@datametria/vue-components 1.1.2 → 1.2.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.
Files changed (32) hide show
  1. package/README.md +657 -472
  2. package/dist/index.es.js +1916 -675
  3. package/dist/index.umd.js +74 -1
  4. package/dist/vue-components.css +1 -1
  5. package/package.json +98 -98
  6. package/src/components/DatametriaAlert.vue +137 -123
  7. package/src/components/DatametriaBadge.vue +98 -90
  8. package/src/components/DatametriaButton.vue +165 -157
  9. package/src/components/DatametriaChip.vue +149 -149
  10. package/src/components/DatametriaMenu.vue +620 -0
  11. package/src/components/DatametriaNavbar.vue +252 -227
  12. package/src/components/DatametriaSkeleton.vue +240 -0
  13. package/src/components/DatametriaSlider.vue +408 -0
  14. package/src/components/DatametriaTimePicker.vue +286 -0
  15. package/src/components/DatametriaToast.vue +176 -163
  16. package/src/components/DatametriaTooltip.vue +409 -0
  17. package/src/components/__tests__/DatametriaAlert.test.js +36 -0
  18. package/src/components/__tests__/DatametriaBadge.test.js +30 -0
  19. package/src/components/__tests__/DatametriaButton.test.js +31 -0
  20. package/src/components/__tests__/DatametriaChip.test.js +39 -0
  21. package/src/components/__tests__/DatametriaNavbar.test.js +49 -0
  22. package/src/components/__tests__/DatametriaToast.test.js +49 -0
  23. package/src/composables/useAccessibilityScale.ts +95 -0
  24. package/src/composables/useBreakpoints.ts +83 -0
  25. package/src/composables/useHapticFeedback.ts +440 -0
  26. package/src/composables/useRipple.ts +219 -0
  27. package/src/index.ts +61 -52
  28. package/src/stories/Variants.stories.js +96 -0
  29. package/src/styles/design-tokens.css +623 -31
  30. package/ACCESSIBILITY.md +0 -78
  31. package/DESIGN-SYSTEM.md +0 -70
  32. package/PROGRESS.md +0 -327
