@scania/tegel 0.0.1-beta.1 → 0.0.1-beta.11
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sdds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +1 -1
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js +2 -2
- package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +1 -1
- package/dist/cjs/sdds-modal.cjs.entry.js +3 -3
- package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sdds-popover-canvas.cjs.entry.js +1 -1
- package/dist/cjs/sdds-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/sdds-slider.cjs.entry.js +1 -1
- package/dist/cjs/sdds-textarea.cjs.entry.js +1 -1
- package/dist/cjs/sdds-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/accordion/accordion.css +0 -14
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +1 -1
- package/dist/collection/components/dropdown/dropdown.css +2 -2
- package/dist/collection/components/dropdown/dropdown.js +1 -1
- package/dist/collection/components/modal/modal.css +7 -8
- package/dist/collection/components/modal/modal.js +3 -3
- package/dist/collection/components/popover-canvas/popover-canvas.css +1 -2
- package/dist/collection/components/popover-menu/popover-menu.css +1 -1
- package/dist/collection/components/slider/slider.css +0 -1
- package/dist/collection/components/spinner/spinner.js +2 -2
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +1 -1
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +1 -1
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/components/dropdown-option.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/sdds-accordion.js +1 -1
- package/dist/components/sdds-dropdown-filter.js +1 -1
- package/dist/components/sdds-inline-tabs-fullbleed.js +1 -1
- package/dist/components/sdds-modal.js +3 -3
- package/dist/components/sdds-navigation-tabs.js +1 -1
- package/dist/components/sdds-popover-canvas.js +1 -1
- package/dist/components/sdds-popover-menu.js +1 -1
- package/dist/components/sdds-slider.js +1 -1
- package/dist/components/sdds-textarea.js +1 -1
- package/dist/components/sdds-tooltip.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sdds-accordion.entry.js +1 -1
- package/dist/esm/sdds-dropdown-filter.entry.js +1 -1
- package/dist/esm/sdds-dropdown_2.entry.js +2 -2
- package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +1 -1
- package/dist/esm/sdds-modal.entry.js +3 -3
- package/dist/esm/sdds-navigation-tabs.entry.js +1 -1
- package/dist/esm/sdds-popover-canvas.entry.js +1 -1
- package/dist/esm/sdds-popover-menu.entry.js +1 -1
- package/dist/esm/sdds-slider.entry.js +1 -1
- package/dist/esm/sdds-textarea.entry.js +1 -1
- package/dist/esm/sdds-tooltip.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/{p-677baf7f.entry.js → p-0fc35c8c.entry.js} +1 -1
- package/dist/tegel/p-21dbda3f.entry.js +1 -0
- package/dist/tegel/{p-f2f7aa45.entry.js → p-28116fd7.entry.js} +1 -1
- package/dist/tegel/{p-4cb85347.entry.js → p-3c2de07c.entry.js} +1 -1
- package/dist/tegel/{p-7451779b.entry.js → p-46140930.entry.js} +1 -1
- package/dist/tegel/p-59e49a1c.entry.js +1 -0
- package/dist/tegel/{p-d91caec6.entry.js → p-6df7e735.entry.js} +1 -1
- package/dist/tegel/p-a468986d.entry.js +1 -0
- package/dist/tegel/{p-12ca5cfa.entry.js → p-b57a7d4f.entry.js} +1 -1
- package/dist/tegel/{p-4b58a02c.entry.js → p-df98e6db.entry.js} +1 -1
- package/dist/tegel/{p-cf72dfd9.entry.js → p-ee84d4a0.entry.js} +1 -1
- package/dist/tegel/tegel.css +2 -2
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +1 -1
- package/dist/types/components/modal/modal.d.ts +1 -1
- package/dist/types/components/spinner/spinner.d.ts +2 -2
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components.d.ts +12 -12
- package/package.json +4 -4
- package/readme.md +136 -2
- package/dist/collection/components/accordion/accordion.stories.js +0 -91
- package/dist/collection/components/badge/badge.stories.js +0 -101
- package/dist/collection/components/banner/banner.stories.js +0 -93
- package/dist/collection/components/block/block.stories.js +0 -46
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +0 -26
- package/dist/collection/components/button/button-native.stories.js +0 -183
- package/dist/collection/components/button/button-webcomponent.stories.js +0 -182
- package/dist/collection/components/card/card.stories.js +0 -181
- package/dist/collection/components/checkbox/checkbox.stories.js +0 -54
- package/dist/collection/components/chips/chips.stories.js +0 -124
- package/dist/collection/components/data-table/native-table.stories.js +0 -182
- package/dist/collection/components/data-table/table-component-basic.stories.js +0 -163
- package/dist/collection/components/data-table/table-component-batch-actions.stories.js +0 -129
- package/dist/collection/components/data-table/table-component-bodydata.stories.js +0 -58
- package/dist/collection/components/data-table/table-component-custom-width.stories.js +0 -198
- package/dist/collection/components/data-table/table-component-event-listeners.stories.js +0 -153
- package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +0 -137
- package/dist/collection/components/data-table/table-component-filtering.stories.js +0 -139
- package/dist/collection/components/data-table/table-component-multiselect.stories.js +0 -160
- package/dist/collection/components/data-table/table-component-pagination.stories.js +0 -129
- package/dist/collection/components/data-table/table-component-sorting.stories.js +0 -107
- package/dist/collection/components/datetime/datetime.stories.js +0 -149
- package/dist/collection/components/divider/divider.stories.js +0 -116
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +0 -130
- package/dist/collection/components/dropdown/dropdown-native.stories.js +0 -90
- package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +0 -151
- package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +0 -146
- package/dist/collection/components/footer/footer.stories.js +0 -100
- package/dist/collection/components/header/header-all.stories.js +0 -217
- package/dist/collection/components/header/header-default.stories.js +0 -47
- package/dist/collection/components/header/header-inline.stories.js +0 -113
- package/dist/collection/components/header/header-search.stories.js +0 -263
- package/dist/collection/components/header/header-toolbar.stories.js +0 -204
- package/dist/collection/components/icon/icon-font.stories.js +0 -57
- package/dist/collection/components/icon/icon-web-component.stories.js +0 -51
- package/dist/collection/components/link/link.stories.js +0 -45
- package/dist/collection/components/message/message.stories.js +0 -117
- package/dist/collection/components/modal/modal-native.stories.js +0 -121
- package/dist/collection/components/modal/modal-webcomponent.stories.js +0 -78
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -87
- package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +0 -132
- package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -109
- package/dist/collection/components/radio-button/radio-button.stories.js +0 -68
- package/dist/collection/components/side-menu/side-menu.stories.js +0 -182
- package/dist/collection/components/slider/slider.stories.js +0 -251
- package/dist/collection/components/spinner/spinner.stories.js +0 -59
- package/dist/collection/components/stepper/stepper.stories.js +0 -139
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +0 -65
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +0 -43
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -32
- package/dist/collection/components/textarea/textarea.stories.js +0 -149
- package/dist/collection/components/textfield/textfield.stories.js +0 -222
- package/dist/collection/components/toast/toast.stories.js +0 -119
- package/dist/collection/components/toggle/toggle.stories.js +0 -62
- package/dist/collection/components/tooltip/tooltip.stories.js +0 -113
- package/dist/collection/components/utility/colour/background-color.stories.js +0 -96
- package/dist/collection/components/utility/colour/text-color.stories.js +0 -94
- package/dist/collection/foundations-stories/colour/colour-brand.stories.js +0 -38
- package/dist/collection/foundations-stories/colour/colour-scales.stories.js +0 -71
- package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +0 -40
- package/dist/collection/foundations-stories/grid/grid.stories.js +0 -386
- package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +0 -100
- package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +0 -94
- package/dist/collection/foundations-stories/typography/typography-body.stories.js +0 -16
- package/dist/collection/foundations-stories/typography/typography-detail.stories.js +0 -17
- package/dist/collection/foundations-stories/typography/typography-headline.stories.js +0 -39
- package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +0 -12
- package/dist/tegel/p-2f376504.entry.js +0 -1
- package/dist/tegel/p-9d8caf51.entry.js +0 -1
- package/dist/tegel/p-b01cface.entry.js +0 -1
- package/dist/types/components/accordion/accordion.stories.d.ts +0 -77
- package/dist/types/components/badge/badge.stories.d.ts +0 -66
- package/dist/types/components/banner/banner.stories.d.ts +0 -68
- package/dist/types/components/block/block.stories.d.ts +0 -31
- package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +0 -12
- package/dist/types/components/button/button-native.stories.d.ts +0 -144
- package/dist/types/components/button/button-webcomponent.stories.d.ts +0 -143
- package/dist/types/components/card/card.stories.d.ts +0 -114
- package/dist/types/components/checkbox/checkbox.stories.d.ts +0 -39
- package/dist/types/components/chips/chips.stories.d.ts +0 -81
- package/dist/types/components/data-table/native-table.stories.d.ts +0 -147
- package/dist/types/components/data-table/table-component-basic.stories.d.ts +0 -100
- package/dist/types/components/data-table/table-component-batch-actions.stories.d.ts +0 -98
- package/dist/types/components/data-table/table-component-bodydata.stories.d.ts +0 -38
- package/dist/types/components/data-table/table-component-custom-width.stories.d.ts +0 -147
- package/dist/types/components/data-table/table-component-event-listeners.stories.d.ts +0 -87
- package/dist/types/components/data-table/table-component-expandable-rows.stories.d.ts +0 -87
- package/dist/types/components/data-table/table-component-filtering.stories.d.ts +0 -100
- package/dist/types/components/data-table/table-component-multiselect.stories.d.ts +0 -100
- package/dist/types/components/data-table/table-component-pagination.stories.d.ts +0 -100
- package/dist/types/components/data-table/table-component-sorting.stories.d.ts +0 -79
- package/dist/types/components/datetime/datetime.stories.d.ts +0 -80
- package/dist/types/components/divider/divider.stories.d.ts +0 -72
- package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.stories.d.ts +0 -73
- package/dist/types/components/dropdown/dropdown-native.stories.d.ts +0 -57
- package/dist/types/components/dropdown/dropdown-wc-default.stories.d.ts +0 -115
- package/dist/types/components/dropdown/dropdown-wc-multiselect.stories.d.ts +0 -115
- package/dist/types/components/footer/footer.stories.d.ts +0 -23
- package/dist/types/components/header/header-all.stories.d.ts +0 -29
- package/dist/types/components/header/header-default.stories.d.ts +0 -29
- package/dist/types/components/header/header-inline.stories.d.ts +0 -29
- package/dist/types/components/header/header-search.stories.d.ts +0 -29
- package/dist/types/components/header/header-toolbar.stories.d.ts +0 -29
- package/dist/types/components/icon/icon-font.stories.d.ts +0 -38
- package/dist/types/components/icon/icon-web-component.stories.d.ts +0 -38
- package/dist/types/components/link/link.stories.d.ts +0 -33
- package/dist/types/components/message/message.stories.d.ts +0 -67
- package/dist/types/components/modal/modal-native.stories.d.ts +0 -51
- package/dist/types/components/modal/modal-webcomponent.stories.d.ts +0 -44
- package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +0 -25
- package/dist/types/components/popover-menu/popover-menu-icons.stories.d.ts +0 -27
- package/dist/types/components/popover-menu/popover-menu.stories.d.ts +0 -27
- package/dist/types/components/radio-button/radio-button.stories.d.ts +0 -41
- package/dist/types/components/side-menu/side-menu.stories.d.ts +0 -42
- package/dist/types/components/slider/slider.stories.d.ts +0 -156
- package/dist/types/components/spinner/spinner.stories.d.ts +0 -37
- package/dist/types/components/stepper/stepper.stories.d.ts +0 -56
- package/dist/types/components/tabs/inline-tabs-default/inline-tabs.stories.d.ts +0 -41
- package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.d.ts +0 -25
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +0 -13
- package/dist/types/components/textarea/textarea.stories.d.ts +0 -111
- package/dist/types/components/textfield/textfield.stories.d.ts +0 -176
- package/dist/types/components/toast/toast.stories.d.ts +0 -58
- package/dist/types/components/toggle/toggle.stories.d.ts +0 -42
- package/dist/types/components/tooltip/tooltip.stories.d.ts +0 -54
- package/dist/types/components/utility/colour/background-color.stories.d.ts +0 -58
- package/dist/types/components/utility/colour/text-color.stories.d.ts +0 -58
- package/dist/types/foundations-stories/colour/colour-brand.stories.d.ts +0 -13
- package/dist/types/foundations-stories/colour/colour-scales.stories.d.ts +0 -13
- package/dist/types/foundations-stories/colour/colour-semantic.stories.d.ts +0 -13
- package/dist/types/foundations-stories/grid/grid.stories.d.ts +0 -35
- package/dist/types/foundations-stories/spacing/spacing-element.stories.d.ts +0 -8
- package/dist/types/foundations-stories/spacing/spacing-layout.stories.d.ts +0 -8
- package/dist/types/foundations-stories/typography/typography-body.stories.d.ts +0 -8
- package/dist/types/foundations-stories/typography/typography-detail.stories.d.ts +0 -8
- package/dist/types/foundations-stories/typography/typography-headline.stories.d.ts +0 -21
- package/dist/types/foundations-stories/typography/typography-paragraph.stories.d.ts +0 -8
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Dropdown Filter',
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: 'centered',
|
|
7
|
-
notes: readme,
|
|
8
|
-
design: [
|
|
9
|
-
{
|
|
10
|
-
name: 'Figma',
|
|
11
|
-
type: 'figma',
|
|
12
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Link',
|
|
16
|
-
type: 'link',
|
|
17
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
size: {
|
|
23
|
-
name: 'Size',
|
|
24
|
-
control: {
|
|
25
|
-
type: 'radio',
|
|
26
|
-
},
|
|
27
|
-
options: ['Large', 'Medium', 'Small'],
|
|
28
|
-
description: 'Size of the dropdown',
|
|
29
|
-
},
|
|
30
|
-
placeholder: {
|
|
31
|
-
name: 'Placeholder',
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Placeholder text when no option is selected',
|
|
34
|
-
},
|
|
35
|
-
disabled: {
|
|
36
|
-
name: 'Disabled',
|
|
37
|
-
description: 'Disables the component',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'boolean',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
helper: {
|
|
43
|
-
name: 'Helper text',
|
|
44
|
-
control: {
|
|
45
|
-
type: 'text',
|
|
46
|
-
},
|
|
47
|
-
description: 'Helper text assists the user with additional information about the dropdown',
|
|
48
|
-
},
|
|
49
|
-
defaultOption: {
|
|
50
|
-
description: 'Sets a pre-selected option and replaces placeholder',
|
|
51
|
-
name: 'Default option',
|
|
52
|
-
control: {
|
|
53
|
-
type: 'radio',
|
|
54
|
-
},
|
|
55
|
-
options: ['No default', 'Option 1', 'Option 2', 'Option 3'],
|
|
56
|
-
},
|
|
57
|
-
openDirection: {
|
|
58
|
-
name: 'Open direction',
|
|
59
|
-
description: 'The direction the dropdown will open.',
|
|
60
|
-
control: {
|
|
61
|
-
type: 'radio',
|
|
62
|
-
},
|
|
63
|
-
options: ['Up', 'Down', 'Auto'],
|
|
64
|
-
table: {
|
|
65
|
-
summary: {
|
|
66
|
-
defaultValue: 'auto',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
args: {
|
|
72
|
-
size: 'Large',
|
|
73
|
-
placeholder: 'Placeholder',
|
|
74
|
-
disabled: false,
|
|
75
|
-
helper: '',
|
|
76
|
-
defaultOption: 'Option 1',
|
|
77
|
-
state: 'Default',
|
|
78
|
-
openDirection: 'Auto',
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
const FilterTemplate = ({ size, disabled = false, helper = '', label, state = 'default', placeholder, labelPosition, defaultOption, openDirection, }) => {
|
|
82
|
-
const stateValue = state === 'Error' ? 'error' : 'default';
|
|
83
|
-
const sizeLookup = { Large: 'lg', Medium: 'md', Small: 'sm' };
|
|
84
|
-
const labelPosLookup = { None: 'no-default', Outside: 'outside' };
|
|
85
|
-
const defaultOptionLookup = {
|
|
86
|
-
'No default': 'no-default',
|
|
87
|
-
'Option 1': 'option-1',
|
|
88
|
-
'Option 2': 'option-2',
|
|
89
|
-
'Option 3': 'option-3',
|
|
90
|
-
};
|
|
91
|
-
return formatHtmlPreview(`
|
|
92
|
-
<style>
|
|
93
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
94
|
-
.demo-wrapper {
|
|
95
|
-
width: 300px;
|
|
96
|
-
height:200px;
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
99
|
-
|
|
100
|
-
<div class="demo-wrapper">
|
|
101
|
-
<sdds-dropdown-filter
|
|
102
|
-
id="sdds-dropdown-filter"
|
|
103
|
-
size="${sizeLookup[size]}"
|
|
104
|
-
placeholder="${placeholder}"
|
|
105
|
-
disabled="${disabled}"
|
|
106
|
-
open-direction="${openDirection.toLowerCase()}"
|
|
107
|
-
label-position="${labelPosLookup[labelPosition]}"
|
|
108
|
-
${labelPosLookup[labelPosition] !== 'no-default' ? `label="${label}"` : ''}
|
|
109
|
-
${helper !== '' ? `helper="${helper}"` : ''}
|
|
110
|
-
state="${stateValue}"
|
|
111
|
-
data='[
|
|
112
|
-
{
|
|
113
|
-
"value": "option-1",
|
|
114
|
-
"label":"Jakarta"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"value":"option-2"
|
|
118
|
-
,"label":"Stockholm"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"value":"option-3",
|
|
122
|
-
"label":"Barcelona"
|
|
123
|
-
}
|
|
124
|
-
]'
|
|
125
|
-
default-option="${defaultOptionLookup[defaultOption]}">
|
|
126
|
-
</sdds-dropdown-filter>
|
|
127
|
-
</div>
|
|
128
|
-
`);
|
|
129
|
-
};
|
|
130
|
-
export const Default = FilterTemplate.bind({});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Components/Dropdown',
|
|
4
|
-
parameters: {
|
|
5
|
-
layout: 'centered',
|
|
6
|
-
design: [
|
|
7
|
-
{
|
|
8
|
-
name: 'Figma',
|
|
9
|
-
type: 'figma',
|
|
10
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'Link',
|
|
14
|
-
type: 'link',
|
|
15
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
label: {
|
|
21
|
-
name: 'Label',
|
|
22
|
-
type: 'string',
|
|
23
|
-
description: 'Label text helps to describe what the dropdown contains',
|
|
24
|
-
},
|
|
25
|
-
size: {
|
|
26
|
-
name: 'Size',
|
|
27
|
-
description: 'Size of the dropdown',
|
|
28
|
-
control: {
|
|
29
|
-
type: 'radio',
|
|
30
|
-
},
|
|
31
|
-
options: ['Large', 'Medium', 'Small'],
|
|
32
|
-
},
|
|
33
|
-
disabled: {
|
|
34
|
-
name: 'Disabled',
|
|
35
|
-
description: 'Disables the component',
|
|
36
|
-
control: {
|
|
37
|
-
type: 'boolean',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
state: {
|
|
41
|
-
name: 'State',
|
|
42
|
-
control: {
|
|
43
|
-
type: 'radio',
|
|
44
|
-
},
|
|
45
|
-
options: ['Default', 'Error'],
|
|
46
|
-
description: 'Support error state',
|
|
47
|
-
},
|
|
48
|
-
helper: {
|
|
49
|
-
name: 'Helper text',
|
|
50
|
-
control: {
|
|
51
|
-
type: 'text',
|
|
52
|
-
},
|
|
53
|
-
description: 'Helper text assists the user with additional information about the dropdown',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
args: {
|
|
57
|
-
label: '',
|
|
58
|
-
size: 'Large',
|
|
59
|
-
disabled: false,
|
|
60
|
-
state: 'Default',
|
|
61
|
-
helper: '',
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
const NativeTemplate = ({ disabled, size, helper, label, state }) => {
|
|
65
|
-
const sizeLookup = { Large: 'lg', Medium: 'md', Small: 'sm' };
|
|
66
|
-
return formatHtmlPreview(`
|
|
67
|
-
<style>
|
|
68
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
69
|
-
.demo-wrapper {
|
|
70
|
-
width: 300px;
|
|
71
|
-
}
|
|
72
|
-
</style>
|
|
73
|
-
|
|
74
|
-
<div class="demo-wrapper">
|
|
75
|
-
<div class="sdds-dropdown ${size !== 'Large' ? `sdds-dropdown-${sizeLookup[size]}` : ''} ${state === 'Error' ? 'sdds-dropdown--error' : ''}" >
|
|
76
|
-
${label !== '' ? `<span class="sdds-dropdown-label-outside">${label}</span> ` : ''}
|
|
77
|
-
<select
|
|
78
|
-
name="nativeDropdown"
|
|
79
|
-
id="mySelect"
|
|
80
|
-
${disabled ? `disabled` : ''} >
|
|
81
|
-
<option value="truck">Truck</option>
|
|
82
|
-
<option value="bus">Bus</option>
|
|
83
|
-
<option value="car">Car</option>
|
|
84
|
-
</select>
|
|
85
|
-
${helper !== '' ? `<span class="sdds-dropdown-helper">${helper}</span>` : ''}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
`);
|
|
89
|
-
};
|
|
90
|
-
export const Native = NativeTemplate.bind({});
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import readme from './readme.md';
|
|
2
|
-
import readmeOption from './dropdown-option/readme.md';
|
|
3
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Components/Dropdown',
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: 'centered',
|
|
8
|
-
notes: { 'Dropdown': readme, 'Dropdown option': readmeOption },
|
|
9
|
-
design: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Figma',
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Link',
|
|
17
|
-
type: 'link',
|
|
18
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
size: {
|
|
24
|
-
name: 'Size',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'radio',
|
|
27
|
-
},
|
|
28
|
-
options: ['Large', 'Medium', 'Small'],
|
|
29
|
-
description: 'Size of the dropdown',
|
|
30
|
-
},
|
|
31
|
-
placeholder: {
|
|
32
|
-
name: 'Placeholder',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Placeholder text when no option is selected',
|
|
35
|
-
},
|
|
36
|
-
labelPosition: {
|
|
37
|
-
name: 'Label position',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'radio',
|
|
40
|
-
},
|
|
41
|
-
options: ['None', 'Inside', 'Outside'],
|
|
42
|
-
description: 'Label text position',
|
|
43
|
-
},
|
|
44
|
-
labelText: {
|
|
45
|
-
name: 'Label text',
|
|
46
|
-
control: 'text',
|
|
47
|
-
description: 'Label text helps to describe what the dropdown contains',
|
|
48
|
-
if: { arg: 'labelPosition', neq: 'None' },
|
|
49
|
-
},
|
|
50
|
-
disabled: {
|
|
51
|
-
name: 'Disabled',
|
|
52
|
-
description: 'Disables the component',
|
|
53
|
-
control: {
|
|
54
|
-
type: 'boolean',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
state: {
|
|
58
|
-
name: 'State',
|
|
59
|
-
control: {
|
|
60
|
-
type: 'radio',
|
|
61
|
-
},
|
|
62
|
-
options: ['Default', 'Error'],
|
|
63
|
-
description: 'Support error state',
|
|
64
|
-
},
|
|
65
|
-
helper: {
|
|
66
|
-
name: 'Add helper text',
|
|
67
|
-
control: 'boolean',
|
|
68
|
-
description: 'Adds a helper text.',
|
|
69
|
-
},
|
|
70
|
-
helperText: {
|
|
71
|
-
name: 'Helper text',
|
|
72
|
-
description: 'Helper text assists the user with additional information about the dropdown',
|
|
73
|
-
control: 'text',
|
|
74
|
-
if: { arg: 'helper', eq: true },
|
|
75
|
-
},
|
|
76
|
-
defaultOption: {
|
|
77
|
-
if: { arg: 'type', neq: 'Multiselect' },
|
|
78
|
-
name: 'Default option',
|
|
79
|
-
description: 'Sets a pre-selected option and replaces placeholder',
|
|
80
|
-
control: {
|
|
81
|
-
type: 'radio',
|
|
82
|
-
},
|
|
83
|
-
options: ['No default', 'Option 1', 'Option 2', 'Option 3'],
|
|
84
|
-
},
|
|
85
|
-
openDirection: {
|
|
86
|
-
name: 'Open direction',
|
|
87
|
-
description: 'The direction the dropdown will open.',
|
|
88
|
-
control: {
|
|
89
|
-
type: 'radio',
|
|
90
|
-
},
|
|
91
|
-
options: ['Up', 'Down', 'Auto'],
|
|
92
|
-
table: {
|
|
93
|
-
summary: {
|
|
94
|
-
defaultValue: 'auto',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
args: {
|
|
100
|
-
size: 'Large',
|
|
101
|
-
placeholder: 'Placeholder',
|
|
102
|
-
state: 'Default',
|
|
103
|
-
disabled: false,
|
|
104
|
-
labelPosition: 'None',
|
|
105
|
-
labelText: 'Label text',
|
|
106
|
-
helper: false,
|
|
107
|
-
helperText: 'Helper text',
|
|
108
|
-
defaultOption: 'Option 1',
|
|
109
|
-
openDirection: 'Auto',
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
const Template = ({ size, disabled = false, labelPosition, helper, helperText, labelText, state = 'default', placeholder, defaultOption, openDirection, }) => {
|
|
113
|
-
const stateValue = state === 'Error' ? 'error' : 'default';
|
|
114
|
-
const sizeLookup = { Large: 'lg', Medium: 'md', Small: 'sm' };
|
|
115
|
-
const labelPosLookup = { None: 'no-default', Inside: 'inside', Outside: 'outside' };
|
|
116
|
-
const defaultOptionLookup = {
|
|
117
|
-
'No default': 'no-default',
|
|
118
|
-
'Option 1': 'option-1',
|
|
119
|
-
'Option 2': 'option-2',
|
|
120
|
-
'Option 3': 'option-3',
|
|
121
|
-
};
|
|
122
|
-
return formatHtmlPreview(`
|
|
123
|
-
<style>
|
|
124
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
125
|
-
.demo-wrapper {
|
|
126
|
-
width: 300px;
|
|
127
|
-
height:200px;
|
|
128
|
-
}
|
|
129
|
-
</style>
|
|
130
|
-
|
|
131
|
-
<div class="demo-wrapper">
|
|
132
|
-
<sdds-dropdown
|
|
133
|
-
id="sdds-dropdown-reg"
|
|
134
|
-
size="${sizeLookup[size]}"
|
|
135
|
-
placeholder="${placeholder}"
|
|
136
|
-
disabled="${disabled}"
|
|
137
|
-
open-direction="${openDirection.toLowerCase()}"
|
|
138
|
-
label-position="${labelPosLookup[labelPosition]}"
|
|
139
|
-
${labelPosLookup[labelPosition] !== 'no-default' ? `label="${labelText}"` : ''}
|
|
140
|
-
${helper ? `helper="${helperText}"` : ''}
|
|
141
|
-
state="${stateValue}"
|
|
142
|
-
type="default"
|
|
143
|
-
default-option="${defaultOptionLookup[defaultOption]}" >
|
|
144
|
-
<sdds-dropdown-option value="option-1" tabindex="0" disabled>Option 1</sdds-dropdown-option>
|
|
145
|
-
<sdds-dropdown-option value="option-2" tabindex="0">Option 2</sdds-dropdown-option>
|
|
146
|
-
<sdds-dropdown-option value="option-3" tabindex="0">Option 3</sdds-dropdown-option>
|
|
147
|
-
</sdds-dropdown>
|
|
148
|
-
</div>
|
|
149
|
-
`);
|
|
150
|
-
};
|
|
151
|
-
export const WebComponentDefault = Template.bind({});
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import readme from './readme.md';
|
|
2
|
-
import readmeOption from './dropdown-option/readme.md';
|
|
3
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Components/Dropdown',
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: 'centered',
|
|
8
|
-
notes: { 'Dropdown': readme, 'Dropdown option': readmeOption },
|
|
9
|
-
design: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Figma',
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Link',
|
|
17
|
-
type: 'link',
|
|
18
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
size: {
|
|
24
|
-
name: 'Size',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'radio',
|
|
27
|
-
},
|
|
28
|
-
options: ['Large', 'Medium', 'Small'],
|
|
29
|
-
description: 'Size of the dropdown',
|
|
30
|
-
},
|
|
31
|
-
placeholder: {
|
|
32
|
-
name: 'Placeholder',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Placeholder text when no option is selected',
|
|
35
|
-
},
|
|
36
|
-
labelPosition: {
|
|
37
|
-
name: 'Label position',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'radio',
|
|
40
|
-
},
|
|
41
|
-
options: ['None', 'Inside', 'Outside'],
|
|
42
|
-
description: 'Label text position',
|
|
43
|
-
},
|
|
44
|
-
labelText: {
|
|
45
|
-
name: 'Label text',
|
|
46
|
-
control: 'text',
|
|
47
|
-
description: 'Label text helps to describe what the dropdown contains',
|
|
48
|
-
if: { arg: 'labelPosition', neq: 'None' },
|
|
49
|
-
},
|
|
50
|
-
disabled: {
|
|
51
|
-
name: 'Disabled',
|
|
52
|
-
description: 'Disables the component',
|
|
53
|
-
control: {
|
|
54
|
-
type: 'boolean',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
state: {
|
|
58
|
-
name: 'State',
|
|
59
|
-
control: {
|
|
60
|
-
type: 'radio',
|
|
61
|
-
},
|
|
62
|
-
options: ['Default', 'Error'],
|
|
63
|
-
description: 'Support error state',
|
|
64
|
-
},
|
|
65
|
-
helper: {
|
|
66
|
-
name: 'Add helper text',
|
|
67
|
-
control: 'boolean',
|
|
68
|
-
description: 'Adds a helper text.',
|
|
69
|
-
},
|
|
70
|
-
helperText: {
|
|
71
|
-
name: 'Helper text',
|
|
72
|
-
description: 'Helper text assists the user with additional information about the dropdown',
|
|
73
|
-
control: 'text',
|
|
74
|
-
if: { arg: 'helper', eq: true },
|
|
75
|
-
},
|
|
76
|
-
multiDefaultOption: {
|
|
77
|
-
name: 'Default options',
|
|
78
|
-
description: 'Sets a pre-selected option and replaces placeholder',
|
|
79
|
-
if: { arg: 'type', neq: 'Default' },
|
|
80
|
-
control: {
|
|
81
|
-
type: 'check',
|
|
82
|
-
},
|
|
83
|
-
options: ['Option 1', 'Option 2', 'Option 3'],
|
|
84
|
-
},
|
|
85
|
-
openDirection: {
|
|
86
|
-
name: 'Open direction',
|
|
87
|
-
description: 'The direction the dropdown will open.',
|
|
88
|
-
control: {
|
|
89
|
-
type: 'radio',
|
|
90
|
-
},
|
|
91
|
-
options: ['Up', 'Down', 'Auto'],
|
|
92
|
-
table: {
|
|
93
|
-
summary: {
|
|
94
|
-
defaultValue: 'auto',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
args: {
|
|
100
|
-
size: 'Large',
|
|
101
|
-
placeholder: 'Placeholder',
|
|
102
|
-
state: 'Default',
|
|
103
|
-
disabled: false,
|
|
104
|
-
labelPosition: 'None',
|
|
105
|
-
labelText: 'Label text',
|
|
106
|
-
helper: false,
|
|
107
|
-
helperText: 'Helper text',
|
|
108
|
-
multiDefaultOption: ['Option 1', 'Option 2'],
|
|
109
|
-
openDirection: 'Auto',
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
const Template = ({ size, disabled = false, labelPosition, labelText, helper, helperText, state = 'default', placeholder, multiDefaultOption, openDirection, }) => {
|
|
113
|
-
const stateValue = state === 'Error' ? 'error' : 'default';
|
|
114
|
-
const sizeLookup = { Large: 'lg', Medium: 'md', Small: 'sm' };
|
|
115
|
-
const labelPosLookup = { None: 'no-default', Inside: 'inside', Outside: 'outside' };
|
|
116
|
-
const multiDefaultOptionValue = multiDefaultOption.map((value) => value.toLowerCase().replace(' ', '-'));
|
|
117
|
-
return formatHtmlPreview(`
|
|
118
|
-
<style>
|
|
119
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
120
|
-
.demo-wrapper {
|
|
121
|
-
width: 300px;
|
|
122
|
-
height:200px;
|
|
123
|
-
}
|
|
124
|
-
</style>
|
|
125
|
-
|
|
126
|
-
<div class="demo-wrapper">
|
|
127
|
-
<sdds-dropdown
|
|
128
|
-
id="sdds-dropdown-reg"
|
|
129
|
-
size="${sizeLookup[size]}"
|
|
130
|
-
placeholder="${placeholder}"
|
|
131
|
-
disabled="${disabled}"
|
|
132
|
-
open-direction="${openDirection.toLowerCase()}"
|
|
133
|
-
label-position="${labelPosLookup[labelPosition]}"
|
|
134
|
-
${labelPosLookup[labelPosition] !== 'no-default' ? `label="${labelText}"` : ''}
|
|
135
|
-
${helper ? `helper="${helperText}"` : ''}
|
|
136
|
-
state="${stateValue}"
|
|
137
|
-
type="multiselect"
|
|
138
|
-
default-option="${multiDefaultOptionValue}" >
|
|
139
|
-
<sdds-dropdown-option value="option-1" tabindex="0">Option 1</sdds-dropdown-option>
|
|
140
|
-
<sdds-dropdown-option value="option-2" tabindex="0" disabled>Option 2</sdds-dropdown-option>
|
|
141
|
-
<sdds-dropdown-option value="option-3" tabindex="0">Option 3</sdds-dropdown-option>
|
|
142
|
-
</sdds-dropdown>
|
|
143
|
-
</div>
|
|
144
|
-
`);
|
|
145
|
-
};
|
|
146
|
-
export const WebComponentMultiselect = Template.bind({});
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import readme from './readme.md';
|
|
2
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Footer',
|
|
5
|
-
parameters: {
|
|
6
|
-
notes: readme,
|
|
7
|
-
layout: 'fullscreen',
|
|
8
|
-
design: [
|
|
9
|
-
{
|
|
10
|
-
name: 'Figma',
|
|
11
|
-
type: 'figma',
|
|
12
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7568%3A298118&t=Ne6myqwca5m00de7-1',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Link',
|
|
16
|
-
type: 'link',
|
|
17
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7568%3A298118&t=Ne6myqwca5m00de7-1',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
topPart: {
|
|
23
|
-
name: 'Top part',
|
|
24
|
-
description: 'Adds top part of the footer with more links',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
const Template = ({ topPart }) => formatHtmlPreview(`
|
|
32
|
-
<style>
|
|
33
|
-
.demo-wrapper {
|
|
34
|
-
padding: 0;
|
|
35
|
-
margin: 0;
|
|
36
|
-
font-size: 14px;
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
39
|
-
|
|
40
|
-
<div class="demo-wrapper">
|
|
41
|
-
<div class="sdds-footer">
|
|
42
|
-
${topPart
|
|
43
|
-
? `
|
|
44
|
-
<div class="sdds-footer-top sdds-container-fluid">
|
|
45
|
-
<div class="sdds-row">
|
|
46
|
-
<div class="sdds-footer-top-col sdds-col-max sdds-col-xxlg sdds-col-xlg sdds-col-lg sdds-col-md-12 sdds-col-sm-12 sdds-col-xs-12">
|
|
47
|
-
<div class="sdds-footer-title opened">
|
|
48
|
-
<span>Title 1</span>
|
|
49
|
-
<span class="sdds-footer-top-icon">
|
|
50
|
-
<sdds-icon name="chevron_down" size="16px"></sdds-icon>
|
|
51
|
-
</span>
|
|
52
|
-
</div>
|
|
53
|
-
<ul class="sdds-footer-main-links opened">
|
|
54
|
-
<li><a href="#">Legal link</a></li>
|
|
55
|
-
<li><a href="#">Legal link</a></li>
|
|
56
|
-
<li><a href="#">Legal link</a></li>
|
|
57
|
-
<li><a href="#">Legal link</a></li>
|
|
58
|
-
</ul>
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<div class="sdds-col-max sdds-col-xxlg sdds-col-xlg sdds-col-lg sdds-col-md-12 sdds-col-sm-12 sdds-col-xs-12">
|
|
62
|
-
<div class="sdds-footer-title">
|
|
63
|
-
<span>Title 2</span>
|
|
64
|
-
<span class="sdds-footer-top-icon">
|
|
65
|
-
<sdds-icon name="chevron_down" size="16px"></sdds-icon>
|
|
66
|
-
</span>
|
|
67
|
-
</div>
|
|
68
|
-
<ul class="sdds-footer-main-links">
|
|
69
|
-
<li><a href="#">Legal link</a></li>
|
|
70
|
-
<li><a href="#">Legal link</a></li>
|
|
71
|
-
<li><a href="#">Legal link</a></li>
|
|
72
|
-
<li><a href="#">Legal link</a></li>
|
|
73
|
-
</ul>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
`
|
|
78
|
-
: ''}
|
|
79
|
-
<div class="sdds-footer-main">
|
|
80
|
-
<ul class="sdds-footer-main-links">
|
|
81
|
-
<li><a href="#">Legal link</a></li>
|
|
82
|
-
<li><a href="#">Legal link</a></li>
|
|
83
|
-
<li><a href="#">Legal link</a></li>
|
|
84
|
-
</ul>
|
|
85
|
-
<ul class="sdds-footer-social-links">
|
|
86
|
-
<li><a href="#">Social 1</a></li>
|
|
87
|
-
<li><a href="#">Social 1</a></li>
|
|
88
|
-
<li><a href="#">Social 1</a></li>
|
|
89
|
-
</ul>
|
|
90
|
-
<div class="sdds-footer-main-brand">
|
|
91
|
-
<p>Copyright © 2022 Scania</p>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
`);
|
|
97
|
-
export const Default = Template.bind({});
|
|
98
|
-
Default.args = {
|
|
99
|
-
topPart: false,
|
|
100
|
-
};
|