tide-design-system 2.0.21 → 2.0.23
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/.eslintrc.cjs +90 -0
- package/.storybook/main.ts +60 -0
- package/.storybook/preview.ts +252 -0
- package/dist/IconAccountBalance-ad4f4a95.js +16 -0
- package/dist/IconAdd-917e055b.js +16 -0
- package/dist/IconAiDescription-e6f8ed46.js +20 -0
- package/dist/IconAlignSpace-5d64a8e4.js +16 -0
- package/dist/IconApplePay-7742e162.js +16 -0
- package/dist/IconArrowBack-1810092d.js +16 -0
- package/dist/IconArrowForward-ddabefc9.js +16 -0
- package/dist/IconArrowRight-d93347c3.js +16 -0
- package/dist/IconAssignment-1983e555.js +16 -0
- package/dist/IconAwardStar-8128aca1.js +16 -0
- package/dist/IconBookmark-7d88d664.js +16 -0
- package/dist/IconCalendarMonth-2fd1e713.js +16 -0
- package/dist/IconCall-8aa582d9.js +16 -0
- package/dist/IconCheck-cf7470ee.js +16 -0
- package/dist/IconChevronLeft-558206bb.js +16 -0
- package/dist/IconChevronRight-28930a0b.js +16 -0
- package/dist/IconClear-9419bf17.js +16 -0
- package/dist/IconClose-abfb6177.js +16 -0
- package/dist/IconCycle-2affec71.js +16 -0
- package/dist/IconDelete-67b69553.js +16 -0
- package/dist/IconDiamond-93af488a.js +16 -0
- package/dist/IconDraft-6e70e48f.js +16 -0
- package/dist/IconEdit-16d34325.js +16 -0
- package/dist/IconError-a2922b95.js +16 -0
- package/dist/IconExpandContent-7e144d1c.js +16 -0
- package/dist/IconExpandLess-3a8a0552.js +16 -0
- package/dist/IconExpandMore-c600148e.js +16 -0
- package/dist/IconFacebook-4658b533.js +16 -0
- package/dist/IconFavorite-d23faefe.js +16 -0
- package/dist/IconFavoriteFilled-aa0d6d5e.js +16 -0
- package/dist/IconFormatBold-70a5cacf.js +16 -0
- package/dist/IconFormatItalic-c06504d7.js +16 -0
- package/dist/IconFormatListBulleted-9493858a.js +16 -0
- package/dist/IconForum-ae4ad63f.js +16 -0
- package/dist/IconGavel-44c29036.js +16 -0
- package/dist/IconGoogle-febad0d8.js +31 -0
- package/dist/IconGooglePay-8cf0286e.js +16 -0
- package/dist/IconGrid-25f665e0.js +16 -0
- package/dist/IconHeight-4fae7545.js +16 -0
- package/dist/IconHelp-340ee4fb.js +16 -0
- package/dist/IconInfo-efead10b.js +16 -0
- package/dist/IconInsertText-00236a65.js +16 -0
- package/dist/IconInstagram-57188d29.js +16 -0
- package/dist/IconIosShare-167aa8c4.js +16 -0
- package/dist/IconLayout-2865e0eb.js +16 -0
- package/dist/IconLinkedIn-f29c217d.js +16 -0
- package/dist/IconLocalShipping-901a3e4c.js +16 -0
- package/dist/IconLock-47669e20.js +16 -0
- package/dist/IconMail-9b85058a.js +16 -0
- package/dist/IconMenu-4bed57f3.js +16 -0
- package/dist/IconMoreHoriz-2aabe29f.js +16 -0
- package/dist/IconNotifications-bcbf1d8c.js +16 -0
- package/dist/IconOpenInNew-78fffcfe.js +16 -0
- package/dist/IconPalette-22865300.js +16 -0
- package/dist/IconPaypal-c28e6dbe.js +16 -0
- package/dist/IconPerson-7ada8b07.js +16 -0
- package/dist/IconPhotoCamera-31a58b85.js +16 -0
- package/dist/IconPinterest-fe5cc414.js +16 -0
- package/dist/IconPlayArrow-1ed5d884.js +16 -0
- package/dist/IconRemove-bab221ba.js +16 -0
- package/dist/IconRoundedCorners-e21c4321.js +16 -0
- package/dist/IconRuler-0ceea80a.js +16 -0
- package/dist/IconSearch-f8faefb4.js +16 -0
- package/dist/IconSeating-2ca8921d.js +16 -0
- package/dist/IconSell-b011ac2d.js +16 -0
- package/dist/IconShare-57f28ce3.js +16 -0
- package/dist/IconShoppingCart-b532dab0.js +16 -0
- package/dist/IconSms-378f373a.js +16 -0
- package/dist/IconStar-1b8ad0f9.js +16 -0
- package/dist/IconSwapVert-8085e942.js +16 -0
- package/dist/IconThreeDRotation-33f086a7.js +29 -0
- package/dist/IconTrophy-f4be8b54.js +16 -0
- package/dist/IconTune-0913ba01.js +16 -0
- package/dist/IconTwitter-9acefb07.js +16 -0
- package/dist/IconVideocam-33650e6f.js +16 -0
- package/dist/IconViewInAr-d1534ef2.js +16 -0
- package/dist/IconVisibility-a1c21dd0.js +16 -0
- package/dist/IconVolumeOff-8e121ef3.js +16 -0
- package/dist/IconVolumeOn-992e16dd.js +16 -0
- package/dist/IconWarning-6f490acf.js +16 -0
- package/dist/IconWeight-e3b3daa6.js +16 -0
- package/dist/IconWidth-023f69f2.js +16 -0
- package/dist/IconYoutube-a6224033.js +16 -0
- package/dist/css/grid-layout.css +7 -3
- package/dist/style.css +1 -1
- package/dist/tide-design-system.js +2172 -46
- package/dist/types/Icon.ts +6 -0
- package/index.ts +122 -0
- package/package.json +9 -12
- package/src/assets/css/animation.css +14 -0
- package/src/assets/css/dynamic-buttons.css +79 -0
- package/src/assets/css/dynamic-utilities.css +39 -0
- package/src/assets/css/grid-layout.css +71 -0
- package/src/assets/css/main.css +5 -0
- package/src/assets/css/realm/aero.css +42 -0
- package/src/assets/css/realm/atv.css +43 -0
- package/src/assets/css/realm/boatmart.css +42 -0
- package/src/assets/css/realm/cycle.css +42 -0
- package/src/assets/css/realm/equip.css +42 -0
- package/src/assets/css/realm/pwc.css +42 -0
- package/src/assets/css/realm/rv.css +50 -0
- package/src/assets/css/realm/snow.css +42 -0
- package/src/assets/css/realm/truck.css +42 -0
- package/src/assets/css/reset.css +79 -0
- package/src/assets/css/storybook.css +9 -0
- package/src/assets/css/utilities.css +1602 -0
- package/src/assets/css/variables.css +118 -0
- package/src/assets/svg/icons/IconAccountBalance.svg +5 -0
- package/src/assets/svg/icons/IconAdd.svg +3 -0
- package/src/assets/svg/icons/IconAiDescription.svg +7 -0
- package/src/assets/svg/icons/IconAlignSpace.svg +3 -0
- package/src/assets/svg/icons/IconApplePay.svg +5 -0
- package/src/assets/svg/icons/IconArrowBack.svg +3 -0
- package/src/assets/svg/icons/IconArrowForward.svg +3 -0
- package/src/assets/svg/icons/IconArrowRight.svg +3 -0
- package/src/assets/svg/icons/IconAssignment.svg +5 -0
- package/src/assets/svg/icons/IconAwardStar.svg +5 -0
- package/src/assets/svg/icons/IconBookmark.svg +5 -0
- package/src/assets/svg/icons/IconCalendarMonth.svg +5 -0
- package/src/assets/svg/icons/IconCall.svg +5 -0
- package/src/assets/svg/icons/IconCheck.svg +3 -0
- package/src/assets/svg/icons/IconChevronLeft.svg +3 -0
- package/src/assets/svg/icons/IconChevronRight.svg +3 -0
- package/src/assets/svg/icons/IconClear.svg +5 -0
- package/src/assets/svg/icons/IconClose.svg +3 -0
- package/src/assets/svg/icons/IconCycle.svg +5 -0
- package/src/assets/svg/icons/IconDelete.svg +5 -0
- package/src/assets/svg/icons/IconDiamond.svg +5 -0
- package/src/assets/svg/icons/IconDraft.svg +3 -0
- package/src/assets/svg/icons/IconEdit.svg +5 -0
- package/src/assets/svg/icons/IconError.svg +5 -0
- package/src/assets/svg/icons/IconExpandContent.svg +3 -0
- package/src/assets/svg/icons/IconExpandLess.svg +3 -0
- package/src/assets/svg/icons/IconExpandMore.svg +3 -0
- package/src/assets/svg/icons/IconFacebook.svg +5 -0
- package/src/assets/svg/icons/IconFavorite.svg +5 -0
- package/src/assets/svg/icons/IconFavoriteFilled.svg +5 -0
- package/src/assets/svg/icons/IconFormatBold.svg +5 -0
- package/src/assets/svg/icons/IconFormatItalic.svg +3 -0
- package/src/assets/svg/icons/IconFormatListBulleted.svg +5 -0
- package/src/assets/svg/icons/IconForum.svg +5 -0
- package/src/assets/svg/icons/IconGavel.svg +5 -0
- package/src/assets/svg/icons/IconGoogle.svg +18 -0
- package/src/assets/svg/icons/IconGooglePay.svg +5 -0
- package/src/assets/svg/icons/IconGrid.svg +3 -0
- package/src/assets/svg/icons/IconHeight.svg +3 -0
- package/src/assets/svg/icons/IconHelp.svg +5 -0
- package/src/assets/svg/icons/IconInfo.svg +5 -0
- package/src/assets/svg/icons/IconInsertText.svg +5 -0
- package/src/assets/svg/icons/IconInstagram.svg +5 -0
- package/src/assets/svg/icons/IconIosShare.svg +5 -0
- package/src/assets/svg/icons/IconLayout.svg +5 -0
- package/src/assets/svg/icons/IconLinkedIn.svg +5 -0
- package/src/assets/svg/icons/IconLocalShipping.svg +5 -0
- package/src/assets/svg/icons/IconLock.svg +5 -0
- package/src/assets/svg/icons/IconMail.svg +5 -0
- package/src/assets/svg/icons/IconMenu.svg +3 -0
- package/src/assets/svg/icons/IconMoreHoriz.svg +5 -0
- package/src/assets/svg/icons/IconNotifications.svg +5 -0
- package/src/assets/svg/icons/IconOpenInNew.svg +5 -0
- package/src/assets/svg/icons/IconPalette.svg +5 -0
- package/src/assets/svg/icons/IconPaypal.svg +5 -0
- package/src/assets/svg/icons/IconPerson.svg +5 -0
- package/src/assets/svg/icons/IconPhotoCamera.svg +5 -0
- package/src/assets/svg/icons/IconPinterest.svg +5 -0
- package/src/assets/svg/icons/IconPlayArrow.svg +3 -0
- package/src/assets/svg/icons/IconRemove.svg +3 -0
- package/src/assets/svg/icons/IconRoundedCorners.svg +5 -0
- package/src/assets/svg/icons/IconRuler.svg +3 -0
- package/src/assets/svg/icons/IconSearch.svg +5 -0
- package/src/assets/svg/icons/IconSeating.svg +3 -0
- package/src/assets/svg/icons/IconSell.svg +5 -0
- package/src/assets/svg/icons/IconShare.svg +5 -0
- package/src/assets/svg/icons/IconShoppingCart.svg +5 -0
- package/src/assets/svg/icons/IconSms.svg +5 -0
- package/src/assets/svg/icons/IconStar.svg +5 -0
- package/src/assets/svg/icons/IconSwapVert.svg +5 -0
- package/src/assets/svg/icons/IconThreeDRotation.svg +18 -0
- package/src/assets/svg/icons/IconTrophy.svg +5 -0
- package/src/assets/svg/icons/IconTune.svg +5 -0
- package/src/assets/svg/icons/IconTwitter.svg +5 -0
- package/src/assets/svg/icons/IconVideocam.svg +5 -0
- package/src/assets/svg/icons/IconViewInAr.svg +5 -0
- package/src/assets/svg/icons/IconVisibility.svg +5 -0
- package/src/assets/svg/icons/IconVolumeOff.svg +5 -0
- package/src/assets/svg/icons/IconVolumeOn.svg +5 -0
- package/src/assets/svg/icons/IconWarning.svg +5 -0
- package/src/assets/svg/icons/IconWeight.svg +3 -0
- package/src/assets/svg/icons/IconWidth.svg +3 -0
- package/src/assets/svg/icons/IconYoutube.svg +5 -0
- package/src/components/TideAccordionItem.vue +105 -0
- package/src/components/TideAlert.vue +124 -0
- package/src/components/TideBackgroundImage.vue +44 -0
- package/src/components/TideBadge.vue +30 -0
- package/src/components/TideBadgePremium.vue +31 -0
- package/src/components/TideBadgeTrustedPartner.vue +38 -0
- package/src/components/TideBreadCrumbs.vue +53 -0
- package/src/components/TideButton.vue +67 -0
- package/src/components/TideButtonIcon.vue +52 -0
- package/src/components/TideButtonPagination.vue +71 -0
- package/src/components/TideCard.vue +19 -0
- package/src/components/TideCarousel.vue +188 -0
- package/src/components/TideChipAction.vue +48 -0
- package/src/components/TideChipFilter.vue +55 -0
- package/src/components/TideChipInput.vue +44 -0
- package/src/components/TideColumns.vue +53 -0
- package/src/components/TideDivider.vue +24 -0
- package/src/components/TideIcon.vue +58 -0
- package/src/components/TideImage.vue +44 -0
- package/src/components/TideIndicator.vue +57 -0
- package/src/components/TideInputCheckbox.vue +145 -0
- package/src/components/TideInputRadio.vue +87 -0
- package/src/components/TideInputSelect.vue +204 -0
- package/src/components/TideInputText.vue +292 -0
- package/src/components/TideInputTextarea.vue +196 -0
- package/src/components/TideLink.vue +66 -0
- package/src/components/TideModal.vue +187 -0
- package/src/components/TidePagination.vue +67 -0
- package/src/components/TideSeoLinks.vue +58 -0
- package/src/components/TideTabs.vue +89 -0
- package/src/components/TideToggle.vue +95 -0
- package/src/docs/development.md +51 -0
- package/src/docs/integration.md +79 -0
- package/src/docs/storybook.md +39 -0
- package/src/stories/DemoCssUtilities.stories.ts +154 -0
- package/src/stories/DemoCssUtilitiesByTextInput.stories.ts +61 -0
- package/src/stories/FoundationsBorder.stories.ts +230 -0
- package/src/stories/FoundationsGap.stories.ts +180 -0
- package/src/stories/FoundationsMargin.stories.ts +155 -0
- package/src/stories/FoundationsPadding.stories.ts +108 -0
- package/src/stories/FoundationsShadow.stories.ts +84 -0
- package/src/stories/FoundationsTypography.stories.ts +172 -0
- package/src/stories/Template.stories.ts +71 -0
- package/src/stories/TideAccordionItem.stories.ts +68 -0
- package/src/stories/TideAlert.stories.ts +58 -0
- package/src/stories/TideBackgroundImage.stories.ts +53 -0
- package/src/stories/TideBadge.stories.ts +31 -0
- package/src/stories/TideBadgePremium.stories.ts +31 -0
- package/src/stories/TideBadgeTrustedPartner.stories.ts +33 -0
- package/src/stories/TideBreadCrumbs.stories.ts +43 -0
- package/src/stories/TideButton.stories.ts +118 -0
- package/src/stories/TideButtonIcon.stories.ts +103 -0
- package/src/stories/TideButtonPagination.stories.ts +99 -0
- package/src/stories/TideCard.stories.ts +38 -0
- package/src/stories/TideCarousel.stories.ts +130 -0
- package/src/stories/TideChipAction.stories.ts +46 -0
- package/src/stories/TideChipFilter.stories.ts +59 -0
- package/src/stories/TideChipInput.stories.ts +42 -0
- package/src/stories/TideColumns.stories.ts +90 -0
- package/src/stories/TideDivider.stories.ts +46 -0
- package/src/stories/TideIcon.stories.ts +29 -0
- package/src/stories/TideIndicator.stories.ts +31 -0
- package/src/stories/TideInputCheckbox.stories.ts +86 -0
- package/src/stories/TideInputRadio.stories.ts +71 -0
- package/src/stories/TideInputSelect.stories.ts +145 -0
- package/src/stories/TideInputText.stories.ts +181 -0
- package/src/stories/TideInputTextarea.stories.ts +116 -0
- package/src/stories/TideLink.stories.ts +137 -0
- package/src/stories/TideModal.stories.ts +122 -0
- package/src/stories/TidePagination.stories.ts +83 -0
- package/src/stories/TideSeoLinks.stories.ts +67 -0
- package/src/stories/TideTabs.stories.ts +100 -0
- package/src/stories/TideToggle.stories.ts +69 -0
- package/src/stories/Welcome.mdx +17 -0
- package/src/types/Alert.ts +8 -0
- package/src/types/Badge.ts +21 -0
- package/src/types/BreadCrumb.ts +5 -0
- package/src/types/Detail.ts +4 -0
- package/src/types/Element.ts +13 -0
- package/src/types/FacetRange.ts +84 -0
- package/src/types/Field.ts +54 -0
- package/src/types/Form.ts +58 -0
- package/src/types/Formatted.ts +22 -0
- package/src/types/Icon.ts +87 -0
- package/src/types/Link.ts +5 -0
- package/src/types/ListingMedia.ts +43 -0
- package/src/types/Orientation.ts +6 -0
- package/src/types/Priority.ts +11 -0
- package/src/types/Raw.ts +5 -0
- package/src/types/Realm.ts +13 -0
- package/src/types/RealmConfig.ts +14 -0
- package/src/types/Select.ts +10 -0
- package/src/types/Size.ts +6 -0
- package/src/types/Storybook.ts +219 -0
- package/src/types/Styles.ts +590 -0
- package/src/types/Tab.ts +5 -0
- package/src/types/Target.ts +6 -0
- package/src/types/TextInput.ts +16 -0
- package/src/types/Validation.ts +24 -0
- package/src/utilities/format.ts +184 -0
- package/src/utilities/storybook.ts +295 -0
- package/src/utilities/validation.ts +197 -0
- package/tests/utilities-format.spec.ts +430 -0
- package/tsconfig.app.json +14 -0
- package/tsconfig.config.json +12 -0
- package/tsconfig.json +22 -0
- package/tsconfig.vitest.json +10 -0
- package/vite.config.ts +43 -0
- package/dist/IconAccountBalance-e434dc83.js +0 -11
- package/dist/IconAdd-137c81ee.js +0 -11
- package/dist/IconAiDescription-b61fdf89.js +0 -15
- package/dist/IconAlignSpace-7fbe46b4.js +0 -11
- package/dist/IconApplePay-64062dcc.js +0 -11
- package/dist/IconArrowBack-e6928100.js +0 -11
- package/dist/IconArrowForward-d6ab6d3a.js +0 -11
- package/dist/IconArrowRight-c6a11581.js +0 -11
- package/dist/IconAssignment-e2763562.js +0 -11
- package/dist/IconAwardStar-17cf905a.js +0 -11
- package/dist/IconBookmark-82addaac.js +0 -11
- package/dist/IconCalendarMonth-1a83d5d5.js +0 -11
- package/dist/IconCall-ba5b39c1.js +0 -11
- package/dist/IconCheck-cf09e735.js +0 -11
- package/dist/IconChevronLeft-8f71380a.js +0 -11
- package/dist/IconChevronRight-68656c61.js +0 -11
- package/dist/IconClear-785206de.js +0 -11
- package/dist/IconClose-44cd3416.js +0 -11
- package/dist/IconCycle-7920badb.js +0 -11
- package/dist/IconDelete-6392fe21.js +0 -11
- package/dist/IconDiamond-87eabf00.js +0 -11
- package/dist/IconEdit-8e98e4d6.js +0 -11
- package/dist/IconError-744d1a2c.js +0 -11
- package/dist/IconExpandContent-b7b8cde3.js +0 -11
- package/dist/IconExpandLess-210cd748.js +0 -11
- package/dist/IconExpandMore-42efdc9f.js +0 -11
- package/dist/IconFacebook-fb220a44.js +0 -11
- package/dist/IconFavorite-f59e02f9.js +0 -11
- package/dist/IconFavoriteFilled-e8d07819.js +0 -11
- package/dist/IconFormatBold-0029544d.js +0 -11
- package/dist/IconFormatItalic-3a6bf7c0.js +0 -11
- package/dist/IconFormatListBulleted-aa928706.js +0 -11
- package/dist/IconForum-eb80ff50.js +0 -11
- package/dist/IconGavel-e89cca44.js +0 -11
- package/dist/IconGoogle-7a073b42.js +0 -28
- package/dist/IconGooglePay-ee54db4a.js +0 -11
- package/dist/IconGrid-bf797b90.js +0 -11
- package/dist/IconHelp-19e606c6.js +0 -11
- package/dist/IconInfo-559b7d0f.js +0 -11
- package/dist/IconInsertText-c915a8a6.js +0 -11
- package/dist/IconInstagram-0575acd4.js +0 -11
- package/dist/IconIosShare-93c68705.js +0 -11
- package/dist/IconLayout-85066093.js +0 -11
- package/dist/IconLinkedIn-75fb43e2.js +0 -11
- package/dist/IconLocalShipping-abceb11a.js +0 -11
- package/dist/IconLock-1341dc44.js +0 -11
- package/dist/IconMail-925571bb.js +0 -11
- package/dist/IconMenu-6c017324.js +0 -11
- package/dist/IconMoreHoriz-cd236be0.js +0 -11
- package/dist/IconNotifications-74251294.js +0 -11
- package/dist/IconOpenInNew-e350684e.js +0 -11
- package/dist/IconPalette-0741adc0.js +0 -11
- package/dist/IconPaypal-9267d4dd.js +0 -11
- package/dist/IconPerson-02596ee6.js +0 -11
- package/dist/IconPhotoCamera-04e406ff.js +0 -11
- package/dist/IconPinterest-9e6e2f1f.js +0 -11
- package/dist/IconPlayArrow-aa6e204b.js +0 -11
- package/dist/IconRemove-8f57304c.js +0 -11
- package/dist/IconRoundedCorners-673a1198.js +0 -11
- package/dist/IconSearch-a0ebf9b5.js +0 -11
- package/dist/IconSell-b20a15c2.js +0 -11
- package/dist/IconShare-fa702e5c.js +0 -11
- package/dist/IconShoppingCart-81bd675f.js +0 -11
- package/dist/IconSms-71c3667d.js +0 -11
- package/dist/IconStar-8ef71a6b.js +0 -11
- package/dist/IconSwapVert-e1a856cc.js +0 -11
- package/dist/IconThreeDRotation-8ba20beb.js +0 -26
- package/dist/IconTrophy-3a84843d.js +0 -11
- package/dist/IconTune-8d1f5475.js +0 -11
- package/dist/IconTwitter-bff7aa81.js +0 -11
- package/dist/IconVideocam-c90004a7.js +0 -11
- package/dist/IconViewInAr-9c1793fa.js +0 -11
- package/dist/IconVisibility-7eecd864.js +0 -11
- package/dist/IconVolumeOff-aebdfc74.js +0 -11
- package/dist/IconVolumeOn-023c1853.js +0 -11
- package/dist/IconWarning-5719af6f.js +0 -11
- package/dist/IconYoutube-554684e4.js +0 -11
- package/dist/index-b7b97ebf.js +0 -2165
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import TideChipAction from '@/components/TideChipAction.vue';
|
|
2
|
+
import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/storybook';
|
|
3
|
+
|
|
4
|
+
const render = (args: any) => ({
|
|
5
|
+
components: { TideChipAction },
|
|
6
|
+
setup: () => ({ args }),
|
|
7
|
+
template: '<TideChipAction class="tide-display-inline-flex" v-bind="args" />',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
argTypes: {
|
|
12
|
+
dataTrack,
|
|
13
|
+
href: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'URL to navigate to on click',
|
|
16
|
+
table: {
|
|
17
|
+
defaultValue: { summary: 'None' },
|
|
18
|
+
type: { summary: 'string' },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
isNewTab: {
|
|
22
|
+
...argTypeBooleanUnrequired,
|
|
23
|
+
description: 'Determines whether to target a new browser tab',
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
control: 'text',
|
|
27
|
+
description: 'Chip text',
|
|
28
|
+
table: {
|
|
29
|
+
defaultValue: { summary: 'None' },
|
|
30
|
+
type: { summary: 'string' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
dataTrack: '',
|
|
36
|
+
href: 'https://www.sample.com',
|
|
37
|
+
label: 'Demo',
|
|
38
|
+
},
|
|
39
|
+
component: TideChipAction,
|
|
40
|
+
parameters,
|
|
41
|
+
render,
|
|
42
|
+
tags: ['autodocs'],
|
|
43
|
+
title: 'Basic Components/TideChipAction',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Demo = {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import TideChipFilter from '@/components/TideChipFilter.vue';
|
|
4
|
+
import { argTypeBooleanUnrequired, click, dataTrack, parameters } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const render = (args: any, { updateArgs }: any) => ({
|
|
7
|
+
components: { TideChipFilter },
|
|
8
|
+
methods: {
|
|
9
|
+
handleClick: (event: Event) => {
|
|
10
|
+
if (args.click) action(args.click)(event);
|
|
11
|
+
|
|
12
|
+
updateArgs({ ...args, isActive: !args.isActive });
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
setup: () => ({ args }),
|
|
16
|
+
template: `<TideChipFilter @click="handleClick" class="tide-display-inline-flex" v-bind="args">{{ args.default }}</TideChipFilter>`,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
argTypes: {
|
|
21
|
+
click,
|
|
22
|
+
dataTrack,
|
|
23
|
+
default: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
defaultValue: 'None',
|
|
26
|
+
description: 'Content above label<br />(i.e. Vehicle thumbnail)',
|
|
27
|
+
table: {
|
|
28
|
+
defaultValue: { summary: 'None' },
|
|
29
|
+
type: { summary: 'HTML' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
isActive: {
|
|
33
|
+
...argTypeBooleanUnrequired,
|
|
34
|
+
description: 'Determines whether toggle is active',
|
|
35
|
+
},
|
|
36
|
+
label: {
|
|
37
|
+
control: 'text',
|
|
38
|
+
description: 'Chip text',
|
|
39
|
+
table: {
|
|
40
|
+
defaultValue: { summary: 'None' },
|
|
41
|
+
type: { summary: 'string' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
args: {
|
|
46
|
+
click: 'doSomething',
|
|
47
|
+
dataTrack: '',
|
|
48
|
+
default: '',
|
|
49
|
+
isActive: undefined,
|
|
50
|
+
label: 'Demo',
|
|
51
|
+
},
|
|
52
|
+
component: TideChipFilter,
|
|
53
|
+
parameters,
|
|
54
|
+
render,
|
|
55
|
+
tags: ['autodocs'],
|
|
56
|
+
title: 'Basic Components/TideChipFilter',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Demo = {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import TideChipInput from '@/components/TideChipInput.vue';
|
|
4
|
+
import { click, dataTrack, parameters } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const render = (args: any) => ({
|
|
7
|
+
components: { TideChipInput },
|
|
8
|
+
methods: {
|
|
9
|
+
handleClick: (event: Event) => {
|
|
10
|
+
if (args.click) action(args.click)(event);
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
setup: () => ({ args }),
|
|
14
|
+
template: `<TideChipInput @click="handleClick" v-bind="args" />`,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
argTypes: {
|
|
19
|
+
click,
|
|
20
|
+
dataTrack,
|
|
21
|
+
label: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Chip text',
|
|
24
|
+
table: {
|
|
25
|
+
defaultValue: { summary: 'None' },
|
|
26
|
+
type: { summary: 'string' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
args: {
|
|
31
|
+
click: 'doSomething',
|
|
32
|
+
dataTrack: '',
|
|
33
|
+
label: 'Demo',
|
|
34
|
+
},
|
|
35
|
+
component: TideChipInput,
|
|
36
|
+
parameters,
|
|
37
|
+
render,
|
|
38
|
+
tags: ['autodocs'],
|
|
39
|
+
title: 'Basic Components/TideChipInput',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Demo = {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import TideColumns from '@/components/TideColumns.vue';
|
|
4
|
+
import { lineBreak, tab } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
7
|
+
const { args } = context;
|
|
8
|
+
|
|
9
|
+
const argsWithValues: string[] = [];
|
|
10
|
+
|
|
11
|
+
if (args.heading) argsWithValues.push(`:heading="${args.heading}"`);
|
|
12
|
+
|
|
13
|
+
return `<TideColumns ${argsWithValues.join(' ')}>${lineBreak}${tab}<template #section1>${
|
|
14
|
+
args.section1
|
|
15
|
+
}</template>${lineBreak}${tab}<template #section2>${args.section2}</template>${lineBreak}${tab}<template #section3>${
|
|
16
|
+
args.section3
|
|
17
|
+
}</template>${lineBreak}${tab}<template #section4>${args.section4}</template>${lineBreak}</TideColumns>`;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const parameters = {
|
|
21
|
+
docs: {
|
|
22
|
+
source: {
|
|
23
|
+
format: 'vue',
|
|
24
|
+
language: 'html',
|
|
25
|
+
transform: formatSnippet,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
argTypes: {
|
|
32
|
+
heading: {
|
|
33
|
+
control: 'text',
|
|
34
|
+
description: 'Determines label',
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: { summary: 'None' },
|
|
37
|
+
type: { summary: 'string' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
section1: {
|
|
41
|
+
control: 'text',
|
|
42
|
+
defaultValue: 'None',
|
|
43
|
+
description: 'Section 1 content',
|
|
44
|
+
table: {
|
|
45
|
+
defaultValue: { summary: 'None' },
|
|
46
|
+
type: { summary: 'HTML' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
section2: {
|
|
50
|
+
control: 'text',
|
|
51
|
+
defaultValue: 'None',
|
|
52
|
+
description: 'Section 2 content',
|
|
53
|
+
table: {
|
|
54
|
+
defaultValue: { summary: 'None' },
|
|
55
|
+
type: { summary: 'HTML' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
section3: {
|
|
59
|
+
control: 'text',
|
|
60
|
+
defaultValue: 'None',
|
|
61
|
+
description: 'Section 3 content',
|
|
62
|
+
table: {
|
|
63
|
+
defaultValue: { summary: 'None' },
|
|
64
|
+
type: { summary: 'HTML' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
section4: {
|
|
68
|
+
control: 'text',
|
|
69
|
+
defaultValue: 'None',
|
|
70
|
+
description: 'Section 4 content',
|
|
71
|
+
table: {
|
|
72
|
+
defaultValue: { summary: 'None' },
|
|
73
|
+
type: { summary: 'HTML' },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
args: {
|
|
78
|
+
heading: 'Demo',
|
|
79
|
+
section1: 'Section 1',
|
|
80
|
+
section2: 'Section 2',
|
|
81
|
+
section3: 'Section 3',
|
|
82
|
+
section4: 'Section 4',
|
|
83
|
+
},
|
|
84
|
+
component: TideColumns,
|
|
85
|
+
parameters,
|
|
86
|
+
tags: ['autodocs'],
|
|
87
|
+
title: 'Basic Components/TideColumns',
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Demo = {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ORIENTATION as STANDARD_ORIENTATION } from '@/types/Orientation';
|
|
2
|
+
import TideDivider from '@/components/TideDivider.vue';
|
|
3
|
+
import { disabledArgType, formatArgType, parameters, prependNoneAsUndefined } from '@/utilities/storybook';
|
|
4
|
+
|
|
5
|
+
const formatArgs = (args: any) => {
|
|
6
|
+
args.flexDirection = args.orientation === ORIENTATION.VERTICAL ? 'tide-flex-row' : 'tide-flex-column';
|
|
7
|
+
args.divTemplate = `<div class="sb-border-blue-light sb-font-blue-light tide-display-flex tide-axis1-center tide-axis2-center tide-padding-1 tide-width-full" style="min-width: 100px; min-height:100px;" />`;
|
|
8
|
+
|
|
9
|
+
return { args };
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const render = (args: any) => ({
|
|
13
|
+
components: { TideDivider },
|
|
14
|
+
setup: () => formatArgs(args),
|
|
15
|
+
template: `<div :class="['tide-display-flex', args.flexDirection]">
|
|
16
|
+
<div class="sb-border-blue-light sb-font-blue-light tide-display-flex tide-axis1-center tide-axis2-center tide-padding-1 tide-width-full" style="min-width: 100px; min-height:100px;" />
|
|
17
|
+
|
|
18
|
+
<TideDivider :orientation="args.orientation" />
|
|
19
|
+
|
|
20
|
+
<div class="sb-border-blue-light sb-font-blue-light tide-display-flex tide-axis1-center tide-axis2-center tide-padding-1 tide-width-full" style="min-width: 100px; height:100px;" />
|
|
21
|
+
</div>`,
|
|
22
|
+
updated: () => formatArgs(args),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const ORIENTATION = prependNoneAsUndefined(STANDARD_ORIENTATION);
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
argTypes: {
|
|
29
|
+
disabledArgType: disabledArgType, // Force updated() trigger when orientation is set to undefined.
|
|
30
|
+
orientation: {
|
|
31
|
+
...formatArgType({ ORIENTATION }),
|
|
32
|
+
description: 'Determines whether Divider is horizontal or vertical',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
disabledArgType: '',
|
|
37
|
+
orientation: undefined,
|
|
38
|
+
},
|
|
39
|
+
component: TideDivider,
|
|
40
|
+
parameters,
|
|
41
|
+
render,
|
|
42
|
+
tags: ['autodocs'],
|
|
43
|
+
title: 'Basic Components/TideDivider',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Demo = {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as STANDARD_SIZE from '@/types/Size';
|
|
2
|
+
import TideIcon from '@/components/TideIcon.vue';
|
|
3
|
+
import { ICON } from '@/types/Icon';
|
|
4
|
+
import { formatArgType, parameters, prependNoneAsUndefined } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const SIZE = prependNoneAsUndefined(STANDARD_SIZE.SIZE);
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
argTypes: {
|
|
10
|
+
icon: {
|
|
11
|
+
...formatArgType({ ICON }),
|
|
12
|
+
description: 'Icon',
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
...formatArgType({ SIZE }),
|
|
16
|
+
description: 'Determines icon dimensions',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
icon: ICON.FAVORITE,
|
|
21
|
+
size: undefined,
|
|
22
|
+
},
|
|
23
|
+
component: TideIcon,
|
|
24
|
+
parameters,
|
|
25
|
+
tags: ['autodocs'],
|
|
26
|
+
title: 'Basic Components/TideIcon',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Demo = {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import TideIndicator from '@/components/TideIndicator.vue';
|
|
2
|
+
import { parameters } from '@/utilities/storybook';
|
|
3
|
+
|
|
4
|
+
const render = (args: any) => ({
|
|
5
|
+
components: { TideIndicator },
|
|
6
|
+
setup: () => ({ args }),
|
|
7
|
+
template: `<TideIndicator v-bind="args" />`,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
argTypes: {
|
|
12
|
+
label: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
description: 'Indicator text',
|
|
15
|
+
table: {
|
|
16
|
+
defaultValue: { summary: 'None' },
|
|
17
|
+
type: { summary: 'text' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
label: '',
|
|
23
|
+
},
|
|
24
|
+
component: TideIndicator,
|
|
25
|
+
parameters,
|
|
26
|
+
render,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
title: 'Basic Components/TideIndicator',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Demo = {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import TideInputCheckbox from '@/components/TideInputCheckbox.vue';
|
|
4
|
+
import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const render = (args: any, context: any) => ({
|
|
7
|
+
components: { TideInputCheckbox },
|
|
8
|
+
methods: {
|
|
9
|
+
handleClick: (event: Event) => {
|
|
10
|
+
const input = context.canvasElement.querySelector('input');
|
|
11
|
+
|
|
12
|
+
action('TideInputCheckbox toggled')(event);
|
|
13
|
+
context.updateArgs({ ...args, checked: input.checked === true, indeterminate: undefined });
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
setup: () => ({ args }),
|
|
17
|
+
template: `<TideInputCheckbox @click="handleClick" v-bind="args" />`,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
argTypes: {
|
|
22
|
+
checked: {
|
|
23
|
+
...argTypeBooleanUnrequired,
|
|
24
|
+
description: 'Determines whether Checkbox is checked or unchecked',
|
|
25
|
+
},
|
|
26
|
+
dataTrack,
|
|
27
|
+
disabled: {
|
|
28
|
+
...argTypeBooleanUnrequired,
|
|
29
|
+
description: 'Determines whether Checkbox state is interactable',
|
|
30
|
+
},
|
|
31
|
+
indeterminate: {
|
|
32
|
+
...argTypeBooleanUnrequired,
|
|
33
|
+
description: 'Determines whether Checkbox is indeterminate',
|
|
34
|
+
if: { arg: 'checked', eq: true },
|
|
35
|
+
},
|
|
36
|
+
inputId: {
|
|
37
|
+
control: 'text',
|
|
38
|
+
description: 'Unique ID attribute<br />(to bind Checkbox label to input)',
|
|
39
|
+
table: {
|
|
40
|
+
defaultValue: { summary: 'None' },
|
|
41
|
+
type: { summary: 'string' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
label: {
|
|
45
|
+
control: 'text',
|
|
46
|
+
description: 'Label content',
|
|
47
|
+
table: {
|
|
48
|
+
defaultValue: { summary: 'None' },
|
|
49
|
+
type: { summary: 'string' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
name: {
|
|
53
|
+
control: 'text',
|
|
54
|
+
description: 'Name attribute',
|
|
55
|
+
table: {
|
|
56
|
+
defaultValue: { summary: 'None' },
|
|
57
|
+
type: { summary: 'string' },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
number: {
|
|
61
|
+
control: 'text',
|
|
62
|
+
description: 'Parenthetical response count',
|
|
63
|
+
table: {
|
|
64
|
+
defaultValue: { summary: 'None' },
|
|
65
|
+
type: { summary: 'number' },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
args: {
|
|
70
|
+
checked: undefined,
|
|
71
|
+
dataTrack: '',
|
|
72
|
+
disabled: undefined,
|
|
73
|
+
indeterminate: undefined,
|
|
74
|
+
inputId: '',
|
|
75
|
+
label: 'Input label',
|
|
76
|
+
name: '',
|
|
77
|
+
number: '',
|
|
78
|
+
},
|
|
79
|
+
component: TideInputCheckbox,
|
|
80
|
+
parameters,
|
|
81
|
+
render,
|
|
82
|
+
tags: ['autodocs'],
|
|
83
|
+
title: 'Basic Components/TideInputCheckbox',
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const Demo = {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import TideInputRadio from '@/components/TideInputRadio.vue';
|
|
4
|
+
import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const render = (args: any, context: any) => ({
|
|
7
|
+
components: { TideInputRadio },
|
|
8
|
+
methods: {
|
|
9
|
+
handleChange: (event: KeyboardEvent) => {
|
|
10
|
+
const input = context.canvasElement.querySelector('input');
|
|
11
|
+
|
|
12
|
+
action('TideInputRadio changed')(event);
|
|
13
|
+
context.updateArgs({ ...args, checked: input.checked });
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
setup: () => ({ args }),
|
|
17
|
+
template: `<TideInputRadio @change="handleChange" v-bind="args" />`,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
argTypes: {
|
|
22
|
+
checked: {
|
|
23
|
+
...argTypeBooleanUnrequired,
|
|
24
|
+
description: 'Determines whether input is selected',
|
|
25
|
+
},
|
|
26
|
+
dataTrack,
|
|
27
|
+
disabled: {
|
|
28
|
+
...argTypeBooleanUnrequired,
|
|
29
|
+
description: 'Determines whether input is interactable',
|
|
30
|
+
},
|
|
31
|
+
inputId: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
description: 'Unique ID attribute<br />(to bind input label to input)',
|
|
34
|
+
table: {
|
|
35
|
+
defaultValue: { summary: 'None' },
|
|
36
|
+
type: { summary: 'string' },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
label: {
|
|
40
|
+
control: 'text',
|
|
41
|
+
description: 'Label content',
|
|
42
|
+
table: {
|
|
43
|
+
defaultValue: { summary: 'None' },
|
|
44
|
+
type: { summary: 'string' },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
name: {
|
|
48
|
+
control: 'text',
|
|
49
|
+
description: 'Name attribute',
|
|
50
|
+
table: {
|
|
51
|
+
defaultValue: { summary: 'None' },
|
|
52
|
+
type: { summary: 'string' },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
args: {
|
|
57
|
+
checked: undefined,
|
|
58
|
+
dataTrack: '',
|
|
59
|
+
disabled: undefined,
|
|
60
|
+
inputId: '',
|
|
61
|
+
label: 'Input label',
|
|
62
|
+
name: '',
|
|
63
|
+
},
|
|
64
|
+
component: TideInputRadio,
|
|
65
|
+
parameters,
|
|
66
|
+
render,
|
|
67
|
+
tags: ['autodocs'],
|
|
68
|
+
title: 'Basic Components/TideInputRadio',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const Demo = {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import type { SelectOption } from '@/types/Select';
|
|
4
|
+
|
|
5
|
+
import TideInputSelect from '@/components/TideInputSelect.vue';
|
|
6
|
+
import {
|
|
7
|
+
argTypeBooleanUnrequired,
|
|
8
|
+
change,
|
|
9
|
+
dataTrack,
|
|
10
|
+
doSomething,
|
|
11
|
+
formatArgType,
|
|
12
|
+
getLabelsFromOptions,
|
|
13
|
+
parameters,
|
|
14
|
+
} from '@/utilities/storybook';
|
|
15
|
+
|
|
16
|
+
const options = {
|
|
17
|
+
'Option 1': 1,
|
|
18
|
+
'Option 2': 2,
|
|
19
|
+
'Option 3': 3,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const selectOptions: SelectOption[] = [
|
|
23
|
+
{
|
|
24
|
+
label: 'Option 1',
|
|
25
|
+
value: 1,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'Option 2',
|
|
29
|
+
value: 2,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Option 3',
|
|
33
|
+
value: 3,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const render = (args: any, { updateArgs }: any) => ({
|
|
38
|
+
components: { TideInputSelect },
|
|
39
|
+
methods: {
|
|
40
|
+
doSomething,
|
|
41
|
+
handleChange: (event: Event) => {
|
|
42
|
+
const value = parseInt((event?.target as HTMLSelectElement).value, 10);
|
|
43
|
+
|
|
44
|
+
updateArgs({ ...args, value });
|
|
45
|
+
action('TideInputSelect changed')(event);
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const performCallback = eval(args.change);
|
|
49
|
+
|
|
50
|
+
if (performCallback) {
|
|
51
|
+
performCallback();
|
|
52
|
+
}
|
|
53
|
+
} catch {
|
|
54
|
+
alert('Please specify a valid handler in the "change" control.');
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
setup: () => ({ args }),
|
|
59
|
+
template: `<TideInputSelect @change="handleChange" v-bind="args" />`,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
argTypes: {
|
|
64
|
+
change,
|
|
65
|
+
dataTrack,
|
|
66
|
+
disabled: {
|
|
67
|
+
...argTypeBooleanUnrequired,
|
|
68
|
+
description: 'Determines whether Select is interactable',
|
|
69
|
+
},
|
|
70
|
+
error: {
|
|
71
|
+
...argTypeBooleanUnrequired,
|
|
72
|
+
description: 'Reflects whether the Select value is valid',
|
|
73
|
+
},
|
|
74
|
+
inputId: {
|
|
75
|
+
control: 'text',
|
|
76
|
+
description: 'Unique ID attribute<br />(to bind Select label to input)',
|
|
77
|
+
table: {
|
|
78
|
+
defaultValue: { summary: 'None' },
|
|
79
|
+
type: { summary: 'string' },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
label: {
|
|
83
|
+
control: 'text',
|
|
84
|
+
description: 'Label content',
|
|
85
|
+
table: {
|
|
86
|
+
defaultValue: { summary: 'None' },
|
|
87
|
+
type: { summary: 'string' },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
options: {
|
|
91
|
+
...formatArgType({ selectOptions }),
|
|
92
|
+
control: 'object',
|
|
93
|
+
description: 'Determines values found inside Select',
|
|
94
|
+
isCustom: true,
|
|
95
|
+
table: {
|
|
96
|
+
defaultValue: { summary: '[]' },
|
|
97
|
+
type: { summary: 'SelectOption[]' },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: {
|
|
101
|
+
...argTypeBooleanUnrequired,
|
|
102
|
+
description: 'Determines whether Select is required',
|
|
103
|
+
},
|
|
104
|
+
supportingText: {
|
|
105
|
+
control: 'text',
|
|
106
|
+
description: 'Explainer text beneath input',
|
|
107
|
+
table: {
|
|
108
|
+
defaultValue: { summary: 'None' },
|
|
109
|
+
type: { summary: 'string' },
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
value: {
|
|
113
|
+
control: {
|
|
114
|
+
labels: getLabelsFromOptions(options),
|
|
115
|
+
type: 'select',
|
|
116
|
+
},
|
|
117
|
+
description: 'Determines which tab should be active by default<br />(Subsequently managed within component)',
|
|
118
|
+
options: Object.values(options),
|
|
119
|
+
table: {
|
|
120
|
+
defaultValue: { summary: 'None' },
|
|
121
|
+
type: { summary: 'SelectOption' },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
args: {
|
|
126
|
+
change: 'doSomething',
|
|
127
|
+
dataTrack: '',
|
|
128
|
+
disabled: undefined,
|
|
129
|
+
error: undefined,
|
|
130
|
+
inputId: '',
|
|
131
|
+
label: 'Input label',
|
|
132
|
+
name: '',
|
|
133
|
+
options: selectOptions,
|
|
134
|
+
required: undefined,
|
|
135
|
+
supportingText: '',
|
|
136
|
+
value: undefined,
|
|
137
|
+
},
|
|
138
|
+
component: TideInputSelect,
|
|
139
|
+
parameters,
|
|
140
|
+
render,
|
|
141
|
+
tags: ['autodocs'],
|
|
142
|
+
title: 'Basic Components/TideInputSelect',
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const Demo = {};
|