@leaflink/stash 52.0.2 → 53.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -49
- package/dist/Accordion.js +16 -16
- package/dist/Accordion.js.map +1 -1
- package/dist/AccordionGroup.js +7 -7
- package/dist/AccordionGroup.js.map +1 -1
- package/dist/ActionsDropdown.js +16 -16
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js.map +1 -1
- package/dist/AddressSelect.vue.d.ts +1 -1
- package/dist/Alert.js +34 -34
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +31 -31
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppSidebar.js +19 -19
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +32 -32
- package/dist/AppTopbar.js.map +1 -1
- package/dist/Avatar.js +18 -18
- package/dist/Avatar.js.map +1 -1
- package/dist/Backdrop.js +5 -5
- package/dist/Backdrop.js.map +1 -1
- package/dist/Badge.js +38 -38
- package/dist/Badge.js.map +1 -1
- package/dist/Box.js +1 -1
- package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js} +6 -6
- package/dist/{Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map → Box.vue_vue_type_script_setup_true_lang-dFFZN40_.js.map} +1 -1
- package/dist/Button.js +21 -21
- package/dist/Button.js.map +1 -1
- package/dist/ButtonGroup.js +26 -26
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Card.js +14 -14
- package/dist/Card.js.map +1 -1
- package/dist/CardContent.js +1 -1
- package/dist/CardContent.js.map +1 -1
- package/dist/CardFooter.js +1 -1
- package/dist/CardFooter.js.map +1 -1
- package/dist/CardHeader.js +4 -4
- package/dist/CardHeader.js.map +1 -1
- package/dist/CardMedia.js +20 -20
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +88 -93
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +30 -30
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +0 -3
- package/dist/Chip.js +33 -33
- package/dist/Chip.js.map +1 -1
- package/dist/ConfirmationCodeInput.js +72 -72
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ContextSwitcher.js +27 -27
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +47 -48
- package/dist/Copy.js.map +1 -1
- package/dist/CurrencyInput.js +1 -1
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +5 -5
- package/dist/DataView.js +23 -23
- package/dist/DataView.js.map +1 -1
- package/dist/DataViewFilters.js +26 -26
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +22 -22
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +52 -52
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +10 -10
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionList.js +2 -2
- package/dist/DescriptionList.js.map +1 -1
- package/dist/DescriptionListDetail.js +2 -2
- package/dist/DescriptionListDetail.js.map +1 -1
- package/dist/DescriptionListGroup.js +9 -9
- package/dist/DescriptionListGroup.js.map +1 -1
- package/dist/DescriptionListTerm.js +8 -8
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +47 -47
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +6 -6
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +20 -20
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +26 -26
- package/dist/EmptyState.js.map +1 -1
- package/dist/Field.js +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js → Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js} +17 -17
- package/dist/Field.vue_vue_type_script_setup_true_lang-dAGKfjf5.js.map +1 -0
- package/dist/FileUpload.js +47 -49
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +20 -20
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDrawerItem.js +13 -13
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDropdown.js +27 -27
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterSelect.js +33 -33
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +29 -29
- package/dist/Filters.js.map +1 -1
- package/dist/Filters.vue.d.ts +2 -8
- package/dist/HttpError.js +29 -29
- package/dist/HttpError.js.map +1 -1
- package/dist/HttpError.vue.d.ts +0 -3
- package/dist/Icon.js +12 -12
- package/dist/Icon.js.map +1 -1
- package/dist/IconLabel.js +19 -19
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/Illustration.js +2 -2
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js} +4 -4
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js.map → Illustration.vue_vue_type_script_setup_true_lang-C1bPkWZZ.js.map} +1 -1
- package/dist/Image.js +2 -2
- package/dist/Image.vue.d.ts +0 -3
- package/dist/{Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js → Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js} +11 -11
- package/dist/Image.vue_vue_type_script_setup_true_lang-CAj0FH9h.js.map +1 -0
- package/dist/InlineEdit.js +8 -8
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +29 -29
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +87 -84
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +2 -2
- package/dist/IntegrationIcon.js +11 -11
- package/dist/IntegrationIcon.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js} +16 -16
- package/dist/{Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js.map → Label.vue_vue_type_script_setup_true_lang-xwY3X-iV.js.map} +1 -1
- package/dist/ListItem.js +14 -14
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItem.vue.d.ts +0 -6
- package/dist/ListItemCell.js +9 -9
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListView.js +138 -141
- package/dist/ListView.js.map +1 -1
- package/dist/ListView.vue.d.ts +2 -26
- package/dist/Loading.js +8 -8
- package/dist/Loading.js.map +1 -1
- package/dist/Logo.js +1 -1
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js} +3 -3
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map → Logo.vue_vue_type_script_setup_true_lang-DghNC_k6.js.map} +1 -1
- package/dist/Menu.js +5 -5
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.js +12 -12
- package/dist/MenuItem.js.map +1 -1
- package/dist/Metric.js +24 -24
- package/dist/Metric.js.map +1 -1
- package/dist/Modal.js +60 -60
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +1 -1
- package/dist/Modals.js.map +1 -1
- package/dist/Module.js +6 -6
- package/dist/Module.js.map +1 -1
- package/dist/ModuleContent.js +16 -16
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleFooter.js +13 -13
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleHeader.js +29 -29
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/MoreActions.js +81 -84
- package/dist/MoreActions.js.map +1 -1
- package/dist/ObfuscateText.js +4 -4
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/PageContent.js +13 -13
- package/dist/PageContent.js.map +1 -1
- package/dist/PageHeader.js +28 -28
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/Paginate.js +45 -45
- package/dist/Paginate.js.map +1 -1
- package/dist/QuickAction.js +18 -18
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +17 -17
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +158 -154
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +80 -80
- package/dist/RadioNew.js.map +1 -1
- package/dist/RadioNew.vue.d.ts +0 -3
- package/dist/RangeInput.js +2 -2
- package/dist/RangeInput.js.map +1 -1
- package/dist/SearchBar.js +9 -9
- package/dist/SearchBar.js.map +1 -1
- package/dist/SectionHeader.js +14 -14
- package/dist/SectionHeader.js.map +1 -1
- package/dist/Select.js +369 -366
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +26 -27
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Skeleton.js +20 -20
- package/dist/Skeleton.js.map +1 -1
- package/dist/Step.js +37 -40
- package/dist/Step.js.map +1 -1
- package/dist/Stepper.js +17 -17
- package/dist/Stepper.js.map +1 -1
- package/dist/Switch.js +57 -57
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +17 -19
- package/dist/Tab.js.map +1 -1
- package/dist/TabPanel.js +1 -1
- package/dist/TabPanel.js.map +1 -1
- package/dist/Table.js +22 -22
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +32 -32
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +35 -35
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +10 -10
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +51 -51
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js → Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js} +33 -33
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-BVTCcK6M.js.map +1 -0
- package/dist/TextEditor.js +8 -8
- package/dist/TextEditor.js.map +1 -1
- package/dist/Textarea.js +15 -15
- package/dist/Textarea.js.map +1 -1
- package/dist/Thumbnail.js +41 -41
- package/dist/Thumbnail.js.map +1 -1
- package/dist/ThumbnailEmpty.js +3 -3
- package/dist/ThumbnailEmpty.js.map +1 -1
- package/dist/ThumbnailGroup.js +22 -22
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/Timeline.js +3 -3
- package/dist/Timeline.js.map +1 -1
- package/dist/TimelineItem.js +22 -22
- package/dist/TimelineItem.js.map +1 -1
- package/dist/Toast.js +29 -29
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +3 -0
- package/dist/Toasts.js +11 -11
- package/dist/Toasts.js.map +1 -1
- package/dist/Tooltip.js +2 -81
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.vue.d.ts +1 -1
- package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js +84 -0
- package/dist/Tooltip.vue_vue_type_script_setup_true_lang-mzBLSXy3.js.map +1 -0
- package/dist/components.css +2 -2
- package/dist/constants.d.ts +9 -9
- package/dist/constants.js +17 -17
- package/dist/constants.js.map +1 -1
- package/dist/directives/tooltip.js +2 -2
- package/dist/directives/tooltip.js.map +1 -1
- package/dist/{index-C14LhAwV.js → index-DBV9Uz0C.js} +3 -3
- package/dist/{index-C14LhAwV.js.map → index-DBV9Uz0C.js.map} +1 -1
- package/dist/tailwind-base.js.d.ts +12 -0
- package/dist/tailwind-base.js.map +1 -1
- package/dist/useSortable.js +1 -1
- package/dist/utils/helpers.js +15 -15
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +15 -15
- package/styles/backwards-compat.css +373 -2851
- package/styles/main.css +8 -0
- package/styles/sofia-font.css +23 -27
- package/styles/theme.css +1033 -0
- package/dist/Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js.map +0 -1
- package/dist/Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map +0 -1
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3Irnlcd.js.map +0 -1
- package/dist/tailwind-base.d.ts +0 -333
- package/styles/base.css +0 -902
- package/tailwind-base.ts +0 -455
package/dist/RadioNew.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { R as
|
|
3
|
-
import { _ as
|
|
4
|
-
const E = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as p, useCssModule as h, inject as B, createElementBlock as $, openBlock as m, normalizeClass as d, unref as t, createElementVNode as n, toDisplayString as y, withDirectives as C, vShow as M, renderSlot as w, computed as c, createBlock as g, resolveDynamicComponent as N, withCtx as D } from "vue";
|
|
2
|
+
import { R as x } from "./RadioGroup.keys-CqfiKkNz.js";
|
|
3
|
+
import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.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 },
|
|
@@ -14,44 +14,44 @@ const E = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @_
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["input"],
|
|
16
16
|
setup(s, { emit: u }) {
|
|
17
|
-
const e = s, l =
|
|
17
|
+
const e = s, l = h(), a = B(x.key), r = u;
|
|
18
18
|
return (o, i) => {
|
|
19
|
-
var
|
|
20
|
-
return
|
|
19
|
+
var b, v;
|
|
20
|
+
return m(), $("div", {
|
|
21
21
|
"data-variant-button": "",
|
|
22
22
|
class: d([
|
|
23
|
-
|
|
23
|
+
t(l).root,
|
|
24
24
|
{
|
|
25
|
-
"
|
|
26
|
-
[
|
|
25
|
+
"w-full": e.fullWidth,
|
|
26
|
+
[t(l)["radio-group-vertical-orientation"]]: ((v = (b = t(a)) == null ? void 0 : b.orientation) == null ? void 0 : v.value) === "vertical"
|
|
27
27
|
}
|
|
28
28
|
])
|
|
29
29
|
}, [
|
|
30
30
|
n("input", {
|
|
31
31
|
id: `${e.name}-${e.id}`,
|
|
32
|
-
class: d(["
|
|
32
|
+
class: d(["sr-only", t(l).input]),
|
|
33
33
|
type: "radio",
|
|
34
34
|
name: e.name,
|
|
35
35
|
value: e.value,
|
|
36
36
|
checked: e.modelValue === e.value,
|
|
37
37
|
disabled: e.disabled || e.disabled,
|
|
38
|
-
onInput: i[0] || (i[0] = (
|
|
38
|
+
onInput: i[0] || (i[0] = (k) => r("input", k))
|
|
39
39
|
}, null, 42, E),
|
|
40
40
|
n("label", {
|
|
41
|
-
class: d(
|
|
41
|
+
class: d(t(l).label),
|
|
42
42
|
for: `${e.name}-${e.id}`
|
|
43
43
|
}, y(e.label), 11, R)
|
|
44
44
|
], 2);
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
}),
|
|
48
|
-
label:
|
|
49
|
-
root:
|
|
50
|
-
"radio-group-vertical-orientation": "_radio-group-vertical-
|
|
51
|
-
input:
|
|
52
|
-
},
|
|
53
|
-
$style:
|
|
54
|
-
},
|
|
47
|
+
}), O = "_label_1upd7_3", S = "_root_1upd7_15", z = "_input_1upd7_37", A = {
|
|
48
|
+
label: O,
|
|
49
|
+
root: S,
|
|
50
|
+
"radio-group-vertical-orientation": "_radio-group-vertical-orientation_1upd7_33",
|
|
51
|
+
input: z
|
|
52
|
+
}, F = {
|
|
53
|
+
$style: A
|
|
54
|
+
}, J = /* @__PURE__ */ V(T, [["__cssModules", F]]), P = ["id", "name", "value", "checked", "disabled"], U = ["for"], q = /* @__PURE__ */ p({
|
|
55
55
|
__name: "VariantChip",
|
|
56
56
|
props: {
|
|
57
57
|
disabled: { type: Boolean },
|
|
@@ -64,32 +64,32 @@ const E = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @_
|
|
|
64
64
|
},
|
|
65
65
|
emits: ["input"],
|
|
66
66
|
setup(s, { emit: u }) {
|
|
67
|
-
const e = s, l =
|
|
68
|
-
return (r, o) => (
|
|
69
|
-
class: d([
|
|
67
|
+
const e = s, l = h(), a = u;
|
|
68
|
+
return (r, o) => (m(), $("div", {
|
|
69
|
+
class: d([t(l).root, { "w-full": e.fullWidth }])
|
|
70
70
|
}, [
|
|
71
71
|
n("input", {
|
|
72
72
|
id: `${e.name}-${e.id}`,
|
|
73
|
-
class: d(["
|
|
73
|
+
class: d(["sr-only", t(l).input]),
|
|
74
74
|
type: "radio",
|
|
75
75
|
name: e.name,
|
|
76
76
|
value: e.value,
|
|
77
77
|
checked: e.modelValue === e.value,
|
|
78
78
|
disabled: e.disabled || e.disabled,
|
|
79
|
-
onInput: o[0] || (o[0] = (i) =>
|
|
80
|
-
}, null, 42,
|
|
79
|
+
onInput: o[0] || (o[0] = (i) => a("input", i))
|
|
80
|
+
}, null, 42, P),
|
|
81
81
|
n("label", {
|
|
82
|
-
class: d(
|
|
82
|
+
class: d(t(l).label),
|
|
83
83
|
for: `${e.name}-${e.id}`
|
|
84
|
-
}, y(e.label), 11,
|
|
84
|
+
}, y(e.label), 11, U)
|
|
85
85
|
], 2));
|
|
86
86
|
}
|
|
87
|
-
}), H = "
|
|
87
|
+
}), H = "_label_17vp0_5", K = "_input_17vp0_19", L = {
|
|
88
88
|
label: H,
|
|
89
89
|
input: K
|
|
90
90
|
}, Q = {
|
|
91
91
|
$style: L
|
|
92
|
-
}, X = /* @__PURE__ */
|
|
92
|
+
}, X = /* @__PURE__ */ V(q, [["__cssModules", Q]]), Y = ["id", "name", "value", "checked", "disabled"], Z = ["for"], I = /* @__PURE__ */ p({
|
|
93
93
|
__name: "VariantRadio",
|
|
94
94
|
props: {
|
|
95
95
|
disabled: { type: Boolean },
|
|
@@ -102,34 +102,34 @@ const E = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @_
|
|
|
102
102
|
},
|
|
103
103
|
emits: ["input"],
|
|
104
104
|
setup(s, { emit: u }) {
|
|
105
|
-
const e = s, l =
|
|
106
|
-
return (r, o) => (
|
|
107
|
-
class: d(["
|
|
105
|
+
const e = s, l = h(), a = u;
|
|
106
|
+
return (r, o) => (m(), $("div", {
|
|
107
|
+
class: d(["flex", [t(l).root, { "w-full": e.fullWidth }]])
|
|
108
108
|
}, [
|
|
109
109
|
n("input", {
|
|
110
110
|
id: `${e.name}-${e.id}`,
|
|
111
|
-
class: d(
|
|
111
|
+
class: d(t(l).input),
|
|
112
112
|
type: "radio",
|
|
113
113
|
name: e.name,
|
|
114
114
|
value: e.value,
|
|
115
115
|
checked: e.modelValue === e.value,
|
|
116
116
|
disabled: e.disabled,
|
|
117
|
-
onInput: o[0] || (o[0] = (i) =>
|
|
117
|
+
onInput: o[0] || (o[0] = (i) => a("input", i))
|
|
118
118
|
}, null, 42, Y),
|
|
119
|
-
|
|
120
|
-
class: d([
|
|
119
|
+
C(n("label", {
|
|
120
|
+
class: d([t(l).label, { "text-ice-500": e.disabled }]),
|
|
121
121
|
for: `${e.name}-${e.id}`
|
|
122
122
|
}, y(e.label), 11, Z), [
|
|
123
|
-
[
|
|
123
|
+
[M, e.label]
|
|
124
124
|
])
|
|
125
125
|
], 2));
|
|
126
126
|
}
|
|
127
|
-
}), j = "
|
|
127
|
+
}), j = "_label_l6dx6_5", G = "_input_l6dx6_12", ee = {
|
|
128
128
|
label: j,
|
|
129
129
|
input: G
|
|
130
130
|
}, le = {
|
|
131
131
|
$style: ee
|
|
132
|
-
},
|
|
132
|
+
}, ae = /* @__PURE__ */ V(I, [["__cssModules", le]]), te = ["for"], se = ["id", "aria-labelledby", "name", "value", "checked", "disabled"], de = ["id"], oe = /* @__PURE__ */ p({
|
|
133
133
|
__name: "VariantTile",
|
|
134
134
|
props: {
|
|
135
135
|
disabled: { type: Boolean },
|
|
@@ -142,67 +142,67 @@ const E = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @_
|
|
|
142
142
|
},
|
|
143
143
|
emits: ["input"],
|
|
144
144
|
setup(s, { emit: u }) {
|
|
145
|
-
const e = s, l =
|
|
146
|
-
return (r, o) => (
|
|
147
|
-
class: d([
|
|
145
|
+
const e = s, l = h(), a = u;
|
|
146
|
+
return (r, o) => (m(), $("label", {
|
|
147
|
+
class: d([t(l).root, { "w-full": e.fullWidth, [t(l)["root--disabled"]]: e.disabled }]),
|
|
148
148
|
for: `${e.name}-${e.id}`
|
|
149
149
|
}, [
|
|
150
150
|
n("div", {
|
|
151
|
-
class: d(["
|
|
152
|
-
|
|
151
|
+
class: d(["flex border", [
|
|
152
|
+
t(l)["tile-header"],
|
|
153
153
|
{
|
|
154
|
-
"
|
|
155
|
-
"
|
|
154
|
+
"border-blue-500 bg-blue-100": e.modelValue === e.value && !e.disabled,
|
|
155
|
+
"border-ice-500 bg-ice-100": e.modelValue !== e.value || e.disabled
|
|
156
156
|
}
|
|
157
157
|
]])
|
|
158
158
|
}, [
|
|
159
159
|
n("input", {
|
|
160
160
|
id: `${e.name}-${e.id}`,
|
|
161
161
|
"aria-labelledby": `tile-label-${e.name}-${e.id}`,
|
|
162
|
-
class: d(["
|
|
162
|
+
class: d(["sr-only", t(l).input]),
|
|
163
163
|
type: "radio",
|
|
164
164
|
name: e.name,
|
|
165
165
|
value: e.value,
|
|
166
166
|
checked: e.modelValue === e.value,
|
|
167
167
|
disabled: e.disabled,
|
|
168
|
-
onInput: o[0] || (o[0] = (i) =>
|
|
168
|
+
onInput: o[0] || (o[0] = (i) => a("input", i))
|
|
169
169
|
}, null, 42, se),
|
|
170
170
|
n("div", {
|
|
171
171
|
id: `tile-label-${e.name}-${e.id}`,
|
|
172
|
-
class: d([
|
|
172
|
+
class: d([t(l).label, { "text-ice-500": e.disabled }])
|
|
173
173
|
}, y(e.label), 11, de)
|
|
174
174
|
], 2),
|
|
175
175
|
n("div", {
|
|
176
176
|
class: d([
|
|
177
|
-
|
|
177
|
+
t(l)["tile-body"],
|
|
178
178
|
{
|
|
179
|
-
"
|
|
180
|
-
"
|
|
179
|
+
"border-ice-500": e.modelValue !== e.value || e.disabled,
|
|
180
|
+
"border-blue-500": e.modelValue === e.value && !e.disabled
|
|
181
181
|
}
|
|
182
182
|
])
|
|
183
183
|
}, [
|
|
184
|
-
|
|
184
|
+
w(r.$slots, "default")
|
|
185
185
|
], 2)
|
|
186
|
-
], 10,
|
|
186
|
+
], 10, te));
|
|
187
187
|
}
|
|
188
|
-
}), ie = "
|
|
188
|
+
}), ie = "_root_1hkcw_5", ne = "_label_1hkcw_35", ue = "_input_1hkcw_42", re = {
|
|
189
189
|
root: ie,
|
|
190
|
-
"root--disabled": "_root--
|
|
191
|
-
"tile-header": "_tile-
|
|
192
|
-
"tile-body": "_tile-
|
|
190
|
+
"root--disabled": "_root--disabled_1hkcw_14",
|
|
191
|
+
"tile-header": "_tile-header_1hkcw_18",
|
|
192
|
+
"tile-body": "_tile-body_1hkcw_19",
|
|
193
193
|
label: ne,
|
|
194
194
|
input: ue
|
|
195
195
|
}, ce = {
|
|
196
196
|
$style: re
|
|
197
|
-
},
|
|
198
|
-
var
|
|
199
|
-
const fe = /* @__PURE__ */
|
|
197
|
+
}, _e = /* @__PURE__ */ V(oe, [["__cssModules", ce]]);
|
|
198
|
+
var _ = /* @__PURE__ */ ((s) => (s.Radio = "radio", s.Button = "button", s.Chip = "chip", s.Tile = "tile", s))(_ || {});
|
|
199
|
+
const fe = /* @__PURE__ */ p({
|
|
200
200
|
__name: "RadioNew",
|
|
201
201
|
props: {
|
|
202
202
|
name: { default: void 0 },
|
|
203
203
|
disabled: { type: Boolean, default: !1 },
|
|
204
204
|
fullWidth: { type: Boolean, default: !1 },
|
|
205
|
-
id: {
|
|
205
|
+
id: {},
|
|
206
206
|
modelValue: { default: void 0 },
|
|
207
207
|
hasError: { type: Boolean, default: !1 },
|
|
208
208
|
label: { default: "" },
|
|
@@ -212,38 +212,38 @@ const fe = /* @__PURE__ */ _({
|
|
|
212
212
|
emits: ["update:modelValue"],
|
|
213
213
|
setup(s, { emit: u }) {
|
|
214
214
|
const e = {
|
|
215
|
-
[
|
|
216
|
-
[
|
|
217
|
-
[
|
|
218
|
-
[
|
|
219
|
-
}, l = B(
|
|
220
|
-
function
|
|
215
|
+
[_.Button]: J,
|
|
216
|
+
[_.Chip]: X,
|
|
217
|
+
[_.Radio]: ae,
|
|
218
|
+
[_.Tile]: _e
|
|
219
|
+
}, l = B(x.key, null), a = s, r = c(() => a.modelValue || (l == null ? void 0 : l.modelValue.value)), o = c(() => a.name || (l == null ? void 0 : l.name.value)), i = c(() => a.fullWidth || (l == null ? void 0 : l.fullWidth.value)), b = c(() => a.disabled || (l == null ? void 0 : l.disabled.value)), v = c(() => a.variant || (l == null ? void 0 : l.variant.value) || "radio"), k = u;
|
|
220
|
+
function W(f) {
|
|
221
221
|
if (l != null && l.update) {
|
|
222
222
|
l.update(f);
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
|
|
225
|
+
k("update:modelValue", f.target.value);
|
|
226
226
|
}
|
|
227
|
-
return (f,
|
|
228
|
-
id:
|
|
229
|
-
disabled:
|
|
230
|
-
"has-error":
|
|
227
|
+
return (f, pe) => (m(), g(N(e[v.value]), {
|
|
228
|
+
id: a.id,
|
|
229
|
+
disabled: b.value,
|
|
230
|
+
"has-error": a.hasError,
|
|
231
231
|
"full-width": i.value,
|
|
232
|
-
label:
|
|
232
|
+
label: a.label,
|
|
233
233
|
"model-value": r.value,
|
|
234
234
|
name: o.value,
|
|
235
|
-
value:
|
|
236
|
-
onInput:
|
|
235
|
+
value: a.value,
|
|
236
|
+
onInput: W
|
|
237
237
|
}, {
|
|
238
238
|
default: D(() => [
|
|
239
|
-
|
|
239
|
+
w(f.$slots, "default")
|
|
240
240
|
]),
|
|
241
241
|
_: 3
|
|
242
242
|
}, 40, ["id", "disabled", "has-error", "full-width", "label", "model-value", "name", "value"]));
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
245
|
export {
|
|
246
|
-
|
|
246
|
+
_ as RadioVariant,
|
|
247
247
|
fe as default
|
|
248
248
|
};
|
|
249
249
|
//# sourceMappingURL=RadioNew.js.map
|
package/dist/RadioNew.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../../RadioGroup/RadioGroup.keys';\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 const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n const emit = defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <div\n data-variant-button\n :class=\"[\n classes.root,\n {\n 'tw-w-full': props.fullWidth,\n [classes['radio-group-vertical-orientation']]: radioGroupInjection?.orientation?.value === 'vertical',\n },\n ]\"\n >\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 .root.radio-group-vertical-orientation .label {\n border-right-color: var(--color-ice-500);\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 .root.radio-group-vertical-orientation:first-of-type .label {\n border-top-left-radius: theme('borderRadius.DEFAULT');\n border-top-right-radius: theme('borderRadius.DEFAULT');\n border-bottom-left-radius: 0;\n }\n\n .root.radio-group-vertical-orientation:last-of-type .label {\n border-top-right-radius: 0;\n border-bottom-right-radius: theme('borderRadius.DEFAULT');\n border-bottom-left-radius: theme('borderRadius.DEFAULT');\n }\n\n .root.radio-group-vertical-orientation:not(:first-of-type) .label {\n margin-left: 0;\n margin-top: -1px;\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 = 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 = 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 = 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 = 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":["props","__props","classes","useCssModule","radioGroupInjection","inject","RADIO_GROUP_INJECTION","emit","__emit","RadioVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","derivedModelValue","computed","derivedName","derivedNameFullWidth","derivedDisabled","derivedVariant","onInput","e"],"mappings":";;;;;;;;;;;;;;;;AA2CE,UAAMA,IAAQC,GACRC,IAAUC,EAAA,GACVC,IAAsBC,EAAOC,EAAsB,GAAG,GAEtDC,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNb,UAAMR,IAAQC,GACRC,IAAUC,EAAA,GAEVI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHb,UAAMR,IAAQC,GACRC,IAAUC,EAAA,GAEVI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHb,UAAMR,IAAQC,GACRC,IAAUC,EAAA,GAEVI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CR,IAAKC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;AC8DV,UAAMC,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,GAGjBV,IAAsBC,EAAOC,EAAsB,KAAK,IAAI,GAE5DN,IAAQC,GAcRc,IAAoBC,EAAS,MAAMhB,EAAM,eAAcI,KAAA,gBAAAA,EAAqB,WAAW,MAAK,GAC5Fa,IAAcD,EAAS,MAAMhB,EAAM,SAAQI,KAAA,gBAAAA,EAAqB,KAAK,MAAK,GAC1Ec,IAAuBF,EAAS,MAAMhB,EAAM,cAAaI,KAAA,gBAAAA,EAAqB,UAAU,MAAK,GAC7Fe,IAAkBH,EAAS,MAAMhB,EAAM,aAAYI,KAAA,gBAAAA,EAAqB,SAAS,MAAK,GACtFgB,IAAiBJ,EAAwB,MAAMhB,EAAM,YAAWI,KAAA,gBAAAA,EAAqB,QAAQ,UAAS,OAAO,GAE7GG,IAAOC;AAIb,aAASa,EAAQC,GAAU;AACzB,UAAIlB,KAAA,QAAAA,EAAqB,QAAQ;AAC/B,QAAAA,EAAoB,OAAOkB,CAAC;AAE5B;AAAA,MACF;AAEA,MAAAf,EAAK,qBAAsBe,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 { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../../RadioGroup/RadioGroup.keys';\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 const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n const emit = defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <div\n data-variant-button\n :class=\"[\n classes.root,\n {\n 'w-full': props.fullWidth,\n [classes['radio-group-vertical-orientation']]: radioGroupInjection?.orientation?.value === 'vertical',\n },\n ]\"\n >\n <input\n :id=\"`${props.name}-${props.id}`\"\n class=\"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 @layer utilities {\n .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:first-of-type .label {\n border-top-left-radius: var(--radius-sm);\n border-bottom-left-radius: var(--radius-sm);\n }\n\n .root:last-of-type .label {\n border-top-right-radius: var(--radius-sm);\n border-bottom-right-radius: var(--radius-sm);\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 .root.radio-group-vertical-orientation .label {\n border-right-color: var(--color-ice-500);\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 .root.radio-group-vertical-orientation:first-of-type .label {\n border-top-left-radius: var(--radius-sm);\n border-top-right-radius: var(--radius-sm);\n border-bottom-left-radius: 0;\n }\n\n .root.radio-group-vertical-orientation:last-of-type .label {\n border-top-right-radius: 0;\n border-bottom-right-radius: var(--radius-sm);\n border-bottom-left-radius: var(--radius-sm);\n }\n\n .root.radio-group-vertical-orientation:not(:first-of-type) .label {\n margin-left: 0;\n margin-top: -1px;\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 }\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 = defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <div :class=\"[classes.root, { 'w-full': props.fullWidth }]\">\n <input\n :id=\"`${props.name}-${props.id}`\"\n class=\"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 @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .label {\n display: inline-block;\n padding: --spacing(1) --spacing(3);\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-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: var(--color-white);\n background-color: var(--color-blue-500);\n font-weight: var(--font-weight-bold);\n }\n\n .input:not(:checked, :disabled) ~ .label:hover {\n border-color: var(--color-blue-500);\n }\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 = defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <div class=\"flex\" :class=\"[classes.root, { '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, { '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 @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .label {\n font-weight: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 --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 }\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 = defineEmits<{\n (e: 'input', event: Event): void;\n }>();\n</script>\n\n<template>\n <label\n :class=\"[classes.root, { 'w-full': props.fullWidth, [classes['root--disabled']]: props.disabled }]\"\n :for=\"`${props.name}-${props.id}`\"\n >\n <div\n class=\"flex border\"\n :class=\"[\n classes['tile-header'],\n {\n 'border-blue-500 bg-blue-100': props.modelValue === props.value && !props.disabled,\n 'border-ice-500 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=\"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, { 'text-ice-500': props.disabled }]\">\n {{ props.label }}\n </div>\n </div>\n <div\n :class=\"[\n classes['tile-body'],\n {\n 'border-ice-500': props.modelValue !== props.value || props.disabled,\n '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 @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .root {\n border-radius: var(--radius-sm);\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: var(--radius-sm) var(--radius-sm) 0 0;\n padding: --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: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 --spacing(3);\n }\n\n .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 margin-left: --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 var(--radius-sm) var(--radius-sm);\n border-width: 0 1px 1px 1px;\n background-color: var(--color-white);\n padding: --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 }\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 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 = 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":["props","__props","classes","useCssModule","radioGroupInjection","inject","RADIO_GROUP_INJECTION","emit","__emit","RadioVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","derivedModelValue","computed","derivedName","derivedNameFullWidth","derivedDisabled","derivedVariant","onInput","e"],"mappings":";;;;;;;;;;;;;;;;AA2CE,UAAMA,IAAQC,GACRC,IAAUC,EAAA,GACVC,IAAsBC,EAAOC,EAAsB,GAAG,GAEtDC,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNb,UAAMR,IAAQC,GACRC,IAAUC,EAAA,GAEVI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHb,UAAMR,IAAQC,GACRC,IAAUC,EAAA,GAEVI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHb,UAAMR,IAAQC,GACRC,IAAUC,EAAA,GAEVI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CR,IAAKC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,OAAO,QAJGA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;AC8DV,UAAMC,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,GAGjBV,IAAsBC,EAAOC,EAAsB,KAAK,IAAI,GAE5DN,IAAQC,GAaRc,IAAoBC,EAAS,MAAMhB,EAAM,eAAcI,KAAA,gBAAAA,EAAqB,WAAW,MAAK,GAC5Fa,IAAcD,EAAS,MAAMhB,EAAM,SAAQI,KAAA,gBAAAA,EAAqB,KAAK,MAAK,GAC1Ec,IAAuBF,EAAS,MAAMhB,EAAM,cAAaI,KAAA,gBAAAA,EAAqB,UAAU,MAAK,GAC7Fe,IAAkBH,EAAS,MAAMhB,EAAM,aAAYI,KAAA,gBAAAA,EAAqB,SAAS,MAAK,GACtFgB,IAAiBJ,EAAwB,MAAMhB,EAAM,YAAWI,KAAA,gBAAAA,EAAqB,QAAQ,UAAS,OAAO,GAE7GG,IAAOC;AAIb,aAASa,EAAQC,GAAU;AACzB,UAAIlB,KAAA,QAAAA,EAAqB,QAAQ;AAC/B,QAAAA,EAAoB,OAAOkB,CAAC;AAE5B;AAAA,MACF;AAEA,MAAAf,EAAK,qBAAsBe,EAAE,OAA4B,KAAK;AAAA,IAChE;;;;;;;;;;;;;;;;;;;"}
|
package/dist/RadioNew.vue.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes
|
|
|
36
36
|
disabled: boolean;
|
|
37
37
|
fullWidth: boolean;
|
|
38
38
|
hasError: boolean;
|
|
39
|
-
id: undefined;
|
|
40
39
|
label: string;
|
|
41
40
|
modelValue: undefined;
|
|
42
41
|
name: undefined;
|
|
@@ -47,7 +46,6 @@ variant: undefined;
|
|
|
47
46
|
disabled: boolean;
|
|
48
47
|
fullWidth: boolean;
|
|
49
48
|
hasError: boolean;
|
|
50
|
-
id: undefined;
|
|
51
49
|
label: string;
|
|
52
50
|
modelValue: undefined;
|
|
53
51
|
name: undefined;
|
|
@@ -58,7 +56,6 @@ variant: undefined;
|
|
|
58
56
|
name: string;
|
|
59
57
|
disabled: boolean;
|
|
60
58
|
label: string;
|
|
61
|
-
id: string | number;
|
|
62
59
|
hasError: boolean;
|
|
63
60
|
modelValue: string;
|
|
64
61
|
variant: "button" | "radio" | "tile" | "chip";
|
package/dist/RangeInput.js
CHANGED
|
@@ -2,7 +2,7 @@ import { defineComponent as o, useSlots as n, createElementBlock as a, openBlock
|
|
|
2
2
|
import m from "./Icon.js";
|
|
3
3
|
const p = {
|
|
4
4
|
"data-test": "stash-range-input",
|
|
5
|
-
class: "stash-range-input
|
|
5
|
+
class: "stash-range-input flex gap-3"
|
|
6
6
|
}, _ = /* @__PURE__ */ o({
|
|
7
7
|
__name: "RangeInput",
|
|
8
8
|
setup(c) {
|
|
@@ -13,7 +13,7 @@ const p = {
|
|
|
13
13
|
s(e.$slots, "min"),
|
|
14
14
|
l(m, {
|
|
15
15
|
name: "transfer",
|
|
16
|
-
class: "
|
|
16
|
+
class: "mb-2 mt-auto"
|
|
17
17
|
}),
|
|
18
18
|
s(e.$slots, "max")
|
|
19
19
|
]));
|
package/dist/RangeInput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeInput.js","sources":["../src/components/RangeInput/RangeInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n\n const slots = useSlots();\n\n const hasSlots = !!slots.min && !!slots.max;\n\n if (!hasSlots) {\n throw new Error('RangeInput: please provide slots for min and max values.');\n }\n</script>\n\n<template>\n <div data-test=\"stash-range-input\" class=\"stash-range-input
|
|
1
|
+
{"version":3,"file":"RangeInput.js","sources":["../src/components/RangeInput/RangeInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useSlots } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n\n const slots = useSlots();\n\n const hasSlots = !!slots.min && !!slots.max;\n\n if (!hasSlots) {\n throw new Error('RangeInput: please provide slots for min and max values.');\n }\n</script>\n\n<template>\n <div data-test=\"stash-range-input\" class=\"stash-range-input flex gap-3\">\n <!-- @slot field for minimal value input -->\n <slot name=\"min\"></slot>\n\n <Icon name=\"transfer\" class=\"mb-2 mt-auto\" />\n <!-- @slot Field for maximal value input -->\n <slot name=\"max\"></slot>\n </div>\n</template>\n"],"names":["slots","useSlots"],"mappings":";;;;;;;;AAKE,UAAMA,IAAQC,EAAA;AAId,QAAI,EAFa,CAAC,CAACD,EAAM,OAAO,CAAC,CAACA,EAAM;AAGtC,YAAM,IAAI,MAAM,0DAA0D;;;;;;;;;;;"}
|
package/dist/SearchBar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as C, useSlots as S, ref as i, computed as V, createBlock as h, openBlock as p, withKeys as s, normalizeClass as m, createSlots as I, withCtx as n, createCommentVNode as T, createVNode as
|
|
1
|
+
import { defineComponent as C, useSlots as S, ref as i, computed as V, createBlock as h, openBlock as p, withKeys as s, normalizeClass as m, createSlots as I, withCtx as n, createCommentVNode as T, createVNode as d, unref as K, renderSlot as L } from "vue";
|
|
2
2
|
import { t as f } from "./locale.js";
|
|
3
3
|
import b from "./Button.js";
|
|
4
4
|
import v from "./Icon.js";
|
|
@@ -17,20 +17,20 @@ const N = /* @__PURE__ */ C({
|
|
|
17
17
|
},
|
|
18
18
|
emits: ["search", "update:model-value"],
|
|
19
19
|
setup(_, { emit: k }) {
|
|
20
|
-
const e = _, l = k, g = S(), a = i(e.modelValue),
|
|
20
|
+
const e = _, l = k, g = S(), a = i(e.modelValue), u = i(), x = V(() => a.value ? 0 : -1);
|
|
21
21
|
function o() {
|
|
22
22
|
e.isLoading || e.isWorking || l("search", a.value);
|
|
23
23
|
}
|
|
24
24
|
function c() {
|
|
25
25
|
var r, t;
|
|
26
|
-
a.value = "", l("search", ""), l("update:model-value", ""), (t = (r =
|
|
26
|
+
a.value = "", l("search", ""), l("update:model-value", ""), (t = (r = u.value) == null ? void 0 : r.inputEl) == null || t.focus();
|
|
27
27
|
}
|
|
28
28
|
function y() {
|
|
29
29
|
l("update:model-value", a.value);
|
|
30
30
|
}
|
|
31
31
|
return (r, t) => (p(), h(W, {
|
|
32
32
|
ref_key: "stashInputRef",
|
|
33
|
-
ref:
|
|
33
|
+
ref: u,
|
|
34
34
|
modelValue: a.value,
|
|
35
35
|
"onUpdate:modelValue": [
|
|
36
36
|
t[0] || (t[0] = (B) => a.value = B),
|
|
@@ -56,11 +56,11 @@ const N = /* @__PURE__ */ C({
|
|
|
56
56
|
]
|
|
57
57
|
}, {
|
|
58
58
|
default: n(() => [
|
|
59
|
-
|
|
59
|
+
d(v, { name: "close" })
|
|
60
60
|
]),
|
|
61
61
|
_: 1
|
|
62
62
|
}, 8, ["disabled"])) : T("", !0),
|
|
63
|
-
|
|
63
|
+
d(b, {
|
|
64
64
|
tabindex: x.value,
|
|
65
65
|
"data-test": "stash-search-bar|search-button",
|
|
66
66
|
disabled: e.isLoading,
|
|
@@ -72,8 +72,8 @@ const N = /* @__PURE__ */ C({
|
|
|
72
72
|
]
|
|
73
73
|
}, {
|
|
74
74
|
default: n(() => [
|
|
75
|
-
|
|
76
|
-
class: m({ "
|
|
75
|
+
d(v, {
|
|
76
|
+
class: m({ "animate-spin": e.isWorking }),
|
|
77
77
|
name: e.isWorking ? "loading-empty" : "search"
|
|
78
78
|
}, null, 8, ["class", "name"])
|
|
79
79
|
]),
|
|
@@ -91,7 +91,7 @@ const N = /* @__PURE__ */ C({
|
|
|
91
91
|
} : void 0
|
|
92
92
|
]), 1032, ["modelValue", "class", "label", "placeholder", "hint-text"]));
|
|
93
93
|
}
|
|
94
|
-
}), q = /* @__PURE__ */ w(N, [["__scopeId", "data-v-
|
|
94
|
+
}), q = /* @__PURE__ */ w(N, [["__scopeId", "data-v-fb06db50"]]);
|
|
95
95
|
export {
|
|
96
96
|
q as default
|
|
97
97
|
};
|
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 { computed, ref, 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 = 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 slots = useSlots();\n const searchTerm = ref(props.modelValue);\n const stashInputRef = ref<InstanceType<typeof Input>>();\n\n const searchTabIndex = computed(() => (searchTerm.value ? 0 : -1));\n\n function onSearch() {\n if (props.isLoading || props.isWorking) {\n return;\n }\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=\"[{ 'stash-search-bar--value': !!searchTerm }]\"\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=\"onSearch\"\n >\n <template #append>\n <Button\n v-if=\"searchTerm\"\n class=\"stash-search-bar__clear-button\"\n :disabled=\"props.isLoading\"\n data-test=\"stash-search-bar|clear-button\"\n @click=\"clearSearchTerm\"\n @keyup.enter=\"clearSearchTerm\"\n @keyup.space=\"clearSearchTerm\"\n >\n <Icon name=\"close\" />\n </Button>\n <Button\n :tabindex=\"searchTabIndex\"\n data-test=\"stash-search-bar|search-button\"\n :disabled=\"props.isLoading\"\n class=\"stash-search-bar__search-button\"\n @click=\"onSearch\"\n @keyup.enter=\"onSearch\"\n @keyup.space=\"onSearch\"\n >\n <Icon :class=\"{ '
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":["../src/components/SearchBar/SearchBar.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, ref, 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 = 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 slots = useSlots();\n const searchTerm = ref(props.modelValue);\n const stashInputRef = ref<InstanceType<typeof Input>>();\n\n const searchTabIndex = computed(() => (searchTerm.value ? 0 : -1));\n\n function onSearch() {\n if (props.isLoading || props.isWorking) {\n return;\n }\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=\"[{ 'stash-search-bar--value': !!searchTerm }]\"\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=\"onSearch\"\n >\n <template #append>\n <Button\n v-if=\"searchTerm\"\n class=\"stash-search-bar__clear-button\"\n :disabled=\"props.isLoading\"\n data-test=\"stash-search-bar|clear-button\"\n @click=\"clearSearchTerm\"\n @keyup.enter=\"clearSearchTerm\"\n @keyup.space=\"clearSearchTerm\"\n >\n <Icon name=\"close\" />\n </Button>\n <Button\n :tabindex=\"searchTabIndex\"\n data-test=\"stash-search-bar|search-button\"\n :disabled=\"props.isLoading\"\n class=\"stash-search-bar__search-button\"\n @click=\"onSearch\"\n @keyup.enter=\"onSearch\"\n @keyup.space=\"onSearch\"\n >\n <Icon :class=\"{ 'animate-spin': props.isWorking }\" :name=\"props.isWorking ? 'loading-empty' : 'search'\" />\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 scoped>\n @reference \"../../../styles/main.css\";\n\n @layer utilities {\n .stash-search-bar :deep(input) {\n text-overflow: ellipsis;\n }\n\n .stash-search-bar--value :deep(input) {\n padding-right: 72px;\n }\n\n .stash-search-bar :deep(input):hover {\n border: 1px solid var(--color-blue-500);\n }\n\n .stash-search-bar :deep(.stash-input-append) {\n display: flex;\n justify-content: flex-end;\n width: 72px; /* double the the default width of 36px */\n overflow: visible;\n }\n\n .stash-search-bar__clear-button {\n color: var(--color-ice-700);\n height: --spacing(9);\n min-width: --spacing(9);\n width: --spacing(9);\n background: none;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:focus-visible {\n outline: none;\n box-shadow: none;\n\n & svg {\n border-radius: var(--radius-sm);\n\n @apply ring-4 ring-blue-500/15;\n }\n }\n }\n\n .stash-search-bar__clear-button:disabled {\n color: var(--color-ice-500);\n cursor: default;\n }\n\n .stash-search-bar__search-button {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n height: --spacing(9);\n min-width: --spacing(9);\n width: --spacing(9);\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:focus {\n box-shadow: none;\n }\n\n &:disabled {\n border-color: var(--color-ice-500);\n }\n\n &:hover {\n background-color: var(--color-blue-600);\n }\n\n &:active {\n background-color: var(--color-blue-700);\n }\n\n &:focus-visible {\n outline: none;\n border: 1px solid var(--color-blue-900);\n /* Simulating a bigger border so the design does not break */\n box-shadow:\n inset 0 0 0 1px var(--color-blue-900),\n 0 0 0 4px rgb(0 114 240 / 15%); /* Unfortunatelly, we have to use RGBA to make the shadow transparent, this is blue-500 */\n }\n }\n }\n</style>\n"],"names":["props","__props","emit","__emit","slots","useSlots","searchTerm","ref","stashInputRef","searchTabIndex","computed","onSearch","clearSearchTerm","_b","_a","handleChange"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CE,UAAMA,IAAQC,GASRC,IAAOC,GAYPC,IAAQC,EAAA,GACRC,IAAaC,EAAIP,EAAM,UAAU,GACjCQ,IAAgBD,EAAA,GAEhBE,IAAiBC,EAAS,MAAOJ,EAAW,QAAQ,IAAI,EAAG;AAEjE,aAASK,IAAW;AAClB,MAAIX,EAAM,aAAaA,EAAM,aAG7BE,EAAK,UAAUI,EAAW,KAAK;AAAA,IACjC;AAEA,aAASM,IAAkB;;AACzB,MAAAN,EAAW,QAAQ,IACnBJ,EAAK,UAAU,EAAE,GACjBA,EAAK,sBAAsB,EAAE,IAE7BW,KAAAC,IAAAN,EAAc,UAAd,gBAAAM,EAAqB,YAArB,QAAAD,EAA8B;AAAA,IAChC;AAEA,aAASE,IAAe;AACtB,MAAAb,EAAK,sBAAsBI,EAAW,KAAK;AAAA,IAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/SectionHeader.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as m, computed as s, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
class: "stash-section-header__content
|
|
1
|
+
import { defineComponent as m, computed as s, createElementBlock as h, openBlock as n, createElementVNode as e, createBlock as p, renderSlot as u, resolveDynamicComponent as _, mergeProps as f, withCtx as v, toDisplayString as x, createVNode as b } from "vue";
|
|
2
|
+
import g from "./Icon.js";
|
|
3
|
+
const k = { class: "stash-section-header" }, w = {
|
|
4
|
+
class: "stash-section-header__content flex-wrap items-center justify-between px-6 py-3 md:flex",
|
|
5
5
|
"data-test": "stash-section-header|content"
|
|
6
|
-
}, y = { "data-test": "stash-section-header|title" }, C = { class: "stash-section-header__action-label
|
|
6
|
+
}, y = { "data-test": "stash-section-header|title" }, C = { class: "stash-section-header__action-label m-0 text-ice-900" }, E = { class: "stash-section-header__action-icon size-6 items-center rounded-full bg-ice-200 p-[2px] text-ice-900" }, S = /* @__PURE__ */ m({
|
|
7
7
|
__name: "SectionHeader",
|
|
8
8
|
props: {
|
|
9
9
|
actionLabel: { default: "View All" },
|
|
@@ -15,24 +15,24 @@ const g = { class: "stash-section-header" }, k = {
|
|
|
15
15
|
const t = a, c = i, r = s(() => t.to ? "router-link" : "button"), l = s(() => t.to ? {
|
|
16
16
|
to: t.to
|
|
17
17
|
} : {});
|
|
18
|
-
return (d, o) => (n(),
|
|
19
|
-
e("div",
|
|
18
|
+
return (d, o) => (n(), h("div", k, [
|
|
19
|
+
e("div", w, [
|
|
20
20
|
e("div", y, [
|
|
21
21
|
e("h2", null, [
|
|
22
|
-
|
|
22
|
+
u(d.$slots, "default")
|
|
23
23
|
])
|
|
24
24
|
]),
|
|
25
|
-
(n(),
|
|
25
|
+
(n(), p(_(r.value), f(l.value, {
|
|
26
26
|
"data-test": "stash-section-header|action",
|
|
27
|
-
class: "stash-section-header__action
|
|
27
|
+
class: "stash-section-header__action flex items-center gap-3 max-md:pt-3",
|
|
28
28
|
onClick: o[0] || (o[0] = () => {
|
|
29
29
|
t.to || c("actionEvent");
|
|
30
30
|
})
|
|
31
31
|
}), {
|
|
32
|
-
default:
|
|
33
|
-
e("span", C,
|
|
32
|
+
default: v(() => [
|
|
33
|
+
e("span", C, x(t.actionLabel), 1),
|
|
34
34
|
e("span", E, [
|
|
35
|
-
|
|
35
|
+
b(g, {
|
|
36
36
|
name: t.actionIcon,
|
|
37
37
|
size: "dense"
|
|
38
38
|
}, null, 8, ["name"])
|
|
@@ -41,7 +41,7 @@ const g = { class: "stash-section-header" }, k = {
|
|
|
41
41
|
_: 1
|
|
42
42
|
}, 16))
|
|
43
43
|
]),
|
|
44
|
-
o[1] || (o[1] = e("div", { class: "stash-section-header__divider
|
|
44
|
+
o[1] || (o[1] = e("div", { class: "stash-section-header__divider h-px bg-ice-200" }, null, -1))
|
|
45
45
|
]));
|
|
46
46
|
}
|
|
47
47
|
});
|