@3t-transform/threeteeui 0.0.16 → 0.0.18

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 (125) hide show
  1. package/dist/cjs/{index-864b7110.js → index-bf777121.js} +3 -0
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/tttx-button.cjs.entry.js +25 -19
  4. package/dist/cjs/tttx-checkbox.cjs.entry.js +18 -18
  5. package/dist/cjs/tttx-form.cjs.entry.js +365 -365
  6. package/dist/cjs/tttx-icon.cjs.entry.js +14 -1856
  7. package/dist/cjs/tttx-input-calendar.cjs.entry.js +125 -0
  8. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +33 -0
  9. package/dist/cjs/tttx-list.cjs.entry.js +188 -188
  10. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  11. package/dist/cjs/tttx-popover-content.cjs.entry.js +13 -13
  12. package/dist/cjs/tttx-standalone-input.cjs.entry.js +127 -127
  13. package/dist/cjs/tttx-table.cjs.entry.js +50 -50
  14. package/dist/cjs/tttx.cjs.js +2 -2
  15. package/dist/collection/collection-manifest.json +2 -0
  16. package/dist/collection/components/atoms/tttx-button/tttx-button.css +94 -18
  17. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -93
  18. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +74 -27
  19. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +8 -5
  20. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -116
  21. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -47
  22. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +26 -0
  23. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +56 -0
  24. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +12 -0
  25. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -66
  26. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  27. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +97 -96
  28. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +23 -23
  29. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +102 -101
  30. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +9 -9
  31. package/dist/collection/components/molecules/tttx-form/tttx-form.css +95 -11
  32. package/dist/collection/components/molecules/tttx-form/tttx-form.js +452 -451
  33. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +109 -109
  34. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.css +93 -0
  35. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.js +174 -0
  36. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.js +27 -0
  37. package/dist/collection/components/molecules/tttx-list/tttx-list.js +312 -311
  38. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +14 -14
  39. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +570 -569
  40. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +134 -134
  41. package/dist/collection/components/molecules/tttx-table/tttx-table.js +174 -177
  42. package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +65 -65
  43. package/dist/collection/components/palette.stories.js +7 -7
  44. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  45. package/dist/collection/icons.js +2838 -2838
  46. package/dist/collection/index.js +1 -1
  47. package/dist/components/index.d.ts +2 -0
  48. package/dist/components/index.js +2 -0
  49. package/dist/components/tttx-button.js +1 -40
  50. package/dist/components/tttx-button2.js +56 -0
  51. package/dist/components/tttx-checkbox.js +36 -36
  52. package/dist/components/tttx-form.js +382 -382
  53. package/dist/components/tttx-icon2.js +32 -1874
  54. package/dist/components/tttx-input-calendar.d.ts +11 -0
  55. package/dist/components/tttx-input-calendar.js +157 -0
  56. package/dist/components/tttx-keyvalue-block.d.ts +11 -0
  57. package/dist/components/tttx-keyvalue-block.js +49 -0
  58. package/dist/components/tttx-list.js +214 -214
  59. package/dist/components/tttx-loading-spinner2.js +33 -33
  60. package/dist/components/tttx-popover-content2.js +32 -32
  61. package/dist/components/tttx-standalone-input.js +168 -169
  62. package/dist/components/tttx-table.js +79 -79
  63. package/dist/esm/{index-232e347b.js → index-a05bd606.js} +3 -0
  64. package/dist/esm/loader.js +3 -3
  65. package/dist/esm/polyfills/core-js.js +0 -0
  66. package/dist/esm/polyfills/dom.js +0 -0
  67. package/dist/esm/polyfills/es5-html-element.js +0 -0
  68. package/dist/esm/polyfills/index.js +0 -0
  69. package/dist/esm/polyfills/system.js +0 -0
  70. package/dist/esm/tttx-button.entry.js +25 -19
  71. package/dist/esm/tttx-checkbox.entry.js +18 -18
  72. package/dist/esm/tttx-form.entry.js +365 -365
  73. package/dist/esm/tttx-icon.entry.js +14 -1856
  74. package/dist/esm/tttx-input-calendar.entry.js +121 -0
  75. package/dist/esm/tttx-keyvalue-block.entry.js +29 -0
  76. package/dist/esm/tttx-list.entry.js +188 -188
  77. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  78. package/dist/esm/tttx-popover-content.entry.js +13 -13
  79. package/dist/esm/tttx-standalone-input.entry.js +127 -127
  80. package/dist/esm/tttx-table.entry.js +50 -50
  81. package/dist/esm/tttx.js +3 -3
  82. package/dist/tttx/{p-3973b7dd.entry.js → p-037d286f.entry.js} +1 -1
  83. package/dist/tttx/{p-184c4fae.js → p-07b134af.js} +1 -1
  84. package/dist/tttx/{p-125f06b3.entry.js → p-1b63f16a.entry.js} +1 -1
  85. package/dist/tttx/p-45afb84c.entry.js +1 -0
  86. package/dist/tttx/p-68ff0f39.entry.js +1 -0
  87. package/dist/tttx/{p-6828fe6f.entry.js → p-93763d3c.entry.js} +1 -1
  88. package/dist/tttx/p-a5808741.entry.js +1 -0
  89. package/dist/tttx/{p-fe4c70b2.entry.js → p-a92ca87e.entry.js} +1 -1
  90. package/dist/tttx/{p-5ce1ba22.entry.js → p-a96ca037.entry.js} +1 -1
  91. package/dist/tttx/p-dc087fd8.entry.js +1 -0
  92. package/dist/tttx/p-e3cc75bb.entry.js +1 -0
  93. package/dist/tttx/{p-01e1894e.entry.js → p-f579ed1e.entry.js} +1 -1
  94. package/dist/tttx/tttx.esm.js +1 -1
  95. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -9
  96. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -20
  97. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -14
  98. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -21
  99. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +4 -0
  100. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +6 -0
  101. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  102. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  103. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +7 -7
  104. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +18 -18
  105. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -9
  106. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -6
  107. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +134 -134
  108. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +12 -12
  109. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.d.ts +19 -0
  110. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.d.ts +26 -0
  111. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +51 -51
  112. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +13 -13
  113. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -38
  114. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -106
  115. package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +15 -15
  116. package/dist/types/components/molecules/tttx-table/tttx-table.stories.d.ts +21 -21
  117. package/dist/types/components/palette.stories.d.ts +6 -6
  118. package/dist/types/components.d.ts +46 -15
  119. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  120. package/dist/types/icons.d.ts +2 -2
  121. package/dist/types/index.d.ts +1 -1
  122. package/package.json +4 -4
  123. package/dist/tttx/p-10316ff1.entry.js +0 -1
  124. package/dist/tttx/p-b1c22f5f.entry.js +0 -1
  125. package/dist/tttx/p-c7f9be65.entry.js +0 -1
