iryx-ui 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/components/AvatarGroup.vue.d.ts +8 -2
  2. package/dist/components/AvatarGroup.vue_vue_type_script_setup_true_lang.js +57 -23
  3. package/dist/components/Breadcrumb.vue.d.ts +10 -2
  4. package/dist/components/Breadcrumb.vue_vue_type_script_setup_true_lang.js +66 -34
  5. package/dist/components/ConfirmPopover.vue.d.ts +1 -1
  6. package/dist/components/FileUpload.vue.d.ts +23 -1
  7. package/dist/components/FileUpload.vue_vue_type_script_setup_true_lang.js +139 -96
  8. package/dist/components/Input.vue.d.ts +14 -0
  9. package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +86 -69
  10. package/dist/components/SignaturePad.vue.d.ts +1 -1
  11. package/dist/components/Textarea.vue.d.ts +14 -0
  12. package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +90 -42
  13. package/dist/components/Toaster.vue_vue_type_script_setup_true_lang.js +42 -41
  14. package/dist/components/index.js +144 -144
  15. package/dist/composables/character-count.d.ts +6 -0
  16. package/dist/composables/character-count.js +18 -0
  17. package/dist/composables/toast.d.ts +16 -1
  18. package/dist/composables/toast.js +23 -2
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +154 -154
  21. package/dist/theme/avatar.d.ts +21 -0
  22. package/dist/theme/avatar.js +28 -21
  23. package/dist/theme/bar-chart.d.ts +3 -3
  24. package/dist/theme/calendar.js +1 -1
  25. package/dist/theme/code.js +1 -1
  26. package/dist/theme/donut-chart.d.ts +3 -3
  27. package/dist/theme/file-upload.d.ts +24 -0
  28. package/dist/theme/file-upload.js +6 -2
  29. package/dist/theme/input.d.ts +46 -0
  30. package/dist/theme/input.js +10 -2
  31. package/dist/theme/kbd.js +1 -1
  32. package/dist/theme/line-chart.d.ts +3 -3
  33. package/dist/theme/rating.js +1 -1
  34. package/dist/theme/table.js +1 -1
  35. package/dist/theme/toast.d.ts +9 -0
  36. package/dist/theme/toast.js +2 -1
  37. package/package.json +1 -1
@@ -11,21 +11,27 @@ export interface AvatarGroupProps {
11
11
  max?: number;
12
12
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
13
13
  shape?: 'circle' | 'square';
14
+ /**
15
+ * Show each person's `name` in a tooltip, and lift the avatar under the
16
+ * pointer or focus out of the stack.
17
+ */
18
+ tooltip?: boolean;
14
19
  /** Skip built-in classes; you take over styling entirely. */
15
20
  unstyled?: boolean;
16
21
  class?: ClassValue;
17
22
  /** Override classes per element, e.g. `{ overflow: 'bg-primary' }`. */
18
23
  ui?: {
19
24
  root?: string;
25
+ trigger?: string;
20
26
  item?: string;
21
27
  overflow?: string;
22
28
  };
23
29
  }
24
- declare var __VLS_1: {
30
+ declare var __VLS_8: {
25
31
  count: number;
26
32
  };
27
33
  type __VLS_Slots = {} & {
28
- overflow?: (props: typeof __VLS_1) => any;
34
+ overflow?: (props: typeof __VLS_8) => any;
29
35
  };
30
36
  declare const __VLS_base: import("vue").DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {
31
37
  unstyled: boolean;
@@ -1,15 +1,17 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import { avatarGroupTheme as t } from "../theme/avatar.js";
3
3
  import n from "./Avatar.js";
4
- import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h } from "vue";
4
+ import r from "./Tooltip.js";
5
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as p, normalizeClass as m, openBlock as h, renderList as g, renderSlot as _, toDisplayString as v, withCtx as y } from "vue";
5
6
  //#region src/components/AvatarGroup.vue?vue&type=script&setup=true&lang.ts
