@byyuurin/ui 0.0.6 → 0.0.8

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.
Files changed (198) hide show
  1. package/README.md +4 -5
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.json +12 -0
  4. package/dist/{nuxt.mjs → module.mjs} +8 -8
  5. package/dist/module.mjs.map +1 -0
  6. package/dist/runtime/app/injections.d.ts +16 -0
  7. package/dist/runtime/app/injections.js +31 -0
  8. package/dist/runtime/components/Accordion.vue +27 -38
  9. package/dist/runtime/components/Alert.vue +23 -16
  10. package/dist/runtime/components/App.vue +15 -15
  11. package/dist/runtime/components/Avatar.vue +73 -0
  12. package/dist/runtime/components/AvatarGroup.vue +90 -0
  13. package/dist/runtime/components/Badge.vue +15 -10
  14. package/dist/runtime/components/Breadcrumb.vue +105 -0
  15. package/dist/runtime/components/Button.vue +22 -23
  16. package/dist/runtime/components/ButtonGroup.vue +12 -10
  17. package/dist/runtime/components/Card.vue +16 -8
  18. package/dist/runtime/components/Carousel.vue +19 -12
  19. package/dist/runtime/components/Checkbox.vue +16 -12
  20. package/dist/runtime/components/Chip.vue +17 -12
  21. package/dist/runtime/components/Collapsible.vue +56 -0
  22. package/dist/runtime/components/Drawer.vue +18 -17
  23. package/dist/runtime/components/Input.vue +28 -28
  24. package/dist/runtime/components/InputNumber.vue +169 -0
  25. package/dist/runtime/components/Kbd.vue +51 -0
  26. package/dist/runtime/components/Link.vue +301 -72
  27. package/dist/runtime/components/LinkBase.vue +88 -0
  28. package/dist/runtime/components/Modal.vue +11 -9
  29. package/dist/runtime/components/ModalProvider.vue +2 -1
  30. package/dist/runtime/components/Pagination.vue +30 -30
  31. package/dist/runtime/components/PinInput.vue +7 -7
  32. package/dist/runtime/components/Popover.vue +7 -7
  33. package/dist/runtime/components/Progress.vue +165 -0
  34. package/dist/runtime/components/RadioGroup.vue +33 -29
  35. package/dist/runtime/components/Select.vue +40 -40
  36. package/dist/runtime/components/Separator.vue +63 -0
  37. package/dist/runtime/components/Skeleton.vue +33 -0
  38. package/dist/runtime/components/Slider.vue +6 -6
  39. package/dist/runtime/components/Switch.vue +14 -15
  40. package/dist/runtime/components/Table.vue +300 -0
  41. package/dist/runtime/components/Tabs.vue +25 -21
  42. package/dist/runtime/components/Textarea.vue +11 -11
  43. package/dist/runtime/components/Toast.vue +15 -14
  44. package/dist/runtime/components/Toaster.vue +5 -39
  45. package/dist/runtime/components/Tooltip.vue +7 -7
  46. package/dist/runtime/composables/useAvatarGroup.d.ts +4 -0
  47. package/dist/runtime/composables/useAvatarGroup.js +8 -0
  48. package/dist/runtime/composables/useButtonGroup.d.ts +4 -12
  49. package/dist/runtime/composables/{useButtonGroup.mjs → useButtonGroup.js} +1 -6
  50. package/dist/runtime/composables/useComponentIcons.d.ts +9 -9
  51. package/dist/runtime/composables/useComponentIcons.js +24 -0
  52. package/dist/runtime/composables/useKbd.d.ts +35 -0
  53. package/dist/runtime/composables/useKbd.js +49 -0
  54. package/dist/runtime/composables/useLocale.d.ts +8 -0
  55. package/dist/runtime/composables/useLocale.js +22 -0
  56. package/dist/runtime/composables/useModal.d.ts +2 -7
  57. package/dist/runtime/composables/{useModal.mjs → useModal.js} +1 -6
  58. package/dist/runtime/composables/useTheme.d.ts +2 -6
  59. package/dist/runtime/composables/useTheme.js +16 -0
  60. package/dist/runtime/composables/useToast.d.ts +1 -1
  61. package/dist/runtime/index.d.ts +40 -0
  62. package/dist/runtime/index.js +40 -0
  63. package/dist/runtime/locale/en.d.ts +2 -0
  64. package/dist/runtime/locale/en.js +28 -0
  65. package/dist/runtime/locale/index.d.ts +2 -0
  66. package/dist/runtime/locale/index.js +2 -0
  67. package/dist/runtime/locale/zh-tw.d.ts +2 -0
  68. package/dist/runtime/locale/zh-tw.js +28 -0
  69. package/dist/runtime/theme/accordion.d.ts +5 -5
  70. package/dist/runtime/theme/{accordion.mjs → accordion.js} +2 -2
  71. package/dist/runtime/theme/alert.d.ts +2 -2
  72. package/dist/runtime/theme/{alert.mjs → alert.js} +4 -4
  73. package/dist/runtime/theme/app.d.ts +8 -5
  74. package/dist/runtime/theme/app.js +18 -0
  75. package/dist/runtime/theme/avatar-group.d.ts +52 -0
  76. package/dist/runtime/theme/avatar-group.js +32 -0
  77. package/dist/runtime/theme/avatar.d.ts +56 -0
  78. package/dist/runtime/theme/avatar.js +34 -0
  79. package/dist/runtime/theme/badge.d.ts +45 -21
  80. package/dist/runtime/theme/{badge.mjs → badge.js} +2 -2
  81. package/dist/runtime/theme/breadcrumb.d.ts +67 -0
  82. package/dist/runtime/theme/breadcrumb.js +44 -0
  83. package/dist/runtime/theme/button-group.d.ts +2 -2
  84. package/dist/runtime/theme/button.d.ts +61 -115
  85. package/dist/runtime/theme/button.js +164 -0
  86. package/dist/runtime/theme/card.d.ts +38 -38
  87. package/dist/runtime/theme/card.js +37 -0
  88. package/dist/runtime/theme/carousel.d.ts +2 -2
  89. package/dist/runtime/theme/{carousel.mjs → carousel.js} +2 -2
  90. package/dist/runtime/theme/checkbox.d.ts +1 -1
  91. package/dist/runtime/theme/{checkbox.mjs → checkbox.js} +3 -3
  92. package/dist/runtime/theme/chip.d.ts +47 -14
  93. package/dist/runtime/theme/{chip.mjs → chip.js} +7 -9
  94. package/dist/runtime/theme/collapsible.d.ts +38 -0
  95. package/dist/runtime/theme/collapsible.js +10 -0
  96. package/dist/runtime/theme/drawer.d.ts +43 -43
  97. package/dist/runtime/theme/{drawer.mjs → drawer.js} +33 -22
  98. package/dist/runtime/theme/index.d.ts +37 -27
  99. package/dist/runtime/theme/index.js +37 -0
  100. package/dist/runtime/theme/input-number.d.ts +141 -0
  101. package/dist/runtime/theme/input-number.js +95 -0
  102. package/dist/runtime/theme/input.d.ts +77 -105
  103. package/dist/runtime/theme/{input.mjs → input.js} +25 -25
  104. package/dist/runtime/theme/kbd.d.ts +39 -0
  105. package/dist/runtime/theme/kbd.js +26 -0
  106. package/dist/runtime/theme/link.d.ts +2 -2
  107. package/dist/runtime/theme/{link.mjs → link.js} +1 -1
  108. package/dist/runtime/theme/modal.d.ts +31 -8
  109. package/dist/runtime/theme/{modal.mjs → modal.js} +4 -9
  110. package/dist/runtime/theme/pagination.d.ts +17 -17
  111. package/dist/runtime/theme/pinInput.d.ts +42 -42
  112. package/dist/runtime/theme/{pinInput.mjs → pinInput.js} +10 -10
  113. package/dist/runtime/theme/popover.d.ts +8 -8
  114. package/dist/runtime/theme/{popover.mjs → popover.js} +1 -1
  115. package/dist/runtime/theme/progress.d.ts +122 -0
  116. package/dist/runtime/theme/progress.js +95 -0
  117. package/dist/runtime/theme/radio-group.d.ts +1 -1
  118. package/dist/runtime/theme/{radio-group.mjs → radio-group.js} +1 -1
  119. package/dist/runtime/theme/scroll-area.d.ts +17 -17
  120. package/dist/runtime/theme/{scroll-area.mjs → scroll-area.js} +2 -2
  121. package/dist/runtime/theme/select.d.ts +93 -108
  122. package/dist/runtime/theme/{select.mjs → select.js} +31 -31
  123. package/dist/runtime/theme/separator.d.ts +95 -0
  124. package/dist/runtime/theme/separator.js +53 -0
  125. package/dist/runtime/theme/skeleton.d.ts +8 -0
  126. package/dist/runtime/theme/skeleton.js +7 -0
  127. package/dist/runtime/theme/slider.d.ts +1 -1
  128. package/dist/runtime/theme/{slider.mjs → slider.js} +3 -3
  129. package/dist/runtime/theme/switch.d.ts +1 -1
  130. package/dist/runtime/theme/{switch.mjs → switch.js} +3 -3
  131. package/dist/runtime/theme/table.d.ts +89 -0
  132. package/dist/runtime/theme/table.js +35 -0
  133. package/dist/runtime/theme/tabs.d.ts +70 -53
  134. package/dist/runtime/theme/{tabs.mjs → tabs.js} +12 -12
  135. package/dist/runtime/theme/textarea.d.ts +43 -37
  136. package/dist/runtime/theme/{textarea.mjs → textarea.js} +10 -10
  137. package/dist/runtime/theme/toast.d.ts +2 -2
  138. package/dist/runtime/theme/{toast.mjs → toast.js} +3 -3
  139. package/dist/runtime/theme/toaster.d.ts +42 -27
  140. package/dist/runtime/theme/tooltip.d.ts +11 -11
  141. package/dist/runtime/theme/tooltip.js +11 -0
  142. package/dist/runtime/types/components.d.ts +37 -27
  143. package/dist/runtime/types/index.d.ts +5 -4
  144. package/dist/runtime/types/index.js +3 -0
  145. package/dist/runtime/types/locale.d.ts +23 -0
  146. package/dist/runtime/types/locale.js +0 -0
  147. package/dist/runtime/types/utils.d.ts +1 -1
  148. package/dist/runtime/types/utils.js +0 -0
  149. package/dist/runtime/utils/index.d.ts +9 -4
  150. package/dist/runtime/utils/{index.mjs → index.js} +9 -7
  151. package/dist/runtime/utils/link.d.ts +22 -7
  152. package/dist/runtime/utils/link.js +30 -0
  153. package/dist/runtime/utils/styler.d.ts +1 -1
  154. package/dist/runtime/utils/translator.d.ts +18 -0
  155. package/dist/runtime/utils/translator.js +8 -0
  156. package/dist/runtime/vue/stubs.d.ts +9 -0
  157. package/dist/runtime/vue/stubs.js +16 -0
  158. package/dist/shared/ui.ba24b380.mjs +4 -0
  159. package/dist/shared/ui.ba24b380.mjs.map +1 -0
  160. package/dist/types.d.mts +1 -0
  161. package/dist/types.d.ts +1 -0
  162. package/dist/unocss.d.mts +6 -11
  163. package/dist/unocss.d.ts +6 -11
  164. package/dist/unocss.mjs +40 -21
  165. package/dist/unocss.mjs.map +1 -1
  166. package/dist/unplugin.mjs +35 -8
  167. package/dist/unplugin.mjs.map +1 -1
  168. package/dist/vite.d.mts +0 -1
  169. package/dist/vite.d.ts +0 -1
  170. package/dist/vite.mjs +3 -1
  171. package/dist/vite.mjs.map +1 -1
  172. package/package.json +50 -38
  173. package/dist/index.d.ts +0 -29
  174. package/dist/index.mjs +0 -29
  175. package/dist/nuxt.mjs.map +0 -1
  176. package/dist/runtime/composables/useComponentIcons.mjs +0 -24
  177. package/dist/runtime/composables/useTheme.mjs +0 -26
  178. package/dist/runtime/theme/app.mjs +0 -15
  179. package/dist/runtime/theme/button.mjs +0 -148
  180. package/dist/runtime/theme/card.mjs +0 -14
  181. package/dist/runtime/theme/index.mjs +0 -27
  182. package/dist/runtime/theme/tooltip.mjs +0 -11
  183. package/dist/runtime/types/components.mjs +0 -27
  184. package/dist/runtime/types/index.mjs +0 -2
  185. package/dist/runtime/utils/link.mjs +0 -4
  186. package/dist/shared/ui.D4zm1r0C.mjs +0 -4
  187. package/dist/shared/ui.D4zm1r0C.mjs.map +0 -1
  188. /package/dist/{nuxt.d.mts → module.d.mts} +0 -0
  189. /package/dist/{nuxt.d.ts → module.d.ts} +0 -0
  190. /package/dist/runtime/composables/{useToast.mjs → useToast.js} +0 -0
  191. /package/dist/runtime/theme/{button-group.mjs → button-group.js} +0 -0
  192. /package/dist/runtime/theme/{pagination.mjs → pagination.js} +0 -0
  193. /package/dist/runtime/theme/{toaster.mjs → toaster.js} +0 -0
  194. /package/dist/runtime/types/{utils.mjs → components.js} +0 -0
  195. /package/dist/runtime/utils/{extend-theme.mjs → extend-theme.js} +0 -0
  196. /package/dist/runtime/utils/{styler.mjs → styler.js} +0 -0
  197. /package/dist/runtime/{composables/defineInjection.d.ts → utils/vue.d.ts} +0 -0
  198. /package/dist/runtime/{composables/defineInjection.mjs → utils/vue.js} +0 -0
