@lumx/react 3.20.1-alpha.27 → 3.20.1-alpha.28

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 (150) hide show
  1. package/_internal/{Button-2b55a913.js → Button-5a87fee9.js} +5 -5
  2. package/_internal/{Button-2b55a913.js.map → Button-5a87fee9.js.map} +1 -1
  3. package/_internal/{ButtonRoot-823f3e9c.js → ButtonRoot-bf682215.js} +2 -2
  4. package/_internal/{ButtonRoot-823f3e9c.js.map → ButtonRoot-bf682215.js.map} +1 -1
  5. package/_internal/{Chip-e1e85810.js → Chip-8d0aae06.js} +2 -2
  6. package/_internal/{Chip-e1e85810.js.map → Chip-8d0aae06.js.map} +1 -1
  7. package/_internal/{IconButton-be160cb0.js → IconButton-351389b0.js} +5 -5
  8. package/_internal/{IconButton-be160cb0.js.map → IconButton-351389b0.js.map} +1 -1
  9. package/_internal/{ImageCaption-fcf5720c.js → ImageCaption-4109b433.js} +4 -4
  10. package/_internal/{ImageCaption-fcf5720c.js.map → ImageCaption-4109b433.js.map} +1 -1
  11. package/_internal/{List-dbf4297f.js → List-b7882a99.js} +241 -215
  12. package/_internal/{List-dbf4297f.js.map → List-b7882a99.js.map} +1 -1
  13. package/_internal/{PopoverDialog-193a0918.js → PopoverDialog-2e7b9ed5.js} +10 -10
  14. package/_internal/{PopoverDialog-193a0918.js.map → PopoverDialog-2e7b9ed5.js.map} +1 -1
  15. package/_internal/{Slides-2d267d8c.js → Slides-83646e84.js} +3 -3
  16. package/_internal/{Slides-2d267d8c.js.map → Slides-83646e84.js.map} +1 -1
  17. package/_internal/{Thumbnail-0872250e.js → Thumbnail-741501a5.js} +3 -3
  18. package/_internal/{Thumbnail-0872250e.js.map → Thumbnail-741501a5.js.map} +1 -1
  19. package/_internal/components/{alert-dialog-a6ed922b.js → alert-dialog-5df4f133.js} +6 -6
  20. package/_internal/components/{alert-dialog-a6ed922b.js.map → alert-dialog-5df4f133.js.map} +1 -1
  21. package/_internal/components/{autocomplete-c97b7698.js → autocomplete-824c779e.js} +7 -7
  22. package/_internal/components/{autocomplete-c97b7698.js.map → autocomplete-824c779e.js.map} +1 -1
  23. package/_internal/components/{avatar-d2214a61.js → avatar-69b66f01.js} +3 -3
  24. package/_internal/components/{avatar-d2214a61.js.map → avatar-69b66f01.js.map} +1 -1
  25. package/_internal/components/{badge-8390e590.js → badge-63cd3b1c.js} +2 -2
  26. package/_internal/components/{badge-8390e590.js.map → badge-63cd3b1c.js.map} +1 -1
  27. package/_internal/components/{button-b05f8f0c.js → button-eebd4e00.js} +4 -4
  28. package/_internal/components/{button-b05f8f0c.js.map → button-eebd4e00.js.map} +1 -1
  29. package/_internal/components/{checkbox-346834f8.js → checkbox-54943a02.js} +5 -5
  30. package/_internal/components/{checkbox-346834f8.js.map → checkbox-54943a02.js.map} +1 -1
  31. package/_internal/components/{chip-e3a6330f.js → chip-9ad6b318.js} +3 -3
  32. package/_internal/components/{chip-e3a6330f.js.map → chip-9ad6b318.js.map} +1 -1
  33. package/_internal/components/{comment-block-b1acc69f.js → comment-block-55a4ab3c.js} +4 -4
  34. package/_internal/components/{comment-block-b1acc69f.js.map → comment-block-55a4ab3c.js.map} +1 -1
  35. package/_internal/components/date-picker-a824a3ae.js +2 -0
  36. package/_internal/components/date-picker-a824a3ae.js.map +1 -0
  37. package/_internal/components/{dialog-785646aa.js → dialog-5e6320b8.js} +4 -4
  38. package/_internal/components/{dialog-785646aa.js.map → dialog-5e6320b8.js.map} +1 -1
  39. package/_internal/components/{divider-116af6b9.js → divider-bdf11ba3.js} +2 -2
  40. package/_internal/components/{divider-116af6b9.js.map → divider-bdf11ba3.js.map} +1 -1
  41. package/_internal/components/{drag-handle-6b073866.js → drag-handle-45912fd3.js} +3 -3
  42. package/_internal/components/{drag-handle-6b073866.js.map → drag-handle-45912fd3.js.map} +1 -1
  43. package/_internal/components/{dropdown-c0c0cfe8.js → dropdown-0216211d.js} +5 -5
  44. package/_internal/components/{dropdown-c0c0cfe8.js.map → dropdown-0216211d.js.map} +1 -1
  45. package/_internal/components/{expansion-panel-1de1d1ff.js → expansion-panel-3ce73c6b.js} +4 -4
  46. package/_internal/components/{expansion-panel-1de1d1ff.js.map → expansion-panel-3ce73c6b.js.map} +1 -1
  47. package/_internal/components/{flag-7c9d3abf.js → flag-1b177f78.js} +4 -4
  48. package/_internal/components/{flag-7c9d3abf.js.map → flag-1b177f78.js.map} +1 -1
  49. package/_internal/components/{flex-box-10423fa5.js → flex-box-93b97715.js} +2 -2
  50. package/_internal/components/{flex-box-10423fa5.js.map → flex-box-93b97715.js.map} +1 -1
  51. package/_internal/components/{generic-block-b79f163a.js → generic-block-925f7c5b.js} +3 -3
  52. package/_internal/components/{generic-block-b79f163a.js.map → generic-block-925f7c5b.js.map} +1 -1
  53. package/_internal/components/{grid-6f1b5a41.js → grid-95fd1493.js} +2 -2
  54. package/_internal/components/{grid-6f1b5a41.js.map → grid-95fd1493.js.map} +1 -1
  55. package/_internal/components/{grid-column-ee504283.js → grid-column-43f28cfb.js} +2 -2
  56. package/_internal/components/{grid-column-ee504283.js.map → grid-column-43f28cfb.js.map} +1 -1
  57. package/_internal/components/{heading-d4c66a34.js → heading-45d6e78e.js} +3 -3
  58. package/_internal/components/{heading-d4c66a34.js.map → heading-45d6e78e.js.map} +1 -1
  59. package/_internal/components/icon-79195151.js +2 -0
  60. package/_internal/components/icon-79195151.js.map +1 -0
  61. package/_internal/components/{image-block-762eb669.js → image-block-aba6d2db.js} +4 -4
  62. package/_internal/components/{image-block-762eb669.js.map → image-block-aba6d2db.js.map} +1 -1
  63. package/_internal/components/{image-lightbox-10fef304.js → image-lightbox-8b8e77c2.js} +8 -8
  64. package/_internal/components/{image-lightbox-10fef304.js.map → image-lightbox-8b8e77c2.js.map} +1 -1
  65. package/_internal/components/{inline-list-e6f19a98.js → inline-list-dfb9fd34.js} +2 -2
  66. package/_internal/components/{inline-list-e6f19a98.js.map → inline-list-dfb9fd34.js.map} +1 -1
  67. package/_internal/components/{input-helper-64153099.js → input-helper-c8a0078b.js} +2 -2
  68. package/_internal/components/{input-helper-64153099.js.map → input-helper-c8a0078b.js.map} +1 -1
  69. package/_internal/components/{input-label-2feb0bb0.js → input-label-9711398b.js} +2 -2
  70. package/_internal/components/{input-label-2feb0bb0.js.map → input-label-9711398b.js.map} +1 -1
  71. package/_internal/components/{lightbox-dcc9a7a0.js → lightbox-894abe64.js} +4 -4
  72. package/_internal/components/{lightbox-dcc9a7a0.js.map → lightbox-894abe64.js.map} +1 -1
  73. package/_internal/components/{link-f9421eab.js → link-e70e64ed.js} +4 -4
  74. package/_internal/components/{link-f9421eab.js.map → link-e70e64ed.js.map} +1 -1
  75. package/_internal/components/{link-preview-5c7e3878.js → link-preview-e56f3570.js} +4 -4
  76. package/_internal/components/{link-preview-5c7e3878.js.map → link-preview-e56f3570.js.map} +1 -1
  77. package/_internal/components/{list-f29e54b7.js → list-59b7ce56.js} +3 -3
  78. package/_internal/components/{list-f29e54b7.js.map → list-59b7ce56.js.map} +1 -1
  79. package/_internal/components/{message-aa3e3f76.js → message-a255dfd3.js} +4 -4
  80. package/_internal/components/{message-aa3e3f76.js.map → message-a255dfd3.js.map} +1 -1
  81. package/_internal/components/{mosaic-b4b35fa7.js → mosaic-192f2270.js} +4 -4
  82. package/_internal/components/mosaic-192f2270.js.map +1 -0
  83. package/_internal/components/{navigation-8357dbe6.js → navigation-dfe8aac0.js} +7 -7
  84. package/_internal/components/{navigation-8357dbe6.js.map → navigation-dfe8aac0.js.map} +1 -1
  85. package/_internal/components/{notification-ec4cf95f.js → notification-10f289b5.js} +4 -4
  86. package/_internal/components/{notification-ec4cf95f.js.map → notification-10f289b5.js.map} +1 -1
  87. package/_internal/components/popover-6c7f745b.js +3 -0
  88. package/_internal/components/popover-6c7f745b.js.map +1 -0
  89. package/_internal/components/{post-block-bb3d3cbf.js → post-block-f7dcc6e9.js} +4 -4
  90. package/_internal/components/{post-block-bb3d3cbf.js.map → post-block-f7dcc6e9.js.map} +1 -1
  91. package/_internal/components/{progress-f39c3fa2.js → progress-7a05fb0c.js} +2 -2
  92. package/_internal/components/{progress-f39c3fa2.js.map → progress-7a05fb0c.js.map} +1 -1
  93. package/_internal/components/{progress-tracker-997931ac.js → progress-tracker-48876add.js} +5 -5
  94. package/_internal/components/{progress-tracker-997931ac.js.map → progress-tracker-48876add.js.map} +1 -1
  95. package/_internal/components/{radio-button-559a4863.js → radio-button-07cf45e9.js} +4 -4
  96. package/_internal/components/{radio-button-559a4863.js.map → radio-button-07cf45e9.js.map} +1 -1
  97. package/_internal/components/{select-8295a416.js → select-8b54a444.js} +9 -9
  98. package/_internal/components/{select-8295a416.js.map → select-8b54a444.js.map} +1 -1
  99. package/_internal/components/{side-navigation-40ee8bda.js → side-navigation-7eeed3b4.js} +4 -4
  100. package/_internal/components/{side-navigation-40ee8bda.js.map → side-navigation-7eeed3b4.js.map} +1 -1
  101. package/_internal/components/{skeleton-c66516ee.js → skeleton-a4e84085.js} +2 -2
  102. package/_internal/components/{skeleton-c66516ee.js.map → skeleton-a4e84085.js.map} +1 -1
  103. package/_internal/components/{slider-efbfbc45.js → slider-5d64b470.js} +4 -4
  104. package/_internal/components/{slider-efbfbc45.js.map → slider-5d64b470.js.map} +1 -1
  105. package/_internal/components/{slideshow-c5faf531.js → slideshow-bce65cf6.js} +4 -4
  106. package/_internal/components/{slideshow-c5faf531.js.map → slideshow-bce65cf6.js.map} +1 -1
  107. package/_internal/components/{switch-a26a5a72.js → switch-7ae55d89.js} +4 -4
  108. package/_internal/components/{switch-a26a5a72.js.map → switch-7ae55d89.js.map} +1 -1
  109. package/_internal/components/{table-c43ec4a5.js → table-5bdf4aec.js} +3 -3
  110. package/_internal/components/{table-c43ec4a5.js.map → table-5bdf4aec.js.map} +1 -1
  111. package/_internal/components/{tabs-4037fe57.js → tabs-2ad54592.js} +4 -4
  112. package/_internal/components/{tabs-4037fe57.js.map → tabs-2ad54592.js.map} +1 -1
  113. package/_internal/components/text-09c81111.js +2 -0
  114. package/_internal/components/text-09c81111.js.map +1 -0
  115. package/_internal/components/{text-field-82adaeb4.js → text-field-3e1030f0.js} +6 -6
  116. package/_internal/components/{text-field-82adaeb4.js.map → text-field-3e1030f0.js.map} +1 -1
  117. package/_internal/components/{thumbnail-f1784929.js → thumbnail-1c5828b9.js} +2 -2
  118. package/_internal/components/{thumbnail-f1784929.js.map → thumbnail-1c5828b9.js.map} +1 -1
  119. package/_internal/components/{toolbar-a43533a2.js → toolbar-0d14efb7.js} +2 -2
  120. package/_internal/components/{toolbar-a43533a2.js.map → toolbar-0d14efb7.js.map} +1 -1
  121. package/_internal/components/{tooltip-aa48ddda.js → tooltip-31181a24.js} +3 -3
  122. package/_internal/components/{tooltip-aa48ddda.js.map → tooltip-31181a24.js.map} +1 -1
  123. package/_internal/components/{uploader-7bc3adaa.js → uploader-845b2412.js} +3 -3
  124. package/_internal/components/{uploader-7bc3adaa.js.map → uploader-845b2412.js.map} +1 -1
  125. package/_internal/components/{user-block-fc03f01a.js → user-block-91c30797.js} +4 -4
  126. package/_internal/components/{user-block-fc03f01a.js.map → user-block-91c30797.js.map} +1 -1
  127. package/_internal/{constants-b9e57936.js → constants-9b714e31.js} +145 -133
  128. package/_internal/{constants-b9e57936.js.map → constants-9b714e31.js.map} +1 -1
  129. package/_internal/forwardRef-d0e90329.js +82 -0
  130. package/_internal/{forwardRef-15f62847.js.map → forwardRef-d0e90329.js.map} +1 -1
  131. package/_internal/{index-8e7fecb5.js → index-68e1b0af.js} +4 -4
  132. package/_internal/{index-8e7fecb5.js.map → index-68e1b0af.js.map} +1 -1
  133. package/_internal/{index-192f8ada.js → index-745f94ee.js} +2 -2
  134. package/_internal/{index-192f8ada.js.map → index-745f94ee.js.map} +1 -1
  135. package/_internal/{index-b06353f2.js → index-ab520e78.js} +3 -3
  136. package/_internal/{index-b06353f2.js.map → index-ab520e78.js.map} +1 -1
  137. package/_internal/{wrapChildrenIconWithSpaces-f1e91251.js → wrapChildrenIconWithSpaces-e6038f72.js} +2 -2
  138. package/_internal/{wrapChildrenIconWithSpaces-f1e91251.js.map → wrapChildrenIconWithSpaces-e6038f72.js.map} +1 -1
  139. package/index.js +61 -61
  140. package/package.json +7 -13
  141. package/_internal/components/date-picker-582c4925.js +0 -2
  142. package/_internal/components/date-picker-582c4925.js.map +0 -1
  143. package/_internal/components/icon-7c79ab42.js +0 -2
  144. package/_internal/components/icon-7c79ab42.js.map +0 -1
  145. package/_internal/components/mosaic-b4b35fa7.js.map +0 -1
  146. package/_internal/components/popover-a674dd8d.js +0 -3
  147. package/_internal/components/popover-a674dd8d.js.map +0 -1
  148. package/_internal/components/text-851c62f8.js +0 -2
  149. package/_internal/components/text-851c62f8.js.map +0 -1
  150. package/_internal/forwardRef-15f62847.js +0 -70
