@igne-agency/react-web-ui 0.5.0 → 0.6.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/dist/components/accordion/accordion.css +21 -21
- package/dist/components/accordion/accordion.d.ts +17 -4
- package/dist/components/accordion/accordion.js +83 -36
- package/dist/components/accordion/accordion.module.js +6 -6
- package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
- package/dist/components/attachment-tile/attachment-preview.js +388 -119
- package/dist/components/attachment-tile/attachment-tile.css +31 -25
- package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
- package/dist/components/attachment-tile/attachment-tile.js +160 -43
- package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/avatar/avatar.css +9 -9
- package/dist/components/avatar/avatar.d.ts +50 -5
- package/dist/components/avatar/avatar.js +178 -64
- package/dist/components/avatar/avatar.module.js +3 -3
- package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
- package/dist/components/avatar-group/avatar-group-context.js +2 -2
- package/dist/components/avatar-group/avatar-group.css +26 -20
- package/dist/components/avatar-group/avatar-group.d.ts +85 -27
- package/dist/components/avatar-group/avatar-group.js +400 -246
- package/dist/components/avatar-group/avatar-group.module.js +8 -8
- package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
- package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
- package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
- package/dist/components/button/button.css +29 -31
- package/dist/components/button/button.d.ts +20 -16
- package/dist/components/button/button.js +140 -145
- package/dist/components/button/button.module.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/checkbox-field/checkbox-field.js +63 -49
- package/dist/components/checkbox-field/checkbox.css +105 -56
- package/dist/components/checkbox-field/checkbox.d.ts +3 -2
- package/dist/components/checkbox-field/checkbox.js +12 -9
- package/dist/components/checkbox-field/checkbox.module.js +4 -4
- package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
- package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
- package/dist/components/collapsible/collapsible.css +20 -20
- package/dist/components/collapsible/collapsible.d.ts +17 -4
- package/dist/components/collapsible/collapsible.js +83 -36
- package/dist/components/collapsible/collapsible.module.js +5 -5
- package/dist/components/combobox-field/combobox-field.js +206 -158
- package/dist/components/combobox-field/combobox.css +492 -277
- package/dist/components/combobox-field/combobox.d.ts +148 -39
- package/dist/components/combobox-field/combobox.js +506 -206
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/value-state-view.css +5 -5
- package/dist/components/combobox-field/value-state-view.module.js +4 -4
- package/dist/components/composer/composer-attachments.d.ts +30 -11
- package/dist/components/composer/composer-attachments.js +45 -40
- package/dist/components/composer/composer-editor.css +40 -35
- package/dist/components/composer/composer-editor.d.ts +14 -4
- package/dist/components/composer/composer-editor.js +134 -44
- package/dist/components/composer/composer-editor.module.js +5 -5
- package/dist/components/composer/composer.css +22 -22
- package/dist/components/composer/composer.d.ts +13 -2
- package/dist/components/composer/composer.js +78 -63
- package/dist/components/composer/composer.module.js +5 -5
- package/dist/components/composer/index.d.ts +2 -2
- package/dist/components/composer/mention-text.css +5 -5
- package/dist/components/composer/mention-text.module.js +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
- package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
- package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
- package/dist/components/conversation/conversation.css +52 -52
- package/dist/components/conversation/conversation.d.ts +43 -18
- package/dist/components/conversation/conversation.js +120 -78
- package/dist/components/conversation/conversation.module.js +15 -15
- package/dist/components/date-field/date-field.d.ts +1 -1
- package/dist/components/date-field/date-field.js +202 -100
- package/dist/components/date-field/date-input.d.ts +73 -37
- package/dist/components/date-field/date-input.js +72 -45
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.js +219 -107
- package/dist/components/date-range-field/date-range-input.d.ts +84 -40
- package/dist/components/date-range-field/date-range-input.js +83 -48
- package/dist/components/dialog/dialog.css +32 -32
- package/dist/components/dialog/dialog.d.ts +8 -7
- package/dist/components/dialog/dialog.js +8 -26
- package/dist/components/dialog/dialog.module.js +6 -6
- package/dist/components/divider/divider.css +6 -6
- package/dist/components/divider/divider.d.ts +36 -2
- package/dist/components/divider/divider.js +195 -29
- package/dist/components/divider/divider.module.js +3 -3
- package/dist/components/drawer/drawer.css +55 -56
- package/dist/components/drawer/drawer.d.ts +8 -7
- package/dist/components/drawer/drawer.js +8 -26
- package/dist/components/drawer/drawer.module.js +6 -6
- package/dist/components/field/field.css +34 -24
- package/dist/components/field/field.d.ts +60 -37
- package/dist/components/field/field.js +242 -157
- package/dist/components/field/field.module.js +12 -10
- package/dist/components/field/input-parts.d.ts +11 -13
- package/dist/components/field/input-parts.js +23 -42
- package/dist/components/field-placeholder/field-placeholder.css +6 -6
- package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
- package/dist/components/fieldset/field-group.d.ts +1 -1
- package/dist/components/fieldset/field-group.js +48 -42
- package/dist/components/fieldset/fieldset-root.d.ts +1 -1
- package/dist/components/fieldset/fieldset-root.js +19 -17
- package/dist/components/fieldset/fieldset.d.ts +2 -2
- package/dist/components/fieldset/fieldset.js +2 -2
- package/dist/components/file-field/file-field.css +126 -60
- package/dist/components/file-field/file-field.js +201 -109
- package/dist/components/file-field/file-field.module.js +4 -4
- package/dist/components/file-field/file-input.d.ts +66 -40
- package/dist/components/file-field/file-input.js +188 -132
- package/dist/components/filter-bar/filter-bar.css +8 -8
- package/dist/components/filter-bar/filter-bar.d.ts +12 -3
- package/dist/components/filter-bar/filter-bar.js +23 -25
- package/dist/components/filter-bar/filter-bar.module.js +5 -5
- package/dist/components/form/form.d.ts +19 -7
- package/dist/components/form/form.js +80 -29
- package/dist/components/icon/icon.css +2 -2
- package/dist/components/icon/icon.module.js +1 -1
- package/dist/components/link/link.css +6 -5
- package/dist/components/link/link.module.js +1 -1
- package/dist/components/menu/menu.css +52 -47
- package/dist/components/menu/menu.d.ts +32 -25
- package/dist/components/menu/menu.js +75 -124
- package/dist/components/menu/menu.module.js +8 -8
- package/dist/components/nav/nav-context.d.ts +1 -1
- package/dist/components/nav/nav-item-view.d.ts +10 -13
- package/dist/components/nav/nav-item-view.js +42 -54
- package/dist/components/nav/nav.css +150 -119
- package/dist/components/nav/nav.d.ts +61 -17
- package/dist/components/nav/nav.js +271 -176
- package/dist/components/nav/nav.module.js +17 -15
- package/dist/components/number-field/number-field.css +153 -64
- package/dist/components/number-field/number-field.d.ts +2 -2
- package/dist/components/number-field/number-field.js +112 -91
- package/dist/components/number-field/number-field.module.js +6 -6
- package/dist/components/number-field/number-input.d.ts +43 -23
- package/dist/components/number-field/number-input.js +179 -125
- package/dist/components/otp-field/otp-field.css +153 -60
- package/dist/components/otp-field/otp-field.d.ts +2 -2
- package/dist/components/otp-field/otp-field.js +62 -46
- package/dist/components/otp-field/otp-field.module.js +4 -4
- package/dist/components/otp-field/otp-input.d.ts +8 -6
- package/dist/components/otp-field/otp-input.js +92 -92
- package/dist/components/pagination/pagination.d.ts +46 -15
- package/dist/components/pagination/pagination.js +217 -224
- package/dist/components/password-field/password-field.css +23 -23
- package/dist/components/password-field/password-field.js +107 -85
- package/dist/components/password-field/password-field.module.js +8 -8
- package/dist/components/password-field/password-strength.d.ts +107 -3
- package/dist/components/password-field/password-strength.js +569 -92
- package/dist/components/photo-field/photo-field.js +137 -112
- package/dist/components/photo-field/photo-input.css +67 -44
- package/dist/components/photo-field/photo-input.d.ts +59 -15
- package/dist/components/photo-field/photo-input.js +173 -86
- package/dist/components/photo-field/photo-input.module.js +10 -8
- package/dist/components/popover/popover.css +41 -41
- package/dist/components/popover/popover.d.ts +66 -25
- package/dist/components/popover/popover.js +332 -217
- package/dist/components/popover/popover.module.js +15 -19
- package/dist/components/radio-group-field/radio-group-field.js +80 -71
- package/dist/components/radio-group-field/radio-group.css +112 -60
- package/dist/components/radio-group-field/radio-group.d.ts +19 -3
- package/dist/components/radio-group-field/radio-group.js +66 -23
- package/dist/components/radio-group-field/radio-group.module.js +4 -4
- package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
- package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
- package/dist/components/segmented-control-field/segmented-control.css +132 -79
- package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
- package/dist/components/segmented-control-field/segmented-control.js +124 -41
- package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
- package/dist/components/select-field/select.css +214 -101
- package/dist/components/select-field/select.d.ts +43 -11
- package/dist/components/select-field/select.js +194 -109
- package/dist/components/select-field/select.module.js +14 -14
- package/dist/components/skeleton/skeleton.css +4 -4
- package/dist/components/skeleton/skeleton.module.js +3 -3
- package/dist/components/stale/stale.css +15 -15
- package/dist/components/stale/stale.d.ts +27 -3
- package/dist/components/stale/stale.js +147 -66
- package/dist/components/stale/stale.module.js +6 -6
- package/dist/components/status-message/status-message.css +22 -22
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/switch-field/switch-field.js +77 -57
- package/dist/components/switch-field/switch.css +112 -63
- package/dist/components/switch-field/switch.d.ts +20 -3
- package/dist/components/switch-field/switch.js +70 -27
- package/dist/components/switch-field/switch.module.js +4 -4
- package/dist/components/tabs/tabs.css +32 -32
- package/dist/components/tabs/tabs.d.ts +21 -7
- package/dist/components/tabs/tabs.js +73 -14
- package/dist/components/tabs/tabs.module.js +7 -7
- package/dist/components/tag/tag.css +84 -84
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +94 -94
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.css +159 -82
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.js +139 -110
- package/dist/components/text-field/text-field.module.js +9 -9
- package/dist/components/text-field/text-input.d.ts +81 -45
- package/dist/components/text-field/text-input.js +366 -217
- package/dist/components/textarea-field/textarea-field.css +7 -2
- package/dist/components/textarea-field/textarea-field.js +72 -56
- package/dist/components/textarea-field/textarea-field.module.js +2 -2
- package/dist/components/time-field/time-field.js +153 -60
- package/dist/components/time-field/time-input.d.ts +21 -10
- package/dist/components/time-field/time-input.js +22 -11
- package/dist/components/toast/toast-provider.css +34 -31
- package/dist/components/toast/toast-provider.d.ts +63 -14
- package/dist/components/toast/toast-provider.js +174 -111
- package/dist/components/toast/toast-provider.module.js +7 -7
- package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
- package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
- package/dist/components/toggle-group-field/toggle-group.css +117 -67
- package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group-field/toggle-group.js +2 -2
- package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/components/tooltip/tooltip.module.js +1 -1
- package/dist/data-table/data-table-content.js +6 -5
- package/dist/data-table/data-table-parts.d.ts +41 -13
- package/dist/data-table/data-table-parts.js +213 -172
- package/dist/data-table/data-table-selection.d.ts +105 -3
- package/dist/data-table/data-table-selection.js +654 -145
- package/dist/data-table/data-table.css +125 -128
- package/dist/data-table/data-table.d.ts +21 -26
- package/dist/data-table/data-table.js +20 -23
- package/dist/data-table/data-table.module.js +32 -34
- package/dist/data-table/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
- package/dist/lib/calendar/calendar-navigation.js +185 -118
- package/dist/lib/calendar/calendar-parts.d.ts +143 -0
- package/dist/lib/calendar/calendar-parts.js +540 -0
- package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
- package/dist/lib/calendar/calendar-prefab.js +311 -0
- package/dist/lib/calendar/calendar-year.d.ts +3 -1
- package/dist/lib/calendar/calendar-year.js +139 -131
- package/dist/lib/calendar/temporal.css +325 -232
- package/dist/lib/calendar/temporal.d.ts +67 -82
- package/dist/lib/calendar/temporal.js +258 -569
- package/dist/lib/calendar/temporal.module.js +38 -38
- package/dist/lib/forms/use-connected-field.d.ts +1 -1
- package/dist/lib/forms/use-connected-field.js +1 -1
- package/dist/lib/render-as.d.ts +13 -0
- package/dist/lib/render-as.js +46 -0
- package/dist/tokens.css +6 -3
- package/package.json +1 -1
- package/tokens/dark.tokens.json +6 -0
- package/tokens/sys.tokens.json +7 -0
- package/dist/components/button/close-button.d.ts +0 -16
- package/dist/components/button/close-button.js +0 -30
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Field } from "../field/field.js";
|
|
1
2
|
import { OtpInput } from "./otp-input.js";
|
|
3
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
2
4
|
import { c } from "react/compiler-runtime";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
// src/components/otp-field/otp-field.tsx
|
|
@@ -17,75 +19,89 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
17
19
|
* />
|
|
18
20
|
*/
|
|
19
21
|
var OtpField = (t0) => {
|
|
20
|
-
const $ = c(
|
|
22
|
+
const $ = c(24);
|
|
21
23
|
let description;
|
|
22
24
|
let label;
|
|
25
|
+
let optionalLabel;
|
|
23
26
|
let rootProps;
|
|
24
27
|
let slotLabel;
|
|
25
28
|
if ($[0] !== t0) {
|
|
26
|
-
({label, description, slotLabel, ...rootProps} = t0);
|
|
29
|
+
({label, description, slotLabel, optionalLabel, ...rootProps} = t0);
|
|
27
30
|
$[0] = t0;
|
|
28
31
|
$[1] = description;
|
|
29
32
|
$[2] = label;
|
|
30
|
-
$[3] =
|
|
31
|
-
$[4] =
|
|
33
|
+
$[3] = optionalLabel;
|
|
34
|
+
$[4] = rootProps;
|
|
35
|
+
$[5] = slotLabel;
|
|
32
36
|
} else {
|
|
33
37
|
description = $[1];
|
|
34
38
|
label = $[2];
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
optionalLabel = $[3];
|
|
40
|
+
rootProps = $[4];
|
|
41
|
+
slotLabel = $[5];
|
|
37
42
|
}
|
|
38
43
|
let t1;
|
|
39
|
-
if ($[
|
|
40
|
-
t1 = /* @__PURE__ */ jsx(
|
|
41
|
-
$[
|
|
42
|
-
$[
|
|
43
|
-
} else t1 = $[
|
|
44
|
+
if ($[6] !== optionalLabel) {
|
|
45
|
+
t1 = /* @__PURE__ */ jsx(Field.Requiredness, { optionalLabel });
|
|
46
|
+
$[6] = optionalLabel;
|
|
47
|
+
$[7] = t1;
|
|
48
|
+
} else t1 = $[7];
|
|
44
49
|
let t2;
|
|
45
|
-
if ($[
|
|
46
|
-
t2 = /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
if ($[8] !== label || $[9] !== t1) {
|
|
51
|
+
t2 = /* @__PURE__ */ jsxs(OtpInput.Label, { children: [
|
|
52
|
+
label,
|
|
53
|
+
" ",
|
|
54
|
+
t1
|
|
55
|
+
] });
|
|
56
|
+
$[8] = label;
|
|
57
|
+
$[9] = t1;
|
|
58
|
+
$[10] = t2;
|
|
59
|
+
} else t2 = $[10];
|
|
50
60
|
let t3;
|
|
51
|
-
if ($[
|
|
52
|
-
t3 = /* @__PURE__ */ jsx(OtpInput.
|
|
53
|
-
$[
|
|
54
|
-
|
|
61
|
+
if ($[11] !== slotLabel) {
|
|
62
|
+
t3 = /* @__PURE__ */ jsx(OtpInput.Slots, { slotLabel });
|
|
63
|
+
$[11] = slotLabel;
|
|
64
|
+
$[12] = t3;
|
|
65
|
+
} else t3 = $[12];
|
|
55
66
|
let t4;
|
|
56
|
-
if ($[
|
|
57
|
-
t4 = /* @__PURE__ */
|
|
58
|
-
$[
|
|
59
|
-
|
|
60
|
-
} else t4 = $[11];
|
|
67
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
68
|
+
t4 = /* @__PURE__ */ jsx(OtpInput.Pending, { children: /* @__PURE__ */ jsx(Spinner, { size: 1 }) });
|
|
69
|
+
$[13] = t4;
|
|
70
|
+
} else t4 = $[13];
|
|
61
71
|
let t5;
|
|
62
|
-
if ($[
|
|
63
|
-
t5 = /* @__PURE__ */
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
} else t5 = $[
|
|
72
|
+
if ($[14] !== t3) {
|
|
73
|
+
t5 = /* @__PURE__ */ jsxs(OtpInput.Group, { children: [t3, t4] });
|
|
74
|
+
$[14] = t3;
|
|
75
|
+
$[15] = t5;
|
|
76
|
+
} else t5 = $[15];
|
|
67
77
|
let t6;
|
|
68
|
-
if ($[
|
|
69
|
-
t6 = /* @__PURE__ */ jsx(OtpInput.
|
|
70
|
-
$[
|
|
71
|
-
|
|
78
|
+
if ($[16] !== description) {
|
|
79
|
+
t6 = /* @__PURE__ */ jsx(OtpInput.Description, { children: description });
|
|
80
|
+
$[16] = description;
|
|
81
|
+
$[17] = t6;
|
|
82
|
+
} else t6 = $[17];
|
|
72
83
|
let t7;
|
|
73
|
-
if ($[
|
|
74
|
-
t7 = /* @__PURE__ */
|
|
84
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
85
|
+
t7 = /* @__PURE__ */ jsx(OtpInput.Error, {});
|
|
86
|
+
$[18] = t7;
|
|
87
|
+
} else t7 = $[18];
|
|
88
|
+
let t8;
|
|
89
|
+
if ($[19] !== rootProps || $[20] !== t2 || $[21] !== t5 || $[22] !== t6) {
|
|
90
|
+
t8 = /* @__PURE__ */ jsxs(OtpInput.Root, {
|
|
75
91
|
...rootProps,
|
|
76
92
|
children: [
|
|
77
|
-
|
|
78
|
-
t4,
|
|
93
|
+
t2,
|
|
79
94
|
t5,
|
|
80
|
-
t6
|
|
95
|
+
t6,
|
|
96
|
+
t7
|
|
81
97
|
]
|
|
82
98
|
});
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
} else
|
|
89
|
-
return
|
|
99
|
+
$[19] = rootProps;
|
|
100
|
+
$[20] = t2;
|
|
101
|
+
$[21] = t5;
|
|
102
|
+
$[22] = t6;
|
|
103
|
+
$[23] = t8;
|
|
104
|
+
} else t8 = $[23];
|
|
105
|
+
return t8;
|
|
90
106
|
};
|
|
91
107
|
export { OtpField };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './otp-field.css';// src/components/otp-field/otp-field.module.scss
|
|
2
|
-
var root = "
|
|
3
|
-
var group = "
|
|
4
|
-
var slot = "
|
|
5
|
-
var separator = "
|
|
2
|
+
var root = "_root_1dlq9_3";
|
|
3
|
+
var group = "_group_1dlq9_6";
|
|
4
|
+
var slot = "_slot_1dlq9_12";
|
|
5
|
+
var separator = "_separator_1dlq9_185";
|
|
6
6
|
var otp_field_module_default = {
|
|
7
7
|
root,
|
|
8
8
|
group,
|
|
@@ -4,7 +4,7 @@ import { Field, type FieldProps, type FieldState } from "../field/index.ts";
|
|
|
4
4
|
import { InputError, type InputErrorProps, InputLabel, type InputLabelProps, InputPending, type InputPendingProps } from "../field/input-parts.tsx";
|
|
5
5
|
import { type OtpInputBaseProps } from "./otp-input-context.ts";
|
|
6
6
|
export type { OtpInputBaseProps };
|
|
7
|
-
export type OtpInputRootProps = Omit<FieldProps, "label" | "description"> & OtpInputBaseProps & Readonly<{
|
|
7
|
+
export type OtpInputRootProps = Omit<FieldProps, "label" | "description" | "optionalLabel"> & OtpInputBaseProps & Readonly<{
|
|
8
8
|
value: string;
|
|
9
9
|
onValueChange: (value: string) => void;
|
|
10
10
|
/** Number of character slots. @default 6 */
|
|
@@ -19,9 +19,9 @@ export type OtpInputRootProps = Omit<FieldProps, "label" | "description"> & OtpI
|
|
|
19
19
|
* projecting its state onto every part.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
|
-
* <OtpInput.Root value={code} onValueChange={setCode}
|
|
22
|
+
* <OtpInput.Root value={code} onValueChange={setCode}>…</OtpInput.Root>
|
|
23
23
|
*/
|
|
24
|
-
declare const OtpInputRoot: ({ length, requiredness,
|
|
24
|
+
declare const OtpInputRoot: ({ length, requiredness, errors, dirty, touched, pending, state, className, children, ...base }: OtpInputRootProps) => ReactNode;
|
|
25
25
|
export type OtpInputLabelProps = InputLabelProps;
|
|
26
26
|
export type OtpInputGroupProps = Omit<BaseOTPField.Root.Props, keyof OtpInputBaseProps | "className" | "value" | "defaultValue" | "onValueChange" | "length"> & Readonly<{
|
|
27
27
|
className?: string;
|
|
@@ -89,11 +89,13 @@ export type OtpInputParts = Readonly<{
|
|
|
89
89
|
* given.
|
|
90
90
|
*
|
|
91
91
|
* @example
|
|
92
|
-
* <OtpInput.Root value={code} onValueChange={setCode}
|
|
93
|
-
* <OtpInput.Label>Verification code
|
|
92
|
+
* <OtpInput.Root value={code} onValueChange={setCode} requiredness="optional">
|
|
93
|
+
* <OtpInput.Label>Verification code <Field.Requiredness optionalLabel="optional" /></OtpInput.Label>
|
|
94
94
|
* <OtpInput.Group>
|
|
95
95
|
* <OtpInput.Slots slotLabel={(index, total) => `character ${index} of ${total}`} />
|
|
96
|
-
* <OtpInput.Pending
|
|
96
|
+
* <OtpInput.Pending>
|
|
97
|
+
* <Spinner size={1} />
|
|
98
|
+
* </OtpInput.Pending>
|
|
97
99
|
* </OtpInput.Group>
|
|
98
100
|
* <OtpInput.Error />
|
|
99
101
|
* </OtpInput.Root>
|
|
@@ -16,53 +16,50 @@ var DEFAULT_LENGTH = 6;
|
|
|
16
16
|
* projecting its state onto every part.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
|
-
* <OtpInput.Root value={code} onValueChange={setCode}
|
|
19
|
+
* <OtpInput.Root value={code} onValueChange={setCode}>…</OtpInput.Root>
|
|
20
20
|
*/
|
|
21
21
|
var OtpInputRoot = (t0) => {
|
|
22
|
-
const $ = c(
|
|
22
|
+
const $ = c(52);
|
|
23
23
|
let base;
|
|
24
24
|
let children;
|
|
25
25
|
let className;
|
|
26
26
|
let dirty;
|
|
27
27
|
let errors;
|
|
28
|
-
let optionalLabel;
|
|
29
28
|
let requiredness;
|
|
30
29
|
let state;
|
|
31
30
|
let t1;
|
|
32
31
|
let t2;
|
|
33
32
|
let touched;
|
|
34
33
|
if ($[0] !== t0) {
|
|
35
|
-
({length: t1, requiredness,
|
|
34
|
+
({length: t1, requiredness, errors, dirty, touched, pending: t2, state, className, children, ...base} = t0);
|
|
36
35
|
$[0] = t0;
|
|
37
36
|
$[1] = base;
|
|
38
37
|
$[2] = children;
|
|
39
38
|
$[3] = className;
|
|
40
39
|
$[4] = dirty;
|
|
41
40
|
$[5] = errors;
|
|
42
|
-
$[6] =
|
|
43
|
-
$[7] =
|
|
44
|
-
$[8] =
|
|
45
|
-
$[9] =
|
|
46
|
-
$[10] =
|
|
47
|
-
$[11] = touched;
|
|
41
|
+
$[6] = requiredness;
|
|
42
|
+
$[7] = state;
|
|
43
|
+
$[8] = t1;
|
|
44
|
+
$[9] = t2;
|
|
45
|
+
$[10] = touched;
|
|
48
46
|
} else {
|
|
49
47
|
base = $[1];
|
|
50
48
|
children = $[2];
|
|
51
49
|
className = $[3];
|
|
52
50
|
dirty = $[4];
|
|
53
51
|
errors = $[5];
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
touched = $[11];
|
|
52
|
+
requiredness = $[6];
|
|
53
|
+
state = $[7];
|
|
54
|
+
t1 = $[8];
|
|
55
|
+
t2 = $[9];
|
|
56
|
+
touched = $[10];
|
|
60
57
|
}
|
|
61
58
|
const length = t1 === void 0 ? DEFAULT_LENGTH : t1;
|
|
62
59
|
const pending = t2 === void 0 ? false : t2;
|
|
63
60
|
const t3 = base.value !== "";
|
|
64
61
|
let t4;
|
|
65
|
-
if ($[
|
|
62
|
+
if ($[11] !== base.disabled || $[12] !== base.readOnly || $[13] !== dirty || $[14] !== errors || $[15] !== pending || $[16] !== requiredness || $[17] !== state || $[18] !== t3 || $[19] !== touched) {
|
|
66
63
|
t4 = {
|
|
67
64
|
errors,
|
|
68
65
|
requiredness,
|
|
@@ -74,111 +71,112 @@ var OtpInputRoot = (t0) => {
|
|
|
74
71
|
filled: t3,
|
|
75
72
|
state
|
|
76
73
|
};
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
} else t4 = $[
|
|
74
|
+
$[11] = base.disabled;
|
|
75
|
+
$[12] = base.readOnly;
|
|
76
|
+
$[13] = dirty;
|
|
77
|
+
$[14] = errors;
|
|
78
|
+
$[15] = pending;
|
|
79
|
+
$[16] = requiredness;
|
|
80
|
+
$[17] = state;
|
|
81
|
+
$[18] = t3;
|
|
82
|
+
$[19] = touched;
|
|
83
|
+
$[20] = t4;
|
|
84
|
+
} else t4 = $[20];
|
|
88
85
|
const field = useFieldState(t4);
|
|
89
86
|
let t5;
|
|
90
|
-
if ($[
|
|
87
|
+
if ($[21] !== errors || $[22] !== field.phase || $[23] !== field.state) {
|
|
91
88
|
t5 = {
|
|
92
89
|
state: field.state,
|
|
93
90
|
errors,
|
|
94
|
-
optionalLabel,
|
|
95
91
|
phase: field.phase
|
|
96
92
|
};
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
|
|
102
|
-
} else t5 = $[26];
|
|
93
|
+
$[21] = errors;
|
|
94
|
+
$[22] = field.phase;
|
|
95
|
+
$[23] = field.state;
|
|
96
|
+
$[24] = t5;
|
|
97
|
+
} else t5 = $[24];
|
|
103
98
|
let t6;
|
|
104
|
-
if ($[
|
|
99
|
+
if ($[25] !== base || $[26] !== field.disabled || $[27] !== length) {
|
|
105
100
|
t6 = {
|
|
106
101
|
...base,
|
|
107
102
|
disabled: field.disabled,
|
|
108
103
|
length
|
|
109
104
|
};
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
} else t6 = $[
|
|
105
|
+
$[25] = base;
|
|
106
|
+
$[26] = field.disabled;
|
|
107
|
+
$[27] = length;
|
|
108
|
+
$[28] = t6;
|
|
109
|
+
} else t6 = $[28];
|
|
115
110
|
let t7;
|
|
116
|
-
if ($[
|
|
111
|
+
if ($[29] !== field.state || $[30] !== length || $[31] !== t6) {
|
|
117
112
|
t7 = {
|
|
118
113
|
state: field.state,
|
|
119
114
|
length,
|
|
120
115
|
base: t6
|
|
121
116
|
};
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
} else t7 = $[
|
|
117
|
+
$[29] = field.state;
|
|
118
|
+
$[30] = length;
|
|
119
|
+
$[31] = t6;
|
|
120
|
+
$[32] = t7;
|
|
121
|
+
} else t7 = $[32];
|
|
127
122
|
const t8 = field.disabled;
|
|
128
123
|
const t9 = field.invalid;
|
|
129
|
-
|
|
130
|
-
if ($[35] !== className) {
|
|
131
|
-
t10 = clsx(otp_field_module_default.root, className);
|
|
132
|
-
$[35] = className;
|
|
133
|
-
$[36] = t10;
|
|
134
|
-
} else t10 = $[36];
|
|
124
|
+
const t10 = field.state.requiredness;
|
|
135
125
|
let t11;
|
|
136
|
-
if ($[
|
|
137
|
-
t11 =
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
} else t11 = $[
|
|
126
|
+
if ($[33] !== className) {
|
|
127
|
+
t11 = clsx(otp_field_module_default.root, className);
|
|
128
|
+
$[33] = className;
|
|
129
|
+
$[34] = t11;
|
|
130
|
+
} else t11 = $[34];
|
|
141
131
|
let t12;
|
|
142
|
-
if ($[
|
|
143
|
-
t12 =
|
|
132
|
+
if ($[35] !== field.state) {
|
|
133
|
+
t12 = fieldStateAttributes(field.state);
|
|
134
|
+
$[35] = field.state;
|
|
135
|
+
$[36] = t12;
|
|
136
|
+
} else t12 = $[36];
|
|
137
|
+
let t13;
|
|
138
|
+
if ($[37] !== children || $[38] !== dirty || $[39] !== field.disabled || $[40] !== field.invalid || $[41] !== field.state.requiredness || $[42] !== t11 || $[43] !== t12 || $[44] !== touched) {
|
|
139
|
+
t13 = /* @__PURE__ */ jsx(Field.Root, {
|
|
144
140
|
disabled: t8,
|
|
145
141
|
invalid: t9,
|
|
142
|
+
requiredness: t10,
|
|
146
143
|
dirty,
|
|
147
144
|
touched,
|
|
148
|
-
className:
|
|
149
|
-
...
|
|
145
|
+
className: t11,
|
|
146
|
+
...t12,
|
|
150
147
|
children
|
|
151
148
|
});
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
149
|
+
$[37] = children;
|
|
150
|
+
$[38] = dirty;
|
|
151
|
+
$[39] = field.disabled;
|
|
152
|
+
$[40] = field.invalid;
|
|
153
|
+
$[41] = field.state.requiredness;
|
|
154
|
+
$[42] = t11;
|
|
155
|
+
$[43] = t12;
|
|
156
|
+
$[44] = touched;
|
|
157
|
+
$[45] = t13;
|
|
158
|
+
} else t13 = $[45];
|
|
159
|
+
let t14;
|
|
160
|
+
if ($[46] !== t13 || $[47] !== t7) {
|
|
161
|
+
t14 = /* @__PURE__ */ jsx(OtpInputContext, {
|
|
164
162
|
value: t7,
|
|
165
|
-
children:
|
|
163
|
+
children: t13
|
|
166
164
|
});
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
} else
|
|
171
|
-
let
|
|
172
|
-
if ($[
|
|
173
|
-
|
|
165
|
+
$[46] = t13;
|
|
166
|
+
$[47] = t7;
|
|
167
|
+
$[48] = t14;
|
|
168
|
+
} else t14 = $[48];
|
|
169
|
+
let t15;
|
|
170
|
+
if ($[49] !== t14 || $[50] !== t5) {
|
|
171
|
+
t15 = /* @__PURE__ */ jsx(InputPartsContext, {
|
|
174
172
|
value: t5,
|
|
175
|
-
children:
|
|
173
|
+
children: t14
|
|
176
174
|
});
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else
|
|
181
|
-
return
|
|
175
|
+
$[49] = t14;
|
|
176
|
+
$[50] = t5;
|
|
177
|
+
$[51] = t15;
|
|
178
|
+
} else t15 = $[51];
|
|
179
|
+
return t15;
|
|
182
180
|
};
|
|
183
181
|
/**
|
|
184
182
|
* The row of character slots, bound to `Root`'s value.
|
|
@@ -343,11 +341,13 @@ var OtpInputSlots = (t0) => {
|
|
|
343
341
|
* given.
|
|
344
342
|
*
|
|
345
343
|
* @example
|
|
346
|
-
* <OtpInput.Root value={code} onValueChange={setCode}
|
|
347
|
-
* <OtpInput.Label>Verification code
|
|
344
|
+
* <OtpInput.Root value={code} onValueChange={setCode} requiredness="optional">
|
|
345
|
+
* <OtpInput.Label>Verification code <Field.Requiredness optionalLabel="optional" /></OtpInput.Label>
|
|
348
346
|
* <OtpInput.Group>
|
|
349
347
|
* <OtpInput.Slots slotLabel={(index, total) => `character ${index} of ${total}`} />
|
|
350
|
-
* <OtpInput.Pending
|
|
348
|
+
* <OtpInput.Pending>
|
|
349
|
+
* <Spinner size={1} />
|
|
350
|
+
* </OtpInput.Pending>
|
|
351
351
|
* </OtpInput.Group>
|
|
352
352
|
* <OtpInput.Error />
|
|
353
353
|
* </OtpInput.Root>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
3
|
import { type PaginationPage } from "./pagination-context.ts";
|
|
4
4
|
export type { PaginationPage };
|
|
5
5
|
export type PaginationRootProps = useRender.ComponentProps<"div"> & PaginationPage & Readonly<{
|
|
@@ -27,19 +27,41 @@ export type PaginationIndexProps = Omit<useRender.ComponentProps<"span">, "child
|
|
|
27
27
|
}>;
|
|
28
28
|
/** Which page is on screen, as a polite live region. */
|
|
29
29
|
declare const PaginationIndex: ({ label, render, className, ref, ...props }: PaginationIndexProps) => ReactElement;
|
|
30
|
-
export type PaginationStepProps = Omit<
|
|
31
|
-
/** The button
|
|
32
|
-
|
|
33
|
-
/** The glyph, such as a chevron. */
|
|
34
|
-
children: ReactNode;
|
|
30
|
+
export type PaginationStepProps = Omit<ComponentPropsWithRef<"button">, "children"> & Readonly<{
|
|
31
|
+
/** The button to render, such as `<IconButton label="Next page" variant="tertiary"><ChevronRightIcon /></IconButton>`. */
|
|
32
|
+
render: useRender.RenderProp;
|
|
35
33
|
}>;
|
|
36
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Goes to the first page; marked `aria-disabled`, and kept in the tab order, on
|
|
36
|
+
* the first page. It renders whichever button it is given.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <Pagination.First render={<IconButton label="First page" variant="tertiary"><FirstPageIcon /></IconButton>} />
|
|
40
|
+
*/
|
|
37
41
|
declare const PaginationFirst: (props: PaginationStepProps) => ReactNode;
|
|
38
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Goes back a page; marked `aria-disabled`, and kept in the tab order, on the
|
|
44
|
+
* first page. It renders whichever button it is given.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <Pagination.Previous render={<IconButton label="Previous page" variant="tertiary"><ChevronLeftIcon /></IconButton>} />
|
|
48
|
+
*/
|
|
39
49
|
declare const PaginationPrevious: (props: PaginationStepProps) => ReactNode;
|
|
40
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Goes on a page; marked `aria-disabled`, and kept in the tab order, on the
|
|
52
|
+
* last page. It renders whichever button it is given.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* <Pagination.Next render={<IconButton label="Next page" variant="tertiary"><ChevronRightIcon /></IconButton>} />
|
|
56
|
+
*/
|
|
41
57
|
declare const PaginationNext: (props: PaginationStepProps) => ReactNode;
|
|
42
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Goes to the last page; marked `aria-disabled`, and kept in the tab order, on
|
|
60
|
+
* the last page. It renders whichever button it is given.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* <Pagination.Last render={<IconButton label="Last page" variant="tertiary"><LastPageIcon /></IconButton>} />
|
|
64
|
+
*/
|
|
43
65
|
declare const PaginationLast: (props: PaginationStepProps) => ReactNode;
|
|
44
66
|
/** The step buttons' names and glyphs. */
|
|
45
67
|
export type PaginationStepLabels = Readonly<{
|
|
@@ -60,9 +82,17 @@ export type PaginationStepLabels = Readonly<{
|
|
|
60
82
|
/** The last-page button's glyph. */
|
|
61
83
|
lastIcon: ReactNode;
|
|
62
84
|
}>;
|
|
63
|
-
export type PaginationControlsProps =
|
|
64
|
-
/**
|
|
65
|
-
|
|
85
|
+
export type PaginationControlsProps = useRender.ComponentProps<"div">;
|
|
86
|
+
/**
|
|
87
|
+
* The step buttons it is given, `First`, `Previous`, `Next` and `Last`, in a row.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* <Pagination.Controls>
|
|
91
|
+
* <Pagination.Previous render={previousButton} />
|
|
92
|
+
* <Pagination.Next render={nextButton} />
|
|
93
|
+
* </Pagination.Controls>
|
|
94
|
+
*/
|
|
95
|
+
declare const PaginationControls: ({ render, className, ref, ...props }: PaginationControlsProps) => ReactElement;
|
|
66
96
|
/** What the ready-made pager says and shows, besides where the list stands. */
|
|
67
97
|
export type PaginationContentProps = PaginationStepLabels & Readonly<{
|
|
68
98
|
/** The page-size field's label, such as "Rows per page". */
|
|
@@ -92,8 +122,9 @@ export type PaginationParts = typeof Prefab & Readonly<{
|
|
|
92
122
|
* The pager for a paged list, over any source: the page size, which page is on
|
|
93
123
|
* screen, and buttons to the first, previous, next and last page. Its parts
|
|
94
124
|
* compose another pager: `Root` holds where the list stands, `PageSize` picks
|
|
95
|
-
* rows per page, `Index` says which page is on screen, and `
|
|
96
|
-
* `
|
|
125
|
+
* rows per page, `Index` says which page is on screen, and `First`, `Previous`,
|
|
126
|
+
* `Next` and `Last`, each rendering the button it is given, step through the
|
|
127
|
+
* pages, in a `Controls` row or on their own.
|
|
97
128
|
*
|
|
98
129
|
* @example
|
|
99
130
|
* <Pagination
|