@kabobcompany/react 0.0.0-stage → 0.2.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 (143) hide show
  1. package/GUIDE.md +210 -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 +29 -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 +57 -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/Layout/Layout.d.ts +127 -0
  61. package/dist/components/Layout/index.d.ts +2 -0
  62. package/dist/components/LayoutPicker/LayoutPicker.d.ts +69 -0
  63. package/dist/components/LayoutPicker/index.d.ts +2 -0
  64. package/dist/components/List/List.d.ts +67 -0
  65. package/dist/components/List/index.d.ts +2 -0
  66. package/dist/components/Marquee/Marquee.d.ts +24 -0
  67. package/dist/components/Marquee/index.d.ts +2 -0
  68. package/dist/components/Media/Media.d.ts +19 -0
  69. package/dist/components/Media/index.d.ts +2 -0
  70. package/dist/components/Menu/Menu.d.ts +15 -0
  71. package/dist/components/Menu/index.d.ts +2 -0
  72. package/dist/components/NumberBoard/NumberBoard.d.ts +47 -0
  73. package/dist/components/NumberBoard/index.d.ts +2 -0
  74. package/dist/components/NumberStepper/NumberStepper.d.ts +36 -0
  75. package/dist/components/NumberStepper/index.d.ts +2 -0
  76. package/dist/components/OptionCard/OptionCard.d.ts +66 -0
  77. package/dist/components/OptionCard/index.d.ts +2 -0
  78. package/dist/components/PageHeader/PageHeader.d.ts +25 -0
  79. package/dist/components/PageHeader/index.d.ts +2 -0
  80. package/dist/components/Pagination/Pagination.d.ts +10 -0
  81. package/dist/components/Pagination/index.d.ts +2 -0
  82. package/dist/components/Popover/Popover.d.ts +8 -0
  83. package/dist/components/Popover/index.d.ts +2 -0
  84. package/dist/components/Progress/Progress.d.ts +24 -0
  85. package/dist/components/Progress/index.d.ts +2 -0
  86. package/dist/components/QueueItem/QueueItem.d.ts +55 -0
  87. package/dist/components/QueueItem/index.d.ts +2 -0
  88. package/dist/components/Radio/Radio.d.ts +6 -0
  89. package/dist/components/Radio/index.d.ts +2 -0
  90. package/dist/components/Resizable/Resizable.d.ts +40 -0
  91. package/dist/components/Resizable/index.d.ts +2 -0
  92. package/dist/components/Schedule/Schedule.d.ts +17 -0
  93. package/dist/components/Schedule/index.d.ts +2 -0
  94. package/dist/components/ScreenHeader/Clock.d.ts +21 -0
  95. package/dist/components/ScreenHeader/ScreenHeader.d.ts +21 -0
  96. package/dist/components/ScreenHeader/index.d.ts +4 -0
  97. package/dist/components/SegmentedControl/SegmentedControl.d.ts +17 -0
  98. package/dist/components/SegmentedControl/index.d.ts +2 -0
  99. package/dist/components/Select/Select.d.ts +14 -0
  100. package/dist/components/Select/index.d.ts +2 -0
  101. package/dist/components/Separator/Separator.d.ts +21 -0
  102. package/dist/components/Separator/index.d.ts +2 -0
  103. package/dist/components/SideRail/SideRail.d.ts +18 -0
  104. package/dist/components/SideRail/index.d.ts +2 -0
  105. package/dist/components/Slider/Slider.d.ts +52 -0
  106. package/dist/components/Slider/index.d.ts +2 -0
  107. package/dist/components/Spinner/Spinner.d.ts +29 -0
  108. package/dist/components/Spinner/index.d.ts +2 -0
  109. package/dist/components/StatBar/StatBar.d.ts +18 -0
  110. package/dist/components/StatBar/index.d.ts +2 -0
  111. package/dist/components/Stepper/Stepper.d.ts +16 -0
  112. package/dist/components/Stepper/index.d.ts +2 -0
  113. package/dist/components/Summary/Summary.d.ts +10 -0
  114. package/dist/components/Summary/index.d.ts +2 -0
  115. package/dist/components/Switch/Switch.d.ts +10 -0
  116. package/dist/components/Switch/index.d.ts +2 -0
  117. package/dist/components/Tabs/Tabs.d.ts +14 -0
  118. package/dist/components/Tabs/index.d.ts +2 -0
  119. package/dist/components/TagInput/TagInput.d.ts +27 -0
  120. package/dist/components/TagInput/index.d.ts +2 -0
  121. package/dist/components/TicketNumber/TicketNumber.d.ts +39 -0
  122. package/dist/components/TicketNumber/index.d.ts +2 -0
  123. package/dist/components/TileCard/TileCard.d.ts +49 -0
  124. package/dist/components/TileCard/index.d.ts +2 -0
  125. package/dist/components/TimeInput/TimeInput.d.ts +10 -0
  126. package/dist/components/TimeInput/index.d.ts +2 -0
  127. package/dist/components/Timeline/Timeline.d.ts +83 -0
  128. package/dist/components/Timeline/index.d.ts +2 -0
  129. package/dist/components/Toast/Toast.d.ts +15 -0
  130. package/dist/components/Toast/index.d.ts +2 -0
  131. package/dist/components/ToggleGroup/ToggleGroup.d.ts +72 -0
  132. package/dist/components/ToggleGroup/index.d.ts +2 -0
  133. package/dist/components/Tooltip/Tooltip.d.ts +21 -0
  134. package/dist/components/Tooltip/index.d.ts +2 -0
  135. package/dist/components/Tree/Tree.d.ts +18 -0
  136. package/dist/components/Tree/index.d.ts +2 -0
  137. package/dist/components/Typography/Typography.d.ts +64 -0
  138. package/dist/components/Typography/index.d.ts +2 -0
  139. package/dist/index.d.ts +68 -0
  140. package/dist/index.js +5075 -0
  141. package/dist/utils/floating.d.ts +29 -0
  142. package/package.json +39 -4
  143. package/README.md +0 -3
