@scania/tegel 0.0.1-beta.5 → 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.
Files changed (141) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tegel.cjs.js +1 -1
  3. package/dist/collection/collection-manifest.json +2 -2
  4. package/dist/esm/loader.js +1 -1
  5. package/dist/esm/tegel.js +1 -1
  6. package/package.json +5 -5
  7. package/readme.md +135 -0
  8. package/dist/collection/components/accordion/accordion.stories.js +0 -91
  9. package/dist/collection/components/badge/badge.stories.js +0 -101
  10. package/dist/collection/components/banner/banner.stories.js +0 -93
  11. package/dist/collection/components/block/block.stories.js +0 -46
  12. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +0 -26
  13. package/dist/collection/components/button/button-native.stories.js +0 -183
  14. package/dist/collection/components/button/button-webcomponent.stories.js +0 -182
  15. package/dist/collection/components/card/card.stories.js +0 -181
  16. package/dist/collection/components/checkbox/checkbox.stories.js +0 -54
  17. package/dist/collection/components/chips/chips.stories.js +0 -124
  18. package/dist/collection/components/data-table/native-table.stories.js +0 -182
  19. package/dist/collection/components/data-table/table-component-basic.stories.js +0 -163
  20. package/dist/collection/components/data-table/table-component-batch-actions.stories.js +0 -129
  21. package/dist/collection/components/data-table/table-component-bodydata.stories.js +0 -58
  22. package/dist/collection/components/data-table/table-component-custom-width.stories.js +0 -198
  23. package/dist/collection/components/data-table/table-component-event-listeners.stories.js +0 -153
  24. package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +0 -137
  25. package/dist/collection/components/data-table/table-component-filtering.stories.js +0 -139
  26. package/dist/collection/components/data-table/table-component-multiselect.stories.js +0 -160
  27. package/dist/collection/components/data-table/table-component-pagination.stories.js +0 -129
  28. package/dist/collection/components/data-table/table-component-sorting.stories.js +0 -107
  29. package/dist/collection/components/datetime/datetime.stories.js +0 -149
  30. package/dist/collection/components/divider/divider.stories.js +0 -116
  31. package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +0 -130
  32. package/dist/collection/components/dropdown/dropdown-native.stories.js +0 -90
  33. package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +0 -151
  34. package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +0 -146
  35. package/dist/collection/components/footer/footer.stories.js +0 -100
  36. package/dist/collection/components/header/header-all.stories.js +0 -217
  37. package/dist/collection/components/header/header-default.stories.js +0 -47
  38. package/dist/collection/components/header/header-inline.stories.js +0 -113
  39. package/dist/collection/components/header/header-search.stories.js +0 -263
  40. package/dist/collection/components/header/header-toolbar.stories.js +0 -204
  41. package/dist/collection/components/icon/icon-font.stories.js +0 -57
  42. package/dist/collection/components/icon/icon-web-component.stories.js +0 -51
  43. package/dist/collection/components/link/link.stories.js +0 -45
  44. package/dist/collection/components/message/message.stories.js +0 -117
  45. package/dist/collection/components/modal/modal-native.stories.js +0 -121
  46. package/dist/collection/components/modal/modal-webcomponent.stories.js +0 -78
  47. package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -87
  48. package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +0 -132
  49. package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -109
  50. package/dist/collection/components/radio-button/radio-button.stories.js +0 -68
  51. package/dist/collection/components/side-menu/side-menu.stories.js +0 -182
  52. package/dist/collection/components/slider/slider.stories.js +0 -251
  53. package/dist/collection/components/spinner/spinner.stories.js +0 -59
  54. package/dist/collection/components/stepper/stepper.stories.js +0 -139
  55. package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +0 -65
  56. package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +0 -43
  57. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -32
  58. package/dist/collection/components/textarea/textarea.stories.js +0 -149
  59. package/dist/collection/components/textfield/textfield.stories.js +0 -222
  60. package/dist/collection/components/toast/toast.stories.js +0 -119
  61. package/dist/collection/components/toggle/toggle.stories.js +0 -62
  62. package/dist/collection/components/tooltip/tooltip.stories.js +0 -113
  63. package/dist/collection/components/utility/colour/background-color.stories.js +0 -96
  64. package/dist/collection/components/utility/colour/text-color.stories.js +0 -94
  65. package/dist/collection/foundations-stories/colour/colour-brand.stories.js +0 -38
  66. package/dist/collection/foundations-stories/colour/colour-scales.stories.js +0 -71
  67. package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +0 -40
  68. package/dist/collection/foundations-stories/grid/grid.stories.js +0 -386
  69. package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +0 -100
  70. package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +0 -94
  71. package/dist/collection/foundations-stories/typography/typography-body.stories.js +0 -16
  72. package/dist/collection/foundations-stories/typography/typography-detail.stories.js +0 -17
  73. package/dist/collection/foundations-stories/typography/typography-headline.stories.js +0 -39
  74. package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +0 -12
  75. package/dist/types/components/accordion/accordion.stories.d.ts +0 -77
  76. package/dist/types/components/badge/badge.stories.d.ts +0 -66
  77. package/dist/types/components/banner/banner.stories.d.ts +0 -68
  78. package/dist/types/components/block/block.stories.d.ts +0 -31
  79. package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +0 -12
  80. package/dist/types/components/button/button-native.stories.d.ts +0 -144
  81. package/dist/types/components/button/button-webcomponent.stories.d.ts +0 -143
  82. package/dist/types/components/card/card.stories.d.ts +0 -114
  83. package/dist/types/components/checkbox/checkbox.stories.d.ts +0 -39
  84. package/dist/types/components/chips/chips.stories.d.ts +0 -81
  85. package/dist/types/components/data-table/native-table.stories.d.ts +0 -147
  86. package/dist/types/components/data-table/table-component-basic.stories.d.ts +0 -100
  87. package/dist/types/components/data-table/table-component-batch-actions.stories.d.ts +0 -98
  88. package/dist/types/components/data-table/table-component-bodydata.stories.d.ts +0 -38
  89. package/dist/types/components/data-table/table-component-custom-width.stories.d.ts +0 -147
  90. package/dist/types/components/data-table/table-component-event-listeners.stories.d.ts +0 -87
  91. package/dist/types/components/data-table/table-component-expandable-rows.stories.d.ts +0 -87
  92. package/dist/types/components/data-table/table-component-filtering.stories.d.ts +0 -100
  93. package/dist/types/components/data-table/table-component-multiselect.stories.d.ts +0 -100
  94. package/dist/types/components/data-table/table-component-pagination.stories.d.ts +0 -100
  95. package/dist/types/components/data-table/table-component-sorting.stories.d.ts +0 -79
  96. package/dist/types/components/datetime/datetime.stories.d.ts +0 -80
  97. package/dist/types/components/divider/divider.stories.d.ts +0 -72
  98. package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.stories.d.ts +0 -73
  99. package/dist/types/components/dropdown/dropdown-native.stories.d.ts +0 -57
  100. package/dist/types/components/dropdown/dropdown-wc-default.stories.d.ts +0 -115
  101. package/dist/types/components/dropdown/dropdown-wc-multiselect.stories.d.ts +0 -115
  102. package/dist/types/components/footer/footer.stories.d.ts +0 -23
  103. package/dist/types/components/header/header-all.stories.d.ts +0 -29
  104. package/dist/types/components/header/header-default.stories.d.ts +0 -29
  105. package/dist/types/components/header/header-inline.stories.d.ts +0 -29
  106. package/dist/types/components/header/header-search.stories.d.ts +0 -29
  107. package/dist/types/components/header/header-toolbar.stories.d.ts +0 -29
  108. package/dist/types/components/icon/icon-font.stories.d.ts +0 -38
  109. package/dist/types/components/icon/icon-web-component.stories.d.ts +0 -38
  110. package/dist/types/components/link/link.stories.d.ts +0 -33
  111. package/dist/types/components/message/message.stories.d.ts +0 -67
  112. package/dist/types/components/modal/modal-native.stories.d.ts +0 -51
  113. package/dist/types/components/modal/modal-webcomponent.stories.d.ts +0 -44
  114. package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +0 -25
  115. package/dist/types/components/popover-menu/popover-menu-icons.stories.d.ts +0 -27
  116. package/dist/types/components/popover-menu/popover-menu.stories.d.ts +0 -27
  117. package/dist/types/components/radio-button/radio-button.stories.d.ts +0 -41
  118. package/dist/types/components/side-menu/side-menu.stories.d.ts +0 -42
  119. package/dist/types/components/slider/slider.stories.d.ts +0 -156
  120. package/dist/types/components/spinner/spinner.stories.d.ts +0 -37
  121. package/dist/types/components/stepper/stepper.stories.d.ts +0 -56
  122. package/dist/types/components/tabs/inline-tabs-default/inline-tabs.stories.d.ts +0 -41
  123. package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.d.ts +0 -25
  124. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +0 -13
  125. package/dist/types/components/textarea/textarea.stories.d.ts +0 -111
  126. package/dist/types/components/textfield/textfield.stories.d.ts +0 -176
  127. package/dist/types/components/toast/toast.stories.d.ts +0 -58
  128. package/dist/types/components/toggle/toggle.stories.d.ts +0 -42
  129. package/dist/types/components/tooltip/tooltip.stories.d.ts +0 -54
  130. package/dist/types/components/utility/colour/background-color.stories.d.ts +0 -58
  131. package/dist/types/components/utility/colour/text-color.stories.d.ts +0 -58
  132. package/dist/types/foundations-stories/colour/colour-brand.stories.d.ts +0 -13
  133. package/dist/types/foundations-stories/colour/colour-scales.stories.d.ts +0 -13
  134. package/dist/types/foundations-stories/colour/colour-semantic.stories.d.ts +0 -13
  135. package/dist/types/foundations-stories/grid/grid.stories.d.ts +0 -35
  136. package/dist/types/foundations-stories/spacing/spacing-element.stories.d.ts +0 -8
  137. package/dist/types/foundations-stories/spacing/spacing-layout.stories.d.ts +0 -8
  138. package/dist/types/foundations-stories/typography/typography-body.stories.d.ts +0 -8
  139. package/dist/types/foundations-stories/typography/typography-detail.stories.d.ts +0 -8
  140. package/dist/types/foundations-stories/typography/typography-headline.stories.d.ts +0 -21
  141. package/dist/types/foundations-stories/typography/typography-paragraph.stories.d.ts +0 -8
