@sdaia-ds/mcp 0.0.0-stage → 3.1.0
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 +1113 -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 +12080 -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,77 @@
|
|
|
1
|
+
# Thinking Panel
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Thinking Panel
|
|
5
|
+
- Slug: `thinking-panel`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add thinking-panel`
|
|
8
|
+
- Import: `import { ThinkingPanel } from '@/components/ui/ThinkingPanel'`
|
|
9
|
+
- Installed files: `ThinkingPanel.tsx`, `ThinkingPanel.types.ts`, `ThinkingPanel.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/thinking-panel
|
|
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 thinking-panel`. It copies the source into your components folder (`components/ui/ThinkingPanel/`, under `src/` when the project has one); import it as `@/components/ui/ThinkingPanel`. 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
|
+
| `variant?` | `'brand' \| 'neutral' \| 'outline'` | 'brand' | Visual style. - `brand` — raised surface, brand-green accent (default) - `neutral` — subtle surface, neutral accent - `outline` — transparent surface, default accent |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout. Inherits from the document when unset. |
|
|
19
|
+
| `animated?` | `boolean` | true | Animate the live trace — bouncing thinking dots (collapsed), a pulsing pipeline badge + spinning header icon (expanded) and a staggered rise-in of the timeline items. Collapses under `prefers-reduced-motion`. |
|
|
20
|
+
| `state?` | `'hidden' \| 'collapsed' \| 'expanded'` | — | Controlled panel state. |
|
|
21
|
+
| `defaultState?` | `'hidden' \| 'collapsed' \| 'expanded'` | 'collapsed' | Initial state when uncontrolled. |
|
|
22
|
+
| `onStateChange?` | `(state: ThinkingPanelState) => void` | — | Called when the user toggles between collapsed and expanded. |
|
|
23
|
+
| `runningLabel?` | `ReactNode` | — | Running label shown next to the thinking dots, inside a polite live region (wins over `labels.running`, default 'Thinking…'). |
|
|
24
|
+
| `count?` | `ReactNode` | — | Activity count badge text (e.g. `4 activities executed`). |
|
|
25
|
+
| `showCount?` | `boolean` | true | Show the activity count badge. |
|
|
26
|
+
| `expandLabel?` | `ReactNode` | — | Expand button label (wins over `labels.expand`, default 'Expand'). |
|
|
27
|
+
| `title?` | `ReactNode` | — | Expanded header title (wins over `labels.title`, default 'Reasoning trace'). |
|
|
28
|
+
| `headerIcon?` | `string` | recordStroke | Header icon — a `@platformscode/icons` data URL. |
|
|
29
|
+
| `pipelineLabel?` | `ReactNode` | — | Active-pipeline badge text (e.g. `Active Pipeline`). The badge is not rendered when unset. |
|
|
30
|
+
| `showPipeline?` | `boolean` | true | Show the active-pipeline badge (when `pipelineLabel` is set). |
|
|
31
|
+
| `items?` | `TraceItemProps[]` | — | Timeline entries — rendered as rail-less Trace Items along the panel rail. The timeline is a polite live region, so entries streamed in later are announced. |
|
|
32
|
+
| `children?` | `ReactNode` | — | Custom timeline content — overrides `items` when provided. |
|
|
33
|
+
| `hiddenLabel?` | `ReactNode` | — | Placeholder text for the hidden state (wins over `labels.hidden`, default 'No active trace'). |
|
|
34
|
+
| `labels?` | `Partial<ThinkingPanelLabels>` | — | Translatable built-in strings (see ). |
|
|
35
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
36
|
+
|
|
37
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
38
|
+
|
|
39
|
+
## Options (allowed values)
|
|
40
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the panel — mirrors the Figma `Style` property.
|
|
41
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout. Inherits from the document when unset.
|
|
42
|
+
- `state`: `'hidden'` \| `'collapsed'` \| `'expanded'` — Panel state — mirrors the Figma `State` property.
|
|
43
|
+
- `defaultState`: `'hidden'` \| `'collapsed'` \| `'expanded'` — Panel state — mirrors the Figma `State` property.
|
|
44
|
+
|
|
45
|
+
## Accessibility
|
|
46
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
47
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
48
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
49
|
+
|
|
50
|
+
## Design tokens used
|
|
51
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
52
|
+
- `var(--ds-color-)`
|
|
53
|
+
- `var(--ds-color-bg-muted)`
|
|
54
|
+
- `var(--ds-color-bg-raised)`
|
|
55
|
+
- `var(--ds-color-bg-subtle)`
|
|
56
|
+
- `var(--ds-color-border-brand)`
|
|
57
|
+
- `var(--ds-color-border-default)`
|
|
58
|
+
- `var(--ds-color-border-subtle)`
|
|
59
|
+
- `var(--ds-color-icon-brand)`
|
|
60
|
+
- `var(--ds-color-icon-default)`
|
|
61
|
+
- `var(--ds-color-icon-neutral)`
|
|
62
|
+
- `var(--ds-color-text-default)`
|
|
63
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
64
|
+
- `var(--ds-radius-full)`
|
|
65
|
+
- `var(--ds-radius-l)`
|
|
66
|
+
- `var(--ds-spacing-lg)`
|
|
67
|
+
- `var(--ds-spacing-md)`
|
|
68
|
+
- `var(--ds-spacing-sm)`
|
|
69
|
+
- `var(--ds-spacing-xs)`
|
|
70
|
+
|
|
71
|
+
## AI usage guidance
|
|
72
|
+
When generating UI:
|
|
73
|
+
- Install with `npx sdaia-ui@latest add thinking-panel` (after `npx sdaia-ui@latest init`), then import `{ ThinkingPanel }` from `@/components/ui/ThinkingPanel`.
|
|
74
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
75
|
+
- Use only the documented option values listed under "Options".
|
|
76
|
+
- 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).
|
|
77
|
+
- 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,67 @@
|
|
|
1
|
+
# Tool Activity Feed
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Tool Activity Feed
|
|
5
|
+
- Slug: `tool-activity-feed`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add tool-activity-feed`
|
|
8
|
+
- Import: `import { ToolActivityFeed } from '@/components/ui/ToolActivityFeed'`
|
|
9
|
+
- Installed files: `ToolActivityFeed.tsx`, `ToolActivityFeed.types.ts`, `ToolActivityFeed.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/tool-activity-feed
|
|
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 tool-activity-feed`. It copies the source into your components folder (`components/ui/ToolActivityFeed/`, under `src/` when the project has one); import it as `@/components/ui/ToolActivityFeed`. 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
|
+
| `variant?` | `'brand' \| 'neutral' \| 'outline'` | 'brand' | Visual style of the feed card. - `brand` — raised surface, default border (default) - `neutral` — subtle surface, subtle border - `outline` — transparent surface, default border |
|
|
18
|
+
| `state?` | `'live' \| 'completed'` | 'live' | Feed lifecycle state. - `live` — pulsing status dot + warning count, live rows - `completed` — success tick + neutral count, compact result rows Applies to every row unless a row sets its own `state`. |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the header and rows. Inherits from the document when unset. |
|
|
20
|
+
| `title` | `ReactNode` | — | Header title (e.g. `Agent Processing Feed` / `Pipeline History Logs`). |
|
|
21
|
+
| `count?` | `ReactNode` | — | Header count/summary badge (e.g. `3 Jobs Active` / `All tasks complete`). |
|
|
22
|
+
| `showCount?` | `boolean` | true | Show the header count badge. |
|
|
23
|
+
| `headerIcon?` | `ReactNode` | — | Override the header leading icon. Defaults to a pulsing dot (`live`) or a success tick (`completed`). |
|
|
24
|
+
| `items` | `ToolActivityFeedItem[]` | — | Feed rows, rendered as composed `FeedItem`s. |
|
|
25
|
+
| `showMetrics?` | `boolean` | true | Show each row's metric badge (completed rows). |
|
|
26
|
+
| `labels?` | `Partial<ToolActivityFeedLabels>` | — | Translatable built-in strings (see ). |
|
|
27
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
28
|
+
|
|
29
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
30
|
+
|
|
31
|
+
## Options (allowed values)
|
|
32
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the feed card — mirrors the Figma `Style` property.
|
|
33
|
+
- `state`: `'live'` \| `'completed'` — Lifecycle state of the feed (drives the header + default row state).
|
|
34
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the header and rows. Inherits from the document when unset.
|
|
35
|
+
|
|
36
|
+
## Accessibility
|
|
37
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
38
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
39
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
40
|
+
|
|
41
|
+
## Design tokens used
|
|
42
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
43
|
+
- `var(--ds-color-bg-default)`
|
|
44
|
+
- `var(--ds-color-bg-raised)`
|
|
45
|
+
- `var(--ds-color-bg-subtle)`
|
|
46
|
+
- `var(--ds-color-bg-warning-subtle)`
|
|
47
|
+
- `var(--ds-color-border-default)`
|
|
48
|
+
- `var(--ds-color-border-default-strong)`
|
|
49
|
+
- `var(--ds-color-border-subtle)`
|
|
50
|
+
- `var(--ds-color-border-warning-strong)`
|
|
51
|
+
- `var(--ds-color-icon-success)`
|
|
52
|
+
- `var(--ds-color-text-default)`
|
|
53
|
+
- `var(--ds-color-text-warning)`
|
|
54
|
+
- `var(--ds-radius-full)`
|
|
55
|
+
- `var(--ds-radius-l)`
|
|
56
|
+
- `var(--ds-spacing-lg)`
|
|
57
|
+
- `var(--ds-spacing-md)`
|
|
58
|
+
- `var(--ds-spacing-sm)`
|
|
59
|
+
- `var(--ds-spacing-xs)`
|
|
60
|
+
|
|
61
|
+
## AI usage guidance
|
|
62
|
+
When generating UI:
|
|
63
|
+
- Install with `npx sdaia-ui@latest add tool-activity-feed` (after `npx sdaia-ui@latest init`), then import `{ ToolActivityFeed }` from `@/components/ui/ToolActivityFeed`.
|
|
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
|
+
- 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).
|
|
67
|
+
- 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
|
+
# Tool Call
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Tool Call
|
|
5
|
+
- Slug: `tool-call-card`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add tool-call-card`
|
|
8
|
+
- Import: `import { ToolCallCard } from '@/components/ui/ToolCallCard'`
|
|
9
|
+
- Installed files: `ToolCallCard.tsx`, `ToolCallCard.types.ts`, `ToolCallCard.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/tool-call-card
|
|
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 tool-call-card`. It copies the source into your components folder (`components/ui/ToolCallCard/`, under `src/` when the project has one); import it as `@/components/ui/ToolCallCard`. 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
|
+
| `variant?` | `'brand' \| 'neutral' \| 'outline'` | 'neutral' | Visual style of the card. - `brand` — brand-tinted surface + brand border - `neutral` — subtle surface + subtle border (default) - `outline` — transparent surface + default border |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the header and panels. Inherits from the document when unset. |
|
|
19
|
+
| `name` | `ReactNode` | — | Tool name, e.g. `search_web`. |
|
|
20
|
+
| `subtitle?` | `ReactNode` | — | Subtitle under the name, e.g. `Search tools server · MCP`. |
|
|
21
|
+
| `icon?` | `string` | wrench02Stroke | Tool icon — a `@platformscode/icons` data URL rendered through `DgaIcon`. |
|
|
22
|
+
| `showIcon?` | `boolean` | true | Show the leading tool-icon tile. |
|
|
23
|
+
| `headerEnd?` | `ReactNode` | — | Optional trailing header content (e.g. a status badge or control). |
|
|
24
|
+
| `animated?` | `boolean` | true | Fade the response panel in when it appears (streamed tool output). Collapses under `prefers-reduced-motion`. |
|
|
25
|
+
| `request?` | `ToolCallPanel` | — | The request panel (labelled `Arguments` by default). |
|
|
26
|
+
| `response?` | `ToolCallPanel` | — | The response panel (labelled `Response` by default). |
|
|
27
|
+
| `labels?` | `Partial<ToolCallCardLabels>` | — | Translatable built-in strings (see ). |
|
|
28
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
29
|
+
|
|
30
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
31
|
+
|
|
32
|
+
## Options (allowed values)
|
|
33
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
34
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the header and panels. Inherits from the document when unset.
|
|
35
|
+
|
|
36
|
+
## Accessibility
|
|
37
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
38
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
39
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
40
|
+
|
|
41
|
+
## Design tokens used
|
|
42
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
43
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
44
|
+
- `var(--ds-color-bg-info-subtle)`
|
|
45
|
+
- `var(--ds-color-bg-subtle)`
|
|
46
|
+
- `var(--ds-color-border-brand)`
|
|
47
|
+
- `var(--ds-color-border-default)`
|
|
48
|
+
- `var(--ds-color-border-subtle)`
|
|
49
|
+
- `var(--ds-color-icon-default)`
|
|
50
|
+
- `var(--ds-color-primitive-radius-radius-12)`
|
|
51
|
+
- `var(--ds-color-text-default)`
|
|
52
|
+
- `var(--ds-color-text-paragraph)`
|
|
53
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
54
|
+
- `var(--ds-spacing-lg)`
|
|
55
|
+
- `var(--ds-spacing-md)`
|
|
56
|
+
- `var(--ds-spacing-sm)`
|
|
57
|
+
- `var(--ds-spacing-xs)`
|
|
58
|
+
- `var(--ds-spacing-xxs)`
|
|
59
|
+
|
|
60
|
+
## AI usage guidance
|
|
61
|
+
When generating UI:
|
|
62
|
+
- Install with `npx sdaia-ui@latest add tool-call-card` (after `npx sdaia-ui@latest init`), then import `{ ToolCallCard }` from `@/components/ui/ToolCallCard`.
|
|
63
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
64
|
+
- Use only the documented option values listed under "Options".
|
|
65
|
+
- 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).
|
|
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,72 @@
|
|
|
1
|
+
# Tool Status Row
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Tool Status Row
|
|
5
|
+
- Slug: `tool-status-row`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add tool-status-row`
|
|
8
|
+
- Import: `import { ToolStatusRow } from '@/components/ui/ToolStatusRow'`
|
|
9
|
+
- Installed files: `ToolStatusRow.tsx`, `ToolStatusRow.types.ts`, `ToolStatusRow.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/tool-status-row
|
|
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 tool-status-row`. It copies the source into your components folder (`components/ui/ToolStatusRow/`, under `src/` when the project has one); import it as `@/components/ui/ToolStatusRow`. 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
|
+
| `variant?` | `'brand' \| 'neutral' \| 'outline'` | 'neutral' | Visual style of the card and the status pill. - `brand` — brand-tinted surface + brand-style pill - `neutral` — raised surface + neutral pill (default) - `outline` — transparent surface + outline pill |
|
|
18
|
+
| `state?` | `'queued' \| 'running' \| 'success' \| 'failed'` | 'queued' | Lifecycle state. - `queued` — clock icon, "Thinking…" pill, muted progress - `running` — refresh icon, "Running tool" pill, info-blue progress - `success` — tick icon, "Tool complete" pill, full success-green progress - `failed` — alert icon, "Tool failed" pill, danger-red progress |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the row and progress fill. Inherits from the document when unset. |
|
|
20
|
+
| `name` | `ReactNode` | — | Tool name, e.g. `search_web`. |
|
|
21
|
+
| `subtitle?` | `ReactNode` | — | Subtitle under the name, e.g. `Search server · attempt 1 of 3`. |
|
|
22
|
+
| `icon?` | `string` | — | Override the leading icon — a `@platformscode/icons` data URL rendered through `DgaIcon`. Defaults to the icon for the given . |
|
|
23
|
+
| `showIcon?` | `boolean` | true | Show the leading icon tile. |
|
|
24
|
+
| `animated?` | `boolean` | true | Animate the live states — the leading icon spins while `running` and the status pill animates its live statuses (see ). Collapses under `prefers-reduced-motion`. |
|
|
25
|
+
| `statusLabel?` | `ReactNode` | — | Override the status pill label (wins over `labels[state]`). |
|
|
26
|
+
| `showStatus?` | `boolean` | true | Show the trailing status pill. |
|
|
27
|
+
| `progress?` | `number` | — | Progress value (0–100). When unset: `queued` shows 0, `success` 100, and `running` / `failed` show an indeterminate bar (no `aria-valuenow`). |
|
|
28
|
+
| `showProgress?` | `boolean` | true | Show the progress bar. |
|
|
29
|
+
| `labels?` | `Partial<ToolStatusRowLabels>` | — | Translatable built-in strings (see ). |
|
|
30
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
31
|
+
|
|
32
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
33
|
+
|
|
34
|
+
## Options (allowed values)
|
|
35
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
36
|
+
- `state`: `'queued'` \| `'running'` \| `'success'` \| `'failed'` — Lifecycle state of the tool — drives the leading icon, the status pill
|
|
37
|
+
(composed ) and the progress bar colour/value.
|
|
38
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the row and progress fill. Inherits from the document when unset.
|
|
39
|
+
|
|
40
|
+
## Accessibility
|
|
41
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
42
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
43
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
44
|
+
|
|
45
|
+
## Design tokens used
|
|
46
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
47
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
48
|
+
- `var(--ds-color-bg-muted)`
|
|
49
|
+
- `var(--ds-color-bg-raised)`
|
|
50
|
+
- `var(--ds-color-bg-subtle)`
|
|
51
|
+
- `var(--ds-color-border-brand)`
|
|
52
|
+
- `var(--ds-color-border-default)`
|
|
53
|
+
- `var(--ds-color-icon-default)`
|
|
54
|
+
- `var(--ds-color-primitive-radius-radius-12)`
|
|
55
|
+
- `var(--ds-color-text-danger)`
|
|
56
|
+
- `var(--ds-color-text-default)`
|
|
57
|
+
- `var(--ds-color-text-info)`
|
|
58
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
59
|
+
- `var(--ds-color-text-success)`
|
|
60
|
+
- `var(--ds-radius-full)`
|
|
61
|
+
- `var(--ds-spacing-lg)`
|
|
62
|
+
- `var(--ds-spacing-md)`
|
|
63
|
+
- `var(--ds-spacing-xs)`
|
|
64
|
+
- `var(--ds-spacing-xxs)`
|
|
65
|
+
|
|
66
|
+
## AI usage guidance
|
|
67
|
+
When generating UI:
|
|
68
|
+
- Install with `npx sdaia-ui@latest add tool-status-row` (after `npx sdaia-ui@latest init`), then import `{ ToolStatusRow }` from `@/components/ui/ToolStatusRow`.
|
|
69
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
70
|
+
- Use only the documented option values listed under "Options".
|
|
71
|
+
- 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).
|
|
72
|
+
- 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,71 @@
|
|
|
1
|
+
# Tool Timeline Item
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Tool Timeline Item
|
|
5
|
+
- Slug: `tool-timeline-item`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add tool-timeline-item`
|
|
8
|
+
- Import: `import { ToolTimelineItem } from '@/components/ui/ToolTimelineItem'`
|
|
9
|
+
- Installed files: `ToolTimelineItem.tsx`, `ToolTimelineItem.types.ts`, `ToolTimelineItem.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/tool-timeline-item
|
|
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 tool-timeline-item`. It copies the source into your components folder (`components/ui/ToolTimelineItem/`, under `src/` when the project has one); import it as `@/components/ui/ToolTimelineItem`. 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
|
+
| `variant?` | `'brand' \| 'neutral' \| 'outline'` | 'neutral' | Visual style of the card. - `brand` — brand-tinted surface + brand border - `neutral` — raised surface + default border (default) - `outline` — transparent surface + default border |
|
|
18
|
+
| `state?` | `'started' \| 'running' \| 'completed'` | 'started' | Lifecycle milestone. - `started` — neutral clock icon, muted title, subtle line - `running` — outlined refresh icon, info-blue title, info-blue line - `completed` — solid green tick, success-green title, success-green line |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the rail and content. Inherits from the document when unset. |
|
|
20
|
+
| `title` | `ReactNode` | — | Milestone title, e.g. `Request accepted`. |
|
|
21
|
+
| `description?` | `ReactNode` | — | Supporting description under the title. |
|
|
22
|
+
| `timestamp?` | `ReactNode` | — | Trailing timestamp, e.g. `14:02:11`. |
|
|
23
|
+
| `icon?` | `string` | — | Override the status icon — a `@platformscode/icons` data URL rendered through `DgaIcon`. Defaults to the icon for the given . |
|
|
24
|
+
| `showConnector?` | `boolean` | true | Show the trailing connector line below the status icon. |
|
|
25
|
+
| `labels?` | `Partial<ToolTimelineItemLabels>` | — | Translatable built-in strings (see ). |
|
|
26
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
27
|
+
|
|
28
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
29
|
+
|
|
30
|
+
## Options (allowed values)
|
|
31
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
32
|
+
- `state`: `'started'` \| `'running'` \| `'completed'` — Lifecycle milestone of the timeline item — drives the status icon, the title
|
|
33
|
+
colour, and the connector-line colour.
|
|
34
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the rail and content. Inherits from the document when unset.
|
|
35
|
+
|
|
36
|
+
## Accessibility
|
|
37
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
38
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
39
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
40
|
+
|
|
41
|
+
## Design tokens used
|
|
42
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
43
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
44
|
+
- `var(--ds-color-bg-raised)`
|
|
45
|
+
- `var(--ds-color-bg-subtle)`
|
|
46
|
+
- `var(--ds-color-border-brand)`
|
|
47
|
+
- `var(--ds-color-border-default)`
|
|
48
|
+
- `var(--ds-color-border-info-subtle)`
|
|
49
|
+
- `var(--ds-color-border-subtle)`
|
|
50
|
+
- `var(--ds-color-border-success-subtle)`
|
|
51
|
+
- `var(--ds-color-button-bg-primary-default)`
|
|
52
|
+
- `var(--ds-color-icon-neutral)`
|
|
53
|
+
- `var(--ds-color-icon-oncolor)`
|
|
54
|
+
- `var(--ds-color-primitive-radius-radius-12)`
|
|
55
|
+
- `var(--ds-color-text-info)`
|
|
56
|
+
- `var(--ds-color-text-paragraph)`
|
|
57
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
58
|
+
- `var(--ds-color-text-success)`
|
|
59
|
+
- `var(--ds-radius-full)`
|
|
60
|
+
- `var(--ds-spacing-lg)`
|
|
61
|
+
- `var(--ds-spacing-md)`
|
|
62
|
+
- `var(--ds-spacing-sm)`
|
|
63
|
+
- `var(--ds-spacing-xs)`
|
|
64
|
+
|
|
65
|
+
## AI usage guidance
|
|
66
|
+
When generating UI:
|
|
67
|
+
- Install with `npx sdaia-ui@latest add tool-timeline-item` (after `npx sdaia-ui@latest init`), then import `{ ToolTimelineItem }` from `@/components/ui/ToolTimelineItem`.
|
|
68
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
69
|
+
- Use only the documented option values listed under "Options".
|
|
70
|
+
- 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).
|
|
71
|
+
- 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,93 @@
|
|
|
1
|
+
# Voice Session
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Voice Session
|
|
5
|
+
- Slug: `voice-session`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add voice-session`
|
|
8
|
+
- Import: `import { VoiceSession } from '@/components/ui/VoiceSession'`
|
|
9
|
+
- Installed files: `VoiceSession.tsx`, `VoiceSession.types.ts`, `VoiceSession.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/voice-session
|
|
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 voice-session`. It copies the source into your components folder (`components/ui/VoiceSession/`, under `src/` when the project has one); import it as `@/components/ui/VoiceSession`. 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
|
+
| `variant?` | `'brand' \| 'neutral' \| 'outline'` | 'neutral' | Visual style of the card. - `brand` — brand-tinted surface + brand border - `neutral` — default (white) surface + subtle border (default) - `outline` — transparent surface + default border |
|
|
18
|
+
| `state?` | `'idle' \| 'listening' \| 'processing' \| 'speaking'` | 'listening' | Session lifecycle state. |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the header, bubbles and controls. |
|
|
20
|
+
| `title?` | `ReactNode` | labels.title ('Voice session') | Header title. |
|
|
21
|
+
| `model?` | `ReactNode` | — | Model chip text. No default — the chip renders only when set. |
|
|
22
|
+
| `language?` | `ReactNode` | — | Language chip text. No default — the chip renders only when set. |
|
|
23
|
+
| `timer?` | `ReactNode` | — | Session timer, top-right. No default — renders only when set. |
|
|
24
|
+
| `statusLabel?` | `ReactNode` | per state from `labels` ('Listening…' / 'Processing…' / 'Speaking…') | Status pill label override. |
|
|
25
|
+
| `stageTitle?` | `ReactNode` | per state from `labels` | Stage title override. |
|
|
26
|
+
| `stageHint?` | `ReactNode` | `labels.stageHintIdle` while idle; otherwise none | Stage hint/subtitle. |
|
|
27
|
+
| `speaker?` | `ReactNode` | — | Transcript bubble — speaker name. No default. |
|
|
28
|
+
| `speakerMeta?` | `ReactNode` | — | Transcript bubble — meta (e.g. `recognizing…`, `0:12`). No default. |
|
|
29
|
+
| `transcript?` | `ReactNode` | — | Transcript bubble — the spoken text. No default; the bubble renders only when `speaker`, `speakerMeta` or `transcript` is set. |
|
|
30
|
+
| `audioCurrentTime?` | `string` | — | Speaking only — audio player current time. The player renders only when an audio prop is set. |
|
|
31
|
+
| `audioDuration?` | `string` | — | Speaking only — audio player total duration. |
|
|
32
|
+
| `audioProgress?` | `number` | — | Speaking only — audio progress (0–100). |
|
|
33
|
+
| `showControls?` | `boolean` | true | Show the trailing control row. |
|
|
34
|
+
| `onPrimaryControl?` | `() => void` | — | Primary control click (mic in listening/processing, regenerate in speaking). |
|
|
35
|
+
| `onToggleCaptions?` | `() => void` | — | Captions control click. |
|
|
36
|
+
| `onSettings?` | `() => void` | — | Settings control click. |
|
|
37
|
+
| `onEndSession?` | `() => void` | — | End-session control click. |
|
|
38
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
39
|
+
| `labels?` | `Partial<VoiceSessionLabels>` | — | Localised copy for the title, status/stage text and control names. |
|
|
40
|
+
|
|
41
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
42
|
+
|
|
43
|
+
## Options (allowed values)
|
|
44
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
45
|
+
- `state`: `'idle'` \| `'listening'` \| `'processing'` \| `'speaking'` — Voice-session lifecycle — mirrors the Figma `State` property. Drives the
|
|
46
|
+
status pill, stage media, accent colour and body:
|
|
47
|
+
- `idle` — static (muted) orb, no status pill, "tap to start" prompt, no bubble
|
|
48
|
+
- `listening` — pulse-ring orb, info-blue accent, live-speech bubble + waveform
|
|
49
|
+
- `processing` — muted waveform, warning-amber accent, the user's request bubble
|
|
50
|
+
- `speaking` — active waveform, brand-green accent, the assistant bubble + audio player
|
|
51
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the header, bubbles and controls.
|
|
52
|
+
|
|
53
|
+
## Accessibility
|
|
54
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
55
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
56
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
57
|
+
|
|
58
|
+
## Design tokens used
|
|
59
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
60
|
+
- `var(--ds-color-bg-brand)`
|
|
61
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
62
|
+
- `var(--ds-color-bg-default)`
|
|
63
|
+
- `var(--ds-color-bg-info-subtle)`
|
|
64
|
+
- `var(--ds-color-bg-muted)`
|
|
65
|
+
- `var(--ds-color-bg-subtle)`
|
|
66
|
+
- `var(--ds-color-border-brand)`
|
|
67
|
+
- `var(--ds-color-border-default)`
|
|
68
|
+
- `var(--ds-color-border-subtle)`
|
|
69
|
+
- `var(--ds-color-icon-brand)`
|
|
70
|
+
- `var(--ds-color-icon-default)`
|
|
71
|
+
- `var(--ds-color-icon-oncolor)`
|
|
72
|
+
- `var(--ds-color-primitive-radius-radius-10)`
|
|
73
|
+
- `var(--ds-color-primitive-radius-radius-12)`
|
|
74
|
+
- `var(--ds-color-primitive-radius-radius-16)`
|
|
75
|
+
- `var(--ds-color-text-brand)`
|
|
76
|
+
- `var(--ds-color-text-default)`
|
|
77
|
+
- `var(--ds-color-text-info)`
|
|
78
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
79
|
+
- `var(--ds-color-text-warning)`
|
|
80
|
+
- `var(--ds-radius-full)`
|
|
81
|
+
- `var(--ds-spacing-lg)`
|
|
82
|
+
- `var(--ds-spacing-md)`
|
|
83
|
+
- `var(--ds-spacing-sm)`
|
|
84
|
+
- `var(--ds-spacing-xl)`
|
|
85
|
+
- `var(--ds-spacing-xs)`
|
|
86
|
+
- `var(--ds-spacing-xxs)`
|
|
87
|
+
|
|
88
|
+
## AI usage guidance
|
|
89
|
+
When generating UI:
|
|
90
|
+
- Install with `npx sdaia-ui@latest add voice-session` (after `npx sdaia-ui@latest init`), then import `{ VoiceSession }` from `@/components/ui/VoiceSession`.
|
|
91
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
92
|
+
- Use only the documented option values listed under "Options".
|
|
93
|
+
- 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,106 @@
|
|
|
1
|
+
# Alerts
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Alerts
|
|
5
|
+
- Slug: `alert`
|
|
6
|
+
- Category: Feedback
|
|
7
|
+
- Install: `npx sdaia-ui@latest add alert`
|
|
8
|
+
- Import: `import { Alert } from '@/components/ui/Alert'`
|
|
9
|
+
- Installed files: `Alert.tsx`, `Alert.types.ts`, `Alert.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/alerts
|
|
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 alert`. It copies the source into your components folder (`components/ui/Alert/`, under `src/` when the project has one); import it as `@/components/ui/Alert`. 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
|
+
| `type?` | `'standard' \| 'outline' \| 'solid'` | 'standard' | Structural type of the alert |
|
|
18
|
+
| `variant?` | `'neutral' \| 'info' \| 'error' \| 'warning' \| 'success'` | 'info' | Intent of the alert. |
|
|
19
|
+
| `surface?` | `'solid' \| 'glass'` | 'solid' | Surface material — `glass` swaps the container for the shared liquid-glass skin. |
|
|
20
|
+
| `title?` | `string` | — | Title text displayed as the header |
|
|
21
|
+
| `description?` | `string` | — | Description text displayed below the title |
|
|
22
|
+
| `closable?` | `boolean` | false | Shows a close (X) button |
|
|
23
|
+
| `onClose?` | `() => void` | — | Callback when the close button is clicked |
|
|
24
|
+
| `leadingIcon?` | `ReactNode \| boolean` | — | Leading icon — true for default icon, false to hide, or ReactNode for custom |
|
|
25
|
+
| `actions?` | `ReactNode` | — | Action buttons slot (rendered after text, before close button) |
|
|
26
|
+
| `iconTop?` | `boolean` | false | Stack icon above text (for mobile/tablet layouts) |
|
|
27
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the alert. Inherits from the document when omitted. |
|
|
28
|
+
| `labels?` | `Partial<AlertLabels>` | — | Override built-in strings (English defaults) to localize the alert. |
|
|
29
|
+
| `children?` | `ReactNode` | — | — |
|
|
30
|
+
|
|
31
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`, `title`.
|
|
32
|
+
|
|
33
|
+
## Options (allowed values)
|
|
34
|
+
- `type`: `'standard'` \| `'outline'` \| `'solid'` — Structural type of the alert
|
|
35
|
+
- `variant`: `'neutral'` \| `'info'` \| `'error'` \| `'warning'` \| `'success'` — Intent of the alert (neutral / info / error / warning / success). A
|
|
36
|
+
variation of the design, not an interaction condition, so it is modelled as
|
|
37
|
+
`variant`.
|
|
38
|
+
- `surface`: `'solid'` \| `'glass'` — Surface material of the alert.
|
|
39
|
+
- `solid` — the opaque per-type surface (default)
|
|
40
|
+
- `glass` — the shared liquid-glass material (`.glass-surface`): translucent
|
|
41
|
+
background + backdrop blur + beveled shadow. Variant colours still drive the
|
|
42
|
+
icon and text (via the `standard` treatment, so copy stays readable on the
|
|
43
|
+
translucent surface). Orthogonal to `type`/`variant`.
|
|
44
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction of the alert. Inherits from the document when omitted.
|
|
45
|
+
|
|
46
|
+
## Deprecated props
|
|
47
|
+
Do not use in new code:
|
|
48
|
+
- `state`
|
|
49
|
+
- `icon`
|
|
50
|
+
|
|
51
|
+
## Accessibility
|
|
52
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
53
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
54
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
55
|
+
|
|
56
|
+
## Design tokens used
|
|
57
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
58
|
+
- `var(--ds-color-)`
|
|
59
|
+
- `var(--ds-color-alpha-black-10)`
|
|
60
|
+
- `var(--ds-color-alpha-black-20)`
|
|
61
|
+
- `var(--ds-color-bg-danger-muted)`
|
|
62
|
+
- `var(--ds-color-bg-danger-strong)`
|
|
63
|
+
- `var(--ds-color-bg-danger-subtle)`
|
|
64
|
+
- `var(--ds-color-bg-default)`
|
|
65
|
+
- `var(--ds-color-bg-emphasis-high)`
|
|
66
|
+
- `var(--ds-color-bg-info-muted)`
|
|
67
|
+
- `var(--ds-color-bg-info-strong)`
|
|
68
|
+
- `var(--ds-color-bg-info-subtle)`
|
|
69
|
+
- `var(--ds-color-bg-muted)`
|
|
70
|
+
- `var(--ds-color-bg-success-muted)`
|
|
71
|
+
- `var(--ds-color-bg-success-strong)`
|
|
72
|
+
- `var(--ds-color-bg-success-subtle)`
|
|
73
|
+
- `var(--ds-color-bg-warning-muted)`
|
|
74
|
+
- `var(--ds-color-bg-warning-strong)`
|
|
75
|
+
- `var(--ds-color-bg-warning-subtle)`
|
|
76
|
+
- `var(--ds-color-border-default)`
|
|
77
|
+
- `var(--ds-color-border-focus)`
|
|
78
|
+
- `var(--ds-color-button-bg-neutral-hovered)`
|
|
79
|
+
- `var(--ds-color-button-bg-neutral-pressed)`
|
|
80
|
+
- `var(--ds-color-icon-danger)`
|
|
81
|
+
- `var(--ds-color-icon-default)`
|
|
82
|
+
- `var(--ds-color-icon-info)`
|
|
83
|
+
- `var(--ds-color-icon-neutral)`
|
|
84
|
+
- `var(--ds-color-icon-oncolor)`
|
|
85
|
+
- `var(--ds-color-icon-success)`
|
|
86
|
+
- `var(--ds-color-icon-warning)`
|
|
87
|
+
- `var(--ds-color-text-danger)`
|
|
88
|
+
- `var(--ds-color-text-display)`
|
|
89
|
+
- `var(--ds-color-text-info)`
|
|
90
|
+
- `var(--ds-color-text-on-color)`
|
|
91
|
+
- `var(--ds-color-text-paragraph)`
|
|
92
|
+
- `var(--ds-color-text-success)`
|
|
93
|
+
- `var(--ds-color-text-warning)`
|
|
94
|
+
- `var(--ds-icon-3xl)`
|
|
95
|
+
- `var(--ds-motion-feedback-duration)`
|
|
96
|
+
- `var(--ds-motion-feedback-easing)`
|
|
97
|
+
- `var(--ds-radius-figma-xs)`
|
|
98
|
+
- …and 20 more
|
|
99
|
+
|
|
100
|
+
## AI usage guidance
|
|
101
|
+
When generating UI:
|
|
102
|
+
- Install with `npx sdaia-ui@latest add alert` (after `npx sdaia-ui@latest init`), then import `{ Alert }` from `@/components/ui/Alert`.
|
|
103
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
104
|
+
- Use only the documented option values listed under "Options".
|
|
105
|
+
- 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).
|
|
106
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|