@okshaun/components 4.2.0 → 5.0.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/README.md +1 -1
- package/dist/icon-metadata.json +134 -0
- package/dist/index.js +15085 -9899
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +739 -531
- package/dist/{preset-CsYXL2Bm.js → preset-B6fsdoKY.js} +2141 -214
- package/dist/preset-B6fsdoKY.js.map +1 -0
- package/dist/preset.js +1 -1
- package/dist/specs/keyframes.json +66 -0
- package/dist/specs/recipes.json +383 -26
- package/dist/specs/tokens.json +15 -0
- package/dist/sprite.svg +1 -1
- package/dist/sprite.symbol.html +248 -2
- package/dist/styles.css +3862 -799
- package/dist/svgs/barcode-reader-off.svg +1 -0
- package/dist/svgs/circle-dashed.svg +1 -0
- package/dist/svgs/drawer-left-hide.svg +1 -0
- package/dist/svgs/drawer-left-show.svg +1 -0
- package/dist/svgs/drawer-right-hide.svg +1 -0
- package/dist/svgs/drawer-right-show.svg +1 -0
- package/dist/svgs/not-equal.svg +1 -0
- package/dist/svgs/square-dashed.svg +1 -0
- package/dist/types/index.d.ts +2725 -117
- package/package.json +9 -12
- package/src/recipes/alert.ts +80 -0
- package/src/recipes/autocomplete.ts +2 -2
- package/src/recipes/avatar.ts +13 -6
- package/src/recipes/button.ts +41 -30
- package/src/recipes/checkbox.ts +3 -0
- package/src/recipes/chip.ts +16 -0
- package/src/recipes/code.ts +40 -23
- package/src/recipes/codeBlock.ts +277 -0
- package/src/recipes/drawer.ts +150 -0
- package/src/recipes/filterField.ts +138 -0
- package/src/recipes/filterMenu.ts +71 -0
- package/src/recipes/filterToken.ts +189 -0
- package/src/recipes/inlineNote.ts +49 -0
- package/src/recipes/keyFact.ts +111 -0
- package/src/recipes/listItem.ts +25 -0
- package/src/recipes/menu.ts +41 -2
- package/src/recipes/pageBanner.ts +110 -0
- package/src/recipes/peekBar.ts +35 -0
- package/src/recipes/popover.ts +206 -0
- package/src/recipes/recipes-regular.ts +1 -1
- package/src/recipes/recipes-slot.ts +13 -0
- package/src/recipes/segmentedFields.ts +11 -5
- package/src/recipes/select.ts +204 -63
- package/src/recipes/spinner.ts +1 -1
- package/src/recipes/tabs.ts +161 -0
- package/src/recipes/tag.ts +13 -2
- package/src/recipes/timeMenus.ts +1 -1
- package/src/recipes/toast.ts +116 -0
- package/src/recipes/toggle.ts +3 -3
- package/src/styles/primitives/fontSizes.ts +1 -0
- package/src/styles/primitives/radii.ts +2 -0
- package/src/styles/utilities/keyframes.ts +38 -0
- package/src/utils/compoundComponent.ts +29 -0
- package/dist/preset-CsYXL2Bm.js.map +0 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
// Every part renders through `Box`, which applies the body font and a subtle
|
|
6
|
+
// text color. Inner parts restate inheritance so the block's own font and tone
|
|
7
|
+
// color reach the code.
|
|
8
|
+
const inheritText = {
|
|
9
|
+
fontFamily: 'inherit',
|
|
10
|
+
fontVariationSettings: 'inherit',
|
|
11
|
+
fontSize: 'inherit',
|
|
12
|
+
fontWeight: 'inherit',
|
|
13
|
+
lineHeight: 'inherit',
|
|
14
|
+
color: 'inherit',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const focusRing = {
|
|
18
|
+
outlineWidth: '2',
|
|
19
|
+
outlineStyle: 'solid',
|
|
20
|
+
outlineColor: 'border.focused',
|
|
21
|
+
outlineOffset: '-2',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const codeBlockBase = {
|
|
25
|
+
root: {
|
|
26
|
+
...globalBaseStyles,
|
|
27
|
+
position: 'relative',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
w: 'full',
|
|
31
|
+
minW: '0',
|
|
32
|
+
borderWidth: '1',
|
|
33
|
+
borderStyle: 'solid',
|
|
34
|
+
rounded: '8',
|
|
35
|
+
overflow: 'hidden',
|
|
36
|
+
},
|
|
37
|
+
header: {
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
gap: '8',
|
|
41
|
+
minH: '32',
|
|
42
|
+
pl: '16',
|
|
43
|
+
pr: '4',
|
|
44
|
+
borderBottomWidth: '1',
|
|
45
|
+
borderBottomStyle: 'solid',
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
flex: '1',
|
|
49
|
+
minW: '0',
|
|
50
|
+
fontFamily: 'mono',
|
|
51
|
+
fontSize: '12',
|
|
52
|
+
lineHeight: 'tight',
|
|
53
|
+
color: 'inherit',
|
|
54
|
+
truncate: true,
|
|
55
|
+
},
|
|
56
|
+
actions: {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
gap: '2',
|
|
60
|
+
flex: 'none',
|
|
61
|
+
},
|
|
62
|
+
floatingActions: {
|
|
63
|
+
position: 'absolute',
|
|
64
|
+
top: '4',
|
|
65
|
+
right: '4',
|
|
66
|
+
zIndex: '1',
|
|
67
|
+
display: 'flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
gap: '2',
|
|
70
|
+
},
|
|
71
|
+
content: {
|
|
72
|
+
position: 'relative',
|
|
73
|
+
overflowX: 'auto',
|
|
74
|
+
overflowY: 'auto',
|
|
75
|
+
fontFamily: 'mono',
|
|
76
|
+
fontWeight: 'normal',
|
|
77
|
+
lineHeight: 'loose',
|
|
78
|
+
color: 'inherit',
|
|
79
|
+
_focusVisible: focusRing,
|
|
80
|
+
},
|
|
81
|
+
pre: {
|
|
82
|
+
...inheritText,
|
|
83
|
+
m: '0',
|
|
84
|
+
py: '12',
|
|
85
|
+
px: '16',
|
|
86
|
+
minW: 'full',
|
|
87
|
+
w: 'fit-content',
|
|
88
|
+
bg: 'transparent',
|
|
89
|
+
tabSize: '2',
|
|
90
|
+
},
|
|
91
|
+
// Also resets global `code` styles from the host page, such as a tint or
|
|
92
|
+
// padding meant for inline code.
|
|
93
|
+
code: {
|
|
94
|
+
...inheritText,
|
|
95
|
+
display: 'block',
|
|
96
|
+
m: '0',
|
|
97
|
+
p: '0',
|
|
98
|
+
rounded: '0',
|
|
99
|
+
bg: 'transparent',
|
|
100
|
+
whiteSpace: 'inherit',
|
|
101
|
+
overflowWrap: 'inherit',
|
|
102
|
+
mixBlendMode: 'normal',
|
|
103
|
+
},
|
|
104
|
+
line: {
|
|
105
|
+
...inheritText,
|
|
106
|
+
display: 'block',
|
|
107
|
+
position: 'relative',
|
|
108
|
+
// An empty line has no text, so it needs an explicit one-line height.
|
|
109
|
+
minH: '1lh',
|
|
110
|
+
},
|
|
111
|
+
lineNumber: {
|
|
112
|
+
...inheritText,
|
|
113
|
+
position: 'absolute',
|
|
114
|
+
left: '0',
|
|
115
|
+
w: 'var(--code-block-gutter)',
|
|
116
|
+
textAlign: 'right',
|
|
117
|
+
userSelect: 'none',
|
|
118
|
+
pointerEvents: 'none',
|
|
119
|
+
_before: {
|
|
120
|
+
content: 'attr(data-line)',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
expand: {
|
|
124
|
+
display: 'flex',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'center',
|
|
127
|
+
gap: '4',
|
|
128
|
+
w: 'full',
|
|
129
|
+
minH: '32',
|
|
130
|
+
px: '16',
|
|
131
|
+
borderTopWidth: '1',
|
|
132
|
+
borderTopStyle: 'solid',
|
|
133
|
+
fontSize: '12',
|
|
134
|
+
fontWeight: 'medium',
|
|
135
|
+
cursor: 'pointer',
|
|
136
|
+
_focusVisible: focusRing,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const codeBlockVariants = {
|
|
141
|
+
/**
|
|
142
|
+
* Surface treatment. `default` sits on the page as a sunken panel.
|
|
143
|
+
* `inverse` uses the inverse surface for setup and integration snippets that
|
|
144
|
+
* must stand apart from the surrounding page; it follows the theme, so it is
|
|
145
|
+
* dark in the light theme and light in the dark theme.
|
|
146
|
+
*/
|
|
147
|
+
tone: {
|
|
148
|
+
default: {
|
|
149
|
+
root: {
|
|
150
|
+
bg: 'surface.sunken',
|
|
151
|
+
borderColor: 'border',
|
|
152
|
+
color: 'text',
|
|
153
|
+
},
|
|
154
|
+
header: {
|
|
155
|
+
borderColor: 'border',
|
|
156
|
+
color: 'text.subtle',
|
|
157
|
+
},
|
|
158
|
+
lineNumber: {
|
|
159
|
+
color: 'text.subtlest',
|
|
160
|
+
},
|
|
161
|
+
expand: {
|
|
162
|
+
bg: 'surface.sunken',
|
|
163
|
+
borderColor: 'border',
|
|
164
|
+
color: 'text.subtle',
|
|
165
|
+
_hover: { bg: 'surface.hovered', color: 'text' },
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
inverse: {
|
|
169
|
+
root: {
|
|
170
|
+
bg: 'bg.neutral.inverse',
|
|
171
|
+
borderColor: 'transparent',
|
|
172
|
+
color: 'text.inverse',
|
|
173
|
+
},
|
|
174
|
+
header: {
|
|
175
|
+
borderColor: 'bg.neutral.inverse.subtle',
|
|
176
|
+
color: 'text.inverse.subtlest',
|
|
177
|
+
},
|
|
178
|
+
lineNumber: {
|
|
179
|
+
color: 'text.inverse.subtlest',
|
|
180
|
+
},
|
|
181
|
+
expand: {
|
|
182
|
+
bg: 'bg.neutral.inverse',
|
|
183
|
+
borderColor: 'bg.neutral.inverse.subtle',
|
|
184
|
+
color: 'text.inverse.subtlest',
|
|
185
|
+
_hover: { color: 'text.inverse' },
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
size: {
|
|
190
|
+
sm: {
|
|
191
|
+
content: { fontSize: '12' },
|
|
192
|
+
},
|
|
193
|
+
md: {
|
|
194
|
+
content: { fontSize: '14' },
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
/** Wraps long lines instead of scrolling horizontally. */
|
|
198
|
+
wrap: {
|
|
199
|
+
true: {
|
|
200
|
+
pre: {
|
|
201
|
+
whiteSpace: 'pre-wrap',
|
|
202
|
+
overflowWrap: 'anywhere',
|
|
203
|
+
w: 'auto',
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
false: {
|
|
207
|
+
pre: {
|
|
208
|
+
whiteSpace: 'pre',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
/** Reserves a gutter on each line for the line number. */
|
|
213
|
+
lineNumbers: {
|
|
214
|
+
true: {
|
|
215
|
+
line: {
|
|
216
|
+
pl: 'calc(var(--code-block-gutter) + token(spacing.16))',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
false: {},
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* Limits the visible height to the first `--code-block-max-lines` source
|
|
223
|
+
* lines. The component measures the bottom of the last visible line into
|
|
224
|
+
* `--code-block-collapsed-h`, so a wrapped line shows in full. The `calc`
|
|
225
|
+
* is the fallback before measurement, and it is exact when lines do not
|
|
226
|
+
* wrap.
|
|
227
|
+
*/
|
|
228
|
+
collapsed: {
|
|
229
|
+
true: {
|
|
230
|
+
content: {
|
|
231
|
+
maxH: 'var(--code-block-collapsed-h, calc(var(--code-block-max-lines) * 1lh + token(spacing.24)))',
|
|
232
|
+
overflowY: 'hidden',
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
false: {},
|
|
236
|
+
},
|
|
237
|
+
/**
|
|
238
|
+
* Reserves a gutter on the right of the code for the floating copy button,
|
|
239
|
+
* so the button never covers code. Set when there is no header.
|
|
240
|
+
*/
|
|
241
|
+
actionGutter: {
|
|
242
|
+
true: {
|
|
243
|
+
content: {
|
|
244
|
+
mr: '32',
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
false: {},
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export const codeBlockRecipe = defineSlotRecipe({
|
|
252
|
+
className: 'codeBlock',
|
|
253
|
+
jsx: ['CodeBlock'],
|
|
254
|
+
slots: [
|
|
255
|
+
'root',
|
|
256
|
+
'header',
|
|
257
|
+
'title',
|
|
258
|
+
'actions',
|
|
259
|
+
'floatingActions',
|
|
260
|
+
'content',
|
|
261
|
+
'pre',
|
|
262
|
+
'code',
|
|
263
|
+
'line',
|
|
264
|
+
'lineNumber',
|
|
265
|
+
'expand',
|
|
266
|
+
],
|
|
267
|
+
base: codeBlockBase,
|
|
268
|
+
variants: codeBlockVariants,
|
|
269
|
+
defaultVariants: {
|
|
270
|
+
tone: 'default',
|
|
271
|
+
size: 'md',
|
|
272
|
+
wrap: false,
|
|
273
|
+
lineNumbers: false,
|
|
274
|
+
collapsed: false,
|
|
275
|
+
actionGutter: false,
|
|
276
|
+
},
|
|
277
|
+
});
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const drawerBase = {
|
|
6
|
+
overlay: {
|
|
7
|
+
position: 'fixed',
|
|
8
|
+
inset: '0',
|
|
9
|
+
bg: 'blanket',
|
|
10
|
+
zIndex: 1100,
|
|
11
|
+
// Initial state matches animation start
|
|
12
|
+
opacity: '0',
|
|
13
|
+
animation: 'modalFadeIn 200ms ease-out forwards',
|
|
14
|
+
'&[data-state="closing"]': {
|
|
15
|
+
animation: 'modalFadeOut 200ms ease-out forwards',
|
|
16
|
+
},
|
|
17
|
+
_motionReduce: {
|
|
18
|
+
opacity: '1',
|
|
19
|
+
animation: 'none',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
container: {
|
|
23
|
+
...globalBaseStyles,
|
|
24
|
+
position: 'fixed',
|
|
25
|
+
top: '0',
|
|
26
|
+
bottom: '0',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
// Size to the visible viewport, so the footer stays on screen when mobile
|
|
30
|
+
// browser controls expand. 100vh is the fallback for browsers without dvh.
|
|
31
|
+
h: '100vh',
|
|
32
|
+
'@supports (height: 100dvh)': {
|
|
33
|
+
h: '100dvh',
|
|
34
|
+
},
|
|
35
|
+
maxW: '100vw',
|
|
36
|
+
bg: 'surface.overlay',
|
|
37
|
+
boxShadow: 'overlay',
|
|
38
|
+
outline: 'none',
|
|
39
|
+
// Same layer as the modal's position wrapper, not its 1101 container: the
|
|
40
|
+
// modal's 1101 only applies inside that wrapper's stacking context. On a
|
|
41
|
+
// tie, the later portal paints on top, so a modal opened from a drawer
|
|
42
|
+
// covers it. The container follows the overlay in the DOM, so it still
|
|
43
|
+
// paints above its own scrim.
|
|
44
|
+
zIndex: 1100,
|
|
45
|
+
_motionReduce: {
|
|
46
|
+
animation: 'none',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
header: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'space-between',
|
|
53
|
+
gap: '12',
|
|
54
|
+
flexShrink: 0,
|
|
55
|
+
px: '20',
|
|
56
|
+
py: '12',
|
|
57
|
+
borderBottom: 'default',
|
|
58
|
+
},
|
|
59
|
+
title: {
|
|
60
|
+
w: 'full',
|
|
61
|
+
truncate: true,
|
|
62
|
+
},
|
|
63
|
+
closeButton: {
|
|
64
|
+
// IconButton styles are applied by the IconButton component.
|
|
65
|
+
},
|
|
66
|
+
body: {
|
|
67
|
+
flex: 1,
|
|
68
|
+
minH: '0',
|
|
69
|
+
display: 'flex',
|
|
70
|
+
flexDirection: 'column',
|
|
71
|
+
gap: '12',
|
|
72
|
+
px: '20',
|
|
73
|
+
py: '20',
|
|
74
|
+
},
|
|
75
|
+
footer: {
|
|
76
|
+
display: 'flex',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
justifyContent: 'flex-end',
|
|
79
|
+
gap: '8',
|
|
80
|
+
flexShrink: 0,
|
|
81
|
+
px: '20',
|
|
82
|
+
py: '12',
|
|
83
|
+
borderTop: 'default',
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const mobile = {
|
|
88
|
+
xsDown: {
|
|
89
|
+
w: '100vw',
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const drawerVariants = {
|
|
94
|
+
side: {
|
|
95
|
+
right: {
|
|
96
|
+
container: {
|
|
97
|
+
right: '0',
|
|
98
|
+
animation: 'drawerSlideInRight 200ms ease-out forwards',
|
|
99
|
+
'&[data-state="closing"]': {
|
|
100
|
+
animation: 'drawerSlideOutRight 200ms ease-in forwards',
|
|
101
|
+
_motionReduce: { animation: 'none' },
|
|
102
|
+
},
|
|
103
|
+
_motionReduce: { animation: 'none' },
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
left: {
|
|
107
|
+
container: {
|
|
108
|
+
left: '0',
|
|
109
|
+
animation: 'drawerSlideInLeft 200ms ease-out forwards',
|
|
110
|
+
'&[data-state="closing"]': {
|
|
111
|
+
animation: 'drawerSlideOutLeft 200ms ease-in forwards',
|
|
112
|
+
_motionReduce: { animation: 'none' },
|
|
113
|
+
},
|
|
114
|
+
_motionReduce: { animation: 'none' },
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
size: {
|
|
119
|
+
sm: { container: { w: 'md', ...mobile } },
|
|
120
|
+
md: { container: { w: 'xl', ...mobile } },
|
|
121
|
+
lg: { container: { w: '3xl', ...mobile } },
|
|
122
|
+
xl: { container: { w: '5xl', ...mobile } },
|
|
123
|
+
full: { container: { w: '100vw' } },
|
|
124
|
+
},
|
|
125
|
+
scrollable: {
|
|
126
|
+
true: { body: { overflowY: 'auto' } },
|
|
127
|
+
false: { body: { overflow: 'hidden' } },
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const drawerRecipe = defineSlotRecipe({
|
|
132
|
+
className: 'drawer',
|
|
133
|
+
jsx: ['Drawer', 'DrawerHeader', 'DrawerBody', 'DrawerFooter'],
|
|
134
|
+
slots: [
|
|
135
|
+
'overlay',
|
|
136
|
+
'container',
|
|
137
|
+
'header',
|
|
138
|
+
'title',
|
|
139
|
+
'closeButton',
|
|
140
|
+
'body',
|
|
141
|
+
'footer',
|
|
142
|
+
],
|
|
143
|
+
base: drawerBase,
|
|
144
|
+
variants: drawerVariants,
|
|
145
|
+
defaultVariants: {
|
|
146
|
+
side: 'right',
|
|
147
|
+
size: 'md',
|
|
148
|
+
scrollable: true,
|
|
149
|
+
},
|
|
150
|
+
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The filter bar's field: a search icon, the filter tokens, one text input,
|
|
7
|
+
* a "+N more" button for tokens that do not fit, and a clear-all button.
|
|
8
|
+
* The frame matches the `Autocomplete` control.
|
|
9
|
+
*/
|
|
10
|
+
export const filterFieldRecipe = defineSlotRecipe({
|
|
11
|
+
className: 'filterField',
|
|
12
|
+
jsx: ['FilterField'],
|
|
13
|
+
slots: [
|
|
14
|
+
'root',
|
|
15
|
+
'icon',
|
|
16
|
+
'values',
|
|
17
|
+
'sizer',
|
|
18
|
+
'token',
|
|
19
|
+
'input',
|
|
20
|
+
'more',
|
|
21
|
+
'shortcut',
|
|
22
|
+
'clear',
|
|
23
|
+
],
|
|
24
|
+
base: {
|
|
25
|
+
root: {
|
|
26
|
+
...globalBaseStyles,
|
|
27
|
+
'--filter-field-gap': 'token(sizes.6)',
|
|
28
|
+
'--filter-field-input-min': 'token(sizes.120)',
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
gap: '8',
|
|
32
|
+
w: 'full',
|
|
33
|
+
minW: '0',
|
|
34
|
+
minH: '40',
|
|
35
|
+
ps: '10',
|
|
36
|
+
pe: '4',
|
|
37
|
+
bg: 'surface',
|
|
38
|
+
color: 'text',
|
|
39
|
+
borderWidth: '1',
|
|
40
|
+
borderStyle: 'solid',
|
|
41
|
+
borderColor: 'border.input',
|
|
42
|
+
borderRadius: '4',
|
|
43
|
+
outlineWidth: '1',
|
|
44
|
+
outlineStyle: 'solid',
|
|
45
|
+
outlineColor: 'transparent',
|
|
46
|
+
cursor: 'text',
|
|
47
|
+
transitionDuration: 'fast',
|
|
48
|
+
transitionProperty: 'background, border-color, outline-color',
|
|
49
|
+
transitionTimingFunction: 'default',
|
|
50
|
+
_focusWithin: {
|
|
51
|
+
borderColor: 'border.focused',
|
|
52
|
+
outlineColor: 'border.focused',
|
|
53
|
+
},
|
|
54
|
+
_disabled: {
|
|
55
|
+
bg: 'bg.disabled',
|
|
56
|
+
borderColor: 'border.disabled',
|
|
57
|
+
color: 'text.disabled',
|
|
58
|
+
cursor: 'not-allowed',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
icon: {
|
|
62
|
+
flexShrink: '0',
|
|
63
|
+
},
|
|
64
|
+
values: {
|
|
65
|
+
position: 'relative',
|
|
66
|
+
display: 'flex',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
gap: 'var(--filter-field-gap)',
|
|
69
|
+
flex: '1',
|
|
70
|
+
minW: '0',
|
|
71
|
+
},
|
|
72
|
+
// Spans the values area so the overflow hook reads its width. The end
|
|
73
|
+
// padding keeps room for the input.
|
|
74
|
+
sizer: {
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
inset: '0',
|
|
77
|
+
columnGap: 'var(--filter-field-gap)',
|
|
78
|
+
pe: 'calc(var(--filter-field-input-min) + var(--filter-field-gap))',
|
|
79
|
+
visibility: 'hidden',
|
|
80
|
+
pointerEvents: 'none',
|
|
81
|
+
},
|
|
82
|
+
token: {
|
|
83
|
+
display: 'inline-flex',
|
|
84
|
+
flexShrink: '0',
|
|
85
|
+
// A token behind "+N more" stays in the DOM, so its width can be read.
|
|
86
|
+
'&[data-overflowed]': {
|
|
87
|
+
position: 'absolute',
|
|
88
|
+
insetInlineStart: '0',
|
|
89
|
+
visibility: 'hidden',
|
|
90
|
+
pointerEvents: 'none',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
input: {
|
|
94
|
+
flex: '1',
|
|
95
|
+
minW: 'var(--filter-field-input-min)',
|
|
96
|
+
h: '28',
|
|
97
|
+
p: '0',
|
|
98
|
+
bg: 'transparent',
|
|
99
|
+
color: 'text',
|
|
100
|
+
fontFamily: 'sans',
|
|
101
|
+
fontSize: '14',
|
|
102
|
+
borderWidth: '0',
|
|
103
|
+
outline: 'none',
|
|
104
|
+
_placeholder: {
|
|
105
|
+
color: 'text.placeholder',
|
|
106
|
+
},
|
|
107
|
+
_disabled: {
|
|
108
|
+
cursor: 'not-allowed',
|
|
109
|
+
},
|
|
110
|
+
// Inside a token, the input is as wide as its text.
|
|
111
|
+
'&[data-inline]': {
|
|
112
|
+
flex: 'none',
|
|
113
|
+
minW: '0',
|
|
114
|
+
h: '22',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
more: {
|
|
118
|
+
flexShrink: '0',
|
|
119
|
+
'&[data-pending]': {
|
|
120
|
+
borderStyle: 'dashed',
|
|
121
|
+
},
|
|
122
|
+
'&[data-open]': {
|
|
123
|
+
borderColor: 'border.focused',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
shortcut: {
|
|
127
|
+
flexShrink: '0',
|
|
128
|
+
// At the end of the field, the hint lines up with the start padding.
|
|
129
|
+
me: '6',
|
|
130
|
+
'[data-has-clear] &': {
|
|
131
|
+
me: '0',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
clear: {
|
|
135
|
+
flexShrink: '0',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The popup list of a filter field. Focus stays in the field's input, so the
|
|
7
|
+
* active row is shown with the hover fill, not with focus.
|
|
8
|
+
*/
|
|
9
|
+
export const filterMenuRecipe = defineSlotRecipe({
|
|
10
|
+
className: 'filterMenu',
|
|
11
|
+
jsx: ['FilterMenu'],
|
|
12
|
+
slots: ['root', 'listbox', 'checkbox', 'before', 'empty', 'footer'],
|
|
13
|
+
base: {
|
|
14
|
+
root: {
|
|
15
|
+
...globalBaseStyles,
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
w: 'xs',
|
|
19
|
+
maxH: 'var(--available-height)',
|
|
20
|
+
bg: 'surface',
|
|
21
|
+
borderRadius: '4',
|
|
22
|
+
boxShadow: 'overlay',
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
outline: 'none',
|
|
25
|
+
},
|
|
26
|
+
listbox: {
|
|
27
|
+
flex: '1',
|
|
28
|
+
minH: '0',
|
|
29
|
+
overflowY: 'auto',
|
|
30
|
+
outline: 'none',
|
|
31
|
+
},
|
|
32
|
+
checkbox: {
|
|
33
|
+
display: 'block',
|
|
34
|
+
w: 'var(--list-item-icon-size)',
|
|
35
|
+
h: 'var(--list-item-icon-size)',
|
|
36
|
+
},
|
|
37
|
+
before: {
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
gap: '6',
|
|
41
|
+
},
|
|
42
|
+
empty: {
|
|
43
|
+
px: '10',
|
|
44
|
+
py: '6',
|
|
45
|
+
color: 'text.subtlest',
|
|
46
|
+
fontFamily: 'sans',
|
|
47
|
+
fontSize: '14',
|
|
48
|
+
},
|
|
49
|
+
footer: {
|
|
50
|
+
px: '10',
|
|
51
|
+
py: '6',
|
|
52
|
+
bg: 'surface.sunken',
|
|
53
|
+
color: 'text.subtlest',
|
|
54
|
+
fontFamily: 'sans',
|
|
55
|
+
fontSize: '12',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
variants: {
|
|
59
|
+
layer: {
|
|
60
|
+
elevated: {
|
|
61
|
+
root: { zIndex: 'elevated' },
|
|
62
|
+
},
|
|
63
|
+
modalFloating: {
|
|
64
|
+
root: { zIndex: 'modalFloating' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
defaultVariants: {
|
|
69
|
+
layer: 'elevated',
|
|
70
|
+
},
|
|
71
|
+
});
|