@designcrowd/fe-shared-lib 1.2.0 → 1.2.1-ml-input-changes
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/.storybook-static/assets/Auth-Cog6hw8U.css +1 -0
- package/.storybook-static/assets/Auth.stories-CbTWisKB.js +490 -0
- package/.storybook-static/assets/AuthCrazyDomains.stories-Dsjxh-je.js +73 -0
- package/.storybook-static/assets/Button-Dt0lL0uX.css +1 -0
- package/.storybook-static/assets/Button-IgCxbLvL.js +1 -0
- package/.storybook-static/assets/ButtonGroup-JjgCZ8Bt.css +1 -0
- package/.storybook-static/assets/ButtonGroup.stories-yhUiem6j.js +494 -0
- package/.storybook-static/assets/ButtonPrimary-CFNYtrCi.css +1 -0
- package/.storybook-static/assets/ButtonPrimary-Ce51KkgM.js +1 -0
- package/.storybook-static/assets/Buttons.stories-C7AZ07ow.js +699 -0
- package/.storybook-static/assets/ButtonsCrazyDomains.stories-DgtyyoFM.js +199 -0
- package/.storybook-static/assets/Checkbox.mixin-DkHpdvGa.js +1 -0
- package/.storybook-static/assets/Checkbox.stories-12upKauG.js +203 -0
- package/.storybook-static/assets/Checktile.stories-8H8_5ia-.js +88 -0
- package/.storybook-static/assets/CollapsiblePanel.stories-Cs6gaONK.js +39 -0
- package/.storybook-static/assets/Color-RQJUDNI5-B-WwomMi.js +1 -0
- package/.storybook-static/assets/ColorPicker.stories-DriJaUqB.js +73 -0
- package/.storybook-static/assets/CopyToClipboardText.stories-r9YFXGiX.js +32 -0
- package/.storybook-static/assets/DocsRenderer-K4EAMTCU-BflUCOHA.js +513 -0
- package/.storybook-static/assets/Dropdown.stories-D1RPdExw.js +154 -0
- package/.storybook-static/assets/DropdownItem-BQ0eJTHo.css +1 -0
- package/.storybook-static/assets/DropdownItem-C4PFbXSv.js +1 -0
- package/.storybook-static/assets/FormControl.mixin-BIPKWa5J.js +1 -0
- package/.storybook-static/assets/HashRouteModal.stories-jZo8F3lr.js +64 -0
- package/.storybook-static/assets/HelloBar-CXc7uecf.js +1 -0
- package/.storybook-static/assets/HelloBar.stories-DJPqn9T0.js +342 -0
- package/.storybook-static/assets/Icon-B8lXgcc0.js +1 -0
- package/.storybook-static/assets/Icon.stories-B2K3kKRW.js +735 -0
- package/.storybook-static/assets/Icon.stories-z4pz6mSi.js +126 -0
- package/.storybook-static/assets/Loader-D6_mUM4g.js +1 -0
- package/.storybook-static/assets/LogoBusinessBrandColours-7RXxlPF7.js +1 -0
- package/.storybook-static/assets/LogoBusinessBrandColours-8SUh_BWV.css +1 -0
- package/.storybook-static/assets/LogoBusinessBrandColours.stories-Cc65CQQK.js +36 -0
- package/.storybook-static/assets/Masonry-Q4MdMr0_.css +1 -0
- package/.storybook-static/assets/Masonry.stories-CB-rWe0y.js +71 -0
- package/.storybook-static/assets/Modal-BOHOQzO4.js +1 -0
- package/.storybook-static/assets/Modal-MZ2jF3mP.css +1 -0
- package/.storybook-static/assets/Modal.stories-Hbi4v2MQ.js +380 -0
- package/.storybook-static/assets/Notice.stories-ChRjh1h1.js +222 -0
- package/.storybook-static/assets/NumberStepper.stories-D4c10_Cl.js +48 -0
- package/.storybook-static/assets/PaymentConfigList.stories-EUp7r4Ga.js +126 -0
- package/.storybook-static/assets/Picture-AUjTe_FO.js +1 -0
- package/.storybook-static/assets/Picture.stories-7_37X1oI.js +119 -0
- package/.storybook-static/assets/Pill-DEH_ScBa.js +1 -0
- package/.storybook-static/assets/Pill.stories-CKakcDo1.js +18 -0
- package/.storybook-static/assets/PillBar-BeJSf_Pk.css +1 -0
- package/.storybook-static/assets/PillBar.stories-BNwlQM4p.js +41 -0
- package/.storybook-static/assets/Price-BzFp3dn5.js +1 -0
- package/.storybook-static/assets/Price.stories-m0jztoEd.js +221 -0
- package/.storybook-static/assets/PublishBrandPageModal-BOGSPjB0.css +1 -0
- package/.storybook-static/assets/PublishBrandPageModal.stories-Bt2eK5tM.js +349 -0
- package/.storybook-static/assets/SearchBar.stories-DE7D9jqF.js +12 -0
- package/.storybook-static/assets/Select-BkD_4Yie.css +1 -0
- package/.storybook-static/assets/Select.stories-vMzrjNuo.js +108 -0
- package/.storybook-static/assets/SellDomainNameList.fixtures-LC6fjr_b.js +1 -0
- package/.storybook-static/assets/SellDomainNameListModal-DAV6wUWy.js +1 -0
- package/.storybook-static/assets/SellDomainNameListModal-geQc7R-K.css +1 -0
- package/.storybook-static/assets/SellDomainNameListModal.stories-BOCkiwOR.js +71 -0
- package/.storybook-static/assets/SellDomainNameListSearchResult-DP3zr-UL.js +1 -0
- package/.storybook-static/assets/SellDomainNameListSearchResult-Dtf2vM3k.css +1 -0
- package/.storybook-static/assets/SellDomainNameSearchWithResults--W028-5L.js +1 -0
- package/.storybook-static/assets/SellDomainNameSearchWithResults.stories-CCYgVB46.js +37 -0
- package/.storybook-static/assets/SellDomainNameWidget.stories-ukdr-BaU.js +36 -0
- package/.storybook-static/assets/SignIn-B9RTmsHO.css +1 -0
- package/.storybook-static/assets/SignIn-yR2yVQBY.js +1 -0
- package/.storybook-static/assets/Slider-CQ7DbC3q.css +1 -0
- package/.storybook-static/assets/Slider.stories-CwIY_YjL.js +129 -0
- package/.storybook-static/assets/StarRating-BRQqs_py.css +1 -0
- package/.storybook-static/assets/StarRating.stories-B2ZK1FmW.js +45 -0
- package/.storybook-static/assets/TabMenu.stories-Cr3TQSxW.js +47 -0
- package/.storybook-static/assets/TextCopyField-BuZ5L-lt.js +1 -0
- package/.storybook-static/assets/TextCopyField.stories-ivRqKsNm.js +47 -0
- package/.storybook-static/assets/TextInput-BepJC9nE.js +1 -0
- package/.storybook-static/assets/TextInput.stories-BW4TEkLR.js +233 -0
- package/.storybook-static/assets/Textarea.stories-DWkB6BWG.js +207 -0
- package/.storybook-static/assets/Toggle.stories-C_GsxzOh.js +161 -0
- package/.storybook-static/assets/Tooltip-BHf5qq0n.css +1 -0
- package/.storybook-static/assets/Tooltip-BQfusa53.js +1 -0
- package/.storybook-static/assets/Tooltip.stories-CAIFG7b2.js +953 -0
- package/.storybook-static/assets/UploadYourLogoApplication-CeFWp7qz.css +9 -0
- package/.storybook-static/assets/UploadYourLogoApplication.stories-C-OLYLzi.js +194 -0
- package/.storybook-static/assets/UploadYourLogoDropzone-BZeSfjIk.css +1 -0
- package/.storybook-static/assets/UploadYourLogoDropzone-Cxgdqo37.js +24 -0
- package/.storybook-static/assets/UploadYourLogoDropzone.stories-X-I5FYLu.js +35 -0
- package/.storybook-static/assets/UploadedLogoSearchResultCard.stories-B2kj1FVv.js +79 -0
- package/.storybook-static/assets/WithTooltip-Y7J54OF7-DkTQ6h6H.js +1 -0
- package/.storybook-static/assets/_commonjsHelpers-BosuxZz1.js +1 -0
- package/.storybook-static/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
- package/.storybook-static/assets/api-lSJGRrF2.js +1 -0
- package/.storybook-static/assets/axe-CeoKsdFO.js +30 -0
- package/.storybook-static/assets/axios-dxcvQi4N.js +6 -0
- package/.storybook-static/assets/brand-crowd-api.client-CfTgrTzo.js +1 -0
- package/.storybook-static/assets/carousel-B0jomWUs.css +1 -0
- package/.storybook-static/assets/carousel.stories-B1RxWT1u.js +374 -0
- package/.storybook-static/assets/entry-preview-CMasyaBj.js +1 -0
- package/.storybook-static/assets/entry-preview-docs-DfJD_mNC.js +14 -0
- package/.storybook-static/assets/event-constants-6ydiL1p5.js +1 -0
- package/.storybook-static/assets/formatter-B5HCVTEV-CmCZjaYl.js +58 -0
- package/.storybook-static/assets/iframe-B6RguKdJ.js +7 -0
- package/.storybook-static/assets/index-BqKh95Lf.js +24 -0
- package/.storybook-static/assets/index-BwDkhjyp.js +9 -0
- package/.storybook-static/assets/index-D-8MO0q_.js +1 -0
- package/.storybook-static/assets/index-DK28puIS.js +3 -0
- package/.storybook-static/assets/index-DlpNa54Y.js +1 -0
- package/.storybook-static/assets/index-DrFu-skq.js +6 -0
- package/.storybook-static/assets/preview-B4GcaC1c.js +1 -0
- package/.storybook-static/assets/preview-BAz7FMXc.js +396 -0
- package/.storybook-static/assets/preview-BJPLiuSt.js +1 -0
- package/.storybook-static/assets/preview-CBGjgnh2.js +1 -0
- package/.storybook-static/assets/preview-Cv3rAi2i.js +7 -0
- package/.storybook-static/assets/preview-CwqMn10d.js +20 -0
- package/.storybook-static/assets/preview-DF-d5FoE.js +1 -0
- package/.storybook-static/assets/preview-Db4Idchh.js +1 -0
- package/.storybook-static/assets/preview-DvOZkz_N.js +7 -0
- package/.storybook-static/assets/preview-G-5UVXmd.js +1 -0
- package/.storybook-static/assets/preview-efJowmDL.js +7 -0
- package/.storybook-static/assets/syntaxhighlighter-JOJW2KGS-DjsQUJyu.js +1 -0
- package/.storybook-static/assets/tracking-ATsLLehC.js +1 -0
- package/.storybook-static/assets/vue.esm-bundler-C7QvyiW1.js +47 -0
- package/.storybook-static/css/tailwind-brandCrowd.css +2344 -0
- package/.storybook-static/css/tailwind-brandPage.css +2032 -0
- package/.storybook-static/css/tailwind-crazyDomains.css +2344 -0
- package/.storybook-static/css/tailwind-designCom.css +2344 -0
- package/.storybook-static/css/tailwind-designCrowd.css +2344 -0
- package/.storybook-static/favicon.svg +7 -0
- package/.storybook-static/iframe.html +501 -0
- package/.storybook-static/index.html +163 -0
- package/.storybook-static/index.json +1 -0
- package/.storybook-static/project.json +1 -0
- package/.storybook-static/sb-addons/a11y-1/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/a11y-1/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/actions-2/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/controls-3/manager-bundle.js +60 -0
- package/.storybook-static/sb-addons/controls-3/manager-bundle.js.LEGAL.txt +18 -0
- package/.storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/.storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/essentials-measure-7/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/essentials-outline-8/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/links-9/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/links-9/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-addons/themes-10/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/themes-10/manager-bundle.js.LEGAL.txt +0 -0
- package/.storybook-static/sb-common-assets/fonts.css +31 -0
- package/.storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/.storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/.storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/.storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/.storybook-static/sb-manager/WithTooltip-Y7J54OF7-3AIPQNGM.js +1 -0
- package/.storybook-static/sb-manager/chunk-KCJCJECS.js +234 -0
- package/.storybook-static/sb-manager/chunk-TZAR34JC.js +6 -0
- package/.storybook-static/sb-manager/chunk-UOBNU442.js +347 -0
- package/.storybook-static/sb-manager/chunk-VCJ56UEM.js +183 -0
- package/.storybook-static/sb-manager/chunk-VMGB76WP.js +9 -0
- package/.storybook-static/sb-manager/chunk-XP3HGWTR.js +1 -0
- package/.storybook-static/sb-manager/formatter-B5HCVTEV-7DCBOGO6.js +58 -0
- package/.storybook-static/sb-manager/globals-module-info.js +1 -0
- package/.storybook-static/sb-manager/globals-runtime.js +1 -0
- package/.storybook-static/sb-manager/globals.js +1 -0
- package/.storybook-static/sb-manager/index.js +1 -0
- package/.storybook-static/sb-manager/runtime.js +1 -0
- package/.storybook-static/sb-manager/syntaxhighlighter-JOJW2KGS-7BF26SBB.js +1 -0
- package/.storybook-static/sb-preview/globals.js +1 -0
- package/.storybook-static/sb-preview/runtime.js +128 -0
- package/dist/css/tailwind-brandCrowd.css +2459 -0
- package/dist/css/tailwind-brandPage.css +2147 -0
- package/dist/css/tailwind-crazyDomains.css +2459 -0
- package/dist/css/tailwind-designCom.css +2459 -0
- package/dist/css/tailwind-designCrowd.css +2459 -0
- package/package.json +1 -1
- package/public/css/tailwind-brandCrowd.css +4 -0
- package/public/css/tailwind-brandPage.css +4 -0
- package/public/css/tailwind-crazyDomains.css +4 -0
- package/public/css/tailwind-designCom.css +4 -0
- package/public/css/tailwind-designCrowd.css +4 -0
- package/src/atoms/components/Button/Button.vue +3 -0
- package/src/atoms/components/Button/Buttons.stories.js +24 -0
- package/src/atoms/components/Button/variants/ButtonAi.vue +2 -2
- package/src/atoms/components/Button/variants/ButtonOutlinePrimary.vue +53 -0
- package/src/atoms/components/Dropdown/Dropdown.stories.js +5 -5
- package/src/atoms/components/FormControl/FormControl.mixin.js +7 -1
- package/src/atoms/components/TextInput/TextInput.vue +5 -0
- package/src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.vue +1 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import{M as t}from"./Modal-BOHOQzO4.js";import{B as Y}from"./Button-IgCxbLvL.js";import"./Icon-B8lXgcc0.js";import"./vue.esm-bundler-C7QvyiW1.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ButtonPrimary-Ce51KkgM.js";const{useArgs:s}=__STORYBOOK_MODULE_PREVIEW_API__,U={title:"Components/Modal",component:t},o={render:e=>{const[,n]=s();return{components:{Modal:t},setup(){return{args:e}},template:`
|
|
2
|
+
<Modal v-bind="args" close-on-esc @close-modal="closeLoginModal">
|
|
3
|
+
Your component goes here
|
|
4
|
+
</Modal>
|
|
5
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})}}}},args:{visible:!0}},g={render:e=>{const[,n]=s();return{components:{Modal:t,Button:Y},setup(){return{args:e}},template:`
|
|
6
|
+
<div>
|
|
7
|
+
<Button size="medium" variant="primary" label="Click Me" @on-click="onButtonClick" />
|
|
8
|
+
<Modal v-bind="args" close-on-esc @close-modal="closeLoginModal">
|
|
9
|
+
Your component goes here
|
|
10
|
+
</Modal>
|
|
11
|
+
</div>
|
|
12
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})},onButtonClick(){n({...e,visible:!0})}}}},args:{visible:!0}},c={render:e=>{const[,n]=s();return{components:{Modal:t},setup(){return{args:e}},template:`
|
|
13
|
+
<Modal v-bind="args" :simple="true" @close-modal="closeLoginModal">
|
|
14
|
+
<div class="tw-px-8">
|
|
15
|
+
<div>
|
|
16
|
+
<h2 class="tw-text-2xl tw-text-center tw-mb-4">Hello World</h2>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</Modal>
|
|
20
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})}}}},args:{visible:!0}},r={render:e=>{const[,n]=s();return{components:{Modal:t},setup(){return{args:e}},template:`
|
|
21
|
+
<Modal v-bind="args" :mandatory="true" @close-modal="closeLoginModal">
|
|
22
|
+
I'm a mandatory modal
|
|
23
|
+
</Modal>
|
|
24
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})}}}},args:{visible:!0}},a={render:e=>{const[,n]=s();return{components:{Modal:t},setup(){return{args:e}},template:`
|
|
25
|
+
<Modal v-bind="args" @close-modal="closeLoginModal">
|
|
26
|
+
<div>
|
|
27
|
+
<div>Heading</div>
|
|
28
|
+
<div style="height: 150px;">Contents 1</div>
|
|
29
|
+
<div style="height: 250px;">Contents 2</div>
|
|
30
|
+
<div style="height: 300px;">Contents 3</div>
|
|
31
|
+
<button>Save</button>
|
|
32
|
+
</div>
|
|
33
|
+
</Modal>
|
|
34
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})}}}},args:{visible:!0}},l={render:e=>{const[,n]=s();return{components:{Modal:t},setup(){return{args:e}},template:`
|
|
35
|
+
<Modal v-bind="args" @close-modal="closeLoginModal">
|
|
36
|
+
<template v-slot:header>
|
|
37
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
38
|
+
<span>Header</span>
|
|
39
|
+
</div>
|
|
40
|
+
<div>
|
|
41
|
+
<span>Sticky content here which does not overflow</span>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
<div class="sm:tw-h-96">
|
|
45
|
+
<div style="height: 150px;">Over flowing Contents 1</div>
|
|
46
|
+
<div style="height: 200px;">Over flowing Contents 2</div>
|
|
47
|
+
<div style="height: 350px;">Over flowing Contents 3</div>
|
|
48
|
+
<div style="height: 350px;">Over flowing Contents 4</div>
|
|
49
|
+
<div style="height: 350px;">Over flowing Contents 5</div>
|
|
50
|
+
<button>Save</button>
|
|
51
|
+
</div>
|
|
52
|
+
<template v-slot:footer>
|
|
53
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
54
|
+
<span>Footer</span>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
</Modal>
|
|
58
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})}}}},args:{visible:!0}},i={render:e=>{const[,n]=s();return{components:{Modal:t},setup(){return{args:e}},template:`
|
|
59
|
+
<Modal v-bind="args" @close-modal="closeLoginModal" fullScreenBreakpoint="sm">
|
|
60
|
+
<template v-slot:header>
|
|
61
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
62
|
+
<span>Try resizing browser</span>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
<div class="sm:tw-h-96">
|
|
66
|
+
<div style="height: 150px;">Over flowing Contents 1</div>
|
|
67
|
+
<div style="height: 200px;">Over flowing Contents 2</div>
|
|
68
|
+
<div style="height: 350px;">Over flowing Contents 3</div>
|
|
69
|
+
<div style="height: 350px;">Over flowing Contents 4</div>
|
|
70
|
+
<div style="height: 350px;">Over flowing Contents 5</div>
|
|
71
|
+
<button>Save</button>
|
|
72
|
+
</div>
|
|
73
|
+
<template v-slot:footer>
|
|
74
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
75
|
+
<span>Footer</span>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
</Modal>
|
|
79
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})}}}},args:{visible:!0}},d={render:e=>{const[,n]=s();return{components:{Modal:t},setup(){return{args:e}},template:`
|
|
80
|
+
<Modal mode="image" v-bind="args" @close-modal="closeLoginModal">
|
|
81
|
+
<img alt="modal-img" src="https://source.unsplash.com/random/1200x1200"/>
|
|
82
|
+
</Modal>
|
|
83
|
+
`,methods:{closeLoginModal(){n({...e,visible:!1})}}}},args:{visible:!0}};d.story={name:"Modal — Image"};o.story={name:"Modal"};r.story={name:"Modal — Mandatory"};a.story={name:"Modal — Overflow Height"};l.story={name:"Modal — Header and Footer"};i.story={name:"Modal — Fullscreen breakpoint"};var p,v,m;o.parameters={...o.parameters,docs:{...(p=o.parameters)==null?void 0:p.docs,source:{originalSource:`{
|
|
84
|
+
render: args => {
|
|
85
|
+
const [, setArgs] = useArgs();
|
|
86
|
+
return {
|
|
87
|
+
components: {
|
|
88
|
+
Modal
|
|
89
|
+
},
|
|
90
|
+
setup() {
|
|
91
|
+
return {
|
|
92
|
+
args
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
template: \`
|
|
96
|
+
<Modal v-bind="args" close-on-esc @close-modal="closeLoginModal">
|
|
97
|
+
Your component goes here
|
|
98
|
+
</Modal>
|
|
99
|
+
\`,
|
|
100
|
+
methods: {
|
|
101
|
+
closeLoginModal() {
|
|
102
|
+
setArgs({
|
|
103
|
+
...args,
|
|
104
|
+
visible: false
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
args: {
|
|
111
|
+
visible: true
|
|
112
|
+
}
|
|
113
|
+
}`,...(m=(v=o.parameters)==null?void 0:v.docs)==null?void 0:m.source}}};var u,h,M;g.parameters={...g.parameters,docs:{...(u=g.parameters)==null?void 0:u.docs,source:{originalSource:`{
|
|
114
|
+
render: args => {
|
|
115
|
+
const [, setArgs] = useArgs();
|
|
116
|
+
return {
|
|
117
|
+
components: {
|
|
118
|
+
Modal,
|
|
119
|
+
Button
|
|
120
|
+
},
|
|
121
|
+
setup() {
|
|
122
|
+
return {
|
|
123
|
+
args
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
template: \`
|
|
127
|
+
<div>
|
|
128
|
+
<Button size="medium" variant="primary" label="Click Me" @on-click="onButtonClick" />
|
|
129
|
+
<Modal v-bind="args" close-on-esc @close-modal="closeLoginModal">
|
|
130
|
+
Your component goes here
|
|
131
|
+
</Modal>
|
|
132
|
+
</div>
|
|
133
|
+
\`,
|
|
134
|
+
methods: {
|
|
135
|
+
closeLoginModal() {
|
|
136
|
+
setArgs({
|
|
137
|
+
...args,
|
|
138
|
+
visible: false
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
onButtonClick() {
|
|
142
|
+
setArgs({
|
|
143
|
+
...args,
|
|
144
|
+
visible: true
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
args: {
|
|
151
|
+
visible: true
|
|
152
|
+
}
|
|
153
|
+
}`,...(M=(h=g.parameters)==null?void 0:h.docs)==null?void 0:M.source}}};var b,f,x;c.parameters={...c.parameters,docs:{...(b=c.parameters)==null?void 0:b.docs,source:{originalSource:`{
|
|
154
|
+
render: args => {
|
|
155
|
+
const [, setArgs] = useArgs();
|
|
156
|
+
return {
|
|
157
|
+
components: {
|
|
158
|
+
Modal
|
|
159
|
+
},
|
|
160
|
+
setup() {
|
|
161
|
+
return {
|
|
162
|
+
args
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
template: \`
|
|
166
|
+
<Modal v-bind="args" :simple="true" @close-modal="closeLoginModal">
|
|
167
|
+
<div class="tw-px-8">
|
|
168
|
+
<div>
|
|
169
|
+
<h2 class="tw-text-2xl tw-text-center tw-mb-4">Hello World</h2>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</Modal>
|
|
173
|
+
\`,
|
|
174
|
+
methods: {
|
|
175
|
+
closeLoginModal() {
|
|
176
|
+
setArgs({
|
|
177
|
+
...args,
|
|
178
|
+
visible: false
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
args: {
|
|
185
|
+
visible: true
|
|
186
|
+
}
|
|
187
|
+
}`,...(x=(f=c.parameters)==null?void 0:f.docs)==null?void 0:x.source}}};var y,w,A;r.parameters={...r.parameters,docs:{...(y=r.parameters)==null?void 0:y.docs,source:{originalSource:`{
|
|
188
|
+
render: args => {
|
|
189
|
+
const [, setArgs] = useArgs();
|
|
190
|
+
return {
|
|
191
|
+
components: {
|
|
192
|
+
Modal
|
|
193
|
+
},
|
|
194
|
+
setup() {
|
|
195
|
+
return {
|
|
196
|
+
args
|
|
197
|
+
};
|
|
198
|
+
},
|
|
199
|
+
template: \`
|
|
200
|
+
<Modal v-bind="args" :mandatory="true" @close-modal="closeLoginModal">
|
|
201
|
+
I'm a mandatory modal
|
|
202
|
+
</Modal>
|
|
203
|
+
\`,
|
|
204
|
+
methods: {
|
|
205
|
+
closeLoginModal() {
|
|
206
|
+
setArgs({
|
|
207
|
+
...args,
|
|
208
|
+
visible: false
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
args: {
|
|
215
|
+
visible: true
|
|
216
|
+
}
|
|
217
|
+
}`,...(A=(w=r.parameters)==null?void 0:w.docs)==null?void 0:A.source}}};var C,L,S;a.parameters={...a.parameters,docs:{...(C=a.parameters)==null?void 0:C.docs,source:{originalSource:`{
|
|
218
|
+
render: args => {
|
|
219
|
+
const [, setArgs] = useArgs();
|
|
220
|
+
return {
|
|
221
|
+
components: {
|
|
222
|
+
Modal
|
|
223
|
+
},
|
|
224
|
+
setup() {
|
|
225
|
+
return {
|
|
226
|
+
args
|
|
227
|
+
};
|
|
228
|
+
},
|
|
229
|
+
template: \`
|
|
230
|
+
<Modal v-bind="args" @close-modal="closeLoginModal">
|
|
231
|
+
<div>
|
|
232
|
+
<div>Heading</div>
|
|
233
|
+
<div style="height: 150px;">Contents 1</div>
|
|
234
|
+
<div style="height: 250px;">Contents 2</div>
|
|
235
|
+
<div style="height: 300px;">Contents 3</div>
|
|
236
|
+
<button>Save</button>
|
|
237
|
+
</div>
|
|
238
|
+
</Modal>
|
|
239
|
+
\`,
|
|
240
|
+
methods: {
|
|
241
|
+
closeLoginModal() {
|
|
242
|
+
setArgs({
|
|
243
|
+
...args,
|
|
244
|
+
visible: false
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
},
|
|
250
|
+
args: {
|
|
251
|
+
visible: true
|
|
252
|
+
}
|
|
253
|
+
}`,...(S=(L=a.parameters)==null?void 0:L.docs)==null?void 0:S.source}}};var O,B,k;l.parameters={...l.parameters,docs:{...(O=l.parameters)==null?void 0:O.docs,source:{originalSource:`{
|
|
254
|
+
render: args => {
|
|
255
|
+
const [, setArgs] = useArgs();
|
|
256
|
+
return {
|
|
257
|
+
components: {
|
|
258
|
+
Modal
|
|
259
|
+
},
|
|
260
|
+
setup() {
|
|
261
|
+
return {
|
|
262
|
+
args
|
|
263
|
+
};
|
|
264
|
+
},
|
|
265
|
+
template: \`
|
|
266
|
+
<Modal v-bind="args" @close-modal="closeLoginModal">
|
|
267
|
+
<template v-slot:header>
|
|
268
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
269
|
+
<span>Header</span>
|
|
270
|
+
</div>
|
|
271
|
+
<div>
|
|
272
|
+
<span>Sticky content here which does not overflow</span>
|
|
273
|
+
</div>
|
|
274
|
+
</template>
|
|
275
|
+
<div class="sm:tw-h-96">
|
|
276
|
+
<div style="height: 150px;">Over flowing Contents 1</div>
|
|
277
|
+
<div style="height: 200px;">Over flowing Contents 2</div>
|
|
278
|
+
<div style="height: 350px;">Over flowing Contents 3</div>
|
|
279
|
+
<div style="height: 350px;">Over flowing Contents 4</div>
|
|
280
|
+
<div style="height: 350px;">Over flowing Contents 5</div>
|
|
281
|
+
<button>Save</button>
|
|
282
|
+
</div>
|
|
283
|
+
<template v-slot:footer>
|
|
284
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
285
|
+
<span>Footer</span>
|
|
286
|
+
</div>
|
|
287
|
+
</template>
|
|
288
|
+
</Modal>
|
|
289
|
+
\`,
|
|
290
|
+
methods: {
|
|
291
|
+
closeLoginModal() {
|
|
292
|
+
setArgs({
|
|
293
|
+
...args,
|
|
294
|
+
visible: false
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
},
|
|
300
|
+
args: {
|
|
301
|
+
visible: true
|
|
302
|
+
}
|
|
303
|
+
}`,...(k=(B=l.parameters)==null?void 0:B.docs)==null?void 0:k.source}}};var z,F,H;i.parameters={...i.parameters,docs:{...(z=i.parameters)==null?void 0:z.docs,source:{originalSource:`{
|
|
304
|
+
render: args => {
|
|
305
|
+
const [, setArgs] = useArgs();
|
|
306
|
+
return {
|
|
307
|
+
components: {
|
|
308
|
+
Modal
|
|
309
|
+
},
|
|
310
|
+
setup() {
|
|
311
|
+
return {
|
|
312
|
+
args
|
|
313
|
+
};
|
|
314
|
+
},
|
|
315
|
+
template: \`
|
|
316
|
+
<Modal v-bind="args" @close-modal="closeLoginModal" fullScreenBreakpoint="sm">
|
|
317
|
+
<template v-slot:header>
|
|
318
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
319
|
+
<span>Try resizing browser</span>
|
|
320
|
+
</div>
|
|
321
|
+
</template>
|
|
322
|
+
<div class="sm:tw-h-96">
|
|
323
|
+
<div style="height: 150px;">Over flowing Contents 1</div>
|
|
324
|
+
<div style="height: 200px;">Over flowing Contents 2</div>
|
|
325
|
+
<div style="height: 350px;">Over flowing Contents 3</div>
|
|
326
|
+
<div style="height: 350px;">Over flowing Contents 4</div>
|
|
327
|
+
<div style="height: 350px;">Over flowing Contents 5</div>
|
|
328
|
+
<button>Save</button>
|
|
329
|
+
</div>
|
|
330
|
+
<template v-slot:footer>
|
|
331
|
+
<div style="text-align: center; font-weight: 600; font-size: 20px;">
|
|
332
|
+
<span>Footer</span>
|
|
333
|
+
</div>
|
|
334
|
+
</template>
|
|
335
|
+
</Modal>
|
|
336
|
+
\`,
|
|
337
|
+
methods: {
|
|
338
|
+
closeLoginModal() {
|
|
339
|
+
setArgs({
|
|
340
|
+
...args,
|
|
341
|
+
visible: false
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
},
|
|
347
|
+
args: {
|
|
348
|
+
visible: true
|
|
349
|
+
}
|
|
350
|
+
}`,...(H=(F=i.parameters)==null?void 0:F.docs)==null?void 0:H.source}}};var _,I,W;d.parameters={...d.parameters,docs:{...(_=d.parameters)==null?void 0:_.docs,source:{originalSource:`{
|
|
351
|
+
render: args => {
|
|
352
|
+
const [, setArgs] = useArgs();
|
|
353
|
+
return {
|
|
354
|
+
components: {
|
|
355
|
+
Modal
|
|
356
|
+
},
|
|
357
|
+
setup() {
|
|
358
|
+
return {
|
|
359
|
+
args
|
|
360
|
+
};
|
|
361
|
+
},
|
|
362
|
+
template: \`
|
|
363
|
+
<Modal mode="image" v-bind="args" @close-modal="closeLoginModal">
|
|
364
|
+
<img alt="modal-img" src="https://source.unsplash.com/random/1200x1200"/>
|
|
365
|
+
</Modal>
|
|
366
|
+
\`,
|
|
367
|
+
methods: {
|
|
368
|
+
closeLoginModal() {
|
|
369
|
+
setArgs({
|
|
370
|
+
...args,
|
|
371
|
+
visible: false
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
},
|
|
377
|
+
args: {
|
|
378
|
+
visible: true
|
|
379
|
+
}
|
|
380
|
+
}`,...(W=(I=d.parameters)==null?void 0:I.docs)==null?void 0:W.source}}};const V=["Sample","OpenWithButton","Simple","MandatorySample","InnerOverflowSample","HeaderFooterSample","FullscreenBreakpointSample","Image"];export{i as FullscreenBreakpointSample,l as HeaderFooterSample,d as Image,a as InnerOverflowSample,r as MandatorySample,g as OpenWithButton,o as Sample,c as Simple,V as __namedExportsOrder,U as default};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import{c as p,r as l,a as g,n as r,o as N,d as v}from"./vue.esm-bundler-C7QvyiW1.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{B as o}from"./Button-IgCxbLvL.js";import"./ButtonPrimary-Ce51KkgM.js";import"./Icon-B8lXgcc0.js";const f={props:{color:{type:String,required:!1,default:"primary"},direction:{type:String,required:!1,default:"top"},alignment:{type:String,required:!1,default:"left"},size:{type:String,required:!1,default:void 0},closable:{type:Boolean,required:!1,default:!1},isVisible:{type:Boolean,required:!1,default:void 0}}};function h(e,i,t,C,k,x){return N(),p("div",{class:r({"tw-relative tw-inline-flex tw-flex-col sm:tw-flex-row tw-w-full sm:tw-w-auto":!0,"tw-justify-center":t.alignment==="center","tw-justify-end":t.alignment==="right","tw-justify-start":t.alignment==="left"})},[l(e.$slots,"target"),g("div",{class:r({"sm:tw-absolute tw-static tw-w-full tw-z-10 tw-border tw-border-solid tw-border-grayscale-500 tw-rounded tw-bg-white tw-top-full tw-mt-4":!0,"sm:tw-top-auto sm:tw-mt-0":t.direction!=="bottom","sm:tw-bottom-full sm:tw-mb-4":t.direction==="top","sm:tw-left-full sm:tw-ml-4":t.direction==="right","sm:tw-right-full sm:tw-mr-4":t.direction==="left","tw-right-0":t.alignment==="right","tw-left-0":t.alignment==="left","sm:tw-w-64":t.size==="sm","sm:tw-w-72":t.size==="md","sm:tw-w-96":t.size==="lg","tw-hidden":!t.isVisible})},[l(e.$slots,"body")],2)],2)}const a=y(f,[["render",h]]);f.__docgenInfo={exportName:"default",displayName:"Notice",description:"",tags:{},props:[{name:"color",type:{name:"string"},required:!1,defaultValue:{func:!1,value:"'primary'"}},{name:"direction",type:{name:"string"},required:!1,defaultValue:{func:!1,value:"'top'"}},{name:"alignment",type:{name:"string"},required:!1,defaultValue:{func:!1,value:"'left'"}},{name:"size",type:{name:"string"},required:!1,defaultValue:{func:!1,value:"undefined"}},{name:"closable",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"isVisible",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"undefined"}}],slots:[{name:"target"},{name:"body"}],sourceFiles:["/Users/brooke.couchman/Projects/fe-shared-lib/src/atoms/components/Notice/Notice.vue"]};const R={title:"Components/Notice",component:a},V=(e,i,t)=>({notice:{direction:e,isVisible:i},button:{label:"Click me",variant:"primary",size:"small-wide",onClick:t}}),B=v("StorybookNoticeBody",{components:{Button:o},template:`
|
|
2
|
+
<div class="tw-p-4">
|
|
3
|
+
<input type="text" class="tw-mb-2" />
|
|
4
|
+
<Button
|
|
5
|
+
label="Submit"
|
|
6
|
+
variant="primary"
|
|
7
|
+
size="small-wide"
|
|
8
|
+
:full-width="true"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
`}),n=()=>({components:{Notice:a,Button:o,StorybookNoticeBodyComponent:B},data(){return{isTopNoticeVisible:!1,isRightNoticeVisible:!1,isBottomNoticeVisible:!1,isLeftNoticeVisible:!1,directions:["Top","Right","Bottom","Left"]}},computed:{onClickFunctions(){return{top:()=>{this.isTopNoticeVisible=!this.isTopNoticeVisible},right:()=>{this.isRightNoticeVisible=!this.isRightNoticeVisible},bottom:()=>{this.isBottomNoticeVisible=!this.isBottomNoticeVisible},left:()=>{this.isLeftNoticeVisible=!this.isLeftNoticeVisible}}},variants(){return this.directions.map(e=>{const i=e.toLowerCase();return V(i,this[`is${e}NoticeVisible`],this.onClickFunctions[i])})}},template:`
|
|
12
|
+
<div class="tw-flex tw-justify-center tw-mt-40">
|
|
13
|
+
<div class="tw-container tw-max-w-300">
|
|
14
|
+
<table class="tw-w-full">
|
|
15
|
+
<thead>
|
|
16
|
+
<tr>
|
|
17
|
+
<th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Notice</th>
|
|
18
|
+
<th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Code</th>
|
|
19
|
+
</tr>
|
|
20
|
+
</thead>
|
|
21
|
+
<tbody>
|
|
22
|
+
<tr
|
|
23
|
+
v-for="(variant, index) in variants"
|
|
24
|
+
:key="index"
|
|
25
|
+
class="tw-bg-grayscale-200"
|
|
26
|
+
>
|
|
27
|
+
<td class="tw-p-4">
|
|
28
|
+
<Notice
|
|
29
|
+
:direction="variant.notice.direction"
|
|
30
|
+
:is-visible="variant.notice.isVisible"
|
|
31
|
+
>
|
|
32
|
+
<template #target>
|
|
33
|
+
<Button
|
|
34
|
+
:label="variant.button.label"
|
|
35
|
+
:variant="variant.button.variant"
|
|
36
|
+
:size="variant.button.size"
|
|
37
|
+
@on-click="variant.button.onClick"
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
<template #body>
|
|
41
|
+
<StorybookNoticeBodyComponent />
|
|
42
|
+
</template>
|
|
43
|
+
</Notice>
|
|
44
|
+
</td>
|
|
45
|
+
<td class="tw-p-4">
|
|
46
|
+
<code
|
|
47
|
+
class="tw-bg-info-100 tw-p-2 tw-rounded tw-bg-gray-400 tw-border tw-border-solid tw-border-info-300 tw-text-info-900"
|
|
48
|
+
>
|
|
49
|
+
<Notice direction="{{ variant.notice.direction }}" is-visible="{{ variant.notice.isVisible }}">
|
|
50
|
+
|
|
51
|
+
<template #target>...</template>
|
|
52
|
+
|
|
53
|
+
<template #body>...</template>
|
|
54
|
+
</Notice>
|
|
55
|
+
</code>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
</tbody>
|
|
59
|
+
</table>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
`}),s=()=>({components:{Notice:a,Button:o},data(){return{isNoticeVisible:!1}},template:`
|
|
63
|
+
<Notice
|
|
64
|
+
direction="bottom"
|
|
65
|
+
:is-visible="isNoticeVisible"
|
|
66
|
+
size="md"
|
|
67
|
+
>
|
|
68
|
+
<template #target>
|
|
69
|
+
<Button
|
|
70
|
+
:full-width="true"
|
|
71
|
+
label="Click me"
|
|
72
|
+
variant="primary"
|
|
73
|
+
size="small-wide"
|
|
74
|
+
@on-click="isNoticeVisible = !isNoticeVisible"
|
|
75
|
+
/>
|
|
76
|
+
</template>
|
|
77
|
+
<template #body>
|
|
78
|
+
<div class="tw-p-4">
|
|
79
|
+
<input type="text" class="tw-mb-2 tw-w-full" />
|
|
80
|
+
<Button
|
|
81
|
+
label="Submit"
|
|
82
|
+
variant="primary"
|
|
83
|
+
size="small-wide"
|
|
84
|
+
:full-width="true"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
</Notice>
|
|
89
|
+
`});var c,d,m;n.parameters={...n.parameters,docs:{...(c=n.parameters)==null?void 0:c.docs,source:{originalSource:`() => {
|
|
90
|
+
return {
|
|
91
|
+
components: {
|
|
92
|
+
Notice,
|
|
93
|
+
Button,
|
|
94
|
+
StorybookNoticeBodyComponent
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return {
|
|
98
|
+
isTopNoticeVisible: false,
|
|
99
|
+
isRightNoticeVisible: false,
|
|
100
|
+
isBottomNoticeVisible: false,
|
|
101
|
+
isLeftNoticeVisible: false,
|
|
102
|
+
directions: ['Top', 'Right', 'Bottom', 'Left']
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
computed: {
|
|
106
|
+
onClickFunctions() {
|
|
107
|
+
return {
|
|
108
|
+
top: () => {
|
|
109
|
+
this.isTopNoticeVisible = !this.isTopNoticeVisible;
|
|
110
|
+
},
|
|
111
|
+
right: () => {
|
|
112
|
+
this.isRightNoticeVisible = !this.isRightNoticeVisible;
|
|
113
|
+
},
|
|
114
|
+
bottom: () => {
|
|
115
|
+
this.isBottomNoticeVisible = !this.isBottomNoticeVisible;
|
|
116
|
+
},
|
|
117
|
+
left: () => {
|
|
118
|
+
this.isLeftNoticeVisible = !this.isLeftNoticeVisible;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
variants() {
|
|
123
|
+
return this.directions.map(direction => {
|
|
124
|
+
const directionLowerCase = direction.toLowerCase();
|
|
125
|
+
return generateNoticeVariant(directionLowerCase, this[\`is\${direction}NoticeVisible\`], this.onClickFunctions[directionLowerCase]);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
template: \`
|
|
130
|
+
<div class="tw-flex tw-justify-center tw-mt-40">
|
|
131
|
+
<div class="tw-container tw-max-w-300">
|
|
132
|
+
<table class="tw-w-full">
|
|
133
|
+
<thead>
|
|
134
|
+
<tr>
|
|
135
|
+
<th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Notice</th>
|
|
136
|
+
<th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Code</th>
|
|
137
|
+
</tr>
|
|
138
|
+
</thead>
|
|
139
|
+
<tbody>
|
|
140
|
+
<tr
|
|
141
|
+
v-for="(variant, index) in variants"
|
|
142
|
+
:key="index"
|
|
143
|
+
class="tw-bg-grayscale-200"
|
|
144
|
+
>
|
|
145
|
+
<td class="tw-p-4">
|
|
146
|
+
<Notice
|
|
147
|
+
:direction="variant.notice.direction"
|
|
148
|
+
:is-visible="variant.notice.isVisible"
|
|
149
|
+
>
|
|
150
|
+
<template #target>
|
|
151
|
+
<Button
|
|
152
|
+
:label="variant.button.label"
|
|
153
|
+
:variant="variant.button.variant"
|
|
154
|
+
:size="variant.button.size"
|
|
155
|
+
@on-click="variant.button.onClick"
|
|
156
|
+
/>
|
|
157
|
+
</template>
|
|
158
|
+
<template #body>
|
|
159
|
+
<StorybookNoticeBodyComponent />
|
|
160
|
+
</template>
|
|
161
|
+
</Notice>
|
|
162
|
+
</td>
|
|
163
|
+
<td class="tw-p-4">
|
|
164
|
+
<code
|
|
165
|
+
class="tw-bg-info-100 tw-p-2 tw-rounded tw-bg-gray-400 tw-border tw-border-solid tw-border-info-300 tw-text-info-900"
|
|
166
|
+
>
|
|
167
|
+
<Notice direction="{{ variant.notice.direction }}" is-visible="{{ variant.notice.isVisible }}">
|
|
168
|
+
|
|
169
|
+
<template #target>...</template>
|
|
170
|
+
|
|
171
|
+
<template #body>...</template>
|
|
172
|
+
</Notice>
|
|
173
|
+
</code>
|
|
174
|
+
</td>
|
|
175
|
+
</tr>
|
|
176
|
+
</tbody>
|
|
177
|
+
</table>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
\`
|
|
181
|
+
};
|
|
182
|
+
}`,...(m=(d=n.parameters)==null?void 0:d.docs)==null?void 0:m.source}}};var u,b,w;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`() => {
|
|
183
|
+
return {
|
|
184
|
+
components: {
|
|
185
|
+
Notice,
|
|
186
|
+
Button
|
|
187
|
+
},
|
|
188
|
+
data() {
|
|
189
|
+
return {
|
|
190
|
+
isNoticeVisible: false
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
template: \`
|
|
194
|
+
<Notice
|
|
195
|
+
direction="bottom"
|
|
196
|
+
:is-visible="isNoticeVisible"
|
|
197
|
+
size="md"
|
|
198
|
+
>
|
|
199
|
+
<template #target>
|
|
200
|
+
<Button
|
|
201
|
+
:full-width="true"
|
|
202
|
+
label="Click me"
|
|
203
|
+
variant="primary"
|
|
204
|
+
size="small-wide"
|
|
205
|
+
@on-click="isNoticeVisible = !isNoticeVisible"
|
|
206
|
+
/>
|
|
207
|
+
</template>
|
|
208
|
+
<template #body>
|
|
209
|
+
<div class="tw-p-4">
|
|
210
|
+
<input type="text" class="tw-mb-2 tw-w-full" />
|
|
211
|
+
<Button
|
|
212
|
+
label="Submit"
|
|
213
|
+
variant="primary"
|
|
214
|
+
size="small-wide"
|
|
215
|
+
:full-width="true"
|
|
216
|
+
/>
|
|
217
|
+
</div>
|
|
218
|
+
</template>
|
|
219
|
+
</Notice>
|
|
220
|
+
\`
|
|
221
|
+
};
|
|
222
|
+
}`,...(w=(b=s.parameters)==null?void 0:b.docs)==null?void 0:w.source}}};const T=["Sample","Mobile"];export{s as Mobile,n as Sample,T as __namedExportsOrder,R as default};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{z as c,c as w,i as d,w as r,a as g,k as m,g as N,o as S}from"./vue.esm-bundler-C7QvyiW1.js";import{B as p}from"./Button-IgCxbLvL.js";import{_ as P}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ButtonPrimary-Ce51KkgM.js";import"./Icon-B8lXgcc0.js";const v={components:{Button:p},props:{id:{type:String,default:()=>"1"},modelValue:{type:Number,default:void 0},min:{type:Number,default:1},max:{type:Number,default:void 0},dataAttribute:{type:String,default:null},disabled:{type:Boolean,default:void 0},size:{type:String,default:"medium"}},setup(t){const e=`js-number-stepper-${t.id}`;return{numberStepperRef:e,[e]:c(null)}},data(){return{num:null,longPress:null,longPressTimeout:null,longPressInterval:null}},computed:{buttonStyle(){let t="";return this.size==="medium"&&(t="!tw-p-4"),t},buttonIconSize(){let t="xs";return this.size==="medium"&&(t="sm"),t},number:{get(){return parseInt(this.num,10)},set(t){this.num=t}}},watch:{modelValue(t){this.number=t}},created(){this.LONG_PRESS_DELAY=1e3,this.LONG_PRESS_INTERVAL_DELAY=100,this.LONG_PRESS_AMOUNT=5,this.FOCUSED_EVENT="focus",this.BLUR_EVENT="blur"},mounted(){this.number=this.modelValue,this.addDataAttribute()},beforeUnmount(){this.clearLongPressTimers()},methods:{addDataAttribute(){this.dataAttribute&&this.$refs[this.numberStepperRef].setAttribute(this.dataAttribute,"")},changeNumber(t,e){this.disabled||(t==="up"?this.increment(e):this.decrement(e))},increment(t){const e=typeof t=="number"?t:1;(!this.max||this.max&&this.number+e<=this.max)&&(this.number+=e),this.max&&this.number+e>this.max&&(this.number=this.max),this.$emit("update:modelValue",this.number),this.$emit("input",this.number)},decrement(t){const e=typeof t=="number"?t:1;this.number-e>=this.min?this.number-=e:this.number=this.min,this.$emit("update:modelValue",this.number),this.$emit("input",this.number)},onMouseWheel(t){this.disabled||(t.preventDefault(),t.deltaY<0?this.increment():this.decrement())},onMouseDown(t){if(!this.disabled){const e=this;let i=1;e.changeNumber(t),e.longPressInterval=setInterval(()=>{e.changeNumber(t,i)},e.LONG_PRESS_INTERVAL_DELAY),e.longPressTimeout=setTimeout(()=>{i=e.LONG_PRESS_AMOUNT},e.LONG_PRESS_DELAY)}},clearLongPressTimers(t){t&&t.preventDefault(),clearTimeout(this.longPressTimeout),clearInterval(this.longPressInterval),this.longPressTimeout=null,this.longPressInterval=null,this.longPress=!1},onArrowDown(t){if(!this.disabled){const e=this;e.longPress?e.changeNumber(t,e.LONG_PRESS_AMOUNT):e.changeNumber(t),e.longPressTimeout||(e.longPressTimeout=setTimeout(()=>{e.longPress=!0},e.LONG_PRESS_DELAY))}},onInput(t){if(!this.disabled){const e=Math.round(parseFloat(t.target.value));let i=0;if(!/\D/.test(e)||!e)i=e&&e;else if(e.length>=this.number.toString().length)i=e.slice(0,-1);else if(typeof size=="string"){const u=Math.round(parseFloat(size));i=Number.isNaN(u)?this.number:u}e?(e<this.min&&(i=this.min),this.max&&e>this.max&&(i=this.max)):i=this.min,this.number=i,t.target.value=i,this.$emit("update:modelValue",this.number),this.$emit("input",this.number)}}}},T={class:"tw-flex tw-items-stretch"},V=["value","disabled"];function L(t,e,i,u,x,n){const a=N("Button");return S(),w("div",T,[d(a,{variant:"flat",icon:"minus","icon-size":n.buttonIconSize,class:"tw-rounded-r-none",classes:n.buttonStyle,rounded:!1,"rounded-left":!0,disabled:i.disabled,onMousedown:[e[0]||(e[0]=r(s=>n.onMouseDown("down"),["left"])),r(n.clearLongPressTimers,["right"]),r(n.clearLongPressTimers,["middle"])],onMouseup:n.clearLongPressTimers,onMouseleave:n.clearLongPressTimers,onTouchstart:e[1]||(e[1]=s=>n.onMouseDown("down")),onTouchend:e[2]||(e[2]=s=>n.clearLongPressTimers(s)),onTouchcancel:e[3]||(e[3]=s=>n.clearLongPressTimers(s))},null,8,["icon-size","classes","disabled","onMousedown","onMouseup","onMouseleave"]),g("input",{ref:u.numberStepperRef,class:"tw-w-full tw-text-center tw-border tw-border-solid tw-border-secondary-200",type:"text",value:n.number,pattern:"[0-9]",disabled:i.disabled,onWheel:e[4]||(e[4]=(...s)=>n.onMouseWheel&&n.onMouseWheel(...s)),onInput:e[5]||(e[5]=r((...s)=>n.onInput&&n.onInput(...s),["stop"])),onKeyup:e[6]||(e[6]=(...s)=>n.clearLongPressTimers&&n.clearLongPressTimers(...s)),onKeydown:[e[7]||(e[7]=m(s=>n.onArrowDown("up"),["up"])),e[8]||(e[8]=m(s=>n.onArrowDown("down"),["down"]))],onFocus:e[9]||(e[9]=s=>t.$emit(t.FOCUSED_EVENT)),onBlur:e[10]||(e[10]=s=>t.$emit(t.BLUR_EVENT))},null,40,V),d(a,{variant:"flat",rounded:!1,"rounded-right":!0,icon:"plus","icon-size":n.buttonIconSize,class:"tw-rounded-l-none",classes:n.buttonStyle,disabled:i.disabled,onMousedown:[e[11]||(e[11]=r(s=>n.onMouseDown("up"),["left"])),r(n.clearLongPressTimers,["right"]),r(n.clearLongPressTimers,["middle"])],onMouseup:n.clearLongPressTimers,onMouseleave:n.clearLongPressTimers,onTouchstart:e[12]||(e[12]=s=>n.onMouseDown("up")),onTouchend:e[13]||(e[13]=s=>n.clearLongPressTimers(s)),onTouchcancel:e[14]||(e[14]=s=>n.clearLongPressTimers(s))},null,8,["icon-size","classes","disabled","onMousedown","onMouseup","onMouseleave"])])}const h=P(v,[["render",L]]);v.__docgenInfo={exportName:"default",displayName:"NumberStepper",description:"",tags:{},props:[{name:"id",type:{name:"string"},defaultValue:{func:!0,value:"() => '1'"}},{name:"modelValue",type:{name:"number"},defaultValue:{func:!1,value:"undefined"}},{name:"min",type:{name:"number"},defaultValue:{func:!1,value:"1"}},{name:"max",type:{name:"number"},defaultValue:{func:!1,value:"undefined"}},{name:"dataAttribute",type:{name:"string"},defaultValue:{func:!1,value:"null"}},{name:"disabled",type:{name:"boolean"},defaultValue:{func:!1,value:"undefined"}},{name:"size",type:{name:"string"},defaultValue:{func:!1,value:"'medium'"}}],events:[{name:"<undefined>"},{name:"update:modelValue",type:{names:["undefined"]}},{name:"input",type:{names:["undefined"]}}],sourceFiles:["/Users/brooke.couchman/Projects/fe-shared-lib/src/atoms/components/NumberStepper/NumberStepper.vue"]};const I={title:"Components/Number Stepper",component:h},y={components:{NumberStepper:h,Button:p},data(){return{numberValue:20}}},l=()=>({...y,template:`
|
|
2
|
+
<div>
|
|
3
|
+
<div>Full width min 18 max 25</div>
|
|
4
|
+
<NumberStepper v-model="numberValue" id="id1" :min="18" :max="25" :disabled="false" />
|
|
5
|
+
<div class="tw-mt-4 tw-w-64">
|
|
6
|
+
<div>Fixed container width</div>
|
|
7
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="false" />
|
|
8
|
+
</div>
|
|
9
|
+
<div class="tw-mt-4 tw-w-64">
|
|
10
|
+
<div>Disabled</div>
|
|
11
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="true" />
|
|
12
|
+
</div>
|
|
13
|
+
<div class="tw-mt-4 tw-w-64">
|
|
14
|
+
<div>Normal size</div>
|
|
15
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="false" />
|
|
16
|
+
</div>
|
|
17
|
+
<div class="tw-mt-4 tw-w-64">
|
|
18
|
+
<div>Bigger size</div>
|
|
19
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="false" />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
`});var o,b,f;l.parameters={...l.parameters,docs:{...(o=l.parameters)==null?void 0:o.docs,source:{originalSource:`() => {
|
|
23
|
+
return {
|
|
24
|
+
...data,
|
|
25
|
+
template: \`
|
|
26
|
+
<div>
|
|
27
|
+
<div>Full width min 18 max 25</div>
|
|
28
|
+
<NumberStepper v-model="numberValue" id="id1" :min="18" :max="25" :disabled="false" />
|
|
29
|
+
<div class="tw-mt-4 tw-w-64">
|
|
30
|
+
<div>Fixed container width</div>
|
|
31
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="false" />
|
|
32
|
+
</div>
|
|
33
|
+
<div class="tw-mt-4 tw-w-64">
|
|
34
|
+
<div>Disabled</div>
|
|
35
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="true" />
|
|
36
|
+
</div>
|
|
37
|
+
<div class="tw-mt-4 tw-w-64">
|
|
38
|
+
<div>Normal size</div>
|
|
39
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="false" />
|
|
40
|
+
</div>
|
|
41
|
+
<div class="tw-mt-4 tw-w-64">
|
|
42
|
+
<div>Bigger size</div>
|
|
43
|
+
<NumberStepper v-model="numberValue" id="id2" :min="18" :max="25" :disabled="false" />
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
\`
|
|
47
|
+
};
|
|
48
|
+
}`,...(f=(b=l.parameters)==null?void 0:b.docs)==null?void 0:f.source}}};const R=["Primary"];export{l as Primary,R as __namedExportsOrder,I as default};
|