@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,189 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const partButtonStyles = {
|
|
6
|
+
appearance: 'none',
|
|
7
|
+
cursor: 'pointer',
|
|
8
|
+
_hover: {
|
|
9
|
+
bg: 'bg.neutral.hovered',
|
|
10
|
+
},
|
|
11
|
+
_active: {
|
|
12
|
+
bg: 'bg.neutral.pressed',
|
|
13
|
+
},
|
|
14
|
+
_focusVisible: {
|
|
15
|
+
outlineColor: 'border.focused',
|
|
16
|
+
},
|
|
17
|
+
_disabled: {
|
|
18
|
+
cursor: 'not-allowed',
|
|
19
|
+
_hover: { bg: 'transparent' },
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* One filter in a filter field: field, operator, value, then remove.
|
|
25
|
+
* States are data attributes on the root, so a state picked at runtime
|
|
26
|
+
* never depends on generated variant classes.
|
|
27
|
+
*/
|
|
28
|
+
export const filterTokenRecipe = defineSlotRecipe({
|
|
29
|
+
className: 'filterToken',
|
|
30
|
+
jsx: ['FilterToken'],
|
|
31
|
+
slots: [
|
|
32
|
+
'root',
|
|
33
|
+
'part',
|
|
34
|
+
'field',
|
|
35
|
+
'operator',
|
|
36
|
+
'value',
|
|
37
|
+
'valueText',
|
|
38
|
+
'count',
|
|
39
|
+
'editor',
|
|
40
|
+
'remove',
|
|
41
|
+
],
|
|
42
|
+
base: {
|
|
43
|
+
root: {
|
|
44
|
+
...globalBaseStyles,
|
|
45
|
+
display: 'inline-flex',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
flexShrink: '0',
|
|
48
|
+
maxW: 'full',
|
|
49
|
+
h: '28',
|
|
50
|
+
ps: '2',
|
|
51
|
+
pe: '2',
|
|
52
|
+
borderWidth: '1',
|
|
53
|
+
borderStyle: 'solid',
|
|
54
|
+
borderColor: 'border',
|
|
55
|
+
borderRadius: '4',
|
|
56
|
+
bg: 'bg.neutral',
|
|
57
|
+
color: 'text',
|
|
58
|
+
fontFamily: 'sans',
|
|
59
|
+
fontSize: '14',
|
|
60
|
+
whiteSpace: 'nowrap',
|
|
61
|
+
transitionDuration: 'fast',
|
|
62
|
+
transitionProperty: 'background, border-color, opacity',
|
|
63
|
+
transitionTimingFunction: 'default',
|
|
64
|
+
// Lets every part shrink, the tooltip wrapper around the value included.
|
|
65
|
+
'& > *': {
|
|
66
|
+
minW: '0',
|
|
67
|
+
},
|
|
68
|
+
'&[data-state=editing]': {
|
|
69
|
+
bg: 'surface',
|
|
70
|
+
borderColor: 'border.focused',
|
|
71
|
+
},
|
|
72
|
+
'&[data-state=pending]': {
|
|
73
|
+
bg: 'surface',
|
|
74
|
+
borderColor: 'border.bold',
|
|
75
|
+
borderStyle: 'dashed',
|
|
76
|
+
},
|
|
77
|
+
'&[data-state=removing]': {
|
|
78
|
+
bg: 'surface',
|
|
79
|
+
borderColor: 'border.bold',
|
|
80
|
+
borderStyle: 'dashed',
|
|
81
|
+
opacity: '[0.6]',
|
|
82
|
+
},
|
|
83
|
+
'&[data-state=armed]': {
|
|
84
|
+
bg: 'bg.neutral.hovered',
|
|
85
|
+
borderColor: 'border.focused',
|
|
86
|
+
},
|
|
87
|
+
'&[data-disabled]': {
|
|
88
|
+
opacity: '[0.6]',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
part: {
|
|
92
|
+
...globalBaseStyles,
|
|
93
|
+
display: 'inline-flex',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
minW: '0',
|
|
96
|
+
h: '22',
|
|
97
|
+
px: '4',
|
|
98
|
+
bg: 'transparent',
|
|
99
|
+
borderWidth: '0',
|
|
100
|
+
borderRadius: '2',
|
|
101
|
+
outlineWidth: '2',
|
|
102
|
+
outlineStyle: 'solid',
|
|
103
|
+
outlineColor: 'transparent',
|
|
104
|
+
outlineOffset: '-2',
|
|
105
|
+
fontFamily: 'sans',
|
|
106
|
+
fontSize: '14',
|
|
107
|
+
lineHeight: 'tight',
|
|
108
|
+
textAlign: 'start',
|
|
109
|
+
'button&': partButtonStyles,
|
|
110
|
+
'[data-state=removing] &': {
|
|
111
|
+
textDecoration: 'line-through',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
field: {
|
|
115
|
+
color: 'text',
|
|
116
|
+
},
|
|
117
|
+
operator: {
|
|
118
|
+
color: 'text.subtlest',
|
|
119
|
+
// A locked operator reads as part of the sentence, not as a control.
|
|
120
|
+
'&[data-locked]': {
|
|
121
|
+
cursor: 'default',
|
|
122
|
+
},
|
|
123
|
+
'[data-tone=exclude] > &': {
|
|
124
|
+
color: 'text.danger',
|
|
125
|
+
bg: 'bg.danger',
|
|
126
|
+
_hover: { bg: 'bg.danger.hovered' },
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
value: {
|
|
130
|
+
display: 'inline-flex',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
gap: '4',
|
|
133
|
+
color: 'text',
|
|
134
|
+
fontWeight: 'medium',
|
|
135
|
+
},
|
|
136
|
+
// A long single value truncates. The +N count after it always stays visible.
|
|
137
|
+
valueText: {
|
|
138
|
+
minW: '0',
|
|
139
|
+
color: 'text',
|
|
140
|
+
maxW: '240',
|
|
141
|
+
overflow: 'hidden',
|
|
142
|
+
textOverflow: 'ellipsis',
|
|
143
|
+
},
|
|
144
|
+
count: {
|
|
145
|
+
flexShrink: '0',
|
|
146
|
+
color: 'text.subtle',
|
|
147
|
+
},
|
|
148
|
+
editor: {
|
|
149
|
+
display: 'inline-flex',
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
gap: '4',
|
|
152
|
+
ps: '4',
|
|
153
|
+
cursor: 'text',
|
|
154
|
+
},
|
|
155
|
+
remove: {
|
|
156
|
+
...globalBaseStyles,
|
|
157
|
+
appearance: 'none',
|
|
158
|
+
display: 'inline-flex',
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
justifyContent: 'center',
|
|
161
|
+
flexShrink: '0',
|
|
162
|
+
w: '20',
|
|
163
|
+
h: '20',
|
|
164
|
+
ms: '2',
|
|
165
|
+
p: '0',
|
|
166
|
+
bg: 'transparent',
|
|
167
|
+
borderWidth: '0',
|
|
168
|
+
borderRadius: '2',
|
|
169
|
+
outlineWidth: '2',
|
|
170
|
+
outlineStyle: 'solid',
|
|
171
|
+
outlineColor: 'transparent',
|
|
172
|
+
outlineOffset: '-2',
|
|
173
|
+
cursor: 'pointer',
|
|
174
|
+
_icon: {
|
|
175
|
+
fill: 'icon.subtle',
|
|
176
|
+
},
|
|
177
|
+
_hover: {
|
|
178
|
+
bg: 'bg.neutral.hovered',
|
|
179
|
+
_icon: { fill: 'icon' },
|
|
180
|
+
},
|
|
181
|
+
_focusVisible: {
|
|
182
|
+
outlineColor: 'border.focused',
|
|
183
|
+
},
|
|
184
|
+
_disabled: {
|
|
185
|
+
cursor: 'not-allowed',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const inlineNoteBase = {
|
|
6
|
+
root: {
|
|
7
|
+
...globalBaseStyles,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'flex-start',
|
|
10
|
+
gap: '4',
|
|
11
|
+
w: 'full',
|
|
12
|
+
},
|
|
13
|
+
icon: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
flex: 'none',
|
|
17
|
+
minH: '16',
|
|
18
|
+
},
|
|
19
|
+
message: {
|
|
20
|
+
flex: '1',
|
|
21
|
+
minW: '0',
|
|
22
|
+
maxW: 'full',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const inlineNoteVariants = {
|
|
27
|
+
/**
|
|
28
|
+
* Semantic tone. An inline note carries no surface of its own, so tone is
|
|
29
|
+
* expressed through the text and icon color tokens the component applies.
|
|
30
|
+
*/
|
|
31
|
+
tone: {
|
|
32
|
+
info: {},
|
|
33
|
+
success: {},
|
|
34
|
+
warning: {},
|
|
35
|
+
danger: {},
|
|
36
|
+
neutral: {},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const inlineNoteRecipe = defineSlotRecipe({
|
|
41
|
+
className: 'inlineNote',
|
|
42
|
+
jsx: ['InlineNote'],
|
|
43
|
+
slots: ['root', 'icon', 'message'],
|
|
44
|
+
base: inlineNoteBase,
|
|
45
|
+
variants: inlineNoteVariants,
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
tone: 'info',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const keyFactBase = {
|
|
6
|
+
root: {
|
|
7
|
+
...globalBaseStyles,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
minW: '0',
|
|
10
|
+
maxW: 'full',
|
|
11
|
+
},
|
|
12
|
+
label: {
|
|
13
|
+
flex: 'none',
|
|
14
|
+
whiteSpace: 'nowrap',
|
|
15
|
+
},
|
|
16
|
+
// The label's text renders in these, through Box. Box resets font and color,
|
|
17
|
+
// so they take both from the label.
|
|
18
|
+
labelWithColon: {
|
|
19
|
+
color: 'inherit',
|
|
20
|
+
fontFamily: 'inherit',
|
|
21
|
+
fontVariationSettings: 'inherit',
|
|
22
|
+
fontWeight: 'inherit',
|
|
23
|
+
lineHeight: 'inherit',
|
|
24
|
+
},
|
|
25
|
+
labelPlain: {
|
|
26
|
+
color: 'inherit',
|
|
27
|
+
fontFamily: 'inherit',
|
|
28
|
+
fontVariationSettings: 'inherit',
|
|
29
|
+
fontWeight: 'inherit',
|
|
30
|
+
lineHeight: 'inherit',
|
|
31
|
+
},
|
|
32
|
+
value: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
minW: '0',
|
|
35
|
+
// The truncation tooltip wraps the value in a span. Let it shrink so the
|
|
36
|
+
// value can truncate.
|
|
37
|
+
'& > span': {
|
|
38
|
+
w: 'full',
|
|
39
|
+
minW: '0',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
actions: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
flex: 'none',
|
|
46
|
+
gap: '2',
|
|
47
|
+
ms: '4',
|
|
48
|
+
},
|
|
49
|
+
text: {
|
|
50
|
+
display: 'block',
|
|
51
|
+
minW: '0',
|
|
52
|
+
overflow: 'hidden',
|
|
53
|
+
textOverflow: 'ellipsis',
|
|
54
|
+
whiteSpace: 'nowrap',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const keyFactVariants = {
|
|
59
|
+
/**
|
|
60
|
+
* `horizontal` reads "Label: Value" on one line, for a page header `aside`.
|
|
61
|
+
* `vertical` stacks the label over a larger value, for a facts strip.
|
|
62
|
+
*/
|
|
63
|
+
// Each layout sets every property the other one sets, so a conditional
|
|
64
|
+
// layout switches cleanly at a breakpoint. The label renders in both forms,
|
|
65
|
+
// and the layout shows one.
|
|
66
|
+
layout: {
|
|
67
|
+
horizontal: {
|
|
68
|
+
root: { flexDirection: 'row', alignItems: 'center', gap: '4' },
|
|
69
|
+
// A text style sets its own color, so set the label color after it.
|
|
70
|
+
label: { textStyle: 'sans.sm', color: 'text.subtle' },
|
|
71
|
+
labelWithColon: { display: 'inline' },
|
|
72
|
+
labelPlain: { display: 'none' },
|
|
73
|
+
value: { textStyle: 'sans.sm' },
|
|
74
|
+
},
|
|
75
|
+
vertical: {
|
|
76
|
+
root: { flexDirection: 'column', alignItems: 'stretch', gap: '2' },
|
|
77
|
+
label: { textStyle: 'sans.sm', color: 'text.subtle' },
|
|
78
|
+
labelWithColon: { display: 'none' },
|
|
79
|
+
labelPlain: { display: 'inline' },
|
|
80
|
+
value: { textStyle: 'sans.lg' },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
/** Replaces the value with a text input. */
|
|
84
|
+
editing: {
|
|
85
|
+
true: {
|
|
86
|
+
root: { w: '280' },
|
|
87
|
+
value: { flex: '1' },
|
|
88
|
+
},
|
|
89
|
+
false: {},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const keyFactRecipe = defineSlotRecipe({
|
|
94
|
+
className: 'keyFact',
|
|
95
|
+
jsx: ['KeyFact'],
|
|
96
|
+
slots: [
|
|
97
|
+
'root',
|
|
98
|
+
'label',
|
|
99
|
+
'labelWithColon',
|
|
100
|
+
'labelPlain',
|
|
101
|
+
'value',
|
|
102
|
+
'text',
|
|
103
|
+
'actions',
|
|
104
|
+
],
|
|
105
|
+
base: keyFactBase,
|
|
106
|
+
variants: keyFactVariants,
|
|
107
|
+
defaultVariants: {
|
|
108
|
+
layout: 'horizontal',
|
|
109
|
+
editing: false,
|
|
110
|
+
},
|
|
111
|
+
});
|
package/src/recipes/listItem.ts
CHANGED
|
@@ -15,7 +15,9 @@ export const listItemRecipe = defineSlotRecipe({
|
|
|
15
15
|
'wrapper',
|
|
16
16
|
'icon',
|
|
17
17
|
'beforeSlot',
|
|
18
|
+
'beforeContent',
|
|
18
19
|
'afterSlot',
|
|
20
|
+
'afterContent',
|
|
19
21
|
'itemMain',
|
|
20
22
|
'itemLabel',
|
|
21
23
|
'itemDescription',
|
|
@@ -86,9 +88,32 @@ export const listItemRecipe = defineSlotRecipe({
|
|
|
86
88
|
beforeSlot: {
|
|
87
89
|
ms: 'calc(var(--list-item-slot-margin) * -1)',
|
|
88
90
|
},
|
|
91
|
+
// Centers custom `before` content, such as a 20px icon or an avatar,
|
|
92
|
+
// on the first line of the label, the same way a built-in icon sits.
|
|
93
|
+
beforeContent: {
|
|
94
|
+
display: 'flex',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
flexShrink: '0',
|
|
98
|
+
minW: 'var(--list-item-icon-size)',
|
|
99
|
+
minH: 'var(--list-item-icon-size)',
|
|
100
|
+
},
|
|
89
101
|
afterSlot: {
|
|
90
102
|
me: 'calc(var(--list-item-slot-margin) * -1)',
|
|
91
103
|
},
|
|
104
|
+
// Short trailing text, such as a date range or a count. It stays on the
|
|
105
|
+
// first line of the label and never wraps.
|
|
106
|
+
afterContent: {
|
|
107
|
+
display: 'flex',
|
|
108
|
+
alignItems: 'center',
|
|
109
|
+
flexShrink: '0',
|
|
110
|
+
minH: 'var(--list-item-icon-size)',
|
|
111
|
+
ms: 'auto',
|
|
112
|
+
ps: '8',
|
|
113
|
+
color: 'text.subtlest',
|
|
114
|
+
fontSize: 'var(--list-item-description-size)',
|
|
115
|
+
whiteSpace: 'nowrap',
|
|
116
|
+
},
|
|
92
117
|
divider: {
|
|
93
118
|
width: 'full',
|
|
94
119
|
py: 'var(--list-item-padding-y)',
|
package/src/recipes/menu.ts
CHANGED
|
@@ -33,8 +33,10 @@ const menuBase = {
|
|
|
33
33
|
bg: { base: 'tan.20', _dark: 'tan.70' },
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
|
+
// `clip` (not `hidden`) so the oversized size probe inside can't make this a
|
|
37
|
+
// programmatically scrollable ancestor that `scrollIntoView()` would move.
|
|
36
38
|
levelsViewport: {
|
|
37
|
-
overflow: '
|
|
39
|
+
overflow: 'clip',
|
|
38
40
|
width: 'full',
|
|
39
41
|
position: 'relative',
|
|
40
42
|
},
|
|
@@ -56,7 +58,12 @@ const menuBase = {
|
|
|
56
58
|
visibility: 'hidden',
|
|
57
59
|
top: '0',
|
|
58
60
|
left: '0',
|
|
59
|
-
|
|
61
|
+
// `max-content`, not `fit-content`: the probe sits inside the wrapper, so
|
|
62
|
+
// `fit-content` capped it at the wrapper's current width. Going back from
|
|
63
|
+
// a narrow level then measured the wider level at the narrow width, and
|
|
64
|
+
// its labels wrapped. `100vw` keeps very long labels on screen.
|
|
65
|
+
width: 'max-content',
|
|
66
|
+
maxWidth: '100vw',
|
|
60
67
|
height: 'fit-content',
|
|
61
68
|
overflow: 'visible',
|
|
62
69
|
},
|
|
@@ -123,6 +130,38 @@ const menuVariants = {
|
|
|
123
130
|
},
|
|
124
131
|
},
|
|
125
132
|
},
|
|
133
|
+
// Caps the wrapper to `--available-height`, which Floating UI's `size()`
|
|
134
|
+
// middleware writes at runtime, and scrolls the overflow. The floor keeps a
|
|
135
|
+
// few rows visible when the trigger sits at the viewport edge.
|
|
136
|
+
scrollable: {
|
|
137
|
+
true: {
|
|
138
|
+
wrapper: {
|
|
139
|
+
maxHeight: 'max(var(--available-height), token(sizes.120))',
|
|
140
|
+
overflowY: 'auto',
|
|
141
|
+
},
|
|
142
|
+
// Drill-in sets an explicit wrapper height, so each level can fill it
|
|
143
|
+
// and scroll on its own. Otherwise every level stretches to the tallest
|
|
144
|
+
// one and a short level scrolls into blank space. Single-level menus
|
|
145
|
+
// have no explicit height, so the wrapper still does the scrolling.
|
|
146
|
+
levelsViewport: {
|
|
147
|
+
height: 'full',
|
|
148
|
+
},
|
|
149
|
+
levelsTrack: {
|
|
150
|
+
height: 'full',
|
|
151
|
+
},
|
|
152
|
+
// Keeps keyboard focus scrolling from landing under the sticky header;
|
|
153
|
+
// Menu measures the header into `--menu-back-header-height`.
|
|
154
|
+
level: {
|
|
155
|
+
overflowY: 'auto',
|
|
156
|
+
scrollPaddingTop: 'var(--menu-back-header-height, 0px)',
|
|
157
|
+
},
|
|
158
|
+
backHeader: {
|
|
159
|
+
position: 'sticky',
|
|
160
|
+
top: '0',
|
|
161
|
+
zIndex: '1',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
126
165
|
};
|
|
127
166
|
|
|
128
167
|
export const menuRecipe = defineSlotRecipe({
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const pageBannerBase = {
|
|
6
|
+
root: {
|
|
7
|
+
...globalBaseStyles,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
gap: '8',
|
|
11
|
+
w: 'full',
|
|
12
|
+
px: '24',
|
|
13
|
+
py: '12',
|
|
14
|
+
borderRadius: '0',
|
|
15
|
+
borderBottom: 'default',
|
|
16
|
+
},
|
|
17
|
+
icon: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
flex: 'none',
|
|
21
|
+
minH: '20',
|
|
22
|
+
},
|
|
23
|
+
content: {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flex: '1',
|
|
26
|
+
minW: '0',
|
|
27
|
+
},
|
|
28
|
+
message: {
|
|
29
|
+
maxW: 'full',
|
|
30
|
+
},
|
|
31
|
+
actions: {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
flexWrap: 'wrap',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
gap: '8',
|
|
36
|
+
flex: 'none',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Emphasis is applied through `data-emphasis` inside each tone rather than as a
|
|
42
|
+
* second recipe variant. Pairing two variants would need `compoundVariants`,
|
|
43
|
+
* which `standards/recipes/conditional-variants.md` disallows.
|
|
44
|
+
*/
|
|
45
|
+
const pageBannerVariants = {
|
|
46
|
+
/** Semantic tone. `data-emphasis="bold"` switches to the filled treatment. */
|
|
47
|
+
tone: {
|
|
48
|
+
info: {
|
|
49
|
+
root: {
|
|
50
|
+
bg: 'bg.info',
|
|
51
|
+
borderBottom: 'info',
|
|
52
|
+
'&[data-emphasis="bold"]': {
|
|
53
|
+
bg: 'bg.info.bold',
|
|
54
|
+
borderBottomColor: 'bg.info.bold',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
success: {
|
|
59
|
+
root: {
|
|
60
|
+
bg: 'bg.success',
|
|
61
|
+
borderBottom: 'success',
|
|
62
|
+
'&[data-emphasis="bold"]': {
|
|
63
|
+
bg: 'bg.success.bold',
|
|
64
|
+
borderBottomColor: 'bg.success.bold',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
warning: {
|
|
69
|
+
root: {
|
|
70
|
+
bg: 'bg.warning',
|
|
71
|
+
borderBottom: 'warning',
|
|
72
|
+
'&[data-emphasis="bold"]': {
|
|
73
|
+
bg: 'bg.warning.bold',
|
|
74
|
+
borderBottomColor: 'bg.warning.bold',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
danger: {
|
|
79
|
+
root: {
|
|
80
|
+
bg: 'bg.danger',
|
|
81
|
+
borderBottom: 'danger',
|
|
82
|
+
'&[data-emphasis="bold"]': {
|
|
83
|
+
bg: 'bg.danger.bold',
|
|
84
|
+
borderBottomColor: 'bg.danger.bold',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
neutral: {
|
|
89
|
+
root: {
|
|
90
|
+
bg: 'bg.neutral',
|
|
91
|
+
borderBottom: 'default',
|
|
92
|
+
'&[data-emphasis="bold"]': {
|
|
93
|
+
bg: 'bg.neutral.bold',
|
|
94
|
+
borderBottomColor: 'bg.neutral.bold',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const pageBannerRecipe = defineSlotRecipe({
|
|
102
|
+
className: 'pageBanner',
|
|
103
|
+
jsx: ['PageBanner'],
|
|
104
|
+
slots: ['root', 'icon', 'content', 'message', 'actions'],
|
|
105
|
+
base: pageBannerBase,
|
|
106
|
+
variants: pageBannerVariants,
|
|
107
|
+
defaultVariants: {
|
|
108
|
+
tone: 'info',
|
|
109
|
+
},
|
|
110
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const peekBarBase = {
|
|
6
|
+
root: {
|
|
7
|
+
...globalBaseStyles,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
justifyContent: 'space-between',
|
|
11
|
+
gap: '8',
|
|
12
|
+
px: '16',
|
|
13
|
+
py: '8',
|
|
14
|
+
borderBottomWidth: '1',
|
|
15
|
+
borderBottomStyle: 'solid',
|
|
16
|
+
borderColor: 'border',
|
|
17
|
+
},
|
|
18
|
+
position: {
|
|
19
|
+
textStyle: 'sans.md',
|
|
20
|
+
color: 'text',
|
|
21
|
+
whiteSpace: 'nowrap',
|
|
22
|
+
},
|
|
23
|
+
controls: {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
gap: '4',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const peekBarRecipe = defineSlotRecipe({
|
|
31
|
+
className: 'peekBar',
|
|
32
|
+
jsx: ['PeekBar'],
|
|
33
|
+
slots: ['root', 'position', 'controls'],
|
|
34
|
+
base: peekBarBase,
|
|
35
|
+
});
|