@3t-transform/threeteeui 0.0.6 → 0.0.8

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 (121) hide show
  1. package/dist/cjs/{index-8a7479e4.js → index-8a4cb9bc.js} +256 -407
  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-icon.cjs.entry.js +1845 -5
  7. package/dist/cjs/tttx-input.cjs.entry.js +44 -0
  8. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +26 -0
  9. package/dist/cjs/tttx-popover-content.cjs.entry.js +23 -0
  10. package/dist/cjs/tttx.cjs.js +7 -3
  11. package/dist/collection/collection-manifest.json +9 -5
  12. package/dist/collection/components/atoms/tttx-button/tttx-button.css +61 -0
  13. package/dist/collection/components/atoms/tttx-button/tttx-button.js +93 -0
  14. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +27 -0
  15. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +101 -0
  16. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +114 -0
  17. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +47 -0
  18. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +48 -0
  19. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +66 -0
  20. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +15 -0
  21. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.css +30 -0
  22. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +96 -0
  23. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +23 -0
  24. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +135 -0
  25. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +101 -0
  26. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +13 -0
  27. package/dist/collection/components/molecules/tttx-form/tttx-form.js +109 -0
  28. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +33 -0
  29. package/dist/collection/components/molecules/tttx-input/tttx-input.css +149 -0
  30. package/dist/collection/components/molecules/tttx-input/tttx-input.js +259 -0
  31. package/dist/collection/components/molecules/tttx-input/tttx-input.stories.js +106 -0
  32. package/dist/collection/components/palette.stories.js +88 -0
  33. package/dist/collection/icons.js +2838 -0
  34. package/dist/components/index.d.ts +16 -3
  35. package/dist/components/index.js +7 -3
  36. package/dist/components/{tttx-worksheet.d.ts → tttx-button.d.ts} +4 -4
  37. package/dist/components/tttx-button.js +45 -0
  38. package/dist/components/tttx-checkbox.d.ts +11 -0
  39. package/dist/components/tttx-checkbox.js +46 -0
  40. package/dist/components/{tttx-page.d.ts → tttx-form.d.ts} +4 -4
  41. package/dist/components/tttx-form.js +75 -0
  42. package/dist/components/tttx-icon.js +1 -32
  43. package/dist/components/tttx-icon2.js +1875 -0
  44. package/dist/components/tttx-input.d.ts +11 -0
  45. package/dist/components/tttx-input.js +77 -0
  46. package/dist/components/tttx-loading-spinner.d.ts +11 -0
  47. package/dist/components/tttx-loading-spinner.js +43 -0
  48. package/dist/components/tttx-popover-content.d.ts +11 -0
  49. package/dist/components/tttx-popover-content.js +42 -0
  50. package/dist/esm/{index-854ff56f.js → index-9654537d.js} +254 -408
  51. package/dist/esm/loader.js +4 -3
  52. package/dist/esm/polyfills/css-shim.js +1 -1
  53. package/dist/esm/tttx-button.entry.js +24 -0
  54. package/dist/esm/tttx-checkbox.entry.js +24 -0
  55. package/dist/esm/tttx-form.entry.js +54 -0
  56. package/dist/esm/tttx-icon.entry.js +1845 -5
  57. package/dist/esm/tttx-input.entry.js +40 -0
  58. package/dist/esm/tttx-loading-spinner.entry.js +22 -0
  59. package/dist/esm/tttx-popover-content.entry.js +19 -0
  60. package/dist/esm/tttx.js +4 -3
  61. package/dist/tttx/p-1884203f.entry.js +1 -0
  62. package/dist/tttx/p-317b13d3.entry.js +1 -0
  63. package/dist/tttx/p-3cb692d6.entry.js +1 -0
  64. package/dist/tttx/p-3cd7ad04.entry.js +1 -0
  65. package/dist/tttx/p-674e2f18.entry.js +1 -0
  66. package/dist/tttx/p-a23389f1.entry.js +1 -0
  67. package/dist/tttx/p-b6cc2780.js +2 -0
  68. package/dist/tttx/p-f30a0e84.entry.js +1 -0
  69. package/dist/tttx/tttx.esm.js +1 -1
  70. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +9 -0
  71. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +20 -0
  72. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +14 -0
  73. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +21 -0
  74. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -0
  75. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +5 -0
  76. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +7 -0
  77. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +18 -0
  78. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -0
  79. package/dist/types/{docs/template.stories.d.ts → components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts} +1 -0
  80. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +11 -0
  81. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +13 -0
  82. package/dist/types/components/molecules/tttx-input/tttx-input.d.ts +20 -0
  83. package/dist/types/components/molecules/tttx-input/tttx-input.stories.d.ts +60 -0
  84. package/dist/types/components/palette.stories.d.ts +6 -0
  85. package/dist/types/components.d.ts +142 -38
  86. package/dist/types/icons.d.ts +2 -0
  87. package/dist/types/stencil-public-runtime.d.ts +59 -3
  88. package/loader/index.d.ts +9 -0
  89. package/package.json +33 -25
  90. package/readme.md +14 -32
  91. package/dist/cjs/toolbar-656be6e6.js +0 -34259
  92. package/dist/cjs/tttx-page.cjs.entry.js +0 -927
  93. package/dist/cjs/tttx-worksheet.cjs.entry.js +0 -47
  94. package/dist/collection/components/components/tttx-icon/tttx-icon.css +0 -89
  95. package/dist/collection/components/components/tttx-icon/tttx-icon.js +0 -59
  96. package/dist/collection/components/components/tttx-icon/tttx-icon.stories.js +0 -40
  97. package/dist/collection/components/patterns/tttx-page/tttx-page.css +0 -162
  98. package/dist/collection/components/patterns/tttx-page/tttx-page.js +0 -213
  99. package/dist/collection/components/patterns/tttx-page/tttx-page.stories.js +0 -80
  100. package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.css +0 -134
  101. package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.js +0 -70
  102. package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.stories.js +0 -44
  103. package/dist/collection/docs/template.stories.js +0 -10
  104. package/dist/components/tttx-page.js +0 -953
  105. package/dist/components/tttx-worksheet.js +0 -6
  106. package/dist/components/tttx-worksheet2.js +0 -34288
  107. package/dist/esm/toolbar-cede4385.js +0 -34231
  108. package/dist/esm/tttx-page.entry.js +0 -923
  109. package/dist/esm/tttx-worksheet.entry.js +0 -43
  110. package/dist/tttx/p-4b57de2e.entry.js +0 -1
  111. package/dist/tttx/p-61f78304.entry.js +0 -1
  112. package/dist/tttx/p-7244abd4.entry.js +0 -1
  113. package/dist/tttx/p-d038fe18.js +0 -1
  114. package/dist/tttx/p-ddfeb0ba.js +0 -2
  115. package/dist/tttx/tttx.css +0 -1
  116. package/dist/types/components/components/tttx-icon/tttx-icon.d.ts +0 -5
  117. package/dist/types/components/components/tttx-icon/tttx-icon.stories.d.ts +0 -24
  118. package/dist/types/components/patterns/tttx-page/tttx-page.d.ts +0 -21
  119. package/dist/types/components/patterns/tttx-page/tttx-page.stories.d.ts +0 -48
  120. package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.d.ts +0 -9
  121. package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.stories.d.ts +0 -23
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-8a4cb9bc.js');
6
+
7
+ const tttxInputCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.field{clear:both}.container{display:flex;flex-wrap:wrap;box-sizing:border-box;height:36px;border:1px solid #c8c8c8;border-radius:4px}.icon-left,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.input{flex-grow:1;border:none;outline:none;font-size:16px;padding:8px 16px;background-color:transparent}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.label{display:block;height:18px;font-weight:600;color:#212121;font-size:16px;margin-bottom:4px;z-index:1}.disabled{background:#f0f0f0;color:#9e9e9e;border-color:#c8c8c8}.focused{border-color:#1479c6}.errormsg{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;border-radius:none;z-index:2;color:#DC0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#DC0000}.danger{color:#DC0000}.optional{color:#757575;font-weight:normal}:host{display:block}.spacing{margin-bottom:16px}.errorstate{border-color:#DC0000}.icon-right{margin-top:5px;margin-right:4px}.icon-left{margin-top:5px;margin-left:4px}";
8
+
9
+ const TttxInput = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.valueChanged = index.createEvent(this, "valueChanged", 7);
13
+ this.handleFocus = () => {
14
+ this.isfocused = true;
15
+ };
16
+ this.handleBlur = () => {
17
+ this.isfocused = false;
18
+ };
19
+ this.isfocused = false;
20
+ this.label = undefined;
21
+ this.valid = undefined;
22
+ this.showerrormsg = undefined;
23
+ this.errormsg = undefined;
24
+ this.value = undefined;
25
+ this.type = 'text';
26
+ this.placeholder = undefined;
27
+ this.pattern = undefined;
28
+ this.iconleft = undefined;
29
+ this.iconright = undefined;
30
+ this.required = undefined;
31
+ }
32
+ handleChange(event) {
33
+ const target = event.target;
34
+ this.value = target.value;
35
+ this.valueChanged.emit(target.value);
36
+ }
37
+ render() {
38
+ const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : '', this.iconleft ? 'iconleft' : ''].join(' ');
39
+ return (index.h(index.Host, null, index.h("div", { class: "field spacing" }, this.label && index.h("label", { class: "label" }, this.label, !this.required ? index.h("span", { class: "optional" }, " (optional)") : ''), index.h("div", { class: inputClass }, this.iconleft && (index.h("div", { class: "icon-left" }, index.h("tttx-icon", { icon: this.iconleft, colour: "grey" }))), index.h("input", { class: "input", onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this), type: this.type, placeholder: this.placeholder, value: this.value, onInput: event => this.handleChange(event) }), this.iconright && (index.h("div", { class: "icon-right" }, index.h("tttx-icon", { icon: this.iconright, colour: "grey" })))), this.showerrormsg && this.errormsg && index.h("div", { class: "errormsg" }, index.h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
40
+ }
41
+ };
42
+ TttxInput.style = tttxInputCss;
43
+
44
+ exports.tttx_input = TttxInput;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-8a4cb9bc.js');
6
+
7
+ const tttxLoadingSpinnerCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.spinner-container{position:absolute}.loading-box{display:flex;align-items:center;justify-content:center}.loading-text{font-size:16px;font-weight:400;padding-top:10px;text-align:center}.spinner{border:solid #1479c6;border-bottom-color:#D5D5D5;border-radius:50%;position:relative;box-sizing:border-box;animation:rotation 1s linear infinite}.spinner.small{height:20px;width:20px;border-width:4px}.spinner.large{height:60px;width:60px;border-width:8px}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
8
+
9
+ const TttxLoadingSpinner = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.loadingMessage = undefined;
13
+ this.size = 'large';
14
+ }
15
+ renderLoadingMessage() {
16
+ if (!this.loadingMessage)
17
+ return '';
18
+ return index.h("div", { class: 'loading-text' }, "Loading, please wait...");
19
+ }
20
+ render() {
21
+ return index.h("div", { class: 'spinner-container' }, index.h("div", { class: "loading-box" }, index.h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage());
22
+ }
23
+ };
24
+ TttxLoadingSpinner.style = tttxLoadingSpinnerCss;
25
+
26
+ exports.tttx_loading_spinner = TttxLoadingSpinner;
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-8a4cb9bc.js');
6
+
7
+ const tttxPopoverContentCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:block;max-width:400px}h4{margin:0;font-size:15px;font-weight:700;color:black;margin-bottom:4px}p{margin:0;font-size:14px;font-weight:normal;color:black;margin-bottom:4px}.linky{color:#1479c6;text-decoration:none;cursor:pointer}";
8
+
9
+ const TttxPopoverContent = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.header = undefined;
13
+ this.body = undefined;
14
+ this.linkcontext = undefined;
15
+ this.linktext = undefined;
16
+ }
17
+ render() {
18
+ return (index.h(index.Host, null, this.header && index.h("h4", null, this.header), this.body && index.h("p", null, this.body), this.linkcontext && index.h("span", { class: "linky", onClick: (evt) => console.log(this.linkcontext, evt) }, this.linktext || 'More Information')));
19
+ }
20
+ };
21
+ TttxPopoverContent.style = tttxPopoverContentCss;
22
+
23
+ exports.tttx_popover_content = TttxPopoverContent;
@@ -1,9 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-8a7479e4.js');
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-8a4cb9bc.js');
4
6
 
