@3t-transform/threeteeui 0.0.15 → 0.0.17

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 (153) hide show
  1. package/dist/cjs/index-864b7110.js +1531 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +22 -0
  4. package/dist/cjs/tttx-button.cjs.entry.js +34 -0
  5. package/dist/cjs/tttx-checkbox.cjs.entry.js +28 -0
  6. package/dist/cjs/tttx-form.cjs.entry.js +374 -0
  7. package/dist/cjs/tttx-icon.cjs.entry.js +21 -0
  8. package/dist/cjs/tttx-input-calendar.cjs.entry.js +125 -0
  9. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +33 -0
  10. package/dist/cjs/tttx-list.cjs.entry.js +198 -0
  11. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +26 -0
  12. package/dist/cjs/tttx-popover-content.cjs.entry.js +23 -0
  13. package/dist/cjs/tttx-standalone-input.cjs.entry.js +136 -0
  14. package/dist/cjs/tttx-table.cjs.entry.js +60 -0
  15. package/dist/cjs/tttx.cjs.js +23 -0
  16. package/dist/collection/collection-manifest.json +22 -0
  17. package/dist/collection/components/atoms/tttx-button/tttx-button.css +138 -0
  18. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -0
  19. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +74 -0
  20. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +108 -0
  21. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -0
  22. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -0
  23. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +26 -0
  24. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +56 -0
  25. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +12 -0
  26. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +48 -0
  27. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -0
  28. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -0
  29. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.css +30 -0
  30. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +97 -0
  31. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +23 -0
  32. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +181 -0
  33. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +102 -0
  34. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +13 -0
  35. package/dist/collection/components/molecules/tttx-form/tttx-form.css +314 -0
  36. package/dist/collection/components/molecules/tttx-form/tttx-form.js +452 -0
  37. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +109 -0
  38. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.css +93 -0
  39. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.js +174 -0
  40. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.js +27 -0
  41. package/dist/collection/components/molecules/tttx-list/tttx-list.css +56 -0
  42. package/dist/collection/components/molecules/tttx-list/tttx-list.js +312 -0
  43. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +37 -0
  44. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.css +177 -0
  45. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +570 -0
  46. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +156 -0
  47. package/dist/collection/components/molecules/tttx-table/tttx-table.css +166 -0
  48. package/dist/collection/components/molecules/tttx-table/tttx-table.js +174 -0
  49. package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +81 -0
  50. package/dist/collection/components/palette.stories.js +88 -0
  51. package/dist/collection/docs/gettingstarted-developer.stories.js +9 -0
  52. package/dist/collection/icons.js +2838 -0
  53. package/dist/collection/index.js +1 -0
  54. package/dist/components/index.d.ts +41 -0
  55. package/dist/components/index.js +12 -0
  56. package/dist/components/tttx-button.d.ts +11 -0
  57. package/dist/components/tttx-button.js +6 -0
  58. package/dist/components/tttx-button2.js +56 -0
  59. package/dist/components/tttx-checkbox.d.ts +11 -0
  60. package/dist/components/tttx-checkbox.js +46 -0
  61. package/dist/components/tttx-form.d.ts +11 -0
  62. package/dist/components/tttx-form.js +391 -0
  63. package/dist/components/tttx-icon.d.ts +11 -0
  64. package/dist/components/tttx-icon.js +6 -0
  65. package/dist/components/tttx-icon2.js +35 -0
  66. package/dist/components/tttx-input-calendar.d.ts +11 -0
  67. package/dist/components/tttx-input-calendar.js +157 -0
  68. package/dist/components/tttx-keyvalue-block.d.ts +11 -0
  69. package/dist/components/tttx-keyvalue-block.js +49 -0
  70. package/dist/components/tttx-list.d.ts +11 -0
  71. package/dist/components/tttx-list.js +225 -0
  72. package/dist/components/tttx-loading-spinner.d.ts +11 -0
  73. package/dist/components/tttx-loading-spinner.js +6 -0
  74. package/dist/components/tttx-loading-spinner2.js +40 -0
  75. package/dist/components/tttx-popover-content.d.ts +11 -0
  76. package/dist/components/tttx-popover-content.js +6 -0
  77. package/dist/components/tttx-popover-content2.js +39 -0
  78. package/dist/components/tttx-standalone-input.d.ts +11 -0
  79. package/dist/components/tttx-standalone-input.js +179 -0
  80. package/dist/components/tttx-table.d.ts +11 -0
  81. package/dist/components/tttx-table.js +91 -0
  82. package/dist/esm/index-232e347b.js +1502 -0
  83. package/dist/esm/index.js +1 -0
  84. package/dist/esm/loader.js +18 -0
  85. package/dist/esm/polyfills/core-js.js +11 -0
  86. package/dist/esm/polyfills/css-shim.js +1 -0
  87. package/dist/esm/polyfills/dom.js +79 -0
  88. package/dist/esm/polyfills/es5-html-element.js +1 -0
  89. package/dist/esm/polyfills/index.js +34 -0
  90. package/dist/esm/polyfills/system.js +6 -0
  91. package/dist/esm/tttx-button.entry.js +30 -0
  92. package/dist/esm/tttx-checkbox.entry.js +24 -0
  93. package/dist/esm/tttx-form.entry.js +370 -0
  94. package/dist/esm/tttx-icon.entry.js +17 -0
  95. package/dist/esm/tttx-input-calendar.entry.js +121 -0
  96. package/dist/esm/tttx-keyvalue-block.entry.js +29 -0
  97. package/dist/esm/tttx-list.entry.js +194 -0
  98. package/dist/esm/tttx-loading-spinner.entry.js +22 -0
  99. package/dist/esm/tttx-popover-content.entry.js +19 -0
  100. package/dist/esm/tttx-standalone-input.entry.js +132 -0
  101. package/dist/esm/tttx-table.entry.js +56 -0
  102. package/dist/esm/tttx.js +18 -0
  103. package/dist/index.cjs.js +1 -0
  104. package/dist/index.js +1 -0
  105. package/dist/tttx/index.esm.js +0 -0
  106. package/dist/tttx/p-01e1894e.entry.js +1 -0
  107. package/dist/tttx/p-184c4fae.js +2 -0
  108. package/dist/tttx/p-1bc3dfee.entry.js +1 -0
  109. package/dist/tttx/p-1cf8f9e8.entry.js +1 -0
  110. package/dist/tttx/p-220f7519.entry.js +1 -0
  111. package/dist/tttx/p-3973b7dd.entry.js +1 -0
  112. package/dist/tttx/p-5247e827.entry.js +1 -0
  113. package/dist/tttx/p-6828fe6f.entry.js +1 -0
  114. package/dist/tttx/p-81904eed.entry.js +1 -0
  115. package/dist/tttx/p-cf107fb6.entry.js +1 -0
  116. package/dist/tttx/p-f56fe662.entry.js +1 -0
  117. package/dist/tttx/p-fe4c70b2.entry.js +1 -0
  118. package/dist/tttx/tttx.esm.js +1 -0
  119. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -0
  120. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -0
  121. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -0
  122. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -0
  123. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +4 -0
  124. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +6 -0
  125. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -0
  126. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -0
  127. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +7 -0
  128. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +18 -0
  129. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -0
  130. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -0
  131. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +134 -0
  132. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +12 -0
  133. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.d.ts +19 -0
  134. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.d.ts +26 -0
  135. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +51 -0
  136. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +13 -0
  137. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -0
  138. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -0
  139. package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +15 -0
  140. package/dist/types/components/molecules/tttx-table/tttx-table.stories.d.ts +21 -0
  141. package/dist/types/components/palette.stories.d.ts +6 -0
  142. package/dist/types/components.d.ts +295 -0
  143. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -0
  144. package/dist/types/icons.d.ts +2 -0
  145. package/dist/types/index.d.ts +1 -0
  146. package/dist/types/stencil-public-runtime.d.ts +1637 -0
  147. package/loader/cdn.js +3 -0
  148. package/loader/index.cjs.js +3 -0
  149. package/loader/index.d.ts +21 -0
  150. package/loader/index.es2017.js +3 -0
  151. package/loader/index.js +4 -0
  152. package/loader/package.json +11 -0
  153. package/package.json +4 -4
