@boostdev/design-system-components 0.1.15 → 0.1.17
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 +4 -4
- package/README.md +50 -1
- package/dist/client.cjs +203 -114
- package/dist/client.css +520 -435
- package/dist/client.d.cts +23 -3
- package/dist/client.d.ts +23 -3
- package/dist/client.js +202 -114
- package/dist/index.cjs +203 -114
- package/dist/index.css +520 -435
- package/dist/index.d.cts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +202 -114
- package/package.json +1 -1
- package/src/components/interaction/Command/Command.mdx +1 -0
- package/src/components/interaction/Command/Command.spec.tsx +18 -0
- package/src/components/interaction/Command/Command.tsx +5 -0
- package/src/components/interaction/Dialog/Dialog.spec.tsx +18 -0
- package/src/components/interaction/Drawer/Drawer.spec.tsx +18 -0
- package/src/components/interaction/Drawer/Drawer.tsx +5 -0
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.mdx +64 -0
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +99 -0
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.spec.tsx +87 -0
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.stories.tsx +110 -0
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +89 -0
- package/src/components/interaction/form/SegmentedControl/index.ts +2 -0
- package/src/components/interaction/form/Switch/Switch.mdx +7 -2
- package/src/components/interaction/form/Switch/Switch.module.css +6 -6
- package/src/components/interaction/form/Switch/Switch.spec.tsx +23 -0
- package/src/components/interaction/form/Switch/Switch.stories.tsx +8 -0
- package/src/components/interaction/form/Switch/Switch.tsx +5 -2
- package/src/components/interaction/form/atoms/Label.module.css +0 -1
- package/src/components/ui/Progress/Progress.module.css +0 -4
- package/src/index.ts +2 -0
- package/src/stories/Introduction.mdx +4 -3
package/AGENTS.md
CHANGED
|
@@ -16,9 +16,9 @@ Or individual token layers. All component styles live inside `@layer component`.
|
|
|
16
16
|
|
|
17
17
|
## Component categories
|
|
18
18
|
|
|
19
|
-
- **ui/**: Pure display — Badge, Typography, Loading, Skeleton
|
|
19
|
+
- **ui/**: Pure display — Badge, Typography, Loading, Skeleton, Collapsible
|
|
20
20
|
- **interaction/**: Interactive — Button, Dialog, Toast (with Provider + hook), Rating
|
|
21
|
-
- **interaction/form/**: Form fields — FormInput, Checkbox, Radio (+ atom primitives Label, Message, InputContainer)
|
|
21
|
+
- **interaction/form/**: Form fields — FormInput, Checkbox, Radio, Switch, SegmentedControl (+ atom primitives Label, Message, InputContainer)
|
|
22
22
|
- **layout/**: Layout helpers — ButtonGroup, Card, SectionHeader, IconWrapper
|
|
23
23
|
|
|
24
24
|
## Styling conventions
|
|
@@ -79,8 +79,8 @@ Prefer semantic tokens over palette tokens. Key tokens for component states:
|
|
|
79
79
|
|-------|---------|---------|
|
|
80
80
|
| `--color_active` | Active / checked / filled state | Checkbox, Radio, Slider, Progress, ProgressCircle |
|
|
81
81
|
| `--color_on-active` | Content on `--color_active` | Checkbox tick, Radio inner dot |
|
|
82
|
-
| `--color_active--subtle` | Subtle background for active track | Switch
|
|
83
|
-
| `--color_active--strong` | Strong foreground for active thumb | Switch
|
|
82
|
+
| `--color_active--subtle` | Subtle background for active track | Switch (`--switch_track-bg--active`) |
|
|
83
|
+
| `--color_active--strong` | Strong foreground for active thumb | Switch (`--switch_thumb-bg--active`) |
|
|
84
84
|
| `--color_success--subtle` | Subtle background for success variant | Alert, NotificationBanner |
|
|
85
85
|
| `--color_on-success--subtle` | Text on success subtle background | Alert, NotificationBanner |
|
|
86
86
|
| `--color_interactive` | Focus ring colour | All focusable inputs |
|
package/README.md
CHANGED
|
@@ -76,6 +76,24 @@ Variants: `primary` (default) · `secondary` · `success` · `error` · `warning
|
|
|
76
76
|
|
|
77
77
|
---
|
|
78
78
|
|
|
79
|
+
#### Collapsible
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { Collapsible } from '@boostdev/components';
|
|
83
|
+
|
|
84
|
+
<Collapsible summary="What is the return policy?" defaultOpen>
|
|
85
|
+
You can return any item within 30 days of purchase.
|
|
86
|
+
</Collapsible>
|
|
87
|
+
|
|
88
|
+
{/* Group: only one open at a time */}
|
|
89
|
+
<Collapsible name="faq" summary="Question 1">Answer 1</Collapsible>
|
|
90
|
+
<Collapsible name="faq" summary="Question 2">Answer 2</Collapsible>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Built on native `<details>`/`<summary>`. Use `name` to group multiple Collapsibles so only one stays open at a time.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
79
97
|
#### Typography
|
|
80
98
|
|
|
81
99
|
```tsx
|
|
@@ -248,6 +266,37 @@ import { Radio } from '@boostdev/components';
|
|
|
248
266
|
<Radio label="Option B" name="choice" value="b" />
|
|
249
267
|
```
|
|
250
268
|
|
|
269
|
+
#### Switch
|
|
270
|
+
|
|
271
|
+
```tsx
|
|
272
|
+
import { Switch } from '@boostdev/components';
|
|
273
|
+
|
|
274
|
+
<Switch label="Enable notifications" name="notifications" />
|
|
275
|
+
<Switch label="Dark mode" name="dark-mode" defaultChecked />
|
|
276
|
+
<Switch label="On" name="theme" prefix="Off" size="small" />
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Sizes: `small` · `medium` (default) · `large`
|
|
280
|
+
|
|
281
|
+
#### SegmentedControl
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
import { SegmentedControl } from '@boostdev/components';
|
|
285
|
+
|
|
286
|
+
<SegmentedControl
|
|
287
|
+
name="view"
|
|
288
|
+
defaultValue="week"
|
|
289
|
+
options={[
|
|
290
|
+
{ value: 'day', label: 'Day' },
|
|
291
|
+
{ value: 'week', label: 'Week' },
|
|
292
|
+
{ value: 'month', label: 'Month' },
|
|
293
|
+
]}
|
|
294
|
+
onChange={value => console.log(value)}
|
|
295
|
+
/>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Single-select control with a sliding thumb. All options have equal width (sized to the widest). Sizes: `small` · `medium` (default) · `large`.
|
|
299
|
+
|
|
251
300
|
---
|
|
252
301
|
|
|
253
302
|
### Layout components
|
|
@@ -431,7 +480,7 @@ pnpm build # compile to dist/
|
|
|
431
480
|
pnpm typecheck # TypeScript check (library code only)
|
|
432
481
|
pnpm lint # ESLint
|
|
433
482
|
pnpm lint:css # Stylelint
|
|
434
|
-
pnpm test # Vitest —
|
|
483
|
+
pnpm test # Vitest — 329 tests
|
|
435
484
|
pnpm mcp:start # Start the MCP server locally (http://localhost:3001/api/mcp)
|
|
436
485
|
pnpm storybook # Storybook dev server on port 6006
|
|
437
486
|
```
|