@boostdev/design-system-components 1.2.0 → 1.2.2

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.
Files changed (168) hide show
  1. package/AGENTS.md +46 -4
  2. package/README.md +15 -15
  3. package/dist/client.cjs +149 -124
  4. package/dist/client.css +503 -525
  5. package/dist/client.d.cts +71 -96
  6. package/dist/client.d.ts +71 -96
  7. package/dist/client.js +149 -124
  8. package/dist/index.cjs +149 -124
  9. package/dist/index.css +503 -525
  10. package/dist/index.d.cts +71 -96
  11. package/dist/index.d.ts +71 -96
  12. package/dist/index.js +149 -124
  13. package/dist/web-components/{chunk-6MH5UWUD.js → chunk-2FGATTGT.js} +5 -0
  14. package/dist/web-components/{chunk-5IPHEONG.js → chunk-6I2DBFQ7.js} +1 -0
  15. package/dist/web-components/{chunk-DI46Q2EA.js → chunk-OCODKRVZ.js} +57 -82
  16. package/dist/web-components/index.d.ts +571 -1
  17. package/dist/web-components/index.js +1501 -4
  18. package/dist/web-components/interaction/bds-collapsible.js +1 -1
  19. package/dist/web-components/interaction/bds-drawer.js +1 -1
  20. package/dist/web-components/interaction/form/bds-segmented-control.js +1 -1
  21. package/package.json +1 -1
  22. package/src/components/interaction/Command/Command.tsx +4 -3
  23. package/src/components/interaction/Dialog/Dialog.tsx +4 -5
  24. package/src/components/interaction/Drawer/Drawer.module.css +37 -62
  25. package/src/components/interaction/Drawer/Drawer.spec.tsx +3 -3
  26. package/src/components/interaction/Drawer/Drawer.tsx +25 -24
  27. package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +4 -2
  28. package/src/components/interaction/Popover/Popover.tsx +4 -3
  29. package/src/components/interaction/Rating/Rating.tsx +4 -2
  30. package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx +4 -6
  31. package/src/components/interaction/form/Combobox/Combobox.tsx +4 -2
  32. package/src/components/interaction/form/FileInput/FileInput.tsx +4 -3
  33. package/src/components/interaction/form/NumberInput/NumberInput.tsx +4 -3
  34. package/src/components/interaction/form/RadioGroup/RadioGroup.tsx +4 -6
  35. package/src/components/interaction/form/SegmentedControl/SegmentedControl.mdx +8 -4
  36. package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +13 -6
  37. package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +4 -6
  38. package/src/components/interaction/form/atoms/InputContainer.tsx +2 -2
  39. package/src/components/layout/ButtonGroup/ButtonGroup.tsx +4 -6
  40. package/src/components/layout/Card/Card.tsx +4 -10
  41. package/src/components/layout/IconWrapper/IconWrapper.tsx +4 -5
  42. package/src/components/layout/SectionHeader/SectionHeader.tsx +5 -4
  43. package/src/components/ui/Accordion/Accordion.tsx +4 -3
  44. package/src/components/ui/Alert/Alert.tsx +4 -3
  45. package/src/components/ui/Avatar/Avatar.tsx +5 -3
  46. package/src/components/ui/Badge/Badge.tsx +4 -5
  47. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +4 -3
  48. package/src/components/ui/Calendar/Calendar.tsx +4 -4
  49. package/src/components/ui/Carousel/Carousel.tsx +4 -4
  50. package/src/components/ui/DescriptionList/DescriptionList.tsx +4 -4
  51. package/src/components/ui/Loading/Loading.tsx +4 -3
  52. package/src/components/ui/NotificationBanner/NotificationBanner.tsx +4 -2
  53. package/src/components/ui/Pagination/Pagination.tsx +4 -2
  54. package/src/components/ui/Progress/Progress.tsx +4 -2
  55. package/src/components/ui/ProgressCircle/ProgressCircle.tsx +4 -1
  56. package/src/components/ui/Separator/Separator.tsx +5 -3
  57. package/src/components/ui/Skeleton/Skeleton.tsx +4 -3
  58. package/src/components/ui/SkipLink/SkipLink.tsx +4 -5
  59. package/src/components/ui/Tabs/Tabs.tsx +4 -4
  60. package/src/components/ui/Tooltip/Tooltip.tsx +4 -2
  61. package/src/components/ui/Typography/Typography.tsx +4 -5
  62. package/src/stories/DesignSystem/Grid.mdx +2 -0
  63. package/src/stories/Introduction.mdx +2 -1
  64. package/src/web-components/index.ts +12 -0
  65. package/src/web-components/interaction/BdsAccordion.mdx +80 -28
  66. package/src/web-components/interaction/BdsAccordion.stories.tsx +67 -58
  67. package/src/web-components/interaction/BdsCollapsible.mdx +93 -23
  68. package/src/web-components/interaction/BdsCollapsible.stories.tsx +29 -48
  69. package/src/web-components/interaction/BdsDialog.mdx +88 -27
  70. package/src/web-components/interaction/BdsDialog.stories.tsx +129 -47
  71. package/src/web-components/interaction/BdsDrawer.mdx +85 -27
  72. package/src/web-components/interaction/BdsDrawer.stories.tsx +161 -31
  73. package/src/web-components/interaction/BdsDropdownMenu.mdx +108 -0
  74. package/src/web-components/interaction/BdsDropdownMenu.stories.tsx +91 -0
  75. package/src/web-components/interaction/BdsSkipLink.mdx +72 -16
  76. package/src/web-components/interaction/BdsSkipLink.stories.tsx +47 -34
  77. package/src/web-components/interaction/BdsTabs.mdx +97 -27
  78. package/src/web-components/interaction/BdsTabs.stories.tsx +69 -55
  79. package/src/web-components/interaction/BdsTooltip.mdx +84 -18
  80. package/src/web-components/interaction/BdsTooltip.stories.tsx +49 -30
  81. package/src/web-components/interaction/bds-collapsible.ts +1 -0
  82. package/src/web-components/interaction/bds-drawer.ts +59 -82
  83. package/src/web-components/interaction/bds-dropdown-menu-item.ts +124 -0
  84. package/src/web-components/interaction/bds-dropdown-menu.spec.ts +102 -0
  85. package/src/web-components/interaction/bds-dropdown-menu.ts +200 -0
  86. package/src/web-components/interaction/form/BdsCheckbox.mdx +57 -20
  87. package/src/web-components/interaction/form/BdsCheckbox.stories.tsx +35 -36
  88. package/src/web-components/interaction/form/BdsCheckboxGroup.mdx +70 -0
  89. package/src/web-components/interaction/form/BdsCheckboxGroup.stories.tsx +81 -0
  90. package/src/web-components/interaction/form/BdsCombobox.mdx +52 -33
  91. package/src/web-components/interaction/form/BdsCombobox.stories.tsx +55 -53
  92. package/src/web-components/interaction/form/BdsFileInput.mdx +59 -24
  93. package/src/web-components/interaction/form/BdsFileInput.stories.tsx +38 -53
  94. package/src/web-components/interaction/form/BdsFormInput.mdx +98 -0
  95. package/src/web-components/interaction/form/BdsFormInput.stories.tsx +139 -0
  96. package/src/web-components/interaction/form/BdsNumberInput.mdx +51 -22
  97. package/src/web-components/interaction/form/BdsNumberInput.stories.tsx +24 -46
  98. package/src/web-components/interaction/form/BdsRadio.mdx +53 -22
  99. package/src/web-components/interaction/form/BdsRadio.stories.tsx +19 -51
  100. package/src/web-components/interaction/form/BdsRadioGroup.mdx +73 -0
  101. package/src/web-components/interaction/form/BdsRadioGroup.stories.tsx +88 -0
  102. package/src/web-components/interaction/form/BdsSegmentedControl.mdx +76 -23
  103. package/src/web-components/interaction/form/BdsSegmentedControl.stories.tsx +64 -54
  104. package/src/web-components/interaction/form/BdsSelect.mdx +59 -21
  105. package/src/web-components/interaction/form/BdsSelect.stories.tsx +47 -56
  106. package/src/web-components/interaction/form/BdsSlider.mdx +55 -27
  107. package/src/web-components/interaction/form/BdsSlider.stories.tsx +23 -44
  108. package/src/web-components/interaction/form/BdsSwitch.mdx +53 -20
  109. package/src/web-components/interaction/form/BdsSwitch.stories.tsx +22 -37
  110. package/src/web-components/interaction/form/BdsTextarea.mdx +54 -22
  111. package/src/web-components/interaction/form/BdsTextarea.stories.tsx +35 -44
  112. package/src/web-components/interaction/form/bds-checkbox-group.spec.ts +55 -0
  113. package/src/web-components/interaction/form/bds-checkbox-group.ts +117 -0
  114. package/src/web-components/interaction/form/bds-form-input.spec.ts +83 -0
  115. package/src/web-components/interaction/form/bds-form-input.ts +268 -0
  116. package/src/web-components/interaction/form/bds-radio-group.spec.ts +62 -0
  117. package/src/web-components/interaction/form/bds-radio-group.ts +142 -0
  118. package/src/web-components/interaction/form/bds-segmented-control.ts +5 -0
  119. package/src/web-components/ui/BdsAvatar.mdx +29 -20
  120. package/src/web-components/ui/BdsAvatar.stories.tsx +14 -28
  121. package/src/web-components/ui/BdsBreadcrumb.mdx +22 -19
  122. package/src/web-components/ui/BdsBreadcrumb.stories.tsx +11 -21
  123. package/src/web-components/ui/BdsButtonGroup.mdx +69 -0
  124. package/src/web-components/ui/BdsButtonGroup.stories.tsx +66 -0
  125. package/src/web-components/ui/BdsCalendar.mdx +93 -0
  126. package/src/web-components/ui/BdsCalendar.stories.tsx +63 -0
  127. package/src/web-components/ui/BdsCard.mdx +30 -25
  128. package/src/web-components/ui/BdsCard.stories.tsx +19 -42
  129. package/src/web-components/ui/BdsCarousel.mdx +83 -0
  130. package/src/web-components/ui/BdsCarousel.stories.tsx +96 -0
  131. package/src/web-components/ui/BdsDescriptionList.mdx +13 -16
  132. package/src/web-components/ui/BdsDescriptionList.stories.tsx +34 -49
  133. package/src/web-components/ui/BdsIconWrapper.mdx +20 -20
  134. package/src/web-components/ui/BdsIconWrapper.stories.tsx +46 -41
  135. package/src/web-components/ui/BdsLink.mdx +21 -17
  136. package/src/web-components/ui/BdsLink.stories.tsx +19 -20
  137. package/src/web-components/ui/BdsLoading.mdx +9 -13
  138. package/src/web-components/ui/BdsLoading.stories.tsx +8 -10
  139. package/src/web-components/ui/BdsNotificationBanner.mdx +32 -37
  140. package/src/web-components/ui/BdsNotificationBanner.stories.tsx +38 -47
  141. package/src/web-components/ui/BdsPagination.mdx +74 -0
  142. package/src/web-components/ui/BdsPagination.stories.tsx +36 -0
  143. package/src/web-components/ui/BdsProgress.mdx +24 -17
  144. package/src/web-components/ui/BdsProgress.stories.tsx +55 -29
  145. package/src/web-components/ui/BdsProgressCircle.mdx +24 -18
  146. package/src/web-components/ui/BdsProgressCircle.stories.tsx +17 -29
  147. package/src/web-components/ui/BdsRating.mdx +22 -22
  148. package/src/web-components/ui/BdsRating.stories.tsx +19 -13
  149. package/src/web-components/ui/BdsSectionHeader.mdx +31 -28
  150. package/src/web-components/ui/BdsSectionHeader.stories.tsx +21 -23
  151. package/src/web-components/ui/BdsSeparator.mdx +22 -8
  152. package/src/web-components/ui/BdsSeparator.stories.tsx +27 -19
  153. package/src/web-components/ui/BdsSkeleton.mdx +20 -26
  154. package/src/web-components/ui/BdsSkeleton.stories.tsx +23 -23
  155. package/src/web-components/ui/BdsTable.mdx +81 -0
  156. package/src/web-components/ui/BdsTable.stories.tsx +83 -0
  157. package/src/web-components/ui/BdsTypography.mdx +20 -29
  158. package/src/web-components/ui/BdsTypography.stories.tsx +19 -18
  159. package/src/web-components/ui/bds-button-group.spec.ts +40 -0
  160. package/src/web-components/ui/bds-button-group.ts +78 -0
  161. package/src/web-components/ui/bds-calendar.spec.ts +91 -0
  162. package/src/web-components/ui/bds-calendar.ts +427 -0
  163. package/src/web-components/ui/bds-carousel.spec.ts +64 -0
  164. package/src/web-components/ui/bds-carousel.ts +296 -0
  165. package/src/web-components/ui/bds-pagination.spec.ts +67 -0
  166. package/src/web-components/ui/bds-pagination.ts +197 -0
  167. package/src/web-components/ui/bds-table.spec.ts +45 -0
  168. package/src/web-components/ui/bds-table.ts +96 -0
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
- import '../index';
3
+ import '../index'; // auto-registers all custom elements
4
4
 
