maz-ui 3.21.5 → 3.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/components/MazCheckbox.d.ts +14 -4
  2. package/components/MazCheckbox.mjs +36 -29
  3. package/components/MazInput.d.ts +38 -22
  4. package/components/MazInput.mjs +1 -2
  5. package/components/MazInputNumber.mjs +1 -1
  6. package/components/MazInputPrice.mjs +1 -1
  7. package/components/MazInputTags.mjs +1 -1
  8. package/components/MazPhoneNumberInput.d.ts +41 -1
  9. package/components/MazPhoneNumberInput.mjs +1 -1
  10. package/components/MazPicker.mjs +1 -1
  11. package/components/MazRadio.d.ts +82 -0
  12. package/components/MazRadio.mjs +133 -0
  13. package/components/MazSelect.d.ts +33 -1
  14. package/components/MazSelect.mjs +1 -1
  15. package/components/MazTextarea.d.ts +17 -17
  16. package/components/MazTextarea.mjs +7 -8
  17. package/components/assets/MazCheckbox.css +1 -1
  18. package/components/assets/MazInput.css +1 -1
  19. package/components/assets/MazInputPrice.css +1 -1
  20. package/components/assets/MazInputTags.css +1 -1
  21. package/components/assets/MazPhoneNumberInput.css +1 -1
  22. package/components/assets/MazRadio.css +1 -0
  23. package/components/assets/MazSelect.css +1 -1
  24. package/components/assets/MazTextarea.css +1 -1
  25. package/components/chunks/{MazBtn-a3a285eb.mjs → MazBtn-0e02f0da.mjs} +2 -2
  26. package/components/chunks/{MazBtn-704bd37b.mjs → MazBtn-2f4fa942.mjs} +2 -2
  27. package/components/chunks/{MazBtn-2a8cee98.mjs → MazBtn-30723941.mjs} +2 -2
  28. package/components/chunks/{MazBtn-080c9397.mjs → MazBtn-4e1e116e.mjs} +2 -2
  29. package/components/chunks/{MazBtn-7f413085.mjs → MazBtn-b42e3575.mjs} +2 -2
  30. package/components/chunks/{MazBtn-29a43072.mjs → MazBtn-f48da79c.mjs} +2 -2
  31. package/components/chunks/{MazCheckbox-b445b9b2.mjs → MazCheckbox-9fa9179a.mjs} +37 -30
  32. package/components/chunks/{MazCheckbox-b8974a89.mjs → MazCheckbox-e0bbe6ec.mjs} +37 -30
  33. package/components/chunks/MazInput-713b00d0.mjs +326 -0
  34. package/components/chunks/MazInput-b9386887.mjs +341 -0
  35. package/components/chunks/MazInput-c33627dd.mjs +334 -0
  36. package/components/chunks/{MazInputPrice-eb36a7dd.mjs → MazInputPrice-452297f5.mjs} +171 -191
  37. package/components/chunks/{MazInputTags-24164d56.mjs → MazInputTags-7a463b81.mjs} +176 -196
  38. package/components/chunks/{MazPhoneNumberInput-d90953ab.mjs → MazPhoneNumberInput-31bc05f9.mjs} +241 -226
  39. package/components/chunks/{MazPicker-9f4c724c.mjs → MazPicker-50fc11d1.mjs} +4 -4
  40. package/components/chunks/{MazPickerCalendar-35fe36ab.mjs → MazPickerCalendar-cacb361c.mjs} +5 -5
  41. package/components/chunks/{MazPickerHeader-d8687abf.mjs → MazPickerHeader-63d45179.mjs} +1 -1
  42. package/components/chunks/{MazPickerMonthSwitcher-739ed62a.mjs → MazPickerMonthSwitcher-913c6e2c.mjs} +2 -2
  43. package/components/chunks/{MazPickerShortcuts-68622fe8.mjs → MazPickerShortcuts-c6fabfc6.mjs} +2 -2
  44. package/components/chunks/{MazPickerTime-031062b2.mjs → MazPickerTime-5e4475da.mjs} +2 -2
  45. package/components/chunks/{MazPickerYearSwitcher-2a006a30.mjs → MazPickerYearSwitcher-dd4fa89c.mjs} +3 -3
  46. package/components/chunks/{MazSelect-4de4d975.mjs → MazSelect-2e5cd411.mjs} +199 -206
  47. package/components/chunks/{MazSpinner-d356ad25.mjs → MazSpinner-100c99b8.mjs} +1 -1
  48. package/components/chunks/{MazSpinner-d669a3af.mjs → MazSpinner-191ad23b.mjs} +1 -1
  49. package/components/chunks/{MazSpinner-89743727.mjs → MazSpinner-339a9006.mjs} +1 -1
  50. package/components/chunks/{MazSpinner-85c86950.mjs → MazSpinner-8859d658.mjs} +1 -1
  51. package/components/chunks/{MazSpinner-8700b7eb.mjs → MazSpinner-cb6f99f3.mjs} +1 -1
  52. package/components/chunks/{MazSpinner-76e79a34.mjs → MazSpinner-db6fc59d.mjs} +1 -1
  53. package/components/index.d.ts +1 -0
  54. package/components/index.mjs +1 -0
  55. package/css/main.css +1 -1
  56. package/nuxt/index.json +1 -1
  57. package/package.json +1 -1
  58. package/types/components/MazCheckbox.vue.d.ts +14 -4
  59. package/types/components/MazInput.vue.d.ts +38 -22
  60. package/types/components/MazPhoneNumberInput.vue.d.ts +41 -1
  61. package/types/components/MazRadio.vue.d.ts +82 -0
  62. package/types/components/MazSelect.vue.d.ts +33 -1
  63. package/types/components/MazTextarea.vue.d.ts +17 -17
  64. package/types/components/index.d.ts +1 -0
  65. package/components/chunks/MazInput-12a098d4.mjs +0 -361
  66. package/components/chunks/MazInput-20ea773f.mjs +0 -354
  67. package/components/chunks/MazInput-4313d3cc.mjs +0 -346
