@sdaia-ds/mcp 0.0.0-stage → 3.1.1
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/README.md +212 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +291 -0
- package/dist/index.js.map +1 -0
- package/knowledge/actions/breadcrumb.md +50 -0
- package/knowledge/actions/button-menu.md +82 -0
- package/knowledge/actions/button-split.md +69 -0
- package/knowledge/actions/button.md +101 -0
- package/knowledge/actions/content-switcher.md +66 -0
- package/knowledge/actions/date-picker.md +115 -0
- package/knowledge/actions/floating-button.md +100 -0
- package/knowledge/actions/horizontal-tabs.md +52 -0
- package/knowledge/actions/link.md +76 -0
- package/knowledge/actions/modal.md +103 -0
- package/knowledge/actions/pagination.md +69 -0
- package/knowledge/actions/radio-button.md +88 -0
- package/knowledge/actions/switch.md +87 -0
- package/knowledge/actions/tag.md +69 -0
- package/knowledge/ai/agent-activity.md +65 -0
- package/knowledge/ai/agent-card.md +65 -0
- package/knowledge/ai/agent-handoff.md +65 -0
- package/knowledge/ai/ai-citation.md +78 -0
- package/knowledge/ai/ai-code-block.md +86 -0
- package/knowledge/ai/ai-disclaimer.md +84 -0
- package/knowledge/ai/ai-message-bubble.md +81 -0
- package/knowledge/ai/ai-message.md +118 -0
- package/knowledge/ai/ai-prompt-input.md +93 -0
- package/knowledge/ai/ai-states.md +107 -0
- package/knowledge/ai/ai-status-indicator.md +81 -0
- package/knowledge/ai/ai-suggested-prompts.md +62 -0
- package/knowledge/ai/ai-thinking-indicator.md +94 -0
- package/knowledge/ai/artifact-viewer.md +105 -0
- package/knowledge/ai/citation.md +61 -0
- package/knowledge/ai/context-manager.md +111 -0
- package/knowledge/ai/prompt-context.md +72 -0
- package/knowledge/ai/prompt-suggestion.md +68 -0
- package/knowledge/ai/prompt-template.md +71 -0
- package/knowledge/ai/prompt-variable.md +61 -0
- package/knowledge/ai/reasoning-trace.md +106 -0
- package/knowledge/ai/source-explorer.md +117 -0
- package/knowledge/ai/source-group.md +59 -0
- package/knowledge/ai/source-reference.md +70 -0
- package/knowledge/ai/thinking-panel.md +77 -0
- package/knowledge/ai/tool-activity-feed.md +67 -0
- package/knowledge/ai/tool-call-card.md +66 -0
- package/knowledge/ai/tool-status-row.md +72 -0
- package/knowledge/ai/tool-timeline-item.md +71 -0
- package/knowledge/ai/voice-session.md +93 -0
- package/knowledge/feedback/alert.md +106 -0
- package/knowledge/feedback/badge.md +86 -0
- package/knowledge/feedback/card.md +54 -0
- package/knowledge/feedback/feedback-overview.md +37 -0
- package/knowledge/feedback/feedback.md +46 -0
- package/knowledge/feedback/help-icon.md +57 -0
- package/knowledge/feedback/loading-indicator.md +76 -0
- package/knowledge/feedback/notification-banner.md +73 -0
- package/knowledge/feedback/notification-popup.md +87 -0
- package/knowledge/feedback/notifications.md +158 -0
- package/knowledge/feedback/progress-bar.md +69 -0
- package/knowledge/feedback/rating-overview.md +58 -0
- package/knowledge/feedback/rating.md +64 -0
- package/knowledge/feedback/skeleton-avatar.md +48 -0
- package/knowledge/feedback/skeleton.md +53 -0
- package/knowledge/feedback/toast.md +74 -0
- package/knowledge/feedback/tooltip.md +72 -0
- package/knowledge/form/autocomplete.md +100 -0
- package/knowledge/form/checkbox.md +95 -0
- package/knowledge/form/date-time-field.md +63 -0
- package/knowledge/form/error-summary.md +56 -0
- package/knowledge/form/field-group.md +57 -0
- package/knowledge/form/file-uploader.md +60 -0
- package/knowledge/form/form-section.md +58 -0
- package/knowledge/form/number-input.md +92 -0
- package/knowledge/form/otp-input.md +83 -0
- package/knowledge/form/password-input.md +49 -0
- package/knowledge/form/range-slider.md +71 -0
- package/knowledge/form/rich-text-editor.md +106 -0
- package/knowledge/form/select.md +113 -0
- package/knowledge/form/signature.md +83 -0
- package/knowledge/form/slider.md +66 -0
- package/knowledge/form/text-area.md +90 -0
- package/knowledge/form/text-input.md +132 -0
- package/knowledge/form/time-input.md +44 -0
- package/knowledge/form/time-picker.md +73 -0
- package/knowledge/foundations/accessibility.md +97 -0
- package/knowledge/foundations/colors.md +1117 -0
- package/knowledge/foundations/figma.md +30 -0
- package/knowledge/foundations/icon-usage.md +114 -0
- package/knowledge/foundations/icons.md +16 -0
- package/knowledge/foundations/motion.md +39 -0
- package/knowledge/foundations/radius.md +17 -0
- package/knowledge/foundations/responsive.md +64 -0
- package/knowledge/foundations/rtl.md +106 -0
- package/knowledge/foundations/spacing.md +27 -0
- package/knowledge/foundations/theme.md +115 -0
- package/knowledge/foundations/tokens.json +12124 -0
- package/knowledge/foundations/typography.md +45 -0
- package/knowledge/general/accordion.md +79 -0
- package/knowledge/general/activity.md +44 -0
- package/knowledge/general/app-shell.md +64 -0
- package/knowledge/general/area-chart.md +89 -0
- package/knowledge/general/audio-player.md +85 -0
- package/knowledge/general/avatar-group.md +50 -0
- package/knowledge/general/avatar.md +61 -0
- package/knowledge/general/carousel-image.md +103 -0
- package/knowledge/general/chart.md +25 -0
- package/knowledge/general/chip.md +90 -0
- package/knowledge/general/code-snippet.md +80 -0
- package/knowledge/general/column-chart.md +84 -0
- package/knowledge/general/context-menu.md +55 -0
- package/knowledge/general/digital-stamp.md +77 -0
- package/knowledge/general/divider.md +65 -0
- package/knowledge/general/donut-chart.md +75 -0
- package/knowledge/general/draggable-list.md +43 -0
- package/knowledge/general/dropdown.md +90 -0
- package/knowledge/general/empty-state.md +60 -0
- package/knowledge/general/filtration.md +85 -0
- package/knowledge/general/footer.md +59 -0
- package/knowledge/general/line-chart.md +95 -0
- package/knowledge/general/list.md +91 -0
- package/knowledge/general/media-gallery.md +85 -0
- package/knowledge/general/media-viewer.md +78 -0
- package/knowledge/general/menu.md +66 -0
- package/knowledge/general/metric.md +92 -0
- package/knowledge/general/nav-bar.md +62 -0
- package/knowledge/general/nav-header.md +125 -0
- package/knowledge/general/number.md +72 -0
- package/knowledge/general/page-template.md +80 -0
- package/knowledge/general/pdf-viewer.md +91 -0
- package/knowledge/general/pie-chart-panel.md +86 -0
- package/knowledge/general/popover.md +115 -0
- package/knowledge/general/progress-circle.md +63 -0
- package/knowledge/general/quote.md +64 -0
- package/knowledge/general/radial-stepper.md +72 -0
- package/knowledge/general/scatter-chart.md +62 -0
- package/knowledge/general/second-nav-header.md +55 -0
- package/knowledge/general/slideout-menu.md +92 -0
- package/knowledge/general/stepper.md +42 -0
- package/knowledge/general/structured-list.md +52 -0
- package/knowledge/general/table-bulk-actions-bar.md +66 -0
- package/knowledge/general/table-of-content.md +49 -0
- package/knowledge/general/table.md +113 -0
- package/knowledge/general/tree-view.md +55 -0
- package/knowledge/general/vertical-tabs.md +48 -0
- package/knowledge/general/video-player.md +88 -0
- package/knowledge/manifest.json +919 -0
- package/knowledge/patterns/buttons-with-sdaia-touch.md +34 -0
- package/knowledge/patterns/sdaia-logo-animation.md +35 -0
- package/knowledge/patterns/switch-with-sdaia-touch.md +29 -0
- package/knowledge/setup.md +125 -0
- package/package.json +45 -4
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Slideout Menu
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Slideout Menu
|
|
5
|
+
- Slug: `slideout-menu`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add slideout-menu`
|
|
8
|
+
- Import: `import { SlideoutMenu } from '@/components/ui/SlideoutMenu'`
|
|
9
|
+
- Installed files: `SlideoutMenu.tsx`, `SlideoutMenu.types.ts`, `SlideoutMenu.variants.ts`, `SlideoutMenuDivider.tsx`, `SlideoutMenuSection.tsx`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/slideoutmenu
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add slideout-menu`. It copies the source into your components folder (`components/ui/SlideoutMenu/`, under `src/` when the project has one); import it as `@/components/ui/SlideoutMenu`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction applied to the panel. Also picks the slide direction (inline-end in LTR, inline-start in RTL). Omit to inherit (LTR motion). |
|
|
18
|
+
| `title?` | `string` | — | Header title (also names the dialog). Nothing is rendered when omitted. |
|
|
19
|
+
| `description?` | `string` | — | Header description text. Nothing is rendered when omitted. |
|
|
20
|
+
| `headerIcon?` | `ReactNode` | — | Optional header icon (rendered inside a bordered circle) |
|
|
21
|
+
| `divider?` | `boolean` | true | Whether to show header dividers and section dividers |
|
|
22
|
+
| `showFooter?` | `boolean` | true | Whether to show the footer. Each footer button only renders when its label is provided. |
|
|
23
|
+
| `primaryButtonLabel?` | `string` | — | Primary (dark) button label. The button is not rendered when omitted. |
|
|
24
|
+
| `secondaryButtonLabel?` | `string` | — | Secondary (outline) button label. The button is not rendered when omitted. |
|
|
25
|
+
| `onPrimaryClick?` | `() => void` | — | Primary button click handler |
|
|
26
|
+
| `onSecondaryClick?` | `() => void` | — | Secondary button click handler |
|
|
27
|
+
| `onClose?` | `() => void` | — | Close handler — called by the header close button and by Escape while focus is inside the panel. Without it the header button collapses / re-expands the panel body instead. |
|
|
28
|
+
| `open?` | `boolean` | true | Whether the slideout is open/visible. |
|
|
29
|
+
| `modal?` | `boolean` | true | Modal dialog semantics (`aria-modal="true"`, Tab is kept inside the panel). Set `false` for a non-modal side panel that sits beside content. |
|
|
30
|
+
| `surface?` | `'solid' \| 'glass'` | 'solid' | Surface treatment — `'solid'` (default) or `'glass'` (translucent liquid-glass material). |
|
|
31
|
+
| `labels?` | `Partial<SlideoutMenuLabels>` | — | Override the built-in accessible strings (English defaults). |
|
|
32
|
+
| `children?` | `ReactNode` | — | Content to render in the body |
|
|
33
|
+
| `className?` | `string` | — | Additional class names for the outer container |
|
|
34
|
+
|
|
35
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `dir`, `children`.
|
|
36
|
+
|
|
37
|
+
## Options (allowed values)
|
|
38
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction applied to the panel. Also picks the slide direction
|
|
39
|
+
(inline-end in LTR, inline-start in RTL). Omit to inherit (LTR motion).
|
|
40
|
+
- `surface`: `'solid'` \| `'glass'` — Surface treatment of the slide-out panel.
|
|
41
|
+
- `'solid'` (default) — opaque panel background.
|
|
42
|
+
- `'glass'` — translucent liquid-glass material (blurred backdrop +
|
|
43
|
+
beveled edge highlight). Reads best when the panel overlays imagery
|
|
44
|
+
or color.
|
|
45
|
+
|
|
46
|
+
The visual is provided by the shared `.glass-surface` utility, so it is
|
|
47
|
+
theme-aware (light / dark) and identical across every component that
|
|
48
|
+
exposes a `surface` prop.
|
|
49
|
+
|
|
50
|
+
## Deprecated props
|
|
51
|
+
Do not use in new code:
|
|
52
|
+
- `rtl`
|
|
53
|
+
|
|
54
|
+
## Accessibility
|
|
55
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
56
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
57
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
58
|
+
|
|
59
|
+
## Design tokens used
|
|
60
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
61
|
+
- `var(--ds-color-bg-default)`
|
|
62
|
+
- `var(--ds-color-bg-overlay)`
|
|
63
|
+
- `var(--ds-color-border-brand)`
|
|
64
|
+
- `var(--ds-color-border-default)`
|
|
65
|
+
- `var(--ds-color-icon-default)`
|
|
66
|
+
- `var(--ds-color-icon-neutral)`
|
|
67
|
+
- `var(--ds-color-text-default)`
|
|
68
|
+
- `var(--ds-color-text-display)`
|
|
69
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
70
|
+
- `var(--ds-motion-enter-duration)`
|
|
71
|
+
- `var(--ds-motion-enter-easing)`
|
|
72
|
+
- `var(--ds-motion-exit-duration)`
|
|
73
|
+
- `var(--ds-motion-exit-easing)`
|
|
74
|
+
- `var(--ds-motion-feedback-duration)`
|
|
75
|
+
- `var(--ds-motion-feedback-easing)`
|
|
76
|
+
- `var(--ds-radius-full)`
|
|
77
|
+
- `var(--ds-radius-xxs)`
|
|
78
|
+
- `var(--ds-spacing-3xl)`
|
|
79
|
+
- `var(--ds-spacing-lg)`
|
|
80
|
+
- `var(--ds-spacing-md)`
|
|
81
|
+
- `var(--ds-spacing-xl)`
|
|
82
|
+
- `var(--ds-spacing-xs)`
|
|
83
|
+
- `var(--ds-spacing-xxs)`
|
|
84
|
+
- `var(--ds-text-leading-line-heights-text-xs)`
|
|
85
|
+
|
|
86
|
+
## AI usage guidance
|
|
87
|
+
When generating UI:
|
|
88
|
+
- Install with `npx sdaia-ui@latest add slideout-menu` (after `npx sdaia-ui@latest init`), then import `{ SlideoutMenu }` from `@/components/ui/SlideoutMenu`.
|
|
89
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
90
|
+
- Use only the documented option values listed under "Options".
|
|
91
|
+
- Pass icons via `<DgaIcon data={…} className="size-icon-sm" />` from `@platformscode/icons` only — see `get_foundations` (`icon-usage`). Never emoji, Lucide, or random icons (e.g. `pizza01Stroke` for dark mode).
|
|
92
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Stepper
|
|
5
|
+
- Slug: `stepper`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add stepper`
|
|
8
|
+
- Import: `import { Stepper } from '@/components/ui/Stepper'`
|
|
9
|
+
- Installed files: `Stepper.tsx`, `Stepper.types.ts`, `Stepper.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/stepper
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add stepper`. It copies the source into your components folder (`components/ui/Stepper/`, under `src/` when the project has one); import it as `@/components/ui/Stepper`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `orientation?` | `StepperOrientation` | 'horizontal' | Layout of the steps (Figma `Orientation`). Horizontal sits above a form; vertical fits a side panel. A horizontal stepper restacks vertically when its container is narrower than 36rem (576px). |
|
|
18
|
+
| `currentStep?` | `number` | — | Number of the step the user is on (1-based, like the numbers shown). Steps before it become `completed`, it becomes `current`, later ones `upcoming`. A `status` set on a `StepperItem` always wins (e.g. `error`). |
|
|
19
|
+
| `children?` | `ReactNode` | — | `StepperItem` elements, in order. |
|
|
20
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the stepper. Inherits from the document when omitted. |
|
|
21
|
+
| `labels?` | `Partial<StepperItemLabels>` | — | Screen-reader status words for every step (English defaults). |
|
|
22
|
+
|
|
23
|
+
Also accepts standard `<element>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
|
|
24
|
+
|
|
25
|
+
## Options (allowed values)
|
|
26
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction of the stepper. Inherits from the document when omitted.
|
|
27
|
+
|
|
28
|
+
## Accessibility
|
|
29
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
30
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
31
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
32
|
+
|
|
33
|
+
## Design tokens used
|
|
34
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
35
|
+
- `var(--ds-brand-spacing-space-4)`
|
|
36
|
+
|
|
37
|
+
## AI usage guidance
|
|
38
|
+
When generating UI:
|
|
39
|
+
- Install with `npx sdaia-ui@latest add stepper` (after `npx sdaia-ui@latest init`), then import `{ Stepper }` from `@/components/ui/Stepper`.
|
|
40
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
41
|
+
- Use only the documented option values listed under "Options".
|
|
42
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Structured List
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Structured List
|
|
5
|
+
- Slug: `structured-list`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add structured-list`
|
|
8
|
+
- Import: `import { StructuredList } from '@/components/ui/StructuredList'`
|
|
9
|
+
- Installed files: `StructuredList.tsx`, `StructuredList.types.ts`, `StructuredList.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/structuredlist
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add structured-list`. It copies the source into your components folder (`components/ui/StructuredList/`, under `src/` when the project has one); import it as `@/components/ui/StructuredList`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `columns` | `StructuredListColumn[]` | — | Array of columns, each with a header and rows |
|
|
18
|
+
| `compact?` | `boolean` | false | Use compact row height (48px instead of 64px) |
|
|
19
|
+
| `contained?` | `boolean` | false | Add border and rounded corners around the list |
|
|
20
|
+
| `dividerRow?` | `boolean` | true | Show horizontal dividers between data rows (default: true) |
|
|
21
|
+
| `dividerColumn?` | `boolean` | true | Show vertical dividers between columns (default: true) |
|
|
22
|
+
| `dividerHeader?` | `boolean` | true | Show divider under the header row (default: true) |
|
|
23
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
|
|
24
|
+
| `className?` | `string` | — | Additional class name |
|
|
25
|
+
|
|
26
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`, `dir`.
|
|
27
|
+
|
|
28
|
+
## Options (allowed values)
|
|
29
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
|
|
30
|
+
|
|
31
|
+
## Deprecated props
|
|
32
|
+
Do not use in new code:
|
|
33
|
+
- `rtl`
|
|
34
|
+
|
|
35
|
+
## Accessibility
|
|
36
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
37
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
38
|
+
|
|
39
|
+
## Design tokens used
|
|
40
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
41
|
+
- `var(--ds-color-border-default)`
|
|
42
|
+
- `var(--ds-color-table-text-head)`
|
|
43
|
+
- `var(--ds-radius-m)`
|
|
44
|
+
- `var(--ds-spacing-lg)`
|
|
45
|
+
- `var(--ds-spacing-xl)`
|
|
46
|
+
|
|
47
|
+
## AI usage guidance
|
|
48
|
+
When generating UI:
|
|
49
|
+
- Install with `npx sdaia-ui@latest add structured-list` (after `npx sdaia-ui@latest init`), then import `{ StructuredList }` from `@/components/ui/StructuredList`.
|
|
50
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
51
|
+
- Use only the documented option values listed under "Options".
|
|
52
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Table Bulk Actions Bar
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Table Bulk Actions Bar
|
|
5
|
+
- Slug: `table-bulk-actions-bar`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add table-bulk-actions-bar`
|
|
8
|
+
- Import: `import { TableBulkActionsBar } from '@/components/ui/TableBulkActionsBar'`
|
|
9
|
+
- Installed files: `TableBulkActionsBar.tsx`, `TableBulkActionsBar.types.ts`, `TableBulkActionsBar.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/table-bulk-actions-bar
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add table-bulk-actions-bar`. It copies the source into your components folder (`components/ui/TableBulkActionsBar/`, under `src/` when the project has one); import it as `@/components/ui/TableBulkActionsBar`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `selectedCount` | `number` | — | Number of selected rows — e.g. `selectedRowKeys.length` from the `Table`'s `onSelectionChange`. The bar is hidden while it is 0. |
|
|
18
|
+
| `totalCount?` | `number` | — | Number of rows that can be selected. Drives the select-all checkbox: indeterminate while only some rows are selected, checked when all are. When omitted the checkbox shows the indeterminate (some selected) mark. |
|
|
19
|
+
| `onSelectAllChange?` | `(checked: boolean) => void` | — | Called by the select-all checkbox with `true` (select every row) or `false` (clear). The checkbox renders only when this is set. |
|
|
20
|
+
| `onClearSelection?` | `() => void` | — | Called by the "Clear selection" link. The link renders only when this is set (Figma boolean `Clear Selection`). |
|
|
21
|
+
| `onClose?` | `() => void` | — | Called by the close (×) button, which dismisses the bar — usually by clearing the selection. The button renders only when this is set (Figma boolean `Close Button`). |
|
|
22
|
+
| `actions?` | `ReactNode` | — | The bulk actions — usually up to three small `Button`s such as Approve, Export and Delete (Figma `Export Action` / `Delete Action`). Use a menu for more. Destructive actions must ask for confirmation. |
|
|
23
|
+
| `returnFocusRef?` | `RefObject<HTMLElement \| null>` | — | Where keyboard focus goes when the bar hides while it holds focus (after "Clear selection", close or select-all → clear). Defaults to the first focusable element after the bar — for an inline bar, the table's select-all checkbox — so focus is never dropped on the page body. |
|
|
24
|
+
| `position?` | `'inline' \| 'floating'` | 'inline' | Placement and surface (Figma `Position`). |
|
|
25
|
+
| `labels?` | `Partial<TableBulkActionsBarLabels>` | — | Localised built-in strings (English defaults). |
|
|
26
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the bar. Inherits from the document when omitted. Figma `RTL=True` maps to `dir="rtl"`. |
|
|
27
|
+
|
|
28
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`, `children`.
|
|
29
|
+
|
|
30
|
+
## Options (allowed values)
|
|
31
|
+
- `position`: `'inline'` \| `'floating'` — Where the bar sits (Figma `Position`).
|
|
32
|
+
- `inline` — above the table header, in place of the table toolbar; light
|
|
33
|
+
brand surface.
|
|
34
|
+
- `floating` — raised surface with a shadow that sticks 24px above the
|
|
35
|
+
bottom of the viewport while a long table scrolls (`position: sticky`, so
|
|
36
|
+
it settles back in place at the end of the table instead of covering the
|
|
37
|
+
pagination). Place it right after the `Table`.
|
|
38
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction of the bar. Inherits from the document when omitted.
|
|
39
|
+
Figma `RTL=True` maps to `dir="rtl"`.
|
|
40
|
+
|
|
41
|
+
## Accessibility
|
|
42
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
43
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
44
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
45
|
+
|
|
46
|
+
## Design tokens used
|
|
47
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
48
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
49
|
+
- `var(--ds-color-bg-raised)`
|
|
50
|
+
- `var(--ds-color-border-brand-subtle)`
|
|
51
|
+
- `var(--ds-color-border-default)`
|
|
52
|
+
- `var(--ds-color-text-default)`
|
|
53
|
+
- `var(--ds-radius-m)`
|
|
54
|
+
- `var(--ds-spacing-3xl)`
|
|
55
|
+
- `var(--ds-spacing-lg)`
|
|
56
|
+
- `var(--ds-spacing-md)`
|
|
57
|
+
- `var(--ds-spacing-xl)`
|
|
58
|
+
- `var(--ds-spacing-xs)`
|
|
59
|
+
- `var(--ds-text-leading-line-heights-text-sm)`
|
|
60
|
+
|
|
61
|
+
## AI usage guidance
|
|
62
|
+
When generating UI:
|
|
63
|
+
- Install with `npx sdaia-ui@latest add table-bulk-actions-bar` (after `npx sdaia-ui@latest init`), then import `{ TableBulkActionsBar }` from `@/components/ui/TableBulkActionsBar`.
|
|
64
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
65
|
+
- Use only the documented option values listed under "Options".
|
|
66
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Table of Content
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Table of Content
|
|
5
|
+
- Slug: `table-of-content`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add table-of-content`
|
|
8
|
+
- Import: `import { TableOfContent } from '@/components/ui/TableOfContent'`
|
|
9
|
+
- Installed files: `TableOfContent.tsx`, `TableOfContent.types.ts`, `TableOfContent.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/table-of-content
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add table-of-content`. It copies the source into your components folder (`components/ui/TableOfContent/`, under `src/` when the project has one); import it as `@/components/ui/TableOfContent`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `label?` | `ReactNode` | — | Small header label above the page name (rich content allowed). Takes precedence over `labels.heading`. |
|
|
18
|
+
| `labels?` | `Partial<TableOfContentLabels>` | — | Translatable built-in strings. |
|
|
19
|
+
| `pageName` | `ReactNode` | — | The current page title displayed in the header. |
|
|
20
|
+
| `lists` | `TableOfContentListItem[][]` | — | Lists of TOC items (each list is a separate group). Matches Figma where multiple lists can appear stacked. |
|
|
21
|
+
| `selectedId?` | `string` | — | Controlled selected item id (forwarded to every list). |
|
|
22
|
+
| `defaultSelectedId?` | `string` | — | Uncontrolled initial selected item id. Defaults to the first item of the first list. |
|
|
23
|
+
| `onSelectedIdChange?` | `(id: string) => void` | — | Called when an item is activated (click / Enter / Space). |
|
|
24
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction applied to the root. Inherits when omitted. |
|
|
25
|
+
|
|
26
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
|
|
27
|
+
|
|
28
|
+
## Options (allowed values)
|
|
29
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction applied to the root. Inherits when omitted.
|
|
30
|
+
|
|
31
|
+
## Accessibility
|
|
32
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
33
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
34
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
35
|
+
|
|
36
|
+
## Design tokens used
|
|
37
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
38
|
+
- `var(--ds-color-text-display)`
|
|
39
|
+
- `var(--ds-color-text-paragraph)`
|
|
40
|
+
- `var(--ds-spacing-md)`
|
|
41
|
+
- `var(--ds-text-leading-line-heights-text-sm)`
|
|
42
|
+
- `var(--ds-text-leading-line-heights-text-xl)`
|
|
43
|
+
|
|
44
|
+
## AI usage guidance
|
|
45
|
+
When generating UI:
|
|
46
|
+
- Install with `npx sdaia-ui@latest add table-of-content` (after `npx sdaia-ui@latest init`), then import `{ TableOfContent }` from `@/components/ui/TableOfContent`.
|
|
47
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
48
|
+
- Use only the documented option values listed under "Options".
|
|
49
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Table
|
|
5
|
+
- Slug: `table`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add table`
|
|
8
|
+
- Import: `import { Table } from '@/components/ui/Table'`
|
|
9
|
+
- Installed files: `Table.tsx`, `Table.types.ts`, `Table.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/table
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add table`. It copies the source into your components folder (`components/ui/Table/`, under `src/` when the project has one); import it as `@/components/ui/Table`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `title?` | `ReactNode` | — | Title shown in the table header band |
|
|
18
|
+
| `description?` | `ReactNode` | — | Optional description shown beneath the title |
|
|
19
|
+
| `headerActions?` | `ReactNode` | — | Custom slot for action content (e.g. `<Button/>`s) on the trailing side of the header |
|
|
20
|
+
| `showMoreIcon?` | `boolean` | — | Shows the inline more (3-dot) icon button after the header actions |
|
|
21
|
+
| `onMoreClick?` | `() => void` | — | Click handler for the more icon. If omitted the icon is not rendered |
|
|
22
|
+
| `hideHeader?` | `boolean` | false | Hides the entire top header band (title/description/actions) |
|
|
23
|
+
| `columns` | `TableColumn[]` | — | Column definitions |
|
|
24
|
+
| `rows` | `TableRowData[]` | — | Row data |
|
|
25
|
+
| `divider?` | `'none' \| 'horizontal' \| 'vertical' \| 'both'` | 'none' | Divider style between rows/columns |
|
|
26
|
+
| `sortKey?` | `string` | — | Controlled sort key |
|
|
27
|
+
| `sortDirection?` | `'asc' \| 'desc'` | — | Controlled sort direction |
|
|
28
|
+
| `onSort?` | `(key: string, direction: TableSortDirection) => void` | — | Fired when a sortable header cell is clicked |
|
|
29
|
+
| `showPagination?` | `boolean` | false | Shows the pagination footer |
|
|
30
|
+
| `page?` | `number` | 1 | Current page number (1-based) |
|
|
31
|
+
| `totalPages?` | `number` | 1 | Total page count |
|
|
32
|
+
| `onPageChange?` | `(page: number) => void` | — | Fired when prev/next is clicked |
|
|
33
|
+
| `mobile?` | `boolean` | false | Forces the mobile layout regardless of viewport |
|
|
34
|
+
| `labels?` | `Partial<TableLabels>` | — | Override built-in strings (English defaults) to localize pagination, actions and selection labels. |
|
|
35
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
|
|
36
|
+
| `selectable?` | `boolean` | false | Adds a checkbox to the first column of every row plus a select-all checkbox in its header cell (Figma: header / row cell Type=Checkbox). |
|
|
37
|
+
| `selectedRowKeys?` | `TableRowKey[]` | — | Controlled selection: keys of the selected rows. |
|
|
38
|
+
| `defaultSelectedRowKeys?` | `TableRowKey[]` | — | Uncontrolled initial selection. Ignored when `selectedRowKeys` is set. |
|
|
39
|
+
| `onSelectionChange?` | `(selectedRowKeys: TableRowKey[], selectedRows: TableRowData[]) => void` | — | Fired when the selection changes, with the new keys and the selected rows among `rows`. |
|
|
40
|
+
| `getRowKey?` | `(row: TableRowData) => TableRowKey` | defaultGetRowKey | Derives a row's selection key. |
|
|
41
|
+
| `state?` | `'default' \| 'loading' \| 'empty' \| 'error'` | 'default' | Data state of the body (Figma Table State). `loading` shows skeleton rows and sets `aria-busy`; `empty` / `error` replace the rows with `emptyState` / `errorState`. Messages are announced in a polite live region. |
|
|
42
|
+
| `loadingRowCount?` | `number` | 5 | Number of skeleton rows while `state="loading"`. |
|
|
43
|
+
| `emptyState?` | `TableStateContent` | — | Message shown when `state="empty"` (EmptyState type No Data). |
|
|
44
|
+
| `errorState?` | `TableStateContent` | — | Message shown when `state="error"` (EmptyState type Error), usually with a retry action. |
|
|
45
|
+
|
|
46
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `dir`.
|
|
47
|
+
|
|
48
|
+
## Options (allowed values)
|
|
49
|
+
- `divider`: `'none'` \| `'horizontal'` \| `'vertical'` \| `'both'` — Divider style between rows/columns
|
|
50
|
+
- `sortDirection`: `'asc'` \| `'desc'` — Controlled sort direction
|
|
51
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
|
|
52
|
+
- `state`: `'default'` \| `'loading'` \| `'empty'` \| `'error'` — Data state of the table body (Figma Table State 12942:258736).
|
|
53
|
+
- `default` — the rows.
|
|
54
|
+
- `loading` — skeleton rows under the real header; header and pagination
|
|
55
|
+
stay so the layout does not jump.
|
|
56
|
+
- `empty` — the header stays and an `EmptyState` (No Data) replaces the
|
|
57
|
+
rows, e.g. when a search or filter returns nothing.
|
|
58
|
+
- `error` — the header stays and an `EmptyState` (Error) with a retry action
|
|
59
|
+
replaces the rows.
|
|
60
|
+
|
|
61
|
+
## Accessibility
|
|
62
|
+
Built in (SDAIA review item C7) — verified by `tests/a11y/keyboard/mouse-toggles.spec.ts` in the design system's test suite:
|
|
63
|
+
- Row checkboxes and the select-all checkbox respond to a click on the box.
|
|
64
|
+
- Built-in pagination and selection strings (previous / next, page X of Y, select all / row, more actions) can be translated through `labels`.
|
|
65
|
+
|
|
66
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
67
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
68
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
69
|
+
|
|
70
|
+
## Design tokens used
|
|
71
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
72
|
+
- `var(--ds-brand-primary-900)`
|
|
73
|
+
- `var(--ds-brand-primary-950)`
|
|
74
|
+
- `var(--ds-color-bg-emphasis-high)`
|
|
75
|
+
- `var(--ds-color-bg-overlay)`
|
|
76
|
+
- `var(--ds-color-border-brand)`
|
|
77
|
+
- `var(--ds-color-border-default)`
|
|
78
|
+
- `var(--ds-color-border-muted)`
|
|
79
|
+
- `var(--ds-color-icon-default)`
|
|
80
|
+
- `var(--ds-color-icon-default-400)`
|
|
81
|
+
- `var(--ds-color-icon-default-500)`
|
|
82
|
+
- `var(--ds-color-primitive-neutral-700)`
|
|
83
|
+
- `var(--ds-color-table-)`
|
|
84
|
+
- `var(--ds-color-table-bg-header)`
|
|
85
|
+
- `var(--ds-color-table-bg-row-hovered)`
|
|
86
|
+
- `var(--ds-color-table-bg-row-select)`
|
|
87
|
+
- `var(--ds-color-table-bg-row-selected-hovered)`
|
|
88
|
+
- `var(--ds-color-table-cell-border)`
|
|
89
|
+
- `var(--ds-color-table-text-body)`
|
|
90
|
+
- `var(--ds-color-table-text-head)`
|
|
91
|
+
- `var(--ds-color-text-paragraph)`
|
|
92
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
93
|
+
- `var(--ds-radius-full)`
|
|
94
|
+
- `var(--ds-radius-l)`
|
|
95
|
+
- `var(--ds-radius-xs)`
|
|
96
|
+
- `var(--ds-spacing-2xl)`
|
|
97
|
+
- `var(--ds-spacing-4xl)`
|
|
98
|
+
- `var(--ds-spacing-lg)`
|
|
99
|
+
- `var(--ds-spacing-md)`
|
|
100
|
+
- `var(--ds-spacing-none)`
|
|
101
|
+
- `var(--ds-spacing-xl)`
|
|
102
|
+
- `var(--ds-spacing-xs)`
|
|
103
|
+
- `var(--ds-text-leading-line-heights-text-lg)`
|
|
104
|
+
- `var(--ds-text-leading-line-heights-text-md)`
|
|
105
|
+
- `var(--ds-text-leading-line-heights-text-sm)`
|
|
106
|
+
|
|
107
|
+
## AI usage guidance
|
|
108
|
+
When generating UI:
|
|
109
|
+
- Install with `npx sdaia-ui@latest add table` (after `npx sdaia-ui@latest init`), then import `{ Table }` from `@/components/ui/Table`.
|
|
110
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
111
|
+
- Use only the documented option values listed under "Options".
|
|
112
|
+
- Pass icons via `<DgaIcon data={…} className="size-icon-sm" />` from `@platformscode/icons` only — see `get_foundations` (`icon-usage`). Never emoji, Lucide, or random icons (e.g. `pizza01Stroke` for dark mode).
|
|
113
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Tree View
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Tree View
|
|
5
|
+
- Slug: `tree-view`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add tree-view`
|
|
8
|
+
- Import: `import { TreeView } from '@/components/ui/TreeView'`
|
|
9
|
+
- Installed files: `TreeView.tsx`, `TreeView.types.ts`, `TreeView.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/tree-view
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add tree-view`. It copies the source into your components folder (`components/ui/TreeView/`, under `src/` when the project has one); import it as `@/components/ui/TreeView`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction applied to the root. Also decides which arrow key expands (Right in LTR, Left in RTL). Omit to inherit — the computed direction is used for the keys. |
|
|
18
|
+
| `items` | `TreeViewNode[]` | — | Tree nodes to render. |
|
|
19
|
+
| `expandedIds?` | `string[]` | — | Controlled expanded ids. |
|
|
20
|
+
| `defaultExpandedIds?` | `string[]` | [] | Uncontrolled initial expanded ids. |
|
|
21
|
+
| `onExpandedIdsChange?` | `(expandedIds: string[]) => void` | — | Called whenever expansion state changes. |
|
|
22
|
+
| `selectedId?` | `string` | — | Controlled selected node id. |
|
|
23
|
+
| `defaultSelectedId?` | `string` | — | Uncontrolled initial selected node id. |
|
|
24
|
+
| `onSelectedIdChange?` | `(id: string) => void` | — | Called when a node is selected. |
|
|
25
|
+
| `baseLevel?` | `TreeViewItemLevel` | 1 | Base indentation level for the first rendered row. Figma set covers levels 1–4. |
|
|
26
|
+
|
|
27
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
|
|
28
|
+
|
|
29
|
+
## Options (allowed values)
|
|
30
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction applied to the root. Also decides which arrow key
|
|
31
|
+
expands (Right in LTR, Left in RTL). Omit to inherit — the computed
|
|
32
|
+
direction is used for the keys.
|
|
33
|
+
|
|
34
|
+
## Deprecated props
|
|
35
|
+
Do not use in new code:
|
|
36
|
+
- `rtl`
|
|
37
|
+
|
|
38
|
+
## Accessibility
|
|
39
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
40
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
41
|
+
|
|
42
|
+
## Design tokens used
|
|
43
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
44
|
+
- `var(--ds-color-bg-default)`
|
|
45
|
+
- `var(--ds-color-border-brand)`
|
|
46
|
+
- `var(--ds-radius-m)`
|
|
47
|
+
- `var(--ds-radius-xxs)`
|
|
48
|
+
- `var(--ds-spacing-lg)`
|
|
49
|
+
|
|
50
|
+
## AI usage guidance
|
|
51
|
+
When generating UI:
|
|
52
|
+
- Install with `npx sdaia-ui@latest add tree-view` (after `npx sdaia-ui@latest init`), then import `{ TreeView }` from `@/components/ui/TreeView`.
|
|
53
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
54
|
+
- Use only the documented option values listed under "Options".
|
|
55
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Vertical Tabs
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Vertical Tabs
|
|
5
|
+
- Slug: `vertical-tabs`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add vertical-tabs`
|
|
8
|
+
- Import: `import { VerticalTabs } from '@/components/ui/VerticalTabs'`
|
|
9
|
+
- Installed files: `VerticalTabs.tsx`, `VerticalTabs.types.ts`, `VerticalTabs.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/vertical-tabs
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add vertical-tabs`. It copies the source into your components folder (`components/ui/VerticalTabs/`, under `src/` when the project has one); import it as `@/components/ui/VerticalTabs`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `items` | `VerticalTabItem[]` | — | Tabs to render. |
|
|
18
|
+
| `type?` | `'primary' \| 'neutral' \| 'line-vertical' \| 'outline'` | 'primary' | Visual type. |
|
|
19
|
+
| `value?` | `string` | — | Controlled selected value. |
|
|
20
|
+
| `defaultValue?` | `string` | — | Uncontrolled initial value. |
|
|
21
|
+
| `onValueChange?` | `(value: string) => void` | — | Selection change callback. |
|
|
22
|
+
| `disabled?` | `boolean` | false | Disable the entire tab group. |
|
|
23
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction applied to the root. Inherits the ambient direction when omitted. |
|
|
24
|
+
|
|
25
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
|
|
26
|
+
|
|
27
|
+
## Options (allowed values)
|
|
28
|
+
- `type`: `'primary'` \| `'neutral'` \| `'line-vertical'` \| `'outline'` — Container-level type. Determines both the wrapper styling and the
|
|
29
|
+
inner `Tab` variant used for each item.
|
|
30
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction applied to the root. Inherits the ambient direction when omitted.
|
|
31
|
+
|
|
32
|
+
## Accessibility
|
|
33
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
34
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
35
|
+
|
|
36
|
+
## Design tokens used
|
|
37
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
38
|
+
- `var(--ds-spacing-lg)`
|
|
39
|
+
- `var(--ds-spacing-md)`
|
|
40
|
+
- `var(--ds-spacing-xs)`
|
|
41
|
+
|
|
42
|
+
## AI usage guidance
|
|
43
|
+
When generating UI:
|
|
44
|
+
- Install with `npx sdaia-ui@latest add vertical-tabs` (after `npx sdaia-ui@latest init`), then import `{ VerticalTabs }` from `@/components/ui/VerticalTabs`.
|
|
45
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
46
|
+
- Use only the documented option values listed under "Options".
|
|
47
|
+
- Express the disabled state with the `disabled` prop, not custom styling.
|
|
48
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Video Player
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Video Player
|
|
5
|
+
- Slug: `video-player`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add video-player`
|
|
8
|
+
- Import: `import { VideoPlayer } from '@/components/ui/VideoPlayer'`
|
|
9
|
+
- Installed files: `VideoPlayer.tsx`, `VideoPlayer.types.ts`, `VideoPlayer.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/video-player
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add video-player`. It copies the source into your components folder (`components/ui/VideoPlayer/`, under `src/` when the project has one); import it as `@/components/ui/VideoPlayer`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `src?` | `string` | — | URL of the video to play. When provided, the component renders a real <video> element and drives progress / currentTime / duration from actual playback. When omitted, the component shows the poster image and relies on the controlled progress / currentTime / duration props (demo / storybook mode). |
|
|
18
|
+
| `poster?` | `string` | — | Poster / thumbnail image shown before playback begins. When omitted (and there is no `src`), the player renders an empty neutral surface — there is no built-in placeholder image. |
|
|
19
|
+
| `posterAlt?` | `string` | '' | Accessible alt text for the poster image. |
|
|
20
|
+
| `title?` | `string` | — | Video title shown in the header while the player is in the playing state. |
|
|
21
|
+
| `playing?` | `boolean` | — | Whether the player is playing (controlled). When omitted the component manages its own playing state. |
|
|
22
|
+
| `defaultPlaying?` | `boolean` | false | Initial playing state when uncontrolled. Default: false. |
|
|
23
|
+
| `progress?` | `number` | — | Playback progress 0–100 (controlled). When omitted the component manages its own progress internally. |
|
|
24
|
+
| `defaultProgress?` | `number` | 0 | Initial progress value when uncontrolled. Default: 0. |
|
|
25
|
+
| `currentTime?` | `string` | '0:00' | Current-time display string shown in the controls bar, e.g. "0:12". |
|
|
26
|
+
| `duration?` | `string` | '0:00' | Total-duration display string shown in the controls bar, e.g. "2:32". |
|
|
27
|
+
| `onPlay?` | `() => void` | — | Called when the user requests playback to start. |
|
|
28
|
+
| `onPause?` | `() => void` | — | Called when the user requests playback to pause. |
|
|
29
|
+
| `onPrevious?` | `() => void` | — | Called when the previous-track button is clicked. |
|
|
30
|
+
| `onNext?` | `() => void` | — | Called when the next-track button is clicked. |
|
|
31
|
+
| `onProgressChange?` | `(value: number) => void` | — | Called when the user scrubs the progress bar. Receives the new value in the range 0–100. |
|
|
32
|
+
| `onVolumeClick?` | `() => void` | — | Called when the volume button is clicked. |
|
|
33
|
+
| `onSettingsClick?` | `() => void` | — | Called when the settings button is clicked. |
|
|
34
|
+
| `onFullscreenClick?` | `() => void` | — | Called when the fullscreen button is clicked. |
|
|
35
|
+
| `onMoreClick?` | `() => void` | — | Called when the more-options (⋮) button is clicked. |
|
|
36
|
+
| `labels?` | `Partial<VideoPlayerLabels>` | — | Localised copy for every control label (`aria-label` / `aria-valuetext`). Unset keys fall back to English. See . |
|
|
37
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. In `rtl` the controls bar mirrors (button groups swap sides, progress fills right-to-left, ArrowLeft seeks forward). Omit to inherit the direction from the parent. |
|
|
38
|
+
| `surface?` | `'solid' \| 'glass'` | 'solid' | Surface treatment of the controls toolbar — `'solid'` (default) or `'glass'` (translucent liquid-glass material). |
|
|
39
|
+
|
|
40
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `dir`.
|
|
41
|
+
|
|
42
|
+
## Options (allowed values)
|
|
43
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. In `rtl` the controls bar mirrors (button groups swap
|
|
44
|
+
sides, progress fills right-to-left, ArrowLeft seeks forward).
|
|
45
|
+
Omit to inherit the direction from the parent.
|
|
46
|
+
- `surface`: `'solid'` \| `'glass'` — Surface treatment of the controls toolbar (the pill wrapping the playback
|
|
47
|
+
controls).
|
|
48
|
+
- `'solid'` (default) — dark semi-transparent scrim.
|
|
49
|
+
- `'glass'` — translucent liquid-glass material (blurred video backdrop +
|
|
50
|
+
beveled edge highlight).
|
|
51
|
+
|
|
52
|
+
The visual is provided by the shared `.glass-surface` utility, so it is
|
|
53
|
+
theme-aware (light / dark) and identical across every component that
|
|
54
|
+
exposes a `surface` prop.
|
|
55
|
+
|
|
56
|
+
## Deprecated props
|
|
57
|
+
Do not use in new code:
|
|
58
|
+
- `rtl`
|
|
59
|
+
|
|
60
|
+
## Accessibility
|
|
61
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
62
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
63
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
64
|
+
|
|
65
|
+
## Design tokens used
|
|
66
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
67
|
+
- `var(--ds-color-bg-brand)`
|
|
68
|
+
- `var(--ds-color-bg-emphasis-strong)`
|
|
69
|
+
- `var(--ds-color-border-on-color-30)`
|
|
70
|
+
- `var(--ds-color-icon-oncolor)`
|
|
71
|
+
- `var(--ds-color-text-on-color)`
|
|
72
|
+
- `var(--ds-motion-feedback-duration)`
|
|
73
|
+
- `var(--ds-motion-feedback-easing)`
|
|
74
|
+
- `var(--ds-radius-m)`
|
|
75
|
+
- `var(--ds-radius-xxs)`
|
|
76
|
+
- `var(--ds-spacing-3xl)`
|
|
77
|
+
- `var(--ds-spacing-lg)`
|
|
78
|
+
- `var(--ds-spacing-md)`
|
|
79
|
+
- `var(--ds-spacing-sm)`
|
|
80
|
+
- `var(--ds-spacing-xl)`
|
|
81
|
+
- `var(--ds-themes-media-media-background-transparent)`
|
|
82
|
+
|
|
83
|
+
## AI usage guidance
|
|
84
|
+
When generating UI:
|
|
85
|
+
- Install with `npx sdaia-ui@latest add video-player` (after `npx sdaia-ui@latest init`), then import `{ VideoPlayer }` from `@/components/ui/VideoPlayer`.
|
|
86
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
87
|
+
- Use only the documented option values listed under "Options".
|
|
88
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|