@boostdev/design-system-components 1.2.1 → 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 (51) hide show
  1. package/AGENTS.md +21 -0
  2. package/README.md +15 -15
  3. package/dist/client.cjs +141 -120
  4. package/dist/client.css +468 -468
  5. package/dist/client.d.cts +71 -96
  6. package/dist/client.d.ts +71 -96
  7. package/dist/client.js +141 -120
  8. package/dist/index.cjs +141 -120
  9. package/dist/index.css +468 -468
  10. package/dist/index.d.cts +71 -96
  11. package/dist/index.d.ts +71 -96
  12. package/dist/index.js +141 -120
  13. package/package.json +1 -1
  14. package/src/components/interaction/Command/Command.tsx +4 -3
  15. package/src/components/interaction/Dialog/Dialog.tsx +4 -5
  16. package/src/components/interaction/Drawer/Drawer.spec.tsx +3 -3
  17. package/src/components/interaction/Drawer/Drawer.tsx +4 -7
  18. package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +4 -2
  19. package/src/components/interaction/Popover/Popover.tsx +4 -3
  20. package/src/components/interaction/Rating/Rating.tsx +4 -2
  21. package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx +4 -6
  22. package/src/components/interaction/form/Combobox/Combobox.tsx +4 -2
  23. package/src/components/interaction/form/FileInput/FileInput.tsx +4 -3
  24. package/src/components/interaction/form/NumberInput/NumberInput.tsx +4 -3
  25. package/src/components/interaction/form/RadioGroup/RadioGroup.tsx +4 -6
  26. package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +4 -6
  27. package/src/components/interaction/form/atoms/InputContainer.tsx +2 -2
  28. package/src/components/layout/ButtonGroup/ButtonGroup.tsx +4 -6
  29. package/src/components/layout/Card/Card.tsx +4 -10
  30. package/src/components/layout/IconWrapper/IconWrapper.tsx +4 -5
  31. package/src/components/layout/SectionHeader/SectionHeader.tsx +5 -4
  32. package/src/components/ui/Accordion/Accordion.tsx +4 -3
  33. package/src/components/ui/Alert/Alert.tsx +4 -3
  34. package/src/components/ui/Avatar/Avatar.tsx +5 -3
  35. package/src/components/ui/Badge/Badge.tsx +4 -5
  36. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +4 -3
  37. package/src/components/ui/Calendar/Calendar.tsx +4 -4
  38. package/src/components/ui/Carousel/Carousel.tsx +4 -4
  39. package/src/components/ui/DescriptionList/DescriptionList.tsx +4 -4
  40. package/src/components/ui/Loading/Loading.tsx +4 -3
  41. package/src/components/ui/NotificationBanner/NotificationBanner.tsx +4 -2
  42. package/src/components/ui/Pagination/Pagination.tsx +4 -2
  43. package/src/components/ui/Progress/Progress.tsx +4 -2
  44. package/src/components/ui/ProgressCircle/ProgressCircle.tsx +4 -1
  45. package/src/components/ui/Separator/Separator.tsx +5 -3
  46. package/src/components/ui/Skeleton/Skeleton.tsx +4 -3
  47. package/src/components/ui/SkipLink/SkipLink.tsx +4 -5
  48. package/src/components/ui/Tabs/Tabs.tsx +4 -4
  49. package/src/components/ui/Tooltip/Tooltip.tsx +4 -2
  50. package/src/components/ui/Typography/Typography.tsx +4 -5
  51. package/src/stories/DesignSystem/Grid.mdx +2 -0
package/AGENTS.md CHANGED
@@ -224,6 +224,27 @@ References: https://developer.mozilla.org/en-US/docs/Web/Accessibility | https:/
224
224
  - **State guard in open/close methods**: `_open()` and `_close()` on stateful web components must return early if already in the target state, to prevent dispatching redundant events to listeners.
225
225
  - **Drawer/Dialog animation**: `<dialog>` is the sliding panel itself — no wrapper div. Slide animation uses `translate` + `@starting-style` only. Do **not** add `@keyframes` — mixing `@keyframes` (open) with `translate` transition (close) causes a stutter. Backdrop uses `opacity: 0` as default with `@starting-style { opacity: 0 }` on `[open]::backdrop` for a smooth fade. `display` and `overlay` discrete transitions must include the easing function before `allow-discrete`.
226
226
 
