@watermarkinsights/ripple 3.0.1-0 → 3.0.2-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 (224) hide show
  1. package/dist/{ripple/functions-316c1b23.js → cjs/functions-e3f5ae65.js} +188 -2391
  2. package/dist/cjs/global-1e540de6.js +38 -0
  3. package/dist/cjs/http-service-9e8c4dd5.js +57 -0
  4. package/dist/cjs/index-d930307d.js +1392 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/interfaces-30a74c1f.js +35 -0
  7. package/dist/cjs/loader.cjs.js +22 -0
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +89 -0
  9. package/dist/cjs/priv-datepicker.cjs.entry.js +672 -0
  10. package/dist/cjs/priv-navigator-button.cjs.entry.js +29 -0
  11. package/dist/cjs/priv-navigator-item.cjs.entry.js +34 -0
  12. package/dist/cjs/ripple.cjs.js +20 -0
  13. package/dist/cjs/wm-action-menu_2.cjs.entry.js +318 -0
  14. package/dist/cjs/wm-button.cjs.entry.js +152 -0
  15. package/dist/cjs/wm-chart-slice.cjs.entry.js +22 -0
  16. package/dist/cjs/wm-chart.cjs.entry.js +508 -0
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +257 -0
  18. package/dist/cjs/wm-input.cjs.entry.js +110 -0
  19. package/dist/cjs/wm-modal-footer.cjs.entry.js +43 -0
  20. package/dist/cjs/wm-modal-header.cjs.entry.js +45 -0
  21. package/dist/cjs/wm-modal.cjs.entry.js +149 -0
  22. package/dist/cjs/wm-navigator.cjs.entry.js +279 -0
  23. package/dist/cjs/wm-network-uploader.cjs.entry.js +431 -0
  24. package/dist/cjs/wm-option_2.cjs.entry.js +483 -0
  25. package/dist/cjs/wm-pagination.cjs.entry.js +176 -0
  26. package/dist/cjs/wm-search.cjs.entry.js +231 -0
  27. package/dist/cjs/wm-snackbar.cjs.entry.js +160 -0
  28. package/dist/cjs/wm-tab-item_3.cjs.entry.js +316 -0
  29. package/dist/cjs/wm-tag-input.cjs.entry.js +538 -0
  30. package/dist/cjs/wm-timepicker.cjs.entry.js +386 -0
  31. package/dist/cjs/wm-toggletip.cjs.entry.js +128 -0
  32. package/dist/cjs/wm-uploader.cjs.entry.js +342 -0
  33. package/dist/cjs/wm-wrapper.cjs.entry.js +21 -0
  34. package/dist/collection/collection-manifest.json +131 -0
  35. package/dist/{ripple/ripple.css → collection/components/wm-action-menu/wm-action-menu.css} +80 -42
  36. package/dist/collection/components/wm-action-menu/wm-action-menu.js +392 -0
  37. package/dist/collection/components/wm-button/wm-button.css +572 -0
  38. package/dist/collection/components/wm-button/wm-button.js +365 -0
  39. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.css +132 -0
  40. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.js +232 -0
  41. package/dist/collection/components/wm-chart/wm-chart-slice.js +64 -0
  42. package/dist/collection/components/wm-chart/wm-chart.css +337 -0
  43. package/dist/collection/components/wm-chart/wm-chart.js +710 -0
  44. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +374 -0
  45. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1003 -0
  46. package/dist/collection/components/wm-datepicker/wm-datepicker.css +211 -0
  47. package/dist/collection/components/wm-datepicker/wm-datepicker.js +439 -0
  48. package/dist/collection/components/wm-input/wm-input.css +220 -0
  49. package/dist/collection/components/wm-input/wm-input.js +302 -0
  50. package/dist/collection/components/wm-menuitem/wm-menuitem.css +118 -0
  51. package/dist/collection/components/wm-menuitem/wm-menuitem.js +411 -0
  52. package/dist/collection/components/wm-modal/wm-modal-footer.css +84 -0
  53. package/dist/collection/components/wm-modal/wm-modal-footer.js +159 -0
  54. package/dist/collection/components/wm-modal/wm-modal-header.css +78 -0
  55. package/dist/collection/components/wm-modal/wm-modal-header.js +109 -0
  56. package/dist/collection/components/wm-modal/wm-modal.css +155 -0
  57. package/dist/collection/components/wm-modal/wm-modal.js +356 -0
  58. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +94 -0
  59. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -0
  60. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +67 -0
  61. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -0
  62. package/dist/collection/components/wm-navigator/wm-navigator.css +137 -0
  63. package/dist/collection/components/wm-navigator/wm-navigator.js +468 -0
  64. package/dist/collection/components/wm-option/wm-option.css +162 -0
  65. package/dist/collection/components/wm-option/wm-option.js +394 -0
  66. package/dist/collection/components/wm-pagination/wm-pagination.css +217 -0
  67. package/dist/collection/components/wm-pagination/wm-pagination.js +348 -0
  68. package/dist/collection/components/wm-search/wm-search.css +155 -0
  69. package/dist/collection/components/wm-search/wm-search.js +439 -0
  70. package/dist/collection/components/wm-select/wm-select.css +315 -0
  71. package/dist/collection/components/wm-select/wm-select.js +676 -0
  72. package/dist/collection/components/wm-snackbar/wm-snackbar.css +331 -0
  73. package/dist/collection/components/wm-snackbar/wm-snackbar.js +240 -0
  74. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +104 -0
  75. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +202 -0
  76. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +73 -0
  77. package/dist/{ripple/wm-tab-list.entry.js → collection/components/wm-tabs/wm-tab-list/wm-tab-list.js} +131 -17
  78. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +57 -0
  79. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -0
  80. package/dist/collection/components/wm-tag-input/wm-tag-input.css +431 -0
  81. package/dist/collection/components/wm-tag-input/wm-tag-input.js +754 -0
  82. package/dist/collection/components/wm-timepicker/wm-timepicker.css +370 -0
  83. package/dist/collection/components/wm-timepicker/wm-timepicker.js +567 -0
  84. package/dist/collection/components/wm-toggletip/wm-toggletip.css +350 -0
  85. package/dist/collection/components/wm-toggletip/wm-toggletip.js +217 -0
  86. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.css +642 -0
  87. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +753 -0
  88. package/dist/collection/components/wm-uploader/wm-uploader.css +666 -0
  89. package/dist/collection/components/wm-uploader/wm-uploader.js +673 -0
  90. package/dist/collection/components/wm-wrapper/wm-wrapper.js +27 -0
  91. package/dist/collection/dev/scripts.js +20 -0
  92. package/dist/collection/global/__mocks__/functions.js +5 -0
  93. package/dist/collection/global/functions.js +420 -0
  94. package/dist/{ripple/app-globals-b5693c90.js → collection/global/global.js} +3 -8
  95. package/dist/{ripple/interfaces-50753346.js → collection/global/interfaces.js} +4 -6
  96. package/dist/collection/global/services/__mocks__/http-service.js +130 -0
  97. package/dist/collection/global/services/http-service.js +50 -0
  98. package/dist/collection/lang/lang.js +5 -0
  99. package/dist/collection/lang/piglatin.js +93 -0
  100. package/dist/esm/functions-0deb7f8e.js +6117 -0
  101. package/dist/esm/global-d6b49e98.js +36 -0
  102. package/dist/{ripple → esm}/http-service-5d037e16.js +0 -0
  103. package/dist/esm/index-5a842e48.js +1363 -0
  104. package/dist/esm/index.js +1 -0
  105. package/dist/esm/interfaces-61c6305b.js +32 -0
  106. package/dist/esm/loader.js +18 -0
  107. package/dist/esm/polyfills/core-js.js +11 -0
  108. package/dist/esm/polyfills/css-shim.js +1 -0
  109. package/dist/esm/polyfills/dom.js +79 -0
  110. package/dist/esm/polyfills/es5-html-element.js +1 -0
  111. package/dist/esm/polyfills/index.js +34 -0
  112. package/dist/esm/polyfills/system.js +6 -0
  113. package/dist/{ripple → esm}/priv-chart-popover.entry.js +2 -2
  114. package/dist/{ripple → esm}/priv-datepicker.entry.js +3 -3
  115. package/dist/{ripple → esm}/priv-navigator-button.entry.js +1 -1
  116. package/dist/{ripple → esm}/priv-navigator-item.entry.js +1 -1
  117. package/dist/esm/ripple.js +18 -0
  118. package/dist/{ripple/wm-action-menu.entry.js → esm/wm-action-menu_2.entry.js} +114 -3
  119. package/dist/{ripple → esm}/wm-button.entry.js +3 -3
  120. package/dist/{ripple → esm}/wm-chart-slice.entry.js +1 -1
  121. package/dist/{ripple → esm}/wm-chart.entry.js +2 -2
  122. package/dist/{ripple → esm}/wm-datepicker.entry.js +27 -32
  123. package/dist/{ripple → esm}/wm-input.entry.js +2 -2
  124. package/dist/{ripple → esm}/wm-modal-footer.entry.js +2 -2
  125. package/dist/{ripple → esm}/wm-modal-header.entry.js +2 -2
  126. package/dist/{ripple → esm}/wm-modal.entry.js +2 -2
  127. package/dist/{ripple → esm}/wm-navigator.entry.js +3 -3
  128. package/dist/{ripple → esm}/wm-network-uploader.entry.js +2 -2
  129. package/dist/{ripple/wm-select.entry.js → esm/wm-option_2.entry.js} +119 -3
  130. package/dist/{ripple → esm}/wm-pagination.entry.js +2 -2
  131. package/dist/{ripple → esm}/wm-search.entry.js +2 -2
  132. package/dist/{ripple → esm}/wm-snackbar.entry.js +2 -2
  133. package/dist/esm/wm-tab-item_3.entry.js +310 -0
  134. package/dist/{ripple → esm}/wm-tag-input.entry.js +2 -2
  135. package/dist/{ripple → esm}/wm-timepicker.entry.js +2 -2
  136. package/dist/{ripple → esm}/wm-toggletip.entry.js +2 -2
  137. package/dist/{ripple → esm}/wm-uploader.entry.js +2 -2
  138. package/dist/{ripple → esm}/wm-wrapper.entry.js +1 -1
  139. package/dist/index.cjs.js +1 -0
  140. package/dist/index.js +1 -0
  141. package/dist/loader/cdn.js +3 -0
  142. package/dist/loader/index.cjs.js +3 -0
  143. package/dist/loader/index.d.ts +13 -0
  144. package/dist/loader/index.es2017.js +3 -0
  145. package/dist/loader/index.js +4 -0
  146. package/dist/loader/package.json +10 -0
  147. package/dist/ripple/index.esm.js +0 -1
  148. package/dist/ripple/p-103f8cae.entry.js +1 -0
  149. package/dist/ripple/p-129d94fa.entry.js +1 -0
  150. package/dist/ripple/p-139fe143.entry.js +1 -0
  151. package/dist/ripple/p-16367805.entry.js +1 -0
  152. package/dist/ripple/p-1d334060.entry.js +1 -0
  153. package/dist/ripple/p-2562f330.entry.js +1 -0
  154. package/dist/ripple/p-278b26ef.entry.js +1 -0
  155. package/dist/ripple/p-2c21bb72.entry.js +1 -0
  156. package/dist/ripple/p-2f5fda71.entry.js +1 -0
  157. package/dist/ripple/p-3e6f04d5.entry.js +1 -0
  158. package/dist/ripple/p-7185de7f.entry.js +1 -0
  159. package/dist/ripple/p-770d0798.entry.js +1 -0
  160. package/dist/ripple/p-846b4c5f.entry.js +1 -0
  161. package/dist/ripple/p-888bec42.js +1 -0
  162. package/dist/ripple/p-90779d53.entry.js +1 -0
  163. package/dist/ripple/p-934543f2.js +1 -0
  164. package/dist/ripple/p-9a087fee.entry.js +1 -0
  165. package/dist/ripple/p-a6d6eae7.js +1 -0
  166. package/dist/ripple/p-a942ad10.entry.js +1 -0
  167. package/dist/ripple/p-bfb4652d.entry.js +1 -0
  168. package/dist/ripple/p-c0fe5201.entry.js +1 -0
  169. package/dist/ripple/p-c2e27acc.entry.js +1 -0
  170. package/dist/ripple/p-c2edda64.entry.js +1 -0
  171. package/dist/ripple/p-d1fdcbcf.entry.js +1 -0
  172. package/dist/ripple/p-d40b6afb.entry.js +1 -0
  173. package/dist/ripple/p-da73db1c.entry.js +1 -0
  174. package/dist/ripple/p-e3843249.js +1 -0
  175. package/dist/ripple/p-ea5cd8b8.js +16 -0
  176. package/dist/ripple/p-ed0f43f4.entry.js +1 -0
  177. package/dist/ripple/p-ffafd363.entry.js +1 -0
  178. package/dist/ripple/ripple.esm.js +1 -125
  179. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +43 -0
  180. package/dist/types/components/wm-button/wm-button.d.ts +36 -0
  181. package/dist/types/components/wm-chart/priv-chart-popover/priv-chart-popover.d.ts +23 -0
  182. package/dist/types/components/wm-chart/wm-chart-slice.d.ts +8 -0
  183. package/dist/types/components/wm-chart/wm-chart.d.ts +77 -0
  184. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +75 -0
  185. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +39 -0
  186. package/dist/types/components/wm-input/wm-input.d.ts +30 -0
  187. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +30 -0
  188. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +15 -0
  189. package/dist/types/components/wm-modal/wm-modal-header.d.ts +12 -0
  190. package/dist/types/components/wm-modal/wm-modal.d.ts +34 -0
  191. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -0
  192. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -0
  193. package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -0
  194. package/dist/types/components/wm-option/wm-option.d.ts +28 -0
  195. package/dist/types/components/wm-pagination/wm-pagination.d.ts +31 -0
  196. package/dist/types/components/wm-search/wm-search.d.ts +78 -0
  197. package/dist/types/components/wm-select/wm-select.d.ts +63 -0
  198. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +32 -0
  199. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +35 -0
  200. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +50 -0
  201. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -0
  202. package/dist/types/components/wm-tag-input/{wm-tag-input.d.ts~ds312_tagInputMaxTags → wm-tag-input.d.ts} +1 -1
  203. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +59 -0
  204. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +25 -0
  205. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -0
  206. package/dist/types/components/wm-uploader/wm-uploader.d.ts +75 -0
  207. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -0
  208. package/dist/types/{components.d.ts~ds312_tagInputMaxTags → components.d.ts} +0 -0
  209. package/dist/types/global/__mocks__/functions.d.ts +5 -0
  210. package/dist/types/global/global.d.ts +1 -0
  211. package/dist/types/global/interfaces.d.ts +33 -0
  212. package/dist/types/global/services/__mocks__/http-service.d.ts +6 -0
  213. package/dist/types/global/services/http-service.d.ts +4 -0
  214. package/dist/types/lang/lang.d.ts +5 -0
  215. package/dist/types/{stencil-public-runtime.d.ts~ds312_tagInputMaxTags → stencil-public-runtime.d.ts} +190 -182
  216. package/package.json +1 -1
  217. package/dist/ripple/css-shim-bbdf0cc6.js +0 -4
  218. package/dist/ripple/dom-1f98a75f.js +0 -73
  219. package/dist/ripple/index-20b65f86.js +0 -2938
  220. package/dist/ripple/shadow-css-67b66845.js +0 -389
  221. package/dist/ripple/wm-menuitem.entry.js +0 -114
  222. package/dist/ripple/wm-option.entry.js +0 -119
  223. package/dist/ripple/wm-tab-item.entry.js +0 -78
  224. package/dist/ripple/wm-tab-panel.entry.js +0 -38
