@skeletonlabs/skeleton-common 4.7.1 → 4.7.3
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/package.json +4 -8
- package/src/classes.ts +434 -0
- package/src/components/accordion.css +43 -0
- package/src/components/app-bar.css +22 -0
- package/src/components/avatar.css +23 -0
- package/src/components/collapsible.css +19 -0
- package/src/components/combobox.css +78 -0
- package/src/components/date-picker.css +148 -0
- package/src/components/file-upload.css +77 -0
- package/src/components/floating-panel.css +66 -0
- package/src/components/listbox.css +59 -0
- package/src/components/menu.css +43 -0
- package/src/components/navigation.css +79 -0
- package/src/components/pagination.css +44 -0
- package/src/components/progress.css +77 -0
- package/src/components/rating-group.css +21 -0
- package/src/components/segmented-control.css +80 -0
- package/src/components/slider.css +52 -0
- package/src/components/steps.css +93 -0
- package/src/components/switch.css +59 -0
- package/src/components/tabs.css +63 -0
- package/src/components/tags-input.css +73 -0
- package/src/components/toast.css +74 -0
- package/src/components/toggle-group.css +55 -0
- package/src/components/tree-view.css +91 -0
- package/src/index.css +23 -0
- package/dist/classes.d.mts +0 -268
- package/dist/classes.mjs +0 -269
- package/dist/index.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-common",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.3",
|
|
4
4
|
"description": "The common package for Skeleton.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"repository": {
|
|
@@ -10,16 +10,12 @@
|
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"./classes": {
|
|
16
|
-
"types": "./dist/classes.d.mts",
|
|
17
|
-
"import": "./dist/classes.mjs"
|
|
13
|
+
"import": "./src/index.css",
|
|
14
|
+
"style": "./src/index.css"
|
|
18
15
|
}
|
|
19
16
|
},
|
|
20
17
|
"files": [
|
|
21
|
-
"
|
|
22
|
-
"!dist/**/*.map"
|
|
18
|
+
"src"
|
|
23
19
|
],
|
|
24
20
|
"sideEffects": false,
|
|
25
21
|
"license": "MIT",
|
package/src/classes.ts
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
export const appBar = {
|
|
2
|
+
root: 'w-full bg-surface-100-900 p-4 space-y-4',
|
|
3
|
+
toolbar: 'grid items-center justify-between gap-4',
|
|
4
|
+
lead: '',
|
|
5
|
+
headline: '',
|
|
6
|
+
trail: 'flex gap-2',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const avatar = {
|
|
10
|
+
root: 'isolate bg-surface-400-600 size-16 rounded-full overflow-hidden',
|
|
11
|
+
image: 'w-full object-cover',
|
|
12
|
+
fallback: 'size-full flex justify-center items-center',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const collapsible = {
|
|
16
|
+
root: 'w-full flex flex-col items-center data-[state=open]:gap-2',
|
|
17
|
+
trigger: 'data-disabled:opacity-50 data-disabled:pointer-events-none',
|
|
18
|
+
indicator: '',
|
|
19
|
+
content: '',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const combobox = {
|
|
23
|
+
root: 'w-full space-y-2',
|
|
24
|
+
label: 'label-text',
|
|
25
|
+
control: 'relative',
|
|
26
|
+
input: 'input',
|
|
27
|
+
trigger: 'btn-icon btn-icon-sm preset-tonal absolute end-1.5 top-1/2 -translate-y-1/2',
|
|
28
|
+
clearTrigger: 'btn btn-sm preset-tonal hover:preset-filled-error-500',
|
|
29
|
+
positioner: '',
|
|
30
|
+
content: 'card bg-surface-50-950 border border-surface-200-800 p-2 flex flex-col gap-2',
|
|
31
|
+
itemGroup: '',
|
|
32
|
+
itemGroupLabel: 'text-surface-600-400 text-xs px-2 py-1',
|
|
33
|
+
item: [
|
|
34
|
+
'flex justify-between items-center px-2 py-1 rounded cursor-pointer',
|
|
35
|
+
'data-[state=checked]:preset-filled',
|
|
36
|
+
'data-highlighted:preset-tonal',
|
|
37
|
+
'data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
38
|
+
],
|
|
39
|
+
itemText: '',
|
|
40
|
+
itemIndicator: '',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const datePicker = {
|
|
44
|
+
root: 'space-y-2',
|
|
45
|
+
label: 'label-text',
|
|
46
|
+
control: 'relative space-y-2',
|
|
47
|
+
input: 'input',
|
|
48
|
+
trigger: 'btn-icon btn-icon-sm preset-tonal absolute end-1.5 top-1.25',
|
|
49
|
+
clearTrigger: '',
|
|
50
|
+
presetTrigger: 'btn hover:preset-tonal',
|
|
51
|
+
positioner: '',
|
|
52
|
+
content: 'card bg-surface-50-950 border border-surface-200-800 p-2 space-y-2',
|
|
53
|
+
yearSelect: 'select',
|
|
54
|
+
monthSelect: 'select',
|
|
55
|
+
view: 'space-y-2',
|
|
56
|
+
viewControl: 'flex gap-2 justify-between',
|
|
57
|
+
prevTrigger: 'btn-icon hover:preset-tonal',
|
|
58
|
+
viewTrigger: 'btn hover:preset-tonal',
|
|
59
|
+
rangeText: '',
|
|
60
|
+
nextTrigger: 'btn-icon hover:preset-tonal',
|
|
61
|
+
table: 'border-separate border-spacing-2',
|
|
62
|
+
tableHead: '',
|
|
63
|
+
tableRow: '',
|
|
64
|
+
tableHeader: 'text-sm size-8',
|
|
65
|
+
tableBody: '',
|
|
66
|
+
tableCell: 'size-8',
|
|
67
|
+
tableCellTrigger: [
|
|
68
|
+
'text-sm size-full btn p-0 hover:preset-tonal cursor-pointer',
|
|
69
|
+
'data-focus-visible:outline-2 data-focus-visible:outline-offset-1 data-focus-visible:outline-surface-950-50',
|
|
70
|
+
'data-selected:preset-filled',
|
|
71
|
+
'data-in-range:preset-filled',
|
|
72
|
+
'data-today:underline data-today:underline-offset-4',
|
|
73
|
+
'data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const dialog = {
|
|
78
|
+
trigger: '',
|
|
79
|
+
backdrop: '',
|
|
80
|
+
positioner: '',
|
|
81
|
+
content: '',
|
|
82
|
+
title: '',
|
|
83
|
+
description: '',
|
|
84
|
+
closeTrigger: '',
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const fileUpload = {
|
|
88
|
+
root: 'w-full space-y-2 data-disabled:disabled',
|
|
89
|
+
label: 'label-text',
|
|
90
|
+
dropzone: [
|
|
91
|
+
'card px-4 py-10 border border-dashed border-surface-200-800 flex flex-col justify-center items-center gap-2 data-dragging:preset-tonal',
|
|
92
|
+
],
|
|
93
|
+
hiddenInput: '',
|
|
94
|
+
trigger: 'btn preset-filled',
|
|
95
|
+
clearTrigger: 'btn btn-sm preset-tonal hover:preset-filled-error-500',
|
|
96
|
+
itemGroup: 'flex flex-col gap-2',
|
|
97
|
+
item: 'grid grid-cols-[auto_1fr_auto] gap-4 items-center preset-tonal px-4 py-2 rounded',
|
|
98
|
+
itemName: 'text-sm',
|
|
99
|
+
itemSizeText: 'text-xs opacity-60',
|
|
100
|
+
itemDeleteTrigger: 'btn-icon',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const floatingPanel = {
|
|
104
|
+
trigger: '',
|
|
105
|
+
positioner: '',
|
|
106
|
+
content: 'card overflow-hidden shadow-lg border border-surface-300-700',
|
|
107
|
+
dragTrigger: '',
|
|
108
|
+
header: 'px-4 py-2 grid grid-cols-[1fr_auto] gap-2 items-center bg-surface-200-800 overflow-y-hidden',
|
|
109
|
+
title: 'flex justify-start items-center gap-2 whitespace-nowrap',
|
|
110
|
+
control: 'flex gap-1',
|
|
111
|
+
stageTrigger: 'btn-icon hover:preset-tonal',
|
|
112
|
+
closeTrigger: 'btn-icon hover:preset-tonal',
|
|
113
|
+
body: 'h-full bg-surface-100-900 p-4 overflow-y-auto',
|
|
114
|
+
resizeTrigger: 'data-[axis*=n]:h-2 data-[axis*=s]:h-2 data-[axis*=e]:w-2 data-[axis*=w]:w-2',
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const listbox = {
|
|
118
|
+
root: 'flex flex-col items-stretch gap-2',
|
|
119
|
+
label: 'label-text',
|
|
120
|
+
input: 'input',
|
|
121
|
+
content: 'card bg-surface-50-950 border border-surface-200-800 p-2 flex flex-col gap-2',
|
|
122
|
+
itemGroup: '',
|
|
123
|
+
itemGroupLabel: 'text-surface-600-400 text-xs px-2 py-1',
|
|
124
|
+
item: [
|
|
125
|
+
'flex justify-between items-center px-2 py-1 rounded cursor-pointer hover:preset-tonal',
|
|
126
|
+
'data-selected:preset-filled',
|
|
127
|
+
'data-highlighted:preset-tonal',
|
|
128
|
+
'data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
129
|
+
],
|
|
130
|
+
itemText: '',
|
|
131
|
+
itemIndicator: '',
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const menu = {
|
|
135
|
+
trigger: '',
|
|
136
|
+
contextTrigger: '',
|
|
137
|
+
positioner: '',
|
|
138
|
+
indicator: '',
|
|
139
|
+
content: 'card bg-surface-50-950 border border-surface-200-800 p-2 flex flex-col items-stretch gap-2 shadow-lg min-w-48',
|
|
140
|
+
arrow: '[--arrow-size:--spacing(2)] [--arrow-background:var(--color-surface-50-950)]',
|
|
141
|
+
arrowTip: '',
|
|
142
|
+
itemGroup: '',
|
|
143
|
+
itemGroupLabel: 'text-surface-600-400 text-xs px-2 py-1',
|
|
144
|
+
item: ['flex justify-between items-center px-2 py-1 rounded cursor-pointer', 'data-highlighted:preset-tonal'],
|
|
145
|
+
itemText: '',
|
|
146
|
+
itemIndicator: '',
|
|
147
|
+
separator: 'hr',
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const navigation = {
|
|
151
|
+
root: [
|
|
152
|
+
'bg-surface-100-900 overflow-x-hidden transition-[width] duration-200',
|
|
153
|
+
// Bar
|
|
154
|
+
'data-[layout=bar]:w-full data-[layout=bar]:p-2',
|
|
155
|
+
// Rail
|
|
156
|
+
'data-[layout=rail]:w-[100px] data-[layout=rail]:h-full data-[layout=rail]:overflow-y-hidden data-[layout=rail]:p-2 data-[layout=rail]:flex data-[layout=rail]:flex-col data-[layout=rail]:gap-4',
|
|
157
|
+
// Sidebar
|
|
158
|
+
'data-[layout=sidebar]:w-[280px] data-[layout=sidebar]:h-full data-[layout=sidebar]:overflow-y-auto data-[layout=sidebar]:p-4',
|
|
159
|
+
],
|
|
160
|
+
header: '',
|
|
161
|
+
content: [
|
|
162
|
+
// Rail
|
|
163
|
+
'data-[layout=rail]:contents',
|
|
164
|
+
// Sidebar
|
|
165
|
+
'data-[layout=sidebar]:space-y-4',
|
|
166
|
+
],
|
|
167
|
+
group: [
|
|
168
|
+
// Rail
|
|
169
|
+
'data-[layout=rail]:contents',
|
|
170
|
+
// Sidebar
|
|
171
|
+
'data-[layout=sidebar]:flex flex-col gap-2',
|
|
172
|
+
],
|
|
173
|
+
label: 'text-xs text-surface-700-300',
|
|
174
|
+
menu: [
|
|
175
|
+
'flex-1 flex gap-2',
|
|
176
|
+
// Bar
|
|
177
|
+
'data-[layout=bar]:items-stretch',
|
|
178
|
+
// Rail
|
|
179
|
+
'data-[layout=rail]:flex-col data-[layout=rail]:justify-center',
|
|
180
|
+
// Sidebar
|
|
181
|
+
'data-[layout=sidebar]:flex-col data-[layout=sidebar]:items-stretch',
|
|
182
|
+
],
|
|
183
|
+
footer: '',
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const pagination = {
|
|
187
|
+
root: 'inline-flex gap-2 p-2 rounded-container preset-outlined-surface-200-800 w-fit',
|
|
188
|
+
firstTrigger: 'btn btn-sm preset-tonal',
|
|
189
|
+
prevTrigger: 'btn btn-sm preset-tonal',
|
|
190
|
+
item: 'btn btn-sm preset-tonal cursor-pointer select-none data-selected:preset-filled',
|
|
191
|
+
ellipsis: 'btn btn-sm preset-tonal pointer-events-none',
|
|
192
|
+
nextTrigger: 'btn btn-sm preset-tonal',
|
|
193
|
+
lastTrigger: 'btn btn-sm preset-tonal',
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const popover = {
|
|
197
|
+
anchor: '',
|
|
198
|
+
trigger: '',
|
|
199
|
+
positioner: '',
|
|
200
|
+
content: '',
|
|
201
|
+
arrow: '',
|
|
202
|
+
arrowTip: '',
|
|
203
|
+
title: '',
|
|
204
|
+
description: '',
|
|
205
|
+
closeTrigger: '',
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export const progress = {
|
|
209
|
+
root: [
|
|
210
|
+
'flex flex-col gap-2',
|
|
211
|
+
// Horizontal Orientation
|
|
212
|
+
'data-[orientation=horizontal]:w-full',
|
|
213
|
+
// Vertical Orientation
|
|
214
|
+
'data-[orientation=vertical]:items-center',
|
|
215
|
+
],
|
|
216
|
+
label: 'whitespace-nowrap',
|
|
217
|
+
valueText: '',
|
|
218
|
+
|
|
219
|
+
// Linear
|
|
220
|
+
track: [
|
|
221
|
+
'bg-surface-200-800 rounded-base overflow-hidden',
|
|
222
|
+
// Horizontal Orientation
|
|
223
|
+
'data-[orientation=horizontal]:w-full data-[orientation=horizontal]:h-2',
|
|
224
|
+
// Vertical Orientation
|
|
225
|
+
'data-[orientation=vertical]:w-2 data-[orientation=vertical]:h-[100px] data-[orientation=vertical]:flex data-[orientation=vertical]:flex-col-reverse',
|
|
226
|
+
],
|
|
227
|
+
range: [
|
|
228
|
+
'h-full bg-surface-950-50 rounded-base',
|
|
229
|
+
// Horizontal Orientation
|
|
230
|
+
'data-[orientation=horizontal]:transition-[width] data-[orientation=horizontal]:data-[state=indeterminate]:animate-progress-linear-indeterminate-horizontal',
|
|
231
|
+
// Vertical Orientation
|
|
232
|
+
'data-[orientation=vertical]:transition-[height] data-[orientation=vertical]:data-[state=indeterminate]:animate-progress-linear-indeterminate-vertical',
|
|
233
|
+
],
|
|
234
|
+
|
|
235
|
+
// Circular
|
|
236
|
+
circle: '[--size:--spacing(24)] [--thickness:calc(var(--size)/12)]',
|
|
237
|
+
circleTrack: 'stroke-surface-200-800',
|
|
238
|
+
circleRange: [
|
|
239
|
+
'stroke-primary-500 transition-[stroke-dashoffset] ease-in-out',
|
|
240
|
+
'data-[state=indeterminate]:animate-progress-circular-indeterminate',
|
|
241
|
+
],
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export const ratingGroup = {
|
|
245
|
+
root: 'flex flex-col gap-2',
|
|
246
|
+
label: 'label-text',
|
|
247
|
+
control: 'flex gap-2 data-disabled:cursor-not-allowed data-disabled:opacity-50',
|
|
248
|
+
item: '',
|
|
249
|
+
hiddenInput: '',
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
export const segmentedControl = {
|
|
253
|
+
root: 'flex flex-col gap-2 not-skb:group',
|
|
254
|
+
label: 'label-text',
|
|
255
|
+
control: [
|
|
256
|
+
'inline-flex preset-outlined-surface-200-800 p-2 gap-2 rounded',
|
|
257
|
+
'group-data-[orientation=horizontal]:flex-row group-data-[orientation=vertical]:flex-col',
|
|
258
|
+
],
|
|
259
|
+
indicator: 'top-(--top) left-(--left) w-(--width) h-(--height) preset-filled rounded data-disabled:opacity-50',
|
|
260
|
+
item: [
|
|
261
|
+
'btn cursor-pointer z-10 flex-1',
|
|
262
|
+
'data-focus-visible:outline-2 data-focus-visible:outline-offset-1 data-focus-visible:outline-surface-950-50',
|
|
263
|
+
'data-readonly:pointer-events-none',
|
|
264
|
+
'data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
265
|
+
],
|
|
266
|
+
itemText: ['transition-colors', 'data-[state=checked]:text-surface-contrast-950 data-[state=checked]:dark:text-surface-contrast-50'],
|
|
267
|
+
itemHiddenInput: '',
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const slider = {
|
|
271
|
+
root: 'w-full flex flex-col gap-2',
|
|
272
|
+
label: 'label-text',
|
|
273
|
+
valueText: '',
|
|
274
|
+
control: ['flex items-center', 'data-disabled:opacity-50'],
|
|
275
|
+
track: 'bg-surface-200-800 rounded-base h-2 overflow-hidden flex-1',
|
|
276
|
+
range: 'bg-surface-950-50 h-full',
|
|
277
|
+
thumb: [
|
|
278
|
+
'size-5 bg-surface-50-950 ring-inset ring-2 ring-surface-950-50 rounded-full',
|
|
279
|
+
'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-surface-950-50',
|
|
280
|
+
],
|
|
281
|
+
hiddenInput: '',
|
|
282
|
+
markerGroup: '',
|
|
283
|
+
marker: 'text-xs text-surface-600-400',
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export const steps = {
|
|
287
|
+
root: ['data-[orientation=horizontal]:space-y-4', 'data-[orientation=vertical]:flex data-[orientation=vertical]:space-x-4'],
|
|
288
|
+
list: [
|
|
289
|
+
'flex gap-2',
|
|
290
|
+
'data-[orientation=horizontal]:items-center',
|
|
291
|
+
'data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-start',
|
|
292
|
+
],
|
|
293
|
+
item: [
|
|
294
|
+
'flex gap-2 grow last:flex-initial',
|
|
295
|
+
'data-[orientation=horizontal]:items-center',
|
|
296
|
+
'data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-start',
|
|
297
|
+
],
|
|
298
|
+
trigger: 'flex items-center gap-1',
|
|
299
|
+
indicator: [
|
|
300
|
+
'size-8 rounded-full content-center',
|
|
301
|
+
'not-data-complete:not-data-current:preset-outlined-surface-200-800',
|
|
302
|
+
'data-complete:preset-filled-primary-500',
|
|
303
|
+
'data-current:preset-outlined-primary-500',
|
|
304
|
+
],
|
|
305
|
+
separator: [
|
|
306
|
+
'h-0 border-surface-200-800 grow',
|
|
307
|
+
'data-complete:border-primary-500',
|
|
308
|
+
'data-[orientation=horizontal]:border-t',
|
|
309
|
+
'data-[orientation=vertical]:border-s data-[orientation=vertical]:ms-4 data-[orientation=vertical]:min-h-4',
|
|
310
|
+
],
|
|
311
|
+
content: '',
|
|
312
|
+
prevTrigger: '',
|
|
313
|
+
nextTrigger: '',
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const switch_ = {
|
|
317
|
+
root: [
|
|
318
|
+
'cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-50 inline-flex gap-2 items-center rounded',
|
|
319
|
+
'data-focus-visible:outline-2 data-focus-visible:outline-offset-1 data-focus-visible:outline-surface-950-50',
|
|
320
|
+
],
|
|
321
|
+
control: [
|
|
322
|
+
'preset-filled-surface-200-800 h-6 w-10 p-0.5 rounded-full flex justify-start',
|
|
323
|
+
'data-[state=checked]:preset-filled-primary-500',
|
|
324
|
+
],
|
|
325
|
+
thumb: [
|
|
326
|
+
'grid justify-center items-center h-full aspect-square rounded-full',
|
|
327
|
+
'bg-surface-50 text-surface-contrast-50 fill-surface-contrast-50',
|
|
328
|
+
'transition-transform duration-100 data-[state=checked]:translate-x-4 rtl:data-[state=checked]:-translate-x-4',
|
|
329
|
+
],
|
|
330
|
+
label: 'label-text',
|
|
331
|
+
hiddenInput: '',
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
export { switch_ as switch };
|
|
335
|
+
|
|
336
|
+
export const tabs = {
|
|
337
|
+
root: 'w-full flex data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row',
|
|
338
|
+
list: [
|
|
339
|
+
'relative flex gap-2 border-surface-200-800',
|
|
340
|
+
'data-[orientation=horizontal]:pb-2 data-[orientation=horizontal]:mb-4 data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:border-b',
|
|
341
|
+
'data-[orientation=vertical]:pe-2 data-[orientation=vertical]:me-4 data-[orientation=vertical]:flex-col data-[orientation=vertical]:border-e',
|
|
342
|
+
],
|
|
343
|
+
trigger: ['btn hover:preset-tonal-primary', 'data-disabled:opacity-50'],
|
|
344
|
+
indicator: [
|
|
345
|
+
'bg-surface-950-50',
|
|
346
|
+
'data-[orientation=horizontal]:w-(--width) data-[orientation=horizontal]:h-0.5 data-[orientation=horizontal]:bottom-0',
|
|
347
|
+
'data-[orientation=vertical]:w-0.5 data-[orientation=vertical]:h-(--height) data-[orientation=vertical]:end-0',
|
|
348
|
+
],
|
|
349
|
+
content: '',
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export const tagsInput = {
|
|
353
|
+
root: 'w-full space-y-2',
|
|
354
|
+
label: 'label-text',
|
|
355
|
+
control: 'input flex flex-wrap gap-2 p-2',
|
|
356
|
+
item: '',
|
|
357
|
+
itemPreview: ['chip flex gap-0 p-0 preset-filled hover:brightness-100 w-fit', 'data-highlighted:ring data-highlighted:ring-primary-500'],
|
|
358
|
+
itemText: 'leading-none px-2 py-1',
|
|
359
|
+
itemDeleteTrigger: 'hover:preset-tonal px-2 py-1',
|
|
360
|
+
itemInput: 'input text-xs',
|
|
361
|
+
input: 'input-ghost',
|
|
362
|
+
clearTrigger: 'btn btn-sm preset-tonal hover:preset-filled-error-500',
|
|
363
|
+
hiddenInput: '',
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
export const toast = {
|
|
367
|
+
root: [
|
|
368
|
+
'card p-3 w-full max-w-sm ring flex items-center gap-2',
|
|
369
|
+
'preset-filled-surface-50-950 ring-surface-200-800',
|
|
370
|
+
'data-[type=success]:preset-filled-success-500',
|
|
371
|
+
'data-[type=warning]:preset-filled-warning-500',
|
|
372
|
+
'data-[type=error]:preset-filled-error-500',
|
|
373
|
+
// https://zagjs.com/components/toast#requirement
|
|
374
|
+
'translate-x-(--x) translate-y-(--y) scale-(--scale) z-(--z-index) h-(--height) opacity-(--opacity) will-change-[translate,scale,opacity]',
|
|
375
|
+
'transition duration-400 ease-[cubic-bezier(0.21,1.02,0.73,1)] data-[state=closed]:ease-[cubic-bezier(0.06,0.71,0.55,1)]',
|
|
376
|
+
],
|
|
377
|
+
group: 'w-[calc(100%-calc(var(--viewport-offset-left)+var(--viewport-offset-right)))]',
|
|
378
|
+
message: 'flex-1',
|
|
379
|
+
title: 'font-medium text-sm',
|
|
380
|
+
description: 'text-sm',
|
|
381
|
+
actionTrigger: 'btn preset-filled',
|
|
382
|
+
closeTrigger: 'btn-icon hover:preset-tonal',
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
export const toggleGroup = {
|
|
386
|
+
root: [
|
|
387
|
+
'inline-flex preset-outlined-surface-200-800 divide-surface-200-800 overflow-hidden rounded-base',
|
|
388
|
+
'data-[orientation=horizontal]:divide-x data-[orientation=vertical]:divide-y',
|
|
389
|
+
'data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col',
|
|
390
|
+
],
|
|
391
|
+
item: [
|
|
392
|
+
'flex justify-center items-center w-9 aspect-square hover:preset-tonal data-[state=on]:preset-filled',
|
|
393
|
+
'data-focus-visible:outline-2 data-focus-visible:outline-offset-1 data-focus-visible:outline-surface-950-50',
|
|
394
|
+
'data-readonly:pointer-events-none',
|
|
395
|
+
'data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
396
|
+
],
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
export const tooltip = {
|
|
400
|
+
trigger: '',
|
|
401
|
+
positioner: '',
|
|
402
|
+
content: '',
|
|
403
|
+
arrow: '',
|
|
404
|
+
arrowTip: '',
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
export const treeView = {
|
|
408
|
+
root: 'w-full flex flex-col gap-2 items-start select-none',
|
|
409
|
+
tree: 'space-y-1',
|
|
410
|
+
label: 'label-text',
|
|
411
|
+
item: [
|
|
412
|
+
'flex items-center gap-2 pe-4 py-2 rounded-base',
|
|
413
|
+
// Hover and selection states
|
|
414
|
+
'hover:preset-tonal data-selected:preset-filled',
|
|
415
|
+
// Left side overlap effect
|
|
416
|
+
'ps-[calc(var(--depth)*var(--spacing)*6+var(--spacing)*4)]',
|
|
417
|
+
],
|
|
418
|
+
branch: 'space-y-1',
|
|
419
|
+
branchControl: [
|
|
420
|
+
'flex items-center gap-2 pe-4 py-2 rounded-base',
|
|
421
|
+
// Hover and selection states
|
|
422
|
+
'hover:preset-tonal data-selected:preset-filled',
|
|
423
|
+
// Left side overlap effect
|
|
424
|
+
'ps-[calc(var(--depth)*var(--spacing)*6-var(--spacing)*2)]',
|
|
425
|
+
],
|
|
426
|
+
branchIndicator: 'data-[state=open]:rotate-90',
|
|
427
|
+
branchText: 'flex items-center gap-2',
|
|
428
|
+
branchContent: 'space-y-1 relative',
|
|
429
|
+
branchIndentGuide: [
|
|
430
|
+
'absolute bg-surface-500/50 w-0.5 h-full rounded-base',
|
|
431
|
+
// Left side overlap effect
|
|
432
|
+
'left-[calc(var(--depth)*var(--spacing)*6)] -translate-x-1/2',
|
|
433
|
+
],
|
|
434
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[data-scope='accordion'] {
|
|
2
|
+
&[data-part='root'] {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: --spacing(2);
|
|
6
|
+
|
|
7
|
+
&[data-orientation='vertical'] {
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&[data-orientation='horizontal'] {
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&[data-part='item'] {
|
|
17
|
+
display: flex;
|
|
18
|
+
gap: --spacing(2);
|
|
19
|
+
|
|
20
|
+
&[data-orientation='vertical'] {
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&[data-orientation='horizontal'] {
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&[data-part='item-trigger'] {
|
|
30
|
+
padding: --spacing(2) --spacing(4);
|
|
31
|
+
border-radius: var(--radius-base);
|
|
32
|
+
width: 100%;
|
|
33
|
+
text-align: start;
|
|
34
|
+
|
|
35
|
+
&:hover {
|
|
36
|
+
@apply preset-tonal-primary;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[data-part='item-content'] {
|
|
41
|
+
padding: --spacing(2) --spacing(4);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[data-scope='app-bar'] {
|
|
2
|
+
&[data-part='root'] {
|
|
3
|
+
width: 100%;
|
|
4
|
+
background: var(--color-surface-100-900);
|
|
5
|
+
padding: --spacing(4);
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: --spacing(4);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&[data-part='toolbar'] {
|
|
12
|
+
display: grid;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
gap: --spacing(4);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&[data-part='trail'] {
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: --spacing(2);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[data-scope='avatar'] {
|
|
2
|
+
&[data-part='root'] {
|
|
3
|
+
isolation: isolate;
|
|
4
|
+
background: var(--color-surface-400-600);
|
|
5
|
+
width: --spacing(16);
|
|
6
|
+
height: --spacing(16);
|
|
7
|
+
border-radius: calc(infinity * 1px);
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&[data-part='image'] {
|
|
12
|
+
width: 100%;
|
|
13
|
+
object-fit: cover;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&[data-part='fallback'] {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[data-scope='collapsible'] {
|
|
2
|
+
&[data-part='root'] {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
|
|
8
|
+
&[data-state='open'] {
|
|
9
|
+
gap: --spacing(2);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&[data-part='trigger'] {
|
|
14
|
+
&[data-disabled] {
|
|
15
|
+
opacity: 0.5;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
[data-scope='combobox'] {
|
|
2
|
+
&[data-part='root'] {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: --spacing(2);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&[data-part='label'] {
|
|
10
|
+
@apply label-text;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&[data-part='control'] {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&[data-part='input'] {
|
|
18
|
+
@apply input;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[data-part='trigger'] {
|
|
22
|
+
position: absolute;
|
|
23
|
+
inset-inline-end: --spacing(1.5);
|
|
24
|
+
top: 50%;
|
|
25
|
+
transform: translateY(-50%);
|
|
26
|
+
|
|
27
|
+
@apply btn-icon btn-icon-sm preset-tonal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&[data-part='clear-trigger'] {
|
|
31
|
+
width: fit-content;
|
|
32
|
+
|
|
33
|
+
@apply btn btn-sm preset-tonal;
|
|
34
|
+
|
|
35
|
+
&:hover {
|
|
36
|
+
@apply preset-filled-error-500;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[data-part='content'] {
|
|
41
|
+
padding: --spacing(2);
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
gap: --spacing(2);
|
|
45
|
+
background: var(--color-surface-50-950);
|
|
46
|
+
border: 1px solid var(--color-surface-200-800);
|
|
47
|
+
|
|
48
|
+
@apply card;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&[data-part='item-group-label'] {
|
|
52
|
+
color: var(--color-surface-600-400);
|
|
53
|
+
font-size: var(--text-xs);
|
|
54
|
+
padding: --spacing(1) --spacing(2);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[data-part='item'] {
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: space-between;
|
|
60
|
+
align-items: center;
|
|
61
|
+
padding: --spacing(1) --spacing(2);
|
|
62
|
+
border-radius: var(--radius-base);
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
|
|
65
|
+
&[data-state='checked'] {
|
|
66
|
+
@apply preset-filled;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[data-highlighted] {
|
|
70
|
+
@apply preset-tonal;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&[data-disabled] {
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
opacity: 0.5;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|