5
7
  /*
6
- Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
7
9
  */
8
10
  const patchBrowser = () => {
9
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('tttx.cjs.js', document.baseURI).href));
@@ -15,5 +17,7 @@ const patchBrowser = () => {
15
17
  };
16
18
 
17
19
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["tttx-worksheet.cjs",[[4,"tttx-worksheet",{"pageSize":[1,"page-size"]}]]],["tttx-page.cjs",[[4,"tttx-page",{"appName":[1,"app-name"],"pageTitle":[1,"page-title"],"lastUpdated":[1,"last-updated"],"manageAccountsUrl":[1,"manage-accounts-url"],"logoutUrl":[1,"logout-url"],"pageSize":[1,"page-size"],"helpUrl":[1,"help-url"]}]]],["tttx-icon.cjs",[[0,"tttx-icon",{"name":[1],"color":[1]}]]]], options);
20
+ return index.bootstrapLazy([["tttx-input.cjs",[[1,"tttx-input",{"label":[1],"valid":[4],"showerrormsg":[4],"errormsg":[1],"value":[1025],"type":[1],"placeholder":[1],"pattern":[1],"iconleft":[1],"iconright":[1],"required":[4],"isfocused":[32]}]]],["tttx-button.cjs",[[1,"tttx-button",{"fontColor":[1,"font-color"],"buttonStyle":[1,"button-style"]},[[0,"clickEvent","onClicked"]]]]],["tttx-checkbox.cjs",[[1,"tttx-checkbox",{"value":[4],"label":[1],"required":[4]}]]],["tttx-form.cjs",[[1,"tttx-form",{"dataAttribute":[1,"data-attribute"],"functionAttribute":[1,"function-attribute"]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-popover-content.cjs",[[1,"tttx-popover-content",{"header":[1],"body":[1],"linkcontext":[1],"linktext":[1]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"colour":[1]},[[4,"click","handleDocumentClick"]]]]]], options);
19
21
  });
22
+
23
+ exports.setNonce = index.setNonce;
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "entries": [
3
- "./components/components/tttx-icon/tttx-icon.js",
4
- "./components/patterns/tttx-page/tttx-page.js",
5
- "./components/patterns/tttx-worksheet/tttx-worksheet.js"
3
+ "./components/atoms/tttx-button/tttx-button.js",
4
+ "./components/atoms/tttx-icon/tttx-icon.js",
5
+ "./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js",
6
+ "./components/atoms/tttx-popover-content/tttx-popover-content.js",
7
+ "./components/atoms/ttx-checkbox/tttx-checkbox.js",
8
+ "./components/molecules/tttx-form/tttx-form.js",
9
+ "./components/molecules/tttx-input/tttx-input.js"
6
10
  ],
7
11
  "compiler": {
8
12
  "name": "@stencil/core",
9
- "version": "2.20.0",
10
- "typescriptVersion": "4.8.4"
13
+ "version": "2.22.3",
14
+ "typescriptVersion": "4.9.4"
11
15
  },
12
16
  "collections": [],
13
17
  "bundles": []
@@ -0,0 +1,61 @@
1
+ .material-symbols-rounded {
2
+ font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
3
+ }
4
+
5
+ .button {
6
+ height: 36px;
7
+ padding: 8px 16px;
8
+ margin: 0;
9
+ background: transparent;
10
+ color: #212121;
11
+ border: 1px solid #c8c8c8;
12
+ border-radius: 4px;
13
+ text-transform: uppercase;
14
+ display: flex;
15
+ justify-content: left;
16
+ align-items: center;
17
+ font-size: 14px;
18
+ font-weight: 400;
19
+ }
20
+
21
+ .button:hover {
22
+ background: #f0f0f0;
23
+ }
24
+
25
+ .button:active {
26
+ background: #e3e3e3;
27
+ }
28
+
29
+ .primary-blue {
30
+ background: #1479c6;
31
+ border: 1px solid #1479c6;
32
+ }
33
+
34
+ .primary-blue:hover {
35
+ background: #1169ba;
36
+ }
37
+
38
+ .primary-blue:active {
39
+ background: #0951a8;
40
+ }
41
+
42
+ .secondary-white {
43
+ background: white;
44
+ border: 1px solid #212121;
45
+ }
46
+
47
+ :host {
48
+ display: inline-block;
49
+ }
50
+
51
+ .spacingleft {
52
+ margin-left: 8px;
53
+ }
54
+
55
+ .font-white {
56
+ color: white;
57
+ }
58
+
59
+ .font-black {
60
+ color: #212121;
61
+ }
@@ -0,0 +1,93 @@
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
+ }
@@ -0,0 +1,27 @@
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
+ };
@@ -0,0 +1,101 @@
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: block;
24
+ }
25
+
26
+ .tooltip {
27
+ background: #ffffff;
28
+ color: #343434;
29
+ font-weight: bold;
30
+ padding: 8px 16px;
31
+ font-size: 13px;
32
+ border-radius: 4px;
33
+ box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.3);
34
+ display: none;
35
+ }
36
+
37
+ .tooltip[data-show] {
38
+ display: block;
39
+ }
40
+
41
+ .arrow,
42
+ .arrow::before {
43
+ position: absolute;
44
+ width: 8px;
45
+ height: 8px;
46
+ background: inherit;
47
+ }
48
+
49
+ .arrow {
50
+ visibility: hidden;
51
+ }
52
+
53
+ .arrow::before {
54
+ visibility: visible;
55
+ content: "";
56
+ transform: rotate(45deg);
57
+ }
58
+
59
+ .tooltip[data-popper-placement^=top] > .arrow {
60
+ bottom: -4px;
61
+ }
62
+
63
+ .tooltip[data-popper-placement^=bottom] > .arrow {
64
+ top: -4px;
65
+ }
66
+
67
+ .tooltip[data-popper-placement^=left] > .arrow {
68
+ right: -4px;
69
+ }
70
+
71
+ .tooltip[data-popper-placement^=right] > .arrow {
72
+ left: -4px;
73
+ }
74
+
75
+ .red {
76
+ color: #DC0000;
77
+ }
78
+
79
+ .orange {
80
+ color: #F59500;
81
+ }
82
+
83
+ .blue {
84
+ color: #1479c6;
85
+ }
86
+
87
+ .green {
88
+ color: #A2BB31;
89
+ }
90
+
91
+ .gray {
92
+ color: #757575;
93
+ }
94
+
95
+ .black {
96
+ color: #212121;
97
+ }
98
+
99
+ .clickable {
100
+ cursor: pointer;
101
+ }
@@ -0,0 +1,114 @@
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
+ this.popperInstance = createPopper(this.referenceElement, this.popperElement, {
23
+ placement: 'top',
24
+ modifiers: [
25
+ {
26
+ name: 'flip',
27
+ options: {
28
+ fallbackPlacements: ['bottom'],
29
+ },
30
+ },
31
+ {
32
+ name: 'offset',
33
+ options: {
34
+ offset: [0, 12],
35
+ },
36
+ },
37
+ ],
38
+ });
39
+ }
40
+ disconnectedCallback() {
41
+ this.popperInstance.destroy();
42
+ }
43
+ render() {
44
+ return (h(Host, null, h("span", { onClick: () => {
45
+ if (this.popperElement) {
46
+ this.popperElement.setAttribute('data-show', '');
47
+ }
48
+ if (this.popperInstance) {
49
+ this.popperInstance.update();
50
+ }
51
+ }, 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 })))));
52
+ }
53
+ static get is() { return "tttx-icon"; }
54
+ static get encapsulation() { return "shadow"; }
55
+ static get originalStyleUrls() {
56
+ return {
57
+ "$": ["tttx-icon.scss"]
58
+ };
59
+ }
60
+ static get styleUrls() {
61
+ return {
62
+ "$": ["tttx-icon.css"]
63
+ };
64
+ }
65
+ static get properties() {
66
+ return {
67
+ "icon": {
68
+ "type": "string",
69
+ "mutable": false,
70
+ "complexType": {
71
+ "original": "string",
72
+ "resolved": "string",
73
+ "references": {}
74
+ },
75
+ "required": false,
76
+ "optional": false,
77
+ "docs": {
78
+ "tags": [],
79
+ "text": ""
80
+ },
81
+ "attribute": "icon",
82
+ "reflect": false
83
+ },
84
+ "colour": {
85
+ "type": "string",
86
+ "mutable": false,
87
+ "complexType": {
88
+ "original": "string",
89
+ "resolved": "string",
90
+ "references": {}
91
+ },
92
+ "required": false,
93
+ "optional": false,
94
+ "docs": {
95
+ "tags": [],
96
+ "text": ""
97
+ },
98
+ "attribute": "colour",
99
+ "reflect": false,
100
+ "defaultValue": "'grey'"
101
+ }
102
+ };
103
+ }
104
+ static get elementRef() { return "el"; }
105
+ static get listeners() {
106
+ return [{
107
+ "name": "click",
108
+ "method": "handleDocumentClick",
109
+ "target": "document",
110
+ "capture": false,
111
+ "passive": false
112
+ }];
113
+ }
114
+ }
@@ -0,0 +1,47 @@
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
+ };
@@ -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
+ }