@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.
Files changed (151) hide show
  1. package/README.md +212 -2
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +291 -0
  4. package/dist/index.js.map +1 -0
  5. package/knowledge/actions/breadcrumb.md +50 -0
  6. package/knowledge/actions/button-menu.md +82 -0
  7. package/knowledge/actions/button-split.md +69 -0
  8. package/knowledge/actions/button.md +101 -0
  9. package/knowledge/actions/content-switcher.md +66 -0
  10. package/knowledge/actions/date-picker.md +115 -0
  11. package/knowledge/actions/floating-button.md +100 -0
  12. package/knowledge/actions/horizontal-tabs.md +52 -0
  13. package/knowledge/actions/link.md +76 -0
  14. package/knowledge/actions/modal.md +103 -0
  15. package/knowledge/actions/pagination.md +69 -0
  16. package/knowledge/actions/radio-button.md +88 -0
  17. package/knowledge/actions/switch.md +87 -0
  18. package/knowledge/actions/tag.md +69 -0
  19. package/knowledge/ai/agent-activity.md +65 -0
  20. package/knowledge/ai/agent-card.md +65 -0
  21. package/knowledge/ai/agent-handoff.md +65 -0
  22. package/knowledge/ai/ai-citation.md +78 -0
  23. package/knowledge/ai/ai-code-block.md +86 -0
  24. package/knowledge/ai/ai-disclaimer.md +84 -0
  25. package/knowledge/ai/ai-message-bubble.md +81 -0
  26. package/knowledge/ai/ai-message.md +118 -0
  27. package/knowledge/ai/ai-prompt-input.md +93 -0
  28. package/knowledge/ai/ai-states.md +107 -0
  29. package/knowledge/ai/ai-status-indicator.md +81 -0
  30. package/knowledge/ai/ai-suggested-prompts.md +62 -0
  31. package/knowledge/ai/ai-thinking-indicator.md +94 -0
  32. package/knowledge/ai/artifact-viewer.md +105 -0
  33. package/knowledge/ai/citation.md +61 -0
  34. package/knowledge/ai/context-manager.md +111 -0
  35. package/knowledge/ai/prompt-context.md +72 -0
  36. package/knowledge/ai/prompt-suggestion.md +68 -0
  37. package/knowledge/ai/prompt-template.md +71 -0
  38. package/knowledge/ai/prompt-variable.md +61 -0
  39. package/knowledge/ai/reasoning-trace.md +106 -0
  40. package/knowledge/ai/source-explorer.md +117 -0
  41. package/knowledge/ai/source-group.md +59 -0
  42. package/knowledge/ai/source-reference.md +70 -0
  43. package/knowledge/ai/thinking-panel.md +77 -0
  44. package/knowledge/ai/tool-activity-feed.md +67 -0
  45. package/knowledge/ai/tool-call-card.md +66 -0
  46. package/knowledge/ai/tool-status-row.md +72 -0
  47. package/knowledge/ai/tool-timeline-item.md +71 -0
  48. package/knowledge/ai/voice-session.md +93 -0
  49. package/knowledge/feedback/alert.md +106 -0
  50. package/knowledge/feedback/badge.md +86 -0
  51. package/knowledge/feedback/card.md +54 -0
  52. package/knowledge/feedback/feedback-overview.md +37 -0
  53. package/knowledge/feedback/feedback.md +46 -0
  54. package/knowledge/feedback/help-icon.md +57 -0
  55. package/knowledge/feedback/loading-indicator.md +76 -0
  56. package/knowledge/feedback/notification-banner.md +73 -0
  57. package/knowledge/feedback/notification-popup.md +87 -0
  58. package/knowledge/feedback/notifications.md +158 -0
  59. package/knowledge/feedback/progress-bar.md +69 -0
  60. package/knowledge/feedback/rating-overview.md +58 -0
  61. package/knowledge/feedback/rating.md +64 -0
  62. package/knowledge/feedback/skeleton-avatar.md +48 -0
  63. package/knowledge/feedback/skeleton.md +53 -0
  64. package/knowledge/feedback/toast.md +74 -0
  65. package/knowledge/feedback/tooltip.md +72 -0
  66. package/knowledge/form/autocomplete.md +100 -0
  67. package/knowledge/form/checkbox.md +95 -0
  68. package/knowledge/form/date-time-field.md +63 -0
  69. package/knowledge/form/error-summary.md +56 -0
  70. package/knowledge/form/field-group.md +57 -0
  71. package/knowledge/form/file-uploader.md +60 -0
  72. package/knowledge/form/form-section.md +58 -0
  73. package/knowledge/form/number-input.md +92 -0
  74. package/knowledge/form/otp-input.md +83 -0
  75. package/knowledge/form/password-input.md +49 -0
  76. package/knowledge/form/range-slider.md +71 -0
  77. package/knowledge/form/rich-text-editor.md +106 -0
  78. package/knowledge/form/select.md +113 -0
  79. package/knowledge/form/signature.md +83 -0
  80. package/knowledge/form/slider.md +66 -0
  81. package/knowledge/form/text-area.md +90 -0
  82. package/knowledge/form/text-input.md +132 -0
  83. package/knowledge/form/time-input.md +44 -0
  84. package/knowledge/form/time-picker.md +73 -0
  85. package/knowledge/foundations/accessibility.md +97 -0
  86. package/knowledge/foundations/colors.md +1113 -0
  87. package/knowledge/foundations/figma.md +30 -0
  88. package/knowledge/foundations/icon-usage.md +114 -0
  89. package/knowledge/foundations/icons.md +16 -0
  90. package/knowledge/foundations/motion.md +39 -0
  91. package/knowledge/foundations/radius.md +17 -0
  92. package/knowledge/foundations/responsive.md +64 -0
  93. package/knowledge/foundations/rtl.md +106 -0
  94. package/knowledge/foundations/spacing.md +27 -0
  95. package/knowledge/foundations/theme.md +115 -0
  96. package/knowledge/foundations/tokens.json +12080 -0
  97. package/knowledge/foundations/typography.md +45 -0
  98. package/knowledge/general/accordion.md +79 -0
  99. package/knowledge/general/activity.md +44 -0
  100. package/knowledge/general/app-shell.md +64 -0
  101. package/knowledge/general/area-chart.md +89 -0
  102. package/knowledge/general/audio-player.md +85 -0
  103. package/knowledge/general/avatar-group.md +50 -0
  104. package/knowledge/general/avatar.md +61 -0
  105. package/knowledge/general/carousel-image.md +103 -0
  106. package/knowledge/general/chart.md +25 -0
  107. package/knowledge/general/chip.md +90 -0
  108. package/knowledge/general/code-snippet.md +80 -0
  109. package/knowledge/general/column-chart.md +84 -0
  110. package/knowledge/general/context-menu.md +55 -0
  111. package/knowledge/general/digital-stamp.md +77 -0
  112. package/knowledge/general/divider.md +65 -0
  113. package/knowledge/general/donut-chart.md +75 -0
  114. package/knowledge/general/draggable-list.md +43 -0
  115. package/knowledge/general/dropdown.md +90 -0
  116. package/knowledge/general/empty-state.md +60 -0
  117. package/knowledge/general/filtration.md +85 -0
  118. package/knowledge/general/footer.md +59 -0
  119. package/knowledge/general/line-chart.md +95 -0
  120. package/knowledge/general/list.md +91 -0
  121. package/knowledge/general/media-gallery.md +85 -0
  122. package/knowledge/general/media-viewer.md +78 -0
  123. package/knowledge/general/menu.md +66 -0
  124. package/knowledge/general/metric.md +92 -0
  125. package/knowledge/general/nav-bar.md +62 -0
  126. package/knowledge/general/nav-header.md +125 -0
  127. package/knowledge/general/number.md +72 -0
  128. package/knowledge/general/page-template.md +80 -0
  129. package/knowledge/general/pdf-viewer.md +91 -0
  130. package/knowledge/general/pie-chart-panel.md +86 -0
  131. package/knowledge/general/popover.md +115 -0
  132. package/knowledge/general/progress-circle.md +63 -0
  133. package/knowledge/general/quote.md +64 -0
  134. package/knowledge/general/radial-stepper.md +72 -0
  135. package/knowledge/general/scatter-chart.md +62 -0
  136. package/knowledge/general/second-nav-header.md +55 -0
  137. package/knowledge/general/slideout-menu.md +92 -0
  138. package/knowledge/general/stepper.md +42 -0
  139. package/knowledge/general/structured-list.md +52 -0
  140. package/knowledge/general/table-bulk-actions-bar.md +66 -0
  141. package/knowledge/general/table-of-content.md +49 -0
  142. package/knowledge/general/table.md +113 -0
  143. package/knowledge/general/tree-view.md +55 -0
  144. package/knowledge/general/vertical-tabs.md +48 -0
  145. package/knowledge/general/video-player.md +88 -0
  146. package/knowledge/manifest.json +919 -0
  147. package/knowledge/patterns/buttons-with-sdaia-touch.md +34 -0
  148. package/knowledge/patterns/sdaia-logo-animation.md +35 -0
  149. package/knowledge/patterns/switch-with-sdaia-touch.md +29 -0
  150. package/knowledge/setup.md +125 -0
  151. package/package.json +45 -4
