@boostdev/design-system-components 1.2.4 → 1.2.6

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 (71) hide show
  1. package/AGENTS.md +42 -15
  2. package/README.md +7 -0
  3. package/dist/client.cjs +57 -52
  4. package/dist/client.css +546 -536
  5. package/dist/client.d.cts +1 -1
  6. package/dist/client.d.ts +1 -1
  7. package/dist/client.js +57 -52
  8. package/dist/index.cjs +57 -52
  9. package/dist/index.css +546 -536
  10. package/dist/index.d.cts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +57 -52
  13. package/dist/utils.cjs +30 -0
  14. package/dist/utils.d.cts +8 -0
  15. package/dist/utils.d.ts +8 -0
  16. package/dist/utils.js +5 -0
  17. package/package.json +10 -4
  18. package/src/client.ts +6 -0
  19. package/src/components/interaction/Button/Button.mdx +11 -3
  20. package/src/components/interaction/Button/Button.module.css +5 -5
  21. package/src/components/interaction/Command/Command.mdx +1 -0
  22. package/src/components/interaction/Command/Command.module.css +1 -1
  23. package/src/components/interaction/Drawer/Drawer.mdx +2 -0
  24. package/src/components/interaction/Drawer/Drawer.module.css +1 -1
  25. package/src/components/interaction/DropdownMenu/DropdownMenu.mdx +19 -0
  26. package/src/components/interaction/DropdownMenu/DropdownMenu.module.css +2 -2
  27. package/src/components/interaction/Rating/Rating.mdx +14 -0
  28. package/src/components/interaction/Rating/Rating.module.css +2 -2
  29. package/src/components/interaction/Toast/Toast.mdx +12 -4
  30. package/src/components/interaction/Toast/Toast.spec.tsx +11 -0
  31. package/src/components/interaction/Toast/Toast.tsx +11 -4
  32. package/src/components/interaction/form/Combobox/Combobox.mdx +2 -0
  33. package/src/components/interaction/form/Combobox/Combobox.module.css +3 -3
  34. package/src/components/interaction/form/FileInput/FileInput.mdx +2 -0
  35. package/src/components/interaction/form/FileInput/FileInput.module.css +2 -2
  36. package/src/components/interaction/form/NumberInput/NumberInput.mdx +4 -0
  37. package/src/components/interaction/form/NumberInput/NumberInput.module.css +3 -3
  38. package/src/components/interaction/form/SegmentedControl/SegmentedControl.mdx +1 -0
  39. package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +1 -1
  40. package/src/components/interaction/form/Slider/Slider.mdx +4 -0
  41. package/src/components/interaction/form/Slider/Slider.module.css +8 -8
  42. package/src/components/interaction/form/Switch/Switch.mdx +3 -0
  43. package/src/components/interaction/form/Switch/Switch.module.css +1 -1
  44. package/src/components/interaction/form/Textarea/Textarea.mdx +1 -1
  45. package/src/components/interaction/form/Textarea/Textarea.module.css +1 -1
  46. package/src/components/layout/ButtonGroup/ButtonGroup.mdx +2 -0
  47. package/src/components/layout/Card/Card.mdx +8 -5
  48. package/src/components/layout/Card/Card.module.css +4 -4
  49. package/src/components/layout/SectionHeader/SectionHeader.mdx +10 -2
  50. package/src/components/layout/SectionHeader/SectionHeader.module.css +29 -17
  51. package/src/components/layout/SectionHeader/SectionHeader.spec.tsx +5 -0
  52. package/src/components/layout/SectionHeader/SectionHeader.stories.tsx +2 -1
  53. package/src/components/layout/SectionHeader/SectionHeader.tsx +1 -1
  54. package/src/components/ui/Accordion/Accordion.mdx +1 -0
  55. package/src/components/ui/Accordion/Accordion.module.css +1 -1
  56. package/src/components/ui/Alert/Alert.mdx +6 -3
  57. package/src/components/ui/Alert/Alert.module.css +1 -1
  58. package/src/components/ui/Calendar/Calendar.mdx +5 -0
  59. package/src/components/ui/Calendar/Calendar.module.css +5 -5
  60. package/src/components/ui/Carousel/Carousel.mdx +14 -0
  61. package/src/components/ui/Carousel/Carousel.module.css +1 -1
  62. package/src/components/ui/NotificationBanner/NotificationBanner.mdx +18 -0
  63. package/src/components/ui/NotificationBanner/NotificationBanner.module.css +1 -1
  64. package/src/components/ui/Pagination/Pagination.mdx +21 -0
  65. package/src/components/ui/Pagination/Pagination.module.css +5 -5
  66. package/src/components/ui/Table/Table.mdx +2 -0
  67. package/src/components/ui/Table/Table.module.css +2 -2
  68. package/src/components/ui/Tabs/Tabs.mdx +17 -0
  69. package/src/components/ui/Tabs/Tabs.module.css +3 -3
  70. package/src/css/bdc.css +1 -0
  71. package/src/utils.ts +6 -0
