@seed-design/css 1.2.2 → 1.2.4
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/all.css +1033 -192
- package/all.layered.css +9070 -0
- package/all.layered.min.css +1 -0
- package/all.min.css +1 -1
- package/base.css +4 -0
- package/base.layered.css +858 -0
- package/base.layered.min.css +1 -0
- package/base.min.css +1 -1
- package/package.json +11 -2
- package/recipes/action-button.css +69 -17
- package/recipes/action-button.layered.css +421 -0
- package/recipes/action-button.layered.mjs +79 -0
- package/recipes/action-chip.layered.css +84 -0
- package/recipes/action-chip.layered.mjs +51 -0
- package/recipes/action-sheet-item.layered.css +38 -0
- package/recipes/action-sheet-item.layered.mjs +29 -0
- package/recipes/action-sheet.layered.css +134 -0
- package/recipes/action-sheet.layered.mjs +60 -0
- package/recipes/app-bar-main.layered.css +165 -0
- package/recipes/app-bar-main.layered.mjs +63 -0
- package/recipes/app-bar.css +9 -1
- package/recipes/app-bar.layered.css +302 -0
- package/recipes/app-bar.layered.mjs +70 -0
- package/recipes/app-screen.layered.css +332 -0
- package/recipes/app-screen.layered.mjs +98 -0
- package/recipes/article.layered.css +12 -0
- package/recipes/article.layered.mjs +22 -0
- package/recipes/aspect-ratio.css +0 -2
- package/recipes/aspect-ratio.layered.css +26 -0
- package/recipes/aspect-ratio.layered.mjs +22 -0
- package/recipes/avatar-stack.layered.css +94 -0
- package/recipes/avatar-stack.layered.mjs +50 -0
- package/recipes/avatar.layered.css +222 -0
- package/recipes/avatar.layered.mjs +65 -0
- package/recipes/badge.layered.css +140 -0
- package/recipes/badge.layered.mjs +131 -0
- package/recipes/bottom-sheet-handle.css +9 -2
- package/recipes/bottom-sheet-handle.layered.css +36 -0
- package/recipes/bottom-sheet-handle.layered.mjs +36 -0
- package/recipes/bottom-sheet.css +14 -3
- package/recipes/bottom-sheet.layered.css +224 -0
- package/recipes/bottom-sheet.layered.mjs +75 -0
- package/recipes/callout.css +77 -12
- package/recipes/callout.layered.css +242 -0
- package/recipes/callout.layered.mjs +63 -0
- package/recipes/checkbox-group.layered.css +7 -0
- package/recipes/checkbox-group.layered.mjs +22 -0
- package/recipes/checkbox.layered.css +54 -0
- package/recipes/checkbox.layered.mjs +48 -0
- package/recipes/checkmark.css +61 -13
- package/recipes/checkmark.layered.css +187 -0
- package/recipes/checkmark.layered.mjs +86 -0
- package/recipes/chip-tabs.css +62 -14
- package/recipes/chip-tabs.layered.css +254 -0
- package/recipes/chip-tabs.layered.mjs +75 -0
- package/recipes/chip.css +60 -15
- package/recipes/chip.layered.css +272 -0
- package/recipes/chip.layered.mjs +80 -0
- package/recipes/contextual-floating-button.css +24 -7
- package/recipes/contextual-floating-button.layered.css +130 -0
- package/recipes/contextual-floating-button.layered.mjs +34 -0
- package/recipes/control-chip.layered.css +99 -0
- package/recipes/control-chip.layered.mjs +51 -0
- package/recipes/dialog.layered.css +111 -0
- package/recipes/dialog.layered.mjs +66 -0
- package/recipes/extended-action-sheet-item.layered.css +38 -0
- package/recipes/extended-action-sheet-item.layered.mjs +29 -0
- package/recipes/extended-action-sheet.layered.css +132 -0
- package/recipes/extended-action-sheet.layered.mjs +64 -0
- package/recipes/extended-fab.layered.css +79 -0
- package/recipes/extended-fab.layered.mjs +34 -0
- package/recipes/fab.layered.css +37 -0
- package/recipes/fab.layered.mjs +22 -0
- package/recipes/field-label.layered.css +35 -0
- package/recipes/field-label.layered.mjs +47 -0
- package/recipes/field.layered.css +81 -0
- package/recipes/field.layered.mjs +60 -0
- package/recipes/floating-action-button.css +15 -5
- package/recipes/floating-action-button.layered.css +101 -0
- package/recipes/floating-action-button.layered.mjs +47 -0
- package/recipes/help-bubble.css +8 -0
- package/recipes/help-bubble.layered.css +104 -0
- package/recipes/help-bubble.layered.mjs +60 -0
- package/recipes/identity-placeholder.css +2 -2
- package/recipes/identity-placeholder.d.ts +1 -1
- package/recipes/identity-placeholder.layered.css +22 -0
- package/recipes/identity-placeholder.layered.mjs +43 -0
- package/recipes/identity-placeholder.mjs +2 -1
- package/recipes/image-frame-icon.layered.css +8 -0
- package/recipes/image-frame-icon.layered.mjs +22 -0
- package/recipes/image-frame-indicator.layered.css +18 -0
- package/recipes/image-frame-indicator.layered.mjs +22 -0
- package/recipes/image-frame-reaction-button.css +9 -1
- package/recipes/image-frame-reaction-button.layered.css +43 -0
- package/recipes/image-frame-reaction-button.layered.mjs +22 -0
- package/recipes/image-frame.layered.css +28 -0
- package/recipes/image-frame.layered.mjs +34 -0
- package/recipes/inline-banner.layered.css +161 -0
- package/recipes/inline-banner.layered.mjs +64 -0
- package/recipes/input-button.css +27 -5
- package/recipes/input-button.layered.css +167 -0
- package/recipes/input-button.layered.mjs +64 -0
- package/recipes/link-content.layered.css +48 -0
- package/recipes/link-content.layered.mjs +35 -0
- package/recipes/list-header.layered.css +26 -0
- package/recipes/list-header.layered.mjs +29 -0
- package/recipes/list-item.css +63 -17
- package/recipes/list-item.layered.css +187 -0
- package/recipes/list-item.layered.mjs +59 -0
- package/recipes/manner-temp-badge.layered.css +72 -0
- package/recipes/manner-temp-badge.layered.mjs +37 -0
- package/recipes/manner-temp.layered.css +57 -0
- package/recipes/manner-temp.layered.mjs +37 -0
- package/recipes/menu-sheet-item.css +24 -3
- package/recipes/menu-sheet-item.layered.css +102 -0
- package/recipes/menu-sheet-item.layered.mjs +56 -0
- package/recipes/menu-sheet.css +18 -3
- package/recipes/menu-sheet.layered.css +167 -0
- package/recipes/menu-sheet.layered.mjs +74 -0
- package/recipes/notification-badge-positioner.layered.css +35 -0
- package/recipes/notification-badge-positioner.layered.mjs +51 -0
- package/recipes/notification-badge.layered.css +33 -0
- package/recipes/notification-badge.layered.mjs +29 -0
- package/recipes/page-banner.css +122 -22
- package/recipes/page-banner.layered.css +361 -0
- package/recipes/page-banner.layered.mjs +117 -0
- package/recipes/progress-circle.layered.css +52 -0
- package/recipes/progress-circle.layered.mjs +55 -0
- package/recipes/pull-to-refresh.layered.css +19 -0
- package/recipes/pull-to-refresh.layered.mjs +36 -0
- package/recipes/radio-group.layered.css +7 -0
- package/recipes/radio-group.layered.mjs +22 -0
- package/recipes/radio.layered.css +54 -0
- package/recipes/radio.layered.mjs +48 -0
- package/recipes/radiomark.css +34 -7
- package/recipes/radiomark.layered.css +132 -0
- package/recipes/radiomark.layered.mjs +48 -0
- package/recipes/reaction-button.css +24 -7
- package/recipes/reaction-button.layered.css +124 -0
- package/recipes/reaction-button.layered.mjs +29 -0
- package/recipes/scroll-fog.layered.css +27 -0
- package/recipes/scroll-fog.layered.mjs +28 -0
- package/recipes/segmented-control.css +31 -5
- package/recipes/segmented-control.layered.css +108 -0
- package/recipes/segmented-control.layered.mjs +40 -0
- package/recipes/select-box-group.layered.css +13 -0
- package/recipes/select-box-group.layered.mjs +22 -0
- package/recipes/select-box.css +19 -3
- package/recipes/select-box.layered.css +148 -0
- package/recipes/select-box.layered.mjs +63 -0
- package/recipes/selectBoxCheckmark.css +9 -2
- package/recipes/selectBoxCheckmark.layered.css +42 -0
- package/recipes/selectBoxCheckmark.layered.mjs +36 -0
- package/recipes/skeleton.layered.css +56 -0
- package/recipes/skeleton.layered.mjs +36 -0
- package/recipes/slider-marker.layered.css +54 -0
- package/recipes/slider-marker.layered.mjs +30 -0
- package/recipes/slider-tick.layered.css +25 -0
- package/recipes/slider-tick.layered.mjs +29 -0
- package/recipes/slider.css +41 -16
- package/recipes/slider.layered.css +238 -0
- package/recipes/slider.layered.mjs +68 -0
- package/recipes/snackbar-region.layered.css +18 -0
- package/recipes/snackbar-region.layered.mjs +22 -0
- package/recipes/snackbar.css +20 -1
- package/recipes/snackbar.layered.css +126 -0
- package/recipes/snackbar.layered.mjs +56 -0
- package/recipes/switch.layered.css +62 -0
- package/recipes/switch.layered.mjs +44 -0
- package/recipes/switchmark.css +9 -1
- package/recipes/switchmark.layered.css +100 -0
- package/recipes/switchmark.layered.mjs +49 -0
- package/recipes/tabs.css +9 -0
- package/recipes/tabs.layered.css +211 -0
- package/recipes/tabs.layered.mjs +78 -0
- package/recipes/tag-group-item.layered.css +98 -0
- package/recipes/tag-group-item.layered.mjs +55 -0
- package/recipes/tag-group.layered.css +58 -0
- package/recipes/tag-group.layered.mjs +62 -0
- package/recipes/text-input.css +1 -0
- package/recipes/text-input.layered.css +236 -0
- package/recipes/text-input.layered.mjs +73 -0
- package/recipes/text.layered.css +364 -0
- package/recipes/text.layered.mjs +90 -0
- package/recipes/toggle-button.css +42 -11
- package/recipes/toggle-button.layered.css +183 -0
- package/recipes/toggle-button.layered.mjs +34 -0
- package/vars/color/stroke.d.ts +2 -1
- package/vars/color/stroke.mjs +2 -1
- package/vars/component/action-button.d.ts +61 -61
- package/vars/component/bottom-sheet.d.ts +3 -3
- package/vars/component/bottom-sheet.mjs +3 -3
- package/vars/component/callout.d.ts +7 -7
- package/vars/component/chip-tab.d.ts +2 -1
- package/vars/component/chip-tab.mjs +2 -1
- package/vars/component/contextual-floating-button.d.ts +2 -2
- package/vars/component/identity-placeholder.d.ts +2 -2
- package/vars/component/identity-placeholder.mjs +2 -2
- package/vars/component/image-frame-floater.d.ts +1 -1
- package/vars/component/image-frame.d.ts +11 -17
- package/vars/component/image-frame.mjs +7 -12
- package/vars/component/index.d.ts +1 -0
- package/vars/component/index.mjs +1 -0
- package/vars/component/input-button.d.ts +1 -1
- package/vars/component/list-item.d.ts +1 -1
- package/vars/component/list-item.mjs +1 -1
- package/vars/component/segmented-control-indicator.d.ts +24 -0
- package/vars/component/segmented-control-indicator.mjs +24 -0
- package/vars/component/segmented-control-item.d.ts +3 -11
- package/vars/component/segmented-control-item.mjs +3 -11
- package/vars/component/segmented-control.d.ts +0 -8
- package/vars/component/segmented-control.mjs +0 -8
- package/vars/component/select-box.d.ts +1 -1
- package/vars/component/slider.d.ts +14 -10
- package/vars/component/slider.mjs +11 -10
- package/vars/component/text-input.d.ts +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import './app-screen.layered.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const appScreenSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-app-screen__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"layer",
|
|
11
|
+
"seed-app-screen__layer"
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"dim",
|
|
15
|
+
"seed-app-screen__dim"
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"edge",
|
|
19
|
+
"seed-app-screen__edge"
|
|
20
|
+
]
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const defaultVariant = {
|
|
24
|
+
"theme": "cupertino",
|
|
25
|
+
"transitionStyle": "slideFromRightIOS",
|
|
26
|
+
"layerOffsetTop": "appBar",
|
|
27
|
+
"layerOffsetBottom": "none",
|
|
28
|
+
"tone": "layer",
|
|
29
|
+
"gradient": true
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const compoundVariants = [
|
|
33
|
+
{
|
|
34
|
+
"tone": "transparent",
|
|
35
|
+
"gradient": true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"tone": "transparent",
|
|
39
|
+
"gradient": true,
|
|
40
|
+
"layerOffsetBottom": "none"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"tone": "transparent",
|
|
44
|
+
"gradient": true,
|
|
45
|
+
"layerOffsetTop": "safeArea"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"tone": "transparent",
|
|
49
|
+
"gradient": true,
|
|
50
|
+
"layerOffsetTop": "appBar"
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
export const appScreenVariantMap = {
|
|
55
|
+
"theme": [
|
|
56
|
+
"cupertino",
|
|
57
|
+
"android"
|
|
58
|
+
],
|
|
59
|
+
"transitionStyle": [
|
|
60
|
+
"slideFromRightIOS",
|
|
61
|
+
"fadeFromBottomAndroid",
|
|
62
|
+
"fadeIn"
|
|
63
|
+
],
|
|
64
|
+
"layerOffsetTop": [
|
|
65
|
+
"none",
|
|
66
|
+
"safeArea",
|
|
67
|
+
"appBar"
|
|
68
|
+
],
|
|
69
|
+
"layerOffsetBottom": [
|
|
70
|
+
"none",
|
|
71
|
+
"safeArea"
|
|
72
|
+
],
|
|
73
|
+
"tone": [
|
|
74
|
+
"layer",
|
|
75
|
+
"transparent"
|
|
76
|
+
],
|
|
77
|
+
"gradient": [
|
|
78
|
+
true,
|
|
79
|
+
false
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const appScreenVariantKeys = Object.keys(appScreenVariantMap);
|
|
84
|
+
|
|
85
|
+
export function appScreen(props) {
|
|
86
|
+
return Object.fromEntries(
|
|
87
|
+
appScreenSlotNames.map(([slot, className]) => {
|
|
88
|
+
return [
|
|
89
|
+
slot,
|
|
90
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
91
|
+
];
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
Object.assign(appScreen, { splitVariantProps: (props) => splitVariantProps(props, appScreenVariantMap) });
|
|
97
|
+
|
|
98
|
+
// @recipe(seed): app-screen
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './article.layered.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const defaultVariant = {};
|
|
5
|
+
|
|
6
|
+
const compoundVariants = [];
|
|
7
|
+
|
|
8
|
+
export const articleVariantMap = {};
|
|
9
|
+
|
|
10
|
+
export const articleVariantKeys = Object.keys(articleVariantMap);
|
|
11
|
+
|
|
12
|
+
export function article(props) {
|
|
13
|
+
return createClassName(
|
|
14
|
+
"seed-article",
|
|
15
|
+
mergeVariants(defaultVariant, props),
|
|
16
|
+
compoundVariants,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Object.assign(article, { splitVariantProps: (props) => splitVariantProps(props, articleVariantMap) });
|
|
21
|
+
|
|
22
|
+
// @recipe(seed): article
|
package/recipes/aspect-ratio.css
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@layer seed-components {
|
|
2
|
+
.seed-aspect-ratio {
|
|
3
|
+
--seed-aspect-ratio-padding: 75%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.seed-aspect-ratio:before {
|
|
7
|
+
content: "";
|
|
8
|
+
height: 0;
|
|
9
|
+
padding-bottom: var(--seed-aspect-ratio-padding);
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.seed-aspect-ratio > :not(style) {
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
position: absolute;
|
|
20
|
+
inset: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.seed-aspect-ratio > img, .seed-aspect-ratio > video {
|
|
24
|
+
object-fit: cover;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './aspect-ratio.layered.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const defaultVariant = {};
|
|
5
|
+
|
|
6
|
+
const compoundVariants = [];
|
|
7
|
+
|
|
8
|
+
export const aspectRatioVariantMap = {};
|
|
9
|
+
|
|
10
|
+
export const aspectRatioVariantKeys = Object.keys(aspectRatioVariantMap);
|
|
11
|
+
|
|
12
|
+
export function aspectRatio(props) {
|
|
13
|
+
return createClassName(
|
|
14
|
+
"seed-aspect-ratio",
|
|
15
|
+
mergeVariants(defaultVariant, props),
|
|
16
|
+
compoundVariants,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Object.assign(aspectRatio, { splitVariantProps: (props) => splitVariantProps(props, aspectRatioVariantMap) });
|
|
21
|
+
|
|
22
|
+
// @recipe(seed): aspect-ratio
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@layer seed-components {
|
|
2
|
+
.seed-avatar-stack__root {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.seed-avatar-stack__item {
|
|
9
|
+
border-radius: var(--seed-radius-full);
|
|
10
|
+
background-clip: padding-box;
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.seed-avatar-stack__item--size_20:not(:first-child) {
|
|
15
|
+
margin-left: -5px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.seed-avatar-stack__item--size_20 {
|
|
19
|
+
clip-path: inset(-1px);
|
|
20
|
+
box-shadow: 0 0 0 1px var(--seed-color-bg-layer-default);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.seed-avatar-stack__item--size_24:not(:first-child) {
|
|
24
|
+
margin-left: -6px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.seed-avatar-stack__item--size_24 {
|
|
28
|
+
clip-path: inset(-1px);
|
|
29
|
+
box-shadow: 0 0 0 1px var(--seed-color-bg-layer-default);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.seed-avatar-stack__item--size_36:not(:first-child) {
|
|
33
|
+
margin-left: -8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.seed-avatar-stack__item--size_36 {
|
|
37
|
+
clip-path: inset(-2px);
|
|
38
|
+
box-shadow: 0 0 0 2px var(--seed-color-bg-layer-default);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.seed-avatar-stack__item--size_42:not(:first-child) {
|
|
42
|
+
margin-left: -10px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.seed-avatar-stack__item--size_42 {
|
|
46
|
+
clip-path: inset(-2px);
|
|
47
|
+
box-shadow: 0 0 0 2px var(--seed-color-bg-layer-default);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.seed-avatar-stack__item--size_48:not(:first-child) {
|
|
51
|
+
margin-left: -12px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.seed-avatar-stack__item--size_48 {
|
|
55
|
+
clip-path: inset(-2px);
|
|
56
|
+
box-shadow: 0 0 0 2px var(--seed-color-bg-layer-default);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.seed-avatar-stack__item--size_64:not(:first-child) {
|
|
60
|
+
margin-left: -16px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.seed-avatar-stack__item--size_64 {
|
|
64
|
+
clip-path: inset(-3px);
|
|
65
|
+
box-shadow: 0 0 0 3px var(--seed-color-bg-layer-default);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.seed-avatar-stack__item--size_80:not(:first-child) {
|
|
69
|
+
margin-left: -20px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.seed-avatar-stack__item--size_80 {
|
|
73
|
+
clip-path: inset(-4px);
|
|
74
|
+
box-shadow: 0 0 0 4px var(--seed-color-bg-layer-default);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.seed-avatar-stack__item--size_96:not(:first-child) {
|
|
78
|
+
margin-left: -24px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.seed-avatar-stack__item--size_96 {
|
|
82
|
+
clip-path: inset(-5px);
|
|
83
|
+
box-shadow: 0 0 0 5px var(--seed-color-bg-layer-default);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.seed-avatar-stack__item--size_108:not(:first-child) {
|
|
87
|
+
margin-left: -27px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.seed-avatar-stack__item--size_108 {
|
|
91
|
+
clip-path: inset(-5px);
|
|
92
|
+
box-shadow: 0 0 0 5px var(--seed-color-bg-layer-default);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import './avatar-stack.layered.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const avatarStackSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-avatar-stack__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"item",
|
|
11
|
+
"seed-avatar-stack__item"
|
|
12
|
+
]
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const defaultVariant = {
|
|
16
|
+
"size": 48
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const compoundVariants = [];
|
|
20
|
+
|
|
21
|
+
export const avatarStackVariantMap = {
|
|
22
|
+
"size": [
|
|
23
|
+
"20",
|
|
24
|
+
"24",
|
|
25
|
+
"36",
|
|
26
|
+
"42",
|
|
27
|
+
"48",
|
|
28
|
+
"64",
|
|
29
|
+
"80",
|
|
30
|
+
"96",
|
|
31
|
+
"108"
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const avatarStackVariantKeys = Object.keys(avatarStackVariantMap);
|
|
36
|
+
|
|
37
|
+
export function avatarStack(props) {
|
|
38
|
+
return Object.fromEntries(
|
|
39
|
+
avatarStackSlotNames.map(([slot, className]) => {
|
|
40
|
+
return [
|
|
41
|
+
slot,
|
|
42
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
43
|
+
];
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Object.assign(avatarStack, { splitVariantProps: (props) => splitVariantProps(props, avatarStackVariantMap) });
|
|
49
|
+
|
|
50
|
+
// @recipe(seed): avatar-stack
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
@layer seed-components {
|
|
2
|
+
.seed-avatar__root {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
vertical-align: top;
|
|
5
|
+
border-radius: var(--seed-radius-full);
|
|
6
|
+
width: var(--avatar-size);
|
|
7
|
+
height: var(--avatar-size);
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
position: relative;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.seed-avatar__root:after {
|
|
15
|
+
content: "";
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
border-radius: var(--seed-radius-full);
|
|
18
|
+
box-shadow: inset 0 0 0 var(--avatar-stroke-width) var(--seed-color-stroke-neutral-subtle);
|
|
19
|
+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"16\" cy=\"16\" r=\"16\" fill=\"white\"/></svg>"), var(--svg-mask-uri);
|
|
20
|
+
-webkit-mask-size: 100% 100%, var(--badge-mask-size) var(--badge-mask-size);
|
|
21
|
+
-webkit-mask-position: 0 0, var(--badge-mask-offset) var(--badge-mask-offset);
|
|
22
|
+
-webkit-mask-composite: source-out;
|
|
23
|
+
-webkit-mask-repeat: no-repeat;
|
|
24
|
+
mask-image: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"16\" cy=\"16\" r=\"16\" fill=\"white\"/></svg>"), var(--svg-mask-uri);
|
|
25
|
+
mask-size: 100% 100%, var(--badge-mask-size) var(--badge-mask-size);
|
|
26
|
+
mask-position: 0 0, var(--badge-mask-offset) var(--badge-mask-offset);
|
|
27
|
+
position: absolute;
|
|
28
|
+
inset: 0;
|
|
29
|
+
transform: translateZ(0);
|
|
30
|
+
mask-repeat: no-repeat;
|
|
31
|
+
mask-composite: subtract;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.seed-avatar__image {
|
|
35
|
+
object-fit: cover;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"16\" cy=\"16\" r=\"16\" fill=\"white\"/></svg>"), var(--svg-mask-uri);
|
|
39
|
+
-webkit-mask-size: 100% 100%, var(--badge-mask-size) var(--badge-mask-size);
|
|
40
|
+
-webkit-mask-position: 0 0, var(--badge-mask-offset) var(--badge-mask-offset);
|
|
41
|
+
-webkit-mask-composite: source-out;
|
|
42
|
+
-webkit-mask-repeat: no-repeat;
|
|
43
|
+
mask-image: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"16\" cy=\"16\" r=\"16\" fill=\"white\"/></svg>"), var(--svg-mask-uri);
|
|
44
|
+
mask-size: 100% 100%, var(--badge-mask-size) var(--badge-mask-size);
|
|
45
|
+
mask-position: 0 0, var(--badge-mask-offset) var(--badge-mask-offset);
|
|
46
|
+
display: block;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
transform: translateZ(0);
|
|
49
|
+
mask-repeat: no-repeat;
|
|
50
|
+
mask-composite: subtract;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.seed-avatar__image:not([data-loading-state="loaded"]) {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.seed-avatar__fallback {
|
|
58
|
+
object-fit: cover;
|
|
59
|
+
border-radius: var(--seed-radius-full);
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"16\" cy=\"16\" r=\"16\" fill=\"white\"/></svg>"), var(--svg-mask-uri);
|
|
63
|
+
-webkit-mask-size: 100% 100%, var(--badge-mask-size) var(--badge-mask-size);
|
|
64
|
+
-webkit-mask-position: 0 0, var(--badge-mask-offset) var(--badge-mask-offset);
|
|
65
|
+
-webkit-mask-composite: source-out;
|
|
66
|
+
-webkit-mask-repeat: no-repeat;
|
|
67
|
+
mask-image: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"16\" cy=\"16\" r=\"16\" fill=\"white\"/></svg>"), var(--svg-mask-uri);
|
|
68
|
+
mask-size: 100% 100%, var(--badge-mask-size) var(--badge-mask-size);
|
|
69
|
+
mask-position: 0 0, var(--badge-mask-offset) var(--badge-mask-offset);
|
|
70
|
+
justify-content: center;
|
|
71
|
+
align-items: center;
|
|
72
|
+
display: flex;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
transform: translateZ(0);
|
|
75
|
+
mask-repeat: no-repeat;
|
|
76
|
+
mask-composite: subtract;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.seed-avatar__fallback[data-loading-state="loaded"] {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.seed-avatar__badge {
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
top: var(--badge-offset);
|
|
87
|
+
left: var(--badge-offset);
|
|
88
|
+
width: var(--badge-size);
|
|
89
|
+
height: var(--badge-size);
|
|
90
|
+
justify-content: center;
|
|
91
|
+
align-items: center;
|
|
92
|
+
display: flex;
|
|
93
|
+
position: absolute;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.seed-avatar__root--size_20 {
|
|
97
|
+
--avatar-size: 20px;
|
|
98
|
+
--avatar-stroke-width: 1px;
|
|
99
|
+
--badge-mask-size: 0px;
|
|
100
|
+
--badge-mask-offset: 0px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.seed-avatar__badge--size_20 {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.seed-avatar__root--size_24 {
|
|
108
|
+
--avatar-size: 24px;
|
|
109
|
+
--avatar-stroke-width: 1px;
|
|
110
|
+
--badge-mask-size: 12px;
|
|
111
|
+
--badge-mask-offset: 14px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.seed-avatar__badge--size_24 {
|
|
115
|
+
--badge-size: 10px;
|
|
116
|
+
--badge-offset: 15px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.seed-avatar__root--size_36 {
|
|
120
|
+
--avatar-size: 36px;
|
|
121
|
+
--avatar-stroke-width: 1px;
|
|
122
|
+
--badge-mask-size: 18px;
|
|
123
|
+
--badge-mask-offset: 20px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.seed-avatar__badge--size_36 {
|
|
127
|
+
--badge-size: 14px;
|
|
128
|
+
--badge-offset: 22px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.seed-avatar__root--size_42 {
|
|
132
|
+
--avatar-size: 42px;
|
|
133
|
+
--avatar-stroke-width: 1px;
|
|
134
|
+
--badge-mask-size: 20px;
|
|
135
|
+
--badge-mask-offset: 24px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.seed-avatar__badge--size_42 {
|
|
139
|
+
--badge-size: 16px;
|
|
140
|
+
--badge-offset: 26px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.seed-avatar__root--size_48 {
|
|
144
|
+
--avatar-size: 48px;
|
|
145
|
+
--avatar-stroke-width: 1px;
|
|
146
|
+
--badge-mask-size: 22px;
|
|
147
|
+
--badge-mask-offset: 28px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.seed-avatar__badge--size_48 {
|
|
151
|
+
--badge-size: 18px;
|
|
152
|
+
--badge-offset: 30px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.seed-avatar__root--size_64 {
|
|
156
|
+
--avatar-size: 64px;
|
|
157
|
+
--avatar-stroke-width: 1px;
|
|
158
|
+
--badge-mask-size: 26px;
|
|
159
|
+
--badge-mask-offset: 40px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.seed-avatar__badge--size_64 {
|
|
163
|
+
--badge-size: 22px;
|
|
164
|
+
--badge-offset: 42px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.seed-avatar__root--size_80 {
|
|
168
|
+
--avatar-size: 80px;
|
|
169
|
+
--avatar-stroke-width: 1px;
|
|
170
|
+
--badge-mask-size: 32px;
|
|
171
|
+
--badge-mask-offset: 52px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.seed-avatar__badge--size_80 {
|
|
175
|
+
--badge-size: 28px;
|
|
176
|
+
--badge-offset: 54px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.seed-avatar__root--size_96 {
|
|
180
|
+
--avatar-size: 96px;
|
|
181
|
+
--avatar-stroke-width: 1px;
|
|
182
|
+
--badge-mask-size: 38px;
|
|
183
|
+
--badge-mask-offset: 62px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.seed-avatar__badge--size_96 {
|
|
187
|
+
--badge-size: 32px;
|
|
188
|
+
--badge-offset: 65px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.seed-avatar__root--size_108 {
|
|
192
|
+
--avatar-size: 108px;
|
|
193
|
+
--avatar-stroke-width: 1px;
|
|
194
|
+
--badge-mask-size: 44px;
|
|
195
|
+
--badge-mask-offset: 70px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.seed-avatar__badge--size_108 {
|
|
199
|
+
--badge-size: 36px;
|
|
200
|
+
--badge-offset: 74px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.seed-avatar__root--badgeMask_none {
|
|
204
|
+
--svg-mask-uri: url("data:image/svg+xml;utf8,<svg />");
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.seed-avatar__root--badgeMask_circle {
|
|
208
|
+
--svg-mask-uri: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"16\" cy=\"16\" r=\"16\" fill=\"white\"/></svg>");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.seed-avatar__badge--badgeMask_circle {
|
|
212
|
+
border-radius: 9999px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.seed-avatar__root--badgeMask_flower {
|
|
216
|
+
--svg-mask-uri: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path shape-rendering=\"crispEdges\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M29.9115 8C28.4089 5.42609 25.682 4.02087 22.8994 4.10435C21.5637 1.68348 19.0037 0 15.9985 0C12.9933 0 10.4333 1.65565 9.09762 4.10435C6.32893 4.03478 3.60197 5.42609 2.09936 8C0.596754 10.5739 0.76371 13.6348 2.19675 16C0.749797 18.3652 0.596754 21.4261 2.09936 24C3.60197 26.5739 6.32893 27.9791 9.11154 27.8957C10.4472 30.3165 13.0072 32 16.0124 32C19.0176 32 21.5776 30.3443 22.9133 27.8957C25.682 27.9652 28.4089 26.5739 29.9115 24C31.4141 21.4261 31.2472 18.3652 29.8141 16C31.2611 13.6348 31.4141 10.5739 29.9115 8Z\" fill=\"white\"/></svg>");
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.seed-avatar__root--badgeMask_shield {
|
|
220
|
+
--svg-mask-uri: url("data:image/svg+xml;utf8,<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18.137 31.4527C18.1171 31.4616 18.0943 31.4721 18.0531 31.491C18.046 31.4943 18.0356 31.4994 18.0221 31.5059C17.8282 31.5996 16.9959 32.0019 16.0001 32C15.0096 32.002 14.1895 31.6075 13.986 31.5096L13.8629 31.4527C13.5452 31.3105 13.1039 31.1059 12.5795 30.8436C11.541 30.3242 10.1273 29.554 8.68691 28.5676C7.2706 27.5976 5.67543 26.3154 4.39746 24.7323C3.12739 23.159 1.92743 20.9794 1.92743 18.3179V7.77468C1.92743 6.02645 3.02031 4.4647 4.66276 3.86583L14.5747 0.25173C15.4953 -0.0839101 16.5047 -0.0839101 17.4252 0.25173L27.3372 3.86583C28.9796 4.4647 30.0725 6.02646 30.0725 7.77468V18.3179C30.0725 20.9794 28.8726 23.159 27.6025 24.7323C26.3245 26.3154 24.7294 27.5976 23.313 28.5676C21.8727 29.554 20.4589 30.3242 19.4205 30.8436C18.8961 31.1059 18.4547 31.3106 18.137 31.4527Z\" fill=\"white\"/></svg>");
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import './avatar.layered.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const avatarSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-avatar__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"image",
|
|
11
|
+
"seed-avatar__image"
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"fallback",
|
|
15
|
+
"seed-avatar__fallback"
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"badge",
|
|
19
|
+
"seed-avatar__badge"
|
|
20
|
+
]
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const defaultVariant = {
|
|
24
|
+
"size": 48,
|
|
25
|
+
"badgeMask": "none"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const compoundVariants = [];
|
|
29
|
+
|
|
30
|
+
export const avatarVariantMap = {
|
|
31
|
+
"size": [
|
|
32
|
+
"20",
|
|
33
|
+
"24",
|
|
34
|
+
"36",
|
|
35
|
+
"42",
|
|
36
|
+
"48",
|
|
37
|
+
"64",
|
|
38
|
+
"80",
|
|
39
|
+
"96",
|
|
40
|
+
"108"
|
|
41
|
+
],
|
|
42
|
+
"badgeMask": [
|
|
43
|
+
"none",
|
|
44
|
+
"circle",
|
|
45
|
+
"flower",
|
|
46
|
+
"shield"
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const avatarVariantKeys = Object.keys(avatarVariantMap);
|
|
51
|
+
|
|
52
|
+
export function avatar(props) {
|
|
53
|
+
return Object.fromEntries(
|
|
54
|
+
avatarSlotNames.map(([slot, className]) => {
|
|
55
|
+
return [
|
|
56
|
+
slot,
|
|
57
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
58
|
+
];
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Object.assign(avatar, { splitVariantProps: (props) => splitVariantProps(props, avatarVariantMap) });
|
|
64
|
+
|
|
65
|
+
// @recipe(seed): avatar
|