@@ -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';
@@ -0,0 +1,23 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+ export interface ComboboxOption {
3
+ value: string;
4
+ label: string;
5
+ /** Extra text matched by the filter (e.g. pinyin, code). */
6
+ keywords?: string;
7
+ disabled?: boolean;
8
+ }
9
+ export interface ComboboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'size'> {
10
+ options: ComboboxOption[];
11
+ /** Selected value (controlled). */
12
+ value?: string | null;
13
+ defaultValue?: string | null;
14
+ onChange?: (value: string | null) => void;
15
+ /** Custom filter; default = case-insensitive substring on label + keywords. */
16
+ filter?: (option: ComboboxOption, query: string) => boolean;
17
+ /** Shown when nothing matches. */
18
+ emptyText?: ReactNode;
19
+ label?: ReactNode;
20
+ size?: 'sm' | 'md' | 'lg';
21
+ }
22
+ /** Searchable select: type to filter, arrows to move, Enter to pick, Escape to close. Reuses Dropdown's list styling. */
23
+ export declare function Combobox({ options, value, defaultValue, onChange, filter, emptyText, label, size, placeholder, disabled, id, className, ...rest }: ComboboxProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Combobox } from './Combobox';
2
+ export type { ComboboxProps, ComboboxOption } from './Combobox';
@@ -0,0 +1,70 @@
1
+ import { HTMLAttributes, Key, ReactNode } from 'react';
2
+ export type DataTableAlign = 'start' | 'center' | 'end';
3
+ export type DataTableSortDirection = 'ascending' | 'descending';
4
+ export interface DataTableSort {
5
+ /** Column key being sorted. */
6
+ key: string;
7
+ direction: DataTableSortDirection;
8
+ }
9
+ export interface DataTableColumn<T> {
10
+ /** Unique column key. Also the row field read when `render` is omitted. */
11
+ key: string;
12
+ /** Header label. */
13
+ label: ReactNode;
14
+ /** Fixed column width (px number or any CSS length). */
15
+ width?: number | string;
16
+ /** Cell and header alignment. Default `start`. Use `end` for numbers. */
17
+ align?: DataTableAlign;
18
+ /** Header becomes a sort button with a caret; sets `aria-sort`. */
19
+ sortable?: boolean;
20
+ /** Custom cell renderer. Defaults to `row[key]`. */
21
+ render?: (row: T, index: number) => ReactNode;
22
+ }
23
+ export interface DataTableProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange'> {
24
+ /** Column definitions. */
25
+ columns: DataTableColumn<T>[];
26
+ /** Row data. */
27
+ rows: T[];
28
+ /** Field name or function giving each row a stable unique key (used for React keys and selection). */
29
+ rowKey: keyof T | ((row: T) => Key);
30
+ /**
31
+ * Controlled sort state (`null` = unsorted). When controlled, the caller is responsible for ordering `rows`
32
+ * (e.g. server-side sorting). When omitted, the table sorts `rows` itself by the column's raw value.
33
+ */
34
+ sort?: DataTableSort | null;
35
+ /** Initial sort for the uncontrolled mode. */
36
+ defaultSort?: DataTableSort | null;
37
+ /** Called when a sortable header is clicked: ascending → descending → unsorted. */
38
+ onSortChange?: (sort: DataTableSort | null) => void;
39
+ /** Show a checkbox column with a select-all header. */
40
+ selectable?: boolean;
41
+ /** Controlled selected row keys. */
42
+ selectedKeys?: Key[];
43
+ /** Initially selected row keys (uncontrolled). */
44
+ defaultSelectedKeys?: Key[];
45
+ /** Called with the new selected row keys. */
46
+ onSelectionChange?: (keys: Key[]) => void;
47
+ /** Row click handler; adds a pointer cursor. */
48
+ onRowClick?: (row: T, index: number) => void;
49
+ /** Content shown when `rows` is empty and not loading (e.g. an `<EmptyState compact>`). */
50
+ empty?: ReactNode;
51
+ /** Loading state. With no rows the body shows `loadingContent`; with rows they are dimmed and `aria-busy` is set. */
52
+ loading?: boolean;
53
+ /** Content for the loading state. Defaults to a brand spinner. */
54
+ loadingContent?: ReactNode;
55
+ /** Keep the header visible while the body scrolls. Give the table a `style={{ maxHeight }}`. */
56
+ stickyHeader?: boolean;
57
+ /** 44px rows instead of 64px. */
58
+ dense?: boolean;
59
+ /** Accessible table caption (visually hidden). */
60
+ caption?: ReactNode;
61
+ /** Accessible label for the select-all checkbox. */
62
+ selectAllLabel?: string;
63
+ /** Accessible label for each row checkbox. */
64
+ selectRowLabel?: (row: T) => string;
65
+ }
66
+ /**
67
+ * Generic data table: 12px muted header, 64px rows with faint separators and hover tint, sortable columns
68
+ * (caret like the list header), optional checkbox selection, empty and loading states, sticky header, dense mode.
69
+ */
70
+ export declare function DataTable<T>({ columns, rows, rowKey, sort, defaultSort, onSortChange, selectable, selectedKeys, defaultSelectedKeys, onSelectionChange, onRowClick, empty, loading, loadingContent, stickyHeader, dense, caption, selectAllLabel, selectRowLabel, className, ...rest }: DataTableProps<T>): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DataTable } from './DataTable';
2
+ export type { DataTableProps, DataTableColumn, DataTableSort, DataTableSortDirection, DataTableAlign } from './DataTable';
@@ -0,0 +1,39 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ /** `[start, end]` as `YYYY-MM-DD` strings; an empty string means unset. */
3
+ export type DateRangeValue = [start: string, end: string];
4
+ export interface DateRangeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
5
+ /** Current range (controlled). */
6
+ value?: DateRangeValue;
7
+ /** Initial range when uncontrolled. */
8
+ defaultValue?: DateRangeValue;
9
+ /** Called with the new range when either date changes. */
10
+ onChange?: (value: DateRangeValue) => void;
11
+ /** Earliest selectable date (`YYYY-MM-DD`). The end date can never precede the start. */
12
+ min?: string;
13
+ /** Latest selectable date (`YYYY-MM-DD`). */
14
+ max?: string;
15
+ /** Label rendered above the field. */
16
+ label?: ReactNode;
17
+ /** Helper or error text below the field. */
18
+ hint?: ReactNode;
19
+ /** Marks the field invalid (red border). */
20
+ error?: boolean;
21
+ /** Disables both inputs. */
22
+ disabled?: boolean;
23
+ /** Marks both inputs required. */
24
+ required?: boolean;
25
+ /** `sm` 32 · `md` 36 · `lg` 44 (default). */
26
+ size?: 'sm' | 'md' | 'lg';
27
+ /** Stretch to the container width. */
28
+ block?: boolean;
29
+ /** Form names for the two inputs. */
30
+ startName?: string;
31
+ endName?: string;
32
+ /** Accessible names for the two inputs. Default "Start date" / "End date". */
33
+ startLabel?: string;
34
+ endLabel?: string;
35
+ /** Text between the dates. Default "~". */
36
+ separator?: ReactNode;
37
+ }
38
+ /** Two native date inputs styled as one field: "2022-07-04 ~ 2022-08-31" with a calendar glyph. */
39
+ export declare function DateRange({ value, defaultValue, onChange, min, max, label, hint, error, disabled, required, size, block, startName, endName, startLabel, endLabel, separator, className, id, ...rest }: DateRangeProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DateRange } from './DateRange';
2
+ export type { DateRangeProps, DateRangeValue } from './DateRange';
@@ -0,0 +1,12 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface DescriptionItem {
3
+ label: ReactNode;
4
+ value: ReactNode;
5
+ }
6
+ export interface DescriptionListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
7
+ title?: ReactNode;
8
+ items: DescriptionItem[];
9
+ columns?: number;
10
+ }
11
+ /** Tinted key/value panel (Figma Info 12864:21564). Values can hold `StatusDot` or `SignalDots`. */
12
+ export declare function DescriptionList({ title, items, columns, className, style, ...rest }: DescriptionListProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DescriptionList } from './DescriptionList';
2
+ export type { DescriptionListProps, DescriptionItem } from './DescriptionList';
@@ -0,0 +1,29 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ title?: ReactNode;
6
+ /** Primary actions at the right of the footer, typically `<Button size="lg">`. */
7
+ footer?: ReactNode;
8
+ /** Destructive actions at the left of the footer (刪除裝置 / 停用裝置). */
9
+ footerStart?: ReactNode;
10
+ /** 480px variant for confirmations; default is the 840px form lightbox. */
11
+ small?: boolean;
12
+ /** 960px variant (Info & Remote Access). */
13
+ large?: boolean;
14
+ /** Near full screen (80% of the viewport each way) for a work surface over a page; the body scrolls. */
15
+ full?: boolean;
16
+ /** Vertically centre instead of the 46px top offset. */
17
+ centered?: boolean;
18
+ /** `false` keeps the dialog open on a backdrop click (a form that would lose work). Escape and the close button still close. Default true. */
19
+ closeOnBackdrop?: boolean;
20
+ /** Hide the outside close button. */
21
+ hideClose?: boolean;
22
+ closeLabel?: string;
23
+ }
24
+ /**
25
+ * Modal lightbox (Figma 裝置設定). Black 50% backdrop, 840px white panel with header and footer dividers,
26
+ * close X outside the top-right corner. Closes on Escape and backdrop click.
27
+ * Focus moves into the panel when it opens, Tab stays inside it, and focus returns to the opener on close.
28
+ */
29
+ export declare function Dialog({ open, onClose, title, footer, footerStart, small, large, full, centered, closeOnBackdrop, hideClose, closeLabel, className, children, ...rest }: DialogProps): import('react').JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export { Dialog } from './Dialog';
2
+ export type { DialogProps } from './Dialog';
@@ -0,0 +1,28 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface DrawerProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
3
+ /** Whether the drawer is shown. */
4
+ open: boolean;
5
+ /** Called on Escape, overlay click (unless `closeOnOverlay` is false) and the close button. */
6
+ onClose: () => void;
7
+ /** Header title; also the dialog's accessible name. */
8
+ title?: ReactNode;
9
+ /** Primary actions at the right of the footer. */
10
+ footer?: ReactNode;
11
+ /** Secondary / destructive actions at the left of the footer. */
12
+ footerStart?: ReactNode;
13
+ /** Edge the panel slides in from. Default `right`. */
14
+ side?: 'left' | 'right';
15
+ /** Panel width: `sm` 360px, `md` 480px (default), `lg` 720px. */
16
+ size?: 'sm' | 'md' | 'lg';
17
+ /** Close when the overlay is clicked. Default true. */
18
+ closeOnOverlay?: boolean;
19
+ /** Hide the header close button. */
20
+ hideClose?: boolean;
21
+ /** Accessible label of the close button. */
22
+ closeLabel?: string;
23
+ }
24
+ /**
25
+ * Side panel over a 50% overlay, with Dialog-style header / body / footer. Closes on Escape and overlay click,
26
+ * keeps Tab focus inside the panel while open, and returns focus to the previously focused element on close.
27
+ */
28
+ export declare function Drawer({ open, onClose, title, footer, footerStart, side, size, closeOnOverlay, hideClose, closeLabel, className, children, ...rest }: DrawerProps): import('react').JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export { Drawer } from './Drawer';
2
+ export type { DrawerProps } from './Drawer';
@@ -0,0 +1,65 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ export interface DropdownOption {
3
+ /** Value reported to `onChange`. */
4
+ value: string;
5
+ /** Visible text; also used for type-ahead and the multiple summary. */
6
+ label: string;
7
+ /** Optional 16px icon before the label. */
8
+ icon?: ReactNode;
9
+ /** Option cannot be chosen. */
10
+ disabled?: boolean;
11
+ }
12
+ interface DropdownBaseProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onChange' | 'type' | 'role'> {
13
+ /** Options to list. */
14
+ options: DropdownOption[];
15
+ /** Text shown when nothing is selected. */
16
+ placeholder?: string;
17
+ /** `default` input look, or `pill`: fully rounded, auto width, for header selectors such as language. */
18
+ variant?: 'default' | 'pill';
19
+ /** `sm` 32 · `md` 36 · `lg` 44 (default). */
20
+ size?: 'sm' | 'md' | 'lg';
21
+ /** Leading icon in the trigger (e.g. a globe). If omitted, the selected option's icon is shown. */
22
+ icon?: ReactNode;
23
+ /** Label rendered above the control. */
24
+ label?: ReactNode;
25
+ /** Helper or error text below the control. */
26
+ hint?: ReactNode;
27
+ /** Marks the control invalid (red border). */
28
+ error?: boolean;
29
+ /** Open the list above the trigger. */
30
+ placement?: 'bottom' | 'top';
31
+ /** Align the popup to the trigger's end edge (useful for pills at the right of a header). */
32
+ alignEnd?: boolean;
33
+ /** Form field name; hidden inputs carry the value(s). */
34
+ name?: string;
35
+ /** Class on the outer `.kb-dropdown` wrapper (className goes there too). */
36
+ className?: string;
37
+ }
38
+ export interface DropdownSingleProps extends DropdownBaseProps {
39
+ /** Allow several selections. */
40
+ multiple?: false;
41
+ /** Selected value (controlled). */
42
+ value?: string;
43
+ /** Initial value when uncontrolled. */
44
+ defaultValue?: string;
45
+ /** Called with the chosen value. */
46
+ onChange?: (value: string) => void;
47
+ }
48
+ export interface DropdownMultipleProps extends DropdownBaseProps {
49
+ /** Allow several selections; the list stays open and the trigger shows a comma summary. */
50
+ multiple: true;
51
+ /** Selected values (controlled). */
52
+ value?: string[];
53
+ /** Initial values when uncontrolled. */
54
+ defaultValue?: string[];
55
+ /** Called with the full selection after each toggle. */
56
+ onChange?: (value: string[]) => void;
57
+ }
58
+ export type DropdownProps = DropdownSingleProps | DropdownMultipleProps;
59
+ /**
60
+ * Custom listbox select: a combobox button that opens a popup list.
61
+ * Keyboard: Enter / Space / ArrowDown opens, ArrowUp / ArrowDown / Home / End move, Enter selects,
62
+ * Escape / Tab close, typing jumps to the first matching label.
63
+ */
64
+ export declare function Dropdown(props: DropdownProps): import('react').JSX.Element;
65
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Dropdown } from './Dropdown';
2
+ export type { DropdownProps, DropdownSingleProps, DropdownMultipleProps, DropdownOption } from './Dropdown';
@@ -0,0 +1,60 @@
1
+ import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
2
+ /** Left/right editor column. `kind="content"` uses the darker playlist surface. */
3
+ export declare function EditorSidebar({ kind, className, children, ...rest }: HTMLAttributes<HTMLElement> & {
4
+ kind?: 'panel' | 'content';
5
+ }): import('react').JSX.Element;
6
+ export interface EditorPanelHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
7
+ title: ReactNode;
8
+ onAdd?: () => void;
9
+ action?: ReactNode;
10
+ }
11
+ /** "Content ⊕ … select" header (Figma sidebar/content). */
12
+ export declare function EditorPanelHeader({ title, onAdd, action, className, ...rest }: EditorPanelHeaderProps): import('react').JSX.Element;
13
+ export declare function EditorPanelFooter({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): import('react').JSX.Element;
14
+ export declare function ToolPalette({ onCollapse, className, children, ...rest }: HTMLAttributes<HTMLDivElement> & {
15
+ onCollapse?: () => void;
16
+ }): import('react').JSX.Element;
17
+ export declare function ToolRow({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): import('react').JSX.Element;
18
+ export interface ToolButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
19
+ label: string;
20
+ active?: boolean;
21
+ }
22
+ /** 48px tool (Figma tools_expand). Active = teal. */
23
+ export declare function ToolButton({ label, active, type, className, children, ...rest }: ToolButtonProps): import('react').JSX.Element;
24
+ export declare function LayerList({ title, className, children, ...rest }: HTMLAttributes<HTMLDivElement> & {
25
+ title?: ReactNode;
26
+ }): import('react').JSX.Element;
27
+ export interface LayerItemProps extends HTMLAttributes<HTMLDivElement> {
28
+ icon?: ReactNode;
29
+ active?: boolean;
30
+ }
31
+ export declare function LayerItem({ icon, active, className, children, ...rest }: LayerItemProps): import('react').JSX.Element;
32
+ export declare function PanelTitle({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): import('react').JSX.Element;
33
+ /** Grouped block of fields (Figma set up/all sections). */
34
+ export declare function PanelSection({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): import('react').JSX.Element;
35
+ export declare function SlideList({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): import('react').JSX.Element;
36
+ export interface SlideCardProps extends HTMLAttributes<HTMLDivElement> {
37
+ index: number;
38
+ duration: ReactNode;
39
+ name: ReactNode;
40
+ src?: string;
41
+ video?: boolean;
42
+ selected?: boolean;
43
+ /** Hover actions (24px round buttons). */
44
+ actions?: ReactNode;
45
+ /** Show the drag handle chip. */
46
+ handle?: boolean;
47
+ }
48
+ /** Playlist slide (Figma sidebar/content slide). */
49
+ export declare function SlideCard({ index, duration, name, src, video, selected, actions, handle, className, ...rest }: SlideCardProps): import('react').JSX.Element;
50
+ export interface ZoomControlProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
51
+ value: number;
52
+ onChange: (value: number) => void;
53
+ step?: number;
54
+ min?: number;
55
+ max?: number;
56
+ }
57
+ /** − 100 % + (Figma zoom in). */
58
+ export declare function ZoomControl({ value, onChange, step, min, max, className, ...rest }: ZoomControlProps): import('react').JSX.Element;
59
+ /** Teal "1920 x 1080" label under a selected canvas element. */
60
+ export declare function SizeLabel({ className, children, ...rest }: HTMLAttributes<HTMLSpanElement>): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { EditorSidebar, EditorPanelHeader, EditorPanelFooter, ToolPalette, ToolRow, ToolButton, LayerList, LayerItem, PanelTitle, PanelSection, SlideList, SlideCard, ZoomControl, SizeLabel } from './Editor';
2
+ export type { EditorPanelHeaderProps, ToolButtonProps, LayerItemProps, SlideCardProps, ZoomControlProps } from './Editor';
@@ -0,0 +1,17 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
3
+ /** 48px icon (32px when compact). */
4
+ icon?: ReactNode;
5
+ /** Free-size illustration; takes the place of `icon`. */
6
+ illustration?: ReactNode;
7
+ /** Optional headline, 14px medium. */
8
+ title?: ReactNode;
9
+ /** Muted explanatory text, e.g. "目前無處理中號碼,請點選左側號碼叫號。" */
10
+ description?: ReactNode;
11
+ /** Buttons shown under the text. */
12
+ action?: ReactNode;
13
+ /** Tighter padding and smaller type, for panels and table bodies. */
14
+ compact?: boolean;
15
+ }
16
+ /** Centred, muted placeholder for empty lists, panels and search results. */
17
+ export declare function EmptyState({ icon, illustration, title, description, action, compact, className, children, ...rest }: EmptyStateProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { EmptyState } from './EmptyState';
2
+ export type { EmptyStateProps } from './EmptyState';
@@ -0,0 +1,29 @@
1
+ import { LabelHTMLAttributes, ReactNode } from 'react';
2
+ export interface FileUploadProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'title' | 'onDrop'> {
3
+ /** Called with the chosen or dropped files (filtered by `accept`; one file unless `multiple`). */
4
+ onFiles: (files: File[]) => void;
5
+ /** Same as the native `accept`, e.g. `image/jpeg` or `.jpg,.png`. Dropped files are filtered by it. */
6
+ accept?: string;
7
+ /** Allow several files. */
8
+ multiple?: boolean;
9
+ /** Disables clicking and dropping. */
10
+ disabled?: boolean;
11
+ /** Marks the zone invalid (red border). */
12
+ error?: boolean;
13
+ /** Main line, e.g. "Please upload in jpg format". */
14
+ title?: ReactNode;
15
+ /** Secondary line, e.g. "500 x 500 px". */
16
+ hint?: ReactNode;
17
+ /** Replaces the default + icon. */
18
+ icon?: ReactNode;
19
+ /** Preview (typically an `<img>`) that fills the zone; title/hint appear over it on hover. */
20
+ preview?: ReactNode;
21
+ /** `default`: full-width 160px zone. `square`: 120px box for logos (set `--kb-file-upload-size` to resize). */
22
+ variant?: 'default' | 'square';
23
+ /** Form name for the underlying file input. */
24
+ name?: string;
25
+ /** Accessible name when no visible title is given. */
26
+ 'aria-label'?: string;
27
+ }
28
+ /** Dashed drop zone. Click opens the file picker; drag files over for a brand-tinted state. */
29
+ export declare function FileUpload({ onFiles, accept, multiple, disabled, error, title, hint, icon, preview, variant, name, className, 'aria-label': ariaLabel, onDragEnter, onDragOver, onDragLeave, ...rest }: FileUploadProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { FileUpload } from './FileUpload';
2
+ export type { FileUploadProps } from './FileUpload';
@@ -0,0 +1,27 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { CheckboxProps } from '../Checkbox';
3
+ export interface FilterGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
+ /** 12px bold heading, e.g. 發佈狀態. */
5
+ title: ReactNode;
6
+ }
7
+ /** Titled block inside a filter popover. Children are `FilterOption`s or a single control. */
8
+ export declare function FilterGroup({ title, className, children, ...rest }: FilterGroupProps): import('react').JSX.Element;
9
+ export interface FilterOptionProps extends CheckboxProps {
10
+ /** Result count shown in a pill at the right. */
11
+ count?: ReactNode;
12
+ }
13
+ /** Checkbox row with a trailing count pill (Figma checkbox_info full). */
14
+ export declare function FilterOption({ count, className, children, ...rest }: FilterOptionProps): import('react').JSX.Element;
15
+ export interface FilterSectionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onToggle'> {
16
+ /** 14px heading beside the checkbox, e.g. 裝置. */
17
+ title: ReactNode;
18
+ /** Controlled open state; the checkbox mirrors it. */
19
+ open?: boolean;
20
+ defaultOpen?: boolean;
21
+ onToggle?: (open: boolean) => void;
22
+ }
23
+ /**
24
+ * Checkbox-headed collapsible block (Figma 進階篩選). Checked = expanded on an inset panel.
25
+ * Put `PopoverColumns` with `FilterGroup`s inside.
26
+ */
27
+ export declare function FilterSection({ title, open, defaultOpen, onToggle, className, children, ...rest }: FilterSectionProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { FilterGroup, FilterOption, FilterSection } from './Filter';
2
+ export type { FilterGroupProps, FilterOptionProps, FilterSectionProps } from './Filter';
@@ -0,0 +1,50 @@
1
+ import { HTMLAttributes, MouseEvent, ReactElement, ReactNode } from 'react';
2
+ import { Placement } from '../../utils/floating';
3
+ type TriggerProps = {
4
+ ref?: unknown;
5
+ onClick?: (e: MouseEvent) => void;
6
+ 'aria-haspopup'?: string;
7
+ 'aria-expanded'?: boolean;
8
+ 'aria-controls'?: string;
9
+ };
10
+ export interface DropdownMenuProps {
11
+ /** The trigger element (usually a Button or IconButton). Receives ref, onClick and aria props. */
12
+ trigger: ReactElement<TriggerProps>;
13
+ /** `MenuItem`s (and `MenuDivider`s). Clicking an item closes the menu. */
14
+ children: ReactNode;
15
+ placement?: Placement;
16
+ open?: boolean;
17
+ defaultOpen?: boolean;
18
+ onOpenChange?: (open: boolean) => void;
19
+ /** Left-align item text (default is centred, like Menu). */
20
+ align?: 'center' | 'start';
21
+ /** Keep open after an item is chosen. */
22
+ keepOpen?: boolean;
23
+ className?: string;
24
+ }
25
+ /**
26
+ * Anchored dark menu (Figma module/popup/tooltip) opened from any trigger. Flips to stay on screen,
27
+ * renders in a portal, closes on outside click / Escape / item select, arrow keys move between items.
28
+ */
29
+ export declare function DropdownMenu({ trigger, children, placement, open, defaultOpen, onOpenChange, align, keepOpen, className }: DropdownMenuProps): import('react').JSX.Element;
30
+ export interface FloatingPopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {
31
+ trigger: ReactElement<TriggerProps>;
32
+ /** Panel content, rendered inside a `.kb-popover` surface. */
33
+ content: ReactNode;
34
+ placement?: Placement;
35
+ open?: boolean;
36
+ defaultOpen?: boolean;
37
+ onOpenChange?: (open: boolean) => void;
38
+ /** Accessible name for the dialog panel. */
39
+ label?: string;
40
+ }
41
+ /** Light panel (Popover surface) anchored to a trigger — filters, quick settings, hover-card style details. */
42
+ export declare function FloatingPopover({ trigger, content, placement, open, defaultOpen, onOpenChange, label, className, ...rest }: FloatingPopoverProps): import('react').JSX.Element;
43
+ export interface ContextMenuProps extends HTMLAttributes<HTMLDivElement> {
44
+ /** Menu shown at the pointer on right-click (or Shift+F10 / ContextMenu key). */
45
+ menu: ReactNode;
46
+ align?: 'center' | 'start';
47
+ }
48
+ /** Right-click menu for any area (layers, media tiles, list rows). */
49
+ export declare function ContextMenu({ menu, align, className, children, ...rest }: ContextMenuProps): import('react').JSX.Element;
50
+ export {};
@@ -0,0 +1,4 @@
1
+ export { DropdownMenu, FloatingPopover, ContextMenu } from './Floating';
2
+ export type { DropdownMenuProps, FloatingPopoverProps, ContextMenuProps } from './Floating';
3
+ export { useAnchoredPosition, useDismiss } from '../../utils/floating';
4
+ export type { Placement, AnchorOptions } from '../../utils/floating';
@@ -0,0 +1,40 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface FormSectionProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
3
+ /** Section title, 16px bold. Also the section's accessible name. */
4
+ title: ReactNode;
5
+ /** Muted 12px text under the title. */
6
+ description?: ReactNode;
7
+ /** Slot right after the title, e.g. an `InfoIcon`. */
8
+ info?: ReactNode;
9
+ /** Controls at the right end of the header row (e.g. a Switch enabling the whole section). */
10
+ headerActions?: ReactNode;
11
+ /** `stacked` header above content (default) or `aside` header in a left column, content on the right. */
12
+ layout?: 'stacked' | 'aside';
13
+ /** Heading level. Default 2. */
14
+ headingLevel?: 2 | 3 | 4;
15
+ }
16
+ /**
17
+ * Settings-page section: title (+ description / info) and content, 24px padding, full-width divider below.
18
+ * Put `FormSectionRow`s inside to align every label on one grid across sections.
19
+ */
20
+ export declare function FormSection({ title, description, info, headerActions, layout, headingLevel, className, children, ...rest }: FormSectionProps): import('react').JSX.Element;
21
+ export interface FormSectionRowProps extends HTMLAttributes<HTMLDivElement> {
22
+ /** Row label (13px medium) in the shared label column. */
23
+ label: ReactNode;
24
+ /** Muted hint under the label. */
25
+ hint?: ReactNode;
26
+ /** Slot beside the label text, e.g. an `InfoIcon`. */
27
+ labelExtra?: ReactNode;
28
+ /** Id of the control the label is for. When omitted the label is linked with `aria-labelledby` on the control group. */
29
+ htmlFor?: string;
30
+ }
31
+ /** Label / control pair on the section's label grid (label column 160px, controls line up across sections). */
32
+ export declare function FormSectionRow({ label, hint, labelExtra, htmlFor, className, children, ...rest }: FormSectionRowProps): import('react').JSX.Element;
33
+ export interface ActionFooterProps extends HTMLAttributes<HTMLDivElement> {
34
+ /** Content at the left (status text such as "尚未儲存的變更", or secondary actions). */
35
+ start?: ReactNode;
36
+ /** Stick to the bottom of the scroll container. Default true. */
37
+ sticky?: boolean;
38
+ }
39
+ /** Bottom action bar with right-aligned actions (Save). Sticky by default, 24px side padding to match FormSection. */
40
+ export declare function ActionFooter({ start, sticky, className, children, ...rest }: ActionFooterProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { FormSection, FormSectionRow, ActionFooter } from './FormSection';
2
+ export type { FormSectionProps, FormSectionRowProps, ActionFooterProps } from './FormSection';
@@ -0,0 +1,17 @@
1
+ import { ButtonHTMLAttributes } from 'react';
2
+ export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ /** Required accessible name, since the button has no visible text. */
4
+ label: string;
5
+ /** `md` 32px (default) or `sm` 24px hit area. */
6
+ size?: 'sm' | 'md';
7
+ /** Circular hit area (app bar actions). */
8
+ round?: boolean;
9
+ /** Chip-style filled background (dark editor toolbar). */
10
+ filled?: boolean;
11
+ /** Render at 50% opacity until hovered (row action icons). */
12
+ muted?: boolean;
13
+ /** Toggle state, sets `aria-pressed`. */
14
+ pressed?: boolean;
15
+ }
16
+ /** Square/round button that wraps a single 20px SVG icon. */
17
+ export declare function IconButton({ label, size, round, filled, muted, pressed, type, className, children, ...rest }: IconButtonProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { IconButton } from './IconButton';
2
+ export type { IconButtonProps } from './IconButton';