Skip to content

Commit 0b9f7af

Browse files
committed
Bump version
1 parent 4421826 commit 0b9f7af

File tree

8 files changed

+92
-88
lines changed

8 files changed

+92
-88
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tapsioss/web-components",
3-
"version": "0.0.0-alpha-3",
3+
"version": "0.0.0-alpha-4",
44
"files": [
55
"dist/**/*.js",
66
"dist/**/*.js.map",

src/bottom-sheet/bottom-sheet.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ export class BottomSheet extends LitElement {
135135
}
136136
}
137137
};
138-
138+
139139
private handleDismiss = (): void => {
140140
this.disappear = true;
141-
141+
142142
this.dispatchEvent(
143143
new CustomEvent('close', {
144144
bubbles: true,

src/bottom-sheet/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import styles from './bottom-sheet.style';
2424
* @cssprop [--tap-bottom-sheet-header-padding=12px]
2525
* @cssprop [--tap-bottom-sheet-background=--tap-sys-color-surface-primary]
2626
* @cssprop [--tap-bottom-sheet-content-overflow-y=scroll]
27-
*
27+
*
2828
* @fires close - Fires when the bottom sheet closes.
2929
*/
3030
@customElement('tap-bottom-sheet')

src/radio-group/radio-group.stories.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ interface ArgTypes {
3131

3232
const Template: Story<ArgTypes> = ({ value, direction }: ArgTypes) => html`
3333
<tap-radio-group value="${value}" direction="${direction}">
34-
<tap-row>
35-
<div slot="leading"><tap-radio value="1"></tap-radio></div>
36-
<div slot="content">
37-
<span>Label for Option 1</span>
38-
</div>
39-
</tap-row>
40-
<tap-row>
41-
<div slot="content">
42-
<tap-radio value="2"></tap-radio>
43-
<span>Label for Option 2</span>
44-
</div>
45-
</tap-row>
46-
34+
<tap-row>
35+
<div slot="leading"><tap-radio value="1"></tap-radio></div>
36+
<div slot="content">
37+
<span>Label for Option 1</span>
38+
</div>
39+
</tap-row>
40+
<tap-row>
41+
<div slot="content">
42+
<tap-radio value="2"></tap-radio>
43+
<span>Label for Option 2</span>
44+
</div>
45+
</tap-row>
46+
4747
<tap-radio value="3"></tap-radio>
4848
<tap-radio value="4"></tap-radio>
4949
</tap-radio-group>

src/radio-group/radio-group.test.ts

+72-68
Original file line numberDiff line numberDiff line change
@@ -5,88 +5,92 @@ import { expect, fixture, html } from '@open-wc/testing';
55
import { RadioGroup } from './radio-group.js';
66

77
describe('tap-radio-group component', () => {
8-
const value = '2';
9-
it('should select the correct radio button based on the initial value', async () => {
10-
const element = await fixture<RadioGroup>(html`
8+
const value = '2';
9+
it('should select the correct radio button based on the initial value', async () => {
10+
const element = await fixture<RadioGroup>(html`
1111
<tap-radio-group value=${value}>
1212
<tap-radio value="1"></tap-radio>
1313
<tap-radio value="2"></tap-radio>
1414
<tap-radio value="3"></tap-radio>
1515
</tap-radio-group>
1616
`);
1717

18-
const radios = element.radios;
18+
const radios = element.radios;
1919

20-
expect(radios.length).to.equal(3);
21-
expect(radios.find(radio => radio.value === value)?.checked).to.be.true;
22-
});
20+
expect(radios.length).to.equal(3);
21+
expect(radios.find((radio) => radio.value === value)?.checked).to.be.true;
22+
});
2323

24-
it('should select a radio button when a nested element is passed', async () => {
25-
const rootElement = await fixture<RadioGroup>(html`
26-
<tap-radio-group value="2">
27-
<div>
28-
<tap-radio value="1"></tap-radio>
29-
</div>
30-
<div>
31-
<tap-radio value="2"></tap-radio>
32-
</div>
33-
<div>
34-
<tap-radio value="3"></tap-radio>
35-
</div>
36-
</tap-radio-group>
37-
`);
24+
it('should select a radio button when a nested element is passed', async () => {
25+
const rootElement = await fixture<RadioGroup>(html`
26+
<tap-radio-group value="2">
27+
<div>
28+
<tap-radio value="1"></tap-radio>
29+
</div>
30+
<div>
31+
<tap-radio value="2"></tap-radio>
32+
</div>
33+
<div>
34+
<tap-radio value="3"></tap-radio>
35+
</div>
36+
</tap-radio-group>
37+
`);
3838

39-
const slot = rootElement.shadowRoot?.querySelector('slot');
40-
const elements = slot!.assignedElements({ flatten: true });
39+
const slot = rootElement.shadowRoot?.querySelector('slot');
40+
const elements = slot!.assignedElements({ flatten: true });
4141

42-
// TODO: use the element.radios
43-
const radios = elements.flatMap(element => {
44-
if (element.nodeType === Node.ELEMENT_NODE) {
45-
const el = element as HTMLElement;
46-
const foundRadios = Array.from(el.querySelectorAll('tap-radio'));
47-
return foundRadios;
48-
}
49-
return [];
50-
});
51-
expect(radios.length).to.equal(3);
52-
expect(radios.find(radio => radio.value === value)?.value).to.equal(value);
42+
// TODO: use the element.radios
43+
const radios = elements.flatMap((element) => {
44+
if (element.nodeType === Node.ELEMENT_NODE) {
45+
const el = element as HTMLElement;
46+
const foundRadios = Array.from(el.querySelectorAll('tap-radio'));
47+
return foundRadios;
48+
}
49+
return [];
5350
});
51+
expect(radios.length).to.equal(3);
52+
expect(radios.find((radio) => radio.value === value)?.value).to.equal(
53+
value,
54+
);
55+
});
5456

55-
it('should handle radio buttons nested inside other elements', async () => {
56-
const rootElement = await fixture<RadioGroup>(html`
57-
<tap-radio-group value=${value}>
58-
<tap-row>
59-
<div slot="leading"><tap-radio value="1"></tap-radio></div>
60-
<div slot="content"><span>Label 1</span></div>
61-
</tap-row>
62-
<tap-row>
63-
<div slot="content">
64-
<tap-radio value="2"></tap-radio>
65-
<span>Label 2</span>
66-
</div>
67-
</tap-row>
68-
<tap-row>
69-
<div slot="content">
70-
<tap-radio value="3"></tap-radio>
71-
<span>Label 3</span>
72-
</div>
73-
</tap-row>
74-
</tap-radio-group>
75-
`);
57+
it('should handle radio buttons nested inside other elements', async () => {
58+
const rootElement = await fixture<RadioGroup>(html`
59+
<tap-radio-group value=${value}>
60+
<tap-row>
61+
<div slot="leading"><tap-radio value="1"></tap-radio></div>
62+
<div slot="content"><span>Label 1</span></div>
63+
</tap-row>
64+
<tap-row>
65+
<div slot="content">
66+
<tap-radio value="2"></tap-radio>
67+
<span>Label 2</span>
68+
</div>
69+
</tap-row>
70+
<tap-row>
71+
<div slot="content">
72+
<tap-radio value="3"></tap-radio>
73+
<span>Label 3</span>
74+
</div>
75+
</tap-row>
76+
</tap-radio-group>
77+
`);
7678

77-
const slot = rootElement.shadowRoot?.querySelector('slot');
78-
const elements = slot!.assignedElements({ flatten: true });
79+
const slot = rootElement.shadowRoot?.querySelector('slot');
80+
const elements = slot!.assignedElements({ flatten: true });
7981

80-
// TODO: use the element.radios
81-
const radios = elements.flatMap(element => {
82-
if (element.nodeType === Node.ELEMENT_NODE) {
83-
const el = element as HTMLElement;
84-
const foundRadios = Array.from(el.querySelectorAll('tap-radio'));
85-
return foundRadios;
86-
}
87-
return [];
88-
});
89-
expect(radios.length).to.equal(3);
90-
expect(radios.find(radio => radio.value === value)?.value).to.equal(value);
82+
// TODO: use the element.radios
83+
const radios = elements.flatMap((element) => {
84+
if (element.nodeType === Node.ELEMENT_NODE) {
85+
const el = element as HTMLElement;
86+
const foundRadios = Array.from(el.querySelectorAll('tap-radio'));
87+
return foundRadios;
88+
}
89+
return [];
9190
});
91+
expect(radios.length).to.equal(3);
92+
expect(radios.find((radio) => radio.value === value)?.value).to.equal(
93+
value,
94+
);
95+
});
9296
});

src/radio-group/radio-group.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class RadioGroup extends LitElement {
2222
radios.push(node);
2323
} else if (node instanceof HTMLElement) {
2424
radios = radios.concat(
25-
findRadios(Array.from(node.querySelectorAll('tap-radio')))
25+
findRadios(Array.from(node.querySelectorAll('tap-radio'))),
2626
);
2727
}
2828
});

src/toast/toast.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class Toast extends LitElement {
138138

139139
@property({ type: Boolean, attribute: 'show-dismiss-button' })
140140
showDismissButton? = false;
141-
141+
142142
@property({ reflect: true })
143143
variant?: 'success' | 'error' | 'info' | 'warning' | 'inverse' = 'inverse';
144144

src/utils/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ export function redispatchEvent(element: Element, event: Event) {
2828
}
2929

3030
return dispatched;
31-
}
31+
}

0 commit comments

Comments
 (0)