@accelint/design-toolkit 2.2.1 → 2.3.1
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 -0
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +3 -39
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/avatar/index.d.ts +4 -4
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/box/index.d.ts +3 -3
- package/dist/components/button/index.d.ts +35 -23
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +297 -0
- package/dist/components/button/styles.js +2 -0
- package/dist/components/button/styles.js.map +1 -0
- package/dist/components/button/types.d.ts +14 -0
- package/dist/components/button/types.js +2 -0
- package/dist/components/button/types.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +25 -48
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.d.ts +250 -0
- package/dist/components/chip/styles.js +2 -0
- package/dist/components/chip/styles.js.map +1 -0
- package/dist/components/chip/types.d.ts +20 -0
- package/dist/components/chip/types.js +2 -0
- package/dist/components/chip/types.js.map +1 -0
- package/dist/components/classification-badge/index.d.ts +15 -16
- package/dist/components/classification-badge/index.js +1 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/styles.d.ts +51 -0
- package/dist/components/classification-badge/styles.js +2 -0
- package/dist/components/classification-badge/styles.js.map +1 -0
- package/dist/components/classification-badge/types.d.ts +9 -0
- package/dist/components/classification-badge/types.js +2 -0
- package/dist/components/classification-badge/types.js.map +1 -0
- package/dist/components/classification-banner/index.d.ts +15 -16
- package/dist/components/classification-banner/index.js +1 -2
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/styles.d.ts +38 -0
- package/dist/components/classification-banner/styles.js +2 -0
- package/dist/components/classification-banner/styles.js.map +1 -0
- package/dist/components/classification-banner/types.d.ts +9 -0
- package/dist/components/classification-banner/types.js +2 -0
- package/dist/components/classification-banner/types.js.map +1 -0
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/index.js.map +1 -1
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +5 -5
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/icon/types.d.ts +3 -5
- package/dist/components/label/index.d.ts +10 -7
- package/dist/components/label/index.js +1 -1
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/styles.d.ts +5 -0
- package/dist/components/label/styles.js +2 -0
- package/dist/components/label/styles.js.map +1 -0
- package/dist/components/label/types.d.ts +10 -0
- package/dist/components/label/types.js +2 -0
- package/dist/components/label/types.js.map +1 -0
- package/dist/components/options/index.d.ts +2 -2
- package/dist/components/options-item/index.js +1 -1
- package/dist/components/options-item/index.js.map +1 -1
- package/dist/components/popover/styles.d.ts +3 -3
- package/dist/components/query-builder/index.js +1 -1
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/value-editor.js +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/radio/index.d.ts +11 -9
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +53 -0
- package/dist/components/radio/styles.js +2 -0
- package/dist/components/radio/styles.js.map +1 -0
- package/dist/components/radio/types.d.ts +21 -0
- package/dist/components/radio/types.js +2 -0
- package/dist/components/radio/types.js.map +1 -0
- package/dist/components/search-field/index.js +1 -1
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +10 -7
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +41 -0
- package/dist/components/switch/styles.js +2 -0
- package/dist/components/switch/styles.js.map +1 -0
- package/dist/components/switch/types.d.ts +13 -0
- package/dist/components/switch/types.js +2 -0
- package/dist/components/switch/types.js.map +1 -0
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +19 -0
- package/dist/components/text-area-field/index.js +2 -0
- package/dist/components/text-area-field/index.js.map +1 -0
- package/dist/components/text-area-field/styles.d.ts +113 -0
- package/dist/components/text-area-field/styles.js +2 -0
- package/dist/components/text-area-field/styles.js.map +1 -0
- package/dist/components/text-area-field/types.d.ts +23 -0
- package/dist/components/text-area-field/types.js +2 -0
- package/dist/components/text-area-field/types.js.map +1 -0
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/index.css +122 -252
- package/dist/index.d.ts +25 -11
- package/dist/index.js +1 -1
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +873 -754
- package/dist/tokens/generated/themes.css +147 -0
- package/dist/tokens/generated/themes.d.ts +2 -0
- package/dist/tokens/generated/tokens.css +119 -0
- package/dist/tokens/generated/tokens.d.ts +108 -0
- package/dist/tokens/generated/tokens.js +2 -0
- package/dist/tokens/generated/tokens.js.map +1 -0
- package/package.json +5 -5
- package/dist/components/floating-button/index.d.ts +0 -18
- package/dist/components/floating-button/index.js +0 -2
- package/dist/components/floating-button/index.js.map +0 -1
- package/dist/components/icon-button/index.d.ts +0 -20
- package/dist/components/icon-button/index.js +0 -2
- package/dist/components/icon-button/index.js.map +0 -1
- package/dist/components/text-area/index.d.ts +0 -30
- package/dist/components/text-area/index.js +0 -2
- package/dist/components/text-area/index.js.map +0 -1
- package/dist/components/toggle-icon-button/index.d.ts +0 -20
- package/dist/components/toggle-icon-button/index.js +0 -2
- package/dist/components/toggle-icon-button/index.js.map +0 -1
@@ -0,0 +1,297 @@
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
2
|
+
|
3
|
+
declare const ButtonStylesDefaults: {
|
4
|
+
readonly color: "info";
|
5
|
+
readonly size: "medium";
|
6
|
+
readonly variant: "filled";
|
7
|
+
};
|
8
|
+
declare const ButtonStyles: tailwind_variants.TVReturnType<{} | {
|
9
|
+
color: {
|
10
|
+
info: tailwind_variants.ClassValue | {};
|
11
|
+
serious: tailwind_variants.ClassValue | {};
|
12
|
+
critical: tailwind_variants.ClassValue | {};
|
13
|
+
};
|
14
|
+
size: {
|
15
|
+
large: tailwind_variants.ClassValue | {};
|
16
|
+
medium: tailwind_variants.ClassValue | {};
|
17
|
+
small: tailwind_variants.ClassValue | {};
|
18
|
+
xsmall: tailwind_variants.ClassValue | {};
|
19
|
+
};
|
20
|
+
variant: {
|
21
|
+
filled: tailwind_variants.ClassValue | {};
|
22
|
+
outline: tailwind_variants.ClassValue | {};
|
23
|
+
flat: tailwind_variants.ClassValue | {};
|
24
|
+
icon: tailwind_variants.ClassValue | {};
|
25
|
+
floating: tailwind_variants.ClassValue | {};
|
26
|
+
};
|
27
|
+
}, undefined, undefined, {
|
28
|
+
color: {
|
29
|
+
info: string;
|
30
|
+
serious: string;
|
31
|
+
critical: string;
|
32
|
+
};
|
33
|
+
size: {
|
34
|
+
large: string;
|
35
|
+
medium: string;
|
36
|
+
small: string;
|
37
|
+
xsmall: string;
|
38
|
+
};
|
39
|
+
variant: {
|
40
|
+
filled: string;
|
41
|
+
outline: string;
|
42
|
+
flat: string;
|
43
|
+
icon: string;
|
44
|
+
floating: string[];
|
45
|
+
};
|
46
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
47
|
+
color: {
|
48
|
+
info: string;
|
49
|
+
serious: string;
|
50
|
+
critical: string;
|
51
|
+
};
|
52
|
+
size: {
|
53
|
+
large: string;
|
54
|
+
medium: string;
|
55
|
+
small: string;
|
56
|
+
xsmall: string;
|
57
|
+
};
|
58
|
+
variant: {
|
59
|
+
filled: string;
|
60
|
+
outline: string;
|
61
|
+
flat: string;
|
62
|
+
icon: string;
|
63
|
+
floating: string[];
|
64
|
+
};
|
65
|
+
}, undefined, string[], {
|
66
|
+
color: {
|
67
|
+
info: string;
|
68
|
+
serious: string;
|
69
|
+
critical: string;
|
70
|
+
};
|
71
|
+
size: {
|
72
|
+
large: string;
|
73
|
+
medium: string;
|
74
|
+
small: string;
|
75
|
+
xsmall: string;
|
76
|
+
};
|
77
|
+
variant: {
|
78
|
+
filled: string;
|
79
|
+
outline: string;
|
80
|
+
flat: string;
|
81
|
+
icon: string;
|
82
|
+
floating: string[];
|
83
|
+
};
|
84
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
85
|
+
color: {
|
86
|
+
info: string;
|
87
|
+
serious: string;
|
88
|
+
critical: string;
|
89
|
+
};
|
90
|
+
size: {
|
91
|
+
large: string;
|
92
|
+
medium: string;
|
93
|
+
small: string;
|
94
|
+
xsmall: string;
|
95
|
+
};
|
96
|
+
variant: {
|
97
|
+
filled: string;
|
98
|
+
outline: string;
|
99
|
+
flat: string;
|
100
|
+
icon: string;
|
101
|
+
floating: string[];
|
102
|
+
};
|
103
|
+
}, undefined, string[], unknown, unknown, undefined>>>;
|
104
|
+
declare const LinkButtonStyles: tailwind_variants.TVReturnType<{} | {
|
105
|
+
color: {
|
106
|
+
info: tailwind_variants.ClassValue | {};
|
107
|
+
serious: tailwind_variants.ClassValue | {};
|
108
|
+
critical: tailwind_variants.ClassValue | {};
|
109
|
+
};
|
110
|
+
size: {
|
111
|
+
large: tailwind_variants.ClassValue | {};
|
112
|
+
medium: tailwind_variants.ClassValue | {};
|
113
|
+
small: tailwind_variants.ClassValue | {};
|
114
|
+
xsmall: tailwind_variants.ClassValue | {};
|
115
|
+
};
|
116
|
+
variant: {
|
117
|
+
filled: tailwind_variants.ClassValue | {};
|
118
|
+
outline: tailwind_variants.ClassValue | {};
|
119
|
+
flat: tailwind_variants.ClassValue | {};
|
120
|
+
icon: tailwind_variants.ClassValue | {};
|
121
|
+
floating: tailwind_variants.ClassValue | {};
|
122
|
+
};
|
123
|
+
}, undefined, undefined, {
|
124
|
+
color: {
|
125
|
+
info: string;
|
126
|
+
serious: string;
|
127
|
+
critical: string;
|
128
|
+
};
|
129
|
+
size: {
|
130
|
+
large: string;
|
131
|
+
medium: string;
|
132
|
+
small: string;
|
133
|
+
xsmall: string;
|
134
|
+
};
|
135
|
+
variant: {
|
136
|
+
filled: string;
|
137
|
+
outline: string;
|
138
|
+
flat: string;
|
139
|
+
icon: string;
|
140
|
+
floating: string[];
|
141
|
+
};
|
142
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
143
|
+
color: {
|
144
|
+
info: string;
|
145
|
+
serious: string;
|
146
|
+
critical: string;
|
147
|
+
};
|
148
|
+
size: {
|
149
|
+
large: string;
|
150
|
+
medium: string;
|
151
|
+
small: string;
|
152
|
+
xsmall: string;
|
153
|
+
};
|
154
|
+
variant: {
|
155
|
+
filled: string;
|
156
|
+
outline: string;
|
157
|
+
flat: string;
|
158
|
+
icon: string;
|
159
|
+
floating: string[];
|
160
|
+
};
|
161
|
+
}, undefined, string[], {
|
162
|
+
color: {
|
163
|
+
info: string;
|
164
|
+
serious: string;
|
165
|
+
critical: string;
|
166
|
+
};
|
167
|
+
size: {
|
168
|
+
large: string;
|
169
|
+
medium: string;
|
170
|
+
small: string;
|
171
|
+
xsmall: string;
|
172
|
+
};
|
173
|
+
variant: {
|
174
|
+
filled: string;
|
175
|
+
outline: string;
|
176
|
+
flat: string;
|
177
|
+
icon: string;
|
178
|
+
floating: string[];
|
179
|
+
};
|
180
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
181
|
+
color: {
|
182
|
+
info: string;
|
183
|
+
serious: string;
|
184
|
+
critical: string;
|
185
|
+
};
|
186
|
+
size: {
|
187
|
+
large: string;
|
188
|
+
medium: string;
|
189
|
+
small: string;
|
190
|
+
xsmall: string;
|
191
|
+
};
|
192
|
+
variant: {
|
193
|
+
filled: string;
|
194
|
+
outline: string;
|
195
|
+
flat: string;
|
196
|
+
icon: string;
|
197
|
+
floating: string[];
|
198
|
+
};
|
199
|
+
}, undefined, string[], unknown, unknown, undefined>>>;
|
200
|
+
declare const ToggleButtonStyles: tailwind_variants.TVReturnType<{} | {
|
201
|
+
color: {
|
202
|
+
info: tailwind_variants.ClassValue | {};
|
203
|
+
serious: tailwind_variants.ClassValue | {};
|
204
|
+
critical: tailwind_variants.ClassValue | {};
|
205
|
+
};
|
206
|
+
size: {
|
207
|
+
large: tailwind_variants.ClassValue | {};
|
208
|
+
medium: tailwind_variants.ClassValue | {};
|
209
|
+
small: tailwind_variants.ClassValue | {};
|
210
|
+
xsmall: tailwind_variants.ClassValue | {};
|
211
|
+
};
|
212
|
+
variant: {
|
213
|
+
filled: tailwind_variants.ClassValue | {};
|
214
|
+
outline: tailwind_variants.ClassValue | {};
|
215
|
+
flat: tailwind_variants.ClassValue | {};
|
216
|
+
icon: tailwind_variants.ClassValue | {};
|
217
|
+
floating: tailwind_variants.ClassValue | {};
|
218
|
+
};
|
219
|
+
}, undefined, undefined, {
|
220
|
+
color: {
|
221
|
+
info: string;
|
222
|
+
serious: string;
|
223
|
+
critical: string;
|
224
|
+
};
|
225
|
+
size: {
|
226
|
+
large: string;
|
227
|
+
medium: string;
|
228
|
+
small: string;
|
229
|
+
xsmall: string;
|
230
|
+
};
|
231
|
+
variant: {
|
232
|
+
filled: string;
|
233
|
+
outline: string;
|
234
|
+
flat: string;
|
235
|
+
icon: string;
|
236
|
+
floating: string[];
|
237
|
+
};
|
238
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
239
|
+
color: {
|
240
|
+
info: string;
|
241
|
+
serious: string;
|
242
|
+
critical: string;
|
243
|
+
};
|
244
|
+
size: {
|
245
|
+
large: string;
|
246
|
+
medium: string;
|
247
|
+
small: string;
|
248
|
+
xsmall: string;
|
249
|
+
};
|
250
|
+
variant: {
|
251
|
+
filled: string;
|
252
|
+
outline: string;
|
253
|
+
flat: string;
|
254
|
+
icon: string;
|
255
|
+
floating: string[];
|
256
|
+
};
|
257
|
+
}, undefined, string[], {
|
258
|
+
color: {
|
259
|
+
info: string;
|
260
|
+
serious: string;
|
261
|
+
critical: string;
|
262
|
+
};
|
263
|
+
size: {
|
264
|
+
large: string;
|
265
|
+
medium: string;
|
266
|
+
small: string;
|
267
|
+
xsmall: string;
|
268
|
+
};
|
269
|
+
variant: {
|
270
|
+
filled: string;
|
271
|
+
outline: string;
|
272
|
+
flat: string;
|
273
|
+
icon: string;
|
274
|
+
floating: string[];
|
275
|
+
};
|
276
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
277
|
+
color: {
|
278
|
+
info: string;
|
279
|
+
serious: string;
|
280
|
+
critical: string;
|
281
|
+
};
|
282
|
+
size: {
|
283
|
+
large: string;
|
284
|
+
medium: string;
|
285
|
+
small: string;
|
286
|
+
xsmall: string;
|
287
|
+
};
|
288
|
+
variant: {
|
289
|
+
filled: string;
|
290
|
+
outline: string;
|
291
|
+
flat: string;
|
292
|
+
icon: string;
|
293
|
+
floating: string[];
|
294
|
+
};
|
295
|
+
}, undefined, string[], unknown, unknown, undefined>>>;
|
296
|
+
|
297
|
+
export { ButtonStyles, ButtonStylesDefaults, LinkButtonStyles, ToggleButtonStyles };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import {tv}from'./../../lib/utils.js';var a={color:"info",size:"medium",variant:"filled"},l=tv({base:["flex w-content cursor-pointer items-center justify-center rounded-medium outline outline-transparent","disabled:cursor-not-allowed"],variants:{color:{info:"",serious:"",critical:""},size:{large:"gap-xs px-m py-s text-button-l",medium:"gap-xs px-m py-s text-button-m",small:"gap-xxs px-s py-xs text-button-s",xsmall:"gap-xxs px-s py-xs text-button-xs"},variant:{filled:"disabled:fg-disabled disabled:bg-interactive-disabled",outline:"disabled:fg-disabled disabled:outline-interactive-disabled",flat:"disabled:fg-disabled disabled:bg-transparent",icon:"disabled:fg-disabled disabled:bg-transparent",floating:["rounded-full","disabled:fg-disabled disabled:bg-interactive-disabled disabled:outline-interactive-disabled"]}},compoundVariants:[{size:["large","medium"],variant:["icon","floating"],className:"p-xs"},{size:["small","xsmall"],variant:["icon","floating"],className:"p-xxs"},{size:["small","xsmall"],variant:"icon",className:"rounded-small"},{color:"info",variant:"filled",className:["enabled:bg-interactive-default","enabled:hover:bg-interactive-hover-light","enabled:focus:bg-interactive-hover-light"]},{color:"info",variant:"outline",className:["enabled:fg-default-light enabled:outline-interactive","enabled:hover:outline-interactive-hover","enabled:focus:outline-interactive-hover"]},{color:"info",variant:["flat","icon"],className:["enabled:fg-default-light","enabled:hover:bg-interactive-hover-dark","enabled:focus:bg-interactive-hover-dark"]},{color:"info",variant:"floating",className:["enabled:fg-interactive enabled:bg-surface-default enabled:outline-interactive","enabled:hover:fg-interactive-hover enabled:hover:outline-interactive-hover","enabled:focus:fg-interactive-hover enabled:focus:outline-interactive-hover"]},{color:"serious",variant:"filled",className:["enabled:bg-serious","enabled:hover:bg-serious-hover","enabled:focus:bg-serious-hover"]},{color:"serious",variant:"outline",className:["enabled:fg-default-light enabled:outline-serious","enabled:hover:outline-interactive-hover","enabled:focus:outline-interactive-hover"]},{color:"serious",variant:["flat","icon"],className:["enabled:fg-default-light","enabled:hover:bg-serious-hover","enabled:focus:bg-serious-hover"]},{color:"serious",variant:"floating",className:["enabled:fg-serious enabled:bg-serious-subtle enabled:outline-serious","enabled:hover:fg-interactive-hover enabled:hover:outline-interactive-hover","enabled:focus:fg-interactive-hover enabled:focus:outline-interactive-hover"]},{color:"critical",variant:"filled",className:["enabled:bg-critical","enabled:hover:bg-critical-hover","enabled:focus:bg-critical-hover"]},{color:"critical",variant:"outline",className:["enabled:fg-default-light enabled:outline-critical","enabled:hover:outline-interactive-hover","enabled:focus:outline-interactive-hover"]},{color:"critical",variant:["flat","icon"],className:["enabled:fg-default-light","enabled:hover:bg-critical-hover","enabled:focus:bg-critical-hover"]},{color:"critical",variant:"floating",className:["enabled:fg-critical enabled:bg-critical-subtle enabled:outline-critical","enabled:hover:fg-interactive-hover enabled:hover:outline-interactive-hover","enabled:focus:fg-interactive-hover enabled:focus:outline-interactive-hover"]}],defaultVariants:a}),t=tv({extend:l}),o=tv({extend:l}),n=tv({extend:l,compoundVariants:[{color:"info",variant:"filled",className:["enabled:selected:bg-info-subtle","enabled:selected:hover:bg-interactive-hover-light","enabled:selected:focus:bg-interactive-hover-light"]},{color:"info",variant:"floating",className:["enabled:selected:outline-highlight","enabled:selected:hover:outline-interactive-hover","enabled:selected:focus:outline-interactive-hover"]},{color:"serious",variant:"filled",className:["enabled:selected:bg-serious-subtle","enabled:selected:hover:bg-serious-hover","enabled:selected:focus:bg-serious-hover"]},{color:"serious",variant:"floating",className:["enabled:selected:outline-highlight","enabled:selected:hover:outline-interactive-hover","enabled:selected:focus:outline-interactive-hover"]},{color:"critical",variant:"filled",className:["enabled:selected:bg-critical-subtle","enabled:selected:hover:bg-critical-hover","enabled:selected:focus:bg-critical-hover"]},{color:"critical",variant:"floating",className:["enabled:selected:outline-highlight","enabled:selected:hover:outline-interactive-hover","enabled:selected:focus:outline-interactive-hover"]},{className:["enabled:selected:fg-highlight","enabled:selected:hover:fg-highlight","enabled:selected:focus:fg-highlight"]}]});export{t as ButtonStyles,a as ButtonStylesDefaults,o as LinkButtonStyles,n as ToggleButtonStyles};//# sourceMappingURL=styles.js.map
|
2
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/button/styles.ts"],"names":["e","tv","BaseButtonStyles"],"mappings":"4CAeS,CAAA,KAAA,CACP,MAAM,CAAA,IAAA,CAAA,QACN,CAAA,gBAIA,CAAA,CAAA,CAAA,CAAAA,EAAM,CACJ,CAAA,IAAA,CAAA,CAAA,sGACA,CA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CAAA,CAAA,CAAA,SACE,CAAA,CAAA,+BACA,CAAA,2EAKP,CAAA,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const ButtonStylesDefaults = {\n color: 'info',\n size: 'medium',\n variant: 'filled',\n} as const;\n\nconst BaseButtonStyles = tv({\n base: [\n 'flex w-content cursor-pointer items-center justify-center rounded-medium outline outline-transparent',\n 'disabled:cursor-not-allowed',\n ],\n variants: {\n color: {\n info: '',\n serious: '',\n critical: '',\n },\n size: {\n large: 'gap-xs px-m py-s text-button-l',\n medium: 'gap-xs px-m py-s text-button-m',\n small: 'gap-xxs px-s py-xs text-button-s',\n xsmall: 'gap-xxs px-s py-xs text-button-xs',\n },\n variant: {\n filled: 'disabled:fg-disabled disabled:bg-interactive-disabled',\n outline: 'disabled:fg-disabled disabled:outline-interactive-disabled',\n flat: 'disabled:fg-disabled disabled:bg-transparent',\n icon: 'disabled:fg-disabled disabled:bg-transparent',\n floating: [\n 'rounded-full',\n 'disabled:fg-disabled disabled:bg-interactive-disabled disabled:outline-interactive-disabled',\n ],\n },\n },\n compoundVariants: [\n {\n size: ['large', 'medium'],\n variant: ['icon', 'floating'],\n className: 'p-xs',\n },\n {\n size: ['small', 'xsmall'],\n variant: ['icon', 'floating'],\n className: 'p-xxs',\n },\n {\n size: ['small', 'xsmall'],\n variant: 'icon',\n className: 'rounded-small',\n },\n\n /** Colors **/\n // Info\n {\n color: 'info',\n variant: 'filled',\n className: [\n 'enabled:bg-interactive-default',\n 'enabled:hover:bg-interactive-hover-light',\n 'enabled:focus:bg-interactive-hover-light',\n ],\n },\n {\n color: 'info',\n variant: 'outline',\n className: [\n 'enabled:fg-default-light enabled:outline-interactive',\n 'enabled:hover:outline-interactive-hover',\n 'enabled:focus:outline-interactive-hover',\n ],\n },\n {\n color: 'info',\n variant: ['flat', 'icon'],\n className: [\n 'enabled:fg-default-light',\n 'enabled:hover:bg-interactive-hover-dark',\n 'enabled:focus:bg-interactive-hover-dark',\n ],\n },\n {\n color: 'info',\n variant: 'floating',\n className: [\n 'enabled:fg-interactive enabled:bg-surface-default enabled:outline-interactive',\n 'enabled:hover:fg-interactive-hover enabled:hover:outline-interactive-hover',\n 'enabled:focus:fg-interactive-hover enabled:focus:outline-interactive-hover',\n ],\n },\n\n // Serious\n {\n color: 'serious',\n variant: 'filled',\n className: [\n 'enabled:bg-serious',\n 'enabled:hover:bg-serious-hover',\n 'enabled:focus:bg-serious-hover',\n ],\n },\n {\n color: 'serious',\n variant: 'outline',\n className: [\n 'enabled:fg-default-light enabled:outline-serious',\n 'enabled:hover:outline-interactive-hover',\n 'enabled:focus:outline-interactive-hover',\n ],\n },\n {\n color: 'serious',\n variant: ['flat', 'icon'],\n className: [\n 'enabled:fg-default-light',\n 'enabled:hover:bg-serious-hover',\n 'enabled:focus:bg-serious-hover',\n ],\n },\n {\n color: 'serious',\n variant: 'floating',\n className: [\n 'enabled:fg-serious enabled:bg-serious-subtle enabled:outline-serious',\n 'enabled:hover:fg-interactive-hover enabled:hover:outline-interactive-hover',\n 'enabled:focus:fg-interactive-hover enabled:focus:outline-interactive-hover',\n ],\n },\n\n // Critical\n {\n color: 'critical',\n variant: 'filled',\n className: [\n 'enabled:bg-critical',\n 'enabled:hover:bg-critical-hover',\n 'enabled:focus:bg-critical-hover',\n ],\n },\n {\n color: 'critical',\n variant: 'outline',\n className: [\n 'enabled:fg-default-light enabled:outline-critical',\n 'enabled:hover:outline-interactive-hover',\n 'enabled:focus:outline-interactive-hover',\n ],\n },\n {\n color: 'critical',\n variant: ['flat', 'icon'],\n className: [\n 'enabled:fg-default-light',\n 'enabled:hover:bg-critical-hover',\n 'enabled:focus:bg-critical-hover',\n ],\n },\n {\n color: 'critical',\n variant: 'floating',\n className: [\n 'enabled:fg-critical enabled:bg-critical-subtle enabled:outline-critical',\n 'enabled:hover:fg-interactive-hover enabled:hover:outline-interactive-hover',\n 'enabled:focus:fg-interactive-hover enabled:focus:outline-interactive-hover',\n ],\n },\n ],\n defaultVariants: ButtonStylesDefaults,\n});\n\nexport const ButtonStyles = tv({\n extend: BaseButtonStyles,\n});\n\nexport const LinkButtonStyles = tv({\n extend: BaseButtonStyles,\n});\n\nexport const ToggleButtonStyles = tv({\n extend: BaseButtonStyles,\n compoundVariants: [\n {\n color: 'info',\n variant: 'filled',\n className: [\n 'enabled:selected:bg-info-subtle',\n 'enabled:selected:hover:bg-interactive-hover-light',\n 'enabled:selected:focus:bg-interactive-hover-light',\n ],\n },\n {\n color: 'info',\n variant: 'floating',\n className: [\n 'enabled:selected:outline-highlight',\n 'enabled:selected:hover:outline-interactive-hover',\n 'enabled:selected:focus:outline-interactive-hover',\n ],\n },\n {\n color: 'serious',\n variant: 'filled',\n className: [\n 'enabled:selected:bg-serious-subtle',\n 'enabled:selected:hover:bg-serious-hover',\n 'enabled:selected:focus:bg-serious-hover',\n ],\n },\n {\n color: 'serious',\n variant: 'floating',\n className: [\n 'enabled:selected:outline-highlight',\n 'enabled:selected:hover:outline-interactive-hover',\n 'enabled:selected:focus:outline-interactive-hover',\n ],\n },\n {\n color: 'critical',\n variant: 'filled',\n className: [\n 'enabled:selected:bg-critical-subtle',\n 'enabled:selected:hover:bg-critical-hover',\n 'enabled:selected:focus:bg-critical-hover',\n ],\n },\n {\n color: 'critical',\n variant: 'floating',\n className: [\n 'enabled:selected:outline-highlight',\n 'enabled:selected:hover:outline-interactive-hover',\n 'enabled:selected:focus:outline-interactive-hover',\n ],\n },\n // Must be last to override color values\n {\n className: [\n 'enabled:selected:fg-highlight',\n 'enabled:selected:hover:fg-highlight',\n 'enabled:selected:focus:fg-highlight',\n ],\n },\n ],\n});\n"]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { RefAttributes, PropsWithChildren } from 'react';
|
2
|
+
import { ButtonProps as ButtonProps$1, LinkProps, ToggleButtonProps as ToggleButtonProps$1 } from 'react-aria-components';
|
3
|
+
import { VariantProps } from 'tailwind-variants';
|
4
|
+
import { ButtonStyles } from './styles.js';
|
5
|
+
|
6
|
+
type ButtonStyleVariants = VariantProps<typeof ButtonStyles>;
|
7
|
+
type ButtonProps = ButtonProps$1 & ButtonStyleVariants & RefAttributes<HTMLButtonElement>;
|
8
|
+
type LinkButtonProps = LinkProps & ButtonStyleVariants & RefAttributes<HTMLAnchorElement>;
|
9
|
+
type ToggleButtonProps = ToggleButtonProps$1 & ButtonStyleVariants & RefAttributes<HTMLButtonElement>;
|
10
|
+
type ButtonProviderProps = PropsWithChildren<Omit<ButtonProps, 'ref'>>;
|
11
|
+
type LinkButtonProviderProps = PropsWithChildren<Omit<LinkButtonProps, 'ref'>>;
|
12
|
+
type ToggleButtonProviderProps = PropsWithChildren<Omit<ToggleButtonProps, 'ref'>>;
|
13
|
+
|
14
|
+
export type { ButtonProps, ButtonProviderProps, ButtonStyleVariants, LinkButtonProps, LinkButtonProviderProps, ToggleButtonProps, ToggleButtonProviderProps };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import
|
2
|
+
import react__default from 'react';
|
3
3
|
import { CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1 } from 'react-aria-components';
|
4
4
|
|
5
5
|
/**
|
@@ -12,7 +12,7 @@ declare namespace Checkbox {
|
|
12
12
|
var Group: typeof CheckboxGroup;
|
13
13
|
}
|
14
14
|
interface CheckboxGroupProps extends CheckboxGroupProps$1 {
|
15
|
-
label?: string |
|
15
|
+
label?: string | react__default.JSX.Element;
|
16
16
|
}
|
17
17
|
declare function CheckboxGroup({ children, className, label, ...props }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
18
18
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {cn}from'./../../lib/utils.js';import {CheckboxIndeterminate,CheckboxSelected}from'@accelint/icons';import'client-only';import {cva}from'cva';import {Checkbox,CheckboxGroup}from'react-aria-components';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var f=cva("fg-inverse-light size-l rounded-small outline outline-interactive",{variants:{isIndeterminate:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isSelected:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isHovered:{true:"outline-interactive-hover"},isFocused:{true:"outline-interactive-hover"},isDisabled:{true:"outline-interactive-disabled hover:outline-interactive-disabled"},isReadOnly:{true:"outline-interactive-disabled hover:outline-interactive-disabled"}},compoundVariants:[{isDisabled:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isDisabled:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"}],defaultVariants:{isIndeterminate:false,isSelected:false}});function k({className:e,children:r,...t}){return jsx(Checkbox,{...t,className:cn("fg-default-light flex items-center gap-m
|
1
|
+
import {cn}from'./../../lib/utils.js';import {CheckboxIndeterminate,CheckboxSelected}from'@accelint/icons';import'client-only';import {cva}from'cva';import {Checkbox,CheckboxGroup}from'react-aria-components';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var f=cva("fg-inverse-light size-l rounded-small outline outline-interactive",{variants:{isIndeterminate:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isSelected:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isHovered:{true:"outline-interactive-hover"},isFocused:{true:"outline-interactive-hover"},isDisabled:{true:"outline-interactive-disabled hover:outline-interactive-disabled"},isReadOnly:{true:"outline-interactive-disabled hover:outline-interactive-disabled"}},compoundVariants:[{isDisabled:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isDisabled:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"}],defaultVariants:{isIndeterminate:false,isSelected:false}});function k({className:e,children:r,...t}){return jsx(Checkbox,{...t,className:cn("fg-default-light flex items-center gap-m text-body-s disabled:text-interactive-disabled",e),children:({isDisabled:o,isFocused:a,isHovered:h,isIndeterminate:s,isReadOnly:d,isSelected:n})=>jsxs(Fragment,{children:[jsxs("div",{className:cn(f({isDisabled:o,isFocused:a,isHovered:h,isIndeterminate:s,isReadOnly:d,isSelected:n})),"aria-hidden":true,children:[s&&!n&&jsx(CheckboxIndeterminate,{}),n&&!s&&jsx(CheckboxSelected,{})]}),r]})})}function C({children:e,className:r,label:t,...o}){return jsx(CheckboxGroup,{...o,className:cn("fg-default-light flex flex-col gap-m text-body-s",r),children:a=>jsxs(Fragment,{children:[t?jsx(Label,{children:t}):void 0,typeof e=="function"?e(a):e]})})}k.Group=C;export{k as Checkbox};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["v","jsx","args","x","c","Fragment","l","u","isSelected","CheckboxIndeterminate","isIndeterminate","CheckboxSelected","i","p","children","label","props","m","g","Checkbox","CheckboxGroup"],"mappings":"wSA2BE,IAAA,CAAA,CAAAA,GAAA,CAAA,mEAEE,CAAA,CAAA,QACE,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,gGAER,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,gGAER,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,2BAER,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,2BAER,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,iEAER,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,iEAGV,CAAA,CAAA,CAAA,gBAEI,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,UACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,eACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,UACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,eACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGf,CAAA,CAAA,CAAA,eACE,CAAA,CAAA,eACA,CAAA,KAAA,CAAA,UAUC,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,SAAoB,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,SAAoC,CACxE,CAAA,GAAA,CAAA,CAAA,CACEC,CAAAA,OACMC,GAAAA,CACJC,QAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACE,CAAAC,EAAA,CAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["v","jsx","args","x","c","Fragment","l","u","isSelected","CheckboxIndeterminate","isIndeterminate","CheckboxSelected","i","p","children","label","props","m","g","Checkbox","CheckboxGroup"],"mappings":"wSA2BE,IAAA,CAAA,CAAAA,GAAA,CAAA,mEAEE,CAAA,CAAA,QACE,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,gGAER,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA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,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UAGJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,aAEC,CAAA,IAAA,CAAA,QAAoBI,CAAcP,CAAAA,CAACQ,EAAA,CAAA,CAAsB,EACzDD,yBAAc,CAACE,EAAAA,CAAmBT,CAAAA,CAACU,EAAA,CAAA,CAAiB,EAAAC,GACvD,CAAAC,gBACCC,CAAAA,EACH,CAAA,CAEJ,CAEJ,CAOA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SACA,CAAAC,CAAAA,CACA,KACF,CAAuB,CACrB,CAAA,GAAA,CAAA,CAAA,CACEd,CAAAA,OACMe,GAAAA,CACJC,aAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACE,CAAAb,EAAA,CAAA,kDAID,CAAA,CAAA,CAAA,CAAA,QACC,CACG,CAAA,EAAAE,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAS,CAAO,CAAA,CAAA,CAAAK,GAAA,CAAAM,KAAA,CAAA,CAAA,QAAiB,CAAA,CAAA,CAAA,CACjC,CAAA,MAAOJ,CAAAA,OAAa,CAAA,EAAA,UAA+BA,CACtD,CAAA,CAEJ,CAEJ,CAEAK,CAAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQC,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport { CheckboxIndeterminate, CheckboxSelected } from '@accelint/icons';\nimport 'client-only';\nimport { cva } from 'cva';\nimport type React from 'react';\nimport {\n Checkbox as AriaCheckbox,\n CheckboxGroup as AriaCheckboxGroup,\n type CheckboxGroupProps as AriaCheckboxGroupProps,\n type CheckboxProps as AriaCheckboxProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\n\nconst checkboxStyles = cva(\n 'fg-inverse-light size-l rounded-small outline outline-interactive',\n {\n variants: {\n isIndeterminate: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isSelected: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isHovered: {\n true: 'outline-interactive-hover',\n },\n isFocused: {\n true: 'outline-interactive-hover',\n },\n isDisabled: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n isReadOnly: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isDisabled: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n ],\n defaultVariants: {\n isIndeterminate: false,\n isSelected: false,\n },\n },\n);\n\n/**\n * This is a checkbox.\n */\nexport interface CheckboxProps extends AriaCheckboxProps {}\n\nexport function Checkbox({ className, children, ...args }: CheckboxProps) {\n return (\n <AriaCheckbox\n {...args}\n className={cn(\n 'fg-default-light flex items-center gap-m text-body-s disabled:text-interactive-disabled',\n className,\n )}\n >\n {({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }) => (\n <>\n <div\n className={cn(\n checkboxStyles({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }),\n )}\n aria-hidden\n >\n {isIndeterminate && !isSelected && <CheckboxIndeterminate />}\n {isSelected && !isIndeterminate && <CheckboxSelected />}\n </div>\n {children}\n </>\n )}\n </AriaCheckbox>\n );\n}\n\nexport interface CheckboxGroupProps extends AriaCheckboxGroupProps {\n // children: React.JSX.Element;\n label?: string | React.JSX.Element;\n}\n\nfunction CheckboxGroup({\n children,\n className,\n label,\n ...props\n}: CheckboxGroupProps) {\n return (\n <AriaCheckboxGroup\n {...props}\n className={cn(\n 'fg-default-light flex flex-col gap-m text-body-s',\n className,\n )}\n >\n {(props) => (\n <>\n {label ? <Label>{label}</Label> : undefined}\n {typeof children === 'function' ? children(props) : children}\n </>\n )}\n </AriaCheckboxGroup>\n );\n}\n\nCheckbox.Group = CheckboxGroup;\n"]}
|
@@ -1,57 +1,34 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import * as
|
3
|
-
import {
|
4
|
-
import
|
5
|
-
import
|
2
|
+
import * as react from 'react';
|
3
|
+
import { ContextValue } from 'react-aria-components';
|
4
|
+
import { ChipProps, ChipProviderProps, ChipListProps, DeletableChipProps, SelectableChipProps, BaseChipProps } from './types.js';
|
5
|
+
import 'tailwind-variants';
|
6
|
+
import './styles.js';
|
6
7
|
|
7
|
-
declare const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
interface ChipProps extends VariantProps<typeof chipStyles>, Omit<React__default.HTMLProps<HTMLSpanElement>, 'children' | 'size'> {
|
12
|
-
className?: string;
|
13
|
-
/** Used to add text to the badge, such as the number of unread notifications. */
|
14
|
-
children?: ReactNode;
|
15
|
-
}
|
16
|
-
declare const Chip: {
|
17
|
-
({ className, size, variant, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
18
|
-
displayName: string;
|
19
|
-
as(props: VariantProps<typeof chipStyles>, className?: string | string[]): string;
|
20
|
-
List: typeof ChipList;
|
21
|
-
Selectable: {
|
22
|
-
({ className, isDisabled, size, ...props }: SelectableChipProps): react_jsx_runtime.JSX.Element;
|
23
|
-
displayName: string;
|
24
|
-
};
|
25
|
-
Deletable: {
|
26
|
-
({ children, className, isDisabled, size, textValue, ...props }: DeletableChipProps): react_jsx_runtime.JSX.Element;
|
27
|
-
displayName: string;
|
28
|
-
};
|
29
|
-
};
|
30
|
-
interface ChipListProps<T> extends Omit<TagGroupProps, 'children'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'> {
|
8
|
+
declare const ChipContext: react.Context<ContextValue<BaseChipProps, HTMLDivElement>>;
|
9
|
+
declare function ChipProvider({ children, ...props }: ChipProviderProps): react_jsx_runtime.JSX.Element;
|
10
|
+
declare namespace ChipProvider {
|
11
|
+
var displayName: string;
|
31
12
|
}
|
32
|
-
declare function ChipList<T extends object>({
|
13
|
+
declare function ChipList<T extends object>({ ref, ...props }: ChipListProps<T>): react_jsx_runtime.JSX.Element;
|
33
14
|
declare namespace ChipList {
|
34
15
|
var displayName: string;
|
35
16
|
}
|
36
|
-
declare
|
37
|
-
|
38
|
-
|
39
|
-
}
|
40
|
-
|
17
|
+
declare function SelectableChip({ ref, ...props }: SelectableChipProps): react_jsx_runtime.JSX.Element;
|
18
|
+
declare namespace SelectableChip {
|
19
|
+
var displayName: string;
|
20
|
+
}
|
21
|
+
declare function DeletableChip({ ref, ...props }: DeletableChipProps): react_jsx_runtime.JSX.Element;
|
22
|
+
declare namespace DeletableChip {
|
23
|
+
var displayName: string;
|
41
24
|
}
|
42
|
-
declare
|
43
|
-
|
44
|
-
displayName: string;
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
} & cva_types.ClassProp) | undefined) => string;
|
50
|
-
interface DeletableChipProps extends VariantProps<typeof deletableChipStyles>, Omit<TagProps, 'isDisabled'> {
|
25
|
+
declare function Chip({ ref, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
26
|
+
declare namespace Chip {
|
27
|
+
var displayName: string;
|
28
|
+
var Provider: typeof ChipProvider;
|
29
|
+
var List: typeof ChipList;
|
30
|
+
var Deletable: typeof DeletableChip;
|
31
|
+
var Selectable: typeof SelectableChip;
|
51
32
|
}
|
52
|
-
declare const DeletableChip: {
|
53
|
-
({ children, className, isDisabled, size, textValue, ...props }: DeletableChipProps): react_jsx_runtime.JSX.Element;
|
54
|
-
displayName: string;
|
55
|
-
};
|
56
33
|
|
57
|
-
export { Chip,
|
34
|
+
export { Chip, ChipContext };
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import'client-only';import {CancelFill}from'@accelint/icons';import {createContext,useContext}from'react';import {useContextProps,Tag,TagGroup,TagList,composeRenderProps,Button}from'react-aria-components';import {Icon}from'../icon/index.js';import {SelectableChipStyles,DeletableChipStyles,ChipStyles,ChipStylesDefaults}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var c=createContext(null);function v({children:e,...t}){return jsx(c.Provider,{value:t,children:e})}v.displayName="Chip.Provider";var y=createContext(false);function N({ref:e,...t}){[t,e]=useContextProps(t,e??null,c);let{children:s,className:a,dependencies:r,items:o,renderEmptyState:n,size:l=ChipStylesDefaults.size,...m}=t;return jsx(y.Provider,{value:true,children:jsx(v,{size:l,children:jsx(TagGroup,{...m,children:jsx(TagList,{ref:e,className:composeRenderProps(a,d=>I({className:d})),dependencies:r,items:o,renderEmptyState:n,children:s})})})})}N.displayName="Chip.List";var{chip:R}=SelectableChipStyles();function f({ref:e,...t}){[t,e]=useContextProps(t,e??null,c);let{className:s,size:a,...r}=t;return jsx(Tag,{...r,ref:e,className:composeRenderProps(s,o=>R({className:o,size:a}))})}f.displayName="Chip.Selectable";var{chip:V,remove:G}=DeletableChipStyles();function T({ref:e,...t}){[t,e]=useContextProps(t,e??null,c);let{children:s,classNames:a,size:r,textValue:o=typeof s=="string"?s:void 0,...n}=t;return jsx(Tag,{...n,ref:e,className:composeRenderProps(a?.chip,l=>V({className:l,size:r})),textValue:o,children:composeRenderProps(s,(l,{allowsRemoving:m})=>{if(!m)throw new Error("You have a <Chip.Deletable> in a <Chip.List> that does not specify an onRemove handler.");return jsxs(Fragment,{children:[l,jsx(Button,{slot:"remove",className:composeRenderProps(a?.remove,d=>G({className:d})),children:jsx(Icon,{size:"small",children:jsx(CancelFill,{})})})]})})})}T.displayName="Chip.Deletable";var{list:I,chip:w}=ChipStyles();function C({ref:e,...t}){[t,e]=useContextProps(t,e??null,c);let a=useContext(y)?Tag:"div",{className:r,size:o=ChipStylesDefaults.size,variant:n=ChipStylesDefaults.variant,...l}=t;return jsx(Icon.Provider,{size:o==="medium"?"small":"xsmall",children:jsx(a,{...l,ref:e,className:w({size:o,variant:n,className:r})})})}C.displayName="Chip";C.Provider=v;C.List=N;C.Deletable=T;C.Selectable=f;export{C as Chip,c as ChipContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/chip/index.tsx"],"names":["p","s","Chip","P","size","variant","Component","useContext","Coordinator","AriaTag","jsx","i","u","props","className","cn","chipStyles","items","T","S","ChipList","selectableChipStyles","cva","d","SelectableChip","deletableChipStyles","internalTextValue","textValue","children","allowsRemoving","jsxs","V","D","Button","L","v","DeletableChip"],"mappings":"4TAgCI,IAAA,CAAA,CAAAA,GAAA,CAAAC,EAAA,CAAA,CAAA,iGAGA,CAAA,CAAA,CAAA,CAAA,UACW,OACP,CAAA,CAAA,mDACA,CAAA,QAAU,CAAA,sCACD,OAAA,CAAA,mCACD,CAAA,MAAA,CAAA,iCACF,CAAA,IAAA,CAAA,kCAGN,CAAA,CAAA,IAAA,CAAQ,CAAA,MAAA,CAAA,wBACD,CAAA,KAAA,CAAA,yBAGX,CAAA,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,QACN,CAAS,OAEb,CACF,MAckC,CAAA,CAAK,CAAA,CAE1BC,EAAOC,aAAC,CACnB,KAAA,CAAA,CAAA,CAAA,CAAA,CA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CAAA,CAAA,CAAA,CAAA,UACAG,CAAAA,CACA,CAAA,IAAA,CAAA,CAAA,CAAA,SAGJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SAGC,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,QAAG,CAAA,CAAA,CAAA,iBAA+B,GACjC,CAAI,CAACyB,GACH,CAAA,GAAA,CAAM,CAAA,CAAA,UACJ,KAAA,CAAA,qFAKFC,CAAAA,OACGC,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAA,CAAOJ,CAAAA,OAAa,CAAA,EAAA,UACN,CAAA,CAAA,CAAA,CAAA,cAA0B,CAAA,CACrCA,CAAAA,GACHK,EAAA,CACC,CAAA,CAAA,CAAAtB,GAAA,CAAKuB,MAAA,CAAA,CAAA,IAAA,CAAA,QACL,CAAA,8GAGI,CAAA,CAAA,EAAA,4DAGJ,CAAA,CAAA,CAAA,QAAM,CAAAvB,GAAA,CAAKC,IAAA,CAAA,CAAA,IAAA,CACT,OAAA,CAAA,QAAY,CACdD,GAAA,CACFwB,UAAA,CAAA,EAGN,CAAA,CACF,CAEJ,EACAC,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,WAAc,CAAA,gBACvB,CAAA,CAAA,CAAA,SAAYA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport { CancelFill } from '@accelint/icons';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport type React from 'react';\nimport { type ReactNode, createContext, useContext } from 'react';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n type TagGroupProps as AriaTagGroupProps,\n TagList as AriaTagList,\n type TagListProps as AriaTagListProps,\n type TagProps as AriaTagProps,\n Button,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\n\nconst chipStyles = cva(\n cn([\n 'fg-default-light inline-flex w-content items-center justify-center gap-xxs rounded-full outline',\n ]),\n {\n variants: {\n variant: {\n advisory: 'bg-advisory-subtle outline-advisory-bold',\n critical: 'bg-critical-subtle outline-critical',\n serious: 'bg-serious-subtle outline-serious',\n normal: 'bg-normal-subtle outline-normal',\n info: 'bg-info-subtle outline-info-bold',\n },\n size: {\n medium: 'px-s py-xs text-body-s',\n small: 'px-s py-xs text-body-xs',\n },\n },\n defaultVariants: {\n size: 'medium',\n variant: 'info',\n },\n },\n);\n\nexport interface ChipProps\n extends VariantProps<typeof chipStyles>,\n Omit<React.HTMLProps<HTMLSpanElement>, 'children' | 'size'> {\n className?: string;\n /** Used to add text to the badge, such as the number of unread notifications. */\n children?: ReactNode;\n}\n\n// This coordinator is used as a way for the `<Chip>` component to understand\n// whether or not it is being rendered inside of a `<Chip.List>`. This allows\n// us to opt-into using an `<AriaTag>` or a `<span>` to ensure standalone\n// functionality.\nconst Coordinator = createContext(false);\n\nexport const Chip = ({\n className,\n size = 'medium',\n variant = 'info',\n ...props\n}: ChipProps) => {\n const context = useContext(Coordinator);\n\n // If any context was returned from the `Coordinator` context, then\n // we are being rendered inside of a `Chip.List` and need to render\n // an `<AriaTag>`.\n const Component = context ? AriaTag : 'span';\n\n return (\n <Icon.Provider size={size === 'medium' ? 'small' : 'xsmall'}>\n <Component\n className={cn(\n chipStyles({\n size,\n variant,\n className,\n }),\n )}\n {...props}\n />\n </Icon.Provider>\n );\n};\nChip.displayName = 'Chip';\nChip.as = (\n props: VariantProps<typeof chipStyles>,\n className?: string | string[],\n) => cn(chipStyles({ ...props, className }));\n\nexport interface ChipListProps<T>\n extends Omit<AriaTagGroupProps, 'children'>,\n Pick<AriaTagListProps<T>, 'items' | 'children' | 'renderEmptyState'> {}\n\nfunction ChipList<T extends object>({\n children,\n className,\n items,\n renderEmptyState,\n ...props\n}: ChipListProps<T>) {\n return (\n <Coordinator.Provider value={true}>\n <AriaTagGroup {...props}>\n <AriaTagList<T>\n items={items}\n renderEmptyState={renderEmptyState}\n className={cn('flex flex-wrap gap-xs', className)}\n >\n {children}\n </AriaTagList>\n </AriaTagGroup>\n </Coordinator.Provider>\n );\n}\nChipList.displayName = 'Chip.List';\nChip.List = ChipList;\n\nconst selectableChipStyles = cva(\n cn([\n 'fg-default-light inline-flex w-content items-center justify-center rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n 'dtk-selected:bg-highlight-subtle dtk-selected:outline-highlight',\n ]),\n {\n variants: {\n isDisabled: {\n true: 'fg-disabled dtk-selected:bg-transparent dtk-selected:outline-interactive-disabled outline-interactive-disabled hover:outline-interactive-disabled focus:outline-interactive-disabled',\n false: 'cursor-pointer',\n },\n size: {\n medium: 'px-s py-xs text-body-s',\n small: 'px-s py-xs text-body-xs',\n },\n },\n defaultVariants: {\n isDisabled: false,\n size: 'medium',\n },\n },\n);\n\ninterface SelectableChipProps\n extends VariantProps<typeof selectableChipStyles>,\n Omit<AriaTagProps, 'isDisabled'> {}\n\nexport const SelectableChip = ({\n className,\n isDisabled = false,\n size = 'medium',\n ...props\n}: SelectableChipProps) => (\n <AriaTag\n className={cn(\n selectableChipStyles({\n isDisabled,\n size,\n className,\n }),\n )}\n {...props}\n />\n);\nSelectableChip.displayName = 'Chip.Selectable';\nChip.Selectable = SelectableChip;\n\nconst deletableChipStyles = cva(\n cn([\n 'fg-default-light group inline-flex w-content items-center justify-center gap-xs rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n ]),\n {\n variants: {\n isDisabled: {\n true: 'fg-disabled outline-interactive-disabled hover:outline-interactive-disabled',\n false: '',\n },\n size: {\n medium: 'p-xs pl-m text-body-s',\n small: 'p-xs pl-s text-body-xs',\n },\n },\n defaultVariants: {\n isDisabled: false,\n size: 'medium',\n },\n },\n);\n\ninterface DeletableChipProps\n extends VariantProps<typeof deletableChipStyles>,\n Omit<AriaTagProps, 'isDisabled'> {}\n\nexport const DeletableChip = ({\n children,\n className,\n isDisabled = false,\n size = 'medium',\n textValue,\n ...props\n}: DeletableChipProps) => {\n const internalTextValue =\n textValue ?? (typeof children === 'string' ? children : undefined);\n\n return (\n <AriaTag\n className={cn(\n deletableChipStyles({\n isDisabled,\n size,\n className,\n }),\n )}\n textValue={internalTextValue}\n {...props}\n >\n {({ allowsRemoving, ...props }) => {\n if (!allowsRemoving) {\n throw new Error(\n 'You have a <Chip.Deletable> in a <Chip.List> does not specify an onRemove handler.',\n );\n }\n\n return (\n <>\n {typeof children === 'function'\n ? children({ allowsRemoving, ...props })\n : children}\n <Button\n slot='remove'\n className={cn([\n 'icon-default-dark group-hover:icon-default-light group-focus:icon-default-light cursor-pointer',\n isDisabled &&\n 'icon-disabled group-hover:icon-disabled cursor-not-allowed',\n ])}\n >\n <Icon size='small'>\n <CancelFill />\n </Icon>\n </Button>\n </>\n );\n }}\n </AriaTag>\n );\n};\nDeletableChip.displayName = 'Chip.Deletable';\nChip.Deletable = DeletableChip;\n"]}
|
1
|
+
{"version":3,"sources":["../../../src/components/chip/index.tsx"],"names":["ChipContext","createContext","b","props","children","ChipProvider","ref","useContextProps","className","dependencies","items","renderEmptyState","size","ChipStylesDefaults","u","ChipListRenderingContext","jsx","AriaTagGroup","S","AriaTagList","z","composeRenderProps","list","ChipList","SelectableChipStyles","E","AriaTag","P","selectableChip","SelectableChip","deletableChip","DeletableChipStyles","B","textValue","classNames","allowsRemoving","Fragment","F","Button","D","remove","Icon","x","CancelFill","g","DeletableChip","ChipStyles","A","useContext","variant","Component","chip","Chip"],"mappings":"oYAyCaA,IACXC,CAAAA,CAA2DC,aAAA,CAAA,IAE7D,EAAA,SAAsB,CAAE,C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,CAAAA,CAAAA,GAAS,QAAW,CAAA,OAAU,CAAA,QACjD,CAAA,QAAAI,CAACkC,GAAAA,CAAA,CACE,CAAA,CAAA,GACD,CAAA,CAAA,IACA,CAAA,CAAA,SAAWC,CAAK,CAAE,CAAA,CAAA,IAAAvC,CAAM,CAAA,CAAA,OAAAqC,CAAS,CAAA,CAAA,SAAU,CAAC,CAAA,CAC9C,CAAA,CACF,CAEJ,CACAG,EAAK,CAAA,CAAA,WAAc,CAAA,MACnBA,CAAK,CAAA,CAAA,QAAW/C,CAChB+C,CAAAA,CAAK,CAAA,CAAA,IAAO7B,CACZ6B,CAAAA,CAAK,CAAA,CAAA,SAAYP,CACjBO,CAAAA,CAAK,CAAA,CAAA,UAAavB,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { CancelFill } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagList as AriaTagList,\n Button,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport {\n ChipStyles,\n ChipStylesDefaults,\n DeletableChipStyles,\n SelectableChipStyles,\n} from './styles';\nimport type {\n BaseChipProps,\n ChipListProps,\n ChipProps,\n ChipProviderProps,\n DeletableChipProps,\n SelectableChipProps,\n} from './types';\n\nexport const ChipContext =\n createContext<ContextValue<BaseChipProps, HTMLDivElement>>(null);\n\nfunction ChipProvider({ children, ...props }: ChipProviderProps) {\n return <ChipContext.Provider value={props}>{children}</ChipContext.Provider>;\n}\nChipProvider.displayName = 'Chip.Provider';\n\nconst ChipListRenderingContext = createContext(false);\n\nfunction ChipList<T extends object>({ ref, ...props }: ChipListProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, ChipContext);\n\n const {\n children,\n className,\n dependencies,\n items,\n renderEmptyState,\n size = ChipStylesDefaults.size,\n ...rest\n } = props;\n\n return (\n <ChipListRenderingContext.Provider value>\n <ChipProvider size={size}>\n <AriaTagGroup {...rest}>\n <AriaTagList<T>\n ref={ref}\n className={composeRenderProps(className, (className) =>\n list({ className }),\n )}\n dependencies={dependencies}\n items={items}\n renderEmptyState={renderEmptyState}\n >\n {children}\n </AriaTagList>\n </AriaTagGroup>\n </ChipProvider>\n </ChipListRenderingContext.Provider>\n );\n}\nChipList.displayName = 'Chip.List';\n\nconst { chip: selectableChip } = SelectableChipStyles();\n\nfunction SelectableChip({ ref, ...props }: SelectableChipProps) {\n [props, ref] = useContextProps(props, ref ?? null, ChipContext);\n\n const { className, size, ...rest } = props;\n\n return (\n <AriaTag\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n selectableChip({ className, size }),\n )}\n />\n );\n}\nSelectableChip.displayName = 'Chip.Selectable';\n\nconst { chip: deletableChip, remove } = DeletableChipStyles();\n\nfunction DeletableChip({ ref, ...props }: DeletableChipProps) {\n [props, ref] = useContextProps(props, ref ?? null, ChipContext);\n\n const {\n children,\n classNames,\n size,\n textValue = typeof children === 'string' ? children : undefined,\n ...rest\n } = props;\n\n return (\n <AriaTag\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.chip, (className) =>\n deletableChip({ className, size }),\n )}\n textValue={textValue}\n >\n {composeRenderProps(children, (children, { allowsRemoving }) => {\n if (!allowsRemoving) {\n throw new Error(\n 'You have a <Chip.Deletable> in a <Chip.List> that does not specify an onRemove handler.',\n );\n }\n\n return (\n <>\n {children}\n <Button\n slot='remove'\n className={composeRenderProps(classNames?.remove, (className) =>\n remove({ className }),\n )}\n >\n <Icon size='small'>\n <CancelFill />\n </Icon>\n </Button>\n </>\n );\n })}\n </AriaTag>\n );\n}\nDeletableChip.displayName = 'Chip.Deletable';\n\nconst { list, chip } = ChipStyles();\n\nexport function Chip({ ref, ...props }: ChipProps) {\n [props, ref] = useContextProps(props, ref ?? null, ChipContext);\n\n const context = useContext(ChipListRenderingContext);\n const Component = context ? AriaTag : 'div';\n const {\n className,\n size = ChipStylesDefaults.size,\n variant = ChipStylesDefaults.variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size === 'medium' ? 'small' : 'xsmall'}>\n <Component\n {...rest}\n ref={ref}\n className={chip({ size, variant, className })}\n />\n </Icon.Provider>\n );\n}\nChip.displayName = 'Chip';\nChip.Provider = ChipProvider;\nChip.List = ChipList;\nChip.Deletable = DeletableChip;\nChip.Selectable = SelectableChip;\n"]}
|