@bethinkpl/design-system 40.0.1 → 41.0.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/dist/design-system.css +1 -1
- package/dist/design-system.js +7456 -7361
- package/dist/design-system.js.map +1 -1
- package/dist/lib/js/components/Cards/Card/Card.consts.d.ts +1 -0
- package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +0 -9
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +0 -36
- package/dist/lib/js/components/ContainerRibbon/ContainerRibbon.consts.d.ts +1 -0
- package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +1 -1
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +2 -2
- package/dist/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.consts.d.ts +17 -0
- package/dist/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.vue.d.ts +27 -0
- package/dist/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.vue.d.ts +13 -0
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +6 -2
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +3 -12
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +1 -1
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +6 -2
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +6 -2
- package/dist/lib/js/components/Stepper/Stepper.vue.d.ts +23 -0
- package/dist/lib/js/components/Stepper/index.d.ts +3 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +0 -36
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +0 -36
- package/dist/lib/js/components/TextGroup/TextGroup.vue.d.ts +0 -3
- package/dist/lib/js/components/Tile/Tile.vue.d.ts +1 -1
- package/dist/lib/js/components/Toast/Toast.vue.d.ts +0 -36
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +1 -1
- package/dist/lib/js/components/TopNav/TopNav/TopNav.vue.d.ts +17 -0
- package/dist/lib/js/components/TopNav/TopNavBranding/TopNavBranding.vue.d.ts +33 -0
- package/dist/lib/js/components/TopNav/topNavStoryLogo.d.ts +1 -0
- package/dist/lib/js/components/Well/Well.consts.d.ts +1 -0
- package/dist/lib/js/index.d.ts +6 -5
- package/lib/js/components/Cards/Card/Card.vue +0 -11
- package/lib/js/components/ContainerRibbon/ContainerRibbon.consts.ts +1 -0
- package/lib/js/components/ContainerRibbon/ContainerRibbon.spec.ts +9 -6
- package/lib/js/components/ContainerRibbon/ContainerRibbon.vue +11 -0
- package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.consts.ts +20 -0
- package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.spec.ts +125 -0
- package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.stories.ts +69 -0
- package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.vue +101 -0
- package/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.spec.ts +24 -0
- package/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.stories.ts +31 -0
- package/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.vue +19 -0
- package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.stories.ts +93 -8
- package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue +3 -0
- package/lib/js/components/RichList/RichListItem/RichListItem.stories.ts +83 -0
- package/lib/js/components/RichList/RichListItem/RichListItem.vue +11 -4
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.ts +7 -0
- package/lib/js/components/SelectList/SelectListItem/SelectListItem.vue +9 -3
- package/lib/js/components/Stepper/Stepper.spec.ts +99 -0
- package/lib/js/components/Stepper/Stepper.stories.ts +62 -0
- package/lib/js/components/Stepper/Stepper.vue +97 -0
- package/lib/js/components/Stepper/index.ts +3 -0
- package/lib/js/components/TextGroup/TextGroup.vue +0 -5
- package/lib/js/components/TopNav/TopNav/TopNav.spec.ts +56 -0
- package/lib/js/components/TopNav/TopNav/TopNav.stories.ts +99 -0
- package/lib/js/components/TopNav/TopNav/TopNav.vue +79 -0
- package/lib/js/components/TopNav/TopNavBranding/TopNavBranding.spec.ts +103 -0
- package/lib/js/components/TopNav/TopNavBranding/TopNavBranding.stories.ts +107 -0
- package/lib/js/components/TopNav/TopNavBranding/TopNavBranding.vue +102 -0
- package/lib/js/components/TopNav/topNavStoryLogo.ts +19 -0
- package/lib/js/index.ts +6 -5
- package/lib/js/styles/Radiuses/Radiuses.stories.ts +44 -0
- package/lib/js/styles/Shadows/Shadows.stories.scss +33 -0
- package/lib/js/styles/Shadows/Shadows.stories.ts +37 -0
- package/package.json +1 -1
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.d.ts +0 -5
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +0 -406
- package/dist/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue.d.ts +0 -2
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.ts +0 -7
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.stories.ts +0 -44
- package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue +0 -83
- package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.stories.ts +0 -31
- package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue +0 -21
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ds-topNav">
|
|
3
|
+
<div class="ds-topNav__leftWrapper">
|
|
4
|
+
<div v-if="$slots.leading" class="ds-topNav__leading">
|
|
5
|
+
<slot name="leading" />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="ds-topNav__default">
|
|
8
|
+
<slot />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-if="$slots.trailing" class="ds-topNav__trailing">
|
|
12
|
+
<slot name="trailing" />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" scoped>
|
|
18
|
+
@import '../../../../styles/settings/spacings';
|
|
19
|
+
@import '../../../../styles/settings/shadows';
|
|
20
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
21
|
+
@import '../../../../styles/settings/media-queries';
|
|
22
|
+
|
|
23
|
+
.ds-topNav {
|
|
24
|
+
align-items: center;
|
|
25
|
+
background-color: $color-default-background;
|
|
26
|
+
box-shadow: $shadow-s;
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: $space-6;
|
|
29
|
+
height: 56px;
|
|
30
|
+
padding: 0 $space-6 0 $space-3;
|
|
31
|
+
width: 100%;
|
|
32
|
+
|
|
33
|
+
@media #{breakpoint-s()} {
|
|
34
|
+
padding: $space-6 $space-10;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__leftWrapper {
|
|
38
|
+
align-items: center;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex: 1 0 0;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
|
|
43
|
+
@media #{breakpoint-s()} {
|
|
44
|
+
gap: $space-4;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__leading {
|
|
49
|
+
align-items: center;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__default {
|
|
55
|
+
flex: 1 0 0;
|
|
56
|
+
margin-left: $space-3;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
|
|
59
|
+
@media #{breakpoint-s()} {
|
|
60
|
+
margin-left: 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__trailing {
|
|
65
|
+
align-items: center;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
justify-content: flex-end;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
72
|
+
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
defineSlots<{
|
|
75
|
+
leading?: () => any;
|
|
76
|
+
default?: () => any;
|
|
77
|
+
trailing?: () => any;
|
|
78
|
+
}>();
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import { h } from 'vue';
|
|
4
|
+
|
|
5
|
+
import TopNavBranding from './TopNavBranding.vue';
|
|
6
|
+
|
|
7
|
+
describe('TopNavBranding', () => {
|
|
8
|
+
const createComponent = (props = {}, slots = {}) =>
|
|
9
|
+
mount(TopNavBranding, {
|
|
10
|
+
props: {
|
|
11
|
+
title: 'Title',
|
|
12
|
+
...props,
|
|
13
|
+
},
|
|
14
|
+
slots,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should create', () => {
|
|
18
|
+
const component = createComponent();
|
|
19
|
+
|
|
20
|
+
expect(component.exists()).toBe(true);
|
|
21
|
+
expect(component.find('.ds-topNavBranding').exists()).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('renders the title', () => {
|
|
25
|
+
const component = createComponent({ title: 'Kurs do LEK' });
|
|
26
|
+
|
|
27
|
+
expect(component.find('.ds-topNavBranding__title').text()).toBe('Kurs do LEK');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('renders the logo slot when provided', () => {
|
|
31
|
+
const component = createComponent(
|
|
32
|
+
{},
|
|
33
|
+
{ logo: () => h('span', { class: 'child' }, 'Logo') },
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
expect(component.find('.ds-topNavBranding__logo .child').text()).toBe('Logo');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('does not render the logo wrapper when the slot is not provided', () => {
|
|
40
|
+
const component = createComponent();
|
|
41
|
+
|
|
42
|
+
expect(component.find('.ds-topNavBranding__logo').exists()).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('renders the accessory slot when provided', () => {
|
|
46
|
+
const component = createComponent(
|
|
47
|
+
{},
|
|
48
|
+
{ accessory: () => h('span', { class: 'child' }, 'Accessory') },
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
expect(component.find('.ds-topNavBranding__accessory .child').text()).toBe('Accessory');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('does not render the accessory wrapper when the slot is not provided', () => {
|
|
55
|
+
const component = createComponent();
|
|
56
|
+
|
|
57
|
+
expect(component.find('.ds-topNavBranding__accessory').exists()).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('link rendering', () => {
|
|
61
|
+
it('renders the brand as a non-interactive div by default', () => {
|
|
62
|
+
const component = createComponent();
|
|
63
|
+
const brand = component.find('.ds-topNavBranding__brand');
|
|
64
|
+
|
|
65
|
+
expect(brand.element.tagName).toBe('DIV');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('renders the brand as an anchor when href is provided', () => {
|
|
69
|
+
const component = createComponent({ href: 'https://example.com' });
|
|
70
|
+
const brand = component.find('.ds-topNavBranding__brand');
|
|
71
|
+
|
|
72
|
+
expect(brand.element.tagName).toBe('A');
|
|
73
|
+
expect(brand.attributes('href')).toBe('https://example.com');
|
|
74
|
+
expect(brand.find('.ds-topNavBranding__title').text()).toBe('Title');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('renders the brand as a router-link when to is provided', () => {
|
|
78
|
+
const component = createComponent({ to: '/home' });
|
|
79
|
+
const brand = component.find('.ds-topNavBranding__brand');
|
|
80
|
+
|
|
81
|
+
expect(brand.element.tagName).toBe('ROUTER-LINK');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('prioritizes href over to', () => {
|
|
85
|
+
const component = createComponent({ href: 'https://example.com', to: '/home' });
|
|
86
|
+
const brand = component.find('.ds-topNavBranding__brand');
|
|
87
|
+
|
|
88
|
+
expect(brand.element.tagName).toBe('A');
|
|
89
|
+
expect(brand.attributes('href')).toBe('https://example.com');
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('keeps the accessory outside the link', () => {
|
|
93
|
+
const component = createComponent(
|
|
94
|
+
{ href: 'https://example.com' },
|
|
95
|
+
{ accessory: () => h('span', { class: 'child' }, 'Accessory') },
|
|
96
|
+
);
|
|
97
|
+
const brand = component.find('.ds-topNavBranding__brand');
|
|
98
|
+
|
|
99
|
+
expect(brand.find('.ds-topNavBranding__accessory').exists()).toBe(false);
|
|
100
|
+
expect(component.find('.ds-topNavBranding__accessory .child').text()).toBe('Accessory');
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import TopNavBranding from './TopNavBranding.vue';
|
|
2
|
+
|
|
3
|
+
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
4
|
+
import Flag from '../../Flag/Flag.vue';
|
|
5
|
+
import { FLAG_SIZES } from '../../Flag/Flag.consts';
|
|
6
|
+
import * as FLAGS from '../../Flag/flags';
|
|
7
|
+
import SlotPlaceholder, {
|
|
8
|
+
SLOT_PLACEHOLDER_SIZES,
|
|
9
|
+
} from '../../../../../.storybook/SlotPlaceholder/SlotPlaceholder.vue';
|
|
10
|
+
import { toRefs } from 'vue';
|
|
11
|
+
import { TOP_NAV_STORY_LOGO } from '../topNavStoryLogo';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Components/TopNav/TopNavBranding',
|
|
15
|
+
component: TopNavBranding,
|
|
16
|
+
} as Meta<typeof TopNavBranding>;
|
|
17
|
+
|
|
18
|
+
const FilledTemplate: StoryFn<typeof TopNavBranding> = (args) => ({
|
|
19
|
+
components: { TopNavBranding, Flag },
|
|
20
|
+
setup() {
|
|
21
|
+
return {
|
|
22
|
+
...toRefs(args),
|
|
23
|
+
logo: TOP_NAV_STORY_LOGO,
|
|
24
|
+
FLAGS,
|
|
25
|
+
FLAG_SIZES,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
template: `
|
|
29
|
+
<top-nav-branding :title="title" :href="href" :to="to">
|
|
30
|
+
<template #logo>
|
|
31
|
+
<span v-html="logo" style="display: inline-flex;" />
|
|
32
|
+
</template>
|
|
33
|
+
<template #accessory>
|
|
34
|
+
<flag :flag="FLAGS.FLAG_POLAND" :size="FLAG_SIZES.XXS" />
|
|
35
|
+
</template>
|
|
36
|
+
</top-nav-branding>
|
|
37
|
+
`,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const Filled = FilledTemplate.bind({});
|
|
41
|
+
|
|
42
|
+
export const Linked = FilledTemplate.bind({});
|
|
43
|
+
|
|
44
|
+
const SlotPlaceholdersTemplate: StoryFn<typeof TopNavBranding> = (args) => ({
|
|
45
|
+
components: { TopNavBranding, SlotPlaceholder },
|
|
46
|
+
setup() {
|
|
47
|
+
return {
|
|
48
|
+
...toRefs(args),
|
|
49
|
+
SLOT_PLACEHOLDER_SIZES,
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
template: `
|
|
53
|
+
<top-nav-branding :title="title">
|
|
54
|
+
<template #logo>
|
|
55
|
+
<slot-placeholder label="logo" :size="SLOT_PLACEHOLDER_SIZES.MEDIUM" />
|
|
56
|
+
</template>
|
|
57
|
+
<template #accessory>
|
|
58
|
+
<slot-placeholder label="accessory" :size="SLOT_PLACEHOLDER_SIZES.MEDIUM" />
|
|
59
|
+
</template>
|
|
60
|
+
</top-nav-branding>
|
|
61
|
+
`,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const SlotPlaceholders = SlotPlaceholdersTemplate.bind({});
|
|
65
|
+
|
|
66
|
+
const args = {
|
|
67
|
+
title: 'Bethink',
|
|
68
|
+
href: '',
|
|
69
|
+
to: '',
|
|
70
|
+
} as Args;
|
|
71
|
+
|
|
72
|
+
const argTypes = {
|
|
73
|
+
title: {
|
|
74
|
+
control: 'text',
|
|
75
|
+
},
|
|
76
|
+
href: {
|
|
77
|
+
control: 'text',
|
|
78
|
+
description: 'Renders the logo + title as an `<a>` linking to this URL.',
|
|
79
|
+
},
|
|
80
|
+
to: {
|
|
81
|
+
control: 'text',
|
|
82
|
+
description:
|
|
83
|
+
'Renders the logo + title as a `<router-link>` (resolved by the host app). Ignored when `href` is set.',
|
|
84
|
+
},
|
|
85
|
+
} as ArgTypes;
|
|
86
|
+
|
|
87
|
+
const parameters = {
|
|
88
|
+
design: {
|
|
89
|
+
type: 'figma',
|
|
90
|
+
url: 'https://www.figma.com/design/xym3gXf0vBCofzksDtRDaU/INI-201-E-commerce?node-id=345-21287&m=dev',
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
Filled.args = args;
|
|
95
|
+
Filled.argTypes = argTypes;
|
|
96
|
+
Filled.parameters = parameters;
|
|
97
|
+
|
|
98
|
+
Linked.args = {
|
|
99
|
+
...args,
|
|
100
|
+
href: '/',
|
|
101
|
+
} as Args;
|
|
102
|
+
Linked.argTypes = argTypes;
|
|
103
|
+
Linked.parameters = parameters;
|
|
104
|
+
|
|
105
|
+
SlotPlaceholders.args = args;
|
|
106
|
+
SlotPlaceholders.argTypes = argTypes;
|
|
107
|
+
SlotPlaceholders.parameters = parameters;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ds-topNavBranding">
|
|
3
|
+
<component :is="brandAs" v-bind="brandBindings" class="ds-topNavBranding__brand">
|
|
4
|
+
<span v-if="$slots.logo" class="ds-topNavBranding__logo">
|
|
5
|
+
<slot name="logo" />
|
|
6
|
+
</span>
|
|
7
|
+
<span class="ds-topNavBranding__title">
|
|
8
|
+
{{ title }}
|
|
9
|
+
</span>
|
|
10
|
+
</component>
|
|
11
|
+
<div v-if="$slots.accessory" class="ds-topNavBranding__accessory">
|
|
12
|
+
<slot name="accessory" />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" scoped>
|
|
18
|
+
@import '../../../../styles/settings/spacings';
|
|
19
|
+
@import '../../../../styles/settings/typography/tokens';
|
|
20
|
+
@import '../../../../styles/settings/colors/tokens';
|
|
21
|
+
@import '../../../../styles/settings/media-queries';
|
|
22
|
+
|
|
23
|
+
.ds-topNavBranding {
|
|
24
|
+
align-items: center;
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: $space-6;
|
|
27
|
+
width: 100%;
|
|
28
|
+
|
|
29
|
+
&__brand {
|
|
30
|
+
align-items: center;
|
|
31
|
+
color: inherit;
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: $space-6;
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__logo {
|
|
38
|
+
align-items: center;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__title {
|
|
44
|
+
@include text-m-compact-regular;
|
|
45
|
+
|
|
46
|
+
color: $color-default-text;
|
|
47
|
+
flex: 0 1 auto;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
|
|
53
|
+
@media #{breakpoint-s()} {
|
|
54
|
+
@include text-l-compact-regular;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__accessory {
|
|
59
|
+
align-items: center;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
65
|
+
|
|
66
|
+
<script setup lang="ts">
|
|
67
|
+
import { computed } from 'vue';
|
|
68
|
+
|
|
69
|
+
// DS don't have vue-router installed, so we define a loose type which should match RouteLocationRaw
|
|
70
|
+
type RouterLocation = string | Record<string, unknown>;
|
|
71
|
+
|
|
72
|
+
const { href = '', to = '' } = defineProps<{
|
|
73
|
+
title: string;
|
|
74
|
+
href?: string;
|
|
75
|
+
to?: RouterLocation;
|
|
76
|
+
}>();
|
|
77
|
+
|
|
78
|
+
defineSlots<{
|
|
79
|
+
logo?: () => any;
|
|
80
|
+
accessory?: () => any;
|
|
81
|
+
}>();
|
|
82
|
+
|
|
83
|
+
const brandAs = computed(() => {
|
|
84
|
+
if (href) {
|
|
85
|
+
return 'a';
|
|
86
|
+
}
|
|
87
|
+
if (to) {
|
|
88
|
+
return 'router-link';
|
|
89
|
+
}
|
|
90
|
+
return 'div';
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const brandBindings = computed(() => {
|
|
94
|
+
if (href) {
|
|
95
|
+
return { href };
|
|
96
|
+
}
|
|
97
|
+
if (to) {
|
|
98
|
+
return { to };
|
|
99
|
+
}
|
|
100
|
+
return {};
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Shared SVG logo markup used by the TopNav and TopNavBranding Storybook stories.
|
|
2
|
+
export const TOP_NAV_STORY_LOGO = `
|
|
3
|
+
<span style="display: inline-flex; height: 24px; width: 31.448px;">
|
|
4
|
+
<svg preserveAspectRatio="none" width="100%" height="100%" viewBox="0 0 31.4483 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block;">
|
|
5
|
+
<g clip-path="url(#clip0_0_28)">
|
|
6
|
+
<path d="M6.79071 8.23154C6.79071 8.64557 7.12449 8.95993 7.51966 8.95993C7.68463 8.95993 7.84193 8.90242 7.96086 8.81041L11.947 11.7278C11.8818 11.8658 11.8435 12.023 11.8435 12.1878C11.8435 12.3527 11.878 12.4984 11.9432 12.6287L7.96853 15.3966C7.84193 15.2969 7.68463 15.2318 7.51582 15.2318C7.10147 15.2318 6.78687 15.5653 6.78687 15.9601C6.78687 16.3742 7.12065 16.6885 7.51582 16.6885C7.91099 16.6885 8.24477 16.355 8.24477 15.9601C8.24477 15.8758 8.22558 15.7876 8.19873 15.7186L12.1657 12.9584C12.3614 13.1539 12.6338 13.2728 12.9215 13.2728C13.5315 13.2728 13.9996 12.7782 13.9996 12.1955C13.9996 11.6128 13.5277 11.0991 12.933 11.0991C12.6491 11.0991 12.3883 11.2179 12.1887 11.402L8.20256 8.48839C8.23709 8.40788 8.2486 8.32354 8.2486 8.23154C8.2486 7.8175 7.91482 7.50314 7.51966 7.50314C7.10531 7.50314 6.79071 7.83667 6.79071 8.23154ZM12.933 11.6856C13.2093 11.6856 13.428 11.9042 13.428 12.1802C13.428 12.4562 13.2093 12.6747 12.933 12.6747C12.6568 12.6747 12.4381 12.4562 12.4381 12.1802C12.4381 11.9042 12.6568 11.6856 12.933 11.6856ZM7.86111 8.24687C7.86111 8.42322 7.70381 8.5804 7.52733 8.5804C7.35085 8.5804 7.19355 8.42322 7.19355 8.24687C7.19355 8.07052 7.35085 7.91334 7.52733 7.91334C7.70381 7.91334 7.86111 8.07052 7.86111 8.24687Z" fill="#101921"/>
|
|
7
|
+
<path d="M4.4811 14.9481C4.58916 14.9481 4.67677 14.8605 4.67677 14.7526C4.67677 14.6446 4.58916 14.557 4.4811 14.557C4.37304 14.557 4.28544 14.6446 4.28544 14.7526C4.28544 14.8605 4.37304 14.9481 4.4811 14.9481Z" fill="#101921"/>
|
|
8
|
+
<path d="M3.59102 13.499C3.40686 13.499 3.25724 13.6485 3.25724 13.8325C3.25724 14.0165 3.40686 14.166 3.59102 14.166C3.77517 14.166 3.9248 14.0165 3.9248 13.8325C3.9248 13.6485 3.77517 13.499 3.59102 13.499Z" fill="#101921"/>
|
|
9
|
+
<path d="M3.8097 12.0843C3.8097 11.7278 3.53347 11.4518 3.17667 11.4518C2.81987 11.4518 2.54364 11.7278 2.54364 12.0843C2.54364 12.4409 2.81987 12.7169 3.17667 12.7169C3.53347 12.7169 3.8097 12.4409 3.8097 12.0843Z" fill="#101921"/>
|
|
10
|
+
<path d="M24.3315 5.37931H7.6923C3.44139 5.37931 0 8.34271 0 12C0 15.6573 3.46058 18.6207 7.6923 18.6207H24.3123C28.2486 18.6207 31.4521 15.6343 31.4521 11.9885C31.4521 8.34271 28.2639 5.37931 24.3315 5.37931ZM15.5419 17.5434H7.71148C4.07443 17.5434 1.10493 15.0631 1.10493 12C1.10493 8.93692 4.05141 6.45656 7.71148 6.45656H15.5419V17.5434ZM29.8753 10.6122C29.8561 10.6122 29.8177 10.6237 29.7755 10.6237C29.6566 10.6161 29.5645 10.5509 29.5108 10.4282C28.9852 9.00976 27.7076 7.83284 26.0694 7.29996C25.9198 7.24629 25.8277 7.08144 25.8776 6.93193C25.9313 6.78242 26.0963 6.69041 26.2459 6.74025C28.0337 7.34597 29.4571 8.64557 30.0364 10.225C30.0901 10.3899 30.0172 10.5471 29.8715 10.6122H29.8753Z" fill="#101921"/>
|
|
11
|
+
</g>
|
|
12
|
+
<defs>
|
|
13
|
+
<clipPath id="clip0_0_28">
|
|
14
|
+
<rect width="31.4483" height="24" fill="white"/>
|
|
15
|
+
</clipPath>
|
|
16
|
+
</defs>
|
|
17
|
+
</svg>
|
|
18
|
+
</span>
|
|
19
|
+
`;
|
package/lib/js/index.ts
CHANGED
|
@@ -96,11 +96,9 @@ export { default as DsDrawerDivider } from './components/Drawer/DrawerDivider/Dr
|
|
|
96
96
|
export { default as DrawerHeader } from './components/Drawer/DrawerHeader/DrawerHeader.vue';
|
|
97
97
|
export { default as DsDrawerHeader } from './components/Drawer/DrawerHeader/DrawerHeader.vue';
|
|
98
98
|
export * from './components/Drawer/DrawerHeader/DrawerHeader.consts';
|
|
99
|
-
export { default as
|
|
100
|
-
export { default as
|
|
101
|
-
export
|
|
102
|
-
export { default as DsDrawerListItemGroup } from './components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue';
|
|
103
|
-
export * from './components/Drawer/DrawerListItem/DrawerListItem.consts';
|
|
99
|
+
export { default as DsLabelValueItem } from './components/LabelValue/LabelValueItem/LabelValueItem.vue';
|
|
100
|
+
export { default as DsLabelValueItemGroup } from './components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.vue';
|
|
101
|
+
export * from './components/LabelValue/LabelValueItem/LabelValueItem.consts';
|
|
104
102
|
export { default as DrawerTile } from './components/Drawer/DrawerTile/DrawerTile.vue';
|
|
105
103
|
export { default as DsDrawerTile } from './components/Drawer/DrawerTile/DrawerTile.vue';
|
|
106
104
|
export { default as DrawerSection } from './components/Drawer/DrawerSection/DrawerSection.vue';
|
|
@@ -188,6 +186,9 @@ export { default as DsSkeleton } from './components/Skeleton/Skeleton.vue';
|
|
|
188
186
|
export { default as DsStatsLayout } from './components/StatsLayout/StatsLayout.vue';
|
|
189
187
|
export { default as DsStatsResetBanner } from './components/StatsLayout/StatsResetBanner/StatsResetBanner.vue';
|
|
190
188
|
export { default as DsStatsSectionHeader } from './components/StatsLayout/StatsSectionHeader/StatsSectionHeader.vue';
|
|
189
|
+
export { default as DsStepper } from './components/Stepper';
|
|
190
|
+
export { default as DsTopNav } from './components/TopNav/TopNav/TopNav.vue';
|
|
191
|
+
export { default as DsTopNavBranding } from './components/TopNav/TopNavBranding/TopNavBranding.vue';
|
|
191
192
|
export { default as DsFlag } from './components/Flag';
|
|
192
193
|
export * from './components/Flag/Flag.consts';
|
|
193
194
|
export * from './components/Flag/flags';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'foundations/Radiuses',
|
|
5
|
+
} as Meta;
|
|
6
|
+
|
|
7
|
+
const radiuses = [
|
|
8
|
+
{ name: 'radius-xs', value: '2px' },
|
|
9
|
+
{ name: 'radius-s', value: '4px' },
|
|
10
|
+
{ name: 'radius-m', value: '6px' },
|
|
11
|
+
{ name: 'radius-l', value: '8px' },
|
|
12
|
+
// Special radius for components which have to be always rounded
|
|
13
|
+
{ name: 'radius-xl', value: '200px' },
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const StoryTemplate: StoryFn = () => ({
|
|
17
|
+
setup() {
|
|
18
|
+
return {
|
|
19
|
+
radiuses,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
methods: {
|
|
23
|
+
getStyles(radius) {
|
|
24
|
+
return `
|
|
25
|
+
border-radius: ${radius.value};
|
|
26
|
+
background-color: gray;
|
|
27
|
+
height: 80px;
|
|
28
|
+
width: 160px;
|
|
29
|
+
`;
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
template: `
|
|
33
|
+
<div>
|
|
34
|
+
<div v-for="radius in radiuses" style="margin-bottom: 24px;">
|
|
35
|
+
<code>
|
|
36
|
+
\${{ radius.name }}: {{ radius.value }}
|
|
37
|
+
</code>
|
|
38
|
+
<div :style="getStyles(radius)"></div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
`,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const Static = StoryTemplate.bind({});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import '../../../styles/settings/shadows';
|
|
2
|
+
@import '../../../styles/settings/radiuses';
|
|
3
|
+
|
|
4
|
+
.ds-shadow {
|
|
5
|
+
background-color: var(--color-default-background);
|
|
6
|
+
border-radius: $radius-m;
|
|
7
|
+
height: 80px;
|
|
8
|
+
width: 240px;
|
|
9
|
+
|
|
10
|
+
&.-ds-shadowS {
|
|
11
|
+
box-shadow: $shadow-s;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&.-ds-shadowM {
|
|
15
|
+
box-shadow: $shadow-m;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.-ds-shadowL {
|
|
19
|
+
box-shadow: $shadow-l;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.-ds-shadowXl {
|
|
23
|
+
box-shadow: $shadow-xl;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.-ds-shadowInsetS {
|
|
27
|
+
box-shadow: $shadow-inset-s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.-ds-shadowInsetM {
|
|
31
|
+
box-shadow: $shadow-inset-m;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
import './Shadows.stories.scss';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'foundations/Shadows',
|
|
6
|
+
} as Meta;
|
|
7
|
+
|
|
8
|
+
// Names mirror lib/styles/settings/_shadows.scss; the shadows themselves are
|
|
9
|
+
// applied from that source via the `.ds-shadow` classes in Shadows.stories.scss.
|
|
10
|
+
const shadows = [
|
|
11
|
+
{ name: 'shadow-s', modifier: '-ds-shadowS' },
|
|
12
|
+
{ name: 'shadow-m', modifier: '-ds-shadowM' },
|
|
13
|
+
{ name: 'shadow-l', modifier: '-ds-shadowL' },
|
|
14
|
+
{ name: 'shadow-xl', modifier: '-ds-shadowXl' },
|
|
15
|
+
{ name: 'shadow-inset-s', modifier: '-ds-shadowInsetS' },
|
|
16
|
+
{ name: 'shadow-inset-m', modifier: '-ds-shadowInsetM' },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const StoryTemplate: StoryFn = () => ({
|
|
20
|
+
setup() {
|
|
21
|
+
return {
|
|
22
|
+
shadows,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<div style="padding: 24px;">
|
|
27
|
+
<div v-for="shadow in shadows" style="margin-bottom: 48px;">
|
|
28
|
+
<code>
|
|
29
|
+
\${{ shadow.name }}
|
|
30
|
+
</code>
|
|
31
|
+
<div :class="['ds-shadow', shadow.modifier]" style="margin-top: 12px;"></div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
`,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const Static = StoryTemplate.bind({});
|
package/package.json
CHANGED