@robuust-digital/vue-components 1.3.2 → 2.0.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 (73) hide show
  1. package/README.md +47 -52
  2. package/dist/_shared/ButtonBase-CQjlJ85F.js +87 -0
  3. package/dist/_shared/ChevronDownIcon-z-5U4fIb.js +55 -0
  4. package/dist/_shared/FormInput-abFMz_J4.js +82 -0
  5. package/dist/_shared/Modal-COVlUEud.js +193 -0
  6. package/dist/_shared/Tooltip-BKXJoJ1x.js +126 -0
  7. package/dist/_shared/XMarkIcon-90mcPzBs.js +19 -0
  8. package/dist/_shared/icon-spinner-CmxIOqaK.js +26 -0
  9. package/dist/combobox/combobox.css +203 -0
  10. package/dist/combobox/index.js +349 -0
  11. package/dist/combobox/styles.css +1 -0
  12. package/dist/core/accordion.css +47 -0
  13. package/dist/core/alert.css +169 -0
  14. package/dist/core/badge.css +121 -0
  15. package/dist/core/button.css +393 -0
  16. package/dist/core/checkbox.css +60 -0
  17. package/dist/core/empty-state.css +56 -0
  18. package/dist/core/index.js +779 -0
  19. package/dist/core/input.css +92 -0
  20. package/dist/core/pagination.css +48 -0
  21. package/dist/core/radio.css +61 -0
  22. package/dist/core/select.css +81 -0
  23. package/dist/core/styles.css +92 -0
  24. package/dist/core/table.css +87 -0
  25. package/dist/core/tabs.css +74 -0
  26. package/dist/core/textarea.css +48 -0
  27. package/dist/core/theme.css +11 -0
  28. package/dist/dialogs/drawer.css +72 -0
  29. package/dist/dialogs/index.js +200 -0
  30. package/dist/dialogs/modal.css +98 -0
  31. package/dist/dialogs/styles.css +2 -0
  32. package/dist/dropdown/dropdown.css +89 -0
  33. package/dist/dropdown/index.js +136 -0
  34. package/dist/dropdown/styles.css +1 -0
  35. package/dist/lightswitch/index.js +48 -0
  36. package/dist/lightswitch/lightswitch.css +68 -0
  37. package/dist/lightswitch/styles.css +1 -0
  38. package/dist/rich-text-editor/index.js +262 -0
  39. package/dist/rich-text-editor/rich-text.css +83 -0
  40. package/dist/rich-text-editor/styles.css +1 -0
  41. package/dist/toast/index.js +100 -0
  42. package/dist/toast/styles.css +1 -0
  43. package/dist/toast/toast.css +187 -0
  44. package/dist/tooltip/index.js +5 -0
  45. package/dist/tooltip/styles.css +1 -0
  46. package/dist/tooltip/tooltip.css +69 -0
  47. package/package.json +55 -52
  48. package/dist/nuxt-module.js +0 -27
  49. package/dist/style.css +0 -1
  50. package/dist/tailwind/base/index.js +0 -72
  51. package/dist/tailwind/components/accordion.js +0 -59
  52. package/dist/tailwind/components/alert.js +0 -166
  53. package/dist/tailwind/components/badge.js +0 -119
  54. package/dist/tailwind/components/button.js +0 -292
  55. package/dist/tailwind/components/checkbox.js +0 -70
  56. package/dist/tailwind/components/combobox.js +0 -226
  57. package/dist/tailwind/components/drawer.js +0 -104
  58. package/dist/tailwind/components/dropdown.js +0 -97
  59. package/dist/tailwind/components/empty-state.js +0 -69
  60. package/dist/tailwind/components/input.js +0 -101
  61. package/dist/tailwind/components/lightswitch.js +0 -79
  62. package/dist/tailwind/components/modal.js +0 -132
  63. package/dist/tailwind/components/pagination.js +0 -62
  64. package/dist/tailwind/components/radio.js +0 -75
  65. package/dist/tailwind/components/rich-text.js +0 -100
  66. package/dist/tailwind/components/select.js +0 -88
  67. package/dist/tailwind/components/table.js +0 -109
  68. package/dist/tailwind/components/tabs.js +0 -95
  69. package/dist/tailwind/components/textarea.js +0 -53
  70. package/dist/tailwind/components/toast.js +0 -188
  71. package/dist/tailwind/components/tooltip.js +0 -74
  72. package/dist/tailwind/index.js +0 -94
  73. package/dist/vue-components.es.js +0 -2401
