@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,263 +1,5 @@
1
- import { createElementBlock as r, openBlock as s, createElementVNode as n, ref as p, useAttrs as H, computed as x, watch as L, Fragment as A, createVNode as v, renderSlot as C, withCtx as M, normalizeClass as _, createCommentVNode as $, unref as f, renderList as B, createBlock as E, resolveDynamicComponent as S } from "vue";
2
- import { useEditor as O, EditorContent as T } from "@tiptap/vue-3";
3
- import N from "@tiptap/starter-kit";
4
- import { _ as U } from "../_shared/Tooltip-B93ZF7IF.js";
5
- import { _ as q } from "../_shared/FormInput-B-SQTZTA.js";
6
- import { _ as z } from "../_shared/Modal-Bw2sID1x.js";
7
- function D(i, d) {
8
- return s(), r("svg", {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- viewBox: "0 0 16 16",
11
- fill: "currentColor",
12
- "aria-hidden": "true",
13
- "data-slot": "icon"
14
- }, [
15
- n("path", {
16
- "fill-rule": "evenodd",
17
- d: "M3 3a1 1 0 0 1 1-1h5a3.5 3.5 0 0 1 2.843 5.541A3.75 3.75 0 0 1 9.25 14H4a1 1 0 0 1-1-1V3Zm2.5 3.5v-2H9a1 1 0 0 1 0 2H5.5Zm0 2.5v2.5h3.75a1.25 1.25 0 1 0 0-2.5H5.5Z",
18
- "clip-rule": "evenodd"
19
- })
20
- ]);
21
- }
22
- function I(i, d) {
23
- return s(), r("svg", {
24
- xmlns: "http://www.w3.org/2000/svg",
25
- viewBox: "0 0 16 16",
26
- fill: "currentColor",
27
- "aria-hidden": "true",
28
- "data-slot": "icon"
29
- }, [
30
- n("path", {
31
- "fill-rule": "evenodd",
32
- d: "M6.25 2.75A.75.75 0 0 1 7 2h6a.75.75 0 0 1 0 1.5h-2.483l-3.429 9H9A.75.75 0 0 1 9 14H3a.75.75 0 0 1 0-1.5h2.483l3.429-9H7a.75.75 0 0 1-.75-.75Z",
33
- "clip-rule": "evenodd"
34
- })
35
- ]);
36
- }
37
- function R(i, d) {
38
- return s(), r("svg", {
39
- xmlns: "http://www.w3.org/2000/svg",
40
- viewBox: "0 0 16 16",
41
- fill: "currentColor",
42
- "aria-hidden": "true",
43
- "data-slot": "icon"
44
- }, [
45
- n("path", {
46
- "fill-rule": "evenodd",
47
- d: "M8.914 6.025a.75.75 0 0 1 1.06 0 3.5 3.5 0 0 1 0 4.95l-2 2a3.5 3.5 0 0 1-5.396-4.402.75.75 0 0 1 1.251.827 2 2 0 0 0 3.085 2.514l2-2a2 2 0 0 0 0-2.828.75.75 0 0 1 0-1.06Z",
48
- "clip-rule": "evenodd"
49
- }),
50
- n("path", {
51
- "fill-rule": "evenodd",
52
- d: "M7.086 9.975a.75.75 0 0 1-1.06 0 3.5 3.5 0 0 1 0-4.95l2-2a3.5 3.5 0 0 1 5.396 4.402.75.75 0 0 1-1.251-.827 2 2 0 0 0-3.085-2.514l-2 2a2 2 0 0 0 0 2.828.75.75 0 0 1 0 1.06Z",
53
- "clip-rule": "evenodd"
54
- })
55
- ]);
56
- }
57
- function j(i, d) {
58
- return s(), r("svg", {
59
- xmlns: "http://www.w3.org/2000/svg",
60
- viewBox: "0 0 16 16",
61
- fill: "currentColor",
62
- "aria-hidden": "true",
63
- "data-slot": "icon"
64
- }, [
65
- n("path", { d: "M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" })
66
- ]);
67
- }
68
- function F(i, d) {
69
- return s(), r("svg", {
70
- xmlns: "http://www.w3.org/2000/svg",
71
- viewBox: "0 0 16 16",
72
- fill: "currentColor",
73
- "aria-hidden": "true",
74
- "data-slot": "icon"
75
- }, [
76
- n("path", { d: "M2.995 1a.625.625 0 1 0 0 1.25h.38v2.125a.625.625 0 1 0 1.25 0v-2.75A.625.625 0 0 0 4 1H2.995ZM3.208 7.385a2.37 2.37 0 0 1 1.027-.124L2.573 8.923a.625.625 0 0 0 .439 1.067l1.987.011a.625.625 0 0 0 .006-1.25l-.49-.003.777-.776c.215-.215.335-.506.335-.809 0-.465-.297-.957-.842-1.078a3.636 3.636 0 0 0-1.993.121.625.625 0 1 0 .416 1.179ZM2.625 11a.625.625 0 1 0 0 1.25H4.25a.125.125 0 0 1 0 .25H3.5a.625.625 0 1 0 0 1.25h.75a.125.125 0 0 1 0 .25H2.625a.625.625 0 1 0 0 1.25H4.25a1.375 1.375 0 0 0 1.153-2.125A1.375 1.375 0 0 0 4.25 11H2.625ZM7.25 2a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM7.25 7.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM6.5 13.25a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Z" })
77
- ]);
78
- }
79
- const K = { class: "rvc-rich-text-toolbar" }, P = ["disabled", "aria-label", "onClick"], ee = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
80
- __name: "RichTextEditor",
81
- props: {
82
- id: {
83
- type: String,
84
- required: !0
85
- },
86
- modelValue: {
87
- type: String,
88
- default: ""
89
- },
90
- rootClass: {
91
- type: String,
92
- default: void 0
93
- },
94
- config: {
95
- type: String,
96
- default: "default",
97
- validator: (i) => ["default", "simple"].includes(i)
98
- },
99
- customExtensions: {
100
- type: Array,
101
- default: () => []
102
- },
103
- customCommands: {
104
- type: Array,
105
- default: () => []
106
- },
107
- disabled: {
108
- type: Boolean
109
- }
110
- },
111
- emits: ["update:modelValue", "tiptap:onCreate"],
112
- setup(i, { emit: d }) {
113
- const a = i, h = d, b = p(!1), u = p(!1), c = p(""), m = H(), k = m.class ? `${m.class} ` : "", y = N.configure({
114
- link: {
115
- openOnClick: !1
116
- }
117
- }), t = O({
118
- extensions: [y, ...a.customExtensions],
119
- content: a.modelValue,
120
- editorProps: {
121
- attributes: {
122
- ...m,
123
- id: a.id,
124
- class: `${k}rvc-textarea rvc-rich-text-textarea`
125
- }
126
- },
127
- onCreate: ({ editor: l }) => {
128
- h("tiptap:onCreate", l);
129
- },
130
- onUpdate: ({ editor: l }) => {
131
- const o = l.isEmpty ? "" : l.getHTML();
132
- h("update:modelValue", o);
133
- },
134
- onSelectionUpdate({ editor: l }) {
135
- b.value = !l.view.state.selection.empty;
136
- }
137
- }), V = x(() => [
138
- {
139
- name: "bold",
140
- icon: D,
141
- title: "Bold",
142
- isVisible: !0,
143
- isActive: () => t.value.isActive("bold"),
144
- action: () => t.value.commands.toggleBold()
145
- },
146
- {
147
- name: "italic",
148
- icon: I,
149
- title: "Italic",
150
- isVisible: !0,
151
- isActive: () => t.value.isActive("italic"),
152
- action: () => t.value.commands.toggleItalic()
153
- },
154
- {
155
- name: "bulletList",
156
- icon: j,
157
- title: "Bullet List",
158
- isVisible: a.config === "default",
159
- isActive: () => t.value.isActive("bulletList"),
160
- action: () => t.value.commands.toggleBulletList()
161
- },
162
- {
163
- name: "orderedList",
164
- icon: F,
165
- title: "Ordered List",
166
- isVisible: a.config === "default",
167
- isActive: () => t.value.isActive("orderedList"),
168
- action: () => t.value.commands.toggleOrderedList()
169
- },
170
- {
171
- name: "link",
172
- icon: R,
173
- title: "Hyperlink",
174
- isVisible: a.config === "default",
175
- disabled: !b.value && !t.value.isActive("link"),
176
- isActive: () => t.value.isActive("link"),
177
- action: () => {
178
- c.value = t.value.getAttributes("link").href, u.value = !0;
179
- }
180
- }
181
- ]), g = x(() => {
182
- const l = V.value.filter((e) => a.config === "default" || ["bold", "italic"].includes(e.name)), o = a.customCommands.map((e) => ({
183
- ...e,
184
- isVisible: e.isVisible ?? !0,
185
- disabled: typeof e.disabled == "function" ? e.disabled(t.value) : e.disabled ?? !1,
186
- isActive: () => {
187
- var w;
188
- return ((w = e.isActive) == null ? void 0 : w.call(e, t.value)) ?? !1;
189
- },
190
- action: () => e.action(t.value)
191
- }));
192
- return [...l, ...o];
193
- });
194
- L(() => a.modelValue, (l) => {
195
- t.value.getHTML() === l || t.value.commands.setContent(l, !1);
196
- });
197
- const Z = () => {
198
- t.value.commands.setLink({ href: c.value }), u.value = !1, c.value = null;
199
- };
200
- return (l, o) => (s(), r(A, null, [
201
- v(z, {
202
- id: `${a.id}-modal-add-hyperlink`,
203
- title: "Add Hyperlink",
204
- as: "form",
205
- show: u.value,
206
- "onModal:close": o[1] || (o[1] = (e) => u.value = !1),
207
- "onModal:save": Z
208
- }, {
209
- default: M(() => [
210
- v(q, {
211
- modelValue: c.value,
212
- "onUpdate:modelValue": o[0] || (o[0] = (e) => c.value = e),
213
- placeholder: "https://www.example.com",
214
- type: "url",
215
- required: ""
216
- }, null, 8, ["modelValue"])
217
- ]),
218
- _: 1
219
- }, 8, ["id", "show"]),
220
- C(l.$slots, "default"),
221
- n("div", {
222
- class: _(["rvc-rich-text", i.rootClass, { "rvc-rich-text-disabled": i.disabled }])
223
- }, [
224
- f(t) ? C(l.$slots, "toolbar", {
225
- key: 0,
226
- commands: g.value,
227
- tiptap: f(t)
228
- }, () => [
229
- n("ul", K, [
230
- (s(!0), r(A, null, B(g.value.filter((e) => e.isVisible), (e) => (s(), r("li", {
231
- key: `toolbar-item-command-${e.name}`
232
- }, [
233
- v(U, {
234
- content: e.title,
235
- placement: "bottom",
236
- size: "sm",
237
- class: "rvc-rich-text-tooltip"
238
- }, {
239
- default: M(() => [
240
- n("button", {
241
- disabled: e.disabled,
242
- type: "button",
243
- "aria-label": e.title,
244
- class: _([{ "rvc-rich-text-button-active": e.isActive() }, "rvc-rich-text-button"]),
245
- onClick: e.action
246
- }, [
247
- (s(), E(S(e.icon)))
248
- ], 10, P)
249
- ]),
250
- _: 2
251
- }, 1032, ["content"])
252
- ]))), 128))
253
- ])
254
- ]) : $("", !0),
255
- v(f(T), { editor: f(t) }, null, 8, ["editor"])
256
- ], 2)
257
- ], 64));
258
- }
259
- });
1
+ import { _ as t } from "../_shared/RichTextEditor.vue_vue_type_script_setup_true_lang-Bs4WdJhA.js";
260
2
  export {
261
- ee as RichTextEditor,
262
- ee as default
3
+ t as RichTextEditor,
4
+ t as default
263
5
  };