@@ -1,12 +1,12 @@
1
- import { f as forwardRef, c as classNames } from './forwardRef-15f62847.js';
1
+ import { f as forwardRef, c as classNames } from './forwardRef-d0e90329.js';
2
2
  import { i as isComponent } from './isComponent-b9762ff1.js';
3
3
  import { getRootClassName, getBasicClass } from '@lumx/core/js/utils/className';
4
4
  import { u as useTheme, T as ThemeProvider } from './ThemeContext-3181f000.js';
5
- import { B as ButtonRoot } from './ButtonRoot-823f3e9c.js';
5
+ import { B as ButtonRoot } from './ButtonRoot-bf682215.js';
6
6
  import { jsxs, jsx } from 'react/jsx-runtime';
7
- import { T as Text } from './index-b06353f2.js';
7
+ import { T as Text } from './index-ab520e78.js';
8
8
  import { Emphasis, Size, Theme } from '@lumx/core/js/constants';
9
- import { I as Icon } from './index-192f8ada.js';
9
+ import { I as Icon } from './index-745f94ee.js';
10
10
 
11
11
  const ButtonEmphasis = Emphasis;
12
12
 
@@ -94,4 +94,4 @@ Button.className = CLASSNAME;
94
94
  Button.defaultProps = DEFAULT_PROPS;
