@maltjoy/core-vue 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (31) hide show
  1. package/dist/components/JoyButton/JoyButton.vue.d.ts +3 -3
  2. package/dist/components/JoyCheckbox/JoyCheckbox.vue.d.ts +85 -0
  3. package/dist/components/JoyCheckbox/tests/JoyCheckbox.spec.d.ts +1 -0
  4. package/dist/components/JoyFormError/JoyFormError.vue.d.ts +23 -0
  5. package/dist/components/JoyFormError/tests/JoyFormError.spec.d.ts +1 -0
  6. package/dist/components/JoyHighlight/JoyHighlight.types.d.ts +3 -0
  7. package/dist/components/JoyHighlight/JoyHighlight.vue.d.ts +48 -0
  8. package/dist/components/JoyHighlight/tests/JoyHighlight.spec.d.ts +1 -0
  9. package/dist/components/JoyInput/JoyInput.vue.d.ts +47 -30
  10. package/dist/components/JoyLabel/JoyLabel.vue.d.ts +1 -1
  11. package/dist/components/JoyRadio/JoyRadio.vue.d.ts +37 -13
  12. package/dist/components/JoySelect/JoySelect.vue.d.ts +33 -42
  13. package/dist/components/JoyToggle/JoyToggle.vue.d.ts +71 -0
  14. package/dist/components/JoyToggle/tests/JoyToggle.spec.d.ts +1 -0
  15. package/dist/components/JoyWrapper/JoyWrapper.vue.d.ts +9 -9
  16. package/dist/components/index.d.ts +5 -1
  17. package/dist/composables/index.d.ts +1 -0
  18. package/dist/composables/props.d.ts +56 -0
  19. package/dist/helpers/index.d.ts +2 -0
  20. package/dist/joy-vue.js +470 -284
  21. package/dist/joy-vue.umd.cjs +1 -1
  22. package/dist/style.css +1 -1
  23. package/dist/tests/composables/prop.spec.d.ts +1 -0
  24. package/dist/tests/composables/test-components/CheckboxFormProps.vue.d.ts +62 -0
  25. package/dist/tests/composables/test-components/GenericFormProps.vue.d.ts +44 -0
  26. package/dist/tests/composables/test-components/GenericFormPropsWithLabel.vue.d.ts +55 -0
  27. package/dist/tests/helpers.spec.d.ts +1 -0
  28. package/dist/types/index.d.ts +1 -0
  29. package/joy-components.d.ts +15 -10
  30. package/package.json +1 -1
  31. package/dist/components/JoySelect/JoySelect.types.d.ts +0 -2
