@byyuurin/ui 0.0.3 → 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 (142) hide show
  1. package/README.md +15 -24
  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/App.vue +5 -1
  11. package/dist/runtime/components/Badge.vue +71 -0
  12. package/dist/runtime/components/Button.vue +3 -3
  13. package/dist/runtime/components/Card.vue +4 -4
  14. package/dist/runtime/components/Checkbox.vue +3 -6
  15. package/dist/runtime/components/Chip.vue +59 -0
  16. package/dist/runtime/components/Drawer.vue +2 -2
  17. package/dist/runtime/components/Input.vue +7 -2
  18. package/dist/runtime/components/Link.vue +1 -1
  19. package/dist/runtime/components/Modal.vue +2 -2
  20. package/dist/runtime/components/ModalProvider.vue +1 -1
  21. package/dist/runtime/components/PinInput.vue +86 -0
  22. package/dist/runtime/components/Popover.vue +1 -1
  23. package/dist/runtime/components/RadioGroup.vue +2 -8
  24. package/dist/runtime/components/ScrollArea.vue +72 -0
  25. package/dist/runtime/components/Select.vue +2 -1
  26. package/dist/runtime/components/Slider.vue +97 -0
  27. package/dist/runtime/components/Switch.vue +1 -2
  28. package/dist/runtime/components/Tabs.vue +6 -6
  29. package/dist/runtime/components/Textarea.vue +172 -0
  30. package/dist/runtime/components/Toast.vue +2 -2
  31. package/dist/runtime/components/Toaster.vue +2 -1
  32. package/dist/runtime/components/Tooltip.vue +1 -1
  33. package/dist/runtime/composables/defineInjection.d.ts +11 -0
  34. package/dist/runtime/composables/defineInjection.mjs +9 -0
  35. package/dist/runtime/composables/useModal.d.ts +1 -1
  36. package/dist/runtime/composables/useModal.mjs +3 -2
  37. package/dist/runtime/composables/useTheme.d.ts +3 -1
  38. package/dist/runtime/composables/useTheme.mjs +14 -6
  39. package/dist/runtime/theme/accordion.mjs +24 -21
  40. package/dist/runtime/theme/alert.d.ts +85 -0
  41. package/dist/runtime/theme/alert.mjs +47 -0
  42. package/dist/runtime/theme/app.mjs +1 -0
  43. package/dist/runtime/theme/badge.d.ts +79 -0
  44. package/dist/runtime/theme/badge.mjs +89 -0
  45. package/dist/runtime/theme/button.d.ts +4 -9
  46. package/dist/runtime/theme/button.mjs +130 -127
  47. package/dist/runtime/theme/card.d.ts +2 -2
  48. package/dist/runtime/theme/card.mjs +12 -9
  49. package/dist/runtime/theme/checkbox.d.ts +0 -12
  50. package/dist/runtime/theme/checkbox.mjs +45 -47
  51. package/dist/runtime/theme/chip.d.ts +56 -0
  52. package/dist/runtime/theme/chip.mjs +63 -0
  53. package/dist/runtime/theme/drawer.mjs +69 -66
  54. package/dist/runtime/theme/index.d.ts +7 -0
  55. package/dist/runtime/theme/index.mjs +7 -0
  56. package/dist/runtime/theme/input.d.ts +13 -5
  57. package/dist/runtime/theme/input.mjs +135 -122
  58. package/dist/runtime/theme/link.d.ts +1 -1
  59. package/dist/runtime/theme/link.mjs +23 -20
  60. package/dist/runtime/theme/modal.mjs +51 -48
  61. package/dist/runtime/theme/pinInput.d.ts +97 -0
  62. package/dist/runtime/theme/pinInput.mjs +108 -0
  63. package/dist/runtime/theme/popover.mjs +11 -8
  64. package/dist/runtime/theme/radioGroup.d.ts +0 -24
  65. package/dist/runtime/theme/radioGroup.mjs +50 -59
  66. package/dist/runtime/theme/scrollArea.d.ts +51 -0
  67. package/dist/runtime/theme/scrollArea.mjs +33 -0
  68. package/dist/runtime/theme/select.d.ts +5 -2
  69. package/dist/runtime/theme/select.mjs +156 -143
  70. package/dist/runtime/theme/slider.d.ts +73 -0
  71. package/dist/runtime/theme/slider.mjs +49 -0
  72. package/dist/runtime/theme/switch.d.ts +0 -12
  73. package/dist/runtime/theme/switch.mjs +66 -69
  74. package/dist/runtime/theme/tabs.d.ts +44 -13
  75. package/dist/runtime/theme/tabs.mjs +132 -106
  76. package/dist/runtime/theme/textarea.d.ts +93 -0
  77. package/dist/runtime/theme/textarea.mjs +113 -0
  78. package/dist/runtime/theme/toast.mjs +26 -23
  79. package/dist/runtime/theme/toaster.d.ts +2 -2
  80. package/dist/runtime/theme/toaster.mjs +84 -81
  81. package/dist/runtime/theme/tooltip.mjs +9 -6
  82. package/dist/runtime/types/components.d.ts +7 -0
  83. package/dist/runtime/types/index.d.ts +1 -3
  84. package/dist/runtime/utils/extend-theme.mjs +1 -1
  85. package/dist/runtime/utils/index.d.ts +0 -11
  86. package/dist/runtime/utils/index.mjs +0 -11
  87. package/dist/runtime/utils/link.d.ts +1 -1
  88. package/dist/shared/ui.CzDyI29e.mjs +8 -0
  89. package/dist/shared/ui.CzDyI29e.mjs.map +1 -0
  90. package/dist/unocss-preset.d.mts +15 -7
  91. package/dist/unocss-preset.d.ts +15 -7
  92. package/dist/unocss-preset.mjs +97 -384
  93. package/dist/unocss-preset.mjs.map +1 -0
  94. package/dist/unplugin.d.mts +25 -0
  95. package/dist/unplugin.d.ts +25 -0
  96. package/dist/unplugin.mjs +64 -0
  97. package/dist/unplugin.mjs.map +1 -0
  98. package/dist/vite.d.mts +9 -0
  99. package/dist/vite.d.ts +9 -0
  100. package/dist/vite.mjs +14 -0
  101. package/dist/vite.mjs.map +1 -0
  102. package/package.json +22 -14
  103. package/dist/index.cjs +0 -38
  104. package/dist/resolver.d.mts +0 -13
  105. package/dist/resolver.d.ts +0 -13
  106. package/dist/resolver.mjs +0 -21
  107. package/dist/runtime/components/index.cjs +0 -132
  108. package/dist/runtime/components/index.d.ts +0 -18
  109. package/dist/runtime/components/index.mjs +0 -18
  110. package/dist/runtime/composables/index.cjs +0 -33
  111. package/dist/runtime/composables/index.d.ts +0 -4
  112. package/dist/runtime/composables/index.mjs +0 -4
  113. package/dist/runtime/composables/useComponentIcons.cjs +0 -30
  114. package/dist/runtime/composables/useModal.cjs +0 -55
  115. package/dist/runtime/composables/useTheme.cjs +0 -30
  116. package/dist/runtime/composables/useToast.cjs +0 -51
  117. package/dist/runtime/theme/accordion.cjs +0 -27
  118. package/dist/runtime/theme/app.cjs +0 -15
  119. package/dist/runtime/theme/button.cjs +0 -127
  120. package/dist/runtime/theme/card.cjs +0 -17
  121. package/dist/runtime/theme/checkbox.cjs +0 -56
  122. package/dist/runtime/theme/drawer.cjs +0 -73
  123. package/dist/runtime/theme/index.cjs +0 -125
  124. package/dist/runtime/theme/input.cjs +0 -115
  125. package/dist/runtime/theme/link.cjs +0 -23
  126. package/dist/runtime/theme/modal.cjs +0 -55
  127. package/dist/runtime/theme/popover.cjs +0 -13
  128. package/dist/runtime/theme/radioGroup.cjs +0 -73
  129. package/dist/runtime/theme/select.cjs +0 -128
  130. package/dist/runtime/theme/switch.cjs +0 -73
  131. package/dist/runtime/theme/tabs.cjs +0 -105
  132. package/dist/runtime/theme/toast.cjs +0 -33
  133. package/dist/runtime/theme/toaster.cjs +0 -72
  134. package/dist/runtime/theme/tooltip.cjs +0 -14
  135. package/dist/runtime/types/components.cjs +0 -1
  136. package/dist/runtime/types/index.cjs +0 -27
  137. package/dist/runtime/types/utils.cjs +0 -1
  138. package/dist/runtime/utils/extend-theme.cjs +0 -24
  139. package/dist/runtime/utils/index.cjs +0 -119
  140. package/dist/runtime/utils/link.cjs +0 -10
  141. package/dist/runtime/utils/styler.cjs +0 -18
  142. package/dist/shared/ui.CPXA9QoM.mjs +0 -23
