cisse-vue-ui 0.8.3 → 0.9.0
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/README.md +666 -4
- package/dist/{CheckboxGroup.vue_vue_type_script_setup_true_lang-DuJr8cz3.cjs → CheckboxGroup.vue_vue_type_script_setup_true_lang-BC86pBlY.cjs} +70 -70
- package/dist/CheckboxGroup.vue_vue_type_script_setup_true_lang-BC86pBlY.cjs.map +1 -0
- package/dist/{CheckboxGroup.vue_vue_type_script_setup_true_lang-N4oS_DJD.js → CheckboxGroup.vue_vue_type_script_setup_true_lang-ZP02bMgY.js} +72 -72
- package/dist/CheckboxGroup.vue_vue_type_script_setup_true_lang-ZP02bMgY.js.map +1 -0
- package/dist/{ConfirmDialog.vue_vue_type_script_setup_true_lang-DWs2V7xX.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-C5KHLMvx.js} +37 -184
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-C5KHLMvx.js.map +1 -0
- package/dist/{ConfirmDialog.vue_vue_type_script_setup_true_lang-BGUoa5fT.cjs → ConfirmDialog.vue_vue_type_script_setup_true_lang-CLfy0-Wb.cjs} +33 -180
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CLfy0-Wb.cjs.map +1 -0
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-DoJKvn30.cjs → Dropdown.vue_vue_type_script_setup_true_lang-BAKGRZIb.cjs} +2 -2
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-DoJKvn30.cjs.map → Dropdown.vue_vue_type_script_setup_true_lang-BAKGRZIb.cjs.map} +1 -1
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-A9Ax6iob.js → Dropdown.vue_vue_type_script_setup_true_lang-GLCX7E3C.js} +2 -2
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-A9Ax6iob.js.map → Dropdown.vue_vue_type_script_setup_true_lang-GLCX7E3C.js.map} +1 -1
- package/dist/{FilterTabs.vue_vue_type_script_setup_true_lang-jW6Ikbvy.cjs → FilterTabs.vue_vue_type_script_setup_true_lang-COkZbeGG.cjs} +1260 -209
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-COkZbeGG.cjs.map +1 -0
- package/dist/{FilterTabs.vue_vue_type_script_setup_true_lang-CcOgc2Y_.js → FilterTabs.vue_vue_type_script_setup_true_lang-CzpYHtc5.js} +1269 -218
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-CzpYHtc5.js.map +1 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BHopJ9RG.js +298 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BHopJ9RG.js.map +1 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-Bo3HqgX0.cjs +297 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-Bo3HqgX0.cjs.map +1 -0
- package/dist/{PageHero.vue_vue_type_script_setup_true_lang-rbvfGvll.cjs → PageHero.vue_vue_type_script_setup_true_lang-BqwBJlv0.cjs} +2 -2
- package/dist/{PageHero.vue_vue_type_script_setup_true_lang-rbvfGvll.cjs.map → PageHero.vue_vue_type_script_setup_true_lang-BqwBJlv0.cjs.map} +1 -1
- package/dist/{PageHero.vue_vue_type_script_setup_true_lang-Gvocjdqh.js → PageHero.vue_vue_type_script_setup_true_lang-by-P5wIB.js} +2 -2
- package/dist/{PageHero.vue_vue_type_script_setup_true_lang-Gvocjdqh.js.map → PageHero.vue_vue_type_script_setup_true_lang-by-P5wIB.js.map} +1 -1
- package/dist/cisse-vue-ui.css +4 -4
- package/dist/components/core/AccordionItem.test.d.ts +1 -0
- package/dist/components/core/Breadcrumb.stories.d.ts +5 -0
- package/dist/components/core/CardWrapper.stories.d.ts +32 -0
- package/dist/components/core/CardWrapper.test.d.ts +1 -0
- package/dist/components/core/CardWrapper.vue.d.ts +129 -0
- package/dist/components/core/CollapsibleCard.vue.d.ts +1 -1
- package/dist/components/core/DataTable.stories.d.ts +38 -0
- package/dist/components/core/Dropdown.vue.d.ts +1 -1
- package/dist/components/core/Popover.vue.d.ts +2 -2
- package/dist/components/core/Tooltip.stories.d.ts +3 -0
- package/dist/components/core/index.cjs +40 -23
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +4 -1
- package/dist/components/core/index.js +40 -23
- package/dist/components/core/table/DataTable.test.d.ts +1 -0
- package/dist/components/core/{TableComponent.vue.d.ts → table/DataTable.vue.d.ts} +60 -7
- package/dist/components/core/table/Table.stories.d.ts +27 -0
- package/dist/components/core/table/atoms/Caption.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Caption.vue.d.ts +26 -0
- package/dist/components/core/table/atoms/Col.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Col.vue.d.ts +8 -0
- package/dist/components/core/table/atoms/Colgroup.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Colgroup.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Table.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Table.vue.d.ts +46 -0
- package/dist/components/core/table/atoms/Tbody.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Tbody.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Td.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Td.vue.d.ts +43 -0
- package/dist/components/core/table/atoms/Tfoot.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Tfoot.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Th.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Th.vue.d.ts +64 -0
- package/dist/components/core/table/atoms/Thead.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Thead.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Tr.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Tr.vue.d.ts +35 -0
- package/dist/components/core/table/atoms/index.d.ts +10 -0
- package/dist/components/core/table/index.d.ts +3 -0
- package/dist/components/core/table/molecules/ExpandableRow.test.d.ts +1 -0
- package/dist/components/core/table/molecules/ExpandableRow.vue.d.ts +47 -0
- package/dist/components/core/table/molecules/TableFooter.test.d.ts +1 -0
- package/dist/components/core/table/molecules/TableFooter.vue.d.ts +21 -0
- package/dist/components/core/table/molecules/TableHeader.test.d.ts +1 -0
- package/dist/components/core/table/molecules/TableHeader.vue.d.ts +49 -0
- package/dist/components/core/table/molecules/TableRow.test.d.ts +1 -0
- package/dist/components/core/table/molecules/TableRow.vue.d.ts +59 -0
- package/dist/components/core/table/molecules/index.d.ts +4 -0
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/TableSkeleton.vue.d.ts +1 -1
- package/dist/components/feedback/index.cjs +14 -14
- package/dist/components/feedback/index.js +14 -14
- package/dist/components/form/Combobox.stories.d.ts +2 -0
- package/dist/components/form/Combobox.vue.d.ts +4 -0
- package/dist/components/form/DatePicker.stories.d.ts +2 -0
- package/dist/components/form/DatePicker.vue.d.ts +4 -0
- package/dist/components/form/FormSection.vue.d.ts +1 -1
- package/dist/components/form/FormSelect.stories.d.ts +2 -0
- package/dist/components/form/FormSelect.vue.d.ts +4 -0
- package/dist/components/form/IconPicker.stories.d.ts +19 -0
- package/dist/components/form/IconPicker.test.d.ts +1 -0
- package/dist/components/form/InputWrapper.stories.d.ts +1 -5
- package/dist/components/form/InputWrapper.vue.d.ts +6 -3
- package/dist/components/form/Rating.vue.d.ts +1 -1
- package/dist/components/form/SearchInput.vue.d.ts +1 -1
- package/dist/components/form/TagsInput.stories.d.ts +1 -0
- package/dist/components/form/TagsInput.vue.d.ts +3 -3
- package/dist/components/form/TextArea.stories.d.ts +3 -1
- package/dist/components/form/TextArea.vue.d.ts +4 -0
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +2 -2
- package/dist/components/index.cjs +56 -39
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +66 -49
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/composables/index.cjs +18 -9
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.d.ts +8 -0
- package/dist/composables/index.js +15 -6
- package/dist/composables/index.js.map +1 -1
- package/dist/composables/useColumnResize.d.ts +38 -0
- package/dist/composables/useColumnResize.test.d.ts +1 -0
- package/dist/composables/useColumnVisibility.d.ts +44 -0
- package/dist/composables/useColumnVisibility.test.d.ts +1 -0
- package/dist/composables/useEditableCell.d.ts +51 -0
- package/dist/composables/useEditableCell.test.d.ts +1 -0
- package/dist/composables/useInputStyles.d.ts +32 -0
- package/dist/composables/useInputStyles.test.d.ts +1 -0
- package/dist/composables/usePagination.d.ts +44 -0
- package/dist/composables/usePagination.test.d.ts +1 -0
- package/dist/composables/usePinnedRows.d.ts +41 -0
- package/dist/composables/usePinnedRows.test.d.ts +1 -0
- package/dist/composables/useTableKeyboardNavigation.d.ts +52 -0
- package/dist/composables/useTableKeyboardNavigation.test.d.ts +1 -0
- package/dist/composables/useVirtualScroll.d.ts +32 -0
- package/dist/composables/useVirtualScroll.test.d.ts +1 -0
- package/dist/index-0kwQORZJ.js +114 -0
- package/dist/index-0kwQORZJ.js.map +1 -0
- package/dist/{index-5dQNEzd8.cjs → index-BMSH4AOz.cjs} +57 -40
- package/dist/{index-5dQNEzd8.cjs.map → index-BMSH4AOz.cjs.map} +1 -1
- package/dist/{index-SNefWfX0.js → index-BaWpldIJ.js} +3 -3
- package/dist/{index-SNefWfX0.js.map → index-BaWpldIJ.js.map} +1 -1
- package/dist/index.cjs +75 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +83 -57
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/types/property.d.ts +8 -0
- package/dist/{useDropdown-DK4c5JGL.cjs → useDropdown-HI7ABBLe.cjs} +5 -4
- package/dist/{useDropdown-DK4c5JGL.cjs.map → useDropdown-HI7ABBLe.cjs.map} +1 -1
- package/dist/{useDropdown-De0cKI83.js → useDropdown-XITCE_SM.js} +5 -4
- package/dist/{useDropdown-De0cKI83.js.map → useDropdown-XITCE_SM.js.map} +1 -1
- package/dist/useInputStyles-BFTJdXHL.js +127 -0
- package/dist/useInputStyles-BFTJdXHL.js.map +1 -0
- package/dist/useInputStyles-DMfvW6N5.cjs +126 -0
- package/dist/useInputStyles-DMfvW6N5.cjs.map +1 -0
- package/dist/usePagination-BGwbICFC.js +135 -0
- package/dist/usePagination-BGwbICFC.js.map +1 -0
- package/dist/usePagination-gvvh1zqA.cjs +134 -0
- package/dist/usePagination-gvvh1zqA.cjs.map +1 -0
- package/dist/useVirtualScroll-BivP86fA.cjs +869 -0
- package/dist/useVirtualScroll-BivP86fA.cjs.map +1 -0
- package/dist/useVirtualScroll-YeZru2Eo.js +870 -0
- package/dist/useVirtualScroll-YeZru2Eo.js.map +1 -0
- package/package.json +1 -1
- package/dist/CheckboxGroup.vue_vue_type_script_setup_true_lang-DuJr8cz3.cjs.map +0 -1
- package/dist/CheckboxGroup.vue_vue_type_script_setup_true_lang-N4oS_DJD.js.map +0 -1
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-BGUoa5fT.cjs.map +0 -1
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-DWs2V7xX.js.map +0 -1
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-CcOgc2Y_.js.map +0 -1
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-jW6Ikbvy.cjs.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BwtEbaiT.js +0 -150
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BwtEbaiT.js.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-DtwwmfWr.cjs +0 -149
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-DtwwmfWr.cjs.map +0 -1
- package/dist/components/core/TableComponent.stories.d.ts +0 -16
- package/dist/index-CDDUEkXf.js +0 -97
- package/dist/index-CDDUEkXf.js.map +0 -1
- package/dist/useDarkMode-Cl5QWTlC.js +0 -53
- package/dist/useDarkMode-Cl5QWTlC.js.map +0 -1
- package/dist/useDarkMode-DLZcJEUQ.cjs +0 -52
- package/dist/useDarkMode-DLZcJEUQ.cjs.map +0 -1
- package/dist/useToast-Bk60GArg.cjs +0 -176
- package/dist/useToast-Bk60GArg.cjs.map +0 -1
- package/dist/useToast-ina5g3mj.js +0 -177
- package/dist/useToast-ina5g3mj.js.map +0 -1
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const vue = require("vue");
|
|
3
|
-
const _hoisted_1$2 = {
|
|
4
|
-
class: "bg-white dark:bg-gray-900 rounded-lg shadow-md p-4 space-y-4",
|
|
5
|
-
"aria-hidden": "true"
|
|
6
|
-
};
|
|
7
|
-
const _hoisted_2$2 = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "flex items-center gap-3"
|
|
10
|
-
};
|
|
11
|
-
const _hoisted_3$1 = { class: "space-y-2" };
|
|
12
|
-
const _hoisted_4$1 = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "flex justify-end gap-2 pt-2"
|
|
15
|
-
};
|
|
16
|
-
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
-
__name: "CardSkeleton",
|
|
18
|
-
props: {
|
|
19
|
-
showAvatar: { type: Boolean, default: false },
|
|
20
|
-
lines: { default: 3 },
|
|
21
|
-
showActions: { type: Boolean, default: false }
|
|
22
|
-
},
|
|
23
|
-
setup(__props) {
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
|
|
26
|
-
__props.showAvatar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [..._cache[0] || (_cache[0] = [
|
|
27
|
-
vue.createElementVNode("div", { class: "size-10 rounded-full bg-gray-200 dark:bg-gray-700 animate-pulse" }, null, -1),
|
|
28
|
-
vue.createElementVNode("div", { class: "flex-1 space-y-2" }, [
|
|
29
|
-
vue.createElementVNode("div", { class: "h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse w-1/2" }),
|
|
30
|
-
vue.createElementVNode("div", { class: "h-3 bg-gray-200 dark:bg-gray-700 rounded animate-pulse w-1/3" })
|
|
31
|
-
], -1)
|
|
32
|
-
])])) : vue.createCommentVNode("", true),
|
|
33
|
-
vue.createElementVNode("div", _hoisted_3$1, [
|
|
34
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.lines, (line) => {
|
|
35
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
36
|
-
key: line,
|
|
37
|
-
class: "h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",
|
|
38
|
-
style: vue.normalizeStyle({ width: line === __props.lines ? "60%" : "100%" })
|
|
39
|
-
}, null, 4);
|
|
40
|
-
}), 128))
|
|
41
|
-
]),
|
|
42
|
-
__props.showActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [..._cache[1] || (_cache[1] = [
|
|
43
|
-
vue.createElementVNode("div", { class: "h-8 w-20 bg-gray-200 dark:bg-gray-700 rounded animate-pulse" }, null, -1),
|
|
44
|
-
vue.createElementVNode("div", { class: "h-8 w-20 bg-gray-200 dark:bg-gray-700 rounded animate-pulse" }, null, -1)
|
|
45
|
-
])])) : vue.createCommentVNode("", true)
|
|
46
|
-
]);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
const _hoisted_1$1 = {
|
|
51
|
-
class: "w-full",
|
|
52
|
-
"aria-hidden": "true"
|
|
53
|
-
};
|
|
54
|
-
const _hoisted_2$1 = {
|
|
55
|
-
key: 0,
|
|
56
|
-
class: "flex gap-4 px-4 py-3 border-b border-gray-200 dark:border-gray-700"
|
|
57
|
-
};
|
|
58
|
-
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
59
|
-
__name: "TableSkeleton",
|
|
60
|
-
props: {
|
|
61
|
-
rows: { default: 5 },
|
|
62
|
-
columns: { default: 4 },
|
|
63
|
-
showHeader: { type: Boolean, default: true }
|
|
64
|
-
},
|
|
65
|
-
setup(__props) {
|
|
66
|
-
return (_ctx, _cache) => {
|
|
67
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
|
|
68
|
-
__props.showHeader ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
|
|
69
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.columns, (col) => {
|
|
70
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
71
|
-
key: `header-${col}`,
|
|
72
|
-
class: "flex-1 h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",
|
|
73
|
-
style: vue.normalizeStyle({ maxWidth: col === 1 ? "30%" : "20%" })
|
|
74
|
-
}, null, 4);
|
|
75
|
-
}), 128))
|
|
76
|
-
])) : vue.createCommentVNode("", true),
|
|
77
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.rows, (row) => {
|
|
78
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
79
|
-
key: `row-${row}`,
|
|
80
|
-
class: "flex items-center gap-4 px-4 py-4 border-b border-gray-100 dark:border-gray-800"
|
|
81
|
-
}, [
|
|
82
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.columns, (col) => {
|
|
83
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
84
|
-
key: `cell-${row}-${col}`,
|
|
85
|
-
class: "flex-1 h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",
|
|
86
|
-
style: vue.normalizeStyle({
|
|
87
|
-
maxWidth: col === 1 ? "40%" : col === __props.columns ? "15%" : "25%",
|
|
88
|
-
opacity: 1 - row * 0.1
|
|
89
|
-
})
|
|
90
|
-
}, null, 4);
|
|
91
|
-
}), 128))
|
|
92
|
-
]);
|
|
93
|
-
}), 128))
|
|
94
|
-
]);
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const _hoisted_1 = {
|
|
99
|
-
class: "divide-y divide-gray-200 dark:divide-gray-700",
|
|
100
|
-
"aria-hidden": "true"
|
|
101
|
-
};
|
|
102
|
-
const _hoisted_2 = {
|
|
103
|
-
key: 0,
|
|
104
|
-
class: "shrink-0 size-10 rounded-full bg-gray-200 dark:bg-gray-700 animate-pulse"
|
|
105
|
-
};
|
|
106
|
-
const _hoisted_3 = { class: "flex-1 min-w-0 space-y-2" };
|
|
107
|
-
const _hoisted_4 = {
|
|
108
|
-
key: 1,
|
|
109
|
-
class: "shrink-0 size-8 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"
|
|
110
|
-
};
|
|
111
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
112
|
-
__name: "ListSkeleton",
|
|
113
|
-
props: {
|
|
114
|
-
items: { default: 5 },
|
|
115
|
-
showAvatar: { type: Boolean, default: true },
|
|
116
|
-
showSecondary: { type: Boolean, default: true },
|
|
117
|
-
showAction: { type: Boolean, default: false }
|
|
118
|
-
},
|
|
119
|
-
setup(__props) {
|
|
120
|
-
return (_ctx, _cache) => {
|
|
121
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
122
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.items, (item) => {
|
|
123
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
124
|
-
key: item,
|
|
125
|
-
class: "flex items-center gap-4 py-4 px-4"
|
|
126
|
-
}, [
|
|
127
|
-
__props.showAvatar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2)) : vue.createCommentVNode("", true),
|
|
128
|
-
vue.createElementVNode("div", _hoisted_3, [
|
|
129
|
-
vue.createElementVNode("div", {
|
|
130
|
-
class: "h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",
|
|
131
|
-
style: vue.normalizeStyle({ width: `${60 + Math.random() * 30}%` })
|
|
132
|
-
}, null, 4),
|
|
133
|
-
__props.showSecondary ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
134
|
-
key: 0,
|
|
135
|
-
class: "h-3 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",
|
|
136
|
-
style: vue.normalizeStyle({ width: `${40 + Math.random() * 20}%` })
|
|
137
|
-
}, null, 4)) : vue.createCommentVNode("", true)
|
|
138
|
-
]),
|
|
139
|
-
__props.showAction ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("", true)
|
|
140
|
-
]);
|
|
141
|
-
}), 128))
|
|
142
|
-
]);
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
exports._sfc_main = _sfc_main$1;
|
|
147
|
-
exports._sfc_main$1 = _sfc_main$2;
|
|
148
|
-
exports._sfc_main$2 = _sfc_main;
|
|
149
|
-
//# sourceMappingURL=ListSkeleton.vue_vue_type_script_setup_true_lang-DtwwmfWr.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListSkeleton.vue_vue_type_script_setup_true_lang-DtwwmfWr.cjs","sources":["../src/components/feedback/CardSkeleton.vue","../src/components/feedback/TableSkeleton.vue","../src/components/feedback/ListSkeleton.vue"],"sourcesContent":["<script lang=\"ts\" setup>\r\nwithDefaults(\r\n defineProps<{\r\n /** Show avatar/icon placeholder */\r\n showAvatar?: boolean\r\n /** Number of text lines */\r\n lines?: number\r\n /** Show action buttons */\r\n showActions?: boolean\r\n }>(),\r\n {\r\n showAvatar: false,\r\n lines: 3,\r\n showActions: false,\r\n },\r\n)\r\n</script>\r\n\r\n<template>\r\n <div class=\"bg-white dark:bg-gray-900 rounded-lg shadow-md p-4 space-y-4\" aria-hidden=\"true\">\r\n <!-- Header with avatar -->\r\n <div v-if=\"showAvatar\" class=\"flex items-center gap-3\">\r\n <div class=\"size-10 rounded-full bg-gray-200 dark:bg-gray-700 animate-pulse\" />\r\n <div class=\"flex-1 space-y-2\">\r\n <div class=\"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse w-1/2\" />\r\n <div class=\"h-3 bg-gray-200 dark:bg-gray-700 rounded animate-pulse w-1/3\" />\r\n </div>\r\n </div>\r\n\r\n <!-- Content lines -->\r\n <div class=\"space-y-2\">\r\n <div\r\n v-for=\"line in lines\"\r\n :key=\"line\"\r\n class=\"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse\"\r\n :style=\"{ width: line === lines ? '60%' : '100%' }\"\r\n />\r\n </div>\r\n\r\n <!-- Actions -->\r\n <div v-if=\"showActions\" class=\"flex justify-end gap-2 pt-2\">\r\n <div class=\"h-8 w-20 bg-gray-200 dark:bg-gray-700 rounded animate-pulse\" />\r\n <div class=\"h-8 w-20 bg-gray-200 dark:bg-gray-700 rounded animate-pulse\" />\r\n </div>\r\n </div>\r\n</template>\r\n","<script lang=\"ts\" setup>\r\nwithDefaults(\r\n defineProps<{\r\n /** Number of rows */\r\n rows?: number\r\n /** Number of columns */\r\n columns?: number\r\n /** Show header */\r\n showHeader?: boolean\r\n }>(),\r\n {\r\n rows: 5,\r\n columns: 4,\r\n showHeader: true,\r\n },\r\n)\r\n</script>\r\n\r\n<template>\r\n <div class=\"w-full\" aria-hidden=\"true\">\r\n <!-- Header -->\r\n <div\r\n v-if=\"showHeader\"\r\n class=\"flex gap-4 px-4 py-3 border-b border-gray-200 dark:border-gray-700\"\r\n >\r\n <div\r\n v-for=\"col in columns\"\r\n :key=\"`header-${col}`\"\r\n class=\"flex-1 h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse\"\r\n :style=\"{ maxWidth: col === 1 ? '30%' : '20%' }\"\r\n />\r\n </div>\r\n <!-- Rows -->\r\n <div\r\n v-for=\"row in rows\"\r\n :key=\"`row-${row}`\"\r\n class=\"flex items-center gap-4 px-4 py-4 border-b border-gray-100 dark:border-gray-800\"\r\n >\r\n <div\r\n v-for=\"col in columns\"\r\n :key=\"`cell-${row}-${col}`\"\r\n class=\"flex-1 h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse\"\r\n :style=\"{\r\n maxWidth: col === 1 ? '40%' : col === columns ? '15%' : '25%',\r\n opacity: 1 - (row * 0.1)\r\n }\"\r\n />\r\n </div>\r\n </div>\r\n</template>\r\n","<script lang=\"ts\" setup>\r\nwithDefaults(\r\n defineProps<{\r\n /** Number of items */\r\n items?: number\r\n /** Show avatar/icon placeholder */\r\n showAvatar?: boolean\r\n /** Show secondary text */\r\n showSecondary?: boolean\r\n /** Show action button */\r\n showAction?: boolean\r\n }>(),\r\n {\r\n items: 5,\r\n showAvatar: true,\r\n showSecondary: true,\r\n showAction: false,\r\n },\r\n)\r\n</script>\r\n\r\n<template>\r\n <div class=\"divide-y divide-gray-200 dark:divide-gray-700\" aria-hidden=\"true\">\r\n <div\r\n v-for=\"item in items\"\r\n :key=\"item\"\r\n class=\"flex items-center gap-4 py-4 px-4\"\r\n >\r\n <!-- Avatar -->\r\n <div\r\n v-if=\"showAvatar\"\r\n class=\"shrink-0 size-10 rounded-full bg-gray-200 dark:bg-gray-700 animate-pulse\"\r\n />\r\n\r\n <!-- Content -->\r\n <div class=\"flex-1 min-w-0 space-y-2\">\r\n <div\r\n class=\"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse\"\r\n :style=\"{ width: `${60 + Math.random() * 30}%` }\"\r\n />\r\n <div\r\n v-if=\"showSecondary\"\r\n class=\"h-3 bg-gray-200 dark:bg-gray-700 rounded animate-pulse\"\r\n :style=\"{ width: `${40 + Math.random() * 20}%` }\"\r\n />\r\n </div>\r\n\r\n <!-- Action -->\r\n <div\r\n v-if=\"showAction\"\r\n class=\"shrink-0 size-8 rounded bg-gray-200 dark:bg-gray-700 animate-pulse\"\r\n />\r\n </div>\r\n </div>\r\n</template>\r\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_hoisted_2","_createElementVNode","_hoisted_3","_Fragment","_renderList","_normalizeStyle","_hoisted_4"],"mappings":";;;;;;;;;;;;;;;;;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AA,IAAA,CAAA;AAAA,cAAA;;YAMhC,QAAA,cADRR,IAAAA,UAAA,GAAAC,IAAAA,mBAGE,OAHF,UAGE;;;;;;;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
-
import { default as TableComponent } from './TableComponent.vue';
|
|
3
|
-
declare const meta: Meta<typeof TableComponent>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const WithTypes: Story;
|
|
8
|
-
export declare const WithBadge: Story;
|
|
9
|
-
export declare const WithAlignment: Story;
|
|
10
|
-
export declare const Selectable: Story;
|
|
11
|
-
export declare const WithActions: Story;
|
|
12
|
-
export declare const WithCustomSlot: Story;
|
|
13
|
-
export declare const EmptyState: Story;
|
|
14
|
-
export declare const NestedProperties: Story;
|
|
15
|
-
export declare const Loading: Story;
|
|
16
|
-
export declare const LoadingCustomRows: Story;
|
package/dist/index-CDDUEkXf.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { o as _sfc_main, p as _sfc_main$1, d as _sfc_main$4, f as _sfc_main$5, n as _sfc_main$9, _ as _sfc_main$b, j as _sfc_main$f, r as _sfc_main$j, m as _sfc_main$m, u as _sfc_main$r, b as _sfc_main$E, l as _sfc_main$S, c as _sfc_main$W, s as _sfc_main$Z, t as _sfc_main$_, i as _sfc_main$10, h as _sfc_main$12, e as _sfc_main$13, a as _sfc_main$14, g as _sfc_main$16, q as _sfc_main$19, k as _sfc_main$1c } from "./FilterTabs.vue_vue_type_script_setup_true_lang-CcOgc2Y_.js";
|
|
2
|
-
import { a as _sfc_main$n, _ as _sfc_main$D } from "./Dropdown.vue_vue_type_script_setup_true_lang-A9Ax6iob.js";
|
|
3
|
-
import { e as _sfc_main$6, d as _sfc_main$8, c as _sfc_main$l, b as _sfc_main$K, _ as _sfc_main$$, a as _sfc_main$18 } from "./BadgeType.vue_vue_type_script_setup_true_lang-tHRMWBb-.js";
|
|
4
|
-
import { _ as _sfc_main$a } from "./Button.vue_vue_type_script_setup_true_lang-CBYr0Z2_.js";
|
|
5
|
-
import { A as _sfc_main$e, j as _sfc_main$g, l as _sfc_main$h, g as _sfc_main$k, q as _sfc_main$o, h as _sfc_main$q, o as _sfc_main$s, d as _sfc_main$t, a as _sfc_main$u, b as _sfc_main$v, _ as _sfc_main$w, n as _sfc_main$x, c as _sfc_main$y, m as _sfc_main$z, p as _sfc_main$A, u as _sfc_main$G, t as _sfc_main$J, y as _sfc_main$L, r as _sfc_main$P, v as _sfc_main$Q, s as _sfc_main$R, w as _sfc_main$T, k as _sfc_main$U, i as _sfc_main$V, e as _sfc_main$X, S as Slider, f as _sfc_main$11, T as TagsInput, z as _sfc_main$17, x as _sfc_main$1d } from "./CheckboxGroup.vue_vue_type_script_setup_true_lang-N4oS_DJD.js";
|
|
6
|
-
import { _ as _sfc_main$d } from "./index-SNefWfX0.js";
|
|
7
|
-
import { e as _sfc_main$2, j as _sfc_main$i, f as _sfc_main$p, _ as _sfc_main$C, a as _sfc_main$F, c as _sfc_main$H, d as _sfc_main$I, b as _sfc_main$O, P as Progress, i as _sfc_main$Y, g as _sfc_main$1a, h as _sfc_main$1b } from "./ConfirmDialog.vue_vue_type_script_setup_true_lang-DWs2V7xX.js";
|
|
8
|
-
import { a as _sfc_main$c, b as _sfc_main$B, _ as _sfc_main$15 } from "./ListSkeleton.vue_vue_type_script_setup_true_lang-BwtEbaiT.js";
|
|
9
|
-
import { _ as _sfc_main$3, a as _sfc_main$7, c as _sfc_main$M, b as _sfc_main$N } from "./PageHero.vue_vue_type_script_setup_true_lang-Gvocjdqh.js";
|
|
10
|
-
const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11
|
-
__proto__: null,
|
|
12
|
-
Accordion: _sfc_main,
|
|
13
|
-
AccordionItem: _sfc_main$1,
|
|
14
|
-
Alert: _sfc_main$2,
|
|
15
|
-
AuthLayout: _sfc_main$3,
|
|
16
|
-
AutocompleteComponent: _sfc_main$4,
|
|
17
|
-
Avatar: _sfc_main$5,
|
|
18
|
-
BadgeType: _sfc_main$6,
|
|
19
|
-
BaseLayout: _sfc_main$7,
|
|
20
|
-
BooleanType: _sfc_main$8,
|
|
21
|
-
Breadcrumb: _sfc_main$9,
|
|
22
|
-
Button: _sfc_main$a,
|
|
23
|
-
CardComponent: _sfc_main$b,
|
|
24
|
-
CardSkeleton: _sfc_main$c,
|
|
25
|
-
Checkbox: _sfc_main$d,
|
|
26
|
-
CheckboxGroup: _sfc_main$e,
|
|
27
|
-
CollapsibleCard: _sfc_main$f,
|
|
28
|
-
ColorPicker: _sfc_main$g,
|
|
29
|
-
Combobox: _sfc_main$h,
|
|
30
|
-
ConfirmDialog: _sfc_main$i,
|
|
31
|
-
DarkModeToggle: _sfc_main$j,
|
|
32
|
-
DatePicker: _sfc_main$k,
|
|
33
|
-
DateType: _sfc_main$l,
|
|
34
|
-
Drawer: _sfc_main$m,
|
|
35
|
-
Dropdown: _sfc_main$n,
|
|
36
|
-
EmailInput: _sfc_main$o,
|
|
37
|
-
EmptyState: _sfc_main$p,
|
|
38
|
-
FileUpload: _sfc_main$q,
|
|
39
|
-
FilterTabs: _sfc_main$r,
|
|
40
|
-
FormActions: _sfc_main$s,
|
|
41
|
-
FormGroup: _sfc_main$t,
|
|
42
|
-
FormHelp: _sfc_main$u,
|
|
43
|
-
FormInput: _sfc_main$v,
|
|
44
|
-
FormLabel: _sfc_main$w,
|
|
45
|
-
FormSection: _sfc_main$x,
|
|
46
|
-
FormSelect: _sfc_main$y,
|
|
47
|
-
IconPicker: _sfc_main$z,
|
|
48
|
-
InputWrapper: _sfc_main$A,
|
|
49
|
-
ListSkeleton: _sfc_main$B,
|
|
50
|
-
LoadingSpinner: _sfc_main$C,
|
|
51
|
-
MenuItem: _sfc_main$D,
|
|
52
|
-
MobileList: _sfc_main$E,
|
|
53
|
-
Modal: _sfc_main$F,
|
|
54
|
-
MoneyInput: _sfc_main$G,
|
|
55
|
-
NotificationComponent: _sfc_main$H,
|
|
56
|
-
NotificationList: _sfc_main$I,
|
|
57
|
-
NumberInput: _sfc_main$J,
|
|
58
|
-
NumberType: _sfc_main$K,
|
|
59
|
-
OTPInput: _sfc_main$L,
|
|
60
|
-
PageHero: _sfc_main$M,
|
|
61
|
-
PageLayout: _sfc_main$N,
|
|
62
|
-
PaginationControls: _sfc_main$O,
|
|
63
|
-
PasswordInput: _sfc_main$P,
|
|
64
|
-
PercentInput: _sfc_main$Q,
|
|
65
|
-
PhoneInput: _sfc_main$R,
|
|
66
|
-
Popover: _sfc_main$S,
|
|
67
|
-
Progress,
|
|
68
|
-
QuantityInput: _sfc_main$T,
|
|
69
|
-
RangeSlider: _sfc_main$U,
|
|
70
|
-
Rating: _sfc_main$V,
|
|
71
|
-
ResponsiveList: _sfc_main$W,
|
|
72
|
-
SearchInput: _sfc_main$X,
|
|
73
|
-
Skeleton: _sfc_main$Y,
|
|
74
|
-
Slider,
|
|
75
|
-
StatsCard: _sfc_main$Z,
|
|
76
|
-
StatsGrid: _sfc_main$_,
|
|
77
|
-
StatusBadge: _sfc_main$$,
|
|
78
|
-
Stepper: _sfc_main$10,
|
|
79
|
-
Switch: _sfc_main$11,
|
|
80
|
-
TabPanel: _sfc_main$12,
|
|
81
|
-
TableAction: _sfc_main$13,
|
|
82
|
-
TableComponent: _sfc_main$14,
|
|
83
|
-
TableSkeleton: _sfc_main$15,
|
|
84
|
-
Tabs: _sfc_main$16,
|
|
85
|
-
TagsInput,
|
|
86
|
-
TextArea: _sfc_main$17,
|
|
87
|
-
TextType: _sfc_main$18,
|
|
88
|
-
Timeline: _sfc_main$19,
|
|
89
|
-
Toast: _sfc_main$1a,
|
|
90
|
-
ToastContainer: _sfc_main$1b,
|
|
91
|
-
Tooltip: _sfc_main$1c,
|
|
92
|
-
URLInput: _sfc_main$1d
|
|
93
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
94
|
-
export {
|
|
95
|
-
components as c
|
|
96
|
-
};
|
|
97
|
-
//# sourceMappingURL=index-CDDUEkXf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-CDDUEkXf.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ref, watch, onMounted } from "vue";
|
|
2
|
-
function useDarkMode(options = {}) {
|
|
3
|
-
const {
|
|
4
|
-
selector = "html",
|
|
5
|
-
attribute = "class",
|
|
6
|
-
storageKey = "dark-mode",
|
|
7
|
-
defaultValue = false
|
|
8
|
-
} = options;
|
|
9
|
-
const isDark = ref(defaultValue);
|
|
10
|
-
const getInitialValue = () => {
|
|
11
|
-
if (typeof window === "undefined") return defaultValue;
|
|
12
|
-
const stored = localStorage.getItem(storageKey);
|
|
13
|
-
if (stored !== null) {
|
|
14
|
-
return stored === "true";
|
|
15
|
-
}
|
|
16
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
17
|
-
};
|
|
18
|
-
const updateDOM = (dark) => {
|
|
19
|
-
if (typeof document === "undefined") return;
|
|
20
|
-
const element = document.querySelector(selector);
|
|
21
|
-
if (!element) return;
|
|
22
|
-
if (attribute === "class") {
|
|
23
|
-
element.classList.toggle("dark", dark);
|
|
24
|
-
} else {
|
|
25
|
-
element.setAttribute(attribute, dark ? "dark" : "light");
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const toggle = () => {
|
|
29
|
-
isDark.value = !isDark.value;
|
|
30
|
-
};
|
|
31
|
-
const set = (value) => {
|
|
32
|
-
isDark.value = value;
|
|
33
|
-
};
|
|
34
|
-
watch(isDark, (newValue) => {
|
|
35
|
-
updateDOM(newValue);
|
|
36
|
-
if (typeof localStorage !== "undefined") {
|
|
37
|
-
localStorage.setItem(storageKey, String(newValue));
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
onMounted(() => {
|
|
41
|
-
isDark.value = getInitialValue();
|
|
42
|
-
updateDOM(isDark.value);
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
isDark,
|
|
46
|
-
toggle,
|
|
47
|
-
set
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export {
|
|
51
|
-
useDarkMode as u
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=useDarkMode-Cl5QWTlC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDarkMode-Cl5QWTlC.js","sources":["../src/composables/useDarkMode.ts"],"sourcesContent":["import { ref, watch, onMounted } from 'vue'\n\nexport interface DarkModeOptions {\n selector?: string\n attribute?: string\n storageKey?: string\n defaultValue?: boolean\n}\n\n/**\n * Composable for managing dark mode state\n */\nexport function useDarkMode(options: DarkModeOptions = {}) {\n const {\n selector = 'html',\n attribute = 'class',\n storageKey = 'dark-mode',\n defaultValue = false,\n } = options\n\n const isDark = ref(defaultValue)\n\n const getInitialValue = (): boolean => {\n if (typeof window === 'undefined') return defaultValue\n\n const stored = localStorage.getItem(storageKey)\n if (stored !== null) {\n return stored === 'true'\n }\n\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n }\n\n const updateDOM = (dark: boolean) => {\n if (typeof document === 'undefined') return\n\n const element = document.querySelector(selector)\n if (!element) return\n\n if (attribute === 'class') {\n element.classList.toggle('dark', dark)\n } else {\n element.setAttribute(attribute, dark ? 'dark' : 'light')\n }\n }\n\n const toggle = () => {\n isDark.value = !isDark.value\n }\n\n const set = (value: boolean) => {\n isDark.value = value\n }\n\n watch(isDark, (newValue) => {\n updateDOM(newValue)\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem(storageKey, String(newValue))\n }\n })\n\n onMounted(() => {\n isDark.value = getInitialValue()\n updateDOM(isDark.value)\n })\n\n return {\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-
const {
|
|
5
|
-
selector = "html",
|
|
6
|
-
attribute = "class",
|
|
7
|
-
storageKey = "dark-mode",
|
|
8
|
-
defaultValue = false
|
|
9
|
-
} = options;
|
|
10
|
-
const isDark = vue.ref(defaultValue);
|
|
11
|
-
const getInitialValue = () => {
|
|
12
|
-
if (typeof window === "undefined") return defaultValue;
|
|
13
|
-
const stored = localStorage.getItem(storageKey);
|
|
14
|
-
if (stored !== null) {
|
|
15
|
-
return stored === "true";
|
|
16
|
-
}
|
|
17
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
18
|
-
};
|
|
19
|
-
const updateDOM = (dark) => {
|
|
20
|
-
if (typeof document === "undefined") return;
|
|
21
|
-
const element = document.querySelector(selector);
|
|
22
|
-
if (!element) return;
|
|
23
|
-
if (attribute === "class") {
|
|
24
|
-
element.classList.toggle("dark", dark);
|
|
25
|
-
} else {
|
|
26
|
-
element.setAttribute(attribute, dark ? "dark" : "light");
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const toggle = () => {
|
|
30
|
-
isDark.value = !isDark.value;
|
|
31
|
-
};
|
|
32
|
-
const set = (value) => {
|
|
33
|
-
isDark.value = value;
|
|
34
|
-
};
|
|
35
|
-
vue.watch(isDark, (newValue) => {
|
|
36
|
-
updateDOM(newValue);
|
|
37
|
-
if (typeof localStorage !== "undefined") {
|
|
38
|
-
localStorage.setItem(storageKey, String(newValue));
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
vue.onMounted(() => {
|
|
42
|
-
isDark.value = getInitialValue();
|
|
43
|
-
updateDOM(isDark.value);
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
isDark,
|
|
47
|
-
toggle,
|
|
48
|
-
set
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
exports.useDarkMode = useDarkMode;
|
|
52
|
-
//# sourceMappingURL=useDarkMode-DLZcJEUQ.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDarkMode-DLZcJEUQ.cjs","sources":["../src/composables/useDarkMode.ts"],"sourcesContent":["import { ref, watch, onMounted } from 'vue'\n\nexport interface DarkModeOptions {\n selector?: string\n attribute?: string\n storageKey?: string\n defaultValue?: boolean\n}\n\n/**\n * Composable for managing dark mode state\n */\nexport function useDarkMode(options: DarkModeOptions = {}) {\n const {\n selector = 'html',\n attribute = 'class',\n storageKey = 'dark-mode',\n defaultValue = false,\n } = options\n\n const isDark = ref(defaultValue)\n\n const getInitialValue = (): boolean => {\n if (typeof window === 'undefined') return defaultValue\n\n const stored = localStorage.getItem(storageKey)\n if (stored !== null) {\n return stored === 'true'\n }\n\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n }\n\n const updateDOM = (dark: boolean) => {\n if (typeof document === 'undefined') return\n\n const element = document.querySelector(selector)\n if (!element) return\n\n if (attribute === 'class') {\n element.classList.toggle('dark', dark)\n } else {\n element.setAttribute(attribute, dark ? 'dark' : 'light')\n }\n }\n\n const toggle = () => {\n isDark.value = !isDark.value\n }\n\n const set = (value: boolean) => {\n isDark.value = value\n }\n\n watch(isDark, (newValue) => {\n updateDOM(newValue)\n if (typeof localStorage !== 'undefined') {\n localStorage.setItem(storageKey, String(newValue))\n }\n })\n\n onMounted(() => {\n isDark.value = getInitialValue()\n updateDOM(isDark.value)\n })\n\n return {\n isDark,\n toggle,\n set,\n }\n}\n"],"names":["ref","watch","onMounted"],"mappings":";;AAYO,SAAS,YAAY,UAA2B,IAAI;AACzD,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,eAAe;AAAA,EAAA,IACb;AAEJ,QAAM,SAASA,IAAAA,IAAI,YAAY;AAE/B,QAAM,kBAAkB,MAAe;AACrC,QAAI,OAAO,WAAW,YAAa,QAAO;AAE1C,UAAM,SAAS,aAAa,QAAQ,UAAU;AAC9C,QAAI,WAAW,MAAM;AACnB,aAAO,WAAW;AAAA,IACpB;AAEA,WAAO,OAAO,WAAW,8BAA8B,EAAE;AAAA,EAC3D;AAEA,QAAM,YAAY,CAAC,SAAkB;AACnC,QAAI,OAAO,aAAa,YAAa;AAErC,UAAM,UAAU,SAAS,cAAc,QAAQ;AAC/C,QAAI,CAAC,QAAS;AAEd,QAAI,cAAc,SAAS;AACzB,cAAQ,UAAU,OAAO,QAAQ,IAAI;AAAA,IACvC,OAAO;AACL,cAAQ,aAAa,WAAW,OAAO,SAAS,OAAO;AAAA,IACzD;AAAA,EACF;AAEA,QAAM,SAAS,MAAM;AACnB,WAAO,QAAQ,CAAC,OAAO;AAAA,EACzB;AAEA,QAAM,MAAM,CAAC,UAAmB;AAC9B,WAAO,QAAQ;AAAA,EACjB;AAEAC,YAAM,QAAQ,CAAC,aAAa;AAC1B,cAAU,QAAQ;AAClB,QAAI,OAAO,iBAAiB,aAAa;AACvC,mBAAa,QAAQ,YAAY,OAAO,QAAQ,CAAC;AAAA,IACnD;AAAA,EACF,CAAC;AAEDC,MAAAA,UAAU,MAAM;AACd,WAAO,QAAQ,gBAAA;AACf,cAAU,OAAO,KAAK;AAAA,EACxB,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;;"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const vue = require("vue");
|
|
3
|
-
var IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
4
|
-
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
|
|
5
|
-
function uid(len) {
|
|
6
|
-
var i = 0, tmp = 11;
|
|
7
|
-
if (!BUFFER || IDX + tmp > SIZE * 2) {
|
|
8
|
-
for (BUFFER = "", IDX = 0; i < SIZE; i++) {
|
|
9
|
-
BUFFER += HEX[Math.random() * 256 | 0];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return BUFFER.substring(IDX, IDX++ + tmp);
|
|
13
|
-
}
|
|
14
|
-
const notifications = vue.ref([]);
|
|
15
|
-
function useNotifications() {
|
|
16
|
-
const notify = (type, message, options = {}) => {
|
|
17
|
-
const id = uid();
|
|
18
|
-
const notification = {
|
|
19
|
-
id,
|
|
20
|
-
type,
|
|
21
|
-
message,
|
|
22
|
-
title: options.title ?? null,
|
|
23
|
-
duration: options.duration ?? 5e3
|
|
24
|
-
};
|
|
25
|
-
notifications.value.push(notification);
|
|
26
|
-
if (notification.duration && notification.duration > 0) {
|
|
27
|
-
setTimeout(() => remove(id), notification.duration);
|
|
28
|
-
}
|
|
29
|
-
return id;
|
|
30
|
-
};
|
|
31
|
-
const success = (message, options) => notify("success", message, options);
|
|
32
|
-
const warning = (message, options) => notify("warning", message, options);
|
|
33
|
-
const error = (message, options) => notify("error", message, options);
|
|
34
|
-
const info = (message, options) => notify("info", message, options);
|
|
35
|
-
const remove = (id) => {
|
|
36
|
-
notifications.value = notifications.value.filter((n) => n.id !== id);
|
|
37
|
-
};
|
|
38
|
-
const clear = () => {
|
|
39
|
-
notifications.value = [];
|
|
40
|
-
};
|
|
41
|
-
return {
|
|
42
|
-
notifications: vue.readonly(notifications),
|
|
43
|
-
notify,
|
|
44
|
-
success,
|
|
45
|
-
warning,
|
|
46
|
-
error,
|
|
47
|
-
info,
|
|
48
|
-
remove,
|
|
49
|
-
clear
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function useExportCSV() {
|
|
53
|
-
const escapeCSV = (value) => {
|
|
54
|
-
if (value === null || value === void 0) return "";
|
|
55
|
-
const str = String(value);
|
|
56
|
-
if (str.includes(",") || str.includes('"') || str.includes("\n")) {
|
|
57
|
-
return `"${str.replace(/"/g, '""')}"`;
|
|
58
|
-
}
|
|
59
|
-
return str;
|
|
60
|
-
};
|
|
61
|
-
const exportToCSV = (data, columns, filename = "export.csv") => {
|
|
62
|
-
if (!data || data.length === 0) {
|
|
63
|
-
console.warn("No data to export");
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const headers = columns.map((col) => escapeCSV(col.label)).join(",");
|
|
67
|
-
const rows = data.map(
|
|
68
|
-
(item) => columns.map((col) => escapeCSV(item[col.key])).join(",")
|
|
69
|
-
);
|
|
70
|
-
const csv = [headers, ...rows].join("\n");
|
|
71
|
-
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
|
72
|
-
const url = URL.createObjectURL(blob);
|
|
73
|
-
const link = document.createElement("a");
|
|
74
|
-
link.setAttribute("href", url);
|
|
75
|
-
link.setAttribute("download", filename);
|
|
76
|
-
link.style.visibility = "hidden";
|
|
77
|
-
document.body.appendChild(link);
|
|
78
|
-
link.click();
|
|
79
|
-
document.body.removeChild(link);
|
|
80
|
-
URL.revokeObjectURL(url);
|
|
81
|
-
};
|
|
82
|
-
return {
|
|
83
|
-
exportToCSV,
|
|
84
|
-
escapeCSV
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function useModal(options) {
|
|
88
|
-
const {
|
|
89
|
-
initialOpen = false,
|
|
90
|
-
initialData = null,
|
|
91
|
-
onOpen,
|
|
92
|
-
onClose
|
|
93
|
-
} = options ?? {};
|
|
94
|
-
const isOpen = vue.ref(initialOpen);
|
|
95
|
-
const data = vue.ref(initialData);
|
|
96
|
-
const open = (newData) => {
|
|
97
|
-
data.value = newData ?? null;
|
|
98
|
-
isOpen.value = true;
|
|
99
|
-
onOpen == null ? void 0 : onOpen(data.value);
|
|
100
|
-
};
|
|
101
|
-
const close = () => {
|
|
102
|
-
isOpen.value = false;
|
|
103
|
-
data.value = null;
|
|
104
|
-
onClose == null ? void 0 : onClose();
|
|
105
|
-
};
|
|
106
|
-
const toggle = () => {
|
|
107
|
-
if (isOpen.value) {
|
|
108
|
-
close();
|
|
109
|
-
} else {
|
|
110
|
-
open();
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
return {
|
|
114
|
-
isOpen,
|
|
115
|
-
data,
|
|
116
|
-
open,
|
|
117
|
-
close,
|
|
118
|
-
toggle
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function useModals(modals) {
|
|
122
|
-
return modals;
|
|
123
|
-
}
|
|
124
|
-
const toasts = vue.ref([]);
|
|
125
|
-
let toastId = 0;
|
|
126
|
-
function useToast() {
|
|
127
|
-
const add = (options) => {
|
|
128
|
-
const id = `toast-${++toastId}`;
|
|
129
|
-
const toast = {
|
|
130
|
-
id,
|
|
131
|
-
message: options.message,
|
|
132
|
-
type: options.type || "info",
|
|
133
|
-
title: options.title,
|
|
134
|
-
duration: options.duration ?? 5e3
|
|
135
|
-
};
|
|
136
|
-
toasts.value.push(toast);
|
|
137
|
-
return id;
|
|
138
|
-
};
|
|
139
|
-
const remove = (id) => {
|
|
140
|
-
const index = toasts.value.findIndex((t) => t.id === id);
|
|
141
|
-
if (index > -1) {
|
|
142
|
-
toasts.value.splice(index, 1);
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
const clear = () => {
|
|
146
|
-
toasts.value = [];
|
|
147
|
-
};
|
|
148
|
-
const success = (message, title) => {
|
|
149
|
-
return add({ message, title, type: "success" });
|
|
150
|
-
};
|
|
151
|
-
const error = (message, title) => {
|
|
152
|
-
return add({ message, title, type: "error" });
|
|
153
|
-
};
|
|
154
|
-
const warning = (message, title) => {
|
|
155
|
-
return add({ message, title, type: "warning" });
|
|
156
|
-
};
|
|
157
|
-
const info = (message, title) => {
|
|
158
|
-
return add({ message, title, type: "info" });
|
|
159
|
-
};
|
|
160
|
-
return {
|
|
161
|
-
toasts,
|
|
162
|
-
add,
|
|
163
|
-
remove,
|
|
164
|
-
clear,
|
|
165
|
-
success,
|
|
166
|
-
error,
|
|
167
|
-
warning,
|
|
168
|
-
info
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
exports.useExportCSV = useExportCSV;
|
|
172
|
-
exports.useModal = useModal;
|
|
173
|
-
exports.useModals = useModals;
|
|
174
|
-
exports.useNotifications = useNotifications;
|
|
175
|
-
exports.useToast = useToast;
|
|
176
|
-
//# sourceMappingURL=useToast-Bk60GArg.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToast-Bk60GArg.cjs","sources":["../node_modules/uid/dist/index.mjs","../src/composables/useNotifications.ts","../src/composables/useExportCSV.ts","../src/composables/useModal.ts","../src/composables/useToast.ts"],"sourcesContent":["var IDX=256, HEX=[], SIZE=256, BUFFER;\nwhile (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);\n\nexport function uid(len) {\n\tvar i=0, tmp=(len || 11);\n\tif (!BUFFER || ((IDX + tmp) > SIZE*2)) {\n\t\tfor (BUFFER='',IDX=0; i < SIZE; i++) {\n\t\t\tBUFFER += HEX[Math.random() * 256 | 0];\n\t\t}\n\t}\n\n\treturn BUFFER.substring(IDX, IDX++ + tmp);\n}\n","import { ref, readonly } from 'vue'\r\nimport { uid } from 'uid'\r\nimport type { Notification, NotificationType, NotificationOptions } from '@/types'\r\n\r\n// Global state (singleton pattern) - shared across all useNotifications() calls\r\nconst notifications = ref<Notification[]>([])\r\n\r\n/**\r\n * Composable for managing notifications/toasts\r\n * Uses singleton pattern - all components share the same notifications state\r\n */\r\nexport function useNotifications() {\r\n\r\n const notify = (\r\n type: NotificationType,\r\n message: string,\r\n options: NotificationOptions = {},\r\n ): string => {\r\n const id = uid()\r\n const notification: Notification = {\r\n id,\r\n type,\r\n message,\r\n title: options.title ?? null,\r\n duration: options.duration ?? 5000,\r\n }\r\n\r\n notifications.value.push(notification)\r\n\r\n if (notification.duration && notification.duration > 0) {\r\n setTimeout(() => remove(id), notification.duration)\r\n }\r\n\r\n return id\r\n }\r\n\r\n const success = (message: string, options?: NotificationOptions) =>\r\n notify('success', message, options)\r\n\r\n const warning = (message: string, options?: NotificationOptions) =>\r\n notify('warning', message, options)\r\n\r\n const error = (message: string, options?: NotificationOptions) =>\r\n notify('error', message, options)\r\n\r\n const info = (message: string, options?: NotificationOptions) =>\r\n notify('info', message, options)\r\n\r\n const remove = (id: string) => {\r\n notifications.value = notifications.value.filter((n) => n.id !== id)\r\n }\r\n\r\n const clear = () => {\r\n notifications.value = []\r\n }\r\n\r\n return {\r\n notifications: readonly(notifications),\r\n notify,\r\n success,\r\n warning,\r\n error,\r\n info,\r\n remove,\r\n clear,\r\n }\r\n}\r\n","/**\n * Composable for exporting data to CSV format\n */\nexport function useExportCSV() {\n const escapeCSV = (value: unknown): string => {\n if (value === null || value === undefined) return ''\n const str = String(value)\n if (str.includes(',') || str.includes('\"') || str.includes('\\n')) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`\n }\n return str\n }\n\n const exportToCSV = <T extends Record<string, unknown>>(\n data: T[],\n columns: { key: keyof T; label: string }[],\n filename: string = 'export.csv',\n ) => {\n if (!data || data.length === 0) {\n console.warn('No data to export')\n return\n }\n\n // Create header row\n const headers = columns.map((col) => escapeCSV(col.label)).join(',')\n\n // Create data rows\n const rows = data.map((item) =>\n columns.map((col) => escapeCSV(item[col.key])).join(','),\n )\n\n // Combine header and rows\n const csv = [headers, ...rows].join('\\n')\n\n // Create and trigger download\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\n const url = URL.createObjectURL(blob)\n const link = document.createElement('a')\n link.setAttribute('href', url)\n link.setAttribute('download', filename)\n link.style.visibility = 'hidden'\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n URL.revokeObjectURL(url)\n }\n\n return {\n exportToCSV,\n escapeCSV,\n }\n}\n","import { ref, type Ref } from 'vue'\r\n\r\nexport interface UseModalReturn<T = unknown> {\r\n /** Whether the modal is currently open */\r\n isOpen: Ref<boolean>\r\n /** Data associated with the modal (e.g., item being edited) */\r\n data: Ref<T | null>\r\n /** Open the modal, optionally with data */\r\n open: (newData?: T) => void\r\n /** Close the modal and clear data */\r\n close: () => void\r\n /** Toggle the modal state */\r\n toggle: () => void\r\n}\r\n\r\n/**\r\n * Composable for managing modal state\r\n *\r\n * @example\r\n * ```ts\r\n * // Simple modal\r\n * const createModal = useModal()\r\n * createModal.open()\r\n * createModal.close()\r\n *\r\n * // Modal with data (e.g., for editing)\r\n * const editModal = useModal<User>()\r\n * editModal.open(selectedUser)\r\n * // Access editModal.data.value in modal\r\n *\r\n * // With onClose callback\r\n * const deleteModal = useModal<Item>({ onClose: () => refetch() })\r\n * ```\r\n */\r\nexport function useModal<T = unknown>(options?: {\r\n /** Initial open state */\r\n initialOpen?: boolean\r\n /** Initial data */\r\n initialData?: T | null\r\n /** Callback when modal opens */\r\n onOpen?: (data: T | null) => void\r\n /** Callback when modal closes */\r\n onClose?: () => void\r\n}): UseModalReturn<T> {\r\n const {\r\n initialOpen = false,\r\n initialData = null,\r\n onOpen,\r\n onClose,\r\n } = options ?? {}\r\n\r\n const isOpen = ref(initialOpen)\r\n const data = ref<T | null>(initialData) as Ref<T | null>\r\n\r\n const open = (newData?: T) => {\r\n data.value = newData ?? null\r\n isOpen.value = true\r\n onOpen?.(data.value)\r\n }\r\n\r\n const close = () => {\r\n isOpen.value = false\r\n data.value = null\r\n onClose?.()\r\n }\r\n\r\n const toggle = () => {\r\n if (isOpen.value) {\r\n close()\r\n } else {\r\n open()\r\n }\r\n }\r\n\r\n return {\r\n isOpen,\r\n data,\r\n open,\r\n close,\r\n toggle,\r\n }\r\n}\r\n\r\n/**\r\n * Create multiple related modals at once\r\n * Useful when a page has several modals (create, edit, delete, etc.)\r\n *\r\n * @example\r\n * ```ts\r\n * const modals = useModals({\r\n * create: useModal(),\r\n * edit: useModal<User>(),\r\n * delete: useModal<User>(),\r\n * })\r\n *\r\n * modals.create.open()\r\n * modals.edit.open(user)\r\n * modals.delete.close()\r\n * ```\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport function useModals<T extends Record<string, UseModalReturn<any>>>(\r\n modals: T\r\n): T {\r\n return modals\r\n}\r\n","import { ref } from 'vue'\r\nimport type { ToastType } from '@/components/feedback/Toast.vue'\r\nimport type { ToastItem } from '@/components/feedback/ToastContainer.vue'\r\n\r\nexport interface ToastOptions {\r\n message: string\r\n type?: ToastType\r\n title?: string\r\n duration?: number\r\n}\r\n\r\nconst toasts = ref<ToastItem[]>([])\r\n\r\nlet toastId = 0\r\n\r\nexport function useToast() {\r\n const add = (options: ToastOptions): string => {\r\n const id = `toast-${++toastId}`\r\n const toast: ToastItem = {\r\n id,\r\n message: options.message,\r\n type: options.type || 'info',\r\n title: options.title,\r\n duration: options.duration ?? 5000,\r\n }\r\n toasts.value.push(toast)\r\n return id\r\n }\r\n\r\n const remove = (id: string) => {\r\n const index = toasts.value.findIndex((t) => t.id === id)\r\n if (index > -1) {\r\n toasts.value.splice(index, 1)\r\n }\r\n }\r\n\r\n const clear = () => {\r\n toasts.value = []\r\n }\r\n\r\n const success = (message: string, title?: string) => {\r\n return add({ message, title, type: 'success' })\r\n }\r\n\r\n const error = (message: string, title?: string) => {\r\n return add({ message, title, type: 'error' })\r\n }\r\n\r\n const warning = (message: string, title?: string) => {\r\n return add({ message, title, type: 'warning' })\r\n }\r\n\r\n const info = (message: string, title?: string) => {\r\n return add({ message, title, type: 'info' })\r\n }\r\n\r\n return {\r\n toasts,\r\n add,\r\n remove,\r\n clear,\r\n success,\r\n error,\r\n warning,\r\n info,\r\n }\r\n}\r\n"],"names":["ref","readonly"],"mappings":";;AAAA,IAAI,MAAI,KAAK,MAAI,CAAA,GAAI,OAAK,KAAK;AAC/B,OAAO,MAAO,KAAI,GAAG,KAAK,MAAM,KAAK,SAAS,EAAE,EAAE,UAAU,CAAC;AAEtD,SAAS,IAAI,KAAK;AACxB,MAAI,IAAE,GAAG,MAAY;AACrB,MAAI,CAAC,UAAY,MAAM,MAAO,OAAK,GAAI;AACtC,SAAK,SAAO,IAAG,MAAI,GAAG,IAAI,MAAM,KAAK;AACpC,gBAAU,IAAI,KAAK,OAAM,IAAK,MAAM,CAAC;AAAA,IACtC;AAAA,EACD;AAEA,SAAO,OAAO,UAAU,KAAK,QAAQ,GAAG;AACzC;ACPA,MAAM,gBAAgBA,IAAAA,IAAoB,EAAE;AAMrC,SAAS,mBAAmB;AAEjC,QAAM,SAAS,CACb,MACA,SACA,UAA+B,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