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,53 @@
|
|
|
1
|
+
import { parameters, argTypeBooleanUnrequired } from '@/utilities/storybook';
|
|
2
|
+
import TideBackgroundImage from '@/components/TideBackgroundImage.vue';
|
|
3
|
+
|
|
4
|
+
const render = (args: any) => ({
|
|
5
|
+
components: { TideBackgroundImage },
|
|
6
|
+
setup() {
|
|
7
|
+
return { args };
|
|
8
|
+
},
|
|
9
|
+
template: `
|
|
10
|
+
<TideBackgroundImage v-bind="args">
|
|
11
|
+
<div class="tide-padding-4 tide-font-700 tide-font-20">
|
|
12
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque est nibh, convallis vel aliquam non, elementum a lorem.
|
|
13
|
+
</div>
|
|
14
|
+
</TideBackgroundImage>
|
|
15
|
+
`,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
argTypes: {
|
|
20
|
+
alt: {
|
|
21
|
+
control: 'text',
|
|
22
|
+
description: 'Button text',
|
|
23
|
+
table: {
|
|
24
|
+
defaultValue: { summary: 'None' },
|
|
25
|
+
type: { summary: 'string' },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
isLazy: {
|
|
29
|
+
...argTypeBooleanUnrequired,
|
|
30
|
+
description: 'Determines if the image should be lazy-loaded',
|
|
31
|
+
},
|
|
32
|
+
src: {
|
|
33
|
+
control: 'text',
|
|
34
|
+
description: 'Source URL for the background image',
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: { summary: 'None' },
|
|
37
|
+
type: { summary: 'string' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
args: {
|
|
42
|
+
alt: '',
|
|
43
|
+
isLazy: true,
|
|
44
|
+
src: 'https://placedog.net/500/400',
|
|
45
|
+
},
|
|
46
|
+
component: TideBackgroundImage,
|
|
47
|
+
parameters,
|
|
48
|
+
render,
|
|
49
|
+
tags: ['autodocs'],
|
|
50
|
+
title: 'Basic Components/TideBackgroundImage',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Demo = {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import TideBadge from '@/components/TideBadge.vue';
|
|
2
|
+
import { parameters } from '@/utilities/storybook';
|
|
3
|
+
|
|
4
|
+
const render = (args: any) => ({
|
|
5
|
+
components: { TideBadge },
|
|
6
|
+
setup: () => ({ args }),
|
|
7
|
+
template: `<TideBadge class="tide-shadow-bottom" v-bind="args" />`,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
argTypes: {
|
|
12
|
+
label: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
description: 'Badge text',
|
|
15
|
+
table: {
|
|
16
|
+
defaultValue: { summary: 'None' },
|
|
17
|
+
type: { summary: 'string' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
label: 'Demo',
|
|
23
|
+
},
|
|
24
|
+
component: TideBadge,
|
|
25
|
+
parameters,
|
|
26
|
+
render,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
title: 'Basic Components/TideBadge',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Demo = {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import TideBadgePremium from '@/components/TideBadgePremium.vue';
|
|
2
|
+
import { BADGE_PREMIUM } from '@/types/Badge';
|
|
3
|
+
import { formatArgType, parameters } from '@/utilities/storybook';
|
|
4
|
+
|
|
5
|
+
const render = (args: any) => ({
|
|
6
|
+
components: { TideBadgePremium },
|
|
7
|
+
setup: () => ({ args }),
|
|
8
|
+
template: `<TideBadgePremium v-bind="args" />`,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
argTypes: {
|
|
13
|
+
label: {
|
|
14
|
+
...formatArgType({ BADGE_PREMIUM }),
|
|
15
|
+
description: 'Badge text',
|
|
16
|
+
table: {
|
|
17
|
+
defaultValue: { summary: 'Premium' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
label: BADGE_PREMIUM.PREMIUM,
|
|
23
|
+
},
|
|
24
|
+
component: TideBadgePremium,
|
|
25
|
+
parameters,
|
|
26
|
+
render,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
title: 'Basic Components/TideBadgePremium',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Demo = {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as STANDARD_BADGE from '@/types/Storybook';
|
|
2
|
+
import TideBadgeTrustedPartner from '@/components/TideBadgeTrustedPartner.vue';
|
|
3
|
+
import { formatArgType, parameters, prependNoneAsUndefined } from '@/utilities/storybook';
|
|
4
|
+
|
|
5
|
+
const BADGE_TRUSTED = prependNoneAsUndefined(STANDARD_BADGE.BADGE_TRUSTED);
|
|
6
|
+
|
|
7
|
+
const render = (args: any) => ({
|
|
8
|
+
components: { TideBadgeTrustedPartner },
|
|
9
|
+
setup: () => ({ args }),
|
|
10
|
+
template: `<TideBadgeTrustedPartner v-bind="args" />`,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
argTypes: {
|
|
15
|
+
years: {
|
|
16
|
+
...formatArgType({ BADGE_TRUSTED }),
|
|
17
|
+
description: 'Badge text',
|
|
18
|
+
table: {
|
|
19
|
+
defaultValue: { summary: BADGE_TRUSTED.YEARS_5 },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
years: undefined,
|
|
25
|
+
},
|
|
26
|
+
component: TideBadgeTrustedPartner,
|
|
27
|
+
parameters,
|
|
28
|
+
render,
|
|
29
|
+
tags: ['autodocs'],
|
|
30
|
+
title: 'Basic Components/TideBadgeTrustedPartner',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Demo = {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BreadCrumb } from '@/types/BreadCrumb';
|
|
2
|
+
|
|
3
|
+
import TideBreadCrumbs from '@/components/TideBreadCrumbs.vue';
|
|
4
|
+
import { parameters } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const breadCrumbs: BreadCrumb[] = [
|
|
7
|
+
{
|
|
8
|
+
dataTrack: 'Home Bread Crumb Click',
|
|
9
|
+
label: 'Home',
|
|
10
|
+
url: '/',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
dataTrack: 'SRP Bread Crumb Click',
|
|
14
|
+
label: 'Search results',
|
|
15
|
+
url: '/rvs-for-sale',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: 'Vehicle details',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
argTypes: {
|
|
24
|
+
breadCrumbs: {
|
|
25
|
+
control: 'object',
|
|
26
|
+
description: 'Determines label and optional URL for each bread crumb',
|
|
27
|
+
isCustom: true,
|
|
28
|
+
table: {
|
|
29
|
+
defaultValue: { summary: '[]' },
|
|
30
|
+
type: { summary: 'BreadCrumb[]' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
breadCrumbs: breadCrumbs,
|
|
36
|
+
},
|
|
37
|
+
component: TideBreadCrumbs,
|
|
38
|
+
parameters,
|
|
39
|
+
tags: ['autodocs'],
|
|
40
|
+
title: 'Basic Components/TideBreadCrumbs',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Demo = {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import * as STANDARD_ELEMENT from '@/types/Element';
|
|
4
|
+
import * as STANDARD_ICON from '@/types/Icon';
|
|
5
|
+
import * as STANDARD_PRIORITY from '@/types/Priority';
|
|
6
|
+
import TideButton from '@/components/TideButton.vue';
|
|
7
|
+
import {
|
|
8
|
+
argTypeBooleanUnrequired,
|
|
9
|
+
click,
|
|
10
|
+
dataTrack,
|
|
11
|
+
doSomething,
|
|
12
|
+
formatArgType,
|
|
13
|
+
parameters,
|
|
14
|
+
prependNoneAsUndefined,
|
|
15
|
+
} from '@/utilities/storybook';
|
|
16
|
+
|
|
17
|
+
const ELEMENT = prependNoneAsUndefined(STANDARD_ELEMENT.ELEMENT);
|
|
18
|
+
const ICON = prependNoneAsUndefined(STANDARD_ICON.ICON);
|
|
19
|
+
const PRIORITY = prependNoneAsUndefined(STANDARD_PRIORITY.PRIORITY);
|
|
20
|
+
|
|
21
|
+
const render = (args: any) => ({
|
|
22
|
+
components: { TideButton },
|
|
23
|
+
methods: {
|
|
24
|
+
doSomething,
|
|
25
|
+
handleClick: (event: Event) => {
|
|
26
|
+
action('TideButton clicked')(event);
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
const buttonClick = eval(args.click);
|
|
30
|
+
|
|
31
|
+
if (buttonClick) {
|
|
32
|
+
buttonClick();
|
|
33
|
+
}
|
|
34
|
+
} catch {
|
|
35
|
+
alert('Please specify a valid handler in the "click" control.');
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
setup: () => ({ args }),
|
|
40
|
+
template: `<TideButton @click="handleClick" v-bind="args" />`,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
argTypes: {
|
|
45
|
+
click: {
|
|
46
|
+
...click,
|
|
47
|
+
if: { arg: 'element', neq: ELEMENT.LINK },
|
|
48
|
+
},
|
|
49
|
+
dataTrack,
|
|
50
|
+
disabled: {
|
|
51
|
+
...argTypeBooleanUnrequired,
|
|
52
|
+
description: 'Determines clickability<br />(Button only)',
|
|
53
|
+
if: { arg: 'element', neq: ELEMENT.LINK },
|
|
54
|
+
},
|
|
55
|
+
element: {
|
|
56
|
+
...formatArgType({ ELEMENT }),
|
|
57
|
+
description: 'HTML tag type',
|
|
58
|
+
table: {
|
|
59
|
+
defaultValue: { summary: 'BUTTON' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
href: {
|
|
63
|
+
description: 'URL to open<br />(Link only)',
|
|
64
|
+
if: { arg: 'element', eq: ELEMENT.LINK },
|
|
65
|
+
table: {
|
|
66
|
+
defaultValue: { summary: 'None' },
|
|
67
|
+
type: { summary: 'string' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
iconLeading: {
|
|
71
|
+
...formatArgType({ ICON }),
|
|
72
|
+
description: 'Icon to left of label',
|
|
73
|
+
},
|
|
74
|
+
iconTrailing: {
|
|
75
|
+
...formatArgType({ ICON }),
|
|
76
|
+
description: 'Icon to right of label',
|
|
77
|
+
},
|
|
78
|
+
isNewTab: {
|
|
79
|
+
...argTypeBooleanUnrequired,
|
|
80
|
+
description: 'Determines whether to target a new browser tab<br />(Link only)',
|
|
81
|
+
if: { arg: 'element', eq: ELEMENT.LINK },
|
|
82
|
+
},
|
|
83
|
+
label: {
|
|
84
|
+
control: 'text',
|
|
85
|
+
description: 'Button text',
|
|
86
|
+
table: {
|
|
87
|
+
defaultValue: { summary: 'None' },
|
|
88
|
+
type: { summary: 'string' },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
priority: {
|
|
92
|
+
...formatArgType({ PRIORITY }),
|
|
93
|
+
description: 'Determines visual prominence',
|
|
94
|
+
table: {
|
|
95
|
+
defaultValue: { summary: 'PRIMARY' },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
args: {
|
|
100
|
+
click: 'doSomething',
|
|
101
|
+
dataTrack: '',
|
|
102
|
+
disabled: undefined,
|
|
103
|
+
element: undefined,
|
|
104
|
+
href: 'https://www.sample.com',
|
|
105
|
+
iconLeading: undefined,
|
|
106
|
+
iconTrailing: undefined,
|
|
107
|
+
isNewTab: undefined,
|
|
108
|
+
label: 'Demo',
|
|
109
|
+
priority: undefined,
|
|
110
|
+
},
|
|
111
|
+
component: TideButton,
|
|
112
|
+
parameters,
|
|
113
|
+
render,
|
|
114
|
+
tags: ['autodocs'],
|
|
115
|
+
title: 'Basic Components/TideButton',
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const Demo = {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import * as STANDARD_ELEMENT from '@/types/Element';
|
|
4
|
+
import * as STANDARD_PRIORITY from '@/types/Priority';
|
|
5
|
+
import TideButtonIcon from '@/components/TideButtonIcon.vue';
|
|
6
|
+
import { ICON } from '@/types/Icon';
|
|
7
|
+
import {
|
|
8
|
+
argTypeBooleanUnrequired,
|
|
9
|
+
click,
|
|
10
|
+
dataTrack,
|
|
11
|
+
doSomething,
|
|
12
|
+
formatArgType,
|
|
13
|
+
parameters,
|
|
14
|
+
prependNoneAsUndefined,
|
|
15
|
+
} from '@/utilities/storybook';
|
|
16
|
+
|
|
17
|
+
const ELEMENT = prependNoneAsUndefined(STANDARD_ELEMENT.ELEMENT);
|
|
18
|
+
const PRIORITY = prependNoneAsUndefined(STANDARD_PRIORITY.PRIORITY);
|
|
19
|
+
|
|
20
|
+
const render = (args: any) => ({
|
|
21
|
+
components: { TideButtonIcon },
|
|
22
|
+
methods: {
|
|
23
|
+
doSomething,
|
|
24
|
+
handleClick: (event: Event) => {
|
|
25
|
+
action('TideButtonIcon clicked')(event);
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const buttonClick = eval(args.click);
|
|
29
|
+
|
|
30
|
+
if (buttonClick) {
|
|
31
|
+
buttonClick();
|
|
32
|
+
}
|
|
33
|
+
} catch {
|
|
34
|
+
alert('Please specify a valid handler in the "click" control.');
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
setup: () => ({ args }),
|
|
39
|
+
template: '<TideButtonIcon @click="handleClick" class="tide-display-inline-block" v-bind="args" />',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
argTypes: {
|
|
44
|
+
click: {
|
|
45
|
+
...click,
|
|
46
|
+
if: { arg: 'element', neq: ELEMENT.LINK },
|
|
47
|
+
},
|
|
48
|
+
dataTrack,
|
|
49
|
+
disabled: {
|
|
50
|
+
...argTypeBooleanUnrequired,
|
|
51
|
+
description: 'Determines clickability<br />(Button only)',
|
|
52
|
+
if: { arg: 'element', neq: ELEMENT.LINK },
|
|
53
|
+
},
|
|
54
|
+
element: {
|
|
55
|
+
...formatArgType({ ELEMENT }),
|
|
56
|
+
description: 'HTML tag type',
|
|
57
|
+
table: {
|
|
58
|
+
defaultValue: { summary: 'BUTTON' },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
href: {
|
|
62
|
+
description: 'URL to open<br />(Link only)',
|
|
63
|
+
if: { arg: 'element', eq: ELEMENT.LINK },
|
|
64
|
+
table: {
|
|
65
|
+
defaultValue: { summary: 'None' },
|
|
66
|
+
type: { summary: 'string' },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
icon: {
|
|
70
|
+
...formatArgType({ ICON }),
|
|
71
|
+
description: 'Icon',
|
|
72
|
+
},
|
|
73
|
+
isNewTab: {
|
|
74
|
+
...argTypeBooleanUnrequired,
|
|
75
|
+
description: 'Determines whether to target a new browser tab<br />(Link only)',
|
|
76
|
+
if: { arg: 'element', eq: ELEMENT.LINK },
|
|
77
|
+
},
|
|
78
|
+
priority: {
|
|
79
|
+
...formatArgType({ PRIORITY }),
|
|
80
|
+
description: 'Determines visual prominence',
|
|
81
|
+
table: {
|
|
82
|
+
defaultValue: { summary: 'PRIMARY' },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
args: {
|
|
87
|
+
click: 'doSomething',
|
|
88
|
+
dataTrack: '',
|
|
89
|
+
disabled: undefined,
|
|
90
|
+
element: undefined,
|
|
91
|
+
href: 'https://www.sample.com',
|
|
92
|
+
icon: ICON.MAIL,
|
|
93
|
+
isNewTab: undefined,
|
|
94
|
+
priority: undefined,
|
|
95
|
+
},
|
|
96
|
+
component: TideButtonIcon,
|
|
97
|
+
parameters,
|
|
98
|
+
render,
|
|
99
|
+
tags: ['autodocs'],
|
|
100
|
+
title: 'Basic Components/TideButtonIcon',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const Demo = {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import * as STANDARD_ELEMENT from '@/types/Element';
|
|
4
|
+
import TideButtonPagination from '@/components/TideButtonPagination.vue';
|
|
5
|
+
import {
|
|
6
|
+
argTypeBooleanUnrequired,
|
|
7
|
+
click,
|
|
8
|
+
dataTrack,
|
|
9
|
+
doSomething,
|
|
10
|
+
formatArgType,
|
|
11
|
+
parameters,
|
|
12
|
+
prependNoneAsUndefined,
|
|
13
|
+
} from '@/utilities/storybook';
|
|
14
|
+
|
|
15
|
+
const ELEMENT_TEXT_AS_ICON = prependNoneAsUndefined(STANDARD_ELEMENT.ELEMENT_TEXT_AS_ICON);
|
|
16
|
+
|
|
17
|
+
const render = (args: any) => ({
|
|
18
|
+
components: { TideButtonPagination },
|
|
19
|
+
methods: {
|
|
20
|
+
doSomething,
|
|
21
|
+
handleClick: (event: Event) => {
|
|
22
|
+
action('TideButtonPagination clicked')(event);
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const buttonClick = eval(args.click);
|
|
26
|
+
|
|
27
|
+
if (buttonClick) {
|
|
28
|
+
buttonClick();
|
|
29
|
+
}
|
|
30
|
+
} catch {
|
|
31
|
+
alert('Please specify a valid handler in the "click" control.');
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
setup: () => ({ args }),
|
|
36
|
+
template: `<TideButtonPagination @click="handleClick" v-bind="args" />`,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
argTypes: {
|
|
41
|
+
click: {
|
|
42
|
+
...click,
|
|
43
|
+
if: { arg: 'element', neq: ELEMENT_TEXT_AS_ICON.LINK },
|
|
44
|
+
},
|
|
45
|
+
dataTrack,
|
|
46
|
+
disabled: {
|
|
47
|
+
...argTypeBooleanUnrequired,
|
|
48
|
+
description: 'Indicates whether Pagination Button is associated with the displayed page',
|
|
49
|
+
if: {
|
|
50
|
+
arg: 'element',
|
|
51
|
+
eq: ELEMENT_TEXT_AS_ICON.BUTTON,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
element: {
|
|
55
|
+
...formatArgType({ ELEMENT_TEXT_AS_ICON }),
|
|
56
|
+
description: 'HTML tag type',
|
|
57
|
+
table: {
|
|
58
|
+
defaultValue: { summary: 'BUTTON' },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
href: {
|
|
62
|
+
description: 'URL to open<br />(Link only)',
|
|
63
|
+
if: { arg: 'element', eq: ELEMENT_TEXT_AS_ICON.LINK },
|
|
64
|
+
table: {
|
|
65
|
+
defaultValue: { summary: 'None' },
|
|
66
|
+
type: { summary: 'string' },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
isNewTab: {
|
|
70
|
+
...argTypeBooleanUnrequired,
|
|
71
|
+
description: 'Determines whether to target a new browser tab<br />(Link only)',
|
|
72
|
+
if: { arg: 'element', eq: ELEMENT_TEXT_AS_ICON.LINK },
|
|
73
|
+
},
|
|
74
|
+
label: {
|
|
75
|
+
control: 'text',
|
|
76
|
+
description: 'Button text',
|
|
77
|
+
table: {
|
|
78
|
+
defaultValue: { summary: 'None' },
|
|
79
|
+
type: { summary: 'string' },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
args: {
|
|
84
|
+
click: 'doSomething',
|
|
85
|
+
dataTrack: '',
|
|
86
|
+
disabled: undefined,
|
|
87
|
+
element: undefined,
|
|
88
|
+
href: 'https://www.sample.com',
|
|
89
|
+
isNewTab: undefined,
|
|
90
|
+
label: '1',
|
|
91
|
+
},
|
|
92
|
+
component: TideButtonPagination,
|
|
93
|
+
parameters,
|
|
94
|
+
render,
|
|
95
|
+
tags: ['autodocs'],
|
|
96
|
+
title: 'Basic Components/TideButtonPagination',
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const Demo = {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import TideCard from '@/components/TideCard.vue';
|
|
2
|
+
import { dataTrack, parameters } from '@/utilities/storybook';
|
|
3
|
+
|
|
4
|
+
const render = (args: any) => ({
|
|
5
|
+
components: { TideCard },
|
|
6
|
+
setup: () => ({ args }),
|
|
7
|
+
template: `<TideCard class="tide-display-inline-block tide-padding-1">{{ args.default }}</TideCard>`,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
argTypes: {
|
|
12
|
+
class: {
|
|
13
|
+
table: {
|
|
14
|
+
disable: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
dataTrack,
|
|
18
|
+
default: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
description: 'Card content',
|
|
21
|
+
table: {
|
|
22
|
+
defaultValue: { summary: 'None' },
|
|
23
|
+
type: { summary: 'HTML' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
dataTrack: '',
|
|
29
|
+
default: 'Demo',
|
|
30
|
+
},
|
|
31
|
+
component: TideCard,
|
|
32
|
+
parameters,
|
|
33
|
+
render,
|
|
34
|
+
tags: ['autodocs'],
|
|
35
|
+
title: 'Basic Components/TideCard',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Demo = {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
|
|
3
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
4
|
+
|
|
5
|
+
import TideCard from '@/components/TideCard.vue';
|
|
6
|
+
import TideCarousel from '@/components/TideCarousel.vue';
|
|
7
|
+
import { argTypeBooleanUnrequired, change, disabledArgType, doSomething, lineBreak, tab } from '@/utilities/storybook';
|
|
8
|
+
|
|
9
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
10
|
+
const { args } = context;
|
|
11
|
+
|
|
12
|
+
const argsWithValues: string[] = [];
|
|
13
|
+
|
|
14
|
+
if (args.isTouchscreen !== undefined) argsWithValues.push(`:is-touchscreen="${args.isTouchscreen}"`);
|
|
15
|
+
if (args.offsetX) argsWithValues.push(`:offset-x="${args.offsetX}"`);
|
|
16
|
+
if (args.handleEmit) argsWithValues.push(`@change"${args.handleEmit}"`);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
`<TideCarousel ${argsWithValues.join(' ')}>${lineBreak}` +
|
|
20
|
+
`${tab}<li${lineBreak}` +
|
|
21
|
+
`${tab}${tab}:class="tide-shrink-none${args.hasPadding ? ' tide-padding-y-1' : ''}"${lineBreak}` +
|
|
22
|
+
`${tab}${tab}v-for="(_child, index) in new Array(12)"${lineBreak}` +
|
|
23
|
+
`${tab}>${lineBreak}` +
|
|
24
|
+
`${tab}${tab}<TideCard class="tide-padding-1">Card {{ index + 1 }}</TideCard>${lineBreak}` +
|
|
25
|
+
`${tab}</li>${lineBreak}` +
|
|
26
|
+
`</TideCarousel>`
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const parameters = {
|
|
31
|
+
docs: {
|
|
32
|
+
source: {
|
|
33
|
+
format: 'vue',
|
|
34
|
+
language: 'html',
|
|
35
|
+
transform: formatSnippet,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const render = (args: any) => ({
|
|
41
|
+
components: { TideCard, TideCarousel },
|
|
42
|
+
methods: {
|
|
43
|
+
doSomething,
|
|
44
|
+
handleEmit: (index: number) => {
|
|
45
|
+
action(`Current slide ${index}`)({ index });
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const performCallback = eval(args.handleEmit);
|
|
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: `<TideCarousel @change="handleEmit" v-bind="args"><li v-for="(_child, index) in new Array(12)" :class="['tide-shrink-none', args.hasPadding ? ' tide-padding-y-1' : '']"><TideCard class="tide-padding-1">Card {{ index + 1 }}</TideCard></li></TideCarousel>`,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
argTypes: {
|
|
64
|
+
change: disabledArgType,
|
|
65
|
+
default: {
|
|
66
|
+
table: {
|
|
67
|
+
disable: true,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
handleEmit: {
|
|
71
|
+
...change,
|
|
72
|
+
table: {
|
|
73
|
+
defaultValue: { summary: 'None' },
|
|
74
|
+
type: { summary: '(event: Event, currentSlide: number) => void' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
// TODO: adapt via formatSnippet
|
|
78
|
+
hasPadding: {
|
|
79
|
+
control: 'boolean',
|
|
80
|
+
description: 'Demonstrates the box shadow',
|
|
81
|
+
name: 'Has Padding',
|
|
82
|
+
table: {
|
|
83
|
+
defaultValue: { summary: 'False' },
|
|
84
|
+
type: { summary: 'boolean' },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
isTouchscreen: {
|
|
88
|
+
...argTypeBooleanUnrequired,
|
|
89
|
+
description: 'Determines button and/or swipe control scheme<br />(Use reference to ViewportStore)',
|
|
90
|
+
table: {
|
|
91
|
+
defaultValue: { summary: 'None' },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
offsetX: {
|
|
95
|
+
control: {
|
|
96
|
+
max: 72,
|
|
97
|
+
min: 0,
|
|
98
|
+
step: 24,
|
|
99
|
+
type: 'number',
|
|
100
|
+
},
|
|
101
|
+
description: 'Determines horizontal spacing around Carousel content',
|
|
102
|
+
table: {
|
|
103
|
+
defaultValue: { summary: 'None' },
|
|
104
|
+
type: { summary: 'number (px)' },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
slideChange: {
|
|
108
|
+
control: 'text',
|
|
109
|
+
description: 'JS function to execute when current slide is updated',
|
|
110
|
+
table: {
|
|
111
|
+
defaultValue: { summary: 'None' },
|
|
112
|
+
type: { summary: '(event: Event, slideIndex: number) => void' },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
args: {
|
|
117
|
+
handleEmit: 'doSomething',
|
|
118
|
+
hasPadding: false,
|
|
119
|
+
isTouchscreen: undefined,
|
|
120
|
+
offsetX: 0,
|
|
121
|
+
slideChange: 'doSomething',
|
|
122
|
+
},
|
|
123
|
+
component: TideCarousel,
|
|
124
|
+
parameters,
|
|
125
|
+
render,
|
|
126
|
+
tags: ['autodocs'],
|
|
127
|
+
title: 'Basic Components/TideCarousel',
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const Demo = {};
|