@scania/tegel 0.0.1-beta.4 → 0.0.1-beta.6
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/components/dropdown-option.js +0 -1
- package/dist/components/dropdown.js +0 -1
- package/dist/components/icon.js +0 -1
- package/dist/components/sdds-accordion-item.js +0 -1
- package/dist/components/sdds-accordion.js +0 -1
- package/dist/components/sdds-badges.js +0 -1
- package/dist/components/sdds-button.js +0 -1
- package/dist/components/sdds-datetime.js +0 -1
- package/dist/components/sdds-dropdown-filter.js +0 -1
- package/dist/components/sdds-header-cell.js +0 -1
- package/dist/components/sdds-inline-tabs-fullbleed.js +0 -1
- package/dist/components/sdds-inline-tabs.js +0 -1
- package/dist/components/sdds-modal.js +0 -1
- package/dist/components/sdds-navigation-tabs.js +0 -1
- package/dist/components/sdds-popover-canvas.js +0 -1
- package/dist/components/sdds-popover-menu.js +0 -1
- package/dist/components/sdds-slider.js +0 -1
- package/dist/components/sdds-spinner.js +0 -1
- package/dist/components/sdds-table-body-row-expandable.js +0 -1
- package/dist/components/sdds-table-body.js +0 -1
- package/dist/components/sdds-table-footer.js +0 -1
- package/dist/components/sdds-table-header.js +0 -1
- package/dist/components/sdds-table-toolbar.js +0 -1
- package/dist/components/sdds-table.js +0 -1
- package/dist/components/sdds-textarea.js +0 -1
- package/dist/components/sdds-textfield.js +0 -1
- package/dist/components/sdds-tooltip.js +0 -1
- package/dist/components/table-body-cell.js +0 -1
- package/dist/components/table-body-row.js +0 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/package.json +3 -3
- package/readme.md +135 -0
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.19.2 | 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.19.2 | 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/components/icon.js
CHANGED
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.19.2 | 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.19.2 | 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.6",
|
|
4
4
|
"description": "Tegel - Scania's Digital Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tegel",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "https://github.com/scania-digital-design-system/sdds/issues"
|
|
14
14
|
},
|
|
15
15
|
"main": "dist/index.cjs.js",
|
|
16
|
-
"module": "
|
|
16
|
+
"module": "dist/index.js",
|
|
17
17
|
"es2015": "dist/esm/index.mjs",
|
|
18
18
|
"es2017": "dist/esm/index.mjs",
|
|
19
19
|
"types": "dist/types/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@popperjs/core": "^2.11.6",
|
|
50
|
-
"@stencil/core": "^2.
|
|
50
|
+
"@stencil/core": "^2.13.0",
|
|
51
51
|
"@storybook/addon-google-analytics": "^6.2.9",
|
|
52
52
|
"concurrently": "^7.4.0",
|
|
53
53
|
"dotenv": "^16.0.3",
|
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
|
|