@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.
- package/GUIDE.md +185 -0
- package/dist/components/Accordion/Accordion.d.ts +48 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Alert/Alert.d.ts +23 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/AppBar/AppBar.d.ts +22 -0
- package/dist/components/AppBar/index.d.ts +2 -0
- package/dist/components/ArrowButton/ArrowButton.d.ts +20 -0
- package/dist/components/ArrowButton/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +38 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +30 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +21 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +22 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Calendar/Calendar.d.ts +37 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Carousel/Carousel.d.ts +47 -0
- package/dist/components/Carousel/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/ChoiceChips/ChoiceChips.d.ts +45 -0
- package/dist/components/ChoiceChips/index.d.ts +2 -0
- package/dist/components/Combobox/Combobox.d.ts +23 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.d.ts +70 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DateRange/DateRange.d.ts +39 -0
- package/dist/components/DateRange/index.d.ts +2 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +12 -0
- package/dist/components/DescriptionList/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +24 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +28 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Dropdown/Dropdown.d.ts +65 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Editor/Editor.d.ts +60 -0
- package/dist/components/Editor/index.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.d.ts +17 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.d.ts +29 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/Filter/Filter.d.ts +27 -0
- package/dist/components/Filter/index.d.ts +2 -0
- package/dist/components/Floating/Floating.d.ts +50 -0
- package/dist/components/Floating/index.d.ts +4 -0
- package/dist/components/FormSection/FormSection.d.ts +40 -0
- package/dist/components/FormSection/index.d.ts +2 -0
- package/dist/components/IconButton/IconButton.d.ts +17 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +55 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Kbd/Kbd.d.ts +18 -0
- package/dist/components/Kbd/index.d.ts +2 -0
- package/dist/components/LayoutPicker/LayoutPicker.d.ts +69 -0
- package/dist/components/LayoutPicker/index.d.ts +2 -0
- package/dist/components/List/List.d.ts +67 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/Marquee/Marquee.d.ts +24 -0
- package/dist/components/Marquee/index.d.ts +2 -0
- package/dist/components/Media/Media.d.ts +19 -0
- package/dist/components/Media/index.d.ts +2 -0
- package/dist/components/Menu/Menu.d.ts +15 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/NumberBoard/NumberBoard.d.ts +47 -0
- package/dist/components/NumberBoard/index.d.ts +2 -0
- package/dist/components/NumberStepper/NumberStepper.d.ts +36 -0
- package/dist/components/NumberStepper/index.d.ts +2 -0
- package/dist/components/OptionCard/OptionCard.d.ts +66 -0
- package/dist/components/OptionCard/index.d.ts +2 -0
- package/dist/components/PageHeader/PageHeader.d.ts +25 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +10 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +8 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Progress/Progress.d.ts +24 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/QueueItem/QueueItem.d.ts +55 -0
- package/dist/components/QueueItem/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +6 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Resizable/Resizable.d.ts +40 -0
- package/dist/components/Resizable/index.d.ts +2 -0
- package/dist/components/Schedule/Schedule.d.ts +17 -0
- package/dist/components/Schedule/index.d.ts +2 -0
- package/dist/components/ScreenHeader/Clock.d.ts +21 -0
- package/dist/components/ScreenHeader/ScreenHeader.d.ts +21 -0
- package/dist/components/ScreenHeader/index.d.ts +4 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +17 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +10 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Separator/Separator.d.ts +21 -0
- package/dist/components/Separator/index.d.ts +2 -0
- package/dist/components/SideRail/SideRail.d.ts +16 -0
- package/dist/components/SideRail/index.d.ts +2 -0
- package/dist/components/Slider/Slider.d.ts +52 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +29 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/StatBar/StatBar.d.ts +18 -0
- package/dist/components/StatBar/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Summary/Summary.d.ts +10 -0
- package/dist/components/Summary/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +10 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +14 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/TagInput/TagInput.d.ts +27 -0
- package/dist/components/TagInput/index.d.ts +2 -0
- package/dist/components/TicketNumber/TicketNumber.d.ts +39 -0
- package/dist/components/TicketNumber/index.d.ts +2 -0
- package/dist/components/TileCard/TileCard.d.ts +49 -0
- package/dist/components/TileCard/index.d.ts +2 -0
- package/dist/components/TimeInput/TimeInput.d.ts +10 -0
- package/dist/components/TimeInput/index.d.ts +2 -0
- package/dist/components/Timeline/Timeline.d.ts +83 -0
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts +11 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +72 -0
- package/dist/components/ToggleGroup/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +21 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tree/Tree.d.ts +18 -0
- package/dist/components/Tree/index.d.ts +2 -0
- package/dist/components/Typography/Typography.d.ts +54 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +4935 -0
- package/dist/utils/floating.d.ts +29 -0
- package/package.json +39 -4
- package/README.md +0 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export declare function ScheduleBoard({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): import('react').JSX.Element;
|
|
3
|
+
export interface ScheduleColumnProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
day: ReactNode;
|
|
5
|
+
onAdd?: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** One weekday column with a teal add button (Figma 營業時間). */
|
|
8
|
+
export declare function ScheduleColumn({ day, onAdd, className, children, ...rest }: ScheduleColumnProps): import('react').JSX.Element;
|
|
9
|
+
export type ScheduleTone = 'blue' | 'green' | 'violet';
|
|
10
|
+
export interface ScheduleCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
tone?: ScheduleTone;
|
|
13
|
+
/** Menu trigger at the right of the header. */
|
|
14
|
+
menu?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/** Tinted action card: Wake (blue), Reboot (green), Sleep (violet). */
|
|
17
|
+
export declare function ScheduleCard({ title, tone, menu, className, children, ...rest }: ScheduleCardProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
/** Default clock pattern, as on the Figma kiosk header: `2020/03/25 Wed. 18:13`. */
|
|
3
|
+
export declare const CLOCK_DEFAULT_PATTERN = "YYYY/MM/DD ddd. HH:mm";
|
|
4
|
+
/**
|
|
5
|
+
* Minimal date formatter. Tokens: `YYYY` `MM` `DD` `ddd` (Sun–Sat) `HH` `mm` `ss`.
|
|
6
|
+
* Any other text is kept as is. Use the `format` function prop for locale-aware output.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatClock(date: Date, pattern?: string): string;
|
|
9
|
+
export interface ClockProps extends Omit<HTMLAttributes<HTMLTimeElement>, 'children'> {
|
|
10
|
+
/**
|
|
11
|
+
* Pattern string (see `formatClock`) or a function `(date) => string`.
|
|
12
|
+
* Default `"YYYY/MM/DD ddd. HH:mm"`.
|
|
13
|
+
*/
|
|
14
|
+
format?: string | ((date: Date) => string);
|
|
15
|
+
/** Fixed time to show. When set, the clock does not tick (deterministic stories and tests). */
|
|
16
|
+
now?: Date;
|
|
17
|
+
/** Tick interval in ms while live. Default 1000. */
|
|
18
|
+
interval?: number;
|
|
19
|
+
}
|
|
20
|
+
/** Live-updating date/time text for screen headers and boards. Renders a `<time>` element. */
|
|
21
|
+
export declare function Clock({ format, now, interval, className, ...rest }: ClockProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ScreenHeaderVariant = 'surface' | 'muted' | 'transparent';
|
|
3
|
+
export interface ScreenHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Background: `surface` white (default), `muted` subtle grey as on the Figma kiosk, `transparent` over a backdrop. */
|
|
5
|
+
variant?: ScreenHeaderVariant;
|
|
6
|
+
/** Soft shadow under the bar, separating it from the screen content. */
|
|
7
|
+
shadow?: boolean;
|
|
8
|
+
/** Left slot, e.g. a home button and opening hours (wrap text in `.kb-screen-header__info`). */
|
|
9
|
+
start?: ReactNode;
|
|
10
|
+
/** Centre slot, e.g. a logo (wrap in `.kb-screen-header__logo`). Falls back to `children`. */
|
|
11
|
+
center?: ReactNode;
|
|
12
|
+
/** Right slot, e.g. a language picker above a `Clock` (wrap both in `.kb-screen-header__stack`). */
|
|
13
|
+
end?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Three-slot top bar for customer-facing screens (ticket kiosks, signage, calling boards).
|
|
17
|
+
* The centre slot stays centred whatever the side slots contain. Height follows `data-scale`
|
|
18
|
+
* (120px under `data-scale="kiosk"`).
|
|
19
|
+
* Figma: Tico RUN kiosk header (1:625).
|
|
20
|
+
*/
|
|
21
|
+
export declare function ScreenHeader({ variant, shadow, start, center, end, className, children, ...rest }: ScreenHeaderProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SegmentedOption<T extends string = string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SegmentedControlProps<T extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
8
|
+
options: SegmentedOption<T>[];
|
|
9
|
+
value: T;
|
|
10
|
+
onChange: (value: T) => void;
|
|
11
|
+
/** Active item shows teal text on translucent bg (Figma settings_tab). */
|
|
12
|
+
accent?: boolean;
|
|
13
|
+
/** Items share the width equally. */
|
|
14
|
+
block?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Dark segmented toggle (Figma settings_tab / weekday_tab). Track stays dark in both themes. */
|
|
17
|
+
export declare function SegmentedControl<T extends string>({ options, value, onChange, accent, block, className, ...rest }: SegmentedControlProps<T>): import('react').JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode, SelectHTMLAttributes } from 'react';
|
|
2
|
+
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
3
|
+
/** Compact 12px variant (same as size="sm"). */
|
|
4
|
+
small?: boolean;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
/** Label above the control (12px bold). */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Native select styled like Input, with the 10x5 chevron from Figma. Pass `<option>` children. */
|
|
10
|
+
export declare function Select({ small, size, label, id, className, children, ...rest }: SelectProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export type SeparatorTone = 'default' | 'faint';
|
|
4
|
+
export interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Direction of the rule. Vertical stretches to the height of its flex row. */
|
|
6
|
+
orientation?: SeparatorOrientation;
|
|
7
|
+
/** `default` = border-default, `faint` = border-faint (toolbar / popover dividers). */
|
|
8
|
+
tone?: SeparatorTone;
|
|
9
|
+
/** Optional text centred between two rules, e.g. 或 / OR. */
|
|
10
|
+
label?: ReactNode;
|
|
11
|
+
/** Add space-4 margin on both sides of the rule. */
|
|
12
|
+
spaced?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Purely visual: hidden from assistive tech (`role="none"`).
|
|
15
|
+
* Set to false when the rule separates meaningful sections.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
decorative?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Thin rule between content groups. Horizontal or vertical, with an optional centred label. */
|
|
21
|
+
export declare function Separator({ orientation, tone, label, spaced, decorative, className, ...rest }: SeparatorProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface SideRailProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
}
|
|
4
|
+
/** 60px icon-only navigation rail. Compose with `RailItem`. */
|
|
5
|
+
export declare function SideRail({ className, children, ...rest }: SideRailProps): import('react').JSX.Element;
|
|
6
|
+
export interface RailItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
7
|
+
/** Accessible name; the item shows only an icon. */
|
|
8
|
+
label: string;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** Pin to the bottom of the rail (language switch). */
|
|
11
|
+
bottom?: boolean;
|
|
12
|
+
/** Red notification dot beside the icon. */
|
|
13
|
+
dot?: boolean;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function RailItem({ label, active, bottom, dot, className, children, ...rest }: RailItemProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type SliderValue = number | [number, number];
|
|
3
|
+
export type SliderMark = number | {
|
|
4
|
+
value: number;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export interface SliderProps<V extends SliderValue = number> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
8
|
+
/** Controlled value. Pass a `[low, high]` tuple for a range slider with two thumbs. */
|
|
9
|
+
value?: V;
|
|
10
|
+
/** Initial value when uncontrolled. A tuple makes it a range slider. */
|
|
11
|
+
defaultValue?: V;
|
|
12
|
+
/** Called continuously while dragging or on each key press. */
|
|
13
|
+
onChange?: (value: V) => void;
|
|
14
|
+
/** Called once when a drag ends or after a key press (commit point, e.g. to save volume). */
|
|
15
|
+
onChangeEnd?: (value: V) => void;
|
|
16
|
+
/** @default 0 */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** @default 100 */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** Increment; values snap to `min + n * step`. @default 1 */
|
|
21
|
+
step?: number;
|
|
22
|
+
/** Keyboard PageUp / PageDown increment. @default max(step, (max - min) / 10) */
|
|
23
|
+
pageStep?: number;
|
|
24
|
+
/** Minimum gap between the two thumbs of a range slider. @default 0 */
|
|
25
|
+
minDistance?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Tick marks: `true` = a tick at every step (only if ≤ 50 steps),
|
|
28
|
+
* or a list of values / `{ value, label }` objects. Labels render below the rail.
|
|
29
|
+
*/
|
|
30
|
+
marks?: boolean | SliderMark[];
|
|
31
|
+
/** Visible label above the rail; also the accessible name. */
|
|
32
|
+
label?: ReactNode;
|
|
33
|
+
/** Show the formatted value at the right of the label row. @default true when `label` is set */
|
|
34
|
+
showOutput?: boolean;
|
|
35
|
+
/** Value bubble over the thumb: on hover / focus / drag, always, or never. @default 'auto' */
|
|
36
|
+
tooltip?: 'auto' | 'always' | 'none';
|
|
37
|
+
/** Format the value for the tooltip, output and `aria-valuetext`, e.g. `(v) => v + '%'`. */
|
|
38
|
+
formatValue?: (value: number) => string;
|
|
39
|
+
/** Accessible names for the thumbs when there is no visible `label` (range: `[low, high]`). */
|
|
40
|
+
thumbLabels?: string | [string, string];
|
|
41
|
+
/** Smaller 12px knob / 3px rail. @default 'md' */
|
|
42
|
+
size?: 'sm' | 'md';
|
|
43
|
+
/** Disable interaction. */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Name of a hidden input (range: `name` twice) so the value submits with a form. */
|
|
46
|
+
name?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Horizontal slider for volume, opacity, zoom. Single value or range (two thumbs).
|
|
50
|
+
* Keyboard: arrows ±step, PageUp/PageDown ±pageStep, Home/End jump to the bounds.
|
|
51
|
+
*/
|
|
52
|
+
export declare function Slider<V extends SliderValue = number>({ value, defaultValue, onChange, onChangeEnd, min, max, step, pageStep, minDistance, marks, label, showOutput, tooltip, formatValue, thumbLabels, size, disabled, name, className, ...rest }: SliderProps<V>): import('react').JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** `sm` 16px (inline / buttons), `md` 24px (default), `lg` 40px (page / panel). */
|
|
5
|
+
size?: SpinnerSize;
|
|
6
|
+
/** Visible text next to (or under, with `vertical`) the ring. Also used as the accessible name. */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
/** Stack the label under the ring. */
|
|
9
|
+
vertical?: boolean;
|
|
10
|
+
/** `brand` accent colour (default) or `current` to inherit the text colour (e.g. inside a filled button). */
|
|
11
|
+
tone?: 'brand' | 'current';
|
|
12
|
+
/** Accessible name when no visible `label` is given. Default "Loading". */
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Brand-coloured loading spinner. Renders `role="status"`; slows down under prefers-reduced-motion. */
|
|
16
|
+
export declare function Spinner({ size, label, vertical, tone, className, 'aria-label': ariaLabel, ...rest }: SpinnerProps): import('react').JSX.Element;
|
|
17
|
+
export type SkeletonVariant = 'text' | 'rect' | 'circle';
|
|
18
|
+
export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
19
|
+
/** `text` one line of text height (default), `rect` block (64px default height), `circle` avatar / icon. */
|
|
20
|
+
variant?: SkeletonVariant;
|
|
21
|
+
/** CSS width (px number or length). Text lines default to 100%, circles to 36px. */
|
|
22
|
+
width?: number | string;
|
|
23
|
+
/** CSS height (px number or length). */
|
|
24
|
+
height?: number | string;
|
|
25
|
+
/** For `text`: render this many lines; the last one is 60% wide. */
|
|
26
|
+
lines?: number;
|
|
27
|
+
}
|
|
28
|
+
/** Placeholder shape with a shimmer while content loads. Hidden from assistive tech; shimmer stops under reduced motion. */
|
|
29
|
+
export declare function Skeleton({ variant, width, height, lines, className, style, ...rest }: SkeletonProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface StatBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Left summary, e.g. daily usage. Use `StatLabel` for the muted parts. */
|
|
4
|
+
summary?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/** White strip of counters above a list (Figma 裝置顯示狀態列). Put `Stat`s as children. */
|
|
7
|
+
export declare function StatBar({ summary, className, children, ...rest }: StatBarProps): import('react').JSX.Element;
|
|
8
|
+
export declare function StatLabel({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import('react').JSX.Element;
|
|
11
|
+
export type StatTone = 'success' | 'info' | 'warning' | 'error' | 'pending' | 'neutral';
|
|
12
|
+
export interface StatProps extends HTMLAttributes<HTMLSpanElement> {
|
|
13
|
+
tone?: StatTone;
|
|
14
|
+
icon: ReactNode;
|
|
15
|
+
/** Accessible description of what the number means. */
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Stat({ tone, icon, label, className, children, ...rest }: StatProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export declare function StepNav({ className, children, ...rest }: HTMLAttributes<HTMLElement>): import('react').JSX.Element;
|
|
3
|
+
export interface StepItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** "STEP 1", "STEP 3-2"… Omit for a plain title item like 功能總覽. */
|
|
5
|
+
step?: ReactNode;
|
|
6
|
+
/** The step being shown (teal). */
|
|
7
|
+
active?: boolean;
|
|
8
|
+
/** The selected sub-step (tint + teal border). */
|
|
9
|
+
current?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Vertical onboarding step (Figma 12874:27182). */
|
|
12
|
+
export declare function StepItem({ step, active, current, type, className, children, ...rest }: StepItemProps): import('react').JSX.Element;
|
|
13
|
+
/** Orange label used beside step instructions (Figma 12874:27233). */
|
|
14
|
+
export declare function StepTag({ step, className, children, ...rest }: HTMLAttributes<HTMLSpanElement> & {
|
|
15
|
+
step: ReactNode;
|
|
16
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface SummaryItem {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface SummaryProps extends HTMLAttributes<HTMLDListElement> {
|
|
7
|
+
items: SummaryItem[];
|
|
8
|
+
}
|
|
9
|
+
/** Read-only key/value strip on a teal tint (Figma 項目 block: UID, 建立時間, 版本, MAC address). */
|
|
10
|
+
export declare function Summary({ items, className, ...rest }: SummaryProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'role'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
/** Render the text as a 12px bold field label (Figma 定時返回). */
|
|
5
|
+
asLabel?: boolean;
|
|
6
|
+
/** Node after the text, e.g. an `InfoIcon`. */
|
|
7
|
+
extra?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** 28x16 toggle. Track turns teal and the knob slides right when on. */
|
|
10
|
+
export declare function Switch({ children, asLabel, extra, className, ...rest }: SwitchProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TabsProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** 12px variant with 32px gaps (Figma Month / Week / Day). */
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
}
|
|
6
|
+
/** Horizontal tab strip with teal underline. Compose with `<Tab>`. */
|
|
7
|
+
export declare function Tabs({ size, className, children, ...rest }: TabsProps): import('react').JSX.Element;
|
|
8
|
+
export interface TabProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
/** Selected tab: full opacity + 3px teal bar. */
|
|
10
|
+
active?: boolean;
|
|
11
|
+
/** Optional second line (12px, muted), as in the editor tab. */
|
|
12
|
+
subtitle?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function Tab({ active, subtitle, type, className, children, ...rest }: TabProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TagInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'size' | 'type'> {
|
|
3
|
+
/** Current tags (controlled). */
|
|
4
|
+
value: string[];
|
|
5
|
+
/** Called with the next tag list whenever a tag is added or removed. */
|
|
6
|
+
onChange: (tags: string[]) => void;
|
|
7
|
+
/** Label rendered above the control. */
|
|
8
|
+
label?: ReactNode;
|
|
9
|
+
/** Helper or error text below the control. */
|
|
10
|
+
hint?: ReactNode;
|
|
11
|
+
/** Marks the field invalid: red border and hint. */
|
|
12
|
+
error?: boolean;
|
|
13
|
+
/** `sm` 32 · `md` 36 · `lg` 44 (default). */
|
|
14
|
+
size?: 'sm' | 'md' | 'lg';
|
|
15
|
+
/** `inline`: chips wrap inside the field (default). `stacked`: field on top, chips below. */
|
|
16
|
+
layout?: 'inline' | 'stacked';
|
|
17
|
+
/** Keys that commit the typed text as a tag. Default Enter and comma. */
|
|
18
|
+
separators?: string[];
|
|
19
|
+
/** Allow the same tag twice. Default false (duplicates are ignored). */
|
|
20
|
+
allowDuplicates?: boolean;
|
|
21
|
+
/** Maximum number of tags; input is disabled once reached. */
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Accessible label for each chip's remove button. Default `Remove <tag>`. */
|
|
24
|
+
removeLabel?: (tag: string) => string;
|
|
25
|
+
}
|
|
26
|
+
/** Text input that turns Enter / comma into removable chips. Backspace on an empty field removes the last chip; pasted comma lists are split. */
|
|
27
|
+
export declare function TagInput({ value, onChange, label, hint, error, size, layout, separators, allowDuplicates, max, removeLabel, disabled, id, className, style, onKeyDown, onBlur, onPaste, placeholder, ...rest }: TagInputProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type TicketNumberSize = 'sm' | 'md' | 'lg' | 'xl' | 'display';
|
|
3
|
+
export type TicketNumberTone = 'default' | 'brand' | 'muted';
|
|
4
|
+
export interface TicketNumberMetaItem {
|
|
5
|
+
/** Muted label, e.g. "Ticket issue time". */
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** Value, e.g. "10:24". */
|
|
8
|
+
value: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface TicketNumberProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
11
|
+
/** The queue / ticket number. Rendered with tabular figures. */
|
|
12
|
+
number: ReactNode;
|
|
13
|
+
/** Caption for the number, e.g. "NOW" or "Your Queue Number". */
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* `sm` 20 · `md` 24 (rail card) · `lg` 48 · `xl` 72 · `display` 120 (signage / mobile hero).
|
|
17
|
+
* Sizes follow the font tokens, so `data-scale="kiosk"` enlarges them.
|
|
18
|
+
*/
|
|
19
|
+
size?: TicketNumberSize;
|
|
20
|
+
/** Number colour: `default` text, `brand` accent (now serving), `muted` (done / inactive). */
|
|
21
|
+
tone?: TicketNumberTone;
|
|
22
|
+
/** `stack` puts the label above; `inline` puts it on the baseline to the left ("NOW 713002"). */
|
|
23
|
+
layout?: 'stack' | 'inline';
|
|
24
|
+
/** Centre label, number and meta (mobile ticket page, signage). */
|
|
25
|
+
centered?: boolean;
|
|
26
|
+
/** Status pill slot, typically a `Badge` ("準備中"). */
|
|
27
|
+
status?: ReactNode;
|
|
28
|
+
/** Label / value pairs rendered as a description list under the number. */
|
|
29
|
+
meta?: TicketNumberMetaItem[];
|
|
30
|
+
/**
|
|
31
|
+
* Announce changes to screen readers (`aria-live="polite"`). Use on the one number that
|
|
32
|
+
* updates when a ticket is called, not on every number of a board.
|
|
33
|
+
*/
|
|
34
|
+
live?: boolean;
|
|
35
|
+
/** Free slot under the meta list, e.g. a name tag. */
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/** Queue / ticket number with optional label, status pill and meta list. */
|
|
39
|
+
export declare function TicketNumber({ number, label, size, tone, layout, centered, status, meta, live, className, children, ...rest }: TicketNumberProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type TileCardTone = 'brand' | 'neutral' | 'none';
|
|
3
|
+
export type TileCardIndicator = 'checkbox' | 'radio' | 'none';
|
|
4
|
+
export interface TileCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onChange' | 'onSelect'> {
|
|
5
|
+
/** Card title. Shown in the header band (or centred when `solid`). */
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
/** Optional icon before the title (sized to the title, 1em). */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** Header band colour: `brand` accent band with white title (default), `neutral` grey band, `none` no band. */
|
|
10
|
+
tone?: TileCardTone;
|
|
11
|
+
/**
|
|
12
|
+
* Trailing selection mark. Also sets the ARIA role when selectable:
|
|
13
|
+
* `checkbox` → role="checkbox", `radio` → role="radio", `none` → role="button" with aria-pressed.
|
|
14
|
+
*/
|
|
15
|
+
indicator?: TileCardIndicator;
|
|
16
|
+
/** Muted description in the body, clamped to two lines. */
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
/** Footer stats row, usually `TileStat` elements (laid out in equal columns). */
|
|
19
|
+
stats?: ReactNode;
|
|
20
|
+
/** Selected state: accent ring and tinted body; ticks the indicator. */
|
|
21
|
+
selected?: boolean;
|
|
22
|
+
/** Called with the next selected value when the card is activated (click, Enter or Space). */
|
|
23
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Make the card focusable and operable as a toggle. Defaults to true when `onSelectedChange` or
|
|
26
|
+
* `onClick` is given.
|
|
27
|
+
*/
|
|
28
|
+
selectable?: boolean;
|
|
29
|
+
/** Dimmed and not operable. */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Whole card filled with the accent and content centred (e.g. a "talk to staff" option). */
|
|
32
|
+
solid?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Large selectable tile for kiosk and touch screens: header band with a big title and a checkbox/radio
|
|
36
|
+
* mark, a short description and footer stats. Scales with `data-scale="kiosk"`.
|
|
37
|
+
* Figma: Tico RUN kiosk service selection (1:625).
|
|
38
|
+
*/
|
|
39
|
+
export declare function TileCard({ title, icon, tone, indicator, description, stats, selected, onSelectedChange, selectable, disabled, solid, className, children, onClick, onKeyDown, ...rest }: TileCardProps): import('react').JSX.Element;
|
|
40
|
+
export interface TileStatProps extends HTMLAttributes<HTMLDivElement> {
|
|
41
|
+
/** Big number, e.g. `10`. */
|
|
42
|
+
value: ReactNode;
|
|
43
|
+
/** Small unit after the value, e.g. `ppl`, `mins`. */
|
|
44
|
+
unit?: ReactNode;
|
|
45
|
+
/** Caption under the value, e.g. "Wait In Line". */
|
|
46
|
+
caption?: ReactNode;
|
|
47
|
+
}
|
|
48
|
+
/** One statistic in a TileCard footer: big value + small unit, with a muted caption. */
|
|
49
|
+
export declare function TileStat({ value, unit, caption, className, ...rest }: TileStatProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputProps } from '../Input/Input';
|
|
2
|
+
export interface TimeInputProps extends Omit<InputProps, 'type' | 'trailingIcon' | 'searchIcon' | 'suffix' | 'action'> {
|
|
3
|
+
/** Show a seconds field (sets `step` to 1 unless you pass one). */
|
|
4
|
+
withSeconds?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Native time input with the Input look and a 16px clock glyph. Value is `HH:MM` (or `HH:MM:SS` with `withSeconds`).
|
|
8
|
+
* Accepts every Input prop: `label`, `hint`, `error`, `size`, `min`, `max`, `step`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function TimeInput({ withSeconds, step, className, ...rest }: TimeInputProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A point in time. Either minutes (e.g. from midnight: 480 = 08:00, 1440 = 24:00) or a `Date`.
|
|
4
|
+
* Use one kind consistently for `start`, `end`, `now` and every item.
|
|
5
|
+
*/
|
|
6
|
+
export type TimeValue = number | Date;
|
|
7
|
+
export type TimelineTone = 'accent' | 'neutral' | 'success' | 'warning' | 'error' | 'violet';
|
|
8
|
+
export interface TimelineItem {
|
|
9
|
+
id: string;
|
|
10
|
+
start: TimeValue;
|
|
11
|
+
end: TimeValue;
|
|
12
|
+
/** Bar text, e.g. the playlist or schedule name. */
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
/** Bar colour. Default `accent`. */
|
|
15
|
+
tone?: TimelineTone;
|
|
16
|
+
/** Plain-text name for the accessible label / tooltip when `label` is not a string. */
|
|
17
|
+
title?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TimelineTrack {
|
|
20
|
+
id: string;
|
|
21
|
+
/** Row label, e.g. a screen or region name. Stays visible while scrolling horizontally. */
|
|
22
|
+
label: ReactNode;
|
|
23
|
+
/** Second line under the label, e.g. "Online · 1920×1080". */
|
|
24
|
+
meta?: ReactNode;
|
|
25
|
+
items: TimelineItem[];
|
|
26
|
+
}
|
|
27
|
+
export interface TimelineProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
28
|
+
/** Range start, e.g. `0` (00:00) or a Date. */
|
|
29
|
+
start: TimeValue;
|
|
30
|
+
/** Range end, e.g. `1440` (24:00) or a Date. */
|
|
31
|
+
end: TimeValue;
|
|
32
|
+
/** Rows to draw. Items overlapping in time stack into sub-rows within their track. */
|
|
33
|
+
tracks: TimelineTrack[];
|
|
34
|
+
/** Current time; draws a vertical line when inside the range. */
|
|
35
|
+
now?: TimeValue;
|
|
36
|
+
/** Id of the selected item (ring around the bar). */
|
|
37
|
+
selectedId?: string | null;
|
|
38
|
+
/** Makes items buttons; called when one is clicked or activated with Enter/Space. */
|
|
39
|
+
onSelect?: (item: TimelineItem, track: TimelineTrack) => void;
|
|
40
|
+
/** Zoom: pixel width of one hour. Default 80. */
|
|
41
|
+
pxPerHour?: number;
|
|
42
|
+
/** Width of the sticky label column, any CSS length. Default 160px (from CSS). */
|
|
43
|
+
labelWidth?: string;
|
|
44
|
+
/** Header text above the label column, e.g. "Screen". */
|
|
45
|
+
corner?: ReactNode;
|
|
46
|
+
/** Time formatter for ruler, bar times and accessible labels. Default `HH:MM`. */
|
|
47
|
+
formatTime?: (value: TimeValue) => string;
|
|
48
|
+
/** Hide the start–end time inside bars. Times still appear in the tooltip / accessible label. */
|
|
49
|
+
hideItemTimes?: boolean;
|
|
50
|
+
/** Shown when `tracks` is empty. */
|
|
51
|
+
emptyMessage?: ReactNode;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Horizontal time track for a day or any range: hour ruler, one row per track, bars per item, current-time
|
|
55
|
+
* line. Scrolls horizontally with the label column pinned. Works in light and dark themes.
|
|
56
|
+
*/
|
|
57
|
+
export declare function Timeline({ start, end, tracks, now, selectedId, onSelect, pxPerHour, labelWidth, corner, formatTime, hideItemTimes, emptyMessage, className, style, ...rest }: TimelineProps): import('react').JSX.Element;
|
|
58
|
+
export interface PlaylistStripItem {
|
|
59
|
+
id: string;
|
|
60
|
+
/** Content name. */
|
|
61
|
+
label: ReactNode;
|
|
62
|
+
/** Play duration in seconds; sets the block's relative width. */
|
|
63
|
+
duration: number;
|
|
64
|
+
/** Image URL or a node (e.g. a media-type icon) shown at the left of the block. */
|
|
65
|
+
thumbnail?: string | ReactNode;
|
|
66
|
+
}
|
|
67
|
+
export interface PlaylistStripProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
68
|
+
items: PlaylistStripItem[];
|
|
69
|
+
/** Id of the highlighted block. */
|
|
70
|
+
selectedId?: string | null;
|
|
71
|
+
/** Makes blocks buttons; called when one is clicked. */
|
|
72
|
+
onSelect?: (item: PlaylistStripItem) => void;
|
|
73
|
+
/** Duration formatter (seconds → text). Default `MM:SS`, or `H:MM:SS` from one hour. */
|
|
74
|
+
formatDuration?: (seconds: number) => string;
|
|
75
|
+
/** Caption above the total. Default "Total". Pass `null` to hide the total. */
|
|
76
|
+
totalLabel?: ReactNode;
|
|
77
|
+
/** Shown when `items` is empty. */
|
|
78
|
+
emptyMessage?: ReactNode;
|
|
79
|
+
/** Accessible name for the list. Default "Playlist". */
|
|
80
|
+
label?: string;
|
|
81
|
+
}
|
|
82
|
+
/** Compact single-row playlist: blocks proportional to duration (with a minimum width), total at the end. */
|
|
83
|
+
export declare function PlaylistStrip({ items, selectedId, onSelect, formatDuration, totalLabel, emptyMessage, label, className, ...rest }: PlaylistStripProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Optional accent bar. Not in Figma; added for review. */
|
|
4
|
+
tone?: 'neutral' | 'success' | 'error';
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Dark bottom-centre notice (Figma 防止登出密碼設定成功). Render inside `ToastRegion`. */
|
|
9
|
+
export declare function Toast({ tone, onClose, className, children, ...rest }: ToastProps): import('react').JSX.Element;
|
|
10
|
+
/** Fixed container at the bottom centre of the viewport. */
|
|
11
|
+
export declare function ToastRegion({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): import('react').JSX.Element;
|