vlite3 0.9.12 → 1.0.2

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 CHANGED
@@ -224,84 +224,73 @@ Override these variables in `:root` or within a `.dark` class (when using class-
224
224
 
225
225
  ### Extended Color Variants
226
226
 
227
- For more complex components, vlite3 provides extended variants for main semantic colors (`primary`, `danger`, `warning`, `info`, `success`). These are useful for building nuanced UIs with subtle backgrounds, hover states, and accessible text.
227
+ For more complex components, **vlite3** provides extended variants for main semantic colors (`primary`, `danger`, `warning`, `info`, `success`). These help create nuanced UIs with subtle backgrounds, hover states, and accessible text.
228
228
 
229
- | Base Color | Variant Variables | Usage Description |
230
- | ----------- | --------------------------- | ----------------- |
231
- | **Primary** | `--color-primary-light`<br> |
232
-
233
- <br>`--color-primary-dark`<br>
234
-
235
- <br>`--color-primary-fg`<br>
236
-
237
- <br>`--color-primary-fg-light` | **Light**: Subtle background (e.g., 10% opacity).<br>
238
-
239
- <br>**Dark**: Hover state for the main color.<br>
240
-
241
- <br>**Fg**: Text color on top of the _main_ color.<br>
242
-
243
- <br>**Fg-Light**: Text color on top of the _light_ variant. |
244
- | **Danger** | `--color-danger-light`<br>
245
-
246
- <br>`--color-danger-dark`<br>
247
-
248
- <br>`--color-danger-fg`<br>
249
-
250
- <br>`--color-danger-fg-light` | **Light**: Error backgrounds (alerts).<br>
251
-
252
- <br>**Dark**: Hover state for destructive buttons.<br>
253
-
254
- <br>**Fg**: Text on destructive buttons.<br>
255
-
256
- <br>**Fg-Light**: Text on error alerts. |
257
- | **Warning** | `--color-warning-light`<br>
258
-
259
- <br>`--color-warning-dark`<br>
260
-
261
- <br>`--color-warning-fg`<br>
262
-
263
- <br>`--color-warning-fg-light` | **Light**: Warning backgrounds.<br>
229
+ ---
264
230
 
265
- <br>**Dark**: Active/Determined warning states.<br>
231
+ #### Primary
266
232
 
267
- <br>**Fg**: Text on warning badges.<br>
233
+ | Variable | Description |
234
+ | -------------------------- | -------------------------------------- |
235
+ | `--color-primary-light` | Subtle background (e.g., 10% opacity) |
236
+ | `--color-primary-dark` | Hover state for the main color |
237
+ | `--color-primary-fg` | Text color on top of the main color |
238
+ | `--color-primary-fg-light` | Text color on top of the light variant |
268
239
 
269
- <br>**Fg-Light**: Text on warning backgrounds. |
270
- | **Success** | `--color-success-light`<br>
240
+ ---
271
241
 
272
- <br>`--color-success-dark`<br>
242
+ #### Danger
273
243
 
274
- <br>`--color-success-fg`<br>
244
+ | Variable | Description |
245
+ | ------------------------- | ----------------------------------- |
246
+ | `--color-danger-light` | Error backgrounds (alerts) |
247
+ | `--color-danger-dark` | Hover state for destructive buttons |
248
+ | `--color-danger-fg` | Text on destructive buttons |
249
+ | `--color-danger-fg-light` | Text on error alerts |
275
250
 
276
- <br>`--color-success-fg-light` | **Light**: Success backgrounds (toasts).<br>
251
+ ---
277
252
 
278
- <br>**Dark**: Hover/Active success actions.<br>
253
+ #### Warning
279
254
 
280
- <br>**Fg**: Text on success buttons.<br>
255
+ | Variable | Description |
256
+ | -------------------------- | ----------------------------------- |
257
+ | `--color-warning-light` | Warning backgrounds |
258
+ | `--color-warning-dark` | Active or emphasized warning states |
259
+ | `--color-warning-fg` | Text on warning badges |
260
+ | `--color-warning-fg-light` | Text on warning backgrounds |
281
261
 
282
- <br>**Fg-Light**: Text on success backgrounds. |
283
- | **Info** | `--color-info-light`<br>
262
+ ---
284
263
 
285
- <br>`--color-info-dark`<br>
264
+ #### Success
286
265
 
287
- <br>`--color-info-fg`<br>
266
+ | Variable | Description |
267
+ | -------------------------- | ------------------------------- |
268
+ | `--color-success-light` | Success backgrounds (toasts) |
269
+ | `--color-success-dark` | Hover or active success actions |
270
+ | `--color-success-fg` | Text on success buttons |
271
+ | `--color-success-fg-light` | Text on success backgrounds |
288
272
 
289
- <br>`--color-info-fg-light` | **Light**: Info backgrounds.<br>
273
+ ---
290
274
 
291
- <br>**Dark**: Hover/Active info actions.<br>
275
+ #### Info
292
276
 
293
- <br>**Fg**: Text on info buttons.<br>
277
+ | Variable | Description |
278
+ | ----------------------- | ---------------------------- |
279
+ | `--color-info-light` | Info backgrounds |
280
+ | `--color-info-dark` | Hover or active info actions |
281
+ | `--color-info-fg` | Text on info buttons |
282
+ | `--color-info-fg-light` | Text on info backgrounds |
294
283
 
295
- <br>**Fg-Light**: Text on info backgrounds. |
284
+ ---
296
285
 
297
- **Example Usage:**
286
+ ### Example Usage
298
287
 
299
288
  ```html
300
289
  <div class="bg-success-light text-success-fg-light border border-success/20">
301
290
  Operation Completed
302
291
  </div>
303
292
 
304
- <button class="bg-danger text-danger-fg hover:bg-danger-dark">Delete</button>
293
+ <button class="bg-danger text-danger-fg hover:bg-dang
305
294
  ```
306
295
 
307
296
  ### Additional Colors
@@ -404,16 +393,19 @@ Follow these rules strictly to ensure visual consistency and predictable styling
404
393
  - [x] **Label**
405
394
  - [x] **Badge**
406
395
  - [x] **Chip**
396
+ - [x] **StatusChip**
407
397
  - [x] **Logo**
408
398
  - [x] **Navbar**
409
399
  - [x] **SidebarMenu**
410
400
  - [x] **SidePanel**
411
401
  - [x] **Breadcrumb**
412
402
  - [x] **List**
403
+ - [x] **AttachmentsList**
413
404
  - [x] **Masonry Grid**
414
405
  - [x] **Stats**
415
406
  - [x] **ThemeToggle**
416
407
  - [x] **Screen**
408
+ - [x] **ChatInterface**
417
409
 
418
410
  ### Inputs & Forms
419
411
 
@@ -454,11 +446,14 @@ Follow these rules strictly to ensure visual consistency and predictable styling
454
446
  - [x] **Tabes**
455
447
  - [x] **Masonry**
456
448
  - [x] **Stats**
449
+ - [x] **Price**
450
+ - [x] **Date**
457
451
 
458
452
  ### Feedback & Overlays
459
453
 
460
454
  - [x] **Alert**
461
455
  - [x] **Modal**
456
+ - [x] **Empty**
462
457
  - [x] **ConfirmationModal**
463
458
  - [x] **ToastNotification**
464
459
  - [x] **Tooltip**
@@ -10,7 +10,7 @@ const p = /* @__PURE__ */ b({
10
10
  setup(o) {
11
11
  const e = o, s = a(() => {
12
12
  const r = {
13
- xs: "px-1.5 h-5 text-[10.5px] leading-none",
13
+ xs: "px-1.5 h-4 text-[9px] leading-none",
14
14
  sm: "px-2 h-6 text-xs font-medium",
15
15
  md: "px-2.5 h-7 text-xs font-semibold",
16
16
  lg: "px-3 h-8 text-sm font-semibold"
@@ -0,0 +1,33 @@
1
+ type __VLS_Props = {
2
+ /** dayjs-compatible format string for the time portion. Default: 'hh:mm:ss A' */
3
+ timeFormat?: string;
4
+ /** dayjs-compatible format string for the date portion. Default: 'dddd, MMMM D, YYYY' */
5
+ dateFormat?: string;
6
+ /** Whether to render the time heading. Default: true */
7
+ showTime?: boolean;
8
+ /** Whether to render the date paragraph. Default: true */
9
+ showDate?: boolean;
10
+ /**
11
+ * Milliseconds between each clock tick.
12
+ * Reactive — changing this prop will immediately restart the interval.
13
+ * Default: 1000
14
+ */
15
+ tickInterval?: number;
16
+ /** Additional Tailwind/CSS classes applied to the time <h2> element */
17
+ timeClass?: string;
18
+ /** Additional Tailwind/CSS classes applied to the date <p> element */
19
+ dateClass?: string;
20
+ /** Additional Tailwind/CSS classes applied to the root wrapper <div> */
21
+ wrapperClass?: string;
22
+ };
23
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
24
+ wrapperClass: string;
25
+ timeFormat: string;
26
+ dateFormat: string;
27
+ showTime: boolean;
28
+ showDate: boolean;
29
+ tickInterval: number;
30
+ timeClass: string;
31
+ dateClass: string;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
+ export default _default;
@@ -0,0 +1,51 @@
1
+ import { defineComponent as h, ref as w, watch as x, onMounted as k, onUnmounted as C, computed as i, openBlock as r, createElementBlock as n, normalizeClass as s, toDisplayString as d, createCommentVNode as u } from "vue";
2
+ import c from "dayjs";
3
+ const D = /* @__PURE__ */ h({
4
+ __name: "Clock",
5
+ props: {
6
+ timeFormat: { default: "hh:mm:ss A" },
7
+ dateFormat: { default: "dddd, MMMM D, YYYY" },
8
+ showTime: { type: Boolean, default: !0 },
9
+ showDate: { type: Boolean, default: !0 },
10
+ tickInterval: { default: 1e3 },
11
+ timeClass: { default: "" },
12
+ dateClass: { default: "" },
13
+ wrapperClass: { default: "" }
14
+ },
15
+ setup(t) {
16
+ const a = t, o = w(/* @__PURE__ */ new Date());
17
+ let e;
18
+ function m(l) {
19
+ e !== void 0 && clearInterval(e), e = setInterval(() => {
20
+ o.value = /* @__PURE__ */ new Date();
21
+ }, l);
22
+ }
23
+ x(
24
+ () => a.tickInterval,
25
+ (l) => {
26
+ m(l);
27
+ }
28
+ ), k(() => {
29
+ m(a.tickInterval);
30
+ }), C(() => {
31
+ e !== void 0 && clearInterval(e);
32
+ });
33
+ const f = i(() => c(o.value).format(a.timeFormat)), v = i(() => c(o.value).format(a.dateFormat));
34
+ return (l, p) => (r(), n("div", {
35
+ class: s(["flex flex-col items-center z-10 w-full", t.wrapperClass]),
36
+ style: { "will-change": "transform", contain: "layout style" }
37
+ }, [
38
+ t.showTime ? (r(), n("h2", {
39
+ key: 0,
40
+ class: s(["text-5xl md:text-6xl font-extralight text-foreground tracking-tight tabular-nums", t.timeClass])
41
+ }, d(f.value), 3)) : u("", !0),
42
+ t.showDate ? (r(), n("p", {
43
+ key: 1,
44
+ class: s(["text-fs-1 font-normal text-muted-foreground mt-3.5 tracking-wide", t.dateClass])
45
+ }, d(v.value), 3)) : u("", !0)
46
+ ], 2));
47
+ }
48
+ });
49
+ export {
50
+ D as default
51
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Clock.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1 @@
1
+ export { default as Clock } from './Clock.vue';
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
4
4
  import { $t as E } from "../../utils/i18n.js";
5
5
  import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
6
6
  import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
7
- import ee from "./CommandPaletteItem.vue2.js";
7
+ import ee from "./CommandPaletteItem.vue.js";
8
8
  const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/60 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
9
9
  key: 0,
10
10
  class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
@@ -1,5 +1,5 @@
1
1
  import t from "./CommandPaletteItem.vue3.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-66b1ae06"]]);
5
5
  export {
@@ -1,13 +1,13 @@
1
- import { defineComponent as T, computed as d, openBlock as x, createBlock as w, unref as o, withCtx as u, createElementVNode as z, createVNode as m, renderSlot as $, mergeProps as k } from "vue";
2
- import P from "./Button.vue.js";
3
- import B from "./Dropdown/Dropdown.vue.js";
1
+ import { defineComponent as z, computed as m, openBlock as x, createBlock as k, unref as D, withCtx as h, createElementVNode as L, createVNode as g, renderSlot as B, mergeProps as P } from "vue";
2
+ import V from "./Button.vue.js";
3
+ import U from "./Dropdown/Dropdown.vue.js";
4
4
  import "@iconify/vue";
5
- import { $t as S } from "../utils/i18n.js";
5
+ import { $t as I } from "../utils/i18n.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  import j, { TimePicker as C } from "v-datepicker-lite";
9
9
  import "v-datepicker-lite/style.css";
10
- const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
10
+ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
11
11
  __name: "DatePicker",
12
12
  props: {
13
13
  placeholder: {},
@@ -29,34 +29,53 @@ const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
29
29
  readonly: { type: Boolean }
30
30
  },
31
31
  emits: ["update:modelValue", "change"],
32
- setup(t, { emit: V }) {
33
- const l = t, s = V, a = d({
34
- get: () => l.modelValue ?? l.value,
32
+ setup(t, { emit: N }) {
33
+ const r = t, y = N, a = m({
34
+ get: () => r.modelValue ?? r.value,
35
35
  set: (e) => {
36
- s("update:modelValue", e), s("change", e);
36
+ y("update:modelValue", e), y("change", e);
37
37
  }
38
- }), I = (e) => e instanceof Date ? e.getHours() !== 0 || e.getMinutes() !== 0 : typeof e == "string" ? e.includes("T") || /\d{2}:\d{2}/.test(e) : !1, c = (e) => {
38
+ }), T = (e) => e instanceof Date ? e.getHours() !== 0 || e.getMinutes() !== 0 : typeof e == "string" ? e.includes("T") || /\d{2}:\d{2}/.test(e) : !1, u = (e) => {
39
+ if (!e) return null;
40
+ if (e instanceof Date)
41
+ return isNaN(e.getTime()) ? null : new Date(e.getFullYear(), e.getMonth(), e.getDate());
42
+ if (typeof e == "string") {
43
+ if (/^\d{4}-\d{2}-\d{2}$/.test(e)) {
44
+ const [l, d, o] = e.split("-").map(Number);
45
+ return new Date(l, d - 1, o);
46
+ }
47
+ if (e.includes("T")) {
48
+ const l = e.split("T")[0], [d, o, s] = l.split("-").map(Number);
49
+ return new Date(d, o - 1, s);
50
+ }
51
+ const i = new Date(e);
52
+ return isNaN(i.getTime()) ? null : i;
53
+ }
54
+ return null;
55
+ }, c = (e) => {
56
+ const n = e.getFullYear(), i = String(e.getMonth() + 1).padStart(2, "0"), l = String(e.getDate()).padStart(2, "0");
57
+ return `${n}-${i}-${l}`;
58
+ }, b = (e) => {
39
59
  try {
40
60
  if (e && typeof e == "object") {
41
- const h = e.startDate || e.start, b = e.endDate || e.end;
42
- if (h && b) {
43
- const y = new Date(h), g = new Date(b);
44
- if (!isNaN(y.getTime()) && !isNaN(g.getTime()))
45
- return { startDate: y, endDate: g };
61
+ const d = e.startDate || e.start, o = e.endDate || e.end;
62
+ if (d && o) {
63
+ const s = u(d), w = u(o);
64
+ if (s && w) return { startDate: s, endDate: w };
46
65
  }
47
66
  }
48
- const n = new Date(e);
49
- if (isNaN(n.getTime())) return null;
50
- const i = new Date(n), D = new Date(n);
51
- return D.setDate(i.getDate() + 6), { startDate: i, endDate: D };
67
+ const n = u(e);
68
+ if (!n) return null;
69
+ const i = new Date(n), l = new Date(n);
70
+ return l.setDate(i.getDate() + 6), { startDate: i, endDate: l };
52
71
  } catch {
53
72
  return null;
54
73
  }
55
- }, r = d(() => {
74
+ }, f = m(() => {
56
75
  if (!a.value) return "";
57
- if (l.mode === "time") return a.value;
58
- if (l.mode === "week") {
59
- const e = c(a.value);
76
+ if (r.mode === "time") return a.value;
77
+ if (r.mode === "week") {
78
+ const e = b(a.value);
60
79
  if (!e) return "";
61
80
  const n = e.startDate.toLocaleDateString("en-US", {
62
81
  month: "short",
@@ -70,34 +89,52 @@ const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
70
89
  return `${n} - ${i}`;
71
90
  }
72
91
  try {
92
+ if (r.mode === "date" || r.mode === "month") {
93
+ const i = u(a.value);
94
+ return i ? i.toLocaleDateString("en-US", {
95
+ month: "short",
96
+ day: "numeric",
97
+ year: "numeric"
98
+ }) : String(a.value);
99
+ }
73
100
  const e = new Date(a.value);
74
101
  if (isNaN(e.getTime())) return String(a.value);
75
- const n = l.mode === "dateTime" && I(a.value);
102
+ const n = r.mode === "dateTime" && T(a.value);
76
103
  return e.toLocaleDateString("en-US", {
77
104
  month: "short",
78
105
  day: "numeric",
79
106
  year: "numeric",
80
- ...n ? { hour: "2-digit", minute: "2-digit", hour12: l.timeFormat === "12h" } : {}
107
+ ...n ? { hour: "2-digit", minute: "2-digit", hour12: r.timeFormat === "12h" } : {}
81
108
  });
82
109
  } catch {
83
110
  return String(a.value);
84
111
  }
85
- }), f = d(() => {
86
- if (l.placeholderI18n) return S(l.placeholderI18n);
87
- if (l.placeholder !== void 0) return l.placeholder;
88
- const e = S("vlite.datePicker.placeholder");
112
+ }), v = m(() => {
113
+ if (r.placeholderI18n) return I(r.placeholderI18n);
114
+ if (r.placeholder !== void 0) return r.placeholder;
115
+ const e = I("vlite.datePicker.placeholder");
89
116
  return e !== "vlite.datePicker.placeholder" ? e : "Select date";
90
- }), v = (e) => {
91
- if (l.mode === "week") {
92
- const n = c(e);
117
+ }), S = (e) => {
118
+ if (r.mode === "week") {
119
+ const n = b(e);
120
+ if (n) {
121
+ a.value = {
122
+ startDate: c(n.startDate),
123
+ endDate: c(n.endDate)
124
+ };
125
+ return;
126
+ }
127
+ }
128
+ if (r.mode === "date" || r.mode === "month") {
129
+ const n = u(e);
93
130
  if (n) {
94
- a.value = { startDate: n.startDate, endDate: n.endDate };
131
+ a.value = c(n);
95
132
  return;
96
133
  }
97
134
  }
98
135
  a.value = e;
99
- }, N = d(() => l.mode === "week" && a.value && typeof a.value == "object" && (a.value.startDate || a.value.start) || a.value);
100
- return (e, n) => t.mode !== "time" ? (x(), w(o(B), {
136
+ }, $ = m(() => r.mode === "week" && a.value && typeof a.value == "object" && (a.value.startDate || a.value.start) || a.value);
137
+ return (e, n) => t.mode !== "time" ? (x(), k(D(U), {
101
138
  key: 0,
102
139
  position: "bottom-start",
103
140
  class: "w-full",
@@ -105,13 +142,13 @@ const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
105
142
  teleport: t.teleport,
106
143
  disabled: t.disabled || t.readonly
107
144
  }, {
108
- trigger: u(() => [
109
- $(e.$slots, "default", {
145
+ trigger: h(() => [
146
+ B(e.$slots, "default", {
110
147
  value: a.value,
111
- displayValue: r.value
148
+ displayValue: f.value
112
149
  }, () => [
113
- m(P, k({
114
- text: r.value?.replace("-", "—") || f.value,
150
+ g(V, P({
151
+ text: f.value?.replace("-", "—") || v.value,
115
152
  variant: t.variant || "outline",
116
153
  size: t.size || "md",
117
154
  icon: t.icon || "lucide:calendar",
@@ -119,10 +156,10 @@ const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
119
156
  }, t.btnProps, { class: "w-full justify-start text-left font-normal" }), null, 16, ["text", "variant", "size", "icon", "disabled"])
120
157
  ])
121
158
  ]),
122
- default: u(() => [
123
- z("div", U, [
124
- m(o(j), {
125
- value: N.value,
159
+ default: h(() => [
160
+ L("div", F, [
161
+ g(D(j), {
162
+ value: $.value,
126
163
  mode: t.mode,
127
164
  "min-date": t.minDate,
128
165
  "max-date": t.maxDate,
@@ -132,17 +169,17 @@ const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
132
169
  "time-format": "12h",
133
170
  disabled: t.disabled,
134
171
  readonly: t.readonly,
135
- onChange: v
172
+ onChange: S
136
173
  }, null, 8, ["value", "mode", "min-date", "max-date", "disabled-dates", "minuteInterval", "disabled", "readonly"])
137
174
  ])
138
175
  ]),
139
176
  _: 3
140
- }, 8, ["teleport", "disabled"])) : (x(), w(o(C), {
177
+ }, 8, ["teleport", "disabled"])) : (x(), k(D(C), {
141
178
  key: 1,
142
179
  "model-value": a.value,
143
180
  "onUpdate:modelValue": [
144
181
  n[0] || (n[0] = (i) => a.value = i),
145
- v
182
+ S
146
183
  ],
147
184
  mode: t.mode,
148
185
  "min-date": t.minDate,
@@ -154,9 +191,9 @@ const U = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ T({
154
191
  disabled: t.disabled,
155
192
  readonly: t.readonly
156
193
  }, {
157
- default: u(() => [
158
- m(P, k({
159
- text: r.value || f.value,
194
+ default: h(() => [
195
+ g(V, P({
196
+ text: f.value || v.value,
160
197
  variant: t.variant || "outline",
161
198
  size: t.size || "md",
162
199
  icon: t.icon || (t.mode === "time" ? "lucide:clock" : "lucide:calendar"),
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
3
3
  import v from "./Modal.vue.js";
4
4
  import N from "./CommandPalette/CommandPaletteContent.vue.js";
5
5
  import { $t as R } from "../utils/i18n.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  const U = { class: "block truncate -text-fs-1.5" }, V = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, q = /* @__PURE__ */ x({
8
8
  __name: "NavbarCommandPalette",
9
9
  props: {
@@ -9,6 +9,8 @@ interface Props {
9
9
  variant?: 'solid' | 'outline' | 'ghost';
10
10
  attached?: boolean;
11
11
  size?: 'sm' | 'md' | 'lg';
12
+ mask?: boolean;
13
+ fluid?: boolean;
12
14
  }
13
15
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
14
16
  change: (value: string) => any;
@@ -21,6 +23,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
21
23
  }>, {
22
24
  length: number;
23
25
  type: "text" | "number";
26
+ mask: boolean;
24
27
  variant: "solid" | "outline" | "ghost";
25
28
  size: "sm" | "md" | "lg";
26
29
  error: boolean;
@@ -29,5 +32,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
29
32
  modelValue: string;
30
33
  autofocus: boolean;
31
34
  attached: boolean;
35
+ fluid: boolean;
32
36
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
33
37
  export default _default;
@@ -1,5 +1,5 @@
1
- import { defineComponent as j, ref as h, watch as z, onMounted as C, nextTick as V, computed as A, openBlock as g, createElementBlock as m, normalizeClass as v, Fragment as E, renderList as M } from "vue";
2
- const F = ["value", "type", "disabled", "placeholder", "onInput", "onKeydown"], P = /* @__PURE__ */ j({
1
+ import { defineComponent as C, ref as v, watch as M, onMounted as V, nextTick as A, computed as m, openBlock as g, createElementBlock as h, normalizeClass as y, Fragment as E, renderList as F } from "vue";
2
+ const K = ["value", "type", "inputmode", "disabled", "placeholder", "onInput", "onKeydown"], T = /* @__PURE__ */ C({
3
3
  __name: "OTPInput",
4
4
  props: {
5
5
  length: { default: 6 },
@@ -11,29 +11,31 @@ const F = ["value", "type", "disabled", "placeholder", "onInput", "onKeydown"],
11
11
  placeholder: { default: "" },
12
12
  variant: { default: "outline" },
13
13
  attached: { type: Boolean, default: !1 },
14
- size: { default: "md" }
14
+ size: { default: "md" },
15
+ mask: { type: Boolean, default: !1 },
16
+ fluid: { type: Boolean, default: !1 }
15
17
  },
16
18
  emits: ["update:modelValue", "complete", "change"],
17
- setup(f, { emit: b }) {
18
- const a = f, p = b, s = h([]), r = h(new Array(a.length).fill(""));
19
- z(
20
- () => a.modelValue,
21
- (t) => {
22
- const e = t || "", l = e.split("").slice(0, a.length);
19
+ setup(d, { emit: b }) {
20
+ const t = d, p = b, s = v([]), r = v(new Array(t.length).fill(""));
21
+ M(
22
+ () => t.modelValue,
23
+ (l) => {
24
+ const e = l || "", a = e.split("").slice(0, t.length);
23
25
  if (r.value.join("") !== e) {
24
- const o = new Array(a.length).fill("");
25
- l.forEach((u, i) => o[i] = u), r.value = o;
26
+ const o = new Array(t.length).fill("");
27
+ a.forEach((u, i) => o[i] = u), r.value = o;
26
28
  }
27
29
  },
28
30
  { immediate: !0 }
29
31
  );
30
32
  const c = () => {
31
- const t = r.value.join("");
32
- p("update:modelValue", t), p("change", t), t.length === a.length && p("complete", t);
33
- }, y = (t, e) => {
34
- let n = t.target.value;
35
- if (a.type === "number" && (n = n.replace(/\D/g, "")), n.length === 1) {
36
- r.value[e] = n, c(), e < a.length - 1 && s.value[e + 1]?.focus();
33
+ const l = r.value.join("");
34
+ p("update:modelValue", l), p("change", l), l.length === t.length && p("complete", l);
35
+ }, w = (l, e) => {
36
+ let n = l.target.value;
37
+ if (t.type === "number" && (n = n.replace(/\D/g, "")), n.length === 1) {
38
+ r.value[e] = n, c(), e < t.length - 1 && s.value[e + 1]?.focus();
37
39
  return;
38
40
  }
39
41
  if (!n) {
@@ -41,75 +43,85 @@ const F = ["value", "type", "disabled", "placeholder", "onInput", "onKeydown"],
41
43
  return;
42
44
  }
43
45
  if (n.length > 1) {
44
- const o = n.split("").slice(0, a.length - e);
45
- o.forEach((i, d) => {
46
- e + d < a.length && (r.value[e + d] = i);
46
+ const o = n.split("").slice(0, t.length - e);
47
+ o.forEach((i, f) => {
48
+ e + f < t.length && (r.value[e + f] = i);
47
49
  }), c();
48
- const u = Math.min(e + o.length, a.length - 1);
50
+ const u = Math.min(e + o.length, t.length - 1);
49
51
  s.value[u]?.focus();
50
52
  }
51
- }, w = (t, e) => {
52
- const l = t.key;
53
- if (l === "Backspace") {
54
- r.value[e] || (t.preventDefault(), e > 0 && (r.value[e - 1] = "", s.value[e - 1]?.focus(), c()));
53
+ }, D = (l, e) => {
54
+ const a = l.key;
55
+ if (a === "Backspace") {
56
+ r.value[e] || (l.preventDefault(), e > 0 && (r.value[e - 1] = "", s.value[e - 1]?.focus(), c()));
55
57
  return;
56
58
  }
57
- l === "ArrowLeft" && (t.preventDefault(), e > 0 && s.value[e - 1]?.focus()), l === "ArrowRight" && (t.preventDefault(), e < a.length - 1 && s.value[e + 1]?.focus());
58
- }, D = (t) => {
59
- t.preventDefault();
60
- const e = t.clipboardData?.getData("text/plain");
59
+ a === "ArrowLeft" && (l.preventDefault(), e > 0 && s.value[e - 1]?.focus()), a === "ArrowRight" && (l.preventDefault(), e < t.length - 1 && s.value[e + 1]?.focus());
60
+ }, k = (l) => {
61
+ l.preventDefault();
62
+ const e = l.clipboardData?.getData("text/plain");
61
63
  if (!e) return;
62
- let l = e.trim();
63
- a.type === "number" && (l = l.replace(/\D/g, ""));
64
- const n = l.split("").slice(0, a.length), o = [...r.value];
65
- n.forEach((i, d) => {
66
- o[d] = i;
64
+ let a = e.trim();
65
+ t.type === "number" && (a = a.replace(/\D/g, ""));
66
+ const n = a.split("").slice(0, t.length), o = [...r.value];
67
+ n.forEach((i, f) => {
68
+ o[f] = i;
67
69
  }), r.value = o, c();
68
- const u = Math.min(n.length, a.length - 1);
70
+ const u = Math.min(n.length, t.length - 1);
69
71
  s.value[u]?.focus();
70
- }, k = (t, e) => {
71
- t && (s.value[e] = t);
72
+ }, B = (l, e) => {
73
+ l && (s.value[e] = l);
72
74
  };
73
- C(() => {
74
- a.autofocus && V(() => {
75
+ V(() => {
76
+ t.autofocus && A(() => {
75
77
  s.value[0]?.focus();
76
78
  });
77
79
  });
78
- const B = A(() => ["flex items-center", a.attached ? "-space-x-px" : "gap-2"].join(" ")), I = (t) => {
79
- const e = "text-center font-medium transition-all focus:outline-none focus:z-10 disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted-foreground", l = {
80
+ const I = m(() => t.mask ? "password" : t.type === "number" ? "tel" : "text"), j = m(() => {
81
+ if (!t.mask)
82
+ return t.type === "number" ? "numeric" : void 0;
83
+ }), x = m(() => {
84
+ const l = t.attached ? "-space-x-px" : "gap-2", e = t.fluid ? "w-full" : "";
85
+ return ["flex items-center", l, e].filter(Boolean).join(" ");
86
+ }), z = (l) => {
87
+ const e = "text-center font-medium transition-all focus:outline-none focus:z-10 disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted-foreground", a = t.fluid ? {
88
+ sm: "flex-1 min-w-0 h-8 text-sm",
89
+ md: "flex-1 min-w-0 h-10 text-lg",
90
+ lg: "flex-1 min-w-0 h-12 text-xl"
91
+ } : {
80
92
  sm: "w-8 h-8 text-sm",
81
93
  md: "w-10 h-10 text-lg",
82
94
  lg: "w-12 h-12 text-xl"
83
95
  }, n = {
84
96
  solid: "bg-muted border border-transparent focus:border-primary focus:ring-2 focus:ring-primary",
85
97
  outline: "border border-input focus:border-primary focus:ring-2 focus:ring-primary",
86
- ghost: "bg-transparent border border-transparent hover:bg-accent focus:focus:border-primary focus:ring-2 focus:ring-primary"
87
- }, o = a.error ? "border-destructive focus:ring-destructive text-destructive" : "";
98
+ ghost: "bg-transparent border border-transparent hover:bg-accent focus:border-primary focus:ring-2 focus:ring-primary"
99
+ }, o = t.error ? "border-destructive focus:ring-destructive text-destructive" : "";
88
100
  let u = "rounded-md";
89
- return a.attached && (t === 0 ? u = "rounded-l-md rounded-r-none" : t === a.length - 1 ? u = "rounded-r-md rounded-l-none" : u = "rounded-none"), [e, l[a.size], n[a.variant], o, u].join(" ");
101
+ return t.attached && (l === 0 ? u = "rounded-l-md rounded-r-none" : l === t.length - 1 ? u = "rounded-r-md rounded-l-none" : u = "rounded-none"), [e, a[t.size], n[t.variant], o, u].join(" ");
90
102
  };
91
- return (t, e) => (g(), m("div", {
92
- class: v(B.value)
103
+ return (l, e) => (g(), h("div", {
104
+ class: y(x.value)
93
105
  }, [
94
- (g(!0), m(E, null, M(a.length, (l, n) => (g(), m("input", {
106
+ (g(!0), h(E, null, F(t.length, (a, n) => (g(), h("input", {
95
107
  key: n,
96
108
  ref_for: !0,
97
- ref: (o) => k(o, n),
109
+ ref: (o) => B(o, n),
98
110
  value: r.value[n],
99
- type: f.type === "number" ? "tel" : "text",
100
- inputmode: "numeric",
111
+ type: I.value,
112
+ inputmode: j.value,
101
113
  maxlength: 1,
102
- disabled: f.disabled,
103
- placeholder: f.placeholder,
104
- class: v(I(n)),
105
- onInput: (o) => y(o, n),
106
- onKeydown: (o) => w(o, n),
107
- onPaste: D,
108
- onFocus: e[0] || (e[0] = (o) => t.$emit("update:modelValue", r.value.join("")))
109
- }, null, 42, F))), 128))
114
+ disabled: d.disabled,
115
+ placeholder: d.placeholder,
116
+ class: y(z(n)),
117
+ onInput: (o) => w(o, n),
118
+ onKeydown: (o) => D(o, n),
119
+ onPaste: k,
120
+ onFocus: e[0] || (e[0] = (o) => l.$emit("update:modelValue", r.value.join("")))
121
+ }, null, 42, K))), 128))
110
122
  ], 2));
111
123
  }
112
124
  });
113
125
  export {
114
- P as default
126
+ T as default
115
127
  };
package/index.d.ts CHANGED
@@ -76,4 +76,5 @@ export { GoogleSignInPlugin };
76
76
  export * from './components/StatusChip';
77
77
  export * from './components/Price';
78
78
  export * from './components/DateTime';
79
+ export * from './components/Clock';
79
80
  export * from './core/config.ts';
package/index.js CHANGED
@@ -118,7 +118,8 @@ import { default as Qt } from "./components/StatusChip/StatusChip.vue.js";
118
118
  import { STATUS_MAP as qt, normalizeStatus as Wt, resolveStatus as Xt } from "./components/StatusChip/status-map.js";
119
119
  import { default as Jt } from "./components/Price/Price.vue.js";
120
120
  import { default as ea } from "./components/DateTime/DateTime.vue.js";
121
- import { VLITE_CONFIG_KEY as ra, configState as ta, updateConfig as aa, useVLiteConfig as fa } from "./core/config.js";
121
+ import { default as ra } from "./components/Clock/Clock.vue.js";
122
+ import { VLITE_CONFIG_KEY as aa, configState as fa, updateConfig as ma, useVLiteConfig as la } from "./core/config.js";
122
123
  export {
123
124
  E as $t,
124
125
  Fo as Accordion,
@@ -140,6 +141,7 @@ export {
140
141
  nt as CheckBox,
141
142
  L as Chip,
142
143
  yo as ChoiceBox,
144
+ ra as Clock,
143
145
  yt as ColorPicker,
144
146
  Ot as CommandPaletteContent,
145
147
  Mt as ConfirmationModal,
@@ -218,12 +220,12 @@ export {
218
220
  Mr as TimelineItem,
219
221
  Rt as ToastNotification,
220
222
  xt as Tooltip,
221
- ra as VLITE_CONFIG_KEY,
223
+ aa as VLITE_CONFIG_KEY,
222
224
  fo as Workbook,
223
225
  we as barcodesConstants,
224
226
  p as camelCase,
225
227
  d as capitalize,
226
- ta as configState,
228
+ fa as configState,
227
229
  Fr as configure,
228
230
  u as copyToClipboard,
229
231
  Ht as createVLite,
@@ -259,7 +261,7 @@ export {
259
261
  F as throttle,
260
262
  Br as toast,
261
263
  v as truncate,
262
- aa as updateConfig,
264
+ ma as updateConfig,
263
265
  Sr as useAdvancedKeyStroke,
264
266
  Ye as useDropdownIds,
265
267
  Ve as useDropdownSelection,
@@ -271,6 +273,6 @@ export {
271
273
  kr as useNotifications,
272
274
  Vo as useTheme,
273
275
  oo as useTreeSelection,
274
- fa as useVLiteConfig,
276
+ la as useVLiteConfig,
275
277
  Cr as vScrollReveal
276
278
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "description": "A Vue 3 UI component library built with Tailwind CSS.",
5
5
  "license": "MIT",
6
- "version": "0.9.12",
6
+ "version": "1.0.2",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",