@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.
- package/AGENTS.md +21 -0
- package/README.md +15 -15
- package/dist/client.cjs +141 -120
- package/dist/client.css +468 -468
- package/dist/client.d.cts +71 -96
- package/dist/client.d.ts +71 -96
- package/dist/client.js +141 -120
- package/dist/index.cjs +141 -120
- package/dist/index.css +468 -468
- package/dist/index.d.cts +71 -96
- package/dist/index.d.ts +71 -96
- package/dist/index.js +141 -120
- package/package.json +1 -1
- package/src/components/interaction/Command/Command.tsx +4 -3
- package/src/components/interaction/Dialog/Dialog.tsx +4 -5
- package/src/components/interaction/Drawer/Drawer.spec.tsx +3 -3
- package/src/components/interaction/Drawer/Drawer.tsx +4 -7
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +4 -2
- package/src/components/interaction/Popover/Popover.tsx +4 -3
- package/src/components/interaction/Rating/Rating.tsx +4 -2
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx +4 -6
- package/src/components/interaction/form/Combobox/Combobox.tsx +4 -2
- package/src/components/interaction/form/FileInput/FileInput.tsx +4 -3
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +4 -3
- package/src/components/interaction/form/RadioGroup/RadioGroup.tsx +4 -6
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +4 -6
- package/src/components/interaction/form/atoms/InputContainer.tsx +2 -2
- package/src/components/layout/ButtonGroup/ButtonGroup.tsx +4 -6
- package/src/components/layout/Card/Card.tsx +4 -10
- package/src/components/layout/IconWrapper/IconWrapper.tsx +4 -5
- package/src/components/layout/SectionHeader/SectionHeader.tsx +5 -4
- package/src/components/ui/Accordion/Accordion.tsx +4 -3
- package/src/components/ui/Alert/Alert.tsx +4 -3
- package/src/components/ui/Avatar/Avatar.tsx +5 -3
- package/src/components/ui/Badge/Badge.tsx +4 -5
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +4 -3
- package/src/components/ui/Calendar/Calendar.tsx +4 -4
- package/src/components/ui/Carousel/Carousel.tsx +4 -4
- package/src/components/ui/DescriptionList/DescriptionList.tsx +4 -4
- package/src/components/ui/Loading/Loading.tsx +4 -3
- package/src/components/ui/NotificationBanner/NotificationBanner.tsx +4 -2
- package/src/components/ui/Pagination/Pagination.tsx +4 -2
- package/src/components/ui/Progress/Progress.tsx +4 -2
- package/src/components/ui/ProgressCircle/ProgressCircle.tsx +4 -1
- package/src/components/ui/Separator/Separator.tsx +5 -3
- package/src/components/ui/Skeleton/Skeleton.tsx +4 -3
- package/src/components/ui/SkipLink/SkipLink.tsx +4 -5
- package/src/components/ui/Tabs/Tabs.tsx +4 -4
- package/src/components/ui/Tooltip/Tooltip.tsx +4 -2
- package/src/components/ui/Typography/Typography.tsx +4 -5
- 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
|
|
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
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
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` | `
|
|
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 —
|
|
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
|
```
|