@byyuurin/ui 0.0.4 → 0.0.5

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 (94) hide show
  1. package/README.md +11 -22
  2. package/dist/index.d.ts +25 -2
  3. package/dist/index.mjs +25 -2
  4. package/dist/nuxt.d.mts +1 -1
  5. package/dist/nuxt.d.ts +1 -1
  6. package/dist/nuxt.mjs +14 -10
  7. package/dist/nuxt.mjs.map +1 -0
  8. package/dist/runtime/components/Accordion.vue +1 -1
  9. package/dist/runtime/components/Alert.vue +120 -0
  10. package/dist/runtime/components/Badge.vue +71 -0
  11. package/dist/runtime/components/Button.vue +3 -2
  12. package/dist/runtime/components/Card.vue +4 -4
  13. package/dist/runtime/components/Checkbox.vue +1 -1
  14. package/dist/runtime/components/Chip.vue +59 -0
  15. package/dist/runtime/components/Drawer.vue +2 -2
  16. package/dist/runtime/components/Input.vue +2 -1
  17. package/dist/runtime/components/Link.vue +1 -1
  18. package/dist/runtime/components/Modal.vue +2 -2
  19. package/dist/runtime/components/PinInput.vue +86 -0
  20. package/dist/runtime/components/Popover.vue +1 -1
  21. package/dist/runtime/components/RadioGroup.vue +1 -1
  22. package/dist/runtime/components/ScrollArea.vue +1 -1
  23. package/dist/runtime/components/Select.vue +2 -1
  24. package/dist/runtime/components/Slider.vue +97 -0
  25. package/dist/runtime/components/Switch.vue +1 -1
  26. package/dist/runtime/components/Tabs.vue +1 -1
  27. package/dist/runtime/components/Textarea.vue +2 -3
  28. package/dist/runtime/components/Toast.vue +1 -1
  29. package/dist/runtime/components/Toaster.vue +2 -1
  30. package/dist/runtime/components/Tooltip.vue +1 -1
  31. package/dist/runtime/theme/accordion.mjs +24 -21
  32. package/dist/runtime/theme/alert.d.ts +85 -0
  33. package/dist/runtime/theme/alert.mjs +47 -0
  34. package/dist/runtime/theme/app.mjs +1 -0
  35. package/dist/runtime/theme/badge.d.ts +79 -0
  36. package/dist/runtime/theme/badge.mjs +89 -0
  37. package/dist/runtime/theme/button.d.ts +4 -1
  38. package/dist/runtime/theme/button.mjs +131 -120
  39. package/dist/runtime/theme/card.d.ts +2 -2
  40. package/dist/runtime/theme/card.mjs +12 -9
  41. package/dist/runtime/theme/checkbox.mjs +45 -42
  42. package/dist/runtime/theme/chip.d.ts +56 -0
  43. package/dist/runtime/theme/chip.mjs +63 -0
  44. package/dist/runtime/theme/drawer.mjs +69 -66
  45. package/dist/runtime/theme/index.d.ts +5 -0
  46. package/dist/runtime/theme/index.mjs +5 -0
  47. package/dist/runtime/theme/input.d.ts +13 -5
  48. package/dist/runtime/theme/input.mjs +135 -122
  49. package/dist/runtime/theme/link.d.ts +1 -1
  50. package/dist/runtime/theme/link.mjs +23 -20
  51. package/dist/runtime/theme/modal.mjs +51 -48
  52. package/dist/runtime/theme/pinInput.d.ts +97 -0
  53. package/dist/runtime/theme/pinInput.mjs +108 -0
  54. package/dist/runtime/theme/popover.mjs +11 -8
  55. package/dist/runtime/theme/radioGroup.mjs +50 -47
  56. package/dist/runtime/theme/scrollArea.mjs +24 -21
  57. package/dist/runtime/theme/select.d.ts +5 -2
  58. package/dist/runtime/theme/select.mjs +156 -143
  59. package/dist/runtime/theme/slider.d.ts +73 -0
  60. package/dist/runtime/theme/slider.mjs +49 -0
  61. package/dist/runtime/theme/switch.mjs +66 -63
  62. package/dist/runtime/theme/tabs.d.ts +12 -2
  63. package/dist/runtime/theme/tabs.mjs +132 -113
  64. package/dist/runtime/theme/textarea.d.ts +5 -2
  65. package/dist/runtime/theme/textarea.mjs +103 -90
  66. package/dist/runtime/theme/toast.mjs +26 -23
  67. package/dist/runtime/theme/toaster.d.ts +2 -2
  68. package/dist/runtime/theme/toaster.mjs +84 -81
  69. package/dist/runtime/theme/tooltip.mjs +9 -6
  70. package/dist/runtime/types/components.d.ts +5 -0
  71. package/dist/runtime/types/index.d.ts +1 -3
  72. package/dist/runtime/utils/extend-theme.mjs +1 -1
  73. package/dist/runtime/utils/link.d.ts +1 -1
  74. package/dist/shared/ui.CzDyI29e.mjs +8 -0
  75. package/dist/shared/ui.CzDyI29e.mjs.map +1 -0
  76. package/dist/unocss-preset.mjs +44 -35
  77. package/dist/unocss-preset.mjs.map +1 -0
  78. package/dist/unplugin.d.mts +25 -0
  79. package/dist/unplugin.d.ts +25 -0
  80. package/dist/unplugin.mjs +64 -0
  81. package/dist/unplugin.mjs.map +1 -0
  82. package/dist/vite.d.mts +9 -0
  83. package/dist/vite.d.ts +9 -0
  84. package/dist/vite.mjs +14 -0
  85. package/dist/vite.mjs.map +1 -0
  86. package/package.json +17 -10
  87. package/dist/resolver.d.mts +0 -13
  88. package/dist/resolver.d.ts +0 -13
  89. package/dist/resolver.mjs +0 -21
  90. package/dist/runtime/components/index.d.ts +0 -20
  91. package/dist/runtime/components/index.mjs +0 -20
  92. package/dist/runtime/composables/index.d.ts +0 -5
  93. package/dist/runtime/composables/index.mjs +0 -5
  94. package/dist/shared/ui.Cmq14xN9.mjs +0 -25
