vueless 0.0.478-beta.13 → 0.0.478-beta.15
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.
- package/composables/useAutoPosition.ts +1 -1
- package/composables/useBreakpoint.ts +1 -1
- package/composables/useMutationObserver.ts +1 -1
- package/composables/useUI.ts +3 -3
- package/constants.js +192 -0
- package/directives/clickOutside/storybook/stories.ts +1 -1
- package/directives/tooltip/storybook/stories.ts +1 -1
- package/directives/tooltip/vTooltip.ts +2 -2
- package/index.ts +3 -3
- package/package.json +5 -5
- package/preset.tailwind.js +6 -1
- package/ui.button/UButton.vue +1 -1
- package/ui.button/storybook/Docs.mdx +1 -1
- package/ui.button/storybook/stories.js +1 -1
- package/ui.button-link/ULink.vue +1 -1
- package/ui.button-link/storybook/Docs.mdx +1 -1
- package/ui.button-link/storybook/stories.js +1 -1
- package/ui.button-toggle/UToggle.vue +1 -1
- package/ui.button-toggle/storybook/Docs.mdx +1 -1
- package/ui.button-toggle/storybook/stories.js +1 -1
- package/ui.button-toggle-item/UToggleItem.vue +1 -1
- package/ui.button-toggle-item/storybook/Docs.mdx +1 -1
- package/ui.button-toggle-item/storybook/stories.js +1 -1
- package/ui.container-accordion/UAccordion.vue +1 -1
- package/ui.container-accordion/storybook/Docs.mdx +1 -1
- package/ui.container-accordion/storybook/stories.js +1 -1
- package/ui.container-card/storybook/Docs.mdx +1 -1
- package/ui.container-card/storybook/stories.js +1 -1
- package/ui.container-col/UCol.vue +1 -1
- package/ui.container-col/storybook/Docs.mdx +1 -1
- package/ui.container-col/storybook/stories.js +1 -1
- package/ui.container-divider/UDivider.vue +1 -1
- package/ui.container-divider/storybook/Docs.mdx +1 -1
- package/ui.container-divider/storybook/stories.js +1 -1
- package/ui.container-group/UGroup.vue +1 -1
- package/ui.container-group/storybook/Docs.mdx +1 -1
- package/ui.container-group/storybook/stories.js +1 -1
- package/ui.container-modal/UModal.vue +1 -1
- package/ui.container-modal/storybook/Docs.mdx +1 -1
- package/ui.container-modal/storybook/stories.js +1 -1
- package/ui.container-modal-confirm/UModalConfirm.vue +1 -1
- package/ui.container-modal-confirm/storybook/Docs.mdx +1 -1
- package/ui.container-modal-confirm/storybook/stories.js +1 -1
- package/ui.container-page/UPage.vue +1 -1
- package/ui.container-page/storybook/Docs.mdx +1 -1
- package/ui.container-page/storybook/stories.js +1 -1
- package/ui.container-page/useAttrs.js +1 -1
- package/ui.container-row/URow.vue +1 -1
- package/ui.container-row/storybook/Docs.mdx +1 -1
- package/ui.container-row/storybook/stories.js +1 -1
- package/ui.data-list/UDataList.vue +1 -1
- package/ui.data-list/storybook/Docs.mdx +1 -1
- package/ui.data-list/storybook/stories.js +1 -1
- package/ui.data-table/UTable.vue +2 -2
- package/ui.data-table/UTableRow.vue +6 -5
- package/ui.data-table/config.js +10 -3
- package/ui.data-table/storybook/Docs.mdx +1 -1
- package/ui.data-table/storybook/stories.js +5 -3
- package/ui.data-table/utilTable.js +1 -1
- package/ui.dropdown-badge/UDropdownBadge.vue +1 -1
- package/ui.dropdown-badge/storybook/Docs.mdx +1 -1
- package/ui.dropdown-badge/storybook/stories.js +1 -1
- package/ui.dropdown-button/UDropdownButton.vue +1 -1
- package/ui.dropdown-button/storybook/Docs.mdx +1 -1
- package/ui.dropdown-button/storybook/stories.js +1 -1
- package/ui.dropdown-link/UDropdownLink.vue +1 -1
- package/ui.dropdown-link/storybook/Docs.mdx +1 -1
- package/ui.dropdown-link/storybook/stories.js +1 -1
- package/ui.dropdown-list/UDropdownList.vue +2 -2
- package/ui.dropdown-list/storybook/Docs.mdx +1 -1
- package/ui.dropdown-list/storybook/stories.js +1 -1
- package/ui.form-calendar/UCalendar.vue +1 -1
- package/ui.form-calendar/storybook/Docs.mdx +1 -1
- package/ui.form-calendar/storybook/stories.js +1 -1
- package/ui.form-checkbox/UCheckbox.vue +1 -1
- package/ui.form-checkbox/storybook/Docs.mdx +1 -1
- package/ui.form-checkbox/storybook/stories.js +1 -1
- package/ui.form-checkbox-group/UCheckboxGroup.vue +1 -1
- package/ui.form-checkbox-group/storybook/Docs.mdx +1 -1
- package/ui.form-checkbox-group/storybook/stories.js +1 -1
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +1 -1
- package/ui.form-checkbox-multi-state/storybook/Docs.mdx +1 -1
- package/ui.form-checkbox-multi-state/storybook/stories.js +1 -1
- package/ui.form-color-picker/UColorPicker.vue +1 -1
- package/ui.form-color-picker/storybook/Docs.mdx +1 -1
- package/ui.form-color-picker/storybook/stories.js +1 -1
- package/ui.form-date-picker/UDatePicker.vue +1 -1
- package/ui.form-date-picker/storybook/Docs.mdx +1 -1
- package/ui.form-date-picker/storybook/stories.js +1 -1
- package/ui.form-date-picker-range/UDatePickerRange.vue +1 -1
- package/ui.form-date-picker-range/storybook/Docs.mdx +1 -1
- package/ui.form-date-picker-range/storybook/stories.js +1 -1
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input/storybook/Docs.mdx +1 -1
- package/ui.form-input/storybook/stories.js +1 -1
- package/ui.form-input-file/UInputFile.vue +1 -1
- package/ui.form-input-file/storybook/Docs.mdx +1 -1
- package/ui.form-input-file/storybook/stories.js +1 -1
- package/ui.form-input-money/UInputMoney.vue +1 -1
- package/ui.form-input-money/storybook/Docs.mdx +1 -1
- package/ui.form-input-money/storybook/stories.js +1 -1
- package/ui.form-input-number/UInputNumber.vue +1 -1
- package/ui.form-input-number/storybook/Docs.mdx +1 -1
- package/ui.form-input-number/storybook/stories.js +1 -1
- package/ui.form-input-rating/UInputRating.vue +1 -1
- package/ui.form-input-rating/storybook/Docs.mdx +1 -1
- package/ui.form-input-rating/storybook/stories.js +1 -1
- package/ui.form-input-search/UInputSearch.vue +2 -2
- package/ui.form-input-search/storybook/Docs.mdx +1 -1
- package/ui.form-input-search/storybook/stories.js +1 -1
- package/ui.form-label/ULabel.vue +1 -1
- package/ui.form-label/storybook/Docs.mdx +1 -1
- package/ui.form-label/storybook/stories.js +1 -1
- package/ui.form-radio/URadio.vue +1 -1
- package/ui.form-radio/storybook/Docs.mdx +1 -1
- package/ui.form-radio/storybook/stories.js +1 -1
- package/ui.form-radio-group/URadioGroup.vue +1 -1
- package/ui.form-radio-group/storybook/Docs.mdx +1 -1
- package/ui.form-radio-group/storybook/stories.js +1 -1
- package/ui.form-select/USelect.vue +3 -3
- package/ui.form-select/storybook/Docs.mdx +1 -1
- package/ui.form-select/storybook/stories.js +1 -1
- package/ui.form-switch/USwitch.vue +1 -1
- package/ui.form-switch/storybook/Docs.mdx +1 -1
- package/ui.form-switch/storybook/stories.js +1 -1
- package/ui.form-switch/utilVariant.js +1 -1
- package/ui.form-textarea/UTextarea.vue +1 -1
- package/ui.form-textarea/storybook/Docs.mdx +1 -1
- package/ui.form-textarea/storybook/stories.js +1 -1
- package/ui.image-avatar/UAvatar.vue +1 -1
- package/ui.image-avatar/storybook/Docs.mdx +1 -1
- package/ui.image-avatar/storybook/stories.js +1 -1
- package/ui.image-icon/UIcon.vue +2 -2
- package/ui.image-icon/storybook/Docs.mdx +1 -1
- package/ui.image-icon/storybook/stories.js +1 -1
- package/ui.loader/ULoader.vue +1 -1
- package/ui.loader/storybook/Docs.mdx +1 -1
- package/ui.loader/storybook/stories.js +1 -1
- package/ui.loader-overlay/ULoaderOverlay.vue +1 -1
- package/ui.loader-overlay/storybook/Docs.mdx +1 -1
- package/ui.loader-overlay/storybook/stories.js +1 -1
- package/ui.loader-progress/ULoaderProgress.vue +33 -48
- package/ui.loader-progress/constants.js +1 -0
- package/ui.loader-progress/storybook/Docs.mdx +1 -1
- package/ui.loader-progress/storybook/stories.js +2 -3
- package/ui.loader-progress/useLoaderProgress.js +13 -8
- package/ui.loader-progress/utilLoaderProgress.js +1 -1
- package/ui.navigation-pagination/UPagination.vue +1 -1
- package/ui.navigation-pagination/storybook/Docs.mdx +1 -1
- package/ui.navigation-pagination/storybook/stories.js +1 -1
- package/ui.navigation-progress/StepperProgress.vue +1 -1
- package/ui.navigation-progress/UProgress.vue +1 -1
- package/ui.navigation-progress/storybook/Docs.mdx +1 -1
- package/ui.navigation-progress/storybook/stories.js +1 -1
- package/ui.navigation-tab/UTab.vue +1 -1
- package/ui.navigation-tab/storybook/Docs.mdx +1 -1
- package/ui.navigation-tab/storybook/stories.js +1 -1
- package/ui.navigation-tabs/UTabs.vue +1 -1
- package/ui.navigation-tabs/storybook/Docs.mdx +1 -1
- package/ui.navigation-tabs/storybook/stories.js +1 -1
- package/ui.other-dot/UDot.vue +1 -1
- package/ui.other-dot/storybook/Docs.mdx +1 -1
- package/ui.other-dot/storybook/stories.js +1 -1
- package/ui.text-alert/UAlert.vue +1 -1
- package/ui.text-alert/storybook/Docs.mdx +1 -1
- package/ui.text-alert/storybook/stories.js +1 -1
- package/ui.text-badge/UBadge.vue +1 -1
- package/ui.text-badge/storybook/Docs.mdx +1 -1
- package/ui.text-badge/storybook/stories.ts +1 -1
- package/ui.text-block/UText.vue +1 -1
- package/ui.text-block/storybook/Docs.mdx +1 -1
- package/ui.text-block/storybook/stories.ts +1 -1
- package/ui.text-empty/UEmpty.vue +1 -1
- package/ui.text-empty/storybook/Docs.mdx +1 -1
- package/ui.text-empty/storybook/stories.js +1 -1
- package/ui.text-file/UFile.vue +1 -1
- package/ui.text-file/storybook/Docs.mdx +1 -1
- package/ui.text-file/storybook/stories.js +1 -1
- package/ui.text-files/UFiles.vue +1 -1
- package/ui.text-files/storybook/Docs.mdx +1 -1
- package/ui.text-files/storybook/stories.js +1 -1
- package/ui.text-header/UHeader.vue +1 -1
- package/ui.text-header/storybook/Docs.mdx +1 -1
- package/ui.text-header/storybook/stories.js +1 -1
- package/ui.text-money/UMoney.vue +1 -1
- package/ui.text-money/storybook/Docs.mdx +1 -1
- package/ui.text-money/storybook/stories.js +1 -1
- package/ui.text-notify/UNotify.vue +1 -1
- package/ui.text-notify/storybook/Docs.mdx +1 -1
- package/ui.text-notify/storybook/stories.js +1 -1
- package/ui.text-notify/utilNotify.js +1 -1
- package/{vite/utils/common.js → utils/node/helper.js} +0 -1
- package/{vite/utils/iconLoader.js → utils/node/loaderIcon.js} +3 -2
- package/{vite/utils/svgLoader.js → utils/node/loaderSvg.js} +1 -15
- package/utils/node/mergeConfigs.js +199 -0
- package/{vite/utils → utils/node}/tailwindSafelist.js +33 -16
- package/{vite/utils → utils/node}/vuelessResolver.js +5 -6
- package/utils/{utilPlatform.ts → platform.ts} +1 -1
- package/utils/{utilTailwind.ts → tailwind.ts} +1 -1
- package/utils/{utilTheme.ts → theme.ts} +4 -4
- package/utils/ui.ts +129 -0
- package/vite/index.js +10 -5
- package/vite.js +100 -0
- package/constants.ts +0 -73
- package/utils/utilUI.ts +0 -374
- package/vite/constants.js +0 -111
- /package/utils/{utilHelper.ts → helper.ts} +0 -0
- /package/utils/{utilStorybook.ts → storybook.ts} +0 -0
package/composables/useUI.ts
CHANGED
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
computed,
|
|
12
12
|
} from "vue";
|
|
13
13
|
|
|
14
|
-
import { cx, cva, setColor, getColor, vuelessConfig, mergeConfigs } from "../utils/
|
|
15
|
-
import { cloneDeep, isCSR } from "../utils/
|
|
14
|
+
import { cx, cva, setColor, getColor, vuelessConfig, mergeConfigs } from "../utils/ui.ts";
|
|
15
|
+
import { cloneDeep, isCSR } from "../utils/helper.ts";
|
|
16
16
|
import {
|
|
17
17
|
STRATEGY_TYPE,
|
|
18
18
|
CVA_CONFIG_KEY,
|
|
19
19
|
SYSTEM_CONFIG_KEY,
|
|
20
20
|
NESTED_COMPONENT_REG_EXP,
|
|
21
|
-
} from "../constants.
|
|
21
|
+
} from "../constants.js";
|
|
22
22
|
|
|
23
23
|
import type { ComponentInternalInstance, Slot, VNode, ComputedRef } from "vue";
|
|
24
24
|
import type {
|
package/constants.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The file has `.js` extension to support both node and browser scripts without a file transpilation.
|
|
3
|
+
* Please do not change the extension if you do not fully understand the consequences.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* Custom Vueless colors */
|
|
7
|
+
export const BRAND_COLOR = "brand";
|
|
8
|
+
export const GRAY_COLOR = "gray";
|
|
9
|
+
export const COOL_COLOR = "cool";
|
|
10
|
+
export const GRAYSCALE_COLOR = "grayscale";
|
|
11
|
+
|
|
12
|
+
/* Vueless dark mode */
|
|
13
|
+
export const DARK_MODE_SELECTOR = "vl-dark";
|
|
14
|
+
export const LIGHT_MODE_SELECTOR = "vl-light";
|
|
15
|
+
|
|
16
|
+
/* Vueless defaults */
|
|
17
|
+
export const DEFAULT_BRAND_COLOR = GRAYSCALE_COLOR;
|
|
18
|
+
export const DEFAULT_GRAY_COLOR = COOL_COLOR;
|
|
19
|
+
export const DEFAULT_RING = 4; /* pixels */
|
|
20
|
+
export const DEFAULT_RING_OFFSET = 0; /* pixels */
|
|
21
|
+
export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
|
|
22
|
+
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#1f2937"; // gray-800
|
|
23
|
+
export const DEFAULT_ROUNDING = 8; /* pixels */
|
|
24
|
+
|
|
25
|
+
/* Vueless supported colors and shades */
|
|
26
|
+
export const COLOR_SHADES = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
27
|
+
export const GRAY_COLORS = ["slate", COOL_COLOR, "zinc", "neutral", "stone"];
|
|
28
|
+
export const BRAND_COLORS = [
|
|
29
|
+
"red",
|
|
30
|
+
"orange",
|
|
31
|
+
"amber",
|
|
32
|
+
"yellow",
|
|
33
|
+
"lime",
|
|
34
|
+
"green",
|
|
35
|
+
"emerald",
|
|
36
|
+
"teal",
|
|
37
|
+
"cyan",
|
|
38
|
+
"sky",
|
|
39
|
+
"blue",
|
|
40
|
+
"indigo",
|
|
41
|
+
"violet",
|
|
42
|
+
"purple",
|
|
43
|
+
"fuchsia",
|
|
44
|
+
"pink",
|
|
45
|
+
"rose",
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
/* Vueless merge class strategy types */
|
|
49
|
+
export const STRATEGY_TYPE = {
|
|
50
|
+
merge: "merge",
|
|
51
|
+
replace: "replace",
|
|
52
|
+
overwrite: "overwrite",
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/* CVA (Class Variance Authority) default config keys */
|
|
56
|
+
export const CVA_CONFIG_KEY = {
|
|
57
|
+
base: "base",
|
|
58
|
+
variants: "variants",
|
|
59
|
+
compoundVariants: "compoundVariants",
|
|
60
|
+
defaultVariants: "defaultVariants",
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* Vueless default config keys */
|
|
64
|
+
export const SYSTEM_CONFIG_KEY = {
|
|
65
|
+
i18n: "i18n",
|
|
66
|
+
defaults: "defaults",
|
|
67
|
+
strategy: "strategy",
|
|
68
|
+
safelist: "safelist",
|
|
69
|
+
component: "component",
|
|
70
|
+
transition: "transition",
|
|
71
|
+
safelistColors: "safelistColors",
|
|
72
|
+
...CVA_CONFIG_KEY,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/* Component to folder mapping. */
|
|
76
|
+
export const COMPONENTS = {
|
|
77
|
+
/* Buttons & Links */
|
|
78
|
+
UButton: "ui.button",
|
|
79
|
+
ULink: "ui.button-link",
|
|
80
|
+
UToggle: "ui.button-toggle",
|
|
81
|
+
UToggleItem: "ui.button-toggle-item",
|
|
82
|
+
|
|
83
|
+
/* Dropdowns */
|
|
84
|
+
UDropdownButton: "ui.dropdown-button",
|
|
85
|
+
UDropdownBadge: "ui.dropdown-badge",
|
|
86
|
+
UDropdownLink: "ui.dropdown-link",
|
|
87
|
+
UDropdownList: "ui.dropdown-list",
|
|
88
|
+
|
|
89
|
+
/* Form Inputs & Controls */
|
|
90
|
+
UInput: "ui.form-input",
|
|
91
|
+
UInputFile: "ui.form-input-file",
|
|
92
|
+
UInputMoney: "ui.form-input-money",
|
|
93
|
+
UInputSearch: "ui.form-input-search",
|
|
94
|
+
UInputNumber: "ui.form-input-number",
|
|
95
|
+
UInputRating: "ui.form-input-rating",
|
|
96
|
+
UTextarea: "ui.form-textarea",
|
|
97
|
+
USelect: "ui.form-select",
|
|
98
|
+
UCheckbox: "ui.form-checkbox",
|
|
99
|
+
UCheckboxGroup: "ui.form-checkbox-group",
|
|
100
|
+
UCheckboxMultiState: "ui.form-checkbox-multi-state",
|
|
101
|
+
USwitch: "ui.form-switch",
|
|
102
|
+
URadio: "ui.form-radio",
|
|
103
|
+
URadioGroup: "ui.form-radio-group",
|
|
104
|
+
UCalendar: "ui.form-calendar",
|
|
105
|
+
UDatePicker: "ui.form-date-picker",
|
|
106
|
+
UDatePickerRange: "ui.form-date-picker-range",
|
|
107
|
+
ULabel: "ui.form-label",
|
|
108
|
+
UColorPicker: "ui.form-color-picker",
|
|
109
|
+
|
|
110
|
+
/* Text & Content */
|
|
111
|
+
UHeader: "ui.text-header",
|
|
112
|
+
UText: "ui.text-block",
|
|
113
|
+
UAlert: "ui.text-alert",
|
|
114
|
+
UNotify: "ui.text-notify",
|
|
115
|
+
UMoney: "ui.text-money",
|
|
116
|
+
UFile: "ui.text-file",
|
|
117
|
+
UFiles: "ui.text-files",
|
|
118
|
+
UEmpty: "ui.text-empty",
|
|
119
|
+
UBadge: "ui.text-badge",
|
|
120
|
+
|
|
121
|
+
/* Containers */
|
|
122
|
+
UDivider: "ui.container-divider",
|
|
123
|
+
UCol: "ui.container-col",
|
|
124
|
+
URow: "ui.container-row",
|
|
125
|
+
UGroup: "ui.container-group",
|
|
126
|
+
UAccordion: "ui.container-accordion",
|
|
127
|
+
UCard: "ui.container-card",
|
|
128
|
+
UModal: "ui.container-modal",
|
|
129
|
+
UModalConfirm: "ui.container-modal-confirm",
|
|
130
|
+
UPage: "ui.container-page",
|
|
131
|
+
|
|
132
|
+
/* Images and Icons */
|
|
133
|
+
UIcon: "ui.image-icon",
|
|
134
|
+
UAvatar: "ui.image-avatar",
|
|
135
|
+
|
|
136
|
+
/* Data */
|
|
137
|
+
UTable: "ui.data-table",
|
|
138
|
+
UDataList: "ui.data-list",
|
|
139
|
+
|
|
140
|
+
/* Navigation */
|
|
141
|
+
UTab: "ui.navigation-tab",
|
|
142
|
+
UTabs: "ui.navigation-tabs",
|
|
143
|
+
UProgress: "ui.navigation-progress",
|
|
144
|
+
UPagination: "ui.navigation-pagination",
|
|
145
|
+
|
|
146
|
+
/* Loaders and Skeletons */
|
|
147
|
+
ULoader: "ui.loader",
|
|
148
|
+
ULoaderProgress: "ui.loader-progress",
|
|
149
|
+
ULoaderOverlay: "ui.loader-overlay",
|
|
150
|
+
|
|
151
|
+
/* Other */
|
|
152
|
+
UDot: "ui.other-dot",
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/* Extending Tailwind Merge by vueless custom tailwind classes. */
|
|
156
|
+
export const TAILWIND_MERGE_EXTENSION = {
|
|
157
|
+
extend: {
|
|
158
|
+
theme: {
|
|
159
|
+
spacing: ["safe-top", "safe-bottom", "safe-left", "safe-right"],
|
|
160
|
+
},
|
|
161
|
+
classGroups: {
|
|
162
|
+
"ring-w": [{ ring: ["dynamic"] }],
|
|
163
|
+
"ring-offset-w": [{ "ring-offset": ["dynamic"] }],
|
|
164
|
+
"ring-offset-color": [{ "ring-offset": ["dynamic"] }],
|
|
165
|
+
"font-size": [{ text: ["2xs"] }],
|
|
166
|
+
rounded: [{ rounded: ["dynamic"] }],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/* SVGO config for preparing SVG icons. */
|
|
172
|
+
export const DEFAULT_SVGO_CONFIG = {
|
|
173
|
+
plugins: [
|
|
174
|
+
{
|
|
175
|
+
name: "preset-default",
|
|
176
|
+
params: {
|
|
177
|
+
overrides: {
|
|
178
|
+
removeViewBox: false,
|
|
179
|
+
convertColors: {
|
|
180
|
+
currentColor: true,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/* Other */
|
|
189
|
+
export const PX_IN_REM = 16;
|
|
190
|
+
export const NESTED_COMPONENT_REG_EXP = /\{U[^}]*}/g;
|
|
191
|
+
export const DYNAMIC_COLOR_PATTERN = "{color}";
|
|
192
|
+
export const TAILWIND_CLASS_DELIMITER = ":";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
2
|
-
import { getArgTypes } from "../../../utils/
|
|
2
|
+
import { getArgTypes } from "../../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import UIcon from "../../../ui.image-icon/UIcon.vue";
|
|
5
5
|
import URow from "../../../ui.container-row/URow.vue";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import tippy from "tippy.js";
|
|
2
2
|
import { merge } from "lodash-es";
|
|
3
3
|
|
|
4
|
-
import { vuelessConfig } from "../../utils/
|
|
5
|
-
import { isCSR, isSSR } from "../../utils/
|
|
4
|
+
import { vuelessConfig } from "../../utils/ui.ts";
|
|
5
|
+
import { isCSR, isSSR } from "../../utils/helper.ts";
|
|
6
6
|
|
|
7
7
|
import type { DefaultProps } from "tippy.js";
|
|
8
8
|
import type {
|
package/index.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { createLocale, LocaleSymbol } from "./composables/useLocale.ts";
|
|
3
3
|
import { createLoaderOverlay, LoaderOverlaySymbol } from "./ui.loader-overlay/useLoaderOverlay.js";
|
|
4
4
|
import { createLoaderProgress, LoaderProgressSymbol } from "./ui.loader-progress/useLoaderProgress.js";
|
|
5
|
-
import { themeInit } from "./utils/
|
|
5
|
+
import { themeInit } from "./utils/theme.ts";
|
|
6
6
|
|
|
7
7
|
import type { App } from 'vue'
|
|
8
8
|
import type { CreateVuelessOptions } from './types.ts'
|
|
9
9
|
|
|
10
|
-
export { setTitle } from "./utils/
|
|
11
|
-
export { setTheme } from "./utils/
|
|
10
|
+
export { setTitle } from "./utils/helper.ts";
|
|
11
|
+
export { setTheme } from "./utils/theme.ts";
|
|
12
12
|
export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n.js";
|
|
13
13
|
export { default as defaultEnLocale } from "./adatper.locale/locales/en.js";
|
|
14
14
|
export { useLocale } from "./composables/useLocale.ts";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.478-beta.
|
|
3
|
+
"version": "0.0.478-beta.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"dev:docs": "npx @vueless/web-types && node prepare
|
|
31
|
-
"dev": "npx @vueless/web-types && node prepare
|
|
32
|
-
"build": "npx @vueless/web-types && node prepare
|
|
30
|
+
"dev:docs": "npx @vueless/web-types && node .prepare/icons && storybook dev -p 6006 --docs --no-open",
|
|
31
|
+
"dev": "npx @vueless/web-types && node .prepare/icons && STORYBOOK_FULL=1 storybook dev -p 6006 --no-open",
|
|
32
|
+
"build": "npx @vueless/web-types && node .prepare/icons && storybook build --docs",
|
|
33
33
|
"preview": "vite preview --host --outDir=storybook-static",
|
|
34
34
|
"ts:check": "vue-tsc --build --force",
|
|
35
|
-
"release:prepare": "node prepare
|
|
35
|
+
"release:prepare": "node .prepare/icons && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE README.md dist/ && node .prepare/package",
|
|
36
36
|
"release:beta": "release-it --ci --npm.publish --preRelease=beta --increment=prerelease",
|
|
37
37
|
"release:patch": "release-it patch --ci --npm.publish",
|
|
38
38
|
"release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
|
package/preset.tailwind.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The file has `.js` extension because it is a node script.
|
|
3
|
+
* Please do not change the extension if you do not fully understand the consequences.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import forms from "@tailwindcss/forms";
|
|
2
7
|
import colors from "tailwindcss/colors.js";
|
|
3
8
|
import {
|
|
@@ -13,7 +18,7 @@ import {
|
|
|
13
18
|
DEFAULT_BRAND_COLOR,
|
|
14
19
|
DEFAULT_GRAY_COLOR,
|
|
15
20
|
GRAYSCALE_COLOR,
|
|
16
|
-
} from "./constants.
|
|
21
|
+
} from "./constants.js";
|
|
17
22
|
|
|
18
23
|
const isStrategyOverride = process.env.VUELESS_STRATEGY === "override";
|
|
19
24
|
const brandColor = process.env.VUELESS_BRAND || DEFAULT_BRAND_COLOR;
|
package/ui.button/UButton.vue
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<script setup>
|
|
84
84
|
import { computed, ref, watchEffect, useId, watch } from "vue";
|
|
85
85
|
|
|
86
|
-
import { getDefault } from "../utils/
|
|
86
|
+
import { getDefault } from "../utils/ui.ts";
|
|
87
87
|
import ULoader from "../ui.loader/ULoader.vue";
|
|
88
88
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
89
89
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UButton from "../../ui.button/UButton.vue";
|
|
4
4
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
package/ui.button-link/ULink.vue
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<script setup>
|
|
48
48
|
import { computed, ref } from "vue";
|
|
49
49
|
import { RouterLink, useLink } from "vue-router";
|
|
50
|
-
import { getDefault } from "../utils/
|
|
50
|
+
import { getDefault } from "../utils/ui.ts";
|
|
51
51
|
|
|
52
52
|
import useAttrs from "./useAttrs.js";
|
|
53
53
|
import defaultConfig from "./config.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import ULink from "../../ui.button-link/ULink.vue";
|
|
4
4
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
@@ -33,7 +33,7 @@ import { computed, provide, readonly } from "vue";
|
|
|
33
33
|
|
|
34
34
|
import ULabel from "../ui.form-label/ULabel.vue";
|
|
35
35
|
import UToggleItem from "../ui.button-toggle-item/UToggleItem.vue";
|
|
36
|
-
import { getDefault } from "../utils/
|
|
36
|
+
import { getDefault } from "../utils/ui.ts";
|
|
37
37
|
|
|
38
38
|
import defaultConfig from "./config.js";
|
|
39
39
|
import { UToggle, TYPE_RADIO, TYPE_CHECKBOX } from "./constants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
2
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import UToggle from "../../ui.button-toggle/UToggle.vue";
|
|
5
5
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
import { computed, inject, onMounted, ref, useId } from "vue";
|
|
52
52
|
|
|
53
53
|
import UButton from "../ui.button/UButton.vue";
|
|
54
|
-
import { getDefault } from "../utils/
|
|
54
|
+
import { getDefault } from "../utils/ui.ts";
|
|
55
55
|
|
|
56
56
|
import { TYPE_RADIO } from "../ui.button-toggle/constants.js";
|
|
57
57
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UToggleItem from "../../ui.button-toggle-item/UToggleItem.vue";
|
|
4
4
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
@@ -26,7 +26,7 @@ import { computed, ref, useId } from "vue";
|
|
|
26
26
|
|
|
27
27
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
28
28
|
import UDivider from "../ui.container-divider/UDivider.vue";
|
|
29
|
-
import { getDefault } from "../utils/
|
|
29
|
+
import { getDefault } from "../utils/ui.ts";
|
|
30
30
|
|
|
31
31
|
import { UAccordion } from "./constants.js";
|
|
32
32
|
import defaultConfig from "./config.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UAccordion from "../../ui.container-accordion/UAccordion.vue";
|
|
4
4
|
import UButton from "../../ui.button/UButton.vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UCard from "../../ui.container-card/UCard.vue";
|
|
4
4
|
import UInput from "../../ui.form-input/UInput.vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
4
4
|
import UInput from "../../ui.form-input/UInput.vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import URow from "../../ui.container-row/URow.vue";
|
|
4
4
|
import UDivider from "../../ui.container-divider/UDivider.vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UGroup from "../../ui.container-group/UGroup.vue";
|
|
4
4
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
<script setup>
|
|
108
108
|
import { computed, useSlots, watch, ref, useId } from "vue";
|
|
109
109
|
|
|
110
|
-
import { getDefault } from "../utils/
|
|
110
|
+
import { getDefault } from "../utils/ui.ts";
|
|
111
111
|
|
|
112
112
|
import ULink from "../ui.button-link/ULink.vue";
|
|
113
113
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UModal from "../../ui.container-modal/UModal.vue";
|
|
4
4
|
import UButton from "../../ui.button/UButton.vue";
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
import { computed } from "vue";
|
|
84
84
|
import { merge } from "lodash-es";
|
|
85
85
|
|
|
86
|
-
import { getDefault } from "../utils/
|
|
86
|
+
import { getDefault } from "../utils/ui.ts";
|
|
87
87
|
|
|
88
88
|
import UButton from "../ui.button/UButton.vue";
|
|
89
89
|
import UModal from "../ui.container-modal/UModal.vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UModalConfirm from "../../ui.container-modal-confirm/UModalConfirm.vue";
|
|
4
4
|
import UButton from "../../ui.button/UButton.vue";
|
|
@@ -89,7 +89,7 @@ import ULink from "../ui.button-link/ULink.vue";
|
|
|
89
89
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
90
90
|
import UHeader from "../ui.text-header/UHeader.vue";
|
|
91
91
|
|
|
92
|
-
import { getDefault } from "../utils/
|
|
92
|
+
import { getDefault } from "../utils/ui.ts";
|
|
93
93
|
|
|
94
94
|
import defaultConfig from "./config.js";
|
|
95
95
|
import { UPage } from "./constants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "../../utils/
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./stories.js";
|
|
5
5
|
import defaultConfig from "../config.js?raw"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/
|
|
1
|
+
import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
|
|
2
2
|
|
|
3
3
|
import UPage from "../../ui.container-page/UPage.vue";
|
|
4
4
|
import UCard from "../../ui.container-card/UCard.vue";
|