@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
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="drawerSection">
|
|
3
|
+
<div
|
|
4
|
+
v-if="title"
|
|
5
|
+
class="drawerSection__header"
|
|
6
|
+
:class="{ '-isExpandable': isExpandable }"
|
|
7
|
+
@click="onHeaderClick"
|
|
8
|
+
>
|
|
9
|
+
<div class="drawerSection__headerTitleWrapper">
|
|
10
|
+
<div class="drawerSection__headerTitle">{{ title }}</div>
|
|
11
|
+
<ds-icon-button
|
|
12
|
+
v-if="isExpandable"
|
|
13
|
+
:color="ICON_BUTTON_COLORS.NEUTRAL"
|
|
14
|
+
:icon="isExpanded ? ICONS.FA_ANGLE_UP : ICONS.FA_ANGLE_DOWN"
|
|
15
|
+
:size="ICON_BUTTON_SIZES.X_SMALL"
|
|
16
|
+
:touchable="false"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<ds-divider v-if="hasDivider" />
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="isExpanded || !isExpandable">
|
|
22
|
+
<slot />
|
|
23
|
+
</div>
|
|
24
|
+
<div v-if="$slots.uncollapsible"><slot name="uncollapsible" /></div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style lang="scss" scoped>
|
|
29
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
30
|
+
@import '../../../../styles/settings/spacings';
|
|
31
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
32
|
+
|
|
33
|
+
.drawerSection {
|
|
34
|
+
$root: &;
|
|
35
|
+
|
|
36
|
+
&__header {
|
|
37
|
+
&:hover,
|
|
38
|
+
&:focus {
|
|
39
|
+
#{$root}__headerTitle {
|
|
40
|
+
color: $color-neutral-text-weak-hovered;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.-isExpandable {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__headerTitleWrapper {
|
|
50
|
+
align-items: center;
|
|
51
|
+
display: flex;
|
|
52
|
+
gap: $space-xxs;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&__headerTitle {
|
|
57
|
+
@include info-s-extensive-bold-uppercase;
|
|
58
|
+
|
|
59
|
+
color: $color-neutral-text-weak;
|
|
60
|
+
padding: $space-xxs 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
64
|
+
|
|
65
|
+
<script lang="ts">
|
|
66
|
+
import Divider from '../../Divider';
|
|
67
|
+
import IconButton from '../../Buttons/IconButton/IconButton.vue';
|
|
68
|
+
import { ICONS } from '../../Icons/Icon';
|
|
69
|
+
import { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES } from '../../Buttons/IconButton';
|
|
70
|
+
|
|
71
|
+
export default {
|
|
72
|
+
name: 'DrawerSection',
|
|
73
|
+
components: {
|
|
74
|
+
DsIconButton: IconButton,
|
|
75
|
+
DsDivider: Divider,
|
|
76
|
+
},
|
|
77
|
+
props: {
|
|
78
|
+
hasDivider: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: true,
|
|
81
|
+
},
|
|
82
|
+
isExpandable: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false,
|
|
85
|
+
},
|
|
86
|
+
title: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: null,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
data() {
|
|
92
|
+
return {
|
|
93
|
+
isExpanded: false,
|
|
94
|
+
ICON_BUTTON_COLORS: Object.freeze(ICON_BUTTON_COLORS),
|
|
95
|
+
ICON_BUTTON_SIZES: Object.freeze(ICON_BUTTON_SIZES),
|
|
96
|
+
ICONS: Object.freeze(ICONS),
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
onHeaderClick(): void {
|
|
101
|
+
if (this.isExpandable) {
|
|
102
|
+
this.isExpanded = !this.isExpanded;
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import DrawerTile from './DrawerTile.vue';
|
|
2
|
+
|
|
3
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import { args, argTypes, data, template } from '../../Tile/Tile.sb.shared';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Drawer/DrawerTile',
|
|
8
|
+
component: DrawerTile,
|
|
9
|
+
} as Meta<typeof DrawerTile>;
|
|
10
|
+
|
|
11
|
+
const StoryTemplate: StoryFn<typeof DrawerTile> = (args) => ({
|
|
12
|
+
components: { DrawerTile },
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
template: template('drawer-tile'),
|
|
17
|
+
data,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const Interactive = StoryTemplate.bind({});
|
|
21
|
+
|
|
22
|
+
Interactive.argTypes = argTypes;
|
|
23
|
+
Interactive.args = args;
|
|
24
|
+
|
|
25
|
+
Interactive.parameters = {
|
|
26
|
+
design: {
|
|
27
|
+
type: 'figma',
|
|
28
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=6785-111025&t=pzyp7YuJcnGNBfS5-4',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ds-tile v-bind="$attrs" class="drawerTile" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<style lang="scss" scoped>
|
|
6
|
+
@import '../../../../styles/settings/spacings';
|
|
7
|
+
|
|
8
|
+
.drawerTile {
|
|
9
|
+
padding: $space-xxs 0;
|
|
10
|
+
}
|
|
11
|
+
</style>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import Tile from '../../Tile/Tile.vue';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'DrawerTile',
|
|
18
|
+
components: {
|
|
19
|
+
DsTile: Tile,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
</script>
|
|
@@ -4,7 +4,7 @@ import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
|
4
4
|
import { OVERLAY_HEADER_BORDER_COLORS } from './OverlayHeader.consts';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title: 'Components/OverlayHeader',
|
|
7
|
+
title: 'Components/Headers/OverlayHeader',
|
|
8
8
|
component: OverlayHeader,
|
|
9
9
|
} as Meta<typeof OverlayHeader>;
|
|
10
10
|
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
</template>
|
|
98
98
|
|
|
99
99
|
<style scoped lang="scss">
|
|
100
|
-
@import '
|
|
101
|
-
@import '
|
|
102
|
-
@import '
|
|
103
|
-
@import '
|
|
104
|
-
@import '
|
|
100
|
+
@import '../../../../styles/settings/spacings';
|
|
101
|
+
@import '../../../../styles/settings/media-queries';
|
|
102
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
103
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
104
|
+
@import '../../../../styles/mixins/flex-overflow-mask';
|
|
105
105
|
|
|
106
106
|
.ds-overlayHeader {
|
|
107
107
|
align-items: center;
|
|
@@ -258,11 +258,15 @@
|
|
|
258
258
|
</style>
|
|
259
259
|
|
|
260
260
|
<script lang="ts">
|
|
261
|
-
import IconButton from '
|
|
262
|
-
import DsDivider, { DIVIDER_PROMINENCES } from '
|
|
263
|
-
import DsDropdown, { DROPDOWN_PLACEMENTS } from '
|
|
264
|
-
import {
|
|
265
|
-
|
|
261
|
+
import IconButton from '../../Buttons/IconButton/IconButton.vue';
|
|
262
|
+
import DsDivider, { DIVIDER_PROMINENCES } from '../../Divider';
|
|
263
|
+
import DsDropdown, { DROPDOWN_PLACEMENTS } from '../../Dropdown';
|
|
264
|
+
import {
|
|
265
|
+
ICON_BUTTON_COLORS,
|
|
266
|
+
ICON_BUTTON_SIZES,
|
|
267
|
+
ICON_BUTTON_STATES,
|
|
268
|
+
} from '../../Buttons/IconButton';
|
|
269
|
+
import { ICONS } from '../../Icons/Icon';
|
|
266
270
|
import { OVERLAY_HEADER_BORDER_COLORS } from './OverlayHeader.consts';
|
|
267
271
|
|
|
268
272
|
export default {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import PageHeader from './PageHeader.vue';
|
|
2
|
+
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import { PAGE_HEADER_MOBILE_LAYOUTS } from './PageHeader.consts';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Headers/PageHeader',
|
|
8
|
+
component: PageHeader,
|
|
9
|
+
} as Meta<typeof PageHeader>;
|
|
10
|
+
|
|
11
|
+
const StoryTemplate: StoryFn<typeof PageHeader> = (args) => ({
|
|
12
|
+
components: { PageHeader },
|
|
13
|
+
setup() {
|
|
14
|
+
return { ...args };
|
|
15
|
+
},
|
|
16
|
+
template:
|
|
17
|
+
'<page-header' +
|
|
18
|
+
' :page-title="pageTitle"' +
|
|
19
|
+
' :supporting-info="supportingInfo"' +
|
|
20
|
+
' :mobile-layout="mobileLayout"' +
|
|
21
|
+
' :divider="divider"' +
|
|
22
|
+
'>' +
|
|
23
|
+
'<template v-if="breadcrumbs" #breadcrumbs><div v-html="breadcrumbs" /></template>' +
|
|
24
|
+
'<template v-if="actions" #actions><div v-html="actions" /></template>' +
|
|
25
|
+
'</page-header>',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const Interactive = StoryTemplate.bind({});
|
|
29
|
+
|
|
30
|
+
const args = {
|
|
31
|
+
breadcrumbs: '',
|
|
32
|
+
actions: '',
|
|
33
|
+
pageTitle: 'Page title',
|
|
34
|
+
supportingInfo: 'Supporting info write here',
|
|
35
|
+
divider: true,
|
|
36
|
+
mobileLayout: 'vertical',
|
|
37
|
+
} as Args;
|
|
38
|
+
|
|
39
|
+
const argTypes = {
|
|
40
|
+
breadcrumbs: {
|
|
41
|
+
control: { type: 'text' },
|
|
42
|
+
},
|
|
43
|
+
actions: {
|
|
44
|
+
control: { type: 'text' },
|
|
45
|
+
},
|
|
46
|
+
pageTitle: {
|
|
47
|
+
control: { type: 'text' },
|
|
48
|
+
},
|
|
49
|
+
supportingInfo: {
|
|
50
|
+
control: { type: 'text' },
|
|
51
|
+
},
|
|
52
|
+
divider: {
|
|
53
|
+
control: { type: 'boolean' },
|
|
54
|
+
defaultValue: true,
|
|
55
|
+
},
|
|
56
|
+
mobileLayout: {
|
|
57
|
+
control: {
|
|
58
|
+
type: 'select',
|
|
59
|
+
options: Object.values(PAGE_HEADER_MOBILE_LAYOUTS),
|
|
60
|
+
defaultValue: PAGE_HEADER_MOBILE_LAYOUTS.VERTICAL,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
} as ArgTypes;
|
|
64
|
+
|
|
65
|
+
Interactive.argTypes = argTypes;
|
|
66
|
+
Interactive.args = args;
|
|
67
|
+
Interactive.parameters = {
|
|
68
|
+
actions: {
|
|
69
|
+
handles: ['click'],
|
|
70
|
+
},
|
|
71
|
+
design: {
|
|
72
|
+
type: 'figma',
|
|
73
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?type=design&node-id=6984-129711&t=ivzu5dM9vSgW20Re-0',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="pageHeader"
|
|
4
|
+
:class="{ '-horizontal': mobileLayout === PAGE_HEADER_MOBILE_LAYOUTS.HORIZONTAL }"
|
|
5
|
+
>
|
|
6
|
+
<div class="pageHeader__wrapper">
|
|
7
|
+
<div v-if="$slots.breadcrumbs" class="pageHeader__breadcrumbs">
|
|
8
|
+
<slot name="breadcrumbs" />
|
|
9
|
+
</div>
|
|
10
|
+
<div class="pageHeader__contentWrapper">
|
|
11
|
+
<div class="pageHeader__textWrapper">
|
|
12
|
+
<div class="pageHeader__title">{{ pageTitle }}</div>
|
|
13
|
+
<div v-if="supportingInfo" class="pageHeader__supportingText"
|
|
14
|
+
>{{ supportingInfo }}
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div v-if="$slots.actions" class="pageHeader__actions">
|
|
19
|
+
<slot name="actions" />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<ds-divider v-if="divider" />
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<style scoped lang="scss">
|
|
28
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
29
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
30
|
+
@import '../../../../styles/settings/media-queries';
|
|
31
|
+
@import '../../../../styles/settings/spacings';
|
|
32
|
+
|
|
33
|
+
.pageHeader {
|
|
34
|
+
$root: &;
|
|
35
|
+
|
|
36
|
+
padding: 0;
|
|
37
|
+
|
|
38
|
+
&__wrapper {
|
|
39
|
+
align-items: flex-start;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: $space-xxs;
|
|
43
|
+
padding: $space-xxs 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&__contentWrapper {
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: $space-xxs;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
padding: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
@media #{breakpoint-s()} {
|
|
56
|
+
align-items: center;
|
|
57
|
+
flex-direction: row;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__textWrapper {
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: $space-xxxxs;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
padding: $space-xxxxs 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__title {
|
|
71
|
+
@include pageHeading-s-default-bold;
|
|
72
|
+
|
|
73
|
+
color: $color-default-text;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&__supportingText {
|
|
77
|
+
@include info-m-default-regular;
|
|
78
|
+
|
|
79
|
+
color: $color-neutral-text;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.-horizontal {
|
|
83
|
+
#{$root}__contentWrapper {
|
|
84
|
+
align-items: center;
|
|
85
|
+
flex-direction: row;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
90
|
+
|
|
91
|
+
<script lang="ts">
|
|
92
|
+
import DsDivider from '../../Divider';
|
|
93
|
+
import { PAGE_HEADER_MOBILE_LAYOUTS } from './PageHeader.consts';
|
|
94
|
+
|
|
95
|
+
export default {
|
|
96
|
+
name: 'PageHeader',
|
|
97
|
+
components: {
|
|
98
|
+
DsDivider,
|
|
99
|
+
},
|
|
100
|
+
props: {
|
|
101
|
+
pageTitle: {
|
|
102
|
+
type: String,
|
|
103
|
+
required: true,
|
|
104
|
+
},
|
|
105
|
+
supportingInfo: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: null,
|
|
108
|
+
},
|
|
109
|
+
divider: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true,
|
|
112
|
+
},
|
|
113
|
+
mobileLayout: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: PAGE_HEADER_MOBILE_LAYOUTS.VERTICAL,
|
|
116
|
+
validator: (value) => Object.values(PAGE_HEADER_MOBILE_LAYOUTS).includes(value),
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
data() {
|
|
120
|
+
return {
|
|
121
|
+
PAGE_HEADER_MOBILE_LAYOUTS: Object.freeze(PAGE_HEADER_MOBILE_LAYOUTS),
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
</script>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import SectionHeader from './SectionHeader.vue';
|
|
2
|
-
import { SECTION_HEADER_SIZES } from './SectionHeader.consts';
|
|
3
|
-
import { ICONS } from '
|
|
2
|
+
import { SECTION_HEADER_MOBILE_LAYOUTS, SECTION_HEADER_SIZES } from './SectionHeader.consts';
|
|
3
|
+
import { ICONS } from '../../Icons/Icon';
|
|
4
4
|
|
|
5
5
|
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
|
-
title: 'Components/SectionHeader',
|
|
8
|
+
title: 'Components/Headers/SectionHeader',
|
|
9
9
|
component: SectionHeader,
|
|
10
10
|
} as Meta<typeof SectionHeader>;
|
|
11
11
|
|
|
@@ -28,13 +28,18 @@ const StoryTemplate: StoryFn<typeof SectionHeader> = (args, { updateArgs }) => (
|
|
|
28
28
|
},
|
|
29
29
|
template:
|
|
30
30
|
'<section-header' +
|
|
31
|
-
' :expandable="
|
|
31
|
+
' :is-expandable="isExpandable"' +
|
|
32
32
|
' :hide-slot-when-collapsed="hideSlotWhenCollapsed"' +
|
|
33
33
|
' :icon-left="ICONS[iconLeft]"' +
|
|
34
|
+
' :icon-right="ICONS[iconRight]"' +
|
|
34
35
|
' :is-expanded="isExpanded"' +
|
|
35
36
|
' :size="size"' +
|
|
36
|
-
' :
|
|
37
|
+
' :info="info"' +
|
|
37
38
|
' :title="title"' +
|
|
39
|
+
' :eyebrow="eyebrow"' +
|
|
40
|
+
' :divider="divider"' +
|
|
41
|
+
' :mobile-layout="mobileLayout"' +
|
|
42
|
+
' :supportingText="supportingText"' +
|
|
38
43
|
' @update:isExpanded="onIsExpandedUpdated"' +
|
|
39
44
|
'>' +
|
|
40
45
|
'<div style="border: 1px solid;">Slot content</div>' +
|
|
@@ -44,13 +49,19 @@ const StoryTemplate: StoryFn<typeof SectionHeader> = (args, { updateArgs }) => (
|
|
|
44
49
|
export const Interactive = StoryTemplate.bind({});
|
|
45
50
|
|
|
46
51
|
const args = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
size: SECTION_HEADER_SIZES.MEDIUM,
|
|
53
|
+
title: 'Section Header',
|
|
54
|
+
supportingText:
|
|
55
|
+
'Supporting text. Et doloribus aspernatur suscipit provident maiores. Natus natus et pariatur. Eligendi illo quo esse. Tenetur ad neque veniam.',
|
|
56
|
+
eyebrow: 'eyebrow text',
|
|
57
|
+
iconLeft: ICONS.FA_PLAY,
|
|
58
|
+
iconRight: ICONS.FA_BOOK,
|
|
59
|
+
info: true,
|
|
60
|
+
divider: true,
|
|
61
|
+
isExpandable: false,
|
|
50
62
|
isExpanded: false,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
title: 'Title',
|
|
63
|
+
hideSlotWhenCollapsed: false,
|
|
64
|
+
mobileLayout: SECTION_HEADER_MOBILE_LAYOUTS.VERTICAL,
|
|
54
65
|
} as Args;
|
|
55
66
|
|
|
56
67
|
const argTypes = {
|
|
@@ -58,9 +69,28 @@ const argTypes = {
|
|
|
58
69
|
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
59
70
|
defaultValue: null,
|
|
60
71
|
},
|
|
72
|
+
iconRight: {
|
|
73
|
+
control: { type: 'select', options: [null, ...Object.keys(ICONS)] },
|
|
74
|
+
defaultValue: null,
|
|
75
|
+
},
|
|
61
76
|
size: {
|
|
62
77
|
control: { type: 'select', options: Object.values(SECTION_HEADER_SIZES) },
|
|
63
|
-
defaultValue: SECTION_HEADER_SIZES.
|
|
78
|
+
defaultValue: SECTION_HEADER_SIZES.MEDIUM,
|
|
79
|
+
},
|
|
80
|
+
divider: {
|
|
81
|
+
control: { type: 'boolean' },
|
|
82
|
+
defaultValue: true,
|
|
83
|
+
},
|
|
84
|
+
info: {
|
|
85
|
+
control: { type: 'boolean' },
|
|
86
|
+
defaultValue: false,
|
|
87
|
+
},
|
|
88
|
+
mobileLayout: {
|
|
89
|
+
control: {
|
|
90
|
+
type: 'select',
|
|
91
|
+
options: Object.values(SECTION_HEADER_MOBILE_LAYOUTS),
|
|
92
|
+
defaultValue: SECTION_HEADER_MOBILE_LAYOUTS.VERTICAL,
|
|
93
|
+
},
|
|
64
94
|
},
|
|
65
95
|
} as ArgTypes;
|
|
66
96
|
|
|
@@ -68,8 +98,11 @@ Interactive.argTypes = argTypes;
|
|
|
68
98
|
Interactive.args = args;
|
|
69
99
|
|
|
70
100
|
Interactive.parameters = {
|
|
101
|
+
actions: {
|
|
102
|
+
handles: ['click'],
|
|
103
|
+
},
|
|
71
104
|
design: {
|
|
72
105
|
type: 'figma',
|
|
73
|
-
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=
|
|
106
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?type=design&node-id=6984-129711&t=ivzu5dM9vSgW20Re-0',
|
|
74
107
|
},
|
|
75
108
|
};
|