@byyuurin/ui 0.0.10 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/README.md +170 -58
  2. package/dist/module.d.mts +4 -13
  3. package/dist/module.json +4 -4
  4. package/dist/module.mjs +54 -20
  5. package/dist/runtime/components/Accordion.vue +48 -72
  6. package/dist/runtime/components/Accordion.vue.d.ts +74 -0
  7. package/dist/runtime/components/Alert.vue +65 -83
  8. package/dist/runtime/components/Alert.vue.d.ts +71 -0
  9. package/dist/runtime/components/App.vue +28 -42
  10. package/dist/runtime/components/App.vue.d.ts +26 -0
  11. package/dist/runtime/components/Avatar.vue +82 -58
  12. package/dist/runtime/components/Avatar.vue.d.ts +39 -0
  13. package/dist/runtime/components/AvatarGroup.vue +43 -70
  14. package/dist/runtime/components/AvatarGroup.vue.d.ts +30 -0
  15. package/dist/runtime/components/Badge.vue +70 -64
  16. package/dist/runtime/components/Badge.vue.d.ts +45 -0
  17. package/dist/runtime/components/Breadcrumb.vue +56 -76
  18. package/dist/runtime/components/Breadcrumb.vue.d.ts +79 -0
  19. package/dist/runtime/components/Button.vue +150 -78
  20. package/dist/runtime/components/Button.vue.d.ts +45 -0
  21. package/dist/runtime/components/Calendar.vue +99 -125
  22. package/dist/runtime/components/Calendar.vue.d.ts +102 -0
  23. package/dist/runtime/components/Card.vue +33 -46
  24. package/dist/runtime/components/Card.vue.d.ts +34 -0
  25. package/dist/runtime/components/Carousel.vue +164 -237
  26. package/dist/runtime/components/Carousel.vue.d.ts +125 -0
  27. package/dist/runtime/components/Checkbox.vue +86 -88
  28. package/dist/runtime/components/Checkbox.vue.d.ts +63 -0
  29. package/dist/runtime/components/Chip.vue +44 -58
  30. package/dist/runtime/components/Chip.vue.d.ts +48 -0
  31. package/dist/runtime/components/Collapsible.vue +29 -33
  32. package/dist/runtime/components/Collapsible.vue.d.ts +34 -0
  33. package/dist/runtime/components/Drawer.vue +110 -150
  34. package/dist/runtime/components/Drawer.vue.d.ts +103 -0
  35. package/dist/runtime/components/DropdownMenu.vue +49 -120
  36. package/dist/runtime/components/DropdownMenu.vue.d.ts +140 -0
  37. package/dist/runtime/components/DropdownMenuContent.vue +177 -143
  38. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +51 -0
  39. package/dist/runtime/components/FieldGroup.vue +33 -0
  40. package/dist/runtime/components/FieldGroup.vue.d.ts +33 -0
  41. package/dist/runtime/components/Form.vue +245 -275
  42. package/dist/runtime/components/Form.vue.d.ts +103 -0
  43. package/dist/runtime/components/FormField.vue +108 -0
  44. package/dist/runtime/components/FormField.vue.d.ts +63 -0
  45. package/dist/runtime/components/Icon.vue +20 -0
  46. package/dist/runtime/components/Icon.vue.d.ts +9 -0
  47. package/dist/runtime/components/Input.vue +125 -156
  48. package/dist/runtime/components/Input.vue.d.ts +76 -0
  49. package/dist/runtime/components/InputNumber.vue +103 -130
  50. package/dist/runtime/components/InputNumber.vue.d.ts +191 -0
  51. package/dist/runtime/components/Kbd.vue +24 -39
  52. package/dist/runtime/components/Kbd.vue.d.ts +34 -0
  53. package/dist/runtime/components/Link.vue +105 -337
  54. package/dist/runtime/components/Link.vue.d.ts +95 -0
  55. package/dist/runtime/components/LinkBase.vue +31 -71
  56. package/dist/runtime/components/LinkBase.vue.d.ts +33 -0
  57. package/dist/runtime/components/Modal.vue +82 -103
  58. package/dist/runtime/components/Modal.vue.d.ts +96 -0
  59. package/dist/runtime/components/NavigationMenu.vue +336 -0
  60. package/dist/runtime/components/NavigationMenu.vue.d.ts +181 -0
  61. package/dist/runtime/components/OverlayProvider.vue +12 -16
  62. package/dist/runtime/components/OverlayProvider.vue.d.ts +3 -0
  63. package/dist/runtime/components/Pagination.vue +65 -139
  64. package/dist/runtime/components/Pagination.vue.d.ts +116 -0
  65. package/dist/runtime/components/PinInput.vue +78 -73
  66. package/dist/runtime/components/PinInput.vue.d.ts +54 -0
  67. package/dist/runtime/components/Popover.vue +60 -75
  68. package/dist/runtime/components/Popover.vue.d.ts +70 -0
  69. package/dist/runtime/components/Progress.vue +79 -126
  70. package/dist/runtime/components/Progress.vue.d.ts +63 -0
  71. package/dist/runtime/components/RadioGroup.vue +109 -140
  72. package/dist/runtime/components/RadioGroup.vue.d.ts +96 -0
  73. package/dist/runtime/components/ScrollArea.vue +50 -48
  74. package/dist/runtime/components/ScrollArea.vue.d.ts +21 -0
  75. package/dist/runtime/components/Select.vue +221 -221
  76. package/dist/runtime/components/Select.vue.d.ts +260 -0
  77. package/dist/runtime/components/Separator.vue +55 -47
  78. package/dist/runtime/components/Separator.vue.d.ts +48 -0
  79. package/dist/runtime/components/Skeleton.vue +25 -22
  80. package/dist/runtime/components/Skeleton.vue.d.ts +19 -0
  81. package/dist/runtime/components/Slider.vue +73 -77
  82. package/dist/runtime/components/Slider.vue.d.ts +52 -0
  83. package/dist/runtime/components/Switch.vue +66 -77
  84. package/dist/runtime/components/Switch.vue.d.ts +58 -0
  85. package/dist/runtime/components/Table.vue +357 -215
  86. package/dist/runtime/components/Table.vue.d.ts +234 -0
  87. package/dist/runtime/components/Tabs.vue +90 -88
  88. package/dist/runtime/components/Tabs.vue.d.ts +97 -0
  89. package/dist/runtime/components/Textarea.vue +147 -146
  90. package/dist/runtime/components/Textarea.vue.d.ts +76 -0
  91. package/dist/runtime/components/Toast.vue +108 -90
  92. package/dist/runtime/components/Toast.vue.d.ts +152 -0
  93. package/dist/runtime/components/ToastProvider.vue +82 -109
  94. package/dist/runtime/components/ToastProvider.vue.d.ts +51 -0
  95. package/dist/runtime/components/Tooltip.vue +54 -53
  96. package/dist/runtime/components/Tooltip.vue.d.ts +53 -0
  97. package/dist/runtime/composables/defineShortcuts.d.ts +16 -0
  98. package/dist/runtime/composables/defineShortcuts.js +129 -0
  99. package/dist/runtime/composables/useAvatarGroup.d.ts +8 -3
  100. package/dist/runtime/composables/useAvatarGroup.js +10 -3
  101. package/dist/runtime/composables/useComponentIcons.d.ts +9 -6
  102. package/dist/runtime/composables/useComponentIcons.js +4 -4
  103. package/dist/runtime/composables/useFieldGroup.d.ts +8 -0
  104. package/dist/runtime/composables/useFieldGroup.js +14 -0
  105. package/dist/runtime/composables/useFormField.d.ts +62 -0
  106. package/dist/runtime/composables/useFormField.js +99 -0
  107. package/dist/runtime/composables/useKbd.d.ts +3 -2
  108. package/dist/runtime/composables/useKbd.js +3 -2
  109. package/dist/runtime/composables/useLocale.d.ts +68 -5
  110. package/dist/runtime/composables/useLocale.js +11 -11
  111. package/dist/runtime/composables/useOverlay.d.ts +51 -15
  112. package/dist/runtime/composables/useOverlay.js +44 -30
  113. package/dist/runtime/composables/usePortal.d.ts +6 -0
  114. package/dist/runtime/composables/usePortal.js +17 -0
  115. package/dist/runtime/composables/useToast.d.ts +12 -5
  116. package/dist/runtime/composables/useToast.js +12 -7
  117. package/dist/runtime/locale/en.d.ts +30 -1
  118. package/dist/runtime/locale/en.js +2 -1
  119. package/dist/runtime/locale/index.d.ts +2 -2
  120. package/dist/runtime/locale/index.js +1 -1
  121. package/dist/runtime/locale/zh_tw.d.ts +31 -0
  122. package/dist/runtime/locale/{zh-tw.js → zh_tw.js} +2 -1
  123. package/dist/runtime/plugins/colors.d.ts +2 -0
  124. package/dist/runtime/plugins/colors.js +50 -0
  125. package/dist/runtime/types/app.config.d.ts +6 -0
  126. package/dist/runtime/types/form.d.ts +58 -17
  127. package/dist/runtime/types/form.js +11 -0
  128. package/dist/runtime/types/index.d.ts +51 -8
  129. package/dist/runtime/types/index.js +45 -2
  130. package/dist/runtime/types/input.d.ts +8 -0
  131. package/dist/runtime/types/locale.d.ts +5 -0
  132. package/dist/runtime/types/style.d.ts +33 -0
  133. package/dist/runtime/types/style.js +0 -0
  134. package/dist/runtime/types/unocss.d.ts +4 -0
  135. package/dist/runtime/types/utils.d.ts +38 -37
  136. package/dist/runtime/utils/form.d.ts +5 -1
  137. package/dist/runtime/utils/form.js +49 -0
  138. package/dist/runtime/utils/index.d.ts +10 -13
  139. package/dist/runtime/utils/index.js +41 -48
  140. package/dist/runtime/utils/link.d.ts +5 -6
  141. package/dist/runtime/utils/link.js +16 -2
  142. package/dist/runtime/utils/locale.d.ts +5 -0
  143. package/dist/runtime/utils/locale.js +10 -0
  144. package/dist/runtime/utils/style.d.ts +94 -0
  145. package/dist/runtime/utils/style.js +37 -0
  146. package/dist/runtime/vue/components/Icon.vue +15 -0
  147. package/dist/runtime/vue/components/Icon.vue.d.ts +7 -0
  148. package/dist/runtime/vue/components/Link.vue +163 -0
  149. package/dist/runtime/vue/components/Link.vue.d.ts +95 -0
  150. package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
  151. package/dist/runtime/vue/composables/useAppConfig.js +4 -0
  152. package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
  153. package/dist/runtime/vue/plugins/color-mode.js +6 -0
  154. package/dist/runtime/vue/plugins/head.d.ts +4 -0
  155. package/dist/runtime/vue/plugins/head.js +9 -0
  156. package/dist/runtime/vue/stubs.d.ts +16 -1
  157. package/dist/runtime/vue/stubs.js +32 -1
  158. package/dist/setup.d.mts +13 -0
  159. package/dist/setup.mjs +12 -0
  160. package/dist/shared/ui.CzIlLITK.mjs +51 -0
  161. package/dist/shared/ui.DSyJHSTk.mjs +3787 -0
  162. package/dist/shared/ui.DpbffTXs.d.mts +84 -0
  163. package/dist/shared/ui.IulR-OYx.d.mts +64 -0
  164. package/dist/types.d.mts +3 -1
  165. package/dist/unocss.d.mts +12 -52
  166. package/dist/unocss.mjs +144 -253
  167. package/dist/unplugin.d.mts +13 -26
  168. package/dist/unplugin.mjs +193 -18
  169. package/dist/vite.d.mts +10 -1
  170. package/dist/vite.mjs +12 -3
  171. package/package.json +156 -87
  172. package/vue-plugin.d.ts +5 -0
  173. package/dist/module.cjs +0 -5
  174. package/dist/module.d.ts +0 -13
  175. package/dist/module.mjs.map +0 -1
  176. package/dist/runtime/app/injections.d.ts +0 -9307
  177. package/dist/runtime/app/injections.js +0 -61
  178. package/dist/runtime/components/ButtonGroup.vue +0 -46
  179. package/dist/runtime/components/FormItem.vue +0 -129
  180. package/dist/runtime/composables/useButtonGroup.d.ts +0 -5
  181. package/dist/runtime/composables/useButtonGroup.js +0 -9
  182. package/dist/runtime/composables/useFormItem.d.ts +0 -27
  183. package/dist/runtime/composables/useFormItem.js +0 -64
  184. package/dist/runtime/composables/useTheme.d.ts +0 -9
  185. package/dist/runtime/composables/useTheme.js +0 -23
  186. package/dist/runtime/index.d.ts +0 -44
  187. package/dist/runtime/index.js +0 -44
  188. package/dist/runtime/locale/zh-tw.d.ts +0 -2
  189. package/dist/runtime/theme/accordion.d.ts +0 -56
  190. package/dist/runtime/theme/accordion.js +0 -28
  191. package/dist/runtime/theme/alert.d.ts +0 -125
  192. package/dist/runtime/theme/alert.js +0 -47
  193. package/dist/runtime/theme/app.d.ts +0 -19
  194. package/dist/runtime/theme/app.js +0 -19
  195. package/dist/runtime/theme/avatar-group.d.ts +0 -52
  196. package/dist/runtime/theme/avatar-group.js +0 -32
  197. package/dist/runtime/theme/avatar.d.ts +0 -56
  198. package/dist/runtime/theme/avatar.js +0 -34
  199. package/dist/runtime/theme/badge.d.ts +0 -82
  200. package/dist/runtime/theme/badge.js +0 -92
  201. package/dist/runtime/theme/breadcrumb.d.ts +0 -67
  202. package/dist/runtime/theme/breadcrumb.js +0 -44
  203. package/dist/runtime/theme/button-group.d.ts +0 -66
  204. package/dist/runtime/theme/button-group.js +0 -42
  205. package/dist/runtime/theme/button.d.ts +0 -190
  206. package/dist/runtime/theme/button.js +0 -164
  207. package/dist/runtime/theme/calendar.d.ts +0 -56
  208. package/dist/runtime/theme/calendar.js +0 -69
  209. package/dist/runtime/theme/card.d.ts +0 -62
  210. package/dist/runtime/theme/card.js +0 -37
  211. package/dist/runtime/theme/carousel.d.ts +0 -113
  212. package/dist/runtime/theme/carousel.js +0 -43
  213. package/dist/runtime/theme/checkbox.d.ts +0 -88
  214. package/dist/runtime/theme/checkbox.js +0 -54
  215. package/dist/runtime/theme/chip.d.ts +0 -67
  216. package/dist/runtime/theme/chip.js +0 -66
  217. package/dist/runtime/theme/collapsible.d.ts +0 -38
  218. package/dist/runtime/theme/collapsible.js +0 -10
  219. package/dist/runtime/theme/drawer.d.ts +0 -148
  220. package/dist/runtime/theme/drawer.js +0 -113
  221. package/dist/runtime/theme/dropdown-menu.d.ts +0 -71
  222. package/dist/runtime/theme/dropdown-menu.js +0 -83
  223. package/dist/runtime/theme/form-item.d.ts +0 -76
  224. package/dist/runtime/theme/form-item.js +0 -34
  225. package/dist/runtime/theme/form.d.ts +0 -8
  226. package/dist/runtime/theme/form.js +0 -7
  227. package/dist/runtime/theme/index.d.ts +0 -41
  228. package/dist/runtime/theme/index.js +0 -41
  229. package/dist/runtime/theme/input-number.d.ts +0 -121
  230. package/dist/runtime/theme/input-number.js +0 -95
  231. package/dist/runtime/theme/input.d.ts +0 -178
  232. package/dist/runtime/theme/input.js +0 -151
  233. package/dist/runtime/theme/kbd.d.ts +0 -39
  234. package/dist/runtime/theme/kbd.js +0 -26
  235. package/dist/runtime/theme/link.d.ts +0 -44
  236. package/dist/runtime/theme/link.js +0 -26
  237. package/dist/runtime/theme/modal.d.ts +0 -48
  238. package/dist/runtime/theme/modal.js +0 -55
  239. package/dist/runtime/theme/pagination.d.ts +0 -80
  240. package/dist/runtime/theme/pagination.js +0 -17
  241. package/dist/runtime/theme/pinInput.d.ts +0 -100
  242. package/dist/runtime/theme/pinInput.js +0 -111
  243. package/dist/runtime/theme/popover.d.ts +0 -38
  244. package/dist/runtime/theme/popover.js +0 -13
  245. package/dist/runtime/theme/progress.d.ts +0 -186
  246. package/dist/runtime/theme/progress.js +0 -95
  247. package/dist/runtime/theme/radio-group.d.ts +0 -110
  248. package/dist/runtime/theme/radio-group.js +0 -61
  249. package/dist/runtime/theme/scroll-area.d.ts +0 -73
  250. package/dist/runtime/theme/scroll-area.js +0 -33
  251. package/dist/runtime/theme/select.d.ts +0 -192
  252. package/dist/runtime/theme/select.js +0 -173
  253. package/dist/runtime/theme/separator.d.ts +0 -80
  254. package/dist/runtime/theme/separator.js +0 -53
  255. package/dist/runtime/theme/skeleton.d.ts +0 -8
  256. package/dist/runtime/theme/skeleton.js +0 -7
  257. package/dist/runtime/theme/slider.d.ts +0 -76
  258. package/dist/runtime/theme/slider.js +0 -52
  259. package/dist/runtime/theme/switch.d.ts +0 -122
  260. package/dist/runtime/theme/switch.js +0 -78
  261. package/dist/runtime/theme/table.d.ts +0 -92
  262. package/dist/runtime/theme/table.js +0 -36
  263. package/dist/runtime/theme/tabs.d.ts +0 -135
  264. package/dist/runtime/theme/tabs.js +0 -146
  265. package/dist/runtime/theme/textarea.d.ts +0 -96
  266. package/dist/runtime/theme/textarea.js +0 -116
  267. package/dist/runtime/theme/toast-provider.d.ts +0 -122
  268. package/dist/runtime/theme/toast-provider.js +0 -97
  269. package/dist/runtime/theme/toast.d.ts +0 -89
  270. package/dist/runtime/theme/toast.js +0 -35
  271. package/dist/runtime/theme/tooltip.d.ts +0 -44
  272. package/dist/runtime/theme/tooltip.js +0 -11
  273. package/dist/runtime/types/components.d.ts +0 -42
  274. package/dist/runtime/utils/extend-theme.d.ts +0 -9
  275. package/dist/runtime/utils/extend-theme.js +0 -27
  276. package/dist/runtime/utils/styler.d.ts +0 -4
  277. package/dist/runtime/utils/styler.js +0 -10
  278. package/dist/runtime/utils/translator.d.ts +0 -18
  279. package/dist/runtime/utils/translator.js +0 -8
  280. package/dist/shared/ui.3e7fad19.mjs +0 -5
  281. package/dist/shared/ui.3e7fad19.mjs.map +0 -1
  282. package/dist/types.d.ts +0 -1
  283. package/dist/unocss.d.ts +0 -52
  284. package/dist/unocss.mjs.map +0 -1
  285. package/dist/unplugin.d.ts +0 -26
  286. package/dist/unplugin.mjs.map +0 -1
  287. package/dist/vite.d.ts +0 -9
  288. package/dist/vite.mjs.map +0 -1
  289. /package/dist/runtime/types/{components.js → input.js} +0 -0
