vui-toolkit 0.0.1

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.
@@ -0,0 +1,10 @@
1
+ type __VLS_Props = {
2
+ tasks: any[];
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ toggleDone: (id: string) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
7
+ onToggleDone?: ((id: string) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import type { VuiBannerType } from '../components/VuiBanner.vue';
2
+ export interface VuiBannerItem {
3
+ id: number;
4
+ type?: VuiBannerType;
5
+ message: string;
6
+ dismissible?: boolean;
7
+ }
8
+ export declare function useVuiBanner(): {
9
+ banners: import("vue").Ref<{
10
+ id: number;
11
+ type?: VuiBannerType | undefined;
12
+ message: string;
13
+ dismissible?: boolean | undefined;
14
+ }[], VuiBannerItem[] | {
15
+ id: number;
16
+ type?: VuiBannerType | undefined;
17
+ message: string;
18
+ dismissible?: boolean | undefined;
19
+ }[]>;
20
+ addBanner: (options: Omit<VuiBannerItem, "id">) => void;
21
+ removeBanner: (id: number) => void;
22
+ };
@@ -0,0 +1,9 @@
1
+ export { default as VuiAccordion } from './components/VuiAccordion.vue';
2
+ export { default as VuiProgressBar } from './components/VuiProgressBar.vue';
3
+ export { default as VuiStatusMeter } from './components/VuiStatusMeter.vue';
4
+ import VuiBadge from './components/VuiBadge.vue';
5
+ export { VuiBadge };
6
+ declare const _default: {
7
+ install(app: any): void;
8
+ };
9
+ export default _default;
package/dist/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ import './style.css';
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,270 @@
1
+
2
+ .vui-accordion[data-v-b0532c49] {
3
+ border-radius: 6px;
4
+ }
5
+
6
+ .vui-progressbar[data-v-551d3aec] {
7
+ background: var(--vui-progress-bg);
8
+ border-radius: 6px;
9
+ overflow: hidden;
10
+ position: relative;
11
+ }
12
+
13
+ /* Sizes */
14
+ .vui-progressbar--size-sm[data-v-551d3aec] {
15
+ height: var(--vui-progress-height-sm);
16
+ }
17
+ .vui-progressbar--size-md[data-v-551d3aec] {
18
+ height: var(--vui-progress-height-md);
19
+ }
20
+ .vui-progressbar--size-lg[data-v-551d3aec] {
21
+ height: var(--vui-progress-height-lg);
22
+ }
23
+
24
+ /* Fill */
25
+ .vui-progressbar-fill[data-v-551d3aec] {
26
+ height: 100%;
27
+ background: currentColor;
28
+ transition: width var(--vui-progress-transition);
29
+ }
30
+
31
+ /* Variants (color via currentColor) */
32
+ .vui-progressbar--primary[data-v-551d3aec] {
33
+ color: var(--vui-progress-primary);
34
+ }
35
+ .vui-progressbar--success[data-v-551d3aec] {
36
+ color: var(--vui-progress-success);
37
+ }
38
+ .vui-progressbar--warning[data-v-551d3aec] {
39
+ color: var(--vui-progress-warning);
40
+ }
41
+ .vui-progressbar--error[data-v-551d3aec] {
42
+ color: var(--vui-progress-error);
43
+ }
44
+
45
+ /* Striped Background */
46
+ .vui-progressbar--striped .vui-progressbar-fill[data-v-551d3aec] {
47
+ background-image: linear-gradient(
48
+ 45deg,
49
+ rgba(255, 255, 255, 0.15) 25%,
50
+ transparent 25%,
51
+ transparent 50%,
52
+ rgba(255, 255, 255, 0.15) 50%,
53
+ rgba(255, 255, 255, 0.15) 75%,
54
+ transparent 75%,
55
+ transparent
56
+ );
57
+ background-size: 1rem 1rem;
58
+ }
59
+
60
+ /* Animated Stripes */
61
+ .vui-progressbar--animated .vui-progressbar-fill[data-v-551d3aec] {
62
+ animation: vui-progress-stripes-551d3aec 1s linear infinite;
63
+ }
64
+ @keyframes vui-progress-stripes-551d3aec {
65
+ 0% {
66
+ background-position: 1rem 0;
67
+ }
68
+ 100% {
69
+ background-position: 0 0;
70
+ }
71
+ }
72
+
73
+ /* Indeterminate */
74
+ .vui-progressbar--indeterminate[data-v-551d3aec] {
75
+ overflow: hidden;
76
+ }
77
+ .vui-progressbar--indeterminate .vui-progressbar-fill[data-v-551d3aec] {
78
+ width: 50%;
79
+ position: absolute;
80
+ animation: vui-progress-indeterminate-551d3aec 2s infinite ease;
81
+ }
82
+ @keyframes vui-progress-indeterminate-551d3aec {
83
+ 0% {
84
+ left: -50%;
85
+ }
86
+ 50% {
87
+ left: 25%;
88
+ }
89
+ 100% {
90
+ left: 100%;
91
+ }
92
+ }
93
+
94
+ :root {
95
+ --vui-meter-bg: #e5e7eb;
96
+ --vui-meter-primary: #2e7d8f;
97
+ --vui-meter-success: #4caf50;
98
+ --vui-meter-warning: #ff9800;
99
+ --vui-meter-error: #f44336;
100
+ --vui-meter-transition: 0.6s ease;
101
+ }
102
+ .vui-meter {
103
+ display: inline-flex;
104
+ align-items: center;
105
+ justify-content: center;
106
+ }
107
+
108
+ /* BAR BASE */
109
+ .vui-meter-bar-bg {
110
+ background: var(--vui-meter-bg);
111
+ width: 100%;
112
+ height: var(--vui-meter-thickness, 8px);
113
+ border-radius: 4px;
114
+ overflow: hidden;
115
+ }
116
+ .vui-meter-bar-bg.vertical {
117
+ width: var(--vui-meter-thickness, 8px);
118
+ height: 100px;
119
+ display: flex;
120
+ flex-direction: column-reverse;
121
+ }
122
+ .vui-meter-bar-fg {
123
+ background: currentColor;
124
+ height: 100%;
125
+ transition: width var(--vui-meter-transition),
126
+ height var(--vui-meter-transition);
127
+ }
128
+
129
+ /* CIRCLE BASE */
130
+ .vui-meter-svg {
131
+ width: 100px;
132
+ height: 100px;
133
+ }
134
+ .vui-meter-bg-circle {
135
+ fill: none;
136
+ stroke: var(--vui-meter-bg);
137
+ stroke-width: var(--vui-meter-thickness, 8);
138
+ }
139
+ .vui-meter-fg-circle {
140
+ fill: none;
141
+ stroke: currentColor;
142
+ stroke-width: var(--vui-meter-thickness, 8);
143
+ transform: rotate(-90deg);
144
+ transform-origin: center;
145
+ transition: stroke-dashoffset var(--vui-meter-transition);
146
+ }
147
+
148
+ /* COLORS */
149
+ .vui-meter--primary {
150
+ color: var(--vui-meter-primary);
151
+ }
152
+ .vui-meter--success {
153
+ color: var(--vui-meter-success);
154
+ }
155
+ .vui-meter--warning {
156
+ color: var(--vui-meter-warning);
157
+ }
158
+ .vui-meter--error {
159
+ color: var(--vui-meter-error);
160
+ }
161
+
162
+ /* SIZES */
163
+ .vui-meter--size-sm .vui-meter-svg {
164
+ width: 60px;
165
+ height: 60px;
166
+ }
167
+ .vui-meter--size-md .vui-meter-svg {
168
+ width: 100px;
169
+ height: 100px;
170
+ }
171
+ .vui-meter--size-lg .vui-meter-svg {
172
+ width: 140px;
173
+ height: 140px;
174
+ }
175
+
176
+
177
+ :root {
178
+ /* Info */
179
+ --vui-info-bg: #1e66f5;
180
+ --vui-info-text: #ffffff;
181
+
182
+ /* Success */
183
+ --vui-success-bg: #4caf50;
184
+ --vui-success-text: #ffffff;
185
+
186
+ /* Warning */
187
+ --vui-warning-bg: #ff9800;
188
+ --vui-warning-text: #ffffff;
189
+
190
+ /* Error */
191
+ --vui-error-bg: #f44336;
192
+ --vui-error-text: #ffffff;
193
+
194
+ /* Neutral */
195
+ --vui-neutral-bg: #9e9e9e;
196
+ --vui-neutral-text: #ffffff;
197
+
198
+ /* Soft variant */
199
+ --vui-soft-bg: rgba(0, 0, 0, 0.05);
200
+ }
201
+ .vui-badge {
202
+ --vui-badge-radius: 999px;
203
+ --vui-badge-font-size: 13px;
204
+ --vui-badge-padding-x: 12px;
205
+ --vui-badge-padding-y: 4px;
206
+
207
+ display: inline-flex;
208
+ align-items: center;
209
+ gap: 6px;
210
+ font-size: var(--vui-badge-font-size);
211
+ font-weight: 500;
212
+ padding: var(--vui-badge-padding-y) var(--vui-badge-padding-x);
213
+ border-radius: var(--vui-badge-radius);
214
+ border: 1px solid transparent;
215
+ transition: all 0.2s ease;
216
+ }
217
+
218
+ /* Rounded toggle */
219
+ .vui-badge--rounded {
220
+ border-radius: 999px;
221
+ }
222
+
223
+ /* Sizes */
224
+ .vui-badge--sm {
225
+ font-size: 12px;
226
+ padding: 2px 8px;
227
+ }
228
+ .vui-badge--lg {
229
+ font-size: 14px;
230
+ padding: 6px 14px;
231
+ }
232
+
233
+ /* SOLID */
234
+ .vui-badge--solid.vui-badge--info {
235
+ background: var(--vui-info-bg);
236
+ color: var(--vui-info-text);
237
+ }
238
+ .vui-badge--solid.vui-badge--success {
239
+ background: var(--vui-success-bg);
240
+ color: var(--vui-success-text);
241
+ }
242
+ .vui-badge--solid.vui-badge--warning {
243
+ background: var(--vui-warning-bg);
244
+ color: var(--vui-warning-text);
245
+ }
246
+ .vui-badge--solid.vui-badge--error {
247
+ background: var(--vui-error-bg);
248
+ color: var(--vui-error-text);
249
+ }
250
+ .vui-badge--solid.vui-badge--neutral {
251
+ background: var(--vui-neutral-bg);
252
+ color: var(--vui-neutral-text);
253
+ }
254
+
255
+ /* SOFT */
256
+ .vui-badge--soft {
257
+ background: var(--vui-soft-bg);
258
+ }
259
+
260
+ /* OUTLINE */
261
+ .vui-badge--outline {
262
+ background: transparent;
263
+ border-color: currentColor;
264
+ }
265
+
266
+ /* Icon */
267
+ .vui-badge__icon {
268
+ display: inline-flex;
269
+ align-items: center;
270
+ }
@@ -0,0 +1,277 @@
1
+ import { defineComponent, ref, computed, provide, openBlock, createElementBlock, renderSlot, normalizeClass, normalizeStyle, createElementVNode, createCommentVNode } from 'vue';
2
+
3
+ const _hoisted_1$3 = { class: "vui-accordion" };
4
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5
+ __name: "VuiAccordion",
6
+ props: {
7
+ modelValue: { default: void 0 },
8
+ multiple: { type: Boolean, default: false }
9
+ },
10
+ emits: ["update:modelValue"],
11
+ setup(__props, { emit: __emit }) {
12
+ const props = __props;
13
+ const emit = __emit;
14
+ const internalValue = ref(
15
+ props.multiple ? [] : null
16
+ );
17
+ const isControlled = computed(() => props.modelValue !== void 0);
18
+ const active = computed({
19
+ get() {
20
+ return isControlled.value ? props.modelValue : internalValue.value;
21
+ },
22
+ set(val) {
23
+ if (isControlled.value) {
24
+ emit("update:modelValue", val);
25
+ } else {
26
+ internalValue.value = val ?? null;
27
+ }
28
+ }
29
+ });
30
+ function toggleItem(id) {
31
+ if (props.multiple) {
32
+ const current = Array.isArray(active.value) ? [...active.value] : [];
33
+ const index = current.indexOf(id);
34
+ if (index > -1) {
35
+ current.splice(index, 1);
36
+ } else {
37
+ current.push(id);
38
+ }
39
+ active.value = current;
40
+ } else {
41
+ active.value = active.value === id ? null : id;
42
+ }
43
+ }
44
+ provide("vuiAccordion", {
45
+ active,
46
+ toggleItem,
47
+ multiple: props.multiple
48
+ });
49
+ return (_ctx, _cache) => {
50
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
51
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
52
+ ]);
53
+ };
54
+ }
55
+ });
56
+
57
+ const _export_sfc = (sfc, props) => {
58
+ const target = sfc.__vccOpts || sfc;
59
+ for (const [key, val] of props) {
60
+ target[key] = val;
61
+ }
62
+ return target;
63
+ };
64
+
65
+ const VuiAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-b0532c49"]]);
66
+
67
+ const _hoisted_1$2 = ["aria-valuenow"];
68
+ const _hoisted_2$2 = {
69
+ key: 1,
70
+ class: "vui-progressbar-fill"
71
+ };
72
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
73
+ __name: "VuiProgressBar",
74
+ props: {
75
+ modelValue: {
76
+ type: Number,
77
+ default: 0
78
+ },
79
+ indeterminate: Boolean,
80
+ variant: {
81
+ type: String,
82
+ default: "primary"
83
+ },
84
+ size: {
85
+ type: String,
86
+ default: "md"
87
+ },
88
+ striped: Boolean,
89
+ animated: Boolean
90
+ },
91
+ emits: ["update:modelValue"],
92
+ setup(__props, { emit: __emit }) {
93
+ const props = __props;
94
+ const normalizedValue = computed(() => {
95
+ return Math.min(Math.max(props.modelValue, 0), 100);
96
+ });
97
+ return (_ctx, _cache) => {
98
+ return openBlock(), createElementBlock("div", {
99
+ class: normalizeClass(["vui-progressbar", [
100
+ `vui-progressbar--size-${__props.size}`,
101
+ `vui-progressbar--${__props.variant}`,
102
+ { "vui-progressbar--indeterminate": __props.indeterminate },
103
+ { "vui-progressbar--striped": __props.striped },
104
+ { "vui-progressbar--animated": __props.animated }
105
+ ]]),
106
+ role: "progressbar",
107
+ "aria-valuenow": !__props.indeterminate ? __props.modelValue : void 0,
108
+ "aria-valuemin": "0",
109
+ "aria-valuemax": "100"
110
+ }, [
111
+ !__props.indeterminate ? (openBlock(), createElementBlock("div", {
112
+ key: 0,
113
+ class: "vui-progressbar-fill",
114
+ style: normalizeStyle({ width: normalizedValue.value + "%" })
115
+ }, null, 4)) : (openBlock(), createElementBlock("div", _hoisted_2$2))
116
+ ], 10, _hoisted_1$2);
117
+ };
118
+ }
119
+ });
120
+
121
+ const VuiProgressBar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-551d3aec"]]);
122
+
123
+ const _hoisted_1$1 = {
124
+ key: 0,
125
+ class: "vui-meter-bar-bg"
126
+ };
127
+ const _hoisted_2$1 = {
128
+ key: 1,
129
+ class: "vui-meter-bar-bg vertical"
130
+ };
131
+ const _hoisted_3 = ["viewBox"];
132
+ const _hoisted_4 = ["cy"];
133
+ const _hoisted_5 = ["cy"];
134
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
135
+ __name: "VuiStatusMeter",
136
+ props: {
137
+ modelValue: {
138
+ type: Number,
139
+ default: 0
140
+ },
141
+ variant: {
142
+ type: String,
143
+ default: "horizontal"
144
+ },
145
+ color: {
146
+ type: String,
147
+ default: "primary"
148
+ },
149
+ size: {
150
+ type: String,
151
+ default: "md"
152
+ },
153
+ thickness: {
154
+ type: Number,
155
+ default: 8
156
+ },
157
+ max: {
158
+ type: Number,
159
+ default: 100
160
+ }
161
+ },
162
+ emits: ["update:modelValue"],
163
+ setup(__props, { emit: __emit }) {
164
+ const props = __props;
165
+ const normalizedValue = computed(() => {
166
+ const v = Math.min(props.modelValue, props.max);
167
+ return v / props.max * 100;
168
+ });
169
+ const colorClass = computed(() => `vui-meter--${props.color}`);
170
+ const variantClass = computed(() => `vui-meter--${props.variant}`);
171
+ const circumference = 2 * Math.PI * 45;
172
+ const offset = computed(() => {
173
+ if (props.variant === "semi") {
174
+ const semiCirc = Math.PI * 45;
175
+ return semiCirc * (1 - normalizedValue.value / 100);
176
+ }
177
+ return circumference * (1 - normalizedValue.value / 100);
178
+ });
179
+ return (_ctx, _cache) => {
180
+ return openBlock(), createElementBlock("div", {
181
+ class: normalizeClass(["vui-meter", [variantClass.value, colorClass.value, `vui-meter--size-${__props.size}`]])
182
+ }, [
183
+ props.variant === "horizontal" ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
184
+ createElementVNode("div", {
185
+ class: "vui-meter-bar-fg",
186
+ style: normalizeStyle({ width: normalizedValue.value + "%" })
187
+ }, null, 4)
188
+ ])) : createCommentVNode("", true),
189
+ props.variant === "vertical" ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
190
+ createElementVNode("div", {
191
+ class: "vui-meter-bar-fg",
192
+ style: normalizeStyle({ height: normalizedValue.value + "%" })
193
+ }, null, 4)
194
+ ])) : createCommentVNode("", true),
195
+ props.variant === "circular" || props.variant === "semi" ? (openBlock(), createElementBlock("svg", {
196
+ key: 2,
197
+ class: "vui-meter-svg",
198
+ viewBox: props.variant === "circular" ? "0 0 100 100" : "0 0 100 50"
199
+ }, [
200
+ createElementVNode("circle", {
201
+ class: "vui-meter-bg-circle",
202
+ cx: "50",
203
+ cy: props.variant === "circular" ? 50 : 50,
204
+ r: "45"
205
+ }, null, 8, _hoisted_4),
206
+ createElementVNode("circle", {
207
+ class: normalizeClass(["vui-meter-fg-circle", variantClass.value]),
208
+ cx: "50",
209
+ cy: props.variant === "circular" ? 50 : 50,
210
+ r: "45",
211
+ style: normalizeStyle({
212
+ strokeDasharray: circumference,
213
+ strokeDashoffset: offset.value
214
+ })
215
+ }, null, 14, _hoisted_5)
216
+ ], 8, _hoisted_3)) : createCommentVNode("", true)
217
+ ], 2);
218
+ };
219
+ }
220
+ });
221
+
222
+ const _hoisted_1 = {
223
+ key: 0,
224
+ class: "vui-badge__icon"
225
+ };
226
+ const _hoisted_2 = { class: "vui-badge__label" };
227
+ const _sfc_main = /* @__PURE__ */ defineComponent({
228
+ __name: "VuiBadge",
229
+ props: {
230
+ type: {
231
+ type: String,
232
+ default: "info"
233
+ },
234
+ variant: {
235
+ type: String,
236
+ default: "solid"
237
+ },
238
+ size: {
239
+ type: String,
240
+ default: "md"
241
+ },
242
+ rounded: {
243
+ type: Boolean,
244
+ default: true
245
+ }
246
+ },
247
+ setup(__props) {
248
+ const props = __props;
249
+ const classes = computed(() => [
250
+ "vui-badge",
251
+ `vui-badge--${props.type}`,
252
+ `vui-badge--${props.variant}`,
253
+ `vui-badge--${props.size}`,
254
+ { "vui-badge--rounded": props.rounded }
255
+ ]);
256
+ return (_ctx, _cache) => {
257
+ return openBlock(), createElementBlock("span", {
258
+ class: normalizeClass(classes.value)
259
+ }, [
260
+ _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_1, [
261
+ renderSlot(_ctx.$slots, "icon")
262
+ ])) : createCommentVNode("", true),
263
+ createElementVNode("span", _hoisted_2, [
264
+ renderSlot(_ctx.$slots, "default")
265
+ ])
266
+ ], 2);
267
+ };
268
+ }
269
+ });
270
+
271
+ const index = {
272
+ install(app) {
273
+ app.component("VuiBadge", _sfc_main);
274
+ }
275
+ };
276
+
277
+ export { VuiAccordion, _sfc_main as VuiBadge, VuiProgressBar, _sfc_main$1 as VuiStatusMeter, index as default };