@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.
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 +1117 -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 +12124 -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,83 @@
1
+ # OTP Input
2
+
3
+ ## Metadata
4
+ - Component: OTP Input
5
+ - Slug: `otp-input`
6
+ - Category: Form
7
+ - Install: `npx sdaia-ui@latest add otp-input`
8
+ - Import: `import { OtpInput } from '@/components/ui/OtpInput'`
9
+ - Installed files: `OtpInput.tsx`, `OtpInput.types.ts`, `OtpInput.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/otp-input
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 otp-input`. It copies the source into your components folder (`components/ui/OtpInput/`, under `src/` when the project has one); import it as `@/components/ui/OtpInput`. 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. The label, helper and Resend row mirror in RTL; the digit boxes always stay left to right. |
18
+ | `length?` | `OtpInputLength` | 4 | Number of digit boxes (Figma `Length`). |
19
+ | `value?` | `string` | — | Code entered so far (controlled), digits only. |
20
+ | `defaultValue?` | `string` | '' | Initial code (uncontrolled). |
21
+ | `onChange?` | `(value: string) => void` | — | Fired on every change with the digits entered so far. |
22
+ | `onComplete?` | `(value: string) => void` | — | Fired once every box holds a digit, with the full code. |
23
+ | `label?` | `string` | — | Label above the boxes (Figma `Label EN/AR`). Names the group. |
24
+ | `helperText?` | `string` | — | Helper text under the boxes (Figma `Helper` + `Helper Text EN/AR`). |
25
+ | `error?` | `string` | — | Error message (Figma `Error Message EN/AR`). Replaces the helper text, turns the boxes red, sets `aria-invalid` and is announced. Say what went wrong and what to do. |
26
+ | `disabled?` | `boolean` | false | Disables every box and the Resend action (Figma State=Disabled). |
27
+ | `required?` | `boolean` | false | Marks the code as required (`aria-required` on every box). |
28
+ | `autoFocus?` | `boolean` | false | Focus the first empty box on mount. |
29
+ | `name?` | `string` | — | Name of a hidden input that carries the code in a native form submit. Omit it when the form reads `value` itself. |
30
+ | `resendQuestion?` | `string` | — | Question before the Resend action (Figma `Resend Question EN/AR`), e.g. "Didn't get a code?". |
31
+ | `onResend?` | `() => void` | — | Shows the Resend action (Figma `Resend`) as a link-styled button and fires when it is pressed. Pass `resendHref` instead to navigate. |
32
+ | `resendHref?` | `string` | — | Shows the Resend action as a link to this URL. |
33
+ | `resendDisabled?` | `boolean` | false | Disables only the Resend action, e.g. during a cool-down. |
34
+ | `labels?` | `Partial<OtpInputLabels>` | — | Localised built-in strings (digit names, Resend text). |
35
+
36
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onChange`, `defaultValue`, `dir`.
37
+
38
+ ## Options (allowed values)
39
+ - `dir`: `'ltr'` \| `'rtl'` — Layout direction. The label, helper and Resend row mirror in RTL; the digit boxes always stay left to right.
40
+
41
+ ## Accessibility
42
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
43
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
44
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
45
+
46
+ ## Design tokens used
47
+ Keep these consistent (resolve values with `get_tokens`):
48
+ - `var(--ds-color-)`
49
+ - `var(--ds-color-bg-disabled)`
50
+ - `var(--ds-color-border-disabled)`
51
+ - `var(--ds-color-border-focus)`
52
+ - `var(--ds-color-form-field-bg-default)`
53
+ - `var(--ds-color-form-field-border-danger)`
54
+ - `var(--ds-color-form-field-border-default)`
55
+ - `var(--ds-color-form-field-border-hovered)`
56
+ - `var(--ds-color-form-field-border-pressed)`
57
+ - `var(--ds-color-form-field-text-filled)`
58
+ - `var(--ds-color-form-field-text-label)`
59
+ - `var(--ds-color-icon-danger)`
60
+ - `var(--ds-color-icon-neutral)`
61
+ - `var(--ds-color-text-danger)`
62
+ - `var(--ds-color-text-disabled)`
63
+ - `var(--ds-color-text-paragraph)`
64
+ - `var(--ds-color-text-paragraph-muted)`
65
+ - `var(--ds-motion-feedback-duration)`
66
+ - `var(--ds-motion-feedback-easing)`
67
+ - `var(--ds-radius-m)`
68
+ - `var(--ds-spacing-md)`
69
+ - `var(--ds-spacing-sm)`
70
+ - `var(--ds-spacing-xs)`
71
+ - `var(--ds-spacing-xxs)`
72
+ - `var(--ds-text-family-display)`
73
+ - `var(--ds-text-family-text)`
74
+ - `var(--ds-text-leading-line-heights-display-xs)`
75
+ - `var(--ds-text-leading-line-heights-text-sm)`
76
+
77
+ ## AI usage guidance
78
+ When generating UI:
79
+ - Install with `npx sdaia-ui@latest add otp-input` (after `npx sdaia-ui@latest init`), then import `{ OtpInput }` from `@/components/ui/OtpInput`.
80
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
81
+ - Use only the documented option values listed under "Options".
82
+ - Express the disabled state with the `disabled` prop, not custom styling.
83
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,49 @@
1
+ # Password Input
2
+
3
+ ## Metadata
4
+ - Component: Password Input
5
+ - Slug: `password-input`
6
+ - Category: Form
7
+ - Install: `npx sdaia-ui@latest add password-input`
8
+ - Import: `import { PasswordInput } from '@/components/ui/PasswordInput'`
9
+ - Installed files: `PasswordInput.tsx`, `PasswordInput.types.ts`, `PasswordInput.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/password-input
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 password-input`. It copies the source into your components folder (`components/ui/PasswordInput/`, under `src/` when the project has one); import it as `@/components/ui/PasswordInput`. 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
+ | `visibility?` | `'hidden' \| 'shown'` | — | Whether the value is masked or readable (Figma `Visibility`). Controlled when set; pair it with `onVisibilityChange`. |
18
+ | `defaultVisibility?` | `'hidden' \| 'shown'` | 'hidden' | Initial visibility when uncontrolled. Keep the value hidden by default: the user reveals it on demand. |
19
+ | `onVisibilityChange?` | `(visibility: PasswordInputVisibility) => void` | — | Fired when the eye toggle is pressed, with the new visibility. |
20
+ | `autoComplete?` | `string` | 'current-password' | Native `autocomplete`. Use `'current-password'` on sign-in forms and `'new-password'` when the user creates or changes a password. |
21
+ | `labels?` | `Partial<PasswordInputLabels>` | — | Localised built-in strings (the eye toggle's accessible name). |
22
+
23
+ ## Options (allowed values)
24
+ - `visibility`: `'hidden'` \| `'shown'` — Whether the password is masked (`'hidden'`) or readable (`'shown'`).
25
+ Maps to the Figma `Visibility` axis (Hidden / Shown).
26
+ - `defaultVisibility`: `'hidden'` \| `'shown'` — Whether the password is masked (`'hidden'`) or readable (`'shown'`).
27
+ Maps to the Figma `Visibility` axis (Hidden / Shown).
28
+
29
+ ## Accessibility
30
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
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-color-)`
37
+ - `var(--ds-color-border-brand)`
38
+ - `var(--ds-color-icon-default)`
39
+ - `var(--ds-motion-feedback-duration)`
40
+ - `var(--ds-motion-feedback-easing)`
41
+ - `var(--ds-radius-xs)`
42
+ - `var(--ds-spacing-xs)`
43
+
44
+ ## AI usage guidance
45
+ When generating UI:
46
+ - Install with `npx sdaia-ui@latest add password-input` (after `npx sdaia-ui@latest init`), then import `{ PasswordInput }` from `@/components/ui/PasswordInput`.
47
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
48
+ - Use only the documented option values listed under "Options".
49
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,71 @@
1
+ # Range Slider
2
+
3
+ ## Metadata
4
+ - Component: Range Slider
5
+ - Slug: `range-slider`
6
+ - Category: Form
7
+ - Install: `npx sdaia-ui@latest add range-slider`
8
+ - Import: `import { RangeSlider } from '@/components/ui/RangeSlider'`
9
+ - Installed files: `RangeSlider.tsx`, `RangeSlider.types.ts`, `RangeSlider.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/range-slider
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 range-slider`. It copies the source into your components folder (`components/ui/RangeSlider/`, under `src/` when the project has one); import it as `@/components/ui/RangeSlider`. 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
+ | `value?` | `RangeSliderValue` | — | Current [start, end] value. Controlled when provided. |
18
+ | `defaultValue?` | `RangeSliderValue` | [20, 80] | Initial [start, end] for uncontrolled usage. Default: [20, 80] |
19
+ | `onChange?` | `(value: RangeSliderValue) => void` | — | Called with new [start, end] when either thumb moves |
20
+ | `min?` | `number` | 0 | Minimum bound. Default: 0 |
21
+ | `max?` | `number` | 100 | Maximum bound. Default: 100 |
22
+ | `step?` | `number` | 1 | Step increment. Default: 1 |
23
+ | `label?` | `'inline' \| 'bottom' \| 'top-floating' \| 'bottom-floating' \| 'none'` | 'inline' | Label position variant. Default: 'inline' |
24
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the slider. Unset inherits from the closest `dir` ancestor. In RTL the track fills from the right and the arrow keys follow the visual direction. |
25
+ | `leadingIcon?` | `boolean` | false | Show info icon at the leading end |
26
+ | `trailingIcon?` | `boolean` | false | Show info icon at the trailing end |
27
+ | `disabled?` | `boolean` | false | Disabled state |
28
+ | `formatValue?` | `(value: number) => string` | — | Custom formatter for displayed values (min/max labels, bubbles, and the thumbs' `aria-valuetext`). Default: v => `${v}%` |
29
+ | `labels?` | `Partial<RangeSliderLabels>` | — | Localised built-in strings (thumb names). |
30
+
31
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onChange`, `defaultValue`, `dir`.
32
+
33
+ ## Options (allowed values)
34
+ - `label`: `'inline'` \| `'bottom'` \| `'top-floating'` \| `'bottom-floating'` \| `'none'` — Label position variant. Default: 'inline'
35
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction of the slider. Unset inherits from the closest `dir` ancestor.
36
+ In RTL the track fills from the right and the arrow keys follow the visual direction.
37
+
38
+ ## Deprecated props
39
+ Do not use in new code:
40
+ - `direction`
41
+
42
+ ## Accessibility
43
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
44
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
45
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
46
+
47
+ ## Design tokens used
48
+ Keep these consistent (resolve values with `get_tokens`):
49
+ - `var(--ds-color-)`
50
+ - `var(--ds-color-bg-brand)`
51
+ - `var(--ds-color-bg-default)`
52
+ - `var(--ds-color-bg-emphasis-low)`
53
+ - `var(--ds-color-border-focus)`
54
+ - `var(--ds-color-border-on-default)`
55
+ - `var(--ds-color-button-bg-primary-default)`
56
+ - `var(--ds-color-icon-neutral)`
57
+ - `var(--ds-color-text-display)`
58
+ - `var(--ds-radius-full)`
59
+ - `var(--ds-radius-xs)`
60
+ - `var(--ds-spacing-md)`
61
+ - `var(--ds-spacing-sm)`
62
+ - `var(--ds-spacing-xs)`
63
+
64
+ ## AI usage guidance
65
+ When generating UI:
66
+ - Install with `npx sdaia-ui@latest add range-slider` (after `npx sdaia-ui@latest init`), then import `{ RangeSlider }` from `@/components/ui/RangeSlider`.
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
+ - Express the disabled state with the `disabled` prop, not custom styling.
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,106 @@
1
+ # Rich Text Editor
2
+
3
+ ## Metadata
4
+ - Component: Rich Text Editor
5
+ - Slug: `rich-text-editor`
6
+ - Category: Form
7
+ - Install: `npx sdaia-ui@latest add rich-text-editor`
8
+ - Import: `import { RichTextEditor } from '@/components/ui/RichTextEditor'`
9
+ - Installed files: `RichTextEditor.tsx`, `RichTextEditor.types.ts`, `RichTextEditor.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/rich-text-editor
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 rich-text-editor`. It copies the source into your components folder (`components/ui/RichTextEditor/`, under `src/` when the project has one); import it as `@/components/ui/RichTextEditor`. 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?` | `'default' \| 'text-selected' \| 'input'` | 'default' | Visual type. - `default` (default) — full formatting toolbar + content-editable area - `text-selected` — compact floating toolbar shown when text is selected - `input` — self-contained input field with bottom quick-action bar and optional expanded toolbar |
18
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the editor (toolbar order, panels, placeholder). Unset inherits from the document / nearest `dir` ancestor. |
19
+ | `labels?` | `Partial<RichTextEditorLabels>` | — | Localised built-in strings (aria labels, menu options, placeholders…). |
20
+ | `mobile?` | `boolean` | false | Render in mobile layout. - `default` type: collapses to a 2-row toolbar (undo/redo + selectors on row 1, collapsed format groups on row 2). |
21
+ | `expand?` | `boolean` | false | Show expanded formatting toolbar above the content area. Only applies when `type="input"`. |
22
+ | `isBold?` | `boolean` | false | Whether the Bold action is currently active (toggled). |
23
+ | `isItalic?` | `boolean` | false | Whether the Italic action is currently active (toggled). |
24
+ | `isUnderline?` | `boolean` | false | Whether the Underline action is currently active (toggled). |
25
+ | `alignment?` | `'left' \| 'center' \| 'right'` | — | Currently active text alignment. |
26
+ | `textStyle?` | `string` | — | Initially selected text style: a built-in option label (English or the localised `labels` value, e.g. `"Heading 1"`) or its tag (`"p"`, `"h1"`…). |
27
+ | `textStyleOptions?` | `string[]` | — | Available text style options. |
28
+ | `fontSize?` | `string` | — | Initially selected font size label (e.g. `"16"`). |
29
+ | `fontSizeOptions?` | `string[]` | — | Available font size options. |
30
+ | `onTextStyleChange?` | `(value: string) => void` | — | Called with the (localised) option label when the user selects a text style. |
31
+ | `onFontSizeChange?` | `(value: string) => void` | — | Called when the user selects a font size option. |
32
+ | `onUndo?` | `() => void` | — | Called when the Undo button is pressed. |
33
+ | `onRedo?` | `() => void` | — | Called when the Redo button is pressed. |
34
+ | `onBold?` | `() => void` | — | Called when the Bold button is pressed. |
35
+ | `onItalic?` | `() => void` | — | Called when the Italic button is pressed. |
36
+ | `onUnderline?` | `() => void` | — | Called when the Underline button is pressed. |
37
+ | `onAlign?` | `(alignment: TextAlignment) => void` | — | Called when an alignment button is pressed. |
38
+ | `onColor?` | `() => void` | — | Called whenever a colour from the colour picker is applied. |
39
+ | `onLink?` | `() => void` | — | Called when the Link button is pressed (`text-selected`) or a link is inserted. |
40
+ | `onImage?` | `() => void` | — | Called when the Image button is pressed. |
41
+ | `onAI?` | `() => void` | — | Called when the AI button is pressed. |
42
+ | `value?` | `string` | — | Initial HTML content of the editable region (`default` and `input` types). Read once on mount; listen to `onChange` for later edits. |
43
+ | `placeholder?` | `string` | 'Type here…' (`default` type) / 'You can write here…' (`input` type) | Placeholder text of the editable region. Wins over `labels.placeholder` / `labels.inputPlaceholder`. |
44
+ | `onChange?` | `(value: string) => void` | — | Called on every edit with the editor's new HTML. |
45
+ | `onAddContent?` | `() => void` | — | Called when the `+` (add content) button is pressed. |
46
+ | `onFormatText?` | `() => void` | — | Called when a text style is applied from the Aa (format text) menu. |
47
+ | `onEmoji?` | `() => void` | — | Called when the emoji button is pressed. |
48
+ | `onMention?` | `() => void` | — | Called when the `@` mention button is pressed. |
49
+
50
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onChange`, `dir`.
51
+
52
+ ## Options (allowed values)
53
+ - `type`: `'default'` \| `'text-selected'` \| `'input'` — Which visual mode the component renders in
54
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction of the editor (toolbar order, panels, placeholder).
55
+ Unset inherits from the document / nearest `dir` ancestor.
56
+ - `alignment`: `'left'` \| `'center'` \| `'right'` — Text alignment option
57
+
58
+ ## Accessibility
59
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
60
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
61
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
62
+
63
+ ## Design tokens used
64
+ Keep these consistent (resolve values with `get_tokens`):
65
+ - `var(--ds-color-)`
66
+ - `var(--ds-color-bg-default)`
67
+ - `var(--ds-color-bg-emphasis-low)`
68
+ - `var(--ds-color-bg-muted)`
69
+ - `var(--ds-color-bg-overlay)`
70
+ - `var(--ds-color-border-brand)`
71
+ - `var(--ds-color-border-default)`
72
+ - `var(--ds-color-form-field-bg-default)`
73
+ - `var(--ds-color-form-field-border-default)`
74
+ - `var(--ds-color-form-field-border-hovered)`
75
+ - `var(--ds-color-form-field-text-filled)`
76
+ - `var(--ds-color-form-field-text-placeholder)`
77
+ - `var(--ds-color-form-option-bg-hover)`
78
+ - `var(--ds-color-form-option-bg-pressed)`
79
+ - `var(--ds-color-icon-brand)`
80
+ - `var(--ds-color-icon-default)`
81
+ - `var(--ds-color-icon-default-500)`
82
+ - `var(--ds-color-icon-oncolor)`
83
+ - `var(--ds-color-primitive-neutral-400)`
84
+ - `var(--ds-color-text-default)`
85
+ - `var(--ds-color-text-paragraph-muted)`
86
+ - `var(--ds-motion-feedback-duration)`
87
+ - `var(--ds-motion-feedback-easing)`
88
+ - `var(--ds-radius-full)`
89
+ - `var(--ds-radius-m)`
90
+ - `var(--ds-radius-xs)`
91
+ - `var(--ds-radius-xxs)`
92
+ - `var(--ds-spacing-3xl)`
93
+ - `var(--ds-spacing-lg)`
94
+ - `var(--ds-spacing-md)`
95
+ - `var(--ds-spacing-sm)`
96
+ - `var(--ds-spacing-xl)`
97
+ - `var(--ds-spacing-xs)`
98
+ - `var(--ds-spacing-xxs)`
99
+ - `var(--ds-text-leading-line-heights-text-md)`
100
+
101
+ ## AI usage guidance
102
+ When generating UI:
103
+ - Install with `npx sdaia-ui@latest add rich-text-editor` (after `npx sdaia-ui@latest init`), then import `{ RichTextEditor }` from `@/components/ui/RichTextEditor`.
104
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
105
+ - Use only the documented option values listed under "Options".
106
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,113 @@
1
+ # Select
2
+
3
+ ## Metadata
4
+ - Component: Select
5
+ - Slug: `select`
6
+ - Category: Form
7
+ - Install: `npx sdaia-ui@latest add select`
8
+ - Import: `import { Select } from '@/components/ui/Select'`
9
+ - Installed files: `Select.tsx`, `Select.types.ts`, `Select.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/select
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 select`. It copies the source into your components folder (`components/ui/Select/`, under `src/` when the project has one); import it as `@/components/ui/Select`. 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
+ ## Description
15
+ Accessibility: the trigger is a WAI-ARIA `role="combobox"` labelled by `label`
16
+ (via `aria-labelledby`) and described by helper / error text. `aria-label`,
17
+ `aria-labelledby` and `aria-describedby` passed here are forwarded to the
18
+ combobox (not the wrapper) — use `aria-label` when there is no visible label.
19
+ All other HTML attributes go to the outer wrapper `<div>`.
20
+
21
+ ## Props
22
+ | Prop | Type | Default | Description |
23
+ | --- | --- | --- | --- |
24
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the field. Leave unset to inherit it from an ancestor. |
25
+ | `size?` | `'large' \| 'medium'` | 'large' | Trigger size. - `'large'` — 40 px inner height, `py-spacing-md` padding - `'medium'` — 36 px inner height, `py-spacing-sm` padding |
26
+ | `leadingItem?` | `'none' \| 'icon' \| 'dot' \| 'checkbox' \| 'avatar'` | 'none' | Figma Leading Item — element before the value in trigger and menu items. |
27
+ | `options?` | `SelectOption[]` | [] | List of selectable options |
28
+ | `value?` | `string \| string[]` | — | Controlled selected value(s). - Single: `string` - Multi (`multiple={true}`): `string[]` |
29
+ | `onChange?` | `(value: string \| string[]) => void` | — | Called when the selection changes |
30
+ | `multiple?` | `boolean` | false | Enable multi-select mode. When true, `value` should be `string[]`, selected items are shown as Chips in the trigger, and the dropdown stays open after each selection. |
31
+ | `placeholder?` | `string` | 'Select option' | Placeholder text shown when nothing is selected. Wins over `labels.placeholder`. |
32
+ | `label?` | `string` | — | Label rendered above the trigger |
33
+ | `labelHelp?` | `ReactNode` | — | Content rendered right after the label text, outside the `<label>` element (e.g. a `HelpIcon`), so its own accessible name is not part of the field's. |
34
+ | `required?` | `boolean` | false | Show the required asterisk next to the label and set `aria-required="true"` |
35
+ | `helperText?` | `string` | — | Helper text shown below the trigger |
36
+ | `error?` | `string` | — | Error message — shown in red below the trigger. Takes precedence over `helperText`, applies a red border, sets `aria-invalid="true"` and is announced when it appears. |
37
+ | `disabled?` | `boolean` | false | Disables the entire field |
38
+ | `leadingIcon?` | `ReactNode` | — | Icon node displayed when `leading='icon'`. Rendered at 20 × 20 px in both the trigger and the dropdown items. |
39
+ | `avatarSrc?` | `string` | the default `SaudiAvatar` from sdaia-assets | Default avatar image URL used in the trigger when `leading='avatar'` and no option is selected (or the selected option has no `avatar`). |
40
+ | `id?` | `string` | — | HTML id for the combobox trigger (the label, listbox and options derive their ids from it) |
41
+ | `labels?` | `Partial<SelectLabels>` | — | Localised built-in strings. |
42
+
43
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onChange`.
44
+
45
+ ## Options (allowed values)
46
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction of the field. Leave unset to inherit it from an ancestor.
47
+ - `size`: `'large'` \| `'medium'` — Height / padding variant for the trigger
48
+ - `leadingItem`: `'none'` \| `'icon'` \| `'dot'` \| `'checkbox'` \| `'avatar'` — Figma Leading Item variant — what appears before the selected value in the trigger
49
+ and in each dropdown option.
50
+ - `'none'` — Leading Item=None
51
+ - `'icon'` — Leading Item=Icon; pass `leadingIcon`
52
+ - `'dot'` — Leading Item=Dot (status dot)
53
+ - `'checkbox'` — Leading Item=Checkbox (multi-select; checkboxes in list)
54
+ - `'avatar'` — Leading Item=Avatar; per-option `avatar` or `avatarSrc`
55
+
56
+ ## Deprecated props
57
+ Do not use in new code:
58
+ - `leading` — Same as `leadingItem` (legacy name); `leadingItem` wins when both are set.
59
+
60
+ ## Accessibility
61
+ Built in (SDAIA review item A3) — verified by `tests/a11y/keyboard/select.spec.ts` in the design system's test suite:
62
+ - The trigger is a WAI-ARIA select-only `combobox`, named by the visible `label`.
63
+ - `Enter` opens the list, arrow keys move the active option, `Enter` selects it.
64
+ - `Escape` closes the list without changing the value.
65
+
66
+ You must:
67
+ - Always pass `label` (use a visually hidden label only when the design has none).
68
+
69
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
70
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
71
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
72
+
73
+ ## Design tokens used
74
+ Keep these consistent (resolve values with `get_tokens`):
75
+ - `var(--ds-color-bg-brand)`
76
+ - `var(--ds-color-bg-muted)`
77
+ - `var(--ds-color-bg-overlay)`
78
+ - `var(--ds-color-border-brand)`
79
+ - `var(--ds-color-border-default)`
80
+ - `var(--ds-color-form-field-bg-default)`
81
+ - `var(--ds-color-form-field-border-danger)`
82
+ - `var(--ds-color-form-field-border-default)`
83
+ - `var(--ds-color-form-field-border-hovered)`
84
+ - `var(--ds-color-form-field-text-filled)`
85
+ - `var(--ds-color-form-field-text-helper)`
86
+ - `var(--ds-color-form-field-text-label)`
87
+ - `var(--ds-color-form-field-text-placeholder)`
88
+ - `var(--ds-color-icon-danger)`
89
+ - `var(--ds-color-icon-default-500)`
90
+ - `var(--ds-color-icon-default-disabled)`
91
+ - `var(--ds-color-primitive-neutral-400)`
92
+ - `var(--ds-color-text-danger)`
93
+ - `var(--ds-color-text-disabled)`
94
+ - `var(--ds-motion-feedback-duration)`
95
+ - `var(--ds-motion-feedback-easing)`
96
+ - `var(--ds-radius-full)`
97
+ - `var(--ds-radius-m)`
98
+ - `var(--ds-spacing-lg)`
99
+ - `var(--ds-spacing-md)`
100
+ - `var(--ds-spacing-sm)`
101
+ - `var(--ds-spacing-xs)`
102
+ - `var(--ds-spacing-xxs)`
103
+ - `var(--ds-text-family-text)`
104
+ - `var(--ds-text-leading-line-heights-text-sm)`
105
+
106
+ ## AI usage guidance
107
+ When generating UI:
108
+ - Install with `npx sdaia-ui@latest add select` (after `npx sdaia-ui@latest init`), then import `{ Select }` from `@/components/ui/Select`.
109
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
110
+ - Use only the documented option values listed under "Options".
111
+ - 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).
112
+ - Express the disabled state with the `disabled` prop, not custom styling.
113
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,83 @@
1
+ # Signature
2
+
3
+ ## Metadata
4
+ - Component: Signature
5
+ - Slug: `signature`
6
+ - Category: Form
7
+ - Install: `npx sdaia-ui@latest add signature`
8
+ - Import: `import { Signature } from '@/components/ui/Signature'`
9
+ - Installed files: `Signature.tsx`, `Signature.types.ts`, `Signature.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/signature
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 signature`. It copies the source into your components folder (`components/ui/Signature/`, under `src/` when the project has one); import it as `@/components/ui/Signature`. 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?` | `'draw' \| 'text' \| 'upload'` | — | Controlled active tab. Pair with `onTypeChange`. When omitted use `defaultType`. |
18
+ | `defaultType?` | `'draw' \| 'text' \| 'upload'` | 'draw' | Uncontrolled initial tab. |
19
+ | `onTypeChange?` | `(type: SignatureType) => void` | — | Called when the user switches tabs. |
20
+ | `helperText?` | `string` | — | Helper / disclaimer text shown below the signature area (e.g. "By signing this document, I certify…"). Nothing is rendered when omitted. It also describes the accept button (`aria-describedby`). |
21
+ | `showHelperText?` | `boolean` | true | Whether the helper text is visible. |
22
+ | `showOptions?` | `boolean` | true | Whether the draw / text options toolbar (color, size, background) is shown. |
23
+ | `showTabs?` | `boolean` | true | Whether the tabs row is shown. |
24
+ | `cancelLabel?` | `string` | — | Label for the secondary (cancel) action. Wins over `labels.cancel`. |
25
+ | `acceptLabel?` | `string` | — | Label for the primary (accept) action. Wins over `labels.accept`. |
26
+ | `onCancel?` | `() => void` | — | Called when Cancel is clicked. |
27
+ | `onAccept?` | `(data?: string \| File) => void` | — | Called when Accept and Sign is clicked. Receives the captured data: draw → base64 PNG string (transparent background, device-pixel resolution). Strokes drawn with the theme-default ink are exported in black so the image stays readable on a white document even when signed in dark mode; strokes in a picked colour keep that colour. text → the typed signature string upload → the File object |
28
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the card. Unset inherits from the document. |
29
+ | `maxFileSize?` | `number` | DEFAULT_MAX_FILE_SIZE | Largest file (bytes) the upload tab accepts. A larger file is rejected and `labels.fileTooLarge` is shown; `onAccept` never receives it. |
30
+ | `labels?` | `Partial<SignatureLabels>` | — | Localised built-in strings. |
31
+ | `className?` | `string` | — | — |
32
+
33
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onChange`, `dir`.
34
+
35
+ ## Options (allowed values)
36
+ - `type`: `'draw'` \| `'text'` \| `'upload'` — Which signature capture method is active.
37
+ Maps to the Figma "Type" property.
38
+ - `defaultType`: `'draw'` \| `'text'` \| `'upload'` — Which signature capture method is active.
39
+ Maps to the Figma "Type" property.
40
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction of the card. Unset inherits from the document.
41
+
42
+ ## Accessibility
43
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
44
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
45
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
46
+
47
+ ## Design tokens used
48
+ Keep these consistent (resolve values with `get_tokens`):
49
+ - `var(--ds-color-bg-default)`
50
+ - `var(--ds-color-bg-emphasis-low)`
51
+ - `var(--ds-color-bg-overlay)`
52
+ - `var(--ds-color-border-brand)`
53
+ - `var(--ds-color-border-default)`
54
+ - `var(--ds-color-form-field-border-default)`
55
+ - `var(--ds-color-form-field-text-filled)`
56
+ - `var(--ds-color-form-field-text-helper)`
57
+ - `var(--ds-color-form-field-text-placeholder)`
58
+ - `var(--ds-color-form-option-bg-hover)`
59
+ - `var(--ds-color-icon-default-500)`
60
+ - `var(--ds-color-primitive-neutral-400)`
61
+ - `var(--ds-color-text-brand)`
62
+ - `var(--ds-color-text-danger)`
63
+ - `var(--ds-color-text-default)`
64
+ - `var(--ds-color-text-paragraph-muted)`
65
+ - `var(--ds-radius-l)`
66
+ - `var(--ds-radius-m)`
67
+ - `var(--ds-radius-xxs)`
68
+ - `var(--ds-spacing-)`
69
+ - `var(--ds-spacing-4xl)`
70
+ - `var(--ds-spacing-6xl)`
71
+ - `var(--ds-spacing-lg)`
72
+ - `var(--ds-spacing-md)`
73
+ - `var(--ds-spacing-sm)`
74
+ - `var(--ds-spacing-xl)`
75
+ - `var(--ds-spacing-xs)`
76
+ - `var(--ds-spacing-xxs)`
77
+
78
+ ## AI usage guidance
79
+ When generating UI:
80
+ - Install with `npx sdaia-ui@latest add signature` (after `npx sdaia-ui@latest init`), then import `{ Signature }` from `@/components/ui/Signature`.
81
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
82
+ - Use only the documented option values listed under "Options".
83
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,66 @@
1
+ # Slider
2
+
3
+ ## Metadata
4
+ - Component: Slider
5
+ - Slug: `slider`
6
+ - Category: Form
7
+ - Install: `npx sdaia-ui@latest add slider`
8
+ - Import: `import { Slider } from '@/components/ui/Slider'`
9
+ - Installed files: `Slider.tsx`, `Slider.types.ts`, `Slider.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/slider
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 slider`. It copies the source into your components folder (`components/ui/Slider/`, under `src/` when the project has one); import it as `@/components/ui/Slider`. 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
+ | `value?` | `number` | — | Current value (0–100). Controlled when provided. |
18
+ | `defaultValue?` | `number` | 50 | Initial value for uncontrolled usage (0–100). Default: 50 |
19
+ | `onChange?` | `(value: number) => void` | — | Called with the new value when the user moves the thumb |
20
+ | `label?` | `'inline' \| 'bottom' \| 'top-floating' \| 'bottom-floating' \| 'none'` | 'inline' | Label position variant |
21
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the slider. Unset inherits from the closest `dir` ancestor. |
22
+ | `leadingIcon?` | `boolean` | false | Show info icon at the leading end |
23
+ | `trailingIcon?` | `boolean` | false | Show info icon at the trailing end |
24
+ | `formatValue?` | `(value: number) => string` | — | Custom label formatter for the current value. Also used for the input's `aria-valuetext` and the floating bubble. When provided in `inline` mode, both the leading and trailing label slots display the formatted value instead of the raw "0%" / "value%" defaults. E.g. `(v) => v < 50 ? 'Small' : 'Medium'` |
25
+ | `disabled?` | `boolean` | false | Disabled state |
26
+ | `labels?` | `Partial<SliderLabels>` | — | Localised built-in strings (input name, min / max labels). |
27
+
28
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onChange`, `dir`.
29
+
30
+ ## Options (allowed values)
31
+ - `label`: `'inline'` \| `'bottom'` \| `'top-floating'` \| `'bottom-floating'` \| `'none'` — Label position variant
32
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction of the slider. Unset inherits from the closest `dir` ancestor.
33
+
34
+ ## Accessibility
35
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
36
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
37
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
38
+
39
+ ## Design tokens used
40
+ Keep these consistent (resolve values with `get_tokens`):
41
+ - `var(--ds-color-)`
42
+ - `var(--ds-color-bg-brand)`
43
+ - `var(--ds-color-bg-default)`
44
+ - `var(--ds-color-bg-emphasis-low)`
45
+ - `var(--ds-color-border-focus)`
46
+ - `var(--ds-color-border-on-default)`
47
+ - `var(--ds-color-button-bg-primary-default)`
48
+ - `var(--ds-color-icon-neutral)`
49
+ - `var(--ds-color-text-display)`
50
+ - `var(--ds-radius-full)`
51
+ - `var(--ds-radius-xs)`
52
+ - `var(--ds-radius-xxs)`
53
+ - `var(--ds-spacing-md)`
54
+ - `var(--ds-spacing-sm)`
55
+ - `var(--ds-spacing-xs)`
56
+ - `var(--ds-spacing-xxs)`
57
+ - `var(--ds-text-size-text-xs)`
58
+
59
+ ## AI usage guidance
60
+ When generating UI:
61
+ - Install with `npx sdaia-ui@latest add slider` (after `npx sdaia-ui@latest init`), then import `{ Slider }` from `@/components/ui/Slider`.
62
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
63
+ - Use only the documented option values listed under "Options".
64
+ - 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).
65
+ - Express the disabled state with the `disabled` prop, not custom styling.
66
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.