6
- var g = /*@__PURE__*/ l({
7
+ var b = ["tabindex"], x = ["tabindex"], S = /*@__PURE__*/ f({
7
8
  __name: "AvatarGroup",
8
9
  props: {
9
10
  items: {},
10
11
  max: {},
11
12
  size: {},
12
13
  shape: {},
14
+ tooltip: { type: Boolean },
13
15
  unstyled: {
14
16
  type: Boolean,
15
17
  default: void 0
@@ -22,29 +24,61 @@ var g = /*@__PURE__*/ l({
22
24
  ] },
23
25
  ui: {}
24
26
  },
25
- setup(l) {
26
- let g = l, _ = i(() => g.items ?? []), v = i(() => {
27
- let e = g.max;
28
- return [...e !== void 0 && _.value.length > e ? _.value.slice(0, e) : _.value].reverse();
29
- }), y = i(() => {
30
- let e = g.max;
31
- return e === void 0 || _.value.length <= e ? 0 : _.value.length - e;
32
- }), b = e(), x = i(() => g.unstyled ?? b.unstyled), S = i(() => t({ size: g.size })), C = i(() => x.value ? [g.ui?.root, g.class] : S.value.root({ class: [g.ui?.root, g.class] })), w = i(() => x.value ? g.ui?.item : S.value.item({ class: g.ui?.item })), T = i(() => x.value ? g.ui?.overflow : S.value.overflow({ class: g.ui?.overflow }));
33
- return (e, t) => (f(), s("div", { class: d(C.value) }, [y.value ? (f(), s("span", {
27
+ setup(f) {
28
+ let S = f, C = a(() => S.items ?? []), w = a(() => {
29
+ let e = S.max;
30
+ return [...e !== void 0 && C.value.length > e ? C.value.slice(0, e) : C.value].reverse();
31
+ }), T = a(() => {
32
+ let e = S.max;
33
+ return e === void 0 || C.value.length <= e ? 0 : C.value.length - e;
34
+ }), E = a(() => C.value.slice(C.value.length - T.value).map((e) => e.name).filter(Boolean).join(", ")), D = e(), O = a(() => S.unstyled ?? D.unstyled), k = a(() => t({
35
+ size: S.size,
36
+ tooltip: S.tooltip
37
+ })), A = a(() => O.value ? [S.ui?.root, S.class] : k.value.root({ class: [S.ui?.root, S.class] })), j = a(() => O.value ? S.ui?.trigger : k.value.trigger({ class: S.ui?.trigger })), M = a(() => O.value ? S.ui?.item : k.value.item({ class: S.ui?.item })), N = a(() => O.value ? S.ui?.overflow : k.value.overflow({ class: S.ui?.overflow }));
38
+ return (e, t) => (h(), c("div", { class: m(A.value) }, [T.value ? (h(), o(r, {
34
39
  key: 0,
35
- class: d(T.value)
36
- }, [m(e.$slots, "overflow", { count: y.value }, () => [c("+" + h(y.value), 1)])], 2)) : o("", !0), (f(!0), s(r, null, p(v.value, (e, t) => (f(), a(n, u({ key: t }, { ref_for: !0 }, e, {
37
- size: g.size,
38
- shape: g.shape,
39
- unstyled: x.value,
40
- class: w.value
41
- }), null, 16, [
42
- "size",
43
- "shape",
44
- "unstyled",
45
- "class"
40
+ text: E.value,
41
+ disabled: !S.tooltip || !E.value,
42
+ "side-offset": 10,
43
+ unstyled: O.value
44
+ }, {
45
+ trigger: y(() => [l("span", {
46
+ class: m(N.value),
47
+ tabindex: S.tooltip && E.value ? 0 : void 0
48
+ }, [_(e.$slots, "overflow", { count: T.value }, () => [u("+" + v(T.value), 1)])], 10, b)]),
49
+ _: 3
50
+ }, 8, [
51
+ "text",
52
+ "disabled",
53
+ "unstyled"
54
+ ])) : s("", !0), (h(!0), c(i, null, g(w.value, (e, t) => (h(), o(r, {
55
+ key: t,
56
+ text: e.name,
57
+ disabled: !S.tooltip || !e.name,
58
+ "side-offset": 10,
59
+ unstyled: O.value
60
+ }, {
61
+ trigger: y(() => [l("span", {
62
+ class: m(j.value),
63
+ tabindex: S.tooltip && e.name ? 0 : void 0
64
+ }, [d(n, p({ ref_for: !0 }, e, {
65
+ size: S.size,
66
+ shape: S.shape,
67
+ unstyled: O.value,
68
+ class: M.value
69
+ }), null, 16, [
70
+ "size",
71
+ "shape",
72
+ "unstyled",
73
+ "class"
74
+ ])], 10, x)]),
75
+ _: 2
76
+ }, 1032, [
77
+ "text",
78
+ "disabled",
79
+ "unstyled"
46
80
  ]))), 128))], 2));
47
81
  }
48
82
  });
49
83
  //#endregion
50
- export { g as default };
84
+ export { S as default };
@@ -15,6 +15,13 @@ export interface BreadcrumbProps {
15
15
  * apps.
16
16
  */
17
17
  label?: string;
18
+ /**
19
+ * Show at most this many crumbs: the first, then a "…" menu holding the
20
+ * middle, then the last `max - 1`. Below 2 it is treated as 2.
21
+ */
22
+ max?: number;
23
+ /** Accessible name for the "…" button — override for non-English apps. */
24
+ moreLabel?: string;
18
25
  /** Skip built-in classes; you take over styling entirely. */
19
26
  unstyled?: boolean;
20
27
  class?: ClassValue;
@@ -28,13 +35,14 @@ export interface BreadcrumbProps {
28
35
  separator?: string;
29
36
  };
30
37
  }
31
- declare var __VLS_26: {};
38
+ declare var __VLS_38: {};
32
39
  type __VLS_Slots = {} & {
33
- separator?: (props: typeof __VLS_26) => any;
40
+ separator?: (props: typeof __VLS_38) => any;
34
41
  };
35
42
  declare const __VLS_base: import("vue").DefineComponent<BreadcrumbProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BreadcrumbProps> & Readonly<{}>, {
36
43
  label: string;
37
44
  unstyled: boolean;
45
+ moreLabel: string;
38
46
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
47
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
40
48
  declare const _default: typeof __VLS_export;
@@ -1,15 +1,18 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import t from "./Icon.js";
3
3
  import { breadcrumbTheme as n } from "../theme/breadcrumb.js";
4
- import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
5
- import { ArrowRight01Icon as b } from "@hugeicons/core-free-icons";
6
- import { Primitive as x } from "reka-ui";
4
+ import r from "./DropdownMenu.js";
5
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
6
+ import { ArrowRight01Icon as x, MoreHorizontalIcon as S } from "@hugeicons/core-free-icons";
7
+ import { Primitive as C } from "reka-ui";
7
8
  //#region src/components/Breadcrumb.vue?vue&type=script&setup=true&lang.ts
8
- var S = /*@__PURE__*/ d({
9
+ var w = ["aria-label"], T = /*@__PURE__*/ f({
9
10
  __name: "Breadcrumb",
10
11
  props: {
11
12
  items: {},
12
13
  label: { default: "Breadcrumb" },
14
+ max: {},
15
+ moreLabel: { default: "Show hidden pages" },
13
16
  unstyled: {
14
17
  type: Boolean,
15
18
  default: void 0
@@ -22,52 +25,81 @@ var S = /*@__PURE__*/ d({
22
25
  ] },
23
26
  ui: {}
24
27
  },
25
- setup(d) {
26
- let S = d, C = e(), w = i(() => S.unstyled ?? C.unstyled), T = i(() => S.items ?? []), E = i(() => T.value.length - 1), D = i(() => n());
27
- function O(e) {
28
- let t = S.ui?.[e];
29
- return w.value ? t : D.value[e]({ class: t });
28
+ setup(f) {
29
+ let T = f, E = e(), D = a(() => T.unstyled ?? E.unstyled), O = a(() => T.items ?? []), k = a(() => O.value.length - 1), A = a(() => {
30
+ if (T.max === void 0) return 0;
31
+ let e = Math.max(T.max, 2);
32
+ return O.value.length > e ? O.value.length - e : 0;
33
+ }), j = a(() => {
34
+ let e = O.value.map((e, t) => ({
35
+ item: e,
36
+ index: t
37
+ }));
38
+ return A.value ? [
39
+ e[0],
40
+ null,
41
+ ...e.slice(1 + A.value)
42
+ ] : e;
43
+ }), M = a(() => O.value.slice(1, 1 + A.value).map((e) => ({
44
+ label: e.label,
45
+ icon: e.icon,
46
+ onSelect: e.onSelect ?? (e.href ? () => window.location.assign(e.href) : void 0)
47
+ }))), N = a(() => n());
48
+ function P(e) {
49
+ let t = T.ui?.[e];
50
+ return D.value ? t : N.value[e]({ class: t });
30
51
  }
31
- return (e, n) => (p(), a(v(x), {
52
+ return (e, n) => (m(), o(y(C), {
32
53
  as: "nav",
33
- "aria-label": S.label,
34
- class: f(w.value ? [S.ui?.root, S.class] : D.value.root({ class: [S.ui?.root, S.class] }))
54
+ "aria-label": T.label,
55
+ class: p(D.value ? [T.ui?.root, T.class] : N.value.root({ class: [T.ui?.root, T.class] }))
35
56
  }, {
36
- default: y(() => [c("ol", { class: f(O("list")) }, [(p(!0), s(r, null, m(T.value, (n, r) => (p(), s("li", {
37
- key: r,
38
- class: f(O("item"))
39
- }, [r === E.value ? (p(), s("span", {
40
- key: 0,
57
+ default: b(() => [l("ol", { class: p(P("list")) }, [(m(!0), c(i, null, h(j.value, (n) => (m(), c("li", {
58
+ key: n?.index ?? "more",
59
+ class: p(P("item"))
60
+ }, [n ? n.index === k.value ? (m(), c("span", {
61
+ key: 1,
41
62
  "aria-current": "page",
42
- class: f(O("current"))
43
- }, [n.icon ? (p(), a(t, {
63
+ class: p(P("current"))
64
+ }, [n.item.icon ? (m(), o(t, {
44
65
  key: 0,
45
- icon: n.icon
46
- }, null, 8, ["icon"])) : o("", !0), l(" " + _(n.label), 1)], 2)) : (p(), a(g(n.href ? "a" : "button"), {
47
- key: 1,
48
- href: n.href,
49
- type: n.href ? void 0 : "button",
50
- class: f(O("link")),
51
- onClick: (e) => n.onSelect?.()
66
+ icon: n.item.icon
67
+ }, null, 8, ["icon"])) : s("", !0), u(" " + v(n.item.label), 1)], 2)) : (m(), o(_(n.item.href ? "a" : "button"), {
68
+ key: 2,
69
+ href: n.item.href,
70
+ type: n.item.href ? void 0 : "button",
71
+ class: p(P("link")),
72
+ onClick: (e) => n.item.onSelect?.()
52
73
  }, {
53
- default: y(() => [n.icon ? (p(), a(t, {
74
+ default: b(() => [n.item.icon ? (m(), o(t, {
54
75
  key: 0,
55
- icon: n.icon
56
- }, null, 8, ["icon"])) : o("", !0), l(" " + _(n.label), 1)]),
76
+ icon: n.item.icon
77
+ }, null, 8, ["icon"])) : s("", !0), u(" " + v(n.item.label), 1)]),
57
78
  _: 2
58
79
  }, 1032, [
59
80
  "href",
60
81
  "type",
61
82
  "class",
62
83
  "onClick"
63
- ])), r === E.value ? o("", !0) : (p(), s("span", {
64
- key: 2,
84
+ ])) : (m(), o(r, {
85
+ key: 0,
86
+ items: M.value,
87
+ unstyled: D.value
88
+ }, {
89
+ trigger: b(() => [l("button", {
90
+ type: "button",
91
+ "aria-label": T.moreLabel,
92
+ class: p(P("link"))
93
+ }, [d(t, { icon: y(S) }, null, 8, ["icon"])], 10, w)]),
94
+ _: 1
95
+ }, 8, ["items", "unstyled"])), n?.index === k.value ? s("", !0) : (m(), c("span", {
96
+ key: 3,
65
97
  "aria-hidden": "true",
66
- class: f(O("separator"))
67
- }, [h(e.$slots, "separator", {}, () => [u(t, { icon: v(b) }, null, 8, ["icon"])])], 2))], 2))), 128))], 2)]),
98
+ class: p(P("separator"))
99
+ }, [g(e.$slots, "separator", {}, () => [d(t, { icon: y(x) }, null, 8, ["icon"])])], 2))], 2))), 128))], 2)]),
68
100
  _: 3
69
101
  }, 8, ["aria-label", "class"]));
70
102
  }
71
103
  });
72
104
  //#endregion
73
- export { S as default };
105
+ export { T as default };
@@ -48,10 +48,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
48
48
  }>, {
49
49
  unstyled: boolean;
50
50
  side: "top" | "right" | "bottom" | "left";
51
+ arrow: boolean;
51
52
  sideOffset: number;
52
53
  confirmLabel: string;
53
54
  cancelLabel: string;
54
- arrow: boolean;
55
55
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
56
56
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
57
57
  declare const _default: typeof __VLS_export;
@@ -4,6 +4,13 @@ export interface FileRejection {
4
4
  file: File;
5
5
  reason: 'type' | 'size' | 'count';
6
6
  }
7
+ export interface FileUploadStatus {
8
+ state: 'uploading' | 'done' | 'error';
9
+ /** 0–100. Leave it out while uploading for an indeterminate bar. */
10
+ progress?: number;
11
+ /** Shown on the row when `state` is `'error'`. Falls back to `failedText`. */
12
+ error?: string;
13
+ }
7
14
  export interface FileUploadProps {
8
15
  /** Accept more than one file. The model is an array either way. */
9
16
  multiple?: boolean;
@@ -23,8 +30,18 @@ export interface FileUploadProps {
23
30
  hint?: string;
24
31
  /** Text on the browse button. */
25
32
  browseLabel?: string;
33
+ /**
34
+ * Upload state for a held file — a bar while uploading, "Uploaded" when done,
35
+ * the error and a retry button when it failed. Read reactively, so point it
36
+ * at your own reactive store.
37
+ */
38
+ statusFor?: (file: File) => FileUploadStatus | undefined;
26
39
  /** Labels and messages — override for non-English apps. */
27
40
  removeLabel?: string;
41
+ retryLabel?: string;
42
+ /** Added to the size once a file's status is `'done'`. */
43
+ doneText?: string;
44
+ failedText?: string;
28
45
  tooLargeText?: string;
29
46
  wrongTypeText?: string;
30
47
  tooManyText?: string;
@@ -33,7 +50,7 @@ export interface FileUploadProps {
33
50
  /** Applied to the outer wrapper, which stacks the zone above the list. */
34
51
  class?: ClassValue;
35
52
  /** Override classes per element, e.g. `{ dropzone: 'py-10' }`. */
36
- ui?: Partial<Record<'root' | 'dropzone' | 'input' | 'icon' | 'label' | 'browse' | 'hint' | 'list' | 'item' | 'thumbnail' | 'placeholder' | 'details' | 'name' | 'meta' | 'remove' | 'error', string>>;
53
+ ui?: Partial<Record<'root' | 'dropzone' | 'input' | 'icon' | 'label' | 'browse' | 'hint' | 'list' | 'item' | 'thumbnail' | 'placeholder' | 'details' | 'name' | 'meta' | 'remove' | 'error' | 'progress' | 'actions' | 'retry', string>>;
37
54
  }
38
55
  type __VLS_Props = FileUploadProps;
39
56
  type __VLS_ModelProps = {
@@ -47,9 +64,11 @@ type __VLS_ModelProps = {
47
64
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
48
65
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
49
66
  "update:modelValue": (value: File[]) => any;
67
+ retry: (file: File) => any;
50
68
  reject: (rejections: FileRejection[]) => any;
51
69
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
52
70
  "onUpdate:modelValue"?: ((value: File[]) => any) | undefined;
71
+ onRetry?: ((file: File) => any) | undefined;
53
72
  onReject?: ((rejections: FileRejection[]) => any) | undefined;
54
73
  }>, {
55
74
  label: string;
@@ -57,6 +76,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
57
76
  invalid: boolean;
58
77
  removeLabel: string;
59
78
  browseLabel: string;
79
+ retryLabel: string;
80
+ doneText: string;
81
+ failedText: string;
60
82
  tooLargeText: string;
61
83
  wrongTypeText: string;
62
84
  tooManyText: string;