@leaflink/stash 45.1.1 → 45.1.3
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/dist/AddressSelect.js +1 -1
- package/dist/CurrencyInput.js +1 -1
- package/dist/DataViewFilters.js +1 -1
- package/dist/DatePicker.js +1 -1
- package/dist/Dialog.js +23 -23
- package/dist/Dialog.js.map +1 -1
- package/dist/Field.js +1 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js +93 -0
- package/dist/Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js.map +1 -0
- package/dist/FilterSelect.js +1 -1
- package/dist/Filters.js +1 -1
- package/dist/InlineEdit.js +1 -1
- package/dist/Input.js +1 -1
- package/dist/InputOptions.js +1 -1
- package/dist/ListView.js +1 -1
- package/dist/RadioGroup.js +78 -74
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchBar.js +1 -1
- package/dist/Select.js +1 -1
- package/dist/SelectStatus.js +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/components.css +1 -1
- package/package.json +1 -2
- package/dist/Field.vue_vue_type_script_setup_true_lang-224ab33a.js +0 -96
- package/dist/Field.vue_vue_type_script_setup_true_lang-224ab33a.js.map +0 -1
package/dist/RadioGroup.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as $, inject as
|
|
2
|
-
import
|
|
3
|
-
import { _ as O } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as $, inject as k, useCssModule as V, openBlock as s, createElementBlock as d, normalizeClass as _, unref as e, Fragment as B, renderList as R, createElementVNode as r, toDisplayString as h, provide as C, computed as v, createBlock as I, withCtx as M, renderSlot as T, resolveDynamicComponent as G } from "vue";
|
|
2
|
+
import E from "lodash-es/uniqueId";
|
|
3
|
+
import { _ as O } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
4
4
|
import { R as y } from "./RadioGroup.keys-974818d6.js";
|
|
5
|
-
import { _ as
|
|
5
|
+
import { _ as x } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
7
7
|
import "./locale.js";
|
|
8
8
|
import "lodash-es/get";
|
|
9
9
|
const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @__PURE__ */ $({
|
|
10
10
|
__name: "VariantButton",
|
|
11
11
|
setup(u) {
|
|
12
|
-
const o =
|
|
12
|
+
const o = k(y.key);
|
|
13
13
|
if (!o)
|
|
14
14
|
throw new Error("VariantButton must be used with a RadioGroup instance.");
|
|
15
|
-
const { name: t, disabled:
|
|
16
|
-
return (
|
|
15
|
+
const { name: t, disabled: m, fullWidth: f, modelValue: l, options: i, update: n } = o, p = V();
|
|
16
|
+
return (g, c) => (s(), d("div", {
|
|
17
17
|
class: _(["tw-flex", e(p).root])
|
|
18
18
|
}, [
|
|
19
|
-
(
|
|
19
|
+
(s(!0), d(B, null, R(e(i), (a) => (s(), d("div", {
|
|
20
20
|
key: `${e(t)}-${a.id}`,
|
|
21
|
-
class: _([{ "tw-w-full": e(
|
|
21
|
+
class: _([{ "tw-w-full": e(f) }])
|
|
22
22
|
}, [
|
|
23
23
|
r("input", {
|
|
24
24
|
id: `${e(t)}-${a.id}`,
|
|
@@ -26,10 +26,10 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
26
26
|
type: "radio",
|
|
27
27
|
name: e(t),
|
|
28
28
|
value: a.value,
|
|
29
|
-
checked: e(
|
|
30
|
-
disabled: e(
|
|
29
|
+
checked: e(l) === a.value,
|
|
30
|
+
disabled: e(m) || a.disabled,
|
|
31
31
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
32
|
-
(...b) => e(
|
|
32
|
+
(...b) => e(n) && e(n)(...b))
|
|
33
33
|
}, null, 40, W),
|
|
34
34
|
r("label", {
|
|
35
35
|
for: `${e(t)}-${a.id}`
|
|
@@ -41,19 +41,19 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
41
41
|
root: S
|
|
42
42
|
}, L = {
|
|
43
43
|
$style: D
|
|
44
|
-
}, N = /* @__PURE__ */
|
|
44
|
+
}, N = /* @__PURE__ */ x(q, [["__cssModules", L]]), z = ["id", "name", "value", "checked", "disabled"], A = ["for"], F = /* @__PURE__ */ $({
|
|
45
45
|
__name: "VariantChip",
|
|
46
46
|
setup(u) {
|
|
47
|
-
const o =
|
|
47
|
+
const o = k(y.key);
|
|
48
48
|
if (!o)
|
|
49
49
|
throw new Error("VariantChip must be used with a RadioGroup instance.");
|
|
50
|
-
const { name: t, disabled:
|
|
51
|
-
return (
|
|
50
|
+
const { name: t, disabled: m, fullWidth: f, modelValue: l, options: i, update: n } = o, p = V();
|
|
51
|
+
return (g, c) => (s(), d("div", {
|
|
52
52
|
class: _(["tw-my-1.5 tw-flex tw-flex-wrap", e(p).root])
|
|
53
53
|
}, [
|
|
54
|
-
(
|
|
54
|
+
(s(!0), d(B, null, R(e(i), (a) => (s(), d("div", {
|
|
55
55
|
key: `${e(t)}-${a.id}`,
|
|
56
|
-
class: _([{ "tw-w-full": e(
|
|
56
|
+
class: _([{ "tw-w-full": e(f) }])
|
|
57
57
|
}, [
|
|
58
58
|
r("input", {
|
|
59
59
|
id: `${e(t)}-${a.id}`,
|
|
@@ -61,10 +61,10 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
61
61
|
type: "radio",
|
|
62
62
|
name: e(t),
|
|
63
63
|
value: a.value,
|
|
64
|
-
checked: e(
|
|
65
|
-
disabled: e(
|
|
64
|
+
checked: e(l) === a.value,
|
|
65
|
+
disabled: e(m) || a.disabled,
|
|
66
66
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
67
|
-
(...b) => e(
|
|
67
|
+
(...b) => e(n) && e(n)(...b))
|
|
68
68
|
}, null, 40, z),
|
|
69
69
|
r("label", {
|
|
70
70
|
for: `${e(t)}-${a.id}`
|
|
@@ -76,29 +76,29 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
76
76
|
root: J
|
|
77
77
|
}, U = {
|
|
78
78
|
$style: P
|
|
79
|
-
}, H = /* @__PURE__ */
|
|
79
|
+
}, H = /* @__PURE__ */ x(F, [["__cssModules", U]]), K = ["id", "name", "value", "checked", "disabled"], Q = ["for"], X = /* @__PURE__ */ $({
|
|
80
80
|
__name: "VariantRadio",
|
|
81
81
|
setup(u) {
|
|
82
|
-
const o =
|
|
82
|
+
const o = k(y.key);
|
|
83
83
|
if (!o)
|
|
84
84
|
throw new Error("VariantRadio must be used with a RadioGroup instance.");
|
|
85
|
-
const { name: t, disabled:
|
|
86
|
-
return (
|
|
85
|
+
const { name: t, disabled: m, fullWidth: f, modelValue: l, options: i, update: n } = o, p = V();
|
|
86
|
+
return (g, c) => (s(), d("div", {
|
|
87
87
|
class: _(["tw-flex tw-flex-wrap", e(p).root])
|
|
88
88
|
}, [
|
|
89
|
-
(
|
|
89
|
+
(s(!0), d(B, null, R(e(i), (a) => (s(), d("div", {
|
|
90
90
|
key: `${e(t)}-${a.id}`,
|
|
91
|
-
class: _([{ "tw-w-full": e(
|
|
91
|
+
class: _([{ "tw-w-full": e(f) }])
|
|
92
92
|
}, [
|
|
93
93
|
r("input", {
|
|
94
94
|
id: `${e(t)}-${a.id}`,
|
|
95
95
|
type: "radio",
|
|
96
96
|
name: e(t),
|
|
97
97
|
value: a.value,
|
|
98
|
-
checked: e(
|
|
99
|
-
disabled: e(
|
|
98
|
+
checked: e(l) === a.value,
|
|
99
|
+
disabled: e(m) || a.disabled,
|
|
100
100
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
101
|
-
(...b) => e(
|
|
101
|
+
(...b) => e(n) && e(n)(...b))
|
|
102
102
|
}, null, 40, K),
|
|
103
103
|
r("label", {
|
|
104
104
|
for: `${e(t)}-${a.id}`
|
|
@@ -110,27 +110,27 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
110
110
|
root: Y
|
|
111
111
|
}, ee = {
|
|
112
112
|
$style: Z
|
|
113
|
-
}, te = /* @__PURE__ */
|
|
113
|
+
}, te = /* @__PURE__ */ x(X, [["__cssModules", ee]]), ae = ["for"], se = ["id", "name", "value", "checked", "disabled"], le = { class: "tw-m-0 tw-text-ice-900" }, oe = { class: "tw-m-0 tw-text-ice-700" }, re = /* @__PURE__ */ $({
|
|
114
114
|
__name: "VariantTile",
|
|
115
115
|
setup(u) {
|
|
116
|
-
const o =
|
|
116
|
+
const o = k(y.key);
|
|
117
117
|
if (!o)
|
|
118
118
|
throw new Error("VariantTile must be used with a RadioGroup instance.");
|
|
119
|
-
const { name: t, disabled:
|
|
120
|
-
return (
|
|
119
|
+
const { name: t, disabled: m, fullWidth: f, modelValue: l, options: i, update: n } = o, p = V();
|
|
120
|
+
return (g, c) => (s(), d("div", {
|
|
121
121
|
class: _(["tw-flex tw-flex-wrap", e(p).root])
|
|
122
122
|
}, [
|
|
123
|
-
(
|
|
123
|
+
(s(!0), d(B, null, R(e(i), (a) => (s(), d("label", {
|
|
124
124
|
key: `${e(t)}-${a.id}`,
|
|
125
|
-
class: _([e(p)["tile-container"], { "tw-w-full": e(
|
|
125
|
+
class: _([e(p)["tile-container"], { "tw-w-full": e(f) }]),
|
|
126
126
|
for: `${e(t)}-${a.id}`
|
|
127
127
|
}, [
|
|
128
128
|
r("div", {
|
|
129
129
|
class: _(["tw-flex tw-border", [
|
|
130
130
|
e(p)["tile-header"],
|
|
131
131
|
{
|
|
132
|
-
"tw-border-blue-500 tw-bg-blue-100 tw-text-ice-900": e(
|
|
133
|
-
"tw-border-ice-500 tw-bg-ice-100 tw-text-ice-700": e(
|
|
132
|
+
"tw-border-blue-500 tw-bg-blue-100 tw-text-ice-900": e(l) === a.value,
|
|
133
|
+
"tw-border-ice-500 tw-bg-ice-100 tw-text-ice-700": e(l) !== a.value
|
|
134
134
|
}
|
|
135
135
|
]])
|
|
136
136
|
}, [
|
|
@@ -140,10 +140,10 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
140
140
|
type: "radio",
|
|
141
141
|
name: e(t),
|
|
142
142
|
value: a.value,
|
|
143
|
-
checked: e(
|
|
144
|
-
disabled: e(
|
|
143
|
+
checked: e(l) === a.value,
|
|
144
|
+
disabled: e(m) || a.disabled,
|
|
145
145
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
146
|
-
(...b) => e(
|
|
146
|
+
(...b) => e(n) && e(n)(...b))
|
|
147
147
|
}, null, 40, se),
|
|
148
148
|
r("div", null, [
|
|
149
149
|
r("span", null, h(a.text), 1)
|
|
@@ -153,8 +153,8 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
153
153
|
class: _(["tw-border-x tw-border-b", [
|
|
154
154
|
e(p)["tile-body"],
|
|
155
155
|
{
|
|
156
|
-
"tw-border-ice-500": e(
|
|
157
|
-
"tw-border-blue-500": e(
|
|
156
|
+
"tw-border-ice-500": e(l) !== a.value,
|
|
157
|
+
"tw-border-blue-500": e(l) === a.value
|
|
158
158
|
}
|
|
159
159
|
]])
|
|
160
160
|
}, [
|
|
@@ -164,16 +164,16 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
164
164
|
], 10, ae))), 128))
|
|
165
165
|
], 2));
|
|
166
166
|
}
|
|
167
|
-
}),
|
|
168
|
-
root:
|
|
167
|
+
}), de = "_root_1sppn_2", ie = {
|
|
168
|
+
root: de,
|
|
169
169
|
"tile-container": "_tile-container_1sppn_23",
|
|
170
170
|
"tile-header": "_tile-header_1sppn_30",
|
|
171
171
|
"tile-body": "_tile-body_1sppn_31"
|
|
172
172
|
}, ne = {
|
|
173
|
-
$style:
|
|
174
|
-
}, ue = /* @__PURE__ */
|
|
175
|
-
var
|
|
176
|
-
const
|
|
173
|
+
$style: ie
|
|
174
|
+
}, ue = /* @__PURE__ */ x(re, [["__cssModules", ne]]);
|
|
175
|
+
var w = /* @__PURE__ */ ((u) => (u.Radio = "radio", u.Button = "button", u.Chip = "chip", u.Tile = "tile", u))(w || {});
|
|
176
|
+
const ce = /* @__PURE__ */ $({
|
|
177
177
|
__name: "RadioGroup",
|
|
178
178
|
props: {
|
|
179
179
|
name: { default: void 0 },
|
|
@@ -192,40 +192,34 @@ const he = /* @__PURE__ */ $({
|
|
|
192
192
|
},
|
|
193
193
|
emits: ["update:modelValue"],
|
|
194
194
|
setup(u, { emit: o }) {
|
|
195
|
-
const t = u,
|
|
196
|
-
[
|
|
197
|
-
[
|
|
198
|
-
[
|
|
199
|
-
[
|
|
195
|
+
const t = u, m = {
|
|
196
|
+
[w.Button]: N,
|
|
197
|
+
[w.Chip]: H,
|
|
198
|
+
[w.Radio]: te,
|
|
199
|
+
[w.Tile]: ue
|
|
200
200
|
};
|
|
201
|
-
function
|
|
201
|
+
function f(i) {
|
|
202
202
|
o("update:modelValue", i.target.value);
|
|
203
203
|
}
|
|
204
|
-
const
|
|
205
|
-
return
|
|
204
|
+
const l = E("radio-group-field-error-");
|
|
205
|
+
return C(y.key, {
|
|
206
206
|
name: v(() => t.name),
|
|
207
207
|
disabled: v(() => t.disabled),
|
|
208
208
|
fullWidth: v(() => t.fullWidth),
|
|
209
209
|
modelValue: v(() => t.modelValue),
|
|
210
210
|
options: v(() => t.options),
|
|
211
211
|
variant: v(() => t.variant),
|
|
212
|
-
update:
|
|
213
|
-
}), (i,
|
|
214
|
-
class:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
"tw-flex-wrap": !t.options && (t.variant === e(m).Chip || t.variant === e(m).Radio),
|
|
218
|
-
"tw-gap-x-1.5 tw-gap-y-3": !t.options && t.variant === e(m).Chip,
|
|
219
|
-
"tw-gap-6": !t.options && (t.variant === e(m).Radio || t.variant === e(m).Tile)
|
|
220
|
-
}
|
|
221
|
-
]),
|
|
222
|
-
"aria-errormessage": e(s),
|
|
212
|
+
update: f
|
|
213
|
+
}), (i, n) => (s(), I(O, {
|
|
214
|
+
class: "stash-radio-group",
|
|
215
|
+
"data-test": "stash-radio-group",
|
|
216
|
+
"aria-errormessage": e(l),
|
|
223
217
|
"aria-invalid": !!t.errorText,
|
|
224
218
|
role: "radiogroup",
|
|
225
219
|
fieldset: "",
|
|
226
220
|
label: t.label,
|
|
227
221
|
"add-bottom-space": t.addBottomSpace,
|
|
228
|
-
"error-id": e(
|
|
222
|
+
"error-id": e(l),
|
|
229
223
|
"error-text": t.errorText,
|
|
230
224
|
"hint-text": t.hintText,
|
|
231
225
|
"show-optional-in-label": t.showOptionalInLabel,
|
|
@@ -234,16 +228,26 @@ const he = /* @__PURE__ */ $({
|
|
|
234
228
|
}, {
|
|
235
229
|
default: M(() => [
|
|
236
230
|
t.options ? T(i.$slots, "default", { key: 0 }, () => [
|
|
237
|
-
(
|
|
238
|
-
]) :
|
|
231
|
+
(s(), I(G(m[t.variant])))
|
|
232
|
+
], !0) : (s(), d("div", {
|
|
233
|
+
key: 1,
|
|
234
|
+
class: _(["tw-flex", {
|
|
235
|
+
"tw-flex-wrap": t.variant !== e(w).Button,
|
|
236
|
+
"tw-gap-x-1.5 tw-gap-y-3": t.variant === e(w).Chip,
|
|
237
|
+
"tw-gap-6": t.variant === e(w).Radio || t.variant === e(w).Tile
|
|
238
|
+
}])
|
|
239
|
+
}, [
|
|
240
|
+
T(i.$slots, "default", {}, void 0, !0)
|
|
241
|
+
], 2))
|
|
239
242
|
]),
|
|
240
243
|
_: 3
|
|
241
|
-
}, 8, ["
|
|
244
|
+
}, 8, ["aria-errormessage", "aria-invalid", "label", "add-bottom-space", "error-id", "error-text", "hint-text", "show-optional-in-label", "is-required", "is-read-only"]));
|
|
242
245
|
}
|
|
243
246
|
});
|
|
247
|
+
const $e = /* @__PURE__ */ x(ce, [["__scopeId", "data-v-a6627a68"]]);
|
|
244
248
|
export {
|
|
245
249
|
y as RADIO_GROUP_INJECTION,
|
|
246
|
-
|
|
247
|
-
|
|
250
|
+
w as RadioGroupVariant,
|
|
251
|
+
$e as default
|
|
248
252
|
};
|
|
249
253
|
//# sourceMappingURL=RadioGroup.js.map
|
package/dist/RadioGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sources":["../src/components/RadioGroup/components/VariantButton.vue","../src/components/RadioGroup/components/VariantChip.vue","../src/components/RadioGroup/components/VariantRadio.vue","../src/components/RadioGroup/components/VariantTile.vue","../src/components/RadioGroup/RadioGroup.types.ts","../src/components/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantButton must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-flex\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'tw-w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"tw-sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n .root label {\n padding: 8px 30px;\n border: 1px solid var(--color-ice-500);\n font-weight: theme('fontWeight.semibold');\n color: var(--color-ice-700);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n display: block;\n text-align: center;\n }\n\n .root > div:first-child label {\n border-top-left-radius: theme('borderRadius.DEFAULT');\n border-bottom-left-radius: theme('borderRadius.DEFAULT');\n }\n\n .root > div:last-child label {\n border-top-right-radius: theme('borderRadius.DEFAULT');\n border-bottom-right-radius: theme('borderRadius.DEFAULT');\n }\n\n .root > div:not(:first-child) label {\n margin-left: -1px;\n }\n\n .root > div:not(:last-child) label {\n border-right-color: transparent;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n z-index: 1;\n position: relative;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n background-color: var(--color-blue-100);\n z-index: 1;\n position: relative;\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantChip must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-my-1.5 tw-flex tw-flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'tw-w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"tw-sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n .root {\n gap: theme('spacing.6');\n }\n\n .root label {\n padding: theme('spacing[1.5]') theme('spacing.3');\n border: 1px solid var(--color-ice-500);\n font-weight: theme('fontWeight.normal');\n color: var(--color-ice-900);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n border-radius: 9999px;\n white-space: nowrap;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-white);\n background-color: var(--color-blue-500);\n font-weight: theme('fontWeight.bold');\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantRadio must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-flex tw-flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'tw-w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n .root {\n gap: theme('spacing.6');\n }\n\n .root label {\n font-weight: theme('fontWeight.medium');\n user-select: none;\n cursor: pointer;\n padding: 0 theme('spacing.3');\n }\n\n .root input {\n appearance: none;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 5px;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n .root input:hover:not(:disabled) {\n border-color: var(--color-blue-500);\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantTile must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-flex tw-flex-wrap\" :class=\"classes.root\">\n <label\n v-for=\"option in options\"\n :key=\"`${name}-${option.id}`\"\n :class=\"[classes['tile-container'], { 'tw-w-full': fullWidth }]\"\n :for=\"`${name}-${option.id}`\"\n >\n <div\n class=\"tw-flex tw-border\"\n :class=\"[\n classes['tile-header'],\n {\n 'tw-border-blue-500 tw-bg-blue-100 tw-text-ice-900': modelValue === option.value,\n 'tw-border-ice-500 tw-bg-ice-100 tw-text-ice-700': modelValue !== option.value,\n },\n ]\"\n >\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"tw-sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <div>\n <span>\n {{ option.text }}\n </span>\n </div>\n </div>\n <div\n class=\"tw-border-x tw-border-b\"\n :class=\"[\n classes['tile-body'],\n {\n 'tw-border-ice-500': modelValue !== option.value,\n 'tw-border-blue-500': modelValue === option.value,\n },\n ]\"\n >\n <p class=\"tw-m-0 tw-text-ice-900\">{{ option.subTitle }}</p>\n <p class=\"tw-m-0 tw-text-ice-700\">{{ option.subText }}</p>\n </div>\n </label>\n </div>\n</template>\n\n<style module>\n .root {\n gap: theme('spacing.6');\n }\n\n .root label {\n cursor: pointer;\n user-select: none;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n\n .root label.tile-container {\n border-radius: theme('borderRadius.DEFAULT');\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n .tile-header,\n .tile-body {\n transition: all 0.2s;\n }\n\n .tile-header {\n border-radius: theme('borderRadius.DEFAULT') theme('borderRadius.DEFAULT') 0 0;\n padding: theme('spacing.3') 0;\n }\n\n .root label.tile-container:hover .tile-header {\n background-color: var(--color-blue-100) !important;\n border-color: var(--color-blue-500) !important;\n color: var(--color-ice-900) !important;\n transition: all 0.2s;\n }\n\n .tile-body {\n border-radius: 0 0 theme('borderRadius.DEFAULT') theme('borderRadius.DEFAULT');\n background-color: var(--color-white);\n padding: theme('spacing.6');\n display: flex;\n flex-direction: column;\n }\n\n .root label.tile-container:hover .tile-body {\n border-color: var(--color-blue-500) !important;\n transition: all 0.2s;\n }\n\n .root input {\n appearance: none;\n background-color: var(--color-white);\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 2px;\n }\n\n .root input ~ div {\n font-weight: theme('fontWeight.medium');\n user-select: none;\n cursor: pointer;\n padding: 0 theme('spacing.3');\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root label.tile-container input {\n margin-left: theme('spacing.3');\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n @media screen and (width <= 640px) {\n .root {\n flex-direction: column;\n }\n }\n</style>\n","import { ComputedRef } from 'vue';\n\nexport enum RadioGroupVariant {\n Radio = 'radio',\n Button = 'button',\n Chip = 'chip',\n Tile = 'tile',\n}\n\nexport type RadioGroupVariants = `${RadioGroupVariant}`;\n\n/**\n * An individual radio `<input>` within a RadioGroup instance\n */\nexport interface RadioGroupOption {\n /**\n * Disables the RadioGroupOption if truthy\n */\n disabled?: boolean;\n\n /**\n * The unique identifier for the option\n */\n id: string;\n\n /**\n * The text to be displayed for the option\n */\n text: string;\n\n /**\n * The value of the option. Used for the modelValue of the RadioGroup.\n */\n value: string;\n\n /**\n * The subtitle for tile variant\n */\n subTitle?: string;\n\n /**\n * The subtext for tile variant\n */\n subText?: string;\n}\n\n/**\n * Properties and utilities provided to children of a RadioGroup instance\n */\nexport interface RadioGroupInjection {\n /**\n * This type should match RadioGroupProps['disabled']\n */\n disabled: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['fullWidth']\n */\n fullWidth: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['modelValue']\n */\n modelValue: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['name']\n */\n name: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['options']\n */\n options: ComputedRef<RadioGroupOption[] | undefined>;\n\n /**\n * Triggered when the user changes their selection; updates the v-model.\n */\n update: (e: Event) => void;\n\n /**\n * This type should match RadioGroupProps['variant']\n * @default 'radio'\n */\n variant: ComputedRef<RadioGroupVariants | undefined>;\n}\n","<script lang=\"ts\">\n import { RadioGroupOption, RadioGroupVariant, RadioGroupVariants } from './RadioGroup.types';\n\n export * from './RadioGroup.keys';\n export * from './RadioGroup.types';\n\n export interface RadioGroupProps {\n /**\n * Passed to the \"name\" attribute of the `<input>` elements within the RadioGroup.\n */\n name?: string;\n\n /**\n * Deprecated - Compose your radio group with the `Radio` component instead\n * @deprecated\n */\n options?: RadioGroupOption[];\n\n /**\n * The value of the selected radio option. Use this prop with the `update:modelValue` event to create a controlled component.\n */\n modelValue?: RadioGroupOption['value'];\n\n /**\n * @defaultValue 'radio'\n */\n variant?: RadioGroupVariants;\n\n /**\n * Whether the entire group should be disabled\n */\n disabled?: boolean;\n\n /**\n * Whether the group should expand to the parent's width\n */\n fullWidth?: boolean;\n\n /**\n * Adds spacing under the field that is consistent whether hint/error text is displayed.\n */\n addBottomSpace?: boolean;\n\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling.\n */\n errorText?: string;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * Whether it's a readonly field.\n */\n isReadOnly?: boolean;\n\n /**\n * Whether the field is required.\n */\n isRequired?: boolean;\n\n /**\n * Label to render above the input.\n */\n label?: string;\n\n /**\n * Show \"(optional)\" to the right of the label text\n */\n showOptionalInLabel?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, provide } from 'vue';\n\n import Field from '../Field/Field.vue';\n import VariantButton from './components/VariantButton.vue';\n import VariantChip from './components/VariantChip.vue';\n import VariantRadio from './components/VariantRadio.vue';\n import VariantTile from './components/VariantTile.vue';\n import { RADIO_GROUP_INJECTION } from './RadioGroup.keys';\n\n const variantComponentsMap = {\n [RadioGroupVariant.Button]: VariantButton,\n [RadioGroupVariant.Chip]: VariantChip,\n [RadioGroupVariant.Radio]: VariantRadio,\n [RadioGroupVariant.Tile]: VariantTile,\n };\n\n const props = withDefaults(defineProps<RadioGroupProps>(), {\n variant: 'radio',\n disabled: false,\n fullWidth: false,\n errorText: undefined,\n hintText: undefined,\n label: undefined,\n modelValue: undefined,\n name: undefined,\n options: undefined,\n });\n\n const emit =\n defineEmits<{\n /**\n * Occurs when the user selects a radio option. Also, it enables v-model usage on the component.\n */\n (e: 'update:modelValue', value: RadioGroupOption['value']): void;\n }>();\n\n function update(e: Event) {\n emit('update:modelValue', (e.target as HTMLInputElement).value);\n }\n\n const errorId = uniqueId('radio-group-field-error-');\n\n provide(RADIO_GROUP_INJECTION.key, {\n name: computed(() => props.name),\n disabled: computed(() => props.disabled),\n fullWidth: computed(() => props.fullWidth),\n modelValue: computed(() => props.modelValue),\n options: computed(() => props.options),\n variant: computed(() => props.variant),\n update,\n });\n</script>\n\n<template>\n <Field\n :class=\"[\n {\n 'tw-flex': !props.options,\n 'tw-flex-wrap':\n !props.options && (props.variant === RadioGroupVariant.Chip || props.variant === RadioGroupVariant.Radio),\n 'tw-gap-x-1.5 tw-gap-y-3': !props.options && props.variant === RadioGroupVariant.Chip,\n 'tw-gap-6':\n !props.options && (props.variant === RadioGroupVariant.Radio || props.variant === RadioGroupVariant.Tile),\n },\n ]\"\n :aria-errormessage=\"errorId\"\n :aria-invalid=\"!!props.errorText\"\n role=\"radiogroup\"\n fieldset\n :label=\"props.label\"\n :add-bottom-space=\"props.addBottomSpace\"\n :error-id=\"errorId\"\n :error-text=\"props.errorText\"\n :hint-text=\"props.hintText\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n :is-required=\"props.isRequired\"\n :is-read-only=\"props.isReadOnly\"\n >\n <slot v-if=\"props.options\">\n <component :is=\"variantComponentsMap[props.variant]\" />\n </slot>\n <slot v-else></slot>\n </Field>\n</template>\n"],"names":["radioGroupInjection","inject","RADIO_GROUP_INJECTION","name","disabled","fullWidth","modelValue","options","update","classes","useCssModule","RadioGroupVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","e","emit","errorId","uniqueId","provide","computed","props"],"mappings":";;;;;;;;;;;AAKQ,UAAAA,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,wDAAwD;AAG1E,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPV,UAAAV,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,sDAAsD;AAGxE,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPV,UAAAV,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,uDAAuD;AAGzE,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPV,UAAAV,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,sDAAsD;AAGxE,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVN,IAAAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCoFJC,IAAuB;AAAA,MAC3B,CAACD,EAAkB,MAAM,GAAGE;AAAA,MAC5B,CAACF,EAAkB,IAAI,GAAGG;AAAA,MAC1B,CAACH,EAAkB,KAAK,GAAGI;AAAA,MAC3B,CAACJ,EAAkB,IAAI,GAAGK;AAAA,IAAA;AAuB5B,aAASR,EAAOS,GAAU;AACnB,MAAAC,EAAA,qBAAsBD,EAAE,OAA4B,KAAK;AAAA,IAChE;AAEM,UAAAE,IAAUC,EAAS,0BAA0B;AAEnD,WAAAC,EAAQnB,EAAsB,KAAK;AAAA,MACjC,MAAMoB,EAAS,MAAMC,EAAM,IAAI;AAAA,MAC/B,UAAUD,EAAS,MAAMC,EAAM,QAAQ;AAAA,MACvC,WAAWD,EAAS,MAAMC,EAAM,SAAS;AAAA,MACzC,YAAYD,EAAS,MAAMC,EAAM,UAAU;AAAA,MAC3C,SAASD,EAAS,MAAMC,EAAM,OAAO;AAAA,MACrC,SAASD,EAAS,MAAMC,EAAM,OAAO;AAAA,MACrC,QAAAf;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sources":["../src/components/RadioGroup/components/VariantButton.vue","../src/components/RadioGroup/components/VariantChip.vue","../src/components/RadioGroup/components/VariantRadio.vue","../src/components/RadioGroup/components/VariantTile.vue","../src/components/RadioGroup/RadioGroup.types.ts","../src/components/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantButton must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-flex\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'tw-w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"tw-sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n .root label {\n padding: 8px 30px;\n border: 1px solid var(--color-ice-500);\n font-weight: theme('fontWeight.semibold');\n color: var(--color-ice-700);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n display: block;\n text-align: center;\n }\n\n .root > div:first-child label {\n border-top-left-radius: theme('borderRadius.DEFAULT');\n border-bottom-left-radius: theme('borderRadius.DEFAULT');\n }\n\n .root > div:last-child label {\n border-top-right-radius: theme('borderRadius.DEFAULT');\n border-bottom-right-radius: theme('borderRadius.DEFAULT');\n }\n\n .root > div:not(:first-child) label {\n margin-left: -1px;\n }\n\n .root > div:not(:last-child) label {\n border-right-color: transparent;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n z-index: 1;\n position: relative;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n background-color: var(--color-blue-100);\n z-index: 1;\n position: relative;\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantChip must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-my-1.5 tw-flex tw-flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'tw-w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"tw-sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n .root {\n gap: theme('spacing.6');\n }\n\n .root label {\n padding: theme('spacing[1.5]') theme('spacing.3');\n border: 1px solid var(--color-ice-500);\n font-weight: theme('fontWeight.normal');\n color: var(--color-ice-900);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n border-radius: 9999px;\n white-space: nowrap;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-white);\n background-color: var(--color-blue-500);\n font-weight: theme('fontWeight.bold');\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantRadio must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-flex tw-flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'tw-w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n .root {\n gap: theme('spacing.6');\n }\n\n .root label {\n font-weight: theme('fontWeight.medium');\n user-select: none;\n cursor: pointer;\n padding: 0 theme('spacing.3');\n }\n\n .root input {\n appearance: none;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 5px;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n .root input:hover:not(:disabled) {\n border-color: var(--color-blue-500);\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantTile must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"tw-flex tw-flex-wrap\" :class=\"classes.root\">\n <label\n v-for=\"option in options\"\n :key=\"`${name}-${option.id}`\"\n :class=\"[classes['tile-container'], { 'tw-w-full': fullWidth }]\"\n :for=\"`${name}-${option.id}`\"\n >\n <div\n class=\"tw-flex tw-border\"\n :class=\"[\n classes['tile-header'],\n {\n 'tw-border-blue-500 tw-bg-blue-100 tw-text-ice-900': modelValue === option.value,\n 'tw-border-ice-500 tw-bg-ice-100 tw-text-ice-700': modelValue !== option.value,\n },\n ]\"\n >\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"tw-sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <div>\n <span>\n {{ option.text }}\n </span>\n </div>\n </div>\n <div\n class=\"tw-border-x tw-border-b\"\n :class=\"[\n classes['tile-body'],\n {\n 'tw-border-ice-500': modelValue !== option.value,\n 'tw-border-blue-500': modelValue === option.value,\n },\n ]\"\n >\n <p class=\"tw-m-0 tw-text-ice-900\">{{ option.subTitle }}</p>\n <p class=\"tw-m-0 tw-text-ice-700\">{{ option.subText }}</p>\n </div>\n </label>\n </div>\n</template>\n\n<style module>\n .root {\n gap: theme('spacing.6');\n }\n\n .root label {\n cursor: pointer;\n user-select: none;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n\n .root label.tile-container {\n border-radius: theme('borderRadius.DEFAULT');\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n .tile-header,\n .tile-body {\n transition: all 0.2s;\n }\n\n .tile-header {\n border-radius: theme('borderRadius.DEFAULT') theme('borderRadius.DEFAULT') 0 0;\n padding: theme('spacing.3') 0;\n }\n\n .root label.tile-container:hover .tile-header {\n background-color: var(--color-blue-100) !important;\n border-color: var(--color-blue-500) !important;\n color: var(--color-ice-900) !important;\n transition: all 0.2s;\n }\n\n .tile-body {\n border-radius: 0 0 theme('borderRadius.DEFAULT') theme('borderRadius.DEFAULT');\n background-color: var(--color-white);\n padding: theme('spacing.6');\n display: flex;\n flex-direction: column;\n }\n\n .root label.tile-container:hover .tile-body {\n border-color: var(--color-blue-500) !important;\n transition: all 0.2s;\n }\n\n .root input {\n appearance: none;\n background-color: var(--color-white);\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 2px;\n }\n\n .root input ~ div {\n font-weight: theme('fontWeight.medium');\n user-select: none;\n cursor: pointer;\n padding: 0 theme('spacing.3');\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root label.tile-container input {\n margin-left: theme('spacing.3');\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n @media screen and (width <= 640px) {\n .root {\n flex-direction: column;\n }\n }\n</style>\n","import { ComputedRef } from 'vue';\n\nexport enum RadioGroupVariant {\n Radio = 'radio',\n Button = 'button',\n Chip = 'chip',\n Tile = 'tile',\n}\n\nexport type RadioGroupVariants = `${RadioGroupVariant}`;\n\n/**\n * An individual radio `<input>` within a RadioGroup instance\n */\nexport interface RadioGroupOption {\n /**\n * Disables the RadioGroupOption if truthy\n */\n disabled?: boolean;\n\n /**\n * The unique identifier for the option\n */\n id: string;\n\n /**\n * The text to be displayed for the option\n */\n text: string;\n\n /**\n * The value of the option. Used for the modelValue of the RadioGroup.\n */\n value: string;\n\n /**\n * The subtitle for tile variant\n */\n subTitle?: string;\n\n /**\n * The subtext for tile variant\n */\n subText?: string;\n}\n\n/**\n * Properties and utilities provided to children of a RadioGroup instance\n */\nexport interface RadioGroupInjection {\n /**\n * This type should match RadioGroupProps['disabled']\n */\n disabled: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['fullWidth']\n */\n fullWidth: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['modelValue']\n */\n modelValue: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['name']\n */\n name: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['options']\n */\n options: ComputedRef<RadioGroupOption[] | undefined>;\n\n /**\n * Triggered when the user changes their selection; updates the v-model.\n */\n update: (e: Event) => void;\n\n /**\n * This type should match RadioGroupProps['variant']\n * @default 'radio'\n */\n variant: ComputedRef<RadioGroupVariants | undefined>;\n}\n","<script lang=\"ts\">\n import { RadioGroupOption, RadioGroupVariant, RadioGroupVariants } from './RadioGroup.types';\n\n export * from './RadioGroup.keys';\n export * from './RadioGroup.types';\n\n export interface RadioGroupProps {\n /**\n * Passed to the \"name\" attribute of the `<input>` elements within the RadioGroup.\n */\n name?: string;\n\n /**\n * Deprecated - Compose your radio group with the `Radio` component instead\n * @deprecated\n */\n options?: RadioGroupOption[];\n\n /**\n * The value of the selected radio option. Use this prop with the `update:modelValue` event to create a controlled component.\n */\n modelValue?: RadioGroupOption['value'];\n\n /**\n * @defaultValue 'radio'\n */\n variant?: RadioGroupVariants;\n\n /**\n * Whether the entire group should be disabled\n */\n disabled?: boolean;\n\n /**\n * Whether the group should expand to the parent's width\n */\n fullWidth?: boolean;\n\n /**\n * Adds spacing under the field that is consistent whether hint/error text is displayed.\n */\n addBottomSpace?: boolean;\n\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling.\n */\n errorText?: string;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * Whether it's a readonly field.\n */\n isReadOnly?: boolean;\n\n /**\n * Whether the field is required.\n */\n isRequired?: boolean;\n\n /**\n * Label to render above the input.\n */\n label?: string;\n\n /**\n * Show \"(optional)\" to the right of the label text\n */\n showOptionalInLabel?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, provide } from 'vue';\n\n import Field from '../Field/Field.vue';\n import VariantButton from './components/VariantButton.vue';\n import VariantChip from './components/VariantChip.vue';\n import VariantRadio from './components/VariantRadio.vue';\n import VariantTile from './components/VariantTile.vue';\n import { RADIO_GROUP_INJECTION } from './RadioGroup.keys';\n\n const variantComponentsMap = {\n [RadioGroupVariant.Button]: VariantButton,\n [RadioGroupVariant.Chip]: VariantChip,\n [RadioGroupVariant.Radio]: VariantRadio,\n [RadioGroupVariant.Tile]: VariantTile,\n };\n\n const props = withDefaults(defineProps<RadioGroupProps>(), {\n variant: 'radio',\n disabled: false,\n fullWidth: false,\n errorText: undefined,\n hintText: undefined,\n label: undefined,\n modelValue: undefined,\n name: undefined,\n options: undefined,\n });\n\n const emit =\n defineEmits<{\n /**\n * Occurs when the user selects a radio option. Also, it enables v-model usage on the component.\n */\n (e: 'update:modelValue', value: RadioGroupOption['value']): void;\n }>();\n\n function update(e: Event) {\n emit('update:modelValue', (e.target as HTMLInputElement).value);\n }\n\n const errorId = uniqueId('radio-group-field-error-');\n\n provide(RADIO_GROUP_INJECTION.key, {\n name: computed(() => props.name),\n disabled: computed(() => props.disabled),\n fullWidth: computed(() => props.fullWidth),\n modelValue: computed(() => props.modelValue),\n options: computed(() => props.options),\n variant: computed(() => props.variant),\n update,\n });\n</script>\n\n<template>\n <Field\n class=\"stash-radio-group\"\n data-test=\"stash-radio-group\"\n :aria-errormessage=\"errorId\"\n :aria-invalid=\"!!props.errorText\"\n role=\"radiogroup\"\n fieldset\n :label=\"props.label\"\n :add-bottom-space=\"props.addBottomSpace\"\n :error-id=\"errorId\"\n :error-text=\"props.errorText\"\n :hint-text=\"props.hintText\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n :is-required=\"props.isRequired\"\n :is-read-only=\"props.isReadOnly\"\n >\n <slot v-if=\"props.options\">\n <component :is=\"variantComponentsMap[props.variant]\" />\n </slot>\n <div\n v-else\n class=\"tw-flex\"\n :class=\"{\n 'tw-flex-wrap': props.variant !== RadioGroupVariant.Button,\n 'tw-gap-x-1.5 tw-gap-y-3': props.variant === RadioGroupVariant.Chip,\n 'tw-gap-6': props.variant === RadioGroupVariant.Radio || props.variant === RadioGroupVariant.Tile,\n }\"\n >\n <slot></slot>\n </div>\n </Field>\n</template>\n\n<style scoped>\n .stash-radio-group :global(.stash-field-hint),\n .stash-radio-group :global(.stash-field-error) {\n display: block;\n width: 100%;\n }\n\n .stash-radio-group > :global(.stash-label) {\n margin-bottom: 6px;\n }\n</style>\n"],"names":["radioGroupInjection","inject","RADIO_GROUP_INJECTION","name","disabled","fullWidth","modelValue","options","update","classes","useCssModule","RadioGroupVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","e","emit","errorId","uniqueId","provide","computed","props"],"mappings":";;;;;;;;;;;AAKQ,UAAAA,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,wDAAwD;AAG1E,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPV,UAAAV,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,sDAAsD;AAGxE,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPV,UAAAV,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,uDAAuD;AAGzE,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPV,UAAAV,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACG,YAAA,IAAI,MAAM,sDAAsD;AAGxE,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,EAAW,IAAAR,GAC7DS,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVN,IAAAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCoFJC,IAAuB;AAAA,MAC3B,CAACD,EAAkB,MAAM,GAAGE;AAAA,MAC5B,CAACF,EAAkB,IAAI,GAAGG;AAAA,MAC1B,CAACH,EAAkB,KAAK,GAAGI;AAAA,MAC3B,CAACJ,EAAkB,IAAI,GAAGK;AAAA,IAAA;AAuB5B,aAASR,EAAOS,GAAU;AACnB,MAAAC,EAAA,qBAAsBD,EAAE,OAA4B,KAAK;AAAA,IAChE;AAEM,UAAAE,IAAUC,EAAS,0BAA0B;AAEnD,WAAAC,EAAQnB,EAAsB,KAAK;AAAA,MACjC,MAAMoB,EAAS,MAAMC,EAAM,IAAI;AAAA,MAC/B,UAAUD,EAAS,MAAMC,EAAM,QAAQ;AAAA,MACvC,WAAWD,EAAS,MAAMC,EAAM,SAAS;AAAA,MACzC,YAAYD,EAAS,MAAMC,EAAM,UAAU;AAAA,MAC3C,SAASD,EAAS,MAAMC,EAAM,OAAO;AAAA,MACrC,SAASD,EAAS,MAAMC,EAAM,OAAO;AAAA,MACrC,QAAAf;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/SearchBar.js
CHANGED
|
@@ -12,7 +12,7 @@ import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
|
12
12
|
import "lodash-es/isNil";
|
|
13
13
|
import "./utils/i18n.js";
|
|
14
14
|
import "./constants.js";
|
|
15
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
15
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
16
16
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
17
17
|
const M = /* @__PURE__ */ C({
|
|
18
18
|
name: "ll-search-bar",
|
package/dist/Select.js
CHANGED
|
@@ -10,7 +10,7 @@ import { DEBOUNCE as Ht, KEY_CODES as ie } from "./constants.js";
|
|
|
10
10
|
import zt from "./clickoutside.js";
|
|
11
11
|
import { D as Wt } from "./MenusPlugin-5e93f0a5.js";
|
|
12
12
|
import Xe from "./Chip.js";
|
|
13
|
-
import { _ as Kt } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
13
|
+
import { _ as Kt } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
14
14
|
import ve from "./Icon.js";
|
|
15
15
|
import { _ as Ut } from "./_plugin-vue_export-helper-dad06003.js";
|
|
16
16
|
import "lodash-es/get";
|
package/dist/SelectStatus.js
CHANGED
|
@@ -22,7 +22,7 @@ import "./clickoutside.js";
|
|
|
22
22
|
import "./MenusPlugin-5e93f0a5.js";
|
|
23
23
|
import "./Chip.js";
|
|
24
24
|
import "./utils/colorScheme.js";
|
|
25
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
25
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
26
26
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
27
27
|
import "./locale.js";
|
|
28
28
|
const j = { class: "tw-mr-6 tw-truncate" }, E = {
|
package/dist/Textarea.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as R, useAttrs as M, useSlots as S, useCssModule as k, ref as x, computed as H, watch as O, onMounted as A, nextTick as I, onBeforeUnmount as P, openBlock as V, createBlock as $, mergeProps as _, unref as c, createSlots as q, withCtx as g, createElementVNode as j, renderSlot as D } from "vue";
|
|
2
2
|
import F from "lodash-es/uniqueId";
|
|
3
|
-
import { _ as L } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as L } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
4
4
|
import { _ as N } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
5
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
6
6
|
import "./locale.js";
|