@kabobcompany/react 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/GUIDE.md +185 -0
  2. package/dist/components/Accordion/Accordion.d.ts +48 -0
  3. package/dist/components/Accordion/index.d.ts +2 -0
  4. package/dist/components/Alert/Alert.d.ts +23 -0
  5. package/dist/components/Alert/index.d.ts +2 -0
  6. package/dist/components/AppBar/AppBar.d.ts +22 -0
  7. package/dist/components/AppBar/index.d.ts +2 -0
  8. package/dist/components/ArrowButton/ArrowButton.d.ts +20 -0
  9. package/dist/components/ArrowButton/index.d.ts +2 -0
  10. package/dist/components/Avatar/Avatar.d.ts +38 -0
  11. package/dist/components/Avatar/index.d.ts +2 -0
  12. package/dist/components/Badge/Badge.d.ts +30 -0
  13. package/dist/components/Badge/index.d.ts +2 -0
  14. package/dist/components/Breadcrumb/Breadcrumb.d.ts +21 -0
  15. package/dist/components/Breadcrumb/index.d.ts +2 -0
  16. package/dist/components/Button/Button.d.ts +22 -0
  17. package/dist/components/Button/index.d.ts +2 -0
  18. package/dist/components/Calendar/Calendar.d.ts +37 -0
  19. package/dist/components/Calendar/index.d.ts +2 -0
  20. package/dist/components/Card/Card.d.ts +13 -0
  21. package/dist/components/Card/index.d.ts +2 -0
  22. package/dist/components/Carousel/Carousel.d.ts +47 -0
  23. package/dist/components/Carousel/index.d.ts +2 -0
  24. package/dist/components/Checkbox/Checkbox.d.ts +9 -0
  25. package/dist/components/Checkbox/index.d.ts +2 -0
  26. package/dist/components/ChoiceChips/ChoiceChips.d.ts +45 -0
  27. package/dist/components/ChoiceChips/index.d.ts +2 -0
  28. package/dist/components/Combobox/Combobox.d.ts +23 -0
  29. package/dist/components/Combobox/index.d.ts +2 -0
  30. package/dist/components/DataTable/DataTable.d.ts +70 -0
  31. package/dist/components/DataTable/index.d.ts +2 -0
  32. package/dist/components/DateRange/DateRange.d.ts +39 -0
  33. package/dist/components/DateRange/index.d.ts +2 -0
  34. package/dist/components/DescriptionList/DescriptionList.d.ts +12 -0
  35. package/dist/components/DescriptionList/index.d.ts +2 -0
  36. package/dist/components/Dialog/Dialog.d.ts +24 -0
  37. package/dist/components/Dialog/index.d.ts +2 -0
  38. package/dist/components/Drawer/Drawer.d.ts +28 -0
  39. package/dist/components/Drawer/index.d.ts +2 -0
  40. package/dist/components/Dropdown/Dropdown.d.ts +65 -0
  41. package/dist/components/Dropdown/index.d.ts +2 -0
  42. package/dist/components/Editor/Editor.d.ts +60 -0
  43. package/dist/components/Editor/index.d.ts +2 -0
  44. package/dist/components/EmptyState/EmptyState.d.ts +17 -0
  45. package/dist/components/EmptyState/index.d.ts +2 -0
  46. package/dist/components/FileUpload/FileUpload.d.ts +29 -0
  47. package/dist/components/FileUpload/index.d.ts +2 -0
  48. package/dist/components/Filter/Filter.d.ts +27 -0
  49. package/dist/components/Filter/index.d.ts +2 -0
  50. package/dist/components/Floating/Floating.d.ts +50 -0
  51. package/dist/components/Floating/index.d.ts +4 -0
  52. package/dist/components/FormSection/FormSection.d.ts +40 -0
  53. package/dist/components/FormSection/index.d.ts +2 -0
  54. package/dist/components/IconButton/IconButton.d.ts +17 -0
  55. package/dist/components/IconButton/index.d.ts +2 -0
  56. package/dist/components/Input/Input.d.ts +55 -0
  57. package/dist/components/Input/index.d.ts +2 -0
  58. package/dist/components/Kbd/Kbd.d.ts +18 -0
  59. package/dist/components/Kbd/index.d.ts +2 -0
  60. package/dist/components/LayoutPicker/LayoutPicker.d.ts +69 -0
  61. package/dist/components/LayoutPicker/index.d.ts +2 -0
  62. package/dist/components/List/List.d.ts +67 -0
  63. package/dist/components/List/index.d.ts +2 -0
  64. package/dist/components/Marquee/Marquee.d.ts +24 -0
  65. package/dist/components/Marquee/index.d.ts +2 -0
  66. package/dist/components/Media/Media.d.ts +19 -0
  67. package/dist/components/Media/index.d.ts +2 -0
  68. package/dist/components/Menu/Menu.d.ts +15 -0
  69. package/dist/components/Menu/index.d.ts +2 -0
  70. package/dist/components/NumberBoard/NumberBoard.d.ts +47 -0
  71. package/dist/components/NumberBoard/index.d.ts +2 -0
  72. package/dist/components/NumberStepper/NumberStepper.d.ts +36 -0
  73. package/dist/components/NumberStepper/index.d.ts +2 -0
  74. package/dist/components/OptionCard/OptionCard.d.ts +66 -0
  75. package/dist/components/OptionCard/index.d.ts +2 -0
  76. package/dist/components/PageHeader/PageHeader.d.ts +25 -0
  77. package/dist/components/PageHeader/index.d.ts +2 -0
  78. package/dist/components/Pagination/Pagination.d.ts +10 -0
  79. package/dist/components/Pagination/index.d.ts +2 -0
  80. package/dist/components/Popover/Popover.d.ts +8 -0
  81. package/dist/components/Popover/index.d.ts +2 -0
  82. package/dist/components/Progress/Progress.d.ts +24 -0
  83. package/dist/components/Progress/index.d.ts +2 -0
  84. package/dist/components/QueueItem/QueueItem.d.ts +55 -0
  85. package/dist/components/QueueItem/index.d.ts +2 -0
  86. package/dist/components/Radio/Radio.d.ts +6 -0
  87. package/dist/components/Radio/index.d.ts +2 -0
  88. package/dist/components/Resizable/Resizable.d.ts +40 -0
  89. package/dist/components/Resizable/index.d.ts +2 -0
  90. package/dist/components/Schedule/Schedule.d.ts +17 -0
  91. package/dist/components/Schedule/index.d.ts +2 -0
  92. package/dist/components/ScreenHeader/Clock.d.ts +21 -0
  93. package/dist/components/ScreenHeader/ScreenHeader.d.ts +21 -0
  94. package/dist/components/ScreenHeader/index.d.ts +4 -0
  95. package/dist/components/SegmentedControl/SegmentedControl.d.ts +17 -0
  96. package/dist/components/SegmentedControl/index.d.ts +2 -0
  97. package/dist/components/Select/Select.d.ts +10 -0
  98. package/dist/components/Select/index.d.ts +2 -0
  99. package/dist/components/Separator/Separator.d.ts +21 -0
  100. package/dist/components/Separator/index.d.ts +2 -0
  101. package/dist/components/SideRail/SideRail.d.ts +16 -0
  102. package/dist/components/SideRail/index.d.ts +2 -0
  103. package/dist/components/Slider/Slider.d.ts +52 -0
  104. package/dist/components/Slider/index.d.ts +2 -0
  105. package/dist/components/Spinner/Spinner.d.ts +29 -0
  106. package/dist/components/Spinner/index.d.ts +2 -0
  107. package/dist/components/StatBar/StatBar.d.ts +18 -0
  108. package/dist/components/StatBar/index.d.ts +2 -0
  109. package/dist/components/Stepper/Stepper.d.ts +16 -0
  110. package/dist/components/Stepper/index.d.ts +2 -0
  111. package/dist/components/Summary/Summary.d.ts +10 -0
  112. package/dist/components/Summary/index.d.ts +2 -0
  113. package/dist/components/Switch/Switch.d.ts +10 -0
  114. package/dist/components/Switch/index.d.ts +2 -0
  115. package/dist/components/Tabs/Tabs.d.ts +14 -0
  116. package/dist/components/Tabs/index.d.ts +2 -0
  117. package/dist/components/TagInput/TagInput.d.ts +27 -0
  118. package/dist/components/TagInput/index.d.ts +2 -0
  119. package/dist/components/TicketNumber/TicketNumber.d.ts +39 -0
  120. package/dist/components/TicketNumber/index.d.ts +2 -0
  121. package/dist/components/TileCard/TileCard.d.ts +49 -0
  122. package/dist/components/TileCard/index.d.ts +2 -0
  123. package/dist/components/TimeInput/TimeInput.d.ts +10 -0
  124. package/dist/components/TimeInput/index.d.ts +2 -0
  125. package/dist/components/Timeline/Timeline.d.ts +83 -0
  126. package/dist/components/Timeline/index.d.ts +2 -0
  127. package/dist/components/Toast/Toast.d.ts +11 -0
  128. package/dist/components/Toast/index.d.ts +2 -0
  129. package/dist/components/ToggleGroup/ToggleGroup.d.ts +72 -0
  130. package/dist/components/ToggleGroup/index.d.ts +2 -0
  131. package/dist/components/Tooltip/Tooltip.d.ts +21 -0
  132. package/dist/components/Tooltip/index.d.ts +2 -0
  133. package/dist/components/Tree/Tree.d.ts +18 -0
  134. package/dist/components/Tree/index.d.ts +2 -0
  135. package/dist/components/Typography/Typography.d.ts +54 -0
  136. package/dist/components/Typography/index.d.ts +2 -0
  137. package/dist/index.d.ts +67 -0
  138. package/dist/index.js +4935 -0
  139. package/dist/utils/floating.d.ts +29 -0
  140. package/package.json +39 -4
  141. package/README.md +0 -3
