@3t-transform/threeteeui 0.0.10 → 0.0.11

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 (78) hide show
  1. package/dist/cjs/{index-8a4cb9bc.js → index-bf39be87.js} +41 -0
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/tttx-button.cjs.entry.js +2 -2
  4. package/dist/cjs/tttx-checkbox.cjs.entry.js +3 -3
  5. package/dist/cjs/tttx-form.cjs.entry.js +169 -41
  6. package/dist/cjs/tttx-icon.cjs.entry.js +2 -2
  7. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +4 -4
  8. package/dist/cjs/tttx-popover-content.cjs.entry.js +2 -2
  9. package/dist/cjs/tttx-standalone-input.cjs.entry.js +134 -0
  10. package/dist/cjs/tttx.cjs.js +2 -2
  11. package/dist/collection/collection-manifest.json +2 -2
  12. package/dist/collection/components/atoms/tttx-button/tttx-button.css +1 -0
  13. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +3 -3
  14. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +3 -3
  15. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +15 -15
  16. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +1 -1
  17. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +2 -2
  18. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +1 -1
  19. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +1 -1
  20. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +3 -3
  21. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +85 -39
  22. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +1 -1
  23. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +5 -5
  24. package/dist/collection/components/molecules/tttx-form/tttx-form.css +230 -0
  25. package/dist/collection/components/molecules/tttx-form/tttx-form.js +195 -55
  26. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +97 -28
  27. package/dist/collection/components/molecules/{tttx-input/tttx-input.css → tttx-standalone-input/tttx-standalone-input.css} +77 -49
  28. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +561 -0
  29. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +156 -0
  30. package/dist/collection/components/palette.stories.js +81 -81
  31. package/dist/collection/docs/gettingstarted-developer.stories.js +4 -4
  32. package/dist/components/index.d.ts +1 -1
  33. package/dist/components/index.js +1 -1
  34. package/dist/components/tttx-button.js +1 -1
  35. package/dist/components/tttx-checkbox.js +2 -2
  36. package/dist/components/tttx-form.js +167 -39
  37. package/dist/components/tttx-icon2.js +1 -1
  38. package/dist/components/tttx-loading-spinner.js +3 -3
  39. package/dist/components/tttx-popover-content.js +1 -1
  40. package/dist/components/{tttx-input.d.ts → tttx-standalone-input.d.ts} +4 -4
  41. package/dist/components/tttx-standalone-input.js +178 -0
  42. package/dist/esm/{index-9654537d.js → index-63c4d25e.js} +41 -0
  43. package/dist/esm/loader.js +3 -3
  44. package/dist/esm/tttx-button.entry.js +2 -2
  45. package/dist/esm/tttx-checkbox.entry.js +3 -3
  46. package/dist/esm/tttx-form.entry.js +169 -41
  47. package/dist/esm/tttx-icon.entry.js +2 -2
  48. package/dist/esm/tttx-loading-spinner.entry.js +4 -4
  49. package/dist/esm/tttx-popover-content.entry.js +2 -2
  50. package/dist/esm/tttx-standalone-input.entry.js +130 -0
  51. package/dist/esm/tttx.js +3 -3
  52. package/dist/tttx/{p-3cb692d6.entry.js → p-1a4eb1f3.entry.js} +1 -1
  53. package/dist/tttx/p-2d54f8aa.entry.js +1 -0
  54. package/dist/tttx/p-338b3976.entry.js +1 -0
  55. package/dist/tttx/{p-674e2f18.entry.js → p-4c57bcbd.entry.js} +1 -1
  56. package/dist/tttx/{p-f4855113.entry.js → p-709246f5.entry.js} +1 -1
  57. package/dist/tttx/p-95a29e09.entry.js +1 -0
  58. package/dist/tttx/{p-1884203f.entry.js → p-ad0c3fe4.entry.js} +1 -1
  59. package/dist/tttx/p-bec472d8.js +2 -0
  60. package/dist/tttx/tttx.esm.js +1 -1
  61. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +14 -7
  62. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +1 -8
  63. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -0
  64. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -0
  65. package/dist/types/components.d.ts +66 -41
  66. package/package.json +67 -65
  67. package/readme.md +89 -86
  68. package/dist/cjs/tttx-input.cjs.entry.js +0 -44
  69. package/dist/collection/components/molecules/tttx-input/tttx-input.js +0 -259
  70. package/dist/collection/components/molecules/tttx-input/tttx-input.stories.js +0 -106
  71. package/dist/components/tttx-input.js +0 -77
  72. package/dist/esm/tttx-input.entry.js +0 -40
  73. package/dist/tttx/p-317b13d3.entry.js +0 -1
  74. package/dist/tttx/p-3cd7ad04.entry.js +0 -1
  75. package/dist/tttx/p-b6cc2780.js +0 -2
  76. package/dist/tttx/p-f30a0e84.entry.js +0 -1
  77. package/dist/types/components/molecules/tttx-input/tttx-input.d.ts +0 -20
  78. package/dist/types/components/molecules/tttx-input/tttx-input.stories.d.ts +0 -60
