@boostdev/design-system-components 1.2.8 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -3
- package/README.md +57 -38
- package/dist/client.cjs +52 -50
- package/dist/client.css +537 -524
- package/dist/client.d.cts +31 -1
- package/dist/client.d.ts +31 -1
- package/dist/client.js +52 -50
- package/dist/index.cjs +52 -50
- package/dist/index.css +537 -524
- package/dist/index.d.cts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +52 -50
- package/dist/native/index.cjs +5 -2
- package/dist/native/index.d.cts +3 -1
- package/dist/native/index.d.ts +3 -1
- package/dist/native/index.js +5 -2
- package/dist/web-components/{chunk-DZRSJGPB.js → chunk-3S42DZ7W.js} +1 -1
- package/dist/web-components/{chunk-3REOIRDW.js → chunk-N3TN6WCH.js} +26 -1
- package/dist/web-components/globals.js +1 -1
- package/dist/web-components/index.js +2 -2
- package/dist/web-components/interaction/bds-button.d.ts +7 -0
- package/dist/web-components/interaction/bds-button.js +1 -1
- package/package.json +3 -3
- package/src/components/interaction/Button/Button.mdx +84 -29
- package/src/components/interaction/Button/Button.module.css +25 -1
- package/src/components/interaction/Button/Button.native.mdx +33 -14
- package/src/components/interaction/Button/Button.native.spec.tsx +20 -0
- package/src/components/interaction/Button/Button.native.stories.tsx +110 -9
- package/src/components/interaction/Button/Button.native.tsx +13 -4
- package/src/components/interaction/Button/Button.spec.tsx +16 -0
- package/src/components/interaction/Button/Button.stories.tsx +134 -16
- package/src/components/interaction/Button/Button.tsx +32 -0
- package/src/components/interaction/Command/Command.module.css +1 -1
- package/src/components/interaction/Dialog/Dialog.module.css +1 -1
- package/src/components/interaction/Dialog/Dialog.native.mdx +2 -2
- package/src/components/interaction/Drawer/Drawer.module.css +1 -1
- package/src/components/interaction/Drawer/Drawer.native.mdx +2 -2
- package/src/components/interaction/DropdownMenu/DropdownMenu.module.css +1 -1
- package/src/components/interaction/DropdownMenu/DropdownMenu.native.mdx +2 -2
- package/src/components/interaction/Popover/Popover.module.css +1 -1
- package/src/components/interaction/Popover/Popover.native.mdx +2 -2
- package/src/components/interaction/Rating/Rating.module.css +1 -1
- package/src/components/interaction/Rating/Rating.native.mdx +1 -1
- package/src/components/interaction/Toast/Toast.module.css +1 -1
- package/src/components/interaction/Toast/Toast.native.mdx +3 -3
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +1 -1
- package/src/components/interaction/form/Checkbox/Checkbox.native.mdx +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.module.css +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.native.mdx +1 -1
- package/src/components/interaction/form/Combobox/Combobox.module.css +1 -1
- package/src/components/interaction/form/Combobox/Combobox.native.mdx +1 -1
- package/src/components/interaction/form/FileInput/FileInput.module.css +1 -1
- package/src/components/interaction/form/FileInput/FileInput.native.mdx +1 -1
- package/src/components/interaction/form/FormInput/FormInput.module.css +1 -1
- package/src/components/interaction/form/FormInput/FormInput.native.mdx +1 -1
- package/src/components/interaction/form/NumberInput/NumberInput.module.css +1 -1
- package/src/components/interaction/form/NumberInput/NumberInput.native.mdx +1 -1
- package/src/components/interaction/form/Radio/Radio.module.css +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.module.css +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.native.mdx +1 -1
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +1 -1
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.native.mdx +1 -1
- package/src/components/interaction/form/Select/Select.module.css +1 -1
- package/src/components/interaction/form/Select/Select.native.mdx +1 -1
- package/src/components/interaction/form/Slider/Slider.module.css +1 -1
- package/src/components/interaction/form/Slider/Slider.native.mdx +1 -1
- package/src/components/interaction/form/Switch/Switch.module.css +1 -1
- package/src/components/interaction/form/Textarea/Textarea.module.css +1 -1
- package/src/components/interaction/form/Textarea/Textarea.native.mdx +1 -1
- package/src/components/interaction/form/atoms/InputContainer.module.css +1 -1
- package/src/components/interaction/form/atoms/Label.module.css +1 -1
- package/src/components/interaction/form/atoms/Message.module.css +1 -1
- package/src/components/layout/ButtonGroup/ButtonGroup.module.css +1 -1
- package/src/components/layout/Card/Card.module.css +1 -1
- package/src/components/layout/IconWrapper/IconWrapper.module.css +1 -1
- package/src/components/layout/IconWrapper/IconWrapper.stories.tsx +46 -14
- package/src/components/layout/SectionHeader/SectionHeader.module.css +1 -1
- package/src/components/ui/Accordion/Accordion.module.css +1 -1
- package/src/components/ui/Accordion/Accordion.native.mdx +1 -1
- package/src/components/ui/Accordion/Accordion.native.stories.tsx +1 -1
- package/src/components/ui/Alert/Alert.module.css +1 -1
- package/src/components/ui/Alert/Alert.native.mdx +1 -1
- package/src/components/ui/Avatar/Avatar.module.css +1 -1
- package/src/components/ui/Avatar/Avatar.native.mdx +1 -1
- package/src/components/ui/Badge/Badge.module.css +1 -1
- package/src/components/ui/Badge/Badge.native.mdx +1 -1
- package/src/components/ui/Breadcrumb/Breadcrumb.module.css +1 -1
- package/src/components/ui/Breadcrumb/Breadcrumb.native.mdx +1 -1
- package/src/components/ui/Calendar/Calendar.module.css +1 -1
- package/src/components/ui/Calendar/Calendar.native.mdx +1 -1
- package/src/components/ui/Carousel/Carousel.module.css +1 -1
- package/src/components/ui/Carousel/Carousel.native.mdx +1 -1
- package/src/components/ui/Collapsible/Collapsible.module.css +1 -1
- package/src/components/ui/Collapsible/Collapsible.native.mdx +1 -1
- package/src/components/ui/DescriptionList/DescriptionList.module.css +1 -1
- package/src/components/ui/DescriptionList/DescriptionList.native.mdx +1 -1
- package/src/components/ui/Link/Link.module.css +1 -1
- package/src/components/ui/Link/Link.native.mdx +1 -1
- package/src/components/ui/Loading/Loading.module.css +1 -1
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +1 -1
- package/src/components/ui/Pagination/Pagination.module.css +1 -1
- package/src/components/ui/Pagination/Pagination.native.mdx +1 -1
- package/src/components/ui/Progress/Progress.module.css +1 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.module.css +1 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.native.mdx +1 -1
- package/src/components/ui/Separator/Separator.module.css +1 -1
- package/src/components/ui/Skeleton/Skeleton.module.css +1 -1
- package/src/components/ui/SkipLink/SkipLink.module.css +1 -1
- package/src/components/ui/Table/Table.module.css +1 -1
- package/src/components/ui/Table/Table.native.mdx +1 -1
- package/src/components/ui/Tabs/Tabs.module.css +1 -1
- package/src/components/ui/Tabs/Tabs.native.mdx +1 -1
- package/src/components/ui/Tooltip/Tooltip.module.css +1 -1
- package/src/components/ui/Tooltip/Tooltip.native.mdx +1 -1
- package/src/components/ui/Typography/Typography.module.css +1 -1
- package/src/components/ui/Typography/Typography.native.mdx +1 -1
- package/src/css/bdc.css +1 -1
- package/src/css/index.css +1 -1
- package/src/stories/DesignSystem/Borders.mdx +3 -3
- package/src/stories/DesignSystem/Colors.mdx +1 -1
- package/src/stories/DesignSystem/DarkMode.mdx +3 -3
- package/src/stories/DesignSystem/Overview.mdx +16 -5
- package/src/stories/DesignSystem/Typography.mdx +1 -1
- package/src/stories/Introduction.mdx +4 -4
- package/src/stories/ReactNative.mdx +6 -6
- package/src/web-components/globals.ts +1 -1
- package/src/web-components/interaction/BdsAccordion.mdx +3 -3
- package/src/web-components/interaction/BdsAccordion.stories.tsx +1 -1
- package/src/web-components/interaction/BdsButton.mdx +48 -16
- package/src/web-components/interaction/BdsButton.stories.tsx +171 -19
- package/src/web-components/interaction/BdsCollapsible.mdx +2 -2
- package/src/web-components/interaction/BdsDialog.mdx +2 -2
- package/src/web-components/interaction/BdsDrawer.mdx +2 -2
- package/src/web-components/interaction/BdsDropdownMenu.mdx +2 -2
- package/src/web-components/interaction/BdsPopover.mdx +1 -1
- package/src/web-components/interaction/BdsSkipLink.mdx +2 -2
- package/src/web-components/interaction/BdsTabs.mdx +2 -2
- package/src/web-components/interaction/BdsToastProvider.mdx +3 -3
- package/src/web-components/interaction/BdsTooltip.mdx +2 -2
- package/src/web-components/interaction/bds-button.spec.ts +35 -0
- package/src/web-components/interaction/bds-button.ts +28 -1
- package/src/web-components/interaction/form/BdsCheckbox.mdx +1 -1
- package/src/web-components/interaction/form/BdsCheckboxGroup.mdx +1 -1
- package/src/web-components/interaction/form/BdsCombobox.mdx +1 -1
- package/src/web-components/interaction/form/BdsFileInput.mdx +1 -1
- package/src/web-components/interaction/form/BdsFormInput.mdx +1 -1
- package/src/web-components/interaction/form/BdsNumberInput.mdx +1 -1
- package/src/web-components/interaction/form/BdsRadio.mdx +1 -1
- package/src/web-components/interaction/form/BdsRadioGroup.mdx +1 -1
- package/src/web-components/interaction/form/BdsSegmentedControl.mdx +1 -1
- package/src/web-components/interaction/form/BdsSelect.mdx +1 -1
- package/src/web-components/interaction/form/BdsSlider.mdx +1 -1
- package/src/web-components/interaction/form/BdsSwitch.mdx +1 -1
- package/src/web-components/interaction/form/BdsTextarea.mdx +1 -1
- package/src/web-components/ui/BdsAlert.mdx +1 -1
- package/src/web-components/ui/BdsAvatar.mdx +1 -1
- package/src/web-components/ui/BdsBadge.mdx +1 -1
- package/src/web-components/ui/BdsBreadcrumb.mdx +1 -1
- package/src/web-components/ui/BdsButtonGroup.mdx +1 -1
- package/src/web-components/ui/BdsCalendar.mdx +1 -1
- package/src/web-components/ui/BdsCard.mdx +1 -1
- package/src/web-components/ui/BdsCarousel.mdx +1 -1
- package/src/web-components/ui/BdsDescriptionList.mdx +1 -1
- package/src/web-components/ui/BdsIconWrapper.mdx +1 -1
- package/src/web-components/ui/BdsLink.mdx +1 -1
- package/src/web-components/ui/BdsLoading.mdx +1 -1
- package/src/web-components/ui/BdsNotificationBanner.mdx +1 -1
- package/src/web-components/ui/BdsPagination.mdx +1 -1
- package/src/web-components/ui/BdsProgress.mdx +1 -1
- package/src/web-components/ui/BdsProgressCircle.mdx +1 -1
- package/src/web-components/ui/BdsRating.mdx +1 -1
- package/src/web-components/ui/BdsSectionHeader.mdx +1 -1
- package/src/web-components/ui/BdsSeparator.mdx +2 -2
- package/src/web-components/ui/BdsSkeleton.mdx +1 -1
- package/src/web-components/ui/BdsTable.mdx +1 -1
- package/src/web-components/ui/BdsTypography.mdx +1 -1
|
@@ -12,14 +12,14 @@ Framework-agnostic Skip Navigation Link custom element. Visually hidden until fo
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
|
-
import '@boostdev/components/web-components';
|
|
15
|
+
import '@boostdev/design-system-components/web-components';
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Or in HTML without a bundler:
|
|
19
19
|
|
|
20
20
|
```html
|
|
21
21
|
<script type="module">
|
|
22
|
-
import '@boostdev/components/web-components';
|
|
22
|
+
import '@boostdev/design-system-components/web-components';
|
|
23
23
|
</script>
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -12,14 +12,14 @@ Framework-agnostic Tabs custom element. Coordinates `<bds-tab>` and `<bds-tab-pa
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
|
-
import '@boostdev/components/web-components';
|
|
15
|
+
import '@boostdev/design-system-components/web-components';
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Or in HTML without a bundler:
|
|
19
19
|
|
|
20
20
|
```html
|
|
21
21
|
<script type="module">
|
|
22
|
-
import '@boostdev/components/web-components';
|
|
22
|
+
import '@boostdev/design-system-components/web-components';
|
|
23
23
|
</script>
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -12,7 +12,7 @@ Framework-agnostic toast notification provider. Wrap your page content in `<bds-
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
|
-
import '@boostdev/components/web-components';
|
|
15
|
+
import '@boostdev/design-system-components/web-components';
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Examples
|
|
@@ -34,7 +34,7 @@ import '@boostdev/components/web-components';
|
|
|
34
34
|
### 1. Static method (import required)
|
|
35
35
|
|
|
36
36
|
```js
|
|
37
|
-
import { BdsToastProvider } from '@boostdev/components/web-components';
|
|
37
|
+
import { BdsToastProvider } from '@boostdev/design-system-components/web-components';
|
|
38
38
|
|
|
39
39
|
BdsToastProvider.show('File saved', 'success');
|
|
40
40
|
BdsToastProvider.show('Something went wrong', 'error');
|
|
@@ -75,7 +75,7 @@ document.dispatchEvent(new CustomEvent('bds-show-toast', {
|
|
|
75
75
|
</bds-toast-provider>
|
|
76
76
|
|
|
77
77
|
<script type="module">
|
|
78
|
-
import '@boostdev/components/web-components';
|
|
78
|
+
import '@boostdev/design-system-components/web-components';
|
|
79
79
|
// or use the document event API — no import needed
|
|
80
80
|
</script>
|
|
81
81
|
```
|
|
@@ -12,14 +12,14 @@ Framework-agnostic Tooltip custom element. Displays a small informational label
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
|
-
import '@boostdev/components/web-components';
|
|
15
|
+
import '@boostdev/design-system-components/web-components';
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Or in HTML without a bundler:
|
|
19
19
|
|
|
20
20
|
```html
|
|
21
21
|
<script type="module">
|
|
22
|
-
import '@boostdev/components/web-components';
|
|
22
|
+
import '@boostdev/design-system-components/web-components';
|
|
23
23
|
</script>
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -92,4 +92,39 @@ describe('bds-button', () => {
|
|
|
92
92
|
expect(a!.getAttribute('rel')).toBe('noopener');
|
|
93
93
|
cleanup(el);
|
|
94
94
|
});
|
|
95
|
+
|
|
96
|
+
it('applies is-icon-only class when is-icon-only is set', async () => {
|
|
97
|
+
const el = await fixture('<bds-button is-icon-only aria-label="Confirm"><svg></svg></bds-button>');
|
|
98
|
+
const btn = el.shadowRoot!.querySelector('button');
|
|
99
|
+
expect(btn!.className).toContain('is-icon-only');
|
|
100
|
+
cleanup(el);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('does not apply is-icon-only class by default', async () => {
|
|
104
|
+
const el = await fixture('<bds-button>Click</bds-button>');
|
|
105
|
+
const btn = el.shadowRoot!.querySelector('button');
|
|
106
|
+
expect(btn!.className).not.toContain('is-icon-only');
|
|
107
|
+
cleanup(el);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('reflects the is-icon-only attribute on the host', async () => {
|
|
111
|
+
const el = await fixture('<bds-button is-icon-only aria-label="Confirm"></bds-button>');
|
|
112
|
+
expect(el.hasAttribute('is-icon-only')).toBe(true);
|
|
113
|
+
cleanup(el);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('composes is-icon-only with outline variant', async () => {
|
|
117
|
+
const el = await fixture('<bds-button variant="outline" is-icon-only aria-label="Confirm"></bds-button>');
|
|
118
|
+
const btn = el.shadowRoot!.querySelector('button');
|
|
119
|
+
expect(btn!.className).toContain('outline');
|
|
120
|
+
expect(btn!.className).toContain('is-icon-only');
|
|
121
|
+
cleanup(el);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('forwards aria-label to the inner button', async () => {
|
|
125
|
+
const el = await fixture('<bds-button is-icon-only aria-label="Close"></bds-button>');
|
|
126
|
+
const btn = el.shadowRoot!.querySelector('button');
|
|
127
|
+
expect(btn!.getAttribute('aria-label')).toBe('Close');
|
|
128
|
+
cleanup(el);
|
|
129
|
+
});
|
|
95
130
|
});
|
|
@@ -14,6 +14,7 @@ export type ButtonSize = 'small' | 'medium' | 'large';
|
|
|
14
14
|
* target — forwarded to <a> when href is set
|
|
15
15
|
* rel — forwarded to <a> when href is set
|
|
16
16
|
* has-pulse — boolean, enables the pulse ring animation
|
|
17
|
+
* is-icon-only — boolean, forces a 1:1 aspect ratio with minimal xs padding (requires aria-label)
|
|
17
18
|
* type — "button" (default) | "submit" | "reset"
|
|
18
19
|
*
|
|
19
20
|
* Slots:
|
|
@@ -114,6 +115,23 @@ export class BdsButton extends LitElement {
|
|
|
114
115
|
animation: pulse 3s infinite;
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
/* Icon-only: square (1:1), equal xs padding on both axes — composes with
|
|
119
|
+
any variant/size. box-sizing: border-box keeps the outer box at
|
|
120
|
+
--button_height; without it, all: unset reverts to content-box and
|
|
121
|
+
padding-block would stretch the button past its declared height.
|
|
122
|
+
Slotted child fills the content area (button height minus the two
|
|
123
|
+
padding sides) so SVG icons scale with button size. */
|
|
124
|
+
.button.is-icon-only {
|
|
125
|
+
aspect-ratio: 1;
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
padding: var(--bds-space_xs);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host([is-icon-only]) ::slotted(*) {
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
block-size: 100%;
|
|
133
|
+
}
|
|
134
|
+
|
|
117
135
|
/* SVG icon colour */
|
|
118
136
|
.button svg {
|
|
119
137
|
--icon__stroke: currentcolor;
|
|
@@ -141,6 +159,12 @@ export class BdsButton extends LitElement {
|
|
|
141
159
|
transition: var(--bds-animation_transition);
|
|
142
160
|
}
|
|
143
161
|
|
|
162
|
+
/* Icon-only: zero out icon slot margins so icon centres */
|
|
163
|
+
.button.is-icon-only .icon-start.has-content,
|
|
164
|
+
.button.is-icon-only .icon-end.has-content {
|
|
165
|
+
margin-inline: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
144
168
|
/* Hover icon animation */
|
|
145
169
|
@media (hover: hover) and (pointer: fine) {
|
|
146
170
|
.button:hover .icon-start svg,
|
|
@@ -189,6 +213,7 @@ export class BdsButton extends LitElement {
|
|
|
189
213
|
target: { type: String },
|
|
190
214
|
rel: { type: String },
|
|
191
215
|
hasPulse: { type: Boolean, attribute: 'has-pulse', reflect: true },
|
|
216
|
+
isIconOnly: { type: Boolean, attribute: 'is-icon-only', reflect: true },
|
|
192
217
|
type: { type: String },
|
|
193
218
|
ariaLabel: { type: String, attribute: 'aria-label' },
|
|
194
219
|
// Internal state
|
|
@@ -205,6 +230,7 @@ export class BdsButton extends LitElement {
|
|
|
205
230
|
declare target: string | undefined;
|
|
206
231
|
declare rel: string | undefined;
|
|
207
232
|
declare hasPulse: boolean;
|
|
233
|
+
declare isIconOnly: boolean;
|
|
208
234
|
declare type: 'button' | 'submit' | 'reset';
|
|
209
235
|
declare ariaLabel: string | null;
|
|
210
236
|
declare private _iconStartFilled: boolean;
|
|
@@ -216,6 +242,7 @@ export class BdsButton extends LitElement {
|
|
|
216
242
|
this.size = 'medium';
|
|
217
243
|
this.disabled = false;
|
|
218
244
|
this.hasPulse = false;
|
|
245
|
+
this.isIconOnly = false;
|
|
219
246
|
this.type = 'button';
|
|
220
247
|
this.ariaLabel = null;
|
|
221
248
|
this._iconStartFilled = false;
|
|
@@ -233,7 +260,7 @@ export class BdsButton extends LitElement {
|
|
|
233
260
|
}
|
|
234
261
|
|
|
235
262
|
private get _classes() {
|
|
236
|
-
return `button ${this.variant} ${this.size}${this.hasPulse ? ' has-pulse' : ''}`;
|
|
263
|
+
return `button ${this.variant} ${this.size}${this.hasPulse ? ' has-pulse' : ''}${this.isIconOnly ? ' is-icon-only' : ''}`;
|
|
237
264
|
}
|
|
238
265
|
|
|
239
266
|
private _handleAnchorClick(e: MouseEvent) {
|
|
@@ -13,14 +13,14 @@ Framework-agnostic Separator custom element. Renders a thin decorative line to v
|
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
15
|
// Register all web components at once
|
|
16
|
-
import '@boostdev/components/web-components';
|
|
16
|
+
import '@boostdev/design-system-components/web-components';
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Or in HTML without a bundler:
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
22
|
<script type="module">
|
|
23
|
-
import '@boostdev/components/web-components';
|
|
23
|
+
import '@boostdev/design-system-components/web-components';
|
|
24
24
|
</script>
|
|
25
25
|
```
|
|
26
26
|
|