@@ -0,0 +1,4 @@
1
+ import { default as RichTextEditor } from './components/RichTextEditor.vue';
2
+ export type { RichTextConfig, CustomCommand, RichTextEditorProps } from './components/RichTextEditor.vue';
3
+ export { RichTextEditor };
4
+ export default RichTextEditor;
@@ -1,101 +1,5 @@
1
- import { onMounted as y, watch as w, createBlock as n, openBlock as s, unref as r, withCtx as c, resolveDynamicComponent as m, normalizeClass as h, renderSlot as a, createElementVNode as u, createCommentVNode as f, toDisplayString as p, createElementBlock as C, createVNode as $ } from "vue";
2
- import { TransitionRoot as b } from "@headlessui/vue";
3
- import { r as g } from "../_shared/XMarkIcon-90mcPzBs.js";
4
- const k = { class: "rvc-toast-title" }, V = {
5
- __name: "Toast",
6
- props: {
7
- show: {
8
- type: Boolean
9
- },
10
- as: {
11
- type: String,
12
- default: "div"
13
- },
14
- title: {
15
- type: String,
16
- default: ""
17
- },
18
- icon: {
19
- type: [Object, Function],
20
- default: null
21
- },
22
- timeout: {
23
- type: [Number, Boolean],
24
- default: 5e3
25
- },
26
- position: {
27
- type: String,
28
- default: "bottom",
29
- validator: (t) => ["top", "bottom"].includes(t)
30
- },
31
- type: {
32
- type: String,
33
- default: "info",
34
- validator: (t) => ["success", "warning", "danger", "info"].includes(t)
35
- },
36
- showClose: {
37
- type: Boolean,
38
- default: !1
39
- }
40
- },
41
- emits: ["toast:close"],
42
- setup(t, { emit: d }) {
43
- const o = t, v = d, l = () => {
44
- o.timeout && o.show && setTimeout(() => {
45
- v("toast:close");
46
- }, o.timeout);
47
- };
48
- return y(() => {
49
- l();
50
- }), w(() => o.show, (e) => {
51
- e && l();
52
- }), (e, i) => (s(), n(r(b), {
53
- show: t.show,
54
- as: "template",
55
- enter: "rvc-toast-transition-enter",
56
- "enter-from": "rvc-toast-transition-enter-from",
57
- "enter-to": "rvc-toast-transition-enter-to",
58
- leave: "rvc-toast-transition-leave",
59
- "leave-from": "rvc-toast-transition-leave-from",
60
- "leave-to": "rvc-toast-transition-leave-to"
61
- }, {
62
- default: c(() => [
63
- (s(), n(m(t.as), {
64
- class: h(["rvc-toast", `rvc-toast-${t.position}`, `rvc-toast-${t.type}`, { "rvc-toast-open": t.show }])
65
- }, {
66
- default: c(() => [
67
- a(e.$slots, "icon", {}, () => [
68
- t.icon ? (s(), n(m(t.icon), {
69
- key: 0,
70
- class: "rvc-toast-icon"
71
- })) : f("", !0)
72
- ]),
73
- u("div", null, [
74
- a(e.$slots, "title", {}, () => [
75
- u("span", k, p(t.title), 1)
76
- ]),
77
- a(e.$slots, "default")
78
- ]),
79
- a(e.$slots, "close", {}, () => [
80
- t.showClose ? (s(), C("button", {
81
- key: 0,
82
- type: "button",
83
- class: "rvc-toast-close",
84
- "aria-label": "Close",
85
- onClick: i[0] || (i[0] = (B) => e.$emit("toast:close"))
86
- }, [
87
- $(r(g))
88
- ])) : f("", !0)
89
- ])
90
- ]),
91
- _: 3
92
- }, 8, ["class"]))
93
- ]),
94
- _: 3
95
- }, 8, ["show"]));
96
- }
97
- };
1
+ import { _ as s } from "../_shared/Toast.vue_vue_type_script_setup_true_lang-FEeRXoIx.js";
98
2
  export {
99
- V as Toast,
100
- V as default
3
+ s as Toast,
4
+ s as default
101
5
  };
