@bethinkpl/design-system 16.2.1 → 16.3.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/.env +1 -0
- package/.yarnrc.yml +1 -0
- package/README.md +1 -1
- package/dist/design-system.umd.js +5511 -3951
- package/dist/design-system.umd.js.map +1 -1
- package/dist/lib/js/components/Drawer/DrawerContent/DrawerContent.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerContent/DrawerContent.vue.d.ts +4 -0
- package/dist/lib/js/components/Drawer/DrawerDivider/DrawerDivider.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerDivider/DrawerDivider.vue.d.ts +20 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/index.d.ts +2 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +3 -0
- package/dist/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue.d.ts +4 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +224 -0
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.stories.d.ts +5 -0
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +8 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.consts.d.ts +7 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +257 -0
- package/dist/lib/js/components/Headers/OverlayHeader/index.d.ts +3 -0
- package/dist/lib/js/components/Headers/PageHeader/PageHeader.consts.d.ts +4 -0
- package/dist/lib/js/components/Headers/PageHeader/PageHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Headers/PageHeader/index.d.ts +3 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.consts.d.ts +10 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.stories.d.ts +5 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +286 -0
- package/dist/lib/js/components/Headers/SectionHeader/index.d.ts +3 -0
- package/dist/lib/js/components/SectionTitle/SectionTitle.consts.d.ts +4 -0
- package/dist/lib/js/components/SectionTitle/SectionTitle.stories.d.ts +5 -0
- package/dist/lib/js/components/SectionTitle/SectionTitle.vue.d.ts +3 -0
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +57 -3
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +183 -0
- package/dist/lib/js/index.d.ts +14 -4
- package/dist/tools/importers/helpers/structures.d.ts +4 -4
- package/docs/iframe.html +1 -1
- package/docs/main.e7609578.iframe.bundle.js +1 -0
- package/docs/project.json +1 -1
- package/lib/js/components/Drawer/DrawerContent/DrawerContent.stories.ts +29 -0
- package/lib/js/components/Drawer/DrawerContent/DrawerContent.vue +22 -0
- package/lib/js/components/Drawer/DrawerDivider/DrawerDivider.stories.ts +48 -0
- package/lib/js/components/Drawer/DrawerDivider/DrawerDivider.vue +36 -0
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.stories.ts +57 -0
- package/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue +204 -0
- package/lib/js/components/Drawer/DrawerHeader/index.ts +3 -0
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.ts +7 -0
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.stories.ts +43 -0
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue +79 -0
- package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.stories.ts +31 -0
- package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue +19 -0
- package/lib/js/components/Drawer/DrawerSection/DrawerSection.stories.ts +41 -0
- package/lib/js/components/Drawer/DrawerSection/DrawerSection.vue +107 -0
- package/lib/js/components/Drawer/DrawerTile/DrawerTile.stories.ts +30 -0
- package/lib/js/components/Drawer/DrawerTile/DrawerTile.vue +22 -0
- package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/OverlayHeader.stories.ts +1 -1
- package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/OverlayHeader.vue +14 -10
- package/lib/js/components/Headers/PageHeader/PageHeader.consts.ts +4 -0
- package/lib/js/components/Headers/PageHeader/PageHeader.stories.ts +75 -0
- package/lib/js/components/Headers/PageHeader/PageHeader.vue +125 -0
- package/lib/js/components/Headers/PageHeader/index.ts +4 -0
- package/lib/js/components/Headers/SectionHeader/SectionHeader.consts.ts +10 -0
- package/lib/js/components/{SectionHeader → Headers/SectionHeader}/SectionHeader.stories.ts +46 -13
- package/lib/js/components/Headers/SectionHeader/SectionHeader.vue +395 -0
- package/lib/js/components/SectionTitle/SectionTitle.consts.ts +5 -0
- package/lib/js/components/SectionTitle/SectionTitle.stories.ts +41 -0
- package/lib/js/components/SectionTitle/SectionTitle.vue +58 -0
- package/lib/js/components/Tile/Tile.sb.shared.ts +54 -0
- package/lib/js/components/Tile/Tile.stories.ts +8 -67
- package/lib/js/index.ts +14 -4
- package/lib/styles/settings/colors/_tokens-variables.scss +4 -0
- package/lib/styles/settings/colors/_tokens.json +1 -1
- package/lib/styles/settings/colors/_tokens.scss +4 -0
- package/package.json +1 -1
- package/tools/importers/helpers/structures.ts +4 -4
- package/docs/main.1bbe2ef5.iframe.bundle.js +0 -1
- package/lib/js/components/SectionHeader/SectionHeader.consts.ts +0 -4
- package/lib/js/components/SectionHeader/SectionHeader.vue +0 -230
- /package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/OverlayHeader.consts.ts +0 -0
- /package/lib/js/components/{OverlayHeader → Headers/OverlayHeader}/index.ts +0 -0
- /package/lib/js/components/{SectionHeader → Headers/SectionHeader}/index.ts +0 -0
package/docs/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1684318839894,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"metaFramework":{"name":"vue-cli","packageName":"@vue/cli-service","version":"5.0.4"},"packageManager":{"type":"yarn","version":"1.22.19"},"storybookVersion":"6.5.13","language":"typescript","storybookPackages":{"@storybook/builder-webpack5":{"version":"6.5.13"},"@storybook/manager-webpack5":{"version":"6.5.13"},"@storybook/vue3":{"version":"6.5.13"},"eslint-plugin-storybook":{"version":"0.6.6"}},"framework":{"name":"vue3"},"addons":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-docs":{"version":"6.5.15"},"@storybook/addon-controls":{"version":"6.5.15"},"@storybook/addon-storysource":{"version":"6.5.15"},"@storybook/addon-viewport":{"version":"6.5.15"},"storybook-addon-designs":{"version":"6.3.1"}}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import DrawerContent from './DrawerContent.vue';
|
|
2
|
+
|
|
3
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Drawer/DrawerContent',
|
|
7
|
+
component: DrawerContent,
|
|
8
|
+
} as Meta<typeof DrawerContent>;
|
|
9
|
+
|
|
10
|
+
const StoryTemplate: StoryFn<typeof DrawerContent> = (args) => ({
|
|
11
|
+
components: { DrawerContent },
|
|
12
|
+
setup() {
|
|
13
|
+
return { ...args };
|
|
14
|
+
},
|
|
15
|
+
template: `
|
|
16
|
+
<drawer-content>
|
|
17
|
+
<div>One</div>
|
|
18
|
+
<div>Two</div>
|
|
19
|
+
</drawer-content>`,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Static = StoryTemplate.bind({});
|
|
23
|
+
|
|
24
|
+
Static.parameters = {
|
|
25
|
+
design: {
|
|
26
|
+
type: 'figma',
|
|
27
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=6785-111039&t=ojEtzUKoNdQTh0X8-4',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="drawerContent">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<style lang="scss" scoped>
|
|
8
|
+
@import '../../../../styles/settings/spacings';
|
|
9
|
+
|
|
10
|
+
.drawerContent {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: $space-s;
|
|
14
|
+
padding: $space-xxs $space-s;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
export default {
|
|
20
|
+
name: 'DrawerContent',
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import DrawerDivider from './DrawerDivider.vue';
|
|
2
|
+
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import { DIVIDER_PROMINENCES, DIVIDER_SIZES } from '../../Divider';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Drawer/DrawerDivider',
|
|
8
|
+
component: DrawerDivider,
|
|
9
|
+
} as Meta<typeof DrawerDivider>;
|
|
10
|
+
|
|
11
|
+
const StoryTemplate: StoryFn<typeof DrawerDivider> = (args) => ({
|
|
12
|
+
components: { DrawerDivider },
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
template: `
|
|
17
|
+
<div style="height: 200px; width: 200px;">
|
|
18
|
+
<drawer-divider :prominence="prominence" :size="size" />
|
|
19
|
+
</div>`,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Interactive = StoryTemplate.bind({});
|
|
23
|
+
|
|
24
|
+
const args = {
|
|
25
|
+
prominence: DIVIDER_PROMINENCES.DEFAULT,
|
|
26
|
+
size: DIVIDER_SIZES.S,
|
|
27
|
+
} as Args;
|
|
28
|
+
|
|
29
|
+
const argTypes = {
|
|
30
|
+
prominence: {
|
|
31
|
+
control: { type: 'select', options: Object.values(DIVIDER_PROMINENCES) },
|
|
32
|
+
defaultValue: DIVIDER_PROMINENCES.DEFAULT,
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
control: { type: 'select', options: Object.values(DIVIDER_SIZES) },
|
|
36
|
+
defaultValue: DIVIDER_SIZES.S,
|
|
37
|
+
},
|
|
38
|
+
} as ArgTypes;
|
|
39
|
+
|
|
40
|
+
Interactive.argTypes = argTypes;
|
|
41
|
+
Interactive.args = args;
|
|
42
|
+
|
|
43
|
+
Interactive.parameters = {
|
|
44
|
+
design: {
|
|
45
|
+
type: 'figma',
|
|
46
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=6785-111032&t=2Z2n2tIHRHEsWjoW-4',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="drawerDivider">
|
|
3
|
+
<ds-divider :prominence="prominence" :size="size" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<style lang="scss" scoped>
|
|
8
|
+
@import '../../../../styles/settings/spacings';
|
|
9
|
+
|
|
10
|
+
.drawerDivider {
|
|
11
|
+
padding: $space-xxs 0;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import Divider, { DIVIDER_PROMINENCES, DIVIDER_SIZES } from '../../Divider';
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'DrawerDivider',
|
|
20
|
+
components: {
|
|
21
|
+
DsDivider: Divider,
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
prominence: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: DIVIDER_PROMINENCES.DEFAULT,
|
|
27
|
+
validator: (value: string) => Object.values(DIVIDER_PROMINENCES).includes(value),
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: DIVIDER_SIZES.S,
|
|
32
|
+
validator: (value: string) => Object.values(DIVIDER_SIZES).includes(value),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import DrawerHeader from './DrawerHeader.vue';
|
|
2
|
+
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import { ICONS } from '../../Icons/Icon';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Drawer/DrawerHeader',
|
|
8
|
+
component: DrawerHeader,
|
|
9
|
+
} as Meta<typeof DrawerHeader>;
|
|
10
|
+
|
|
11
|
+
const StoryTemplate: StoryFn<typeof DrawerHeader> = (args) => ({
|
|
12
|
+
components: { DrawerHeader },
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
ICONS: Object.freeze(ICONS),
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
22
|
+
<drawer-header :title="title" :eyebrow-text="eyebrowText" :pill-label="pillLabel"
|
|
23
|
+
:left-icon="ICONS[leftIcon]"
|
|
24
|
+
:has-divider="hasDivider" :is-closable="isClosable"
|
|
25
|
+
:is-interactive-eyebrow="isInteractiveEyebrow" :is-second-level="isSecondLevel"
|
|
26
|
+
:eyebrow-ellipsis="eyebrowEllipsis" :title-ellipsis="titleEllipsis"/>`,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Interactive = StoryTemplate.bind({});
|
|
30
|
+
|
|
31
|
+
const args = {} as Args;
|
|
32
|
+
|
|
33
|
+
const argTypes = {
|
|
34
|
+
title: { control: { type: 'text' }, defaultValue: 'Header Title' },
|
|
35
|
+
eyebrowText: { control: { type: 'text' }, defaultValue: 'eyebrow' },
|
|
36
|
+
pillLabel: { control: { type: 'text' }, defaultValue: 'pill' },
|
|
37
|
+
hasDivider: { control: { type: 'boolean' }, defaultValue: false },
|
|
38
|
+
isClosable: { control: { type: 'boolean' }, defaultValue: true },
|
|
39
|
+
isSecondLevel: { control: { type: 'boolean' }, defaultValue: false },
|
|
40
|
+
isInteractiveEyebrow: { control: { type: 'boolean' }, defaultValue: false },
|
|
41
|
+
leftIcon: {
|
|
42
|
+
control: { type: 'select', options: [...Object.keys(ICONS), null] },
|
|
43
|
+
defaultValue: null,
|
|
44
|
+
},
|
|
45
|
+
eyebrowEllipsis: { control: { type: 'boolean' }, defaultValue: false },
|
|
46
|
+
titleEllipsis: { control: { type: 'boolean' }, defaultValue: false },
|
|
47
|
+
} as ArgTypes;
|
|
48
|
+
|
|
49
|
+
Interactive.argTypes = argTypes;
|
|
50
|
+
Interactive.args = args;
|
|
51
|
+
|
|
52
|
+
Interactive.parameters = {
|
|
53
|
+
design: {
|
|
54
|
+
type: 'figma',
|
|
55
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?type=design&node-id=5844-97971&t=BghQUeaLDBGoEKOq-4',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="drawerHeader">
|
|
3
|
+
<div class="drawerHeader__titleWrapper">
|
|
4
|
+
<ds-button
|
|
5
|
+
v-if="isSecondLevel"
|
|
6
|
+
:icon-left="ICONS.FA_CHEVRON_LEFT"
|
|
7
|
+
:type="BUTTON_TYPES.TEXT"
|
|
8
|
+
class="drawerHeader__secondLevel"
|
|
9
|
+
>
|
|
10
|
+
Wróć
|
|
11
|
+
</ds-button>
|
|
12
|
+
<div :class="{ '-hidden': isSecondLevel }" class="drawerHeader__firstLevel">
|
|
13
|
+
<span
|
|
14
|
+
v-if="eyebrowText"
|
|
15
|
+
:class="{
|
|
16
|
+
'-isInteractive': isInteractiveEyebrow,
|
|
17
|
+
'-ellipsis': eyebrowEllipsis,
|
|
18
|
+
}"
|
|
19
|
+
class="drawerHeader__eyebrow"
|
|
20
|
+
@click="isInteractiveEyebrow && $emit('eyebrowClicked')"
|
|
21
|
+
>
|
|
22
|
+
{{ eyebrowText }}
|
|
23
|
+
</span>
|
|
24
|
+
<div class="drawerHeader__title">
|
|
25
|
+
<icon
|
|
26
|
+
v-if="leftIcon"
|
|
27
|
+
:icon="leftIcon"
|
|
28
|
+
:size="ICON_SIZES.X_SMALL"
|
|
29
|
+
class="drawerHeader__leftIcon"
|
|
30
|
+
/>
|
|
31
|
+
<span
|
|
32
|
+
v-if="title"
|
|
33
|
+
:class="{ '-ellipsis': titleEllipsis }"
|
|
34
|
+
:title="titleEllipsis ? title : undefined"
|
|
35
|
+
>{{ title }}</span
|
|
36
|
+
>
|
|
37
|
+
<pill v-if="pillLabel" :label="pillLabel" />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<icon-button
|
|
41
|
+
v-if="isClosable"
|
|
42
|
+
class="drawerHeader__closeButton"
|
|
43
|
+
:icon="ICONS.FA_XMARK"
|
|
44
|
+
:size="ICON_BUTTON_SIZES.MEDIUM"
|
|
45
|
+
:touchable="false"
|
|
46
|
+
@click="$emit('close')"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
<divider v-if="hasDivider" :size="DIVIDER_SIZES.L" :prominence="DIVIDER_PROMINENCES.WEAK" />
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<style lang="scss" scoped>
|
|
54
|
+
@import '../../../../styles/settings/spacings';
|
|
55
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
56
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
57
|
+
|
|
58
|
+
$minimal-drawer-header-height: 82px;
|
|
59
|
+
|
|
60
|
+
.drawerHeader {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
|
|
64
|
+
&__secondLevel {
|
|
65
|
+
position: absolute !important; //it is required so firstLevel content does not make component wider when hidden, and important is needed so component does not change its width when button was clicked
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__leftIcon {
|
|
69
|
+
color: $color-neutral-icon;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__firstLevel {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
row-gap: $space-xxxxs;
|
|
77
|
+
|
|
78
|
+
&.-hidden {
|
|
79
|
+
visibility: hidden; //by this we make sure that height does not change when switching to second level
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&__eyebrow {
|
|
84
|
+
@include info-s-extensive-bold-uppercase;
|
|
85
|
+
|
|
86
|
+
color: $color-neutral-text-weak;
|
|
87
|
+
|
|
88
|
+
&.-isInteractive:hover {
|
|
89
|
+
color: $color-neutral-text-weak-hovered;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.-ellipsis {
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
text-overflow: ellipsis;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__title {
|
|
101
|
+
@include heading-s-default-bold-uppercase;
|
|
102
|
+
|
|
103
|
+
align-items: center;
|
|
104
|
+
color: $color-neutral-text-strong;
|
|
105
|
+
column-gap: $space-xxxs;
|
|
106
|
+
display: flex;
|
|
107
|
+
|
|
108
|
+
.-ellipsis {
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
text-overflow: ellipsis;
|
|
111
|
+
white-space: nowrap;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__titleWrapper {
|
|
116
|
+
align-items: center;
|
|
117
|
+
column-gap: $space-xxxxs;
|
|
118
|
+
display: flex;
|
|
119
|
+
justify-content: space-between;
|
|
120
|
+
min-height: $minimal-drawer-header-height;
|
|
121
|
+
padding: $space-m $space-xs $space-m $space-s;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&__closeButton {
|
|
125
|
+
align-self: flex-start;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
129
|
+
|
|
130
|
+
<script>
|
|
131
|
+
import Button from '../../Buttons/Button/Button.vue';
|
|
132
|
+
import Divider from '../../Divider/Divider.vue';
|
|
133
|
+
import IconButton from '../../Buttons/IconButton/IconButton.vue';
|
|
134
|
+
import Pill from '../../Pill/Pill.vue';
|
|
135
|
+
import Icon from '../../Icons/Icon/Icon.vue';
|
|
136
|
+
import { BUTTON_TYPES } from '../../Buttons/Button';
|
|
137
|
+
import { ICON_SIZES, ICONS } from '../../Icons/Icon';
|
|
138
|
+
import { DIVIDER_PROMINENCES, DIVIDER_SIZES } from '../../Divider';
|
|
139
|
+
import { ICON_BUTTON_SIZES } from '../../Buttons/IconButton';
|
|
140
|
+
|
|
141
|
+
export default {
|
|
142
|
+
name: 'DrawerHeader',
|
|
143
|
+
components: {
|
|
144
|
+
DsButton: Button,
|
|
145
|
+
Divider,
|
|
146
|
+
Icon,
|
|
147
|
+
IconButton,
|
|
148
|
+
Pill,
|
|
149
|
+
},
|
|
150
|
+
props: {
|
|
151
|
+
title: {
|
|
152
|
+
type: String,
|
|
153
|
+
required: true,
|
|
154
|
+
},
|
|
155
|
+
eyebrowText: {
|
|
156
|
+
type: String,
|
|
157
|
+
default: null,
|
|
158
|
+
},
|
|
159
|
+
pillLabel: {
|
|
160
|
+
type: String,
|
|
161
|
+
default: null,
|
|
162
|
+
},
|
|
163
|
+
leftIcon: {
|
|
164
|
+
type: [Object, null],
|
|
165
|
+
default: null,
|
|
166
|
+
},
|
|
167
|
+
isClosable: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
default: true,
|
|
170
|
+
},
|
|
171
|
+
isSecondLevel: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
default: false,
|
|
174
|
+
},
|
|
175
|
+
isInteractiveEyebrow: {
|
|
176
|
+
type: Boolean,
|
|
177
|
+
default: false,
|
|
178
|
+
},
|
|
179
|
+
hasDivider: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: false,
|
|
182
|
+
},
|
|
183
|
+
eyebrowEllipsis: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: false,
|
|
186
|
+
},
|
|
187
|
+
titleEllipsis: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: false,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
emits: ['close', 'eyebrowClicked'],
|
|
193
|
+
data() {
|
|
194
|
+
return {
|
|
195
|
+
BUTTON_TYPES: Object.freeze(BUTTON_TYPES),
|
|
196
|
+
DIVIDER_SIZES: Object.freeze(DIVIDER_SIZES),
|
|
197
|
+
DIVIDER_PROMINENCES: Object.freeze(DIVIDER_PROMINENCES),
|
|
198
|
+
ICONS: Object.freeze(ICONS),
|
|
199
|
+
ICON_BUTTON_SIZES: Object.freeze(ICON_BUTTON_SIZES),
|
|
200
|
+
ICON_SIZES: Object.freeze(ICON_SIZES),
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import DrawerListItem from './DrawerListItem.vue';
|
|
2
|
+
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import { DRAWER_LIST_ITEM_STATES } from './DrawerListItem.consts';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Drawer/DrawerListItem',
|
|
8
|
+
component: DrawerListItem,
|
|
9
|
+
} as Meta<typeof DrawerListItem>;
|
|
10
|
+
|
|
11
|
+
const StoryTemplate: StoryFn<typeof DrawerListItem> = (args) => ({
|
|
12
|
+
components: { DrawerListItem },
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
template: `<div style="height: 300px; width: 200px;">
|
|
17
|
+
<drawer-list-item :label="label" :value-text="valueText" :state="state" />
|
|
18
|
+
</div>`,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const Interactive = StoryTemplate.bind({});
|
|
22
|
+
|
|
23
|
+
const args = {
|
|
24
|
+
label: 'Label',
|
|
25
|
+
valueText: 'value',
|
|
26
|
+
} as Args;
|
|
27
|
+
|
|
28
|
+
const argTypes = {
|
|
29
|
+
state: {
|
|
30
|
+
control: { type: 'select', options: Object.values(DRAWER_LIST_ITEM_STATES) },
|
|
31
|
+
defaultValue: DRAWER_LIST_ITEM_STATES.DEFAULT,
|
|
32
|
+
},
|
|
33
|
+
} as ArgTypes;
|
|
34
|
+
|
|
35
|
+
Interactive.argTypes = argTypes;
|
|
36
|
+
Interactive.args = args;
|
|
37
|
+
|
|
38
|
+
Interactive.parameters = {
|
|
39
|
+
design: {
|
|
40
|
+
type: 'figma',
|
|
41
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=6785-111025&t=pzyp7YuJcnGNBfS5-4',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="drawerListItem">
|
|
3
|
+
<div class="drawerListItem__label">{{ label }}</div>
|
|
4
|
+
<ds-icon
|
|
5
|
+
v-if="state === DRAWER_LIST_ITEM_STATES.LOADING"
|
|
6
|
+
:icon="ICONS.FAD_SPINNER_THIRD"
|
|
7
|
+
:size="ICON_SIZES.XX_SMALL"
|
|
8
|
+
spinning
|
|
9
|
+
/>
|
|
10
|
+
<div v-else class="drawerListItem__value">
|
|
11
|
+
{{ valueText }}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style lang="scss" scoped>
|
|
17
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
18
|
+
@import '../../../../styles/settings/spacings';
|
|
19
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
20
|
+
|
|
21
|
+
.drawerListItem {
|
|
22
|
+
align-items: center;
|
|
23
|
+
color: $color-neutral-text-strong;
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: $space-xxs;
|
|
26
|
+
padding: $space-xxs 0;
|
|
27
|
+
width: 100%;
|
|
28
|
+
|
|
29
|
+
&__label {
|
|
30
|
+
@include label-m-default-regular;
|
|
31
|
+
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
overflow-wrap: break-word;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__value {
|
|
38
|
+
@include info-m-default-bold;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
42
|
+
|
|
43
|
+
<script lang="ts">
|
|
44
|
+
import { PropType } from 'vue';
|
|
45
|
+
|
|
46
|
+
import { DRAWER_LIST_ITEM_STATES, DrawerListItemState } from './DrawerListItem.consts';
|
|
47
|
+
import Icon, { ICONS, ICON_SIZES } from '../../Icons/Icon';
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
name: 'DrawerListItem',
|
|
51
|
+
components: {
|
|
52
|
+
DsIcon: Icon,
|
|
53
|
+
},
|
|
54
|
+
props: {
|
|
55
|
+
state: {
|
|
56
|
+
type: String as PropType<DrawerListItemState>,
|
|
57
|
+
default: DRAWER_LIST_ITEM_STATES.DEFAULT,
|
|
58
|
+
validator(state) {
|
|
59
|
+
return Object.values(DRAWER_LIST_ITEM_STATES).includes(state);
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
label: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: true,
|
|
65
|
+
},
|
|
66
|
+
valueText: {
|
|
67
|
+
type: String,
|
|
68
|
+
required: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
DRAWER_LIST_ITEM_STATES: Object.freeze(DRAWER_LIST_ITEM_STATES),
|
|
74
|
+
ICONS: Object.freeze(ICONS),
|
|
75
|
+
ICON_SIZES: Object.freeze(ICON_SIZES),
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import DrawerListItemGroup from './DrawerListItemGroup.vue';
|
|
2
|
+
|
|
3
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import DrawerListItem from '../DrawerListItem/DrawerListItem.vue';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Drawer/DrawerListItemGroup',
|
|
8
|
+
component: DrawerListItemGroup,
|
|
9
|
+
} as Meta<typeof DrawerListItemGroup>;
|
|
10
|
+
|
|
11
|
+
const StoryTemplate: StoryFn<typeof DrawerListItemGroup> = (args) => ({
|
|
12
|
+
components: { DrawerListItemGroup, DrawerListItem },
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
template: `
|
|
17
|
+
<drawer-list-item-group>
|
|
18
|
+
<drawer-list-item value-text="1" label="Item" />
|
|
19
|
+
<drawer-list-item value-text="2" label="Item" />
|
|
20
|
+
</drawer-list-item-group>
|
|
21
|
+
`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const Static = StoryTemplate.bind({});
|
|
25
|
+
|
|
26
|
+
Static.parameters = {
|
|
27
|
+
design: {
|
|
28
|
+
type: 'figma',
|
|
29
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=6785-111079&t=PEjZUz7dUozNqntp-4',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="drawerListItemGroup">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<style lang="scss" scoped>
|
|
8
|
+
@import '../../../../styles/settings/spacings';
|
|
9
|
+
|
|
10
|
+
.drawerListItemGroup {
|
|
11
|
+
padding: 0 0 $space-xxxs;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
export default {
|
|
17
|
+
name: 'DrawerListItemGroup',
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import DrawerSection from './DrawerSection.vue';
|
|
2
|
+
|
|
3
|
+
import { Args, Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Drawer/DrawerSection',
|
|
7
|
+
component: DrawerSection,
|
|
8
|
+
} as Meta<typeof DrawerSection>;
|
|
9
|
+
|
|
10
|
+
const StoryTemplate: StoryFn<typeof DrawerSection> = (args) => ({
|
|
11
|
+
components: { DrawerSection },
|
|
12
|
+
setup() {
|
|
13
|
+
return { ...args };
|
|
14
|
+
},
|
|
15
|
+
template: `
|
|
16
|
+
<drawer-section
|
|
17
|
+
:has-divider="hasDivider"
|
|
18
|
+
:is-expandable="isExpandable"
|
|
19
|
+
:title="title"
|
|
20
|
+
>
|
|
21
|
+
Default slot
|
|
22
|
+
<template #uncollapsible>Uncollapsible slot</template>
|
|
23
|
+
</drawer-section>`,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const Interactive = StoryTemplate.bind({});
|
|
27
|
+
|
|
28
|
+
const args = {
|
|
29
|
+
hasDivider: true,
|
|
30
|
+
isExpandable: false,
|
|
31
|
+
title: 'Drawer section header',
|
|
32
|
+
} as Args;
|
|
33
|
+
|
|
34
|
+
Interactive.args = args;
|
|
35
|
+
|
|
36
|
+
Interactive.parameters = {
|
|
37
|
+
design: {
|
|
38
|
+
type: 'figma',
|
|
39
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=6785-111107&t=jOrkmR91y4woubGJ-4',
|
|
40
|
+
},
|
|
41
|
+
};
|