@@ -3,8 +3,8 @@ import type { Color, Size } from './types';
3
3
  export type { Color, Size };
4
4
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
5
5
  modelValue: {
6
- type: BooleanConstructor;
7
- required: true;
6
+ type: PropType<boolean | (string | number)[]>;
7
+ default: undefined;
8
8
  };
9
9
  id: {
10
10
  type: StringConstructor;
@@ -14,6 +14,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
14
14
  type: PropType<Color>;
15
15
  default: string;
16
16
  };
17
+ value: {
18
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
19
+ default: undefined;
20
+ };
17
21
  name: {
18
22
  type: StringConstructor;
19
23
  default: string;
@@ -31,8 +35,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
31
35
  "update:model-value": (...args: any[]) => void;
32
36
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
33
37
  modelValue: {
34
- type: BooleanConstructor;
35
- required: true;
38
+ type: PropType<boolean | (string | number)[]>;
39
+ default: undefined;
36
40
  };
37
41
  id: {
38
42
  type: StringConstructor;
@@ -42,6 +46,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
42
46
  type: PropType<Color>;
43
47
  default: string;
44
48
  };
49
+ value: {
50
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
51
+ default: undefined;
52
+ };
45
53
  name: {
46
54
  type: StringConstructor;
47
55
  default: string;
@@ -62,7 +70,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
62
70
  color: Color;
63
71
  disabled: boolean;
64
72
  name: string;
73
+ value: string | number | boolean;
65
74
  id: string;
75
+ modelValue: boolean | (string | number)[];
66
76
  }, {}>, {
67
77
  default?(_: {}): any;
68
78
  }>;
@@ -1,5 +1,5 @@
1
1
  import "./assets/MazCheckbox.css";
2
- import { computed, openBlock, createElementBlock, createElementVNode, defineComponent, useCssVars, getCurrentInstance, unref, normalizeClass, mergeProps, createVNode, Transition, withCtx, withDirectives, vShow, renderSlot } from "vue";
2
+ import { computed, openBlock, createElementBlock, createElementVNode, defineComponent, useCssVars, getCurrentInstance, unref, normalizeClass, mergeProps, createVNode, renderSlot } from "vue";
3
3
  const useInstanceUniqId = ({
4
4
  componentName,
5
5
  instance,
@@ -39,12 +39,16 @@ const _hoisted_2 = ["id", "checked", "disabled", "name"];
39
39
  const _sfc_main = /* @__PURE__ */ defineComponent({
40
40
  __name: "MazCheckbox",
41
41
  props: {
42
- modelValue: { type: Boolean, required: true },
42
+ modelValue: {
43
+ type: [Boolean, Array],
44
+ default: void 0
45
+ },
43
46
  id: { type: String, default: void 0 },
44
47
  color: {
45
48
  type: String,
46
49
  default: "primary"
47
50
  },
51
+ value: { type: [String, Number, Boolean], default: void 0 },
48
52
  name: { type: String, default: "m-checkbox" },
49
53
  size: { type: String, default: "md" },
50
54
  disabled: { type: Boolean, default: false }
@@ -57,10 +61,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
61
  ],
58
62
  setup(__props, { emit: __emit }) {
59
63
  useCssVars((_ctx) => ({
60
- "2887ae19": checkIconColor.value,
61
- "3ea743fb": checkboxSize.value,
62
- "8729aa64": checkboxSelectedColor.value,
63
- "324bb1de": checkboxBoxShadow.value
64
+ "40cdf8ce": checkIconColor.value,
65
+ "25e00d0a": checkboxSize.value,
66
+ "5692b564": checkboxSelectedColor.value,
67
+ "9df23cde": checkboxBoxShadow.value
64
68
  }));
65
69
  const instance = getCurrentInstance();
66
70
  const props = __props;
@@ -70,6 +74,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
70
74
  instance,
71
75
  providedId: props.id
72
76
  });
77
+ const isChecked = computed(
78
+ () => typeof props.value !== "boolean" && Array.isArray(props.modelValue) ? props.modelValue.includes(props.value) : typeof props.modelValue === "boolean" ? props.modelValue : false
79
+ );
73
80
  const checkboxSize = computed(() => {
74
81
  switch (props.size) {
75
82
  case "xl": {
@@ -120,14 +127,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
120
127
  () => ["black", "transparent"].includes(props.color) ? `var(--maz-color-muted)` : `var(--maz-color-${props.color}-alpha)`
121
128
  );
122
129
  function keyboardHandler(event) {
123
- if (["Enter", "Space"].includes(event.code)) {
130
+ if (["Space"].includes(event.code)) {
124
131
  event.preventDefault();
125
- emitValue(!props.modelValue);
132
+ emitValue(props.value ?? !props.modelValue);
133
+ }
134
+ }
135
+ function getNewValue(value) {
136
+ if (typeof value === "boolean" && (typeof props.modelValue === "boolean" || props.modelValue === void 0 || props.modelValue === null)) {
137
+ return props.modelValue ? false : true;
138
+ } else if (Array.isArray(props.modelValue) && typeof value !== "boolean") {
139
+ return props.modelValue.includes(value) ? props.modelValue.filter((v) => v !== value) : [...props.modelValue, value];
140
+ } else {
141
+ return [value];
126
142
  }
127
143
  }
128
144
  function emitValue(value) {
129
- emits("update:model-value", value);
130
- emits("change", value);
145
+ const newValue = getNewValue(value);
146
+ emits("update:model-value", newValue);
147
+ emits("change", newValue);
131
148
  }
132
149
  return (_ctx, _cache) => {
133
150
  return openBlock(), createElementBlock("label", {
@@ -135,43 +152,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
135
152
  class: normalizeClass(["m-checkbox", { "--disabled": __props.disabled }]),
136
153
  tabindex: "0",
137
154
  role: "checkbox",
138
- "aria-checked": __props.modelValue,
155
+ "aria-checked": isChecked.value,
139
156
  onKeydown: keyboardHandler
140
157
  }, [
141
158
  createElementVNode("input", mergeProps({
142
159
  id: unref(instanceId),
143
- checked: __props.modelValue
160
+ checked: isChecked.value
144
161
  }, _ctx.$attrs, {
162
+ tabindex: "-1",
145
163
  disabled: __props.disabled,
146
164
  name: __props.name,
147
165
  type: "checkbox",
148
166
  onChange: _cache[0] || (_cache[0] = ($event) => {
149
167
  var _a;
150
- return emitValue((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked);
168
+ return emitValue(__props.value ?? ((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.checked));
151
169
  })
152
170
  }), null, 16, _hoisted_2),
153
171
  createElementVNode("span", null, [
154
- createVNode(Transition, {
155
- name: "maz-scale",
156
- persisted: ""
157
- }, {
158
- default: withCtx(() => [
159
- withDirectives(createVNode(unref(CheckIcon), {
160
- class: normalizeClass(["check-icon", checkIconSize.value])
161
- }, null, 8, ["class"]), [
162
- [vShow, __props.modelValue]
163
- ])
164
- ]),
165
- _: 1
166
- /* STABLE */
167
- })
172
+ createVNode(unref(CheckIcon), {
173
+ class: normalizeClass(["check-icon", checkIconSize.value])
174
+ }, null, 8, ["class"])
168
175
  ]),
169
176
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
170
177
  ], 42, _hoisted_1);
171
178
  };
172
179
  }
173
180
  });
174
- const MazCheckbox_vue_vue_type_style_index_0_scoped_e6c359ea_lang = "";
181
+ const MazCheckbox_vue_vue_type_style_index_0_scoped_141a5e53_lang = "";
175
182
  const _export_sfc = (sfc, props) => {
176
183
  const target = sfc.__vccOpts || sfc;
177
184
  for (const [key, val] of props) {
@@ -179,7 +186,7 @@ const _export_sfc = (sfc, props) => {
179
186
  }
180
187
  return target;
181
188
  };
182
- const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e6c359ea"]]);
189
+ const MazCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-141a5e53"]]);
183
190
  export {
184
191
  MazCheckbox as default
185
192
  };
@@ -1,7 +1,15 @@
1
- import { type PropType } from 'vue';
1
+ import { type PropType, type StyleValue } from 'vue';
2
2
  import type { Color, ModelValueSimple, Size } from './types';
3
3
  export type { Color, Size, ModelValueSimple } from './types';
4
- declare const _default: import("vue").DefineComponent<{
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
5
+ style: {
6
+ type: PropType<StyleValue>;
7
+ default: undefined;
8
+ };
9
+ class: {
10
+ type: StringConstructor;
11
+ default: undefined;
12
+ };
5
13
  modelValue: {
6
14
  type: PropType<ModelValueSimple>;
7
15
  default: undefined;
@@ -108,25 +116,22 @@ declare const _default: import("vue").DefineComponent<{
108
116
  type: StringConstructor;
109
117
  default: undefined;
110
118
  };
111
- }, {
112
- inputValue: import("vue").WritableComputedRef<ModelValueSimple>;
113
- shouldUp: import("vue").ComputedRef<boolean>;
114
- hasLabel: import("vue").ComputedRef<boolean>;
115
- computedPlaceholder: import("vue").ComputedRef<string | undefined>;
116
- isPasswordType: import("vue").ComputedRef<boolean>;
117
- inputType: import("vue").ComputedRef<string>;
118
- input: import("vue").Ref<HTMLElement | undefined>;
119
- isFocused: import("vue").Ref<boolean>;
120
- hasPasswordVisible: import("vue").Ref<boolean>;
121
- borderStyle: import("vue").ComputedRef<"maz-border-danger" | "maz-border-success" | "maz-border-warning" | "maz-border-black" | "maz-border-info" | "maz-border-primary" | "maz-border-secondary" | "maz-border-white" | "--default-border" | undefined>;
122
- focus: (event: Event) => void;
123
- blur: (event: Event) => void;
124
- change: (event: Event) => void;
125
- emitValue: (value: unknown) => void;
126
- hasRightPart: () => boolean;
127
- hasLeftPart: () => boolean;
128
- instanceId: import("vue").ComputedRef<string>;
129
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "blur" | "change" | "focus" | "update" | "update:model-value")[], "click" | "blur" | "change" | "focus" | "update" | "update:model-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
119
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
120
+ click: (...args: any[]) => void;
121
+ blur: (...args: any[]) => void;
122
+ change: (...args: any[]) => void;
123
+ focus: (...args: any[]) => void;
124
+ update: (...args: any[]) => void;
125
+ "update:model-value": (...args: any[]) => void;
126
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
127
+ style: {
128
+ type: PropType<StyleValue>;
129
+ default: undefined;
130
+ };
131
+ class: {
132
+ type: StringConstructor;
133
+ default: undefined;
134
+ };
130
135
  modelValue: {
131
136
  type: PropType<ModelValueSimple>;
132
137
  default: undefined;
@@ -247,6 +252,8 @@ declare const _default: import("vue").DefineComponent<{
247
252
  color: Color;
248
253
  type: string;
249
254
  label: string;
255
+ style: StyleValue;
256
+ class: string;
250
257
  disabled: boolean;
251
258
  name: string;
252
259
  placeholder: string;
@@ -267,5 +274,14 @@ declare const _default: import("vue").DefineComponent<{
267
274
  validButtonLoading: boolean;
268
275
  autoFocus: boolean;
269
276
  borderActive: boolean;
270
- }, {}>;
277
+ }, {}>, {
278
+ "left-icon"?(_: {}): any;
279
+ "right-icon"?(_: {}): any;
280
+ "valid-button"?(_: {}): any;
281
+ }>;
271
282
  export default _default;
283
+ type __VLS_WithTemplateSlots<T, S> = T & {
284
+ new (): {
285
+ $slots: S;
286
+ };
287
+ };
@@ -1,5 +1,4 @@
1
- import { M } from "./chunks/MazInput-12a098d4.mjs";
2
- import "vue";
1
+ import { M } from "./chunks/MazInput-b9386887.mjs";
3
2
  export {
4
3
  M as default
5
4
  };
@@ -19,7 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  emits: ["update:model-value"],
20
20
  setup(__props, { emit: __emit }) {
21
21
  const MazBtn = defineAsyncComponent(() => import("./chunks/MazBtn-cf0c8fcb.mjs"));
22
- const MazInput = defineAsyncComponent(() => import("./chunks/MazInput-20ea773f.mjs"));
22
+ const MazInput = defineAsyncComponent(() => import("./chunks/MazInput-c33627dd.mjs"));
23
23
  const PlusIcon = defineAsyncComponent(() => import("./chunks/plus-b1b0a5a8.mjs"));
24
24
  const MinusIcon = defineAsyncComponent(() => import("./chunks/minus-c9cdee90.mjs"));
25
25
  const props = __props;
@@ -1,4 +1,4 @@
1
- import { a } from "./chunks/MazInputPrice-eb36a7dd.mjs";
1
+ import { a } from "./chunks/MazInputPrice-452297f5.mjs";
2
2
  export {
3
3
  a as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { M } from "./chunks/MazInputTags-24164d56.mjs";
1
+ import { M } from "./chunks/MazInputTags-7a463b81.mjs";
2
2
  export {
3
3
  M as default
4
4
  };
@@ -2,8 +2,16 @@ import type { CountryCode } from 'libphonenumber-js';
2
2
  import type { Result, Translations } from './MazPhoneNumberInput/types';
3
3
  import type { Color, Position, Size } from './types';
4
4
  export type { Color, Size, Position, CountryCode, Result, Translations };
5
- import { type PropType } from 'vue';
5
+ import { type PropType, type StyleValue } from 'vue';
6
6
  declare const _default: import("vue").DefineComponent<{
7
+ style: {
8
+ type: PropType<StyleValue>;
9
+ default: undefined;
10
+ };
11
+ class: {
12
+ type: StringConstructor;
13
+ default: undefined;
14
+ };
7
15
  /** Country calling code + telephone number in international format */
8
16
  modelValue: {
9
17
  type: StringConstructor;
@@ -160,6 +168,16 @@ declare const _default: import("vue").DefineComponent<{
160
168
  type: BooleanConstructor;
161
169
  default: boolean;
162
170
  };
171
+ /** Will replace the calling code by the country name in the country selector */
172
+ countrySelectorDisplayName: {
173
+ type: BooleanConstructor;
174
+ default: boolean;
175
+ };
176
+ /** Choose the width of the country selector */
177
+ countrySelectorWidth: {
178
+ type: StringConstructor;
179
+ default: string;
180
+ };
163
181
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
164
182
  data: (...args: any[]) => void;
165
183
  update: (...args: any[]) => void;
@@ -167,6 +185,14 @@ declare const _default: import("vue").DefineComponent<{
167
185
  "country-code": (...args: any[]) => void;
168
186
  "update:country-code": (...args: any[]) => void;
169
187
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
188
+ style: {
189
+ type: PropType<StyleValue>;
190
+ default: undefined;
191
+ };
192
+ class: {
193
+ type: StringConstructor;
194
+ default: undefined;
195
+ };
170
196
  /** Country calling code + telephone number in international format */
171
197
  modelValue: {
172
198
  type: StringConstructor;
@@ -323,6 +349,16 @@ declare const _default: import("vue").DefineComponent<{
323
349
  type: BooleanConstructor;
324
350
  default: boolean;
325
351
  };
352
+ /** Will replace the calling code by the country name in the country selector */
353
+ countrySelectorDisplayName: {
354
+ type: BooleanConstructor;
355
+ default: boolean;
356
+ };
357
+ /** Choose the width of the country selector */
358
+ countrySelectorWidth: {
359
+ type: StringConstructor;
360
+ default: string;
361
+ };
326
362
  }>> & {
327
363
  "onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
328
364
  onUpdate?: ((...args: any[]) => any) | undefined;
@@ -333,6 +369,8 @@ declare const _default: import("vue").DefineComponent<{
333
369
  success: boolean;
334
370
  size: Size;
335
371
  color: Color;
372
+ style: StyleValue;
373
+ class: string;
336
374
  disabled: boolean;
337
375
  placeholder: string;
338
376
  id: string;
@@ -368,5 +406,7 @@ declare const _default: import("vue").DefineComponent<{
368
406
  countryLocale: string;
369
407
  noValidationError: boolean;
370
408
  noValidationSuccess: boolean;
409
+ countrySelectorDisplayName: boolean;
410
+ countrySelectorWidth: string;
371
411
  }, {}>;
372
412
  export default _default;
@@ -1,4 +1,4 @@
1
- import { M } from "./chunks/MazPhoneNumberInput-d90953ab.mjs";
1
+ import { M } from "./chunks/MazPhoneNumberInput-31bc05f9.mjs";
2
2
  export {
3
3
  M as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { M } from "./chunks/MazPicker-9f4c724c.mjs";
1
+ import { M } from "./chunks/MazPicker-50fc11d1.mjs";
2
2
  export {
3
3
  M as default
4
4
  };
@@ -0,0 +1,82 @@
1
+ import { type PropType } from 'vue';
2
+ import type { Color, Size } from './types';
3
+ export type { Color, Size };
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
5
+ modelValue: {
6
+ type: StringConstructor;
7
+ default: undefined;
8
+ };
9
+ value: {
10
+ type: StringConstructor;
11
+ required: true;
12
+ };
13
+ name: {
14
+ type: StringConstructor;
15
+ required: true;
16
+ };
17
+ id: {
18
+ type: StringConstructor;
19
+ default: undefined;
20
+ };
21
+ color: {
22
+ type: PropType<Color>;
23
+ default: string;
24
+ };
25
+ size: {
26
+ type: PropType<Size>;
27
+ default: string;
28
+ };
29
+ disabled: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
34
+ change: (...args: any[]) => void;
35
+ "update:model-value": (...args: any[]) => void;
36
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
+ modelValue: {
38
+ type: StringConstructor;
39
+ default: undefined;
40
+ };
41
+ value: {
42
+ type: StringConstructor;
43
+ required: true;
44
+ };
45
+ name: {
46
+ type: StringConstructor;
47
+ required: true;
48
+ };
49
+ id: {
50
+ type: StringConstructor;
51
+ default: undefined;
52
+ };
53
+ color: {
54
+ type: PropType<Color>;
55
+ default: string;
56
+ };
57
+ size: {
58
+ type: PropType<Size>;
59
+ default: string;
60
+ };
61
+ disabled: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
65
+ }>> & {
66
+ onChange?: ((...args: any[]) => any) | undefined;
67
+ "onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
68
+ }, {
69
+ size: Size;
70
+ color: Color;
71
+ disabled: boolean;
72
+ id: string;
73
+ modelValue: string;
74
+ }, {}>, {
75
+ default?(_: {}): any;
76
+ }>;
77
+ export default _default;
78
+ type __VLS_WithTemplateSlots<T, S> = T & {
79
+ new (): {
80
+ $slots: S;
81
+ };
82
+ };
@@ -0,0 +1,133 @@
1
+ import "./assets/MazRadio.css";
2
+ import { computed, defineComponent, useCssVars, getCurrentInstance, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, mergeProps, renderSlot, pushScopeId, popScopeId } from "vue";
3
+ const useInstanceUniqId = ({
4
+ componentName,
5
+ instance,
6
+ providedId
7
+ }) => {
8
+ return computed(() => providedId ?? `${componentName}-${instance == null ? void 0 : instance.uid}`);
9
+ };
10
+ const _withScopeId = (n) => (pushScopeId("data-v-f47afb8e"), n = n(), popScopeId(), n);
11
+ const _hoisted_1 = ["for", "aria-checked"];
12
+ const _hoisted_2 = ["id", "value", "disabled", "name", "checked"];
13
+ const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
14
+ "span",
15
+ null,
16
+ [
17
+ /* @__PURE__ */ createElementVNode("span", { class: "round" })
18
+ ],
19
+ -1
20
+ /* HOISTED */
21
+ ));
22
+ const _sfc_main = /* @__PURE__ */ defineComponent({
23
+ __name: "MazRadio",
24
+ props: {
25
+ modelValue: { type: String, default: void 0 },
26
+ value: { type: String, required: true },
27
+ name: { type: String, required: true },
28
+ id: { type: String, default: void 0 },
29
+ color: {
30
+ type: String,
31
+ default: "primary"
32
+ },
33
+ size: { type: String, default: "md" },
34
+ disabled: { type: Boolean, default: false }
35
+ },
36
+ emits: [
37
+ /* emitted when value change */
38
+ "update:model-value",
39
+ /* emited when value change */
40
+ "change"
41
+ ],
42
+ setup(__props, { emit: __emit }) {
43
+ useCssVars((_ctx) => ({
44
+ "2a231cf6": radioSize.value,
45
+ "ef04cef8": radioSelectedColor.value,
46
+ "f6f84072": radioBoxShadow.value
47
+ }));
48
+ const instance = getCurrentInstance();
49
+ const props = __props;
50
+ const emits = __emit;
51
+ const instanceId = useInstanceUniqId({
52
+ componentName: "MazCheckbox",
53
+ instance,
54
+ providedId: props.id
55
+ });
56
+ const isSelected = computed(() => props.modelValue === props.value);
57
+ const radioSize = computed(() => {
58
+ switch (props.size) {
59
+ case "xl": {
60
+ return "2.25rem";
61
+ }
62
+ case "lg": {
63
+ return "2rem";
64
+ }
65
+ default: {
66
+ return "1.625rem";
67
+ }
68
+ case "sm": {
69
+ return "1.425rem";
70
+ }
71
+ case "xs": {
72
+ return "1.325rem";
73
+ }
74
+ case "mini": {
75
+ return "1.2rem";
76
+ }
77
+ }
78
+ });
79
+ const radioSelectedColor = computed(() => `var(--maz-color-${props.color})`);
80
+ const radioBoxShadow = computed(
81
+ () => ["black", "transparent"].includes(props.color) ? `var(--maz-color-muted)` : `var(--maz-color-${props.color}-alpha)`
82
+ );
83
+ function keyboardHandler(event, value) {
84
+ if (["Space"].includes(event.code)) {
85
+ event.preventDefault();
86
+ emitValue(value);
87
+ }
88
+ }
89
+ function emitValue(value) {
90
+ emits("update:model-value", value);
91
+ emits("change", value);
92
+ }
93
+ return (_ctx, _cache) => {
94
+ return openBlock(), createElementBlock("label", {
95
+ for: unref(instanceId),
96
+ class: normalizeClass(["m-checkbox", { "--disabled": __props.disabled, "--selected": isSelected.value }]),
97
+ tabindex: "0",
98
+ role: "radio",
99
+ "aria-checked": isSelected.value,
100
+ onKeydown: _cache[1] || (_cache[1] = ($event) => keyboardHandler($event, __props.value))
101
+ }, [
102
+ createElementVNode("input", mergeProps({
103
+ id: unref(instanceId),
104
+ value: __props.value
105
+ }, _ctx.$attrs, {
106
+ tabindex: "-1",
107
+ disabled: __props.disabled,
108
+ name: __props.name,
109
+ type: "radio",
110
+ checked: isSelected.value,
111
+ onChange: _cache[0] || (_cache[0] = ($event) => {
112
+ var _a;
113
+ return emitValue((_a = $event == null ? void 0 : $event.target) == null ? void 0 : _a.value);
114
+ })
115
+ }), null, 16, _hoisted_2),
116
+ _hoisted_3,
117
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
118
+ ], 42, _hoisted_1);
119
+ };
120
+ }
121
+ });
122
+ const MazRadio_vue_vue_type_style_index_0_scoped_f47afb8e_lang = "";
123
+ const _export_sfc = (sfc, props) => {
124
+ const target = sfc.__vccOpts || sfc;
125
+ for (const [key, val] of props) {
126
+ target[key] = val;
127
+ }
128
+ return target;
129
+ };
130
+ const MazRadio = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f47afb8e"]]);
131
+ export {
132
+ MazRadio as default
133
+ };