@@ -0,0 +1,4 @@
1
+ import { default as Toast } from './components/Toast.vue';
2
+ export type { ToastPosition, ToastType, ToastProps } from './components/Toast.vue';
3
+ export { Toast };
4
+ export default Toast;
@@ -1,4 +1,4 @@
1
- import { _ as o } from "../_shared/Tooltip-B93ZF7IF.js";
1
+ import { _ as o } from "../_shared/Tooltip.vue_vue_type_script_setup_true_lang-CoydN9sS.js";
2
2
  export {
3
3
  o as Tooltip,
4
4
  o as default
@@ -0,0 +1,4 @@
1
+ import { default as Tooltip } from './components/Tooltip.vue';
2
+ export type { TooltipPlacement, TooltipSize, TooltipProps } from './components/Tooltip.vue';
3
+ export { Tooltip };
4
+ export default Tooltip;
@@ -0,0 +1,3 @@
1
+ import { FunctionalComponent, SVGAttributes, HTMLAttributes, VNodeProps } from '../../node_modules/vue';
2
+ export type RenderableComponent = FunctionalComponent<SVGAttributes & HTMLAttributes & VNodeProps>;
3
+ export type Icon = RenderableComponent | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robuust-digital/vue-components",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-rc.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,26 +22,54 @@
22
22
  "README.md",
23
23
  "CHANGELOG.md"
24
24
  ],
