@leaflink/stash 44.0.0-beta.7 → 44.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -39
- package/dist/ActionsDropdown.js +2 -2
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +2 -2
- package/dist/AppNavigationItem.js +1 -1
- package/dist/AppSidebar.js +13 -13
- package/dist/AppSidebar.js.map +1 -1
- package/dist/Badge.vue.d.ts +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js +17 -0
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js.map +1 -0
- package/dist/ButtonGroup.js +19 -19
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Checkbox.js +57 -46
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +2 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js +9 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js.map +1 -0
- package/dist/ChevronToggle.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataView.js +1 -1
- package/dist/DataViewFilters.js +4 -4
- package/dist/DataViewSortButton.js +47 -38
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +2 -2
- package/dist/DatePicker.js +8 -8
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +1 -1
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +33 -33
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +4 -4
- package/dist/Divider.js.map +1 -1
- package/dist/Expand.js +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-b6a57ae9.js → Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js} +12 -13
- package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +1 -0
- package/dist/Field.js +2 -2
- package/dist/Field.vue.d.ts +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-4483019d.js → Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js} +2 -2
- package/dist/Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js.map +1 -0
- package/dist/FileUpload.js +7 -7
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +30 -30
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDropdown.js +2 -2
- package/dist/FilterSelect.js +2 -2
- package/dist/Filters.js +39 -39
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +6 -6
- package/dist/IconLabel.js +6 -6
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/Illustration.js +10 -60
- package/dist/Illustration.js.map +1 -1
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js +56 -0
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js.map +1 -0
- package/dist/Image.js +67 -72
- package/dist/Image.js.map +1 -1
- package/dist/InlineEdit.js +2 -2
- package/dist/Input.js +53 -53
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +2 -2
- package/dist/Label.js +1 -1
- package/dist/Label.vue.d.ts +13 -2
- package/dist/{Label.vue_vue_type_script_setup_true_lang-2de35913.js → Label.vue_vue_type_script_setup_true_lang-4b02087f.js} +12 -11
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +1 -0
- package/dist/ListItem.js +11 -11
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemCell.js +9 -9
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListView.js +83 -80
- package/dist/ListView.js.map +1 -1
- package/dist/Loading.js +17 -10
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js +8 -0
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js.map +1 -0
- package/dist/MenuItem.js +20 -14
- package/dist/MenuItem.js.map +1 -1
- package/dist/Modal.js +2 -2
- package/dist/Modal.js.map +1 -1
- package/dist/ObfuscateText.js +30 -32
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +1 -1
- package/dist/PageContent.js +9 -9
- package/dist/PageContent.js.map +1 -1
- package/dist/PageHeader.js +22 -22
- package/dist/PageHeader.js.map +1 -1
- package/dist/Paginate.js +1 -1
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js +11 -0
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js.map +1 -0
- package/dist/Radio.js +24 -19
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +43 -43
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchBar.js +32 -32
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +5 -5
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +2 -2
- package/dist/Switch.js +41 -34
- package/dist/Switch.js.map +1 -1
- package/dist/Table.js +6 -6
- package/dist/Table.keys-cf93df19.js +27 -0
- package/dist/{Table.keys-75e99266.js.map → Table.keys-cf93df19.js.map} +1 -1
- package/dist/TableCell.js +5 -5
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +32 -32
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +10 -10
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +6 -6
- package/dist/TableRow.js.map +1 -1
- package/dist/Textarea.js +49 -41
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.js +23 -23
- package/dist/Toast.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/constants.d.ts +26 -19
- package/dist/constants.js +41 -26
- package/dist/constants.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tailwind-base.d.ts +16 -16
- package/dist/tailwind-base.js +7 -4
- package/dist/tailwind-base.js.map +1 -1
- package/package.json +1 -1
- package/styles/backwards-compat.css +41 -104
- package/styles/base.css +258 -112
- package/tailwind-base.ts +3 -0
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js +0 -17
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js +0 -2
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js.map +0 -1
- package/dist/Expand.vue_vue_type_script_setup_true_lang-b6a57ae9.js.map +0 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-4483019d.js.map +0 -1
- package/dist/Label.vue_vue_type_script_setup_true_lang-2de35913.js.map +0 -1
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js +0 -2
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js.map +0 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js +0 -11
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js.map +0 -1
- package/dist/Table.keys-75e99266.js +0 -27
- package/styles/_base.scss +0 -493
- package/styles/elements/_links.scss +0 -32
- package/styles/elements/_lists.scss +0 -31
- package/styles/elements/_misc.scss +0 -16
- package/styles/main.scss +0 -38
package/dist/RadioGroup.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as $, inject as x, useCssModule as k, openBlock as l, createElementBlock as n, normalizeClass as _, unref as e, Fragment as V, renderList as
|
|
1
|
+
import { defineComponent as $, inject as x, useCssModule as k, openBlock as l, createElementBlock as n, normalizeClass as _, unref as e, Fragment as V, renderList as B, createElementVNode as r, toDisplayString as h, provide as g, computed as v, createBlock as C, withCtx as M, renderSlot as T, resolveDynamicComponent as E } from "vue";
|
|
2
2
|
import G from "lodash-es/uniqueId";
|
|
3
|
-
import { _ as O } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as O } from "./Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js";
|
|
4
4
|
import { R as y } from "./RadioGroup.keys-974818d6.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as R } from "./_plugin-vue_export-helper-dad06003.js";
|
|
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__ */ $({
|
|
@@ -12,13 +12,13 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
12
12
|
const o = x(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: f, fullWidth: w, modelValue: s, options: i, update: d } = o, p = k();
|
|
16
|
+
return (I, c) => (l(), n("div", {
|
|
17
17
|
class: _(["tw-flex", e(p).root])
|
|
18
18
|
}, [
|
|
19
|
-
(l(!0), n(V, null,
|
|
19
|
+
(l(!0), n(V, null, B(e(i), (a) => (l(), n("div", {
|
|
20
20
|
key: `${e(t)}-${a.id}`,
|
|
21
|
-
class: _([{ "tw-w-full": e(
|
|
21
|
+
class: _([{ "tw-w-full": e(w) }])
|
|
22
22
|
}, [
|
|
23
23
|
r("input", {
|
|
24
24
|
id: `${e(t)}-${a.id}`,
|
|
@@ -27,7 +27,7 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
27
27
|
name: e(t),
|
|
28
28
|
value: a.value,
|
|
29
29
|
checked: e(s) === a.value,
|
|
30
|
-
disabled: e(
|
|
30
|
+
disabled: e(f) || a.disabled,
|
|
31
31
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
32
32
|
(...b) => e(d) && e(d)(...b))
|
|
33
33
|
}, null, 40, W),
|
|
@@ -37,23 +37,23 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
37
37
|
], 2))), 128))
|
|
38
38
|
], 2));
|
|
39
39
|
}
|
|
40
|
-
}), S = "
|
|
40
|
+
}), S = "_root_1bamn_2", D = {
|
|
41
41
|
root: S
|
|
42
42
|
}, L = {
|
|
43
43
|
$style: D
|
|
44
|
-
}, N = /* @__PURE__ */
|
|
44
|
+
}, N = /* @__PURE__ */ R(q, [["__cssModules", L]]), z = ["id", "name", "value", "checked", "disabled"], A = ["for"], F = /* @__PURE__ */ $({
|
|
45
45
|
__name: "VariantChip",
|
|
46
46
|
setup(u) {
|
|
47
47
|
const o = x(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: f, fullWidth: w, modelValue: s, options: i, update: d } = o, p = k();
|
|
51
|
+
return (I, c) => (l(), n("div", {
|
|
52
52
|
class: _(["tw-my-1.5 tw-flex tw-flex-wrap", e(p).root])
|
|
53
53
|
}, [
|
|
54
|
-
(l(!0), n(V, null,
|
|
54
|
+
(l(!0), n(V, null, B(e(i), (a) => (l(), n("div", {
|
|
55
55
|
key: `${e(t)}-${a.id}`,
|
|
56
|
-
class: _([{ "tw-w-full": e(
|
|
56
|
+
class: _([{ "tw-w-full": e(w) }])
|
|
57
57
|
}, [
|
|
58
58
|
r("input", {
|
|
59
59
|
id: `${e(t)}-${a.id}`,
|
|
@@ -62,7 +62,7 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
62
62
|
name: e(t),
|
|
63
63
|
value: a.value,
|
|
64
64
|
checked: e(s) === a.value,
|
|
65
|
-
disabled: e(
|
|
65
|
+
disabled: e(f) || a.disabled,
|
|
66
66
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
67
67
|
(...b) => e(d) && e(d)(...b))
|
|
68
68
|
}, null, 40, z),
|
|
@@ -72,23 +72,23 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
72
72
|
], 2))), 128))
|
|
73
73
|
], 2));
|
|
74
74
|
}
|
|
75
|
-
}), J = "
|
|
75
|
+
}), J = "_root_kagur_2", P = {
|
|
76
76
|
root: J
|
|
77
77
|
}, U = {
|
|
78
78
|
$style: P
|
|
79
|
-
}, H = /* @__PURE__ */
|
|
79
|
+
}, H = /* @__PURE__ */ R(F, [["__cssModules", U]]), K = ["id", "name", "value", "checked", "disabled"], Q = ["for"], X = /* @__PURE__ */ $({
|
|
80
80
|
__name: "VariantRadio",
|
|
81
81
|
setup(u) {
|
|
82
82
|
const o = x(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: f, fullWidth: w, modelValue: s, options: i, update: d } = o, p = k();
|
|
86
|
+
return (I, c) => (l(), n("div", {
|
|
87
87
|
class: _(["tw-flex tw-flex-wrap", e(p).root])
|
|
88
88
|
}, [
|
|
89
|
-
(l(!0), n(V, null,
|
|
89
|
+
(l(!0), n(V, null, B(e(i), (a) => (l(), n("div", {
|
|
90
90
|
key: `${e(t)}-${a.id}`,
|
|
91
|
-
class: _([{ "tw-w-full": e(
|
|
91
|
+
class: _([{ "tw-w-full": e(w) }])
|
|
92
92
|
}, [
|
|
93
93
|
r("input", {
|
|
94
94
|
id: `${e(t)}-${a.id}`,
|
|
@@ -96,7 +96,7 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
96
96
|
name: e(t),
|
|
97
97
|
value: a.value,
|
|
98
98
|
checked: e(s) === a.value,
|
|
99
|
-
disabled: e(
|
|
99
|
+
disabled: e(f) || a.disabled,
|
|
100
100
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
101
101
|
(...b) => e(d) && e(d)(...b))
|
|
102
102
|
}, null, 40, K),
|
|
@@ -106,23 +106,23 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
106
106
|
], 2))), 128))
|
|
107
107
|
], 2));
|
|
108
108
|
}
|
|
109
|
-
}), Y = "
|
|
109
|
+
}), Y = "_root_11y1n_2", Z = {
|
|
110
110
|
root: Y
|
|
111
111
|
}, ee = {
|
|
112
112
|
$style: Z
|
|
113
|
-
}, te = /* @__PURE__ */
|
|
113
|
+
}, te = /* @__PURE__ */ R(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
116
|
const o = x(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: f, fullWidth: w, modelValue: s, options: i, update: d } = o, p = k();
|
|
120
|
+
return (I, c) => (l(), n("div", {
|
|
121
121
|
class: _(["tw-flex tw-flex-wrap", e(p).root])
|
|
122
122
|
}, [
|
|
123
|
-
(l(!0), n(V, null,
|
|
123
|
+
(l(!0), n(V, null, B(e(i), (a) => (l(), n("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(w) }]),
|
|
126
126
|
for: `${e(t)}-${a.id}`
|
|
127
127
|
}, [
|
|
128
128
|
r("div", {
|
|
@@ -141,7 +141,7 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
141
141
|
name: e(t),
|
|
142
142
|
value: a.value,
|
|
143
143
|
checked: e(s) === a.value,
|
|
144
|
-
disabled: e(
|
|
144
|
+
disabled: e(f) || a.disabled,
|
|
145
145
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
146
146
|
(...b) => e(d) && e(d)(...b))
|
|
147
147
|
}, null, 40, se),
|
|
@@ -164,14 +164,14 @@ const W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @_
|
|
|
164
164
|
], 10, ae))), 128))
|
|
165
165
|
], 2));
|
|
166
166
|
}
|
|
167
|
-
}), ie = "
|
|
167
|
+
}), ie = "_root_1sppn_2", de = {
|
|
168
168
|
root: ie,
|
|
169
|
-
"tile-container": "_tile-
|
|
170
|
-
"tile-header": "_tile-
|
|
171
|
-
"tile-body": "_tile-
|
|
169
|
+
"tile-container": "_tile-container_1sppn_23",
|
|
170
|
+
"tile-header": "_tile-header_1sppn_30",
|
|
171
|
+
"tile-body": "_tile-body_1sppn_31"
|
|
172
172
|
}, ne = {
|
|
173
173
|
$style: de
|
|
174
|
-
}, ue = /* @__PURE__ */
|
|
174
|
+
}, ue = /* @__PURE__ */ R(re, [["__cssModules", ne]]);
|
|
175
175
|
var m = /* @__PURE__ */ ((u) => (u.Radio = "radio", u.Button = "button", u.Chip = "chip", u.Tile = "tile", u))(m || {});
|
|
176
176
|
const he = /* @__PURE__ */ $({
|
|
177
177
|
__name: "RadioGroup",
|
|
@@ -192,25 +192,25 @@ const he = /* @__PURE__ */ $({
|
|
|
192
192
|
},
|
|
193
193
|
emits: ["update:modelValue"],
|
|
194
194
|
setup(u, { emit: o }) {
|
|
195
|
-
const t = u,
|
|
195
|
+
const t = u, f = {
|
|
196
196
|
[m.Button]: N,
|
|
197
197
|
[m.Chip]: H,
|
|
198
198
|
[m.Radio]: te,
|
|
199
199
|
[m.Tile]: ue
|
|
200
200
|
};
|
|
201
|
-
function
|
|
201
|
+
function w(i) {
|
|
202
202
|
o("update:modelValue", i.target.value);
|
|
203
203
|
}
|
|
204
204
|
const s = G("radio-group-field-error-");
|
|
205
|
-
return
|
|
205
|
+
return g(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, d) => (l(),
|
|
212
|
+
update: w
|
|
213
|
+
}), (i, d) => (l(), C(O, {
|
|
214
214
|
class: _([
|
|
215
215
|
{
|
|
216
216
|
"tw-flex": !t.options,
|
|
@@ -233,9 +233,9 @@ const he = /* @__PURE__ */ $({
|
|
|
233
233
|
"is-read-only": t.isReadOnly
|
|
234
234
|
}, {
|
|
235
235
|
default: M(() => [
|
|
236
|
-
t.options ?
|
|
237
|
-
(l(),
|
|
238
|
-
]) :
|
|
236
|
+
t.options ? T(i.$slots, "default", { key: 0 }, () => [
|
|
237
|
+
(l(), C(E(f[t.variant])))
|
|
238
|
+
]) : T(i.$slots, "default", { key: 1 })
|
|
239
239
|
]),
|
|
240
240
|
_: 3
|
|
241
241
|
}, 8, ["class", "aria-errormessage", "aria-invalid", "label", "add-bottom-space", "error-id", "error-text", "hint-text", "show-optional-in-label", "is-required", "is-read-only"]));
|
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: 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, 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: 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, 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: 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, 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: 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","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;;;;;;;;;;;;;;;;;;;;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,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 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","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;;;;;;;;;;;;;;;;;;;;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,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
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as C, useCssModule as B, useSlots as S, ref as
|
|
1
|
+
import { defineComponent as C, useCssModule as B, useSlots as S, ref as m, openBlock as h, createBlock as f, normalizeClass as o, unref as r, withKeys as V, createSlots as w, withCtx as n, createVNode as u, createCommentVNode as I, renderSlot as L } from "vue";
|
|
2
2
|
import { t as b } from "./locale.js";
|
|
3
3
|
import _ from "./Button.js";
|
|
4
4
|
import v from "./Icon.js";
|
|
5
5
|
import T from "./Input.js";
|
|
6
|
-
import { _ as
|
|
6
|
+
import { _ as j } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "lodash-es/get";
|
|
8
|
-
import "./Button.vue_used_vue_type_style_index_0_lang.module-
|
|
8
|
+
import "./Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js";
|
|
9
9
|
import "lodash-es/uniqueId";
|
|
10
10
|
import "./index-79ce320f.js";
|
|
11
11
|
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-
|
|
17
|
-
const
|
|
15
|
+
import "./Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js";
|
|
16
|
+
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
17
|
+
const M = /* @__PURE__ */ C({
|
|
18
18
|
name: "ll-search-bar",
|
|
19
19
|
__name: "SearchBar",
|
|
20
20
|
props: {
|
|
@@ -26,24 +26,24 @@ const W = /* @__PURE__ */ C({
|
|
|
26
26
|
hintText: { default: void 0 }
|
|
27
27
|
},
|
|
28
28
|
emits: ["search", "update:model-value"],
|
|
29
|
-
setup(
|
|
30
|
-
const e =
|
|
29
|
+
setup(k, { emit: s }) {
|
|
30
|
+
const e = k, c = B(), g = S(), t = m(e.modelValue), i = m();
|
|
31
31
|
function d() {
|
|
32
|
-
s("search",
|
|
32
|
+
s("search", t.value);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
var l,
|
|
36
|
-
|
|
34
|
+
function y() {
|
|
35
|
+
var l, a;
|
|
36
|
+
t.value = "", s("search", ""), s("update:model-value", ""), (a = (l = i.value) == null ? void 0 : l.inputEl) == null || a.focus();
|
|
37
37
|
}
|
|
38
38
|
function x() {
|
|
39
|
-
s("update:model-value",
|
|
39
|
+
s("update:model-value", t.value);
|
|
40
40
|
}
|
|
41
|
-
return (l,
|
|
41
|
+
return (l, a) => (h(), f(T, {
|
|
42
42
|
ref_key: "stashInputRef",
|
|
43
|
-
ref:
|
|
44
|
-
modelValue:
|
|
43
|
+
ref: i,
|
|
44
|
+
modelValue: t.value,
|
|
45
45
|
"onUpdate:modelValue": [
|
|
46
|
-
|
|
46
|
+
a[0] || (a[0] = (p) => t.value = p),
|
|
47
47
|
x
|
|
48
48
|
],
|
|
49
49
|
class: o(["stash-search-bar", r(c)["search-input"]]),
|
|
@@ -51,30 +51,30 @@ const W = /* @__PURE__ */ C({
|
|
|
51
51
|
placeholder: e.placeholder,
|
|
52
52
|
"hint-text": e.hintText,
|
|
53
53
|
"data-test": "stash-search-bar",
|
|
54
|
-
onKeyup:
|
|
54
|
+
onKeyup: a[1] || (a[1] = V((p) => !e.isLoading && d(), ["enter"]))
|
|
55
55
|
}, w({
|
|
56
56
|
append: n(() => [
|
|
57
|
-
|
|
57
|
+
t.value ? (h(), f(_, {
|
|
58
58
|
key: 0,
|
|
59
59
|
class: o(r(c)["clear-button"]),
|
|
60
60
|
disabled: e.isLoading,
|
|
61
61
|
"data-test": "stash-search-bar|clear-button",
|
|
62
|
-
onClick:
|
|
62
|
+
onClick: y
|
|
63
63
|
}, {
|
|
64
64
|
default: n(() => [
|
|
65
|
-
|
|
65
|
+
u(v, { name: "close" })
|
|
66
66
|
]),
|
|
67
67
|
_: 1
|
|
68
68
|
}, 8, ["class", "disabled"])) : I("", !0),
|
|
69
|
-
|
|
69
|
+
u(_, {
|
|
70
70
|
"data-test": "stash-search-bar|search-button",
|
|
71
71
|
disabled: e.isLoading,
|
|
72
72
|
class: o(r(c)["search-button"]),
|
|
73
73
|
onClick: d
|
|
74
74
|
}, {
|
|
75
75
|
default: n(() => [
|
|
76
|
-
|
|
77
|
-
class: o({ "
|
|
76
|
+
u(v, {
|
|
77
|
+
class: o({ "tw-animate-spin tw-text-teal-500": e.isWorking }),
|
|
78
78
|
name: e.isWorking ? "working" : "search"
|
|
79
79
|
}, null, 8, ["class", "name"])
|
|
80
80
|
]),
|
|
@@ -83,7 +83,7 @@ const W = /* @__PURE__ */ C({
|
|
|
83
83
|
]),
|
|
84
84
|
_: 2
|
|
85
85
|
}, [
|
|
86
|
-
r(
|
|
86
|
+
r(g).hint ? {
|
|
87
87
|
name: "hint",
|
|
88
88
|
fn: n(() => [
|
|
89
89
|
L(l.$slots, "hint")
|
|
@@ -92,13 +92,13 @@ const W = /* @__PURE__ */ C({
|
|
|
92
92
|
} : void 0
|
|
93
93
|
]), 1032, ["modelValue", "class", "label", "placeholder", "hint-text"]));
|
|
94
94
|
}
|
|
95
|
-
}),
|
|
96
|
-
"search-input": "_search-
|
|
97
|
-
"clear-button": "_clear-
|
|
98
|
-
"search-button": "_search-
|
|
99
|
-
},
|
|
100
|
-
$style:
|
|
101
|
-
}, X = /* @__PURE__ */ M
|
|
95
|
+
}), W = {
|
|
96
|
+
"search-input": "_search-input_jm4a0_2",
|
|
97
|
+
"clear-button": "_clear-button_jm4a0_8",
|
|
98
|
+
"search-button": "_search-button_jm4a0_23"
|
|
99
|
+
}, $ = {
|
|
100
|
+
$style: W
|
|
101
|
+
}, X = /* @__PURE__ */ j(M, [["__cssModules", $]]);
|
|
102
102
|
export {
|
|
103
103
|
X as default
|
|
104
104
|
};
|
package/dist/SearchBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sources":["../src/components/SearchBar/SearchBar.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { ref, useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import Input from '../Input/Input.vue';\n\n export interface SearchBarProps {\n /**\n * Indicates loading activity (for example async request) that should prevent search\n */\n isLoading?: boolean;\n\n /**\n * Sets a visual indicator that the search is active\n */\n isWorking?: boolean;\n\n /**\n * The search term\n */\n modelValue?: string;\n\n /**\n * Placeholder text for the input\n */\n placeholder?: string;\n\n /**\n * Label for search bar\n */\n label?: string;\n\n /**\n * Text below the input\n */\n hintText?: string;\n }\n\n defineOptions({\n name: 'll-search-bar',\n });\n\n const props = withDefaults(defineProps<SearchBarProps>(), {\n isLoading: false,\n isWorking: false,\n modelValue: '',\n placeholder: t('ll.search'),\n label: t('ll.search'),\n hintText: undefined,\n });\n\n const emit =\n defineEmits<{\n /**\n * Emitted when searching or clearing the search input\n */\n (e: 'search', searchTerm: string): void;\n\n /**\n * Emitted when the search term changes\n */\n (e: 'update:model-value', searchTerm: string): void;\n }>();\n\n const classes = useCssModule();\n const slots = useSlots();\n const searchTerm = ref(props.modelValue);\n const stashInputRef = ref<InstanceType<typeof Input>>();\n\n function onSearch() {\n emit('search', searchTerm.value);\n }\n\n function clearSearchTerm() {\n searchTerm.value = '';\n emit('search', '');\n emit('update:model-value', '');\n\n stashInputRef.value?.inputEl?.focus();\n }\n\n function handleChange() {\n emit('update:model-value', searchTerm.value);\n }\n</script>\n\n<template>\n <Input\n ref=\"stashInputRef\"\n v-model=\"searchTerm\"\n class=\"stash-search-bar\"\n :class=\"classes['search-input']\"\n :label=\"props.label\"\n :placeholder=\"props.placeholder\"\n :hint-text=\"props.hintText\"\n data-test=\"stash-search-bar\"\n @update:model-value=\"handleChange\"\n @keyup.enter=\"!props.isLoading && onSearch()\"\n >\n <template #append>\n <Button\n v-if=\"searchTerm\"\n :class=\"classes['clear-button']\"\n :disabled=\"props.isLoading\"\n data-test=\"stash-search-bar|clear-button\"\n @click=\"clearSearchTerm\"\n >\n <Icon name=\"close\" />\n </Button>\n <Button\n data-test=\"stash-search-bar|search-button\"\n :disabled=\"props.isLoading\"\n :class=\"classes['search-button']\"\n @click=\"onSearch\"\n >\n <Icon
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":["../src/components/SearchBar/SearchBar.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { ref, useCssModule, useSlots } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n import Input from '../Input/Input.vue';\n\n export interface SearchBarProps {\n /**\n * Indicates loading activity (for example async request) that should prevent search\n */\n isLoading?: boolean;\n\n /**\n * Sets a visual indicator that the search is active\n */\n isWorking?: boolean;\n\n /**\n * The search term\n */\n modelValue?: string;\n\n /**\n * Placeholder text for the input\n */\n placeholder?: string;\n\n /**\n * Label for search bar\n */\n label?: string;\n\n /**\n * Text below the input\n */\n hintText?: string;\n }\n\n defineOptions({\n name: 'll-search-bar',\n });\n\n const props = withDefaults(defineProps<SearchBarProps>(), {\n isLoading: false,\n isWorking: false,\n modelValue: '',\n placeholder: t('ll.search'),\n label: t('ll.search'),\n hintText: undefined,\n });\n\n const emit =\n defineEmits<{\n /**\n * Emitted when searching or clearing the search input\n */\n (e: 'search', searchTerm: string): void;\n\n /**\n * Emitted when the search term changes\n */\n (e: 'update:model-value', searchTerm: string): void;\n }>();\n\n const classes = useCssModule();\n const slots = useSlots();\n const searchTerm = ref(props.modelValue);\n const stashInputRef = ref<InstanceType<typeof Input>>();\n\n function onSearch() {\n emit('search', searchTerm.value);\n }\n\n function clearSearchTerm() {\n searchTerm.value = '';\n emit('search', '');\n emit('update:model-value', '');\n\n stashInputRef.value?.inputEl?.focus();\n }\n\n function handleChange() {\n emit('update:model-value', searchTerm.value);\n }\n</script>\n\n<template>\n <Input\n ref=\"stashInputRef\"\n v-model=\"searchTerm\"\n class=\"stash-search-bar\"\n :class=\"classes['search-input']\"\n :label=\"props.label\"\n :placeholder=\"props.placeholder\"\n :hint-text=\"props.hintText\"\n data-test=\"stash-search-bar\"\n @update:model-value=\"handleChange\"\n @keyup.enter=\"!props.isLoading && onSearch()\"\n >\n <template #append>\n <Button\n v-if=\"searchTerm\"\n :class=\"classes['clear-button']\"\n :disabled=\"props.isLoading\"\n data-test=\"stash-search-bar|clear-button\"\n @click=\"clearSearchTerm\"\n >\n <Icon name=\"close\" />\n </Button>\n <Button\n data-test=\"stash-search-bar|search-button\"\n :disabled=\"props.isLoading\"\n :class=\"classes['search-button']\"\n @click=\"onSearch\"\n >\n <Icon\n :class=\"{ 'tw-animate-spin tw-text-teal-500': props.isWorking }\"\n :name=\"props.isWorking ? 'working' : 'search'\"\n />\n </Button>\n </template>\n <template v-if=\"slots.hint\" #hint>\n <!-- @slot Overrides the Input hint-text prop -->\n <slot name=\"hint\"></slot>\n </template>\n </Input>\n</template>\n\n<style module>\n .search-input :global(.stash-input-append) {\n display: flex;\n justify-content: flex-end;\n width: 72px; /* double the the default width of 36px */\n }\n\n .search-input :global(.stash-input-append) .clear-button {\n color: var(--color-ice-700);\n height: theme('spacing.9');\n margin: 0;\n min-width: theme('spacing.9');\n padding: 0;\n width: theme('spacing.9');\n background: none;\n }\n\n .search-input :global(.stash-input-append) .clear-button:disabled {\n color: var(--color-ice-500);\n cursor: default;\n }\n\n .search-input :global(.stash-input-append) .search-button {\n border-bottom-left-radius: 0;\n border-left: none;\n border-top-left-radius: 0;\n min-width: theme('spacing.9');\n padding: 0 theme('spacing[1.5]');\n width: theme('spacing.9');\n }\n\n .search-input :global(.stash-input-append) .search-button:focus {\n box-shadow: none;\n }\n\n .search-input :global(.stash-input-append) .search-button:disabled {\n border-color: var(--color-ice-500);\n }\n</style>\n"],"names":["classes","useCssModule","slots","useSlots","searchTerm","ref","props","stashInputRef","onSearch","emit","clearSearchTerm","_b","_a","handleChange"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkEQA,IAAUC,KACVC,IAAQC,KACRC,IAAaC,EAAIC,EAAM,UAAU,GACjCC,IAAgBF;AAEtB,aAASG,IAAW;AACb,MAAAC,EAAA,UAAUL,EAAW,KAAK;AAAA,IACjC;AAEA,aAASM,IAAkB;;AACzB,MAAAN,EAAW,QAAQ,IACnBK,EAAK,UAAU,EAAE,GACjBA,EAAK,sBAAsB,EAAE,IAEfE,KAAAC,IAAAL,EAAA,UAAA,gBAAAK,EAAO,YAAP,QAAAD,EAAgB;AAAA,IAChC;AAEA,aAASE,IAAe;AACjB,MAAAJ,EAAA,sBAAsBL,EAAW,KAAK;AAAA,IAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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-42ba3c5a.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-4b02087f.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-c65a30d3"), 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 = {
|
|
@@ -1364,7 +1364,7 @@ const On = (e) => (Mt("data-v-35aedb3d"), e = e(), Dt(), e), kn = ["id", "aria-e
|
|
|
1364
1364
|
se(ve, {
|
|
1365
1365
|
"data-test": "stash-select|options-loading",
|
|
1366
1366
|
name: "working",
|
|
1367
|
-
class: "
|
|
1367
|
+
class: "tw-animate-spin tw-text-ice-500"
|
|
1368
1368
|
})
|
|
1369
1369
|
], 512), [
|
|
1370
1370
|
[Ve, t.loading || M.value]
|
|
@@ -1401,7 +1401,7 @@ const On = (e) => (Mt("data-v-35aedb3d"), 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-c65a30d3"]]);
|
|
1405
1405
|
export {
|
|
1406
1406
|
ho as default
|
|
1407
1407
|
};
|