@@ -1,93 +1,110 @@
1
- import { Host, h } from '@stencil/core';
2
- export class TttxButton {
3
- constructor() {
4
- this.fontColor = undefined;
5
- this.buttonStyle = undefined;
6
- }
7
- onClick() {
8
- this.clickEvent.emit('clicked');
9
- }
10
- onClicked(event) {
11
- console.log('Picked up a clickEvent', event);
12
- }
13
- render() {
14
- return (h(Host, null, h("button", { onClick: this.onClick.bind(this), class: `button ${this.fontColor} ${this.buttonStyle}` }, h("span", null, h("slot", null)))));
15
- }
16
- static get is() { return "tttx-button"; }
17
- static get encapsulation() { return "shadow"; }
18
- static get originalStyleUrls() {
19
- return {
20
- "$": ["tttx-button.scss"]
21
- };
22
- }
23
- static get styleUrls() {
24
- return {
25
- "$": ["tttx-button.css"]
26
- };
27
- }
28
- static get properties() {
29
- return {
30
- "fontColor": {
31
- "type": "string",
32
- "mutable": false,
33
- "complexType": {
34
- "original": "string",
35
- "resolved": "string",
36
- "references": {}
37
- },
38
- "required": false,
39
- "optional": false,
40
- "docs": {
41
- "tags": [],
42
- "text": ""
43
- },
44
- "attribute": "font-color",
45
- "reflect": false
46
- },
47
- "buttonStyle": {
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": "button-style",
62
- "reflect": false
63
- }
64
- };
65
- }
66
- static get events() {
67
- return [{
68
- "method": "clickEvent",
69
- "name": "clickEvent",
70
- "bubbles": true,
71
- "cancelable": true,
72
- "composed": true,
73
- "docs": {
74
- "tags": [],
75
- "text": ""
76
- },
77
- "complexType": {
78
- "original": "string",
79
- "resolved": "string",
80
- "references": {}
81
- }
82
- }];
83
- }
84
- static get listeners() {
85
- return [{
86
- "name": "clickEvent",
87
- "method": "onClicked",
88
- "target": undefined,
89
- "capture": false,
90
- "passive": false
91
- }];
92
- }
93
- }
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
+ }
@@ -1,27 +1,74 @@
1
- export default {
2
- title: 'Atoms/Button',
3
- component: 'tttx-button',
4
- argTypes: {
5
- fontColor: {
6
- control: {
7
- type: 'select',
8
- options: ['font-white', 'font-black'],
9
- },
10
- },
11
- buttonStyle: {
12
- control: {
13
- type: 'select',
14
- options: ['primary-blue', 'secondary-white'],
15
- },
16
- },
17
- },
18
- };
19
- const Template = ({ content, fontColor, buttonStyle }) => `
20
- <tttx-button font-color=${fontColor} button-style=${buttonStyle}>${content}</tttx-button>
21
- `;
22
- export const Default = Template.bind({});
23
- Default.args = {
24
- content: 'My Button',
25
- fontColor: 'font-white',
26
- buttonStyle: 'primary-blue',
27
- };
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({});
@@ -20,7 +20,14 @@
20
20
  }
