@robuust-digital/vue-components 1.3.2 β†’ 2.0.0-rc.1

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 +58 -53
  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
package/README.md CHANGED
@@ -1,79 +1,74 @@
1
1
  # Robuust Vue 3 Components
2
2
 
3
- A modern and customizable component library built with **Vue 3** and **Tailwind CSS**, designed to deliver a flexible, cohesive UI experience across all projects. Quickly integrate reusable components with ease, and customize them to suit your unique branding needs.
3
+ A modern and customizable component library built with **Vue 3** and **Tailwind 4 CSS**, designed to deliver a flexible, cohesive UI experience across all projects. Quickly integrate reusable components with ease, and customize them to suit your unique branding needs.
4
4
 
5
- ## Features
5
+ ## πŸš€ Features
6
6
 
7
7
  - ✨ **Vue 3 Components**: Carefully crafted components that work seamlessly with Vue 3
8
- - πŸ’Ž **Tailwind CSS Integration**: Leverage Tailwind CSS for styling, with full theme customization support
8
+ - πŸ’Ž **Tailwind 4 CSS Integration**: Leverage Tailwind CSS for styling, with full theme customization support
9
9
  - 🎨 **Theming & Customization**: Tailor components to your project’s branding directly from the `tailwind.config.js`
10
10
  - πŸ––πŸ½ **Accessibility First**: Components are designed with accessibility in mind, ensuring compliance with best practices
11
- - πŸ“¦ **Nuxt 3 module available**: Easily integrate with Nuxt 3 projects for seamless server-side rendering and enhanced performance
12
11
 
13
- ## Docs
12
+ ## πŸ“š Table of Contents
14
13
 