@@ -0,0 +1,56 @@
1
+ declare const _default: {
2
+ base: undefined;
3
+ slots: {
4
+ root: string;
5
+ image: string;
6
+ fallback: string;
7
+ icon: string;
8
+ };
9
+ variants: {
10
+ size: {
11
+ xs: {
12
+ root: string;
13
+ };
14
+ sm: {
15
+ root: string;
16
+ };
17
+ md: {
18
+ root: string;
19
+ };
20
+ lg: {
21
+ root: string;
22
+ };
23
+ xl: {
24
+ root: string;
25
+ };
26
+ };
27
+ };
28
+ compoundVariants: import("@byyuurin/ui-kit").CVCompoundVariants<{
29
+ size: {
30
+ xs: {
31
+ root: string;
32
+ };
33
+ sm: {
34
+ root: string;
35
+ };
36
+ md: {
37
+ root: string;
38
+ };
39
+ lg: {
40
+ root: string;
41
+ };
42
+ xl: {
43
+ root: string;
44
+ };
45
+ };
46
+ }, {
47
+ root: string;
48
+ image: string;
49
+ fallback: string;
50
+ icon: string;
51
+ }, undefined>;
52
+ defaultVariants: {
53
+ size: "md";
54
+ };
55
+ };
56
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import { ct } from "@byyuurin/ui-kit";
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-soft-ui-cb/10",
7
+ image: "size-full rounded-inherit object-cover",
8
+ fallback: "leading-none color-ui-cb/60 truncate",
9
+ icon: "size-3/4 color-ui-cb/60 shrink-0"
10
+ },
11
+ variants: {
12
+ size: {
13
+ xs: {
14
+ root: "text-xs size-1.4em"
15
+ },
16
+ sm: {
17
+ root: "text-sm size-1.6em"
18
+ },
19
+ md: {
20
+ root: "text-base size-2em"
21
+ },
22
+ lg: {
23
+ root: "text-lg size-2.4em"
24
+ },
25
+ xl: {
26
+ root: "text-xl size-3em"
27
+ }
28
+ }
29
+ },
30
+ defaultVariants: {
31
+ size: "md"
32
+ }
33
+ }
34
+ );
@@ -50,31 +50,55 @@ declare const _default: {
50
50
  };
