@bethinkpl/design-system 15.2.1 → 16.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +4 -0
- package/.storybook/main.js +16 -8
- package/dist/demo.html +1 -8
- package/dist/design-system.umd.js +18210 -16610
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Badges/Badge/Badge.stories.d.ts +4 -39
- package/dist/lib/js/components/Badges/BadgeScore/BadgeScore.stories.d.ts +3 -108
- package/dist/lib/js/components/Badges/BadgeScore/BadgeScore.vue.d.ts +3 -46
- package/dist/lib/js/components/Banner/Banner.stories.d.ts +4 -2785
- package/dist/lib/js/components/Banner/Banner.vue.d.ts +10 -1121
- package/dist/lib/js/components/Buttons/Button/Button.stories.d.ts +4 -701
- package/dist/lib/js/components/Buttons/Button/Button.vue.d.ts +8 -51
- package/dist/lib/js/components/Buttons/IconButton/IconButton.stories.d.ts +9 -4838
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +7 -399
- package/dist/lib/js/components/Cards/Card/Card.stories.d.ts +4 -89
- package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +2 -29
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.stories.d.ts +4 -647
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +7 -92
- package/dist/lib/js/components/Divider/Divider.stories.d.ts +4 -59
- package/dist/lib/js/components/Drawer/Drawer.stories.d.ts +4 -43
- package/dist/lib/js/components/Dropdown/Dropdown.stories.d.ts +4 -113
- package/dist/lib/js/components/IconText/IconText.stories.d.ts +4 -223
- package/dist/lib/js/components/IconText/IconText.vue.d.ts +2 -44
- package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.stories.d.ts +4 -181
- package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue.d.ts +3 -46
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +4 -3
- package/dist/lib/js/components/Icons/Icon/Icon.stories.d.ts +5 -133
- package/dist/lib/js/components/Icons/Icon/Icon.vue.d.ts +2 -3
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +5 -47
- package/dist/lib/js/components/Modals/Modal/Modal.stories.d.ts +7 -7231
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +12 -1140
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.stories.d.ts +6 -6029
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +5 -1450
- package/dist/lib/js/components/NumberInCircle/NumberInCircle.stories.d.ts +3 -3
- package/dist/lib/js/components/OverlayHeader/OverlayHeader.stories.d.ts +4 -2055
- package/dist/lib/js/components/OverlayHeader/OverlayHeader.vue.d.ts +7 -779
- package/dist/lib/js/components/Pagination/Pagination.stories.d.ts +4 -1869
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +5 -694
- package/dist/lib/js/components/Pill/Pill.stories.d.ts +4 -1985
- package/dist/lib/js/components/Pill/Pill.vue.d.ts +7 -740
- package/dist/lib/js/components/PopOver/PopOver.stories.d.ts +4 -4
- package/dist/lib/js/components/ProgressBar/ProgressBar.stories.d.ts +8 -1886
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +5 -47
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.stories.d.ts +4 -534
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +5 -47
- package/dist/lib/js/components/Ripple/Ripple.stories.d.ts +4 -59
- package/dist/lib/js/components/Ripple/Ripple.vue.d.ts +1 -1
- package/dist/lib/js/components/SectionHeader/SectionHeader.stories.d.ts +4 -555
- package/dist/lib/js/components/SectionHeader/SectionHeader.vue.d.ts +5 -48
- package/dist/lib/js/components/SelectList/SelectList.stories.d.ts +2 -4
- package/dist/lib/js/components/SelectList/SelectList.vue.d.ts +3 -4
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.d.ts +4 -563
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +3 -282
- package/dist/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.stories.d.ts +4 -69
- package/dist/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.vue.d.ts +3 -35
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.stories.d.ts +4 -669
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +3 -336
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.stories.d.ts +4 -497
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +5 -47
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +5 -47
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockedeStatus.stories.d.ts +4 -497
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.d.ts +4 -3179
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +10 -1358
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.d.ts +6 -6945
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +11 -1478
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionTextarea.vue.d.ts +1 -0
- package/dist/lib/js/components/SurveyToggle/SurveyToggle.stories.d.ts +4 -237
- package/dist/lib/js/components/SurveyToggle/SurveyToggle.vue.d.ts +3 -48
- package/dist/lib/js/components/TabItem/TabItem.stories.d.ts +4 -153
- package/dist/lib/js/components/TabItem/TabItem.vue.d.ts +3 -46
- package/dist/lib/js/components/Tile/Tile.stories.d.ts +5 -994
- package/dist/lib/js/components/Tile/Tile.vue.d.ts +8 -79
- package/dist/lib/js/components/Toggles/CounterToggle/CounterToggle.stories.d.ts +4 -185
- package/dist/lib/js/components/Toggles/CounterToggle/CounterToggle.vue.d.ts +4 -47
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.stories.d.ts +4 -239
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +3 -29
- package/dist/lib/js/components/Well/Well.stories.d.ts +3 -3
- package/dist/lib/js/styles/Colors/Colors.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsThemes/ColorsThemes.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsTokensLms/ColorsTokensLms.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsTokensPrimaryBodywork/ColorsTokensPrimaryBodywork.stories.d.ts +3 -3
- package/dist/lib/js/styles/ColorsTokensPrimaryWnl/ColorsTokensPrimaryWnl.stories.d.ts +3 -3
- package/dist/lib/js/styles/Spacings/Spacings.stories.d.ts +1 -1
- package/dist/lib/js/styles/TypographyTokensLms/TypographyTokensLms.stories.d.ts +3 -3
- package/dist/lib/js/styles/TypographyVariables/TypographyVariables.stories.d.ts +3 -3
- package/docs/117.1156a7c503a067ad8241.manager.bundle.js +2 -0
- package/docs/247.6eaf240e.iframe.bundle.js +1 -0
- package/docs/255.721b3744029f102ac772.manager.bundle.js +2 -0
- package/docs/286.23828fb3.iframe.bundle.js +2 -0
- package/docs/295.4e52f65e605e88f7b915.manager.bundle.js +1 -0
- package/docs/317.bb9fa3422a439c11ef07.manager.bundle.js +1 -0
- package/docs/363.5eecfb3735eae61195ab.manager.bundle.js +586 -0
- package/docs/363.5eecfb3735eae61195ab.manager.bundle.js.LICENSE.txt +23 -0
- package/docs/39.bfc720d8.iframe.bundle.js +2 -0
- package/docs/407.e7bfe1ea814fec553911.manager.bundle.js +2 -0
- package/docs/594.bb1a9f64.iframe.bundle.js +2 -0
- package/docs/600.5586e4df861d64de85f8.manager.bundle.js +1 -0
- package/docs/636.6664115b472db0c0d56f.manager.bundle.js +2 -0
- package/docs/{vendors~main.247e7a9b46e986df3069.manager.bundle.js.LICENSE.txt → 636.6664115b472db0c0d56f.manager.bundle.js.LICENSE.txt} +0 -10
- package/docs/651.3a01b956.iframe.bundle.js +1 -0
- package/docs/690.46a1e07a.iframe.bundle.js +1 -0
- package/docs/701.691b9947.iframe.bundle.js +1 -0
- package/docs/765.a2b66c95.iframe.bundle.js +2 -0
- package/docs/{vendors~main.d572ee99.iframe.bundle.js.LICENSE.txt → 765.a2b66c95.iframe.bundle.js.LICENSE.txt} +0 -16
- package/docs/935.19d3d944.iframe.bundle.js +2 -0
- package/docs/962.ec348c19.iframe.bundle.js +2 -0
- package/docs/977.a265714880f883237672.manager.bundle.js +1 -0
- package/docs/iframe.html +1 -1
- package/docs/index.html +1 -1
- package/docs/main.aca4e1b49e5b812b2501.manager.bundle.js +1 -0
- package/docs/main.e3406522.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/docs/runtime~main.8a21756dfcf63c109f1d.manager.bundle.js +1 -0
- package/docs/runtime~main.b2826aa6.iframe.bundle.js +1 -0
- package/jest.config.js +3 -6
- package/lib/js/components/Badges/Badge/Badge.spec.ts +3 -8
- package/lib/js/components/Badges/Badge/Badge.stories.ts +5 -3
- package/lib/js/components/Badges/BadgeScore/BadgeScore.spec.ts +3 -7
- package/lib/js/components/Badges/BadgeScore/BadgeScore.stories.ts +9 -5
- package/lib/js/components/Badges/BadgeScore/BadgeScore.vue +4 -3
- package/lib/js/components/Banner/Banner.stories.ts +25 -22
- package/lib/js/components/Banner/Banner.vue +11 -28
- package/lib/js/components/Buttons/Button/Button.spec.ts +10 -6
- package/lib/js/components/Buttons/Button/Button.stories.ts +23 -17
- package/lib/js/components/Buttons/Button/Button.vue +5 -7
- package/lib/js/components/Buttons/IconButton/IconButton.stories.ts +28 -13
- package/lib/js/components/Buttons/IconButton/IconButton.vue +8 -6
- package/lib/js/components/Cards/Card/Card.spec.ts +5 -10
- package/lib/js/components/Cards/Card/Card.stories.ts +17 -5
- package/lib/js/components/Cards/CardExpandable/CardExpandable.spec.ts +7 -12
- package/lib/js/components/Cards/CardExpandable/CardExpandable.stories.ts +20 -10
- package/lib/js/components/Cards/CardExpandable/CardExpandable.vue +5 -3
- package/lib/js/components/Divider/Divider.stories.ts +9 -4
- package/lib/js/components/Drawer/Drawer.stories.ts +5 -3
- package/lib/js/components/Dropdown/Dropdown.stories.ts +5 -3
- package/lib/js/components/IconText/IconText.stories.ts +14 -12
- package/lib/js/components/IconText/IconText.vue +2 -1
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.stories.ts +6 -4
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue +3 -3
- package/lib/js/components/Icons/Icon/Icon.stories.ts +12 -5
- package/lib/js/components/Icons/Icon/Icon.vue +3 -3
- package/lib/js/components/Modal/Modal.spec.ts +3 -8
- package/lib/js/components/Modal/Modal.vue +1 -1
- package/lib/js/components/Modals/Modal/Modal.stories.ts +15 -29
- package/lib/js/components/Modals/Modal/Modal.vue +10 -10
- package/lib/js/components/Modals/ModalDialog/ModalDialog.stories.ts +6 -4
- package/lib/js/components/Modals/ModalDialog/ModalDialog.vue +7 -7
- package/lib/js/components/NumberInCircle/NumberInCircle.stories.ts +5 -3
- package/lib/js/components/OverlayHeader/OverlayHeader.stories.ts +19 -17
- package/lib/js/components/OverlayHeader/OverlayHeader.vue +1 -4
- package/lib/js/components/Pagination/Pagination.spec.ts +4 -7
- package/lib/js/components/Pagination/Pagination.stories.ts +8 -6
- package/lib/js/components/Pagination/Pagination.vue +3 -3
- package/lib/js/components/Pill/Pill.spec.ts +7 -5
- package/lib/js/components/Pill/Pill.stories.ts +5 -3
- package/lib/js/components/Pill/Pill.vue +4 -4
- package/lib/js/components/PopOver/PopOver.stories.ts +5 -3
- package/lib/js/components/PopOver/PopOver.vue +5 -5
- package/lib/js/components/ProgressBar/ProgressBar.stories.ts +6 -7
- package/lib/js/components/ProgressBar/ProgressBar.vue +6 -4
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.spec.ts +4 -6
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.stories.ts +8 -6
- package/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue +1 -1
- package/lib/js/components/Ripple/Ripple.stories.ts +5 -3
- package/lib/js/components/Ripple/Ripple.vue +10 -10
- package/lib/js/components/SectionHeader/SectionHeader.stories.ts +5 -3
- package/lib/js/components/SectionHeader/SectionHeader.vue +2 -1
- package/lib/js/components/SelectList/SelectList.stories.ts +32 -23
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.ts +14 -12
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.vue +3 -2
- package/lib/js/components/SelectList/SelectListItemDivider/SelectListItemDivider.stories.ts +3 -2
- package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.stories.ts +16 -14
- package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue +3 -2
- package/lib/js/components/Statuses/AccessStatus/AccessStatus.spec.ts +4 -8
- package/lib/js/components/Statuses/AccessStatus/AccessStatus.stories.ts +5 -3
- package/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.spec.ts +4 -8
- package/lib/js/components/Statuses/BlockadeStatus/BlockedeStatus.stories.ts +5 -3
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.stories.ts +5 -5
- package/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue +3 -2
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.spec.ts +5 -14
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.stories.ts +29 -21
- package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue +8 -11
- package/lib/js/components/SurveyQuestions/SurveyQuestionTextarea.vue +1 -0
- package/lib/js/components/SurveyToggle/SurveyToggle.spec.ts +3 -8
- package/lib/js/components/SurveyToggle/SurveyToggle.stories.ts +5 -3
- package/lib/js/components/SurveyToggle/SurveyToggle.vue +6 -9
- package/lib/js/components/TabItem/TabItem.spec.ts +3 -7
- package/lib/js/components/TabItem/TabItem.stories.ts +5 -3
- package/lib/js/components/TabItem/TabItem.vue +4 -10
- package/lib/js/components/Tile/Tile.spec.ts +14 -18
- package/lib/js/components/Tile/Tile.stories.ts +12 -5
- package/lib/js/components/Tile/Tile.vue +5 -5
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.spec.ts +5 -5
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.stories.ts +8 -3
- package/lib/js/components/Toggles/CounterToggle/CounterToggle.vue +5 -7
- package/lib/js/components/Toggles/ToggleButton/ToggleButton.stories.ts +16 -13
- package/lib/js/components/Toggles/ToggleButton/ToggleButton.vue +3 -17
- package/lib/js/components/Well/Well.stories.ts +6 -9
- package/lib/js/styles/Colors/Colors.stories.ts +5 -3
- package/lib/js/styles/ColorsThemes/ColorsThemes.stories.ts +5 -3
- package/lib/js/styles/ColorsTokensLms/ColorsTokensLms.stories.ts +5 -3
- package/lib/js/styles/ColorsTokensPrimaryBodywork/ColorsTokensPrimaryBodywork.stories.ts +5 -3
- package/lib/js/styles/ColorsTokensPrimaryWnl/ColorsTokensPrimaryWnl.stories.ts +5 -3
- package/lib/js/styles/Spacings/Spacings.stories.ts +11 -13
- package/lib/js/styles/TypographyTokensLms/TypographyTokensLms.stories.ts +5 -3
- package/lib/js/styles/TypographyVariables/TypographyVariables.stories.ts +5 -3
- package/lib/js/tests/emptyTransformer.ts +3 -1
- package/lib/js/typings.d.ts +9 -5
- package/package.json +22 -19
- package/stylelint.config.js +6 -2
- package/tsconfig.json +4 -2
- package/vue.config.js +8 -4
- package/docs/0.0bd4fd4436a8d1ef1d30.manager.bundle.js +0 -2
- package/docs/0.330ac560.iframe.bundle.js +0 -3
- package/docs/0.330ac560.iframe.bundle.js.map +0 -1
- package/docs/1.7b1bde44.iframe.bundle.js +0 -3
- package/docs/1.7b1bde44.iframe.bundle.js.map +0 -1
- package/docs/1.b52e4f9c5cc26b3ab941.manager.bundle.js +0 -1
- package/docs/10.65aa234815172050014e.manager.bundle.js +0 -1
- package/docs/10.9f63d710.iframe.bundle.js +0 -1
- package/docs/11.cc4ccf1b.iframe.bundle.js +0 -3
- package/docs/11.cc4ccf1b.iframe.bundle.js.map +0 -1
- package/docs/2.4511ae7e.iframe.bundle.js +0 -3
- package/docs/2.4511ae7e.iframe.bundle.js.map +0 -1
- package/docs/3.be646fdb.iframe.bundle.js +0 -1
- package/docs/4.56a28fc4.iframe.bundle.js +0 -1
- package/docs/5.3df3ab4b52abff899664.manager.bundle.js +0 -2
- package/docs/6.63f5637c3f9a33682852.manager.bundle.js +0 -586
- package/docs/6.63f5637c3f9a33682852.manager.bundle.js.LICENSE.txt +0 -24
- package/docs/7.4282478bb99c2aa1c46e.manager.bundle.js +0 -1
- package/docs/8.000736d9.iframe.bundle.js +0 -3
- package/docs/8.000736d9.iframe.bundle.js.map +0 -1
- package/docs/8.c81223eef5990edfc649.manager.bundle.js +0 -1
- package/docs/9.33f72dc1.iframe.bundle.js +0 -1
- package/docs/9.45659a2e4dd371822c72.manager.bundle.js +0 -2
- package/docs/main.56306661f1672549dbce.manager.bundle.js +0 -1
- package/docs/main.6c57cadf.iframe.bundle.js +0 -1
- package/docs/runtime~main.016fc6b4.iframe.bundle.js +0 -1
- package/docs/runtime~main.a7a714be62d5940f5192.manager.bundle.js +0 -1
- package/docs/vendors~main.247e7a9b46e986df3069.manager.bundle.js +0 -2
- package/docs/vendors~main.d572ee99.iframe.bundle.js +0 -3
- package/docs/vendors~main.d572ee99.iframe.bundle.js.map +0 -1
- /package/docs/{0.0bd4fd4436a8d1ef1d30.manager.bundle.js.LICENSE.txt → 117.1156a7c503a067ad8241.manager.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{11.cc4ccf1b.iframe.bundle.js.LICENSE.txt → 255.721b3744029f102ac772.manager.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{5.3df3ab4b52abff899664.manager.bundle.js.LICENSE.txt → 286.23828fb3.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{2.4511ae7e.iframe.bundle.js.LICENSE.txt → 39.bfc720d8.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{8.000736d9.iframe.bundle.js.LICENSE.txt → 407.e7bfe1ea814fec553911.manager.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{9.45659a2e4dd371822c72.manager.bundle.js.LICENSE.txt → 594.bb1a9f64.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{0.330ac560.iframe.bundle.js.LICENSE.txt → 935.19d3d944.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/docs/{1.7b1bde44.iframe.bundle.js.LICENSE.txt → 962.ec348c19.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
:class="{
|
|
28
28
|
'-neutral': colorScheme === ICON_BUTTON_COLOR_SCHEMES.NEUTRAL_LABEL,
|
|
29
29
|
}"
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
>
|
|
31
|
+
<slot />
|
|
32
|
+
</div>
|
|
32
33
|
<wnl-button
|
|
33
34
|
ref="button"
|
|
34
35
|
class="a-iconButton__button"
|
|
@@ -128,6 +129,7 @@
|
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
|
|
131
133
|
#{$self}__label {
|
|
132
134
|
color: map-get($color-map, 'outlined', 'disabled', 'color');
|
|
133
135
|
}
|
|
@@ -258,6 +260,7 @@
|
|
|
258
260
|
height: $icon-button-large-size;
|
|
259
261
|
width: $icon-button-large-size;
|
|
260
262
|
}
|
|
263
|
+
|
|
261
264
|
#{$self}__label {
|
|
262
265
|
@include button-l-default-bold-uppercase;
|
|
263
266
|
}
|
|
@@ -273,8 +276,6 @@
|
|
|
273
276
|
</style>
|
|
274
277
|
|
|
275
278
|
<script lang="ts">
|
|
276
|
-
import { VueConstructor } from 'vue';
|
|
277
|
-
|
|
278
279
|
import WnlIcon, { ICON_SIZES, ICONS } from '../../Icons/Icon';
|
|
279
280
|
import WnlButton, {
|
|
280
281
|
BUTTON_COLORS,
|
|
@@ -290,6 +291,7 @@ import {
|
|
|
290
291
|
ICON_BUTTON_TYPES,
|
|
291
292
|
} from './IconButton.consts';
|
|
292
293
|
import { Value } from '../../../utils/type.utils';
|
|
294
|
+
import { toRaw } from 'vue';
|
|
293
295
|
|
|
294
296
|
const ICON_ONLY_ICON_SIZES_MAP = {
|
|
295
297
|
[ICON_BUTTON_SIZES.XX_SMALL]: ICON_SIZES.XXX_SMALL,
|
|
@@ -330,8 +332,8 @@ export default {
|
|
|
330
332
|
icon: {
|
|
331
333
|
type: Object,
|
|
332
334
|
required: true,
|
|
333
|
-
validator(icon
|
|
334
|
-
return Object.values(ICONS).includes(icon);
|
|
335
|
+
validator(icon) {
|
|
336
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
335
337
|
},
|
|
336
338
|
},
|
|
337
339
|
color: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import Card from './Card.vue';
|
|
4
4
|
|
|
@@ -10,20 +10,15 @@ describe('Card', () => {
|
|
|
10
10
|
headerHasPadding = false,
|
|
11
11
|
dividerUnderHeader = false,
|
|
12
12
|
} = {}) => {
|
|
13
|
-
const localVue = createLocalVue();
|
|
14
|
-
|
|
15
13
|
return shallowMount(Card, {
|
|
16
|
-
|
|
17
|
-
mocks: {},
|
|
18
|
-
propsData: {
|
|
14
|
+
props: {
|
|
19
15
|
headerHasPadding,
|
|
20
16
|
dividerUnderHeader,
|
|
21
17
|
},
|
|
22
|
-
stubs: {},
|
|
23
18
|
slots: {
|
|
24
|
-
header: headerSlot,
|
|
25
|
-
content: contentSlot,
|
|
26
|
-
footer: footerSlot,
|
|
19
|
+
...(headerSlot !== '' && { header: headerSlot }),
|
|
20
|
+
...(contentSlot !== '' && { content: contentSlot }),
|
|
21
|
+
...(footerSlot !== '' && { footer: footerSlot }),
|
|
27
22
|
},
|
|
28
23
|
});
|
|
29
24
|
};
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import Card from './Card.vue';
|
|
2
2
|
|
|
3
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Components/Cards/Card',
|
|
7
7
|
component: Card,
|
|
8
8
|
} as Meta<typeof Card>;
|
|
9
9
|
|
|
10
|
-
const StoryTemplate: StoryFn<typeof Card> = (
|
|
10
|
+
const StoryTemplate: StoryFn<typeof Card> = (args) => ({
|
|
11
11
|
components: { Card },
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
setup() {
|
|
13
|
+
return { ...args };
|
|
14
|
+
},
|
|
15
|
+
template: `
|
|
16
|
+
<card :header-has-padding="headerHasPadding" :divider-under-header="dividerUnderHeader">
|
|
17
|
+
<template v-if="header" #header>
|
|
18
|
+
<div v-html="header" />
|
|
19
|
+
</template>
|
|
20
|
+
<template v-if="content" #content>
|
|
21
|
+
<div v-html="content" />
|
|
22
|
+
</template>
|
|
23
|
+
<template v-if="footer" #footer>
|
|
24
|
+
<div v-html="footer" />
|
|
25
|
+
</template>
|
|
26
|
+
</card>`,
|
|
15
27
|
});
|
|
16
28
|
|
|
17
29
|
export const Interactive = StoryTemplate.bind({});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import CardExpandable from './CardExpandable.vue';
|
|
4
4
|
|
|
@@ -20,21 +20,16 @@ describe('CardExpandable', () => {
|
|
|
20
20
|
contentSlot = '',
|
|
21
21
|
expandedContentSlot = '',
|
|
22
22
|
}: createComponentOptions = {}) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return shallowMount(CardExpandable, {
|
|
26
|
-
localVue,
|
|
27
|
-
mocks: {},
|
|
28
|
-
propsData: {
|
|
23
|
+
return mount(CardExpandable, {
|
|
24
|
+
props: {
|
|
29
25
|
isExpanded,
|
|
30
26
|
...(expanderTextExpanded && { expanderTextExpanded }),
|
|
31
27
|
...(expanderTextCollapsed && { expanderTextCollapsed }),
|
|
32
|
-
},
|
|
33
|
-
stubs: {},
|
|
28
|
+
} as any,
|
|
34
29
|
slots: {
|
|
35
|
-
header: headerSlot,
|
|
36
|
-
content: contentSlot,
|
|
37
|
-
expandedContent: expandedContentSlot,
|
|
30
|
+
...(headerSlot !== '' && { header: headerSlot }),
|
|
31
|
+
...(contentSlot !== '' && { content: contentSlot }),
|
|
32
|
+
...(expandedContentSlot !== '' && { expandedContent: expandedContentSlot }),
|
|
38
33
|
},
|
|
39
34
|
});
|
|
40
35
|
};
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import CardExpandable from './CardExpandable.vue';
|
|
2
2
|
|
|
3
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Components/Cards/CardExpandable',
|
|
7
7
|
component: CardExpandable,
|
|
8
8
|
} as Meta<typeof CardExpandable>;
|
|
9
9
|
|
|
10
|
-
const StoryTemplate: StoryFn<typeof CardExpandable> = (
|
|
10
|
+
const StoryTemplate: StoryFn<typeof CardExpandable> = (args) => ({
|
|
11
11
|
components: { CardExpandable },
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
setup() {
|
|
13
|
+
return { ...args };
|
|
14
|
+
},
|
|
15
|
+
template: `
|
|
16
|
+
<card-expandable :is-expander-visible="isExpanderVisible" :expander-text-collapsed="expanderTextCollapsed"
|
|
17
|
+
:expander-text-expanded="expanderTextExpanded" :is-expanded="isExpanded"
|
|
18
|
+
:header-has-padding="headerHasPadding" :divider-under-header="dividerUnderHeader">
|
|
19
|
+
<template v-if="header" #header>
|
|
20
|
+
<div v-html="header" />
|
|
21
|
+
</template>
|
|
22
|
+
<template #content="{ isExpanded: isExpandedInternal }">
|
|
23
|
+
<div v-html="content" />
|
|
24
|
+
<div v-if="isExpandedInternal">Dodatkowa treść w slocie <code>content</code> widoczna po rozwinięciu</div>
|
|
25
|
+
</template>
|
|
26
|
+
<template #expandedContent>
|
|
27
|
+
<div v-html="expandedContent"></div>
|
|
28
|
+
</template>
|
|
29
|
+
</card-expandable>`,
|
|
20
30
|
});
|
|
21
31
|
|
|
22
32
|
export const Interactive = StoryTemplate.bind({});
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
:header-has-padding="headerHasPadding"
|
|
5
5
|
:divider-under-header="dividerUnderHeader"
|
|
6
6
|
>
|
|
7
|
-
<template #header
|
|
7
|
+
<template #header>
|
|
8
|
+
<slot name="header" />
|
|
9
|
+
</template>
|
|
8
10
|
<template #content>
|
|
9
11
|
<slot name="content" :is-expanded="isExpandedInternal" />
|
|
10
12
|
<div v-if="isExpandedInternal" class="cardExpandable__expandedContent">
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
background-color: $color-neutral-background-hovered;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
&:deep(.ripple) {
|
|
56
58
|
background-color: $color-default-ripple !important;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -71,9 +73,9 @@
|
|
|
71
73
|
</style>
|
|
72
74
|
|
|
73
75
|
<script lang="ts">
|
|
76
|
+
import Ripple from 'vue-ripple-directive';
|
|
74
77
|
import DsCard from '../Card/';
|
|
75
78
|
import DsIcon, { ICONS, ICON_SIZES } from '../../../components/Icons/Icon';
|
|
76
|
-
import Ripple from 'vue-ripple-directive';
|
|
77
79
|
|
|
78
80
|
export default {
|
|
79
81
|
name: 'CardExpandable',
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import Divider from './Divider.vue';
|
|
2
2
|
import { DIVIDER_PROMINENCES, DIVIDER_SIZES } from './Divider.consts';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Divider',
|
|
8
8
|
component: Divider,
|
|
9
9
|
} as Meta<typeof Divider>;
|
|
10
10
|
|
|
11
|
-
const StoryTemplate: StoryFn<typeof Divider> = (
|
|
11
|
+
const StoryTemplate: StoryFn<typeof Divider> = (args) => ({
|
|
12
12
|
components: { Divider },
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
template: `
|
|
17
|
+
<div style="height: 200px; width: 200px;">
|
|
18
|
+
<divider :is-vertical="isVertical" :prominence="prominence" :size="size" />
|
|
19
|
+
</div>`,
|
|
15
20
|
});
|
|
16
21
|
|
|
17
22
|
export const Interactive = StoryTemplate.bind({});
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import Drawer from './Drawer.vue';
|
|
2
2
|
import { DRAWER_POSITIONS } from './Drawer.consts';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Drawer',
|
|
8
8
|
component: Drawer,
|
|
9
9
|
} as Meta<typeof Drawer>;
|
|
10
10
|
|
|
11
|
-
const StoryTemplate: StoryFn<typeof Drawer> = (
|
|
11
|
+
const StoryTemplate: StoryFn<typeof Drawer> = (args) => ({
|
|
12
12
|
components: { Drawer },
|
|
13
|
-
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
14
16
|
template: `<div style="height: 300px; width: 200px;">
|
|
15
17
|
<drawer :position="position" :sticky-header="stickyHeader" :sticky-footer="stickyFooter">
|
|
16
18
|
<template v-slot:header><div style="background-color: var(--raw-gray-100)">Header<br><br></div></template>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from './Dropdown.consts';
|
|
7
7
|
import SelectList from '../SelectList/SelectList.vue';
|
|
8
8
|
|
|
9
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
9
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
10
10
|
import SelectListItem from '../SelectList/SelectListItem/SelectListItem.vue';
|
|
11
11
|
|
|
12
12
|
export default {
|
|
@@ -14,9 +14,11 @@ export default {
|
|
|
14
14
|
component: Dropdown,
|
|
15
15
|
} as Meta<typeof Dropdown>;
|
|
16
16
|
|
|
17
|
-
const StoryTemplate: StoryFn<typeof Dropdown> = (
|
|
17
|
+
const StoryTemplate: StoryFn<typeof Dropdown> = (args) => ({
|
|
18
18
|
components: { Dropdown, SelectList, SelectListItem },
|
|
19
|
-
|
|
19
|
+
setup() {
|
|
20
|
+
return { ...args };
|
|
21
|
+
},
|
|
20
22
|
template: `
|
|
21
23
|
<div style="position: relative">
|
|
22
24
|
<dropdown :trigger-action="triggerAction" :force-show="forceShow" :same-width="sameWidth" :radius="radius"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
1
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
2
2
|
import IconText from './IconText.vue';
|
|
3
3
|
import { ICON_TEXT_COLORS, ICON_TEXT_SIZES, ICON_TEXT_STATES } from './IconText.consts';
|
|
4
4
|
import { ICONS } from '../Icons/Icon';
|
|
@@ -8,19 +8,21 @@ export default {
|
|
|
8
8
|
component: IconText,
|
|
9
9
|
} as Meta<typeof IconText>;
|
|
10
10
|
|
|
11
|
-
const StoryTemplate: StoryFn<typeof IconText> = (
|
|
11
|
+
const StoryTemplate: StoryFn<typeof IconText> = (args) => ({
|
|
12
12
|
components: { IconText },
|
|
13
|
-
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
14
16
|
template: `
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
<icon-text
|
|
18
|
+
:color="color"
|
|
19
|
+
:icon="ICONS[icon]"
|
|
20
|
+
:label="label"
|
|
21
|
+
:is-interactive="isInteractive"
|
|
22
|
+
:is-label-bold="isLabelBold"
|
|
23
|
+
:size="size"
|
|
24
|
+
:state="state"
|
|
25
|
+
/>`,
|
|
24
26
|
data() {
|
|
25
27
|
return {
|
|
26
28
|
ICONS: Object.freeze(ICONS),
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
import Icon, { ICON_SIZES, ICONS } from '../Icons/Icon';
|
|
125
125
|
import { ICON_TEXT_COLORS, ICON_TEXT_SIZES, ICON_TEXT_STATES } from './IconText.consts';
|
|
126
126
|
import { Value } from '../../utils/type.utils';
|
|
127
|
+
import { toRaw } from 'vue';
|
|
127
128
|
|
|
128
129
|
export default {
|
|
129
130
|
name: 'IconText',
|
|
@@ -141,7 +142,7 @@ export default {
|
|
|
141
142
|
icon: {
|
|
142
143
|
type: Object,
|
|
143
144
|
required: true,
|
|
144
|
-
validate: (icon) => Object.values(ICONS).includes(icon),
|
|
145
|
+
validate: (icon) => Object.values(ICONS).includes(toRaw(icon)),
|
|
145
146
|
},
|
|
146
147
|
isInteractive: {
|
|
147
148
|
type: Boolean,
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
|
|
1
3
|
import FeatureIcon from './FeatureIcon.vue';
|
|
2
4
|
import { ICONS } from '../Icon';
|
|
3
5
|
import { FEATURE_ICON_SIZES, FEATURE_ICON_COLOR } from './FeatureIcon.consts';
|
|
4
6
|
|
|
5
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue';
|
|
6
|
-
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Components/Icons/FeatureIcon',
|
|
9
9
|
component: FeatureIcon,
|
|
10
10
|
} as Meta<typeof FeatureIcon>;
|
|
11
11
|
|
|
12
|
-
const StoryTemplate: StoryFn<typeof FeatureIcon> = (
|
|
12
|
+
const StoryTemplate: StoryFn<typeof FeatureIcon> = (args) => ({
|
|
13
13
|
components: { FeatureIcon },
|
|
14
|
-
|
|
14
|
+
setup() {
|
|
15
|
+
return { ...args };
|
|
16
|
+
},
|
|
15
17
|
template:
|
|
16
18
|
'<feature-icon :icon="ICONS[icon]" :size="size" :color="color" :doubleBackground="doubleBackground" />',
|
|
17
19
|
data() {
|
|
@@ -118,9 +118,9 @@ $feature-icon-padding-large: 10px;
|
|
|
118
118
|
</style>
|
|
119
119
|
|
|
120
120
|
<script lang="ts">
|
|
121
|
-
import { VueConstructor } from 'vue';
|
|
122
121
|
import WnlIcon, { ICONS, ICON_SIZES } from '../Icon';
|
|
123
122
|
import { FEATURE_ICON_SIZES, FEATURE_ICON_COLOR } from './FeatureIcon.consts';
|
|
123
|
+
import { toRaw } from 'vue';
|
|
124
124
|
|
|
125
125
|
export default {
|
|
126
126
|
name: 'FeatureIcon',
|
|
@@ -131,8 +131,8 @@ export default {
|
|
|
131
131
|
icon: {
|
|
132
132
|
type: Object,
|
|
133
133
|
default: null,
|
|
134
|
-
validator(icon
|
|
135
|
-
return Object.values(ICONS).includes(icon);
|
|
134
|
+
validator(icon) {
|
|
135
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
136
136
|
},
|
|
137
137
|
},
|
|
138
138
|
size: {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import Icon from './Icon.vue';
|
|
2
2
|
import { ICON_SIZES, ICONS } from './Icon.consts';
|
|
3
3
|
|
|
4
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/
|
|
4
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Icons/Icon',
|
|
8
8
|
component: Icon,
|
|
9
9
|
} as Meta<typeof Icon>;
|
|
10
10
|
|
|
11
|
-
const StoryTemplate: StoryFn<typeof Icon> = (
|
|
11
|
+
const StoryTemplate: StoryFn<typeof Icon> = (args) => ({
|
|
12
12
|
components: { Icon },
|
|
13
|
-
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
14
16
|
template:
|
|
15
17
|
'<div class="sbIconList__singleIcon"><icon :icon="ICONS[icon]" :size="size" :touchable="touchable" :spinning="spinning" :rotation="rotation" :flipped-vertical="flippedVertical" :flipped-horizontal="flippedHorizontal" /></div>',
|
|
16
18
|
data() {
|
|
@@ -51,15 +53,20 @@ Interactive.argTypes = argTypes;
|
|
|
51
53
|
Interactive.args = args;
|
|
52
54
|
|
|
53
55
|
Interactive.parameters = {
|
|
56
|
+
actions: {
|
|
57
|
+
handles: ['click'],
|
|
58
|
+
},
|
|
54
59
|
design: {
|
|
55
60
|
type: 'figma',
|
|
56
61
|
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS---Components?node-id=1552%3A34963',
|
|
57
62
|
},
|
|
58
63
|
};
|
|
59
64
|
|
|
60
|
-
const StoryAllIconsTemplate: StoryFn<typeof Icon> = (
|
|
65
|
+
const StoryAllIconsTemplate: StoryFn<typeof Icon> = (args) => ({
|
|
61
66
|
components: { Icon },
|
|
62
|
-
|
|
67
|
+
setup() {
|
|
68
|
+
return { ...args };
|
|
69
|
+
},
|
|
63
70
|
template:
|
|
64
71
|
'<div class="sbIconList">' +
|
|
65
72
|
'<div v-for="(icon, iconName) in ICONS" :key="iconName" class="sbIconList__icon">' +
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
</style>
|
|
21
21
|
|
|
22
22
|
<script lang="ts">
|
|
23
|
-
import { VueConstructor } from 'vue';
|
|
24
23
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
25
24
|
|
|
26
25
|
import { ICON_SIZES, ICONS } from './Icon.consts';
|
|
26
|
+
import { toRaw } from 'vue';
|
|
27
27
|
|
|
28
28
|
export default {
|
|
29
29
|
name: 'Icon',
|
|
@@ -34,8 +34,8 @@ export default {
|
|
|
34
34
|
icon: {
|
|
35
35
|
type: Object,
|
|
36
36
|
required: true,
|
|
37
|
-
validator(icon
|
|
38
|
-
return Object.values(ICONS).includes(icon);
|
|
37
|
+
validator(icon) {
|
|
38
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
size: {
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import Modal from './Modal.vue';
|
|
4
4
|
|
|
5
5
|
describe('Modal', () => {
|
|
6
6
|
const createComponent = ({ headerSlot = '', slot = '', showHeader = true } = {}) => {
|
|
7
|
-
const localVue = createLocalVue();
|
|
8
|
-
|
|
9
7
|
return shallowMount(Modal, {
|
|
10
|
-
|
|
11
|
-
mocks: {},
|
|
12
|
-
propsData: {
|
|
8
|
+
props: {
|
|
13
9
|
showHeader,
|
|
14
|
-
},
|
|
15
|
-
stubs: {},
|
|
10
|
+
} as any,
|
|
16
11
|
slots: {
|
|
17
12
|
header: headerSlot,
|
|
18
13
|
slot,
|
|
@@ -1,43 +1,29 @@
|
|
|
1
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
|
|
1
3
|
import Modal from './Modal.vue';
|
|
2
4
|
import { ICONS } from '../../Icons/Icon';
|
|
3
5
|
import { FEATURE_ICON_COLOR } from '../../Icons/FeatureIcon';
|
|
4
6
|
import { MODAL_SIZES, MODAL_HEADER_TITLE_SIZES } from './Modal.consts';
|
|
5
7
|
|
|
6
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue';
|
|
7
|
-
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Components/Modals/Modal',
|
|
10
10
|
component: Modal,
|
|
11
11
|
} as Meta<typeof Modal>;
|
|
12
12
|
|
|
13
|
-
const StoryTemplate: StoryFn<typeof Modal> = (
|
|
13
|
+
const StoryTemplate: StoryFn<typeof Modal> = (args) => ({
|
|
14
14
|
components: { Modal },
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:footerSecondaryButtonText="footerSecondaryButtonText"
|
|
28
|
-
:footerSecondaryButtonIcon="ICONS[footerSecondaryButtonIcon]"
|
|
29
|
-
:footerTertiaryButtonText="footerTertiaryButtonText"
|
|
30
|
-
:footerTertiaryButtonIcon="ICONS[footerTertiaryButtonIcon]"
|
|
31
|
-
:footerCheckboxText="footerCheckboxText"
|
|
32
|
-
:headerImage="headerImage"
|
|
33
|
-
@close-modal="onCloseModal"
|
|
34
|
-
@checkbox-change="onCheckboxChange"
|
|
35
|
-
@primary-button-click="onPrimaryButtonClick"
|
|
36
|
-
@secondary-button-click="onSecondaryButtonClick"
|
|
37
|
-
@tertiary-button-click="onTertiaryButtonClick"
|
|
38
|
-
>
|
|
39
|
-
<div v-html="defaultSlot" />
|
|
40
|
-
</modal>`,
|
|
15
|
+
setup() {
|
|
16
|
+
return { ...args };
|
|
17
|
+
},
|
|
18
|
+
template:
|
|
19
|
+
'<modal :headerFeatureIcon="ICONS[headerFeatureIcon]" :size="size" :danger="danger" ' +
|
|
20
|
+
':headerTitleSize="headerTitleSize" :headerTitle="headerTitle" :headerSubtitle="headerSubtitle" :contentCentered="contentCentered" :headerFeatureIconColor="headerFeatureIconColor" ' +
|
|
21
|
+
':footerPrimaryButtonText="footerPrimaryButtonText" :footerPrimaryButtonIcon="ICONS[footerPrimaryButtonIcon]" ' +
|
|
22
|
+
':footerSecondaryButtonText="footerSecondaryButtonText" :footerSecondaryButtonIcon="ICONS[footerSecondaryButtonIcon]" ' +
|
|
23
|
+
':footerTertiaryButtonText="footerTertiaryButtonText" :footerTertiaryButtonIcon="ICONS[footerTertiaryButtonIcon]" ' +
|
|
24
|
+
':footerCheckboxText="footerCheckboxText" :headerImage="headerImage">' +
|
|
25
|
+
'<div v-html="defaultSlot" />' +
|
|
26
|
+
'</modal>',
|
|
41
27
|
data() {
|
|
42
28
|
return {
|
|
43
29
|
ICONS: Object.freeze(ICONS),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:size="ICON_SIZES.SMALL"
|
|
9
9
|
:elevation="BUTTON_ELEVATIONS.X_SMALL"
|
|
10
10
|
:color="ICON_BUTTON_COLORS.NEUTRAL_WEAK"
|
|
11
|
-
@click.
|
|
11
|
+
@click.stop="$emit('close-modal')"
|
|
12
12
|
/>
|
|
13
13
|
<div class="ds-modal__scrollableWrapper">
|
|
14
14
|
<img v-if="headerImage" class="ds-modal__image" :src="headerImage" alt="" />
|
|
@@ -312,11 +312,11 @@ $image-height-small: 140px;
|
|
|
312
312
|
<script lang="ts">
|
|
313
313
|
import FeatureIcon from '../../Icons/FeatureIcon/FeatureIcon.vue';
|
|
314
314
|
import { MODAL_SIZES, MODAL_HEADER_TITLE_SIZES } from './Modal.consts';
|
|
315
|
-
import { VueConstructor } from 'vue';
|
|
316
315
|
import { ICONS, ICON_SIZES } from '../../Icons/Icon';
|
|
317
316
|
import { FEATURE_ICON_COLOR, FEATURE_ICON_SIZES } from '../../Icons/FeatureIcon';
|
|
318
317
|
import WnlButton, { BUTTON_COLORS, BUTTON_TYPES, BUTTON_ELEVATIONS } from '../../Buttons/Button';
|
|
319
318
|
import WnlIconButton, { ICON_BUTTON_COLORS } from '../../Buttons/IconButton';
|
|
319
|
+
import { toRaw } from 'vue';
|
|
320
320
|
|
|
321
321
|
export default {
|
|
322
322
|
name: 'Modal',
|
|
@@ -347,8 +347,8 @@ export default {
|
|
|
347
347
|
headerFeatureIcon: {
|
|
348
348
|
type: Object,
|
|
349
349
|
default: null,
|
|
350
|
-
validator(icon
|
|
351
|
-
return Object.values(ICONS).includes(icon);
|
|
350
|
+
validator(icon) {
|
|
351
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
352
352
|
},
|
|
353
353
|
},
|
|
354
354
|
headerFeatureIconColor: {
|
|
@@ -373,8 +373,8 @@ export default {
|
|
|
373
373
|
footerPrimaryButtonIcon: {
|
|
374
374
|
type: Object,
|
|
375
375
|
default: null,
|
|
376
|
-
validator(icon
|
|
377
|
-
return Object.values(ICONS).includes(icon);
|
|
376
|
+
validator(icon) {
|
|
377
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
378
378
|
},
|
|
379
379
|
},
|
|
380
380
|
footerSecondaryButtonText: {
|
|
@@ -384,8 +384,8 @@ export default {
|
|
|
384
384
|
footerSecondaryButtonIcon: {
|
|
385
385
|
type: Object,
|
|
386
386
|
default: null,
|
|
387
|
-
validator(icon
|
|
388
|
-
return Object.values(ICONS).includes(icon);
|
|
387
|
+
validator(icon) {
|
|
388
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
389
389
|
},
|
|
390
390
|
},
|
|
391
391
|
footerTertiaryButtonText: {
|
|
@@ -395,8 +395,8 @@ export default {
|
|
|
395
395
|
footerTertiaryButtonIcon: {
|
|
396
396
|
type: Object,
|
|
397
397
|
default: null,
|
|
398
|
-
validator(icon
|
|
399
|
-
return Object.values(ICONS).includes(icon);
|
|
398
|
+
validator(icon) {
|
|
399
|
+
return Object.values(ICONS).includes(toRaw(icon));
|
|
400
400
|
},
|
|
401
401
|
},
|
|
402
402
|
footerCheckboxText: {
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
|
|
1
3
|
import ModalDialog from './ModalDialog.vue';
|
|
2
4
|
import { ICONS } from '../../Icons/Icon';
|
|
3
5
|
import { FEATURE_ICON_COLOR } from '../../Icons/FeatureIcon';
|
|
4
6
|
|
|
5
|
-
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue';
|
|
6
|
-
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Components/Modals/ModalDialog',
|
|
9
9
|
component: ModalDialog,
|
|
10
10
|
} as Meta<typeof ModalDialog>;
|
|
11
11
|
|
|
12
|
-
const StoryTemplate: StoryFn<typeof ModalDialog> = (
|
|
12
|
+
const StoryTemplate: StoryFn<typeof ModalDialog> = (args) => ({
|
|
13
13
|
components: { ModalDialog },
|
|
14
|
-
|
|
14
|
+
setup() {
|
|
15
|
+
return { ...args };
|
|
16
|
+
},
|
|
15
17
|
template:
|
|
16
18
|
'<modal-dialog :headerFeatureIcon="ICONS[headerFeatureIcon]" :danger="danger" ' +
|
|
17
19
|
':headerTitle="headerTitle" :headerSubtitle="headerSubtitle" :headerFeatureIconColor="headerFeatureIconColor" ' +
|