21
21
 
22
22
  :host {
23
- display: block;
23
+ display: inline-block;
24
+ cursor: default;
25
+ user-select: none;
26
+ }
27
+
28
+ .icon-size {
29
+ width: 24px;
30
+ height: 24px;
24
31
  }
25
32
 
26
33
  .tooltip {
@@ -98,8 +105,4 @@
98
105
 
99
106
  .white {
100
107
  color: white;
101
- }
102
-
103
- .clickable {
104
- cursor: pointer;
105
108
  }
@@ -1,116 +1,62 @@
1
- import { Host, h } from '@stencil/core';
2
- import { createPopper } from '@popperjs/core';
3
- export class TttxIcon {
4
- constructor() {
5
- this.icon = undefined;
6
- this.colour = 'grey';
7
- }
8
- handleDocumentClick(event) {
9
- if (!event.composedPath().includes(this.referenceElement)) {
10
- if (this.popperElement) {
11
- this.popperElement.removeAttribute('data-show');
12
- }
13
- if (this.popperInstance) {
14
- this.popperInstance.update();
15
- }
16
- }
17
- }
18
- componentWillLoad() {
19
- this.hasPopoverSlot = !!this.el.querySelector('[slot="popover"]');
20
- }
21
- componentDidLoad() {
22
- if (this.popperElement) {
23
- this.popperInstance = createPopper(this.referenceElement, this.popperElement, {
24
- placement: 'top',
25
- modifiers: [
26
- {
27
- name: 'flip',
28
- options: {
29
- fallbackPlacements: ['bottom'],
30
- },
31
- },
32
- {
33
- name: 'offset',
34
- options: {
35
- offset: [0, 12],
36
- },
37
- },
38
- ],
39
- });
40
- }
41
- }
42
- disconnectedCallback() {
43
- this.popperInstance.destroy();
44
- }
45
- render() {
46
- return (h(Host, null, h("span", { onClick: () => {
47
- if (this.popperElement) {
48
- this.popperElement.setAttribute('data-show', '');
49
- }
50
- if (this.popperInstance) {
51
- this.popperInstance.update();
52
- }
53
- }, ref: el => (this.referenceElement = el), class: `material-symbols-rounded ${this.colour ? this.colour : ''} ${this.hasPopoverSlot ? 'clickable' : ''}` }, this.icon), this.hasPopoverSlot && (h("div", { ref: el => (this.popperElement = el), class: "tooltip" }, h("slot", { name: "popover" }), h("div", { class: "arrow", "data-popper-arrow": true })))));
54
- }
55
- static get is() { return "tttx-icon"; }
56
- static get encapsulation() { return "shadow"; }
57
- static get originalStyleUrls() {
58
- return {
59
- "$": ["tttx-icon.scss"]
60
- };
61
- }
62
- static get styleUrls() {
63
- return {
64
- "$": ["tttx-icon.css"]
65
- };
66
- }
67
- static get properties() {
68
- return {
69
- "icon": {
70
- "type": "string",
71
- "mutable": false,
72
- "complexType": {
73
- "original": "string",
74
- "resolved": "string",
75
- "references": {}
76
- },
77
- "required": false,
78
- "optional": false,
79
- "docs": {
80
- "tags": [],
81
- "text": ""
82
- },
83
- "attribute": "icon",
84
- "reflect": false
85
- },
86
- "colour": {
87
- "type": "string",
88
- "mutable": false,
89
- "complexType": {
90
- "original": "string",
91
- "resolved": "string",
92
- "references": {}
93
- },
94
- "required": false,
95
- "optional": false,
96
- "docs": {
97
- "tags": [],
98
- "text": ""
99
- },
100
- "attribute": "colour",
101
- "reflect": false,
102
- "defaultValue": "'grey'"
103
- }
104
- };
105
- }
106
- static get elementRef() { return "el"; }
107
- static get listeners() {
108
- return [{
109
- "name": "click",
110
- "method": "handleDocumentClick",
111
- "target": "document",
112
- "capture": false,
113
- "passive": false
114
- }];
115
- }
116
- }
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
+ }
@@ -1,47 +1,22 @@
1
- import icons from './../../../icons';
2
- const colours = ['red', 'blue', 'black', 'grey', 'green'];
3
- export default {
4
- title: 'Atoms/Icons',
5
- component: 'tttx-icon',
6
- argTypes: {
7
- icon: {
8
- control: {
9
- type: 'select',
10
- options: icons,
11
- },
12
- },
13
- colour: {
14
- control: {
15
- type: 'select',
16
- options: colours,
17
- },
18
- },
19
- },
20
- };
21
- const Template = ({ icon, colour }) => `<tttx-icon icon="${icon}" colour="${colour}" />`;
22
- export const Basic = Template.bind({});
23
- Basic.args = {
24
- icon: 'warning',
25
- colour: 'red',
26
- };
27
- const WithPopoverTemplate = ({ icon, colour }) => `
28
- <div style="overflow: auto; height: 300px;">
29
- <div style="margin-top:150px; height:300px;">
30
- <tttx-icon icon="${icon}" colour="${colour}">
31
- <div slot="popover">
32
- <tttx-popover-content
33
- header="The humble egg"
34
- body="Most arthropods such as insects, vertebrates (excluding live-bearing mammals), and mollusks lay eggs, although some, such as scorpions, do not."
35
- linkcontext="Wikipedia_egg"
36
- linktext="Learn more about eggs"
37
- />
38
- </div>
39
- </tttx-icon>
40
- </div>
41
- </div>
42
- `;
43
- export const WithPopover = WithPopoverTemplate.bind({});
44
- WithPopover.args = {
45
- icon: 'warning',
46
- colour: 'red',
47
- };
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
+ }