@@ -0,0 +1,84 @@
1
+ import * as _unplugin from 'unplugin';
2
+ import { Options } from 'unplugin-auto-import/types';
3
+ import { Options as Options$1 } from 'unplugin-vue-components/types';
4
+ import { V as VariantsColor, C as Color, N as NeutralColor, a as VariantsSize, M as ModuleOptions } from './ui.IulR-OYx.mjs';
5
+ import * as ui from '#build/ui';
6
+ import { UIConfig as UIConfig$1 } from '../../dist/runtime/types/style.js';
7
+ import { PresetOptions } from '../unocss.mjs';
8
+
9
+ declare const icons: {
10
+ close: string;
11
+ loading: string;
12
+ check: string;
13
+ chevronUp: string;
14
+ chevronDown: string;
15
+ chevronLeft: string;
16
+ chevronRight: string;
17
+ chevronDoubleLeft: string;
18
+ chevronDoubleRight: string;
19
+ ellipsis: string;
20
+ plus: string;
21
+ minus: string;
22
+ external: string;
23
+ };
24
+
25
+ type AppConfigIcons = Record<keyof typeof icons | (string & {}), string>;
26
+ type AppConfigUI<Colors extends string = VariantsColor> = {
27
+ colors?: {
28
+ [C in Colors extends '' | never ? VariantsColor : Colors]?: Color;
29
+ } & {
30
+ primary?: Color;
31
+ neutral?: NeutralColor | (string & {});
32
+ };
33
+ icons?: Partial<AppConfigIcons>;
34
+ } & UIConfig$1<typeof ui>;
35
+ interface UIConfig<Color extends string = VariantsColor> extends Omit<UIOptions, 'theme' | 'ui'> {
36
+ theme?: {
37
+ /**
38
+ * Define the color aliases available for components
39
+ * @default ["primary", "secondary", "success", "info", "warning", "error"]
40
+ */
41
+ colors?: Color[];
42
+ /**
43
+ * Enable or disable transitions on components
44
+ * @default true
45
+ */
46
+ transitions?: boolean;
47
+ defaultVariants?: {
48
+ /**
49
+ * The default color variant to use for components
50
+ * @default "primary"
51
+ */
52
+ color?: Color;
53
+ /**
54
+ * The default size variant to use for components
55
+ * @default "md"
56
+ */
57
+ size?: VariantsSize | (string & {});
58
+ };
59
+ };
60
+ ui?: AppConfigUI<Color>;
61
+ }
62
+ declare function setup<Color extends string = VariantsColor>(defaults?: UIConfig<Color>): {
63
+ uno: PresetOptions;
64
+ vite: UIOptions;
65
+ };
66
+
67
+ declare const runtimeDir: string;
68
+ interface UIOptions extends Omit<ModuleOptions, 'fonts'> {
69
+ /** Whether to generate declaration files for auto-imported components. */
70
+ dts?: boolean;
71
+ ui?: AppConfigUI;
72
+ /**
73
+ * Override options for `unplugin-auto-import`
74
+ */
75
+ autoImport?: Partial<Options>;
76
+ /**
77
+ * Override options for `unplugin-vue-components`
78
+ */
79
+ components?: Partial<Options$1>;
80
+ }
81
+ declare const unplugin: _unplugin.UnpluginInstance<UIOptions | undefined, boolean>;
82
+
83
+ export { runtimeDir as r, setup as s, unplugin as u };
84
+ export type { AppConfigIcons as A, UIOptions as U, AppConfigUI as a };
@@ -0,0 +1,64 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { colors } from '@unocss/preset-wind4/colors';
3
+ import '../../dist/runtime/types/index.js';
4
+
5
+ declare const themeSizes: readonly ["xs", "sm", "md", "lg", "xl"];
6
+ type VariantsSize = typeof themeSizes[number];
7
+ declare const defaultColors: readonly ["primary", "secondary", "success", "info", "warning", "error"];
8
+ type VariantsColor = typeof defaultColors[number];
9
+ declare const neutralColors: ("slate" | "gray" | "zinc" | "neutral" | "stone" | "light" | "dark")[];
10
+ type NeutralColor = typeof neutralColors[number];
11
+ type Color$1 = keyof Omit<typeof colors, NeutralColor | 'black' | 'white'> | (string & {});
12
+
13
+ type Color = VariantsColor | (string & {});
14
+ type Size = VariantsSize | (string & {});
15
+ interface ModuleOptions {
16
+ /**
17
+ * Prefix for components
18
+ *
19
+ * @default "U"
20
+ */
21
+ prefix?: string;
22
+ /**
23
+ * Enable or disable `@nuxt/fonts` module
24
+ * @default true
25
+ */
26
+ fonts?: boolean;
27
+ /**
28
+ * Enable or disable `@nuxtjs/color-mode` module
29
+ *
30
+ * @default true
31
+ */
32
+ colorMode?: boolean;
33
+ /**
34
+ * Customize how the theme is generated
35
+ */
36
+ theme?: {
37
+ /**
38
+ * Define the color aliases available for components
39
+ * @default ["primary", "secondary", "success", "info", "warning", "error"]
40
+ */
41
+ colors?: Color[];
42
+ /**
43
+ * Enable or disable transitions on components
44
+ * @default true
45
+ */
46
+ transitions?: boolean;
47
+ defaultVariants?: {
48
+ /**
49
+ * The default color variant to use for components
50
+ * @default "primary"
51
+ */
52
+ color?: Color;
53
+ /**
54
+ * The default size variant to use for components
55
+ * @default "md"
56
+ */
57
+ size?: Size;
58
+ };
59
+ };
60
+ }
61
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
62
+
63
+ export { _default as _ };
64
+ export type { Color$1 as C, ModuleOptions as M, NeutralColor as N, VariantsColor as V, VariantsSize as a };
package/dist/types.d.mts CHANGED
@@ -1 +1,3 @@
1
- export { type ModuleOptions, default } from './module.js'
1
+ export { type ModuleOptions, default } from './shared/ui.IulR-OYx.mjs'
2
+
3
+ export * from '../dist/runtime/types/index.js'
package/dist/unocss.d.mts CHANGED
@@ -1,52 +1,12 @@
1
- import * as _unocss_core from '@unocss/core';
2
- import { UserConfig, Rule } from '@unocss/core';
3
- import { CRRule } from '@byyuurin/ui-kit';
4
- import { Theme } from '@unocss/preset-mini';
5
-
6
- declare const cssVarsPrefix = "ui";
7
- declare const cssVarsBase: string[];
8
- declare const cssVarsDynamic: string[];
9
- declare const cssVarsAll: string[];
10
-
11
- interface PresetOptions {
12
- /** @default "0rem" */
13
- radius?: string;
14
- /** @default "[radius]" */
15
- radiusBox?: string;
16
- /** @default "[radius]" */
17
- radiusButton?: string;
18
- /** @default "[radius]" */
19
- radiusCheckbox?: string;
20
- /** @default "[radius]" */
21
- radiusRadio?: string;
22
- /** @default "[radius]" */
23
- radiusSwitch?: string;
24
- /** @default "[radius]" */
25
- radiusTabs?: string;
26
- /**
27
- * Base content color
28
- * @default "#1f2937"
29
- */
30
- cb?: string;
31
- /**
32
- * Primary color
33
- * @default "[cb]"
34
- */
35
- cp?: string;
36
- /**
37
- * Base background color
38
- * @default "#ffffff"
39
- */
40
- cx?: string;
41
- }
42
- declare const preset: _unocss_core.PresetFactory<object, PresetOptions>;
43
-
44
- declare function transformUnoRules(userConfig?: UserConfig): CRRule[];
45
-
46
- declare const rules: Rule[];
47
-
48
- declare const theme: Theme;
49
- declare function cssVar(name: string, ...defaultValue: string[]): string;
50
- declare function cssColor(...rgb: (string | number)[]): string;
51
-
52
- export { type PresetOptions, cssColor, cssVar, cssVarsAll, cssVarsBase, cssVarsDynamic, cssVarsPrefix, preset, rules, theme, transformUnoRules };
1
+ import { Preset } from '@unocss/core';
2
+ import { Theme } from '@unocss/preset-wind4/theme';
3
+ import { M as ModuleOptions } from './shared/ui.IulR-OYx.mjs';
4
+ import '@nuxt/schema';
5
+ import '@unocss/preset-wind4/colors';
6
+ import '../dist/runtime/types/index.js';
7
+
8
+ type PresetOptions = Pick<(ModuleOptions['theme'] & {}), 'colors'>;
9
+ declare function createUnoPreset(options?: PresetOptions): () => Preset<Theme>;
10
+
11
+ export { createUnoPreset };
12
+ export type { PresetOptions };
package/dist/unocss.mjs CHANGED
@@ -1,264 +1,155 @@
1
- import { definePreset, mergeConfigs } from '@unocss/core';
2
- import { parseColor, parseCssColor } from '@unocss/preset-mini/utils';
3
- import { kebabCase } from 'scule';
4
- import { presetUno } from '@unocss/preset-uno';
1
+ import { colors } from '@unocss/preset-wind4/colors';
2
+ import { parseColor } from '@unocss/preset-wind4/utils';
3
+ import { r as resolveColors } from './shared/ui.CzIlLITK.mjs';
4
+ import '../dist/runtime/utils/index.js';
5
5
 
