@robuust-digital/vue-components 2.1.0 → 2.2.0-rc.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 (61) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/_shared/ButtonBase.vue_vue_type_script_setup_true_lang-B0YsKehI.js +60 -0
  3. package/dist/_shared/ChevronDownIcon-DaaXfD3C.js +41 -0
  4. package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-D1vKMJok.js +266 -0
  5. package/dist/_shared/Drawer.vue_vue_type_script_setup_true_lang-DT6tBBZ7.js +186 -0
  6. package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-D5vTFLkq.js +115 -0
  7. package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-BhJpG-Fw.js +75 -0
  8. package/dist/_shared/Lightswitch.vue_vue_type_script_setup_true_lang-CvN-2WJt.js +44 -0
  9. package/dist/_shared/Modal.vue_vue_type_script_setup_true_lang-DBEOIZnO.js +187 -0
  10. package/dist/_shared/RichTextEditor.vue_vue_type_script_setup_true_lang-Bs4WdJhA.js +274 -0
  11. package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-CsGx6wBK.js +676 -0
  12. package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-FEeRXoIx.js +75 -0
  13. package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-CoydN9sS.js +96 -0
  14. package/dist/combobox/index.js +3 -347
  15. package/dist/combobox.d.ts +4 -0
  16. package/dist/components/Accordion.vue.d.ts +37 -0
  17. package/dist/components/Alert.vue.d.ts +39 -0
  18. package/dist/components/Badge.vue.d.ts +32 -0
  19. package/dist/components/ButtonBase.vue.d.ts +50 -0
  20. package/dist/components/Checkbox.vue.d.ts +39 -0
  21. package/dist/components/Combobox.vue.d.ts +112 -0
  22. package/dist/components/DataTable.vue.d.ts +122 -0
  23. package/dist/components/Drawer.vue.d.ts +103 -0
  24. package/dist/components/Dropdown.vue.d.ts +120 -0
  25. package/dist/components/EmptyState.vue.d.ts +23 -0
  26. package/dist/components/FormInput.vue.d.ts +49 -0
  27. package/dist/components/FormSelect.vue.d.ts +58 -0
  28. package/dist/components/FormTextarea.vue.d.ts +16 -0
  29. package/dist/components/Lightswitch.vue.d.ts +26 -0
  30. package/dist/components/Modal.vue.d.ts +98 -0
  31. package/dist/components/Pagination.vue.d.ts +60 -0
  32. package/dist/components/Radio.vue.d.ts +34 -0
  33. package/dist/components/RichTextEditor.vue.d.ts +71 -0
  34. package/dist/components/Tabs.vue.d.ts +26 -0
  35. package/dist/components/Toast.vue.d.ts +46 -0
  36. package/dist/components/Tooltip.vue.d.ts +45 -0
  37. package/dist/composables/useDialogContext.d.ts +18 -0
  38. package/dist/composables/useForm.d.ts +6 -0
  39. package/dist/core/index.js +17 -826
  40. package/dist/core.d.ts +27 -0
  41. package/dist/dialogs/index.js +4 -216
  42. package/dist/dialogs.d.ts +5 -0
  43. package/dist/dropdown/index.js +3 -131
  44. package/dist/dropdown.d.ts +4 -0
  45. package/dist/index/index.js +35 -0
  46. package/dist/index.d.ts +8 -0
  47. package/dist/lightswitch/index.js +3 -47
  48. package/dist/lightswitch.d.ts +4 -0
  49. package/dist/rich-text-editor/index.js +3 -261
  50. package/dist/rich-text-editor.d.ts +4 -0
  51. package/dist/toast/index.js +3 -99
  52. package/dist/toast.d.ts +4 -0
  53. package/dist/tooltip/index.js +1 -1
  54. package/dist/tooltip.d.ts +4 -0
  55. package/dist/types/shared.d.ts +3 -0
  56. package/package.json +49 -15
  57. package/dist/_shared/ButtonBase-DfkwHIhN.js +0 -87
  58. package/dist/_shared/ChevronDownIcon-z-5U4fIb.js +0 -55
  59. package/dist/_shared/FormInput-B-SQTZTA.js +0 -92
  60. package/dist/_shared/Modal-Bw2sID1x.js +0 -213
  61. package/dist/_shared/Tooltip-B93ZF7IF.js +0 -126
