@solfacil/girassol 0.1.2 → 0.1.6

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 (62) hide show
  1. package/.vscode/extensions.json +4 -2
  2. package/.vscode/settings.json +15 -5
  3. package/README.md +1 -1
  4. package/cli/package.json +2 -12
  5. package/cli/src/commands/create:component.ts +91 -0
  6. package/cli/src/commands/generate:plugin.ts +1 -1
  7. package/cli/src/commands/generate:types.ts +1 -1
  8. package/cli/src/commands/girassol.ts +1 -1
  9. package/cli/src/extensions/cli-extension.ts +1 -1
  10. package/cli/src/templates/components/component.spec.ts.ejs +20 -0
  11. package/cli/src/templates/components/component.stories.mdx.ejs +74 -0
  12. package/cli/src/templates/components/component.vue.ejs +23 -0
  13. package/cli/src/templates/components/index.ts.ejs +10 -0
  14. package/cli/yarn.lock +31 -2860
  15. package/dist/girassol.es.js +1106 -136
  16. package/dist/girassol.umd.js +5 -5
  17. package/dist/style.css +1 -1
  18. package/dist/theme/solfacil/colors.d.ts +2 -2
  19. package/dist/theme/solfacil/index.d.ts +3 -0
  20. package/dist/theme/solfacil/utilities.d.ts +3 -0
  21. package/dist/types/components/dropdown/Dropdown.vue.d.ts +77 -0
  22. package/dist/types/components/dropdown/dropdown.spec.d.ts +1 -0
  23. package/dist/types/components/dropdown/index.d.ts +2 -0
  24. package/dist/types/components/forms/button/Button.vue.d.ts +4 -4
  25. package/dist/types/components/forms/checkbox/CheckboxGroup.vue.d.ts +1 -1
  26. package/dist/types/components/forms/checkbox/checkbox-type.d.ts +2 -2
  27. package/dist/types/components/forms/checkbox/index.d.ts +1 -1
  28. package/dist/types/components/forms/input/Input.vue.d.ts +3 -1
  29. package/dist/types/components/forms/input/index.d.ts +1 -1
  30. package/dist/types/components/forms/radio/RadioGroup.vue.d.ts +1 -1
  31. package/dist/types/components/forms/radio/index.d.ts +1 -1
  32. package/dist/types/components/forms/radio/radio-type.d.ts +2 -2
  33. package/dist/types/components/forms/select/Select.vue.d.ts +53 -0
  34. package/dist/types/components/forms/select/index.d.ts +2 -0
  35. package/dist/types/components/forms/select/select.spec.d.ts +1 -0
  36. package/dist/types/components/forms/switch/index.d.ts +1 -1
  37. package/dist/types/components/forms/textarea/Textarea.vue.d.ts +50 -0
  38. package/dist/types/components/forms/textarea/index.d.ts +2 -0
  39. package/dist/types/components/forms/textarea/textarea.spec.d.ts +1 -0
  40. package/dist/types/components/forms/textfield/Textfield.vue.d.ts +1 -1
  41. package/dist/types/components/forms/textfield/index.d.ts +1 -1
  42. package/dist/types/composables/use-toast/Toast.vue.d.ts +66 -0
  43. package/dist/types/composables/use-toast/index.d.ts +9 -0
  44. package/dist/types/composables/use-toast/types.d.ts +23 -0
  45. package/dist/types/composables/use-toast/use-toast.spec.d.ts +1 -0
  46. package/dist/types/composables/use-toast/useTimer.d.ts +9 -0
  47. package/dist/types/composables/use-toast/useTransition.d.ts +57 -0
  48. package/dist/types/index.d.ts +5 -1
  49. package/dist/vite.config.d.ts +1 -1
  50. package/dist/windi.config.d.ts +1 -1
  51. package/package.json +65 -33
  52. package/theme/solfacil/borders.ts +2 -2
  53. package/theme/solfacil/colors.ts +4 -4
  54. package/theme/solfacil/effects.ts +3 -3
  55. package/theme/solfacil/index.ts +5 -2
  56. package/theme/solfacil/miscs.ts +2 -2
  57. package/theme/solfacil/spacing.ts +1 -1
  58. package/theme/solfacil/typography.ts +2 -2
  59. package/theme/solfacil/utilities.ts +88 -3
  60. package/vite.config.ts +16 -4
  61. package/windi.config.ts +7 -4
  62. package/cli/__tests__/cli-integration.test.ts +0 -29
@@ -1,9 +1,28 @@
1
- import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createVNode, mergeProps, isRef, ref, createBlock, withCtx, withDirectives, vShow, Fragment, renderList } from "vue";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, ref, toDisplayString, createCommentVNode, createVNode, mergeProps, isRef, createBlock, withCtx, withDirectives, vShow, vModelText, Fragment, renderList, getCurrentScope, onScopeDispose, watch, reactive, withModifiers, createTextVNode, Transition as Transition$1, normalizeStyle, withKeys, onMounted, onUnmounted, render as render$8 } from "vue";
2
21
  var Button_vue_vue_type_style_index_0_lang = "";
