@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
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-e1c79686.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
package/dist/cjs/tegel.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const index = require('./index-e1c79686.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('tegel.cjs.js', document.baseURI).href));
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as promiseResolve, b as bootstrapLazy } from './index-b67b15a6.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
Stencil Client Patch Esm v2.
|
|
4
|
+
Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
5
5
|
*/
|
|
6
6
|
const patchEsm = () => {
|
|
7
7
|
return promiseResolve();
|
package/dist/esm/tegel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as promiseResolve, b as bootstrapLazy } from './index-b67b15a6.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
Stencil Client Patch Browser v2.
|
|
4
|
+
Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
5
5
|
*/
|
|
6
6
|
const patchBrowser = () => {
|
|
7
7
|
const importMeta = import.meta.url;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scania/tegel",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.7",
|
|
4
4
|
"description": "Tegel - Scania's Digital Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tegel",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"module": "dist/index.js",
|
|
17
17
|
"es2015": "dist/esm/index.mjs",
|
|
18
18
|
"es2017": "dist/esm/index.mjs",
|
|
19
|
-
"types": "dist/types/
|
|
19
|
+
"types": "dist/types/components.d.ts",
|
|
20
20
|
"collection": "dist/collection/collection-manifest.json",
|
|
21
21
|
"collection:main": "dist/collection/index.js",
|
|
22
22
|
"unpkg": "dist/components/components.esm.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@popperjs/core": "^2.11.6",
|
|
50
|
-
"@stencil/core": "^2.
|
|
50
|
+
"@stencil/core": "^2.20.0",
|
|
51
51
|
"@storybook/addon-google-analytics": "^6.2.9",
|
|
52
52
|
"concurrently": "^7.4.0",
|
|
53
53
|
"dotenv": "^16.0.3",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@babel/core": "^7.19.1",
|
|
59
|
-
"@stencil/sass": "^2.0.
|
|
59
|
+
"@stencil/sass": "^2.0.1",
|
|
60
60
|
"@storybook/addon-a11y": "^6.5.14",
|
|
61
61
|
"@storybook/addon-actions": "^6.5.12",
|
|
62
62
|
"@storybook/addon-essentials": "^6.5.12",
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
import readmeItem from './accordion-item/readme.md';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Components/Accordion',
|
|
6
|
-
argTypes: {
|
|
7
|
-
iconPosition: {
|
|
8
|
-
name: 'Expand icon position',
|
|
9
|
-
control: {
|
|
10
|
-
type: 'radio',
|
|
11
|
-
},
|
|
12
|
-
options: { End: 'end', Start: 'start' },
|
|
13
|
-
description: 'The horizontal position of the expand icon.',
|
|
14
|
-
table: {
|
|
15
|
-
defaultValue: { summary: 'end' },
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
disabled: {
|
|
19
|
-
name: 'Disable all items',
|
|
20
|
-
description: 'Disable all accordion items.',
|
|
21
|
-
control: {
|
|
22
|
-
type: 'boolean',
|
|
23
|
-
},
|
|
24
|
-
table: {
|
|
25
|
-
defaultValue: { summary: 'false' },
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
paddingReset: {
|
|
29
|
-
name: 'Less padding right',
|
|
30
|
-
description: 'Less padding on the right inside accordion items.',
|
|
31
|
-
control: {
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
},
|
|
34
|
-
table: {
|
|
35
|
-
defaultValue: { summary: 'false' },
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
modeVariant: {
|
|
39
|
-
name: 'Mode variant',
|
|
40
|
-
description: 'Variant of the component.',
|
|
41
|
-
control: {
|
|
42
|
-
type: 'radio',
|
|
43
|
-
},
|
|
44
|
-
options: ['Primary', 'Secondary'],
|
|
45
|
-
table: {
|
|
46
|
-
defaultValue: { summary: 'primary' },
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
parameters: {
|
|
51
|
-
notes: { 'Accordion': readme, 'Accordion item': readmeItem },
|
|
52
|
-
design: [
|
|
53
|
-
{
|
|
54
|
-
name: 'Figma',
|
|
55
|
-
type: 'figma',
|
|
56
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2762%3A84&t=rVXuTOgTmXPauyHd-1',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: 'Link',
|
|
60
|
-
type: 'link',
|
|
61
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2762%3A84&t=rVXuTOgTmXPauyHd-1',
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
args: {
|
|
66
|
-
disabled: false,
|
|
67
|
-
paddingReset: false,
|
|
68
|
-
iconPosition: 'end',
|
|
69
|
-
modeVariant: 'Primary',
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
const Template = ({ disabled, iconPosition, paddingReset, modeVariant }) => {
|
|
73
|
-
const affixAttr = iconPosition === 'start' ? 'expand-icon-position="start"' : '';
|
|
74
|
-
const disabledAttr = disabled ? 'disabled' : '';
|
|
75
|
-
const paddingResetAttr = paddingReset ? 'padding-reset' : '';
|
|
76
|
-
const tabIndexAttr = 'tabindex="0"';
|
|
77
|
-
return formatHtmlPreview(`
|
|
78
|
-
<sdds-accordion mode-variant="${modeVariant.toLowerCase()}">
|
|
79
|
-
<sdds-accordion-item header="First item" ${tabIndexAttr} ${affixAttr} ${disabledAttr} ${paddingResetAttr}>
|
|
80
|
-
This is the panel, which contains associated information with the header. Usually it contains text, set in the same size as the header.
|
|
81
|
-
Lorem ipsum doler sit amet.
|
|
82
|
-
</sdds-accordion-item>
|
|
83
|
-
<sdds-accordion-item header="Second item" ${tabIndexAttr} ${affixAttr} ${disabledAttr} ${paddingResetAttr} expanded>
|
|
84
|
-
This is the panel, which contains associated information with the header. Usually it contains text, set in the same size as the header.
|
|
85
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis laoreet vestibulum fermentum.
|
|
86
|
-
</sdds-accordion-item>
|
|
87
|
-
</sdds-accordion>
|
|
88
|
-
`);
|
|
89
|
-
};
|
|
90
|
-
export const Default = Template.bind({});
|
|
91
|
-
Default.args = {};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Badge',
|
|
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=7477%3A297479&t=rVXuTOgTmXPauyHd-1',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Link',
|
|
16
|
-
type: 'link',
|
|
17
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7477%3A297479&t=rVXuTOgTmXPauyHd-1',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
visible: {
|
|
23
|
-
name: 'Visible',
|
|
24
|
-
description: 'Toggle visibility of badge',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
},
|
|
28
|
-
table: {
|
|
29
|
-
defaultValue: { summary: false },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
value: {
|
|
33
|
-
name: 'Value',
|
|
34
|
-
description: 'Set a value to show on the badge',
|
|
35
|
-
control: {
|
|
36
|
-
type: 'number',
|
|
37
|
-
},
|
|
38
|
-
if: { arg: 'size', neq: 'sm' },
|
|
39
|
-
table: {
|
|
40
|
-
defaultValue: { summary: null },
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
size: {
|
|
44
|
-
name: 'Size',
|
|
45
|
-
description: 'Size of the component',
|
|
46
|
-
options: {
|
|
47
|
-
Large: 'lg',
|
|
48
|
-
Small: 'sm',
|
|
49
|
-
},
|
|
50
|
-
control: {
|
|
51
|
-
type: 'radio',
|
|
52
|
-
},
|
|
53
|
-
table: {
|
|
54
|
-
defaultValue: { summary: 'lg' },
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
args: {
|
|
59
|
-
visible: true,
|
|
60
|
-
size: 'lg',
|
|
61
|
-
value: 1,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
const Template = ({ value, size, visible }) => formatHtmlPreview(`<sdds-badges
|
|
65
|
-
${value ? `value="${value}"` : ''}
|
|
66
|
-
is-visible=${visible}
|
|
67
|
-
size="${size}">
|
|
68
|
-
</sdds-badges>`);
|
|
69
|
-
export const Default = Template.bind({});
|
|
70
|
-
const WithDemoTemplate = ({ value, size, visible }) => formatHtmlPreview(`
|
|
71
|
-
<style>
|
|
72
|
-
/* Note: Demo classes used here are just for demo purposes in Storybook */
|
|
73
|
-
.badges-demo-box {
|
|
74
|
-
margin:5px;
|
|
75
|
-
height: 32px;
|
|
76
|
-
width: 32px;
|
|
77
|
-
position: relative;
|
|
78
|
-
background-color: #C4C4C4;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.badges-demo-box sdds-badges[size="lg"]{
|
|
82
|
-
position: absolute;
|
|
83
|
-
left: 16px;
|
|
84
|
-
top: -5px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.badges-demo-box sdds-badges[size="sm"]{
|
|
88
|
-
position: absolute;
|
|
89
|
-
left: 26px;
|
|
90
|
-
top: -2px;
|
|
91
|
-
}
|
|
92
|
-
</style>
|
|
93
|
-
|
|
94
|
-
<div class="badges-demo-box">
|
|
95
|
-
<sdds-badges
|
|
96
|
-
${value ? `value="${value}"` : ''}
|
|
97
|
-
is-visible=${visible}
|
|
98
|
-
size="${size}">
|
|
99
|
-
</sdds-badges>
|
|
100
|
-
</div>`);
|
|
101
|
-
export const WithDemoComponent = WithDemoTemplate.bind({});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
// FIXME: CMS: Change state to type in Code tab of component
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Banner',
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: 'fullscreen',
|
|
7
|
-
design: [
|
|
8
|
-
{
|
|
9
|
-
name: 'Figma',
|
|
10
|
-
type: 'figma',
|
|
11
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5927%3A497&t=rVXuTOgTmXPauyHd-1',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'Link',
|
|
15
|
-
type: 'link',
|
|
16
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=5927%3A497&t=rVXuTOgTmXPauyHd-1',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
state: {
|
|
22
|
-
name: 'Type',
|
|
23
|
-
description: 'Changes type of component',
|
|
24
|
-
options: ['Default', 'Error', 'Info'],
|
|
25
|
-
control: {
|
|
26
|
-
type: 'radio',
|
|
27
|
-
},
|
|
28
|
-
table: {
|
|
29
|
-
defaultValue: { summary: 'default' },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
header: {
|
|
33
|
-
name: 'Header',
|
|
34
|
-
description: 'Text to display in header section',
|
|
35
|
-
control: {
|
|
36
|
-
type: 'text',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
subheader: {
|
|
40
|
-
name: 'Subheader',
|
|
41
|
-
description: 'Text to display in subheader section',
|
|
42
|
-
control: {
|
|
43
|
-
type: 'text',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
link: {
|
|
47
|
-
name: 'Link',
|
|
48
|
-
description: 'Text to display in link section',
|
|
49
|
-
control: {
|
|
50
|
-
type: 'text',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
prefix: {
|
|
54
|
-
name: 'Show icon',
|
|
55
|
-
description: 'If an icon should be displayed. For type default the truck icon is used in this example, but it should be changed to suit your needs.',
|
|
56
|
-
control: {
|
|
57
|
-
type: 'boolean',
|
|
58
|
-
},
|
|
59
|
-
table: {
|
|
60
|
-
defaultValue: { summary: 'true' },
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
args: {
|
|
65
|
-
state: 'Default',
|
|
66
|
-
header: 'This is a header text area',
|
|
67
|
-
subheader: 'SubHeader text area',
|
|
68
|
-
link: 'Learn more',
|
|
69
|
-
prefix: true,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
const Template = ({ state, prefix, header, subheader, link }) => formatHtmlPreview(`
|
|
73
|
-
<div class="sdds-banner sdds-banner-${state.toLowerCase()}">
|
|
74
|
-
${prefix && state === 'error'
|
|
75
|
-
? '<span class="sdds-banner-prefix"><sdds-icon name="error" size="20px"></sdds-icon></span>'
|
|
76
|
-
: ''}
|
|
77
|
-
${prefix && state === 'info'
|
|
78
|
-
? '<span class="sdds-banner-prefix"><sdds-icon name="info" size="20px"></sdds-icon></span>'
|
|
79
|
-
: ''}
|
|
80
|
-
${prefix && !(state === 'info' || state === 'error')
|
|
81
|
-
? '<span class="sdds-banner-prefix"><sdds-icon name="truck" size="20px"></sdds-icon></span>'
|
|
82
|
-
: ''}
|
|
83
|
-
<div class="sdds-banner-body">
|
|
84
|
-
${header && `<h6 class="sdds-banner-header">${header}</h6>`}
|
|
85
|
-
${subheader && `<div class="sdds-banner-subheader">${subheader}</div>`}
|
|
86
|
-
${link && `<a class="sdds-link sdds-banner-link">${link}</a>`}
|
|
87
|
-
</div>
|
|
88
|
-
<button type="button" aria-label="close" class="sdds-banner-close">
|
|
89
|
-
<sdds-icon name="cross" size="20px"></sdds-icon>
|
|
90
|
-
</button>
|
|
91
|
-
</div>
|
|
92
|
-
`);
|
|
93
|
-
export const Default = Template.bind({});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Components/Block',
|
|
4
|
-
parameters: {
|
|
5
|
-
layout: 'padded',
|
|
6
|
-
design: [
|
|
7
|
-
{
|
|
8
|
-
name: 'Figma',
|
|
9
|
-
type: 'figma',
|
|
10
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9743%3A24020&t=rVXuTOgTmXPauyHd-1',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'Link',
|
|
14
|
-
type: 'link',
|
|
15
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9743%3A24020&t=rVXuTOgTmXPauyHd-1',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
type: {
|
|
21
|
-
name: 'Mode variation',
|
|
22
|
-
description: 'Mode variation adjusts component colors to have better visibility depending on global mode and background. ',
|
|
23
|
-
control: {
|
|
24
|
-
type: 'radio',
|
|
25
|
-
},
|
|
26
|
-
options: ['Primary', 'Secondary'],
|
|
27
|
-
table: {
|
|
28
|
-
defaultValue: { summary: 'Primary' },
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
args: {
|
|
33
|
-
type: 'Primary',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
const Template = ({ type }) => formatHtmlPreview(`
|
|
37
|
-
<div class="sdds-block sdds-block-${type.toLowerCase()}">
|
|
38
|
-
<h2 class="sdds-headline-02">Block</h2>
|
|
39
|
-
<p class="sdds-body-01">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum nisi ut eleifend ultrices. Nunc venenatis maximus sapien, ac bibendum nisl aliquam in. Morbi ac velit et ligula consectetur interdum. Vestibulum condimentum, augue vitae lobortis rhoncus, mi est ultricies mi, sed tincidunt magna nibh in lectus. Pellentesque vel vulputate orci, vel lacinia orci. Sed suscipit leo at diam ullamcorper, vitae volutpat neque dapibus. Maecenas sit amet rhoncus arcu. Sed sed molestie elit. Nullam in interdum est, vitae aliquam ipsum. Nunc rutrum nibh ut arcu egestas egestas.</p>
|
|
40
|
-
<div class="sdds-block">
|
|
41
|
-
<h3 class="sdds-headline-03">Block in a block</h3>
|
|
42
|
-
<p class="sdds-body-02">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum nisi ut eleifend ultrices. Nunc venenatis maximus sapien, ac bibendum nisl aliquam in. Morbi ac velit et ligula consectetur interdum. Vestibulum condimentum, augue vitae lobortis rhoncus, mi est ultricies mi, sed tincidunt magna nibh in lectus. Pellentesque vel vulputate orci, vel lacinia orci. Sed suscipit leo at diam ullamcorper, vitae volutpat neque dapibus. Maecenas sit amet rhoncus arcu. Sed sed molestie elit. Nullam in interdum est, vitae aliquam ipsum. Nunc rutrum nibh ut arcu egestas egestas.</p>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
`);
|
|
46
|
-
export const Default = Template.bind({});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
title: 'Components/Breadcrumb',
|
|
3
|
-
parameters: {
|
|
4
|
-
design: [
|
|
5
|
-
{
|
|
6
|
-
name: 'Figma',
|
|
7
|
-
type: 'figma',
|
|
8
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2703%3A4725&t=rVXuTOgTmXPauyHd-1',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
name: 'Link',
|
|
12
|
-
type: 'link',
|
|
13
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=2703%3A4725&t=rVXuTOgTmXPauyHd-1',
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const Template = () => `
|
|
19
|
-
<div class="sdds-breadcrumb">
|
|
20
|
-
<div class="sdds-breadcrumb-item"><a href="#">Page 1</a></div>
|
|
21
|
-
<div class="sdds-breadcrumb-item"><a href="#">Page 2</a></div>
|
|
22
|
-
<div class="sdds-breadcrumb-item sdds-breadcrumb-item-current"><a aria-current="page">Page 3</a></div>
|
|
23
|
-
</div>
|
|
24
|
-
`;
|
|
25
|
-
export const Default = Template.bind({});
|
|
26
|
-
Default.args = {};
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
import { iconsNames } from '../icon/iconsArray';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Button',
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: 'padded',
|
|
7
|
-
chromatic: {
|
|
8
|
-
disableSnapshot: false, // enables snapshotting for the component
|
|
9
|
-
},
|
|
10
|
-
design: [
|
|
11
|
-
{
|
|
12
|
-
name: 'Figma',
|
|
13
|
-
type: 'figma',
|
|
14
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1574%3A72148&t=rVXuTOgTmXPauyHd-1',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: 'Link',
|
|
18
|
-
type: 'link',
|
|
19
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=1574%3A72148&t=rVXuTOgTmXPauyHd-1',
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
argTypes: {
|
|
24
|
-
text: {
|
|
25
|
-
name: 'Text',
|
|
26
|
-
description: 'The text to be displayed on the button',
|
|
27
|
-
control: {
|
|
28
|
-
type: 'text',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
btnType: {
|
|
32
|
-
name: 'Type',
|
|
33
|
-
description: 'Four different button types to help the user to distinguish the level of importance of the task they represent',
|
|
34
|
-
control: {
|
|
35
|
-
type: 'radio',
|
|
36
|
-
},
|
|
37
|
-
options: ['Primary', 'Secondary', 'Ghost', 'Danger'],
|
|
38
|
-
table: {
|
|
39
|
-
defaultValue: { summary: 'primary' },
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
size: {
|
|
43
|
-
name: 'Size',
|
|
44
|
-
description: 'Size of the button',
|
|
45
|
-
control: {
|
|
46
|
-
type: 'radio',
|
|
47
|
-
},
|
|
48
|
-
options: ['Large', 'Medium', 'Small', 'Extra small'],
|
|
49
|
-
table: {
|
|
50
|
-
defaultValue: { summary: 'lg' },
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
variant: {
|
|
54
|
-
name: 'Variant',
|
|
55
|
-
description: 'Button variant.',
|
|
56
|
-
control: {
|
|
57
|
-
type: 'radio',
|
|
58
|
-
},
|
|
59
|
-
options: ['On light', 'On dark'],
|
|
60
|
-
table: {
|
|
61
|
-
defaultValue: { summary: 'on-dark' },
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
fullbleed: {
|
|
65
|
-
name: 'Fullbleed',
|
|
66
|
-
defaultValue: false,
|
|
67
|
-
description: 'Fluid width in certain components-old',
|
|
68
|
-
control: {
|
|
69
|
-
type: 'boolean',
|
|
70
|
-
},
|
|
71
|
-
table: {
|
|
72
|
-
defaultValue: { summary: false },
|
|
73
|
-
},
|
|
74
|
-
if: { arg: 'onlyIcon', eq: false },
|
|
75
|
-
},
|
|
76
|
-
disabled: {
|
|
77
|
-
name: 'Disabled',
|
|
78
|
-
type: 'boolean',
|
|
79
|
-
description: 'Choose to disable the button',
|
|
80
|
-
table: {
|
|
81
|
-
defaultValue: { summary: false },
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
onlyIcon: {
|
|
85
|
-
name: 'Only Icon',
|
|
86
|
-
description: 'Displays only the icon and excludes any text from the button',
|
|
87
|
-
control: {
|
|
88
|
-
type: 'boolean',
|
|
89
|
-
},
|
|
90
|
-
table: {
|
|
91
|
-
defaultValue: { summary: false },
|
|
92
|
-
},
|
|
93
|
-
if: { arg: 'size', neq: 'Extra small' },
|
|
94
|
-
},
|
|
95
|
-
icon: {
|
|
96
|
-
name: 'Icon',
|
|
97
|
-
description: 'Icon to display on the button. Choose "none" to exclude the icon.',
|
|
98
|
-
control: {
|
|
99
|
-
type: 'select',
|
|
100
|
-
},
|
|
101
|
-
options: ['none', ...iconsNames],
|
|
102
|
-
if: { arg: 'size', neq: 'Extra small' },
|
|
103
|
-
},
|
|
104
|
-
iconType: {
|
|
105
|
-
name: 'Icon type',
|
|
106
|
-
description: 'Native/Web Component',
|
|
107
|
-
control: {
|
|
108
|
-
type: 'radio',
|
|
109
|
-
},
|
|
110
|
-
options: ['Native', 'Web Component'],
|
|
111
|
-
if: { arg: 'icon', neq: 'none' },
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
args: {
|
|
115
|
-
text: 'Button',
|
|
116
|
-
btnType: 'Primary',
|
|
117
|
-
size: 'Large',
|
|
118
|
-
variant: 'On dark',
|
|
119
|
-
fullbleed: false,
|
|
120
|
-
disabled: false,
|
|
121
|
-
onlyIcon: false,
|
|
122
|
-
icon: 'none',
|
|
123
|
-
iconType: 'Native',
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
const NativeTemplate = ({ size, variant, btnType, fullbleed, text = 'Button', disabled = '', onlyIcon, icon, iconType, }) => {
|
|
127
|
-
const fbClass = fullbleed ? 'sdds-btn-fullbleed' : '';
|
|
128
|
-
const onlyIconCss = onlyIcon ? 'sdds-btn-icon' : '';
|
|
129
|
-
const btnTypeLookUp = {
|
|
130
|
-
Primary: 'primary',
|
|
131
|
-
Secondary: 'secondary',
|
|
132
|
-
Ghost: 'ghost',
|
|
133
|
-
Danger: 'danger',
|
|
134
|
-
};
|
|
135
|
-
const sizeLookUp = {
|
|
136
|
-
'Large': 'lg',
|
|
137
|
-
'Medium': 'md',
|
|
138
|
-
'Small': 'sm',
|
|
139
|
-
'Extra small': 'xs',
|
|
140
|
-
};
|
|
141
|
-
const varaintLookup = {
|
|
142
|
-
'On light': 'on-light',
|
|
143
|
-
'On dark': 'on-dark',
|
|
144
|
-
};
|
|
145
|
-
return formatHtmlPreview(`
|
|
146
|
-
<style>
|
|
147
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
148
|
-
${icon && iconType === 'Native'
|
|
149
|
-
? `@import url('https://cdn.digitaldesign.scania.com/icons/webfont/css/sdds-icons.css');
|
|
150
|
-
i.sdds-btn-icon{
|
|
151
|
-
font-size: ${size === 'Small' ? '16' : '20'}px;
|
|
152
|
-
}\n `
|
|
153
|
-
: ''}\ .demo-wrapper{
|
|
154
|
-
width: 100%;
|
|
155
|
-
}
|
|
156
|
-
</style>
|
|
157
|
-
|
|
158
|
-
<div class="demo-wrapper">
|
|
159
|
-
<button class="sdds-btn sdds-btn-${btnTypeLookUp[btnType]} sdds-btn-${sizeLookUp[size]} ${fbClass} ${disabled ? 'disabled' : ''} ${onlyIconCss} ${varaintLookup[variant] === 'on-light' ? 'sdds-on-white-bg' : ''} ${onlyIcon ? 'sdds-btn-only-icon' : ''}">
|
|
160
|
-
${!onlyIcon ? `<span class="sdds-btn-text">${text}</span>` : ''}
|
|
161
|
-
${onlyIcon || (icon && icon !== 'none')
|
|
162
|
-
? `
|
|
163
|
-
${iconType === 'Native'
|
|
164
|
-
? `<i class="sdds-btn-icon sdds-icon ${icon}"></i>`
|
|
165
|
-
: `<sdds-icon class='sdds-btn-icon ' size='${sizeLookUp[size] === 'sm' ? '16px' : '20px'}' name='${icon}'></sdds-icon>`}
|
|
166
|
-
`
|
|
167
|
-
: ''}
|
|
168
|
-
</button>
|
|
169
|
-
</div>
|
|
170
|
-
`);
|
|
171
|
-
};
|
|
172
|
-
export const Native = NativeTemplate.bind({});
|
|
173
|
-
Native.args = {};
|
|
174
|
-
export const NativeWithIcon = NativeTemplate.bind({});
|
|
175
|
-
NativeWithIcon.args = {
|
|
176
|
-
icon: 'truck',
|
|
177
|
-
};
|
|
178
|
-
export const NativeOnlyIcon = NativeTemplate.bind({});
|
|
179
|
-
NativeOnlyIcon.args = {
|
|
180
|
-
text: '',
|
|
181
|
-
onlyIcon: true,
|
|
182
|
-
icon: 'truck',
|
|
183
|
-
};
|