@@ -0,0 +1,200 @@
1
+ import { createBlock as w, openBlock as f, unref as l, withCtx as o, createVNode as i, withModifiers as S, createElementVNode as a, normalizeClass as u, renderSlot as c, createElementBlock as $, createCommentVNode as y, createTextVNode as B, toDisplayString as D } from "vue";
2
+ import { TransitionRoot as E, Dialog as L, TransitionChild as b, DialogPanel as N, DialogTitle as T } from "@headlessui/vue";
3
+ import { _ as p } from "../_shared/ButtonBase-CQjlJ85F.js";
4
+ import { u as V } from "../_shared/Modal-COVlUEud.js";
5
+ import { _ as X } from "../_shared/Modal-COVlUEud.js";
6
+ import { r as z } from "../_shared/XMarkIcon-90mcPzBs.js";
7
+ const R = {
8
+ class: "fixed inset-0 overflow-hidden",
9
+ role: "presentation"
10
+ }, q = { class: "absolute inset-0 overflow-hidden" }, F = { class: "pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10" }, I = { class: "flex h-full flex-col shadow-xl" }, M = { class: "flex items-center justify-between" }, j = {
11
+ key: 0,
12
+ class: "ml-3 flex h-7 items-center"
13
+ }, A = ["id"], P = { class: "flex shrink-0 rvc-drawer-footer" }, Q = {
14
+ __name: "Drawer",
15
+ props: {
16
+ as: {
17
+ type: String,
18
+ default: "form"
19
+ },
20
+ id: {
21
+ type: String,
22
+ required: !0
23
+ },
24
+ title: {
25
+ type: String,
26
+ required: !0
27
+ },
28
+ showClose: {
29
+ type: Boolean
30
+ },
31
+ scrolledDown: {
32
+ type: Boolean
33
+ },
34
+ headerSticky: {
35
+ type: Boolean
36
+ },
37
+ spinning: {
38
+ type: Boolean
39
+ },
40
+ submitLabel: {
41
+ type: String,
42
+ default: "Save"
43
+ },
44
+ cancelLabel: {
45
+ type: String,
46
+ default: "Cancel"
47
+ },
48
+ panelClass: {
49
+ type: String,
50
+ default: "max-w-xl"
51
+ }
52
+ },
53
+ emits: ["drawer:open", "drawer:close", "drawer:save", "drawer:closed"],
54
+ setup(t, { emit: x }) {
55
+ const n = x, g = t, {
56
+ contentRef: h,
57
+ ready: d,
58
+ isForm: C,
59
+ titleId: m,
60
+ descriptionId: v,
61
+ initialFocusElement: k
62
+ } = V(g);
63
+ return (s, e) => (f(), w(l(E), { as: "template" }, {
64
+ default: o(() => [
65
+ i(l(L), {
66
+ as: t.as,
67
+ class: "rvc-drawer",
68
+ static: "",
69
+ "aria-modal": "true",
70
+ role: "dialog",
71
+ "initial-focus": l(k),
72
+ "aria-labelledby": l(m),
73
+ onClose: e[5] || (e[5] = (r) => s.$emit("drawer:close")),
74
+ onSubmit: e[6] || (e[6] = S((r) => n("drawer:save", r), ["prevent"]))
75
+ }, {
76
+ default: o(() => [
77
+ i(l(b), {
78
+ as: "template",
79
+ enter: "ease-in-out duration-500",
80
+ "enter-from": "opacity-0",
81
+ "enter-to": "opacity-100",
82
+ leave: "ease-in-out duration-500",
83
+ "leave-from": "opacity-100",
84
+ "leave-to": "opacity-0",
85
+ onBeforeEnter: e[0] || (e[0] = (r) => n("drawer:open"))
86
+ }, {
87
+ default: o(() => e[7] || (e[7] = [
88
+ a("div", {
89
+ class: "fixed inset-0 transition-opacity rvc-drawer-backdrop",
90
+ "aria-hidden": "true"
91
+ }, null, -1)
92
+ ])),
93
+ _: 1
94
+ }),
95
+ a("div", R, [
96
+ a("div", q, [
97
+ a("div", F, [
98
+ i(l(b), {
99
+ as: "template",
100
+ enter: "transform transition ease-in-out duration-500 sm:duration-700",
101
+ "enter-from": "translate-x-full",
102
+ "enter-to": "translate-x-0",
103
+ leave: "transform transition ease-in-out duration-500 sm:duration-700",
104
+ "leave-from": "translate-x-0",
105
+ "leave-to": "translate-x-full",
106
+ onBeforeEnter: e[3] || (e[3] = (r) => d.value = !0),
107
+ onAfterLeave: e[4] || (e[4] = (r) => (d.value = !1, n("drawer:closed")))
108
+ }, {
109
+ default: o(() => [
110
+ i(l(N), {
111
+ class: u(["pointer-events-auto w-screen", t.panelClass]),
112
+ "aria-busy": t.spinning,
113
+ "aria-describedby": l(v)
114
+ }, {
115
+ default: o(() => [
116
+ a("div", I, [
117
+ a("header", {
118
+ class: u([{ "sticky top-0 left-0 -w-full z-10": t.headerSticky }, "rvc-drawer-header"])
119
+ }, [
120
+ c(s.$slots, "header", {
121
+ title: t.title,
122
+ showClose: t.showClose
123
+ }, () => [
124
+ a("div", M, [
125
+ i(l(T), {
126
+ id: l(m),
127
+ class: "rvc-drawer-title"
128
+ }, {
129
+ default: o(() => [
130
+ B(D(t.title), 1)
131
+ ]),
132
+ _: 1
133
+ }, 8, ["id"]),
134
+ t.showClose ? (f(), $("div", j, [
135
+ a("button", {
136
+ type: "button",
137
+ class: "relative rvc-drawer-close",
138
+ "aria-label": "Close panel",
139
+ onClick: e[1] || (e[1] = (r) => n("drawer:close"))
140
+ }, [
141
+ i(l(z), {
142
+ class: "size-full",
143
+ "aria-hidden": "true"
144
+ })
145
+ ])
146
+ ])) : y("", !0)
147
+ ])
148
+ ])
149
+ ], 2),
150
+ a("div", {
151
+ class: u([t.scrolledDown ? "flex-col-reverse" : "flex-col", "flex min-h-0 flex-1 overflow-y-scroll"])
152
+ }, [
153
+ a("div", {
154
+ id: l(v),
155
+ ref_key: "contentRef",
156
+ ref: h,
157
+ class: "relative flex-1 rvc-drawer-content"
158
+ }, [
159
+ c(s.$slots, "default", { ready: l(d) })
160
+ ], 8, A)
161
+ ], 2),
162
+ a("footer", P, [
163
+ c(s.$slots, "footer", { loading: t.spinning }, () => [
164
+ i(p, {
165
+ type: "button",
166
+ label: t.cancelLabel,
167
+ color: "light",
168
+ onClick: e[2] || (e[2] = (r) => n("drawer:close"))
169
+ }, null, 8, ["label"]),
170
+ l(C) ? (f(), w(p, {
171
+ key: 0,
172
+ type: "submit",
173
+ label: t.submitLabel,
174
+ spinning: t.spinning,
175
+ disabled: t.spinning
176
+ }, null, 8, ["label", "spinning", "disabled"])) : y("", !0)
177
+ ])
178
+ ])
179
+ ])
180
+ ]),
181
+ _: 3
182
+ }, 8, ["class", "aria-busy", "aria-describedby"])
183
+ ]),
184
+ _: 3
185
+ })
186
+ ])
187
+ ])
188
+ ])
189
+ ]),
190
+ _: 3
191
+ }, 8, ["as", "initial-focus", "aria-labelledby"])
192
+ ]),
193
+ _: 3
194
+ }));
195
+ }
196
+ };
197
+ export {
198
+ Q as Drawer,
199
+ X as Modal
200
+ };
@@ -0,0 +1,98 @@
1
+ :root {
2
+ --rvc-modal-backdrop-bg-color: var(--rvc-dialog-backdrop-bg-color);
3
+ --rvc-modal-border-color: var(--rvc-base-border-color);
4
+ --rvc-modal-border-width: var(--rvc-base-border-width);
5
+ --rvc-modal-border-style: var(--rvc-base-border-style);
6
+ --rvc-modal-border-radius: var(--rvc-base-border-radius);
7
+ --rvc-modal-padding-x: var(--rvc-dialog-padding-x);
8
+ --rvc-modal-padding-y: var(--rvc-dialog-padding-y);
9
+ --rvc-modal-header-bg-color: var(--rvc-dialog-header-bg-color);
10
+ --rvc-modal-title-font-size: var(--rvc-dialog-title-font-size);
11
+ --rvc-modal-title-font-weight: var(--rvc-dialog-title-font-weight);
12
+ --rvc-modal-title-font-family: var(--rvc-dialog-title-font-family);
13
+ --rvc-modal-title-color: var(--rvc-dialog-title-color);
14
+ --rvc-modal-close-size: var(--rvc-dialog-close-size);
15
+ --rvc-modal-close-color: var(--rvc-dialog-close-color);
16
+ --rvc-modal-close-color-hover: var(--rvc-dialog-close-color-hover);
17
+ --rvc-modal-content-bg-color: var(--rvc-dialog-content-bg-color);
18
+ --rvc-modal-footer-bg-color: var(--rvc-dialog-footer-bg-color);
19
+ --rvc-modal-footer-gap: var(--rvc-dialog-footer-gap);
20
+ --rvc-modal-box-shadow: var(--box-shadow-xl);
21
+ --rvc-modal-margin-y: 0;
22
+ }
23
+
24
+ @layer components {
25
+ .rvc-modal {
26
+ z-index: 600;
27
+ position: relative;
28
+
29
+ .rvc-modal-backdrop {
30
+ background-color: var(--rvc-modal-backdrop-bg-color);
31
+ }
32
+
33
+ .rvc-modal-panel {
34
+ border-color: var(--rvc-modal-border-color);
35
+ border-width: var(--rvc-modal-border-width);
36
+ border-style: var(--rvc-modal-border-style);
37
+ border-radius: var(--rvc-modal-border-radius);
38
+ box-shadow: var(--rvc-modal-box-shadow);
39
+ margin-block: var(--rvc-modal-margin-y);
40
+ display: flex;
41
+ height: 100%;
42
+ flex-direction: column;
43
+ position: relative;
44
+ transform: translate(0, 0);
45
+ overflow: hidden;
46
+ width: 100%;
47
+ text-align: left;
48
+ }
49
+
50
+ .rvc-modal-header {
51
+ padding-block: var(--rvc-modal-padding-y);
52
+ padding-inline: var(--rvc-modal-padding-x);
53
+ background-color: var(--rvc-modal-header-bg-color);
54
+ border-bottom-color: var(--rvc-modal-border-color);
55
+ border-bottom-width: var(--rvc-modal-border-width);
56
+ border-bottom-style: var(--rvc-modal-border-style);
57
+ }
58
+
59
+ .rvc-modal-title {
60
+ font-size: var(--rvc-modal-title-font-size);
61
+ font-weight: var(--rvc-modal-title-font-weight);
62
+ font-family: var(--rvc-modal-title-font-family);
63
+ color: var(--rvc-modal-title-color);
64
+ }
65
+
66
+ .rvc-modal-close {
67
+ width: var(--rvc-modal-close-size);
68
+ height: var(--rvc-modal-close-size);
69
+ color: var(--rvc-modal-close-color);
70
+
71
+ &:hover {
72
+ color: var(--rvc-modal-close-color-hover);
73
+ }
74
+ }
75
+
76
+ .rvc-modal-content {
77
+ padding-block: var(--rvc-modal-padding-y);
78
+ padding-inline: var(--rvc-modal-padding-x);
79
+ background-color: var(--rvc-modal-content-bg-color);
80
+ }
81
+
82
+ .rvc-modal-footer {
83
+ padding-block: var(--rvc-modal-padding-y);
84
+ padding-inline: var(--rvc-modal-padding-x);
85
+ gap: var(--rvc-modal-footer-gap);
86
+ background-color: var(--rvc-modal-footer-bg-color);
87
+ border-top-color: var(--rvc-modal-border-color);
88
+ border-top-width: var(--rvc-modal-border-width);
89
+ border-top-style: var(--rvc-modal-border-style);
90
+ display: flex;
91
+ flex-direction: column;
92
+
93
+ @media (width >= 40rem) {
94
+ flex-direction: row-reverse;
95
+ }
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,2 @@
1
+ @import "./drawer.css";
2
+ @import "./modal.css";
@@ -0,0 +1,89 @@
1
+ :root {
2
+ --rvc-dropdown-bg-color: var(--rvc-base-input-bg-color);
3
+ --rvc-dropdown-border-radius: var(--rvc-base-border-radius);
4
+ --rvc-dropdown-border-width: var(--rvc-base-border-width);
5
+ --rvc-dropdown-border-color: var(--rvc-base-border-color);
6
+ --rvc-dropdown-icon-size: var(--rvc-base-input-icon-size);
7
+ --rvc-dropdown-icon-color: var(--rvc-base-input-icon-color);
8
+ --rvc-dropdown-icon-color-hover: var(--rvc-base-input-icon-color);
9
+ --rvc-dropdown-item-color: var(--rvc-base-input-color);
10
+ --rvc-dropdown-font-size: var(--rvc-base-font-size);
11
+ --rvc-dropdown-font-weight: var(--rvc-base-font-weight);
12
+ --rvc-dropdown-width: calc(var(--spacing) * 56);
13
+ --rvc-dropdown-padding-x: calc(var(--spacing) * 6);
14
+ --rvc-dropdown-padding-y: calc(var(--spacing) * 6);
15
+ --rvc-dropdown-gap: calc(var(--spacing) * 2);
16
+ --rvc-dropdown-z-index: 50;
17
+ --rvc-dropdown-item-gap: calc(var(--spacing) * 3);
18
+ --rvc-dropdown-item-border-radius: 0;
19
+ --rvc-dropdown-item-bg-color: transparent;
20
+ --rvc-dropdown-item-bg-color-hover: transparent;
21
+ --rvc-dropdown-item-color-hover: var(--color-slate-600);
22
+ --rvc-dropdown-item-padding-x: 0;
23
+ --rvc-dropdown-item-padding-y: 0;
24
+ --rvc-dropdown-item-font-size: var(--rvc-base-font-size);
25
+ --rvc-dropdown-item-font-weight: var(--rvc-base-font-weight);
26
+ }
27
+
28
+ @layer components {
29
+ .rvc-dropdown {
30
+ width: var(--rvc-dropdown-width);
31
+ background-color: var(--rvc-dropdown-bg-color);
32
+ border-radius: var(--rvc-dropdown-border-radius);
33
+ border-width: var(--rvc-dropdown-border-width);
34
+ border-color: var(--rvc-dropdown-border-color);
35
+ padding-block: var(--rvc-dropdown-padding-y);
36
+ padding-inline: var(--rvc-dropdown-padding-x);
37
+ font-size: var(--rvc-dropdown-font-size);
38
+ font-weight: var(--rvc-dropdown-font-weight);
39
+ gap: var(--rvc-dropdown-gap);
40
+ z-index: var(--rvc-dropdown-z-index);
41
+ margin-top: calc(var(--spacing) * 1);
42
+ position: absolute;
43
+ display: flex;
44
+ flex-direction: column;
45
+ align-items: flex-start;
46
+ right: 0;
47
+
48
+ &.rvc-dropdown-left {
49
+ left: 0;
50
+ right: auto;
51
+ }
52
+
53
+ &.rvc-dropdown-full {
54
+ left: 0;
55
+ right: 0;
56
+ width: 100%;
57
+ }
58
+
59
+ .rvc-dropdown-item {
60
+ color: var(--rvc-dropdown-item-color);
61
+ background-color: var(--rvc-dropdown-item-bg-color);
62
+ gap: var(--rvc-dropdown-item-gap);
63
+ padding-block: var(--rvc-dropdown-item-padding-y);
64
+ padding-inline: var(--rvc-dropdown-item-padding-x);
65
+ border-radius: var(--rvc-dropdown-item-border-radius);
66
+ font-size: var(--rvc-dropdown-item-font-size);
67
+ font-weight: var(--rvc-dropdown-item-font-weight);
68
+ display: flex;
69
+ align-items: center;
70
+ width: 100%;
71
+
72
+ &:hover {
73
+ color: var(--rvc-dropdown-item-color-hover);
74
+ background-color: var(--rvc-dropdown-item-bg-color-hover);
75
+ text-decoration: underline;
76
+
77
+ .rvc-dropdown-item-icon {
78
+ color: var(--rvc-dropdown-icon-color-hover);
79
+ }
80
+ }
81
+
82
+ .rvc-dropdown-item-icon {
83
+ width: var(--rvc-dropdown-icon-size);
84
+ height: var(--rvc-dropdown-icon-size);
85
+ color: var(--rvc-dropdown-icon-color);
86
+ }
87
+ }
88
+ }
89
+ }
@@ -0,0 +1,136 @@
1
+ import { createElementBlock as w, openBlock as o, createElementVNode as C, createBlock as r, unref as a, normalizeClass as u, withCtx as l, renderSlot as s, createVNode as i, mergeProps as f, Transition as B, Fragment as M, renderList as $, resolveDynamicComponent as m, createCommentVNode as A, createTextVNode as D, toDisplayString as L } from "vue";
2
+ import { Menu as N, MenuButton as p, MenuItems as S, MenuItem as v } from "@headlessui/vue";
3
+ import { _ as V } from "../_shared/ButtonBase-CQjlJ85F.js";
4
+ function x(t, c) {
5
+ return o(), w("svg", {
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 20 20",
8
+ fill: "currentColor",
9
+ "aria-hidden": "true",
10
+ "data-slot": "icon"
11
+ }, [
12
+ C("path", { d: "M10 3a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM10 8.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM11.5 15.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Z" })
13
+ ]);
14
+ }
15
+ const T = /* @__PURE__ */ Object.assign({
16
+ inheritAttrs: !1
17
+ }, {
18
+ __name: "Dropdown",
19
+ props: {
20
+ items: {
21
+ type: Array,
22
+ required: !0,
23
+ default: () => []
24
+ },
25
+ alignLeft: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ fullWidth: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ label: {
34
+ type: String,
35
+ default: "Options"
36
+ },
37
+ rootClass: {
38
+ type: String,
39
+ default: ""
40
+ }
41
+ },
42
+ emits: ["dropdown:click"],
43
+ setup(t, { emit: c }) {
44
+ const b = c, y = (n) => {
45
+ const {
46
+ as: g,
47
+ bindAs: e,
48
+ event: d,
49
+ icon: h,
50
+ name: I,
51
+ ...k
52
+ } = n;
53
+ return k;
54
+ };
55
+ return (n, g) => (o(), r(a(N), {
56
+ as: "div",
57
+ class: u(["relative inline-block w-fit", t.rootClass])
58
+ }, {
59
+ default: l(() => [
60
+ s(n.$slots, "button", {
61
+ label: t.label,
62
+ button: a(p)
63
+ }, () => [
64
+ i(a(p), f({
65
+ as: V,
66
+ label: t.label,
67
+ color: "light",
68
+ icon: a(x),
69
+ "icon-left": t.alignLeft
70
+ }, n.$attrs), null, 16, ["label", "icon", "icon-left"])
71
+ ]),
72
+ i(B, {
73
+ "enter-active-class": "transition duration-100 ease-out",
74
+ "enter-from-class": "transform scale-95 opacity-0",
75
+ "enter-to-class": "transform scale-100 opacity-100",
76
+ "leave-active-class": "transition duration-75 ease-in",
77
+ "leave-from-class": "transform scale-100 opacity-100",
78
+ "leave-to-class": "transform scale-95 opacity-0"
79
+ }, {
80
+ default: l(() => [
81
+ i(a(S), {
82
+ class: u([
83
+ "rvc-dropdown",
84
+ {
85
+ "rvc-dropdown-left": t.alignLeft,
86
+ "rvc-dropdown-full": t.fullWidth
87
+ }
88
+ ])
89
+ }, {
90
+ default: l(() => [
91
+ s(n.$slots, "items", {
92
+ items: t.items,
93
+ menuItem: a(v)
94
+ }, () => [
95
+ (o(!0), w(M, null, $(t.items, (e, d) => (o(), r(a(v), {
96
+ key: `${d}-dropdown-item`,
97
+ as: "template"
98
+ }, {
99
+ default: l(() => [
100
+ s(n.$slots, "item", { item: e }, () => [
101
+ (o(), r(m(e.as ? e.as : "button"), f({
102
+ class: "rvc-dropdown-item",
103
+ ref_for: !0
104
+ }, y(e), {
105
+ as: e.bindAs ? e.bindAs : void 0,
106
+ onClick: (h) => (b("dropdown:click", e), e.event ? e.event() : null)
107
+ }), {
108
+ default: l(() => [
109
+ e.icon ? (o(), r(m(e.icon), {
110
+ key: 0,
111
+ class: "rvc-dropdown-item-icon"
112
+ })) : A("", !0),
113
+ D(" " + L(e.name), 1)
114
+ ]),
115
+ _: 2
116
+ }, 1040, ["as", "onClick"]))
117
+ ])
118
+ ]),
119
+ _: 2
120
+ }, 1024))), 128))
121
+ ])
122
+ ]),
123
+ _: 3
124
+ }, 8, ["class"])
125
+ ]),
126
+ _: 3
127
+ })
128
+ ]),
129
+ _: 3
130
+ }, 8, ["class"]));
131
+ }
132
+ });
133
+ export {
134
+ T as Dropdown,
135
+ T as default
136
+ };
@@ -0,0 +1 @@
1
+ @import "./dropdown.css";
@@ -0,0 +1,48 @@
1
+ import { computed as n, createBlock as o, openBlock as r, unref as a, withCtx as s, createVNode as p, createCommentVNode as h, mergeProps as f, createElementVNode as g, renderSlot as w } from "vue";
2
+ import { SwitchGroup as V, Switch as v, SwitchLabel as b } from "@headlessui/vue";
3
+ const B = /* @__PURE__ */ Object.assign({
4
+ inheritAttrs: !1
5
+ }, {
6
+ __name: "Lightswitch",
7
+ props: {
8
+ modelValue: {
9
+ type: Boolean,
10
+ default: !1
11
+ }
12
+ },
13
+ emits: ["update:modelValue"],
14
+ setup(u, { emit: i }) {
15
+ const d = u, c = i, l = n({
16
+ get: () => d.modelValue,
17
+ set: (e) => c("update:modelValue", e)
18
+ });
19
+ return (e, t) => (r(), o(a(V), {
20
+ as: "div",
21
+ class: "rvc-lightswitch-group"
22
+ }, {
23
+ default: s(() => [
24
+ p(a(v), f({
25
+ modelValue: l.value,
26
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => l.value = m),
27
+ class: [{ "rvc-lightswitch-enabled": l.value }, "rvc-lightswitch"]
28
+ }, e.$attrs), {
29
+ default: s(() => t[1] || (t[1] = [
30
+ g("span", { class: "rvc-lightswitch-toggle" }, null, -1)
31
+ ])),
32
+ _: 1
33
+ }, 16, ["modelValue", "class"]),
34
+ e.$slots.default ? (r(), o(a(b), { key: 0 }, {
35
+ default: s(() => [
36
+ w(e.$slots, "default")
37
+ ]),
38
+ _: 3
39
+ })) : h("", !0)
40
+ ]),
41
+ _: 3
42
+ }));
43
+ }
44
+ });
45
+ export {
46
+ B as Lightswitch,
47
+ B as default
48
+ };
@@ -0,0 +1,68 @@
1
+ :root {
2
+ --rvc-lightswitch-transition-duration: var(--rvc-base-transition-duration);
3
+ --rvc-lightswitch-transition-timing-function: var(--rvc-base-transition-timing-function);
4
+ --rvc-lightswitch-toggle-transition-duration: var(--rvc-base-transition-duration);
5
+ --rvc-lightswitch-toggle-transition-timing-function: var(--rvc-base-transition-timing-function);
6
+ --rvc-lightswitch-border-radius: calc(infinity * 1px);
7
+ --rvc-lightswitch-height: 1.875rem;
8
+ --rvc-lightswitch-width: 3.125rem;
9
+ --rvc-lightswitch-bg-color: var(--color-slate-200);
10
+ --rvc-lightswitch-bg-color-enabled: var(--color-green-400);
11
+ --rvc-lightswitch-transition-property: colors;
12
+ --rvc-lightswitch-label-offset: 0.5rem;
13
+ --rvc-lightswitch-toggle-offset: 0.1875rem;
14
+ --rvc-lightswitch-toggle-size: calc(var(--spacing) * 6);
15
+ --rvc-lightswitch-toggle-bg-color: var(--color-white);
16
+ --rvc-lightswitch-toggle-transition-property: transform;
17
+ }
18
+
19
+ @layer components {
20
+ .rvc-lightswitch-group {
21
+ display: inline-block;
22
+
23
+ &:has(label) {
24
+ display: inline-flex;
25
+ align-items: center;
26
+ }
27
+
28
+ label {
29
+ cursor: pointer;
30
+ padding-left: var(--rvc-lightswitch-label-offset);
31
+ }
32
+
33
+ .rvc-lightswitch {
34
+ height: var(--rvc-lightswitch-height);
35
+ transition-property: var(--rvc-lightswitch-transition-property);
36
+ transition-duration: var(--rvc-lightswitch-transition-duration);
37
+ transition-timing-function: var(--rvc-lightswitch-transition-timing-function);
38
+ width: var(--rvc-lightswitch-width);
39
+ border-radius: var(--rvc-lightswitch-border-radius);
40
+ background-color: var(--rvc-lightswitch-bg-color);
41
+ position: relative;
42
+ display: inline-flex;
43
+ align-items: center;
44
+
45
+ .rvc-lightswitch-toggle {
46
+ width: var(--rvc-lightswitch-toggle-size);
47
+ height: var(--rvc-lightswitch-toggle-size);
48
+ transform: translateX(var(--rvc-lightswitch-toggle-offset));
49
+ transform-origin: left;
50
+ border-radius: var(--rvc-lightswitch-border-radius);
51
+ background-color: var(--rvc-lightswitch-toggle-bg-color);
52
+ transition-property: var(--rvc-lightswitch-toggle-transition-property);
53
+ transition-duration: var(--rvc-lightswitch-toggle-transition-duration);
54
+ transition-timing-function: var(--rvc-lightswitch-toggle-transition-timing-function);
55
+ display: inline-block;
56
+ box-shadow: var(--shadow-md);
57
+ }
58
+
59
+ &.rvc-lightswitch-enabled {
60
+ background-color: var(--rvc-lightswitch-bg-color-enabled);
61
+
62
+ .rvc-lightswitch-toggle {
63
+ transform: translateX(calc(var(--rvc-lightswitch-width) - var(--rvc-lightswitch-toggle-size) - var(--rvc-lightswitch-toggle-offset)));
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
@@ -0,0 +1 @@
1
+ @import "./lightswitch.css";