@@ -1,92 +0,0 @@
1
- import { computed as v, getCurrentInstance as $, useSlots as I, ref as b, createElementBlock as s, openBlock as n, normalizeClass as x, createCommentVNode as u, renderSlot as i, unref as r, createBlock as f, resolveDynamicComponent as m, normalizeProps as V, guardReactiveProps as B, withDirectives as C, mergeProps as y, vModelDynamic as O } from "vue";
2
- const S = () => ({ hasModelBinding: v(() => {
3
- var l;
4
- const o = $();
5
- return ((l = o == null ? void 0 : o.vnode) == null ? void 0 : l.props) && Object.prototype.hasOwnProperty.call(o.vnode.props, "onUpdate:modelValue");
6
- }) }), j = {
7
- key: 0,
8
- class: "rvc-input-prefix"
9
- }, z = ["type"], F = ["type"], M = {
10
- key: 1,
11
- class: "rvc-input-suffix"
12
- }, D = /* @__PURE__ */ Object.assign({
13
- inheritAttrs: !1
14
- }, {
15
- __name: "FormInput",
16
- props: {
17
- modelValue: {
18
- type: [String, Number],
19
- default: void 0
20
- },
21
- rootClass: {
22
- type: String,
23
- default: ""
24
- },
25
- prefixIcon: {
26
- type: [Object, Function],
27
- default: null
28
- },
29
- icon: {
30
- type: [Object, Function],
31
- default: null
32
- },
33
- size: {
34
- type: String,
35
- default: "base",
36
- validator: (e) => ["sm", "base"].includes(e)
37
- }
38
- },
39
- emits: ["update:modelValue"],
40
- setup(e, { emit: o }) {
41
- const l = e, g = o, { hasModelBinding: h } = S(), a = I(), c = b(null), d = v({
42
- get: () => l.modelValue,
43
- set: (t) => g("update:modelValue", t)
44
- });
45
- return (t, p) => (n(), s("div", {
46
- class: x([
47
- "rvc-input",
48
- `rvc-input-${e.size}`,
49
- e.rootClass
50
- ])
51
- }, [
52
- r(a).prefix || r(a).prefixIcon || e.prefixIcon ? (n(), s("span", j, [
53
- i(t.$slots, "prefix", {}, () => [
54
- i(t.$slots, "prefixIcon", { icon: e.prefixIcon }, () => [
55
- e.prefixIcon ? (n(), f(m(e.prefixIcon), {
56
- key: 0,
57
- "aria-hidden": "true"
58
- })) : u("", !0)
59
- ])
60
- ])
61
- ])) : u("", !0),
62
- i(t.$slots, "input", V(B(t.$attrs)), () => [
63
- r(h) ? C((n(), s("input", y({ key: 0 }, t.$attrs, {
64
- ref_key: "input",
65
- ref: c,
66
- "onUpdate:modelValue": p[0] || (p[0] = (k) => d.value = k),
67
- type: t.$attrs.type || "text"
68
- }), null, 16, z)), [
69
- [O, d.value]
70
- ]) : (n(), s("input", y({ key: 1 }, t.$attrs, {
71
- ref_key: "input",
72
- ref: c,
73
- type: t.$attrs.type || "text"
74
- }), null, 16, F))
75
- ]),
76
- r(a).suffix || r(a).icon || e.icon ? (n(), s("span", M, [
77
- i(t.$slots, "suffix", {}, () => [
78
- i(t.$slots, "icon", { icon: e.icon }, () => [
79
- e.icon ? (n(), f(m(e.icon), {
80
- key: 0,
81
- "aria-hidden": "true"
82
- })) : u("", !0)
83
- ])
84
- ])
85
- ])) : u("", !0)
86
- ], 2));
87
- }
88
- });
89
- export {
90
- D as _,
91
- S as u
92
- };
@@ -1,213 +0,0 @@
1
- import { ref as $, computed as f, createBlock as F, openBlock as p, unref as o, withCtx as m, createVNode as i, withModifiers as D, createElementVNode as r, normalizeClass as L, createElementBlock as k, renderSlot as s, createCommentVNode as T, createTextVNode as I, toDisplayString as N } from "vue";
2
- import { TransitionRoot as R, Dialog as V, TransitionChild as C, DialogPanel as h, DialogTitle as S } from "@headlessui/vue";
3
- import { _ as B } from "./ButtonBase-DfkwHIhN.js";
4
- import { r as w } from "./XMarkIcon-90mcPzBs.js";
5
- function q(t) {
6
- const v = $(null), n = $(!1), b = f(() => t.as === "form"), y = f(() => `${t.id}-title`), c = f(() => `${t.id}-content`), u = f(() => {
7
- var d;
8
- return (d = v.value) == null ? void 0 : d.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
9
- });
10
- return {
11
- contentRef: v,
12
- ready: n,
13
- isForm: b,
14
- titleId: y,
15
- descriptionId: c,
16
- initialFocusElement: u
17
- };
18
- }
19
- const A = {
20
- role: "presentation",
21
- class: "rvc-modal-presentation"
22
- }, H = { class: "rvc-modal-container" }, M = {
23
- key: 0,
24
- class: "rvc-modal-header"
25
- }, z = { class: "rvc-modal-header-inner" }, P = { class: "rvc-modal-close-wrapper" }, j = ["id"], G = {
26
- key: 2,
27
- class: "rvc-modal-footer"
28
- }, U = {
29
- __name: "Modal",
30
- props: {
31
- as: {
32
- type: String,
33
- default: "div"
34
- },
35
- id: {
36
- type: String,
37
- required: !0
38
- },
39
- title: {
40
- type: String,
41
- required: !0
42
- },
43
- showClose: {
44
- type: Boolean
45
- },
46
- spinning: {
47
- type: Boolean
48
- },
49
- submitLabel: {
50
- type: String,
51
- default: "Confirm"
52
- },
53
- cancelLabel: {
54
- type: String,
55
- default: "Cancel"
56
- },
57
- panelClass: {
58
- type: String,
59
- default: "rvc-modal-panel-max-width"
60
- },
61
- resetHeader: {
62
- type: Boolean
63
- },
64
- resetFooter: {
65
- type: Boolean
66
- }
67
- },
68
- emits: ["modal:open", "modal:opened", "modal:close", "modal:save", "modal:closed"],
69
- setup(t, { emit: v }) {
70
- const n = v, b = t, {
71
- contentRef: y,
72
- ready: c,
73
- isForm: u,
74
- titleId: d,
75
- descriptionId: g,
76
- initialFocusElement: E
77
- } = q(b);
78
- return (l, e) => (p(), F(o(R), { as: "template" }, {
79
- default: m(() => [
80
- i(o(V), {
81
- as: t.as,
82
- class: "rvc-modal",
83
- static: "",
84
- "aria-modal": "true",
85
- role: "dialog",
86
- "initial-focus": o(E),
87
- "aria-labelledby": o(d),
88
- onClose: e[7] || (e[7] = (a) => l.$emit("modal:close")),
89
- onSubmit: e[8] || (e[8] = D((a) => n("modal:save", a), ["prevent"]))
90
- }, {
91
- default: m(() => [
92
- i(o(C), {
93
- as: "template",
94
- enter: "rvc-modal-backdrop-transition-enter",
95
- "enter-from": "rvc-modal-backdrop-transition-enter-from",
96
- "enter-to": "rvc-modal-backdrop-transition-enter-to",
97
- leave: "rvc-modal-backdrop-transition-leave",
98
- "leave-from": "rvc-modal-backdrop-transition-leave-from",
99
- "leave-to": "rvc-modal-backdrop-transition-leave-to",
100
- onBeforeEnter: e[0] || (e[0] = (a) => n("modal:open")),
101
- onAfterEnter: e[1] || (e[1] = (a) => n("modal:opened"))
102
- }, {
103
- default: m(() => e[9] || (e[9] = [
104
- r("div", {
105
- "aria-hidden": "true",
106
- class: "rvc-modal-backdrop"
107
- }, null, -1)
108
- ])),
109
- _: 1,
110
- __: [9]
111
- }),
112
- r("div", A, [
113
- r("div", H, [
114
- i(o(C), {
115
- as: "template",
116
- enter: "rvc-modal-transition-enter",
117
- "enter-from": "rvc-modal-transition-enter-from",
118
- "enter-to": "rvc-modal-transition-enter-to",
119
- leave: "rvc-modal-transition-leave",
120
- "leave-from": "rvc-modal-transition-leave-from",
121
- "leave-to": "rvc-modal-transition-leave-to",
122
- onBeforeEnter: e[5] || (e[5] = (a) => c.value = !0),
123
- onAfterLeave: e[6] || (e[6] = (a) => (c.value = !1, n("modal:closed")))
124
- }, {
125
- default: m(() => [
126
- i(o(h), {
127
- class: L(["rvc-modal-panel", t.panelClass]),
128
- "aria-busy": t.spinning,
129
- "aria-describedby": o(g)
130
- }, {
131
- default: m(() => [
132
- t.resetHeader ? s(l.$slots, "header", { key: 1 }) : (p(), k("header", M, [
133
- s(l.$slots, "header", { title: t.title }, () => [
134
- r("div", z, [
135
- s(l.$slots, "title", {
136
- id: o(d),
137
- dialogTitle: o(S),
138
- title: t.title
139
- }, () => [
140
- i(o(S), {
141
- id: o(d),
142
- class: "rvc-modal-title"
143
- }, {
144
- default: m(() => [
145
- I(N(t.title), 1)
146
- ]),
147
- _: 1
148
- }, 8, ["id"])
149
- ]),
150
- t.showClose ? s(l.$slots, "close", {
151
- key: 0,
152
- icon: o(w),
153
- emitClose: () => n("drawer:close")
154
- }, () => [
155
- r("div", P, [
156
- r("button", {
157
- type: "button",
158
- class: "rvc-modal-close",
159
- "aria-label": "Close panel",
160
- onClick: e[2] || (e[2] = (a) => n("modal:close"))
161
- }, [
162
- i(o(w), { "aria-hidden": "true" })
163
- ])
164
- ])
165
- ]) : T("", !0)
166
- ])
167
- ])
168
- ])),
169
- r("div", {
170
- id: o(g),
171
- ref_key: "contentRef",
172
- ref: y,
173
- class: "rvc-modal-content"
174
- }, [
175
- s(l.$slots, "default", { ready: o(c) })
176
- ], 8, j),
177
- t.resetFooter ? s(l.$slots, "footer", { key: 3 }) : (p(), k("footer", G, [
178
- s(l.$slots, "footer", { loading: t.spinning }, () => [
179
- i(B, {
180
- type: o(u) ? "submit" : "button",
181
- label: t.submitLabel,
182
- spinning: t.spinning,
183
- disabled: t.spinning,
184
- onClick: e[3] || (e[3] = (a) => !o(u) && l.$emit("modal:save"))
185
- }, null, 8, ["type", "label", "spinning", "disabled"]),
186
- i(B, {
187
- type: "button",
188
- color: "light",
189
- label: t.cancelLabel,
190
- onClick: e[4] || (e[4] = (a) => l.$emit("modal:close"))
191
- }, null, 8, ["label"])
192
- ])
193
- ]))
194
- ]),
195
- _: 3
196
- }, 8, ["class", "aria-busy", "aria-describedby"])
197
- ]),
198
- _: 3
199
- })
200
- ])
201
- ])
202
- ]),
203
- _: 3
204
- }, 8, ["as", "initial-focus", "aria-labelledby"])
205
- ]),
206
- _: 3
207
- }));
208
- }
209
- };
210
- export {
211
- U as _,
212
- q as u
213
- };
@@ -1,126 +0,0 @@
1
- import { shallowRef as a, createElementBlock as p, openBlock as f, renderSlot as u, createElementVNode as g, normalizeStyle as x, normalizeClass as S, unref as h, createCommentVNode as $, mergeProps as R } from "vue";
2
- import { useFloating as k, autoUpdate as z, autoPlacement as P, offset as W, shift as C, arrow as M, size as A } from "@floating-ui/vue";
3
- const B = ["innerHTML"], N = {
4
- __name: "Tooltip",
5
- props: {
6
- content: {
7
- type: String,
8
- required: !0
9
- },
10
- blur: {
11
- type: Boolean,
12
- default: !0
13
- },
14
- maxWidth: {
15
- type: Number,
16
- default: null
17
- },
18
- tooltipClass: {
19
- type: String,
20
- default: ""
21
- },
22
- placement: {
23
- type: String,
24
- default: void 0,
25
- validator: (t) => t === void 0 || [
26
- "top",
27
- "right",
28
- "bottom",
29
- "left",
30
- "top-start",
31
- "top-end",
32
- "right-start",
33
- "right-end",
34
- "bottom-start",
35
- "bottom-end",
36
- "left-start",
37
- "left-end"
38
- ].includes(t)
39
- },
40
- size: {
41
- type: String,
42
- default: "base",
43
- validator: (t) => ["sm", "base"].includes(t)
44
- }
45
- },
46
- setup(t) {
47
- const o = t, i = a(), s = a(), l = a(), {
48
- floatingStyles: y,
49
- middlewareData: w,
50
- placement: c
51
- } = k(i, s, {
52
- middleware: [
53
- o.placement ? null : P(),
54
- W(o.size === "sm" ? 7 : 10),
55
- C({ crossAxis: !0, padding: 5 }),
56
- M({ element: l }),
57
- A({
58
- apply({ availableWidth: e, availableHeight: r, elements: n }) {
59
- Object.assign(n.floating.style, {
60
- maxWidth: o.maxWidth ? `${Math.min(e, o.maxWidth) / 16}rem` : "",
61
- maxHeight: `${r / 16}rem `
62
- });
63
- }
64
- })
65
- ],
66
- whileElementsMounted: z,
67
- placement: o.placement
68
- }), b = (e) => ({
69
- top: 0,
70
- bottom: 180,
71
- left: -90,
72
- right: 90
73
- })[e.split("-")[0]] || 0, v = (e) => {
74
- var m, d;
75
- const r = c.value.split("-")[0], n = {
76
- left: "right",
77
- right: "left",
78
- bottom: "top",
79
- top: "bottom"
80
- }[r];
81
- return {
82
- style: {
83
- left: (m = e.arrow) != null && m.x ? `${e.arrow.x}px` : "",
84
- top: (d = e.arrow) != null && d.y ? `${e.arrow.y}px` : "",
85
- bottom: "",
86
- right: "",
87
- [n]: l.value ? `${l.value.offsetWidth * -1}px` : "",
88
- transform: `rotate(${b(c.value)}deg)`
89
- }
90
- };
91
- };
92
- return (e, r) => (f(), p("div", {
93
- ref_key: "wrapperRef",
94
- ref: i,
95
- class: "rvc-tooltip-wrapper"
96
- }, [
97
- u(e.$slots, "default"),
98
- g("div", {
99
- ref_key: "tooltipRef",
100
- ref: s,
101
- class: S([
102
- "rvc-tooltip",
103
- t.tooltipClass,
104
- `rvc-tooltip-${t.size}`,
105
- { "rvc-tooltip-blur": t.blur }
106
- ]),
107
- style: x(h(y))
108
- }, [
109
- u(e.$slots, "content", { content: t.content }, () => [
110
- t.content ? (f(), p("div", {
111
- key: 0,
112
- innerHTML: t.content
113
- }, null, 8, B)) : $("", !0)
114
- ]),
115
- g("div", R({
116
- ref_key: "arrowRef",
117
- ref: l,
118
- class: "rvc-tooltip-arrow"
119
- }, v(h(w))), null, 16)
120
- ], 6)
121
- ], 512));
122
- }
123
- };
124
- export {
125
- N as _
126
- };