@lumx/react 3.20.1-alpha.31 → 3.20.1-alpha.32

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 (171) hide show
  1. package/_internal/{Button-f382ee1c.js → Button-1b7d3b79.js} +9 -8
  2. package/_internal/Button-1b7d3b79.js.map +1 -0
  3. package/_internal/ButtonRoot-a70baf82.js.map +1 -1
  4. package/_internal/{Chip-70af04b4.js → Chip-8fbedc93.js} +10 -7
  5. package/_internal/Chip-8fbedc93.js.map +1 -0
  6. package/_internal/{ClickAwayProvider-1204f237.js → ClickAwayProvider-7093ba23.js} +2 -2
  7. package/_internal/ClickAwayProvider-7093ba23.js.map +1 -0
  8. package/_internal/{IconButton-1790b47e.js → IconButton-e11b5e74.js} +3 -3
  9. package/_internal/{IconButton-1790b47e.js.map → IconButton-e11b5e74.js.map} +1 -1
  10. package/_internal/{ImageCaption-16bf224b.js → ImageCaption-6f2f4131.js} +3 -3
  11. package/_internal/{ImageCaption-16bf224b.js.map → ImageCaption-6f2f4131.js.map} +1 -1
  12. package/_internal/{List-c75646f2.js → List-4e95288a.js} +9 -7
  13. package/_internal/List-4e95288a.js.map +1 -0
  14. package/_internal/{PopoverDialog-3b63f140.js → PopoverDialog-d85ff977.js} +10 -10
  15. package/_internal/PopoverDialog-d85ff977.js.map +1 -0
  16. package/_internal/{Slides-2a427c44.js → Slides-68a7d0e6.js} +13 -6
  17. package/_internal/Slides-68a7d0e6.js.map +1 -0
  18. package/_internal/{Thumbnail-d2001ccb.js → Thumbnail-22bbea7e.js} +4 -3
  19. package/_internal/Thumbnail-22bbea7e.js.map +1 -0
  20. package/_internal/check-circle-de24f857.js +4 -0
  21. package/_internal/check-circle-de24f857.js.map +1 -0
  22. package/_internal/chevron-right-827b804a.js +6 -0
  23. package/_internal/chevron-right-827b804a.js.map +1 -0
  24. package/_internal/chevron-up-0b9c76cb.js +6 -0
  25. package/_internal/chevron-up-0b9c76cb.js.map +1 -0
  26. package/_internal/close-circle-ef5d1aac.js +4 -0
  27. package/_internal/close-circle-ef5d1aac.js.map +1 -0
  28. package/_internal/close-eaf6c45a.js +4 -0
  29. package/_internal/close-eaf6c45a.js.map +1 -0
  30. package/_internal/components/{alert-dialog-bd1b2532.js → alert-dialog-5326cf04.js} +6 -5
  31. package/_internal/components/{alert-dialog-bd1b2532.js.map → alert-dialog-5326cf04.js.map} +1 -1
  32. package/_internal/components/{autocomplete-8ae2c4f9.js → autocomplete-7d9581e8.js} +7 -7
  33. package/_internal/components/{autocomplete-8ae2c4f9.js.map → autocomplete-7d9581e8.js.map} +1 -1
  34. package/_internal/components/{avatar-778d7df6.js → avatar-52bb217f.js} +2 -2
  35. package/_internal/components/{avatar-778d7df6.js.map → avatar-52bb217f.js.map} +1 -1
  36. package/_internal/components/{button-4aff084a.js → button-c4127e86.js} +3 -3
  37. package/_internal/components/{button-4aff084a.js.map → button-c4127e86.js.map} +1 -1
  38. package/_internal/components/{checkbox-a448ca6c.js → checkbox-f7751583.js} +6 -3
  39. package/_internal/components/checkbox-f7751583.js.map +1 -0
  40. package/_internal/components/{chip-19e40755.js → chip-1ed080fb.js} +2 -2
  41. package/_internal/components/{chip-19e40755.js.map → chip-1ed080fb.js.map} +1 -1
  42. package/_internal/components/{comment-block-bcbedf3c.js → comment-block-343e1922.js} +3 -3
  43. package/_internal/components/{comment-block-bcbedf3c.js.map → comment-block-343e1922.js.map} +1 -1
  44. package/_internal/components/date-picker-b6b3dc77.js +2 -0
  45. package/_internal/components/date-picker-b6b3dc77.js.map +1 -0
  46. package/_internal/components/{dialog-30336ccb.js → dialog-d0e090b1.js} +6 -6
  47. package/_internal/components/dialog-d0e090b1.js.map +1 -0
  48. package/_internal/components/{drag-handle-137f71b6.js → drag-handle-eec23fc2.js} +4 -3
  49. package/_internal/components/drag-handle-eec23fc2.js.map +1 -0
  50. package/_internal/components/{dropdown-d18122d7.js → dropdown-25170b7c.js} +4 -4
  51. package/_internal/components/{dropdown-d18122d7.js.map → dropdown-25170b7c.js.map} +1 -1
  52. package/_internal/components/{expansion-panel-38ed3d9f.js → expansion-panel-df812318.js} +9 -9
  53. package/_internal/components/expansion-panel-df812318.js.map +1 -0
  54. package/_internal/components/{flag-c2e41e8d.js → flag-c8d690bc.js} +3 -3
  55. package/_internal/components/{flag-c2e41e8d.js.map → flag-c8d690bc.js.map} +1 -1
  56. package/_internal/components/{flex-box-15be92f6.js → flex-box-4eeba972.js} +2 -2
  57. package/_internal/components/flex-box-4eeba972.js.map +1 -0
  58. package/_internal/components/{generic-block-5d843f1e.js → generic-block-964b2724.js} +11 -14
  59. package/_internal/components/generic-block-964b2724.js.map +1 -0
  60. package/_internal/components/{grid-column-85e305e7.js → grid-column-99652545.js} +3 -2
  61. package/_internal/components/grid-column-99652545.js.map +1 -0
  62. package/_internal/components/{heading-28520e1c.js → heading-6cc0f178.js} +2 -2
  63. package/_internal/components/{heading-28520e1c.js.map → heading-6cc0f178.js.map} +1 -1
  64. package/_internal/components/icon-9cf785b1.js +2 -0
  65. package/_internal/components/icon-9cf785b1.js.map +1 -0
  66. package/_internal/components/{image-block-10976174.js → image-block-4f3fe64c.js} +3 -3
  67. package/_internal/components/{image-block-10976174.js.map → image-block-4f3fe64c.js.map} +1 -1
  68. package/_internal/components/{image-lightbox-86f1e1fb.js → image-lightbox-7b172571.js} +12 -9
  69. package/_internal/components/image-lightbox-7b172571.js.map +1 -0
  70. package/_internal/components/{lightbox-c618a33b.js → lightbox-10ff28f9.js} +6 -6
  71. package/_internal/components/{lightbox-c618a33b.js.map → lightbox-10ff28f9.js.map} +1 -1
  72. package/_internal/components/{link-9c3feb34.js → link-9d1bd2f6.js} +3 -3
  73. package/_internal/components/{link-9c3feb34.js.map → link-9d1bd2f6.js.map} +1 -1
  74. package/_internal/components/{link-preview-79500604.js → link-preview-9525e97f.js} +3 -3
  75. package/_internal/components/{link-preview-79500604.js.map → link-preview-9525e97f.js.map} +1 -1
  76. package/_internal/components/{list-2f256244.js → list-c8c7a6eb.js} +2 -2
  77. package/_internal/components/{list-2f256244.js.map → list-c8c7a6eb.js.map} +1 -1
  78. package/_internal/components/{message-a3806f51.js → message-edd6a28a.js} +6 -4
  79. package/_internal/components/{message-a3806f51.js.map → message-edd6a28a.js.map} +1 -1
  80. package/_internal/components/{mosaic-e6581097.js → mosaic-c8084ee8.js} +4 -3
  81. package/_internal/components/mosaic-c8084ee8.js.map +1 -0
  82. package/_internal/components/{navigation-5378f128.js → navigation-c9121998.js} +6 -6
  83. package/_internal/components/{navigation-5378f128.js.map → navigation-c9121998.js.map} +1 -1
  84. package/_internal/components/{notification-49837625.js → notification-97a8a04a.js} +9 -5
  85. package/_internal/components/notification-97a8a04a.js.map +1 -0
  86. package/_internal/components/popover-f93484cd.js +3 -0
  87. package/_internal/components/popover-f93484cd.js.map +1 -0
  88. package/_internal/components/{post-block-478bc3b8.js → post-block-7e63c4f4.js} +12 -12
  89. package/_internal/components/post-block-7e63c4f4.js.map +1 -0
  90. package/_internal/components/{progress-tracker-0fd35bea.js → progress-tracker-c9758d83.js} +7 -3
  91. package/_internal/components/progress-tracker-c9758d83.js.map +1 -0
  92. package/_internal/components/{select-a145edbb.js → select-bea40e77.js} +15 -10
  93. package/_internal/components/select-bea40e77.js.map +1 -0
  94. package/_internal/components/{side-navigation-b99d6022.js → side-navigation-385825d4.js} +7 -6
  95. package/_internal/components/side-navigation-385825d4.js.map +1 -0
  96. package/_internal/components/{slideshow-b78ac3d6.js → slideshow-e0880d40.js} +3 -3
  97. package/_internal/components/{slideshow-b78ac3d6.js.map → slideshow-e0880d40.js.map} +1 -1
  98. package/_internal/components/{switch-25b65051.js → switch-24fea8d7.js} +3 -2
  99. package/_internal/components/switch-24fea8d7.js.map +1 -0
  100. package/_internal/components/{table-3cbee034.js → table-834af792.js} +6 -3
  101. package/_internal/components/table-834af792.js.map +1 -0
  102. package/_internal/components/{tabs-5d8ea1a5.js → tabs-bebfe959.js} +3 -3
  103. package/_internal/components/{tabs-5d8ea1a5.js.map → tabs-bebfe959.js.map} +1 -1
  104. package/_internal/components/text-9074f440.js +2 -0
  105. package/_internal/components/text-9074f440.js.map +1 -0
  106. package/_internal/components/{text-field-c26582c5.js → text-field-8597b7f7.js} +7 -5
  107. package/_internal/components/text-field-8597b7f7.js.map +1 -0
  108. package/_internal/components/{thumbnail-cb55b26c.js → thumbnail-4928bba2.js} +2 -2
  109. package/_internal/components/{thumbnail-cb55b26c.js.map → thumbnail-4928bba2.js.map} +1 -1
  110. package/_internal/components/{tooltip-dcb43bbe.js → tooltip-21018736.js} +2 -2
  111. package/_internal/components/{tooltip-dcb43bbe.js.map → tooltip-21018736.js.map} +1 -1
  112. package/_internal/components/{uploader-873b9bc1.js → uploader-2e1b080e.js} +2 -2
  113. package/_internal/components/{uploader-873b9bc1.js.map → uploader-2e1b080e.js.map} +1 -1
  114. package/_internal/components/{user-block-7cbaffe0.js → user-block-5fd51607.js} +12 -11
  115. package/_internal/components/user-block-5fd51607.js.map +1 -0
  116. package/_internal/{index-151e2652.js → index-77f213b1.js} +2 -2
  117. package/_internal/{index-151e2652.js.map → index-77f213b1.js.map} +1 -1
  118. package/_internal/{index-25d2a45e.js → index-aa6d1d90.js} +4 -4
  119. package/_internal/{index-25d2a45e.js.map → index-aa6d1d90.js.map} +1 -1
  120. package/_internal/{components/icon-a00d698b.js → index-d3e86bd8.js} +6 -5
  121. package/_internal/index-d3e86bd8.js.map +1 -0
  122. package/_internal/information-49bbeed3.js +6 -0
  123. package/_internal/information-49bbeed3.js.map +1 -0
  124. package/_internal/{isComponent-b9762ff1.js → isComponent-78df9309.js} +5 -3
  125. package/_internal/isComponent-78df9309.js.map +1 -0
  126. package/_internal/partitionMulti-4daccdd5.js +25 -0
  127. package/_internal/partitionMulti-4daccdd5.js.map +1 -0
  128. package/_internal/{useCallbackOnEscape-b956a85d.js → useCallbackOnEscape-ea4d9eb4.js} +4 -6
  129. package/_internal/useCallbackOnEscape-ea4d9eb4.js.map +1 -0
  130. package/_internal/{useFocusTrap-2dbae79e.js → useFocusTrap-c3c6378b.js} +2 -2
  131. package/_internal/{useFocusTrap-2dbae79e.js.map → useFocusTrap-c3c6378b.js.map} +1 -1
  132. package/_internal/{wrapChildrenIconWithSpaces-ef2a6772.js → wrapChildrenIconWithSpaces-fb85a743.js} +2 -2
  133. package/_internal/{wrapChildrenIconWithSpaces-ef2a6772.js.map → wrapChildrenIconWithSpaces-fb85a743.js.map} +1 -1
  134. package/index.d.ts +15 -4
  135. package/index.js +49 -49
  136. package/package.json +3 -3
  137. package/utils/index.js +1 -1
  138. package/_internal/Button-f382ee1c.js.map +0 -1
  139. package/_internal/Chip-70af04b4.js.map +0 -1
  140. package/_internal/ClickAwayProvider-1204f237.js.map +0 -1
  141. package/_internal/List-c75646f2.js.map +0 -1
  142. package/_internal/PopoverDialog-3b63f140.js.map +0 -1
  143. package/_internal/Slides-2a427c44.js.map +0 -1
  144. package/_internal/Thumbnail-d2001ccb.js.map +0 -1
  145. package/_internal/components/checkbox-a448ca6c.js.map +0 -1
  146. package/_internal/components/date-picker-b6d4048e.js +0 -2
  147. package/_internal/components/date-picker-b6d4048e.js.map +0 -1
  148. package/_internal/components/dialog-30336ccb.js.map +0 -1
  149. package/_internal/components/drag-handle-137f71b6.js.map +0 -1
  150. package/_internal/components/expansion-panel-38ed3d9f.js.map +0 -1
  151. package/_internal/components/flex-box-15be92f6.js.map +0 -1
  152. package/_internal/components/generic-block-5d843f1e.js.map +0 -1
  153. package/_internal/components/grid-column-85e305e7.js.map +0 -1
  154. package/_internal/components/icon-a00d698b.js.map +0 -1
  155. package/_internal/components/image-lightbox-86f1e1fb.js.map +0 -1
  156. package/_internal/components/mosaic-e6581097.js.map +0 -1
  157. package/_internal/components/notification-49837625.js.map +0 -1
  158. package/_internal/components/popover-dfcddda4.js +0 -3
  159. package/_internal/components/popover-dfcddda4.js.map +0 -1
  160. package/_internal/components/post-block-478bc3b8.js.map +0 -1
  161. package/_internal/components/progress-tracker-0fd35bea.js.map +0 -1
  162. package/_internal/components/select-a145edbb.js.map +0 -1
  163. package/_internal/components/side-navigation-b99d6022.js.map +0 -1
  164. package/_internal/components/switch-25b65051.js.map +0 -1
  165. package/_internal/components/table-3cbee034.js.map +0 -1
  166. package/_internal/components/text-f84a5417.js +0 -2
  167. package/_internal/components/text-f84a5417.js.map +0 -1
  168. package/_internal/components/text-field-c26582c5.js.map +0 -1
  169. package/_internal/components/user-block-7cbaffe0.js.map +0 -1
  170. package/_internal/isComponent-b9762ff1.js.map +0 -1
  171. package/_internal/useCallbackOnEscape-b956a85d.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ const mdiAlert = 'M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2z';
