tuix-webcomponents 0.0.12 → 0.0.14
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/src/tuix-text/TuixText.d.ts +1 -1
- package/dist/src/tuix-text/TuixText.js +124 -97
- package/dist/src/tuix-text/TuixText.js.map +1 -1
- package/dist/stories/tuix-text.stories.d.ts +47 -0
- package/dist/stories/tuix-text.stories.js +60 -0
- package/dist/stories/tuix-text.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/fonts/Rubik-Medium.ttf +0 -0
- package/fonts/Rubik-Regular.ttf +0 -0
- package/fonts/Rubik-SemiBold.ttf +0 -0
- package/package.json +8 -9
- package/.circleci/config.yml +0 -105
- package/.editorconfig +0 -29
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -4
- package/.storybook/main.js +0 -3
- package/.storybook/server.mjs +0 -8
- package/bin/build.sh +0 -9
- package/demo/index.html +0 -35
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -62
- package/dist/package.json +0 -93
- package/src/enums/tuix-text.enums.ts +0 -27
- package/src/index.ts +0 -1
- package/src/tuix-text/TuixText.ts +0 -150
- package/src/utils/colors.ts +0 -10
- package/stories/tuix-text.stories.ts +0 -82
- package/tsconfig.json +0 -22
- package/web-dev-server.config.mjs +0 -27
package/package.json
CHANGED
|
@@ -3,25 +3,24 @@
|
|
|
3
3
|
"description": "Webcomponent tuix-webcomponents following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "tuix-webcomponents",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.14",
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"main": "dist/src/index.js",
|
|
9
9
|
"module": "dist/src/index.js",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./dist/src/index.js",
|
|
12
|
-
"./tuix-webcomponents.js": "./dist/src/
|
|
12
|
+
"./tuix-webcomponents.js": "./dist/src/index.js"
|
|
13
13
|
},
|
|
14
|
+
"files":["dist", "fonts"],
|
|
14
15
|
"scripts": {
|
|
15
|
-
"prepare": "husky install",
|
|
16
16
|
"analyze": "cem analyze --litelement",
|
|
17
|
-
"start": "
|
|
17
|
+
"start": "./bin/build.sh && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
18
18
|
"build": "./bin/build.sh && npm run analyze -- --exclude dist",
|
|
19
|
-
"prepublish": "
|
|
19
|
+
"prepublish": "./bin/build.sh && npm run analyze -- --exclude dist",
|
|
20
20
|
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
21
|
-
"format": "
|
|
22
|
-
"
|
|
23
|
-
"storybook": "
|
|
24
|
-
"storybook:build": "rm -rf dist && tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
21
|
+
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
22
|
+
"storybook": "./bin/build.sh && npm run analyze -- --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
|
|
23
|
+
"storybook:build": "./bin/build.sh && npm run analyze -- --exclude dist && build-storybook"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
26
|
"@commitlint/cli": "^17.6.1",
|
package/.circleci/config.yml
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
version: 2.1
|
|
3
|
-
|
|
4
|
-
workflows:
|
|
5
|
-
git_deploy:
|
|
6
|
-
jobs:
|
|
7
|
-
- deploy-prod:
|
|
8
|
-
filters:
|
|
9
|
-
branches:
|
|
10
|
-
only: master
|
|
11
|
-
- deploy-dev:
|
|
12
|
-
filters:
|
|
13
|
-
branches:
|
|
14
|
-
only: develop
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
|
|
18
|
-
deploy-dev:
|
|
19
|
-
working_directory: ~/app
|
|
20
|
-
docker:
|
|
21
|
-
- image: mhart/alpine-node:14.15.4
|
|
22
|
-
steps:
|
|
23
|
-
- run:
|
|
24
|
-
name: install git and ssh
|
|
25
|
-
command: apk update && apk add rsync && apk add git && apk add openssh-client
|
|
26
|
-
- add_ssh_keys:
|
|
27
|
-
fingerprints:
|
|
28
|
-
- "a1:a0:00:b4:59:8d:34:81:9c:d8:ac:25:cc:e5:93:00"
|
|
29
|
-
- run:
|
|
30
|
-
name: config git
|
|
31
|
-
command: git config --global user.email "pipeline@circleci.com" && git config --global user.name "CircleCI"
|
|
32
|
-
- run:
|
|
33
|
-
name: add github.com as known host
|
|
34
|
-
command: ssh-keygen -F github.com || ssh-keyscan github.com >> ~/.ssh/known_hosts
|
|
35
|
-
- run:
|
|
36
|
-
name: checkout
|
|
37
|
-
command: git clone "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH" .
|
|
38
|
-
- run:
|
|
39
|
-
name: npm install
|
|
40
|
-
command: npm install
|
|
41
|
-
- run:
|
|
42
|
-
name: npm run storybook:build
|
|
43
|
-
command: npm run storybook:build
|
|
44
|
-
- run:
|
|
45
|
-
name: push build to github
|
|
46
|
-
command: |
|
|
47
|
-
git clone git@github.com:tuixdevelopment/tuix-storybook-staging.git tuix-storybook-staging
|
|
48
|
-
cp -R tuix-storybook-staging/.git .git-backup
|
|
49
|
-
cp -R tuix-storybook-staging/CNAME CNAME-backup
|
|
50
|
-
rm -rf tuix-storybook-staging
|
|
51
|
-
cp -R storybook-static tuix-storybook-staging
|
|
52
|
-
cp -R .git-backup tuix-storybook-staging/.git
|
|
53
|
-
cp -R CNAME-backup tuix-storybook-staging/CNAME
|
|
54
|
-
|
|
55
|
-
GIT_TAG="$GIT_TAG.$(date +%s)"
|
|
56
|
-
|
|
57
|
-
cd tuix-storybook-staging
|
|
58
|
-
git add .
|
|
59
|
-
git commit -m "$GIT_TAG" --allow-empty
|
|
60
|
-
git push origin master -f
|
|
61
|
-
|
|
62
|
-
deploy-prod:
|
|
63
|
-
working_directory: ~/app
|
|
64
|
-
docker:
|
|
65
|
-
- image: mhart/alpine-node:14.15.4
|
|
66
|
-
steps:
|
|
67
|
-
- run:
|
|
68
|
-
name: install git and ssh
|
|
69
|
-
command: apk update && apk add rsync && apk add git && apk add openssh-client
|
|
70
|
-
- add_ssh_keys:
|
|
71
|
-
fingerprints:
|
|
72
|
-
- "a1:a0:00:b4:59:8d:34:81:9c:d8:ac:25:cc:e5:93:00"
|
|
73
|
-
- run:
|
|
74
|
-
name: config git
|
|
75
|
-
command: git config --global user.email "pipeline@circleci.com" && git config --global user.name "CircleCI"
|
|
76
|
-
- run:
|
|
77
|
-
name: add github.com as known host
|
|
78
|
-
command: ssh-keygen -F github.com || ssh-keyscan github.com >> ~/.ssh/known_hosts
|
|
79
|
-
- run:
|
|
80
|
-
name: checkout
|
|
81
|
-
command: git clone "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH" .
|
|
82
|
-
- run:
|
|
83
|
-
name: npm install
|
|
84
|
-
command: npm install
|
|
85
|
-
- run:
|
|
86
|
-
name: npm run storybook:build
|
|
87
|
-
command: npm run storybook:build
|
|
88
|
-
- run:
|
|
89
|
-
name: push build to github
|
|
90
|
-
command: |
|
|
91
|
-
git clone git@github.com:tuixdevelopment/tuix-storybook-prod.git tuix-storybook-prod
|
|
92
|
-
cp -R tuix-storybook-prod/.git .git-backup
|
|
93
|
-
cp -R tuix-storybook-prod/CNAME CNAME-backup
|
|
94
|
-
rm -rf tuix-storybook-prod
|
|
95
|
-
cp -R storybook-static tuix-storybook-prod
|
|
96
|
-
cp -R .git-backup tuix-storybook-prod/.git
|
|
97
|
-
cp -R CNAME-backup tuix-storybook-prod/CNAME
|
|
98
|
-
|
|
99
|
-
GIT_TAG="0.0.0.$(date +%s)"
|
|
100
|
-
|
|
101
|
-
cd tuix-storybook-prod
|
|
102
|
-
git add .
|
|
103
|
-
git commit -m "$GIT_TAG" --allow-empty
|
|
104
|
-
git push origin master -f
|
|
105
|
-
|
package/.editorconfig
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[*]
|
|
9
|
-
|
|
10
|
-
# Change these settings to your own preference
|
|
11
|
-
indent_style = space
|
|
12
|
-
indent_size = 2
|
|
13
|
-
|
|
14
|
-
# We recommend you to keep these unchanged
|
|
15
|
-
end_of_line = lf
|
|
16
|
-
charset = utf-8
|
|
17
|
-
trim_trailing_whitespace = true
|
|
18
|
-
insert_final_newline = true
|
|
19
|
-
|
|
20
|
-
[*.md]
|
|
21
|
-
trim_trailing_whitespace = false
|
|
22
|
-
|
|
23
|
-
[*.json]
|
|
24
|
-
indent_size = 2
|
|
25
|
-
|
|
26
|
-
[*.{html,js,md}]
|
|
27
|
-
block_comment_start = /**
|
|
28
|
-
block_comment = *
|
|
29
|
-
block_comment_end = */
|
package/.husky/commit-msg
DELETED
package/.husky/pre-commit
DELETED
package/.prettierrc
DELETED
package/.storybook/main.js
DELETED
package/.storybook/server.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { storybookPlugin } from '@web/dev-server-storybook';
|
|
2
|
-
import baseConfig from '../web-dev-server.config.mjs';
|
|
3
|
-
|
|
4
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
5
|
-
...baseConfig,
|
|
6
|
-
open: '/',
|
|
7
|
-
plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
|
|
8
|
-
});
|
package/bin/build.sh
DELETED
package/demo/index.html
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
7
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
8
|
-
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600&display=swap" rel="stylesheet">
|
|
9
|
-
<style>
|
|
10
|
-
body {
|
|
11
|
-
background: #fafafa;
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
<div id="demo"></div>
|
|
18
|
-
|
|
19
|
-
<script type="module">
|
|
20
|
-
import { html, render } from 'lit';
|
|
21
|
-
import '../dist/src/tuix-text/TuixText.js';
|
|
22
|
-
import { TextSize, TextColor, TextType } from '../dist/src/enums/tuix-text.enums.js'
|
|
23
|
-
|
|
24
|
-
render(
|
|
25
|
-
html`
|
|
26
|
-
<tuix-text size="${TextSize.XL}" color="${TextColor.Primary}" type="${TextType.Headline}">
|
|
27
|
-
Hello World
|
|
28
|
-
</tuix-text>
|
|
29
|
-
`,
|
|
30
|
-
document.querySelector('#demo')
|
|
31
|
-
);
|
|
32
|
-
</script>
|
|
33
|
-
</body>
|
|
34
|
-
|
|
35
|
-
</html>
|
package/dist/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 tuix-webcomponents
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/README.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# \<tuix-webcomponents>
|
|
2
|
-
|
|
3
|
-
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm i tuix-webcomponents
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<script type="module">
|
|
15
|
-
import 'tuix-webcomponents/tuix-webcomponents.js';
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<tuix-webcomponents></tuix-webcomponents>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Linting and formatting
|
|
22
|
-
|
|
23
|
-
To scan the project for linting and formatting errors, run
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm run lint
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
To automatically fix linting and formatting errors, run
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm run format
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Demoing with Storybook
|
|
36
|
-
|
|
37
|
-
To run a local instance of Storybook for your component, run
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm run storybook
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
To build a production version of Storybook, run
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm run storybook:build
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## Tooling configs
|
|
51
|
-
|
|
52
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
53
|
-
|
|
54
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
55
|
-
|
|
56
|
-
## Local Demo with `web-dev-server`
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
npm start
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
To run a local development server that serves the basic demo located in `demo/index.html`
|
package/dist/package.json
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tuix-webcomponents",
|
|
3
|
-
"description": "Webcomponent tuix-webcomponents following open-wc recommendations",
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"author": "tuix-webcomponents",
|
|
6
|
-
"version": "0.0.11",
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"main": "dist/src/index.js",
|
|
9
|
-
"module": "dist/src/index.js",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": "./dist/src/index.js",
|
|
12
|
-
"./tuix-webcomponents.js": "./dist/src/tuix-webcomponents.js"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"prepare": "husky install",
|
|
16
|
-
"analyze": "cem analyze --litelement",
|
|
17
|
-
"start": "rm -rf dist && tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
18
|
-
"build": "./bin/build.sh && npm run analyze -- --exclude dist",
|
|
19
|
-
"prepublish": "tsc && npm run analyze -- --exclude dist",
|
|
20
|
-
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
21
|
-
"format": "prettier --write \"src/**/*.ts\" \"stories/**/*.ts\"",
|
|
22
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"stories/**/*.ts\"",
|
|
23
|
-
"storybook": "rm -rf dist && tsc && npm run analyze -- --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
|
|
24
|
-
"storybook:build": "rm -rf dist && tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@commitlint/cli": "^17.6.1",
|
|
28
|
-
"@commitlint/config-conventional": "^17.6.1",
|
|
29
|
-
"@custom-elements-manifest/analyzer": "^0.8.0",
|
|
30
|
-
"@open-wc/eslint-config": "^10.0.0",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
32
|
-
"@typescript-eslint/parser": "^5.59.0",
|
|
33
|
-
"@web/dev-server": "^0.1.38",
|
|
34
|
-
"@web/dev-server-storybook": "^0.6.2",
|
|
35
|
-
"commitlint": "^17.6.1",
|
|
36
|
-
"concurrently": "^8.0.1",
|
|
37
|
-
"eslint": "^8.38.0",
|
|
38
|
-
"eslint-config-prettier": "^8.8.0",
|
|
39
|
-
"husky": "^8.0.3",
|
|
40
|
-
"lint-staged": "^13.2.1",
|
|
41
|
-
"prettier": "^2.8.7",
|
|
42
|
-
"tslib": "^2.5.0",
|
|
43
|
-
"typescript": "^5.0.4"
|
|
44
|
-
},
|
|
45
|
-
"customElements": "custom-elements.json",
|
|
46
|
-
"eslintConfig": {
|
|
47
|
-
"parser": "@typescript-eslint/parser",
|
|
48
|
-
"extends": [
|
|
49
|
-
"@open-wc",
|
|
50
|
-
"prettier"
|
|
51
|
-
],
|
|
52
|
-
"plugins": [
|
|
53
|
-
"@typescript-eslint"
|
|
54
|
-
],
|
|
55
|
-
"rules": {
|
|
56
|
-
"no-unused-vars": "off",
|
|
57
|
-
"@typescript-eslint/no-unused-vars": [
|
|
58
|
-
"error"
|
|
59
|
-
],
|
|
60
|
-
"import/no-unresolved": "off",
|
|
61
|
-
"import/extensions": [
|
|
62
|
-
"error",
|
|
63
|
-
"always",
|
|
64
|
-
{
|
|
65
|
-
"ignorePackages": true
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"prettier": {
|
|
71
|
-
"singleQuote": true,
|
|
72
|
-
"arrowParens": "avoid"
|
|
73
|
-
},
|
|
74
|
-
"husky": {
|
|
75
|
-
"hooks": {
|
|
76
|
-
"pre-commit": "lint-staged"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"lint-staged": {
|
|
80
|
-
"*.{ts,tsx}": [
|
|
81
|
-
"npm run format",
|
|
82
|
-
"npm run lint"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"commitlint": {
|
|
86
|
-
"extends": [
|
|
87
|
-
"@commitlint/config-conventional"
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
"dependencies": {
|
|
91
|
-
"lit": "^2.7.2"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
export enum TextSize {
|
|
3
|
-
XL = 'xl',
|
|
4
|
-
L = 'l',
|
|
5
|
-
M = 'm',
|
|
6
|
-
S = 's',
|
|
7
|
-
XS = 'xs',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export enum TextColor {
|
|
11
|
-
Primary = 'primary',
|
|
12
|
-
Secondary = 'secondary',
|
|
13
|
-
Grey = 'grey',
|
|
14
|
-
LightGrey = 'lightGrey',
|
|
15
|
-
Disabled = 'disabled',
|
|
16
|
-
Validation = 'validation',
|
|
17
|
-
Error = 'error',
|
|
18
|
-
Success = 'success',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export enum TextType {
|
|
22
|
-
Headline = 'headline',
|
|
23
|
-
Body = 'body',
|
|
24
|
-
Button = 'button_link',
|
|
25
|
-
Link = 'button_link',
|
|
26
|
-
Fields = 'fields',
|
|
27
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TuixText } from './tuix-text/TuixText.js';
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { html, css, LitElement } from 'lit';
|
|
2
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import { TextType, TextColor, TextSize } from '../enums/tuix-text.enums.js';
|
|
5
|
-
import { ColorText } from '../utils/colors.js';
|
|
6
|
-
|
|
7
|
-
@customElement('tuix-text')
|
|
8
|
-
export class TuixText extends LitElement {
|
|
9
|
-
@property({ type: String })
|
|
10
|
-
size?: TextSize;
|
|
11
|
-
|
|
12
|
-
@property({ type: TextColor })
|
|
13
|
-
color?: TextColor;
|
|
14
|
-
|
|
15
|
-
@property({ type: TextType })
|
|
16
|
-
type?: TextType;
|
|
17
|
-
|
|
18
|
-
static styles = css`
|
|
19
|
-
.text {
|
|
20
|
-
font-family: 'Rubik', sans-serif;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.text.headline.xl {
|
|
24
|
-
font-size: 4rem;
|
|
25
|
-
font-weight: 600;
|
|
26
|
-
line-height: 4.4rem;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.text.headline.l {
|
|
30
|
-
font-size: 3.5rem;
|
|
31
|
-
font-weight: 600;
|
|
32
|
-
line-height: 4.2rem;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.text.headline.m {
|
|
36
|
-
font-size: 2.25rem;
|
|
37
|
-
font-weight: 500;
|
|
38
|
-
line-height: 2.7rem;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.text.headline.s {
|
|
42
|
-
font-size: 1.5rem;
|
|
43
|
-
font-weight: 500;
|
|
44
|
-
line-height: 1.8rem;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.text.headline.xs {
|
|
48
|
-
font-size: 1.125rem;
|
|
49
|
-
font-weight: 500;
|
|
50
|
-
line-height: 1.35;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.text.body.m {
|
|
54
|
-
font-size: 1rem;
|
|
55
|
-
font-weight: 300;
|
|
56
|
-
line-height: 1.4rem;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.text.body.s {
|
|
60
|
-
font-size: 0.875rem;
|
|
61
|
-
font-weight: 300;
|
|
62
|
-
line-height: 1.225rem;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.text.button_link.xl {
|
|
66
|
-
font-size: 1.25rem;
|
|
67
|
-
font-weight: 400;
|
|
68
|
-
line-height: 1.5rem;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.text.button_link.l {
|
|
72
|
-
font-size: 1.25rem;
|
|
73
|
-
font-weight: 400;
|
|
74
|
-
line-height: 1.5rem;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@media only screen and (max-width: 40rem) {
|
|
78
|
-
.text.button_link.m {
|
|
79
|
-
font-size: 1rem;
|
|
80
|
-
font-weight: 400;
|
|
81
|
-
line-height: 1.25rem;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.text.body.m {
|
|
85
|
-
line-height: 1.3rem;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.text.body.s {
|
|
89
|
-
line-height: 1.1375rem;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.text.headline.xl {
|
|
93
|
-
font-size: 3rem;
|
|
94
|
-
line-height: 3.3rem;
|
|
95
|
-
}
|
|
96
|
-
.text.headline.l {
|
|
97
|
-
font-size: 2rem;
|
|
98
|
-
line-height: 2.4rem;
|
|
99
|
-
}
|
|
100
|
-
.text.headline.m {
|
|
101
|
-
font-size: 1.5rem;
|
|
102
|
-
line-height: 1.8rem;
|
|
103
|
-
}
|
|
104
|
-
.text.headline.s {
|
|
105
|
-
font-size: 1.125rem;
|
|
106
|
-
line-height: 1.35rem;
|
|
107
|
-
}
|
|
108
|
-
.text.headline.xs {
|
|
109
|
-
font-size: 1rem;
|
|
110
|
-
line-height: 1.2rem;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
@media only screen and (max-width: 20rem) {
|
|
115
|
-
.text.button_link.s {
|
|
116
|
-
font-size: 0.875rem;
|
|
117
|
-
font-weight: 400;
|
|
118
|
-
line-height: 1rem;
|
|
119
|
-
}
|
|
120
|
-
.text.button_link.xs {
|
|
121
|
-
font-size: 0.875rem;
|
|
122
|
-
font-weight: 400;
|
|
123
|
-
line-height: 1rem;
|
|
124
|
-
}
|
|
125
|
-
.text.headline.xl {
|
|
126
|
-
font-size: 1.5rem;
|
|
127
|
-
line-height: 1.8rem;
|
|
128
|
-
}
|
|
129
|
-
.text.headline.l {
|
|
130
|
-
font-size: 1.375rem;
|
|
131
|
-
line-height: 1.65rem;
|
|
132
|
-
}
|
|
133
|
-
.text.headline.m {
|
|
134
|
-
font-size: 1.25rem;
|
|
135
|
-
line-height: 1.5rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
`;
|
|
139
|
-
|
|
140
|
-
getTextClass() {
|
|
141
|
-
return `${this.type} ${this.size}`;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
render() {
|
|
145
|
-
return html`<slot
|
|
146
|
-
class="text ${this.getTextClass()}"
|
|
147
|
-
style="${styleMap({ color: ColorText[this.color || TextColor.Primary] })}"
|
|
148
|
-
></slot>`;
|
|
149
|
-
}
|
|
150
|
-
}
|