@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/modal.ts
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
3
5
|
const modalBase = {
|
|
4
6
|
positionWrapper: {
|
|
7
|
+
'--wrapper-p': {
|
|
8
|
+
base: 'token(sizes.0)',
|
|
9
|
+
xs: 'token(sizes.12)',
|
|
10
|
+
sm: 'token(sizes.32)',
|
|
11
|
+
md: 'token(sizes.56)',
|
|
12
|
+
},
|
|
5
13
|
position: 'fixed',
|
|
6
14
|
inset: '0',
|
|
7
|
-
display: '
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
padding: '16',
|
|
13
|
-
zIndex: '1101',
|
|
15
|
+
display: 'grid',
|
|
16
|
+
p: 'var(--wrapper-p)',
|
|
17
|
+
w: '100vw',
|
|
18
|
+
h: '100vh',
|
|
19
|
+
zIndex: 1100,
|
|
14
20
|
},
|
|
15
21
|
overlay: {
|
|
16
22
|
position: 'fixed',
|
|
17
23
|
inset: '0',
|
|
18
24
|
bg: 'blanket',
|
|
19
|
-
zIndex:
|
|
25
|
+
zIndex: 1100,
|
|
20
26
|
// Initial state matches animation start
|
|
21
27
|
opacity: '0',
|
|
22
28
|
// Animation handled via data-state
|
|
@@ -26,24 +32,16 @@ const modalBase = {
|
|
|
26
32
|
},
|
|
27
33
|
},
|
|
28
34
|
container: {
|
|
29
|
-
|
|
35
|
+
...globalBaseStyles,
|
|
30
36
|
display: 'flex',
|
|
31
37
|
flexDirection: 'column',
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
maxW: 'calc(100vw - (2 * var(--wrapper-p)))',
|
|
39
|
+
maxH: 'calc(100vh - (2 * var(--wrapper-p)))',
|
|
34
40
|
bg: 'surface.overlay',
|
|
35
41
|
borderRadius: '12',
|
|
36
42
|
boxShadow: 'overlay',
|
|
37
43
|
outline: 'none',
|
|
38
|
-
|
|
39
|
-
// Initial state matches animation start
|
|
40
|
-
opacity: '0',
|
|
41
|
-
transform: '[scale(0.95) translateY(-10px)]',
|
|
42
|
-
// Animation handled via data-state
|
|
43
|
-
animation: 'modalScaleIn 150ms ease-out forwards',
|
|
44
|
-
'&[data-state="closing"]': {
|
|
45
|
-
animation: 'modalScaleOut 150ms ease-out forwards',
|
|
46
|
-
},
|
|
44
|
+
zIndex: 1101,
|
|
47
45
|
},
|
|
48
46
|
header: {
|
|
49
47
|
display: 'flex',
|
|
@@ -82,80 +80,83 @@ const modalBase = {
|
|
|
82
80
|
},
|
|
83
81
|
};
|
|
84
82
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
top: {
|
|
94
|
-
positionWrapper: {
|
|
95
|
-
alignItems: 'flex-start',
|
|
96
|
-
justifyContent: 'center',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
bottom: {
|
|
100
|
-
positionWrapper: {
|
|
101
|
-
alignItems: 'flex-end',
|
|
102
|
-
justifyContent: 'center',
|
|
103
|
-
},
|
|
104
|
-
},
|
|
83
|
+
const mobile = {
|
|
84
|
+
xsDown: {
|
|
85
|
+
width: '100vw',
|
|
86
|
+
height: '100vh',
|
|
87
|
+
maxWidth: '100vw',
|
|
88
|
+
maxHeight: '100vh',
|
|
89
|
+
borderRadius: '0',
|
|
105
90
|
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const modalVariants = {
|
|
106
94
|
size: {
|
|
107
95
|
sm: {
|
|
108
96
|
container: {
|
|
109
|
-
|
|
97
|
+
w: 'md',
|
|
98
|
+
...mobile,
|
|
110
99
|
},
|
|
111
100
|
},
|
|
112
101
|
md: {
|
|
113
102
|
container: {
|
|
114
|
-
|
|
103
|
+
w: 'xl',
|
|
104
|
+
...mobile,
|
|
115
105
|
},
|
|
116
106
|
},
|
|
117
107
|
lg: {
|
|
118
108
|
container: {
|
|
119
|
-
|
|
109
|
+
w: '3xl',
|
|
110
|
+
...mobile,
|
|
120
111
|
},
|
|
121
112
|
},
|
|
122
113
|
xl: {
|
|
123
114
|
container: {
|
|
124
|
-
|
|
115
|
+
w: '5xl',
|
|
116
|
+
...mobile,
|
|
125
117
|
},
|
|
126
118
|
},
|
|
127
119
|
full: {
|
|
128
120
|
container: {
|
|
129
|
-
|
|
121
|
+
w: '95vw',
|
|
122
|
+
...mobile,
|
|
130
123
|
},
|
|
131
124
|
},
|
|
132
|
-
|
|
125
|
+
fullPage: {
|
|
126
|
+
positionWrapper: {
|
|
127
|
+
'--wrapper-p': 'token(sizes.0)',
|
|
128
|
+
},
|
|
133
129
|
container: {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
w: '100vw',
|
|
131
|
+
h: '100vh',
|
|
132
|
+
maxW: '100vw',
|
|
133
|
+
maxH: '100vh',
|
|
138
134
|
borderRadius: '0',
|
|
135
|
+
...mobile,
|
|
139
136
|
},
|
|
140
137
|
},
|
|
141
138
|
},
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
position: {
|
|
140
|
+
centered: {
|
|
141
|
+
positionWrapper: {
|
|
142
|
+
placeContent: 'center',
|
|
143
|
+
},
|
|
144
144
|
container: {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
maxWidth: '[100vw]',
|
|
149
|
-
maxHeight: '[100vh]',
|
|
150
|
-
borderRadius: '0',
|
|
145
|
+
animation: 'modalScaleIn 150ms ease-out forwards',
|
|
146
|
+
'&[data-state="closing"]': {
|
|
147
|
+
animation: 'modalScaleOut 150ms ease-out forwards',
|
|
151
148
|
},
|
|
152
149
|
},
|
|
153
150
|
},
|
|
154
|
-
|
|
151
|
+
top: {
|
|
152
|
+
positionWrapper: {
|
|
153
|
+
placeContent: 'start center',
|
|
154
|
+
},
|
|
155
155
|
container: {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
animation: 'modalScaleInTop 150ms ease-out forwards',
|
|
157
|
+
'&[data-state="closing"]': {
|
|
158
|
+
animation: 'modalScaleOutTop 150ms ease-out forwards',
|
|
159
|
+
},
|
|
159
160
|
},
|
|
160
161
|
},
|
|
161
162
|
},
|
|
@@ -163,7 +164,7 @@ const modalVariants = {
|
|
|
163
164
|
|
|
164
165
|
export const modalRecipe = defineSlotRecipe({
|
|
165
166
|
className: 'modal',
|
|
166
|
-
jsx: ['
|
|
167
|
+
jsx: ['ModalWrapper', 'ModalHeader', 'ModalBody', 'ModalFooter', 'Modal'],
|
|
167
168
|
slots: [
|
|
168
169
|
'positionWrapper',
|
|
169
170
|
'overlay',
|
|
@@ -177,8 +178,7 @@ export const modalRecipe = defineSlotRecipe({
|
|
|
177
178
|
base: modalBase,
|
|
178
179
|
variants: modalVariants,
|
|
179
180
|
defaultVariants: {
|
|
180
|
-
position: 'centered',
|
|
181
|
-
variant: 'default',
|
|
182
181
|
size: 'md',
|
|
182
|
+
position: 'centered',
|
|
183
183
|
},
|
|
184
184
|
});
|
package/src/recipes/radio.ts
CHANGED
|
@@ -27,13 +27,13 @@ export const radioRecipe = defineSlotRecipe({
|
|
|
27
27
|
cursor: 'inherit',
|
|
28
28
|
"& ~ [name='radio']": {
|
|
29
29
|
display: 'inline-grid',
|
|
30
|
-
zIndex: '
|
|
30
|
+
zIndex: '3',
|
|
31
31
|
},
|
|
32
32
|
_checked: {
|
|
33
33
|
"& ~ [name='radio-checked']": {
|
|
34
34
|
display: 'inline-grid',
|
|
35
35
|
fill: 'icon',
|
|
36
|
-
zIndex: '
|
|
36
|
+
zIndex: '2',
|
|
37
37
|
},
|
|
38
38
|
"& ~ [name='radio']": {
|
|
39
39
|
display: 'none',
|
|
@@ -43,7 +43,7 @@ export const radioRecipe = defineSlotRecipe({
|
|
|
43
43
|
display: 'inline-grid',
|
|
44
44
|
'& ~ svg:not([name="circle"])': {
|
|
45
45
|
fill: 'red.50',
|
|
46
|
-
zIndex: '
|
|
46
|
+
zIndex: '3',
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
_focusVisible: {
|
|
@@ -51,7 +51,7 @@ export const radioRecipe = defineSlotRecipe({
|
|
|
51
51
|
display: 'inline-grid',
|
|
52
52
|
position: 'absolute',
|
|
53
53
|
fill: 'border.focused',
|
|
54
|
-
zIndex: '
|
|
54
|
+
zIndex: '2',
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
},
|
|
@@ -61,10 +61,10 @@ export const radioRecipe = defineSlotRecipe({
|
|
|
61
61
|
inset: '0',
|
|
62
62
|
width: '24',
|
|
63
63
|
height: '24',
|
|
64
|
-
zIndex: '
|
|
64
|
+
zIndex: '3',
|
|
65
65
|
"&:is([name='radio'])": {
|
|
66
66
|
fill: 'icon.subtlest',
|
|
67
|
-
zIndex: '
|
|
67
|
+
zIndex: '3',
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
radioBg: {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
export { autocompleteRecipe } from './autocomplete';
|
|
1
2
|
export { avatarRecipe } from './avatar';
|
|
2
3
|
export { badgeRecipe } from './badge';
|
|
3
4
|
export { breadcrumbsRecipe } from './breadcrumbs';
|
|
4
5
|
export { buttonRecipe, iconButtonRecipe } from './button';
|
|
6
|
+
export { calendarRecipe } from './calendar';
|
|
5
7
|
export { checkboxRecipe } from './checkbox';
|
|
6
8
|
export { chipRecipe } from './chip';
|
|
7
|
-
export {
|
|
9
|
+
export { dateMenusRecipe } from './dateMenus';
|
|
10
|
+
export { dateTimeMenusRecipe } from './dateTimeMenus';
|
|
8
11
|
export { formFieldRecipe } from './formField';
|
|
9
12
|
export { kbdRecipe } from './kbd';
|
|
10
13
|
export { listItemRecipe } from './listItem';
|
|
@@ -12,9 +15,11 @@ export { listItemGroupRecipe } from './listItemGroup';
|
|
|
12
15
|
export { menuRecipe } from './menu';
|
|
13
16
|
export { modalRecipe } from './modal';
|
|
14
17
|
export { radioRecipe } from './radio';
|
|
18
|
+
export { segmentedFieldsRecipe } from './segmentedFields';
|
|
19
|
+
export { segmentedInputsRecipe } from './segmentedInputs';
|
|
15
20
|
export { selectRecipe } from './select';
|
|
16
21
|
export { spinnerRecipe } from './spinner';
|
|
17
22
|
export { textInputRecipe } from './textInput';
|
|
18
|
-
export {
|
|
23
|
+
export { timeMenusRecipe } from './timeMenus';
|
|
19
24
|
export { toggleRecipe } from './toggle';
|
|
20
25
|
export { tooltipRecipe } from './tooltip';
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const segmentedFieldsBase = {
|
|
6
|
+
container: {
|
|
7
|
+
...globalBaseStyles,
|
|
8
|
+
'--input-py': 'token(sizes.3)',
|
|
9
|
+
'--input-px': 'token(sizes.10)',
|
|
10
|
+
'--slot-size': 'token(sizes.20)',
|
|
11
|
+
'--slot-px': 'token(sizes.6)',
|
|
12
|
+
position: 'relative',
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
width: 'full',
|
|
16
|
+
py: 'var(--input-py)',
|
|
17
|
+
px: 'var(--input-px)',
|
|
18
|
+
bg: 'bg.input',
|
|
19
|
+
borderWidth: '1',
|
|
20
|
+
borderStyle: 'solid',
|
|
21
|
+
borderColor: 'border.input',
|
|
22
|
+
borderRadius: '4',
|
|
23
|
+
outlineWidth: '2',
|
|
24
|
+
outlineOffset: '-1',
|
|
25
|
+
outlineStyle: 'solid',
|
|
26
|
+
outlineColor: 'transparent',
|
|
27
|
+
transitionDuration: 'fast',
|
|
28
|
+
transitionProperty: 'background, border-color, outline-color',
|
|
29
|
+
transitionTimingFunction: 'default',
|
|
30
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
31
|
+
bg: 'bg.input.pressed',
|
|
32
|
+
borderColor: 'border.focused',
|
|
33
|
+
outlineColor: 'border.focused',
|
|
34
|
+
},
|
|
35
|
+
_open: {
|
|
36
|
+
bg: 'bg.input.pressed',
|
|
37
|
+
borderColor: 'border.focused',
|
|
38
|
+
outlineColor: 'border.focused',
|
|
39
|
+
},
|
|
40
|
+
_disabled: {
|
|
41
|
+
bg: 'bg.disabled',
|
|
42
|
+
borderColor: 'border.disabled',
|
|
43
|
+
cursor: 'not-allowed',
|
|
44
|
+
pointerEvents: 'none',
|
|
45
|
+
},
|
|
46
|
+
_error: {
|
|
47
|
+
borderColor: 'border.danger',
|
|
48
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
49
|
+
borderColor: 'border.danger',
|
|
50
|
+
outlineColor: 'border.danger',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
_invalid: {
|
|
54
|
+
borderColor: 'border.danger',
|
|
55
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
56
|
+
borderColor: 'border.danger',
|
|
57
|
+
outlineColor: 'border.danger',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
slot: {
|
|
62
|
+
display: 'inline-flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
transitionDuration: 'fast',
|
|
65
|
+
transitionProperty: 'all',
|
|
66
|
+
transitionTimingFunction: 'default',
|
|
67
|
+
flex: '0 0 var(--slot-size)',
|
|
68
|
+
px: 'var(--slot-px)',
|
|
69
|
+
fill: 'icon.decorative',
|
|
70
|
+
pointerEvents: 'none',
|
|
71
|
+
zIndex: 1,
|
|
72
|
+
},
|
|
73
|
+
buttonSlot: {
|
|
74
|
+
display: 'inline-flex',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
flex: '0 0 var(--slot-size)',
|
|
77
|
+
px: '0',
|
|
78
|
+
zIndex: 1,
|
|
79
|
+
m: '-1',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const segmentedFieldsVariants = {
|
|
84
|
+
size: {
|
|
85
|
+
sm: {
|
|
86
|
+
container: {
|
|
87
|
+
'--input-py': 'token(sizes.0)',
|
|
88
|
+
'--input-px': 'token(sizes.8)',
|
|
89
|
+
'--slot-size': 'token(sizes.16)',
|
|
90
|
+
'--slot-px': 'token(sizes.4)',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
md: {
|
|
94
|
+
container: {
|
|
95
|
+
'--input-py': 'token(sizes.3)',
|
|
96
|
+
'--input-px': 'token(sizes.10)',
|
|
97
|
+
'--slot-size': 'token(sizes.20)',
|
|
98
|
+
'--slot-px': 'token(sizes.6)',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
lg: {
|
|
102
|
+
container: {
|
|
103
|
+
'--input-py': 'token(sizes.7)',
|
|
104
|
+
'--input-px': 'token(sizes.12)',
|
|
105
|
+
'--slot-size': 'token(sizes.24)',
|
|
106
|
+
'--slot-px': 'token(sizes.8)',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
xl: {
|
|
110
|
+
container: {
|
|
111
|
+
'--input-py': 'token(sizes.9)',
|
|
112
|
+
'--input-px': 'token(sizes.16)',
|
|
113
|
+
'--slot-size': 'token(sizes.28)',
|
|
114
|
+
'--slot-px': 'token(sizes.10)',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
field: {
|
|
119
|
+
date: {
|
|
120
|
+
container: {
|
|
121
|
+
minW: '128',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
time: {
|
|
125
|
+
container: {
|
|
126
|
+
minW: '104',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
dateTime: {
|
|
130
|
+
container: {
|
|
131
|
+
minW: '216',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
range: {
|
|
136
|
+
date: {
|
|
137
|
+
container: {
|
|
138
|
+
minW: '248',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
time: {
|
|
142
|
+
container: {
|
|
143
|
+
minW: '200',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
before: {
|
|
148
|
+
true: {
|
|
149
|
+
container: {
|
|
150
|
+
ps: '0',
|
|
151
|
+
},
|
|
152
|
+
buttonSlot: {
|
|
153
|
+
'& button': {
|
|
154
|
+
borderTopRightRadius: '0',
|
|
155
|
+
borderBottomRightRadius: '0',
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
after: {
|
|
161
|
+
true: {
|
|
162
|
+
container: {
|
|
163
|
+
pe: '0',
|
|
164
|
+
},
|
|
165
|
+
buttonSlot: {
|
|
166
|
+
'& button': {
|
|
167
|
+
borderTopLeftRadius: '0',
|
|
168
|
+
borderBottomLeftRadius: '0',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// validate-ignore: recipe-jsx-name-matches-component — shared chrome for the segmented date/time field family
|
|
176
|
+
export const segmentedFieldsRecipe = defineSlotRecipe({
|
|
177
|
+
className: 'segmentedFields',
|
|
178
|
+
jsx: [
|
|
179
|
+
'SegmentedFields',
|
|
180
|
+
'DateInput',
|
|
181
|
+
'DateRangeInput',
|
|
182
|
+
'TimeInput',
|
|
183
|
+
'TimeRangeInput',
|
|
184
|
+
'DateTimeInput',
|
|
185
|
+
],
|
|
186
|
+
slots: ['container', 'slot', 'buttonSlot'],
|
|
187
|
+
base: segmentedFieldsBase,
|
|
188
|
+
variants: segmentedFieldsVariants,
|
|
189
|
+
defaultVariants: {
|
|
190
|
+
size: 'md',
|
|
191
|
+
},
|
|
192
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
// Shared low-level styling for segmented input guts (MM/DD/YYYY, HH:MM AM/PM,
|
|
6
|
+
// account-style part numbers, phone-like segments, etc). Higher-level input
|
|
7
|
+
// wrappers own border, background, padding, validation, and open/focus state.
|
|
8
|
+
const segmentedInputsBase = {
|
|
9
|
+
root: {
|
|
10
|
+
...globalBaseStyles,
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
gap: '0',
|
|
14
|
+
width: 'fit',
|
|
15
|
+
color: 'text',
|
|
16
|
+
fontFamily: 'mono',
|
|
17
|
+
lineHeight: 'default',
|
|
18
|
+
cursor: 'text',
|
|
19
|
+
userSelect: 'none',
|
|
20
|
+
flexGrow: '0',
|
|
21
|
+
flexShrink: '0',
|
|
22
|
+
flexBasis: 'fit',
|
|
23
|
+
minW: '0',
|
|
24
|
+
_disabled: {
|
|
25
|
+
color: 'text.disabled',
|
|
26
|
+
cursor: 'not-allowed',
|
|
27
|
+
pointerEvents: 'none',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
// Individual focusable segment span (MM, DD, YYYY, HH, AM/PM, ...)
|
|
32
|
+
segment: {
|
|
33
|
+
display: 'inline-flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
outline: 'none',
|
|
37
|
+
borderRadius: '2',
|
|
38
|
+
cursor: 'default',
|
|
39
|
+
userSelect: 'none',
|
|
40
|
+
fontFamily: 'mono',
|
|
41
|
+
fontVariantNumeric: 'tabular-nums',
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
color: 'text',
|
|
44
|
+
_focus: {
|
|
45
|
+
// Cetec highlights a focused segment with bg.accent.gold.subtlest.
|
|
46
|
+
// okshaun has no gold palette, so that emitted as literal text, the
|
|
47
|
+
// color-mix was invalid and the segment had no focus highlight at all.
|
|
48
|
+
// bg.selected is okshaun's equivalent subtle selection background.
|
|
49
|
+
bg: 'bg.selected',
|
|
50
|
+
},
|
|
51
|
+
_groupDisabled: {
|
|
52
|
+
color: 'text.disabled',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
// The "/" or ":" or " " literal between segments. `minWidth: '0.75em'`
|
|
57
|
+
// is a deliberate floor, not decoration — the " " separators (minute/AM-PM,
|
|
58
|
+
// and the gap between a DateTimeInput's date/time halves) render at 0
|
|
59
|
+
// layout width in the Recursive Variable font at this size/axis regardless
|
|
60
|
+
// of `whiteSpace: 'pre'` (confirmed: real space character, zero measured
|
|
61
|
+
// width) — a font-rendering quirk, not a whitespace-collapsing bug. The
|
|
62
|
+
// floor keeps the visual gap independent of what the glyph itself measures.
|
|
63
|
+
separator: {
|
|
64
|
+
color: 'text.placeholder',
|
|
65
|
+
textAlign: 'center',
|
|
66
|
+
userSelect: 'none',
|
|
67
|
+
whiteSpace: 'pre',
|
|
68
|
+
minWidth: '0.75em',
|
|
69
|
+
display: 'inline-flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
'&[data-gap=none]': {
|
|
73
|
+
minWidth: '0',
|
|
74
|
+
px: '0',
|
|
75
|
+
},
|
|
76
|
+
'&[data-gap=tight]': {
|
|
77
|
+
minWidth: '0.5em',
|
|
78
|
+
px: '1',
|
|
79
|
+
},
|
|
80
|
+
'&[data-gap=normal]': {
|
|
81
|
+
minWidth: '0.75em',
|
|
82
|
+
px: '1',
|
|
83
|
+
},
|
|
84
|
+
'&[data-gap=loose]': {
|
|
85
|
+
minWidth: '1.25em',
|
|
86
|
+
px: '2',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const segmentedInputsVariants = {
|
|
92
|
+
size: {
|
|
93
|
+
sm: { root: { fontSize: '14' } },
|
|
94
|
+
md: { root: { fontSize: '16' } },
|
|
95
|
+
lg: { root: { fontSize: '16' } },
|
|
96
|
+
xl: { root: { fontSize: '20' } },
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const segmentedInputsRecipe = defineSlotRecipe({
|
|
101
|
+
className: 'segmentedInputs',
|
|
102
|
+
jsx: ['SegmentedInputs', 'SegmentedInput', 'SegmentedDate', 'SegmentedTime'],
|
|
103
|
+
slots: ['root', 'segment', 'separator'],
|
|
104
|
+
base: segmentedInputsBase,
|
|
105
|
+
variants: segmentedInputsVariants,
|
|
106
|
+
defaultVariants: {
|
|
107
|
+
size: 'md',
|
|
108
|
+
},
|
|
109
|
+
});
|