@sdaia-ds/mcp 0.0.0-stage → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +291 -0
- package/dist/index.js.map +1 -0
- package/knowledge/actions/breadcrumb.md +50 -0
- package/knowledge/actions/button-menu.md +82 -0
- package/knowledge/actions/button-split.md +69 -0
- package/knowledge/actions/button.md +101 -0
- package/knowledge/actions/content-switcher.md +66 -0
- package/knowledge/actions/date-picker.md +115 -0
- package/knowledge/actions/floating-button.md +100 -0
- package/knowledge/actions/horizontal-tabs.md +52 -0
- package/knowledge/actions/link.md +76 -0
- package/knowledge/actions/modal.md +103 -0
- package/knowledge/actions/pagination.md +69 -0
- package/knowledge/actions/radio-button.md +88 -0
- package/knowledge/actions/switch.md +87 -0
- package/knowledge/actions/tag.md +69 -0
- package/knowledge/ai/agent-activity.md +65 -0
- package/knowledge/ai/agent-card.md +65 -0
- package/knowledge/ai/agent-handoff.md +65 -0
- package/knowledge/ai/ai-citation.md +78 -0
- package/knowledge/ai/ai-code-block.md +86 -0
- package/knowledge/ai/ai-disclaimer.md +84 -0
- package/knowledge/ai/ai-message-bubble.md +81 -0
- package/knowledge/ai/ai-message.md +118 -0
- package/knowledge/ai/ai-prompt-input.md +93 -0
- package/knowledge/ai/ai-states.md +107 -0
- package/knowledge/ai/ai-status-indicator.md +81 -0
- package/knowledge/ai/ai-suggested-prompts.md +62 -0
- package/knowledge/ai/ai-thinking-indicator.md +94 -0
- package/knowledge/ai/artifact-viewer.md +105 -0
- package/knowledge/ai/citation.md +61 -0
- package/knowledge/ai/context-manager.md +111 -0
- package/knowledge/ai/prompt-context.md +72 -0
- package/knowledge/ai/prompt-suggestion.md +68 -0
- package/knowledge/ai/prompt-template.md +71 -0
- package/knowledge/ai/prompt-variable.md +61 -0
- package/knowledge/ai/reasoning-trace.md +106 -0
- package/knowledge/ai/source-explorer.md +117 -0
- package/knowledge/ai/source-group.md +59 -0
- package/knowledge/ai/source-reference.md +70 -0
- package/knowledge/ai/thinking-panel.md +77 -0
- package/knowledge/ai/tool-activity-feed.md +67 -0
- package/knowledge/ai/tool-call-card.md +66 -0
- package/knowledge/ai/tool-status-row.md +72 -0
- package/knowledge/ai/tool-timeline-item.md +71 -0
- package/knowledge/ai/voice-session.md +93 -0
- package/knowledge/feedback/alert.md +106 -0
- package/knowledge/feedback/badge.md +86 -0
- package/knowledge/feedback/card.md +54 -0
- package/knowledge/feedback/feedback-overview.md +37 -0
- package/knowledge/feedback/feedback.md +46 -0
- package/knowledge/feedback/help-icon.md +57 -0
- package/knowledge/feedback/loading-indicator.md +76 -0
- package/knowledge/feedback/notification-banner.md +73 -0
- package/knowledge/feedback/notification-popup.md +87 -0
- package/knowledge/feedback/notifications.md +158 -0
- package/knowledge/feedback/progress-bar.md +69 -0
- package/knowledge/feedback/rating-overview.md +58 -0
- package/knowledge/feedback/rating.md +64 -0
- package/knowledge/feedback/skeleton-avatar.md +48 -0
- package/knowledge/feedback/skeleton.md +53 -0
- package/knowledge/feedback/toast.md +74 -0
- package/knowledge/feedback/tooltip.md +72 -0
- package/knowledge/form/autocomplete.md +100 -0
- package/knowledge/form/checkbox.md +95 -0
- package/knowledge/form/date-time-field.md +63 -0
- package/knowledge/form/error-summary.md +56 -0
- package/knowledge/form/field-group.md +57 -0
- package/knowledge/form/file-uploader.md +60 -0
- package/knowledge/form/form-section.md +58 -0
- package/knowledge/form/number-input.md +92 -0
- package/knowledge/form/otp-input.md +83 -0
- package/knowledge/form/password-input.md +49 -0
- package/knowledge/form/range-slider.md +71 -0
- package/knowledge/form/rich-text-editor.md +106 -0
- package/knowledge/form/select.md +113 -0
- package/knowledge/form/signature.md +83 -0
- package/knowledge/form/slider.md +66 -0
- package/knowledge/form/text-area.md +90 -0
- package/knowledge/form/text-input.md +132 -0
- package/knowledge/form/time-input.md +44 -0
- package/knowledge/form/time-picker.md +73 -0
- package/knowledge/foundations/accessibility.md +97 -0
- package/knowledge/foundations/colors.md +1117 -0
- package/knowledge/foundations/figma.md +30 -0
- package/knowledge/foundations/icon-usage.md +114 -0
- package/knowledge/foundations/icons.md +16 -0
- package/knowledge/foundations/motion.md +39 -0
- package/knowledge/foundations/radius.md +17 -0
- package/knowledge/foundations/responsive.md +64 -0
- package/knowledge/foundations/rtl.md +106 -0
- package/knowledge/foundations/spacing.md +27 -0
- package/knowledge/foundations/theme.md +115 -0
- package/knowledge/foundations/tokens.json +12124 -0
- package/knowledge/foundations/typography.md +45 -0
- package/knowledge/general/accordion.md +79 -0
- package/knowledge/general/activity.md +44 -0
- package/knowledge/general/app-shell.md +64 -0
- package/knowledge/general/area-chart.md +89 -0
- package/knowledge/general/audio-player.md +85 -0
- package/knowledge/general/avatar-group.md +50 -0
- package/knowledge/general/avatar.md +61 -0
- package/knowledge/general/carousel-image.md +103 -0
- package/knowledge/general/chart.md +25 -0
- package/knowledge/general/chip.md +90 -0
- package/knowledge/general/code-snippet.md +80 -0
- package/knowledge/general/column-chart.md +84 -0
- package/knowledge/general/context-menu.md +55 -0
- package/knowledge/general/digital-stamp.md +77 -0
- package/knowledge/general/divider.md +65 -0
- package/knowledge/general/donut-chart.md +75 -0
- package/knowledge/general/draggable-list.md +43 -0
- package/knowledge/general/dropdown.md +90 -0
- package/knowledge/general/empty-state.md +60 -0
- package/knowledge/general/filtration.md +85 -0
- package/knowledge/general/footer.md +59 -0
- package/knowledge/general/line-chart.md +95 -0
- package/knowledge/general/list.md +91 -0
- package/knowledge/general/media-gallery.md +85 -0
- package/knowledge/general/media-viewer.md +78 -0
- package/knowledge/general/menu.md +66 -0
- package/knowledge/general/metric.md +92 -0
- package/knowledge/general/nav-bar.md +62 -0
- package/knowledge/general/nav-header.md +125 -0
- package/knowledge/general/number.md +72 -0
- package/knowledge/general/page-template.md +80 -0
- package/knowledge/general/pdf-viewer.md +91 -0
- package/knowledge/general/pie-chart-panel.md +86 -0
- package/knowledge/general/popover.md +115 -0
- package/knowledge/general/progress-circle.md +63 -0
- package/knowledge/general/quote.md +64 -0
- package/knowledge/general/radial-stepper.md +72 -0
- package/knowledge/general/scatter-chart.md +62 -0
- package/knowledge/general/second-nav-header.md +55 -0
- package/knowledge/general/slideout-menu.md +92 -0
- package/knowledge/general/stepper.md +42 -0
- package/knowledge/general/structured-list.md +52 -0
- package/knowledge/general/table-bulk-actions-bar.md +66 -0
- package/knowledge/general/table-of-content.md +49 -0
- package/knowledge/general/table.md +113 -0
- package/knowledge/general/tree-view.md +55 -0
- package/knowledge/general/vertical-tabs.md +48 -0
- package/knowledge/general/video-player.md +88 -0
- package/knowledge/manifest.json +919 -0
- package/knowledge/patterns/buttons-with-sdaia-touch.md +34 -0
- package/knowledge/patterns/sdaia-logo-animation.md +35 -0
- package/knowledge/patterns/switch-with-sdaia-touch.md +29 -0
- package/knowledge/setup.md +125 -0
- package/package.json +45 -4
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Prompt Context
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Prompt Context
|
|
5
|
+
- Slug: `prompt-context`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add prompt-context`
|
|
8
|
+
- Import: `import { PromptContext } from '@/components/ui/PromptContext'`
|
|
9
|
+
- Installed files: `PromptContext.tsx`, `PromptContext.types.ts`, `PromptContext.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/prompt-context
|
|
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 prompt-context`. It copies the source into your components folder (`components/ui/PromptContext/`, under `src/` when the project has one); import it as `@/components/ui/PromptContext`. 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 context chip. - `brand` — raised surface + brand-tinted icon tile (default) - `neutral` — subtle surface + muted icon tile - `outline` — transparent surface + outlined icon tile |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout. Omit to inherit from the closest `dir` ancestor. |
|
|
19
|
+
| `labels?` | `Partial<PromptContextLabels>` | — | Override any built-in string (e.g. the remove button's aria-label). |
|
|
20
|
+
| `icon?` | `string` | fileAttachmentStroke | Leading icon — a `@platformscode/icons` data URL. |
|
|
21
|
+
| `filename` | `ReactNode` | — | File name / context title (truncates on overflow). |
|
|
22
|
+
| `tokens?` | `ReactNode` | — | Token-count label (e.g. `14.8k tokens`). |
|
|
23
|
+
| `fileType?` | `ReactNode` | — | File-type badge label (e.g. `CSV`). |
|
|
24
|
+
| `showType?` | `boolean` | true | Show the file-type badge. |
|
|
25
|
+
| `status?` | `ReactNode` | — | Status badge label (e.g. `Loaded`). |
|
|
26
|
+
| `showStatus?` | `boolean` | true | Show the status badge. |
|
|
27
|
+
| `statusColor?` | `BadgeColor` | 'primary' | Status badge colour. |
|
|
28
|
+
| `showRemove?` | `boolean` | true | Show the remove action. |
|
|
29
|
+
| `removeIcon?` | `string` | cancel01Stroke | Remove icon — a `@platformscode/icons` data URL. |
|
|
30
|
+
| `removeLabel?` | `string` | 'Remove' | Accessible label for the remove button. Wins over `labels.remove`. |
|
|
31
|
+
| `onRemove?` | `MouseEventHandler<HTMLButtonElement>` | — | Click handler for the remove button. |
|
|
32
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
33
|
+
|
|
34
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`, `title`.
|
|
35
|
+
|
|
36
|
+
## Options (allowed values)
|
|
37
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the chip — mirrors the Figma `Style` property.
|
|
38
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout. Omit to inherit from the closest `dir` ancestor.
|
|
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-)`
|
|
48
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
49
|
+
- `var(--ds-color-bg-muted)`
|
|
50
|
+
- `var(--ds-color-bg-raised)`
|
|
51
|
+
- `var(--ds-color-bg-subtle)`
|
|
52
|
+
- `var(--ds-color-border-default)`
|
|
53
|
+
- `var(--ds-color-border-subtle)`
|
|
54
|
+
- `var(--ds-color-icon-brand)`
|
|
55
|
+
- `var(--ds-color-icon-default)`
|
|
56
|
+
- `var(--ds-color-icon-neutral)`
|
|
57
|
+
- `var(--ds-color-text-default)`
|
|
58
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
59
|
+
- `var(--ds-radius-l)`
|
|
60
|
+
- `var(--ds-radius-m)`
|
|
61
|
+
- `var(--ds-spacing-md)`
|
|
62
|
+
- `var(--ds-spacing-sm)`
|
|
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 prompt-context` (after `npx sdaia-ui@latest init`), then import `{ PromptContext }` from `@/components/ui/PromptContext`.
|
|
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,68 @@
|
|
|
1
|
+
# Prompt Suggestion
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Prompt Suggestion
|
|
5
|
+
- Slug: `prompt-suggestion`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add prompt-suggestion`
|
|
8
|
+
- Import: `import { PromptSuggestion } from '@/components/ui/PromptSuggestion'`
|
|
9
|
+
- Installed files: `PromptSuggestion.tsx`, `PromptSuggestion.types.ts`, `PromptSuggestion.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/prompt-suggestion
|
|
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 prompt-suggestion`. It copies the source into your components folder (`components/ui/PromptSuggestion/`, under `src/` when the project has one); import it as `@/components/ui/PromptSuggestion`. 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 suggestion card. - `brand` — raised surface, neutral border that turns brand-green on hover, soft-tinted icon disc + soft category chip (default) - `neutral` — subtle surface, black icon disc, neutral category chip - `outline` — transparent surface, outlined icon disc + outlined chip |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout (icon trails the text). |
|
|
19
|
+
| `title` | `ReactNode` | — | Primary line — the suggested prompt title. |
|
|
20
|
+
| `description?` | `ReactNode` | — | Secondary line — a short description of the prompt. |
|
|
21
|
+
| `category?` | `ReactNode` | — | Category label rendered inside the DS Chip. |
|
|
22
|
+
| `meta?` | `ReactNode` | — | Token-cost meta text shown after the category (e.g. `~2.1k tokens`). |
|
|
23
|
+
| `icon?` | `string` | sparklesStroke | Leading icon — a `@platformscode/icons` data URL rendered through `DgaIcon`. |
|
|
24
|
+
| `showIcon?` | `boolean` | true | Show the leading icon disc. |
|
|
25
|
+
| `as?` | `ElementType` | 'button' | Override the rendered root element (e.g. `'a'`, `'div'`). |
|
|
26
|
+
|
|
27
|
+
Also accepts standard `<button>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `prefix`.
|
|
28
|
+
|
|
29
|
+
## Options (allowed values)
|
|
30
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
31
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout (icon trails the text).
|
|
32
|
+
|
|
33
|
+
## Accessibility
|
|
34
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
35
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
36
|
+
|
|
37
|
+
## Design tokens used
|
|
38
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
39
|
+
- `var(--ds-color-bg-default)`
|
|
40
|
+
- `var(--ds-color-bg-raised)`
|
|
41
|
+
- `var(--ds-color-bg-subtle)`
|
|
42
|
+
- `var(--ds-color-border-brand)`
|
|
43
|
+
- `var(--ds-color-border-default)`
|
|
44
|
+
- `var(--ds-color-border-subtle)`
|
|
45
|
+
- `var(--ds-color-button-bg-black-default)`
|
|
46
|
+
- `var(--ds-color-icon-default)`
|
|
47
|
+
- `var(--ds-color-icon-neutral)`
|
|
48
|
+
- `var(--ds-color-icon-oncolor)`
|
|
49
|
+
- `var(--ds-color-text-default)`
|
|
50
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
51
|
+
- `var(--ds-motion-feedback-duration)`
|
|
52
|
+
- `var(--ds-motion-feedback-easing)`
|
|
53
|
+
- `var(--ds-radius-full)`
|
|
54
|
+
- `var(--ds-radius-l)`
|
|
55
|
+
- `var(--ds-radius-xl)`
|
|
56
|
+
- `var(--ds-spacing-lg)`
|
|
57
|
+
- `var(--ds-spacing-md)`
|
|
58
|
+
- `var(--ds-spacing-sm)`
|
|
59
|
+
- `var(--ds-spacing-xs)`
|
|
60
|
+
- `var(--ds-spacing-xxs)`
|
|
61
|
+
|
|
62
|
+
## AI usage guidance
|
|
63
|
+
When generating UI:
|
|
64
|
+
- Install with `npx sdaia-ui@latest add prompt-suggestion` (after `npx sdaia-ui@latest init`), then import `{ PromptSuggestion }` from `@/components/ui/PromptSuggestion`.
|
|
65
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
66
|
+
- Use only the documented option values listed under "Options".
|
|
67
|
+
- 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).
|
|
68
|
+
- 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
|
+
# Prompt Template
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Prompt Template
|
|
5
|
+
- Slug: `prompt-template`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add prompt-template`
|
|
8
|
+
- Import: `import { PromptTemplate } from '@/components/ui/PromptTemplate'`
|
|
9
|
+
- Installed files: `PromptTemplate.tsx`, `PromptTemplate.types.ts`, `PromptTemplate.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/prompt-template
|
|
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 prompt-template`. It copies the source into your components folder (`components/ui/PromptTemplate/`, under `src/` when the project has one); import it as `@/components/ui/PromptTemplate`. 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 template card. - `brand` — raised surface + soft (green) category chip (default) - `neutral` — subtle surface + neutral category chip - `outline` — transparent surface + outlined category chip |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout. Omit to inherit from the closest `dir` ancestor. |
|
|
19
|
+
| `labels?` | `Partial<PromptTemplateLabels>` | — | Override any built-in string (e.g. the action button label). |
|
|
20
|
+
| `category?` | `ReactNode` | — | Category label rendered in the DS Chip. |
|
|
21
|
+
| `showChip?` | `boolean` | true | Show the category chip. |
|
|
22
|
+
| `difficulty?` | `ReactNode` | — | Difficulty label rendered in the DS Badge (gold). |
|
|
23
|
+
| `showBadge?` | `boolean` | true | Show the difficulty badge. |
|
|
24
|
+
| `owner?` | `ReactNode` | — | Owner / scope label (e.g. `Global Template`). |
|
|
25
|
+
| `ownerIcon?` | `string` | user02Stroke | Owner icon — a `@platformscode/icons` data URL. |
|
|
26
|
+
| `title` | `ReactNode` | — | Title — the template name. |
|
|
27
|
+
| `description?` | `ReactNode` | — | Short description of what the template does. |
|
|
28
|
+
| `stat?` | `ReactNode` | — | Primary stat (e.g. `Saves ~2 hrs`). |
|
|
29
|
+
| `statMeta?` | `ReactNode` | — | Secondary stat after the separator dot (e.g. `1.2k uses`). |
|
|
30
|
+
| `statIcon?` | `string` | timeHalfPassStroke | Stat icon — a `@platformscode/icons` data URL. |
|
|
31
|
+
| `showStat?` | `boolean` | true | Show the stat row. |
|
|
32
|
+
| `actionLabel?` | `ReactNode` | 'Inject Template' | Action button label. Wins over `labels.action`; pass `null` to hide the button. |
|
|
33
|
+
| `actionIcon?` | `string` | arrowRight02Stroke | Action button leading icon — a `@platformscode/icons` data URL. |
|
|
34
|
+
| `onAction?` | `MouseEventHandler<HTMLButtonElement>` | — | Click handler for the action button. |
|
|
35
|
+
| `showAction?` | `boolean` | true | Render the action button. |
|
|
36
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
37
|
+
|
|
38
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `children`.
|
|
39
|
+
|
|
40
|
+
## Options (allowed values)
|
|
41
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
42
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout. Omit to inherit from the closest `dir` ancestor.
|
|
43
|
+
|
|
44
|
+
## Accessibility
|
|
45
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
46
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
47
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
48
|
+
|
|
49
|
+
## Design tokens used
|
|
50
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
51
|
+
- `var(--ds-color-)`
|
|
52
|
+
- `var(--ds-color-bg-raised)`
|
|
53
|
+
- `var(--ds-color-bg-subtle)`
|
|
54
|
+
- `var(--ds-color-border-default)`
|
|
55
|
+
- `var(--ds-color-border-subtle)`
|
|
56
|
+
- `var(--ds-color-icon-neutral)`
|
|
57
|
+
- `var(--ds-color-text-default)`
|
|
58
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
59
|
+
- `var(--ds-radius-full)`
|
|
60
|
+
- `var(--ds-radius-l)`
|
|
61
|
+
- `var(--ds-spacing-lg)`
|
|
62
|
+
- `var(--ds-spacing-md)`
|
|
63
|
+
- `var(--ds-spacing-xs)`
|
|
64
|
+
|
|
65
|
+
## AI usage guidance
|
|
66
|
+
When generating UI:
|
|
67
|
+
- Install with `npx sdaia-ui@latest add prompt-template` (after `npx sdaia-ui@latest init`), then import `{ PromptTemplate }` from `@/components/ui/PromptTemplate`.
|
|
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,61 @@
|
|
|
1
|
+
# Prompt Variable
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Prompt Variable
|
|
5
|
+
- Slug: `prompt-variable`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add prompt-variable`
|
|
8
|
+
- Import: `import { PromptVariable } from '@/components/ui/PromptVariable'`
|
|
9
|
+
- Installed files: `PromptVariable.tsx`, `PromptVariable.types.ts`, `PromptVariable.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/prompt-variable
|
|
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 prompt-variable`. It copies the source into your components folder (`components/ui/PromptVariable/`, under `src/` when the project has one); import it as `@/components/ui/PromptVariable`. 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 variable card. - `brand` — raised surface (default) - `neutral` — subtle surface - `outline` — transparent surface |
|
|
18
|
+
| `locked?` | `boolean` | false | Locked state — the value input is read-only/disabled and the state badge + marker switch to the neutral "Locked" treatment. Mirrors the Figma `State`. |
|
|
19
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout. Omit to inherit from the closest `dir` ancestor. |
|
|
20
|
+
| `labels?` | `Partial<PromptVariableLabels>` | — | Override any built-in string (state badge text, the input's fallback name). |
|
|
21
|
+
| `label?` | `ReactNode` | — | Variable label (e.g. `Variable: Language_Target`). It also names the value input (`aria-labelledby`); without it the input is named by `labels.value`. |
|
|
22
|
+
| `showState?` | `boolean` | true | Show the state badge (Editable / Locked). |
|
|
23
|
+
| `stateLabel?` | `ReactNode` | — | Override the state badge text. Wins over `labels.editable` / `labels.locked`. |
|
|
24
|
+
| `showType?` | `boolean` | true | Show the type badge. |
|
|
25
|
+
| `type?` | `ReactNode` | — | Type badge label (e.g. `string`). |
|
|
26
|
+
| `helper?` | `ReactNode` | — | Helper text after the type badge (e.g. `Used in 3 places`). |
|
|
27
|
+
| `placeholder?` | `string` | — | Placeholder for the value input. |
|
|
28
|
+
|
|
29
|
+
Also accepts standard `<input>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `size`, `prefix`, `dir`, `type`.
|
|
30
|
+
|
|
31
|
+
## Options (allowed values)
|
|
32
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
33
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout. Omit to inherit from the closest `dir` ancestor.
|
|
34
|
+
|
|
35
|
+
## Accessibility
|
|
36
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
37
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
38
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
39
|
+
|
|
40
|
+
## Design tokens used
|
|
41
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
42
|
+
- `var(--ds-color-)`
|
|
43
|
+
- `var(--ds-color-bg-raised)`
|
|
44
|
+
- `var(--ds-color-bg-subtle)`
|
|
45
|
+
- `var(--ds-color-border-default)`
|
|
46
|
+
- `var(--ds-color-border-subtle)`
|
|
47
|
+
- `var(--ds-color-icon-neutral)`
|
|
48
|
+
- `var(--ds-color-icon-warning)`
|
|
49
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
50
|
+
- `var(--ds-radius-full)`
|
|
51
|
+
- `var(--ds-radius-l)`
|
|
52
|
+
- `var(--ds-spacing-md)`
|
|
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 prompt-variable` (after `npx sdaia-ui@latest init`), then import `{ PromptVariable }` from `@/components/ui/PromptVariable`.
|
|
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,106 @@
|
|
|
1
|
+
# Reasoning Trace
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Reasoning Trace (composite pattern — not a single component)
|
|
5
|
+
- Slug: `reasoning-trace`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add reasoning-disclosure reasoning-node thinking-step`
|
|
8
|
+
- Import: per primitive, e.g. `import { ReasoningNode } from '@/components/ui/ReasoningNode'`
|
|
9
|
+
- Docs: https://ds.nacew.com/components/reasoning-trace
|
|
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 run the composite install 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 `reasoning-trace` slug.** "Reasoning Trace" is a documentation pattern that composes three installable primitives — `ReasoningNode`, `ReasoningDisclosure`, and `ThinkingStep` — into an auditable chain of how an answer was reached.
|
|
14
|
+
|
|
15
|
+
## Description
|
|
16
|
+
A vertical, auditable chain that explains *how* an AI reached an answer: a sequence of reasoning steps, each with a lifecycle state, an optional rationale, and an expandable evidence summary. Compose `ReasoningNode` rows for the step-by-step chain, `ThinkingStep` cards for lighter "what the model is considering" notes, and a `ReasoningDisclosure` for the collapsible verified-evidence summary at the end.
|
|
17
|
+
|
|
18
|
+
## Composed components
|
|
19
|
+
|
|
20
|
+
| Component | Slug | Purpose |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `ReasoningNode` | `reasoning-node` | One step in the chain — title, rationale, and a lifecycle status pill. |
|
|
23
|
+
| `ReasoningDisclosure` | `reasoning-disclosure` | Collapsible summary box of `label → value` evidence rows. |
|
|
24
|
+
| `ThinkingStep` | `thinking-step` | Lightweight step card — title, optional trailing element, description. |
|
|
25
|
+
|
|
26
|
+
### `ReasoningNode` props
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| `variant?` | `'neutral' \| 'brand' \| 'outline'` | `'neutral'` | Visual style of the outer card. |
|
|
30
|
+
| `state?` | `'active' \| 'complete' \| 'pending'` | `'active'` | Lifecycle — sets the semantic tint (active → info, complete → success, pending → warning), status icon, and default label. |
|
|
31
|
+
| `dir?` | `'ltr' \| 'rtl'` | `'ltr'` | Layout direction (mirrors for RTL). |
|
|
32
|
+
| `icon?` | `ReactNode` | `<ReasoningHeadIcon />` | Leading glyph inside the 36px tile. |
|
|
33
|
+
| `title?` | `ReactNode` | `'Reasoning node'` | Header title (the reasoning step). |
|
|
34
|
+
| `statusLabel?` | `ReactNode` | state name | Status pill label (`Active` / `Complete` / `Pending`). |
|
|
35
|
+
| `rationale?` | `ReactNode` | — | Rationale paragraph shown in the tinted summary box. |
|
|
36
|
+
| `as?` | `ElementType` | `'div'` | Override the rendered root element. |
|
|
37
|
+
|
|
38
|
+
### `ReasoningDisclosure` props
|
|
39
|
+
| Prop | Type | Default | Description |
|
|
40
|
+
| --- | --- | --- | --- |
|
|
41
|
+
| `variant?` | `'neutral' \| 'brand' \| 'outline'` | `'neutral'` | Visual style. |
|
|
42
|
+
| `dir?` | `'ltr' \| 'rtl'` | `'ltr'` | Layout direction. |
|
|
43
|
+
| `expanded?` | `boolean` | — | Controlled expanded state. |
|
|
44
|
+
| `defaultExpanded?` | `boolean` | `false` | Initial expanded state when uncontrolled. |
|
|
45
|
+
| `onExpandedChange?` | `(expanded: boolean) => void` | — | Called when the user toggles open/closed. |
|
|
46
|
+
| `icon?` | `ReactNode` | `<ReasoningHeadIcon />` | Leading glyph inside the 36px tile. |
|
|
47
|
+
| `title?` | `ReactNode` | `'Reasoning summary'` | Header title. |
|
|
48
|
+
| `subtitle?` | `ReactNode` | `'3 verified points · auditable'` | Header subtitle. |
|
|
49
|
+
| `items?` | `ReasoningDisclosureItem[]` | — | `label → value` rows shown when expanded. |
|
|
50
|
+
| `expandLabel?` | `string` | `'Expand reasoning summary'` | Accessible label when collapsed. |
|
|
51
|
+
| `collapseLabel?` | `string` | `'Collapse reasoning summary'` | Accessible label when expanded. |
|
|
52
|
+
| `as?` | `ElementType` | `'div'` | Override the rendered root element. |
|
|
53
|
+
|
|
54
|
+
`ReasoningDisclosureItem` = `{ label: ReactNode; value: ReactNode; key?: string \| number }`.
|
|
55
|
+
|
|
56
|
+
### `ThinkingStep` props
|
|
57
|
+
| Prop | Type | Default | Description |
|
|
58
|
+
| --- | --- | --- | --- |
|
|
59
|
+
| `variant?` | `'neutral' \| 'brand' \| 'outline'` | `'neutral'` | Visual style of the card. |
|
|
60
|
+
| `dir?` | `'ltr' \| 'rtl'` | `'ltr'` | Layout direction. |
|
|
61
|
+
| `icon?` | `ReactNode` | `<ReasoningHeadIcon />` | Leading glyph inside the 40px tile. |
|
|
62
|
+
| `title?` | `ReactNode` | `'Thinking step'` | Step title (semibold). |
|
|
63
|
+
| `titleTrailing?` | `ReactNode` | — | Optional trailing element on the title row (e.g. a timestamp or badge). |
|
|
64
|
+
| `description?` | `ReactNode` | — | Supporting description line. |
|
|
65
|
+
| `as?` | `ElementType` | `'div'` | Override the rendered root element. |
|
|
66
|
+
|
|
67
|
+
All three also accept standard `<div>` HTML attributes (`className`, `style`, `aria-*`, …) except `title`.
|
|
68
|
+
|
|
69
|
+
## Options (allowed values)
|
|
70
|
+
- `ReasoningNode` `state` — `'active'` \| `'complete'` \| `'pending'`
|
|
71
|
+
- `variant` (all three) — `'neutral'` \| `'brand'` \| `'outline'`
|
|
72
|
+
|
|
73
|
+
## Usage example
|
|
74
|
+
```tsx
|
|
75
|
+
import { ReasoningNode } from '@/components/ui/ReasoningNode';
|
|
76
|
+
|
|
77
|
+
const NODES = [
|
|
78
|
+
{ state: 'complete' as const, title: 'Current rule applies', rationale: 'Supported by 3 primary sources with matching effective dates.' },
|
|
79
|
+
{ state: 'active' as const, title: 'Comparing policy applicability', rationale: 'Checking entity type, jurisdiction, effective date, and exceptions.' },
|
|
80
|
+
{ state: 'pending' as const, title: 'Amendment date needs confirmation', rationale: 'One source conflicts with the official publication timeline.' },
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
<div className="flex flex-col gap-spacing-md">
|
|
84
|
+
{NODES.map((node) => (
|
|
85
|
+
<ReasoningNode key={node.title} {...node} />
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Accessibility
|
|
91
|
+
- `ReasoningDisclosure` is a disclosure widget — keep the toggle keyboard-operable and provide `expandLabel` / `collapseLabel`.
|
|
92
|
+
- Don't rely on the status tint alone; the `statusLabel` text carries the state meaning.
|
|
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
|
+
- Surfaces/borders via `color-bg-raised`, `color-border-muted`, `brand-neutral-*`.
|
|
98
|
+
- State tints resolve from semantic `color-*` tokens by `state`; spacing/radius via `spacing-*` / `radius-*`. Never hardcode colours.
|
|
99
|
+
|
|
100
|
+
## AI usage guidance
|
|
101
|
+
When generating UI:
|
|
102
|
+
- Install the three primitives with the composite command above, then import each `{ ReasoningNode }` / `{ ReasoningDisclosure }` / `{ ThinkingStep }` from `@/components/ui/<Name>`. There is no `reasoning-trace` install slug.
|
|
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
|
+
- Build the chain from `ReasoningNode` rows (one per step) and close it with a `ReasoningDisclosure` evidence summary; use `ThinkingStep` for lighter narration. Use only the documented `state` / `variant` values.
|
|
105
|
+
- Pass any custom `icon` as a node from `@platformscode/icons` via `DgaIcon` — see `get_foundations` (`icon-usage`). Never emoji, Lucide, or random icons.
|
|
106
|
+
- Pick one theme per screen via `.theme-dark`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Source Explorer
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Source Explorer
|
|
5
|
+
- Slug: `source-explorer`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add source-explorer`
|
|
8
|
+
- Import: `import { SourceExplorer } from '@/components/ui/SourceExplorer'`
|
|
9
|
+
- Installed files: `SourceExplorer.tsx`, `SourceExplorer.types.ts`, `SourceExplorer.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/source-explorer
|
|
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 source-explorer`. It copies the source into your components folder (`components/ui/SourceExplorer/`, under `src/` when the project has one); import it as `@/components/ui/SourceExplorer`. 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
|
+
| `layout?` | `'side-panel' \| 'inline' \| 'modal'` | 'side-panel' | Layout — mirrors the Figma `Variant` property. |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout. |
|
|
19
|
+
| `labels?` | `Partial<SourceExplorerLabels>` | — | Overrides for every built-in visible or accessible string (see ). Unset keys keep the English defaults. The per-string props (`title`, `searchPlaceholder`, `primaryActionLabel`) win over the matching keys. |
|
|
20
|
+
| `title?` | `ReactNode` | 'Sources' | Header title. Wins over `labels.title`. |
|
|
21
|
+
| `headerIcon?` | `string` | globe02Stroke | Header icon (inline variant) — a `@platformscode/icons` data URL. |
|
|
22
|
+
| `count?` | `number` | — | Count shown in the header pill. |
|
|
23
|
+
| `verified?` | `boolean` | false | Show the header "Verified" badge. |
|
|
24
|
+
| `subtitle?` | `ReactNode` | — | Header subtitle (side-panel: "8 sources used · 6 verified"; modal: description). |
|
|
25
|
+
| `filters?` | `string[]` | — | Filter-tab labels (side-panel). |
|
|
26
|
+
| `activeFilter?` | `string` | — | Active filter label. |
|
|
27
|
+
| `onFilterChange?` | `(filter: string) => void` | — | Filter change handler. |
|
|
28
|
+
| `searchPlaceholder?` | `string` | 'Search sources, types, domains…' | Search placeholder (modal). Wins over `labels.searchPlaceholder`. |
|
|
29
|
+
| `sources?` | `SourceExplorerItem[]` | [] | The source rows. |
|
|
30
|
+
| `moreCount?` | `number` | — | Number of extra chips collapsed into "+N more" (inline). |
|
|
31
|
+
| `primaryActionLabel?` | `ReactNode` | 'View all sources' | Inline primary button label. Wins over `labels.viewAllSources`; pass `null` to hide the button. |
|
|
32
|
+
| `onPrimaryAction?` | `MouseEventHandler<HTMLButtonElement>` | — | Inline primary button handler. |
|
|
33
|
+
| `detail?` | `SourceExplorerDetail` | — | Featured detail panel (side-panel / modal). |
|
|
34
|
+
| `metadata?` | `SourceExplorerMetaRow[]` | — | Metadata rows (side-panel / modal). |
|
|
35
|
+
| `footerNote?` | `ReactNode` | — | Footer note (modal: "4 of 8 shown"). |
|
|
36
|
+
| `searchValue?` | `string` | — | Search field value (modal). When `onSearchChange` is set the field is editable. |
|
|
37
|
+
| `onSearchChange?` | `(value: string) => void` | — | Search field change handler (modal) — makes the search input live. |
|
|
38
|
+
| `onSelectSource?` | `(item: SourceExplorerItem) => void` | — | Select a source — makes each row clickable (and the row "view" action). |
|
|
39
|
+
| `onCopySource?` | `(item: SourceExplorerItem) => void` | — | Row "copy" action. |
|
|
40
|
+
| `rowMenu?` | `SourceMenuAction[]` | — | Row overflow-menu actions. When provided, the row "⋮" button renders the DS Dropdown menu with these items instead of the single `onMoreSource` action. |
|
|
41
|
+
| `onMoreSource?` | `(item: SourceExplorerItem) => void` | — | Row "more" action — used when `rowMenu` is not provided. |
|
|
42
|
+
| `onOpenSource?` | `MouseEventHandler<HTMLButtonElement>` | — | "Open source" action (detail panel + modal footer). |
|
|
43
|
+
| `onCopyCitation?` | `MouseEventHandler<HTMLButtonElement>` | — | "Copy citation" / "Copy citations" action (detail panel + modal footer). |
|
|
44
|
+
| `onViewMetadata?` | `MouseEventHandler<HTMLButtonElement>` | — | "View metadata" action (detail panel). |
|
|
45
|
+
| `onSort?` | `MouseEventHandler<HTMLButtonElement>` | — | Header sort icon button. |
|
|
46
|
+
| `onFilter?` | `MouseEventHandler<HTMLButtonElement>` | — | Header filter icon button. |
|
|
47
|
+
| `onClose?` | `MouseEventHandler<HTMLButtonElement>` | — | Close handler — renders the header close (×) button on side-panel / modal. |
|
|
48
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
49
|
+
|
|
50
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`, `title`, `style`.
|
|
51
|
+
|
|
52
|
+
## Options (allowed values)
|
|
53
|
+
- `layout`: `'side-panel'` \| `'inline'` \| `'modal'` — Figma `Variant` property — the three layouts (set with the `layout` prop).
|
|
54
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout.
|
|
55
|
+
|
|
56
|
+
## Deprecated props
|
|
57
|
+
Do not use in new code:
|
|
58
|
+
- `variant` — Root surface style (`neutral` / `brand` / `outline`) — mirrors the Figma
|
|
59
|
+
`Style` property.
|
|
60
|
+
- `style` — Root surface style.
|
|
61
|
+
|
|
62
|
+
## Accessibility
|
|
63
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
64
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
65
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
66
|
+
|
|
67
|
+
## Design tokens used
|
|
68
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
69
|
+
- `var(--ds-color-)`
|
|
70
|
+
- `var(--ds-color-bg-brand-subtle)`
|
|
71
|
+
- `var(--ds-color-bg-danger-strong)`
|
|
72
|
+
- `var(--ds-color-bg-danger-subtle)`
|
|
73
|
+
- `var(--ds-color-bg-default)`
|
|
74
|
+
- `var(--ds-color-bg-info-subtle)`
|
|
75
|
+
- `var(--ds-color-bg-muted)`
|
|
76
|
+
- `var(--ds-color-bg-raised)`
|
|
77
|
+
- `var(--ds-color-bg-subtle)`
|
|
78
|
+
- `var(--ds-color-bg-success-strong)`
|
|
79
|
+
- `var(--ds-color-bg-success-subtle)`
|
|
80
|
+
- `var(--ds-color-bg-warning-strong)`
|
|
81
|
+
- `var(--ds-color-bg-warning-subtle)`
|
|
82
|
+
- `var(--ds-color-border-brand)`
|
|
83
|
+
- `var(--ds-color-border-default)`
|
|
84
|
+
- `var(--ds-color-border-default-strong)`
|
|
85
|
+
- `var(--ds-color-border-subtle)`
|
|
86
|
+
- `var(--ds-color-form-field-border-default)`
|
|
87
|
+
- `var(--ds-color-icon-brand)`
|
|
88
|
+
- `var(--ds-color-icon-danger)`
|
|
89
|
+
- `var(--ds-color-icon-info)`
|
|
90
|
+
- `var(--ds-color-icon-neutral)`
|
|
91
|
+
- `var(--ds-color-icon-success)`
|
|
92
|
+
- `var(--ds-color-icon-warning)`
|
|
93
|
+
- `var(--ds-color-primitive-radius-radius-12)`
|
|
94
|
+
- `var(--ds-color-primitive-radius-radius-16)`
|
|
95
|
+
- `var(--ds-color-primitive-radius-radius-2)`
|
|
96
|
+
- `var(--ds-color-primitive-radius-radius-6)`
|
|
97
|
+
- `var(--ds-color-primitive-radius-radius-8)`
|
|
98
|
+
- `var(--ds-color-primitive-radius-radius-9999)`
|
|
99
|
+
- `var(--ds-color-text-brand)`
|
|
100
|
+
- `var(--ds-color-text-danger)`
|
|
101
|
+
- `var(--ds-color-text-default)`
|
|
102
|
+
- `var(--ds-color-text-info)`
|
|
103
|
+
- `var(--ds-color-text-paragraph)`
|
|
104
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
105
|
+
- `var(--ds-color-text-success)`
|
|
106
|
+
- `var(--ds-color-text-warning)`
|
|
107
|
+
- `var(--ds-spacing-lg)`
|
|
108
|
+
- `var(--ds-spacing-md)`
|
|
109
|
+
- …and 7 more
|
|
110
|
+
|
|
111
|
+
## AI usage guidance
|
|
112
|
+
When generating UI:
|
|
113
|
+
- Install with `npx sdaia-ui@latest add source-explorer` (after `npx sdaia-ui@latest init`), then import `{ SourceExplorer }` from `@/components/ui/SourceExplorer`.
|
|
114
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
115
|
+
- Use only the documented option values listed under "Options".
|
|
116
|
+
- 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).
|
|
117
|
+
- 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,59 @@
|
|
|
1
|
+
# Source Group
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Source Group
|
|
5
|
+
- Slug: `source-group`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add source-group`
|
|
8
|
+
- Import: `import { SourceGroup } from '@/components/ui/SourceGroup'`
|
|
9
|
+
- Installed files: `SourceGroup.tsx`, `SourceGroup.types.ts`, `SourceGroup.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/sourcegroup
|
|
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 source-group`. It copies the source into your components folder (`components/ui/SourceGroup/`, under `src/` when the project has one); import it as `@/components/ui/SourceGroup`. 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 group container. - `brand` — raised surface, default border (default) - `neutral` — subtle surface, subtle border - `outline` — transparent surface, default border |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the header and citation row. |
|
|
19
|
+
| `title` | `ReactNode` | — | Header title (e.g. `Grounding Context Logs (3 Citations)`). |
|
|
20
|
+
| `icon?` | `string` | databaseStroke | Header icon — a `@platformscode/icons` data URL rendered through `DgaIcon`. |
|
|
21
|
+
| `showIcon?` | `boolean` | true | Show the leading header icon. |
|
|
22
|
+
| `verification?` | `ReactNode` | — | Verification badge label (e.g. `Strict Verification`). The badge renders only when this is set — there is no built-in default copy. |
|
|
23
|
+
| `showVerification?` | `boolean` | true | Show the trailing verification badge (when `verification` is set). |
|
|
24
|
+
| `items` | `SourceGroupItem[]` | — | Citation rows rendered in the group body. |
|
|
25
|
+
| `autoNumber?` | `boolean` | true | Auto-number items 1..n when an item omits its own `number`. |
|
|
26
|
+
|
|
27
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`.
|
|
28
|
+
|
|
29
|
+
## Options (allowed values)
|
|
30
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the group container — mirrors the Figma `Style` property.
|
|
31
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the header and citation row.
|
|
32
|
+
|
|
33
|
+
## Accessibility
|
|
34
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
35
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
36
|
+
|
|
37
|
+
## Design tokens used
|
|
38
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
39
|
+
- `var(--ds-color-bg-default)`
|
|
40
|
+
- `var(--ds-color-bg-raised)`
|
|
41
|
+
- `var(--ds-color-bg-subtle)`
|
|
42
|
+
- `var(--ds-color-border-default)`
|
|
43
|
+
- `var(--ds-color-border-default-strong)`
|
|
44
|
+
- `var(--ds-color-border-subtle)`
|
|
45
|
+
- `var(--ds-color-icon-default)`
|
|
46
|
+
- `var(--ds-color-text-default)`
|
|
47
|
+
- `var(--ds-radius-l)`
|
|
48
|
+
- `var(--ds-spacing-lg)`
|
|
49
|
+
- `var(--ds-spacing-md)`
|
|
50
|
+
- `var(--ds-spacing-sm)`
|
|
51
|
+
- `var(--ds-spacing-xs)`
|
|
52
|
+
|
|
53
|
+
## AI usage guidance
|
|
54
|
+
When generating UI:
|
|
55
|
+
- Install with `npx sdaia-ui@latest add source-group` (after `npx sdaia-ui@latest init`), then import `{ SourceGroup }` from `@/components/ui/SourceGroup`.
|
|
56
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
57
|
+
- Use only the documented option values listed under "Options".
|
|
58
|
+
- 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).
|
|
59
|
+
- 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,70 @@
|
|
|
1
|
+
# Source Reference
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Source Reference
|
|
5
|
+
- Slug: `source-reference`
|
|
6
|
+
- Category: AI
|
|
7
|
+
- Install: `npx sdaia-ui@latest add source-reference`
|
|
8
|
+
- Import: `import { SourceReference } from '@/components/ui/SourceReference'`
|
|
9
|
+
- Installed files: `SourceReference.tsx`, `SourceReference.types.ts`, `SourceReference.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/source-reference
|
|
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 source-reference`. It copies the source into your components folder (`components/ui/SourceReference/`, under `src/` when the project has one); import it as `@/components/ui/SourceReference`. 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 source card. - `brand` — raised surface + transparent (subtle) leading button (default) - `neutral` — subtle surface + solid black leading button - `outline` — transparent surface + outlined leading button |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. `rtl` mirrors the layout. |
|
|
19
|
+
| `title` | `ReactNode` | — | Source title — the linked document/page name. |
|
|
20
|
+
| `url?` | `ReactNode` | — | Source URL shown under the title. |
|
|
21
|
+
| `showUrl?` | `boolean` | true | Show the URL line. |
|
|
22
|
+
| `icon?` | `string` | tick02Stroke | Leading icon-only button glyph — a `@platformscode/icons` data URL. |
|
|
23
|
+
| `showButton?` | `boolean` | true | Show the leading icon-only button. |
|
|
24
|
+
| `onButtonClick?` | `MouseEventHandler<HTMLButtonElement>` | — | Click handler for the leading icon-only button. |
|
|
25
|
+
| `buttonLabel?` | `string` | 'Cited source' | Accessible label for the leading icon-only button. Wins over `labels.button`. |
|
|
26
|
+
| `selectable?` | `boolean` | true | Whether the leading button is a selection toggle (filled when selected, outlined when not). On by default so a source can be selected/unselected. Set `false` for a purely decorative "cited" indicator styled by `variant`. |
|
|
27
|
+
| `selected?` | `boolean` | — | Controlled selected state of the leading toggle. When set, the component is controlled — drive it with `onSelectedChange`. Sources can be selected and unselected independently. |
|
|
28
|
+
| `defaultSelected?` | `boolean` | false | Uncontrolled initial selected state (ignored when `selected` is set). |
|
|
29
|
+
| `onSelectedChange?` | `(selected: boolean) => void` | — | Fired with the next value whenever the user toggles the leading selection control. |
|
|
30
|
+
| `openIcon?` | `string` | linkSquare02Stroke | Trailing "open" affordance glyph — a `@platformscode/icons` data URL. |
|
|
31
|
+
| `showOpen?` | `boolean` | true | Show the trailing "open" affordance. |
|
|
32
|
+
| `href?` | `string` | — | When set, the "open" affordance becomes a link to the source. |
|
|
33
|
+
| `target?` | `HTMLAttributeAnchorTarget` | '_blank' | Anchor target when `href` is set. |
|
|
34
|
+
| `rel?` | `string` | 'noopener noreferrer' for `_blank` | Anchor rel when `href` is set. |
|
|
35
|
+
| `onOpen?` | `MouseEventHandler<HTMLAnchorElement \| HTMLButtonElement>` | — | Click handler for the "open" affordance (used when there is no `href`). |
|
|
36
|
+
| `openLabel?` | `string` | 'Open source' | Accessible label for the "open" affordance. Wins over `labels.open`. |
|
|
37
|
+
| `labels?` | `Partial<SourceReferenceLabels>` | — | Overrides for every built-in accessible string (see ). Unset keys keep the English defaults. |
|
|
38
|
+
| `as?` | `ElementType` | 'div' | Override the rendered root element. |
|
|
39
|
+
|
|
40
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `children`.
|
|
41
|
+
|
|
42
|
+
## Options (allowed values)
|
|
43
|
+
- `variant`: `'brand'` \| `'neutral'` \| `'outline'` — Visual style of the card — mirrors the Figma `Style` property.
|
|
44
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction. `rtl` mirrors the layout.
|
|
45
|
+
|
|
46
|
+
## Accessibility
|
|
47
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
48
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
49
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
50
|
+
|
|
51
|
+
## Design tokens used
|
|
52
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
53
|
+
- `var(--ds-color-bg-raised)`
|
|
54
|
+
- `var(--ds-color-bg-subtle)`
|
|
55
|
+
- `var(--ds-color-border-default)`
|
|
56
|
+
- `var(--ds-color-border-subtle)`
|
|
57
|
+
- `var(--ds-color-icon-neutral)`
|
|
58
|
+
- `var(--ds-color-text-default)`
|
|
59
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
60
|
+
- `var(--ds-radius-l)`
|
|
61
|
+
- `var(--ds-spacing-md)`
|
|
62
|
+
- `var(--ds-spacing-sm)`
|
|
63
|
+
|
|
64
|
+
## AI usage guidance
|
|
65
|
+
When generating UI:
|
|
66
|
+
- Install with `npx sdaia-ui@latest add source-reference` (after `npx sdaia-ui@latest init`), then import `{ SourceReference }` from `@/components/ui/SourceReference`.
|
|
67
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
68
|
+
- Use only the documented option values listed under "Options".
|
|
69
|
+
- 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).
|
|
70
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|