@@ -0,0 +1,78 @@
1
+ /* --------------------------------------
2
+ 1. Box-shadow
3
+ -------------------------------------- */
4
+ /* --------------------------------------
5
+ 2. Border-radius
6
+ -------------------------------------- */
7
+ /* --------------------------------------
8
+ 3. Transforms
9
+ -------------------------------------- */
10
+ /* --------------------------------------
11
+ 4. Button Focus
12
+ -------------------------------------- */
13
+ /* --------------------------------------
14
+ 5. Flex
15
+ -------------------------------------- */
16
+ /* --------------------------------------
17
+ 6. Button Hover
18
+ -------------------------------------- */
19
+ /* --------------------------------------
20
+ 7. Screen Reader Only
21
+ -------------------------------------- */
22
+ /* --------------------------------------
23
+ 8. Label styles
24
+ this mixin includes all the styles for the label
25
+ + flex rules on the parent container to switch between top and left position
26
+ + srOnly when label is hidden
27
+ Assumes the following markup:
28
+ div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
29
+ .wrapper is for the flex rules
30
+ .label-wrapper is to set the height of the label when positioned left so it's the same height as
31
+ the input. It can't be done directly on .label because of possible line wrapping.
32
+ When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
33
+ (they can't be aligned on the baseline because of possible description text and error message)
34
+ -------------------------------------- */
35
+ /********************************************************************************************/
36
+ /* DO NOT USE THESE DIRECTLY, ASSIGN THEM TO VARIABLES NAMED AFTER FUNCTIONALITY, SEE BELOW */
37
+ /********************************************************************************************/
38
+ /* USAGE */
39
+ /* BELOW IS BEFORE WE HAD THE COLOR PALETTE FROM UI */
40
+ /* TODO: replace with vars above whenever possible */
41
+ /* Buttons */
42
+ /* VIA */
43
+ wm-modal-header {
44
+ -webkit-border-radius: 5px 5px 0 0px;
45
+ -moz-border-radius: 5px 5px 0 0px;
46
+ -ms-border-radius: 5px 5px 0 0px;
47
+ border-radius: 5px 5px 0 0px;
48
+ margin-bottom: -1px;
49
+ }
50
+ wm-modal-header .wm-wrapper {
51
+ display: -webkit-box;
52
+ display: -webkit-flex;
53
+ display: -ms-flexbox;
54
+ display: flex;
55
+ -webkit-box-pack: justify;
56
+ -ms-flex-pack: justify;
57
+ -webkit-justify-content: space-between;
58
+ justify-content: space-between;
59
+ -webkit-box-align: center;
60
+ -webkit-align-items: center;
61
+ -ms-flex-align: center;
62
+ align-items: center;
63
+ }
64
+ wm-modal-header .wm-wrapper .title {
65
+ margin: 0;
66
+ font-weight: 600;
67
+ font-size: 1.125rem;
68
+ color: #4a4a4a;
69
+ line-height: normal;
70
+ }
71
+ wm-modal-header .wm-wrapper .title .subtitle {
72
+ display: block;
73
+ font-size: 0.875rem;
74
+ font-weight: normal;
75
+ }
76
+ wm-modal-header .wm-wrapper .title:focus {
77
+ outline: none;
78
+ }
@@ -0,0 +1,109 @@
1
+ import { h, Component, Element, Prop, Host, Listen } from "@stencil/core";
2
+ import { intl, checkForFocusableElInShadow } from "../../global/functions";
3
+ export class ModalHeader {
4
+ constructor() {
5
+ this.heading = "";
6
+ this.subheading = "";
7
+ this.closeTooltip = intl.formatMessage({
8
+ id: "global.closeVerb",
9
+ defaultMessage: "Close",
10
+ description: "For a button, to close a user interface element",
11
+ });
12
+ }
13
+ //Trap focus when user tabs past last element in modal
14
+ focusFirstEl() {
15
+ checkForFocusableElInShadow(this.firstElement).focus();
16
+ }
17
+ componentWillLoad() {
18
+ this.uid = this.el.parentElement.uid;
19
+ }
20
+ emitParentCloseEvent() {
21
+ const parentModal = this.el.parentElement;
22
+ //@ts-ignore
23
+ parentModal.emitCloseEvent();
24
+ }
25
+ // @Listen("click")
26
+ // directFocusOnClick() {
27
+ // this.headingElement.tabIndex = 0;
28
+ // this.headingElement.focus();
29
+ // }
30
+ render() {
31
+ return (h(Host, null,
32
+ h("div", { class: "wm-wrapper" },
33
+ h("div", null,
34
+ h("h2", { class: "title", id: `wm-modal-heading-text-${this.uid}` },
35
+ this.heading,
36
+ h("span", { class: "subtitle" }, this.subheading))),
37
+ h("wm-button", { "button-style": "navigational", icon: "f156", tooltip: this.closeTooltip, "tooltip-position": "left", id: `wm-modal-close-${this.uid}`, ref: (el) => (this.firstElement = el), onClick: () => this.emitParentCloseEvent() }))));
38
+ }
39
+ static get is() { return "wm-modal-header"; }
40
+ static get originalStyleUrls() { return {
41
+ "$": ["wm-modal-header.scss"]
42
+ }; }
43
+ static get styleUrls() { return {
44
+ "$": ["wm-modal-header.css"]
45
+ }; }
46
+ static get properties() { return {
47
+ "uid": {
48
+ "type": "string",
49
+ "mutable": true,
50
+ "complexType": {
51
+ "original": "string",
52
+ "resolved": "string",
53
+ "references": {}
54
+ },
55
+ "required": true,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "uid",
62
+ "reflect": false
63
+ },
64
+ "heading": {
65
+ "type": "string",
66
+ "mutable": false,
67
+ "complexType": {
68
+ "original": "string",
69
+ "resolved": "string | undefined",
70
+ "references": {}
71
+ },
72
+ "required": false,
73
+ "optional": true,
74
+ "docs": {
75
+ "tags": [],
76
+ "text": ""
77
+ },
78
+ "attribute": "heading",
79
+ "reflect": true,
80
+ "defaultValue": "\"\""
81
+ },
82
+ "subheading": {
83
+ "type": "string",
84
+ "mutable": false,
85
+ "complexType": {
86
+ "original": "string",
87
+ "resolved": "string | undefined",
88
+ "references": {}
89
+ },
90
+ "required": false,
91
+ "optional": true,
92
+ "docs": {
93
+ "tags": [],
94
+ "text": ""
95
+ },
96
+ "attribute": "subheading",
97
+ "reflect": true,
98
+ "defaultValue": "\"\""
99
+ }
100
+ }; }
101
+ static get elementRef() { return "el"; }
102
+ static get listeners() { return [{
103
+ "name": "focusFirstElement",
104
+ "method": "focusFirstEl",
105
+ "target": "document",
106
+ "capture": false,
107
+ "passive": false
108
+ }]; }
109
+ }
@@ -0,0 +1,155 @@
1
+ /* --------------------------------------
2
+ 1. Box-shadow
3
+ -------------------------------------- */
4
+ /* --------------------------------------
5
+ 2. Border-radius
6
+ -------------------------------------- */
7
+ /* --------------------------------------
8
+ 3. Transforms
9
+ -------------------------------------- */
10
+ /* --------------------------------------
11
+ 4. Button Focus
12
+ -------------------------------------- */
13
+ /* --------------------------------------
14
+ 5. Flex
15
+ -------------------------------------- */
16
+ /* --------------------------------------
17
+ 6. Button Hover
18
+ -------------------------------------- */
19
+ /* --------------------------------------
20
+ 7. Screen Reader Only
21
+ -------------------------------------- */
22
+ /* --------------------------------------
23
+ 8. Label styles
24
+ this mixin includes all the styles for the label
25
+ + flex rules on the parent container to switch between top and left position
26
+ + srOnly when label is hidden
27
+ Assumes the following markup:
28
+ div.wrapper[.label-left.invalid] > div.label-wrapper > label.label > span.required
29
+ .wrapper is for the flex rules
30
+ .label-wrapper is to set the height of the label when positioned left so it's the same height as
31
+ the input. It can't be done directly on .label because of possible line wrapping.
32
+ When the label is on top there's no line wrapping at all to ensure proper alignment of inlined elements
33
+ (they can't be aligned on the baseline because of possible description text and error message)
34
+ -------------------------------------- */
35
+ /********************************************************************************************/
36
+ /* DO NOT USE THESE DIRECTLY, ASSIGN THEM TO VARIABLES NAMED AFTER FUNCTIONALITY, SEE BELOW */
37
+ /********************************************************************************************/
38
+ /* USAGE */
39
+ /* BELOW IS BEFORE WE HAD THE COLOR PALETTE FROM UI */
40
+ /* TODO: replace with vars above whenever possible */
41
+ /* Buttons */
42
+ /* VIA */
43
+ wm-modal {
44
+ display: -webkit-box;
45
+ display: -webkit-flex;
46
+ display: -ms-flexbox;
47
+ display: flex;
48
+ -webkit-box-pack: center;
49
+ -ms-flex-pack: center;
50
+ -webkit-justify-content: center;
51
+ justify-content: center;
52
+ -webkit-box-align: center;
53
+ -webkit-align-items: center;
54
+ -ms-flex-align: center;
55
+ align-items: center;
56
+ flex-direction: column;
57
+ position: fixed;
58
+ top: 50%;
59
+ left: 50%;
60
+ transform: translate(-50%, -50%);
61
+ z-index: 2001;
62
+ width: 80vw;
63
+ max-width: 750px;
64
+ max-height: 80vh;
65
+ -webkit-box-shadow: 0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);
66
+ -moz-box-shadow: 0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);
67
+ box-shadow: 0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);
68
+ }
69
+ wm-modal * {
70
+ box-sizing: border-box;
71
+ }
72
+ wm-modal > * {
73
+ width: 80vw;
74
+ max-width: 750px;
75
+ background: #fff;
76
+ }
77
+ wm-modal > *:focus {
78
+ outline: none;
79
+ }
80
+ wm-modal wm-modal-header,
81
+ wm-modal wm-modal-footer {
82
+ padding: 1.25rem 1.875rem;
83
+ }
84
+ wm-modal wm-modal-header {
85
+ z-index: 2003;
86
+ }
87
+ wm-modal wm-modal-footer {
88
+ z-index: 2003;
89
+ }
90
+ wm-modal > :not(wm-modal-header):not(wm-modal-footer) {
91
+ max-height: calc(80vh - 166px);
92
+ z-index: 2002;
93
+ }
94
+ wm-modal.wm-modal wm-modal-header {
95
+ border-bottom: 1px solid #f4f3f6;
96
+ }
97
+ wm-modal.wm-modal wm-modal-footer {
98
+ border-top: 1px solid #f4f3f6;
99
+ }
100
+ @media only screen and (max-width: 768px) {
101
+ wm-modal.wm-modal {
102
+ height: 100%;
103
+ max-height: none;
104
+ max-width: none;
105
+ width: 100vw;
106
+ }
107
+ wm-modal.wm-modal > * {
108
+ max-width: none;
109
+ width: 100vw;
110
+ }
111
+ wm-modal.wm-modal > *:not(wm-modal-header):not(wm-modal-footer) {
112
+ max-height: none;
113
+ height: calc(100vh - 166px);
114
+ }
115
+ }
116
+ wm-modal.wm-dialog > :not(wm-modal-header):not(wm-modal-footer) {
117
+ padding: 0 1.875rem 1.25rem 1.875rem;
118
+ font-size: 0.875rem;
119
+ border: none;
120
+ }
121
+ wm-modal .overlay {
122
+ width: 100vw;
123
+ height: 100vh;
124
+ max-width: none;
125
+ max-height: none;
126
+ position: fixed !important;
127
+ top: -1;
128
+ bottom: 1;
129
+ left: -1;
130
+ right: 1;
131
+ transform: translate(0%, 0%);
132
+ background-color: rgba(25, 25, 25, 0.4);
133
+ -ms-transition: opacity 0.5s ease-out;
134
+ -webkit-transition: opacity 0.5s ease-out;
135
+ -moz-transition: opacity 0.5s ease-out;
136
+ transition: opacity 0.5s ease-out;
137
+ z-index: 2000;
138
+ }
139
+ wm-modal.hide {
140
+ visibility: hidden;
141
+ }
142
+ wm-modal .sr-only {
143
+ position: absolute !important;
144
+ width: 1px !important;
145
+ height: 1px !important;
146
+ padding: 0 !important;
147
+ border: 0 !important;
148
+ overflow: hidden !important;
149
+ clip: rect(0, 0, 0, 0) !important;
150
+ clip-path: inset(50%) !important;
151
+ white-space: nowrap !important;
152
+ margin: -1px !important;
153
+ top: 0;
154
+ left: 0;
155
+ }
@@ -0,0 +1,356 @@
1
+ import { h, Component, Element, Listen, Host, Prop, Watch, Event, Method } from "@stencil/core";
2
+ import { getFirstFocusableDescendant, checkForActiveElInShadow } from "../../global/functions";
3
+ import { generateId } from "../../global/functions";
4
+ export class Modal {
5
+ constructor() {
6
+ this.isOpen = false;
7
+ this.elementToFocus = "";
8
+ this.isTypeDialog = false;
9
+ this.bodyFocusListener = () => this.redirectFocusOnBody();
10
+ }
11
+ //App can open modal by toggling the prop
12
+ toggleModal() {
13
+ this.isOpen ? this.showModal() : this.hideModal();
14
+ }
15
+ //The below not implemented in light of the fact that the app does often need to keep track of the modal's state itself so that it can update the data displayed in the body:
16
+ //App can also open modal by emitting wmShowModal event. Event needs to include the modal's unique id as the event detail, or else all modals on the page will open when wmShowModal event is dispatched.
17
+ // @Listen("wmShowModal", { target: "window" })
18
+ // doesEventMatchId(ev: CustomEvent) {
19
+ // ev.detail === this.uid && this.showModal();
20
+ // }
21
+ showModal() {
22
+ this.setElToFocusOnClose(); //Record where the user was before the modal opened so that focus can return to it when the modal closes
23
+ document.body.style.overflow = "hidden"; //Keeps the page below the modal from scrolling
24
+ //Focus listeners as a general catch for keeping focus in case of errors in finding element with id passed in by dev (element is removed from DOM, etc.) or other scenarios
25
+ document.body.tabIndex = 0;
26
+ document.body.removeEventListener("focus", this.bodyFocusListener, true);
27
+ document.body.addEventListener("focus", this.bodyFocusListener, true);
28
+ window.requestAnimationFrame(() => {
29
+ this.setElToFocusOnOpen();
30
+ window.requestAnimationFrame(() => this.focusOnOpen.focus()); //Bring focus to element inside modal
31
+ });
32
+ }
33
+ handleClick(ev) {
34
+ this.isOpen && ev.target === this.overlayEl && this.focusOnOpen.focus();
35
+ }
36
+ closeModalOnEscape(ev) {
37
+ if (ev.key === "Escape") {
38
+ this.wmCloseTriggered.emit();
39
+ this.isOpen = false;
40
+ }
41
+ }
42
+ //Close the modal and focus the triggering element when the modal buttons emit their events
43
+ hideModal() {
44
+ document.body.style.overflow = "visible";
45
+ document.body.tabIndex = -1;
46
+ document.body.removeEventListener("focus", this.bodyFocusListener, true);
47
+ window.requestAnimationFrame(() => this.focusOnClose.focus()); //Return focus
48
+ }
49
+ componentWillLoad() {
50
+ if (this.elementToFocus === "primary" || this.elementToFocus === "secondary") {
51
+ if (!this.el.id) {
52
+ throw new Error("You are telling the modal to focus an element in the footer when it opens. That's fine! But when you do that, you also need to give the wm-modal-wrapper an ID and set the ID of the modal body to 'content-[id of wm-modal-wrapper]. This is for accessibility purposes.");
53
+ }
54
+ }
55
+ this.uid = this.el.id ? this.el.id : generateId();
56
+ }
57
+ componentDidLoad() {
58
+ if (this.isOpen) {
59
+ this.showModal();
60
+ }
61
+ }
62
+ async emitCloseEvent() {
63
+ this.wmCloseTriggered.emit();
64
+ }
65
+ async emitPrimaryEvent() {
66
+ this.wmPrimaryTriggered.emit();
67
+ }
68
+ async emitSecondaryEvent() {
69
+ this.wmSecondaryTriggered.emit();
70
+ }
71
+ //If the dev hasn't specified an element to focus, element to focus first will be the close (X) button
72
+ setElToFocusOnOpen() {
73
+ const closeBtn = getFirstFocusableDescendant(this.el.querySelector(`#wm-modal-close-${this.uid}`));
74
+ if (this.elementToFocus) {
75
+ if (this.elementToFocus === "primary" || this.elementToFocus === "secondary") {
76
+ this.setAriaDescribedbyOnModal();
77
+ this.elementToFocus = `wm-${this.elementToFocus}-${this.uid}`;
78
+ }
79
+ const elToFocus = this.el.querySelector(`#${this.elementToFocus}`);
80
+ if (elToFocus) {
81
+ const firstEl = getFirstFocusableDescendant(elToFocus);
82
+ if (firstEl) {
83
+ this.focusOnOpen = firstEl;
84
+ }
85
+ else {
86
+ console.warn("Ripple Component Library: The modal component couldn't find an element matching the value you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.");
87
+ this.focusOnOpen = closeBtn;
88
+ }
89
+ }
90
+ else {
91
+ console.warn("Ripple Component Library: The modal component couldn't find an element matching the value you passed for 'elementToFocus'. It will fall back to the default and focus the close button when the modal opens.");
92
+ this.focusOnOpen = closeBtn;
93
+ }
94
+ }
95
+ else {
96
+ this.focusOnOpen = closeBtn;
97
+ }
98
+ }
99
+ setAriaDescribedbyOnModal() {
100
+ const modalBody = document.getElementById(`content-${this.uid}`);
101
+ if (!modalBody) {
102
+ console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.");
103
+ }
104
+ else {
105
+ this.el.setAttribute("aria-describedby", `wm-modal-heading-text-${this.uid} content-${this.uid}`);
106
+ }
107
+ }
108
+ setElToFocusOnClose() {
109
+ const elToFocus = document.activeElement;
110
+ if (elToFocus.tagName === "WM-MENUITEM") {
111
+ this.focusOnClose = elToFocus.parentElement;
112
+ }
113
+ else {
114
+ this.focusOnClose = checkForActiveElInShadow(elToFocus);
115
+ }
116
+ }
117
+ redirectFocusOnBody() {
118
+ if (document.activeElement.tagName === "BODY") {
119
+ this.setElToFocusOnOpen();
120
+ this.focusOnOpen.focus();
121
+ }
122
+ }
123
+ render() {
124
+ return (h(Host, { class: (this.isOpen ? "" : "hide ") + (this.isTypeDialog ? "wm-dialog" : "wm-modal"), role: "dialog", "aria-describedby": `wm-modal-heading-text-${this.uid}`, "aria-modal": "true", tabindex: this.isOpen ? 0 : null, onFocus: () => {
125
+ this.focusLastElement.emit();
126
+ } },
127
+ h("div", { class: "overlay", ref: (el) => (this.overlayEl = el) }),
128
+ h("div", { class: "sr-only", tabIndex: 0, onFocus: () => {
129
+ this.focusFirstElement.emit();
130
+ } })));
131
+ }
132
+ static get is() { return "wm-modal"; }
133
+ static get originalStyleUrls() { return {
134
+ "$": ["wm-modal.scss"]
135
+ }; }
136
+ static get styleUrls() { return {
137
+ "$": ["wm-modal.css"]
138
+ }; }
139
+ static get properties() { return {
140
+ "isOpen": {
141
+ "type": "boolean",
142
+ "mutable": true,
143
+ "complexType": {
144
+ "original": "boolean",
145
+ "resolved": "boolean",
146
+ "references": {}
147
+ },
148
+ "required": false,
149
+ "optional": false,
150
+ "docs": {
151
+ "tags": [],
152
+ "text": ""
153
+ },
154
+ "attribute": "is-open",
155
+ "reflect": true,
156
+ "defaultValue": "false"
157
+ },
158
+ "elementToFocus": {
159
+ "type": "string",
160
+ "mutable": true,
161
+ "complexType": {
162
+ "original": "string",
163
+ "resolved": "string",
164
+ "references": {}
165
+ },
166
+ "required": false,
167
+ "optional": false,
168
+ "docs": {
169
+ "tags": [],
170
+ "text": ""
171
+ },
172
+ "attribute": "element-to-focus",
173
+ "reflect": false,
174
+ "defaultValue": "\"\""
175
+ },
176
+ "isTypeDialog": {
177
+ "type": "boolean",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "boolean",
181
+ "resolved": "boolean",
182
+ "references": {}
183
+ },
184
+ "required": false,
185
+ "optional": false,
186
+ "docs": {
187
+ "tags": [],
188
+ "text": ""
189
+ },
190
+ "attribute": "is-type-dialog",
191
+ "reflect": true,
192
+ "defaultValue": "false"
193
+ },
194
+ "uid": {
195
+ "type": "string",
196
+ "mutable": true,
197
+ "complexType": {
198
+ "original": "string",
199
+ "resolved": "string",
200
+ "references": {}
201
+ },
202
+ "required": true,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": ""
207
+ },
208
+ "attribute": "uid",
209
+ "reflect": true
210
+ }
211
+ }; }
212
+ static get events() { return [{
213
+ "method": "focusLastElement",
214
+ "name": "focusLastElement",
215
+ "bubbles": true,
216
+ "cancelable": true,
217
+ "composed": true,
218
+ "docs": {
219
+ "tags": [],
220
+ "text": ""
221
+ },
222
+ "complexType": {
223
+ "original": "any",
224
+ "resolved": "any",
225
+ "references": {}
226
+ }
227
+ }, {
228
+ "method": "focusFirstElement",
229
+ "name": "focusFirstElement",
230
+ "bubbles": true,
231
+ "cancelable": true,
232
+ "composed": true,
233
+ "docs": {
234
+ "tags": [],
235
+ "text": ""
236
+ },
237
+ "complexType": {
238
+ "original": "any",
239
+ "resolved": "any",
240
+ "references": {}
241
+ }
242
+ }, {
243
+ "method": "wmCloseTriggered",
244
+ "name": "wmCloseTriggered",
245
+ "bubbles": true,
246
+ "cancelable": true,
247
+ "composed": true,
248
+ "docs": {
249
+ "tags": [],
250
+ "text": ""
251
+ },
252
+ "complexType": {
253
+ "original": "any",
254
+ "resolved": "any",
255
+ "references": {}
256
+ }
257
+ }, {
258
+ "method": "wmPrimaryTriggered",
259
+ "name": "wmPrimaryTriggered",
260
+ "bubbles": true,
261
+ "cancelable": true,
262
+ "composed": true,
263
+ "docs": {
264
+ "tags": [],
265
+ "text": ""
266
+ },
267
+ "complexType": {
268
+ "original": "any",
269
+ "resolved": "any",
270
+ "references": {}
271
+ }
272
+ }, {
273
+ "method": "wmSecondaryTriggered",
274
+ "name": "wmSecondaryTriggered",
275
+ "bubbles": true,
276
+ "cancelable": true,
277
+ "composed": true,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": ""
281
+ },
282
+ "complexType": {
283
+ "original": "any",
284
+ "resolved": "any",
285
+ "references": {}
286
+ }
287
+ }]; }
288
+ static get methods() { return {
289
+ "emitCloseEvent": {
290
+ "complexType": {
291
+ "signature": "() => Promise<void>",
292
+ "parameters": [],
293
+ "references": {
294
+ "Promise": {
295
+ "location": "global"
296
+ }
297
+ },
298
+ "return": "Promise<void>"
299
+ },
300
+ "docs": {
301
+ "text": "",
302
+ "tags": []
303
+ }
304
+ },
305
+ "emitPrimaryEvent": {
306
+ "complexType": {
307
+ "signature": "() => Promise<void>",
308
+ "parameters": [],
309
+ "references": {
310
+ "Promise": {
311
+ "location": "global"
312
+ }
313
+ },
314
+ "return": "Promise<void>"
315
+ },
316
+ "docs": {
317
+ "text": "",
318
+ "tags": []
319
+ }
320
+ },
321
+ "emitSecondaryEvent": {
322
+ "complexType": {
323
+ "signature": "() => Promise<void>",
324
+ "parameters": [],
325
+ "references": {
326
+ "Promise": {
327
+ "location": "global"
328
+ }
329
+ },
330
+ "return": "Promise<void>"
331
+ },
332
+ "docs": {
333
+ "text": "",
334
+ "tags": []
335
+ }
336
+ }
337
+ }; }
338
+ static get elementRef() { return "el"; }
339
+ static get watchers() { return [{
340
+ "propName": "isOpen",
341
+ "methodName": "toggleModal"
342
+ }]; }
343
+ static get listeners() { return [{
344
+ "name": "click",
345
+ "method": "handleClick",
346
+ "target": undefined,
347
+ "capture": false,
348
+ "passive": false
349
+ }, {
350
+ "name": "keydown",
351
+ "method": "closeModalOnEscape",
352
+ "target": undefined,
353
+ "capture": false,
354
+ "passive": false
355
+ }]; }
356
+ }