2
+
3
+ const mdiInformation = 'M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2';
4
+
5
+ export { mdiInformation as a, mdiAlert as m };
6
+ //# sourceMappingURL=information-49bbeed3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"information-49bbeed3.js","sources":["../../../lumx-icons/dist/esm/alert.js","../../../lumx-icons/dist/esm/information.js"],"sourcesContent":["export const mdiAlert = 'M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2z';","export const mdiInformation = 'M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2';"],"names":["mdiAlert","mdiInformation"],"mappings":"AAAO,MAAMA,QAAQ,GAAG;;ACAjB,MAAMC,cAAc,GAAG;;;;"}
@@ -1,5 +1,7 @@
1
+ import get from 'lodash/get';
2
+
1
3
  /**
2
- * Properties of a component to use to determine its name.
4
+ * Properties of a component to use to determine it's name.
3
5
  * In the order of preference.
4
6
  */
5
7
  const NAME_PROPERTIES = ['type', 'type.displayName', 'displayName', 'name', 'type.name', 'props.mdxType', '_reactInternalFiber.elementType.name'];
@@ -11,8 +13,8 @@ const NAME_PROPERTIES = ['type', 'type.displayName', 'displayName', 'name', 'typ
11
13
  */
12
14
  const isComponent = component => instance => {
13
15
  const componentName = typeof component === 'string' ? component : component.displayName;
14
- return !!instance.$$typeof && NAME_PROPERTIES.some(nameProperty => instance[nameProperty] === componentName);
16
+ return !!get(instance, '$$typeof') && NAME_PROPERTIES.some(nameProperty => get(instance, nameProperty) === componentName);
15
17
  };
16
18
 
17
19
  export { isComponent as i };
18
- //# sourceMappingURL=isComponent-b9762ff1.js.map
20
+ //# sourceMappingURL=isComponent-78df9309.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isComponent-78df9309.js","sources":["../../src/utils/type/isComponent.ts"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport get from 'lodash/get';\nimport type { Comp } from './Comp';\n\n/**\n * Properties of a component to use to determine it's name.\n * In the order of preference.\n */\nconst NAME_PROPERTIES: string[] = [\n 'type',\n 'type.displayName',\n 'displayName',\n 'name',\n 'type.name',\n 'props.mdxType',\n '_reactInternalFiber.elementType.name',\n];\n/**\n * Create a predicate function that checks if a ReactNode is a react element from the given component.\n *\n * @param component React function component or the component name\n * @return predicate returning true if value is instance of the component\n */\nexport const isComponent =\n <C>(component: Comp<C, any> | string) =>\n (instance: ReactNode): instance is ReactElement => {\n const componentName = typeof component === 'string' ? component : component.displayName;\n\n return (\n !!get(instance, '$$typeof') &&\n NAME_PROPERTIES.some((nameProperty: string): boolean => get(instance, nameProperty) === componentName)\n );\n };\n"],"names":["NAME_PROPERTIES","isComponent","component","instance","componentName","displayName","get","some","nameProperty"],"mappings":";;AAIA;AACA;AACA;AACA;AACA,MAAMA,eAAyB,GAAG,CAC9B,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,MAAM,EACN,WAAW,EACX,eAAe,EACf,sCAAsC,CACzC,CAAA;AACD;AACA;AACA;AACA;AACA;AACA;MACaC,WAAW,GAChBC,SAAgC,IACnCC,QAAmB,IAA+B;EAC/C,MAAMC,aAAa,GAAG,OAAOF,SAAS,KAAK,QAAQ,GAAGA,SAAS,GAAGA,SAAS,CAACG,WAAW,CAAA;EAEvF,OACI,CAAC,CAACC,GAAG,CAACH,QAAQ,EAAE,UAAU,CAAC,IAC3BH,eAAe,CAACO,IAAI,CAAEC,YAAoB,IAAcF,GAAG,CAACH,QAAQ,EAAEK,YAAY,CAAC,KAAKJ,aAAa,CAAC,CAAA;AAE9G;;;;"}
@@ -0,0 +1,25 @@
1
+ import concat from 'lodash/concat';
2
+ import dropRight from 'lodash/dropRight';
3
+ import last from 'lodash/last';
4
+ import partition from 'lodash/partition';
5
+ import reduce from 'lodash/reduce';
6
+
7
+ /**
8
+ * Similar to lodash `partition` function but working with multiple predicates.
9
+ *
10
+ * @example
11
+ * const isString = (s) => typeof s === 'string'
12
+ * const isNumber = (s) => typeof s === 'number'
13
+ * const [strings, numbers, others] = partitionMulti(['a', 1, 'b', false], [isString, isNumber])
14
+ * //=> [['a', 'b'], [1], [false]]
15
+ *
16
+ * @param elements array of elements
17
+ * @param predicates array of predicates to apply on elements
18
+ * @return partitioned elements by the given predicates
19
+ */
20
+ function partitionMulti(elements, predicates) {
21
+ return reduce(predicates, (partitioned, predicate) => concat(dropRight(partitioned), partition(last(partitioned), predicate)), [elements]);
22
+ }
23
+
24
+ export { partitionMulti as p };
25
+ //# sourceMappingURL=partitionMulti-4daccdd5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partitionMulti-4daccdd5.js","sources":["../../src/utils/partitionMulti.ts"],"sourcesContent":["import concat from 'lodash/concat';\nimport dropRight from 'lodash/dropRight';\nimport last from 'lodash/last';\nimport partition from 'lodash/partition';\nimport reduce from 'lodash/reduce';\n\nimport { Predicate } from '@lumx/core/js/types';\n\n/**\n * Similar to lodash `partition` function but working with multiple predicates.\n *\n * @example\n * const isString = (s) => typeof s === 'string'\n * const isNumber = (s) => typeof s === 'number'\n * const [strings, numbers, others] = partitionMulti(['a', 1, 'b', false], [isString, isNumber])\n * //=> [['a', 'b'], [1], [false]]\n *\n * @param elements array of elements\n * @param predicates array of predicates to apply on elements\n * @return partitioned elements by the given predicates\n */\nexport function partitionMulti<T>(elements: T[], predicates: Array<Predicate<T>>): T[][] {\n return reduce(\n predicates,\n (partitioned: T[][], predicate: Predicate<T>) =>\n concat(dropRight(partitioned), partition(last(partitioned), predicate)),\n [elements],\n );\n}\n"],"names":["partitionMulti","elements","predicates","reduce","partitioned","predicate","concat","dropRight","partition","last"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAcA,CAAIC,QAAa,EAAEC,UAA+B,EAAS;AACrF,EAAA,OAAOC,MAAM,CACTD,UAAU,EACV,CAACE,WAAkB,EAAEC,SAAuB,KACxCC,MAAM,CAACC,SAAS,CAACH,WAAW,CAAC,EAAEI,SAAS,CAACC,IAAI,CAACL,WAAW,CAAC,EAAEC,SAAS,CAAC,CAAC,EAC3E,CAACJ,QAAQ,CACb,CAAC,CAAA;AACL;;;;"}
@@ -1,7 +1,8 @@
1
1
  import { D as DOCUMENT } from './constants-d0e3f49e.js';
2
2
  import { onEscapePressed } from '@lumx/core/js/utils';
3
3
  import { useEffect } from 'react';
4
- import { last } from '@lumx/core/js/utils/collection/last';
4
+ import last from 'lodash/last';
5
+ import pull from 'lodash/pull';
5
6
 
6
7
  /**
7
8
  * Keep track of listeners, only the last registered listener gets activated at any point (previously registered
@@ -23,10 +24,7 @@ function makeListenerTowerContext() {
23
24
  // Disable current listener.
24
25
  listener.disable();
25
26
  // Remove current listener.
26
- const index = LISTENERS.indexOf(listener);
27
- if (index > -1) {
28
- LISTENERS.splice(index, 1);
29
- }
27
+ pull(LISTENERS, listener);
30
28
  // Enable previous listener.
31
29
  last(LISTENERS)?.enable();
32
30
  }
@@ -61,4 +59,4 @@ function useCallbackOnEscape(callback, closeOnEscape = true) {
61
59
  }
62
60
 
63
61
  export { makeListenerTowerContext as m, useCallbackOnEscape as u };
64
- //# sourceMappingURL=useCallbackOnEscape-b956a85d.js.map
62
+ //# sourceMappingURL=useCallbackOnEscape-ea4d9eb4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCallbackOnEscape-ea4d9eb4.js","sources":["../../src/utils/function/makeListenerTowerContext.ts","../../src/hooks/useCallbackOnEscape.ts"],"sourcesContent":["import last from 'lodash/last';\nimport pull from 'lodash/pull';\n\nexport type Listener = { enable(): void; disable(): void };\n\n/**\n * Keep track of listeners, only the last registered listener gets activated at any point (previously registered\n * listener are disabled).\n * When a listener gets unregistered, the previously registered listener gets enabled again.\n */\nexport function makeListenerTowerContext() {\n const LISTENERS: Listener[] = [];\n\n return {\n register(listener: Listener) {\n // Disable previous listener.\n last(LISTENERS)?.disable();\n // Keep track of current listener.\n LISTENERS.push(listener);\n // Enable current listener.\n listener.enable();\n },\n unregister(listener: Listener) {\n // Disable current listener.\n listener.disable();\n // Remove current listener.\n pull(LISTENERS, listener);\n // Enable previous listener.\n last(LISTENERS)?.enable();\n },\n };\n}\n","import { DOCUMENT } from '@lumx/react/constants';\nimport { Callback } from '@lumx/react/utils/type';\nimport { onEscapePressed } from '@lumx/core/js/utils';\nimport { useEffect } from 'react';\nimport { Listener, makeListenerTowerContext } from '@lumx/react/utils/function/makeListenerTowerContext';\n\nconst LISTENERS = makeListenerTowerContext();\n\n/**\n * Register a global listener on 'Escape' key pressed.\n *\n * If multiple listener are registered, only the last one is maintained. When a listener is unregistered, the previous\n * one gets activated again.\n *\n * @param callback Callback\n * @param closeOnEscape Disables the hook when false\n */\nexport function useCallbackOnEscape(callback: Callback | undefined, closeOnEscape = true) {\n useEffect(() => {\n const rootElement = DOCUMENT?.body;\n if (!closeOnEscape || !callback || !rootElement) {\n return undefined;\n }\n const onKeyDown = onEscapePressed(callback);\n\n const listener: Listener = {\n enable: () => rootElement.addEventListener('keydown', onKeyDown),\n disable: () => rootElement.removeEventListener('keydown', onKeyDown),\n };\n\n LISTENERS.register(listener);\n return () => LISTENERS.unregister(listener);\n }, [callback, closeOnEscape]);\n}\n"],"names":["makeListenerTowerContext","LISTENERS","register","listener","last","disable","push","enable","unregister","pull","useCallbackOnEscape","callback","closeOnEscape","useEffect","rootElement","DOCUMENT","body","undefined","onKeyDown","onEscapePressed","addEventListener","removeEventListener"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,GAAG;EACvC,MAAMC,SAAqB,GAAG,EAAE,CAAA;EAEhC,OAAO;IACHC,QAAQA,CAACC,QAAkB,EAAE;AACzB;AACAC,MAAAA,IAAI,CAACH,SAAS,CAAC,EAAEI,OAAO,EAAE,CAAA;AAC1B;AACAJ,MAAAA,SAAS,CAACK,IAAI,CAACH,QAAQ,CAAC,CAAA;AACxB;MACAA,QAAQ,CAACI,MAAM,EAAE,CAAA;KACpB;IACDC,UAAUA,CAACL,QAAkB,EAAE;AAC3B;MACAA,QAAQ,CAACE,OAAO,EAAE,CAAA;AAClB;AACAI,MAAAA,IAAI,CAACR,SAAS,EAAEE,QAAQ,CAAC,CAAA;AACzB;AACAC,MAAAA,IAAI,CAACH,SAAS,CAAC,EAAEM,MAAM,EAAE,CAAA;AAC7B,KAAA;GACH,CAAA;AACL;;ACzBA,MAAMN,SAAS,GAAGD,wBAAwB,EAAE,CAAA;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,mBAAmBA,CAACC,QAA8B,EAAEC,aAAa,GAAG,IAAI,EAAE;AACtFC,EAAAA,SAAS,CAAC,MAAM;AACZ,IAAA,MAAMC,WAAW,GAAGC,QAAQ,EAAEC,IAAI,CAAA;IAClC,IAAI,CAACJ,aAAa,IAAI,CAACD,QAAQ,IAAI,CAACG,WAAW,EAAE;AAC7C,MAAA,OAAOG,SAAS,CAAA;AACpB,KAAA;AACA,IAAA,MAAMC,SAAS,GAAGC,eAAe,CAACR,QAAQ,CAAC,CAAA;AAE3C,IAAA,MAAMR,QAAkB,GAAG;MACvBI,MAAM,EAAEA,MAAMO,WAAW,CAACM,gBAAgB,CAAC,SAAS,EAAEF,SAAS,CAAC;MAChEb,OAAO,EAAEA,MAAMS,WAAW,CAACO,mBAAmB,CAAC,SAAS,EAAEH,SAAS,CAAA;KACtE,CAAA;AAEDjB,IAAAA,SAAS,CAACC,QAAQ,CAACC,QAAQ,CAAC,CAAA;AAC5B,IAAA,OAAO,MAAMF,SAAS,CAACO,UAAU,CAACL,QAAQ,CAAC,CAAA;AAC/C,GAAC,EAAE,CAACQ,QAAQ,EAAEC,aAAa,CAAC,CAAC,CAAA;AACjC;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react';
2
2
  import { D as DOCUMENT } from './constants-d0e3f49e.js';
3
3
  import { g as getFocusableElements } from './getFocusableElements-230173a8.js';
4
- import { m as makeListenerTowerContext } from './useCallbackOnEscape-b956a85d.js';
4
+ import { m as makeListenerTowerContext } from './useCallbackOnEscape-ea4d9eb4.js';
5
5
 
6
6
  /**
7
7
  * Get first and last elements focusable in an element.
@@ -109,4 +109,4 @@ function useFocusTrap(focusZoneElement, focusElement) {
109
109
  }
110
110
 
111
111
  export { getFirstAndLastFocusable as g, useFocusTrap as u };
112
- //# sourceMappingURL=useFocusTrap-2dbae79e.js.map
112
+ //# sourceMappingURL=useFocusTrap-c3c6378b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFocusTrap-2dbae79e.js","sources":["../../src/utils/browser/focus/getFirstAndLastFocusable.ts","../../src/hooks/useFocusTrap.ts"],"sourcesContent":["import { getFocusableElements } from './getFocusableElements';\n\n/**\n * Get first and last elements focusable in an element.\n *\n * @param parentElement The element in which to search focusable elements.\n * @return first and last focusable elements\n */\nexport function getFirstAndLastFocusable(parentElement: HTMLElement | ShadowRoot) {\n const focusableElements = getFocusableElements(parentElement);\n\n // First non disabled element.\n const first = focusableElements[0];\n // Last non disabled element.\n const last = focusableElements[focusableElements.length - 1];\n\n if (last && first) {\n return { first, last };\n }\n return {};\n}\n","import { useEffect } from 'react';\n\nimport { DOCUMENT } from '@lumx/react/constants';\nimport { getFirstAndLastFocusable } from '@lumx/react/utils/browser/focus/getFirstAndLastFocusable';\nimport { Falsy } from '@lumx/react/utils/type';\nimport { Listener, makeListenerTowerContext } from '@lumx/react/utils/function/makeListenerTowerContext';\n\nconst FOCUS_TRAPS = makeListenerTowerContext();\n\n/**\n * Trap 'Tab' focus switch inside the `focusZoneElement`.\n *\n * If multiple focus trap are activated, only the last one is maintained and when a focus trap closes, the previous one\n * gets activated again.\n *\n * @param focusZoneElement The element in which to trap the focus.\n * @param focusElement The element to focus when the focus trap is activated (otherwise the first focusable element\n * will be focused).\n */\nexport function useFocusTrap(focusZoneElement: HTMLElement | Falsy, focusElement?: HTMLElement | null): void {\n useEffect(() => {\n // Body element can be undefined in SSR context.\n const rootElement = DOCUMENT?.body;\n\n if (!rootElement || !focusZoneElement) {\n return undefined;\n }\n\n // Use the shadow root as focusZoneElement when available\n const focusZoneElementOrShadowRoot = focusZoneElement.shadowRoot || focusZoneElement;\n\n // Trap 'Tab' key down focus switch into the focus zone.\n const trapTabFocusInFocusZone = (evt: KeyboardEvent) => {\n const { key } = evt;\n if (key !== 'Tab') {\n return;\n }\n\n const focusable = getFirstAndLastFocusable(focusZoneElementOrShadowRoot);\n\n // Prevent focus switch if no focusable available.\n if (!focusable.first) {\n evt.preventDefault();\n return;\n }\n\n const activeElement = focusZoneElement.shadowRoot\n ? focusZoneElement.shadowRoot.activeElement\n : document.activeElement;\n\n if (\n // No previous focus\n !activeElement ||\n // Previous focus is at the end of the focus zone.\n (!evt.shiftKey && activeElement === focusable.last) ||\n // Previous focus is outside the focus zone\n !focusZoneElementOrShadowRoot.contains(activeElement)\n ) {\n focusable.first.focus();\n evt.preventDefault();\n return;\n }\n\n if (\n // Focus order reversed\n evt.shiftKey &&\n // Previous focus is at the start of the focus zone.\n activeElement === focusable.first\n ) {\n focusable.last.focus();\n evt.preventDefault();\n }\n };\n\n const focusTrap: Listener = {\n enable: () => rootElement.addEventListener('keydown', trapTabFocusInFocusZone),\n disable: () => rootElement.removeEventListener('keydown', trapTabFocusInFocusZone),\n };\n\n // SETUP:\n if (focusElement && focusZoneElementOrShadowRoot.contains(focusElement)) {\n // Focus the given element.\n focusElement.focus({ preventScroll: true });\n } else {\n // Focus the first focusable element in the zone.\n getFirstAndLastFocusable(focusZoneElementOrShadowRoot).first?.focus({ preventScroll: true });\n }\n FOCUS_TRAPS.register(focusTrap);\n\n // TEARDOWN:\n return () => FOCUS_TRAPS.unregister(focusTrap);\n }, [focusElement, focusZoneElement]);\n}\n"],"names":["getFirstAndLastFocusable","parentElement","focusableElements","getFocusableElements","first","last","length","FOCUS_TRAPS","makeListenerTowerContext","useFocusTrap","focusZoneElement","focusElement","useEffect","rootElement","DOCUMENT","body","undefined","focusZoneElementOrShadowRoot","shadowRoot","trapTabFocusInFocusZone","evt","key","focusable","preventDefault","activeElement","document","shiftKey","contains","focus","focusTrap","enable","addEventListener","disable","removeEventListener","preventScroll","register","unregister"],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,CAACC,aAAuC,EAAE;AAC9E,EAAA,MAAMC,iBAAiB,GAAGC,oBAAoB,CAACF,aAAa,CAAC,CAAA;;AAE7D;AACA,EAAA,MAAMG,KAAK,GAAGF,iBAAiB,CAAC,CAAC,CAAC,CAAA;AAClC;EACA,MAAMG,IAAI,GAAGH,iBAAiB,CAACA,iBAAiB,CAACI,MAAM,GAAG,CAAC,CAAC,CAAA;EAE5D,IAAID,IAAI,IAAID,KAAK,EAAE;IACf,OAAO;MAAEA,KAAK;AAAEC,MAAAA,IAAAA;KAAM,CAAA;AAC1B,GAAA;AACA,EAAA,OAAO,EAAE,CAAA;AACb;;ACbA,MAAME,WAAW,GAAGC,wBAAwB,EAAE,CAAA;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAACC,gBAAqC,EAAEC,YAAiC,EAAQ;AACz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AACuB,KAAK,EAAE,CAAA;QACtBR,GAAG,CAACG,cAAc,EAAE,CAAA;AACxB,OAAA;KACH,CAAA;AAED,IAAA,MAAMM,SAAmB,GAAG;MACxBC,MAAM,EAAEA,MAAMjB,WAAW,CAACkB,gBAAgB,CAAC,SAAS,EAAEZ,uBAAuB,CAAC;MAC9Ea,OAAO,EAAEA,MAAMnB,WAAW,CAACoB,mBAAmB,CAAC,SAAS,EAAEd,uBAAuB,CAAA;KACpF,CAAA;;AAED;IACA,IAAIR,YAAY,IAAIM,4BAA4B,CAACU,QAAQ,CAAChB,YAAY,CAAC,EAAE;AACrE;MACAA,YAAY,CAACiB,KAAK,CAAC;AAAEM,QAAAA,aAAa,EAAE,IAAA;AAAK,OAAC,CAAC,CAAA;AAC/C,KAAC,MAAM;AACH;AACAlC,MAAAA,wBAAwB,CAACiB,4BAA4B,CAAC,CAACb,KAAK,EAAEwB,KAAK,CAAC;AAAEM,QAAAA,aAAa,EAAE,IAAA;AAAK,OAAC,CAAC,CAAA;AAChG,KAAA;AACA3B,IAAAA,WAAW,CAAC4B,QAAQ,CAACN,SAAS,CAAC,CAAA;;AAE/B;AACA,IAAA,OAAO,MAAMtB,WAAW,CAAC6B,UAAU,CAACP,SAAS,CAAC,CAAA;AAClD,GAAC,EAAE,CAAClB,YAAY,EAAED,gBAAgB,CAAC,CAAC,CAAA;AACxC;;;;"}
1
+ {"version":3,"file":"useFocusTrap-c3c6378b.js","sources":["../../src/utils/browser/focus/getFirstAndLastFocusable.ts","../../src/hooks/useFocusTrap.ts"],"sourcesContent":["import { getFocusableElements } from './getFocusableElements';\n\n/**\n * Get first and last elements focusable in an element.\n *\n * @param parentElement The element in which to search focusable elements.\n * @return first and last focusable elements\n */\nexport function getFirstAndLastFocusable(parentElement: HTMLElement | ShadowRoot) {\n const focusableElements = getFocusableElements(parentElement);\n\n // First non disabled element.\n const first = focusableElements[0];\n // Last non disabled element.\n const last = focusableElements[focusableElements.length - 1];\n\n if (last && first) {\n return { first, last };\n }\n return {};\n}\n","import { useEffect } from 'react';\n\nimport { DOCUMENT } from '@lumx/react/constants';\nimport { getFirstAndLastFocusable } from '@lumx/react/utils/browser/focus/getFirstAndLastFocusable';\nimport { Falsy } from '@lumx/react/utils/type';\nimport { Listener, makeListenerTowerContext } from '@lumx/react/utils/function/makeListenerTowerContext';\n\nconst FOCUS_TRAPS = makeListenerTowerContext();\n\n/**\n * Trap 'Tab' focus switch inside the `focusZoneElement`.\n *\n * If multiple focus trap are activated, only the last one is maintained and when a focus trap closes, the previous one\n * gets activated again.\n *\n * @param focusZoneElement The element in which to trap the focus.\n * @param focusElement The element to focus when the focus trap is activated (otherwise the first focusable element\n * will be focused).\n */\nexport function useFocusTrap(focusZoneElement: HTMLElement | Falsy, focusElement?: HTMLElement | null): void {\n useEffect(() => {\n // Body element can be undefined in SSR context.\n const rootElement = DOCUMENT?.body;\n\n if (!rootElement || !focusZoneElement) {\n return undefined;\n }\n\n // Use the shadow root as focusZoneElement when available\n const focusZoneElementOrShadowRoot = focusZoneElement.shadowRoot || focusZoneElement;\n\n // Trap 'Tab' key down focus switch into the focus zone.\n const trapTabFocusInFocusZone = (evt: KeyboardEvent) => {\n const { key } = evt;\n if (key !== 'Tab') {\n return;\n }\n\n const focusable = getFirstAndLastFocusable(focusZoneElementOrShadowRoot);\n\n // Prevent focus switch if no focusable available.\n if (!focusable.first) {\n evt.preventDefault();\n return;\n }\n\n const activeElement = focusZoneElement.shadowRoot\n ? focusZoneElement.shadowRoot.activeElement\n : document.activeElement;\n\n if (\n // No previous focus\n !activeElement ||\n // Previous focus is at the end of the focus zone.\n (!evt.shiftKey && activeElement === focusable.last) ||\n // Previous focus is outside the focus zone\n !focusZoneElementOrShadowRoot.contains(activeElement)\n ) {\n focusable.first.focus();\n evt.preventDefault();\n return;\n }\n\n if (\n // Focus order reversed\n evt.shiftKey &&\n // Previous focus is at the start of the focus zone.\n activeElement === focusable.first\n ) {\n focusable.last.focus();\n evt.preventDefault();\n }\n };\n\n const focusTrap: Listener = {\n enable: () => rootElement.addEventListener('keydown', trapTabFocusInFocusZone),\n disable: () => rootElement.removeEventListener('keydown', trapTabFocusInFocusZone),\n };\n\n // SETUP:\n if (focusElement && focusZoneElementOrShadowRoot.contains(focusElement)) {\n // Focus the given element.\n focusElement.focus({ preventScroll: true });\n } else {\n // Focus the first focusable element in the zone.\n getFirstAndLastFocusable(focusZoneElementOrShadowRoot).first?.focus({ preventScroll: true });\n }\n FOCUS_TRAPS.register(focusTrap);\n\n // TEARDOWN:\n return () => FOCUS_TRAPS.unregister(focusTrap);\n }, [focusElement, focusZoneElement]);\n}\n"],"names":["getFirstAndLastFocusable","parentElement","focusableElements","getFocusableElements","first","last","length","FOCUS_TRAPS","makeListenerTowerContext","useFocusTrap","focusZoneElement","focusElement","useEffect","rootElement","DOCUMENT","body","undefined","focusZoneElementOrShadowRoot","shadowRoot","trapTabFocusInFocusZone","evt","key","focusable","preventDefault","activeElement","document","shiftKey","contains","focus","focusTrap","enable","addEventListener","disable","removeEventListener","preventScroll","register","unregister"],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,CAACC,aAAuC,EAAE;AAC9E,EAAA,MAAMC,iBAAiB,GAAGC,oBAAoB,CAACF,aAAa,CAAC,CAAA;;AAE7D;AACA,EAAA,MAAMG,KAAK,GAAGF,iBAAiB,CAAC,CAAC,CAAC,CAAA;AAClC;EACA,MAAMG,IAAI,GAAGH,iBAAiB,CAACA,iBAAiB,CAACI,MAAM,GAAG,CAAC,CAAC,CAAA;EAE5D,IAAID,IAAI,IAAID,KAAK,EAAE;IACf,OAAO;MAAEA,KAAK;AAAEC,MAAAA,IAAAA;KAAM,CAAA;AAC1B,GAAA;AACA,EAAA,OAAO,EAAE,CAAA;AACb;;ACbA,MAAME,WAAW,GAAGC,wBAAwB,EAAE,CAAA;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAACC,gBA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B,QAAAA,SAAS,CAACjB,IAAI,CAACuB,KAAK,EAAE,CAAA;QACtBR,GAAG,CAACG,cAAc,EAAE,CAAA;AACxB,OAAA;KACH,CAAA;AAED,IAAA,MAAMM,SAAmB,GAAG;MACxBC,MAAM,EAAEA,MAAMjB,WAAW,CAACkB,gBAAgB,CAAC,SAAS,EAAEZ,uBAAuB,CAAC;MAC9Ea,OAAO,EAAEA,MAAMnB,WAAW,CAACoB,mBAAmB,CAAC,SAAS,EAAEd,uBAAuB,CAAA;KACpF,CAAA;;AAED;IACA,IAAIR,YAAY,IAAIM,4BAA4B,CAACU,QAAQ,CAAChB,YAAY,CAAC,EAAE;AACrE;MACAA,YAAY,CAACiB,KAAK,CAAC;AAAEM,QAAAA,aAAa,EAAE,IAAA;AAAK,OAAC,CAAC,CAAA;AAC/C,KAAC,MAAM;AACH;AACAlC,MAAAA,wBAAwB,CAACiB,4BAA4B,CAAC,CAACb,KAAK,EAAEwB,KAAK,CAAC;AAAEM,QAAAA,aAAa,EAAE,IAAA;AAAK,OAAC,CAAC,CAAA;AAChG,KAAA;AACA3B,IAAAA,WAAW,CAAC4B,QAAQ,CAACN,SAAS,CAAC,CAAA;;AAE/B;AACA,IAAA,OAAO,MAAMtB,WAAW,CAAC6B,UAAU,CAACP,SAAS,CAAC,CAAA;AAClD,GAAC,EAAE,CAAClB,YAAY,EAAED,gBAAgB,CAAC,CAAC,CAAA;AACxC;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React__default, { Children } from 'react';
2
2
  import { i as isComponentType } from './isComponentType-e806b848.js';
3
- import { Icon } from './components/icon-a00d698b.js';
3
+ import { I as Icon } from './index-d3e86bd8.js';
4
4
 
5
5
  /** Force wrap spaces around icons to make sure they are never stuck against text. */
6
6
  function wrapChildrenIconWithSpaces(children) {
@@ -17,4 +17,4 @@ function wrapChildrenIconWithSpaces(children) {
17
17
  }
18
18
 
19
19
  export { wrapChildrenIconWithSpaces as w };
20
- //# sourceMappingURL=wrapChildrenIconWithSpaces-ef2a6772.js.map
20
+ //# sourceMappingURL=wrapChildrenIconWithSpaces-fb85a743.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrapChildrenIconWithSpaces-ef2a6772.js","sources":["../../src/utils/react/wrapChildrenIconWithSpaces.tsx"],"sourcesContent":["import React, { Children } from 'react';\nimport { isComponentType } from '@lumx/react/utils/type';\nimport { Icon } from '@lumx/react';\n\n/** Force wrap spaces around icons to make sure they are never stuck against text. */\nexport function wrapChildrenIconWithSpaces(children: React.ReactNode): React.ReactNode {\n if (children === null || children === undefined) return undefined;\n return Children.toArray(children).flatMap((child) => {\n if (isComponentType(Icon)(child)) {\n return [' ', child, ' '];\n }\n if (\n React.isValidElement(child) &&\n child.props &&\n typeof child.props === 'object' &&\n 'children' in child.props\n ) {\n return React.cloneElement(child, undefined, wrapChildrenIconWithSpaces(child.props.children));\n }\n return child;\n });\n}\n"],"names":["wrapChildrenIconWithSpaces","children","undefined","Children","toArray","flatMap","child","isComponentType","Icon","React","isValidElement","props","cloneElement"],"mappings":";;;;AAIA;AACO,SAASA,0BAA0BA,CAACC,QAAyB,EAAmB;EACnF,IAAIA,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAKC,SAAS,EAAE,OAAOA,SAAS,CAAA;EACjE,OAAOC,QAAQ,CAACC,OAAO,CAACH,QAAQ,CAAC,CAACI,OAAO,CAAEC,KAAK,IAAK;AACjD,IAAA,IAAIC,eAAe,CAACC,IAAI,CAAC,CAACF,KAAK,CAAC,EAAE;AAC9B,MAAA,OAAO,CAAC,GAAG,EAAEA,KAAK,EAAE,GAAG,CAAC,CAAA;AAC5B,KAAA;IACA,iBACIG,cAAK,CAACC,cAAc,CAACJ,KAAK,CAAC,IAC3BA,KAAK,CAACK,KAAK,IACX,OAAOL,KAAK,CAACK,KAAK,KAAK,QAAQ,IAC/B,UAAU,IAAIL,KAAK,CAACK,KAAK,EAC3B;AACE,MAAA,oBAAOF,cAAK,CAACG,YAAY,CAACN,KAAK,EAAEJ,SAAS,EAAEF,0BAA0B,CAACM,KAAK,CAACK,KAAK,CAACV,QAAQ,CAAC,CAAC,CAAA;AACjG,KAAA;AACA,IAAA,OAAOK,KAAK,CAAA;AAChB,GAAC,CAAC,CAAA;AACN;;;;"}
1
+ {"version":3,"file":"wrapChildrenIconWithSpaces-fb85a743.js","sources":["../../src/utils/react/wrapChildrenIconWithSpaces.tsx"],"sourcesContent":["import React, { Children } from 'react';\nimport { isComponentType } from '@lumx/react/utils/type';\nimport { Icon } from '@lumx/react';\n\n/** Force wrap spaces around icons to make sure they are never stuck against text. */\nexport function wrapChildrenIconWithSpaces(children: React.ReactNode): React.ReactNode {\n if (children === null || children === undefined) return undefined;\n return Children.toArray(children).flatMap((child) => {\n if (isComponentType(Icon)(child)) {\n return [' ', child, ' '];\n }\n if (\n React.isValidElement(child) &&\n child.props &&\n typeof child.props === 'object' &&\n 'children' in child.props\n ) {\n return React.cloneElement(child, undefined, wrapChildrenIconWithSpaces(child.props.children));\n }\n return child;\n });\n}\n"],"names":["wrapChildrenIconWithSpaces","children","undefined","Children","toArray","flatMap","child","isComponentType","Icon","React","isValidElement","props","cloneElement"],"mappings":";;;;AAIA;AACO,SAASA,0BAA0BA,CAACC,QAAyB,EAAmB;EACnF,IAAIA,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAKC,SAAS,EAAE,OAAOA,SAAS,CAAA;EACjE,OAAOC,QAAQ,CAACC,OAAO,CAACH,QAAQ,CAAC,CAACI,OAAO,CAAEC,KAAK,IAAK;AACjD,IAAA,IAAIC,eAAe,CAACC,IAAI,CAAC,CAACF,KAAK,CAAC,EAAE;AAC9B,MAAA,OAAO,CAAC,GAAG,EAAEA,KAAK,EAAE,GAAG,CAAC,CAAA;AAC5B,KAAA;IACA,iBACIG,cAAK,CAACC,cAAc,CAACJ,KAAK,CAAC,IAC3BA,KAAK,CAACK,KAAK,IACX,OAAOL,KAAK,CAACK,KAAK,KAAK,QAAQ,IAC/B,UAAU,IAAIL,KAAK,CAACK,KAAK,EAC3B;AACE,MAAA,oBAAOF,cAAK,CAACG,YAAY,CAACN,KAAK,EAAEJ,SAAS,EAAEF,0BAA0B,CAACM,KAAK,CAACK,KAAK,CAACV,QAAQ,CAAC,CAAC,CAAA;AACjG,KAAA;AACA,IAAA,OAAOK,KAAK,CAAA;AAChB,GAAC,CAAC,CAAA;AACN;;;;"}
package/index.d.ts CHANGED
@@ -1042,13 +1042,24 @@ interface FlexBoxProps extends GenericProps {
1042
1042
  */
1043
1043
  declare const FlexBox: Comp<FlexBoxProps, HTMLDivElement>;
1044
1044
 
1045
- type GenericBlockGapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;
1046
1045
  /**
1047
1046
  * Accepted gap sizes for the generic block.
1048
1047
  */
1049
- declare const GenericBlockGapSize: {
1050
- [S in GenericBlockGapSize]: S;
1051
- };
1048
+ declare const GenericBlockGapSize: Pick<{
1049
+ readonly xxs: "xxs";
1050
+ readonly xs: "xs";
1051
+ readonly s: "s";
1052
+ readonly m: "m";
1053
+ readonly l: "l";
1054
+ readonly xl: "xl";
1055
+ readonly xxl: "xxl";
1056
+ readonly tiny: "tiny";
1057
+ readonly regular: "regular";
1058
+ readonly medium: "medium";
1059
+ readonly big: "big";
1060
+ readonly huge: "huge";
1061
+ }, "tiny" | "regular" | "medium" | "big" | "huge">;
1062
+ type GenericBlockGapSize = ValueOf<typeof GenericBlockGapSize>;
1052
1063
 
1053
1064
  interface GenericBlockProps extends FlexBoxProps {
1054
1065
  /**
package/index.js CHANGED
@@ -1,66 +1,66 @@
1
1
  export * from '@lumx/core/js/constants';
2
2
  export * from '@lumx/core/js/types';
3
3
  export { T as ThemeProvider, u as useTheme } from './_internal/ThemeContext-3181f000.js';
4
- export { AlertDialog } from './_internal/components/alert-dialog-bd1b2532.js';
5
- export { Autocomplete, AutocompleteMultiple } from './_internal/components/autocomplete-8ae2c4f9.js';
6
- export { Avatar } from './_internal/components/avatar-778d7df6.js';
4
+ export { AlertDialog } from './_internal/components/alert-dialog-5326cf04.js';
5
+ export { Autocomplete, AutocompleteMultiple } from './_internal/components/autocomplete-7d9581e8.js';
6
+ export { Avatar } from './_internal/components/avatar-52bb217f.js';
7
7
  export { Badge, BadgeWrapper } from './_internal/components/badge-ccf47147.js';
8
- export { a as Button, B as ButtonEmphasis } from './_internal/Button-f382ee1c.js';
9
- export { I as IconButton } from './_internal/IconButton-1790b47e.js';
10
- export { ButtonGroup } from './_internal/components/button-4aff084a.js';
11
- export { Checkbox } from './_internal/components/checkbox-a448ca6c.js';
12
- export { C as Chip } from './_internal/Chip-70af04b4.js';
13
- export { ChipGroup } from './_internal/components/chip-19e40755.js';
14
- export { CommentBlock, CommentBlockVariant } from './_internal/components/comment-block-bcbedf3c.js';
15
- export { D as DatePicker, a as DatePickerControlled, b as DatePickerField, P as PopoverDialog } from './_internal/PopoverDialog-3b63f140.js';
16
- export { Dialog } from './_internal/components/dialog-30336ccb.js';
8
+ export { a as Button, B as ButtonEmphasis } from './_internal/Button-1b7d3b79.js';
9
+ export { I as IconButton } from './_internal/IconButton-e11b5e74.js';
10
+ export { ButtonGroup } from './_internal/components/button-c4127e86.js';
11
+ export { Checkbox } from './_internal/components/checkbox-f7751583.js';
12
+ export { C as Chip } from './_internal/Chip-8fbedc93.js';
13
+ export { ChipGroup } from './_internal/components/chip-1ed080fb.js';
14
+ export { CommentBlock, CommentBlockVariant } from './_internal/components/comment-block-343e1922.js';
15
+ export { D as DatePicker, a as DatePickerControlled, b as DatePickerField, P as PopoverDialog } from './_internal/PopoverDialog-d85ff977.js';
16
+ export { Dialog } from './_internal/components/dialog-d0e090b1.js';
17
17
  export { Divider } from './_internal/components/divider-0e93aa3d.js';
18
- export { DragHandle } from './_internal/components/drag-handle-137f71b6.js';
19
- export { Dropdown } from './_internal/components/dropdown-d18122d7.js';
20
- export { ExpansionPanel } from './_internal/components/expansion-panel-38ed3d9f.js';
21
- export { Flag } from './_internal/components/flag-c2e41e8d.js';
22
- export { FlexBox } from './_internal/components/flex-box-15be92f6.js';
23
- export { GenericBlock, GenericBlockGapSize } from './_internal/components/generic-block-5d843f1e.js';
24
- export { Heading } from './_internal/components/heading-28520e1c.js';
18
+ export { DragHandle } from './_internal/components/drag-handle-eec23fc2.js';
19
+ export { Dropdown } from './_internal/components/dropdown-25170b7c.js';
20
+ export { ExpansionPanel } from './_internal/components/expansion-panel-df812318.js';
21
+ export { Flag } from './_internal/components/flag-c8d690bc.js';
22
+ export { FlexBox } from './_internal/components/flex-box-4eeba972.js';
23
+ export { GenericBlock, GenericBlockGapSize } from './_internal/components/generic-block-964b2724.js';
24
+ export { Heading } from './_internal/components/heading-6cc0f178.js';
25
25
  export { H as HeadingLevelProvider, u as useHeadingLevel } from './_internal/HeadingLevelProvider-ebdcb0c7.js';
26
26
  export { Grid, GridItem } from './_internal/components/grid-8c08dc4b.js';
27
- export { GridColumn } from './_internal/components/grid-column-85e305e7.js';
28
- export { Icon } from './_internal/components/icon-a00d698b.js';
29
- export { ImageBlock, ImageBlockCaptionPosition } from './_internal/components/image-block-10976174.js';
30
- export { ImageLightbox } from './_internal/components/image-lightbox-86f1e1fb.js';
27
+ export { GridColumn } from './_internal/components/grid-column-99652545.js';
28
+ export { I as Icon } from './_internal/index-d3e86bd8.js';
29
+ export { ImageBlock, ImageBlockCaptionPosition } from './_internal/components/image-block-4f3fe64c.js';
30
+ export { ImageLightbox } from './_internal/components/image-lightbox-7b172571.js';
31
31
  export { InlineList } from './_internal/components/inline-list-5ba8bb0f.js';
32
32
  export { InputHelper } from './_internal/components/input-helper-2e4e49fd.js';
33
33
  export { InputLabel } from './_internal/components/input-label-30d199c3.js';
34
- export { Lightbox } from './_internal/components/lightbox-c618a33b.js';
35
- export { Link } from './_internal/components/link-9c3feb34.js';
36
- export { LinkPreview } from './_internal/components/link-preview-79500604.js';
37
- export { L as List, a as ListItem, i as isClickable } from './_internal/List-c75646f2.js';
38
- export { ListDivider, ListSubheader } from './_internal/components/list-2f256244.js';
39
- export { Message } from './_internal/components/message-a3806f51.js';
40
- export { Mosaic } from './_internal/components/mosaic-e6581097.js';
41
- export { Navigation } from './_internal/components/navigation-5378f128.js';
42
- export { Notification } from './_internal/components/notification-49837625.js';
34
+ export { Lightbox } from './_internal/components/lightbox-10ff28f9.js';
35
+ export { Link } from './_internal/components/link-9d1bd2f6.js';
36
+ export { LinkPreview } from './_internal/components/link-preview-9525e97f.js';
37
+ export { L as List, a as ListItem, i as isClickable } from './_internal/List-4e95288a.js';
38
+ export { ListDivider, ListSubheader } from './_internal/components/list-c8c7a6eb.js';
39
+ export { Message } from './_internal/components/message-edd6a28a.js';
40
+ export { Mosaic } from './_internal/components/mosaic-c8084ee8.js';
41
+ export { Navigation } from './_internal/components/navigation-c9121998.js';
42
+ export { Notification } from './_internal/components/notification-97a8a04a.js';
43
43
  export { P as Placement } from './_internal/constants-43721918.js';
44
- export { P as Popover } from './_internal/index-25d2a45e.js';
45
- export { PostBlock } from './_internal/components/post-block-478bc3b8.js';
44
+ export { P as Popover } from './_internal/index-aa6d1d90.js';
45
+ export { PostBlock } from './_internal/components/post-block-7e63c4f4.js';
46
46
  export { Progress, ProgressCircular, ProgressLinear, ProgressVariant } from './_internal/components/progress-44bb0301.js';
47
- export { ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel } from './_internal/components/progress-tracker-0fd35bea.js';
47
+ export { ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel } from './_internal/components/progress-tracker-c9758d83.js';
48
48
  export { RadioButton, RadioGroup } from './_internal/components/radio-button-929c7bee.js';
49
- export { Select, SelectMultiple, SelectMultipleField, SelectVariant } from './_internal/components/select-a145edbb.js';
50
- export { SideNavigation, SideNavigationItem } from './_internal/components/side-navigation-b99d6022.js';
49
+ export { Select, SelectMultiple, SelectMultipleField, SelectVariant } from './_internal/components/select-bea40e77.js';
50
+ export { SideNavigation, SideNavigationItem } from './_internal/components/side-navigation-385825d4.js';
51
51
  export { SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography } from './_internal/components/skeleton-1ea8c82a.js';
52
52
  export { Slider, clamp } from './_internal/components/slider-78cfaa67.js';
53
- export { Slideshow } from './_internal/components/slideshow-b78ac3d6.js';
54
- export { b as Slides, a as SlideshowControls, S as SlideshowItem } from './_internal/Slides-2a427c44.js';
55
- export { Switch } from './_internal/components/switch-25b65051.js';
56
- export { Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, ThOrder } from './_internal/components/table-3cbee034.js';
57
- export { Tab, TabList, TabListLayout, TabPanel, TabProvider } from './_internal/components/tabs-5d8ea1a5.js';
58
- export { T as Text } from './_internal/index-151e2652.js';
59
- export { TextField } from './_internal/components/text-field-c26582c5.js';
60
- export { T as Thumbnail, u as useFocusPointStyle } from './_internal/Thumbnail-d2001ccb.js';
61
- export { ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant } from './_internal/components/thumbnail-cb55b26c.js';
53
+ export { Slideshow } from './_internal/components/slideshow-e0880d40.js';
54
+ export { b as Slides, a as SlideshowControls, S as SlideshowItem } from './_internal/Slides-68a7d0e6.js';
55
+ export { Switch } from './_internal/components/switch-24fea8d7.js';
56
+ export { Table, TableBody, TableCell, TableCellVariant, TableHeader, TableRow, ThOrder } from './_internal/components/table-834af792.js';
57
+ export { Tab, TabList, TabListLayout, TabPanel, TabProvider } from './_internal/components/tabs-bebfe959.js';
58
+ export { T as Text } from './_internal/index-77f213b1.js';
59
+ export { TextField } from './_internal/components/text-field-8597b7f7.js';
60
+ export { T as Thumbnail, u as useFocusPointStyle } from './_internal/Thumbnail-22bbea7e.js';
61
+ export { ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant } from './_internal/components/thumbnail-4928bba2.js';
62
62
  export { Toolbar } from './_internal/components/toolbar-e7c984e6.js';
63
- export { Tooltip } from './_internal/components/tooltip-dcb43bbe.js';
64
- export { Uploader, UploaderVariant } from './_internal/components/uploader-873b9bc1.js';
65
- export { UserBlock } from './_internal/components/user-block-7cbaffe0.js';
63
+ export { Tooltip } from './_internal/components/tooltip-21018736.js';
64
+ export { Uploader, UploaderVariant } from './_internal/components/uploader-2e1b080e.js';
65
+ export { UserBlock } from './_internal/components/user-block-5fd51607.js';
66
66
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "url": "https://github.com/lumapps/design-system/issues"
7
7
  },
8
8
  "dependencies": {
9
- "@lumx/core": "^3.20.1-alpha.31",
10
- "@lumx/icons": "^3.20.1-alpha.31",
9
+ "@lumx/core": "^3.20.1-alpha.32",
10
+ "@lumx/icons": "^3.20.1-alpha.32",
11
11
  "@popperjs/core": "^2.5.4",
12
12
  "body-scroll-lock": "^3.1.5",
13
13
  "classnames": "^2.3.2",
@@ -90,5 +90,5 @@
90
90
  "build:storybook": "storybook build"
91
91
  },
92
92
  "sideEffects": false,
93
- "version": "3.20.1-alpha.31"
93
+ "version": "3.20.1-alpha.32"
94
94
  }
package/utils/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ClickAwayProvider } from '../_internal/ClickAwayProvider-1204f237.js';
1
+ export { C as ClickAwayProvider } from '../_internal/ClickAwayProvider-7093ba23.js';
2
2
  export { P as Portal, a as PortalProvider } from '../_internal/Portal-3f86608e.js';
3
3
  export { D as DisabledStateProvider, u as useDisabledStateContext } from '../_internal/DisabledStateContext-ea04260d.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button-f382ee1c.js","sources":["../../src/components/button/Button.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { Emphasis, Icon, Size, Theme, Text, ThemeProvider } from '@lumx/react';\nimport { isComponent } from '@lumx/react/utils/type';\nimport { getBasicClass, getRootClassName } from '@lumx/core/js/utils/className';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nimport { BaseButtonProps, ButtonRoot } from './ButtonRoot';\n\n/**\n * Button emphasis definition.\n * @deprecated Use Emphasis instead.\n */\nexport const ButtonEmphasis = Emphasis;\n\n/**\n * Defines the props of the component.\n */\nexport interface ButtonProps extends BaseButtonProps {\n /** Left icon (SVG path). */\n leftIcon?: string;\n /** Right icon (SVG path). */\n rightIcon?: string;\n /** When `true`, the button gets as large as possible. */\n fullWidth?: boolean;\n /** Children */\n children?: React.ReactNode;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Button';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<ButtonProps> = {\n emphasis: Emphasis.high,\n size: Size.m,\n};\n\n/**\n * Button component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Button = forwardRef<ButtonProps, HTMLButtonElement | HTMLAnchorElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n children,\n className,\n emphasis = DEFAULT_PROPS.emphasis,\n leftIcon,\n rightIcon,\n size = DEFAULT_PROPS.size,\n theme = defaultTheme,\n ...forwardedProps\n } = props;\n\n const buttonClassName = classNames(\n className,\n getBasicClass({ prefix: CLASSNAME, type: 'hasLeftIcon', value: !!leftIcon }),\n getBasicClass({ prefix: CLASSNAME, type: 'hasRightIcon', value: !!rightIcon }),\n );\n\n return (\n <ButtonRoot\n ref={ref}\n {...{ emphasis, size, theme, ...forwardedProps }}\n className={buttonClassName}\n variant=\"button\"\n >\n {leftIcon && (\n // Theme is handled in the button scss\n <ThemeProvider value={undefined}>\n <Icon icon={leftIcon} />\n </ThemeProvider>\n )}\n {children && (isComponent(Text)(children) ? children : <span>{children}</span>)}\n {rightIcon && (\n // Theme is handled in the button scss\n <ThemeProvider value={undefined}>\n <Icon icon={rightIcon} />\n </ThemeProvider>\n )}\n </ButtonRoot>\n );\n});\nButton.displayName = COMPONENT_NAME;\nButton.className = CLASSNAME;\nButton.defaultProps = DEFAULT_PROPS;\n"],"names":["ButtonEmphasis","Emphasis","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","emphasis","high","size","Size","m","Button","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","children","className","leftIcon","rightIcon","theme","forwardedProps","buttonClassName","classNames","getBasicClass","prefix","type","value","_jsxs","ButtonRoot","variant","_jsx","ThemeProvider","undefined","Icon","icon","isComponent","Text","displayName","defaultProps"],"mappings":";;;;;;;;;;;AAcO,MAAMA,cAAc,GAAGC,SAAQ;;AAEtC;AACA;AACA;;AAYA;AACA;AACA;AACA,MAAMC,cAAc,GAAG,QAAQ,CAAA;;AAE/B;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAmC,GAAG;EACxCC,QAAQ,EAAEL,QAAQ,CAACM,IAAI;EACvBC,IAAI,EAAEC,IAAI,CAACC,CAAAA;AACf,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,MAAM,GAAGC,UAAU,CAAqD,CAACC,KAAK,EAAEC,GAAG,KAAK;EACjG,MAAMC,YAAY,GAAGC,QAAQ,EAAE,IAAIC,KAAK,CAACC,KAAK,CAAA;EAC9C,MAAM;IACFC,QAAQ;IACRC,SAAS;IACTd,QAAQ,GAAGD,aAAa,CAACC,QAAQ;IACjCe,QAAQ;IACRC,SAAS;IACTd,IAAI,GAAGH,aAAa,CAACG,IAAI;AACzBe,IAAAA,KAAK,GAAGR,YAAY;IACpB,GAAGS,cAAAA;AACP,GAAC,GAAGX,KAAK,CAAA;AAET,EAAA,MAAMY,eAAe,GAAGC,UAAU,CAC9BN,SAAS,EACTO,aAAa,CAAC;AAAEC,IAAAA,MAAM,EAAEzB,SAAS;AAAE0B,IAAAA,IAAI,EAAE,aAAa;IAAEC,KAAK,EAAE,CAAC,CAACT,QAAAA;GAAU,CAAC,EAC5EM,aAAa,CAAC;AAAEC,IAAAA,MAAM,EAAEzB,SAAS;AAAE0B,IAAAA,IAAI,EAAE,cAAc;IAAEC,KAAK,EAAE,CAAC,CAACR,SAAAA;AAAU,GAAC,CACjF,CAAC,CAAA;EAED,oBACIS,IAAA,CAACC,UAAU,EAAA;AACPlB,IAAAA,GAAG,EAAEA,GAAI;IACHR,QAAQ;IAAEE,IAAI;IAAEe,KAAK;AAAE,IAAA,GAAGC,cAAc;AAC9CJ,IAAAA,SAAS,EAAEK,eAAgB;AAC3BQ,IAAAA,OAAO,EAAC,QAAQ;AAAAd,IAAAA,QAAA,GAEfE,QAAQ;AAAA;AACL;AACAa,IAAAA,GAAA,CAACC,aAAa,EAAA;AAACL,MAAAA,KAAK,EAAEM,SAAU;MAAAjB,QAAA,eAC5Be,GAAA,CAACG,IAAI,EAAA;AAACC,QAAAA,IAAI,EAAEjB,QAAAA;OAAW,CAAA;AAAC,KACb,CAClB,EACAF,QAAQ,KAAKoB,WAAW,CAACC,IAAI,CAAC,CAACrB,QAAQ,CAAC,GAAGA,QAAQ,gBAAGe,GAAA,CAAA,MAAA,EAAA;AAAAf,MAAAA,QAAA,EAAOA,QAAAA;KAAe,CAAC,CAAC,EAC9EG,SAAS;AAAA;AACN;AACAY,IAAAA,GAAA,CAACC,aAAa,EAAA;AAACL,MAAAA,KAAK,EAAEM,SAAU;MAAAjB,QAAA,eAC5Be,GAAA,CAACG,IAAI,EAAA;AAACC,QAAAA,IAAI,EAAEhB,SAAAA;OAAY,CAAA;AAAC,KACd,CAClB,CAAA;AAAA,GACO,CAAC,CAAA;AAErB,CAAC,EAAC;AACFX,MAAM,CAAC8B,WAAW,GAAGvC,cAAc,CAAA;AACnCS,MAAM,CAACS,SAAS,GAAGjB,SAAS,CAAA;AAC5BQ,MAAM,CAAC+B,YAAY,GAAGrC,aAAa;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chip-70af04b4.js","sources":["../../src/hooks/useStopPropagation.ts","../../src/components/chip/Chip.tsx"],"sourcesContent":["import { MouseEventHandler, useCallback } from 'react';\n\n/**\n * Wrap mouse event handler to stop event propagation.\n *\n * @param handler The mouse handler to wrap.\n * @return Mouse handler stopping propagation.\n */\nexport function useStopPropagation(handler?: MouseEventHandler): MouseEventHandler {\n return useCallback(\n (evt) => {\n if (!evt || !handler) {\n return;\n }\n handler(evt);\n evt.stopPropagation();\n },\n [handler],\n );\n}\n","import { MouseEventHandler, ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { ColorPalette, Size, Theme } from '@lumx/react';\nimport { useStopPropagation } from '@lumx/react/hooks/useStopPropagation';\n\nimport { GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { onEnterPressed } from '@lumx/core/js/utils';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { useDisableStateProps } from '@lumx/react/utils/disabled/useDisableStateProps';\nimport { HasAriaDisabled } from '@lumx/react/utils/type/HasAriaDisabled';\n\n/**\n * Chip sizes.\n */\ntype ChipSize = Extract<Size, 's' | 'm'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface ChipProps extends GenericProps, HasTheme, HasAriaDisabled {\n /** A component to be rendered after the content. */\n after?: ReactNode;\n /** A component to be rendered before the content. */\n before?: ReactNode;\n /** Color variant. */\n color?: ColorPalette;\n /** Whether the component is clickable or not. */\n isClickable?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the chip is currently in a highlighted state or not. */\n isHighlighted?: boolean;\n /** Whether the component is selected or not. */\n isSelected?: boolean;\n /** Size variant. */\n size?: ChipSize;\n /** On \"after\" element clicked callback. */\n onAfterClick?: MouseEventHandler;\n /** On \"before\" element clicked callback. */\n onBeforeClick?: MouseEventHandler;\n /** Children */\n children?: React.ReactNode;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Chip';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<ChipProps> = {\n size: Size.m,\n};\n\n/**\n * Chip component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Chip = forwardRef<ChipProps, HTMLAnchorElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const { isAnyDisabled, disabledStateProps, otherProps } = useDisableStateProps(props);\n const {\n after,\n before,\n children,\n className,\n color,\n isClickable: propIsClickable,\n isHighlighted,\n isSelected,\n onAfterClick,\n onBeforeClick,\n onClick,\n size = DEFAULT_PROPS.size,\n theme = defaultTheme,\n href,\n onKeyDown,\n ...forwardedProps\n } = otherProps;\n const hasOnClick = Boolean(props.onClick);\n const isButton = hasOnClick && !href;\n const isClickable = Boolean(hasOnClick) || Boolean(href) || propIsClickable;\n\n // Adapt color to the theme.\n const chipColor = color || (theme === Theme.light ? ColorPalette.dark : ColorPalette.light);\n\n const handleOnBeforeClick = useStopPropagation(onBeforeClick);\n const handleOnAfterClick = useStopPropagation(onAfterClick);\n const handleKeyDown = (evt: React.KeyboardEvent) => {\n onKeyDown?.(evt);\n if (onClick) {\n onEnterPressed(onClick)(evt);\n }\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <a\n role={isButton ? 'button' : undefined}\n tabIndex={isClickable && !disabledStateProps.disabled ? 0 : undefined}\n {...forwardedProps}\n href={!disabledStateProps.disabled ? href : undefined}\n ref={ref}\n className={classNames(\n className,\n handleBasicClasses({\n clickable: isClickable,\n color: chipColor,\n isDisabled: isAnyDisabled,\n hasAfter: Boolean(after),\n hasBefore: Boolean(before),\n highlighted: Boolean(isHighlighted),\n prefix: CLASSNAME,\n selected: Boolean(isSelected),\n size,\n unselected: Boolean(!isSelected),\n }),\n )}\n aria-disabled={(isClickable && isAnyDisabled) || undefined}\n onClick={onClick || undefined}\n onKeyDown={handleKeyDown}\n >\n {before && (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions\n <div\n className={classNames(`${CLASSNAME}__before`, {\n [`${CLASSNAME}__before--is-clickable`]: !!onBeforeClick,\n })}\n onClick={handleOnBeforeClick}\n >\n {before}\n </div>\n )}\n <div className={`${CLASSNAME}__label`}>{children}</div>\n {after && (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions\n <div\n className={classNames(`${CLASSNAME}__after`, {\n [`${CLASSNAME}__after--is-clickable`]: !!onAfterClick,\n })}\n onClick={handleOnAfterClick}\n >\n {after}\n </div>\n )}\n </a>\n );\n});\nChip.displayName = COMPONENT_NAME;\nChip.className = CLASSNAME;\nChip.defaultProps = DEFAULT_PROPS;\n"],"names":["useStopPropagation","handler","useCallback","evt","stopPropagation","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","size","Size","m","Chip","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","isAnyDisabled","disabledStateProps","otherProps","useDisableStateProps","after","before","children","className","color","isClickable","propIsClickable","isHighlighted","isSelected","onAfterClick","onBeforeClick","onClick","theme","href","onKeyDown","forwardedProps","hasOnClick","Boolean","isButton","chipColor","ColorPalette","dark","handleOnBeforeClick","handleOnAfterClick","handleKeyDown","onEnterPressed","_jsxs","role","undefined","tabIndex","disabled","classNames","handleBasicClasses","clickable","isDisabled","hasAfter","hasBefore","highlighted","prefix","selected","unselected","_jsx","displayName","defaultProps"],"mappings":";;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAACC,OAA2B,EAAqB;EAC/E,OAAOC,WAAW,CACbC,GAAG,IAAK;AACL,IAAA,IAAI,CAACA,GAAG,IAAI,CAACF,OAAO,EAAE;AAClB,MAAA,OAAA;AACJ,KAAA;IACAA,OAAO,CAACE,GAAG,CAAC,CAAA;IACZA,GAAG,CAACC,eAAe,EAAE,CAAA;AACzB,GAAC,EACD,CAACH,OAAO,CACZ,CAAC,CA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sx"],"sourcesContent":["import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\nimport { isEmpty } from '@lumx/core/js/utils/collection/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(targets: HTMLElement[], refs: Array<RefObject<HTMLElement>>): boolean {\n // The targets elements are not contained in any of the listed element references.\n return !refs.some((ref) => targets.some((target) => ref?.current?.contains(target)));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target] as HTMLElement[];\n if (isClickAway(targets, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n"],"names":["EVENT_TYPES","isClickAway","targets","refs","some","ref","target","current","contains","useClickAway","callback","childrenRefs","useEffect","currentRefs","isEmpty","undefined","listener","evt","composedPath","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","createContext","ClickAwayProvider","children","parentRef","parentContext","useContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","useRef","_jsx","Provider","value","displayName"],"mappings":";;;;AAKA,MAAMA,WAAW,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AAE/C,SAASC,WAAWA,CAACC,OAAsB,EAAEC,IAAmC,EAAW;AACvF;EACA,OAAO,CAACA,IAAI,CAACC,IAAI,CAAEC,GAAG,IAAKH,OAAO,CAACE,IAAI,CAAEE,MAA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