3
- const _hoisted_1$a = ["data-testid"];
4
- const _hoisted_2$8 = { class: "icon -left" };
5
- const _hoisted_3$6 = { class: "icon -right" };
6
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
22
+ const _hoisted_1$k = ["data-testid"];
23
+ const _hoisted_2$i = { class: "icon -left" };
24
+ const _hoisted_3$g = { class: "icon -right" };
25
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
7
26
  props: {
8
27
  variant: { default: "primary" },
9
28
  dense: { type: Boolean, default: false },
@@ -27,23 +46,23 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
27
46
  `]),
28
47
  type: "button"
29
48
  }, [
30
- createElementVNode("div", _hoisted_2$8, [
49
+ createElementVNode("div", _hoisted_2$i, [
31
50
  renderSlot(_ctx.$slots, "icon-left")
32
51
  ]),
33
52
  renderSlot(_ctx.$slots, "default"),
34
- createElementVNode("div", _hoisted_3$6, [
53
+ createElementVNode("div", _hoisted_3$g, [
35
54
  renderSlot(_ctx.$slots, "icon-right")
36
55
  ])
37
- ], 10, _hoisted_1$a);
56
+ ], 10, _hoisted_1$k);
38
57
  };
39
58
  }
40
59
  });
41
- _sfc_main$8.install = (app) => {
42
- app.component("SolButton", _sfc_main$8);
60
+ _sfc_main$c.install = (app) => {
61
+ app.component("SolButton", _sfc_main$c);
43
62
  };
44
63
  var Input_vue_vue_type_style_index_0_lang = "";
45
- const _hoisted_1$9 = ["id", "data-testid", "value"];
46
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
64
+ const _hoisted_1$j = ["id", "data-testid", "value"];
65
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
47
66
  props: {
48
67
  id: null,
49
68
  modelValue: null,
@@ -51,32 +70,38 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
51
70
  error: { type: Boolean }
52
71
  },
53
72
  emits: ["update:modelValue"],
54
- setup(__props, { emit }) {
73
+ setup(__props, { expose, emit }) {
55
74
  function emitInput({ target }) {
56
- const { value } = target;
57
- emit("update:modelValue", value);
75
+ var _a2;
76
+ emit("update:modelValue", (_a2 = target == null ? void 0 : target.value) != null ? _a2 : "");
58
77
  }
78
+ const input = ref("");
79
+ expose({
80
+ input
81
+ });
59
82
  return (_ctx, _cache) => {
60
83
  return openBlock(), createElementBlock("input", {
61
84
  id: `input-${__props.id}`,
85
+ ref_key: "input",
86
+ ref: input,
62
87
  "data-testid": `input-${__props.id}`,
63
88
  value: __props.modelValue,
64
89
  class: normalizeClass(["sol-input-core", { "-invert": __props.invert, "-error": __props.error }]),
65
90
  onInput: emitInput
66
- }, null, 42, _hoisted_1$9);
91
+ }, null, 42, _hoisted_1$j);
67
92
  };
68
93
  }
69
94
  });
70
- _sfc_main$7.install = (app) => {
71
- app.component("SolInput", _sfc_main$7);
95
+ _sfc_main$b.install = (app) => {
96
+ app.component("SolInput", _sfc_main$b);
72
97
  };
73
98
  var Textfield_vue_vue_type_style_index_0_lang = "";
74
- const _hoisted_1$8 = ["id", "data-testid"];
75
- const _hoisted_2$7 = ["for"];
76
- const _hoisted_3$5 = { class: "container-input" };
77
- const _hoisted_4$3 = ["id"];
78
- const _hoisted_5 = ["id"];
79
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
99
+ const _hoisted_1$i = ["id", "data-testid"];
100
+ const _hoisted_2$h = ["for"];
101
+ const _hoisted_3$f = { class: "container-input" };
102
+ const _hoisted_4$6 = ["id"];
103
+ const _hoisted_5$3 = ["id"];
104
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
80
105
  props: {
81
106
  id: null,
82
107
  class: null,
@@ -106,11 +131,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
106
131
  return null;
107
132
  }
108
133
  return (_ctx, _cache) => {
109
- var _a;
134
+ var _a2;
110
135
  return openBlock(), createElementBlock("div", {
111
136
  id: `textfield-${__props.id}`,
112
137
  "data-testid": `textfield-${__props.id}`,
113
- class: normalizeClass([[`${(_a = _ctx.$props.class) != null ? _a : ""}`, { "-invert": __props.invert }], "sol-textfield-core"])
138
+ class: normalizeClass([[`${(_a2 = _ctx.$props.class) != null ? _a2 : ""}`, { "-invert": __props.invert }], "sol-textfield-core"])
114
139
  }, [
115
140
  renderSlot(_ctx.$slots, "label", {}, () => [
116
141
  __props.label ? (openBlock(), createElementBlock("label", {
@@ -119,20 +144,20 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
119
144
  class: "label"
120
145
  }, [
121
146
  createElementVNode("span", null, toDisplayString(__props.label), 1)
122
- ], 8, _hoisted_2$7)) : createCommentVNode("", true)
147
+ ], 8, _hoisted_2$h)) : createCommentVNode("", true)
123
148
  ]),
124
- createElementVNode("div", _hoisted_3$5, [
149
+ createElementVNode("div", _hoisted_3$f, [
125
150
  renderSlot(_ctx.$slots, "default", {}, () => [
126
- createVNode(_sfc_main$7, mergeProps(_ctx.$attrs, {
151
+ createVNode(_sfc_main$b, mergeProps(_ctx.$attrs, {
152
+ id: __props.id,
127
153
  modelValue: unref(model),
128
154
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
129
- id: __props.id,
130
155
  "data-testid": `input-${__props.id}`,
131
156
  class: [__props.error && "-error", "input"],
132
157
  invert: __props.invert,
133
158
  "aria-invalid": !!__props.error,
134
159
  "aria-describedby": ariaDescribedby(__props.hint, __props.error)
135
- }), null, 16, ["modelValue", "id", "data-testid", "class", "invert", "aria-invalid", "aria-describedby"])
160
+ }), null, 16, ["id", "modelValue", "data-testid", "class", "invert", "aria-invalid", "aria-describedby"])
136
161
  ]),
137
162
  renderSlot(_ctx.$slots, "icon")
138
163
  ]),
@@ -140,51 +165,51 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
140
165
  key: 0,
141
166
  id: `hint-${__props.id}`,
142
167
  class: "hint"
143
- }, toDisplayString(__props.hint), 9, _hoisted_4$3)) : __props.error ? (openBlock(), createElementBlock("span", {
168
+ }, toDisplayString(__props.hint), 9, _hoisted_4$6)) : __props.error ? (openBlock(), createElementBlock("span", {
144
169
  key: 1,
145
170
  id: `error-${__props.id}`,
146
171
  class: "error"
147
- }, toDisplayString(__props.error), 9, _hoisted_5)) : createCommentVNode("", true)
148
- ], 10, _hoisted_1$8);
172
+ }, toDisplayString(__props.error), 9, _hoisted_5$3)) : createCommentVNode("", true)
173
+ ], 10, _hoisted_1$i);
149
174
  };
150
175
  }
151
176
  });
152
- const _hoisted_1$7 = {
177
+ const _hoisted_1$h = {
153
178
  preserveAspectRatio: "xMidYMid meet",
154
179
  viewBox: "0 0 24 24",
155
180
  width: "1.2em",
156
181
  height: "1.2em"
157
182
  };
158
- const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("g", { fill: "currentColor" }, [
183
+ const _hoisted_2$g = /* @__PURE__ */ createElementVNode("g", { fill: "currentColor" }, [
159
184
  /* @__PURE__ */ createElementVNode("path", { d: "M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0z" }),
160
185
  /* @__PURE__ */ createElementVNode("path", { d: "M21.894 11.553C19.736 7.236 15.904 5 12 5c-3.903 0-7.736 2.236-9.894 6.553a1 1 0 0 0 0 .894C4.264 16.764 8.096 19 12 19c3.903 0 7.736-2.236 9.894-6.553a1 1 0 0 0 0-.894zM12 17c-2.969 0-6.002-1.62-7.87-5C5.998 8.62 9.03 7 12 7c2.969 0 6.002 1.62 7.87 5c-1.868 3.38-4.901 5-7.87 5z" })
161
186
  ], -1);
162
- const _hoisted_3$4 = [
163
- _hoisted_2$6
187
+ const _hoisted_3$e = [
188
+ _hoisted_2$g
164
189
  ];
165
- function render$1(_ctx, _cache) {
166
- return openBlock(), createElementBlock("svg", _hoisted_1$7, _hoisted_3$4);
190
+ function render$7(_ctx, _cache) {
191
+ return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_3$e);
167
192
  }
168
- var EyeOn = { name: "mi-eye", render: render$1 };
169
- const _hoisted_1$6 = {
193
+ var EyeOn = { name: "mi-eye", render: render$7 };
194
+ const _hoisted_1$g = {
170
195
  preserveAspectRatio: "xMidYMid meet",
171
196
  viewBox: "0 0 24 24",
172
197
  width: "1.2em",
173
198
  height: "1.2em"
174
199
  };
175
- const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("path", {
200
+ const _hoisted_2$f = /* @__PURE__ */ createElementVNode("path", {
176
201
  fill: "currentColor",
177
202
  d: "M4.707 3.293a1 1 0 0 0-1.414 1.414l2.424 2.424c-1.43 1.076-2.678 2.554-3.611 4.422a1 1 0 0 0 0 .894C4.264 16.764 8.096 19 12 19c1.555 0 3.1-.355 4.53-1.055l2.763 2.762a1 1 0 0 0 1.414-1.414l-16-16zm10.307 13.135c-.98.383-2 .572-3.014.572c-2.969 0-6.002-1.62-7.87-5c.817-1.479 1.858-2.62 3.018-3.437l2.144 2.144a3 3 0 0 0 4.001 4.001l1.72 1.72zm3.538-2.532c.483-.556.926-1.187 1.318-1.896c-1.868-3.38-4.9-5-7.87-5c-.112 0-.224.002-.336.007L9.879 5.223A10.215 10.215 0 0 1 12 5c3.903 0 7.736 2.236 9.894 6.553a1 1 0 0 1 0 .894a13.106 13.106 0 0 1-1.925 2.865l-1.417-1.416z"
178
203
  }, null, -1);
179
- const _hoisted_3$3 = [
180
- _hoisted_2$5
204
+ const _hoisted_3$d = [
205
+ _hoisted_2$f
181
206
  ];
182
- function render(_ctx, _cache) {
183
- return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_3$3);
207
+ function render$6(_ctx, _cache) {
208
+ return openBlock(), createElementBlock("svg", _hoisted_1$g, _hoisted_3$d);
184
209
  }
185
- var EyeOff = { name: "mi-eye-off", render };
186
- const _hoisted_1$5 = ["aria-label"];
187
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
210
+ var EyeOff = { name: "mi-eye-off", render: render$6 };
211
+ const _hoisted_1$f = ["aria-label"];
212
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
188
213
  props: {
189
214
  id: { default: "" },
190
215
  label: { default: "Sua senha" }
@@ -193,7 +218,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
193
218
  const passwordIsVisible = ref(false);
194
219
  const inputType = computed(() => passwordIsVisible.value ? "text" : "password");
195
220
  return (_ctx, _cache) => {
196
- return openBlock(), createBlock(_sfc_main$6, {
221
+ return openBlock(), createBlock(_sfc_main$a, {
197
222
  id: __props.id,
198
223
  required: "",
199
224
  type: unref(inputType),
@@ -213,23 +238,108 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
213
238
  withDirectives(createVNode(unref(EyeOff), { "aria-hidden": "true" }, null, 512), [
214
239
  [vShow, !passwordIsVisible.value]
215
240
  ])
216
- ], 8, _hoisted_1$5)
241
+ ], 8, _hoisted_1$f)
217
242
  ]),
218
243
  _: 1
219
244
  }, 8, ["id", "type", "label"]);
220
245
  };
221
246
  }
222
247
  });
223
- _sfc_main$6.install = (app) => {
224
- app.component("SolTextfield", _sfc_main$6);
248
+ _sfc_main$a.install = (app) => {
249
+ app.component("SolTextfield", _sfc_main$a);
225
250
  };
226
- _sfc_main$5.install = (app) => {
227
- app.component("SolTextfieldPassword", _sfc_main$5);
251
+ _sfc_main$9.install = (app) => {
252
+ app.component("SolTextfieldPassword", _sfc_main$9);
253
+ };
254
+ var Textarea_vue_vue_type_style_index_0_lang = "";
255
+ const _hoisted_1$e = ["id", "data-testid"];
256
+ const _hoisted_2$e = ["for"];
257
+ const _hoisted_3$c = { class: "container-textarea" };
258
+ const _hoisted_4$5 = ["id", "data-testid", "invert", "aria-invalid", "aria-describedby"];
259
+ const _hoisted_5$2 = ["id"];
260
+ const _hoisted_6$2 = ["id"];
261
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
262
+ props: {
263
+ id: null,
264
+ class: null,
265
+ modelValue: { default: "" },
266
+ label: { default: "label" },
267
+ hint: null,
268
+ invert: { type: Boolean },
269
+ resize: { default: "both" },
270
+ error: null
271
+ },
272
+ emits: ["update:modelValue"],
273
+ setup(__props, { emit }) {
274
+ const props = __props;
275
+ const model = computed({
276
+ get: () => props.modelValue,
277
+ set: (inputValue) => {
278
+ emit("update:modelValue", inputValue);
279
+ }
280
+ });
281
+ function showHint(hint, error) {
282
+ return !!hint && !error;
283
+ }
284
+ function ariaDescribedby(hint, error) {
285
+ if (error)
286
+ return `error-${props.id}`;
287
+ if (showHint(hint, error))
288
+ return `hint-${props.id}`;
289
+ return null;
290
+ }
291
+ return (_ctx, _cache) => {
292
+ var _a2;
293
+ return openBlock(), createElementBlock("div", {
294
+ id: `textarea-${__props.id}`,
295
+ "data-testid": `textarea-${__props.id}`,
296
+ class: normalizeClass([[`${(_a2 = _ctx.$props.class) != null ? _a2 : ""}`, { "-invert": __props.invert }], "sol-textarea-core"])
297
+ }, [
298
+ renderSlot(_ctx.$slots, "label", {}, () => [
299
+ __props.label ? (openBlock(), createElementBlock("label", {
300
+ key: 0,
301
+ for: `input-${__props.id}`,
302
+ class: "label"
303
+ }, [
304
+ createElementVNode("span", null, toDisplayString(__props.label), 1)
305
+ ], 8, _hoisted_2$e)) : createCommentVNode("", true)
306
+ ]),
307
+ createElementVNode("div", _hoisted_3$c, [
308
+ renderSlot(_ctx.$slots, "default", {}, () => [
309
+ withDirectives(createElementVNode("textarea", mergeProps(_ctx.$attrs, {
310
+ id: `input-${__props.id}`,
311
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
312
+ "data-testid": `input-${__props.id}`,
313
+ class: [__props.error && "-error", "textarea"],
314
+ invert: __props.invert,
315
+ style: { resize: __props.resize },
316
+ "aria-invalid": !!__props.error,
317
+ "aria-describedby": ariaDescribedby(__props.hint, __props.error)
318
+ }), null, 16, _hoisted_4$5), [
319
+ [vModelText, unref(model)]
320
+ ])
321
+ ])
322
+ ]),
323
+ showHint(__props.hint, __props.error) ? (openBlock(), createElementBlock("span", {
324
+ key: 0,
325
+ id: `hint-${__props.id}`,
326
+ class: "hint"
327
+ }, toDisplayString(__props.hint), 9, _hoisted_5$2)) : __props.error ? (openBlock(), createElementBlock("span", {
328
+ key: 1,
329
+ id: `error-${__props.id}`,
330
+ class: "error"
331
+ }, toDisplayString(__props.error), 9, _hoisted_6$2)) : createCommentVNode("", true)
332
+ ], 10, _hoisted_1$e);
333
+ };
334
+ }
335
+ });
336
+ _sfc_main$8.install = (app) => {
337
+ app.component("SolTextarea", _sfc_main$8);
228
338
  };
229
339
  var Radio_vue_vue_type_style_index_0_lang = "";
230
- const _hoisted_1$4 = ["id", "data-testid", "checked", "value", "name"];
231
- const _hoisted_2$4 = ["for"];
232
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
340
+ const _hoisted_1$d = ["id", "data-testid", "checked", "value", "name"];
341
+ const _hoisted_2$d = ["for"];
342
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
233
343
  props: {
234
344
  id: null,
235
345
  name: null,
@@ -242,32 +352,32 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
242
352
  setup(__props, { emit }) {
243
353
  return (_ctx, _cache) => {
244
354
  return openBlock(), createElementBlock("div", {
245
- class: normalizeClass(["sol-radio-core", __props.class])
355
+ class: normalizeClass(["sol-radio-core", _ctx.$props.class])
246
356
  }, [
247
357
  createElementVNode("input", mergeProps(_ctx.$attrs, {
358
+ id: `radio-${__props.name}-${__props.id}`,
248
359
  type: "radio",
249
360
  class: "radio",
250
- id: `radio-${__props.name}-${__props.id}`,
251
361
  "data-testid": `radio-${__props.name}-${__props.id}`,
252
362
  checked: __props.checked,
253
363
  value: __props.value,
254
364
  name: __props.name,
255
365
  onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
256
- }), null, 16, _hoisted_1$4),
366
+ }), null, 16, _hoisted_1$d),
257
367
  createElementVNode("label", {
258
368
  class: "label",
259
369
  for: `radio-${__props.name}-${__props.id}`
260
- }, toDisplayString(__props.label), 9, _hoisted_2$4)
370
+ }, toDisplayString(__props.label), 9, _hoisted_2$d)
261
371
  ], 2);
262
372
  };
263
373
  }
264
374
  });
265
375
  var RadioGroup_vue_vue_type_style_index_0_lang = "";
266
- const _hoisted_1$3 = ["aria-labelledby"];
267
- const _hoisted_2$3 = ["id", "data-testid"];
268
- const _hoisted_3$2 = ["id"];
269
- const _hoisted_4$2 = ["id"];
270
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
376
+ const _hoisted_1$c = ["aria-labelledby"];
377
+ const _hoisted_2$c = ["id", "data-testid"];
378
+ const _hoisted_3$b = ["id"];
379
+ const _hoisted_4$4 = ["id"];
380
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
271
381
  props: {
272
382
  id: null,
273
383
  title: null,
@@ -307,10 +417,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
307
417
  id: `radio-group-title-${__props.id}`
308
418
  }, () => [
309
419
  createElementVNode("legend", {
310
- class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
311
420
  id: `radio-group-title-${__props.id}`,
421
+ class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
312
422
  "data-testid": `radio-group-title-${__props.id}`
313
- }, toDisplayString(__props.title), 11, _hoisted_2$3)
423
+ }, toDisplayString(__props.title), 11, _hoisted_2$c)
314
424
  ]),
315
425
  createElementVNode("ul", {
316
426
  class: normalizeClass(["container-radios", { "flex-col": __props.direction === "column" }])
@@ -320,11 +430,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
320
430
  direction: __props.direction
321
431
  }, () => [
322
432
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.radios, (radio, index) => {
323
- var _a;
433
+ var _a2;
324
434
  return openBlock(), createElementBlock("li", { key: index }, [
325
- createVNode(_sfc_main$4, mergeProps(_ctx.$attrs, {
435
+ createVNode(_sfc_main$7, mergeProps(_ctx.$attrs, {
436
+ id: (_a2 = radio == null ? void 0 : radio.id) != null ? _a2 : `${radio.value}`,
326
437
  class: ["radio", { "mb-micro": __props.direction === "column", "mr-micro": __props.direction === "row" }],
327
- id: (_a = radio == null ? void 0 : radio.id) != null ? _a : `${radio.value}`,
328
438
  name: radio.name,
329
439
  value: radio.value,
330
440
  label: radio.label,
@@ -332,7 +442,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
332
442
  "aria-invalid": !!__props.error,
333
443
  "aria-describedby": ariaDescribedby(__props.hint, __props.error),
334
444
  onChange: ($event) => emitUpdatedValue(radio)
335
- }), null, 16, ["class", "id", "name", "value", "label", "checked", "aria-invalid", "aria-describedby", "onChange"])
445
+ }), null, 16, ["id", "class", "name", "value", "label", "checked", "aria-invalid", "aria-describedby", "onChange"])
336
446
  ]);
337
447
  }), 128))
338
448
  ])
@@ -341,25 +451,25 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
341
451
  key: 0,
342
452
  id: `hint-${__props.id}`,
343
453
  class: "hint"
344
- }, toDisplayString(__props.hint), 9, _hoisted_3$2)) : __props.error ? (openBlock(), createElementBlock("p", {
454
+ }, toDisplayString(__props.hint), 9, _hoisted_3$b)) : __props.error ? (openBlock(), createElementBlock("p", {
345
455
  key: 1,
346
456
  id: `error-${__props.id}`,
347
457
  class: "error"
348
- }, toDisplayString(__props.error), 9, _hoisted_4$2)) : createCommentVNode("", true)
349
- ], 8, _hoisted_1$3);
458
+ }, toDisplayString(__props.error), 9, _hoisted_4$4)) : createCommentVNode("", true)
459
+ ], 8, _hoisted_1$c);
350
460
  };
351
461
  }
352
462
  });
353
- _sfc_main$4.install = (app) => {
354
- app.component("SolRadio", _sfc_main$4);
463
+ _sfc_main$7.install = (app) => {
464
+ app.component("SolRadio", _sfc_main$7);
355
465
  };
356
- _sfc_main$3.install = (app) => {
357
- app.component("SolRadioGroup", _sfc_main$3);
466
+ _sfc_main$6.install = (app) => {
467
+ app.component("SolRadioGroup", _sfc_main$6);
358
468
  };
359
469
  var Checkbox_vue_vue_type_style_index_0_lang = "";
360
- const _hoisted_1$2 = ["id", "data-testid", "checked", "value", "name"];
361
- const _hoisted_2$2 = ["for"];
362
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
470
+ const _hoisted_1$b = ["id", "data-testid", "checked", "value", "name"];
471
+ const _hoisted_2$b = ["for"];
472
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
363
473
  props: {
364
474
  id: null,
365
475
  name: null,
@@ -372,32 +482,32 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
372
482
  setup(__props, { emit }) {
373
483
  return (_ctx, _cache) => {
374
484
  return openBlock(), createElementBlock("div", {
375
- class: normalizeClass(["sol-checkbox-core", __props.class])
485
+ class: normalizeClass(["sol-checkbox-core", _ctx.$props.class])
376
486
  }, [
377
487
  createElementVNode("input", mergeProps(_ctx.$attrs, {
488
+ id: `checkbox-${__props.name}-${__props.id}`,
378
489
  type: "checkbox",
379
490
  class: "checkbox",
380
- id: `checkbox-${__props.name}-${__props.id}`,
381
491
  "data-testid": `checkbox-${__props.name}-${__props.id}`,
382
492
  checked: __props.checked,
383
493
  value: __props.value,
384
494
  name: __props.name,
385
495
  onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
386
- }), null, 16, _hoisted_1$2),
496
+ }), null, 16, _hoisted_1$b),
387
497
  createElementVNode("label", {
388
498
  class: "label",
389
499
  for: `checkbox-${__props.name}-${__props.id}`
390
- }, toDisplayString(__props.label), 9, _hoisted_2$2)
500
+ }, toDisplayString(__props.label), 9, _hoisted_2$b)
391
501
  ], 2);
392
502
  };
393
503
  }
394
504
  });
395
505
  var CheckboxGroup_vue_vue_type_style_index_0_lang = "";
396
- const _hoisted_1$1 = ["aria-labelledby"];
397
- const _hoisted_2$1 = ["id", "data-testid"];
398
- const _hoisted_3$1 = ["id"];
399
- const _hoisted_4$1 = ["id"];
400
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
506
+ const _hoisted_1$a = ["aria-labelledby"];
507
+ const _hoisted_2$a = ["id", "data-testid"];
508
+ const _hoisted_3$a = ["id"];
509
+ const _hoisted_4$3 = ["id"];
510
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
401
511
  props: {
402
512
  id: null,
403
513
  title: null,
@@ -422,21 +532,20 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
422
532
  return null;
423
533
  }
424
534
  function isChecked(value) {
425
- var _a;
426
- return (_a = props == null ? void 0 : props.modelValue) == null ? void 0 : _a.includes(value);
535
+ var _a2;
536
+ return (_a2 = props == null ? void 0 : props.modelValue) == null ? void 0 : _a2.includes(value);
427
537
  }
428
538
  function sanitizeNewModelValue(value) {
429
539
  return Array.isArray(props == null ? void 0 : props.modelValue) ? [...props.modelValue, value] : [value];
430
540
  }
431
541
  function emitUpdatedValue(checkbox) {
432
- var _a;
542
+ var _a2;
433
543
  emit("change", checkbox.value);
434
- const checked = isChecked(checkbox.value) ? (_a = props.modelValue) == null ? void 0 : _a.filter((value) => value !== checkbox.value) : sanitizeNewModelValue(checkbox.value);
544
+ const checked = isChecked(checkbox.value) ? (_a2 = props.modelValue) == null ? void 0 : _a2.filter((value) => value !== checkbox.value) : sanitizeNewModelValue(checkbox.value);
435
545
  emit("update:modelValue", checked);
436
546
  }
437
547
  return (_ctx, _cache) => {
438
548
  return openBlock(), createElementBlock("fieldset", {
439
- role: "group",
440
549
  class: "sol-checkbox-group-core",
441
550
  "aria-labelledby": `checkbox-group-title-${__props.id}`
442
551
  }, [
@@ -444,10 +553,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
444
553
  id: `checkbox-group-title-${__props.id}`
445
554
  }, () => [
446
555
  createElementVNode("legend", {
447
- class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
448
556
  id: `checkbox-group-title-${__props.id}`,
557
+ class: normalizeClass(["title", { "sr-only": __props.hideTitle }]),
449
558
  "data-testid": `checkbox-group-title-${__props.id}`
450
- }, toDisplayString(__props.title), 11, _hoisted_2$1)
559
+ }, toDisplayString(__props.title), 11, _hoisted_2$a)
451
560
  ]),
452
561
  createElementVNode("ul", {
453
562
  class: normalizeClass(["container-checkboxes", { "flex-col": __props.direction === "column" }])
@@ -457,11 +566,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
457
566
  direction: __props.direction
458
567
  }, () => [
459
568
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.checkboxes, (checkbox, index) => {
460
- var _a;
569
+ var _a2;
461
570
  return openBlock(), createElementBlock("li", { key: index }, [
462
- createVNode(_sfc_main$2, mergeProps(_ctx.$attrs, {
571
+ createVNode(_sfc_main$5, mergeProps(_ctx.$attrs, {
572
+ id: (_a2 = checkbox == null ? void 0 : checkbox.id) != null ? _a2 : `${checkbox.value}`,
463
573
  class: ["checkbox", { "mb-micro": __props.direction === "column", "mr-micro": __props.direction === "row" }],
464
- id: (_a = checkbox == null ? void 0 : checkbox.id) != null ? _a : `${checkbox.value}`,
465
574
  label: checkbox.label,
466
575
  name: checkbox.name,
467
576
  value: checkbox.value,
@@ -469,7 +578,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
469
578
  "aria-invalid": !!__props.error,
470
579
  "aria-describedby": ariaDescribedby(__props.hint, __props.error),
471
580
  onChange: ($event) => emitUpdatedValue(checkbox)
472
- }), null, 16, ["class", "id", "label", "name", "value", "checked", "aria-invalid", "aria-describedby", "onChange"])
581
+ }), null, 16, ["id", "class", "label", "name", "value", "checked", "aria-invalid", "aria-describedby", "onChange"])
473
582
  ]);
474
583
  }), 128))
475
584
  ])
@@ -478,27 +587,27 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
478
587
  key: 0,
479
588
  id: `hint-${__props.id}`,
480
589
  class: "hint"
481
- }, toDisplayString(__props.hint), 9, _hoisted_3$1)) : __props.error ? (openBlock(), createElementBlock("p", {
590
+ }, toDisplayString(__props.hint), 9, _hoisted_3$a)) : __props.error ? (openBlock(), createElementBlock("p", {
482
591
  key: 1,
483
592
  id: `error-${__props.id}`,
484
593
  class: "error"
485
- }, toDisplayString(__props.error), 9, _hoisted_4$1)) : createCommentVNode("", true)
486
- ], 8, _hoisted_1$1);
594
+ }, toDisplayString(__props.error), 9, _hoisted_4$3)) : createCommentVNode("", true)
595
+ ], 8, _hoisted_1$a);
487
596
  };
488
597
  }
489
598
  });
490
- _sfc_main$2.install = (app) => {
491
- app.component("SolCheckbox", _sfc_main$2);
599
+ _sfc_main$5.install = (app) => {
600
+ app.component("SolCheckbox", _sfc_main$5);
492
601
  };
493
- _sfc_main$1.install = (app) => {
494
- app.component("SolCheckboxGroup", _sfc_main$1);
602
+ _sfc_main$4.install = (app) => {
603
+ app.component("SolCheckboxGroup", _sfc_main$4);
495
604
  };
496
605
  var Switch_vue_vue_type_style_index_0_lang = "";
497
- const _hoisted_1 = ["for", "id", "data-testid"];
498
- const _hoisted_2 = { class: "switch-container" };
499
- const _hoisted_3 = ["id", "aria-labelledby", "data-testid", "checked", "value", "name"];
500
- const _hoisted_4 = /* @__PURE__ */ createElementVNode("span", { class: "ellipse" }, null, -1);
501
- const _sfc_main = /* @__PURE__ */ defineComponent({
606
+ const _hoisted_1$9 = ["id", "for", "data-testid"];
607
+ const _hoisted_2$9 = { class: "switch-container" };
608
+ const _hoisted_3$9 = ["id", "aria-checked", "aria-labelledby", "data-testid", "checked", "value", "name"];
609
+ const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("span", { class: "ellipse" }, null, -1);
610
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
502
611
  props: {
503
612
  id: null,
504
613
  name: null,
@@ -516,48 +625,910 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
516
625
  class: normalizeClass(["sol-switch-core", [_ctx.$props.class, { "-horizontal": __props.horizontalLabel }]])
517
626
  }, [
518
627
  createElementVNode("label", {
628
+ id: `switch-label-${__props.name}-${__props.id}`,
519
629
  class: normalizeClass(["label", { "mb-1": !__props.horizontalLabel, "sr-only": __props.hideLabel }]),
520
630
  for: `switch-${__props.name}-${__props.id}`,
521
- id: `switch-label-${__props.name}-${__props.id}`,
522
631
  "data-testid": `switch-label-${__props.name}-${__props.id}`
523
- }, toDisplayString(__props.label), 11, _hoisted_1),
524
- createElementVNode("div", _hoisted_2, [
632
+ }, toDisplayString(__props.label), 11, _hoisted_1$9),
633
+ createElementVNode("div", _hoisted_2$9, [
525
634
  createElementVNode("input", mergeProps(_ctx.$attrs, {
635
+ id: `switch-${__props.name}-${__props.id}`,
526
636
  type: "checkbox",
527
637
  class: "switch",
528
638
  role: "switch",
529
- id: `switch-${__props.name}-${__props.id}`,
639
+ "aria-checked": __props.checked,
530
640
  "aria-labelledby": `switch-label-${__props.name}-${__props.id}`,
531
641
  "data-testid": `switch-${__props.name}-${__props.id}`,
532
642
  checked: __props.checked,
533
643
  value: __props.value,
534
644
  name: __props.name,
535
645
  onChange: _cache[0] || (_cache[0] = ($event) => emit("change", __props.value))
536
- }), null, 16, _hoisted_3),
537
- _hoisted_4
646
+ }), null, 16, _hoisted_3$9),
647
+ _hoisted_4$2
538
648
  ])
539
649
  ], 2);
540
650
  };
541
651
  }
542
652
  });
543
- _sfc_main.install = (app) => {
544
- app.component("SolSwitch", _sfc_main);
653
+ _sfc_main$3.install = (app) => {
654
+ app.component("SolSwitch", _sfc_main$3);
655
+ };
656
+ function tryOnScopeDispose(fn) {
657
+ if (getCurrentScope()) {
658
+ onScopeDispose(fn);
659
+ return true;
660
+ }
661
+ return false;
662
+ }
663
+ var _a;
664
+ const isClient = typeof window !== "undefined";
665
+ const isString = (val) => typeof val === "string";
666
+ const noop = () => {
667
+ };
668
+ isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
669
+ function unrefElement(elRef) {
670
+ var _a2;
671
+ const plain = unref(elRef);
672
+ return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
673
+ }
674
+ const defaultWindow = isClient ? window : void 0;
675
+ isClient ? window.document : void 0;
676
+ isClient ? window.navigator : void 0;
677
+ isClient ? window.location : void 0;
678
+ function useEventListener(...args) {
679
+ let target;
680
+ let event;
681
+ let listener;
682
+ let options;
683
+ if (isString(args[0])) {
684
+ [event, listener, options] = args;
685
+ target = defaultWindow;
686
+ } else {
687
+ [target, event, listener, options] = args;
688
+ }
689
+ if (!target)
690
+ return noop;
691
+ let cleanup = noop;
692
+ const stopWatch = watch(() => unrefElement(target), (el) => {
693
+ cleanup();
694
+ if (!el)
695
+ return;
696
+ el.addEventListener(event, listener, options);
697
+ cleanup = () => {
698
+ el.removeEventListener(event, listener, options);
699
+ cleanup = noop;
700
+ };
701
+ }, { immediate: true, flush: "post" });
702
+ const stop = () => {
703
+ stopWatch();
704
+ cleanup();
705
+ };
706
+ tryOnScopeDispose(stop);
707
+ return stop;
708
+ }
709
+ function onClickOutside(target, handler, options = {}) {
710
+ const { window: window2 = defaultWindow, ignore, capture = true } = options;
711
+ if (!window2)
712
+ return;
713
+ const shouldListen = ref(true);
714
+ let fallback;
715
+ const listener = (event) => {
716
+ window2.clearTimeout(fallback);
717
+ const el = unrefElement(target);
718
+ const composedPath = event.composedPath();
719
+ if (!el || el === event.target || composedPath.includes(el) || !shouldListen.value)
720
+ return;
721
+ if (ignore && ignore.length > 0) {
722
+ if (ignore.some((target2) => {
723
+ const el2 = unrefElement(target2);
724
+ return el2 && (event.target === el2 || composedPath.includes(el2));
725
+ }))
726
+ return;
727
+ }
728
+ handler(event);
729
+ };
730
+ const cleanup = [
731
+ useEventListener(window2, "click", listener, { passive: true, capture }),
732
+ useEventListener(window2, "pointerdown", (e) => {
733
+ const el = unrefElement(target);
734
+ shouldListen.value = !!el && !e.composedPath().includes(el);
735
+ }, { passive: true }),
736
+ useEventListener(window2, "pointerup", (e) => {
737
+ fallback = window2.setTimeout(() => listener(e), 50);
738
+ }, { passive: true })
739
+ ];
740
+ const stop = () => cleanup.forEach((fn) => fn());
741
+ return stop;
742
+ }
743
+ const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
744
+ const globalKey = "__vueuse_ssr_handlers__";
745
+ _global[globalKey] = _global[globalKey] || {};
746
+ _global[globalKey];
747
+ const _hoisted_1$8 = {
748
+ preserveAspectRatio: "xMidYMid meet",
749
+ viewBox: "0 0 24 24",
750
+ width: "1.2em",
751
+ height: "1.2em"
752
+ };
753
+ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("path", {
754
+ fill: "currentColor",
755
+ d: "M10 4a6 6 0 1 0 0 12a6 6 0 0 0 0-12zm-8 6a8 8 0 1 1 14.32 4.906l5.387 5.387a1 1 0 0 1-1.414 1.414l-5.387-5.387A8 8 0 0 1 2 10z"
756
+ }, null, -1);
757
+ const _hoisted_3$8 = [
758
+ _hoisted_2$8
759
+ ];
760
+ function render$5(_ctx, _cache) {
761
+ return openBlock(), createElementBlock("svg", _hoisted_1$8, _hoisted_3$8);
762
+ }
763
+ var IconSearch = { name: "mi-search", render: render$5 };
764
+ var Dropdown_vue_vue_type_style_index_0_lang = "";
765
+ const _hoisted_1$7 = ["data-testid"];
766
+ const _hoisted_2$7 = ["id", "for"];
767
+ const _hoisted_3$7 = ["id", "disabled", "data-testid", "aria-expanded", "aria-labelledby", "aria-controls", "onClick"];
768
+ const _hoisted_4$1 = { class: "dropdown-container" };
769
+ const _hoisted_5$1 = ["id", "data-testid", "aria-multiselectable", "aria-labelledby"];
770
+ const _hoisted_6$1 = ["id", "data-testid", "selected", "aria-selected", "onClick", "onKeyup"];
771
+ const _hoisted_7 = {
772
+ key: 0,
773
+ class: "no-data"
774
+ };
775
+ const _hoisted_8 = /* @__PURE__ */ createTextVNode(" Sem dados ");
776
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
777
+ props: {
778
+ id: null,
779
+ label: null,
780
+ disabled: { type: Boolean },
781
+ loading: { type: Boolean, default: false },
782
+ searchable: { type: Boolean, default: false },
783
+ closeOnSelect: { type: Boolean, default: true },
784
+ fetchOnSearch: { type: Boolean, default: false },
785
+ isMultipleSelect: { type: Boolean },
786
+ searchPlaceholder: null,
787
+ selected: null,
788
+ options: { default: () => [] }
789
+ },
790
+ emits: ["closeDropdown", "search", "update:selected"],
791
+ setup(__props, { emit }) {
792
+ const props = __props;
793
+ const el = ref();
794
+ const isDropdownOpen = ref(false);
795
+ const filter = ref("");
796
+ const filtered = computed(() => {
797
+ var _a2;
798
+ return props.fetchOnSearch ? props.options : (_a2 = props.options) == null ? void 0 : _a2.filter((option) => typeof option === "string" ? option.includes(filter.value) : option.name.includes(filter.value));
799
+ });
800
+ const selectedSanitize = computed(() => Array.isArray(props.selected) ? props.selected.join(", ").trim() : props.selected);
801
+ onClickOutside(el, () => {
802
+ if (isDropdownOpen.value)
803
+ close2();
804
+ });
805
+ function toggleDropdown() {
806
+ if (!props.disabled)
807
+ isDropdownOpen.value ? close2() : open();
808
+ }
809
+ function open() {
810
+ isDropdownOpen.value = true;
811
+ }
812
+ function close2() {
813
+ resetStates();
814
+ emit("closeDropdown");
815
+ }
816
+ function sanitizeMultipleSelection(selectedValue) {
817
+ const selected = new Set(props.selected);
818
+ selected.has(selectedValue) ? selected.delete(selectedValue) : selected.add(selectedValue);
819
+ return [...selected];
820
+ }
821
+ function select(selected) {
822
+ const value = typeof selected === "string" ? selected : selected.value;
823
+ const sanitize = props.isMultipleSelect ? sanitizeMultipleSelection(value) : value;
824
+ emit("update:selected", sanitize);
825
+ if (props.closeOnSelect && !props.isMultipleSelect)
826
+ close2();
827
+ }
828
+ function isSelected(option) {
829
+ if (Array.isArray(props.selected)) {
830
+ return typeof option === "string" ? props.selected.includes(option) : props.selected.includes(option.value);
831
+ }
832
+ return typeof option === "string" ? option === props.selected : option.value === props.selected;
833
+ }
834
+ const elements = reactive({
835
+ list: void 0,
836
+ search: void 0
837
+ });
838
+ const elementFocus = reactive({
839
+ id: "",
840
+ index: 0
841
+ });
842
+ function navigation({ code }) {
843
+ const focusListItem = (index) => {
844
+ const indexItem = index != null ? index : elementFocus.index;
845
+ if (index !== void 0)
846
+ elementFocus.index = index;
847
+ setTimeout(() => {
848
+ var _a2, _b;
849
+ const item = (_a2 = elements.list) == null ? void 0 : _a2.children[indexItem];
850
+ elementFocus.id = (_b = item == null ? void 0 : item.id) != null ? _b : "";
851
+ item == null ? void 0 : item.focus();
852
+ }, 0);
853
+ };
854
+ const focusSearch = () => {
855
+ var _a2;
856
+ if (props.searchable) {
857
+ elementFocus.index = 0;
858
+ (_a2 = elements == null ? void 0 : elements.search) == null ? void 0 : _a2.focus();
859
+ }
860
+ };
861
+ switch (code) {
862
+ case "ArrowUp":
863
+ elementFocus.index > 0 && (elementFocus.index -= 1);
864
+ return focusListItem();
865
+ case "ArrowDown":
866
+ if (!isDropdownOpen.value) {
867
+ open();
868
+ return focusListItem(0);
869
+ }
870
+ elementFocus.index < filtered.value.length - 1 && (elementFocus.index += 1);
871
+ return focusListItem();
872
+ case "Home":
873
+ return focusListItem(0);
874
+ case "End":
875
+ return focusListItem(props.options.length - 1);
876
+ case "Escape":
877
+ return close2();
878
+ default:
879
+ !["Enter", "NumpadEnter", "Space"].includes(code) && focusSearch();
880
+ }
881
+ }
882
+ function resetStates() {
883
+ isDropdownOpen.value = false;
884
+ elementFocus.index = 0;
885
+ filter.value = "";
886
+ }
887
+ function getOption(option, key) {
888
+ return typeof option === "string" ? option : option[key != null ? key : "value"];
889
+ }
890
+ return (_ctx, _cache) => {
891
+ return openBlock(), createElementBlock("div", {
892
+ ref_key: "el",
893
+ ref: el,
894
+ class: "sol-dropdown-core",
895
+ "data-testid": `dropdown-${__props.id}`,
896
+ onKeydownPassive: navigation
897
+ }, [
898
+ renderSlot(_ctx.$slots, "label", {}, () => [
899
+ __props.label ? (openBlock(), createElementBlock("label", {
900
+ key: 0,
901
+ id: `label-dropdown-${__props.id}`,
902
+ class: normalizeClass(["label", { "-disabled": __props.disabled }]),
903
+ for: `toggle-dropdown-${__props.id}`
904
+ }, toDisplayString(__props.label), 11, _hoisted_2$7)) : createCommentVNode("", true)
905
+ ]),
906
+ createElementVNode("button", {
907
+ id: `toggle-dropdown-${__props.id}`,
908
+ disabled: __props.disabled,
909
+ "data-testid": `toggle-dropdown-${__props.id}`,
910
+ class: "button-toggle-dropdown toggle-dropdown",
911
+ "aria-haspopup": "listbox",
912
+ "aria-expanded": isDropdownOpen.value,
913
+ "aria-labelledby": `label-dropdown-${__props.id}`,
914
+ "aria-controls": `dropdown-list-${__props.id}`,
915
+ onClick: withModifiers(toggleDropdown, ["stop"])
916
+ }, [
917
+ renderSlot(_ctx.$slots, "toggle-dropdown", {
918
+ toggle: { open, close: close2, toggleDropdown },
919
+ isOpen: isDropdownOpen.value,
920
+ selectedSanitized: unref(selectedSanitize),
921
+ selected: __props.selected
922
+ }, () => [
923
+ createTextVNode(toDisplayString(unref(selectedSanitize) || "Selecione"), 1)
924
+ ])
925
+ ], 8, _hoisted_3$7),
926
+ createVNode(Transition$1, {
927
+ mode: "out-in",
928
+ name: "dropdown"
929
+ }, {
930
+ default: withCtx(() => [
931
+ withDirectives(createElementVNode("div", _hoisted_4$1, [
932
+ __props.searchable ? (openBlock(), createElementBlock("div", {
933
+ key: 0,
934
+ class: normalizeClass(["search-container", { "-loading": __props.loading }])
935
+ }, [
936
+ renderSlot(_ctx.$slots, "search", { filter: filter.value }, () => [
937
+ createVNode(_sfc_main$b, {
938
+ id: `search-dropdown-${__props.id}`,
939
+ ref: (target) => unref(elements).search = target == null ? void 0 : target.input,
940
+ modelValue: filter.value,
941
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter.value = $event),
942
+ "data-testid": `search-dropdown-${__props.id}`,
943
+ role: "combobox",
944
+ class: "search",
945
+ "aria-autocomplete": "list",
946
+ placeholder: __props.searchPlaceholder,
947
+ "aria-expanded": isDropdownOpen.value,
948
+ "aria-haspopup": "listbox",
949
+ "aria-owns": `dropdown-list-${__props.id}`,
950
+ "aria-controls": `dropdown-list-${__props.id}`,
951
+ "aria-activedescendant": unref(elementFocus).id,
952
+ "aria-labelledby": `label-dropdown-${__props.id}`,
953
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => {
954
+ }, ["stop"])),
955
+ onInput: _cache[2] || (_cache[2] = ($event) => {
956
+ var _a2;
957
+ return emit("search", (_a2 = $event.target) == null ? void 0 : _a2.value);
958
+ })
959
+ }, null, 8, ["id", "modelValue", "data-testid", "placeholder", "aria-expanded", "aria-owns", "aria-controls", "aria-activedescendant", "aria-labelledby"]),
960
+ createVNode(unref(IconSearch), {
961
+ "aria-hidden": "true",
962
+ class: "icon"
963
+ })
964
+ ])
965
+ ], 2)) : createCommentVNode("", true),
966
+ createElementVNode("ul", {
967
+ id: `dropdown-list-${__props.id}`,
968
+ ref: (target) => unref(elements).list = target,
969
+ "data-testid": `dropdown-list-${__props.id}`,
970
+ role: "listbox",
971
+ tabindex: "-1",
972
+ "aria-multiselectable": __props.isMultipleSelect,
973
+ "aria-labelledby": `label-dropdown-${__props.id}`,
974
+ class: "dropdown-list-core"
975
+ }, [
976
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filtered), (option, index) => {
977
+ return openBlock(), createElementBlock("li", {
978
+ id: `option-${__props.id}-${getOption(option, "value")}`,
979
+ key: index,
980
+ "data-testid": `option-${__props.id}-${getOption(option, "value")}`,
981
+ role: "option",
982
+ tabindex: "-1",
983
+ class: "dropdown-item",
984
+ style: normalizeStyle(`--item: ${index + 1}`),
985
+ selected: isSelected(option),
986
+ "aria-selected": isSelected(option),
987
+ onClick: ($event) => select(option),
988
+ onKeyup: [
989
+ withKeys(($event) => select(option), ["enter"]),
990
+ withKeys(($event) => select(option), ["space"])
991
+ ]
992
+ }, [
993
+ renderSlot(_ctx.$slots, "default", {
994
+ text: getOption(option, "name"),
995
+ option,
996
+ isSelect: isSelected
997
+ }, () => [
998
+ createTextVNode(toDisplayString(getOption(option, "name")), 1)
999
+ ])
1000
+ ], 44, _hoisted_6$1);
1001
+ }), 128)),
1002
+ !unref(filtered).length ? (openBlock(), createElementBlock("li", _hoisted_7, [
1003
+ renderSlot(_ctx.$slots, "no-data", {}, () => [
1004
+ _hoisted_8
1005
+ ])
1006
+ ])) : createCommentVNode("", true)
1007
+ ], 8, _hoisted_5$1)
1008
+ ], 512), [
1009
+ [vShow, isDropdownOpen.value]
1010
+ ])
1011
+ ]),
1012
+ _: 3
1013
+ })
1014
+ ], 40, _hoisted_1$7);
1015
+ };
1016
+ }
1017
+ });
1018
+ _sfc_main$2.install = (app) => {
1019
+ app.component("SolDropdown", _sfc_main$2);
1020
+ };
1021
+ const _hoisted_1$6 = {
1022
+ preserveAspectRatio: "xMidYMid meet",
1023
+ viewBox: "0 0 24 24",
1024
+ width: "1.2em",
1025
+ height: "1.2em"
1026
+ };
1027
+ const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("path", {
1028
+ fill: "currentColor",
1029
+ d: "m17 10l-5 6l-5-6h10z"
1030
+ }, null, -1);
1031
+ const _hoisted_3$6 = [
1032
+ _hoisted_2$6
1033
+ ];
1034
+ function render$4(_ctx, _cache) {
1035
+ return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_3$6);
1036
+ }
1037
+ var IconArrow = { name: "mi-caret-down", render: render$4 };
1038
+ var Select_vue_vue_type_style_index_0_lang = "";
1039
+ const _hoisted_1$5 = { class: "select" };
1040
+ const _hoisted_2$5 = {
1041
+ key: 2,
1042
+ class: "placeholder-inline"
1043
+ };
1044
+ const _hoisted_3$5 = { class: "error" };
1045
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1046
+ props: {
1047
+ id: null,
1048
+ options: null,
1049
+ label: { default: "Label" },
1050
+ disabled: { type: Boolean },
1051
+ multiple: { type: Boolean },
1052
+ modelValue: null,
1053
+ error: null,
1054
+ fetchOnApi: { type: Boolean },
1055
+ placeholder: { default: "Selecione" },
1056
+ searchPlaceholder: null,
1057
+ searchable: { type: Boolean }
1058
+ },
1059
+ emits: ["update:modelValue"],
1060
+ setup(__props, { emit }) {
1061
+ return (_ctx, _cache) => {
1062
+ return openBlock(), createBlock(_sfc_main$2, {
1063
+ id: `select-${__props.id}`,
1064
+ selected: __props.modelValue,
1065
+ label: __props.label,
1066
+ disabled: __props.disabled,
1067
+ "fetch-on-search": __props.fetchOnApi,
1068
+ "is-multiple-select": __props.multiple,
1069
+ class: "sol-select-core",
1070
+ "search-placeholder": __props.searchPlaceholder,
1071
+ searchable: __props.searchable,
1072
+ options: __props.options,
1073
+ "onUpdate:selected": _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", $event))
1074
+ }, {
1075
+ "toggle-dropdown": withCtx(({ selected, isOpen }) => [
1076
+ createElementVNode("div", {
1077
+ class: normalizeClass(["select-container", { "-disabled": __props.disabled, "-error": __props.error }])
1078
+ }, [
1079
+ createElementVNode("div", _hoisted_1$5, [
1080
+ __props.multiple && selected.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(selected, (item, index) => {
1081
+ return openBlock(), createElementBlock("span", {
1082
+ key: index,
1083
+ class: "tag",
1084
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
1085
+ }, ["stop"]))
1086
+ }, toDisplayString(item), 1);
1087
+ }), 128)) : selected.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1088
+ createTextVNode(toDisplayString(selected), 1)
1089
+ ], 64)) : (openBlock(), createElementBlock("span", _hoisted_2$5, toDisplayString(__props.placeholder), 1))
1090
+ ]),
1091
+ createVNode(unref(IconArrow), {
1092
+ class: normalizeClass(["icon", { "-open": isOpen }])
1093
+ }, null, 8, ["class"])
1094
+ ], 2),
1095
+ createElementVNode("span", _hoisted_3$5, toDisplayString(__props.error), 1)
1096
+ ]),
1097
+ _: 1
1098
+ }, 8, ["id", "selected", "label", "disabled", "fetch-on-search", "is-multiple-select", "search-placeholder", "searchable", "options"]);
1099
+ };
1100
+ }
1101
+ });
1102
+ _sfc_main$1.install = (app) => {
1103
+ app.component("SolSelect", _sfc_main$1);
545
1104
  };
546
1105
  var windiBase = "";
547
1106
  var windiComponents = "";
548
1107
  var windiUtilities = "";
549
1108
  var style = "";
1109
+ const TOAST_GAP = 12;
1110
+ const DEFAULT_OPTIONS = {
1111
+ type: "success",
1112
+ timeout: 5e3,
1113
+ showIcon: true,
1114
+ showCloseButton: true,
1115
+ position: "top-right",
1116
+ hideProgressBar: false
1117
+ };
1118
+ function useTimer(callback, delay) {
1119
+ const timer = reactive({
1120
+ id: null,
1121
+ intervalId: null,
1122
+ startTime: 0,
1123
+ remaining: delay
1124
+ });
1125
+ const progress = ref(100);
1126
+ function stop() {
1127
+ clearInterval(timer.intervalId);
1128
+ clearTimeout(timer.id);
1129
+ timer.remaining -= Date.now() - timer.startTime;
1130
+ }
1131
+ function start() {
1132
+ timer.startTime = Date.now();
1133
+ clearTimeout(timer.id);
1134
+ timer.intervalId = setInterval(() => {
1135
+ progress.value--;
1136
+ }, delay / 100 - 5);
1137
+ timer.id = setTimeout(callback, timer.remaining);
1138
+ }
1139
+ function clear() {
1140
+ clearInterval(timer.intervalId);
1141
+ clearTimeout(timer.id);
1142
+ progress.value = 100;
1143
+ }
1144
+ onMounted(() => {
1145
+ if (delay <= 0)
1146
+ return false;
1147
+ });
1148
+ onUnmounted(() => {
1149
+ clear();
1150
+ });
1151
+ return {
1152
+ start,
1153
+ stop,
1154
+ clear,
1155
+ progress
1156
+ };
1157
+ }
1158
+ function usePosition(fn) {
1159
+ const stylePosition = computed(() => {
1160
+ const { position, offset } = fn();
1161
+ switch (position) {
1162
+ case "top-left":
1163
+ return {
1164
+ left: "0",
1165
+ top: `${offset}px`
1166
+ };
1167
+ case "bottom-left":
1168
+ return {
1169
+ left: "0",
1170
+ bottom: `${offset}px`
1171
+ };
1172
+ case "bottom-right":
1173
+ return {
1174
+ right: "0",
1175
+ bottom: `${offset}px`
1176
+ };
1177
+ case "top-center":
1178
+ return {
1179
+ top: `${offset}px`,
1180
+ left: "0",
1181
+ right: "0",
1182
+ marginRight: "auto",
1183
+ marginLeft: "auto"
1184
+ };
1185
+ case "bottom-center":
1186
+ return {
1187
+ bottom: `${offset}px`,
1188
+ left: "0",
1189
+ right: "0",
1190
+ marginRight: "auto",
1191
+ marginLeft: "auto"
1192
+ };
1193
+ default:
1194
+ return {
1195
+ right: "0",
1196
+ top: `${offset}px`
1197
+ };
1198
+ }
1199
+ });
1200
+ return {
1201
+ stylePosition
1202
+ };
1203
+ }
1204
+ var Transition = /* @__PURE__ */ ((Transition2) => {
1205
+ Transition2["top-left"] = "bounce-left";
1206
+ Transition2["top-right"] = "bounce-right";
1207
+ Transition2["top-center"] = "bounce-down";
1208
+ Transition2["bottom-left"] = "bounce-left";
1209
+ Transition2["bottom-center"] = "bounce-up";
1210
+ Transition2["bottom-right"] = "bounce-right";
1211
+ return Transition2;
1212
+ })(Transition || {});
1213
+ const _hoisted_1$4 = {
1214
+ preserveAspectRatio: "xMidYMid meet",
1215
+ viewBox: "0 0 24 24",
1216
+ width: "1.2em",
1217
+ height: "1.2em"
1218
+ };
1219
+ const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("path", {
1220
+ fill: "currentColor",
1221
+ d: "M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12zm14.664-3.247a1 1 0 0 1 .083 1.411l-5.333 6a1 1 0 0 1-1.495 0l-2.666-3a1 1 0 0 1 1.494-1.328l1.92 2.159l4.586-5.16a1 1 0 0 1 1.411-.082z"
1222
+ }, null, -1);
1223
+ const _hoisted_3$4 = [
1224
+ _hoisted_2$4
1225
+ ];
1226
+ function render$3(_ctx, _cache) {
1227
+ return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$4);
1228
+ }
1229
+ var Success = { name: "mi-circle-check", render: render$3 };
1230
+ const _hoisted_1$3 = {
1231
+ preserveAspectRatio: "xMidYMid meet",
1232
+ viewBox: "0 0 24 24",
1233
+ width: "1.2em",
1234
+ height: "1.2em"
1235
+ };
1236
+ const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("path", {
1237
+ fill: "currentColor",
1238
+ d: "M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12zm5.793-4.207a1 1 0 0 1 1.414 0L12 10.586l2.793-2.793a1 1 0 1 1 1.414 1.414L13.414 12l2.793 2.793a1 1 0 0 1-1.414 1.414L12 13.414l-2.793 2.793a1 1 0 0 1-1.414-1.414L10.586 12L7.793 9.207a1 1 0 0 1 0-1.414z"
1239
+ }, null, -1);
1240
+ const _hoisted_3$3 = [
1241
+ _hoisted_2$3
1242
+ ];
1243
+ function render$2(_ctx, _cache) {
1244
+ return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$3);
1245
+ }
1246
+ var Error$1 = { name: "mi-circle-error", render: render$2 };
1247
+ const _hoisted_1$2 = {
1248
+ preserveAspectRatio: "xMidYMid meet",
1249
+ viewBox: "0 0 24 24",
1250
+ width: "1.2em",
1251
+ height: "1.2em"
1252
+ };
1253
+ const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("g", { fill: "currentColor" }, [
1254
+ /* @__PURE__ */ createElementVNode("path", { d: "M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12z" }),
1255
+ /* @__PURE__ */ createElementVNode("path", { d: "M12 14a1 1 0 0 1-1-1V7a1 1 0 1 1 2 0v6a1 1 0 0 1-1 1zm-1.5 2.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z" })
1256
+ ], -1);
1257
+ const _hoisted_3$2 = [
1258
+ _hoisted_2$2
1259
+ ];
1260
+ function render$1(_ctx, _cache) {
1261
+ return openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$2);
1262
+ }
1263
+ var Info = { name: "mi-circle-warning", render: render$1 };
1264
+ const _hoisted_1$1 = {
1265
+ preserveAspectRatio: "xMidYMid meet",
1266
+ viewBox: "0 0 24 24",
1267
+ width: "1.2em",
1268
+ height: "1.2em"
1269
+ };
1270
+ const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("path", {
1271
+ fill: "currentColor",
1272
+ d: "M5.293 5.293a1 1 0 0 1 1.414 0L12 10.586l5.293-5.293a1 1 0 1 1 1.414 1.414L13.414 12l5.293 5.293a1 1 0 0 1-1.414 1.414L12 13.414l-5.293 5.293a1 1 0 0 1-1.414-1.414L10.586 12L5.293 6.707a1 1 0 0 1 0-1.414z"
1273
+ }, null, -1);
1274
+ const _hoisted_3$1 = [
1275
+ _hoisted_2$1
1276
+ ];
1277
+ function render(_ctx, _cache) {
1278
+ return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
1279
+ }
1280
+ var Close = { name: "mi-close", render };
1281
+ var Toast_vue_vue_type_style_index_0_lang = "";
1282
+ const _hoisted_1 = ["id", "data-testid"];
1283
+ const _hoisted_2 = { class: "content-wrapper" };
1284
+ const _hoisted_3 = {
1285
+ key: 0,
1286
+ class: "icon-container",
1287
+ "aria-hidden": "true"
1288
+ };
1289
+ const _hoisted_4 = { class: "content" };
1290
+ const _hoisted_5 = {
1291
+ key: 0,
1292
+ class: "description"
1293
+ };
1294
+ const _hoisted_6 = ["data-testid"];
1295
+ const _sfc_main = /* @__PURE__ */ defineComponent({
1296
+ props: {
1297
+ id: null,
1298
+ type: { default: DEFAULT_OPTIONS.type },
1299
+ visible: { type: Boolean, default: false },
1300
+ title: null,
1301
+ description: null,
1302
+ timeout: null,
1303
+ hideProgressBar: { type: Boolean, default: DEFAULT_OPTIONS.hideProgressBar },
1304
+ showIcon: { type: Boolean, default: DEFAULT_OPTIONS.showIcon },
1305
+ offset: { default: 0 },
1306
+ onClose: null,
1307
+ onCloseHandler: null,
1308
+ position: { default: DEFAULT_OPTIONS.position }
1309
+ },
1310
+ setup(__props) {
1311
+ const props = __props;
1312
+ const { start, stop, progress } = useTimer(() => {
1313
+ var _a2;
1314
+ (_a2 = props.onCloseHandler) == null ? void 0 : _a2.call(props);
1315
+ }, props.timeout);
1316
+ const { stylePosition } = usePosition(() => ({
1317
+ offset: props.offset,
1318
+ position: props.position
1319
+ }));
1320
+ const isMultiline = computed(() => props.title && props.description);
1321
+ function onMouseEnter() {
1322
+ if (props.timeout > 0) {
1323
+ stop();
1324
+ }
1325
+ }
1326
+ function onMouseLeave() {
1327
+ start();
1328
+ }
1329
+ onMounted(() => {
1330
+ start();
1331
+ });
1332
+ return (_ctx, _cache) => {
1333
+ return openBlock(), createBlock(Transition$1, {
1334
+ name: unref(Transition)[__props.position],
1335
+ type: "animation"
1336
+ }, {
1337
+ default: withCtx(() => [
1338
+ __props.visible ? (openBlock(), createElementBlock("div", {
1339
+ key: 0,
1340
+ id: `toast-${__props.type}-${__props.id}`,
1341
+ role: "status",
1342
+ "data-testid": `toast-${__props.type}-${__props.id}`,
1343
+ style: normalizeStyle(unref(stylePosition)),
1344
+ class: normalizeClass(["sol-toast-core", [`-${__props.type}`, { "-multiline": unref(isMultiline) }]]),
1345
+ onKeyup: _cache[1] || (_cache[1] = withKeys((...args) => __props.onCloseHandler && __props.onCloseHandler(...args), ["esc"])),
1346
+ onMouseenter: onMouseEnter,
1347
+ onMouseleave: onMouseLeave,
1348
+ onFocusin: onMouseEnter,
1349
+ onFocusout: onMouseLeave
1350
+ }, [
1351
+ createElementVNode("section", _hoisted_2, [
1352
+ __props.showIcon ? (openBlock(), createElementBlock("div", _hoisted_3, [
1353
+ renderSlot(_ctx.$slots, "icon-status", { type: __props.type }, () => [
1354
+ __props.type === "success" ? (openBlock(), createBlock(unref(Success), {
1355
+ key: 0,
1356
+ class: "icon"
1357
+ })) : createCommentVNode("", true),
1358
+ __props.type === "info" ? (openBlock(), createBlock(unref(Info), {
1359
+ key: 1,
1360
+ class: "icon"
1361
+ })) : createCommentVNode("", true),
1362
+ __props.type === "danger" ? (openBlock(), createBlock(unref(Error$1), {
1363
+ key: 2,
1364
+ class: "icon"
1365
+ })) : createCommentVNode("", true)
1366
+ ])
1367
+ ])) : createCommentVNode("", true),
1368
+ createElementVNode("div", _hoisted_4, [
1369
+ createElementVNode("p", {
1370
+ class: normalizeClass(["title", { "-multiline": unref(isMultiline) }])
1371
+ }, [
1372
+ renderSlot(_ctx.$slots, "title", {}, () => [
1373
+ createTextVNode(toDisplayString(__props.title), 1)
1374
+ ])
1375
+ ], 2),
1376
+ __props.description ? (openBlock(), createElementBlock("p", _hoisted_5, [
1377
+ renderSlot(_ctx.$slots, "description", {}, () => [
1378
+ createTextVNode(toDisplayString(__props.description), 1)
1379
+ ])
1380
+ ])) : createCommentVNode("", true)
1381
+ ])
1382
+ ]),
1383
+ createElementVNode("button", {
1384
+ type: "button",
1385
+ class: normalizeClass(["close", { "-multiline": unref(isMultiline) }]),
1386
+ "data-testid": `toast-close-button-${__props.type}-${__props.id}`,
1387
+ "aria-label": "close notification",
1388
+ onClick: _cache[0] || (_cache[0] = (...args) => __props.onCloseHandler && __props.onCloseHandler(...args))
1389
+ }, [
1390
+ createVNode(unref(Close), { class: "icon" })
1391
+ ], 10, _hoisted_6),
1392
+ !__props.hideProgressBar ? (openBlock(), createElementBlock("div", {
1393
+ key: 0,
1394
+ class: "progressbar",
1395
+ "aria-hidden": "true",
1396
+ style: normalizeStyle({ width: `${unref(progress)}%` })
1397
+ }, null, 4)) : createCommentVNode("", true)
1398
+ ], 46, _hoisted_1)) : createCommentVNode("", true)
1399
+ ]),
1400
+ _: 3
1401
+ }, 8, ["name"]);
1402
+ };
1403
+ }
1404
+ });
1405
+ const toasts = {
1406
+ "top-left": [],
1407
+ "top-right": [],
1408
+ "top-center": [],
1409
+ "bottom-left": [],
1410
+ "bottom-right": [],
1411
+ "bottom-center": []
1412
+ };
1413
+ function useToast() {
1414
+ let toastId = 0;
1415
+ function clearAllToasts() {
1416
+ Object.entries(toasts).forEach(([position, toastsInAPosition]) => {
1417
+ if (toastsInAPosition.length) {
1418
+ toastsInAPosition.forEach((toast) => {
1419
+ var _a2;
1420
+ const id = (_a2 = toast.toastVNode.props) == null ? void 0 : _a2.id;
1421
+ close(id, position);
1422
+ });
1423
+ }
1424
+ });
1425
+ }
1426
+ const createToast = (content, options) => {
1427
+ const id = toastId++;
1428
+ const initializedOptions = options ? initializeOptions(options) : DEFAULT_OPTIONS;
1429
+ if (options == null ? void 0 : options.showOneToast)
1430
+ clearAllToasts();
1431
+ const transformContent = typeof content === "string" ? { title: content } : content;
1432
+ setupVNode(id, initializedOptions, transformContent);
1433
+ return {
1434
+ close: () => close(id, initializedOptions.position)
1435
+ };
1436
+ };
1437
+ return {
1438
+ createToast,
1439
+ clearAllToasts
1440
+ };
1441
+ }
1442
+ function initializeOptions(options) {
1443
+ const processedOptions = __spreadProps(__spreadValues(__spreadValues({}, DEFAULT_OPTIONS), options), {
1444
+ showIcon: options.showIcon
1445
+ });
1446
+ processedOptions.hideProgressBar = !!(processedOptions.timeout && (processedOptions == null ? void 0 : processedOptions.timeout) <= 0);
1447
+ if (options.hideProgressBar) {
1448
+ processedOptions.hideProgressBar = options.hideProgressBar;
1449
+ }
1450
+ return processedOptions;
1451
+ }
1452
+ function setupVNode(id, options, content) {
1453
+ setTimeout(() => {
1454
+ const verticalOffset = moveToastsOnAdd(options, toasts, TOAST_GAP);
1455
+ const container = document.createElement("div");
1456
+ document.body.appendChild(container);
1457
+ const toastVNode = createVNode(_sfc_main, setupVNodeProps(options, id, verticalOffset, close, content));
1458
+ render$8(toastVNode, container);
1459
+ toasts[options.position].push({ toastVNode, container });
1460
+ if (toastVNode.component)
1461
+ toastVNode.component.props.visible = true;
1462
+ }, 1);
1463
+ }
1464
+ function setupVNodeProps(options, id, offset, closeFn, content) {
1465
+ return __spreadProps(__spreadValues(__spreadValues({}, options), content), {
1466
+ id,
1467
+ offset,
1468
+ visible: false,
1469
+ onCloseHandler() {
1470
+ closeFn(id, options.position ? options.position : "top-right");
1471
+ }
1472
+ });
1473
+ }
1474
+ function moveToastsOnAdd(options, toasts2, toastGap) {
1475
+ if (!options.position)
1476
+ throw new Error("no position");
1477
+ return toasts2[options.position].reduce((acc, { toastVNode }) => {
1478
+ const offsetHeight = toastVNode.el.offsetHeight + toastGap;
1479
+ acc += offsetHeight || 0;
1480
+ return acc;
1481
+ }, toastGap);
1482
+ }
1483
+ function moveToastsOnClose(index, toastArr, position, toastHeight) {
1484
+ for (let i = index; i < toastArr.length; i++) {
1485
+ const { toastVNode } = toastArr[i];
1486
+ if (!toastVNode.el)
1487
+ return;
1488
+ const verticalPosition = position.split("-")[0] || "top";
1489
+ const positionLessOneToast = parseInt(toastVNode.el.style[verticalPosition], 10) - toastHeight - TOAST_GAP;
1490
+ if (!toastVNode.component)
1491
+ return;
1492
+ toastVNode.component.props.offset = positionLessOneToast;
1493
+ }
1494
+ }
1495
+ function close(id, position) {
1496
+ var _a2;
1497
+ const toastArr = toasts[position];
1498
+ const index = toastArr.findIndex(({ toastVNode: toastVNode2 }) => {
1499
+ var _a3;
1500
+ return id === ((_a3 = toastVNode2 == null ? void 0 : toastVNode2.props) == null ? void 0 : _a3.id);
1501
+ });
1502
+ if (index === -1)
1503
+ return;
1504
+ const { container, toastVNode } = toastArr[index];
1505
+ const height = (_a2 = toastVNode == null ? void 0 : toastVNode.el) == null ? void 0 : _a2.offsetHeight;
1506
+ toasts[position].splice(index, 1);
1507
+ moveToastsOnClose(index, toastArr, position, height);
1508
+ if (!toastVNode.component)
1509
+ return;
1510
+ const componentProps = toastVNode.component.props;
1511
+ componentProps.visible = false;
1512
+ componentProps.onClose && componentProps.onClose();
1513
+ setTimeout(() => {
1514
+ render$8(null, container);
1515
+ document.body.removeChild(container);
1516
+ }, 1e3);
1517
+ }
550
1518
  console.log("%c\u{1F33B}[Girassol]\u{1F33B}", "padding: 8px;background: #212121;color: gold; font-family: 'Fira code'; font-weight: bold; font-size: 1.2rem");
551
1519
  const components = {
552
- SolButton: _sfc_main$8,
553
- SolInput: _sfc_main$7,
554
- SolTextfield: _sfc_main$6,
555
- SolTextfieldPassword: _sfc_main$5,
556
- SolRadio: _sfc_main$4,
557
- SolRadioGroup: _sfc_main$3,
558
- SolCheckbox: _sfc_main$2,
559
- SolCheckboxGroup: _sfc_main$1,
560
- SolSwitch: _sfc_main
1520
+ SolButton: _sfc_main$c,
1521
+ SolInput: _sfc_main$b,
1522
+ SolTextarea: _sfc_main$8,
1523
+ SolTextfield: _sfc_main$a,
1524
+ SolTextfieldPassword: _sfc_main$9,
1525
+ SolRadio: _sfc_main$7,
1526
+ SolRadioGroup: _sfc_main$6,
1527
+ SolCheckbox: _sfc_main$5,
1528
+ SolCheckboxGroup: _sfc_main$4,
1529
+ SolSwitch: _sfc_main$3,
1530
+ SolDropdown: _sfc_main$2,
1531
+ SolSelect: _sfc_main$1
561
1532
  };
562
1533
  function install(App) {
563
1534
  for (const component in components) {
@@ -565,7 +1536,6 @@ function install(App) {
565
1536
  }
566
1537
  }
567
1538
  const componentsNames = [];
568
- for (const component in components) {
1539
+ for (const component in components)
569
1540
  componentsNames.push(component);
570
- }
571
- export { _sfc_main$8 as SolButton, _sfc_main$2 as SolCheckbox, _sfc_main$1 as SolCheckboxGroup, _sfc_main$7 as SolInput, _sfc_main$4 as SolRadio, _sfc_main$3 as SolRadioGroup, _sfc_main as SolSwitch, _sfc_main$6 as SolTextfield, _sfc_main$5 as SolTextfieldPassword, componentsNames, install };
1541
+ export { _sfc_main$c as SolButton, _sfc_main$5 as SolCheckbox, _sfc_main$4 as SolCheckboxGroup, _sfc_main$2 as SolDropdown, _sfc_main$b as SolInput, _sfc_main$7 as SolRadio, _sfc_main$6 as SolRadioGroup, _sfc_main$1 as SolSelect, _sfc_main$3 as SolSwitch, _sfc_main$8 as SolTextarea, _sfc_main$a as SolTextfield, _sfc_main$9 as SolTextfieldPassword, componentsNames, install, useToast };