@leaflink/stash 51.10.0 → 51.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.js.map +1 -1
- package/dist/Accordion.vue.d.ts +37 -6
- package/dist/ActionsDropdown.js +2 -2
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/ActionsDropdown.vue.d.ts +74 -0
- package/dist/AddressSelect.js +60 -56
- package/dist/AddressSelect.js.map +1 -1
- package/dist/AddressSelect.vue.d.ts +65 -8
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.vue.d.ts +41 -4
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppNavigationItem.vue.d.ts +31 -4
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppSidebar.vue.d.ts +35 -8
- package/dist/AppTopbar.js +1 -1
- package/dist/AppTopbar.js.map +1 -1
- package/dist/AppTopbar.vue.d.ts +33 -4
- package/dist/Avatar.js.map +1 -1
- package/dist/Avatar.vue.d.ts +44 -5
- package/dist/Backdrop.js.map +1 -1
- package/dist/Backdrop.vue.d.ts +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Badge.vue.d.ts +55 -6
- package/dist/Box.vue.d.ts +36 -3
- package/dist/Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue.d.ts +50 -5
- package/dist/ButtonGroup.js +37 -33
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/ButtonGroup.vue.d.ts +39 -6
- package/dist/Card.js.map +1 -1
- package/dist/Card.vue.d.ts +32 -5
- package/dist/CardContent.js.map +1 -1
- package/dist/CardContent.vue.d.ts +1 -1
- package/dist/CardFooter.js.map +1 -1
- package/dist/CardFooter.vue.d.ts +1 -1
- package/dist/CardHeader.js.map +1 -1
- package/dist/CardHeader.vue.d.ts +15 -2
- package/dist/CardMedia.js.map +1 -1
- package/dist/CardMedia.vue.d.ts +15 -2
- package/dist/Carousel.js +72 -66
- package/dist/Carousel.js.map +1 -1
- package/dist/Carousel.vue.d.ts +10 -10
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +53 -8
- package/dist/ChevronToggle.vue.d.ts +34 -7
- package/dist/ChevronToggle.vue_vue_type_script_setup_true_lang-Ce_qOXfR.js.map +1 -1
- package/dist/Chip.js.map +1 -1
- package/dist/Chip.vue.d.ts +52 -10
- package/dist/ConfirmationCodeInput.js +44 -40
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ConfirmationCodeInput.vue.d.ts +43 -8
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/ContextSwitcher.vue.d.ts +41 -6
- package/dist/Copy.js.map +1 -1
- package/dist/Copy.vue.d.ts +34 -3
- package/dist/CurrencyInput.js +21 -20
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +46 -125
- package/dist/CustomRender.js.map +1 -1
- package/dist/DataView.js +96 -94
- package/dist/DataView.js.map +1 -1
- package/dist/DataView.keys-aSOnA4AD.js.map +1 -1
- package/dist/DataView.vue.d.ts +57 -12
- package/dist/DataViewFilters.js +139 -127
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewFilters.keys-BLu07FiP.js.map +1 -1
- package/dist/DataViewFilters.vue.d.ts +54 -9
- package/dist/DataViewSortButton.js +2 -2
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewSortButton.vue.d.ts +30 -3
- package/dist/DataViewToolbar.js +151 -83
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DataViewToolbar.vue.d.ts +40 -5
- package/dist/DatePicker.js +4636 -4524
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePicker.vue.d.ts +79 -30
- package/dist/DescriptionList.js.map +1 -1
- package/dist/DescriptionList.vue.d.ts +32 -3
- package/dist/DescriptionListDetail.js.map +1 -1
- package/dist/DescriptionListDetail.vue.d.ts +1 -1
- package/dist/DescriptionListGroup.js.map +1 -1
- package/dist/DescriptionListGroup.vue.d.ts +1 -1
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/DescriptionListTerm.vue.d.ts +1 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.vue.d.ts +53 -10
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +95 -89
- package/dist/Dropdown.js.map +1 -1
- package/dist/Dropdown.vue.d.ts +48 -12
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/EmptyState.vue.d.ts +62 -5
- package/dist/Expand.vue.d.ts +40 -10
- package/dist/Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js.map +1 -1
- package/dist/Field.vue.d.ts +53 -4
- package/dist/Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js.map +1 -1
- package/dist/FileUpload.js +74 -72
- package/dist/FileUpload.js.map +1 -1
- package/dist/FileUpload.vue.d.ts +44 -10
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterChip.vue.d.ts +41 -6
- package/dist/FilterDrawerItem.js +21 -21
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDrawerItem.vue.d.ts +23 -6
- package/dist/FilterDropdown.js +69 -63
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterDropdown.vue.d.ts +35 -122
- package/dist/FilterSelect.js.map +1 -1
- package/dist/FilterSelect.vue.d.ts +31 -4
- package/dist/Filters.js +164 -157
- package/dist/Filters.js.map +1 -1
- package/dist/Filters.vue.d.ts +2190 -0
- package/dist/HttpError.js +7 -7
- package/dist/HttpError.js.map +1 -1
- package/dist/HttpError.vue.d.ts +41 -4
- package/dist/Icon.js +17 -17
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +36 -3
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +40 -5
- package/dist/Illustration.js +2 -2
- package/dist/Illustration.vue.d.ts +42 -3
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BVzzNsRt.js → Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js} +11 -11
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BVzzNsRt.js.map → Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js.map} +1 -1
- package/dist/Image.js +2 -2
- package/dist/Image.vue.d.ts +40 -5
- package/dist/{Image.vue_vue_type_script_setup_true_lang-Dg2Zk2r2.js → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js} +41 -37
- package/dist/{Image.vue_vue_type_script_setup_true_lang-Dg2Zk2r2.js.map → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map} +1 -1
- package/dist/InlineEdit.js.map +1 -1
- package/dist/InlineEdit.vue.d.ts +47 -126
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +45 -12
- package/dist/InputOptions.js +69 -66
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +55 -10
- package/dist/IntegrationIcon.js +7 -7
- package/dist/IntegrationIcon.js.map +1 -1
- package/dist/IntegrationIcon.vue.d.ts +36 -3
- package/dist/Label.vue.d.ts +42 -3
- package/dist/Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js.map +1 -1
- package/dist/LicenseChip.js.map +1 -1
- package/dist/LicenseChip.vue.d.ts +30 -3
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItem.vue.d.ts +294 -0
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListItemCell.vue.d.ts +21 -0
- package/dist/ListView.js +7 -4
- package/dist/ListView.js.map +1 -1
- package/dist/ListView.types.d.ts +29 -0
- package/dist/ListView.vue.d.ts +5496 -0
- package/dist/Loading.js +2 -2
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue.d.ts +1 -1
- package/dist/Logo.js +1 -1
- package/dist/Logo.vue.d.ts +41 -6
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-Y3iE9utm.js → Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js} +17 -17
- package/dist/Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map +1 -0
- package/dist/Menu.js.map +1 -1
- package/dist/Menu.vue.d.ts +1 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MenuItem.vue.d.ts +1 -1
- package/dist/MenusPlugin-Bk6UW6o9.js +12 -0
- package/dist/{MenusPlugin-B4jpNe7x.js.map → MenusPlugin-Bk6UW6o9.js.map} +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Metric.vue.d.ts +34 -3
- package/dist/Modal.js +64 -62
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.vue.d.ts +60 -13
- package/dist/Modals.js +18 -17
- package/dist/Modals.js.map +1 -1
- package/dist/ModalsPlugin.js +11 -11
- package/dist/ModalsPlugin.js.map +1 -1
- package/dist/Module.js.map +1 -1
- package/dist/Module.keys-CEsrW2f0.js.map +1 -1
- package/dist/Module.types-B1FfGGac.js.map +1 -1
- package/dist/Module.vue.d.ts +29 -2
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleContent.vue.d.ts +3 -3
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleFooter.vue.d.ts +1 -1
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ModuleHeader.vue.d.ts +39 -5
- package/dist/MoreActions.js +491 -0
- package/dist/MoreActions.js.map +1 -0
- package/dist/MoreActions.vue.d.ts +126 -0
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +40 -3
- package/dist/PageContent.js.map +1 -1
- package/dist/PageContent.vue.d.ts +30 -3
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageHeader.vue.d.ts +35 -6
- package/dist/PageNavigation.js +50 -50
- package/dist/PageNavigation.js.map +1 -1
- package/dist/PageNavigation.vue.d.ts +36 -7
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue.d.ts +40 -5
- package/dist/PlaidLink.js.map +1 -1
- package/dist/PlaidLink.vue.d.ts +49 -12
- package/dist/QuickAction.js.map +1 -1
- package/dist/QuickAction.vue.d.ts +15 -2
- package/dist/Radio.js.map +1 -1
- package/dist/Radio.vue.d.ts +93 -0
- package/dist/RadioGroup.js +101 -94
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.vue.d.ts +42 -116
- package/dist/RadioNew.js +99 -96
- package/dist/RadioNew.js.map +1 -1
- package/dist/RadioNew.vue.d.ts +48 -7
- package/dist/RangeInput.js.map +1 -1
- package/dist/RangeInput.vue.d.ts +1 -1
- package/dist/SearchBar.js +39 -38
- package/dist/SearchBar.js.map +1 -1
- package/dist/SearchBar.vue.d.ts +44 -127
- package/dist/SectionHeader.js.map +1 -1
- package/dist/SectionHeader.vue.d.ts +36 -5
- package/dist/Select.js +183 -171
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +102 -23
- package/dist/SelectStatus.js +38 -38
- package/dist/SelectStatus.js.map +1 -1
- package/dist/SelectStatus.vue.d.ts +46 -226
- package/dist/Skeleton.js.map +1 -1
- package/dist/Skeleton.vue.d.ts +34 -3
- package/dist/Step.js +44 -44
- package/dist/Step.js.map +1 -1
- package/dist/Step.vue.d.ts +43 -4
- package/dist/Stepper.js.map +1 -1
- package/dist/Stepper.vue.d.ts +44 -9
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.vue.d.ts +47 -8
- package/dist/Tab.js +9 -9
- package/dist/Tab.js.map +1 -1
- package/dist/Tab.vue.d.ts +15 -2
- package/dist/TabPanel.js.map +1 -1
- package/dist/TabPanel.vue.d.ts +30 -3
- package/dist/Table.js +59 -53
- package/dist/Table.js.map +1 -1
- package/dist/Table.keys-LHQf6FEH.js.map +1 -1
- package/dist/Table.vue.d.ts +50 -3
- package/dist/TableCell.js +1 -1
- package/dist/TableCell.js.map +1 -1
- package/dist/TableCell.vue.d.ts +32 -3
- package/dist/TableHeaderCell.js +1 -1
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderCell.vue.d.ts +30 -3
- package/dist/TableHeaderRow.js +1 -1
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableHeaderRow.vue.d.ts +34 -5
- package/dist/TableRow.js +44 -43
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRow.vue.d.ts +48 -7
- package/dist/Tabs.js +2 -2
- package/dist/Tabs.vue.d.ts +31 -122
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-BlJVDr7o.js +78 -0
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-BlJVDr7o.js.map +1 -0
- package/dist/TextEditor.js +2420 -2414
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +39 -8
- package/dist/Textarea.js +32 -29
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +44 -9
- package/dist/Thumbnail.js +1 -1
- package/dist/Thumbnail.js.map +1 -1
- package/dist/Thumbnail.vue.d.ts +4 -4
- package/dist/ThumbnailEmpty.js.map +1 -1
- package/dist/ThumbnailEmpty.vue.d.ts +1 -1
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/ThumbnailGroup.keys-EJ4qFNhx.js.map +1 -1
- package/dist/ThumbnailGroup.vue.d.ts +22 -26
- package/dist/Timeline.js.map +1 -1
- package/dist/Timeline.vue.d.ts +32 -3
- package/dist/TimelineItem.js.map +1 -1
- package/dist/TimelineItem.vue.d.ts +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +30 -3
- package/dist/Toasts.js.map +1 -1
- package/dist/ToastsPlugin.js +11 -11
- package/dist/ToastsPlugin.js.map +1 -1
- package/dist/Tooltip.js +30 -29
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.vue.d.ts +43 -11
- package/dist/colors-DDDVvqfQ.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/directives/autofocus.js.map +1 -1
- package/dist/directives/clickoutside.js.map +1 -1
- package/dist/directives/observe.js.map +1 -1
- package/dist/directives/sticky.js.map +1 -1
- package/dist/directives/tooltip.js +3 -3
- package/dist/directives/tooltip.js.map +1 -1
- package/dist/directives/viewable.js +44 -39
- package/dist/directives/viewable.js.map +1 -1
- package/dist/{floating-ui.vue-CL01Y9ER.js → floating-ui.vue-pzUuloyX.js} +2 -2
- package/dist/{floating-ui.vue-CL01Y9ER.js.map → floating-ui.vue-pzUuloyX.js.map} +1 -1
- package/dist/formatDateTime-Dz8bXV0R.js +1418 -0
- package/dist/{formatDateTime-DG7kBc2T.js.map → formatDateTime-Dz8bXV0R.js.map} +1 -1
- package/dist/index-C14LhAwV.js +294 -0
- package/dist/{index-GUu9zvbg.js.map → index-C14LhAwV.js.map} +1 -1
- package/dist/index-D6bxWkZ1.js.map +1 -1
- package/dist/index.js +104 -99
- package/dist/index.js.map +1 -1
- package/dist/isDefined-DzVx0B6k.js.map +1 -1
- package/dist/keys-BEdEsanp.js.map +1 -1
- package/dist/keys-C8Zfr_By.js.map +1 -1
- package/dist/locale.js.map +1 -1
- package/dist/misc-CHQs-G03.js.map +1 -1
- package/dist/obfuscateText.d.ts +1 -1
- package/dist/parseISO-wlfIB_QJ.js.map +1 -1
- package/dist/searchFuzzy-DRasJ33G.js +409 -0
- package/dist/{searchFuzzy-DBDE6jkd.js.map → searchFuzzy-DRasJ33G.js.map} +1 -1
- package/dist/statusLevels-D8EgtE_L.js.map +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/tailwind-base.d.ts +18 -0
- package/dist/tailwind-base.js +18 -8
- package/dist/tailwind-base.js.map +1 -1
- package/dist/toTimeZone-Coq1oPTt.js.map +1 -1
- package/dist/useConfirmBeforeClosing.js.map +1 -1
- package/dist/useDialog.d.ts +2 -2
- package/dist/useDialog.js +25 -21
- package/dist/useDialog.js.map +1 -1
- package/dist/useGoogleMaps.js +110 -108
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/useMediaQuery.d.ts +6 -0
- package/dist/useMediaQuery.js +15 -11
- package/dist/useMediaQuery.js.map +1 -1
- package/dist/useModals.d.ts +1 -1
- package/dist/useModals.js.map +1 -1
- package/dist/usePaginationStats-d_q39naC.js.map +1 -1
- package/dist/usePlaidLink.js +27 -20
- package/dist/usePlaidLink.js.map +1 -1
- package/dist/useScriptTag.js.map +1 -1
- package/dist/useSearch.js +13 -13
- package/dist/useSearch.js.map +1 -1
- package/dist/useSelection.js +56 -56
- package/dist/useSelection.js.map +1 -1
- package/dist/useSortable.js +63 -54
- package/dist/useSortable.js.map +1 -1
- package/dist/useStepper.d.ts +2 -2
- package/dist/useStepper.js +40 -36
- package/dist/useStepper.js.map +1 -1
- package/dist/useToasts.js +23 -23
- package/dist/useToasts.js.map +1 -1
- package/dist/useValidation.js +100 -96
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/calculateElementOverflow.js +4 -4
- package/dist/utils/calculateElementOverflow.js.map +1 -1
- package/dist/utils/colorScheme.js.map +1 -1
- package/dist/utils/createQueryString.js.map +1 -1
- package/dist/utils/createValidDate.js.map +1 -1
- package/dist/utils/formatDateTime.js +1 -1
- package/dist/utils/getContrastingTextColor.js.map +1 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/normalizeDate.js.map +1 -1
- package/dist/utils/obfuscateText.js +6 -6
- package/dist/utils/obfuscateText.js.map +1 -1
- package/dist/utils/searchFuzzy.js +1 -1
- package/dist/utils/storage.js +23 -23
- package/dist/utils/storage.js.map +1 -1
- package/package.json +12 -12
- package/tailwind-base.ts +11 -0
- package/dist/Logo.vue_vue_type_script_setup_true_lang-Y3iE9utm.js.map +0 -1
- package/dist/MenusPlugin-B4jpNe7x.js +0 -12
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-Dprx064Y.js +0 -156
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-Dprx064Y.js.map +0 -1
- package/dist/formatDateTime-DG7kBc2T.js +0 -1414
- package/dist/index-GUu9zvbg.js +0 -128
- package/dist/searchFuzzy-DBDE6jkd.js +0 -408
package/dist/RadioNew.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as _, useCssModule as
|
|
2
|
-
import { R as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as _, useCssModule as $, inject as B, createElementBlock as h, openBlock as b, normalizeClass as d, unref as a, createElementVNode as n, toDisplayString as y, withDirectives as M, vShow as x, renderSlot as k, computed as c, createBlock as g, resolveDynamicComponent as N, withCtx as D } from "vue";
|
|
2
|
+
import { R as W } from "./RadioGroup.keys-CqfiKkNz.js";
|
|
3
|
+
import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const E = ["id", "name", "value", "checked", "disabled"], R = ["for"], T = /* @__PURE__ */ _({
|
|
5
5
|
__name: "VariantButton",
|
|
6
6
|
props: {
|
|
7
7
|
disabled: { type: Boolean },
|
|
@@ -13,42 +13,45 @@ const D = ["id", "name", "value", "checked", "disabled"], E = ["for"], R = /* @_
|
|
|
13
13
|
value: {}
|
|
14
14
|
},
|
|
15
15
|
emits: ["input"],
|
|
16
|
-
setup(
|
|
17
|
-
const e =
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
setup(s, { emit: u }) {
|
|
17
|
+
const e = s, l = $(), t = B(W.key), r = u;
|
|
18
|
+
return (o, i) => {
|
|
19
|
+
var m, v;
|
|
20
|
+
return b(), h("div", {
|
|
21
|
+
"data-variant-button": "",
|
|
22
|
+
class: d([
|
|
23
|
+
a(l).root,
|
|
24
|
+
{
|
|
25
|
+
"tw-w-full": e.fullWidth,
|
|
26
|
+
[a(l)["radio-group-vertical-orientation"]]: ((v = (m = a(t)) == null ? void 0 : m.orientation) == null ? void 0 : v.value) === "vertical"
|
|
27
|
+
}
|
|
28
|
+
])
|
|
29
|
+
}, [
|
|
30
|
+
n("input", {
|
|
31
|
+
id: `${e.name}-${e.id}`,
|
|
32
|
+
class: d(["tw-sr-only", a(l).input]),
|
|
33
|
+
type: "radio",
|
|
34
|
+
name: e.name,
|
|
35
|
+
value: e.value,
|
|
36
|
+
checked: e.modelValue === e.value,
|
|
37
|
+
disabled: e.disabled || e.disabled,
|
|
38
|
+
onInput: i[0] || (i[0] = (V) => r("input", V))
|
|
39
|
+
}, null, 42, E),
|
|
40
|
+
n("label", {
|
|
41
|
+
class: d(a(l).label),
|
|
42
|
+
for: `${e.name}-${e.id}`
|
|
43
|
+
}, y(e.label), 11, R)
|
|
44
|
+
], 2);
|
|
45
|
+
};
|
|
43
46
|
}
|
|
44
|
-
}),
|
|
45
|
-
label:
|
|
46
|
-
root:
|
|
47
|
+
}), q = "_label_6w0bq_2", O = "_root_6w0bq_14", S = "_input_6w0bq_36", z = {
|
|
48
|
+
label: q,
|
|
49
|
+
root: O,
|
|
47
50
|
"radio-group-vertical-orientation": "_radio-group-vertical-orientation_6w0bq_32",
|
|
48
|
-
input:
|
|
49
|
-
},
|
|
50
|
-
$style:
|
|
51
|
-
},
|
|
51
|
+
input: S
|
|
52
|
+
}, A = {
|
|
53
|
+
$style: z
|
|
54
|
+
}, F = /* @__PURE__ */ w(T, [["__cssModules", A]]), J = ["id", "name", "value", "checked", "disabled"], P = ["for"], U = /* @__PURE__ */ _({
|
|
52
55
|
__name: "VariantChip",
|
|
53
56
|
props: {
|
|
54
57
|
disabled: { type: Boolean },
|
|
@@ -60,33 +63,33 @@ const D = ["id", "name", "value", "checked", "disabled"], E = ["for"], R = /* @_
|
|
|
60
63
|
value: {}
|
|
61
64
|
},
|
|
62
65
|
emits: ["input"],
|
|
63
|
-
setup(
|
|
64
|
-
const e =
|
|
65
|
-
return (r,
|
|
66
|
-
class:
|
|
66
|
+
setup(s, { emit: u }) {
|
|
67
|
+
const e = s, l = $(), t = u;
|
|
68
|
+
return (r, o) => (b(), h("div", {
|
|
69
|
+
class: d([a(l).root, { "tw-w-full": e.fullWidth }])
|
|
67
70
|
}, [
|
|
68
71
|
n("input", {
|
|
69
72
|
id: `${e.name}-${e.id}`,
|
|
70
|
-
class:
|
|
73
|
+
class: d(["tw-sr-only", a(l).input]),
|
|
71
74
|
type: "radio",
|
|
72
75
|
name: e.name,
|
|
73
76
|
value: e.value,
|
|
74
77
|
checked: e.modelValue === e.value,
|
|
75
78
|
disabled: e.disabled || e.disabled,
|
|
76
|
-
onInput:
|
|
77
|
-
}, null, 42,
|
|
79
|
+
onInput: o[0] || (o[0] = (i) => t("input", i))
|
|
80
|
+
}, null, 42, J),
|
|
78
81
|
n("label", {
|
|
79
|
-
class:
|
|
82
|
+
class: d(a(l).label),
|
|
80
83
|
for: `${e.name}-${e.id}`
|
|
81
|
-
},
|
|
84
|
+
}, y(e.label), 11, P)
|
|
82
85
|
], 2));
|
|
83
86
|
}
|
|
84
|
-
}),
|
|
85
|
-
label:
|
|
86
|
-
input:
|
|
87
|
-
},
|
|
88
|
-
$style:
|
|
89
|
-
},
|
|
87
|
+
}), H = "_label_vdpts_2", K = "_input_vdpts_16", L = {
|
|
88
|
+
label: H,
|
|
89
|
+
input: K
|
|
90
|
+
}, Q = {
|
|
91
|
+
$style: L
|
|
92
|
+
}, X = /* @__PURE__ */ w(U, [["__cssModules", Q]]), Y = ["id", "name", "value", "checked", "disabled"], Z = ["for"], I = /* @__PURE__ */ _({
|
|
90
93
|
__name: "VariantRadio",
|
|
91
94
|
props: {
|
|
92
95
|
disabled: { type: Boolean },
|
|
@@ -98,35 +101,35 @@ const D = ["id", "name", "value", "checked", "disabled"], E = ["for"], R = /* @_
|
|
|
98
101
|
value: {}
|
|
99
102
|
},
|
|
100
103
|
emits: ["input"],
|
|
101
|
-
setup(
|
|
102
|
-
const e =
|
|
103
|
-
return (r,
|
|
104
|
-
class:
|
|
104
|
+
setup(s, { emit: u }) {
|
|
105
|
+
const e = s, l = $(), t = u;
|
|
106
|
+
return (r, o) => (b(), h("div", {
|
|
107
|
+
class: d(["tw-flex", [a(l).root, { "tw-w-full": e.fullWidth }]])
|
|
105
108
|
}, [
|
|
106
109
|
n("input", {
|
|
107
110
|
id: `${e.name}-${e.id}`,
|
|
108
|
-
class:
|
|
111
|
+
class: d(a(l).input),
|
|
109
112
|
type: "radio",
|
|
110
113
|
name: e.name,
|
|
111
114
|
value: e.value,
|
|
112
115
|
checked: e.modelValue === e.value,
|
|
113
116
|
disabled: e.disabled,
|
|
114
|
-
onInput:
|
|
115
|
-
}, null, 42,
|
|
117
|
+
onInput: o[0] || (o[0] = (i) => t("input", i))
|
|
118
|
+
}, null, 42, Y),
|
|
116
119
|
M(n("label", {
|
|
117
|
-
class:
|
|
120
|
+
class: d([a(l).label, { "tw-text-ice-500": e.disabled }]),
|
|
118
121
|
for: `${e.name}-${e.id}`
|
|
119
|
-
},
|
|
122
|
+
}, y(e.label), 11, Z), [
|
|
120
123
|
[x, e.label]
|
|
121
124
|
])
|
|
122
125
|
], 2));
|
|
123
126
|
}
|
|
124
|
-
}),
|
|
125
|
-
label:
|
|
126
|
-
input:
|
|
127
|
+
}), j = "_label_kw8hn_2", G = "_input_kw8hn_9", ee = {
|
|
128
|
+
label: j,
|
|
129
|
+
input: G
|
|
127
130
|
}, le = {
|
|
128
131
|
$style: ee
|
|
129
|
-
}, te = /* @__PURE__ */
|
|
132
|
+
}, te = /* @__PURE__ */ w(I, [["__cssModules", le]]), ae = ["for"], se = ["id", "aria-labelledby", "name", "value", "checked", "disabled"], de = ["id"], oe = /* @__PURE__ */ _({
|
|
130
133
|
__name: "VariantTile",
|
|
131
134
|
props: {
|
|
132
135
|
disabled: { type: Boolean },
|
|
@@ -138,14 +141,14 @@ const D = ["id", "name", "value", "checked", "disabled"], E = ["for"], R = /* @_
|
|
|
138
141
|
value: {}
|
|
139
142
|
},
|
|
140
143
|
emits: ["input"],
|
|
141
|
-
setup(
|
|
142
|
-
const e =
|
|
143
|
-
return (r,
|
|
144
|
-
class:
|
|
144
|
+
setup(s, { emit: u }) {
|
|
145
|
+
const e = s, l = $(), t = u;
|
|
146
|
+
return (r, o) => (b(), h("label", {
|
|
147
|
+
class: d([a(l).root, { "tw-w-full": e.fullWidth, [a(l)["root--disabled"]]: e.disabled }]),
|
|
145
148
|
for: `${e.name}-${e.id}`
|
|
146
149
|
}, [
|
|
147
150
|
n("div", {
|
|
148
|
-
class:
|
|
151
|
+
class: d(["tw-flex tw-border", [
|
|
149
152
|
a(l)["tile-header"],
|
|
150
153
|
{
|
|
151
154
|
"tw-border-blue-500 tw-bg-blue-100": e.modelValue === e.value && !e.disabled,
|
|
@@ -156,21 +159,21 @@ const D = ["id", "name", "value", "checked", "disabled"], E = ["for"], R = /* @_
|
|
|
156
159
|
n("input", {
|
|
157
160
|
id: `${e.name}-${e.id}`,
|
|
158
161
|
"aria-labelledby": `tile-label-${e.name}-${e.id}`,
|
|
159
|
-
class:
|
|
162
|
+
class: d(["tw-sr-only", a(l).input]),
|
|
160
163
|
type: "radio",
|
|
161
164
|
name: e.name,
|
|
162
165
|
value: e.value,
|
|
163
166
|
checked: e.modelValue === e.value,
|
|
164
167
|
disabled: e.disabled,
|
|
165
|
-
onInput:
|
|
166
|
-
}, null, 42,
|
|
168
|
+
onInput: o[0] || (o[0] = (i) => t("input", i))
|
|
169
|
+
}, null, 42, se),
|
|
167
170
|
n("div", {
|
|
168
171
|
id: `tile-label-${e.name}-${e.id}`,
|
|
169
|
-
class:
|
|
170
|
-
},
|
|
172
|
+
class: d([a(l).label, { "tw-text-ice-500": e.disabled }])
|
|
173
|
+
}, y(e.label), 11, de)
|
|
171
174
|
], 2),
|
|
172
175
|
n("div", {
|
|
173
|
-
class:
|
|
176
|
+
class: d([
|
|
174
177
|
a(l)["tile-body"],
|
|
175
178
|
{
|
|
176
179
|
"tw-border-ice-500": e.modelValue !== e.value || e.disabled,
|
|
@@ -178,12 +181,12 @@ const D = ["id", "name", "value", "checked", "disabled"], E = ["for"], R = /* @_
|
|
|
178
181
|
}
|
|
179
182
|
])
|
|
180
183
|
}, [
|
|
181
|
-
|
|
184
|
+
k(r.$slots, "default")
|
|
182
185
|
], 2)
|
|
183
186
|
], 10, ae));
|
|
184
187
|
}
|
|
185
|
-
}),
|
|
186
|
-
root:
|
|
188
|
+
}), ie = "_root_583pa_2", ne = "_label_583pa_32", ue = "_input_583pa_39", re = {
|
|
189
|
+
root: ie,
|
|
187
190
|
"root--disabled": "_root--disabled_583pa_11",
|
|
188
191
|
"tile-header": "_tile-header_583pa_15",
|
|
189
192
|
"tile-body": "_tile-body_583pa_16",
|
|
@@ -191,8 +194,8 @@ const D = ["id", "name", "value", "checked", "disabled"], E = ["for"], R = /* @_
|
|
|
191
194
|
input: ue
|
|
192
195
|
}, ce = {
|
|
193
196
|
$style: re
|
|
194
|
-
}, pe = /* @__PURE__ */
|
|
195
|
-
var p = /* @__PURE__ */ ((
|
|
197
|
+
}, pe = /* @__PURE__ */ w(oe, [["__cssModules", ce]]);
|
|
198
|
+
var p = /* @__PURE__ */ ((s) => (s.Radio = "radio", s.Button = "button", s.Chip = "chip", s.Tile = "tile", s))(p || {});
|
|
196
199
|
const fe = /* @__PURE__ */ _({
|
|
197
200
|
__name: "RadioNew",
|
|
198
201
|
props: {
|
|
@@ -207,33 +210,33 @@ const fe = /* @__PURE__ */ _({
|
|
|
207
210
|
value: {}
|
|
208
211
|
},
|
|
209
212
|
emits: ["update:modelValue"],
|
|
210
|
-
setup(
|
|
213
|
+
setup(s, { emit: u }) {
|
|
211
214
|
const e = {
|
|
212
|
-
[p.Button]:
|
|
213
|
-
[p.Chip]:
|
|
215
|
+
[p.Button]: F,
|
|
216
|
+
[p.Chip]: X,
|
|
214
217
|
[p.Radio]: te,
|
|
215
218
|
[p.Tile]: pe
|
|
216
|
-
}, l =
|
|
217
|
-
function C(
|
|
218
|
-
if (l
|
|
219
|
-
l.update(
|
|
219
|
+
}, l = B(W.key, null), t = s, r = c(() => t.modelValue || (l == null ? void 0 : l.modelValue.value)), o = c(() => t.name || (l == null ? void 0 : l.name.value)), i = c(() => t.fullWidth || (l == null ? void 0 : l.fullWidth.value)), m = c(() => t.disabled || (l == null ? void 0 : l.disabled.value)), v = c(() => t.variant || (l == null ? void 0 : l.variant.value) || "radio"), V = u;
|
|
220
|
+
function C(f) {
|
|
221
|
+
if (l != null && l.update) {
|
|
222
|
+
l.update(f);
|
|
220
223
|
return;
|
|
221
224
|
}
|
|
222
|
-
|
|
225
|
+
V("update:modelValue", f.target.value);
|
|
223
226
|
}
|
|
224
|
-
return (
|
|
227
|
+
return (f, _e) => (b(), g(N(e[v.value]), {
|
|
225
228
|
id: t.id,
|
|
226
|
-
disabled:
|
|
229
|
+
disabled: m.value,
|
|
227
230
|
"has-error": t.hasError,
|
|
228
|
-
"full-width":
|
|
231
|
+
"full-width": i.value,
|
|
229
232
|
label: t.label,
|
|
230
233
|
"model-value": r.value,
|
|
231
|
-
name:
|
|
234
|
+
name: o.value,
|
|
232
235
|
value: t.value,
|
|
233
236
|
onInput: C
|
|
234
237
|
}, {
|
|
235
|
-
default:
|
|
236
|
-
|
|
238
|
+
default: D(() => [
|
|
239
|
+
k(f.$slots, "default")
|
|
237
240
|
]),
|
|
238
241
|
_: 3
|
|
239
242
|
}, 40, ["id", "disabled", "has-error", "full-width", "label", "model-value", "name", "value"]));
|
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","_createElementBlock","_normalizeClass","_unref","_createElementVNode","_cache","$event","_toDisplayString","_hoisted_2","_vShow","_hoisted_3","_renderSlot","_ctx","RadioVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","derivedModelValue","computed","derivedName","derivedNameFullWidth","derivedDisabled","derivedVariant","onInput","e","_createBlock","_resolveDynamicComponent"],"mappings":"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"}
|
|
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,GACvBC,IAAsBC,EAAOC,EAAsB,GAAG,GAEtDC,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNb,UAAMR,IAAQC,GACRC,IAAUC,EAAa,GAEvBI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHb,UAAMR,IAAQC,GACRC,IAAUC,EAAa,GAEvBI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHb,UAAMR,IAAQC,GACRC,IAAUC,EAAa,GAEvBI,IAAOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5CH,IAAAC,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,IACvB,GAEMV,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,MAAA;AAGG,MAAAf,EAAA,qBAAsBe,EAAE,OAA4B,KAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;"}
|
package/dist/RadioNew.vue.d.ts
CHANGED
|
@@ -1,28 +1,69 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { DefineComponent } from 'vue';
|
|
4
|
+
import { ExtractPropTypes } from 'vue';
|
|
5
|
+
import { PropType } from 'vue';
|
|
4
6
|
import { PublicProps } from 'vue';
|
|
5
7
|
|
|
8
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
|
|
10
|
+
declare type __VLS_Prettify<T> = {
|
|
11
|
+
[K in keyof T]: T[K];
|
|
12
|
+
} & {};
|
|
13
|
+
|
|
14
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
24
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
25
|
+
default: D[K];
|
|
26
|
+
}> : P[K];
|
|
27
|
+
};
|
|
28
|
+
|
|
6
29
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
7
30
|
new (): {
|
|
8
31
|
$slots: S;
|
|
9
32
|
};
|
|
10
33
|
};
|
|
11
34
|
|
|
12
|
-
declare const _default: __VLS_WithTemplateSlots<DefineComponent<RadioProps
|
|
13
|
-
|
|
14
|
-
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<RadioProps>, {
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
fullWidth: boolean;
|
|
38
|
+
hasError: boolean;
|
|
39
|
+
id: undefined;
|
|
40
|
+
label: string;
|
|
41
|
+
modelValue: undefined;
|
|
42
|
+
name: undefined;
|
|
43
|
+
variant: undefined;
|
|
44
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
45
|
+
"update:modelValue": (value: string) => void;
|
|
46
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<RadioProps>, {
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
fullWidth: boolean;
|
|
49
|
+
hasError: boolean;
|
|
50
|
+
id: undefined;
|
|
51
|
+
label: string;
|
|
52
|
+
modelValue: undefined;
|
|
53
|
+
name: undefined;
|
|
54
|
+
variant: undefined;
|
|
55
|
+
}>>> & Readonly<{
|
|
15
56
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
16
57
|
}>, {
|
|
17
|
-
id: string | number;
|
|
18
58
|
name: string;
|
|
19
|
-
label: string;
|
|
20
59
|
disabled: boolean;
|
|
60
|
+
label: string;
|
|
61
|
+
id: string | number;
|
|
21
62
|
hasError: boolean;
|
|
22
63
|
modelValue: string;
|
|
23
|
-
variant: "
|
|
64
|
+
variant: "button" | "radio" | "tile" | "chip";
|
|
24
65
|
fullWidth: boolean;
|
|
25
|
-
}, {}, {}, {}, string, ComponentProvideOptions,
|
|
66
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
26
67
|
default?(_: {}): any;
|
|
27
68
|
}>;
|
|
28
69
|
export default _default;
|
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 tw-flex tw-gap-3\">\n <!-- @slot field for minimal value input -->\n <slot name=\"min\"></slot>\n\n <Icon name=\"transfer\" class=\"tw-mb-2 tw-mt-auto\" />\n <!-- @slot Field for maximal value input -->\n <slot name=\"max\"></slot>\n </div>\n</template>\n"],"names":["slots","useSlots"
|
|
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 tw-flex tw-gap-3\">\n <!-- @slot field for minimal value input -->\n <slot name=\"min\"></slot>\n\n <Icon name=\"transfer\" class=\"tw-mb-2 tw-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,EAAS;AAIvB,QAAI,EAFa,CAAC,CAACD,EAAM,OAAO,CAAC,CAACA,EAAM;AAGhC,YAAA,IAAI,MAAM,0DAA0D;;;;;;;;;;;"}
|
package/dist/RangeInput.vue.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
declare const _default: __VLS_WithTemplateSlots<DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {},
|
|
12
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
13
13
|
min?(_: {}): any;
|
|
14
14
|
max?(_: {}): any;
|
|
15
15
|
}>;
|