@surflane/ui 0.2.0 → 0.4.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/README.md +17 -7
- package/dist/advanced-forms.js +24 -24
- package/dist/app-shell.d.ts +2 -1
- package/dist/app-shell.js +25 -9
- package/dist/avatar.d.ts +24 -0
- package/dist/avatar.js +26 -0
- package/dist/button.js +3 -3
- package/dist/chart.js +6 -3
- package/dist/chevron.d.ts +3 -0
- package/dist/chevron.js +6 -0
- package/dist/commands.js +9 -9
- package/dist/content.js +11 -8
- package/dist/context-overlays.js +6 -6
- package/dist/data.d.ts +57 -12
- package/dist/data.js +60 -18
- package/dist/dialog.js +8 -7
- package/dist/disclosure.d.ts +42 -0
- package/dist/disclosure.js +41 -0
- package/dist/feedback.js +14 -14
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.js +5 -5
- package/dist/forms.js +17 -17
- package/dist/foundations.js +7 -7
- package/dist/icon.d.ts +1 -0
- package/dist/icon.js +5 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +10 -7
- package/dist/input-extensions.js +11 -11
- package/dist/input.js +1 -1
- package/dist/markdown.js +3 -2
- package/dist/menu.js +14 -14
- package/dist/messages.js +11 -11
- package/dist/navigation-menu.js +9 -9
- package/dist/navigation.d.ts +1 -91
- package/dist/navigation.js +8 -75
- package/dist/otp-field.js +4 -4
- package/dist/pagination.js +1 -1
- package/dist/panels.js +12 -11
- package/dist/parts.d.ts +3 -0
- package/dist/parts.js +8 -1
- package/dist/popover.js +2 -2
- package/dist/scroll-area.js +1 -1
- package/dist/select.js +3 -2
- package/dist/sizing.js +1 -1
- package/dist/status.js +2 -2
- package/dist/syntax-context.d.ts +7 -0
- package/dist/syntax-context.js +4 -0
- package/dist/syntax-highlighter.d.ts +4 -1
- package/dist/syntax-highlighter.js +11 -5
- package/dist/syntax-highlighting.d.ts +8 -0
- package/dist/syntax-highlighting.js +12 -0
- package/dist/table-selection.d.ts +31 -0
- package/dist/table-selection.js +50 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.js +13 -0
- package/dist/toast.js +14 -14
- package/package.json +57 -8
- package/src/all.css +8 -0
- package/src/styles.css +3579 -3598
package/dist/data.js
CHANGED
|
@@ -1,40 +1,82 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { Button } from './button.js';
|
|
4
5
|
import { part } from './parts.js';
|
|
5
6
|
import { ScrollArea } from './scroll-area.js';
|
|
6
|
-
const TableContainer = React.forwardRef(function TableContainer(props, ref) {
|
|
7
|
+
const TableContainer = /* @__PURE__ */ React.forwardRef(function TableContainer(props, ref) {
|
|
7
8
|
return _jsx(ScrollArea, { ...props, ref: ref });
|
|
8
9
|
});
|
|
9
|
-
const
|
|
10
|
+
const RootPart = /* @__PURE__ */ part('table', 'pui-table');
|
|
11
|
+
const TableRoot = /* @__PURE__ */ React.forwardRef(function TableRoot({ density, stickyHeader, ...props }, ref) {
|
|
12
|
+
return (_jsx(RootPart, { ...props, ref: ref, "data-density": density === 'compact' ? 'compact' : undefined, "data-sticky-header": stickyHeader || undefined }));
|
|
13
|
+
});
|
|
14
|
+
const layout = ({ align, numeric }) => ({
|
|
15
|
+
'data-align': numeric ? 'end' : align,
|
|
16
|
+
'data-numeric': numeric || undefined,
|
|
17
|
+
});
|
|
18
|
+
const HeaderCellPart = /* @__PURE__ */ part('th', 'pui-table-cell pui-table-header');
|
|
19
|
+
const CellPart = /* @__PURE__ */ part('td', 'pui-table-cell');
|
|
20
|
+
// align replaces the obsolete HTML align attribute of th and td.
|
|
21
|
+
const TableHeaderCell = /* @__PURE__ */ React.forwardRef(function TableHeaderCell({ align, numeric, ...props }, ref) {
|
|
22
|
+
return _jsx(HeaderCellPart, { ...props, ...layout({ align, numeric }), ref: ref });
|
|
23
|
+
});
|
|
24
|
+
const TableCell = /* @__PURE__ */ React.forwardRef(function TableCell({ align, numeric, ...props }, ref) {
|
|
25
|
+
return _jsx(CellPart, { ...props, ...layout({ align, numeric }), ref: ref });
|
|
26
|
+
});
|
|
27
|
+
function SortIcon({ sort }) {
|
|
28
|
+
return (_jsx("svg", { className: 'pui-table-sort-icon', width: '16', height: '16', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '1.6', strokeLinecap: 'round', strokeLinejoin: 'round', "aria-hidden": 'true', children: _jsx("path", { d: sort === 'ascending'
|
|
29
|
+
? 'M12 19V5m-6 6 6-6 6 6'
|
|
30
|
+
: sort === 'descending'
|
|
31
|
+
? 'M12 5v14m-6-6 6 6 6-6'
|
|
32
|
+
: 'm8 9 4-4 4 4m-8 6 4 4 4-4' }) }));
|
|
33
|
+
}
|
|
34
|
+
/** A column header whose button sorts the column. aria-sort names the order on the sorted column only. */
|
|
35
|
+
const TableSortHeader = /* @__PURE__ */ React.forwardRef(function TableSortHeader({ sort, onSort, disabled, children, className, ...props }, ref) {
|
|
36
|
+
return (_jsx(TableHeaderCell, { ...props, ref: ref, scope: 'col', "aria-sort": sort, className: ['pui-table-sort-header', className].filter(Boolean).join(' '), children: _jsxs(Button, { variant: 'ghost', className: 'pui-table-sort', "data-sort": sort, disabled: disabled, onClick: onSort, children: [_jsx("span", { children: children }), _jsx(SortIcon, { sort: sort })] }) }));
|
|
37
|
+
});
|
|
38
|
+
/** One-line text that ends in an ellipsis. String content also becomes the title. */
|
|
39
|
+
const TableTruncate = /* @__PURE__ */ React.forwardRef(function TableTruncate({ className, title, children, ...props }, ref) {
|
|
40
|
+
return (_jsx("span", { ...props, ref: ref, title: title ?? (typeof children === 'string' ? children : undefined), className: ['pui-table-truncate', className].filter(Boolean).join(' '), children: children }));
|
|
41
|
+
});
|
|
42
|
+
/** A full-width body row for loading, empty, error and permission messages. It has no hover. */
|
|
43
|
+
const TableMessage = /* @__PURE__ */ React.forwardRef(function TableMessage({ className, ...props }, ref) {
|
|
44
|
+
return (_jsx("tr", { className: 'pui-table-row pui-table-message-row', children: _jsx("td", { ...props, ref: ref, className: ['pui-table-cell pui-table-message', className]
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
.join(' ') }) }));
|
|
47
|
+
});
|
|
48
|
+
const TableRow = /* @__PURE__ */ React.forwardRef(function TableRow({ selected, className, ...props }, ref) {
|
|
10
49
|
return (_jsx("tr", { ...props, ref: ref, "data-selected": selected || undefined, className: ['pui-table-row', className].filter(Boolean).join(' ') }));
|
|
11
50
|
});
|
|
12
51
|
export const Table = {
|
|
13
52
|
Container: TableContainer,
|
|
14
|
-
Root:
|
|
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'),
|
|
53
|
+
Root: TableRoot,
|
|
54
|
+
Caption: /* @__PURE__ */ part('caption', 'pui-table-caption'),
|
|
55
|
+
Head: /* @__PURE__ */ part('thead', 'pui-table-head'),
|
|
56
|
+
Body: /* @__PURE__ */ part('tbody', 'pui-table-body'),
|
|
57
|
+
Foot: /* @__PURE__ */ part('tfoot', 'pui-table-foot'),
|
|
19
58
|
Row: TableRow,
|
|
20
|
-
HeaderCell:
|
|
21
|
-
|
|
59
|
+
HeaderCell: TableHeaderCell,
|
|
60
|
+
SortHeader: TableSortHeader,
|
|
61
|
+
Cell: TableCell,
|
|
62
|
+
Truncate: TableTruncate,
|
|
63
|
+
Message: TableMessage,
|
|
22
64
|
};
|
|
23
|
-
const ListRoot = React.forwardRef(function ListRoot({ className, ...props }, ref) {
|
|
65
|
+
const ListRoot = /* @__PURE__ */ React.forwardRef(function ListRoot({ className, ...props }, ref) {
|
|
24
66
|
return (_jsx("ul", { role: 'list', ...props, ref: ref, className: ['pui-list', className].filter(Boolean).join(' ') }));
|
|
25
67
|
});
|
|
26
|
-
const ListItem = React.forwardRef(function ListItem({ selected, className, ...props }, ref) {
|
|
68
|
+
const ListItem = /* @__PURE__ */ React.forwardRef(function ListItem({ selected, className, ...props }, ref) {
|
|
27
69
|
return (_jsx("li", { ...props, ref: ref, "data-selected": selected || undefined, className: ['pui-list-item', className].filter(Boolean).join(' ') }));
|
|
28
70
|
});
|
|
29
71
|
export const List = {
|
|
30
72
|
Root: ListRoot,
|
|
31
73
|
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'),
|
|
74
|
+
Content: /* @__PURE__ */ part('div', 'pui-list-content'),
|
|
75
|
+
Title: /* @__PURE__ */ part('div', 'pui-list-title'),
|
|
76
|
+
Description: /* @__PURE__ */ part('p', 'pui-list-description'),
|
|
77
|
+
Actions: /* @__PURE__ */ part('div', 'pui-list-actions'),
|
|
36
78
|
};
|
|
37
79
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
38
|
-
export { ListRoot, ListItem, TableContainer, TableRow };
|
|
80
|
+
export { ListRoot, ListItem, TableContainer, TableRoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, };
|
|
39
81
|
export const { Content: ListContent, Title: ListTitle, Description: ListDescription, Actions: ListActions, } = List;
|
|
40
|
-
export const {
|
|
82
|
+
export const { Caption: TableCaption, Head: TableHead, Body: TableBody, Foot: TableFoot, } = Table;
|
package/dist/dialog.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { skin } from './parts.js';
|
|
4
5
|
import { useDialogFocusBoundary } from './dialog-focus.js';
|
|
5
6
|
import { useComponentSize } from './sizing.js';
|
|
6
7
|
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
7
8
|
import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog';
|
|
8
9
|
const cx = (...v) => v.filter(Boolean).join(' ');
|
|
9
10
|
/** 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:
|
|
11
|
+
const DialogCloseButton = /* @__PURE__ */ React.forwardRef(function DialogCloseButton({ className, 'aria-label': label = 'Close dialog', ...props }, ref) {
|
|
12
|
+
return (_jsx(BaseDialog.Close, { ...props, ref: ref, "aria-label": label, className: skin('pui-icon-button pui-dialog-close', 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
|
});
|
|
13
|
-
const DialogContent = React.forwardRef(function DialogContent({ className, children, closeLabel = 'Close dialog', closeDisabled, focusBoundaryLabel = 'Continue dialog navigation', ...props }, ref) {
|
|
14
|
+
const DialogContent = /* @__PURE__ */ React.forwardRef(function DialogContent({ className, children, closeLabel = 'Close dialog', closeDisabled, focusBoundaryLabel = 'Continue dialog navigation', ...props }, ref) {
|
|
14
15
|
const scheme = useComponentSize();
|
|
15
16
|
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:
|
|
17
|
+
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: skin('pui-dialog-popup pui-dialog-content', className), children: [_jsx(DialogCloseButton, { "aria-label": closeLabel, disabled: closeDisabled }), children] })] }));
|
|
17
18
|
});
|
|
18
19
|
function DialogHeader({ className, ...props }) {
|
|
19
20
|
return _jsx("div", { ...props, className: cx('pui-dialog-header', className) });
|
|
20
21
|
}
|
|
21
|
-
const DialogBody = React.forwardRef(function DialogBody({ className, ...props }, ref) {
|
|
22
|
+
const DialogBody = /* @__PURE__ */ React.forwardRef(function DialogBody({ className, ...props }, ref) {
|
|
22
23
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-dialog-body', className) }));
|
|
23
24
|
});
|
|
24
25
|
function DialogFooter({ className, ...props }) {
|
|
@@ -32,10 +33,10 @@ export const Dialog = {
|
|
|
32
33
|
Footer: DialogFooter,
|
|
33
34
|
CloseButton: DialogCloseButton,
|
|
34
35
|
};
|
|
35
|
-
const AlertDialogContent = React.forwardRef(function AlertDialogContent({ className, focusBoundaryLabel = 'Continue dialog navigation', ...props }, ref) {
|
|
36
|
+
const AlertDialogContent = /* @__PURE__ */ React.forwardRef(function AlertDialogContent({ className, focusBoundaryLabel = 'Continue dialog navigation', ...props }, ref) {
|
|
36
37
|
const scheme = useComponentSize();
|
|
37
38
|
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:
|
|
39
|
+
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: skin('pui-dialog-popup pui-dialog-content pui-confirm-content', className) })] }));
|
|
39
40
|
});
|
|
40
41
|
export const AlertDialog = {
|
|
41
42
|
...BaseAlertDialog,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Accordion as BaseAccordion } from '@base-ui/react/accordion';
|
|
3
|
+
declare function AccordionRoot<Value = string>({ className, ...props }: BaseAccordion.Root.Props<Value>): React.JSX.Element;
|
|
4
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/accordion").AccordionTriggerProps, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
5
|
+
indicator?: React.ReactNode;
|
|
6
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
declare const AccordionPanel: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/accordion").AccordionPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const Accordion: {
|
|
9
|
+
Root: typeof AccordionRoot;
|
|
10
|
+
Item: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/accordion").AccordionItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
11
|
+
size?: import("./sizing.js").ComponentSize;
|
|
12
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Header: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/accordion").AccordionHeaderProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref">, "size"> & {
|
|
14
|
+
size?: import("./sizing.js").ComponentSize;
|
|
15
|
+
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
16
|
+
Trigger: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/accordion").AccordionTriggerProps, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
17
|
+
indicator?: React.ReactNode;
|
|
18
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
19
|
+
Panel: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/accordion").AccordionPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
};
|
|
21
|
+
declare const CollapsibleTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/collapsible").CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
22
|
+
indicator?: React.ReactNode;
|
|
23
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
declare const CollapsiblePanel: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/collapsible").CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export declare const Collapsible: {
|
|
26
|
+
Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/collapsible").CollapsibleRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
27
|
+
size?: import("./sizing.js").ComponentSize;
|
|
28
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
Trigger: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/collapsible").CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
30
|
+
indicator?: React.ReactNode;
|
|
31
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
Panel: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/collapsible").CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
};
|
|
34
|
+
export { AccordionPanel, AccordionRoot, AccordionTrigger, CollapsiblePanel, CollapsibleTrigger, };
|
|
35
|
+
export declare const AccordionHeader: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/accordion").AccordionHeaderProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref">, "size"> & {
|
|
36
|
+
size?: import("./sizing.js").ComponentSize;
|
|
37
|
+
} & React.RefAttributes<HTMLHeadingElement>>, AccordionItem: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/accordion").AccordionItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
38
|
+
size?: import("./sizing.js").ComponentSize;
|
|
39
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export declare const CollapsibleRoot: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react/collapsible").CollapsibleRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
41
|
+
size?: import("./sizing.js").ComponentSize;
|
|
42
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Accordion as BaseAccordion } from '@base-ui/react/accordion';
|
|
5
|
+
import { Collapsible as BaseCollapsible } from '@base-ui/react/collapsible';
|
|
6
|
+
import { Chevron } from './chevron.js';
|
|
7
|
+
import { skin, part } from './parts.js';
|
|
8
|
+
function AccordionRoot({ className, ...props }) {
|
|
9
|
+
return (_jsx(BaseAccordion.Root, { ...props, className: skin('pui-accordion', className) }));
|
|
10
|
+
}
|
|
11
|
+
const AccordionTrigger = /* @__PURE__ */ React.forwardRef(function AccordionTrigger({ className, children, indicator, ...props }, ref) {
|
|
12
|
+
return (_jsxs(BaseAccordion.Trigger, { ...props, ref: ref, className: skin('pui-disclosure-trigger', className), children: [_jsx("span", { className: 'pui-disclosure-label', children: children }), indicator === undefined ? _jsx(Chevron, {}) : indicator] }));
|
|
13
|
+
});
|
|
14
|
+
const AccordionPanel = /* @__PURE__ */ React.forwardRef(function AccordionPanel({ className, children, render, ...props }, ref) {
|
|
15
|
+
return (_jsx(BaseAccordion.Panel, { ...props, ref: ref, className: skin('pui-accordion-panel', className), render: render ??
|
|
16
|
+
((panelProps, state) => (_jsx("div", { ...panelProps, inert: state.transitionStatus === 'ending' || undefined, "aria-hidden": state.transitionStatus === 'ending' || undefined }))), children: _jsx("div", { className: 'pui-disclosure-body', children: children }) }));
|
|
17
|
+
});
|
|
18
|
+
export const Accordion = {
|
|
19
|
+
...BaseAccordion,
|
|
20
|
+
Root: AccordionRoot,
|
|
21
|
+
Item: /* @__PURE__ */ part(BaseAccordion.Item, 'pui-accordion-item'),
|
|
22
|
+
Header: /* @__PURE__ */ part(BaseAccordion.Header, 'pui-accordion-header'),
|
|
23
|
+
Trigger: AccordionTrigger,
|
|
24
|
+
Panel: AccordionPanel,
|
|
25
|
+
};
|
|
26
|
+
const CollapsibleTrigger = /* @__PURE__ */ React.forwardRef(function CollapsibleTrigger({ className, children, indicator, ...props }, ref) {
|
|
27
|
+
return (_jsxs(BaseCollapsible.Trigger, { ...props, ref: ref, className: skin('pui-disclosure-trigger', className), children: [_jsx("span", { className: 'pui-disclosure-label', children: children }), indicator === undefined ? _jsx(Chevron, {}) : indicator] }));
|
|
28
|
+
});
|
|
29
|
+
const CollapsiblePanel = /* @__PURE__ */ React.forwardRef(function CollapsiblePanel({ className, children, ...props }, ref) {
|
|
30
|
+
return (_jsx(BaseCollapsible.Panel, { ...props, ref: ref, className: skin('pui-collapsible-panel', className), children: _jsx("div", { className: 'pui-disclosure-body', children: children }) }));
|
|
31
|
+
});
|
|
32
|
+
export const Collapsible = {
|
|
33
|
+
...BaseCollapsible,
|
|
34
|
+
Root: /* @__PURE__ */ part(BaseCollapsible.Root, 'pui-collapsible'),
|
|
35
|
+
Trigger: CollapsibleTrigger,
|
|
36
|
+
Panel: CollapsiblePanel,
|
|
37
|
+
};
|
|
38
|
+
// Flat names for React Server Components, which cannot dot into client exports.
|
|
39
|
+
export { AccordionPanel, AccordionRoot, AccordionTrigger, CollapsiblePanel, CollapsibleTrigger, };
|
|
40
|
+
export const { Header: AccordionHeader, Item: AccordionItem } = Accordion;
|
|
41
|
+
export const { Root: CollapsibleRoot } = Collapsible;
|
package/dist/feedback.js
CHANGED
|
@@ -4,30 +4,30 @@ import * as React from 'react';
|
|
|
4
4
|
import { useComponentSize } from './sizing.js';
|
|
5
5
|
import { Progress as BaseProgress } from '@base-ui/react/progress';
|
|
6
6
|
import { Meter as BaseMeter } from '@base-ui/react/meter';
|
|
7
|
-
import { part } from './parts.js';
|
|
7
|
+
import { part, sizeName } from './parts.js';
|
|
8
8
|
export const Progress = {
|
|
9
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'),
|
|
10
|
+
Root: /* @__PURE__ */ part(BaseProgress.Root, 'pui-gauge pui-progress'),
|
|
11
|
+
Label: /* @__PURE__ */ part(BaseProgress.Label, 'pui-gauge-label'),
|
|
12
|
+
Value: /* @__PURE__ */ part(BaseProgress.Value, 'pui-gauge-value'),
|
|
13
|
+
Track: /* @__PURE__ */ part(BaseProgress.Track, 'pui-gauge-track'),
|
|
14
|
+
Indicator: /* @__PURE__ */ part(BaseProgress.Indicator, 'pui-gauge-indicator'),
|
|
15
15
|
};
|
|
16
16
|
export const Meter = {
|
|
17
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'),
|
|
18
|
+
Root: /* @__PURE__ */ part(BaseMeter.Root, 'pui-gauge pui-meter'),
|
|
19
|
+
Label: /* @__PURE__ */ part(BaseMeter.Label, 'pui-gauge-label'),
|
|
20
|
+
Value: /* @__PURE__ */ part(BaseMeter.Value, 'pui-gauge-value'),
|
|
21
|
+
Track: /* @__PURE__ */ part(BaseMeter.Track, 'pui-gauge-track'),
|
|
22
|
+
Indicator: /* @__PURE__ */ part(BaseMeter.Indicator, 'pui-gauge-indicator'),
|
|
23
23
|
};
|
|
24
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) {
|
|
25
|
+
export const Spinner = /* @__PURE__ */ React.forwardRef(function Spinner({ label = 'Loading', decorative = false, size, className, ...props }, ref) {
|
|
26
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 })] }));
|
|
27
|
+
return (_jsxs("span", { ...props, ref: ref, className: ['pui-spinner', className].filter(Boolean).join(' '), "data-size": sizeName(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
28
|
});
|
|
29
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) {
|
|
30
|
+
export const Skeleton = /* @__PURE__ */ React.forwardRef(function Skeleton({ shape = 'text', className, ...props }, ref) {
|
|
31
31
|
return (_jsx("span", { ...props, ref: ref, className: ['pui-skeleton', className].filter(Boolean).join(' '), "data-shape": shape, "aria-hidden": 'true' }));
|
|
32
32
|
});
|
|
33
33
|
// Flat names for React Server Components, which cannot dot into client exports.
|
package/dist/file-upload.js
CHANGED
|
@@ -49,7 +49,7 @@ function sizeLabel(bytes) {
|
|
|
49
49
|
return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(bytes / (unit === 'MB' ? 1024 * 1024 : unit === 'KB' ? 1024 : 1))} ${unit}`;
|
|
50
50
|
}
|
|
51
51
|
/** Native selection/validation and a cancellable transport adapter; no network request is built in. */
|
|
52
|
-
export const FileUpload = React.forwardRef(function FileUpload({ label, description, name, form, accept = '', capture, multiple = false, required = false, maxFiles = Infinity, maxFileSize = Infinity, files: controlled, defaultFiles = [], onFilesChange, onReject, transport, getUploadError, labels: customLabels, disabled = false, className, onDragEnter, onDragLeave, onDragOver, onDrop, ...props }, forwardedRef) {
|
|
52
|
+
export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({ label, description, name, form, accept = '', capture, multiple = false, required = false, maxFiles = Infinity, maxFileSize = Infinity, files: controlled, defaultFiles = [], onFilesChange, onReject, transport, getUploadError, labels: customLabels, disabled = false, className, onDragEnter, onDragLeave, onDragOver, onDrop, ...props }, forwardedRef) {
|
|
53
53
|
const labels = {
|
|
54
54
|
...labelsDefault,
|
|
55
55
|
...customLabels,
|
package/dist/filter-bar.js
CHANGED
|
@@ -3,19 +3,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
const cx = (base, extra) => [base, extra].filter(Boolean).join(' ');
|
|
5
5
|
/** Layout only: filtering, routing and async results remain controlled by the caller. */
|
|
6
|
-
const Root = React.forwardRef(function FilterBarRoot({ label, className, ...props }, ref) {
|
|
6
|
+
const Root = /* @__PURE__ */ React.forwardRef(function FilterBarRoot({ label, className, ...props }, ref) {
|
|
7
7
|
return (_jsx("form", { ...props, ref: ref, role: 'search', "aria-label": label, className: cx('pui-filter-bar', className) }));
|
|
8
8
|
});
|
|
9
|
-
const Controls = React.forwardRef(function FilterBarControls({ className, ...props }, ref) {
|
|
9
|
+
const Controls = /* @__PURE__ */ React.forwardRef(function FilterBarControls({ className, ...props }, ref) {
|
|
10
10
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-filter-bar-controls', className) }));
|
|
11
11
|
});
|
|
12
|
-
const Field = React.forwardRef(function FilterBarField({ width = 'filter', className, ...props }, ref) {
|
|
12
|
+
const Field = /* @__PURE__ */ React.forwardRef(function FilterBarField({ width = 'filter', className, ...props }, ref) {
|
|
13
13
|
return (_jsx("label", { ...props, ref: ref, "data-width": width, className: cx('pui-filter-bar-field', className) }));
|
|
14
14
|
});
|
|
15
|
-
const Actions = React.forwardRef(function FilterBarActions({ className, ...props }, ref) {
|
|
15
|
+
const Actions = /* @__PURE__ */ React.forwardRef(function FilterBarActions({ className, ...props }, ref) {
|
|
16
16
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-filter-bar-actions', className) }));
|
|
17
17
|
});
|
|
18
|
-
const Summary = React.forwardRef(function FilterBarSummary({ className, ...props }, ref) {
|
|
18
|
+
const Summary = /* @__PURE__ */ React.forwardRef(function FilterBarSummary({ className, ...props }, ref) {
|
|
19
19
|
return (_jsx("div", { role: 'status', "aria-atomic": 'true', ...props, ref: ref, className: cx('pui-filter-bar-summary', className) }));
|
|
20
20
|
});
|
|
21
21
|
export const FilterBar = { Root, Controls, Field, Actions, Summary };
|
package/dist/forms.js
CHANGED
|
@@ -10,14 +10,14 @@ import { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-grou
|
|
|
10
10
|
import { Radio as BaseRadio } from '@base-ui/react/radio';
|
|
11
11
|
import { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';
|
|
12
12
|
import { Switch as BaseSwitch } from '@base-ui/react/switch';
|
|
13
|
-
const ChoiceResetPaint = React.createContext(0);
|
|
13
|
+
const ChoiceResetPaint = /* @__PURE__ */ React.createContext(0);
|
|
14
14
|
import { skin, part } from './parts.js';
|
|
15
|
-
const FieldRoot = part(BaseField.Root, 'pui-field');
|
|
16
|
-
const FieldLabel = part(BaseField.Label, 'pui-field-label');
|
|
17
|
-
const FieldControl = part(BaseField.Control, 'pui-input');
|
|
18
|
-
const FieldDescription = part(BaseField.Description, 'pui-field-description');
|
|
19
|
-
const FieldError = part(BaseField.Error, 'pui-field-error');
|
|
20
|
-
const FieldItem = part(BaseField.Item, 'pui-field-item');
|
|
15
|
+
const FieldRoot = /* @__PURE__ */ part(BaseField.Root, 'pui-field');
|
|
16
|
+
const FieldLabel = /* @__PURE__ */ part(BaseField.Label, 'pui-field-label');
|
|
17
|
+
const FieldControl = /* @__PURE__ */ part(BaseField.Control, 'pui-input');
|
|
18
|
+
const FieldDescription = /* @__PURE__ */ part(BaseField.Description, 'pui-field-description');
|
|
19
|
+
const FieldError = /* @__PURE__ */ part(BaseField.Error, 'pui-field-error');
|
|
20
|
+
const FieldItem = /* @__PURE__ */ part(BaseField.Item, 'pui-field-item');
|
|
21
21
|
export const Field = {
|
|
22
22
|
...BaseField,
|
|
23
23
|
Root: FieldRoot,
|
|
@@ -29,20 +29,20 @@ export const Field = {
|
|
|
29
29
|
};
|
|
30
30
|
export const Fieldset = {
|
|
31
31
|
...BaseFieldset,
|
|
32
|
-
Root: part(BaseFieldset.Root, 'pui-fieldset'),
|
|
33
|
-
Legend: part(BaseFieldset.Legend, 'pui-fieldset-legend'),
|
|
32
|
+
Root: /* @__PURE__ */ part(BaseFieldset.Root, 'pui-fieldset'),
|
|
33
|
+
Legend: /* @__PURE__ */ part(BaseFieldset.Legend, 'pui-fieldset-legend'),
|
|
34
34
|
};
|
|
35
35
|
export function Form({ className, ...props }) {
|
|
36
36
|
return _jsx(BaseForm, { ...props, className: skin('pui-form', className) });
|
|
37
37
|
}
|
|
38
|
-
export const Textarea = React.forwardRef(function Textarea({ className, size, ...props }, ref) {
|
|
38
|
+
export const Textarea = /* @__PURE__ */ React.forwardRef(function Textarea({ className, size, ...props }, ref) {
|
|
39
39
|
const scheme = useComponentSize(size);
|
|
40
40
|
return (_jsx("textarea", { "data-ui-size": scheme, ...props, ref: ref, className: ['pui-input pui-textarea', className]
|
|
41
41
|
.filter(Boolean)
|
|
42
42
|
.join(' ') }));
|
|
43
43
|
});
|
|
44
44
|
import { useRootRef, useResetValue } from './form-state.js';
|
|
45
|
-
const CheckboxRoot = React.forwardRef(function CheckboxRoot({ checked, defaultChecked = false, onCheckedChange, className, form, ...props }, ref) {
|
|
45
|
+
const CheckboxRoot = /* @__PURE__ */ React.forwardRef(function CheckboxRoot({ checked, defaultChecked = false, onCheckedChange, className, form, ...props }, ref) {
|
|
46
46
|
React.useContext(ChoiceResetPaint);
|
|
47
47
|
const [element, attach] = useRootRef(ref);
|
|
48
48
|
const [selected, setSelected] = useResetValue(checked, defaultChecked, element, form);
|
|
@@ -52,7 +52,7 @@ const CheckboxRoot = React.forwardRef(function CheckboxRoot({ checked, defaultCh
|
|
|
52
52
|
setSelected(next);
|
|
53
53
|
} }));
|
|
54
54
|
});
|
|
55
|
-
const CheckboxIndicator = React.forwardRef(function CheckboxIndicator({ className, children, ...props }, ref) {
|
|
55
|
+
const CheckboxIndicator = /* @__PURE__ */ React.forwardRef(function CheckboxIndicator({ className, children, ...props }, ref) {
|
|
56
56
|
return (_jsx(BaseCheckbox.Indicator, { ...props, ref: ref, className: skin('pui-checkbox-indicator', className), children: children ?? (_jsxs("svg", { width: '14', height: '14', viewBox: '0 0 20 20', fill: 'none', stroke: 'currentColor', strokeWidth: '2', "aria-hidden": 'true', children: [_jsx("path", { className: 'pui-checkbox-check', d: 'm4 10 4 4 8-8' }), _jsx("path", { className: 'pui-checkbox-mixed', d: 'M4 10h12' })] })) }));
|
|
57
57
|
});
|
|
58
58
|
export const Checkbox = {
|
|
@@ -60,7 +60,7 @@ export const Checkbox = {
|
|
|
60
60
|
Root: CheckboxRoot,
|
|
61
61
|
Indicator: CheckboxIndicator,
|
|
62
62
|
};
|
|
63
|
-
export const CheckboxGroup = React.forwardRef(function CheckboxGroup({ value, defaultValue = [], onValueChange, className, ...props }, ref) {
|
|
63
|
+
export const CheckboxGroup = /* @__PURE__ */ React.forwardRef(function CheckboxGroup({ value, defaultValue = [], onValueChange, className, ...props }, ref) {
|
|
64
64
|
const [element, attach] = useRootRef(ref);
|
|
65
65
|
const [selected, setSelected, revision] = useResetValue(value, defaultValue, element);
|
|
66
66
|
return (_jsx(ChoiceResetPaint.Provider, { value: revision, children: _jsx(BaseCheckboxGroup, { ...props, ref: attach, value: selected, className: skin('pui-choice-group', className), onValueChange: (next, event) => {
|
|
@@ -78,16 +78,16 @@ export function RadioGroup({ value, defaultValue, onValueChange, className, form
|
|
|
78
78
|
setSelected(next);
|
|
79
79
|
} }) }));
|
|
80
80
|
}
|
|
81
|
-
const RadioRoot = React.forwardRef(function RadioRoot({ className, ...props }, ref) {
|
|
81
|
+
const RadioRoot = /* @__PURE__ */ React.forwardRef(function RadioRoot({ className, ...props }, ref) {
|
|
82
82
|
React.useContext(ChoiceResetPaint);
|
|
83
83
|
return (_jsx(BaseRadio.Root, { ...props, ref: ref, className: skin('pui-radio', className) }));
|
|
84
84
|
});
|
|
85
85
|
export const Radio = {
|
|
86
86
|
...BaseRadio,
|
|
87
87
|
Root: RadioRoot,
|
|
88
|
-
Indicator: part(BaseRadio.Indicator, 'pui-radio-indicator'),
|
|
88
|
+
Indicator: /* @__PURE__ */ part(BaseRadio.Indicator, 'pui-radio-indicator'),
|
|
89
89
|
};
|
|
90
|
-
const SwitchRoot = React.forwardRef(function SwitchRoot({ checked, defaultChecked = false, onCheckedChange, className, form, ...props }, ref) {
|
|
90
|
+
const SwitchRoot = /* @__PURE__ */ React.forwardRef(function SwitchRoot({ checked, defaultChecked = false, onCheckedChange, className, form, ...props }, ref) {
|
|
91
91
|
const [element, attach] = useRootRef(ref);
|
|
92
92
|
const [selected, setSelected] = useResetValue(checked, defaultChecked, element, form);
|
|
93
93
|
return (_jsx(BaseSwitch.Root, { ...props, form: form, ref: attach, checked: selected, className: skin('pui-switch', className), onCheckedChange: (next, event) => {
|
|
@@ -99,7 +99,7 @@ const SwitchRoot = React.forwardRef(function SwitchRoot({ checked, defaultChecke
|
|
|
99
99
|
export const Switch = {
|
|
100
100
|
...BaseSwitch,
|
|
101
101
|
Root: SwitchRoot,
|
|
102
|
-
Thumb: part(BaseSwitch.Thumb, 'pui-switch-thumb'),
|
|
102
|
+
Thumb: /* @__PURE__ */ part(BaseSwitch.Thumb, 'pui-switch-thumb'),
|
|
103
103
|
};
|
|
104
104
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
105
105
|
export { CheckboxIndicator, CheckboxRoot, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldRoot, RadioRoot, SwitchRoot, };
|
package/dist/foundations.js
CHANGED
|
@@ -6,23 +6,23 @@ const gapStyle = (gap, style) => ({
|
|
|
6
6
|
...(gap === undefined ? {} : { '--layout-gap': `var(--space-${gap})` }),
|
|
7
7
|
...style,
|
|
8
8
|
});
|
|
9
|
-
export const Container = React.forwardRef(function Container({ width = 'workspace', className, ...props }, ref) {
|
|
9
|
+
export const Container = /* @__PURE__ */ React.forwardRef(function Container({ width = 'workspace', className, ...props }, ref) {
|
|
10
10
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-container', className), "data-width": width }));
|
|
11
11
|
});
|
|
12
|
-
export const Stack = React.forwardRef(function Stack({ gap, className, style, ...props }, ref) {
|
|
12
|
+
export const Stack = /* @__PURE__ */ React.forwardRef(function Stack({ gap, className, style, ...props }, ref) {
|
|
13
13
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-stack', className), style: gapStyle(gap, style) }));
|
|
14
14
|
});
|
|
15
|
-
export const Inline = React.forwardRef(function Inline({ gap, justify = 'start', className, style, ...props }, ref) {
|
|
15
|
+
export const Inline = /* @__PURE__ */ React.forwardRef(function Inline({ gap, justify = 'start', className, style, ...props }, ref) {
|
|
16
16
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-inline', className), "data-justify": justify, style: gapStyle(gap, style) }));
|
|
17
17
|
});
|
|
18
|
-
export const Grid = React.forwardRef(function Grid({ gap, bleed = 0, columns = 3, className, style, ...props }, ref) {
|
|
18
|
+
export const Grid = /* @__PURE__ */ React.forwardRef(function Grid({ gap, bleed = 0, columns = 3, className, style, ...props }, ref) {
|
|
19
19
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-grid', className), "data-columns": columns, style: gapStyle(gap, {
|
|
20
20
|
'--grid-inline-bleed': `var(--space-${bleed})`,
|
|
21
21
|
...style,
|
|
22
22
|
}) }));
|
|
23
23
|
});
|
|
24
24
|
/** Spans are explicit at each viewport breakpoint; placement follows DOM order. */
|
|
25
|
-
export const GridItem = React.forwardRef(function GridItem({ span, mediumSpan, smallSpan, className, style, ...props }, ref) {
|
|
25
|
+
export const GridItem = /* @__PURE__ */ React.forwardRef(function GridItem({ span, mediumSpan, smallSpan, className, style, ...props }, ref) {
|
|
26
26
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-grid-item', className), style: {
|
|
27
27
|
'--grid-item-span': span,
|
|
28
28
|
'--grid-item-span-medium': mediumSpan,
|
|
@@ -30,7 +30,7 @@ export const GridItem = React.forwardRef(function GridItem({ span, mediumSpan, s
|
|
|
30
30
|
...style,
|
|
31
31
|
} }));
|
|
32
32
|
});
|
|
33
|
-
export const Surface = React.forwardRef(function Surface({ tone = 'subtle', padding, className, style, ...props }, ref) {
|
|
33
|
+
export const Surface = /* @__PURE__ */ React.forwardRef(function Surface({ tone = 'subtle', padding, className, style, ...props }, ref) {
|
|
34
34
|
return (_jsx("div", { ...props, ref: ref, className: cx('pui-surface', className), "data-tone": tone, style: {
|
|
35
35
|
...(padding === undefined
|
|
36
36
|
? {}
|
|
@@ -50,6 +50,6 @@ export function PageHeader({ as: Root = 'div', headingProps, actionsLabel, title
|
|
|
50
50
|
description !== false &&
|
|
51
51
|
description !== '' && (_jsx(Text, { color: 'secondary', className: 'pui-page-header-description', children: description }))] }), actions != null && actions !== false && actions !== '' && (_jsx("div", { className: 'pui-page-header-actions', role: actionsLabel ? 'group' : undefined, "aria-label": actionsLabel, children: actions }))] })] }));
|
|
52
52
|
}
|
|
53
|
-
export const Prose = React.forwardRef(function Prose({ className, ...props }, ref) {
|
|
53
|
+
export const Prose = /* @__PURE__ */ React.forwardRef(function Prose({ className, ...props }, ref) {
|
|
54
54
|
return _jsx("div", { ...props, ref: ref, className: cx('pui-prose', className) });
|
|
55
55
|
});
|
package/dist/icon.d.ts
CHANGED
package/dist/icon.js
CHANGED
|
@@ -10,6 +10,7 @@ const shapes = {
|
|
|
10
10
|
alert: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: '12', cy: '12', r: '9' }), _jsx("path", { d: 'M12 7v6m0 3v1' })] })),
|
|
11
11
|
warning: (_jsxs(_Fragment, { children: [_jsx("path", { d: 'm12 3 10 18H2L12 3Z' }), _jsx("path", { d: 'M12 9v4m0 3v1' })] })),
|
|
12
12
|
menu: _jsx("path", { d: 'M4 6h16M4 12h16M4 18h16' }),
|
|
13
|
+
more: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: '5', cy: '12', r: '1' }), _jsx("circle", { cx: '12', cy: '12', r: '1' }), _jsx("circle", { cx: '19', cy: '12', r: '1' })] })),
|
|
13
14
|
sun: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: '12', cy: '12', r: '4' }), _jsx("path", { d: 'M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5' })] })),
|
|
14
15
|
moon: _jsx("path", { d: 'M20.5 13.2A8.5 8.5 0 0 1 10.8 3.5 8.5 8.5 0 1 0 20.5 13.2Z' }),
|
|
15
16
|
monitor: (_jsxs(_Fragment, { children: [_jsx("rect", { x: '3', y: '4', width: '18', height: '13', rx: '2' }), _jsx("path", { d: 'M8 21h8m-4-4v4' })] })),
|
|
@@ -23,6 +24,8 @@ const shapes = {
|
|
|
23
24
|
};
|
|
24
25
|
export const iconNames = Object.keys(shapes);
|
|
25
26
|
/** Static SVG only. Actions, focus, accessible button names and hit targets belong to the parent control. */
|
|
26
|
-
export const Icon = React.forwardRef(function Icon({ name, size = 'sm', decorative = true, label, className, ...props }, ref) {
|
|
27
|
-
return (_jsx("svg", { ...props, ref: ref, className: ['pui-icon', className].filter(Boolean).join(' '), "data-size": size, "data-directional": name === 'chevron-forward' || name === 'arrow-back'
|
|
27
|
+
export const Icon = /* @__PURE__ */ React.forwardRef(function Icon({ name, size = 'sm', decorative = true, label, className, ...props }, ref) {
|
|
28
|
+
return (_jsx("svg", { ...props, ref: ref, className: ['pui-icon', className].filter(Boolean).join(' '), "data-size": size, "data-directional": name === 'chevron-forward' || name === 'arrow-back'
|
|
29
|
+
? 'true'
|
|
30
|
+
: undefined, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeLinecap: 'round', strokeLinejoin: 'round', focusable: 'false', "aria-hidden": decorative ? true : undefined, role: decorative ? undefined : 'img', "aria-label": decorative ? undefined : label, children: shapes[name] }));
|
|
28
31
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -11,10 +11,14 @@ export { ScrollArea } from './scroll-area.js';
|
|
|
11
11
|
export { Sheet, Drawer, type PanelSide, SheetBackdrop, SheetClose, SheetDescription, SheetHandle, SheetPopup, SheetPortal, SheetRoot, SheetTitle, SheetTrigger, SheetViewport, SheetContent, SheetHeader, SheetBody, SheetFooter, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerHandle, DrawerIndent, DrawerIndentBackground, DrawerPopup, DrawerPortal, DrawerProvider, DrawerRoot, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerViewport, DrawerVirtualKeyboardProvider, DrawerPrimitiveContent, DrawerHeader, DrawerBody, DrawerFooter, } from './panels.js';
|
|
12
12
|
export { Container, Stack, Inline, Grid, GridItem, Surface, Heading, Text, PageHeader, Prose, type Space, } from './foundations.js';
|
|
13
13
|
export { Field, Fieldset, Form, Textarea, Checkbox, CheckboxGroup, Radio, RadioGroup, Switch, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldRoot, FieldValidity, FieldsetLegend, FieldsetRoot, CheckboxIndicator, CheckboxRoot, RadioIndicator, RadioRoot, SwitchRoot, SwitchThumb, } from './forms.js';
|
|
14
|
-
export { Tabs,
|
|
14
|
+
export { Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, } from './tabs.js';
|
|
15
|
+
export { Accordion, Collapsible, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger, } from './disclosure.js';
|
|
16
|
+
export { Avatar, AvatarFallback, AvatarImage, AvatarRoot, AvatarStatus, } from './avatar.js';
|
|
17
|
+
export { Separator, Link, Breadcrumbs, BreadcrumbsRoot, BreadcrumbsList, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsSeparator, BreadcrumbsCurrent, } from './navigation.js';
|
|
15
18
|
export { Badge, StatusBadge, type BadgeProps, type StatusTone, } from './status.js';
|
|
16
19
|
export { Progress, Meter, Spinner, Skeleton, type SpinnerProps, type SkeletonProps, ProgressIndicator, ProgressLabel, ProgressRoot, ProgressTrack, ProgressValue, MeterIndicator, MeterLabel, MeterRoot, MeterTrack, MeterValue, } from './feedback.js';
|
|
17
|
-
export { Table, List, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableCell, ListRoot, ListItem, ListContent, ListTitle, ListDescription, ListActions, } from './data.js';
|
|
20
|
+
export { Table, List, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, ListRoot, ListItem, ListContent, ListTitle, ListDescription, ListActions, type TableDensity, type TableSort, } from './data.js';
|
|
21
|
+
export { useTableSelection, type TableSelectionOptions, type TableSelectionCheckbox, } from './table-selection.js';
|
|
18
22
|
export { InlineMessage, EmptyState, InlineMessageRoot, InlineMessageIcon, InlineMessageContent, InlineMessageTitle, InlineMessageDescription, InlineMessageActions, EmptyStateRoot, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, } from './messages.js';
|
|
19
23
|
export { Card, CodeBlock, type CodeBlockProps, CardRoot, CardHeader, CardTitle, CardDescription, CardBody, CardFooter, } from './content.js';
|
|
20
24
|
export { Pagination, type PaginationProps } from './pagination.js';
|
|
@@ -29,9 +33,5 @@ export { Toast, type ToastRootProps, type ToastViewportProps, ToastAction, Toast
|
|
|
29
33
|
export { FileUpload, type FileUploadProps, type UploadTransport, type FileUploadLabels, type FileChangeDetails, type FileRejection, type UploadState, } from './file-upload.js';
|
|
30
34
|
export { Icon, iconNames, type IconName, type IconProps } from './icon.js';
|
|
31
35
|
export { FilterBar, FilterBarRoot, FilterBarControls, FilterBarField, FilterBarActions, FilterBarSummary, } from './filter-bar.js';
|
|
32
|
-
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellContent, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
|
|
33
|
-
export { Tree, type TreeNode, type TreeProps } from './tree.js';
|
|
34
|
-
export { DatePicker, DateRangePicker, TimeField, DateLocaleProvider, type DatePickerProps, type DateRangePickerProps, type TimeFieldProps, type DateValue, type TimeValue, } from './date-picker.js';
|
|
35
|
-
export { Chart, type ChartDatum, type ChartSeries, type ChartProps, } from './chart.js';
|
|
36
|
+
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
|
|
36
37
|
export { SyntaxHighlighter, syntaxLanguages, type SyntaxHighlighterProps, } from './syntax-highlighter.js';
|
|
37
|
-
export { Markdown, type MarkdownProps } from './markdown.js';
|
package/dist/index.js
CHANGED
|
@@ -12,10 +12,14 @@ export { ScrollArea } from './scroll-area.js';
|
|
|
12
12
|
export { Sheet, Drawer, SheetBackdrop, SheetClose, SheetDescription, SheetHandle, SheetPopup, SheetPortal, SheetRoot, SheetTitle, SheetTrigger, SheetViewport, SheetContent, SheetHeader, SheetBody, SheetFooter, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerHandle, DrawerIndent, DrawerIndentBackground, DrawerPopup, DrawerPortal, DrawerProvider, DrawerRoot, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerViewport, DrawerVirtualKeyboardProvider, DrawerPrimitiveContent, DrawerHeader, DrawerBody, DrawerFooter, } from './panels.js';
|
|
13
13
|
export { Container, Stack, Inline, Grid, GridItem, Surface, Heading, Text, PageHeader, Prose, } from './foundations.js';
|
|
14
14
|
export { Field, Fieldset, Form, Textarea, Checkbox, CheckboxGroup, Radio, RadioGroup, Switch, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldRoot, FieldValidity, FieldsetLegend, FieldsetRoot, CheckboxIndicator, CheckboxRoot, RadioIndicator, RadioRoot, SwitchRoot, SwitchThumb, } from './forms.js';
|
|
15
|
-
export { Tabs,
|
|
15
|
+
export { Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, } from './tabs.js';
|
|
16
|
+
export { Accordion, Collapsible, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger, } from './disclosure.js';
|
|
17
|
+
export { Avatar, AvatarFallback, AvatarImage, AvatarRoot, AvatarStatus, } from './avatar.js';
|
|
18
|
+
export { Separator, Link, Breadcrumbs, BreadcrumbsRoot, BreadcrumbsList, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsSeparator, BreadcrumbsCurrent, } from './navigation.js';
|
|
16
19
|
export { Badge, StatusBadge, } from './status.js';
|
|
17
20
|
export { Progress, Meter, Spinner, Skeleton, ProgressIndicator, ProgressLabel, ProgressRoot, ProgressTrack, ProgressValue, MeterIndicator, MeterLabel, MeterRoot, MeterTrack, MeterValue, } from './feedback.js';
|
|
18
|
-
export { Table, List, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableCell, ListRoot, ListItem, ListContent, ListTitle, ListDescription, ListActions, } from './data.js';
|
|
21
|
+
export { Table, List, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, ListRoot, ListItem, ListContent, ListTitle, ListDescription, ListActions, } from './data.js';
|
|
22
|
+
export { useTableSelection, } from './table-selection.js';
|
|
19
23
|
export { InlineMessage, EmptyState, InlineMessageRoot, InlineMessageIcon, InlineMessageContent, InlineMessageTitle, InlineMessageDescription, InlineMessageActions, EmptyStateRoot, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, } from './messages.js';
|
|
20
24
|
export { Card, CodeBlock, CardRoot, CardHeader, CardTitle, CardDescription, CardBody, CardFooter, } from './content.js';
|
|
21
25
|
export { Pagination } from './pagination.js';
|
|
@@ -30,9 +34,8 @@ export { Toast, ToastAction, ToastArrow, ToastClose, ToastContent, ToastDescript
|
|
|
30
34
|
export { FileUpload, } from './file-upload.js';
|
|
31
35
|
export { Icon, iconNames } from './icon.js';
|
|
32
36
|
export { FilterBar, FilterBarRoot, FilterBarControls, FilterBarField, FilterBarActions, FilterBarSummary, } from './filter-bar.js';
|
|
33
|
-
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellContent, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
|
|
38
|
+
// Chart, DatePicker, Markdown, Tree and syntax highlighting need optional packages, so
|
|
39
|
+
// they live on their own entry points: @surflane/ui/chart, /date-picker, /markdown, /tree
|
|
40
|
+
// and /syntax-highlighting.
|
|
37
41
|
export { SyntaxHighlighter, syntaxLanguages, } from './syntax-highlighter.js';
|
|
38
|
-
export { Markdown } from './markdown.js';
|