@deck9/ui 0.17.0-next.2 → 0.17.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.
- package/README.md +107 -11
- package/dist/src/ui.mjs +170 -167
- package/dist/src/ui.umd.js +2 -2
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,24 +1,120 @@
|
|
|
1
|
-
# ui
|
|
1
|
+
# @deck9/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vue 3 components for Deck9 apps such as [Input](https://github.com/deck9/input), styled with Tailwind CSS 3. Storybook is the component reference: run `npm run storybook` in this repo.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @deck9/ui
|
|
9
|
+
pnpm add @deck9/ui
|
|
10
|
+
yarn add @deck9/ui
|
|
11
|
+
bun add @deck9/ui
|
|
4
12
|
```
|
|
5
|
-
|
|
13
|
+
|
|
14
|
+
Vue 3.3 or newer is a peer dependency. Pre-releases are on the `next` tag: `npm install @deck9/ui@next`.
|
|
15
|
+
|
|
16
|
+
The steps below use npm. With another package manager, swap `npm install` for `pnpm add`, `yarn add` or `bun add`.
|
|
17
|
+
|
|
18
|
+
## Use it in an app
|
|
19
|
+
|
|
20
|
+
### Tailwind
|
|
21
|
+
|
|
22
|
+
The package ships no CSS: its components use Tailwind 3 classes, and the app's Tailwind build creates them. In a new app, set up Tailwind 3:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install -D tailwindcss@3 postcss autoprefixer @tailwindcss/forms
|
|
26
|
+
npx tailwindcss init -p
|
|
6
27
|
```
|
|
7
28
|
|
|
8
|
-
|
|
29
|
+
In `tailwind.config.js`, add the package's bundle to `content`, plus the `grey` color and the forms plugin the components use. `darkMode: "class"` keeps the components light until the app sets a `dark` class. Without it, they turn dark whenever the computer is in dark mode.
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import colors from "tailwindcss/colors";
|
|
33
|
+
import forms from "@tailwindcss/forms";
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
darkMode: "class",
|
|
37
|
+
content: [
|
|
38
|
+
"./index.html",
|
|
39
|
+
"./src/**/*.{vue,js,ts}",
|
|
40
|
+
"./node_modules/@deck9/ui/dist/src/ui.mjs",
|
|
41
|
+
],
|
|
42
|
+
theme: {
|
|
43
|
+
extend: {
|
|
44
|
+
colors: { grey: colors.slate },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
plugins: [forms],
|
|
48
|
+
};
|
|
9
49
|
```
|
|
10
|
-
|
|
50
|
+
|
|
51
|
+
Put Tailwind's layers in the app's main CSS file (in a Vite app: `src/style.css`):
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@tailwind base;
|
|
55
|
+
@tailwind components;
|
|
56
|
+
@tailwind utilities;
|
|
11
57
|
```
|
|
12
58
|
|
|
13
|
-
###
|
|
59
|
+
### Icons
|
|
60
|
+
|
|
61
|
+
The components draw icons with Font Awesome 6 and register only the few they use themselves. The app registers every other icon. Install Font Awesome 6, so the app and the components share one copy:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
npm install @fortawesome/fontawesome-svg-core@6 @fortawesome/free-solid-svg-icons@6
|
|
14
65
|
```
|
|
15
|
-
|
|
66
|
+
|
|
67
|
+
Register the icons once before the app mounts, for example in `src/main.js`:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
71
|
+
import { faRocket } from "@fortawesome/free-solid-svg-icons";
|
|
72
|
+
|
|
73
|
+
library.add(faRocket);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Brand icons work the same way with `@fortawesome/free-brands-svg-icons@6`.
|
|
77
|
+
|
|
78
|
+
### A first component
|
|
79
|
+
|
|
80
|
+
```vue
|
|
81
|
+
<script setup>
|
|
82
|
+
import { D9Button, D9Icon } from "@deck9/ui";
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<template>
|
|
86
|
+
<D9Button label="Launch" icon="rocket" />
|
|
87
|
+
<D9Icon name="rocket" size="2x" />
|
|
88
|
+
</template>
|
|
16
89
|
```
|
|
17
90
|
|
|
18
|
-
|
|
91
|
+
Icon names are Font Awesome's names in kebab-case, without `fa`: `faChevronDown` is `chevron-down`.
|
|
92
|
+
|
|
93
|
+
## Develop
|
|
94
|
+
|
|
95
|
+
The repo uses npm (`package-lock.json`) and the Node version in `.nvmrc`.
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
npm ci
|
|
99
|
+
npm run storybook # Storybook on http://localhost:6006
|
|
100
|
+
npm test # Vitest
|
|
101
|
+
npm run lint # ESLint
|
|
102
|
+
npm run check # type check
|
|
103
|
+
npm run build # builds dist/, the files npm publishes
|
|
19
104
|
```
|
|
20
|
-
|
|
105
|
+
|
|
106
|
+
## Release
|
|
107
|
+
|
|
108
|
+
Run `release.sh` on main. It takes the same arguments as `npm version`:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
./release.sh preminor --preid next # 0.17.0 → 0.18.0-next.0
|
|
112
|
+
./release.sh prerelease # 0.18.0-next.0 → 0.18.0-next.1
|
|
113
|
+
./release.sh minor # 0.18.0-next.1 → 0.18.0
|
|
114
|
+
./release.sh patch # 0.18.0 → 0.18.1
|
|
115
|
+
./release.sh major # 0.18.1 → 1.0.0
|
|
21
116
|
```
|
|
22
117
|
|
|
23
|
-
|
|
24
|
-
|
|
118
|
+
It pulls main, builds, bumps the version, pushes the commit and tag, and creates a GitHub release. You need push rights on main and a logged-in `gh`. The GitHub release starts the publish workflow, which publishes to npm through trusted publishing, without an npm token.
|
|
119
|
+
|
|
120
|
+
A version with a dash, like `0.18.0-next.1`, is a pre-release: it goes to the `next` tag. Every other version goes to `latest`, which is what `npm install @deck9/ui` installs.
|
package/dist/src/ui.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as $, computed as D, openBlock as a, createBlock as C, unref as d, mergeProps as P, createCommentVNode as f, createElementBlock as i, normalizeClass as b, createElementVNode as c, toDisplayString as g, createVNode as k, ref as z, watch as I, Fragment as E, withDirectives as J, vModelText as Q, normalizeStyle as F, withCtx as x, renderSlot as T, Teleport as W, Transition as O, Comment as X, normalizeProps as Y, guardReactiveProps as Z, resolveDynamicComponent as ee, onMounted as R, createTextVNode as j, renderList as G, onUnmounted as te } from "vue";
|
|
2
2
|
import { library as se, findIconDefinition as U } from "@fortawesome/fontawesome-svg-core";
|
|
3
3
|
import { FontAwesomeIcon as le } from "@fortawesome/vue-fontawesome";
|
|
4
4
|
import { faCheck as oe, faChevronDown as ae, faCircleNotch as ne, faEllipsis as re, faEyeDropper as ie } from "@fortawesome/free-solid-svg-icons";
|
|
5
5
|
import { v4 as H } from "uuid";
|
|
6
6
|
import { useEyeDropper as de } from "@vueuse/core";
|
|
7
|
-
import { Menu as ue, MenuButton as ce, MenuItems as
|
|
7
|
+
import { Menu as ue, MenuButton as ce, MenuItems as me, MenuItem as fe, Listbox as pe, ListboxButton as be, ListboxOptions as ge, ListboxOption as ye, Switch as he } from "@headlessui/vue";
|
|
8
8
|
import { useFloating as ke, autoUpdate as ve, offset as _e, flip as xe, shift as $e } from "@floating-ui/vue";
|
|
9
9
|
const K = [
|
|
10
10
|
oe,
|
|
@@ -14,28 +14,28 @@ const K = [
|
|
|
14
14
|
ie
|
|
15
15
|
];
|
|
16
16
|
se.add(...K);
|
|
17
|
-
const yt = K.map(({ iconName:
|
|
17
|
+
const yt = K.map(({ iconName: l }) => l), ht = [], w = /* @__PURE__ */ $({
|
|
18
18
|
__name: "Icon",
|
|
19
19
|
props: {
|
|
20
20
|
name: { default: "user" }
|
|
21
21
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const n =
|
|
24
|
-
const t = n.name,
|
|
25
|
-
return
|
|
22
|
+
setup(l) {
|
|
23
|
+
const n = l, e = D(() => {
|
|
24
|
+
const t = n.name, s = U({ prefix: "fab", iconName: t }) ?? U({ prefix: "fas", iconName: t });
|
|
25
|
+
return s || console.warn(
|
|
26
26
|
"could not load icon, because it is not available",
|
|
27
27
|
n.name
|
|
28
|
-
),
|
|
28
|
+
), s;
|
|
29
29
|
});
|
|
30
|
-
return (t,
|
|
30
|
+
return (t, s) => e.value ? (a(), C(d(le), P({
|
|
31
31
|
key: 0,
|
|
32
32
|
icon: e.value
|
|
33
|
-
}, t.$attrs), null, 16, ["icon"])) :
|
|
33
|
+
}, t.$attrs), null, 16, ["icon"])) : f("", !0);
|
|
34
34
|
}
|
|
35
35
|
}), we = ["aria-label", "disabled", "aria-disabled", "aria-busy"], Ce = {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "absolute inset-0 flex items-center justify-center"
|
|
38
|
-
}, kt = /* @__PURE__ */
|
|
38
|
+
}, kt = /* @__PURE__ */ $({
|
|
39
39
|
__name: "Button",
|
|
40
40
|
props: {
|
|
41
41
|
label: {},
|
|
@@ -47,8 +47,8 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
47
47
|
iconPosition: { default: "right" }
|
|
48
48
|
},
|
|
49
49
|
emits: ["click"],
|
|
50
|
-
setup(
|
|
51
|
-
const e =
|
|
50
|
+
setup(l, { emit: n }) {
|
|
51
|
+
const e = l, t = n, s = D(() => {
|
|
52
52
|
const o = {
|
|
53
53
|
"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": e.color === "primary",
|
|
54
54
|
"text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": e.color === "light",
|
|
@@ -57,7 +57,7 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
57
57
|
}, p = {
|
|
58
58
|
"pointer-events-none opacity-75 cursor-not-allowed": e.isDisabled,
|
|
59
59
|
"cursor-default": e.isLoading
|
|
60
|
-
},
|
|
60
|
+
}, _ = {
|
|
61
61
|
"px-4 py-1 text-xs leading-5 mono-100 rounded-lg": e.size === "small",
|
|
62
62
|
"px-5 py-2 text-sm leading-4 font-medium rounded-lg": e.size === "medium",
|
|
63
63
|
"px-8 py-3 text-base leading-6 font-medium rounded-lg": e.size === "large"
|
|
@@ -65,7 +65,7 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
65
65
|
return {
|
|
66
66
|
...o,
|
|
67
67
|
...p,
|
|
68
|
-
...
|
|
68
|
+
..._
|
|
69
69
|
};
|
|
70
70
|
}), u = D(() => {
|
|
71
71
|
const o = {
|
|
@@ -74,7 +74,7 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
74
74
|
}, p = {
|
|
75
75
|
"ml-3 -mr-1": ["small", "medium"].includes(e.size) && e.iconPosition === "right",
|
|
76
76
|
"ml-3 -mr-3": ["large"].includes(e.size) && e.iconPosition === "right"
|
|
77
|
-
},
|
|
77
|
+
}, _ = {
|
|
78
78
|
"text-white": e.color === "primary",
|
|
79
79
|
"text-blue-600": e.color === "light",
|
|
80
80
|
"text-grey-50": e.color === "dark"
|
|
@@ -82,7 +82,7 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
82
82
|
return {
|
|
83
83
|
...o,
|
|
84
84
|
...p,
|
|
85
|
-
...
|
|
85
|
+
..._
|
|
86
86
|
};
|
|
87
87
|
});
|
|
88
88
|
function v(o) {
|
|
@@ -93,7 +93,7 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
93
93
|
t("click", o);
|
|
94
94
|
}
|
|
95
95
|
return (o, p) => (a(), i("button", {
|
|
96
|
-
class: b(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",
|
|
96
|
+
class: b(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", s.value]),
|
|
97
97
|
type: "button",
|
|
98
98
|
"aria-label": o.label,
|
|
99
99
|
disabled: o.isDisabled,
|
|
@@ -108,20 +108,20 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
108
108
|
key: 0,
|
|
109
109
|
name: o.icon,
|
|
110
110
|
class: b(u.value)
|
|
111
|
-
}, null, 8, ["name", "class"])) :
|
|
111
|
+
}, null, 8, ["name", "class"])) : f("", !0),
|
|
112
112
|
c("span", null, g(o.label), 1),
|
|
113
113
|
o.icon && o.iconPosition === "right" ? (a(), C(w, {
|
|
114
114
|
key: 1,
|
|
115
115
|
name: o.icon,
|
|
116
116
|
class: b(u.value)
|
|
117
|
-
}, null, 8, ["name", "class"])) :
|
|
117
|
+
}, null, 8, ["name", "class"])) : f("", !0)
|
|
118
118
|
], 2),
|
|
119
119
|
o.isLoading ? (a(), i("span", Ce, [
|
|
120
120
|
k(w, {
|
|
121
121
|
class: "animate-spin",
|
|
122
122
|
name: "circle-notch"
|
|
123
123
|
})
|
|
124
|
-
])) :
|
|
124
|
+
])) : f("", !0)
|
|
125
125
|
], 10, we));
|
|
126
126
|
}
|
|
127
127
|
}), Ve = { class: "relative flex items-start" }, De = ["checked", "id"], ze = { class: "ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed" }, Be = ["for"], Le = {
|
|
@@ -129,7 +129,7 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
129
129
|
class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
|
|
130
130
|
}, Se = {
|
|
131
131
|
inheritAttrs: !1
|
|
132
|
-
}, vt = /* @__PURE__ */
|
|
132
|
+
}, vt = /* @__PURE__ */ $({
|
|
133
133
|
...Se,
|
|
134
134
|
__name: "Checkbox",
|
|
135
135
|
props: {
|
|
@@ -139,42 +139,42 @@ const yt = K.map(({ iconName: s }) => s), ht = [], w = /* @__PURE__ */ x({
|
|
|
139
139
|
description: {}
|
|
140
140
|
},
|
|
141
141
|
emits: ["update:modelValue"],
|
|
142
|
-
setup(
|
|
143
|
-
const e = n, t = (
|
|
144
|
-
e("update:modelValue",
|
|
142
|
+
setup(l, { emit: n }) {
|
|
143
|
+
const e = n, t = (s) => {
|
|
144
|
+
e("update:modelValue", s.target.checked);
|
|
145
145
|
};
|
|
146
|
-
return (
|
|
146
|
+
return (s, u) => (a(), i("div", Ve, [
|
|
147
147
|
c("input", P({
|
|
148
148
|
class: "peer mt-0.5 h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm disabled:opacity-50 disabled:cursor-not-allowed",
|
|
149
149
|
type: "checkbox",
|
|
150
|
-
checked:
|
|
150
|
+
checked: s.modelValue,
|
|
151
151
|
onChange: t,
|
|
152
|
-
id:
|
|
153
|
-
},
|
|
152
|
+
id: s.id
|
|
153
|
+
}, s.$attrs), null, 16, De),
|
|
154
154
|
c("div", ze, [
|
|
155
155
|
c("label", {
|
|
156
|
-
for:
|
|
156
|
+
for: s.id,
|
|
157
157
|
class: "font-medium text-grey-700 dark:text-grey-200 casual-25"
|
|
158
|
-
}, g(
|
|
159
|
-
|
|
158
|
+
}, g(s.label), 9, Be),
|
|
159
|
+
s.description ? (a(), i("p", Le, g(s.description), 1)) : f("", !0)
|
|
160
160
|
])
|
|
161
161
|
]));
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
function A(
|
|
164
|
+
function A(l) {
|
|
165
165
|
const n = D(() => ({
|
|
166
|
-
"pl-3 pr-10 py-2": !
|
|
167
|
-
"pl-4 pr-10 py-3": !
|
|
168
|
-
"pl-6 pr-10 py-3": !
|
|
169
|
-
"pl-10 pr-10 py-1": (
|
|
170
|
-
"pl-12 pr-10 py-3": (
|
|
171
|
-
"w-full block":
|
|
166
|
+
"pl-3 pr-10 py-2": !l.icon && l.type !== "color" && l.size === "small",
|
|
167
|
+
"pl-4 pr-10 py-3": !l.icon && l.type !== "color" && l.size === "medium",
|
|
168
|
+
"pl-6 pr-10 py-3": !l.icon && l.type !== "color" && l.size === "large",
|
|
169
|
+
"pl-10 pr-10 py-1": (l.icon || l.type === "color") && l.size === "small",
|
|
170
|
+
"pl-12 pr-10 py-3": (l.icon || l.type === "color") && (l.size === "medium" || l.size === "large"),
|
|
171
|
+
"w-full block": l.block === !0
|
|
172
172
|
})), e = D(() => ({
|
|
173
|
-
"pointer-events-none opacity-50 cursor-not-allowed":
|
|
173
|
+
"pointer-events-none opacity-50 cursor-not-allowed": l.isDisabled
|
|
174
174
|
})), t = D(() => ({
|
|
175
|
-
"text-xs leading-4":
|
|
176
|
-
"text-sm leading-4":
|
|
177
|
-
"text-base leading-5":
|
|
175
|
+
"text-xs leading-4": l.size === "small",
|
|
176
|
+
"text-sm leading-4": l.size === "medium",
|
|
177
|
+
"text-base leading-5": l.size === "large"
|
|
178
178
|
}));
|
|
179
179
|
return {
|
|
180
180
|
inputClasses: n,
|
|
@@ -184,7 +184,7 @@ function A(s) {
|
|
|
184
184
|
}
|
|
185
185
|
const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { class: "absolute inset-y-2 left-2 w-8 cursor-pointer" }, Ie = ["disabled"], Te = ["disabled"], Ee = {
|
|
186
186
|
inheritAttrs: !1
|
|
187
|
-
}, _t = /* @__PURE__ */
|
|
187
|
+
}, _t = /* @__PURE__ */ $({
|
|
188
188
|
...Ee,
|
|
189
189
|
__name: "Input",
|
|
190
190
|
props: {
|
|
@@ -200,20 +200,20 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
200
200
|
showColorPicker: { type: Boolean }
|
|
201
201
|
},
|
|
202
202
|
emits: ["update:modelValue"],
|
|
203
|
-
setup(
|
|
204
|
-
const t =
|
|
203
|
+
setup(l, { expose: n, emit: e }) {
|
|
204
|
+
const t = l, s = z(null), u = z(t.modelValue ?? ""), v = (r) => t.type === "number" && r !== "" && r !== null ? Number(r) : r;
|
|
205
205
|
I(
|
|
206
206
|
() => t.modelValue,
|
|
207
207
|
(r) => {
|
|
208
208
|
typeof r < "u" && r !== v(u.value) && (u.value = r);
|
|
209
209
|
}
|
|
210
210
|
);
|
|
211
|
-
const o = e, { inputClasses: p, disabledClasses:
|
|
211
|
+
const o = e, { inputClasses: p, disabledClasses: _, textSizeClasses: V } = A(t), y = D(() => t.type === "color" ? "text" : t.type), {
|
|
212
212
|
isSupported: M,
|
|
213
|
-
open:
|
|
213
|
+
open: m,
|
|
214
214
|
sRGBHex: N
|
|
215
215
|
} = de(), h = () => {
|
|
216
|
-
|
|
216
|
+
m();
|
|
217
217
|
};
|
|
218
218
|
I(N, (r) => {
|
|
219
219
|
u.value = r, o("update:modelValue", r);
|
|
@@ -233,22 +233,22 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
233
233
|
return n({
|
|
234
234
|
focus: () => {
|
|
235
235
|
var r;
|
|
236
|
-
t.isDisabled || (r =
|
|
236
|
+
t.isDisabled || (r = s.value) == null || r.focus();
|
|
237
237
|
}
|
|
238
238
|
}), (r, L) => (a(), i("div", {
|
|
239
239
|
class: b(["relative", [r.block ? "w-full block" : "inline-block"]])
|
|
240
240
|
}, [
|
|
241
241
|
c("input", P({
|
|
242
|
-
class: ["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(p), d(V), d(
|
|
242
|
+
class: ["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(p), d(V), d(_)]],
|
|
243
243
|
placeholder: r.placeholder,
|
|
244
|
-
type:
|
|
244
|
+
type: y.value,
|
|
245
245
|
min: r.min,
|
|
246
246
|
max: r.max,
|
|
247
247
|
disabled: r.isDisabled,
|
|
248
248
|
value: u.value
|
|
249
249
|
}, r.$attrs, {
|
|
250
250
|
ref_key: "inputElement",
|
|
251
|
-
ref:
|
|
251
|
+
ref: s,
|
|
252
252
|
onInput: B,
|
|
253
253
|
onChange: S
|
|
254
254
|
}), null, 16, Pe),
|
|
@@ -279,49 +279,51 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
279
279
|
size: "xs",
|
|
280
280
|
name: "eyedropper"
|
|
281
281
|
})
|
|
282
|
-
], 8, Te)) :
|
|
282
|
+
], 8, Te)) : f("", !0)
|
|
283
283
|
], 64)) : r.icon ? (a(), i("span", {
|
|
284
284
|
key: 1,
|
|
285
285
|
class: b(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", d(V)])
|
|
286
286
|
}, [
|
|
287
287
|
k(w, { name: r.icon }, null, 8, ["name"])
|
|
288
|
-
], 2)) :
|
|
288
|
+
], 2)) : f("", !0)
|
|
289
289
|
], 2));
|
|
290
290
|
}
|
|
291
291
|
}), Ae = { class: "inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20" }, Ne = ["id", "for"], je = {
|
|
292
292
|
key: 0,
|
|
293
293
|
class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
|
|
294
|
-
}, xt = /* @__PURE__ */
|
|
294
|
+
}, xt = /* @__PURE__ */ $({
|
|
295
295
|
__name: "Label",
|
|
296
296
|
props: {
|
|
297
297
|
id: {},
|
|
298
298
|
label: {},
|
|
299
299
|
description: {}
|
|
300
300
|
},
|
|
301
|
-
setup(
|
|
301
|
+
setup(l) {
|
|
302
302
|
return (n, e) => (a(), i("span", Ae, [
|
|
303
303
|
c("label", {
|
|
304
304
|
id: n.id ? `${n.id}-label` : void 0,
|
|
305
305
|
for: n.id
|
|
306
306
|
}, g(n.label), 9, Ne),
|
|
307
|
-
n.description ? (a(), i("span", je, g(n.description), 1)) :
|
|
307
|
+
n.description ? (a(), i("span", je, g(n.description), 1)) : f("", !0)
|
|
308
308
|
]));
|
|
309
309
|
}
|
|
310
310
|
}), Ue = {
|
|
311
311
|
key: 0,
|
|
312
312
|
class: "sr-only"
|
|
313
|
-
}, $t = /* @__PURE__ */
|
|
313
|
+
}, $t = /* @__PURE__ */ $({
|
|
314
314
|
__name: "MenuContainer",
|
|
315
315
|
props: {
|
|
316
316
|
position: { default: "left" },
|
|
317
317
|
usePortal: { type: [Boolean, String], default: !1 },
|
|
318
318
|
label: { default: "Open menu" }
|
|
319
319
|
},
|
|
320
|
-
setup(
|
|
321
|
-
const n =
|
|
320
|
+
setup(l) {
|
|
321
|
+
const n = l, e = (o = []) => o.some(
|
|
322
322
|
(p) => typeof p.children == "string" ? p.type !== X && p.children.trim() !== "" : Array.isArray(p.children) && e(p.children)
|
|
323
|
-
), t = z(null),
|
|
323
|
+
), t = z(null), s = z(null), u = n.position === "left" ? "bottom-end" : "bottom-start", { floatingStyles: v } = ke(t, s, {
|
|
324
324
|
placement: u,
|
|
325
|
+
// left/top instead of a transform, so the transition's translate isn't overridden
|
|
326
|
+
transform: !1,
|
|
325
327
|
whileElementsMounted: ve,
|
|
326
328
|
middleware: [_e(6), xe(), $e({ padding: 6 })]
|
|
327
329
|
});
|
|
@@ -329,14 +331,14 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
329
331
|
as: "div",
|
|
330
332
|
class: "inline-block text-left"
|
|
331
333
|
}, {
|
|
332
|
-
default:
|
|
334
|
+
default: x(({ open: _ }) => [
|
|
333
335
|
k(d(ce), {
|
|
334
336
|
class: "focus:outline-none",
|
|
335
337
|
ref_key: "reference",
|
|
336
338
|
ref: t
|
|
337
339
|
}, {
|
|
338
|
-
default:
|
|
339
|
-
var
|
|
340
|
+
default: x(() => {
|
|
341
|
+
var V, y;
|
|
340
342
|
return [
|
|
341
343
|
T(o.$slots, "button", {}, () => [
|
|
342
344
|
k(d(w), {
|
|
@@ -344,7 +346,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
344
346
|
name: "ellipsis-h"
|
|
345
347
|
})
|
|
346
348
|
]),
|
|
347
|
-
e((
|
|
349
|
+
e((y = (V = o.$slots).button) == null ? void 0 : y.call(V)) ? f("", !0) : (a(), i("span", Ue, g(o.label), 1))
|
|
348
350
|
];
|
|
349
351
|
}),
|
|
350
352
|
_: 3
|
|
@@ -353,35 +355,37 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
353
355
|
to: typeof o.usePortal == "string" ? o.usePortal : "body",
|
|
354
356
|
disabled: !o.usePortal
|
|
355
357
|
}, [
|
|
356
|
-
|
|
357
|
-
class: "
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
358
|
+
k(O, {
|
|
359
|
+
"enter-active-class": "transition duration-200 ease-in-out",
|
|
360
|
+
"enter-from-class": "transform -translate-y-4 opacity-0",
|
|
361
|
+
"enter-to-class": "transform opacity-100",
|
|
362
|
+
"leave-active-class": "transition duration-100 ease-in-out",
|
|
363
|
+
"leave-from-class": "transform opacity-100",
|
|
364
|
+
"leave-to-class": "transform -translate-y-2 opacity-0"
|
|
365
|
+
}, {
|
|
366
|
+
default: x(() => [
|
|
367
|
+
_ ? (a(), i("div", {
|
|
368
|
+
key: 0,
|
|
369
|
+
class: "w-56 z-20",
|
|
370
|
+
style: F(d(v)),
|
|
371
|
+
ref_key: "floating",
|
|
372
|
+
ref: s
|
|
373
|
+
}, [
|
|
374
|
+
k(d(me), {
|
|
375
|
+
static: "",
|
|
372
376
|
class: b([
|
|
373
377
|
"z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"
|
|
374
378
|
])
|
|
375
379
|
}, {
|
|
376
|
-
default:
|
|
380
|
+
default: x(() => [
|
|
377
381
|
T(o.$slots, "default")
|
|
378
382
|
]),
|
|
379
383
|
_: 3
|
|
380
384
|
})
|
|
381
|
-
]),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
+
], 4)) : f("", !0)
|
|
386
|
+
]),
|
|
387
|
+
_: 2
|
|
388
|
+
}, 1024)
|
|
385
389
|
], 8, ["to", "disabled"]))
|
|
386
390
|
]),
|
|
387
391
|
_: 3
|
|
@@ -390,7 +394,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
390
394
|
}), Fe = {
|
|
391
395
|
key: 0,
|
|
392
396
|
class: "bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"
|
|
393
|
-
}, wt = /* @__PURE__ */
|
|
397
|
+
}, wt = /* @__PURE__ */ $({
|
|
394
398
|
__name: "MenuLink",
|
|
395
399
|
props: {
|
|
396
400
|
label: {},
|
|
@@ -398,18 +402,18 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
398
402
|
disabled: { type: Boolean },
|
|
399
403
|
as: {}
|
|
400
404
|
},
|
|
401
|
-
setup(
|
|
402
|
-
return (n, e) => (a(), C(d(
|
|
403
|
-
default:
|
|
405
|
+
setup(l) {
|
|
406
|
+
return (n, e) => (a(), C(d(fe), Y(Z({ disabled: n.disabled })), {
|
|
407
|
+
default: x(({ active: t }) => [
|
|
404
408
|
(a(), C(ee(n.as || "span"), {
|
|
405
409
|
class: b(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
|
|
406
410
|
t ? "bg-grey-200" : "",
|
|
407
411
|
n.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
|
|
408
412
|
]])
|
|
409
413
|
}, {
|
|
410
|
-
default:
|
|
414
|
+
default: x(() => [
|
|
411
415
|
c("span", null, g(n.label), 1),
|
|
412
|
-
n.meta ? (a(), i("span", Fe, g(n.meta), 1)) :
|
|
416
|
+
n.meta ? (a(), i("span", Fe, g(n.meta), 1)) : f("", !0)
|
|
413
417
|
]),
|
|
414
418
|
_: 2
|
|
415
419
|
}, 1032, ["class"]))
|
|
@@ -429,7 +433,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
429
433
|
}, Ke = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" }, qe = { class: "absolute right-2 inset-y-0 flex items-center" }, Je = {
|
|
430
434
|
key: 0,
|
|
431
435
|
class: "bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"
|
|
432
|
-
}, Ct = /* @__PURE__ */
|
|
436
|
+
}, Ct = /* @__PURE__ */ $({
|
|
433
437
|
__name: "Select",
|
|
434
438
|
props: {
|
|
435
439
|
id: {},
|
|
@@ -443,54 +447,54 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
443
447
|
by: {}
|
|
444
448
|
},
|
|
445
449
|
emits: ["update:modelValue"],
|
|
446
|
-
setup(
|
|
447
|
-
const e =
|
|
448
|
-
|
|
450
|
+
setup(l, { emit: n }) {
|
|
451
|
+
const e = l, t = z(e.modelValue ?? null), s = n, u = (m) => typeof e.by == "string" ? m[e.by] : m.id, { inputClasses: v, disabledClasses: o, textSizeClasses: p } = A(e), _ = z(!1), V = () => {
|
|
452
|
+
_.value = !!e.id && !!document.getElementById(`${e.id}-label`);
|
|
449
453
|
};
|
|
450
454
|
R(V), I(() => e.id, V, { flush: "post" });
|
|
451
|
-
const
|
|
452
|
-
() =>
|
|
455
|
+
const y = D(
|
|
456
|
+
() => _.value ? `${e.id}-label ${e.id}` : void 0
|
|
453
457
|
);
|
|
454
458
|
I(
|
|
455
459
|
() => e.modelValue,
|
|
456
|
-
(
|
|
457
|
-
t.value =
|
|
460
|
+
(m) => {
|
|
461
|
+
t.value = m ?? null;
|
|
458
462
|
}
|
|
459
463
|
);
|
|
460
|
-
const M = (
|
|
461
|
-
t.value =
|
|
464
|
+
const M = (m) => {
|
|
465
|
+
t.value = m, s("update:modelValue", m);
|
|
462
466
|
};
|
|
463
|
-
return (
|
|
467
|
+
return (m, N) => (a(), C(d(pe), {
|
|
464
468
|
as: "div",
|
|
465
469
|
"model-value": t.value,
|
|
466
470
|
"onUpdate:modelValue": M,
|
|
467
|
-
by:
|
|
468
|
-
disabled:
|
|
471
|
+
by: m.by,
|
|
472
|
+
disabled: m.isDisabled
|
|
469
473
|
}, {
|
|
470
|
-
default:
|
|
474
|
+
default: x(() => [
|
|
471
475
|
c("div", Oe, [
|
|
472
476
|
k(d(be), {
|
|
473
|
-
id:
|
|
474
|
-
"aria-labelledby":
|
|
477
|
+
id: m.id,
|
|
478
|
+
"aria-labelledby": y.value,
|
|
475
479
|
class: b(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [d(v), d(p), d(o)]])
|
|
476
480
|
}, {
|
|
477
|
-
default:
|
|
481
|
+
default: x(() => {
|
|
478
482
|
var h;
|
|
479
483
|
return [
|
|
480
|
-
|
|
484
|
+
m.icon ? (a(), i("span", Re, [
|
|
481
485
|
k(w, {
|
|
482
|
-
name: ((h = t.value) == null ? void 0 : h.icon) ??
|
|
486
|
+
name: ((h = t.value) == null ? void 0 : h.icon) ?? m.icon
|
|
483
487
|
}, null, 8, ["name"])
|
|
484
|
-
])) :
|
|
488
|
+
])) : f("", !0),
|
|
485
489
|
t.value ? (a(), i("span", Ge, [
|
|
486
|
-
T(
|
|
490
|
+
T(m.$slots, "option", {
|
|
487
491
|
option: t.value,
|
|
488
492
|
active: !1,
|
|
489
493
|
selected: !0
|
|
490
494
|
}, () => [
|
|
491
495
|
j(g(t.value.label), 1)
|
|
492
496
|
])
|
|
493
|
-
])) : (a(), i("span", He, g(
|
|
497
|
+
])) : (a(), i("span", He, g(m.placeholder), 1)),
|
|
494
498
|
c("span", Ke, [
|
|
495
499
|
k(w, {
|
|
496
500
|
class: "text-grey-400",
|
|
@@ -507,16 +511,16 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
507
511
|
"leave-from-class": "opacity-100",
|
|
508
512
|
"leave-to-class": "opacity-0"
|
|
509
513
|
}, {
|
|
510
|
-
default:
|
|
514
|
+
default: x(() => [
|
|
511
515
|
k(d(ge), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
|
|
512
|
-
default:
|
|
513
|
-
(a(!0), i(E, null, G(
|
|
516
|
+
default: x(() => [
|
|
517
|
+
(a(!0), i(E, null, G(m.options, (h) => (a(), C(d(ye), {
|
|
514
518
|
as: "template",
|
|
515
519
|
key: u(h),
|
|
516
520
|
value: h,
|
|
517
521
|
disabled: h.disabled
|
|
518
522
|
}, {
|
|
519
|
-
default:
|
|
523
|
+
default: x(({ active: B, selected: S }) => [
|
|
520
524
|
c("li", {
|
|
521
525
|
class: b([
|
|
522
526
|
B ? "text-white bg-blue-500" : "text-grey-900 dark:text-grey-50",
|
|
@@ -525,7 +529,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
525
529
|
])
|
|
526
530
|
}, [
|
|
527
531
|
c("div", qe, [
|
|
528
|
-
h.disabled &&
|
|
532
|
+
h.disabled && m.disabledBadge ? (a(), i("span", Je, g(m.disabledBadge), 1)) : f("", !0)
|
|
529
533
|
]),
|
|
530
534
|
c("span", {
|
|
531
535
|
class: b([
|
|
@@ -537,8 +541,8 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
537
541
|
key: 0,
|
|
538
542
|
class: "inline-block mr-1",
|
|
539
543
|
name: h.icon
|
|
540
|
-
}, null, 8, ["name"])) :
|
|
541
|
-
T(
|
|
544
|
+
}, null, 8, ["name"])) : f("", !0),
|
|
545
|
+
T(m.$slots, "option", {
|
|
542
546
|
option: h,
|
|
543
547
|
active: B,
|
|
544
548
|
selected: S
|
|
@@ -558,7 +562,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
558
562
|
class: "h-5 w-5",
|
|
559
563
|
"aria-hidden": "true"
|
|
560
564
|
})
|
|
561
|
-
], 2)) :
|
|
565
|
+
], 2)) : f("", !0)
|
|
562
566
|
], 2)
|
|
563
567
|
]),
|
|
564
568
|
_: 2
|
|
@@ -586,7 +590,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
586
590
|
}, et = {
|
|
587
591
|
key: 1,
|
|
588
592
|
class: "w-1/3 h-10 mt-6 bg-current rounded-lg"
|
|
589
|
-
}, Vt = /* @__PURE__ */
|
|
593
|
+
}, Vt = /* @__PURE__ */ $({
|
|
590
594
|
__name: "Skeleton",
|
|
591
595
|
props: {
|
|
592
596
|
avatar: { type: Boolean, default: !1 },
|
|
@@ -594,25 +598,24 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
594
598
|
lines: { default: 3 },
|
|
595
599
|
footer: { type: Boolean, default: !1 }
|
|
596
600
|
},
|
|
597
|
-
setup(
|
|
598
|
-
const n =
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
return (t, l) => (a(), i("div", Qe, [
|
|
601
|
+
setup(l) {
|
|
602
|
+
const n = l, e = ["mr-4", "mr-5", "mr-6", "mr-8", "mr-10", "mr-16", "mr-24", "mr-32"], t = D(
|
|
603
|
+
() => Array.from({ length: Math.max(0, Math.floor(n.lines)) }, () => ({
|
|
604
|
+
margin: e[Math.floor(Math.random() * e.length)]
|
|
605
|
+
}))
|
|
606
|
+
);
|
|
607
|
+
return (s, u) => (a(), i("div", Qe, [
|
|
605
608
|
c("div", We, [
|
|
606
|
-
|
|
607
|
-
|
|
609
|
+
s.avatar ? (a(), i("div", Xe)) : f("", !0),
|
|
610
|
+
s.title ? (a(), i("div", Ye)) : f("", !0)
|
|
608
611
|
]),
|
|
609
|
-
t.
|
|
610
|
-
(a(!0), i(E, null, G(
|
|
611
|
-
class: b(["h-4 bg-current rounded-lg",
|
|
612
|
-
key:
|
|
612
|
+
t.value.length > 0 ? (a(), i("div", Ze, [
|
|
613
|
+
(a(!0), i(E, null, G(t.value, (v, o) => (a(), i("div", {
|
|
614
|
+
class: b(["h-4 bg-current rounded-lg", v.margin]),
|
|
615
|
+
key: o
|
|
613
616
|
}, null, 2))), 128))
|
|
614
|
-
])) :
|
|
615
|
-
|
|
617
|
+
])) : f("", !0),
|
|
618
|
+
s.footer ? (a(), i("div", et)) : f("", !0)
|
|
616
619
|
]));
|
|
617
620
|
}
|
|
618
621
|
}), tt = {
|
|
@@ -620,18 +623,18 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
620
623
|
class: "inline-flex align-[-0.125em]"
|
|
621
624
|
}, st = { class: "sr-only" }, lt = {
|
|
622
625
|
inheritAttrs: !1
|
|
623
|
-
}, Dt = /* @__PURE__ */
|
|
626
|
+
}, Dt = /* @__PURE__ */ $({
|
|
624
627
|
...lt,
|
|
625
628
|
__name: "Spinner",
|
|
626
629
|
props: {
|
|
627
630
|
label: { default: "Loading" }
|
|
628
631
|
},
|
|
629
|
-
setup(
|
|
632
|
+
setup(l) {
|
|
630
633
|
const n = z(!1);
|
|
631
634
|
let e;
|
|
632
635
|
return R(() => {
|
|
633
636
|
e = setTimeout(() => n.value = !0, 100);
|
|
634
|
-
}), te(() => clearTimeout(e)), (t,
|
|
637
|
+
}), te(() => clearTimeout(e)), (t, s) => (a(), i("span", tt, [
|
|
635
638
|
k(d(w), P({
|
|
636
639
|
class: "animate-spin",
|
|
637
640
|
name: "circle-notch"
|
|
@@ -639,7 +642,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
639
642
|
c("span", st, g(n.value ? t.label : ""), 1)
|
|
640
643
|
]));
|
|
641
644
|
}
|
|
642
|
-
}), ot = { class: "sr-only" }, zt = /* @__PURE__ */
|
|
645
|
+
}), ot = { class: "sr-only" }, zt = /* @__PURE__ */ $({
|
|
643
646
|
__name: "Switch",
|
|
644
647
|
props: {
|
|
645
648
|
id: { default: () => H() },
|
|
@@ -649,23 +652,23 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
649
652
|
offLabel: { default: "off" }
|
|
650
653
|
},
|
|
651
654
|
emits: ["update:modelValue", "change"],
|
|
652
|
-
setup(
|
|
653
|
-
const e = n, t = (
|
|
654
|
-
e("update:modelValue",
|
|
655
|
+
setup(l, { emit: n }) {
|
|
656
|
+
const e = n, t = (s) => {
|
|
657
|
+
e("update:modelValue", s), e("change", s);
|
|
655
658
|
};
|
|
656
|
-
return (
|
|
657
|
-
id:
|
|
658
|
-
modelValue:
|
|
659
|
-
class: b([
|
|
659
|
+
return (s, u) => (a(), C(d(he), {
|
|
660
|
+
id: s.id,
|
|
661
|
+
modelValue: s.modelValue,
|
|
662
|
+
class: b([s.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),
|
|
660
663
|
"onUpdate:modelValue": t
|
|
661
664
|
}, {
|
|
662
|
-
default:
|
|
665
|
+
default: x(() => [
|
|
663
666
|
c("span", {
|
|
664
|
-
class: b(["absolute text-xs text-center text-white inset-x-2",
|
|
665
|
-
}, g(
|
|
666
|
-
c("span", ot, g(
|
|
667
|
+
class: b(["absolute text-xs text-center text-white inset-x-2", s.modelValue ? "pr-3" : "pl-3"])
|
|
668
|
+
}, g(s.modelValue === !0 ? s.onLabel : s.offLabel), 3),
|
|
669
|
+
c("span", ot, g(s.label), 1),
|
|
667
670
|
c("span", {
|
|
668
|
-
class: b([
|
|
671
|
+
class: b([s.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
|
|
669
672
|
}, null, 2)
|
|
670
673
|
]),
|
|
671
674
|
_: 1
|
|
@@ -673,7 +676,7 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
673
676
|
}
|
|
674
677
|
}), at = { class: "relative" }, nt = ["disabled", "value"], rt = {
|
|
675
678
|
inheritAttrs: !1
|
|
676
|
-
}, Bt = /* @__PURE__ */
|
|
679
|
+
}, Bt = /* @__PURE__ */ $({
|
|
677
680
|
...rt,
|
|
678
681
|
__name: "Textarea",
|
|
679
682
|
props: {
|
|
@@ -683,22 +686,22 @@ const Pe = ["placeholder", "type", "min", "max", "disabled", "value"], Me = { cl
|
|
|
683
686
|
block: { type: Boolean }
|
|
684
687
|
},
|
|
685
688
|
emits: ["update:modelValue"],
|
|
686
|
-
setup(
|
|
687
|
-
const t =
|
|
688
|
-
|
|
689
|
-
},
|
|
689
|
+
setup(l, { expose: n, emit: e }) {
|
|
690
|
+
const t = l, s = e, { inputClasses: u, disabledClasses: v, textSizeClasses: o } = A(t), p = function(y) {
|
|
691
|
+
s("update:modelValue", (y == null ? void 0 : y.target).value);
|
|
692
|
+
}, _ = z(null);
|
|
690
693
|
return n({
|
|
691
694
|
focus: () => {
|
|
692
|
-
t.isDisabled ||
|
|
695
|
+
t.isDisabled || _.value.focus();
|
|
693
696
|
}
|
|
694
|
-
}), (
|
|
697
|
+
}), (y, M) => (a(), i("div", at, [
|
|
695
698
|
c("textarea", P({
|
|
696
699
|
class: ["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(u), d(o), d(v)]],
|
|
697
|
-
disabled:
|
|
698
|
-
value:
|
|
699
|
-
},
|
|
700
|
+
disabled: y.isDisabled,
|
|
701
|
+
value: y.modelValue ?? ""
|
|
702
|
+
}, y.$attrs, {
|
|
700
703
|
ref_key: "input",
|
|
701
|
-
ref:
|
|
704
|
+
ref: _,
|
|
702
705
|
cols: "56",
|
|
703
706
|
rows: "8",
|
|
704
707
|
onInput: p
|
package/dist/src/ui.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@fortawesome/fontawesome-svg-core"),require("@fortawesome/vue-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("uuid"),require("@vueuse/core"),require("@headlessui/vue"),require("@floating-ui/vue")):typeof define=="function"&&define.amd?define(["exports","vue","@fortawesome/fontawesome-svg-core","@fortawesome/vue-fontawesome","@fortawesome/free-solid-svg-icons","uuid","@vueuse/core","@headlessui/vue","@floating-ui/vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.ui={},i.Vue,i.fontawesomeSvgCore,i.vueFontawesome,i.freeSolidSvgIcons,i.uuid,i.VueUse,i.HeadlessUIVue,i.FloatingUIVue))})(this,function(i,e,N,$,_,E,S,y,V){"use strict";const D=[_.faCheck,_.faChevronDown,_.faCircleNotch,_.faEllipsis,_.faEyeDropper];N.library.add(...D);const L=D.map(({iconName:n})=>n),P=[],b=e.defineComponent({__name:"Icon",props:{name:{default:"user"}},setup(n){const s=n,t=e.computed(()=>{const o=s.name,l=N.findIconDefinition({prefix:"fab",iconName:o})??N.findIconDefinition({prefix:"fas",iconName:o});return l||console.warn("could not load icon, because it is not available",s.name),l});return(o,l)=>t.value?(e.openBlock(),e.createBlock(e.unref($.FontAwesomeIcon),e.mergeProps({key:0,icon:t.value},o.$attrs),null,16,["icon"])):e.createCommentVNode("",!0)}}),M=["aria-label","disabled","aria-disabled","aria-busy"],I={key:0,class:"absolute inset-0 flex items-center justify-center"},T=e.defineComponent({__name:"Button",props:{label:{},size:{default:"medium"},color:{default:"primary"},isLoading:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},icon:{},iconPosition:{default:"right"}},emits:["click"],setup(n,{emit:s}){const t=n,o=s,l=e.computed(()=>{const a={"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900":t.color==="primary","text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900":t.color==="light","text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900":t.color==="dark","text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900":t.color==="danger"},m={"pointer-events-none opacity-75 cursor-not-allowed":t.isDisabled,"cursor-default":t.isLoading},f={"px-4 py-1 text-xs leading-5 mono-100 rounded-lg":t.size==="small","px-5 py-2 text-sm leading-4 font-medium rounded-lg":t.size==="medium","px-8 py-3 text-base leading-6 font-medium rounded-lg":t.size==="large"};return{...a,...m,...f}}),c=e.computed(()=>{const a={"mr-2 -ml-1":["small","medium"].includes(t.size)&&t.iconPosition==="left","mr-4 -ml-2":["large"].includes(t.size)&&t.iconPosition==="left"},m={"ml-3 -mr-1":["small","medium"].includes(t.size)&&t.iconPosition==="right","ml-3 -mr-3":["large"].includes(t.size)&&t.iconPosition==="right"},f={"text-white":t.color==="primary","text-blue-600":t.color==="light","text-grey-50":t.color==="dark"};return{...a,...m,...f}});function u(a){if(t.isLoading){a.preventDefault();return}o("click",a)}return(a,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",l.value]),type:"button","aria-label":a.label,disabled:a.isDisabled,"aria-disabled":a.isLoading||void 0,"aria-busy":a.isLoading,onClick:u},[e.createElementVNode("div",{class:e.normalizeClass(!a.isLoading||"invisible")},[a.icon&&a.iconPosition==="left"?(e.openBlock(),e.createBlock(b,{key:0,name:a.icon,class:e.normalizeClass(c.value)},null,8,["name","class"])):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.label),1),a.icon&&a.iconPosition==="right"?(e.openBlock(),e.createBlock(b,{key:1,name:a.icon,class:e.normalizeClass(c.value)},null,8,["name","class"])):e.createCommentVNode("",!0)],2),a.isLoading?(e.openBlock(),e.createElementBlock("span",I,[e.createVNode(b,{class:"animate-spin",name:"circle-notch"})])):e.createCommentVNode("",!0)],10,M))}}),j={class:"relative flex items-start"},q=["checked","id"],A={class:"ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed"},F=["for"],U={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},O={inheritAttrs:!1},R=e.defineComponent({...O,__name:"Checkbox",props:{id:{default:()=>E.v4()},label:{},modelValue:{type:Boolean},description:{}},emits:["update:modelValue"],setup(n,{emit:s}){const t=s,o=l=>{t("update:modelValue",l.target.checked)};return(l,c)=>(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("input",e.mergeProps({class:"peer mt-0.5 h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"checkbox",checked:l.modelValue,onChange:o,id:l.id},l.$attrs),null,16,q),e.createElementVNode("div",A,[e.createElementVNode("label",{for:l.id,class:"font-medium text-grey-700 dark:text-grey-200 casual-25"},e.toDisplayString(l.label),9,F),l.description?(e.openBlock(),e.createElementBlock("p",U,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))}});function x(n){const s=e.computed(()=>({"pl-3 pr-10 py-2":!n.icon&&n.type!=="color"&&n.size==="small","pl-4 pr-10 py-3":!n.icon&&n.type!=="color"&&n.size==="medium","pl-6 pr-10 py-3":!n.icon&&n.type!=="color"&&n.size==="large","pl-10 pr-10 py-1":(n.icon||n.type==="color")&&n.size==="small","pl-12 pr-10 py-3":(n.icon||n.type==="color")&&(n.size==="medium"||n.size==="large"),"w-full block":n.block===!0})),t=e.computed(()=>({"pointer-events-none opacity-50 cursor-not-allowed":n.isDisabled})),o=e.computed(()=>({"text-xs leading-4":n.size==="small","text-sm leading-4":n.size==="medium","text-base leading-5":n.size==="large"}));return{inputClasses:s,disabledClasses:t,textSizeClasses:o}}const H=["placeholder","type","min","max","disabled","value"],G={class:"absolute inset-y-2 left-2 w-8 cursor-pointer"},K=["disabled"],J=["disabled"],Q={inheritAttrs:!1},W=e.defineComponent({...Q,__name:"Input",props:{modelValue:{},type:{default:"text"},placeholder:{},size:{default:"medium"},icon:{},min:{},max:{},isDisabled:{type:Boolean,default:!1},block:{type:Boolean},showColorPicker:{type:Boolean}},emits:["update:modelValue"],setup(n,{expose:s,emit:t}){const o=n,l=e.ref(null),c=e.ref(o.modelValue??""),u=r=>o.type==="number"&&r!==""&&r!==null?Number(r):r;e.watch(()=>o.modelValue,r=>{typeof r<"u"&&r!==u(c.value)&&(c.value=r)});const a=t,{inputClasses:m,disabledClasses:f,textSizeClasses:k}=x(o),g=e.computed(()=>o.type==="color"?"text":o.type),{isSupported:w,open:d,sRGBHex:z}=S.useEyeDropper(),p=()=>{d()};e.watch(z,r=>{c.value=r,a("update:modelValue",r)});const h=function(r){c.value=(r==null?void 0:r.target).value,a("update:modelValue",u(c.value))},C=function(){const r=u(c.value);if(typeof r!="number")return;const B=Math.min(Math.max(r,o.min??-1/0),o.max??1/0);B!==r&&(c.value=B,a("update:modelValue",B))};return s({focus:()=>{var r;o.isDisabled||(r=l.value)==null||r.focus()}}),(r,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative",[r.block?"w-full block":"inline-block"]])},[e.createElementVNode("input",e.mergeProps({class:["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(m),e.unref(k),e.unref(f)]],placeholder:r.placeholder,type:g.value,min:r.min,max:r.max,disabled:r.isDisabled,value:c.value},r.$attrs,{ref_key:"inputElement",ref:l,onInput:h,onChange:C}),null,16,H),r.type==="color"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",G,[e.withDirectives(e.createElementVNode("input",{class:"invisible",type:"color",disabled:r.isDisabled,"onUpdate:modelValue":B[0]||(B[0]=ze=>c.value=ze),onInput:h},null,40,K),[[e.vModelText,c.value]]),e.createElementVNode("span",{class:"border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",style:e.normalizeStyle(`background-color: ${c.value}`)},null,4)]),e.unref(w)&&r.showColorPicker?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",disabled:r.isDisabled,onClick:p},[e.createVNode(b,{size:"xs",name:"eyedropper"})],8,J)):e.createCommentVNode("",!0)],64)):r.icon?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4",e.unref(k)])},[e.createVNode(b,{name:r.icon},null,8,["name"])],2)):e.createCommentVNode("",!0)],2))}}),X={class:"inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20"},Y=["id","for"],Z={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},v=e.defineComponent({__name:"Label",props:{id:{},label:{},description:{}},setup(n){return(s,t)=>(e.openBlock(),e.createElementBlock("span",X,[e.createElementVNode("label",{id:s.id?`${s.id}-label`:void 0,for:s.id},e.toDisplayString(s.label),9,Y),s.description?(e.openBlock(),e.createElementBlock("span",Z,e.toDisplayString(s.description),1)):e.createCommentVNode("",!0)]))}}),ee={key:0,class:"sr-only"},te=e.defineComponent({__name:"MenuContainer",props:{position:{default:"left"},usePortal:{type:[Boolean,String],default:!1},label:{default:"Open menu"}},setup(n){const s=n,t=(a=[])=>a.some(m=>typeof m.children=="string"?m.type!==e.Comment&&m.children.trim()!=="":Array.isArray(m.children)&&t(m.children)),o=e.ref(null),l=e.ref(null),c=s.position==="left"?"bottom-end":"bottom-start",{floatingStyles:u}=V.useFloating(o,l,{placement:c,whileElementsMounted:V.autoUpdate,middleware:[V.offset(6),V.flip(),V.shift({padding:6})]});return(a,m)=>(e.openBlock(),e.createBlock(e.unref(y.Menu),{as:"div",class:"inline-block text-left"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.MenuButton),{class:"focus:outline-none",ref_key:"reference",ref:o},{default:e.withCtx(()=>{var f,k;return[e.renderSlot(a.$slots,"button",{},()=>[e.createVNode(e.unref(b),{class:"fill-current",name:"ellipsis-h"})]),t((k=(f=a.$slots).button)==null?void 0:k.call(f))?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(a.label),1))]}),_:3},512),(e.openBlock(),e.createBlock(e.Teleport,{to:typeof a.usePortal=="string"?a.usePortal:"body",disabled:!a.usePortal},[e.createElementVNode("div",{class:"w-56 z-20",style:e.normalizeStyle(e.unref(u)),ref_key:"floating",ref:l},[e.createVNode(e.Transition,{"enter-active-class":"transition duration-200 ease-in-out","enter-from-class":"transform -translate-y-4 opacity-0","enter-to-class":"transform opacity-100","leave-active-class":"transition duration-100 ease-in-out","leave-from-class":"transform opacity-100","leave-to-class":"transform -translate-y-2 opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.MenuItems),{class:e.normalizeClass(["z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"])},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3})],4)],8,["to","disabled"]))]),_:3}))}}),oe={key:0,class:"bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"},ne=e.defineComponent({__name:"MenuLink",props:{label:{},meta:{},disabled:{type:Boolean},as:{}},setup(n){return(s,t)=>(e.openBlock(),e.createBlock(e.unref(y.MenuItem),e.normalizeProps(e.guardReactiveProps({disabled:s.disabled})),{default:e.withCtx(({active:o})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.as||"span"),{class:e.normalizeClass(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg",[o?"bg-grey-200":"",s.disabled?"opacity-50 pointer-events-none":"hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"]])},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(s.label),1),s.meta?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(s.meta),1)):e.createCommentVNode("",!0)]),_:2},1032,["class"]))]),_:1},16))}}),le={class:"relative"},ae={key:0,class:"absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},se={key:1,class:"block truncate"},re={key:2,class:"text-grey-500 truncate"},ie={class:"absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},ce={class:"absolute right-2 inset-y-0 flex items-center"},de={key:0,class:"bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"},me=e.defineComponent({__name:"Select",props:{id:{},modelValue:{},size:{default:"medium"},icon:{},placeholder:{},isDisabled:{type:Boolean,default:!1},options:{},disabledBadge:{},by:{}},emits:["update:modelValue"],setup(n,{emit:s}){const t=n,o=e.ref(t.modelValue??null),l=s,c=d=>typeof t.by=="string"?d[t.by]:d.id,{inputClasses:u,disabledClasses:a,textSizeClasses:m}=x(t),f=e.ref(!1),k=()=>{f.value=!!t.id&&!!document.getElementById(`${t.id}-label`)};e.onMounted(k),e.watch(()=>t.id,k,{flush:"post"});const g=e.computed(()=>f.value?`${t.id}-label ${t.id}`:void 0);e.watch(()=>t.modelValue,d=>{o.value=d??null});const w=d=>{o.value=d,l("update:modelValue",d)};return(d,z)=>(e.openBlock(),e.createBlock(e.unref(y.Listbox),{as:"div","model-value":o.value,"onUpdate:modelValue":w,by:d.by,disabled:d.isDisabled},{default:e.withCtx(()=>[e.createElementVNode("div",le,[e.createVNode(e.unref(y.ListboxButton),{id:d.id,"aria-labelledby":g.value,class:e.normalizeClass(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left",[e.unref(u),e.unref(m),e.unref(a)]])},{default:e.withCtx(()=>{var p;return[d.icon?(e.openBlock(),e.createElementBlock("span",ae,[e.createVNode(b,{name:((p=o.value)==null?void 0:p.icon)??d.icon},null,8,["name"])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("span",se,[e.renderSlot(d.$slots,"option",{option:o.value,active:!1,selected:!0},()=>[e.createTextVNode(e.toDisplayString(o.value.label),1)])])):(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(d.placeholder),1)),e.createElementVNode("span",ie,[e.createVNode(b,{class:"text-grey-400",name:"chevron-down","aria-hidden":"true"})])]}),_:3},8,["id","aria-labelledby","class"]),e.createVNode(e.Transition,{"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.ListboxOptions),{class:"absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options,p=>(e.openBlock(),e.createBlock(e.unref(y.ListboxOption),{as:"template",key:c(p),value:p,disabled:p.disabled},{default:e.withCtx(({active:h,selected:C})=>[e.createElementVNode("li",{class:e.normalizeClass([h?"text-white bg-blue-500":"text-grey-900 dark:text-grey-50","cursor-default select-none relative py-2 pl-3 pr-12",{"opacity-50 bg-grey-100":p.disabled}])},[e.createElementVNode("div",ce,[p.disabled&&d.disabledBadge?(e.openBlock(),e.createElementBlock("span",de,e.toDisplayString(d.disabledBadge),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",{class:e.normalizeClass([C?"font-semibold":"font-normal","block truncate"])},[p.icon?(e.openBlock(),e.createBlock(b,{key:0,class:"inline-block mr-1",name:p.icon},null,8,["name"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"option",{option:p,active:h,selected:C},()=>[e.createTextVNode(e.toDisplayString(p.label),1)])],2),C?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([h?"text-blue-100":"text-blue-500","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(b,{name:"check",class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]),_:2},1032,["value","disabled"]))),128))]),_:3})]),_:3})])]),_:3},8,["model-value","by","disabled"]))}}),fe={class:"animate-pulse"},pe={class:"flex items-center justify-between space-x-4"},ue={key:0,class:"w-12 h-12 bg-current rounded-full shrink-0"},be={key:1,class:"w-full h-8 bg-current rounded-lg"},ge={key:0,class:"mt-6 space-y-2"},ye={key:1,class:"w-1/3 h-10 mt-6 bg-current rounded-lg"},ke=e.defineComponent({__name:"Skeleton",props:{avatar:{type:Boolean,default:!1},title:{type:Boolean,default:!0},lines:{default:3},footer:{type:Boolean,default:!1}},setup(n){const s=n,t=new Array(s.lines).fill(void 0).map(()=>{const o=[4,5,6,8,10,16,24,32];return{margin:`mr-${o[Math.floor(Math.random()*o.length)]}`}});return(o,l)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",pe,[o.avatar?(e.openBlock(),e.createElementBlock("div",ue)):e.createCommentVNode("",!0),o.title?(e.openBlock(),e.createElementBlock("div",be)):e.createCommentVNode("",!0)]),o.lines>0?(e.openBlock(),e.createElementBlock("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t),(c,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-4 bg-current rounded-lg",c.margin]),key:u},null,2))),128))])):e.createCommentVNode("",!0),o.footer?(e.openBlock(),e.createElementBlock("div",ye)):e.createCommentVNode("",!0)]))}}),he={role:"status",class:"inline-flex align-[-0.125em]"},Be={class:"sr-only"},_e={inheritAttrs:!1},Ve=e.defineComponent({..._e,__name:"Spinner",props:{label:{default:"Loading"}},setup(n){const s=e.ref(!1);let t;return e.onMounted(()=>{t=setTimeout(()=>s.value=!0,100)}),e.onUnmounted(()=>clearTimeout(t)),(o,l)=>(e.openBlock(),e.createElementBlock("span",he,[e.createVNode(e.unref(b),e.mergeProps({class:"animate-spin",name:"circle-notch"},o.$attrs),null,16),e.createElementVNode("span",Be,e.toDisplayString(s.value?o.label:""),1)]))}}),Ce={class:"sr-only"},we=e.defineComponent({__name:"Switch",props:{id:{default:()=>E.v4()},label:{},modelValue:{type:Boolean},onLabel:{default:"on"},offLabel:{default:"off"}},emits:["update:modelValue","change"],setup(n,{emit:s}){const t=s,o=l=>{t("update:modelValue",l),t("change",l)};return(l,c)=>(e.openBlock(),e.createBlock(e.unref(y.Switch),{id:l.id,modelValue:l.modelValue,class:e.normalizeClass([l.modelValue?"bg-blue-700":"bg-grey-700","relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),"onUpdate:modelValue":o},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["absolute text-xs text-center text-white inset-x-2",l.modelValue?"pr-3":"pl-3"])},e.toDisplayString(l.modelValue===!0?l.onLabel:l.offLabel),3),e.createElementVNode("span",Ce,e.toDisplayString(l.label),1),e.createElementVNode("span",{class:e.normalizeClass([l.modelValue?"translate-x-9":"translate-x-1","inline-block w-4 h-4 transition bg-white rounded-full"])},null,2)]),_:1},8,["id","modelValue","class"]))}}),Ne={class:"relative"},xe=["disabled","value"],Ee={inheritAttrs:!1},De=e.defineComponent({...Ee,__name:"Textarea",props:{modelValue:{},size:{default:"medium"},isDisabled:{type:Boolean,default:!1},block:{type:Boolean}},emits:["update:modelValue"],setup(n,{expose:s,emit:t}){const o=n,l=t,{inputClasses:c,disabledClasses:u,textSizeClasses:a}=x(o),m=function(g){l("update:modelValue",(g==null?void 0:g.target).value)},f=e.ref(null);return s({focus:()=>{o.isDisabled||f.value.focus()}}),(g,w)=>(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("textarea",e.mergeProps({class:["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(c),e.unref(a),e.unref(u)]],disabled:g.isDisabled,value:g.modelValue??""},g.$attrs,{ref_key:"input",ref:f,cols:"56",rows:"8",onInput:m}),`
|
|
2
|
-
`,16,
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@fortawesome/fontawesome-svg-core"),require("@fortawesome/vue-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("uuid"),require("@vueuse/core"),require("@headlessui/vue"),require("@floating-ui/vue")):typeof define=="function"&&define.amd?define(["exports","vue","@fortawesome/fontawesome-svg-core","@fortawesome/vue-fontawesome","@fortawesome/free-solid-svg-icons","uuid","@vueuse/core","@headlessui/vue","@floating-ui/vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.ui={},i.Vue,i.fontawesomeSvgCore,i.vueFontawesome,i.freeSolidSvgIcons,i.uuid,i.VueUse,i.HeadlessUIVue,i.FloatingUIVue))})(this,function(i,e,x,$,_,E,S,y,V){"use strict";const D=[_.faCheck,_.faChevronDown,_.faCircleNotch,_.faEllipsis,_.faEyeDropper];x.library.add(...D);const L=D.map(({iconName:l})=>l),P=[],g=e.defineComponent({__name:"Icon",props:{name:{default:"user"}},setup(l){const s=l,t=e.computed(()=>{const o=s.name,n=x.findIconDefinition({prefix:"fab",iconName:o})??x.findIconDefinition({prefix:"fas",iconName:o});return n||console.warn("could not load icon, because it is not available",s.name),n});return(o,n)=>t.value?(e.openBlock(),e.createBlock(e.unref($.FontAwesomeIcon),e.mergeProps({key:0,icon:t.value},o.$attrs),null,16,["icon"])):e.createCommentVNode("",!0)}}),M=["aria-label","disabled","aria-disabled","aria-busy"],I={key:0,class:"absolute inset-0 flex items-center justify-center"},T=e.defineComponent({__name:"Button",props:{label:{},size:{default:"medium"},color:{default:"primary"},isLoading:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},icon:{},iconPosition:{default:"right"}},emits:["click"],setup(l,{emit:s}){const t=l,o=s,n=e.computed(()=>{const a={"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900":t.color==="primary","text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900":t.color==="light","text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900":t.color==="dark","text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900":t.color==="danger"},m={"pointer-events-none opacity-75 cursor-not-allowed":t.isDisabled,"cursor-default":t.isLoading},b={"px-4 py-1 text-xs leading-5 mono-100 rounded-lg":t.size==="small","px-5 py-2 text-sm leading-4 font-medium rounded-lg":t.size==="medium","px-8 py-3 text-base leading-6 font-medium rounded-lg":t.size==="large"};return{...a,...m,...b}}),c=e.computed(()=>{const a={"mr-2 -ml-1":["small","medium"].includes(t.size)&&t.iconPosition==="left","mr-4 -ml-2":["large"].includes(t.size)&&t.iconPosition==="left"},m={"ml-3 -mr-1":["small","medium"].includes(t.size)&&t.iconPosition==="right","ml-3 -mr-3":["large"].includes(t.size)&&t.iconPosition==="right"},b={"text-white":t.color==="primary","text-blue-600":t.color==="light","text-grey-50":t.color==="dark"};return{...a,...m,...b}});function u(a){if(t.isLoading){a.preventDefault();return}o("click",a)}return(a,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",n.value]),type:"button","aria-label":a.label,disabled:a.isDisabled,"aria-disabled":a.isLoading||void 0,"aria-busy":a.isLoading,onClick:u},[e.createElementVNode("div",{class:e.normalizeClass(!a.isLoading||"invisible")},[a.icon&&a.iconPosition==="left"?(e.openBlock(),e.createBlock(g,{key:0,name:a.icon,class:e.normalizeClass(c.value)},null,8,["name","class"])):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.label),1),a.icon&&a.iconPosition==="right"?(e.openBlock(),e.createBlock(g,{key:1,name:a.icon,class:e.normalizeClass(c.value)},null,8,["name","class"])):e.createCommentVNode("",!0)],2),a.isLoading?(e.openBlock(),e.createElementBlock("span",I,[e.createVNode(g,{class:"animate-spin",name:"circle-notch"})])):e.createCommentVNode("",!0)],10,M))}}),j={class:"relative flex items-start"},q=["checked","id"],A={class:"ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed"},F=["for"],U={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},O={inheritAttrs:!1},R=e.defineComponent({...O,__name:"Checkbox",props:{id:{default:()=>E.v4()},label:{},modelValue:{type:Boolean},description:{}},emits:["update:modelValue"],setup(l,{emit:s}){const t=s,o=n=>{t("update:modelValue",n.target.checked)};return(n,c)=>(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("input",e.mergeProps({class:"peer mt-0.5 h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"checkbox",checked:n.modelValue,onChange:o,id:n.id},n.$attrs),null,16,q),e.createElementVNode("div",A,[e.createElementVNode("label",{for:n.id,class:"font-medium text-grey-700 dark:text-grey-200 casual-25"},e.toDisplayString(n.label),9,F),n.description?(e.openBlock(),e.createElementBlock("p",U,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))}});function N(l){const s=e.computed(()=>({"pl-3 pr-10 py-2":!l.icon&&l.type!=="color"&&l.size==="small","pl-4 pr-10 py-3":!l.icon&&l.type!=="color"&&l.size==="medium","pl-6 pr-10 py-3":!l.icon&&l.type!=="color"&&l.size==="large","pl-10 pr-10 py-1":(l.icon||l.type==="color")&&l.size==="small","pl-12 pr-10 py-3":(l.icon||l.type==="color")&&(l.size==="medium"||l.size==="large"),"w-full block":l.block===!0})),t=e.computed(()=>({"pointer-events-none opacity-50 cursor-not-allowed":l.isDisabled})),o=e.computed(()=>({"text-xs leading-4":l.size==="small","text-sm leading-4":l.size==="medium","text-base leading-5":l.size==="large"}));return{inputClasses:s,disabledClasses:t,textSizeClasses:o}}const H=["placeholder","type","min","max","disabled","value"],G={class:"absolute inset-y-2 left-2 w-8 cursor-pointer"},K=["disabled"],J=["disabled"],Q={inheritAttrs:!1},W=e.defineComponent({...Q,__name:"Input",props:{modelValue:{},type:{default:"text"},placeholder:{},size:{default:"medium"},icon:{},min:{},max:{},isDisabled:{type:Boolean,default:!1},block:{type:Boolean},showColorPicker:{type:Boolean}},emits:["update:modelValue"],setup(l,{expose:s,emit:t}){const o=l,n=e.ref(null),c=e.ref(o.modelValue??""),u=r=>o.type==="number"&&r!==""&&r!==null?Number(r):r;e.watch(()=>o.modelValue,r=>{typeof r<"u"&&r!==u(c.value)&&(c.value=r)});const a=t,{inputClasses:m,disabledClasses:b,textSizeClasses:k}=N(o),f=e.computed(()=>o.type==="color"?"text":o.type),{isSupported:w,open:d,sRGBHex:z}=S.useEyeDropper(),p=()=>{d()};e.watch(z,r=>{c.value=r,a("update:modelValue",r)});const h=function(r){c.value=(r==null?void 0:r.target).value,a("update:modelValue",u(c.value))},C=function(){const r=u(c.value);if(typeof r!="number")return;const B=Math.min(Math.max(r,o.min??-1/0),o.max??1/0);B!==r&&(c.value=B,a("update:modelValue",B))};return s({focus:()=>{var r;o.isDisabled||(r=n.value)==null||r.focus()}}),(r,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative",[r.block?"w-full block":"inline-block"]])},[e.createElementVNode("input",e.mergeProps({class:["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(m),e.unref(k),e.unref(b)]],placeholder:r.placeholder,type:f.value,min:r.min,max:r.max,disabled:r.isDisabled,value:c.value},r.$attrs,{ref_key:"inputElement",ref:n,onInput:h,onChange:C}),null,16,H),r.type==="color"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",G,[e.withDirectives(e.createElementVNode("input",{class:"invisible",type:"color",disabled:r.isDisabled,"onUpdate:modelValue":B[0]||(B[0]=ze=>c.value=ze),onInput:h},null,40,K),[[e.vModelText,c.value]]),e.createElementVNode("span",{class:"border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",style:e.normalizeStyle(`background-color: ${c.value}`)},null,4)]),e.unref(w)&&r.showColorPicker?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",disabled:r.isDisabled,onClick:p},[e.createVNode(g,{size:"xs",name:"eyedropper"})],8,J)):e.createCommentVNode("",!0)],64)):r.icon?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4",e.unref(k)])},[e.createVNode(g,{name:r.icon},null,8,["name"])],2)):e.createCommentVNode("",!0)],2))}}),X={class:"inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20"},Y=["id","for"],Z={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},v=e.defineComponent({__name:"Label",props:{id:{},label:{},description:{}},setup(l){return(s,t)=>(e.openBlock(),e.createElementBlock("span",X,[e.createElementVNode("label",{id:s.id?`${s.id}-label`:void 0,for:s.id},e.toDisplayString(s.label),9,Y),s.description?(e.openBlock(),e.createElementBlock("span",Z,e.toDisplayString(s.description),1)):e.createCommentVNode("",!0)]))}}),ee={key:0,class:"sr-only"},te=e.defineComponent({__name:"MenuContainer",props:{position:{default:"left"},usePortal:{type:[Boolean,String],default:!1},label:{default:"Open menu"}},setup(l){const s=l,t=(a=[])=>a.some(m=>typeof m.children=="string"?m.type!==e.Comment&&m.children.trim()!=="":Array.isArray(m.children)&&t(m.children)),o=e.ref(null),n=e.ref(null),c=s.position==="left"?"bottom-end":"bottom-start",{floatingStyles:u}=V.useFloating(o,n,{placement:c,transform:!1,whileElementsMounted:V.autoUpdate,middleware:[V.offset(6),V.flip(),V.shift({padding:6})]});return(a,m)=>(e.openBlock(),e.createBlock(e.unref(y.Menu),{as:"div",class:"inline-block text-left"},{default:e.withCtx(({open:b})=>[e.createVNode(e.unref(y.MenuButton),{class:"focus:outline-none",ref_key:"reference",ref:o},{default:e.withCtx(()=>{var k,f;return[e.renderSlot(a.$slots,"button",{},()=>[e.createVNode(e.unref(g),{class:"fill-current",name:"ellipsis-h"})]),t((f=(k=a.$slots).button)==null?void 0:f.call(k))?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(a.label),1))]}),_:3},512),(e.openBlock(),e.createBlock(e.Teleport,{to:typeof a.usePortal=="string"?a.usePortal:"body",disabled:!a.usePortal},[e.createVNode(e.Transition,{"enter-active-class":"transition duration-200 ease-in-out","enter-from-class":"transform -translate-y-4 opacity-0","enter-to-class":"transform opacity-100","leave-active-class":"transition duration-100 ease-in-out","leave-from-class":"transform opacity-100","leave-to-class":"transform -translate-y-2 opacity-0"},{default:e.withCtx(()=>[b?(e.openBlock(),e.createElementBlock("div",{key:0,class:"w-56 z-20",style:e.normalizeStyle(e.unref(u)),ref_key:"floating",ref:n},[e.createVNode(e.unref(y.MenuItems),{static:"",class:e.normalizeClass(["z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"])},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})],4)):e.createCommentVNode("",!0)]),_:2},1024)],8,["to","disabled"]))]),_:3}))}}),oe={key:0,class:"bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"},ne=e.defineComponent({__name:"MenuLink",props:{label:{},meta:{},disabled:{type:Boolean},as:{}},setup(l){return(s,t)=>(e.openBlock(),e.createBlock(e.unref(y.MenuItem),e.normalizeProps(e.guardReactiveProps({disabled:s.disabled})),{default:e.withCtx(({active:o})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.as||"span"),{class:e.normalizeClass(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg",[o?"bg-grey-200":"",s.disabled?"opacity-50 pointer-events-none":"hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"]])},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(s.label),1),s.meta?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(s.meta),1)):e.createCommentVNode("",!0)]),_:2},1032,["class"]))]),_:1},16))}}),le={class:"relative"},ae={key:0,class:"absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},se={key:1,class:"block truncate"},re={key:2,class:"text-grey-500 truncate"},ie={class:"absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},ce={class:"absolute right-2 inset-y-0 flex items-center"},de={key:0,class:"bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"},me=e.defineComponent({__name:"Select",props:{id:{},modelValue:{},size:{default:"medium"},icon:{},placeholder:{},isDisabled:{type:Boolean,default:!1},options:{},disabledBadge:{},by:{}},emits:["update:modelValue"],setup(l,{emit:s}){const t=l,o=e.ref(t.modelValue??null),n=s,c=d=>typeof t.by=="string"?d[t.by]:d.id,{inputClasses:u,disabledClasses:a,textSizeClasses:m}=N(t),b=e.ref(!1),k=()=>{b.value=!!t.id&&!!document.getElementById(`${t.id}-label`)};e.onMounted(k),e.watch(()=>t.id,k,{flush:"post"});const f=e.computed(()=>b.value?`${t.id}-label ${t.id}`:void 0);e.watch(()=>t.modelValue,d=>{o.value=d??null});const w=d=>{o.value=d,n("update:modelValue",d)};return(d,z)=>(e.openBlock(),e.createBlock(e.unref(y.Listbox),{as:"div","model-value":o.value,"onUpdate:modelValue":w,by:d.by,disabled:d.isDisabled},{default:e.withCtx(()=>[e.createElementVNode("div",le,[e.createVNode(e.unref(y.ListboxButton),{id:d.id,"aria-labelledby":f.value,class:e.normalizeClass(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left",[e.unref(u),e.unref(m),e.unref(a)]])},{default:e.withCtx(()=>{var p;return[d.icon?(e.openBlock(),e.createElementBlock("span",ae,[e.createVNode(g,{name:((p=o.value)==null?void 0:p.icon)??d.icon},null,8,["name"])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("span",se,[e.renderSlot(d.$slots,"option",{option:o.value,active:!1,selected:!0},()=>[e.createTextVNode(e.toDisplayString(o.value.label),1)])])):(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(d.placeholder),1)),e.createElementVNode("span",ie,[e.createVNode(g,{class:"text-grey-400",name:"chevron-down","aria-hidden":"true"})])]}),_:3},8,["id","aria-labelledby","class"]),e.createVNode(e.Transition,{"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.ListboxOptions),{class:"absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options,p=>(e.openBlock(),e.createBlock(e.unref(y.ListboxOption),{as:"template",key:c(p),value:p,disabled:p.disabled},{default:e.withCtx(({active:h,selected:C})=>[e.createElementVNode("li",{class:e.normalizeClass([h?"text-white bg-blue-500":"text-grey-900 dark:text-grey-50","cursor-default select-none relative py-2 pl-3 pr-12",{"opacity-50 bg-grey-100":p.disabled}])},[e.createElementVNode("div",ce,[p.disabled&&d.disabledBadge?(e.openBlock(),e.createElementBlock("span",de,e.toDisplayString(d.disabledBadge),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",{class:e.normalizeClass([C?"font-semibold":"font-normal","block truncate"])},[p.icon?(e.openBlock(),e.createBlock(g,{key:0,class:"inline-block mr-1",name:p.icon},null,8,["name"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"option",{option:p,active:h,selected:C},()=>[e.createTextVNode(e.toDisplayString(p.label),1)])],2),C?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([h?"text-blue-100":"text-blue-500","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(g,{name:"check",class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]),_:2},1032,["value","disabled"]))),128))]),_:3})]),_:3})])]),_:3},8,["model-value","by","disabled"]))}}),fe={class:"animate-pulse"},pe={class:"flex items-center justify-between space-x-4"},ue={key:0,class:"w-12 h-12 bg-current rounded-full shrink-0"},be={key:1,class:"w-full h-8 bg-current rounded-lg"},ge={key:0,class:"mt-6 space-y-2"},ye={key:1,class:"w-1/3 h-10 mt-6 bg-current rounded-lg"},ke=e.defineComponent({__name:"Skeleton",props:{avatar:{type:Boolean,default:!1},title:{type:Boolean,default:!0},lines:{default:3},footer:{type:Boolean,default:!1}},setup(l){const s=l,t=["mr-4","mr-5","mr-6","mr-8","mr-10","mr-16","mr-24","mr-32"],o=e.computed(()=>Array.from({length:Math.max(0,Math.floor(s.lines))},()=>({margin:t[Math.floor(Math.random()*t.length)]})));return(n,c)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",pe,[n.avatar?(e.openBlock(),e.createElementBlock("div",ue)):e.createCommentVNode("",!0),n.title?(e.openBlock(),e.createElementBlock("div",be)):e.createCommentVNode("",!0)]),o.value.length>0?(e.openBlock(),e.createElementBlock("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-4 bg-current rounded-lg",u.margin]),key:a},null,2))),128))])):e.createCommentVNode("",!0),n.footer?(e.openBlock(),e.createElementBlock("div",ye)):e.createCommentVNode("",!0)]))}}),he={role:"status",class:"inline-flex align-[-0.125em]"},Be={class:"sr-only"},_e={inheritAttrs:!1},Ve=e.defineComponent({..._e,__name:"Spinner",props:{label:{default:"Loading"}},setup(l){const s=e.ref(!1);let t;return e.onMounted(()=>{t=setTimeout(()=>s.value=!0,100)}),e.onUnmounted(()=>clearTimeout(t)),(o,n)=>(e.openBlock(),e.createElementBlock("span",he,[e.createVNode(e.unref(g),e.mergeProps({class:"animate-spin",name:"circle-notch"},o.$attrs),null,16),e.createElementVNode("span",Be,e.toDisplayString(s.value?o.label:""),1)]))}}),Ce={class:"sr-only"},we=e.defineComponent({__name:"Switch",props:{id:{default:()=>E.v4()},label:{},modelValue:{type:Boolean},onLabel:{default:"on"},offLabel:{default:"off"}},emits:["update:modelValue","change"],setup(l,{emit:s}){const t=s,o=n=>{t("update:modelValue",n),t("change",n)};return(n,c)=>(e.openBlock(),e.createBlock(e.unref(y.Switch),{id:n.id,modelValue:n.modelValue,class:e.normalizeClass([n.modelValue?"bg-blue-700":"bg-grey-700","relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),"onUpdate:modelValue":o},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["absolute text-xs text-center text-white inset-x-2",n.modelValue?"pr-3":"pl-3"])},e.toDisplayString(n.modelValue===!0?n.onLabel:n.offLabel),3),e.createElementVNode("span",Ce,e.toDisplayString(n.label),1),e.createElementVNode("span",{class:e.normalizeClass([n.modelValue?"translate-x-9":"translate-x-1","inline-block w-4 h-4 transition bg-white rounded-full"])},null,2)]),_:1},8,["id","modelValue","class"]))}}),xe={class:"relative"},Ne=["disabled","value"],Ee={inheritAttrs:!1},De=e.defineComponent({...Ee,__name:"Textarea",props:{modelValue:{},size:{default:"medium"},isDisabled:{type:Boolean,default:!1},block:{type:Boolean}},emits:["update:modelValue"],setup(l,{expose:s,emit:t}){const o=l,n=t,{inputClasses:c,disabledClasses:u,textSizeClasses:a}=N(o),m=function(f){n("update:modelValue",(f==null?void 0:f.target).value)},b=e.ref(null);return s({focus:()=>{o.isDisabled||b.value.focus()}}),(f,w)=>(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("textarea",e.mergeProps({class:["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(c),e.unref(a),e.unref(u)]],disabled:f.isDisabled,value:f.modelValue??""},f.$attrs,{ref_key:"input",ref:b,cols:"56",rows:"8",onInput:m}),`
|
|
2
|
+
`,16,Ne)]))}});i.D9Button=T,i.D9Checkbox=R,i.D9Icon=g,i.D9Input=W,i.D9Label=v,i.D9Menu=te,i.D9MenuLink=ne,i.D9Select=me,i.D9Skeleton=ke,i.D9Spinner=Ve,i.D9Switch=we,i.D9Textarea=De,i.brands=P,i.icons=L,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deck9/ui",
|
|
3
|
-
"version": "0.17.0
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "The UI components used in deck9 software applications.",
|
|
5
5
|
"author": "Philipp Reinking <philipp@deck9.co> (https://deck9.co)",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"check": "vue-tsc --noEmit",
|
|
8
|
+
"lint": "eslint . --max-warnings 0",
|
|
8
9
|
"build": "vue-tsc --noEmit && vite build",
|
|
9
10
|
"test": "vitest run",
|
|
10
11
|
"storybook": "storybook dev -p 6006",
|
|
@@ -52,8 +53,6 @@
|
|
|
52
53
|
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
53
54
|
"@typescript-eslint/parser": "^5.28.0",
|
|
54
55
|
"@vitejs/plugin-vue": "^4.5.0",
|
|
55
|
-
"@vue/cli-plugin-babel": "^5.0.8",
|
|
56
|
-
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
57
56
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
58
57
|
"@vue/eslint-config-typescript": "^11.0.2",
|
|
59
58
|
"@vue/test-utils": "2.4.6",
|