@okshaun/components 3.0.0 → 4.1.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/dist/icon-metadata.json +359 -42
- package/dist/index.js +12890 -5844
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +523 -501
- package/dist/playroom-static.css +2 -2
- package/dist/{preset-BAn5LBiW.js → preset-CLoY9s9i.js} +2031 -2086
- package/dist/preset-CLoY9s9i.js.map +1 -0
- package/dist/preset.js +1 -1
- package/dist/specs/conditions.json +75 -51
- package/dist/specs/keyframes.json +22 -0
- package/dist/specs/recipes.json +222 -106
- package/dist/specs/semantic-tokens.json +194 -86
- package/dist/specs/tokens.json +16 -36
- package/dist/sprite.svg +1 -1
- package/dist/sprite.symbol.html +445 -44
- package/dist/styles.css +11441 -13424
- package/dist/svgs/cheese.svg +1 -0
- package/dist/svgs/collapse-vertical.svg +1 -0
- package/dist/svgs/expand-vertical.svg +1 -0
- package/dist/svgs/magnet.svg +1 -0
- package/dist/svgs/to-date-backward.svg +1 -0
- package/dist/svgs/to-date-forward.svg +1 -0
- package/dist/types/index.d.ts +2815 -288
- package/package.json +4 -2
- package/src/recipes/autocomplete.ts +266 -0
- package/src/recipes/badge.ts +25 -54
- package/src/recipes/button.ts +155 -316
- package/src/recipes/calendar.ts +91 -0
- package/src/recipes/card.ts +4 -70
- package/src/recipes/chip.ts +212 -266
- package/src/recipes/dateMenus.ts +40 -0
- package/src/recipes/dateTimeMenus.ts +43 -0
- package/src/recipes/formField.ts +1 -1
- package/src/recipes/kbd.ts +42 -39
- package/src/recipes/list.ts +11 -85
- package/src/recipes/listDensity.ts +66 -0
- package/src/recipes/listItem.ts +27 -166
- package/src/recipes/listItemGroup.ts +16 -16
- package/src/recipes/menu.ts +17 -3
- package/src/recipes/modal.ts +65 -65
- package/src/recipes/radio.ts +6 -6
- package/src/recipes/recipes-slot.ts +7 -2
- package/src/recipes/segmentedFields.ts +192 -0
- package/src/recipes/segmentedInputs.ts +109 -0
- package/src/recipes/tag.ts +218 -210
- package/src/recipes/text.ts +37 -19
- package/src/recipes/textInput.ts +103 -155
- package/src/recipes/themeSwitcher.ts +3 -3
- package/src/recipes/timeMenus.ts +110 -0
- package/src/recipes/toggle.ts +3 -1
- package/src/styles/primitives/shadows.ts +26 -60
- package/src/styles/primitives/zIndex.ts +1 -0
- package/src/styles/semantics/colors.ts +84 -37
- package/src/styles/semantics/shadows.ts +4 -30
- package/src/styles/semantics/zIndex.ts +2 -0
- package/src/styles/utilities/conditions.ts +61 -51
- package/src/styles/utilities/dropShadows.ts +51 -0
- package/src/styles/utilities/filters.ts +22 -7
- package/src/styles/utilities/globalStyle.ts +5 -2
- package/src/styles/utilities/index.ts +3 -0
- package/src/styles/utilities/keyframes.ts +27 -4
- package/src/styles/utilities/recipeGlobalStyles.ts +22 -0
- package/src/styles/utilities/shadowDefinitions.ts +112 -0
- package/src/utils/dsChain.ts +113 -0
- package/src/utils/dsComponent.ts +44 -0
- package/src/utils/dsPart.ts +41 -0
- package/dist/preset-BAn5LBiW.js.map +0 -1
- package/src/recipes/datePicker.ts +0 -234
- package/src/recipes/timePicker.ts +0 -216
package/src/recipes/kbd.ts
CHANGED
|
@@ -1,53 +1,56 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
gap: '1',
|
|
8
|
-
verticalAlign: 'middle',
|
|
9
|
-
},
|
|
10
|
-
key: {
|
|
11
|
-
display: 'inline-flex',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
justifyContent: 'center',
|
|
14
|
-
minH: '6',
|
|
15
|
-
minW: '6',
|
|
16
|
-
px: '2',
|
|
17
|
-
borderWidth: '1',
|
|
18
|
-
borderStyle: 'solid',
|
|
19
|
-
borderColor: 'border.subtle',
|
|
20
|
-
borderRadius: '6',
|
|
21
|
-
bg: 'bg.neutral',
|
|
22
|
-
color: 'text',
|
|
23
|
-
fontFamily: 'mono',
|
|
24
|
-
fontSize: '12',
|
|
25
|
-
lineHeight: 'none',
|
|
26
|
-
fontWeight: 'medium',
|
|
27
|
-
letterSpacing: 'wide',
|
|
28
|
-
whiteSpace: 'nowrap',
|
|
29
|
-
boxShadow: 'sm',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
3
|
+
// Ported from the Cetec design system: slot names, sizing and type treatment.
|
|
4
|
+
// Two Cetec properties are dropped rather than faked: `cornerShape` is a Cetec
|
|
5
|
+
// utility okshaun does not register, and `fontVariant` drives Recursive's
|
|
6
|
+
// variable-font axes, which IBM Plex Mono does not expose.
|
|
33
7
|
export const kbdRecipe = defineSlotRecipe({
|
|
34
8
|
className: 'kbd',
|
|
35
9
|
jsx: ['Kbd'],
|
|
36
|
-
slots: ['
|
|
37
|
-
base:
|
|
10
|
+
slots: ['kbdGroup', 'key'],
|
|
11
|
+
base: {
|
|
12
|
+
kbdGroup: {
|
|
13
|
+
display: 'inline-flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
gap: '2',
|
|
16
|
+
verticalAlign: 'middle',
|
|
17
|
+
},
|
|
18
|
+
key: {
|
|
19
|
+
display: 'inline-flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
gap: '1',
|
|
23
|
+
h: '16',
|
|
24
|
+
w: 'fit',
|
|
25
|
+
minW: '16',
|
|
26
|
+
rounded: '6',
|
|
27
|
+
bg: 'bg.neutral',
|
|
28
|
+
px: '4',
|
|
29
|
+
fontFamily: 'mono',
|
|
30
|
+
lineHeight: 'tight',
|
|
31
|
+
fontWeight: 'bold',
|
|
32
|
+
textTransform: 'uppercase',
|
|
33
|
+
color: 'text.subtle',
|
|
34
|
+
userSelect: 'none',
|
|
35
|
+
pointerEvents: 'none',
|
|
36
|
+
fontSize: '10',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
38
39
|
variants: {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
variant: {
|
|
41
|
+
default: {
|
|
42
|
+
key: {
|
|
43
|
+
fontSize: '10',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
symbol: {
|
|
41
47
|
key: {
|
|
42
|
-
|
|
43
|
-
px: '2.5',
|
|
44
|
-
fontSize: '14',
|
|
45
|
-
letterSpacing: 'normal',
|
|
48
|
+
fontSize: '12',
|
|
46
49
|
},
|
|
47
50
|
},
|
|
48
51
|
},
|
|
49
52
|
},
|
|
50
53
|
defaultVariants: {
|
|
51
|
-
|
|
54
|
+
variant: 'default',
|
|
52
55
|
},
|
|
53
56
|
});
|
package/src/recipes/list.ts
CHANGED
|
@@ -1,90 +1,20 @@
|
|
|
1
1
|
import { defineRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
my: '4',
|
|
13
|
-
mx: '10',
|
|
14
|
-
},
|
|
15
|
-
row: {
|
|
16
|
-
py: '3',
|
|
17
|
-
px: '10',
|
|
18
|
-
},
|
|
19
|
-
icon: {
|
|
20
|
-
w: '24',
|
|
21
|
-
h: '24',
|
|
22
|
-
},
|
|
23
|
-
beforeSlot: {
|
|
24
|
-
mr: '3',
|
|
25
|
-
},
|
|
26
|
-
afterSlot: {
|
|
27
|
-
ml: '3',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
comfortable: {
|
|
31
|
-
groupLabel: {
|
|
32
|
-
px: '12',
|
|
33
|
-
pt: '12',
|
|
34
|
-
pb: '4',
|
|
35
|
-
fontSize: '14',
|
|
36
|
-
},
|
|
37
|
-
divider: {
|
|
38
|
-
my: '6',
|
|
39
|
-
mx: '12',
|
|
40
|
-
},
|
|
41
|
-
row: {
|
|
42
|
-
py: '7',
|
|
43
|
-
px: '12',
|
|
44
|
-
},
|
|
45
|
-
icon: {
|
|
46
|
-
w: '24',
|
|
47
|
-
h: '24',
|
|
48
|
-
},
|
|
49
|
-
beforeSlot: {
|
|
50
|
-
mr: '3',
|
|
51
|
-
},
|
|
52
|
-
afterSlot: {
|
|
53
|
-
ml: '3',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
spacious: {
|
|
57
|
-
groupLabel: {
|
|
58
|
-
px: '16',
|
|
59
|
-
pt: '16',
|
|
60
|
-
pb: '6',
|
|
61
|
-
fontSize: '16',
|
|
62
|
-
},
|
|
63
|
-
divider: {
|
|
64
|
-
my: '8',
|
|
65
|
-
mx: '16',
|
|
66
|
-
},
|
|
67
|
-
row: {
|
|
68
|
-
py: '9',
|
|
69
|
-
px: '16',
|
|
70
|
-
},
|
|
71
|
-
icon: {
|
|
72
|
-
w: '28',
|
|
73
|
-
h: '28',
|
|
74
|
-
},
|
|
75
|
-
beforeSlot: {
|
|
76
|
-
mr: '4',
|
|
77
|
-
},
|
|
78
|
-
afterSlot: {
|
|
79
|
-
ml: '4',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
} as const;
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
import { listDensityVars } from './listDensity';
|
|
6
|
+
|
|
7
|
+
// Ported from the Cetec design system. The same density custom properties are
|
|
8
|
+
// published at three levels - list, listItemGroup and listItem - each on its
|
|
9
|
+
// own wrapper, so a group label resolves them whether or not it sits inside a
|
|
10
|
+
// list item. This replaces okshaun's separate listDensity object, whose values
|
|
11
|
+
// were identical.
|
|
83
12
|
|
|
84
13
|
export const listRecipe = defineRecipe({
|
|
85
14
|
className: 'list',
|
|
86
15
|
jsx: ['List'],
|
|
87
16
|
base: {
|
|
17
|
+
...globalBaseStyles,
|
|
88
18
|
display: 'flex',
|
|
89
19
|
flexDirection: 'column',
|
|
90
20
|
alignItems: 'start',
|
|
@@ -92,11 +22,7 @@ export const listRecipe = defineRecipe({
|
|
|
92
22
|
gap: '0',
|
|
93
23
|
},
|
|
94
24
|
variants: {
|
|
95
|
-
density:
|
|
96
|
-
compact: {},
|
|
97
|
-
comfortable: {},
|
|
98
|
-
spacious: {},
|
|
99
|
-
},
|
|
25
|
+
density: listDensityVars,
|
|
100
26
|
},
|
|
101
27
|
defaultVariants: {
|
|
102
28
|
density: 'compact',
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Density is one variant that publishes a full set of custom properties on the
|
|
3
|
+
* list wrapper; every other slot, ListItemGroup and Menu read them. Ported from
|
|
4
|
+
* the Cetec design system, which is where the abstraction comes from: expressing
|
|
5
|
+
* density as compound variants instead makes every variant prop on the recipe
|
|
6
|
+
* non-responsive, because Panda types variant props as plain literals rather
|
|
7
|
+
* than ConditionalValue on any recipe declaring compoundVariants.
|
|
8
|
+
*/
|
|
9
|
+
export type ListDensityValue = 'compact' | 'comfortable' | 'spacious';
|
|
10
|
+
|
|
11
|
+
export const listDensityVars = {
|
|
12
|
+
compact: {
|
|
13
|
+
'--list-item-slot-margin': 'token(sizes.5)',
|
|
14
|
+
'--list-item-padding-y': 'token(sizes.3)',
|
|
15
|
+
'--list-item-padding-x': 'token(sizes.10)',
|
|
16
|
+
'--list-item-icon-size': 'token(sizes.24)',
|
|
17
|
+
'--list-item-label-size': 'token(sizes.16)',
|
|
18
|
+
'--list-item-description-size': 'token(sizes.12)',
|
|
19
|
+
'--list-group-label-padding-x': 'token(sizes.10)',
|
|
20
|
+
'--list-group-label-padding-top': 'token(sizes.8)',
|
|
21
|
+
'--list-group-label-padding-bottom': 'token(sizes.2)',
|
|
22
|
+
'--list-group-label-size': 'token(sizes.12)',
|
|
23
|
+
'--list-group-divider-margin-y': 'token(sizes.4)',
|
|
24
|
+
'--list-group-divider-margin-x': 'token(sizes.10)',
|
|
25
|
+
},
|
|
26
|
+
comfortable: {
|
|
27
|
+
'--list-item-slot-margin': 'token(sizes.7)',
|
|
28
|
+
'--list-item-padding-y': 'token(sizes.7)',
|
|
29
|
+
'--list-item-padding-x': 'token(sizes.12)',
|
|
30
|
+
'--list-item-icon-size': 'token(sizes.24)',
|
|
31
|
+
'--list-item-label-size': 'token(sizes.16)',
|
|
32
|
+
'--list-item-description-size': 'token(sizes.12)',
|
|
33
|
+
'--list-group-label-padding-x': 'token(sizes.12)',
|
|
34
|
+
'--list-group-label-padding-top': 'token(sizes.12)',
|
|
35
|
+
'--list-group-label-padding-bottom': 'token(sizes.4)',
|
|
36
|
+
'--list-group-label-size': 'token(sizes.14)',
|
|
37
|
+
'--list-group-divider-margin-y': 'token(sizes.6)',
|
|
38
|
+
'--list-group-divider-margin-x': 'token(sizes.12)',
|
|
39
|
+
},
|
|
40
|
+
spacious: {
|
|
41
|
+
'--list-item-slot-margin': 'token(sizes.9)',
|
|
42
|
+
'--list-item-padding-y': 'token(sizes.9)',
|
|
43
|
+
'--list-item-padding-x': 'token(sizes.16)',
|
|
44
|
+
'--list-item-icon-size': 'token(sizes.28)',
|
|
45
|
+
'--list-item-label-size': 'token(sizes.20)',
|
|
46
|
+
'--list-item-description-size': 'token(sizes.14)',
|
|
47
|
+
'--list-group-label-padding-x': 'token(sizes.16)',
|
|
48
|
+
'--list-group-label-padding-top': 'token(sizes.16)',
|
|
49
|
+
'--list-group-label-padding-bottom': 'token(sizes.6)',
|
|
50
|
+
'--list-group-label-size': 'token(sizes.16)',
|
|
51
|
+
'--list-group-divider-margin-y': 'token(sizes.8)',
|
|
52
|
+
'--list-group-divider-margin-x': 'token(sizes.16)',
|
|
53
|
+
},
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
56
|
+
export const listDensityWrapperVars = {
|
|
57
|
+
compact: {
|
|
58
|
+
wrapper: listDensityVars.compact,
|
|
59
|
+
},
|
|
60
|
+
comfortable: {
|
|
61
|
+
wrapper: listDensityVars.comfortable,
|
|
62
|
+
},
|
|
63
|
+
spacious: {
|
|
64
|
+
wrapper: listDensityVars.spacious,
|
|
65
|
+
},
|
|
66
|
+
} as const;
|
package/src/recipes/listItem.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
import { listDensityWrapperVars } from './listDensity';
|
|
6
|
+
|
|
7
|
+
// Ported from the Cetec design system: structure, slot order, density
|
|
8
|
+
// abstraction and interaction behaviour. okshaun's own semantic tokens carry
|
|
9
|
+
// the styling, and they share these names.
|
|
4
10
|
|
|
5
11
|
export const listItemRecipe = defineSlotRecipe({
|
|
6
12
|
className: 'listItem',
|
|
7
13
|
jsx: ['ListItem'],
|
|
8
14
|
slots: [
|
|
9
15
|
'wrapper',
|
|
16
|
+
'icon',
|
|
10
17
|
'beforeSlot',
|
|
11
18
|
'afterSlot',
|
|
12
|
-
'icon',
|
|
13
19
|
'itemMain',
|
|
14
20
|
'itemLabel',
|
|
15
21
|
'itemDescription',
|
|
@@ -17,11 +23,14 @@ export const listItemRecipe = defineSlotRecipe({
|
|
|
17
23
|
],
|
|
18
24
|
base: {
|
|
19
25
|
wrapper: {
|
|
26
|
+
...globalBaseStyles,
|
|
20
27
|
display: 'flex',
|
|
21
28
|
alignItems: 'start',
|
|
22
29
|
justifyContent: 'start',
|
|
23
30
|
gap: '4',
|
|
24
31
|
width: 'full',
|
|
32
|
+
py: 'var(--list-item-padding-y)',
|
|
33
|
+
px: 'var(--list-item-padding-x)',
|
|
25
34
|
textAlign: 'left',
|
|
26
35
|
borderWidth: '1',
|
|
27
36
|
borderStyle: 'solid',
|
|
@@ -44,39 +53,20 @@ export const listItemRecipe = defineSlotRecipe({
|
|
|
44
53
|
_focus: {
|
|
45
54
|
bg: 'bg.neutral.hovered',
|
|
46
55
|
},
|
|
47
|
-
'&[data-active="true"]': {
|
|
48
|
-
bg: 'bg.neutral.hovered',
|
|
49
|
-
},
|
|
50
|
-
'&[data-disabled="true"]': {
|
|
51
|
-
opacity: '0.4',
|
|
52
|
-
cursor: 'not-allowed',
|
|
53
|
-
pointerEvents: 'none',
|
|
54
|
-
},
|
|
55
56
|
_disabled: {
|
|
56
57
|
opacity: '0.4',
|
|
57
58
|
cursor: 'not-allowed',
|
|
58
59
|
pointerEvents: 'none',
|
|
59
60
|
},
|
|
60
61
|
},
|
|
61
|
-
beforeSlot: {
|
|
62
|
-
display: 'flex',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
flexShrink: '0',
|
|
65
|
-
},
|
|
66
|
-
afterSlot: {
|
|
67
|
-
display: 'flex',
|
|
68
|
-
alignItems: 'center',
|
|
69
|
-
flexShrink: '0',
|
|
70
|
-
},
|
|
71
|
-
divider: {
|
|
72
|
-
width: 'full',
|
|
73
|
-
},
|
|
74
62
|
icon: {
|
|
75
63
|
aspectRatio: 'square',
|
|
76
64
|
transitionDuration: 'fast',
|
|
77
65
|
transitionProperty: 'fill',
|
|
78
66
|
transitionTimingFunction: 'default',
|
|
79
67
|
flexShrink: '0',
|
|
68
|
+
w: 'var(--list-item-icon-size)',
|
|
69
|
+
h: 'var(--list-item-icon-size)',
|
|
80
70
|
},
|
|
81
71
|
itemMain: {
|
|
82
72
|
display: 'flex',
|
|
@@ -86,11 +76,24 @@ export const listItemRecipe = defineSlotRecipe({
|
|
|
86
76
|
},
|
|
87
77
|
itemLabel: {
|
|
88
78
|
color: 'text',
|
|
79
|
+
fontSize: 'var(--list-item-label-size)',
|
|
89
80
|
},
|
|
90
81
|
itemDescription: {
|
|
91
82
|
color: 'text.subtlest',
|
|
83
|
+
fontSize: 'var(--list-item-description-size)',
|
|
92
84
|
lineHeight: 'tight',
|
|
93
85
|
},
|
|
86
|
+
beforeSlot: {
|
|
87
|
+
ms: 'calc(var(--list-item-slot-margin) * -1)',
|
|
88
|
+
},
|
|
89
|
+
afterSlot: {
|
|
90
|
+
me: 'calc(var(--list-item-slot-margin) * -1)',
|
|
91
|
+
},
|
|
92
|
+
divider: {
|
|
93
|
+
width: 'full',
|
|
94
|
+
py: 'var(--list-item-padding-y)',
|
|
95
|
+
px: 'var(--list-item-padding-x)',
|
|
96
|
+
},
|
|
94
97
|
},
|
|
95
98
|
variants: {
|
|
96
99
|
variant: {
|
|
@@ -141,60 +144,11 @@ export const listItemRecipe = defineSlotRecipe({
|
|
|
141
144
|
},
|
|
142
145
|
divider: {},
|
|
143
146
|
},
|
|
144
|
-
density:
|
|
145
|
-
compact: {
|
|
146
|
-
wrapper: listDensity.compact.row,
|
|
147
|
-
itemLabel: {
|
|
148
|
-
textStyle: 'sans.md',
|
|
149
|
-
color: 'text',
|
|
150
|
-
},
|
|
151
|
-
itemDescription: {
|
|
152
|
-
textStyle: 'sans.xs',
|
|
153
|
-
lineHeight: 'tight',
|
|
154
|
-
},
|
|
155
|
-
icon: listDensity.compact.icon,
|
|
156
|
-
beforeSlot: listDensity.compact.beforeSlot,
|
|
157
|
-
afterSlot: listDensity.compact.afterSlot,
|
|
158
|
-
divider: listDensity.compact.divider,
|
|
159
|
-
},
|
|
160
|
-
comfortable: {
|
|
161
|
-
wrapper: listDensity.comfortable.row,
|
|
162
|
-
itemLabel: {
|
|
163
|
-
textStyle: 'sans.md',
|
|
164
|
-
color: 'text',
|
|
165
|
-
},
|
|
166
|
-
itemDescription: {
|
|
167
|
-
textStyle: 'sans.xs',
|
|
168
|
-
lineHeight: 'tight',
|
|
169
|
-
},
|
|
170
|
-
icon: listDensity.comfortable.icon,
|
|
171
|
-
beforeSlot: listDensity.comfortable.beforeSlot,
|
|
172
|
-
afterSlot: listDensity.comfortable.afterSlot,
|
|
173
|
-
divider: listDensity.comfortable.divider,
|
|
174
|
-
},
|
|
175
|
-
spacious: {
|
|
176
|
-
wrapper: listDensity.spacious.row,
|
|
177
|
-
itemLabel: {
|
|
178
|
-
textStyle: 'sans.lg',
|
|
179
|
-
color: 'text',
|
|
180
|
-
},
|
|
181
|
-
itemDescription: {
|
|
182
|
-
textStyle: 'sans.sm',
|
|
183
|
-
lineHeight: 'tight',
|
|
184
|
-
},
|
|
185
|
-
icon: listDensity.spacious.icon,
|
|
186
|
-
beforeSlot: listDensity.spacious.beforeSlot,
|
|
187
|
-
afterSlot: listDensity.spacious.afterSlot,
|
|
188
|
-
divider: listDensity.spacious.divider,
|
|
189
|
-
},
|
|
190
|
-
},
|
|
147
|
+
density: listDensityWrapperVars,
|
|
191
148
|
selected: {
|
|
192
149
|
true: {
|
|
193
150
|
wrapper: {
|
|
194
151
|
bg: 'surface.selected',
|
|
195
|
-
'&[data-active="true"]': {
|
|
196
|
-
bg: 'surface.selected.hovered',
|
|
197
|
-
},
|
|
198
152
|
_hover: {
|
|
199
153
|
bg: 'surface.selected.hovered',
|
|
200
154
|
},
|
|
@@ -217,101 +171,8 @@ export const listItemRecipe = defineSlotRecipe({
|
|
|
217
171
|
false: {},
|
|
218
172
|
},
|
|
219
173
|
},
|
|
220
|
-
compoundVariants: [
|
|
221
|
-
{
|
|
222
|
-
density: 'compact',
|
|
223
|
-
iconBefore: true,
|
|
224
|
-
css: {
|
|
225
|
-
wrapper: {
|
|
226
|
-
ps: '5',
|
|
227
|
-
},
|
|
228
|
-
beforeSlot: listDensity.compact.beforeSlot,
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
density: 'compact',
|
|
233
|
-
iconAfter: true,
|
|
234
|
-
css: {
|
|
235
|
-
wrapper: {
|
|
236
|
-
pe: '5',
|
|
237
|
-
},
|
|
238
|
-
afterSlot: listDensity.compact.afterSlot,
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
density: 'compact',
|
|
243
|
-
variant: 'checkbox',
|
|
244
|
-
css: {
|
|
245
|
-
wrapper: {
|
|
246
|
-
ps: '5',
|
|
247
|
-
},
|
|
248
|
-
beforeSlot: listDensity.compact.beforeSlot,
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
density: 'comfortable',
|
|
253
|
-
iconBefore: true,
|
|
254
|
-
css: {
|
|
255
|
-
wrapper: {
|
|
256
|
-
ps: '7',
|
|
257
|
-
},
|
|
258
|
-
beforeSlot: listDensity.comfortable.beforeSlot,
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
density: 'comfortable',
|
|
263
|
-
iconAfter: true,
|
|
264
|
-
css: {
|
|
265
|
-
wrapper: {
|
|
266
|
-
pe: '7',
|
|
267
|
-
},
|
|
268
|
-
afterSlot: listDensity.comfortable.afterSlot,
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
density: 'comfortable',
|
|
273
|
-
variant: 'checkbox',
|
|
274
|
-
css: {
|
|
275
|
-
wrapper: {
|
|
276
|
-
ps: '7',
|
|
277
|
-
},
|
|
278
|
-
beforeSlot: listDensity.comfortable.beforeSlot,
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
density: 'spacious',
|
|
283
|
-
iconBefore: true,
|
|
284
|
-
css: {
|
|
285
|
-
wrapper: {
|
|
286
|
-
ps: '9',
|
|
287
|
-
},
|
|
288
|
-
beforeSlot: listDensity.spacious.beforeSlot,
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
density: 'spacious',
|
|
293
|
-
iconAfter: true,
|
|
294
|
-
css: {
|
|
295
|
-
wrapper: {
|
|
296
|
-
pe: '9',
|
|
297
|
-
},
|
|
298
|
-
afterSlot: listDensity.spacious.afterSlot,
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
density: 'spacious',
|
|
303
|
-
variant: 'checkbox',
|
|
304
|
-
css: {
|
|
305
|
-
wrapper: {
|
|
306
|
-
ps: '9',
|
|
307
|
-
},
|
|
308
|
-
beforeSlot: listDensity.spacious.beforeSlot,
|
|
309
|
-
},
|
|
310
|
-
},
|
|
311
|
-
],
|
|
312
174
|
defaultVariants: {
|
|
313
175
|
variant: 'default',
|
|
314
176
|
density: 'compact',
|
|
315
|
-
selected: false,
|
|
316
177
|
},
|
|
317
178
|
});
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
import { listDensityWrapperVars } from './listDensity';
|
|
6
|
+
|
|
7
|
+
// Ported from the Cetec design system: reads the shared density custom
|
|
8
|
+
// properties rather than spreading a per-density style object.
|
|
4
9
|
|
|
5
10
|
export const listItemGroupRecipe = defineSlotRecipe({
|
|
6
11
|
className: 'listItemGroup',
|
|
@@ -11,28 +16,23 @@ export const listItemGroupRecipe = defineSlotRecipe({
|
|
|
11
16
|
width: 'full',
|
|
12
17
|
},
|
|
13
18
|
groupLabel: {
|
|
19
|
+
...globalBaseStyles,
|
|
14
20
|
color: 'text.subtlest',
|
|
21
|
+
px: 'var(--list-group-label-padding-x)',
|
|
22
|
+
pt: 'var(--list-group-label-padding-top)',
|
|
23
|
+
pb: 'var(--list-group-label-padding-bottom)',
|
|
24
|
+
fontSize: 'var(--list-group-label-size)',
|
|
15
25
|
borderStyle: 'solid',
|
|
16
26
|
borderWidth: '1',
|
|
17
27
|
borderColor: 'transparent',
|
|
18
28
|
},
|
|
19
|
-
divider: {
|
|
29
|
+
divider: {
|
|
30
|
+
my: 'var(--list-group-divider-margin-y)',
|
|
31
|
+
mx: 'var(--list-group-divider-margin-x)',
|
|
32
|
+
},
|
|
20
33
|
},
|
|
21
34
|
variants: {
|
|
22
|
-
density:
|
|
23
|
-
compact: {
|
|
24
|
-
groupLabel: listDensity.compact.groupLabel,
|
|
25
|
-
divider: listDensity.compact.divider,
|
|
26
|
-
},
|
|
27
|
-
comfortable: {
|
|
28
|
-
groupLabel: listDensity.comfortable.groupLabel,
|
|
29
|
-
divider: listDensity.comfortable.divider,
|
|
30
|
-
},
|
|
31
|
-
spacious: {
|
|
32
|
-
groupLabel: listDensity.spacious.groupLabel,
|
|
33
|
-
divider: listDensity.spacious.divider,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
35
|
+
density: listDensityWrapperVars,
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
38
|
density: 'compact',
|
package/src/recipes/menu.ts
CHANGED
|
@@ -7,7 +7,6 @@ const menuBase = {
|
|
|
7
7
|
borderRadius: '4',
|
|
8
8
|
boxShadow: 'overlay',
|
|
9
9
|
overflow: 'hidden',
|
|
10
|
-
zIndex: '100',
|
|
11
10
|
transitionProperty: 'width, height',
|
|
12
11
|
transitionDuration: 'normal',
|
|
13
12
|
transitionTimingFunction: 'default',
|
|
@@ -22,13 +21,13 @@ const menuBase = {
|
|
|
22
21
|
borderWidth: '0',
|
|
23
22
|
borderBlockWidth: '3',
|
|
24
23
|
borderColor: 'transparent',
|
|
25
|
-
bg: { base: 'tan.
|
|
24
|
+
bg: { base: 'tan.10', _dark: 'tan.60' },
|
|
26
25
|
width: 'full',
|
|
27
26
|
textAlign: 'left',
|
|
28
27
|
cursor: 'pointer',
|
|
29
28
|
color: 'text',
|
|
30
29
|
_hover: {
|
|
31
|
-
bg: { base: 'tan.
|
|
30
|
+
bg: { base: 'tan.20', _dark: 'tan.50' },
|
|
32
31
|
},
|
|
33
32
|
_active: {
|
|
34
33
|
bg: { base: 'tan.20', _dark: 'tan.70' },
|
|
@@ -69,6 +68,20 @@ const menuBase = {
|
|
|
69
68
|
};
|
|
70
69
|
|
|
71
70
|
const menuVariants = {
|
|
71
|
+
// Floating content inherits its layer from FloatingLayerContext, so a menu
|
|
72
|
+
// opened inside a modal stacks above the dialog instead of behind it.
|
|
73
|
+
layer: {
|
|
74
|
+
elevated: {
|
|
75
|
+
wrapper: {
|
|
76
|
+
zIndex: 'elevated',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
modalFloating: {
|
|
80
|
+
wrapper: {
|
|
81
|
+
zIndex: 'modalFloating',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
72
85
|
density: {
|
|
73
86
|
compact: {
|
|
74
87
|
backHeader: {
|
|
@@ -128,5 +141,6 @@ export const menuRecipe = defineSlotRecipe({
|
|
|
128
141
|
variants: menuVariants,
|
|
129
142
|
defaultVariants: {
|
|
130
143
|
density: 'compact',
|
|
144
|
+
layer: 'elevated',
|
|
131
145
|
},
|
|
132
146
|
});
|