@chakra-ui/panda-preset 3.33.0 → 3.35.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.
@@ -0,0 +1,462 @@
1
+ "use strict";
2
+ 'use strict';
3
+
4
+ var def = require('../def.cjs');
5
+
6
+ const datePickerSlotRecipe = def.defineSlotRecipe({
7
+ className: "date-picker",
8
+ slots: [
9
+ "clearTrigger",
10
+ "content",
11
+ "control",
12
+ "input",
13
+ "label",
14
+ "monthSelect",
15
+ "nextTrigger",
16
+ "positioner",
17
+ "presetTrigger",
18
+ "prevTrigger",
19
+ "rangeText",
20
+ "root",
21
+ "table",
22
+ "tableBody",
23
+ "tableCell",
24
+ "tableCellTrigger",
25
+ "tableHead",
26
+ "tableHeader",
27
+ "tableRow",
28
+ "trigger",
29
+ "view",
30
+ "viewControl",
31
+ "viewTrigger",
32
+ "yearSelect",
33
+ "view",
34
+ "valueText",
35
+ "indicatorGroup"
36
+ ],
37
+ base: {
38
+ root: {
39
+ display: "flex",
40
+ flexDirection: "column",
41
+ gap: "1.5",
42
+ width: "full",
43
+ "--datepicker-indicators-offset": "sizes.3",
44
+ _disabled: {
45
+ opacity: 0.5
46
+ }
47
+ },
48
+ label: {
49
+ textStyle: "sm",
50
+ fontWeight: "medium"
51
+ },
52
+ indicatorGroup: {
53
+ position: "absolute",
54
+ insetEnd: "var(--datepicker-indicators-offset)",
55
+ top: "50%",
56
+ transform: "translateY(-50%)",
57
+ display: "flex",
58
+ alignItems: "center",
59
+ justifyContent: "center",
60
+ gap: "1"
61
+ },
62
+ control: {
63
+ display: "flex",
64
+ alignItems: "center",
65
+ gap: "2",
66
+ width: "full",
67
+ position: "relative"
68
+ },
69
+ input: {
70
+ flex: "1",
71
+ minWidth: "0",
72
+ height: "var(--datepicker-input-height)",
73
+ "--input-height": "var(--datepicker-input-height)",
74
+ px: "var(--datepicker-input-px)",
75
+ textStyle: "sm",
76
+ bg: "transparent",
77
+ borderRadius: "l2",
78
+ outline: "0",
79
+ appearance: "none",
80
+ color: "fg",
81
+ "--focus-color": "colors.colorPalette.focusRing",
82
+ "--error-color": "colors.border.error",
83
+ _placeholder: {
84
+ color: "fg.muted"
85
+ },
86
+ _invalid: {
87
+ focusRingColor: "var(--error-color)",
88
+ borderColor: "var(--error-color)"
89
+ }
90
+ },
91
+ trigger: {
92
+ display: "inline-flex",
93
+ alignItems: "center",
94
+ justifyContent: "center",
95
+ width: "6",
96
+ height: "6",
97
+ borderRadius: "l1",
98
+ color: "fg.muted",
99
+ outline: "none",
100
+ _hover: {
101
+ color: "fg"
102
+ },
103
+ focusVisibleRing: "inside",
104
+ focusRingWidth: "2px",
105
+ _icon: {
106
+ boxSize: "4"
107
+ }
108
+ },
109
+ content: {
110
+ display: "flex",
111
+ flexDirection: "column",
112
+ gap: "3",
113
+ p: "3",
114
+ minW: "18rem",
115
+ bg: "bg.panel",
116
+ borderRadius: "l2",
117
+ boxShadow: "lg",
118
+ color: "fg",
119
+ "--date-picker-z-index": "zIndex.popover",
120
+ zIndex: "calc(var(--date-picker-z-index) + var(--layer-index, 0))",
121
+ outline: "none",
122
+ _open: {
123
+ animationStyle: "scale-fade-in",
124
+ animationDuration: "fast"
125
+ },
126
+ _closed: {
127
+ animationStyle: "scale-fade-out",
128
+ animationDuration: "faster"
129
+ }
130
+ },
131
+ view: {
132
+ display: "flex",
133
+ flexDirection: "column",
134
+ gap: "3"
135
+ },
136
+ viewControl: {
137
+ display: "flex",
138
+ alignItems: "center",
139
+ justifyContent: "space-between",
140
+ gap: "2",
141
+ height: "var(--datepicker-nav-trigger-size)"
142
+ },
143
+ viewTrigger: {
144
+ display: "inline-flex",
145
+ flex: "1",
146
+ alignItems: "center",
147
+ justifyContent: "center",
148
+ gap: "1",
149
+ py: "1.5",
150
+ px: "2",
151
+ textStyle: "sm",
152
+ fontWeight: "semibold",
153
+ borderRadius: "l2",
154
+ focusVisibleRing: "inside",
155
+ focusRingWidth: "2px",
156
+ _hover: {
157
+ bg: "colorPalette.subtle"
158
+ }
159
+ },
160
+ prevTrigger: {
161
+ display: "inline-flex",
162
+ alignItems: "center",
163
+ justifyContent: "center",
164
+ boxSize: "var(--datepicker-nav-trigger-size)",
165
+ borderRadius: "l2",
166
+ color: "fg",
167
+ focusVisibleRing: "inside",
168
+ focusRingWidth: "2px",
169
+ _hover: {
170
+ bg: "colorPalette.subtle"
171
+ },
172
+ _focusVisible: {
173
+ boxShadow: "0 0 0 2px var(--colors-color-palette-focus-ring)"
174
+ },
175
+ _disabled: {
176
+ opacity: 0.5
177
+ },
178
+ _icon: {
179
+ boxSize: "4"
180
+ }
181
+ },
182
+ nextTrigger: {
183
+ display: "inline-flex",
184
+ alignItems: "center",
185
+ justifyContent: "center",
186
+ boxSize: "var(--datepicker-nav-trigger-size)",
187
+ borderRadius: "l2",
188
+ color: "fg",
189
+ focusVisibleRing: "inside",
190
+ focusRingWidth: "2px",
191
+ _hover: {
192
+ bg: "colorPalette.subtle"
193
+ },
194
+ _focusVisible: {
195
+ boxShadow: "0 0 0 2px var(--colors-color-palette-focus-ring)"
196
+ },
197
+ _disabled: {
198
+ opacity: 0.5
199
+ },
200
+ _icon: {
201
+ boxSize: "4"
202
+ }
203
+ },
204
+ rangeText: {
205
+ textStyle: "sm",
206
+ fontWeight: "semibold"
207
+ },
208
+ table: {
209
+ borderCollapse: "separate",
210
+ borderSpacing: "0"
211
+ },
212
+ tableHeader: {
213
+ width: "var(--table-cell-size)",
214
+ py: "2",
215
+ textStyle: "xs",
216
+ fontWeight: "medium",
217
+ color: "fg.muted",
218
+ textAlign: "center",
219
+ textTransform: "uppercase",
220
+ "&[data-type='week-number']": {
221
+ color: "fg.subtle"
222
+ }
223
+ },
224
+ tableCell: {
225
+ py: "0.5",
226
+ "&[data-type='week-number']": {
227
+ color: "fg.subtle"
228
+ }
229
+ },
230
+ tableCellTrigger: {
231
+ display: "inline-flex",
232
+ alignItems: "center",
233
+ justifyContent: "center",
234
+ minWidth: "var(--table-cell-size)",
235
+ minHeight: "var(--table-cell-size)",
236
+ textStyle: "sm",
237
+ borderRadius: "l2",
238
+ focusVisibleRing: "inside",
239
+ focusRingWidth: "2px",
240
+ focusRingOffset: "0px",
241
+ cursor: "default",
242
+ position: "relative",
243
+ _hover: {
244
+ bg: "colorPalette.subtle"
245
+ },
246
+ "[data-view=month] &, [data-view=year] &": {
247
+ width: "calc(var(--table-cell-size) * 1.75)"
248
+ },
249
+ _today: {
250
+ color: "colorPalette.fg",
251
+ fontWeight: "semibold",
252
+ textDecoration: "underline",
253
+ textUnderlineOffset: "3px",
254
+ textDecorationThickness: "2px"
255
+ },
256
+ "&[data-selected]": {
257
+ bg: "colorPalette.solid",
258
+ color: "colorPalette.contrast",
259
+ _hover: {
260
+ bg: "colorPalette.solid"
261
+ }
262
+ },
263
+ "&[data-in-range]": {
264
+ bg: "colorPalette.subtle",
265
+ color: "colorPalette.fg",
266
+ borderRadius: "0",
267
+ _hover: {
268
+ bg: "colorPalette.subtle"
269
+ }
270
+ },
271
+ "&[data-in-range][data-selected]": {
272
+ bg: "colorPalette.solid",
273
+ color: "colorPalette.contrast",
274
+ borderRadius: "0",
275
+ _hover: {
276
+ bg: "colorPalette.solid"
277
+ },
278
+ "&[data-range-start][data-range-end]": {
279
+ borderRadius: "l2"
280
+ },
281
+ "&[data-range-start]:not([data-range-end])": {
282
+ borderStartRadius: "l2",
283
+ borderEndRadius: "0"
284
+ },
285
+ "&[data-range-end]:not([data-range-start])": {
286
+ borderEndRadius: "l2",
287
+ borderStartRadius: "0"
288
+ }
289
+ },
290
+ _disabled: {
291
+ opacity: 0.4
292
+ }
293
+ },
294
+ monthSelect: {
295
+ height: "var(--datepicker-select-height)",
296
+ ps: "2",
297
+ pe: "8",
298
+ textStyle: "sm",
299
+ borderWidth: "1px",
300
+ borderRadius: "l2",
301
+ outline: "none",
302
+ focusVisibleRing: "inside",
303
+ appearance: "none",
304
+ fieldSizing: "content",
305
+ backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,
306
+ backgroundRepeat: "no-repeat",
307
+ backgroundPosition: "right 0.375rem center",
308
+ backgroundSize: "1.25em"
309
+ },
310
+ yearSelect: {
311
+ height: "var(--datepicker-select-height)",
312
+ ps: "2",
313
+ pe: "8",
314
+ textStyle: "sm",
315
+ borderWidth: "1px",
316
+ borderRadius: "l2",
317
+ outline: "none",
318
+ focusVisibleRing: "inside",
319
+ appearance: "none",
320
+ fieldSizing: "content",
321
+ backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,
322
+ backgroundRepeat: "no-repeat",
323
+ backgroundPosition: "right 0.375rem center",
324
+ backgroundSize: "1.25em"
325
+ },
326
+ clearTrigger: {
327
+ display: "inline-flex",
328
+ alignItems: "center",
329
+ justifyContent: "center",
330
+ width: "6",
331
+ height: "6",
332
+ flexShrink: 0,
333
+ textStyle: "xs",
334
+ borderRadius: "l2",
335
+ color: "fg.muted",
336
+ _hover: {
337
+ color: "fg"
338
+ },
339
+ focusVisibleRing: "inside",
340
+ _icon: {
341
+ width: "4",
342
+ height: "4"
343
+ }
344
+ }
345
+ },
346
+ variants: {
347
+ size: {
348
+ xs: {
349
+ root: {
350
+ "--datepicker-input-height": "sizes.8",
351
+ "--datepicker-input-px": "sizes.2",
352
+ "--datepicker-indicators-offset": "sizes.2"
353
+ },
354
+ view: {
355
+ "--table-cell-size": "sizes.8",
356
+ "--datepicker-nav-trigger-size": "sizes.7",
357
+ "--datepicker-select-height": "sizes.8"
358
+ }
359
+ },
360
+ sm: {
361
+ root: {
362
+ "--datepicker-input-height": "sizes.9",
363
+ "--datepicker-input-px": "sizes.2.5",
364
+ "--datepicker-indicators-offset": "sizes.2.5"
365
+ },
366
+ view: {
367
+ "--table-cell-size": "sizes.9",
368
+ "--datepicker-nav-trigger-size": "sizes.8",
369
+ "--datepicker-select-height": "sizes.9"
370
+ }
371
+ },
372
+ md: {
373
+ root: {
374
+ "--datepicker-input-height": "sizes.10",
375
+ "--datepicker-input-px": "sizes.3"
376
+ },
377
+ view: {
378
+ "--table-cell-size": "sizes.10",
379
+ "--datepicker-nav-trigger-size": "sizes.8",
380
+ "--datepicker-select-height": "sizes.10"
381
+ }
382
+ },
383
+ lg: {
384
+ root: {
385
+ "--datepicker-input-height": "sizes.11",
386
+ "--datepicker-input-px": "sizes.4"
387
+ },
388
+ view: {
389
+ "--table-cell-size": "sizes.10",
390
+ "--datepicker-nav-trigger-size": "sizes.9",
391
+ "--datepicker-select-height": "sizes.10"
392
+ }
393
+ },
394
+ xl: {
395
+ root: {
396
+ "--datepicker-input-height": "sizes.12",
397
+ "--datepicker-input-px": "sizes.4.5"
398
+ },
399
+ view: {
400
+ "--table-cell-size": "sizes.10",
401
+ "--datepicker-nav-trigger-size": "sizes.9",
402
+ "--datepicker-select-height": "sizes.10"
403
+ }
404
+ }
405
+ },
406
+ hideOutsideDays: {
407
+ true: {
408
+ tableCellTrigger: {
409
+ "&[data-outside-range]": {
410
+ visibility: "hidden"
411
+ }
412
+ }
413
+ }
414
+ },
415
+ variant: {
416
+ outline: {
417
+ input: {
418
+ bg: "transparent",
419
+ borderWidth: "1px",
420
+ borderColor: "border",
421
+ focusVisibleRing: "inside",
422
+ focusRingColor: "var(--focus-color)"
423
+ }
424
+ },
425
+ subtle: {
426
+ input: {
427
+ borderWidth: "1px",
428
+ borderColor: "transparent",
429
+ bg: "bg.muted",
430
+ focusVisibleRing: "inside",
431
+ focusRingColor: "var(--focus-color)"
432
+ }
433
+ },
434
+ flushed: {
435
+ input: {
436
+ bg: "transparent",
437
+ borderBottomWidth: "1px",
438
+ borderBottomColor: "border",
439
+ borderRadius: "0",
440
+ px: "0",
441
+ _focusVisible: {
442
+ borderColor: "var(--focus-color)",
443
+ boxShadow: "0px 1px 0px 0px var(--focus-color)",
444
+ _invalid: {
445
+ borderColor: "var(--error-color)",
446
+ boxShadow: "0px 1px 0px 0px var(--error-color)"
447
+ }
448
+ }
449
+ },
450
+ indicatorGroup: {
451
+ insetEnd: "0"
452
+ }
453
+ }
454
+ }
455
+ },
456
+ defaultVariants: {
457
+ size: "md",
458
+ variant: "outline"
459
+ }
460
+ });
461
+
462
+ exports.datePickerSlotRecipe = datePickerSlotRecipe;
@@ -26,7 +26,8 @@ const dialogSlotRecipe = def.defineSlotRecipe({
26
26
  top: 0,
27
27
  w: "100dvw",
28
28
  h: "100dvh",
29
- zIndex: "var(--z-index)",
29
+ "--dialog-z-index": "zIndex.popover",
30
+ zIndex: "calc(var(--dialog-z-index) + var(--layer-index, 0) - 1)",
30
31
  _open: {
31
32
  animationName: "fade-in",
32
33
  animationDuration: "slow"
@@ -26,7 +26,8 @@ const drawerSlotRecipe = def.defineSlotRecipe({
26
26
  top: 0,
27
27
  w: "100vw",
28
28
  h: "100dvh",
29
- zIndex: "var(--z-index)",
29
+ "--drawer-z-index": "zIndex.popover",
30
+ zIndex: "calc(var(--drawer-z-index) + var(--layer-index, 0) - 1)",
30
31
  _open: {
31
32
  animationName: "fade-in",
32
33
  animationDuration: "slow"
@@ -16,6 +16,7 @@ var collapsible = require('./collapsible.cjs');
16
16
  var colorPicker = require('./color-picker.cjs');
17
17
  var combobox = require('./combobox.cjs');
18
18
  var dataList = require('./data-list.cjs');
19
+ var datePicker = require('./date-picker.cjs');
19
20
  var dialog = require('./dialog.cjs');
20
21
  var drawer = require('./drawer.cjs');
21
22
  var editable = require('./editable.cjs');
@@ -70,6 +71,7 @@ const slotRecipes = {
70
71
  codeBlock: codeBlock.codeBlockSlotRecipe,
71
72
  collapsible: collapsible.collapsibleSlotRecipe,
72
73
  dataList: dataList.dataListSlotRecipe,
74
+ datePicker: datePicker.datePickerSlotRecipe,
73
75
  dialog: dialog.dialogSlotRecipe,
74
76
  drawer: drawer.drawerSlotRecipe,
75
77
  editable: editable.editableSlotRecipe,
@@ -175,7 +175,7 @@ const keyframes = {
175
175
  },
176
176
  "slide-from-top": {
177
177
  "0%": {
178
- translate: "0 -0.5rem"
178
+ translate: "0 calc(var(--slide-from-top-distance, 0.5rem) * -1)"
179
179
  },
180
180
  to: {
181
181
  translate: "0"
@@ -183,7 +183,7 @@ const keyframes = {
183
183
  },
184
184
  "slide-from-bottom": {
185
185
  "0%": {
186
- translate: "0 0.5rem"
186
+ translate: "0 var(--slide-from-bottom-distance, 0.5rem)"
187
187
  },
188
188
  to: {
189
189
  translate: "0"
@@ -191,7 +191,7 @@ const keyframes = {
191
191
  },
192
192
  "slide-from-left": {
193
193
  "0%": {
194
- translate: "-0.5rem 0"
194
+ translate: "calc(var(--slide-from-left-distance, 0.5rem) * -1) 0"
195
195
  },
196
196
  to: {
197
197
  translate: "0"
@@ -199,7 +199,7 @@ const keyframes = {
199
199
  },
200
200
  "slide-from-right": {
201
201
  "0%": {
202
- translate: "0.5rem 0"
202
+ translate: "var(--slide-from-right-distance, 0.5rem) 0"
203
203
  },
204
204
  to: {
205
205
  translate: "0"
@@ -210,7 +210,7 @@ const keyframes = {
210
210
  translate: "0"
211
211
  },
212
212
  to: {
213
- translate: "0 -0.5rem"
213
+ translate: "0 calc(var(--slide-to-top-distance, 0.5rem) * -1)"
214
214
  }
215
215
  },
216
216
  "slide-to-bottom": {
@@ -218,7 +218,7 @@ const keyframes = {
218
218
  translate: "0"
219
219
  },
220
220
  to: {
221
- translate: "0 0.5rem"
221
+ translate: "0 var(--slide-to-bottom-distance, 0.5rem)"
222
222
  }
223
223
  },
224
224
  "slide-to-left": {
@@ -226,7 +226,7 @@ const keyframes = {
226
226
  translate: "0"
227
227
  },
228
228
  to: {
229
- translate: "-0.5rem 0"
229
+ translate: "calc(var(--slide-to-left-distance, 0.5rem) * -1) 0"
230
230
  }
231
231
  },
232
232
  "slide-to-right": {
@@ -234,7 +234,7 @@ const keyframes = {
234
234
  translate: "0"
235
235
  },
236
236
  to: {
237
- translate: "0.5rem 0"
237
+ translate: "var(--slide-to-right-distance, 0.5rem) 0"
238
238
  }
239
239
  },
240
240
  "scale-in": {
@@ -4,7 +4,6 @@ import { buttonRecipe } from './button.js';
4
4
  import { checkmarkRecipe } from './checkmark.js';
5
5
  import { codeRecipe } from './code.js';
6
6
  import { colorSwatchRecipe } from './color-swatch.js';
7
- import { containerRecipe } from './container.js';
8
7
  import { headingRecipe } from './heading.js';
9
8
  import { iconRecipe } from './icon.js';
10
9
  import { inputRecipe } from './input.js';
@@ -23,7 +22,6 @@ const recipes = {
23
22
  badge: badgeRecipe,
24
23
  button: buttonRecipe,
25
24
  code: codeRecipe,
26
- container: containerRecipe,
27
25
  heading: headingRecipe,
28
26
  input: inputRecipe,
29
27
  inputAddon: inputAddonRecipe,
@@ -5,48 +5,48 @@ const shadows = defineSemanticTokens.shadows({
5
5
  xs: {
6
6
  value: {
7
7
  _light: "0px 1px 2px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/20}",
8
- _dark: "0px 1px 1px {black/64}, 0px 0px 1px inset {colors.gray.300/20}"
8
+ _dark: "0px 1px 1px {colors.black/64}, 0px 0px 1px inset {colors.gray.300/20}"
9
9
  }
10
10
  },
11
11
  sm: {
12
12
  value: {
13
13
  _light: "0px 2px 4px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",
14
- _dark: "0px 2px 4px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"
14
+ _dark: "0px 2px 4px {colors.black/64}, 0px 0px 1px inset {colors.gray.300/30}"
15
15
  }
16
16
  },
17
17
  md: {
18
18
  value: {
19
19
  _light: "0px 4px 8px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",
20
- _dark: "0px 4px 8px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"
20
+ _dark: "0px 4px 8px {colors.black/64}, 0px 0px 1px inset {colors.gray.300/30}"
21
21
  }
22
22
  },
23
23
  lg: {
24
24
  value: {
25
25
  _light: "0px 8px 16px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",
26
- _dark: "0px 8px 16px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"
26
+ _dark: "0px 8px 16px {colors.black/64}, 0px 0px 1px inset {colors.gray.300/30}"
27
27
  }
28
28
  },
29
29
  xl: {
30
30
  value: {
31
31
  _light: "0px 16px 24px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",
32
- _dark: "0px 16px 24px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"
32
+ _dark: "0px 16px 24px {colors.black/64}, 0px 0px 1px inset {colors.gray.300/30}"
33
33
  }
34
34
  },
35
35
  "2xl": {
36
36
  value: {
37
37
  _light: "0px 24px 40px {colors.gray.900/16}, 0px 0px 1px {colors.gray.900/30}",
38
- _dark: "0px 24px 40px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"
38
+ _dark: "0px 24px 40px {colors.black/64}, 0px 0px 1px inset {colors.gray.300/30}"
39
39
  }
40
40
  },
41
41
  inner: {
42
42
  value: {
43
- _light: "inset 0 2px 4px 0 {black/5}",
44
- _dark: "inset 0 2px 4px 0 black"
43
+ _light: "inset 0 2px 4px 0 {colors.black/5}",
44
+ _dark: "inset 0 2px 4px 0 {colors.black}"
45
45
  }
46
46
  },
47
47
  inset: {
48
48
  value: {
49
- _light: "inset 0 0 0 1px {black/5}",
49
+ _light: "inset 0 0 0 1px {colors.black/5}",
50
50
  _dark: "inset 0 0 0 1px {colors.gray.300/5}"
51
51
  }
52
52
  }