15
- [**See full docs here**](https://robuust.github.io/vue-components/)
14
+ - [Robuust Vue 3 Components](#robuust-vue-3-components)
15
+ - [πŸš€ Features](#-features)
16
+ - [πŸ“š Table of Contents](#-table-of-contents)
17
+ - [Documentation](#documentation)
18
+ - [Three-shaking](#three-shaking)
19
+ - [Getting Started](#getting-started)
16
20
 
17
- ## Installation
21
+ ## Documentation
18
22
 
19
- 1. **Install the component library via yarn or npm:**
23
+ πŸ“– [**View Documentation**](https://robuust.github.io/vue-components/)
20
24
 
21
- ```bash
22
- yarn add @robuust-digital/vue-components
23
- ```
25
+ ## Three-shaking
24
26
 
25
- ```bash
26
- npm i @robuust-digital/vue-components
27
- ```
27
+ This library is built with Vue 3 and Tailwind 4 CSS, and is designed to be tree-shakable. This means that you can import only the components you need, and the rest will be excluded from your final bundle.
28
28
 
29
- 2. **Add the component library plugin to your `tailwind.config.js`:**
30
-
31
- ```javascript
32
- // tailwind.config.js
33
- import components from '@robuust-digital/vue-components/tailwind';
34
-
35
- export default {
36
- theme: {
37
- extend: {
38
- // Customize component styles here
39
- components: (theme) => ({
40
- button: {
41
- '--rvc-button-height': theme('height.9'),
42
- // ...
43
- },
44
- }),
45
- },
46
- },
47
- plugins: [components],
48
- };
49
- ```
29
+ - [`@robuust-digital/vue-components/core`](./src/core) - The core component library
30
+ - [`@robuust-digital/vue-components/combobox`](./src/combobox) - `Combobox` component
31
+ - [`@robuust-digital/vue-components/dialogs`](./src/dialogs) - Headless UI components: `Drawer` and `Modal`
32
+ - [`@robuust-digital/vue-components/dropdown`](./src/dropdown) - Headless UI component: `Dropdown`
33
+ - [`@robuust-digital/vue-components/lightswitch`](./src/lightswitch) - Headless UI component: `Lightswitch`
34
+ - [`@robuust-digital/vue-components/toast`](./src/toast) - Headless UI component: `Toast`
35
+ - [`@robuust-digital/vue-components/rich-text-editor`](./src/rich-text-editor) - `RichTextEditor` component
36
+ - [`@robuust-digital/vue-components/tooltip`](./src/tooltip) - `Tooltip` component with `@floating-ui/vue`
50
37
 
51
- ## Import the CSS
38
+ ## Getting Started
52
39
 
53
- Import our base CSS file in your main entry file:
40
+ **Clone the repository** and install dependencies:
54
41
 
55
- ```javascript
56
- import '@robuust-digital/vue-components/css';
42
+ ```bash
43
+ git clone https://github.com/robuust/vue-components.git
44
+ cd vue-components
45
+ yarn install
57
46
  ```
58
47
 
59
- *This CSS file includes essential base styles and transitions required by the components. Make sure to import it before using any components.*
48
+ To start developing the component library, follow these steps:
60
49
 
61
- ## For Nuxt 3 Projects
50
+ ```bash
51
+ # Install dependencies
52
+ yarn install
62
53
 
63
- **Add the module to your `nuxt.config.ts` or `nuxt.config.js`:**
54
+ # Start the development playground
55
+ yarn dev
64
56
 
65
- ```javascript
66
- export default defineNuxtConfig({
67
- modules: ['@robuust-digital/vue-components/nuxt'],
68
- });
69
- ```
57
+ # Build the component library
58
+ yarn build
70
59
 
71
- This will automatically register all components globally in your Nuxt application, making them available for immediate use.
60
+ # Run the documentation site locally
61
+ yarn docs:dev
72
62
 
63
+ # Build the documentation site
64
+ yarn docs:build
73
65
 
74
- ## License
66
+ # Preview the documentation site
67
+ yarn docs:preview
75
68
 
76
- MIT Β© Robuust Digital
69
+ # Run unit tests
70
+ yarn test:unit
77
71
 
78
-
79
- *With `@robuust-digital/vue-components`, bring consistency, flexibility, and a polished look to all your Vue 3 applications.*
72
+ # Lint all files
73
+ yarn lint
74
+ ```
@@ -0,0 +1,87 @@
1
+ import { watchEffect as u, createBlock as l, openBlock as t, resolveDynamicComponent as c, mergeProps as y, withCtx as d, createElementBlock as b, renderSlot as i, 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: "sr-only"
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, h) => (t(), l(c(n.as), y(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(), b("span", m, [
57
+ i(e.$slots, "default", { label: n.label }, () => [
58
+ r(s(n.label), 1)
59
+ ])
60
+ ])) : n.label ? i(e.$slots, "default", {
61
+ key: 1,
62
+ label: n.label
63
+ }, () => [
64
+ r(s(n.label), 1)
65
+ ]) : a("", !0),
66
+ i(e.$slots, "icon", { icon: n.icon }, () => [
67
+ n.icon && !n.spinning ? (t(), l(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
+ i(e.$slots, "spinner", { spinning: n.spinning }, () => [
74
+ n.spinning ? (t(), l(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
+ };
@@ -0,0 +1,55 @@
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
+ };
@@ -0,0 +1,82 @@
1
+ import { computed as y, getCurrentInstance as $, useSlots as I, createElementBlock as i, openBlock as o, normalizeClass as k, createCommentVNode as l, renderSlot as r, unref as a, createBlock as p, resolveDynamicComponent as m, normalizeProps as b, guardReactiveProps as V, withDirectives as B, mergeProps as f, vModelDynamic as C } from "vue";
2
+ const x = () => ({ hasModelBinding: y(() => {
3
+ var s;
4
+ const n = $();
5
+ return ((s = n == null ? void 0 : n.vnode) == null ? void 0 : s.props) && Object.prototype.hasOwnProperty.call(n.vnode.props, "onUpdate:modelValue");
6
+ }) }), O = {
7
+ key: 0,
8
+ class: "rvc-input-prefix"
9
+ }, S = ["type"], j = ["type"], F = /* @__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 s = e, v = n, { hasModelBinding: g } = x(), u = I(), c = y({
39
+ get: () => s.modelValue,
40
+ set: (t) => v("update:modelValue", t)
41
+ });
42
+ return (t, d) => (o(), i("div", {
43
+ class: k([
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", O, [
50
+ r(t.$slots, "prefix", {}, () => [
51
+ r(t.$slots, "prefixIcon", { icon: e.prefixIcon }, () => [
52
+ e.prefixIcon ? (o(), p(m(e.prefixIcon), {
53
+ key: 0,
54
+ "aria-hidden": "true"
55
+ })) : l("", !0)
56
+ ])
57
+ ])
58
+ ])) : l("", !0),
59
+ r(t.$slots, "input", b(V(t.$attrs)), () => [
60
+ a(g) ? B((o(), i("input", f({ key: 0 }, t.$attrs, {
61
+ "onUpdate:modelValue": d[0] || (d[0] = (h) => c.value = h),
62
+ type: t.$attrs.type || "text"
63
+ }), null, 16, S)), [
64
+ [C, c.value]
65
+ ]) : (o(), i("input", f({
66
+ key: 1,
67
+ type: t.$attrs.type || "text"
68
+ }, t.$attrs), null, 16, j))
69
+ ]),
70
+ r(t.$slots, "icon", { icon: e.icon }, () => [
71
+ e.icon ? (o(), p(m(e.icon), {
72
+ key: 0,
73
+ "aria-hidden": "true"
74
+ })) : l("", !0)
75
+ ])
76
+ ], 2));
77
+ }
78
+ });
79
+ export {
80
+ F as _,
81
+ x as u
82
+ };
@@ -0,0 +1,193 @@
1
+ import { ref as g, computed as f, createBlock as w, openBlock as C, unref as a, withCtx as r, createVNode as n, withModifiers as x, createElementVNode as o, normalizeClass as B, renderSlot as b, createElementBlock as E, createCommentVNode as D, createTextVNode as L, toDisplayString as h } from "vue";
2
+ import { TransitionRoot as F, Dialog as I, TransitionChild as $, DialogPanel as N, DialogTitle as R } from "@headlessui/vue";
3
+ import { _ as S } from "./ButtonBase-CQjlJ85F.js";
4
+ import { r as T } from "./XMarkIcon-90mcPzBs.js";
5
+ function V(t) {
6
+ const c = g(null), i = g(!1), y = f(() => t.as === "form"), v = f(() => `${t.id}-title`), d = f(() => `${t.id}-content`), u = f(() => {
7
+ var m;
8
+ return (m = c.value) == null ? void 0 : m.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
9
+ });
10
+ return {
11
+ contentRef: c,
12
+ ready: i,
13
+ isForm: y,
14
+ titleId: v,
15
+ descriptionId: d,
16
+ initialFocusElement: u
17
+ };
18
+ }
19
+ const q = {
20
+ role: "presentation",
21
+ class: "fixed inset-0 z-10 w-screen overflow-y-auto"
22
+ }, z = { class: "flex min-h-full justify-center p-4 items-center sm:p-0" }, j = { class: "rvc-modal-header" }, M = { class: "flex items-center justify-between" }, A = {
23
+ key: 0,
24
+ class: "ml-3 flex h-7 items-center"
25
+ }, P = ["id"], G = { class: "rvc-modal-footer" }, Q = {
26
+ __name: "Modal",
27
+ props: {
28
+ as: {
29
+ type: String,
30
+ default: "div"
31
+ },
32
+ id: {
33
+ type: String,
34
+ required: !0
35
+ },
36
+ title: {
37
+ type: String,
38
+ required: !0
39
+ },
40
+ showClose: {
41
+ type: Boolean
42
+ },
43
+ spinning: {
44
+ type: Boolean
45
+ },
46
+ submitLabel: {
47
+ type: String,
48
+ default: "Confirm"
49
+ },
50
+ cancelLabel: {
51
+ type: String,
52
+ default: "Cancel"
53
+ },
54
+ panelClass: {
55
+ type: String,
56
+ default: "sm:max-w-lg"
57
+ }
58
+ },
59
+ emits: ["modal:open", "modal:close", "modal:save", "modal:closed"],
60
+ setup(t, { emit: c }) {
61
+ const i = c, y = t, {
62
+ contentRef: v,
63
+ ready: d,
64
+ isForm: u,
65
+ titleId: m,
66
+ descriptionId: p,
67
+ initialFocusElement: k
68
+ } = V(y);
69
+ return (s, e) => (C(), w(a(F), { as: "template" }, {
70
+ default: r(() => [
71
+ n(a(I), {
72
+ as: t.as,
73
+ class: "rvc-modal",
74
+ static: "",
75
+ "aria-modal": "true",
76
+ role: "dialog",
77
+ "initial-focus": a(k),
78
+ "aria-labelledby": a(m),
79
+ onClose: e[6] || (e[6] = (l) => s.$emit("modal:close")),
80
+ onSubmit: e[7] || (e[7] = x((l) => i("modal:save", l), ["prevent"]))
81
+ }, {
82
+ default: r(() => [
83
+ n(a($), {
84
+ as: "template",
85
+ enter: "ease-out duration-300",
86
+ "enter-from": "opacity-0",
87
+ "enter-to": "opacity-100",
88
+ leave: "ease-in duration-200",
89
+ "leave-from": "opacity-100",
90
+ "leave-to": "opacity-0",
91
+ onBeforeEnter: e[0] || (e[0] = (l) => i("modal:open"))
92
+ }, {
93
+ default: r(() => e[8] || (e[8] = [
94
+ o("div", {
95
+ "aria-hidden": "true",
96
+ class: "fixed inset-0 transition-opacity rvc-modal-backdrop"
97
+ }, null, -1)
98
+ ])),
99
+ _: 1
100
+ }),
101
+ o("div", q, [
102
+ o("div", z, [
103
+ n(a($), {
104
+ as: "template",
105
+ enter: "ease-out duration-300",
106
+ "enter-from": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
107
+ "enter-to": "opacity-100 translate-y-0 sm:scale-100",
108
+ leave: "ease-in duration-200",
109
+ "leave-from": "opacity-100 translate-y-0 sm:scale-100",
110
+ "leave-to": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
111
+ onBeforeEnter: e[4] || (e[4] = (l) => d.value = !0),
112
+ onAfterLeave: e[5] || (e[5] = (l) => (d.value = !1, i("modal:closed")))
113
+ }, {
114
+ default: r(() => [
115
+ n(a(N), {
116
+ class: B(["rvc-modal-panel", t.panelClass]),
117
+ "aria-busy": t.spinning,
118
+ "aria-describedby": a(p)
119
+ }, {
120
+ default: r(() => [
121
+ o("header", j, [
122
+ b(s.$slots, "header", { title: t.title }, () => [
123
+ o("div", M, [
124
+ n(a(R), {
125
+ id: a(m),
126
+ class: "rvc-modal-title"
127
+ }, {
128
+ default: r(() => [
129
+ L(h(t.title), 1)
130
+ ]),
131
+ _: 1
132
+ }, 8, ["id"]),
133
+ t.showClose ? (C(), E("div", A, [
134
+ o("button", {
135
+ type: "button",
136
+ class: "relative rvc-modal-close",
137
+ "aria-label": "Close panel",
138
+ onClick: e[1] || (e[1] = (l) => i("modal:close"))
139
+ }, [
140
+ n(a(T), {
141
+ class: "size-full",
142
+ "aria-hidden": "true"
143
+ })
144
+ ])
145
+ ])) : D("", !0)
146
+ ])
147
+ ])
148
+ ]),
149
+ o("div", {
150
+ id: a(p),
151
+ ref_key: "contentRef",
152
+ ref: v,
153
+ class: "rvc-modal-content"
154
+ }, [
155
+ b(s.$slots, "default", { ready: a(d) })
156
+ ], 8, P),
157
+ o("footer", G, [
158
+ b(s.$slots, "footer", { loading: t.spinning }, () => [
159
+ n(S, {
160
+ type: a(u) ? "submit" : "button",
161
+ label: t.submitLabel,
162
+ spinning: t.spinning,
163
+ disabled: t.spinning,
164
+ onClick: e[2] || (e[2] = (l) => !a(u) && s.$emit("modal:save"))
165
+ }, null, 8, ["type", "label", "spinning", "disabled"]),
166
+ n(S, {
167
+ type: "button",
168
+ color: "light",
169
+ label: t.cancelLabel,
170
+ onClick: e[3] || (e[3] = (l) => s.$emit("modal:close"))
171
+ }, null, 8, ["label"])
172
+ ])
173
+ ])
174
+ ]),
175
+ _: 3
176
+ }, 8, ["class", "aria-busy", "aria-describedby"])
177
+ ]),
178
+ _: 3
179
+ })
180
+ ])
181
+ ])
182
+ ]),
183
+ _: 3
184
+ }, 8, ["as", "initial-focus", "aria-labelledby"])
185
+ ]),
186
+ _: 3
187
+ }));
188
+ }
189
+ };
190
+ export {
191
+ Q as _,
192
+ V as u
193
+ };
@@ -0,0 +1,126 @@
1
+ import { shallowRef as a, createElementBlock as d, openBlock as u, renderSlot as f, 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: b,
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
+ }), v = (e) => ({
69
+ top: 0,
70
+ bottom: 180,
71
+ left: -90,
72
+ right: 90
73
+ })[e.split("-")[0]] || 0, w = (e) => {
74
+ var p, m;
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: (p = e.arrow) != null && p.x ? `${e.arrow.x}px` : "",
84
+ top: (m = e.arrow) != null && m.y ? `${e.arrow.y}px` : "",
85
+ bottom: "",
86
+ right: "",
87
+ [n]: l.value ? `${l.value.offsetWidth * -1}px` : "",
88
+ transform: `rotate(${v(c.value)}deg)`
89
+ }
90
+ };
91
+ };
92
+ return (e, r) => (u(), d("div", {
93
+ ref_key: "wrapperRef",
94
+ ref: i,
95
+ class: "group/tooltip"
96
+ }, [
97
+ f(e.$slots, "default"),
98
+ g("div", {
99
+ ref_key: "tooltipRef",
100
+ ref: s,
101
+ class: S([
102
+ "rvc-tooltip group-hover/tooltip:opacity-100 group-hover/tooltip:visible invisible opacity-0",
103
+ t.tooltipClass,
104
+ `rvc-tooltip-${t.size}`,
105
+ { "rvc-tooltip-blur": t.blur }
106
+ ]),
107
+ style: x(h(y))
108
+ }, [
109
+ f(e.$slots, "content", { content: t.content }, () => [
110
+ t.content ? (u(), d("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: "absolute rvc-tooltip-arrow"
119
+ }, w(h(b))), null, 16)
120
+ ], 6)
121
+ ], 512));
122
+ }
123
+ };
124
+ export {
125
+ N as _
126
+ };
@@ -0,0 +1,19 @@
1
+ import { createElementBlock as e, openBlock as r, createElementVNode as l } from "vue";
2
+ function n(o, t) {
3
+ return r(), e("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ viewBox: "0 0 24 24",
6
+ fill: "currentColor",
7
+ "aria-hidden": "true",
8
+ "data-slot": "icon"
9
+ }, [
10
+ l("path", {
11
+ "fill-rule": "evenodd",
12
+ d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
13
+ "clip-rule": "evenodd"
14
+ })
15
+ ]);
16
+ }
17
+ export {
18
+ n as r
19
+ };