@scania/tegel 0.0.1-beta.6 → 0.0.1-beta.7
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/tegel.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/package.json +4 -4
- 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/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,251 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Slider',
|
|
5
|
-
argTypes: {
|
|
6
|
-
initialValue: {
|
|
7
|
-
name: 'Initial value',
|
|
8
|
-
description: 'Initial value for slider',
|
|
9
|
-
control: {
|
|
10
|
-
type: 'text',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
min: {
|
|
14
|
-
name: 'Min. value',
|
|
15
|
-
description: 'Minimum value',
|
|
16
|
-
control: {
|
|
17
|
-
type: 'text',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
max: {
|
|
21
|
-
name: 'Max. value',
|
|
22
|
-
description: 'Maximum value',
|
|
23
|
-
control: {
|
|
24
|
-
type: 'text',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
showLabel: {
|
|
28
|
-
name: 'Show label',
|
|
29
|
-
description: 'Show or hide label',
|
|
30
|
-
control: {
|
|
31
|
-
type: 'boolean',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
labelText: {
|
|
35
|
-
name: 'Label text',
|
|
36
|
-
description: 'Text for label',
|
|
37
|
-
control: {
|
|
38
|
-
type: 'text',
|
|
39
|
-
},
|
|
40
|
-
if: {
|
|
41
|
-
arg: 'showLabel',
|
|
42
|
-
truthy: true,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
showTooltip: {
|
|
46
|
-
name: 'Show tooltip',
|
|
47
|
-
description: 'Show or hide tooltip',
|
|
48
|
-
control: {
|
|
49
|
-
type: 'boolean',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
showTicks: {
|
|
53
|
-
name: 'Show ticks',
|
|
54
|
-
description: 'Show or hide ticks',
|
|
55
|
-
control: {
|
|
56
|
-
type: 'boolean',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
numTicks: {
|
|
60
|
-
name: 'Number of ticks',
|
|
61
|
-
description: 'Set the number of ticks to display',
|
|
62
|
-
control: {
|
|
63
|
-
type: 'text',
|
|
64
|
-
},
|
|
65
|
-
if: {
|
|
66
|
-
arg: 'showTicks',
|
|
67
|
-
truthy: true,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
snapToTicks: {
|
|
71
|
-
name: 'Snap to ticks',
|
|
72
|
-
description: 'Snap the scrubber to the closest tick when dragging',
|
|
73
|
-
control: {
|
|
74
|
-
type: 'boolean',
|
|
75
|
-
},
|
|
76
|
-
if: {
|
|
77
|
-
arg: 'showTicks',
|
|
78
|
-
truthy: true,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
showTickNumbers: {
|
|
82
|
-
name: 'Show tick numbers',
|
|
83
|
-
description: 'Show or hide tick numbers',
|
|
84
|
-
control: {
|
|
85
|
-
type: 'boolean',
|
|
86
|
-
},
|
|
87
|
-
if: {
|
|
88
|
-
arg: 'showTicks',
|
|
89
|
-
truthy: true,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
showControls: {
|
|
93
|
-
name: 'Show controls (not compatible with input field)',
|
|
94
|
-
description: 'Show or hide controls',
|
|
95
|
-
control: {
|
|
96
|
-
type: 'boolean',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
step: {
|
|
100
|
-
name: 'Step value',
|
|
101
|
-
description: 'Value to increment/decrease when using controls',
|
|
102
|
-
control: {
|
|
103
|
-
type: 'text',
|
|
104
|
-
},
|
|
105
|
-
if: {
|
|
106
|
-
arg: 'showControls',
|
|
107
|
-
truthy: true,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
showInput: {
|
|
111
|
-
name: 'Show value input field (not compatible with controls)',
|
|
112
|
-
description: 'Show or hide value input field',
|
|
113
|
-
control: {
|
|
114
|
-
type: 'boolean',
|
|
115
|
-
},
|
|
116
|
-
if: {
|
|
117
|
-
arg: 'showControls',
|
|
118
|
-
truthy: false,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
disabled: {
|
|
122
|
-
name: 'Disabled',
|
|
123
|
-
description: 'Put control in disabled state',
|
|
124
|
-
control: {
|
|
125
|
-
type: 'boolean',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
readonly: {
|
|
129
|
-
name: 'Read Only',
|
|
130
|
-
description: 'Put control in read-only state',
|
|
131
|
-
control: {
|
|
132
|
-
type: 'boolean',
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
small: {
|
|
136
|
-
name: 'Small',
|
|
137
|
-
description: 'Use small variant',
|
|
138
|
-
control: {
|
|
139
|
-
type: 'boolean',
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
parameters: {
|
|
144
|
-
notes: readme,
|
|
145
|
-
design: [
|
|
146
|
-
{
|
|
147
|
-
name: 'Figma',
|
|
148
|
-
type: 'figma',
|
|
149
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9649%3A20759&t=Ne6myqwca5m00de7-1',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name: 'Link',
|
|
153
|
-
type: 'link',
|
|
154
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9649%3A20759&t=Ne6myqwca5m00de7-1',
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
args: {
|
|
159
|
-
min: 0,
|
|
160
|
-
max: 100,
|
|
161
|
-
value: 50,
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
const style = `
|
|
165
|
-
<style>
|
|
166
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
167
|
-
.demo-wrapper {
|
|
168
|
-
width: 80%;
|
|
169
|
-
margin: 0 auto;
|
|
170
|
-
display: flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
height: 100%;
|
|
173
|
-
padding-top: 100px;
|
|
174
|
-
padding-left: 40px;
|
|
175
|
-
padding-right: 40px;
|
|
176
|
-
}
|
|
177
|
-
</style>
|
|
178
|
-
`;
|
|
179
|
-
const Template = ({ initialValue, min, max, showLabel, labelText, showTooltip, showTicks, numTicks, showTickNumbers, snapToTicks, showControls, step, showInput, disabled, readonly, small, }) => {
|
|
180
|
-
return formatHtmlPreview(`
|
|
181
|
-
${style}
|
|
182
|
-
<div class="demo-wrapper">
|
|
183
|
-
<sdds-slider id="sdds-slider"
|
|
184
|
-
min="${min}"
|
|
185
|
-
max="${max}"
|
|
186
|
-
${showControls && step ? 'step="' + step + '"' : ''}
|
|
187
|
-
value="${initialValue}"
|
|
188
|
-
${showTicks ? 'ticks="' + numTicks + '"' : ''}
|
|
189
|
-
${showTickNumbers ? 'show-tick-numbers' : ''}
|
|
190
|
-
${snapToTicks ? 'snap' : ''}
|
|
191
|
-
${showLabel ? 'label="' + labelText + '"' : ''}
|
|
192
|
-
${showTooltip ? 'tooltip' : ''}
|
|
193
|
-
${showControls ? 'controls' : ''}
|
|
194
|
-
${showInput ? 'input' : ''}
|
|
195
|
-
${disabled ? 'disabled' : ''}
|
|
196
|
-
${small ? 'size="sm"' : ''}
|
|
197
|
-
${readonly ? 'read-only' : ''}
|
|
198
|
-
>
|
|
199
|
-
|
|
200
|
-
</sdds-slider>
|
|
201
|
-
</div>
|
|
202
|
-
`);
|
|
203
|
-
};
|
|
204
|
-
let sliderStoryLoaded = false;
|
|
205
|
-
function ready(fn) {
|
|
206
|
-
if (document.readyState !== 'loading') {
|
|
207
|
-
fn();
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
document.addEventListener('DOMContentLoaded', fn);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
ready(() => {
|
|
214
|
-
if (sliderStoryLoaded) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
sliderStoryLoaded = true;
|
|
218
|
-
const slider = document.querySelector('#sdds-slider');
|
|
219
|
-
if (!slider) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
/*
|
|
223
|
-
@ATTENTION
|
|
224
|
-
Keep in mind that storybook does stuff, so if any story control is changed,
|
|
225
|
-
the page has to be reloaded for this event listener to work. Also it will only
|
|
226
|
-
work in the Canvas-tab
|
|
227
|
-
*/
|
|
228
|
-
console.log('adding slider event');
|
|
229
|
-
slider.addEventListener('sliderChange', event => {
|
|
230
|
-
console.log('Got a sliderChange event', event['detail'].value);
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
export const Default = Template.bind({});
|
|
234
|
-
Default.args = {
|
|
235
|
-
initialValue: '50',
|
|
236
|
-
showLabel: false,
|
|
237
|
-
labelText: 'Label',
|
|
238
|
-
showTooltip: true,
|
|
239
|
-
showTicks: false,
|
|
240
|
-
numTicks: '3',
|
|
241
|
-
showTickNumbers: false,
|
|
242
|
-
showControls: false,
|
|
243
|
-
showInput: false,
|
|
244
|
-
min: '0',
|
|
245
|
-
max: '100',
|
|
246
|
-
step: '1',
|
|
247
|
-
disabled: false,
|
|
248
|
-
small: false,
|
|
249
|
-
snapToTicks: false,
|
|
250
|
-
readonly: false,
|
|
251
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Spinner',
|
|
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=10259%3A29263&t=Ne6myqwca5m00de7-1',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Link',
|
|
16
|
-
type: 'link',
|
|
17
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10259%3A29263&t=Ne6myqwca5m00de7-1',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
variant: {
|
|
23
|
-
name: 'Variant',
|
|
24
|
-
control: {
|
|
25
|
-
type: 'radio',
|
|
26
|
-
},
|
|
27
|
-
options: ['Standard', 'Inverted'],
|
|
28
|
-
description: 'Variant of the spinner',
|
|
29
|
-
},
|
|
30
|
-
size: {
|
|
31
|
-
name: 'Size',
|
|
32
|
-
control: {
|
|
33
|
-
type: 'radio',
|
|
34
|
-
},
|
|
35
|
-
options: ['Large', 'Medium', 'Small', 'Extra small'],
|
|
36
|
-
description: 'Size of the spinner',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
args: {
|
|
40
|
-
variant: 'Standard',
|
|
41
|
-
size: 'Large',
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
const Template = ({ size, variant }) => {
|
|
45
|
-
const sizeLookup = { 'Large': 'lg', 'Medium': 'md', 'Small': 'sm', 'Extra small': 'xs' };
|
|
46
|
-
const variantLookup = { Standard: 'standard', Inverted: 'inverted' };
|
|
47
|
-
return formatHtmlPreview(`
|
|
48
|
-
<sdds-spinner
|
|
49
|
-
size="${sizeLookup[size]}"
|
|
50
|
-
variant="${variantLookup[variant]}">
|
|
51
|
-
</sdds-spinner>
|
|
52
|
-
`);
|
|
53
|
-
};
|
|
54
|
-
export const Default = Template.bind({});
|
|
55
|
-
Default.args = {};
|
|
56
|
-
export const Inverted = Template.bind({});
|
|
57
|
-
Inverted.args = {
|
|
58
|
-
variant: 'Inverted',
|
|
59
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Components/Stepper',
|
|
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=10508%3A32221&t=Ne6myqwca5m00de7-1',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'Link',
|
|
14
|
-
type: 'link',
|
|
15
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10508%3A32221&t=Ne6myqwca5m00de7-1',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
size: {
|
|
21
|
-
name: 'Size',
|
|
22
|
-
description: 'Size of the stepper',
|
|
23
|
-
control: {
|
|
24
|
-
type: 'radio',
|
|
25
|
-
},
|
|
26
|
-
options: ['Default', 'Small'],
|
|
27
|
-
},
|
|
28
|
-
style: {
|
|
29
|
-
name: 'Style',
|
|
30
|
-
description: 'Style of the stepper',
|
|
31
|
-
control: {
|
|
32
|
-
type: 'radio',
|
|
33
|
-
},
|
|
34
|
-
options: ['Default', 'Text on side', 'Vertical'],
|
|
35
|
-
},
|
|
36
|
-
showLabel: {
|
|
37
|
-
name: 'Show label text',
|
|
38
|
-
description: 'Show or hide the label text',
|
|
39
|
-
control: {
|
|
40
|
-
type: 'boolean',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
iconType: {
|
|
44
|
-
name: 'Icon type',
|
|
45
|
-
description: 'Native/Web Component',
|
|
46
|
-
control: {
|
|
47
|
-
type: 'radio',
|
|
48
|
-
},
|
|
49
|
-
options: ['Native', 'Web Component'],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
args: {
|
|
53
|
-
size: 'Default',
|
|
54
|
-
style: 'Default',
|
|
55
|
-
showLabel: true,
|
|
56
|
-
iconType: 'Native',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
const Template = ({ size, style, showLabel, iconType }) => {
|
|
60
|
-
const sizeClass = size === 'Small' ? 'sdds-stepper-sm' : '';
|
|
61
|
-
const styleLookup = {
|
|
62
|
-
'Default': '',
|
|
63
|
-
'Text on side': 'sdds-stepper--sidetext',
|
|
64
|
-
'Vertical': 'sdds-stepper--vertical',
|
|
65
|
-
};
|
|
66
|
-
return formatHtmlPreview(`
|
|
67
|
-
|
|
68
|
-
${iconType === 'Native'
|
|
69
|
-
? ` <style>/* Note: In case using WebFont icons, please make sure to import icons css file in your implementation */
|
|
70
|
-
@import url('https://cdn.digitaldesign.scania.com/icons/webfont/css/sdds-icons.css');</style>
|
|
71
|
-
`
|
|
72
|
-
: ''}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<div class="sdds-stepper-demo-container">
|
|
76
|
-
<div class="sdds-stepper ${sizeClass} ${styleLookup[style]}">
|
|
77
|
-
|
|
78
|
-
<div class="sdds-stepper__step sdds-stepper__step--value">
|
|
79
|
-
<div class="sdds-stepper__step-icon">
|
|
80
|
-
<span class="sdds-stepper__step-icon-value">1</span>
|
|
81
|
-
</div>
|
|
82
|
-
${showLabel ? '<label class="sdds-stepper__step_label">Step value</label>' : ''}
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div class="sdds-stepper__step sdds-stepper__step--warning">
|
|
86
|
-
<div class="sdds-stepper__step-icon">
|
|
87
|
-
${iconType === 'Native'
|
|
88
|
-
? `<i class="sdds-icon warning"></i>
|
|
89
|
-
`
|
|
90
|
-
: `<sdds-icon name="warning" size="${size === 'Small' ? '16px' : '18px'}"></sdds-icon> `}
|
|
91
|
-
</div>
|
|
92
|
-
${showLabel ? '<label class="sdds-stepper__step_label">Step warning</label>' : ''}
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div class="sdds-stepper__step sdds-stepper__step--inactive">
|
|
96
|
-
<div class="sdds-stepper__step-icon">
|
|
97
|
-
<span class="sdds-stepper__step-icon-value">3</span>
|
|
98
|
-
</div>
|
|
99
|
-
${showLabel ? '<label class="sdds-stepper__step_label">Step inactive</label>' : ''}
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
<div class="sdds-stepper__step sdds-stepper__step--success">
|
|
103
|
-
<div class="sdds-stepper__step-icon">
|
|
104
|
-
${iconType === 'Native'
|
|
105
|
-
? `<i class="sdds-icon tick"></i>
|
|
106
|
-
`
|
|
107
|
-
: `<div>
|
|
108
|
-
<sdds-icon name="tick" size="${size === 'Small' ? '16px' : '20px'}"></sdds-icon>
|
|
109
|
-
</div>`}
|
|
110
|
-
</div>
|
|
111
|
-
${showLabel ? '<label class="sdds-stepper__step_label">Step success</label>' : ''}
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
`);
|
|
117
|
-
};
|
|
118
|
-
export const Default = Template.bind({});
|
|
119
|
-
Default.args = {};
|
|
120
|
-
export const Small = Template.bind({});
|
|
121
|
-
Small.args = {
|
|
122
|
-
size: 'Small',
|
|
123
|
-
};
|
|
124
|
-
export const TextOnSide = Template.bind({});
|
|
125
|
-
TextOnSide.args = {
|
|
126
|
-
size: 'Default',
|
|
127
|
-
style: 'Text on side',
|
|
128
|
-
};
|
|
129
|
-
export const Vertical = Template.bind({});
|
|
130
|
-
Vertical.args = {
|
|
131
|
-
size: 'Default',
|
|
132
|
-
style: 'Vertical',
|
|
133
|
-
};
|
|
134
|
-
export const HideLabel = Template.bind({});
|
|
135
|
-
HideLabel.args = {
|
|
136
|
-
size: 'Default',
|
|
137
|
-
style: 'Default',
|
|
138
|
-
label: 'Hide',
|
|
139
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Tabs',
|
|
5
|
-
parameters: {
|
|
6
|
-
notes: readme,
|
|
7
|
-
backgrounds: { default: 'white' },
|
|
8
|
-
design: [
|
|
9
|
-
{
|
|
10
|
-
name: 'Figma',
|
|
11
|
-
type: 'figma',
|
|
12
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A32834&t=Ne6myqwca5m00de7-1',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Link',
|
|
16
|
-
type: 'link',
|
|
17
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A32834&t=Ne6myqwca5m00de7-1',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
autoHeight: {
|
|
23
|
-
name: 'Same height',
|
|
24
|
-
description: 'Make all tab panels as tall as the tallest tab panel',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
modeVariant: {
|
|
30
|
-
name: "Mode variant",
|
|
31
|
-
control: {
|
|
32
|
-
type: 'radio'
|
|
33
|
-
},
|
|
34
|
-
options: ['Primary', 'Secondary'],
|
|
35
|
-
},
|
|
36
|
-
backgrounds: {
|
|
37
|
-
table: {
|
|
38
|
-
disable: true,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
args: {
|
|
43
|
-
autoHeight: false,
|
|
44
|
-
modeVariant: 'Primary'
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
// eslint-disable-next-line arrow-body-style
|
|
48
|
-
const Template = ({ autoHeight = false, modeVariant }) => {
|
|
49
|
-
return formatHtmlPreview(`
|
|
50
|
-
<sdds-inline-tabs ${autoHeight ? 'auto-height' : ''} mode-variant="${modeVariant.toLowerCase()}">
|
|
51
|
-
<div data-name="Tab with tall content">
|
|
52
|
-
Tab panel 1
|
|
53
|
-
<div style="width:200px; height:200px; background: linear-gradient(125deg,rgba(255, 0, 0, 1) 0%,rgba(255, 255, 0, 1) 33%,rgba(0, 192, 255, 1) 66%,rgba(192, 0, 255, 1) 100%);"></div>
|
|
54
|
-
</div>
|
|
55
|
-
<div data-name="Default tab" data-default="true">
|
|
56
|
-
Tab panel 2
|
|
57
|
-
</div>
|
|
58
|
-
<div data-name="Disabled tab" aria-disabled="true">
|
|
59
|
-
Tab panel 3
|
|
60
|
-
</div>
|
|
61
|
-
</sdds-inline-tabs>
|
|
62
|
-
`);
|
|
63
|
-
};
|
|
64
|
-
export const InlineTabs = Template.bind({});
|
|
65
|
-
InlineTabs.args = {};
|
package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Tabs',
|
|
5
|
-
parameters: {
|
|
6
|
-
notes: readme,
|
|
7
|
-
design: [
|
|
8
|
-
{
|
|
9
|
-
name: 'Figma',
|
|
10
|
-
type: 'figma',
|
|
11
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A32834&t=Ne6myqwca5m00de7-1',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'Link',
|
|
15
|
-
type: 'link',
|
|
16
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A32834&t=Ne6myqwca5m00de7-1',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
modeVariant: {
|
|
22
|
-
name: "Variant",
|
|
23
|
-
control: {
|
|
24
|
-
type: 'radio'
|
|
25
|
-
},
|
|
26
|
-
options: ['Primary', 'Secondary'],
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
args: {
|
|
30
|
-
modeVariant: 'Primary'
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const Template = ({ modeVariant }) => formatHtmlPreview(`
|
|
34
|
-
<sdds-inline-tabs-fullbleed id="inline-tabs-fullbleed-example" mode-variant="${modeVariant.toLowerCase()}">
|
|
35
|
-
<a href="#">Tab name</a>
|
|
36
|
-
<a href="#" class="sdds-inline-tabs-fullbleed--tab__active">Active tab</a>
|
|
37
|
-
<a href="#">Tab name</a>
|
|
38
|
-
<a href="#">Tab name</a>
|
|
39
|
-
<a href="#" class="sdds-inline-tabs-fullbleed--tab__disabled">Disabled tab</a>
|
|
40
|
-
</sdds-inline-tabs-fullbleed>
|
|
41
|
-
`);
|
|
42
|
-
export const InlineTabsFullbleed = Template.bind({});
|
|
43
|
-
InlineTabsFullbleed.args = {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Tabs',
|
|
5
|
-
parameters: {
|
|
6
|
-
notes: readme,
|
|
7
|
-
design: [
|
|
8
|
-
{
|
|
9
|
-
name: 'Figma',
|
|
10
|
-
type: 'figma',
|
|
11
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A31546&t=Ne6myqwca5m00de7-1',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'Link',
|
|
15
|
-
type: 'link',
|
|
16
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=10544%3A31546&t=Ne6myqwca5m00de7-1',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
// Why role="link" on a disabled link: https://www.scottohara.me/blog/2021/05/28/disabled-links.html
|
|
22
|
-
const Template = () => formatHtmlPreview(`
|
|
23
|
-
<sdds-navigation-tabs>
|
|
24
|
-
<a href="#" class="sdds-navigation-tabs-tab-active">Active tab</a>
|
|
25
|
-
<a href="#">Tab name</a>
|
|
26
|
-
<a href="#">Tab name</a>
|
|
27
|
-
<a href="#">Tab name</a>
|
|
28
|
-
<a role="link" aria-disabled="true" class="sdds-navigation-tabs-tab-disabled">Disabled tab</a>
|
|
29
|
-
</sdds-navigation-tabs>
|
|
30
|
-
`);
|
|
31
|
-
export const NavigationTabs = Template.bind({});
|
|
32
|
-
NavigationTabs.args = {};
|