25
- "main": "./dist/core/index.js",
26
- "module": "./dist/core/index.js",
25
+ "main": "./dist/index/index.js",
26
+ "module": "./dist/index/index.js",
27
+ "types": "./dist/index.d.ts",
27
28
  "exports": {
28
- ".": "./dist/core/index.js",
29
- "./core": "./dist/core/index.js",
29
+ ".": {
30
+ "import": "./dist/index/index.js",
31
+ "types": "./dist/index.d.ts"
32
+ },
33
+ "./core": {
34
+ "import": "./dist/core/index.js",
35
+ "types": "./dist/core.d.ts"
36
+ },
30
37
  "./core/css": "./dist/core/styles.css",
31
38
  "./core/theme": "./dist/core/theme.css",
32
- "./combobox": "./dist/combobox/index.js",
39
+ "./combobox": {
40
+ "import": "./dist/combobox/index.js",
41
+ "types": "./dist/combobox.d.ts"
42
+ },
33
43
  "./combobox/css": "./dist/combobox/styles.css",
34
- "./dialogs": "./dist/dialogs/index.js",
44
+ "./dialogs": {
45
+ "import": "./dist/dialogs/index.js",
46
+ "types": "./dist/dialogs.d.ts"
47
+ },
35
48
  "./dialogs/css": "./dist/dialogs/styles.css",
36
- "./dropdown": "./dist/dropdown/index.js",
49
+ "./dropdown": {
50
+ "import": "./dist/dropdown/index.js",
51
+ "types": "./dist/dropdown.d.ts"
52
+ },
37
53
  "./dropdown/css": "./dist/dropdown/styles.css",
38
- "./lightswitch": "./dist/lightswitch/index.js",
54
+ "./lightswitch": {
55
+ "import": "./dist/lightswitch/index.js",
56
+ "types": "./dist/lightswitch.d.ts"
57
+ },
39
58
  "./lightswitch/css": "./dist/lightswitch/styles.css",
40
- "./rich-text-editor": "./dist/rich-text-editor/index.js",
59
+ "./rich-text-editor": {
60
+ "import": "./dist/rich-text-editor/index.js",
61
+ "types": "./dist/rich-text-editor.d.ts"
62
+ },
41
63
  "./rich-text-editor/css": "./dist/rich-text-editor/styles.css",
42
- "./toast": "./dist/toast/index.js",
64
+ "./toast": {
65
+ "import": "./dist/toast/index.js",
66
+ "types": "./dist/toast.d.ts"
67
+ },
43
68
  "./toast/css": "./dist/toast/styles.css",
44
- "./tooltip": "./dist/tooltip/index.js",
69
+ "./tooltip": {
70
+ "import": "./dist/tooltip/index.js",
71
+ "types": "./dist/tooltip.d.ts"
72
+ },
45
73
  "./tooltip/css": "./dist/tooltip/styles.css"
46
74
  },