@@ -1,18 +1,26 @@
1
- import { createMergeRules } from "@byyuurin/ui/unocss-preset";
1
+ import { transformUnoRules } from "@byyuurin/ui/unocss-preset";
2
2
  import { createSharedComposable } from "@vueuse/core";
3
3
  import { computed, toValue } from "vue";
4
4
  import * as theme from "../theme/index.mjs";
5
- import { createInjection, extendTheme, prepareStyler } from "../utils/index.mjs";
5
+ import { extendTheme, prepareStyler } from "../utils/index.mjs";
6
+ import { defineInjection } from "./defineInjection.mjs";
6
7
  export const {
8
+ InjectionKey: InjectionKeyThemeExtension,
7
9
  provide: provideThemeExtension,
8
10
  inject: injectThemeExtension
9
- } = createInjection("ui.themeExtension", {});
11
+ } = defineInjection("ui.themeExtension", {});
12
+ export const {
13
+ InjectionKey: InjectionKeyUnoConfig,
14
+ provide: provideUnoConfig,
15
+ inject: injectUnoConfig
16
+ } = defineInjection("ui.unoConfig", {});
10
17
  export const useTheme = createSharedComposable(() => {
11
- const _theme = injectThemeExtension();
12
- const mergeRules = createMergeRules();
18
+ const themeExtension = injectThemeExtension();
19
+ const unoConfig = injectUnoConfig();
20
+ const mergeRules = transformUnoRules(unoConfig);
13
21
  const { createStyler } = prepareStyler(mergeRules);
14
22
  return {
15
- theme: computed(() => extendTheme(toValue(_theme), theme)),
23
+ theme: computed(() => extendTheme(toValue(themeExtension), theme)),
16
24
  createStyler
17
25
  };
18
26
  });
