@openwarelabs/ui 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -2
  3. package/dist/components/Accordion/Accordion.d.cts +54 -0
  4. package/dist/components/Accordion/Accordion.d.ts +54 -0
  5. package/dist/components/Alert/Alert.d.cts +18 -0
  6. package/dist/components/Alert/Alert.d.ts +18 -0
  7. package/dist/components/Avatar/Avatar.d.cts +14 -0
  8. package/dist/components/Avatar/Avatar.d.ts +14 -0
  9. package/dist/components/Avatar/AvatarGroup.d.cts +28 -0
  10. package/dist/components/Avatar/AvatarGroup.d.ts +28 -0
  11. package/dist/components/Badge/Badge.d.cts +13 -0
  12. package/dist/components/Badge/Badge.d.ts +13 -0
  13. package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +33 -0
  14. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +33 -0
  15. package/dist/components/Button/Button.d.cts +42 -0
  16. package/dist/components/Button/Button.d.ts +42 -0
  17. package/dist/components/Button/ButtonGroup.d.cts +33 -0
  18. package/dist/components/Button/ButtonGroup.d.ts +33 -0
  19. package/dist/components/Calendar/Calendar.d.cts +31 -0
  20. package/dist/components/Calendar/Calendar.d.ts +31 -0
  21. package/dist/components/Calendar/DatePicker.d.cts +21 -0
  22. package/dist/components/Calendar/DatePicker.d.ts +21 -0
  23. package/dist/components/Calendar/dates.d.cts +15 -0
  24. package/dist/components/Calendar/dates.d.ts +15 -0
  25. package/dist/components/Card/Card.d.cts +18 -0
  26. package/dist/components/Card/Card.d.ts +18 -0
  27. package/dist/components/Checkbox/Checkbox.d.cts +59 -0
  28. package/dist/components/Checkbox/Checkbox.d.ts +59 -0
  29. package/dist/components/ChoiceCard/ChoiceCard.d.cts +14 -0
  30. package/dist/components/ChoiceCard/ChoiceCard.d.ts +14 -0
  31. package/dist/components/CodeBlock/CodeBlock.d.cts +50 -0
  32. package/dist/components/CodeBlock/CodeBlock.d.ts +50 -0
  33. package/dist/components/ColorPicker/ColorPicker.d.cts +62 -0
  34. package/dist/components/ColorPicker/ColorPicker.d.ts +62 -0
  35. package/dist/components/Combobox/Combobox.d.cts +42 -0
  36. package/dist/components/Combobox/Combobox.d.ts +42 -0
  37. package/dist/components/CommandPalette/CommandPalette.d.cts +27 -0
  38. package/dist/components/CommandPalette/CommandPalette.d.ts +27 -0
  39. package/dist/components/CommandPalette/filterCommands.d.cts +3 -0
  40. package/dist/components/CommandPalette/filterCommands.d.ts +3 -0
  41. package/dist/components/Dialog/Dialog.d.cts +42 -0
  42. package/dist/components/Dialog/Dialog.d.ts +42 -0
  43. package/dist/components/Drawer/Drawer.d.cts +23 -0
  44. package/dist/components/Drawer/Drawer.d.ts +23 -0
  45. package/dist/components/EmptyState/EmptyState.d.cts +18 -0
  46. package/dist/components/EmptyState/EmptyState.d.ts +18 -0
  47. package/dist/components/Field/Field.d.cts +18 -0
  48. package/dist/components/Field/Field.d.ts +18 -0
  49. package/dist/components/FileDropZone/FileDropZone.d.cts +29 -0
  50. package/dist/components/FileDropZone/FileDropZone.d.ts +29 -0
  51. package/dist/components/FileTree/FileTree.d.cts +29 -0
  52. package/dist/components/FileTree/FileTree.d.ts +29 -0
  53. package/dist/components/Input/Input.d.cts +18 -0
  54. package/dist/components/Input/Input.d.ts +18 -0
  55. package/dist/components/InputOTP/InputOTP.d.cts +31 -0
  56. package/dist/components/InputOTP/InputOTP.d.ts +31 -0
  57. package/dist/components/Kbd/Kbd.d.cts +5 -0
  58. package/dist/components/Kbd/Kbd.d.ts +5 -0
  59. package/dist/components/Layout/Layout.d.cts +50 -0
  60. package/dist/components/Layout/Layout.d.ts +50 -0
  61. package/dist/components/Marketing/Marketing.d.cts +39 -0
  62. package/dist/components/Marketing/Marketing.d.ts +39 -0
  63. package/dist/components/Menu/Menu.d.cts +43 -0
  64. package/dist/components/Menu/Menu.d.ts +43 -0
  65. package/dist/components/NavList/NavList.d.cts +27 -0
  66. package/dist/components/NavList/NavList.d.ts +27 -0
  67. package/dist/components/NumberField/NumberField.d.cts +23 -0
  68. package/dist/components/NumberField/NumberField.d.ts +23 -0
  69. package/dist/components/Pagination/Pagination.d.cts +24 -0
  70. package/dist/components/Pagination/Pagination.d.ts +24 -0
  71. package/dist/components/Popover/Popover.d.cts +30 -0
  72. package/dist/components/Popover/Popover.d.ts +30 -0
  73. package/dist/components/Progress/Progress.d.cts +41 -0
  74. package/dist/components/Progress/Progress.d.ts +41 -0
  75. package/dist/components/RadioGroup/RadioGroup.d.cts +36 -0
  76. package/dist/components/RadioGroup/RadioGroup.d.ts +36 -0
  77. package/dist/components/SearchField/SearchField.d.cts +17 -0
  78. package/dist/components/SearchField/SearchField.d.ts +17 -0
  79. package/dist/components/SegmentedControl/SegmentedControl.d.cts +32 -0
  80. package/dist/components/SegmentedControl/SegmentedControl.d.ts +32 -0
  81. package/dist/components/Select/Select.d.cts +40 -0
  82. package/dist/components/Select/Select.d.ts +40 -0
  83. package/dist/components/Skeleton/Skeleton.d.cts +26 -0
  84. package/dist/components/Skeleton/Skeleton.d.ts +26 -0
  85. package/dist/components/Slider/Slider.d.cts +33 -0
  86. package/dist/components/Slider/Slider.d.ts +33 -0
  87. package/dist/components/Spinner/Spinner.d.cts +14 -0
  88. package/dist/components/Spinner/Spinner.d.ts +14 -0
  89. package/dist/components/Stat/Stat.d.cts +20 -0
  90. package/dist/components/Stat/Stat.d.ts +20 -0
  91. package/dist/components/Steps/Steps.d.cts +27 -0
  92. package/dist/components/Steps/Steps.d.ts +27 -0
  93. package/dist/components/Switch/Switch.d.cts +9 -0
  94. package/dist/components/Switch/Switch.d.ts +9 -0
  95. package/dist/components/Table/Table.d.cts +55 -0
  96. package/dist/components/Table/Table.d.ts +55 -0
  97. package/dist/components/Tabs/Tabs.d.cts +35 -0
  98. package/dist/components/Tabs/Tabs.d.ts +35 -0
  99. package/dist/components/Tag/Tag.d.cts +40 -0
  100. package/dist/components/Tag/Tag.d.ts +40 -0
  101. package/dist/components/Textarea/Textarea.d.cts +12 -0
  102. package/dist/components/Textarea/Textarea.d.ts +12 -0
  103. package/dist/components/Toast/Toast.d.cts +41 -0
  104. package/dist/components/Toast/Toast.d.ts +41 -0
  105. package/dist/components/Tooltip/Tooltip.d.cts +19 -0
  106. package/dist/components/Tooltip/Tooltip.d.ts +19 -0
  107. package/dist/components.css +5236 -0
  108. package/dist/fonts.css +3 -0
  109. package/dist/hooks/useControllableState.d.cts +5 -0
  110. package/dist/hooks/useControllableState.d.ts +5 -0
  111. package/dist/hooks/useFloating.d.cts +26 -0
  112. package/dist/hooks/useFloating.d.ts +26 -0
  113. package/dist/hooks/useIndicator.d.cts +8 -0
  114. package/dist/hooks/useIndicator.d.ts +8 -0
  115. package/dist/hooks/useMenuKeyboard.d.cts +12 -0
  116. package/dist/hooks/useMenuKeyboard.d.ts +12 -0
  117. package/dist/hooks/useModalDialog.d.cts +9 -0
  118. package/dist/hooks/useModalDialog.d.ts +9 -0
  119. package/dist/hooks/usePresence.d.cts +13 -0
  120. package/dist/hooks/usePresence.d.ts +13 -0
  121. package/dist/icons.d.cts +33 -0
  122. package/dist/icons.d.ts +33 -0
  123. package/dist/index.cjs +4622 -0
  124. package/dist/index.cjs.map +7 -0
  125. package/dist/index.d.cts +114 -0
  126. package/dist/index.d.ts +114 -0
  127. package/dist/index.js +4650 -0
  128. package/dist/index.js.map +7 -0
  129. package/dist/openware-ui.iife.js +8 -0
  130. package/dist/styles.css +5664 -0
  131. package/dist/tailwind.css +145 -0
  132. package/dist/tokens.css +427 -0
  133. package/dist/tokens.json +1163 -0
  134. package/dist/utils/brand.d.cts +30 -0
  135. package/dist/utils/brand.d.ts +30 -0
  136. package/dist/utils/copyText.d.cts +2 -0
  137. package/dist/utils/copyText.d.ts +2 -0
  138. package/dist/utils/cx.d.cts +4 -0
  139. package/dist/utils/cx.d.ts +4 -0
  140. package/dist/utils/resizeTextArea.d.cts +2 -0
  141. package/dist/utils/resizeTextArea.d.ts +2 -0
  142. package/dist/utils/text.d.cts +4 -0
  143. package/dist/utils/text.d.ts +4 -0
  144. package/package.json +83 -4