47
75
  "scripts": {
@@ -52,7 +80,8 @@
52
80
  "docs:preview": "vitepress preview docs",
53
81
  "test:unit": "vitest run",
54
82
  "lint": "eslint .",
55
- "lint:style": "stylelint 'src/**/*.{vue,css}'"
83
+ "lint:style": "stylelint 'src/**/*.{vue,css}'",
84
+ "type-check": "npx vue-tsc --noEmit"
56
85
  },
57
86
  "dependencies": {
58
87
  "@floating-ui/vue": "^1.1.7",
@@ -67,9 +96,12 @@
67
96
  "@rushstack/eslint-patch": "^1.10.5",
68
97
  "@tailwindcss/postcss": "^4.0.6",
69
98
  "@tailwindcss/vite": "^4.0.6",
99
+ "@types/node": "^24.2.0",
100
+ "@typescript-eslint/eslint-plugin": "^8.39.0",
101
+ "@typescript-eslint/parser": "^8.39.0",
70
102
  "@vitejs/plugin-vue": "^6.0.0",
71
103
  "@vitest/coverage-v8": "^3.0.5",
72
- "@vue/eslint-config-airbnb": "^8.0.0",
104
+ "@vue/eslint-config-airbnb-with-typescript": "^8.0.0",
73
105
  "@vue/test-utils": "^2.4.6",
74
106
  "eslint": "^8.57.1",
75
107
  "eslint-plugin-vue": "^9.32.0",
@@ -81,7 +113,9 @@
81
113
  "stylelint-config-property-sort-order-smacss": "^10.0.0",
82
114
  "stylelint-config-standard": "^39.0.0",
83
115
  "tailwindcss": "^4.0.6",
116
+ "typescript": "^5.9.2",
84
117
  "vite": "^6.1.0",
118
+ "vite-plugin-dts": "^4.5.4",
85
119
  "vite-plugin-static-copy": "^3.0.0",
86
120
  "vite-plugin-vue-devtools": "^8.0.0",
87
121
  "vite-svg-loader": "^5.1.0",
@@ -91,5 +125,5 @@
91
125
  "resolutions": {
92
126
  "@vueuse/core": "^13.0.0"
93
127
  },
94
- "packageManager": "yarn@4.9.1"
128
+ "packageManager": "yarn@4.9.2"
95
129
  }
