@robuust-digital/vue-components 2.0.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 (66) hide show
  1. package/CHANGELOG.md +25 -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/button.css +1 -9
  40. package/dist/core/checkbox.css +6 -9
  41. package/dist/core/index.js +17 -799
  42. package/dist/core/input.css +8 -7
  43. package/dist/core/radio.css +6 -9
  44. package/dist/core/utilities.css +12 -0
  45. package/dist/core.d.ts +27 -0
  46. package/dist/dialogs/index.js +4 -206
  47. package/dist/dialogs.d.ts +5 -0
  48. package/dist/dropdown/index.js +3 -131
  49. package/dist/dropdown.d.ts +4 -0
  50. package/dist/index/index.js +35 -0
  51. package/dist/index.d.ts +8 -0
  52. package/dist/lightswitch/index.js +3 -47
  53. package/dist/lightswitch.d.ts +4 -0
  54. package/dist/rich-text-editor/index.js +3 -263
  55. package/dist/rich-text-editor.d.ts +4 -0
  56. package/dist/toast/index.js +3 -99
  57. package/dist/toast.d.ts +4 -0
  58. package/dist/tooltip/index.js +1 -1
  59. package/dist/tooltip.d.ts +4 -0
  60. package/dist/types/shared.d.ts +3 -0
  61. package/package.json +55 -24
  62. package/dist/_shared/ButtonBase-DfkwHIhN.js +0 -87
  63. package/dist/_shared/ChevronDownIcon-z-5U4fIb.js +0 -55
  64. package/dist/_shared/FormInput-C5LjZViC.js +0 -85
  65. package/dist/_shared/Modal-dqDGKVw5.js +0 -201
  66. package/dist/_shared/Tooltip-B93ZF7IF.js +0 -126