@@ -0,0 +1,25 @@
1
+ # Chart
2
+
3
+ ## Metadata
4
+ - Component: Chart
5
+ - Slug: `chart`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add chart`
8
+ - Import: `import { Chart } from '@/components/ui/Chart'`
9
+ - Installed files: `Chart.tsx`, `Chart.types.ts`, `Chart.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/chart
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 chart`. It copies the source into your components folder (`components/ui/Chart/`, under `src/` when the project has one); import it as `@/components/ui/Chart`. 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
+ This component takes no documented props beyond standard HTML attributes.
16
+
17
+ ## Accessibility
18
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
19
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
20
+
21
+ ## AI usage guidance
22
+ When generating UI:
23
+ - Install with `npx sdaia-ui@latest add chart` (after `npx sdaia-ui@latest init`), then import `{ Chart }` from `@/components/ui/Chart`.
24
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
25
+ - 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,90 @@
1
+ # Chip
2
+
3
+ ## Metadata
4
+ - Component: Chip
5
+ - Slug: `chip`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add chip`
8
+ - Import: `import { Chip } from '@/components/ui/Chip'`
9
+ - Installed files: `Chip.tsx`, `Chip.types.ts`, `Chip.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/chip
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 chip`. It copies the source into your components folder (`components/ui/Chip/`, under `src/` when the project has one); import it as `@/components/ui/Chip`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
13
+
14
+ ## Props
15
+ | Prop | Type | Default | Description |
16
+ | --- | --- | --- | --- |
17
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the chip. Leave unset to inherit it from an ancestor (`dir="rtl"` on any parent mirrors the leading / trailing slots). |
18
+ | `variant?` | `'soft' \| 'solid' \| 'neutral' \| 'outline'` | 'soft' | Visual style of the chip |
19
+ | `size?` | `'sm' \| 'md' \| 'lg'` | 'md' | Size of the chip |
20
+ | `rounded?` | `boolean` | true | Pill-shaped (fully rounded) when true. When false, uses a size-based radius (lg → 8px, md/sm → 6px). |
21
+ | `disabled?` | `boolean` | false | Disables the chip and prevents interaction |
22
+ | `selected?` | `boolean` | false | Marks the chip as selected (toggled on) |
23
+ | `leadingIcon?` | `ReactNode` | — | Icon or node displayed before the label (direction-aware, auto-flips in RTL). |
24
+ | `trailingIcon?` | `ReactNode` | — | Icon or node displayed after the label (direction-aware, auto-flips in RTL). Pair with `onTrailingIconClick` to make it an independent clickable action, e.g. an "×" dismiss button that removes the chip from a filter list without toggling the chip's own selected state. |
25
+ | `onLeadingIconClick?` | `(e: MouseEvent<HTMLSpanElement> \| KeyboardEvent<HTMLSpanElement>) => void` | — | Called when the leading icon area is clicked or activated via keyboard. When provided, the leading icon slot renders as a `role="button"` span with its own focus ring and Enter/Space activation, and the chip root renders as a non-interactive `<span>` (unless `as` is set) so controls are never nested. The event is stopped from propagating to the chip's `onClick`. |
26
+ | `onTrailingIconClick?` | `(e: MouseEvent<HTMLSpanElement> \| KeyboardEvent<HTMLSpanElement>) => void` | — | Called when the trailing icon area is clicked or activated via keyboard. When provided, the trailing icon slot renders as a `role="button"` span with its own focus ring and Enter/Space activation, and the chip root renders as a non-interactive `<span>` (unless `as` is set) so controls are never nested. The event is stopped from propagating to the chip's `onClick`. Common use-case: an "×" icon that removes the chip from a filter list without toggling the chip's selected state. |
27
+ | `trailingIconLabel?` | `string` | — | Accessible label for the trailing icon `role="button"` span, e.g. `Remove ${label}`. Only relevant when `onTrailingIconClick` is provided. Wins over `labels.remove`. |
28
+ | `leadingIconLabel?` | `string` | — | Accessible label for the leading icon `role="button"` span. Only relevant when `onLeadingIconClick` is provided. |
29
+ | `labels?` | `Partial<ChipLabels>` | — | Localised built-in strings. |
30
+ | `avatar?` | `boolean` | false | When `true`, renders a circular avatar image in the leading slot. `leadingIcon` is ignored when `avatar` is `true`. Figma: Avatar property on Chip (node 4113:9553) |
31
+ | `avatarSrc?` | `string` | the default `SaudiAvatar` from sdaia-assets | Image URL/path for the avatar. Only used when `avatar={true}`. |
32
+ | `as?` | `ElementType` | 'button', or 'span' when an icon slot is clickable | Override the rendered HTML element. |
33
+ | `children?` | `ReactNode` | — | — |
34
+
35
+ Also accepts standard `<button>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
36
+
37
+ ## Options (allowed values)
38
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction of the chip. Leave unset to inherit it from an ancestor
39
+ (`dir="rtl"` on any parent mirrors the leading / trailing slots).
40
+ - `variant`: `'soft'` \| `'solid'` \| `'neutral'` \| `'outline'` — Visual style of the chip
41
+ - `size`: `'sm'` \| `'md'` \| `'lg'` — Size of the chip
42
+
43
+ ## Accessibility
44
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
45
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
46
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
47
+
48
+ ## Design tokens used
49
+ Keep these consistent (resolve values with `get_tokens`):
50
+ - `var(--ds-color-)`
51
+ - `var(--ds-color-bg-default)`
52
+ - `var(--ds-color-bg-disabled)`
53
+ - `var(--ds-color-bg-disabled-brand)`
54
+ - `var(--ds-color-bg-emphasis-high)`
55
+ - `var(--ds-color-bg-emphasis-low)`
56
+ - `var(--ds-color-border-brand)`
57
+ - `var(--ds-color-border-default)`
58
+ - `var(--ds-color-border-focus)`
59
+ - `var(--ds-color-chip-bg-neutral-default)`
60
+ - `var(--ds-color-chip-bg-neutral-hovered)`
61
+ - `var(--ds-color-chip-bg-neutral-selected)`
62
+ - `var(--ds-color-text-default)`
63
+ - `var(--ds-color-text-disabled)`
64
+ - `var(--ds-color-text-on-color)`
65
+ - `var(--ds-motion-feedback-duration)`
66
+ - `var(--ds-motion-feedback-easing)`
67
+ - `var(--ds-radius-full)`
68
+ - `var(--ds-radius-xs)`
69
+ - `var(--ds-spacing-lg)`
70
+ - `var(--ds-spacing-xs)`
71
+ - `var(--ds-themes-chip-)`
72
+ - `var(--ds-themes-chip-chip-bg-neutral-pressed)`
73
+ - `var(--ds-themes-chip-chip-bg-soft-default)`
74
+ - `var(--ds-themes-chip-chip-bg-soft-hovered)`
75
+ - `var(--ds-themes-chip-chip-bg-soft-pressed)`
76
+ - `var(--ds-themes-chip-chip-bg-soft-selected)`
77
+ - `var(--ds-themes-chip-chip-bg-solid-default)`
78
+ - `var(--ds-themes-chip-chip-bg-solid-hovered)`
79
+ - `var(--ds-themes-chip-chip-bg-solid-pressed)`
80
+ - `var(--ds-themes-chip-chip-bg-solid-selected)`
81
+ - `var(--ds-themes-chip-chip-text-soft)`
82
+
83
+ ## AI usage guidance
84
+ When generating UI:
85
+ - Install with `npx sdaia-ui@latest add chip` (after `npx sdaia-ui@latest init`), then import `{ Chip }` from `@/components/ui/Chip`.
86
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
87
+ - Use only the documented option values listed under "Options".
88
+ - 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).
89
+ - Express the disabled state with the `disabled` prop, not custom styling.
90
+ - 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,80 @@
1
+ # Code Snippet
2
+
3
+ ## Metadata
4
+ - Component: Code Snippet
5
+ - Slug: `code-snippet`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add code-snippet`
8
+ - Import: `import { CodeSnippet } from '@/components/ui/CodeSnippet'`
9
+ - Installed files: `CodeSnippet.tsx`, `CodeSnippet.types.ts`, `CodeSnippet.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/code-snippet
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 code-snippet`. It copies the source into your components folder (`components/ui/CodeSnippet/`, under `src/` when the project has one); import it as `@/components/ui/CodeSnippet`. 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` | `'multi-line-with-tabs' \| 'multi-line-without-tabs' \| 'single-line'` | — | Structural layout / Figma variant. |
18
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the chrome (tabs / file header). The code body and the single-line command always render LTR. Unset inherits from the document. |
19
+ | `labels?` | `Partial<CodeSnippetLabels>` | — | Localised built-in strings. |
20
+ | `showHeader?` | `boolean` | true for multi-line variants; no effect for single-line. | When true, shows the top region (tabs or file header for multi-line). |
21
+ | `showLineNumbers?` | `boolean` | true for multi-line variants; no effect for single-line. | Line-number column for multi-line bodies. |
22
+ | `codeBodyMinHeight?` | `string` | — | Tailwind classes for the **multi-line code body row** minimum height (below the header). Merged after the default (~384px). Ignored for `single-line`. |
23
+ | `copyText?` | `string` | — | Clipboard payload when the copy control is used. |
24
+ | `onCopy?` | `() => void \| Promise<void>` | — | Invoked when the copy control is activated after a successful `writeText`, or by itself if `copyText` is empty (handle clipboard yourself). |
25
+ | `showMoreButton?` | `boolean` | true | Renders the secondary "Show more" control under multi-line code. |
26
+ | `onShowMore?` | `() => void` | — | Called when "Show more" is pressed. |
27
+ | `showCopyButton?` | `boolean` | true | Renders the primary copy control. |
28
+
29
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`, `dir`, `onCopy`.
30
+
31
+ ## Options (allowed values)
32
+ - `variant`: `'multi-line-with-tabs'` \| `'multi-line-without-tabs'` \| `'single-line'` — Structural layout from Figma "Code Snippet":
33
+ - `multi-line-with-tabs` — underline `Tabs` + line gutter + body
34
+ - `multi-line-without-tabs` — file header row + same body
35
+ - `single-line` — compact command row (label + command + copy)
36
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction of the chrome (tabs / file header). The code body and the single-line
37
+ command always render LTR. Unset inherits from the document.
38
+
39
+ ## Deprecated props
40
+ Do not use in new code:
41
+ - `showMoreLabel` — Label of the collapsed-code toggle. Wins over `labels.showMore`.
42
+
43
+ ## Accessibility
44
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
45
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
46
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
47
+
48
+ ## Design tokens used
49
+ Keep these consistent (resolve values with `get_tokens`):
50
+ - `var(--ds-color-)`
51
+ - `var(--ds-color-bg-default)`
52
+ - `var(--ds-color-bg-muted)`
53
+ - `var(--ds-color-border-brand)`
54
+ - `var(--ds-color-border-default)`
55
+ - `var(--ds-color-icon-default)`
56
+ - `var(--ds-color-text-brand)`
57
+ - `var(--ds-color-text-default)`
58
+ - `var(--ds-color-text-paragraph)`
59
+ - `var(--ds-color-text-paragraph-muted)`
60
+ - `var(--ds-color-text-warning)`
61
+ - `var(--ds-color-tooltip-bg-on-light)`
62
+ - `var(--ds-color-tooltip-text-heading-on-light)`
63
+ - `var(--ds-motion-feedback-duration)`
64
+ - `var(--ds-motion-feedback-easing)`
65
+ - `var(--ds-radius-full)`
66
+ - `var(--ds-radius-l)`
67
+ - `var(--ds-radius-xs)`
68
+ - `var(--ds-spacing-2xl)`
69
+ - `var(--ds-spacing-3xl)`
70
+ - `var(--ds-spacing-lg)`
71
+ - `var(--ds-spacing-md)`
72
+ - `var(--ds-spacing-xl)`
73
+ - `var(--ds-spacing-xs)`
74
+
75
+ ## AI usage guidance
76
+ When generating UI:
77
+ - Install with `npx sdaia-ui@latest add code-snippet` (after `npx sdaia-ui@latest init`), then import `{ CodeSnippet }` from `@/components/ui/CodeSnippet`.
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
+ - 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,84 @@
1
+ # Column Chart
2
+
3
+ ## Metadata
4
+ - Component: Column Chart
5
+ - Slug: `column-chart`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add column-chart`
8
+ - Import: `import { ColumnChart } from '@/components/ui/ColumnChart'`
9
+ - Installed files: `ColumnChart.tsx`, `ColumnChart.types.ts`, `ColumnChart.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/column-chart
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 column-chart`. It copies the source into your components folder (`components/ui/ColumnChart/`, under `src/` when the project has one); import it as `@/components/ui/ColumnChart`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
13
+
14
+ ## Props
15
+ | Prop | Type | Default | Description |
16
+ | --- | --- | --- | --- |
17
+ | `type?` | `'Insight' \| 'Score' \| 'TrendMatrix' \| 'ValuePanel' \| 'InsightGrid' \| 'GaugeChart' \| 'PulseBox' \| 'MetricCell' \| 'DataCluster' \| 'ProgressMeter' \| 'Forecast' \| 'ScorePod' \| 'IndexTile'` | 'Insight' | Which variant layout to render. |
18
+ | `dir?` | `'ltr' \| 'rtl'` | — | Direction of the root. When omitted the chart inherits the page direction. In RTL the axes mirror: the first category is on the right, the Y axis sits on the right and bars read right-to-left. |
19
+ | `locale?` | `string` | 'en' | BCP 47 locale used to format numbers (derived Y-axis ticks, tooltip and data-table values), e.g. `'ar-SA'`. |
20
+ | `labels?` | `Partial<ColumnChartLabels>` | — | Overrides for the built-in strings (English defaults). |
21
+ | `title?` | `string` | — | Main card title (Insight, Score, DataCluster, IndexTile). Not rendered when omitted. |
22
+ | `note?` | `string` | — | Subtitle / note (Insight, Forecast). Not rendered when omitted. |
23
+ | `dateBadge?` | `string` | — | Date range text shown in the header badge (Insight, DataCluster). Not rendered when omitted. |
24
+ | `label?` | `string` | — | Indicator label. Not rendered when omitted. |
25
+ | `value?` | `string` | — | Metric value string (e.g. `'422.61'`). Not rendered when omitted. |
26
+ | `badge?` | `{ type?: 'increase' \| 'decrease'; value?: string }` | — | ChartBadge config for the primary metric. Not rendered without `value`. |
27
+ | `label2?` | `string` | — | — |
28
+ | `value2?` | `string` | — | — |
29
+ | `badge2?` | `{ type?: 'increase' \| 'decrease'; value?: string }` | — | — |
30
+ | `data?` | `ColumnChartDataPoint[]` | — | Indicator 1 / green series. Values are percentages 0–100 (or absolute, scaled by maxValue). When missing or empty the chart shows the `labels.noData` state. |
31
+ | `data2?` | `ColumnChartDataPoint[]` | — | Indicator 2 / lavender series (Score, InsightGrid, MetricCell, ProgressMeter, ScorePod). |
32
+ | `maxValue?` | `number` | DEFAULT_MAX_VALUE | Maximum Y value used to compute bar heights in full-chart modes. |
33
+ | `xLabels?` | `string[]` | — | X-axis (category) labels. The X axis is not rendered when omitted. |
34
+ | `yLabels?` | `string[]` | — | Y-axis labels listed top→bottom. When omitted, six evenly spaced ticks from `maxValue` to 0 are derived and formatted with `locale`. |
35
+ | `tabs?` | `ColumnChartTab[]` | — | Score tabs. Not rendered when omitted. |
36
+ | `defaultTab?` | `string` | — | — |
37
+ | `onTabChange?` | `(value: string) => void` | — | — |
38
+ | `legend?` | `ColumnChartLegendItem[]` | — | Score legend. Not rendered when omitted. |
39
+ | `metrics?` | `ColumnChartMetric[]` | — | Two metrics for Score, ProgressMeter, ScorePod, IndexTile (bottom rows), MetricCell. |
40
+ | `onActionClick?` | `() => void` | — | — |
41
+ | `actionLabel?` | `string` | — | Bottom indicator label for Forecast (falls back to `label`). |
42
+
43
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
44
+
45
+ ## Options (allowed values)
46
+ - `type`: `'Insight'` \| `'Score'` \| `'TrendMatrix'` \| `'ValuePanel'` \| `'InsightGrid'` \| `'GaugeChart'` \| `'PulseBox'` \| `'MetricCell'` \| `'DataCluster'` \| `'ProgressMeter'` \| `'Forecast'` \| `'ScorePod'` \| `'IndexTile'` — Which variant layout to render.
47
+ - `dir`: `'ltr'` \| `'rtl'` — Direction of the root. When omitted the chart inherits the page direction.
48
+ In RTL the axes mirror: the first category is on the right, the Y axis
49
+ sits on the right and bars read right-to-left.
50
+
51
+ ## Accessibility
52
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
53
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
54
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
55
+
56
+ ## Design tokens used
57
+ Keep these consistent (resolve values with `get_tokens`):
58
+ - `var(--ds-color-bg-raised)`
59
+ - `var(--ds-color-border-brand)`
60
+ - `var(--ds-color-border-default)`
61
+ - `var(--ds-color-button-bg-neutral-default)`
62
+ - `var(--ds-color-button-bg-neutral-hovered)`
63
+ - `var(--ds-color-button-bg-neutral-pressed)`
64
+ - `var(--ds-color-chart-series-1)`
65
+ - `var(--ds-color-chart-series-2)`
66
+ - `var(--ds-color-chip-bg-neutral-default)`
67
+ - `var(--ds-color-icon-default)`
68
+ - `var(--ds-color-icon-default-500)`
69
+ - `var(--ds-color-text-default)`
70
+ - `var(--ds-color-text-paragraph)`
71
+ - `var(--ds-radius-full)`
72
+ - `var(--ds-radius-m)`
73
+ - `var(--ds-spacing-lg)`
74
+ - `var(--ds-spacing-md)`
75
+ - `var(--ds-spacing-sm)`
76
+ - `var(--ds-spacing-xl)`
77
+ - `var(--ds-spacing-xs)`
78
+
79
+ ## AI usage guidance
80
+ When generating UI:
81
+ - Install with `npx sdaia-ui@latest add column-chart` (after `npx sdaia-ui@latest init`), then import `{ ColumnChart }` from `@/components/ui/ColumnChart`.
82
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
83
+ - Use only the documented option values listed under "Options".
84
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,55 @@
1
+ # Context Menu
2
+
3
+ ## Metadata
4
+ - Component: Context Menu
5
+ - Slug: `context-menu`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add context-menu`
8
+ - Import: `import { ContextMenu } from '@/components/ui/ContextMenu'`
9
+ - Installed files: `ContextMenu.tsx`, `ContextMenu.types.ts`, `ContextMenu.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/context-menu
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-menu`. It copies the source into your components folder (`components/ui/ContextMenu/`, under `src/` when the project has one); import it as `@/components/ui/ContextMenu`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
13
+
14
+ ## Props
15
+ | Prop | Type | Default | Description |
16
+ | --- | --- | --- | --- |
17
+ | `dir?` | `'ltr' \| 'rtl'` | — | Layout direction — applied to the root element. Inherits from the page when omitted. |
18
+ | `items?` | `ContextMenuItem[]` | [] | Ordered list of items and dividers to display in the panel. Figma default: 8 `ContextMenuDropdown` rows with 2 dividers interspersed. |
19
+ | `surface?` | `'solid' \| 'glass'` | 'solid' | Surface treatment — `'solid'` (default) or `'glass'` (translucent liquid-glass material). |
20
+ | `className?` | `string` | — | Additional class names on the root panel wrapper |
21
+
22
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`.
23
+
24
+ ## Options (allowed values)
25
+ - `dir`: `'ltr'` \| `'rtl'` — Layout direction — applied to the root element. Inherits from the page when omitted.
26
+ - `surface`: `'solid'` \| `'glass'` — Surface treatment of the menu panel.
27
+ - `'solid'` (default) — opaque card with the standard drop shadow.
28
+ - `'glass'` — translucent liquid-glass material (blurred backdrop +
29
+ beveled edge highlight). Reads best placed over imagery or color.
30
+
31
+ The visual is provided by the shared `.glass-surface` utility, so it is
32
+ theme-aware (light / dark) and identical across every component that
33
+ exposes a `surface` prop.
34
+
35
+ ## Deprecated props
36
+ Do not use in new code:
37
+ - `rtl`
38
+
39
+ ## Accessibility
40
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
41
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
42
+
43
+ ## Design tokens used
44
+ Keep these consistent (resolve values with `get_tokens`):
45
+ - `var(--ds-color-bg-raised)`
46
+ - `var(--ds-color-border-muted)`
47
+ - `var(--ds-radius-m)`
48
+ - `var(--ds-spacing-xs)`
49
+
50
+ ## AI usage guidance
51
+ When generating UI:
52
+ - Install with `npx sdaia-ui@latest add context-menu` (after `npx sdaia-ui@latest init`), then import `{ ContextMenu }` from `@/components/ui/ContextMenu`.
53
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
54
+ - Use only the documented option values listed under "Options".
55
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,77 @@
1
+ # Digital Stamp
2
+
3
+ ## Metadata
4
+ - Component: Digital Stamp
5
+ - Slug: `digital-stamp`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add digital-stamp`
8
+ - Import: `import { DigitalStamp } from '@/components/ui/DigitalStamp'`
9
+ - Installed files: `DigitalStamp.tsx`, `DigitalStamp.types.ts`, `DigitalStamp.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/digital-stamp
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 digital-stamp`. It copies the source into your components folder (`components/ui/DigitalStamp/`, under `src/` when the project has one); import it as `@/components/ui/DigitalStamp`. 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
+ | `message` | `ReactNode` | — | Short verification message shown in the collapsed bar. |
18
+ | `features?` | `DigitalStampFeature[]` | — | Feature rows shown inside the opened panel. Defaults to domain + HTTPS (see `labels`). |
19
+ | `registrationTitle?` | `ReactNode` | — | Optional heading shown above the registration description (e.g. "Registered with DGA"). |
20
+ | `registrationDescription?` | `ReactNode` | — | Descriptive text before the registration number link. Defaults to `labels.registeredOn`. |
21
+ | `registrationNumber?` | `ReactNode` | — | Registration number displayed as a link. |
22
+ | `registrationHref?` | `string` | — | href for the registration number link. |
23
+ | `authorityLogo?` | `ReactNode` | — | Optional DGA (authority) logo node. A default monogram is used when omitted. |
24
+ | `flag?` | `ReactNode` | — | Optional flag node rendered on the leading side (defaults to the Saudi flag). |
25
+ | `defaultOpen?` | `boolean` | false | Uncontrolled initial open state. |
26
+ | `open?` | `boolean` | — | Controlled open state. |
27
+ | `onOpenChange?` | `(open: boolean) => void` | — | Fires when the disclosure toggles. |
28
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
29
+ | `labels?` | `Partial<DigitalStampLabels>` | — | Override built-in strings (English defaults) to localize the stamp. |
30
+
31
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `dir`.
32
+
33
+ ## Options (allowed values)
34
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
35
+
36
+ ## Deprecated props
37
+ Do not use in new code:
38
+ - `howYouKnowLabel`
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-default)`
48
+ - `var(--ds-color-bg-emphasis-high)`
49
+ - `var(--ds-color-bg-emphasis-low)`
50
+ - `var(--ds-color-bg-raised)`
51
+ - `var(--ds-color-border-success-strong)`
52
+ - `var(--ds-color-icon-success)`
53
+ - `var(--ds-color-link-primary)`
54
+ - `var(--ds-color-link-primary-hovered)`
55
+ - `var(--ds-color-text-brand)`
56
+ - `var(--ds-color-text-default)`
57
+ - `var(--ds-color-text-paragraph)`
58
+ - `var(--ds-motion-feedback-duration)`
59
+ - `var(--ds-motion-feedback-easing)`
60
+ - `var(--ds-radius-full)`
61
+ - `var(--ds-radius-m)`
62
+ - `var(--ds-radius-xxs)`
63
+ - `var(--ds-spacing-3xl)`
64
+ - `var(--ds-spacing-4xl)`
65
+ - `var(--ds-spacing-5xl)`
66
+ - `var(--ds-spacing-lg)`
67
+ - `var(--ds-spacing-md)`
68
+ - `var(--ds-spacing-sm)`
69
+ - `var(--ds-spacing-xl)`
70
+ - `var(--ds-spacing-xs)`
71
+
72
+ ## AI usage guidance
73
+ When generating UI:
74
+ - Install with `npx sdaia-ui@latest add digital-stamp` (after `npx sdaia-ui@latest init`), then import `{ DigitalStamp }` from `@/components/ui/DigitalStamp`.
75
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
76
+ - Use only the documented option values listed under "Options".
77
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,65 @@
1
+ # Divider
2
+
3
+ ## Metadata
4
+ - Component: Divider
5
+ - Slug: `divider`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add divider`
8
+ - Import: `import { Divider } from '@/components/ui/Divider'`
9
+ - Installed files: `Divider.tsx`, `Divider.types.ts`, `Divider.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/divider
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 divider`. It copies the source into your components folder (`components/ui/Divider/`, under `src/` when the project has one); import it as `@/components/ui/Divider`. 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
+ | `lineType?` | `'horizontal' \| 'vertical'` | 'horizontal' | Orientation of the divider. Default: `'horizontal'`. |
18
+ | `color?` | `'neutral' \| 'primary'` | 'neutral' | Color scheme. Default: `'neutral'`. |
19
+ | `thickness?` | `'hairline' \| 'thin' \| 'regular' \| 'thick'` | 'hairline' | Line weight. Default: `'hairline'`. |
20
+ | `length?` | `'full' \| 'inset' \| 'inset-start' \| 'inset-end'` | 'full' | Inset variant — horizontal only. Default: `'full'`. |
21
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
22
+
23
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
24
+
25
+ ## Options (allowed values)
26
+ - `lineType`: `'horizontal'` \| `'vertical'` — Orientation of the divider line.
27
+ - `color`: `'neutral'` \| `'primary'` — Color palette (Figma node 4016:1408).
28
+ neutral → --ds-color-border-default
29
+ primary → --ds-color-border-brand
30
+ - `thickness`: `'hairline'` \| `'thin'` \| `'regular'` \| `'thick'` — Visual weight of the line.
31
+ hairline → 1 px
32
+ thin → 2 px
33
+ regular → 3 px
34
+ thick → 4 px
35
+ - `length`: `'full'` \| `'inset'` \| `'inset-start'` \| `'inset-end'` — Inset padding applied to horizontal dividers.
36
+ Uses logical CSS properties so RTL is handled automatically:
37
+ full → no inset (full container width)
38
+ inset → spacing-3xl on both sides
39
+ inset-start → spacing-3xl on inline-start (left in LTR, right in RTL)
40
+ inset-end → spacing-3xl on inline-end (right in LTR, left in RTL)
41
+
42
+ Note: vertical dividers always fill the container height; `length`
43
+ has no effect when lineType="vertical".
44
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
45
+
46
+ ## Deprecated props
47
+ Do not use in new code:
48
+ - `rtl`
49
+
50
+ ## Accessibility
51
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
52
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
53
+
54
+ ## Design tokens used
55
+ Keep these consistent (resolve values with `get_tokens`):
56
+ - `var(--ds-color-border-brand)`
57
+ - `var(--ds-color-border-default)`
58
+ - `var(--ds-spacing-3xl)`
59
+
60
+ ## AI usage guidance
61
+ When generating UI:
62
+ - Install with `npx sdaia-ui@latest add divider` (after `npx sdaia-ui@latest init`), then import `{ Divider }` from `@/components/ui/Divider`.
63
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
64
+ - Use only the documented option values listed under "Options".
65
+ - 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,75 @@
1
+ # Donut Chart
2
+
3
+ ## Metadata
4
+ - Component: Donut Chart
5
+ - Slug: `donut-chart`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add donut-chart`
8
+ - Import: `import { DonutChart } from '@/components/ui/DonutChart'`
9
+ - Installed files: `DonutChart.tsx`, `DonutChart.types.ts`, `DonutChart.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/donut-chart
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 donut-chart`. It copies the source into your components folder (`components/ui/DonutChart/`, under `src/` when the project has one); import it as `@/components/ui/DonutChart`. 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?` | `'Color Border' \| 'Color Filled'` | 'Color Border' | Rendering style — controls whether the ring has a grey track and whether the pie mode renders ring arcs or solid sectors. |
18
+ | `pie?` | `boolean` | false | `false` — single-arc donut driven by `percentage`. `true` — multi-slice chart driven by `series` / `sliceData`. |
19
+ | `percentage?` | `number` | — | Fill percentage for donut mode (pie=false), 0–100. Without it the chart renders its no-data state (`labels.noData`). |
20
+ | `slices?` | `DonutChartSliceCount` | — | Number of equal slices in pie mode (pie=true) when no `series` / `sliceData` is given. Ignored when either is supplied. Without `series`, `sliceData` or `slices`, pie mode renders the no-data state. |
21
+ | `series?` | `DonutChartSeriesItem[]` | — | Preferred series JSON for pie mode. Use this when integrating with chart panels/legends to keep values in sync. |
22
+ | `sliceData?` | `DonutChartSliceData[]` | — | Custom per-slice data for pie mode. When provided, overrides `slices` and uses `value` for proportional sizing and `color` for per-slice colour. |
23
+ | `helperText?` | `string` | — | Helper text rendered above the bold label inside the ring. Omit it (or pass `''`) to hide it. |
24
+ | `label?` | `string` | — | Bold value rendered below the helper text. In donut mode defaults to `'${percentage}%'`. Set to `undefined` or `''` to hide. |
25
+ | `size?` | `number` | DEFAULT_SIZE | Diameter of the component in px. All geometry (stroke-width, radius) scales proportionally. |
26
+ | `segmentGap?` | `number` | PIE_RING_GAP_DEG | Gap in degrees between adjacent ring arc segments (pie=true, Color Border). Set to `0` for flush/seamless segments. |
27
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction. In `'rtl'` the fill arc / pie sectors are mirrored horizontally (they run counter-clockwise from 12 o'clock), matching the chart-wide decision that charts mirror in RTL. When omitted, the direction inherited from the closest `dir` ancestor is used. |
28
+ | `labels?` | `Partial<DonutChartLabels>` | — | Translatable built-in strings (accessible names, no-data message, data-table headers). |
29
+
30
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
31
+
32
+ ## Options (allowed values)
33
+ - `variant`: `'Color Border'` \| `'Color Filled'` — Visual rendering style.
34
+
35
+ | Value | pie=false | pie=true |
36
+ |----------------|----------------------------------------|---------------------------------|
37
+ | 'Color Border' | Grey track ring + green fill arc | Ring divided into N coloured arc segments (gaps between) |
38
+ | 'Color Filled' | Green arc only, transparent background | Full pie — N solid sectors from centre |
39
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction. In `'rtl'` the fill arc / pie sectors are mirrored
40
+ horizontally (they run counter-clockwise from 12 o'clock), matching the
41
+ chart-wide decision that charts mirror in RTL. When omitted, the direction
42
+ inherited from the closest `dir` ancestor is used.
43
+
44
+ ## Deprecated props
45
+ Do not use in new code:
46
+ - `rtl`
47
+
48
+ ## Accessibility
49
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
50
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
51
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
52
+
53
+ ## Design tokens used
54
+ Keep these consistent (resolve values with `get_tokens`):
55
+ - `var(--ds-color-bg-raised)`
56
+ - `var(--ds-color-border-default)`
57
+ - `var(--ds-color-chart-series-1)`
58
+ - `var(--ds-color-chart-series-2)`
59
+ - `var(--ds-color-chart-series-3)`
60
+ - `var(--ds-color-text-default)`
61
+ - `var(--ds-color-text-paragraph)`
62
+ - `var(--ds-color-text-paragraph-muted)`
63
+ - `var(--ds-radius-xs)`
64
+ - `var(--ds-text-size-display-sm)`
65
+ - `var(--ds-text-size-text-lg)`
66
+ - `var(--ds-themes-chart-chart-series-4)`
67
+ - `var(--ds-themes-chart-chart-series-5)`
68
+ - `var(--ds-themes-chart-chart-series-6)`
69
+
70
+ ## AI usage guidance
71
+ When generating UI:
72
+ - Install with `npx sdaia-ui@latest add donut-chart` (after `npx sdaia-ui@latest init`), then import `{ DonutChart }` from `@/components/ui/DonutChart`.
73
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
74
+ - Use only the documented option values listed under "Options".
75
+ - 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,43 @@
1
+ # Draggable List
2
+
3
+ ## Metadata
4
+ - Component: Draggable List
5
+ - Slug: `draggable-list`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add draggable-list`
8
+ - Import: `import { DraggableList } from '@/components/ui/DraggableList'`
9
+ - Installed files: `DraggableList.tsx`, `DraggableList.types.ts`, `DraggableList.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/draggable-list
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 draggable-list`. It copies the source into your components folder (`components/ui/DraggableList/`, under `src/` when the project has one); import it as `@/components/ui/DraggableList`. 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
+ | `children?` | `ReactNode` | — | List items (typically `DraggableItem` elements). |
18
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction for logical layout. Prefer inheriting from an ancestor; set explicitly for documentation previews. |
19
+
20
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`.
21
+
22
+ ## Options (allowed values)
23
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction for logical layout. Prefer inheriting from an ancestor;
24
+ set explicitly for documentation previews.
25
+
26
+ ## Deprecated props
27
+ Do not use in new code:
28
+ - `rtl`
29
+
30
+ ## Accessibility
31
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
32
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
33
+
34
+ ## Design tokens used
35
+ Keep these consistent (resolve values with `get_tokens`):
36
+ - `var(--ds-spacing-lg)`
37
+
38
+ ## AI usage guidance
39
+ When generating UI:
40
+ - Install with `npx sdaia-ui@latest add draggable-list` (after `npx sdaia-ui@latest init`), then import `{ DraggableList }` from `@/components/ui/DraggableList`.
41
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
42
+ - Use only the documented option values listed under "Options".
43
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.