@surflane/ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +18 -0
  3. package/README.md +55 -2
  4. package/dist/advanced-forms.d.ts +115 -0
  5. package/dist/advanced-forms.js +93 -0
  6. package/dist/app-shell.d.ts +23 -0
  7. package/dist/app-shell.js +29 -0
  8. package/dist/button.d.ts +11 -0
  9. package/dist/button.js +16 -0
  10. package/dist/chart.d.ts +48 -0
  11. package/dist/chart.js +124 -0
  12. package/dist/commands.d.ts +47 -0
  13. package/dist/commands.js +27 -0
  14. package/dist/content.d.ts +59 -0
  15. package/dist/content.js +66 -0
  16. package/dist/context-overlays.d.ts +95 -0
  17. package/dist/context-overlays.js +50 -0
  18. package/dist/data.d.ts +95 -0
  19. package/dist/data.js +40 -0
  20. package/dist/date-picker.d.ts +23 -0
  21. package/dist/date-picker.js +39 -0
  22. package/dist/dialog-focus.d.ts +5 -0
  23. package/dist/dialog-focus.js +35 -0
  24. package/dist/dialog.d.ts +59 -0
  25. package/dist/dialog.js +49 -0
  26. package/dist/feedback.d.ts +76 -0
  27. package/dist/feedback.js +35 -0
  28. package/dist/file-upload.d.ts +77 -0
  29. package/dist/file-upload.js +343 -0
  30. package/dist/filter-bar.d.ts +17 -0
  31. package/dist/filter-bar.js +23 -0
  32. package/dist/form-state.d.ts +5 -0
  33. package/dist/form-state.js +63 -0
  34. package/dist/forms.d.ts +91 -0
  35. package/dist/forms.js +109 -0
  36. package/dist/foundations.d.ts +51 -0
  37. package/dist/foundations.js +55 -0
  38. package/dist/icon.d.ts +37 -0
  39. package/dist/icon.js +28 -0
  40. package/dist/index.d.ts +37 -0
  41. package/dist/index.js +38 -0
  42. package/dist/input-extensions.d.ts +117 -0
  43. package/dist/input-extensions.js +64 -0
  44. package/dist/input.d.ts +7 -0
  45. package/dist/input.js +10 -0
  46. package/dist/markdown.d.ts +15 -0
  47. package/dist/markdown.js +121 -0
  48. package/dist/menu.d.ts +79 -0
  49. package/dist/menu.js +44 -0
  50. package/dist/messages.d.ts +63 -0
  51. package/dist/messages.js +38 -0
  52. package/dist/navigation-menu.d.ts +52 -0
  53. package/dist/navigation-menu.js +31 -0
  54. package/dist/navigation.d.ts +107 -0
  55. package/dist/navigation.js +108 -0
  56. package/dist/otp-field.d.ts +12 -0
  57. package/dist/otp-field.js +46 -0
  58. package/dist/pagination.d.ts +23 -0
  59. package/dist/pagination.js +44 -0
  60. package/dist/panels.d.ts +66 -0
  61. package/dist/panels.js +99 -0
  62. package/dist/parts.d.ts +9 -0
  63. package/dist/parts.js +22 -0
  64. package/dist/popover.d.ts +21 -0
  65. package/dist/popover.js +13 -0
  66. package/dist/scroll-area.d.ts +8 -0
  67. package/dist/scroll-area.js +39 -0
  68. package/dist/select.d.ts +33 -0
  69. package/dist/select.js +97 -0
  70. package/dist/sizing.d.ts +13 -0
  71. package/dist/sizing.js +23 -0
  72. package/dist/slot.d.ts +2 -0
  73. package/dist/slot.js +10 -0
  74. package/dist/status.d.ts +22 -0
  75. package/dist/status.js +17 -0
  76. package/dist/syntax-engine.d.ts +5 -0
  77. package/dist/syntax-engine.js +129 -0
  78. package/dist/syntax-highlighter.d.ts +17 -0
  79. package/dist/syntax-highlighter.js +64 -0
  80. package/dist/toast.d.ts +59 -0
  81. package/dist/toast.js +99 -0
  82. package/dist/tone-transition.d.ts +4 -0
  83. package/dist/tone-transition.js +81 -0
  84. package/dist/tooltip.d.ts +11 -0
  85. package/dist/tooltip.js +13 -0
  86. package/dist/tree.d.ts +28 -0
  87. package/dist/tree.js +311 -0
  88. package/package.json +109 -4
  89. package/src/styles.css +3708 -0
