windly-ui 1.0.2 → 1.0.4

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 (103) hide show
  1. package/{ui-library/dist → dist}/module.json +2 -2
  2. package/dist/module.mjs +33 -0
  3. package/dist/runtime/components/Accordion.d.vue.ts +39 -0
  4. package/dist/runtime/components/Accordion.vue +96 -0
  5. package/dist/runtime/components/Accordion.vue.d.ts +39 -0
  6. package/dist/runtime/components/Alert.d.vue.ts +83 -0
  7. package/dist/runtime/components/Alert.vue +78 -0
  8. package/dist/runtime/components/Alert.vue.d.ts +83 -0
  9. package/dist/runtime/components/Avatar.d.vue.ts +141 -0
  10. package/dist/runtime/components/Avatar.vue +72 -0
  11. package/dist/runtime/components/Avatar.vue.d.ts +141 -0
  12. package/dist/runtime/components/Badge.d.vue.ts +133 -0
  13. package/dist/runtime/components/Badge.vue +99 -0
  14. package/dist/runtime/components/Badge.vue.d.ts +133 -0
  15. package/dist/runtime/components/Breadcrumbs.d.vue.ts +83 -0
  16. package/dist/runtime/components/Breadcrumbs.vue +116 -0
  17. package/dist/runtime/components/Breadcrumbs.vue.d.ts +83 -0
  18. package/dist/runtime/components/Button.d.vue.ts +208 -0
  19. package/dist/runtime/components/Button.vue +126 -0
  20. package/dist/runtime/components/Button.vue.d.ts +208 -0
  21. package/dist/runtime/components/Card.d.vue.ts +83 -0
  22. package/dist/runtime/components/Card.vue +71 -0
  23. package/dist/runtime/components/Card.vue.d.ts +83 -0
  24. package/dist/runtime/components/Checkbox.d.vue.ts +190 -0
  25. package/dist/runtime/components/Checkbox.vue +125 -0
  26. package/dist/runtime/components/Checkbox.vue.d.ts +190 -0
  27. package/dist/runtime/components/CodeBlock.d.vue.ts +16 -0
  28. package/dist/runtime/components/CodeBlock.vue +75 -0
  29. package/dist/runtime/components/CodeBlock.vue.d.ts +16 -0
  30. package/dist/runtime/components/ColorPicker.d.vue.ts +91 -0
  31. package/dist/runtime/components/ColorPicker.vue +244 -0
  32. package/dist/runtime/components/ColorPicker.vue.d.ts +91 -0
  33. package/dist/runtime/components/Date.d.vue.ts +137 -0
  34. package/dist/runtime/components/Date.vue +201 -0
  35. package/dist/runtime/components/Date.vue.d.ts +137 -0
  36. package/dist/runtime/components/Dialog.d.vue.ts +63 -0
  37. package/dist/runtime/components/Dialog.vue +85 -0
  38. package/dist/runtime/components/Dialog.vue.d.ts +63 -0
  39. package/dist/runtime/components/Divider.d.vue.ts +51 -0
  40. package/dist/runtime/components/Divider.vue +52 -0
  41. package/dist/runtime/components/Divider.vue.d.ts +51 -0
  42. package/dist/runtime/components/Drawer.d.vue.ts +30 -0
  43. package/dist/runtime/components/Drawer.vue +43 -0
  44. package/dist/runtime/components/Drawer.vue.d.ts +30 -0
  45. package/dist/runtime/components/Dropdown.d.vue.ts +34 -0
  46. package/dist/runtime/components/Dropdown.vue +127 -0
  47. package/dist/runtime/components/Dropdown.vue.d.ts +34 -0
  48. package/dist/runtime/components/FileUploader.d.vue.ts +65 -0
  49. package/dist/runtime/components/FileUploader.vue +358 -0
  50. package/dist/runtime/components/FileUploader.vue.d.ts +65 -0
  51. package/dist/runtime/components/Icon.d.vue.ts +41 -0
  52. package/dist/runtime/components/Icon.vue +66 -0
  53. package/dist/runtime/components/Icon.vue.d.ts +41 -0
  54. package/dist/runtime/components/Image.d.vue.ts +77 -0
  55. package/dist/runtime/components/Image.vue +61 -0
  56. package/dist/runtime/components/Image.vue.d.ts +77 -0
  57. package/dist/runtime/components/Input.d.vue.ts +68 -0
  58. package/dist/runtime/components/Input.vue +241 -0
  59. package/dist/runtime/components/Input.vue.d.ts +68 -0
  60. package/dist/runtime/components/Radio.d.vue.ts +41 -0
  61. package/dist/runtime/components/Radio.vue +222 -0
  62. package/dist/runtime/components/Radio.vue.d.ts +41 -0
  63. package/dist/runtime/components/ScrollArea.d.vue.ts +79 -0
  64. package/dist/runtime/components/ScrollArea.vue +36 -0
  65. package/dist/runtime/components/ScrollArea.vue.d.ts +79 -0
  66. package/dist/runtime/components/Select.d.vue.ts +51 -0
  67. package/dist/runtime/components/Select.vue +271 -0
  68. package/dist/runtime/components/Select.vue.d.ts +51 -0
  69. package/dist/runtime/components/Stepper.d.vue.ts +46 -0
  70. package/dist/runtime/components/Stepper.vue +218 -0
  71. package/dist/runtime/components/Stepper.vue.d.ts +46 -0
  72. package/dist/runtime/components/TabPanel.d.vue.ts +17 -0
  73. package/dist/runtime/components/TabPanel.vue +21 -0
  74. package/dist/runtime/components/TabPanel.vue.d.ts +17 -0
  75. package/dist/runtime/components/Table.d.vue.ts +40 -0
  76. package/dist/runtime/components/Table.vue +92 -0
  77. package/dist/runtime/components/Table.vue.d.ts +40 -0
  78. package/dist/runtime/components/Tabs.d.vue.ts +20 -0
  79. package/dist/runtime/components/Tabs.vue +62 -0
  80. package/dist/runtime/components/Tabs.vue.d.ts +20 -0
  81. package/dist/runtime/components/Textarea.d.vue.ts +208 -0
  82. package/dist/runtime/components/Textarea.vue +185 -0
  83. package/dist/runtime/components/Textarea.vue.d.ts +208 -0
  84. package/dist/runtime/components/Toggle.d.vue.ts +36 -0
  85. package/dist/runtime/components/Toggle.vue +173 -0
  86. package/dist/runtime/components/Toggle.vue.d.ts +36 -0
  87. package/dist/runtime/components/Tooltip.d.vue.ts +63 -0
  88. package/dist/runtime/components/Tooltip.vue +144 -0
  89. package/dist/runtime/components/Tooltip.vue.d.ts +63 -0
  90. package/dist/runtime/components/uiProps.d.ts +38 -0
  91. package/dist/runtime/components/uiProps.js +11 -0
  92. package/dist/runtime/components/useUiClasses.d.ts +43 -0
  93. package/dist/runtime/components/useUiClasses.js +124 -0
  94. package/dist/runtime/composables/plugin.d.ts +2 -0
  95. package/dist/runtime/composables/plugin.js +3 -0
  96. package/dist/runtime/tailwind-color.d.ts +2 -0
  97. package/dist/runtime/tailwind-color.js +5859 -0
  98. package/package.json +12 -46
  99. package/LICENSE +0 -21
  100. package/README.md +0 -232
  101. package/ui-library/dist/module.mjs +0 -22
  102. /package/{ui-library/dist → dist}/module.d.mts +0 -0
  103. /package/{ui-library/dist → dist}/types.d.mts +0 -0
