@cdx-ui/components 0.0.1-alpha.33 → 0.0.1-alpha.35
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/lib/commonjs/components/Button/index.js +4 -11
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +148 -112
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Heading/styles.js +6 -7
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +2 -7
- package/lib/commonjs/components/IconButton/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/styles.js +15 -62
- package/lib/commonjs/components/IconButton/styles.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +10 -9
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/styles.js +5 -7
- package/lib/commonjs/components/Link/styles.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +45 -0
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/styles.js +10 -0
- package/lib/commonjs/components/ProgressBar/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/styles.js +5 -5
- package/lib/commonjs/components/ProgressSegmented/styles.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +6 -7
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/components/index.js +12 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/Button/index.js +4 -11
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +149 -112
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Heading/styles.js +6 -7
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/IconButton/index.js +2 -7
- package/lib/module/components/IconButton/index.js.map +1 -1
- package/lib/module/components/IconButton/styles.js +16 -63
- package/lib/module/components/IconButton/styles.js.map +1 -1
- package/lib/module/components/Input/styles.js +11 -10
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/styles.js +6 -7
- package/lib/module/components/Link/styles.js.map +1 -1
- package/lib/module/components/ProgressBar/index.js +41 -0
- package/lib/module/components/ProgressBar/index.js.map +1 -0
- package/lib/module/components/ProgressBar/styles.js +6 -0
- package/lib/module/components/ProgressBar/styles.js.map +1 -0
- package/lib/module/components/ProgressSegmented/styles.js +5 -5
- package/lib/module/components/ProgressSegmented/styles.js.map +1 -1
- package/lib/module/components/Text/styles.js +6 -7
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +3 -6
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/styles.d.ts +1 -6
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/styles.d.ts +2 -0
- package/lib/typescript/components/Link/styles.d.ts.map +1 -1
- package/lib/typescript/components/ProgressBar/index.d.ts +17 -0
- package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/components/ProgressBar/styles.d.ts +5 -0
- package/lib/typescript/components/ProgressBar/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/styles.d.ts.map +1 -1
- package/lib/typescript/components/Text/styles.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/Button/index.tsx +6 -10
- package/src/components/Button/styles.ts +127 -138
- package/src/components/Heading/styles.tsx +6 -7
- package/src/components/IconButton/index.tsx +2 -3
- package/src/components/IconButton/styles.ts +18 -90
- package/src/components/Input/styles.ts +26 -35
- package/src/components/Link/styles.ts +12 -11
- package/src/components/ProgressBar/index.tsx +53 -0
- package/src/components/ProgressBar/styles.ts +9 -0
- package/src/components/ProgressSegmented/styles.ts +6 -5
- package/src/components/Text/styles.tsx +6 -7
- package/src/components/index.ts +1 -0
- package/lib/commonjs/components/Button/buttonSharedVariants.js +0 -200
- package/lib/commonjs/components/Button/buttonSharedVariants.js.map +0 -1
- package/lib/module/components/Button/buttonSharedVariants.js +0 -195
- package/lib/module/components/Button/buttonSharedVariants.js.map +0 -1
- package/lib/typescript/components/Button/buttonSharedVariants.d.ts +0 -29
- package/lib/typescript/components/Button/buttonSharedVariants.d.ts.map +0 -1
- package/src/components/Button/buttonSharedVariants.ts +0 -281
|
@@ -2,34 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
-
import {
|
|
6
|
-
import { sharedFilledForegroundTextCompounds, sharedFilledSurfaceCompounds, sharedGhostSurfaceCompounds, sharedOutlineGhostForegroundTextCompounds } from './buttonSharedVariants';
|
|
7
|
-
const buttonStrongSurfaceCompounds = sharedFilledSurfaceCompounds.map(c => ({
|
|
8
|
-
variant: 'strong',
|
|
9
|
-
...c
|
|
10
|
-
}));
|
|
11
|
-
const buttonGhostSurfaceCompounds = sharedGhostSurfaceCompounds.map(c => ({
|
|
12
|
-
variant: 'ghost',
|
|
13
|
-
...c
|
|
14
|
-
}));
|
|
15
|
-
const buttonStrongForegroundTextCompounds = sharedFilledForegroundTextCompounds.map(c => ({
|
|
16
|
-
variant: 'strong',
|
|
17
|
-
...c
|
|
18
|
-
}));
|
|
19
|
-
const buttonOutlineGhostForegroundTextCompounds = sharedOutlineGhostForegroundTextCompounds.map(c => ({
|
|
20
|
-
variant: ['outline', 'ghost'],
|
|
21
|
-
...c
|
|
22
|
-
}));
|
|
5
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
23
6
|
|
|
24
|
-
// TODO:
|
|
25
|
-
// TODO: Create cva wrapper
|
|
7
|
+
// TODO: Validate that `dark:` syntax works with Uniwind `ScopedTheme`
|
|
26
8
|
|
|
27
|
-
export const buttonRootVariants = cva(['flex-row items-center justify-center',
|
|
9
|
+
export const buttonRootVariants = cva(['flex-row items-center justify-center', 'rounded-[var(--border-radius-button)]', 'web:outline-none web:focus:outline-none web:focus-visible:outline-none', TRANSITION_COLORS, 'data-[disabled=true]:opacity-[--opacity-disabled]', DISABLED_CURSOR, 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[--color-stroke-focus] web:data-[focus-visible=true]:ring-offset-2'], {
|
|
28
10
|
variants: {
|
|
29
11
|
variant: {
|
|
30
|
-
strong: [],
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
strong: ['border-b-1 border-black/75'],
|
|
13
|
+
// TODO: Replace with token
|
|
14
|
+
outline: ['bg-transparent', 'border border-stroke-primary'],
|
|
15
|
+
ghost: ['bg-transparent']
|
|
33
16
|
},
|
|
34
17
|
color: {
|
|
35
18
|
action: [],
|
|
@@ -42,102 +25,127 @@ export const buttonRootVariants = cva(['flex-row items-center justify-center', R
|
|
|
42
25
|
default: 'h-10 px-4 gap-2',
|
|
43
26
|
small: 'h-8 px-3 gap-1.5'
|
|
44
27
|
},
|
|
45
|
-
mode: {
|
|
46
|
-
light: [],
|
|
47
|
-
dark: []
|
|
48
|
-
},
|
|
49
28
|
fullWidth: {
|
|
50
29
|
true: 'w-full',
|
|
51
30
|
false: ''
|
|
52
31
|
}
|
|
53
32
|
},
|
|
54
|
-
compoundVariants: [
|
|
55
|
-
//
|
|
33
|
+
compoundVariants: [
|
|
34
|
+
// ── strong × color (filled surface) ──────────────────────────────
|
|
56
35
|
{
|
|
57
|
-
variant: '
|
|
36
|
+
variant: 'strong',
|
|
58
37
|
color: 'action',
|
|
59
|
-
className: ['
|
|
60
|
-
default: 'data-[active=true]:
|
|
61
|
-
web: 'data-[hover=true]:
|
|
38
|
+
className: ['bg-surface-action-strong', Platform.select({
|
|
39
|
+
default: 'data-[active=true]:bg-surface-action-strong-active',
|
|
40
|
+
web: 'data-[hover=true]:bg-surface-action-strong-hover data-[active=true]:data-[hover=true]:bg-surface-action-strong-active'
|
|
62
41
|
})]
|
|
63
42
|
}, {
|
|
64
|
-
variant: '
|
|
43
|
+
variant: 'strong',
|
|
65
44
|
color: 'danger',
|
|
66
|
-
className: ['
|
|
67
|
-
default: 'data-[active=true]:
|
|
68
|
-
web: 'data-[hover=true]:
|
|
45
|
+
className: ['bg-surface-danger-strong', Platform.select({
|
|
46
|
+
default: 'data-[active=true]:bg-surface-danger-strong-active',
|
|
47
|
+
web: 'data-[hover=true]:bg-surface-danger-strong-hover data-[active=true]:data-[hover=true]:bg-surface-danger-strong-active'
|
|
69
48
|
})]
|
|
70
49
|
}, {
|
|
71
|
-
variant: '
|
|
50
|
+
variant: 'strong',
|
|
72
51
|
color: 'warning',
|
|
73
|
-
className: ['
|
|
74
|
-
default: 'data-[active=true]:
|
|
75
|
-
web: 'data-[hover=true]:
|
|
52
|
+
className: ['bg-surface-warning-strong', Platform.select({
|
|
53
|
+
default: 'data-[active=true]:bg-amber-600',
|
|
54
|
+
web: 'data-[hover=true]:bg-amber-500 data-[active=true]:data-[hover=true]:bg-amber-600'
|
|
76
55
|
})]
|
|
77
56
|
}, {
|
|
78
|
-
variant: '
|
|
57
|
+
variant: 'strong',
|
|
79
58
|
color: 'success',
|
|
80
|
-
className: ['
|
|
81
|
-
default: 'data-[active=true]:
|
|
82
|
-
web: 'data-[hover=true]:
|
|
59
|
+
className: ['bg-surface-success-strong', Platform.select({
|
|
60
|
+
default: 'data-[active=true]:bg-green-800',
|
|
61
|
+
web: 'data-[hover=true]:bg-green-700 data-[active=true]:data-[hover=true]:bg-green-800'
|
|
83
62
|
})]
|
|
84
63
|
}, {
|
|
85
|
-
variant: '
|
|
64
|
+
variant: 'strong',
|
|
86
65
|
color: 'info',
|
|
87
|
-
className: ['
|
|
88
|
-
default: 'data-[active=true]:
|
|
89
|
-
web: 'data-[hover=true]:
|
|
66
|
+
className: ['bg-surface-info-strong', Platform.select({
|
|
67
|
+
default: 'data-[active=true]:bg-sky-700',
|
|
68
|
+
web: 'data-[hover=true]:bg-sky-600 data-[active=true]:data-[hover=true]:bg-sky-700'
|
|
90
69
|
})]
|
|
91
70
|
},
|
|
92
|
-
//
|
|
71
|
+
// ── outline × color (border + hover/active surface) ─────────────
|
|
93
72
|
{
|
|
94
73
|
variant: 'outline',
|
|
95
74
|
color: 'action',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700'
|
|
75
|
+
className: ['border-stroke-action', Platform.select({
|
|
76
|
+
default: 'data-[active=true]:bg-surface-action-subtle-active',
|
|
77
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-subtle-active'
|
|
100
78
|
})]
|
|
101
|
-
},
|
|
102
|
-
// --- outline × semantic colors × mode: dark ---
|
|
103
|
-
{
|
|
79
|
+
}, {
|
|
104
80
|
variant: 'outline',
|
|
105
81
|
color: 'danger',
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
web: 'data-[hover=true]:bg-red-950/50 data-[active=true]:data-[hover=true]:bg-red-950'
|
|
82
|
+
className: ['border-stroke-danger', Platform.select({
|
|
83
|
+
default: 'data-[active=true]:bg-surface-danger-subtle-active',
|
|
84
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-subtle-active'
|
|
110
85
|
})]
|
|
111
86
|
}, {
|
|
112
87
|
variant: 'outline',
|
|
113
88
|
color: 'warning',
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
web: 'data-[hover=true]:bg-amber-950/50 data-[active=true]:data-[hover=true]:bg-amber-950'
|
|
89
|
+
className: ['border-stroke-warning', Platform.select({
|
|
90
|
+
default: 'data-[active=true]:bg-surface-warning-subtle',
|
|
91
|
+
web: 'data-[hover=true]:bg-surface-warning-tint data-[active=true]:data-[hover=true]:bg-surface-warning-subtle'
|
|
118
92
|
})]
|
|
119
93
|
}, {
|
|
120
94
|
variant: 'outline',
|
|
121
95
|
color: 'success',
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
web: 'data-[hover=true]:bg-green-950/50 data-[active=true]:data-[hover=true]:bg-green-950'
|
|
96
|
+
className: ['border-stroke-success', Platform.select({
|
|
97
|
+
default: 'data-[active=true]:bg-surface-success-subtle',
|
|
98
|
+
web: 'data-[hover=true]:bg-surface-success-tint data-[active=true]:data-[hover=true]:bg-surface-success-subtle'
|
|
126
99
|
})]
|
|
127
100
|
}, {
|
|
128
101
|
variant: 'outline',
|
|
129
102
|
color: 'info',
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
web: 'data-[hover=true]:bg-sky-950/50 data-[active=true]:data-[hover=true]:bg-sky-950'
|
|
103
|
+
className: ['border-stroke-info', Platform.select({
|
|
104
|
+
default: 'data-[active=true]:bg-surface-info-subtle',
|
|
105
|
+
web: 'data-[hover=true]:bg-surface-info-tint data-[active=true]:data-[hover=true]:bg-surface-info-subtle'
|
|
134
106
|
})]
|
|
135
|
-
},
|
|
107
|
+
},
|
|
108
|
+
// ── ghost × color (hover/active surface fills) ──────────────────
|
|
109
|
+
{
|
|
110
|
+
variant: 'ghost',
|
|
111
|
+
color: 'action',
|
|
112
|
+
className: [Platform.select({
|
|
113
|
+
default: 'data-[active=true]:bg-surface-action-subtle-active',
|
|
114
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-subtle-active'
|
|
115
|
+
})]
|
|
116
|
+
}, {
|
|
117
|
+
variant: 'ghost',
|
|
118
|
+
color: 'danger',
|
|
119
|
+
className: [Platform.select({
|
|
120
|
+
default: 'data-[active=true]:bg-surface-danger-subtle-active',
|
|
121
|
+
web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-subtle-active'
|
|
122
|
+
})]
|
|
123
|
+
}, {
|
|
124
|
+
variant: 'ghost',
|
|
125
|
+
color: 'warning',
|
|
126
|
+
className: [Platform.select({
|
|
127
|
+
default: 'data-[active=true]:bg-surface-warning-subtle',
|
|
128
|
+
web: 'data-[hover=true]:bg-surface-warning-tint data-[active=true]:data-[hover=true]:bg-surface-warning-subtle'
|
|
129
|
+
})]
|
|
130
|
+
}, {
|
|
131
|
+
variant: 'ghost',
|
|
132
|
+
color: 'success',
|
|
133
|
+
className: [Platform.select({
|
|
134
|
+
default: 'data-[active=true]:bg-surface-success-subtle',
|
|
135
|
+
web: 'data-[hover=true]:bg-surface-success-tint data-[active=true]:data-[hover=true]:bg-surface-success-subtle'
|
|
136
|
+
})]
|
|
137
|
+
}, {
|
|
138
|
+
variant: 'ghost',
|
|
139
|
+
color: 'info',
|
|
140
|
+
className: [Platform.select({
|
|
141
|
+
default: 'data-[active=true]:bg-surface-info-subtle',
|
|
142
|
+
web: 'data-[hover=true]:bg-surface-info-tint data-[active=true]:data-[hover=true]:bg-surface-info-subtle'
|
|
143
|
+
})]
|
|
144
|
+
}],
|
|
136
145
|
defaultVariants: {
|
|
137
146
|
variant: 'strong',
|
|
138
147
|
color: 'action',
|
|
139
148
|
size: 'default',
|
|
140
|
-
mode: 'light',
|
|
141
149
|
fullWidth: false
|
|
142
150
|
}
|
|
143
151
|
});
|
|
@@ -158,24 +166,63 @@ export const buttonTextVariants = cva(['font-medium', 'text-center'], {
|
|
|
158
166
|
size: {
|
|
159
167
|
default: 'text-base',
|
|
160
168
|
small: 'text-sm'
|
|
161
|
-
},
|
|
162
|
-
mode: {
|
|
163
|
-
light: [],
|
|
164
|
-
dark: []
|
|
165
169
|
}
|
|
166
170
|
},
|
|
167
|
-
compoundVariants: [
|
|
171
|
+
compoundVariants: [
|
|
172
|
+
// ── strong × color (filled foreground text) ──────────────────────
|
|
173
|
+
{
|
|
174
|
+
variant: 'strong',
|
|
175
|
+
color: 'action',
|
|
176
|
+
className: 'text-content-action-on-strong'
|
|
177
|
+
}, {
|
|
178
|
+
variant: 'strong',
|
|
179
|
+
color: 'danger',
|
|
180
|
+
className: 'text-content-danger-on-strong'
|
|
181
|
+
}, {
|
|
182
|
+
variant: 'strong',
|
|
183
|
+
color: 'warning',
|
|
184
|
+
className: 'text-content-warning-on-strong'
|
|
185
|
+
}, {
|
|
186
|
+
variant: 'strong',
|
|
187
|
+
color: 'success',
|
|
188
|
+
className: 'text-content-success-on-strong'
|
|
189
|
+
}, {
|
|
190
|
+
variant: 'strong',
|
|
191
|
+
color: 'info',
|
|
192
|
+
className: 'text-content-info-on-strong'
|
|
193
|
+
},
|
|
194
|
+
// ── outline/ghost × color (transparent foreground text) ──────────
|
|
195
|
+
{
|
|
196
|
+
variant: ['outline', 'ghost'],
|
|
197
|
+
color: 'action',
|
|
198
|
+
className: 'text-content-action'
|
|
199
|
+
}, {
|
|
200
|
+
variant: ['outline', 'ghost'],
|
|
201
|
+
color: 'danger',
|
|
202
|
+
className: 'text-content-danger'
|
|
203
|
+
}, {
|
|
204
|
+
variant: ['outline', 'ghost'],
|
|
205
|
+
color: 'warning',
|
|
206
|
+
className: 'text-content-warning'
|
|
207
|
+
}, {
|
|
208
|
+
variant: ['outline', 'ghost'],
|
|
209
|
+
color: 'success',
|
|
210
|
+
className: 'text-content-success'
|
|
211
|
+
}, {
|
|
212
|
+
variant: ['outline', 'ghost'],
|
|
213
|
+
color: 'info',
|
|
214
|
+
className: 'text-content-info'
|
|
215
|
+
}],
|
|
168
216
|
defaultVariants: {
|
|
169
217
|
variant: 'strong',
|
|
170
218
|
color: 'action',
|
|
171
|
-
size: 'default'
|
|
172
|
-
mode: 'light'
|
|
219
|
+
size: 'default'
|
|
173
220
|
}
|
|
174
221
|
});
|
|
175
222
|
export const buttonSpinnerVariants = cva([], {
|
|
176
223
|
variants: {
|
|
177
224
|
variant: {
|
|
178
|
-
strong:
|
|
225
|
+
strong: [],
|
|
179
226
|
outline: [],
|
|
180
227
|
ghost: []
|
|
181
228
|
},
|
|
@@ -185,66 +232,56 @@ export const buttonSpinnerVariants = cva([], {
|
|
|
185
232
|
warning: [],
|
|
186
233
|
success: [],
|
|
187
234
|
info: []
|
|
188
|
-
},
|
|
189
|
-
mode: {
|
|
190
|
-
light: [],
|
|
191
|
-
dark: []
|
|
192
235
|
}
|
|
193
236
|
},
|
|
194
237
|
compoundVariants: [
|
|
195
|
-
//
|
|
238
|
+
// ── strong × color ───────────────────────────────────────────────
|
|
196
239
|
{
|
|
197
|
-
variant:
|
|
240
|
+
variant: 'strong',
|
|
198
241
|
color: 'action',
|
|
199
|
-
className: 'accent-
|
|
242
|
+
className: 'accent-[var(--color-content-action-on-strong)]'
|
|
200
243
|
}, {
|
|
201
|
-
variant:
|
|
244
|
+
variant: 'strong',
|
|
202
245
|
color: 'danger',
|
|
203
|
-
className: 'accent-
|
|
246
|
+
className: 'accent-[var(--color-content-danger-on-strong)]'
|
|
204
247
|
}, {
|
|
205
|
-
variant:
|
|
248
|
+
variant: 'strong',
|
|
206
249
|
color: 'warning',
|
|
207
|
-
className: 'accent-
|
|
250
|
+
className: 'accent-[var(--color-content-warning-on-strong)]'
|
|
208
251
|
}, {
|
|
209
|
-
variant:
|
|
252
|
+
variant: 'strong',
|
|
210
253
|
color: 'success',
|
|
211
|
-
className: 'accent-
|
|
254
|
+
className: 'accent-[var(--color-content-success-on-strong)]'
|
|
212
255
|
}, {
|
|
213
|
-
variant:
|
|
256
|
+
variant: 'strong',
|
|
214
257
|
color: 'info',
|
|
215
|
-
className: 'accent-
|
|
258
|
+
className: 'accent-[var(--color-content-info-on-strong)]'
|
|
216
259
|
},
|
|
217
|
-
//
|
|
260
|
+
// ── outline/ghost × color ────────────────────────────────────────
|
|
218
261
|
{
|
|
219
262
|
variant: ['outline', 'ghost'],
|
|
220
263
|
color: 'action',
|
|
221
|
-
|
|
222
|
-
className: 'accent-white'
|
|
264
|
+
className: 'accent-[var(--color-content-action)]'
|
|
223
265
|
}, {
|
|
224
266
|
variant: ['outline', 'ghost'],
|
|
225
267
|
color: 'danger',
|
|
226
|
-
|
|
227
|
-
className: 'accent-red-300'
|
|
268
|
+
className: 'accent-[var(--color-content-danger)]'
|
|
228
269
|
}, {
|
|
229
270
|
variant: ['outline', 'ghost'],
|
|
230
271
|
color: 'warning',
|
|
231
|
-
|
|
232
|
-
className: 'accent-amber-300'
|
|
272
|
+
className: 'accent-[var(--color-content-warning)]'
|
|
233
273
|
}, {
|
|
234
274
|
variant: ['outline', 'ghost'],
|
|
235
275
|
color: 'success',
|
|
236
|
-
|
|
237
|
-
className: 'accent-green-300'
|
|
276
|
+
className: 'accent-[var(--color-content-success)]'
|
|
238
277
|
}, {
|
|
239
278
|
variant: ['outline', 'ghost'],
|
|
240
279
|
color: 'info',
|
|
241
|
-
|
|
242
|
-
className: 'accent-sky-300'
|
|
280
|
+
className: 'accent-[var(--color-content-info)]'
|
|
243
281
|
}],
|
|
244
282
|
defaultVariants: {
|
|
245
283
|
variant: 'strong',
|
|
246
|
-
color: 'action'
|
|
247
|
-
mode: 'light'
|
|
284
|
+
color: 'action'
|
|
248
285
|
}
|
|
249
286
|
});
|
|
250
287
|
export const buttonGroupVariants = cva([], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","
|
|
1
|
+
{"version":3,"names":["Platform","cva","DISABLED_CURSOR","TRANSITION_COLORS","buttonRootVariants","variants","variant","strong","outline","ghost","color","action","danger","warning","success","info","size","default","small","fullWidth","true","false","compoundVariants","className","select","web","defaultVariants","buttonTextVariants","buttonSpinnerVariants","buttonGroupVariants","flexDirection","row","column","isAttached","buttonIconVariants"],"sourceRoot":"../../../../src","sources":["components/Button/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA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MACVb,IAAI,EAAE,OAAO;MACbC,KAAK,EAAE;IACT;EACF,CAAC;EACDK,eAAe,EAAE;IACfI,aAAa,EAAE,KAAK;IACpBG,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,OAAO,MAAMC,kBAAkB,GAAGjC,GAAG,CAAC,EAAE,EAAE;EACxCI,QAAQ,EAAE;IACRW,IAAI,EAAE;MACJC,OAAO,EAAE,QAAQ;MACjBC,KAAK,EAAE;IACT;EACF,CAAC;EACDQ,eAAe,EAAE;IACfV,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
-
|
|
6
|
-
export const headingStyle = cva([`${COLOR_TEXT_PRIMARY} font-semibold tracking-tight my-0`, Platform.select({
|
|
5
|
+
export const headingStyle = cva([`text-content-primary font-semibold tracking-tight my-0`, Platform.select({
|
|
7
6
|
web: 'font-sans bg-transparent display-inline no-underline',
|
|
8
7
|
default: ''
|
|
9
8
|
})], {
|
|
10
9
|
variants: {
|
|
11
10
|
size: {
|
|
12
|
-
xl: '
|
|
13
|
-
lg: '
|
|
14
|
-
md: '
|
|
15
|
-
sm: '
|
|
16
|
-
xs: '
|
|
11
|
+
xl: 'heading-xl',
|
|
12
|
+
lg: 'heading-lg',
|
|
13
|
+
md: 'heading-md',
|
|
14
|
+
sm: 'heading-sm',
|
|
15
|
+
xs: 'heading-xs'
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","
|
|
1
|
+
{"version":3,"names":["Platform","cva","headingStyle","select","web","default","variants","size","xl","lg","md","sm","xs"],"sourceRoot":"../../../../src","sources":["components/Heading/styles.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AAEjE,OAAO,MAAMC,YAAY,GAAGD,GAAG,CAC7B,CACE,wDAAwD,EACxDD,QAAQ,CAACG,MAAM,CAAC;EACdC,GAAG,EAAE,sDAAsD;EAC3DC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE,YAAY;MAChBC,EAAE,EAAE;IACN;EACF;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -40,7 +40,6 @@ function IconButtonGlyph({
|
|
|
40
40
|
const IconButtonRoot = /*#__PURE__*/forwardRef(({
|
|
41
41
|
variant = 'solid',
|
|
42
42
|
size = 'default',
|
|
43
|
-
mode = 'light',
|
|
44
43
|
className,
|
|
45
44
|
style,
|
|
46
45
|
as: IconComponent,
|
|
@@ -50,15 +49,11 @@ const IconButtonRoot = /*#__PURE__*/forwardRef(({
|
|
|
50
49
|
}, ref) => {
|
|
51
50
|
const rootClassName = cn(iconButtonRootVariants({
|
|
52
51
|
variant,
|
|
53
|
-
size
|
|
54
|
-
mode
|
|
52
|
+
size
|
|
55
53
|
}), className);
|
|
56
54
|
const glyphClassName = cn(iconButtonGlyphVariants({
|
|
57
55
|
size
|
|
58
|
-
}), iconButtonIconColorVariants(
|
|
59
|
-
variant,
|
|
60
|
-
mode
|
|
61
|
-
}), iconClassName);
|
|
56
|
+
}), iconButtonIconColorVariants(), iconClassName);
|
|
62
57
|
return /*#__PURE__*/_jsx(IconButtonPrimitive, {
|
|
63
58
|
ref: ref,
|
|
64
59
|
accessibilityRole: accessibilityRole,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","ActivityIndicator","Pressable","Text","View","createButton","dataAttributes","useButtonContext","cn","Icon","iconButtonGlyphVariants","iconButtonIconColorVariants","iconButtonRootVariants","jsx","_jsx","IconButtonPrimitive","Root","Group","Spinner","IconButtonGlyph","as","IconComponent","className","hover","focus","active","disabled","focusVisible","IconButtonRoot","variant","size","
|
|
1
|
+
{"version":3,"names":["forwardRef","ActivityIndicator","Pressable","Text","View","createButton","dataAttributes","useButtonContext","cn","Icon","iconButtonGlyphVariants","iconButtonIconColorVariants","iconButtonRootVariants","jsx","_jsx","IconButtonPrimitive","Root","Group","Spinner","IconButtonGlyph","as","IconComponent","className","hover","focus","active","disabled","focusVisible","IconButtonRoot","variant","size","style","iconClassName","accessibilityRole","props","ref","rootClassName","glyphClassName","children","displayName","IconButton"],"sourceRoot":"../../../../src","sources":["components/IconButton/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,iBAAiB,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAA6B,cAAc;AAC5F,SACEC,YAAY,EACZC,cAAc,EAEdC,gBAAgB,QACX,oBAAoB;AAE3B,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,IAAI,QAAwB,SAAS;AAC9C,SAEEC,uBAAuB,EACvBC,2BAA2B,EAC3BC,sBAAsB,QACjB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,MAAMC,mBAAmB,GAAGV,YAAY,CAAC;EACvCW,IAAI,EAAEd,SAAS;EACfC,IAAI;EACJc,KAAK,EAAEb,IAAI;EACXc,OAAO,EAAEjB,iBAAiB;EAC1BQ,IAAI,EAAEL;AACR,CAAC,CAAC;AAEF,SAASe,eAAeA,CAAC;EAAEC,EAAE,EAAEC,aAAa;EAAEC;AAA8C,CAAC,EAAE;EAC7F,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC,MAAM;IAAEC,QAAQ;IAAEC;EAAa,CAAC,GAAGpB,gBAAgB,CAAC,CAAC;EAC3E,oBACEO,IAAA,CAACL,IAAI;IACHW,EAAE,EAAEC,aAAc;IAClBC,SAAS,EAAEA,SAAU;IAAA,GACjBhB,cAAc,CAAC;MACjBiB,KAAK;MACLC,KAAK;MACLC,MAAM;MACNC,QAAQ;MACRC;IACF,CAAC;EAAC,CACH,CAAC;AAEN;AAUA,MAAMC,cAAc,gBAAG5B,UAAU,CAC/B,CACE;EACE6B,OAAO,GAAG,OAAO;EACjBC,IAAI,GAAG,SAAS;EAChBR,SAAS;EACTS,KAAK;EACLX,EAAE,EAAEC,aAAa;EACjBW,aAAa;EACbC,iBAAiB,GAAG,QAAQ;EAC5B,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,aAAa,GAAG5B,EAAE,CAACI,sBAAsB,CAAC;IAAEiB,OAAO;IAAEC;EAAK,CAAC,CAAC,EAAER,SAAS,CAAC;EAE9E,MAAMe,cAAc,GAAG7B,EAAE,CACvBE,uBAAuB,CAAC;IAAEoB;EAAK,CAAC,CAAC,EACjCnB,2BAA2B,CAAC,CAAC,EAC7BqB,aACF,CAAC;EAED,oBACElB,IAAA,CAACC,mBAAmB;IAClBoB,GAAG,EAAEA,GAAI;IACTF,iBAAiB,EAAEA,iBAAkB;IACrCX,SAAS,EAAEc,aAAc;IACzBL,KAAK,EAAEA,KAAM;IAAA,GACTG,KAAK;IAAAI,QAAA,eAETxB,IAAA,CAACK,eAAe;MAACC,EAAE,EAAEC,aAAc;MAACC,SAAS,EAAEe;IAAe,CAAE;EAAC,CAC9C,CAAC;AAE1B,CACF,CAAC;AAEDT,cAAc,CAACW,WAAW,GAAG,YAAY;AAEzC,OAAO,MAAMC,UAAU,GAAGZ,cAAc","ignoreList":[]}
|
|
@@ -2,86 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
function actionOnlyCompounds(compounds) {
|
|
8
|
-
return compounds.filter(c => c.color === 'action').map(c => {
|
|
9
|
-
const {
|
|
10
|
-
color,
|
|
11
|
-
...rest
|
|
12
|
-
} = c;
|
|
13
|
-
void color;
|
|
14
|
-
return rest;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** Dark-mode hover/active surface for ghost (solid uses a separate compound with border). */
|
|
19
|
-
const iconButtonDarkGhostSurfaceCompounds = actionOnlyCompounds(sharedGhostSurfaceCompounds).map(c => ({
|
|
20
|
-
variant: 'ghost',
|
|
21
|
-
...c
|
|
22
|
-
}));
|
|
23
|
-
const iconButtonForegroundTextCompounds = actionOnlyCompounds(sharedOutlineGhostForegroundTextCompounds).map(c => ({
|
|
24
|
-
variant: ['solid', 'ghost'],
|
|
25
|
-
...c
|
|
26
|
-
}));
|
|
27
|
-
export const iconButtonRootVariants = cva(['flex items-center justify-center', RADIUS_FULL, 'web:outline-none web:focus:outline-none web:focus-visible:outline-none', TRANSITION_COLORS, DISABLED_OPACITY, DISABLED_CURSOR, 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-slate-400/50 web:data-[focus-visible=true]:ring-offset-2'], {
|
|
5
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
|
+
export const iconButtonRootVariants = cva(['flex items-center justify-center', 'rounded-[var(--border-radius-round)]', 'web:outline-none web:focus:outline-none web:focus-visible:outline-none', TRANSITION_COLORS, 'data-[disabled=true]:opacity-[--opacity-disabled]', DISABLED_CURSOR, 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[--color-stroke-ring] web:data-[focus-visible=true]:ring-offset-2'], {
|
|
28
7
|
variants: {
|
|
29
8
|
variant: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
9
|
+
solid: ['bg-surface-primary border border-stroke-secondary', Platform.select({
|
|
10
|
+
default: 'data-[active=true]:bg-surface-primary-active',
|
|
11
|
+
web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active'
|
|
12
|
+
})],
|
|
13
|
+
ghost: ['bg-transparent', Platform.select({
|
|
14
|
+
default: 'data-[active=true]:bg-surface-primary-active',
|
|
15
|
+
web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active'
|
|
16
|
+
})]
|
|
33
17
|
},
|
|
34
18
|
size: {
|
|
35
|
-
default: 'h-
|
|
36
|
-
small: 'h-8 w-8 min-w-8 shrink-0 p-
|
|
37
|
-
},
|
|
38
|
-
mode: {
|
|
39
|
-
light: [],
|
|
40
|
-
dark: []
|
|
19
|
+
default: 'h-11 w-11 min-w-11 shrink-0 p-2.5',
|
|
20
|
+
small: 'h-8 w-8 min-w-8 shrink-0 p-1.5'
|
|
41
21
|
}
|
|
42
22
|
},
|
|
43
|
-
compoundVariants: [...iconButtonDarkGhostSurfaceCompounds, {
|
|
44
|
-
variant: 'solid',
|
|
45
|
-
mode: 'dark',
|
|
46
|
-
className: ['border-slate-700', Platform.select({
|
|
47
|
-
default: 'data-[active=true]:bg-slate-700',
|
|
48
|
-
web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700'
|
|
49
|
-
})]
|
|
50
|
-
}],
|
|
51
23
|
defaultVariants: {
|
|
52
24
|
variant: 'solid',
|
|
53
|
-
size: 'default'
|
|
54
|
-
mode: 'light'
|
|
25
|
+
size: 'default'
|
|
55
26
|
}
|
|
56
27
|
});
|
|
57
28
|
export const iconButtonGlyphVariants = cva([], {
|
|
58
29
|
variants: {
|
|
59
30
|
size: {
|
|
60
|
-
default: 'size-
|
|
61
|
-
small: 'size-
|
|
31
|
+
default: 'size-6',
|
|
32
|
+
small: 'size-5'
|
|
62
33
|
}
|
|
63
34
|
},
|
|
64
35
|
defaultVariants: {
|
|
65
36
|
size: 'default'
|
|
66
37
|
}
|
|
67
38
|
});
|
|
68
|
-
|
|
69
|
-
/** Icon fill aligned with Button outline/ghost action label colors (solid matches ghost). */
|
|
70
|
-
export const iconButtonIconColorVariants = cva([], {
|
|
71
|
-
variants: {
|
|
72
|
-
variant: {
|
|
73
|
-
solid: [],
|
|
74
|
-
ghost: []
|
|
75
|
-
},
|
|
76
|
-
mode: {
|
|
77
|
-
light: [],
|
|
78
|
-
dark: []
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
compoundVariants: [...iconButtonForegroundTextCompounds],
|
|
82
|
-
defaultVariants: {
|
|
83
|
-
variant: 'solid',
|
|
84
|
-
mode: 'light'
|
|
85
|
-
}
|
|
86
|
-
});
|
|
39
|
+
export const iconButtonIconColorVariants = cva(['text-content-primary']);
|
|
87
40
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","
|
|
1
|
+
{"version":3,"names":["Platform","cva","DISABLED_CURSOR","TRANSITION_COLORS","iconButtonRootVariants","variants","variant","solid","select","default","web","ghost","size","small","defaultVariants","iconButtonGlyphVariants","iconButtonIconColorVariants"],"sourceRoot":"../../../../src","sources":["components/IconButton/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AACjE,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,yBAAyB;AAE5E,OAAO,MAAMC,sBAAsB,GAAGH,GAAG,CACvC,CACE,kCAAkC,EAClC,sCAAsC,EACtC,wEAAwE,EACxEE,iBAAiB,EACjB,mDAAmD,EACnDD,eAAe,EACf,2IAA2I,CAC5I,EACD;EACEG,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,KAAK,EAAE,CACL,mDAAmD,EACnDP,QAAQ,CAACQ,MAAM,CAAC;QACdC,OAAO,EAAE,8CAA8C;QACvDC,GAAG,EAAE;MACP,CAAC,CAAC,CACH;MACDC,KAAK,EAAE,CACL,gBAAgB,EAChBX,QAAQ,CAACQ,MAAM,CAAC;QACdC,OAAO,EAAE,8CAA8C;QACvDC,GAAG,EAAE;MACP,CAAC,CAAC;IAEN,CAAC;IACDE,IAAI,EAAE;MACJH,OAAO,EAAE,mCAAmC;MAC5CI,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfR,OAAO,EAAE,OAAO;IAChBM,IAAI,EAAE;EACR;AACF,CACF,CAAC;AAED,OAAO,MAAMG,uBAAuB,GAAGd,GAAG,CAAC,EAAE,EAAE;EAC7CI,QAAQ,EAAE;IACRO,IAAI,EAAE;MACJH,OAAO,EAAE,QAAQ;MACjBI,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfF,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,OAAO,MAAMI,2BAA2B,GAAGf,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC","ignoreList":[]}
|