@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,3 +1,4 @@
|
|
|
1
|
+
import { IconButton } from "../button/button.js";
|
|
1
2
|
import { Field } from "../field/field.js";
|
|
2
3
|
import { useFieldState } from "../field/use-field-state.js";
|
|
3
4
|
import { PhotoInput } from "./photo-input.js";
|
|
@@ -28,7 +29,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
28
29
|
* />
|
|
29
30
|
*/
|
|
30
31
|
var PhotoField = (t0) => {
|
|
31
|
-
const $ = c(
|
|
32
|
+
const $ = c(84);
|
|
32
33
|
let className;
|
|
33
34
|
let controlProps;
|
|
34
35
|
let defaultPreview;
|
|
@@ -113,150 +114,174 @@ var PhotoField = (t0) => {
|
|
|
113
114
|
} else t1 = $[26];
|
|
114
115
|
const field = useFieldState(t1);
|
|
115
116
|
const { invalid } = field;
|
|
116
|
-
|
|
117
|
-
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
-
t2 = /* @__PURE__ */ jsx("span", {});
|
|
119
|
-
$[27] = t2;
|
|
120
|
-
} else t2 = $[27];
|
|
117
|
+
const t2 = field.disabled;
|
|
121
118
|
let t3;
|
|
122
|
-
if ($[
|
|
123
|
-
t3 = /* @__PURE__ */ jsx(
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
120
|
+
t3 = /* @__PURE__ */ jsx("span", {});
|
|
121
|
+
$[27] = t3;
|
|
122
|
+
} else t3 = $[27];
|
|
123
|
+
let t4;
|
|
124
|
+
if ($[28] !== optionalLabel || $[29] !== requiredness) {
|
|
125
|
+
t4 = /* @__PURE__ */ jsx(Field.Requiredness, {
|
|
126
126
|
requiredness,
|
|
127
|
-
optionalLabel
|
|
128
|
-
render: t2,
|
|
129
|
-
children: label
|
|
127
|
+
optionalLabel
|
|
130
128
|
});
|
|
131
|
-
$[28] =
|
|
132
|
-
$[29] =
|
|
133
|
-
$[30] =
|
|
134
|
-
|
|
135
|
-
$[32] = t3;
|
|
136
|
-
} else t3 = $[32];
|
|
137
|
-
let t4;
|
|
138
|
-
if ($[33] !== description || $[34] !== ids || $[35] !== invalid) {
|
|
139
|
-
t4 = ids.describedBy(description !== void 0, invalid);
|
|
140
|
-
$[33] = description;
|
|
141
|
-
$[34] = ids;
|
|
142
|
-
$[35] = invalid;
|
|
143
|
-
$[36] = t4;
|
|
144
|
-
} else t4 = $[36];
|
|
129
|
+
$[28] = optionalLabel;
|
|
130
|
+
$[29] = requiredness;
|
|
131
|
+
$[30] = t4;
|
|
132
|
+
} else t4 = $[30];
|
|
145
133
|
let t5;
|
|
146
|
-
if ($[
|
|
147
|
-
t5 = /* @__PURE__ */
|
|
148
|
-
|
|
149
|
-
|
|
134
|
+
if ($[31] !== label || $[32] !== labelId || $[33] !== t4) {
|
|
135
|
+
t5 = /* @__PURE__ */ jsxs(Field.Label, {
|
|
136
|
+
id: labelId,
|
|
137
|
+
nativeLabel: false,
|
|
138
|
+
render: t3,
|
|
139
|
+
children: [
|
|
140
|
+
label,
|
|
141
|
+
" ",
|
|
142
|
+
t4
|
|
143
|
+
]
|
|
150
144
|
});
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
|
|
145
|
+
$[31] = label;
|
|
146
|
+
$[32] = labelId;
|
|
147
|
+
$[33] = t4;
|
|
148
|
+
$[34] = t5;
|
|
149
|
+
} else t5 = $[34];
|
|
155
150
|
let t6;
|
|
156
|
-
if ($[
|
|
157
|
-
t6 =
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
|
|
151
|
+
if ($[35] !== description || $[36] !== ids || $[37] !== invalid) {
|
|
152
|
+
t6 = ids.describedBy(description !== void 0, invalid);
|
|
153
|
+
$[35] = description;
|
|
154
|
+
$[36] = ids;
|
|
155
|
+
$[37] = invalid;
|
|
156
|
+
$[38] = t6;
|
|
157
|
+
} else t6 = $[38];
|
|
161
158
|
let t7;
|
|
162
|
-
if ($[
|
|
163
|
-
t7 = /* @__PURE__ */
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
|
|
167
|
-
} else t7 = $[44];
|
|
159
|
+
if ($[39] !== previewLabel) {
|
|
160
|
+
t7 = /* @__PURE__ */ jsx(PhotoInput.Image, { alt: previewLabel });
|
|
161
|
+
$[39] = previewLabel;
|
|
162
|
+
$[40] = t7;
|
|
163
|
+
} else t7 = $[40];
|
|
168
164
|
let t8;
|
|
169
|
-
if ($[
|
|
170
|
-
t8 = /* @__PURE__ */ jsx(PhotoInput.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
$[45] = removeIcon;
|
|
175
|
-
$[46] = removeLabel;
|
|
176
|
-
$[47] = t8;
|
|
177
|
-
} else t8 = $[47];
|
|
165
|
+
if ($[41] !== defaultPreview) {
|
|
166
|
+
t8 = /* @__PURE__ */ jsx(PhotoInput.Fallback, { children: defaultPreview });
|
|
167
|
+
$[41] = defaultPreview;
|
|
168
|
+
$[42] = t8;
|
|
169
|
+
} else t8 = $[42];
|
|
178
170
|
let t9;
|
|
179
|
-
if ($[
|
|
180
|
-
t9 = /* @__PURE__ */
|
|
171
|
+
if ($[43] !== t7 || $[44] !== t8) {
|
|
172
|
+
t9 = /* @__PURE__ */ jsxs(PhotoInput.Face, { children: [t7, t8] });
|
|
173
|
+
$[43] = t7;
|
|
174
|
+
$[44] = t8;
|
|
175
|
+
$[45] = t9;
|
|
176
|
+
} else t9 = $[45];
|
|
177
|
+
let t10;
|
|
178
|
+
if ($[46] !== icon) {
|
|
179
|
+
t10 = /* @__PURE__ */ jsx(PhotoInput.Badge, { children: icon });
|
|
180
|
+
$[46] = icon;
|
|
181
|
+
$[47] = t10;
|
|
182
|
+
} else t10 = $[47];
|
|
183
|
+
let t11;
|
|
184
|
+
if ($[48] !== t10 || $[49] !== t9) {
|
|
185
|
+
t11 = /* @__PURE__ */ jsxs(PhotoInput.Well, { children: [t9, t10] });
|
|
186
|
+
$[48] = t10;
|
|
187
|
+
$[49] = t9;
|
|
188
|
+
$[50] = t11;
|
|
189
|
+
} else t11 = $[50];
|
|
190
|
+
let t12;
|
|
191
|
+
if ($[51] !== removeIcon || $[52] !== removeLabel) {
|
|
192
|
+
t12 = /* @__PURE__ */ jsx(PhotoInput.Remove, { render: /* @__PURE__ */ jsx(IconButton, {
|
|
193
|
+
label: removeLabel,
|
|
194
|
+
variant: "secondary",
|
|
195
|
+
children: removeIcon
|
|
196
|
+
}) });
|
|
197
|
+
$[51] = removeIcon;
|
|
198
|
+
$[52] = removeLabel;
|
|
199
|
+
$[53] = t12;
|
|
200
|
+
} else t12 = $[53];
|
|
201
|
+
let t13;
|
|
202
|
+
if ($[54] !== noPhotoLabel || $[55] !== photoSetLabel) {
|
|
203
|
+
t13 = /* @__PURE__ */ jsx(PhotoInput.ValueText, {
|
|
181
204
|
photoSetLabel,
|
|
182
205
|
noPhotoLabel
|
|
183
206
|
});
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else
|
|
188
|
-
let
|
|
189
|
-
if ($[
|
|
190
|
-
|
|
207
|
+
$[54] = noPhotoLabel;
|
|
208
|
+
$[55] = photoSetLabel;
|
|
209
|
+
$[56] = t13;
|
|
210
|
+
} else t13 = $[56];
|
|
211
|
+
let t14;
|
|
212
|
+
if ($[57] !== controlProps || $[58] !== field.state.pending || $[59] !== hasStoredImage || $[60] !== invalid || $[61] !== labelId || $[62] !== readOnly || $[63] !== t11 || $[64] !== t12 || $[65] !== t13 || $[66] !== t6) {
|
|
213
|
+
t14 = /* @__PURE__ */ jsxs(PhotoInput.Root, {
|
|
191
214
|
...controlProps,
|
|
192
215
|
hasStoredImage,
|
|
193
216
|
labelledBy: labelId,
|
|
194
|
-
describedBy:
|
|
217
|
+
describedBy: t6,
|
|
195
218
|
readOnly,
|
|
196
219
|
invalid,
|
|
197
220
|
pending: field.state.pending,
|
|
198
221
|
children: [
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
222
|
+
t11,
|
|
223
|
+
t12,
|
|
224
|
+
t13
|
|
202
225
|
]
|
|
203
226
|
});
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
} else
|
|
216
|
-
let
|
|
217
|
-
if ($[
|
|
218
|
-
|
|
227
|
+
$[57] = controlProps;
|
|
228
|
+
$[58] = field.state.pending;
|
|
229
|
+
$[59] = hasStoredImage;
|
|
230
|
+
$[60] = invalid;
|
|
231
|
+
$[61] = labelId;
|
|
232
|
+
$[62] = readOnly;
|
|
233
|
+
$[63] = t11;
|
|
234
|
+
$[64] = t12;
|
|
235
|
+
$[65] = t13;
|
|
236
|
+
$[66] = t6;
|
|
237
|
+
$[67] = t14;
|
|
238
|
+
} else t14 = $[67];
|
|
239
|
+
let t15;
|
|
240
|
+
if ($[68] !== description || $[69] !== descriptionId) {
|
|
241
|
+
t15 = /* @__PURE__ */ jsx(Field.Description, {
|
|
219
242
|
id: descriptionId,
|
|
220
243
|
children: description
|
|
221
244
|
});
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
} else
|
|
226
|
-
let
|
|
227
|
-
if ($[
|
|
228
|
-
|
|
245
|
+
$[68] = description;
|
|
246
|
+
$[69] = descriptionId;
|
|
247
|
+
$[70] = t15;
|
|
248
|
+
} else t15 = $[70];
|
|
249
|
+
let t16;
|
|
250
|
+
if ($[71] !== errorId || $[72] !== errors) {
|
|
251
|
+
t16 = /* @__PURE__ */ jsx(Field.Error, {
|
|
229
252
|
id: errorId,
|
|
230
253
|
children: errors
|
|
231
254
|
});
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
} else
|
|
236
|
-
let
|
|
237
|
-
if ($[
|
|
238
|
-
|
|
255
|
+
$[71] = errorId;
|
|
256
|
+
$[72] = errors;
|
|
257
|
+
$[73] = t16;
|
|
258
|
+
} else t16 = $[73];
|
|
259
|
+
let t17;
|
|
260
|
+
if ($[74] !== className || $[75] !== dirty || $[76] !== field.disabled || $[77] !== invalid || $[78] !== t14 || $[79] !== t15 || $[80] !== t16 || $[81] !== t5 || $[82] !== touched) {
|
|
261
|
+
t17 = /* @__PURE__ */ jsxs(Field.Root, {
|
|
239
262
|
className,
|
|
263
|
+
disabled: t2,
|
|
240
264
|
invalid,
|
|
241
265
|
dirty,
|
|
242
266
|
touched,
|
|
243
267
|
children: [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
268
|
+
t5,
|
|
269
|
+
t14,
|
|
270
|
+
t15,
|
|
271
|
+
t16
|
|
248
272
|
]
|
|
249
273
|
});
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
|
|
260
|
-
|
|
274
|
+
$[74] = className;
|
|
275
|
+
$[75] = dirty;
|
|
276
|
+
$[76] = field.disabled;
|
|
277
|
+
$[77] = invalid;
|
|
278
|
+
$[78] = t14;
|
|
279
|
+
$[79] = t15;
|
|
280
|
+
$[80] = t16;
|
|
281
|
+
$[81] = t5;
|
|
282
|
+
$[82] = touched;
|
|
283
|
+
$[83] = t17;
|
|
284
|
+
} else t17 = $[83];
|
|
285
|
+
return t17;
|
|
261
286
|
};
|
|
262
287
|
export { PhotoField };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
@layer kit.reset, kit.base, kit.components;
|
|
2
2
|
@layer kit.components {
|
|
3
|
-
.
|
|
3
|
+
._photoInput_1l3vc_3 {
|
|
4
4
|
position: relative;
|
|
5
5
|
inline-size: var(--photo-input-size, var(--sys-unit-64));
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
._well_1l3vc_7 {
|
|
8
8
|
--_well-state-layer: 0;
|
|
9
9
|
position: relative;
|
|
10
10
|
display: grid;
|
|
@@ -12,97 +12,120 @@
|
|
|
12
12
|
inline-size: 100%;
|
|
13
13
|
aspect-ratio: 1;
|
|
14
14
|
margin: 0;
|
|
15
|
-
border: 1px solid var(--photo-input-border, var(--sys-color-border));
|
|
16
|
-
border-radius: var(--sys-radius-circle);
|
|
17
|
-
padding: var(--sys-unit-2);
|
|
15
|
+
border: var(--photo-input-border-width, 1px) solid var(--photo-input-border, var(--sys-color-border));
|
|
16
|
+
border-radius: var(--photo-input-radius, var(--sys-radius-circle));
|
|
17
|
+
padding: var(--photo-input-pad-y, var(--sys-unit-2)) var(--photo-input-pad-x, var(--sys-unit-2));
|
|
18
18
|
background-color: var(--photo-input-bg, var(--sys-color-surface));
|
|
19
|
-
color: var(--sys-color-text);
|
|
19
|
+
color: var(--photo-input-fg, var(--sys-color-text));
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
._well_1l3vc_7 {
|
|
23
23
|
outline: 0 solid var(--sys-color-focus-ring);
|
|
24
24
|
outline-offset: var(--sys-focus-ring-offset);
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
._well_1l3vc_7:focus-visible {
|
|
27
27
|
outline-width: var(--sys-focus-ring-width);
|
|
28
28
|
}
|
|
29
29
|
@media not (prefers-reduced-motion) {
|
|
30
|
-
.
|
|
30
|
+
._well_1l3vc_7 {
|
|
31
31
|
transition: border-color var(--sys-motion-instant) var(--sys-motion-standard), background-color var(--sys-motion-instant) var(--sys-motion-standard), outline-width var(--sys-motion-instant) var(--sys-motion-standard);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
.
|
|
34
|
+
._well_1l3vc_7:is(:hover, :focus-visible):not([data-readonly]), ._well_1l3vc_7[data-dragover] {
|
|
35
35
|
--_well-state-layer: var(--sys-state-hover);
|
|
36
36
|
border-color: var(--photo-input-active-border, var(--sys-color-primary));
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
._well_1l3vc_7[data-dragover] {
|
|
39
39
|
--_well-state-layer: var(--sys-state-dragged);
|
|
40
40
|
background-color: var(--photo-input-drop-bg, var(--sys-color-primary-container));
|
|
41
41
|
}
|
|
42
|
-
.
|
|
42
|
+
._well_1l3vc_7[data-pending] {
|
|
43
43
|
cursor: progress;
|
|
44
|
-
caret-color: var(--sys-color-text-muted);
|
|
45
|
-
}
|
|
46
|
-
.
|
|
47
|
-
--
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
--
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
caret-color: var(--field-pending-caret, var(--sys-color-text-muted));
|
|
45
|
+
}
|
|
46
|
+
._well_1l3vc_7[data-invalid] {
|
|
47
|
+
--_field-fg: var(
|
|
48
|
+
--field-invalid-fg,
|
|
49
|
+
var(--sys-color-error-fg)
|
|
50
|
+
);
|
|
51
|
+
--_field-muted-fg: var(
|
|
52
|
+
--field-invalid-muted-fg,
|
|
53
|
+
var(--field-invalid-fg, var(--sys-color-error-fg))
|
|
54
|
+
);
|
|
55
|
+
--_field-placeholder-fg: var(
|
|
56
|
+
--field-invalid-placeholder-fg,
|
|
57
|
+
var(--field-invalid-fg, var(--sys-color-error-fg))
|
|
58
|
+
);
|
|
59
|
+
--_field-fill: var(
|
|
60
|
+
--field-invalid-bg,
|
|
61
|
+
var(--sys-color-error-bg)
|
|
62
|
+
);
|
|
63
|
+
border-color: var(--field-invalid-border, var(--sys-color-error-fg));
|
|
64
|
+
background-color: var(--_field-fill);
|
|
65
|
+
color: var(--_field-fg);
|
|
66
|
+
}
|
|
67
|
+
._well_1l3vc_7[data-readonly] {
|
|
68
|
+
--_field-fg: var(
|
|
69
|
+
--field-readonly-fg,
|
|
70
|
+
var(--sys-color-text)
|
|
71
|
+
);
|
|
72
|
+
--_field-fill: var(
|
|
73
|
+
--field-readonly-bg,
|
|
74
|
+
var(--sys-color-surface-high)
|
|
75
|
+
);
|
|
76
|
+
border-style: var(--field-readonly-border-style, dashed);
|
|
77
|
+
border-color: var(--field-readonly-border, var(--sys-color-outline));
|
|
78
|
+
background: var(--_field-fill);
|
|
79
|
+
color: var(--_field-fg);
|
|
60
80
|
cursor: default;
|
|
61
81
|
}
|
|
62
|
-
.
|
|
82
|
+
._face_1l3vc_82 {
|
|
63
83
|
position: relative;
|
|
64
84
|
display: grid;
|
|
65
85
|
place-items: center;
|
|
66
86
|
overflow: hidden;
|
|
67
|
-
border-radius: var(--sys-radius-circle);
|
|
87
|
+
border-radius: var(--photo-input-radius, var(--sys-radius-circle));
|
|
68
88
|
}
|
|
69
|
-
.
|
|
89
|
+
._face_1l3vc_82::after {
|
|
70
90
|
content: "";
|
|
71
91
|
position: absolute;
|
|
72
92
|
inset: 0;
|
|
73
|
-
background-color: var(--sys-color-primary);
|
|
93
|
+
background-color: var(--photo-input-state-layer-bg, var(--sys-color-primary));
|
|
74
94
|
opacity: var(--_well-state-layer);
|
|
75
95
|
pointer-events: none;
|
|
76
96
|
}
|
|
77
|
-
.
|
|
78
|
-
.
|
|
97
|
+
._face_1l3vc_82 img,
|
|
98
|
+
._face_1l3vc_82 svg {
|
|
79
99
|
inline-size: 100%;
|
|
80
100
|
block-size: 100%;
|
|
81
101
|
object-fit: cover;
|
|
82
|
-
border-radius: var(--sys-radius-circle);
|
|
102
|
+
border-radius: var(--photo-input-radius, var(--sys-radius-circle));
|
|
83
103
|
}
|
|
84
|
-
.
|
|
104
|
+
._fallback_1l3vc_104 {
|
|
105
|
+
display: contents;
|
|
106
|
+
}
|
|
107
|
+
._badge_1l3vc_107 {
|
|
85
108
|
position: absolute;
|
|
86
109
|
inset-block-end: 0;
|
|
87
110
|
inset-inline-end: 0;
|
|
88
111
|
display: grid;
|
|
89
112
|
place-items: center;
|
|
90
|
-
inline-size: var(--sys-unit-20);
|
|
91
|
-
block-size: var(--sys-unit-20);
|
|
92
|
-
border: 3px solid var(--sys-color-surface);
|
|
93
|
-
border-radius: var(--sys-radius-circle);
|
|
113
|
+
inline-size: var(--photo-input-badge-size, var(--sys-unit-20));
|
|
114
|
+
block-size: var(--photo-input-badge-size, var(--sys-unit-20));
|
|
115
|
+
border: var(--photo-input-badge-border-width, 3px) solid var(--photo-input-badge-border, var(--sys-color-surface));
|
|
116
|
+
border-radius: var(--photo-input-badge-radius, var(--sys-radius-circle));
|
|
94
117
|
background-color: var(--photo-input-badge-bg, var(--sys-color-primary));
|
|
95
118
|
color: var(--photo-input-badge-fg, var(--sys-color-on-primary));
|
|
96
119
|
pointer-events: none;
|
|
97
120
|
}
|
|
98
|
-
.
|
|
121
|
+
._remove_1l3vc_121 {
|
|
99
122
|
position: absolute;
|
|
100
123
|
inset-block-start: 0;
|
|
101
124
|
inset-inline-end: 0;
|
|
102
|
-
border: 3px solid var(--sys-color-surface);
|
|
125
|
+
border: var(--photo-input-remove-border-width, 3px) solid var(--photo-input-remove-border, var(--sys-color-surface));
|
|
103
126
|
}
|
|
104
|
-
.
|
|
105
|
-
.
|
|
127
|
+
._picker_1l3vc_127,
|
|
128
|
+
._valueText_1l3vc_128 {
|
|
106
129
|
position: absolute;
|
|
107
130
|
overflow: hidden;
|
|
108
131
|
clip-path: inset(50%);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import { type ComponentProps, type ComponentPropsWithRef, type HTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
3
|
import { type FieldBlurHandler } from "../field/index.ts";
|
|
3
4
|
/** What the circle shows until a photo is picked: a placeholder, or the stored photo. */
|
|
4
5
|
export type PhotoInputPreviewProps = Readonly<{
|
|
@@ -43,22 +44,56 @@ export type PhotoInputWellProps = HTMLAttributes<HTMLElement>;
|
|
|
43
44
|
* Read-only, it is a focusable image that opens nothing.
|
|
44
45
|
*/
|
|
45
46
|
declare const PhotoInputWell: ({ className, ...props }: PhotoInputWellProps) => ReactNode;
|
|
46
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The picture inside the well, holding the picked photo's `Image` and the
|
|
49
|
+
* `Fallback` shown until one is picked.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* <PhotoInput.Face>
|
|
53
|
+
* <PhotoInput.Image alt="Preview" />
|
|
54
|
+
* <PhotoInput.Fallback><Avatar name={user.name} /></PhotoInput.Fallback>
|
|
55
|
+
* </PhotoInput.Face>
|
|
56
|
+
*/
|
|
57
|
+
declare const PhotoInputFace: ({ className, ...props }: ComponentProps<"span">) => ReactNode;
|
|
58
|
+
export type PhotoInputImageProps = Omit<ComponentProps<"img">, "src" | "alt"> & Readonly<{
|
|
47
59
|
/** The picked photo's alternative text, such as "Preview". */
|
|
48
|
-
|
|
60
|
+
alt: string;
|
|
49
61
|
}>;
|
|
50
|
-
/**
|
|
51
|
-
|
|
62
|
+
/**
|
|
63
|
+
* The picked photo. Renders nothing until one is picked.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* <PhotoInput.Image alt="Preview" />
|
|
67
|
+
*/
|
|
68
|
+
declare const PhotoInputImage: ({ alt, ...props }: PhotoInputImageProps) => ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* What the face shows until a photo is picked, such as a placeholder or the
|
|
71
|
+
* stored photo. Renders nothing once one is picked, or without children.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <PhotoInput.Fallback><Avatar name={user.name} /></PhotoInput.Fallback>
|
|
75
|
+
*/
|
|
76
|
+
declare const PhotoInputFallback: ({ className, children, ...props }: ComponentProps<"span">) => ReactNode;
|
|
52
77
|
/** The badge on the well's rim. Its children are the icon, such as a camera; without them, or read-only, it renders nothing. */
|
|
53
78
|
declare const PhotoInputBadge: ({ className, children, ...props }: ComponentProps<"span">) => ReactNode;
|
|
54
|
-
export type PhotoInputRemoveProps = Omit<
|
|
55
|
-
/** The button
|
|
56
|
-
|
|
57
|
-
/** The button's icon, such as a cross. */
|
|
58
|
-
icon: ReactNode;
|
|
79
|
+
export type PhotoInputRemoveProps = Omit<ComponentPropsWithRef<"button">, "children"> & Readonly<{
|
|
80
|
+
/** The button to render, such as `<IconButton label="Remove photo" variant="secondary"><CloseIcon /></IconButton>`. */
|
|
81
|
+
render: useRender.RenderProp;
|
|
59
82
|
}>;
|
|
60
|
-
/**
|
|
61
|
-
|
|
83
|
+
/**
|
|
84
|
+
* The button on the rim that removes a picked photo. It renders whichever
|
|
85
|
+
* button it is given, only while a photo is picked.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* <PhotoInput.Remove
|
|
89
|
+
* render={
|
|
90
|
+
* <IconButton label="Remove photo" variant="secondary">
|
|
91
|
+
* <CloseIcon />
|
|
92
|
+
* </IconButton>
|
|
93
|
+
* }
|
|
94
|
+
* />
|
|
95
|
+
*/
|
|
96
|
+
declare const PhotoInputRemove: ({ render, className, onClick, ...props }: PhotoInputRemoveProps) => ReactElement | null;
|
|
62
97
|
export type PhotoInputValueTextProps = Omit<ComponentProps<"span">, "children" | "id"> & Readonly<{
|
|
63
98
|
/** What the well announces while a photo is set, such as "Photo set". */
|
|
64
99
|
photoSetLabel: string;
|
|
@@ -72,6 +107,8 @@ export type PhotoInputParts = Readonly<{
|
|
|
72
107
|
Root: typeof PhotoInputRoot;
|
|
73
108
|
Well: typeof PhotoInputWell;
|
|
74
109
|
Face: typeof PhotoInputFace;
|
|
110
|
+
Image: typeof PhotoInputImage;
|
|
111
|
+
Fallback: typeof PhotoInputFallback;
|
|
75
112
|
Badge: typeof PhotoInputBadge;
|
|
76
113
|
Remove: typeof PhotoInputRemove;
|
|
77
114
|
ValueText: typeof PhotoInputValueText;
|
|
@@ -85,12 +122,19 @@ export type PhotoInputParts = Readonly<{
|
|
|
85
122
|
* @example
|
|
86
123
|
* <PhotoInput.Root labelledBy={labelId} value={file} onValueChange={setFile}>
|
|
87
124
|
* <PhotoInput.Well>
|
|
88
|
-
* <PhotoInput.Face
|
|
89
|
-
* <
|
|
125
|
+
* <PhotoInput.Face>
|
|
126
|
+
* <PhotoInput.Image alt="Preview" />
|
|
127
|
+
* <PhotoInput.Fallback><Avatar name={user.name} /></PhotoInput.Fallback>
|
|
90
128
|
* </PhotoInput.Face>
|
|
91
129
|
* <PhotoInput.Badge><PhotoCameraIcon /></PhotoInput.Badge>
|
|
92
130
|
* </PhotoInput.Well>
|
|
93
|
-
* <PhotoInput.Remove
|
|
131
|
+
* <PhotoInput.Remove
|
|
132
|
+
* render={
|
|
133
|
+
* <IconButton label="Remove photo" variant="secondary">
|
|
134
|
+
* <CloseIcon />
|
|
135
|
+
* </IconButton>
|
|
136
|
+
* }
|
|
137
|
+
* />
|
|
94
138
|
* <PhotoInput.ValueText photoSetLabel="Photo set" noPhotoLabel="No photo" />
|
|
95
139
|
* </PhotoInput.Root>
|
|
96
140
|
*/
|