@@ -1,85 +0,0 @@
1
- import { computed as v, getCurrentInstance as $, useSlots as I, ref as b, createElementBlock as i, openBlock as o, normalizeClass as V, createCommentVNode as l, renderSlot as s, unref as a, createBlock as m, resolveDynamicComponent as f, normalizeProps as B, guardReactiveProps as C, withDirectives as x, mergeProps as y, vModelDynamic as O } from "vue";
2
- const S = () => ({ hasModelBinding: v(() => {
3
- var r;
4
- const n = $();
5
- return ((r = n == null ? void 0 : n.vnode) == null ? void 0 : r.props) && Object.prototype.hasOwnProperty.call(n.vnode.props, "onUpdate:modelValue");
6
- }) }), j = {
7
- key: 0,
8
- class: "rvc-input-prefix"
9
- }, z = ["type"], F = ["type"], P = /* @__PURE__ */ Object.assign({
10
- inheritAttrs: !1
11
- }, {
12
- __name: "FormInput",
13
- props: {
14
- modelValue: {
15
- type: [String, Number],
16
- default: void 0
17
- },
18
- rootClass: {
19
- type: String,
20
- default: ""
21
- },
22
- prefixIcon: {
23
- type: [Object, Function],
24
- default: null
25
- },
26
- icon: {
27
- type: [Object, Function],
28
- default: null
29
- },
30
- size: {
31
- type: String,
32
- default: "base",
33
- validator: (e) => ["sm", "base"].includes(e)
34
- }
35
- },
36
- emits: ["update:modelValue"],
37
- setup(e, { emit: n }) {
38
- const r = e, g = n, { hasModelBinding: h } = S(), u = I(), c = b(null), d = v({
39
- get: () => r.modelValue,
40
- set: (t) => g("update:modelValue", t)
41
- });
42
- return (t, p) => (o(), i("div", {
43
- class: V([
44
- "rvc-input",
45
- `rvc-input-${e.size}`,
46
- e.rootClass
47
- ])
48
- }, [
49
- a(u).prefix || a(u).prefixIcon || e.prefixIcon ? (o(), i("span", j, [
50
- s(t.$slots, "prefix", {}, () => [
51
- s(t.$slots, "prefixIcon", { icon: e.prefixIcon }, () => [
52
- e.prefixIcon ? (o(), m(f(e.prefixIcon), {
53
- key: 0,
54
- "aria-hidden": "true"
55
- })) : l("", !0)
56
- ])
57
- ])
58
- ])) : l("", !0),
59
- s(t.$slots, "input", B(C(t.$attrs)), () => [
60
- a(h) ? x((o(), i("input", y({ key: 0 }, t.$attrs, {
61
- ref_key: "input",
62
- ref: c,
63
- "onUpdate:modelValue": p[0] || (p[0] = (k) => d.value = k),
64
- type: t.$attrs.type || "text"
65
- }), null, 16, z)), [
66
- [O, d.value]
67
- ]) : (o(), i("input", y({ key: 1 }, t.$attrs, {
68
- ref_key: "input",
69
- ref: c,
70
- type: t.$attrs.type || "text"
71
- }), null, 16, F))
72
- ]),
73
- s(t.$slots, "icon", { icon: e.icon }, () => [
74
- e.icon ? (o(), m(f(e.icon), {
75
- key: 0,
76
- "aria-hidden": "true"
77
- })) : l("", !0)
78
- ])
79
- ], 2));
80
- }
81
- });
82
- export {
83
- P as _,
84
- S as u
85
- };
@@ -1,201 +0,0 @@
1
- import { ref as g, computed as f, createBlock as B, openBlock as E, unref as t, withCtx as d, createVNode as r, withModifiers as D, createElementVNode as a, normalizeClass as L, renderSlot as c, createCommentVNode as T, createTextVNode as F, toDisplayString as I } from "vue";
2
- import { TransitionRoot as N, Dialog as R, TransitionChild as $, DialogPanel as V, DialogTitle as C } from "@headlessui/vue";
3
- import { _ as k } from "./ButtonBase-DfkwHIhN.js";
4
- import { r as S } from "./XMarkIcon-90mcPzBs.js";
5
- function q(o) {
6
- const v = g(null), n = g(!1), b = f(() => o.as === "form"), p = f(() => `${o.id}-title`), m = f(() => `${o.id}-content`), u = f(() => {
7
- var s;
8
- return (s = v.value) == null ? void 0 : s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
9
- });
10
- return {
11
- contentRef: v,
12
- ready: n,
13
- isForm: b,
14
- titleId: p,
15
- descriptionId: m,
16
- initialFocusElement: u
17
- };
18
- }
19
- const h = {
20
- role: "presentation",
21
- class: "rvc-modal-presentation"
22
- }, A = { class: "rvc-modal-container" }, M = { class: "rvc-modal-header" }, x = { class: "rvc-modal-header-inner" }, z = { class: "rvc-modal-close-wrapper" }, P = ["id"], j = { class: "rvc-modal-footer" }, O = {
23
- __name: "Modal",
24
- props: {
25
- as: {
26
- type: String,
27
- default: "div"
28
- },
29
- id: {
30
- type: String,
31
- required: !0
32
- },
33
- title: {
34
- type: String,
35
- required: !0
36
- },
37
- showClose: {
38
- type: Boolean
39
- },
40
- spinning: {
41
- type: Boolean
42
- },
43
- submitLabel: {
44
- type: String,
45
- default: "Confirm"
46
- },
47
- cancelLabel: {
48
- type: String,
49
- default: "Cancel"
50
- },
51
- panelClass: {
52
- type: String,
53
- default: "rvc-modal-panel-max-width"
54
- }
55
- },
56
- emits: ["modal:open", "modal:opened", "modal:close", "modal:save", "modal:closed"],
57
- setup(o, { emit: v }) {
58
- const n = v, b = o, {
59
- contentRef: p,
60
- ready: m,
61
- isForm: u,
62
- titleId: s,
63
- descriptionId: y,
64
- initialFocusElement: w
65
- } = q(b);
66
- return (i, e) => (E(), B(t(N), { as: "template" }, {
67
- default: d(() => [
68
- r(t(R), {
69
- as: o.as,
70
- class: "rvc-modal",
71
- static: "",
72
- "aria-modal": "true",
73
- role: "dialog",
74
- "initial-focus": t(w),
75
- "aria-labelledby": t(s),
76
- onClose: e[7] || (e[7] = (l) => i.$emit("modal:close")),
77
- onSubmit: e[8] || (e[8] = D((l) => n("modal:save", l), ["prevent"]))
78
- }, {
79
- default: d(() => [
80
- r(t($), {
81
- as: "template",
82
- enter: "rvc-modal-backdrop-transition-enter",
83
- "enter-from": "rvc-modal-backdrop-transition-enter-from",
84
- "enter-to": "rvc-modal-backdrop-transition-enter-to",
85
- leave: "rvc-modal-backdrop-transition-leave",
86
- "leave-from": "rvc-modal-backdrop-transition-leave-from",
87
- "leave-to": "rvc-modal-backdrop-transition-leave-to",
88
- onBeforeEnter: e[0] || (e[0] = (l) => n("modal:open")),
89
- onAfterEnter: e[1] || (e[1] = (l) => n("modal:opened"))
90
- }, {
91
- default: d(() => e[9] || (e[9] = [
92
- a("div", {
93
- "aria-hidden": "true",
94
- class: "rvc-modal-backdrop"
95
- }, null, -1)
96
- ])),
97
- _: 1,
98
- __: [9]
99
- }),
100
- a("div", h, [
101
- a("div", A, [
102
- r(t($), {
103
- as: "template",
104
- enter: "rvc-modal-transition-enter",
105
- "enter-from": "rvc-modal-transition-enter-from",
106
- "enter-to": "rvc-modal-transition-enter-to",
107
- leave: "rvc-modal-transition-leave",
108
- "leave-from": "rvc-modal-transition-leave-from",
109
- "leave-to": "rvc-modal-transition-leave-to",
110
- onBeforeEnter: e[5] || (e[5] = (l) => m.value = !0),
111
- onAfterLeave: e[6] || (e[6] = (l) => (m.value = !1, n("modal:closed")))
112
- }, {
113
- default: d(() => [
114
- r(t(V), {
115
- class: L(["rvc-modal-panel", o.panelClass]),
116
- "aria-busy": o.spinning,
117
- "aria-describedby": t(y)
118
- }, {
119
- default: d(() => [
120
- a("header", M, [
121
- c(i.$slots, "header", { title: o.title }, () => [
122
- a("div", x, [
123
- c(i.$slots, "title", {
124
- id: t(s),
125
- dialogTitle: t(C),
126
- title: o.title
127
- }, () => [
128
- r(t(C), {
129
- id: t(s),
130
- class: "rvc-modal-title"
131
- }, {
132
- default: d(() => [
133
- F(I(o.title), 1)
134
- ]),
135
- _: 1
136
- }, 8, ["id"])
137
- ]),
138
- o.showClose ? c(i.$slots, "close", {
139
- key: 0,
140
- icon: t(S),
141
- emitClose: () => n("drawer:close")
142
- }, () => [
143
- a("div", z, [
144
- a("button", {
145
- type: "button",
146
- class: "rvc-modal-close",
147
- "aria-label": "Close panel",
148
- onClick: e[2] || (e[2] = (l) => n("modal:close"))
149
- }, [
150
- r(t(S), { "aria-hidden": "true" })
151
- ])
152
- ])
153
- ]) : T("", !0)
154
- ])
155
- ])
156
- ]),
157
- a("div", {
158
- id: t(y),
159
- ref_key: "contentRef",
160
- ref: p,
161
- class: "rvc-modal-content"
162
- }, [
163
- c(i.$slots, "default", { ready: t(m) })
164
- ], 8, P),
165
- a("footer", j, [
166
- c(i.$slots, "footer", { loading: o.spinning }, () => [
167
- r(k, {
168
- type: t(u) ? "submit" : "button",
169
- label: o.submitLabel,
170
- spinning: o.spinning,
171
- disabled: o.spinning,
172
- onClick: e[3] || (e[3] = (l) => !t(u) && i.$emit("modal:save"))
173
- }, null, 8, ["type", "label", "spinning", "disabled"]),
174
- r(k, {
175
- type: "button",
176
- color: "light",
177
- label: o.cancelLabel,
178
- onClick: e[4] || (e[4] = (l) => i.$emit("modal:close"))
179
- }, null, 8, ["label"])
180
- ])
181
- ])
182
- ]),
183
- _: 3
184
- }, 8, ["class", "aria-busy", "aria-describedby"])
185
- ]),
186
- _: 3
187
- })
188
- ])
189
- ])
190
- ]),
191
- _: 3
192
- }, 8, ["as", "initial-focus", "aria-labelledby"])
193
- ]),
194
- _: 3
195
- }));
196
- }
197
- };
198
- export {
199
- O as _,
200
- q as u
201
- };
@@ -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
- };