@leaflink/stash 43.5.2 → 44.0.0-beta.10
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/assets/illustrations/FileUpload/document.svg +1 -17
- package/dist/ActionsDropdown.js +25 -25
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +12 -11
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +9 -9
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +22 -22
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppSidebar.js +11 -11
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +12 -12
- package/dist/Avatar.js +12 -12
- package/dist/Avatar.js.map +1 -1
- package/dist/Backdrop.js +1 -1
- package/dist/Backdrop.js.map +1 -1
- package/dist/Badge.js +12 -12
- package/dist/Badge.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 +28 -28
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Card.js +3 -3
- package/dist/Card.js.map +1 -1
- package/dist/CardHeader.js +3 -3
- package/dist/CardMedia.js +1 -1
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +260 -248
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +58 -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/Chip.js +1 -1
- package/dist/Chip.js.map +1 -1
- package/dist/ConfirmationCodeInput.js +21 -21
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ContextSwitcher.js +6 -5
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataView.js +1 -1
- package/dist/DataViewFilters.js +7 -7
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +47 -38
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +4 -4
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +12 -15
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +8 -8
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +46 -46
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +9 -9
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +17 -17
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/Expand.js +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js → Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js} +14 -15
- 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-475832fe.js → Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js} +5 -5
- package/dist/Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js.map +1 -0
- package/dist/FileUpload.js +49 -47
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +20 -20
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDrawerItem.js +4 -4
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDropdown.js +19 -19
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterSelect.js +27 -27
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +51 -50
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +28 -28
- package/dist/HttpError.js.map +1 -1
- package/dist/IconLabel.js +17 -17
- 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 +3 -3
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +43 -43
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +34 -33
- package/dist/InputOptions.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/Label.vue.d.ts +13 -2
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js +38 -0
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +1 -0
- package/dist/ListItem.js +16 -15
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemCell.js +9 -9
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListView.js +143 -139
- 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/Menu.js +1 -1
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.js +20 -14
- package/dist/MenuItem.js.map +1 -1
- package/dist/Metric.js +4 -4
- package/dist/Metric.js.map +1 -1
- package/dist/Modal.js +21 -21
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +13 -13
- package/dist/Modals.js.map +1 -1
- package/dist/Module.js +2 -2
- package/dist/Module.js.map +1 -1
- package/dist/ModuleContent.js +2 -2
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleFooter.js +11 -11
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleHeader.js +6 -6
- package/dist/ModuleHeader.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 +24 -24
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +3 -3
- package/dist/PageNavigation.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/QuickAction.js +20 -17
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +30 -15
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +177 -148
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +118 -91
- package/dist/RadioNew.js.map +1 -1
- package/dist/SearchBar.js +27 -27
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +189 -188
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +22 -21
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Step.js +37 -37
- package/dist/Step.js.map +1 -1
- package/dist/Switch.js +44 -36
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +3 -2
- package/dist/Tab.js.map +1 -1
- package/dist/{Tab.vue_vue_type_script_setup_true_lang-b810bee8.js → Tab.vue_vue_type_script_setup_true_lang-69d1b046.js} +23 -22
- package/dist/Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map +1 -0
- package/dist/Table.js +23 -22
- package/dist/Table.js.map +1 -1
- package/dist/Table.keys-cf93df19.js +27 -0
- package/dist/{Table.keys-1ebe4ecb.js.map → Table.keys-cf93df19.js.map} +1 -1
- package/dist/TableCell.js +24 -23
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +37 -36
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +13 -12
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +36 -34
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js → Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js} +26 -26
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js.map +1 -0
- package/dist/Textarea.js +61 -53
- 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 +33 -26
- package/dist/constants.js +56 -41
- package/dist/constants.js.map +1 -1
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/storage.js +3 -2
- package/dist/storage.js.map +1 -1
- package/dist/tailwind-base.d.ts +16 -16
- package/dist/tailwind-base.js +16 -6
- package/dist/tailwind-base.js.map +1 -1
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/utils/helpers.js +37 -37
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/storage.js +30 -29
- package/dist/utils/storage.js.map +1 -1
- package/package.json +2 -2
- package/styles/_core.scss +49 -1
- package/styles/backwards-compat.css +1467 -106
- package/styles/base.css +537 -22
- package/tailwind-base.ts +6 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js +0 -17
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js +0 -2
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js.map +0 -1
- package/dist/Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js.map +0 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-475832fe.js.map +0 -1
- package/dist/Label.vue_vue_type_script_setup_true_lang-1d29d98a.js +0 -37
- package/dist/Label.vue_vue_type_script_setup_true_lang-1d29d98a.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-bfccf992.js +0 -11
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js.map +0 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-b810bee8.js.map +0 -1
- package/dist/Table.keys-1ebe4ecb.js +0 -27
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js.map +0 -1
- package/styles/_base.scss +0 -493
- package/styles/components/_all.scss +0 -14
- package/styles/components/_box.scss +0 -13
- package/styles/components/_item-list.scss +0 -78
- package/styles/components/_sidebar.scss +0 -404
- package/styles/components/_top-header.scss +0 -219
- package/styles/elements/_all.scss +0 -15
- package/styles/elements/_buttons.scss +0 -235
- package/styles/elements/_forms.scss +0 -300
- package/styles/elements/_links.scss +0 -32
- package/styles/elements/_lists.scss +0 -31
- package/styles/elements/_misc.scss +0 -16
- package/styles/elements/_tables.scss +0 -80
- package/styles/elements/_tooltips.scss +0 -110
- package/styles/main.scss +0 -38
- package/styles/utility/_all.scss +0 -12
- package/styles/utility/_animations.scss +0 -103
- package/styles/utility/_display.scss +0 -167
- package/styles/utility/_grid.scss +0 -200
- package/styles/utility/_icons.scss +0 -31
- package/styles/utility/_transitions.scss +0 -110
package/dist/RadioNew.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { R as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as p, useCssModule as m, openBlock as _, createElementBlock as v, normalizeClass as d, unref as s, createElementVNode as n, toDisplayString as f, withDirectives as k, vShow as W, renderSlot as h, inject as C, computed as r, createBlock as M, resolveDynamicComponent as x, withCtx as N } from "vue";
|
|
2
|
+
import { R as D } from "./RadioGroup.keys-974818d6.js";
|
|
3
|
+
import { _ as $ } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
const E = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @__PURE__ */ p({
|
|
5
5
|
__name: "VariantButton",
|
|
6
6
|
props: {
|
|
7
7
|
disabled: { type: Boolean },
|
|
@@ -13,29 +13,34 @@ const N = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @_
|
|
|
13
13
|
value: {}
|
|
14
14
|
},
|
|
15
15
|
emits: ["input"],
|
|
16
|
-
setup(
|
|
17
|
-
const e = a;
|
|
18
|
-
return (
|
|
19
|
-
class: s(
|
|
16
|
+
setup(t, { emit: i }) {
|
|
17
|
+
const e = t, a = m();
|
|
18
|
+
return (l, o) => (_(), v("div", {
|
|
19
|
+
class: d([s(a).root, { "tw-w-full": e.fullWidth }])
|
|
20
20
|
}, [
|
|
21
|
-
|
|
21
|
+
n("input", {
|
|
22
22
|
id: `${e.name}-${e.id}`,
|
|
23
|
-
class: "
|
|
23
|
+
class: d(["tw-sr-only", s(a).input]),
|
|
24
24
|
type: "radio",
|
|
25
25
|
name: e.name,
|
|
26
26
|
value: e.value,
|
|
27
27
|
checked: e.modelValue === e.value,
|
|
28
28
|
disabled: e.disabled || e.disabled,
|
|
29
|
-
onInput:
|
|
30
|
-
}, null,
|
|
31
|
-
|
|
32
|
-
class:
|
|
29
|
+
onInput: o[0] || (o[0] = (u) => i("input", u))
|
|
30
|
+
}, null, 42, E),
|
|
31
|
+
n("label", {
|
|
32
|
+
class: d(s(a).label),
|
|
33
33
|
for: `${e.name}-${e.id}`
|
|
34
|
-
},
|
|
34
|
+
}, f(e.label), 11, R)
|
|
35
35
|
], 2));
|
|
36
36
|
}
|
|
37
|
-
})
|
|
38
|
-
|
|
37
|
+
}), g = "_label_1mshv_2", O = "_root_1mshv_14", S = "_input_1mshv_32", z = {
|
|
38
|
+
label: g,
|
|
39
|
+
root: O,
|
|
40
|
+
input: S
|
|
41
|
+
}, A = {
|
|
42
|
+
$style: z
|
|
43
|
+
}, F = /* @__PURE__ */ $(T, [["__cssModules", A]]), J = ["id", "name", "value", "checked", "disabled"], P = ["for"], U = /* @__PURE__ */ p({
|
|
39
44
|
__name: "VariantChip",
|
|
40
45
|
props: {
|
|
41
46
|
disabled: { type: Boolean },
|
|
@@ -47,29 +52,33 @@ const D = /* @__PURE__ */ v(T, [["__scopeId", "data-v-2172fc90"]]), E = ["id", "
|
|
|
47
52
|
value: {}
|
|
48
53
|
},
|
|
49
54
|
emits: ["input"],
|
|
50
|
-
setup(
|
|
51
|
-
const e = a;
|
|
52
|
-
return (
|
|
53
|
-
class: s(
|
|
55
|
+
setup(t, { emit: i }) {
|
|
56
|
+
const e = t, a = m();
|
|
57
|
+
return (l, o) => (_(), v("div", {
|
|
58
|
+
class: d([s(a).root, { "tw-w-full": e.fullWidth }])
|
|
54
59
|
}, [
|
|
55
|
-
|
|
60
|
+
n("input", {
|
|
56
61
|
id: `${e.name}-${e.id}`,
|
|
57
|
-
class: "
|
|
62
|
+
class: d(["tw-sr-only", s(a).input]),
|
|
58
63
|
type: "radio",
|
|
59
64
|
name: e.name,
|
|
60
65
|
value: e.value,
|
|
61
66
|
checked: e.modelValue === e.value,
|
|
62
67
|
disabled: e.disabled || e.disabled,
|
|
63
|
-
onInput:
|
|
64
|
-
}, null,
|
|
65
|
-
|
|
66
|
-
class:
|
|
68
|
+
onInput: o[0] || (o[0] = (u) => i("input", u))
|
|
69
|
+
}, null, 42, J),
|
|
70
|
+
n("label", {
|
|
71
|
+
class: d(s(a).label),
|
|
67
72
|
for: `${e.name}-${e.id}`
|
|
68
|
-
},
|
|
73
|
+
}, f(e.label), 11, P)
|
|
69
74
|
], 2));
|
|
70
75
|
}
|
|
71
|
-
})
|
|
72
|
-
|
|
76
|
+
}), q = "_label_vdpts_2", H = "_input_vdpts_16", K = {
|
|
77
|
+
label: q,
|
|
78
|
+
input: H
|
|
79
|
+
}, L = {
|
|
80
|
+
$style: K
|
|
81
|
+
}, Q = /* @__PURE__ */ $(U, [["__cssModules", L]]), X = ["id", "name", "value", "checked", "disabled"], Y = ["for"], Z = /* @__PURE__ */ p({
|
|
73
82
|
__name: "VariantRadio",
|
|
74
83
|
props: {
|
|
75
84
|
disabled: { type: Boolean },
|
|
@@ -81,31 +90,35 @@ const M = /* @__PURE__ */ v(S, [["__scopeId", "data-v-8bfe9d47"]]), z = ["id", "
|
|
|
81
90
|
value: {}
|
|
82
91
|
},
|
|
83
92
|
emits: ["input"],
|
|
84
|
-
setup(
|
|
85
|
-
const e = a;
|
|
86
|
-
return (
|
|
87
|
-
class:
|
|
93
|
+
setup(t, { emit: i }) {
|
|
94
|
+
const e = t, a = m();
|
|
95
|
+
return (l, o) => (_(), v("div", {
|
|
96
|
+
class: d(["tw-flex", [s(a).root, { "tw-w-full": e.fullWidth }]])
|
|
88
97
|
}, [
|
|
89
|
-
|
|
98
|
+
n("input", {
|
|
90
99
|
id: `${e.name}-${e.id}`,
|
|
91
|
-
class:
|
|
100
|
+
class: d(s(a).input),
|
|
92
101
|
type: "radio",
|
|
93
102
|
name: e.name,
|
|
94
103
|
value: e.value,
|
|
95
104
|
checked: e.modelValue === e.value,
|
|
96
105
|
disabled: e.disabled,
|
|
97
|
-
onInput:
|
|
98
|
-
}, null,
|
|
99
|
-
|
|
100
|
-
class: s(
|
|
106
|
+
onInput: o[0] || (o[0] = (u) => i("input", u))
|
|
107
|
+
}, null, 42, X),
|
|
108
|
+
k(n("label", {
|
|
109
|
+
class: d([s(a).label, { "tw-text-ice-500": e.disabled }]),
|
|
101
110
|
for: `${e.name}-${e.id}`
|
|
102
|
-
},
|
|
103
|
-
[
|
|
111
|
+
}, f(e.label), 11, Y), [
|
|
112
|
+
[W, e.label]
|
|
104
113
|
])
|
|
105
114
|
], 2));
|
|
106
115
|
}
|
|
107
|
-
})
|
|
108
|
-
|
|
116
|
+
}), I = "_label_kw8hn_2", j = "_input_kw8hn_9", G = {
|
|
117
|
+
label: I,
|
|
118
|
+
input: j
|
|
119
|
+
}, ee = {
|
|
120
|
+
$style: G
|
|
121
|
+
}, le = /* @__PURE__ */ $(Z, [["__cssModules", ee]]), ae = ["for"], te = ["id", "aria-labelledby", "name", "value", "checked", "disabled"], se = ["id"], de = /* @__PURE__ */ p({
|
|
109
122
|
__name: "VariantTile",
|
|
110
123
|
props: {
|
|
111
124
|
disabled: { type: Boolean },
|
|
@@ -117,48 +130,62 @@ const I = /* @__PURE__ */ v(F, [["__scopeId", "data-v-7175a75d"]]), J = ["for"],
|
|
|
117
130
|
value: {}
|
|
118
131
|
},
|
|
119
132
|
emits: ["input"],
|
|
120
|
-
setup(
|
|
121
|
-
const e = a;
|
|
122
|
-
return (
|
|
123
|
-
class: s(
|
|
133
|
+
setup(t, { emit: i }) {
|
|
134
|
+
const e = t, a = m();
|
|
135
|
+
return (l, o) => (_(), v("label", {
|
|
136
|
+
class: d([s(a).root, { "tw-w-full": e.fullWidth, [s(a)["root--disabled"]]: e.disabled }]),
|
|
124
137
|
for: `${e.name}-${e.id}`
|
|
125
138
|
}, [
|
|
126
|
-
|
|
127
|
-
class:
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
139
|
+
n("div", {
|
|
140
|
+
class: d(["tw-flex tw-border", [
|
|
141
|
+
s(a)["tile-header"],
|
|
142
|
+
{
|
|
143
|
+
"tw-border-blue-500 tw-bg-blue-100": e.modelValue === e.value && !e.disabled,
|
|
144
|
+
"tw-border-ice-500 tw-bg-ice-100": e.modelValue !== e.value || e.disabled
|
|
145
|
+
}
|
|
146
|
+
]])
|
|
131
147
|
}, [
|
|
132
|
-
|
|
148
|
+
n("input", {
|
|
133
149
|
id: `${e.name}-${e.id}`,
|
|
134
150
|
"aria-labelledby": `tile-label-${e.name}-${e.id}`,
|
|
135
|
-
class: "
|
|
151
|
+
class: d(["tw-sr-only", s(a).input]),
|
|
136
152
|
type: "radio",
|
|
137
153
|
name: e.name,
|
|
138
154
|
value: e.value,
|
|
139
155
|
checked: e.modelValue === e.value,
|
|
140
156
|
disabled: e.disabled,
|
|
141
|
-
onInput:
|
|
142
|
-
}, null,
|
|
143
|
-
|
|
157
|
+
onInput: o[0] || (o[0] = (u) => i("input", u))
|
|
158
|
+
}, null, 42, te),
|
|
159
|
+
n("div", {
|
|
144
160
|
id: `tile-label-${e.name}-${e.id}`,
|
|
145
|
-
class: s(
|
|
146
|
-
},
|
|
161
|
+
class: d([s(a).label, { "tw-text-ice-500": e.disabled }])
|
|
162
|
+
}, f(e.label), 11, se)
|
|
147
163
|
], 2),
|
|
148
|
-
|
|
149
|
-
class:
|
|
150
|
-
"
|
|
151
|
-
|
|
152
|
-
|
|
164
|
+
n("div", {
|
|
165
|
+
class: d([
|
|
166
|
+
s(a)["tile-body"],
|
|
167
|
+
{
|
|
168
|
+
"tw-border-ice-500": e.modelValue !== e.value || e.disabled,
|
|
169
|
+
"tw-border-blue-500": e.modelValue === e.value && !e.disabled
|
|
170
|
+
}
|
|
171
|
+
])
|
|
153
172
|
}, [
|
|
154
|
-
|
|
173
|
+
h(l.$slots, "default")
|
|
155
174
|
], 2)
|
|
156
|
-
], 10,
|
|
175
|
+
], 10, ae));
|
|
157
176
|
}
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
177
|
+
}), oe = "_root_583pa_2", ne = "_label_583pa_32", ie = "_input_583pa_39", ue = {
|
|
178
|
+
root: oe,
|
|
179
|
+
"root--disabled": "_root--disabled_583pa_11",
|
|
180
|
+
"tile-header": "_tile-header_583pa_15",
|
|
181
|
+
"tile-body": "_tile-body_583pa_16",
|
|
182
|
+
label: ne,
|
|
183
|
+
input: ie
|
|
184
|
+
}, re = {
|
|
185
|
+
$style: ue
|
|
186
|
+
}, ce = /* @__PURE__ */ $(de, [["__cssModules", re]]);
|
|
187
|
+
var c = /* @__PURE__ */ ((t) => (t.Radio = "radio", t.Button = "button", t.Chip = "chip", t.Tile = "tile", t))(c || {});
|
|
188
|
+
const ve = /* @__PURE__ */ p({
|
|
162
189
|
__name: "RadioNew",
|
|
163
190
|
props: {
|
|
164
191
|
name: { default: void 0 },
|
|
@@ -172,40 +199,40 @@ const Y = /* @__PURE__ */ r({
|
|
|
172
199
|
value: {}
|
|
173
200
|
},
|
|
174
201
|
emits: ["update:modelValue"],
|
|
175
|
-
setup(
|
|
176
|
-
const e =
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[
|
|
180
|
-
[
|
|
181
|
-
}, l =
|
|
182
|
-
function
|
|
202
|
+
setup(t, { emit: i }) {
|
|
203
|
+
const e = t, a = {
|
|
204
|
+
[c.Button]: F,
|
|
205
|
+
[c.Chip]: Q,
|
|
206
|
+
[c.Radio]: le,
|
|
207
|
+
[c.Tile]: ce
|
|
208
|
+
}, l = C(D.key, null), o = r(() => e.modelValue || (l == null ? void 0 : l.modelValue.value)), u = r(() => e.name || (l == null ? void 0 : l.name.value)), y = r(() => e.fullWidth || (l == null ? void 0 : l.fullWidth.value)), w = r(() => e.disabled || (l == null ? void 0 : l.disabled.value)), V = r(() => e.variant || (l == null ? void 0 : l.variant.value) || "radio");
|
|
209
|
+
function B(b) {
|
|
183
210
|
if (l != null && l.update) {
|
|
184
|
-
l.update(
|
|
211
|
+
l.update(b);
|
|
185
212
|
return;
|
|
186
213
|
}
|
|
187
|
-
|
|
214
|
+
i("update:modelValue", b.target.value);
|
|
188
215
|
}
|
|
189
|
-
return (
|
|
216
|
+
return (b, pe) => (_(), M(x(a[V.value]), {
|
|
190
217
|
id: e.id,
|
|
191
|
-
disabled:
|
|
218
|
+
disabled: w.value,
|
|
192
219
|
"has-error": e.hasError,
|
|
193
|
-
"full-width":
|
|
220
|
+
"full-width": y.value,
|
|
194
221
|
label: e.label,
|
|
195
|
-
"model-value":
|
|
196
|
-
name:
|
|
222
|
+
"model-value": o.value,
|
|
223
|
+
name: u.value,
|
|
197
224
|
value: e.value,
|
|
198
|
-
onInput:
|
|
225
|
+
onInput: B
|
|
199
226
|
}, {
|
|
200
|
-
default:
|
|
201
|
-
b
|
|
227
|
+
default: N(() => [
|
|
228
|
+
h(b.$slots, "default")
|
|
202
229
|
]),
|
|
203
230
|
_: 3
|
|
204
231
|
}, 40, ["id", "disabled", "has-error", "full-width", "label", "model-value", "name", "value"]));
|
|
205
232
|
}
|
|
206
233
|
});
|
|
207
234
|
export {
|
|
208
|
-
|
|
209
|
-
|
|
235
|
+
c as RadioVariant,
|
|
236
|
+
ve as default
|
|
210
237
|
};
|
|
211
238
|
//# sourceMappingURL=RadioNew.js.map
|
package/dist/RadioNew.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioNew.js","sources":["../src/components/RadioNew/Radio.types.ts","../src/components/RadioNew/RadioNew.vue"],"sourcesContent":["export enum RadioVariant {\n Radio = 'radio',\n Button = 'button',\n Chip = 'chip',\n Tile = 'tile',\n}\n\nexport type RadioVariants = `${RadioVariant}`;\n","<script lang=\"ts\">\n export * from './Radio.types';\n\n export interface RadioProps {\n /**\n * Passed to the \"name\" attribute of the `<input>` element.\n */\n name?: string;\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 * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: string | number;\n\n /**\n * value bound to the parent component\n */\n modelValue?: string | undefined;\n\n /**\n * Adds error styling\n */\n hasError?: boolean;\n\n /**\n * The description which appears to the right of the radio button\n */\n label?: string;\n\n /**\n * the styling for the radio button @defaultValue 'radio'\n */\n variant?: RadioVariants;\n\n /**\n * The value for the radio input.\n */\n value: string;\n }\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup/RadioGroup.keys';\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 { RadioVariant, RadioVariants } from './Radio.types';\n\n const variantComponentsMap = {\n [RadioVariant.Button]: VariantButton,\n [RadioVariant.Chip]: VariantChip,\n [RadioVariant.Radio]: VariantRadio,\n [RadioVariant.Tile]: VariantTile,\n };\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key, null);\n\n const props = withDefaults(defineProps<RadioProps>(), {\n disabled: false,\n fullWidth: false,\n hasError: false,\n id: undefined,\n label: '',\n modelValue: undefined,\n name: undefined,\n variant: undefined,\n });\n\n /**\n * use prop values but fallback to radio group context values if they are provided\n */\n const derivedModelValue = computed(() => props.modelValue || radioGroupInjection?.modelValue.value);\n const derivedName = computed(() => props.name || radioGroupInjection?.name.value);\n const derivedNameFullWidth = computed(() => props.fullWidth || radioGroupInjection?.fullWidth.value);\n const derivedDisabled = computed(() => props.disabled || radioGroupInjection?.disabled.value);\n const derivedVariant = computed<RadioVariants>(() => props.variant || radioGroupInjection?.variant.value || 'radio');\n\n const emit =\n defineEmits<{\n (e: 'update:modelValue', value: RadioProps['value']): void;\n }>();\n\n function onInput(e: Event) {\n if (radioGroupInjection?.update) {\n radioGroupInjection.update(e);\n\n return;\n }\n\n emit('update:modelValue', (e.target as HTMLInputElement).value);\n }\n</script>\n\n<template>\n <component\n :is=\"variantComponentsMap[derivedVariant]\"\n :id=\"props.id\"\n :disabled=\"derivedDisabled\"\n :has-error=\"props.hasError\"\n :full-width=\"derivedNameFullWidth\"\n :label=\"props.label\"\n :model-value=\"derivedModelValue\"\n :name=\"derivedName\"\n :value=\"props.value\"\n @input=\"onInput\"\n >\n <slot></slot>\n </component>\n</template>\n"],"names":["RadioVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","radioGroupInjection","inject","RADIO_GROUP_INJECTION","derivedModelValue","computed","props","derivedName","derivedNameFullWidth","derivedDisabled","derivedVariant","onInput","e","emit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;iBC8DJC,IAAuB;AAAA,MAC3B,CAACD,EAAa,MAAM,GAAGE;AAAA,MACvB,CAACF,EAAa,IAAI,GAAGG;AAAA,MACrB,CAACH,EAAa,KAAK,GAAGI;AAAA,MACtB,CAACJ,EAAa,IAAI,GAAGK;AAAA,IAAA,GAGjBC,IAAsBC,EAAOC,EAAsB,KAAK,IAAI,GAgB5DC,IAAoBC,EAAS,MAAMC,EAAM,eAAcL,KAAA,gBAAAA,EAAqB,WAAW,MAAK,GAC5FM,IAAcF,EAAS,MAAMC,EAAM,SAAQL,KAAA,gBAAAA,EAAqB,KAAK,MAAK,GAC1EO,IAAuBH,EAAS,MAAMC,EAAM,cAAaL,KAAA,gBAAAA,EAAqB,UAAU,MAAK,GAC7FQ,IAAkBJ,EAAS,MAAMC,EAAM,aAAYL,KAAA,gBAAAA,EAAqB,SAAS,MAAK,GACtFS,IAAiBL,EAAwB,MAAMC,EAAM,YAAWL,KAAA,gBAAAA,EAAqB,QAAQ,UAAS,OAAO;AAOnH,aAASU,EAAQC,GAAU;AACzB,UAAIX,KAAA,QAAAA,EAAqB,QAAQ;AAC/B,QAAAA,EAAoB,OAAOW,CAAC;AAE5B;AAAA,MACF;AAEK,MAAAC,EAAA,qBAAsBD,EAAE,OAA4B,KAAK;AAAA,IAChE;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"RadioNew.js","sources":["../src/components/RadioNew/components/VariantButton.vue","../src/components/RadioNew/components/VariantChip.vue","../src/components/RadioNew/components/VariantRadio.vue","../src/components/RadioNew/components/VariantTile.vue","../src/components/RadioNew/Radio.types.ts","../src/components/RadioNew/RadioNew.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useCssModule } from 'vue';\n\n export interface RadioVariantProps {\n /**\n * Whether the input 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 * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: string | number;\n\n /**\n * The description which appears to the right of the radio button\n */\n label?: string;\n\n /**\n * value bound to the parent component\n */\n modelValue?: string | undefined;\n\n /**\n * Passed to the \"name\" attribute of the `<input>` element.\n */\n name?: string;\n\n /**\n * The value for the radio input.\n */\n value: string;\n }\n\n const props = defineProps<RadioVariantProps>();\n const classes = useCssModule();\n\n const emit =\n defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <div :class=\"[classes.root, { 'tw-w-full': props.fullWidth }]\">\n <input\n :id=\"`${props.name}-${props.id}`\"\n class=\"tw-sr-only\"\n :class=\"classes.input\"\n type=\"radio\"\n :name=\"props.name\"\n :value=\"props.value\"\n :checked=\"props.modelValue === props.value\"\n :disabled=\"props.disabled || props.disabled\"\n @input=\"emit('input', $event)\"\n />\n <label :class=\"classes.label\" :for=\"`${props.name}-${props.id}`\">\n {{ props.label }}\n </label>\n </div>\n</template>\n\n<style module>\n .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:first-of-type .label {\n border-top-left-radius: theme('borderRadius.DEFAULT');\n border-bottom-left-radius: theme('borderRadius.DEFAULT');\n }\n\n .root:last-of-type .label {\n border-top-right-radius: theme('borderRadius.DEFAULT');\n border-bottom-right-radius: theme('borderRadius.DEFAULT');\n }\n\n .root:not(:first-of-type) .label {\n margin-left: -1px;\n }\n\n .root:not(:last-of-type) .label {\n border-right-color: transparent;\n }\n\n .input:disabled ~ .label {\n background-color: var(--color-ice-100);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .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 .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 { useCssModule } from 'vue';\n\n export interface RadioVariantProps {\n /**\n * Whether the input 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 * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: string | number;\n\n /**\n * The description which appears to the right of the radio button\n */\n label?: string;\n\n /**\n * value bound to the parent component\n */\n modelValue?: string | undefined;\n\n /**\n * Passed to the \"name\" attribute of the `<input>` element.\n */\n name?: string;\n\n /**\n * The value for the radio input.\n */\n value: string;\n }\n\n const props = defineProps<RadioVariantProps>();\n const classes = useCssModule();\n\n const emit =\n defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <div :class=\"[classes.root, { 'tw-w-full': props.fullWidth }]\">\n <input\n :id=\"`${props.name}-${props.id}`\"\n class=\"tw-sr-only\"\n :class=\"classes.input\"\n type=\"radio\"\n :name=\"props.name\"\n :value=\"props.value\"\n :checked=\"props.modelValue === props.value\"\n :disabled=\"props.disabled || props.disabled\"\n @input=\"emit('input', $event)\"\n />\n <label :class=\"classes.label\" :for=\"`${props.name}-${props.id}`\">\n {{ props.label }}\n </label>\n </div>\n</template>\n\n<style module>\n .label {\n display: inline-block;\n padding: theme('spacing.1') theme('spacing.3');\n border: 1px solid var(--color-ice-500);\n font-weight: theme('fontWeight.normal');\n line-height: 1.375rem;\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 .input:disabled ~ .label {\n background-color: var(--color-ice-100);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .input:checked:not(:disabled) ~ .label {\n border-color: var(--color-blue-500);\n color: theme('colors.white');\n background-color: var(--color-blue-500);\n font-weight: theme('fontWeight.bold');\n }\n\n .input:not(:checked, :disabled) ~ .label:hover {\n border-color: var(--color-blue-500);\n }\n</style>\n","<script setup lang=\"ts\">\n import { useCssModule } from 'vue';\n\n export interface RadioVariantProps {\n /**\n * Whether the input 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 * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: string | number;\n\n /**\n * The description which appears to the right of the radio button\n */\n label?: string;\n\n /**\n * value bound to the parent component\n */\n modelValue?: string | undefined;\n\n /**\n * Passed to the \"name\" attribute of the `<input>` element.\n */\n name?: string;\n\n /**\n * The value for the radio input.\n */\n value: string;\n }\n\n const props = defineProps<RadioVariantProps>();\n const classes = useCssModule();\n\n const emit =\n defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <div class=\"tw-flex\" :class=\"[classes.root, { 'tw-w-full': props.fullWidth }]\">\n <input\n :id=\"`${props.name}-${props.id}`\"\n :class=\"classes.input\"\n type=\"radio\"\n :name=\"props.name\"\n :value=\"props.value\"\n :checked=\"props.modelValue === props.value\"\n :disabled=\"props.disabled\"\n @input=\"emit('input', $event)\"\n />\n <label\n v-show=\"props.label\"\n :class=\"[classes.label, { 'tw-text-ice-500': props.disabled }]\"\n :for=\"`${props.name}-${props.id}`\"\n >\n {{ props.label }}\n </label>\n </div>\n</template>\n\n<style module>\n .label {\n font-weight: theme('fontWeight.medium');\n user-select: none;\n cursor: pointer;\n padding: 0 theme('spacing.3');\n }\n\n .input {\n appearance: none;\n border-radius: 50%;\n min-width: 20px;\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 }\n\n .input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .input:disabled {\n background-image: radial-gradient(var(--color-ice-100) 100%, var(--color-ice-100) 100%);\n }\n\n .input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, var(--color-ice-100) 54%);\n }\n\n .input:hover:not(:disabled) {\n border-color: var(--color-blue-500);\n }\n\n .input:disabled ~ .label {\n cursor: auto;\n }\n\n .input:hover:not(:disabled) ~ .label {\n color: var(--color-ice-900);\n }\n\n .input:not(:disabled) ~ .label:hover {\n color: var(--color-ice-900);\n }\n</style>\n","<script setup lang=\"ts\">\n import { useCssModule } from 'vue';\n\n export interface RadioVariantProps {\n /**\n * Whether the input 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 * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: string | number;\n\n /**\n * The description which appears to the right of the radio button\n */\n label?: string;\n\n /**\n * value bound to the parent component\n */\n modelValue?: string | undefined;\n\n /**\n * Passed to the \"name\" attribute of the `<input>` element.\n */\n name?: string;\n\n /**\n * The value for the radio input.\n */\n value: string;\n }\n\n const props = defineProps<RadioVariantProps>();\n const classes = useCssModule();\n\n const emit =\n defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <label\n :class=\"[classes.root, { 'tw-w-full': props.fullWidth, [classes['root--disabled']]: props.disabled }]\"\n :for=\"`${props.name}-${props.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': props.modelValue === props.value && !props.disabled,\n 'tw-border-ice-500 tw-bg-ice-100': props.modelValue !== props.value || props.disabled,\n },\n ]\"\n >\n <input\n :id=\"`${props.name}-${props.id}`\"\n :aria-labelledby=\"`tile-label-${props.name}-${props.id}`\"\n class=\"tw-sr-only\"\n :class=\"classes.input\"\n type=\"radio\"\n :name=\"props.name\"\n :value=\"props.value\"\n :checked=\"props.modelValue === props.value\"\n :disabled=\"props.disabled\"\n @input=\"emit('input', $event)\"\n />\n <div :id=\"`tile-label-${props.name}-${props.id}`\" :class=\"[classes.label, { 'tw-text-ice-500': props.disabled }]\">\n {{ props.label }}\n </div>\n </div>\n <div\n :class=\"[\n classes['tile-body'],\n {\n 'tw-border-ice-500': props.modelValue !== props.value || props.disabled,\n 'tw-border-blue-500': props.modelValue === props.value && !props.disabled,\n },\n ]\"\n >\n <slot></slot>\n </div>\n </label>\n</template>\n\n<style module>\n .root {\n border-radius: theme('borderRadius.DEFAULT');\n cursor: pointer;\n display: flex;\n flex: 1;\n flex-direction: column;\n user-select: none;\n }\n\n .root--disabled {\n cursor: auto;\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:hover:not(.root--disabled) .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 .label {\n font-weight: theme('fontWeight.medium');\n user-select: none;\n cursor: pointer;\n padding: 0 theme('spacing.3');\n }\n\n .input {\n appearance: none;\n background-color: theme('colors.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 margin-left: theme('spacing.3');\n }\n\n .input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, var(--color-ice-100) 54%);\n }\n\n .tile-body {\n border-radius: 0 0 theme('borderRadius.DEFAULT') theme('borderRadius.DEFAULT');\n border-width: 0 1px 1px 1px;\n background-color: theme('colors.white');\n padding: theme('spacing.6');\n display: flex;\n flex-direction: column;\n }\n\n .root:hover:not(.root--disabled) .tile-body {\n border-color: var(--color-blue-500) !important;\n transition: all 0.2s;\n }\n</style>\n","export enum RadioVariant {\n Radio = 'radio',\n Button = 'button',\n Chip = 'chip',\n Tile = 'tile',\n}\n\nexport type RadioVariants = `${RadioVariant}`;\n","<script lang=\"ts\">\n export * from './Radio.types';\n\n export interface RadioProps {\n /**\n * Passed to the \"name\" attribute of the `<input>` element.\n */\n name?: string;\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 * A unique string to distinguish one Radio instance from another\n * and to link the label to the input; required for accessibility\n */\n id: string | number;\n\n /**\n * value bound to the parent component\n */\n modelValue?: string | undefined;\n\n /**\n * Adds error styling\n */\n hasError?: boolean;\n\n /**\n * The description which appears to the right of the radio button\n */\n label?: string;\n\n /**\n * the styling for the radio button @defaultValue 'radio'\n */\n variant?: RadioVariants;\n\n /**\n * The value for the radio input.\n */\n value: string;\n }\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup/RadioGroup.keys';\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 { RadioVariant, RadioVariants } from './Radio.types';\n\n const variantComponentsMap = {\n [RadioVariant.Button]: VariantButton,\n [RadioVariant.Chip]: VariantChip,\n [RadioVariant.Radio]: VariantRadio,\n [RadioVariant.Tile]: VariantTile,\n };\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key, null);\n\n const props = withDefaults(defineProps<RadioProps>(), {\n disabled: false,\n fullWidth: false,\n hasError: false,\n id: undefined,\n label: '',\n modelValue: undefined,\n name: undefined,\n variant: undefined,\n });\n\n /**\n * use prop values but fallback to radio group context values if they are provided\n */\n const derivedModelValue = computed(() => props.modelValue || radioGroupInjection?.modelValue.value);\n const derivedName = computed(() => props.name || radioGroupInjection?.name.value);\n const derivedNameFullWidth = computed(() => props.fullWidth || radioGroupInjection?.fullWidth.value);\n const derivedDisabled = computed(() => props.disabled || radioGroupInjection?.disabled.value);\n const derivedVariant = computed<RadioVariants>(() => props.variant || radioGroupInjection?.variant.value || 'radio');\n\n const emit =\n defineEmits<{\n (e: 'update:modelValue', value: RadioProps['value']): void;\n }>();\n\n function onInput(e: Event) {\n if (radioGroupInjection?.update) {\n radioGroupInjection.update(e);\n\n return;\n }\n\n emit('update:modelValue', (e.target as HTMLInputElement).value);\n }\n</script>\n\n<template>\n <component\n :is=\"variantComponentsMap[derivedVariant]\"\n :id=\"props.id\"\n :disabled=\"derivedDisabled\"\n :has-error=\"props.hasError\"\n :full-width=\"derivedNameFullWidth\"\n :label=\"props.label\"\n :model-value=\"derivedModelValue\"\n :name=\"derivedName\"\n :value=\"props.value\"\n @input=\"onInput\"\n >\n <slot></slot>\n </component>\n</template>\n"],"names":["classes","useCssModule","RadioVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","radioGroupInjection","inject","RADIO_GROUP_INJECTION","derivedModelValue","computed","props","derivedName","derivedNameFullWidth","derivedDisabled","derivedVariant","onInput","e","emit"],"mappings":";;;;;;;;;;;;;;;;iBA0CQA,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCAVD,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCAVD,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCAVD,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1CN,IAAAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;iBC8DJC,IAAuB;AAAA,MAC3B,CAACD,EAAa,MAAM,GAAGE;AAAA,MACvB,CAACF,EAAa,IAAI,GAAGG;AAAA,MACrB,CAACH,EAAa,KAAK,GAAGI;AAAA,MACtB,CAACJ,EAAa,IAAI,GAAGK;AAAA,IAAA,GAGjBC,IAAsBC,EAAOC,EAAsB,KAAK,IAAI,GAgB5DC,IAAoBC,EAAS,MAAMC,EAAM,eAAcL,KAAA,gBAAAA,EAAqB,WAAW,MAAK,GAC5FM,IAAcF,EAAS,MAAMC,EAAM,SAAQL,KAAA,gBAAAA,EAAqB,KAAK,MAAK,GAC1EO,IAAuBH,EAAS,MAAMC,EAAM,cAAaL,KAAA,gBAAAA,EAAqB,UAAU,MAAK,GAC7FQ,IAAkBJ,EAAS,MAAMC,EAAM,aAAYL,KAAA,gBAAAA,EAAqB,SAAS,MAAK,GACtFS,IAAiBL,EAAwB,MAAMC,EAAM,YAAWL,KAAA,gBAAAA,EAAqB,QAAQ,UAAS,OAAO;AAOnH,aAASU,EAAQC,GAAU;AACzB,UAAIX,KAAA,QAAAA,EAAqB,QAAQ;AAC/B,QAAAA,EAAoB,OAAOW,CAAC;AAE5B;AAAA,MACF;AAEK,MAAAC,EAAA,qBAAsBD,EAAE,OAA4B,KAAK;AAAA,IAChE;;;;;;;;;;;;;;;;;;;"}
|
package/dist/SearchBar.js
CHANGED
|
@@ -3,18 +3,18 @@ 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: {
|
|
@@ -27,39 +27,39 @@ const W = /* @__PURE__ */ C({
|
|
|
27
27
|
},
|
|
28
28
|
emits: ["search", "update:model-value"],
|
|
29
29
|
setup(k, { emit: s }) {
|
|
30
|
-
const e = k, c = B(), g = S(),
|
|
30
|
+
const e = k, c = B(), g = S(), t = m(e.modelValue), i = m();
|
|
31
31
|
function d() {
|
|
32
|
-
s("search",
|
|
33
|
-
}
|
|
34
|
-
function x() {
|
|
35
|
-
var l, t;
|
|
36
|
-
a.value = "", s("search", ""), s("update:model-value", ""), (t = (l = i.value) == null ? void 0 : l.inputEl) == null || t.focus();
|
|
32
|
+
s("search", t.value);
|
|
37
33
|
}
|
|
38
34
|
function y() {
|
|
39
|
-
|
|
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
|
+
}
|
|
38
|
+
function x() {
|
|
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
43
|
ref: i,
|
|
44
|
-
modelValue:
|
|
44
|
+
modelValue: t.value,
|
|
45
45
|
"onUpdate:modelValue": [
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
a[0] || (a[0] = (p) => t.value = p),
|
|
47
|
+
x
|
|
48
48
|
],
|
|
49
49
|
class: o(["stash-search-bar", r(c)["search-input"]]),
|
|
50
50
|
label: e.label,
|
|
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" })
|
|
@@ -74,7 +74,7 @@ const W = /* @__PURE__ */ C({
|
|
|
74
74
|
}, {
|
|
75
75
|
default: n(() => [
|
|
76
76
|
u(v, {
|
|
77
|
-
class: o({ "
|
|
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
|
]),
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|