@3t-transform/threeteeui 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/cjs/{index-8a7479e4.js → index-253ca97c.js} +239 -415
  2. package/dist/cjs/loader.cjs.js +4 -3
  3. package/dist/cjs/tttx-button.cjs.entry.js +28 -0
  4. package/dist/cjs/tttx-checkbox.cjs.entry.js +28 -0
  5. package/dist/cjs/tttx-form.cjs.entry.js +58 -0
  6. package/dist/cjs/tttx-single-input.cjs.entry.js +44 -0
  7. package/dist/cjs/tttx-text-box.cjs.entry.js +38 -0
  8. package/dist/cjs/tttx.cjs.js +7 -3
  9. package/dist/collection/collection-manifest.json +7 -5
  10. package/dist/collection/components/atoms/tttx-button/tttx-button.css +61 -0
  11. package/dist/collection/components/atoms/tttx-button/tttx-button.js +93 -0
  12. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +30 -0
  13. package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.css +142 -0
  14. package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.js +259 -0
  15. package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.stories.js +92 -0
  16. package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.css +142 -0
  17. package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.js +150 -0
  18. package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.stories.js +17 -0
  19. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +138 -0
  20. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +101 -0
  21. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +13 -0
  22. package/dist/collection/components/molecules/tttx-form/tttx-form.js +109 -0
  23. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +37 -0
  24. package/dist/collection/icons.js +2838 -0
  25. package/dist/components/index.d.ts +14 -3
  26. package/dist/components/index.js +6 -4
  27. package/dist/components/{tttx-page.d.ts → tttx-button.d.ts} +4 -4
  28. package/dist/components/tttx-button.js +45 -0
  29. package/dist/components/{tttx-worksheet.d.ts → tttx-checkbox.d.ts} +4 -4
  30. package/dist/components/tttx-checkbox.js +46 -0
  31. package/dist/components/{tttx-icon.d.ts → tttx-form.d.ts} +4 -4
  32. package/dist/components/tttx-form.js +75 -0
  33. package/dist/components/tttx-single-input.d.ts +11 -0
  34. package/dist/components/tttx-single-input.js +71 -0
  35. package/dist/components/tttx-text-box.d.ts +11 -0
  36. package/dist/components/tttx-text-box.js +59 -0
  37. package/dist/esm/{index-854ff56f.js → index-fcca6c58.js} +237 -416
  38. package/dist/esm/loader.js +4 -3
  39. package/dist/esm/polyfills/css-shim.js +1 -1
  40. package/dist/esm/tttx-button.entry.js +24 -0
  41. package/dist/esm/tttx-checkbox.entry.js +24 -0
  42. package/dist/esm/tttx-form.entry.js +54 -0
  43. package/dist/esm/tttx-single-input.entry.js +40 -0
  44. package/dist/esm/tttx-text-box.entry.js +34 -0
  45. package/dist/esm/tttx.js +4 -3
  46. package/dist/tttx/p-05d7d002.entry.js +1 -0
  47. package/dist/tttx/p-40709c59.entry.js +1 -0
  48. package/dist/tttx/p-64703252.entry.js +1 -0
  49. package/dist/tttx/p-8d1f2e5c.entry.js +1 -0
  50. package/dist/tttx/p-9bf836ed.entry.js +1 -0
  51. package/dist/tttx/p-a7b95fd2.js +2 -0
  52. package/dist/tttx/tttx.esm.js +1 -1
  53. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +9 -0
  54. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +20 -0
  55. package/dist/types/components/atoms/tttx-single-input/tttx-single-input.d.ts +20 -0
  56. package/dist/types/components/atoms/tttx-single-input/tttx-single-input.stories.d.ts +27 -0
  57. package/dist/types/components/atoms/tttx-text-box/tttx-text-box.d.ts +14 -0
  58. package/dist/types/components/atoms/tttx-text-box/tttx-text-box.stories.d.ts +6 -0
  59. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -0
  60. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -0
  61. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +11 -0
  62. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +6 -0
  63. package/dist/types/components.d.ts +128 -51
  64. package/dist/types/icons.d.ts +2 -0
  65. package/dist/types/stencil-public-runtime.d.ts +59 -3
  66. package/loader/index.d.ts +9 -0
  67. package/package.json +58 -59
  68. package/readme.md +1 -6
  69. package/dist/cjs/toolbar-656be6e6.js +0 -34259
  70. package/dist/cjs/tttx-icon.cjs.entry.js +0 -21
  71. package/dist/cjs/tttx-page.cjs.entry.js +0 -927
  72. package/dist/cjs/tttx-worksheet.cjs.entry.js +0 -47
  73. package/dist/collection/components/components/tttx-icon/tttx-icon.css +0 -89
  74. package/dist/collection/components/components/tttx-icon/tttx-icon.js +0 -59
  75. package/dist/collection/components/components/tttx-icon/tttx-icon.stories.js +0 -40
  76. package/dist/collection/components/patterns/tttx-page/tttx-page.css +0 -162
  77. package/dist/collection/components/patterns/tttx-page/tttx-page.js +0 -213
  78. package/dist/collection/components/patterns/tttx-page/tttx-page.stories.js +0 -80
  79. package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.css +0 -134
  80. package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.js +0 -70
  81. package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.stories.js +0 -44
  82. package/dist/components/tttx-icon.js +0 -37
  83. package/dist/components/tttx-page.js +0 -953
  84. package/dist/components/tttx-worksheet.js +0 -6
  85. package/dist/components/tttx-worksheet2.js +0 -34288
  86. package/dist/esm/toolbar-cede4385.js +0 -34231
  87. package/dist/esm/tttx-icon.entry.js +0 -17
  88. package/dist/esm/tttx-page.entry.js +0 -923
  89. package/dist/esm/tttx-worksheet.entry.js +0 -43
  90. package/dist/tttx/p-4b57de2e.entry.js +0 -1
  91. package/dist/tttx/p-61f78304.entry.js +0 -1
  92. package/dist/tttx/p-7244abd4.entry.js +0 -1
  93. package/dist/tttx/p-d038fe18.js +0 -1
  94. package/dist/tttx/p-ddfeb0ba.js +0 -2
  95. package/dist/tttx/tttx.css +0 -1
  96. package/dist/types/components/components/tttx-icon/tttx-icon.d.ts +0 -5
  97. package/dist/types/components/components/tttx-icon/tttx-icon.stories.d.ts +0 -24
  98. package/dist/types/components/patterns/tttx-page/tttx-page.d.ts +0 -21
  99. package/dist/types/components/patterns/tttx-page/tttx-page.stories.d.ts +0 -48
  100. package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.d.ts +0 -9
  101. package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.stories.d.ts +0 -23
