@3t-transform/threeteeui 0.0.7 → 0.0.8
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/{index-253ca97c.js → index-8a4cb9bc.js} +26 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +1 -1
- package/dist/cjs/tttx-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/tttx-form.cjs.entry.js +1 -1
- package/dist/cjs/tttx-icon.cjs.entry.js +1861 -0
- package/dist/cjs/tttx-input.cjs.entry.js +44 -0
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +26 -0
- package/dist/cjs/tttx-popover-content.cjs.entry.js +23 -0
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +1 -4
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +101 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +114 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +47 -0
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +48 -0
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +66 -0
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +15 -0
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.css +30 -0
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +96 -0
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +23 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +1 -4
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +18 -22
- package/dist/collection/components/{atoms/tttx-text-box/tttx-text-box.css → molecules/tttx-input/tttx-input.css} +11 -4
- package/dist/collection/components/{atoms/tttx-single-input/tttx-single-input.js → molecules/tttx-input/tttx-input.js} +5 -5
- package/dist/collection/components/molecules/tttx-input/tttx-input.stories.js +106 -0
- package/dist/collection/components/palette.stories.js +88 -0
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +4 -2
- package/dist/components/tttx-checkbox.js +1 -1
- package/dist/components/{tttx-text-box.d.ts → tttx-icon.d.ts} +4 -4
- package/dist/components/tttx-icon.js +6 -0
- package/dist/components/tttx-icon2.js +1875 -0
- package/dist/components/{tttx-single-input.d.ts → tttx-input.d.ts} +4 -4
- package/dist/components/tttx-input.js +77 -0
- package/dist/components/tttx-loading-spinner.d.ts +11 -0
- package/dist/components/tttx-loading-spinner.js +43 -0
- package/dist/components/tttx-popover-content.d.ts +11 -0
- package/dist/components/tttx-popover-content.js +42 -0
- package/dist/esm/{index-fcca6c58.js → index-9654537d.js} +26 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/tttx-button.entry.js +1 -1
- package/dist/esm/tttx-checkbox.entry.js +2 -2
- package/dist/esm/tttx-form.entry.js +1 -1
- package/dist/esm/tttx-icon.entry.js +1857 -0
- package/dist/esm/tttx-input.entry.js +40 -0
- package/dist/esm/tttx-loading-spinner.entry.js +22 -0
- package/dist/esm/tttx-popover-content.entry.js +19 -0
- package/dist/esm/tttx.js +3 -3
- package/dist/tttx/p-1884203f.entry.js +1 -0
- package/dist/tttx/p-317b13d3.entry.js +1 -0
- package/dist/tttx/{p-8d1f2e5c.entry.js → p-3cb692d6.entry.js} +1 -1
- package/dist/tttx/p-3cd7ad04.entry.js +1 -0
- package/dist/tttx/p-674e2f18.entry.js +1 -0
- package/dist/tttx/p-a23389f1.entry.js +1 -0
- package/dist/tttx/p-b6cc2780.js +2 -0
- package/dist/tttx/{p-40709c59.entry.js → p-f30a0e84.entry.js} +1 -1
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +14 -0
- package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +21 -0
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -0
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +5 -0
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +7 -0
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +18 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +12 -5
- package/dist/types/components/{atoms/tttx-single-input/tttx-single-input.d.ts → molecules/tttx-input/tttx-input.d.ts} +1 -1
- package/dist/types/components/molecules/tttx-input/tttx-input.stories.d.ts +60 -0
- package/dist/types/components.d.ts +63 -36
- package/package.json +67 -58
- package/readme.md +14 -27
- package/dist/cjs/tttx-single-input.cjs.entry.js +0 -44
- package/dist/cjs/tttx-text-box.cjs.entry.js +0 -38
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.css +0 -142
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.stories.js +0 -92
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.js +0 -150
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.stories.js +0 -17
- package/dist/collection/docs/template.stories.js +0 -10
- package/dist/components/tttx-single-input.js +0 -71
- package/dist/components/tttx-text-box.js +0 -59
- package/dist/esm/tttx-single-input.entry.js +0 -40
- package/dist/esm/tttx-text-box.entry.js +0 -34
- package/dist/tttx/p-05d7d002.entry.js +0 -1
- package/dist/tttx/p-64703252.entry.js +0 -1
- package/dist/tttx/p-9bf836ed.entry.js +0 -1
- package/dist/tttx/p-a7b95fd2.js +0 -2
- package/dist/types/components/atoms/tttx-single-input/tttx-single-input.stories.d.ts +0 -27
- package/dist/types/components/atoms/tttx-text-box/tttx-text-box.d.ts +0 -14
- package/dist/types/docs/template.stories.d.ts +0 -5
- /package/dist/types/components/{atoms/tttx-text-box/tttx-text-box.stories.d.ts → palette.stories.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,58 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@3t-transform/threeteeui",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "3t Design System",
|
|
5
|
-
"main": "dist/index.cjs.js",
|
|
6
|
-
"module": "dist/index.js",
|
|
7
|
-
"es2015": "dist/esm/index.mjs",
|
|
8
|
-
"es2017": "dist/esm/index.mjs",
|
|
9
|
-
"types": "dist/types/index.d.ts",
|
|
10
|
-
"collection": "dist/collection/collection-manifest.json",
|
|
11
|
-
"collection:main": "dist/collection/index.js",
|
|
12
|
-
"unpkg": "dist/3tui/3tui.esm.js",
|
|
13
|
-
"files": [
|
|
14
|
-
"dist/",
|
|
15
|
-
"loader/"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "stencil build --docs",
|
|
19
|
-
"start": "stencil build --watch --serve",
|
|
20
|
-
"test": "stencil test --spec --e2e",
|
|
21
|
-
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
22
|
-
"generate": "stencil generate",
|
|
23
|
-
"storybook": "
|
|
24
|
-
"build-storybook": "build
|
|
25
|
-
"chromatic": "npx chromatic --project-token=531b962b0be5 --exit-zero-on-changes --exit-once-uploaded"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"@
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@storybook/
|
|
39
|
-
"@storybook/
|
|
40
|
-
"@storybook/
|
|
41
|
-
"@storybook/
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@3t-transform/threeteeui",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "3t Design System",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"es2015": "dist/esm/index.mjs",
|
|
8
|
+
"es2017": "dist/esm/index.mjs",
|
|
9
|
+
"types": "dist/types/index.d.ts",
|
|
10
|
+
"collection": "dist/collection/collection-manifest.json",
|
|
11
|
+
"collection:main": "dist/collection/index.js",
|
|
12
|
+
"unpkg": "dist/3tui/3tui.esm.js",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/",
|
|
15
|
+
"loader/"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "stencil build --docs",
|
|
19
|
+
"start": "stencil build --watch --serve",
|
|
20
|
+
"test": "stencil test --spec --e2e",
|
|
21
|
+
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
22
|
+
"generate": "stencil generate",
|
|
23
|
+
"storybook": "storybook dev -p 6006",
|
|
24
|
+
"build-storybook": "storybook build",
|
|
25
|
+
"chromatic": "npx chromatic --project-token=531b962b0be5 --exit-zero-on-changes --exit-once-uploaded",
|
|
26
|
+
"lint:generate": "eslint --ext .tsx -o output.eslint.json -f json"
|
|
27
|
+
},
|
|
28
|
+
"resolutions": {
|
|
29
|
+
"@types/babel__traverse": "7.0.6"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@babel/core": "^7.18.10",
|
|
33
|
+
"@babel/preset-env": "^7.21.4",
|
|
34
|
+
"@mdx-js/react": "^2.1.5",
|
|
35
|
+
"@rollup/plugin-commonjs": "^23.0.3",
|
|
36
|
+
"@stencil/core": "^2.20.0",
|
|
37
|
+
"@stencil/sass": "^1.5.2",
|
|
38
|
+
"@storybook/addon-actions": "^7.0.6",
|
|
39
|
+
"@storybook/addon-essentials": "^7.0.6",
|
|
40
|
+
"@storybook/addon-interactions": "^7.0.6",
|
|
41
|
+
"@storybook/addon-links": "^7.0.6",
|
|
42
|
+
"@storybook/addon-mdx-gfm": "^7.0.6",
|
|
43
|
+
"@storybook/html": "^7.0.6",
|
|
44
|
+
"@storybook/html-webpack5": "^7.0.6",
|
|
45
|
+
"@storybook/testing-library": "^0.1.0",
|
|
46
|
+
"@storybook/web-components": "^7.0.6",
|
|
47
|
+
"@types/jest": "^27.0.3",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
49
|
+
"@typescript-eslint/parser": "^5.59.0",
|
|
50
|
+
"chromatic": "^6.7.4",
|
|
51
|
+
"eslint": "^8.38.0",
|
|
52
|
+
"jest": "^27.4.5",
|
|
53
|
+
"jest-cli": "^27.4.5",
|
|
54
|
+
"less": "^4.1.3",
|
|
55
|
+
"lit-html": "^2.7.0",
|
|
56
|
+
"puppeteer": "^10.0.0",
|
|
57
|
+
"react": "^18.2.0",
|
|
58
|
+
"react-dom": "^18.2.0",
|
|
59
|
+
"sass": "^1.56.1"
|
|
60
|
+
},
|
|
61
|
+
"license": "UNLICENSED",
|
|
62
|
+
"readme": "ERROR: No README data found!",
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@popperjs/core": "^2.11.7",
|
|
65
|
+
"storybook": "^7.0.6"
|
|
66
|
+
}
|
|
67
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,30 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
## Stencil Component Starter
|
|
16
|
-
|
|
17
|
-
This is a starter project for building a standalone Web Component using Stencil.
|
|
18
|
-
|
|
19
|
-
Stencil is also great for building entire apps. For that, use the [stencil-app-starter](https://github.com/ionic-team/stencil-app-starter) instead.
|
|
20
|
-
|
|
21
|
-
## Stencil
|
|
22
|
-
|
|
23
|
-
Stencil is a compiler for building fast web apps using Web Components.
|
|
24
|
-
|
|
25
|
-
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
|
|
26
|
-
|
|
27
|
-
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
|
|
1
|
+
## TTTX Library Vision
|
|
2
|
+
|
|
3
|
+
- To create versioned components where each micro-frontend may use any version it chooses.
|
|
4
|
+
- Why? - Our root frontend contains many micro-frontends. Each one might have a diffrent version of these components loaded at any time. We must not let a change in one MFE affect another MFE loaded at the same time.
|
|
5
|
+
- To keep the components extremely lightweight, use as few dependencies as possible. Keep the individual components in the low KB, not the MB.
|
|
6
|
+
- Why? - When there are multiple versions of the same component loaded, we need to keep them extremely lightweight. Most simple components can be executed in a few dozen KB.
|
|
7
|
+
- No CSS frameworks. Use only the minimum styles to get the job done.
|
|
8
|
+
- Why? - This means we can be sure that we only load code we are actually using.
|
|
9
|
+
- No external styles. A component must style itself and be inside a shadow DOM so that styles from the external application cannot leak inside.
|
|
10
|
+
- Why? - We cannot have any components being affected by the styles of the surrunding application. The component must be entirely self-contained.
|
|
11
|
+
- No leaking styles. A component must not infect the application with its styles.
|
|
12
|
+
- Why? - The same goes both ways, the component styles must not affect the surrounding application.
|
|
13
|
+
- Create only components as we need them. YAGNI applies.
|
|
14
|
+
- Why? - It's about Agile. We need to deliver value to the customer (our develoeprs) as soon as possible for their feedback, and so they can deliver value to their customer (our users). If a certain component is required, it will crop up, and then we will make it.
|
|
28
15
|
|
|
29
16
|
## Getting Started
|
|
30
17
|
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-253ca97c.js');
|
|
6
|
-
|
|
7
|
-
const tttxSingleInputCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\";font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.field{clear:both}.container{display:flex;flex-wrap:wrap;box-sizing:border-box;height:36px;border:1px solid #c8c8c8;border-radius:4px}.icon-left,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.input{flex-grow:1;border:none;outline:none;font-size:16px;padding:8px 16px;background-color:transparent}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.label{display:block;font-size:16px;height:18px;font-weight:600;color:#212121;font-size:16px;margin-bottom:4px;z-index:1}.disabled{background:#f0f0f0;color:#9e9e9e;border-color:#c8c8c8}.focused{border-color:#1479c6}.errormsg{height:16px;display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;color:white;border-radius:none;z-index:2;color:#DC0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#DC0000}.danger{color:#DC0000}.optional{color:#757575;font-weight:normal}:host{display:block}.spacing{margin-bottom:16px}.errorstate{border-color:#DC0000}";
|
|
8
|
-
|
|
9
|
-
const TttxSingleInput = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
13
|
-
this.handleFocus = () => {
|
|
14
|
-
this.isfocused = true;
|
|
15
|
-
};
|
|
16
|
-
this.handleBlur = () => {
|
|
17
|
-
this.isfocused = false;
|
|
18
|
-
};
|
|
19
|
-
this.isfocused = false;
|
|
20
|
-
this.label = undefined;
|
|
21
|
-
this.valid = undefined;
|
|
22
|
-
this.showerrormsg = undefined;
|
|
23
|
-
this.errormsg = undefined;
|
|
24
|
-
this.value = undefined;
|
|
25
|
-
this.type = 'text';
|
|
26
|
-
this.placeholder = undefined;
|
|
27
|
-
this.pattern = undefined;
|
|
28
|
-
this.iconleft = undefined;
|
|
29
|
-
this.iconright = undefined;
|
|
30
|
-
this.required = undefined;
|
|
31
|
-
}
|
|
32
|
-
handleChange(event) {
|
|
33
|
-
const target = event.target;
|
|
34
|
-
this.value = target.value;
|
|
35
|
-
this.valueChanged.emit(target.value);
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : '', this.iconleft ? 'iconleft' : ''].join(' ');
|
|
39
|
-
return (index.h(index.Host, null, index.h("div", { class: "field spacing" }, this.label && index.h("label", { class: "label" }, this.label, !this.required ? index.h("span", { class: "optional" }, " (optional)") : ''), index.h("div", { class: inputClass }, this.iconleft && (index.h("div", { class: "icon-left" }, index.h("span", { class: "material-symbols-rounded" }, this.iconleft))), index.h("input", { class: "input", onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this), type: this.type, placeholder: this.placeholder, value: this.value, onInput: event => this.handleChange(event) }), this.iconright && (index.h("div", { class: "icon-right" }, index.h("span", { class: "material-symbols-rounded" }, this.iconright)))), this.showerrormsg && this.errormsg && index.h("div", { class: "errormsg" }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
TttxSingleInput.style = tttxSingleInputCss;
|
|
43
|
-
|
|
44
|
-
exports.tttx_single_input = TttxSingleInput;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-253ca97c.js');
|
|
6
|
-
|
|
7
|
-
const tttxTextBoxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\";font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.field{clear:both}.container{display:flex;flex-wrap:wrap;box-sizing:border-box;height:36px;border:1px solid #c8c8c8;border-radius:4px}.icon-left,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.input{flex-grow:1;border:none;outline:none;font-size:16px;padding:8px 16px;background-color:transparent}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.label{display:block;font-size:16px;height:18px;font-weight:600;color:#212121;font-size:16px;margin-bottom:4px;z-index:1}.disabled{background:#f0f0f0;color:#9e9e9e;border-color:#c8c8c8}.focused{border-color:#1479c6}.errormsg{height:16px;display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;color:white;border-radius:none;z-index:2;color:#DC0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#DC0000}.danger{color:#DC0000}.optional{color:#757575;font-weight:normal}:host{display:block}.spacing{margin-bottom:16px}.errorstate{border-color:#DC0000}";
|
|
8
|
-
|
|
9
|
-
const TttxTextBox = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
13
|
-
this.handleFocus = () => {
|
|
14
|
-
this.isfocused = true;
|
|
15
|
-
};
|
|
16
|
-
this.handleBlur = () => {
|
|
17
|
-
this.isfocused = false;
|
|
18
|
-
};
|
|
19
|
-
this.label = undefined;
|
|
20
|
-
this.showerrormsg = undefined;
|
|
21
|
-
this.errormsg = undefined;
|
|
22
|
-
this.required = undefined;
|
|
23
|
-
this.value = undefined;
|
|
24
|
-
this.isfocused = false;
|
|
25
|
-
}
|
|
26
|
-
handleChange(event) {
|
|
27
|
-
const target = event.target;
|
|
28
|
-
this.value = target.value;
|
|
29
|
-
this.valueChanged.emit(target.value);
|
|
30
|
-
}
|
|
31
|
-
render() {
|
|
32
|
-
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : ''].join(' ');
|
|
33
|
-
return (index.h(index.Host, null, index.h("div", { class: "field spacing" }, this.label && index.h("label", { class: "label" }, this.label, !this.required ? index.h("span", { class: "optional" }, " (optional)") : ''), index.h("div", { class: inputClass }, index.h("input", { class: "input", type: "text", value: this.value, required: this.required, onInput: event => this.handleChange(event), onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this) })), this.showerrormsg && this.errormsg && index.h("div", { class: "errormsg" }, this.errormsg))));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
TttxTextBox.style = tttxTextBoxCss;
|
|
37
|
-
|
|
38
|
-
exports.tttx_text_box = TttxTextBox;
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
.material-symbols-rounded {
|
|
2
|
-
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.material-symbols-rounded {
|
|
6
|
-
font-family: "Material Symbols Rounded";
|
|
7
|
-
font-weight: 400;
|
|
8
|
-
font-style: normal;
|
|
9
|
-
font-size: 24px;
|
|
10
|
-
line-height: 1;
|
|
11
|
-
letter-spacing: normal;
|
|
12
|
-
text-transform: none;
|
|
13
|
-
display: inline-block;
|
|
14
|
-
white-space: nowrap;
|
|
15
|
-
word-wrap: normal;
|
|
16
|
-
direction: ltr;
|
|
17
|
-
text-rendering: optimizeLegibility;
|
|
18
|
-
-webkit-font-smoothing: antialiased;
|
|
19
|
-
color: #9e9e9e;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.field {
|
|
23
|
-
clear: both;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.container {
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-wrap: wrap;
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
height: 36px;
|
|
31
|
-
border: 1px solid #c8c8c8;
|
|
32
|
-
border-radius: 4px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.icon-left,
|
|
36
|
-
.icon-right {
|
|
37
|
-
flex-basis: 24px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.icon-left span,
|
|
41
|
-
.icon-right span {
|
|
42
|
-
font-size: 24px;
|
|
43
|
-
line-height: 24px;
|
|
44
|
-
text-align: center;
|
|
45
|
-
display: block;
|
|
46
|
-
width: 24px;
|
|
47
|
-
height: 24px;
|
|
48
|
-
margin-top: 4px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.icon-left span {
|
|
52
|
-
margin-left: 4px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.icon-right span {
|
|
56
|
-
margin-right: 4px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.input {
|
|
60
|
-
flex-grow: 1;
|
|
61
|
-
border: none;
|
|
62
|
-
outline: none;
|
|
63
|
-
font-size: 16px;
|
|
64
|
-
padding: 8px 16px;
|
|
65
|
-
background-color: transparent;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.iconleft .input {
|
|
69
|
-
padding-left: 4px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.iconright .input {
|
|
73
|
-
padding-right: 4px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.label {
|
|
77
|
-
display: block;
|
|
78
|
-
font-size: 16px;
|
|
79
|
-
height: 18px;
|
|
80
|
-
font-weight: 600;
|
|
81
|
-
color: #212121;
|
|
82
|
-
font-size: 16px;
|
|
83
|
-
margin-bottom: 4px;
|
|
84
|
-
z-index: 1;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.disabled {
|
|
88
|
-
background: #f0f0f0;
|
|
89
|
-
color: #9e9e9e;
|
|
90
|
-
border-color: #c8c8c8;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.focused {
|
|
94
|
-
border-color: #1479c6;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.errormsg {
|
|
98
|
-
height: 16px;
|
|
99
|
-
display: flex;
|
|
100
|
-
justify-content: center;
|
|
101
|
-
align-items: center;
|
|
102
|
-
float: left;
|
|
103
|
-
margin-bottom: 16px;
|
|
104
|
-
box-sizing: border-box;
|
|
105
|
-
background-color: transparent;
|
|
106
|
-
height: 26px;
|
|
107
|
-
font-size: 14px;
|
|
108
|
-
color: white;
|
|
109
|
-
border-radius: none;
|
|
110
|
-
z-index: 2;
|
|
111
|
-
color: #DC0000;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.errormsg .validationicon {
|
|
115
|
-
width: 16px;
|
|
116
|
-
height: 16px;
|
|
117
|
-
font-size: 16px;
|
|
118
|
-
margin-right: 4px;
|
|
119
|
-
vertical-align: middle;
|
|
120
|
-
color: #DC0000;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.danger {
|
|
124
|
-
color: #DC0000;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.optional {
|
|
128
|
-
color: #757575;
|
|
129
|
-
font-weight: normal;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
:host {
|
|
133
|
-
display: block;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.spacing {
|
|
137
|
-
margin-bottom: 16px;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.errorstate {
|
|
141
|
-
border-color: #DC0000;
|
|
142
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import icons from './../../../icons';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Atoms/Single Input',
|
|
4
|
-
component: 'tttx-single-input',
|
|
5
|
-
argTypes: {
|
|
6
|
-
iconleft: {
|
|
7
|
-
options: icons,
|
|
8
|
-
control: { type: 'select' },
|
|
9
|
-
},
|
|
10
|
-
iconright: {
|
|
11
|
-
options: icons,
|
|
12
|
-
control: { type: 'select' },
|
|
13
|
-
},
|
|
14
|
-
type: {
|
|
15
|
-
options: ['text', 'password', 'email', 'number'],
|
|
16
|
-
control: { type: 'radio' },
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
const TemplateTest = ({ value, label, iconleft, iconright, type, required, errormsg, placeholder }) => `
|
|
21
|
-
<tttx-single-input
|
|
22
|
-
placeholder="${placeholder}"
|
|
23
|
-
iconleft="${iconleft}"
|
|
24
|
-
iconright="${iconright}"
|
|
25
|
-
value="${value}"
|
|
26
|
-
label="${label}"
|
|
27
|
-
type="${type}"
|
|
28
|
-
errormsg="${errormsg}"
|
|
29
|
-
${required ? `required` : ''}
|
|
30
|
-
></tttx-single-input>
|
|
31
|
-
`;
|
|
32
|
-
export const Default = TemplateTest.bind({});
|
|
33
|
-
Default.args = {
|
|
34
|
-
value: 'Uh egg',
|
|
35
|
-
label: 'Please tell me about your egg',
|
|
36
|
-
icon: 'egg',
|
|
37
|
-
type: 'text',
|
|
38
|
-
errormsg: 'Incorrect egg, please egg again.',
|
|
39
|
-
required: true,
|
|
40
|
-
valid: true,
|
|
41
|
-
placeholder: 'Please for the love of god tell me about your egg',
|
|
42
|
-
};
|
|
43
|
-
const TemplateMultiple = () => `
|
|
44
|
-
|
|
45
|
-
<tttx-single-input
|
|
46
|
-
iconleft="search"
|
|
47
|
-
iconright="clear"
|
|
48
|
-
placeholder="Search for your account"
|
|
49
|
-
label="Account number"
|
|
50
|
-
type="text"
|
|
51
|
-
errormsg="testing123"
|
|
52
|
-
showerrormsg
|
|
53
|
-
></tttx-single-input>
|
|
54
|
-
|
|
55
|
-
<tttx-single-input
|
|
56
|
-
placeholder="Enter first name"
|
|
57
|
-
label="First name"
|
|
58
|
-
type="text"
|
|
59
|
-
errormsg="Your first name is required"
|
|
60
|
-
required
|
|
61
|
-
showerrormsg
|
|
62
|
-
></tttx-single-input>
|
|
63
|
-
|
|
64
|
-
<tttx-single-input
|
|
65
|
-
placeholder="Enter last name"
|
|
66
|
-
label="Last name"
|
|
67
|
-
type="text"
|
|
68
|
-
errormsg="testing123"
|
|
69
|
-
required
|
|
70
|
-
showerrormsg
|
|
71
|
-
></tttx-single-input>
|
|
72
|
-
|
|
73
|
-
<tttx-single-input
|
|
74
|
-
placeholder="Enter date of birth"
|
|
75
|
-
label="Date of birth"
|
|
76
|
-
type="text"
|
|
77
|
-
errormsg="testing123"
|
|
78
|
-
required
|
|
79
|
-
showerrormsg
|
|
80
|
-
></tttx-single-input>
|
|
81
|
-
|
|
82
|
-
<tttx-single-input
|
|
83
|
-
placeholder="Enter email address"
|
|
84
|
-
label="Email address"
|
|
85
|
-
type="email"
|
|
86
|
-
errormsg="testing123"
|
|
87
|
-
required
|
|
88
|
-
showerrormsg
|
|
89
|
-
></tttx-single-input>
|
|
90
|
-
|
|
91
|
-
`;
|
|
92
|
-
export const Example = TemplateMultiple.bind({});
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { h, Host } from '@stencil/core';
|
|
2
|
-
export class TttxTextBox {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.handleFocus = () => {
|
|
5
|
-
this.isfocused = true;
|
|
6
|
-
};
|
|
7
|
-
this.handleBlur = () => {
|
|
8
|
-
this.isfocused = false;
|
|
9
|
-
};
|
|
10
|
-
this.label = undefined;
|
|
11
|
-
this.showerrormsg = undefined;
|
|
12
|
-
this.errormsg = undefined;
|
|
13
|
-
this.required = undefined;
|
|
14
|
-
this.value = undefined;
|
|
15
|
-
this.isfocused = false;
|
|
16
|
-
}
|
|
17
|
-
handleChange(event) {
|
|
18
|
-
const target = event.target;
|
|
19
|
-
this.value = target.value;
|
|
20
|
-
this.valueChanged.emit(target.value);
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : ''].join(' ');
|
|
24
|
-
return (h(Host, null, h("div", { class: "field spacing" }, this.label && h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : ''), h("div", { class: inputClass }, h("input", { class: "input", type: "text", value: this.value, required: this.required, onInput: event => this.handleChange(event), onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this) })), this.showerrormsg && this.errormsg && h("div", { class: "errormsg" }, this.errormsg))));
|
|
25
|
-
}
|
|
26
|
-
static get is() { return "tttx-text-box"; }
|
|
27
|
-
static get encapsulation() { return "shadow"; }
|
|
28
|
-
static get originalStyleUrls() {
|
|
29
|
-
return {
|
|
30
|
-
"$": ["tttx-text-box.scss"]
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
static get styleUrls() {
|
|
34
|
-
return {
|
|
35
|
-
"$": ["tttx-text-box.css"]
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
static get properties() {
|
|
39
|
-
return {
|
|
40
|
-
"label": {
|
|
41
|
-
"type": "string",
|
|
42
|
-
"mutable": false,
|
|
43
|
-
"complexType": {
|
|
44
|
-
"original": "string",
|
|
45
|
-
"resolved": "string",
|
|
46
|
-
"references": {}
|
|
47
|
-
},
|
|
48
|
-
"required": false,
|
|
49
|
-
"optional": false,
|
|
50
|
-
"docs": {
|
|
51
|
-
"tags": [],
|
|
52
|
-
"text": ""
|
|
53
|
-
},
|
|
54
|
-
"attribute": "label",
|
|
55
|
-
"reflect": false
|
|
56
|
-
},
|
|
57
|
-
"showerrormsg": {
|
|
58
|
-
"type": "boolean",
|
|
59
|
-
"mutable": false,
|
|
60
|
-
"complexType": {
|
|
61
|
-
"original": "boolean",
|
|
62
|
-
"resolved": "boolean",
|
|
63
|
-
"references": {}
|
|
64
|
-
},
|
|
65
|
-
"required": false,
|
|
66
|
-
"optional": false,
|
|
67
|
-
"docs": {
|
|
68
|
-
"tags": [],
|
|
69
|
-
"text": ""
|
|
70
|
-
},
|
|
71
|
-
"attribute": "showerrormsg",
|
|
72
|
-
"reflect": false
|
|
73
|
-
},
|
|
74
|
-
"errormsg": {
|
|
75
|
-
"type": "string",
|
|
76
|
-
"mutable": false,
|
|
77
|
-
"complexType": {
|
|
78
|
-
"original": "string",
|
|
79
|
-
"resolved": "string",
|
|
80
|
-
"references": {}
|
|
81
|
-
},
|
|
82
|
-
"required": false,
|
|
83
|
-
"optional": false,
|
|
84
|
-
"docs": {
|
|
85
|
-
"tags": [],
|
|
86
|
-
"text": ""
|
|
87
|
-
},
|
|
88
|
-
"attribute": "errormsg",
|
|
89
|
-
"reflect": false
|
|
90
|
-
},
|
|
91
|
-
"required": {
|
|
92
|
-
"type": "boolean",
|
|
93
|
-
"mutable": false,
|
|
94
|
-
"complexType": {
|
|
95
|
-
"original": "boolean",
|
|
96
|
-
"resolved": "boolean",
|
|
97
|
-
"references": {}
|
|
98
|
-
},
|
|
99
|
-
"required": false,
|
|
100
|
-
"optional": false,
|
|
101
|
-
"docs": {
|
|
102
|
-
"tags": [],
|
|
103
|
-
"text": ""
|
|
104
|
-
},
|
|
105
|
-
"attribute": "required",
|
|
106
|
-
"reflect": false
|
|
107
|
-
},
|
|
108
|
-
"value": {
|
|
109
|
-
"type": "string",
|
|
110
|
-
"mutable": true,
|
|
111
|
-
"complexType": {
|
|
112
|
-
"original": "string",
|
|
113
|
-
"resolved": "string",
|
|
114
|
-
"references": {}
|
|
115
|
-
},
|
|
116
|
-
"required": false,
|
|
117
|
-
"optional": false,
|
|
118
|
-
"docs": {
|
|
119
|
-
"tags": [],
|
|
120
|
-
"text": ""
|
|
121
|
-
},
|
|
122
|
-
"attribute": "value",
|
|
123
|
-
"reflect": false
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
static get states() {
|
|
128
|
-
return {
|
|
129
|
-
"isfocused": {}
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
static get events() {
|
|
133
|
-
return [{
|
|
134
|
-
"method": "valueChanged",
|
|
135
|
-
"name": "valueChanged",
|
|
136
|
-
"bubbles": true,
|
|
137
|
-
"cancelable": true,
|
|
138
|
-
"composed": true,
|
|
139
|
-
"docs": {
|
|
140
|
-
"tags": [],
|
|
141
|
-
"text": ""
|
|
142
|
-
},
|
|
143
|
-
"complexType": {
|
|
144
|
-
"original": "string",
|
|
145
|
-
"resolved": "string",
|
|
146
|
-
"references": {}
|
|
147
|
-
}
|
|
148
|
-
}];
|
|
149
|
-
}
|
|
150
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
title: 'Atoms/Text Box',
|
|
3
|
-
component: 'tttx-text-box'
|
|
4
|
-
};
|
|
5
|
-
const TemplateTest = ({ label, errormsg, required }) => `
|
|
6
|
-
<tttx-text-box
|
|
7
|
-
label="${label}"
|
|
8
|
-
errormsg="${errormsg}"
|
|
9
|
-
${required ? `required` : ''}
|
|
10
|
-
></tttx-text-box>
|
|
11
|
-
`;
|
|
12
|
-
export const Default = TemplateTest.bind({});
|
|
13
|
-
Default.args = {
|
|
14
|
-
label: 'Input Label',
|
|
15
|
-
errormsg: 'Field is required',
|
|
16
|
-
required: true
|
|
17
|
-
};
|