@surflane/ui 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/accordion.d.ts +33 -17
- package/dist/accordion.js +10 -11
- package/dist/alert-dialog.d.ts +8 -4
- package/dist/alert-dialog.js +3 -4
- package/dist/app-shell.d.ts +81 -44
- package/dist/app-shell.js +67 -29
- package/dist/autocomplete.d.ts +117 -61
- package/dist/autocomplete.js +8 -8
- package/dist/avatar.d.ts +34 -17
- package/dist/avatar.js +8 -9
- package/dist/badge.d.ts +6 -10
- package/dist/badge.js +5 -6
- package/dist/bottom-navigation.d.ts +11 -41
- package/dist/bottom-navigation.js +9 -10
- package/dist/breadcrumbs.d.ts +21 -5
- package/dist/breadcrumbs.js +12 -14
- package/dist/button.d.ts +15 -8
- package/dist/button.js +8 -9
- package/dist/card.d.ts +610 -35
- package/dist/card.js +12 -12
- package/dist/chart.d.ts +9 -32
- package/dist/chart.js +65 -26
- package/dist/checkbox-group.d.ts +4 -1
- package/dist/checkbox-group.js +3 -4
- package/dist/checkbox.d.ts +13 -4
- package/dist/checkbox.js +6 -6
- package/dist/choice-label.d.ts +3 -11
- package/dist/choice-label.js +4 -4
- package/dist/class-names.d.ts +6 -0
- package/dist/class-names.js +18 -0
- package/dist/code.d.ts +13 -10
- package/dist/code.js +8 -5
- package/dist/collapsible.d.ts +25 -12
- package/dist/collapsible.js +7 -8
- package/dist/combobox.d.ts +145 -73
- package/dist/combobox.js +27 -27
- package/dist/context-menu.d.ts +106 -54
- package/dist/context-menu.js +4 -5
- package/dist/css/accordion.css +1 -1
- package/dist/css/alert-dialog.css +2 -2
- package/dist/css/all.css +7 -5
- package/dist/css/app-shell.css +1 -1
- package/dist/css/autocomplete.css +1 -1
- package/dist/css/avatar.css +2 -2
- package/dist/css/badge.css +2 -2
- package/dist/css/bottom-navigation.css +1 -1
- package/dist/css/breadcrumbs.css +3 -3
- package/dist/css/button.css +1 -1
- package/dist/css/card.css +3 -3
- package/dist/css/chart.css +2 -2
- package/dist/css/checkbox-group.css +1 -1
- package/dist/css/checkbox.css +1 -1
- package/dist/css/choice-label.css +1 -1
- package/dist/css/code.css +2 -2
- package/dist/css/collapsible.css +1 -1
- package/dist/css/combobox.css +1 -1
- package/dist/css/context-menu.css +1 -1
- package/dist/css/date-picker.css +1 -1
- package/dist/css/dialog.css +2 -2
- package/dist/css/drawer.css +2 -2
- package/dist/css/empty-state.css +2 -2
- package/dist/css/field.css +1 -1
- package/dist/css/fieldset.css +1 -1
- package/dist/css/file-upload.css +2 -2
- package/dist/css/filter-bar.css +1 -1
- package/dist/css/form.css +1 -1
- package/dist/css/icon.css +1 -1
- package/dist/css/inline-message.css +2 -2
- package/dist/css/input.css +1 -1
- package/dist/css/layout.css +2 -2
- package/dist/css/link.css +2 -2
- package/dist/css/list.css +2 -2
- package/dist/css/markdown.css +4 -4
- package/dist/css/menu.css +1 -1
- package/dist/css/menubar.css +1 -1
- package/dist/css/meter.css +1 -1
- package/dist/css/native-select.css +1 -1
- package/dist/css/navigation-menu.css +1 -1
- package/dist/css/number-field.css +1 -1
- package/dist/css/otp-field.css +1 -1
- package/dist/css/page-header.css +3 -3
- package/dist/css/pagination.css +2 -2
- package/dist/css/popover.css +1 -1
- package/dist/css/preview-card.css +2 -2
- package/dist/css/progress.css +1 -1
- package/dist/css/radio-group.css +1 -1
- package/dist/css/rules/accordion.css +5 -5
- package/dist/css/rules/alert-dialog.css +9 -9
- package/dist/css/rules/app-shell.css +274 -82
- package/dist/css/rules/avatar.css +7 -7
- package/dist/css/rules/badge.css +6 -6
- package/dist/css/rules/bar.css +11 -11
- package/dist/css/rules/base.css +30 -30
- package/dist/css/rules/bottom-navigation.css +57 -56
- package/dist/css/rules/breadcrumbs.css +2 -2
- package/dist/css/rules/button.css +66 -65
- package/dist/css/rules/card.css +3 -3
- package/dist/css/rules/chart.css +134 -124
- package/dist/css/rules/checkbox.css +5 -5
- package/dist/css/rules/choice-label.css +19 -18
- package/dist/css/rules/choice.css +65 -60
- package/dist/css/rules/code.css +2 -2
- package/dist/css/rules/collapsible.css +2 -2
- package/dist/css/rules/combobox.css +87 -83
- package/dist/css/rules/context-menu.css +1 -1
- package/dist/css/rules/date-picker.css +150 -144
- package/dist/css/rules/dialog.css +85 -79
- package/dist/css/rules/disclosure.css +49 -47
- package/dist/css/rules/drawer.css +6 -6
- package/dist/css/rules/empty-state.css +2 -2
- package/dist/css/rules/field-control.css +51 -42
- package/dist/css/rules/field.css +26 -24
- package/dist/css/rules/fieldset.css +10 -8
- package/dist/css/rules/file-upload.css +73 -72
- package/dist/css/rules/filter-bar.css +19 -18
- package/dist/css/rules/form.css +3 -3
- package/dist/css/rules/gauge.css +22 -22
- package/dist/css/rules/icon.css +16 -11
- package/dist/css/rules/inline-message.css +3 -3
- package/dist/css/rules/input-group.css +50 -43
- package/dist/css/rules/input.css +11 -11
- package/dist/css/rules/item.css +7 -7
- package/dist/css/rules/link.css +2 -2
- package/dist/css/rules/list.css +3 -3
- package/dist/css/rules/markdown.css +27 -27
- package/dist/css/rules/menu.css +45 -42
- package/dist/css/rules/menubar.css +6 -6
- package/dist/css/rules/navigation-menu.css +69 -66
- package/dist/css/rules/number-field.css +22 -21
- package/dist/css/rules/otp-field.css +28 -27
- package/dist/css/rules/panel.css +105 -100
- package/dist/css/rules/popover.css +23 -20
- package/dist/css/rules/popup.css +15 -14
- package/dist/css/rules/preview-card.css +20 -19
- package/dist/css/rules/progress.css +3 -3
- package/dist/css/rules/radio-group.css +8 -8
- package/dist/css/rules/scroll-area.css +50 -39
- package/dist/css/rules/select.css +39 -36
- package/dist/css/rules/sizing.css +119 -116
- package/dist/css/rules/skeleton.css +18 -11
- package/dist/css/rules/slider.css +43 -43
- package/dist/css/rules/sparkline.css +21 -21
- package/dist/css/rules/spinner.css +9 -9
- package/dist/css/rules/stat.css +32 -32
- package/dist/css/rules/switch.css +28 -21
- package/dist/css/rules/syntax-highlighter.css +37 -36
- package/dist/css/rules/table.css +10 -10
- package/dist/css/rules/tabs.css +53 -52
- package/dist/css/rules/textarea.css +9 -7
- package/dist/css/rules/toast.css +94 -90
- package/dist/css/rules/toggle.css +12 -12
- package/dist/css/rules/toolbar.css +27 -27
- package/dist/css/rules/tooltip.css +14 -14
- package/dist/css/rules/tree.css +38 -38
- package/dist/css/scroll-area.css +1 -1
- package/dist/css/select.css +1 -1
- package/dist/css/separator.css +2 -2
- package/dist/css/sheet.css +2 -2
- package/dist/css/sizing.css +1 -1
- package/dist/css/skeleton.css +1 -1
- package/dist/css/slider.css +1 -1
- package/dist/css/sparkline.css +1 -1
- package/dist/css/spinner.css +1 -1
- package/dist/css/stat.css +1 -1
- package/dist/css/styles.css +17 -17
- package/dist/css/switch.css +1 -1
- package/dist/css/syntax-highlighter.css +1 -1
- package/dist/css/table.css +2 -2
- package/dist/css/tabs.css +1 -1
- package/dist/css/textarea.css +1 -1
- package/dist/css/toast.css +1 -1
- package/dist/css/toggle-group.css +1 -1
- package/dist/css/toggle.css +1 -1
- package/dist/css/toolbar.css +1 -1
- package/dist/css/tooltip.css +1 -1
- package/dist/css/tree.css +1 -1
- package/dist/css/typography.css +2 -2
- package/dist/date-picker.js +28 -8
- package/dist/dialog.d.ts +20 -8
- package/dist/dialog.js +11 -12
- package/dist/drawer.d.ts +12 -4
- package/dist/drawer.js +5 -5
- package/dist/element-part.d.ts +8 -0
- package/dist/element-part.js +21 -0
- package/dist/empty-state.d.ts +602 -24
- package/dist/empty-state.js +9 -9
- package/dist/field.d.ts +60 -36
- package/dist/field.js +6 -6
- package/dist/fieldset.d.ts +19 -11
- package/dist/fieldset.js +2 -2
- package/dist/file-upload.d.ts +8 -23
- package/dist/file-upload.js +23 -16
- package/dist/filter-bar.d.ts +30 -10
- package/dist/filter-bar.js +16 -18
- package/dist/form.js +1 -1
- package/dist/icon.d.ts +9 -2
- package/dist/icon.js +6 -6
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -3
- package/dist/inline-message.d.ts +51 -27
- package/dist/inline-message.js +10 -11
- package/dist/input.d.ts +4 -2
- package/dist/input.js +3 -4
- package/dist/layout.d.ts +24 -12
- package/dist/layout.js +27 -27
- package/dist/link.d.ts +3 -1
- package/dist/link.js +3 -4
- package/dist/list.d.ts +43 -27
- package/dist/list.js +12 -13
- package/dist/markdown.d.ts +14 -6
- package/dist/markdown.js +28 -11
- package/dist/menu.d.ts +113 -57
- package/dist/menu.js +24 -25
- package/dist/menubar.d.ts +5 -3
- package/dist/menubar.js +1 -1
- package/dist/meter.d.ts +46 -26
- package/dist/meter.js +5 -5
- package/dist/native-select.d.ts +4 -2
- package/dist/native-select.js +2 -2
- package/dist/navigation-menu.d.ts +76 -40
- package/dist/navigation-menu.js +15 -16
- package/dist/number-field.d.ts +44 -19
- package/dist/number-field.js +12 -13
- package/dist/otp-field.d.ts +26 -9
- package/dist/otp-field.js +10 -11
- package/dist/page-header.js +3 -4
- package/dist/pagination.d.ts +11 -8
- package/dist/pagination.js +4 -5
- package/dist/panel.d.ts +3 -1
- package/dist/panel.js +5 -6
- package/dist/parts.d.ts +5 -7
- package/dist/parts.js +8 -16
- package/dist/popover.d.ts +20 -12
- package/dist/popover.js +3 -3
- package/dist/preview-card.d.ts +22 -10
- package/dist/preview-card.js +7 -8
- package/dist/progress.d.ts +46 -26
- package/dist/progress.js +5 -5
- package/dist/radio-group.d.ts +16 -8
- package/dist/radio-group.js +5 -5
- package/dist/scroll-area.d.ts +4 -2
- package/dist/scroll-area.js +6 -6
- package/dist/select.d.ts +3 -1
- package/dist/select.js +5 -5
- package/dist/separator.d.ts +5 -2
- package/dist/separator.js +3 -4
- package/dist/sheet.d.ts +12 -4
- package/dist/sheet.js +5 -5
- package/dist/size.d.ts +7 -0
- package/dist/size.js +9 -0
- package/dist/sizing.d.ts +8 -3
- package/dist/sizing.js +8 -10
- package/dist/skeleton.d.ts +3 -3
- package/dist/skeleton.js +4 -6
- package/dist/slider.d.ts +55 -31
- package/dist/slider.js +7 -7
- package/dist/sparkline.d.ts +5 -20
- package/dist/sparkline.js +5 -7
- package/dist/spinner.d.ts +4 -6
- package/dist/spinner.js +7 -8
- package/dist/stat.d.ts +34 -42
- package/dist/stat.js +9 -10
- package/dist/status.js +0 -1
- package/dist/switch.d.ts +17 -8
- package/dist/switch.js +4 -5
- package/dist/syntax-engine.js +9 -1
- package/dist/syntax-highlighter.d.ts +3 -7
- package/dist/syntax-highlighter.js +4 -4
- package/dist/syntax-highlighting.js +2 -2
- package/dist/table.d.ts +111 -75
- package/dist/table.js +32 -33
- package/dist/tabs.d.ts +46 -26
- package/dist/tabs.js +5 -5
- package/dist/textarea.d.ts +4 -2
- package/dist/textarea.js +3 -4
- package/dist/toast.d.ts +76 -42
- package/dist/toast.js +28 -28
- package/dist/toggle-group.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tone-transition.d.ts +1 -1
- package/dist/tone-transition.js +9 -8
- package/dist/toolbar.d.ts +55 -31
- package/dist/toolbar.js +6 -6
- package/dist/tooltip.d.ts +4 -1
- package/dist/tooltip.js +2 -2
- package/dist/tree.d.ts +12 -1
- package/dist/tree.js +13 -9
- package/dist/typography.d.ts +3 -1
- package/dist/typography.js +6 -8
- package/package.json +6 -5
package/dist/table.d.ts
CHANGED
|
@@ -1,116 +1,152 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
rootClassName?: string;
|
|
5
|
-
rootStyle?: React.CSSProperties;
|
|
6
|
-
orientation?: "horizontal" | "vertical" | "both";
|
|
7
|
-
scrollChain?: "auto" | "contain";
|
|
8
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
2
|
+
import { ScrollArea } from './scroll-area.js';
|
|
3
|
+
declare const TableContainer: ({ bleed, rootClassName, ref, ...props }: React.ComponentPropsWithoutRef<typeof ScrollArea> & {
|
|
9
4
|
label: string;
|
|
10
5
|
/** Hangs the table into the gutter by its cell inset, so cell text lines up with
|
|
11
6
|
* the text around it and a row's hover reaches past it evenly on both sides. */
|
|
12
7
|
bleed?: boolean;
|
|
13
|
-
} &
|
|
8
|
+
} & {
|
|
9
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
declare const RootPart: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref">, "size"> & {
|
|
12
|
+
size?: import("./size.js").ComponentSize;
|
|
13
|
+
ref?: React.Ref<HTMLTableElement> | undefined;
|
|
14
|
+
}) => React.JSX.Element;
|
|
14
15
|
export type TableDensity = 'default' | 'compact';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} & React.RefAttributes<HTMLTableElement>, "ref"> & {
|
|
16
|
+
export type TableVariant = 'plain' | 'lined' | 'grid' | 'striped';
|
|
17
|
+
declare const TableRoot: ({ density, variant, stickyHeader, ref, ...props }: React.ComponentPropsWithoutRef<typeof RootPart> & {
|
|
18
18
|
/** compact tightens rows for scanning many records with a pointer. */
|
|
19
19
|
density?: TableDensity;
|
|
20
|
+
/**
|
|
21
|
+
* plain separates rows by space; lined draws lines between rows, grid between
|
|
22
|
+
* rows and columns, both inside the table only; striped tones every other row.
|
|
23
|
+
*/
|
|
24
|
+
variant?: TableVariant;
|
|
20
25
|
/** Keeps the header visible while a bounded Container scrolls vertically. */
|
|
21
26
|
stickyHeader?: boolean;
|
|
22
|
-
} &
|
|
27
|
+
} & {
|
|
28
|
+
ref?: React.Ref<HTMLTableElement>;
|
|
29
|
+
}) => React.JSX.Element;
|
|
23
30
|
type CellLayout = {
|
|
24
31
|
align?: 'start' | 'center' | 'end';
|
|
25
32
|
/** Aligns to the end with tabular figures, so digits line up down the column. */
|
|
26
33
|
numeric?: boolean;
|
|
27
34
|
};
|
|
28
|
-
declare const
|
|
29
|
-
size?: import("./
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
declare const HeaderCellPart: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref">, "size"> & {
|
|
36
|
+
size?: import("./size.js").ComponentSize;
|
|
37
|
+
ref?: React.Ref<HTMLTableCellElement> | undefined;
|
|
38
|
+
}) => React.JSX.Element;
|
|
39
|
+
declare const CellPart: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref">, "size"> & {
|
|
40
|
+
size?: import("./size.js").ComponentSize;
|
|
41
|
+
ref?: React.Ref<HTMLTableCellElement> | undefined;
|
|
42
|
+
}) => React.JSX.Element;
|
|
43
|
+
declare const TableHeaderCell: ({ align, numeric, ref, ...props }: Omit<React.ComponentPropsWithoutRef<typeof HeaderCellPart>, "align"> & CellLayout & {
|
|
44
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
45
|
+
}) => React.JSX.Element;
|
|
46
|
+
declare const TableCell: ({ align, numeric, ref, ...props }: Omit<React.ComponentPropsWithoutRef<typeof CellPart>, "align"> & CellLayout & {
|
|
47
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
48
|
+
}) => React.JSX.Element;
|
|
34
49
|
export type TableSort = 'ascending' | 'descending';
|
|
35
50
|
/** A column header whose button sorts the column. aria-sort names the order on the sorted column only. */
|
|
36
|
-
declare const TableSortHeader:
|
|
37
|
-
size?: import("./sizing.js").ComponentSize;
|
|
38
|
-
} & React.RefAttributes<HTMLTableCellElement>, "ref">, "align"> & CellLayout & React.RefAttributes<HTMLTableCellElement>, "ref">, "scope" | "aria-sort" | "onClick"> & {
|
|
51
|
+
declare const TableSortHeader: ({ sort, onSort, disabled, children, className, ref, ...props }: Omit<React.ComponentPropsWithoutRef<typeof TableHeaderCell>, "scope" | "aria-sort" | "onClick"> & {
|
|
39
52
|
sort?: TableSort;
|
|
40
53
|
onSort: () => void;
|
|
41
54
|
disabled?: boolean;
|
|
42
|
-
} &
|
|
55
|
+
} & {
|
|
56
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
57
|
+
}) => React.JSX.Element;
|
|
43
58
|
/** One-line text that ends in an ellipsis. String content also becomes the title. */
|
|
44
|
-
declare const TableTruncate: React.
|
|
59
|
+
declare const TableTruncate: ({ className, title, children, ref, ...props }: React.ComponentPropsWithoutRef<"span"> & {
|
|
60
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
61
|
+
}) => React.JSX.Element;
|
|
45
62
|
/** A full-width body row for loading, empty, error and permission messages. It has no hover. */
|
|
46
|
-
declare const TableMessage: React.
|
|
63
|
+
declare const TableMessage: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"td"> & {
|
|
47
64
|
colSpan: number;
|
|
48
|
-
} &
|
|
49
|
-
|
|
65
|
+
} & {
|
|
66
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
67
|
+
}) => React.JSX.Element;
|
|
68
|
+
declare const TableRow: ({ selected, className, ref, ...props }: React.ComponentPropsWithoutRef<"tr"> & {
|
|
50
69
|
selected?: boolean;
|
|
51
|
-
} &
|
|
70
|
+
} & {
|
|
71
|
+
ref?: React.Ref<HTMLTableRowElement>;
|
|
72
|
+
}) => React.JSX.Element;
|
|
52
73
|
export declare const Table: {
|
|
53
|
-
Container: React.
|
|
54
|
-
label?: string;
|
|
55
|
-
rootClassName?: string;
|
|
56
|
-
rootStyle?: React.CSSProperties;
|
|
57
|
-
orientation?: "horizontal" | "vertical" | "both";
|
|
58
|
-
scrollChain?: "auto" | "contain";
|
|
59
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
74
|
+
Container: ({ bleed, rootClassName, ref, ...props }: React.ComponentPropsWithoutRef<typeof ScrollArea> & {
|
|
60
75
|
label: string;
|
|
61
76
|
/** Hangs the table into the gutter by its cell inset, so cell text lines up with
|
|
62
77
|
* the text around it and a row's hover reaches past it evenly on both sides. */
|
|
63
78
|
bleed?: boolean;
|
|
64
|
-
} &
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
79
|
+
} & {
|
|
80
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
81
|
+
}) => React.JSX.Element;
|
|
82
|
+
Root: ({ density, variant, stickyHeader, ref, ...props }: React.ComponentPropsWithoutRef<typeof RootPart> & {
|
|
68
83
|
/** compact tightens rows for scanning many records with a pointer. */
|
|
69
84
|
density?: TableDensity;
|
|
85
|
+
/**
|
|
86
|
+
* plain separates rows by space; lined draws lines between rows, grid between
|
|
87
|
+
* rows and columns, both inside the table only; striped tones every other row.
|
|
88
|
+
*/
|
|
89
|
+
variant?: TableVariant;
|
|
70
90
|
/** Keeps the header visible while a bounded Container scrolls vertically. */
|
|
71
91
|
stickyHeader?: boolean;
|
|
72
|
-
} &
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
size?: import("./
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
} & {
|
|
93
|
+
ref?: React.Ref<HTMLTableElement>;
|
|
94
|
+
}) => React.JSX.Element;
|
|
95
|
+
Caption: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "size"> & {
|
|
96
|
+
size?: import("./size.js").ComponentSize;
|
|
97
|
+
ref?: React.Ref<HTMLTableCaptionElement> | undefined;
|
|
98
|
+
}) => React.JSX.Element;
|
|
99
|
+
Head: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
|
|
100
|
+
size?: import("./size.js").ComponentSize;
|
|
101
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
102
|
+
}) => React.JSX.Element;
|
|
103
|
+
Body: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
|
|
104
|
+
size?: import("./size.js").ComponentSize;
|
|
105
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
106
|
+
}) => React.JSX.Element;
|
|
107
|
+
Foot: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
|
|
108
|
+
size?: import("./size.js").ComponentSize;
|
|
109
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
110
|
+
}) => React.JSX.Element;
|
|
111
|
+
Row: ({ selected, className, ref, ...props }: React.ComponentPropsWithoutRef<"tr"> & {
|
|
86
112
|
selected?: boolean;
|
|
87
|
-
} &
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
} & {
|
|
114
|
+
ref?: React.Ref<HTMLTableRowElement>;
|
|
115
|
+
}) => React.JSX.Element;
|
|
116
|
+
HeaderCell: ({ align, numeric, ref, ...props }: Omit<React.ComponentPropsWithoutRef<typeof HeaderCellPart>, "align"> & CellLayout & {
|
|
117
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
118
|
+
}) => React.JSX.Element;
|
|
119
|
+
SortHeader: ({ sort, onSort, disabled, children, className, ref, ...props }: Omit<React.ComponentPropsWithoutRef<typeof TableHeaderCell>, "scope" | "aria-sort" | "onClick"> & {
|
|
94
120
|
sort?: TableSort;
|
|
95
121
|
onSort: () => void;
|
|
96
122
|
disabled?: boolean;
|
|
97
|
-
} &
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
123
|
+
} & {
|
|
124
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
125
|
+
}) => React.JSX.Element;
|
|
126
|
+
Cell: ({ align, numeric, ref, ...props }: Omit<React.ComponentPropsWithoutRef<typeof CellPart>, "align"> & CellLayout & {
|
|
127
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
128
|
+
}) => React.JSX.Element;
|
|
129
|
+
Truncate: ({ className, title, children, ref, ...props }: React.ComponentPropsWithoutRef<"span"> & {
|
|
130
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
131
|
+
}) => React.JSX.Element;
|
|
132
|
+
Message: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"td"> & {
|
|
103
133
|
colSpan: number;
|
|
104
|
-
} &
|
|
134
|
+
} & {
|
|
135
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
136
|
+
}) => React.JSX.Element;
|
|
105
137
|
};
|
|
106
138
|
export { TableContainer, TableRoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, };
|
|
107
|
-
export declare const TableCaption:
|
|
108
|
-
size?: import("./
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
size?: import("./
|
|
115
|
-
|
|
139
|
+
export declare const TableCaption: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "size"> & {
|
|
140
|
+
size?: import("./size.js").ComponentSize;
|
|
141
|
+
ref?: React.Ref<HTMLTableCaptionElement> | undefined;
|
|
142
|
+
}) => React.JSX.Element, TableHead: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
|
|
143
|
+
size?: import("./size.js").ComponentSize;
|
|
144
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
145
|
+
}) => React.JSX.Element, TableBody: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
|
|
146
|
+
size?: import("./size.js").ComponentSize;
|
|
147
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
148
|
+
}) => React.JSX.Element, TableFoot: ({ className, size, ref, ...rest }: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref">, "size"> & {
|
|
149
|
+
size?: import("./size.js").ComponentSize;
|
|
150
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
151
|
+
}) => React.JSX.Element;
|
|
116
152
|
export { useTableSelection, type TableSelectionOptions, type TableSelectionCheckbox, } from './table-selection.js';
|
package/dist/table.js
CHANGED
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
2
|
import { Icon } from './icon.js';
|
|
5
3
|
import { Button } from './button.js';
|
|
6
|
-
import {
|
|
4
|
+
import { cx } from './class-names.js';
|
|
5
|
+
import { elementPart } from './element-part.js';
|
|
7
6
|
import { ScrollArea } from './scroll-area.js';
|
|
8
|
-
const TableContainer =
|
|
9
|
-
return (_jsx(ScrollArea, { ...props, ref: ref, rootClassName: cx(bleed && '
|
|
10
|
-
}
|
|
11
|
-
const RootPart = /* @__PURE__ */
|
|
12
|
-
const TableRoot =
|
|
13
|
-
return (_jsx(RootPart, { ...props, ref: ref, "data-density": density === 'compact' ? 'compact' : undefined, "data-sticky-header": stickyHeader || undefined }));
|
|
14
|
-
}
|
|
7
|
+
const TableContainer = function TableContainer({ bleed, rootClassName, ref, ...props }) {
|
|
8
|
+
return (_jsx(ScrollArea, { ...props, ref: ref, rootClassName: cx(bleed && 'surf-table-bleed', rootClassName) }));
|
|
9
|
+
};
|
|
10
|
+
const RootPart = /* @__PURE__ */ elementPart('table', 'surf-table');
|
|
11
|
+
const TableRoot = function TableRoot({ density, variant, stickyHeader, ref, ...props }) {
|
|
12
|
+
return (_jsx(RootPart, { ...props, ref: ref, "data-density": density === 'compact' ? 'compact' : undefined, "data-variant": variant && variant !== 'plain' ? variant : undefined, "data-sticky-header": stickyHeader || undefined }));
|
|
13
|
+
};
|
|
15
14
|
const layout = ({ align, numeric }) => ({
|
|
16
15
|
'data-align': numeric ? 'end' : align,
|
|
17
16
|
'data-numeric': numeric || undefined,
|
|
18
17
|
});
|
|
19
|
-
const HeaderCellPart = /* @__PURE__ */
|
|
20
|
-
const CellPart = /* @__PURE__ */
|
|
18
|
+
const HeaderCellPart = /* @__PURE__ */ elementPart('th', 'surf-table-cell surf-table-header');
|
|
19
|
+
const CellPart = /* @__PURE__ */ elementPart('td', 'surf-table-cell');
|
|
21
20
|
// align replaces the obsolete HTML align attribute of th and td.
|
|
22
|
-
const TableHeaderCell =
|
|
21
|
+
const TableHeaderCell = function TableHeaderCell({ align, numeric, ref, ...props }) {
|
|
23
22
|
return _jsx(HeaderCellPart, { ...props, ...layout({ align, numeric }), ref: ref });
|
|
24
|
-
}
|
|
25
|
-
const TableCell =
|
|
23
|
+
};
|
|
24
|
+
const TableCell = function TableCell({ align, numeric, ref, ...props }) {
|
|
26
25
|
return _jsx(CellPart, { ...props, ...layout({ align, numeric }), ref: ref });
|
|
27
|
-
}
|
|
26
|
+
};
|
|
28
27
|
function SortIcon({ sort }) {
|
|
29
28
|
return (_jsx(Icon, { name: sort === 'ascending'
|
|
30
29
|
? 'arrow-up'
|
|
31
30
|
: sort === 'descending'
|
|
32
31
|
? 'arrow-down'
|
|
33
|
-
: 'sort', className: '
|
|
32
|
+
: 'sort', className: 'surf-table-sort-icon' }));
|
|
34
33
|
}
|
|
35
34
|
/** A column header whose button sorts the column. aria-sort names the order on the sorted column only. */
|
|
36
|
-
const TableSortHeader =
|
|
37
|
-
return (_jsx(TableHeaderCell, { ...props, ref: ref, scope: 'col', "aria-sort": sort, className: cx('
|
|
38
|
-
}
|
|
35
|
+
const TableSortHeader = function TableSortHeader({ sort, onSort, disabled, children, className, ref, ...props }) {
|
|
36
|
+
return (_jsx(TableHeaderCell, { ...props, ref: ref, scope: 'col', "aria-sort": sort, className: cx('surf-table-sort-header', className), children: _jsxs(Button, { variant: 'ghost', className: 'surf-table-sort', "data-sort": sort, disabled: disabled, onClick: onSort, children: [_jsx("span", { children: children }), _jsx(SortIcon, { sort: sort })] }) }));
|
|
37
|
+
};
|
|
39
38
|
/** One-line text that ends in an ellipsis. String content also becomes the title. */
|
|
40
|
-
const TableTruncate =
|
|
41
|
-
return (_jsx("span", { ...props, ref: ref, title: title ?? (typeof children === 'string' ? children : undefined), className: cx('
|
|
42
|
-
}
|
|
39
|
+
const TableTruncate = function TableTruncate({ className, title, children, ref, ...props }) {
|
|
40
|
+
return (_jsx("span", { ...props, ref: ref, title: title ?? (typeof children === 'string' ? children : undefined), className: cx('surf-table-truncate', className), children: children }));
|
|
41
|
+
};
|
|
43
42
|
/** A full-width body row for loading, empty, error and permission messages. It has no hover. */
|
|
44
|
-
const TableMessage =
|
|
45
|
-
return (_jsx("tr", { className: '
|
|
46
|
-
}
|
|
47
|
-
const TableRow =
|
|
48
|
-
return (_jsx("tr", { ...props, ref: ref, "data-selected": selected || undefined, className: cx('
|
|
49
|
-
}
|
|
43
|
+
const TableMessage = function TableMessage({ className, ref, ...props }) {
|
|
44
|
+
return (_jsx("tr", { className: 'surf-table-row surf-table-message-row', children: _jsx("td", { ...props, ref: ref, className: cx('surf-table-cell surf-table-message', className) }) }));
|
|
45
|
+
};
|
|
46
|
+
const TableRow = function TableRow({ selected, className, ref, ...props }) {
|
|
47
|
+
return (_jsx("tr", { ...props, ref: ref, "data-selected": selected || undefined, className: cx('surf-table-row', className) }));
|
|
48
|
+
};
|
|
50
49
|
export const Table = {
|
|
51
50
|
Container: TableContainer,
|
|
52
51
|
Root: TableRoot,
|
|
53
|
-
Caption: /* @__PURE__ */
|
|
54
|
-
Head: /* @__PURE__ */
|
|
55
|
-
Body: /* @__PURE__ */
|
|
56
|
-
Foot: /* @__PURE__ */
|
|
52
|
+
Caption: /* @__PURE__ */ elementPart('caption', 'surf-table-caption'),
|
|
53
|
+
Head: /* @__PURE__ */ elementPart('thead', 'surf-table-head'),
|
|
54
|
+
Body: /* @__PURE__ */ elementPart('tbody', 'surf-table-body'),
|
|
55
|
+
Foot: /* @__PURE__ */ elementPart('tfoot', 'surf-table-foot'),
|
|
57
56
|
Row: TableRow,
|
|
58
57
|
HeaderCell: TableHeaderCell,
|
|
59
58
|
SortHeader: TableSortHeader,
|
package/dist/tabs.d.ts
CHANGED
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const Tabs: {
|
|
3
|
-
Root:
|
|
4
|
-
size?: import("./
|
|
5
|
-
} &
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} & React.RefAttributes<HTMLDivElement
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
3
|
+
Root: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
4
|
+
size?: import("./size.js").ComponentSize;
|
|
5
|
+
} & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
List: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsListProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
9
|
+
size?: import("./size.js").ComponentSize;
|
|
10
|
+
} & {
|
|
11
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
12
|
+
}) => React.JSX.Element;
|
|
13
|
+
Tab: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsTabProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
14
|
+
size?: import("./size.js").ComponentSize;
|
|
15
|
+
} & {
|
|
16
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
17
|
+
}) => React.JSX.Element;
|
|
18
|
+
Panel: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
19
|
+
size?: import("./size.js").ComponentSize;
|
|
20
|
+
} & {
|
|
21
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
|
+
Indicator: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsIndicatorProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
|
|
24
|
+
size?: import("./size.js").ComponentSize;
|
|
25
|
+
} & {
|
|
26
|
+
ref?: React.Ref<HTMLSpanElement> | undefined;
|
|
27
|
+
}) => React.JSX.Element;
|
|
18
28
|
};
|
|
19
|
-
export declare const TabsIndicator:
|
|
20
|
-
size?: import("./
|
|
21
|
-
} &
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
size?: import("./
|
|
25
|
-
} &
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
size?: import("./
|
|
29
|
-
} &
|
|
29
|
+
export declare const TabsIndicator: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsIndicatorProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref">, "size"> & {
|
|
30
|
+
size?: import("./size.js").ComponentSize;
|
|
31
|
+
} & {
|
|
32
|
+
ref?: React.Ref<HTMLSpanElement> | undefined;
|
|
33
|
+
}) => React.JSX.Element, TabsList: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsListProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
34
|
+
size?: import("./size.js").ComponentSize;
|
|
35
|
+
} & {
|
|
36
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
37
|
+
}) => React.JSX.Element, TabsPanel: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
38
|
+
size?: import("./size.js").ComponentSize;
|
|
39
|
+
} & {
|
|
40
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
41
|
+
}) => React.JSX.Element, TabsRoot: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
42
|
+
size?: import("./size.js").ComponentSize;
|
|
43
|
+
} & {
|
|
44
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
45
|
+
}) => React.JSX.Element, TabsTab: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/tabs").TabsTabProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
46
|
+
size?: import("./size.js").ComponentSize;
|
|
47
|
+
} & {
|
|
48
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
49
|
+
}) => React.JSX.Element;
|
package/dist/tabs.js
CHANGED
|
@@ -3,11 +3,11 @@ import { Tabs as BaseTabs } from '@base-ui/react/tabs';
|
|
|
3
3
|
import { part } from './parts.js';
|
|
4
4
|
export const Tabs = {
|
|
5
5
|
...BaseTabs,
|
|
6
|
-
Root: /* @__PURE__ */ part(BaseTabs.Root, '
|
|
7
|
-
List: /* @__PURE__ */ part(BaseTabs.List, '
|
|
8
|
-
Tab: /* @__PURE__ */ part(BaseTabs.Tab, '
|
|
9
|
-
Panel: /* @__PURE__ */ part(BaseTabs.Panel, '
|
|
10
|
-
Indicator: /* @__PURE__ */ part(BaseTabs.Indicator, '
|
|
6
|
+
Root: /* @__PURE__ */ part(BaseTabs.Root, 'surf-tabs'),
|
|
7
|
+
List: /* @__PURE__ */ part(BaseTabs.List, 'surf-tabs-list'),
|
|
8
|
+
Tab: /* @__PURE__ */ part(BaseTabs.Tab, 'surf-tabs-tab'),
|
|
9
|
+
Panel: /* @__PURE__ */ part(BaseTabs.Panel, 'surf-tabs-panel'),
|
|
10
|
+
Indicator: /* @__PURE__ */ part(BaseTabs.Indicator, 'surf-tabs-indicator'),
|
|
11
11
|
};
|
|
12
12
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
13
13
|
export const { Indicator: TabsIndicator, List: TabsList, Panel: TabsPanel, Root: TabsRoot, Tab: TabsTab, } = Tabs;
|
package/dist/textarea.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { type ComponentSizeAlias } from './sizing.js';
|
|
3
3
|
/** A multi-line text field. Inside Field.Root it takes the label, description and
|
|
4
4
|
* error from the field, as Input does. */
|
|
5
|
-
export declare const Textarea: React.
|
|
5
|
+
export declare const Textarea: ({ className, size, rows, cols, wrap, ref, ...props }: React.ComponentPropsWithoutRef<"textarea"> & {
|
|
6
6
|
size?: ComponentSizeAlias;
|
|
7
|
-
} &
|
|
7
|
+
} & {
|
|
8
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
9
|
+
}) => React.JSX.Element;
|
package/dist/textarea.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { useComponentSize } from './sizing.js';
|
|
5
4
|
import { Field as BaseField } from '@base-ui/react/field';
|
|
6
5
|
import { cx } from './parts.js';
|
|
7
6
|
/** A multi-line text field. Inside Field.Root it takes the label, description and
|
|
8
7
|
* error from the field, as Input does. */
|
|
9
|
-
export const Textarea =
|
|
8
|
+
export const Textarea = function Textarea({ className, size, rows, cols, wrap, ref, ...props }) {
|
|
10
9
|
const scheme = useComponentSize(size);
|
|
11
|
-
return (_jsx(BaseField.Control, { ...props, ref: ref, "data-ui-size": scheme, render: _jsx("textarea", { rows: rows, cols: cols, wrap: wrap }), className: cx('
|
|
12
|
-
}
|
|
10
|
+
return (_jsx(BaseField.Control, { ...props, ref: ref, "data-ui-size": scheme, render: _jsx("textarea", { rows: rows, cols: cols, wrap: wrap }), className: cx('surf-input surf-textarea', className) }));
|
|
11
|
+
};
|