@boostdev/design-system-components 2.7.0 → 2.7.1
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 +102 -2
- package/dist/client.cjs +52 -52
- package/dist/client.css +548 -548
- package/dist/client.js +52 -52
- package/dist/index.cjs +52 -52
- package/dist/index.css +548 -548
- package/dist/index.js +52 -52
- package/dist/web-components/{chunk-T6AETZRP.js → chunk-3GFWLSLS.js} +1 -1
- package/dist/web-components/{chunk-N6IMUOY4.js → chunk-65JXQOBA.js} +3 -3
- package/dist/web-components/{chunk-ZTC6GRP7.js → chunk-BKIHQYJR.js} +1 -0
- package/dist/web-components/{chunk-X3FKVHLK.js → chunk-CM3KYZ6Z.js} +1 -1
- package/dist/web-components/{chunk-QLZ2362S.js → chunk-CZBIVR4V.js} +1 -1
- package/dist/web-components/{chunk-GER5UJOF.js → chunk-F5E3IT7G.js} +1 -3
- package/dist/web-components/{chunk-UFFCKVZE.js → chunk-FXURM6D5.js} +1 -1
- package/dist/web-components/{chunk-HHHRF2PS.js → chunk-IYGF6CD5.js} +1 -1
- package/dist/web-components/{chunk-OCODKRVZ.js → chunk-KUI55GFB.js} +2 -2
- package/dist/web-components/{chunk-ZNKEZIYE.js → chunk-NCPQ7AF3.js} +3 -2
- package/dist/web-components/{chunk-RTOS7LLG.js → chunk-PC3IOQAH.js} +3 -8
- package/dist/web-components/{chunk-JUKB3BUP.js → chunk-PXZWYO6Z.js} +1 -1
- package/dist/web-components/{chunk-EBJM3VD4.js → chunk-QBB6ZX4R.js} +1 -1
- package/dist/web-components/{chunk-ECW3HHWA.js → chunk-TQ7IQ4GZ.js} +7 -2
- package/dist/web-components/{chunk-AJSXNDAP.js → chunk-X46KL5BK.js} +19 -18
- package/dist/web-components/{chunk-XNA6WTXG.js → chunk-Y3POAKGS.js} +1 -1
- package/dist/web-components/{chunk-HGBNDR22.js → chunk-Y7V7LM6R.js} +1 -1
- package/dist/web-components/index.js +23 -19
- package/dist/web-components/interaction/bds-accordion-item.js +1 -1
- package/dist/web-components/interaction/bds-accordion.js +1 -1
- package/dist/web-components/interaction/bds-button.js +1 -1
- package/dist/web-components/interaction/bds-dialog.js +1 -1
- package/dist/web-components/interaction/bds-drawer.js +1 -1
- package/dist/web-components/interaction/bds-popover.js +1 -1
- package/dist/web-components/interaction/bds-tooltip.js +1 -1
- package/dist/web-components/interaction/form/bds-checkbox.js +1 -1
- package/dist/web-components/interaction/form/bds-combobox.js +1 -1
- package/dist/web-components/interaction/form/bds-number-input.js +1 -1
- package/dist/web-components/interaction/form/bds-radio.js +1 -1
- package/dist/web-components/interaction/form/bds-select.js +1 -1
- package/dist/web-components/interaction/form/bds-switch.js +1 -1
- package/dist/web-components/interaction/form/bds-textarea.js +1 -1
- package/dist/web-components/ui/bds-alert.js +1 -1
- package/dist/web-components/ui/bds-card.d.ts +3 -9
- package/dist/web-components/ui/bds-card.js +1 -1
- package/dist/web-components/ui/bds-notification-banner.js +1 -1
- package/package.json +2 -1
- package/src/components/layout/IconWrapper/IconWrapper.module.css +2 -2
- package/src/test/token-contract.spec.ts +86 -0
- package/src/web-components/interaction/bds-accordion-item.ts +1 -1
- package/src/web-components/interaction/bds-accordion.ts +1 -0
- package/src/web-components/interaction/bds-button.ts +1 -3
- package/src/web-components/interaction/bds-dialog.ts +3 -3
- package/src/web-components/interaction/bds-drawer.ts +2 -2
- package/src/web-components/interaction/bds-popover.ts +7 -2
- package/src/web-components/interaction/bds-tooltip.ts +1 -1
- package/src/web-components/interaction/form/bds-checkbox.ts +1 -1
- package/src/web-components/interaction/form/bds-combobox.ts +1 -1
- package/src/web-components/interaction/form/bds-form-input.ts +1 -1
- package/src/web-components/interaction/form/bds-number-input.ts +1 -1
- package/src/web-components/interaction/form/bds-radio.ts +1 -1
- package/src/web-components/interaction/form/bds-select.ts +1 -1
- package/src/web-components/interaction/form/bds-switch.ts +1 -1
- package/src/web-components/interaction/form/bds-textarea.ts +1 -1
- package/src/web-components/ui/BdsCard.mdx +4 -3
- package/src/web-components/ui/BdsCard.stories.tsx +7 -11
- package/src/web-components/ui/BdsSkeleton.stories.tsx +4 -4
- package/src/web-components/ui/bds-alert.ts +3 -2
- package/src/web-components/ui/bds-card.spec.ts +3 -5
- package/src/web-components/ui/bds-card.ts +5 -12
- package/src/web-components/ui/bds-notification-banner.ts +19 -18
- package/src/web-components/ui/bds-pagination.ts +1 -1
- package/src/web-components/ui/bds-table.ts +4 -0
package/AGENTS.md
CHANGED
|
@@ -80,7 +80,7 @@ Also: never define story component functions inside a `render: () => { function
|
|
|
80
80
|
Component-scoped variables use **inline fallbacks**, not top-level declarations. The default value lives inside the `var()` call; state overrides (`:focus`, error modifier, etc.) set the variable on the rule where they apply:
|
|
81
81
|
|
|
82
82
|
```css
|
|
83
|
-
/*
|
|
83
|
+
/* correct — default is the fallback, state sets the var */
|
|
84
84
|
.input {
|
|
85
85
|
border: 1px solid var(--input_border-color, currentcolor);
|
|
86
86
|
}
|
|
@@ -88,7 +88,7 @@ Component-scoped variables use **inline fallbacks**, not top-level declarations.
|
|
|
88
88
|
--input_border-color: var(--bds-color_interactive);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
/*
|
|
91
|
+
/* wrong — declaring defaults at the element level */
|
|
92
92
|
.input {
|
|
93
93
|
--input_border-color: var(--bds-color_on-bg);
|
|
94
94
|
border: 1px solid var(--input_border-color);
|
|
@@ -97,6 +97,20 @@ Component-scoped variables use **inline fallbacks**, not top-level declarations.
|
|
|
97
97
|
|
|
98
98
|
For **border colours** that should match surrounding text/icon colour, use `currentcolor` as the fallback rather than a specific token.
|
|
99
99
|
|
|
100
|
+
### Consumer override surface
|
|
101
|
+
|
|
102
|
+
Every `var(--{component}_{property}, fallback)` reference in a component's CSS module is a **public override point**. Consumers restyle components by setting these properties on the element or any ancestor -- no `@layer` or specificity tricks needed.
|
|
103
|
+
|
|
104
|
+
**Naming convention**: `--{component}_{property}` (e.g. `--button_color`, `--card_shadow--default`, `--input_radius`). Variant-specific overrides append a variant suffix: `--alert_bg--success`, `--badge_text--error`. Hover/active state overrides append a state suffix: `--button_bg--hover`, `--dropdown_item-bg--hover`.
|
|
105
|
+
|
|
106
|
+
**Discovering available overrides**:
|
|
107
|
+
- **MCP server**: call `ds_get_component` -- it returns all overridable CSS custom properties with their default fallbacks.
|
|
108
|
+
- **Source**: read the component's `.module.css` file and look for `var(--{component}_...)` calls.
|
|
109
|
+
|
|
110
|
+
Internal coordination variables (set via inline styles in the TSX, such as `--control_count`, `--control_selected-index`, `--slider_fill`, `--fieldGroup_field-count`) are **not** part of the override surface -- they are implementation details.
|
|
111
|
+
|
|
112
|
+
> A `@token` annotation convention for explicit declaration of the override surface may be added in the future.
|
|
113
|
+
|
|
100
114
|
### bdc border tokens
|
|
101
115
|
|
|
102
116
|
Components use `box-shadow: inset` (not `outline` or `border`) for all visual frame edges via `--bdc_*` tokens defined in `src/css/bdc.css`. This keeps `outline` exclusively for `:focus-visible` rings. Set local values on the component rule:
|
|
@@ -173,6 +187,34 @@ box-shadow: var(--component_focus-ring, 0 0 0 2px rgb(from var(--bds-color_inter
|
|
|
173
187
|
```
|
|
174
188
|
Error focus rings substitute `--bds-color_error` for `--bds-color_interactive`.
|
|
175
189
|
|
|
190
|
+
### Semantic vs raw token layers
|
|
191
|
+
|
|
192
|
+
The foundation token set (`--bds-*`) contains two conceptual layers. Understanding the distinction helps component authors choose the right token and keeps the override surface predictable.
|
|
193
|
+
|
|
194
|
+
**Raw scale tokens** (implementation detail, subject to change between minor versions):
|
|
195
|
+
- Space scale: `--bds-space_xxs`, `--bds-space_xs`, `--bds-space_s`, `--bds-space_m`, `--bds-space_l`, `--bds-space_xl`, `--bds-space_xxl`
|
|
196
|
+
- Border radius scale: `--bds-border_radius--xs`, `--bds-border_radius--s`, `--bds-border_radius--m`, `--bds-border_radius--full`, `--bds-border_radius--circle`
|
|
197
|
+
- Shadow elevation scale: `--bds-shadow_s`, `--bds-shadow_m`, `--bds-shadow_l`, `--bds-shadow_xl`, `--bds-shadow_2xl`
|
|
198
|
+
- Font size scale: `--bds-font_size--body--s`, `--bds-font_size--body`, `--bds-font_size--heading-3`, etc.
|
|
199
|
+
|
|
200
|
+
**Semantic tokens** (stable API, encode design decisions):
|
|
201
|
+
- Colour roles: `--bds-color_interactive`, `--bds-color_error`, `--bds-color_bg`, `--bds-color_on-bg`, `--bds-color_success`, `--bds-color_warning`
|
|
202
|
+
- Active state: `--bdc-color_active`, `--bdc-color_on-active`, `--bdc-color_active--subtle`
|
|
203
|
+
- Layout: `--bds-grid_gap`, `--bds-grid_template-columns`, `--bds-container_max-width`
|
|
204
|
+
- Focus: `--bds-outline_default`, `--bds-outline_color`, `--bds-outline_offset`
|
|
205
|
+
|
|
206
|
+
**Recommendation for component authors**:
|
|
207
|
+
- Prefer semantic tokens over raw scale tokens where a semantic equivalent exists (e.g. use `--bds-color_interactive` not a specific blue palette token).
|
|
208
|
+
- When referencing a raw scale token, wrap it inside a component-local variable so the value can be overridden without depending on the scale:
|
|
209
|
+
```css
|
|
210
|
+
/* correct — consumer can override --card_padding without knowing the scale */
|
|
211
|
+
padding: var(--card_padding, var(--bds-space_m));
|
|
212
|
+
|
|
213
|
+
/* avoid — locks the consumer into the foundation scale */
|
|
214
|
+
padding: var(--bds-space_m);
|
|
215
|
+
```
|
|
216
|
+
- This two-level fallback pattern (`--component_property, --bds-scale_token`) keeps the component API stable even if the foundation scale changes.
|
|
217
|
+
|
|
176
218
|
## Import paths
|
|
177
219
|
|
|
178
220
|
```ts
|
|
@@ -265,6 +307,64 @@ Key patterns:
|
|
|
265
307
|
7. Meet all accessibility requirements listed above
|
|
266
308
|
8. After changes: `pnpm build`, `pnpm typecheck`, `pnpm lint`, `pnpm lint:css`, `pnpm test`
|
|
267
309
|
|
|
310
|
+
## Component token API surface
|
|
311
|
+
|
|
312
|
+
Component-local CSS custom properties are **public API**. They form the theming and override surface that consumers depend on.
|
|
313
|
+
|
|
314
|
+
**Versioning rules**:
|
|
315
|
+
- **Removing or renaming** a component token is a **BREAKING CHANGE** requiring a major version bump.
|
|
316
|
+
- **Adding** a new component token is a minor or patch change (additive, non-breaking).
|
|
317
|
+
- **Changing a token's default fallback** is a minor change if it alters visual output, patch if corrective.
|
|
318
|
+
|
|
319
|
+
The following table lists every component-local token extracted from `src/components/**/*.module.css`. Tokens prefixed with `--bds-*` (foundation) and `--bdc*` (shared border system) are excluded -- those are owned by the foundation or `bdc.css`, not by individual components. Internal coordination variables set via inline styles in TSX are also excluded.
|
|
320
|
+
|
|
321
|
+
| Component | Tokens |
|
|
322
|
+
|---|---|
|
|
323
|
+
| Accordion | `--accordion_border`, `--accordion_radius`, `--accordion_trigger-bg--hover` |
|
|
324
|
+
| Alert | `--alert_bg`, `--alert_text`, `--alert_border`, `--alert_bg--info`, `--alert_text--info`, `--alert_border--info`, `--alert_bg--success`, `--alert_text--success`, `--alert_border--success`, `--alert_bg--warning`, `--alert_text--warning`, `--alert_border--warning`, `--alert_bg--error`, `--alert_text--error`, `--alert_border--error`, `--alert_dismiss-border`, `--alert_dismiss-radius`, `--alert_dismiss-opacity--hover` |
|
|
325
|
+
| Avatar | `--avatar_size`, `--avatar_radius`, `--avatar_bg`, `--avatar_text` |
|
|
326
|
+
| Badge | `--badge_radius`, `--badge_font-size`, `--badge_bg`, `--badge_text`, `--badge_bg--primary`, `--badge_text--primary`, `--badge_bg--secondary`, `--badge_text--secondary`, `--badge_bg--success`, `--badge_text--success`, `--badge_bg--error`, `--badge_text--error`, `--badge_bg--warning`, `--badge_text--warning` |
|
|
327
|
+
| Button | `--button_color`, `--button_on-color`, `--button_color--on-bg`, `--button_radius`, `--button_height`, `--button_font-size`, `--button_bg`, `--button_text`, `--button_border`, `--button_pulse-color`, `--button_bg--hover`, `--button_text--hover`, `--button_border--hover`, `--button_pulse-color--hover`, `--button_bg--outline`, `--button_text--outline`, `--button_border--outline`, `--button_bg--outline-hover`, `--button_text--outline-hover`, `--button_border--outline-hover` |
|
|
328
|
+
| Calendar | `--calendar_border`, `--calendar_radius`, `--calendar_shadow`, `--calendar_button-radius`, `--calendar_navBtn-bg--hover`, `--calendar_day-bg--hover`, `--calendar_today-color`, `--calendar_today-border`, `--calendar_day-bg--selected`, `--calendar_day-color--selected` |
|
|
329
|
+
| Card | `--card_color`, `--card_on-color`, `--card_shadow--default`, `--card_shadow--elevated`, `--card_shadow--outlined`, `--card_border`, `--card_padding`, `--card_shadow--clickable-hover`, `--card_shadow--default-hover`, `--card_shadow--elevated-hover`, `--card_shadow--outlined-hover` |
|
|
330
|
+
| Carousel | `--carousel_indicator-radius`, `--carousel_navBtn-bg--hover` |
|
|
331
|
+
| Checkbox | `--checkbox_color`, `--checkbox_border`, `--checkbox_radius`, `--checkbox_shadow`, `--checkbox_color_bg`, `--checkbox_color-active`, `--checkbox_color-on-active` |
|
|
332
|
+
| Collapsible | `--collapsible_border-width`, `--collapsible_border-color`, `--collapsible_border-radius`, `--collapsible_color`, `--collapsible_bg`, `--collapsible_bg--hover`, `--collapsible_on-color` |
|
|
333
|
+
| Combobox | `--combobox_border`, `--combobox_radius`, `--combobox_shadow`, `--combobox_color_bg`, `--combobox_color`, `--combobox_on-color`, `--combobox_listbox-border`, `--combobox_listbox-radius`, `--combobox_listbox-shadow`, `--combobox_option-bg--highlighted`, `--combobox_option-color--highlighted` |
|
|
334
|
+
| Command | `--command_color`, `--command_on-color`, `--command_border`, `--command_shadow`, `--command_item-bg--active` |
|
|
335
|
+
| Dialog | `--dialog_border`, `--dialog_radius`, `--dialog_shadow`, `--dialog_color`, `--dialog_on-color`, `--dialog_close-radius`, `--dialog_close-border` |
|
|
336
|
+
| Drawer | `--drawer_color`, `--drawer_on-color`, `--drawer_close-radius`, `--drawer_close-bg--hover` |
|
|
337
|
+
| DropdownMenu | `--dropdown_border`, `--dropdown_radius`, `--dropdown_color`, `--dropdown_on-color`, `--dropdown_shadow`, `--dropdown_item-bg--hover`, `--dropdown_item-color--hover` |
|
|
338
|
+
| FieldGroup | `--fieldGroup_gap`, `--fieldGroup_min-field-width`, `--fieldGroup_legend-padding-block`, `--fieldGroup_legend-gap`, `--fieldGroup_legend-border-block-end`, `--fieldGroup_legend-color`, `--fieldGroup_legend-font-size`, `--fieldGroup_legend-font-weight`, `--fieldGroup_legend-line-height` |
|
|
339
|
+
| FileInput | `--fileInput_color`, `--fileInput_border-color`, `--fileInput_border-color--hover`, `--fileInput_bg--hover` |
|
|
340
|
+
| FormInput | `--input_border`, `--input_radius`, `--input_shadow`, `--input_color`, `--input_color_bg` |
|
|
341
|
+
| Grid | `--grid_gap`, `--grid_columns` |
|
|
342
|
+
| IconWrapper | `--icon-wrapper-radius`, `--icon-wrapper-color`, `--icon-wrapper_on-color` |
|
|
343
|
+
| Link | `--link_color`, `--link_color-hover`, `--link_color--default`, `--link_color-hover--default`, `--link_color--subtle`, `--link_color-hover--subtle`, `--link_color--standalone`, `--link_color-hover--standalone` |
|
|
344
|
+
| Loading | `--loading_radius` |
|
|
345
|
+
| NotificationBanner | `--banner_bg`, `--banner_text`, `--banner_border`, `--banner_bg--info`, `--banner_text--info`, `--banner_border--info`, `--banner_bg--success`, `--banner_text--success`, `--banner_border--success`, `--banner_bg--warning`, `--banner_text--warning`, `--banner_border--warning`, `--banner_bg--error`, `--banner_text--error`, `--banner_border--error`, `--banner_dismiss-radius`, `--banner_dismiss-border`, `--banner_dismiss-opacity--hover` |
|
|
346
|
+
| NumberInput | `--numberInput_border`, `--numberInput_radius`, `--numberInput_shadow`, `--numberInput_color`, `--numberInput_stepper-bg`, `--numberInput_stepper-color`, `--numberInput_stepper-bg--hover`, `--numberInput_stepper-opacity--hover` |
|
|
347
|
+
| Pagination | `--pagination_radius`, `--btn_bg`, `--btn_color`, `--btn_border`, `--btn_bg--hover`, `--btn_color--hover`, `--btn_bg--active`, `--btn_color--active`, `--btn_border--active` |
|
|
348
|
+
| Popover | `--popover_z-index`, `--popover_max-width`, `--popover_max-height`, `--popover_border`, `--popover_radius`, `--popover_color`, `--popover_on-color`, `--popover_shadow` |
|
|
349
|
+
| Progress | `--progress_height`, `--progress_radius`, `--progress_color-active` |
|
|
350
|
+
| ProgressCircle | `--progressCircle_color-active` |
|
|
351
|
+
| Radio | `--radio_color`, `--radio_border`, `--radio_radius`, `--radio_shadow`, `--radio_color_bg`, `--radio_color-active`, `--radio_description-color` |
|
|
352
|
+
| Rating | `--rating_color`, `--rating_color--filled` |
|
|
353
|
+
| SectionHeader | `--sectionHeader-title-color`, `--sectionHeader_subtitle-color`, `--sectionHeader_title-size`, `--sectionHeader_title-line-height`, `--sectionHeader_title-weight`, `--sectionHeader_subtitle-size` |
|
|
354
|
+
| SegmentedControl | `--control_track-bg`, `--control_radius`, `--control_thumb-radius`, `--control_thumb-bg`, `--control_label-color`, `--control_label-color--active`, `--control_label-color--hover`, `--control_item-bg`, `--control_item-bg--active`, `--control_indicator-color` |
|
|
355
|
+
| Select | `--select_border`, `--select_radius`, `--select_shadow`, `--select_color_bg`, `--select_color`, `--select_chevron-color` |
|
|
356
|
+
| Separator | `--separator_color`, `--separator_thickness` |
|
|
357
|
+
| Slider | `--slider_color`, `--slider_track-radius`, `--slider_color-active`, `--slider_track-bg`, `--slider_thumb-radius`, `--slider_color--error` |
|
|
358
|
+
| Switch | `--switch_color`, `--switch_track-radius`, `--switch_track-bg`, `--switch_shadow`, `--switch_thumb-bg`, `--switch_thumb-radius`, `--switch_border-color--error`, `--switch_track-bg--active`, `--switch_thumb-bg--active` |
|
|
359
|
+
| Table | `--table_border`, `--table_radius`, `--table_sortBtn-color--hover`, `--table_row-bg--hover` |
|
|
360
|
+
| Tabs | `--tab_color`, `--tab_border-color`, `--tab_color--active`, `--tab_border-color--active`, `--tab_color--hover` |
|
|
361
|
+
| Textarea | `--textarea_border`, `--textarea_radius`, `--textarea_shadow`, `--textarea_color_bg`, `--textarea_color` |
|
|
362
|
+
| Toast | `--toast_color`, `--toast_on-color`, `--toast_color--success`, `--toast_on-color--success`, `--toast_color--warning`, `--toast_on-color--warning`, `--toast_color--info`, `--toast_on-color--info`, `--toast_color--error`, `--toast_on-color--error` |
|
|
363
|
+
| Tooltip | `--tooltip_radius`, `--tooltip_bg`, `--tooltip_text` |
|
|
364
|
+
| Typography | `--typography_color` |
|
|
365
|
+
|
|
366
|
+
Components not listed have no component-local override tokens: Breadcrumb, ButtonContainer, CheckboxGroup, DescriptionList, GridItem, InputContainer, Label, Message, RadioGroup, Skeleton, SkipLink.
|
|
367
|
+
|
|
268
368
|
## MCP server
|
|
269
369
|
|
|
270
370
|
A live version of this design system is available as an MCP server at:
|