@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
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citizenplane/pimp",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"dev": "
|
|
6
|
-
"build": "
|
|
7
|
-
"preview": "vite preview",
|
|
5
|
+
"dev": "storybook dev -p 8080",
|
|
6
|
+
"build": "storybook build --output-dir ./dist",
|
|
8
7
|
"lint": "eslint --fix src",
|
|
9
8
|
"format": "prettier . --write",
|
|
10
9
|
"test": "jest tests"
|
|
@@ -37,9 +36,20 @@
|
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@babel/core": "^7.27.1",
|
|
39
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
40
40
|
"@eslint/eslintrc": "^3.3.1",
|
|
41
41
|
"@eslint/js": "^9.26.0",
|
|
42
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
43
|
+
"@storybook/addon-onboarding": "^8.6.14",
|
|
44
|
+
"@storybook/blocks": "^8.6.14",
|
|
45
|
+
"@storybook/experimental-addon-test": "^8.6.14",
|
|
46
|
+
"@storybook/preset-scss": "^1.0.3",
|
|
47
|
+
"@storybook/test": "^8.6.14",
|
|
48
|
+
"@storybook/vue3": "^8.6.14",
|
|
49
|
+
"@storybook/vue3-vite": "^8.6.14",
|
|
42
50
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
51
|
+
"@vitest/browser": "^3.1.4",
|
|
52
|
+
"@vitest/coverage-v8": "^3.1.4",
|
|
43
53
|
"@vue/babel-preset-app": "^5.0.8",
|
|
44
54
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
45
55
|
"@vue/test-utils": "^2.4.6",
|
|
@@ -47,15 +57,24 @@
|
|
|
47
57
|
"babel-core": "^7.0.0-bridge.0",
|
|
48
58
|
"eslint": "^9.26.0",
|
|
49
59
|
"eslint-plugin-prettier": "^5.4.0",
|
|
60
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
50
61
|
"eslint-plugin-vue": "^10.1.0",
|
|
51
62
|
"globals": "^16.1.0",
|
|
52
63
|
"husky": "^9.1.7",
|
|
53
64
|
"jest": "~29.7.0",
|
|
54
65
|
"jest-environment-jsdom": "^29.7.0",
|
|
55
66
|
"lint-staged": "^16.0.0",
|
|
67
|
+
"playwright": "^1.52.0",
|
|
56
68
|
"prettier": "^3.5.3",
|
|
57
69
|
"sass": "~1.88.0",
|
|
58
70
|
"sass-loader": "^16.0.5",
|
|
59
|
-
"
|
|
71
|
+
"storybook": "^8.6.14",
|
|
72
|
+
"vite": "^6.3.5",
|
|
73
|
+
"vitest": "^3.1.4"
|
|
74
|
+
},
|
|
75
|
+
"eslintConfig": {
|
|
76
|
+
"extends": [
|
|
77
|
+
"plugin:storybook/recommended"
|
|
78
|
+
]
|
|
60
79
|
}
|
|
61
80
|
}
|
package/src/README.md
CHANGED
|
@@ -9,7 +9,6 @@ There is 4 different ways you can contribute & improve Pimp components library.
|
|
|
9
9
|
- 🌟 Major update: changes that break backward compatibility
|
|
10
10
|
- 💅 Minor update: backward compatible new features
|
|
11
11
|
- 🐛 Patch update: backward compatible bug fixes
|
|
12
|
-
- 📚 Documentation update: make the documentation up-to-date with last releases
|
|
13
12
|
|
|
14
13
|
These 4 different contributions have their own specific processes that will be described in the following sections.
|
|
15
14
|
|
|
@@ -21,8 +20,6 @@ These 4 different contributions have their own specific processes that will be d
|
|
|
21
20
|
|
|
22
21
|
Your update is a major one if your changes break the previous version.
|
|
23
22
|
|
|
24
|
-
> 💡 If your changes need a documentation update (new component, updated props), add a ticket in the [Product Roadmap on Notion](https://www.notion.so/citizenplane/e23d1b492dc04c85be2416102634e3b5?v=c7ff85f676f74b6ebf31989e56614518) that describes what to update.
|
|
25
|
-
|
|
26
23
|
See the [release](#release) section for instructions on how to release properly the new package version
|
|
27
24
|
|
|
28
25
|
### 💅 Minor update
|
|
@@ -39,8 +36,6 @@ If you're adding a new component to the library, here is what you should do:
|
|
|
39
36
|
|
|
40
37
|
Once you're done with the implementation, see the [release](#release) section for instructions on how to release properly the new package version.
|
|
41
38
|
|
|
42
|
-
> 💡 If your changes need a documentation update (new component, updated props), add a ticket in the [Product Roadmap on Notion](https://www.notion.so/citizenplane/e23d1b492dc04c85be2416102634e3b5?v=c7ff85f676f74b6ebf31989e56614518) that describes what to update.
|
|
43
|
-
|
|
44
39
|
See the [release](#release) section for instructions on how to release properly the new package version
|
|
45
40
|
|
|
46
41
|
### 🐛 Patch update
|
|
@@ -49,22 +44,6 @@ Your update is a patch one if your changes concern a bug in the current version
|
|
|
49
44
|
|
|
50
45
|
See the [release](#release) section for instructions on how to release properly the new package version
|
|
51
46
|
|
|
52
|
-
### 📚 Documentation update
|
|
53
|
-
|
|
54
|
-
Documentation update are done so developers who are using the `@citizenplane/pimp` package can use components without any pain. Contrarily to other updates types, this one happens in the `/docs` directory.
|
|
55
|
-
|
|
56
|
-
In order to run the documentation, move into `/docs` folder and run the `npm run dev` command.
|
|
57
|
-
|
|
58
|
-
> Project is running on http://localhost:8080
|
|
59
|
-
|
|
60
|
-
Every time you update the documentation, the first thing you should do is to ensure you update the corresponding version in the docs `package.json`.
|
|
61
|
-
|
|
62
|
-
Then, you can update the different sections that needs to.
|
|
63
|
-
|
|
64
|
-
> If you've never used Vuepress before, check out their [docs](https://vuepress.vuejs.org/guide/).
|
|
65
|
-
|
|
66
|
-
Once you've finished, create the corresponding MR and see the corresponding [release](#documentation-release) section
|
|
67
|
-
|
|
68
47
|
## Release
|
|
69
48
|
|
|
70
49
|
### Components release
|
|
@@ -85,10 +64,6 @@ Once it's finished, you'll get the last version of the package.
|
|
|
85
64
|
|
|
86
65
|
You'll be able to use last components updates just by upgrading the package in corresponding projects.
|
|
87
66
|
|
|
88
|
-
### Documentation release
|
|
89
|
-
|
|
90
|
-
The release process is the classical one; when CI has passed, you can deploy to production the new documentation version.
|
|
91
|
-
|
|
92
67
|
## Visuals 🖼
|
|
93
68
|
|
|
94
69
|
 _Documentation mode_
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
@use '../variables/colors' as colors;
|
|
2
|
+
@use '../helpers/functions' as fn;
|
|
3
|
+
|
|
1
4
|
.u-text-ellipsis,
|
|
2
5
|
%u-text-ellipsis {
|
|
3
6
|
white-space: nowrap;
|
|
4
7
|
text-overflow: ellipsis;
|
|
5
8
|
overflow: hidden;
|
|
6
9
|
}
|
|
10
|
+
|
|
11
|
+
.u-asterisk {
|
|
12
|
+
position: relative;
|
|
13
|
+
top: fn.px-to-rem(-3);
|
|
14
|
+
font-size: fn.px-to-em(12);
|
|
15
|
+
line-height: normal;
|
|
16
|
+
|
|
17
|
+
&::after {
|
|
18
|
+
content: ' ';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
legend .u-asterisk,
|
|
23
|
+
label .u-asterisk {
|
|
24
|
+
color: colors.$error-color;
|
|
25
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cpDate" :class="dynamicClasses">
|
|
3
3
|
<label v-if="label" class="cpDate__label" :for="cpDateId">
|
|
4
|
-
{{
|
|
4
|
+
{{ capitalizedLabel }} <span v-if="required" class="u-asterisk">*</span>
|
|
5
|
+
<cp-icon v-if="!isDateValid" type="alert-circle" />
|
|
5
6
|
</label>
|
|
6
7
|
<div class="cpDate__inputs">
|
|
7
8
|
<input
|
|
@@ -120,10 +121,8 @@ export default {
|
|
|
120
121
|
}
|
|
121
122
|
},
|
|
122
123
|
computed: {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return `${capitalizeFirstLetter(this.label)} ${requiredLabel}`
|
|
124
|
+
capitalizedLabel() {
|
|
125
|
+
return capitalizeFirstLetter(this.label)
|
|
127
126
|
},
|
|
128
127
|
cpDateId() {
|
|
129
128
|
return randomString()
|
|
@@ -324,6 +323,10 @@ export default {
|
|
|
324
323
|
margin-bottom: sp.$space;
|
|
325
324
|
font-size: fn.px-to-em(14);
|
|
326
325
|
|
|
326
|
+
> span {
|
|
327
|
+
margin-left: sp.$space-xs;
|
|
328
|
+
}
|
|
329
|
+
|
|
327
330
|
i {
|
|
328
331
|
margin-left: sp.$space-sm;
|
|
329
332
|
width: fn.px-to-rem(16);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cpInput" :class="dynamicClasses" :aria-disabled="isDisabled" @click="focusOnInput">
|
|
3
|
-
<base-input-label v-if="label" v-bind-once="{ for: inputIdentifier }"
|
|
4
|
-
{{
|
|
3
|
+
<base-input-label v-if="label" v-bind-once="{ for: inputIdentifier }">
|
|
4
|
+
{{ capitalizedLabel }} <span v-if="isRequired" class="u-asterisk">*</span>
|
|
5
5
|
<cp-tooltip v-if="tooltip" :content="tooltip">
|
|
6
6
|
<button type="button" class="cpInput__tooltip">
|
|
7
7
|
<icon-tooltip class="cpInput__tooltipIcon" />
|
|
@@ -61,7 +61,7 @@ import { ref, useAttrs, useSlots, computed, nextTick, onMounted, useId } from 'v
|
|
|
61
61
|
|
|
62
62
|
import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
|
|
63
63
|
|
|
64
|
-
import { randomString } from '@/helpers'
|
|
64
|
+
import { randomString, capitalizeFirstLetter } from '@/helpers'
|
|
65
65
|
|
|
66
66
|
const props = defineProps({
|
|
67
67
|
modelValue: {
|
|
@@ -133,6 +133,8 @@ const inputDescribedByAttribute = computed(() => `${helpMessageId} ${errorMessag
|
|
|
133
133
|
|
|
134
134
|
const slots = useSlots()
|
|
135
135
|
|
|
136
|
+
const capitalizedLabel = computed(() => capitalizeFirstLetter(props.label))
|
|
137
|
+
|
|
136
138
|
const inputModel = defineModel({
|
|
137
139
|
type: [String, Number, Boolean],
|
|
138
140
|
default: '',
|
|
@@ -324,19 +326,6 @@ onMounted(async () => {
|
|
|
324
326
|
box-shadow: none;
|
|
325
327
|
}
|
|
326
328
|
|
|
327
|
-
&__label {
|
|
328
|
-
display: flex;
|
|
329
|
-
align-items: center;
|
|
330
|
-
font-size: fn.px-to-em(14);
|
|
331
|
-
line-height: fn.px-to-rem(24);
|
|
332
|
-
margin-bottom: sp.$space;
|
|
333
|
-
gap: sp.$space-sm;
|
|
334
|
-
|
|
335
|
-
sup {
|
|
336
|
-
color: colors.$error-color;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
329
|
&__tooltip {
|
|
341
330
|
display: flex;
|
|
342
331
|
padding: sp.$space-sm;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cpTextarea">
|
|
3
3
|
<base-input-label v-if="label" v-bind-once="{ for: inputIdentifier }" class="cpTextarea__label">
|
|
4
|
-
{{
|
|
4
|
+
{{ capitalizedLabel }}
|
|
5
|
+
<span v-if="required" class="u-asterisk">*</span>
|
|
5
6
|
</base-input-label>
|
|
6
7
|
<textarea
|
|
7
8
|
v-model="textareaModel"
|
|
@@ -32,7 +33,7 @@ import { ref, computed } from 'vue'
|
|
|
32
33
|
import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
|
|
33
34
|
import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vue'
|
|
34
35
|
|
|
35
|
-
import { randomString } from '@/helpers'
|
|
36
|
+
import { randomString, capitalizeFirstLetter } from '@/helpers'
|
|
36
37
|
|
|
37
38
|
const props = defineProps({
|
|
38
39
|
modelValue: {
|
|
@@ -96,10 +97,7 @@ const textareaModel = defineModel({
|
|
|
96
97
|
|
|
97
98
|
const inputIdentifier = ref(props.inputId || randomString())
|
|
98
99
|
|
|
99
|
-
const
|
|
100
|
-
const requiredLabel = props.required && props.label ? '*' : ''
|
|
101
|
-
return `${props.label} ${requiredLabel}`
|
|
102
|
-
})
|
|
100
|
+
const capitalizedLabel = computed(() => capitalizeFirstLetter(props.label))
|
|
103
101
|
|
|
104
102
|
const displayErrorMessage = computed(() => props.isInvalid && props.errorMessage.length)
|
|
105
103
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cpSelect" :class="dynamicClasses">
|
|
3
3
|
<base-input-label v-if="label" :for="selectReferenceId" class="cpSelect__label">
|
|
4
|
-
{{
|
|
4
|
+
{{ capitalizedLabel }} <span v-if="required" class="u-asterisk">*</span>
|
|
5
5
|
</base-input-label>
|
|
6
6
|
<div class="cpSelect__container">
|
|
7
7
|
<select
|
|
@@ -38,6 +38,8 @@ import { randomString } from '@/helpers'
|
|
|
38
38
|
import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
|
|
39
39
|
import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vue'
|
|
40
40
|
|
|
41
|
+
import { capitalizeFirstLetter } from '@/helpers'
|
|
42
|
+
|
|
41
43
|
export default {
|
|
42
44
|
name: 'CpSelect',
|
|
43
45
|
components: {
|
|
@@ -101,10 +103,8 @@ export default {
|
|
|
101
103
|
}
|
|
102
104
|
},
|
|
103
105
|
computed: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return `${this.label} ${requiredLabel}`
|
|
106
|
+
capitalizedLabel() {
|
|
107
|
+
return capitalizeFirstLetter(this.label)
|
|
108
108
|
},
|
|
109
109
|
dynamicClasses() {
|
|
110
110
|
return {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'BaseInputLabel',
|
|
6
|
+
component: BaseInputLabel,
|
|
7
|
+
argTypes: {
|
|
8
|
+
isInvalid: {
|
|
9
|
+
control: 'boolean',
|
|
10
|
+
description: 'Whether the label should show an invalid state',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof BaseInputLabel>
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
16
|
+
type Story = StoryObj<typeof meta>
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
isInvalid: false,
|
|
21
|
+
},
|
|
22
|
+
render: (args) => ({
|
|
23
|
+
components: { BaseInputLabel },
|
|
24
|
+
setup() {
|
|
25
|
+
return { args }
|
|
26
|
+
},
|
|
27
|
+
template: `
|
|
28
|
+
<div class="baseInputLabel-story">
|
|
29
|
+
<BaseInputLabel v-bind="args">
|
|
30
|
+
Default Label
|
|
31
|
+
</BaseInputLabel>
|
|
32
|
+
</div>
|
|
33
|
+
`,
|
|
34
|
+
}),
|
|
35
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import CpAlert from '@/components/feedback-indicators/CpAlert.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'CpAlert',
|
|
6
|
+
component: CpAlert,
|
|
7
|
+
argTypes: {
|
|
8
|
+
intent: {
|
|
9
|
+
control: 'select',
|
|
10
|
+
options: ['info', 'success', 'warning', 'critical'],
|
|
11
|
+
description: 'The type of alert',
|
|
12
|
+
},
|
|
13
|
+
title: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'The title of the alert',
|
|
16
|
+
},
|
|
17
|
+
isClosable: {
|
|
18
|
+
control: 'boolean',
|
|
19
|
+
description: 'Whether the alert can be closed',
|
|
20
|
+
},
|
|
21
|
+
onClose: { action: 'closed' },
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta<typeof CpAlert>
|
|
24
|
+
|
|
25
|
+
export default meta
|
|
26
|
+
type Story = StoryObj<typeof meta>
|
|
27
|
+
|
|
28
|
+
const defaultTemplate = `
|
|
29
|
+
<CpAlert v-bind="args">
|
|
30
|
+
Default slot content
|
|
31
|
+
</CpAlert>
|
|
32
|
+
`
|
|
33
|
+
|
|
34
|
+
export const Default: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
title: 'Alert title',
|
|
37
|
+
intent: 'info',
|
|
38
|
+
isClosable: true,
|
|
39
|
+
},
|
|
40
|
+
render: (args) => ({
|
|
41
|
+
components: { CpAlert },
|
|
42
|
+
setup() {
|
|
43
|
+
return { args }
|
|
44
|
+
},
|
|
45
|
+
template: defaultTemplate,
|
|
46
|
+
}),
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Success: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
...Default.args,
|
|
52
|
+
intent: 'success',
|
|
53
|
+
},
|
|
54
|
+
render: (args) => ({
|
|
55
|
+
...Default.render(args),
|
|
56
|
+
template: defaultTemplate,
|
|
57
|
+
}),
|
|
58
|
+
}
|
|
59
|
+
export const Warning: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
...Default.args,
|
|
62
|
+
intent: 'warning',
|
|
63
|
+
},
|
|
64
|
+
render: (args) => ({
|
|
65
|
+
...Default.render(args),
|
|
66
|
+
template: defaultTemplate,
|
|
67
|
+
}),
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const Error: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
...Default.args,
|
|
73
|
+
intent: 'critical',
|
|
74
|
+
},
|
|
75
|
+
render: (args) => ({
|
|
76
|
+
...Default.render(args),
|
|
77
|
+
template: defaultTemplate,
|
|
78
|
+
}),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const NotClosable: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
...Default.args,
|
|
84
|
+
isClosable: false,
|
|
85
|
+
},
|
|
86
|
+
render: (args) => ({
|
|
87
|
+
...Default.render(args),
|
|
88
|
+
template: defaultTemplate,
|
|
89
|
+
}),
|
|
90
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
|
|
3
|
+
import CpBadge from '@/components/atomic-elements/CpBadge.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'CpBadge',
|
|
7
|
+
component: CpBadge,
|
|
8
|
+
argTypes: {
|
|
9
|
+
color: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: ['neutral', 'blue', 'green', 'red', 'orange', 'purple', 'teal', 'pink', 'yellow'],
|
|
12
|
+
description: 'The color variant of the badge',
|
|
13
|
+
},
|
|
14
|
+
isSolid: {
|
|
15
|
+
control: 'boolean',
|
|
16
|
+
description: 'Whether the badge has a solid background',
|
|
17
|
+
},
|
|
18
|
+
isPlain: {
|
|
19
|
+
control: 'boolean',
|
|
20
|
+
description: 'Whether the badge has a plain style (no dot)',
|
|
21
|
+
},
|
|
22
|
+
isClearable: {
|
|
23
|
+
control: 'boolean',
|
|
24
|
+
description: 'Whether the badge can be cleared',
|
|
25
|
+
},
|
|
26
|
+
icon: {
|
|
27
|
+
control: 'select',
|
|
28
|
+
options: ['arrow-left', 'arrow-right', 'arrow-up', 'arrow-down', 'check'],
|
|
29
|
+
description: 'The icon to display in the badge',
|
|
30
|
+
},
|
|
31
|
+
onClear: { action: 'cleared' },
|
|
32
|
+
},
|
|
33
|
+
} satisfies Meta<typeof CpBadge>
|
|
34
|
+
|
|
35
|
+
export default meta
|
|
36
|
+
type Story = StoryObj<typeof meta>
|
|
37
|
+
|
|
38
|
+
export const Default: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
color: 'neutral',
|
|
41
|
+
isSolid: false,
|
|
42
|
+
isPlain: false,
|
|
43
|
+
isClearable: false,
|
|
44
|
+
icon: '',
|
|
45
|
+
},
|
|
46
|
+
render: (args) => ({
|
|
47
|
+
components: { CpBadge },
|
|
48
|
+
setup() {
|
|
49
|
+
return { args }
|
|
50
|
+
},
|
|
51
|
+
template: '<CpBadge v-bind="args">Badge</CpBadge>',
|
|
52
|
+
}),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const WithColors: Story = {
|
|
56
|
+
render: (args) => ({
|
|
57
|
+
components: { CpBadge },
|
|
58
|
+
setup() {
|
|
59
|
+
return { args }
|
|
60
|
+
},
|
|
61
|
+
template: `
|
|
62
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
63
|
+
<CpBadge color="neutral">Neutral</CpBadge>
|
|
64
|
+
<CpBadge color="blue">Blue</CpBadge>
|
|
65
|
+
<CpBadge color="green">Green</CpBadge>
|
|
66
|
+
<CpBadge color="red">Red</CpBadge>
|
|
67
|
+
<CpBadge color="orange">Orange</CpBadge>
|
|
68
|
+
<CpBadge color="purple">Purple</CpBadge>
|
|
69
|
+
<CpBadge color="teal">Teal</CpBadge>
|
|
70
|
+
<CpBadge color="pink">Pink</CpBadge>
|
|
71
|
+
<CpBadge color="yellow">Yellow</CpBadge>
|
|
72
|
+
</div>
|
|
73
|
+
`,
|
|
74
|
+
}),
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const Solid: Story = {
|
|
78
|
+
render: (args) => ({
|
|
79
|
+
components: { CpBadge },
|
|
80
|
+
setup() {
|
|
81
|
+
return { args }
|
|
82
|
+
},
|
|
83
|
+
template: `
|
|
84
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
85
|
+
<CpBadge color="neutral" is-solid>Neutral</CpBadge>
|
|
86
|
+
<CpBadge color="blue" is-solid>Blue</CpBadge>
|
|
87
|
+
<CpBadge color="green" is-solid>Green</CpBadge>
|
|
88
|
+
<CpBadge color="red" is-solid>Red</CpBadge>
|
|
89
|
+
<CpBadge color="orange" is-solid>Orange</CpBadge>
|
|
90
|
+
<CpBadge color="purple" is-solid>Purple</CpBadge>
|
|
91
|
+
<CpBadge color="teal" is-solid>Teal</CpBadge>
|
|
92
|
+
<CpBadge color="pink" is-solid>Pink</CpBadge>
|
|
93
|
+
<CpBadge color="yellow" is-solid>Yellow</CpBadge>
|
|
94
|
+
</div>
|
|
95
|
+
`,
|
|
96
|
+
}),
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const WithIcon: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
color: 'blue',
|
|
102
|
+
icon: 'check',
|
|
103
|
+
},
|
|
104
|
+
render: (args) => ({
|
|
105
|
+
components: { CpBadge },
|
|
106
|
+
setup() {
|
|
107
|
+
return { args }
|
|
108
|
+
},
|
|
109
|
+
template: '<CpBadge v-bind="args">With Icon</CpBadge>',
|
|
110
|
+
}),
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const Clearable: Story = {
|
|
114
|
+
args: {
|
|
115
|
+
color: 'blue',
|
|
116
|
+
isClearable: true,
|
|
117
|
+
},
|
|
118
|
+
render: (args) => ({
|
|
119
|
+
components: { CpBadge },
|
|
120
|
+
setup() {
|
|
121
|
+
return { args }
|
|
122
|
+
},
|
|
123
|
+
template: '<CpBadge v-bind="args">Clearable Badge</CpBadge>',
|
|
124
|
+
}),
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const Plain: Story = {
|
|
128
|
+
args: {
|
|
129
|
+
color: 'green',
|
|
130
|
+
isPlain: true,
|
|
131
|
+
},
|
|
132
|
+
render: (args) => ({
|
|
133
|
+
components: { CpBadge },
|
|
134
|
+
setup() {
|
|
135
|
+
return { args }
|
|
136
|
+
},
|
|
137
|
+
template: '<CpBadge v-bind="args">Plain Badge</CpBadge>',
|
|
138
|
+
}),
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const AllVariants: Story = {
|
|
142
|
+
render: (args) => ({
|
|
143
|
+
components: { CpBadge },
|
|
144
|
+
setup() {
|
|
145
|
+
return { args }
|
|
146
|
+
},
|
|
147
|
+
template: `
|
|
148
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
149
|
+
<CpBadge color="blue">Default</CpBadge>
|
|
150
|
+
<CpBadge color="blue" is-solid>Solid</CpBadge>
|
|
151
|
+
<CpBadge color="blue" is-plain>Plain</CpBadge>
|
|
152
|
+
<CpBadge color="blue" is-clearable>Clearable</CpBadge>
|
|
153
|
+
<CpBadge color="blue" icon="check">With Icon</CpBadge>
|
|
154
|
+
<CpBadge color="blue" is-solid is-clearable>Solid Clearable</CpBadge>
|
|
155
|
+
</div>
|
|
156
|
+
`,
|
|
157
|
+
}),
|
|
158
|
+
}
|