95
95
 
96
96
  export { ButtonEmphasis as B, Button as a };
97
- //# sourceMappingURL=Button-2b55a913.js.map
97
+ //# sourceMappingURL=Button-5a87fee9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button-2b55a913.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,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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
+ {"version":3,"file":"Button-5a87fee9.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,GA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AA;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,4 +1,4 @@
1
- import { f as forwardRef, c as classNames } from './forwardRef-15f62847.js';
1
+ import { f as forwardRef, c as classNames } from './forwardRef-d0e90329.js';
2
2
  import './constants-d0e3f49e.js';
3
3
  import { handleBasicClasses } from '@lumx/core/js/utils/className';
4
4
  import { R as RawClickable } from './RawClickable-2c2b6a89.js';
@@ -114,4 +114,4 @@ ButtonRoot.displayName = COMPONENT_NAME;
114
114
  ButtonRoot.defaultProps = {};
115
115
 
116
116
  export { ButtonRoot as B };
117
- //# sourceMappingURL=ButtonRoot-823f3e9c.js.map
117
+ //# sourceMappingURL=ButtonRoot-bf682215.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonRoot-823f3e9c.js","sources":["../../src/components/button/ButtonRoot.tsx"],"sourcesContent":["import { AriaAttributes, ButtonHTMLAttributes, DetailedHTMLProps, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { ColorPalette, Emphasis, Size, Theme } from '@lumx/react';\nimport { CSS_PREFIX } from '@lumx/react/constants';\nimport { GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\nimport { HasAriaDisabled } from '@lumx/react/utils/type/HasAriaDisabled';\nimport { RawClickable } from '@lumx/react/utils/react/RawClickable';\nimport { useDisableStateProps } from '@lumx/react/utils/disabled';\n\ntype HTMLButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;\n\n/**\n * Button size definition.\n */\nexport type ButtonSize = Extract<Size, 's' | 'm'>;\n\nexport interface BaseButtonProps\n extends GenericProps,\n Pick<AriaAttributes, 'aria-expanded' | 'aria-haspopup' | 'aria-pressed' | 'aria-label'>,\n HasTheme,\n HasAriaDisabled {\n /** Color variant. */\n color?: ColorPalette;\n /** Emphasis variant. */\n emphasis?: Emphasis;\n /** Whether or not the button has a background color in low emphasis. */\n hasBackground?: boolean;\n /** Native anchor href property. It determines whether the Button will be a <button> or an <a>. */\n href?: string;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is selected or not (unsupported in `high` emphasis). */\n isSelected?: boolean;\n /** Native button name property. */\n name?: string;\n /** Size variant. */\n size?: ButtonSize;\n /** Native anchor target property. */\n target?: '_self' | '_blank' | '_parent' | '_top';\n /** Native button type. */\n type?: HTMLButtonProps['type'];\n /** Custom react component for the link (can be used to inject react router Link). */\n linkAs?: 'a' | any;\n}\n\nexport interface ButtonRootProps extends BaseButtonProps {\n variant: 'button' | 'icon';\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ButtonRoot';\n\nexport const BUTTON_WRAPPER_CLASSNAME = `${CSS_PREFIX}-button-wrapper`;\nexport const BUTTON_CLASSNAME = `${CSS_PREFIX}-button`;\n\n/**\n * Render a button wrapper with the ButtonRoot inside.\n *\n * @param props Component props.\n * @return React element.\n */\nconst renderButtonWrapper: React.FC<ButtonRootProps> = (props) => {\n const { color, emphasis, variant, fullWidth } = props;\n\n const adaptedColor =\n emphasis === Emphasis.low && (color === ColorPalette.light ? ColorPalette.dark : ColorPalette.light);\n\n const wrapperClassName = classNames(\n handleBasicClasses({\n color: adaptedColor,\n prefix: BUTTON_WRAPPER_CLASSNAME,\n variant,\n fullWidth,\n }),\n );\n const buttonProps = { ...props, hasBackground: false };\n\n return (\n <div className={wrapperClassName}>\n {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}\n <ButtonRoot {...buttonProps} />\n </div>\n );\n};\n\n/**\n * ButtonRoot component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ButtonRoot = forwardRef<ButtonRootProps, HTMLButtonElement | HTMLAnchorElement>((props, ref) => {\n const { isAnyDisabled, disabledStateProps, otherProps } = useDisableStateProps(props);\n const {\n 'aria-label': ariaLabel,\n children,\n className,\n color,\n emphasis,\n hasBackground,\n isSelected,\n isActive,\n isFocused,\n isHovered,\n linkAs,\n size,\n theme,\n variant,\n fullWidth,\n ...forwardedProps\n } = otherProps;\n\n const adaptedColor =\n color ||\n (emphasis !== Emphasis.high && theme === Theme.dark && ColorPalette.light) ||\n (emphasis === Emphasis.high && ColorPalette.primary) ||\n ColorPalette.dark;\n\n if (hasBackground) {\n return renderButtonWrapper({ ...props, ref, variant, color: adaptedColor });\n }\n\n const buttonClassName = classNames(\n className,\n handleBasicClasses({\n color: adaptedColor,\n emphasis,\n isSelected,\n isDisabled: props.isDisabled || props['aria-disabled'],\n isActive,\n isFocused,\n isHovered,\n prefix: BUTTON_CLASSNAME,\n size,\n theme: emphasis === Emphasis.high && theme,\n variant,\n fullWidth,\n }),\n );\n\n return (\n <RawClickable\n as={linkAs || (forwardedProps.href ? 'a' : 'button')}\n {...forwardedProps}\n {...disabledStateProps}\n aria-disabled={isAnyDisabled}\n aria-label={ariaLabel}\n ref={ref as RefObject<HTMLButtonElement>}\n className={buttonClassName}\n >\n {children}\n </RawClickable>\n );\n});\nButtonRoot.displayName = COMPONENT_NAME;\nButtonRoot.defaultProps = {};\n"],"names":["COMPONENT_NAME","BUTTON_WRAPPER_CLASSNAME","CSS_PREFIX","BUTTON_CLASSNAME","renderButtonWrapper","props","color","emphasis","variant","fullWidth","adaptedColor","Emphasis","low","ColorPalette","light","dark","wrapperClassName","classNames","handleBasicClasses","prefix","buttonProps","hasBackground","_jsx","className","children","ButtonRoot","forwardRef","ref","isAnyDisabled","disabledStateProps","otherProps","useDisableStateProps","ariaLabel","isSelected","isActive","isFocused","isHovered","linkAs","size","theme","forwardedProps","high","Theme","primary","buttonClassName","isDisabled","RawClickable","as","href","displayName","defaultProps"],"mappings":";;;;;;;;AAoDA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,YAAY,CAAA;AAE5B,MAAMC,wBAAwB,GAAG,CAAA,EAAGC,UAAU,CAAiB,eAAA,CAAA,CAAA;AAC/D,MAAMC,gBAAgB,GAAG,CAAA,EAAGD,UAAU,CAAS,OAAA,CAAA,CAAA;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,mBAA8C,GAAIC,KAAK,IAAK;EAC9D,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,OAAO;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAGJ,KAAK,CAAA;EAErD,MAAMK,YAAY,GACdH,QAAQ,KAAKI,QAAQ,CAACC,GAAG,KAAKN,KAAK,KAAKO,YAAY,CAACC,KAAK,GAAGD,YAAY,CAACE,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAA;AAExG,EAAA,MAAME,gBAAgB,GAAGC,UAAU,CAC/BC,kBAAkB,CAAC;AACfZ,IAAAA,KAAK,EAAEI,YAAY;AACnBS,IAAAA,MAAM,EAAElB,wBAAwB;IAChCO,OAAO;AACPC,IAAAA,SAAAA;AACJ,GAAC,CACL,CAAC,CAAA;AACD,EAAA,MAAMW,WAAW,GAAG;AAAE,IAAA,GAAGf,KAAK;AAAEgB,IAAAA,aAAa,EAAE,KAAA;GAAO,CAAA;AAEtD,EAAA,oBACIC,GAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAEP,gBAAiB;IAAAQ,QAAA,eAE7BF,GAAA,CAACG,UAAU,EAAA;MAAA,GAAKL,WAAAA;KAAc,CAAA;AAAC,GAC9B,CAAC,CAAA;AAEd,C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B;IACxBmC,IAAI;AACJC,IAAAA,KAAK,EAAEhC,QAAQ,KAAKI,QAAQ,CAAC8B,IAAI,IAAIF,KAAK;IAC1C/B,OAAO;AACPC,IAAAA,SAAAA;AACJ,GAAC,CACL,CAAC,CAAA;EAED,oBACIa,GAAA,CAACwB,YAAY,EAAA;IACTC,EAAE,EAAEV,MAAM,KAAKG,cAAc,CAACQ,IAAI,GAAG,GAAG,GAAG,QAAQ,CAAE;AAAA,IAAA,GACjDR,cAAc;AAAA,IAAA,GACdX,kBAAkB;AACtB,IAAA,eAAA,EAAeD,aAAc;AAC7B,IAAA,YAAA,EAAYI,SAAU;AACtBL,IAAAA,GAAG,EAAEA,GAAoC;AACzCJ,IAAAA,SAAS,EAAEqB,eAAgB;AAAApB,IAAAA,QAAA,EAE1BA,QAAAA;AAAQ,GACC,CAAC,CAAA;AAEvB,CAAC,EAAC;AACFC,UAAU,CAACwB,WAAW,GAAGjD,cAAc,CAAA;AACvCyB,UAAU,CAACyB,YAAY,GAAG,EAAE;;;;"}
1
+ {"version":3,"file":"ButtonRoot-bf682215.js","sources":["../../src/components/button/ButtonRoot.tsx"],"sourcesContent":["import { AriaAttributes, ButtonHTMLAttributes, DetailedHTMLProps, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { ColorPalette, Emphasis, Size, Theme } from '@lumx/react';\nimport { CSS_PREFIX } from '@lumx/react/constants';\nimport { GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\nimport { HasAriaDisabled } from '@lumx/react/utils/type/HasAriaDisabled';\nimport { RawClickable } from '@lumx/react/utils/react/RawClickable';\nimport { useDisableStateProps } from '@lumx/react/utils/disabled';\n\ntype HTMLButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;\n\n/**\n * Button size definition.\n */\nexport type ButtonSize = Extract<Size, 's' | 'm'>;\n\nexport interface BaseButtonProps\n extends GenericProps,\n Pick<AriaAttributes, 'aria-expanded' | 'aria-haspopup' | 'aria-pressed' | 'aria-label'>,\n HasTheme,\n HasAriaDisabled {\n /** Color variant. */\n color?: ColorPalette;\n /** Emphasis variant. */\n emphasis?: Emphasis;\n /** Whether or not the button has a background color in low emphasis. */\n hasBackground?: boolean;\n /** Native anchor href property. It determines whether the Button will be a <button> or an <a>. */\n href?: string;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is selected or not (unsupported in `high` emphasis). */\n isSelected?: boolean;\n /** Native button name property. */\n name?: string;\n /** Size variant. */\n size?: ButtonSize;\n /** Native anchor target property. */\n target?: '_self' | '_blank' | '_parent' | '_top';\n /** Native button type. */\n type?: HTMLButtonProps['type'];\n /** Custom react component for the link (can be used to inject react router Link). */\n linkAs?: 'a' | any;\n}\n\nexport interface ButtonRootProps extends BaseButtonProps {\n variant: 'button' | 'icon';\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ButtonRoot';\n\nexport const BUTTON_WRAPPER_CLASSNAME = `${CSS_PREFIX}-button-wrapper`;\nexport const BUTTON_CLASSNAME = `${CSS_PREFIX}-button`;\n\n/**\n * Render a button wrapper with the ButtonRoot inside.\n *\n * @param props Component props.\n * @return React element.\n */\nconst renderButtonWrapper: React.FC<ButtonRootProps> = (props) => {\n const { color, emphasis, variant, fullWidth } = props;\n\n const adaptedColor =\n emphasis === Emphasis.low && (color === ColorPalette.light ? ColorPalette.dark : ColorPalette.light);\n\n const wrapperClassName = classNames(\n handleBasicClasses({\n color: adaptedColor,\n prefix: BUTTON_WRAPPER_CLASSNAME,\n variant,\n fullWidth,\n }),\n );\n const buttonProps = { ...props, hasBackground: false };\n\n return (\n <div className={wrapperClassName}>\n {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}\n <ButtonRoot {...buttonProps} />\n </div>\n );\n};\n\n/**\n * ButtonRoot component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ButtonRoot = forwardRef<ButtonRootProps, HTMLButtonElement | HTMLAnchorElement>((props, ref) => {\n const { isAnyDisabled, disabledStateProps, otherProps } = useDisableStateProps(props);\n const {\n 'aria-label': ariaLabel,\n children,\n className,\n color,\n emphasis,\n hasBackground,\n isSelected,\n isActive,\n isFocused,\n isHovered,\n linkAs,\n size,\n theme,\n variant,\n fullWidth,\n ...forwardedProps\n } = otherProps;\n\n const adaptedColor =\n color ||\n (emphasis !== Emphasis.high && theme === Theme.dark && ColorPalette.light) ||\n (emphasis === Emphasis.high && ColorPalette.primary) ||\n ColorPalette.dark;\n\n if (hasBackground) {\n return renderButtonWrapper({ ...props, ref, variant, color: adaptedColor });\n }\n\n const buttonClassName = classNames(\n className,\n handleBasicClasses({\n color: adaptedColor,\n emphasis,\n isSelected,\n isDisabled: props.isDisabled || props['aria-disabled'],\n isActive,\n isFocused,\n isHovered,\n prefix: BUTTON_CLASSNAME,\n size,\n theme: emphasis === Emphasis.high && theme,\n variant,\n fullWidth,\n }),\n );\n\n return (\n <RawClickable\n as={linkAs || (forwardedProps.href ? 'a' : 'button')}\n {...forwardedProps}\n {...disabledStateProps}\n aria-disabled={isAnyDisabled}\n aria-label={ariaLabel}\n ref={ref as RefObject<HTMLButtonElement>}\n className={buttonClassName}\n >\n {children}\n </RawClickable>\n );\n});\nButtonRoot.displayName = COMPONENT_NAME;\nButtonRoot.defaultProps = {};\n"],"names":["COMPONENT_NAME","BUTTON_WRAPPER_CLASSNAME","CSS_PREFIX","BUTTON_CLASSNAME","renderButtonWrapper","props","color","emphasis","variant","fullWidth","adaptedColor","Emphasis","low","ColorPalette","light","dark","wrapperClassName","classNames","handleBasicClasses","prefix","buttonProps","hasBackground","_jsx","className","children","ButtonRoot","forwardRef","ref","isAnyDisabled","disabledStateProps","otherProps","useDisableStateProps","ariaLabel","isSelected","isActive","isFocused","isHovered","linkAs","size","theme","forwardedProps","high","Theme","primary","buttonClassName","isDisabled","RawClickable","as","href","displayName","defaultProps"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,EAAA;IACTC,EAAE,EAAEV,MAAM,KAAKG,cAAc,CAACQ,IAAI,GAAG,GAAG,GAAG,QAAQ,CAAE;AAAA,IAAA,GACjDR,cAAc;AAAA,IAAA,GACdX,kBAAkB;AACtB,IAAA,eAAA,EAAeD,aAAc;AAC7B,IAAA,YAAA,EAAYI,SAAU;AACtBL,IAAAA,GAAG,EAAEA,GAAoC;AACzCJ,IAAAA,SAAS,EAAEqB,eAAgB;AAAApB,IAAAA,QAAA,EAE1BA,QAAAA;AAAQ,GACC,CAAC,CAAA;AAEvB,CAAC,EAAC;AACFC,UAAU,CAACwB,WAAW,GAAGjD,cAAc,CAAA;AACvCyB,UAAU,CAACyB,YAAY,GAAG,EAAE;;;;"}
@@ -1,4 +1,4 @@
1
- import { f as forwardRef, c as classNames } from './forwardRef-15f62847.js';
1
+ import { f as forwardRef, c as classNames } from './forwardRef-d0e90329.js';
2
2
  import { useCallback } from 'react';
3
3
  import { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
4
4
  import { onEnterPressed } from '@lumx/core/js/utils';
@@ -140,4 +140,4 @@ Chip.className = CLASSNAME;
140
140
  Chip.defaultProps = DEFAULT_PROPS;
141
141
 
142
142
  export { Chip as C };
143
- //# sourceMappingURL=Chip-e1e85810.js.map
143
+ //# sourceMappingURL=Chip-8d0aae06.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip-e1e85810.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,CAAA;AACL;;AC6BA;AACA;AACA;AACA,MAAMI,cAAc,GAAG,MAAM,CAAA;;AAE7B;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAiC,GAAG;EACtCC,IAAI,EAAEC,IAAI,CAACC,CAAAA;AACf,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,IAAI,GAAGC,UAA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AAGA,EAAAA,SAAS,CAAwB,sBAAA,CAAA,GAAG,CAAC,CAAC4B,aAAAA;AAC9C,SAAC,CAAE;AACHC,QAAAA,OAAO,EAAEW,mBAAoB;AAAApB,QAAAA,QAAA,EAE5BD,MAAAA;OACA,CACR,eACDwC,GAAA,CAAA,KAAA,EAAA;QAAKtC,SAAS,EAAE,CAAGrB,EAAAA,SAAS,CAAU,OAAA,CAAA;AAAAoB,QAAAA,QAAA,EAAEA,QAAAA;OAAc,CAAC,EACtDF,KAAK;AAAA;AACF;MACAyC,GAAA,CAAA,KAAA,EAAA;AACItC,QAAAA,SAAS,EAAE4B,UAAU,CAAC,CAAGjD,EAAAA,SAAS,SAAS,EAAE;AACzC,UAAA,CAAC,CAAGA,EAAAA,SAAS,CAAuB,qBAAA,CAAA,GAAG,CAAC,CAAC2B,YAAAA;AAC7C,SAAC,CAAE;AACHE,QAAAA,OAAO,EAAEY,kBAAmB;AAAArB,QAAAA,QAAA,EAE3BF,KAAAA;AAAK,OACL,CACR,CAAA;KACF,CAAA;AAAC,IAAA;AAEZ,CAAC,EAAC;AACFZ,IAAI,CAACsD,WAAW,GAAG7D,cAAc,CAAA;AACjCO,IAAI,CAACe,SAAS,GAAGrB,SAAS,CAAA;AAC1BM,IAAI,CAACuD,YAAY,GAAG3D,aAAa;;;;"}
1
+ {"version":3,"file":"Chip-8d0aae06.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,CAAA;AACL;;AC6BA;AACA;AACA;AACA,MAAMI,cAAc,GAAG,MAAM,CAAA;;AAE7B;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAiC,GAAG;EACtCC,IAAI,EAAEC,IAAI,CAACC,CAAAA;AACf,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,IAAI,GAAGC,UAAU,CAA+B,CAACC,KAAK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AAwB,sBAAA,CAAA,GAAG,CAAC,CAAC4B,aAAAA;AAC9C,SAAC,CAAE;AACHC,QAAAA,OAAO,EAAEW,mBAAoB;AAAApB,QAAAA,QAAA,EAE5BD,MAAAA;OACA,CACR,eACDwC,GAAA,CAAA,KAAA,EAAA;QAAKtC,SAAS,EAAE,CAAGrB,EAAAA,SAAS,CAAU,OAAA,CAAA;AAAAoB,QAAAA,QAAA,EAAEA,QAAAA;OAAc,CAAC,EACtDF,KAAK;AAAA;AACF;MACAyC,GAAA,CAAA,KAAA,EAAA;AACItC,QAAAA,SAAS,EAAE4B,UAAU,CAAC,CAAGjD,EAAAA,SAAS,SAAS,EAAE;AACzC,UAAA,CAAC,CAAGA,EAAAA,SAAS,CAAuB,qBAAA,CAAA,GAAG,CAAC,CAAC2B,YAAAA;AAC7C,SAAC,CAAE;AACHE,QAAAA,OAAO,EAAEY,kBAAmB;AAAArB,QAAAA,QAAA,EAE3BF,KAAAA;AAAK,OACL,CACR,CAAA;KACF,CAAA;AAAC,IAAA;AAEZ,CAAC,EAAC;AACFZ,IAAI,CAACsD,WAAW,GAAG7D,cAAc,CAAA;AACjCO,IAAI,CAACe,SAAS,GAAGrB,SAAS,CAAA;AAC1BM,IAAI,CAACuD,YAAY,GAAG3D,aAAa;;;;"}
@@ -1,11 +1,11 @@
1
- import { B as ButtonRoot } from './ButtonRoot-823f3e9c.js';
1
+ import { B as ButtonRoot } from './ButtonRoot-bf682215.js';
2
2
  import { getRootClassName } from '@lumx/core/js/utils/className';
3
3
  import { u as useTheme, T as ThemeProvider } from './ThemeContext-3181f000.js';
4
- import { f as forwardRef } from './forwardRef-15f62847.js';
4
+ import { f as forwardRef } from './forwardRef-d0e90329.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- import { Tooltip } from './components/tooltip-aa48ddda.js';
6
+ import { Tooltip } from './components/tooltip-31181a24.js';
7
7
  import { Emphasis, Size, Theme } from '@lumx/core/js/constants';
8
- import { I as Icon } from './index-192f8ada.js';
8
+ import { I as Icon } from './index-745f94ee.js';
9
9
 
10
10
  /**
11
11
  * Component display name.
@@ -74,4 +74,4 @@ IconButton.className = CLASSNAME;
74
74
  IconButton.defaultProps = DEFAULT_PROPS;
75
75
 
76
76
  export { IconButton as I };
77
- //# sourceMappingURL=IconButton-be160cb0.js.map
77
+ //# sourceMappingURL=IconButton-351389b0.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton-be160cb0.js","sources":["../../src/components/button/IconButton.tsx"],"sourcesContent":["import { Emphasis, Icon, Size, Theme, ThemeProvider, Tooltip, TooltipProps } from '@lumx/react';\nimport { BaseButtonProps, ButtonRoot } from '@lumx/react/components/button/ButtonRoot';\nimport { getRootClassName } from '@lumx/core/js/utils/className';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nexport interface IconButtonProps extends BaseButtonProps {\n /**\n * Icon (SVG path).\n * If `image` is also set, `image` will be used instead.\n */\n icon?: string;\n /**\n * Image (image url).\n * Has priority over `icon`.\n */\n image?: string;\n /**\n * Label text (required for a11y purpose).\n * If you really don't want an aria-label, you can set an empty label (this is not recommended).\n */\n label: string;\n /**\n * Props to pass to the tooltip.\n * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.\n * */\n tooltipProps?: Partial<TooltipProps>;\n /** Whether the tooltip should be hidden or not. */\n hideTooltip?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'IconButton';\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<IconButtonProps> = {\n emphasis: Emphasis.high,\n size: Size.m,\n};\n\n/**\n * IconButton component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const IconButton = forwardRef<IconButtonProps, HTMLButtonElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n emphasis = DEFAULT_PROPS.emphasis,\n image,\n icon,\n label,\n size = DEFAULT_PROPS.size,\n theme = defaultTheme,\n tooltipProps,\n hideTooltip,\n ...forwardedProps\n } = props;\n\n return (\n <Tooltip label={hideTooltip ? '' : label} {...tooltipProps}>\n <ButtonRoot ref={ref} {...{ emphasis, size, theme, ...forwardedProps }} aria-label={label} variant=\"icon\">\n {image ? (\n <img\n // no need to set alt as an aria-label is already set on the button\n alt=\"\"\n src={image}\n />\n ) : (\n <ThemeProvider value={undefined}>\n <Icon icon={icon as string} />\n </ThemeProvider>\n )}\n </ButtonRoot>\n </Tooltip>\n );\n});\nIconButton.displayName = COMPONENT_NAME;\nIconButton.className = CLASSNAME;\nIconButton.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","emphasis","Emphasis","high","size","Size","m","IconButton","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","image","icon","label","theme","tooltipProps","hideTooltip","forwardedProps","_jsx","Tooltip","children","ButtonRoot","variant","alt","src","ThemeProvider","value","undefined","Icon","displayName","className","defaultProps"],"mappings":";;;;;;;;;AA+BA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,YAAY,CAAA;;AAEnC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAuC,GAAG;EAC5CC,QAAQ,EAAEC,QAAQ,CAACC,IAAI;EACvBC,IAAI,EAAEC,IAAI,CAACC,CAAAA;AACf,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAGC,UAAU,CAAqC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACrF,MAAMC,YAAY,GAAGC,QAAQ,EAAE,IAAIC,KAAK,CAACC,KAAK,CAAA;EAC9C,MAAM;IACFb,QAAQ,GAAGD,aAAa,CAACC,QAAQ;IACjCc,KAAK;IACLC,IAAI;IACJC,KAAK;IACLb,IAAI,GAAGJ,aAAa,CAACI,IAAI;AACzBc,IAAAA,KAAK,GAAGP,YAAY;IACpBQ,YAAY;IACZC,WAAW;IACX,GAAGC,cAAAA;AACP,GAAC,GAAGZ,KAAK,CAAA;EAET,oBACIa,GAAA,CAACC,OAAO,EAAA;AAACN,IAAAA,KAAK,EAAEG,WAAW,GAAG,EAAE,GAAGH,KAAM;AAAA,IAAA,GAAKE,YAAY;IAAAK,QAAA,eACtDF,GAAA,CAACG,UAAU,EAAA;AAACf,MAAAA,GAAG,EAAEA,GAAI;MAAOT,QAAQ;MAAEG,IAAI;MAAEc,KAAK;AAAE,MAAA,GAAGG,cAAc;AAAI,MAAA,YAAA,EAAYJ,KAAM;AAACS,MAAAA,OAAO,EAAC,MAAM;MAAAF,QAAA,EACpGT,KAAK,gBACFO,GAAA,CAAA,KAAA,EAAA;AACI;AACAK,QAAAA,GAAG,EAAC,EAAE;AACNC,QAAAA,GAAG,EAAEb,KAAAA;AAAM,OACd,CAAC,gBAEFO,GAAA,CAACO,aAAa,EAAA;AAACC,QAAAA,KAAK,EAAEC,SAAU;QAAAP,QAAA,eAC5BF,GAAA,CAACU,IAAI,EAAA;AAAChB,UAAAA,IAAI,EAAEA,IAAAA;SAAiB,CAAA;OAClB,CAAA;KAEX,CAAA;AAAC,GACR,CAAC,CAAA;AAElB,CAAC,EAAC;AACFT,UAAU,CAAC0B,WAAW,GAAGpC,cAAc,CAAA;AACvCU,UAAU,CAAC2B,SAAS,GAAGpC,SAAS,CAAA;AAChCS,UAAU,CAAC4B,YAAY,GAAGnC,aAAa;;;;"}
1
+ {"version":3,"file":"IconButton-351389b0.js","sources":["../../src/components/button/IconButton.tsx"],"sourcesContent":["import { Emphasis, Icon, Size, Theme, ThemeProvider, Tooltip, TooltipProps } from '@lumx/react';\nimport { BaseButtonProps, ButtonRoot } from '@lumx/react/components/button/ButtonRoot';\nimport { getRootClassName } from '@lumx/core/js/utils/className';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nexport interface IconButtonProps extends BaseButtonProps {\n /**\n * Icon (SVG path).\n * If `image` is also set, `image` will be used instead.\n */\n icon?: string;\n /**\n * Image (image url).\n * Has priority over `icon`.\n */\n image?: string;\n /**\n * Label text (required for a11y purpose).\n * If you really don't want an aria-label, you can set an empty label (this is not recommended).\n */\n label: string;\n /**\n * Props to pass to the tooltip.\n * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.\n * */\n tooltipProps?: Partial<TooltipProps>;\n /** Whether the tooltip should be hidden or not. */\n hideTooltip?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'IconButton';\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<IconButtonProps> = {\n emphasis: Emphasis.high,\n size: Size.m,\n};\n\n/**\n * IconButton component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const IconButton = forwardRef<IconButtonProps, HTMLButtonElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n emphasis = DEFAULT_PROPS.emphasis,\n image,\n icon,\n label,\n size = DEFAULT_PROPS.size,\n theme = defaultTheme,\n tooltipProps,\n hideTooltip,\n ...forwardedProps\n } = props;\n\n return (\n <Tooltip label={hideTooltip ? '' : label} {...tooltipProps}>\n <ButtonRoot ref={ref} {...{ emphasis, size, theme, ...forwardedProps }} aria-label={label} variant=\"icon\">\n {image ? (\n <img\n // no need to set alt as an aria-label is already set on the button\n alt=\"\"\n src={image}\n />\n ) : (\n <ThemeProvider value={undefined}>\n <Icon icon={icon as string} />\n </ThemeProvider>\n )}\n </ButtonRoot>\n </Tooltip>\n );\n});\nIconButton.displayName = COMPONENT_NAME;\nIconButton.className = CLASSNAME;\nIconButton.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","emphasis","Emphasis","high","size","Size","m","IconButton","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","image","icon","label","theme","tooltipProps","hideTooltip","forwardedProps","_jsx","Tooltip","children","ButtonRoot","variant","alt","src","ThemeProvider","value","undefined","Icon","displayName","className","defaultProps"],"mappings":";;;;;;;;;AA+BA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,YAAY,CAAA;;AAEnC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAuC,GAAG;EAC5CC,QAAQ,EAAEC,QAAQ,CAACC,IAAI;EACvBC,IAAI,EAAEC,IAAI,CAACC,CAAAA;AACf,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAGC,UAAU,CAAqC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACrF,MAAMC,YAAY,GAAGC,QAAQ,EAAE,IAAIC,KAAK,CAACC,KAAK,CAAA;EAC9C,MAAM;IACFb,QAAQ,GAAGD,aAAa,CAACC,QAAQ;IACjCc,KAAK;IACLC,IAAI;IACJC,KAAK;IACLb,IAAI,GAAGJ,aAAa,CAACI,IAAI;AACzBc,IAAAA,KAAK,GAAGP,YAAY;IACpBQ,YAAY;IACZC,WAAW;IACX,GAAGC,cAAAA;AACP,GAAC,GAAGZ,KAAK,CAAA;EAET,oBACIa,GAAA,CAACC,OAAO,EAAA;AAACN,IAAAA,KAAK,EAAEG,WAAW,GAAG,EAAE,GAAGH,KAAM;AAAA,IAAA,GAAKE,YAAY;IAAAK,QAAA,eACtDF,GAAA,CAACG,UAAU,EAAA;AAACf,MAAAA,GAAG,EAAEA,GAAI;MAAOT,QAAQ;MAAEG,IAAI;MAAEc,KAAK;AAAE,MAAA,GAAGG,cAAc;AAAI,MAAA,YAAA,EAAYJ,KAAM;AAACS,MAAAA,OAAO,EAAC,MAAM;MAAAF,QAAA,EACpGT,KAAK,gBACFO,GAAA,CAAA,KAAA,EAAA;AACI;AACAK,QAAAA,GAAG,EAAC,EAAE;AACNC,QAAAA,GAAG,EAAEb,KAAAA;AAAM,OACd,CAAC,gBAEFO,GAAA,CAACO,aAAa,EAAA;AAACC,QAAAA,KAAK,EAAEC,SAAU;QAAAP,QAAA,eAC5BF,GAAA,CAACU,IAAI,EAAA;AAAChB,UAAAA,IAAI,EAAEA,IAAAA;SAAiB,CAAA;OAClB,CAAA;KAEX,CAAA;AAAC,GACR,CAAC,CAAA;AAElB,CAAC,EAAC;AACFT,UAAU,CAAC0B,WAAW,GAAGpC,cAAc,CAAA;AACvCU,UAAU,CAAC2B,SAAS,GAAGpC,SAAS,CAAA;AAChCS,UAAU,CAAC4B,YAAY,GAAGnC,aAAa;;;;"}
@@ -1,8 +1,8 @@
1
- import { c as classNames } from './forwardRef-15f62847.js';
1
+ import { c as classNames } from './forwardRef-d0e90329.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { u as useTheme } from './ThemeContext-3181f000.js';
4
- import { FlexBox } from './components/flex-box-10423fa5.js';
5
- import { T as Text } from './index-b06353f2.js';
4
+ import { FlexBox } from './components/flex-box-93b97715.js';
5
+ import { T as Text } from './index-ab520e78.js';
6
6
 
7
7
  /** Internal component used to render image captions */
8
8
  const ImageCaption = props => {
@@ -72,4 +72,4 @@ const ImageCaption = props => {
72
72
  };
73
73
 
74
74
  export { ImageCaption as I };
75
- //# sourceMappingURL=ImageCaption-fcf5720c.js.map
75
+ //# sourceMappingURL=ImageCaption-4109b433.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCaption-fcf5720c.js","sources":["../../src/components/image-block/ImageCaption.tsx"],"sourcesContent":["import { CSSProperties, ReactNode } from 'react';\n\nimport { FlexBox, HorizontalAlignment, Text, TextProps, useTheme } from '@lumx/react';\nimport { HasPolymorphicAs, HasTheme } from '@lumx/react/utils/type';\nimport classNames from 'classnames';\n\ntype As = 'div' | 'figcaption';\n\ntype ForwardedTextProps = Omit<TextProps, 'as' | 'typography' | 'color' | 'colorVariant'>;\n\nexport type ImageCaptionMetadata = {\n /** Image title to display in the caption. */\n title?: string;\n /** Props to pass to the title. */\n titleProps?: ForwardedTextProps;\n /** Image description. Can be either a string, or sanitized html. */\n description?: string | { __html: string };\n /** Props to pass to the title. */\n descriptionProps?: ForwardedTextProps;\n /** Tag content. */\n tags?: ReactNode;\n /** Caption custom CSS style. */\n captionStyle?: CSSProperties;\n};\n\nexport type ImageCaptionProps<AS extends As = 'figcaption'> = HasTheme &\n HasPolymorphicAs<AS> &\n ImageCaptionMetadata & {\n /** Base className for sub elements */\n baseClassName?: string;\n /** Alignment. */\n align?: HorizontalAlignment;\n /** Truncate text on title & description (no line wrapping). */\n truncate?: TextProps['truncate'];\n };\n\n/** Internal component used to render image captions */\nexport const ImageCaption = <AS extends As>(props: ImageCaptionProps<AS>) => {\n const defaultTheme = useTheme();\n const {\n baseClassName,\n theme = defaultTheme,\n as = 'figcaption',\n title,\n titleProps,\n description,\n descriptionProps,\n tags,\n captionStyle,\n align,\n truncate,\n } = props;\n if (!title && !description && !tags) return null;\n\n const titleColor = { color: theme === 'dark' ? 'light' : 'dark' } as const;\n const baseColor = { color: theme === 'dark' ? 'light' : 'dark', colorVariant: 'L2' } as const;\n\n // Display description as string or HTML\n const descriptionContent =\n typeof description === 'string' ? { children: description } : { dangerouslySetInnerHTML: description };\n\n return (\n <FlexBox\n as={as}\n className={classNames(baseClassName && `${baseClassName}__wrapper`)}\n style={captionStyle}\n orientation=\"vertical\"\n vAlign={align}\n hAlign={align === 'center' ? align : undefined}\n gap=\"regular\"\n >\n {(title || description) && (\n <Text\n as=\"p\"\n className={classNames(baseClassName && `${baseClassName}__caption`)}\n truncate={truncate}\n {...baseColor}\n >\n {title && (\n <Text\n {...titleProps}\n as=\"span\"\n className={classNames(titleProps?.className, baseClassName && `${baseClassName}__title`)}\n typography=\"subtitle1\"\n {...titleColor}\n >\n {title}\n </Text>\n )}{' '}\n {description && (\n <Text\n {...descriptionProps}\n as=\"span\"\n className={classNames(\n descriptionProps?.className,\n baseClassName && `${baseClassName}__description`,\n )}\n typography=\"body1\"\n {...descriptionContent}\n />\n )}\n </Text>\n )}\n {tags && (\n <FlexBox\n className={classNames(baseClassName && `${baseClassName}__tags`)}\n orientation=\"horizontal\"\n vAlign={align}\n >\n {tags}\n </FlexBox>\n )}\n </FlexBox>\n );\n};\n"],"names":["ImageCaption","props","defaultTheme","useTheme","baseClassName","theme","as","title","titleProps","description","descriptionProps","tags","captionStyle","align","truncate","titleColor","color","baseColor","colorVariant","descriptionContent","children","dangerouslySetInnerHTML","_jsxs","FlexBox","className","classNames","style","orientation","vAlign","hAlign","undefined","gap","Text","_jsx","typography"],"mappings":";;;;;;AAoCA;AACaA,MAAAA,YAAY,GAAmBC,KAA4B,IAAK;AACzE,EAAA,MAAMC,YAAY,GAAGC,QAAQ,EAAE,CAAA;EAC/B,MAAM;IACFC,aAAa;AACbC,IAAAA,KAAK,GAAGH,YAAY;AACpBI,IAAAA,EAAE,GAAG,YAAY;IACjBC,KAAK;IACLC,UAAU;IACVC,WAAW;IACXC,gBAAgB;IAChBC,IAAI;IACJC,YAAY;IACZC,KAAK;AACLC,IAAAA,QAAAA;AACJ,GAAC,GAAGb,KAAK,CAAA;EACT,IAAI,CAACM,KAAK,IAAI,CAACE,WAAW,IAAI,CAACE,IAAI,EAAE,OAAO,IAAI,CAAA;AAEhD,EAAA,MAAMI,UAAU,GAAG;AAAEC,IAAAA,KAAK,EAAEX,KAAK,KAAK,MAAM,GAAG,OAAO,GAAG,MAAA;GAAiB,CAAA;AAC1E,EAAA,MAAMY,SAAS,GAAG;AAAED,IAAAA,KAAK,EAAEX,KAAK,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM;AAAEa,IAAAA,YAAY,EAAE,IAAA;GAAe,CAAA;;AAE7F;AACA,EAAA,MAAMC,kBAAkB,GACpB,OAAOV,WAAW,KAAK,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AAEC,UAAU,CACjBf,gBAAgB,EAAEc,SAAS,EAC3BpB,aAAa,IAAI,CAAA,EAAGA,aAAa,CAAA,aAAA,CACrC,CAAE;AACF8B,QAAAA,UAAU,EAAC,OAAO;QAAA,GACdf,kBAAAA;AAAkB,OACzB,CACJ,CAAA;AAAA,KACC,CACT,EACAR,IAAI,iBACDsB,GAAA,CAACV,OAAO,EAAA;MACJC,SAAS,EAAEC,UAAU,CAACrB,aAAa,IAAI,CAAGA,EAAAA,aAAa,QAAQ,CAAE;AACjEuB,MAAAA,WAAW,EAAC,YAAY;AACxBC,MAAAA,MAAM,EAAEf,KAAM;AAAAO,MAAAA,QAAA,EAEbT,IAAAA;AAAI,KACA,CACZ,CAAA;AAAA,GACI,CAAC,CAAA;AAElB;;;;"}
1
+ {"version":3,"file":"ImageCaption-4109b433.js","sources":["../../src/components/image-block/ImageCaption.tsx"],"sourcesContent":["import { CSSProperties, ReactNode } from 'react';\n\nimport { FlexBox, HorizontalAlignment, Text, TextProps, useTheme } from '@lumx/react';\nimport { HasPolymorphicAs, HasTheme } from '@lumx/react/utils/type';\nimport classNames from 'classnames';\n\ntype As = 'div' | 'figcaption';\n\ntype ForwardedTextProps = Omit<TextProps, 'as' | 'typography' | 'color' | 'colorVariant'>;\n\nexport type ImageCaptionMetadata = {\n /** Image title to display in the caption. */\n title?: string;\n /** Props to pass to the title. */\n titleProps?: ForwardedTextProps;\n /** Image description. Can be either a string, or sanitized html. */\n description?: string | { __html: string };\n /** Props to pass to the title. */\n descriptionProps?: ForwardedTextProps;\n /** Tag content. */\n tags?: ReactNode;\n /** Caption custom CSS style. */\n captionStyle?: CSSProperties;\n};\n\nexport type ImageCaptionProps<AS extends As = 'figcaption'> = HasTheme &\n HasPolymorphicAs<AS> &\n ImageCaptionMetadata & {\n /** Base className for sub elements */\n baseClassName?: string;\n /** Alignment. */\n align?: HorizontalAlignment;\n /** Truncate text on title & description (no line wrapping). */\n truncate?: TextProps['truncate'];\n };\n\n/** Internal component used to render image captions */\nexport const ImageCaption = <AS extends As>(props: ImageCaptionProps<AS>) => {\n const defaultTheme = useTheme();\n const {\n baseClassName,\n theme = defaultTheme,\n as = 'figcaption',\n title,\n titleProps,\n description,\n descriptionProps,\n tags,\n captionStyle,\n align,\n truncate,\n } = props;\n if (!title && !description && !tags) return null;\n\n const titleColor = { color: theme === 'dark' ? 'light' : 'dark' } as const;\n const baseColor = { color: theme === 'dark' ? 'light' : 'dark', colorVariant: 'L2' } as const;\n\n // Display description as string or HTML\n const descriptionContent =\n typeof description === 'string' ? { children: description } : { dangerouslySetInnerHTML: description };\n\n return (\n <FlexBox\n as={as}\n className={classNames(baseClassName && `${baseClassName}__wrapper`)}\n style={captionStyle}\n orientation=\"vertical\"\n vAlign={align}\n hAlign={align === 'center' ? align : undefined}\n gap=\"regular\"\n >\n {(title || description) && (\n <Text\n as=\"p\"\n className={classNames(baseClassName && `${baseClassName}__caption`)}\n truncate={truncate}\n {...baseColor}\n >\n {title && (\n <Text\n {...titleProps}\n as=\"span\"\n className={classNames(titleProps?.className, baseClassName && `${baseClassName}__title`)}\n typography=\"subtitle1\"\n {...titleColor}\n >\n {title}\n </Text>\n )}{' '}\n {description && (\n <Text\n {...descriptionProps}\n as=\"span\"\n className={classNames(\n descriptionProps?.className,\n baseClassName && `${baseClassName}__description`,\n )}\n typography=\"body1\"\n {...descriptionContent}\n />\n )}\n </Text>\n )}\n {tags && (\n <FlexBox\n className={classNames(baseClassName && `${baseClassName}__tags`)}\n orientation=\"horizontal\"\n vAlign={align}\n >\n {tags}\n </FlexBox>\n )}\n </FlexBox>\n );\n};\n"],"names":["ImageCaption","props","defaultTheme","useTheme","baseClassName","theme","as","title","titleProps","description","descriptionProps","tags","captionStyle","align","truncate","titleColor","color","baseColor","colorVariant","descriptionContent","children","dangerouslySetInnerHTML","_jsxs","FlexBox","className","classNames","style","orientation","vAlign","hAlign","undefined","gap","Text","_jsx","typography"],"mappings":";;;;;;AAoCA;AACaA,MAAAA,YAAY,GAA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