@igne-agency/react-web-ui 0.3.1 → 0.5.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 +32 -1
- package/dist/base.css +3 -0
- package/dist/components/accordion/accordion.css +24 -19
- package/dist/components/accordion/accordion.d.ts +19 -3
- package/dist/components/accordion/accordion.js +86 -32
- package/dist/components/accordion/accordion.module.js +8 -8
- package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
- package/dist/components/active-filters/active-filter-describers.js +1 -1
- package/dist/components/active-filters/active-filters.d.ts +35 -2
- package/dist/components/active-filters/active-filters.js +57 -52
- package/dist/components/active-filters/index.js +2 -2
- package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
- package/dist/components/attachment-tile/attachment-preview.js +102 -68
- package/dist/components/attachment-tile/attachment-tile.css +22 -13
- package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
- package/dist/components/attachment-tile/attachment-tile.js +209 -85
- package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/attachment-tile/index.js +2 -2
- package/dist/components/avatar/avatar.d.ts +5 -5
- package/dist/components/avatar/avatar.js +64 -37
- package/dist/components/avatar-group/avatar-group.js +2 -2
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
- package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
- package/dist/components/button/button.d.ts +2 -3
- package/dist/components/button/button.js +58 -77
- package/dist/components/button/close-button.d.ts +4 -2
- package/dist/components/button/close-button.js +9 -9
- package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
- package/dist/components/checkbox-field/checkbox-field.js +108 -131
- package/dist/components/checkbox-field/checkbox.css +26 -34
- package/dist/components/checkbox-field/checkbox.d.ts +51 -8
- package/dist/components/checkbox-field/checkbox.js +221 -57
- package/dist/components/checkbox-field/checkbox.module.js +6 -8
- package/dist/components/checkbox-field/index.d.ts +0 -1
- package/dist/components/checkbox-field/index.js +1 -2
- package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
- package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
- package/dist/components/collapsible/collapsible.css +23 -18
- package/dist/components/collapsible/collapsible.d.ts +18 -3
- package/dist/components/collapsible/collapsible.js +85 -32
- package/dist/components/collapsible/collapsible.module.js +7 -7
- package/dist/components/combobox-field/combobox-field.d.ts +9 -1
- package/dist/components/combobox-field/combobox-field.js +195 -175
- package/dist/components/combobox-field/combobox-items.d.ts +2 -2
- package/dist/components/combobox-field/combobox-items.js +4 -4
- package/dist/components/combobox-field/combobox.css +99 -96
- package/dist/components/combobox-field/combobox.d.ts +94 -15
- package/dist/components/combobox-field/combobox.js +484 -159
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/index.d.ts +0 -1
- package/dist/components/combobox-field/selection.d.ts +4 -1
- package/dist/components/combobox-field/value-state-view.css +7 -3
- package/dist/components/combobox-field/value-state-view.d.ts +4 -2
- package/dist/components/combobox-field/value-state-view.js +15 -15
- package/dist/components/combobox-field/value-state-view.module.js +6 -4
- package/dist/components/composer/composer-attachments.d.ts +11 -3
- package/dist/components/composer/composer-attachments.js +61 -47
- package/dist/components/composer/composer-editor.d.ts +2 -1
- package/dist/components/composer/composer-editor.js +79 -71
- package/dist/components/composer/composer-mentions.js +2 -2
- package/dist/components/composer/composer.d.ts +42 -21
- package/dist/components/composer/composer.js +201 -58
- package/dist/components/composer/mention-text.js +3 -3
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
- package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
- package/dist/components/conversation/conversation.context.d.ts +0 -5
- package/dist/components/conversation/conversation.d.ts +63 -29
- package/dist/components/conversation/conversation.js +193 -82
- package/dist/components/conversation/index.d.ts +1 -1
- package/dist/components/date-field/date-field.d.ts +10 -4
- package/dist/components/date-field/date-field.js +57 -43
- package/dist/components/date-field/date-input.d.ts +20 -3
- package/dist/components/date-field/date-input.js +28 -13
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-field/tsf-date-field.d.ts +1 -1
- package/dist/components/date-field/tsf-date-field.js +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +8 -4
- package/dist/components/date-range-field/date-range-field.js +57 -45
- package/dist/components/date-range-field/date-range-input.d.ts +20 -3
- package/dist/components/date-range-field/date-range-input.js +27 -12
- package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
- package/dist/components/detail-list/detail-list.d.ts +28 -27
- package/dist/components/detail-list/detail-list.js +177 -121
- package/dist/components/dialog/dialog.d.ts +47 -27
- package/dist/components/dialog/dialog.js +101 -38
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.d.ts +48 -30
- package/dist/components/drawer/drawer.js +113 -41
- package/dist/components/email-field/email-field.d.ts +5 -3
- package/dist/components/email-field/email-field.js +1 -3
- package/dist/components/email-field/tsf-email-field.d.ts +3 -2
- package/dist/components/empty-message/empty-message.d.ts +3 -3
- package/dist/components/empty-message/empty-message.js +3 -3
- package/dist/components/error-boundary/error-boundary.d.ts +5 -2
- package/dist/components/error-boundary/error-boundary.js +2 -3
- package/dist/components/error-message/error-message.d.ts +1 -1
- package/dist/components/error-message/error-message.js +1 -1
- package/dist/components/error-text/error-text.js +3 -3
- package/dist/components/field/field.d.ts +5 -5
- package/dist/components/field/field.js +9 -9
- package/dist/components/field/index.js +2 -2
- package/dist/components/field/input-parts.js +1 -1
- package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
- package/dist/components/field-placeholder/field-placeholder.js +41 -26
- package/dist/components/fieldset/field-group.js +1 -1
- package/dist/components/fieldset/fieldset-root.js +1 -1
- package/dist/components/fieldset/fieldset.js +1 -1
- package/dist/components/file-field/file-field.css +19 -15
- package/dist/components/file-field/file-field.d.ts +10 -1
- package/dist/components/file-field/file-field.js +130 -109
- package/dist/components/file-field/file-field.module.js +6 -4
- package/dist/components/file-field/file-input.d.ts +32 -9
- package/dist/components/file-field/file-input.js +94 -74
- package/dist/components/filter-bar/filter-bar.d.ts +79 -51
- package/dist/components/filter-bar/filter-bar.js +552 -216
- package/dist/components/form/form.d.ts +4 -6
- package/dist/components/form/form.js +6 -8
- package/dist/components/icon/icon.d.ts +5 -10
- package/dist/components/icon/icon.js +4 -6
- package/dist/components/link/link.js +1 -1
- package/dist/components/link-button/link-button.d.ts +1 -2
- package/dist/components/link-button/link-button.js +12 -22
- package/dist/components/loading-message/loading-message.d.ts +2 -2
- package/dist/components/loading-message/loading-message.js +1 -1
- package/dist/components/locale-provider/locale-provider.js +1 -1
- package/dist/components/menu/menu.d.ts +40 -22
- package/dist/components/menu/menu.js +100 -40
- package/dist/components/nav/nav-context.d.ts +0 -1
- package/dist/components/nav/nav-context.js +1 -2
- package/dist/components/nav/nav-item-view.d.ts +7 -7
- package/dist/components/nav/nav-item-view.js +27 -51
- package/dist/components/nav/nav.css +72 -60
- package/dist/components/nav/nav.d.ts +15 -8
- package/dist/components/nav/nav.js +105 -52
- package/dist/components/nav/nav.module.js +14 -14
- package/dist/components/number-field/number-field.d.ts +7 -1
- package/dist/components/number-field/number-field.js +98 -82
- package/dist/components/number-field/number-input.d.ts +53 -4
- package/dist/components/number-field/number-input.js +68 -21
- package/dist/components/number-field/tsf-number-field.d.ts +1 -1
- package/dist/components/number-field/tsf-number-field.js +1 -1
- package/dist/components/otp-field/otp-input.d.ts +25 -0
- package/dist/components/otp-field/otp-input.js +26 -1
- package/dist/components/pagination/pagination.d.ts +82 -23
- package/dist/components/pagination/pagination.js +656 -229
- package/dist/components/password-field/password-field.d.ts +7 -1
- package/dist/components/password-field/password-field.js +117 -126
- package/dist/components/password-field/password-strength.js +1 -1
- package/dist/components/password-field/tsf-password-field.d.ts +1 -1
- package/dist/components/password-field/tsf-password-field.js +1 -1
- package/dist/components/photo-field/photo-field.d.ts +17 -3
- package/dist/components/photo-field/photo-field.js +168 -89
- package/dist/components/photo-field/photo-input-context.d.ts +25 -0
- package/dist/components/photo-field/photo-input-context.js +14 -0
- package/dist/components/photo-field/photo-input.d.ts +58 -23
- package/dist/components/photo-field/photo-input.js +459 -261
- package/dist/components/popover/popover.d.ts +55 -23
- package/dist/components/popover/popover.js +205 -61
- package/dist/components/radio-group-field/radio-group.js +1 -1
- package/dist/components/search-field/search-field.d.ts +7 -5
- package/dist/components/search-field/search-field.js +4 -6
- package/dist/components/search-field/tsf-search-field.d.ts +1 -1
- package/dist/components/search-field/tsf-search-field.js +1 -1
- package/dist/components/segmented-control-field/segmented-control.js +1 -1
- package/dist/components/select-field/select-field.d.ts +7 -1
- package/dist/components/select-field/select-field.js +151 -139
- package/dist/components/select-field/select.d.ts +28 -6
- package/dist/components/select-field/select.js +234 -149
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/spinner/spinner.css +47 -1
- package/dist/components/spinner/spinner.js +28 -11
- package/dist/components/spinner/spinner.module.js +18 -3
- package/dist/components/stale/stale.d.ts +17 -21
- package/dist/components/stale/stale.js +307 -129
- package/dist/components/status-message/status-message.css +22 -21
- package/dist/components/status-message/status-message.d.ts +10 -5
- package/dist/components/status-message/status-message.js +20 -24
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/status-message/status-preset.d.ts +4 -5
- package/dist/components/status-message/status-preset.js +3 -3
- package/dist/components/switch-field/switch.js +1 -1
- package/dist/components/tabs/tabs.d.ts +51 -28
- package/dist/components/tabs/tabs.js +219 -144
- package/dist/components/tag/tag.css +23 -21
- package/dist/components/tag/tag.d.ts +17 -15
- package/dist/components/tag/tag.js +140 -65
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +30 -27
- package/dist/components/tag-group/tag-group.d.ts +10 -4
- package/dist/components/tag-group/tag-group.js +47 -35
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.d.ts +14 -3
- package/dist/components/text-field/text-field.js +154 -133
- package/dist/components/text-field/text-input.d.ts +89 -3
- package/dist/components/text-field/text-input.js +184 -70
- package/dist/components/textarea-field/textarea.js +1 -1
- package/dist/components/time-field/time-input.d.ts +6 -0
- package/dist/components/time-field/time-input.js +6 -0
- package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toast-provider.css +38 -34
- package/dist/components/toast/toast-provider.d.ts +65 -3
- package/dist/components/toast/toast-provider.js +313 -148
- package/dist/components/toast/toast-provider.module.js +11 -17
- package/dist/components/toast/toast.d.ts +5 -1
- package/dist/components/toast/toast.js +2 -1
- package/dist/components/toggle-group-field/toggle-group.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +6 -6
- package/dist/components/tooltip/tooltip.js +7 -7
- package/dist/data-table/data-table-content.d.ts +18 -10
- package/dist/data-table/data-table-content.js +145 -290
- package/dist/data-table/data-table-context.d.ts +4 -2
- package/dist/data-table/data-table-context.js +1 -1
- package/dist/data-table/data-table-parts.d.ts +99 -0
- package/dist/data-table/data-table-parts.js +1182 -0
- package/dist/data-table/data-table-selection.d.ts +7 -3
- package/dist/data-table/data-table-selection.js +62 -37
- package/dist/data-table/data-table.css +100 -95
- package/dist/data-table/data-table.d.ts +49 -25
- package/dist/data-table/data-table.js +95 -83
- package/dist/data-table/data-table.module.js +34 -34
- package/dist/data-table/index.d.ts +2 -1
- package/dist/data-table/index.js +2 -1
- package/dist/data-view/use-data-view.d.ts +2 -2
- package/dist/data-view/use-data-view.js +2 -2
- package/dist/index.js +7 -8
- package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
- package/dist/lib/calendar/calendar-navigation.js +72 -73
- package/dist/lib/calendar/calendar-year.d.ts +4 -3
- package/dist/lib/calendar/calendar-year.js +137 -156
- package/dist/lib/calendar/temporal.d.ts +18 -12
- package/dist/lib/calendar/temporal.js +191 -147
- package/dist/lib/table-storage.d.ts +2 -2
- package/dist/lib/table-storage.js +2 -2
- package/dist/lib/unsaved-changes/leave-guard.js +1 -1
- package/dist/terrazzo/index.d.ts +20 -3
- package/dist/terrazzo/index.js +110 -7
- package/dist/tokens.css +94 -71
- package/package.json +4 -3
- package/tokens/ref.tokens.json +0 -30
- package/tokens/sys.tokens.json +0 -7
- package/dist/assets/spinner.js +0 -28
- package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
- package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
- package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
- package/dist/components/combobox-field/combobox-popup-body.js +0 -142
- package/dist/components/conversation/conversation.context.js +0 -4
- package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Icon } from "../icon/icon.js";
|
|
2
1
|
import { Tooltip } from "../tooltip/tooltip.js";
|
|
3
2
|
import { buttonAttributes } from "./button-attributes.js";
|
|
4
3
|
import { c } from "react/compiler-runtime";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
// src/components/button/button.tsx
|
|
8
7
|
var ButtonElement = (t0) => {
|
|
9
8
|
const $ = c(6);
|
|
@@ -41,7 +40,7 @@ var ButtonElement = (t0) => {
|
|
|
41
40
|
* <Button variant="primary" size="md" onClick={apply}>Apply</Button>
|
|
42
41
|
*/
|
|
43
42
|
var Button = (props) => {
|
|
44
|
-
const $ = c(
|
|
43
|
+
const $ = c(45);
|
|
45
44
|
if (props.iconOnly) {
|
|
46
45
|
let className;
|
|
47
46
|
let icon;
|
|
@@ -90,44 +89,35 @@ var Button = (props) => {
|
|
|
90
89
|
$[14] = t0;
|
|
91
90
|
} else t0 = $[14];
|
|
92
91
|
let t1;
|
|
93
|
-
if ($[15] !== icon) {
|
|
94
|
-
t1 = /* @__PURE__ */ jsx(
|
|
95
|
-
svg: icon,
|
|
96
|
-
label: ""
|
|
97
|
-
});
|
|
98
|
-
$[15] = icon;
|
|
99
|
-
$[16] = t1;
|
|
100
|
-
} else t1 = $[16];
|
|
101
|
-
let t2;
|
|
102
|
-
if ($[17] !== iconOnly || $[18] !== label || $[19] !== nativeProps || $[20] !== render || $[21] !== t0 || $[22] !== t1) {
|
|
103
|
-
t2 = /* @__PURE__ */ jsx(ButtonElement, {
|
|
92
|
+
if ($[15] !== icon || $[16] !== iconOnly || $[17] !== label || $[18] !== nativeProps || $[19] !== render || $[20] !== t0) {
|
|
93
|
+
t1 = /* @__PURE__ */ jsx(ButtonElement, {
|
|
104
94
|
render,
|
|
105
95
|
type: "button",
|
|
106
96
|
"aria-label": label,
|
|
107
97
|
...t0,
|
|
108
98
|
"data-icon-only": iconOnly,
|
|
109
99
|
...nativeProps,
|
|
110
|
-
children:
|
|
100
|
+
children: icon
|
|
111
101
|
});
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
} else
|
|
120
|
-
let
|
|
121
|
-
if ($[
|
|
122
|
-
|
|
102
|
+
$[15] = icon;
|
|
103
|
+
$[16] = iconOnly;
|
|
104
|
+
$[17] = label;
|
|
105
|
+
$[18] = nativeProps;
|
|
106
|
+
$[19] = render;
|
|
107
|
+
$[20] = t0;
|
|
108
|
+
$[21] = t1;
|
|
109
|
+
} else t1 = $[21];
|
|
110
|
+
let t2;
|
|
111
|
+
if ($[22] !== label || $[23] !== t1) {
|
|
112
|
+
t2 = /* @__PURE__ */ jsx(Tooltip, {
|
|
123
113
|
content: label,
|
|
124
|
-
children:
|
|
114
|
+
children: t1
|
|
125
115
|
});
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
} else
|
|
130
|
-
return
|
|
116
|
+
$[22] = label;
|
|
117
|
+
$[23] = t1;
|
|
118
|
+
$[24] = t2;
|
|
119
|
+
} else t2 = $[24];
|
|
120
|
+
return t2;
|
|
131
121
|
}
|
|
132
122
|
let children;
|
|
133
123
|
let className_0;
|
|
@@ -137,7 +127,7 @@ var Button = (props) => {
|
|
|
137
127
|
let size_0;
|
|
138
128
|
let tone_0;
|
|
139
129
|
let variant_0;
|
|
140
|
-
if ($[
|
|
130
|
+
if ($[25] !== props) {
|
|
141
131
|
const { variant: t0, size: t1, tone: t2, className: t3, iconOnly: _iconOnly, icon: t4, children: t5, render: t6, ...t7 } = props;
|
|
142
132
|
variant_0 = t0;
|
|
143
133
|
size_0 = t1;
|
|
@@ -147,64 +137,55 @@ var Button = (props) => {
|
|
|
147
137
|
children = t5;
|
|
148
138
|
render_0 = t6;
|
|
149
139
|
nativeProps_0 = t7;
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
140
|
+
$[25] = props;
|
|
141
|
+
$[26] = children;
|
|
142
|
+
$[27] = className_0;
|
|
143
|
+
$[28] = icon_0;
|
|
144
|
+
$[29] = nativeProps_0;
|
|
145
|
+
$[30] = render_0;
|
|
146
|
+
$[31] = size_0;
|
|
147
|
+
$[32] = tone_0;
|
|
148
|
+
$[33] = variant_0;
|
|
159
149
|
} else {
|
|
160
|
-
children = $[
|
|
161
|
-
className_0 = $[
|
|
162
|
-
icon_0 = $[
|
|
163
|
-
nativeProps_0 = $[
|
|
164
|
-
render_0 = $[
|
|
165
|
-
size_0 = $[
|
|
166
|
-
tone_0 = $[
|
|
167
|
-
variant_0 = $[
|
|
150
|
+
children = $[26];
|
|
151
|
+
className_0 = $[27];
|
|
152
|
+
icon_0 = $[28];
|
|
153
|
+
nativeProps_0 = $[29];
|
|
154
|
+
render_0 = $[30];
|
|
155
|
+
size_0 = $[31];
|
|
156
|
+
tone_0 = $[32];
|
|
157
|
+
variant_0 = $[33];
|
|
168
158
|
}
|
|
169
159
|
let t0;
|
|
170
|
-
if ($[
|
|
160
|
+
if ($[34] !== className_0 || $[35] !== size_0 || $[36] !== tone_0 || $[37] !== variant_0) {
|
|
171
161
|
t0 = buttonAttributes({
|
|
172
162
|
variant: variant_0,
|
|
173
163
|
size: size_0,
|
|
174
164
|
tone: tone_0,
|
|
175
165
|
className: className_0
|
|
176
166
|
});
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
} else t0 = $[
|
|
167
|
+
$[34] = className_0;
|
|
168
|
+
$[35] = size_0;
|
|
169
|
+
$[36] = tone_0;
|
|
170
|
+
$[37] = variant_0;
|
|
171
|
+
$[38] = t0;
|
|
172
|
+
} else t0 = $[38];
|
|
183
173
|
let t1;
|
|
184
|
-
if ($[41] !==
|
|
185
|
-
t1 =
|
|
186
|
-
svg: icon_0,
|
|
187
|
-
label: ""
|
|
188
|
-
}) : null;
|
|
189
|
-
$[41] = icon_0;
|
|
190
|
-
$[42] = t1;
|
|
191
|
-
} else t1 = $[42];
|
|
192
|
-
let t2;
|
|
193
|
-
if ($[43] !== children || $[44] !== nativeProps_0 || $[45] !== render_0 || $[46] !== t0 || $[47] !== t1) {
|
|
194
|
-
t2 = /* @__PURE__ */ jsxs(ButtonElement, {
|
|
174
|
+
if ($[39] !== children || $[40] !== icon_0 || $[41] !== nativeProps_0 || $[42] !== render_0 || $[43] !== t0) {
|
|
175
|
+
t1 = /* @__PURE__ */ jsxs(ButtonElement, {
|
|
195
176
|
render: render_0,
|
|
196
177
|
type: "button",
|
|
197
178
|
...t0,
|
|
198
179
|
...nativeProps_0,
|
|
199
|
-
children: [
|
|
180
|
+
children: [icon_0, children]
|
|
200
181
|
});
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
182
|
+
$[39] = children;
|
|
183
|
+
$[40] = icon_0;
|
|
184
|
+
$[41] = nativeProps_0;
|
|
185
|
+
$[42] = render_0;
|
|
186
|
+
$[43] = t0;
|
|
187
|
+
$[44] = t1;
|
|
188
|
+
} else t1 = $[44];
|
|
189
|
+
return t1;
|
|
209
190
|
};
|
|
210
191
|
export { Button };
|
|
@@ -2,6 +2,8 @@ import type { ReactElement, ReactNode } from "react";
|
|
|
2
2
|
export type CloseButtonProps = Readonly<{
|
|
3
3
|
/** Accessible name, surfaced as the tooltip hint and the `aria-label`. */
|
|
4
4
|
closeLabel: string;
|
|
5
|
+
/** The app's close glyph, drawn in `currentColor` at `1em`. */
|
|
6
|
+
icon: ReactNode;
|
|
5
7
|
/** The library part that closes, such as `<BaseDialog.Close />`. */
|
|
6
8
|
render: ReactElement;
|
|
7
9
|
}>;
|
|
@@ -9,6 +11,6 @@ export type CloseButtonProps = Readonly<{
|
|
|
9
11
|
* The icon-only way out of an overlay, rendered as the overlay's own close part.
|
|
10
12
|
*
|
|
11
13
|
* @example
|
|
12
|
-
* <CloseButton closeLabel="Close" render={<BaseDialog.Close />} />
|
|
14
|
+
* <CloseButton closeLabel="Close" icon={<CloseIcon />} render={<BaseDialog.Close />} />
|
|
13
15
|
*/
|
|
14
|
-
export declare const CloseButton: ({ closeLabel, render, }: CloseButtonProps) => ReactNode;
|
|
16
|
+
export declare const CloseButton: ({ closeLabel, icon, render, }: CloseButtonProps) => ReactNode;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import SvgClose from "../../vendor/@material-design-icons/svg/outlined/close.js";
|
|
2
1
|
import { Button } from "./button.js";
|
|
3
2
|
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -7,24 +6,25 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
6
|
* The icon-only way out of an overlay, rendered as the overlay's own close part.
|
|
8
7
|
*
|
|
9
8
|
* @example
|
|
10
|
-
* <CloseButton closeLabel="Close" render={<BaseDialog.Close />} />
|
|
9
|
+
* <CloseButton closeLabel="Close" icon={<CloseIcon />} render={<BaseDialog.Close />} />
|
|
11
10
|
*/
|
|
12
11
|
var CloseButton = (t0) => {
|
|
13
|
-
const $ = c(
|
|
14
|
-
const { closeLabel, render } = t0;
|
|
12
|
+
const $ = c(4);
|
|
13
|
+
const { closeLabel, icon, render } = t0;
|
|
15
14
|
let t1;
|
|
16
|
-
if ($[0] !== closeLabel || $[1] !== render) {
|
|
15
|
+
if ($[0] !== closeLabel || $[1] !== icon || $[2] !== render) {
|
|
17
16
|
t1 = /* @__PURE__ */ jsx(Button, {
|
|
18
17
|
variant: "tertiary",
|
|
19
18
|
iconOnly: true,
|
|
20
|
-
icon
|
|
19
|
+
icon,
|
|
21
20
|
label: closeLabel,
|
|
22
21
|
render
|
|
23
22
|
});
|
|
24
23
|
$[0] = closeLabel;
|
|
25
|
-
$[1] =
|
|
26
|
-
$[2] =
|
|
27
|
-
|
|
24
|
+
$[1] = icon;
|
|
25
|
+
$[2] = render;
|
|
26
|
+
$[3] = t1;
|
|
27
|
+
} else t1 = $[3];
|
|
28
28
|
return t1;
|
|
29
29
|
};
|
|
30
30
|
export { CloseButton };
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { type FieldBlurHandler, type FieldProps } from "../field/index.ts";
|
|
3
|
-
import { type
|
|
4
|
-
export type
|
|
3
|
+
import { type CheckboxControlProps } from "./checkbox.tsx";
|
|
4
|
+
export type CheckboxFieldBaseProps = FieldProps & Omit<CheckboxControlProps, "className" | "onBlur" | "children" | "indeterminate"> & Readonly<{
|
|
5
5
|
onBlur?: FieldBlurHandler;
|
|
6
|
+
/** The mark the box shows while checked, such as a tick. */
|
|
7
|
+
checkIcon: ReactNode;
|
|
6
8
|
/** Applied to the field wrapper, so callers can place the row. */
|
|
7
9
|
className?: string;
|
|
8
10
|
}>;
|
|
11
|
+
/** The indeterminate state, with the mark it needs only when it is used. */
|
|
12
|
+
export type CheckboxFieldIndeterminateProps = Readonly<{
|
|
13
|
+
/** The box shows neither checked nor unchecked, for a parent over a mixed set. */
|
|
14
|
+
indeterminate: boolean;
|
|
15
|
+
/** The mark the box shows while indeterminate, such as a dash. */
|
|
16
|
+
indeterminateIcon: ReactNode;
|
|
17
|
+
}> | Readonly<{
|
|
18
|
+
indeterminate?: undefined;
|
|
19
|
+
indeterminateIcon?: undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export type CheckboxFieldProps = CheckboxFieldBaseProps & CheckboxFieldIndeterminateProps;
|
|
9
22
|
/**
|
|
10
23
|
* The assembled checkbox: the label beside the box, which also toggles it, then
|
|
11
24
|
* the description and the error.
|
|
@@ -14,8 +27,9 @@ export type CheckboxFieldProps = FieldProps & Omit<CheckboxProps, "className" |
|
|
|
14
27
|
* <CheckboxField
|
|
15
28
|
* label="I agree to the terms"
|
|
16
29
|
* optionalLabel="optional"
|
|
30
|
+
* checkIcon={<CheckIcon />}
|
|
17
31
|
* checked={agreed}
|
|
18
32
|
* onCheckedChange={setAgreed}
|
|
19
33
|
* />
|
|
20
34
|
*/
|
|
21
|
-
export declare const CheckboxField: ({ label, description, errors, requiredness, optionalLabel, dirty, touched, pending, name, className, ...props }: CheckboxFieldProps) => ReactNode;
|
|
35
|
+
export declare const CheckboxField: ({ label, description, errors, requiredness, optionalLabel, dirty, touched, pending, name, className, checkIcon, indeterminateIcon, ...props }: CheckboxFieldProps) => ReactNode;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { Field
|
|
2
|
-
import { fieldStateAttributes } from "../field/field-state.js";
|
|
3
|
-
import { useFieldState } from "../field/use-field-state.js";
|
|
1
|
+
import { Field } from "../field/field.js";
|
|
4
2
|
import { detachHiddenInput } from "../field/hidden-input.js";
|
|
5
3
|
import { Checkbox } from "./checkbox.js";
|
|
6
|
-
import checkbox_module_default from "./checkbox.module.js";
|
|
7
4
|
import { c } from "react/compiler-runtime";
|
|
8
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { clsx } from "clsx";
|
|
10
|
-
import { Field } from "@base-ui/react/field";
|
|
11
6
|
// src/components/checkbox-field/checkbox-field.tsx
|
|
12
7
|
/**
|
|
13
8
|
* The assembled checkbox: the label beside the box, which also toggles it, then
|
|
@@ -17,16 +12,19 @@ import { Field } from "@base-ui/react/field";
|
|
|
17
12
|
* <CheckboxField
|
|
18
13
|
* label="I agree to the terms"
|
|
19
14
|
* optionalLabel="optional"
|
|
15
|
+
* checkIcon={<CheckIcon />}
|
|
20
16
|
* checked={agreed}
|
|
21
17
|
* onCheckedChange={setAgreed}
|
|
22
18
|
* />
|
|
23
19
|
*/
|
|
24
20
|
var CheckboxField = (t0) => {
|
|
25
|
-
const $ = c(
|
|
21
|
+
const $ = c(46);
|
|
22
|
+
let checkIcon;
|
|
26
23
|
let className;
|
|
27
24
|
let description;
|
|
28
25
|
let dirty;
|
|
29
26
|
let errors;
|
|
27
|
+
let indeterminateIcon;
|
|
30
28
|
let label;
|
|
31
29
|
let name;
|
|
32
30
|
let optionalLabel;
|
|
@@ -35,147 +33,126 @@ var CheckboxField = (t0) => {
|
|
|
35
33
|
let requiredness;
|
|
36
34
|
let touched;
|
|
37
35
|
if ($[0] !== t0) {
|
|
38
|
-
({label, description, errors, requiredness, optionalLabel, dirty, touched, pending, name, className, ...props} = t0);
|
|
36
|
+
({label, description, errors, requiredness, optionalLabel, dirty, touched, pending, name, className, checkIcon, indeterminateIcon, ...props} = t0);
|
|
39
37
|
$[0] = t0;
|
|
40
|
-
$[1] =
|
|
41
|
-
$[2] =
|
|
42
|
-
$[3] =
|
|
43
|
-
$[4] =
|
|
44
|
-
$[5] =
|
|
45
|
-
$[6] =
|
|
46
|
-
$[7] =
|
|
47
|
-
$[8] =
|
|
48
|
-
$[9] =
|
|
49
|
-
$[10] =
|
|
50
|
-
$[11] =
|
|
38
|
+
$[1] = checkIcon;
|
|
39
|
+
$[2] = className;
|
|
40
|
+
$[3] = description;
|
|
41
|
+
$[4] = dirty;
|
|
42
|
+
$[5] = errors;
|
|
43
|
+
$[6] = indeterminateIcon;
|
|
44
|
+
$[7] = label;
|
|
45
|
+
$[8] = name;
|
|
46
|
+
$[9] = optionalLabel;
|
|
47
|
+
$[10] = pending;
|
|
48
|
+
$[11] = props;
|
|
49
|
+
$[12] = requiredness;
|
|
50
|
+
$[13] = touched;
|
|
51
51
|
} else {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
checkIcon = $[1];
|
|
53
|
+
className = $[2];
|
|
54
|
+
description = $[3];
|
|
55
|
+
dirty = $[4];
|
|
56
|
+
errors = $[5];
|
|
57
|
+
indeterminateIcon = $[6];
|
|
58
|
+
label = $[7];
|
|
59
|
+
name = $[8];
|
|
60
|
+
optionalLabel = $[9];
|
|
61
|
+
pending = $[10];
|
|
62
|
+
props = $[11];
|
|
63
|
+
requiredness = $[12];
|
|
64
|
+
touched = $[13];
|
|
63
65
|
}
|
|
64
|
-
const ids = Field
|
|
66
|
+
const ids = Field.useIds();
|
|
65
67
|
const t1 = props.checked === true;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
};
|
|
78
|
-
$[12] = dirty;
|
|
79
|
-
$[13] = errors;
|
|
80
|
-
$[14] = pending;
|
|
81
|
-
$[15] = props.disabled;
|
|
82
|
-
$[16] = props.readOnly;
|
|
83
|
-
$[17] = requiredness;
|
|
84
|
-
$[18] = t1;
|
|
85
|
-
$[19] = touched;
|
|
86
|
-
$[20] = t2;
|
|
87
|
-
} else t2 = $[20];
|
|
88
|
-
const field = useFieldState(t2);
|
|
89
|
-
let t3;
|
|
90
|
-
if ($[21] !== className) {
|
|
91
|
-
t3 = clsx(checkbox_module_default.root, className);
|
|
92
|
-
$[21] = className;
|
|
93
|
-
$[22] = t3;
|
|
94
|
-
} else t3 = $[22];
|
|
95
|
-
const t4 = field.disabled;
|
|
96
|
-
const t5 = field.invalid;
|
|
97
|
-
let t6;
|
|
98
|
-
if ($[23] !== field.state) {
|
|
99
|
-
t6 = fieldStateAttributes(field.state);
|
|
100
|
-
$[23] = field.state;
|
|
101
|
-
$[24] = t6;
|
|
102
|
-
} else t6 = $[24];
|
|
103
|
-
const t7 = requiredness === "required";
|
|
104
|
-
let t8;
|
|
105
|
-
if ($[25] !== ids.controlId || $[26] !== props || $[27] !== t7) {
|
|
106
|
-
t8 = /* @__PURE__ */ jsx(Checkbox, {
|
|
68
|
+
const t2 = requiredness === "required";
|
|
69
|
+
const t3 = props.indeterminate === true ? indeterminateIcon : checkIcon;
|
|
70
|
+
let t4;
|
|
71
|
+
if ($[14] !== t3) {
|
|
72
|
+
t4 = /* @__PURE__ */ jsx(Checkbox.Indicator, { children: t3 });
|
|
73
|
+
$[14] = t3;
|
|
74
|
+
$[15] = t4;
|
|
75
|
+
} else t4 = $[15];
|
|
76
|
+
let t5;
|
|
77
|
+
if ($[16] !== ids.controlId || $[17] !== props || $[18] !== t2 || $[19] !== t4) {
|
|
78
|
+
t5 = /* @__PURE__ */ jsx(Checkbox.Control, {
|
|
107
79
|
name: ids.controlId,
|
|
108
80
|
inputRef: detachHiddenInput,
|
|
109
|
-
required:
|
|
110
|
-
...props
|
|
81
|
+
required: t2,
|
|
82
|
+
...props,
|
|
83
|
+
children: t4
|
|
111
84
|
});
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
85
|
+
$[16] = ids.controlId;
|
|
86
|
+
$[17] = props;
|
|
87
|
+
$[18] = t2;
|
|
88
|
+
$[19] = t4;
|
|
89
|
+
$[20] = t5;
|
|
90
|
+
} else t5 = $[20];
|
|
91
|
+
let t6;
|
|
92
|
+
if ($[21] !== label || $[22] !== optionalLabel || $[23] !== requiredness) {
|
|
93
|
+
t6 = /* @__PURE__ */ jsx(Field.InlineLabelText, {
|
|
120
94
|
label,
|
|
121
95
|
requiredness,
|
|
122
96
|
optionalLabel
|
|
123
97
|
});
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
} else
|
|
98
|
+
$[21] = label;
|
|
99
|
+
$[22] = optionalLabel;
|
|
100
|
+
$[23] = requiredness;
|
|
101
|
+
$[24] = t6;
|
|
102
|
+
} else t6 = $[24];
|
|
103
|
+
let t7;
|
|
104
|
+
if ($[25] !== t5 || $[26] !== t6) {
|
|
105
|
+
t7 = /* @__PURE__ */ jsxs(Checkbox.Label, { children: [t5, t6] });
|
|
106
|
+
$[25] = t5;
|
|
107
|
+
$[26] = t6;
|
|
108
|
+
$[27] = t7;
|
|
109
|
+
} else t7 = $[27];
|
|
110
|
+
let t8;
|
|
111
|
+
if ($[28] !== description) {
|
|
112
|
+
t8 = /* @__PURE__ */ jsx(Checkbox.Description, { children: description });
|
|
113
|
+
$[28] = description;
|
|
114
|
+
$[29] = t8;
|
|
115
|
+
} else t8 = $[29];
|
|
116
|
+
let t9;
|
|
117
|
+
if ($[30] !== errors) {
|
|
118
|
+
t9 = /* @__PURE__ */ jsx(Checkbox.Error, { children: errors });
|
|
119
|
+
$[30] = errors;
|
|
120
|
+
$[31] = t9;
|
|
121
|
+
} else t9 = $[31];
|
|
129
122
|
let t10;
|
|
130
|
-
if ($[33] !==
|
|
131
|
-
t10 = /* @__PURE__ */ jsxs(
|
|
132
|
-
className: checkbox_module_default.label,
|
|
133
|
-
children: [t8, t9]
|
|
134
|
-
});
|
|
135
|
-
$[33] = t8;
|
|
136
|
-
$[34] = t9;
|
|
137
|
-
$[35] = t10;
|
|
138
|
-
} else t10 = $[35];
|
|
139
|
-
let t11;
|
|
140
|
-
if ($[36] !== description) {
|
|
141
|
-
t11 = /* @__PURE__ */ jsx(Field$1.Description, { children: description });
|
|
142
|
-
$[36] = description;
|
|
143
|
-
$[37] = t11;
|
|
144
|
-
} else t11 = $[37];
|
|
145
|
-
let t12;
|
|
146
|
-
if ($[38] !== errors) {
|
|
147
|
-
t12 = /* @__PURE__ */ jsx(Field$1.Error, { children: errors });
|
|
148
|
-
$[38] = errors;
|
|
149
|
-
$[39] = t12;
|
|
150
|
-
} else t12 = $[39];
|
|
151
|
-
let t13;
|
|
152
|
-
if ($[40] !== dirty || $[41] !== field.disabled || $[42] !== field.invalid || $[43] !== name || $[44] !== t10 || $[45] !== t11 || $[46] !== t12 || $[47] !== t3 || $[48] !== t6 || $[49] !== touched) {
|
|
153
|
-
t13 = /* @__PURE__ */ jsxs(Field$1.Root, {
|
|
123
|
+
if ($[32] !== className || $[33] !== dirty || $[34] !== errors || $[35] !== name || $[36] !== pending || $[37] !== props.disabled || $[38] !== props.readOnly || $[39] !== requiredness || $[40] !== t1 || $[41] !== t7 || $[42] !== t8 || $[43] !== t9 || $[44] !== touched) {
|
|
124
|
+
t10 = /* @__PURE__ */ jsxs(Checkbox.Root, {
|
|
154
125
|
name,
|
|
155
|
-
className
|
|
156
|
-
disabled:
|
|
157
|
-
|
|
126
|
+
className,
|
|
127
|
+
disabled: props.disabled,
|
|
128
|
+
readOnly: props.readOnly,
|
|
129
|
+
errors,
|
|
130
|
+
requiredness,
|
|
158
131
|
dirty,
|
|
159
132
|
touched,
|
|
160
|
-
|
|
133
|
+
pending,
|
|
134
|
+
filled: t1,
|
|
161
135
|
children: [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
136
|
+
t7,
|
|
137
|
+
t8,
|
|
138
|
+
t9
|
|
165
139
|
]
|
|
166
140
|
});
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
|
|
179
|
-
|
|
141
|
+
$[32] = className;
|
|
142
|
+
$[33] = dirty;
|
|
143
|
+
$[34] = errors;
|
|
144
|
+
$[35] = name;
|
|
145
|
+
$[36] = pending;
|
|
146
|
+
$[37] = props.disabled;
|
|
147
|
+
$[38] = props.readOnly;
|
|
148
|
+
$[39] = requiredness;
|
|
149
|
+
$[40] = t1;
|
|
150
|
+
$[41] = t7;
|
|
151
|
+
$[42] = t8;
|
|
152
|
+
$[43] = t9;
|
|
153
|
+
$[44] = touched;
|
|
154
|
+
$[45] = t10;
|
|
155
|
+
} else t10 = $[45];
|
|
156
|
+
return t10;
|
|
180
157
|
};
|
|
181
158
|
export { CheckboxField };
|