@slotted/styles 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +10 -2
- package/package.json +276 -3
- package/src/accordion/accordion.css +96 -0
- package/src/accordion/accordion.tokens.json +14 -0
- package/src/action-bar/action-bar.css +455 -0
- package/src/action-bar/action-bar.tokens.json +50 -0
- package/src/action-sheet/action-sheet.css +462 -0
- package/src/action-sheet/action-sheet.tokens.json +59 -0
- package/src/alert/alert.css +764 -0
- package/src/alert/alert.tokens.json +77 -0
- package/src/app-shell/app-shell.css +1899 -0
- package/src/app-shell/app-shell.tokens.json +88 -0
- package/src/aspect-ratio/aspect-ratio.css +131 -0
- package/src/aspect-ratio/aspect-ratio.tokens.json +1 -0
- package/src/attachment/attachment.css +906 -0
- package/src/attachment/attachment.tokens.json +85 -0
- package/src/avatar/avatar.css +598 -0
- package/src/avatar/avatar.tokens.json +64 -0
- package/src/avatar-group/avatar-group.css +268 -0
- package/src/avatar-group/avatar-group.tokens.json +16 -0
- package/src/badge/badge.css +462 -0
- package/src/badge/badge.tokens.json +58 -0
- package/src/breadcrumb/breadcrumb.css +441 -0
- package/src/breadcrumb/breadcrumb.tokens.json +50 -0
- package/src/button/button.css +754 -0
- package/src/button/button.tokens.json +72 -0
- package/src/button-group/button-group.css +455 -0
- package/src/button-group/button-group.tokens.json +11 -0
- package/src/calendar/calendar.css +846 -0
- package/src/calendar/calendar.tokens.json +67 -0
- package/src/card/card.css +602 -0
- package/src/card/card.tokens.json +68 -0
- package/src/carousel/carousel.css +860 -0
- package/src/carousel/carousel.tokens.json +62 -0
- package/src/cascader/cascader.css +1320 -0
- package/src/cascader/cascader.tokens.json +103 -0
- package/src/chart/chart.css +1473 -0
- package/src/chart/chart.tokens.json +107 -0
- package/src/checkbox/checkbox.css +1011 -0
- package/src/checkbox/checkbox.tokens.json +102 -0
- package/src/checkbox-group/checkbox-group.css +70 -0
- package/src/checkbox-group/checkbox-group.tokens.json +6 -0
- package/src/code-block/code-block.css +555 -0
- package/src/code-block/code-block.tokens.json +69 -0
- package/src/collapsible/collapsible.css +546 -0
- package/src/collapsible/collapsible.tokens.json +55 -0
- package/src/color-picker/color-picker.css +607 -0
- package/src/color-picker/color-picker.tokens.json +58 -0
- package/src/column-manager/column-manager.css +452 -0
- package/src/column-manager/column-manager.tokens.json +43 -0
- package/src/combobox/combobox.css +1048 -0
- package/src/combobox/combobox.tokens.json +112 -0
- package/src/command-palette/command-palette.css +1000 -0
- package/src/command-palette/command-palette.tokens.json +75 -0
- package/src/container/container.css +198 -0
- package/src/container/container.tokens.json +18 -0
- package/src/context-menu/context-menu.css +104 -0
- package/src/context-menu/context-menu.tokens.json +11 -0
- package/src/currency-field/currency-field.css +787 -0
- package/src/currency-field/currency-field.tokens.json +80 -0
- package/src/dashboard-grid/dashboard-grid.css +748 -0
- package/src/dashboard-grid/dashboard-grid.tokens.json +67 -0
- package/src/data-grid/data-grid.css +2484 -0
- package/src/data-grid/data-grid.tokens.json +100 -0
- package/src/data-list/data-list.css +455 -0
- package/src/data-list/data-list.tokens.json +35 -0
- package/src/date-field/date-field.css +560 -0
- package/src/date-field/date-field.tokens.json +80 -0
- package/src/date-picker/date-picker.css +420 -0
- package/src/date-picker/date-picker.tokens.json +49 -0
- package/src/date-range-picker/date-range-picker.css +983 -0
- package/src/date-range-picker/date-range-picker.tokens.json +109 -0
- package/src/datetime-field/datetime-field.css +850 -0
- package/src/datetime-field/datetime-field.tokens.json +91 -0
- package/src/datetime-picker/datetime-picker.css +843 -0
- package/src/datetime-picker/datetime-picker.tokens.json +78 -0
- package/src/datetime-range-picker/datetime-range-picker.css +1375 -0
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +135 -0
- package/src/description-list/description-list.css +675 -0
- package/src/description-list/description-list.tokens.json +66 -0
- package/src/detail-panel/detail-panel.css +329 -0
- package/src/detail-panel/detail-panel.tokens.json +33 -0
- package/src/dialog/dialog.css +968 -0
- package/src/dialog/dialog.tokens.json +66 -0
- package/src/divider/divider.css +131 -0
- package/src/divider/divider.tokens.json +18 -0
- package/src/drawer/drawer.css +1303 -0
- package/src/drawer/drawer.tokens.json +75 -0
- package/src/entity-picker/entity-picker.css +1367 -0
- package/src/entity-picker/entity-picker.tokens.json +118 -0
- package/src/event-calendar/event-calendar.css +2148 -0
- package/src/event-calendar/event-calendar.tokens.json +87 -0
- package/src/field/field.css +707 -0
- package/src/field/field.tokens.json +58 -0
- package/src/field-group/field-group.css +226 -0
- package/src/field-group/field-group.tokens.json +33 -0
- package/src/filter-bar/filter-bar.css +1306 -0
- package/src/filter-bar/filter-bar.tokens.json +78 -0
- package/src/form/form.css +218 -0
- package/src/form/form.tokens.json +32 -0
- package/src/fullscreen/fullscreen.css +376 -0
- package/src/fullscreen/fullscreen.tokens.json +50 -0
- package/src/grid/grid.css +173 -0
- package/src/grid/grid.tokens.json +20 -0
- package/src/highlight/highlight.css +135 -0
- package/src/highlight/highlight.tokens.json +16 -0
- package/src/hover-card/hover-card.css +93 -0
- package/src/hover-card/hover-card.tokens.json +17 -0
- package/src/icon/icon.css +136 -0
- package/src/icon/icon.tokens.json +14 -0
- package/src/image/image.css +449 -0
- package/src/image/image.tokens.json +27 -0
- package/src/import-export-center/import-export-center.css +1175 -0
- package/src/import-export-center/import-export-center.tokens.json +84 -0
- package/src/inline/inline.css +149 -0
- package/src/inline/inline.tokens.json +14 -0
- package/src/inline-message/inline-message.css +396 -0
- package/src/inline-message/inline-message.tokens.json +19 -0
- package/src/kbd/kbd.css +490 -0
- package/src/kbd/kbd.tokens.json +40 -0
- package/src/link/link.css +237 -0
- package/src/link/link.tokens.json +25 -0
- package/src/list/list.css +240 -0
- package/src/list/list.tokens.json +42 -0
- package/src/list-item/list-item.css +937 -0
- package/src/list-item/list-item.tokens.json +114 -0
- package/src/listbox/listbox.css +674 -0
- package/src/listbox/listbox.tokens.json +72 -0
- package/src/loading-overlay/loading-overlay.css +730 -0
- package/src/loading-overlay/loading-overlay.tokens.json +48 -0
- package/src/markdown/markdown.css +168 -0
- package/src/markdown/markdown.tokens.json +18 -0
- package/src/menu/menu.css +817 -0
- package/src/menu/menu.tokens.json +78 -0
- package/src/menubar/menubar.css +170 -0
- package/src/menubar/menubar.tokens.json +32 -0
- package/src/message/message.css +1453 -0
- package/src/message/message.tokens.json +85 -0
- package/src/message-scroller/message-scroller.css +371 -0
- package/src/message-scroller/message-scroller.tokens.json +47 -0
- package/src/multi-select/multi-select.css +1427 -0
- package/src/multi-select/multi-select.tokens.json +114 -0
- package/src/navigation-menu/navigation-menu.css +1029 -0
- package/src/navigation-menu/navigation-menu.tokens.json +70 -0
- package/src/notification-center/notification-center.css +856 -0
- package/src/notification-center/notification-center.tokens.json +84 -0
- package/src/number-field/number-field.css +794 -0
- package/src/number-field/number-field.tokens.json +80 -0
- package/src/otp-input/otp-input.css +525 -0
- package/src/otp-input/otp-input.tokens.json +69 -0
- package/src/page/page.css +179 -0
- package/src/page/page.tokens.json +20 -0
- package/src/page-header/page-header.css +1181 -0
- package/src/page-header/page-header.tokens.json +71 -0
- package/src/pagination/pagination.css +500 -0
- package/src/pagination/pagination.tokens.json +56 -0
- package/src/popover/popover.css +526 -0
- package/src/popover/popover.tokens.json +60 -0
- package/src/progress-indicator/progress-indicator.css +1584 -0
- package/src/progress-indicator/progress-indicator.tokens.json +50 -0
- package/src/prompt-composer/prompt-composer.css +680 -0
- package/src/prompt-composer/prompt-composer.tokens.json +99 -0
- package/src/prose/prose.css +733 -0
- package/src/prose/prose.tokens.json +79 -0
- package/src/radio-group/radio-group.css +778 -0
- package/src/radio-group/radio-group.tokens.json +103 -0
- package/src/rating/rating.css +1071 -0
- package/src/rating/rating.tokens.json +88 -0
- package/src/result-state/result-state.css +980 -0
- package/src/result-state/result-state.tokens.json +63 -0
- package/src/runtime-properties.mjs +321 -0
- package/src/saved-views/saved-views.css +394 -0
- package/src/saved-views/saved-views.tokens.json +41 -0
- package/src/scroll-area/scroll-area.css +481 -0
- package/src/scroll-area/scroll-area.tokens.json +15 -0
- package/src/section/section.css +177 -0
- package/src/section/section.tokens.json +39 -0
- package/src/segmented-control/segmented-control.css +564 -0
- package/src/segmented-control/segmented-control.tokens.json +67 -0
- package/src/select/select.css +1593 -0
- package/src/select/select.tokens.json +110 -0
- package/src/side-navigation/side-navigation.css +1096 -0
- package/src/side-navigation/side-navigation.tokens.json +87 -0
- package/src/skeleton/skeleton.css +431 -0
- package/src/skeleton/skeleton.tokens.json +29 -0
- package/src/slider/slider.css +792 -0
- package/src/slider/slider.tokens.json +75 -0
- package/src/sparkline/sparkline.css +282 -0
- package/src/sparkline/sparkline.tokens.json +45 -0
- package/src/spinner/spinner.css +224 -0
- package/src/spinner/spinner.tokens.json +8 -0
- package/src/split-button/split-button.css +253 -0
- package/src/split-button/split-button.tokens.json +12 -0
- package/src/splitter/splitter.css +336 -0
- package/src/splitter/splitter.tokens.json +24 -0
- package/src/stack/stack.css +128 -0
- package/src/stack/stack.tokens.json +14 -0
- package/src/stat-card/stat-card.css +641 -0
- package/src/stat-card/stat-card.tokens.json +95 -0
- package/src/status-indicator/status-indicator.css +481 -0
- package/src/status-indicator/status-indicator.tokens.json +38 -0
- package/src/stepper/stepper.css +629 -0
- package/src/stepper/stepper.tokens.json +72 -0
- package/src/switch/switch.css +703 -0
- package/src/switch/switch.tokens.json +75 -0
- package/src/table/table.css +1482 -0
- package/src/table/table.tokens.json +69 -0
- package/src/table-of-contents/table-of-contents.css +533 -0
- package/src/table-of-contents/table-of-contents.tokens.json +53 -0
- package/src/tabs/tabs.css +998 -0
- package/src/tabs/tabs.tokens.json +82 -0
- package/src/tag/tag.css +768 -0
- package/src/tag/tag.tokens.json +85 -0
- package/src/tags-input/tags-input.css +757 -0
- package/src/tags-input/tags-input.tokens.json +84 -0
- package/src/text-field/text-field.css +900 -0
- package/src/text-field/text-field.tokens.json +87 -0
- package/src/textarea/textarea.css +365 -0
- package/src/textarea/textarea.tokens.json +59 -0
- package/src/time-field/time-field.css +719 -0
- package/src/time-field/time-field.tokens.json +86 -0
- package/src/time-picker/time-picker.css +665 -0
- package/src/time-picker/time-picker.tokens.json +66 -0
- package/src/time-range-picker/time-range-picker.css +1287 -0
- package/src/time-range-picker/time-range-picker.tokens.json +134 -0
- package/src/timeline/timeline.css +1596 -0
- package/src/timeline/timeline.tokens.json +96 -0
- package/src/toast/toast.css +943 -0
- package/src/toast/toast.tokens.json +90 -0
- package/src/toggle/toggle.css +290 -0
- package/src/toggle/toggle.tokens.json +54 -0
- package/src/toggle-group/toggle-group.css +463 -0
- package/src/toggle-group/toggle-group.tokens.json +54 -0
- package/src/toolbar/toolbar.css +434 -0
- package/src/toolbar/toolbar.tokens.json +49 -0
- package/src/tooltip/tooltip.css +368 -0
- package/src/tooltip/tooltip.tokens.json +39 -0
- package/src/top-navigation/top-navigation.css +1287 -0
- package/src/top-navigation/top-navigation.tokens.json +91 -0
- package/src/tour/tour.css +680 -0
- package/src/tour/tour.tokens.json +67 -0
- package/src/transfer/transfer.css +571 -0
- package/src/transfer/transfer.tokens.json +49 -0
- package/src/tree/tree.css +1000 -0
- package/src/tree/tree.tokens.json +80 -0
- package/src/typography/typography.css +211 -0
- package/src/typography/typography.tokens.json +31 -0
- package/src/upload/upload.css +1706 -0
- package/src/upload/upload.tokens.json +123 -0
- package/src/visually-hidden/visually-hidden.css +52 -0
- package/src/visually-hidden/visually-hidden.tokens.json +1 -0
- package/src/wizard/wizard.css +740 -0
- package/src/wizard/wizard.tokens.json +63 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-avatar-border-width",
|
|
3
|
+
"--slotted-avatar-disabled-image-filter",
|
|
4
|
+
"--slotted-avatar-elevation",
|
|
5
|
+
"--slotted-avatar-font-family",
|
|
6
|
+
"--slotted-avatar-font-weight",
|
|
7
|
+
"--slotted-avatar-glyph-size",
|
|
8
|
+
"--slotted-avatar-initials-size",
|
|
9
|
+
"--slotted-avatar-radius",
|
|
10
|
+
"--slotted-avatar-ring-color",
|
|
11
|
+
"--slotted-avatar-ring-width",
|
|
12
|
+
"--slotted-avatar-size",
|
|
13
|
+
"--slotted-avatar-size-lg",
|
|
14
|
+
"--slotted-avatar-size-md",
|
|
15
|
+
"--slotted-avatar-size-sm",
|
|
16
|
+
"--slotted-avatar-size-xl",
|
|
17
|
+
"--slotted-avatar-size-xs",
|
|
18
|
+
"--slotted-avatar-state-layer-active",
|
|
19
|
+
"--slotted-avatar-state-layer-hover",
|
|
20
|
+
"--slotted-border-strong",
|
|
21
|
+
"--slotted-border-subtle",
|
|
22
|
+
"--slotted-border-width-thick",
|
|
23
|
+
"--slotted-border-width-thin",
|
|
24
|
+
"--slotted-control-font-family",
|
|
25
|
+
"--slotted-disabled-background",
|
|
26
|
+
"--slotted-disabled-border",
|
|
27
|
+
"--slotted-disabled-foreground",
|
|
28
|
+
"--slotted-duration-short",
|
|
29
|
+
"--slotted-easing-enter",
|
|
30
|
+
"--slotted-easing-exit",
|
|
31
|
+
"--slotted-easing-standard",
|
|
32
|
+
"--slotted-focus-ring-color",
|
|
33
|
+
"--slotted-focus-ring-offset",
|
|
34
|
+
"--slotted-focus-ring-width",
|
|
35
|
+
"--slotted-font-weight-medium",
|
|
36
|
+
"--slotted-radius-full",
|
|
37
|
+
"--slotted-surface",
|
|
38
|
+
"--slotted-target-min",
|
|
39
|
+
"--slotted-tone-accent-border",
|
|
40
|
+
"--slotted-tone-accent-on-solid",
|
|
41
|
+
"--slotted-tone-accent-solid",
|
|
42
|
+
"--slotted-tone-accent-surface",
|
|
43
|
+
"--slotted-tone-accent-text",
|
|
44
|
+
"--slotted-tone-danger-border",
|
|
45
|
+
"--slotted-tone-danger-on-solid",
|
|
46
|
+
"--slotted-tone-danger-solid",
|
|
47
|
+
"--slotted-tone-danger-surface",
|
|
48
|
+
"--slotted-tone-danger-text",
|
|
49
|
+
"--slotted-tone-secondary-border",
|
|
50
|
+
"--slotted-tone-secondary-on-solid",
|
|
51
|
+
"--slotted-tone-secondary-solid-hover",
|
|
52
|
+
"--slotted-tone-secondary-surface",
|
|
53
|
+
"--slotted-tone-secondary-text",
|
|
54
|
+
"--slotted-tone-success-border",
|
|
55
|
+
"--slotted-tone-success-on-solid",
|
|
56
|
+
"--slotted-tone-success-solid",
|
|
57
|
+
"--slotted-tone-success-surface",
|
|
58
|
+
"--slotted-tone-success-text",
|
|
59
|
+
"--slotted-tone-warning-border",
|
|
60
|
+
"--slotted-tone-warning-on-solid",
|
|
61
|
+
"--slotted-tone-warning-solid",
|
|
62
|
+
"--slotted-tone-warning-surface",
|
|
63
|
+
"--slotted-tone-warning-text"
|
|
64
|
+
]
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
@layer slotted.components {
|
|
2
|
+
/**
|
|
3
|
+
* ── The group ──────────────────────────────────────────────────────────
|
|
4
|
+
*
|
|
5
|
+
* A list of faces, overlapped or apart, ending in a summary of the ones it
|
|
6
|
+
* does not show. It is a family rather than a part of `avatar` for the reason
|
|
7
|
+
* `button-group` is one: it owns a different element, a different set of
|
|
8
|
+
* decisions, and a member it does not have to be.
|
|
9
|
+
*
|
|
10
|
+
* It is a real `<ul>`, so a screen reader announces a list of N without the
|
|
11
|
+
* family inventing a role. The label is the consumer's `aria-label`, which is
|
|
12
|
+
* the decision `button-group` already took for the same question: a second
|
|
13
|
+
* way to name one thing is a second thing to get wrong.
|
|
14
|
+
*/
|
|
15
|
+
[data-ui='avatar-group'][data-part='root'] {
|
|
16
|
+
/**
|
|
17
|
+
* How much of a member the next one covers, as a fraction of its own box.
|
|
18
|
+
* A proportion rather than a step of the space scale, because what has to
|
|
19
|
+
* stay constant is the amount of face that remains visible: at 0.28 the
|
|
20
|
+
* leading 72 per cent of every avatar is showing, at every size and at
|
|
21
|
+
* every density.
|
|
22
|
+
*
|
|
23
|
+
* The references sit either side of it: ReUI covers 0.25 of a 32-pixel
|
|
24
|
+
* avatar, 0.33 of a 24 and 0.20 of a 20 (the 2026-09-29 dossier), MUI
|
|
25
|
+
* eight pixels of forty. The covering is rounded to the pixel where it is
|
|
26
|
+
* used, below.
|
|
27
|
+
*/
|
|
28
|
+
--_overlap: var(--slotted-avatar-group-overlap, 0.28);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The size is restated here as well as reaching every member through the
|
|
32
|
+
* defaults each binding provides. The member needs it to scale its own type
|
|
33
|
+
* and glyph; the group needs it as a number, to work out an overlap that no
|
|
34
|
+
* child can compute for its parent.
|
|
35
|
+
*/
|
|
36
|
+
--_size: var(--slotted-avatar-size, var(--slotted-avatar-size-md, 36px));
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* ── What a raised member is raised by ──────────────────────────────────
|
|
40
|
+
*
|
|
41
|
+
* Three values, stated on the group and read by the two rules below, so the
|
|
42
|
+
* raise is written once and the reduced-motion answer is a redefinition
|
|
43
|
+
* rather than a second copy of the rule.
|
|
44
|
+
*
|
|
45
|
+
* The lift is the motion: four pixels up, which is a face leaning towards
|
|
46
|
+
* the pointer. The ring and the shadow are not motion — the ring is what
|
|
47
|
+
* separates the raised face from the ones it now covers, and the shadow is
|
|
48
|
+
* what says which of them is in front — so both survive a reader who asked
|
|
49
|
+
* for stillness.
|
|
50
|
+
*
|
|
51
|
+
* It was two pixels and six per cent out until R7. An avatar carries its
|
|
52
|
+
* member's initials when there is no photograph, and six per cent on a box
|
|
53
|
+
* of letters resamples them for the length of the movement; the step that
|
|
54
|
+
* replaces it is the one the raise already spoke in, taken one further, so
|
|
55
|
+
* the face still leaves the row it is in. What the growth added — *this
|
|
56
|
+
* one is in front* — is already said twice over, by the ring and by the
|
|
57
|
+
* shadow under it. `packages/styles/src/text-scale.test.mjs` holds the
|
|
58
|
+
* rule.
|
|
59
|
+
*/
|
|
60
|
+
--_raise-lift: calc(
|
|
61
|
+
var(--slotted-avatar-group-raise-lift, var(--slotted-space-2, 0.25rem)) * -1
|
|
62
|
+
);
|
|
63
|
+
--_raise-ring: var(--slotted-border-width-thick, 2px);
|
|
64
|
+
--_raise-shadow: var(--slotted-shadow-sm);
|
|
65
|
+
|
|
66
|
+
align-items: center;
|
|
67
|
+
display: flex;
|
|
68
|
+
list-style: none;
|
|
69
|
+
margin: 0;
|
|
70
|
+
padding: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* An actions row built from a permission filter renders an empty group often,
|
|
75
|
+
* and an empty box still eats a gap in the row that holds it, so the row
|
|
76
|
+
* beside it drifts for a reason nobody can see in the markup. The same
|
|
77
|
+
* decision `button-group` took.
|
|
78
|
+
*/
|
|
79
|
+
[data-ui='avatar-group'][data-part='root']:empty {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[data-ui='avatar-group'] [data-part='item'],
|
|
84
|
+
[data-ui='avatar-group'] [data-part='overflow'] {
|
|
85
|
+
display: flex;
|
|
86
|
+
/* Not a stacking context: `z-index` stays `auto` so a member raised on
|
|
87
|
+
hover rises above its neighbours rather than only inside its own item. */
|
|
88
|
+
position: relative;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The member lists what it transitions; the group states only the curve, so
|
|
93
|
+
* nothing the avatar crosses is dropped inside a stack. A face leaving the
|
|
94
|
+
* row rises on the entering curve and settles back on the exiting one: the
|
|
95
|
+
* curve of the state it arrives at, which is why the rest rule carries the
|
|
96
|
+
* exit.
|
|
97
|
+
*/
|
|
98
|
+
[data-ui='avatar-group'][data-part='root'][data-layout='stack']
|
|
99
|
+
[data-ui='avatar'][data-part='root'] {
|
|
100
|
+
transition-timing-function: var(--slotted-easing-exit);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ── Size ─────────────────────────────────────────────────────────────── */
|
|
104
|
+
|
|
105
|
+
[data-ui='avatar-group'][data-part='root'][data-size='xs'] {
|
|
106
|
+
--slotted-avatar-size: var(--slotted-avatar-size-xs, 24px);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-ui='avatar-group'][data-part='root'][data-size='sm'] {
|
|
110
|
+
--slotted-avatar-size: var(--slotted-avatar-size-sm, 28px);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[data-ui='avatar-group'][data-part='root'][data-size='md'] {
|
|
114
|
+
--slotted-avatar-size: var(--slotted-avatar-size-md, 36px);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[data-ui='avatar-group'][data-part='root'][data-size='lg'] {
|
|
118
|
+
--slotted-avatar-size: var(--slotted-avatar-size-lg, 48px);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[data-ui='avatar-group'][data-part='root'][data-size='xl'] {
|
|
122
|
+
--slotted-avatar-size: var(--slotted-avatar-size-xl, 64px);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* ── Layout ───────────────────────────────────────────────────────────── */
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The overlapped run. A negative logical inset, so a right-to-left document
|
|
129
|
+
* gets the same component mirrored rather than a second stylesheet — which is
|
|
130
|
+
* what Ant, MUI, Chakra and Primer all need, because all four write `margin-left`.
|
|
131
|
+
*
|
|
132
|
+
* Members are not wrapped: a stack that broke across two lines would leave
|
|
133
|
+
* the last face of the first line overlapping nothing.
|
|
134
|
+
*/
|
|
135
|
+
[data-ui='avatar-group'][data-part='root'][data-layout='stack'] {
|
|
136
|
+
flex-wrap: nowrap;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The avatar owns its own one-pixel edge. The group only controls the overlap,
|
|
141
|
+
* so the stack has one curve per face instead of a second thick ring layered
|
|
142
|
+
* over every member.
|
|
143
|
+
*/
|
|
144
|
+
[data-ui='avatar-group'][data-part='root'][data-layout='stack'] > * + * {
|
|
145
|
+
/* Whole pixels: 0.28 of 36 is 10.08, which left every member after the
|
|
146
|
+
first on a fractional x (50.92, 76.84, 102.77) and softened its edge. */
|
|
147
|
+
margin-inline-start: calc(round(nearest, calc(var(--_size) * var(--_overlap)), 1px) * -1);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The separated run. It wraps, because a row of eight faces at 420 pixels has
|
|
152
|
+
* to go somewhere, and a group laid out apart has no stacking order to lose
|
|
153
|
+
* by breaking.
|
|
154
|
+
*/
|
|
155
|
+
[data-ui='avatar-group'][data-part='root'][data-layout='spread'] {
|
|
156
|
+
flex-wrap: wrap;
|
|
157
|
+
/**
|
|
158
|
+
* A step of the space scale rather than a proportion of the avatar, because
|
|
159
|
+
* separation between two components is a layout rhythm and the space scale
|
|
160
|
+
* is where this library keeps those — the decision `button-group` recorded
|
|
161
|
+
* for the gap between two buttons. Cost: a row of extra-large avatars is
|
|
162
|
+
* proportionally tighter than a row of small ones.
|
|
163
|
+
*/
|
|
164
|
+
gap: var(--slotted-space-4, 0.5rem);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* ── The member under the pointer, or under the caret ─────────────────── */
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* In a stack every member covers the trailing edge of the one before it, so a
|
|
171
|
+
* focus ring drawn on any but the last would be half-hidden under its
|
|
172
|
+
* neighbour. Raising the member is the whole feedback, and it is instant: a
|
|
173
|
+
* change of stacking order that took two hundred milliseconds would leave the
|
|
174
|
+
* avatar behind its neighbour for most of the time the pointer is on it.
|
|
175
|
+
*
|
|
176
|
+
* A weak state held back for the stronger one: a disabled member does not
|
|
177
|
+
* rise, which is the rule `packages/styles/src/states.test.mjs` keeps.
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* The member under the pointer, and the three things that raise it.
|
|
181
|
+
*
|
|
182
|
+
* Order of stacking first: the raise is only legible while the face is in
|
|
183
|
+
* front of the ones it overlaps, and `z-index` is what puts it there.
|
|
184
|
+
*
|
|
185
|
+
* Then the ring, which is the avatar's own — the one it keeps at nought until
|
|
186
|
+
* something it overlaps asks for it, in the surface colour it already
|
|
187
|
+
* defaults to. A stack draws every member over the trailing edge of the one
|
|
188
|
+
* before it, so a raised face has a neighbour's picture against its own edge
|
|
189
|
+
* on one side, and a ring of the surface is the gap that edge would have had
|
|
190
|
+
* if nothing were behind it. It is that token and not an `outline`: R3 gives
|
|
191
|
+
* the outline of every family to the focus ring, and a separation ring drawn
|
|
192
|
+
* as one would be a second thing painted where focus belongs. The ring is
|
|
193
|
+
* only asked for while the pointer is on the member, which is why the group's
|
|
194
|
+
* resting rule still states none (`avatar-group.styles.test.mjs`).
|
|
195
|
+
*
|
|
196
|
+
* Then the elevation, which is what separates a member that is in front from
|
|
197
|
+
* one that merely overlaps: two flat discs at different stacking orders read
|
|
198
|
+
* as a single shape, and a shadow under one of them reads as a face lifted
|
|
199
|
+
* off the row. It reaches the avatar as its own elevation token, so the two
|
|
200
|
+
* rings and the shadow are one `box-shadow` written by the family that owns
|
|
201
|
+
* the box rather than a second one overwriting it (AG1).
|
|
202
|
+
*
|
|
203
|
+
* Then the movement: four pixels towards the reader. The
|
|
204
|
+
* neighbours do not move, because neither a transform nor a shadow is layout
|
|
205
|
+
* — measured in `tools/harness/out/review-loop/ag1/raise.mjs`, both
|
|
206
|
+
* neighbours keep the box they had at rest, in three schemes and three
|
|
207
|
+
* densities.
|
|
208
|
+
*/
|
|
209
|
+
[data-ui='avatar-group'][data-layout='stack']
|
|
210
|
+
[data-ui='avatar'][data-part='root']:not([data-disabled]):hover {
|
|
211
|
+
--slotted-avatar-ring-width: var(--_raise-ring);
|
|
212
|
+
--slotted-avatar-elevation: var(--_raise-shadow);
|
|
213
|
+
|
|
214
|
+
z-index: 1;
|
|
215
|
+
transform: translateY(var(--_raise-lift));
|
|
216
|
+
transition-timing-function: var(--slotted-easing-enter);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
[data-ui='avatar-group'][data-layout='stack'] [data-ui='avatar'][data-part='root']:focus-visible {
|
|
220
|
+
z-index: 1;
|
|
221
|
+
transform: translateY(var(--_raise-lift));
|
|
222
|
+
transition-timing-function: var(--slotted-easing-enter);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* The press settles the raised face halfway back into the row. It is a
|
|
227
|
+
* translate and not a scale for the reason the lift is (R7), and it is a
|
|
228
|
+
* different answer from the hover, which is the whole point of a press.
|
|
229
|
+
*/
|
|
230
|
+
[data-ui='avatar-group'][data-layout='stack']
|
|
231
|
+
[data-ui='avatar'][data-part='root']:not([data-disabled]):active {
|
|
232
|
+
transform: translateY(calc(var(--_raise-lift) / 2));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Stillness keeps the answer and drops the movement: the stacking order and
|
|
237
|
+
* the ring say which face the pointer is on without anything travelling, and
|
|
238
|
+
* they are the two the item names. The shadow goes with the movement — it is
|
|
239
|
+
* the depth the lift implies, and a shadow that appears under a face that did
|
|
240
|
+
* not move is a light source switching on.
|
|
241
|
+
*/
|
|
242
|
+
@media (prefers-reduced-motion: reduce) {
|
|
243
|
+
[data-ui='avatar-group'][data-part='root'][data-layout='stack'] {
|
|
244
|
+
--_raise-lift: 0px;
|
|
245
|
+
--_raise-shadow: 0 0 transparent;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
[data-ui='avatar-group'][data-layout='stack'] [data-ui='avatar'][data-part='root'] {
|
|
249
|
+
transition: none;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* ── The summary ──────────────────────────────────────────────────────── */
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* `+12` is three figures where a pair of initials is two, so the avatar in
|
|
257
|
+
* the overflow reads its type a step smaller: 0.36 of the box against the
|
|
258
|
+
* initials' 0.4, rounded to the pixel — 13 at 36, 9 at 24. It was 0.32, which
|
|
259
|
+
* is 7.68 pixels at 24, under the nine ReUI sets on a 20-pixel face. Tabular figures keep the box
|
|
260
|
+
* from jittering as the count crosses a power of ten, which is the same rule
|
|
261
|
+
* `badge` applies to its own count.
|
|
262
|
+
*/
|
|
263
|
+
[data-ui='avatar-group'] [data-part='overflow'] [data-ui='avatar'][data-part='root'] {
|
|
264
|
+
--slotted-avatar-initials-size: round(nearest, calc(var(--_size) * 0.36), 1px);
|
|
265
|
+
|
|
266
|
+
font-variant-numeric: tabular-nums;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-avatar-group-overlap",
|
|
3
|
+
"--slotted-avatar-group-raise-lift",
|
|
4
|
+
"--slotted-avatar-size",
|
|
5
|
+
"--slotted-avatar-size-lg",
|
|
6
|
+
"--slotted-avatar-size-md",
|
|
7
|
+
"--slotted-avatar-size-sm",
|
|
8
|
+
"--slotted-avatar-size-xl",
|
|
9
|
+
"--slotted-avatar-size-xs",
|
|
10
|
+
"--slotted-border-width-thick",
|
|
11
|
+
"--slotted-easing-enter",
|
|
12
|
+
"--slotted-easing-exit",
|
|
13
|
+
"--slotted-shadow-sm",
|
|
14
|
+
"--slotted-space-2",
|
|
15
|
+
"--slotted-space-4"
|
|
16
|
+
]
|