@3t-transform/threeteeui 0.0.16 → 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 (118) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tttx-button.cjs.entry.js +24 -18
  3. package/dist/cjs/tttx-checkbox.cjs.entry.js +17 -17
  4. package/dist/cjs/tttx-form.cjs.entry.js +364 -364
  5. package/dist/cjs/tttx-icon.cjs.entry.js +12 -1854
  6. package/dist/cjs/tttx-input-calendar.cjs.entry.js +125 -0
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +33 -0
  8. package/dist/cjs/tttx-list.cjs.entry.js +187 -187
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +15 -15
  10. package/dist/cjs/tttx-popover-content.cjs.entry.js +12 -12
  11. package/dist/cjs/tttx-standalone-input.cjs.entry.js +125 -125
  12. package/dist/cjs/tttx-table.cjs.entry.js +49 -49
  13. package/dist/cjs/tttx.cjs.js +1 -1
  14. package/dist/collection/collection-manifest.json +2 -0
  15. package/dist/collection/components/atoms/tttx-button/tttx-button.css +94 -18
  16. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -93
  17. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +74 -27
  18. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +8 -5
  19. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -116
  20. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -47
  21. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +26 -0
  22. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +56 -0
  23. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +12 -0
  24. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -66
  25. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  26. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +97 -96
  27. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +23 -23
  28. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +102 -101
  29. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +9 -9
  30. package/dist/collection/components/molecules/tttx-form/tttx-form.css +95 -11
  31. package/dist/collection/components/molecules/tttx-form/tttx-form.js +452 -451
  32. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +109 -109
  33. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.css +93 -0
  34. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.js +174 -0
  35. package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.js +27 -0
  36. package/dist/collection/components/molecules/tttx-list/tttx-list.js +312 -311
  37. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +14 -14
  38. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +570 -569
  39. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +134 -134
  40. package/dist/collection/components/molecules/tttx-table/tttx-table.js +174 -177
  41. package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +65 -65
  42. package/dist/collection/components/palette.stories.js +7 -7
  43. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  44. package/dist/collection/icons.js +2838 -2838
  45. package/dist/collection/index.js +1 -1
  46. package/dist/components/index.d.ts +2 -0
  47. package/dist/components/index.js +2 -0
  48. package/dist/components/tttx-button.js +1 -40
  49. package/dist/components/tttx-button2.js +56 -0
  50. package/dist/components/tttx-checkbox.js +36 -36
  51. package/dist/components/tttx-form.js +382 -382
  52. package/dist/components/tttx-icon2.js +32 -1874
  53. package/dist/components/tttx-input-calendar.d.ts +11 -0
  54. package/dist/components/tttx-input-calendar.js +157 -0
  55. package/dist/components/tttx-keyvalue-block.d.ts +11 -0
  56. package/dist/components/tttx-keyvalue-block.js +49 -0
  57. package/dist/components/tttx-list.js +214 -214
  58. package/dist/components/tttx-loading-spinner2.js +33 -33
  59. package/dist/components/tttx-popover-content2.js +32 -32
  60. package/dist/components/tttx-standalone-input.js +168 -168
  61. package/dist/components/tttx-table.js +79 -79
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/polyfills/core-js.js +0 -0
  64. package/dist/esm/polyfills/dom.js +0 -0
  65. package/dist/esm/polyfills/es5-html-element.js +0 -0
  66. package/dist/esm/polyfills/index.js +0 -0
  67. package/dist/esm/polyfills/system.js +0 -0
  68. package/dist/esm/tttx-button.entry.js +25 -19
  69. package/dist/esm/tttx-checkbox.entry.js +17 -17
  70. package/dist/esm/tttx-form.entry.js +364 -364
  71. package/dist/esm/tttx-icon.entry.js +14 -1856
  72. package/dist/esm/tttx-input-calendar.entry.js +121 -0
  73. package/dist/esm/tttx-keyvalue-block.entry.js +29 -0
  74. package/dist/esm/tttx-list.entry.js +187 -187
  75. package/dist/esm/tttx-loading-spinner.entry.js +15 -15
  76. package/dist/esm/tttx-popover-content.entry.js +12 -12
  77. package/dist/esm/tttx-standalone-input.entry.js +125 -125
  78. package/dist/esm/tttx-table.entry.js +49 -49
  79. package/dist/esm/tttx.js +1 -1
  80. package/dist/tttx/{p-125f06b3.entry.js → p-1bc3dfee.entry.js} +1 -1
  81. package/dist/tttx/p-1cf8f9e8.entry.js +1 -0
  82. package/dist/tttx/p-220f7519.entry.js +1 -0
  83. package/dist/tttx/{p-5ce1ba22.entry.js → p-5247e827.entry.js} +1 -1
  84. package/dist/tttx/p-81904eed.entry.js +1 -0
  85. package/dist/tttx/p-cf107fb6.entry.js +1 -0
  86. package/dist/tttx/p-f56fe662.entry.js +1 -0
  87. package/dist/tttx/tttx.esm.js +1 -1
  88. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -9
  89. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -20
  90. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -14
  91. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -21
  92. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +4 -0
  93. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +6 -0
  94. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  95. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  96. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +7 -7
  97. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +18 -18
  98. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -9
  99. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -6
  100. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +134 -134
  101. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +12 -12
  102. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.d.ts +19 -0
  103. package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.d.ts +26 -0
  104. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +51 -51
  105. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +13 -13
  106. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -38
  107. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -106
  108. package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +15 -15
  109. package/dist/types/components/molecules/tttx-table/tttx-table.stories.d.ts +21 -21
  110. package/dist/types/components/palette.stories.d.ts +6 -6
  111. package/dist/types/components.d.ts +46 -15
  112. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  113. package/dist/types/icons.d.ts +2 -2
  114. package/dist/types/index.d.ts +1 -1
  115. package/package.json +4 -4
  116. package/dist/tttx/p-10316ff1.entry.js +0 -1
  117. package/dist/tttx/p-b1c22f5f.entry.js +0 -1
  118. 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
+ }