5
5
  function BdsProgress({
6
6
  value = 0,
7
- max,
7
+ max = 100,
8
8
  label,
9
9
  showLabel,
10
- size,
10
+ size = 'medium',
11
11
  }: {
12
12
  value?: number;
13
13
  max?: number;
@@ -28,43 +28,69 @@ const meta = {
28
28
  title: 'Web Components/UI/Progress',
29
29
  component: BdsProgress,
30
30
  tags: ['!stable', 'experimental'],
31
- parameters: { layout: 'padded' },
31
+ parameters: { layout: 'centered' },
32
32
  argTypes: {
33
- size: { control: 'select', options: ['small', 'medium', 'large'] },
33
+ value: { control: { type: 'range', min: 0, max: 100 } },
34
+ max: { control: 'number' },
35
+ size: { control: 'select', options: ['small', 'medium', 'large'] },
36
+ showLabel: { control: 'boolean' },
37
+ label: { control: 'text' },
34
38
  },
35
39
  } satisfies Meta<typeof BdsProgress>;
36
40
 
37
41
  export default meta;
38
42
  type Story = StoryObj<typeof meta>;
39
43
 
40
- export const Default: Story = { args: { value: 60 } };
41
- export const WithLabel: Story = { args: { value: 75, label: 'Upload progress', showLabel: true } };
42
- export const Complete: Story = { args: { value: 100, label: 'Complete', showLabel: true } };
43
- export const Small: Story = { args: { value: 40, size: 'small' } };
44
- export const Medium: Story = { args: { value: 40, size: 'medium' } };
45
- export const Large: Story = { args: { value: 40, size: 'large' } };
44
+ export const Default: Story = {
45
+ args: { value: 60, label: 'Progress', size: 'medium' },
46
+ render: ({ value, max, label, showLabel, size }) => (
47
+ <div style={{ width: 400 }}>
48
+ {React.createElement('bds-progress', {
49
+ value,
50
+ max,
51
+ label,
52
+ 'show-label': showLabel || undefined,
53
+ size,
54
+ })}
55
+ </div>
56
+ ),
57
+ };
46
58
 
47
- export const AllVariants: Story = {
59
+ export const WithLabel: Story = {
48
60
  render: () => (
49
- <div style={{ display: 'flex', flexDirection: 'column', gap: '16px', maxWidth: '400px' }}>
50
- {[25, 50, 75, 100].map(v => (
51
- <BdsProgress key={v} value={v} label={`${v}%`} showLabel />
52
- ))}
61
+ <div style={{ width: 400 }}>
62
+ {React.createElement('bds-progress', {
63
+ value: 60,
64
+ label: 'Upload progress',
65
+ 'show-label': true,
66
+ size: 'medium',
67
+ })}
53
68
  </div>
54
69
  ),
55
70
  };
56
71
 
57
- export const Interactive: Story = {
58
- render: () => {
59
- const [value, setValue] = React.useState(0);
60
- React.useEffect(() => {
61
- const id = setInterval(() => setValue(v => (v >= 100 ? 0 : v + 5)), 200);
62
- return () => clearInterval(id);
63
- }, []);
64
- return (
65
- <div style={{ maxWidth: '400px', display: 'flex', flexDirection: 'column', gap: '12px' }}>
66
- <BdsProgress value={value} label="Loading…" showLabel />
67
- </div>
68
- );
69
- },
72
+ export const Small: Story = {
73
+ render: () => (
74
+ <div style={{ width: 400 }}>
75
+ {React.createElement('bds-progress', { value: 40, label: 'Loading', size: 'small' })}
76
+ </div>
77
+ ),
78
+ };
79
+
80
+ export const Large: Story = {
81
+ render: () => (
82
+ <div style={{ width: 400 }}>
83
+ {React.createElement('bds-progress', { value: 80, label: 'Loading', size: 'large' })}
84
+ </div>
85
+ ),
86
+ };
87
+
88
+ export const AllSizes: Story = {
89
+ render: () => (
90
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 16, width: 400 }}>
91
+ {React.createElement('bds-progress', { value: 60, label: 'Small', 'show-label': true, size: 'small' })}
92
+ {React.createElement('bds-progress', { value: 60, label: 'Medium', 'show-label': true, size: 'medium' })}
93
+ {React.createElement('bds-progress', { value: 60, label: 'Large', 'show-label': true, size: 'large' })}
94
+ </div>
95
+ ),
70
96
  };
@@ -5,7 +5,7 @@ import * as Stories from './BdsProgressCircle.stories';
5
5
 
6
6
  # &lt;bds-progress-circle&gt;
7
7
 
8
- Framework-agnostic circular Progress indicator. Uses SVG to render a smooth arc that fills based on `value / max`.
8
+ Framework-agnostic circular Progress custom element. Renders an SVG ring that fills proportionally to the `value` attribute, with an optional centred percentage label.
9
9
 
10
10
  > **Status: experimental** — API may change before stable release.
11
11
 
@@ -15,16 +15,27 @@ Framework-agnostic circular Progress indicator. Uses SVG to render a smooth arc
15
15
  import '@boostdev/components/web-components';
16
16
  ```
17
17
 
18
+ ## When to use
19
+
20
+ - Compact progress indicators in dashboards, stat cards, or alongside a loading spinner
21
+ - Use `show-value` to display the numeric percentage inside the ring
22
+
18
23
  ## Examples
19
24
 
20
25
  ### All sizes
21
- <Canvas of={Stories.AllVariants} />
26
+ <Canvas of={Stories.AllSizes} />
27
+
28
+ ### Default
29
+ <Canvas of={Stories.Default} />
22
30
 
23
- ### With value
31
+ ### With centred value
24
32
  <Canvas of={Stories.WithValue} />
25
33
 
26
- ### Animated
27
- <Canvas of={Stories.Interactive} />
34
+ ### Small
35
+ <Canvas of={Stories.Small} />
36
+
37
+ ### Large
38
+ <Canvas of={Stories.Large} />
28
39
 
29
40
  ## Props
30
41
 
@@ -36,29 +47,24 @@ import '@boostdev/components/web-components';
36
47
  |-----------|------|---------|-------------|
37
48
  | `value` | number | `0` | Current progress value |
38
49
  | `max` | number | `100` | Maximum value |
39
- | `label` | string | — | Accessible label text |
40
- | `show-value` | boolean | `false` | Displays the percentage in the centre |
41
- | `size` | `"small" \| "medium" \| "large"` | `"medium"` | SVG diameter (`40px` / `64px` / `96px`) |
50
+ | `label` | string | — | Accessible label for the progress bar |
51
+ | `show-value` | boolean | `false` | Displays the rounded percentage in the centre of the ring |
52
+ | `size` | `"small" \| "medium" \| "large"` | `"medium"` | Diameter (`40px` / `64px` / `96px`) |
42
53
 
43
54
  ## CSS Custom Properties
44
55
 
45
56
  | Property | Description |
46
57
  |----------|-------------|
47
- | `--progressCircle_color-active` | Arc stroke colour (defaults to `--bdc-color_active`) |
58
+ | `--progressCircle_color-active` | Stroke colour of the filled arc |
48
59
 
49
60
  ## Usage in plain HTML
50
61
 
51
62
  ```html
52
- <bds-progress-circle value="75" label="Loading"></bds-progress-circle>
53
-
54
- <bds-progress-circle value="65" label="Upload" show-value></bds-progress-circle>
55
-
56
- <bds-progress-circle value="80" size="large" label="Progress" show-value></bds-progress-circle>
63
+ <bds-progress-circle value="75" label="Upload progress" show-value></bds-progress-circle>
64
+ <bds-progress-circle value="30" size="small" label="Loading"></bds-progress-circle>
57
65
  ```
58
66
 
59
67
  ## Accessibility
60
68
 
61
- - Renders `role="progressbar"` with `aria-valuenow`, `aria-valuemin`, `aria-valuemax`, and `aria-label`
62
- - Always provide a meaningful `label` for screen readers
63
- - SVG is hidden from assistive technology (`aria-hidden="true"`) — ARIA attributes are on the container
64
- - Stroke transition respects `prefers-reduced-motion`
69
+ - Renders with `role="progressbar"`, `aria-valuenow`, `aria-valuemin`, and `aria-valuemax`
70
+ - Always provide a `label` to give the indicator a meaningful accessible name
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
- import '../index';
3
+ import '../index'; // auto-registers all custom elements
4
4
 
5
5
  function BdsProgressCircle({
6
6
  value = 0,
7
- max,
7
+ max = 100,
8
8
  label,
9
9
  showValue,
10
- size,
10
+ size = 'medium',
11
11
  }: {
12
12
  value?: number;
13
13
  max?: number;
@@ -30,40 +30,28 @@ const meta = {
30
30
  tags: ['!stable', 'experimental'],
31
31
  parameters: { layout: 'centered' },
32
32
  argTypes: {
33
- size: { control: 'select', options: ['small', 'medium', 'large'] },
33
+ value: { control: { type: 'range', min: 0, max: 100 } },
34
+ max: { control: 'number' },
35
+ size: { control: 'select', options: ['small', 'medium', 'large'] },
36
+ showValue: { control: 'boolean' },
37
+ label: { control: 'text' },
34
38
  },
35
39
  } satisfies Meta<typeof BdsProgressCircle>;
36
40
 
37
41
  export default meta;
38
42
  type Story = StoryObj<typeof meta>;
39
43
 
40
- export const Default: Story = { args: { value: 75 } };
41
- export const WithValue: Story = { args: { value: 65, showValue: true, label: 'Progress' } };
42
- export const Complete: Story = { args: { value: 100, showValue: true, label: 'Complete' } };
43
- export const Small: Story = { args: { value: 60, size: 'small', showValue: true } };
44
- export const Medium: Story = { args: { value: 60, size: 'medium', showValue: true } };
45
- export const Large: Story = { args: { value: 60, size: 'large', showValue: true } };
44
+ export const Default: Story = { args: { value: 75, label: 'Progress', size: 'medium' } };
45
+ export const WithValue: Story = { args: { value: 75, label: 'Progress', showValue: true, size: 'medium' } };
46
+ export const Small: Story = { args: { value: 50, label: 'Loading', size: 'small' } };
47
+ export const Large: Story = { args: { value: 50, label: 'Loading', showValue: true, size: 'large' } };
46
48
 
47
- export const AllVariants: Story = {
49
+ export const AllSizes: Story = {
48
50
  render: () => (
49
- <div style={{ display: 'flex', alignItems: 'center', gap: '32px', flexWrap: 'wrap' }}>
50
- {(['small', 'medium', 'large'] as const).map(s => (
51
- <div key={s} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '8px' }}>
52
- <BdsProgressCircle value={75} size={s} showValue label="Progress" />
53
- <span style={{ fontSize: '0.75rem', color: '#888' }}>{s}</span>
54
- </div>
55
- ))}
51
+ <div style={{ display: 'flex', gap: 24, alignItems: 'center' }}>
52
+ {React.createElement('bds-progress-circle', { value: 60, label: 'Small', 'show-value': true, size: 'small' })}
53
+ {React.createElement('bds-progress-circle', { value: 60, label: 'Medium', 'show-value': true, size: 'medium' })}
54
+ {React.createElement('bds-progress-circle', { value: 60, label: 'Large', 'show-value': true, size: 'large' })}
56
55
  </div>
57
56
  ),
58
57
  };
59
-
60
- export const Interactive: Story = {
61
- render: () => {
62
- const [value, setValue] = React.useState(0);
63
- React.useEffect(() => {
64
- const id = setInterval(() => setValue(v => (v >= 100 ? 0 : v + 2)), 100);
65
- return () => clearInterval(id);
66
- }, []);
67
- return <BdsProgressCircle value={value} showValue label="Loading" size="large" />;
68
- },
69
- };
@@ -5,7 +5,7 @@ import * as Stories from './BdsRating.stories';
5
5
 
6
6
  # &lt;bds-rating&gt;
7
7
 
8
- Framework-agnostic read-only star Rating display. Use to show a score or user rating.
8
+ Framework-agnostic read-only star Rating custom element. Renders a row of SVG stars with filled/empty states based on `value` and `max`.
9
9
 
10
10
  > **Status: experimental** — API may change before stable release.
11
11
 
@@ -15,16 +15,27 @@ Framework-agnostic read-only star Rating display. Use to show a score or user ra
15
15
  import '@boostdev/components/web-components';
16
16
  ```
17
17
 
18
+ ## When to use
19
+
20
+ - Displaying product or review ratings in cards or lists
21
+ - Read-only — for interactive star selection, use a form input instead
22
+
18
23
  ## Examples
19
24
 
20
- ### All ratings
21
- <Canvas of={Stories.AllVariants} />
25
+ ### All values
26
+ <Canvas of={Stories.AllValues} />
27
+
28
+ ### Default (3 of 5)
29
+ <Canvas of={Stories.Default} />
30
+
31
+ ### Full (5 of 5)
32
+ <Canvas of={Stories.Full} />
22
33
 
23
- ### 5 stars
24
- <Canvas of={Stories.FiveStars} />
34
+ ### Empty (0 of 5)
35
+ <Canvas of={Stories.Empty} />
25
36
 
26
- ### Custom max
27
- <Canvas of={Stories.Custom} />
37
+ ### Custom max (7 of 10)
38
+ <Canvas of={Stories.CustomMax} />
28
39
 
29
40
  ## Props
30
41
 
@@ -35,27 +46,16 @@ import '@boostdev/components/web-components';
35
46
  | Attribute | Type | Default | Description |
36
47
  |-----------|------|---------|-------------|
37
48
  | `value` | number | `0` | Number of filled stars |
38
- | `max` | number | `5` | Total number of stars |
39
-
40
- ## CSS Custom Properties
41
-
42
- | Property | Description |
43
- |----------|-------------|
44
- | `--bds-color_warning` | Filled star colour (foundation token) |
49
+ | `max` | number | `5` | Total number of stars displayed |
45
50
 
46
51
  ## Usage in plain HTML
47
52
 
48
53
  ```html
49
54
  <bds-rating value="3"></bds-rating>
50
-
51
- <bds-rating value="4" max="5"></bds-rating>
52
-
53
- <!-- Custom scale -->
54
- <bds-rating value="7" max="10"></bds-rating>
55
+ <bds-rating value="4" max="10"></bds-rating>
55
56
  ```
56
57
 
57
58
  ## Accessibility
58
59
 
59
- - Renders `role="img"` with `aria-label="X out of Y stars"`
60
- - Individual star SVGs are hidden from assistive technology (`aria-hidden="true"`)
61
- - This is a read-only display — for interactive ratings, use a radio group pattern
60
+ - Renders `role="img"` with `aria-label` set to `"{value} out of {max} stars"`
61
+ - All star SVGs carry `aria-hidden="true"` to avoid duplicate announcements
@@ -1,8 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
- import '../index';
3
+ import '../index'; // auto-registers all custom elements
4
4
 
5
- function BdsRating({ value = 0, max }: { value?: number; max?: number }) {
5
+ function BdsRating({
6
+ value = 0,
7
+ max = 5,
8
+ }: {
9
+ value?: number;
10
+ max?: number;
11
+ }) {
6
12
  return React.createElement('bds-rating', { value, max });
7
13
  }
8
14
 
@@ -12,26 +18,26 @@ const meta = {
12
18
  tags: ['!stable', 'experimental'],
13
19
  parameters: { layout: 'centered' },
14
20
  argTypes: {
15
- value: { control: { type: 'number', min: 0, max: 10 } },
16
- max: { control: { type: 'number', min: 1, max: 10 } },
21
+ value: { control: { type: 'range', min: 0, max: 10 } },
22
+ max: { control: 'number' },
17
23
  },
18
24
  } satisfies Meta<typeof BdsRating>;
19
25
 
20
26
  export default meta;
21
27
  type Story = StoryObj<typeof meta>;
22
28
 
23
- export const OneStar: Story = { args: { value: 1 } };
24
- export const ThreeStars: Story = { args: { value: 3 } };
25
- export const FiveStars: Story = { args: { value: 5 } };
26
- export const Custom: Story = { args: { value: 7, max: 10 } };
29
+ export const Default: Story = { args: { value: 3, max: 5 } };
30
+ export const Full: Story = { args: { value: 5, max: 5 } };
31
+ export const Empty: Story = { args: { value: 0, max: 5 } };
32
+ export const CustomMax: Story = { args: { value: 7, max: 10 } };
27
33
 
28
- export const AllVariants: Story = {
34
+ export const AllValues: Story = {
29
35
  render: () => (
30
- <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
36
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
31
37
  {[1, 2, 3, 4, 5].map(v => (
32
- <div key={v} style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
33
- <BdsRating value={v} />
34
- <span style={{ fontSize: '0.875rem', color: '#888' }}>{v}/5</span>
38
+ <div key={v} style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
39
+ <span style={{ width: 8 }}>{v}</span>
40
+ {React.createElement('bds-rating', { value: v, max: 5 })}
35
41
  </div>
36
42
  ))}
37
43
  </div>
@@ -5,7 +5,7 @@ import * as Stories from './BdsSectionHeader.stories';
5
5
 
6
6
  # &lt;bds-section-header&gt;
7
7
 
8
- Framework-agnostic Section Header custom element. Use to introduce page sections with a title and optional subtitle.
8
+ Framework-agnostic Section Header custom element. Combines a title and optional subtitle into a consistently styled page or section heading with size and alignment variants.
9
9
 
10
10
  > **Status: experimental** — API may change before stable release.
11
11
 
@@ -15,16 +15,31 @@ Framework-agnostic Section Header custom element. Use to introduce page sections
15
15
  import '@boostdev/components/web-components';
16
16
  ```
17
17
 
18
+ ## When to use
19
+
20
+ - At the top of page sections to introduce content areas
21
+ - Use `alignment="center"` for marketing/hero sections
22
+ - Override the semantic tag with `title-as` when the heading hierarchy requires a different level
23
+
18
24
  ## Examples
19
25
 
20
26
  ### All sizes
21
- <Canvas of={Stories.AllVariants} />
27
+ <Canvas of={Stories.AllSizes} />
28
+
29
+ ### Default
30
+ <Canvas of={Stories.Default} />
31
+
32
+ ### Small
33
+ <Canvas of={Stories.Small} />
34
+
35
+ ### Large
36
+ <Canvas of={Stories.Large} />
22
37
 
23
- ### With subtitle
24
- <Canvas of={Stories.WithSubtitle} />
38
+ ### Centered
39
+ <Canvas of={Stories.Centered} />
25
40
 
26
- ### Center aligned
27
- <Canvas of={Stories.Center} />
41
+ ### Title only
42
+ <Canvas of={Stories.TitleOnly} />
28
43
 
29
44
  ## Props
30
45
 
@@ -35,35 +50,23 @@ import '@boostdev/components/web-components';
35
50
  | Attribute | Type | Default | Description |
36
51
  |-----------|------|---------|-------------|
37
52
  | `title` | string | — | Heading text (required) |
38
- | `subtitle` | string | — | Optional subheading |
39
- | `alignment` | `"start" \| "center" \| "end"` | `"start"` | Text alignment |
40
- | `size` | `"small" \| "medium" \| "large"` | `"medium"` | Typography scale |
41
- | `title-as` | string | `"h2"` | HTML tag for the title element |
42
-
43
- ## CSS Custom Properties
44
-
45
- | Property | Description |
46
- |----------|-------------|
47
- | `--sectionHeader-title-color` | Title text colour |
48
- | `--sectionHeader_subtitle-color` | Subtitle text colour |
53
+ | `subtitle` | string | — | Optional subheading text |
54
+ | `alignment` | `"start" \| "center" \| "end"` | `"start"` | Text and flex alignment |
55
+ | `size` | `"small" \| "medium" \| "large"` | `"medium"` | Font size scale for title and subtitle |
56
+ | `title-as` | string | `"h2"` | Override the HTML element rendered for the title |
49
57
 
50
58
  ## Usage in plain HTML
51
59
 
52
60
  ```html
53
- <bds-section-header title="Our Products"></bds-section-header>
54
-
55
61
  <bds-section-header
56
- title="Features"
57
- subtitle="Everything you need"
58
- alignment="center"
62
+ title="Our Products"
63
+ subtitle="Browse the full range"
59
64
  size="large"
60
- ></bds-section-header>
61
-
62
- <!-- Use h3 when nested inside another section -->
63
- <bds-section-header title="Subsection" title-as="h3"></bds-section-header>
65
+ alignment="center">
66
+ </bds-section-header>
64
67
  ```
65
68
 
66
69
  ## Accessibility
67
70
 
68
- - Always set `title-as` to match the correct heading level in the document outline
69
- - Default is `h2` adjust if the section header is nested inside an `h2` section
71
+ - The title renders as `h2` by default; use `title-as` to match the page heading hierarchy
72
+ - Avoid skipping heading levels when changing `title-as`
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
- import '../index';
3
+ import '../index'; // auto-registers all custom elements
4
4
 
5
5
  function BdsSectionHeader({
6
- title,
6
+ title = '',
7
7
  subtitle,
8
- alignment,
9
- size,
8
+ alignment = 'start',
9
+ size = 'medium',
10
10
  titleAs,
11
11
  }: {
12
12
  title?: string;
@@ -15,13 +15,7 @@ function BdsSectionHeader({
15
15
  size?: 'small' | 'medium' | 'large';
16
16
  titleAs?: string;
17
17
  }) {
18
- return React.createElement('bds-section-header', {
19
- title,
20
- subtitle,
21
- alignment,
22
- size,
23
- 'title-as': titleAs,
24
- });
18
+ return React.createElement('bds-section-header', { title, subtitle, alignment, size, 'title-as': titleAs });
25
19
  }
26
20
 
27
21
  const meta = {
@@ -31,26 +25,30 @@ const meta = {
31
25
  parameters: { layout: 'padded' },
32
26
  argTypes: {
33
27
  alignment: { control: 'select', options: ['start', 'center', 'end'] },
34
- size: { control: 'select', options: ['small', 'medium', 'large'] },
28
+ size: { control: 'select', options: ['small', 'medium', 'large'] },
29
+ titleAs: { control: 'text' },
35
30
  },
36
31
  } satisfies Meta<typeof BdsSectionHeader>;
37
32
 
38
33
  export default meta;
39
34
  type Story = StoryObj<typeof meta>;
40
35
 
41
- export const Default: Story = { args: { title: 'Our Products' } };
42
- export const WithSubtitle: Story = { args: { title: 'Our Products', subtitle: 'Browse the full range of components' } };
43
- export const Center: Story = { args: { title: 'Features', subtitle: 'Everything you need to build faster', alignment: 'center' } };
44
- export const End: Story = { args: { title: 'Aligned end', alignment: 'end' } };
45
- export const Small: Story = { args: { title: 'Small header', subtitle: 'Compact section intro', size: 'small' } };
46
- export const Large: Story = { args: { title: 'Large header', subtitle: 'Hero-scale section heading', size: 'large' } };
36
+ export const Default: Story = {
37
+ args: { title: 'Our Products', subtitle: 'Browse the full range', size: 'medium', alignment: 'start' },
38
+ };
39
+ export const Small: Story = { args: { title: 'Recent Activity', subtitle: 'Last 30 days', size: 'small' } };
40
+ export const Large: Story = { args: { title: 'Welcome Back', subtitle: 'Here is what happened today', size: 'large' } };
41
+ export const Centered: Story = {
42
+ args: { title: 'Our Mission', subtitle: 'We are building something great', alignment: 'center' },
43
+ };
44
+ export const TitleOnly: Story = { args: { title: 'Settings', size: 'small' } };
47
45
 
48
- export const AllVariants: Story = {
46
+ export const AllSizes: Story = {
49
47
  render: () => (
50
- <div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}>
51
- {(['small', 'medium', 'large'] as const).map(s => (
52
- <BdsSectionHeader key={s} title={`${s.charAt(0).toUpperCase() + s.slice(1)} header`} subtitle="Optional subtitle text" size={s} />
53
- ))}
48
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 32 }}>
49
+ {React.createElement('bds-section-header', { title: 'Small Heading', subtitle: 'Subtitle text', size: 'small' })}
50
+ {React.createElement('bds-section-header', { title: 'Medium Heading', subtitle: 'Subtitle text', size: 'medium' })}
51
+ {React.createElement('bds-section-header', { title: 'Large Heading', subtitle: 'Subtitle text', size: 'large' })}
54
52
  </div>
55
53
  ),
56
54
  };
@@ -5,20 +5,34 @@ import * as Stories from './BdsSeparator.stories';
5
5
 
6
6
  # &lt;bds-separator&gt;
7
7
 
8
- Framework-agnostic Separator custom element. Renders a horizontal or vertical visual divider.
8
+ Framework-agnostic Separator custom element. Renders a thin decorative line to visually divide content. Supports both horizontal and vertical orientations.
9
9
 
10
10
  > **Status: experimental** — API may change before stable release.
11
11
 
12
12
  ## Installation
13
13
 
14
14
  ```js
15
+ // Register all web components at once
15
16
  import '@boostdev/components/web-components';
16
17
  ```
17
18
 
19
+ Or in HTML without a bundler:
20
+
21
+ ```html
22
+ <script type="module">
23
+ import '@boostdev/components/web-components';
24
+ </script>
25
+ ```
26
+
27
+ ## When to use
28
+
29
+ - To visually separate groups of related content (e.g. sections in a form or list)
30
+ - As a vertical divider between inline elements such as navigation links
31
+
18
32
  ## Examples
19
33
 
20
- ### All variants
21
- <Canvas of={Stories.AllVariants} />
34
+ ### Default (horizontal)
35
+ <Canvas of={Stories.Default} />
22
36
 
23
37
  ### Horizontal
24
38
  <Canvas of={Stories.Horizontal} />
@@ -46,11 +60,12 @@ import '@boostdev/components/web-components';
46
60
  ## Usage in plain HTML
47
61
 
48
62
  ```html
49
- <!-- Horizontal (default) -->
63
+ <p>Above</p>
50
64
  <bds-separator></bds-separator>
65
+ <p>Below</p>
51
66
 
52
- <!-- Vertical — needs a height context -->
53
- <div style="display: flex; align-items: center; height: 40px; gap: 16px;">
67
+ <!-- Vertical -->
68
+ <div style="display: flex; align-items: center; gap: 8px; height: 40px;">
54
69
  <span>Left</span>
55
70
  <bds-separator orientation="vertical"></bds-separator>
56
71
  <span>Right</span>
@@ -59,5 +74,4 @@ import '@boostdev/components/web-components';
59
74
 
60
75
  ## Accessibility
61
76
 
62
- - Renders as `role="separator"` with `aria-orientation` set automatically
63
- - Purely decorative — screen readers announce it as a separator landmark
77
+ - Renders a `<div role="separator">` with `aria-orientation` set automatically