@haiilo/catalyst 0.2.3 → 0.4.0

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 (241) hide show
  1. package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  2. package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
  3. package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  4. package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
  5. package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
  6. package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  37. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  38. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  39. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  40. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  41. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  42. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  43. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  44. package/dist/catalyst/catalyst.css +1 -1959
  45. package/dist/catalyst/catalyst.esm.js +1 -131
  46. package/dist/catalyst/catalyst.esm.js.map +1 -1
  47. package/dist/catalyst/index.esm.js +1 -2
  48. package/dist/catalyst/index.esm.js.map +1 -1
  49. package/dist/catalyst/p-89a97b7b.entry.js +10 -0
  50. package/dist/catalyst/p-89a97b7b.entry.js.map +1 -0
  51. package/dist/catalyst/p-ed826597.js +2 -0
  52. package/dist/catalyst/p-ed826597.js.map +1 -0
  53. package/dist/catalyst/p-ef0a8ae9.js +2 -0
  54. package/dist/catalyst/p-ef0a8ae9.js.map +1 -0
  55. package/dist/catalyst/p-f151cb13.js +2 -0
  56. package/dist/catalyst/p-f151cb13.js.map +1 -0
  57. package/dist/cjs/app-globals-7f2b1f8e.js +173 -0
  58. package/dist/cjs/app-globals-7f2b1f8e.js.map +1 -0
  59. package/dist/cjs/cat-alert_9.cjs.entry.js +4557 -0
  60. package/dist/cjs/cat-alert_9.cjs.entry.js.map +1 -0
  61. package/dist/cjs/cat-icon-registry-850c538c.js +47 -0
  62. package/dist/cjs/cat-icon-registry-850c538c.js.map +1 -0
  63. package/dist/cjs/catalyst.cjs.js +24 -0
  64. package/dist/cjs/catalyst.cjs.js.map +1 -0
  65. package/dist/cjs/index-c0881ae0.js +1348 -0
  66. package/dist/cjs/index-c0881ae0.js.map +1 -0
  67. package/dist/cjs/index.cjs.js +11 -0
  68. package/dist/cjs/index.cjs.js.map +1 -0
  69. package/dist/cjs/loader.cjs.js +26 -0
  70. package/dist/cjs/loader.cjs.js.map +1 -0
  71. package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  72. package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
  73. package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  74. package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
  75. package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
  76. package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  77. package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
  78. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  79. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  80. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  81. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  82. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  83. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  84. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  87. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  88. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  89. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  90. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  92. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  93. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  94. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  95. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  96. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  97. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  98. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  99. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  100. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  101. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  102. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  103. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  104. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  105. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  106. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  107. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  108. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  109. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  110. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  111. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  112. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  113. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  114. package/dist/collection/collection-manifest.json +21 -0
  115. package/dist/collection/components/cat-alert/cat-alert.css +57 -0
  116. package/dist/collection/components/cat-alert/cat-alert.js +50 -0
  117. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -0
  118. package/dist/collection/components/cat-badge/cat-badge.css +154 -0
  119. package/dist/collection/components/cat-badge/cat-badge.js +142 -0
  120. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -0
  121. package/dist/collection/components/cat-button/cat-button.css +323 -0
  122. package/dist/collection/components/cat-button/cat-button.js +591 -0
  123. package/dist/collection/components/cat-button/cat-button.js.map +1 -0
  124. package/dist/collection/components/cat-icon/cat-icon-registry.js +42 -0
  125. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -0
  126. package/dist/collection/components/cat-icon/cat-icon.css +50 -0
  127. package/dist/collection/components/cat-icon/cat-icon.js +90 -0
  128. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -0
  129. package/dist/collection/components/cat-menu/cat-menu.css +33 -0
  130. package/dist/collection/components/cat-menu/cat-menu.js +184 -0
  131. package/dist/collection/components/cat-menu/cat-menu.js.map +1 -0
  132. package/dist/collection/components/cat-scrollable/cat-scrollable.css +69 -0
  133. package/dist/collection/components/cat-scrollable/cat-scrollable.js +309 -0
  134. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -0
  135. package/dist/collection/components/cat-skeleton/cat-skeleton.css +177 -0
  136. package/dist/collection/components/cat-skeleton/cat-skeleton.js +131 -0
  137. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -0
  138. package/dist/collection/components/cat-spinner/cat-spinner.css +63 -0
  139. package/dist/collection/components/cat-spinner/cat-spinner.js +65 -0
  140. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -0
  141. package/dist/collection/components/cat-tooltip/cat-tooltip.css +37 -0
  142. package/dist/collection/components/cat-tooltip/cat-tooltip.js +254 -0
  143. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -0
  144. package/dist/collection/index.cdn.js +21 -0
  145. package/dist/collection/index.js +2 -0
  146. package/dist/collection/index.js.map +1 -0
  147. package/dist/collection/init.js +9 -0
  148. package/dist/collection/init.js.map +1 -0
  149. package/dist/collection/utils/breakpoints.js +12 -0
  150. package/dist/collection/utils/breakpoints.js.map +1 -0
  151. package/dist/collection/utils/first-tabbable.js +6 -0
  152. package/dist/collection/utils/first-tabbable.js.map +1 -0
  153. package/dist/collection/utils/is-touch-screen.js +3 -0
  154. package/dist/collection/utils/is-touch-screen.js.map +1 -0
  155. package/dist/collection/utils/media-matcher.js +55 -0
  156. package/dist/collection/utils/media-matcher.js.map +1 -0
  157. package/dist/collection/utils/platform.js +50 -0
  158. package/dist/collection/utils/platform.js.map +1 -0
  159. package/dist/collection/utils/utils.js +4 -0
  160. package/dist/collection/utils/utils.js.map +1 -0
  161. package/dist/{catalyst/cat-alert.entry.js → components/cat-alert.js} +28 -8
  162. package/dist/components/cat-alert.js.map +1 -0
  163. package/dist/{catalyst/cat-badge.entry.js → components/cat-badge.js} +32 -8
  164. package/dist/components/cat-badge.js.map +1 -0
  165. package/dist/{catalyst/cat-button.entry.js → components/cat-button.js} +60 -41
  166. package/dist/components/cat-button.js.map +1 -0
  167. package/dist/components/cat-icon-registry.js +45 -0
  168. package/dist/components/cat-icon-registry.js.map +1 -0
  169. package/dist/components/cat-icon.js +8 -0
  170. package/dist/components/cat-icon.js.map +1 -0
  171. package/dist/{catalyst/cat-icon.entry.js → components/cat-icon2.js} +28 -9
  172. package/dist/components/cat-icon2.js.map +1 -0
  173. package/dist/components/cat-menu.js +870 -0
  174. package/dist/components/cat-menu.js.map +1 -0
  175. package/dist/components/cat-scrollable.js +1363 -0
  176. package/dist/components/cat-scrollable.js.map +1 -0
  177. package/dist/{catalyst/cat-skeleton.entry.js → components/cat-skeleton.js} +31 -8
  178. package/dist/components/cat-skeleton.js.map +1 -0
  179. package/dist/components/cat-spinner.js +8 -0
  180. package/dist/components/cat-spinner.js.map +1 -0
  181. package/dist/{catalyst/cat-spinner.entry.js → components/cat-spinner2.js} +26 -8
  182. package/dist/components/cat-spinner2.js.map +1 -0
  183. package/dist/components/{cat-input.d.ts → cat-tooltip.d.ts} +4 -4
  184. package/dist/components/cat-tooltip.js +154 -0
  185. package/dist/components/cat-tooltip.js.map +1 -0
  186. package/dist/components/first-tabbable.js +1495 -0
  187. package/dist/components/first-tabbable.js.map +1 -0
  188. package/dist/components/index.js +173 -0
  189. package/dist/components/index.js.map +1 -0
  190. package/dist/esm/app-globals-8af9b2cf.js +171 -0
  191. package/dist/esm/app-globals-8af9b2cf.js.map +1 -0
  192. package/dist/esm/cat-alert_9.entry.js +4545 -0
  193. package/dist/esm/cat-alert_9.entry.js.map +1 -0
  194. package/dist/{catalyst → esm}/cat-icon-registry-59da2e37.js +0 -0
  195. package/dist/{catalyst → esm}/cat-icon-registry-59da2e37.js.map +0 -0
  196. package/dist/esm/catalyst.js +22 -0
  197. package/dist/esm/catalyst.js.map +1 -0
  198. package/dist/esm/index-0ff35bca.js +1320 -0
  199. package/dist/esm/index-0ff35bca.js.map +1 -0
  200. package/dist/esm/index.js +3 -0
  201. package/dist/esm/index.js.map +1 -0
  202. package/dist/esm/loader.js +22 -0
  203. package/dist/esm/loader.js.map +1 -0
  204. package/dist/esm/polyfills/core-js.js +11 -0
  205. package/dist/esm/polyfills/css-shim.js +1 -0
  206. package/dist/esm/polyfills/dom.js +79 -0
  207. package/dist/esm/polyfills/es5-html-element.js +1 -0
  208. package/dist/esm/polyfills/index.js +34 -0
  209. package/dist/esm/polyfills/system.js +6 -0
  210. package/dist/index.cjs.js +1 -0
  211. package/dist/index.js +1 -0
  212. package/dist/types/components/cat-menu/cat-menu.d.ts +0 -1
  213. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +46 -0
  214. package/dist/types/components.d.ts +61 -0
  215. package/dist/types/index.d.ts +1 -0
  216. package/dist/types/utils/first-tabbable.d.ts +4 -0
  217. package/dist/types/utils/is-touch-screen.d.ts +2 -0
  218. package/package.json +12 -19
  219. package/dist/catalyst/app-globals-54573336.js +0 -718
  220. package/dist/catalyst/app-globals-54573336.js.map +0 -1
  221. package/dist/catalyst/cat-alert.entry.js.map +0 -1
  222. package/dist/catalyst/cat-badge.entry.js.map +0 -1
  223. package/dist/catalyst/cat-button.entry.js.map +0 -1
  224. package/dist/catalyst/cat-icon.entry.js.map +0 -1
  225. package/dist/catalyst/cat-input.entry.js +0 -55
  226. package/dist/catalyst/cat-input.entry.js.map +0 -1
  227. package/dist/catalyst/cat-menu.entry.js +0 -2986
  228. package/dist/catalyst/cat-menu.entry.js.map +0 -1
  229. package/dist/catalyst/cat-scrollable.entry.js +0 -4523
  230. package/dist/catalyst/cat-scrollable.entry.js.map +0 -1
  231. package/dist/catalyst/cat-skeleton.entry.js.map +0 -1
  232. package/dist/catalyst/cat-spinner.entry.js.map +0 -1
  233. package/dist/catalyst/css-shim-e6dd2538.js +0 -6
  234. package/dist/catalyst/css-shim-e6dd2538.js.map +0 -1
  235. package/dist/catalyst/dom-7fc649b0.js +0 -75
  236. package/dist/catalyst/dom-7fc649b0.js.map +0 -1
  237. package/dist/catalyst/index-2df805aa.js +0 -3059
  238. package/dist/catalyst/index-2df805aa.js.map +0 -1
  239. package/dist/catalyst/shadow-css-4d56fa31.js +0 -390
  240. package/dist/catalyst/shadow-css-4d56fa31.js.map +0 -1
  241. package/dist/types/components/cat-input/cat-input.d.ts +0 -70
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Auto-generated file. Do not edit directly.
3
+ */
4
+ /* stylelint-disable value-keyword-case */
5
+ /* stylelint-enable value-keyword-case */
6
+ :host {
7
+ display: inline-flex;
8
+ vertical-align: middle;
9
+ /* stylelint-disable property-no-vendor-prefix */
10
+ -webkit-user-select: none;
11
+ -ms-user-select: none;
12
+ user-select: none;
13
+ /* stylelint-enable property-no-vendor-prefix */
14
+ }
15
+ :host[hidden] {
16
+ display: none;
17
+ }
18
+
19
+ span {
20
+ display: inline-flex;
21
+ }
22
+
23
+ svg {
24
+ fill: none;
25
+ stroke: currentColor;
26
+ stroke-dasharray: 135px;
27
+ stroke-dashoffset: 95px;
28
+ stroke-linecap: round;
29
+ stroke-width: 5px;
30
+ transform-origin: center center;
31
+ animation: cat-spinner 0.75s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite;
32
+ width: 1em;
33
+ height: 1em;
34
+ }
35
+
36
+ .cat-spinner-xs svg {
37
+ font-size: 0.75rem;
38
+ }
39
+
40
+ .cat-spinner-s svg {
41
+ font-size: 1rem;
42
+ }
43
+
44
+ .cat-spinner-m svg {
45
+ font-size: 1.25rem;
46
+ }
47
+
48
+ .cat-spinner-l svg {
49
+ font-size: 1.5rem;
50
+ }
51
+
52
+ .cat-spinner-xl svg {
53
+ font-size: 1.75rem;
54
+ }
55
+
56
+ @keyframes cat-spinner {
57
+ from {
58
+ transform: rotate(0deg);
59
+ }
60
+ to {
61
+ transform: rotate(360deg);
62
+ }
63
+ }
@@ -0,0 +1,65 @@
1
+ import { Component, h, Prop } from '@stencil/core';
2
+ /**
3
+ * Spinners are used to indicate users that their action is being processed.
4
+ */
5
+ export class CatSpinner {
6
+ constructor() {
7
+ /**
8
+ * The size of the spinner.
9
+ */
10
+ this.size = 'm';
11
+ }
12
+ render() {
13
+ return (h("span", { "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
14
+ [`cat-spinner-${this.size}`]: this.size !== 'inline'
15
+ } },
16
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" },
17
+ h("circle", { cx: "24", cy: "24", r: "21.5" }))));
18
+ }
19
+ static get is() { return "cat-spinner"; }
20
+ static get encapsulation() { return "shadow"; }
21
+ static get originalStyleUrls() { return {
22
+ "$": ["cat-spinner.scss"]
23
+ }; }
24
+ static get styleUrls() { return {
25
+ "$": ["cat-spinner.css"]
26
+ }; }
27
+ static get properties() { return {
28
+ "size": {
29
+ "type": "string",
30
+ "mutable": false,
31
+ "complexType": {
32
+ "original": "'xs' | 's' | 'm' | 'l' | 'xl' | 'inline'",
33
+ "resolved": "\"inline\" | \"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
34
+ "references": {}
35
+ },
36
+ "required": false,
37
+ "optional": false,
38
+ "docs": {
39
+ "tags": [],
40
+ "text": "The size of the spinner."
41
+ },
42
+ "attribute": "size",
43
+ "reflect": false,
44
+ "defaultValue": "'m'"
45
+ },
46
+ "a11yLabel": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "string",
51
+ "resolved": "string | undefined",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": true,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": "Adds accessible label for the spinner that is only shown for screen\nreaders. The `aria-hidden` attribute will be set if no label is present."
59
+ },
60
+ "attribute": "a11y-label",
61
+ "reflect": false
62
+ }
63
+ }; }
64
+ }
65
+ //# sourceMappingURL=cat-spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-spinner.js","sourceRoot":"","sources":["../../../src/components/cat-spinner/cat-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AAMH,MAAM,OAAO,UAAU;EALvB;IAME;;OAEG;IACK,SAAI,GAA6C,GAAG,CAAC;GAuB9D;EAfC,MAAM;IACJ,OAAO,CACL,0BACc,IAAI,CAAC,SAAS,iBACb,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAC3C,KAAK,EAAE;QACL,CAAC,eAAe,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;OACrD;MAED,WAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW;QACzD,cAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,MAAM,GAAU,CACtC,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\n\n/**\n * Spinners are used to indicate users that their action is being processed.\n */\n@Component({\n tag: 'cat-spinner',\n styleUrl: 'cat-spinner.scss',\n shadow: true\n})\nexport class CatSpinner {\n /**\n * The size of the spinner.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the spinner that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <span\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n class={{\n [`cat-spinner-${this.size}`]: this.size !== 'inline'\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\">\n <circle cx=\"24\" cy=\"24\" r=\"21.5\"></circle>\n </svg>\n </span>\n );\n }\n}\n"]}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Auto-generated file. Do not edit directly.
3
+ */
4
+ /* stylelint-disable value-keyword-case */
5
+ /* stylelint-enable value-keyword-case */
6
+ :host {
7
+ display: contents;
8
+ }
9
+
10
+ :host([hidden]) {
11
+ display: none;
12
+ }
13
+
14
+ .tooltip {
15
+ position: absolute;
16
+ font-size: 0.875rem;
17
+ line-height: 1rem;
18
+ padding: 0.25rem;
19
+ background-color: rgba(0, 0, 0, 0.7);
20
+ border-radius: 0.125rem;
21
+ color: white;
22
+ white-space: nowrap;
23
+ transition: 0.13s linear;
24
+ visibility: hidden;
25
+ opacity: 0;
26
+ }
27
+ .tooltip-show {
28
+ opacity: 1;
29
+ visibility: visible;
30
+ }
31
+
32
+ .tooltip-trigger {
33
+ display: inline-block;
34
+ }
35
+ .tooltip-trigger:focus {
36
+ outline: none;
37
+ }
@@ -0,0 +1,254 @@
1
+ import { Component, h, Host, Listen, Prop } from '@stencil/core';
2
+ import { autoUpdate, computePosition, flip, offset } from '@floating-ui/dom';
3
+ import isTouchScreen from '../../utils/is-touch-screen';
4
+ import firstTabbable from '../../utils/first-tabbable';
5
+ let nextUniqueId = 0;
6
+ export class CatTooltip {
7
+ constructor() {
8
+ this.id = `cat-tooltip-${nextUniqueId++}`;
9
+ /**
10
+ * The content of the tooltip.
11
+ */
12
+ this.content = '';
13
+ /**
14
+ * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,
15
+ * and invisible. Corresponds with the native HTML disabled attribute.
16
+ */
17
+ this.disabled = false;
18
+ /**
19
+ * The placement of the tooltip.
20
+ */
21
+ this.placement = 'top';
22
+ /**
23
+ * The delay time for showing tooltip in ms.
24
+ */
25
+ this.showDelay = 1000;
26
+ /**
27
+ * The delay time for hiding tooltip in ms.
28
+ */
29
+ this.hideDelay = 0;
30
+ /**
31
+ * The duration of tap to show the tooltip.
32
+ */
33
+ this.longTouchDuration = 1000;
34
+ }
35
+ handleKeyDown({ key }) {
36
+ key === 'Escape' && this.hideListener();
37
+ }
38
+ componentDidLoad() {
39
+ var _a, _b, _c, _d, _e, _f, _g;
40
+ this.trigger = firstTabbable(this.triggerElement) || this.triggerElement;
41
+ if (!this.isTabbable) {
42
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('tabindex', '0');
43
+ }
44
+ if (this.trigger && this.tooltip) {
45
+ autoUpdate(this.trigger, this.tooltip, () => this.update());
46
+ }
47
+ if (isTouchScreen) {
48
+ (_b = this.trigger) === null || _b === void 0 ? void 0 : _b.addEventListener('touchstart', this.touchStartListener.bind(this));
49
+ (_c = this.trigger) === null || _c === void 0 ? void 0 : _c.addEventListener('touchend', this.touchEndListener.bind(this));
50
+ }
51
+ else {
52
+ (_d = this.trigger) === null || _d === void 0 ? void 0 : _d.addEventListener('focusin', this.showListener.bind(this));
53
+ (_e = this.trigger) === null || _e === void 0 ? void 0 : _e.addEventListener('focusout', this.hideListener.bind(this));
54
+ (_f = this.trigger) === null || _f === void 0 ? void 0 : _f.addEventListener('mouseenter', this.showListener.bind(this));
55
+ (_g = this.trigger) === null || _g === void 0 ? void 0 : _g.addEventListener('mouseleave', this.hideListener.bind(this));
56
+ }
57
+ }
58
+ disconnectedCallback() {
59
+ var _a, _b, _c, _d, _e, _f;
60
+ if (isTouchScreen) {
61
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.removeEventListener('touchstart', this.touchStartListener.bind(this));
62
+ (_b = this.trigger) === null || _b === void 0 ? void 0 : _b.removeEventListener('touchend', this.touchEndListener.bind(this));
63
+ }
64
+ else {
65
+ (_c = this.trigger) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseenter', this.showListener.bind(this));
66
+ (_d = this.trigger) === null || _d === void 0 ? void 0 : _d.removeEventListener('mouseleave', this.hideListener.bind(this));
67
+ (_e = this.trigger) === null || _e === void 0 ? void 0 : _e.removeEventListener('focusin', this.showListener.bind(this));
68
+ (_f = this.trigger) === null || _f === void 0 ? void 0 : _f.removeEventListener('focusout', this.hideListener.bind(this));
69
+ }
70
+ }
71
+ render() {
72
+ return (h(Host, null,
73
+ h("div", { ref: el => (this.triggerElement = el), "aria-describedby": this.id, class: "tooltip-trigger" },
74
+ h("slot", null)),
75
+ this.content && !this.disabled && (h("div", { ref: el => (this.tooltip = el), id: this.id, class: "tooltip" }, this.content))));
76
+ }
77
+ get isTabbable() {
78
+ return firstTabbable(this.trigger);
79
+ }
80
+ update() {
81
+ if (this.trigger && this.tooltip) {
82
+ computePosition(this.trigger, this.tooltip, {
83
+ placement: this.placement,
84
+ middleware: [offset(CatTooltip.OFFSET), flip()]
85
+ }).then(({ x, y }) => {
86
+ if (this.tooltip) {
87
+ Object.assign(this.tooltip.style, {
88
+ left: `${Math.max(0, x)}px`,
89
+ top: `${y}px`
90
+ });
91
+ }
92
+ });
93
+ }
94
+ }
95
+ showListener() {
96
+ window.clearTimeout(this.hideTimeout);
97
+ this.showTimeout = window.setTimeout(() => {
98
+ var _a, _b;
99
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.focus();
100
+ (_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.classList.add('tooltip-show');
101
+ }, this.showDelay);
102
+ }
103
+ hideListener() {
104
+ window.clearTimeout(this.showTimeout);
105
+ this.hideTimeout = window.setTimeout(() => {
106
+ var _a, _b;
107
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.blur();
108
+ (_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.classList.remove('tooltip-show');
109
+ }, this.hideDelay);
110
+ }
111
+ touchStartListener() {
112
+ this.touchTimeout = window.setTimeout(() => {
113
+ var _a;
114
+ (_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.classList.add('tooltip-show');
115
+ }, this.longTouchDuration);
116
+ }
117
+ touchEndListener() {
118
+ var _a;
119
+ window.clearTimeout(this.touchTimeout);
120
+ (_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.classList.remove('tooltip-show');
121
+ }
122
+ static get is() { return "cat-tooltip"; }
123
+ static get encapsulation() { return "shadow"; }
124
+ static get originalStyleUrls() { return {
125
+ "$": ["cat-tooltip.scss"]
126
+ }; }
127
+ static get styleUrls() { return {
128
+ "$": ["cat-tooltip.css"]
129
+ }; }
130
+ static get properties() { return {
131
+ "content": {
132
+ "type": "string",
133
+ "mutable": false,
134
+ "complexType": {
135
+ "original": "string",
136
+ "resolved": "string",
137
+ "references": {}
138
+ },
139
+ "required": false,
140
+ "optional": false,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": "The content of the tooltip."
144
+ },
145
+ "attribute": "content",
146
+ "reflect": false,
147
+ "defaultValue": "''"
148
+ },
149
+ "disabled": {
150
+ "type": "boolean",
151
+ "mutable": false,
152
+ "complexType": {
153
+ "original": "boolean",
154
+ "resolved": "boolean",
155
+ "references": {}
156
+ },
157
+ "required": false,
158
+ "optional": false,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": "Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\nand invisible. Corresponds with the native HTML disabled attribute."
162
+ },
163
+ "attribute": "disabled",
164
+ "reflect": false,
165
+ "defaultValue": "false"
166
+ },
167
+ "placement": {
168
+ "type": "string",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "Placement",
172
+ "resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
173
+ "references": {
174
+ "Placement": {
175
+ "location": "import",
176
+ "path": "@floating-ui/dom"
177
+ }
178
+ }
179
+ },
180
+ "required": false,
181
+ "optional": false,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": "The placement of the tooltip."
185
+ },
186
+ "attribute": "placement",
187
+ "reflect": false,
188
+ "defaultValue": "'top'"
189
+ },
190
+ "showDelay": {
191
+ "type": "number",
192
+ "mutable": false,
193
+ "complexType": {
194
+ "original": "number",
195
+ "resolved": "number",
196
+ "references": {}
197
+ },
198
+ "required": false,
199
+ "optional": false,
200
+ "docs": {
201
+ "tags": [],
202
+ "text": "The delay time for showing tooltip in ms."
203
+ },
204
+ "attribute": "show-delay",
205
+ "reflect": false,
206
+ "defaultValue": "1000"
207
+ },
208
+ "hideDelay": {
209
+ "type": "number",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "number",
213
+ "resolved": "number",
214
+ "references": {}
215
+ },
216
+ "required": false,
217
+ "optional": false,
218
+ "docs": {
219
+ "tags": [],
220
+ "text": "The delay time for hiding tooltip in ms."
221
+ },
222
+ "attribute": "hide-delay",
223
+ "reflect": false,
224
+ "defaultValue": "0"
225
+ },
226
+ "longTouchDuration": {
227
+ "type": "number",
228
+ "mutable": false,
229
+ "complexType": {
230
+ "original": "number",
231
+ "resolved": "number",
232
+ "references": {}
233
+ },
234
+ "required": false,
235
+ "optional": false,
236
+ "docs": {
237
+ "tags": [],
238
+ "text": "The duration of tap to show the tooltip."
239
+ },
240
+ "attribute": "long-touch-duration",
241
+ "reflect": false,
242
+ "defaultValue": "1000"
243
+ }
244
+ }; }
245
+ static get listeners() { return [{
246
+ "name": "keydown",
247
+ "method": "handleKeyDown",
248
+ "target": undefined,
249
+ "capture": false,
250
+ "passive": false
251
+ }]; }
252
+ }
253
+ CatTooltip.OFFSET = 4;
254
+ //# sourceMappingURL=cat-tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-tooltip.js","sourceRoot":"","sources":["../../../src/components/cat-tooltip/cat-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AACxF,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAGvD,IAAI,YAAY,GAAG,CAAC,CAAC;AAOrB,MAAM,OAAO,UAAU;EALvB;IAOmB,OAAE,GAAG,eAAe,YAAY,EAAE,EAAE,CAAC;IAQtD;;OAEG;IACK,YAAO,GAAG,EAAE,CAAC;IAErB;;;OAGG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,cAAS,GAAc,KAAK,CAAC;IAErC;;OAEG;IACK,cAAS,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACK,cAAS,GAAG,CAAC,CAAC;IAEtB;;OAEG;IACK,sBAAiB,GAAG,IAAI,CAAC;GAoGlC;EAjGC,aAAa,CAAC,EAAE,GAAG,EAAiB;IAClC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;EAC1C,CAAC;EAED,gBAAgB;;IACd,IAAI,CAAC,OAAO,GAAG,aA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EAAE,CAAC;MACrB,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;EACrB,CAAC;EAEO,kBAAkB;IACxB,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;;MACzC,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;EAC7B,CAAC;EAEO,gBAAgB;;IACtB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;EACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAzIuB,iBAAM,GAAG,CAAE,CAAA","sourcesContent":["import { Component, h, Host, Listen, Prop } from '@stencil/core';\nimport { autoUpdate, computePosition, flip, offset, Placement } from '@floating-ui/dom';\nimport isTouchScreen from '../../utils/is-touch-screen';\nimport firstTabbable from '../../utils/first-tabbable';\nimport { FocusableElement } from 'tabbable';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-tooltip',\n styleUrl: 'cat-tooltip.scss',\n shadow: true\n})\nexport class CatTooltip {\n private static readonly OFFSET = 4;\n private readonly id = `cat-tooltip-${nextUniqueId++}`;\n private tooltip?: HTMLElement;\n private triggerElement?: HTMLElement;\n private trigger?: FocusableElement;\n private showTimeout?: number;\n private hideTimeout?: number;\n private touchTimeout?: number;\n\n /**\n * The content of the tooltip.\n */\n @Prop() content = '';\n\n /**\n * Specifies that the tooltip should be disabled. A disabled tooltip is unusable,\n * and invisible. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * The placement of the tooltip.\n */\n @Prop() placement: Placement = 'top';\n\n /**\n * The delay time for showing tooltip in ms.\n */\n @Prop() showDelay = 1000;\n\n /**\n * The delay time for hiding tooltip in ms.\n */\n @Prop() hideDelay = 0;\n\n /**\n * The duration of tap to show the tooltip.\n */\n @Prop() longTouchDuration = 1000;\n\n @Listen('keydown')\n handleKeyDown({ key }: KeyboardEvent) {\n key === 'Escape' && this.hideListener();\n }\n\n componentDidLoad(): void {\n this.trigger = firstTabbable(this.triggerElement) || this.triggerElement;\n if (!this.isTabbable) {\n this.trigger?.setAttribute('tabindex', '0');\n }\n if (this.trigger && this.tooltip) {\n autoUpdate(this.trigger, this.tooltip, () => this.update());\n }\n\n if (isTouchScreen) {\n this.trigger?.addEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.addEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.addEventListener('focusin', this.showListener.bind(this));\n this.trigger?.addEventListener('focusout', this.hideListener.bind(this));\n this.trigger?.addEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.addEventListener('mouseleave', this.hideListener.bind(this));\n }\n }\n\n disconnectedCallback(): void {\n if (isTouchScreen) {\n this.trigger?.removeEventListener('touchstart', this.touchStartListener.bind(this));\n this.trigger?.removeEventListener('touchend', this.touchEndListener.bind(this));\n } else {\n this.trigger?.removeEventListener('mouseenter', this.showListener.bind(this));\n this.trigger?.removeEventListener('mouseleave', this.hideListener.bind(this));\n this.trigger?.removeEventListener('focusin', this.showListener.bind(this));\n this.trigger?.removeEventListener('focusout', this.hideListener.bind(this));\n }\n }\n\n render() {\n return (\n <Host>\n <div ref={el => (this.triggerElement = el)} aria-describedby={this.id} class=\"tooltip-trigger\">\n <slot />\n </div>\n {this.content && !this.disabled && (\n <div ref={el => (this.tooltip = el)} id={this.id} class=\"tooltip\">\n {this.content}\n </div>\n )}\n </Host>\n );\n }\n\n private get isTabbable() {\n return firstTabbable(this.trigger);\n }\n\n private update() {\n if (this.trigger && this.tooltip) {\n computePosition(this.trigger, this.tooltip, {\n placement: this.placement,\n middleware: [offset(CatTooltip.OFFSET), flip()]\n }).then(({ x, y }) => {\n if (this.tooltip) {\n Object.assign(this.tooltip.style, {\n left: `${Math.max(0, x)}px`,\n top: `${y}px`\n });\n }\n });\n }\n }\n\n private showListener() {\n window.clearTimeout(this.hideTimeout);\n this.showTimeout = window.setTimeout(() => {\n this.trigger?.focus();\n this.tooltip?.classList.add('tooltip-show');\n }, this.showDelay);\n }\n\n private hideListener() {\n window.clearTimeout(this.showTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.trigger?.blur();\n this.tooltip?.classList.remove('tooltip-show');\n }, this.hideDelay);\n }\n\n private touchStartListener() {\n this.touchTimeout = window.setTimeout(() => {\n this.tooltip?.classList.add('tooltip-show');\n }, this.longTouchDuration);\n }\n\n private touchEndListener() {\n window.clearTimeout(this.touchTimeout);\n this.tooltip?.classList.remove('tooltip-show');\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ (function (doc) {
2
+ var scriptElm = doc.scripts[doc.scripts.length - 1];
3
+ var warn = ['Discouraged script use, please remove: ' + scriptElm.outerHTML];
4
+
5
+ warn.push('To improve performance it is recommended to set the script in the head as follows:');
6
+
7
+ var parts = scriptElm.src.split('/');
8
+ parts.pop();
9
+ // add subfolder(s) here
10
+ // parts.push('...');
11
+ var url = parts.join('/');
12
+
13
+ scriptElm = doc.createElement('script');
14
+ scriptElm.setAttribute('type', 'module');
15
+ scriptElm.src = url + '/catalyst.esm.js';
16
+ warn.push(scriptElm.outerHTML);
17
+ scriptElm.setAttribute('data-stencil-namespace', 'catalyst');
18
+ doc.head.appendChild(scriptElm);
19
+
20
+ console.warn(warn.join('\n'));
21
+ })(document);
@@ -0,0 +1,2 @@
1
+ export { CatIconRegistry } from './components/cat-icon/cat-icon-registry';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatIconRegistry } from './components/cat-icon/cat-icon-registry';\n"]}
@@ -0,0 +1,9 @@
1
+ import { CatIconRegistry } from './components/cat-icon/cat-icon-registry';
2
+ import { ci } from '@haiilo/catalyst-icons';
3
+ function registerIcons() {
4
+ CatIconRegistry.getInstance().addIcons(ci);
5
+ }
6
+ export default function () {
7
+ registerIcons();
8
+ }
9
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAE5C,SAAS,aAAa;EACpB,eAAe,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,OAAO;EACZ,aAAa,EAAE,CAAC;AAClB,CAAC","sourcesContent":["import { CatIconRegistry } from './components/cat-icon/cat-icon-registry';\nimport { ci } from '@haiilo/catalyst-icons';\n\nfunction registerIcons() {\n CatIconRegistry.getInstance().addIcons(ci);\n}\n\nexport default function () {\n registerIcons();\n}\n"]}
@@ -0,0 +1,12 @@
1
+ const _breakpoints = ['xs', 's', 'm', 'l', 'xl'];
2
+ export const Breakpoints = {
3
+ xs: '(max-width: 539.98px)',
4
+ s: '(max-width: 767.98px)',
5
+ m: '(max-width: 991.98px)',
6
+ l: '(max-width: 1199.98px)',
7
+ xl: '(max-width: 1399.98px)'
8
+ };
9
+ export function isBreakpoint(value) {
10
+ return typeof value === 'string' && _breakpoints.includes(value);
11
+ }
12
+ //# sourceMappingURL=breakpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoints.js","sourceRoot":"","sources":["../../src/utils/breakpoints.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAI1D,MAAM,CAAC,MAAM,WAAW,GAA2C;EACjE,EAAE,EAAE,uBAAuB;EAC3B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,wBAAwB;EAC3B,EAAE,EAAE,wBAAwB;CAC7B,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,KAAc;EACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAmB,CAAC,CAAC;AACjF,CAAC","sourcesContent":["const _breakpoints = ['xs', 's', 'm', 'l', 'xl'] as const;\n\nexport type Breakpoint = typeof _breakpoints[number];\n\nexport const Breakpoints: { [breakpoint in Breakpoint]: string } = {\n xs: '(max-width: 539.98px)',\n s: '(max-width: 767.98px)',\n m: '(max-width: 991.98px)',\n l: '(max-width: 1199.98px)',\n xl: '(max-width: 1399.98px)'\n};\n\nexport function isBreakpoint(value: unknown): value is Breakpoint {\n return typeof value === 'string' && _breakpoints.includes(value as Breakpoint);\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { tabbable } from 'tabbable';
2
+ const firstTabbable = (container) => {
3
+ return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();
4
+ };
5
+ export default firstTabbable;
6
+ //# sourceMappingURL=first-tabbable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first-tabbable.js","sourceRoot":"","sources":["../../src/utils/first-tabbable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAItD,MAAM,aAAa,GAAG,CAAC,SAAqB,EAAgC,EAAE;EAC5E,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;AACzG,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { FocusableElement, tabbable } from 'tabbable';\n\ntype Container = Element | FocusableElement | null;\n\nconst firstTabbable = (container?: Container): FocusableElement | undefined => {\n return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();\n};\n\nexport default firstTabbable;\n"]}
@@ -0,0 +1,3 @@
1
+ const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
2
+ export default isTouchDevice;
3
+ //# sourceMappingURL=is-touch-screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-touch-screen.js","sourceRoot":"","sources":["../../src/utils/is-touch-screen.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;AAE/E,eAAe,aAAa,CAAC","sourcesContent":["const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n\nexport default isTouchDevice;\n"]}
@@ -0,0 +1,55 @@
1
+ import log from 'loglevel';
2
+ import { Platform } from './platform';
3
+ // https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts
4
+ /** Global registry for all dynamically-created, injected media queries. */
5
+ const mediaQueriesForWebkitCompatibility = new Set();
6
+ /** Style tag that holds all of the dynamically-created media queries. */
7
+ let mediaQueryStyleNode;
8
+ /** A utility for calling matchMedia queries. */
9
+ export class MediaMatcher {
10
+ constructor() {
11
+ this._platform = new Platform();
12
+ this._matchMedia = window.matchMedia.bind(window);
13
+ }
14
+ /**
15
+ * Evaluates the given media query and returns the native MediaQueryList from which results
16
+ * can be retrieved.
17
+ * Confirms the layout engine will trigger for the selector query provided and returns the
18
+ * MediaQueryList for the query provided.
19
+ */
20
+ matchMedia(query) {
21
+ if (this._platform.WEBKIT || this._platform.BLINK) {
22
+ createEmptyStyleRule(query);
23
+ }
24
+ return this._matchMedia(query);
25
+ }
26
+ }
27
+ /**
28
+ * Creates an empty stylesheet that is used to work around browser inconsistencies related to
29
+ * `matchMedia`. At the time of writing, it handles the following cases:
30
+ * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`
31
+ * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.
32
+ * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules
33
+ * inside the `@media` match existing elements on the page. We work around it by having one rule
34
+ * targeting the `body`. See https://github.com/angular/components/issues/23546.
35
+ */
36
+ function createEmptyStyleRule(query) {
37
+ if (mediaQueriesForWebkitCompatibility.has(query)) {
38
+ return;
39
+ }
40
+ try {
41
+ if (!mediaQueryStyleNode) {
42
+ mediaQueryStyleNode = document.createElement('style');
43
+ mediaQueryStyleNode.setAttribute('type', 'text/css');
44
+ document.head.appendChild(mediaQueryStyleNode);
45
+ }
46
+ if (mediaQueryStyleNode.sheet) {
47
+ mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
48
+ mediaQueriesForWebkitCompatibility.add(query);
49
+ }
50
+ }
51
+ catch (e) {
52
+ log.error(e);
53
+ }
54
+ }
55
+ //# sourceMappingURL=media-matcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-matcher.js","sourceRoot":"","sources":["../../src/utils/media-matcher.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,oFAAoF;AAEpF,2EAA2E;AAC3E,MAAM,kCAAkC,GAAgB,IAAI,GAAG,EAAU,CAAC;AAE1E,yEAAyE;AACzE,IAAI,mBAAiD,CAAC;AAEtD,gDAAgD;AAChD,MAAM,OAAO,YAAY;EAIvB;IACE,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;EACpD,CAAC;EAED;;;;;KAKG;EACH,UAAU,CAAC,KAAa;IACtB,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;MACjD,oBAAoB,CAAC,KAAK,CAAC,CAAC;KAC7B;IACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;EACjC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,KAAa;EACzC,IAAI,kCAAkC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACjD,OAAO;GACR;EAED,IAAI;IACF,IAAI,CAAC,mBAAmB,EAAE;MACxB,mBAAmB,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;MACtD,mBAAmB,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;MACrD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;KAChD;IACD,IAAI,mBAAmB,CAAC,KAAK,EAAE;MAC7B,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC;MACrE,kCAAkC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KAC/C;GACF;EAAC,OAAO,CAAC,EAAE;IACV,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;GACd;AACH,CAAC","sourcesContent":["import log from 'loglevel';\nimport { Platform } from './platform';\n\n// https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\nexport class MediaMatcher {\n private _platform;\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor() {\n this._platform = new Platform();\n this._matchMedia = window.matchMedia.bind(window);\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT || this._platform.BLINK) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * Creates an empty stylesheet that is used to work around browser inconsistencies related to\n * `matchMedia`. At the time of writing, it handles the following cases:\n * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`\n * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.\n * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules\n * inside the `@media` match existing elements on the page. We work around it by having one rule\n * targeting the `body`. See https://github.com/angular/components/issues/23546.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head.appendChild(mediaQueryStyleNode);\n }\n if (mediaQueryStyleNode.sheet) {\n mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n log.error(e);\n }\n}\n"]}
@@ -0,0 +1,50 @@
1
+ // https://github.com/angular/components/blob/master/src/cdk/platform/platform.ts
2
+ // Whether the current platform supports the V8 Break Iterator. The V8 check
3
+ // is necessary to detect all Blink based browsers.
4
+ let hasV8BreakIterator;
5
+ // We need a try/catch around the reference to `Intl`, because accessing it in some cases can
6
+ // cause IE to throw. These cases are tied to particular versions of Windows and can happen if
7
+ // the consumer is providing a polyfilled `Map`. See:
8
+ // https://github.com/Microsoft/ChakraCore/issues/3189
9
+ // https://github.com/angular/components/issues/15687
10
+ try {
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator;
13
+ }
14
+ catch (_a) {
15
+ hasV8BreakIterator = false;
16
+ }
17
+ export class Platform {
18
+ constructor() {
19
+ /** Whether the current browser is Microsoft Edge. */
20
+ this.EDGE = /(edge)/i.test(navigator.userAgent);
21
+ /** Whether the current rendering engine is Microsoft Trident. */
22
+ this.TRIDENT = /(msie|trident)/i.test(navigator.userAgent);
23
+ // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
24
+ /** Whether the current rendering engine is Blink. */
25
+ this.BLINK =
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ !!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;
28
+ // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to
29
+ // ensure that Webkit runs standalone and is not used as another engine's base.
30
+ /** Whether the current rendering engine is WebKit. */
31
+ this.WEBKIT = /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;
32
+ /** Whether the current platform is Apple iOS. */
33
+ this.IOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
34
+ // It's difficult to detect the plain Gecko engine, because most of the browsers identify
35
+ // them self as Gecko-like browsers and modify the userAgent's according to that.
36
+ // Since we only cover one explicit Firefox case, we can simply check for Firefox
37
+ // instead of having an unstable check for Gecko.
38
+ /** Whether the current browser is Firefox. */
39
+ this.FIREFOX = /(firefox|minefield)/i.test(navigator.userAgent);
40
+ /** Whether the current platform is Android. */
41
+ // Trident on mobile adds the android platform to the userAgent to trick detections.
42
+ this.ANDROID = /android/i.test(navigator.userAgent) && !this.TRIDENT;
43
+ // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
44
+ // this and just place the Safari keyword in the userAgent. To be more safe about Safari every
45
+ // Safari browser should also use Webkit as its layout engine.
46
+ /** Whether the current browser is Safari. */
47
+ this.SAFARI = /safari/i.test(navigator.userAgent) && this.WEBKIT;
48
+ }
49
+ }
50
+ //# sourceMappingURL=platform.js.map