package/AGENTS.md CHANGED
@@ -1,10 +1,10 @@
1
- # @boostdev/components - Agent Guide
1
+ # @boostdev/design-system-components - Agent Guide
2
2
 
3
3
  ## What this package provides
4
4
 
5
5
  A component library with three targets:
6
6
  - **React (web)** — CSS Modules, design tokens from `@boostdev/design-system-foundation`, full component suite
7
- - **Web Components** (experimental) — Lit-based custom elements, framework-agnostic, entry point `@boostdev/components/web-components`
7
+ - **Web Components** (experimental) — Lit-based custom elements, framework-agnostic, entry point `@boostdev/design-system-components/web-components`
8
8
  - **React Native** (alpha) — React Native primitives, JS token layer, Metro-resolved via `"react-native"` export condition
9
9
 
10
10
  ## Prerequisites
@@ -17,10 +17,10 @@ All component styles live inside `@layer component`.
17
17
 
18
18
  **Web Components:** import the bundle to register all custom elements:
19
19
  ```js
20
- import '@boostdev/components/web-components';
20
+ import '@boostdev/design-system-components/web-components';
21
21
  ```
22
22
 
23
- **React Native:** wrap the app in `ThemeProvider` from `@boostdev/components/native/ThemeContext`. Metro resolves the native bundle automatically via the `"react-native"` export condition — no extra config needed.
23
+ **React Native:** wrap the app in `ThemeProvider` from `@boostdev/design-system-components/native/ThemeContext`. Metro resolves the native bundle automatically via the `"react-native"` export condition — no extra config needed.
24
24
 
25
25
  ## Component categories
26
26
 
@@ -61,10 +61,12 @@ Also: never define story component functions inside a `render: () => { function
61
61
 
62
62
  ### React Native (alpha) — `src/components/**/*.native.tsx`
63
63
  Native implementations co-located with their web counterparts. Metro resolves them automatically.
64
- - **ui/**: Typography, Badge, Avatar, Alert, NotificationBanner, Progress, Skeleton, Loading, Separator
65
- - **layout/**: Card, SectionHeader, ButtonGroup, IconWrapper
66
- - **interaction/**: Button
67
- - **interaction/form/**: Checkbox, Radio, Switch + atoms (Label, Message)
64
+ - **ui/** (22): Accordion, Alert, Avatar, Badge, Breadcrumb, Calendar, Carousel, Collapsible, DescriptionList, Link, Loading, NotificationBanner, Pagination, Progress, ProgressCircle, Separator, Skeleton, Table, Tabs, Tooltip, Typography
65
+ - **layout/** (4): ButtonGroup, Card, IconWrapper, SectionHeader
66
+ - **interaction/** (7): Button, Dialog, Drawer, DropdownMenu, Popover, Rating, Toast (ToastProvider + useToast)
67
+ - **interaction/form/** (13): Checkbox, CheckboxGroup, Combobox, FileInput, FormInput, NumberInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, Textarea + atoms (Label, Message)
68
+
69
+ **Not ported** (deferred): Command (cmdk dependency), SkipLink (browser-only pattern)
68
70
 
69
71
  Storybook stories: `src/components/**/*.native.stories.tsx` (title `'React Native/{UI|Interaction|Form|Layout}/{Name}'`, tags `['!stable', 'alpha']`). All stories wrap in `<ThemeProvider>` decorator.
70
72
 
@@ -189,16 +191,27 @@ Error focus rings substitute `--bds-color_error` for `--bds-color_interactive`.
189
191
  ## Import paths
190
192
 
191
193
  ```ts
