@citizenplane/pimp 8.11.3 → 8.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/assets/BaseInputLabel-B6HBeOYW.css +1 -0
- package/dist/assets/BaseInputLabel-BKfOnmKd.js +1 -0
- package/dist/assets/BaseInputLabel.stories-B3jMVrza.js +28 -0
- package/dist/assets/Color-YHDXOIA2-CfioBzZb.js +1 -0
- package/dist/assets/Colors-mWZwWrlN.js +1 -0
- package/dist/assets/CpAlert-6hd7PZeZ.js +1 -0
- package/dist/assets/CpAlert-BW1Zf1Km.css +1 -0
- package/dist/assets/CpAlert.stories-CcK6sLCO.js +58 -0
- package/dist/assets/CpBadge-BRRUYYEk.js +1 -0
- package/dist/assets/CpBadge-CE420vX2.css +1 -0
- package/dist/assets/CpBadge.stories-Btggeh1U.js +170 -0
- package/dist/assets/CpButton-DQb7zTje.js +1 -0
- package/dist/assets/CpButton-gbl9KLuG.css +1 -0
- package/dist/assets/CpButton.stories-Chy_2ILm.js +86 -0
- package/dist/assets/CpCheckbox-Dalwqglu.js +1 -0
- package/dist/assets/CpCheckbox-DdQW6Gbc.css +1 -0
- package/dist/assets/CpCheckbox.stories-BEtAkjE-.js +167 -0
- package/dist/assets/CpDate-BdnXxnGQ.css +1 -0
- package/dist/assets/CpDate-DdtWXX2Q.js +3 -0
- package/dist/assets/CpDate.stories-C2Jg2QqC.js +59 -0
- package/dist/assets/CpDatepicker-DlzMF4b8.js +5 -0
- package/dist/assets/CpDatepicker-DqugfF5T.css +1 -0
- package/dist/assets/CpDatepicker.stories-CvOQvZYr.js +83 -0
- package/dist/assets/CpDialog-BTJusbSJ.js +1 -0
- package/dist/assets/CpDialog-BeuM9Ffk.css +1 -0
- package/dist/assets/CpDialog.stories-jA8uhNJR.js +43 -0
- package/dist/assets/CpHeading-BfoX1SIY.js +1 -0
- package/dist/assets/CpHeading-DgViCnDE.css +1 -0
- package/dist/assets/CpHeading.stories-DYb8vPG0.js +85 -0
- package/dist/assets/CpIcon-CdMV7BxY.css +1 -0
- package/dist/assets/CpIcon-DjtGpusx.js +5 -0
- package/dist/assets/CpIcon.stories-Cavk2BnC.js +47 -0
- package/dist/assets/CpInput-BT29xZan.js +1 -0
- package/dist/assets/CpInput-CAegPnB6.css +1 -0
- package/dist/assets/CpInput.stories-BbBe4bFT.js +98 -0
- package/dist/assets/CpLoader-B--Vqrhj.js +1 -0
- package/dist/assets/CpLoader.stories-CZ0hlfa2.js +10 -0
- package/dist/assets/CpRadio-C7OtLwPR.js +1 -0
- package/dist/assets/CpRadio-DiUdGJPg.css +1 -0
- package/dist/assets/CpRadio.stories-DPcn2bvJ.js +132 -0
- package/dist/assets/CpSelect-DlLk_-bg.js +1 -0
- package/dist/assets/CpSelect-HpT9AKcz.css +1 -0
- package/dist/assets/CpSelect.stories-C90Kd5cu.js +85 -0
- package/dist/assets/CpSelectMenu-Bpz33Tbp.js +1 -0
- package/dist/assets/CpSelectMenu-Dw4sbiEj.css +1 -0
- package/dist/assets/CpSelectMenu.stories-Bw2sNo0F.js +104 -0
- package/dist/assets/CpSwitch-CIWoB1sY.css +1 -0
- package/dist/assets/CpSwitch-CeGY7EL9.js +1 -0
- package/dist/assets/CpSwitch.stories-DbepH0R0.js +132 -0
- package/dist/assets/CpTable-BN6Amfsc.css +1 -0
- package/dist/assets/CpTable-RA2YDd8h.js +1 -0
- package/dist/assets/CpTable.stories-Dgc6tAkl.js +151 -0
- package/dist/assets/CpTableEmptyState-DLgi2hhT.css +1 -0
- package/dist/assets/CpTableEmptyState-TCjommO_.js +1 -0
- package/dist/assets/CpTableEmptyState.stories-C2oOfeda.js +20 -0
- package/dist/assets/CpTextarea-CzC-Bjsy.css +1 -0
- package/dist/assets/CpTextarea-HUf2FbPC.js +1 -0
- package/dist/assets/CpTextarea.stories-_17UyFSg.js +64 -0
- package/dist/assets/CpToaster-BXpKEwda.css +1 -0
- package/dist/assets/CpToaster-D9ITJUky.js +1 -0
- package/dist/assets/CpToaster.stories-BhEsau9e.js +124 -0
- package/dist/assets/CpTooltip-BIIOHaoi.css +1 -0
- package/dist/assets/CpTooltip-CD0Q4ym2.js +1 -0
- package/dist/assets/CpTooltip.stories-acOxur2H.js +121 -0
- package/dist/assets/DocsRenderer-CFRXHY34-Do1gGJEp.js +623 -0
- package/dist/assets/Intent-UfUixXOL.js +1 -0
- package/dist/assets/ToggleColors-CSr2zujL.js +1 -0
- package/dist/assets/TransitionExpand-BHMSqajW.css +1 -0
- package/dist/assets/TransitionExpand-BLDnMZa8.js +1 -0
- package/dist/assets/TransitionExpand.stories-5x0MQdG_.js +121 -0
- package/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
- package/dist/assets/anime.esm-RriTVqCw.js +8 -0
- package/dist/assets/entry-preview-CE4fSG5C.js +1 -0
- package/dist/assets/entry-preview-docs-DMfJ0ifx.js +16 -0
- package/dist/assets/iframe-DLKLJnYS.js +211 -0
- package/dist/assets/index-Bx-go_-4.js +8 -0
- package/dist/assets/index-CtrtR6PF.js +1 -0
- package/dist/assets/index-DCv8Njl6.js +1 -0
- package/dist/assets/index-DrFu-skq.js +6 -0
- package/dist/assets/preview-B8lJiyuQ.js +34 -0
- package/dist/assets/preview-BBWR9nbA.js +1 -0
- package/dist/assets/preview-BWzBA1C2.js +396 -0
- package/dist/assets/preview-CHl-kSbv.js +2 -0
- package/dist/assets/preview-CIuMKJn5.js +240 -0
- package/dist/assets/preview-CvbIS5ZJ.js +1 -0
- package/dist/assets/preview-D2UkcbT2.js +3 -0
- package/dist/assets/preview-DD_OYowb.js +1 -0
- package/dist/assets/preview-DGUiP6tS.js +7 -0
- package/dist/assets/preview-OgCpecWL.css +1 -0
- package/dist/assets/vue.esm-bundler-DmHyoj4Y.js +36 -0
- package/dist/favicon.svg +1 -0
- package/dist/iframe.html +666 -0
- package/dist/index.html +177 -0
- package/dist/index.json +1 -0
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +1 -0
- package/dist/sb-addons/chromatic-com-storybook-9/manager-bundle.js +331 -0
- package/dist/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +51 -0
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js +402 -0
- package/dist/sb-addons/essentials-docs-3/manager-bundle.js +242 -0
- package/dist/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/dist/sb-addons/storybook-experimental-addon-test-10/manager-bundle.js +223 -0
- package/dist/sb-common-assets/favicon.svg +1 -0
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +1052 -0
- package/dist/sb-manager/globals-runtime.js +42127 -0
- package/dist/sb-manager/globals.js +48 -0
- package/dist/sb-manager/runtime.js +12048 -0
- package/package.json +24 -5
- package/src/README.md +0 -25
- package/src/assets/styles/base/_base.scss +1 -5
- package/src/assets/styles/utilities/_index.scss +19 -0
- package/src/components/core/BaseInputLabel.vue +0 -1
- package/src/components/date-pickers/CpDate.vue +8 -5
- package/src/components/inputs/CpInput.vue +5 -16
- package/src/components/inputs/CpTextarea.vue +4 -6
- package/src/components/selects/CpSelect.vue +5 -5
- package/src/stories/BaseInputLabel.stories.ts +35 -0
- package/src/stories/CpAlert.stories.ts +90 -0
- package/src/stories/CpBadge.stories.ts +158 -0
- package/src/stories/CpButton.stories.ts +134 -0
- package/src/stories/CpCheckbox.stories.ts +184 -0
- package/src/stories/CpDate.stories.ts +110 -0
- package/src/stories/CpDatepicker.stories.ts +162 -0
- package/src/stories/CpDialog.stories.ts +53 -0
- package/src/stories/CpHeading.stories.ts +77 -0
- package/src/stories/CpIcon.stories.ts +79 -0
- package/src/stories/CpInput.stories.ts +155 -0
- package/src/stories/CpLoader.stories.ts +29 -0
- package/src/stories/CpRadio.stories.ts +139 -0
- package/src/stories/CpSelect.stories.ts +147 -0
- package/src/stories/CpSelectMenu.stories.ts +132 -0
- package/src/stories/CpSwitch.stories.ts +137 -0
- package/src/stories/CpTable.stories.ts +192 -0
- package/src/stories/CpTableEmptyState.stories.ts +34 -0
- package/src/stories/CpTextarea.stories.ts +112 -0
- package/src/stories/CpToaster.stories.ts +147 -0
- package/src/stories/CpTooltip.stories.ts +101 -0
- package/src/stories/TransitionExpand.stories.ts +85 -0
- package/vitest.workspace.js +31 -0
- package/dist/pimp.es.js +0 -14987
- package/dist/pimp.umd.js +0 -12
- package/dist/style.css +0 -1
- package/src/App.vue +0 -110
- package/src/components/core/playground-sections/SectionAtomicElements.vue +0 -83
- package/src/components/core/playground-sections/SectionButtons.vue +0 -142
- package/src/components/core/playground-sections/SectionContainer.vue +0 -50
- package/src/components/core/playground-sections/SectionDatePickers.vue +0 -160
- package/src/components/core/playground-sections/SectionDialog.vue +0 -47
- package/src/components/core/playground-sections/SectionFeedbackIndicators.vue +0 -47
- package/src/components/core/playground-sections/SectionInputs.vue +0 -46
- package/src/components/core/playground-sections/SectionListsAndTables.vue +0 -268
- package/src/components/core/playground-sections/SectionSelectMenus.vue +0 -98
- package/src/components/core/playground-sections/SectionSelects.vue +0 -120
- package/src/components/core/playground-sections/SectionSimpleInputs.vue +0 -305
- package/src/components/core/playground-sections/SectionToasters.vue +0 -68
- package/src/components/core/playground-sections/SectionToggles.vue +0 -158
- package/src/components/core/playground-sections/SectionTypography.vue +0 -40
- package/src/main.js +0 -15
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import CpHeading from '@/components/typography/CpHeading.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'CpHeading',
|
|
6
|
+
component: CpHeading,
|
|
7
|
+
argTypes: {
|
|
8
|
+
headingLevel: {
|
|
9
|
+
control: 'select',
|
|
10
|
+
options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
|
11
|
+
description: 'HTML heading level',
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: [100, 200, 300, 400, 500, 600, 700, 800, 900],
|
|
16
|
+
description: 'Size variant of the heading',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
} satisfies Meta<typeof CpHeading>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
type Story = StoryObj<typeof meta>
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
headingLevel: 'h1',
|
|
27
|
+
size: 500,
|
|
28
|
+
},
|
|
29
|
+
render: (args) => ({
|
|
30
|
+
components: { CpHeading },
|
|
31
|
+
setup() {
|
|
32
|
+
return { args }
|
|
33
|
+
},
|
|
34
|
+
template: `
|
|
35
|
+
<div style="padding: 20px;">
|
|
36
|
+
<CpHeading v-bind="args">
|
|
37
|
+
Default Heading
|
|
38
|
+
</CpHeading>
|
|
39
|
+
</div>
|
|
40
|
+
`,
|
|
41
|
+
}),
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const AllSizes: Story = {
|
|
45
|
+
render: () => ({
|
|
46
|
+
components: { CpHeading },
|
|
47
|
+
template: `
|
|
48
|
+
<div style="padding: 20px; display: flex; flex-direction: column; gap: 16px;">
|
|
49
|
+
<CpHeading size="100">Size 100 Heading</CpHeading>
|
|
50
|
+
<CpHeading size="200">Size 200 Heading</CpHeading>
|
|
51
|
+
<CpHeading size="300">Size 300 Heading</CpHeading>
|
|
52
|
+
<CpHeading size="400">Size 400 Heading</CpHeading>
|
|
53
|
+
<CpHeading size="500">Size 500 Heading</CpHeading>
|
|
54
|
+
<CpHeading size="600">Size 600 Heading</CpHeading>
|
|
55
|
+
<CpHeading size="700">Size 700 Heading</CpHeading>
|
|
56
|
+
<CpHeading size="800">Size 800 Heading</CpHeading>
|
|
57
|
+
<CpHeading size="900">Size 900 Heading</CpHeading>
|
|
58
|
+
</div>
|
|
59
|
+
`,
|
|
60
|
+
}),
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const SizeAndLevelCombination: Story = {
|
|
64
|
+
render: () => ({
|
|
65
|
+
components: { CpHeading },
|
|
66
|
+
template: `
|
|
67
|
+
<div style="padding: 20px; display: flex; flex-direction: column; gap: 16px;">
|
|
68
|
+
<CpHeading heading-level="h1" size="900">H1 with Size 900</CpHeading>
|
|
69
|
+
<CpHeading heading-level="h2" size="800">H2 with Size 800</CpHeading>
|
|
70
|
+
<CpHeading heading-level="h3" size="700">H3 with Size 700</CpHeading>
|
|
71
|
+
<CpHeading heading-level="h4" size="600">H4 with Size 600</CpHeading>
|
|
72
|
+
<CpHeading heading-level="h5" size="500">H5 with Size 500</CpHeading>
|
|
73
|
+
<CpHeading heading-level="h6" size="400">H6 with Size 400</CpHeading>
|
|
74
|
+
</div>
|
|
75
|
+
`,
|
|
76
|
+
}),
|
|
77
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import CpIcon from '@/components/visual/CpIcon.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'CpIcon',
|
|
6
|
+
component: CpIcon,
|
|
7
|
+
argTypes: {
|
|
8
|
+
type: {
|
|
9
|
+
control: 'select',
|
|
10
|
+
options: [
|
|
11
|
+
'activity',
|
|
12
|
+
'alert-circle',
|
|
13
|
+
'arrow-down',
|
|
14
|
+
'arrow-left',
|
|
15
|
+
'arrow-right',
|
|
16
|
+
'arrow-up',
|
|
17
|
+
'bell',
|
|
18
|
+
'calendar',
|
|
19
|
+
'check',
|
|
20
|
+
'check-circle',
|
|
21
|
+
'chevron-down',
|
|
22
|
+
'chevron-left',
|
|
23
|
+
'chevron-right',
|
|
24
|
+
'chevron-up',
|
|
25
|
+
'edit',
|
|
26
|
+
'home',
|
|
27
|
+
'search',
|
|
28
|
+
'settings',
|
|
29
|
+
'user',
|
|
30
|
+
'x',
|
|
31
|
+
],
|
|
32
|
+
description: 'Type of icon to display',
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
control: 'number',
|
|
36
|
+
description: 'Size of the icon in pixels',
|
|
37
|
+
},
|
|
38
|
+
tag: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'HTML tag to use for the icon wrapper',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
} satisfies Meta<typeof CpIcon>
|
|
44
|
+
|
|
45
|
+
export default meta
|
|
46
|
+
type Story = StoryObj<typeof meta>
|
|
47
|
+
|
|
48
|
+
export const Default: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
type: 'check',
|
|
51
|
+
size: 24,
|
|
52
|
+
tag: 'i',
|
|
53
|
+
},
|
|
54
|
+
render: (args) => ({
|
|
55
|
+
components: { CpIcon },
|
|
56
|
+
setup() {
|
|
57
|
+
return { args }
|
|
58
|
+
},
|
|
59
|
+
template: `
|
|
60
|
+
<div style="padding: 20px;">
|
|
61
|
+
<CpIcon v-bind="args" />
|
|
62
|
+
</div>
|
|
63
|
+
`,
|
|
64
|
+
}),
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const DifferentSizes: Story = {
|
|
68
|
+
render: () => ({
|
|
69
|
+
components: { CpIcon },
|
|
70
|
+
template: `
|
|
71
|
+
<div style="padding: 20px; display: flex; align-items: center; gap: 16px;">
|
|
72
|
+
<CpIcon type="check" size="16" />
|
|
73
|
+
<CpIcon type="check" size="24" />
|
|
74
|
+
<CpIcon type="check" size="32" />
|
|
75
|
+
<CpIcon type="check" size="48" />
|
|
76
|
+
</div>
|
|
77
|
+
`,
|
|
78
|
+
}),
|
|
79
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import CpInput from '@/components/inputs/CpInput.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'CpInput',
|
|
7
|
+
component: CpInput,
|
|
8
|
+
argTypes: {
|
|
9
|
+
modelValue: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'The input value',
|
|
12
|
+
},
|
|
13
|
+
type: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['text', 'email', 'password', 'number', 'tel', 'url'],
|
|
16
|
+
description: 'The type of input',
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
description: 'Label text for the input',
|
|
21
|
+
},
|
|
22
|
+
placeholder: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Placeholder text',
|
|
25
|
+
},
|
|
26
|
+
required: {
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
description: 'Whether the field is required',
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
control: 'boolean',
|
|
32
|
+
description: 'Whether the field is disabled',
|
|
33
|
+
},
|
|
34
|
+
isInvalid: {
|
|
35
|
+
control: 'boolean',
|
|
36
|
+
description: 'Whether the field is in an invalid state',
|
|
37
|
+
},
|
|
38
|
+
errorMessage: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'Error message to display',
|
|
41
|
+
},
|
|
42
|
+
autocomplete: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
description: 'Autocomplete attribute value',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
} satisfies Meta<typeof CpInput>
|
|
48
|
+
|
|
49
|
+
export default meta
|
|
50
|
+
type Story = StoryObj<typeof meta>
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
label: 'Input Label',
|
|
55
|
+
placeholder: 'Enter text here',
|
|
56
|
+
type: 'text',
|
|
57
|
+
required: false,
|
|
58
|
+
disabled: false,
|
|
59
|
+
autocomplete: 'off',
|
|
60
|
+
isInvalid: false,
|
|
61
|
+
errorMessage: '',
|
|
62
|
+
hideInvalidityIcon: false,
|
|
63
|
+
removeBorder: false,
|
|
64
|
+
isLarge: false,
|
|
65
|
+
isSearch: false,
|
|
66
|
+
help: '',
|
|
67
|
+
},
|
|
68
|
+
render: (args) => ({
|
|
69
|
+
components: { CpInput },
|
|
70
|
+
setup() {
|
|
71
|
+
const value = ref('')
|
|
72
|
+
return { args, value }
|
|
73
|
+
},
|
|
74
|
+
template: `
|
|
75
|
+
<div style="max-width: 400px; padding: 20px;">
|
|
76
|
+
<CpInput
|
|
77
|
+
v-model="value"
|
|
78
|
+
v-bind="args"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
`,
|
|
82
|
+
}),
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const WithError: Story = {
|
|
86
|
+
args: {
|
|
87
|
+
...Default.args,
|
|
88
|
+
isInvalid: true,
|
|
89
|
+
errorMessage: 'This field is required',
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const Required: Story = {
|
|
94
|
+
args: {
|
|
95
|
+
...Default.args,
|
|
96
|
+
required: true,
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const Disabled: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
...Default.args,
|
|
103
|
+
disabled: true,
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const Email: Story = {
|
|
108
|
+
args: {
|
|
109
|
+
...Default.args,
|
|
110
|
+
type: 'email',
|
|
111
|
+
label: 'Email Address',
|
|
112
|
+
placeholder: 'Enter your email',
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const Password: Story = {
|
|
117
|
+
args: {
|
|
118
|
+
...Default.args,
|
|
119
|
+
type: 'password',
|
|
120
|
+
label: 'Password',
|
|
121
|
+
placeholder: 'Enter your password',
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const Number: Story = {
|
|
126
|
+
args: {
|
|
127
|
+
...Default.args,
|
|
128
|
+
type: 'number',
|
|
129
|
+
label: 'Amount',
|
|
130
|
+
placeholder: 'Enter amount',
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const HelpAndTooltip: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
...Default.args,
|
|
137
|
+
help: 'This is a help text',
|
|
138
|
+
tooltip: 'This is a tooltip',
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const Search: Story = {
|
|
143
|
+
args: {
|
|
144
|
+
...Default.args,
|
|
145
|
+
isSearch: true,
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const Mask: Story = {
|
|
150
|
+
args: {
|
|
151
|
+
...Default.args,
|
|
152
|
+
placeholder: 'Enter your phone number',
|
|
153
|
+
mask: '## ## ## ## ##',
|
|
154
|
+
},
|
|
155
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import CpLoader from '@/components/feedback-indicators/CpLoader.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'CpLoader',
|
|
6
|
+
component: CpLoader,
|
|
7
|
+
argTypes: {
|
|
8
|
+
color: {
|
|
9
|
+
control: 'color',
|
|
10
|
+
description: 'The color of the loader',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof CpLoader>
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
16
|
+
type Story = StoryObj<typeof meta>
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
color: '#4F46E5',
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const CustomColor: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
...Default.args,
|
|
27
|
+
color: '#10B981',
|
|
28
|
+
},
|
|
29
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import CpRadio from '@/components/toggles/CpRadio.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'CpRadio',
|
|
7
|
+
component: CpRadio,
|
|
8
|
+
argTypes: {
|
|
9
|
+
modelValue: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'The selected radio value',
|
|
12
|
+
},
|
|
13
|
+
options: {
|
|
14
|
+
control: 'object',
|
|
15
|
+
description: 'Array of radio options',
|
|
16
|
+
},
|
|
17
|
+
groupName: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'Name attribute for radio group',
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
control: 'select',
|
|
23
|
+
options: ['blue', 'purple'],
|
|
24
|
+
description: 'Color variant of the radio',
|
|
25
|
+
},
|
|
26
|
+
autofocus: {
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
description: 'Whether to autofocus the first radio',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta<typeof CpRadio>
|
|
32
|
+
|
|
33
|
+
export default meta
|
|
34
|
+
type Story = StoryObj<typeof meta>
|
|
35
|
+
|
|
36
|
+
const sampleOptions = [
|
|
37
|
+
{ value: 'option1', label: 'Option 1' },
|
|
38
|
+
{ value: 'option2', label: 'Option 2' },
|
|
39
|
+
{ value: 'option3', label: 'Option 3' },
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
export const Default: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
modelValue: 'option1',
|
|
45
|
+
options: sampleOptions,
|
|
46
|
+
groupName: 'radio-group',
|
|
47
|
+
color: 'blue',
|
|
48
|
+
autofocus: false,
|
|
49
|
+
},
|
|
50
|
+
render: (args) => ({
|
|
51
|
+
components: { CpRadio },
|
|
52
|
+
setup() {
|
|
53
|
+
const value = ref(args.modelValue)
|
|
54
|
+
return { args, value }
|
|
55
|
+
},
|
|
56
|
+
template: `
|
|
57
|
+
<div style="min-width: 400px; padding: 20px;">
|
|
58
|
+
<CpRadio
|
|
59
|
+
v-model="value"
|
|
60
|
+
v-bind="args"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
`,
|
|
64
|
+
}),
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const WithDescriptions: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
...Default.args,
|
|
70
|
+
options: [
|
|
71
|
+
{ value: 'option1', label: 'Basic Plan', description: 'Perfect for individuals' },
|
|
72
|
+
{ value: 'option2', label: 'Pro Plan', description: 'Great for small teams' },
|
|
73
|
+
{ value: 'option3', label: 'Enterprise Plan', description: 'For large organizations' },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const WithAdditionalData: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
...Default.args,
|
|
81
|
+
options: [
|
|
82
|
+
{ value: 'option1', label: 'Monthly', additionalData: '$10/mo' },
|
|
83
|
+
{ value: 'option2', label: 'Yearly', additionalData: '$100/yr' },
|
|
84
|
+
{ value: 'option3', label: 'Lifetime', additionalData: '$500' },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const WithDisabledOptions: Story = {
|
|
90
|
+
args: {
|
|
91
|
+
...Default.args,
|
|
92
|
+
options: [
|
|
93
|
+
{ value: 'option1', label: 'Option 1' },
|
|
94
|
+
{ value: 'option2', label: 'Option 2', disabled: true },
|
|
95
|
+
{ value: 'option3', label: 'Option 3' },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
render: (args) => ({
|
|
99
|
+
components: { CpRadio },
|
|
100
|
+
setup() {
|
|
101
|
+
const value = ref(args.modelValue)
|
|
102
|
+
return { args, value }
|
|
103
|
+
},
|
|
104
|
+
template: `
|
|
105
|
+
<div style="min-width: 400px; padding: 20px;">
|
|
106
|
+
<CpRadio
|
|
107
|
+
v-model="value"
|
|
108
|
+
v-bind="args"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
`,
|
|
112
|
+
}),
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const ComplexOptions: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
...Default.args,
|
|
118
|
+
options: [
|
|
119
|
+
{
|
|
120
|
+
value: 'option1',
|
|
121
|
+
label: 'Basic Plan',
|
|
122
|
+
description: 'Perfect for individuals',
|
|
123
|
+
additionalData: '$10/mo',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
value: 'option2',
|
|
127
|
+
label: 'Pro Plan',
|
|
128
|
+
description: 'Great for small teams',
|
|
129
|
+
additionalData: '$30/mo',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
value: 'option3',
|
|
133
|
+
label: 'Enterprise Plan',
|
|
134
|
+
description: 'For large organizations',
|
|
135
|
+
additionalData: '$100/mo',
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import CpSelect from '@/components/selects/CpSelect.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'CpSelect',
|
|
7
|
+
component: CpSelect,
|
|
8
|
+
argTypes: {
|
|
9
|
+
modelValue: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'The selected value',
|
|
12
|
+
},
|
|
13
|
+
label: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'Label text for the select',
|
|
16
|
+
},
|
|
17
|
+
options: {
|
|
18
|
+
control: 'object',
|
|
19
|
+
description: 'Array of options to display',
|
|
20
|
+
},
|
|
21
|
+
defaultValue: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Default option text',
|
|
24
|
+
},
|
|
25
|
+
hideDefaultValue: {
|
|
26
|
+
control: 'boolean',
|
|
27
|
+
description: 'Whether to hide the default option',
|
|
28
|
+
},
|
|
29
|
+
required: {
|
|
30
|
+
control: 'boolean',
|
|
31
|
+
description: 'Whether the field is required',
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
description: 'Whether the field is disabled',
|
|
36
|
+
},
|
|
37
|
+
isInvalid: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Whether the field is in an invalid state',
|
|
40
|
+
},
|
|
41
|
+
errorMessage: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
description: 'Error message to display',
|
|
44
|
+
},
|
|
45
|
+
isLarge: {
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
description: 'Whether to use large size variant',
|
|
48
|
+
},
|
|
49
|
+
autocomplete: {
|
|
50
|
+
control: 'text',
|
|
51
|
+
description: 'Autocomplete attribute value',
|
|
52
|
+
},
|
|
53
|
+
name: {
|
|
54
|
+
control: 'text',
|
|
55
|
+
description: 'Name attribute for the select',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
} satisfies Meta<typeof CpSelect>
|
|
59
|
+
|
|
60
|
+
export default meta
|
|
61
|
+
type Story = StoryObj<typeof meta>
|
|
62
|
+
|
|
63
|
+
const sampleOptions = [
|
|
64
|
+
{ value: '1', label: 'Option 1' },
|
|
65
|
+
{ value: '2', label: 'Option 2' },
|
|
66
|
+
{ value: '3', label: 'Option 3' },
|
|
67
|
+
{ value: '4', label: 'Option 4' },
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
export const Default: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
label: 'Select Label',
|
|
73
|
+
options: sampleOptions,
|
|
74
|
+
defaultValue: 'Select an option',
|
|
75
|
+
hideDefaultValue: false,
|
|
76
|
+
required: false,
|
|
77
|
+
disabled: false,
|
|
78
|
+
isInvalid: false,
|
|
79
|
+
errorMessage: '',
|
|
80
|
+
isLarge: false,
|
|
81
|
+
autocomplete: 'on',
|
|
82
|
+
name: 'select-field',
|
|
83
|
+
},
|
|
84
|
+
render: (args) => ({
|
|
85
|
+
components: { CpSelect },
|
|
86
|
+
setup() {
|
|
87
|
+
const value = ref('')
|
|
88
|
+
return { args, value }
|
|
89
|
+
},
|
|
90
|
+
template: `
|
|
91
|
+
<div style="max-width: 400px; padding: 20px;">
|
|
92
|
+
<CpSelect
|
|
93
|
+
v-model="value"
|
|
94
|
+
v-bind="args"
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
`,
|
|
98
|
+
}),
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const WithError: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
...Default.args,
|
|
104
|
+
isInvalid: true,
|
|
105
|
+
errorMessage: 'This field is required',
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const Required: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
...Default.args,
|
|
112
|
+
required: true,
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const Disabled: Story = {
|
|
117
|
+
args: {
|
|
118
|
+
...Default.args,
|
|
119
|
+
disabled: true,
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const Large: Story = {
|
|
124
|
+
args: {
|
|
125
|
+
...Default.args,
|
|
126
|
+
isLarge: true,
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const WithoutDefaultOption: Story = {
|
|
131
|
+
args: {
|
|
132
|
+
...Default.args,
|
|
133
|
+
hideDefaultValue: true,
|
|
134
|
+
},
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const WithLongOptions: Story = {
|
|
138
|
+
args: {
|
|
139
|
+
...Default.args,
|
|
140
|
+
options: [
|
|
141
|
+
{ value: '1', label: 'This is a very long option text that might need to be truncated' },
|
|
142
|
+
{ value: '2', label: 'Another long option that demonstrates text truncation' },
|
|
143
|
+
{ value: '3', label: 'Short option' },
|
|
144
|
+
{ value: '4', label: 'Yet another long option to show how the select handles long text' },
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
}
|