@igne-agency/react-web-ui 0.4.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/base.css +3 -0
- 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/terrazzo/index.d.ts +4 -3
- package/dist/terrazzo/index.js +17 -6
- package/dist/tokens.css +28 -4
- package/package.json +2 -2
- 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
|
@@ -18,108 +18,222 @@ var toneOf = (name) => {
|
|
|
18
18
|
return hash;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* stands for is always beside it, so it is not announced. Other props go to
|
|
24
|
-
* the `<span>`.
|
|
21
|
+
* The circle, in a colour that stays the same for the same `name`. Decorative:
|
|
22
|
+
* the name it stands for is always beside it, so it is not announced.
|
|
25
23
|
*
|
|
26
24
|
* @example
|
|
27
|
-
* <Avatar name="Ada Lovelace"
|
|
25
|
+
* <Avatar.Root name="Ada Lovelace">
|
|
26
|
+
* <Avatar.Image src={colleague.portraitUrl} />
|
|
27
|
+
* <Avatar.Fallback>AL</Avatar.Fallback>
|
|
28
|
+
* </Avatar.Root>
|
|
28
29
|
*/
|
|
29
|
-
var
|
|
30
|
-
const $ = c(
|
|
30
|
+
var Root = (t0) => {
|
|
31
|
+
const $ = c(18);
|
|
31
32
|
let className;
|
|
32
33
|
let inlineStyle;
|
|
33
34
|
let name;
|
|
34
35
|
let props;
|
|
35
|
-
let src;
|
|
36
36
|
let t1;
|
|
37
37
|
if ($[0] !== t0) {
|
|
38
|
-
({name,
|
|
38
|
+
({name, size: t1, className, style: inlineStyle, ...props} = t0);
|
|
39
39
|
$[0] = t0;
|
|
40
40
|
$[1] = className;
|
|
41
41
|
$[2] = inlineStyle;
|
|
42
42
|
$[3] = name;
|
|
43
43
|
$[4] = props;
|
|
44
|
-
$[5] =
|
|
45
|
-
$[6] = t1;
|
|
44
|
+
$[5] = t1;
|
|
46
45
|
} else {
|
|
47
46
|
className = $[1];
|
|
48
47
|
inlineStyle = $[2];
|
|
49
48
|
name = $[3];
|
|
50
49
|
props = $[4];
|
|
51
|
-
|
|
52
|
-
t1 = $[6];
|
|
50
|
+
t1 = $[5];
|
|
53
51
|
}
|
|
54
52
|
const size = t1 === void 0 ? 2.5 : t1;
|
|
55
53
|
let t2;
|
|
56
|
-
if ($[
|
|
54
|
+
if ($[6] !== className) {
|
|
57
55
|
t2 = clsx(avatar_module_default.avatar, className);
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
} else t2 = $[
|
|
56
|
+
$[6] = className;
|
|
57
|
+
$[7] = t2;
|
|
58
|
+
} else t2 = $[7];
|
|
61
59
|
const t3 = `${size * INITIALS_RATIO}em`;
|
|
62
60
|
let t4;
|
|
63
|
-
if ($[
|
|
61
|
+
if ($[8] !== inlineStyle || $[9] !== t3) {
|
|
64
62
|
t4 = {
|
|
65
63
|
fontSize: t3,
|
|
66
64
|
inlineSize: `${1 / INITIALS_RATIO}em`,
|
|
67
65
|
blockSize: `${1 / INITIALS_RATIO}em`,
|
|
68
66
|
...inlineStyle
|
|
69
67
|
};
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
} else t4 = $[
|
|
68
|
+
$[8] = inlineStyle;
|
|
69
|
+
$[9] = t3;
|
|
70
|
+
$[10] = t4;
|
|
71
|
+
} else t4 = $[10];
|
|
74
72
|
let t5;
|
|
75
|
-
if ($[
|
|
73
|
+
if ($[11] !== name) {
|
|
76
74
|
t5 = toneOf(name);
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
} else t5 = $[
|
|
75
|
+
$[11] = name;
|
|
76
|
+
$[12] = t5;
|
|
77
|
+
} else t5 = $[12];
|
|
80
78
|
let t6;
|
|
81
|
-
if ($[14] !==
|
|
82
|
-
t6 =
|
|
83
|
-
src,
|
|
84
|
-
alt: "",
|
|
85
|
-
className: avatar_module_default.image
|
|
86
|
-
});
|
|
87
|
-
$[14] = src;
|
|
88
|
-
$[15] = t6;
|
|
89
|
-
} else t6 = $[15];
|
|
90
|
-
let t7;
|
|
91
|
-
if ($[16] !== name) {
|
|
92
|
-
t7 = initialsOf(name);
|
|
93
|
-
$[16] = name;
|
|
94
|
-
$[17] = t7;
|
|
95
|
-
} else t7 = $[17];
|
|
96
|
-
let t8;
|
|
97
|
-
if ($[18] !== t7) {
|
|
98
|
-
t8 = /* @__PURE__ */ jsx(Avatar.Fallback, {
|
|
99
|
-
className: avatar_module_default.fallback,
|
|
100
|
-
children: t7
|
|
101
|
-
});
|
|
102
|
-
$[18] = t7;
|
|
103
|
-
$[19] = t8;
|
|
104
|
-
} else t8 = $[19];
|
|
105
|
-
let t9;
|
|
106
|
-
if ($[20] !== props || $[21] !== t2 || $[22] !== t4 || $[23] !== t5 || $[24] !== t6 || $[25] !== t8) {
|
|
107
|
-
t9 = /* @__PURE__ */ jsxs(Avatar.Root, {
|
|
79
|
+
if ($[13] !== props || $[14] !== t2 || $[15] !== t4 || $[16] !== t5) {
|
|
80
|
+
t6 = /* @__PURE__ */ jsx(Avatar.Root, {
|
|
108
81
|
...props,
|
|
109
82
|
className: t2,
|
|
110
83
|
style: t4,
|
|
111
84
|
"data-tone": t5,
|
|
112
|
-
"aria-hidden": "true"
|
|
113
|
-
|
|
85
|
+
"aria-hidden": "true"
|
|
86
|
+
});
|
|
87
|
+
$[13] = props;
|
|
88
|
+
$[14] = t2;
|
|
89
|
+
$[15] = t4;
|
|
90
|
+
$[16] = t5;
|
|
91
|
+
$[17] = t6;
|
|
92
|
+
} else t6 = $[17];
|
|
93
|
+
return t6;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The portrait, shown once it has loaded.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* <Avatar.Image src={colleague.portraitUrl} />
|
|
100
|
+
*/
|
|
101
|
+
var Image = (t0) => {
|
|
102
|
+
const $ = c(10);
|
|
103
|
+
let className;
|
|
104
|
+
let props;
|
|
105
|
+
let t1;
|
|
106
|
+
if ($[0] !== t0) {
|
|
107
|
+
({alt: t1, className, ...props} = t0);
|
|
108
|
+
$[0] = t0;
|
|
109
|
+
$[1] = className;
|
|
110
|
+
$[2] = props;
|
|
111
|
+
$[3] = t1;
|
|
112
|
+
} else {
|
|
113
|
+
className = $[1];
|
|
114
|
+
props = $[2];
|
|
115
|
+
t1 = $[3];
|
|
116
|
+
}
|
|
117
|
+
const alt = t1 === void 0 ? "" : t1;
|
|
118
|
+
let t2;
|
|
119
|
+
if ($[4] !== className) {
|
|
120
|
+
t2 = clsx(avatar_module_default.image, className);
|
|
121
|
+
$[4] = className;
|
|
122
|
+
$[5] = t2;
|
|
123
|
+
} else t2 = $[5];
|
|
124
|
+
let t3;
|
|
125
|
+
if ($[6] !== alt || $[7] !== props || $[8] !== t2) {
|
|
126
|
+
t3 = /* @__PURE__ */ jsx(Avatar.Image, {
|
|
127
|
+
...props,
|
|
128
|
+
alt,
|
|
129
|
+
className: t2
|
|
114
130
|
});
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
$[26] = t9;
|
|
122
|
-
} else t9 = $[26];
|
|
123
|
-
return t9;
|
|
131
|
+
$[6] = alt;
|
|
132
|
+
$[7] = props;
|
|
133
|
+
$[8] = t2;
|
|
134
|
+
$[9] = t3;
|
|
135
|
+
} else t3 = $[9];
|
|
136
|
+
return t3;
|
|
124
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* What shows while there is no portrait, or while it loads or fails, such as
|
|
140
|
+
* the initials.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* <Avatar.Fallback>AL</Avatar.Fallback>
|
|
144
|
+
*/
|
|
145
|
+
var Fallback = (t0) => {
|
|
146
|
+
const $ = c(8);
|
|
147
|
+
let className;
|
|
148
|
+
let props;
|
|
149
|
+
if ($[0] !== t0) {
|
|
150
|
+
({className, ...props} = t0);
|
|
151
|
+
$[0] = t0;
|
|
152
|
+
$[1] = className;
|
|
153
|
+
$[2] = props;
|
|
154
|
+
} else {
|
|
155
|
+
className = $[1];
|
|
156
|
+
props = $[2];
|
|
157
|
+
}
|
|
158
|
+
let t1;
|
|
159
|
+
if ($[3] !== className) {
|
|
160
|
+
t1 = clsx(avatar_module_default.fallback, className);
|
|
161
|
+
$[3] = className;
|
|
162
|
+
$[4] = t1;
|
|
163
|
+
} else t1 = $[4];
|
|
164
|
+
let t2;
|
|
165
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
166
|
+
t2 = /* @__PURE__ */ jsx(Avatar.Fallback, {
|
|
167
|
+
...props,
|
|
168
|
+
className: t1
|
|
169
|
+
});
|
|
170
|
+
$[5] = props;
|
|
171
|
+
$[6] = t1;
|
|
172
|
+
$[7] = t2;
|
|
173
|
+
} else t2 = $[7];
|
|
174
|
+
return t2;
|
|
175
|
+
};
|
|
176
|
+
var Prefab = (t0) => {
|
|
177
|
+
const $ = c(15);
|
|
178
|
+
let name;
|
|
179
|
+
let props;
|
|
180
|
+
let src;
|
|
181
|
+
if ($[0] !== t0) {
|
|
182
|
+
({name, src, ...props} = t0);
|
|
183
|
+
$[0] = t0;
|
|
184
|
+
$[1] = name;
|
|
185
|
+
$[2] = props;
|
|
186
|
+
$[3] = src;
|
|
187
|
+
} else {
|
|
188
|
+
name = $[1];
|
|
189
|
+
props = $[2];
|
|
190
|
+
src = $[3];
|
|
191
|
+
}
|
|
192
|
+
let t1;
|
|
193
|
+
if ($[4] !== src) {
|
|
194
|
+
t1 = src === void 0 ? null : /* @__PURE__ */ jsx(Image, { src });
|
|
195
|
+
$[4] = src;
|
|
196
|
+
$[5] = t1;
|
|
197
|
+
} else t1 = $[5];
|
|
198
|
+
let t2;
|
|
199
|
+
if ($[6] !== name) {
|
|
200
|
+
t2 = initialsOf(name);
|
|
201
|
+
$[6] = name;
|
|
202
|
+
$[7] = t2;
|
|
203
|
+
} else t2 = $[7];
|
|
204
|
+
let t3;
|
|
205
|
+
if ($[8] !== t2) {
|
|
206
|
+
t3 = /* @__PURE__ */ jsx(Fallback, { children: t2 });
|
|
207
|
+
$[8] = t2;
|
|
208
|
+
$[9] = t3;
|
|
209
|
+
} else t3 = $[9];
|
|
210
|
+
let t4;
|
|
211
|
+
if ($[10] !== name || $[11] !== props || $[12] !== t1 || $[13] !== t3) {
|
|
212
|
+
t4 = /* @__PURE__ */ jsxs(Root, {
|
|
213
|
+
...props,
|
|
214
|
+
name,
|
|
215
|
+
children: [t1, t3]
|
|
216
|
+
});
|
|
217
|
+
$[10] = name;
|
|
218
|
+
$[11] = props;
|
|
219
|
+
$[12] = t1;
|
|
220
|
+
$[13] = t3;
|
|
221
|
+
$[14] = t4;
|
|
222
|
+
} else t4 = $[14];
|
|
223
|
+
return t4;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* A small circular avatar: the portrait at `src`, falling back to initials over
|
|
227
|
+
* a colour that stays the same for the same name. Decorative: the name it
|
|
228
|
+
* stands for is always beside it, so it is not announced. Other props go to
|
|
229
|
+
* the `<span>`. The parts hanging off it compose one by hand.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* <Avatar name="Ada Lovelace" src={colleague.portraitUrl} />
|
|
233
|
+
*/
|
|
234
|
+
var Avatar$1 = Object.assign(Prefab, {
|
|
235
|
+
Root,
|
|
236
|
+
Image,
|
|
237
|
+
Fallback
|
|
238
|
+
});
|
|
125
239
|
export { Avatar$1 as Avatar };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './avatar.css';// src/components/avatar/avatar.module.scss
|
|
2
|
-
var avatar = "
|
|
3
|
-
var image = "
|
|
4
|
-
var fallback = "
|
|
2
|
+
var avatar = "_avatar_18yef_3";
|
|
3
|
+
var image = "_image_18yef_35";
|
|
4
|
+
var fallback = "_fallback_18yef_41";
|
|
5
5
|
var avatar_module_default = {
|
|
6
6
|
avatar,
|
|
7
7
|
image,
|
|
@@ -2,14 +2,12 @@ import { type Context } from "react";
|
|
|
2
2
|
export type AvatarGroupContextValue = Readonly<{
|
|
3
3
|
/** The group's accessible name, which its list carries too. */
|
|
4
4
|
label: string;
|
|
5
|
-
/** Avatar diameter relative to the surrounding font size (in `em`). */
|
|
6
|
-
size: number;
|
|
7
5
|
}>;
|
|
8
6
|
export declare const AvatarGroupContext: Context<AvatarGroupContextValue | null>;
|
|
9
7
|
/**
|
|
10
|
-
* The enclosing `AvatarGroup.Root`'s name
|
|
8
|
+
* The enclosing `AvatarGroup.Root`'s name.
|
|
11
9
|
*
|
|
12
10
|
* @example
|
|
13
|
-
* const {
|
|
11
|
+
* const { label } = useAvatarGroup();
|
|
14
12
|
*/
|
|
15
13
|
export declare const useAvatarGroup: () => AvatarGroupContextValue;
|
|
@@ -3,10 +3,10 @@ import { createContext } from "react";
|
|
|
3
3
|
// src/components/avatar-group/avatar-group-context.ts
|
|
4
4
|
var AvatarGroupContext = createContext(null);
|
|
5
5
|
/**
|
|
6
|
-
* The enclosing `AvatarGroup.Root`'s name
|
|
6
|
+
* The enclosing `AvatarGroup.Root`'s name.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* const {
|
|
9
|
+
* const { label } = useAvatarGroup();
|
|
10
10
|
*/
|
|
11
11
|
var useAvatarGroup = () => {
|
|
12
12
|
return useRequiredContext(AvatarGroupContext, "The AvatarGroup parts must be used within an <AvatarGroup.Root>.");
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
@layer kit.reset, kit.base, kit.components;
|
|
2
2
|
@layer kit.components {
|
|
3
|
-
.
|
|
3
|
+
._group_82sgm_3 {
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
inline-size: fit-content;
|
|
7
7
|
}
|
|
8
|
-
.
|
|
8
|
+
._member_82sgm_8 {
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
flex-shrink: 0;
|
|
11
|
-
border-radius: var(--sys-radius-circle);
|
|
12
|
-
box-shadow: 0 0 0 2px var(--avatar-group-ring, var(--sys-color-surface));
|
|
11
|
+
border-radius: var(--avatar-group-radius, var(--sys-radius-circle));
|
|
12
|
+
box-shadow: 0 0 0 var(--avatar-group-ring-width, 2px) var(--avatar-group-ring, var(--sys-color-surface));
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
._member_82sgm_8:not(:first-child) {
|
|
15
15
|
margin-inline-start: calc(-1 * var(--avatar-group-overlap, 0.4) * var(--_avatar-group-size));
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
._overflow_82sgm_17 {
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
align-items: center;
|
|
20
20
|
justify-content: center;
|
|
@@ -25,38 +25,44 @@
|
|
|
25
25
|
padding: 0;
|
|
26
26
|
color: var(--avatar-group-overflow-fg, var(--sys-color-text));
|
|
27
27
|
font: inherit;
|
|
28
|
-
font-weight: 600;
|
|
28
|
+
font-weight: var(--avatar-group-overflow-font-weight, 600);
|
|
29
29
|
line-height: 1;
|
|
30
30
|
cursor: default;
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
._overflow_82sgm_17 {
|
|
33
33
|
outline: 0 solid var(--sys-color-focus-ring);
|
|
34
34
|
outline-offset: var(--sys-focus-ring-offset);
|
|
35
35
|
}
|
|
36
|
-
.
|
|
36
|
+
._overflow_82sgm_17:focus-visible {
|
|
37
37
|
outline-width: var(--sys-focus-ring-width);
|
|
38
38
|
}
|
|
39
|
-
.
|
|
39
|
+
._count_82sgm_39 {
|
|
40
40
|
font-size: calc(0.4 * var(--_avatar-group-size));
|
|
41
41
|
}
|
|
42
|
-
.
|
|
43
|
-
--popover-radius: var(
|
|
44
|
-
|
|
42
|
+
._popup_82sgm_42 {
|
|
43
|
+
--popover-radius: var(
|
|
44
|
+
--avatar-group-popup-radius,
|
|
45
|
+
var(--sys-radius-md)
|
|
46
|
+
);
|
|
47
|
+
--popover-padding: var(
|
|
48
|
+
--avatar-group-popup-padding,
|
|
49
|
+
var(--sys-unit-4)
|
|
50
|
+
);
|
|
45
51
|
--popover-min-inline-size: 0;
|
|
46
52
|
}
|
|
47
|
-
.
|
|
53
|
+
._list_82sgm_53 {
|
|
48
54
|
display: flex;
|
|
49
55
|
flex-direction: column;
|
|
50
|
-
gap: var(--sys-unit-4);
|
|
56
|
+
gap: var(--avatar-group-list-gap, var(--sys-unit-4));
|
|
51
57
|
list-style: none;
|
|
52
58
|
}
|
|
53
|
-
.
|
|
59
|
+
._item_82sgm_59 {
|
|
54
60
|
display: flex;
|
|
55
61
|
align-items: center;
|
|
56
|
-
gap: var(--sys-unit-4);
|
|
57
|
-
font: var(--sys-font-body-medium);
|
|
62
|
+
gap: var(--avatar-group-item-gap, var(--sys-unit-4));
|
|
63
|
+
font: var(--avatar-group-item-font, var(--sys-font-body-medium));
|
|
58
64
|
}
|
|
59
|
-
.
|
|
60
|
-
color: var(--sys-color-text-muted);
|
|
65
|
+
._suffix_82sgm_65 {
|
|
66
|
+
color: var(--avatar-group-suffix-fg, var(--sys-color-text-muted));
|
|
61
67
|
}
|
|
62
68
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRender } from "@base-ui/react/use-render";
|
|
2
2
|
import type { ReactElement, ReactNode } from "react";
|
|
3
|
-
import { type
|
|
3
|
+
import { type PopoverPopupProps } from "../popover/popover.tsx";
|
|
4
4
|
export type AvatarGroupRootProps = Omit<useRender.ComponentProps<"div">, "aria-label"> & Readonly<{
|
|
5
5
|
/** The group's accessible name, which its list carries too, such as "Invitees". */
|
|
6
6
|
label: string;
|
|
@@ -9,41 +9,94 @@ export type AvatarGroupRootProps = Omit<useRender.ComponentProps<"div">, "aria-l
|
|
|
9
9
|
}>;
|
|
10
10
|
/** The stack: a named group of avatars, overlapping, with no control of its own. */
|
|
11
11
|
declare const Root: ({ label, size, render, className, style: inlineStyle, ref, ...props }: AvatarGroupRootProps) => ReactElement;
|
|
12
|
-
export type AvatarGroupAvatarProps = Omit<useRender.ComponentProps<"span">, "
|
|
13
|
-
/**
|
|
12
|
+
export type AvatarGroupAvatarProps = Omit<useRender.ComponentProps<"span">, "aria-label"> & Readonly<{
|
|
13
|
+
/** The person's display name, announced as the avatar's name. */
|
|
14
14
|
name: string;
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/** The person's `Avatar`, at the group's `size`. */
|
|
16
|
+
children: ReactNode;
|
|
17
17
|
}>;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
/**
|
|
19
|
+
* One member of the stack, overlapping the one before it: an image named for
|
|
20
|
+
* its person, holding their `Avatar`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <AvatarGroup.Avatar name="Ada Lovelace">
|
|
24
|
+
* <Avatar name="Ada Lovelace" size={1.5} />
|
|
25
|
+
* </AvatarGroup.Avatar>
|
|
26
|
+
*/
|
|
27
|
+
declare const Avatar: ({ name, render, className, ref, ...props }: AvatarGroupAvatarProps) => ReactElement;
|
|
28
|
+
export type AvatarGroupOverflowProps = Omit<useRender.ComponentProps<"button">, "aria-label"> & Readonly<{
|
|
24
29
|
/** The button's name, saying what it opens, such as "+3, show all invitees". */
|
|
25
30
|
label: string;
|
|
26
|
-
/** What the popover lists, usually an `AvatarGroup.List`. */
|
|
27
|
-
children: ReactNode;
|
|
28
31
|
}>;
|
|
29
32
|
/**
|
|
30
|
-
* The
|
|
31
|
-
* holding
|
|
33
|
+
* The last member of the stack: the button that stands for everyone it leaves
|
|
34
|
+
* out, holding a `Count`. Render it as the trigger of a `Popover`.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* <AvatarGroup.Overflow
|
|
38
|
+
* label="+3, show all invitees"
|
|
39
|
+
* render={<Popover.Trigger openOnHover />}>
|
|
40
|
+
* <AvatarGroup.Count count={3} />
|
|
41
|
+
* </AvatarGroup.Overflow>
|
|
42
|
+
*/
|
|
43
|
+
declare const Overflow: ({ label, render, className, ref, ...props }: AvatarGroupOverflowProps) => ReactElement;
|
|
44
|
+
export type AvatarGroupCountProps = Omit<useRender.ComponentProps<"span">, "children"> & Readonly<{
|
|
45
|
+
/** How many people the stack leaves out, shown as a signed count such as "+3". */
|
|
46
|
+
count: number;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* How many people the stack leaves out, as a signed number in the reader's
|
|
50
|
+
* own format.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* <AvatarGroup.Count count={3} />
|
|
54
|
+
*/
|
|
55
|
+
declare const Count: ({ count, render, className, ref, ...props }: AvatarGroupCountProps) => ReactElement;
|
|
56
|
+
export type AvatarGroupPopupProps = PopoverPopupProps;
|
|
57
|
+
/**
|
|
58
|
+
* The overflow's popover surface, named after the group.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* <Popover.Portal>
|
|
62
|
+
* <Popover.Positioner side="top" sideOffset={8}>
|
|
63
|
+
* <AvatarGroup.Popup><AvatarGroup.List>…</AvatarGroup.List></AvatarGroup.Popup>
|
|
64
|
+
* </Popover.Positioner>
|
|
65
|
+
* </Popover.Portal>
|
|
32
66
|
*/
|
|
33
|
-
declare const
|
|
67
|
+
declare const Popup: ({ className, ...props }: AvatarGroupPopupProps) => ReactNode;
|
|
34
68
|
export type AvatarGroupListProps = useRender.ComponentProps<"ul">;
|
|
35
69
|
/** The people in the overflow's popover, one `ListItem` each. */
|
|
36
70
|
declare const List: ({ render, className, ref, ...props }: AvatarGroupListProps) => ReactElement;
|
|
37
|
-
export type AvatarGroupListItemProps =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
71
|
+
export type AvatarGroupListItemProps = useRender.ComponentProps<"li">;
|
|
72
|
+
/**
|
|
73
|
+
* One person in the list: their `Avatar`, then their `Name`.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* <AvatarGroup.ListItem>
|
|
77
|
+
* <Avatar name="Ada Lovelace" size={1.5} />
|
|
78
|
+
* <AvatarGroup.Name>Ada Lovelace</AvatarGroup.Name>
|
|
79
|
+
* </AvatarGroup.ListItem>
|
|
80
|
+
*/
|
|
81
|
+
declare const ListItem: ({ render, className, ref, ...props }: AvatarGroupListItemProps) => ReactElement;
|
|
82
|
+
export type AvatarGroupNameProps = useRender.ComponentProps<"span">;
|
|
83
|
+
/**
|
|
84
|
+
* A person's name in the list, with any `Suffix` after it.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* <AvatarGroup.Name>
|
|
88
|
+
* Ada Lovelace <AvatarGroup.Suffix>(you)</AvatarGroup.Suffix>
|
|
89
|
+
* </AvatarGroup.Name>
|
|
90
|
+
*/
|
|
91
|
+
declare const Name: ({ render, ref, ...props }: AvatarGroupNameProps) => ReactElement;
|
|
92
|
+
export type AvatarGroupSuffixProps = useRender.ComponentProps<"span">;
|
|
93
|
+
/**
|
|
94
|
+
* Muted words after a name, such as "(you)".
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* <AvatarGroup.Suffix>(you)</AvatarGroup.Suffix>
|
|
98
|
+
*/
|
|
99
|
+
declare const Suffix: ({ render, className, ref, ...props }: AvatarGroupSuffixProps) => ReactElement;
|
|
47
100
|
/** One person in an `AvatarGroup`. */
|
|
48
101
|
export type AvatarGroupPerson = Readonly<{
|
|
49
102
|
id: string;
|
|
@@ -76,13 +129,18 @@ export type AvatarGroupParts = typeof Prefab & Readonly<{
|
|
|
76
129
|
Root: typeof Root;
|
|
77
130
|
Avatar: typeof Avatar;
|
|
78
131
|
Overflow: typeof Overflow;
|
|
132
|
+
Count: typeof Count;
|
|
133
|
+
Popup: typeof Popup;
|
|
79
134
|
List: typeof List;
|
|
80
135
|
ListItem: typeof ListItem;
|
|
136
|
+
Name: typeof Name;
|
|
137
|
+
Suffix: typeof Suffix;
|
|
81
138
|
}>;
|
|
82
139
|
/**
|
|
83
140
|
* A compact stack of avatars that folds everyone past `max` into a count. The
|
|
84
141
|
* count is a button that lists everyone by name; the stack itself is content.
|
|
85
|
-
* The parts hanging off it compose a group by hand
|
|
142
|
+
* The parts hanging off it compose a group by hand, with the overflow's
|
|
143
|
+
* `Popover` composed around them.
|
|
86
144
|
*
|
|
87
145
|
* @example
|
|
88
146
|
* <AvatarGroup
|