vueless 0.0.478 → 0.0.480
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/adatper.locale/vue-i18n.ts +14 -0
- package/adatper.locale/{vueless.js → vueless.ts} +67 -19
- package/composables/useAutoPosition.ts +113 -0
- package/composables/useBreakpoint.ts +109 -0
- package/composables/useLocale.ts +22 -0
- package/composables/useMutationObserver.ts +53 -0
- package/composables/{useUI.js → useUI.ts} +109 -105
- package/constants.js +124 -2
- package/directives/clickOutside/storybook/Docs.mdx +1 -1
- package/directives/clickOutside/storybook/{stories.js → stories.ts} +7 -9
- package/directives/clickOutside/types.ts +22 -0
- package/directives/clickOutside/vClickOutside.ts +96 -0
- package/directives/index.js +7 -2
- package/directives/tooltip/storybook/Docs.mdx +1 -1
- package/directives/tooltip/storybook/{stories.js → stories.ts} +22 -10
- package/directives/tooltip/types.ts +14 -0
- package/directives/tooltip/vTooltip.ts +82 -0
- package/{index.js → index.ts} +12 -9
- package/package.json +38 -25
- package/plugin-vite.d.ts +10 -0
- package/plugin-vite.js +97 -0
- package/{preset.tailwind.js → preset-tailwind.js} +21 -7
- package/types.ts +322 -0
- package/ui.button/UButton.vue +1 -1
- package/ui.button/storybook/Docs.mdx +1 -1
- package/ui.button/storybook/stories.js +11 -6
- package/ui.button/useAttrs.js +1 -1
- package/ui.button-link/ULink.vue +2 -2
- package/ui.button-link/storybook/Docs.mdx +1 -1
- package/ui.button-link/storybook/stories.js +2 -2
- package/ui.button-link/useAttrs.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 +2 -2
- package/ui.button-toggle/useAttrs.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.button-toggle-item/useAttrs.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-accordion/useAttrs.js +1 -1
- package/ui.container-card/storybook/Docs.mdx +1 -1
- package/ui.container-card/storybook/stories.js +1 -1
- package/ui.container-card/useAttrs.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-col/useAttrs.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 +2 -2
- package/ui.container-divider/useAttrs.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-group/useAttrs.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 +2 -2
- package/ui.container-modal/useAttrs.js +1 -1
- package/ui.container-modal-confirm/UModalConfirm.vue +2 -2
- package/ui.container-modal-confirm/storybook/Docs.mdx +1 -1
- package/ui.container-modal-confirm/storybook/stories.js +2 -2
- package/ui.container-modal-confirm/useAttrs.js +1 -1
- package/ui.container-page/UPage.vue +2 -2
- package/ui.container-page/storybook/Docs.mdx +1 -1
- package/ui.container-page/storybook/stories.js +1 -1
- package/ui.container-page/useAttrs.js +2 -2
- package/ui.container-row/URow.vue +1 -1
- package/ui.container-row/storybook/Docs.mdx +1 -1
- package/ui.container-row/storybook/stories.js +2 -2
- package/ui.container-row/useAttrs.js +1 -1
- package/ui.data-list/UDataList.vue +6 -6
- package/ui.data-list/storybook/Docs.mdx +1 -1
- package/ui.data-list/storybook/stories.js +1 -1
- package/ui.data-list/useAttrs.js +1 -1
- package/ui.data-table/UTable.vue +3 -3
- package/ui.data-table/UTableRow.vue +7 -6
- 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/useAttrs.js +1 -1
- 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 +2 -2
- package/ui.dropdown-badge/useAttrs.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 +3 -3
- package/ui.dropdown-button/useAttrs.js +1 -1
- package/ui.dropdown-link/UDropdownLink.vue +1 -1
- package/ui.dropdown-link/config.js +1 -1
- package/ui.dropdown-link/storybook/Docs.mdx +1 -1
- package/ui.dropdown-link/storybook/stories.js +2 -2
- package/ui.dropdown-link/useAttrs.js +4 -6
- package/ui.dropdown-list/UDropdownList.vue +3 -3
- package/ui.dropdown-list/storybook/Docs.mdx +1 -1
- package/ui.dropdown-list/storybook/stories.js +2 -2
- package/ui.dropdown-list/useAttrs.js +1 -1
- package/ui.form-calendar/UCalendar.vue +2 -2
- package/ui.form-calendar/storybook/Docs.mdx +1 -1
- package/ui.form-calendar/storybook/stories.js +1 -1
- package/ui.form-calendar/useAttrs.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 +2 -2
- package/ui.form-checkbox/useAttrs.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 +2 -2
- package/ui.form-checkbox-group/useAttrs.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 +2 -2
- package/ui.form-checkbox-multi-state/useAttrs.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 +2 -2
- package/ui.form-color-picker/useAttrs.js +1 -1
- package/ui.form-date-picker/UDatePicker.vue +4 -7
- package/ui.form-date-picker/storybook/Docs.mdx +1 -1
- package/ui.form-date-picker/storybook/stories.js +3 -3
- package/ui.form-date-picker/useAttrs.js +2 -2
- package/ui.form-date-picker-range/UDatePickerRange.vue +2 -2
- package/ui.form-date-picker-range/storybook/Docs.mdx +1 -1
- package/ui.form-date-picker-range/storybook/stories.js +2 -2
- package/ui.form-date-picker-range/useAttrs.js +2 -2
- package/ui.form-date-picker-range/useLocale.js +1 -1
- package/ui.form-input/UInput.vue +3 -3
- package/ui.form-input/storybook/Docs.mdx +1 -1
- package/ui.form-input/storybook/stories.js +2 -2
- package/ui.form-input/useAttrs.js +1 -1
- package/ui.form-input-file/UInputFile.vue +2 -2
- package/ui.form-input-file/storybook/Docs.mdx +1 -1
- package/ui.form-input-file/storybook/stories.js +2 -2
- package/ui.form-input-file/useAttrs.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 +2 -2
- package/ui.form-input-money/useAttrs.js +1 -1
- package/ui.form-input-money/useFormatCurrency.js +1 -1
- package/ui.form-input-number/UInputNumber.vue +5 -4
- package/ui.form-input-number/storybook/Docs.mdx +1 -1
- package/ui.form-input-number/storybook/stories.js +2 -2
- package/ui.form-input-number/useAttrs.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 +2 -2
- package/ui.form-input-rating/useAttrs.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 +2 -2
- package/ui.form-input-search/useAttrs.js +1 -1
- package/ui.form-label/ULabel.vue +1 -1
- package/ui.form-label/config.js +2 -2
- package/ui.form-label/storybook/Docs.mdx +1 -1
- package/ui.form-label/storybook/stories.js +2 -2
- package/ui.form-label/useAttrs.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/useAttrs.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 +2 -2
- package/ui.form-radio-group/useAttrs.js +1 -1
- package/ui.form-select/USelect.vue +4 -4
- package/ui.form-select/storybook/Docs.mdx +1 -1
- package/ui.form-select/storybook/stories.js +2 -2
- package/ui.form-select/useAttrs.js +1 -1
- package/ui.form-switch/USwitch.vue +2 -2
- package/ui.form-switch/storybook/Docs.mdx +1 -1
- package/ui.form-switch/storybook/stories.js +2 -2
- package/ui.form-switch/useAttrs.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 +2 -2
- package/ui.form-textarea/useAttrs.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 +2 -2
- package/ui.image-avatar/useAttrs.js +1 -1
- package/ui.image-icon/UIcon.vue +23 -8
- package/ui.image-icon/storybook/Docs.mdx +2 -2
- package/ui.image-icon/storybook/stories.js +2 -2
- package/ui.image-icon/useAttrs.js +2 -2
- package/ui.loader/ULoader.vue +1 -1
- package/ui.loader/storybook/Docs.mdx +1 -1
- package/ui.loader/storybook/stories.js +2 -2
- package/ui.loader/useAttrs.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-overlay/useAttrs.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 +3 -4
- package/ui.loader-progress/useAttrs.js +1 -1
- 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-pagination/useAttrs.js +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 +2 -2
- package/ui.navigation-progress/useAttrs.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-tab/useAttrs.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 +2 -2
- package/ui.navigation-tabs/useAttrs.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 +2 -2
- package/ui.other-dot/useAttrs.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 +2 -2
- package/ui.text-alert/useAttrs.js +1 -1
- package/ui.text-badge/UBadge.vue +89 -179
- package/ui.text-badge/storybook/Docs.mdx +3 -3
- package/ui.text-badge/storybook/{stories.js → stories.ts} +33 -37
- package/ui.text-badge/types.ts +84 -0
- package/ui.text-badge/useAttrs.ts +28 -0
- package/ui.text-block/UText.vue +18 -62
- package/ui.text-block/storybook/Docs.mdx +3 -3
- package/ui.text-block/storybook/{stories.js → stories.ts} +13 -8
- package/ui.text-block/types.ts +33 -0
- package/ui.text-block/useAttrs.ts +20 -0
- package/ui.text-empty/UEmpty.vue +1 -1
- package/ui.text-empty/storybook/Docs.mdx +1 -1
- package/ui.text-empty/storybook/stories.js +2 -2
- package/ui.text-empty/useAttrs.js +1 -1
- package/ui.text-file/UFile.vue +13 -16
- package/ui.text-file/config.js +12 -2
- package/ui.text-file/storybook/Docs.mdx +1 -1
- package/ui.text-file/storybook/stories.js +1 -1
- package/ui.text-file/useAttrs.js +1 -1
- package/ui.text-files/UFiles.vue +1 -1
- package/ui.text-files/config.js +1 -1
- package/ui.text-files/storybook/Docs.mdx +1 -1
- package/ui.text-files/storybook/stories.js +1 -1
- package/ui.text-files/useAttrs.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 +2 -2
- package/ui.text-header/useAttrs.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 +2 -2
- package/ui.text-money/useAttrs.js +1 -1
- package/ui.text-money/utilMoney.js +2 -2
- package/ui.text-notify/UNotify.vue +2 -2
- package/ui.text-notify/storybook/Docs.mdx +1 -1
- package/ui.text-notify/storybook/stories.js +1 -1
- package/ui.text-notify/useAttrs.js +1 -1
- package/ui.text-notify/utilNotify.js +1 -1
- package/utils/{utilHelper.js → helper.ts} +14 -27
- package/utils/node/helper.js +78 -0
- package/utils/node/loaderIcon.js +232 -0
- package/utils/node/loaderSvg.js +71 -0
- package/utils/node/mergeConfigs.js +199 -0
- package/utils/node/tailwindSafelist.js +366 -0
- package/utils/node/vuelessConfig.js +42 -0
- package/utils/node/vuelessResolver.js +28 -0
- package/utils/{utilPlatform.js → platform.ts} +10 -3
- package/utils/{utilStorybook.js → storybook.ts} +102 -36
- package/utils/tailwindConfig.ts +33 -0
- package/utils/{utilTheme.js → theme.ts} +65 -30
- package/utils/ui.ts +129 -0
- package/web-types.json +1362 -157
- package/adatper.locale/vue-i18n.js +0 -11
- package/composables/useAutoPosition.js +0 -94
- package/composables/useBreakpoint.js +0 -104
- package/composables/useLocale.js +0 -25
- package/composables/useMutationObserver.js +0 -48
- package/directives/clickOutside/vClickOutside.js +0 -64
- package/directives/tooltip/vTooltip.js +0 -56
- package/ui.text-badge/useAttrs.js +0 -23
- package/ui.text-block/useAttrs.js +0 -15
- package/utils/utilUI.js +0 -360
- /package/adatper.locale/locales/{en.js → en.ts} +0 -0
- /package/ui.image-icon/{config.js → config.ts} +0 -0
- /package/ui.text-badge/{config.js → config.ts} +0 -0
- /package/ui.text-badge/{constants.js → constants.ts} +0 -0
- /package/ui.text-block/{config.js → config.ts} +0 -0
- /package/ui.text-block/{constants.js → constants.ts} +0 -0
package/types.ts
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { hasSlotContent } from "./composables/useUI.ts";
|
|
2
|
+
|
|
3
|
+
// TODO: Import all components here
|
|
4
|
+
import UTextDefaultConfig from "./ui.text-block/config.ts";
|
|
5
|
+
import UButtonDefaultConfig from "./ui.button/config.ts";
|
|
6
|
+
import UBadgeDefaultConfig from "./ui.text-badge/config.ts";
|
|
7
|
+
|
|
8
|
+
import type { ComputedRef, MaybeRef } from "vue";
|
|
9
|
+
import type { Props } from "tippy.js";
|
|
10
|
+
import type { LocaleOptions } from "./adatper.locale/vueless.ts";
|
|
11
|
+
|
|
12
|
+
export type TemplateRefElement = MaybeRef<HTMLElement | HTMLElement[] | null>;
|
|
13
|
+
|
|
14
|
+
export interface ThemeConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Components brand (primary) color.
|
|
17
|
+
*/
|
|
18
|
+
brand?: BrandColors;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Components gray (secondary) color.
|
|
22
|
+
*/
|
|
23
|
+
gray?: GrayColors;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Default components rounding (border-radius).
|
|
27
|
+
*/
|
|
28
|
+
rounding?: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Default components ring width.
|
|
32
|
+
*/
|
|
33
|
+
ring?: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Default components ring offset width.
|
|
37
|
+
*/
|
|
38
|
+
ringOffset?: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Default components ring color for light theme.
|
|
42
|
+
*/
|
|
43
|
+
ringOffsetColorLight?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Default components ring color for dark theme.
|
|
47
|
+
*/
|
|
48
|
+
ringOffsetColorDark?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Default dark mode state.
|
|
52
|
+
*/
|
|
53
|
+
darkMode?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface Config extends ThemeConfig {
|
|
57
|
+
/**
|
|
58
|
+
* Component classes merge behavior.
|
|
59
|
+
* – merge (default) – smartly merge provided custom classes with default config classes.
|
|
60
|
+
* – replace – replace default config keys by provided custom keys (override only provided keys, the rest classes will be taken from the default config).
|
|
61
|
+
* – override – override default config by provided custom config (keeps only custom config, removes all default classes).
|
|
62
|
+
*/
|
|
63
|
+
strategy?: Strategies;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Component configs.
|
|
67
|
+
*/
|
|
68
|
+
component?: Partial<Components>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Directive configs.
|
|
72
|
+
*/
|
|
73
|
+
directive?: Partial<Directives>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Tailwind-merge config extension for custom classes.
|
|
77
|
+
* All lists of rules available here:
|
|
78
|
+
* https://github.com/dcastil/tailwind-merge/blob/v2.3.0/src/lib/default-config.ts.
|
|
79
|
+
*/
|
|
80
|
+
tailwindMerge?: UnknownObject;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type UnknownObject = Record<string, unknown>;
|
|
84
|
+
export type ComponentNames = keyof Components; // keys union
|
|
85
|
+
export type Strategies = "merge" | "replace" | "override";
|
|
86
|
+
export type Gray = "gray";
|
|
87
|
+
export type GrayColors = "slate" | "cool" | "zinc" | "neutral" | "stone";
|
|
88
|
+
export type BrandColors =
|
|
89
|
+
| "grayscale"
|
|
90
|
+
| "red"
|
|
91
|
+
| "orange"
|
|
92
|
+
| "amber"
|
|
93
|
+
| "yellow"
|
|
94
|
+
| "lime"
|
|
95
|
+
| "green"
|
|
96
|
+
| "emerald"
|
|
97
|
+
| "teal"
|
|
98
|
+
| "cyan"
|
|
99
|
+
| "sky"
|
|
100
|
+
| "blue"
|
|
101
|
+
| "indigo"
|
|
102
|
+
| "violet"
|
|
103
|
+
| "purple"
|
|
104
|
+
| "fuchsia"
|
|
105
|
+
| "pink"
|
|
106
|
+
| "rose";
|
|
107
|
+
|
|
108
|
+
export interface Components {
|
|
109
|
+
UText?: Partial<typeof UTextDefaultConfig>;
|
|
110
|
+
UButton?: Partial<typeof UButtonDefaultConfig>;
|
|
111
|
+
UBadge?: Partial<typeof UBadgeDefaultConfig>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface Directives {
|
|
115
|
+
tooltip?: Partial<Props>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface Component {
|
|
119
|
+
i18n?: UnknownObject;
|
|
120
|
+
defaults?: Defaults;
|
|
121
|
+
safelist?: (string: string) => TailwindSafelist[];
|
|
122
|
+
strategy?: Strategies;
|
|
123
|
+
transition?: Transition;
|
|
124
|
+
safelistColors?: BrandColors;
|
|
125
|
+
[key: string]: (CVA & NestedComponent) | object | string | undefined;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type Defaults = {
|
|
129
|
+
color?: string;
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export interface NestedComponent {
|
|
134
|
+
component: string;
|
|
135
|
+
[key: string]: Record<string, string | object> | string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface Transition {
|
|
139
|
+
enterFromClass?: string;
|
|
140
|
+
enterActiveClass?: string;
|
|
141
|
+
enterToClass?: string;
|
|
142
|
+
leaveFromClass?: string;
|
|
143
|
+
leaveActiveClass?: string;
|
|
144
|
+
leaveToClass?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface CVA {
|
|
148
|
+
base?: string;
|
|
149
|
+
variants?: UnknownObject;
|
|
150
|
+
compoundVariants?: CVACompoundVariants[] & never[];
|
|
151
|
+
defaultVariants?: UnknownObject;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface CVACompoundVariants {
|
|
155
|
+
class: string;
|
|
156
|
+
[key: string]: string | number | undefined | null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface VueAttrs {
|
|
160
|
+
id?: string;
|
|
161
|
+
class?: string;
|
|
162
|
+
value?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface UseAttrs {
|
|
166
|
+
hasSlotContent: typeof hasSlotContent;
|
|
167
|
+
[key: string]: object | undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface KeyAttrs extends VueAttrs {
|
|
171
|
+
"vl-component"?: string | null;
|
|
172
|
+
"vl-key"?: string | null;
|
|
173
|
+
"vl-child-component"?: string | null;
|
|
174
|
+
"vl-child-key"?: string | null;
|
|
175
|
+
config?: UnknownObject;
|
|
176
|
+
[key: string]: string | UnknownObject | undefined | null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface KeysToExtend {
|
|
180
|
+
base?: ComputedRef;
|
|
181
|
+
extend?: ComputedRef;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface CreateVuelessOptions {
|
|
185
|
+
i18n?: LocaleOptions;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface TailwindSafelist {
|
|
189
|
+
pattern: string;
|
|
190
|
+
variants?: string[];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface TailwindColorShades {
|
|
194
|
+
50: string;
|
|
195
|
+
100: string;
|
|
196
|
+
200: string;
|
|
197
|
+
300: string;
|
|
198
|
+
400: string;
|
|
199
|
+
500: string;
|
|
200
|
+
600: string;
|
|
201
|
+
700: string;
|
|
202
|
+
800: string;
|
|
203
|
+
900: string;
|
|
204
|
+
950: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface VuelessCssVariables {
|
|
208
|
+
"--vl-ring": string;
|
|
209
|
+
"--vl-ring-offset": string;
|
|
210
|
+
"--vl-ring-offset-color": string;
|
|
211
|
+
"--vl-rounding": string;
|
|
212
|
+
/* Gray CSS variables */
|
|
213
|
+
"--vl-color-gray-50": string;
|
|
214
|
+
"--vl-color-gray-100": string;
|
|
215
|
+
"--vl-color-gray-200": string;
|
|
216
|
+
"--vl-color-gray-300": string;
|
|
217
|
+
"--vl-color-gray-400": string;
|
|
218
|
+
"--vl-color-gray-500": string;
|
|
219
|
+
"--vl-color-gray-600": string;
|
|
220
|
+
"--vl-color-gray-700": string;
|
|
221
|
+
"--vl-color-gray-800": string;
|
|
222
|
+
"--vl-color-gray-900": string;
|
|
223
|
+
"--vl-color-gray-950": string;
|
|
224
|
+
"--vl-color-gray-default": string;
|
|
225
|
+
/* Brand CSS variables */
|
|
226
|
+
"--vl-color-brand-50": string;
|
|
227
|
+
"--vl-color-brand-100": string;
|
|
228
|
+
"--vl-color-brand-200": string;
|
|
229
|
+
"--vl-color-brand-300": string;
|
|
230
|
+
"--vl-color-brand-400": string;
|
|
231
|
+
"--vl-color-brand-500": string;
|
|
232
|
+
"--vl-color-brand-600": string;
|
|
233
|
+
"--vl-color-brand-700": string;
|
|
234
|
+
"--vl-color-brand-800": string;
|
|
235
|
+
"--vl-color-brand-900": string;
|
|
236
|
+
"--vl-color-brand-950": string;
|
|
237
|
+
"--vl-color-brand-default": string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* Web-types interfaces and types */
|
|
241
|
+
|
|
242
|
+
export interface WebTypes {
|
|
243
|
+
framework: string;
|
|
244
|
+
name: string;
|
|
245
|
+
version: string;
|
|
246
|
+
contributions: Contributions;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface Contributions {
|
|
250
|
+
html: HtmlContributions;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface HtmlContributions {
|
|
254
|
+
"description-markup": string;
|
|
255
|
+
"types-syntax": string;
|
|
256
|
+
tags: Tag[];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface Tag {
|
|
260
|
+
name: string;
|
|
261
|
+
description?: string;
|
|
262
|
+
attributes?: Attribute[];
|
|
263
|
+
events?: Event[];
|
|
264
|
+
slots?: Slot[];
|
|
265
|
+
exposes?: Expose[];
|
|
266
|
+
source?: Source;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface Source {
|
|
270
|
+
module: string;
|
|
271
|
+
symbol: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface Attribute {
|
|
275
|
+
name: string;
|
|
276
|
+
enum: string[];
|
|
277
|
+
required?: boolean;
|
|
278
|
+
description?: string;
|
|
279
|
+
value: AttributeValue;
|
|
280
|
+
default?: unknown;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface AttributeValue {
|
|
284
|
+
kind: string;
|
|
285
|
+
type: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface Event {
|
|
289
|
+
name: string;
|
|
290
|
+
description?: string;
|
|
291
|
+
properties?: EventProperty[];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface EventProperty {
|
|
295
|
+
type: string[];
|
|
296
|
+
name: string;
|
|
297
|
+
description?: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface Slot {
|
|
301
|
+
name: string;
|
|
302
|
+
description?: string;
|
|
303
|
+
scoped?: boolean;
|
|
304
|
+
bindings?: SlotBinding[];
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export interface SlotBinding {
|
|
308
|
+
type: string;
|
|
309
|
+
name: string;
|
|
310
|
+
description?: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export interface Expose {
|
|
314
|
+
name: string;
|
|
315
|
+
description?: string;
|
|
316
|
+
properties: ExposeProperty[];
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface ExposeProperty {
|
|
320
|
+
type: string;
|
|
321
|
+
description?: string;
|
|
322
|
+
}
|
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,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getArgTypes,
|
|
3
|
+
getSlotNames,
|
|
4
|
+
getSlotsFragment,
|
|
5
|
+
getDocsDescription,
|
|
6
|
+
} from "../../utils/storybook.ts";
|
|
2
7
|
|
|
3
8
|
import UButton from "../../ui.button/UButton.vue";
|
|
4
9
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
5
10
|
import URow from "../../ui.container-row/URow.vue";
|
|
6
11
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
7
12
|
|
|
8
|
-
/**
|
|
9
|
-
* The `UButton` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.button)
|
|
10
|
-
*/
|
|
11
13
|
export default {
|
|
12
14
|
id: "1010",
|
|
13
15
|
title: "Buttons & Links / Button",
|
|
@@ -18,6 +20,9 @@ export default {
|
|
|
18
20
|
argTypes: {
|
|
19
21
|
...getArgTypes(UButton.__name),
|
|
20
22
|
},
|
|
23
|
+
parameters: {
|
|
24
|
+
...getDocsDescription(UButton.__name),
|
|
25
|
+
},
|
|
21
26
|
};
|
|
22
27
|
|
|
23
28
|
const DefaultTemplate = (args) => ({
|
|
@@ -34,7 +39,7 @@ const DefaultTemplate = (args) => ({
|
|
|
34
39
|
`,
|
|
35
40
|
});
|
|
36
41
|
|
|
37
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
42
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
38
43
|
components: { UButton, URow, UCol },
|
|
39
44
|
setup() {
|
|
40
45
|
return { args, options: argTypes[args.enum].options };
|
|
@@ -54,7 +59,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
|
54
59
|
`,
|
|
55
60
|
});
|
|
56
61
|
|
|
57
|
-
const ColorTemplate = (args, { argTypes }
|
|
62
|
+
const ColorTemplate = (args, { argTypes }) => ({
|
|
58
63
|
components: { UButton, URow, UCol },
|
|
59
64
|
setup() {
|
|
60
65
|
return {
|
package/ui.button/useAttrs.js
CHANGED
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";
|
|
@@ -256,7 +256,7 @@ const props = defineProps({
|
|
|
256
256
|
});
|
|
257
257
|
|
|
258
258
|
const isPresentRoute = computed(() => {
|
|
259
|
-
for (
|
|
259
|
+
for (const key in props.to) return true;
|
|
260
260
|
|
|
261
261
|
return false;
|
|
262
262
|
});
|
|
@@ -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";
|
|
@@ -34,7 +34,7 @@ const DefaultTemplate = (args) => ({
|
|
|
34
34
|
`,
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
37
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
38
38
|
components: { ULink, URow },
|
|
39
39
|
setup() {
|
|
40
40
|
function getText(value) {
|
|
@@ -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";
|
|
@@ -41,7 +41,7 @@ const DefaultTemplate = (args) => ({
|
|
|
41
41
|
`,
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
44
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
45
45
|
components: { UToggle, URow },
|
|
46
46
|
setup() {
|
|
47
47
|
const value = ref("");
|
|
@@ -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";
|
|
@@ -29,7 +29,7 @@ const DefaultTemplate = (args) => ({
|
|
|
29
29
|
`,
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
const EnumVariantTemplate = (args, { argTypes }
|
|
32
|
+
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
33
33
|
components: { UDivider, URow },
|
|
34
34
|
setup() {
|
|
35
35
|
return {
|
|
@@ -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"
|