@@ -1,25 +1,28 @@
1
1
  import { ct } from "@byyuurin/ui-kit";
2
- export default ct({
3
- slots: {
4
- root: "w-full color-ui-cb",
5
- item: "border-b last:border-b-0",
6
- header: "flex",
7
- trigger: "group flex-1 flex items-center gap-2 font-medium text-sm py-4 focus-visible:outline-ui-fill min-w-0",
8
- content: [
9
- "overflow-hidden focus:outline-none",
10
- "data-[state=open]:animate-[accordion-down_200ms_ease-out]",
11
- "data-[state=closed]:animate-[accordion-up_200ms_ease-out]"
12
- ],
13
- body: "text-sm pb-4 color-ui-cb/80",
14
- icon: "shrink-0 size-5",
15
- trailingIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-transform duration-200",
16
- label: "text-start break-words"
17
- },
18
- variants: {
19
- disabled: {
20
- true: {
21
- trigger: "cursor-not-allowed opacity-50"
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ root: "w-full color-ui-cb",
7
+ item: "border-b last:border-b-0",
8
+ header: "flex",
9
+ trigger: "group flex-1 flex items-center gap-2 font-medium text-sm py-4 outline-none focus-visible:outline-ui-cb/80 min-w-0",
10
+ content: [
11
+ "overflow-hidden focus:outline-none",
12
+ "data-[state=open]:animate-[accordion-down_200ms_ease-out]",
13
+ "data-[state=closed]:animate-[accordion-up_200ms_ease-out]"
14
+ ],
15
+ body: "text-sm pb-4 color-ui-cb/80",
16
+ icon: "shrink-0 size-5",
17
+ trailingIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-transform duration-200",
18
+ label: "text-start break-words"
19
+ },
20
+ variants: {
21
+ disabled: {
22
+ true: {
23
+ trigger: "cursor-not-allowed opacity-50"
24
+ }
22
25
  }
23
26
  }
24
27
  }
25
- });
28
+ );
@@ -0,0 +1,85 @@
1
+ declare const _default: {
2
+ base: undefined;
3
+ slots: {
4
+ root: string;
5
+ wrapper: string;
6
+ title: string;
7
+ description: string;
8
+ icon: string;
9
+ actions: string;
10
+ close: string;
11
+ };
12
+ variants: {
13
+ variant: {
14
+ solid: {
15
+ root: string;
16
+ close: string;
17
+ };
18
+ outline: {
19
+ root: string;
20
+ };
21
+ soft: {
22
+ root: string;
23
+ };
24
+ 'soft-outline': {
25
+ root: string;
26
+ };
27
+ };
28
+ orientation: {
29
+ horizontal: {
30
+ root: string;
31
+ actions: string;
32
+ };
33
+ vertical: {
34
+ root: string;
35
+ actions: string;
36
+ };
37
+ };
38
+ title: {
39
+ true: {
40
+ description: string;
41
+ };
42
+ };
43
+ };
44
+ compoundVariants: import("@byyuurin/ui-kit/index").CVCompoundVariants<{
45
+ variant: {
46
+ solid: {
47
+ root: string;
48
+ close: string;
49
+ };
50
+ outline: {
51
+ root: string;
52
+ };
53
+ soft: {
54
+ root: string;
55
+ };
56
+ 'soft-outline': {
57
+ root: string;
58
+ };
59
+ };
60
+ orientation: {
61
+ horizontal: {
62
+ root: string;
63
+ actions: string;
64
+ };
65
+ vertical: {
66
+ root: string;
67
+ actions: string;
68
+ };
69
+ };
70
+ title: {
71
+ true: {
72
+ description: string;
73
+ };
74
+ };
75
+ }, {
76
+ root: string;
77
+ wrapper: string;
78
+ title: string;
79
+ description: string;
80
+ icon: string;
81
+ actions: string;
82
+ close: string;
83
+ }, undefined>;
84
+ };
85
+ export default _default;
@@ -0,0 +1,47 @@
1
+ import { ct } from "@byyuurin/ui-kit";
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ root: "relative overflow-hidden w-full rounded-ui-box p-4 flex gap-2.5",
7
+ wrapper: "min-w-0 flex-1 flex flex-col",
8
+ title: "text-xl font-medium",
9
+ description: "opacity-80",
10
+ icon: "shrink-0 size-1.5em",
11
+ actions: "flex flex-wrap gap-1.5 shrink-0",
12
+ close: "p-0"
13
+ },
14
+ variants: {
15
+ variant: {
16
+ "solid": {
17
+ root: "color-ui-c1 bg-ui-fill",
18
+ close: "ui-base-inverted"
19
+ },
20
+ "outline": {
21
+ root: "color-ui-content bg-ui-c1 ring ring-inset ring-ui-fill"
22
+ },
23
+ "soft": {
24
+ root: "color-ui-content bg-ui-fill/10"
25
+ },
26
+ "soft-outline": {
27
+ root: "color-ui-content bg-ui-fill/10 ring ring-inset ring-ui-fill/40"
28
+ }
29
+ },
30
+ orientation: {
31
+ horizontal: {
32
+ root: "items-center",
33
+ actions: "items-center"
34
+ },
35
+ vertical: {
36
+ root: "items-start",
37
+ actions: "items-start mt-2.5"
38
+ }
39
+ },
40
+ title: {
41
+ true: {
42
+ description: "mt-1"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ );
@@ -1,4 +1,5 @@
1
1
  export default {
2
+ /* @unocss-include */
2
3
  icons: {
3
4
  close: "i-mdi-close-thick",
4
5
  loading: "i-mdi-loading",
@@ -0,0 +1,79 @@
1
+ declare const _default: {
2
+ base: undefined;
3
+ slots: {
4
+ root: string;
5
+ base: string[];
6
+ };
7
+ variants: {
8
+ size: {
9
+ xs: {
10
+ root: string;
11
+ };
12
+ sm: {
13
+ root: string;
14
+ };
15
+ md: {
16
+ root: string;
17
+ };
18
+ lg: {
19
+ root: string;
20
+ };
21
+ xl: {
22
+ root: string;
23
+ };
24
+ };
25
+ position: {
26
+ 'top-right': {
27
+ base: string;
28
+ };
29
+ 'bottom-right': {
30
+ base: string;
31
+ };
32
+ 'top-left': {
33
+ base: string;
34
+ };
35
+ 'bottom-left': {
36
+ base: string;
37
+ };
38
+ };
39
+ show: {
40
+ true: {
41
+ base: string;
42
+ };
43
+ };
44
+ inset: {
45
+ true: "";
46
+ };
47
+ standalone: {
48
+ false: {
49
+ base: string;
50
+ };
51
+ };
52
+ };
53
+ compoundVariants: ({
54
+ position: "top-right";
55
+ inset: false;
56
+ class: {
57
+ base: string;
58
+ };
59
+ } | {
60
+ position: "bottom-right";
61
+ inset: false;
62
+ class: {
63
+ base: string;
64
+ };
65
+ } | {
66
+ position: "top-left";
67
+ inset: false;
68
+ class: {
69
+ base: string;
70
+ };
71
+ } | {
72
+ position: "bottom-left";
73
+ inset: false;
74
+ class: {
75
+ base: string;
76
+ };
77
+ })[];
78
+ };
79
+ export default _default;
@@ -0,0 +1,89 @@
1
+ import { ct } from "@byyuurin/ui-kit";
2
+ export default ct(
3
+ /* @unocss-include */
4
+ {
5
+ slots: {
6
+ root: "relative inline-flex items-center justify-center shrink-0",
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-ui-fill"
10
+ ]
11
+ },
12
+ variants: {
13
+ size: {
14
+ xs: {
15
+ root: "text-xs"
16
+ },
17
+ sm: {
18
+ root: "text-sm"
19
+ },
20
+ md: {
21
+ root: "text-base"
22
+ },
23
+ lg: {
24
+ root: "text-lg"
25
+ },
26
+ xl: {
27
+ root: "text-xl"
28
+ }
29
+ },
30
+ position: {
31
+ "top-right": {
32
+ base: "top-0 right-0"
33
+ },
34
+ "bottom-right": {
35
+ base: "bottom-0 right-0"
36
+ },
37
+ "top-left": {
38
+ base: "top-0 left-0"
39
+ },
40
+ "bottom-left": {
41
+ base: "bottom-0 left-0"
42
+ }
43
+ },
44
+ show: {
45
+ true: {
46
+ base: "animate-[scale-in_200ms_ease-out]"
47
+ }
48
+ },
49
+ inset: {
50
+ true: ""
51
+ },
52
+ standalone: {
53
+ false: {
54
+ base: "absolute"
55
+ }
56
+ }
57
+ },
58
+ compoundVariants: [
59
+ {
60
+ position: "top-right",
61
+ inset: false,
62
+ class: {
63
+ base: "-translate-y-1/2 translate-x-1/2 transform"
64
+ }
65
+ },
66
+ {
67
+ position: "bottom-right",
68
+ inset: false,
69
+ class: {
70
+ base: "translate-y-1/2 translate-x-1/2 transform"
71
+ }
72
+ },
73
+ {
74
+ position: "top-left",
75
+ inset: false,
76
+ class: {
77
+ base: "-translate-y-1/2 -translate-x-1/2 transform"
78
+ }
79
+ },
80
+ {
81
+ position: "bottom-left",
82
+ inset: false,
83
+ class: {
84
+ base: "translate-y-1/2 -translate-x-1/2 transform"
85
+ }
86
+ }
87
+ ]
88
+ }
89
+ );
@@ -17,6 +17,9 @@ declare const _default: {
17
17
  soft: {
18
18
  base: string[];
19
19
  };
20
+ 'soft-outline': {
21
+ base: string[];
22
+ };
20
23
  ghost: {
21
24
  base: string[];
22
25
  };
@@ -41,14 +44,6 @@ declare const _default: {
41
44
  base: string;
42
45
  };
43
46
  };
44
- round: {
45
- true: {
46
- base: string;
47
- };
48
- false: {
49
- base: string;
50
- };
51
- };
52
47
  active: {
53
48
  true: "";
54
49
  };
@@ -116,7 +111,7 @@ declare const _default: {
116
111
  suffix?: undefined;
117
112
  } | {
118
113
  active: true;
119
- variant: "soft";
114
+ variant: ("soft" | "soft-outline")[];
120
115
  class: {
121
116
  base: string;
122
117
  label?: undefined;