@@ -0,0 +1,63 @@
1
+ type TooltipPlacement = 'top' | 'right' | 'bottom' | 'left';
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
+ text: {
8
+ type: StringConstructor;
9
+ required: true;
10
+ };
11
+ placement: {
12
+ type: () => TooltipPlacement;
13
+ default: string;
14
+ validator: (v: string) => any;
15
+ };
16
+ arrow: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
20
+ color: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ textColor: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
29
+ text: {
30
+ type: StringConstructor;
31
+ required: true;
32
+ };
33
+ placement: {
34
+ type: () => TooltipPlacement;
35
+ default: string;
36
+ validator: (v: string) => any;
37
+ };
38
+ arrow: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ color: {
43
+ type: StringConstructor;
44
+ default: string;
45
+ };
46
+ textColor: {
47
+ type: StringConstructor;
48
+ default: string;
49
+ };
50
+ }>> & Readonly<{}>, {
51
+ textColor: string;
52
+ color: string;
53
+ placement: TooltipPlacement;
54
+ arrow: boolean;
55
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
56
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
57
+ declare const _default: typeof __VLS_export;
58
+ export default _default;
59
+ type __VLS_WithSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -0,0 +1,38 @@
1
+ export declare const uiProps: {
2
+ readonly contentClass: {
3
+ readonly type: StringConstructor;
4
+ readonly default: "";
5
+ };
6
+ readonly contentStyle: {
7
+ readonly type: StringConstructor;
8
+ readonly default: "";
9
+ };
10
+ readonly textColor: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "";
13
+ };
14
+ readonly disable: {
15
+ readonly type: BooleanConstructor;
16
+ readonly default: false;
17
+ };
18
+ readonly loading: {
19
+ readonly type: BooleanConstructor;
20
+ readonly default: false;
21
+ };
22
+ readonly color: {
23
+ readonly type: StringConstructor;
24
+ readonly default: "blue-900";
25
+ };
26
+ readonly rounded: {
27
+ readonly type: StringConstructor;
28
+ readonly default: "md";
29
+ };
30
+ readonly size: {
31
+ readonly type: StringConstructor;
32
+ readonly default: "md";
33
+ };
34
+ readonly iconSize: {
35
+ readonly type: StringConstructor;
36
+ readonly default: "lg";
37
+ };
38
+ };
@@ -0,0 +1,11 @@
1
+ export const uiProps = {
2
+ contentClass: { type: String, default: "" },
3
+ contentStyle: { type: String, default: "" },
4
+ textColor: { type: String, default: "" },
5
+ disable: { type: Boolean, default: false },
6
+ loading: { type: Boolean, default: false },
7
+ color: { type: String, default: "blue-900" },
8
+ rounded: { type: String, default: "md" },
9
+ size: { type: String, default: "md" },
10
+ iconSize: { type: String, default: "lg" }
11
+ };
@@ -0,0 +1,43 @@
1
+ import type { ExtractPropTypes } from "vue";
2
+ import { uiProps } from "./uiProps.js";
3
+ type UiProps = ExtractPropTypes<typeof uiProps>;
4
+ export declare function useUiClasses(props: Partial<UiProps>): {
5
+ contentClass: import("vue").Ref<string, string>;
6
+ contentStyle: import("vue").Ref<string, string>;
7
+ textColor: import("vue").Ref<string, string>;
8
+ disable: import("vue").Ref<boolean, boolean>;
9
+ loading: import("vue").Ref<boolean, boolean>;
10
+ color: import("vue").Ref<string, string>;
11
+ rounded: import("vue").Ref<string, string>;
12
+ size: import("vue").Ref<string, string>;
13
+ iconSize: import("vue").Ref<string, string>;
14
+ roundedClass: {
15
+ none: string;
16
+ xs: string;
17
+ sm: string;
18
+ md: string;
19
+ lg: string;
20
+ xl: string;
21
+ full: string;
22
+ };
23
+ sizeClass: {
24
+ sm: string;
25
+ md: string;
26
+ lg: string;
27
+ };
28
+ iconSizeClasses: {
29
+ xs: string;
30
+ sm: string;
31
+ md: string;
32
+ lg: string;
33
+ xl: string;
34
+ };
35
+ colorClass: import("vue").ComputedRef<string>;
36
+ computedContentClass: import("vue").ComputedRef<string>;
37
+ isColorDark: (color: string) => boolean;
38
+ isHex: (color: string) => boolean;
39
+ isTailwindColor: (color: string) => boolean;
40
+ shadeTailwind: (color: string, delta?: number) => string;
41
+ shadeHex: (hex: string, amount?: number) => string;
42
+ };
43
+ export {};
@@ -0,0 +1,124 @@
1
+ import { computed, toRefs } from "vue";
2
+ export function useUiClasses(props) {
3
+ const safeProps = {
4
+ contentClass: "",
5
+ contentStyle: "",
6
+ textColor: "",
7
+ disable: false,
8
+ loading: false,
9
+ color: "",
10
+ rounded: "md",
11
+ size: "md",
12
+ iconSize: "md",
13
+ ...props
14
+ };
15
+ const {
16
+ contentClass,
17
+ contentStyle,
18
+ textColor,
19
+ disable,
20
+ loading,
21
+ color,
22
+ rounded,
23
+ size,
24
+ iconSize
25
+ } = toRefs(safeProps);
26
+ const roundedClass = {
27
+ none: "rounded-none",
28
+ xs: "rounded-xs",
29
+ sm: "rounded-sm",
30
+ md: "rounded",
31
+ lg: "rounded-lg",
32
+ xl: "rounded-xl",
33
+ full: "rounded-full"
34
+ };
35
+ const sizeClass = {
36
+ sm: "text-xs",
37
+ md: "text-base",
38
+ lg: "text-xl"
39
+ };
40
+ const iconSizeClasses = {
41
+ xs: "text-xs",
42
+ sm: "text-sm",
43
+ md: "text-base",
44
+ lg: "text-lg",
45
+ xl: "text-xl"
46
+ };
47
+ const colorClass = computed(() => {
48
+ if (!color.value) return "";
49
+ return color.value.includes("#") ? `[${color.value}]` : color.value;
50
+ });
51
+ const computedContentClass = computed(() => {
52
+ if (!contentClass.value) return "";
53
+ return contentClass.value.split(" ").map((cls) => cls.startsWith("!") ? cls : `!${cls}`).join(" ");
54
+ });
55
+ function isTailwindColorDark(color2) {
56
+ const match = color2.match(/-(\d{2,3})$/);
57
+ if (!match) return false;
58
+ return Number(match[1]) >= 400;
59
+ }
60
+ function isHexColorDark(hex) {
61
+ let c = hex.replace("#", "");
62
+ if (c.length === 3) {
63
+ c = c.split("").map((x) => x + x).join("");
64
+ }
65
+ const r = parseInt(c.substring(0, 2), 16);
66
+ const g = parseInt(c.substring(2, 4), 16);
67
+ const b = parseInt(c.substring(4, 6), 16);
68
+ const luminance = 0.299 * r + 0.587 * g + 0.114 * b;
69
+ return luminance < 140;
70
+ }
71
+ function isHex(color2) {
72
+ return /^#([0-9A-F]{3}){1,2}$/i.test(color2);
73
+ }
74
+ function isTailwindColor(color2) {
75
+ return /^[a-z]+-\d{2,3}$/.test(color2);
76
+ }
77
+ const isColorDark = (color2) => {
78
+ if (!color2) return false;
79
+ return color2.startsWith("#") ? isHexColorDark(color2) : isTailwindColorDark(color2);
80
+ };
81
+ function shadeTailwind(color2, delta = 100) {
82
+ const [name, shade] = color2.split("-");
83
+ const nextShade = Math.min(900, Math.max(100, Number(shade) + delta));
84
+ return `${name}-${nextShade}`;
85
+ }
86
+ function shadeHex(hex, amount = -10) {
87
+ let c = hex.substring(1);
88
+ if (c.length === 3) {
89
+ c = c.split("").map((x) => x + x).join("");
90
+ }
91
+ const num = parseInt(c, 16);
92
+ let r = num >> 16 & 255;
93
+ let g = num >> 8 & 255;
94
+ let b = num & 255;
95
+ r = Math.min(255, Math.max(0, r + amount));
96
+ g = Math.min(255, Math.max(0, g + amount));
97
+ b = Math.min(255, Math.max(0, b + amount));
98
+ return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;
99
+ }
100
+ return {
101
+ // props
102
+ contentClass,
103
+ contentStyle,
104
+ textColor,
105
+ disable,
106
+ loading,
107
+ color,
108
+ rounded,
109
+ size,
110
+ iconSize,
111
+ // class maps
112
+ roundedClass,
113
+ sizeClass,
114
+ iconSizeClasses,
115
+ // computed
116
+ colorClass,
117
+ computedContentClass,
118
+ isColorDark,
119
+ isHex,
120
+ isTailwindColor,
121
+ shadeTailwind,
122
+ shadeHex
123
+ };
124
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ export default defineNuxtPlugin((nuxtApp) => {
3
+ });
@@ -0,0 +1,2 @@
1
+ declare const tailwindColor: string[];
2
+ export default tailwindColor;