@@ -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.19.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -3,7 +3,7 @@
3
3
  const index = require('./index-e1c79686.js');
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v2.19.2 | MIT Licensed | https://stenciljs.com
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));
@@ -32,8 +32,8 @@
32
32
  ],
33
33
  "compiler": {
34
34
  "name": "@stencil/core",
35
- "version": "2.19.2",
36
- "typescriptVersion": "4.7.4"
35
+ "version": "2.20.0",
36
+ "typescriptVersion": "4.8.4"
37
37
  },
38
38
  "collections": [],
39
39
  "bundles": []
@@ -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.19.2 | MIT Licensed | https://stenciljs.com
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.19.2 | MIT Licensed | https://stenciljs.com
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.5",
3
+ "version": "0.0.1-beta.7",
4
4
  "description": "Tegel - Scania's Digital Design System",
5
5
  "keywords": [
6
6
  "tegel",
@@ -16,9 +16,9 @@
16
16
  "module": "dist/index.js",
17
17
  "es2015": "dist/esm/index.mjs",
18
18
  "es2017": "dist/esm/index.mjs",
19
- "types": "dist/types/index.d.ts",
19
+ "types": "dist/types/components.d.ts",
20
20
  "collection": "dist/collection/collection-manifest.json",
21
- "collection:main": "./dist/index.cjs.js",
21
+ "collection:main": "dist/collection/index.js",
22
22
  "unpkg": "dist/components/components.esm.js",
23
23
  "repository": {
24
24
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@popperjs/core": "^2.11.6",
50
- "@stencil/core": "^2.13.0",
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.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",
package/readme.md CHANGED
@@ -15,6 +15,141 @@ Check out [Tegel Design System](https://tegel.scania.com/) for implementation an
15
15
 
16
16
  - Installation: [https://tegel.scania.com/development/getting-started-development/installation](https://tegel.scania.com/development/getting-started-development/installation)
17
17
 
18
+ ## React
19
+
20
+ ### Typescript
21
+
22
+ 1. Run `npm install @scania/tegel`
23
+ 2. src folder create a file called `register-webcomponents.ts`
24
+ 3. Paste the following into that file:
25
+ ```ts
26
+ import { defineCustomElements, JSX as LocalJSX } from '@scania/tegel/loader';
27
+ import { DetailedHTMLProps, HTMLAttributes } from 'react';
28
+
29
+ type StencilProps<T> = {
30
+ [P in keyof T]?: Omit<T[P], 'ref'> | HTMLAttributes<T>;
31
+ };
32
+
33
+ type ReactProps<T> = {
34
+ [P in keyof T]?: DetailedHTMLProps<HTMLAttributes<T[P]>, T[P]>;
35
+ };
36
+
37
+ type StencilToReact<T = LocalJSX.IntrinsicElements, U = HTMLElementTagNameMap> = StencilProps<T> &
38
+ ReactProps<U>;
39
+
40
+ declare global {
41
+ export namespace JSX {
42
+ interface IntrinsicElements extends StencilToReact { }
43
+ }
44
+ }
45
+
46
+ defineCustomElements(window)
47
+ ```
48
+ 4. In your index.tsx import `register-webcomponents.ts`
49
+ ```tsx
50
+ import React from 'react';
51
+ import ReactDOM from 'react-dom/client';
52
+ import './index.css';
53
+ import App from './App';
54
+ import reportWebVitals from './reportWebVitals';
55
+ import './register-webcomponents';
56
+
57
+ const root = ReactDOM.createRoot(
58
+ document.getElementById('root') as HTMLElement
59
+ );
60
+ root.render(
61
+ <React.StrictMode>
62
+ <App />
63
+ </React.StrictMode>
64
+ );
65
+
66
+ reportWebVitals();
67
+ ```
68
+ 5. In your global css file (usually `App.css`) import the tegel stylesheet.
69
+ ```css
70
+ @import url('@scania/tegel/dist/tegel/tegel.css');
71
+ ```
72
+
73
+ ### Javascript
74
+ 1. Run `npm install @scania/tegel`
75
+ 2. In your index.jsx define the custom components:
76
+ ```jsx
77
+ import React from 'react';
78
+ import ReactDOM from 'react-dom/client';
79
+ import './index.css';
80
+ import App from './App';
81
+ import reportWebVitals from './reportWebVitals';
82
+ import {defineCustomElements} from '@scania/tegel/loader'
83
+
84
+ const root = ReactDOM.createRoot(document.getElementById('root'));
85
+ root.render(
86
+ <React.StrictMode>
87
+ <App />
88
+ </React.StrictMode>
89
+ );
90
+
91
+ reportWebVitals();
92
+ defineCustomElements()
93
+ ```
94
+ 3. In your global css file (usually `App.css`) import the tegel stylesheet.
95
+ ```css
96
+ @import url('@scania/tegel/dist/tegel/tegel.css');
97
+ ```
98
+
99
+ ## Angular
100
+
101
+ 1. Run `npm install @scania/tegel`
102
+ 2. In your `main.ts` import and call the function `defineCustomElements()`:
103
+
104
+ ```ts
105
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
106
+ import { defineCustomElements } from '@scania/tegel/loader'
107
+ import { AppModule } from './app/app.module';
108
+
109
+
110
+ platformBrowserDynamic().bootstrapModule(AppModule)
111
+ .catch(err => console.error(err));
112
+
113
+ defineCustomElements(window);
114
+ ```
115
+ 3. In your `app.module.ts` import `CUSTOM_ELEMENTS_SCHEMA`:
116
+ ```ts
117
+ import { BrowserModule } from '@angular/platform-browser';
118
+ import { AppComponent } from './app.component';
119
+
120
+ @NgModule({
121
+ declarations: [
122
+ AppComponent
123
+ ],
124
+ imports: [
125
+ BrowserModule
126
+ ],
127
+ providers: [],
128
+ bootstrap: [AppComponent],
129
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
130
+ })
131
+ export class AppModule { }
132
+ ```
133
+ 4. In your global css file (`styles.css`) import the tegel stylesheet.
134
+ ```css
135
+ @import url('@scania/tegel/dist/tegel/tegel.css');
136
+ ```
137
+
138
+ ## HTML
139
+
140
+ 1. Run `npm init` to generate a package.json
141
+ 2. Run `npm install @scania/tegel`
142
+ 3. Import the package and its style in your `<head>`:
143
+ ```html
144
+ <script type="module">
145
+ import { defineCustomElements } from "./node_modules/@scania/tegel/loader/index.es2017.js";
146
+ defineCustomElements();
147
+ </script>
148
+ <link rel="stylesheet" href="./node_modules/@scania/tegel/dist/tegel/tegel.css">
149
+ ```
150
+
151
+
152
+
18
153
 
19
154
  See all available components in the [Tegel Design System](https://tegel.scania.com/components/overview).
20
155
 
@@ -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 = {};