@@ -1,87 +0,0 @@
1
- import { watchEffect as u, createBlock as i, openBlock as t, resolveDynamicComponent as c, mergeProps as b, withCtx as d, createElementBlock as y, renderSlot as l, createCommentVNode as a, createTextVNode as r, toDisplayString as s, unref as f } from "vue";
2
- import { S as g } from "./icon-spinner-CmxIOqaK.js";
3
- const m = {
4
- key: 0,
5
- class: "rvc-button-label"
6
- }, O = {
7
- __name: "ButtonBase",
8
- props: {
9
- as: {
10
- type: [String, Object, Function],
11
- default: "button"
12
- },
13
- bindAs: {
14
- type: String,
15
- default: void 0
16
- },
17
- label: {
18
- type: String,
19
- default: ""
20
- },
21
- icon: {
22
- type: [Object, Function],
23
- default: null
24
- },
25
- iconOnly: {
26
- type: Boolean,
27
- default: !1
28
- },
29
- iconLeft: {
30
- type: Boolean
31
- },
32
- size: {
33
- type: String,
34
- default: "base",
35
- validator: (n) => ["sm", "base"].includes(n)
36
- },
37
- spinning: {
38
- type: Boolean
39
- },
40
- color: {
41
- type: String,
42
- default: "primary",
43
- validator: (n) => typeof n != "string" ? !1 : /^(primary|secondary|tertiary|light|dark|green|red|yellow|blue|green-soft|red-soft|yellow-soft|blue-soft)?$/.test(n) || n.startsWith("custom-") || n === "clear"
44
- }
45
- },
46
- setup(n) {
47
- const o = n;
48
- return u(() => {
49
- o.iconOnly && !o.icon && console.warn("[ButtonBase] Using iconOnly prop without providing an icon may result in an empty button.");
50
- }), (e, v) => (t(), i(c(n.as), b(n.bindAs ? { as: n.bindAs } : {}, {
51
- class: ["rvc-button", `rvc-button-${n.color}`, `rvc-button-${n.size}`, { "rvc-button-reverse": n.iconLeft }, { "rvc-button-icon-only": n.iconOnly }],
52
- "aria-label": n.iconOnly ? n.label : null,
53
- "aria-busy": n.spinning
54
- }), {
55
- default: d(() => [
56
- n.iconOnly && n.label ? (t(), y("span", m, [
57
- l(e.$slots, "default", { label: n.label }, () => [
58
- r(s(n.label), 1)
59
- ])
60
- ])) : n.label ? l(e.$slots, "default", {
61
- key: 1,
62
- label: n.label
63
- }, () => [
64
- r(s(n.label), 1)
65
- ]) : a("", !0),
66
- l(e.$slots, "icon", { icon: n.icon }, () => [
67
- n.icon && !n.spinning ? (t(), i(c(n.icon), {
68
- key: 0,
69
- class: "rvc-button-icon",
70
- "aria-hidden": !n.iconOnly
71
- }, null, 8, ["aria-hidden"])) : a("", !0)
72
- ]),
73
- l(e.$slots, "spinner", { spinning: n.spinning }, () => [
74
- n.spinning ? (t(), i(f(g), {
75
- key: 0,
76
- class: "rvc-button-icon rvc-button-icon-loading",
77
- "aria-hidden": "true"
78
- })) : a("", !0)
79
- ])
80
- ]),
81
- _: 3
82
- }, 16, ["class", "aria-label", "aria-busy"]));
83
- }
84
- };
85
- export {
86
- O as _
87
- };
@@ -1,55 +0,0 @@
1
- import { createBlock as l, openBlock as a, resolveDynamicComponent as r, normalizeClass as n, withCtx as o, renderSlot as s, createTextVNode as i, toDisplayString as c, createElementBlock as d, createElementVNode as u } from "vue";
2
- const m = {
3
- __name: "Badge",
4
- props: {
5
- as: {
6
- type: String,
7
- default: "span"
8
- },
9
- label: {
10
- type: String,
11
- default: ""
12
- },
13
- size: {
14
- type: String,
15
- default: "base",
16
- validator: (e) => ["sm", "base"].includes(e)
17
- },
18
- color: {
19
- type: String,
20
- default: "default",
21
- validator: (e) => typeof e != "string" ? !1 : /^(default|gray|red|yellow|green|blue|violet|purple|pink)?$/.test(e) || e.startsWith("custom-")
22
- }
23
- },
24
- setup(e) {
25
- return (t, f) => (a(), l(r(e.as), {
26
- class: n(["rvc-badge", `rvc-badge-${e.color}`, `rvc-badge-${e.size}`])
27
- }, {
28
- default: o(() => [
29
- s(t.$slots, "default", { label: e.label }, () => [
30
- i(c(e.label), 1)
31
- ])
32
- ]),
33
- _: 3
34
- }, 8, ["class"]));
35
- }
36
- };
37
- function p(e, t) {
38
- return a(), d("svg", {
39
- xmlns: "http://www.w3.org/2000/svg",
40
- viewBox: "0 0 20 20",
41
- fill: "currentColor",
42
- "aria-hidden": "true",
43
- "data-slot": "icon"
44
- }, [
45
- u("path", {
46
- "fill-rule": "evenodd",
47
- d: "M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",
48
- "clip-rule": "evenodd"
49
- })
50
- ]);
51
- }
52
- export {
53
- m as _,
54
- p as r
55
- };