6
- const cssVarsPrefix = "ui";
7
- const cssVarsBase = ["cb", "cp", "cx"];
8
- const cssVarsDynamic = ["fill"];
9
- const cssVarsAll = [...cssVarsBase, ...cssVarsDynamic];
6
+ function createUnoPreset(options = {}) {
7
+ const themeShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
8
+ const colors$1 = Object.fromEntries(resolveColors(options?.colors).map((color) => {
9
+ const colorValues = Object.fromEntries(themeShades.map((shade) => [shade, `var(--ui-color-${color}-${shade})`]));
10
+ return [color, { ...colorValues, DEFAULT: `var(--ui-${color})` }];
11
+ }));
12
+ const keyframes = {
13
+ "fade-in": "{from {opacity: 0;}to {opacity: 1;}}",
14
+ "fade-out": "{from {opacity: 1;}to {opacity: 0;}}",
15
+ "scale-in": "{from {opacity: 0;scale: 0.95;}to {opacity: 1;scale: 1;}}",
16
+ "scale-out": "{from {opacity: 1;scale: 1;}to {opacity: 0;scale: 0.95;}}",
17
+ "slide-in-from-top": "{from {transform: translateY(-100%);}to {transform: translateY(0);}}",
18
+ "slide-out-to-top": "{from {transform: translateY(0);}to {transform: translateY(-100%);}}",
19
+ "slide-in-from-right": "{from {transform: translateX(100%);}to {transform: translateX(0);}}",
20
+ "slide-out-to-right": "{from {transform: translateX(0);}to {transform: translateX(100%);}}",
21
+ "slide-in-from-bottom": "{from {transform: translateY(100%);}to {transform: translateY(0);}}",
22
+ "slide-out-to-bottom": "{from {transform: translateY(0);}to {transform: translateY(100%);}}",
23
+ "slide-in-from-left": "{from {transform: translateX(-100%);}to {transform: translateX(0);}}",
24
+ "slide-out-to-left": "{from {transform: translateX(0);}to {transform: translateX(-100%);}}",
25
+ "slide-in-from-top-and-fade": "{from {opacity: 0;transform: translateY(-4px);}to {opacity: 1;transform: translateY(0);}}",
26
+ "slide-out-to-top-and-fade": "{from {opacity: 1;transform: translateY(0);}to {opacity: 0;transform: translateY(-4px);}}",
27
+ "slide-in-from-right-and-fade": "{from {opacity: 0;transform: translateX(4px);}to {opacity: 1;transform: translateX(0);}}",
28
+ "slide-out-to-right-and-fade": "{from {opacity: 1;transform: translateX(0);}to {opacity: 0;transform: translateX(4px);}}",
29
+ "slide-in-from-bottom-and-fade": "{from {opacity: 0;transform: translateY(4px);}to {opacity: 1;transform: translateY(0);}}",
30
+ "slide-out-to-bottom-and-fade": "{from {opacity: 1;transform: translateY(0);}to {opacity: 0;transform: translateY(4px);}}",
31
+ "slide-in-from-left-and-fade": "{from {opacity: 0;transform: translateX(-4px);}to {opacity: 1;transform: translateX(0);}}",
32
+ "slide-out-to-left-and-fade": "{from {opacity: 1;transform: translateX(0);}to {opacity: 0;transform: translateX(-4px);}}",
33
+ "enter-from-right": "{from{opacity:0;transform:translateX(200px);}to{opacity:1;transform:translateX(0);}}",
34
+ "enter-from-left": "{from{opacity:0;transform:translateX(-200px);}to{opacity:1;transform:translateX(0);}}",
35
+ "exit-to-right": "{from{opacity:1;transform:translateX(0);}to{opacity:0;transform:translateX(200px);}}",
36
+ "exit-to-left": "{from{opacity:1;transform:translateX(0);}to{opacity:0;transform:translateX(-200px);}}",
37
+ "carousel": "{0%,100% {width: 50%}0% {transform: translateX(-100%)}100% {transform: translateX(200%)}}",
38
+ "carousel-rtl": "{0%,100% {width: 50%}0% {transform: translateX(100%)}100% {transform: translateX(-200%)}}",
39
+ "carousel-vertical": "{0%,100% {height: 50%}0% {transform: translateY(-100%)}100% {transform: translateY(200%)}}",
40
+ "carousel-inverse": "{0%,100% {width: 50%}0% {transform: translateX(200%)}100% {transform: translateX(-100%)}}",
41
+ "carousel-inverse-rtl": "{0%,100% {width: 50%}0% {transform: translateX(-200%)}100% {transform: translateX(100%)}}",
42
+ "carousel-inverse-vertical": "{0%,100% {height: 50%}0% {transform: translateY(200%)}100% {transform: translateY(-100%)}}",
43
+ "swing": "{0%,100% {width: 50%}0%,100% {transform: translateX(-25%)}50% {transform: translateX(125%)}}",
44
+ "swing-vertical": "{0%,100% {height: 50%}0%,100% {transform: translateY(-25%)}50% {transform: translateY(125%)}}",
45
+ "elastic": "{0%,100% {width: 50%;margin-left: 25%;}50% {width: 90%;margin-left: 5%;}}",
46
+ "elastic-vertical": "{0%,100% {height: 50%;margin-top: 25%;}50% {height: 90%;margin-top: 5%;}}"
47
+ };
48
+ const preset = {
49
+ name: "@byyuurin/ui/uno-preset",
50
+ theme: {
51
+ font: {
52
+ sans: '"Public Sans",sans-serif'
53
+ },
54
+ colors: {
55
+ // theme colors
56
+ "tw-neutral": colors.neutral,
57
+ ...colors$1
58
+ },
59
+ radius: {
60
+ "DEFAULT": "var(--ui-radius)",
61
+ "xs": "calc(var(--ui-radius) * 0.5)",
62
+ "sm": "var(--ui-radius)",
63
+ "md": "calc(var(--ui-radius) * 1.5)",
64
+ "lg": "calc(var(--ui-radius) * 2)",
65
+ "xl": "calc(var(--ui-radius) * 3)",
66
+ "2xl": "calc(var(--ui-radius) * 4)",
67
+ "3xl": "calc(var(--ui-radius) * 6)",
68
+ "4xl": "calc(var(--ui-radius) * 8)"
69
+ },
70
+ animation: {
71
+ keyframes
72
+ }
73
+ },
74
+ shortcuts: [
75
+ [
76
+ /^(?:(text|bg|border-[rltbsexy]|border|divide|outline|ring-offset|ring|stroke|fill)-)(.+)$/,
77
+ ([, t = "", c = ""], { theme }) => {
78
+ if (/^\[.*\]$/.test(c))
79
+ return;
80
+ const parsed = parseColor(c, theme);
81
+ if (!parsed || !/^(?:default|dimmed|muted|toned|highlighted|inverted|elevated|accented|border|bg)/.test(c))
82
+ return;
83
+ if (t.includes(parsed.name))
84
+ return;
85
+ const result = `${t}-[--ui-${t}-${parsed.name}]/${parsed.opacity ?? 100}`.replace("-default", "").replace("/100", "").replace(/\[--ui-(?:border-[rltbsexy]|border|divide|outline|ring-offset|ring|stroke|fill)(-.+)?\]/, "[--ui-border$1]").replace(/(?:bg-(border)|border-(bg))/, "$1$2");
86
+ return result;
87
+ }
88
+ ]
89
+ ],
90
+ safelist: Object.keys(keyframes).map((s) => `keyframes-${s}`),
91
+ preflights: [
92
+ {
93
+ layer: "base",
94
+ getCSS() {
95
+ return `body {
96
+ accent-color: var(--ui-text);
97
+ background-color: var(--ui-bg);
98
+ color: var(--ui-text);
99
+ scrollbar-color: var(--ui-border-accented) transparent;
10
100
 
11
- const theme = {
12
- colors: {
13
- [cssVarsPrefix]: {
14
- cb: cssColor(cssVar("cb")),
15
- cx: cssColor(cssVar("cx")),
16
- primary: cssColor(cssVar("cp", cssVar("content"), cssVar("cb"))),
17
- fill: cssColor(cssVar("fill", cssVar("cb")))
18
- }
19
- },
20
- backgroundColor: {
21
- [cssVarsPrefix]: {
22
- base: cssColor(cssVar("cx"))
23
- }
24
- },
25
- textColor: {
26
- [cssVarsPrefix]: {
27
- base: cssColor(cssVar("cb"))
28
- }
29
- },
30
- borderColor: {
31
- [cssVarsPrefix]: {
32
- base: cssColor(cssVar("cb"))
33
- }
34
- },
35
- borderRadius: {
36
- ...Object.fromEntries(["base", "box", "button", "checkbox", "radio", "switch", "tabs"].map((name) => [`${cssVarsPrefix}-${name}`, name === "base" ? cssVar("radius") : cssVar(`radius-${name}`, cssVar("radius"))]))
37
- },
38
- ringWidth: {
39
- DEFAULT: "1px"
40
- },
41
- shadowColor: {
42
- [cssVarsPrefix]: {
43
- base: cssColor(cssVar("cb"))
44
- }
45
- },
46
- animation: {
47
- keyframes: {
48
- "fade-in": "{from {opacity: 0;}to {opacity: 1;}}",
49
- "fade-out": "{from {opacity: 1;}to {opacity: 0;}}",
50
- "scale-in": "{from {opacity: 0;scale: 0.95;}to {opacity: 1;scale: 1;}}",
51
- "scale-out": "{from {opacity: 1;scale: 1;}to {opacity: 0;scale: 0.95;}}",
52
- "slide-in-from-top": "{from {transform: translateY(-100%);}to {transform: translateY(0);}}",
53
- "slide-out-to-top": "{from {transform: translateY(0);}to {transform: translateY(-100%);}}",
54
- "slide-in-from-right": "{from {transform: translateX(100%);}to {transform: translateX(0);}}",
55
- "slide-out-to-right": "{from {transform: translateX(0);}to {transform: translateX(100%);}}",
56
- "slide-in-from-bottom": "{from {transform: translateY(100%);}to {transform: translateY(0);}}",
57
- "slide-out-to-bottom": "{from {transform: translateY(0);}to {transform: translateY(100%);}}",
58
- "slide-in-from-left": "{from {transform: translateX(-100%);}to {transform: translateX(0);}}",
59
- "slide-out-to-left": "{from {transform: translateX(0);}to {transform: translateX(-100%);}}",
60
- "slide-in-from-top-and-fade": "{from {opacity: 0;transform: translateY(-4px);}to {opacity: 1;transform: translateY(0);}}",
61
- "slide-out-to-top-and-fade": "{from {opacity: 1;transform: translateY(0);}to {opacity: 0;transform: translateY(-4px);}}",
62
- "slide-in-from-right-and-fade": "{from {opacity: 0;transform: translateX(4px);}to {opacity: 1;transform: translateX(0);}}",
63
- "slide-out-to-right-and-fade": "{from {opacity: 1;transform: translateX(0);}to {opacity: 0;transform: translateX(4px);}}",
64
- "slide-in-from-bottom-and-fade": "{from {opacity: 0;transform: translateY(4px);}to {opacity: 1;transform: translateY(0);}}",
65
- "slide-out-to-bottom-and-fade": "{from {opacity: 1;transform: translateY(0);}to {opacity: 0;transform: translateY(4px);}}",
66
- "slide-in-from-left-and-fade": "{from {opacity: 0;transform: translateX(-4px);}to {opacity: 1;transform: translateX(0);}}",
67
- "slide-out-to-left-and-fade": "{from {opacity: 1;transform: translateX(0);}to {opacity: 0;transform: translateX(-4px);}}"
68
- }
69
- }
70
- };
71
- function cssVar(name, ...defaultValue) {
72
- return `var(${[`--${cssVarsPrefix}-${name}`, ...defaultValue].join(",")})`;
73
- }
74
- function cssColor(...rgb) {
75
- return `rgb(${rgb.join(" ")})`;
101
+ -webkit-font-smoothing: antialiased;
102
+ -moz-osx-font-smoothing: grayscale;
76
103
  }
77
104
 
78
- const rules = [
79
- [
80
- new RegExp(`^${cssVarsPrefix}-([^/]+)$`),
81
- ([_, color], ctx) => {
82
- if (!color)
83
- return;
84
- if (color === "base")
85
- return Object.fromEntries(cssVarsDynamic.map((prop) => [`--${cssVarsPrefix}-${prop}`, cssVar("cb")]));
86
- if (color === "base-reverse")
87
- return Object.fromEntries(cssVarsDynamic.map((prop) => [`--${cssVarsPrefix}-${prop}`, cssVar("cx")]));
88
- if (color === "primary")
89
- return Object.fromEntries(cssVarsDynamic.map((prop) => [`--${cssVarsPrefix}-${prop}`, cssVar("cp", cssVar("cb"))]));
90
- const data = parseColor(color, ctx.theme);
91
- const value = resolveRuleValue(data);
92
- if (value)
93
- return Object.fromEntries(cssVarsDynamic.map((prop) => [`--${cssVarsPrefix}-${prop}`, value]));
94
- },
95
- { autocomplete: `${cssVarsPrefix}-$colors` }
96
- ],
97
- [
98
- new RegExp(`^${cssVarsPrefix}-(?:(${cssVarsAll.join("|")})-)([^/]+)$`),
99
- ([_, prop, color], ctx) => {
100
- if (!color)
101
- return;
102
- if (color === "base")
103
- return { [`--${cssVarsPrefix}-${prop}`]: cssVar("cb") };
104
- if (color === "base-reverse")
105
- return { [`--${cssVarsPrefix}-${prop}`]: cssVar("cx") };
106
- if (color === "primary")
107
- return { [`--${cssVarsPrefix}-${prop}`]: cssVar("cp", cssVar("cb")) };
108
- const data = parseColor(color, ctx.theme);
109
- const value = resolveRuleValue(data);
110
- if (value)
111
- return { [`--${cssVarsPrefix}-${prop}`]: value };
112
- },
113
- { autocomplete: `${cssVarsPrefix}-(${cssVarsAll.join("|")})-$colors` }
114
- ],
115
- [
116
- /^bg-soft-(.+)$/,
117
- ([_, color], { theme }) => {
118
- if (!color)
119
- return;
120
- const parsed = parseColor(color, theme);
121
- if (!parsed || parsed.cssColor?.type !== "rgb")
122
- return;
123
- const rgb = `rgb(${parsed.cssColor.components.join(" ")})`;
124
- const opacity = parsed.opacity || "100";
125
- return {
126
- "background-color": `color-mix(in srgb, ${rgb} ${opacity}%, ${cssColor(cssVar("cx"))})`
127
- };
128
- }
129
- ],
130
- // overrides
131
- [/^rotate-(\d+)$/, ([_, d]) => ({ rotate: `${d}deg` })]
132
- ];
133
- function resolveRuleValue(data) {
134
- if (data?.color && data.cssColor?.components) {
135
- let value = data.cssColor.components.join(" ");
136
- if (!/var\s*\((.+)\)(.*)/.test(data.color))
137
- value += ` /* ${data.color} */`;
138
- return value;
139
- }
140
- return null;
141
- }
105
+ :root, .light {
106
+ --un-default-border-color: var(--ui-border);
142
107
 
143
- const preset = definePreset((options = {}) => {
144
- return {
145
- name: "unocss-preset-ui",
146
- theme,
147
- rules,
148
- preflights: [
149
- { getCSS: () => createRootCSS(mergeOptions(options)) }
150
- ],
151
- safelist: Object.keys(theme.animation.keyframes).map((v) => `keyframes-${v}`)
152
- };
153
- });
154
- function mergeOptions(options) {
155
- const defaults = {
156
- radius: "0rem",
157
- radiusBox: "",
158
- radiusButton: "",
159
- radiusCheckbox: "",
160
- radiusRadio: "",
161
- radiusSwitch: "",
162
- radiusTabs: "",
163
- cb: "#1f2937",
164
- cp: "",
165
- cx: "#ffffff"
166
- };
167
- return {
168
- ...defaults,
169
- ...options
170
- };
171
- }
172
- function createRootCSS(kv) {
173
- const join = (input) => input.map((item) => item.endsWith(";") ? item : `${item};`).join("");
174
- const css = [
175
- // initial
176
- `:root{${join(Object.entries(kv).filter(([_, v]) => Boolean(v)).map(([k, v]) => {
177
- const name = kebabCase(k);
178
- const content = parseCssColor(v)?.components.join(" ") ?? v;
179
- return `--${cssVarsPrefix}-${name}:${content}`;
180
- }))}}`,
181
- // reset
182
- `:root{${join([
183
- `color:${cssColor(cssVar("cb"))}`
184
- ])}}`,
185
- `*,::before,::after{${join([
186
- `--un-default-border-color:color-mix(in srgb,${cssColor(cssVar("cb"))} 10%,transparent)`,
187
- `accent-color:${cssColor(cssVar("fill", cssVar("cb")))}`,
188
- `scrollbar-color:color-mix(in srgb,${cssColor(cssVar("cb"))} 25%,transparent) transparent`
189
- ])}}`,
190
- `*::selection{${join([
191
- `color:${cssColor(cssVar("cx"))}`,
192
- `background-color:${cssColor(cssVar("cp", cssVar("cb")))}`
193
- ])}}`
194
- ];
195
- return css.join("");
108
+ --ui-text: var(--ui-color-neutral-700);
109
+ --ui-text-dimmed: var(--ui-color-neutral-400);
110
+ --ui-text-muted: var(--ui-color-neutral-500);
111
+ --ui-text-toned: var(--ui-color-neutral-600);
112
+ --ui-text-highlighted: var(--ui-color-neutral-900);
113
+ --ui-text-inverted: #fff;
114
+
115
+ --ui-bg: #fff;
116
+ --ui-bg-muted: var(--ui-color-neutral-50);
117
+ --ui-bg-elevated: var(--ui-color-neutral-100);
118
+ --ui-bg-accented: var(--ui-color-neutral-200);
119
+ --ui-bg-inverted: var(--ui-color-neutral-900);
120
+
121
+ --ui-border: var(--ui-color-neutral-200);
122
+ --ui-border-muted: var(--ui-color-neutral-200);
123
+ --ui-border-accented: var(--ui-color-neutral-300);
124
+ --ui-border-inverted: var(--ui-color-neutral-900);
125
+
126
+ --ui-radius: 0.25rem;
196
127
  }
197
128
 
198
- const baseUnoConfig = mergeConfigs([
199
- presetUno(),
200
- preset()
201
- ]);
202
- function transformUnoRules(userConfig = {}) {
203
- const { rules = [], theme = {} } = mergeConfigs([baseUnoConfig, userConfig]);
204
- const mergeRules = [];
205
- const toString = (values) => {
206
- const variables = /* @__PURE__ */ new Set([]);
207
- const properties = /* @__PURE__ */ new Set([]);
208
- const propertiesIgnores = /* @__PURE__ */ new Set(["transform"]);
209
- let propertiesOnly = true;
210
- values.forEach((value) => {
211
- if (propertiesIgnores.has(value)) {
212
- properties.add(value);
213
- propertiesOnly = false;
214
- return;
215
- }
216
- if (value.startsWith("--")) {
217
- variables.add(value);
218
- return;
129
+ .dark {
130
+ --ui-text-dimmed: var(--ui-color-neutral-500);
131
+ --ui-text-muted: var(--ui-color-neutral-400);
132
+ --ui-text-toned: var(--ui-color-neutral-300);
133
+ --ui-text: var(--ui-color-neutral-200);
134
+ --ui-text-highlighted: #fff;
135
+ --ui-text-inverted: var(--ui-color-neutral-900);
136
+
137
+ --ui-bg: var(--ui-color-neutral-900);
138
+ --ui-bg-muted: var(--ui-color-neutral-800);
139
+ --ui-bg-elevated: var(--ui-color-neutral-800);
140
+ --ui-bg-accented: var(--ui-color-neutral-700);
141
+ --ui-bg-inverted: #fff;
142
+
143
+ --ui-border: var(--ui-color-neutral-800);
144
+ --ui-border-muted: var(--ui-color-neutral-700);
145
+ --ui-border-accented: var(--ui-color-neutral-700);
146
+ --ui-border-inverted: #fff;
147
+ }`;
148
+ }
219
149
  }
220
- properties.add(value);
221
- });
222
- const valueArray = propertiesOnly && properties.size > 0 ? Array.from(properties.values()) : values;
223
- return valueArray.join(",");
150
+ ]
224
151
  };
