@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,107 @@
|
|
|
1
|
+
# AI States
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: AI States (composite pattern — not a single component)
|
|
5
|
+
- Slug: `ai-states`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add ai-state-row ai-reasoning-state ai-research-state ai-tool-state ai-generation-state ai-artifact-state ai-context-state ai-memory-state ai-model-state ai-multi-agent-state`
|
|
8
|
+
- Import: per family member, e.g. `import { AiReasoningState } from '@/components/ui/AiReasoningState'`
|
|
9
|
+
- Docs: https://ds.nacew.com/components/ai-states
|
|
10
|
+
|
|
11
|
+
> **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 add only the state components you need from the list above. It copies the source into your components folder (`components/ui/<Name>/`, under `src/` when the project has one); import each part as `@/components/ui/<Name>`. 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.
|
|
12
|
+
|
|
13
|
+
> **There is no `ai-states` slug to install.** "AI States" is a documentation grouping for a family of single-line status rows that all share one shape (`AiStateRow`). Install the specific members you need — the docs site's `add ai-states` command does not exist in the registry.
|
|
14
|
+
|
|
15
|
+
## Description
|
|
16
|
+
A family of compact, single-line status rows that communicate what an AI/agent system is doing right now (thinking, searching, running a tool, streaming, managing context/memory, switching model, coordinating agents). Every member renders the same `AiStateRow` shell — a leading icon, a primary label, and an intent-coloured trailing hint — and differs only in its `state` union, which picks the default intent colour, icon, label, and hint.
|
|
17
|
+
|
|
18
|
+
## Composed components
|
|
19
|
+
Each is installable on its own; pick the ones your flow needs.
|
|
20
|
+
|
|
21
|
+
| Component | Slug | Purpose |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| `AiStateRow` | `ai-state-row` | Base row primitive — use directly for a fully custom state. |
|
|
24
|
+
| `AiReasoningState` | `ai-reasoning-state` | Model reasoning / thinking status. |
|
|
25
|
+
| `AiResearchState` | `ai-research-state` | Source search, reading, and ranking status. |
|
|
26
|
+
| `AiToolState` | `ai-tool-state` | Tool invocation lifecycle (waiting → running → result). |
|
|
27
|
+
| `AiGenerationState` | `ai-generation-state` | Output streaming / pause / regenerate status. |
|
|
28
|
+
| `AiArtifactState` | `ai-artifact-state` | Artifact generation lifecycle. |
|
|
29
|
+
| `AiContextState` | `ai-context-state` | Context-window health (full, truncated, lost…). |
|
|
30
|
+
| `AiMemoryState` | `ai-memory-state` | Memory read/write/conflict status. |
|
|
31
|
+
| `AiModelState` | `ai-model-state` | Model switching / fallback / availability. |
|
|
32
|
+
| `AiMultiAgentState` | `ai-multi-agent-state` | Multi-agent coordination + handoff status. |
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
The semantic members (`AiReasoningState`, `AiToolState`, …) share one prop shape:
|
|
36
|
+
|
|
37
|
+
| Prop | Type | Default | Description |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `state` | *(per-component union — see Options)* | — | Which state to display. Drives the intent colour, default icon, label, and hint. |
|
|
40
|
+
| `dir?` | `'ltr' \| 'rtl'` | `'ltr'` | Layout direction (mirrors for RTL). |
|
|
41
|
+
| `label?` | `ReactNode` | — | Override the default label for the state. |
|
|
42
|
+
| `hint?` | `ReactNode` | — | Override the default trailing hint for the state. |
|
|
43
|
+
| `icon?` | `string` | — | Override the leading icon — a `@platformscode/icons` data URL. |
|
|
44
|
+
| `onHintClick?` | `() => void` | — | When set, the hint becomes an interactive action (e.g. `View chain`, `Authorize`). |
|
|
45
|
+
| `hintLabel?` | `string` | hint text | Accessible label for the hint action. |
|
|
46
|
+
|
|
47
|
+
The base `AiStateRow` takes the same fields but requires `intent` and `icon` explicitly:
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Description |
|
|
50
|
+
| --- | --- | --- | --- |
|
|
51
|
+
| `intent` | `'brand' \| 'success' \| 'warning' \| 'danger' \| 'info' \| 'neutral'` | — | Semantic intent — drives border, icon, and hint colour. |
|
|
52
|
+
| `icon` | `string` | — | Leading icon (`@platformscode/icons` data URL). |
|
|
53
|
+
| `label` | `ReactNode` | — | Primary label (always default text colour). |
|
|
54
|
+
| `hint?` | `ReactNode` | — | Intent-coloured trailing status text or action label. |
|
|
55
|
+
| `onHintClick?` | `() => void` | — | Makes the hint an interactive button. |
|
|
56
|
+
| `hintLabel?` | `string` | hint text | Accessible label for the hint button. |
|
|
57
|
+
| `dir?` | `'ltr' \| 'rtl'` | `'ltr'` | Layout direction. |
|
|
58
|
+
|
|
59
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `aria-*`, …) except `title`.
|
|
60
|
+
|
|
61
|
+
## Options (allowed `state` values)
|
|
62
|
+
- `AiReasoningState` — `'deep-thinking'` \| `'reasoning-hidden'` \| `'reasoning-available'` \| `'reasoning-unavailable'`
|
|
63
|
+
- `AiResearchState` — `'searching-sources'` \| `'reading-sources'` \| `'ranking-sources'` \| `'source-failed'` \| `'no-sources-found'`
|
|
64
|
+
- `AiToolState` — `'tool-waiting'` \| `'tool-running'` \| `'permission-needed'` \| `'tool-failed'` \| `'tool-timed-out'`
|
|
65
|
+
- `AiGenerationState` — `'streaming'` \| `'paused'` \| `'interrupted'` \| `'continued'` \| `'regenerating'` \| `'comparing-versions'`
|
|
66
|
+
- `AiArtifactState` — `'generating-artifact'` \| `'artifact-ready'` \| `'artifact-failed'` \| `'artifact-updated'`
|
|
67
|
+
- `AiContextState` — `'context-full'` \| `'context-truncated'` \| `'context-lost'` \| `'context-imported'` \| `'context-invalid'`
|
|
68
|
+
- `AiMemoryState` — `'memory-used'` \| `'memory-updated'` \| `'memory-conflict'` \| `'memory-permission-required'`
|
|
69
|
+
- `AiModelState` — `'model-switching'` \| `'model-fallback'` \| `'model-overloaded'` \| `'model-unavailable'`
|
|
70
|
+
- `AiMultiAgentState` — `'agent-started'` \| `'agent-waiting'` \| `'agent-handoff'` \| `'agent-conflict'` \| `'agent-complete'`
|
|
71
|
+
- `AiStateRow` `intent` — `'brand'` \| `'success'` \| `'warning'` \| `'danger'` \| `'info'` \| `'neutral'`
|
|
72
|
+
|
|
73
|
+
## Usage example
|
|
74
|
+
```tsx
|
|
75
|
+
import { AiReasoningState } from '@/components/ui/AiReasoningState';
|
|
76
|
+
import { AiResearchState } from '@/components/ui/AiResearchState';
|
|
77
|
+
import { AiToolState } from '@/components/ui/AiToolState';
|
|
78
|
+
import { AiGenerationState } from '@/components/ui/AiGenerationState';
|
|
79
|
+
|
|
80
|
+
// Stack the live status of the current turn — each row defaults its own
|
|
81
|
+
// icon, colour, label, and hint from `state`.
|
|
82
|
+
<div className="flex flex-col gap-spacing-md">
|
|
83
|
+
<AiReasoningState state="deep-thinking" />
|
|
84
|
+
<AiResearchState state="searching-sources" />
|
|
85
|
+
<AiToolState state="tool-running" />
|
|
86
|
+
<AiGenerationState state="streaming" />
|
|
87
|
+
</div>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Accessibility
|
|
91
|
+
- Keep keyboard focus visible and any interactive `hint` (`onHintClick`) keyboard-operable; give it a clear `hintLabel`.
|
|
92
|
+
- Convey status with text, not colour alone — the label/hint already carry meaning; intent colour is supplementary.
|
|
93
|
+
- For full color-contrast and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
94
|
+
|
|
95
|
+
## Design tokens used
|
|
96
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
97
|
+
- Intent colours resolve from semantic tokens (`color-text-*`, `color-border-*`, `brand-*`) per `intent`/`state`.
|
|
98
|
+
- Spacing/radius via `spacing-*` / `radius-*` tokens; never hardcode colours.
|
|
99
|
+
|
|
100
|
+
## AI usage guidance
|
|
101
|
+
When generating UI:
|
|
102
|
+
- Install only the state members you use (see Install), then import each `{ AiXState }` from `@/components/ui/AiXState`. NEVER `add ai-states` — that slug does not exist.
|
|
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
|
+
- Drive each row with the documented `state` value; only override `label`/`hint`/`icon` for custom copy. Use only the listed `state` options.
|
|
105
|
+
- For a one-off status not covered by a family member, use `AiStateRow` directly with an explicit `intent` + `icon`.
|
|
106
|
+
- Pass any custom `icon` as a `@platformscode/icons` data URL — see `get_foundations` (`icon-usage`). Never emoji, Lucide, or random icons.
|
|
107
|
+
- Pick one theme per screen via `.theme-dark`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# AI Status Indicator
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: AI Status Indicator
|
|
5
|
+
- Slug: `ai-status-indicator`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add ai-status-indicator`
|
|
8
|
+
- Import: `import { AiStatusIndicator } from '@/components/ui/AiStatusIndicator'`
|
|
9
|
+
- Installed files: `AiStatusIndicator.tsx`, `AiStatusIndicator.types.ts`, `AiStatusIndicator.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/ai-status-indicator
|
|
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 ai-status-indicator`. It copies the source into your components folder (`components/ui/AiStatusIndicator/`, under `src/` when the project has one); import it as `@/components/ui/AiStatusIndicator`. 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
|
+
| `state?` | `'thinking' \| 'tool-running' \| 'tool-success' \| 'tool-error' \| 'source' \| 'model' \| 'agent' \| 'memory'` | 'thinking' | Which AI/agent state to display — drives the icon, intent colour and default copy. |
|
|
18
|
+
| `variant?` | `'brand' \| 'neutral' \| 'outline'` | 'brand' | Visual style of the chip. - `brand` — tinted semantic fill + border (default) - `neutral` — neutral fill + border, semantic icon only - `outline` — transparent fill, semantic border |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. Inherits from the document when unset. `rtl` mirrors the layout and, when `labels` has no entry for the state, uses the built-in Arabic copy. |
|
|
20
|
+
| `showIcon?` | `boolean` | true | Show the leading status icon. |
|
|
21
|
+
| `animated?` | `boolean` | true | Animate the live statuses — a text shimmer on `thinking` and a spinning icon on `tool-running`. Settled statuses stay static. Collapses under `prefers-reduced-motion`. |
|
|
22
|
+
| `labels?` | `Partial<AiStatusIndicatorLabels>` | — | Translatable label per state (see ). |
|
|
23
|
+
| `label?` | `ReactNode` | — | Override the label for the current state (wins over `labels`). |
|
|
24
|
+
| `children?` | `ReactNode` | — | Alias for . |
|
|
25
|
+
|
|
26
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`.
|
|
27
|
+
|
|
28
|
+
## Options (allowed values)
|
|
29
|
+
- `state`: `'thinking'` \| `'tool-running'` \| `'tool-success'` \| `'tool-error'` \| `'source'` \| `'model'` \| `'agent'` \| `'memory'` — Canonical name for — the indicator's `state` values.
|
|
30
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the chip (Figma "Style" property) — a type, not a state.
|
|
31
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. Inherits from the document when unset. `rtl` mirrors the
|
|
32
|
+
layout and, when `labels` has no entry for the state, uses the built-in
|
|
33
|
+
Arabic copy.
|
|
34
|
+
|
|
35
|
+
## Deprecated props
|
|
36
|
+
Do not use in new code:
|
|
37
|
+
- `status`
|
|
38
|
+
- `appearance`
|
|
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-muted)`
|
|
48
|
+
- `var(--ds-color-bg-danger-muted)`
|
|
49
|
+
- `var(--ds-color-bg-info-muted)`
|
|
50
|
+
- `var(--ds-color-bg-muted)`
|
|
51
|
+
- `var(--ds-color-bg-success-muted)`
|
|
52
|
+
- `var(--ds-color-bg-warning-muted)`
|
|
53
|
+
- `var(--ds-color-border-brand)`
|
|
54
|
+
- `var(--ds-color-border-danger-strong)`
|
|
55
|
+
- `var(--ds-color-border-info-strong)`
|
|
56
|
+
- `var(--ds-color-border-subtle)`
|
|
57
|
+
- `var(--ds-color-border-success-strong)`
|
|
58
|
+
- `var(--ds-color-border-warning-strong)`
|
|
59
|
+
- `var(--ds-color-icon-brand)`
|
|
60
|
+
- `var(--ds-color-icon-danger)`
|
|
61
|
+
- `var(--ds-color-icon-info)`
|
|
62
|
+
- `var(--ds-color-icon-success)`
|
|
63
|
+
- `var(--ds-color-icon-warning)`
|
|
64
|
+
- `var(--ds-color-text-brand)`
|
|
65
|
+
- `var(--ds-color-text-danger)`
|
|
66
|
+
- `var(--ds-color-text-info)`
|
|
67
|
+
- `var(--ds-color-text-paragraph)`
|
|
68
|
+
- `var(--ds-color-text-success)`
|
|
69
|
+
- `var(--ds-color-text-warning)`
|
|
70
|
+
- `var(--ds-radius-full)`
|
|
71
|
+
- `var(--ds-spacing-sm)`
|
|
72
|
+
- `var(--ds-spacing-xs)`
|
|
73
|
+
- `var(--ds-spacing-xxs)`
|
|
74
|
+
|
|
75
|
+
## AI usage guidance
|
|
76
|
+
When generating UI:
|
|
77
|
+
- Install with `npx sdaia-ui@latest add ai-status-indicator` (after `npx sdaia-ui@latest init`), then import `{ AiStatusIndicator }` from `@/components/ui/AiStatusIndicator`.
|
|
78
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
79
|
+
- Use only the documented option values listed under "Options".
|
|
80
|
+
- 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).
|
|
81
|
+
- 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,62 @@
|
|
|
1
|
+
# AI Suggested Prompts
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: AI Suggested Prompts
|
|
5
|
+
- Slug: `ai-suggested-prompts`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add ai-suggested-prompts`
|
|
8
|
+
- Import: `import { AiSuggestedPrompts } from '@/components/ui/AiSuggestedPrompts'`
|
|
9
|
+
- Installed files: `AiSuggestedPrompts.tsx`, `AiSuggestedPrompts.types.ts`, `AiSuggestedPrompts.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/ai-suggested-prompts
|
|
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 ai-suggested-prompts`. It copies the source into your components folder (`components/ui/AiSuggestedPrompts/`, under `src/` when the project has one); import it as `@/components/ui/AiSuggestedPrompts`. 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` | `AiSuggestedPromptItem[]` | — | The suggested-prompt entry points to render. |
|
|
18
|
+
| `type?` | `'starter-cards' \| 'follow-up-chips'` | 'starter-cards' | Layout type — mirrors the Figma `Type` property. - `starter-cards` — icon disc + title + description cards (default) - `follow-up-chips` — compact pill chips with a single label |
|
|
19
|
+
| `variant?` | `'neutral' \| 'brand' \| 'outline'` | 'neutral' | Visual style — mirrors the Figma `Style` property. - `neutral` — white surface, neutral border (default) - `brand` — brand-subtle surface, brand-green border - `outline` — transparent surface, neutral border |
|
|
20
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the row flow and text alignment. |
|
|
21
|
+
| `icon?` | `string` | sparklesStroke | Leading icon for every starter card (a `@platformscode/icons` data URL rendered through `DgaIcon`). Overridable per item via `item.icon`. |
|
|
22
|
+
| `showIcon?` | `boolean` | true | Show the leading icon disc on starter cards. |
|
|
23
|
+
| `onSelect?` | `(item: AiSuggestedPromptItem, index: number) => void` | — | Fired when any entry is activated. |
|
|
24
|
+
|
|
25
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onSelect`.
|
|
26
|
+
|
|
27
|
+
## Options (allowed values)
|
|
28
|
+
- `type`: `'starter-cards'` \| `'follow-up-chips'` — Layout type — mirrors the Figma `Type` property.
|
|
29
|
+
- `variant`: `'neutral'` \| `'brand'` \| `'outline'` — Visual style — mirrors the Figma `Style` property.
|
|
30
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the row flow and text alignment.
|
|
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-color-)`
|
|
39
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
40
|
+
- `var(--ds-color-bg-default)`
|
|
41
|
+
- `var(--ds-color-bg-raised)`
|
|
42
|
+
- `var(--ds-color-border-brand)`
|
|
43
|
+
- `var(--ds-color-border-default)`
|
|
44
|
+
- `var(--ds-color-control-border)`
|
|
45
|
+
- `var(--ds-color-icon-brand)`
|
|
46
|
+
- `var(--ds-color-primitive-radius-radius-12)`
|
|
47
|
+
- `var(--ds-color-primitive-radius-radius-8)`
|
|
48
|
+
- `var(--ds-color-text-default)`
|
|
49
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
50
|
+
- `var(--ds-motion-feedback-duration)`
|
|
51
|
+
- `var(--ds-motion-feedback-easing)`
|
|
52
|
+
- `var(--ds-radius-full)`
|
|
53
|
+
- `var(--ds-spacing-lg)`
|
|
54
|
+
- `var(--ds-spacing-sm)`
|
|
55
|
+
|
|
56
|
+
## AI usage guidance
|
|
57
|
+
When generating UI:
|
|
58
|
+
- Install with `npx sdaia-ui@latest add ai-suggested-prompts` (after `npx sdaia-ui@latest init`), then import `{ AiSuggestedPrompts }` from `@/components/ui/AiSuggestedPrompts`.
|
|
59
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
60
|
+
- Use only the documented option values listed under "Options".
|
|
61
|
+
- 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).
|
|
62
|
+
- 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,94 @@
|
|
|
1
|
+
# AI Thinking Indicator
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: AI Thinking Indicator
|
|
5
|
+
- Slug: `ai-thinking-indicator`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add ai-thinking-indicator`
|
|
8
|
+
- Import: `import { AiThinkingIndicator } from '@/components/ui/AiThinkingIndicator'`
|
|
9
|
+
- Installed files: `AiThinkingIndicator.tsx`, `AiThinkingIndicator.types.ts`, `AiThinkingIndicator.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/ai-thinking-indicator
|
|
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 ai-thinking-indicator`. It copies the source into your components folder (`components/ui/AiThinkingIndicator/`, under `src/` when the project has one); import it as `@/components/ui/AiThinkingIndicator`. 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?` | `'neutral' \| 'brand' \| 'outline'` | 'neutral' | Visual style. |
|
|
18
|
+
| `type?` | `'dots' \| 'activity' \| 'reasoning'` | 'dots' | Which cue to render. |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout. Inherits from the document when unset. |
|
|
20
|
+
| `icon?` | `string` | sparklesStroke | Leading AI avatar glyph (a `DgaIcon` data URL from `@platformscode/icons`). |
|
|
21
|
+
| `showAvatar?` | `boolean` | true | Show the leading AI avatar badge (brand circle + sparkle). |
|
|
22
|
+
| `animated?` | `boolean` | true | Animate the working cues — bouncing thinking dots, a shimmering activity label and shimmering live-reasoning copy. Disable for a static snapshot; all collapse under `prefers-reduced-motion`. |
|
|
23
|
+
| `labels?` | `Partial<AiThinkingIndicatorLabels>` | — | Translatable built-in strings (see ). |
|
|
24
|
+
| `label?` | `ReactNode` | — | Activity label shown in the `activity` type (e.g. "Searching the web…"). Falls back to `labels.thinking` ('Thinking…') when unset. |
|
|
25
|
+
| `collapsedLabel?` | `ReactNode` | — | Label for the collapsed reasoning toggle (wins over `labels.showReasoning`). |
|
|
26
|
+
| `title?` | `ReactNode` | — | Title shown in the expanded reasoning panel header (wins over `labels.reasoning`). |
|
|
27
|
+
| `children?` | `ReactNode` | — | Reasoning body content rendered inside the expanded panel. Nothing is rendered in the body when unset. |
|
|
28
|
+
| `open?` | `boolean` | — | Controlled open state of the reasoning disclosure. |
|
|
29
|
+
| `defaultOpen?` | `boolean` | false | Initial open state of the reasoning disclosure when uncontrolled. |
|
|
30
|
+
| `onOpenChange?` | `(open: boolean) => void` | — | Called when the reasoning disclosure is toggled. |
|
|
31
|
+
| `thinkingLabel?` | `string` | — | Status text announced by the wordless `dots` type (wins over `labels.thinking`). |
|
|
32
|
+
| `as?` | `ElementType` | 'div' | Render the root as a different element. |
|
|
33
|
+
|
|
34
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `style`.
|
|
35
|
+
|
|
36
|
+
## Options (allowed values)
|
|
37
|
+
- `variant`: `'neutral'` \| `'brand'` \| `'outline'` — Visual style (a type) — mirrors the Figma `Style` property.
|
|
38
|
+
- `neutral` — quiet surface (raised / subtle) with a default border (default)
|
|
39
|
+
- `brand` — brand-tinted surface with a brand border
|
|
40
|
+
- `outline` — minimal surface (default / transparent) with a default border
|
|
41
|
+
- `type`: `'dots'` \| `'activity'` \| `'reasoning'` — Structural type — mirrors the Figma `State` property, which describes a
|
|
42
|
+
variation of the cue rather than a condition (so it is a type here):
|
|
43
|
+
- `dots` — three pulsing dots (model is thinking, no copy yet)
|
|
44
|
+
- `activity` — sparkle + short activity label (e.g. "Searching the web…")
|
|
45
|
+
- `reasoning` — a reasoning disclosure; collapsed shows a "Show reasoning"
|
|
46
|
+
toggle, expanded (via ) reveals the
|
|
47
|
+
reasoning panel. The Figma `Reasoning-Open` variant is this type with the
|
|
48
|
+
disclosure open.
|
|
49
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout. Inherits from the document when unset.
|
|
50
|
+
|
|
51
|
+
## Deprecated props
|
|
52
|
+
Do not use in new code:
|
|
53
|
+
- `style`
|
|
54
|
+
- `state`
|
|
55
|
+
- `rtl` — Deprecated boolean form of . Prefer `dir`.
|
|
56
|
+
|
|
57
|
+
## Accessibility
|
|
58
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
59
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
60
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
61
|
+
|
|
62
|
+
## Design tokens used
|
|
63
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
64
|
+
- `var(--ds-color-)`
|
|
65
|
+
- `var(--ds-color-bg-brand)`
|
|
66
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
67
|
+
- `var(--ds-color-bg-default)`
|
|
68
|
+
- `var(--ds-color-bg-raised)`
|
|
69
|
+
- `var(--ds-color-bg-subtle)`
|
|
70
|
+
- `var(--ds-color-border-brand)`
|
|
71
|
+
- `var(--ds-color-border-default)`
|
|
72
|
+
- `var(--ds-color-border-muted)`
|
|
73
|
+
- `var(--ds-color-icon-brand)`
|
|
74
|
+
- `var(--ds-color-icon-neutral)`
|
|
75
|
+
- `var(--ds-color-icon-oncolor)`
|
|
76
|
+
- `var(--ds-color-primitive-radius-radius-10)`
|
|
77
|
+
- `var(--ds-color-text-brand)`
|
|
78
|
+
- `var(--ds-color-text-default)`
|
|
79
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
80
|
+
- `var(--ds-radius-full)`
|
|
81
|
+
- `var(--ds-radius-xxs)`
|
|
82
|
+
- `var(--ds-spacing-lg)`
|
|
83
|
+
- `var(--ds-spacing-md)`
|
|
84
|
+
- `var(--ds-spacing-sm)`
|
|
85
|
+
- `var(--ds-spacing-xl)`
|
|
86
|
+
- `var(--ds-text-leading-line-heights-text-sm)`
|
|
87
|
+
|
|
88
|
+
## AI usage guidance
|
|
89
|
+
When generating UI:
|
|
90
|
+
- Install with `npx sdaia-ui@latest add ai-thinking-indicator` (after `npx sdaia-ui@latest init`), then import `{ AiThinkingIndicator }` from `@/components/ui/AiThinkingIndicator`.
|
|
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
|
+
- 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).
|
|
94
|
+
- 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,105 @@
|
|
|
1
|
+
# Artifact Viewer
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Artifact Viewer
|
|
5
|
+
- Slug: `artifact-viewer`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add artifact-viewer`
|
|
8
|
+
- Import: `import { ArtifactViewer } from '@/components/ui/ArtifactViewer'`
|
|
9
|
+
- Installed files: `ArtifactViewer.tsx`, `ArtifactViewer.types.ts`, `ArtifactViewer.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/artifact-viewer
|
|
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 artifact-viewer`. It copies the source into your components folder (`components/ui/ArtifactViewer/`, under `src/` when the project has one); import it as `@/components/ui/ArtifactViewer`. 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
|
+
| `mode?` | `'inline' \| 'fullscreen'` | 'inline' | Layout mode. `inline` is the compact card; `fullscreen` is the 2-pane viewer. |
|
|
18
|
+
| `type?` | `'code' \| 'file' \| 'document' \| 'image'` | 'code' | Artifact kind — drives the tile accent, default icon and preview rendering. |
|
|
19
|
+
| `variant?` | `'neutral' \| 'brand' \| 'outline'` | 'neutral' | Visual style of the card surface. |
|
|
20
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the header, sidebar and action order. |
|
|
21
|
+
| `title` | `ReactNode` | — | Artifact name / filename (header title). |
|
|
22
|
+
| `subtitle?` | `ReactNode` | — | Secondary line — e.g. `TypeScript · 1.2 KB`. |
|
|
23
|
+
| `icon?` | `string` | — | Override the tile icon (a `@platformscode/icons` data URL). Defaults per `type`. |
|
|
24
|
+
| `status?` | `ReactNode` | — | Status chip label (e.g. `Ready`). No default — the chip renders only when set. |
|
|
25
|
+
| `statusState?` | `'success' \| 'warning' \| 'danger' \| 'info' \| 'neutral'` | 'success' | Status chip colour intent. |
|
|
26
|
+
| `showStatus?` | `boolean` | true | Show the status chip. |
|
|
27
|
+
| `version?` | `ReactNode` | — | Version label shown as a chip in the fullscreen top bar (e.g. `v2`). |
|
|
28
|
+
| `code?` | `string` | — | Code body for `type="code"` (rendered in the dark code panel). Nothing renders when omitted. |
|
|
29
|
+
| `imageSrc?` | `string` | — | Image source for `type="image"` — when omitted a placeholder is shown. |
|
|
30
|
+
| `imageCaption?` | `ReactNode` | — | Caption under the image placeholder / image. |
|
|
31
|
+
| `documentHeading?` | `ReactNode` | — | Heading for `type="document"`. |
|
|
32
|
+
| `documentBody?` | `ReactNode` | — | Custom body for `type="document"` — overrides the default skeleton lines. |
|
|
33
|
+
| `preview?` | `ReactNode` | — | Fully override the preview region for any type. |
|
|
34
|
+
| `meta?` | `ArtifactViewerMetaRow[]` | — | Metadata rows. No default — the list renders only when rows are passed. |
|
|
35
|
+
| `detailsHeading?` | `ReactNode` | 'Details' | Heading above the details sidebar (fullscreen). Same as `labels.details`. |
|
|
36
|
+
| `prompt?` | `ReactNode` | — | Prompt line shown in the inline card. |
|
|
37
|
+
| `showPrompt?` | `boolean` | true | Show the prompt row (inline only). |
|
|
38
|
+
| `onOpen?` | `() => void` | — | Action handlers — the matching buttons render with the `labels` copy. |
|
|
39
|
+
| `onCopy?` | `() => void` | — | — |
|
|
40
|
+
| `onDownload?` | `() => void` | — | — |
|
|
41
|
+
| `onRegenerate?` | `() => void` | — | — |
|
|
42
|
+
| `onMore?` | `() => void` | — | — |
|
|
43
|
+
| `onExpand?` | `() => void` | — | Inline header expand control (→ fullscreen). |
|
|
44
|
+
| `onClose?` | `() => void` | — | Fullscreen top-bar close control. |
|
|
45
|
+
| `actions?` | `ReactNode` | — | Override the inline actions row entirely. |
|
|
46
|
+
| `headerActions?` | `ReactNode` | — | Override the fullscreen top-bar trailing action buttons. |
|
|
47
|
+
| `labels?` | `Partial<ArtifactViewerLabels>` | — | Localised copy for the action buttons, icon-button names and details heading. |
|
|
48
|
+
|
|
49
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `prefix`.
|
|
50
|
+
|
|
51
|
+
## Options (allowed values)
|
|
52
|
+
- `mode`: `'inline'` \| `'fullscreen'` — Layout mode — mirrors the Figma `Variant` property.
|
|
53
|
+
- `type`: `'code'` \| `'file'` \| `'document'` \| `'image'` — Artifact kind — mirrors the Figma `Type` property. Sets the tile accent, icon and preview.
|
|
54
|
+
- `variant`: `'neutral'` \| `'brand'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
55
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the header, sidebar and action order.
|
|
56
|
+
- `statusState`: `'success'` \| `'warning'` \| `'danger'` \| `'info'` \| `'neutral'` — Colour intent of the status chip.
|
|
57
|
+
|
|
58
|
+
## Accessibility
|
|
59
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
60
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
61
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
62
|
+
|
|
63
|
+
## Design tokens used
|
|
64
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
65
|
+
- `var(--ds-brand-neutral-800)`
|
|
66
|
+
- `var(--ds-color-)`
|
|
67
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
68
|
+
- `var(--ds-color-bg-danger-subtle)`
|
|
69
|
+
- `var(--ds-color-bg-default)`
|
|
70
|
+
- `var(--ds-color-bg-info-subtle)`
|
|
71
|
+
- `var(--ds-color-bg-muted)`
|
|
72
|
+
- `var(--ds-color-bg-raised)`
|
|
73
|
+
- `var(--ds-color-bg-subtle)`
|
|
74
|
+
- `var(--ds-color-bg-success-subtle)`
|
|
75
|
+
- `var(--ds-color-border-brand)`
|
|
76
|
+
- `var(--ds-color-border-default)`
|
|
77
|
+
- `var(--ds-color-border-subtle)`
|
|
78
|
+
- `var(--ds-color-icon-brand)`
|
|
79
|
+
- `var(--ds-color-icon-danger)`
|
|
80
|
+
- `var(--ds-color-icon-info)`
|
|
81
|
+
- `var(--ds-color-icon-success)`
|
|
82
|
+
- `var(--ds-color-primitive-radius-radius-10)`
|
|
83
|
+
- `var(--ds-color-primitive-radius-radius-12)`
|
|
84
|
+
- `var(--ds-color-primitive-radius-radius-16)`
|
|
85
|
+
- `var(--ds-color-primitive-radius-radius-6)`
|
|
86
|
+
- `var(--ds-color-primitive-radius-radius-8)`
|
|
87
|
+
- `var(--ds-color-primitive-radius-radius-9999)`
|
|
88
|
+
- `var(--ds-color-text-default)`
|
|
89
|
+
- `var(--ds-color-text-on-color)`
|
|
90
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
91
|
+
- `var(--ds-spacing-2xl)`
|
|
92
|
+
- `var(--ds-spacing-lg)`
|
|
93
|
+
- `var(--ds-spacing-md)`
|
|
94
|
+
- `var(--ds-spacing-sm)`
|
|
95
|
+
- `var(--ds-spacing-xs)`
|
|
96
|
+
- `var(--ds-spacing-xxs)`
|
|
97
|
+
- `var(--ds-text-leading-line-heights-text-xs)`
|
|
98
|
+
|
|
99
|
+
## AI usage guidance
|
|
100
|
+
When generating UI:
|
|
101
|
+
- Install with `npx sdaia-ui@latest add artifact-viewer` (after `npx sdaia-ui@latest init`), then import `{ ArtifactViewer }` from `@/components/ui/ArtifactViewer`.
|
|
102
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
103
|
+
- Use only the documented option values listed under "Options".
|
|
104
|
+
- 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).
|
|
105
|
+
- 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,61 @@
|
|
|
1
|
+
# Citation
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Citation
|
|
5
|
+
- Slug: `citation`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add citation`
|
|
8
|
+
- Import: `import { Citation } from '@/components/ui/Citation'`
|
|
9
|
+
- Installed files: `Citation.tsx`, `Citation.types.ts`, `Citation.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/citation
|
|
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 citation`. It copies the source into your components folder (`components/ui/Citation/`, under `src/` when the project has one); import it as `@/components/ui/Citation`. 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 citation badge. - `brand` — raised surface, success-green index badge (default) - `neutral` — subtle surface, neutral index badge - `outline` — transparent surface, info-blue index badge |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout (index trails the text). |
|
|
19
|
+
| `source` | `ReactNode` | — | Source name — the cited document/source (e.g. `knowledge_base_v3`). |
|
|
20
|
+
| `index?` | `ReactNode` | — | Citation index shown in the leading badge (e.g. `1`). |
|
|
21
|
+
| `showIndex?` | `boolean` | true | Show the leading index badge. |
|
|
22
|
+
| `type?` | `ReactNode` | — | Source type shown in the trailing badge (e.g. `Vector File`). |
|
|
23
|
+
| `showType?` | `boolean` | true | Show the trailing type badge (and its divider). |
|
|
24
|
+
| `as?` | `ElementType` | 'span' | Override the rendered root element (e.g. `'a'`, `'button'`). |
|
|
25
|
+
|
|
26
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`.
|
|
27
|
+
|
|
28
|
+
## Options (allowed values)
|
|
29
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the citation — mirrors the Figma `Style` property.
|
|
30
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout (index trails the text).
|
|
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-color-)`
|
|
39
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
40
|
+
- `var(--ds-color-bg-default)`
|
|
41
|
+
- `var(--ds-color-bg-info-subtle)`
|
|
42
|
+
- `var(--ds-color-bg-raised)`
|
|
43
|
+
- `var(--ds-color-bg-subtle)`
|
|
44
|
+
- `var(--ds-color-border-brand)`
|
|
45
|
+
- `var(--ds-color-border-default)`
|
|
46
|
+
- `var(--ds-color-border-default-strong)`
|
|
47
|
+
- `var(--ds-color-border-info-strong)`
|
|
48
|
+
- `var(--ds-color-border-subtle)`
|
|
49
|
+
- `var(--ds-color-text-brand)`
|
|
50
|
+
- `var(--ds-color-text-default)`
|
|
51
|
+
- `var(--ds-color-text-info)`
|
|
52
|
+
- `var(--ds-radius-m)`
|
|
53
|
+
- `var(--ds-spacing-sm)`
|
|
54
|
+
- `var(--ds-spacing-xs)`
|
|
55
|
+
|
|
56
|
+
## AI usage guidance
|
|
57
|
+
When generating UI:
|
|
58
|
+
- Install with `npx sdaia-ui@latest add citation` (after `npx sdaia-ui@latest init`), then import `{ Citation }` from `@/components/ui/Citation`.
|
|
59
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
60
|
+
- Use only the documented option values listed under "Options".
|
|
61
|
+
- 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,111 @@
|
|
|
1
|
+
# Context Manager
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Context Manager
|
|
5
|
+
- Slug: `context-manager`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add context-manager`
|
|
8
|
+
- Import: `import { ContextManager } from '@/components/ui/ContextManager'`
|
|
9
|
+
- Installed files: `ContextManager.tsx`, `ContextManager.types.ts`, `ContextManager.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/context-manager
|
|
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 context-manager`. It copies the source into your components folder (`components/ui/ContextManager/`, under `src/` when the project has one); import it as `@/components/ui/ContextManager`. 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?` | `'panel' \| 'inline' \| 'modal'` | 'panel' | Structural layout. |
|
|
18
|
+
| `surface?` | `'neutral' \| 'brand' \| 'outline'` | 'neutral' | Outer surface treatment. |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction for RTL support. Omit to inherit from the closest `dir` ancestor. |
|
|
20
|
+
| `labels?` | `Partial<ContextManagerLabels>` | — | Override any built-in string (titles, status words, aria-labels, buttons). |
|
|
21
|
+
| `title?` | `ReactNode` | `labels.title` (panel/inline) · `labels.modalTitle` (modal) | Title text. |
|
|
22
|
+
| `headerStatus?` | `ReactNode` | — | Panel: status badge shown next to the title (e.g. "Active"). |
|
|
23
|
+
| `subtitle?` | `ReactNode` | — | Panel: subtitle line · Modal: description line under the title. |
|
|
24
|
+
| `count?` | `number` | — | Inline: total-count shown in the muted pill after the title. |
|
|
25
|
+
| `activeCount?` | `number` | — | Inline: number shown in the green "{n} active" badge. |
|
|
26
|
+
| `activeLabel?` | `string` | 'active' | Inline: word after `activeCount` in the badge. Wins over `labels.active`. |
|
|
27
|
+
| `tabs?` | `ContextTab[]` | — | — |
|
|
28
|
+
| `activeTabId?` | `string` | — | Controlled active tab id. |
|
|
29
|
+
| `onTabChange?` | `(id: string) => void` | — | — |
|
|
30
|
+
| `items?` | `ContextItem[]` | [] | — |
|
|
31
|
+
| `onToggleItem?` | `(id: string, on: boolean) => void` | — | Fired when a row toggle changes. |
|
|
32
|
+
| `detail?` | `ContextDetail \| null` | — | Right-column detail for the selected item. Pass `null` to hide it. |
|
|
33
|
+
| `moreCount?` | `number` | — | Inline: "+{n} more" pill appended after the chips. |
|
|
34
|
+
| `onRemoveItem?` | `(id: string) => void` | — | Inline: fired when a chip's dismiss "×" is activated. |
|
|
35
|
+
| `searchPlaceholder?` | `string` | — | Modal search placeholder. Wins over `labels.searchPlaceholder`. |
|
|
36
|
+
| `searchValue?` | `string` | — | Modal search value (controlled). |
|
|
37
|
+
| `onSearchChange?` | `(value: string) => void` | — | — |
|
|
38
|
+
| `footerSummary?` | `ReactNode` | — | Modal footer summary text (e.g. "4 of 12 shown"). |
|
|
39
|
+
| `warning?` | `ReactNode` | — | Panel footer warning text. Omit to hide the warning bar. |
|
|
40
|
+
| `addLabel?` | `string` | — | — |
|
|
41
|
+
| `manageLabel?` | `string` | — | — |
|
|
42
|
+
| `previewLabel?` | `string` | — | — |
|
|
43
|
+
| `openSourceLabel?` | `string` | — | — |
|
|
44
|
+
| `removeLabel?` | `string` | — | — |
|
|
45
|
+
| `cancelLabel?` | `string` | — | — |
|
|
46
|
+
| `saveLabel?` | `string` | — | — |
|
|
47
|
+
| `onAddContext?` | `() => void` | — | — |
|
|
48
|
+
| `onManage?` | `() => void` | — | — |
|
|
49
|
+
| `onSearch?` | `() => void` | — | — |
|
|
50
|
+
| `onFilter?` | `() => void` | — | — |
|
|
51
|
+
| `onSort?` | `() => void` | — | — |
|
|
52
|
+
| `onClose?` | `() => void` | — | — |
|
|
53
|
+
| `onCancel?` | `() => void` | — | — |
|
|
54
|
+
| `onSave?` | `() => void` | — | — |
|
|
55
|
+
| `onPreview?` | `() => void` | — | — |
|
|
56
|
+
| `onOpenSource?` | `() => void` | — | — |
|
|
57
|
+
| `onRemove?` | `() => void` | — | — |
|
|
58
|
+
|
|
59
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
60
|
+
|
|
61
|
+
## Options (allowed values)
|
|
62
|
+
- `variant`: `'panel'` \| `'inline'` \| `'modal'` — Structural layout of the manager.
|
|
63
|
+
- `panel` — full two-column panel: header, tabs, list + detail, footer warning.
|
|
64
|
+
- `inline` — compact in-conversation strip: header, dismissible chips, actions.
|
|
65
|
+
- `modal` — centred dialog: header, search, list, footer actions.
|
|
66
|
+
|
|
67
|
+
Mirrors the Figma `Variant` property (Panel / Inline / Modal).
|
|
68
|
+
- `surface`: `'neutral'` \| `'brand'` \| `'outline'` — Outer surface treatment — mirrors the Figma `Style` property.
|
|
69
|
+
- `neutral` — solid raised surface, hairline border.
|
|
70
|
+
- `brand` — brand-tinted surface, brand border.
|
|
71
|
+
- `outline` — transparent surface, neutral border.
|
|
72
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction for RTL support. Omit to inherit from the closest `dir` ancestor.
|
|
73
|
+
|
|
74
|
+
## Accessibility
|
|
75
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
76
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
77
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
78
|
+
|
|
79
|
+
## Design tokens used
|
|
80
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
81
|
+
- `var(--ds-color-)`
|
|
82
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
83
|
+
- `var(--ds-color-bg-default)`
|
|
84
|
+
- `var(--ds-color-bg-info-subtle)`
|
|
85
|
+
- `var(--ds-color-bg-muted)`
|
|
86
|
+
- `var(--ds-color-bg-raised)`
|
|
87
|
+
- `var(--ds-color-bg-subtle)`
|
|
88
|
+
- `var(--ds-color-bg-warning-subtle)`
|
|
89
|
+
- `var(--ds-color-border-brand)`
|
|
90
|
+
- `var(--ds-color-border-default)`
|
|
91
|
+
- `var(--ds-color-border-subtle)`
|
|
92
|
+
- `var(--ds-color-button-bg-neutral-default)`
|
|
93
|
+
- `var(--ds-color-icon-brand)`
|
|
94
|
+
- `var(--ds-color-icon-info)`
|
|
95
|
+
- `var(--ds-color-icon-neutral)`
|
|
96
|
+
- `var(--ds-color-icon-warning)`
|
|
97
|
+
- `var(--ds-color-text-default)`
|
|
98
|
+
- `var(--ds-color-text-display)`
|
|
99
|
+
- `var(--ds-color-text-paragraph)`
|
|
100
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
101
|
+
- `var(--ds-color-text-warning)`
|
|
102
|
+
- `var(--ds-radius-full)`
|
|
103
|
+
- `var(--ds-spacing-sm)`
|
|
104
|
+
- `var(--ds-spacing-xs)`
|
|
105
|
+
|
|
106
|
+
## AI usage guidance
|
|
107
|
+
When generating UI:
|
|
108
|
+
- Install with `npx sdaia-ui@latest add context-manager` (after `npx sdaia-ui@latest init`), then import `{ ContextManager }` from `@/components/ui/ContextManager`.
|
|
109
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
110
|
+
- Use only the documented option values listed under "Options".
|
|
111
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|