package/dist/index.es.js CHANGED
@@ -1,15 +1,15 @@
1
- import { defineComponent as f, computed as C, createElementBlock as t, openBlock as a, normalizeClass as y, createCommentVNode as c, renderSlot as p, createElementVNode as i, createTextVNode as w, toDisplayString as m, Fragment as B, renderList as L, ref as k, watch as T, withDirectives as N, vModelText as R, withModifiers as S, onMounted as P, onUnmounted as X, createBlock as K, Teleport as j, createVNode as G, Transition as H, withCtx as J, normalizeStyle as A, withKeys as U } from "vue";
2
- var W = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.OUTLINE = "outline", e.GHOST = "ghost", e))(W || {}), Y = /* @__PURE__ */ ((e) => (e.SM = "sm", e.MD = "md", e.LG = "lg", e))(Y || {});
3
- const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
1
+ import { defineComponent as E, computed as B, createElementBlock as s, openBlock as t, normalizeClass as L, createCommentVNode as f, renderSlot as R, createElementVNode as v, createTextVNode as A, toDisplayString as g, Fragment as U, renderList as K, ref as V, watch as H, withDirectives as re, vModelText as ne, nextTick as Y, normalizeStyle as X, withModifiers as Z, onMounted as J, onUnmounted as ie, createBlock as ee, Teleport as ae, createVNode as te, Transition as le, withCtx as se, createStaticVNode as ve, withKeys as ce, resolveDynamicComponent as fe } from "vue";
2
+ var oe = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.OUTLINE = "outline", e.GHOST = "ghost", e))(oe || {}), me = /* @__PURE__ */ ((e) => (e.SM = "sm", e.MD = "md", e.LG = "lg", e))(me || {});
3
+ const he = ["disabled", "type", "aria-busy", "aria-disabled"], be = {
4
4
  key: 0,
5
5
  class: "spinner",
6
6
  role: "status",
7
7
  "aria-label": "Carregando"
8
- }, ae = /* @__PURE__ */ f({
8
+ }, pe = /* @__PURE__ */ E({
9
9
  __name: "DatametriaButton",
10
10
  props: {
11
- variant: { default: W.PRIMARY },
12
- size: { default: Y.MD },
11
+ variant: { default: oe.PRIMARY },
12
+ size: { default: me.MD },
13
13
  disabled: { type: Boolean, default: !1 },
14
14
  loading: { type: Boolean, default: !1 },
15
15
  fullWidth: { type: Boolean, default: !1 },
@@ -17,40 +17,45 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
17
17
  },
18
18
  emits: ["click"],
19
19
  setup(e) {
20
- const l = e, s = C(() => [
20
+ const i = e;
21
+ if (process.env.NODE_ENV === "development") {
22
+ const a = Object.values(oe);
23
+ a.includes(i.variant) || console.warn(`[DatametriaButton] Invalid variant "${i.variant}". Valid options: ${a.join(", ")}`);
24
+ }
25
+ const n = B(() => [
21
26
  "datametria-button",
22
- `datametria-button--${l.variant}`,
23
- `datametria-button--${l.size}`,
27
+ `datametria-button--${i.variant}`,
28
+ `datametria-button--${i.size}`,
24
29
  {
25
- "datametria-button--full-width": l.fullWidth,
26
- "datametria-button--loading": l.loading,
27
- "datametria-button--disabled": l.disabled
30
+ "datametria-button--full-width": i.fullWidth,
31
+ "datametria-button--loading": i.loading,
32
+ "datametria-button--disabled": i.disabled
28
33
  }
29
34
  ]);
30
- return (o, r) => (a(), t("button", {
31
- class: y(s.value),
35
+ return (a, l) => (t(), s("button", {
36
+ class: L(n.value),
32
37
  disabled: e.disabled || e.loading,
33
38
  type: e.type,
34
39
  "aria-busy": e.loading,
35
40
  "aria-disabled": e.disabled,
36
- onClick: r[0] || (r[0] = (d) => o.$emit("click", d))
41
+ onClick: l[0] || (l[0] = (r) => a.$emit("click", r))
37
42
  }, [
38
- e.loading ? (a(), t("span", ee)) : c("", !0),
39
- p(o.$slots, "default", {}, void 0, !0)
40
- ], 10, Z));
43
+ e.loading ? (t(), s("span", be)) : f("", !0),
44
+ R(a.$slots, "default", {}, void 0, !0)
45
+ ], 10, he));
41
46
  }
42
- }), _ = (e, l) => {
43
- const s = e.__vccOpts || e;
44
- for (const [o, r] of l)
45
- s[o] = r;
46
- return s;
47
- }, Et = /* @__PURE__ */ _(ae, [["__scopeId", "data-v-e9850b65"]]), te = { class: "datametria-input" }, le = ["for"], se = {
47
+ }), S = (e, i) => {
48
+ const n = e.__vccOpts || e;
49
+ for (const [a, l] of i)
50
+ n[a] = l;
51
+ return n;
52
+ }, Kl = /* @__PURE__ */ S(pe, [["__scopeId", "data-v-5b66540e"]]), ge = { class: "datametria-input" }, _e = ["for"], ke = {
48
53
  key: 0,
49
54
  class: "datametria-input__required"
50
- }, re = ["id", "value", "placeholder", "disabled", "required"], de = {
55
+ }, ye = ["id", "value", "placeholder", "disabled", "required"], $e = {
51
56
  key: 1,
52
57
  class: "datametria-input__error"
53
- }, oe = /* @__PURE__ */ f({
58
+ }, we = /* @__PURE__ */ E({
54
59
  __name: "DatametriaInput",
55
60
  props: {
56
61
  modelValue: { default: "" },
@@ -62,45 +67,45 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
62
67
  },
63
68
  emits: ["update:modelValue"],
64
69
  setup(e) {
65
- const l = e, s = C(() => `input-${Math.random().toString(36).substr(2, 9)}`), o = C(() => [
70
+ const i = e, n = B(() => `input-${Math.random().toString(36).substr(2, 9)}`), a = B(() => [
66
71
  "datametria-input__field",
67
72
  {
68
- "datametria-input__field--error": l.errorMessage,
69
- "datametria-input__field--disabled": l.disabled
73
+ "datametria-input__field--error": i.errorMessage,
74
+ "datametria-input__field--disabled": i.disabled
70
75
  }
71
76
  ]);
72
- return (r, d) => (a(), t("div", te, [
73
- e.label ? (a(), t("label", {
77
+ return (l, r) => (t(), s("div", ge, [
78
+ e.label ? (t(), s("label", {
74
79
  key: 0,
75
- for: s.value,
80
+ for: n.value,
76
81
  class: "datametria-input__label"
77
82
  }, [
78
- w(m(e.label) + " ", 1),
79
- e.required ? (a(), t("span", se, "*")) : c("", !0)
80
- ], 8, le)) : c("", !0),
81
- i("input", {
82
- id: s.value,
83
+ A(g(e.label) + " ", 1),
84
+ e.required ? (t(), s("span", ke, "*")) : f("", !0)
85
+ ], 8, _e)) : f("", !0),
86
+ v("input", {
87
+ id: n.value,
83
88
  value: e.modelValue,
84
89
  placeholder: e.placeholder,
85
90
  disabled: e.disabled,
86
91
  required: e.required,
87
- class: y(o.value),
88
- onInput: d[0] || (d[0] = (n) => r.$emit("update:modelValue", n.target.value))
89
- }, null, 42, re),
90
- e.errorMessage ? (a(), t("p", de, m(e.errorMessage), 1)) : c("", !0)
92
+ class: L(a.value),
93
+ onInput: r[0] || (r[0] = (o) => l.$emit("update:modelValue", o.target.value))
94
+ }, null, 42, ye),
95
+ e.errorMessage ? (t(), s("p", $e, g(e.errorMessage), 1)) : f("", !0)
91
96
  ]));
92
97
  }
93
- }), At = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-cae54108"]]), ie = { class: "datametria-select" }, ne = ["for"], ce = {
98
+ }), Xl = /* @__PURE__ */ S(we, [["__scopeId", "data-v-cae54108"]]), xe = { class: "datametria-select" }, Ve = ["for"], De = {
94
99
  key: 0,
95
100
  class: "datametria-select__required"
96
- }, ue = ["id", "value", "disabled", "required"], me = {
101
+ }, Me = ["id", "value", "disabled", "required"], Ce = {
97
102
  key: 0,
98
103
  value: "",
99
104
  disabled: ""
100
- }, be = ["value"], ve = {
105
+ }, Ie = ["value"], Be = {
101
106
  key: 1,
102
107
  class: "datametria-select__error"
103
- }, he = /* @__PURE__ */ f({
108
+ }, Te = /* @__PURE__ */ E({
104
109
  __name: "DatametriaSelect",
105
110
  props: {
106
111
  modelValue: { default: "" },
@@ -113,43 +118,43 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
113
118
  },
114
119
  emits: ["update:modelValue"],
115
120
  setup(e) {
116
- const l = e, s = C(() => `select-${Math.random().toString(36).substr(2, 9)}`), o = C(() => [
121
+ const i = e, n = B(() => `select-${Math.random().toString(36).substr(2, 9)}`), a = B(() => [
117
122
  "datametria-select__field",
118
123
  {
119
- "datametria-select__field--error": l.errorMessage,
120
- "datametria-select__field--disabled": l.disabled
124
+ "datametria-select__field--error": i.errorMessage,
125
+ "datametria-select__field--disabled": i.disabled
121
126
  }
122
127
  ]);
123
- return (r, d) => (a(), t("div", ie, [
124
- e.label ? (a(), t("label", {
128
+ return (l, r) => (t(), s("div", xe, [
129
+ e.label ? (t(), s("label", {
125
130
  key: 0,
126
- for: s.value,
131
+ for: n.value,
127
132
  class: "datametria-select__label"
128
133
  }, [
129
- w(m(e.label) + " ", 1),
130
- e.required ? (a(), t("span", ce, "*")) : c("", !0)
131
- ], 8, ne)) : c("", !0),
132
- i("select", {
133
- id: s.value,
134
+ A(g(e.label) + " ", 1),
135
+ e.required ? (t(), s("span", De, "*")) : f("", !0)
136
+ ], 8, Ve)) : f("", !0),
137
+ v("select", {
138
+ id: n.value,
134
139
  value: e.modelValue,
135
140
  disabled: e.disabled,
136
141
  required: e.required,
137
- class: y(o.value),
138
- onChange: d[0] || (d[0] = (n) => r.$emit("update:modelValue", n.target.value))
142
+ class: L(a.value),
143
+ onChange: r[0] || (r[0] = (o) => l.$emit("update:modelValue", o.target.value))
139
144
  }, [
140
- e.placeholder ? (a(), t("option", me, m(e.placeholder), 1)) : c("", !0),
141
- (a(!0), t(B, null, L(e.options, (n) => (a(), t("option", {
142
- key: n.value,
143
- value: n.value
144
- }, m(n.label), 9, be))), 128))
145
- ], 42, ue),
146
- e.errorMessage ? (a(), t("p", ve, m(e.errorMessage), 1)) : c("", !0)
145
+ e.placeholder ? (t(), s("option", Ce, g(e.placeholder), 1)) : f("", !0),
146
+ (t(!0), s(U, null, K(e.options, (o) => (t(), s("option", {
147
+ key: o.value,
148
+ value: o.value
149
+ }, g(o.label), 9, Ie))), 128))
150
+ ], 42, Me),
151
+ e.errorMessage ? (t(), s("p", Be, g(e.errorMessage), 1)) : f("", !0)
147
152
  ]));
148
153
  }
149
- }), Ot = /* @__PURE__ */ _(he, [["__scopeId", "data-v-96f4e8ce"]]), fe = { class: "datametria-checkbox" }, _e = ["checked", "disabled"], $e = {
154
+ }), Hl = /* @__PURE__ */ S(Te, [["__scopeId", "data-v-96f4e8ce"]]), Le = { class: "datametria-checkbox" }, Ee = ["checked", "disabled"], Se = {
150
155
  key: 0,
151
156
  class: "datametria-checkbox__label"
152
- }, ye = /* @__PURE__ */ f({
157
+ }, qe = /* @__PURE__ */ E({
153
158
  __name: "DatametriaCheckbox",
154
159
  props: {
155
160
  modelValue: { type: Boolean, default: !1 },
@@ -158,22 +163,22 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
158
163
  },
159
164
  emits: ["update:modelValue"],
160
165
  setup(e) {
161
- return (l, s) => (a(), t("label", fe, [
162
- i("input", {
166
+ return (i, n) => (t(), s("label", Le, [
167
+ v("input", {
163
168
  type: "checkbox",
164
169
  checked: e.modelValue,
165
170
  disabled: e.disabled,
166
171
  class: "datametria-checkbox__input",
167
- onChange: s[0] || (s[0] = (o) => l.$emit("update:modelValue", o.target.checked))
168
- }, null, 40, _e),
169
- s[1] || (s[1] = i("span", { class: "datametria-checkbox__checkmark" }, null, -1)),
170
- e.label ? (a(), t("span", $e, m(e.label), 1)) : c("", !0)
172
+ onChange: n[0] || (n[0] = (a) => i.$emit("update:modelValue", a.target.checked))
173
+ }, null, 40, Ee),
174
+ n[1] || (n[1] = v("span", { class: "datametria-checkbox__checkmark" }, null, -1)),
175
+ e.label ? (t(), s("span", Se, g(e.label), 1)) : f("", !0)
171
176
  ]));
172
177
  }
173
- }), Nt = /* @__PURE__ */ _(ye, [["__scopeId", "data-v-3226ffd6"]]), ke = { class: "dm-radio" }, pe = { class: "dm-radio__label" }, ge = ["value", "checked", "disabled", "name", "aria-label", "aria-describedby"], De = {
178
+ }), Gl = /* @__PURE__ */ S(qe, [["__scopeId", "data-v-3226ffd6"]]), Re = { class: "dm-radio" }, ze = { class: "dm-radio__label" }, Ne = ["value", "checked", "disabled", "name", "aria-label", "aria-describedby"], Oe = {
174
179
  key: 0,
175
180
  class: "dm-radio__text"
176
- }, Ve = ["id"], we = /* @__PURE__ */ f({
181
+ }, Fe = ["id"], Ae = /* @__PURE__ */ E({
177
182
  __name: "DatametriaRadio",
178
183
  props: {
179
184
  modelValue: { type: [String, Number, Boolean] },
@@ -185,13 +190,13 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
185
190
  ariaLabel: {}
186
191
  },
187
192
  emits: ["update:modelValue"],
188
- setup(e, { emit: l }) {
189
- const s = e, o = l, r = () => {
190
- s.disabled || o("update:modelValue", s.value);
193
+ setup(e, { emit: i }) {
194
+ const n = e, a = i, l = () => {
195
+ n.disabled || a("update:modelValue", n.value);
191
196
  };
192
- return (d, n) => (a(), t("div", ke, [
193
- i("label", pe, [
194
- i("input", {
197
+ return (r, o) => (t(), s("div", Re, [
198
+ v("label", ze, [
199
+ v("input", {
195
200
  type: "radio",
196
201
  class: "dm-radio__input",
197
202
  value: e.value,
@@ -200,25 +205,25 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
200
205
  name: e.name,
201
206
  "aria-label": e.ariaLabel,
202
207
  "aria-describedby": e.error ? `${e.name}-error` : void 0,
203
- onChange: r
204
- }, null, 40, ge),
205
- n[0] || (n[0] = i("span", { class: "dm-radio__checkmark" }, null, -1)),
206
- e.label ? (a(), t("span", De, m(e.label), 1)) : c("", !0)
208
+ onChange: l
209
+ }, null, 40, Ne),
210
+ o[0] || (o[0] = v("span", { class: "dm-radio__checkmark" }, null, -1)),
211
+ e.label ? (t(), s("span", Oe, g(e.label), 1)) : f("", !0)
207
212
  ]),
208
- e.error ? (a(), t("p", {
213
+ e.error ? (t(), s("p", {
209
214
  key: 0,
210
215
  id: `${e.name}-error`,
211
216
  class: "dm-radio__error"
212
- }, m(e.error), 9, Ve)) : c("", !0)
217
+ }, g(e.error), 9, Fe)) : f("", !0)
213
218
  ]));
214
219
  }
215
- }), Rt = /* @__PURE__ */ _(we, [["__scopeId", "data-v-4fb0fa6f"]]), Ce = { class: "dm-switch" }, Ie = { class: "dm-switch__label" }, Be = ["checked", "disabled", "aria-label", "aria-checked"], Le = {
220
+ }), Yl = /* @__PURE__ */ S(Ae, [["__scopeId", "data-v-4fb0fa6f"]]), je = { class: "dm-switch" }, Pe = { class: "dm-switch__label" }, Ue = ["checked", "disabled", "aria-label", "aria-checked"], We = {
216
221
  key: 0,
217
222
  class: "dm-switch__text"
218
- }, Me = {
223
+ }, Ke = {
219
224
  key: 0,
220
225
  class: "dm-switch__error"
221
- }, qe = /* @__PURE__ */ f({
226
+ }, Xe = /* @__PURE__ */ E({
222
227
  __name: "DatametriaSwitch",
223
228
  props: {
224
229
  modelValue: { type: Boolean, default: !1 },
@@ -228,13 +233,13 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
228
233
  ariaLabel: {}
229
234
  },
230
235
  emits: ["update:modelValue"],
231
- setup(e, { emit: l }) {
232
- const s = e, o = l, r = (d) => {
233
- s.disabled || o("update:modelValue", d.target.checked);
236
+ setup(e, { emit: i }) {
237
+ const n = e, a = i, l = (r) => {
238
+ n.disabled || a("update:modelValue", r.target.checked);
234
239
  };
235
- return (d, n) => (a(), t("div", Ce, [
236
- i("label", Ie, [
237
- i("input", {
240
+ return (r, o) => (t(), s("div", je, [
241
+ v("label", Pe, [
242
+ v("input", {
238
243
  type: "checkbox",
239
244
  class: "dm-switch__input",
240
245
  checked: e.modelValue,
@@ -242,26 +247,26 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
242
247
  "aria-label": e.ariaLabel,
243
248
  "aria-checked": e.modelValue,
244
249
  role: "switch",
245
- onChange: r
246
- }, null, 40, Be),
247
- n[0] || (n[0] = i("span", { class: "dm-switch__track" }, [
248
- i("span", { class: "dm-switch__thumb" })
250
+ onChange: l
251
+ }, null, 40, Ue),
252
+ o[0] || (o[0] = v("span", { class: "dm-switch__track" }, [
253
+ v("span", { class: "dm-switch__thumb" })
249
254
  ], -1)),
250
- e.label ? (a(), t("span", Le, m(e.label), 1)) : c("", !0)
255
+ e.label ? (t(), s("span", We, g(e.label), 1)) : f("", !0)
251
256
  ]),
252
- e.error ? (a(), t("p", Me, m(e.error), 1)) : c("", !0)
257
+ e.error ? (t(), s("p", Ke, g(e.error), 1)) : f("", !0)
253
258
  ]));
254
259
  }
255
- }), Ut = /* @__PURE__ */ _(qe, [["__scopeId", "data-v-f57b4d9a"]]), Te = { class: "dm-textarea" }, xe = {
260
+ }), Jl = /* @__PURE__ */ S(Xe, [["__scopeId", "data-v-f57b4d9a"]]), He = { class: "dm-textarea" }, Ge = {
256
261
  key: 0,
257
262
  class: "dm-textarea__required"
258
- }, Se = ["placeholder", "disabled", "required", "rows", "maxlength", "aria-label", "aria-describedby", "aria-invalid"], ze = {
263
+ }, Ye = ["placeholder", "disabled", "required", "rows", "maxlength", "aria-label", "aria-describedby", "aria-invalid"], Je = {
259
264
  key: 1,
260
265
  class: "dm-textarea__footer"
261
- }, Ee = ["id"], Ae = {
266
+ }, Qe = ["id"], Ze = {
262
267
  key: 1,
263
268
  class: "dm-textarea__counter"
264
- }, Oe = /* @__PURE__ */ f({
269
+ }, ea = /* @__PURE__ */ E({
265
270
  __name: "DatametriaTextarea",
266
271
  props: {
267
272
  modelValue: { default: "" },
@@ -275,56 +280,56 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
275
280
  ariaLabel: {}
276
281
  },
277
282
  emits: ["update:modelValue"],
278
- setup(e, { emit: l }) {
279
- const s = e, o = l, r = `dm-textarea-${Math.random().toString(36).substr(2, 9)}`, d = k(s.modelValue);
280
- T(() => s.modelValue, (u) => {
281
- d.value = u;
283
+ setup(e, { emit: i }) {
284
+ const n = e, a = i, l = `dm-textarea-${Math.random().toString(36).substr(2, 9)}`, r = V(n.modelValue);
285
+ H(() => n.modelValue, (u) => {
286
+ r.value = u;
282
287
  });
283
- const n = () => {
284
- o("update:modelValue", d.value || "");
288
+ const o = () => {
289
+ a("update:modelValue", r.value || "");
285
290
  };
286
- return (u, b) => {
287
- var h;
288
- return a(), t("div", Te, [
289
- e.label ? (a(), t("label", {
291
+ return (u, m) => {
292
+ var b;
293
+ return t(), s("div", He, [
294
+ e.label ? (t(), s("label", {
290
295
  key: 0,
291
- for: r,
296
+ for: l,
292
297
  class: "dm-textarea__label"
293
298
  }, [
294
- w(m(e.label) + " ", 1),
295
- e.required ? (a(), t("span", xe, "*")) : c("", !0)
296
- ])) : c("", !0),
297
- N(i("textarea", {
298
- id: r,
299
- "onUpdate:modelValue": b[0] || (b[0] = (v) => d.value = v),
300
- class: y(["dm-textarea__input", { "dm-textarea__input--error": e.error }]),
299
+ A(g(e.label) + " ", 1),
300
+ e.required ? (t(), s("span", Ge, "*")) : f("", !0)
301
+ ])) : f("", !0),
302
+ re(v("textarea", {
303
+ id: l,
304
+ "onUpdate:modelValue": m[0] || (m[0] = (k) => r.value = k),
305
+ class: L(["dm-textarea__input", { "dm-textarea__input--error": e.error }]),
301
306
  placeholder: e.placeholder,
302
307
  disabled: e.disabled,
303
308
  required: e.required,
304
309
  rows: e.rows,
305
310
  maxlength: e.maxLength,
306
311
  "aria-label": e.ariaLabel,
307
- "aria-describedby": e.error ? `${r}-error` : void 0,
312
+ "aria-describedby": e.error ? `${l}-error` : void 0,
308
313
  "aria-invalid": !!e.error,
309
- onInput: n
310
- }, null, 42, Se), [
311
- [R, d.value]
314
+ onInput: o
315
+ }, null, 42, Ye), [
316
+ [ne, r.value]
312
317
  ]),
313
- e.maxLength || e.error ? (a(), t("div", ze, [
314
- e.error ? (a(), t("p", {
318
+ e.maxLength || e.error ? (t(), s("div", Je, [
319
+ e.error ? (t(), s("p", {
315
320
  key: 0,
316
- id: `${r}-error`,
321
+ id: `${l}-error`,
317
322
  class: "dm-textarea__error"
318
- }, m(e.error), 9, Ee)) : c("", !0),
319
- e.maxLength ? (a(), t("span", Ae, m(((h = d.value) == null ? void 0 : h.length) || 0) + "/" + m(e.maxLength), 1)) : c("", !0)
320
- ])) : c("", !0)
323
+ }, g(e.error), 9, Qe)) : f("", !0),
324
+ e.maxLength ? (t(), s("span", Ze, g(((b = r.value) == null ? void 0 : b.length) || 0) + "/" + g(e.maxLength), 1)) : f("", !0)
325
+ ])) : f("", !0)
321
326
  ]);
322
327
  };
323
328
  }
324
- }), Ft = /* @__PURE__ */ _(Oe, [["__scopeId", "data-v-e9253798"]]), Ne = { class: "dm-datepicker" }, Re = {
329
+ }), Ql = /* @__PURE__ */ S(ea, [["__scopeId", "data-v-e9253798"]]), aa = { class: "dm-datepicker" }, ta = {
325
330
  key: 0,
326
331
  class: "dm-datepicker__required"
327
- }, Ue = { class: "dm-datepicker__wrapper" }, Fe = ["disabled", "required", "min", "max", "aria-label", "aria-describedby", "aria-invalid"], Pe = ["id"], Ke = /* @__PURE__ */ f({
332
+ }, la = { class: "dm-datepicker__wrapper" }, sa = ["disabled", "required", "min", "max", "aria-label", "aria-describedby", "aria-invalid"], ia = ["id"], ra = /* @__PURE__ */ E({
328
333
  __name: "DatametriaDatePicker",
329
334
  props: {
330
335
  modelValue: { default: "" },
@@ -337,64 +342,367 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
337
342
  ariaLabel: {}
338
343
  },
339
344
  emits: ["update:modelValue"],
340
- setup(e, { emit: l }) {
341
- const s = e, o = l, r = `dm-datepicker-${Math.random().toString(36).substr(2, 9)}`, d = k(s.modelValue);
342
- T(() => s.modelValue, (u) => {
343
- d.value = u;
345
+ setup(e, { emit: i }) {
346
+ const n = e, a = i, l = `dm-datepicker-${Math.random().toString(36).substr(2, 9)}`, r = V(n.modelValue);
347
+ H(() => n.modelValue, (u) => {
348
+ r.value = u;
344
349
  });
345
- const n = () => {
346
- o("update:modelValue", d.value);
350
+ const o = () => {
351
+ a("update:modelValue", r.value);
347
352
  };
348
- return (u, b) => (a(), t("div", Ne, [
349
- e.label ? (a(), t("label", {
353
+ return (u, m) => (t(), s("div", aa, [
354
+ e.label ? (t(), s("label", {
350
355
  key: 0,
351
- for: r,
356
+ for: l,
352
357
  class: "dm-datepicker__label"
353
358
  }, [
354
- w(m(e.label) + " ", 1),
355
- e.required ? (a(), t("span", Re, "*")) : c("", !0)
356
- ])) : c("", !0),
357
- i("div", Ue, [
358
- N(i("input", {
359
- id: r,
359
+ A(g(e.label) + " ", 1),
360
+ e.required ? (t(), s("span", ta, "*")) : f("", !0)
361
+ ])) : f("", !0),
362
+ v("div", la, [
363
+ re(v("input", {
364
+ id: l,
360
365
  type: "date",
361
- "onUpdate:modelValue": b[0] || (b[0] = (h) => d.value = h),
362
- class: y(["dm-datepicker__input", { "dm-datepicker__input--error": e.error }]),
366
+ "onUpdate:modelValue": m[0] || (m[0] = (b) => r.value = b),
367
+ class: L(["dm-datepicker__input", { "dm-datepicker__input--error": e.error }]),
363
368
  disabled: e.disabled,
364
369
  required: e.required,
365
370
  min: e.min,
366
371
  max: e.max,
367
372
  "aria-label": e.ariaLabel,
368
- "aria-describedby": e.error ? `${r}-error` : void 0,
373
+ "aria-describedby": e.error ? `${l}-error` : void 0,
369
374
  "aria-invalid": !!e.error,
370
- onChange: n
371
- }, null, 42, Fe), [
372
- [R, d.value]
375
+ onChange: o
376
+ }, null, 42, sa), [
377
+ [ne, r.value]
373
378
  ])
374
379
  ]),
375
- e.error ? (a(), t("p", {
380
+ e.error ? (t(), s("p", {
376
381
  key: 1,
377
- id: `${r}-error`,
382
+ id: `${l}-error`,
378
383
  class: "dm-datepicker__error"
379
- }, m(e.error), 9, Pe)) : c("", !0)
384
+ }, g(e.error), 9, ia)) : f("", !0)
380
385
  ]));
381
386
  }
382
- }), Pt = /* @__PURE__ */ _(Ke, [["__scopeId", "data-v-8bf1e9ec"]]), je = { class: "dm-file-upload" }, Ge = {
387
+ }), Zl = /* @__PURE__ */ S(ra, [["__scopeId", "data-v-8bf1e9ec"]]), na = ["for"], oa = {
388
+ key: 0,
389
+ class: "dm-time-picker__required",
390
+ "aria-label": "obrigatório"
391
+ }, da = { class: "dm-time-picker__wrapper" }, ca = ["id", "disabled", "required", "min", "max", "step", "aria-describedby", "aria-invalid"], ua = {
392
+ key: 0,
393
+ class: "dm-time-picker__icon"
394
+ }, ma = {
395
+ key: 0,
396
+ class: "dm-time-picker__icon--error",
397
+ viewBox: "0 0 20 20",
398
+ fill: "currentColor"
399
+ }, va = {
400
+ key: 1,
401
+ class: "dm-time-picker__icon--success",
402
+ viewBox: "0 0 20 20",
403
+ fill: "currentColor"
404
+ }, fa = {
405
+ key: 1,
406
+ class: "dm-time-picker__messages"
407
+ }, ha = ["id"], ba = ["id"], pa = ["id"], ga = /* @__PURE__ */ E({
408
+ __name: "DatametriaTimePicker",
409
+ props: {
410
+ modelValue: { default: "" },
411
+ label: {},
412
+ placeholder: {},
413
+ disabled: { type: Boolean },
414
+ required: { type: Boolean },
415
+ errorMessage: {},
416
+ successMessage: {},
417
+ helperText: {},
418
+ min: {},
419
+ max: {},
420
+ step: { default: 60 },
421
+ format24h: { type: Boolean, default: !0 }
422
+ },
423
+ emits: ["update:modelValue", "blur", "focus", "change"],
424
+ setup(e, { expose: i, emit: n }) {
425
+ const a = e, l = n, r = V(), o = B(() => `dm-time-picker-${Math.random().toString(36).substr(2, 9)}`), u = B(() => !!a.errorMessage), m = B(() => !!a.successMessage && !u.value), b = B(() => {
426
+ const p = [];
427
+ return a.errorMessage ? p.push(`${o.value}-error`) : a.successMessage ? p.push(`${o.value}-success`) : a.helperText && p.push(`${o.value}-helper`), p.length > 0 ? p.join(" ") : void 0;
428
+ }), k = B({
429
+ get: () => a.modelValue,
430
+ set: (p) => {
431
+ l("update:modelValue", p), l("change", p);
432
+ }
433
+ }), M = (p) => {
434
+ const w = p.target;
435
+ k.value = w.value;
436
+ }, T = (p) => {
437
+ l("blur", p);
438
+ }, $ = (p) => {
439
+ l("focus", p);
440
+ }, C = () => {
441
+ Y(() => {
442
+ var p;
443
+ (p = r.value) == null || p.focus();
444
+ });
445
+ }, h = () => {
446
+ var p;
447
+ (p = r.value) == null || p.blur();
448
+ };
449
+ return H(() => a.modelValue, (p) => {
450
+ r.value && r.value.value !== p && (r.value.value = p);
451
+ }), i({
452
+ focus: C,
453
+ blur: h,
454
+ inputRef: r
455
+ }), (p, w) => (t(), s("div", {
456
+ class: L(["dm-time-picker", { "dm-time-picker--disabled": e.disabled }])
457
+ }, [
458
+ e.label ? (t(), s("label", {
459
+ key: 0,
460
+ for: o.value,
461
+ class: "dm-time-picker__label"
462
+ }, [
463
+ A(g(e.label) + " ", 1),
464
+ e.required ? (t(), s("span", oa, "*")) : f("", !0)
465
+ ], 8, na)) : f("", !0),
466
+ v("div", da, [
467
+ re(v("input", {
468
+ id: o.value,
469
+ ref_key: "inputRef",
470
+ ref: r,
471
+ "onUpdate:modelValue": w[0] || (w[0] = (z) => k.value = z),
472
+ type: "time",
473
+ class: L(["dm-time-picker__input", {
474
+ "dm-time-picker__input--error": u.value,
475
+ "dm-time-picker__input--success": m.value
476
+ }]),
477
+ disabled: e.disabled,
478
+ required: e.required,
479
+ min: e.min,
480
+ max: e.max,
481
+ step: e.step,
482
+ "aria-describedby": b.value,
483
+ "aria-invalid": u.value,
484
+ onInput: M,
485
+ onBlur: T,
486
+ onFocus: $
487
+ }, null, 42, ca), [
488
+ [ne, k.value]
489
+ ]),
490
+ u.value || m.value ? (t(), s("div", ua, [
491
+ u.value ? (t(), s("svg", ma, [...w[1] || (w[1] = [
492
+ v("path", {
493
+ "fill-rule": "evenodd",
494
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
495
+ "clip-rule": "evenodd"
496
+ }, null, -1)
497
+ ])])) : m.value ? (t(), s("svg", va, [...w[2] || (w[2] = [
498
+ v("path", {
499
+ "fill-rule": "evenodd",
500
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
501
+ "clip-rule": "evenodd"
502
+ }, null, -1)
503
+ ])])) : f("", !0)
504
+ ])) : f("", !0)
505
+ ]),
506
+ e.errorMessage || e.successMessage || e.helperText ? (t(), s("div", fa, [
507
+ e.errorMessage ? (t(), s("p", {
508
+ key: 0,
509
+ id: `${o.value}-error`,
510
+ class: "dm-time-picker__error",
511
+ role: "alert"
512
+ }, g(e.errorMessage), 9, ha)) : e.successMessage ? (t(), s("p", {
513
+ key: 1,
514
+ id: `${o.value}-success`,
515
+ class: "dm-time-picker__success"
516
+ }, g(e.successMessage), 9, ba)) : e.helperText ? (t(), s("p", {
517
+ key: 2,
518
+ id: `${o.value}-helper`,
519
+ class: "dm-time-picker__helper"
520
+ }, g(e.helperText), 9, pa)) : f("", !0)
521
+ ])) : f("", !0)
522
+ ], 2));
523
+ }
524
+ }), es = /* @__PURE__ */ S(ga, [["__scopeId", "data-v-89e8ad3a"]]), _a = {
525
+ key: 0,
526
+ class: "dm-slider__header"
527
+ }, ka = ["for"], ya = {
528
+ key: 0,
529
+ class: "dm-slider__required",
530
+ "aria-label": "obrigatório"
531
+ }, $a = {
532
+ key: 1,
533
+ class: "dm-slider__value"
534
+ }, wa = { class: "dm-slider__wrapper" }, xa = ["id", "value", "min", "max", "step", "disabled", "required", "aria-label", "aria-describedby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext"], Va = {
535
+ key: 1,
536
+ class: "dm-slider__range"
537
+ }, Da = { class: "dm-slider__min" }, Ma = { class: "dm-slider__max" }, Ca = {
538
+ key: 2,
539
+ class: "dm-slider__messages"
540
+ }, Ia = ["id"], Ba = ["id"], Ta = /* @__PURE__ */ E({
541
+ __name: "DatametriaSlider",
542
+ props: {
543
+ modelValue: {},
544
+ min: { default: 0 },
545
+ max: { default: 100 },
546
+ step: { default: 1 },
547
+ label: {},
548
+ disabled: { type: Boolean },
549
+ required: { type: Boolean },
550
+ showValue: { type: Boolean, default: !0 },
551
+ showMinMax: { type: Boolean, default: !1 },
552
+ errorMessage: {},
553
+ helperText: {},
554
+ ariaLabel: {},
555
+ formatter: {}
556
+ },
557
+ emits: ["update:modelValue", "change", "input", "focus", "blur"],
558
+ setup(e, { expose: i, emit: n }) {
559
+ const a = e, l = n, r = V(), o = V(!1), u = B(() => `dm-slider-${Math.random().toString(36).substr(2, 9)}`), m = B(() => {
560
+ const x = a.max - a.min;
561
+ return (a.modelValue - a.min) / x * 100;
562
+ }), b = B(() => a.formatter ? a.formatter(a.modelValue) : a.modelValue.toString()), k = B(() => {
563
+ const x = [];
564
+ return a.errorMessage ? x.push(`${u.value}-error`) : a.helperText && x.push(`${u.value}-helper`), x.length > 0 ? x.join(" ") : void 0;
565
+ }), M = B(() => a.formatter ? a.formatter(a.modelValue) : `${a.modelValue}`), T = (x) => a.formatter ? a.formatter(x) : x.toString(), $ = (x) => {
566
+ const q = x.target, D = parseFloat(q.value);
567
+ l("update:modelValue", D), l("input", D);
568
+ }, C = (x) => {
569
+ const q = x.target, D = parseFloat(q.value);
570
+ l("change", D);
571
+ }, h = (x) => {
572
+ l("focus", x);
573
+ }, p = (x) => {
574
+ l("blur", x);
575
+ }, w = (x) => {
576
+ if (a.disabled) return;
577
+ const D = x.currentTarget.getBoundingClientRect(), N = (x.clientX - D.left) / D.width, O = a.max - a.min, d = a.min + N * O, c = Math.round(d / a.step) * a.step, y = Math.max(a.min, Math.min(a.max, c));
578
+ l("update:modelValue", y), l("change", y);
579
+ }, z = (x) => {
580
+ if (a.disabled) return;
581
+ o.value = !0, x.preventDefault();
582
+ const q = (N) => {
583
+ if (!o.value) return;
584
+ const O = x.target.parentElement;
585
+ if (!O) return;
586
+ const d = O.getBoundingClientRect(), c = Math.max(0, Math.min(1, (N.clientX - d.left) / d.width)), y = a.max - a.min, _ = a.min + c * y, I = Math.round(_ / a.step) * a.step, Q = Math.max(a.min, Math.min(a.max, I));
587
+ l("update:modelValue", Q), l("input", Q);
588
+ }, D = () => {
589
+ o.value && (o.value = !1, l("change", a.modelValue)), document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", D);
590
+ };
591
+ document.addEventListener("mousemove", q), document.addEventListener("mouseup", D);
592
+ }, F = (x) => {
593
+ if (a.disabled) return;
594
+ o.value = !0, x.preventDefault();
595
+ const q = (N) => {
596
+ if (!o.value) return;
597
+ const O = x.target.parentElement;
598
+ if (!O) return;
599
+ const d = O.getBoundingClientRect(), c = N.touches[0], y = Math.max(0, Math.min(1, (c.clientX - d.left) / d.width)), _ = a.max - a.min, I = a.min + y * _, Q = Math.round(I / a.step) * a.step, de = Math.max(a.min, Math.min(a.max, Q));
600
+ l("update:modelValue", de), l("input", de);
601
+ }, D = () => {
602
+ o.value && (o.value = !1, l("change", a.modelValue)), document.removeEventListener("touchmove", q), document.removeEventListener("touchend", D);
603
+ };
604
+ document.addEventListener("touchmove", q), document.addEventListener("touchend", D);
605
+ };
606
+ return i({
607
+ focus: () => {
608
+ Y(() => {
609
+ var x;
610
+ (x = r.value) == null || x.focus();
611
+ });
612
+ },
613
+ blur: () => {
614
+ var x;
615
+ (x = r.value) == null || x.blur();
616
+ },
617
+ inputRef: r
618
+ }), (x, q) => (t(), s("div", {
619
+ class: L(["dm-slider", { "dm-slider--disabled": e.disabled }])
620
+ }, [
621
+ e.label || e.showValue ? (t(), s("div", _a, [
622
+ e.label ? (t(), s("label", {
623
+ key: 0,
624
+ for: u.value,
625
+ class: "dm-slider__label"
626
+ }, [
627
+ A(g(e.label) + " ", 1),
628
+ e.required ? (t(), s("span", ya, "*")) : f("", !0)
629
+ ], 8, ka)) : f("", !0),
630
+ e.showValue ? (t(), s("span", $a, g(b.value), 1)) : f("", !0)
631
+ ])) : f("", !0),
632
+ v("div", wa, [
633
+ v("div", {
634
+ class: "dm-slider__track",
635
+ onClick: w
636
+ }, [
637
+ v("div", {
638
+ class: "dm-slider__progress",
639
+ style: X({ width: `${m.value}%` })
640
+ }, null, 4),
641
+ v("div", {
642
+ class: "dm-slider__thumb",
643
+ style: X({ left: `${m.value}%` }),
644
+ onMousedown: z,
645
+ onTouchstart: F
646
+ }, null, 36)
647
+ ]),
648
+ v("input", {
649
+ id: u.value,
650
+ ref_key: "inputRef",
651
+ ref: r,
652
+ type: "range",
653
+ class: "dm-slider__input",
654
+ value: e.modelValue,
655
+ min: e.min,
656
+ max: e.max,
657
+ step: e.step,
658
+ disabled: e.disabled,
659
+ required: e.required,
660
+ "aria-label": e.ariaLabel,
661
+ "aria-describedby": k.value,
662
+ "aria-valuemin": e.min,
663
+ "aria-valuemax": e.max,
664
+ "aria-valuenow": e.modelValue,
665
+ "aria-valuetext": M.value,
666
+ onInput: $,
667
+ onChange: C,
668
+ onFocus: h,
669
+ onBlur: p
670
+ }, null, 40, xa)
671
+ ]),
672
+ e.showMinMax ? (t(), s("div", Va, [
673
+ v("span", Da, g(T(e.min)), 1),
674
+ v("span", Ma, g(T(e.max)), 1)
675
+ ])) : f("", !0),
676
+ e.errorMessage || e.helperText ? (t(), s("div", Ca, [
677
+ e.errorMessage ? (t(), s("p", {
678
+ key: 0,
679
+ id: `${u.value}-error`,
680
+ class: "dm-slider__error",
681
+ role: "alert"
682
+ }, g(e.errorMessage), 9, Ia)) : e.helperText ? (t(), s("p", {
683
+ key: 1,
684
+ id: `${u.value}-helper`,
685
+ class: "dm-slider__helper"
686
+ }, g(e.helperText), 9, Ba)) : f("", !0)
687
+ ])) : f("", !0)
688
+ ], 2));
689
+ }
690
+ }), as = /* @__PURE__ */ S(Ta, [["__scopeId", "data-v-8a957612"]]), La = { class: "dm-file-upload" }, Ea = {
383
691
  key: 0,
384
692
  class: "dm-file-upload__label"
385
- }, He = {
693
+ }, Sa = {
386
694
  key: 0,
387
695
  class: "dm-file-upload__required"
388
- }, Je = ["accept", "multiple", "disabled", "required"], We = { class: "dm-file-upload__content" }, Ye = {
696
+ }, qa = ["accept", "multiple", "disabled", "required"], Ra = { class: "dm-file-upload__content" }, za = {
389
697
  key: 0,
390
698
  class: "dm-file-upload__hint"
391
- }, Qe = {
699
+ }, Na = {
392
700
  key: 1,
393
701
  class: "dm-file-upload__files"
394
- }, Xe = { class: "dm-file-upload__filename" }, Ze = { class: "dm-file-upload__filesize" }, ea = ["onClick"], aa = {
702
+ }, Oa = { class: "dm-file-upload__filename" }, Fa = { class: "dm-file-upload__filesize" }, Aa = ["onClick"], ja = {
395
703
  key: 2,
396
704
  class: "dm-file-upload__error"
397
- }, ta = /* @__PURE__ */ f({
705
+ }, Pa = /* @__PURE__ */ E({
398
706
  __name: "DatametriaFileUpload",
399
707
  props: {
400
708
  modelValue: { default: () => [] },
@@ -406,104 +714,104 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
406
714
  error: {}
407
715
  },
408
716
  emits: ["update:modelValue"],
409
- setup(e, { emit: l }) {
410
- const s = e, o = l, r = k(), d = k(s.modelValue), n = k(!1), u = () => {
411
- var g;
412
- s.disabled || (g = r.value) == null || g.click();
413
- }, b = (g) => {
414
- const V = Array.from(g.target.files || []);
415
- I(V);
416
- }, h = () => {
417
- s.disabled || (n.value = !0);
418
- }, v = () => {
419
- n.value = !1;
420
- }, D = (g) => {
421
- var V;
422
- if (n.value = !1, !s.disabled) {
423
- const $ = Array.from(((V = g.dataTransfer) == null ? void 0 : V.files) || []);
424
- I($);
717
+ setup(e, { emit: i }) {
718
+ const n = e, a = i, l = V(), r = V(n.modelValue), o = V(!1), u = () => {
719
+ var h;
720
+ n.disabled || (h = l.value) == null || h.click();
721
+ }, m = (h) => {
722
+ const p = Array.from(h.target.files || []);
723
+ T(p);
724
+ }, b = () => {
725
+ n.disabled || (o.value = !0);
726
+ }, k = () => {
727
+ o.value = !1;
728
+ }, M = (h) => {
729
+ var p;
730
+ if (o.value = !1, !n.disabled) {
731
+ const w = Array.from(((p = h.dataTransfer) == null ? void 0 : p.files) || []);
732
+ T(w);
425
733
  }
426
- }, I = (g) => {
427
- d.value = s.multiple ? [...d.value, ...g] : g, o("update:modelValue", d.value);
428
- }, x = (g) => {
429
- d.value.splice(g, 1), o("update:modelValue", d.value);
430
- }, O = (g) => {
431
- if (g === 0) return "0 B";
432
- const V = 1024, $ = ["B", "KB", "MB", "GB"], M = Math.floor(Math.log(g) / Math.log(V));
433
- return `${(g / Math.pow(V, M)).toFixed(1)} ${$[M]}`;
734
+ }, T = (h) => {
735
+ r.value = n.multiple ? [...r.value, ...h] : h, a("update:modelValue", r.value);
736
+ }, $ = (h) => {
737
+ r.value.splice(h, 1), a("update:modelValue", r.value);
738
+ }, C = (h) => {
739
+ if (h === 0) return "0 B";
740
+ const p = 1024, w = ["B", "KB", "MB", "GB"], z = Math.floor(Math.log(h) / Math.log(p));
741
+ return `${(h / Math.pow(p, z)).toFixed(1)} ${w[z]}`;
434
742
  };
435
- return (g, V) => (a(), t("div", je, [
436
- e.label ? (a(), t("label", Ge, [
437
- w(m(e.label) + " ", 1),
438
- e.required ? (a(), t("span", He, "*")) : c("", !0)
439
- ])) : c("", !0),
440
- i("div", {
441
- class: y(["dm-file-upload__dropzone", { "dm-file-upload--dragging": n.value, "dm-file-upload__dropzone--dragover": n.value, "dm-file-upload__dropzone--error": e.error }]),
442
- onDragover: S(h, ["prevent"]),
443
- onDragleave: S(v, ["prevent"]),
444
- onDrop: S(D, ["prevent"]),
743
+ return (h, p) => (t(), s("div", La, [
744
+ e.label ? (t(), s("label", Ea, [
745
+ A(g(e.label) + " ", 1),
746
+ e.required ? (t(), s("span", Sa, "*")) : f("", !0)
747
+ ])) : f("", !0),
748
+ v("div", {
749
+ class: L(["dm-file-upload__dropzone", { "dm-file-upload--dragging": o.value, "dm-file-upload__dropzone--dragover": o.value, "dm-file-upload__dropzone--error": e.error }]),
750
+ onDragover: Z(b, ["prevent"]),
751
+ onDragleave: Z(k, ["prevent"]),
752
+ onDrop: Z(M, ["prevent"]),
445
753
  onClick: u
446
754
  }, [
447
- i("input", {
755
+ v("input", {
448
756
  ref_key: "fileInput",
449
- ref: r,
757
+ ref: l,
450
758
  type: "file",
451
759
  class: "dm-file-upload__input",
452
760
  accept: e.accept,
453
761
  multiple: e.multiple,
454
762
  disabled: e.disabled,
455
763
  required: e.required,
456
- onChange: b
457
- }, null, 40, Je),
458
- i("div", We, [
459
- V[0] || (V[0] = i("svg", {
764
+ onChange: m
765
+ }, null, 40, qa),
766
+ v("div", Ra, [
767
+ p[0] || (p[0] = v("svg", {
460
768
  class: "dm-file-upload__icon",
461
769
  viewBox: "0 0 24 24",
462
770
  fill: "none",
463
771
  stroke: "currentColor"
464
772
  }, [
465
- i("path", {
773
+ v("path", {
466
774
  d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",
467
775
  "stroke-width": "2",
468
776
  "stroke-linecap": "round",
469
777
  "stroke-linejoin": "round"
470
778
  })
471
779
  ], -1)),
472
- V[1] || (V[1] = i("p", { class: "dm-file-upload__text" }, [
473
- i("span", { class: "dm-file-upload__text--primary" }, "Clique para selecionar"),
474
- w(" ou arraste arquivos aqui ")
780
+ p[1] || (p[1] = v("p", { class: "dm-file-upload__text" }, [
781
+ v("span", { class: "dm-file-upload__text--primary" }, "Clique para selecionar"),
782
+ A(" ou arraste arquivos aqui ")
475
783
  ], -1)),
476
- e.accept ? (a(), t("p", Ye, m(e.accept), 1)) : c("", !0)
784
+ e.accept ? (t(), s("p", za, g(e.accept), 1)) : f("", !0)
477
785
  ])
478
786
  ], 34),
479
- d.value.length ? (a(), t("div", Qe, [
480
- (a(!0), t(B, null, L(d.value, ($, M) => (a(), t("div", {
481
- key: M,
787
+ r.value.length ? (t(), s("div", Na, [
788
+ (t(!0), s(U, null, K(r.value, (w, z) => (t(), s("div", {
789
+ key: z,
482
790
  class: "dm-file-upload__file"
483
791
  }, [
484
- i("span", Xe, m($.name), 1),
485
- i("span", Ze, m(O($.size)), 1),
486
- i("button", {
792
+ v("span", Oa, g(w.name), 1),
793
+ v("span", Fa, g(C(w.size)), 1),
794
+ v("button", {
487
795
  type: "button",
488
796
  class: "dm-file-upload__remove",
489
- onClick: (z) => x(M),
797
+ onClick: (F) => $(z),
490
798
  "aria-label": "Remover arquivo"
491
- }, "×", 8, ea)
799
+ }, "×", 8, Aa)
492
800
  ]))), 128))
493
- ])) : c("", !0),
494
- e.error ? (a(), t("p", aa, m(e.error), 1)) : c("", !0)
801
+ ])) : f("", !0),
802
+ e.error ? (t(), s("p", ja, g(e.error), 1)) : f("", !0)
495
803
  ]));
496
804
  }
497
- }), Kt = /* @__PURE__ */ _(ta, [["__scopeId", "data-v-da137679"]]), la = {
805
+ }), ts = /* @__PURE__ */ S(Pa, [["__scopeId", "data-v-da137679"]]), Ua = {
498
806
  key: 0,
499
807
  class: "dm-autocomplete__required"
500
- }, sa = { class: "dm-autocomplete__wrapper" }, ra = ["placeholder", "disabled", "required", "aria-label", "aria-expanded", "aria-controls", "aria-activedescendant"], da = ["id"], oa = ["id", "aria-selected", "onClick", "onMouseenter"], ia = {
808
+ }, Wa = { class: "dm-autocomplete__wrapper" }, Ka = ["placeholder", "disabled", "required", "aria-label", "aria-expanded", "aria-controls", "aria-activedescendant"], Xa = ["id"], Ha = ["id", "aria-selected", "onClick", "onMouseenter"], Ga = {
501
809
  key: 1,
502
810
  class: "dm-autocomplete__no-results"
503
- }, na = {
811
+ }, Ya = {
504
812
  key: 1,
505
813
  class: "dm-autocomplete__error"
506
- }, ca = /* @__PURE__ */ f({
814
+ }, Ja = /* @__PURE__ */ E({
507
815
  __name: "DatametriaAutocomplete",
508
816
  props: {
509
817
  modelValue: { default: "" },
@@ -516,148 +824,148 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
516
824
  ariaLabel: {}
517
825
  },
518
826
  emits: ["update:modelValue"],
519
- setup(e, { emit: l }) {
520
- const s = e, o = l, r = `dm-autocomplete-${Math.random().toString(36).substr(2, 9)}`, d = k(), n = k(s.modelValue), u = k(!1), b = k(-1), h = C(() => n.value ? s.options.filter(
521
- ($) => $.toLowerCase().includes(n.value.toLowerCase())
522
- ) : s.options), v = C(
523
- () => b.value >= 0 ? `${r}-option-${b.value}` : void 0
827
+ setup(e, { emit: i }) {
828
+ const n = e, a = i, l = `dm-autocomplete-${Math.random().toString(36).substr(2, 9)}`, r = V(), o = V(n.modelValue), u = V(!1), m = V(-1), b = B(() => o.value ? n.options.filter(
829
+ (w) => w.toLowerCase().includes(o.value.toLowerCase())
830
+ ) : n.options), k = B(
831
+ () => m.value >= 0 ? `${l}-option-${m.value}` : void 0
524
832
  );
525
- T(() => s.modelValue, ($) => {
526
- n.value = $;
833
+ H(() => n.modelValue, (w) => {
834
+ o.value = w;
527
835
  });
528
- const D = () => {
529
- u.value = !0, b.value = -1, o("update:modelValue", n.value);
530
- }, I = () => {
531
- s.disabled || (u.value = !0);
532
- }, x = () => {
836
+ const M = () => {
837
+ u.value = !0, m.value = -1, a("update:modelValue", o.value);
838
+ }, T = () => {
839
+ n.disabled || (u.value = !0);
840
+ }, $ = () => {
533
841
  setTimeout(() => {
534
842
  u.value = !1;
535
843
  }, 200);
536
- }, O = ($) => {
537
- n.value = $, o("update:modelValue", $), u.value = !1, b.value = -1;
538
- }, g = ($) => {
539
- if (!u.value && $.key !== "Escape") {
844
+ }, C = (w) => {
845
+ o.value = w, a("update:modelValue", w), u.value = !1, m.value = -1;
846
+ }, h = (w) => {
847
+ if (!u.value && w.key !== "Escape") {
540
848
  u.value = !0;
541
849
  return;
542
850
  }
543
- switch ($.key) {
851
+ switch (w.key) {
544
852
  case "ArrowDown":
545
- $.preventDefault(), b.value = Math.min(b.value + 1, h.value.length - 1);
853
+ w.preventDefault(), m.value = Math.min(m.value + 1, b.value.length - 1);
546
854
  break;
547
855
  case "ArrowUp":
548
- $.preventDefault(), b.value = Math.max(b.value - 1, 0);
856
+ w.preventDefault(), m.value = Math.max(m.value - 1, 0);
549
857
  break;
550
858
  case "Enter":
551
- $.preventDefault(), b.value >= 0 && O(h.value[b.value]);
859
+ w.preventDefault(), m.value >= 0 && C(b.value[m.value]);
552
860
  break;
553
861
  case "Escape":
554
- u.value = !1, b.value = -1;
862
+ u.value = !1, m.value = -1;
555
863
  break;
556
864
  }
557
- }, V = ($) => {
558
- d.value && !d.value.contains($.target) && (u.value = !1);
865
+ }, p = (w) => {
866
+ r.value && !r.value.contains(w.target) && (u.value = !1);
559
867
  };
560
- return P(() => {
561
- document.addEventListener("click", V);
562
- }), X(() => {
563
- document.removeEventListener("click", V);
564
- }), ($, M) => (a(), t("div", {
868
+ return J(() => {
869
+ document.addEventListener("click", p);
870
+ }), ie(() => {
871
+ document.removeEventListener("click", p);
872
+ }), (w, z) => (t(), s("div", {
565
873
  class: "dm-autocomplete",
566
874
  ref_key: "autocompleteRef",
567
- ref: d
875
+ ref: r
568
876
  }, [
569
- e.label ? (a(), t("label", {
877
+ e.label ? (t(), s("label", {
570
878
  key: 0,
571
- for: r,
879
+ for: l,
572
880
  class: "dm-autocomplete__label"
573
881
  }, [
574
- w(m(e.label) + " ", 1),
575
- e.required ? (a(), t("span", la, "*")) : c("", !0)
576
- ])) : c("", !0),
577
- i("div", sa, [
578
- N(i("input", {
579
- id: r,
580
- "onUpdate:modelValue": M[0] || (M[0] = (z) => n.value = z),
882
+ A(g(e.label) + " ", 1),
883
+ e.required ? (t(), s("span", Ua, "*")) : f("", !0)
884
+ ])) : f("", !0),
885
+ v("div", Wa, [
886
+ re(v("input", {
887
+ id: l,
888
+ "onUpdate:modelValue": z[0] || (z[0] = (F) => o.value = F),
581
889
  type: "text",
582
- class: y(["dm-autocomplete__input", { "dm-autocomplete__input--error": e.error }]),
890
+ class: L(["dm-autocomplete__input", { "dm-autocomplete__input--error": e.error }]),
583
891
  placeholder: e.placeholder,
584
892
  disabled: e.disabled,
585
893
  required: e.required,
586
894
  "aria-label": e.ariaLabel,
587
895
  "aria-expanded": u.value,
588
- "aria-controls": `${r}-listbox`,
589
- "aria-activedescendant": v.value,
896
+ "aria-controls": `${l}-listbox`,
897
+ "aria-activedescendant": k.value,
590
898
  role: "combobox",
591
899
  autocomplete: "off",
592
- onInput: D,
593
- onFocus: I,
594
- onBlur: x,
595
- onKeydown: g
596
- }, null, 42, ra), [
597
- [R, n.value]
900
+ onInput: M,
901
+ onFocus: T,
902
+ onBlur: $,
903
+ onKeydown: h
904
+ }, null, 42, Ka), [
905
+ [ne, o.value]
598
906
  ]),
599
- u.value && h.value.length ? (a(), t("ul", {
907
+ u.value && b.value.length ? (t(), s("ul", {
600
908
  key: 0,
601
- id: `${r}-listbox`,
909
+ id: `${l}-listbox`,
602
910
  class: "dm-autocomplete__dropdown",
603
911
  role: "listbox"
604
912
  }, [
605
- (a(!0), t(B, null, L(h.value, (z, E) => (a(), t("li", {
606
- key: E,
607
- id: `${r}-option-${E}`,
608
- class: y(["dm-autocomplete__option", { "dm-autocomplete__option--active": E === b.value }]),
913
+ (t(!0), s(U, null, K(b.value, (F, P) => (t(), s("li", {
914
+ key: P,
915
+ id: `${l}-option-${P}`,
916
+ class: L(["dm-autocomplete__option", { "dm-autocomplete__option--active": P === m.value }]),
609
917
  role: "option",
610
- "aria-selected": E === b.value,
611
- onClick: (Q) => O(z),
612
- onMouseenter: (Q) => b.value = E
613
- }, m(z), 43, oa))), 128))
614
- ], 8, da)) : u.value && !h.value.length ? (a(), t("div", ia, " No results ")) : c("", !0)
918
+ "aria-selected": P === m.value,
919
+ onClick: (W) => C(F),
920
+ onMouseenter: (W) => m.value = P
921
+ }, g(F), 43, Ha))), 128))
922
+ ], 8, Xa)) : u.value && !b.value.length ? (t(), s("div", Ga, " No results ")) : f("", !0)
615
923
  ]),
616
- e.error ? (a(), t("p", na, m(e.error), 1)) : c("", !0)
924
+ e.error ? (t(), s("p", Ya, g(e.error), 1)) : f("", !0)
617
925
  ], 512));
618
926
  }
619
- }), jt = /* @__PURE__ */ _(ca, [["__scopeId", "data-v-782dacde"]]), ua = {
927
+ }), ls = /* @__PURE__ */ S(Ja, [["__scopeId", "data-v-782dacde"]]), Qa = {
620
928
  key: 0,
621
929
  class: "datametria-card__header"
622
- }, ma = { class: "datametria-card__title" }, ba = { class: "datametria-card__content" }, va = {
930
+ }, Za = { class: "datametria-card__title" }, et = { class: "datametria-card__content" }, at = {
623
931
  key: 1,
624
932
  class: "datametria-card__footer"
625
- }, ha = /* @__PURE__ */ f({
933
+ }, tt = /* @__PURE__ */ E({
626
934
  __name: "DatametriaCard",
627
935
  props: {
628
936
  title: {},
629
937
  padding: { type: Boolean, default: !0 }
630
938
  },
631
939
  setup(e) {
632
- const l = e, s = C(() => [
940
+ const i = e, n = B(() => [
633
941
  "datametria-card",
634
942
  {
635
- "datametria-card--no-padding": !l.padding
943
+ "datametria-card--no-padding": !i.padding
636
944
  }
637
945
  ]);
638
- return (o, r) => (a(), t("div", {
639
- class: y(s.value)
946
+ return (a, l) => (t(), s("div", {
947
+ class: L(n.value)
640
948
  }, [
641
- e.title || o.$slots.header ? (a(), t("div", ua, [
642
- p(o.$slots, "header", {}, () => [
643
- i("h3", ma, m(e.title), 1)
949
+ e.title || a.$slots.header ? (t(), s("div", Qa, [
950
+ R(a.$slots, "header", {}, () => [
951
+ v("h3", Za, g(e.title), 1)
644
952
  ], !0)
645
- ])) : c("", !0),
646
- i("div", ba, [
647
- p(o.$slots, "default", {}, void 0, !0)
953
+ ])) : f("", !0),
954
+ v("div", et, [
955
+ R(a.$slots, "default", {}, void 0, !0)
648
956
  ]),
649
- o.$slots.footer ? (a(), t("div", va, [
650
- p(o.$slots, "footer", {}, void 0, !0)
651
- ])) : c("", !0)
957
+ a.$slots.footer ? (t(), s("div", at, [
958
+ R(a.$slots, "footer", {}, void 0, !0)
959
+ ])) : f("", !0)
652
960
  ], 2));
653
961
  }
654
- }), Gt = /* @__PURE__ */ _(ha, [["__scopeId", "data-v-539a1b0c"]]), fa = {
962
+ }), ss = /* @__PURE__ */ S(tt, [["__scopeId", "data-v-539a1b0c"]]), lt = {
655
963
  key: 0,
656
964
  class: "datametria-modal__header"
657
- }, _a = { class: "datametria-modal__title" }, $a = { class: "datametria-modal__body" }, ya = {
965
+ }, st = { class: "datametria-modal__title" }, it = { class: "datametria-modal__body" }, rt = {
658
966
  key: 1,
659
967
  class: "datametria-modal__footer"
660
- }, ka = /* @__PURE__ */ f({
968
+ }, nt = /* @__PURE__ */ E({
661
969
  __name: "DatametriaModal",
662
970
  props: {
663
971
  modelValue: { type: Boolean },
@@ -666,79 +974,79 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
666
974
  closable: { type: Boolean, default: !0 }
667
975
  },
668
976
  emits: ["update:modelValue", "close"],
669
- setup(e, { emit: l }) {
670
- const s = e, o = l, r = () => {
671
- s.closable && (o("update:modelValue", !1), o("close"));
977
+ setup(e, { emit: i }) {
978
+ const n = e, a = i, l = () => {
979
+ n.closable && (a("update:modelValue", !1), a("close"));
672
980
  };
673
- return (d, n) => (a(), K(j, { to: "body" }, [
674
- G(H, { name: "modal" }, {
675
- default: J(() => [
676
- e.modelValue ? (a(), t("div", {
981
+ return (r, o) => (t(), ee(ae, { to: "body" }, [
982
+ te(le, { name: "modal" }, {
983
+ default: se(() => [
984
+ e.modelValue ? (t(), s("div", {
677
985
  key: 0,
678
986
  class: "datametria-modal",
679
- onClick: S(r, ["self"])
987
+ onClick: Z(l, ["self"])
680
988
  }, [
681
- i("div", {
989
+ v("div", {
682
990
  class: "datametria-modal__content",
683
- style: A({ maxWidth: e.size })
991
+ style: X({ maxWidth: e.size })
684
992
  }, [
685
- e.title || d.$slots.header ? (a(), t("div", fa, [
686
- p(d.$slots, "header", {}, () => [
687
- i("h3", _a, m(e.title), 1)
993
+ e.title || r.$slots.header ? (t(), s("div", lt, [
994
+ R(r.$slots, "header", {}, () => [
995
+ v("h3", st, g(e.title), 1)
688
996
  ], !0),
689
- e.closable ? (a(), t("button", {
997
+ e.closable ? (t(), s("button", {
690
998
  key: 0,
691
999
  class: "datametria-modal__close",
692
- onClick: r
693
- }, " × ")) : c("", !0)
694
- ])) : c("", !0),
695
- i("div", $a, [
696
- p(d.$slots, "default", {}, void 0, !0)
1000
+ onClick: l
1001
+ }, " × ")) : f("", !0)
1002
+ ])) : f("", !0),
1003
+ v("div", it, [
1004
+ R(r.$slots, "default", {}, void 0, !0)
697
1005
  ]),
698
- d.$slots.footer ? (a(), t("div", ya, [
699
- p(d.$slots, "footer", {}, void 0, !0)
700
- ])) : c("", !0)
1006
+ r.$slots.footer ? (t(), s("div", rt, [
1007
+ R(r.$slots, "footer", {}, void 0, !0)
1008
+ ])) : f("", !0)
701
1009
  ], 4)
702
- ])) : c("", !0)
1010
+ ])) : f("", !0)
703
1011
  ]),
704
1012
  _: 3
705
1013
  })
706
1014
  ]));
707
1015
  }
708
- }), Ht = /* @__PURE__ */ _(ka, [["__scopeId", "data-v-8aa80965"]]), pa = /* @__PURE__ */ f({
1016
+ }), is = /* @__PURE__ */ S(nt, [["__scopeId", "data-v-8aa80965"]]), ot = /* @__PURE__ */ E({
709
1017
  __name: "DatametriaContainer",
710
1018
  props: {
711
1019
  size: { default: "lg" },
712
1020
  fluid: { type: Boolean, default: !1 }
713
1021
  },
714
1022
  setup(e) {
715
- return (l, s) => (a(), t("div", {
716
- class: y(["dm-container", [`dm-container--${e.size}`, { "dm-container--fluid": e.fluid }]])
1023
+ return (i, n) => (t(), s("div", {
1024
+ class: L(["dm-container", [`dm-container--${e.size}`, { "dm-container--fluid": e.fluid }]])
717
1025
  }, [
718
- p(l.$slots, "default", {}, void 0, !0)
1026
+ R(i.$slots, "default", {}, void 0, !0)
719
1027
  ], 2));
720
1028
  }
721
- }), Jt = /* @__PURE__ */ _(pa, [["__scopeId", "data-v-4cc8678e"]]), ga = /* @__PURE__ */ f({
1029
+ }), rs = /* @__PURE__ */ S(ot, [["__scopeId", "data-v-4cc8678e"]]), dt = /* @__PURE__ */ E({
722
1030
  __name: "DatametriaGrid",
723
1031
  props: {
724
1032
  cols: { default: 12 },
725
1033
  gap: { default: "var(--dm-space-4)" }
726
1034
  },
727
1035
  setup(e) {
728
- return (l, s) => (a(), t("div", {
1036
+ return (i, n) => (t(), s("div", {
729
1037
  class: "dm-grid",
730
- style: A({
1038
+ style: X({
731
1039
  "--dm-grid-cols": e.cols,
732
1040
  "--dm-grid-gap": e.gap
733
1041
  })
734
1042
  }, [
735
- p(l.$slots, "default", {}, void 0, !0)
1043
+ R(i.$slots, "default", {}, void 0, !0)
736
1044
  ], 4));
737
1045
  }
738
- }), Wt = /* @__PURE__ */ _(ga, [["__scopeId", "data-v-9e2c1279"]]), Da = ["role", "aria-orientation"], Va = {
1046
+ }), ns = /* @__PURE__ */ S(dt, [["__scopeId", "data-v-9e2c1279"]]), ct = ["role", "aria-orientation"], ut = {
739
1047
  key: 0,
740
1048
  class: "dm-divider__label"
741
- }, wa = /* @__PURE__ */ f({
1049
+ }, mt = /* @__PURE__ */ E({
742
1050
  __name: "DatametriaDivider",
743
1051
  props: {
744
1052
  orientation: { default: "horizontal" },
@@ -746,22 +1054,22 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
746
1054
  label: {}
747
1055
  },
748
1056
  setup(e) {
749
- return (l, s) => (a(), t("div", {
750
- class: y(["dm-divider", [`dm-divider--${e.orientation}`, { "dm-divider--dashed": e.dashed }]]),
1057
+ return (i, n) => (t(), s("div", {
1058
+ class: L(["dm-divider", [`dm-divider--${e.orientation}`, { "dm-divider--dashed": e.dashed }]]),
751
1059
  role: e.orientation === "horizontal" ? "separator" : void 0,
752
1060
  "aria-orientation": e.orientation
753
1061
  }, [
754
- l.$slots.default || e.label ? (a(), t("span", Va, [
755
- p(l.$slots, "default", {}, () => [
756
- w(m(e.label), 1)
1062
+ i.$slots.default || e.label ? (t(), s("span", ut, [
1063
+ R(i.$slots, "default", {}, () => [
1064
+ A(g(e.label), 1)
757
1065
  ], !0)
758
- ])) : c("", !0)
759
- ], 10, Da));
1066
+ ])) : f("", !0)
1067
+ ], 10, ct));
760
1068
  }
761
- }), Yt = /* @__PURE__ */ _(wa, [["__scopeId", "data-v-b0655e4c"]]), Ca = { class: "datametria-alert__icon" }, Ia = { key: 0 }, Ba = { key: 1 }, La = { key: 2 }, Ma = { key: 3 }, qa = { class: "datametria-alert__content" }, Ta = {
1069
+ }), os = /* @__PURE__ */ S(mt, [["__scopeId", "data-v-b0655e4c"]]), vt = { class: "datametria-alert__icon" }, ft = { key: 0 }, ht = { key: 1 }, bt = { key: 2 }, pt = { key: 3 }, gt = { class: "datametria-alert__content" }, _t = {
762
1070
  key: 0,
763
1071
  class: "datametria-alert__title"
764
- }, xa = { class: "datametria-alert__message" }, Sa = /* @__PURE__ */ f({
1072
+ }, kt = { class: "datametria-alert__message" }, yt = /* @__PURE__ */ E({
765
1073
  __name: "DatametriaAlert",
766
1074
  props: {
767
1075
  modelValue: { type: Boolean, default: !0 },
@@ -772,33 +1080,38 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
772
1080
  },
773
1081
  emits: ["update:modelValue"],
774
1082
  setup(e) {
775
- const l = e, s = C(() => [
1083
+ const i = e;
1084
+ if (process.env.NODE_ENV === "development") {
1085
+ const a = ["success", "error", "warning", "info", "primary"];
1086
+ a.includes(i.variant) || console.warn(`[DatametriaAlert] Invalid variant "${i.variant}". Valid options: ${a.join(", ")}`);
1087
+ }
1088
+ const n = B(() => [
776
1089
  "datametria-alert",
777
- `datametria-alert--${l.variant}`
1090
+ `datametria-alert--${i.variant}`
778
1091
  ]);
779
- return (o, r) => e.modelValue ? (a(), t("div", {
1092
+ return (a, l) => e.modelValue ? (t(), s("div", {
780
1093
  key: 0,
781
- class: y(s.value)
1094
+ class: L(n.value)
782
1095
  }, [
783
- i("div", Ca, [
784
- e.variant === "success" ? (a(), t("span", Ia, "✓")) : e.variant === "error" ? (a(), t("span", Ba, "✕")) : e.variant === "warning" ? (a(), t("span", La, "⚠")) : (a(), t("span", Ma, "ℹ"))
1096
+ v("div", vt, [
1097
+ e.variant === "success" ? (t(), s("span", ft, "✓")) : e.variant === "error" ? (t(), s("span", ht, "✕")) : e.variant === "warning" ? (t(), s("span", bt, "⚠")) : (t(), s("span", pt, "ℹ"))
785
1098
  ]),
786
- i("div", qa, [
787
- e.title ? (a(), t("h4", Ta, m(e.title), 1)) : c("", !0),
788
- i("p", xa, [
789
- p(o.$slots, "default", {}, () => [
790
- w(m(e.message), 1)
1099
+ v("div", gt, [
1100
+ e.title ? (t(), s("h4", _t, g(e.title), 1)) : f("", !0),
1101
+ v("p", kt, [
1102
+ R(a.$slots, "default", {}, () => [
1103
+ A(g(e.message), 1)
791
1104
  ], !0)
792
1105
  ])
793
1106
  ]),
794
- e.closable ? (a(), t("button", {
1107
+ e.closable ? (t(), s("button", {
795
1108
  key: 0,
796
1109
  class: "datametria-alert__close",
797
- onClick: r[0] || (r[0] = (d) => o.$emit("update:modelValue", !1))
798
- }, " × ")) : c("", !0)
799
- ], 2)) : c("", !0);
1110
+ onClick: l[0] || (l[0] = (r) => a.$emit("update:modelValue", !1))
1111
+ }, " × ")) : f("", !0)
1112
+ ], 2)) : f("", !0);
800
1113
  }
801
- }), Qt = /* @__PURE__ */ _(Sa, [["__scopeId", "data-v-a27dad03"]]), za = ["aria-live"], Ea = { class: "dm-toast__content" }, Aa = { class: "dm-toast__message" }, Oa = /* @__PURE__ */ f({
1114
+ }), ds = /* @__PURE__ */ S(yt, [["__scopeId", "data-v-8a7f7fad"]]), $t = ["aria-live"], wt = { class: "dm-toast__content" }, xt = { class: "dm-toast__message" }, Vt = /* @__PURE__ */ E({
802
1115
  __name: "DatametriaToast",
803
1116
  props: {
804
1117
  message: {},
@@ -808,52 +1121,259 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
808
1121
  modelValue: { type: Boolean, default: !1 }
809
1122
  },
810
1123
  emits: ["update:modelValue", "close"],
811
- setup(e, { emit: l }) {
812
- const s = e, o = l, r = k(s.modelValue);
813
- let d = null;
814
- T(() => s.modelValue, (b) => {
815
- r.value = b, b && s.duration > 0 && n();
1124
+ setup(e, { emit: i }) {
1125
+ const n = e;
1126
+ if (process.env.NODE_ENV === "development") {
1127
+ const m = ["success", "error", "warning", "info", "primary"];
1128
+ m.includes(n.variant) || console.warn(`[DatametriaToast] Invalid variant "${n.variant}". Valid options: ${m.join(", ")}`);
1129
+ }
1130
+ const a = i, l = V(n.modelValue);
1131
+ let r = null;
1132
+ H(() => n.modelValue, (m) => {
1133
+ l.value = m, m && n.duration > 0 && o();
816
1134
  });
817
- const n = () => {
818
- d && clearTimeout(d), d = setTimeout(() => {
1135
+ const o = () => {
1136
+ r && clearTimeout(r), r = setTimeout(() => {
819
1137
  u();
820
- }, s.duration);
1138
+ }, n.duration);
821
1139
  }, u = () => {
822
- r.value = !1, o("update:modelValue", !1), o("close"), d && clearTimeout(d);
1140
+ l.value = !1, a("update:modelValue", !1), a("close"), r && clearTimeout(r);
823
1141
  };
824
- return P(() => {
825
- r.value && s.duration > 0 && n();
826
- }), (b, h) => (a(), K(j, { to: "body" }, [
827
- G(H, { name: "dm-toast" }, {
828
- default: J(() => [
829
- r.value ? (a(), t("div", {
1142
+ return J(() => {
1143
+ l.value && n.duration > 0 && o();
1144
+ }), (m, b) => (t(), ee(ae, { to: "body" }, [
1145
+ te(le, { name: "dm-toast" }, {
1146
+ default: se(() => [
1147
+ l.value ? (t(), s("div", {
830
1148
  key: 0,
831
- class: y(["dm-toast", `dm-toast--${e.variant}`]),
1149
+ class: L(["dm-toast", `dm-toast--${e.variant}`]),
832
1150
  role: "alert",
833
1151
  "aria-live": e.variant === "error" ? "assertive" : "polite"
834
1152
  }, [
835
- i("div", Ea, [
836
- i("span", Aa, m(e.message), 1),
837
- e.closable ? (a(), t("button", {
1153
+ v("div", wt, [
1154
+ v("span", xt, g(e.message), 1),
1155
+ e.closable ? (t(), s("button", {
838
1156
  key: 0,
839
1157
  class: "dm-toast__close",
840
1158
  onClick: u,
841
1159
  "aria-label": "Fechar"
842
- }, "×")) : c("", !0)
1160
+ }, "×")) : f("", !0)
843
1161
  ])
844
- ], 10, za)) : c("", !0)
1162
+ ], 10, $t)) : f("", !0)
845
1163
  ]),
846
1164
  _: 1
847
1165
  })
848
1166
  ]));
849
1167
  }
850
- }), Xt = /* @__PURE__ */ _(Oa, [["__scopeId", "data-v-f6096907"]]), Na = { class: "dm-progress" }, Ra = {
1168
+ }), cs = /* @__PURE__ */ S(Vt, [["__scopeId", "data-v-cc77063e"]]), Dt = ["id", "aria-hidden"], Mt = { class: "dm-tooltip__content" }, Ct = {
1169
+ key: 0,
1170
+ class: "dm-tooltip__arrow"
1171
+ }, It = /* @__PURE__ */ E({
1172
+ __name: "DatametriaTooltip",
1173
+ props: {
1174
+ content: {},
1175
+ placement: { default: "top" },
1176
+ variant: { default: "dark" },
1177
+ trigger: { default: "hover" },
1178
+ disabled: { type: Boolean },
1179
+ showArrow: { type: Boolean, default: !0 },
1180
+ delay: { default: 100 },
1181
+ hideDelay: { default: 100 },
1182
+ offset: { default: 8 },
1183
+ maxWidth: { default: "200px" }
1184
+ },
1185
+ emits: ["show", "hide"],
1186
+ setup(e, { expose: i, emit: n }) {
1187
+ const a = e, l = n, r = V(), o = V(), u = V(!1), m = V(), b = V(), k = B(() => `dm-tooltip-${Math.random().toString(36).substr(2, 9)}`), M = V({}), T = async () => {
1188
+ if (!r.value || !o.value) return;
1189
+ await Y();
1190
+ const D = r.value.getBoundingClientRect(), N = o.value.getBoundingClientRect(), O = {
1191
+ width: window.innerWidth,
1192
+ height: window.innerHeight
1193
+ };
1194
+ let d = 0, c = 0;
1195
+ switch (a.placement) {
1196
+ case "top":
1197
+ case "top-start":
1198
+ case "top-end":
1199
+ d = D.top - N.height - a.offset;
1200
+ break;
1201
+ case "bottom":
1202
+ case "bottom-start":
1203
+ case "bottom-end":
1204
+ d = D.bottom + a.offset;
1205
+ break;
1206
+ case "left":
1207
+ d = D.top + (D.height - N.height) / 2, c = D.left - N.width - a.offset;
1208
+ break;
1209
+ case "right":
1210
+ d = D.top + (D.height - N.height) / 2, c = D.right + a.offset;
1211
+ break;
1212
+ }
1213
+ if (a.placement.startsWith("top") || a.placement.startsWith("bottom"))
1214
+ switch (a.placement) {
1215
+ case "top":
1216
+ case "bottom":
1217
+ c = D.left + (D.width - N.width) / 2;
1218
+ break;
1219
+ case "top-start":
1220
+ case "bottom-start":
1221
+ c = D.left;
1222
+ break;
1223
+ case "top-end":
1224
+ case "bottom-end":
1225
+ c = D.right - N.width;
1226
+ break;
1227
+ }
1228
+ c < 0 ? c = 8 : c + N.width > O.width && (c = O.width - N.width - 8), d < 0 ? d = 8 : d + N.height > O.height && (d = O.height - N.height - 8), M.value = {
1229
+ position: "fixed",
1230
+ top: `${d}px`,
1231
+ left: `${c}px`,
1232
+ maxWidth: a.maxWidth,
1233
+ zIndex: "9999"
1234
+ };
1235
+ }, $ = () => {
1236
+ a.disabled || u.value || (clearTimeout(b.value), m.value = window.setTimeout(async () => {
1237
+ u.value = !0, l("show"), await T();
1238
+ }, a.delay));
1239
+ }, C = () => {
1240
+ clearTimeout(m.value), b.value = window.setTimeout(() => {
1241
+ u.value = !1, l("hide");
1242
+ }, a.hideDelay);
1243
+ }, h = () => {
1244
+ a.trigger === "hover" && $();
1245
+ }, p = () => {
1246
+ a.trigger === "hover" && C();
1247
+ }, w = () => {
1248
+ a.trigger === "focus" && $();
1249
+ }, z = () => {
1250
+ a.trigger === "focus" && C();
1251
+ }, F = () => {
1252
+ a.trigger === "click" && (u.value ? C() : $());
1253
+ }, P = () => {
1254
+ T();
1255
+ }, W = () => {
1256
+ M.value = {};
1257
+ }, x = () => {
1258
+ u.value && T();
1259
+ }, q = () => {
1260
+ u.value && T();
1261
+ };
1262
+ return J(() => {
1263
+ window.addEventListener("resize", x), window.addEventListener("scroll", q, !0);
1264
+ }), ie(() => {
1265
+ clearTimeout(m.value), clearTimeout(b.value), window.removeEventListener("resize", x), window.removeEventListener("scroll", q, !0);
1266
+ }), i({
1267
+ show: $,
1268
+ hide: C,
1269
+ isVisible: B(() => u.value)
1270
+ }), (D, N) => (t(), s("div", {
1271
+ ref_key: "triggerRef",
1272
+ ref: r,
1273
+ class: "dm-tooltip-trigger",
1274
+ onMouseenter: h,
1275
+ onMouseleave: p,
1276
+ onFocus: w,
1277
+ onBlur: z,
1278
+ onClick: F
1279
+ }, [
1280
+ R(D.$slots, "default", {}, void 0, !0),
1281
+ (t(), ee(ae, { to: "body" }, [
1282
+ te(le, {
1283
+ name: "tooltip",
1284
+ onEnter: P,
1285
+ onLeave: W
1286
+ }, {
1287
+ default: se(() => [
1288
+ u.value ? (t(), s("div", {
1289
+ key: 0,
1290
+ ref_key: "tooltipRef",
1291
+ ref: o,
1292
+ id: k.value,
1293
+ class: L(["dm-tooltip", [
1294
+ `dm-tooltip--${e.placement}`,
1295
+ `dm-tooltip--${e.variant}`,
1296
+ { "dm-tooltip--arrow": e.showArrow }
1297
+ ]]),
1298
+ style: X(M.value),
1299
+ role: "tooltip",
1300
+ "aria-hidden": !u.value
1301
+ }, [
1302
+ v("div", Mt, [
1303
+ R(D.$slots, "content", {}, () => [
1304
+ A(g(e.content), 1)
1305
+ ], !0)
1306
+ ]),
1307
+ e.showArrow ? (t(), s("div", Ct)) : f("", !0)
1308
+ ], 14, Dt)) : f("", !0)
1309
+ ]),
1310
+ _: 3
1311
+ })
1312
+ ]))
1313
+ ], 544));
1314
+ }
1315
+ }), us = /* @__PURE__ */ S(It, [["__scopeId", "data-v-130ed64e"]]), Bt = ["aria-label"], Tt = {
1316
+ key: 0,
1317
+ class: "datametria-skeleton__text"
1318
+ }, Lt = {
1319
+ key: 1,
1320
+ class: "datametria-skeleton__avatar shimmer"
1321
+ }, Et = {
1322
+ key: 2,
1323
+ class: "datametria-skeleton__card"
1324
+ }, St = {
1325
+ key: 3,
1326
+ class: "datametria-skeleton__button shimmer"
1327
+ }, qt = {
1328
+ key: 4,
1329
+ class: "datametria-skeleton__custom shimmer"
1330
+ }, Rt = /* @__PURE__ */ E({
1331
+ __name: "DatametriaSkeleton",
1332
+ props: {
1333
+ variant: { default: "text" },
1334
+ width: {},
1335
+ height: {},
1336
+ lines: { default: 3 },
1337
+ animated: { type: Boolean, default: !0 },
1338
+ ariaLabel: { default: "Carregando conteúdo..." },
1339
+ lastLineWidth: { default: 75 }
1340
+ },
1341
+ setup(e) {
1342
+ const i = e, n = B(() => {
1343
+ const l = {};
1344
+ return i.width && (l.width = typeof i.width == "number" ? `${i.width}px` : i.width), i.height && (l.height = typeof i.height == "number" ? `${i.height}px` : i.height), l;
1345
+ }), a = (l) => ({
1346
+ width: l === i.lines ? `${i.lastLineWidth}%` : "100%",
1347
+ marginBottom: l < i.lines ? "0.5rem" : "0"
1348
+ });
1349
+ return (l, r) => (t(), s("div", {
1350
+ class: L(["datametria-skeleton", [
1351
+ `datametria-skeleton--${e.variant}`,
1352
+ { "datametria-skeleton--animated": e.animated }
1353
+ ]]),
1354
+ style: X(n.value),
1355
+ "aria-label": e.ariaLabel,
1356
+ role: "status",
1357
+ "aria-live": "polite"
1358
+ }, [
1359
+ e.variant === "text" ? (t(), s("div", Tt, [
1360
+ (t(!0), s(U, null, K(e.lines, (o) => (t(), s("div", {
1361
+ key: o,
1362
+ class: "datametria-skeleton__line shimmer",
1363
+ style: X(a(o))
1364
+ }, null, 4))), 128))
1365
+ ])) : e.variant === "avatar" ? (t(), s("div", Lt)) : e.variant === "card" ? (t(), s("div", Et, [...r[0] || (r[0] = [
1366
+ ve('<div class="datametria-skeleton__card-header shimmer" data-v-1bc144db></div><div class="datametria-skeleton__card-content" data-v-1bc144db><div class="datametria-skeleton__line shimmer" style="width:100%;" data-v-1bc144db></div><div class="datametria-skeleton__line shimmer" style="width:80%;" data-v-1bc144db></div><div class="datametria-skeleton__line shimmer" style="width:60%;" data-v-1bc144db></div></div>', 2)
1367
+ ])])) : e.variant === "button" ? (t(), s("div", St)) : (t(), s("div", qt))
1368
+ ], 14, Bt));
1369
+ }
1370
+ }), ms = /* @__PURE__ */ S(Rt, [["__scopeId", "data-v-1bc144db"]]), zt = { class: "dm-progress" }, Nt = {
851
1371
  key: 0,
852
1372
  class: "dm-progress__header"
853
- }, Ua = { class: "dm-progress__label" }, Fa = {
1373
+ }, Ot = { class: "dm-progress__label" }, Ft = {
854
1374
  key: 0,
855
1375
  class: "dm-progress__value"
856
- }, Pa = ["aria-valuenow", "aria-label"], Ka = /* @__PURE__ */ f({
1376
+ }, At = ["aria-valuenow", "aria-label"], jt = /* @__PURE__ */ E({
857
1377
  __name: "DatametriaProgress",
858
1378
  props: {
859
1379
  value: {},
@@ -863,13 +1383,13 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
863
1383
  ariaLabel: {}
864
1384
  },
865
1385
  setup(e) {
866
- const l = e, s = C(() => Math.min(Math.max(l.value, 0), 100));
867
- return (o, r) => (a(), t("div", Na, [
868
- e.label ? (a(), t("div", Ra, [
869
- i("span", Ua, m(e.label), 1),
870
- e.showValue ? (a(), t("span", Fa, m(e.value) + "%", 1)) : c("", !0)
871
- ])) : c("", !0),
872
- i("div", {
1386
+ const i = e, n = B(() => Math.min(Math.max(i.value, 0), 100));
1387
+ return (a, l) => (t(), s("div", zt, [
1388
+ e.label ? (t(), s("div", Nt, [
1389
+ v("span", Ot, g(e.label), 1),
1390
+ e.showValue ? (t(), s("span", Ft, g(e.value) + "%", 1)) : f("", !0)
1391
+ ])) : f("", !0),
1392
+ v("div", {
873
1393
  class: "dm-progress__track",
874
1394
  role: "progressbar",
875
1395
  "aria-valuenow": e.value,
@@ -877,17 +1397,17 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
877
1397
  "aria-valuemax": 100,
878
1398
  "aria-label": e.ariaLabel || e.label
879
1399
  }, [
880
- i("div", {
881
- class: y(["dm-progress__bar", `dm-progress__bar--${e.variant}`]),
882
- style: A({ width: `${s.value}%` })
1400
+ v("div", {
1401
+ class: L(["dm-progress__bar", `dm-progress__bar--${e.variant}`]),
1402
+ style: X({ width: `${n.value}%` })
883
1403
  }, null, 6)
884
- ], 8, Pa)
1404
+ ], 8, At)
885
1405
  ]));
886
1406
  }
887
- }), Zt = /* @__PURE__ */ _(Ka, [["__scopeId", "data-v-6c9ef263"]]), ja = ["aria-label"], Ga = {
1407
+ }), vs = /* @__PURE__ */ S(jt, [["__scopeId", "data-v-6c9ef263"]]), Pt = ["aria-label"], Ut = {
888
1408
  key: 0,
889
1409
  class: "dm-spinner__label"
890
- }, Ha = /* @__PURE__ */ f({
1410
+ }, Wt = /* @__PURE__ */ E({
891
1411
  __name: "DatametriaSpinner",
892
1412
  props: {
893
1413
  size: { default: "md" },
@@ -896,16 +1416,16 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
896
1416
  ariaLabel: { default: "Carregando" }
897
1417
  },
898
1418
  setup(e) {
899
- return (l, s) => (a(), t("div", {
900
- class: y(["dm-spinner", [`dm-spinner--${e.size}`, `dm-spinner--${e.variant}`]]),
1419
+ return (i, n) => (t(), s("div", {
1420
+ class: L(["dm-spinner", [`dm-spinner--${e.size}`, `dm-spinner--${e.variant}`]]),
901
1421
  role: "status",
902
1422
  "aria-label": e.ariaLabel
903
1423
  }, [
904
- s[0] || (s[0] = i("svg", {
1424
+ n[0] || (n[0] = v("svg", {
905
1425
  class: "dm-spinner__svg",
906
1426
  viewBox: "0 0 50 50"
907
1427
  }, [
908
- i("circle", {
1428
+ v("circle", {
909
1429
  class: "dm-spinner__circle",
910
1430
  cx: "25",
911
1431
  cy: "25",
@@ -914,60 +1434,60 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
914
1434
  "stroke-width": "4"
915
1435
  })
916
1436
  ], -1)),
917
- e.label ? (a(), t("span", Ga, m(e.label), 1)) : c("", !0)
918
- ], 10, ja));
1437
+ e.label ? (t(), s("span", Ut, g(e.label), 1)) : f("", !0)
1438
+ ], 10, Pt));
919
1439
  }
920
- }), el = /* @__PURE__ */ _(Ha, [["__scopeId", "data-v-013214f1"]]), Ja = { class: "datametria-table" }, Wa = { class: "datametria-table__table" }, Ya = { class: "datametria-table__thead" }, Qa = { class: "datametria-table__tbody" }, Xa = {
1440
+ }), fs = /* @__PURE__ */ S(Wt, [["__scopeId", "data-v-013214f1"]]), Kt = { class: "datametria-table" }, Xt = { class: "datametria-table__table" }, Ht = { class: "datametria-table__thead" }, Gt = { class: "datametria-table__tbody" }, Yt = {
921
1441
  key: 0,
922
1442
  class: "datametria-table__empty"
923
- }, Za = /* @__PURE__ */ f({
1443
+ }, Jt = /* @__PURE__ */ E({
924
1444
  __name: "DatametriaTable",
925
1445
  props: {
926
1446
  columns: {},
927
1447
  data: {}
928
1448
  },
929
1449
  setup(e) {
930
- return (l, s) => (a(), t("div", Ja, [
931
- i("table", Wa, [
932
- i("thead", Ya, [
933
- i("tr", null, [
934
- (a(!0), t(B, null, L(e.columns, (o) => (a(), t("th", {
935
- key: o.key,
1450
+ return (i, n) => (t(), s("div", Kt, [
1451
+ v("table", Xt, [
1452
+ v("thead", Ht, [
1453
+ v("tr", null, [
1454
+ (t(!0), s(U, null, K(e.columns, (a) => (t(), s("th", {
1455
+ key: a.key,
936
1456
  class: "datametria-table__th",
937
- style: A({ width: o.width })
938
- }, m(o.label), 5))), 128))
1457
+ style: X({ width: a.width })
1458
+ }, g(a.label), 5))), 128))
939
1459
  ])
940
1460
  ]),
941
- i("tbody", Qa, [
942
- (a(!0), t(B, null, L(e.data, (o, r) => (a(), t("tr", {
943
- key: r,
1461
+ v("tbody", Gt, [
1462
+ (t(!0), s(U, null, K(e.data, (a, l) => (t(), s("tr", {
1463
+ key: l,
944
1464
  class: "datametria-table__tr"
945
1465
  }, [
946
- (a(!0), t(B, null, L(e.columns, (d) => (a(), t("td", {
947
- key: d.key,
1466
+ (t(!0), s(U, null, K(e.columns, (r) => (t(), s("td", {
1467
+ key: r.key,
948
1468
  class: "datametria-table__td"
949
1469
  }, [
950
- p(l.$slots, `cell-${d.key}`, {
951
- row: o,
952
- value: o[d.key]
1470
+ R(i.$slots, `cell-${r.key}`, {
1471
+ row: a,
1472
+ value: a[r.key]
953
1473
  }, () => [
954
- w(m(o[d.key]), 1)
1474
+ A(g(a[r.key]), 1)
955
1475
  ], !0)
956
1476
  ]))), 128))
957
1477
  ]))), 128))
958
1478
  ])
959
1479
  ]),
960
- e.data.length === 0 ? (a(), t("div", Xa, [
961
- p(l.$slots, "empty", {}, () => [
962
- s[0] || (s[0] = w("Nenhum dado disponível", -1))
1480
+ e.data.length === 0 ? (t(), s("div", Yt, [
1481
+ R(i.$slots, "empty", {}, () => [
1482
+ n[0] || (n[0] = A("Nenhum dado disponível", -1))
963
1483
  ], !0)
964
- ])) : c("", !0)
1484
+ ])) : f("", !0)
965
1485
  ]));
966
1486
  }
967
- }), al = /* @__PURE__ */ _(Za, [["__scopeId", "data-v-7700c903"]]), et = ["aria-label"], at = ["src", "alt"], tt = {
1487
+ }), hs = /* @__PURE__ */ S(Jt, [["__scopeId", "data-v-7700c903"]]), Qt = ["aria-label"], Zt = ["src", "alt"], el = {
968
1488
  key: 1,
969
1489
  class: "dm-avatar__initials"
970
- }, lt = /* @__PURE__ */ f({
1490
+ }, al = /* @__PURE__ */ E({
971
1491
  __name: "DatametriaAvatar",
972
1492
  props: {
973
1493
  src: {},
@@ -978,27 +1498,27 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
978
1498
  ariaLabel: {}
979
1499
  },
980
1500
  setup(e) {
981
- const l = e, s = k(!1), o = C(() => {
982
- if (!l.name) return "?";
983
- const d = l.name.trim().split(" ");
984
- return d.length === 1 ? d[0].charAt(0).toUpperCase() : (d[0].charAt(0) + d[d.length - 1].charAt(0)).toUpperCase();
985
- }), r = () => {
986
- s.value = !0;
1501
+ const i = e, n = V(!1), a = B(() => {
1502
+ if (!i.name) return "?";
1503
+ const r = i.name.trim().split(" ");
1504
+ return r.length === 1 ? r[0].charAt(0).toUpperCase() : (r[0].charAt(0) + r[r.length - 1].charAt(0)).toUpperCase();
1505
+ }), l = () => {
1506
+ n.value = !0;
987
1507
  };
988
- return (d, n) => (a(), t("div", {
989
- class: y(["dm-avatar", [`dm-avatar--${e.size}`, { "dm-avatar--rounded": e.rounded }]]),
1508
+ return (r, o) => (t(), s("div", {
1509
+ class: L(["dm-avatar", [`dm-avatar--${e.size}`, { "dm-avatar--rounded": e.rounded }]]),
990
1510
  "aria-label": e.ariaLabel || e.name
991
1511
  }, [
992
- e.src ? (a(), t("img", {
1512
+ e.src ? (t(), s("img", {
993
1513
  key: 0,
994
1514
  src: e.src,
995
1515
  alt: e.alt || e.name,
996
1516
  class: "dm-avatar__image",
997
- onError: r
998
- }, null, 40, at)) : (a(), t("span", tt, m(o.value), 1))
999
- ], 10, et));
1517
+ onError: l
1518
+ }, null, 40, Zt)) : (t(), s("span", el, g(a.value), 1))
1519
+ ], 10, Qt));
1000
1520
  }
1001
- }), tl = /* @__PURE__ */ _(lt, [["__scopeId", "data-v-898cb5d7"]]), st = ["aria-label"], rt = /* @__PURE__ */ f({
1521
+ }), bs = /* @__PURE__ */ S(al, [["__scopeId", "data-v-898cb5d7"]]), tl = ["aria-label"], ll = /* @__PURE__ */ E({
1002
1522
  __name: "DatametriaBadge",
1003
1523
  props: {
1004
1524
  label: {},
@@ -1007,67 +1527,77 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
1007
1527
  ariaLabel: {}
1008
1528
  },
1009
1529
  setup(e) {
1010
- return (l, s) => (a(), t("span", {
1011
- class: y(["dm-badge", [`dm-badge--${e.variant}`, `dm-badge--${e.size}`]]),
1530
+ const i = e;
1531
+ if (process.env.NODE_ENV === "development") {
1532
+ const n = ["primary", "secondary", "success", "warning", "error", "info"];
1533
+ n.includes(i.variant) || console.warn(`[DatametriaBadge] Invalid variant "${i.variant}". Valid options: ${n.join(", ")}`);
1534
+ }
1535
+ return (n, a) => (t(), s("span", {
1536
+ class: L(["dm-badge", [`dm-badge--${e.variant}`, `dm-badge--${e.size}`]]),
1012
1537
  "aria-label": e.ariaLabel
1013
1538
  }, [
1014
- p(l.$slots, "default", {}, () => [
1015
- w(m(e.label), 1)
1539
+ R(n.$slots, "default", {}, () => [
1540
+ A(g(e.label), 1)
1016
1541
  ], !0)
1017
- ], 10, st));
1542
+ ], 10, tl));
1018
1543
  }
1019
- }), ll = /* @__PURE__ */ _(rt, [["__scopeId", "data-v-843741c5"]]), dt = ["role", "tabindex", "onKeydown"], ot = {
1544
+ }), ps = /* @__PURE__ */ S(ll, [["__scopeId", "data-v-1255c296"]]), sl = ["role", "tabindex", "onKeydown"], il = {
1020
1545
  key: 0,
1021
1546
  class: "dm-chip__icon"
1022
- }, it = { class: "dm-chip__label" }, nt = /* @__PURE__ */ f({
1547
+ }, rl = { class: "dm-chip__label" }, nl = /* @__PURE__ */ E({
1023
1548
  __name: "DatametriaChip",
1024
1549
  props: {
1025
1550
  label: {},
1026
- variant: { default: "default" },
1551
+ variant: { default: "primary" },
1027
1552
  closable: { type: Boolean, default: !1 },
1028
1553
  clickable: { type: Boolean, default: !1 }
1029
1554
  },
1030
1555
  emits: ["click", "close"],
1031
- setup(e, { emit: l }) {
1032
- const s = l, o = () => {
1033
- s("click");
1556
+ setup(e, { emit: i }) {
1557
+ const n = e;
1558
+ if (process.env.NODE_ENV === "development") {
1559
+ const o = ["primary", "secondary", "success", "warning", "error"];
1560
+ o.includes(n.variant) || console.warn(`[DatametriaChip] Invalid variant "${n.variant}". Valid options: ${o.join(", ")}`);
1561
+ }
1562
+ const a = i, l = () => {
1563
+ a("click");
1034
1564
  }, r = () => {
1035
- s("close");
1565
+ a("close");
1036
1566
  };
1037
- return (d, n) => (a(), t("div", {
1038
- class: y(["dm-chip", [`dm-chip--${e.variant}`, { "dm-chip--clickable": e.clickable }]]),
1567
+ return (o, u) => (t(), s("div", {
1568
+ class: L(["dm-chip", [`dm-chip--${e.variant}`, { "dm-chip--clickable": e.clickable }]]),
1039
1569
  role: e.clickable ? "button" : void 0,
1040
1570
  tabindex: e.clickable ? 0 : void 0,
1041
- onClick: o,
1571
+ onClick: l,
1042
1572
  onKeydown: [
1043
- U(o, ["enter"]),
1044
- U(S(o, ["prevent"]), ["space"])
1573
+ ce(l, ["enter"]),
1574
+ ce(Z(l, ["prevent"]), ["space"])
1045
1575
  ]
1046
1576
  }, [
1047
- d.$slots.icon ? (a(), t("span", ot, [
1048
- p(d.$slots, "icon", {}, void 0, !0)
1049
- ])) : c("", !0),
1050
- i("span", it, [
1051
- p(d.$slots, "default", {}, () => [
1052
- w(m(e.label), 1)
1577
+ o.$slots.icon ? (t(), s("span", il, [
1578
+ R(o.$slots, "icon", {}, void 0, !0)
1579
+ ])) : f("", !0),
1580
+ v("span", rl, [
1581
+ R(o.$slots, "default", {}, () => [
1582
+ A(g(e.label), 1)
1053
1583
  ], !0)
1054
1584
  ]),
1055
- e.closable ? (a(), t("button", {
1585
+ e.closable ? (t(), s("button", {
1056
1586
  key: 1,
1057
1587
  class: "dm-chip__close",
1058
- onClick: S(r, ["stop"]),
1588
+ onClick: Z(r, ["stop"]),
1059
1589
  "aria-label": "Remover",
1060
1590
  type: "button"
1061
- }, "×")) : c("", !0)
1062
- ], 42, dt));
1591
+ }, "×")) : f("", !0)
1592
+ ], 42, sl));
1063
1593
  }
1064
- }), sl = /* @__PURE__ */ _(nt, [["__scopeId", "data-v-0d7ae680"]]), ct = ["aria-label"], ut = { class: "dm-navbar__container" }, mt = { class: "dm-navbar__brand" }, bt = {
1594
+ }), gs = /* @__PURE__ */ S(nl, [["__scopeId", "data-v-c6a268e4"]]), ol = ["aria-label"], dl = { class: "dm-navbar__container" }, cl = { class: "dm-navbar__brand" }, ul = {
1065
1595
  href: "/",
1066
1596
  class: "dm-navbar__logo"
1067
- }, vt = ["aria-expanded"], ht = {
1597
+ }, ml = ["aria-expanded"], vl = {
1068
1598
  key: 1,
1069
1599
  class: "dm-navbar__actions"
1070
- }, ft = /* @__PURE__ */ f({
1600
+ }, fl = /* @__PURE__ */ E({
1071
1601
  __name: "DatametriaNavbar",
1072
1602
  props: {
1073
1603
  brand: { default: "" },
@@ -1078,86 +1608,355 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
1078
1608
  ariaLabel: { default: "Main navigation" }
1079
1609
  },
1080
1610
  setup(e) {
1081
- const l = e, s = k(!1), o = () => {
1082
- s.value = !s.value;
1611
+ const i = e;
1612
+ if (process.env.NODE_ENV === "development") {
1613
+ const r = ["light", "dark", "transparent", "primary"];
1614
+ r.includes(i.variant) || console.warn(`[DatametriaNavbar] Invalid variant "${i.variant}". Valid options: ${r.join(", ")}`);
1615
+ }
1616
+ const n = B(() => [
1617
+ "dm-navbar",
1618
+ `dm-navbar--${i.variant}`,
1619
+ { "dm-navbar--sticky": i.sticky },
1620
+ { "dm-navbar--transparent": i.transparent },
1621
+ { "dm-navbar--bordered": i.bordered }
1622
+ ]), a = V(!1), l = () => {
1623
+ a.value = !a.value;
1083
1624
  };
1084
- return (r, d) => (a(), t("nav", {
1085
- class: y(["dm-navbar", [
1086
- `dm-navbar--${l.variant}`,
1087
- { "dm-navbar--sticky": l.sticky },
1088
- { "dm-navbar--transparent": l.transparent },
1089
- { "dm-navbar--bordered": l.bordered }
1090
- ]]),
1625
+ return (r, o) => (t(), s("nav", {
1626
+ class: L(n.value),
1091
1627
  role: "navigation",
1092
- "aria-label": l.ariaLabel
1628
+ "aria-label": i.ariaLabel
1093
1629
  }, [
1094
- i("div", ut, [
1095
- i("div", mt, [
1096
- p(r.$slots, "brand", {}, () => [
1097
- i("a", bt, m(e.brand), 1)
1630
+ v("div", dl, [
1631
+ v("div", cl, [
1632
+ R(r.$slots, "brand", {}, () => [
1633
+ v("a", ul, g(e.brand), 1)
1098
1634
  ], !0)
1099
1635
  ]),
1100
- r.$slots.menu ? (a(), t("button", {
1636
+ r.$slots.menu ? (t(), s("button", {
1101
1637
  key: 0,
1102
1638
  class: "dm-navbar__toggle",
1103
- "aria-expanded": s.value,
1639
+ "aria-expanded": a.value,
1104
1640
  "aria-controls": "navbar-menu",
1105
- onClick: o
1106
- }, [...d[0] || (d[0] = [
1107
- i("span", { class: "dm-navbar__toggle-icon" }, null, -1)
1108
- ])], 8, vt)) : c("", !0),
1109
- i("div", {
1641
+ onClick: l
1642
+ }, [...o[0] || (o[0] = [
1643
+ v("span", { class: "dm-navbar__toggle-icon" }, null, -1)
1644
+ ])], 8, ml)) : f("", !0),
1645
+ v("div", {
1110
1646
  id: "navbar-menu",
1111
- class: y(["dm-navbar__menu", { "dm-navbar__menu--open": s.value }])
1647
+ class: L(["dm-navbar__menu", { "dm-navbar__menu--open": a.value }])
1112
1648
  }, [
1113
- p(r.$slots, "menu", {}, void 0, !0)
1649
+ R(r.$slots, "menu", {}, void 0, !0)
1114
1650
  ], 2),
1115
- r.$slots.actions ? (a(), t("div", ht, [
1116
- p(r.$slots, "actions", {}, void 0, !0)
1117
- ])) : c("", !0)
1651
+ r.$slots.actions ? (t(), s("div", vl, [
1652
+ R(r.$slots, "actions", {}, void 0, !0)
1653
+ ])) : f("", !0)
1118
1654
  ])
1119
- ], 10, ct));
1655
+ ], 10, ol));
1120
1656
  }
1121
- }), rl = /* @__PURE__ */ _(ft, [["__scopeId", "data-v-adcb6d0c"]]), _t = {
1657
+ }), _s = /* @__PURE__ */ S(fl, [["__scopeId", "data-v-4d51ff6b"]]), hl = ["aria-expanded", "aria-controls"], bl = ["disabled"], pl = ["id", "aria-labelledby"], gl = { class: "dm-menu__content" }, _l = ["tabindex", "aria-disabled", "onClick", "onMouseenter"], kl = {
1658
+ key: 0,
1659
+ class: "dm-menu__divider"
1660
+ }, yl = {
1661
+ key: 0,
1662
+ class: "dm-menu__item-icon"
1663
+ }, $l = { class: "dm-menu__item-content" }, wl = { class: "dm-menu__item-label" }, xl = {
1664
+ key: 0,
1665
+ class: "dm-menu__item-description"
1666
+ }, Vl = {
1667
+ key: 1,
1668
+ class: "dm-menu__item-shortcut"
1669
+ }, Dl = /* @__PURE__ */ E({
1670
+ __name: "DatametriaMenu",
1671
+ props: {
1672
+ items: { default: () => [] },
1673
+ triggerText: { default: "Menu" },
1674
+ placement: { default: "bottom-start" },
1675
+ disabled: { type: Boolean },
1676
+ fullWidth: { type: Boolean },
1677
+ showBackdrop: { type: Boolean, default: !1 },
1678
+ closeOnItemClick: { type: Boolean, default: !0 },
1679
+ offset: { default: 4 }
1680
+ },
1681
+ emits: ["open", "close", "item-click"],
1682
+ setup(e, { expose: i, emit: n }) {
1683
+ const a = e, l = n, r = V(), o = V(), u = V(!1), m = V(-1), b = B(() => `dm-menu-${Math.random().toString(36).substr(2, 9)}`), k = B(() => `dm-menu-trigger-${Math.random().toString(36).substr(2, 9)}`), M = V({}), T = async () => {
1684
+ if (!r.value || !o.value) return;
1685
+ await Y();
1686
+ const d = r.value.getBoundingClientRect(), c = o.value.getBoundingClientRect(), y = {
1687
+ width: window.innerWidth,
1688
+ height: window.innerHeight
1689
+ };
1690
+ let _ = 0, I = 0;
1691
+ switch (a.placement) {
1692
+ case "bottom-start":
1693
+ _ = d.bottom + a.offset, I = d.left;
1694
+ break;
1695
+ case "bottom-end":
1696
+ _ = d.bottom + a.offset, I = d.right - c.width;
1697
+ break;
1698
+ case "top-start":
1699
+ _ = d.top - c.height - a.offset, I = d.left;
1700
+ break;
1701
+ case "top-end":
1702
+ _ = d.top - c.height - a.offset, I = d.right - c.width;
1703
+ break;
1704
+ case "left":
1705
+ _ = d.top, I = d.left - c.width - a.offset;
1706
+ break;
1707
+ case "right":
1708
+ _ = d.top, I = d.right + a.offset;
1709
+ break;
1710
+ }
1711
+ I < 8 ? I = 8 : I + c.width > y.width - 8 && (I = y.width - c.width - 8), _ < 8 ? _ = 8 : _ + c.height > y.height - 8 && (_ = y.height - c.height - 8);
1712
+ const Q = a.fullWidth ? `${d.width}px` : "auto";
1713
+ M.value = {
1714
+ position: "fixed",
1715
+ top: `${_}px`,
1716
+ left: `${I}px`,
1717
+ width: Q,
1718
+ zIndex: "9999"
1719
+ };
1720
+ }, $ = async () => {
1721
+ a.disabled || u.value || (u.value = !0, m.value = -1, l("open"), await T(), Y(() => {
1722
+ const d = a.items.findIndex((c) => !c.disabled && !c.divider);
1723
+ d !== -1 && (m.value = d);
1724
+ }));
1725
+ }, C = () => {
1726
+ u.value && (u.value = !1, m.value = -1, l("close"), Y(() => {
1727
+ var d;
1728
+ (d = r.value) == null || d.focus();
1729
+ }));
1730
+ }, h = () => {
1731
+ u.value ? C() : $();
1732
+ }, p = () => {
1733
+ h();
1734
+ }, w = (d) => {
1735
+ switch (d.key) {
1736
+ case "Enter":
1737
+ case " ":
1738
+ case "ArrowDown":
1739
+ d.preventDefault(), $();
1740
+ break;
1741
+ case "ArrowUp":
1742
+ d.preventDefault(), $(), Y(() => {
1743
+ var y;
1744
+ const c = ((y = a.items.map((_, I) => ({ item: _, index: I })).filter(({ item: _ }) => !_.disabled && !_.divider).pop()) == null ? void 0 : y.index) ?? -1;
1745
+ c !== -1 && (m.value = c);
1746
+ });
1747
+ break;
1748
+ case "Escape":
1749
+ C();
1750
+ break;
1751
+ }
1752
+ }, z = (d) => {
1753
+ switch (d.key) {
1754
+ case "ArrowDown":
1755
+ d.preventDefault(), F();
1756
+ break;
1757
+ case "ArrowUp":
1758
+ d.preventDefault(), P();
1759
+ break;
1760
+ case "Enter":
1761
+ case " ":
1762
+ if (d.preventDefault(), m.value !== -1) {
1763
+ const c = a.items[m.value];
1764
+ W(c, m.value);
1765
+ }
1766
+ break;
1767
+ case "Escape":
1768
+ d.preventDefault(), C();
1769
+ break;
1770
+ case "Tab":
1771
+ C();
1772
+ break;
1773
+ }
1774
+ }, F = () => {
1775
+ const d = a.items.map((_, I) => ({ item: _, index: I })).filter(({ item: _ }) => !_.disabled && !_.divider).map(({ index: _ }) => _);
1776
+ if (d.length === 0) return;
1777
+ const c = d.indexOf(m.value), y = c === -1 ? 0 : (c + 1) % d.length;
1778
+ m.value = d[y];
1779
+ }, P = () => {
1780
+ const d = a.items.map((_, I) => ({ item: _, index: I })).filter(({ item: _ }) => !_.disabled && !_.divider).map(({ index: _ }) => _);
1781
+ if (d.length === 0) return;
1782
+ const c = d.indexOf(m.value), y = c === -1 ? d.length - 1 : (c - 1 + d.length) % d.length;
1783
+ m.value = d[y];
1784
+ }, W = (d, c) => {
1785
+ d.disabled || d.divider || (l("item-click", d, c), d.action && d.action(), a.closeOnItemClick && C());
1786
+ }, x = (d) => {
1787
+ d.stopPropagation();
1788
+ }, q = () => {
1789
+ T();
1790
+ }, D = () => {
1791
+ M.value = {};
1792
+ }, N = (d) => {
1793
+ var y, _;
1794
+ if (!u.value) return;
1795
+ const c = d.target;
1796
+ (y = r.value) != null && y.contains(c) || (_ = o.value) != null && _.contains(c) || C();
1797
+ }, O = () => {
1798
+ u.value && T();
1799
+ };
1800
+ return J(() => {
1801
+ document.addEventListener("click", N), window.addEventListener("resize", O);
1802
+ }), ie(() => {
1803
+ document.removeEventListener("click", N), window.removeEventListener("resize", O);
1804
+ }), H(() => a.items, () => {
1805
+ m.value >= a.items.length && (m.value = -1);
1806
+ }), i({
1807
+ open: $,
1808
+ close: C,
1809
+ toggle: h,
1810
+ isOpen: B(() => u.value)
1811
+ }), (d, c) => (t(), s("div", {
1812
+ class: L(["dm-menu", { "dm-menu--disabled": e.disabled }])
1813
+ }, [
1814
+ v("div", {
1815
+ ref_key: "triggerRef",
1816
+ ref: r,
1817
+ class: "dm-menu__trigger",
1818
+ "aria-expanded": u.value,
1819
+ "aria-haspopup": !0,
1820
+ "aria-controls": b.value,
1821
+ onClick: p,
1822
+ onKeydown: w
1823
+ }, [
1824
+ R(d.$slots, "trigger", {
1825
+ isOpen: u.value,
1826
+ toggle: h
1827
+ }, () => [
1828
+ v("button", {
1829
+ type: "button",
1830
+ class: "dm-menu__button",
1831
+ disabled: e.disabled
1832
+ }, [
1833
+ A(g(e.triggerText) + " ", 1),
1834
+ (t(), s("svg", {
1835
+ class: L(["dm-menu__chevron", { "dm-menu__chevron--open": u.value }]),
1836
+ viewBox: "0 0 20 20",
1837
+ fill: "currentColor"
1838
+ }, [...c[0] || (c[0] = [
1839
+ v("path", {
1840
+ "fill-rule": "evenodd",
1841
+ d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",
1842
+ "clip-rule": "evenodd"
1843
+ }, null, -1)
1844
+ ])], 2))
1845
+ ], 8, bl)
1846
+ ], !0)
1847
+ ], 40, hl),
1848
+ (t(), ee(ae, { to: "body" }, [
1849
+ te(le, {
1850
+ name: "menu",
1851
+ onEnter: q,
1852
+ onLeave: D
1853
+ }, {
1854
+ default: se(() => [
1855
+ u.value ? (t(), s("div", {
1856
+ key: 0,
1857
+ ref_key: "menuRef",
1858
+ ref: o,
1859
+ id: b.value,
1860
+ class: L(["dm-menu__dropdown", [
1861
+ `dm-menu__dropdown--${e.placement}`,
1862
+ { "dm-menu__dropdown--full-width": e.fullWidth }
1863
+ ]]),
1864
+ style: X(M.value),
1865
+ role: "menu",
1866
+ "aria-labelledby": k.value,
1867
+ onKeydown: z,
1868
+ onClick: x
1869
+ }, [
1870
+ v("div", gl, [
1871
+ R(d.$slots, "default", {
1872
+ close: C,
1873
+ focusedIndex: m.value
1874
+ }, () => [
1875
+ (t(!0), s(U, null, K(e.items, (y, _) => (t(), s("div", {
1876
+ key: y.key || _,
1877
+ class: L(["dm-menu__item", {
1878
+ "dm-menu__item--focused": m.value === _,
1879
+ "dm-menu__item--disabled": y.disabled,
1880
+ "dm-menu__item--divider": y.divider
1881
+ }]),
1882
+ role: "menuitem",
1883
+ tabindex: y.disabled ? -1 : 0,
1884
+ "aria-disabled": y.disabled,
1885
+ onClick: (I) => W(y, _),
1886
+ onMouseenter: (I) => m.value = _
1887
+ }, [
1888
+ y.divider ? (t(), s("div", kl)) : (t(), s(U, { key: 1 }, [
1889
+ y.icon ? (t(), s("div", yl, [
1890
+ (t(), ee(fe(y.icon)))
1891
+ ])) : f("", !0),
1892
+ v("div", $l, [
1893
+ v("div", wl, g(y.label), 1),
1894
+ y.description ? (t(), s("div", xl, g(y.description), 1)) : f("", !0)
1895
+ ]),
1896
+ y.shortcut ? (t(), s("div", Vl, g(y.shortcut), 1)) : f("", !0)
1897
+ ], 64))
1898
+ ], 42, _l))), 128))
1899
+ ], !0)
1900
+ ])
1901
+ ], 46, pl)) : f("", !0)
1902
+ ]),
1903
+ _: 3
1904
+ })
1905
+ ])),
1906
+ (t(), ee(ae, { to: "body" }, [
1907
+ te(le, { name: "backdrop" }, {
1908
+ default: se(() => [
1909
+ u.value && e.showBackdrop ? (t(), s("div", {
1910
+ key: 0,
1911
+ class: "dm-menu__backdrop",
1912
+ onClick: C
1913
+ })) : f("", !0)
1914
+ ]),
1915
+ _: 1
1916
+ })
1917
+ ]))
1918
+ ], 2));
1919
+ }
1920
+ }), ks = /* @__PURE__ */ S(Dl, [["__scopeId", "data-v-62db3fcc"]]), Ml = {
1122
1921
  class: "dm-breadcrumb",
1123
1922
  "aria-label": "Breadcrumb"
1124
- }, $t = { class: "dm-breadcrumb__list" }, yt = ["href", "onClick"], kt = ["aria-current"], pt = {
1923
+ }, Cl = { class: "dm-breadcrumb__list" }, Il = ["href", "onClick"], Bl = ["aria-current"], Tl = {
1125
1924
  key: 2,
1126
1925
  class: "dm-breadcrumb__separator",
1127
1926
  "aria-hidden": "true"
1128
- }, gt = /* @__PURE__ */ f({
1927
+ }, Ll = /* @__PURE__ */ E({
1129
1928
  __name: "DatametriaBreadcrumb",
1130
1929
  props: {
1131
1930
  items: {},
1132
1931
  separator: { default: "/" }
1133
1932
  },
1134
1933
  emits: ["click"],
1135
- setup(e, { emit: l }) {
1136
- const s = l, o = (r, d, n) => {
1137
- s("click", d, n);
1934
+ setup(e, { emit: i }) {
1935
+ const n = i, a = (l, r, o) => {
1936
+ n("click", r, o);
1138
1937
  };
1139
- return (r, d) => (a(), t("nav", _t, [
1140
- i("ol", $t, [
1141
- (a(!0), t(B, null, L(e.items, (n, u) => (a(), t("li", {
1938
+ return (l, r) => (t(), s("nav", Ml, [
1939
+ v("ol", Cl, [
1940
+ (t(!0), s(U, null, K(e.items, (o, u) => (t(), s("li", {
1142
1941
  key: u,
1143
1942
  class: "dm-breadcrumb__item"
1144
1943
  }, [
1145
- n.href && u < e.items.length - 1 ? (a(), t("a", {
1944
+ o.href && u < e.items.length - 1 ? (t(), s("a", {
1146
1945
  key: 0,
1147
- href: n.href,
1946
+ href: o.href,
1148
1947
  class: "dm-breadcrumb__link",
1149
- onClick: (b) => o(b, n, u)
1150
- }, m(n.label), 9, yt)) : (a(), t("span", {
1948
+ onClick: (m) => a(m, o, u)
1949
+ }, g(o.label), 9, Il)) : (t(), s("span", {
1151
1950
  key: 1,
1152
1951
  class: "dm-breadcrumb__current",
1153
1952
  "aria-current": u === e.items.length - 1 ? "page" : void 0
1154
- }, m(n.label), 9, kt)),
1155
- u < e.items.length - 1 ? (a(), t("span", pt, m(e.separator), 1)) : c("", !0)
1953
+ }, g(o.label), 9, Bl)),
1954
+ u < e.items.length - 1 ? (t(), s("span", Tl, g(e.separator), 1)) : f("", !0)
1156
1955
  ]))), 128))
1157
1956
  ])
1158
1957
  ]));
1159
1958
  }
1160
- }), dl = /* @__PURE__ */ _(gt, [["__scopeId", "data-v-17c32ee3"]]), Dt = { class: "dm-tabs" }, Vt = ["aria-label"], wt = ["id", "aria-selected", "aria-controls", "tabindex", "onClick", "onKeydown"], Ct = { class: "dm-tabs__panels" }, It = ["id", "aria-labelledby", "hidden"], Bt = /* @__PURE__ */ f({
1959
+ }), ys = /* @__PURE__ */ S(Ll, [["__scopeId", "data-v-17c32ee3"]]), El = { class: "dm-tabs" }, Sl = ["aria-label"], ql = ["id", "aria-selected", "aria-controls", "tabindex", "onClick", "onKeydown"], Rl = { class: "dm-tabs__panels" }, zl = ["id", "aria-labelledby", "hidden"], Nl = /* @__PURE__ */ E({
1161
1960
  __name: "DatametriaTabs",
1162
1961
  props: {
1163
1962
  tabs: {},
@@ -1165,241 +1964,683 @@ const Z = ["disabled", "type", "aria-busy", "aria-disabled"], ee = {
1165
1964
  ariaLabel: { default: "Tabs" }
1166
1965
  },
1167
1966
  emits: ["update:modelValue"],
1168
- setup(e, { emit: l }) {
1169
- const s = e, o = l, r = k(s.modelValue);
1170
- T(() => s.modelValue, (u) => {
1171
- r.value = u;
1967
+ setup(e, { emit: i }) {
1968
+ const n = e, a = i, l = V(n.modelValue);
1969
+ H(() => n.modelValue, (u) => {
1970
+ l.value = u;
1172
1971
  });
1173
- const d = (u) => {
1174
- r.value = u, o("update:modelValue", u);
1175
- }, n = (u, b) => {
1176
- var v;
1177
- let h = b;
1972
+ const r = (u) => {
1973
+ l.value = u, a("update:modelValue", u);
1974
+ }, o = (u, m) => {
1975
+ var k;
1976
+ let b = m;
1178
1977
  switch (u.key) {
1179
1978
  case "ArrowLeft":
1180
- u.preventDefault(), h = b > 0 ? b - 1 : s.tabs.length - 1;
1979
+ u.preventDefault(), b = m > 0 ? m - 1 : n.tabs.length - 1;
1181
1980
  break;
1182
1981
  case "ArrowRight":
1183
- u.preventDefault(), h = b < s.tabs.length - 1 ? b + 1 : 0;
1982
+ u.preventDefault(), b = m < n.tabs.length - 1 ? m + 1 : 0;
1184
1983
  break;
1185
1984
  case "Home":
1186
- u.preventDefault(), h = 0;
1985
+ u.preventDefault(), b = 0;
1187
1986
  break;
1188
1987
  case "End":
1189
- u.preventDefault(), h = s.tabs.length - 1;
1988
+ u.preventDefault(), b = n.tabs.length - 1;
1190
1989
  break;
1191
1990
  default:
1192
1991
  return;
1193
1992
  }
1194
- d(h), (v = document.getElementById(`tab-${h}`)) == null || v.focus();
1993
+ r(b), (k = document.getElementById(`tab-${b}`)) == null || k.focus();
1195
1994
  };
1196
- return (u, b) => (a(), t("div", Dt, [
1197
- i("div", {
1995
+ return (u, m) => (t(), s("div", El, [
1996
+ v("div", {
1198
1997
  class: "dm-tabs__header",
1199
1998
  role: "tablist",
1200
1999
  "aria-label": e.ariaLabel
1201
2000
  }, [
1202
- (a(!0), t(B, null, L(e.tabs, (h, v) => (a(), t("button", {
1203
- key: v,
1204
- id: `tab-${v}`,
1205
- class: y(["dm-tabs__tab", { "dm-tabs__tab--active": r.value === v }]),
2001
+ (t(!0), s(U, null, K(e.tabs, (b, k) => (t(), s("button", {
2002
+ key: k,
2003
+ id: `tab-${k}`,
2004
+ class: L(["dm-tabs__tab", { "dm-tabs__tab--active": l.value === k }]),
1206
2005
  role: "tab",
1207
- "aria-selected": r.value === v,
1208
- "aria-controls": `panel-${v}`,
1209
- tabindex: r.value === v ? 0 : -1,
1210
- onClick: (D) => d(v),
1211
- onKeydown: (D) => n(D, v)
1212
- }, m(h), 43, wt))), 128)),
1213
- i("div", {
2006
+ "aria-selected": l.value === k,
2007
+ "aria-controls": `panel-${k}`,
2008
+ tabindex: l.value === k ? 0 : -1,
2009
+ onClick: (M) => r(k),
2010
+ onKeydown: (M) => o(M, k)
2011
+ }, g(b), 43, ql))), 128)),
2012
+ v("div", {
1214
2013
  class: "dm-tabs__indicator",
1215
- style: A({ transform: `translateX(${r.value * 100}%)` })
2014
+ style: X({ transform: `translateX(${l.value * 100}%)` })
1216
2015
  }, null, 4)
1217
- ], 8, Vt),
1218
- i("div", Ct, [
1219
- (a(!0), t(B, null, L(e.tabs, (h, v) => (a(), t("div", {
1220
- key: v,
1221
- id: `panel-${v}`,
1222
- class: y(["dm-tabs__panel", { "dm-tabs__panel--active": r.value === v }]),
2016
+ ], 8, Sl),
2017
+ v("div", Rl, [
2018
+ (t(!0), s(U, null, K(e.tabs, (b, k) => (t(), s("div", {
2019
+ key: k,
2020
+ id: `panel-${k}`,
2021
+ class: L(["dm-tabs__panel", { "dm-tabs__panel--active": l.value === k }]),
1223
2022
  role: "tabpanel",
1224
- "aria-labelledby": `tab-${v}`,
1225
- hidden: r.value !== v
2023
+ "aria-labelledby": `tab-${k}`,
2024
+ hidden: l.value !== k
1226
2025
  }, [
1227
- p(u.$slots, `panel-${v}`, {}, void 0, !0)
1228
- ], 10, It))), 128))
2026
+ R(u.$slots, `panel-${k}`, {}, void 0, !0)
2027
+ ], 10, zl))), 128))
1229
2028
  ])
1230
2029
  ]));
1231
2030
  }
1232
- }), ol = /* @__PURE__ */ _(Bt, [["__scopeId", "data-v-6d59d320"]]);
1233
- let q = k(!1), F = !1;
1234
- function il() {
2031
+ }), $s = /* @__PURE__ */ S(Nl, [["__scopeId", "data-v-6d59d320"]]);
2032
+ let G = V(!1), ue = !1;
2033
+ function ws() {
1235
2034
  const e = () => {
1236
- q.value = !q.value, document.documentElement.classList.toggle("dark", q.value), localStorage.setItem("theme", q.value ? "dark" : "light");
1237
- }, l = (n) => {
1238
- q.value = n === "dark", document.documentElement.classList.toggle("dark", q.value), localStorage.setItem("theme", n);
1239
- }, s = () => {
1240
- F = !0;
1241
- const n = localStorage.getItem("theme");
1242
- if (n)
1243
- l(n);
2035
+ G.value = !G.value, document.documentElement.classList.toggle("dark", G.value), localStorage.setItem("theme", G.value ? "dark" : "light");
2036
+ }, i = (o) => {
2037
+ G.value = o === "dark", document.documentElement.classList.toggle("dark", G.value), localStorage.setItem("theme", o);
2038
+ }, n = () => {
2039
+ ue = !0;
2040
+ const o = localStorage.getItem("theme");
2041
+ if (o)
2042
+ i(o);
1244
2043
  else if (typeof window < "u" && window.matchMedia) {
1245
2044
  const u = window.matchMedia("(prefers-color-scheme: dark)").matches;
1246
- l(u ? "dark" : "light");
2045
+ i(u ? "dark" : "light");
1247
2046
  }
1248
2047
  typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (u) => {
1249
- localStorage.getItem("theme") || l(u.matches ? "dark" : "light");
2048
+ localStorage.getItem("theme") || i(u.matches ? "dark" : "light");
1250
2049
  });
1251
2050
  };
1252
- F || s();
1253
- const o = C(() => q.value ? "dark" : "light");
2051
+ ue || n();
2052
+ const a = B(() => G.value ? "dark" : "light");
1254
2053
  return {
1255
- isDark: q,
1256
- currentTheme: o,
2054
+ isDark: G,
2055
+ currentTheme: a,
1257
2056
  toggle: e,
1258
- setTheme: l,
1259
- setDark: () => l("dark"),
1260
- setLight: () => l("light"),
1261
- initTheme: s
2057
+ setTheme: i,
2058
+ setDark: () => i("dark"),
2059
+ setLight: () => i("light"),
2060
+ initTheme: n
1262
2061
  };
1263
2062
  }
1264
- const Lt = (e) => !!e, Mt = (e) => e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !0, qt = (e) => (l) => l ? l.length >= e : !0, Tt = (e) => (l) => l ? l.length <= e : !0, xt = (e) => (l) => l ? e.test(l) : !0, St = (e) => (l) => e(l);
1265
- function nl() {
2063
+ const Ol = (e) => !!e, Fl = (e) => e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !0, Al = (e) => (i) => i ? i.length >= e : !0, jl = (e) => (i) => i ? i.length <= e : !0, Pl = (e) => (i) => i ? e.test(i) : !0, Ul = (e) => (i) => e(i);
2064
+ function xs() {
1266
2065
  return {
1267
- required: Lt,
1268
- email: Mt,
1269
- minLength: qt,
1270
- maxLength: Tt,
1271
- pattern: xt,
1272
- custom: St
2066
+ required: Ol,
2067
+ email: Fl,
2068
+ minLength: Al,
2069
+ maxLength: jl,
2070
+ pattern: Pl,
2071
+ custom: Ul
1273
2072
  };
1274
2073
  }
1275
- function cl(e = {}) {
1276
- const l = k(!1), s = k(null), o = k(null), r = async (h, v = {}) => {
1277
- l.value = !0, s.value = null;
2074
+ function Vs(e = {}) {
2075
+ const i = V(!1), n = V(null), a = V(null), l = async (b, k = {}) => {
2076
+ i.value = !0, n.value = null;
1278
2077
  try {
1279
- const D = e.baseURL ? `${e.baseURL}${h}` : h, I = await fetch(D, {
1280
- ...v,
2078
+ const M = e.baseURL ? `${e.baseURL}${b}` : b, T = await fetch(M, {
2079
+ ...k,
1281
2080
  headers: {
1282
2081
  "Content-Type": "application/json",
1283
2082
  ...e.headers,
1284
- ...v.headers
2083
+ ...k.headers
1285
2084
  }
1286
2085
  });
1287
- if (!I.ok)
1288
- throw new Error(`HTTP ${I.status}: ${I.statusText}`);
1289
- const x = await I.json();
1290
- return o.value = x, x;
1291
- } catch (D) {
1292
- throw s.value = D.message || "Request failed", D;
2086
+ if (!T.ok)
2087
+ throw new Error(`HTTP ${T.status}: ${T.statusText}`);
2088
+ const $ = await T.json();
2089
+ return a.value = $, $;
2090
+ } catch (M) {
2091
+ throw n.value = M.message || "Request failed", M;
1293
2092
  } finally {
1294
- l.value = !1;
2093
+ i.value = !1;
1295
2094
  }
1296
2095
  };
1297
2096
  return {
1298
- loading: l,
1299
- error: s,
1300
- data: o,
1301
- get: (h, v) => r(h, { ...v, method: "GET" }),
1302
- post: (h, v, D) => r(h, {
1303
- ...D,
2097
+ loading: i,
2098
+ error: n,
2099
+ data: a,
2100
+ get: (b, k) => l(b, { ...k, method: "GET" }),
2101
+ post: (b, k, M) => l(b, {
2102
+ ...M,
1304
2103
  method: "POST",
1305
- body: JSON.stringify(v)
2104
+ body: JSON.stringify(k)
1306
2105
  }),
1307
- put: (h, v, D) => r(h, {
1308
- ...D,
2106
+ put: (b, k, M) => l(b, {
2107
+ ...M,
1309
2108
  method: "PUT",
1310
- body: JSON.stringify(v)
2109
+ body: JSON.stringify(k)
1311
2110
  }),
1312
- delete: (h, v) => r(h, { ...v, method: "DELETE" })
2111
+ delete: (b, k) => l(b, { ...k, method: "DELETE" })
1313
2112
  };
1314
2113
  }
1315
- function ul(e, l) {
1316
- const s = localStorage.getItem(e);
1317
- let o = l;
1318
- if (s)
2114
+ function Ds() {
2115
+ const e = V(1), i = "datametria-accessibility-scale", n = 0.8, a = 2, l = B(
2116
+ () => Math.max(n, Math.min(a, e.value))
2117
+ ), r = B(() => {
2118
+ const $ = l.value;
2119
+ return $ <= 0.9 ? "scale-small" : $ >= 1.1 ? "scale-large" : "scale-normal";
2120
+ }), o = ($) => {
2121
+ const C = Math.max(n, Math.min(a, $));
2122
+ document.documentElement.style.setProperty("--user-scale", C.toString()), e.value = C;
2123
+ }, u = ($) => {
2124
+ try {
2125
+ localStorage.setItem(i, $.toString());
2126
+ } catch (C) {
2127
+ console.warn("Failed to save accessibility scale:", C);
2128
+ }
2129
+ }, m = () => {
1319
2130
  try {
1320
- o = JSON.parse(s);
2131
+ const $ = localStorage.getItem(i);
2132
+ return $ ? parseFloat($) : 1;
2133
+ } catch ($) {
2134
+ return console.warn("Failed to load accessibility scale:", $), 1;
2135
+ }
2136
+ }, b = ($) => {
2137
+ o($), u(l.value);
2138
+ }, k = () => {
2139
+ b(e.value + 0.1);
2140
+ }, M = () => {
2141
+ b(e.value - 0.1);
2142
+ }, T = () => {
2143
+ b(1);
2144
+ };
2145
+ return H(e, ($) => {
2146
+ o($);
2147
+ }), J(() => {
2148
+ const $ = m();
2149
+ o($);
2150
+ }), {
2151
+ scale: l,
2152
+ scaleClass: r,
2153
+ setScale: b,
2154
+ increaseScale: k,
2155
+ decreaseScale: M,
2156
+ resetScale: T,
2157
+ minScale: n,
2158
+ maxScale: a
2159
+ };
2160
+ }
2161
+ const j = {
2162
+ xs: 475,
2163
+ sm: 640,
2164
+ md: 768,
2165
+ lg: 1024,
2166
+ xl: 1280,
2167
+ "2xl": 1536
2168
+ };
2169
+ function Ms() {
2170
+ const e = V(0), i = () => {
2171
+ e.value = window.innerWidth;
2172
+ }, n = (h) => e.value >= j[h], a = (h) => e.value <= j[h], l = (h, p) => e.value >= j[h] && e.value <= j[p], r = () => {
2173
+ const h = e.value;
2174
+ return h >= j["2xl"] ? "2xl" : h >= j.xl ? "xl" : h >= j.lg ? "lg" : h >= j.md ? "md" : h >= j.sm ? "sm" : "xs";
2175
+ }, o = () => e.value < j.sm, u = () => n("sm") && e.value < j.md, m = () => n("md") && e.value < j.lg, b = () => n("lg") && e.value < j.xl, k = () => n("xl") && e.value < j["2xl"], M = () => n("2xl"), T = () => e.value < j.md, $ = () => l("md", "lg"), C = () => n("lg");
2176
+ return J(() => {
2177
+ i(), window.addEventListener("resize", i);
2178
+ }), ie(() => {
2179
+ window.removeEventListener("resize", i);
2180
+ }), {
2181
+ windowWidth: e,
2182
+ breakpoints: j,
2183
+ isGreaterOrEqual: n,
2184
+ isLessOrEqual: a,
2185
+ isBetween: l,
2186
+ getCurrentBreakpoint: r,
2187
+ isXs: o,
2188
+ isSm: u,
2189
+ isMd: m,
2190
+ isLg: b,
2191
+ isXl: k,
2192
+ is2xl: M,
2193
+ isMobile: T,
2194
+ isTablet: $,
2195
+ isDesktop: C
2196
+ };
2197
+ }
2198
+ function Cs(e = {}) {
2199
+ const {
2200
+ color: i = "rgba(255, 255, 255, 0.3)",
2201
+ duration: n = 600,
2202
+ disabled: a = !1
2203
+ } = e, l = V(), r = V([]), o = (h) => {
2204
+ if (a || !l.value) return;
2205
+ const p = l.value, w = p.getBoundingClientRect();
2206
+ let z, F;
2207
+ if (h instanceof MouseEvent)
2208
+ z = h.clientX, F = h.clientY;
2209
+ else {
2210
+ const D = h.touches[0] || h.changedTouches[0];
2211
+ z = D.clientX, F = D.clientY;
2212
+ }
2213
+ const P = z - w.left, W = F - w.top, x = Math.max(w.width, w.height), q = document.createElement("div");
2214
+ q.className = "datametria-ripple", q.style.cssText = `
2215
+ position: absolute;
2216
+ left: ${P - x / 2}px;
2217
+ top: ${W - x / 2}px;
2218
+ width: ${x}px;
2219
+ height: ${x}px;
2220
+ border-radius: 50%;
2221
+ background: ${i};
2222
+ transform: scale(0);
2223
+ animation: ripple-animation ${n / 1e3}s ease-out;
2224
+ pointer-events: none;
2225
+ z-index: 1;
2226
+ `, p.appendChild(q), setTimeout(() => {
2227
+ q.parentNode && q.parentNode.removeChild(q);
2228
+ }, n);
2229
+ }, u = (h) => {
2230
+ o(h);
2231
+ }, m = (h) => h ? (l.value = h, window.getComputedStyle(h).position === "static" && (h.style.position = "relative"), h.style.overflow = "hidden", h.addEventListener("click", u), () => {
2232
+ h.removeEventListener("click", u);
2233
+ }) : void 0, b = (h) => {
2234
+ const p = r.value.findIndex((w) => w.id === h);
2235
+ p > -1 && r.value.splice(p, 1);
2236
+ }, k = () => {
2237
+ r.value = [];
2238
+ };
2239
+ ie(() => {
2240
+ k();
2241
+ });
2242
+ const M = (h) => ({
2243
+ position: "absolute",
2244
+ left: `${h.x}px`,
2245
+ top: `${h.y}px`,
2246
+ width: `${h.size}px`,
2247
+ height: `${h.size}px`,
2248
+ borderRadius: "50%",
2249
+ backgroundColor: i,
2250
+ transform: "scale(0)",
2251
+ animation: `ripple-animation ${n}ms ease-out`,
2252
+ pointerEvents: "none",
2253
+ zIndex: 1
2254
+ }), T = () => {
2255
+ const h = "ripple-keyframes";
2256
+ if (document.getElementById(h)) return;
2257
+ const p = document.createElement("style");
2258
+ p.id = h, p.textContent = `
2259
+ @keyframes ripple-animation {
2260
+ 0% {
2261
+ transform: scale(0);
2262
+ opacity: 1;
2263
+ }
2264
+ 100% {
2265
+ transform: scale(2);
2266
+ opacity: 0;
2267
+ }
2268
+ }
2269
+
2270
+ @media (prefers-reduced-motion: reduce) {
2271
+ @keyframes ripple-animation {
2272
+ 0%, 100% {
2273
+ transform: scale(0);
2274
+ opacity: 0;
2275
+ }
2276
+ }
2277
+ }
2278
+ `, document.head.appendChild(p);
2279
+ }, $ = () => {
2280
+ if (l.value)
2281
+ return m(l.value);
2282
+ }, C = () => {
2283
+ l.value && l.value.removeEventListener("click", u);
2284
+ };
2285
+ return J(() => {
2286
+ T(), l.value && $();
2287
+ }), H(l, (h) => {
2288
+ h && $();
2289
+ }), {
2290
+ rippleRef: l,
2291
+ ripples: r,
2292
+ applyRipple: m,
2293
+ removeRipple: b,
2294
+ clearRipples: k,
2295
+ getRippleStyle: M,
2296
+ createRipple: o,
2297
+ addRippleEffect: $,
2298
+ removeRippleEffect: C
2299
+ };
2300
+ }
2301
+ function Is(e = {}) {
2302
+ const {
2303
+ enabled: i = !0,
2304
+ fallbackToVisual: n = !0,
2305
+ visualDuration: a = 150
2306
+ } = e, l = V(!1), r = V(i), o = V(null), u = () => !!("hapticFeedback" in navigator && navigator.hapticFeedback || "vibrate" in navigator && typeof navigator.vibrate == "function"), m = (d) => {
2307
+ if (!("vibrate" in navigator) || typeof navigator.vibrate != "function") return !1;
2308
+ try {
2309
+ return navigator.vibrate(d);
2310
+ } catch (c) {
2311
+ return console.warn("Haptic feedback failed:", c), !1;
2312
+ }
2313
+ }, b = (d, c) => {
2314
+ if (!n) return;
2315
+ const y = `visual-${Date.now()}`;
2316
+ if (o.value = y, c) {
2317
+ const _ = c.style.transform, I = c.style.transition;
2318
+ switch (c.style.transition = "transform 75ms ease-out", d) {
2319
+ case "light":
2320
+ c.style.transform = "scale(0.98)";
2321
+ break;
2322
+ case "medium":
2323
+ c.style.transform = "scale(0.95)";
2324
+ break;
2325
+ case "heavy":
2326
+ c.style.transform = "scale(0.92)";
2327
+ break;
2328
+ case "selection":
2329
+ c.style.transform = "scale(1.02)";
2330
+ break;
2331
+ default:
2332
+ c.style.transform = "scale(0.97)";
2333
+ }
2334
+ setTimeout(() => {
2335
+ c.style.transform = _, setTimeout(() => {
2336
+ c.style.transition = I, o.value === y && (o.value = null);
2337
+ }, 75);
2338
+ }, 75);
2339
+ }
2340
+ setTimeout(() => {
2341
+ o.value === y && (o.value = null);
2342
+ }, a);
2343
+ }, k = (d) => {
2344
+ if (!r.value) return;
2345
+ let c = !1;
2346
+ l.value && (c = m(10)), !c && n && b("light", d);
2347
+ }, M = (d) => {
2348
+ if (!r.value) return;
2349
+ let c = !1;
2350
+ l.value && (c = m(20)), !c && n && b("medium", d);
2351
+ }, T = (d) => {
2352
+ if (!r.value) return;
2353
+ let c = !1;
2354
+ l.value && (c = m(40)), !c && n && b("heavy", d);
2355
+ }, $ = (d) => {
2356
+ if (!r.value) return;
2357
+ let c = !1;
2358
+ l.value && (c = m(5)), !c && n && b("selection", d);
2359
+ }, C = (d = "medium", c) => {
2360
+ switch (d) {
2361
+ case "light":
2362
+ k(c);
2363
+ break;
2364
+ case "medium":
2365
+ M(c);
2366
+ break;
2367
+ case "heavy":
2368
+ T(c);
2369
+ break;
2370
+ }
2371
+ }, h = (d, c) => {
2372
+ if (!r.value) return;
2373
+ let y;
2374
+ switch (d) {
2375
+ case "success":
2376
+ y = [10, 50, 10];
2377
+ break;
2378
+ case "warning":
2379
+ y = [20, 100, 20, 100, 20];
2380
+ break;
2381
+ case "error":
2382
+ y = [50, 100, 50, 100, 50];
2383
+ break;
2384
+ }
2385
+ let _ = !1;
2386
+ l.value && (_ = m(y)), !_ && n && b("notification", c);
2387
+ }, p = (d, c) => {
2388
+ if (!r.value) return;
2389
+ let y = !1;
2390
+ l.value && (y = m(d)), !y && n && b("medium", c);
2391
+ }, w = () => {
2392
+ r.value = !0;
2393
+ }, z = () => {
2394
+ r.value = !1;
2395
+ }, F = () => {
2396
+ r.value = !r.value;
2397
+ }, P = B(() => l.value && r.value), W = B(() => o.value !== null), x = (d = "light") => {
2398
+ if (!r.value) return !1;
2399
+ if ("hapticFeedback" in navigator && navigator.hapticFeedback)
2400
+ try {
2401
+ return navigator.hapticFeedback.impact(d);
2402
+ } catch (c) {
2403
+ console.warn("Haptic feedback failed:", c);
2404
+ }
2405
+ if ("vibrate" in navigator && typeof navigator.vibrate == "function") {
2406
+ let c;
2407
+ switch (d) {
2408
+ case "light":
2409
+ c = 10;
2410
+ break;
2411
+ case "medium":
2412
+ c = 20;
2413
+ break;
2414
+ case "heavy":
2415
+ c = 30;
2416
+ break;
2417
+ case "success":
2418
+ c = [10, 50, 10];
2419
+ break;
2420
+ case "warning":
2421
+ c = [20, 100, 20];
2422
+ break;
2423
+ case "error":
2424
+ c = [50, 100, 50, 100, 50];
2425
+ break;
2426
+ default:
2427
+ c = 10;
2428
+ }
2429
+ try {
2430
+ return navigator.vibrate(c);
2431
+ } catch (y) {
2432
+ return console.warn("Vibration failed:", y), !1;
2433
+ }
2434
+ }
2435
+ return !1;
2436
+ }, q = () => {
2437
+ const d = "haptic-keyframes";
2438
+ if (document.getElementById(d)) return;
2439
+ const c = document.createElement("style");
2440
+ c.id = d, c.textContent = `
2441
+ @keyframes haptic-pulse-light {
2442
+ 0% { transform: scale(1); }
2443
+ 50% { transform: scale(0.98); }
2444
+ 100% { transform: scale(1); }
2445
+ }
2446
+
2447
+ @keyframes haptic-pulse-medium {
2448
+ 0% { transform: scale(1); }
2449
+ 50% { transform: scale(0.95); }
2450
+ 100% { transform: scale(1); }
2451
+ }
2452
+
2453
+ @keyframes haptic-pulse-heavy {
2454
+ 0% { transform: scale(1); }
2455
+ 50% { transform: scale(0.92); }
2456
+ 100% { transform: scale(1); }
2457
+ }
2458
+
2459
+ @keyframes haptic-success {
2460
+ 0% { transform: scale(1); filter: brightness(1); }
2461
+ 50% { transform: scale(1.02); filter: brightness(1.1); }
2462
+ 100% { transform: scale(1); filter: brightness(1); }
2463
+ }
2464
+
2465
+ @keyframes haptic-error {
2466
+ 0% { transform: translateX(0); }
2467
+ 25% { transform: translateX(-2px); }
2468
+ 75% { transform: translateX(2px); }
2469
+ 100% { transform: translateX(0); }
2470
+ }
2471
+
2472
+ @media (prefers-reduced-motion: reduce) {
2473
+ @keyframes haptic-pulse-light,
2474
+ @keyframes haptic-pulse-medium,
2475
+ @keyframes haptic-pulse-heavy,
2476
+ @keyframes haptic-success,
2477
+ @keyframes haptic-error {
2478
+ 0%, 100% { transform: none; filter: none; }
2479
+ }
2480
+ }
2481
+ `, document.head.appendChild(c);
2482
+ }, D = (d, c) => {
2483
+ if (!d) return;
2484
+ q();
2485
+ const y = d.style.animation;
2486
+ let _, I;
2487
+ switch (c) {
2488
+ case "light":
2489
+ _ = "haptic-pulse-light 0.15s ease-out", I = 150;
2490
+ break;
2491
+ case "medium":
2492
+ _ = "haptic-pulse-medium 0.2s ease-out", I = 200;
2493
+ break;
2494
+ case "heavy":
2495
+ _ = "haptic-pulse-heavy 0.25s ease-out", I = 250;
2496
+ break;
2497
+ case "success":
2498
+ _ = "haptic-success 0.3s ease-out", I = 300;
2499
+ break;
2500
+ case "warning":
2501
+ _ = "haptic-pulse-medium 0.2s ease-out", I = 200;
2502
+ break;
2503
+ case "error":
2504
+ _ = "haptic-error 0.4s ease-out", I = 400;
2505
+ break;
2506
+ default:
2507
+ _ = "haptic-pulse-light 0.15s ease-out", I = 150;
2508
+ }
2509
+ d.style.animation = _, setTimeout(() => {
2510
+ d.style.animation = y;
2511
+ }, I);
2512
+ }, N = (d, c) => {
2513
+ const y = x(c);
2514
+ return D(d, c), y;
2515
+ }, O = () => {
2516
+ const d = u();
2517
+ return l.value = d, d;
2518
+ };
2519
+ return O(), {
2520
+ // Estado
2521
+ isSupported: l,
2522
+ isEnabled: r,
2523
+ canVibrate: P,
2524
+ hasVisualFeedback: W,
2525
+ activeVisualFeedback: o,
2526
+ // Métodos principais (compatíveis com testes)
2527
+ triggerHaptic: x,
2528
+ triggerVisualFeedback: D,
2529
+ feedback: N,
2530
+ checkSupport: O,
2531
+ // Métodos de feedback específicos
2532
+ light: k,
2533
+ medium: M,
2534
+ heavy: T,
2535
+ selection: $,
2536
+ impact: C,
2537
+ notification: h,
2538
+ custom: p,
2539
+ // Controles
2540
+ enable: w,
2541
+ disable: z,
2542
+ toggle: F,
2543
+ // Utilitários
2544
+ detectHapticSupport: u
2545
+ };
2546
+ }
2547
+ function Bs(e, i) {
2548
+ const n = localStorage.getItem(e);
2549
+ let a = i;
2550
+ if (n)
2551
+ try {
2552
+ a = JSON.parse(n);
1321
2553
  } catch {
1322
- o = l;
2554
+ a = i;
1323
2555
  }
1324
- const r = k(o);
1325
- return T(
1326
- r,
1327
- (d) => {
1328
- localStorage.setItem(e, JSON.stringify(d));
2556
+ const l = V(a);
2557
+ return H(
2558
+ l,
2559
+ (r) => {
2560
+ localStorage.setItem(e, JSON.stringify(r));
1329
2561
  },
1330
2562
  { deep: !0 }
1331
- ), r;
2563
+ ), l;
1332
2564
  }
1333
- function ml(e, l = 300) {
1334
- const s = k(e.value);
1335
- let o = null;
1336
- return T(e, (r) => {
1337
- o && clearTimeout(o), o = setTimeout(() => {
1338
- s.value = r;
1339
- }, l);
1340
- }), s;
2565
+ function Ts(e, i = 300) {
2566
+ const n = V(e.value);
2567
+ let a = null;
2568
+ return H(e, (l) => {
2569
+ a && clearTimeout(a), a = setTimeout(() => {
2570
+ n.value = l;
2571
+ }, i);
2572
+ }), n;
1341
2573
  }
1342
- function bl() {
1343
- const e = k(!1), l = k(null);
2574
+ function Ls() {
2575
+ const e = V(!1), i = V(null);
1344
2576
  return {
1345
2577
  copied: e,
1346
- error: l,
1347
- copy: async (r) => {
2578
+ error: i,
2579
+ copy: async (l) => {
1348
2580
  try {
1349
- return await navigator.clipboard.writeText(r), e.value = !0, l.value = null, setTimeout(() => {
2581
+ return await navigator.clipboard.writeText(l), e.value = !0, i.value = null, setTimeout(() => {
1350
2582
  e.value = !1;
1351
2583
  }, 2e3), !0;
1352
- } catch (d) {
1353
- return l.value = d.message || "Copy failed", e.value = !1, !1;
2584
+ } catch (r) {
2585
+ return i.value = r.message || "Copy failed", e.value = !1, !1;
1354
2586
  }
1355
2587
  },
1356
2588
  read: async () => {
1357
2589
  try {
1358
- const r = await navigator.clipboard.readText();
1359
- return l.value = null, r;
1360
- } catch (r) {
1361
- return l.value = r.message || "Read failed", "";
2590
+ const l = await navigator.clipboard.readText();
2591
+ return i.value = null, l;
2592
+ } catch (l) {
2593
+ return i.value = l.message || "Read failed", "";
1362
2594
  }
1363
2595
  }
1364
2596
  };
1365
2597
  }
1366
2598
  export {
1367
- Qt as DatametriaAlert,
1368
- jt as DatametriaAutocomplete,
1369
- tl as DatametriaAvatar,
1370
- ll as DatametriaBadge,
1371
- dl as DatametriaBreadcrumb,
1372
- Et as DatametriaButton,
1373
- Gt as DatametriaCard,
1374
- Nt as DatametriaCheckbox,
1375
- sl as DatametriaChip,
1376
- Jt as DatametriaContainer,
1377
- Pt as DatametriaDatePicker,
1378
- Yt as DatametriaDivider,
1379
- Kt as DatametriaFileUpload,
1380
- Wt as DatametriaGrid,
1381
- At as DatametriaInput,
1382
- Ht as DatametriaModal,
1383
- rl as DatametriaNavbar,
1384
- Zt as DatametriaProgress,
1385
- Rt as DatametriaRadio,
1386
- Ot as DatametriaSelect,
1387
- el as DatametriaSpinner,
1388
- Ut as DatametriaSwitch,
1389
- al as DatametriaTable,
1390
- ol as DatametriaTabs,
1391
- Ft as DatametriaTextarea,
1392
- Xt as DatametriaToast,
1393
- St as custom,
1394
- Mt as email,
1395
- Tt as maxLength,
1396
- qt as minLength,
1397
- xt as pattern,
1398
- Lt as required,
1399
- cl as useAPI,
1400
- bl as useClipboard,
1401
- ml as useDebounce,
1402
- ul as useLocalStorage,
1403
- il as useTheme,
1404
- nl as useValidation
2599
+ ds as DatametriaAlert,
2600
+ ls as DatametriaAutocomplete,
2601
+ bs as DatametriaAvatar,
2602
+ ps as DatametriaBadge,
2603
+ ys as DatametriaBreadcrumb,
2604
+ Kl as DatametriaButton,
2605
+ ss as DatametriaCard,
2606
+ Gl as DatametriaCheckbox,
2607
+ gs as DatametriaChip,
2608
+ rs as DatametriaContainer,
2609
+ Zl as DatametriaDatePicker,
2610
+ os as DatametriaDivider,
2611
+ ts as DatametriaFileUpload,
2612
+ ns as DatametriaGrid,
2613
+ Xl as DatametriaInput,
2614
+ ks as DatametriaMenu,
2615
+ is as DatametriaModal,
2616
+ _s as DatametriaNavbar,
2617
+ vs as DatametriaProgress,
2618
+ Yl as DatametriaRadio,
2619
+ Hl as DatametriaSelect,
2620
+ ms as DatametriaSkeleton,
2621
+ as as DatametriaSlider,
2622
+ fs as DatametriaSpinner,
2623
+ Jl as DatametriaSwitch,
2624
+ hs as DatametriaTable,
2625
+ $s as DatametriaTabs,
2626
+ Ql as DatametriaTextarea,
2627
+ es as DatametriaTimePicker,
2628
+ cs as DatametriaToast,
2629
+ us as DatametriaTooltip,
2630
+ Ul as custom,
2631
+ Fl as email,
2632
+ jl as maxLength,
2633
+ Al as minLength,
2634
+ Pl as pattern,
2635
+ Ol as required,
2636
+ Vs as useAPI,
2637
+ Ds as useAccessibilityScale,
2638
+ Ms as useBreakpoints,
2639
+ Ls as useClipboard,
2640
+ Ts as useDebounce,
2641
+ Is as useHapticFeedback,
2642
+ Bs as useLocalStorage,
2643
+ Cs as useRipple,
2644
+ ws as useTheme,
2645
+ xs as useValidation
1405
2646
  };