@propelinc/citrus-ui 0.6.0 → 1.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 +54 -60
- package/dist/colors/colors.d.ts +31 -0
- package/dist/colors/theme.d.ts +2 -11
- package/dist/colors/util-classes.d.ts +11 -0
- package/dist/components/CAccordion.vue.d.ts +21 -0
- package/dist/components/CAccordionItem.vue.d.ts +41 -0
- package/dist/components/CAppBar.vue.d.ts +156 -0
- package/dist/components/CBadge.vue.d.ts +52 -0
- package/dist/components/CBottomSheet.vue.d.ts +226 -0
- package/dist/components/CButton/CButton.vue.d.ts +231 -0
- package/dist/components/CButton/types.d.ts +5 -0
- package/dist/components/CButtonStack.vue.d.ts +24 -0
- package/dist/components/CCard.vue.d.ts +107 -0
- package/dist/components/CCardFooter.vue.d.ts +26 -0
- package/dist/components/CCardHeader.vue.d.ts +3 -0
- package/dist/components/CCardSection.vue.d.ts +17 -0
- package/dist/components/CCheckbox.vue.d.ts +145 -0
- package/dist/components/CCol.vue.d.ts +21 -0
- package/dist/components/CDivider.vue.d.ts +17 -0
- package/dist/components/CDobField.vue.d.ts +2109 -0
- package/dist/components/CDobSelect.vue.d.ts +398 -0
- package/dist/components/CEmailField.vue.d.ts +699 -0
- package/dist/components/CExpandTransition.vue.d.ts +19 -0
- package/dist/components/CFadeTransition.vue.d.ts +3 -0
- package/dist/components/CFileInput.vue.d.ts +98 -0
- package/dist/components/CFixedPageFooter.vue.d.ts +106 -0
- package/dist/components/CForm.vue.d.ts +29 -0
- package/dist/components/CFormFieldCounter.vue.d.ts +42 -0
- package/dist/components/CIconButton.vue.d.ts +390 -0
- package/dist/components/CLabel.vue.d.ts +32 -0
- package/dist/components/CListItem.vue.d.ts +208 -0
- package/dist/components/CListItemContent.vue.d.ts +27 -0
- package/dist/components/CListItemIcon.vue.d.ts +54 -0
- package/dist/components/CLoader.vue.d.ts +73 -0
- package/dist/components/CLogo.vue.d.ts +19 -0
- package/dist/components/CMaskedTextField.vue.d.ts +2012 -0
- package/dist/components/CMenu.vue.d.ts +6 -0
- package/dist/components/CMenuItem.vue.d.ts +170 -0
- package/dist/components/CMenuLabel.vue.d.ts +3 -0
- package/dist/components/CModal.vue.d.ts +206 -0
- package/dist/components/CModalLoading.vue.d.ts +230 -0
- package/dist/components/CNotification.vue.d.ts +589 -0
- package/dist/components/CPhoneField.vue.d.ts +2088 -0
- package/dist/components/CPill.vue.d.ts +42 -0
- package/dist/components/CPillGroup.vue.d.ts +70 -0
- package/dist/components/CPopup.vue.d.ts +21 -0
- package/dist/components/CProgressLinear.vue.d.ts +61 -0
- package/dist/components/CProgressRing.vue.d.ts +103 -0
- package/dist/components/CRadio.vue.d.ts +73 -0
- package/dist/components/CRadioGroup.vue.d.ts +123 -0
- package/dist/components/CRebrand.vue.d.ts +28 -0
- package/dist/components/CRow.vue.d.ts +67 -0
- package/dist/components/CSafeArea.vue.d.ts +18 -0
- package/dist/components/CSectionHeader.vue.d.ts +28 -0
- package/dist/components/CSelect.vue.d.ts +293 -0
- package/dist/components/CSkeleton.vue.d.ts +3 -0
- package/dist/components/CSkeletonLoaderCard.vue.d.ts +21 -0
- package/dist/components/CSkeletonLoaderCircle.vue.d.ts +5 -0
- package/dist/components/CSkeletonLoaderText.vue.d.ts +44 -0
- package/dist/components/CSlideFadeTransition.vue.d.ts +58 -0
- package/dist/components/CSplitInput.vue.d.ts +2131 -0
- package/dist/components/CSquaredIcon.vue.d.ts +47 -0
- package/dist/components/CSsnField.vue.d.ts +2083 -0
- package/dist/components/CStatusDot.vue.d.ts +27 -0
- package/dist/components/CSwitch.vue.d.ts +54 -0
- package/dist/components/CSwitchListItem.vue.d.ts +392 -0
- package/dist/components/CTextArea.vue.d.ts +240 -0
- package/dist/components/CTextField.vue.d.ts +647 -0
- package/dist/components/CTextLink.vue.d.ts +55 -0
- package/dist/components/CThirdPartyLogo.vue.d.ts +128 -0
- package/dist/components/CTimeago.vue.d.ts +12 -0
- package/dist/components/CToast.vue.d.ts +458 -0
- package/dist/components/CToastsList.vue.d.ts +430 -0
- package/dist/components/CValidationMessage.vue.d.ts +45 -0
- package/dist/components/CZipcodeField.vue.d.ts +2080 -0
- package/dist/components/index.d.ts +66 -25
- package/dist/components/internal/CCloseButton.vue.d.ts +14 -0
- package/dist/composables/accessibility.d.ts +1 -0
- package/dist/composables/animation.d.ts +12 -0
- package/dist/composables/binding.d.ts +19 -0
- package/dist/composables/colors.d.ts +13 -0
- package/dist/composables/elements.d.ts +3 -0
- package/dist/composables/fields.d.ts +9 -0
- package/dist/composables/gestures.d.ts +53 -0
- package/dist/composables/i18n.d.ts +3 -0
- package/dist/composables/id.d.ts +11 -0
- package/dist/composables/input-mask.d.ts +18 -0
- package/dist/composables/router.d.ts +30 -0
- package/dist/composables/slots.d.ts +2 -0
- package/dist/composables/toast.d.ts +21 -0
- package/dist/composables/validations.d.ts +77 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +11738 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/services/animation.d.ts +17 -0
- package/dist/services/directives/index.d.ts +2 -0
- package/dist/services/directives/scroll-into-view.d.ts +7 -0
- package/dist/services/directives/tap-animation.d.ts +6 -0
- package/dist/services/id.d.ts +22 -0
- package/dist/services/injections/accordions.d.ts +3 -0
- package/dist/services/injections/animations.d.ts +2 -0
- package/dist/services/injections/buttons.d.ts +4 -0
- package/dist/services/injections/forms.d.ts +6 -0
- package/dist/services/injections/icon-buttons.d.ts +3 -0
- package/dist/services/injections/pills.d.ts +4 -0
- package/dist/services/injections/radio.d.ts +10 -0
- package/dist/styles/main.css +3002 -0
- package/dist/styles/utils.css +2319 -0
- package/dist/theme/icons.d.ts +35 -2
- package/dist/types/CForm.d.ts +12 -0
- package/dist/types/font-awesome.d.ts +5 -0
- package/dist/types.d.ts +12 -0
- package/index.ts +2 -0
- package/package.json +60 -45
- package/src/assets/fonts/grenette-regular.woff2 +0 -0
- package/src/assets/fonts/grenette-semibold.woff2 +0 -0
- package/src/assets/fonts/polymath.woff2 +0 -0
- package/src/assets/logos/propel/icon.svg +15 -0
- package/src/assets/logos/propel/lockup.svg +11 -0
- package/src/colors/colors.ts +173 -0
- package/src/colors/theme.ts +8 -14
- package/src/colors/util-classes.ts +49 -0
- package/src/componentResolver.js +33 -0
- package/src/components/CAccordion.vue +32 -7
- package/src/components/CAccordionItem.vue +109 -36
- package/src/components/CAppBar.vue +237 -0
- package/src/components/CBadge.vue +74 -0
- package/src/components/CBottomSheet.vue +430 -0
- package/src/components/CButton/CButton.vue +347 -0
- package/src/components/CButton/types.ts +5 -0
- package/src/components/CButtonStack.vue +36 -0
- package/src/components/CCard.vue +149 -41
- package/src/components/CCardFooter.vue +11 -27
- package/src/components/CCardHeader.vue +30 -21
- package/src/components/CCardSection.vue +23 -12
- package/src/components/CCheckbox.vue +191 -21
- package/src/components/CCol.vue +55 -0
- package/src/components/CDivider.vue +46 -0
- package/src/components/CDobField.vue +153 -0
- package/src/components/CDobSelect.vue +274 -0
- package/src/components/CEmailField.vue +61 -0
- package/src/components/CExpandTransition.vue +55 -0
- package/src/components/CFadeTransition.vue +23 -0
- package/src/components/CFileInput.vue +186 -0
- package/src/components/CFixedPageFooter.vue +76 -0
- package/src/components/CForm.vue +86 -0
- package/src/components/CFormFieldCounter.vue +40 -0
- package/src/components/CIconButton.vue +175 -59
- package/src/components/CLabel.vue +52 -0
- package/src/components/CListItem.vue +149 -45
- package/src/components/CListItemContent.vue +60 -0
- package/src/components/CListItemIcon.vue +27 -31
- package/src/components/CLoader.vue +156 -0
- package/src/components/CLogo.vue +23 -0
- package/src/components/CMaskedTextField.vue +118 -0
- package/src/components/CMenu.vue +24 -0
- package/src/components/CMenuItem.vue +106 -0
- package/src/components/CMenuLabel.vue +26 -0
- package/src/components/CModal.vue +198 -79
- package/src/components/CModalLoading.vue +27 -9
- package/src/components/CNotification.vue +86 -53
- package/src/components/CPhoneField.vue +69 -0
- package/src/components/CPill.vue +162 -0
- package/src/components/CPillGroup.vue +73 -0
- package/src/components/CPopup.vue +66 -0
- package/src/components/CProgressLinear.vue +52 -0
- package/src/components/CProgressRing.vue +126 -0
- package/src/components/CRadio.vue +138 -0
- package/src/components/CRadioGroup.vue +142 -0
- package/src/components/CRebrand.vue +28 -0
- package/src/components/CRow.vue +62 -0
- package/src/components/CSafeArea.vue +23 -0
- package/src/components/CSectionHeader.vue +50 -0
- package/src/components/CSelect.vue +223 -74
- package/src/components/CSkeleton.vue +65 -0
- package/src/components/CSkeletonLoaderCard.vue +29 -0
- package/src/components/CSkeletonLoaderCircle.vue +18 -14
- package/src/components/CSkeletonLoaderText.vue +127 -17
- package/src/components/CSlideFadeTransition.vue +100 -0
- package/src/components/CSplitInput.vue +111 -0
- package/src/components/CSquaredIcon.vue +83 -0
- package/src/components/CSsnField.vue +86 -0
- package/src/components/CStatusDot.vue +70 -0
- package/src/components/CSwitch.vue +125 -0
- package/src/components/CSwitchListItem.vue +110 -0
- package/src/components/CTextArea.vue +193 -47
- package/src/components/CTextField.vue +450 -93
- package/src/components/CTextLink.vue +48 -38
- package/src/components/CThirdPartyLogo.vue +127 -0
- package/src/components/CTimeago.vue +63 -0
- package/src/components/CToast.vue +259 -0
- package/src/components/CToastsList.vue +32 -0
- package/src/components/CValidationMessage.vue +70 -0
- package/src/components/CZipcodeField.vue +69 -0
- package/src/components/index.ts +66 -25
- package/src/components/internal/CCloseButton.vue +57 -0
- package/src/composables/accessibility.ts +29 -0
- package/src/composables/animation.ts +95 -0
- package/src/composables/binding.ts +34 -0
- package/src/composables/colors.ts +59 -0
- package/src/composables/elements.ts +72 -0
- package/src/composables/fields.ts +19 -0
- package/src/composables/gestures.ts +197 -0
- package/src/composables/i18n.ts +13 -0
- package/src/composables/id.ts +23 -0
- package/src/composables/input-mask.ts +139 -0
- package/src/composables/router.ts +64 -0
- package/src/composables/slots.ts +57 -0
- package/src/composables/toast.ts +64 -0
- package/src/composables/validations.ts +214 -0
- package/src/index.ts +7 -7
- package/src/plugin.ts +13 -6
- package/src/services/animation.ts +101 -0
- package/src/services/directives/index.ts +2 -0
- package/src/services/directives/scroll-into-view.ts +86 -0
- package/src/services/directives/tap-animation.ts +71 -0
- package/src/services/id.ts +31 -0
- package/src/services/injections/accordions.ts +4 -0
- package/src/services/injections/animations.ts +3 -0
- package/src/services/injections/buttons.ts +5 -0
- package/src/services/injections/forms.ts +8 -0
- package/src/services/injections/icon-buttons.ts +4 -0
- package/src/services/injections/pills.ts +7 -0
- package/src/services/injections/radio.ts +12 -0
- package/src/shims-vue.d.ts +6 -3
- package/src/styles/_animation.scss +19 -0
- package/src/styles/_button.scss +61 -0
- package/src/styles/_colors.scss +58 -11
- package/src/styles/_core.scss +248 -87
- package/src/styles/_form-fields.scss +68 -15
- package/src/styles/_grenette.scss +13 -0
- package/src/styles/_polymath.scss +14 -0
- package/src/styles/_reset.scss +105 -0
- package/src/styles/_shoelace.scss +46 -0
- package/src/styles/_typography.scss +40 -10
- package/src/styles/main.scss +6 -3
- package/src/styles/utils/a11y.scss +18 -0
- package/src/styles/utils/typography.scss +13 -0
- package/src/styles/utils.scss +560 -0
- package/src/styles/variables.scss +27 -15
- package/src/theme/icons.ts +16 -5
- package/src/types/CForm.ts +15 -0
- package/src/types/font-awesome.ts +6 -0
- package/src/types.ts +15 -0
- package/.browserslistrc +0 -3
- package/.eslintrc.js +0 -4
- package/.stylelintrc.js +0 -3
- package/babel.config.js +0 -3
- package/dist/citrus-ui.common.js +0 -43434
- package/dist/citrus-ui.common.js.map +0 -1
- package/dist/citrus-ui.css +0 -1
- package/dist/citrus-ui.umd.js +0 -43444
- package/dist/citrus-ui.umd.js.map +0 -1
- package/dist/citrus-ui.umd.min.js +0 -27
- package/dist/citrus-ui.umd.min.js.map +0 -1
- package/dist/demo.html +0 -10
- package/dist/fonts/Blitz-Script.85ed9abe.woff2 +0 -0
- package/dist/fonts/ObjectSans-Bold.5492f3d5.woff2 +0 -0
- package/dist/fonts/ObjectSans-BoldSlanted.29e2a87e.woff2 +0 -0
- package/dist/fonts/ObjectSans-Heavy.d0b2f035.woff2 +0 -0
- package/dist/fonts/ObjectSans-HeavySlanted.45e9c063.woff2 +0 -0
- package/dist/fonts/ObjectSans-Light.f885dec3.woff2 +0 -0
- package/dist/fonts/ObjectSans-LightSlanted.b8eb7c12.woff2 +0 -0
- package/dist/fonts/ObjectSans-Regular.e4ea0b90.woff2 +0 -0
- package/dist/fonts/ObjectSans-Slanted.57a90be9.woff2 +0 -0
- package/dist/fonts/ObjectSans-Thin.86d44227.woff2 +0 -0
- package/dist/fonts/ObjectSans-ThinSlanted.20342160.woff2 +0 -0
- package/jest.config.js +0 -9
- package/plopfile.js +0 -67
- package/project.json +0 -69
- package/src/assets/fonts/Blitz-Script.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Bold.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-BoldSlanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Heavy.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-HeavySlanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Light.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-LightSlanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Regular.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Slanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Thin.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-ThinSlanted.woff2 +0 -0
- package/src/components/CAlert.vue +0 -78
- package/src/components/CBanner.vue +0 -47
- package/src/components/CButton.vue +0 -146
- package/src/components/CListItemAction.vue +0 -29
- package/src/components/CSegmentedButton.vue +0 -47
- package/src/components/CSegmentedButtonOption.vue +0 -42
- package/src/components/helpers/FormField.vue +0 -48
- package/src/components/helpers/SelectInput.vue +0 -115
- package/src/shims-scss.d.ts +0 -4
- package/src/shims-vuetify.d.ts +0 -4
- package/src/styles/_blitz.scss +0 -8
- package/src/styles/_object-sans.scss +0 -23
- package/storybook-static/0.799c368cbe88266827ba.manager.bundle.js +0 -1
- package/storybook-static/0.a9f0a9ad.iframe.bundle.js +0 -3
- package/storybook-static/0.a9f0a9ad.iframe.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/0.a9f0a9ad.iframe.bundle.js.map +0 -1
- package/storybook-static/1.0438fd8d.iframe.bundle.js +0 -3
- package/storybook-static/1.0438fd8d.iframe.bundle.js.LICENSE.txt +0 -17
- package/storybook-static/1.0438fd8d.iframe.bundle.js.map +0 -1
- package/storybook-static/1.9ebd2fb519f6726108de.manager.bundle.js +0 -1
- package/storybook-static/10.348d8814.iframe.bundle.js +0 -3
- package/storybook-static/10.348d8814.iframe.bundle.js.LICENSE.txt +0 -30
- package/storybook-static/10.348d8814.iframe.bundle.js.map +0 -1
- package/storybook-static/10.a85ea1a67689be8e19ff.manager.bundle.js +0 -1
- package/storybook-static/11.f4e922583ae35da460f3.manager.bundle.js +0 -2
- package/storybook-static/11.f4e922583ae35da460f3.manager.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/12.1415460941f0bdcb8fa8.manager.bundle.js +0 -1
- package/storybook-static/2.75a17459.iframe.bundle.js +0 -3
- package/storybook-static/2.75a17459.iframe.bundle.js.LICENSE.txt +0 -26
- package/storybook-static/2.75a17459.iframe.bundle.js.map +0 -1
- package/storybook-static/5.f459d151315e6780c20f.manager.bundle.js +0 -2
- package/storybook-static/5.f459d151315e6780c20f.manager.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/6.3bd64d820f3745f262ff.manager.bundle.js +0 -1
- package/storybook-static/6.ce8d99b4.iframe.bundle.js +0 -1
- package/storybook-static/7.3d04765dbf3f1dcd706c.manager.bundle.js +0 -1
- package/storybook-static/7.6633a922.iframe.bundle.js +0 -3
- package/storybook-static/7.6633a922.iframe.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/7.6633a922.iframe.bundle.js.map +0 -1
- package/storybook-static/8.b541eadfcb9164835dfc.manager.bundle.js +0 -1
- package/storybook-static/8.fc5e1ebf.iframe.bundle.js +0 -1
- package/storybook-static/9.411ac8e451bbb10926c7.manager.bundle.js +0 -1
- package/storybook-static/9.724ac3ed.iframe.bundle.js +0 -3
- package/storybook-static/9.724ac3ed.iframe.bundle.js.LICENSE.txt +0 -15
- package/storybook-static/9.724ac3ed.iframe.bundle.js.map +0 -1
- package/storybook-static/css/main.95216119.css +0 -1
- package/storybook-static/css/vendors~main.02dc89bf.css +0 -1
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/fonts/Blitz-Script.85ed9abe.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Bold.5492f3d5.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-BoldSlanted.29e2a87e.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Heavy.d0b2f035.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-HeavySlanted.45e9c063.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Light.f885dec3.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-LightSlanted.b8eb7c12.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Regular.e4ea0b90.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Slanted.57a90be9.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Thin.86d44227.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-ThinSlanted.20342160.woff2 +0 -0
- package/storybook-static/iframe.html +0 -348
- package/storybook-static/index.html +0 -51
- package/storybook-static/main.7b4aec9c4352d4bb535b.manager.bundle.js +0 -1
- package/storybook-static/main.9e8c64c7.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.91a0c7330ab317d35c4a.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.e4da100f.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.6660eda6.iframe.bundle.js +0 -7
- package/storybook-static/vendors~main.6660eda6.iframe.bundle.js.LICENSE.txt +0 -80
- package/storybook-static/vendors~main.6660eda6.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.f7f16cebbf3aa96a4f89.manager.bundle.js +0 -2
- package/storybook-static/vendors~main.f7f16cebbf3aa96a4f89.manager.bundle.js.LICENSE.txt +0 -110
- package/tsconfig.dist.json +0 -7
- package/tsconfig.json +0 -24
- package/vue.config.js +0 -5
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
:aria-checked="ariaChecked"
|
|
5
|
+
:class="{ 'c-pill--active': isSelected }"
|
|
6
|
+
class="c-pill"
|
|
7
|
+
data-test="pill"
|
|
8
|
+
:role="role"
|
|
9
|
+
@click="onClick"
|
|
10
|
+
>
|
|
11
|
+
<span class="c-pill-body" data-test="pill-body">
|
|
12
|
+
<span v-if="icon || $slots.icon" class="c-pill-icon">
|
|
13
|
+
<slot name="icon">
|
|
14
|
+
<FontAwesomeIcon v-if="icon" data-test="pill-icon" fixed-width :icon="icon" />
|
|
15
|
+
</slot>
|
|
16
|
+
</span>
|
|
17
|
+
|
|
18
|
+
<span class="c-pill-text">
|
|
19
|
+
<slot />
|
|
20
|
+
</span>
|
|
21
|
+
</span>
|
|
22
|
+
</span>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
27
|
+
import type { PropType } from 'vue';
|
|
28
|
+
import { computed, defineComponent, inject } from 'vue';
|
|
29
|
+
|
|
30
|
+
import {
|
|
31
|
+
ROLE,
|
|
32
|
+
SELECTED_VALUE,
|
|
33
|
+
TOGGLE_VALUE,
|
|
34
|
+
} from '@propelinc/citrus-ui/src/services/injections/pills';
|
|
35
|
+
import type { FaPropType } from '@propelinc/citrus-ui/src/types/font-awesome';
|
|
36
|
+
|
|
37
|
+
type ToggleVariant = 'standalone' | 'group' | 'none';
|
|
38
|
+
|
|
39
|
+
export default defineComponent({
|
|
40
|
+
components: { FontAwesomeIcon },
|
|
41
|
+
props: {
|
|
42
|
+
/** By default, this is a boolean that determines if the pill is selected or
|
|
43
|
+
not. If in a pill group, this is a string that identifies this pill. */
|
|
44
|
+
value: {
|
|
45
|
+
type: [Boolean, String] as PropType<boolean | string | undefined>,
|
|
46
|
+
default: undefined,
|
|
47
|
+
},
|
|
48
|
+
/** The icon to display. */
|
|
49
|
+
icon: { type: [String, Array, Object] as FaPropType, default: undefined },
|
|
50
|
+
},
|
|
51
|
+
emits: ['click', 'input'],
|
|
52
|
+
setup(props, { emit }) {
|
|
53
|
+
const injectedRole = inject(ROLE, undefined);
|
|
54
|
+
const injectedSelectedValue = inject(SELECTED_VALUE, undefined);
|
|
55
|
+
const toggleValue = inject(TOGGLE_VALUE, undefined);
|
|
56
|
+
|
|
57
|
+
const toggleVariant = computed<ToggleVariant>(() => {
|
|
58
|
+
if (toggleValue) {
|
|
59
|
+
return 'group';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (props.value !== undefined) {
|
|
63
|
+
return 'standalone';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return 'none';
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const isSelected = computed(() => {
|
|
70
|
+
if (toggleVariant.value === 'standalone') {
|
|
71
|
+
// @ts-expect-error - "Expression produces a union type that is too complex to represent" error
|
|
72
|
+
// unclear why this is occurring, ignoring for now
|
|
73
|
+
return props.value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (injectedSelectedValue?.value) {
|
|
77
|
+
return injectedSelectedValue.value === props.value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return undefined;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const ariaChecked = computed((): 'true' | 'false' | undefined => {
|
|
84
|
+
if (isSelected.value === undefined) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return isSelected.value ? 'true' : 'false';
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const role = computed(() => {
|
|
92
|
+
if (toggleVariant.value === 'standalone') {
|
|
93
|
+
return 'radio';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (toggleVariant.value === 'group') {
|
|
97
|
+
return injectedRole?.value ?? undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return undefined;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const onClick = (): void => {
|
|
104
|
+
if (toggleVariant.value === 'standalone') {
|
|
105
|
+
emit('input', !props.value);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (toggleVariant.value === 'group' && toggleValue) {
|
|
109
|
+
const nextValue = isSelected.value ? undefined : (props.value as string);
|
|
110
|
+
toggleValue(nextValue);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
emit('click');
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
ariaChecked,
|
|
118
|
+
isSelected,
|
|
119
|
+
onClick,
|
|
120
|
+
role,
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<style lang="scss" scoped>
|
|
127
|
+
@import '@propelinc/citrus-ui/src/styles/core';
|
|
128
|
+
|
|
129
|
+
.c-pill {
|
|
130
|
+
background-color: $color-white;
|
|
131
|
+
border: $border-width solid $color-border;
|
|
132
|
+
border-radius: $border-radius-next;
|
|
133
|
+
color: $color-text-primary;
|
|
134
|
+
display: inline-block;
|
|
135
|
+
font-family: $font-family-polymath;
|
|
136
|
+
height: $button-size-medium;
|
|
137
|
+
padding-inline: 12px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.c-pill--active {
|
|
141
|
+
background-color: $color-black;
|
|
142
|
+
border-color: $color-black;
|
|
143
|
+
color: $color-white;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.c-pill-body {
|
|
147
|
+
align-items: center;
|
|
148
|
+
display: flex;
|
|
149
|
+
gap: 8px;
|
|
150
|
+
height: 100%;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Improves icon alignment
|
|
154
|
+
*/
|
|
155
|
+
line-height: 1;
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.c-pill-icon {
|
|
160
|
+
width: 16px;
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-pill-group" data-test="pill-group">
|
|
3
|
+
<fieldset class="c-pill-group__track">
|
|
4
|
+
<slot>
|
|
5
|
+
<CPill
|
|
6
|
+
v-for="option in options"
|
|
7
|
+
:key="option.value"
|
|
8
|
+
:value="option.value"
|
|
9
|
+
:icon="option.icon"
|
|
10
|
+
>
|
|
11
|
+
{{ option.label }}
|
|
12
|
+
</CPill>
|
|
13
|
+
</slot>
|
|
14
|
+
</fieldset>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import type { PropType } from 'vue';
|
|
20
|
+
import { computed, defineComponent, provide, ref } from 'vue';
|
|
21
|
+
|
|
22
|
+
import CPill from '@propelinc/citrus-ui/src/components/CPill.vue';
|
|
23
|
+
import {
|
|
24
|
+
ROLE,
|
|
25
|
+
SELECTED_VALUE,
|
|
26
|
+
TOGGLE_VALUE,
|
|
27
|
+
} from '@propelinc/citrus-ui/src/services/injections/pills';
|
|
28
|
+
import type { FaIcon } from '@propelinc/citrus-ui/src/types/font-awesome';
|
|
29
|
+
|
|
30
|
+
interface PillConfig {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
icon?: FaIcon;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default defineComponent({
|
|
37
|
+
components: { CPill },
|
|
38
|
+
props: {
|
|
39
|
+
/** Specifies which pill is selected. */
|
|
40
|
+
value: { type: String as PropType<string>, default: () => '' },
|
|
41
|
+
/** A list of pills to display. This is overwritten by the default slot. */
|
|
42
|
+
options: { type: Array as PropType<PillConfig[]>, default: () => [] },
|
|
43
|
+
},
|
|
44
|
+
emits: ['input'],
|
|
45
|
+
setup(props, { emit }) {
|
|
46
|
+
provide(ROLE, ref('radio'));
|
|
47
|
+
provide(
|
|
48
|
+
SELECTED_VALUE,
|
|
49
|
+
computed(() => props.value)
|
|
50
|
+
);
|
|
51
|
+
provide(TOGGLE_VALUE, (value) => {
|
|
52
|
+
emit('input', value);
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style lang="scss" scoped>
|
|
59
|
+
@import '@propelinc/citrus-ui/src/styles/core';
|
|
60
|
+
|
|
61
|
+
.c-pill-group {
|
|
62
|
+
overflow: scroll hidden;
|
|
63
|
+
padding: 0 16px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.c-pill-group__track {
|
|
67
|
+
border: none;
|
|
68
|
+
display: block;
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-wrap: nowrap;
|
|
71
|
+
gap: 8px;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-popup ref="popup" :active="value" distance="8" class="c-popup">
|
|
3
|
+
<span slot="anchor" class="anchor">
|
|
4
|
+
<slot />
|
|
5
|
+
</span>
|
|
6
|
+
<slot name="content" />
|
|
7
|
+
</sl-popup>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { type SlPopup } from '@shoelace-style/shoelace';
|
|
12
|
+
import '@shoelace-style/shoelace/dist/components/popup/popup.js';
|
|
13
|
+
import { defineComponent, onMounted, onUnmounted, ref, watchEffect } from 'vue';
|
|
14
|
+
|
|
15
|
+
export default defineComponent({
|
|
16
|
+
name: 'CPopup',
|
|
17
|
+
props: {
|
|
18
|
+
value: { type: Boolean, default: false },
|
|
19
|
+
},
|
|
20
|
+
emits: ['mouseleave', 'outside-click'],
|
|
21
|
+
setup(props, { emit }) {
|
|
22
|
+
const popup = ref<SlPopup | null>(null);
|
|
23
|
+
|
|
24
|
+
const handleMouseLeave = (): void => {
|
|
25
|
+
if (props.value) {
|
|
26
|
+
emit('mouseleave');
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const handleOutsideClick = ({ target }: MouseEvent): void => {
|
|
31
|
+
if (target instanceof HTMLElement && !popup.value?.contains(target)) {
|
|
32
|
+
emit('outside-click');
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
watchEffect(async () => {
|
|
37
|
+
if (props.value) {
|
|
38
|
+
document.addEventListener('click', handleOutsideClick);
|
|
39
|
+
} else {
|
|
40
|
+
document.removeEventListener('click', handleOutsideClick);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
popup.value?.addEventListener('mouseleave', handleMouseLeave);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
onUnmounted(() => {
|
|
49
|
+
document.removeEventListener('click', handleOutsideClick);
|
|
50
|
+
popup.value?.removeEventListener('mouseleave', handleMouseLeave);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return { popup };
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped>
|
|
59
|
+
.c-popup::part(popup) {
|
|
60
|
+
z-index: 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.anchor {
|
|
64
|
+
height: fit-content;
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sl-progress-bar
|
|
3
|
+
class="c-progress-linear"
|
|
4
|
+
:class="{ 'c-progress-linear--rounded': rounded }"
|
|
5
|
+
:data-test="dataTest"
|
|
6
|
+
:value="value"
|
|
7
|
+
:indeterminate="indeterminate || undefined"
|
|
8
|
+
:label="accessibleText || $t('Loading...')"
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { defineComponent } from 'vue';
|
|
14
|
+
import '@shoelace-style/shoelace/dist/components/progress-bar/progress-bar.js';
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
props: {
|
|
18
|
+
/** Customizes screen reader only text alternative, should be translated */
|
|
19
|
+
accessibleText: { type: String, default: undefined },
|
|
20
|
+
/** Selector for testing */
|
|
21
|
+
dataTest: { type: String, default: 'c-progress-linear' },
|
|
22
|
+
/** Renders an indefinite loading state */
|
|
23
|
+
indeterminate: { type: Boolean, default: false },
|
|
24
|
+
/** Rounds the progress bar */
|
|
25
|
+
rounded: { type: Boolean, default: true },
|
|
26
|
+
/** The current progress from 0 to 100 */
|
|
27
|
+
value: { type: [Number, String], default: 0 },
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss" scoped>
|
|
33
|
+
@import '@propelinc/citrus-ui/src/styles/core';
|
|
34
|
+
|
|
35
|
+
$progress-linear-height: 4px;
|
|
36
|
+
|
|
37
|
+
.c-progress-linear {
|
|
38
|
+
--height: #{$progress-linear-height};
|
|
39
|
+
--indicator-color: #{$color-black};
|
|
40
|
+
--track-color: #{$color-gray-200};
|
|
41
|
+
|
|
42
|
+
&::part(base) {
|
|
43
|
+
border-radius: 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.c-progress-linear--rounded {
|
|
48
|
+
&::part(base) {
|
|
49
|
+
border-radius: calc(#{$progress-linear-height} / 2);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
class="c-progress-ring"
|
|
4
|
+
:data-test="dataTest"
|
|
5
|
+
:aria-label="accessibleText || $t('Loading...')"
|
|
6
|
+
role="progressbar"
|
|
7
|
+
aria-valuemin="0"
|
|
8
|
+
:aria-valuemax="String(valueMax)"
|
|
9
|
+
:aria-valuenow="String(value)"
|
|
10
|
+
:style="{
|
|
11
|
+
'--size': `${size}px`,
|
|
12
|
+
'--indicator-color': cssColor,
|
|
13
|
+
'--track-color': trackCssColor,
|
|
14
|
+
'--track-width': `${trackWidth}px`,
|
|
15
|
+
'--indicator-length': `${percentage}`,
|
|
16
|
+
}"
|
|
17
|
+
>
|
|
18
|
+
<svg class="c-progress-ring__svg">
|
|
19
|
+
<circle class="c-progress-ring__track" />
|
|
20
|
+
<circle class="c-progress-ring__indicator" pathLength="100" />
|
|
21
|
+
</svg>
|
|
22
|
+
<span class="c-progress-ring__label">
|
|
23
|
+
<slot />
|
|
24
|
+
</span>
|
|
25
|
+
</span>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { type PropType, computed, defineComponent } from 'vue';
|
|
30
|
+
|
|
31
|
+
import type Colors from '@propelinc/citrus-ui/src/colors/colors';
|
|
32
|
+
import { type HexColor, isValidColor } from '@propelinc/citrus-ui/src/colors/colors';
|
|
33
|
+
import { useCssColor } from '@propelinc/citrus-ui/src/composables/colors';
|
|
34
|
+
|
|
35
|
+
export default defineComponent({
|
|
36
|
+
props: {
|
|
37
|
+
/** Customizes screen reader only text alternative, should be translated */
|
|
38
|
+
accessibleText: { type: String, default: undefined },
|
|
39
|
+
/** Selector for testing */
|
|
40
|
+
dataTest: { type: String, default: 'c-progress-ring' },
|
|
41
|
+
/** The current progress, from 0 to valueMax */
|
|
42
|
+
value: { type: [Number, String], default: 0 },
|
|
43
|
+
/** Total progress */
|
|
44
|
+
valueMax: { type: [Number, String], default: 100 },
|
|
45
|
+
/** The outer diameter of the progress ring, in px */
|
|
46
|
+
size: { type: [Number, String], default: 44 },
|
|
47
|
+
/** The width of the progress ring, in px */
|
|
48
|
+
trackWidth: { type: [Number, String], default: 4 },
|
|
49
|
+
/** Sets the indicator color */
|
|
50
|
+
color: {
|
|
51
|
+
type: String as PropType<HexColor | keyof typeof Colors>,
|
|
52
|
+
default: 'blue-500',
|
|
53
|
+
validator: isValidColor,
|
|
54
|
+
},
|
|
55
|
+
/** Sets the track color underneath the indicator */
|
|
56
|
+
trackColor: {
|
|
57
|
+
type: String as PropType<HexColor | keyof typeof Colors>,
|
|
58
|
+
default: 'gray-200',
|
|
59
|
+
validator: isValidColor,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
setup(props) {
|
|
63
|
+
const { cssColor } = useCssColor(() => props.color);
|
|
64
|
+
const { cssColor: trackCssColor } = useCssColor(() => props.trackColor);
|
|
65
|
+
|
|
66
|
+
const percentage = computed(() => (100 * Number(props.value)) / Number(props.valueMax));
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
percentage,
|
|
70
|
+
cssColor,
|
|
71
|
+
trackCssColor,
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style lang="scss" scoped>
|
|
78
|
+
@import '@propelinc/citrus-ui/src/styles/core';
|
|
79
|
+
|
|
80
|
+
.c-progress-ring {
|
|
81
|
+
align-items: center;
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
font-size: var(--size);
|
|
85
|
+
height: 1em;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
position: relative;
|
|
88
|
+
width: 1em;
|
|
89
|
+
|
|
90
|
+
&__label {
|
|
91
|
+
color: var(--indicator-color);
|
|
92
|
+
font-size: $font-size-small;
|
|
93
|
+
font-weight: $font-weight-bold;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&__svg {
|
|
97
|
+
height: 100%;
|
|
98
|
+
position: absolute;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__indicator,
|
|
103
|
+
&__track {
|
|
104
|
+
cx: 0.5em;
|
|
105
|
+
cy: 0.5em;
|
|
106
|
+
fill: none;
|
|
107
|
+
r: calc(0.5em - var(--track-width) / 2);
|
|
108
|
+
stroke-width: var(--track-width);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&__indicator {
|
|
112
|
+
stroke: var(--indicator-color);
|
|
113
|
+
|
|
114
|
+
/* The empty gap equal to the path length 100 to make the rest of the circle empty. */
|
|
115
|
+
stroke-dasharray: var(--indicator-length) 100;
|
|
116
|
+
stroke-linecap: round;
|
|
117
|
+
transform: rotate(-90deg);
|
|
118
|
+
transform-origin: 50% 50%;
|
|
119
|
+
transition: stroke-dasharray 0.2s;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&__track {
|
|
123
|
+
stroke: var(--track-color);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label
|
|
3
|
+
:id="idWithFallback"
|
|
4
|
+
:for="`${idWithFallback}-input`"
|
|
5
|
+
:data-test="dataTest"
|
|
6
|
+
:data-selected="parentState.value === value || undefined"
|
|
7
|
+
class="c-radio"
|
|
8
|
+
:class="{
|
|
9
|
+
'c-radio--invalid': parentState.invalid,
|
|
10
|
+
'c-radio--checked': parentState.value === value,
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<input
|
|
14
|
+
:id="`${idWithFallback}-input`"
|
|
15
|
+
type="radio"
|
|
16
|
+
:data-test="`${dataTest}-input`"
|
|
17
|
+
class="c-radio__input"
|
|
18
|
+
:class="{ 'sr-only': hideRadio }"
|
|
19
|
+
:name="parentState.name"
|
|
20
|
+
:value="value"
|
|
21
|
+
:checked="parentState.value === value || undefined"
|
|
22
|
+
@change="onChange($event)"
|
|
23
|
+
@blur="$emit('blur')"
|
|
24
|
+
@focus="$emit('focus')"
|
|
25
|
+
/>
|
|
26
|
+
<slot name="label">{{ label }} </slot>
|
|
27
|
+
</label>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts">
|
|
31
|
+
import {
|
|
32
|
+
type PropType,
|
|
33
|
+
defineComponent,
|
|
34
|
+
inject,
|
|
35
|
+
onBeforeUnmount,
|
|
36
|
+
onMounted,
|
|
37
|
+
ref,
|
|
38
|
+
toRefs,
|
|
39
|
+
} from 'vue';
|
|
40
|
+
|
|
41
|
+
import { useId } from '@propelinc/citrus-ui/src/composables/id';
|
|
42
|
+
import { RADIO_STATE } from '@propelinc/citrus-ui/src/services/injections/radio';
|
|
43
|
+
import type { RadioState } from '@propelinc/citrus-ui/src/services/injections/radio';
|
|
44
|
+
|
|
45
|
+
export default defineComponent({
|
|
46
|
+
name: 'CRadio',
|
|
47
|
+
props: {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
value: { type: null as unknown as PropType<any>, required: true },
|
|
50
|
+
id: { type: String as PropType<string | null>, default: null },
|
|
51
|
+
label: { type: String as PropType<string | null>, default: null },
|
|
52
|
+
dataTest: { type: String, default: 'radio-group-option' },
|
|
53
|
+
hideRadio: { type: Boolean, default: false },
|
|
54
|
+
},
|
|
55
|
+
emits: ['change', 'blur', 'focus'],
|
|
56
|
+
setup(props, { emit }) {
|
|
57
|
+
const { id } = toRefs(props);
|
|
58
|
+
const idWithFallback = useId(id);
|
|
59
|
+
|
|
60
|
+
const parentState = inject(
|
|
61
|
+
RADIO_STATE,
|
|
62
|
+
ref<RadioState>({
|
|
63
|
+
value: null,
|
|
64
|
+
name: idWithFallback.value,
|
|
65
|
+
invalid: false,
|
|
66
|
+
update: () => {},
|
|
67
|
+
register: () => {},
|
|
68
|
+
unregister: () => {},
|
|
69
|
+
})
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const onChange = (event: Event): void => {
|
|
73
|
+
const target = event.target as HTMLInputElement;
|
|
74
|
+
parentState.value.update(target.checked ? props.value : null);
|
|
75
|
+
emit('change', event);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
onMounted((): void => {
|
|
79
|
+
parentState.value.register(props.value);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
onBeforeUnmount((): void => {
|
|
83
|
+
parentState.value.unregister(props.value);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
idWithFallback,
|
|
88
|
+
parentState,
|
|
89
|
+
onChange,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style lang="scss" scoped>
|
|
96
|
+
@import '@propelinc/citrus-ui/src/styles/core';
|
|
97
|
+
@import '@propelinc/citrus-ui/src/styles/form-fields';
|
|
98
|
+
|
|
99
|
+
.c-radio {
|
|
100
|
+
align-items: center;
|
|
101
|
+
background-color: $color-background;
|
|
102
|
+
border: $border;
|
|
103
|
+
border-radius: $border-radius-next;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
display: flex;
|
|
106
|
+
gap: 12px;
|
|
107
|
+
padding: 12px;
|
|
108
|
+
transition: border-color $citrus-field-transition-duration ease;
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.c-radio__input {
|
|
113
|
+
accent-color: $color-black;
|
|
114
|
+
background-color: $color-black;
|
|
115
|
+
border: $color-gray-300 solid $border-width;
|
|
116
|
+
border-color: $color-black;
|
|
117
|
+
margin-top: 1px;
|
|
118
|
+
transform: scale(1.5);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.c-radio__label {
|
|
122
|
+
padding: 0 12px;
|
|
123
|
+
width: 100%;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.c-radio--checked {
|
|
127
|
+
border-color: $color-black;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.c-radio--invalid {
|
|
131
|
+
border-color: $color-status-error;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.c-radio--invalid .c-radio__input {
|
|
135
|
+
accent-color: $color-status-error;
|
|
136
|
+
border-color: $color-status-error;
|
|
137
|
+
}
|
|
138
|
+
</style>
|