192
- // Named exportsplain React / Vite
193
- import { Button, Badge, Typography } from '@boostdev/components';
194
+ // Server-safe componentsworks in Next.js Server Components and client components:
195
+ import { Typography, Badge, Card } from '@boostdev/design-system-components';
196
+
197
+ // Client-only components (use React hooks) — must be inside a 'use client' boundary in Next.js:
198
+ import { ToastProvider, useToast, Dialog, Drawer } from '@boostdev/design-system-components/client';
199
+
200
+ // All components — client entry with 'use client' banner (safe for any component in Next.js):
201
+ import { Button, Badge, Typography } from '@boostdev/design-system-components/client';
194
202
 
195
- // Named exports Next.js / RSC (adds 'use client' to the bundle)
196
- import { Button, Badge, Typography } from '@boostdev/components/client';
203
+ // Utilitiesserver-safe (no CSS, no 'use client'), works in Server Components, layouts, middleware
204
+ import { cn } from '@boostdev/design-system-components/utils';
205
+ import type { WithClassName } from '@boostdev/design-system-components/utils';
197
206
 
198
207
  // CSS (import once, at the app root)
199
- import '@boostdev/components/css';
208
+ import '@boostdev/design-system-components/css';
200
209
  ```
201
210
 
211
+ > **Root entry is RSC-safe**: The root entry (`@boostdev/design-system-components`) can be safely imported in Next.js Server Components — all `createContext` calls are lazily initialised. However, client-only components (those using hooks like `useState`, `useEffect`) must still be rendered inside a `'use client'` boundary.
212
+
213
+ > **`cn()` in Server Components**: For `cn` only, prefer `@boostdev/design-system-components/utils` — the root entry includes a CSS side-effect import.
214
+
202
215
  ## Accessibility requirements (WCAG 2.1 AA)
203
216
 
204
217
  Every component must meet WCAG 2.1 Level AA:
@@ -218,6 +231,10 @@ Every component must meet WCAG 2.1 Level AA:
218
231
 
219
232
  References: https://developer.mozilla.org/en-US/docs/Web/Accessibility | https://www.w3.org/WAI/WCAG21/quickref/
220
233
 
234
+ ## Usage guidelines
235
+
236
+ - **Form buttons must be wrapped in `ButtonGroup`**: Whenever buttons are used inside a form (submit, reset, cancel, navigation), wrap them in a `ButtonGroup` component. Use `variant="flow"` for multi-step form navigation (Back / Next) and `variant="card"` for single-form submissions. This ensures consistent spacing, alignment, and responsive behaviour.
237
+
221
238
  ## Key decisions
222
239
 
223
240
  - **Button variants**: `default` (filled) and `outline` (transparent, outlined). `ghost` is a deprecated alias for `outline` — use `outline` for new code.
@@ -269,6 +286,16 @@ A live version of this design system is available as an MCP server at:
269
286
  https://ds.boostdev.nl/api/mcp
270
287
  ```
271
288
 
272
- Connect to it to look up component props and tokens without reading source files. Use
273
- `ds_get_component` before writing any component code to ensure you have the correct prop names.
289
+ Connect to it to look up component props, CSS custom properties, and tokens without reading source files. Use
290
+ `ds_get_component` before writing any component code it returns the props interface **and** all
291
+ overridable CSS custom properties with their defaults. Override CSS variables on the component
292
+ element or any parent in plain CSS (no `@layer` needed):
293
+
294
+ ```css
295
+ .my-branded-button {
296
+ --button_color: var(--bds-color_success);
297
+ --button_on-color: var(--bds-color_on-success);
298
+ }
299
+ ```
300
+
274
301
  Run `pnpm mcp:start` to start a local instance at `http://localhost:3001/api/mcp`.
package/README.md CHANGED
@@ -52,6 +52,9 @@ import { Button, Card } from '@boostdev/components';
52
52
 
53
53
  // Next.js / RSC — use the /client subpath
54
54
  import { Button, Card } from '@boostdev/components/client';
55
+
56
+ // Server-safe utilities (cn, WithClassName) — works in Server Components, layouts, middleware
57
+ import { cn } from '@boostdev/components/utils';
55
58
  ```
56
59
 
57
60
  ---
@@ -416,6 +419,10 @@ Renders a circular container sized to its own `font-size`. Override the backgrou
416
419
  Composes class name strings, filtering out falsy values:
417
420
 
418
421
  ```ts
422
+ // Server-safe — works in Server Components, layouts, middleware
423
+ import { cn } from '@boostdev/components/utils';
424
+
425
+ // Also available from root or /client (but these are client-only in Next.js)
419
426
  import { cn } from '@boostdev/components';
420
427
 
421
428
  cn('card', isActive && 'card--active', [extraClass])