@@ -0,0 +1,110 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { Host, h } from '@stencil/core';
3
+ export class TttxButton {
4
+ constructor() {
5
+ this._iconcolor = 'black';
6
+ this.notext = undefined;
7
+ this.icon = undefined;
8
+ this.iconposition = 'left';
9
+ this.design = 'default';
10
+ }
11
+ componentWillLoad() {
12
+ this._design = this.design;
13
+ const designs = ['primary', 'default', 'disabled', 'danger', 'borderless'];
14
+ if (!designs.includes(this.design)) {
15
+ this._design = 'default';
16
+ }
17
+ if (this._design === 'primary' || this._design === 'danger') {
18
+ this._iconcolor = 'white';
19
+ }
20
+ }
21
+ render() {
22
+ return (h(Host, null, h("button", { class: `button ${this._design} ${this.icon ? 'withicon' : ''} ${this.icon && this.iconposition ? 'icon' + this.iconposition : ''} ${this.notext ? 'notext' : ''}` }, this.icon && this.iconposition === 'left' && (h("div", { class: "icon-left" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))), !this.notext && h("div", { class: "button-content" }, h("slot", null)), this.icon && this.iconposition === 'right' && (h("div", { class: "icon-right" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))))));
23
+ }
24
+ static get is() { return "tttx-button"; }
25
+ static get encapsulation() { return "shadow"; }
26
+ static get originalStyleUrls() {
27
+ return {
28
+ "$": ["tttx-button.scss"]
29
+ };
30
+ }
31
+ static get styleUrls() {
32
+ return {
33
+ "$": ["tttx-button.css"]
34
+ };
35
+ }
36
+ static get properties() {
37
+ return {
38
+ "notext": {
39
+ "type": "boolean",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "boolean",
43
+ "resolved": "boolean",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": ""
51
+ },
52
+ "attribute": "notext",
53
+ "reflect": false
54
+ },
55
+ "icon": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": ""
68
+ },
69
+ "attribute": "icon",
70
+ "reflect": false
71
+ },
72
+ "iconposition": {
73
+ "type": "string",
74
+ "mutable": false,
75
+ "complexType": {
76
+ "original": "'left' | 'right'",
77
+ "resolved": "\"left\" | \"right\"",
78
+ "references": {}
79
+ },
80
+ "required": false,
81
+ "optional": false,
82
+ "docs": {
83
+ "tags": [],
84
+ "text": ""
85
+ },
86
+ "attribute": "iconposition",
87
+ "reflect": false,
88
+ "defaultValue": "'left'"
89
+ },
90
+ "design": {
91
+ "type": "string",
92
+ "mutable": false,
93
+ "complexType": {
94
+ "original": "string",
95
+ "resolved": "string",
96
+ "references": {}
97
+ },
98
+ "required": false,
99
+ "optional": false,
100
+ "docs": {
101
+ "tags": [],
102
+ "text": ""
103
+ },
104
+ "attribute": "design",
105
+ "reflect": false,
106
+ "defaultValue": "'default'"
107
+ }
108
+ };
109
+ }
110
+ }
@@ -0,0 +1,74 @@
1
+ export default {
2
+ title: 'Atoms/Button',
3
+ component: 'tttx-button'
4
+ };
5
+ const PrimaryButtons = () => `
6
+ <h2>Standard</h2>
7
+ <tttx-button design="primary">Primary</tttx-button>
8
+ <hr />
9
+ <h2>Icon Right</h2>
10
+ <tttx-button design="primary" icon="chevron_right" iconposition="right">Primary</tttx-button>
11
+ <hr />
12
+ <h2>Icon Left</h2>
13
+ <tttx-button design="primary" icon="add">Primary</tttx-button>
14
+ <hr />
15
+ <h2>Icon Only</h2>
16
+ <tttx-button design="primary" icon="more_vert" notext></tttx-button>
17
+ `;
18
+ export const Primary = PrimaryButtons.bind({});
19
+ const DefaultButtons = () => `
20
+ <h2>Standard</h2>
21
+ <tttx-button>Default</tttx-button>
22
+ <hr />
23
+ <h2>Icon Right</h2>
24
+ <tttx-button icon="chevron_right" iconposition="right">Default</tttx-button>
25
+ <hr />
26
+ <h2>Icon Left</h2>
27
+ <tttx-button icon="edit">Default</tttx-button>
28
+ <hr />
29
+ <h2>Icon Only</h2>
30
+ <tttx-button icon="more_vert" notext></tttx-button>
31
+ `;
32
+ export const Default = DefaultButtons.bind({});
33
+ const BorderlessButtons = () => `
34
+ <h2>Standard</h2>
35
+ <tttx-button design="borderless">Borderless</tttx-button>
36
+ <hr />
37
+ <h2>Icon Right</h2>
38
+ <tttx-button design="borderless" icon="chevron_right" iconposition="right">Borderless</tttx-button>
39
+ <hr />
40
+ <h2>Icon Left</h2>
41
+ <tttx-button design="borderless" icon="edit">Borderless</tttx-button>
42
+ <hr />
43
+ <h2>Icon Only</h2>
44
+ <tttx-button design="borderless" icon="more_vert" notext></tttx-button>
45
+ `;
46
+ export const Borderless = BorderlessButtons.bind({});
47
+ const DangerButtons = () => `
48
+ <h2>Standard</h2>
49
+ <tttx-button design="danger">Danger</tttx-button>
50
+ <hr />
51
+ <h2>Icon Right</h2>
52
+ <tttx-button design="danger" icon="chevron_right" iconposition="right">Danger</tttx-button>
53
+ <hr />
54
+ <h2>Icon Left</h2>
55
+ <tttx-button design="danger" icon="delete">Danger</tttx-button>
56
+ <hr />
57
+ <h2>Icon Only</h2>
58
+ <tttx-button design="danger" icon="more_vert" notext></tttx-button>
59
+ `;
60
+ export const Danger = DangerButtons.bind({});
61
+ const DisabledButtons = () => `
62
+ <h2>Standard</h2>
63
+ <tttx-button design="disabled">Disabled</tttx-button>
64
+ <hr />
65
+ <h2>Icon Right</h2>
66
+ <tttx-button design="disabled" icon="chevron_right" iconposition="right">Disabled</tttx-button>
67
+ <hr />
68
+ <h2>Icon Left</h2>
69
+ <tttx-button design="disabled" icon="edit">Disabled</tttx-button>
70
+ <hr />
71
+ <h2>Icon Only</h2>
72
+ <tttx-button design="disabled" icon="more_vert" notext></tttx-button>
73
+ `;
74
+ export const Disabled = DisabledButtons.bind({});
@@ -0,0 +1,108 @@
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", sans-serif;
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
+ :host {
23
+ display: inline-block;
24
+ cursor: default;
25
+ user-select: none;
26
+ }
27
+
28
+ .icon-size {
29
+ width: 24px;
30
+ height: 24px;
31
+ }
32
+
33
+ .tooltip {
34
+ background: #ffffff;
35
+ color: #343434;
36
+ font-weight: bold;
37
+ padding: 8px 16px;
38
+ font-size: 13px;
39
+ border-radius: 4px;
40
+ box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.3);
41
+ display: none;
42
+ }
43
+
44
+ .tooltip[data-show] {
45
+ display: block;
46
+ }
47
+
48
+ .arrow,
49
+ .arrow::before {
50
+ position: absolute;
51
+ width: 8px;
52
+ height: 8px;
53
+ background: inherit;
54
+ }
55
+
56
+ .arrow {
57
+ visibility: hidden;
58
+ }
59
+
60
+ .arrow::before {
61
+ visibility: visible;
62
+ content: "";
63
+ transform: rotate(45deg);
64
+ }
65
+
66
+ .tooltip[data-popper-placement^=top] > .arrow {
67
+ bottom: -4px;
68
+ }
69
+
70
+ .tooltip[data-popper-placement^=bottom] > .arrow {
71
+ top: -4px;
72
+ }
73
+
74
+ .tooltip[data-popper-placement^=left] > .arrow {
75
+ right: -4px;
76
+ }
77
+
78
+ .tooltip[data-popper-placement^=right] > .arrow {
79
+ left: -4px;
80
+ }
81
+
82
+ .red {
83
+ color: #dc0000;
84
+ }
85
+
86
+ .orange {
87
+ color: #f59500;
88
+ }
89
+
90
+ .blue {
91
+ color: #1479c6;
92
+ }
93
+
94
+ .green {
95
+ color: #a2bb31;
96
+ }
97
+
98
+ .gray {
99
+ color: #757575;
100
+ }
101
+
102
+ .black {
103
+ color: #212121;
104
+ }
105
+
106
+ .white {
107
+ color: white;
108
+ }
@@ -0,0 +1,62 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { Host, h } from '@stencil/core';
3
+ export class TttxIcon {
4
+ constructor() {
5
+ this.icon = undefined;
6
+ this.color = 'grey';
7
+ }
8
+ render() {
9
+ return (h(Host, null, h("span", { class: `material-symbols-rounded ${this.color ? this.color : ''}` }, this.icon)));
10
+ }
11
+ static get is() { return "tttx-icon"; }
12
+ static get encapsulation() { return "shadow"; }
13
+ static get originalStyleUrls() {
14
+ return {
15
+ "$": ["tttx-icon.scss"]
16
+ };
17
+ }
18
+ static get styleUrls() {
19
+ return {
20
+ "$": ["tttx-icon.css"]
21
+ };
22
+ }
23
+ static get properties() {
24
+ return {
25
+ "icon": {
26
+ "type": "string",
27
+ "mutable": false,
28
+ "complexType": {
29
+ "original": "string",
30
+ "resolved": "string",
31
+ "references": {}
32
+ },
33
+ "required": false,
34
+ "optional": false,
35
+ "docs": {
36
+ "tags": [],
37
+ "text": ""
38
+ },
39
+ "attribute": "icon",
40
+ "reflect": false
41
+ },
42
+ "color": {
43
+ "type": "string",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "string",
47
+ "resolved": "string",
48
+ "references": {}
49
+ },
50
+ "required": false,
51
+ "optional": false,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": ""
55
+ },
56
+ "attribute": "color",
57
+ "reflect": false,
58
+ "defaultValue": "'grey'"
59
+ }
60
+ };
61
+ }
62
+ }
@@ -0,0 +1,22 @@
1
+ import icons from './../../../icons';
2
+ const colors = ['red', 'blue', 'black', 'grey', 'green'];
3
+ export default {
4
+ title: 'Atoms/Icons',
5
+ component: 'tttx-icon',
6
+ argTypes: {
7
+ icon: {
8
+ control: { type: 'select' },
9
+ options: icons,
10
+ },
11
+ color: {
12
+ control: { type: 'select' },
13
+ options: colors,
14
+ },
15
+ },
16
+ };
17
+ const Template = ({ icon, color }) => `<tttx-icon icon="${icon}" color="${color}" />`;
18
+ export const Icon = Template.bind({});
19
+ Icon.args = {
20
+ icon: 'warning',
21
+ color: 'red',
22
+ };
@@ -0,0 +1,26 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ dl {
6
+ margin: 0;
7
+ padding: 0;
8
+ font-family: "Roboto", sans-serif;
9
+ cursor: default;
10
+ }
11
+
12
+ dt {
13
+ font-weight: 400;
14
+ line-height: 21px;
15
+ font-size: 16px;
16
+ color: #757575;
17
+ }
18
+
19
+ dd {
20
+ margin: 0;
21
+ font-weight: 400;
22
+ font-size: 16px;
23
+ color: #212121;
24
+ line-height: 21px;
25
+ margin-bottom: 18px;
26
+ }
@@ -0,0 +1,56 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { h, Host } from '@stencil/core';
3
+ export class TttxKeyvalueBlock {
4
+ constructor() {
5
+ this.keyvalues = undefined;
6
+ }
7
+ render() {
8
+ let values;
9
+ if (typeof this.keyvalues === 'string') {
10
+ values = JSON.parse(this.keyvalues);
11
+ }
12
+ else {
13
+ values = this.keyvalues;
14
+ }
15
+ const keys = Object.keys(values);
16
+ const elements = [];
17
+ for (let i = 0; i < keys.length; i++) {
18
+ elements.push(h("dt", null, keys[i]));
19
+ elements.push(h("dd", null, values[keys[i]]));
20
+ }
21
+ return (h(Host, null, h("dl", null, elements)));
22
+ }
23
+ static get is() { return "tttx-keyvalue-block"; }
24
+ static get encapsulation() { return "shadow"; }
25
+ static get originalStyleUrls() {
26
+ return {
27
+ "$": ["tttx-keyvalue-block.scss"]
28
+ };
29
+ }
30
+ static get styleUrls() {
31
+ return {
32
+ "$": ["tttx-keyvalue-block.css"]
33
+ };
34
+ }
35
+ static get properties() {
36
+ return {
37
+ "keyvalues": {
38
+ "type": "any",
39
+ "mutable": false,
40
+ "complexType": {
41
+ "original": "any",
42
+ "resolved": "any",
43
+ "references": {}
44
+ },
45
+ "required": false,
46
+ "optional": false,
47
+ "docs": {
48
+ "tags": [],
49
+ "text": ""
50
+ },
51
+ "attribute": "keyvalues",
52
+ "reflect": false
53
+ }
54
+ };
55
+ }
56
+ }
@@ -0,0 +1,12 @@
1
+ export default {
2
+ title: 'atoms/Key Value Block',
3
+ component: 'tttx-keyvalue-block'
4
+ };
5
+ const keyValues = {
6
+ 'Name': 'John Doe',
7
+ 'Date of birth': '14 Jan 1981',
8
+ 'Start of postcode': 'AB10'
9
+ };
10
+ export const KeyValueBlock = () => {
11
+ return `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValues)}' />`;
12
+ };
@@ -0,0 +1,48 @@
1
+ .material-symbols-rounded {
2
+ font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
3
+ }
4
+
5
+ .spinner-container {
6
+ position: absolute;
7
+ }
8
+
9
+ .loading-box {
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ }
14
+
15
+ .loading-text {
16
+ font-size: 16px;
17
+ font-weight: 400;
18
+ padding-top: 10px;
19
+ text-align: center;
20
+ }
21
+
22
+ .spinner {
23
+ border: solid #1479c6;
24
+ border-bottom-color: #d5d5d5;
25
+ border-radius: 50%;
26
+ position: relative;
27
+ box-sizing: border-box;
28
+ animation: rotation 1s linear infinite;
29
+ }
30
+ .spinner.small {
31
+ height: 20px;
32
+ width: 20px;
33
+ border-width: 4px;
34
+ }
35
+ .spinner.large {
36
+ height: 60px;
37
+ width: 60px;
38
+ border-width: 8px;
39
+ }
40
+
41
+ @keyframes rotation {
42
+ 0% {
43
+ transform: rotate(0deg);
44
+ }
45
+ 100% {
46
+ transform: rotate(360deg);
47
+ }
48
+ }
@@ -0,0 +1,67 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { h } from '@stencil/core';
3
+ export class TttxLoadingSpinner {
4
+ constructor() {
5
+ this.loadingMessage = undefined;
6
+ this.size = 'large';
7
+ }
8
+ renderLoadingMessage() {
9
+ if (!this.loadingMessage)
10
+ return '';
11
+ return h("div", { class: "loading-text" }, "Loading, please wait...");
12
+ }
13
+ render() {
14
+ return (h("div", { class: "spinner-container" }, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
15
+ }
16
+ static get is() { return "tttx-loading-spinner"; }
17
+ static get encapsulation() { return "shadow"; }
18
+ static get originalStyleUrls() {
19
+ return {
20
+ "$": ["tttx-loading-spinner.scss"]
21
+ };
22
+ }
23
+ static get styleUrls() {
24
+ return {
25
+ "$": ["tttx-loading-spinner.css"]
26
+ };
27
+ }
28
+ static get properties() {
29
+ return {
30
+ "loadingMessage": {
31
+ "type": "boolean",
32
+ "mutable": true,
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": "loading-message",
45
+ "reflect": false
46
+ },
47
+ "size": {
48
+ "type": "string",
49
+ "mutable": true,
50
+ "complexType": {
51
+ "original": "'small' | 'large'",
52
+ "resolved": "\"large\" | \"small\"",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "size",
62
+ "reflect": false,
63
+ "defaultValue": "'large'"
64
+ }
65
+ };
66
+ }
67
+ }
@@ -0,0 +1,17 @@
1
+ export default {
2
+ title: 'atoms/Loading Spinner',
3
+ component: 'tttx-loading-spinner',
4
+ argTypes: {
5
+ loadingMessage: {
6
+ control: 'boolean',
7
+ },
8
+ size: {
9
+ control: { type: 'radio' },
10
+ options: ['small', 'large'],
11
+ },
12
+ },
13
+ };
14
+ export const Example = args => {
15
+ const size = args.size || 'large';
16
+ return `<tttx-loading-spinner ${args.loadingMessage ? 'loading-message' : ''} size='${size}' />`;
17
+ };
@@ -0,0 +1,30 @@
1
+ .material-symbols-rounded {
2
+ font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
3
+ }
4
+
5
+ :host {
6
+ display: block;
7
+ max-width: 400px;
8
+ }
9
+
10
+ h4 {
11
+ margin: 0;
12
+ font-size: 15px;
13
+ font-weight: 700;
14
+ color: black;
15
+ margin-bottom: 4px;
16
+ }
17
+
18
+ p {
19
+ margin: 0;
20
+ font-size: 14px;
21
+ font-weight: normal;
22
+ color: black;
23
+ margin-bottom: 4px;
24
+ }
25
+
26
+ .linky {
27
+ color: #1479c6;
28
+ text-decoration: none;
29
+ cursor: pointer;
30
+ }