@bethinkpl/design-system 40.1.0 → 41.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.
Files changed (68) hide show
  1. package/dist/design-system.css +1 -1
  2. package/dist/design-system.js +7004 -6905
  3. package/dist/design-system.js.map +1 -1
  4. package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +2 -9
  5. package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +2 -36
  6. package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +1 -1
  7. package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +2 -2
  8. package/dist/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.consts.d.ts +17 -0
  9. package/dist/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.vue.d.ts +27 -0
  10. package/dist/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.vue.d.ts +13 -0
  11. package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +6 -2
  12. package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +3 -12
  13. package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +1 -1
  14. package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +6 -2
  15. package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +6 -2
  16. package/dist/lib/js/components/Stepper/Stepper.vue.d.ts +23 -0
  17. package/dist/lib/js/components/Stepper/index.d.ts +3 -0
  18. package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +2 -36
  19. package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +2 -36
  20. package/dist/lib/js/components/TextGroup/TextGroup.vue.d.ts +0 -3
  21. package/dist/lib/js/components/Tile/Tile.vue.d.ts +1 -1
  22. package/dist/lib/js/components/Toast/Toast.vue.d.ts +2 -36
  23. package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +1 -1
  24. package/dist/lib/js/components/TopNav/TopNav/TopNav.vue.d.ts +17 -0
  25. package/dist/lib/js/components/TopNav/TopNavBranding/TopNavBranding.vue.d.ts +33 -0
  26. package/dist/lib/js/components/TopNav/topNavStoryLogo.d.ts +1 -0
  27. package/dist/lib/js/index.d.ts +6 -5
  28. package/lib/js/components/Cards/Card/Card.spec.ts +50 -0
  29. package/lib/js/components/Cards/Card/Card.stories.ts +5 -0
  30. package/lib/js/components/Cards/Card/Card.vue +14 -11
  31. package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.consts.ts +20 -0
  32. package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.spec.ts +125 -0
  33. package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.stories.ts +69 -0
  34. package/lib/js/components/LabelValue/LabelValueItem/LabelValueItem.vue +101 -0
  35. package/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.spec.ts +24 -0
  36. package/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.stories.ts +31 -0
  37. package/lib/js/components/LabelValue/LabelValueItemGroup/LabelValueItemGroup.vue +19 -0
  38. package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.stories.ts +93 -8
  39. package/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue +3 -0
  40. package/lib/js/components/RichList/RichListItem/RichListItem.stories.ts +83 -0
  41. package/lib/js/components/RichList/RichListItem/RichListItem.vue +11 -4
  42. package/lib/js/components/SelectList/SelectListItem/SelectListItem.stories.ts +7 -0
  43. package/lib/js/components/SelectList/SelectListItem/SelectListItem.vue +9 -3
  44. package/lib/js/components/Stepper/Stepper.spec.ts +99 -0
  45. package/lib/js/components/Stepper/Stepper.stories.ts +62 -0
  46. package/lib/js/components/Stepper/Stepper.vue +97 -0
  47. package/lib/js/components/Stepper/index.ts +3 -0
  48. package/lib/js/components/TextGroup/TextGroup.vue +0 -5
  49. package/lib/js/components/TopNav/TopNav/TopNav.spec.ts +56 -0
  50. package/lib/js/components/TopNav/TopNav/TopNav.stories.ts +99 -0
  51. package/lib/js/components/TopNav/TopNav/TopNav.vue +79 -0
  52. package/lib/js/components/TopNav/TopNavBranding/TopNavBranding.spec.ts +103 -0
  53. package/lib/js/components/TopNav/TopNavBranding/TopNavBranding.stories.ts +107 -0
  54. package/lib/js/components/TopNav/TopNavBranding/TopNavBranding.vue +102 -0
  55. package/lib/js/components/TopNav/topNavStoryLogo.ts +19 -0
  56. package/lib/js/index.ts +6 -5
  57. package/lib/js/styles/Radiuses/Radiuses.stories.ts +44 -0
  58. package/lib/js/styles/Shadows/Shadows.stories.scss +33 -0
  59. package/lib/js/styles/Shadows/Shadows.stories.ts +37 -0
  60. package/package.json +1 -1
  61. package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.d.ts +0 -5
  62. package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +0 -406
  63. package/dist/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue.d.ts +0 -2
  64. package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.consts.ts +0 -7
  65. package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.stories.ts +0 -44
  66. package/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue +0 -83
  67. package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.stories.ts +0 -31
  68. package/lib/js/components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue +0 -21
