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,155 @@
|
|
|
1
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import * as STYLES from '@/types/Storybook';
|
|
4
|
+
import { CSS } from '@/types/Styles';
|
|
5
|
+
import { formatArgType, getConstantsByValues, prependNoneAsEmpty } from '@/utilities/storybook';
|
|
6
|
+
|
|
7
|
+
const MARGIN = prependNoneAsEmpty(STYLES.MARGIN);
|
|
8
|
+
|
|
9
|
+
const formatArgs = (args: any) => {
|
|
10
|
+
args.class = formatClassNames(args).join(' ');
|
|
11
|
+
args.style = formatStyles(args);
|
|
12
|
+
|
|
13
|
+
return { args };
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const formatClassNames = (args: any) => {
|
|
17
|
+
const classNames: string[] = [];
|
|
18
|
+
const hasMarginAuto = getHasMarginAuto(args);
|
|
19
|
+
|
|
20
|
+
if (hasMarginAuto) classNames.push(CSS.DISPLAY.FLEX, CSS.AXIS1.CENTER, CSS.AXIS2.CENTER);
|
|
21
|
+
if (args.margin) classNames.push(args.margin);
|
|
22
|
+
|
|
23
|
+
return classNames;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const formatClassNamesSnippet = (args: any) => {
|
|
27
|
+
const classNames = formatClassNames(args);
|
|
28
|
+
|
|
29
|
+
return getConstantsByValues(classNames);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
33
|
+
const { args } = context;
|
|
34
|
+
const styles = formatStyles(args);
|
|
35
|
+
const styleAttribute = styles ? ` style="${styles}"` : '';
|
|
36
|
+
const classNames = formatClassNamesSnippet(args);
|
|
37
|
+
|
|
38
|
+
return classNames.length
|
|
39
|
+
? `<div :class="[${classNames.join(', ')}]"${styleAttribute}>Demo</div>`
|
|
40
|
+
: `<div${styleAttribute}>Demo</div>`;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const formatStyles = (args: any) => {
|
|
44
|
+
const styles: string[] = [];
|
|
45
|
+
const hasMarginAuto = getHasMarginAuto(args);
|
|
46
|
+
|
|
47
|
+
if (hasMarginAuto) {
|
|
48
|
+
styles.push(`width: ${args.width ? args.width : '100'}px;`);
|
|
49
|
+
styles.push('height: 100px;');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return styles.length > 0 ? styles.join(' ') : null;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const getHasMarginAuto = (args: any) =>
|
|
56
|
+
[MARGIN['X-axis Auto'], MARGIN['Left Auto'], MARGIN['Right Auto']].includes(args.margin);
|
|
57
|
+
|
|
58
|
+
const getContainerClass = (args: any) => (getHasMarginAuto(args) ? '' : CSS.DISPLAY.INLINE_BLOCK);
|
|
59
|
+
|
|
60
|
+
const parameters = {
|
|
61
|
+
docs: {
|
|
62
|
+
source: {
|
|
63
|
+
format: false,
|
|
64
|
+
language: 'html',
|
|
65
|
+
transform: formatSnippet,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const render = (args: any) => ({
|
|
71
|
+
methods: {
|
|
72
|
+
getContainerClass,
|
|
73
|
+
},
|
|
74
|
+
setup() {
|
|
75
|
+
return formatArgs(args);
|
|
76
|
+
},
|
|
77
|
+
template: `<div :class="getContainerClass(args)" class="sb-bg-blue-light"><div class="tide-border-1 tide-padding-1 sb-bg-white sb-bg-white" v-bind="args">Demo</div></div>`,
|
|
78
|
+
updated() {
|
|
79
|
+
return formatArgs(args);
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export default {
|
|
84
|
+
argTypes: {
|
|
85
|
+
margin: {
|
|
86
|
+
...formatArgType({ MARGIN }),
|
|
87
|
+
description: 'Applies a margin',
|
|
88
|
+
name: 'Margin',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
args: {
|
|
92
|
+
margin: MARGIN.None,
|
|
93
|
+
},
|
|
94
|
+
parameters,
|
|
95
|
+
render,
|
|
96
|
+
tags: ['autodocs'],
|
|
97
|
+
title: 'Foundations/Margin',
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const MarginDefault = {
|
|
101
|
+
name: 'Default',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const Margin4 = {
|
|
105
|
+
args: {
|
|
106
|
+
margin: MARGIN['Full 4 REM'],
|
|
107
|
+
},
|
|
108
|
+
name: 'Margin 4 REM',
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const Margin2 = {
|
|
112
|
+
args: {
|
|
113
|
+
margin: MARGIN['Full 2 REM'],
|
|
114
|
+
},
|
|
115
|
+
name: 'Margin 2 REM',
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const Margin1 = {
|
|
119
|
+
args: {
|
|
120
|
+
margin: MARGIN['Full 1 REM'],
|
|
121
|
+
},
|
|
122
|
+
name: 'Margin 1 REM',
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const MarginHalf = {
|
|
126
|
+
args: {
|
|
127
|
+
margin: MARGIN['Full 0.5 REM'],
|
|
128
|
+
},
|
|
129
|
+
name: 'Margin 0.5 REM',
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const MarginQuarter = {
|
|
133
|
+
args: {
|
|
134
|
+
margin: MARGIN['Full 0.25 REM'],
|
|
135
|
+
},
|
|
136
|
+
name: 'Margin 0.25 REM',
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const MarginRightAuto = {
|
|
140
|
+
args: {
|
|
141
|
+
margin: MARGIN['Right Auto'],
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const MarginLeftAuto = {
|
|
146
|
+
args: {
|
|
147
|
+
margin: MARGIN['Left Auto'],
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const MarginXAuto = {
|
|
152
|
+
args: {
|
|
153
|
+
margin: MARGIN['X-axis Auto'],
|
|
154
|
+
},
|
|
155
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import * as STYLES from '@/types/Storybook';
|
|
4
|
+
import { formatArgType, getConstantsByValues, prependNoneAsEmpty } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const PADDING = prependNoneAsEmpty(STYLES.PADDING);
|
|
7
|
+
|
|
8
|
+
const formatArgs = (args: any) => {
|
|
9
|
+
args.class = formatClassNames(args).join(' ');
|
|
10
|
+
|
|
11
|
+
return { args };
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const formatClassNames = (args: any) => {
|
|
15
|
+
const classNames: string[] = [];
|
|
16
|
+
|
|
17
|
+
if (args.padding) classNames.push(args.padding);
|
|
18
|
+
|
|
19
|
+
return classNames;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const formatClassNamesSnippet = (args: any) => {
|
|
23
|
+
const classNames = formatClassNames(args);
|
|
24
|
+
|
|
25
|
+
return getConstantsByValues(classNames);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
29
|
+
const { args } = context;
|
|
30
|
+
const classNames = formatClassNamesSnippet(args);
|
|
31
|
+
|
|
32
|
+
return classNames.length ? `<div :class="[${classNames.join(', ')}]">Demo</div>` : '<div>Demo</div>';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const parameters = {
|
|
36
|
+
docs: {
|
|
37
|
+
source: {
|
|
38
|
+
format: false,
|
|
39
|
+
language: 'html',
|
|
40
|
+
transform: formatSnippet,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const render = (args: any) => ({
|
|
46
|
+
setup() {
|
|
47
|
+
return formatArgs(args);
|
|
48
|
+
},
|
|
49
|
+
template:
|
|
50
|
+
'<div class="tide-display-inline-block tide-border-1 sb-bg-blue-light" v-bind="args"><div class="tide-padding-1 sb-bg-white">Demo</div></div>',
|
|
51
|
+
updated() {
|
|
52
|
+
return formatArgs(args);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
argTypes: {
|
|
58
|
+
padding: {
|
|
59
|
+
...formatArgType({ PADDING }),
|
|
60
|
+
description: 'Applies padding',
|
|
61
|
+
name: 'Padding',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
args: {
|
|
65
|
+
padding: PADDING.None,
|
|
66
|
+
},
|
|
67
|
+
parameters,
|
|
68
|
+
render,
|
|
69
|
+
tags: ['autodocs'],
|
|
70
|
+
title: 'Foundations/Padding',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const Default = {};
|
|
74
|
+
|
|
75
|
+
export const Padding4 = {
|
|
76
|
+
args: {
|
|
77
|
+
padding: PADDING['Full 4 REM'],
|
|
78
|
+
},
|
|
79
|
+
name: 'Padding 4 REM',
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const Padding2 = {
|
|
83
|
+
args: {
|
|
84
|
+
padding: PADDING['Full 2 REM'],
|
|
85
|
+
},
|
|
86
|
+
name: 'Padding 2 REM',
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const Padding1 = {
|
|
90
|
+
args: {
|
|
91
|
+
padding: PADDING['Full 1 REM'],
|
|
92
|
+
},
|
|
93
|
+
name: 'Padding 1 REM',
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const PaddingHalf = {
|
|
97
|
+
args: {
|
|
98
|
+
padding: PADDING['Full 0.5 REM'],
|
|
99
|
+
},
|
|
100
|
+
name: 'Padding 0.5 REM',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const PaddingQuarter = {
|
|
104
|
+
args: {
|
|
105
|
+
padding: PADDING['Full 0.25 REM'],
|
|
106
|
+
},
|
|
107
|
+
name: 'Padding 0.25 REM',
|
|
108
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import * as STYLES from '@/types/Storybook';
|
|
4
|
+
import { formatArgType, getConstantsByValues, prependNoneAsEmpty } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const SHADOW = prependNoneAsEmpty(STYLES.SHADOW);
|
|
7
|
+
|
|
8
|
+
const formatArgs = (args: any) => {
|
|
9
|
+
args.class = formatClassNames(args).join(' ');
|
|
10
|
+
|
|
11
|
+
return { args };
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const formatClassNames = (args: any) => {
|
|
15
|
+
const classNames: string[] = [];
|
|
16
|
+
|
|
17
|
+
if (args.shadow) classNames.push(args.shadow);
|
|
18
|
+
|
|
19
|
+
return classNames;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const formatClassNamesSnippet = (args: any) => {
|
|
23
|
+
const classNames = formatClassNames(args);
|
|
24
|
+
|
|
25
|
+
return getConstantsByValues(classNames);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
29
|
+
const { args } = context;
|
|
30
|
+
const classNames = formatClassNamesSnippet(args);
|
|
31
|
+
|
|
32
|
+
return classNames.length ? `<div :class="[${classNames.join(', ')}]">Demo</div>` : '<div>Demo</div>';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const parameters = {
|
|
36
|
+
docs: {
|
|
37
|
+
source: {
|
|
38
|
+
format: false,
|
|
39
|
+
language: 'html',
|
|
40
|
+
transform: formatSnippet,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const render = (args: any) => ({
|
|
46
|
+
setup() {
|
|
47
|
+
return formatArgs(args);
|
|
48
|
+
},
|
|
49
|
+
template: '<div class="tide-display-inline-block tide-padding-1" v-bind="args">Demo</div>',
|
|
50
|
+
updated() {
|
|
51
|
+
return formatArgs(args);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
argTypes: {
|
|
57
|
+
shadow: {
|
|
58
|
+
...formatArgType({ SHADOW }),
|
|
59
|
+
description: `Applies a shadow at the element's top or bottom boundary.<br />(Top shadows are for sticky footers only.)`,
|
|
60
|
+
name: 'Shadow',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
args: {
|
|
64
|
+
shadow: SHADOW.None,
|
|
65
|
+
},
|
|
66
|
+
parameters,
|
|
67
|
+
render,
|
|
68
|
+
tags: ['autodocs'],
|
|
69
|
+
title: 'Foundations/Shadow',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Default = {};
|
|
73
|
+
|
|
74
|
+
export const ShadowBottom = {
|
|
75
|
+
args: {
|
|
76
|
+
shadow: SHADOW['Bottom'],
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const ShadowTop = {
|
|
81
|
+
args: {
|
|
82
|
+
shadow: SHADOW['Top'],
|
|
83
|
+
},
|
|
84
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { StoryContext } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import { TYPOGRAPHY } from '@/types/Storybook';
|
|
4
|
+
import { formatArgType, getConstantsByValues } from '@/utilities/storybook';
|
|
5
|
+
|
|
6
|
+
const formatArgs = (args: any) => {
|
|
7
|
+
args.class = args.type.join(' ');
|
|
8
|
+
|
|
9
|
+
return { args };
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const formatClassNames = (args: any) => {
|
|
13
|
+
const classNames: string[] = args.type;
|
|
14
|
+
|
|
15
|
+
return getConstantsByValues(classNames);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const formatSnippet = (code: string, context: StoryContext) => {
|
|
19
|
+
const { args } = context;
|
|
20
|
+
const classNames = formatClassNames(args);
|
|
21
|
+
|
|
22
|
+
return `<div :class="[${classNames.join(', ')}]">${args.label}</div>`;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const parameters = {
|
|
26
|
+
docs: {
|
|
27
|
+
source: {
|
|
28
|
+
format: false,
|
|
29
|
+
language: 'html',
|
|
30
|
+
transform: formatSnippet,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const render = (args: any) => ({
|
|
36
|
+
setup() {
|
|
37
|
+
return formatArgs(args);
|
|
38
|
+
},
|
|
39
|
+
template: `<div v-bind="args">{{ args.label }}</div>`,
|
|
40
|
+
updated() {
|
|
41
|
+
return formatArgs(args);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
argTypes: {
|
|
47
|
+
label: {
|
|
48
|
+
control: 'text',
|
|
49
|
+
description: 'Sample text',
|
|
50
|
+
name: 'Label',
|
|
51
|
+
table: {
|
|
52
|
+
defaultValue: { summary: 'None' },
|
|
53
|
+
type: { summary: 'string' },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
type: {
|
|
57
|
+
...formatArgType({ TYPOGRAPHY }),
|
|
58
|
+
description: `Applies font rules`,
|
|
59
|
+
name: 'Type',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
args: {
|
|
63
|
+
label: 'Aa',
|
|
64
|
+
type: TYPOGRAPHY.BODY_1,
|
|
65
|
+
},
|
|
66
|
+
parameters,
|
|
67
|
+
render,
|
|
68
|
+
tags: ['autodocs'],
|
|
69
|
+
title: 'Foundations/Typography',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Display1 = {
|
|
73
|
+
args: {
|
|
74
|
+
type: TYPOGRAPHY.DISPLAY_1,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Headline1 = {
|
|
79
|
+
args: {
|
|
80
|
+
type: TYPOGRAPHY.HEADLINE_1,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Headline2 = {
|
|
85
|
+
args: {
|
|
86
|
+
type: TYPOGRAPHY.HEADLINE_2,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Headline3 = {
|
|
91
|
+
args: {
|
|
92
|
+
type: TYPOGRAPHY.HEADLINE_1,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const Title1 = {
|
|
97
|
+
args: {
|
|
98
|
+
type: TYPOGRAPHY.TITLE_1,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Title2 = {
|
|
103
|
+
args: {
|
|
104
|
+
type: TYPOGRAPHY.TITLE_1,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const Body1 = {
|
|
109
|
+
args: {
|
|
110
|
+
type: TYPOGRAPHY.BODY_1,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const Body2 = {
|
|
115
|
+
args: {
|
|
116
|
+
type: TYPOGRAPHY.BODY_1,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const Label1 = {
|
|
121
|
+
args: {
|
|
122
|
+
type: TYPOGRAPHY.LABEL_1,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const Label1Semibold = {
|
|
127
|
+
args: {
|
|
128
|
+
type: TYPOGRAPHY.LABEL_1_SEMIBOLD,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const Label2 = {
|
|
133
|
+
args: {
|
|
134
|
+
type: TYPOGRAPHY.LABEL_2,
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export const Label2Semibold = {
|
|
139
|
+
args: {
|
|
140
|
+
type: TYPOGRAPHY.LABEL_2_SEMIBOLD,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const Label3 = {
|
|
145
|
+
args: {
|
|
146
|
+
type: TYPOGRAPHY.LABEL_3,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const Link1 = {
|
|
151
|
+
args: {
|
|
152
|
+
type: TYPOGRAPHY.LINK_1,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const Link2 = {
|
|
157
|
+
args: {
|
|
158
|
+
type: TYPOGRAPHY.LINK_2,
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const Link3 = {
|
|
163
|
+
args: {
|
|
164
|
+
type: TYPOGRAPHY.LINK_3,
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const Button1 = {
|
|
169
|
+
args: {
|
|
170
|
+
type: TYPOGRAPHY.BUTTON_1,
|
|
171
|
+
},
|
|
172
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* eslint-disable storybook/story-exports */
|
|
2
|
+
|
|
3
|
+
// IMPORTS
|
|
4
|
+
import TideChipInput from '@/components/TideChipInput.vue';
|
|
5
|
+
import { ICON } from '@/types/Icon';
|
|
6
|
+
import { argTypeBooleanUnrequired, formatArgType, formatSnippet } from '@/utilities/storybook';
|
|
7
|
+
|
|
8
|
+
// PARAMETERS
|
|
9
|
+
const parameters = {
|
|
10
|
+
docs: {
|
|
11
|
+
source: {
|
|
12
|
+
format: 'vue',
|
|
13
|
+
language: 'html',
|
|
14
|
+
transform: formatSnippet,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// STANDARD FUNCTIONS
|
|
20
|
+
const formatArgs = (args: any) => {
|
|
21
|
+
return { args };
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const render = (args: any) => ({
|
|
25
|
+
components: { TideChipInput },
|
|
26
|
+
setup() {
|
|
27
|
+
return formatArgs(args);
|
|
28
|
+
},
|
|
29
|
+
template: '<TideChipInput class="tide-display-inline-flex" v-bind="args" />',
|
|
30
|
+
updated() {
|
|
31
|
+
return formatArgs(args);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// EXPORT
|
|
36
|
+
export default {
|
|
37
|
+
argTypes: {
|
|
38
|
+
argTypeBoilerplate: {
|
|
39
|
+
...formatArgType({ ICON }),
|
|
40
|
+
description: 'Prop description',
|
|
41
|
+
},
|
|
42
|
+
argTypeBooleanUnrequired: {
|
|
43
|
+
...argTypeBooleanUnrequired,
|
|
44
|
+
},
|
|
45
|
+
argTypeComplete: {
|
|
46
|
+
control: 'text',
|
|
47
|
+
description: 'Complete ArgType<br />(Demonstrates all standard argType properties for this project)', // Description in Description column
|
|
48
|
+
name: 'Complete', // Name column
|
|
49
|
+
table: {
|
|
50
|
+
defaultValue: { summary: 'None' }, // Default column
|
|
51
|
+
type: { summary: 'string' }, // Type in Description column
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
label: {
|
|
55
|
+
control: 'text',
|
|
56
|
+
description: 'Chip text',
|
|
57
|
+
table: {
|
|
58
|
+
defaultValue: { summary: 'None' },
|
|
59
|
+
type: { summary: 'string' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
args: {
|
|
64
|
+
label: 'Demo', // Value in Control column
|
|
65
|
+
},
|
|
66
|
+
component: TideChipInput,
|
|
67
|
+
parameters,
|
|
68
|
+
render,
|
|
69
|
+
tags: ['autodocs'],
|
|
70
|
+
title: 'Hidden/Story Template',
|
|
71
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import TideAccordionItem from '@/components/TideAccordionItem.vue';
|
|
2
|
+
import { argTypeBooleanUnrequired, dataTrack, parameters } from '@/utilities/storybook';
|
|
3
|
+
|
|
4
|
+
const render = (args: any) => ({
|
|
5
|
+
components: { TideAccordionItem },
|
|
6
|
+
setup: () => ({ args }),
|
|
7
|
+
template: `<TideAccordionItem :key="args.isExpandedInitial" v-bind="args">{{ args.default }}</TideAccordionItem>`,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
argTypes: {
|
|
12
|
+
dataTrack,
|
|
13
|
+
default: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'Content exposed when expanded',
|
|
16
|
+
table: {
|
|
17
|
+
defaultValue: { summary: 'None' },
|
|
18
|
+
type: { summary: 'HTML' },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
hasBottomDivider: {
|
|
22
|
+
...argTypeBooleanUnrequired,
|
|
23
|
+
description: 'Determines whether to include bottom divider',
|
|
24
|
+
},
|
|
25
|
+
hasTopDivider: {
|
|
26
|
+
...argTypeBooleanUnrequired,
|
|
27
|
+
description: 'Determines whether to include bottom divider',
|
|
28
|
+
},
|
|
29
|
+
isActive: {
|
|
30
|
+
...argTypeBooleanUnrequired,
|
|
31
|
+
description: 'Determines whether to show "active" indicator (primarily for filters)',
|
|
32
|
+
},
|
|
33
|
+
isExpandedInitial: {
|
|
34
|
+
...argTypeBooleanUnrequired,
|
|
35
|
+
description:
|
|
36
|
+
'Determines whether content should be expanded by default<br />(Subsequently managed within component)',
|
|
37
|
+
},
|
|
38
|
+
isOptional: {
|
|
39
|
+
...argTypeBooleanUnrequired,
|
|
40
|
+
description: 'Determines whether to show "(optional)" indicator after label',
|
|
41
|
+
},
|
|
42
|
+
label: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
description: 'Label exposed when collapsed',
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: 'None' },
|
|
47
|
+
type: { summary: 'string' },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
args: {
|
|
52
|
+
dataTrack: '',
|
|
53
|
+
default: 'Lorem Ipsum',
|
|
54
|
+
hasBottomDivider: undefined,
|
|
55
|
+
hasTopDivider: undefined,
|
|
56
|
+
isActive: undefined,
|
|
57
|
+
isExpandedInitial: undefined,
|
|
58
|
+
isOptional: undefined,
|
|
59
|
+
label: 'Demo',
|
|
60
|
+
},
|
|
61
|
+
component: TideAccordionItem,
|
|
62
|
+
parameters,
|
|
63
|
+
render,
|
|
64
|
+
tags: ['autodocs'],
|
|
65
|
+
title: 'Basic Components/TideAccordionItem',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const Demo = {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as STANDARD_ALERT from '@/types/Alert';
|
|
2
|
+
import TideAlert from '@/components/TideAlert.vue';
|
|
3
|
+
import {
|
|
4
|
+
argTypeBooleanUnrequired,
|
|
5
|
+
dataTrack,
|
|
6
|
+
formatArgType,
|
|
7
|
+
parameters,
|
|
8
|
+
prependNoneAsUndefined,
|
|
9
|
+
} from '@/utilities/storybook';
|
|
10
|
+
|
|
11
|
+
const render = (args: any) => ({
|
|
12
|
+
components: { TideAlert },
|
|
13
|
+
setup: () => ({ args }),
|
|
14
|
+
template: `<TideAlert v-bind="args">{{ args.default }}</TideAlert>`,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const ALERT = prependNoneAsUndefined(STANDARD_ALERT.ALERT);
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
argTypes: {
|
|
21
|
+
dataTrack,
|
|
22
|
+
default: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Body text',
|
|
25
|
+
table: {
|
|
26
|
+
defaultValue: { summary: 'None' },
|
|
27
|
+
type: { summary: 'HTML' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
heading: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
description: 'Heading text',
|
|
33
|
+
table: {
|
|
34
|
+
defaultValue: { summary: 'None' },
|
|
35
|
+
type: { summary: 'HTML' },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
isToast: {
|
|
39
|
+
...argTypeBooleanUnrequired,
|
|
40
|
+
description: 'Determines whether the Alert is an overlay or displaces content',
|
|
41
|
+
},
|
|
42
|
+
type: {
|
|
43
|
+
...formatArgType({ ALERT }),
|
|
44
|
+
description: 'Alert type',
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: 'ALERT' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
args: { dataTrack: '', default: '', heading: 'Heading', isToast: undefined, type: undefined },
|
|
51
|
+
component: TideAlert,
|
|
52
|
+
parameters,
|
|
53
|
+
render,
|
|
54
|
+
tags: ['autodocs'],
|
|
55
|
+
title: 'Basic Components/TideAlert',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const Demo = {};
|