@seed-design/css 2.2.2 → 2.3.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/all.css +1274 -198
- package/all.layered.css +1274 -198
- package/all.layered.min.css +1 -1
- package/all.min.css +1 -1
- package/package.json +1 -1
- package/recipes/content-dialog.css +258 -0
- package/recipes/content-dialog.d.ts +24 -0
- package/recipes/content-dialog.layered.css +290 -0
- package/recipes/content-dialog.layered.mjs +71 -0
- package/recipes/content-dialog.mjs +71 -0
- package/recipes/quantity-picker.css +230 -0
- package/recipes/quantity-picker.d.ts +24 -0
- package/recipes/quantity-picker.layered.css +273 -0
- package/recipes/quantity-picker.layered.mjs +72 -0
- package/recipes/quantity-picker.mjs +72 -0
- package/recipes/select-item.css +161 -0
- package/recipes/select-item.d.ts +28 -0
- package/recipes/select-item.layered.css +191 -0
- package/recipes/select-item.layered.mjs +60 -0
- package/recipes/select-item.mjs +60 -0
- package/recipes/select-trigger.css +208 -0
- package/recipes/select-trigger.d.ts +28 -0
- package/recipes/select-trigger.layered.css +227 -0
- package/recipes/select-trigger.layered.mjs +56 -0
- package/recipes/select-trigger.mjs +56 -0
- package/recipes/select.css +93 -0
- package/recipes/select.d.ts +28 -0
- package/recipes/select.layered.css +108 -0
- package/recipes/select.layered.mjs +56 -0
- package/recipes/select.mjs +56 -0
- package/vars/component/alert-dialog.d.ts +52 -0
- package/vars/component/alert-dialog.mjs +52 -0
- package/vars/component/dialog-close-button.d.ts +24 -0
- package/vars/component/dialog-close-button.mjs +24 -0
- package/vars/component/dialog.d.ts +50 -11
- package/vars/component/dialog.mjs +42 -11
- package/vars/component/index.d.ts +7 -0
- package/vars/component/index.mjs +7 -0
- package/vars/component/quantity-picker-button.d.ts +78 -0
- package/vars/component/quantity-picker-button.mjs +78 -0
- package/vars/component/quantity-picker.d.ts +80 -0
- package/vars/component/quantity-picker.mjs +80 -0
- package/vars/component/select-item.d.ts +101 -0
- package/vars/component/select-item.mjs +95 -0
- package/vars/component/select-trigger.d.ts +127 -0
- package/vars/component/select-trigger.mjs +120 -0
- package/vars/component/select.d.ts +62 -0
- package/vars/component/select.mjs +54 -0
package/package.json
CHANGED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
.seed-content-dialog__positioner {
|
|
2
|
+
position: fixed;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
inset: 0;
|
|
7
|
+
overscroll-behavior-y: none;
|
|
8
|
+
--dialog-z-index: 2;
|
|
9
|
+
z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
|
|
10
|
+
}
|
|
11
|
+
.seed-content-dialog__backdrop {
|
|
12
|
+
position: fixed;
|
|
13
|
+
inset: 0;
|
|
14
|
+
background: var(--seed-color-bg-overlay);
|
|
15
|
+
z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
|
|
16
|
+
}
|
|
17
|
+
.seed-content-dialog__backdrop:is([data-state="open"], [data-open]) {
|
|
18
|
+
animation: seed-enter;
|
|
19
|
+
animation-timing-function: var(--seed-timing-function-enter);
|
|
20
|
+
animation-duration: var(--seed-duration-d2);
|
|
21
|
+
--seed-enter-translate-x: 0;
|
|
22
|
+
--seed-enter-translate-y: 0;
|
|
23
|
+
--seed-enter-opacity: 0;
|
|
24
|
+
--seed-enter-scale: 1;
|
|
25
|
+
}
|
|
26
|
+
.seed-content-dialog__backdrop:not(:is([data-state="open"], [data-open])) {
|
|
27
|
+
animation: seed-exit;
|
|
28
|
+
animation-timing-function: var(--seed-timing-function-exit);
|
|
29
|
+
animation-duration: var(--seed-duration-d2);
|
|
30
|
+
animation-fill-mode: forwards;
|
|
31
|
+
--seed-exit-translate-x: 0;
|
|
32
|
+
--seed-exit-translate-y: 0;
|
|
33
|
+
--seed-exit-opacity: 0;
|
|
34
|
+
--seed-exit-scale: 1;
|
|
35
|
+
}
|
|
36
|
+
.seed-content-dialog__content {
|
|
37
|
+
position: relative;
|
|
38
|
+
outline: none;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex: 0 0 auto;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
word-break: break-all;
|
|
44
|
+
z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
|
|
45
|
+
background: var(--seed-color-bg-layer-floating);
|
|
46
|
+
border-radius: var(--seed-radius-r5);
|
|
47
|
+
--content-dialog-default-width: calc(0.9 * 100vw);
|
|
48
|
+
--content-dialog-default-max-width: calc(0.9 * 100%);
|
|
49
|
+
--seed-box-width-base: var(--content-dialog-default-width);
|
|
50
|
+
--seed-box-width-sm: var(--seed-box-width-base, initial);
|
|
51
|
+
--seed-box-width-md: var(--seed-box-width-sm, initial);
|
|
52
|
+
--seed-box-width-lg: var(--seed-box-width-md, initial);
|
|
53
|
+
--seed-box-width-xl: var(--seed-box-width-lg, initial);
|
|
54
|
+
--seed-box-width: var(--seed-box-width-base, initial);
|
|
55
|
+
--seed-box-max-width-base: var(--content-dialog-default-max-width);
|
|
56
|
+
--seed-box-max-width-sm: var(--seed-box-max-width-base, initial);
|
|
57
|
+
--seed-box-max-width-md: var(--seed-box-max-width-sm, initial);
|
|
58
|
+
--seed-box-max-width-lg: var(--seed-box-max-width-md, initial);
|
|
59
|
+
--seed-box-max-width-xl: var(--seed-box-max-width-lg, initial);
|
|
60
|
+
--seed-box-max-width: var(--seed-box-max-width-base, initial);
|
|
61
|
+
width: var(--seed-box-width);
|
|
62
|
+
max-width: var(--seed-box-max-width);
|
|
63
|
+
max-height: calc(0.8 * 100vh);
|
|
64
|
+
max-height: calc(0.8 * 100dvh);
|
|
65
|
+
}
|
|
66
|
+
@media (min-width: 768px) {
|
|
67
|
+
.seed-content-dialog__content {
|
|
68
|
+
--content-dialog-default-width: var(--content-dialog-size-width);
|
|
69
|
+
--content-dialog-default-max-width: calc(100vw - 2 * var(--seed-dimension-x5));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.seed-content-dialog__content:is([data-state="open"], [data-open]) {
|
|
73
|
+
animation: seed-enter;
|
|
74
|
+
animation-timing-function: var(--seed-timing-function-enter-expressive);
|
|
75
|
+
animation-duration: var(--seed-duration-d4);
|
|
76
|
+
--seed-enter-translate-x: 0;
|
|
77
|
+
--seed-enter-translate-y: 0;
|
|
78
|
+
--seed-enter-opacity: 0;
|
|
79
|
+
--seed-enter-scale: 1.3;
|
|
80
|
+
}
|
|
81
|
+
.seed-content-dialog__content:not(:is([data-state="open"], [data-open])) {
|
|
82
|
+
animation: seed-exit;
|
|
83
|
+
animation-timing-function: var(--seed-timing-function-exit);
|
|
84
|
+
animation-duration: var(--seed-duration-d2);
|
|
85
|
+
animation-fill-mode: forwards;
|
|
86
|
+
--seed-exit-translate-x: 0;
|
|
87
|
+
--seed-exit-translate-y: 0;
|
|
88
|
+
--seed-exit-opacity: 0;
|
|
89
|
+
--seed-exit-scale: 1;
|
|
90
|
+
}
|
|
91
|
+
.seed-content-dialog__header {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
gap: var(--seed-dimension-x1_5);
|
|
96
|
+
padding-inline: var(--seed-dimension-x6);
|
|
97
|
+
padding-top: var(--seed-dimension-x6);
|
|
98
|
+
padding-bottom: var(--seed-dimension-x4);
|
|
99
|
+
}
|
|
100
|
+
.seed-content-dialog__header[data-show-close-button] {
|
|
101
|
+
padding-right: calc(var(--seed-dimension-x6) + 22px + var(--seed-dimension-x1_5));
|
|
102
|
+
}
|
|
103
|
+
.seed-content-dialog__body {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
flex: 1;
|
|
108
|
+
overflow-y: auto;
|
|
109
|
+
--seed-box-padding-x-base: var(--seed-dimension-x6);
|
|
110
|
+
--seed-box-padding-x-sm: var(--seed-box-padding-x-base, initial);
|
|
111
|
+
--seed-box-padding-x-md: var(--seed-box-padding-x-sm, initial);
|
|
112
|
+
--seed-box-padding-x-lg: var(--seed-box-padding-x-md, initial);
|
|
113
|
+
--seed-box-padding-x-xl: var(--seed-box-padding-x-lg, initial);
|
|
114
|
+
--seed-box-padding-x: var(--seed-box-padding-x-base, initial);
|
|
115
|
+
--seed-box-min-height-base: 0;
|
|
116
|
+
--seed-box-min-height-sm: var(--seed-box-min-height-base, initial);
|
|
117
|
+
--seed-box-min-height-md: var(--seed-box-min-height-sm, initial);
|
|
118
|
+
--seed-box-min-height-lg: var(--seed-box-min-height-md, initial);
|
|
119
|
+
--seed-box-min-height-xl: var(--seed-box-min-height-lg, initial);
|
|
120
|
+
--seed-box-min-height: var(--seed-box-min-height-base, initial);
|
|
121
|
+
--seed-box-max-height-base: none;
|
|
122
|
+
--seed-box-max-height-sm: var(--seed-box-max-height-base, initial);
|
|
123
|
+
--seed-box-max-height-md: var(--seed-box-max-height-sm, initial);
|
|
124
|
+
--seed-box-max-height-lg: var(--seed-box-max-height-md, initial);
|
|
125
|
+
--seed-box-max-height-xl: var(--seed-box-max-height-lg, initial);
|
|
126
|
+
--seed-box-max-height: var(--seed-box-max-height-base, initial);
|
|
127
|
+
--seed-box-justify-content: initial;
|
|
128
|
+
--seed-box-align-items: initial;
|
|
129
|
+
padding-inline: var(--seed-box-padding-x);
|
|
130
|
+
min-height: var(--seed-box-min-height);
|
|
131
|
+
max-height: var(--seed-box-max-height);
|
|
132
|
+
justify-content: var(--seed-box-justify-content);
|
|
133
|
+
align-items: var(--seed-box-align-items);
|
|
134
|
+
transition: box-shadow var(--seed-duration-color-transition) var(--seed-timing-function-easing);
|
|
135
|
+
}
|
|
136
|
+
.seed-content-dialog__body[data-scrolled]:not(:first-child) {
|
|
137
|
+
box-shadow: inset 0 1px 0 0 var(--seed-color-stroke-neutral-muted);
|
|
138
|
+
}
|
|
139
|
+
.seed-content-dialog__body[data-overflow] {
|
|
140
|
+
padding-bottom: var(--seed-dimension-x12);
|
|
141
|
+
mask-image: linear-gradient(to top, transparent 0, black var(--seed-dimension-x12));
|
|
142
|
+
-webkit-mask-image: linear-gradient(to top, transparent 0, black var(--seed-dimension-x12));
|
|
143
|
+
}
|
|
144
|
+
.seed-content-dialog__body {
|
|
145
|
+
outline: var(--seed-dimension-x0_5) solid transparent;
|
|
146
|
+
outline-offset: calc(var(--seed-dimension-x0_5) * -1);
|
|
147
|
+
}
|
|
148
|
+
.seed-content-dialog__body:is(:focus-visible, [data-focus-visible]) {
|
|
149
|
+
outline: var(--seed-dimension-x0_5) solid var(--seed-color-stroke-focus-ring);
|
|
150
|
+
outline-offset: calc(var(--seed-dimension-x0_5) * -1);
|
|
151
|
+
}
|
|
152
|
+
.seed-content-dialog__title {
|
|
153
|
+
color: var(--seed-color-fg-neutral);
|
|
154
|
+
font-size: var(--seed-font-size-t8);
|
|
155
|
+
line-height: var(--seed-line-height-t8);
|
|
156
|
+
font-weight: var(--seed-font-weight-bold);
|
|
157
|
+
margin: 0;
|
|
158
|
+
}
|
|
159
|
+
.seed-content-dialog__description {
|
|
160
|
+
color: var(--seed-color-fg-neutral-muted);
|
|
161
|
+
font-size: var(--seed-font-size-t5);
|
|
162
|
+
line-height: var(--seed-line-height-t5);
|
|
163
|
+
font-weight: var(--seed-font-weight-regular);
|
|
164
|
+
margin: 0;
|
|
165
|
+
white-space: pre-wrap;
|
|
166
|
+
}
|
|
167
|
+
.seed-content-dialog__footer {
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
align-items: stretch;
|
|
171
|
+
flex-shrink: 0;
|
|
172
|
+
padding-inline: var(--seed-dimension-x6);
|
|
173
|
+
padding-top: var(--seed-dimension-x4);
|
|
174
|
+
padding-bottom: var(--seed-dimension-x6);
|
|
175
|
+
}
|
|
176
|
+
.seed-content-dialog__closeButton {
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: var(--seed-dimension-x7);
|
|
179
|
+
right: var(--seed-dimension-x6);
|
|
180
|
+
display: flex;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
align-items: center;
|
|
183
|
+
border: none;
|
|
184
|
+
background: var(--seed-color-bg-transparent);
|
|
185
|
+
border-radius: var(--seed-radius-r3);
|
|
186
|
+
padding: calc((52px - 22px) / 2);
|
|
187
|
+
margin: calc((22px - 52px) / 2);
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
transition: background var(--seed-duration-color-transition) var(--seed-timing-function-easing), outline-color var(--seed-duration-d3) var(--seed-timing-function-easing);
|
|
190
|
+
--seed-icon-size: 22px;
|
|
191
|
+
--seed-icon-color: var(--seed-color-fg-neutral-subtle);
|
|
192
|
+
outline: var(--seed-dimension-x0_5) solid transparent;
|
|
193
|
+
outline-offset: var(--seed-dimension-x0_5);
|
|
194
|
+
}
|
|
195
|
+
.seed-content-dialog__closeButton:is(:focus-visible, [data-focus-visible]) {
|
|
196
|
+
outline: var(--seed-dimension-x0_5) solid var(--seed-color-stroke-focus-ring);
|
|
197
|
+
outline-offset: var(--seed-dimension-x0_5);
|
|
198
|
+
}
|
|
199
|
+
@media (hover: hover) and (pointer: fine) {
|
|
200
|
+
.seed-content-dialog__closeButton:is(:hover, [data-hover]) {
|
|
201
|
+
background: var(--seed-color-bg-transparent-pressed);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
@media not all and (hover: hover) and (pointer: fine) {
|
|
205
|
+
.seed-content-dialog__closeButton:is(:active, [data-active]) {
|
|
206
|
+
background: var(--seed-color-bg-transparent-pressed);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
.seed-content-dialog__content--size_medium {
|
|
210
|
+
--content-dialog-size-width: 480px;
|
|
211
|
+
}
|
|
212
|
+
.seed-content-dialog__content--size_large {
|
|
213
|
+
--content-dialog-size-width: 800px;
|
|
214
|
+
}
|
|
215
|
+
@media (min-width: 480px) {
|
|
216
|
+
.seed-content-dialog__content {
|
|
217
|
+
--seed-box-width: var(--seed-box-width-sm, initial);
|
|
218
|
+
--seed-box-max-width: var(--seed-box-max-width-sm, initial);
|
|
219
|
+
}
|
|
220
|
+
.seed-content-dialog__body {
|
|
221
|
+
--seed-box-padding-x: var(--seed-box-padding-x-sm, initial);
|
|
222
|
+
--seed-box-min-height: var(--seed-box-min-height-sm, initial);
|
|
223
|
+
--seed-box-max-height: var(--seed-box-max-height-sm, initial);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
@media (min-width: 768px) {
|
|
227
|
+
.seed-content-dialog__content {
|
|
228
|
+
--seed-box-width: var(--seed-box-width-md, initial);
|
|
229
|
+
--seed-box-max-width: var(--seed-box-max-width-md, initial);
|
|
230
|
+
}
|
|
231
|
+
.seed-content-dialog__body {
|
|
232
|
+
--seed-box-padding-x: var(--seed-box-padding-x-md, initial);
|
|
233
|
+
--seed-box-min-height: var(--seed-box-min-height-md, initial);
|
|
234
|
+
--seed-box-max-height: var(--seed-box-max-height-md, initial);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
@media (min-width: 1280px) {
|
|
238
|
+
.seed-content-dialog__content {
|
|
239
|
+
--seed-box-width: var(--seed-box-width-lg, initial);
|
|
240
|
+
--seed-box-max-width: var(--seed-box-max-width-lg, initial);
|
|
241
|
+
}
|
|
242
|
+
.seed-content-dialog__body {
|
|
243
|
+
--seed-box-padding-x: var(--seed-box-padding-x-lg, initial);
|
|
244
|
+
--seed-box-min-height: var(--seed-box-min-height-lg, initial);
|
|
245
|
+
--seed-box-max-height: var(--seed-box-max-height-lg, initial);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
@media (min-width: 1440px) {
|
|
249
|
+
.seed-content-dialog__content {
|
|
250
|
+
--seed-box-width: var(--seed-box-width-xl, initial);
|
|
251
|
+
--seed-box-max-width: var(--seed-box-max-width-xl, initial);
|
|
252
|
+
}
|
|
253
|
+
.seed-content-dialog__body {
|
|
254
|
+
--seed-box-padding-x: var(--seed-box-padding-x-xl, initial);
|
|
255
|
+
--seed-box-min-height: var(--seed-box-min-height-xl, initial);
|
|
256
|
+
--seed-box-max-height: var(--seed-box-max-height-xl, initial);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare interface ContentDialogVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default "medium"
|
|
4
|
+
*/
|
|
5
|
+
size: "medium" | "large";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare type ContentDialogVariantMap = {
|
|
9
|
+
[key in keyof ContentDialogVariant]: Array<ContentDialogVariant[key]>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare type ContentDialogVariantProps = Partial<ContentDialogVariant>;
|
|
13
|
+
|
|
14
|
+
export declare type ContentDialogSlotName = "positioner" | "backdrop" | "content" | "header" | "body" | "footer" | "title" | "description" | "closeButton";
|
|
15
|
+
|
|
16
|
+
export declare const contentDialogVariantMap: ContentDialogVariantMap;
|
|
17
|
+
|
|
18
|
+
export declare const contentDialog: ((
|
|
19
|
+
props?: ContentDialogVariantProps,
|
|
20
|
+
) => Record<ContentDialogSlotName, string>) & {
|
|
21
|
+
splitVariantProps: <T extends ContentDialogVariantProps>(
|
|
22
|
+
props: T,
|
|
23
|
+
) => [ContentDialogVariantProps, Omit<T, keyof ContentDialogVariantProps>];
|
|
24
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
@layer seed-components {
|
|
2
|
+
.seed-content-dialog__positioner {
|
|
3
|
+
overscroll-behavior-y: none;
|
|
4
|
+
--dialog-z-index: 2;
|
|
5
|
+
z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
display: flex;
|
|
9
|
+
position: fixed;
|
|
10
|
+
inset: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.seed-content-dialog__backdrop {
|
|
14
|
+
background: var(--seed-color-bg-overlay);
|
|
15
|
+
z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
|
|
16
|
+
position: fixed;
|
|
17
|
+
inset: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.seed-content-dialog__backdrop:is([data-state="open"], [data-open]) {
|
|
21
|
+
animation: seed-enter;
|
|
22
|
+
animation-timing-function: var(--seed-timing-function-enter);
|
|
23
|
+
animation-duration: var(--seed-duration-d2);
|
|
24
|
+
--seed-enter-translate-x: 0;
|
|
25
|
+
--seed-enter-translate-y: 0;
|
|
26
|
+
--seed-enter-opacity: 0;
|
|
27
|
+
--seed-enter-scale: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.seed-content-dialog__backdrop:not(:is([data-state="open"], [data-open])) {
|
|
31
|
+
animation: seed-exit;
|
|
32
|
+
animation-timing-function: var(--seed-timing-function-exit);
|
|
33
|
+
animation-duration: var(--seed-duration-d2);
|
|
34
|
+
--seed-exit-translate-x: 0;
|
|
35
|
+
--seed-exit-translate-y: 0;
|
|
36
|
+
--seed-exit-opacity: 0;
|
|
37
|
+
--seed-exit-scale: 1;
|
|
38
|
+
animation-fill-mode: forwards;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.seed-content-dialog__content {
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
word-break: break-all;
|
|
44
|
+
z-index: calc(var(--dialog-z-index) + var(--layer-index, 0));
|
|
45
|
+
background: var(--seed-color-bg-layer-floating);
|
|
46
|
+
border-radius: var(--seed-radius-r5);
|
|
47
|
+
--content-dialog-default-width: calc(.9 * 100vw);
|
|
48
|
+
--content-dialog-default-max-width: calc(.9 * 100%);
|
|
49
|
+
--seed-box-width-base: var(--content-dialog-default-width);
|
|
50
|
+
--seed-box-width-sm: var(--seed-box-width-base, initial);
|
|
51
|
+
--seed-box-width-md: var(--seed-box-width-sm, initial);
|
|
52
|
+
--seed-box-width-lg: var(--seed-box-width-md, initial);
|
|
53
|
+
--seed-box-width-xl: var(--seed-box-width-lg, initial);
|
|
54
|
+
--seed-box-width: var(--seed-box-width-base, initial);
|
|
55
|
+
--seed-box-max-width-base: var(--content-dialog-default-max-width);
|
|
56
|
+
--seed-box-max-width-sm: var(--seed-box-max-width-base, initial);
|
|
57
|
+
--seed-box-max-width-md: var(--seed-box-max-width-sm, initial);
|
|
58
|
+
--seed-box-max-width-lg: var(--seed-box-max-width-md, initial);
|
|
59
|
+
--seed-box-max-width-xl: var(--seed-box-max-width-lg, initial);
|
|
60
|
+
--seed-box-max-width: var(--seed-box-max-width-base, initial);
|
|
61
|
+
width: var(--seed-box-width);
|
|
62
|
+
max-width: var(--seed-box-max-width);
|
|
63
|
+
outline: none;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
flex: none;
|
|
66
|
+
max-height: 80dvh;
|
|
67
|
+
display: flex;
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (width >= 768px) {
|
|
72
|
+
.seed-content-dialog__content {
|
|
73
|
+
--content-dialog-default-width: var(--content-dialog-size-width);
|
|
74
|
+
--content-dialog-default-max-width: calc(100vw - 2 * var(--seed-dimension-x5));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.seed-content-dialog__content:is([data-state="open"], [data-open]) {
|
|
79
|
+
animation: seed-enter;
|
|
80
|
+
animation-timing-function: var(--seed-timing-function-enter-expressive);
|
|
81
|
+
animation-duration: var(--seed-duration-d4);
|
|
82
|
+
--seed-enter-translate-x: 0;
|
|
83
|
+
--seed-enter-translate-y: 0;
|
|
84
|
+
--seed-enter-opacity: 0;
|
|
85
|
+
--seed-enter-scale: 1.3;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.seed-content-dialog__content:not(:is([data-state="open"], [data-open])) {
|
|
89
|
+
animation: seed-exit;
|
|
90
|
+
animation-timing-function: var(--seed-timing-function-exit);
|
|
91
|
+
animation-duration: var(--seed-duration-d2);
|
|
92
|
+
--seed-exit-translate-x: 0;
|
|
93
|
+
--seed-exit-translate-y: 0;
|
|
94
|
+
--seed-exit-opacity: 0;
|
|
95
|
+
--seed-exit-scale: 1;
|
|
96
|
+
animation-fill-mode: forwards;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.seed-content-dialog__header {
|
|
100
|
+
gap: var(--seed-dimension-x1_5);
|
|
101
|
+
padding-inline: var(--seed-dimension-x6);
|
|
102
|
+
padding-top: var(--seed-dimension-x6);
|
|
103
|
+
padding-bottom: var(--seed-dimension-x4);
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
display: flex;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.seed-content-dialog__header[data-show-close-button] {
|
|
110
|
+
padding-right: calc(var(--seed-dimension-x6) + 22px + var(--seed-dimension-x1_5));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.seed-content-dialog__body {
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
--seed-box-padding-x-base: var(--seed-dimension-x6);
|
|
116
|
+
--seed-box-padding-x-sm: var(--seed-box-padding-x-base, initial);
|
|
117
|
+
--seed-box-padding-x-md: var(--seed-box-padding-x-sm, initial);
|
|
118
|
+
--seed-box-padding-x-lg: var(--seed-box-padding-x-md, initial);
|
|
119
|
+
--seed-box-padding-x-xl: var(--seed-box-padding-x-lg, initial);
|
|
120
|
+
--seed-box-padding-x: var(--seed-box-padding-x-base, initial);
|
|
121
|
+
--seed-box-min-height-base: 0;
|
|
122
|
+
--seed-box-min-height-sm: var(--seed-box-min-height-base, initial);
|
|
123
|
+
--seed-box-min-height-md: var(--seed-box-min-height-sm, initial);
|
|
124
|
+
--seed-box-min-height-lg: var(--seed-box-min-height-md, initial);
|
|
125
|
+
--seed-box-min-height-xl: var(--seed-box-min-height-lg, initial);
|
|
126
|
+
--seed-box-min-height: var(--seed-box-min-height-base, initial);
|
|
127
|
+
--seed-box-max-height-base: none;
|
|
128
|
+
--seed-box-max-height-sm: var(--seed-box-max-height-base, initial);
|
|
129
|
+
--seed-box-max-height-md: var(--seed-box-max-height-sm, initial);
|
|
130
|
+
--seed-box-max-height-lg: var(--seed-box-max-height-md, initial);
|
|
131
|
+
--seed-box-max-height-xl: var(--seed-box-max-height-lg, initial);
|
|
132
|
+
--seed-box-max-height: var(--seed-box-max-height-base, initial);
|
|
133
|
+
--seed-box-justify-content: initial;
|
|
134
|
+
--seed-box-align-items: initial;
|
|
135
|
+
padding-inline: var(--seed-box-padding-x);
|
|
136
|
+
min-height: var(--seed-box-min-height);
|
|
137
|
+
max-height: var(--seed-box-max-height);
|
|
138
|
+
justify-content: var(--seed-box-justify-content);
|
|
139
|
+
align-items: var(--seed-box-align-items);
|
|
140
|
+
transition: box-shadow var(--seed-duration-color-transition) var(--seed-timing-function-easing);
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
flex: 1;
|
|
143
|
+
display: flex;
|
|
144
|
+
overflow-y: auto;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.seed-content-dialog__body[data-scrolled]:not(:first-child) {
|
|
148
|
+
box-shadow: inset 0 1px 0 0 var(--seed-color-stroke-neutral-muted);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.seed-content-dialog__body[data-overflow] {
|
|
152
|
+
padding-bottom: var(--seed-dimension-x12);
|
|
153
|
+
mask-image: linear-gradient(to top, transparent 0, black var(--seed-dimension-x12));
|
|
154
|
+
-webkit-mask-image: linear-gradient(to top, transparent 0, black var(--seed-dimension-x12));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.seed-content-dialog__body {
|
|
158
|
+
outline: var(--seed-dimension-x0_5) solid transparent;
|
|
159
|
+
outline-offset: calc(var(--seed-dimension-x0_5) * -1);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.seed-content-dialog__body:is(:focus-visible, [data-focus-visible]) {
|
|
163
|
+
outline: var(--seed-dimension-x0_5) solid var(--seed-color-stroke-focus-ring);
|
|
164
|
+
outline-offset: calc(var(--seed-dimension-x0_5) * -1);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.seed-content-dialog__title {
|
|
168
|
+
color: var(--seed-color-fg-neutral);
|
|
169
|
+
font-size: var(--seed-font-size-t8);
|
|
170
|
+
line-height: var(--seed-line-height-t8);
|
|
171
|
+
font-weight: var(--seed-font-weight-bold);
|
|
172
|
+
margin: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.seed-content-dialog__description {
|
|
176
|
+
color: var(--seed-color-fg-neutral-muted);
|
|
177
|
+
font-size: var(--seed-font-size-t5);
|
|
178
|
+
line-height: var(--seed-line-height-t5);
|
|
179
|
+
font-weight: var(--seed-font-weight-regular);
|
|
180
|
+
white-space: pre-wrap;
|
|
181
|
+
margin: 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.seed-content-dialog__footer {
|
|
185
|
+
padding-inline: var(--seed-dimension-x6);
|
|
186
|
+
padding-top: var(--seed-dimension-x4);
|
|
187
|
+
padding-bottom: var(--seed-dimension-x6);
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
flex-shrink: 0;
|
|
190
|
+
align-items: stretch;
|
|
191
|
+
display: flex;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.seed-content-dialog__closeButton {
|
|
195
|
+
top: var(--seed-dimension-x7);
|
|
196
|
+
right: var(--seed-dimension-x6);
|
|
197
|
+
background: var(--seed-color-bg-transparent);
|
|
198
|
+
border-radius: var(--seed-radius-r3);
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
transition: background var(--seed-duration-color-transition) var(--seed-timing-function-easing), outline-color var(--seed-duration-d3) var(--seed-timing-function-easing);
|
|
201
|
+
--seed-icon-size: 22px;
|
|
202
|
+
--seed-icon-color: var(--seed-color-fg-neutral-subtle);
|
|
203
|
+
outline: var(--seed-dimension-x0_5) solid transparent;
|
|
204
|
+
outline-offset: var(--seed-dimension-x0_5);
|
|
205
|
+
border: none;
|
|
206
|
+
justify-content: center;
|
|
207
|
+
align-items: center;
|
|
208
|
+
margin: -15px;
|
|
209
|
+
padding: 15px;
|
|
210
|
+
display: flex;
|
|
211
|
+
position: absolute;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.seed-content-dialog__closeButton:is(:focus-visible, [data-focus-visible]) {
|
|
215
|
+
outline: var(--seed-dimension-x0_5) solid var(--seed-color-stroke-focus-ring);
|
|
216
|
+
outline-offset: var(--seed-dimension-x0_5);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@media (hover: hover) and (pointer: fine) {
|
|
220
|
+
.seed-content-dialog__closeButton:is(:hover, [data-hover]) {
|
|
221
|
+
background: var(--seed-color-bg-transparent-pressed);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@media not all and (hover: hover) and (pointer: fine) {
|
|
226
|
+
.seed-content-dialog__closeButton:is(:active, [data-active]) {
|
|
227
|
+
background: var(--seed-color-bg-transparent-pressed);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.seed-content-dialog__content--size_medium {
|
|
232
|
+
--content-dialog-size-width: 480px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.seed-content-dialog__content--size_large {
|
|
236
|
+
--content-dialog-size-width: 800px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@media (width >= 480px) {
|
|
240
|
+
.seed-content-dialog__content {
|
|
241
|
+
--seed-box-width: var(--seed-box-width-sm, initial);
|
|
242
|
+
--seed-box-max-width: var(--seed-box-max-width-sm, initial);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.seed-content-dialog__body {
|
|
246
|
+
--seed-box-padding-x: var(--seed-box-padding-x-sm, initial);
|
|
247
|
+
--seed-box-min-height: var(--seed-box-min-height-sm, initial);
|
|
248
|
+
--seed-box-max-height: var(--seed-box-max-height-sm, initial);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@media (width >= 768px) {
|
|
253
|
+
.seed-content-dialog__content {
|
|
254
|
+
--seed-box-width: var(--seed-box-width-md, initial);
|
|
255
|
+
--seed-box-max-width: var(--seed-box-max-width-md, initial);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.seed-content-dialog__body {
|
|
259
|
+
--seed-box-padding-x: var(--seed-box-padding-x-md, initial);
|
|
260
|
+
--seed-box-min-height: var(--seed-box-min-height-md, initial);
|
|
261
|
+
--seed-box-max-height: var(--seed-box-max-height-md, initial);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@media (width >= 1280px) {
|
|
266
|
+
.seed-content-dialog__content {
|
|
267
|
+
--seed-box-width: var(--seed-box-width-lg, initial);
|
|
268
|
+
--seed-box-max-width: var(--seed-box-max-width-lg, initial);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.seed-content-dialog__body {
|
|
272
|
+
--seed-box-padding-x: var(--seed-box-padding-x-lg, initial);
|
|
273
|
+
--seed-box-min-height: var(--seed-box-min-height-lg, initial);
|
|
274
|
+
--seed-box-max-height: var(--seed-box-max-height-lg, initial);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@media (width >= 1440px) {
|
|
279
|
+
.seed-content-dialog__content {
|
|
280
|
+
--seed-box-width: var(--seed-box-width-xl, initial);
|
|
281
|
+
--seed-box-max-width: var(--seed-box-max-width-xl, initial);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.seed-content-dialog__body {
|
|
285
|
+
--seed-box-padding-x: var(--seed-box-padding-x-xl, initial);
|
|
286
|
+
--seed-box-min-height: var(--seed-box-min-height-xl, initial);
|
|
287
|
+
--seed-box-max-height: var(--seed-box-max-height-xl, initial);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import './content-dialog.layered.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const contentDialogSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"positioner",
|
|
7
|
+
"seed-content-dialog__positioner"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"backdrop",
|
|
11
|
+
"seed-content-dialog__backdrop"
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"content",
|
|
15
|
+
"seed-content-dialog__content"
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"header",
|
|
19
|
+
"seed-content-dialog__header"
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"body",
|
|
23
|
+
"seed-content-dialog__body"
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"footer",
|
|
27
|
+
"seed-content-dialog__footer"
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"title",
|
|
31
|
+
"seed-content-dialog__title"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"description",
|
|
35
|
+
"seed-content-dialog__description"
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"closeButton",
|
|
39
|
+
"seed-content-dialog__closeButton"
|
|
40
|
+
]
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const defaultVariant = {
|
|
44
|
+
"size": "medium"
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const compoundVariants = [];
|
|
48
|
+
|
|
49
|
+
export const contentDialogVariantMap = {
|
|
50
|
+
"size": [
|
|
51
|
+
"medium",
|
|
52
|
+
"large"
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const contentDialogVariantKeys = Object.keys(contentDialogVariantMap);
|
|
57
|
+
|
|
58
|
+
export function contentDialog(props) {
|
|
59
|
+
return Object.fromEntries(
|
|
60
|
+
contentDialogSlotNames.map(([slot, className]) => {
|
|
61
|
+
return [
|
|
62
|
+
slot,
|
|
63
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
64
|
+
];
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Object.assign(contentDialog, { splitVariantProps: (props) => splitVariantProps(props, contentDialogVariantMap) });
|
|
70
|
+
|
|
71
|
+
// @recipe(seed): content-dialog
|