227
+ ## HTML attribute forwarding
228
+
229
+ All components accept the full set of native HTML attributes for their root element. Props interfaces extend the appropriate `HTMLAttributes<HTMLXxxElement>` type and spread `...rest` onto the root element:
230
+
231
+ ```tsx
232
+ interface BadgeProps extends WithClassName, HTMLAttributes<HTMLSpanElement> {
233
+ variant?: 'primary' | 'secondary' | 'success' | 'error' | 'warning';
234
+ }
235
+
236
+ export function Badge({ variant = 'primary', className, children, ...rest }: BadgeProps) {
237
+ return <span {...rest} className={cn(css.badge, className)}>{children}</span>;
238
+ }
239
+ ```
240
+
241
+ Key patterns:
242
+ - Spread `{...rest}` **before** component-controlled attributes so explicit props always win
243
+ - Use `Omit<HTMLAttributes<...>, 'prop'>` when a custom prop has an incompatible type with the HTML attribute (e.g. `title` as `ReactNode` instead of `string`, `onChange` with a custom signature, `content` as `ReactNode`)
244
+ - Components wrapping `<fieldset>` use `FieldsetHTMLAttributes<HTMLFieldSetElement>`
245
+ - Components wrapping `<a>` use `AnchorHTMLAttributes<HTMLAnchorElement>`
246
+ - Composite form components (Combobox, NumberInput, FileInput) forward `...rest` through `InputContainer`
247
+
227
248
  ## Adding new components
228
249
 
229
250
  1. Create `src/components/{category}/{ComponentName}/`
package/README.md CHANGED
@@ -243,7 +243,7 @@ Toasts auto-dismiss after 5 seconds.
243
243
 
244
244
  ### Form components
245
245
 
246
- All form components accept standard HTML input attributes via spread in addition to their own props.
246
+ All components accept native HTML attributes for their root element via `...rest` spread in addition to their own props. This means you can pass `id`, `data-*`, `aria-*`, `style`, event handlers, and any other valid HTML attribute directly.
247
247
 
248
248
  #### FormInput
249
249
 
@@ -309,20 +309,20 @@ Sizes: `small` · `medium` (default) · `large`
309
309
  ```tsx
310
310
  import { SegmentedControl } from '@boostdev/components';
311
311
 
312
- <SegmentedControl
313
- name="view"
314
- defaultValue="week"
315
- aria-label="Calendar view"
316
- options={[
317
- { value: 'day', label: 'Day' },
318
- { value: 'week', label: 'Week' },
319
- { value: 'month', label: 'Month' },
320
- ]}
321
- onChange={value => console.log(value)}
322
- />
312
+ <SegmentedControl aria-label="Calendar view" selectedIndex={1}>
313
+ <button>Day</button>
314
+ <button>Week</button>
315
+ <button>Month</button>
316
+ </SegmentedControl>
317
+
318
+ {/* Navigation variant — active item auto-detected from aria-current */}
319
+ <SegmentedControl aria-label="Section">
320
+ <a href="/overview" aria-current="page">Overview</a>
321
+ <a href="/details">Details</a>
322
+ </SegmentedControl>
323
323
  ```
324
324
 
325
- Single-select control with a sliding thumb. All options have equal width (sized to the widest). Sizes: `small` · `medium` (default) · `large`.
325
+ Children-based API pass `<button>`, `<a>`, or router `<Link>` elements directly. Active item is set via `selectedIndex` or auto-detected from `aria-current="page"` / `aria-pressed={true}` / `aria-selected={true}`. Variants: `outline` (default) · `filled`. Sizes: `small` · `medium` (default) · `large`.
326
326
 
327
327
  ---
328
328
 
@@ -362,7 +362,7 @@ import { Card } from '@boostdev/components';
362
362
  | `variant` | `'default' \| 'elevated' \| 'outlined'` | `'default'` |
363
363
  | `padding` | `'none' \| 'small' \| 'medium' \| 'large'` | `'medium'` |
364
364
  | `textAlign` | `'start' \| 'center' \| 'end'` | `'start'` |
365
- | `onClick` | `() => void` | — renders a `<button>` |
365
+ | `onClick` | `MouseEventHandler<HTMLElement>` | — renders a `<button>` |
366
366
 
367
367
  ---
368
368
 
@@ -515,7 +515,7 @@ pnpm build # compile to dist/
515
515
  pnpm typecheck # TypeScript check (library code only)
516
516
  pnpm lint # ESLint
517
517
  pnpm lint:css # Stylelint
518
- pnpm test # Vitest — 364 tests
518
+ pnpm test # Vitest — 857 tests
519
519
  pnpm mcp:start # Start the MCP server locally (http://localhost:3001/api/mcp)
520
520
  pnpm storybook # Storybook dev server on port 6006
521
521
  ```