225
- const resolveCSSEntries = (entries) => () => toString(entries.flatMap((value) => Object.keys(value)));
226
- const resolveCSSObject = (object) => () => {
227
- if (JSON.stringify(object) === "{}")
228
- return null;
229
- return toString(Object.keys(object));
230
- };
231
- for (const rule of rules) {
232
- const [maybeString, maybeResult] = rule;
233
- const ruleRE = typeof maybeString === "string" ? new RegExp(`^(?:${maybeString})$`) : maybeString;
234
- if (Array.isArray(maybeResult)) {
235
- mergeRules.push([ruleRE, resolveCSSEntries(maybeResult)]);
236
- continue;
237
- }
238
- if (typeof maybeResult === "object") {
239
- mergeRules.push([ruleRE, resolveCSSObject(maybeResult)]);
240
- continue;
241
- }
242
- const matcher = (matches) => {
243
- try {
244
- const result = maybeResult(["", ...matches], {
245
- theme,
246
- // @ts-expect-error pass
247
- generator: { config: {} }
248
- });
249
- if (Array.isArray(result))
250
- return toString(result.filter((i) => typeof i === "object").map((i) => Array.isArray(i) ? i[0] : Object.keys(i).join(",")));
251
- if (typeof result === "object")
252
- return resolveCSSObject(result)();
253
- } catch (e) {
254
- console.warn(`[Fail Rule]`, ruleRE, e.message);
255
- }
256
- return null;
257
- };
258
- mergeRules.push([ruleRE, matcher]);
259
- }
260
- return mergeRules.sort(([r1], [r2]) => r2.source.length - r1.source.length);
152
+ return () => preset;
261
153
  }
