Skip to content

Commit

Permalink
Remove shadowed kol-span component
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvg authored Jul 19, 2024
2 parents c134b7a + e16f4c2 commit 9eff307
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 72 deletions.
2 changes: 0 additions & 2 deletions packages/components/src/components/component-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import { KolProcess } from './progress/shadow';
import { KolQuote } from './quote/shadow';
import { KolSelect } from './select/shadow';
import { KolSkipNav } from './skip-nav/shadow';
import { KolSpan } from './span/shadow';
import { KolSpanWc } from './span/component';
import { KolSpin } from './spin/shadow';
import { KolSplitButton } from './split-button/shadow';
Expand Down Expand Up @@ -112,7 +111,6 @@ export const COMPONENTS = [
KolQuote,
KolSelect,
KolSkipNav,
KolSpan,
KolSpanWc,
KolSpin,
KolSplitButton,
Expand Down
46 changes: 0 additions & 46 deletions packages/components/src/components/span/shadow.tsx

This file was deleted.

16 changes: 1 addition & 15 deletions packages/components/src/components/span/test/html.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const getSpanWcHtml = (

const hideExpertSlot = !showExpertSlot(state._label);
const icon = mapIconProp2State(state._icons as KoliBriIconsProp);
const classNames: string[] = [...(state._hideLabel === true ? [`hide-label`] : []), ...(options?.additionalClassNames ?? [])];
const classNames: string[] = ['kol-span-wc', ...(state._hideLabel === true ? [`hide-label`] : []), ...(options?.additionalClassNames ?? [])];

return `
<kol-span-wc${classNames.length ? ` class="${classNames.join(' ')}"` : ``}${options?.additionalAttrs ?? ''}>
Expand Down Expand Up @@ -84,17 +84,3 @@ export const getSpanWcHtml = (
}
</kol-span-wc>`;
};

export const getSpanHtml = (
props: SpanProps,
slots: Slots = {
expert: `<slot name="expert" slot="expert"></slot>`,
},
): string => {
return `
<kol-span>
<mock:shadow-root>
${getSpanWcHtml(props, slots, { additionalClassNames: ['kol-span', 'kol-span-wc'] })}
</mock:shadow-root>
</kol-span>`;
};
10 changes: 4 additions & 6 deletions packages/components/src/components/span/test/snapshot.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ import { executeTests } from 'stencil-awesome-test';
import { h } from '@stencil/core';
import { newSpecPage } from '@stencil/core/testing';

import { getSpanHtml } from './html.mock';

import type { SpecPage } from '@stencil/core/testing';
import type { SpanProps } from '../../../schema';
import { KolSpan } from '../shadow';
import { KolSpanWc } from '../component';
import { getSpanWcHtml } from './html.mock';

executeTests<SpanProps>(
'Span',
async (props): Promise<SpecPage> => {
const page = await newSpecPage({
components: [KolSpan, KolSpanWc],
template: () => <kol-span {...props} />,
components: [KolSpanWc],
template: () => <kol-span-wc {...props} />,
});
return page;
},
Expand All @@ -24,7 +22,7 @@ executeTests<SpanProps>(
_hideLabel: [true, false],
_label: ['Text', ''],
},
getSpanHtml,
getSpanWcHtml,
{
execMode: 'default', // ready
},
Expand Down
2 changes: 0 additions & 2 deletions packages/components/src/core/component-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export let KolProgressTag = 'kol-progress' as const;
export let KolQuoteTag = 'kol-quote' as const;
export let KolSelectTag = 'kol-select' as const;
export let KolSkipNavTag = 'kol-skip-nav' as const;
export let KolSpanTag = 'kol-span' as const;
export let KolSpanWcTag = 'kol-span-wc' as const;
export let KolSpinTag = 'kol-spin' as const;
export let KolSplitButtonTag = 'kol-split-button' as const;
Expand Down Expand Up @@ -113,7 +112,6 @@ export const setCustomTagNames = (transformTagName: (tagName: string) => string)
KolQuoteTag = transformTagName(KolQuoteTag as string) as 'kol-quote';
KolSelectTag = transformTagName(KolSelectTag as string) as 'kol-select';
KolSkipNavTag = transformTagName(KolSkipNavTag as string) as 'kol-skip-nav';
KolSpanTag = transformTagName(KolSpanTag as string) as 'kol-span';
KolSpanWcTag = transformTagName(KolSpanWcTag as string) as 'kol-span-wc';
KolSpinTag = transformTagName(KolSpinTag as string) as 'kol-spin';
KolSplitButtonTag = transformTagName(KolSplitButtonTag as string) as 'kol-split-button';
Expand Down
1 change: 0 additions & 1 deletion packages/components/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const EXCLUDE_TAGS = [
'kol-input',
'kol-link-wc',
'kol-popover-wc',
'kol-span',
'kol-span-wc',
'kol-table-stateless-wc',
'kol-tooltip-wc',
Expand Down

0 comments on commit 9eff307

Please sign in to comment.