@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,45 @@
1
+ # SDAIA Typography
2
+
3
+ ## Typeface
4
+
5
+ **IBM Plex Sans Arabic** is the official SDAIA typeface for Arabic and Latin text. `npx sdaia-ui@latest init` installs it (`@fontsource/ibm-plex-sans-arabic`, weights 400 / 500 / 600 / 700), imports it from the app entry (`app/layout.tsx`, `pages/_app.tsx` or `src/main.tsx`) and points the font tokens at it. Other brands use their own Latin font and fall back to IBM Plex Sans Arabic for Arabic (topic `theme`).
6
+
7
+ Do **not** add a Google Fonts `<link>`, a manual `@font-face` or `font-family: system-ui` — they replace or duplicate what `init` set up. The body already uses `var(--ds-text-family-text)`; headings that need the display family use `var(--ds-text-family-display)`.
8
+
9
+ ## Type scale — use the utilities
10
+
11
+ `init` adds one utility per Figma text style. Each sets **both the size and the line height**, and both step down automatically on tablet (< 1280px) and phone (< 768px):
12
+
13
+ | Utility | Desktop (size / line height) | Use for |
14
+ | --- | --- | --- |
15
+ | `text-display-2xl` / `-xl` / `-lg` | 72/90 · 60/72 · 48/60 | Hero and landing titles |
16
+ | `text-display-md` / `-sm` / `-xs` | 36/44 · 30/38 · 24/32 | Page and section titles |
17
+ | `text-text-xl` | 20/30 | Lead paragraphs |
18
+ | `text-text-lg` | 18/28 | Large body |
19
+ | `text-text-md` | 16/24 | Body |
20
+ | `text-text-sm` | 14/20 | UI labels, secondary text |
21
+ | `text-text-xs` | 12/18 | Captions, helper text |
22
+ | `text-text-2xs` | 12/18 | Smallest labels |
23
+
24
+ ```tsx
25
+ <h1 className="text-display-sm font-semibold text-[var(--ds-color-text-display)]">Applications</h1>
26
+ <p className="text-text-md text-[var(--ds-color-text-paragraph)]">…</p>
27
+ ```
28
+
29
+ Don't add your own `text-[14px]`, `leading-[…]` or per-breakpoint font sizes on top: the utilities already handle the responsive steps.
30
+
31
+ ## Weights
32
+
33
+ | Weight | Class | Use for |
34
+ | --- | --- | --- |
35
+ | 400 | `font-normal` | Body text, helper text |
36
+ | 500 | `font-medium` | Labels, buttons, UI controls |
37
+ | 600 | `font-semibold` | Headings, emphasis |
38
+ | 700 | `font-bold` | Rare; strong emphasis |
39
+
40
+ ## Common mistakes
41
+
42
+ - Loading the font a second time (Google Fonts link, `@font-face`) next to the one `init` installed.
43
+ - Hardcoding `font-family` instead of using the tokens.
44
+ - Setting a size with `text-[…]` and a separate line height, instead of one `text-display-*` / `text-text-*` utility.
45
+ - Adding mobile font step-downs by hand — the utilities already step down.
@@ -0,0 +1,79 @@
1
+ # Accordion
2
+
3
+ ## Metadata
4
+ - Component: Accordion
5
+ - Slug: `accordion`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add accordion`
8
+ - Import: `import { Accordion } from '@/components/ui/Accordion'`
9
+ - Installed files: `Accordion.tsx`, `Accordion.types.ts`, `Accordion.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/accordion
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 accordion`. It copies the source into your components folder (`components/ui/Accordion/`, under `src/` when the project has one); import it as `@/components/ui/Accordion`. 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. Inherits when omitted. |
18
+ | `size?` | `'sm' \| 'md' \| 'lg'` | 'md' | Accordion size |
19
+ | `variant?` | `'light' \| 'light-compact' \| 'block'` | 'light' | Visual style |
20
+ | `state?` | `'default' \| 'hovered' \| 'pressed' \| 'focused' \| 'disabled'` | — | Force a specific visual state (useful for docs/previews) |
21
+ | `iconAlignment?` | `'trailing' \| 'leading'` | 'trailing' | Icon position in the trigger row |
22
+ | `label?` | `ReactNode` | — | Trigger label text/content. Renders nothing when omitted. |
23
+ | `expanded?` | `boolean` | — | Controlled expanded state |
24
+ | `defaultExpanded?` | `boolean` | false | Uncontrolled initial expanded state |
25
+ | `disabled?` | `boolean` | false | Non-interactive state |
26
+ | `onExpandedChange?` | `(expanded: boolean) => void` | — | Fires when expanded state changes |
27
+ | `preserveContentSpaceWhenCollapsed?` | `boolean` | false | Keep content height reserved while collapsed (useful for demos/previews) |
28
+
29
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
30
+
31
+ ## Options (allowed values)
32
+ - `dir`: `'ltr'` \| `'rtl'` — Layout direction applied to the root. Inherits when omitted.
33
+ - `size`: `'sm'` \| `'md'` \| `'lg'` — Accordion size
34
+ - `variant`: `'light'` \| `'light-compact'` \| `'block'` — Visual style
35
+ - `state`: `'default'` \| `'hovered'` \| `'pressed'` \| `'focused'` \| `'disabled'` — Force a specific visual state (useful for docs/previews)
36
+ - `iconAlignment`: `'trailing'` \| `'leading'` — Icon position in the trigger row
37
+
38
+ ## Deprecated props
39
+ Do not use in new code:
40
+ - `direction`
41
+
42
+ ## Accessibility
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-bg-default)`
49
+ - `var(--ds-color-bg-emphasis-high)`
50
+ - `var(--ds-color-border-default)`
51
+ - `var(--ds-color-border-focus)`
52
+ - `var(--ds-color-button-bg-neutral-hovered)`
53
+ - `var(--ds-color-button-bg-neutral-pressed)`
54
+ - `var(--ds-color-icon-default)`
55
+ - `var(--ds-color-icon-default-disabled)`
56
+ - `var(--ds-color-text-default)`
57
+ - `var(--ds-color-text-disabled)`
58
+ - `var(--ds-color-text-paragraph)`
59
+ - `var(--ds-icon-sm)`
60
+ - `var(--ds-motion-expand-duration)`
61
+ - `var(--ds-motion-expand-easing)`
62
+ - `var(--ds-motion-feedback-duration)`
63
+ - `var(--ds-motion-feedback-easing)`
64
+ - `var(--ds-radius-m)`
65
+ - `var(--ds-spacing-3xl)`
66
+ - `var(--ds-spacing-5xl)`
67
+ - `var(--ds-spacing-lg)`
68
+ - `var(--ds-spacing-md)`
69
+ - `var(--ds-spacing-none)`
70
+ - `var(--ds-spacing-xl)`
71
+
72
+ ## AI usage guidance
73
+ When generating UI:
74
+ - Install with `npx sdaia-ui@latest add accordion` (after `npx sdaia-ui@latest init`), then import `{ Accordion }` from `@/components/ui/Accordion`.
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
+ - 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).
78
+ - Express the disabled state with the `disabled` prop, not custom styling.
79
+ - 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,44 @@
1
+ # Activity
2
+
3
+ ## Metadata
4
+ - Component: Activity
5
+ - Slug: `activity`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add activity`
8
+ - Import: `import { Activity } from '@/components/ui/Activity'`
9
+ - Installed files: `Activity.tsx`, `Activity.types.ts`, `Activity.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/activity
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 activity`. It copies the source into your components folder (`components/ui/Activity/`, under `src/` when the project has one); import it as `@/components/ui/Activity`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
13
+
14
+ ## Props
15
+ | Prop | Type | Default | Description |
16
+ | --- | --- | --- | --- |
17
+ | `items` | `ActivityItemProps[]` | — | The feed items to render. Each entry maps 1-to-1 to an `ActivityItem`. |
18
+ | `divider?` | `boolean` | false | When true a 1 px horizontal rule is inserted between every consecutive pair of items. Gap collapses from 24 px to 12 px on each side of the rule. |
19
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
20
+
21
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
22
+
23
+ ## Options (allowed values)
24
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
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-3xl)`
37
+ - `var(--ds-spacing-lg)`
38
+
39
+ ## AI usage guidance
40
+ When generating UI:
41
+ - Install with `npx sdaia-ui@latest add activity` (after `npx sdaia-ui@latest init`), then import `{ Activity }` from `@/components/ui/Activity`.
42
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
43
+ - Use only the documented option values listed under "Options".
44
+ - 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,64 @@
1
+ # App Shell
2
+
3
+ ## Metadata
4
+ - Component: App Shell
5
+ - Slug: `app-shell`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add app-shell`
8
+ - Import: `import { AppShell } from '@/components/ui/AppShell'`
9
+ - Installed files: `AppShell.tsx`, `AppShell.types.ts`, `AppShell.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/app-shell
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 app-shell`. It copies the source into your components folder (`components/ui/AppShell/`, under `src/` when the project has one); import it as `@/components/ui/AppShell`. 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
+ | `header?` | `AppShellHeaderProps \| ((layout: AppShellHeaderLayout) => AppShellHeaderProps)` | — | The Nav Header on top of the shell (logo, items, search, actions, labels…). Pass a function to adapt the content to the bar being rendered, e.g. `mobile` on `NavHeaderMenuItem` / `NavHeaderActions` in the compact bar. Omit to render the shell without a header. |
18
+ | `sideNavigation?` | `AppShellSideNavigationProps` | — | The side navigation (`NavBar`: groups, header, footer, labels, style). On desktop it renders as a column at the inline-start edge (the right in Arabic). Below 1280 px it collapses into the header menu: its groups and footer are listed in the Nav Header drawer. Omit for pages without a side navigation (e.g. error pages). |
19
+ | `navigation?` | `'expanded' \| 'collapsed'` | — | Figma `Navigation` — side navigation width on desktop. Controlled; pair with `onNavigationChange`. Omit to let the shell manage it. |
20
+ | `defaultNavigation?` | `'expanded' \| 'collapsed'` | 'expanded' | Initial `navigation` when uncontrolled. |
21
+ | `onNavigationChange?` | `(navigation: AppShellNavigation) => void` | — | Called with the next value when the side navigation toggle is pressed. |
22
+ | `menuOpen?` | `boolean` | — | Whether the header menu (the drawer of the compact bar, < 1280 px) is open. Controlled; pair with `onMenuOpenChange`. Omit to let the shell manage it. |
23
+ | `onMenuOpenChange?` | `(open: boolean) => void` | — | Called when the header menu opens or closes: menu button, Escape, a side navigation item chosen from the drawer, or the viewport growing to desktop width. |
24
+ | `contentClassName?` | `string` | — | Extra classes for the content region (`<main>`), e.g. to remove its padding. |
25
+ | `labels?` | `Partial<AppShellLabels>` | — | Override the built-in accessible strings (English defaults). |
26
+ | `dir?` | `'ltr' \| 'rtl'` | — | Layout direction applied to the root. In `rtl` the side navigation sits on the right. Omit to inherit the ambient direction. |
27
+ | `children?` | `ReactNode` | — | Figma `Content` slot — the page content. |
28
+
29
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
30
+
31
+ ## Options (allowed values)
32
+ - `navigation`: `'expanded'` \| `'collapsed'` — Figma `Navigation` — width of the side navigation on desktop (≥ 1280 px).
33
+ - `expanded` → 255 px, icons + labels
34
+ - `collapsed` → 64 px, icons only
35
+ - `defaultNavigation`: `'expanded'` \| `'collapsed'` — Figma `Navigation` — width of the side navigation on desktop (≥ 1280 px).
36
+ - `expanded` → 255 px, icons + labels
37
+ - `collapsed` → 64 px, icons only
38
+ - `dir`: `'ltr'` \| `'rtl'` — Layout direction applied to the root. In `rtl` the side navigation sits
39
+ on the right. Omit to inherit the ambient direction.
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-brand-spacing-space-3)`
49
+ - `var(--ds-brand-spacing-space-4)`
50
+ - `var(--ds-color-bg-canvas)`
51
+ - `var(--ds-color-bg-default)`
52
+ - `var(--ds-color-border-focus)`
53
+ - `var(--ds-color-text-brand)`
54
+ - `var(--ds-radius-m)`
55
+ - `var(--ds-spacing-3xl)`
56
+ - `var(--ds-spacing-md)`
57
+ - `var(--ds-spacing-xl)`
58
+
59
+ ## AI usage guidance
60
+ When generating UI:
61
+ - Install with `npx sdaia-ui@latest add app-shell` (after `npx sdaia-ui@latest init`), then import `{ AppShell }` from `@/components/ui/AppShell`.
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
+ - 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,89 @@
1
+ # Area Chart
2
+
3
+ ## Metadata
4
+ - Component: Area Chart
5
+ - Slug: `area-chart`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add area-chart`
8
+ - Import: `import { AreaChart } from '@/components/ui/AreaChart'`
9
+ - Installed files: `AreaChart.tsx`, `AreaChart.types.ts`, `AreaChart.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/area-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 area-chart`. It copies the source into your components folder (`components/ui/AreaChart/`, under `src/` when the project has one); import it as `@/components/ui/AreaChart`. 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' \| 'Detailed Comparison' \| 'Metric' \| 'Summary'` | 'Insight' | Chart variant. - Insight — dual-area chart with tabs, metric rows, and bottom legend - Detailed Comparison — two overlapping filled areas for comparing series - Metric — compact KPI card: indicator label + value + sparkline (no badge) - Summary — compact KPI card: label + badge (top) + value + sparkline (bottom) |
18
+ | `xAxisData?` | `XAxisDataType` | '7 Week Days' | X-axis label preset. Controls both the axis labels and the number of default data points rendered. All types respect this prop. |
19
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction. In `'rtl'` the chart mirrors: time runs right-to-left (the first category is on the right) and the Y-axis sits on the right. Inherited from the document when omitted. |
20
+ | `locale?` | `string` | — | BCP 47 locale for the x-axis day / month names (Gregorian, via `Intl`) and number formatting in the tooltip, computed Y-axis ticks and data table, e.g. `'ar-SA'`. English names and plain numbers when omitted. |
21
+ | `labels?` | `Partial<AreaChartLabels>` | — | Overrides for the built-in strings (see `AreaChartLabels`). |
22
+ | `height?` | `number` | — | Total root height in px. - Insight defaults to 440 px. - Detailed Comparison defaults to a preset based on `xAxisData`. - Metric and Summary ignore this prop (content-driven height). |
23
+ | `kpiLabel?` | `ReactNode` | — | Indicator label shown above the main value (Metric / Summary / Detailed Comparison). Not rendered when omitted. |
24
+ | `kpiValue?` | `ReactNode` | — | Main KPI value shown in display-xs bold (Metric / Summary / Detailed Comparison). Not rendered when omitted. |
25
+ | `badgeType?` | `ChartBadgeType` | 'increase' | Direction of the ChartBadge delta indicator (Summary only). |
26
+ | `badgeValue?` | `ReactNode` | — | Text inside the ChartBadge (Summary / Detailed Comparison). The badge is not rendered when omitted. |
27
+ | `tabs?` | `HorizontalTabItem[]` | — | Tab items for the HorizontalTabs strip at the top of the Insight card. No tab strip is rendered when omitted. |
28
+ | `activeTab?` | `string` | — | Controlled active tab value (Insight). |
29
+ | `onTabChange?` | `(value: string) => void` | — | Fired when the user selects a different tab (Insight). |
30
+ | `insightRows?` | `AreaChartInsightRow[]` | — | One or two metric rows shown above the chart area (Insight). Each row renders: label, value, and an optional ChartBadge. No rows are rendered when omitted. |
31
+ | `legendLabel1?` | `ReactNode` | labels.seriesName(0) — 'Series 1' | Legend label for Series 1 in the bottom legend strip (Insight). |
32
+ | `legendLabel2?` | `ReactNode` | labels.seriesName(1) — 'Series 2' | Legend label for Series 2 in the bottom legend strip (Insight). |
33
+ | `series1?` | `number[]` | — | Primary (foreground) area values — Insight only (required for a plot). |
34
+ | `series2?` | `number[]` | — | Secondary (background) area values — Insight only (optional). |
35
+ | `yAxisTicks?` | `[string, string, string, string, string, string]` | — | Optional 6-string array used to label the Y-axis ticks (top → bottom). When omitted, ticks are computed from the active dataset's domain. Insight only. |
36
+ | `sparklineData?` | `GraphBaseDataPoint[]` | — | Data forwarded to the embedded sparkline for the Metric, Summary, and Detailed Comparison KPI cards. See `GraphBaseDataPoint` for the shape. The sparkline area stays empty when omitted (no sample data). The sparkline is decorative (`aria-hidden`); the KPI text carries the data. |
37
+
38
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
39
+
40
+ ## Options (allowed values)
41
+ - `type`: `'Insight'` \| `'Detailed Comparison'` \| `'Metric'` \| `'Summary'` — Chart variant.
42
+ - Insight — dual-area chart with tabs, metric rows, and bottom legend
43
+ - Detailed Comparison — two overlapping filled areas for comparing series
44
+ - Metric — compact KPI card: indicator label + value + sparkline (no badge)
45
+ - Summary — compact KPI card: label + badge (top) + value + sparkline (bottom)
46
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction. In `'rtl'` the chart mirrors: time runs right-to-left
47
+ (the first category is on the right) and the Y-axis sits on the right.
48
+ Inherited from the document when omitted.
49
+
50
+ ## Deprecated props
51
+ Do not use in new code:
52
+ - `rtl` — Render in right-to-left orientation.
53
+
54
+ ## Accessibility
55
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
56
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
57
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
58
+
59
+ ## Design tokens used
60
+ Keep these consistent (resolve values with `get_tokens`):
61
+ - `var(--ds-color-bg-brand-muted)`
62
+ - `var(--ds-color-bg-overlay)`
63
+ - `var(--ds-color-bg-raised)`
64
+ - `var(--ds-color-border-default)`
65
+ - `var(--ds-color-border-default-strong)`
66
+ - `var(--ds-color-chart-series-1)`
67
+ - `var(--ds-color-chart-series-2)`
68
+ - `var(--ds-color-text-brand)`
69
+ - `var(--ds-color-text-default)`
70
+ - `var(--ds-color-text-paragraph)`
71
+ - `var(--ds-radius-m)`
72
+ - `var(--ds-spacing-2xl)`
73
+ - `var(--ds-spacing-3xl)`
74
+ - `var(--ds-spacing-4xl)`
75
+ - `var(--ds-spacing-lg)`
76
+ - `var(--ds-spacing-md)`
77
+ - `var(--ds-spacing-xl)`
78
+ - `var(--ds-spacing-xs)`
79
+ - `var(--ds-text-leading-line-heights-display-xs)`
80
+ - `var(--ds-text-leading-line-heights-text-lg)`
81
+ - `var(--ds-text-leading-line-heights-text-md)`
82
+
83
+ ## AI usage guidance
84
+ When generating UI:
85
+ - Install with `npx sdaia-ui@latest add area-chart` (after `npx sdaia-ui@latest init`), then import `{ AreaChart }` from `@/components/ui/AreaChart`.
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
+ - 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,85 @@
1
+ # Audio Player
2
+
3
+ ## Metadata
4
+ - Component: Audio Player
5
+ - Slug: `audio-player`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add audio-player`
8
+ - Import: `import { AudioPlayer } from '@/components/ui/AudioPlayer'`
9
+ - Installed files: `AudioPlayer.tsx`, `AudioPlayer.types.ts`, `AudioPlayer.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/audio-player
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 audio-player`. It copies the source into your components folder (`components/ui/AudioPlayer/`, under `src/` when the project has one); import it as `@/components/ui/AudioPlayer`. 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?` | `'compact' \| 'detailed'` | 'compact' | Layout variant. Default: 'compact'. |
18
+ | `style?` | `'transparent' \| 'neutral' \| 'brand'` | 'transparent' | Visual style. Default: 'transparent'. |
19
+ | `playing?` | `boolean` | — | Whether the player is playing (controlled). Omit to let the component manage its own state. |
20
+ | `defaultPlaying?` | `boolean` | false | Initial playing state when uncontrolled. Default: false. |
21
+ | `progress?` | `number` | — | Playback progress 0–100 (controlled). Omit to let the component manage its own progress. |
22
+ | `defaultProgress?` | `number` | 0 | Initial progress value when uncontrolled. Default: 0. |
23
+ | `currentTime?` | `string` | '0:00' | Current-time display string, e.g. "0:12". |
24
+ | `duration?` | `string` | '0:00' | Total-duration display string, e.g. "2:32". |
25
+ | `audioName?` | `string` | — | Audio track / episode name. Shown in the detailed variant only. Uses dir="auto" so Arabic text self-detects direction. |
26
+ | `onPlay?` | `() => void` | — | Called when the user requests playback to start. |
27
+ | `onPause?` | `() => void` | — | Called when the user requests playback to pause. |
28
+ | `onSkipBack?` | `() => void` | — | Called when the skip-back button is clicked. |
29
+ | `onSkipForward?` | `() => void` | — | Called when the skip-forward button is clicked. |
30
+ | `onProgressChange?` | `(value: number) => void` | — | Called when the user scrubs the progress bar. Receives the new value in the range 0–100. |
31
+ | `muted?` | `boolean` | — | Whether audio is muted (controlled). Omit to let the component manage its own state. |
32
+ | `defaultMuted?` | `boolean` | false | Initial muted state when uncontrolled. Default: false. |
33
+ | `onVolumeClick?` | `() => void` | — | Called when the volume button is clicked. |
34
+ | `onSettingsClick?` | `() => void` | — | Called when the settings button is clicked. |
35
+ | `labels?` | `Partial<AudioPlayerLabels>` | — | Localised copy for every control label (`aria-label` / `aria-valuetext`). Unset keys fall back to English. See . |
36
+ | `dir?` | `'ltr' \| 'rtl'` | — | Layout direction. In `rtl` the row mirrors (play group on the right, progress fills right-to-left, ArrowLeft seeks forward). The time stays LTR. Omit to inherit the direction from the parent. |
37
+
38
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `style`, `dir`.
39
+
40
+ ## Options (allowed values)
41
+ - `type`: `'compact'` \| `'detailed'` — Layout variant.
42
+ - compact — single row; controls + progress inline (616×56 Figma frame)
43
+ - detailed — two rows; audio name on top, progress + controls below (504×72 Figma frame)
44
+ - `style`: `'transparent'` \| `'neutral'` \| `'brand'` — Visual style of the audio player shell.
45
+ - `dir`: `'ltr'` \| `'rtl'` — Layout direction. In `rtl` the row mirrors (play group on the right,
46
+ progress fills right-to-left, ArrowLeft seeks forward). The time stays LTR.
47
+ Omit to inherit the direction from the parent.
48
+
49
+ ## Deprecated props
50
+ Do not use in new code:
51
+ - `rtl`
52
+
53
+ ## Accessibility
54
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
55
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
56
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
57
+
58
+ ## Design tokens used
59
+ Keep these consistent (resolve values with `get_tokens`):
60
+ - `var(--ds-color-bg-brand)`
61
+ - `var(--ds-color-bg-default)`
62
+ - `var(--ds-color-bg-emphasis-strong)`
63
+ - `var(--ds-color-border-default)`
64
+ - `var(--ds-color-border-strong)`
65
+ - `var(--ds-color-icon-neutral)`
66
+ - `var(--ds-color-icon-oncolor)`
67
+ - `var(--ds-color-text-on-color)`
68
+ - `var(--ds-color-text-paragraph)`
69
+ - `var(--ds-radius-m)`
70
+ - `var(--ds-radius-xxs)`
71
+ - `var(--ds-spacing-lg)`
72
+ - `var(--ds-spacing-md)`
73
+ - `var(--ds-spacing-xs)`
74
+ - `var(--ds-text-leading-line-heights-text-md)`
75
+ - `var(--ds-text-leading-line-heights-text-sm)`
76
+ - `var(--ds-themes-media-media-background-play-neutral)`
77
+ - `var(--ds-themes-media-media-background-transparent)`
78
+ - `var(--ds-themes-media-media-track-bg)`
79
+
80
+ ## AI usage guidance
81
+ When generating UI:
82
+ - Install with `npx sdaia-ui@latest add audio-player` (after `npx sdaia-ui@latest init`), then import `{ AudioPlayer }` from `@/components/ui/AudioPlayer`.
83
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
84
+ - Use only the documented option values listed under "Options".
85
+ - 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,50 @@
1
+ # AvatarGroup
2
+
3
+ ## Metadata
4
+ - Component: AvatarGroup
5
+ - Slug: `avatar-group`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add avatar-group`
8
+ - Import: `import { AvatarGroup } from '@/components/ui/AvatarGroup'`
9
+ - Installed files: `AvatarGroup.tsx`, `AvatarGroup.types.ts`, `AvatarGroup.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/avatargroup
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 avatar-group`. It copies the source into your components folder (`components/ui/AvatarGroup/`, under `src/` when the project has one); import it as `@/components/ui/AvatarGroup`. 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?` | `'group' \| 'individual'` | 'group' | Layout mode. - `group` (default): avatars overlap in a stack via a negative inline margin. - `individual`: avatars are spaced side-by-side. |
18
+ | `items` | `AvatarGroupItem[]` | — | Avatars to render, in visual stacking order (first = on top). |
19
+ | `max?` | `number` | — | Maximum number of avatars to render before collapsing the rest into a `+N` counter. If omitted, every item in `items` is rendered. |
20
+ | `size?` | `AvatarSize` | 'md' | Size applied to every avatar in the group. |
21
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
22
+ | `labels?` | `Partial<AvatarGroupLabels>` | — | Override built-in strings (English defaults) to localize the group. |
23
+
24
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`, `dir`.
25
+
26
+ ## Options (allowed values)
27
+ - `type`: `'group'` \| `'individual'` — Layout mode.
28
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
29
+
30
+ ## Deprecated props
31
+ Do not use in new code:
32
+ - `rtl`
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-border-brand)`
42
+ - `var(--ds-radius-full)`
43
+ - `var(--ds-spacing-md)`
44
+
45
+ ## AI usage guidance
46
+ When generating UI:
47
+ - Install with `npx sdaia-ui@latest add avatar-group` (after `npx sdaia-ui@latest init`), then import `{ AvatarGroup }` from `@/components/ui/AvatarGroup`.
48
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
49
+ - Use only the documented option values listed under "Options".
50
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,61 @@
1
+ # Avatar
2
+
3
+ ## Metadata
4
+ - Component: Avatar
5
+ - Slug: `avatar`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add avatar`
8
+ - Import: `import { Avatar } from '@/components/ui/Avatar'`
9
+ - Installed files: `Avatar.tsx`, `Avatar.types.ts`, `Avatar.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/avatar
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 avatar`. It copies the source into your components folder (`components/ui/Avatar/`, under `src/` when the project has one); import it as `@/components/ui/Avatar`. 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
+ | `size?` | `'sm' \| 'md' \| 'lg' \| 'xl'` | 'md' | Size tier |
18
+ | `type?` | `'initials' \| 'icon' \| 'image'` | 'initials' | Content type |
19
+ | `shape?` | `'round' \| 'square'` | 'round' | Shape |
20
+ | `initials?` | `string` | — | Initials text — used when `type="initials"`. The first two characters will be uppercased and shown. A value starting with `+` (an overflow counter such as `+12`) is shown in full. |
21
+ | `src?` | `string` | — | Image source — used when `type="image"`. When omitted, the avatar renders its neutral background only (no sample picture). |
22
+ | `alt?` | `string` | '' | Alt text for the image — used when `type="image"` |
23
+ | `icon?` | `ReactNode` | — | Custom icon — replaces the default user glyph when `type="icon"` |
24
+ | `statusDot?` | `boolean` | false | Shows the status indicator overlay |
25
+ | `background?` | `boolean` | true | Shows the inner neutral background fill. |
26
+ | `border?` | `boolean` | true | Shows the outer ring border. |
27
+ | `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
28
+
29
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
30
+
31
+ ## Options (allowed values)
32
+ - `size`: `'sm'` \| `'md'` \| `'lg'` \| `'xl'` — Visual size tier
33
+ - `type`: `'initials'` \| `'icon'` \| `'image'` — Content type
34
+ - `shape`: `'round'` \| `'square'` — Shape: round (circle) or rounded-square
35
+ - `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
36
+
37
+ ## Accessibility
38
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
39
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
40
+
41
+ ## Design tokens used
42
+ Keep these consistent (resolve values with `get_tokens`):
43
+ - `var(--ds-color-bg-emphasis-low)`
44
+ - `var(--ds-color-border-subtle)`
45
+ - `var(--ds-color-icon-default)`
46
+ - `var(--ds-color-text-default)`
47
+ - `var(--ds-radius-full)`
48
+ - `var(--ds-radius-xxs)`
49
+ - `var(--ds-spacing-md)`
50
+ - `var(--ds-spacing-xs)`
51
+ - `var(--ds-text-leading-line-heights-text-md)`
52
+ - `var(--ds-text-leading-line-heights-text-sm)`
53
+ - `var(--ds-text-leading-line-heights-text-xs)`
54
+
55
+ ## AI usage guidance
56
+ When generating UI:
57
+ - Install with `npx sdaia-ui@latest add avatar` (after `npx sdaia-ui@latest init`), then import `{ Avatar }` from `@/components/ui/Avatar`.
58
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
59
+ - Use only the documented option values listed under "Options".
60
+ - 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).
61
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
@@ -0,0 +1,103 @@
1
+ # Carousel Image
2
+
3
+ ## Metadata
4
+ - Component: Carousel Image
5
+ - Slug: `carousel-image`
6
+ - Category: General
7
+ - Install: `npx sdaia-ui@latest add carousel-image`
8
+ - Import: `import { CarouselImage } from '@/components/ui/CarouselImage'`
9
+ - Installed files: `CarouselImage.tsx`, `CarouselImage.types.ts`, `CarouselImage.variants.ts`, `index.ts`
10
+ - Docs: https://ds.nacew.com/components/carouseimage
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 carousel-image`. It copies the source into your components folder (`components/ui/CarouselImage/`, under `src/` when the project has one); import it as `@/components/ui/CarouselImage`. 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 — pass `'rtl'` for Arabic/Hebrew contexts. When omitted it is inherited from an ancestor. |
18
+ | `images` | `CarouselImageItem[]` | — | Images to display, one per slide. |
19
+ | `activeIndex?` | `number` | — | Controlled active index. |
20
+ | `defaultIndex?` | `number` | 0 | Initial slide index when uncontrolled. |
21
+ | `onChange?` | `(index: number) => void` | — | Called whenever the active slide changes. |
22
+ | `loop?` | `boolean` | true | Wrap around when navigating past the first/last slide. |
23
+ | `autoplayMs?` | `number` | — | Auto-advance interval in ms. 0 / undefined disables autoplay. Autoplay pauses while the pointer is over the carousel or focus is inside it. |
24
+ | `showArrows?` | `boolean` | true | Show arrow buttons. |
25
+ | `showDots?` | `boolean` | true | Show pagination dots. |
26
+ | `overlay?` | `boolean` | true | When true, arrows and dots overlay the image (image fills the entire card). When false, arrows sit on the sides and dots sit below the image. |
27
+ | `size?` | `'sm' \| 'md' \| 'full'` | 'md' | Size preset from the Figma spec. Sets the inline max-width and a matching aspect ratio so the carousel never balloons to the full page width. Pass `'full'` to opt out of the constraint. |
28
+ | `arrowVariant?` | `CarouselArrowVariant` | 'brand' | Visual style of the arrows. |
29
+ | `arrowSize?` | `CarouselArrowSize` | 'md' | Size of the arrows. |
30
+ | `dotsVariant?` | `CarouselControlsGroupStyle` | 'brand' | Visual style of the pagination dots. |
31
+ | `dotsSize?` | `CarouselControlsGroupSize` | 'sm' | Size of the pagination dots. |
32
+ | `radiusClassName?` | `string` | 'rounded-[var(--ds-radius-m)]' | Border radius class applied to the viewport. |
33
+ | `ariaLabel?` | `string` | — | Accessible label for the carousel region. Takes precedence over `labels.carousel`. |
34
+ | `labels?` | `Partial<CarouselImageLabels>` | — | Translatable accessible text (English defaults). |
35
+
36
+ Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `onChange`, `dir`.
37
+
38
+ ## Options (allowed values)
39
+ - `dir`: `'ltr'` \| `'rtl'` — Layout direction — pass `'rtl'` for Arabic/Hebrew contexts. When omitted
40
+ it is inherited from an ancestor.
41
+ - `size`: `'sm'` \| `'md'` \| `'full'` — Size presets matching Figma node 4455:37316 `Carousel Image`:
42
+ `sm` — max-w 360px (Figma overlay dimensions)
43
+ `md` — max-w 418px (Figma side-arrows dimensions, default)
44
+ `full` — fills the parent's inline size with no max-width
45
+
46
+ ## Placeholder images (demos & prototypes)
47
+
48
+ For mockups and AI-generated pages, use **real photo URLs** with a **free license** — not broken `example.com` links or colored divs. Each slide needs `src` + **`alt`** (required).
49
+
50
+ **Recommended source:** [Unsplash](https://unsplash.com) — [Unsplash License](https://unsplash.com/license): free for commercial and personal use; attribution appreciated but not required. Use `images.unsplash.com` URLs only for **prototypes**; for production, download and self-host (or use your product CDN).
51
+
52
+ **Tech-themed examples** (copy as-is):
53
+
54
+ ```tsx
55
+ <CarouselImage
56
+ size="md"
57
+ ariaLabel="Technology showcase"
58
+ images={[
59
+ {
60
+ src: 'https://images.unsplash.com/photo-1518770660439-4636190af475?w=800&h=450&fit=crop',
61
+ alt: 'Circuit board and electronic components close-up',
62
+ },
63
+ {
64
+ src: 'https://images.unsplash.com/photo-1485827404703-89b55fcc595e?w=800&h=450&fit=crop',
65
+ alt: 'White humanoid robot on a neutral background',
66
+ },
67
+ {
68
+ src: 'https://images.unsplash.com/photo-1498050108023-c5249f4df085?w=800&h=450&fit=crop',
69
+ alt: 'Laptop displaying code on a desk with coffee',
70
+ },
71
+ ]}
72
+ />
73
+ ```
74
+
75
+ | Slide | License | Notes |
76
+ | --- | --- | --- |
77
+ | Circuit / hardware | Unsplash License | `photo-1518770660439` |
78
+ | Robotics / AI | Unsplash License | `photo-1485827404703` |
79
+ | Developer / laptop | Unsplash License | `photo-1498050108023` |
80
+
81
+ **Alternative (generic, not tech-specific):** [Lorem Picsum](https://picsum.photos/) — `https://picsum.photos/seed/carousel-1/800/450` (change `seed` per slide).
82
+
83
+ Do not use copyrighted stock, watermarked URLs, or random Google Images links.
84
+
85
+ ## Accessibility
86
+ - Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
87
+ - Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
88
+ - For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
89
+
90
+ ## Design tokens used
91
+ Keep these consistent (resolve values with `get_tokens`):
92
+ - `var(--ds-color-bg-muted)`
93
+ - `var(--ds-motion-transition-duration)`
94
+ - `var(--ds-motion-transition-easing)`
95
+ - `var(--ds-spacing-xl)`
96
+
97
+ ## AI usage guidance
98
+ When generating UI:
99
+ - Install with `npx sdaia-ui@latest add carousel-image` (after `npx sdaia-ui@latest init`), then import `{ CarouselImage }` from `@/components/ui/CarouselImage`.
100
+ - NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
101
+ - Use only the documented option values listed under "Options".
102
+ - For demos, use the licensed Unsplash URLs in **Placeholder images** (2–3 slides with real `alt` text) — never placeholder.com or invented image paths.
103
+ - Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.