@@ -1,100 +1,113 @@
1
1
  import { ct } from "@byyuurin/ui-kit";
2
- export default ct({
3
- slots: {
4
- root: "rounded-ui-base transition-colors aria-disabled:opacity-50",
5
- base: [
6
- "w-full color-inherit bg-transparent border-0 resize-none placeholder:color-ui-cb/50",
7
- "focus:outline-none",
8
- "disabled:cursor-not-allowed"
9
- ]
10
- },
11
- variants: {
12
- size: {
13
- xs: {
14
- root: "text-xs"
15
- },
16
- sm: {
17
- root: "text-sm"
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ root: "rounded-ui-base transition-colors aria-disabled:opacity-50",
7
+ base: [
8
+ "w-full color-inherit bg-transparent border-0 resize-none placeholder:color-ui-cb/50",
9
+ "focus:outline-none",
10
+ "disabled:cursor-not-allowed"
11
+ ]
12
+ },
13
+ variants: {
14
+ size: {
15
+ xs: {
16
+ root: "text-xs"
17
+ },
18
+ sm: {
19
+ root: "text-sm"
20
+ },
21
+ md: {
22
+ root: "text-base"
23
+ },
24
+ lg: {
25
+ root: "text-lg"
26
+ },
27
+ xl: {
28
+ root: "text-xl"
29
+ }
18
30
  },
19
- md: {
20
- root: "text-base"
31
+ variant: {
32
+ "outline": {
33
+ root: [
34
+ "color-ui-cb/80 bg-ui-c1 ring ring-inset ring-ui-cb/50",
35
+ "focus-within:ring-2 focus-within:ring-ui-cb/50",
36
+ "aria-disabled:ring-ui-cb/80 hover:aria-disabled:ring-ui-cb/80"
37
+ ]
38
+ },
39
+ "soft": {
40
+ root: [
41
+ "color-ui-cb/80 bg-ui-cb/4",
42
+ "hover:bg-ui-cb/6 hover:color-ui-cb/80 focus-within:bg-ui-cb/8 focus-within:color-ui-cb/85",
43
+ "aria-disabled:color-ui-content/80 aria-disabled:bg-ui-fill/5 hover:aria-disabled:color-ui-content/80 hover:aria-disabled:bg-ui-fill/5"
44
+ ]
45
+ },
46
+ "soft-outline": {
47
+ root: [
48
+ "color-ui-cb/80 bg-ui-cb/4 ring ring-inset ring-ui-cb/10",
49
+ "hover:bg-ui-cb/6 hover:color-ui-cb/80 focus-within:bg-ui-cb/8 focus-within:color-ui-cb/85",
50
+ "aria-disabled:color-ui-content/80 aria-disabled:bg-ui-fill/5 hover:aria-disabled:color-ui-content/80 hover:aria-disabled:bg-ui-fill/5"
51
+ ]
52
+ },
53
+ "ghost": {
54
+ root: [
55
+ "color-ui-cb/80 bg-transparent",
56
+ "hover:bg-ui-cb/6 hover:color-ui-cb/80 focus-within:bg-ui-cb/8 focus-within:color-ui-cb/85",
57
+ "aria-disabled:color-ui-fill/80 aria-disabled:bg-transparent hover:aria-disabled:color-ui-fill/80 hover:aria-disabled:bg-transparent"
58
+ ]
59
+ },
60
+ "none": {
61
+ root: "color-ui-cb bg-transparent"
62
+ }
21
63
  },
22
- lg: {
23
- root: "text-lg"
64
+ underline: {
65
+ true: ""
24
66
  },
25
- xl: {
26
- root: "text-xl"
67
+ highlight: {
68
+ true: {
69
+ base: ""
70
+ }
27
71
  }
28
72
  },
29
- variant: {
30
- outline: {
31
- root: [
32
- "color-ui-cb/80 bg-ui-c1 ring ring-inset ring-ui-cb/50",
33
- "focus-within:ring-2 focus-within:ring-ui-cb/50",
34
- "aria-disabled:ring-ui-cb/80 hover:aria-disabled:ring-ui-cb/80"
35
- ]
73
+ compoundVariants: [
74
+ {
75
+ variant: ["soft", "ghost", "none"],
76
+ highlight: false,
77
+ underline: true,
78
+ class: {
79
+ root: [
80
+ "relative after:content-empty after:absolute after:inset-x-0 after:bottom-0 after:h-1px after:bg-ui-cb/40",
81
+ "focus-within:after:h-2px focus-within:after:bg-ui-fill/60"
82
+ ]
83
+ }
36
84
  },
37
- soft: {
38
- root: [
39
- "color-ui-cb/80 bg-ui-cb/4",
40
- "hover:bg-ui-cb/6 hover:color-ui-cb/80 focus-within:bg-ui-cb/8 focus-within:color-ui-cb/85",
41
- "aria-disabled:color-ui-content/80 aria-disabled:bg-ui-fill/5 hover:aria-disabled:color-ui-content/80 hover:aria-disabled:bg-ui-fill/5"
42
- ]
85
+ {
86
+ size: ["xs", "sm", "md"],
87
+ class: {
88
+ root: "p-1.5 px-2.5"
89
+ }
43
90
  },
44
- ghost: {
45
- root: [
46
- "color-ui-cb/80 bg-transparent",
47
- "hover:bg-ui-cb/6 hover:color-ui-cb/80 focus-within:bg-ui-cb/8 focus-within:color-ui-cb/85",
48
- "aria-disabled:color-ui-fill/80 aria-disabled:bg-transparent hover:aria-disabled:color-ui-fill/80 hover:aria-disabled:bg-transparent"
49
- ]
91
+ {
92
+ size: ["lg", "xl"],
93
+ class: {
94
+ root: "p-2.5 px-3.5"
95
+ }
50
96
  },
51
- none: {
52
- root: "color-ui-cb bg-transparent"
53
- }
54
- },
55
- underline: {
56
- true: ""
57
- },
58
- highlight: {
59
- true: {
60
- base: ""
61
- }
62
- }
63
- },
64
- compoundVariants: [
65
- {
66
- variant: ["soft", "ghost", "none"],
67
- highlight: false,
68
- underline: true,
69
- class: {
70
- root: "relative after:content-empty after:absolute after:inset-x-0 after:bottom-0 after:h-1px after:bg-ui-cb/40"
71
- }
72
- },
73
- {
74
- size: ["xs", "sm", "md"],
75
- class: {
76
- root: "p-1.5 px-2.5"
77
- }
78
- },
79
- {
80
- size: ["lg", "xl"],
81
- class: {
82
- root: "p-2.5 px-3.5"
83
- }
84
- },
85
- {
86
- variant: ["soft", "ghost", "none"],
87
- highlight: true,
88
- class: {
89
- root: "ring ring-inset ring-ui-fill/80"
90
- }
91
- },
92
- {
93
- variant: ["outline"],
94
- highlight: true,
95
- class: {
96
- root: "ring-2 ring-ui-fill/80 focus-within:ring-ui-fill/80"
97
+ {
98
+ variant: ["soft", "soft-outline", "ghost", "none"],
99
+ highlight: true,
100
+ class: {
101
+ root: "ring ring-inset ring-ui-fill/80"
102
+ }
103
+ },
104
+ {
105
+ variant: ["outline"],
106
+ highlight: true,
107
+ class: {
108
+ root: "ring-2 ring-ui-fill/80 focus-within:ring-ui-fill/80"
109
+ }
97
110
  }
98
- }
99
- ]
100
- });
111
+ ]
112
+ }
113
+ );
@@ -1,27 +1,30 @@
1
1
  import { ct } from "@byyuurin/ui-kit";
2
- export default ct({
3
- slots: {
4
- root: "relative group overflow-hidden bg-ui-c1 shadow-lg rounded-ui-box ring ring-ui-c2 p-4 flex gap-2.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ui-c2",
5
- wrapper: "w-0 flex-1 flex flex-col gap-1",
6
- title: "text-base font-medium color-ui-cb",
7
- description: "text-sm color-ui-cb/80",
8
- icon: "shrink-0 size-6 color-ui-cb",
9
- avatar: "shrink-0",
10
- avatarSize: "2xl",
11
- actions: "flex flex-wrap gap-1.5 shrink-0",
12
- progress: "absolute inset-x-[var(--ui-radius-box)] bottom-0 h-1 z-[-1] color-ui-base/80 bg-current rounded-ui-base",
13
- close: "p-0.5"
14
- },
15
- variants: {
16
- multiline: {
17
- true: {
18
- root: "items-start",
19
- actions: "items-start mt-1"
20
- },
21
- false: {
22
- root: "items-center",
23
- actions: "items-center"
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ root: "relative group overflow-hidden bg-ui-c1 shadow-lg rounded-ui-box ring ring-ui-c2 p-4 flex gap-2.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ui-c2",
7
+ wrapper: "w-0 flex-1 flex flex-col gap-1",
8
+ title: "text-base font-medium color-ui-cb",
9
+ description: "text-sm color-ui-cb/80",
10
+ icon: "shrink-0 size-6 color-ui-cb",
11
+ avatar: "shrink-0",
12
+ avatarSize: "2xl",
13
+ actions: "flex flex-wrap gap-1.5 shrink-0",
14
+ progress: "absolute inset-x-[var(--ui-radius-box)] bottom-0 h-1 z-[-1] color-ui-base/80 bg-current rounded-ui-base",
15
+ close: "p-0.5"
16
+ },
17
+ variants: {
18
+ multiline: {
19
+ true: {
20
+ root: "items-start",
21
+ actions: "items-start mt-1"
22
+ },
23
+ false: {
24
+ root: "items-center",
25
+ actions: "items-center"
26
+ }
24
27
  }
25
28
  }
26
29
  }
27
- });
30
+ );
@@ -41,14 +41,14 @@ declare const _default: {
41
41
  };
42
42
  };
43
43
  compoundVariants: ({
44
- position: ("top-left" | "top-center" | "top-right")[];
44
+ position: ("top-right" | "top-left" | "top-center")[];
45
45
  class: {
46
46
  viewport: string;
47
47
  base: string;
48
48
  };
49
49
  swipeDirection?: undefined;
50
50
  } | {
51
- position: ("bottom-left" | "bottom-center" | "bottom-right")[];
51
+ position: ("bottom-right" | "bottom-left" | "bottom-center")[];
52
52
  class: {
53
53
  viewport: string;
54
54
  base: string;
@@ -1,89 +1,92 @@
1
1
  import { ct } from "@byyuurin/ui-kit";
2
- export default ct({
3
- slots: {
4
- viewport: [
5
- "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] focus:outline-none",
6
- "data-[expanded=true]:h-[var(--height)]"
7
- ],
8
- base: [
9
- "pointer-events-auto absolute inset-x-0 z-[var(--index)] [transform:var(--transform)] transition-all duration-200 ease-out",
10
- "[&[data-expanded=false][data-front=false]]:h-[var(--front-height)]",
11
- "[&[data-expanded=false][data-front=false]>*]:invisible",
12
- "data-[state=closed]:animate-[toast-closed_200ms_ease-in-out]",
13
- "[&[data-state=closed][data-expanded=false][data-front=false]]:animate-[toast-collapsed-closed_200ms_ease-in-out]",
14
- "data-[swipe=move]:transition-none"
15
- ]
16
- },
17
- variants: {
18
- position: {
19
- "top-left": {
20
- viewport: "left-4"
21
- },
22
- "top-center": {
23
- viewport: "left-1/2 -translate-x-1/2"
24
- },
25
- "top-right": {
26
- viewport: "right-4"
27
- },
28
- "bottom-left": {
29
- viewport: "left-4"
30
- },
31
- "bottom-center": {
32
- viewport: "left-1/2 -translate-x-1/2"
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ viewport: [
7
+ "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] focus:outline-none",
8
+ "data-[expanded=true]:h-[var(--height)]"
9
+ ],
10
+ base: [
11
+ "pointer-events-auto absolute inset-x-0 z-[var(--index)] [transform:var(--transform)] transition-all duration-200 ease-out",
12
+ "[&[data-expanded=false][data-front=false]]:h-[var(--front-height)]",
13
+ "[&[data-expanded=false][data-front=false]>*]:invisible",
14
+ "data-[state=closed]:animate-[toast-closed_200ms_ease-in-out]",
15
+ "[&[data-state=closed][data-expanded=false][data-front=false]]:animate-[toast-collapsed-closed_200ms_ease-in-out]",
16
+ "data-[swipe=move]:transition-none"
17
+ ]
18
+ },
19
+ variants: {
20
+ position: {
21
+ "top-left": {
22
+ viewport: "left-4"
23
+ },
24
+ "top-center": {
25
+ viewport: "left-1/2 -translate-x-1/2"
26
+ },
27
+ "top-right": {
28
+ viewport: "right-4"
29
+ },
30
+ "bottom-left": {
31
+ viewport: "left-4"
32
+ },
33
+ "bottom-center": {
34
+ viewport: "left-1/2 -translate-x-1/2"
35
+ },
36
+ "bottom-right": {
37
+ viewport: "right-4"
38
+ }
33
39
  },
34
- "bottom-right": {
35
- viewport: "right-4"
40
+ swipeDirection: {
41
+ up: {
42
+ base: "data-[swipe=end]:animate-[toast-slide-up_200ms_ease-out]"
43
+ },
44
+ right: {
45
+ base: "data-[swipe=end]:animate-[toast-slide-right_200ms_ease-out]"
46
+ },
47
+ down: {
48
+ base: "data-[swipe=end]:animate-[toast-slide-down_200ms_ease-out]"
49
+ },
50
+ left: {
51
+ base: "data-[swipe=end]:animate-[toast-slide-left_200ms_ease-out]"
52
+ }
36
53
  }
37
54
  },
38
- swipeDirection: {
39
- up: {
40
- base: "data-[swipe=end]:animate-[toast-slide-up_200ms_ease-out]"
55
+ compoundVariants: [
56
+ {
57
+ position: ["top-left", "top-center", "top-right"],
58
+ class: {
59
+ viewport: "top-4",
60
+ base: "top-0 data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out]"
61
+ }
41
62
  },
42
- right: {
43
- base: "data-[swipe=end]:animate-[toast-slide-right_200ms_ease-out]"
63
+ {
64
+ position: ["bottom-left", "bottom-center", "bottom-right"],
65
+ class: {
66
+ viewport: "bottom-4",
67
+ base: "bottom-0 data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out]"
68
+ }
44
69
  },
45
- down: {
46
- base: "data-[swipe=end]:animate-[toast-slide-down_200ms_ease-out]"
70
+ {
71
+ swipeDirection: ["left", "right"],
72
+ class: {
73
+ base: [
74
+ "data-[swipe=move]:translate-x-[var(--reka-toast-swipe-move-x)]",
75
+ "data-[swipe=end]:translate-x-[var(--reka-toast-swipe-end-x)]",
76
+ "data-[swipe=cancel]:translate-x-0"
77
+ ]
78
+ }
47
79
  },
48
- left: {
49
- base: "data-[swipe=end]:animate-[toast-slide-left_200ms_ease-out]"
50
- }
51
- }
52
- },
53
- compoundVariants: [
54
- {
55
- position: ["top-left", "top-center", "top-right"],
56
- class: {
57
- viewport: "top-4",
58
- base: "top-0 data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out]"
80
+ {
81
+ swipeDirection: ["up", "down"],
82
+ class: {
83
+ base: [
84
+ "data-[swipe=move]:translate-y-[var(--reka-toast-swipe-move-y)]",
85
+ "data-[swipe=end]:translate-y-[var(--reka-toast-swipe-end-y)]",
86
+ "data-[swipe=cancel]:translate-y-0"
87
+ ]
88
+ }
59
89
  }
60
- },
61
- {
62
- position: ["bottom-left", "bottom-center", "bottom-right"],
63
- class: {
64
- viewport: "bottom-4",
65
- base: "bottom-0 data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out]"
66
- }
67
- },
68
- {
69
- swipeDirection: ["left", "right"],
70
- class: {
71
- base: [
72
- "data-[swipe=move]:translate-x-[var(--reka-toast-swipe-move-x)]",
73
- "data-[swipe=end]:translate-x-[var(--reka-toast-swipe-end-x)]",
74
- "data-[swipe=cancel]:translate-x-0"
75
- ]
76
- }
77
- },
78
- {
79
- swipeDirection: ["up", "down"],
80
- class: {
81
- base: [
82
- "data-[swipe=move]:translate-y-[var(--reka-toast-swipe-move-y)]",
83
- "data-[swipe=end]:translate-y-[var(--reka-toast-swipe-end-y)]",
84
- "data-[swipe=cancel]:translate-y-0"
85
- ]
86
- }
87
- }
88
- ]
89
- });
90
+ ]
91
+ }
92
+ );
@@ -1,8 +1,11 @@
1
1
  import { ct } from "@byyuurin/ui-kit";
2
- export default ct({
3
- slots: {
4
- content: "flex items-center gap-1 bg-ui-c1 color-ui-base shadow-sm rounded-ui-base ring ring-ui-base/10 h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
5
- arrow: "fill-ui-c1 stroke-ui-cb/10",
6
- text: "truncate"
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ content: "flex items-center gap-1 bg-ui-c1 color-ui-base shadow-sm rounded-ui-base ring ring-ui-base/10 h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
7
+ arrow: "fill-ui-c1 stroke-ui-cb/10",
8
+ text: "truncate"
9
+ }
7
10
  }
8
- });
11
+ );
@@ -1,17 +1,22 @@
1
1
  export type * from '../components/Accordion.vue';
2
+ export type * from '../components/Alert.vue';
2
3
  export type * from '../components/App.vue';
3
4
  export type * from '../components/App.vue';
5
+ export type * from '../components/Badge.vue';
4
6
  export type * from '../components/Button.vue';
5
7
  export type * from '../components/Card.vue';
6
8
  export type * from '../components/Checkbox.vue';
9
+ export type * from '../components/Chip.vue';
7
10
  export type * from '../components/Drawer.vue';
8
11
  export type * from '../components/Input.vue';
9
12
  export type * from '../components/Link.vue';
10
13
  export type * from '../components/Modal.vue';
14
+ export type * from '../components/PinInput.vue';
11
15
  export type * from '../components/Popover.vue';
12
16
  export type * from '../components/RadioGroup.vue';
13
17
  export type * from '../components/ScrollArea.vue';
14
18
  export type * from '../components/Select.vue';
19
+ export type * from '../components/Slider.vue';
15
20
  export type * from '../components/Switch.vue';
16
21
  export type * from '../components/Tabs.vue';
17
22
  export type * from '../components/Textarea.vue';
@@ -1,7 +1,5 @@
1
- import type * as _components from '../components';
2
1
  import type * as theme from '../theme';
3
- import type { PartialTheme } from '.';
2
+ import type { PartialTheme } from './utils';
4
3
  export * from './components';
5
4
  export * from './utils';
6
5
  export type ThemeExtension = PartialTheme<typeof theme>;
7
- export type ComponentName = keyof typeof _components;
@@ -1,6 +1,6 @@
1
1
  import { createDefu } from "defu";
2
2
  export const extendTheme = createDefu((obj, key, value) => {
3
- if (key === "global") {
3
+ if (key === "app") {
4
4
  obj[key] = { ...obj[key], ...value };
5
5
  return true;
6
6
  }
@@ -1,8 +1,8 @@
1
1
  import type { LinkProps } from '../types';
2
2
  export declare function pickLinkProps(props: LinkProps & Partial<Pick<HTMLAnchorElement, 'ariaLabel' | 'title'>>): {
3
3
  disabled: any;
4
- active: any;
5
4
  title: any;
5
+ active: any;
6
6
  type: any;
7
7
  ariaLabel: any;
8
8
  rel: any;
@@ -0,0 +1,8 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { normalize } from 'pathe';
3
+
4
+ const packageName = "@byyuurin/ui";
5
+ const runtimeDir = normalize(fileURLToPath(new URL("../runtime", import.meta.url)));
6
+
7
+ export { packageName as p, runtimeDir as r };
8
+ //# sourceMappingURL=ui.CzDyI29e.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.CzDyI29e.mjs","sources":["../../src/internal/shared.ts"],"sourcesContent":["import { fileURLToPath } from 'node:url'\r\nimport { normalize } from 'pathe'\r\n\r\nexport const packageName = '@byyuurin/ui'\r\n\r\nexport const runtimeDir = normalize(fileURLToPath(new URL('../runtime', import.meta.url)))\r\n"],"names":[],"mappings":";;;AAGO,MAAM,WAAc,GAAA;AAEd,MAAA,UAAA,GAAa,UAAU,aAAc,CAAA,IAAI,IAAI,YAAc,EAAA,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAC;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { definePreset, mergeConfigs } from '@unocss/core';
2
2
  import { parseColor, parseCssColor } from '@unocss/preset-mini/utils';
3
+ import { kebabCase } from 'scule';
3
4
  import { presetUno } from '@unocss/preset-uno';
4
5
 
5
6
  const cssVarsPrefix = "ui";
@@ -7,40 +8,6 @@ const cssVarsBase = ["cb", "c1", "c2", "c3"];
7
8
  const cssVarsDynamic = ["fill", "content"];
8
9
  const cssVarsAll = [...cssVarsBase, ...cssVarsDynamic];
9
10
 
10
- const rules = [
11
- [
12
- new RegExp(`^${cssVarsPrefix}-([^/]+)$`),
13
- ([_, color], ctx) => {
14
- const data = parseColor(color, ctx.theme);
15
- const value = resolveRuleValue(data);
16
- if (value)
17
- return Object.fromEntries(cssVarsDynamic.map((prop) => [`--${cssVarsPrefix}-${prop}`, value]));
18
- },
19
- { autocomplete: `${cssVarsPrefix}-$colors` }
20
- ],
21
- [
22
- new RegExp(`^${cssVarsPrefix}-(?:(${cssVarsAll.join("|")})-)([^/]+)$`),
23
- ([_, prop, color], ctx) => {
24
- const data = parseColor(color, ctx.theme);
25
- const value = resolveRuleValue(data);
26
- if (value)
27
- return { [`--${cssVarsPrefix}-${prop}`]: value };
28
- },
29
- { autocomplete: `${cssVarsPrefix}-(${cssVarsAll.join("|")})-$colors` }
30
- ],
31
- // overrides
32
- [/^rotate-(\d+)$/, ([_, d]) => ({ rotate: `${d}deg` })]
33
- ];
34
- function resolveRuleValue(data) {
35
- if (data?.color && data.cssColor?.components) {
36
- let value = data.cssColor.components.join(" ");
37
- if (!/var\s*\((.+)\)(.*)/.test(data.color))
38
- value += ` /* ${data.color} */`;
39
- return value;
40
- }
41
- return null;
42
- }
43
-
44
11
  const theme = {
45
12
  colors: {
46
13
  [cssVarsPrefix]: {
@@ -112,6 +79,48 @@ function cssColor(...rgb) {
112
79
  return `rgb(${rgb.join(" ")})`;
113
80
  }
114
81
 
82
+ const rules = [
83
+ [
84
+ new RegExp(`^${cssVarsPrefix}-([^/]+)$`),
85
+ ([_, color], ctx) => {
86
+ if (color === "base")
87
+ return Object.fromEntries(cssVarsDynamic.map((prop) => [`--${cssVarsPrefix}-${prop}`, cssVar("cb")]));
88
+ if (color === "base-inverted")
89
+ return Object.fromEntries(cssVarsDynamic.map((prop) => [`--${cssVarsPrefix}-${prop}`, cssVar("c1")]));
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 === "base")
101
+ return { [`--${cssVarsPrefix}-${prop}`]: cssVar("cb") };
102
+ if (color === "base-inverted")
103
+ return { [`--${cssVarsPrefix}-${prop}`]: cssVar("c1") };
104
+ const data = parseColor(color, ctx.theme);
105
+ const value = resolveRuleValue(data);
106
+ if (value)
107
+ return { [`--${cssVarsPrefix}-${prop}`]: value };
108
+ },
109
+ { autocomplete: `${cssVarsPrefix}-(${cssVarsAll.join("|")})-$colors` }
110
+ ],
111
+ // overrides
112
+ [/^rotate-(\d+)$/, ([_, d]) => ({ rotate: `${d}deg` })]
113
+ ];
114
+ function resolveRuleValue(data) {
115
+ if (data?.color && data.cssColor?.components) {
116
+ let value = data.cssColor.components.join(" ");
117
+ if (!/var\s*\((.+)\)(.*)/.test(data.color))
118
+ value += ` /* ${data.color} */`;
119
+ return value;
120
+ }
121
+ return null;
122
+ }
123
+
115
124
  const preset = definePreset((options = {}) => {
116
125
  return {
117
126
  name: "unocss-preset-ui",
@@ -143,7 +152,6 @@ function mergeOptions(options) {
143
152
  };
144
153
  }
145
154
  function createRootCSS(kv) {
146
- const kebabCase = (input) => input.replace(/([A-Z][^A-Z]*)/g, "-$1").replace(/^-/, "").toLowerCase();
147
155
  const join = (input) => input.map((item) => item.endsWith(";") ? item : `${item};`).join("");
148
156
  const css = [
149
157
  // initial
@@ -216,3 +224,4 @@ function transformUnoRules(userConfig = {}) {
216
224
  }
217
225
 
218
226
  export { cssColor, cssVar, cssVarsAll, cssVarsBase, cssVarsDynamic, cssVarsPrefix, preset as default, preset, rules, theme, transformUnoRules };
227
+ //# sourceMappingURL=unocss-preset.mjs.map