Skip to content

Commit fded58e

Browse files
committed
feat(select): 🎨 add select and select option theme
1 parent 299f3ae commit fded58e

File tree

2 files changed

+259
-5
lines changed

2 files changed

+259
-5
lines changed

src/theme/defaultTheme/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { input } from "./input";
88
import { meter } from "./meter";
99
import { progress } from "./progress";
1010
import { radio } from "./radio";
11-
import { select } from "./select";
11+
import { select, selectOption } from "./select";
1212
import { slider } from "./slider";
1313
import { spinner } from "./spinner";
1414
import { switchTheme } from "./switch";
@@ -32,6 +32,7 @@ const extendedTheme = {
3232
radio,
3333
meter,
3434
divider,
35+
selectOption,
3536
};
3637

3738
export default extendedTheme;

src/theme/defaultTheme/select.ts

Lines changed: 257 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const select = {
6060
},
6161
variant: {
6262
outline: {
63-
common: "bg-white border border-gray-200",
63+
common: "bg-white-900 border border-gray-200",
6464
interactions:
6565
"active:border-gray-400 focus-visible:border-gray-400 focus-visible:ring-2 focus-visible:ring-gray-200",
6666
pressedOrHovered: "shadow-sm border-gray-300",
@@ -77,18 +77,18 @@ export const select = {
7777
},
7878
underline: {
7979
common:
80-
"px-0.5 bg-white rounded-none text-gray-700 border-b border-gray-200",
80+
"px-0.5 bg-white-900 rounded-none text-gray-700 border-b border-gray-200",
8181
interactions: "active:shadow-gray-400 focus-visible:shadow-gray-400",
8282
pressedOrHovered: "shadow-sm shadow-gray-300 border-gray-300",
8383
disabled: "placeholder:text-gray-400 shadow-gray-200",
8484
invalid: "border-red-300",
8585
},
8686
ghost: {
87-
common: "bg-white text-gray-700",
87+
common: "bg-white-900 text-gray-700",
8888
interactions:
8989
"active:bg-gray-100 active:placeholder:text-gray-500 focus-visible:bg-gray-100 focus-visible:placeholder:text-gray-500",
9090
pressedOrHovered: "bg-gray-100",
91-
disabled: "bg-white",
91+
disabled: "bg-white-900",
9292
invalid: "bg-red-50",
9393
},
9494
},
@@ -190,3 +190,256 @@ export const select = {
190190
},
191191
},
192192
};
193+
194+
export const selectOption = {
195+
size: {
196+
sm: {
197+
label: {
198+
wrapper: "min-h-[26px] px-2 py-[6px] rounded-lg",
199+
},
200+
icon: {
201+
wrapper: "w-3.5 h-3.5 rounded-full",
202+
innerCircle: {
203+
default: "w-1.5 h-1.5 rounded-full",
204+
},
205+
},
206+
text: {
207+
default: "text-cxs",
208+
lineHeight: 14.5,
209+
},
210+
description: {
211+
default: "text-cxs mt-1",
212+
},
213+
},
214+
md: {
215+
label: {
216+
wrapper: "min-h-[30px] px-2.5 py-[7px] rounded-lg",
217+
},
218+
icon: {
219+
wrapper: "w-4 h-4 rounded-full",
220+
innerCircle: {
221+
default: "w-1.5 h-1.5 rounded-full",
222+
},
223+
},
224+
text: {
225+
default: "text-sm",
226+
lineHeight: 16,
227+
},
228+
description: {
229+
default: "text-sm mt-1",
230+
},
231+
},
232+
lg: {
233+
label: {
234+
wrapper: "min-h-9 px-3 py-2 rounded-[10px]",
235+
},
236+
icon: {
237+
wrapper: "w-5 h-5 rounded-full",
238+
innerCircle: {
239+
default: "w-2 h-2 rounded-full",
240+
},
241+
},
242+
text: {
243+
default: "text-base",
244+
lineHeight: 20,
245+
},
246+
description: {
247+
default: "text-sm mt-1.5",
248+
},
249+
},
250+
xl: {
251+
label: {
252+
wrapper: "min-h-9 px-3 py-2 rounded-[10px]",
253+
},
254+
icon: {
255+
wrapper: "w-5 h-5 rounded-full",
256+
innerCircle: {
257+
default: "w-2 h-2 rounded-full",
258+
},
259+
},
260+
text: {
261+
default: "text-base",
262+
lineHeight: 20,
263+
},
264+
description: {
265+
default: "text-sm mt-1.5",
266+
},
267+
},
268+
},
269+
270+
themeColor: {
271+
base: {
272+
label: {
273+
default: "bg-transparent",
274+
hover: "bg-gray-200",
275+
pressed: "bg-gray-300",
276+
focus: {
277+
offset: 3,
278+
color: "bg-gray-500",
279+
backgroundColor: "bg-gray-100",
280+
},
281+
},
282+
icon: {
283+
unChecked: {
284+
default: "bg-white-900 border-gray-500",
285+
hover: "border-gray-600 shadow shadow-color-opacity-10",
286+
press: "border-gray-600 bg-gray-300",
287+
disabled: "bg-gray-100 border-gray-400",
288+
focus: {
289+
default: "border-white-900",
290+
boxShadow: {
291+
offset: 3,
292+
color: "bg-gray-600",
293+
},
294+
},
295+
},
296+
checked: {
297+
default: "bg-gray-900 border-gray-900",
298+
hover: "bg-gray-800 border-gray-800 shadow shadow-color-opacity-10",
299+
press: "bg-gray-700 border-gray-700",
300+
disabled: "bg-gray-200 border-gray-200",
301+
focus: {
302+
default: "border-gray-900",
303+
boxShadow: {
304+
offset: 3,
305+
color: "bg-gray-500",
306+
},
307+
},
308+
},
309+
},
310+
innerCircle: {
311+
unChecked: {
312+
default: "bg-white-900",
313+
disabled: "bg-gray-100",
314+
press: "bg-gray-300",
315+
},
316+
checked: {
317+
default: "bg-white-900",
318+
disabled: "bg-gray-500",
319+
press: "bg-white-900",
320+
},
321+
},
322+
},
323+
primary: {
324+
label: {
325+
default: "bg-transparent",
326+
hover: "bg-blue-200",
327+
pressed: "bg-blue-300",
328+
focus: {
329+
offset: 3,
330+
color: "bg-blue-500",
331+
backgroundColor: "bg-blue-100",
332+
},
333+
},
334+
icon: {
335+
unChecked: {
336+
default: "bg-white-900 border-blue-500",
337+
hover: "border-blue-500 shadow shadow-color-opacity-10",
338+
press: "border-blue-500 bg-blue-300",
339+
disabled: "bg-blue-100 border-blue-400",
340+
focus: {
341+
default: "bg-white-900",
342+
boxShadow: {
343+
offset: 3,
344+
color: "bg-blue-500",
345+
},
346+
},
347+
},
348+
checked: {
349+
default: "bg-blue-600 border-blue-600",
350+
hover: "bg-blue-700 border-blue-700 shadow shadow-color-opacity-10",
351+
press: "bg-blue-800 border-blue-800",
352+
disabled: "bg-blue-100 border-blue-100",
353+
focus: {
354+
default: "border-blue-600",
355+
boxShadow: {
356+
offset: 3,
357+
color: "bg-blue-500",
358+
},
359+
},
360+
},
361+
},
362+
innerCircle: {
363+
unChecked: {
364+
default: "bg-white-900",
365+
disabled: "bg-blue-100",
366+
press: " bg-blue-300",
367+
},
368+
checked: {
369+
default: "bg-white-900",
370+
disabled: "bg-blue-500",
371+
press: "bg-white-900",
372+
},
373+
},
374+
},
375+
danger: {
376+
label: {
377+
default: "bg-transparent",
378+
hover: "bg-red-200",
379+
pressed: "bg-red-300",
380+
focus: {
381+
offset: 3,
382+
color: "bg-red-500",
383+
backgroundColor: "bg-red-100",
384+
},
385+
},
386+
icon: {
387+
unChecked: {
388+
default: "bg-white-900 border-red-500",
389+
hover: "border-red-500 shadow shadow-color-opacity-10",
390+
press: "border-red-500 bg-red-300",
391+
disabled: "bg-red-100 border-red-400",
392+
focus: {
393+
default: "bg-white-900",
394+
boxShadow: {
395+
offset: 3,
396+
color: "bg-red-500",
397+
},
398+
},
399+
},
400+
checked: {
401+
default: "bg-red-600 border-red-600",
402+
hover: "bg-red-700 border-red-700 shadow shadow-color-opacity-10",
403+
press: "bg-red-800 border-red-800",
404+
disabled: "bg-red-100 border-red-100",
405+
focus: {
406+
default: "border-red-600",
407+
boxShadow: {
408+
offset: 3,
409+
color: "bg-red-500",
410+
},
411+
},
412+
},
413+
},
414+
innerCircle: {
415+
unChecked: {
416+
default: "bg-white-900",
417+
disabled: "bg-red-100",
418+
press: "bg-red-300",
419+
},
420+
checked: {
421+
default: "bg-white-900",
422+
disabled: "bg-red-500",
423+
press: "bg-white-900",
424+
},
425+
},
426+
},
427+
},
428+
429+
label: {
430+
common: "relative flex-row items-center justify-between",
431+
withDescription: "items-start",
432+
text: {
433+
common: "text-gray-800 font-medium",
434+
disabled: "text-gray-500",
435+
},
436+
},
437+
icon: {
438+
common: "flex items-center justify-center border-[1.5px]",
439+
},
440+
labelDescWrapper: { flexShrink: 1 },
441+
description: {
442+
labelText: "text-gray-900 font-medium",
443+
common: "text-gray-600",
444+
},
445+
};

0 commit comments

Comments
 (0)