@sdaia-ds/mcp 0.0.0-stage → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +291 -0
- package/dist/index.js.map +1 -0
- package/knowledge/actions/breadcrumb.md +50 -0
- package/knowledge/actions/button-menu.md +82 -0
- package/knowledge/actions/button-split.md +69 -0
- package/knowledge/actions/button.md +101 -0
- package/knowledge/actions/content-switcher.md +66 -0
- package/knowledge/actions/date-picker.md +115 -0
- package/knowledge/actions/floating-button.md +100 -0
- package/knowledge/actions/horizontal-tabs.md +52 -0
- package/knowledge/actions/link.md +76 -0
- package/knowledge/actions/modal.md +103 -0
- package/knowledge/actions/pagination.md +69 -0
- package/knowledge/actions/radio-button.md +88 -0
- package/knowledge/actions/switch.md +87 -0
- package/knowledge/actions/tag.md +69 -0
- package/knowledge/ai/agent-activity.md +65 -0
- package/knowledge/ai/agent-card.md +65 -0
- package/knowledge/ai/agent-handoff.md +65 -0
- package/knowledge/ai/ai-citation.md +78 -0
- package/knowledge/ai/ai-code-block.md +86 -0
- package/knowledge/ai/ai-disclaimer.md +84 -0
- package/knowledge/ai/ai-message-bubble.md +81 -0
- package/knowledge/ai/ai-message.md +118 -0
- package/knowledge/ai/ai-prompt-input.md +93 -0
- package/knowledge/ai/ai-states.md +107 -0
- package/knowledge/ai/ai-status-indicator.md +81 -0
- package/knowledge/ai/ai-suggested-prompts.md +62 -0
- package/knowledge/ai/ai-thinking-indicator.md +94 -0
- package/knowledge/ai/artifact-viewer.md +105 -0
- package/knowledge/ai/citation.md +61 -0
- package/knowledge/ai/context-manager.md +111 -0
- package/knowledge/ai/prompt-context.md +72 -0
- package/knowledge/ai/prompt-suggestion.md +68 -0
- package/knowledge/ai/prompt-template.md +71 -0
- package/knowledge/ai/prompt-variable.md +61 -0
- package/knowledge/ai/reasoning-trace.md +106 -0
- package/knowledge/ai/source-explorer.md +117 -0
- package/knowledge/ai/source-group.md +59 -0
- package/knowledge/ai/source-reference.md +70 -0
- package/knowledge/ai/thinking-panel.md +77 -0
- package/knowledge/ai/tool-activity-feed.md +67 -0
- package/knowledge/ai/tool-call-card.md +66 -0
- package/knowledge/ai/tool-status-row.md +72 -0
- package/knowledge/ai/tool-timeline-item.md +71 -0
- package/knowledge/ai/voice-session.md +93 -0
- package/knowledge/feedback/alert.md +106 -0
- package/knowledge/feedback/badge.md +86 -0
- package/knowledge/feedback/card.md +54 -0
- package/knowledge/feedback/feedback-overview.md +37 -0
- package/knowledge/feedback/feedback.md +46 -0
- package/knowledge/feedback/help-icon.md +57 -0
- package/knowledge/feedback/loading-indicator.md +76 -0
- package/knowledge/feedback/notification-banner.md +73 -0
- package/knowledge/feedback/notification-popup.md +87 -0
- package/knowledge/feedback/notifications.md +158 -0
- package/knowledge/feedback/progress-bar.md +69 -0
- package/knowledge/feedback/rating-overview.md +58 -0
- package/knowledge/feedback/rating.md +64 -0
- package/knowledge/feedback/skeleton-avatar.md +48 -0
- package/knowledge/feedback/skeleton.md +53 -0
- package/knowledge/feedback/toast.md +74 -0
- package/knowledge/feedback/tooltip.md +72 -0
- package/knowledge/form/autocomplete.md +100 -0
- package/knowledge/form/checkbox.md +95 -0
- package/knowledge/form/date-time-field.md +63 -0
- package/knowledge/form/error-summary.md +56 -0
- package/knowledge/form/field-group.md +57 -0
- package/knowledge/form/file-uploader.md +60 -0
- package/knowledge/form/form-section.md +58 -0
- package/knowledge/form/number-input.md +92 -0
- package/knowledge/form/otp-input.md +83 -0
- package/knowledge/form/password-input.md +49 -0
- package/knowledge/form/range-slider.md +71 -0
- package/knowledge/form/rich-text-editor.md +106 -0
- package/knowledge/form/select.md +113 -0
- package/knowledge/form/signature.md +83 -0
- package/knowledge/form/slider.md +66 -0
- package/knowledge/form/text-area.md +90 -0
- package/knowledge/form/text-input.md +132 -0
- package/knowledge/form/time-input.md +44 -0
- package/knowledge/form/time-picker.md +73 -0
- package/knowledge/foundations/accessibility.md +97 -0
- package/knowledge/foundations/colors.md +1117 -0
- package/knowledge/foundations/figma.md +30 -0
- package/knowledge/foundations/icon-usage.md +114 -0
- package/knowledge/foundations/icons.md +16 -0
- package/knowledge/foundations/motion.md +39 -0
- package/knowledge/foundations/radius.md +17 -0
- package/knowledge/foundations/responsive.md +64 -0
- package/knowledge/foundations/rtl.md +106 -0
- package/knowledge/foundations/spacing.md +27 -0
- package/knowledge/foundations/theme.md +115 -0
- package/knowledge/foundations/tokens.json +12124 -0
- package/knowledge/foundations/typography.md +45 -0
- package/knowledge/general/accordion.md +79 -0
- package/knowledge/general/activity.md +44 -0
- package/knowledge/general/app-shell.md +64 -0
- package/knowledge/general/area-chart.md +89 -0
- package/knowledge/general/audio-player.md +85 -0
- package/knowledge/general/avatar-group.md +50 -0
- package/knowledge/general/avatar.md +61 -0
- package/knowledge/general/carousel-image.md +103 -0
- package/knowledge/general/chart.md +25 -0
- package/knowledge/general/chip.md +90 -0
- package/knowledge/general/code-snippet.md +80 -0
- package/knowledge/general/column-chart.md +84 -0
- package/knowledge/general/context-menu.md +55 -0
- package/knowledge/general/digital-stamp.md +77 -0
- package/knowledge/general/divider.md +65 -0
- package/knowledge/general/donut-chart.md +75 -0
- package/knowledge/general/draggable-list.md +43 -0
- package/knowledge/general/dropdown.md +90 -0
- package/knowledge/general/empty-state.md +60 -0
- package/knowledge/general/filtration.md +85 -0
- package/knowledge/general/footer.md +59 -0
- package/knowledge/general/line-chart.md +95 -0
- package/knowledge/general/list.md +91 -0
- package/knowledge/general/media-gallery.md +85 -0
- package/knowledge/general/media-viewer.md +78 -0
- package/knowledge/general/menu.md +66 -0
- package/knowledge/general/metric.md +92 -0
- package/knowledge/general/nav-bar.md +62 -0
- package/knowledge/general/nav-header.md +125 -0
- package/knowledge/general/number.md +72 -0
- package/knowledge/general/page-template.md +80 -0
- package/knowledge/general/pdf-viewer.md +91 -0
- package/knowledge/general/pie-chart-panel.md +86 -0
- package/knowledge/general/popover.md +115 -0
- package/knowledge/general/progress-circle.md +63 -0
- package/knowledge/general/quote.md +64 -0
- package/knowledge/general/radial-stepper.md +72 -0
- package/knowledge/general/scatter-chart.md +62 -0
- package/knowledge/general/second-nav-header.md +55 -0
- package/knowledge/general/slideout-menu.md +92 -0
- package/knowledge/general/stepper.md +42 -0
- package/knowledge/general/structured-list.md +52 -0
- package/knowledge/general/table-bulk-actions-bar.md +66 -0
- package/knowledge/general/table-of-content.md +49 -0
- package/knowledge/general/table.md +113 -0
- package/knowledge/general/tree-view.md +55 -0
- package/knowledge/general/vertical-tabs.md +48 -0
- package/knowledge/general/video-player.md +88 -0
- package/knowledge/manifest.json +919 -0
- package/knowledge/patterns/buttons-with-sdaia-touch.md +34 -0
- package/knowledge/patterns/sdaia-logo-animation.md +35 -0
- package/knowledge/patterns/switch-with-sdaia-touch.md +29 -0
- package/knowledge/setup.md +125 -0
- package/package.json +45 -4
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# PDF Viewer
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: PDF Viewer
|
|
5
|
+
- Slug: `pdf-viewer`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add pdf-viewer`
|
|
8
|
+
- Import: `import { PdfViewer } from '@/components/ui/PdfViewer'`
|
|
9
|
+
- Installed files: `PdfViewer.tsx`, `PdfViewer.types.ts`, `PdfViewer.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/pdf-viewer
|
|
11
|
+
|
|
12
|
+
> **Hard rule:** `sdaia-ui` is a CLI, not a runtime package — NEVER run `npm install sdaia-ui` and NEVER `import … from 'sdaia-ui'`. Run `npx sdaia-ui@latest init` once per project (Tailwind CSS v4, tokens, the IBM Plex Sans Arabic font, the `@/` alias on Vite, `cn`), then `npx sdaia-ui@latest add pdf-viewer`. It copies the source into your components folder (`components/ui/PdfViewer/`, under `src/` when the project has one); import it as `@/components/ui/PdfViewer`. 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
|
+
| `breakpoint?` | `'desktop' \| 'tablet' \| 'mobile'` | 'desktop' | Visual breakpoint style from the Figma component. |
|
|
18
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Forces a direction on the component root (defaults to inheriting). |
|
|
19
|
+
| `labels?` | `Partial<PdfViewerLabels>` | — | Translatable built-in text. Unset keys use the English defaults. |
|
|
20
|
+
| `showHeader?` | `boolean` | true | Shows the top header area. |
|
|
21
|
+
| `headerTitle?` | `ReactNode` | — | Main header title (centered). Note: We intentionally avoid the prop name `title` because it conflicts with the native HTML `title` attribute on div elements. |
|
|
22
|
+
| `headerSubtitle?` | `ReactNode` | — | Header subtitle (centered, e.g. file size). |
|
|
23
|
+
| `infoItems?` | `PdfViewerInfoItem[]` | [] | Optional info items shown under the title (e.g. number/date). |
|
|
24
|
+
| `showCloseButton?` | `boolean` | true | Shows the close button in the header. |
|
|
25
|
+
| `onClose?` | `() => void` | — | Called when the close button is clicked. |
|
|
26
|
+
| `showPrimaryAction?` | `boolean` | true | Shows the primary header action button (download in Figma). |
|
|
27
|
+
| `onPrimaryAction?` | `() => void` | — | Called when the primary action button is clicked. |
|
|
28
|
+
| `showZoomControls?` | `boolean` | true | Shows the bottom zoom controls bar. |
|
|
29
|
+
| `zoom?` | `number` | — | Zoom percentage (controlled). When provided, the zoom buttons will call `onZoomChange` but will not manage internal state. |
|
|
30
|
+
| `defaultZoom?` | `number` | 100 | Initial zoom percentage (uncontrolled). |
|
|
31
|
+
| `minZoom?` | `number` | 25 | Minimum zoom percentage. |
|
|
32
|
+
| `maxZoom?` | `number` | 200 | Maximum zoom percentage. |
|
|
33
|
+
| `zoomStep?` | `number` | 25 | Zoom step used by +/- buttons. |
|
|
34
|
+
| `onZoomChange?` | `(zoom: number) => void` | — | Called whenever zoom changes (both controlled & uncontrolled). |
|
|
35
|
+
| `zoomLabel?` | `ReactNode` | — | Override the label shown in the zoom dropdown (defaults to `${zoom}%`). |
|
|
36
|
+
| `onZoomOut?` | `() => void` | — | Called when the "zoom out" control is clicked (in addition to zoom changing). |
|
|
37
|
+
| `onZoomIn?` | `() => void` | — | Called when the "zoom in" control is clicked (in addition to zoom changing). |
|
|
38
|
+
| `onZoomFit?` | `() => void` | — | Called when the "fit" (reset) control is clicked (in addition to zoom changing). |
|
|
39
|
+
| `onZoomMenu?` | `() => void` | — | Called when the zoom dropdown is clicked. |
|
|
40
|
+
| `children?` | `ReactNode` | — | Main content rendered under the header. |
|
|
41
|
+
|
|
42
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
|
|
43
|
+
|
|
44
|
+
## Options (allowed values)
|
|
45
|
+
- `breakpoint`: `'desktop'` \| `'tablet'` \| `'mobile'` — Visual breakpoint style from the Figma component.
|
|
46
|
+
- `dir`: `'ltr'` \| `'rtl'` — Forces a direction on the component root (defaults to inheriting).
|
|
47
|
+
|
|
48
|
+
## Deprecated props
|
|
49
|
+
Do not use in new code:
|
|
50
|
+
- `closeLabel` — Accessible label for the close button.
|
|
51
|
+
- `primaryActionLabel` — Primary action label.
|
|
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-canvas)`
|
|
61
|
+
- `var(--ds-color-bg-emphasis-high)`
|
|
62
|
+
- `var(--ds-color-bg-emphasis-low)`
|
|
63
|
+
- `var(--ds-color-bg-emphasis-strong)`
|
|
64
|
+
- `var(--ds-color-border-default)`
|
|
65
|
+
- `var(--ds-color-icon-oncolor)`
|
|
66
|
+
- `var(--ds-color-text-brand)`
|
|
67
|
+
- `var(--ds-color-text-display)`
|
|
68
|
+
- `var(--ds-color-text-on-color)`
|
|
69
|
+
- `var(--ds-color-text-paragraph)`
|
|
70
|
+
- `var(--ds-motion-feedback-duration)`
|
|
71
|
+
- `var(--ds-motion-feedback-easing)`
|
|
72
|
+
- `var(--ds-radius-m)`
|
|
73
|
+
- `var(--ds-radius-xs)`
|
|
74
|
+
- `var(--ds-spacing-2xl)`
|
|
75
|
+
- `var(--ds-spacing-3xl)`
|
|
76
|
+
- `var(--ds-spacing-5xl)`
|
|
77
|
+
- `var(--ds-spacing-6xl)`
|
|
78
|
+
- `var(--ds-spacing-9xl)`
|
|
79
|
+
- `var(--ds-spacing-lg)`
|
|
80
|
+
- `var(--ds-spacing-md)`
|
|
81
|
+
- `var(--ds-spacing-sm)`
|
|
82
|
+
- `var(--ds-spacing-xl)`
|
|
83
|
+
- `var(--ds-spacing-xs)`
|
|
84
|
+
- `var(--ds-spacing-xxs)`
|
|
85
|
+
|
|
86
|
+
## AI usage guidance
|
|
87
|
+
When generating UI:
|
|
88
|
+
- Install with `npx sdaia-ui@latest add pdf-viewer` (after `npx sdaia-ui@latest init`), then import `{ PdfViewer }` from `@/components/ui/PdfViewer`.
|
|
89
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
90
|
+
- Use only the documented option values listed under "Options".
|
|
91
|
+
- 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,86 @@
|
|
|
1
|
+
# Pie Chart
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Pie Chart
|
|
5
|
+
- Slug: `pie-chart-panel`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add pie-chart-panel`
|
|
8
|
+
- Import: `import { PieChartPanel } from '@/components/ui/PieChartPanel'`
|
|
9
|
+
- Installed files: `PieChartPanel.tsx`, `PieChartPanel.types.ts`, `PieChartPanel.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/pie-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 pie-chart-panel`. It copies the source into your components folder (`components/ui/PieChartPanel/`, under `src/` when the project has one); import it as `@/components/ui/PieChartPanel`. The files are yours: prefer props and composition over editing them. `npx sdaia-ui@latest update` never overwrites a file you changed: it keeps it and says it has updates; `diff` shows them and `update --force` takes them.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `variant?` | `'SummaryView' \| 'IndicatorView' \| 'HeroView' \| 'BreakdownPanel' \| 'ComparisonView' \| 'LegendBlock' \| 'LabeledView' \| 'AnnotatedView' \| 'OverviewPanel' \| 'CompactPanel'` | 'SummaryView' | Which layout variant to render. |
|
|
18
|
+
| `title?` | `string` | — | Card title (Display sm / Bold). Also the panel's accessible name. Every text prop below is optional: nothing is rendered for a prop you omit (no placeholder copy). Without `series` the pie shows its no-data state (`labels.noData`). |
|
|
19
|
+
| `note?` | `string` | — | Subtitle / note below the title (Text md / Regular, secondary) |
|
|
20
|
+
| `indicatorName?` | `string` | — | Indicator name label |
|
|
21
|
+
| `indicatorValue?` | `string` | — | Primary metric value e.g. "422.61" |
|
|
22
|
+
| `badgeValue?` | `string` | — | Badge percentage e.g. "12%" |
|
|
23
|
+
| `badgeDirection?` | `'up' \| 'down'` | 'up' | Arrow direction — 'up' = green positive, 'down' = red negative |
|
|
24
|
+
| `dateBadge?` | `string` | — | Date string rendered in a pill e.g. "26/02/2026" |
|
|
25
|
+
| `optionsLabel?` | `string` | labels.options ('Options') | Label for the Options dropdown button in OverviewPanel. |
|
|
26
|
+
| `menuOptions?` | `string[]` | — | List of option labels shown in the Options dropdown (OverviewPanel). When provided the button becomes interactive and opens a menu on click. |
|
|
27
|
+
| `activeOption?` | `string` | — | Currently active option — should match one of the `menuOptions` strings. |
|
|
28
|
+
| `onOptionSelect?` | `(option: string) => void` | — | Called when the user selects an option from the dropdown. |
|
|
29
|
+
| `series?` | `PieChartPanelItem[]` | — | Series items used to build the pie chart + legend / data rows. Max 6 items; each has `label`, `value`, `change`, `percentage`, `color`. |
|
|
30
|
+
| `tabs?` | `PieChartPanelTab[]` | — | Tab items for LabeledView / AnnotatedView |
|
|
31
|
+
| `onTabChange?` | `(index: number) => void` | — | Fired when a tab is clicked |
|
|
32
|
+
| `progress?` | `number` | — | Playback progress 0-100 for the CompactPanel scrubber (controlled). Omit to let the component manage its own scrubber position. |
|
|
33
|
+
| `defaultProgress?` | `number` | 0 | Initial scrubber progress when uncontrolled. |
|
|
34
|
+
| `currentTime?` | `string` | '0:00' | Current-time display string for CompactPanel, e.g. "0:12". |
|
|
35
|
+
| `duration?` | `string` | '0:00' | Total-duration display string for CompactPanel, e.g. "2:32". |
|
|
36
|
+
| `onProgressChange?` | `(value: number) => void` | — | Called when the user scrubs the CompactPanel progress bar. Receives the new value in the range 0-100. |
|
|
37
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction of the panel. In RTL the layout mirrors (logical spacing, data-row borders on the right, scrubber fills from the right) and the pie runs counter-clockwise. When omitted, the inherited direction is used. |
|
|
38
|
+
| `labels?` | `Partial<PieChartPanelLabels>` | — | Translatable built-in strings (button names, scrubber, no-data message, data-table headers). |
|
|
39
|
+
|
|
40
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`, `title`.
|
|
41
|
+
|
|
42
|
+
## Options (allowed values)
|
|
43
|
+
- `variant`: `'SummaryView'` \| `'IndicatorView'` \| `'HeroView'` \| `'BreakdownPanel'` \| `'ComparisonView'` \| `'LegendBlock'` \| `'LabeledView'` \| `'AnnotatedView'` \| `'OverviewPanel'` \| `'CompactPanel'` — Which layout variant to render.
|
|
44
|
+
- `badgeDirection`: `'up'` \| `'down'` — Arrow direction — 'up' = green positive, 'down' = red negative
|
|
45
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction of the panel. In RTL the layout mirrors (logical spacing,
|
|
46
|
+
data-row borders on the right, scrubber fills from the right) and the pie
|
|
47
|
+
runs counter-clockwise. When omitted, the inherited direction is used.
|
|
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-raised)`
|
|
61
|
+
- `var(--ds-color-border-default)`
|
|
62
|
+
- `var(--ds-color-border-strong)`
|
|
63
|
+
- `var(--ds-color-button-bg-neutral-default)`
|
|
64
|
+
- `var(--ds-color-chart-series-1)`
|
|
65
|
+
- `var(--ds-color-chart-series-2)`
|
|
66
|
+
- `var(--ds-color-chart-series-3)`
|
|
67
|
+
- `var(--ds-color-text-default)`
|
|
68
|
+
- `var(--ds-color-text-paragraph)`
|
|
69
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
70
|
+
- `var(--ds-radius-m)`
|
|
71
|
+
- `var(--ds-radius-xs)`
|
|
72
|
+
- `var(--ds-radius-xxs)`
|
|
73
|
+
- `var(--ds-spacing-md)`
|
|
74
|
+
- `var(--ds-spacing-sm)`
|
|
75
|
+
- `var(--ds-spacing-xl)`
|
|
76
|
+
- `var(--ds-text-leading-line-heights-text-sm)`
|
|
77
|
+
- `var(--ds-themes-chart-chart-series-4)`
|
|
78
|
+
- `var(--ds-themes-chart-chart-series-5)`
|
|
79
|
+
- `var(--ds-themes-chart-chart-series-6)`
|
|
80
|
+
|
|
81
|
+
## AI usage guidance
|
|
82
|
+
When generating UI:
|
|
83
|
+
- Install with `npx sdaia-ui@latest add pie-chart-panel` (after `npx sdaia-ui@latest init`), then import `{ PieChartPanel }` from `@/components/ui/PieChartPanel`.
|
|
84
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
85
|
+
- Use only the documented option values listed under "Options".
|
|
86
|
+
- 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,115 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Popover
|
|
5
|
+
- Slug: `popover`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add popover`
|
|
8
|
+
- Import: `import { Popover } from '@/components/ui/Popover'`
|
|
9
|
+
- Installed files: `Popover.tsx`, `Popover.types.ts`, `Popover.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/popover
|
|
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 popover`. It copies the source into your components folder (`components/ui/Popover/`, under `src/` when the project has one); import it as `@/components/ui/Popover`. 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
|
+
| `open?` | `boolean` | — | Whether the popover panel is visible (controlled mode). |
|
|
18
|
+
| `defaultOpen?` | `boolean` | false | Initial open state for uncontrolled mode. |
|
|
19
|
+
| `onOpenChange?` | `(open: boolean) => void` | — | Called when the open state changes (close button click, outside click, Escape). |
|
|
20
|
+
| `trigger?` | `ReactNode` | — | The element that opens/closes the popover on click. When omitted, a default trigger is rendered based on `triggerType`. Pass a single focusable element (e.g. a `<Button>`): it receives `aria-expanded`, `aria-haspopup="dialog"` and `aria-controls`, and focus returns to it when the popover closes. |
|
|
21
|
+
| `triggerType?` | `'button' \| 'link'` | 'button' | Whether the default built-in trigger is a Button or a Link. Only used when `trigger` is not provided. |
|
|
22
|
+
| `triggerLabel?` | `string` | — | Label on the default trigger element. Only used when `trigger` is not provided. Falls back to `labels.trigger`. |
|
|
23
|
+
| `featuredIcon?` | `ReactNode` | — | Custom circular-badge icon shown above the title in the panel. |
|
|
24
|
+
| `title?` | `string` | — | Semibold title text at the top of the panel body. |
|
|
25
|
+
| `helperText?` | `ReactNode` | — | Primary body text (text-sm / regular). |
|
|
26
|
+
| `supportingText?` | `ReactNode` | — | Secondary body text (text-xs / regular, muted). |
|
|
27
|
+
| `image?` | `string \| ReactNode` | — | Image content rendered between supporting text and instance rows. Accepts either: - A `string` URL (rendered as `<img src={...} />`), or - A `ReactNode` (e.g. a pre-composed `<img>` or `<Image>` component). |
|
|
28
|
+
| `imageAlt?` | `string` | '' | Accessible alt text for the image when `image` is a URL string. |
|
|
29
|
+
| `instanceRows?` | `ReactNode` | — | Custom slot rendered below the image inside the panel body. |
|
|
30
|
+
| `children?` | `ReactNode` | — | Free-form content rendered at the bottom of the panel body — after all named slots. |
|
|
31
|
+
| `showCloseButton?` | `boolean` | true | Show the × close button in the top-trailing corner. |
|
|
32
|
+
| `primaryActionLabel?` | `string` | — | Label for the primary (solid-green) action button. When omitted the actions row is hidden. |
|
|
33
|
+
| `secondaryActionLabel?` | `string` | — | Label for the secondary (outlined) action button. When omitted only one button shows. |
|
|
34
|
+
| `onPrimaryAction?` | `() => void` | — | Called when the primary action button is clicked. |
|
|
35
|
+
| `onSecondaryAction?` | `() => void` | — | Called when the secondary action button is clicked. |
|
|
36
|
+
| `actionsAlignment?` | `'start' \| 'center' \| 'end'` | 'start' | Alignment of action buttons in the footer. |
|
|
37
|
+
| `placement?` | `'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end' \| 'left' \| 'left-start' \| 'left-end' \| 'right' \| 'right-start' \| 'right-end'` | 'bottom' | Where the panel appears relative to the trigger. |
|
|
38
|
+
| `showBeak?` | `boolean` | true | Whether to render the directional arrow (beak). |
|
|
39
|
+
| `surface?` | `'solid' \| 'glass'` | 'solid' | Surface treatment — `'solid'` (default) or `'glass'` (translucent liquid-glass material). |
|
|
40
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. Placement `start`/`end` and the close-button position flip in RTL. |
|
|
41
|
+
| `labels?` | `Partial<PopoverLabels>` | — | Override built-in strings (English defaults) to localize the popover. |
|
|
42
|
+
|
|
43
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `title`, `dir`.
|
|
44
|
+
|
|
45
|
+
## Options (allowed values)
|
|
46
|
+
- `triggerType`: `'button'` \| `'link'` — Whether the default built-in trigger is a Button or a Link.
|
|
47
|
+
- `actionsAlignment`: `'start'` \| `'center'` \| `'end'` — How action buttons are laid out in the panel footer.
|
|
48
|
+
|
|
49
|
+
- `start` — buttons sit at the leading edge (natural width).
|
|
50
|
+
- `center` — buttons expand equally to fill the row.
|
|
51
|
+
- `end` — buttons sit at the trailing edge (natural width).
|
|
52
|
+
- `placement`: `'top'` \| `'top-start'` \| `'top-end'` \| `'bottom'` \| `'bottom-start'` \| `'bottom-end'` \| `'left'` \| `'left-start'` \| `'left-end'` \| `'right'` \| `'right-start'` \| `'right-end'` — Where the popover panel appears relative to its trigger.
|
|
53
|
+
|
|
54
|
+
- `top` / `bottom` — panel centered on the trigger horizontally.
|
|
55
|
+
- `*-start` / `*-end` — panel aligned to the leading / trailing edge.
|
|
56
|
+
- `left` / `right` (and variants) — panel placed to the side of the trigger.
|
|
57
|
+
|
|
58
|
+
In RTL mode `start` and `end` are automatically mirrored.
|
|
59
|
+
- `surface`: `'solid'` \| `'glass'` — Surface treatment of the popover panel.
|
|
60
|
+
- `'solid'` (default) — opaque card with a hairline border + drop shadow.
|
|
61
|
+
- `'glass'` — translucent liquid-glass material (blurred backdrop +
|
|
62
|
+
beveled edge highlight). Reads best when the panel overlays imagery
|
|
63
|
+
or color.
|
|
64
|
+
|
|
65
|
+
The visual is provided by the shared `.glass-surface` utility, so it is
|
|
66
|
+
theme-aware (light / dark) and identical across every component that
|
|
67
|
+
exposes a `surface` prop.
|
|
68
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
|
|
69
|
+
Placement `start`/`end` and the close-button position flip in RTL.
|
|
70
|
+
|
|
71
|
+
## Deprecated props
|
|
72
|
+
Do not use in new code:
|
|
73
|
+
- `instanceRowCount`
|
|
74
|
+
|
|
75
|
+
## Accessibility
|
|
76
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
77
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
78
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
79
|
+
|
|
80
|
+
## Design tokens used
|
|
81
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
82
|
+
- `var(--ds-color-alpha-black-10)`
|
|
83
|
+
- `var(--ds-color-alpha-black-20)`
|
|
84
|
+
- `var(--ds-color-bg-default)`
|
|
85
|
+
- `var(--ds-color-bg-emphasis-high)`
|
|
86
|
+
- `var(--ds-color-bg-success-muted)`
|
|
87
|
+
- `var(--ds-color-border-muted)`
|
|
88
|
+
- `var(--ds-color-icon-default)`
|
|
89
|
+
- `var(--ds-color-icon-success)`
|
|
90
|
+
- `var(--ds-color-text-display)`
|
|
91
|
+
- `var(--ds-color-text-paragraph)`
|
|
92
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
93
|
+
- `var(--ds-color-tooltip-bg-on-dark)`
|
|
94
|
+
- `var(--ds-glass-bg)`
|
|
95
|
+
- `var(--ds-motion-feedback-duration)`
|
|
96
|
+
- `var(--ds-motion-feedback-easing)`
|
|
97
|
+
- `var(--ds-radius-full)`
|
|
98
|
+
- `var(--ds-radius-m)`
|
|
99
|
+
- `var(--ds-radius-xs)`
|
|
100
|
+
- `var(--ds-spacing-3xl)`
|
|
101
|
+
- `var(--ds-spacing-md)`
|
|
102
|
+
- `var(--ds-spacing-none)`
|
|
103
|
+
- `var(--ds-spacing-xl)`
|
|
104
|
+
- `var(--ds-spacing-xs)`
|
|
105
|
+
- `var(--ds-text-leading-line-heights-text-md)`
|
|
106
|
+
- `var(--ds-text-leading-line-heights-text-sm)`
|
|
107
|
+
- `var(--ds-text-leading-line-heights-text-xs)`
|
|
108
|
+
|
|
109
|
+
## AI usage guidance
|
|
110
|
+
When generating UI:
|
|
111
|
+
- Install with `npx sdaia-ui@latest add popover` (after `npx sdaia-ui@latest init`), then import `{ Popover }` from `@/components/ui/Popover`.
|
|
112
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
113
|
+
- Use only the documented option values listed under "Options".
|
|
114
|
+
- 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).
|
|
115
|
+
- 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,63 @@
|
|
|
1
|
+
# Progress Circle
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Progress Circle
|
|
5
|
+
- Slug: `progress-circle`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add progress-circle`
|
|
8
|
+
- Import: `import { ProgressCircle } from '@/components/ui/ProgressCircle'`
|
|
9
|
+
- Installed files: `ProgressCircle.tsx`, `ProgressCircle.types.ts`, `ProgressCircle.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/progresscircle
|
|
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 progress-circle`. It copies the source into your components folder (`components/ui/ProgressCircle/`, under `src/` when the project has one); import it as `@/components/ui/ProgressCircle`. 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` | 0 | Current progress value (0–100) |
|
|
18
|
+
| `variant?` | `'primary' \| 'neutral'` | 'primary' | Visual style |
|
|
19
|
+
| `shape?` | `'circle' \| 'half-circle'` | 'circle' | Shape of the progress indicator |
|
|
20
|
+
| `size?` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | 'md' | Size preset |
|
|
21
|
+
| `valueText?` | `boolean` | true | Show percentage text in the center |
|
|
22
|
+
| `labelText?` | `boolean` | false | Show `label` below the percentage (only visible at md, lg, xl). Nothing is rendered when `label` is not provided. |
|
|
23
|
+
| `label?` | `string` | — | Label text (e.g. "Active Users"). Also used as the accessible name of the progress bar when no `aria-label` / `aria-labelledby` is passed. |
|
|
24
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
|
|
25
|
+
| `animateOnView?` | `boolean` | false | Animate the progress arc from 0 when the component enters the viewport |
|
|
26
|
+
| `labels?` | `Partial<ProgressCircleLabels>` | — | Override built-in strings (English defaults) to localize the progress circle. |
|
|
27
|
+
|
|
28
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`.
|
|
29
|
+
|
|
30
|
+
## Options (allowed values)
|
|
31
|
+
- `variant`: `'primary'` \| `'neutral'` — Visual style
|
|
32
|
+
- `shape`: `'circle'` \| `'half-circle'` — Shape of the progress indicator
|
|
33
|
+
- `size`: `'xs'` \| `'sm'` \| `'md'` \| `'lg'` \| `'xl'` — Size preset
|
|
34
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
|
|
35
|
+
|
|
36
|
+
## Deprecated props
|
|
37
|
+
Do not use in new code:
|
|
38
|
+
- `direction`
|
|
39
|
+
|
|
40
|
+
## Accessibility
|
|
41
|
+
Built in (SDAIA review item A7) — verified by `axe scan (aria-progressbar-name) — audit-reports/a11y` in the design system's test suite:
|
|
42
|
+
- Renders a `role="progressbar"` with its current value, named by `label` (or your `aria-label` / `aria-labelledby`).
|
|
43
|
+
|
|
44
|
+
You must:
|
|
45
|
+
- Pass a `label` or `aria-label` that says what is progressing.
|
|
46
|
+
|
|
47
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
48
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
49
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
50
|
+
|
|
51
|
+
## Design tokens used
|
|
52
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
53
|
+
- `var(--ds-color-border-strong)`
|
|
54
|
+
- `var(--ds-color-border-subtle)`
|
|
55
|
+
- `var(--ds-color-stepper-button-current)`
|
|
56
|
+
- `var(--ds-color-text-paragraph)`
|
|
57
|
+
|
|
58
|
+
## AI usage guidance
|
|
59
|
+
When generating UI:
|
|
60
|
+
- Install with `npx sdaia-ui@latest add progress-circle` (after `npx sdaia-ui@latest init`), then import `{ ProgressCircle }` from `@/components/ui/ProgressCircle`.
|
|
61
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
62
|
+
- Use only the documented option values listed under "Options".
|
|
63
|
+
- 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
|
+
# Quote
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Quote
|
|
5
|
+
- Slug: `quote`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add quote`
|
|
8
|
+
- Import: `import { Quote } from '@/components/ui/Quote'`
|
|
9
|
+
- Installed files: `Quote.tsx`, `Quote.types.ts`, `Quote.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/quote
|
|
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 quote`. It copies the source into your components folder (`components/ui/Quote/`, under `src/` when the project has one); import it as `@/components/ui/Quote`. 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
|
+
| `style?` | `'standard' \| 'centered' \| 'author-image' \| 'author-side'` | 'standard' | Layout variant. |
|
|
18
|
+
| `title?` | `string` | — | Title text rendered as the quote heading. Not rendered when omitted. |
|
|
19
|
+
| `quote?` | `string` | — | Body/quote text (the actual quoted content). Not rendered when omitted. |
|
|
20
|
+
| `authorName?` | `string` | — | Author's display name. Not rendered when omitted. |
|
|
21
|
+
| `authorRole?` | `string` | — | Author's role or title below their name. Not rendered when omitted. |
|
|
22
|
+
| `showStar?` | `boolean` | true | Show the star/favorite icon. Applies to `'standard'` (bottom-end corner) and `'centered'` (top center). Has no visual effect on `'author-image'` or `'author-side'`. |
|
|
23
|
+
| `imageSrc?` | `string` | — | URL of the author photo. Required for `'author-image'` and `'author-side'` styles to display an image. |
|
|
24
|
+
| `imageAlt?` | `string` | '' | Accessible alt text for the author photo. |
|
|
25
|
+
| `className?` | `string` | — | Additional className applied to the card root element. |
|
|
26
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Inherits from the document when omitted. |
|
|
27
|
+
|
|
28
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `dir`, `style`, `title`, `children`.
|
|
29
|
+
|
|
30
|
+
## Options (allowed values)
|
|
31
|
+
- `style`: `'standard'` \| `'centered'` \| `'author-image'` \| `'author-side'` — Quote layout style.
|
|
32
|
+
|
|
33
|
+
- `'standard'` — flex-col card: title+description on top, author+star row at bottom.
|
|
34
|
+
- `'centered'` — flex-col card: star centered at top, then title+description centered,
|
|
35
|
+
then author centered.
|
|
36
|
+
- `'author-image'` — flex-row card: 120×120 author photo + name/role on the start side,
|
|
37
|
+
title+description on the end side.
|
|
38
|
+
- `'author-side'` — flex-row card: 160 px wide photo fills full height on the start side,
|
|
39
|
+
title+description+author on the end side.
|
|
40
|
+
|
|
41
|
+
RTL is inherited from `dir="rtl"` on any ancestor, or set explicitly with the
|
|
42
|
+
`dir` prop. The `flex-row` layouts flip visually in RTL via CSS logical properties.
|
|
43
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction. Inherits from the document when omitted.
|
|
44
|
+
|
|
45
|
+
## Accessibility
|
|
46
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
47
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
48
|
+
|
|
49
|
+
## Design tokens used
|
|
50
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
51
|
+
- `var(--ds-color-bg-canvas)`
|
|
52
|
+
- `var(--ds-color-icon-default)`
|
|
53
|
+
- `var(--ds-color-text-default)`
|
|
54
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
55
|
+
- `var(--ds-radius-l)`
|
|
56
|
+
- `var(--ds-radius-xl)`
|
|
57
|
+
|
|
58
|
+
## AI usage guidance
|
|
59
|
+
When generating UI:
|
|
60
|
+
- Install with `npx sdaia-ui@latest add quote` (after `npx sdaia-ui@latest init`), then import `{ Quote }` from `@/components/ui/Quote`.
|
|
61
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
62
|
+
- Use only the documented option values listed under "Options".
|
|
63
|
+
- 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).
|
|
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,72 @@
|
|
|
1
|
+
# Radial Stepper
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Radial Stepper
|
|
5
|
+
- Slug: `radial-stepper`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add radial-stepper`
|
|
8
|
+
- Import: `import { RadialStepper } from '@/components/ui/RadialStepper'`
|
|
9
|
+
- Installed files: `RadialStepper.tsx`, `RadialStepper.types.ts`, `RadialStepper.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/radial-stepper
|
|
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 radial-stepper`. It copies the source into your components folder (`components/ui/RadialStepper/`, under `src/` when the project has one); import it as `@/components/ui/RadialStepper`. 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?` | `'48px' \| '64px' \| '80px' \| '120px'` | '64px' | Ring diameter tier (default: '64px'). Controls CircularItem size AND the text typography tier. |
|
|
18
|
+
| `layout?` | `'Horizontal' \| 'Vertical'` | 'Horizontal' | Flex direction of the component (default: 'Horizontal'). Horizontal: ring left (LTR) or right (RTL) of the text block. Vertical: ring above, text block below, both centred. |
|
|
19
|
+
| `variant?` | `'Primary' \| 'Neutral'` | 'Primary' | Arc colour theme passed to CircularItem (default: 'Primary'). Named `variant` to avoid conflict with HTMLAttributes.style. |
|
|
20
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction applied to the root. "rtl": ring moves to the end (right) of a horizontal layout, text right-aligns and the arc fills counter-clockwise. Inherits from the nearest `dir` ancestor when omitted. |
|
|
21
|
+
| `indicator?` | `CircularItemIndicator` | '1 of 4' | Step progress passed directly to CircularItem (default: '1 of 4'). |
|
|
22
|
+
| `previousLabel?` | `string` | — | Text of the previous-step row (e.g. the previous step's name). Takes precedence over `labels.previous`. |
|
|
23
|
+
| `showPrevious?` | `boolean` | true | Show / hide the previous-step row (default: true). |
|
|
24
|
+
| `stepName?` | `string` | — | Current step name. Renders nothing when omitted. |
|
|
25
|
+
| `showStepName?` | `boolean` | true | Show / hide the step-name row (default: true). |
|
|
26
|
+
| `description?` | `string` | — | Step description. Renders nothing when omitted. |
|
|
27
|
+
| `showDescription?` | `boolean` | true | Show / hide the description row (default: true). |
|
|
28
|
+
| `nextLabel?` | `string` | — | Text of the next-step row (e.g. the next step's name). Takes precedence over `labels.next`. |
|
|
29
|
+
| `showNext?` | `boolean` | true | Show / hide the next-step row (default: true). |
|
|
30
|
+
| `labels?` | `Partial<RadialStepperLabels>` | — | Translatable built-in strings. |
|
|
31
|
+
|
|
32
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
|
|
33
|
+
|
|
34
|
+
## Options (allowed values)
|
|
35
|
+
- `size`: `'48px'` \| `'64px'` \| `'80px'` \| `'120px'` — Physical size of the circular ring.
|
|
36
|
+
Matches the Figma `Size` property names exactly.
|
|
37
|
+
Maps 1-to-1 to CircularItem sizes:
|
|
38
|
+
48px → Small | 64px → Medium | 80px → Large | 120px → Extra Large
|
|
39
|
+
- `layout`: `'Horizontal'` \| `'Vertical'` — Flex direction of the component.
|
|
40
|
+
Horizontal: ring beside text.
|
|
41
|
+
Vertical: ring above text.
|
|
42
|
+
- `variant`: `'Primary'` \| `'Neutral'` — Arc colour passed down to CircularItem.
|
|
43
|
+
Primary = green (#1b8354), Neutral = dark navy (#1f2a37).
|
|
44
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction applied to the root. "rtl": ring moves to the end
|
|
45
|
+
(right) of a horizontal layout, text right-aligns and the arc fills
|
|
46
|
+
counter-clockwise. Inherits from the nearest `dir` ancestor when omitted.
|
|
47
|
+
|
|
48
|
+
## Deprecated props
|
|
49
|
+
Do not use in new code:
|
|
50
|
+
- `rtl`
|
|
51
|
+
|
|
52
|
+
## Accessibility
|
|
53
|
+
- Built-in strings (button names, announcements) come from `labels`; pass translated strings for Arabic or other languages.
|
|
54
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
55
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
56
|
+
|
|
57
|
+
## Design tokens used
|
|
58
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
59
|
+
- `var(--ds-color-)`
|
|
60
|
+
- `var(--ds-color-text-default)`
|
|
61
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
62
|
+
- `var(--ds-spacing-lg)`
|
|
63
|
+
- `var(--ds-spacing-md)`
|
|
64
|
+
- `var(--ds-spacing-xs)`
|
|
65
|
+
- `var(--ds-text-size-text-)`
|
|
66
|
+
|
|
67
|
+
## AI usage guidance
|
|
68
|
+
When generating UI:
|
|
69
|
+
- Install with `npx sdaia-ui@latest add radial-stepper` (after `npx sdaia-ui@latest init`), then import `{ RadialStepper }` from `@/components/ui/RadialStepper`.
|
|
70
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
71
|
+
- Use only the documented option values listed under "Options".
|
|
72
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Scatter
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Scatter
|
|
5
|
+
- Slug: `scatter-chart`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add scatter-chart`
|
|
8
|
+
- Import: `import { ScatterChart } from '@/components/ui/ScatterChart'`
|
|
9
|
+
- Installed files: `ScatterChart.tsx`, `ScatterChart.types.ts`, `ScatterChart.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/scatter
|
|
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 scatter-chart`. It copies the source into your components folder (`components/ui/ScatterChart/`, under `src/` when the project has one); import it as `@/components/ui/ScatterChart`. 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
|
+
| `title?` | `string` | — | Optional chart title rendered above the chart; it also names the chart. |
|
|
18
|
+
| `points?` | `ScatterPoint[]` | — | Scatter data points in data-space coordinates. When missing or empty the chart shows `labels.noData` — there is no sample data. |
|
|
19
|
+
| `yTicks?` | `string[]` | — | Y-axis tick labels from top to bottom, spread evenly from `yMax` (top) to `yMin` (bottom). An empty string '' renders an invisible spacer row (its grid line stays). When omitted, "nice" ticks are computed from the domain and formatted for `locale`. |
|
|
20
|
+
| `xTicks?` | `string[]` | — | X-axis tick labels from `xMin` to `xMax` (in RTL the axis mirrors, so the first tick is on the right). An empty string '' renders an invisible spacer cell. When omitted, ticks are computed from the domain. |
|
|
21
|
+
| `xMin?` | `number` | derived from `points` (rounded) | Minimum data-space X value. |
|
|
22
|
+
| `xMax?` | `number` | derived from `points` (rounded) | Maximum data-space X value. |
|
|
23
|
+
| `yMin?` | `number` | derived from `points` (rounded) | Minimum data-space Y value. |
|
|
24
|
+
| `yMax?` | `number` | derived from `points` (rounded) | Maximum data-space Y value. |
|
|
25
|
+
| `locale?` | `string` | — | BCP 47 locale for the computed tick labels and table values (`Intl.NumberFormat`), e.g. `'ar-SA'`. |
|
|
26
|
+
| `labels?` | `Partial<ScatterChartLabels>` | — | Overrides for the built-in text (accessible name, messages), e.g. Arabic. |
|
|
27
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Text direction. Charts mirror their axes in RTL: the Y axis moves to the right and x grows right-to-left (the origin is at the bottom right). Inherited from the document when omitted. |
|
|
28
|
+
|
|
29
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …).
|
|
30
|
+
|
|
31
|
+
## Options (allowed values)
|
|
32
|
+
- `dir`: `'ltr'` \| `'rtl'` — Text direction. Charts mirror their axes in RTL: the Y axis moves to the
|
|
33
|
+
right and x grows right-to-left (the origin is at the bottom right).
|
|
34
|
+
Inherited from the document when omitted.
|
|
35
|
+
|
|
36
|
+
## Deprecated props
|
|
37
|
+
Do not use in new code:
|
|
38
|
+
- `type` — Trend preset of the Figma frames.
|
|
39
|
+
- `rtl` — Render in RTL layout (mirrors dot X positions).
|
|
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-border-default)`
|
|
49
|
+
- `var(--ds-color-chart-series-1)`
|
|
50
|
+
- `var(--ds-color-text-display)`
|
|
51
|
+
- `var(--ds-color-text-paragraph)`
|
|
52
|
+
- `var(--ds-radius-full)`
|
|
53
|
+
- `var(--ds-spacing-lg)`
|
|
54
|
+
- `var(--ds-spacing-md)`
|
|
55
|
+
- `var(--ds-spacing-xs)`
|
|
56
|
+
|
|
57
|
+
## AI usage guidance
|
|
58
|
+
When generating UI:
|
|
59
|
+
- Install with `npx sdaia-ui@latest add scatter-chart` (after `npx sdaia-ui@latest init`), then import `{ ScatterChart }` from `@/components/ui/ScatterChart`.
|
|
60
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
61
|
+
- Use only the documented option values listed under "Options".
|
|
62
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Second Nav Header
|
|
2
|
+
|
|
3
|
+
## Metadata
|
|
4
|
+
- Component: Second Nav Header
|
|
5
|
+
- Slug: `second-nav-header`
|
|
6
|
+
- Category: General
|
|
7
|
+
- Install: `npx sdaia-ui@latest add second-nav-header`
|
|
8
|
+
- Import: `import { SecondNavHeader } from '@/components/ui/SecondNavHeader'`
|
|
9
|
+
- Installed files: `SecondNavHeader.tsx`, `SecondNavHeader.types.ts`, `SecondNavHeader.variants.ts`, `index.ts`
|
|
10
|
+
- Docs: https://ds.nacew.com/components/second-nav-header
|
|
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 second-nav-header`. It copies the source into your components folder (`components/ui/SecondNavHeader/`, under `src/` when the project has one); import it as `@/components/ui/SecondNavHeader`. 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?` | `SubHeaderItemProps[]` | — | Up to 3 contextual info items (e.g. weather, date, time). Each entry is spread onto a `SubHeaderItem`. |
|
|
18
|
+
| `instance?` | `ReactNode` | — | Custom content injected into the Instance slot (leading side of the trailing group). Typically a breadcrumb, tab set, or status chip. |
|
|
19
|
+
| `label?` | `string` | — | Secondary text label shown in the trailing group (e.g. "List Item"). |
|
|
20
|
+
| `actions?` | `ReactNode` | — | Action content — typically one to three `<Button iconOnly>` elements. Rendered in a `gap-spacing-sm` flex row. |
|
|
21
|
+
| `divider?` | `boolean` | true | Whether to render a bottom border divider. |
|
|
22
|
+
| `dir?` | `'ltr' \| 'rtl'` | — | Layout direction — applied to the root element (and every item); inherits from the page when omitted. |
|
|
23
|
+
| `className?` | `string` | — | — |
|
|
24
|
+
|
|
25
|
+
Also accepts standard `<div>` HTML attributes (`className`, `style`, `onClick`, `aria-*`, …) — except: `children`.
|
|
26
|
+
|
|
27
|
+
## Options (allowed values)
|
|
28
|
+
- `dir`: `'ltr'` \| `'rtl'` — Layout direction — applied to the root element (and every item); inherits from the page when omitted.
|
|
29
|
+
|
|
30
|
+
## Deprecated props
|
|
31
|
+
Do not use in new code:
|
|
32
|
+
- `rtl`
|
|
33
|
+
|
|
34
|
+
## Accessibility
|
|
35
|
+
- Don't remove the focus ring or replace interactive elements with `div`s; keep the control keyboard-operable.
|
|
36
|
+
- For contrast, keyboard patterns and RTL rules, call `get_foundations` (`accessibility`, `rtl`).
|
|
37
|
+
|
|
38
|
+
## Design tokens used
|
|
39
|
+
Keep these consistent (resolve values with `get_tokens`):
|
|
40
|
+
- `var(--ds-color-bg-canvas)`
|
|
41
|
+
- `var(--ds-color-border-default)`
|
|
42
|
+
- `var(--ds-color-text-paragraph-muted)`
|
|
43
|
+
- `var(--ds-spacing-4xl)`
|
|
44
|
+
- `var(--ds-spacing-md)`
|
|
45
|
+
- `var(--ds-spacing-sm)`
|
|
46
|
+
- `var(--ds-spacing-xl)`
|
|
47
|
+
- `var(--ds-spacing-xs)`
|
|
48
|
+
|
|
49
|
+
## AI usage guidance
|
|
50
|
+
When generating UI:
|
|
51
|
+
- Install with `npx sdaia-ui@latest add second-nav-header` (after `npx sdaia-ui@latest init`), then import `{ SecondNavHeader }` from `@/components/ui/SecondNavHeader`.
|
|
52
|
+
- NEVER run `npm install sdaia-ui` and NEVER `import` from the `sdaia-ui` package — it is a source-copying CLI, not a component library.
|
|
53
|
+
- Use only the documented option values listed under "Options".
|
|
54
|
+
- 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).
|
|
55
|
+
- Pick one theme per screen: dark is `.theme-dark` (or `.dark`) on `<html>`; style surrounding layout with DS tokens (`get_tokens`), never hardcoded colors.
|