package/dist/joy-vue.js CHANGED
@@ -1,26 +1,26 @@
1
- import { defineComponent as m, openBlock as o, createElementBlock as n, normalizeClass as f, useAttrs as x, computed as w, createBlock as I, resolveDynamicComponent as L, unref as p, withCtx as B, createCommentVNode as u, createElementVNode as s, renderSlot as i, mergeProps as V, toDisplayString as C, ref as b, useSlots as q, onBeforeMount as T, onMounted as E, watch as R, createTextVNode as O, pushScopeId as A, popScopeId as M } from "vue";
2
- const F = ["teal", "white"], P = /* @__PURE__ */ m({
1
+ import { defineComponent as y, openBlock as s, createElementBlock as u, normalizeClass as d, useAttrs as z, computed as J, createBlock as w, resolveDynamicComponent as T, unref as f, withCtx as V, createCommentVNode as j, createElementVNode as n, renderSlot as r, ref as h, createTextVNode as R, toDisplayString as L, pushScopeId as O, popScopeId as N, mergeProps as C, useSlots as E, onBeforeMount as M, onMounted as A, watch as D } from "vue";
2
+ const G = ["teal", "white"], W = /* @__PURE__ */ y({
3
3
  __name: "JoySpinner",
4
4
  props: {
5
5
  color: {
6
6
  type: String,
7
7
  validator(e) {
8
- return F.includes(e);
8
+ return G.includes(e);
9
9
  }
10
10
  }
11
11
  },
12
12
  setup(e) {
13
- return (a, t) => (o(), n("div", {
14
- class: f(["joy-spinner", `joy-spinner_${e.color}`])
13
+ return (a, t) => (s(), u("div", {
14
+ class: d(["joy-spinner", `joy-spinner_${e.color}`])
15
15
  }, null, 2));
16
16
  }
17
17
  });
18
- const g = (e, a) => {
18
+ const _ = (e, a) => {
19
19
  const t = e.__vccOpts || e;
20
- for (const [l, r] of a)
21
- t[l] = r;
20
+ for (const [l, i] of a)
21
+ t[l] = i;
22
22
  return t;
23
- }, N = /* @__PURE__ */ g(P, [["__scopeId", "data-v-b633f633"]]), W = ["primary", "secondary"], G = ["xlarge", "large", "medium", "small", "xsmall", "xxsmall"], Z = ["main", "admin", "white", "ghost"], D = [...W, ...Z], U = [...G], H = ["xxsmall", "xsmall", "small"], K = ["name", "size"], Q = { class: "joy-button--slot" }, X = /* @__PURE__ */ m({
23
+ }, P = /* @__PURE__ */ _(W, [["__scopeId", "data-v-b633f633"]]), Z = ["primary", "secondary"], U = ["xlarge", "large", "medium", "small", "xsmall", "xxsmall"], K = ["neutral", "success", "info", "warning", "error"], X = ["main", "admin", "white", "ghost"], Q = [...Z, ...X], Y = [...U], x = ["xxsmall", "xsmall", "small"], ee = ["name", "size"], te = { class: "joy-button--slot" }, oe = /* @__PURE__ */ y({
24
24
  __name: "JoyButton",
25
25
  props: {
26
26
  /**
@@ -43,7 +43,7 @@ const g = (e, a) => {
43
43
  type: String,
44
44
  default: "primary",
45
45
  validator(e) {
46
- return D.includes(e);
46
+ return Q.includes(e);
47
47
  }
48
48
  },
49
49
  /** Button or Link size */
@@ -51,7 +51,7 @@ const g = (e, a) => {
51
51
  type: String,
52
52
  default: "medium",
53
53
  validator(e) {
54
- return U.includes(e);
54
+ return Y.includes(e);
55
55
  }
56
56
  },
57
57
  /** Override the icon size. Default to xsmall */
@@ -59,15 +59,15 @@ const g = (e, a) => {
59
59
  type: String,
60
60
  default: "xsmall",
61
61
  validator(e) {
62
- return H.includes(e);
62
+ return x.includes(e);
63
63
  }
64
64
  }
65
65
  },
66
66
  setup(e) {
67
- const a = e, t = x(), l = w(() => ["white", "ghost", "secondary"].includes(a.variant) ? "teal" : "white");
68
- return (r, v) => (o(), I(L(p(t).href ? "a" : "button"), {
69
- disabled: e.loading || p(t).disabled,
70
- class: f([
67
+ const a = e, t = z(), l = J(() => ["white", "ghost", "secondary"].includes(a.variant) ? "teal" : "white");
68
+ return (i, c) => (s(), w(T(f(t).href ? "a" : "button"), {
69
+ disabled: e.loading || f(t).disabled,
70
+ class: d([
71
71
  "joy-button",
72
72
  `joy-button_${e.variant}`,
73
73
  `joy-button_${e.size}`,
@@ -77,39 +77,222 @@ const g = (e, a) => {
77
77
  }
78
78
  ])
79
79
  }, {
80
- default: B(() => [
81
- e.icon ? (o(), n("joy-icon", {
80
+ default: V(() => [
81
+ e.icon ? (s(), u("joy-icon", {
82
82
  key: 0,
83
83
  name: e.icon,
84
84
  size: e.iconSize,
85
85
  lazy: !1
86
- }, null, 8, K)) : u("", !0),
87
- e.loading ? (o(), I(N, {
86
+ }, null, 8, ee)) : j("", !0),
87
+ e.loading ? (s(), w(P, {
88
88
  key: 1,
89
- color: p(l)
90
- }, null, 8, ["color"])) : u("", !0),
91
- s("span", Q, [
92
- i(r.$slots, "default", {}, void 0, !0)
89
+ color: f(l)
90
+ }, null, 8, ["color"])) : j("", !0),
91
+ n("span", te, [
92
+ r(i.$slots, "default", {}, void 0, !0)
93
93
  ])
94
94
  ]),
95
95
  _: 3
96
96
  }, 8, ["disabled", "class"]));
97
97
  }
98
98
  });
99
- const Y = /* @__PURE__ */ g(X, [["__scopeId", "data-v-08c3c0a6"]]), ee = ["small", "medium", "large"], te = {
99
+ const ae = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-08c3c0a6"]]), B = {
100
+ disabled: {
101
+ type: Boolean,
102
+ default: !1
103
+ },
104
+ id: {
105
+ type: String
106
+ },
107
+ invalid: {
108
+ type: Boolean,
109
+ default: !1
110
+ },
111
+ name: {
112
+ type: String
113
+ },
114
+ required: {
115
+ type: Boolean,
116
+ default: !1
117
+ }
118
+ }, F = {
119
+ modelValue: {
120
+ type: Boolean,
121
+ default: !1
122
+ },
123
+ value: {
124
+ type: String,
125
+ default: "on"
126
+ },
127
+ ...B
128
+ }, H = {
129
+ label: String,
130
+ labelSize: {
131
+ type: String,
132
+ default: "medium"
133
+ }
134
+ }, le = ["aria-checked", "aria-hidden"], ne = ["name", "disabled", "checked", "required", "aria-checked", "value", "indeterminate"], ie = { class: "joy-checkbox__content-wrapper" }, se = { class: "joy-checkbox__content" }, re = /* @__PURE__ */ y({
135
+ __name: "JoyCheckbox",
136
+ props: {
137
+ /** Can't be used in addition of v-model. See usage : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes */
138
+ indeterminate: {
139
+ type: Boolean,
140
+ default: !1
141
+ },
142
+ ...F
143
+ },
144
+ emits: ["update:modelValue"],
145
+ setup(e, { expose: a, emit: t }) {
146
+ const l = e, i = h(), c = h(l.indeterminate), S = {
147
+ onChange: (o) => {
148
+ const p = o.target.checked;
149
+ c.value = !1, t("update:modelValue", p);
150
+ }
151
+ };
152
+ return a({
153
+ isIndeterminate: c
154
+ }), (o, p) => (s(), u("div", {
155
+ "aria-checked": o.modelValue,
156
+ "aria-hidden": o.disabled
157
+ }, [
158
+ n("label", {
159
+ class: d([
160
+ "joy-checkbox",
161
+ {
162
+ "joy-checkbox__checked": o.modelValue,
163
+ "joy-checkbox__indeterminate": c.value
164
+ }
165
+ ])
166
+ }, [
167
+ n("input", {
168
+ ref_key: "input",
169
+ ref: i,
170
+ type: "checkbox",
171
+ class: "joy-checkbox__input",
172
+ role: "checkbox",
173
+ name: o.name,
174
+ disabled: o.disabled,
175
+ checked: o.modelValue,
176
+ required: o.required,
177
+ "aria-checked": o.modelValue,
178
+ value: o.value,
179
+ indeterminate: c.value,
180
+ onChange: p[0] || (p[0] = //@ts-ignore
181
+ (...b) => S.onChange && S.onChange(...b))
182
+ }, null, 40, ne),
183
+ n("div", ie, [
184
+ r(o.$slots, "default", {}, void 0, !0),
185
+ n("div", se, [
186
+ r(o.$slots, "checkbox-content", {}, void 0, !0)
187
+ ])
188
+ ])
189
+ ], 2)
190
+ ], 8, le));
191
+ }
192
+ });
193
+ const de = /* @__PURE__ */ _(re, [["__scopeId", "data-v-61d9cccf"]]), ue = (e) => (O("data-v-eba58103"), e = e(), N(), e), ce = ["aria-hidden"], pe = /* @__PURE__ */ ue(() => /* @__PURE__ */ n("joy-icon", {
194
+ "custom-class": "joy-icon-error",
195
+ name: "warning-triangle"
196
+ }, null, -1)), ye = /* @__PURE__ */ y({
197
+ __name: "JoyFormError",
198
+ props: {
199
+ visible: {
200
+ type: Boolean,
201
+ default: !0
202
+ },
203
+ noHtmlErrorText: String
204
+ },
205
+ setup(e) {
206
+ return (a, t) => (s(), u("div", {
207
+ "aria-hidden": e.visible,
208
+ class: d(["joy-form-error", { "joy-has-error": e.visible }]),
209
+ role: "alert"
210
+ }, [
211
+ pe,
212
+ n("div", null, [
213
+ r(a.$slots, "default", {}, () => [
214
+ R(L(e.noHtmlErrorText), 1)
215
+ ], !0)
216
+ ])
217
+ ], 10, ce));
218
+ }
219
+ });
220
+ const _e = /* @__PURE__ */ _(ye, [["__scopeId", "data-v-eba58103"]]);
221
+ function me(e) {
222
+ let a;
223
+ switch (e) {
224
+ case "error":
225
+ a = "warning-triangle";
226
+ break;
227
+ case "success":
228
+ a = "check";
229
+ break;
230
+ default:
231
+ a = "info-circle";
232
+ }
233
+ return a;
234
+ }
235
+ const ve = [...K], fe = ["name"], ge = { class: "joy-highlight--text" }, he = /* @__PURE__ */ y({
236
+ __name: "JoyHighlight",
237
+ props: {
238
+ accent: {
239
+ type: Boolean,
240
+ default: !1
241
+ },
242
+ displayIcon: {
243
+ type: Boolean,
244
+ default: !1
245
+ },
246
+ icon: String,
247
+ level: {
248
+ type: String,
249
+ default: "neutral",
250
+ validator(e) {
251
+ return ve.includes(e);
252
+ }
253
+ }
254
+ },
255
+ setup(e, { expose: a }) {
256
+ const t = e, l = J(() => t.icon ? t.icon : me(t.level));
257
+ return a({
258
+ getRelevantIcon: l
259
+ }), (i, c) => (s(), u("div", {
260
+ class: d([
261
+ "joy-highlight",
262
+ `joy-highlight_${e.level}`,
263
+ {
264
+ "joy-highlight__accent": e.accent,
265
+ "joy-highlight__titled": i.$slots["highlight-title"]
266
+ }
267
+ ])
268
+ }, [
269
+ e.displayIcon ? (s(), u("joy-icon", {
270
+ key: 0,
271
+ name: f(l)
272
+ }, null, 8, fe)) : j("", !0),
273
+ n("div", ge, [
274
+ n("strong", null, [
275
+ r(i.$slots, "highlight-title", {}, void 0, !0)
276
+ ]),
277
+ r(i.$slots, "default", {}, void 0, !0)
278
+ ])
279
+ ], 2));
280
+ }
281
+ });
282
+ const be = /* @__PURE__ */ _(he, [["__scopeId", "data-v-15d3fa11"]]), je = ["small", "medium", "large"], Se = {
100
283
  key: 0,
101
284
  class: "joy-label-required"
102
- }, ae = {
285
+ }, $e = {
103
286
  key: 1,
104
287
  class: "joy-label-optional"
105
- }, oe = /* @__PURE__ */ m({
288
+ }, ke = /* @__PURE__ */ y({
106
289
  __name: "JoyLabel",
107
290
  props: {
108
291
  size: {
109
292
  type: String,
110
293
  default: "medium",
111
294
  validator(e) {
112
- return ee.includes(e);
295
+ return je.includes(e);
113
296
  }
114
297
  },
115
298
  tagName: {
@@ -125,46 +308,33 @@ const Y = /* @__PURE__ */ g(X, [["__scopeId", "data-v-08c3c0a6"]]), ee = ["small
125
308
  }
126
309
  },
127
310
  setup(e) {
128
- return (a, t) => (o(), I(L(e.tagName), V({
311
+ return (a, t) => (s(), w(T(e.tagName), C({
129
312
  class: ["joy-label", `joy-label--${e.size}`]
130
313
  }, a.$attrs), {
131
- default: B(() => [
132
- i(a.$slots, "default", {}, void 0, !0),
133
- e.required ? (o(), n("span", te, "*")) : u("", !0),
134
- e.optionalLabel ? (o(), n("span", ae, "- " + C(e.optionalLabel), 1)) : u("", !0)
314
+ default: V(() => [
315
+ r(a.$slots, "default", {}, void 0, !0),
316
+ e.required ? (s(), u("span", Se, "*")) : j("", !0),
317
+ e.optionalLabel ? (s(), u("span", $e, "- " + L(e.optionalLabel), 1)) : j("", !0)
135
318
  ]),
136
319
  _: 3
137
320
  }, 16, ["class"]));
138
321
  }
139
322
  });
140
- const z = /* @__PURE__ */ g(oe, [["__scopeId", "data-v-e3232407"]]), le = ["id", "type", "value"], ne = ["data-unit"], ie = /* @__PURE__ */ m({
323
+ const q = /* @__PURE__ */ _(ke, [["__scopeId", "data-v-e3232407"]]), Je = ["id", "type", "value"], Ie = ["data-unit"], we = /* @__PURE__ */ y({
141
324
  __name: "JoyInput",
142
325
  props: {
326
+ ...B,
327
+ ...H,
143
328
  clearable: {
144
329
  type: Boolean,
145
330
  default: !1
146
331
  },
147
332
  icon: String,
148
- invalid: {
149
- type: Boolean,
150
- default: !1
151
- },
152
- labelSize: String,
153
333
  modelValue: {
154
334
  type: String,
155
335
  default: ""
156
336
  },
157
- /**
158
- * For accessibility purpose, the name is required. it will be mapped to the input ID, and the label "for" attribute as well.
159
- */
160
- name: {
161
- type: String
162
- },
163
337
  optionalLabel: String,
164
- required: {
165
- type: Boolean,
166
- default: !1
167
- },
168
338
  requiredMark: {
169
339
  type: Boolean,
170
340
  default: !1
@@ -178,105 +348,105 @@ const z = /* @__PURE__ */ g(oe, [["__scopeId", "data-v-e3232407"]]), le = ["id",
178
348
  },
179
349
  emits: ["update:modelValue"],
180
350
  setup(e, { emit: a }) {
181
- const t = e, l = b(), r = b(), v = x(), $ = q(), d = b(!1), y = w(() => t.clearable && t.modelValue.length > 0 && !t.unit), S = w(() => $.default && $.default()), k = w(() => {
182
- var j, c;
183
- return !!((j = r.value) != null && j.closest("joy-wrapper")) || !!((c = r.value) != null && c.closest(".joy-wrapper"));
184
- }), J = b(t.type);
185
- T(() => {
186
- J.value = t.unit ? "number" : t.unit || "text";
351
+ const t = e, l = h(), i = h(), c = z(), S = E(), o = h(!1), p = J(() => t.clearable && t.modelValue.length > 0 && !t.unit), b = J(() => S.default && S.default()), I = J(() => {
352
+ var m, v;
353
+ return !!((m = i.value) != null && m.closest("joy-wrapper")) || !!((v = i.value) != null && v.closest(".joy-wrapper"));
354
+ }), g = h(t.type);
355
+ M(() => {
356
+ g.value = t.unit ? "number" : t.unit || "text";
187
357
  });
188
- const _ = {
358
+ const $ = {
189
359
  onFocus: () => {
190
- d.value = !0;
360
+ o.value = !0;
191
361
  },
192
362
  onBlur: () => {
193
- d.value = !1;
363
+ o.value = !1;
194
364
  },
195
- onInput: (j) => {
196
- let c = j.target.value;
197
- a("update:modelValue", c);
365
+ onInput: (m) => {
366
+ let v = m.target.value;
367
+ a("update:modelValue", v);
198
368
  },
199
369
  clearValue: () => {
200
370
  a("update:modelValue", "");
201
371
  }
202
372
  };
203
- return (j, c) => (o(), n("div", {
373
+ return (m, v) => (s(), u("div", {
204
374
  ref_key: "root",
205
- ref: r,
206
- class: f([`joy-input--${t.size}`])
375
+ ref: i,
376
+ class: d([`joy-input--${t.size}`])
207
377
  }, [
208
- s("div", {
209
- class: f([
378
+ n("div", {
379
+ class: d([
210
380
  "joy-input",
211
381
  {
212
- "joy-input--focusing": d.value,
213
- "joy-input--disabled": p(v).disabled,
214
- "joy-input--invalid": e.invalid,
215
- "joy-input--valid": !e.invalid && !p(v).disabled
382
+ "joy-input--focusing": o.value,
383
+ "joy-input--disabled": f(c).disabled,
384
+ "joy-input--invalid": m.invalid,
385
+ "joy-input--valid": !m.invalid && !f(c).disabled
216
386
  }
217
387
  ])
218
388
  }, [
219
- p(S) ? (o(), I(z, {
389
+ f(b) ? (s(), w(q, {
220
390
  key: 0,
221
- for: e.name,
222
- required: e.required && e.requiredMark,
391
+ for: m.name,
392
+ required: m.required && e.requiredMark,
223
393
  "optional-label": e.optionalLabel,
224
- size: e.labelSize
394
+ size: m.labelSize
225
395
  }, {
226
- default: B(() => [
227
- i(j.$slots, "default", {}, void 0, !0)
396
+ default: V(() => [
397
+ r(m.$slots, "default", {}, void 0, !0)
228
398
  ]),
229
399
  _: 3
230
- }, 8, ["for", "required", "optional-label", "size"])) : u("", !0),
231
- s("div", {
232
- class: f([
400
+ }, 8, ["for", "required", "optional-label", "size"])) : j("", !0),
401
+ n("div", {
402
+ class: d([
233
403
  "joy-input--wrapper",
234
404
  {
235
405
  "joy-input--wrapper-has-icon": !!e.icon,
236
406
  "joy-input--wrapper---clearable": e.clearable,
237
407
  "joy-input--wrapper-unit": !!e.unit,
238
- "joy-input--wrapper-margin": !p(k)
408
+ "joy-input--wrapper-margin": !f(I)
239
409
  }
240
410
  ])
241
411
  }, [
242
- s("input", V(j.$attrs, {
412
+ n("input", C(m.$attrs, {
243
413
  id: t.name,
244
414
  ref_key: "input",
245
415
  ref: l,
246
416
  class: [
247
417
  {
248
- "joy-input--field-disabled": p(v).disabled,
249
- "joy-input--field-invalid": e.invalid
418
+ "joy-input--field-disabled": f(c).disabled,
419
+ "joy-input--field-invalid": m.invalid
250
420
  }
251
421
  ],
252
- type: J.value,
422
+ type: g.value,
253
423
  value: e.modelValue,
254
- onFocus: c[0] || (c[0] = //@ts-ignore
255
- (...h) => _.onFocus && _.onFocus(...h)),
256
- onBlur: c[1] || (c[1] = //@ts-ignore
257
- (...h) => _.onBlur && _.onBlur(...h)),
258
- onInput: c[2] || (c[2] = //@ts-ignore
259
- (...h) => _.onInput && _.onInput(...h))
260
- }), null, 16, le),
261
- p(y) ? (o(), n("joy-icon", {
424
+ onFocus: v[0] || (v[0] = //@ts-ignore
425
+ (...k) => $.onFocus && $.onFocus(...k)),
426
+ onBlur: v[1] || (v[1] = //@ts-ignore
427
+ (...k) => $.onBlur && $.onBlur(...k)),
428
+ onInput: v[2] || (v[2] = //@ts-ignore
429
+ (...k) => $.onInput && $.onInput(...k))
430
+ }), null, 16, Je),
431
+ f(p) ? (s(), u("joy-icon", {
262
432
  key: 0,
263
433
  size: "xxsmall",
264
434
  name: "cross",
265
435
  class: "joy-input--clear",
266
- onClick: c[3] || (c[3] = //@ts-ignore
267
- (...h) => _.clearValue && _.clearValue(...h))
268
- })) : u("", !0),
269
- e.unit ? (o(), n("div", {
436
+ onClick: v[3] || (v[3] = //@ts-ignore
437
+ (...k) => $.clearValue && $.clearValue(...k))
438
+ })) : j("", !0),
439
+ e.unit ? (s(), u("div", {
270
440
  key: 1,
271
441
  "data-unit": e.unit,
272
442
  class: "joy-input--unit"
273
- }, null, 8, ne)) : u("", !0)
443
+ }, null, 8, Ie)) : j("", !0)
274
444
  ], 2)
275
445
  ], 2)
276
446
  ], 2));
277
447
  }
278
448
  });
279
- const se = /* @__PURE__ */ g(ie, [["__scopeId", "data-v-da36bd3d"]]), re = ["teal", "white"], de = ["href"], ue = ["color", "name"], ce = /* @__PURE__ */ m({
449
+ const Ve = /* @__PURE__ */ _(we, [["__scopeId", "data-v-6eb67b7e"]]), Be = ["teal", "white"], Le = ["href"], Ce = ["color", "name"], Ee = /* @__PURE__ */ y({
280
450
  __name: "JoyLink",
281
451
  props: {
282
452
  href: {
@@ -287,37 +457,32 @@ const se = /* @__PURE__ */ g(ie, [["__scopeId", "data-v-da36bd3d"]]), re = ["tea
287
457
  type: String,
288
458
  default: "teal",
289
459
  validator(e) {
290
- return re.includes(e);
460
+ return Be.includes(e);
291
461
  }
292
462
  },
293
463
  icon: String
294
464
  },
295
465
  setup(e) {
296
- const a = e, t = w(() => a.color === "white" ? "white" : "teal");
297
- return (l, r) => (o(), n("a", V({ href: e.href }, l.$attrs, {
466
+ const a = e, t = J(() => a.color === "white" ? "white" : "teal");
467
+ return (l, i) => (s(), u("a", C({ href: e.href }, l.$attrs, {
298
468
  class: ["joy-link", `joy-link_${e.color}`]
299
469
  }), [
300
- e.icon ? (o(), n("joy-icon", {
470
+ e.icon ? (s(), u("joy-icon", {
301
471
  key: 0,
302
- color: p(t),
472
+ color: f(t),
303
473
  name: e.icon
304
- }, null, 8, ue)) : u("", !0),
305
- i(l.$slots, "default", {}, void 0, !0)
306
- ], 16, de));
474
+ }, null, 8, Ce)) : j("", !0),
475
+ r(l.$slots, "default", {}, void 0, !0)
476
+ ], 16, Le));
307
477
  }
308
478
  });
309
- const ye = /* @__PURE__ */ g(ce, [["__scopeId", "data-v-640ee9a6"]]), pe = ["id", "value", "checked", "disabled", "required", "name"], fe = { class: "joy-radio-label" }, me = { class: "joy-radio-content__wrapper" }, ve = { class: "joy-radio-content" }, _e = /* @__PURE__ */ m({
479
+ const qe = /* @__PURE__ */ _(Ee, [["__scopeId", "data-v-640ee9a6"]]), ze = ["id", "value", "checked", "disabled", "required", "name"], Te = { class: "joy-radio-label" }, Re = { class: "joy-radio-content__wrapper" }, Oe = { class: "joy-radio-content" }, Ne = /* @__PURE__ */ y({
310
480
  __name: "JoyRadio",
311
481
  props: {
312
- disabled: Boolean,
313
- invalid: Boolean,
482
+ ...B,
314
483
  modelValue: {
315
484
  type: String
316
485
  },
317
- name: {
318
- type: String
319
- },
320
- required: Boolean,
321
486
  theme: {
322
487
  type: String,
323
488
  default: "default"
@@ -328,65 +493,65 @@ const ye = /* @__PURE__ */ g(ce, [["__scopeId", "data-v-640ee9a6"]]), pe = ["id"
328
493
  },
329
494
  emits: ["update:modelValue"],
330
495
  setup(e, { expose: a, emit: t }) {
331
- const l = e, r = b(!1), v = b(null), $ = b(null), d = q(), y = w(() => !l.modelValue || !l.value ? !1 : l.modelValue === l.value);
332
- function S() {
333
- r.value = !!d["expandable-content"] && y.value;
496
+ const l = e, i = h(!1), c = h(null), S = h(null), o = E(), p = J(() => !l.modelValue || !l.value ? !1 : l.modelValue === l.value);
497
+ function b() {
498
+ i.value = !!o["expandable-content"] && p.value;
334
499
  }
335
- function k() {
336
- t("update:modelValue", l.value), S();
500
+ function I() {
501
+ t("update:modelValue", l.value), b();
337
502
  }
338
- return E(() => {
339
- l.theme === "outline" && S();
340
- }), R(
503
+ return A(() => {
504
+ l.theme === "outline" && b();
505
+ }), D(
341
506
  () => l.modelValue,
342
507
  () => {
343
- S();
508
+ b();
344
509
  }
345
510
  ), a({
346
- checked: y,
347
- isExpanded: r
348
- }), (J, _) => (o(), n("label", {
511
+ checked: p,
512
+ isExpanded: i
513
+ }), (g, $) => (s(), u("label", {
349
514
  ref_key: "root",
350
- ref: v,
351
- class: f([
515
+ ref: c,
516
+ class: d([
352
517
  "joy-radio",
353
518
  `joy-radio--${e.theme}`,
354
519
  {
355
- "joy-radio--checked": p(y),
356
- "joy-radio--disabled": e.disabled,
357
- "joy-radio--invalid": e.invalid
520
+ "joy-radio--checked": f(p),
521
+ "joy-radio--disabled": g.disabled,
522
+ "joy-radio--invalid": g.invalid
358
523
  }
359
524
  ])
360
525
  }, [
361
- s("input", {
362
- id: e.name,
526
+ n("input", {
527
+ id: g.name,
363
528
  type: "radio",
364
529
  value: e.value,
365
- checked: p(y),
366
- disabled: e.disabled,
367
- required: e.required,
368
- name: e.name,
369
- onChange: k
370
- }, null, 40, pe),
371
- s("span", fe, [
372
- i(J.$slots, "default", {}, void 0, !0)
530
+ checked: f(p),
531
+ disabled: g.disabled,
532
+ required: g.required,
533
+ name: g.name,
534
+ onChange: I
535
+ }, null, 40, ze),
536
+ n("span", Te, [
537
+ r(g.$slots, "default", {}, void 0, !0)
373
538
  ]),
374
- s("div", me, [
375
- s("div", ve, [
376
- i(J.$slots, "radio-content", {}, void 0, !0)
539
+ n("div", Re, [
540
+ n("div", Oe, [
541
+ r(g.$slots, "radio-content", {}, void 0, !0)
377
542
  ]),
378
- s("div", {
543
+ n("div", {
379
544
  ref_key: "expandableElement",
380
- ref: $,
381
- class: f(["joy-radio-expandable", { "joy-radio-expandable--expanded": r.value }])
545
+ ref: S,
546
+ class: d(["joy-radio-expandable", { "joy-radio-expandable--expanded": i.value }])
382
547
  }, [
383
- i(J.$slots, "expandable-content", {}, void 0, !0)
548
+ r(g.$slots, "expandable-content", {}, void 0, !0)
384
549
  ], 2)
385
550
  ])
386
551
  ], 2));
387
552
  }
388
553
  });
389
- const be = /* @__PURE__ */ g(_e, [["__scopeId", "data-v-27ec5b79"]]), ge = ["form", "name"], Se = /* @__PURE__ */ m({
554
+ const Ae = /* @__PURE__ */ _(Ne, [["__scopeId", "data-v-822f5782"]]), Pe = ["form", "name"], Fe = /* @__PURE__ */ y({
390
555
  __name: "JoyRadioGroup",
391
556
  props: {
392
557
  direction: {
@@ -408,61 +573,37 @@ const be = /* @__PURE__ */ g(_e, [["__scopeId", "data-v-27ec5b79"]]), ge = ["for
408
573
  }
409
574
  },
410
575
  setup(e) {
411
- return (a, t) => (o(), n("fieldset", {
576
+ return (a, t) => (s(), u("fieldset", {
412
577
  ref: "root",
413
578
  class: "joy-radio-group-fieldset",
414
579
  role: "radiogroup",
415
580
  form: e.form,
416
581
  name: e.name
417
582
  }, [
418
- i(a.$slots, "radio-group-legend", {}, void 0, !0),
419
- s("div", {
420
- class: f(["joy-radio-group-container", `joy-radio-group-${e.direction}`])
583
+ r(a.$slots, "radio-group-legend", {}, void 0, !0),
584
+ n("div", {
585
+ class: d(["joy-radio-group-container", `joy-radio-group-${e.direction}`])
421
586
  }, [
422
- i(a.$slots, "default", {}, void 0, !0)
587
+ r(a.$slots, "default", {}, void 0, !0)
423
588
  ], 2)
424
- ], 8, ge));
589
+ ], 8, Pe));
425
590
  }
426
591
  });
427
- const je = /* @__PURE__ */ g(Se, [["__scopeId", "data-v-09adf076"]]), he = (e) => (A("data-v-1ef94fc2"), e = e(), M(), e), $e = ["id", "name", "aria-invalid", "required", "disabled", "value"], ke = /* @__PURE__ */ he(() => /* @__PURE__ */ s("joy-icon", {
592
+ const He = /* @__PURE__ */ _(Fe, [["__scopeId", "data-v-09adf076"]]), Me = (e) => (O("data-v-7733736c"), e = e(), N(), e), De = ["id", "name", "aria-invalid", "required", "disabled", "value"], Ge = /* @__PURE__ */ Me(() => /* @__PURE__ */ n("joy-icon", {
428
593
  class: "joy-select__chevron",
429
594
  name: "chevron-down"
430
- }, null, -1)), Je = /* @__PURE__ */ m({
595
+ }, null, -1)), We = /* @__PURE__ */ y({
431
596
  __name: "JoySelect",
432
597
  props: {
433
- disabled: {
434
- type: Boolean,
435
- default: !1
436
- },
437
- invalid: {
438
- type: Boolean,
439
- default: !1
440
- },
441
- id: {
442
- type: String
443
- },
444
- label: {
445
- type: String
446
- },
447
- labelSize: {
448
- type: String,
449
- default: "medium"
450
- },
598
+ ...B,
599
+ ...H,
451
600
  modelValue: {
452
601
  type: String,
453
602
  default: ""
454
603
  },
455
- name: {
456
- type: String,
457
- default: "select"
458
- },
459
604
  optionalLabel: {
460
605
  type: String
461
606
  },
462
- required: {
463
- type: Boolean,
464
- default: !1
465
- },
466
607
  requiredMark: {
467
608
  type: Boolean,
468
609
  default: !1
@@ -470,71 +611,71 @@ const je = /* @__PURE__ */ g(Se, [["__scopeId", "data-v-09adf076"]]), he = (e) =
470
611
  },
471
612
  emits: ["update:modelValue"],
472
613
  setup(e, { emit: a }) {
473
- const t = e, l = b(), r = b(), v = q();
474
- E(() => {
475
- var S;
476
- const d = v.label && v.label();
477
- if (!d || !d.length)
614
+ const t = e, l = h(), i = h(), c = E();
615
+ A(() => {
616
+ var b;
617
+ const o = c.label && c.label();
618
+ if (!o || !o.length)
478
619
  return;
479
- const y = d[0];
480
- if (y.type === "JoyLabel") {
481
- const k = (S = y.props) == null ? void 0 : S.for;
482
- if (!k) {
620
+ const p = o[0];
621
+ if (p.type === "JoyLabel") {
622
+ const I = (b = p.props) == null ? void 0 : b.for;
623
+ if (!I) {
483
624
  console.warn("JoyLabel for attribute is missing");
484
625
  return;
485
626
  }
486
- k !== t.id && console.warn("JoyLabel for attribute does not match with JoySelect id");
627
+ I !== t.id && console.warn("JoyLabel for attribute does not match with JoySelect id");
487
628
  }
488
629
  });
489
- function $(d) {
490
- const y = d.target.value;
491
- a("update:modelValue", y);
630
+ function S(o) {
631
+ const p = o.target.value;
632
+ a("update:modelValue", p);
492
633
  }
493
- return (d, y) => (o(), n("div", {
634
+ return (o, p) => (s(), u("div", {
494
635
  ref_key: "root",
495
636
  ref: l
496
637
  }, [
497
- i(d.$slots, "label", {}, () => [
498
- e.label ? (o(), I(z, {
638
+ r(o.$slots, "label", {}, () => [
639
+ o.label ? (s(), w(q, {
499
640
  key: 0,
500
- required: e.required && e.requiredMark,
641
+ required: o.required && e.requiredMark,
501
642
  "optional-label": e.optionalLabel,
502
- for: e.id || e.name,
503
- size: e.labelSize
643
+ for: o.id || o.name,
644
+ size: o.labelSize
504
645
  }, {
505
- default: B(() => [
506
- O(C(e.label), 1)
646
+ default: V(() => [
647
+ R(L(o.label), 1)
507
648
  ]),
508
649
  _: 1
509
- }, 8, ["required", "optional-label", "for", "size"])) : u("", !0)
650
+ }, 8, ["required", "optional-label", "for", "size"])) : j("", !0)
510
651
  ], !0),
511
- s("div", {
512
- class: f({
652
+ n("div", {
653
+ class: d({
513
654
  "joy-select__wrapper": !0,
514
- "joy-select--invalid": e.invalid,
515
- "joy-select--disabled": e.disabled
655
+ "joy-select--invalid": o.invalid,
656
+ "joy-select--disabled": o.disabled
516
657
  })
517
658
  }, [
518
- s("select", {
519
- id: e.id || e.name,
659
+ n("select", {
660
+ id: o.id || o.name,
520
661
  ref_key: "select",
521
- ref: r,
662
+ ref: i,
522
663
  class: "joy-select",
523
- name: e.name,
524
- "aria-invalid": e.invalid,
525
- required: e.required,
526
- disabled: e.disabled,
664
+ name: o.name,
665
+ "aria-invalid": o.invalid,
666
+ required: o.required,
667
+ disabled: o.disabled,
527
668
  value: e.modelValue,
528
- onInput: $
669
+ onInput: S
529
670
  }, [
530
- i(d.$slots, "default", {}, void 0, !0)
531
- ], 40, $e),
532
- ke
671
+ r(o.$slots, "default", {}, void 0, !0)
672
+ ], 40, De),
673
+ Ge
533
674
  ], 2)
534
675
  ], 512));
535
676
  }
536
677
  });
537
- const we = /* @__PURE__ */ g(Je, [["__scopeId", "data-v-1ef94fc2"]]), Ie = /* @__PURE__ */ m({
678
+ const Ze = /* @__PURE__ */ _(We, [["__scopeId", "data-v-7733736c"]]), Ue = /* @__PURE__ */ y({
538
679
  __name: "JoyWrapper",
539
680
  props: {
540
681
  justify: {
@@ -555,29 +696,14 @@ const we = /* @__PURE__ */ g(Je, [["__scopeId", "data-v-1ef94fc2"]]), Ie = /* @_
555
696
  }
556
697
  },
557
698
  setup(e) {
558
- return (a, t) => (o(), n("div", {
559
- class: f(["joy-wrapper", `joy-wrapper--justify-${e.justify}`, `joy-wrapper--align-${e.align}`, `joy-wrapper--direction-${e.direction}`, `joy-wrapper--wrap-${e.wrap}`])
699
+ return (a, t) => (s(), u("div", {
700
+ class: d(["joy-wrapper", `joy-wrapper--justify-${e.justify}`, `joy-wrapper--align-${e.align}`, `joy-wrapper--direction-${e.direction}`, `joy-wrapper--wrap-${e.wrap}`])
560
701
  }, [
561
- i(a.$slots, "default")
702
+ r(a.$slots, "default", {}, void 0, !0)
562
703
  ], 2));
563
704
  }
564
705
  });
565
- const Be = { class: "joy-template__heading" }, Ve = {
566
- key: 0,
567
- class: "joy-template-slot-back"
568
- }, qe = { class: "joy-template__heading___headings" }, ze = {
569
- key: 0,
570
- class: "joy-template-slot-title"
571
- }, xe = {
572
- key: 1,
573
- class: "joy-template-slot-subtitle"
574
- }, Le = {
575
- key: 0,
576
- class: "joy-template-slot-main"
577
- }, Ce = {
578
- key: 1,
579
- class: "joy-template-slot-sidebar"
580
- }, Ee = /* @__PURE__ */ m({
706
+ const Ke = /* @__PURE__ */ _(Ue, [["__scopeId", "data-v-dce6df77"]]), Xe = { class: "joy-template__heading" }, Qe = { class: "joy-template__heading___headings" }, Ye = /* @__PURE__ */ y({
581
707
  __name: "JoyTemplate",
582
708
  props: {
583
709
  full: { type: Boolean, default: !1 },
@@ -585,69 +711,129 @@ const Be = { class: "joy-template__heading" }, Ve = {
585
711
  },
586
712
  setup(e) {
587
713
  const a = e;
588
- return (t, l) => (o(), n("main", {
589
- class: f(["joy-template", { "joy-template--full": a.full }])
714
+ return (t, l) => (s(), u("main", {
715
+ class: d(["joy-template", { "joy-template--full": a.full }])
590
716
  }, [
591
- s("div", Be, [
592
- t.$slots["template-back"] ? (o(), n("div", Ve, [
593
- i(t.$slots, "template-back", {}, void 0, !0)
594
- ])) : u("", !0),
595
- s("div", qe, [
596
- t.$slots["template-title"] ? (o(), n("div", ze, [
597
- i(t.$slots, "template-title", {}, void 0, !0)
598
- ])) : u("", !0),
599
- t.$slots["template-subtitle"] ? (o(), n("div", xe, [
600
- i(t.$slots, "template-subtitle", {}, void 0, !0)
601
- ])) : u("", !0)
717
+ n("div", Xe, [
718
+ n("div", {
719
+ class: d({ "joy-template-slot-back": t.$slots["template-back"] })
720
+ }, [
721
+ r(t.$slots, "template-back", {}, void 0, !0)
722
+ ], 2),
723
+ n("div", Qe, [
724
+ n("div", {
725
+ class: d({ "joy-template-slot-title": t.$slots["template-title"] })
726
+ }, [
727
+ r(t.$slots, "template-title", {}, void 0, !0)
728
+ ], 2),
729
+ n("div", {
730
+ class: d({ "joy-template-slot-subtitle": t.$slots["template-subtitle"] })
731
+ }, [
732
+ r(t.$slots, "template-subtitle", {}, void 0, !0)
733
+ ], 2)
602
734
  ])
603
735
  ]),
604
- s("div", {
605
- class: f([
736
+ n("div", {
737
+ class: d([
606
738
  "joy-template__content",
607
739
  {
608
740
  "joy-template__content--reverse": a.sidebar === "left"
609
741
  }
610
742
  ])
611
743
  }, [
612
- t.$slots["template-main"] ? (o(), n("div", Le, [
613
- i(t.$slots, "template-main", {}, void 0, !0)
614
- ])) : u("", !0),
615
- t.$slots["template-sidebar"] ? (o(), n("div", Ce, [
616
- i(t.$slots, "template-sidebar", {}, void 0, !0)
617
- ])) : u("", !0)
744
+ n("div", {
745
+ class: d({ "joy-template-slot-main": t.$slots["template-main"] })
746
+ }, [
747
+ r(t.$slots, "template-main", {}, void 0, !0)
748
+ ], 2),
749
+ n("div", {
750
+ class: d({ "joy-template-slot-sidebar": t.$slots["template-sidebar"] })
751
+ }, [
752
+ r(t.$slots, "template-sidebar", {}, void 0, !0)
753
+ ], 2)
618
754
  ], 2)
619
755
  ], 2));
620
756
  }
621
757
  });
622
- const Ne = /* @__PURE__ */ g(Ee, [["__scopeId", "data-v-f0293852"]]), Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
758
+ const xe = /* @__PURE__ */ _(Ye, [["__scopeId", "data-v-d8b3fcfa"]]), et = ["name", "disabled", "checked", "required", "aria-checked", "value"], tt = { class: "joy-toggle__content" }, ot = /* @__PURE__ */ y({
759
+ __name: "JoyToggle",
760
+ props: F,
761
+ emits: ["update:modelValue"],
762
+ setup(e, { emit: a }) {
763
+ const t = {
764
+ onChange: (l) => {
765
+ const i = l.target.checked;
766
+ a("update:modelValue", i);
767
+ }
768
+ };
769
+ return (l, i) => (s(), u("div", null, [
770
+ n("label", {
771
+ class: d([
772
+ "joy-toggle",
773
+ {
774
+ "joy-toggle__checked": l.modelValue,
775
+ "joy-toggle__disabled": l.disabled
776
+ }
777
+ ])
778
+ }, [
779
+ n("input", {
780
+ ref: "input",
781
+ type: "checkbox",
782
+ class: "joy-toggle__input",
783
+ role: "checkbox",
784
+ name: l.name,
785
+ disabled: l.disabled,
786
+ checked: l.modelValue,
787
+ required: l.required,
788
+ "aria-checked": l.modelValue,
789
+ value: l.value,
790
+ onChange: i[0] || (i[0] = //@ts-ignore
791
+ (...c) => t.onChange && t.onChange(...c))
792
+ }, null, 40, et),
793
+ n("p", tt, [
794
+ r(l.$slots, "default", {}, void 0, !0)
795
+ ])
796
+ ], 2)
797
+ ]));
798
+ }
799
+ });
800
+ const at = /* @__PURE__ */ _(ot, [["__scopeId", "data-v-e617de9c"]]), lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
623
801
  __proto__: null,
624
- JoyButton: Y,
625
- JoyInput: se,
626
- JoyLabel: z,
627
- JoyLink: ye,
628
- JoyRadio: be,
629
- JoyRadioGroup: je,
630
- JoySelect: we,
631
- JoySpinner: N,
632
- JoyTemplate: Ne,
633
- JoyWrapper: Ie
634
- }, Symbol.toStringTag, { value: "Module" })), Oe = {
802
+ JoyButton: ae,
803
+ JoyCheckbox: de,
804
+ JoyFormError: _e,
805
+ JoyHighlight: be,
806
+ JoyInput: Ve,
807
+ JoyLabel: q,
808
+ JoyLink: qe,
809
+ JoyRadio: Ae,
810
+ JoyRadioGroup: He,
811
+ JoySelect: Ze,
812
+ JoySpinner: P,
813
+ JoyTemplate: xe,
814
+ JoyToggle: at,
815
+ JoyWrapper: Ke
816
+ }, Symbol.toStringTag, { value: "Module" })), it = {
635
817
  install: (e) => {
636
- Object.entries(Te).forEach(([a, t]) => {
818
+ Object.entries(lt).forEach(([a, t]) => {
637
819
  e.component(a, t);
638
820
  });
639
821
  }
640
822
  };
641
823
  export {
642
- Y as JoyButton,
643
- se as JoyInput,
644
- z as JoyLabel,
645
- ye as JoyLink,
646
- be as JoyRadio,
647
- je as JoyRadioGroup,
648
- we as JoySelect,
649
- N as JoySpinner,
650
- Ne as JoyTemplate,
651
- Oe as JoyVuePlugin,
652
- Ie as JoyWrapper
824
+ ae as JoyButton,
825
+ de as JoyCheckbox,
826
+ _e as JoyFormError,
827
+ be as JoyHighlight,
828
+ Ve as JoyInput,
829
+ q as JoyLabel,
830
+ qe as JoyLink,
831
+ Ae as JoyRadio,
832
+ He as JoyRadioGroup,
833
+ Ze as JoySelect,
834
+ P as JoySpinner,
835
+ xe as JoyTemplate,
836
+ at as JoyToggle,
837
+ it as JoyVuePlugin,
838
+ Ke as JoyWrapper
653
839
  };