51
51
  };
52
52
  };
53
- compoundVariants: ({
54
- position: "top-right";
55
- inset: false;
56
- class: {
57
- base: string;
53
+ compoundVariants: import("@byyuurin/ui-kit").CVCompoundVariants<{
54
+ size: {
55
+ xs: {
56
+ root: string;
57
+ };
58
+ sm: {
59
+ root: string;
60
+ };
61
+ md: {
62
+ root: string;
63
+ };
64
+ lg: {
65
+ root: string;
66
+ };
67
+ xl: {
68
+ root: string;
69
+ };
70
+ };
71
+ position: {
72
+ 'top-right': {
73
+ base: string;
74
+ };
75
+ 'bottom-right': {
76
+ base: string;
77
+ };
78
+ 'top-left': {
79
+ base: string;
80
+ };
81
+ 'bottom-left': {
82
+ base: string;
83
+ };
58
84
  };
59
- } | {
60
- position: "bottom-right";
61
- inset: false;
62
- class: {
63
- base: string;
85
+ show: {
86
+ true: {
87
+ base: string;
88
+ };
64
89
  };
65
- } | {
66
- position: "top-left";
67
- inset: false;
68
- class: {
69
- base: string;
90
+ inset: {
91
+ true: "";
70
92
  };
71
- } | {
72
- position: "bottom-left";
73
- inset: false;
74
- class: {
75
- base: string;
93
+ standalone: {
94
+ false: {
95
+ base: string;
96
+ };
76
97
  };
77
- })[];
98
+ }, {
99
+ root: string;
100
+ base: string[];
101
+ }, undefined>;
78
102
  defaultVariants: {
79
103
  size: "md";
80
104
  };
@@ -5,8 +5,8 @@ export default ct(
5
5
  slots: {
6
6
  root: "relative inline-flex items-center justify-center shrink-0",
7
7
  base: [
8
- "inline-block rounded-full ring ring-ui-c1 flex items-center justify-center color-ui-c1 font-medium whitespace-nowrap",
9
- "h-1.2em min-w-1.2em p-0.2em text-0.8em bg-solid-ui-fill"
8
+ "inline-block rounded-full ring ring-ui-cx flex items-center justify-center color-ui-cx font-medium whitespace-nowrap",
9
+ "h-1.2em min-w-1.2em p-0.2em text-0.8em bg-ui-fill"
10
10
  ]
11
11
  },
12
12
  variants: {
@@ -0,0 +1,67 @@
1
+ declare const _default: {
2
+ base: undefined;
3
+ slots: {
4
+ root: string;
5
+ list: string;
6
+ item: string;
7
+ link: string;
8
+ linkLeadingIcon: string;
9
+ linkLabel: string;
10
+ separator: string;
11
+ separatorIcon: string;
12
+ };
13
+ variants: {
14
+ active: {
15
+ true: {
16
+ link: string;
17
+ };
18
+ false: {
19
+ link: string;
20
+ };
21
+ };
22
+ disabled: {
23
+ true: {
24
+ link: string;
25
+ };
26
+ };
27
+ to: {
28
+ true: "";
29
+ };
30
+ };
31
+ compoundVariants: {
32
+ disabled: boolean;
33
+ active: boolean;
34
+ to: boolean;
35
+ class: {
36
+ link: string;
37
+ };
38
+ }[];
39
+ defaultVariants: import("@byyuurin/ui-kit").CVDefaultVariants<{
40
+ active: {
41
+ true: {
42
+ link: string;
43
+ };
44
+ false: {
45
+ link: string;
46
+ };
47
+ };
48
+ disabled: {
49
+ true: {
50
+ link: string;
51
+ };
52
+ };
53
+ to: {
54
+ true: "";
55
+ };
56
+ }, {
57
+ root: string;
58
+ list: string;
59
+ item: string;
60
+ link: string;
61
+ linkLeadingIcon: string;
62
+ linkLabel: string;
63
+ separator: string;
64
+ separatorIcon: string;
65
+ }>;
66
+ };
67
+ export default _default;
@@ -0,0 +1,44 @@
1
+ import { ct } from "@byyuurin/ui-kit";
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ root: "relative min-w-0",
7
+ list: "flex items-center gap-1.5",
8
+ item: "flex min-w-0",
9
+ link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-ui-cp",
10
+ linkLeadingIcon: "shrink-0 size-5",
11
+ linkLabel: "truncate",
12
+ separator: "flex",
13
+ separatorIcon: "shrink-0 size-5 color-ui-cb/60"
14
+ },
15
+ variants: {
16
+ active: {
17
+ true: {
18
+ link: "text-ui-cp font-semibold"
19
+ },
20
+ false: {
21
+ link: "color-ui-cb/60 font-medium"
22
+ }
23
+ },
24
+ disabled: {
25
+ true: {
26
+ link: "cursor-not-allowed opacity-50"
27
+ }
28
+ },
29
+ to: {
30
+ true: ""
31
+ }
32
+ },
33
+ compoundVariants: [
34
+ {
35
+ disabled: false,
36
+ active: false,
37
+ to: true,
38
+ class: {
39
+ link: "hover:color-ui-cb/80 transition-colors"
40
+ }
41
+ }
42
+ ]
43
+ }
44
+ );
@@ -14,7 +14,7 @@ declare const _default: {
14
14
  vertical: "flex flex-col -space-y-px";
15
15
  };
16
16
  };
17
- compoundVariants: import("@byyuurin/ui-kit/index").CVCompoundVariants<{
17
+ compoundVariants: import("@byyuurin/ui-kit").CVCompoundVariants<{
18
18
  size: {
19
19
  xs: "";
20
20
  sm: "";
@@ -27,7 +27,7 @@ declare const _default: {
27
27
  vertical: "flex flex-col -space-y-px";
28
28
  };
29
29
  }, undefined, "relative">;
30
- defaultVariants: import("@byyuurin/ui-kit/index").CVDefaultVariants<{
30
+ defaultVariants: import("@byyuurin/ui-kit").CVDefaultVariants<{
31
31
  size: {
32
32
  xs: "";
33
33
  sm: "";
@@ -3,8 +3,8 @@ declare const _default: {
3
3
  slots: {
4
4
  base: string[];
5
5
  label: string;
6
- prefixIcon: string;
7
- suffixIcon: string;
6
+ leadingIcon: string;
7
+ trailingIcon: string;
8
8
  };
9
9
  variants: {
10
10
  variant: {
@@ -47,10 +47,10 @@ declare const _default: {
47
47
  active: {
48
48
  true: "";
49
49
  };
50
- prefix: {
50
+ leading: {
51
51
  true: "";
52
52
  };
53
- suffix: {
53
+ trailing: {
54
54
  true: "";
55
55
  };
56
56
  loading: {
@@ -65,124 +65,70 @@ declare const _default: {
65
65
  };
66
66
  };
67
67
  };
68
- compoundVariants: ({
69
- size: ("xs" | "sm" | "md")[];
70
- class: {
71
- base: string;
72
- label: string;
73
- prefixIcon?: undefined;
74
- suffixIcon?: undefined;
75
- };
76
- active?: undefined;
77
- variant?: undefined;
78
- loading?: undefined;
79
- prefix?: undefined;
80
- suffix?: undefined;
81
- } | {
82
- size: ("lg" | "xl")[];
83
- class: {
84
- base: string;
85
- label: string;
86
- prefixIcon?: undefined;
87
- suffixIcon?: undefined;
88
- };
89
- active?: undefined;
90
- variant?: undefined;
91
- loading?: undefined;
92
- prefix?: undefined;
93
- suffix?: undefined;
94
- } | {
95
- active: true;
96
- variant: "solid";
97
- class: {
98
- base: string;
99
- label?: undefined;
100
- prefixIcon?: undefined;
101
- suffixIcon?: undefined;
68
+ compoundVariants: import("@byyuurin/ui-kit").CVCompoundVariants<{
69
+ variant: {
70
+ solid: {
71
+ base: string[];
72
+ };
73
+ outline: {
74
+ base: string[];
75
+ };
76
+ soft: {
77
+ base: string[];
78
+ };
79
+ 'soft-outline': {
80
+ base: string[];
81
+ };
82
+ ghost: {
83
+ base: string[];
84
+ };
85
+ link: {
86
+ base: string[];
87
+ };
102
88
  };
103
- size?: undefined;
104
- loading?: undefined;
105
- prefix?: undefined;
106
- suffix?: undefined;
107
- } | {
108
- active: true;
109
- variant: "outline";
110
- class: {
111
- base: string;
112
- label?: undefined;
113
- prefixIcon?: undefined;
114
- suffixIcon?: undefined;
89
+ size: {
90
+ xs: {
91
+ base: string;
92
+ };
93
+ sm: {
94
+ base: string;
95
+ };
96
+ md: {
97
+ base: string;
98
+ };
99
+ lg: {
100
+ base: string;
101
+ };
102
+ xl: {
103
+ base: string;
104
+ };
115
105
  };
116
- size?: undefined;
117
- loading?: undefined;
118
- prefix?: undefined;
119
- suffix?: undefined;
120
- } | {
121
- active: true;
122
- variant: ("soft" | "soft-outline")[];
123
- class: {
124
- base: string;
125
- label?: undefined;
126
- prefixIcon?: undefined;
127
- suffixIcon?: undefined;
106
+ active: {
107
+ true: "";
128
108
  };
129
- size?: undefined;
130
- loading?: undefined;
131
- prefix?: undefined;
132
- suffix?: undefined;
133
- } | {
134
- active: true;
135
- variant: "ghost";
136
- class: {
137
- base: string;
138
- label?: undefined;
139
- prefixIcon?: undefined;
140
- suffixIcon?: undefined;
109
+ leading: {
110
+ true: "";
141
111
  };
142
- size?: undefined;
143
- loading?: undefined;
144
- prefix?: undefined;
145
- suffix?: undefined;
146
- } | {
147
- active: true;
148
- variant: "link";
149
- class: {
150
- base: string;
151
- label?: undefined;
152
- prefixIcon?: undefined;
153
- suffixIcon?: undefined;
112
+ trailing: {
113
+ true: "";
154
114
  };
155
- size?: undefined;
156
- loading?: undefined;
157
- prefix?: undefined;
158
- suffix?: undefined;
159
- } | {
160
- loading: true;
161
- prefix: true;
162
- class: {
163
- prefixIcon: string;
164
- base?: undefined;
165
- label?: undefined;
166
- suffixIcon?: undefined;
115
+ loading: {
116
+ true: "";
167
117
  };
168
- size?: undefined;
169
- active?: undefined;
170
- variant?: undefined;
171
- suffix?: undefined;
172
- } | {
173
- loading: true;
174
- prefix: false;
175
- suffix: true;
176
- class: {
177
- suffixIcon: string;
178
- base?: undefined;
179
- label?: undefined;
180
- prefixIcon?: undefined;
118
+ groupOrientation: {
119
+ horizontal: {
120
+ base: string;
121
+ };
122
+ vertical: {
123
+ base: string;
124
+ };
181
125
  };
182
- size?: undefined;
183
- active?: undefined;
184
- variant?: undefined;
185
- })[];
126
+ }, {
127
+ base: string[];
128
+ label: string;
129
+ leadingIcon: string;
130
+ trailingIcon: string;
131
+ }, undefined>;
186
132
  defaultVariants: {
187
133
  size: "md";
188
134
  };
@@ -0,0 +1,164 @@
1
+ import { ct } from "@byyuurin/ui-kit";
2
+ import { buttonGroupVariant } from "./button-group.js";
3
+ export default ct(
4
+ /* @unocss-include */
5
+ {
6
+ slots: {
7
+ base: [
8
+ "relative inline-flex items-center rounded-ui-button leading-normal transition-colors",
9
+ "outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ui-cb/80",
10
+ "disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:opacity-50"
11
+ ],
12
+ label: "color-inherit",
13
+ leadingIcon: "shrink-0 size-1.5em not-only-child:ml-0.5",
14
+ trailingIcon: "shrink-0 size-1.5em not-only-child:mr-0.5"
15
+ },
16
+ variants: {
17
+ ...buttonGroupVariant,
18
+ variant: {
19
+ "solid": {
20
+ base: [
21
+ "color-ui-cx bg-soft-ui-fill/85",
22
+ "hover:bg-soft-ui-fill/75 active:bg-soft-ui-fill/95",
23
+ "disabled:bg-soft-ui-fill/85 aria-disabled:bg-soft-ui-fill/85",
24
+ "hover:disabled:bg-soft-ui-fill/85 hover:aria-disabled:bg-soft-ui-fill/85"
25
+ ]
26
+ },
27
+ "outline": {
28
+ base: [
29
+ "color-ui-fill/80 bg-ui-cx ring ring-inset ring-ui-fill/30",
30
+ "hover:bg-soft-ui-fill/5 active:bg-soft-ui-fill/10",
31
+ "disabled:bg-ui-cx aria-disabled:bg-ui-cx",
32
+ "hover:disabled:bg-ui-cx hover:aria-disabled:bg-ui-cx"
33
+ ]
34
+ },
35
+ "soft": {
36
+ base: [
37
+ "color-ui-content/80 bg-soft-ui-fill/15",
38
+ "hover:bg-soft-ui-fill/10 hover:color-ui-content/80 active:bg-soft-ui-fill/25 active:color-ui-content/90",
39
+ "disabled:bg-soft-ui-fill/15 aria-disabled:bg-soft-ui-fill/15 disabled:color-ui-content/80 aria-disabled:color-ui-content/80",
40
+ "hover:disabled:bg-soft-ui-fill/15 hover:aria-disabled:bg-soft-ui-fill/15 hover:disabled:color-ui-content/80 hover:aria-disabled:color-ui-content/80"
41
+ ]
42
+ },
43
+ "soft-outline": {
44
+ base: [
45
+ "color-ui-content/80 bg-soft-ui-fill/15 ring ring-inset ring-ui-fill/30",
46
+ "hover:bg-soft-ui-fill/10 hover:color-ui-content/80 active:bg-soft-ui-fill/25 active:color-ui-content/90",
47
+ "disabled:bg-soft-ui-fill/15 aria-disabled:bg-soft-ui-fill/15 disabled:color-ui-content/80 aria-disabled:color-ui-content/80",
48
+ "hover:disabled:bg-soft-ui-fill/15 hover:aria-disabled:bg-soft-ui-fill/15 hover:disabled:color-ui-content/80 hover:aria-disabled:color-ui-content/80"
49
+ ]
50
+ },
51
+ "ghost": {
52
+ base: [
53
+ "color-ui-fill/80 bg-transparent",
54
+ "hover:bg-soft-ui-fill/5 hover:color-ui-fill/80 active:bg-soft-ui-fill/10 active:color-ui-fill/90",
55
+ "disabled:bg-transparent aria-disabled:bg-transparent disabled:hover:bg-transparent aria-disabled:hover:bg-transparent disabled:color-ui-fill/80 aria-disabled:color-ui-fill/80",
56
+ "hover:disabled:bg-transparent hover:aria-disabled:bg-transparent hover:disabled:hover:bg-transparent hover:aria-disabled:hover:bg-transparent hover:disabled:color-ui-fill/80 hover:aria-disabled:color-ui-fill/80"
57
+ ]
58
+ },
59
+ "link": {
60
+ base: [
61
+ "color-ui-fill/80 bg-transparent",
62
+ "hover:color-ui-fill/60 active:color-ui-fill",
63
+ "disabled:color-ui-fill aria-disabled:color-ui-fill",
64
+ "hover:disabled:color-ui-fill hover:aria-disabled:color-ui-fill"
65
+ ]
66
+ }
67
+ },
68
+ size: {
69
+ xs: {
70
+ base: "text-xs"
71
+ },
72
+ sm: {
73
+ base: "text-sm"
74
+ },
75
+ md: {
76
+ base: "text-base"
77
+ },
78
+ lg: {
79
+ base: "text-lg"
80
+ },
81
+ xl: {
82
+ base: "text-xl"
83
+ }
84
+ },
85
+ active: {
86
+ true: ""
87
+ },
88
+ leading: {
89
+ true: ""
90
+ },
91
+ trailing: {
92
+ true: ""
93
+ },
94
+ loading: {
95
+ true: ""
96
+ }
97
+ },
98
+ compoundVariants: [
99
+ {
100
+ size: ["xs", "sm", "md"],
101
+ class: {
102
+ base: "p-1.5",
103
+ label: "px-1"
104
+ }
105
+ },
106
+ {
107
+ size: ["lg", "xl"],
108
+ class: {
109
+ base: "p-2.5",
110
+ label: "px-2"
111
+ }
112
+ },
113
+ {
114
+ active: true,
115
+ variant: "solid",
116
+ class: {
117
+ base: "bg-soft-ui-fill/95 hover:bg-soft-ui-fill/95"
118
+ }
119
+ },
120
+ {
121
+ active: true,
122
+ variant: "outline",
123
+ class: {
124
+ base: "bg-soft-ui-fill/10 hover:bg-soft-ui-fill/30"
125
+ }
126
+ },
127
+ {
128
+ active: true,
129
+ variant: ["soft", "soft-outline"],
130
+ class: {
131
+ base: "color-ui-content/90 bg-soft-ui-fill/25 hover:color-ui-content/90 hover:bg-soft-ui-fill/25"
132
+ }
133
+ },
134
+ {
135
+ active: true,
136
+ variant: "ghost",
137
+ class: {
138
+ base: "color-ui-fill/90 bg-soft-ui-fill/10 hover:color-ui-fill/90 hover:bg-soft-ui-fill/10"
139
+ }
140
+ },
141
+ {
142
+ active: true,
143
+ variant: "link",
144
+ class: {
145
+ base: "color-ui-fill hover:color-ui-fill"
146
+ }
147
+ },
148
+ {
149
+ loading: true,
150
+ leading: true,
151
+ class: { leadingIcon: "animate-spin" }
152
+ },
153
+ {
154
+ loading: true,
155
+ leading: false,
156
+ trailing: true,
157
+ class: { trailingIcon: "animate-spin" }
158
+ }
159
+ ],
160
+ defaultVariants: {
161
+ size: "md"
162
+ }
163
+ }
164
+ );