262
154
 
263
- export { cssColor, cssVar, cssVarsAll, cssVarsBase, cssVarsDynamic, cssVarsPrefix, preset, rules, theme, transformUnoRules };
264
- //# sourceMappingURL=unocss.mjs.map
155
+ export { createUnoPreset };
@@ -1,26 +1,13 @@
1
- import * as _unplugin from 'unplugin';
2
- import { Options } from 'unplugin-auto-import/types';
3
- import { Options as Options$1 } from 'unplugin-vue-components/types';
4
-
5
- declare const runtimeDir: string;
6
- interface UIOptions {
7
- /**
8
- * prefix for components used in templates
9
- *
10
- * @default "U"
11
- */
12
- prefix?: string;
13
- /** Whether to generate declaration files for auto-imported components. */
14
- dts?: boolean;
15
- /**
16
- * Override options for `unplugin-auto-import`
17
- */
18
- autoImport?: Partial<Options>;
19
- /**
20
- * Override options for `unplugin-vue-components`
21
- */
22
- components?: Partial<Options$1>;
23
- }
24
- declare const unplugin: _unplugin.UnpluginInstance<UIOptions | undefined, boolean>;
25
-
26
- export { type UIOptions, runtimeDir, unplugin };
1
+ import 'unplugin';
2
+ import 'unplugin-auto-import/types';
3
+ import 'unplugin-vue-components/types';
4
+ import './shared/ui.IulR-OYx.mjs';
5
+ export { U as UIOptions, r as runtimeDir, u as unplugin } from './shared/ui.DpbffTXs.mjs';
6
+ import '@nuxt/schema';
7
+ import '@unocss/preset-wind4/colors';
8
+ import '../dist/runtime/types/index.js';
9
+ import '#build/ui';
10
+ import '../dist/runtime/types/style.js';
11
+ import './unocss.mjs';
12
+ import '@unocss/core';
13
+ import '@unocss/preset-wind4/theme';