package/dist/data.d.ts ADDED
@@ -0,0 +1,95 @@
1
+ import * as React from "react";
2
+ declare const TableContainer: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ label?: string;
4
+ rootClassName?: string;
5
+ rootStyle?: React.CSSProperties;
6
+ orientation?: "horizontal" | "vertical" | "both";
7
+ scrollChain?: "auto" | "contain";
8
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & {
9
+ label: string;
10
+ } & React.RefAttributes<HTMLDivElement>>;
11
+ declare const TableRow: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
12
+ selected?: boolean;
13
+ } & React.RefAttributes<HTMLTableRowElement>>;
14
+ export declare const Table: {
15
+ Container: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
16
+ label?: string;
17
+ rootClassName?: string;
18
+ rootStyle?: React.CSSProperties;
19
+ orientation?: "horizontal" | "vertical" | "both";
20
+ scrollChain?: "auto" | "contain";
21
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & {
22
+ label: string;
23
+ } & React.RefAttributes<HTMLDivElement>>;
24
+ Root: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref">, "size"> & {
25
+ size?: import("./sizing.js").ComponentSize;
26
+ } & React.RefAttributes<HTMLTableElement>>;
27
+ Caption: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "size"> & {
28
+ size?: import("./sizing.js").ComponentSize;
29
+ } & React.RefAttributes<HTMLTableCaptionElement>>;
30
+ Head: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
31
+ size?: import("./sizing.js").ComponentSize;
32
+ } & React.RefAttributes<HTMLTableSectionElement>>;
33
+ Body: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
34
+ size?: import("./sizing.js").ComponentSize;
35
+ } & React.RefAttributes<HTMLTableSectionElement>>;
36
+ Foot: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
37
+ size?: import("./sizing.js").ComponentSize;
38
+ } & React.RefAttributes<HTMLTableSectionElement>>;
39
+ Row: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
40
+ selected?: boolean;
41
+ } & React.RefAttributes<HTMLTableRowElement>>;
42
+ HeaderCell: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref">, "size"> & {
43
+ size?: import("./sizing.js").ComponentSize;
44
+ } & React.RefAttributes<HTMLTableCellElement>>;
45
+ Cell: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref">, "size"> & {
46
+ size?: import("./sizing.js").ComponentSize;
47
+ } & React.RefAttributes<HTMLTableCellElement>>;
48
+ };
49
+ declare const ListRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
50
+ declare const ListItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
51
+ selected?: boolean;
52
+ } & React.RefAttributes<HTMLLIElement>>;
53
+ export declare const List: {
54
+ Root: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
55
+ Item: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
56
+ selected?: boolean;
57
+ } & React.RefAttributes<HTMLLIElement>>;
58
+ Content: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
59
+ size?: import("./sizing.js").ComponentSize;
60
+ } & React.RefAttributes<HTMLDivElement>>;
61
+ Title: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
62
+ size?: import("./sizing.js").ComponentSize;
63
+ } & React.RefAttributes<HTMLDivElement>>;
64
+ Description: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "size"> & {
65
+ size?: import("./sizing.js").ComponentSize;
66
+ } & React.RefAttributes<HTMLParagraphElement>>;
67
+ Actions: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
68
+ size?: import("./sizing.js").ComponentSize;
69
+ } & React.RefAttributes<HTMLDivElement>>;
70
+ };
71
+ export { ListRoot, ListItem, TableContainer, TableRow };
72
+ export declare const ListContent: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
73
+ size?: import("./sizing.js").ComponentSize;
74
+ } & React.RefAttributes<HTMLDivElement>>, ListTitle: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
75
+ size?: import("./sizing.js").ComponentSize;
76
+ } & React.RefAttributes<HTMLDivElement>>, ListDescription: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "size"> & {
77
+ size?: import("./sizing.js").ComponentSize;
78
+ } & React.RefAttributes<HTMLParagraphElement>>, ListActions: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size"> & {
79
+ size?: import("./sizing.js").ComponentSize;
80
+ } & React.RefAttributes<HTMLDivElement>>;
81
+ export declare const TableRoot: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref">, "size"> & {
82
+ size?: import("./sizing.js").ComponentSize;
83
+ } & React.RefAttributes<HTMLTableElement>>, TableCaption: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "size"> & {
84
+ size?: import("./sizing.js").ComponentSize;
85
+ } & React.RefAttributes<HTMLTableCaptionElement>>, TableHead: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
86
+ size?: import("./sizing.js").ComponentSize;
87
+ } & React.RefAttributes<HTMLTableSectionElement>>, TableBody: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
88
+ size?: import("./sizing.js").ComponentSize;
89
+ } & React.RefAttributes<HTMLTableSectionElement>>, TableFoot: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
90
+ size?: import("./sizing.js").ComponentSize;
91
+ } & React.RefAttributes<HTMLTableSectionElement>>, TableHeaderCell: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref">, "size"> & {
92
+ size?: import("./sizing.js").ComponentSize;
93
+ } & React.RefAttributes<HTMLTableCellElement>>, TableCell: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref">, "size"> & {
94
+ size?: import("./sizing.js").ComponentSize;
95
+ } & React.RefAttributes<HTMLTableCellElement>>;
package/dist/data.js ADDED
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { part } from "./parts.js";
5
+ import { ScrollArea } from "./scroll-area.js";
6
+ const TableContainer = React.forwardRef(function TableContainer(props, ref) {
7
+ return _jsx(ScrollArea, { ...props, ref: ref });
8
+ });
9
+ const TableRow = React.forwardRef(function TableRow({ selected, className, ...props }, ref) {
10
+ return (_jsx("tr", { ...props, ref: ref, "data-selected": selected || undefined, className: ["pui-table-row", className].filter(Boolean).join(" ") }));
11
+ });
12
+ export const Table = {
13
+ Container: TableContainer,
14
+ Root: part("table", "pui-table"),
15
+ Caption: part("caption", "pui-table-caption"),
16
+ Head: part("thead", "pui-table-head"),
17
+ Body: part("tbody", "pui-table-body"),
18
+ Foot: part("tfoot", "pui-table-foot"),
19
+ Row: TableRow,
20
+ HeaderCell: part("th", "pui-table-cell pui-table-header"),
21
+ Cell: part("td", "pui-table-cell"),
22
+ };
23
+ const ListRoot = React.forwardRef(function ListRoot({ className, ...props }, ref) {
24
+ return (_jsx("ul", { role: "list", ...props, ref: ref, className: ["pui-list", className].filter(Boolean).join(" ") }));
25
+ });
26
+ const ListItem = React.forwardRef(function ListItem({ selected, className, ...props }, ref) {
27
+ return (_jsx("li", { ...props, ref: ref, "data-selected": selected || undefined, className: ["pui-list-item", className].filter(Boolean).join(" ") }));
28
+ });
29
+ export const List = {
30
+ Root: ListRoot,
31
+ Item: ListItem,
32
+ Content: part("div", "pui-list-content"),
33
+ Title: part("div", "pui-list-title"),
34
+ Description: part("p", "pui-list-description"),
35
+ Actions: part("div", "pui-list-actions"),
36
+ };
37
+ // Flat names for React Server Components, which cannot dot into client exports.
38
+ export { ListRoot, ListItem, TableContainer, TableRow };
39
+ export const { Content: ListContent, Title: ListTitle, Description: ListDescription, Actions: ListActions, } = List;
40
+ export const { Root: TableRoot, Caption: TableCaption, Head: TableHead, Body: TableBody, Foot: TableFoot, HeaderCell: TableHeaderCell, Cell: TableCell, } = Table;
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { type DatePickerProps as AriaDatePickerProps, type DateValue, type ValidationResult } from "react-aria-components/DatePicker";
3
+ import { type DateRangePickerProps as AriaDateRangePickerProps } from "react-aria-components/DateRangePicker";
4
+ import { type TimeFieldProps as AriaTimeFieldProps, type TimeValue } from "react-aria-components/TimeField";
5
+ export { I18nProvider as DateLocaleProvider } from "react-aria-components/I18nProvider";
6
+ export type { DateValue, TimeValue };
7
+ type FieldContent = {
8
+ label: string;
9
+ description?: React.ReactNode;
10
+ errorMessage?: React.ReactNode | ((validation: ValidationResult) => React.ReactNode);
11
+ ref?: React.Ref<HTMLDivElement>;
12
+ };
13
+ type CalendarContent = {
14
+ calendarLabel?: string;
15
+ };
16
+ export type DatePickerProps<T extends DateValue> = Omit<AriaDatePickerProps<T>, "children"> & FieldContent & CalendarContent;
17
+ export type DateRangePickerProps<T extends DateValue> = Omit<AriaDateRangePickerProps<T>, "children"> & FieldContent & CalendarContent;
18
+ export type TimeFieldProps<T extends TimeValue> = Omit<AriaTimeFieldProps<T>, "children"> & FieldContent;
19
+ /** Locale-aware segmented entry with a keyboard and touch calendar. DateValue
20
+ * retains calendar/time-zone semantics; conversion to an instant is caller-owned. */
21
+ export declare function DatePicker<T extends DateValue>({ label, description, errorMessage, calendarLabel, className, ...props }: DatePickerProps<T>): React.JSX.Element;
22
+ export declare function DateRangePicker<T extends DateValue>({ label, description, errorMessage, calendarLabel, className, ...props }: DateRangePickerProps<T>): React.JSX.Element;
23
+ export declare function TimeField<T extends TimeValue>({ label, description, errorMessage, className, ...props }: TimeFieldProps<T>): React.JSX.Element;
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useComponentSize } from "./sizing.js";
4
+ import { DatePicker as AriaDatePicker, DateInput, DateSegment, Group, Label, Text, FieldError, Calendar, CalendarGrid, CalendarGridHeader, CalendarGridBody, CalendarHeaderCell, CalendarCell, Button, Popover, } from "react-aria-components/DatePicker";
5
+ import { DateRangePicker as AriaDateRangePicker, RangeCalendar, } from "react-aria-components/DateRangePicker";
6
+ import { TimeField as AriaTimeField, } from "react-aria-components/TimeField";
7
+ import { Heading } from "react-aria-components/Heading";
8
+ import { Dialog } from "react-aria-components/Dialog";
9
+ import { skin } from "./parts.js";
10
+ import { useLocale } from "react-aria-components/I18nProvider";
11
+ export { I18nProvider as DateLocaleProvider } from "react-aria-components/I18nProvider";
12
+ function Segments({ slot }) {
13
+ return (_jsx(DateInput, { slot: slot, className: "pui-date-input", children: (segment) => (_jsx(DateSegment, { segment: segment, className: "pui-date-segment" })) }));
14
+ }
15
+ function FieldHelp({ description, errorMessage, }) {
16
+ return (_jsxs(_Fragment, { children: [description && (_jsx(Text, { slot: "description", className: "pui-field-description", children: description })), _jsx(FieldError, { className: "pui-field-error", children: errorMessage })] }));
17
+ }
18
+ function CalendarButton() {
19
+ return (_jsx(Button, { className: "pui-date-trigger", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", "aria-hidden": "true", children: [_jsx("rect", { x: "3", y: "5", width: "18", height: "16", rx: "3" }), _jsx("path", { d: "M7 3v4m10-4v4M3 11h18m-12 4h2" })] }) }));
20
+ }
21
+ function CalendarContents() {
22
+ const { locale } = useLocale();
23
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "pui-calendar-header", children: [_jsx(Button, { slot: "previous", className: "pui-calendar-nav", children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", "aria-hidden": "true", children: _jsx("path", { d: "m15 6-6 6 6 6" }) }) }), _jsx(Heading, { className: "pui-calendar-heading" }), _jsx(Button, { slot: "next", className: "pui-calendar-nav", children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", "aria-hidden": "true", children: _jsx("path", { d: "m9 6 6 6-6 6" }) }) })] }), _jsxs(CalendarGrid, { className: "pui-calendar-grid", weekdayStyle: "short", children: [_jsx(CalendarGridHeader, { children: (day) => (_jsx(CalendarHeaderCell, { className: "pui-calendar-weekday", children: day })) }), _jsx(CalendarGridBody, { children: (date) => (_jsx(CalendarCell, { date: date, className: "pui-calendar-day", children: ({ formattedDate }) => locale.startsWith("ko") ? `${formattedDate}일` : formattedDate })) })] })] }));
24
+ }
25
+ function CalendarPopup({ label, range }) {
26
+ const scheme = useComponentSize();
27
+ return (_jsx(Popover, { "data-ui-size": scheme, className: "pui-date-popover", offset: 8, placement: "bottom start", children: _jsx(Dialog, { "aria-label": label, className: "pui-date-dialog", children: range ? (_jsx(RangeCalendar, { className: "pui-calendar", children: _jsx(CalendarContents, {}) })) : (_jsx(Calendar, { className: "pui-calendar", children: _jsx(CalendarContents, {}) })) }) }));
28
+ }
29
+ /** Locale-aware segmented entry with a keyboard and touch calendar. DateValue
30
+ * retains calendar/time-zone semantics; conversion to an instant is caller-owned. */
31
+ export function DatePicker({ label, description, errorMessage, calendarLabel, className, ...props }) {
32
+ return (_jsxs(AriaDatePicker, { ...props, className: skin("pui-date-picker", className), children: [_jsx(Label, { className: "pui-field-label", children: label }), _jsxs(Group, { className: "pui-date-group", children: [_jsx(Segments, {}), _jsx(CalendarButton, {})] }), _jsx(FieldHelp, { description: description, errorMessage: errorMessage }), _jsx(CalendarPopup, { label: calendarLabel ?? label })] }));
33
+ }
34
+ export function DateRangePicker({ label, description, errorMessage, calendarLabel, className, ...props }) {
35
+ return (_jsxs(AriaDateRangePicker, { ...props, className: skin("pui-date-picker pui-date-range-picker", className), children: [_jsx(Label, { className: "pui-field-label", children: label }), _jsxs(Group, { className: "pui-date-group", children: [_jsxs("div", { className: "pui-date-range-inputs", children: [_jsx(Segments, { slot: "start" }), _jsx("span", { "aria-hidden": "true", className: "pui-date-range-separator", children: "\u2013" }), _jsx(Segments, { slot: "end" })] }), _jsx(CalendarButton, {})] }), _jsx(FieldHelp, { description: description, errorMessage: errorMessage }), _jsx(CalendarPopup, { label: calendarLabel ?? label, range: true })] }));
36
+ }
37
+ export function TimeField({ label, description, errorMessage, className, ...props }) {
38
+ return (_jsxs(AriaTimeField, { ...props, className: skin("pui-time-field", className), children: [_jsx(Label, { className: "pui-field-label", children: label }), _jsx("div", { className: "pui-date-group", children: _jsx(Segments, {}) }), _jsx(FieldHelp, { description: description, errorMessage: errorMessage })] }));
39
+ }
@@ -0,0 +1,5 @@
1
+ /** Base UI 1.9 exposes WebKit's focus guards as buttons for VoiceOver.
2
+ * Give those boundaries a name without hiding or changing their focus behavior.
3
+ * Scope observation to this portal and disconnect it on React ref cleanup.
4
+ */
5
+ export declare function useDialogFocusBoundary(label: string): (portal: HTMLDivElement | null) => (() => void) | undefined;
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ /** Base UI 1.9 exposes WebKit's focus guards as buttons for VoiceOver.
4
+ * Give those boundaries a name without hiding or changing their focus behavior.
5
+ * Scope observation to this portal and disconnect it on React ref cleanup.
6
+ */
7
+ export function useDialogFocusBoundary(label) {
8
+ return React.useCallback((portal) => {
9
+ if (!portal)
10
+ return;
11
+ const owned = new Set();
12
+ const nameBoundaries = () => {
13
+ for (const guard of portal.querySelectorAll(':scope > [data-base-ui-focus-guard][role="button"]')) {
14
+ if (!guard.hasAttribute("aria-label")) {
15
+ guard.setAttribute("aria-label", label);
16
+ owned.add(guard);
17
+ }
18
+ }
19
+ };
20
+ nameBoundaries();
21
+ const observer = new MutationObserver(nameBoundaries);
22
+ observer.observe(portal, {
23
+ childList: true,
24
+ subtree: true,
25
+ attributes: true,
26
+ attributeFilter: ["role"],
27
+ });
28
+ return () => {
29
+ observer.disconnect();
30
+ for (const guard of owned)
31
+ if (guard.getAttribute("aria-label") === label)
32
+ guard.removeAttribute("aria-label");
33
+ };
34
+ }, [label]);
35
+ }
@@ -0,0 +1,59 @@
1
+ import * as React from "react";
2
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
3
+ import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
4
+ /** Visible icon close action; inherits Dialog focus and dismissal behavior. */
5
+ declare const DialogCloseButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, "children"> & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
7
+ closeLabel?: string;
8
+ closeDisabled?: boolean;
9
+ focusBoundaryLabel?: string;
10
+ } & React.RefAttributes<HTMLDivElement>>;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare const DialogBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
14
+ export declare const Dialog: {
15
+ Content: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
16
+ closeLabel?: string;
17
+ closeDisabled?: boolean;
18
+ focusBoundaryLabel?: string;
19
+ } & React.RefAttributes<HTMLDivElement>>;
20
+ Header: typeof DialogHeader;
21
+ Body: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
22
+ Footer: typeof DialogFooter;
23
+ CloseButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, "children"> & React.RefAttributes<HTMLButtonElement>>;
24
+ Backdrop: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
+ Close: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
26
+ Description: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
27
+ Popup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
+ Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
29
+ Root: <Payload>(props: BaseDialog.Root.Props<Payload>) => React.JSX.Element;
30
+ Viewport: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
31
+ Title: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
32
+ Trigger: BaseDialog.Trigger;
33
+ createHandle: typeof BaseDialog.createHandle;
34
+ Handle: typeof BaseDialog.Handle;
35
+ };
36
+ declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
37
+ focusBoundaryLabel?: string;
38
+ } & React.RefAttributes<HTMLDivElement>>;
39
+ export declare const AlertDialog: {
40
+ Content: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
41
+ focusBoundaryLabel?: string;
42
+ } & React.RefAttributes<HTMLDivElement>>;
43
+ Header: typeof DialogHeader;
44
+ Footer: typeof DialogFooter;
45
+ Root: typeof BaseAlertDialog.Root;
46
+ Backdrop: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
47
+ Close: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
48
+ Description: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
49
+ Popup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
50
+ Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
51
+ Title: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
52
+ Trigger: BaseAlertDialog.Trigger;
53
+ Viewport: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
54
+ Handle: typeof BaseAlertDialog.Handle;
55
+ createHandle: typeof BaseAlertDialog.createHandle;
56
+ };
57
+ export { AlertDialogContent, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogCloseButton, };
58
+ export declare const AlertDialogBackdrop: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>, AlertDialogClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>, AlertDialogDescription: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>, AlertDialogHandle: typeof BaseAlertDialog.Handle, AlertDialogPopup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>, AlertDialogPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>, AlertDialogRoot: typeof BaseAlertDialog.Root, AlertDialogTitle: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>, AlertDialogTrigger: BaseAlertDialog.Trigger, AlertDialogViewport: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>>, AlertDialogHeader: typeof DialogHeader, AlertDialogFooter: typeof DialogFooter;
59
+ export declare const DialogBackdrop: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>, DialogClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>, DialogDescription: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>, DialogHandle: typeof BaseDialog.Handle, DialogPopup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>, DialogPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>, DialogRoot: <Payload>(props: BaseDialog.Root.Props<Payload>) => React.JSX.Element, DialogTitle: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>, DialogTrigger: BaseDialog.Trigger, DialogViewport: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
package/dist/dialog.js ADDED
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { useDialogFocusBoundary } from "./dialog-focus.js";
5
+ import { useComponentSize } from "./sizing.js";
6
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
7
+ import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
8
+ const cx = (...v) => v.filter(Boolean).join(" ");
9
+ /** Visible icon close action; inherits Dialog focus and dismissal behavior. */
10
+ const DialogCloseButton = React.forwardRef(function DialogCloseButton({ className, "aria-label": label = "Close dialog", ...props }, ref) {
11
+ return (_jsx(BaseDialog.Close, { ...props, ref: ref, "aria-label": label, className: cx("pui-icon-button pui-dialog-close", typeof className === "string" && className), children: _jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", "aria-hidden": "true", children: _jsx("path", { d: "m6 6 12 12M18 6 6 18" }) }) }));
12
+ });
13
+ const DialogContent = React.forwardRef(function DialogContent({ className, children, closeLabel = "Close dialog", closeDisabled, focusBoundaryLabel = "Continue dialog navigation", ...props }, ref) {
14
+ const scheme = useComponentSize();
15
+ const portalRef = useDialogFocusBoundary(focusBoundaryLabel);
16
+ return (_jsxs(BaseDialog.Portal, { ref: portalRef, children: [_jsx(BaseDialog.Backdrop, { className: "pui-dialog-backdrop" }), _jsxs(BaseDialog.Popup, { "data-ui-size": scheme, ...props, ref: ref, className: cx("pui-dialog-popup pui-dialog-content", typeof className === "string" && className), children: [_jsx(DialogCloseButton, { "aria-label": closeLabel, disabled: closeDisabled }), children] })] }));
17
+ });
18
+ function DialogHeader({ className, ...props }) {
19
+ return _jsx("div", { ...props, className: cx("pui-dialog-header", className) });
20
+ }
21
+ const DialogBody = React.forwardRef(function DialogBody({ className, ...props }, ref) {
22
+ return (_jsx("div", { ...props, ref: ref, className: cx("pui-dialog-body", className) }));
23
+ });
24
+ function DialogFooter({ className, ...props }) {
25
+ return _jsx("div", { ...props, className: cx("pui-dialog-footer", className) });
26
+ }
27
+ export const Dialog = {
28
+ ...BaseDialog,
29
+ Content: DialogContent,
30
+ Header: DialogHeader,
31
+ Body: DialogBody,
32
+ Footer: DialogFooter,
33
+ CloseButton: DialogCloseButton,
34
+ };
35
+ const AlertDialogContent = React.forwardRef(function AlertDialogContent({ className, focusBoundaryLabel = "Continue dialog navigation", ...props }, ref) {
36
+ const scheme = useComponentSize();
37
+ const portalRef = useDialogFocusBoundary(focusBoundaryLabel);
38
+ return (_jsxs(BaseAlertDialog.Portal, { ref: portalRef, children: [_jsx(BaseAlertDialog.Backdrop, { className: "pui-dialog-backdrop" }), _jsx(BaseAlertDialog.Popup, { "data-ui-size": scheme, ...props, ref: ref, className: cx("pui-dialog-popup pui-dialog-content pui-confirm-content", typeof className === "string" && className) })] }));
39
+ });
40
+ export const AlertDialog = {
41
+ ...BaseAlertDialog,
42
+ Content: AlertDialogContent,
43
+ Header: DialogHeader,
44
+ Footer: DialogFooter,
45
+ };
46
+ // Flat names for React Server Components, which cannot dot into client exports.
47
+ export { AlertDialogContent, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogCloseButton, };
48
+ export const { Backdrop: AlertDialogBackdrop, Close: AlertDialogClose, Description: AlertDialogDescription, Handle: AlertDialogHandle, Popup: AlertDialogPopup, Portal: AlertDialogPortal, Root: AlertDialogRoot, Title: AlertDialogTitle, Trigger: AlertDialogTrigger, Viewport: AlertDialogViewport, Header: AlertDialogHeader, Footer: AlertDialogFooter, } = AlertDialog;
49
+ export const { Backdrop: DialogBackdrop, Close: DialogClose, Description: DialogDescription, Handle: DialogHandle, Popup: DialogPopup, Portal: DialogPortal, Root: DialogRoot, Title: DialogTitle, Trigger: DialogTrigger, Viewport: DialogViewport, } = Dialog;
@@ -0,0 +1,76 @@
1
+ import * as React from "react";
2
+ import { type ComponentSizeAlias } from "./sizing.js";
3
+ export declare const Progress: {
4
+ Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
5
+ size?: import("./sizing.js").ComponentSize;
6
+ } & React.RefAttributes<HTMLDivElement>>;
7
+ Label: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressLabelProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
8
+ size?: import("./sizing.js").ComponentSize;
9
+ } & React.RefAttributes<HTMLSpanElement>>;
10
+ Value: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
11
+ size?: import("./sizing.js").ComponentSize;
12
+ } & React.RefAttributes<HTMLSpanElement>>;
13
+ Track: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressTrackProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
14
+ size?: import("./sizing.js").ComponentSize;
15
+ } & React.RefAttributes<HTMLDivElement>>;
16
+ Indicator: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressIndicatorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
17
+ size?: import("./sizing.js").ComponentSize;
18
+ } & React.RefAttributes<HTMLDivElement>>;
19
+ };
20
+ export declare const Meter: {
21
+ Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
22
+ size?: import("./sizing.js").ComponentSize;
23
+ } & React.RefAttributes<HTMLDivElement>>;
24
+ Label: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterLabelProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
25
+ size?: import("./sizing.js").ComponentSize;
26
+ } & React.RefAttributes<HTMLSpanElement>>;
27
+ Value: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
28
+ size?: import("./sizing.js").ComponentSize;
29
+ } & React.RefAttributes<HTMLSpanElement>>;
30
+ Track: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterTrackProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
31
+ size?: import("./sizing.js").ComponentSize;
32
+ } & React.RefAttributes<HTMLDivElement>>;
33
+ Indicator: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterIndicatorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
34
+ size?: import("./sizing.js").ComponentSize;
35
+ } & React.RefAttributes<HTMLDivElement>>;
36
+ };
37
+ export type SpinnerProps = Omit<React.ComponentPropsWithoutRef<"span">, "children"> & {
38
+ label?: string;
39
+ decorative?: boolean;
40
+ size?: ComponentSizeAlias;
41
+ };
42
+ /** Use decorative within a loading region that already owns the announcement. */
43
+ export declare const Spinner: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & {
44
+ label?: string;
45
+ decorative?: boolean;
46
+ size?: ComponentSizeAlias;
47
+ } & React.RefAttributes<HTMLSpanElement>>;
48
+ export type SkeletonProps = Omit<React.ComponentPropsWithoutRef<"span">, "children"> & {
49
+ shape?: "text" | "block" | "circle";
50
+ };
51
+ /** Decorative placeholder; the owning region provides aria-busy and loading text. */
52
+ export declare const Skeleton: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & {
53
+ shape?: "text" | "block" | "circle";
54
+ } & React.RefAttributes<HTMLSpanElement>>;
55
+ export declare const MeterIndicator: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterIndicatorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
56
+ size?: import("./sizing.js").ComponentSize;
57
+ } & React.RefAttributes<HTMLDivElement>>, MeterLabel: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterLabelProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
58
+ size?: import("./sizing.js").ComponentSize;
59
+ } & React.RefAttributes<HTMLSpanElement>>, MeterRoot: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
60
+ size?: import("./sizing.js").ComponentSize;
61
+ } & React.RefAttributes<HTMLDivElement>>, MeterTrack: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterTrackProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
62
+ size?: import("./sizing.js").ComponentSize;
63
+ } & React.RefAttributes<HTMLDivElement>>, MeterValue: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/meter").MeterValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
64
+ size?: import("./sizing.js").ComponentSize;
65
+ } & React.RefAttributes<HTMLSpanElement>>;
66
+ export declare const ProgressIndicator: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressIndicatorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
67
+ size?: import("./sizing.js").ComponentSize;
68
+ } & React.RefAttributes<HTMLDivElement>>, ProgressLabel: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressLabelProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
69
+ size?: import("./sizing.js").ComponentSize;
70
+ } & React.RefAttributes<HTMLSpanElement>>, ProgressRoot: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
71
+ size?: import("./sizing.js").ComponentSize;
72
+ } & React.RefAttributes<HTMLDivElement>>, ProgressTrack: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressTrackProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
73
+ size?: import("./sizing.js").ComponentSize;
74
+ } & React.RefAttributes<HTMLDivElement>>, ProgressValue: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/progress").ProgressValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
75
+ size?: import("./sizing.js").ComponentSize;
76
+ } & React.RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { useComponentSize } from "./sizing.js";
5
+ import { Progress as BaseProgress } from "@base-ui/react/progress";
6
+ import { Meter as BaseMeter } from "@base-ui/react/meter";
7
+ import { part } from "./parts.js";
8
+ export const Progress = {
9
+ ...BaseProgress,
10
+ Root: part(BaseProgress.Root, "pui-gauge pui-progress"),
11
+ Label: part(BaseProgress.Label, "pui-gauge-label"),
12
+ Value: part(BaseProgress.Value, "pui-gauge-value"),
13
+ Track: part(BaseProgress.Track, "pui-gauge-track"),
14
+ Indicator: part(BaseProgress.Indicator, "pui-gauge-indicator"),
15
+ };
16
+ export const Meter = {
17
+ ...BaseMeter,
18
+ Root: part(BaseMeter.Root, "pui-gauge pui-meter"),
19
+ Label: part(BaseMeter.Label, "pui-gauge-label"),
20
+ Value: part(BaseMeter.Value, "pui-gauge-value"),
21
+ Track: part(BaseMeter.Track, "pui-gauge-track"),
22
+ Indicator: part(BaseMeter.Indicator, "pui-gauge-indicator"),
23
+ };
24
+ /** Use decorative within a loading region that already owns the announcement. */
25
+ export const Spinner = React.forwardRef(function Spinner({ label = "Loading", decorative = false, size, className, ...props }, ref) {
26
+ const scheme = useComponentSize(size);
27
+ return (_jsxs("span", { ...props, ref: ref, className: ["pui-spinner", className].filter(Boolean).join(" "), "data-size": size, "data-ui-size": scheme, role: decorative ? undefined : "status", "aria-hidden": decorative || undefined, children: [_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", opacity: ".2" }), _jsx("path", { d: "M12 3a9 9 0 0 1 9 9", strokeLinecap: "round" })] }), !decorative && _jsx("span", { className: "pui-feedback-sr", children: label })] }));
28
+ });
29
+ /** Decorative placeholder; the owning region provides aria-busy and loading text. */
30
+ export const Skeleton = React.forwardRef(function Skeleton({ shape = "text", className, ...props }, ref) {
31
+ return (_jsx("span", { ...props, ref: ref, className: ["pui-skeleton", className].filter(Boolean).join(" "), "data-shape": shape, "aria-hidden": "true" }));
32
+ });
33
+ // Flat names for React Server Components, which cannot dot into client exports.
34
+ export const { Indicator: MeterIndicator, Label: MeterLabel, Root: MeterRoot, Track: MeterTrack, Value: MeterValue, } = Meter;
35
+ export const { Indicator: ProgressIndicator, Label: ProgressLabel, Root: ProgressRoot, Track: ProgressTrack, Value: ProgressValue, } = Progress;
@@ -0,0 +1,77 @@
1
+ import * as React from "react";
2
+ import { Field } from "./forms.js";
3
+ export type UploadState = "ready" | "uploading" | "success" | "error" | "canceled";
4
+ export type UploadTransport = (file: File, context: {
5
+ signal: AbortSignal;
6
+ onProgress: (percent: number | null) => void;
7
+ }) => Promise<void>;
8
+ export type FileRejection = {
9
+ file: File;
10
+ reason: "type" | "size" | "count" | "duplicate";
11
+ };
12
+ export type FileChangeDetails = {
13
+ reason: "select" | "drop" | "remove";
14
+ isCanceled: boolean;
15
+ cancel: () => void;
16
+ };
17
+ export type FileUploadLabels = {
18
+ choose: string;
19
+ drop: string;
20
+ upload: string;
21
+ retry: string;
22
+ cancel: string;
23
+ remove: string;
24
+ status: Record<UploadState, string>;
25
+ rejection: (rejection: FileRejection) => string;
26
+ changed: (count: number) => string;
27
+ complete: (file: File) => string;
28
+ canceled: (file: File) => string;
29
+ failed: (file: File) => string;
30
+ reset: string;
31
+ progress: (file: File) => string;
32
+ };
33
+ export type FileUploadProps = Omit<React.ComponentPropsWithoutRef<typeof Field.Root>, "children" | "name" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & Pick<React.HTMLAttributes<HTMLDivElement>, "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & {
34
+ label: React.ReactNode;
35
+ description?: React.ReactNode;
36
+ name?: string;
37
+ form?: string;
38
+ capture?: React.InputHTMLAttributes<HTMLInputElement>["capture"];
39
+ accept?: string;
40
+ multiple?: boolean;
41
+ required?: boolean;
42
+ maxFiles?: number;
43
+ maxFileSize?: number;
44
+ files?: readonly File[];
45
+ defaultFiles?: readonly File[];
46
+ onFilesChange?: (files: File[], details: FileChangeDetails) => void;
47
+ onReject?: (rejections: FileRejection[]) => void;
48
+ transport?: UploadTransport;
49
+ getUploadError?: (error: unknown) => string;
50
+ labels?: Partial<Omit<FileUploadLabels, "status">> & {
51
+ status?: Partial<FileUploadLabels["status"]>;
52
+ };
53
+ };
54
+ /** Native selection/validation and a cancellable transport adapter; no network request is built in. */
55
+ export declare const FileUpload: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<import("@base-ui/react").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
56
+ size?: import("./sizing.js").ComponentSize;
57
+ } & React.RefAttributes<HTMLDivElement>, "ref">, "children" | "name" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & Pick<React.HTMLAttributes<HTMLDivElement>, "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & {
58
+ label: React.ReactNode;
59
+ description?: React.ReactNode;
60
+ name?: string;
61
+ form?: string;
62
+ capture?: React.InputHTMLAttributes<HTMLInputElement>["capture"];
63
+ accept?: string;
64
+ multiple?: boolean;
65
+ required?: boolean;
66
+ maxFiles?: number;
67
+ maxFileSize?: number;
68
+ files?: readonly File[];
69
+ defaultFiles?: readonly File[];
70
+ onFilesChange?: (files: File[], details: FileChangeDetails) => void;
71
+ onReject?: (rejections: FileRejection[]) => void;
72
+ transport?: UploadTransport;
73
+ getUploadError?: (error: unknown) => string;
74
+ labels?: Partial<Omit<FileUploadLabels, "status">> & {
75
+ status?: Partial<FileUploadLabels["status"]>;
76
+ };
77
+ } & React.RefAttributes<HTMLDivElement>>;