@leaflink/stash 44.0.0-beta.3 → 44.0.0-beta.5
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/ActionsDropdown.js +10 -10
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +2 -2
- package/dist/AppNavigationItem.js +8 -8
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/ButtonGroup.js +2 -2
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataViewFilters.js +2 -2
- package/dist/DataViewSortButton.js +10 -10
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DatePicker.js +4 -4
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +1 -1
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Divider.js +3 -3
- package/dist/Divider.js.map +1 -1
- package/dist/Field.js +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-42cf79d4.js → Field.vue_vue_type_script_setup_true_lang-4483019d.js} +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-42cf79d4.js.map → Field.vue_vue_type_script_setup_true_lang-4483019d.js.map} +1 -1
- package/dist/FileUpload.js +22 -22
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterSelect.js +2 -2
- package/dist/Filters.js +8 -8
- package/dist/Filters.js.map +1 -1
- package/dist/IconLabel.js +10 -10
- package/dist/IconLabel.js.map +1 -1
- package/dist/Image.js +1 -1
- package/dist/Image.js.map +1 -1
- package/dist/InlineEdit.js +2 -2
- package/dist/Input.js +4 -4
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +10 -10
- package/dist/InputOptions.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-c5589919.js → Label.vue_vue_type_script_setup_true_lang-2de35913.js} +6 -6
- package/dist/{Label.vue_vue_type_script_setup_true_lang-c5589919.js.map → Label.vue_vue_type_script_setup_true_lang-2de35913.js.map} +1 -1
- package/dist/ListView.js +43 -43
- package/dist/ListView.js.map +1 -1
- package/dist/ObfuscateText.js +4 -4
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/RadioGroup.js +113 -113
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +4 -4
- package/dist/SearchBar.js +2 -2
- package/dist/Select.js +5 -5
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +2 -2
- package/dist/TableHeaderCell.js +2 -2
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/Textarea.js +2 -2
- package/dist/components.css +1 -1
- package/package.json +1 -1
package/dist/RadioGroup.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, inject as x, openBlock as l, createElementBlock as n, Fragment as $, renderList as V, unref as e, normalizeClass as v, createElementVNode as r, toDisplayString as w, provide as g, computed as b, createBlock as B, withCtx as T, renderSlot as R, resolveDynamicComponent as C } from "vue";
|
|
2
2
|
import E from "lodash-es/uniqueId";
|
|
3
|
-
import { _ as G } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { R as
|
|
3
|
+
import { _ as G } from "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
4
|
+
import { R as y } from "./RadioGroup.keys-974818d6.js";
|
|
5
5
|
import { _ as k } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
7
7
|
import "./locale.js";
|
|
8
8
|
import "lodash-es/get";
|
|
9
|
-
const O = { class: "root flex" }, W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @__PURE__ */
|
|
9
|
+
const O = { class: "root tw-flex" }, W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @__PURE__ */ h({
|
|
10
10
|
__name: "VariantButton",
|
|
11
11
|
setup(u) {
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
12
|
+
const i = x(y.key);
|
|
13
|
+
if (!i)
|
|
14
14
|
throw new Error("VariantButton must be used with a RadioGroup instance.");
|
|
15
|
-
const { name:
|
|
16
|
-
return (I, c) => (
|
|
17
|
-
(
|
|
18
|
-
key: `${e(
|
|
19
|
-
class: v([{ "w-full": e(m) }])
|
|
15
|
+
const { name: t, disabled: p, fullWidth: m, modelValue: d, options: o, update: s } = i;
|
|
16
|
+
return (I, c) => (l(), n("div", O, [
|
|
17
|
+
(l(!0), n($, null, V(e(o), (a) => (l(), n("div", {
|
|
18
|
+
key: `${e(t)}-${a.id}`,
|
|
19
|
+
class: v([{ "tw-w-full": e(m) }])
|
|
20
20
|
}, [
|
|
21
|
-
|
|
22
|
-
id: `${e(
|
|
21
|
+
r("input", {
|
|
22
|
+
id: `${e(t)}-${a.id}`,
|
|
23
23
|
class: "sr-only",
|
|
24
24
|
type: "radio",
|
|
25
|
-
name: e(
|
|
26
|
-
value:
|
|
27
|
-
checked: e(
|
|
28
|
-
disabled: e(p) ||
|
|
25
|
+
name: e(t),
|
|
26
|
+
value: a.value,
|
|
27
|
+
checked: e(d) === a.value,
|
|
28
|
+
disabled: e(p) || a.disabled,
|
|
29
29
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
30
30
|
(...f) => e(s) && e(s)(...f))
|
|
31
31
|
}, null, 40, W),
|
|
32
|
-
|
|
33
|
-
for: `${e(
|
|
34
|
-
},
|
|
32
|
+
r("label", {
|
|
33
|
+
for: `${e(t)}-${a.id}`
|
|
34
|
+
}, w(a.text), 9, j)
|
|
35
35
|
], 2))), 128))
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
const S = /* @__PURE__ */ k(q, [["__scopeId", "data-v-
|
|
39
|
+
const S = /* @__PURE__ */ k(q, [["__scopeId", "data-v-7b71c8aa"]]), D = { class: "root tw-my-1.5 tw-flex tw-flex-wrap" }, L = ["id", "name", "value", "checked", "disabled"], N = ["for"], z = /* @__PURE__ */ h({
|
|
40
40
|
__name: "VariantChip",
|
|
41
41
|
setup(u) {
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
42
|
+
const i = x(y.key);
|
|
43
|
+
if (!i)
|
|
44
44
|
throw new Error("VariantChip must be used with a RadioGroup instance.");
|
|
45
|
-
const { name:
|
|
46
|
-
return (I, c) => (
|
|
47
|
-
(
|
|
48
|
-
key: `${e(
|
|
49
|
-
class: v([{ "w-full": e(m) }])
|
|
45
|
+
const { name: t, disabled: p, fullWidth: m, modelValue: d, options: o, update: s } = i;
|
|
46
|
+
return (I, c) => (l(), n("div", D, [
|
|
47
|
+
(l(!0), n($, null, V(e(o), (a) => (l(), n("div", {
|
|
48
|
+
key: `${e(t)}-${a.id}`,
|
|
49
|
+
class: v([{ "tw-w-full": e(m) }])
|
|
50
50
|
}, [
|
|
51
|
-
|
|
52
|
-
id: `${e(
|
|
51
|
+
r("input", {
|
|
52
|
+
id: `${e(t)}-${a.id}`,
|
|
53
53
|
class: "sr-only",
|
|
54
54
|
type: "radio",
|
|
55
|
-
name: e(
|
|
56
|
-
value:
|
|
57
|
-
checked: e(
|
|
58
|
-
disabled: e(p) ||
|
|
55
|
+
name: e(t),
|
|
56
|
+
value: a.value,
|
|
57
|
+
checked: e(d) === a.value,
|
|
58
|
+
disabled: e(p) || a.disabled,
|
|
59
59
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
60
60
|
(...f) => e(s) && e(s)(...f))
|
|
61
61
|
}, null, 40, L),
|
|
62
|
-
|
|
63
|
-
for: `${e(
|
|
64
|
-
},
|
|
62
|
+
r("label", {
|
|
63
|
+
for: `${e(t)}-${a.id}`
|
|
64
|
+
}, w(a.text), 9, N)
|
|
65
65
|
], 2))), 128))
|
|
66
66
|
]));
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
const A = /* @__PURE__ */ k(z, [["__scopeId", "data-v-
|
|
69
|
+
const A = /* @__PURE__ */ k(z, [["__scopeId", "data-v-b3ebd673"]]), F = { class: "root tw-flex tw-flex-wrap" }, J = ["id", "name", "value", "checked", "disabled"], M = ["for"], P = /* @__PURE__ */ h({
|
|
70
70
|
__name: "VariantRadio",
|
|
71
71
|
setup(u) {
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
72
|
+
const i = x(y.key);
|
|
73
|
+
if (!i)
|
|
74
74
|
throw new Error("VariantRadio must be used with a RadioGroup instance.");
|
|
75
|
-
const { name:
|
|
76
|
-
return (I, c) => (
|
|
77
|
-
(
|
|
78
|
-
key: `${e(
|
|
79
|
-
class: v([{ "w-full": e(m) }])
|
|
75
|
+
const { name: t, disabled: p, fullWidth: m, modelValue: d, options: o, update: s } = i;
|
|
76
|
+
return (I, c) => (l(), n("div", F, [
|
|
77
|
+
(l(!0), n($, null, V(e(o), (a) => (l(), n("div", {
|
|
78
|
+
key: `${e(t)}-${a.id}`,
|
|
79
|
+
class: v([{ "tw-w-full": e(m) }])
|
|
80
80
|
}, [
|
|
81
|
-
|
|
82
|
-
id: `${e(
|
|
81
|
+
r("input", {
|
|
82
|
+
id: `${e(t)}-${a.id}`,
|
|
83
83
|
type: "radio",
|
|
84
|
-
name: e(
|
|
85
|
-
value:
|
|
86
|
-
checked: e(
|
|
87
|
-
disabled: e(p) ||
|
|
84
|
+
name: e(t),
|
|
85
|
+
value: a.value,
|
|
86
|
+
checked: e(d) === a.value,
|
|
87
|
+
disabled: e(p) || a.disabled,
|
|
88
88
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
89
89
|
(...f) => e(s) && e(s)(...f))
|
|
90
90
|
}, null, 40, J),
|
|
91
|
-
|
|
92
|
-
for: `${e(
|
|
93
|
-
},
|
|
91
|
+
r("label", {
|
|
92
|
+
for: `${e(t)}-${a.id}`
|
|
93
|
+
}, w(a.text), 9, M)
|
|
94
94
|
], 2))), 128))
|
|
95
95
|
]));
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
|
-
const U = /* @__PURE__ */ k(P, [["__scopeId", "data-v-
|
|
98
|
+
const U = /* @__PURE__ */ k(P, [["__scopeId", "data-v-ae5fdd9e"]]), H = { class: "root tw-flex tw-flex-wrap" }, K = ["for"], Q = ["id", "name", "value", "checked", "disabled"], X = { class: "tw-m-0 tw-text-ice-900" }, Y = { class: "tw-m-0 tw-text-ice-700" }, Z = /* @__PURE__ */ h({
|
|
99
99
|
__name: "VariantTile",
|
|
100
100
|
setup(u) {
|
|
101
|
-
const
|
|
102
|
-
if (!
|
|
101
|
+
const i = x(y.key);
|
|
102
|
+
if (!i)
|
|
103
103
|
throw new Error("VariantTile must be used with a RadioGroup instance.");
|
|
104
|
-
const { name:
|
|
105
|
-
return (I, c) => (
|
|
106
|
-
(
|
|
107
|
-
key: `${e(
|
|
108
|
-
class: v(["tile-container", { "w-full": e(m) }]),
|
|
109
|
-
for: `${e(
|
|
104
|
+
const { name: t, disabled: p, fullWidth: m, modelValue: d, options: o, update: s } = i;
|
|
105
|
+
return (I, c) => (l(), n("div", H, [
|
|
106
|
+
(l(!0), n($, null, V(e(o), (a) => (l(), n("label", {
|
|
107
|
+
key: `${e(t)}-${a.id}`,
|
|
108
|
+
class: v(["tile-container", { "tw-w-full": e(m) }]),
|
|
109
|
+
for: `${e(t)}-${a.id}`
|
|
110
110
|
}, [
|
|
111
|
-
|
|
112
|
-
class: v(["tile-header border
|
|
113
|
-
"border-blue-500 bg-blue-100
|
|
114
|
-
"border-ice-500 bg-ice-100
|
|
111
|
+
r("div", {
|
|
112
|
+
class: v(["tile-header tw-flex tw-border", {
|
|
113
|
+
"tw-border-blue-500 tw-bg-blue-100 tw-text-ice-900": e(d) === a.value,
|
|
114
|
+
"tw-border-ice-500 tw-bg-ice-100 tw-text-ice-700": e(d) !== a.value
|
|
115
115
|
}])
|
|
116
116
|
}, [
|
|
117
|
-
|
|
118
|
-
id: `${e(
|
|
117
|
+
r("input", {
|
|
118
|
+
id: `${e(t)}-${a.id}`,
|
|
119
119
|
class: "sr-only",
|
|
120
120
|
type: "radio",
|
|
121
|
-
name: e(
|
|
122
|
-
value:
|
|
123
|
-
checked: e(
|
|
124
|
-
disabled: e(p) ||
|
|
121
|
+
name: e(t),
|
|
122
|
+
value: a.value,
|
|
123
|
+
checked: e(d) === a.value,
|
|
124
|
+
disabled: e(p) || a.disabled,
|
|
125
125
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
126
126
|
(...f) => e(s) && e(s)(...f))
|
|
127
127
|
}, null, 40, Q),
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
r("div", null, [
|
|
129
|
+
r("span", null, w(a.text), 1)
|
|
130
130
|
])
|
|
131
131
|
], 2),
|
|
132
|
-
|
|
133
|
-
class: v(["tile-body border-
|
|
134
|
-
"border-ice-500": e(
|
|
135
|
-
"border-blue-500": e(
|
|
132
|
+
r("div", {
|
|
133
|
+
class: v(["tile-body tw-border-x tw-border-b", {
|
|
134
|
+
"tw-border-ice-500": e(d) !== a.value,
|
|
135
|
+
"tw-border-blue-500": e(d) === a.value
|
|
136
136
|
}])
|
|
137
137
|
}, [
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
r("p", X, w(a.subTitle), 1),
|
|
139
|
+
r("p", Y, w(a.subText), 1)
|
|
140
140
|
], 2)
|
|
141
141
|
], 10, K))), 128))
|
|
142
142
|
]));
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
|
-
const ee = /* @__PURE__ */ k(Z, [["__scopeId", "data-v-
|
|
145
|
+
const ee = /* @__PURE__ */ k(Z, [["__scopeId", "data-v-39d1fcc6"]]);
|
|
146
146
|
var _ = /* @__PURE__ */ ((u) => (u.Radio = "radio", u.Button = "button", u.Chip = "chip", u.Tile = "tile", u))(_ || {});
|
|
147
|
-
const ne = /* @__PURE__ */
|
|
147
|
+
const ne = /* @__PURE__ */ h({
|
|
148
148
|
__name: "RadioGroup",
|
|
149
149
|
props: {
|
|
150
150
|
name: { default: void 0 },
|
|
@@ -162,50 +162,50 @@ const ne = /* @__PURE__ */ y({
|
|
|
162
162
|
showOptionalInLabel: { type: Boolean }
|
|
163
163
|
},
|
|
164
164
|
emits: ["update:modelValue"],
|
|
165
|
-
setup(u, { emit:
|
|
166
|
-
const
|
|
165
|
+
setup(u, { emit: i }) {
|
|
166
|
+
const t = u, p = {
|
|
167
167
|
[_.Button]: S,
|
|
168
168
|
[_.Chip]: A,
|
|
169
169
|
[_.Radio]: U,
|
|
170
170
|
[_.Tile]: ee
|
|
171
171
|
};
|
|
172
172
|
function m(o) {
|
|
173
|
-
|
|
173
|
+
i("update:modelValue", o.target.value);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
return g(
|
|
177
|
-
name: b(() =>
|
|
178
|
-
disabled: b(() =>
|
|
179
|
-
fullWidth: b(() =>
|
|
180
|
-
modelValue: b(() =>
|
|
181
|
-
options: b(() =>
|
|
182
|
-
variant: b(() =>
|
|
175
|
+
const d = E("radio-group-field-error-");
|
|
176
|
+
return g(y.key, {
|
|
177
|
+
name: b(() => t.name),
|
|
178
|
+
disabled: b(() => t.disabled),
|
|
179
|
+
fullWidth: b(() => t.fullWidth),
|
|
180
|
+
modelValue: b(() => t.modelValue),
|
|
181
|
+
options: b(() => t.options),
|
|
182
|
+
variant: b(() => t.variant),
|
|
183
183
|
update: m
|
|
184
|
-
}), (o, s) => (
|
|
184
|
+
}), (o, s) => (l(), B(G, {
|
|
185
185
|
class: v([
|
|
186
186
|
{
|
|
187
|
-
"tw-flex": !
|
|
188
|
-
"tw-flex-wrap": !
|
|
189
|
-
"tw-gap-x-1.5 tw-gap-y-3": !
|
|
190
|
-
"tw-gap-6": !
|
|
187
|
+
"tw-flex": !t.options,
|
|
188
|
+
"tw-flex-wrap": !t.options && (t.variant === e(_).Chip || t.variant === e(_).Radio),
|
|
189
|
+
"tw-gap-x-1.5 tw-gap-y-3": !t.options && t.variant === e(_).Chip,
|
|
190
|
+
"tw-gap-6": !t.options && (t.variant === e(_).Radio || t.variant === e(_).Tile)
|
|
191
191
|
}
|
|
192
192
|
]),
|
|
193
|
-
"aria-errormessage": e(
|
|
194
|
-
"aria-invalid": !!
|
|
193
|
+
"aria-errormessage": e(d),
|
|
194
|
+
"aria-invalid": !!t.errorText,
|
|
195
195
|
role: "radiogroup",
|
|
196
196
|
fieldset: "",
|
|
197
|
-
label:
|
|
198
|
-
"add-bottom-space":
|
|
199
|
-
"error-id": e(
|
|
200
|
-
"error-text":
|
|
201
|
-
"hint-text":
|
|
202
|
-
"show-optional-in-label":
|
|
203
|
-
"is-required":
|
|
204
|
-
"is-read-only":
|
|
197
|
+
label: t.label,
|
|
198
|
+
"add-bottom-space": t.addBottomSpace,
|
|
199
|
+
"error-id": e(d),
|
|
200
|
+
"error-text": t.errorText,
|
|
201
|
+
"hint-text": t.hintText,
|
|
202
|
+
"show-optional-in-label": t.showOptionalInLabel,
|
|
203
|
+
"is-required": t.isRequired,
|
|
204
|
+
"is-read-only": t.isReadOnly
|
|
205
205
|
}, {
|
|
206
206
|
default: T(() => [
|
|
207
|
-
|
|
208
|
-
(
|
|
207
|
+
t.options ? R(o.$slots, "default", { key: 0 }, () => [
|
|
208
|
+
(l(), B(C(p[t.variant])))
|
|
209
209
|
]) : R(o.$slots, "default", { key: 1 })
|
|
210
210
|
]),
|
|
211
211
|
_: 3
|
|
@@ -213,7 +213,7 @@ const ne = /* @__PURE__ */ y({
|
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
215
|
export {
|
|
216
|
-
|
|
216
|
+
y as RADIO_GROUP_INJECTION,
|
|
217
217
|
_ as RadioGroupVariant,
|
|
218
218
|
ne as default
|
|
219
219
|
};
|
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 } 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</script>\n\n<template>\n <div class=\"root flex\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"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 scoped>\n .root label {\n padding: 8px 30px;\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-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: var(--border-radius);\n border-bottom-left-radius: var(--border-radius);\n }\n\n .root > div:last-child label {\n border-top-right-radius: var(--border-radius);\n border-bottom-right-radius: var(--border-radius);\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 } 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</script>\n\n<template>\n <div class=\"root flex flex-wrap tw-my-1.5\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"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 scoped>\n .root {\n gap: var(--ll-space-3);\n }\n\n .root label {\n padding: var(--ll-space-1) var(--ll-space-2);\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-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: var(--font-weight-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 } 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</script>\n\n<template>\n <div class=\"root flex flex-wrap\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ '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 scoped>\n .root {\n gap: var(--ll-space-3);\n }\n\n .root label {\n font-weight: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 var(--ll-space-2);\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 } 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</script>\n\n<template>\n <div class=\"root flex flex-wrap\">\n <label\n v-for=\"option in options\"\n :key=\"`${name}-${option.id}`\"\n class=\"tile-container\"\n :class=\"{ 'w-full': fullWidth }\"\n :for=\"`${name}-${option.id}`\"\n >\n <div\n class=\"tile-header border flex\"\n :class=\"{\n 'border-blue-500 bg-blue-100 color-ice-900': modelValue === option.value,\n 'border-ice-500 bg-ice-100 color-ice-700': modelValue !== option.value,\n }\"\n >\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"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=\"tile-body border-r border-b border-l\"\n :class=\"{\n 'border-ice-500': modelValue !== option.value,\n 'border-blue-500': modelValue === option.value,\n }\"\n >\n <p class=\"color-ice-900 tw-m-0\">{{ option.subTitle }}</p>\n <p class=\"color-ice-700 tw-m-0\">{{ option.subText }}</p>\n </div>\n </label>\n </div>\n</template>\n\n<style scoped>\n .root {\n gap: var(--ll-space-3);\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: var(--border-radius);\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: var(--border-radius) var(--border-radius) 0 0;\n padding: var(--ll-space-2) 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 var(--border-radius) var(--border-radius);\n background-color: var(--color-white);\n padding: var(--ll-space-3);\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: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 var(--ll-space-2);\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: var(--ll-space-2);\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 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 or not 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","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;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN7D,UAAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN7D,UAAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;ACN7D,UAAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTzD,IAAAS,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCiFJC,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,aAASN,EAAOO,GAAU;AACnB,MAAAC,EAAA,qBAAsBD,EAAE,OAA4B,KAAK;AAAA,IAChE;AAEM,UAAAE,IAAUC,EAAS,0BAA0B;AAEnD,WAAAC,EAAQjB,EAAsB,KAAK;AAAA,MACjC,MAAMkB,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,QAAAb;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 } 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</script>\n\n<template>\n <div class=\"root tw-flex\">\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=\"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 scoped>\n .root label {\n padding: 8px 30px;\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-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: var(--border-radius);\n border-bottom-left-radius: var(--border-radius);\n }\n\n .root > div:last-child label {\n border-top-right-radius: var(--border-radius);\n border-bottom-right-radius: var(--border-radius);\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 } 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</script>\n\n<template>\n <div class=\"root tw-my-1.5 tw-flex tw-flex-wrap\">\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=\"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 scoped>\n .root {\n gap: var(--ll-space-3);\n }\n\n .root label {\n padding: var(--ll-space-1) var(--ll-space-2);\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-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: var(--font-weight-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 } 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</script>\n\n<template>\n <div class=\"root tw-flex tw-flex-wrap\">\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 scoped>\n .root {\n gap: var(--ll-space-3);\n }\n\n .root label {\n font-weight: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 var(--ll-space-2);\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 } 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</script>\n\n<template>\n <div class=\"root tw-flex tw-flex-wrap\">\n <label\n v-for=\"option in options\"\n :key=\"`${name}-${option.id}`\"\n class=\"tile-container\"\n :class=\"{ 'tw-w-full': fullWidth }\"\n :for=\"`${name}-${option.id}`\"\n >\n <div\n class=\"tile-header tw-flex tw-border\"\n :class=\"{\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 <input\n :id=\"`${name}-${option.id}`\"\n class=\"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=\"tile-body tw-border-x tw-border-b\"\n :class=\"{\n 'tw-border-ice-500': modelValue !== option.value,\n 'tw-border-blue-500': modelValue === option.value,\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 scoped>\n .root {\n gap: var(--ll-space-3);\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: var(--border-radius);\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: var(--border-radius) var(--border-radius) 0 0;\n padding: var(--ll-space-2) 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 var(--border-radius) var(--border-radius);\n background-color: var(--color-white);\n padding: var(--ll-space-3);\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: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 var(--ll-space-2);\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: var(--ll-space-2);\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 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 or not 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","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;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN7D,UAAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN7D,UAAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;ACN7D,UAAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTzD,IAAAS,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCiFJC,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,aAASN,EAAOO,GAAU;AACnB,MAAAC,EAAA,qBAAsBD,EAAE,OAA4B,KAAK;AAAA,IAChE;AAEM,UAAAE,IAAUC,EAAS,0BAA0B;AAEnD,WAAAC,EAAQjB,EAAsB,KAAK;AAAA,MACjC,MAAMkB,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,QAAAb;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/RadioNew.js
CHANGED
|
@@ -97,7 +97,7 @@ const M = /* @__PURE__ */ v(S, [["__scopeId", "data-v-2b097f35"]]), z = ["id", "
|
|
|
97
97
|
onInput: l[0] || (l[0] = (i) => d("input", i))
|
|
98
98
|
}, null, 40, z),
|
|
99
99
|
w(t("label", {
|
|
100
|
-
class: s(["label", { "text-ice-500": e.disabled }]),
|
|
100
|
+
class: s(["label", { "tw-text-ice-500": e.disabled }]),
|
|
101
101
|
for: `${e.name}-${e.id}`
|
|
102
102
|
}, m(e.label), 11, A), [
|
|
103
103
|
[B, e.label]
|
|
@@ -105,7 +105,7 @@ const M = /* @__PURE__ */ v(S, [["__scopeId", "data-v-2b097f35"]]), z = ["id", "
|
|
|
105
105
|
], 2));
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
const I = /* @__PURE__ */ v(F, [["__scopeId", "data-v-
|
|
108
|
+
const I = /* @__PURE__ */ v(F, [["__scopeId", "data-v-6ae860ec"]]), J = ["for"], P = ["id", "aria-labelledby", "name", "value", "checked", "disabled"], U = ["id"], q = /* @__PURE__ */ r({
|
|
109
109
|
__name: "VariantTile",
|
|
110
110
|
props: {
|
|
111
111
|
disabled: { type: Boolean },
|
|
@@ -124,7 +124,7 @@ const I = /* @__PURE__ */ v(F, [["__scopeId", "data-v-958e0dc3"]]), J = ["for"],
|
|
|
124
124
|
for: `${e.name}-${e.id}`
|
|
125
125
|
}, [
|
|
126
126
|
t("div", {
|
|
127
|
-
class: s(["tile-header
|
|
127
|
+
class: s(["tile-header tw-flex tw-border", {
|
|
128
128
|
"tw-border-blue-500 tw-bg-blue-100": e.modelValue === e.value && !e.disabled,
|
|
129
129
|
"tw-border-ice-500 tw-bg-ice-100": e.modelValue !== e.value || e.disabled
|
|
130
130
|
}])
|
|
@@ -156,7 +156,7 @@ const I = /* @__PURE__ */ v(F, [["__scopeId", "data-v-958e0dc3"]]), J = ["for"],
|
|
|
156
156
|
], 10, J));
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
-
const H = /* @__PURE__ */ v(q, [["__scopeId", "data-v-
|
|
159
|
+
const H = /* @__PURE__ */ v(q, [["__scopeId", "data-v-4255697e"]]);
|
|
160
160
|
var u = /* @__PURE__ */ ((a) => (a.Radio = "radio", a.Button = "button", a.Chip = "chip", a.Tile = "tile", a))(u || {});
|
|
161
161
|
const Y = /* @__PURE__ */ r({
|
|
162
162
|
__name: "RadioNew",
|
package/dist/SearchBar.js
CHANGED
|
@@ -12,8 +12,8 @@ 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-
|
|
16
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
15
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
16
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
17
17
|
const W = /* @__PURE__ */ C({
|
|
18
18
|
name: "ll-search-bar",
|
|
19
19
|
__name: "SearchBar",
|
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-4483019d.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";
|
|
@@ -22,7 +22,7 @@ import "lodash-es/isFinite";
|
|
|
22
22
|
import "./utils/colorScheme.js";
|
|
23
23
|
import "./index-79ce320f.js";
|
|
24
24
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
25
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
25
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
26
26
|
import "./locale.js";
|
|
27
27
|
const ge = Math.min, N = Math.max, Ae = Math.round, Be = Math.floor, X = (e) => ({
|
|
28
28
|
x: e,
|
|
@@ -956,7 +956,7 @@ function Rn(e, n, t) {
|
|
|
956
956
|
update: E
|
|
957
957
|
};
|
|
958
958
|
}
|
|
959
|
-
const On = (e) => (Mt("data-v-
|
|
959
|
+
const On = (e) => (Mt("data-v-fa811e90"), e = e(), Dt(), e), kn = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], Tn = ["selected", "value"], Bn = /* @__PURE__ */ On(() => /* @__PURE__ */ z("option", { value: "" }, null, -1)), An = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled", "onKeyup"], Ln = ["id"], Mn = ["onKeypress", "onMousedown"], Dn = {
|
|
960
960
|
key: 0,
|
|
961
961
|
class: "stash-select__total"
|
|
962
962
|
}, Fn = {
|
|
@@ -1317,7 +1317,7 @@ const On = (e) => (Mt("data-v-32017b62"), e = e(), Dt(), e), kn = ["id", "aria-e
|
|
|
1317
1317
|
de(z("div", {
|
|
1318
1318
|
ref_key: "optionsWrapperRef",
|
|
1319
1319
|
ref: u,
|
|
1320
|
-
class: "stash-select__border-selector border-selector tw-w-full tw-shadow",
|
|
1320
|
+
class: "stash-select__border-selector tw-border-selector tw-w-full tw-shadow",
|
|
1321
1321
|
style: At(F(C)),
|
|
1322
1322
|
onClick: m[3] || (m[3] = he(() => {
|
|
1323
1323
|
}, ["stop"]))
|
|
@@ -1401,7 +1401,7 @@ const On = (e) => (Mt("data-v-32017b62"), e = e(), Dt(), e), kn = ["id", "aria-e
|
|
|
1401
1401
|
]), 1032, ["id", "add-bottom-space", "class", "error-text", "hint-text", "label", "show-optional-in-label"]));
|
|
1402
1402
|
}
|
|
1403
1403
|
});
|
|
1404
|
-
const ho = /* @__PURE__ */ Ut(Hn, [["__scopeId", "data-v-
|
|
1404
|
+
const ho = /* @__PURE__ */ Ut(Hn, [["__scopeId", "data-v-fa811e90"]]);
|
|
1405
1405
|
export {
|
|
1406
1406
|
ho as default
|
|
1407
1407
|
};
|