@@ -0,0 +1,56 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { mount } from '@vue/test-utils';
3
+ import { h } from 'vue';
4
+
5
+ import TopNav from './TopNav.vue';
6
+
7
+ describe('TopNav', () => {
8
+ it('should create', () => {
9
+ const component = mount(TopNav);
10
+
11
+ expect(component.exists()).toBe(true);
12
+ expect(component.find('.ds-topNav').exists()).toBe(true);
13
+ });
14
+
15
+ it('renders default slot content', () => {
16
+ const component = mount(TopNav, {
17
+ slots: {
18
+ default: () => h('span', { class: 'child' }, 'Default content'),
19
+ },
20
+ });
21
+
22
+ expect(component.find('.ds-topNav__default .child').text()).toBe('Default content');
23
+ });
24
+
25
+ it('renders the leading slot when provided', () => {
26
+ const component = mount(TopNav, {
27
+ slots: {
28
+ leading: () => h('span', { class: 'child' }, 'Leading content'),
29
+ },
30
+ });
31
+
32
+ expect(component.find('.ds-topNav__leading .child').text()).toBe('Leading content');
33
+ });
34
+
35
+ it('does not render the leading wrapper when the slot is not provided', () => {
36
+ const component = mount(TopNav);
37
+
38
+ expect(component.find('.ds-topNav__leading').exists()).toBe(false);
39
+ });
40
+
41
+ it('renders the trailing slot when provided', () => {
42
+ const component = mount(TopNav, {
43
+ slots: {
44
+ trailing: () => h('span', { class: 'child' }, 'Trailing content'),
45
+ },
46
+ });
47
+
48
+ expect(component.find('.ds-topNav__trailing .child').text()).toBe('Trailing content');
49
+ });
50
+
51
+ it('does not render the trailing wrapper when the slot is not provided', () => {
52
+ const component = mount(TopNav);
53
+
54
+ expect(component.find('.ds-topNav__trailing').exists()).toBe(false);
55
+ });
56
+ });
@@ -0,0 +1,99 @@
1
+ import TopNav from './TopNav.vue';
2
+
3
+ import { Meta, StoryFn } from '@storybook/vue3';
4
+ import TopNavBranding from '../TopNavBranding/TopNavBranding.vue';
5
+ import Flag from '../../Flag/Flag.vue';
6
+ import { FLAG_SIZES } from '../../Flag/Flag.consts';
7
+ import * as FLAGS from '../../Flag/flags';
8
+ import IconButton from '../../Buttons/IconButton/IconButton.vue';
9
+ import {
10
+ ICON_BUTTON_COLORS,
11
+ ICON_BUTTON_SIZES,
12
+ ICON_BUTTON_TYPES,
13
+ } from '../../Buttons/IconButton/IconButton.consts';
14
+ import { BUTTON_RADIUSES } from '../../Buttons/Button/Button.consts';
15
+ import { ICONS } from '../../Icons/Icon';
16
+ import Avatar from '../../Avatar/Avatar.vue';
17
+ import { AVATAR_SIZES } from '../../Avatar/Avatar.consts';
18
+ import SlotPlaceholder, {
19
+ SLOT_PLACEHOLDER_SIZES,
20
+ } from '../../../../../.storybook/SlotPlaceholder/SlotPlaceholder.vue';
21
+ import { TOP_NAV_STORY_LOGO } from '../topNavStoryLogo';
22
+
23
+ export default {
24
+ title: 'Components/TopNav/TopNav',
25
+ component: TopNav,
26
+ } as Meta<typeof TopNav>;
27
+
28
+ const FilledTemplate: StoryFn<typeof TopNav> = () => ({
29
+ components: { TopNav, TopNavBranding, Flag, IconButton, Avatar },
30
+ setup() {
31
+ return {
32
+ logo: TOP_NAV_STORY_LOGO,
33
+ FLAGS,
34
+ FLAG_SIZES,
35
+ ICONS,
36
+ ICON_BUTTON_COLORS,
37
+ ICON_BUTTON_SIZES,
38
+ ICON_BUTTON_TYPES,
39
+ BUTTON_RADIUSES,
40
+ AVATAR_SIZES,
41
+ };
42
+ },
43
+ template: `
44
+ <top-nav>
45
+ <template #leading>
46
+ <icon-button
47
+ :icon="ICONS.FA_BARS"
48
+ :size="ICON_BUTTON_SIZES.MEDIUM"
49
+ :type="ICON_BUTTON_TYPES.ICON_ONLY"
50
+ :color="ICON_BUTTON_COLORS.NEUTRAL"
51
+ :radius="BUTTON_RADIUSES.ROUNDED"
52
+ />
53
+ </template>
54
+ <top-nav-branding title="Bethink">
55
+ <template #logo>
56
+ <span v-html="logo" style="display: inline-flex;" />
57
+ </template>
58
+ <template #accessory>
59
+ <flag :flag="FLAGS.FLAG_POLAND" :size="FLAG_SIZES.XXS" />
60
+ </template>
61
+ </top-nav-branding>
62
+ <template #trailing>
63
+ <avatar username="Bethink User" :size="AVATAR_SIZES.X_SMALL" />
64
+ </template>
65
+ </top-nav>
66
+ `,
67
+ });
68
+
69
+ export const Filled = FilledTemplate.bind({});
70
+
71
+ const SlotPlaceholdersTemplate: StoryFn<typeof TopNav> = () => ({
72
+ components: { TopNav, SlotPlaceholder },
73
+ setup() {
74
+ return { SLOT_PLACEHOLDER_SIZES };
75
+ },
76
+ template: `
77
+ <top-nav>
78
+ <template #leading>
79
+ <slot-placeholder label="leading" :size="SLOT_PLACEHOLDER_SIZES.MEDIUM" />
80
+ </template>
81
+ <slot-placeholder label="default" :size="SLOT_PLACEHOLDER_SIZES.MEDIUM" />
82
+ <template #trailing>
83
+ <slot-placeholder label="trailing" :size="SLOT_PLACEHOLDER_SIZES.MEDIUM" />
84
+ </template>
85
+ </top-nav>
86
+ `,
87
+ });
88
+
89
+ export const SlotPlaceholders = SlotPlaceholdersTemplate.bind({});
90
+
91
+ const parameters = {
92
+ design: {
93
+ type: 'figma',
94
+ url: 'https://www.figma.com/design/xym3gXf0vBCofzksDtRDaU/INI-201-E-commerce?node-id=345-21287&m=dev',
95
+ },
96
+ };
97
+
98
+ Filled.parameters = parameters;
99
+ SlotPlaceholders.parameters = parameters;
@@ -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 DrawerListItem } from './components/Drawer/DrawerListItem/DrawerListItem.vue';
100
- export { default as DsDrawerListItem } from './components/Drawer/DrawerListItem/DrawerListItem.vue';
101
- export { default as DrawerListItemGroup } from './components/Drawer/DrawerListItemGroup/DrawerListItemGroup.vue';
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
+ }