@@ -0,0 +1,138 @@
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
+ }
@@ -0,0 +1,101 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class TttxCheckbox {
3
+ constructor() {
4
+ this.value = undefined;
5
+ this.label = undefined;
6
+ this.required = undefined;
7
+ }
8
+ handleClick(event) {
9
+ const target = event.target;
10
+ this.value = target.checked;
11
+ this.valueChanged.emit(target.checked);
12
+ }
13
+ render() {
14
+ 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("input", { type: "checkbox", class: "input", onChange: event => this.handleClick(event), checked: this.value }))));
15
+ }
16
+ static get is() { return "tttx-checkbox"; }
17
+ static get encapsulation() { return "shadow"; }
18
+ static get originalStyleUrls() {
19
+ return {
20
+ "$": ["tttx-checkbox.scss"]
21
+ };
22
+ }
23
+ static get styleUrls() {
24
+ return {
25
+ "$": ["tttx-checkbox.css"]
26
+ };
27
+ }
28
+ static get properties() {
29
+ return {
30
+ "value": {
31
+ "type": "boolean",
32
+ "mutable": false,
33
+ "complexType": {
34
+ "original": "boolean",
35
+ "resolved": "boolean",
36
+ "references": {}
37
+ },
38
+ "required": false,
39
+ "optional": false,
40
+ "docs": {
41
+ "tags": [],
42
+ "text": ""
43
+ },
44
+ "attribute": "value",
45
+ "reflect": false
46
+ },
47
+ "label": {
48
+ "type": "string",
49
+ "mutable": false,
50
+ "complexType": {
51
+ "original": "string",
52
+ "resolved": "string",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "label",
62
+ "reflect": false
63
+ },
64
+ "required": {
65
+ "type": "boolean",
66
+ "mutable": false,
67
+ "complexType": {
68
+ "original": "boolean",
69
+ "resolved": "boolean",
70
+ "references": {}
71
+ },
72
+ "required": false,
73
+ "optional": false,
74
+ "docs": {
75
+ "tags": [],
76
+ "text": ""
77
+ },
78
+ "attribute": "required",
79
+ "reflect": false
80
+ }
81
+ };
82
+ }
83
+ static get events() {
84
+ return [{
85
+ "method": "valueChanged",
86
+ "name": "valueChanged",
87
+ "bubbles": true,
88
+ "cancelable": true,
89
+ "composed": true,
90
+ "docs": {
91
+ "tags": [],
92
+ "text": ""
93
+ },
94
+ "complexType": {
95
+ "original": "boolean",
96
+ "resolved": "boolean",
97
+ "references": {}
98
+ }
99
+ }];
100
+ }
101
+ }
@@ -0,0 +1,13 @@
1
+ export default {
2
+ title: 'Atoms/Checkbox',
3
+ component: 'tttx-checkbox',
4
+ };
5
+ const Template = ({ value }) => `
6
+ <tttx-checkbox
7
+ ${value ? 'value="true"' : ''}
8
+ ></tttx-checkbox>
9
+ `;
10
+ export const Default = Template.bind({});
11
+ Default.args = {
12
+ value: false
13
+ };
@@ -0,0 +1,109 @@
1
+ import { h } from '@stencil/core';
2
+ export class TttxForm {
3
+ constructor() {
4
+ this.fetchFormData = () => {
5
+ let validForm = true;
6
+ const formData = {};
7
+ const elements = this.el.querySelectorAll(`[${this.dataAttribute}]`);
8
+ elements.forEach((element) => {
9
+ const inputElement = element;
10
+ validForm = validForm ? this.validateFormField(inputElement) : false;
11
+ formData[inputElement.getAttribute(this.dataAttribute)] = inputElement.value;
12
+ });
13
+ return validForm ? formData : null;
14
+ };
15
+ this.dataAttribute = 'form-data';
16
+ this.functionAttribute = 'function-data';
17
+ }
18
+ validateFormField(element) {
19
+ let isValid = true;
20
+ const isRequired = element.hasAttribute("required");
21
+ if (isRequired && !element.value) {
22
+ // required and not set, show error
23
+ element.setAttribute("showerrormsg", "true");
24
+ isValid = false;
25
+ }
26
+ else {
27
+ // required and set, ensure error does not show
28
+ element.removeAttribute("showerrormsg");
29
+ }
30
+ return isValid;
31
+ }
32
+ componentDidLoad() {
33
+ const elements = this.el.querySelectorAll(`[${this.functionAttribute}]`);
34
+ elements.forEach((element) => {
35
+ element.addEventListener('click', event => {
36
+ event.preventDefault();
37
+ const formData = this.fetchFormData();
38
+ if (formData) {
39
+ // only emit event if form data is valid
40
+ this.formSubmit.emit(this.fetchFormData());
41
+ }
42
+ });
43
+ });
44
+ }
45
+ render() {
46
+ return (h("div", null, h("slot", null)));
47
+ }
48
+ static get is() { return "tttx-form"; }
49
+ static get encapsulation() { return "shadow"; }
50
+ static get properties() {
51
+ return {
52
+ "dataAttribute": {
53
+ "type": "string",
54
+ "mutable": false,
55
+ "complexType": {
56
+ "original": "string",
57
+ "resolved": "string",
58
+ "references": {}
59
+ },
60
+ "required": false,
61
+ "optional": false,
62
+ "docs": {
63
+ "tags": [],
64
+ "text": ""
65
+ },
66
+ "attribute": "data-attribute",
67
+ "reflect": false,
68
+ "defaultValue": "'form-data'"
69
+ },
70
+ "functionAttribute": {
71
+ "type": "string",
72
+ "mutable": false,
73
+ "complexType": {
74
+ "original": "string",
75
+ "resolved": "string",
76
+ "references": {}
77
+ },
78
+ "required": false,
79
+ "optional": false,
80
+ "docs": {
81
+ "tags": [],
82
+ "text": ""
83
+ },
84
+ "attribute": "function-attribute",
85
+ "reflect": false,
86
+ "defaultValue": "'function-data'"
87
+ }
88
+ };
89
+ }
90
+ static get events() {
91
+ return [{
92
+ "method": "formSubmit",
93
+ "name": "formSubmit",
94
+ "bubbles": true,
95
+ "cancelable": true,
96
+ "composed": true,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": ""
100
+ },
101
+ "complexType": {
102
+ "original": "any",
103
+ "resolved": "any",
104
+ "references": {}
105
+ }
106
+ }];
107
+ }
108
+ static get elementRef() { return "el"; }
109
+ }
@@ -0,0 +1,37 @@
1
+ export default {
2
+ title: 'molecules/TTTX Form',
3
+ component: 'tttx-form',
4
+ parameters: {
5
+ actions: {
6
+ handles: ['formSubmit'],
7
+ },
8
+ },
9
+ };
10
+ export const CreateUserTemplate = () => `
11
+ <tttx-form>
12
+ <tttx-single-input label="Name" form-data="name" errormsg="You need a name please" required showerrormsg></tttx-single-input>
13
+ <tttx-single-input label="Email Address" form-data="email" errormsg="Email is required" required showerrormsg></tttx-single-input>
14
+ <tttx-single-input label="Password" form-data="password" type="password" errormsg="Enter a password" required showerrormsg></tttx-single-input>
15
+ <tttx-single-input label="Repeat Password" form-data="repeatpassword" type="password" errormsg="Repeat your password" required showerrormsg></tttx-single-input>
16
+ <tttx-checkbox label="Has Signed GDPR" form-data="gdpr" required></tttx-checkbox>
17
+
18
+ <tttx-button font-color="font-white" button-style="primary-blue" function-data="submit">Create User</tttx-button>
19
+ </tttx-form>
20
+ `;
21
+ export const LoginTemplate = () => `
22
+ <tttx-form>
23
+ <tttx-single-input label="Email" form-data="email" errormsg="email is required" required></tttx-single-input>
24
+ <tttx-single-input label="Password" form-data="password" type="password" errormsg="password is required" required></tttx-single-input>
25
+ <tttx-checkbox label="Remember my Password" form-data="rememberpassword" required></tttx-checkbox>
26
+
27
+ <tttx-button font-color="font-white" button-style="primary-blue" function-data="submit">Log In</tttx-button>
28
+ </tttx-form>
29
+ `;
30
+ export const TextBoxExample = () => `
31
+ <tttx-form>
32
+ <tttx-text-box form-data="firstname" label="First Name" errormsg="Field is required" required></tttx-text-box>
33
+ <tttx-text-box form-data="lastname" label="Last Name"></tttx-text-box>
34
+
35
+ <tttx-button font-color="font-white" button-style="primary-blue" function-data="submit">Submit</tttx-button>
36
+ </tttx-form>
37
+ `;