@@ -0,0 +1,31 @@
1
+ import { type ISODate } from "./dates.cjs";
2
+ export interface CalendarProps {
3
+ /** The chosen date as "YYYY-MM-DD", or "" for none. */
4
+ value?: ISODate;
5
+ /** @default "" */
6
+ defaultValue?: ISODate;
7
+ onChange?(value: ISODate): void;
8
+ /** The earliest date that can be chosen, "YYYY-MM-DD". */
9
+ min?: ISODate;
10
+ /** The latest date that can be chosen. */
11
+ max?: ISODate;
12
+ /** Return true for dates that can't be chosen, such as weekends. */
13
+ isDateDisabled?(date: ISODate): boolean;
14
+ /** Month and day names follow this locale, e.g. "en-IE", "de-CH". Defaults to the browser's. */
15
+ locale?: string;
16
+ /** 1 starts weeks on Monday, 0 on Sunday.
17
+ * @default 1 */
18
+ weekStartsOn?: 0 | 1;
19
+ /** Focus the chosen (or today's) date on mount, for use in a popover.
20
+ * @default false */
21
+ autoFocus?: boolean;
22
+ className?: string;
23
+ }
24
+ export interface CalendarHandle {
25
+ focus(): void;
26
+ }
27
+ /**
28
+ * A month grid for picking a date. Arrow keys move by day and week, PageUp and PageDown by month
29
+ * (with Shift, by year), Home and End to the week's ends. Today is marked with a brass dot.
30
+ */
31
+ export declare const Calendar: import("react").ForwardRefExoticComponent<CalendarProps & import("react").RefAttributes<CalendarHandle>>;
@@ -0,0 +1,31 @@
1
+ import { type ISODate } from "./dates.js";
2
+ export interface CalendarProps {
3
+ /** The chosen date as "YYYY-MM-DD", or "" for none. */
4
+ value?: ISODate;
5
+ /** @default "" */
6
+ defaultValue?: ISODate;
7
+ onChange?(value: ISODate): void;
8
+ /** The earliest date that can be chosen, "YYYY-MM-DD". */
9
+ min?: ISODate;
10
+ /** The latest date that can be chosen. */
11
+ max?: ISODate;
12
+ /** Return true for dates that can't be chosen, such as weekends. */
13
+ isDateDisabled?(date: ISODate): boolean;
14
+ /** Month and day names follow this locale, e.g. "en-IE", "de-CH". Defaults to the browser's. */
15
+ locale?: string;
16
+ /** 1 starts weeks on Monday, 0 on Sunday.
17
+ * @default 1 */
18
+ weekStartsOn?: 0 | 1;
19
+ /** Focus the chosen (or today's) date on mount, for use in a popover.
20
+ * @default false */
21
+ autoFocus?: boolean;
22
+ className?: string;
23
+ }
24
+ export interface CalendarHandle {
25
+ focus(): void;
26
+ }
27
+ /**
28
+ * A month grid for picking a date. Arrow keys move by day and week, PageUp and PageDown by month
29
+ * (with Shift, by year), Home and End to the week's ends. Today is marked with a brass dot.
30
+ */
31
+ export declare const Calendar: import("react").ForwardRefExoticComponent<CalendarProps & import("react").RefAttributes<CalendarHandle>>;
@@ -0,0 +1,21 @@
1
+ import { type CalendarProps } from "./Calendar.cjs";
2
+ export interface DatePickerProps extends Omit<CalendarProps, "autoFocus" | "className"> {
3
+ /** Shown when no date is chosen.
4
+ * @default "Pick a date" */
5
+ placeholder?: string;
6
+ /** How the chosen date is written in the field.
7
+ * @default { dateStyle: "medium" } */
8
+ formatOptions?: Intl.DateTimeFormatOptions;
9
+ /** @default "md" */
10
+ size?: "sm" | "md";
11
+ /** @default false */
12
+ isInvalid?: boolean;
13
+ disabled?: boolean;
14
+ id?: string;
15
+ "aria-label"?: string;
16
+ "aria-labelledby"?: string;
17
+ "aria-describedby"?: string;
18
+ className?: string;
19
+ }
20
+ /** A field that opens a Calendar. Choosing a date closes it; Escape closes it without changing anything. */
21
+ export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,21 @@
1
+ import { type CalendarProps } from "./Calendar.js";
2
+ export interface DatePickerProps extends Omit<CalendarProps, "autoFocus" | "className"> {
3
+ /** Shown when no date is chosen.
4
+ * @default "Pick a date" */
5
+ placeholder?: string;
6
+ /** How the chosen date is written in the field.
7
+ * @default { dateStyle: "medium" } */
8
+ formatOptions?: Intl.DateTimeFormatOptions;
9
+ /** @default "md" */
10
+ size?: "sm" | "md";
11
+ /** @default false */
12
+ isInvalid?: boolean;
13
+ disabled?: boolean;
14
+ id?: string;
15
+ "aria-label"?: string;
16
+ "aria-labelledby"?: string;
17
+ "aria-describedby"?: string;
18
+ className?: string;
19
+ }
20
+ /** A field that opens a Calendar. Choosing a date closes it; Escape closes it without changing anything. */
21
+ export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,15 @@
1
+ /** Dates as "YYYY-MM-DD" strings: no time, no time zone, so a date never shifts by a day. */
2
+ export type ISODate = string;
3
+ export declare function toISO(year: number, month: number, day: number): ISODate;
4
+ export declare function parseISO(iso: ISODate): {
5
+ year: number;
6
+ month: number;
7
+ day: number;
8
+ };
9
+ export declare function todayISO(): ISODate;
10
+ export declare function addDays(iso: ISODate, days: number): ISODate;
11
+ export declare function addMonths(iso: ISODate, months: number): ISODate;
12
+ /** 0 = Sunday … 6 = Saturday. */
13
+ export declare function weekday(iso: ISODate): number;
14
+ export declare function toDate(iso: ISODate): Date;
15
+ export declare function formatDate(iso: ISODate, locale: string | undefined, options: Intl.DateTimeFormatOptions): string;
@@ -0,0 +1,15 @@
1
+ /** Dates as "YYYY-MM-DD" strings: no time, no time zone, so a date never shifts by a day. */
2
+ export type ISODate = string;
3
+ export declare function toISO(year: number, month: number, day: number): ISODate;
4
+ export declare function parseISO(iso: ISODate): {
5
+ year: number;
6
+ month: number;
7
+ day: number;
8
+ };
9
+ export declare function todayISO(): ISODate;
10
+ export declare function addDays(iso: ISODate, days: number): ISODate;
11
+ export declare function addMonths(iso: ISODate, months: number): ISODate;
12
+ /** 0 = Sunday … 6 = Saturday. */
13
+ export declare function weekday(iso: ISODate): number;
14
+ export declare function toDate(iso: ISODate): Date;
15
+ export declare function formatDate(iso: ISODate, locale: string | undefined, options: Intl.DateTimeFormatOptions): string;
@@ -0,0 +1,18 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** `none` for a card that holds a list or table edge to edge; `md` is 16px, `lg` 24px.
4
+ * @default "md" */
5
+ padding?: "none" | "md" | "lg";
6
+ }
7
+ /** A surface with a hairline border and no shadow: borders before shadows. */
8
+ export declare function Card({ className, padding, ...props }: CardProps): import("react").JSX.Element;
9
+ export interface SettingsRowProps {
10
+ label: ReactNode;
11
+ /** A muted line or two under the label. */
12
+ description?: ReactNode;
13
+ /** The control: a Switch, a Select, a Button. */
14
+ children: ReactNode;
15
+ className?: string;
16
+ }
17
+ /** A label on the left and its control on the right, like macOS System Settings. Stack them in a Card. */
18
+ export declare function SettingsRow({ children, description, label, className }: SettingsRowProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** `none` for a card that holds a list or table edge to edge; `md` is 16px, `lg` 24px.
4
+ * @default "md" */
5
+ padding?: "none" | "md" | "lg";
6
+ }
7
+ /** A surface with a hairline border and no shadow: borders before shadows. */
8
+ export declare function Card({ className, padding, ...props }: CardProps): import("react").JSX.Element;
9
+ export interface SettingsRowProps {
10
+ label: ReactNode;
11
+ /** A muted line or two under the label. */
12
+ description?: ReactNode;
13
+ /** The control: a Switch, a Select, a Button. */
14
+ children: ReactNode;
15
+ className?: string;
16
+ }
17
+ /** A label on the left and its control on the right, like macOS System Settings. Stack them in a Card. */
18
+ export declare function SettingsRow({ children, description, label, className }: SettingsRowProps): import("react").JSX.Element;
@@ -0,0 +1,59 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
3
+ /** `sm` is 14px, for dense rows; `md` is 16px.
4
+ * @default "md" */
5
+ size?: "sm" | "md";
6
+ /** `danger` for choices that make an action destructive, like also deleting files.
7
+ * @default "primary" */
8
+ tone?: "primary" | "danger";
9
+ /** Shows a dash: some, not all, of what it controls is checked (a "select all" box).
10
+ * @default false */
11
+ indeterminate?: boolean;
12
+ /** The label. With it, Checkbox renders its own <label>; without it, wrap it in yours. */
13
+ children?: ReactNode;
14
+ /** A muted line under the label. */
15
+ description?: ReactNode;
16
+ }
17
+ /**
18
+ * A real checkbox input, restyled. It keeps native behaviour (Space to toggle, form submission, `disabled`).
19
+ * Give it children for its label, or wrap the bare box in your own <label>. Inside a CheckboxGroup, give it a `value`.
20
+ */
21
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
22
+ export interface CheckboxGroupProps {
23
+ /** The question, shown as the group's legend. */
24
+ label: ReactNode;
25
+ /** A muted line under the label. */
26
+ description?: ReactNode;
27
+ /** The checked values. */
28
+ value?: string[];
29
+ /** @default [] */
30
+ defaultValue?: string[];
31
+ onChange?(value: string[]): void;
32
+ /** @default "vertical" */
33
+ orientation?: "vertical" | "horizontal";
34
+ /** An error under the options. */
35
+ error?: ReactNode;
36
+ disabled?: boolean;
37
+ /** The form field name for every box. */
38
+ name?: string;
39
+ /** Checkboxes, each with a `value` and a label. */
40
+ children: ReactNode;
41
+ className?: string;
42
+ }
43
+ /** Several options where any number can be chosen, under one label. */
44
+ export declare function CheckboxGroup({ label, description, value, defaultValue, onChange, orientation, error, disabled, name, children, className, }: CheckboxGroupProps): import("react").JSX.Element;
45
+ export interface FieldsetProps {
46
+ /** The group's title. */
47
+ legend: ReactNode;
48
+ /** A muted line under the legend. */
49
+ description?: ReactNode;
50
+ /** An error under the content, announced when it appears. */
51
+ error?: ReactNode;
52
+ /** @internal */
53
+ errorId?: string;
54
+ disabled?: boolean;
55
+ children: ReactNode;
56
+ className?: string;
57
+ }
58
+ /** Groups related controls under a legend: a set of checkboxes, an address, a pair of dates. */
59
+ export declare function Fieldset({ legend, description, error, errorId, disabled, children, className }: FieldsetProps): import("react").JSX.Element;
@@ -0,0 +1,59 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
3
+ /** `sm` is 14px, for dense rows; `md` is 16px.
4
+ * @default "md" */
5
+ size?: "sm" | "md";
6
+ /** `danger` for choices that make an action destructive, like also deleting files.
7
+ * @default "primary" */
8
+ tone?: "primary" | "danger";
9
+ /** Shows a dash: some, not all, of what it controls is checked (a "select all" box).
10
+ * @default false */
11
+ indeterminate?: boolean;
12
+ /** The label. With it, Checkbox renders its own <label>; without it, wrap it in yours. */
13
+ children?: ReactNode;
14
+ /** A muted line under the label. */
15
+ description?: ReactNode;
16
+ }
17
+ /**
18
+ * A real checkbox input, restyled. It keeps native behaviour (Space to toggle, form submission, `disabled`).
19
+ * Give it children for its label, or wrap the bare box in your own <label>. Inside a CheckboxGroup, give it a `value`.
20
+ */
21
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
22
+ export interface CheckboxGroupProps {
23
+ /** The question, shown as the group's legend. */
24
+ label: ReactNode;
25
+ /** A muted line under the label. */
26
+ description?: ReactNode;
27
+ /** The checked values. */
28
+ value?: string[];
29
+ /** @default [] */
30
+ defaultValue?: string[];
31
+ onChange?(value: string[]): void;
32
+ /** @default "vertical" */
33
+ orientation?: "vertical" | "horizontal";
34
+ /** An error under the options. */
35
+ error?: ReactNode;
36
+ disabled?: boolean;
37
+ /** The form field name for every box. */
38
+ name?: string;
39
+ /** Checkboxes, each with a `value` and a label. */
40
+ children: ReactNode;
41
+ className?: string;
42
+ }
43
+ /** Several options where any number can be chosen, under one label. */
44
+ export declare function CheckboxGroup({ label, description, value, defaultValue, onChange, orientation, error, disabled, name, children, className, }: CheckboxGroupProps): import("react").JSX.Element;
45
+ export interface FieldsetProps {
46
+ /** The group's title. */
47
+ legend: ReactNode;
48
+ /** A muted line under the legend. */
49
+ description?: ReactNode;
50
+ /** An error under the content, announced when it appears. */
51
+ error?: ReactNode;
52
+ /** @internal */
53
+ errorId?: string;
54
+ disabled?: boolean;
55
+ children: ReactNode;
56
+ className?: string;
57
+ }
58
+ /** Groups related controls under a legend: a set of checkboxes, an address, a pair of dates. */
59
+ export declare function Fieldset({ legend, description, error, errorId, disabled, children, className }: FieldsetProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
+ export interface ChoiceCardProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "title"> {
3
+ title: string;
4
+ /** One line under the title saying what this choice does. */
5
+ description: string;
6
+ /** A 20px lucide-react icon, shown on a tinted tile. */
7
+ icon: ReactNode;
8
+ /** Marks the recommended choice with a tinted border. */
9
+ recommended?: boolean;
10
+ /** Keyboard shortcut shown in the top-right corner, e.g. "⌘N". Only pass one that actually works. */
11
+ shortcut?: string;
12
+ }
13
+ /** A large, card-shaped button for picking between a few options, e.g. on an empty state. */
14
+ export declare const ChoiceCard: import("react").ForwardRefExoticComponent<ChoiceCardProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,14 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
+ export interface ChoiceCardProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "title"> {
3
+ title: string;
4
+ /** One line under the title saying what this choice does. */
5
+ description: string;
6
+ /** A 20px lucide-react icon, shown on a tinted tile. */
7
+ icon: ReactNode;
8
+ /** Marks the recommended choice with a tinted border. */
9
+ recommended?: boolean;
10
+ /** Keyboard shortcut shown in the top-right corner, e.g. "⌘N". Only pass one that actually works. */
11
+ shortcut?: string;
12
+ }
13
+ /** A large, card-shaped button for picking between a few options, e.g. on an empty state. */
14
+ export declare const ChoiceCard: import("react").ForwardRefExoticComponent<ChoiceCardProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,50 @@
1
+ import { type ReactNode } from "react";
2
+ export interface CopyButtonProps {
3
+ /** The text to copy. */
4
+ value: string;
5
+ /** Shown beside the icon, and read out.
6
+ * @default "Copy" */
7
+ label?: string;
8
+ /** Shown for two seconds after copying.
9
+ * @default "Copied" */
10
+ copiedLabel?: string;
11
+ /** Just the icon; the label is still read out.
12
+ * @default false */
13
+ iconOnly?: boolean;
14
+ /** `default` sits on surfaces; `onDark` sits on a code block.
15
+ * @default "default" */
16
+ tone?: "default" | "onDark";
17
+ onCopy?(): void;
18
+ className?: string;
19
+ }
20
+ /** Copies a value and says so: the icon turns into a check for two seconds and screen readers hear "Copied". */
21
+ export declare function CopyButton({ value, label, copiedLabel, iconOnly, tone, onCopy, className }: CopyButtonProps): import("react").JSX.Element;
22
+ export interface CodeBlockProps {
23
+ /** The code, as plain text. It's what the copy button copies. */
24
+ code: string;
25
+ /** Pre-highlighted HTML for the code (from Shiki or Prism, say). Without it the code shows plain. */
26
+ html?: string;
27
+ /** A file name or caption in the header. */
28
+ title?: ReactNode;
29
+ /** Shown on the right of the header, e.g. "tsx". */
30
+ language?: string;
31
+ /** @default false */
32
+ showLineNumbers?: boolean;
33
+ /** @default true */
34
+ copyable?: boolean;
35
+ /** Scrolls past this height (pixels). */
36
+ maxHeight?: number;
37
+ className?: string;
38
+ }
39
+ /** Code on a night ground, the same in both themes, with a copy button. */
40
+ export declare function CodeBlock({ code, html, title, language, showLineNumbers, copyable, maxHeight, className }: CodeBlockProps): import("react").JSX.Element;
41
+ export interface SnippetProps {
42
+ /** The command or value, copied as is. */
43
+ value: string;
44
+ /** A muted prompt before it, such as "$".
45
+ * @default "$" */
46
+ prompt?: string | null;
47
+ className?: string;
48
+ }
49
+ /** One line to copy: an install command, an API key name, a URL. */
50
+ export declare function Snippet({ value, prompt, className }: SnippetProps): import("react").JSX.Element;
@@ -0,0 +1,50 @@
1
+ import { type ReactNode } from "react";
2
+ export interface CopyButtonProps {
3
+ /** The text to copy. */
4
+ value: string;
5
+ /** Shown beside the icon, and read out.
6
+ * @default "Copy" */
7
+ label?: string;
8
+ /** Shown for two seconds after copying.
9
+ * @default "Copied" */
10
+ copiedLabel?: string;
11
+ /** Just the icon; the label is still read out.
12
+ * @default false */
13
+ iconOnly?: boolean;
14
+ /** `default` sits on surfaces; `onDark` sits on a code block.
15
+ * @default "default" */
16
+ tone?: "default" | "onDark";
17
+ onCopy?(): void;
18
+ className?: string;
19
+ }
20
+ /** Copies a value and says so: the icon turns into a check for two seconds and screen readers hear "Copied". */
21
+ export declare function CopyButton({ value, label, copiedLabel, iconOnly, tone, onCopy, className }: CopyButtonProps): import("react").JSX.Element;
22
+ export interface CodeBlockProps {
23
+ /** The code, as plain text. It's what the copy button copies. */
24
+ code: string;
25
+ /** Pre-highlighted HTML for the code (from Shiki or Prism, say). Without it the code shows plain. */
26
+ html?: string;
27
+ /** A file name or caption in the header. */
28
+ title?: ReactNode;
29
+ /** Shown on the right of the header, e.g. "tsx". */
30
+ language?: string;
31
+ /** @default false */
32
+ showLineNumbers?: boolean;
33
+ /** @default true */
34
+ copyable?: boolean;
35
+ /** Scrolls past this height (pixels). */
36
+ maxHeight?: number;
37
+ className?: string;
38
+ }
39
+ /** Code on a night ground, the same in both themes, with a copy button. */
40
+ export declare function CodeBlock({ code, html, title, language, showLineNumbers, copyable, maxHeight, className }: CodeBlockProps): import("react").JSX.Element;
41
+ export interface SnippetProps {
42
+ /** The command or value, copied as is. */
43
+ value: string;
44
+ /** A muted prompt before it, such as "$".
45
+ * @default "$" */
46
+ prompt?: string | null;
47
+ className?: string;
48
+ }
49
+ /** One line to copy: an install command, an API key name, a URL. */
50
+ export declare function Snippet({ value, prompt, className }: SnippetProps): import("react").JSX.Element;
@@ -0,0 +1,62 @@
1
+ import { type Placement } from "../../hooks/useFloating.cjs";
2
+ /** What a swatch is: a colour, or a colour with a name to read out. */
3
+ export type ColorSwatchOption = string | {
4
+ color: string;
5
+ name: string;
6
+ };
7
+ export interface ColorPickerProps {
8
+ /** A hex colour: "#0d9488", or "#0d9488cc" with alpha. */
9
+ value?: string;
10
+ /** @default "#312c7e" */
11
+ defaultValue?: string;
12
+ /** Called with a lowercase hex colour as the person drags, types or picks. */
13
+ onChange?(color: string): void;
14
+ /** Adds an opacity slider; colours come back as #rrggbbaa.
15
+ * @default false */
16
+ alpha?: boolean;
17
+ /** Ready-made colours as swatches under the picker. */
18
+ swatches?: ColorSwatchOption[];
19
+ /** The hex field under the picker.
20
+ * @default true */
21
+ showInput?: boolean;
22
+ /** A button that picks a colour from anywhere on the screen, where the browser can (Chrome and Edge).
23
+ * @default true */
24
+ eyeDropper?: boolean;
25
+ /** Names the picker for screen readers.
26
+ * @default "Colour" */
27
+ "aria-label"?: string;
28
+ className?: string;
29
+ }
30
+ interface EyeDropperResult {
31
+ sRGBHex: string;
32
+ }
33
+ declare global {
34
+ interface Window {
35
+ EyeDropper?: new () => {
36
+ open(): Promise<EyeDropperResult>;
37
+ };
38
+ }
39
+ }
40
+ /**
41
+ * Picks a colour: a saturation area and a hue slider (react-colorful, dressed in Openware's look), a hex field,
42
+ * an eyedropper where the browser has one, and optional swatches. The area and sliders work with the arrow keys.
43
+ */
44
+ export declare function ColorPicker({ value, defaultValue, onChange, alpha, swatches, showInput, eyeDropper, "aria-label": ariaLabel, className, }: ColorPickerProps): import("react").JSX.Element;
45
+ export interface ColorFieldProps extends Omit<ColorPickerProps, "className" | "aria-label"> {
46
+ /** @default "md" */
47
+ size?: "sm" | "md";
48
+ /** @default false */
49
+ isInvalid?: boolean;
50
+ disabled?: boolean;
51
+ /** Where the picker opens; it flips when there's no room.
52
+ * @default "bottom-start" */
53
+ placement?: Placement;
54
+ id?: string;
55
+ "aria-label"?: string;
56
+ "aria-labelledby"?: string;
57
+ "aria-describedby"?: string;
58
+ className?: string;
59
+ }
60
+ /** A field that shows a colour and its hex, and opens a ColorPicker below. Escape or a click outside closes it. */
61
+ export declare const ColorField: import("react").ForwardRefExoticComponent<ColorFieldProps & import("react").RefAttributes<HTMLButtonElement>>;
62
+ export {};
@@ -0,0 +1,62 @@
1
+ import { type Placement } from "../../hooks/useFloating.js";
2
+ /** What a swatch is: a colour, or a colour with a name to read out. */
3
+ export type ColorSwatchOption = string | {
4
+ color: string;
5
+ name: string;
6
+ };
7
+ export interface ColorPickerProps {
8
+ /** A hex colour: "#0d9488", or "#0d9488cc" with alpha. */
9
+ value?: string;
10
+ /** @default "#312c7e" */
11
+ defaultValue?: string;
12
+ /** Called with a lowercase hex colour as the person drags, types or picks. */
13
+ onChange?(color: string): void;
14
+ /** Adds an opacity slider; colours come back as #rrggbbaa.
15
+ * @default false */
16
+ alpha?: boolean;
17
+ /** Ready-made colours as swatches under the picker. */
18
+ swatches?: ColorSwatchOption[];
19
+ /** The hex field under the picker.
20
+ * @default true */
21
+ showInput?: boolean;
22
+ /** A button that picks a colour from anywhere on the screen, where the browser can (Chrome and Edge).
23
+ * @default true */
24
+ eyeDropper?: boolean;
25
+ /** Names the picker for screen readers.
26
+ * @default "Colour" */
27
+ "aria-label"?: string;
28
+ className?: string;
29
+ }
30
+ interface EyeDropperResult {
31
+ sRGBHex: string;
32
+ }
33
+ declare global {
34
+ interface Window {
35
+ EyeDropper?: new () => {
36
+ open(): Promise<EyeDropperResult>;
37
+ };
38
+ }
39
+ }
40
+ /**
41
+ * Picks a colour: a saturation area and a hue slider (react-colorful, dressed in Openware's look), a hex field,
42
+ * an eyedropper where the browser has one, and optional swatches. The area and sliders work with the arrow keys.
43
+ */
44
+ export declare function ColorPicker({ value, defaultValue, onChange, alpha, swatches, showInput, eyeDropper, "aria-label": ariaLabel, className, }: ColorPickerProps): import("react").JSX.Element;
45
+ export interface ColorFieldProps extends Omit<ColorPickerProps, "className" | "aria-label"> {
46
+ /** @default "md" */
47
+ size?: "sm" | "md";
48
+ /** @default false */
49
+ isInvalid?: boolean;
50
+ disabled?: boolean;
51
+ /** Where the picker opens; it flips when there's no room.
52
+ * @default "bottom-start" */
53
+ placement?: Placement;
54
+ id?: string;
55
+ "aria-label"?: string;
56
+ "aria-labelledby"?: string;
57
+ "aria-describedby"?: string;
58
+ className?: string;
59
+ }
60
+ /** A field that shows a colour and its hex, and opens a ColorPicker below. Escape or a click outside closes it. */
61
+ export declare const ColorField: import("react").ForwardRefExoticComponent<ColorFieldProps & import("react").RefAttributes<HTMLButtonElement>>;
62
+ export {};
@@ -0,0 +1,42 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ComboboxOption {
3
+ value: string;
4
+ /** The text shown and matched. */
5
+ label: string;
6
+ /** A muted line under the label; also matched. */
7
+ description?: ReactNode;
8
+ disabled?: boolean;
9
+ }
10
+ export interface ComboboxProps {
11
+ options: ComboboxOption[];
12
+ /** The chosen option's value, or "" for none. */
13
+ value?: string;
14
+ /** @default "" */
15
+ defaultValue?: string;
16
+ onChange?(value: string): void;
17
+ /** Called as the person types, to load options from a server. */
18
+ onInputChange?(text: string): void;
19
+ /** @default "Search…" */
20
+ placeholder?: string;
21
+ /** Shown when nothing matches.
22
+ * @default "No matches" */
23
+ emptyMessage?: ReactNode;
24
+ /** Keep what was typed even if it isn't an option; onChange gets the text.
25
+ * @default false */
26
+ allowCustomValue?: boolean;
27
+ /** @default "md" */
28
+ size?: "sm" | "md";
29
+ /** @default false */
30
+ isInvalid?: boolean;
31
+ disabled?: boolean;
32
+ id?: string;
33
+ "aria-label"?: string;
34
+ "aria-labelledby"?: string;
35
+ "aria-describedby"?: string;
36
+ className?: string;
37
+ }
38
+ /**
39
+ * A text field that suggests options as you type: pick a country, a repository, a person.
40
+ * Down opens the list, Up and Down move, Enter picks, Escape closes then clears.
41
+ */
42
+ export declare const Combobox: import("react").ForwardRefExoticComponent<ComboboxProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,42 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ComboboxOption {
3
+ value: string;
4
+ /** The text shown and matched. */
5
+ label: string;
6
+ /** A muted line under the label; also matched. */
7
+ description?: ReactNode;
8
+ disabled?: boolean;
9
+ }
10
+ export interface ComboboxProps {
11
+ options: ComboboxOption[];
12
+ /** The chosen option's value, or "" for none. */
13
+ value?: string;
14
+ /** @default "" */
15
+ defaultValue?: string;
16
+ onChange?(value: string): void;
17
+ /** Called as the person types, to load options from a server. */
18
+ onInputChange?(text: string): void;
19
+ /** @default "Search…" */
20
+ placeholder?: string;
21
+ /** Shown when nothing matches.
22
+ * @default "No matches" */
23
+ emptyMessage?: ReactNode;
24
+ /** Keep what was typed even if it isn't an option; onChange gets the text.
25
+ * @default false */
26
+ allowCustomValue?: boolean;
27
+ /** @default "md" */
28
+ size?: "sm" | "md";
29
+ /** @default false */
30
+ isInvalid?: boolean;
31
+ disabled?: boolean;
32
+ id?: string;
33
+ "aria-label"?: string;
34
+ "aria-labelledby"?: string;
35
+ "aria-describedby"?: string;
36
+ className?: string;
37
+ }
38
+ /**
39
+ * A text field that suggests options as you type: pick a country, a repository, a person.
40
+ * Down opens the list, Up and Down move, Enter picks, Escape closes then clears.
41
+ */
42
+ export declare const Combobox: import("react").ForwardRefExoticComponent<ComboboxProps & import("react").RefAttributes<HTMLInputElement>>;