@@ -5,6 +5,7 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { MinMaxDates } from "./components/molecules/tttx-standalone-input/tttx-standalone-input";
8
9
  export namespace Components {
9
10
  interface TttxButton {
10
11
  "buttonStyle": string;
@@ -16,35 +17,47 @@ export namespace Components {
16
17
  "value": boolean;
17
18
  }
18
19
  interface TttxForm {
19
- "dataAttribute": string;
20
- "functionAttribute": string;
20
+ "formschema": any;
21
+ "submitValue": any;
21
22
  }
22
23
  interface TttxIcon {
23
24
  "colour": string;
24
25
  "icon": string;
25
26
  }
26
- interface TttxInput {
27
+ interface TttxLoadingSpinner {
28
+ "loadingMessage": boolean;
29
+ "size": 'small' | 'large';
30
+ }
31
+ interface TttxPopoverContent {
32
+ "body": string;
33
+ "header": string;
34
+ "linkcontext": string;
35
+ "linktext": string;
36
+ }
37
+ interface TttxStandaloneInput {
38
+ "autocapitalize": string;
39
+ "autocomplete": 'off' | 'on';
40
+ "autofocus": boolean;
41
+ "checked": boolean;
42
+ "disabled": boolean;
27
43
  "errormsg": string;
28
44
  "iconleft": string;
29
45
  "iconright": string;
30
46
  "label": string;
47
+ "max": MinMaxDates | number;
48
+ "maxlength": string | number;
49
+ "min": MinMaxDates | number;
50
+ "minlength": string | number;
51
+ "name": string;
31
52
  "pattern": string;
32
53
  "placeholder": string;
54
+ "readonly": string | boolean;
33
55
  "required": boolean;
34
56
  "showerrormsg": boolean;
57
+ "step": string | number;
35
58
  "type": string;
36
59
  "valid": boolean;
37
- "value": string;
38
- }
39
- interface TttxLoadingSpinner {
40
- "loadingMessage": boolean;
41
- "size": 'small' | 'large';
42
- }
43
- interface TttxPopoverContent {
44
- "body": string;
45
- "header": string;
46
- "linkcontext": string;
47
- "linktext": string;
60
+ "value": string | number;
48
61
  }
49
62
  }
50
63
  export interface TttxButtonCustomEvent<T> extends CustomEvent<T> {
@@ -59,9 +72,9 @@ export interface TttxFormCustomEvent<T> extends CustomEvent<T> {
59
72
  detail: T;
60
73
  target: HTMLTttxFormElement;
61
74
  }
62
- export interface TttxInputCustomEvent<T> extends CustomEvent<T> {
75
+ export interface TttxStandaloneInputCustomEvent<T> extends CustomEvent<T> {
63
76
  detail: T;
64
- target: HTMLTttxInputElement;
77
+ target: HTMLTttxStandaloneInputElement;
65
78
  }
66
79
  declare global {
67
80
  interface HTMLTttxButtonElement extends Components.TttxButton, HTMLStencilElement {
@@ -88,12 +101,6 @@ declare global {
88
101
  prototype: HTMLTttxIconElement;
89
102
  new (): HTMLTttxIconElement;
90
103
  };
91
- interface HTMLTttxInputElement extends Components.TttxInput, HTMLStencilElement {
92
- }
93
- var HTMLTttxInputElement: {
94
- prototype: HTMLTttxInputElement;
95
- new (): HTMLTttxInputElement;
96
- };
97
104
  interface HTMLTttxLoadingSpinnerElement extends Components.TttxLoadingSpinner, HTMLStencilElement {
98
105
  }
99
106
  var HTMLTttxLoadingSpinnerElement: {
@@ -106,14 +113,20 @@ declare global {
106
113
  prototype: HTMLTttxPopoverContentElement;
107
114
  new (): HTMLTttxPopoverContentElement;
108
115
  };
116
+ interface HTMLTttxStandaloneInputElement extends Components.TttxStandaloneInput, HTMLStencilElement {
117
+ }
118
+ var HTMLTttxStandaloneInputElement: {
119
+ prototype: HTMLTttxStandaloneInputElement;
120
+ new (): HTMLTttxStandaloneInputElement;
121
+ };
109
122
  interface HTMLElementTagNameMap {
110
123
  "tttx-button": HTMLTttxButtonElement;
111
124
  "tttx-checkbox": HTMLTttxCheckboxElement;
112
125
  "tttx-form": HTMLTttxFormElement;
113
126
  "tttx-icon": HTMLTttxIconElement;
114
- "tttx-input": HTMLTttxInputElement;
115
127
  "tttx-loading-spinner": HTMLTttxLoadingSpinnerElement;
116
128
  "tttx-popover-content": HTMLTttxPopoverContentElement;
129
+ "tttx-standalone-input": HTMLTttxStandaloneInputElement;
117
130
  }
118
131
  }
119
132
  declare namespace LocalJSX {
@@ -129,46 +142,58 @@ declare namespace LocalJSX {
129
142
  "value"?: boolean;
130
143
  }
131
144
  interface TttxForm {
132
- "dataAttribute"?: string;
133
- "functionAttribute"?: string;
134
- "onFormSubmit"?: (event: TttxFormCustomEvent<any>) => void;
145
+ "formschema"?: any;
146
+ "onSubmitEvent"?: (event: TttxFormCustomEvent<FormData>) => void;
147
+ "submitValue"?: any;
135
148
  }
136
149
  interface TttxIcon {
137
150
  "colour"?: string;
138
151
  "icon"?: string;
139
152
  }
140
- interface TttxInput {
153
+ interface TttxLoadingSpinner {
154
+ "loadingMessage"?: boolean;
155
+ "size"?: 'small' | 'large';
156
+ }
157
+ interface TttxPopoverContent {
158
+ "body"?: string;
159
+ "header"?: string;
160
+ "linkcontext"?: string;
161
+ "linktext"?: string;
162
+ }
163
+ interface TttxStandaloneInput {
164
+ "autocapitalize"?: string;
165
+ "autocomplete"?: 'off' | 'on';
166
+ "autofocus"?: boolean;
167
+ "checked"?: boolean;
168
+ "disabled"?: boolean;
141
169
  "errormsg"?: string;
142
170
  "iconleft"?: string;
143
171
  "iconright"?: string;
144
172
  "label"?: string;
145
- "onValueChanged"?: (event: TttxInputCustomEvent<string>) => void;
173
+ "max"?: MinMaxDates | number;
174
+ "maxlength"?: string | number;
175
+ "min"?: MinMaxDates | number;
176
+ "minlength"?: string | number;
177
+ "name"?: string;
178
+ "onValueChanged"?: (event: TttxStandaloneInputCustomEvent<string>) => void;
146
179
  "pattern"?: string;
147
180
  "placeholder"?: string;
181
+ "readonly"?: string | boolean;
148
182
  "required"?: boolean;
149
183
  "showerrormsg"?: boolean;
184
+ "step"?: string | number;
150
185
  "type"?: string;
151
186
  "valid"?: boolean;
152
- "value"?: string;
153
- }
154
- interface TttxLoadingSpinner {
155
- "loadingMessage"?: boolean;
156
- "size"?: 'small' | 'large';
157
- }
158
- interface TttxPopoverContent {
159
- "body"?: string;
160
- "header"?: string;
161
- "linkcontext"?: string;
162
- "linktext"?: string;
187
+ "value"?: string | number;
163
188
  }
164
189
  interface IntrinsicElements {
165
190
  "tttx-button": TttxButton;
166
191
  "tttx-checkbox": TttxCheckbox;
167
192
  "tttx-form": TttxForm;
168
193
  "tttx-icon": TttxIcon;
169
- "tttx-input": TttxInput;
170
194
  "tttx-loading-spinner": TttxLoadingSpinner;
171
195
  "tttx-popover-content": TttxPopoverContent;
196
+ "tttx-standalone-input": TttxStandaloneInput;
172
197
  }
173
198
  }
174
199
  export { LocalJSX as JSX };
@@ -179,9 +204,9 @@ declare module "@stencil/core" {
179
204
  "tttx-checkbox": LocalJSX.TttxCheckbox & JSXBase.HTMLAttributes<HTMLTttxCheckboxElement>;
180
205
  "tttx-form": LocalJSX.TttxForm & JSXBase.HTMLAttributes<HTMLTttxFormElement>;
181
206
  "tttx-icon": LocalJSX.TttxIcon & JSXBase.HTMLAttributes<HTMLTttxIconElement>;
182
- "tttx-input": LocalJSX.TttxInput & JSXBase.HTMLAttributes<HTMLTttxInputElement>;
183
207
  "tttx-loading-spinner": LocalJSX.TttxLoadingSpinner & JSXBase.HTMLAttributes<HTMLTttxLoadingSpinnerElement>;
184
208
  "tttx-popover-content": LocalJSX.TttxPopoverContent & JSXBase.HTMLAttributes<HTMLTttxPopoverContentElement>;
209
+ "tttx-standalone-input": LocalJSX.TttxStandaloneInput & JSXBase.HTMLAttributes<HTMLTttxStandaloneInputElement>;
185
210
  }
186
211
  }
187
212
  }
package/package.json CHANGED
@@ -1,67 +1,69 @@
1
1
  {
2
- "name": "@3t-transform/threeteeui",
3
- "version": "0.0.10",
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
- }
2
+ "name": "@3t-transform/threeteeui",
3
+ "version": "0.0.11",
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": "^2.7.3",
56
+ "lit-html": "^2.7.0",
57
+ "puppeteer": "^10.0.0",
58
+ "react": "^18.2.0",
59
+ "react-dom": "^18.2.0",
60
+ "sass": "^1.56.1",
61
+ "typescript": "^5.0.4"
62
+ },
63
+ "license": "UNLICENSED",
64
+ "readme": "ERROR: No README data found!",
65
+ "dependencies": {
66
+ "@popperjs/core": "^2.11.7",
67
+ "storybook": "^7.0.6"
68
+ }
67
69
  }
package/readme.md CHANGED
@@ -1,86 +1,89 @@
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.
15
-
16
- ## Getting Started
17
-
18
- Pull down this repo and run:
19
-
20
- ```bash
21
- npm install
22
- npm start
23
- ```
24
-
25
- To build the component for production, run:
26
-
27
- ```bash
28
- npm run build
29
- ```
30
-
31
- To run the unit tests for the components, run:
32
-
33
- ```bash
34
- npm test
35
- ```
36
- To see the components in Storybook, run:
37
-
38
- ```
39
- npm run build
40
- npm run storybook
41
- ```
42
-
43
- Need help? Check out our [docs](https://stenciljs.com/docs/my-first-component).
44
-
45
- ## Naming Components
46
-
47
- When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
48
-
49
- Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic generated web components use the prefix `ion`.
50
-
51
- We suggest: `<tttx-button>` for example.
52
-
53
- ## Testing Components
54
-
55
- Stencil uses a testing framework built using Jest and Puppeteer. It provides support for two types of test: Unit and End-to-End.
56
-
57
- You can find out more form their [docs](https://stenciljs.com/docs/testing-overview)
58
-
59
- For our purposes, if you are creating a component that consumes a devextreme component which is itself a container for other components (e.g. a devextreme toolbar that contains a devextreme button), you will want to create an End-to-End test for that.
60
-
61
- This is because the helper method that builds a test page in the unit tests mocks out HTML elements, and the mock class it provides doesn't define all the methods that devextreme uses when attaching the component to the container, which causes the render to fail. The End-to-End tests build the component in the browser, so we're able to render them there.
62
-
63
- ## Using this component
64
-
65
- There are three strategies we recommend for using web components built with Stencil.
66
-
67
- The first step for all three of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
68
-
69
- - First, you need to [sign up](https://www.npmjs.com/signup) for an npm account. You will also need to ask an organisation owner to add you as a member of the @3t-transform organisation.
70
- - Update the `version` in the package.json.
71
- - Publish the new version with `npm publish @3t-transform/threeteeui`
72
-
73
- ### Script tag
74
-
75
- - Put a script tag similar to this `<script type='module' src='https://unpkg.com/my-component@0.0.1/dist/my-component.esm.js'></script>` in the head of your index.html
76
- - Then you can use the element anywhere in your template, JSX, html etc
77
-
78
- ### Node Modules
79
- - Run `npm install my-component --save`
80
- - Put a script tag similar to this `<script type='module' src='node_modules/my-component/dist/my-component.esm.js'></script>` in the head of your index.html
81
- - Then you can use the element anywhere in your template, JSX, html etc
82
-
83
- ### In a stencil-starter app
84
- - Run `npm install my-component --save`
85
- - Add an import to the npm packages `import my-component;`
86
- - Then you can use the element anywhere in your template, JSX, html etc
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.
15
+
16
+ ## Getting Started
17
+
18
+ Pull down this repo and run:
19
+
20
+ ```bash
21
+ npm install
22
+ npm start
23
+ ```
24
+
25
+ To build the component for production, run:
26
+
27
+ ```bash
28
+ npm run build
29
+ ```
30
+
31
+ To run the unit tests for the components, run:
32
+
33
+ ```bash
34
+ npm test
35
+ ```
36
+
37
+ To see the components in Storybook, run:
38
+
39
+ ```
40
+ npm run build
41
+ npm run storybook
42
+ ```
43
+
44
+ Need help? Check out our [docs](https://stenciljs.com/docs/my-first-component).
45
+
46
+ ## Naming Components
47
+
48
+ When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
49
+
50
+ Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic generated web components use the prefix `ion`.
51
+
52
+ We suggest: `<tttx-button>` for example.
53
+
54
+ ## Testing Components
55
+
56
+ Stencil uses a testing framework built using Jest and Puppeteer. It provides support for two types of test: Unit and End-to-End.
57
+
58
+ You can find out more form their [docs](https://stenciljs.com/docs/testing-overview)
59
+
60
+ For our purposes, if you are creating a component that consumes a devextreme component which is itself a container for other components (e.g. a devextreme toolbar that contains a devextreme button), you will want to create an End-to-End test for that.
61
+
62
+ This is because the helper method that builds a test page in the unit tests mocks out HTML elements, and the mock class it provides doesn't define all the methods that devextreme uses when attaching the component to the container, which causes the render to fail. The End-to-End tests build the component in the browser, so we're able to render them there.
63
+
64
+ ## Using this component
65
+
66
+ There are three strategies we recommend for using web components built with Stencil.
67
+
68
+ The first step for all three of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
69
+
70
+ - First, you need to [sign up](https://www.npmjs.com/signup) for an npm account. You will also need to ask an organisation owner to add you as a member of the @3t-transform organisation.
71
+ - Update the `version` in the package.json.
72
+ - Publish the new version with `npm publish @3t-transform/threeteeui`
73
+
74
+ ### Script tag
75
+
76
+ - Put a script tag similar to this `<script type='module' src='https://unpkg.com/my-component@0.0.1/dist/my-component.esm.js'></script>` in the head of your index.html
77
+ - Then you can use the element anywhere in your template, JSX, html etc
78
+
79
+ ### Node Modules
80
+
81
+ - Run `npm install my-component --save`
82
+ - Put a script tag similar to this `<script type='module' src='node_modules/my-component/dist/my-component.esm.js'></script>` in the head of your index.html
83
+ - Then you can use the element anywhere in your template, JSX, html etc
84
+
85
+ ### In a stencil-starter app
86
+
87
+ - Run `npm install my-component --save`
88
+ - Add an import to the npm packages `import my-component;`
89
+ - Then you can use the element anywhere in your template, JSX, html etc
@@ -1,44 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-8a4cb9bc.js');
6
-
7
- const tttxInputCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;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;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{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;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}.icon-right{margin-top:5px;margin-right:4px}.icon-left{margin-top:5px;margin-left:4px}";
8
-
9
- const TttxInput = 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("tttx-icon", { icon: this.iconleft, colour: "grey" }))), 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("tttx-icon", { icon: this.iconright, colour: "grey" })))), this.showerrormsg && this.errormsg && index.h("div", { class: "errormsg" }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
40
- }
41
- };
42
- TttxInput.style = tttxInputCss;
43
-
44
- exports.tttx_input = TttxInput;