package/GUIDE.md ADDED
@@ -0,0 +1,185 @@
1
+ # Building an app with the Kabob Design System
2
+
3
+ For people and coding agents building a product UI with `@kabobcompany/react`.
4
+ (To change the library itself, see `CLAUDE.md` in the design-book repository.)
5
+
6
+ ## Setup
7
+
8
+ ```ts
9
+ // once, at the app root
10
+ import '@kabobcompany/css';
11
+ // anywhere
12
+ import { Button, Input } from '@kabobcompany/react';
13
+ ```
14
+
15
+ `@kabobcompany/css` carries all the styling; `@kabobcompany/react` components only apply its
16
+ classes and add behaviour. Without the CSS import nothing is styled.
17
+
18
+ ## Rules
19
+
20
+ 1. **Reach for a component before writing markup.** The table below lists what exists.
21
+ Every prop is documented in the type definitions (`dist/index.d.ts` and the
22
+ `dist/components/*/*.d.ts` files beside it): read them instead of guessing.
23
+ 2. **Never write a raw colour, font size, radius or shadow.** Use the `--kb-*`
24
+ variables (see Tokens). If a value is missing, ask for a token.
25
+ 3. **Your own CSS is for layout only**: flex, grid, gaps, widths. Components own their look.
26
+ 4. **No icons are included.** Pass your own SVGs to `icon`, `searchIcon`, `IconButton`
27
+ and `RailItem`. Size them 20px (16px inside small controls) and use
28
+ `stroke="currentColor"` or `fill="currentColor"` so they take the text colour.
29
+ 5. **Every control needs a name**: a `label`, or `aria-label` when there is no visible one.
30
+ `IconButton` requires `label`.
31
+ 6. **One primary button per view.** Others are `secondary`, `ghost` or `subtle`.
32
+ Destructive actions use `danger` (irreversible) or `danger-outline` (reversible).
33
+
34
+ ## Which component
35
+
36
+ | Need | Use |
37
+ |---|---|
38
+ | Action | `Button` (`variant`: primary, secondary, accent, ghost, subtle, link, danger, danger-outline; `size`: sm 32px, md 36px, lg 44px, xl 50px; `rounded` + `icon` for page actions), `IconButton`, `ToggleGroup` / `Toggle` |
39
+ | Text entry | `Input` (`label`, `hint`, `error`, `suffix`, `action`, `searchIcon`), `Textarea`, `NumberStepper`, `TagInput`, `ColorInput` |
40
+ | Choice | `Select` (native, few options), `Dropdown` (styled listbox), `Combobox` (searchable), `Checkbox`, `Radio`, `Switch`, `SegmentedControl`, `ChoiceChips`, `OptionCard` / `OptionCardGroup`, `Slider` |
41
+ | Date and time | `DateInput`, `DateRange`, `TimeInput`, `Calendar` |
42
+ | File | `FileUpload` |
43
+ | Form layout | `FormGrid` (two columns, in dialogs), `FieldSlot` / `FieldPair`, `FormSection` + `FormSectionRow` (settings pages), `ActionFooter` (sticky save bar) |
44
+ | App frame | `AppBar` (top bar), `SideRail` + `RailItem` (icon navigation), `PageHeader` (band with tabs and actions), `PageTitle` (heading + count), `Toolbar` (search and filters) |
45
+ | Navigation | `Tabs` + `Tab`, `Breadcrumb`, `Pagination`, `Tree` + `TreeItem`, `StepNav` |
46
+ | Tabular data | `DataTable` (sorting, selection, loading and empty states) |
47
+ | Rows with detail | `List`, `ListRow`, `ListDetail`, `SubTable`, `Thumbnail`; `Accordion` |
48
+ | Key-value facts | `DescriptionList`, `Summary` (strip of facts), `StatBar` + `Stat` |
49
+ | Cards | `Card` (`variant`: muted, surface, elevated), `TileCard`, `MediaCard` / `MediaGrid` |
50
+ | Status | `Badge` (`tone`), `StatusDot`, `SignalDots`, `Progress` |
51
+ | Messages | `Alert` (inline, stays), `Toast` in a `ToastRegion` (brief confirmation), `EmptyState`, `Spinner`, `Skeleton` |
52
+ | Overlays | `Dialog` (default 840px form; `small` 480px confirm; `large` 960px), `Drawer`, `DropdownMenu`, `ContextMenu`, `Menu`, `Popover`, `Tooltip`, `InfoIcon` |
53
+ | Text | `Heading` (`level` 1 page, 2 section, 3 card, 4 group), `Text`, `Caption`, `Kbd`, `Separator` |
54
+ | People | `Avatar`, `AvatarGroup` |
55
+ | Filtering | `FilterGroup`, `FilterOption`, `FilterSection` |
56
+ | Queues and boards | `TicketNumber`, `QueueItem`, `QueueRail`, `NumberBoard`, `CounterTile`, `Marquee`, `ScreenHeader`, `Clock` |
57
+ | Scheduling and signage | `ScheduleBoard`, `Timeline`, `PlaylistStrip`, `LayoutPicker`, editor panels (`ToolPalette`, `LayerList`, `PanelSection`) |
58
+
59
+ Sizes follow context: `lg` (44px) controls in console forms and dialogs, `md` in
60
+ editors, `sm` in toolbars and tables, `xl` on mobile.
61
+
62
+ ## Page patterns
63
+
64
+ These compile: they are the `Patterns/App pages` stories in Storybook.
65
+
66
+ ### List page
67
+
68
+ App bar on top, side rail at the left, then band, title, toolbar and table.
69
+
70
+ ```tsx
71
+ <div style={{ display: 'flex', flexDirection: 'column', height: '100vh' }}>
72
+ <AppBar logo={<Logo />} wordmark="Devices" actions={<button className="kb-app-bar__user">{user.name}</button>} tenant={company.name} />
73
+ <div style={{ display: 'flex', flex: 1, minHeight: 0 }}>
74
+ <SideRail>
75
+ <RailItem label="Devices" href="/devices" active><MonitorIcon /></RailItem>
76
+ <RailItem label="Templates" href="/templates"><FolderIcon /></RailItem>
77
+ <RailItem label="Settings" href="/settings" bottom><GearIcon /></RailItem>
78
+ </SideRail>
79
+ <main style={{ flex: 1, minWidth: 0, overflow: 'auto' }}>
80
+ <PageHeader
81
+ tabs={<Tabs><Tab active>All devices</Tab><Tab>Groups</Tab></Tabs>}
82
+ actions={<Button rounded icon={<PlusIcon />}>Add</Button>}
83
+ />
84
+ <PageTitle title="All devices" count={`${rows.length} items`} />
85
+ <Toolbar>
86
+ <Input searchIcon={<SearchIcon />} placeholder="Search" aria-label="Search devices"
87
+ value={query} onChange={(e) => setQuery(e.target.value)} style={{ width: 320 }} />
88
+ </Toolbar>
89
+ <DataTable
90
+ columns={columns} rows={rows} rowKey="id" loading={loading} onRowClick={setEditing}
91
+ empty={<EmptyState compact title="No devices found" description="Try a different search." />}
92
+ />
93
+ </main>
94
+ </div>
95
+ </div>
96
+ ```
97
+
98
+ Columns are plain data; `render` is only needed for cells that aren't text:
99
+
100
+ ```tsx
101
+ const columns: DataTableColumn<Device>[] = [
102
+ { key: 'name', label: 'Name', sortable: true },
103
+ { key: 'store', label: 'Store', width: 200, sortable: true },
104
+ { key: 'online', label: 'Status', width: 120,
105
+ render: (d) => (d.online ? <Badge tone="success">Online</Badge> : <Badge>Offline</Badge>) },
106
+ ];
107
+ ```
108
+
109
+ A small app without sections can drop `SideRail` and `PageHeader` and keep
110
+ `AppBar`, `PageTitle` and the content.
111
+
112
+ ### Edit in a dialog
113
+
114
+ Destructive actions go at the left of the footer, the primary action at the right.
115
+ Confirm success with a toast.
116
+
117
+ ```tsx
118
+ <Dialog
119
+ open={editing !== null} onClose={() => setEditing(null)} title="Device settings"
120
+ footerStart={<Button size="lg" variant="danger-outline">Disable</Button>}
121
+ footer={<Button size="lg" onClick={save}>Save</Button>}
122
+ >
123
+ <FormGrid>
124
+ <Input label="Name" large defaultValue={editing?.name} />
125
+ <Select label="Store" size="lg" defaultValue={editing?.store}>…</Select>
126
+ </FormGrid>
127
+ </Dialog>
128
+
129
+ <ToastRegion>{saved ? <Toast tone="success" onClose={() => setSaved(false)}>Device saved</Toast> : null}</ToastRegion>
130
+ ```
131
+
132
+ Show a validation message on the field itself: `<Input label="Name" error hint="Name can't be empty" />`.
133
+
134
+ ### Settings page
135
+
136
+ ```tsx
137
+ <FormSection title="Store" description="Shown on screens and tickets.">
138
+ <FormSectionRow label="Name" htmlFor="store-name"><Input id="store-name" large /></FormSectionRow>
139
+ <FormSectionRow label="Language" htmlFor="store-language"><Select id="store-language" size="lg">…</Select></FormSectionRow>
140
+ </FormSection>
141
+ <FormSection title="Notifications">
142
+ <FormSectionRow label="Sound"><Switch defaultChecked>Enabled</Switch></FormSectionRow>
143
+ </FormSection>
144
+ <ActionFooter start="Unsaved changes">
145
+ <Button size="lg" variant="secondary">Cancel</Button>
146
+ <Button size="lg">Save</Button>
147
+ </ActionFooter>
148
+ ```
149
+
150
+ ## Tokens
151
+
152
+ All values are CSS variables from `@kabobcompany/tokens`, loaded by `@kabobcompany/css`.
153
+
154
+ | Kind | Common names |
155
+ |---|---|
156
+ | Backgrounds | `--kb-color-bg-canvas` (page), `-bg-surface` (cards, white), `-bg-muted`, `-bg-subtle`, `-bg-band`, `-bg-selected` |
157
+ | Text | `--kb-color-text-primary`, `-text-muted`, `-text-on-brand`, `-text-on-status` |
158
+ | Borders | `--kb-color-border-default`, `-border-divider`, `-border-subtle`, `-border-focus` |
159
+ | Brand | `--kb-color-brand-primary`, `-brand-primary-hover`, `-brand-primary-tint` |
160
+ | Status | `--kb-color-status-success`, `-status-warning`, `-status-error` |
161
+ | Shape and type | `--kb-radius-sm`, `-md`, `-lg`; `--kb-font-family-sans`, `-mono` |
162
+
163
+ The full list, with where each value came from, is in `@kabobcompany/tokens/tokens.json`.
164
+
165
+ With Tailwind, map its names onto tokens in `@theme inline` and use utilities for
166
+ layout; don't introduce Tailwind's own palette.
167
+
168
+ ## Theming
169
+
170
+ Three independent switches, set on `<html>` or on any subtree:
171
+
172
+ - **Accent.** One adjustable brand colour: `<html style="--kb-accent:#ff888b">`, or
173
+ `<section data-accent style="--kb-accent:#f9ae0f">` for one area. Set
174
+ `--kb-accent-contrast` too if text on the accent needs a different colour.
175
+ - **Dark.** `data-theme="dark"`, meant for editor-style pages.
176
+ - **Kiosk scale.** `data-scale="kiosk"` enlarges type and controls for 1080p
177
+ customer-facing screens (ticket machines, calling boards).
178
+
179
+ ## Known limits
180
+
181
+ - Tokens were reverse-engineered from Figma screens and await design sign-off;
182
+ names are stable, some values may change.
183
+ - `--kb-color-text-muted` is low contrast (about 2.2:1 on white): fine for
184
+ secondary captions, not for text people must read.
185
+ - White text on the default teal is about 2.9:1: keep it to bold button-size text.
@@ -0,0 +1,48 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ type AccordionVariant = 'default' | 'grouped';
3
+ export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
4
+ /** Allow several items open at once. Default `false`: opening one closes the others. */
5
+ multiple?: boolean;
6
+ /** Controlled open item values. Pair with `onChange`. */
7
+ value?: string[];
8
+ /** Initially open item values (uncontrolled). */
9
+ defaultValue?: string[];
10
+ /** Called with the new list of open item values. */
11
+ onChange?: (value: string[]) => void;
12
+ /**
13
+ * `default`: plain rows separated by dividers.
14
+ * `grouped`: folder-row headers (bg-subtle, 64px, icon, "北區 ^ 3") with `AccordionRow` children (Tico RUN branch list).
15
+ */
16
+ variant?: AccordionVariant;
17
+ /** Heading level wrapping each item's trigger button. Default 3. */
18
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
19
+ }
20
+ /** Collapsible sections. Compose with `AccordionItem`; use `AccordionRow` for child rows in the `grouped` variant. */
21
+ export declare function Accordion({ multiple, value, defaultValue, onChange, variant, headingLevel, className, children, ...rest }: AccordionProps): import('react').JSX.Element;
22
+ export interface AccordionItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
23
+ /** Unique id of this item within the accordion; used in `value` / `defaultValue`. */
24
+ value: string;
25
+ /** Header text. */
26
+ title: ReactNode;
27
+ /** Count or short meta after the title (e.g. number of child rows). */
28
+ meta?: ReactNode;
29
+ /** Leading icon slot (folder icon in the `grouped` variant). */
30
+ icon?: ReactNode;
31
+ /** Trailing actions (e.g. a ⋯ menu IconButton). Rendered outside the toggle button; clicks do not toggle. */
32
+ actions?: ReactNode;
33
+ /** Prevent toggling. */
34
+ disabled?: boolean;
35
+ }
36
+ /** One collapsible section: a header row and a body that is hidden while collapsed. */
37
+ export declare function AccordionItem({ value, title, meta, icon, actions, disabled, className, children, ...rest }: AccordionItemProps): import('react').JSX.Element;
38
+ export interface AccordionRowProps extends HTMLAttributes<HTMLDivElement> {
39
+ /** Trailing actions (e.g. a ⋯ menu IconButton). */
40
+ actions?: ReactNode;
41
+ /** Pointer cursor + hover tint. */
42
+ interactive?: boolean;
43
+ /** Selected tint. */
44
+ selected?: boolean;
45
+ }
46
+ /** Child row inside a `grouped` AccordionItem: 64px, faint divider, text aligned with the group title. */
47
+ export declare function AccordionRow({ actions, interactive, selected, className, children, ...rest }: AccordionRowProps): import('react').JSX.Element;
48
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Accordion, AccordionItem, AccordionRow } from './Accordion';
2
+ export type { AccordionProps, AccordionItemProps, AccordionRowProps } from './Accordion';
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type AlertTone = 'info' | 'success' | 'warning' | 'error';
3
+ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
+ /** Colour and default icon. `info` uses the accent colour. */
5
+ tone?: AlertTone;
6
+ /** `subtle` tinted background (default) or `solid` tone fill. */
7
+ variant?: 'subtle' | 'solid';
8
+ /** Bold first line. */
9
+ title?: ReactNode;
10
+ /** Custom icon; `false` hides it. Defaults to a tone icon. */
11
+ icon?: ReactNode | false;
12
+ /** Action buttons at the end (e.g. a ghost `Button`). */
13
+ action?: ReactNode;
14
+ /** Show a dismiss X and call this when clicked. */
15
+ onDismiss?: () => void;
16
+ /** Accessible label of the dismiss button. */
17
+ dismissLabel?: string;
18
+ }
19
+ /**
20
+ * Inline banner for page or section messages. `warning` / `error` announce immediately (`role="alert"`),
21
+ * `info` / `success` politely (`role="status"`); override with `role`.
22
+ */
23
+ export declare function Alert({ tone, variant, title, icon, action, onDismiss, dismissLabel, role, className, children, ...rest }: AlertProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Alert } from './Alert';
2
+ export type { AlertProps, AlertTone } from './Alert';
@@ -0,0 +1,22 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
3
+ /** Product logo (28px SVG). */
4
+ logo?: ReactNode;
5
+ /** Product wordmark, e.g. "GO". */
6
+ wordmark?: ReactNode;
7
+ /** Right-side actions (bell, user menu). */
8
+ actions?: ReactNode;
9
+ /** Tenant/workspace tile at the far right, e.g. "Retail". */
10
+ tenant?: ReactNode;
11
+ /** Dark editor header (60px, #42464c). Children render as the centre content. */
12
+ editor?: boolean;
13
+ /** Editor mode: document title shown at the left. */
14
+ title?: ReactNode;
15
+ }
16
+ /** Top application bar. Light console (68px) by default, or `editor` for the dark 60px variant. */
17
+ export declare function AppBar({ logo, wordmark, actions, tenant, editor, title, className, children, ...rest }: AppBarProps): import('react').JSX.Element;
18
+ export interface AppBarChipProps extends HTMLAttributes<HTMLSpanElement> {
19
+ icon?: ReactNode;
20
+ }
21
+ /** Pill chip for the editor header (canvas size, duration). */
22
+ export declare function AppBarChip({ icon, className, children, ...rest }: AppBarChipProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { AppBar, AppBarChip } from './AppBar';
2
+ export type { AppBarProps, AppBarChipProps } from './AppBar';
@@ -0,0 +1,20 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ export type ArrowButtonDirection = 'left' | 'right';
3
+ export type ArrowButtonVariant = 'solid' | 'outline';
4
+ export type ArrowButtonSize = 'md' | 'lg';
5
+ export interface ArrowButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
6
+ /** Which side is pointed: `right` for Next / forward (default), `left` for Back. */
7
+ direction?: ArrowButtonDirection;
8
+ /** `solid` accent fill (primary step, default) or `outline` accent border (secondary step). */
9
+ variant?: ArrowButtonVariant;
10
+ /** `md` (button-md height) or `lg` (button-lg height, larger text; 72px under kiosk scale). */
11
+ size?: ArrowButtonSize;
12
+ /** Optional glyph (1em). Placed on the flat side, before the label. Decorative. */
13
+ icon?: ReactNode;
14
+ }
15
+ /**
16
+ * Step-navigation button with one pointed side, for kiosk and touch flows (Back / Next).
17
+ * The accessible name comes from `children`; pass `aria-label` if the content is icon-only.
18
+ * Figma: Tico RUN kiosk service selection (1:625).
19
+ */
20
+ export declare function ArrowButton({ direction, variant, size, icon, type, className, children, ...rest }: ArrowButtonProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ArrowButton } from './ArrowButton';
2
+ export type { ArrowButtonProps, ArrowButtonDirection, ArrowButtonVariant, ArrowButtonSize } from './ArrowButton';
@@ -0,0 +1,38 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type AvatarSize = 'sm' | 'md' | 'lg';
3
+ export type AvatarShape = 'circle' | 'square';
4
+ export type AvatarStatus = 'success' | 'warning' | 'error' | 'info' | 'neutral';
5
+ /** First letters of up to two words; a single CJK name yields its first character. */
6
+ export declare function getInitials(name: string, max?: number): string;
7
+ export interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
8
+ /** Image URL. Falls back to initials if missing or it fails to load. */
9
+ src?: string;
10
+ /** Person / device name. Used as the accessible label and to derive initials. */
11
+ name?: string;
12
+ /** Override the derived initials (1–2 characters) or pass an icon. */
13
+ fallback?: ReactNode;
14
+ /** 24 / 32 / 40px. @default 'md' */
15
+ size?: AvatarSize;
16
+ /** @default 'circle' */
17
+ shape?: AvatarShape;
18
+ /** Show a status dot at the bottom-right. */
19
+ status?: AvatarStatus;
20
+ /** Accessible text for the status dot, e.g. "Online". */
21
+ statusLabel?: string;
22
+ }
23
+ /** User / device picture with initials fallback and optional status dot. */
24
+ export declare function Avatar({ src, name, fallback, size, shape, status, statusLabel, className, ...rest }: AvatarProps): import('react').JSX.Element;
25
+ export interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {
26
+ /** Show at most this many avatars, then a "+N" chip. */
27
+ max?: number;
28
+ /** Size applied to every avatar and the "+N" chip. Overrides each child's size. @default 'md' */
29
+ size?: AvatarSize;
30
+ /** Shape applied to every avatar and the "+N" chip. */
31
+ shape?: AvatarShape;
32
+ /** Total count if larger than the number of children (e.g. server-side count). */
33
+ total?: number;
34
+ /** `Avatar` elements. */
35
+ children?: ReactNode;
36
+ }
37
+ /** Overlapping row of avatars with a "+N" overflow chip. */
38
+ export declare function AvatarGroup({ max, size, shape, total, className, children, ...rest }: AvatarGroupProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Avatar, AvatarGroup, getInitials } from './Avatar';
2
+ export type { AvatarProps, AvatarGroupProps, AvatarSize, AvatarShape, AvatarStatus } from './Avatar';
@@ -0,0 +1,30 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type BadgeTone = 'neutral' | 'rejected' | 'success' | 'warning' | 'error' | 'pending' | 'info' | 'new';
3
+ export type BadgeSolid = 'public' | 'private' | 'brand';
4
+ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
5
+ /** Soft tint + coloured text (Figma 狀態 / count pills). */
6
+ tone?: BadgeTone;
7
+ /** Solid pill with white bold 11px text (Figma authorization: Public / Private). Overrides `tone`. */
8
+ solid?: BadgeSolid;
9
+ /** Optional 12px icon, e.g. lock for Private. */
10
+ icon?: ReactNode;
11
+ /** Tiny uppercase tag (Figma NEW). */
12
+ tag?: boolean;
13
+ /** 10px text variant. */
14
+ small?: boolean;
15
+ }
16
+ /** Status pill. Radius 14, 8/4 padding, 12px. */
17
+ export declare function Badge({ tone, solid, icon, tag, small, className, children, ...rest }: BadgeProps): import('react').JSX.Element;
18
+ export type DotTone = 'neutral' | 'success' | 'error' | 'warning' | 'info' | 'pending';
19
+ /** 10px status dot (list sub-rows, info panel). */
20
+ export declare function StatusDot({ tone, small, label, className, ...rest }: HTMLAttributes<HTMLSpanElement> & {
21
+ tone?: DotTone;
22
+ small?: boolean;
23
+ label?: string;
24
+ }): import('react').JSX.Element;
25
+ /** Five-dot signal strength meter (Figma Wi-Fi quality). */
26
+ export declare function SignalDots({ level, max, label, className, ...rest }: HTMLAttributes<HTMLSpanElement> & {
27
+ level: number;
28
+ max?: number;
29
+ label?: string;
30
+ }): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Badge, StatusDot, SignalDots } from './Badge';
2
+ export type { BadgeProps, BadgeTone, BadgeSolid, DotTone } from './Badge';
@@ -0,0 +1,21 @@
1
+ import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
+ export interface BreadcrumbItem {
3
+ /** Item text. */
4
+ label: ReactNode;
5
+ /** Link target; renders an `<a>`. */
6
+ href?: string;
7
+ /** Click handler; renders a `<button>` when there is no `href`. */
8
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
9
+ }
10
+ export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
11
+ /** Trail from root to the current page. The last item is rendered as the current page (`aria-current="page"`). */
12
+ items: BreadcrumbItem[];
13
+ /** `md` 13px (default) or `lg` bold 20px — 36px under `data-scale="kiosk"` (服務 > 提款). */
14
+ size?: 'md' | 'lg';
15
+ /** Custom separator; defaults to a chevron. */
16
+ separator?: ReactNode;
17
+ /** Landmark label. Default "Breadcrumb". */
18
+ 'aria-label'?: string;
19
+ }
20
+ /** Location trail with chevron separators. */
21
+ export declare function Breadcrumb({ items, size, separator, className, 'aria-label': ariaLabel, ...rest }: BreadcrumbProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Breadcrumb } from './Breadcrumb';
2
+ export type { BreadcrumbProps, BreadcrumbItem } from './Breadcrumb';
@@ -0,0 +1,22 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ export type ButtonVariant = 'primary' | 'secondary' | 'accent' | 'ghost' | 'subtle' | 'link' | 'danger' | 'danger-outline';
3
+ export type ButtonSize = 'sm' | 'md' | 'lg' | 'xl';
4
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ /** Visual style. `primary` teal, `secondary` slate, `accent` purple, `danger` coral (刪除), `danger-outline` (停用). */
6
+ variant?: ButtonVariant;
7
+ /** `sm` 32px / 12px text (toolbars), `md` 36px / 13px, `lg` 44px / 14px (dialog actions), `xl` 50px / radius 5 (mobile). */
8
+ size?: ButtonSize;
9
+ /** Pill shape with an icon slot, as used for 新增 / 下載 page actions. */
10
+ rounded?: boolean;
11
+ /** Stretch to container width. */
12
+ block?: boolean;
13
+ /** Leading icon (20px SVG). */
14
+ icon?: ReactNode;
15
+ /** Small dropdown caret after the label; rotates when `aria-expanded` is true. */
16
+ caret?: boolean;
17
+ }
18
+ /**
19
+ * Standard action button. Composes `.kb-button` classes from @kabobcompany/css.
20
+ * Figma: `btn` (type / size / icon) and `elements/button/rounded`.
21
+ */
22
+ export declare function Button({ variant, size, rounded, block, icon, caret, type, className, children, ...rest }: ButtonProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
@@ -0,0 +1,37 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface CalendarEvent {
3
+ id: string;
4
+ title: string;
5
+ /** ISO date (YYYY-MM-DD), inclusive. */
6
+ start: string;
7
+ end: string;
8
+ }
9
+ export interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'title'> {
10
+ /** First day of the month to show, ISO date. */
11
+ month: string;
12
+ events?: CalendarEvent[];
13
+ selected?: string;
14
+ today?: string;
15
+ onSelect?: (date: string) => void;
16
+ onEventClick?: (event: CalendarEvent) => void;
17
+ /** Rows of events shown per cell before "+N more". */
18
+ maxVisible?: number;
19
+ weekdayLabels?: string[];
20
+ /** Replace the default "2025 July" title. */
21
+ title?: ReactNode;
22
+ }
23
+ /**
24
+ * Month grid (Figma cal 12877:29359). Multi-day events render as connected bars across cells.
25
+ * Layout is simplified: bars stack in event order per cell rather than reserving lanes across the week.
26
+ */
27
+ export declare function Calendar({ month, events, selected, today, onSelect, onEventClick, maxVisible, weekdayLabels, title, className, ...rest }: CalendarProps): import('react').JSX.Element;
28
+ export interface EventCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
29
+ index?: number;
30
+ title: ReactNode;
31
+ duration?: ReactNode;
32
+ range?: ReactNode;
33
+ actionLabel?: ReactNode;
34
+ onAction?: () => void;
35
+ }
36
+ /** Event summary beside the calendar (Figma list view 12877:29341). */
37
+ export declare function EventCard({ index, title, duration, range, actionLabel, onAction, className, ...rest }: EventCardProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Calendar, EventCard } from './Calendar';
2
+ export type { CalendarProps, CalendarEvent, EventCardProps } from './Calendar';
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
3
+ /** `muted` (default, #f6fafa folder card) | `surface` (white + border) | `elevated` (white + shadow). */
4
+ variant?: 'muted' | 'surface' | 'elevated';
5
+ /** Hover tint and pointer cursor. */
6
+ interactive?: boolean;
7
+ /** Centred media/icon area above the body. */
8
+ media?: ReactNode;
9
+ title?: ReactNode;
10
+ meta?: ReactNode;
11
+ }
12
+ /** Content container. Pass `title`/`meta` for the standard body, or your own children. */
13
+ export declare function Card({ variant, interactive, media, title, meta, className, children, ...rest }: CardProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Card } from './Card';
2
+ export type { CardProps } from './Card';
@@ -0,0 +1,47 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface CarouselProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
3
+ /** One child per slide. */
4
+ children: ReactNode;
5
+ /** Viewport aspect ratio, e.g. `'16 / 9'` or `1.5`. Omit to size by content. */
6
+ aspectRatio?: string | number;
7
+ /** Controlled slide index. */
8
+ index?: number;
9
+ /** Initial slide when uncontrolled. @default 0 */
10
+ defaultIndex?: number;
11
+ /** Called when the visible slide changes. */
12
+ onIndexChange?: (index: number) => void;
13
+ /** Wrap from the last slide to the first (and back). @default false */
14
+ loop?: boolean;
15
+ /**
16
+ * Advance automatically. Pauses on hover, keyboard focus and when the user presses pause;
17
+ * starts paused if the user prefers reduced motion. Implies `loop`.
18
+ */
19
+ autoplay?: boolean;
20
+ /** Autoplay delay in ms. @default 5000 */
21
+ interval?: number;
22
+ /** Show previous / next buttons. @default true */
23
+ showArrows?: boolean;
24
+ /** Show dot indicators. @default true */
25
+ showDots?: boolean;
26
+ /** Dots below the viewport, or overlaid on its bottom edge on a scrim. @default 'below' */
27
+ dotsPlacement?: 'below' | 'overlay';
28
+ /** Slide or cross-fade between slides. @default 'slide' */
29
+ transition?: 'slide' | 'fade';
30
+ /** Accessible name of the carousel. @default 'Carousel' */
31
+ label?: string;
32
+ /** Accessible label per slide. @default (i, n) => `${i + 1} / ${n}` */
33
+ slideLabel?: (index: number, count: number) => string;
34
+ /** Labels for the controls (localise here). */
35
+ labels?: {
36
+ previous?: string;
37
+ next?: string;
38
+ pause?: string;
39
+ play?: string;
40
+ goTo?: (index: number) => string;
41
+ };
42
+ }
43
+ /**
44
+ * Slides with prev/next buttons, pager dots and optional autoplay.
45
+ * Keyboard: Left/Right arrows while focus is inside the carousel; Home/End jump to the ends.
46
+ */
47
+ export declare function Carousel({ children, aspectRatio, index, defaultIndex, onIndexChange, loop: loopProp, autoplay, interval, showArrows, showDots, dotsPlacement, transition, label, slideLabel, labels, className, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, ...rest }: CarouselProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Carousel } from './Carousel';
2
+ export type { CarouselProps } from './Carousel';
@@ -0,0 +1,9 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
3
+ /** Visible label text. */
4
+ children?: ReactNode;
5
+ /** Mixed state for "select all" controls. */
6
+ indeterminate?: boolean;
7
+ }
8
+ /** 16px checkbox. Teal when checked. Native input stays in the DOM for forms and a11y. */
9
+ export declare function Checkbox({ children, indeterminate, className, ...rest }: CheckboxProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from './Checkbox';
2
+ export type { CheckboxProps } from './Checkbox';
@@ -0,0 +1,45 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface ChoiceChipOption {
3
+ /** Value reported to `onChange`. */
4
+ value: string;
5
+ /** Visible chip text. */
6
+ label: ReactNode;
7
+ /** Chip cannot be toggled. */
8
+ disabled?: boolean;
9
+ }
10
+ interface ChoiceChipsBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
11
+ /** Chips to render, in order. */
12
+ options: ChoiceChipOption[];
13
+ /** `sm` 32 · `md` 36 (default) · `lg` 44. */
14
+ size?: 'sm' | 'md' | 'lg';
15
+ /** Disables every chip. */
16
+ disabled?: boolean;
17
+ /** Form name for the underlying inputs. */
18
+ name?: string;
19
+ /** Accessible name for the group (use when there is no visible heading). */
20
+ 'aria-label'?: string;
21
+ }
22
+ export interface ChoiceChipsMultipleProps extends ChoiceChipsBaseProps {
23
+ /** Multi-select (default): each chip carries a check box. */
24
+ multiple?: true;
25
+ /** Selected values (controlled). */
26
+ value?: string[];
27
+ /** Initial selection when uncontrolled. */
28
+ defaultValue?: string[];
29
+ /** Called with the full selection after each toggle. */
30
+ onChange?: (value: string[]) => void;
31
+ }
32
+ export interface ChoiceChipsSingleProps extends ChoiceChipsBaseProps {
33
+ /** Single select: chips behave as radios and show no box. */
34
+ multiple: false;
35
+ /** Selected value (controlled). */
36
+ value?: string;
37
+ /** Initial value when uncontrolled. */
38
+ defaultValue?: string;
39
+ /** Called with the chosen value. */
40
+ onChange?: (value: string) => void;
41
+ }
42
+ export type ChoiceChipsProps = ChoiceChipsMultipleProps | ChoiceChipsSingleProps;
43
+ /** Wrap of selectable chips. Selected = brand tint, brand text, brand check box. Native inputs keep forms and keyboard working. */
44
+ export declare function ChoiceChips(props: ChoiceChipsProps): import('react').JSX.Element;
45
+ export {};
@@ -0,0 +1,2 @@
1
+ export { ChoiceChips } from './ChoiceChips';
2
+ export type { ChoiceChipsProps, ChoiceChipsMultipleProps, ChoiceChipsSingleProps, ChoiceChipOption } from './ChoiceChips';