@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/empty-state.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { cx } from './class-names.js';
|
|
3
|
+
import { elementPart } from './element-part.js';
|
|
4
|
+
const EmptyTitle = function EmptyTitle({ level = 3, className, ref, ...props }) {
|
|
5
5
|
return React.createElement(`h${level}`, {
|
|
6
6
|
...props,
|
|
7
7
|
ref,
|
|
8
|
-
className: cx('
|
|
8
|
+
className: cx('surf-empty-title', className),
|
|
9
9
|
});
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
export const EmptyState = {
|
|
12
|
-
Root: /* @__PURE__ */
|
|
13
|
-
Icon: /* @__PURE__ */
|
|
12
|
+
Root: /* @__PURE__ */ elementPart('div', 'surf-empty'),
|
|
13
|
+
Icon: /* @__PURE__ */ elementPart('div', 'surf-empty-icon'),
|
|
14
14
|
Title: EmptyTitle,
|
|
15
|
-
Description: /* @__PURE__ */
|
|
16
|
-
Actions: /* @__PURE__ */
|
|
15
|
+
Description: /* @__PURE__ */ elementPart('p', 'surf-empty-description'),
|
|
16
|
+
Actions: /* @__PURE__ */ elementPart('div', 'surf-empty-actions'),
|
|
17
17
|
};
|
|
18
18
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
19
19
|
export const { Root: EmptyStateRoot, Icon: EmptyStateIcon, Title: EmptyStateTitle, Description: EmptyStateDescription, Actions: EmptyStateActions, } = EmptyState;
|
package/dist/field.d.ts
CHANGED
|
@@ -1,41 +1,65 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const FieldRoot:
|
|
3
|
-
size?: import("./
|
|
4
|
-
} &
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} & React.RefAttributes<HTMLElement
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
declare const
|
|
18
|
-
size?: import("./
|
|
19
|
-
} &
|
|
2
|
+
declare const FieldRoot: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
3
|
+
size?: import("./size.js").ComponentSize;
|
|
4
|
+
} & {
|
|
5
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
declare const FieldLabel: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldLabelProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
8
|
+
size?: import("./size.js").ComponentSize;
|
|
9
|
+
} & {
|
|
10
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
declare const FieldControl: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldControlProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
13
|
+
size?: import("./size.js").ComponentSize;
|
|
14
|
+
} & {
|
|
15
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
16
|
+
}) => React.JSX.Element;
|
|
17
|
+
declare const FieldDescription: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref">, "size"> & {
|
|
18
|
+
size?: import("./size.js").ComponentSize;
|
|
19
|
+
} & {
|
|
20
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
21
|
+
}) => React.JSX.Element;
|
|
22
|
+
declare const FieldError: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldErrorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
23
|
+
size?: import("./size.js").ComponentSize;
|
|
24
|
+
} & {
|
|
25
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
26
|
+
}) => React.JSX.Element;
|
|
27
|
+
declare const FieldItem: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
28
|
+
size?: import("./size.js").ComponentSize;
|
|
29
|
+
} & {
|
|
30
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
31
|
+
}) => React.JSX.Element;
|
|
20
32
|
export declare const Field: {
|
|
21
|
-
Root:
|
|
22
|
-
size?: import("./
|
|
23
|
-
} &
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} & React.RefAttributes<HTMLElement
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
size?: import("./
|
|
38
|
-
} &
|
|
33
|
+
Root: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
34
|
+
size?: import("./size.js").ComponentSize;
|
|
35
|
+
} & {
|
|
36
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
37
|
+
}) => React.JSX.Element;
|
|
38
|
+
Label: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldLabelProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
39
|
+
size?: import("./size.js").ComponentSize;
|
|
40
|
+
} & {
|
|
41
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
42
|
+
}) => React.JSX.Element;
|
|
43
|
+
Control: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldControlProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
44
|
+
size?: import("./size.js").ComponentSize;
|
|
45
|
+
} & {
|
|
46
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
47
|
+
}) => React.JSX.Element;
|
|
48
|
+
Description: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref">, "size"> & {
|
|
49
|
+
size?: import("./size.js").ComponentSize;
|
|
50
|
+
} & {
|
|
51
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
52
|
+
}) => React.JSX.Element;
|
|
53
|
+
Error: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldErrorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
54
|
+
size?: import("./size.js").ComponentSize;
|
|
55
|
+
} & {
|
|
56
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
57
|
+
}) => React.JSX.Element;
|
|
58
|
+
Item: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/field").FieldItemProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
59
|
+
size?: import("./size.js").ComponentSize;
|
|
60
|
+
} & {
|
|
61
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
62
|
+
}) => React.JSX.Element;
|
|
39
63
|
Validity: React.FC<import("@base-ui/react/field").FieldValidityProps>;
|
|
40
64
|
};
|
|
41
65
|
export { FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldRoot, };
|
package/dist/field.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Field as BaseField } from '@base-ui/react/field';
|
|
3
3
|
import { part } from './parts.js';
|
|
4
|
-
const FieldRoot = /* @__PURE__ */ part(BaseField.Root, '
|
|
5
|
-
const FieldLabel = /* @__PURE__ */ part(BaseField.Label, '
|
|
6
|
-
const FieldControl = /* @__PURE__ */ part(BaseField.Control, '
|
|
7
|
-
const FieldDescription = /* @__PURE__ */ part(BaseField.Description, '
|
|
8
|
-
const FieldError = /* @__PURE__ */ part(BaseField.Error, '
|
|
9
|
-
const FieldItem = /* @__PURE__ */ part(BaseField.Item, '
|
|
4
|
+
const FieldRoot = /* @__PURE__ */ part(BaseField.Root, 'surf-field');
|
|
5
|
+
const FieldLabel = /* @__PURE__ */ part(BaseField.Label, 'surf-field-label');
|
|
6
|
+
const FieldControl = /* @__PURE__ */ part(BaseField.Control, 'surf-input');
|
|
7
|
+
const FieldDescription = /* @__PURE__ */ part(BaseField.Description, 'surf-field-description');
|
|
8
|
+
const FieldError = /* @__PURE__ */ part(BaseField.Error, 'surf-field-error');
|
|
9
|
+
const FieldItem = /* @__PURE__ */ part(BaseField.Item, 'surf-field-item');
|
|
10
10
|
export const Field = {
|
|
11
11
|
...BaseField,
|
|
12
12
|
Root: FieldRoot,
|
package/dist/fieldset.d.ts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const Fieldset: {
|
|
3
|
-
Root:
|
|
4
|
-
size?: import("./
|
|
5
|
-
} &
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} & React.RefAttributes<HTMLDivElement
|
|
3
|
+
Root: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetRootProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
4
|
+
size?: import("./size.js").ComponentSize;
|
|
5
|
+
} & {
|
|
6
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
Legend: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetLegendProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
9
|
+
size?: import("./size.js").ComponentSize;
|
|
10
|
+
} & {
|
|
11
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
12
|
+
}) => React.JSX.Element;
|
|
9
13
|
};
|
|
10
|
-
export declare const FieldsetLegend:
|
|
11
|
-
size?: import("./
|
|
12
|
-
} &
|
|
13
|
-
|
|
14
|
-
} & React.RefAttributes<HTMLElement
|
|
14
|
+
export declare const FieldsetLegend: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetLegendProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "size"> & {
|
|
15
|
+
size?: import("./size.js").ComponentSize;
|
|
16
|
+
} & {
|
|
17
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
18
|
+
}) => React.JSX.Element, FieldsetRoot: ({ ref, ...props }: Omit<Omit<Omit<import("@base-ui/react/fieldset").FieldsetRootProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "size"> & {
|
|
19
|
+
size?: import("./size.js").ComponentSize;
|
|
20
|
+
} & {
|
|
21
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
22
|
+
}) => React.JSX.Element;
|
package/dist/fieldset.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Fieldset as BaseFieldset } from '@base-ui/react/fieldset';
|
|
|
3
3
|
import { part } from './parts.js';
|
|
4
4
|
export const Fieldset = {
|
|
5
5
|
...BaseFieldset,
|
|
6
|
-
Root: /* @__PURE__ */ part(BaseFieldset.Root, '
|
|
7
|
-
Legend: /* @__PURE__ */ part(BaseFieldset.Legend, '
|
|
6
|
+
Root: /* @__PURE__ */ part(BaseFieldset.Root, 'surf-fieldset'),
|
|
7
|
+
Legend: /* @__PURE__ */ part(BaseFieldset.Legend, 'surf-fieldset-legend'),
|
|
8
8
|
};
|
|
9
9
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
10
10
|
export const { Legend: FieldsetLegend, Root: FieldsetRoot } = Fieldset;
|
package/dist/file-upload.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export type FileUploadLabels = {
|
|
|
31
31
|
progress: (file: File) => string;
|
|
32
32
|
/** Shown when an upload fails and getUploadError gives no message. */
|
|
33
33
|
uploadError: string;
|
|
34
|
+
/** A file's size, as the list shows it. */
|
|
35
|
+
size: (bytes: number) => string;
|
|
36
|
+
/** A file's action button name, given the action's text and the file, so a
|
|
37
|
+
* language can put the file name first. */
|
|
38
|
+
fileAction: (action: string, file: File) => string;
|
|
34
39
|
};
|
|
35
40
|
export type FileUploadProps = Omit<React.ComponentPropsWithoutRef<typeof Field.Root>, 'children' | 'name' | 'onDragEnter' | 'onDragLeave' | 'onDragOver' | 'onDrop'> & Pick<React.HTMLAttributes<HTMLDivElement>, 'onDragEnter' | 'onDragLeave' | 'onDragOver' | 'onDrop'> & {
|
|
36
41
|
label: React.ReactNode;
|
|
@@ -54,26 +59,6 @@ export type FileUploadProps = Omit<React.ComponentPropsWithoutRef<typeof Field.R
|
|
|
54
59
|
};
|
|
55
60
|
};
|
|
56
61
|
/** Native selection/validation and a cancellable transport adapter; no network request is built in. */
|
|
57
|
-
export declare const FileUpload:
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
label: React.ReactNode;
|
|
61
|
-
description?: React.ReactNode;
|
|
62
|
-
name?: string;
|
|
63
|
-
form?: string;
|
|
64
|
-
capture?: React.InputHTMLAttributes<HTMLInputElement>["capture"];
|
|
65
|
-
accept?: string;
|
|
66
|
-
multiple?: boolean;
|
|
67
|
-
required?: boolean;
|
|
68
|
-
maxFiles?: number;
|
|
69
|
-
maxFileSize?: number;
|
|
70
|
-
files?: readonly File[];
|
|
71
|
-
defaultFiles?: readonly File[];
|
|
72
|
-
onFilesChange?: (files: File[], details: FileChangeDetails) => void;
|
|
73
|
-
onReject?: (rejections: FileRejection[]) => void;
|
|
74
|
-
transport?: UploadTransport;
|
|
75
|
-
getUploadError?: (error: unknown) => string;
|
|
76
|
-
labels?: Partial<Omit<FileUploadLabels, "status">> & {
|
|
77
|
-
status?: Partial<FileUploadLabels["status"]>;
|
|
78
|
-
};
|
|
79
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
export declare const FileUpload: ({ label, description, name, form, accept, capture, multiple, required, maxFiles, maxFileSize, files: controlled, defaultFiles, onFilesChange, onReject, transport, getUploadError, labels: customLabels, disabled, className, onDragEnter, onDragLeave, onDragOver, onDrop, ref: forwardedRef, ...props }: FileUploadProps & {
|
|
63
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
64
|
+
}) => React.JSX.Element;
|
package/dist/file-upload.js
CHANGED
|
@@ -30,6 +30,11 @@ const labelsDefault = {
|
|
|
30
30
|
reset: 'Files reset.',
|
|
31
31
|
progress: (file) => `${file.name} upload progress`,
|
|
32
32
|
uploadError: 'Upload failed. Try again.',
|
|
33
|
+
size: (bytes) => {
|
|
34
|
+
const unit = bytes >= 1024 * 1024 ? 'MB' : bytes >= 1024 ? 'KB' : 'B';
|
|
35
|
+
return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(bytes / (unit === 'MB' ? 1024 * 1024 : unit === 'KB' ? 1024 : 1))} ${unit}`;
|
|
36
|
+
},
|
|
37
|
+
fileAction: (action, file) => `${action} ${file.name}`,
|
|
33
38
|
};
|
|
34
39
|
function signature(file) {
|
|
35
40
|
return JSON.stringify([file.name, file.size, file.type, file.lastModified]);
|
|
@@ -46,14 +51,12 @@ function accepts(file, accept) {
|
|
|
46
51
|
? file.type.toLowerCase().startsWith(rule.slice(0, -1))
|
|
47
52
|
: file.type.toLowerCase() === rule));
|
|
48
53
|
}
|
|
49
|
-
function sizeLabel(bytes) {
|
|
50
|
-
const unit = bytes >= 1024 * 1024 ? 'MB' : bytes >= 1024 ? 'KB' : 'B';
|
|
51
|
-
return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(bytes / (unit === 'MB' ? 1024 * 1024 : unit === 'KB' ? 1024 : 1))} ${unit}`;
|
|
52
|
-
}
|
|
53
54
|
/** Native selection/validation and a cancellable transport adapter; no network request is built in. */
|
|
54
|
-
export const FileUpload =
|
|
55
|
+
export const FileUpload = 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, ref: forwardedRef, ...props }) {
|
|
55
56
|
const labels = {
|
|
56
57
|
...labelsDefault,
|
|
58
|
+
// A field that takes one file says so.
|
|
59
|
+
...(!multiple && { choose: 'Choose file', drop: 'or drop a file here' }),
|
|
57
60
|
...customLabels,
|
|
58
61
|
status: { ...labelsDefault.status, ...customLabels?.status },
|
|
59
62
|
};
|
|
@@ -270,7 +273,7 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
|
|
|
270
273
|
}
|
|
271
274
|
}
|
|
272
275
|
const hasFiles = (event) => Array.from(event.dataTransfer.types).includes('Files');
|
|
273
|
-
return (_jsxs(Field.Root, { ...props, ref: ref, name: name, disabled: disabled, className: skin('
|
|
276
|
+
return (_jsxs(Field.Root, { ...props, ref: ref, name: name, disabled: disabled, className: skin('surf-file-upload', className), "data-dragging": dragging || undefined, children: [_jsx(Field.Label, { children: label }), description != null && description !== false && (_jsx(Field.Description, { children: description })), _jsxs("div", { className: 'surf-file-dropzone', onDragEnter: (event) => {
|
|
274
277
|
onDragEnter?.(event);
|
|
275
278
|
if (!event.defaultPrevented && hasFiles(event) && !disabled) {
|
|
276
279
|
event.preventDefault();
|
|
@@ -296,7 +299,7 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
|
|
|
296
299
|
event.preventDefault();
|
|
297
300
|
select(Array.from(event.dataTransfer.files), 'drop');
|
|
298
301
|
}
|
|
299
|
-
}, children: [_jsxs("div", { className: '
|
|
302
|
+
}, children: [_jsxs("div", { className: 'surf-file-picker', children: [_jsx(Field.Control, { ref: input, id: inputId, name: name, form: form, type: 'file', accept: accept, capture: capture, multiple: multiple, required: required, disabled: disabled, className: 'surf-file-native', "aria-describedby": errorId, onKeyDown: (event) => {
|
|
300
303
|
if (event.key === 'Enter')
|
|
301
304
|
event.preventBaseUIHandler();
|
|
302
305
|
}, onChange: (event) => {
|
|
@@ -304,7 +307,7 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
|
|
|
304
307
|
event.preventBaseUIHandler();
|
|
305
308
|
select(Array.from(event.currentTarget.files ?? []), 'select');
|
|
306
309
|
}
|
|
307
|
-
} }), _jsxs("label", { htmlFor: inputId, className: '
|
|
310
|
+
} }), _jsxs("label", { htmlFor: inputId, className: 'surf-button surf-file-trigger', "data-variant": 'outline', "data-disabled": disabled || undefined, children: [_jsx(Icon, { name: 'upload' }), labels.choose] }), _jsx("p", { className: 'surf-file-drop-hint', children: labels.drop })] }), files.length > 0 && (_jsx("ul", { className: 'surf-file-list', role: 'list', children: files.map((file) => {
|
|
308
311
|
const state = metadata.get(file) ?? {
|
|
309
312
|
status: 'ready',
|
|
310
313
|
progress: null,
|
|
@@ -312,18 +315,22 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
|
|
|
312
315
|
if (!identities.current.has(file))
|
|
313
316
|
identities.current.set(file, `${uid}-${++nextId.current}`);
|
|
314
317
|
const itemId = identities.current.get(file);
|
|
315
|
-
return (_jsxs("li", { className: '
|
|
318
|
+
return (_jsxs("li", { className: 'surf-file-item', children: [_jsxs("div", { className: 'surf-file-info', children: [_jsx("strong", { children: file.name }), _jsx("span", { children: labels.size(file.size) }), _jsx(StatusBadge, { tone: state.status === 'success'
|
|
316
319
|
? 'success'
|
|
317
320
|
: state.status === 'error'
|
|
318
321
|
? 'danger'
|
|
319
322
|
: state.status === 'uploading'
|
|
320
323
|
? 'progress'
|
|
321
|
-
: 'neutral', children: labels.status[state.status] })] }), _jsxs("div", { className: '
|
|
324
|
+
: 'neutral', children: labels.status[state.status] })] }), _jsxs("div", { className: 'surf-file-actions', children: [transport && state.status !== 'success' && (_jsx(Button, { ref: (node) => {
|
|
322
325
|
if (node)
|
|
323
326
|
primaryButtons.current.set(file, node);
|
|
324
327
|
else
|
|
325
328
|
primaryButtons.current.delete(file);
|
|
326
|
-
}, type: 'button', size: '
|
|
329
|
+
}, type: 'button', size: 'small', variant: 'outline', disabled: disabled, "aria-describedby": state.error ? `${itemId}-error` : undefined, "aria-label": labels.fileAction(state.status === 'uploading'
|
|
330
|
+
? labels.cancel
|
|
331
|
+
: state.status === 'ready'
|
|
332
|
+
? labels.upload
|
|
333
|
+
: labels.retry, file), onClick: () => {
|
|
327
334
|
if (state.status === 'uploading')
|
|
328
335
|
cancel(file);
|
|
329
336
|
else
|
|
@@ -332,15 +339,15 @@ export const FileUpload = /* @__PURE__ */ React.forwardRef(function FileUpload({
|
|
|
332
339
|
? labels.cancel
|
|
333
340
|
: state.status === 'ready'
|
|
334
341
|
? labels.upload
|
|
335
|
-
: labels.retry })), _jsx(Button, { type: 'button', size: '
|
|
342
|
+
: labels.retry })), _jsx(Button, { type: 'button', size: 'small', variant: 'ghost', ref: (node) => {
|
|
336
343
|
if (node)
|
|
337
344
|
removeButtons.current.set(file, node);
|
|
338
345
|
else
|
|
339
346
|
removeButtons.current.delete(file);
|
|
340
|
-
}, disabled: disabled, "aria-label":
|
|
347
|
+
}, disabled: disabled, "aria-label": labels.fileAction(labels.remove, file), onClick: () => {
|
|
341
348
|
setRejections([]);
|
|
342
349
|
if (commit(files.filter((current) => current !== file), 'remove'))
|
|
343
350
|
focusPicker.current = file;
|
|
344
|
-
}, children: labels.remove })] }), state.status === 'uploading' && (_jsx(Progress.Root, { value: state.progress, "aria-label": labels.progress(file), children: _jsx(Progress.Track, { children: _jsx(Progress.Indicator, {}) }) })), state.error && (_jsx("p", { id: `${itemId}-error`, className: '
|
|
345
|
-
}) }))] }), _jsx("div", { id: errorId, role: 'alert', className: '
|
|
346
|
-
}
|
|
351
|
+
}, children: labels.remove })] }), state.status === 'uploading' && (_jsx(Progress.Root, { value: state.progress, "aria-label": labels.progress(file), children: _jsx(Progress.Track, { children: _jsx(Progress.Indicator, {}) }) })), state.error && (_jsx("p", { id: `${itemId}-error`, className: 'surf-file-upload-error', children: state.error }))] }, itemId));
|
|
352
|
+
}) }))] }), _jsx("div", { id: errorId, role: 'alert', className: 'surf-file-errors', children: rejections.length > 0 && (_jsx("ul", { children: rejections.map((rejection, index) => (_jsx("li", { children: labels.rejection(rejection) }, index))) })) }), _jsx(Field.Error, {}), _jsx("span", { className: 'surf-feedback-sr', role: 'status', children: announcement })] }));
|
|
353
|
+
};
|
package/dist/filter-bar.d.ts
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const FilterBar: {
|
|
3
|
-
Root: React.
|
|
3
|
+
Root: ({ label, className, ref, ...props }: React.ComponentPropsWithoutRef<"form"> & {
|
|
4
4
|
label: string;
|
|
5
|
-
} &
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
} & {
|
|
6
|
+
ref?: React.Ref<HTMLFormElement>;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
Controls: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
9
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
Field: ({ width, className, ref, ...props }: React.ComponentPropsWithoutRef<"label"> & {
|
|
8
12
|
width?: "search" | "filter";
|
|
9
|
-
} &
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
} & {
|
|
14
|
+
ref?: React.Ref<HTMLLabelElement>;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
|
+
Actions: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
17
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
|
+
Summary: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
20
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
21
|
+
}) => React.JSX.Element;
|
|
12
22
|
};
|
|
13
|
-
export declare const FilterBarRoot: React.
|
|
23
|
+
export declare const FilterBarRoot: ({ label, className, ref, ...props }: React.ComponentPropsWithoutRef<"form"> & {
|
|
14
24
|
label: string;
|
|
15
|
-
} &
|
|
25
|
+
} & {
|
|
26
|
+
ref?: React.Ref<HTMLFormElement>;
|
|
27
|
+
}) => React.JSX.Element, FilterBarControls: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
28
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
29
|
+
}) => React.JSX.Element, FilterBarField: ({ width, className, ref, ...props }: React.ComponentPropsWithoutRef<"label"> & {
|
|
16
30
|
width?: "search" | "filter";
|
|
17
|
-
} &
|
|
31
|
+
} & {
|
|
32
|
+
ref?: React.Ref<HTMLLabelElement>;
|
|
33
|
+
}) => React.JSX.Element, FilterBarActions: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
34
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
35
|
+
}) => React.JSX.Element, FilterBarSummary: ({ className, ref, ...props }: React.ComponentPropsWithoutRef<"div"> & {
|
|
36
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
37
|
+
}) => React.JSX.Element;
|
package/dist/filter-bar.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { cx } from './parts.js';
|
|
2
|
+
import { cx } from './class-names.js';
|
|
5
3
|
/** Layout only: filtering, routing and async results remain controlled by the caller. */
|
|
6
|
-
const Root =
|
|
7
|
-
return (_jsx("form", { ...props, ref: ref, role: 'search', "aria-label": label, className: cx('
|
|
8
|
-
}
|
|
9
|
-
const Controls =
|
|
10
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
11
|
-
}
|
|
12
|
-
const Field =
|
|
13
|
-
return (_jsx("label", { ...props, ref: ref, "data-width": width, className: cx('
|
|
14
|
-
}
|
|
15
|
-
const Actions =
|
|
16
|
-
return (_jsx("div", { ...props, ref: ref, className: cx('
|
|
17
|
-
}
|
|
18
|
-
const Summary =
|
|
19
|
-
return (_jsx("div", { role: 'status', "aria-atomic": 'true', ...props, ref: ref, className: cx('
|
|
20
|
-
}
|
|
4
|
+
const Root = function FilterBarRoot({ label, className, ref, ...props }) {
|
|
5
|
+
return (_jsx("form", { ...props, ref: ref, role: 'search', "aria-label": label, className: cx('surf-filter-bar', className) }));
|
|
6
|
+
};
|
|
7
|
+
const Controls = function FilterBarControls({ className, ref, ...props }) {
|
|
8
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-filter-bar-controls', className) }));
|
|
9
|
+
};
|
|
10
|
+
const Field = function FilterBarField({ width = 'filter', className, ref, ...props }) {
|
|
11
|
+
return (_jsx("label", { ...props, ref: ref, "data-width": width, className: cx('surf-filter-bar-field', className) }));
|
|
12
|
+
};
|
|
13
|
+
const Actions = function FilterBarActions({ className, ref, ...props }) {
|
|
14
|
+
return (_jsx("div", { ...props, ref: ref, className: cx('surf-filter-bar-actions', className) }));
|
|
15
|
+
};
|
|
16
|
+
const Summary = function FilterBarSummary({ className, ref, ...props }) {
|
|
17
|
+
return (_jsx("div", { role: 'status', "aria-atomic": 'true', ...props, ref: ref, className: cx('surf-filter-bar-summary', className) }));
|
|
18
|
+
};
|
|
21
19
|
export const FilterBar = { Root, Controls, Field, Actions, Summary };
|
|
22
20
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
23
21
|
export const { Root: FilterBarRoot, Controls: FilterBarControls, Field: FilterBarField, Actions: FilterBarActions, Summary: FilterBarSummary, } = FilterBar;
|
package/dist/form.js
CHANGED
|
@@ -3,5 +3,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Form as BaseForm } from '@base-ui/react/form';
|
|
4
4
|
import { skin } from './parts.js';
|
|
5
5
|
export function Form({ className, ...props }) {
|
|
6
|
-
return _jsx(BaseForm, { ...props, className: skin('
|
|
6
|
+
return (_jsx(BaseForm, { ...props, className: skin('surf-form', className) }));
|
|
7
7
|
}
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { ComponentSize } from './size.js';
|
|
2
3
|
declare const shapes: {
|
|
3
4
|
search: React.JSX.Element;
|
|
4
5
|
plus: React.JSX.Element;
|
|
@@ -42,8 +43,14 @@ type Semantics = {
|
|
|
42
43
|
};
|
|
43
44
|
export type IconProps = Omit<React.ComponentPropsWithoutRef<'svg'>, 'children' | 'name' | 'role' | 'aria-label' | 'aria-labelledby' | 'aria-hidden' | 'tabIndex' | 'focusable' | 'width' | 'height' | 'viewBox' | 'strokeWidth' | 'fill' | 'stroke' | 'title'> & Semantics & {
|
|
44
45
|
name: IconName;
|
|
45
|
-
|
|
46
|
+
/**
|
|
47
|
+
* 14, 16 or 20px; 16px when omitted. Deprecated, removed in a later minor: sm
|
|
48
|
+
* (16px, now default), md (20px, now large) and lg (24px, off the scale).
|
|
49
|
+
*/
|
|
50
|
+
size?: ComponentSize | 'sm' | 'md' | 'lg';
|
|
46
51
|
};
|
|
47
52
|
/** Static SVG only. Actions, focus, accessible button names and hit targets belong to the parent control. */
|
|
48
|
-
export declare const Icon:
|
|
53
|
+
export declare const Icon: ({ name, size, decorative, label, className, ref, ...props }: IconProps & {
|
|
54
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
55
|
+
}) => React.JSX.Element;
|
|
49
56
|
export {};
|
package/dist/icon.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { cx } from './parts.js';
|
|
2
|
+
import { cx } from './class-names.js';
|
|
5
3
|
const shapes = {
|
|
6
4
|
search: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: '10.5', cy: '10.5', r: '6.5' }), _jsx("path", { d: 'm16 16 4 4' })] })),
|
|
7
5
|
plus: _jsx("path", { d: 'M12 5v14M5 12h14' }),
|
|
@@ -41,7 +39,9 @@ const directional = new Set([
|
|
|
41
39
|
'chevron-back',
|
|
42
40
|
'arrow-back',
|
|
43
41
|
]);
|
|
42
|
+
// The short spellings map by pixel size: sm was 16px, which is now the default.
|
|
43
|
+
const iconSizes = { sm: 'default', md: 'large', lg: 'lg' };
|
|
44
44
|
/** Static SVG only. Actions, focus, accessible button names and hit targets belong to the parent control. */
|
|
45
|
-
export const Icon =
|
|
46
|
-
return (_jsx("svg", { ...props, ref: ref, className: cx('
|
|
47
|
-
}
|
|
45
|
+
export const Icon = function Icon({ name, size, decorative = true, label, className, ref, ...props }) {
|
|
46
|
+
return (_jsx("svg", { ...props, ref: ref, className: cx('surf-icon', className), "data-size": size === 'sm' || size === 'md' || size === 'lg' ? iconSizes[size] : size, "data-directional": directional.has(name) ? 'true' : 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] }));
|
|
47
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -36,13 +36,13 @@ export { NavigationMenu, NavigationMenuArrow, NavigationMenuBackdrop, Navigation
|
|
|
36
36
|
export { Menubar } from './menubar.js';
|
|
37
37
|
export { Link, type LinkProps } from './link.js';
|
|
38
38
|
export { Breadcrumbs, BreadcrumbsRoot, BreadcrumbsList, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsSeparator, BreadcrumbsCurrent, } from './breadcrumbs.js';
|
|
39
|
-
export { Pagination, type PaginationProps } from './pagination.js';
|
|
39
|
+
export { Pagination, type PaginationProps, type PaginationLabels, } from './pagination.js';
|
|
40
40
|
export { BottomNavigation, BottomNavigationRoot, BottomNavigationItem, type BottomNavigationRootProps, type BottomNavigationItemProps, } from './bottom-navigation.js';
|
|
41
41
|
export { Avatar, AvatarFallback, AvatarImage, AvatarRoot, AvatarStatus, } from './avatar.js';
|
|
42
42
|
export { Badge, StatusBadge, type BadgeProps, type StatusTone, } from './badge.js';
|
|
43
43
|
export { Card, CardRoot, CardHeader, CardTitle, CardDescription, CardBody, CardFooter, } from './card.js';
|
|
44
|
-
export { Table, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, type TableDensity, type TableSort, useTableSelection, type TableSelectionOptions, type TableSelectionCheckbox, } from './table.js';
|
|
45
|
-
export { CodeBlock, type CodeBlockProps } from './code.js';
|
|
44
|
+
export { Table, TableContainer, TableRoot, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableSortHeader, TableCell, TableTruncate, TableMessage, type TableDensity, type TableVariant, type TableSort, useTableSelection, type TableSelectionOptions, type TableSelectionCheckbox, } from './table.js';
|
|
45
|
+
export { CodeBlock, type CodeBlockProps, type CodeBlockLabels } from './code.js';
|
|
46
46
|
export { SyntaxHighlighter, syntaxLanguages, type SyntaxHighlighterProps, } from './syntax-highlighter.js';
|
|
47
47
|
export { List, ListRoot, ListItem, ListContent, ListTitle, ListDescription, ListActions, } from './list.js';
|
|
48
48
|
export { Stat, StatRoot, StatLabel, StatValue, StatChange, StatCaption, type StatChangeProps, type StatDirection, } from './stat.js';
|
|
@@ -63,6 +63,6 @@ export { Icon, iconNames, type IconName, type IconProps } from './icon.js';
|
|
|
63
63
|
export { SizeProvider, type ComponentSize, type ComponentSizeAlias, } from './sizing.js';
|
|
64
64
|
export { DirectionProvider } from '@base-ui/react/direction-provider';
|
|
65
65
|
export { Slot } from './slot.js';
|
|
66
|
-
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, type AppShellRootProps, type AppShellSidebarToggleProps, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
|
|
66
|
+
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, type AppShellRootProps, type AppShellSidebarToggleProps, type AppShellSidebarToggleLabels, AppShellBrand, type AppShellBrandProps, AppShellNav, type AppShellNavProps, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, type AppShellLinkProps, } from './app-shell.js';
|
|
67
67
|
export { PageHeader } from './page-header.js';
|
|
68
68
|
export { FilterBar, FilterBarRoot, FilterBarControls, FilterBarField, FilterBarActions, FilterBarSummary, } from './filter-bar.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
// One entry per catalog page: each module is also its own entry point, such as
|
|
3
2
|
// @surflane/ui/checkbox. Chart, DatePicker, Markdown, Tree and syntax highlighting
|
|
4
3
|
// need optional packages, so they live only on their own entry points:
|
|
@@ -46,7 +45,7 @@ export { NavigationMenu, NavigationMenuArrow, NavigationMenuBackdrop, Navigation
|
|
|
46
45
|
export { Menubar } from './menubar.js';
|
|
47
46
|
export { Link } from './link.js';
|
|
48
47
|
export { Breadcrumbs, BreadcrumbsRoot, BreadcrumbsList, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsSeparator, BreadcrumbsCurrent, } from './breadcrumbs.js';
|
|
49
|
-
export { Pagination } from './pagination.js';
|
|
48
|
+
export { Pagination, } from './pagination.js';
|
|
50
49
|
export { BottomNavigation, BottomNavigationRoot, BottomNavigationItem, } from './bottom-navigation.js';
|
|
51
50
|
// Data display
|
|
52
51
|
export { Avatar, AvatarFallback, AvatarImage, AvatarRoot, AvatarStatus, } from './avatar.js';
|
|
@@ -78,6 +77,6 @@ export { SizeProvider, } from './sizing.js';
|
|
|
78
77
|
export { DirectionProvider } from '@base-ui/react/direction-provider';
|
|
79
78
|
export { Slot } from './slot.js';
|
|
80
79
|
// Patterns
|
|
81
|
-
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
|
|
80
|
+
export { AppShell, AppShellRoot, AppShellHeader, AppShellSidebar, AppShellSidebarToggle, AppShellBrand, AppShellNav, AppShellContent, AppShellPage, AppShellFooter, AppShellLabel, AppShellLink, } from './app-shell.js';
|
|
82
81
|
export { PageHeader } from './page-header.js';
|
|
83
82
|
export { FilterBar, FilterBarRoot, FilterBarControls, FilterBarField, FilterBarActions, FilterBarSummary, } from './filter-bar.js';
|