@muraldevkit/ui-toolkit 4.79.1 → 4.81.0-dev-Rwvu.1

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 (165) hide show
  1. package/dist/cjs/components/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
  2. package/dist/cjs/components/badge/MrlBadge/MrlBadge.js.map +1 -1
  3. package/dist/cjs/components/badge/MrlBadgeNotification/MrlBadgeNotification.js.map +1 -1
  4. package/dist/cjs/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js.map +1 -1
  5. package/dist/cjs/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  6. package/dist/cjs/components/empty/default/MrlEmpty.js.map +1 -1
  7. package/dist/cjs/components/empty/large/MrlEmptyLarge.js.map +1 -1
  8. package/dist/cjs/components/form/date-picker/MrlDatePicker.js.map +1 -1
  9. package/dist/cjs/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
  10. package/dist/cjs/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
  11. package/dist/cjs/components/form/select/MrlMultiSelect/MrlMultiSelect.js.map +1 -1
  12. package/dist/cjs/components/form/select/MrlSelect/MrlSelect.js.map +1 -1
  13. package/dist/cjs/components/form/switch/MrlSwitch/MrlSwitch.js.map +1 -1
  14. package/dist/cjs/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js.map +1 -1
  15. package/dist/cjs/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js.map +1 -1
  16. package/dist/cjs/components/grid/MrlCol/MrlCol.js +58 -55
  17. package/dist/cjs/components/grid/MrlCol/MrlCol.js.map +1 -1
  18. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js +3 -5
  19. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  20. package/dist/cjs/components/grid/MrlRow/MrlRow.js +10 -8
  21. package/dist/cjs/components/grid/MrlRow/MrlRow.js.map +1 -1
  22. package/dist/cjs/components/grid/constants.js +47 -9
  23. package/dist/cjs/components/grid/constants.js.map +1 -1
  24. package/dist/cjs/components/layout/MrlSidebar/MrlSidebar.js.map +1 -1
  25. package/dist/cjs/components/live-region/MrlLiveRegion/MrlLiveRegion.js.map +1 -1
  26. package/dist/cjs/components/notification/MrlToast/MrlToast.js.map +1 -1
  27. package/dist/cjs/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
  28. package/dist/cjs/components/portal/MrlPortal.js.map +1 -1
  29. package/dist/cjs/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.js.map +1 -1
  30. package/dist/cjs/components/svg/MrlSvg/MrlSvg.js.map +1 -1
  31. package/dist/cjs/components/table/MrlTableCell/MrlTableCell.js.map +1 -1
  32. package/dist/cjs/components/table/MrlTableColumn/MrlTableColumn.js.map +1 -1
  33. package/dist/cjs/components/tabs/MrlTab/MrlTab.js.map +1 -1
  34. package/dist/cjs/components/tabs/MrlTabGroup/MrlTabGroup.js.map +1 -1
  35. package/dist/cjs/components/tabs/MrlTabLink/MrlTabLink.js.map +1 -1
  36. package/dist/cjs/components/tabs/MrlTabs/MrlTabs.js.map +1 -1
  37. package/dist/cjs/components/text/MrlTextHeading/MrlTextHeading.js.map +1 -1
  38. package/dist/cjs/components/toolbar/MrlToolbar/MrlToolbar.js.map +1 -1
  39. package/dist/cjs/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
  40. package/dist/cjs/version.js +1 -1
  41. package/dist/cjs/version.js.map +1 -1
  42. package/dist/components/avatar/MrlAvatar/MrlAvatar.d.ts +8 -0
  43. package/dist/components/badge/MrlBadge/MrlBadge.d.ts +2 -0
  44. package/dist/components/badge/MrlBadgeNotification/MrlBadgeNotification.d.ts +1 -0
  45. package/dist/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.d.ts +1 -0
  46. package/dist/components/callout/MrlCallout/MrlCallout.d.ts +9 -0
  47. package/dist/components/empty/default/MrlEmpty.d.ts +4 -0
  48. package/dist/components/empty/large/MrlEmptyLarge.d.ts +4 -0
  49. package/dist/components/form/date-picker/MrlDatePicker.d.ts +2 -0
  50. package/dist/components/form/select/MrlCreatableSelect/MrlCreatableSelect.d.ts +4 -0
  51. package/dist/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.d.ts +4 -0
  52. package/dist/components/form/select/MrlMultiSelect/MrlMultiSelect.d.ts +3 -0
  53. package/dist/components/form/select/MrlSelect/MrlSelect.d.ts +3 -0
  54. package/dist/components/form/switch/MrlSwitch/MrlSwitch.d.ts +3 -0
  55. package/dist/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.d.ts +3 -0
  56. package/dist/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.d.ts +3 -0
  57. package/dist/components/grid/MrlCol/MrlCol.d.ts +4 -6
  58. package/dist/components/grid/MrlCol/index.d.ts +1 -1
  59. package/dist/components/grid/MrlGrid/MrlGrid.d.ts +4 -4
  60. package/dist/components/grid/MrlGrid/index.d.ts +1 -1
  61. package/dist/components/grid/MrlRow/MrlRow.d.ts +7 -7
  62. package/dist/components/grid/MrlRow/index.d.ts +1 -1
  63. package/dist/components/grid/constants.d.ts +76 -12
  64. package/dist/components/grid/index.d.ts +1 -0
  65. package/dist/components/layout/MrlSidebar/MrlSidebar.d.ts +2 -0
  66. package/dist/components/live-region/MrlLiveRegion/MrlLiveRegion.d.ts +6 -0
  67. package/dist/components/notification/MrlToast/MrlToast.d.ts +8 -0
  68. package/dist/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +1 -0
  69. package/dist/components/portal/MrlPortal.d.ts +1 -0
  70. package/dist/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.d.ts +10 -0
  71. package/dist/components/svg/MrlSvg/MrlSvg.d.ts +1 -0
  72. package/dist/components/table/MrlTableCell/MrlTableCell.d.ts +3 -0
  73. package/dist/components/table/MrlTableColumn/MrlTableColumn.d.ts +3 -0
  74. package/dist/components/tabs/MrlTab/MrlTab.d.ts +2 -0
  75. package/dist/components/tabs/MrlTabGroup/MrlTabGroup.d.ts +1 -0
  76. package/dist/components/tabs/MrlTabLink/MrlTabLink.d.ts +1 -0
  77. package/dist/components/tabs/MrlTabs/MrlTabs.d.ts +2 -0
  78. package/dist/components/text/MrlTextHeading/MrlTextHeading.d.ts +1 -0
  79. package/dist/components/toolbar/MrlToolbar/MrlToolbar.d.ts +12 -0
  80. package/dist/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +2 -0
  81. package/dist/esm/components/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
  82. package/dist/esm/components/badge/MrlBadge/MrlBadge.js.map +1 -1
  83. package/dist/esm/components/badge/MrlBadgeNotification/MrlBadgeNotification.js.map +1 -1
  84. package/dist/esm/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js.map +1 -1
  85. package/dist/esm/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  86. package/dist/esm/components/empty/default/MrlEmpty.js.map +1 -1
  87. package/dist/esm/components/empty/large/MrlEmptyLarge.js.map +1 -1
  88. package/dist/esm/components/form/date-picker/MrlDatePicker.js.map +1 -1
  89. package/dist/esm/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
  90. package/dist/esm/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
  91. package/dist/esm/components/form/select/MrlMultiSelect/MrlMultiSelect.js.map +1 -1
  92. package/dist/esm/components/form/select/MrlSelect/MrlSelect.js.map +1 -1
  93. package/dist/esm/components/form/switch/MrlSwitch/MrlSwitch.js.map +1 -1
  94. package/dist/esm/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js.map +1 -1
  95. package/dist/esm/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js.map +1 -1
  96. package/dist/esm/components/grid/MrlCol/MrlCol.js +59 -56
  97. package/dist/esm/components/grid/MrlCol/MrlCol.js.map +1 -1
  98. package/dist/esm/components/grid/MrlGrid/MrlGrid.js +3 -5
  99. package/dist/esm/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  100. package/dist/esm/components/grid/MrlRow/MrlRow.js +10 -8
  101. package/dist/esm/components/grid/MrlRow/MrlRow.js.map +1 -1
  102. package/dist/esm/components/grid/constants.js +46 -9
  103. package/dist/esm/components/grid/constants.js.map +1 -1
  104. package/dist/esm/components/layout/MrlSidebar/MrlSidebar.js.map +1 -1
  105. package/dist/esm/components/live-region/MrlLiveRegion/MrlLiveRegion.js.map +1 -1
  106. package/dist/esm/components/notification/MrlToast/MrlToast.js.map +1 -1
  107. package/dist/esm/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
  108. package/dist/esm/components/portal/MrlPortal.js.map +1 -1
  109. package/dist/esm/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.js.map +1 -1
  110. package/dist/esm/components/svg/MrlSvg/MrlSvg.js.map +1 -1
  111. package/dist/esm/components/table/MrlTableCell/MrlTableCell.js.map +1 -1
  112. package/dist/esm/components/table/MrlTableColumn/MrlTableColumn.js.map +1 -1
  113. package/dist/esm/components/tabs/MrlTab/MrlTab.js.map +1 -1
  114. package/dist/esm/components/tabs/MrlTabGroup/MrlTabGroup.js.map +1 -1
  115. package/dist/esm/components/tabs/MrlTabLink/MrlTabLink.js.map +1 -1
  116. package/dist/esm/components/tabs/MrlTabs/MrlTabs.js.map +1 -1
  117. package/dist/esm/components/text/MrlTextHeading/MrlTextHeading.js.map +1 -1
  118. package/dist/esm/components/toolbar/MrlToolbar/MrlToolbar.js.map +1 -1
  119. package/dist/esm/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
  120. package/dist/esm/version.js +1 -1
  121. package/dist/esm/version.js.map +1 -1
  122. package/dist/styles/MrlSidebar/module.scss +2 -2
  123. package/dist/styles/grid/global.scss +97 -2
  124. package/dist/styles.css +1 -7
  125. package/dist/types/components/avatar/MrlAvatar/MrlAvatar.d.ts +8 -0
  126. package/dist/types/components/badge/MrlBadge/MrlBadge.d.ts +2 -0
  127. package/dist/types/components/badge/MrlBadgeNotification/MrlBadgeNotification.d.ts +1 -0
  128. package/dist/types/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.d.ts +1 -0
  129. package/dist/types/components/callout/MrlCallout/MrlCallout.d.ts +9 -0
  130. package/dist/types/components/empty/default/MrlEmpty.d.ts +4 -0
  131. package/dist/types/components/empty/large/MrlEmptyLarge.d.ts +4 -0
  132. package/dist/types/components/form/date-picker/MrlDatePicker.d.ts +2 -0
  133. package/dist/types/components/form/select/MrlCreatableSelect/MrlCreatableSelect.d.ts +4 -0
  134. package/dist/types/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.d.ts +4 -0
  135. package/dist/types/components/form/select/MrlMultiSelect/MrlMultiSelect.d.ts +3 -0
  136. package/dist/types/components/form/select/MrlSelect/MrlSelect.d.ts +3 -0
  137. package/dist/types/components/form/switch/MrlSwitch/MrlSwitch.d.ts +3 -0
  138. package/dist/types/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.d.ts +3 -0
  139. package/dist/types/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.d.ts +3 -0
  140. package/dist/types/components/grid/MrlCol/MrlCol.d.ts +4 -6
  141. package/dist/types/components/grid/MrlCol/index.d.ts +1 -1
  142. package/dist/types/components/grid/MrlGrid/MrlGrid.d.ts +4 -4
  143. package/dist/types/components/grid/MrlGrid/index.d.ts +1 -1
  144. package/dist/types/components/grid/MrlRow/MrlRow.d.ts +7 -7
  145. package/dist/types/components/grid/MrlRow/index.d.ts +1 -1
  146. package/dist/types/components/grid/constants.d.ts +76 -12
  147. package/dist/types/components/grid/index.d.ts +1 -0
  148. package/dist/types/components/layout/MrlSidebar/MrlSidebar.d.ts +2 -0
  149. package/dist/types/components/live-region/MrlLiveRegion/MrlLiveRegion.d.ts +6 -0
  150. package/dist/types/components/notification/MrlToast/MrlToast.d.ts +8 -0
  151. package/dist/types/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +1 -0
  152. package/dist/types/components/portal/MrlPortal.d.ts +1 -0
  153. package/dist/types/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.d.ts +10 -0
  154. package/dist/types/components/svg/MrlSvg/MrlSvg.d.ts +1 -0
  155. package/dist/types/components/table/MrlTableCell/MrlTableCell.d.ts +3 -0
  156. package/dist/types/components/table/MrlTableColumn/MrlTableColumn.d.ts +3 -0
  157. package/dist/types/components/tabs/MrlTab/MrlTab.d.ts +2 -0
  158. package/dist/types/components/tabs/MrlTabGroup/MrlTabGroup.d.ts +1 -0
  159. package/dist/types/components/tabs/MrlTabLink/MrlTabLink.d.ts +1 -0
  160. package/dist/types/components/tabs/MrlTabs/MrlTabs.d.ts +2 -0
  161. package/dist/types/components/text/MrlTextHeading/MrlTextHeading.d.ts +1 -0
  162. package/dist/types/components/toolbar/MrlToolbar/MrlToolbar.d.ts +12 -0
  163. package/dist/types/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +2 -0
  164. package/package.json +1 -1
  165. package/dist/styles/grid/variables.scss +0 -26
@@ -1,9 +1,9 @@
1
- import { LayoutComponent } from '../../layout/constants';
2
- import '../grid.variables.scss';
1
+ import { GridBaseProps } from '../constants';
3
2
  import '../grid.global.scss';
3
+ export type MrlGridProps = GridBaseProps;
4
4
  /**
5
- * MrlGrid React component.
5
+ * MrlGrid React component. Primary container of a grid.
6
6
  * @param props - component props
7
7
  * @returns a MrlGrid React component.
8
8
  */
9
- export declare function MrlGrid({ children, className, ...rest }: LayoutComponent): JSX.Element;
9
+ export declare function MrlGrid({ children, className, ...rest }: MrlGridProps): JSX.Element;
@@ -1 +1 @@
1
- export { MrlGrid } from './MrlGrid';
1
+ export * from './MrlGrid';
@@ -1,12 +1,13 @@
1
- import { LayoutComponent } from '../../layout/constants';
2
- import { AlignOptions, GutterSizes, JustifyOptions } from '../constants';
3
- interface MrlRow extends LayoutComponent {
1
+ import { AlignOptions, GridBaseProps, GutterSizes, JustifyOptions } from '../constants';
2
+ export interface MrlRowProps extends GridBaseProps {
4
3
  /**
5
4
  * Flex alignment of the children within the component.
6
5
  */
7
6
  align?: AlignOptions;
8
7
  /**
9
- * Gutter size for columns within the row
8
+ * Gutter size for columns within the row.
9
+ *
10
+ * @default 1
10
11
  */
11
12
  gutter?: GutterSizes;
12
13
  /**
@@ -15,9 +16,8 @@ interface MrlRow extends LayoutComponent {
15
16
  justify?: JustifyOptions;
16
17
  }
17
18
  /**
18
- * MrlRow React component.
19
+ * MrlRow React component. Creates a grid row.
19
20
  * @param props - component props
20
21
  * @returns a MrlRow React component.
21
22
  */
22
- export declare function MrlRow({ align, children, className, justify, ...rest }: MrlRow): JSX.Element;
23
- export {};
23
+ export declare function MrlRow({ align, children, className, gutter, justify, ...rest }: MrlRowProps): JSX.Element;
@@ -1 +1 @@
1
- export { MrlRow } from './MrlRow';
1
+ export * from './MrlRow';
@@ -1,25 +1,26 @@
1
+ import { DataQa } from '../../utils/dataQa';
1
2
  /**
2
3
  * Alignment & justification options for grid containers
3
4
  */
4
5
  export type AlignOptions = 'start' | 'center' | 'end';
5
6
  export type JustifyOptions = 'start' | 'center' | 'end' | 'between' | 'around';
6
7
  /**
7
- * Available grid sizes
8
+ * Number of columns a `col` can span. There is no `col-0` class — a column
9
+ * always occupies at least one of the twelve tracks.
8
10
  */
9
- export declare const GridSizes: string[];
11
+ export type ColSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
12
  /**
11
- * Number of columns that will be span on the grid.
13
+ * Number of columns an `offset` can skip. `0` is meaningful here: it is how a
14
+ * larger breakpoint cancels an offset inherited from a smaller one.
12
15
  */
13
- export type NumCols = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
16
+ export type OffsetSpan = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
14
17
  /**
15
- * The type of classes that can be configured based on the bootstrap API.
16
- * Current supported:
17
- * - columns "col-<size>-<number>"
18
- * - offsets "offset-<size>-<number>""
18
+ * @deprecated Use `ColSpan` for spans or `OffsetSpan` for offsets. This union
19
+ * allowed `col={0}`, which never produced a class.
19
20
  */
20
- type GridClass = 'col' | 'offset';
21
+ export type NumCols = 0 | ColSpan;
21
22
  /**
22
- * Interface of available class selectors based on GridClass
23
+ * Interface of available class selectors per breakpoint.
23
24
  *
24
25
  * Example interface:
25
26
  * {
@@ -28,23 +29,86 @@ type GridClass = 'col' | 'offset';
28
29
  * }
29
30
  */
30
31
  type GridClassConfig = {
31
- [key in GridClass]?: NumCols;
32
+ col?: ColSpan;
33
+ offset?: OffsetSpan;
32
34
  };
33
35
  /**
34
36
  * Options to configure the number of columns to span on different screen sizes.
35
37
  */
36
- type ColumnConfig = NumCols | 'auto' | GridClassConfig | undefined;
38
+ type ColumnConfig = ColSpan | 'auto' | GridClassConfig | undefined;
37
39
  export interface GridColumns {
40
+ /**
41
+ * Columns that are the same from the smallest of devices to the largest.
42
+ */
38
43
  col?: ColumnConfig;
44
+ /**
45
+ * @deprecated Alias of `col`, kept for backwards compatibility. It resolves
46
+ * to the same un-prefixed tier, so passing both `col` and `xs` emits two
47
+ * competing classes and the larger span wins on CSS source order rather
48
+ * than the one you wrote last. Pass only one.
49
+ */
39
50
  xs?: ColumnConfig;
51
+ /**
52
+ * The number of columns to span on small devices.
53
+ */
40
54
  sm?: ColumnConfig;
55
+ /**
56
+ * The number of columns to span on medium devices.
57
+ */
41
58
  md?: ColumnConfig;
59
+ /**
60
+ * The number of columns to span on large devices.
61
+ */
42
62
  lg?: ColumnConfig;
63
+ /**
64
+ * The number of columns to span on extra large devices.
65
+ */
43
66
  xl?: ColumnConfig;
67
+ /**
68
+ * The number of columns to span on extra extra large devices.
69
+ */
44
70
  xxl?: ColumnConfig;
45
71
  }
72
+ /**
73
+ * Breakpoint keys in ascending order. Drives both class generation and the
74
+ * filtering that keeps grid props from reaching the DOM.
75
+ */
76
+ export declare const GRID_SIZE_KEYS: readonly ["col", "xs", "sm", "md", "lg", "xl", "xxl"];
46
77
  /**
47
78
  * Available gutter sizes for customizing the grid
48
79
  */
49
80
  export type GutterSizes = 0 | 1 | 2;
81
+ /**
82
+ * Gutter size to modifier class. `1` is the default declared on `.row`, so it
83
+ * needs no class.
84
+ */
85
+ export declare const GUTTER_CLASS: Record<GutterSizes, string | undefined>;
86
+ /**
87
+ * Roles a generic layout wrapper may safely carry.
88
+ *
89
+ * Composite widget roles (`grid`, `row`, `gridcell`, `listbox`, `tablist`, …)
90
+ * are deliberately excluded: they promise an APG keyboard contract — roving
91
+ * tabindex or `aria-activedescendant`, arrow-key navigation, selection state —
92
+ * that these divs do not implement. The roles below are structural only and
93
+ * carry no interaction contract, so they are safe to forward.
94
+ *
95
+ * `list`/`listitem` in particular is how a row of columns is announced as
96
+ * "list, N items", and is the standard workaround for Safari/VoiceOver
97
+ * dropping implicit list semantics. `region` needs an accessible name to be
98
+ * exposed as a landmark; the type cannot enforce that.
99
+ *
100
+ * Page landmarks belong to the layout components (MrlMain, MrlPage).
101
+ */
102
+ export type SafeLayoutRole = 'group' | 'list' | 'listitem' | 'none' | 'presentation' | 'region';
103
+ /**
104
+ * Shared props for the grid components: every `div` attribute, with `role`
105
+ * narrowed to {@link SafeLayoutRole}.
106
+ */
107
+ export type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'> & DataQa & {
108
+ /**
109
+ * Structural role for the wrapper. Composite widget roles are not
110
+ * accepted — see {@link SafeLayoutRole}.
111
+ */
112
+ role?: SafeLayoutRole;
113
+ };
50
114
  export {};
@@ -1,3 +1,4 @@
1
1
  export * from './MrlGrid';
2
2
  export * from './MrlRow';
3
3
  export * from './MrlCol';
4
+ export type { AlignOptions, ColSpan, GridColumns, GutterSizes, JustifyOptions, NumCols, OffsetSpan, SafeLayoutRole } from './constants';
@@ -4,7 +4,9 @@ export type MrlSidebarHookInfo = {
4
4
  source: 'userInteraction' | 'imperativeHandler';
5
5
  };
6
6
  interface MrlSidebarHook {
7
+ /** Called on every close request, even if the sidebar is already closed. `info.source` tells whether a user or the imperative handle made it. */
7
8
  hookClose?: (info: MrlSidebarHookInfo) => void;
9
+ /** Called on every open request, even if the sidebar is already open. `info.source` tells whether a user or the imperative handle made it. */
8
10
  hookOpen?: (info: MrlSidebarHookInfo) => void;
9
11
  }
10
12
  interface MrlSidebarAnalytics {
@@ -1,12 +1,18 @@
1
1
  import * as React from 'react';
2
2
  type AriaRelevant = 'additions' | 'all' | 'removals' | 'text' | 'additions text' | undefined;
3
3
  export interface MrlLiveRegionProps extends React.HTMLAttributes<HTMLParagraphElement> {
4
+ /** Sets `aria-atomic`: announce the whole region on every change instead of only the changed part. */
4
5
  ariaAtomic?: boolean;
6
+ /** Sets `aria-live`: how urgently screen readers announce changes. */
5
7
  ariaLive: 'polite' | 'assertive' | 'off';
8
+ /** Sets `aria-relevant`: which kinds of change are announced. */
6
9
  ariaRelevant?: AriaRelevant;
7
10
  id?: string;
11
+ /** Empties the region one second after `srContent` changes. */
8
12
  shouldClearContent?: boolean;
13
+ /** Text announced by the live region. */
9
14
  srContent: string;
15
+ /** Shows the text on screen. By default the region is visually hidden. */
10
16
  visible?: boolean;
11
17
  }
12
18
  /**
@@ -47,15 +47,23 @@ export interface MrlToastProps {
47
47
  * The time in milliseconds after which the toast notification should automatically close.
48
48
  */
49
49
  closeAfterMs?: number;
50
+ /** Visual variant of the toast. Also picks its default icon. */
50
51
  kind?: MrlToastKind;
52
+ /** Link rendered after the messages. */
51
53
  link?: MrlToastLink;
54
+ /** Called when the toast closes, through the close button or auto-close. */
52
55
  onClose?: () => void;
56
+ /** Primary action button. */
53
57
  primaryCTA?: MrlToastCTA;
58
+ /** Main message of the toast. */
54
59
  primaryMessage: string | JSX.Element;
60
+ /** Secondary action button, rendered before the primary one. */
55
61
  secondaryCTA?: MrlToastCTA;
62
+ /** Supporting message rendered after the primary one. */
56
63
  secondaryMessage?: string | JSX.Element;
57
64
  /** Determines whether the close icon button should be shown. */
58
65
  showCloseButton?: boolean;
66
+ /** Shows the icon of the `kind` before the message. Ignored when an `avatar` is shown. */
59
67
  showIcon?: boolean;
60
68
  /**
61
69
  * Enables interaction tracking for this toast. Provide a stable, non-PII id
@@ -7,6 +7,7 @@ interface MrlPaginationButtonProps {
7
7
  buttonClass?: string;
8
8
  /** Additional class to add to the container element */
9
9
  className?: string;
10
+ /** Disables the button. */
10
11
  disabled?: boolean;
11
12
  /**
12
13
  * The type of pagination item.
@@ -6,6 +6,7 @@ export interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {
6
6
  className?: string;
7
7
  ['data-qa']?: string;
8
8
  id?: string;
9
+ /** Stacking layer from `PORTAL_LAYERS`. Its name is used as the container id (over `id`) and its z-index is applied to the container's first child. Without it, the container is `id` or the root portal, with the root z-index. */
9
10
  layer?: PortalLayer;
10
11
  }
11
12
  export declare const MRL_PORTAL_ID: "mrl-root-portal";
@@ -9,6 +9,7 @@ type RefType = HTMLElement | HTMLDivElement | null;
9
9
  export declare const getTabbableElements: (ref: RefType, selector: string) => HTMLElement[];
10
10
  export type FocusOnInitPosition = 'first' | 'last';
11
11
  export interface RovingPropTypes {
12
+ /** CSS selector of the element that starts as the tab stop, for example a checked custom radio. Falls back to `[data-roving-active]`, then to the first `[data-roving]` element. */
12
13
  activeSelector?: string;
13
14
  /**
14
15
  * If true, disabled elements (with disabled attribute or aria-disabled="true")
@@ -23,14 +24,23 @@ export interface RovingPropTypes {
23
24
  * rendered by the time the componentDidMount function is triggered
24
25
  */
25
26
  delayMount?: number;
27
+ /** Moves focus to the first or last element when the component mounts (after `delayMount`, if set). */
26
28
  focusOnInit?: FocusOnInitPosition;
29
+ /** Keeps every element out of the tab order until `isFocused` becomes true. For groups reached through a keyboard shortcut instead of Tab. */
27
30
  focusWithShortcut?: boolean;
31
+ /** Has no effect. Kept for backwards compatibility. */
28
32
  forceUpdate?: boolean;
33
+ /** Set when another roving tabindex is nested inside this one, so its elements are left to the inner instance. */
29
34
  hasChildRoving?: boolean;
35
+ /** CSS selector. Keyboard navigation is ignored while focus is inside a matching element, for example a text input. */
30
36
  ignoreElements?: string;
37
+ /** With `focusWithShortcut`, whether the group holds focus. Turning it on focuses the active element; turning it off removes the group from the tab order. */
31
38
  isFocused?: boolean;
39
+ /** Called when focus moves from the group to another element outside it. With `focusWithShortcut`, also called when `isFocused` turns off while focus is outside the group. */
32
40
  onBlur?: () => void;
41
+ /** Pass it after moving focus into the group programmatically. On the next update the focused element becomes the tab stop and the callback receives `false`, so the consumer can drop it. */
33
42
  onRefocus?: (shouldRefocus: boolean) => void;
43
+ /** Axis of the group, read once at mount. Every arrow key moves focus, but the keys across the axis are left to a focused element with `aria-haspopup="true"` or role combobox, listbox or option. Defaults to horizontal. */
34
44
  orientation?: RovingOrientation;
35
45
  qa?: string;
36
46
  }
@@ -13,6 +13,7 @@ export interface SvgPropTypes extends Omit<MrlComponentProps, 'style'>, Omit<Rea
13
13
  path?: string;
14
14
  /** Enable lazy loading when a path is provided. */
15
15
  lazyLoad?: boolean;
16
+ /** Renders an empty span instead of the SVG. */
16
17
  isClone?: boolean;
17
18
  /** The size of an SVG Component */
18
19
  size?: SVGSize;
@@ -13,8 +13,11 @@ export interface MrlTableCellProps extends React.ComponentPropsWithoutRef<'td'>
13
13
  * Whether this cell is sticky 'left' or sticky 'right' or not sticky at all
14
14
  */
15
15
  sticky?: MrlTableColumnSticky;
16
+ /** Draws the scroll shadow on a cell that is sticky 'left'. Set it while the content is scrolled away from the left edge. */
16
17
  hasScrollShadowLeft?: boolean;
18
+ /** Draws the scroll shadow on a cell that is sticky 'right'. Set it while more columns remain to the right. */
17
19
  hasScrollShadowRight?: boolean;
20
+ /** Horizontal alignment of the cell content. */
18
21
  horizontalAlign?: MrlTableCellHorizontalAlign;
19
22
  }
20
23
  /**
@@ -13,8 +13,11 @@ export interface MrlTableColumnProps extends React.ComponentPropsWithoutRef<'th'
13
13
  * Whether this column is sticky 'left' or sticky 'right' or not sticky at all
14
14
  */
15
15
  sticky?: MrlTableColumnSticky;
16
+ /** Draws the scroll shadow on a header cell that is sticky 'left'. Set it while the content is scrolled away from the left edge. */
16
17
  hasScrollShadowLeft?: boolean;
18
+ /** Draws the scroll shadow on a header cell that is sticky 'right'. Set it while more columns remain to the right. */
17
19
  hasScrollShadowRight?: boolean;
20
+ /** Horizontal alignment of the header cell content. */
18
21
  horizontalAlign?: MrlTableCellHorizontalAlign;
19
22
  }
20
23
  /**
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  export interface MrlTabProps extends React.ComponentProps<'button'> {
3
3
  /** Class to be applied to the button element of the MrlTab */
4
4
  className?: string;
5
+ /** Icon rendered before the tab text. */
5
6
  icon?: React.ReactElement;
6
7
  /**
7
8
  * The id that will be passed to the MrlTabContext to set the active state.
@@ -10,6 +11,7 @@ export interface MrlTabProps extends React.ComponentProps<'button'> {
10
11
  id: string;
11
12
  /** An addition function to call when clicking on a tab */
12
13
  hookClick?: () => void;
14
+ /** Label of the tab. */
13
15
  text: string;
14
16
  /**
15
17
  * Enables interaction tracking for this tab. Provide a stable, non-PII id
@@ -3,6 +3,7 @@ export interface MrlTabGroupPropTypes {
3
3
  children: React.ReactNode;
4
4
  /** Class to be applied to the container element of the MrlTabGroup */
5
5
  className?: string;
6
+ /** Hides the previous and next buttons that page through tabs overflowing the container. */
6
7
  disablePageControls?: boolean;
7
8
  /** A hidden label for the tab group for accessiblity purposes */
8
9
  label?: string;
@@ -5,6 +5,7 @@ export interface MrlTabLinkProps extends NavLinkProps {
5
5
  className?: string;
6
6
  /** Children to be rendered within the text component */
7
7
  children?: React.ReactNode;
8
+ /** Icon rendered before the tab text. */
8
9
  icon?: React.ReactElement;
9
10
  /**
10
11
  * The id that will be passed to the MrlTabContext to set the active state.
@@ -9,7 +9,9 @@ export interface MrlTabsPropTypes {
9
9
  className?: string;
10
10
  /** Sets the default active tab by id */
11
11
  selectedTab?: string;
12
+ /** Size of the tabs. */
12
13
  size?: MrlTabSize;
14
+ /** Stretches the tabs so they share the row width equally. */
13
15
  spaceTabsEvenly?: boolean;
14
16
  }
15
17
  export declare const MrlTabs: React.FC<MrlTabsPropTypes>;
@@ -26,6 +26,7 @@ interface MrlTextHeadingProps extends React.ComponentPropsWithRef<'h1'>, DataQa
26
26
  * Note: hierarchy only impacts MrlTextHeading components with `kind="title"`
27
27
  */
28
28
  hierarchy?: HeadingHierarchies;
29
+ /** Text of the heading. Takes precedence over `children`. */
29
30
  text?: string;
30
31
  }
31
32
  /**
@@ -6,19 +6,24 @@ import { MrlMenuProps } from '../../menu/MrlMenu/MrlMenu';
6
6
  */
7
7
  export interface MrlToolbarProps extends React.ComponentPropsWithRef<'div'> {
8
8
  children?: React.ReactNode;
9
+ /** Visual variant. 'inverse' uses the dark inverse background; 'skeleton' renders a blank placeholder whose length is estimated from the number of items. */
9
10
  kind?: 'default' | 'inverse' | 'skeleton';
10
11
  /**
11
12
  * An optional prop to apply an aria-label to the MrlToobar
12
13
  */
13
14
  label?: string;
15
+ /** Has no effect. Kept for backwards compatibility. */
14
16
  lastToolbarInRow?: boolean;
15
17
  /**
16
18
  * An optional prop to set the maximum number of visible items in a toolbar.
17
19
  * Additional items will appear in a menu.
18
20
  */
19
21
  maxVisibleItems?: number;
22
+ /** Props of the icon button that opens the overflow menu. Replaces the defaults (text "More tools", ghost, small) entirely, so include `text`. */
20
23
  menuButtonProps?: MrlIconButtonProps;
24
+ /** Props of the overflow menu that holds the items beyond `maxVisibleItems`. Replaces the default menu props entirely. */
21
25
  menuProps?: MrlMenuProps;
26
+ /** Direction in which the items are laid out. Defaults to horizontal. */
22
27
  orientation?: 'horizontal' | 'vertical';
23
28
  /**
24
29
  * A boolean prop that sets RovingTabindex in the MrlToolbar
@@ -28,6 +33,13 @@ export interface MrlToolbarProps extends React.ComponentPropsWithRef<'div'> {
28
33
  * Sets the size of the toolbar - defaults to 'small'
29
34
  */
30
35
  size?: 'xsmall' | 'small' | 'medium';
36
+ /**
37
+ * Spaced toolbars provide more space between elements. This is
38
+ * meant to be used for toolbars that have "bigger" elements inside
39
+ * (i.e. long title, ToolbarButtonAdapters, etc).
40
+ *
41
+ * Currently used for all secondary toolbars.
42
+ */
31
43
  spaced?: boolean;
32
44
  }
33
45
  /**
@@ -11,6 +11,7 @@ export interface MrlToolbarButtonProps {
11
11
  * The icon that will be rendered.
12
12
  */
13
13
  icon: React.ReactElement;
14
+ /** Adds the button to the toolbar's roving tabindex (see `shouldUseRti`). */
14
15
  includeInRoving?: boolean;
15
16
  /**
16
17
  * A prop used to set a toolbar button to never move into the menu.
@@ -29,6 +30,7 @@ export interface MrlToolbarButtonProps {
29
30
  * A prop used to render the item in the menu instead of the toolbar.
30
31
  */
31
32
  renderInMenu?: boolean;
33
+ /** Accessible label of the button. Also its tooltip and its text when it moves into the menu. */
32
34
  text: string;
33
35
  /**
34
36
  * Enables interaction tracking for this button. Provide a stable, non-PII id
@@ -1 +1 @@
1
- {"version":3,"file":"MrlAvatar.js","sources":["../../../../../src/components/avatar/MrlAvatar/MrlAvatar.tsx"],"sourcesContent":["import { lock, facilitatorBadge } from '@muraldevkit/ds-icons';\nimport {\n\thexToRgb,\n\tisValidHexColor,\n\tisValidRgbString,\n\tisValidRgbaString,\n\tstickyTextColor\n} from '@tactivos/mural-shared/lib/colors';\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { MrlSvg } from '../../svg/MrlSvg/MrlSvg';\n\nimport styles from './MrlAvatar.module.scss';\n\ntype AvatarKind = (typeof avatarValues.kind)[number];\ntype AvatarSize = (typeof avatarValues.size)[number];\n\ninterface avatarDefaults {\n\tkind: AvatarKind;\n\tsize: AvatarSize;\n\tavatarColor: string;\n}\n\nexport interface MrlAvatarPropTypes {\n\talt?: string;\n\tdataQa?: string;\n\timage?: React.ReactNode | string;\n\tkind?: AvatarKind;\n\tname?: string;\n\tonImageError?: React.ReactEventHandler<HTMLImageElement>;\n\tshowBorder?: boolean;\n\tsize?: AvatarSize;\n\tavatarColor?: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst avatarValues = {\n\tkind: ['default', 'facilitator', 'lock'] as const,\n\tsize: ['xsmall', 'small', 'medium', 'large'] as const\n};\n\nexport const defaultAvatarValues: avatarDefaults = {\n\tavatarColor: '#2f2f2f',\n\tkind: 'default',\n\tsize: 'medium'\n};\n\n/**\n * Renders an avatar component\n * @param {MrlAvatarPropTypes} props the props for your MrlAvatar\n * @returns {React.ReactElement} an avatar containing the props you pass\n */\nexport const MrlAvatar = ({\n\talt,\n\tavatarColor = defaultAvatarValues.avatarColor,\n\tdataQa,\n\tkind = defaultAvatarValues.kind,\n\timage,\n\tname,\n\tonImageError,\n\tshowBorder = false,\n\tsize = defaultAvatarValues.size,\n\t...rest\n}: MrlAvatarPropTypes): React.ReactElement => {\n\tconst containerClasses = classNames(styles['MrlAvatar'], 'MrlAvatar', {\n\t\t[styles[`MrlAvatar--${size}`]]: size && size !== 'medium'\n\t});\n\n\tconst isFacilitatorSize = size === 'small' || size === 'xsmall';\n\tconst showIcon = kind !== 'default' && isFacilitatorSize;\n\tconst iconContainerClasses = classNames(styles['MrlAvatar-icon-container'], {\n\t\t[styles[`MrlAvatar-icon-container--${size}`]]: size && size !== 'medium'\n\t});\n\n\tconst getAvatarRgb = () => {\n\t\tif (isValidHexColor(avatarColor)) {\n\t\t\treturn hexToRgb(avatarColor).toString();\n\t\t}\n\n\t\tif (isValidRgbString(avatarColor)) {\n\t\t\treturn avatarColor.substring(4, avatarColor.length - 1);\n\t\t}\n\n\t\tif (isValidRgbaString(avatarColor)) {\n\t\t\tconst lastComma = avatarColor.lastIndexOf(',');\n\n\t\t\treturn avatarColor.substring(5, lastComma);\n\t\t}\n\t};\n\n\tconst renderImage = () => {\n\t\tif (typeof image === 'string') {\n\t\t\tconst imgAltText = alt ? alt : name ? `${name}'s avatar` : 'Participant avatar';\n\n\t\t\treturn (\n\t\t\t\t<img\n\t\t\t\t\talt={imgAltText}\n\t\t\t\t\tclassName={styles['MrlAvatar-image']}\n\t\t\t\t\tdata-qa={`${dataQa || 'avatar'}-image`}\n\t\t\t\t\tonError={onImageError}\n\t\t\t\t\tsrc={image}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn image;\n\t};\n\n\tconst getInitials = (str: string | undefined): string => {\n\t\tif (!str) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst textLength = size === 'xsmall' ? 1 : 2;\n\n\t\t// Take the name passed in.\n\t\treturn (\n\t\t\tstr\n\t\t\t\t// Split it at each space to create an array of words\n\t\t\t\t.split(' ')\n\t\t\t\t// Take the first character from each word.\n\t\t\t\t.map((item: string) => item.charAt(0).toUpperCase())\n\t\t\t\t// Bring the characters back into one word\n\t\t\t\t.join('')\n\t\t\t\t// Make sure we remove spaces\n\t\t\t\t.replace(/ /g, '')\n\t\t\t\t// Return the correct number of characters\n\t\t\t\t.substring(0, textLength)\n\t\t);\n\t};\n\n\tconst isDarkText = stickyTextColor(avatarColor, '#000000', '#ffffff') === '#ffffff';\n\tconst safeColor = getAvatarRgb();\n\n\tconst backgroundColor =\n\t\timage && typeof image === 'string'\n\t\t\t? 'rgba(var(--mrl-color-white), 1)'\n\t\t\t: `rgba(${safeColor}, 0.08)`;\n\tconst borderColor = showIcon || showBorder ? `rgba(${safeColor}, 1` : 'transparent';\n\tconst textColor = isDarkText ? `rgba(${safeColor}, 1` : 'rgba(--mrl-gray-90, 1)';\n\n\treturn (\n\t\t<div className={containerClasses} data-qa={dataQa} {...rest}>\n\t\t\t<span\n\t\t\t\taria-label={name}\n\t\t\t\tclassName={`${styles['MrlAvatar-content']} MrlAvatar-content`}\n\t\t\t\tdata-qa={dataQa && `avatar-${image ? 'image-container' : 'initials'}`}\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor: backgroundColor,\n\t\t\t\t\tborderColor: borderColor,\n\t\t\t\t\tcolor: textColor\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{image ? renderImage() : <span aria-hidden=\"true\">{getInitials(name)}</span>}\n\t\t\t</span>\n\t\t\t{showIcon && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={iconContainerClasses}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: borderColor\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tclassName={styles['MrlAvatar-icon']}\n\t\t\t\t\t\tsize=\"auto\"\n\t\t\t\t\t\tsvg={kind === 'facilitator' ? facilitatorBadge : lock}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["defaultAvatarValues","avatarColor","kind","size","MrlAvatar","_ref","alt","_ref$avatarColor","dataQa","_ref$kind","image","name","onImageError","_ref$showBorder","showBorder","_ref$size","rest","_objectWithoutProperties","_excluded","containerClasses","classNames","styles","concat","isFacilitatorSize","showIcon","iconContainerClasses","getAvatarRgb","isValidHexColor","hexToRgb","toString","isValidRgbString","substring","length","isValidRgbaString","lastComma","lastIndexOf","renderImage","imgAltText","React","createElement","className","onError","src","getInitials","str","textLength","split","map","item","charAt","toUpperCase","join","replace","isDarkText","stickyTextColor","safeColor","backgroundColor","borderColor","textColor","_extends","style","color","MrlSvg","svg","facilitatorBadge","lock"],"mappings":";;;;;;;;;AAyCO,IAAMA,mBAAmC,GAAG;AAClDC,EAAAA,WAAW,EAAE,SAAS;AACtBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,IAAI,EAAE;AACP;;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMC,SAAS,GAAGC,IAAA,IAWqB;AAAA,EAAA,IAV7CC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAAC,gBAAA,GAAAF,IAAA,CACHJ,WAAW;AAAXA,IAAAA,WAAW,GAAAM,gBAAA,KAAA,MAAA,GAAGP,mBAAmB,CAACC,WAAW,GAAAM,gBAAA;IAC7CC,MAAM,GAAAH,IAAA,CAANG,MAAM;IAAAC,SAAA,GAAAJ,IAAA,CACNH,IAAI;AAAJA,IAAAA,IAAI,G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KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;IAAM,aAAA,EAAY;GAAM,EAAEI,WAAW,CAAChC,IAAI,CAAQ,CACtE,CAAC,EACNa,QAAQ,iBACRc,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACCC,IAAAA,SAAS,EAAEf,oBAAqB;AAChCmC,IAAAA,KAAK,EAAE;AACNJ,MAAAA,eAAe,EAAEC;AAClB;AAAE,GAAA,eAEFnB,KAAA,CAAAC,aAAA,CAACuB,MAAM,EAAA;AACNtB,IAAAA,SAAS,EAAEnB,MAAM,CAAC,gBAAgB,CAAE;AACpClB,IAAAA,IAAI,EAAC,MAAM;AACX4D,IAAAA,GAAG,EAAE7D,IAAI,KAAK,aAAa,GAAG8D,gBAAgB,GAAGC;GACjD,CACI,CAEH,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlAvatar.js","sources":["../../../../../src/components/avatar/MrlAvatar/MrlAvatar.tsx"],"sourcesContent":["import { lock, facilitatorBadge } from '@muraldevkit/ds-icons';\nimport {\n\thexToRgb,\n\tisValidHexColor,\n\tisValidRgbString,\n\tisValidRgbaString,\n\tstickyTextColor\n} from '@tactivos/mural-shared/lib/colors';\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { MrlSvg } from '../../svg/MrlSvg/MrlSvg';\n\nimport styles from './MrlAvatar.module.scss';\n\ntype AvatarKind = (typeof avatarValues.kind)[number];\ntype AvatarSize = (typeof avatarValues.size)[number];\n\ninterface avatarDefaults {\n\tkind: AvatarKind;\n\tsize: AvatarSize;\n\tavatarColor: string;\n}\n\nexport interface MrlAvatarPropTypes {\n\t/** Alt text when `image` is a URL. Defaults to \"<name>'s avatar\", or \"Participant avatar\" without a name. */\n\talt?: string;\n\tdataQa?: string;\n\t/** Image shown instead of the initials: a URL rendered as an `img`, or a custom element. */\n\timage?: React.ReactNode | string;\n\t/** Badge shown on the corner of small and xsmall avatars: a facilitator badge or a lock icon. Also draws the border in `avatarColor`. */\n\tkind?: AvatarKind;\n\t/** Name of the person. Used for the initials when there is no image, and set as `aria-label` on the avatar content. */\n\tname?: string;\n\t/** Called when the `image` URL fails to load. */\n\tonImageError?: React.ReactEventHandler<HTMLImageElement>;\n\t/** Draws a border in `avatarColor` around the avatar. */\n\tshowBorder?: boolean;\n\t/** Size of the avatar. xsmall shows one initial, the other sizes up to two. */\n\tsize?: AvatarSize;\n\t/** Color of the person as hex, rgb or rgba, used to tint the avatar. */\n\tavatarColor?: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst avatarValues = {\n\tkind: ['default', 'facilitator', 'lock'] as const,\n\tsize: ['xsmall', 'small', 'medium', 'large'] as const\n};\n\nexport const defaultAvatarValues: avatarDefaults = {\n\tavatarColor: '#2f2f2f',\n\tkind: 'default',\n\tsize: 'medium'\n};\n\n/**\n * Renders an avatar component\n * @param {MrlAvatarPropTypes} props the props for your MrlAvatar\n * @returns {React.ReactElement} an avatar containing the props you pass\n */\nexport const MrlAvatar = ({\n\talt,\n\tavatarColor = defaultAvatarValues.avatarColor,\n\tdataQa,\n\tkind = defaultAvatarValues.kind,\n\timage,\n\tname,\n\tonImageError,\n\tshowBorder = false,\n\tsize = defaultAvatarValues.size,\n\t...rest\n}: MrlAvatarPropTypes): React.ReactElement => {\n\tconst containerClasses = classNames(styles['MrlAvatar'], 'MrlAvatar', {\n\t\t[styles[`MrlAvatar--${size}`]]: size && size !== 'medium'\n\t});\n\n\tconst isFacilitatorSize = size === 'small' || size === 'xsmall';\n\tconst showIcon = kind !== 'default' && isFacilitatorSize;\n\tconst iconContainerClasses = classNames(styles['MrlAvatar-icon-container'], {\n\t\t[styles[`MrlAvatar-icon-container--${size}`]]: size && size !== 'medium'\n\t});\n\n\tconst getAvatarRgb = () => {\n\t\tif (isValidHexColor(avatarColor)) {\n\t\t\treturn hexToRgb(avatarColor).toString();\n\t\t}\n\n\t\tif (isValidRgbString(avatarColor)) {\n\t\t\treturn avatarColor.substring(4, avatarColor.length - 1);\n\t\t}\n\n\t\tif (isValidRgbaString(avatarColor)) {\n\t\t\tconst lastComma = avatarColor.lastIndexOf(',');\n\n\t\t\treturn avatarColor.substring(5, lastComma);\n\t\t}\n\t};\n\n\tconst renderImage = () => {\n\t\tif (typeof image === 'string') {\n\t\t\tconst imgAltText = alt ? alt : name ? `${name}'s avatar` : 'Participant avatar';\n\n\t\t\treturn (\n\t\t\t\t<img\n\t\t\t\t\talt={imgAltText}\n\t\t\t\t\tclassName={styles['MrlAvatar-image']}\n\t\t\t\t\tdata-qa={`${dataQa || 'avatar'}-image`}\n\t\t\t\t\tonError={onImageError}\n\t\t\t\t\tsrc={image}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn image;\n\t};\n\n\tconst getInitials = (str: string | undefined): string => {\n\t\tif (!str) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst textLength = size === 'xsmall' ? 1 : 2;\n\n\t\t// Take the name passed in.\n\t\treturn (\n\t\t\tstr\n\t\t\t\t// Split it at each space to create an array of words\n\t\t\t\t.split(' ')\n\t\t\t\t// Take the first character from each word.\n\t\t\t\t.map((item: string) => item.charAt(0).toUpperCase())\n\t\t\t\t// Bring the characters back into one word\n\t\t\t\t.join('')\n\t\t\t\t// Make sure we remove spaces\n\t\t\t\t.replace(/ /g, '')\n\t\t\t\t// Return the correct number of characters\n\t\t\t\t.substring(0, textLength)\n\t\t);\n\t};\n\n\tconst isDarkText = stickyTextColor(avatarColor, '#000000', '#ffffff') === '#ffffff';\n\tconst safeColor = getAvatarRgb();\n\n\tconst backgroundColor =\n\t\timage && typeof image === 'string'\n\t\t\t? 'rgba(var(--mrl-color-white), 1)'\n\t\t\t: `rgba(${safeColor}, 0.08)`;\n\tconst borderColor = showIcon || showBorder ? `rgba(${safeColor}, 1` : 'transparent';\n\tconst textColor = isDarkText ? `rgba(${safeColor}, 1` : 'rgba(--mrl-gray-90, 1)';\n\n\treturn (\n\t\t<div className={containerClasses} data-qa={dataQa} {...rest}>\n\t\t\t<span\n\t\t\t\taria-label={name}\n\t\t\t\tclassName={`${styles['MrlAvatar-content']} MrlAvatar-content`}\n\t\t\t\tdata-qa={dataQa && `avatar-${image ? 'image-container' : 'initials'}`}\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor: backgroundColor,\n\t\t\t\t\tborderColor: borderColor,\n\t\t\t\t\tcolor: textColor\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{image ? renderImage() : <span aria-hidden=\"true\">{getInitials(name)}</span>}\n\t\t\t</span>\n\t\t\t{showIcon && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={iconContainerClasses}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: borderColor\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tclassName={styles['MrlAvatar-icon']}\n\t\t\t\t\t\tsize=\"auto\"\n\t\t\t\t\t\tsvg={kind === 'facilitator' ? facilitatorBadge : lock}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["defaultAvatarValues","avatarColor","kind","size","MrlAvatar","_ref","alt","_ref$avatarColor","dataQa","_ref$kind","image","name","onImageError","_ref$showBorder","showBorder","_ref$size","rest","_objectWithoutProperties","_excluded","containerClasses","classNames","styles","concat","isFacilitatorSize","showIcon","iconContainerClasses","getAvatarRgb","isValidHexColor","hexToRgb","toString","isValidRgbString","substring","length","isValidRgbaString","lastComma","lastIndexOf","renderImage","imgAltText","React","createElement","className","onError","src","getInitials","str","textLength","split","map","item","charAt","toUpperCase","join","replace","isDarkText","stickyTextColor","safeColor","backgroundColor","borderColor","textColor","_extends","style","color","MrlSvg","svg","facilitatorBadge","lock"],"mappings":";;;;;;;;;AAiDO,IAAMA,mBAAmC,GAAG;AAClDC,EAAAA,WAAW,EAAE,SAAS;AACtBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,IAAI,EAAE;AACP;;AAEA;AACA;AACA;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,KAAAlB,MAAA,CAAKD,MAAM,CAAC,mBAAmB,CAAC,EAAA,oBAAA,CAAqB;IAC9D,SAAA,EAASb,MAAM,cAAAc,MAAA,CAAcZ,KAAK,GAAG,iBAAiB,GAAG,UAAU,CAAG;AACtEkD,IAAAA,KAAK,EAAE;AACNJ,MAAAA,eAAe,EAAEA,eAAe;AAChCC,MAAAA,WAAW,EAAEA,WAAW;AACxBI,MAAAA,KAAK,EAAEH;AACR;GAAE,EAEDhD,KAAK,GAAG0B,WAAW,EAAE,gBAAGE,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;IAAM,aAAA,EAAY;GAAM,EAAEI,WAAW,CAAChC,IAAI,CAAQ,CACtE,CAAC,EACNa,QAAQ,iBACRc,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACCC,IAAAA,SAAS,EAAEf,oBAAqB;AAChCmC,IAAAA,KAAK,EAAE;AACNJ,MAAAA,eAAe,EAAEC;AAClB;AAAE,GAAA,eAEFnB,KAAA,CAAAC,aAAA,CAACuB,MAAM,EAAA;AACNtB,IAAAA,SAAS,EAAEnB,MAAM,CAAC,gBAAgB,CAAE;AACpClB,IAAAA,IAAI,EAAC,MAAM;AACX4D,IAAAA,GAAG,EAAE7D,IAAI,KAAK,aAAa,GAAG8D,gBAAgB,GAAGC;GACjD,CACI,CAEH,CAAC;AAER;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MrlBadge.js","sources":["../../../../../src/components/badge/MrlBadge/MrlBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { check, error, info, warning } from '@muraldevkit/ds-icons';\n\nimport { DSIconType, MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { MrlComponentProps } from '../../../utils';\nimport styles from './MrlBadge.module.scss';\n\nexport type MrlBadgeKinds = 'default' | 'error' | 'info' | 'success' | 'warning';\n\nexport interface MrlBadgeProps\n\textends Omit<MrlComponentProps, 'style' | 'attrs'>,\n\t\tReact.ComponentProps<'div'> {\n\tclassName?: string;\n\t/**\n\t * Pass a custom icon to any badge kind.\n\t * Should be passed as an MrlSvg JSX Element.\n\t */\n\ticon?: JSX.Element;\n\tkind?: MrlBadgeKinds;\n\t/**\n\t * Displays a default icon for non-default badge kinds.\n\t * To have an icon in `kind=\"default\"` you must use the `icon` prop.\n\t */\n\tshowIcon?: boolean;\n\ttext: string;\n}\n\n/**\n * Badges are a common user interface element that\n * can be used to draw attention to content.\n * @param props - component props\n * @returns a MrlBadge React component.\n */\nexport const MrlBadge = ({\n\tclassName = '',\n\ticon,\n\tkind = 'default',\n\tshowIcon = false,\n\ttext,\n\t...remainingProps\n}: MrlBadgeProps): JSX.Element => {\n\tconst allClasses = classnames(\n\t\t'MrlBadge',\n\t\t[styles['MrlBadge']],\n\t\t{\n\t\t\t[styles[`MrlBadge--${kind}`]]: kind !== 'default'\n\t\t},\n\t\tclassName\n\t);\n\n\tconst renderIcon = () => {\n\t\tif (icon) {\n\t\t\treturn icon;\n\t\t}\n\n\t\tif (kind === 'default') {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (showIcon) {\n\t\t\tconst defaultIcons = {\n\t\t\t\terror: error as DSIconType,\n\t\t\t\tinfo: info as DSIconType,\n\t\t\t\tsuccess: check as DSIconType,\n\t\t\t\twarning: warning as DSIconType\n\t\t\t};\n\t\t\treturn <MrlSvg svg={defaultIcons[kind]} size=\"auto\" />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn (\n\t\t<div {...remainingProps} className={allClasses}>\n\t\t\t{text}\n\t\t\t{renderIcon()}\n\t\t</div>\n\t);\n};\n"],"names":["MrlBadge","_ref","_ref$className","className","icon","_ref$kind","kind","_ref$showIcon","showIcon","text","remainingProps","_objectWithoutProperties","_excluded","allClasses","classnames","styles","concat","renderIcon","defaultIcons","error","info","success","check","warning","React","createElement","MrlSvg","svg","size","_extends"],"mappings":";;;;;;;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,QAAQ,GAAGC,IAA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;AAEA,IAAA,OAAO,IAAI;EACZ,CAAC;AAED,EAAA,oBACCJ,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAI,QAAA,KAASnB,cAAc,EAAA;AAAEP,IAAAA,SAAS,EAAEU;AAAW,GAAA,CAAA,EAC7CJ,IAAI,EACJQ,UAAU,EACP,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlBadge.js","sources":["../../../../../src/components/badge/MrlBadge/MrlBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { check, error, info, warning } from '@muraldevkit/ds-icons';\n\nimport { DSIconType, MrlSvg } from '../../svg/MrlSvg/MrlSvg';\nimport { MrlComponentProps } from '../../../utils';\nimport styles from './MrlBadge.module.scss';\n\nexport type MrlBadgeKinds = 'default' | 'error' | 'info' | 'success' | 'warning';\n\nexport interface MrlBadgeProps\n\textends Omit<MrlComponentProps, 'style' | 'attrs'>,\n\t\tReact.ComponentProps<'div'> {\n\tclassName?: string;\n\t/**\n\t * Pass a custom icon to any badge kind.\n\t * Should be passed as an MrlSvg JSX Element.\n\t */\n\ticon?: JSX.Element;\n\t/** Visual variant of the badge. Also picks the default icon shown with `showIcon`. */\n\tkind?: MrlBadgeKinds;\n\t/**\n\t * Displays a default icon for non-default badge kinds.\n\t * To have an icon in `kind=\"default\"` you must use the `icon` prop.\n\t */\n\tshowIcon?: boolean;\n\t/** Text displayed inside the badge. */\n\ttext: string;\n}\n\n/**\n * Badges are a common user interface element that\n * can be used to draw attention to content.\n * @param props - component props\n * @returns a MrlBadge React component.\n */\nexport const MrlBadge = ({\n\tclassName = '',\n\ticon,\n\tkind = 'default',\n\tshowIcon = false,\n\ttext,\n\t...remainingProps\n}: MrlBadgeProps): JSX.Element => {\n\tconst allClasses = classnames(\n\t\t'MrlBadge',\n\t\t[styles['MrlBadge']],\n\t\t{\n\t\t\t[styles[`MrlBadge--${kind}`]]: kind !== 'default'\n\t\t},\n\t\tclassName\n\t);\n\n\tconst renderIcon = () => {\n\t\tif (icon) {\n\t\t\treturn icon;\n\t\t}\n\n\t\tif (kind === 'default') {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (showIcon) {\n\t\t\tconst defaultIcons = {\n\t\t\t\terror: error as DSIconType,\n\t\t\t\tinfo: info as DSIconType,\n\t\t\t\tsuccess: check as DSIconType,\n\t\t\t\twarning: warning as DSIconType\n\t\t\t};\n\t\t\treturn <MrlSvg svg={defaultIcons[kind]} size=\"auto\" />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn (\n\t\t<div {...remainingProps} className={allClasses}>\n\t\t\t{text}\n\t\t\t{renderIcon()}\n\t\t</div>\n\t);\n};\n"],"names":["MrlBadge","_ref","_ref$className","className","icon","_ref$kind","kind","_ref$showIcon","showIcon","text","remainingProps","_objectWithoutProperties","_excluded","allClasses","classnames","styles","concat","renderIcon","defaultIcons","error","info","success","check","warning","React","createElement","MrlSvg","svg","size","_extends"],"mappings":";;;;;;;;AA8BA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,QAAQ,GAAGC,IAAA,IAOU;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CANjCE,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IACdE,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAAC,SAAA,GAAAJ,IAAA,CACJK,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,SAAS,GAAAA,SAAA;IAAAE,aAAA,GAAAN,IAAA,CAChBO,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,aAAA;IAChBE,IAAI,GAAAR,IAAA,CAAJQ,IAAI;AACDC,IAAAA,cAAc,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA,CAAA;AAEjB,EAAA,IAAMC,UAAU,GAAGC,UAAU,CAC5B,UAAU,EACV,CAACC,MAAM,CAAC,UAAU,CAAC,CAAC,EACpB;IACC,CAACA,MAAM,cAAAC,MAAA,CAAcV,IAAI,CAAA,CAAG,GAAGA,IAAI,KAAK;GACxC,EACDH,SACD,CAAC;EAED,IAAMc,UAAU,GAAGA,MAAM;AACxB,IAAA,IAAIb,IAAI,EAAE;AACT,MAAA,OAAOA,IAAI;AACZ,IAAA;IAEA,IAAIE,IAAI,KAAK,SAAS,EAAE;AACvB,MAAA,OAAO,IAAI;AACZ,IAAA;AAEA,IAAA,IAAIE,QAAQ,EAAE;AACb,MAAA,IAAMU,YAAY,GAAG;AACpBC,QAAAA,KAAK,EAAEA,KAAmB;AAC1BC,QAAAA,IAAI,EAAEA,IAAkB;AACxBC,QAAAA,OAAO,EAAEC,KAAmB;AAC5BC,QAAAA,OAAO,EAAEA;OACT;AACD,MAAA,oBAAOC,KAAA,CAAAC,aAAA,CAACC,MAAM,EAAA;AAACC,QAAAA,GAAG,EAAET,YAAY,CAACZ,IAAI,CAAE;AAACsB,QAAAA,IAAI,EAAC;AAAM,OAAE,CAAC;AACvD,IAAA;AAEA,IAAA,OAAO,IAAI;EACZ,CAAC;AAED,EAAA,oBACCJ,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAI,QAAA,KAASnB,cAAc,EAAA;AAAEP,IAAAA,SAAS,EAAEU;AAAW,GAAA,CAAA,EAC7CJ,IAAI,EACJQ,UAAU,EACP,CAAC;AAER;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MrlBadgeNotification.js","sources":["../../../../../src/components/badge/MrlBadgeNotification/MrlBadgeNotification.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\n\nimport { MrlComponentProps } from '../../../utils';\nimport styles from './MrlBadgeNotification.module.scss';\n\nexport type MrlBadgeNotificationKinds = 'general' | 'info';\n\nexport interface MrlBadgeNotificationProps\n\textends Omit<MrlComponentProps, 'style' | 'attrs'>,\n\t\tReact.ComponentProps<'div'> {\n\tclassName?: string;\n\tkind?: MrlBadgeNotificationKinds;\n\t/**\n\t * A string of text to tell screen reader users what type of notification this is.\n\t * Defaults to 'notification'.\n\t */\n\tnotificationText?: string;\n\t/**\n\t * Used to turn a notification from a hint to numeric.\n\t * NOTE: Must pass a `number`, not a `string`.\n\t */\n\tnumber?: number;\n}\n\n/**\n * Badge notifications are a common user interface element that can be used to\n * draw attention to new or unread content, alerts, or updates.\n * @param props - component props\n * @returns a MrlBadgeNotification React component.\n */\nexport const MrlBadgeNotification = ({\n\tclassName = '',\n\tkind = 'general',\n\tnotificationText = 'notification',\n\tnumber,\n\t...remainingProps\n}: MrlBadgeNotificationProps): JSX.Element => {\n\tconst allClasses = classnames(\n\t\t'MrlBadgeNotification',\n\t\t{\n\t\t\t[styles['MrlBadgeNotification']]: true,\n\t\t\t[styles[`MrlBadgeNotification--${kind}`]]: kind !== 'general',\n\t\t\t[styles['MrlBadgeNotification--numeric']]: Boolean(number)\n\t\t},\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<div {...remainingProps} className={allClasses} aria-label={`New ${notificationText}`}>\n\t\t\t{number ? number : ''}\n\t\t</div>\n\t);\n};\n"],"names":["MrlBadgeNotification","_ref","_ref$className","className","_ref$kind","kind","_ref$notificationText","notificationText","number","remainingProps","_objectWithoutProperties","_excluded","allClasses","classnames","styles","concat","Boolean","React","createElement","_extends"],"mappings":";;;;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,oBAAoB,GAAGC,IAAA,IAMU;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CAL7CE,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IAAAE,SAAA,GAAAH,IAAA,CACdI,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,SAAS,GAAAA,SAAA;IAAAE,qBAAA,GAAAL,IAAA,CAChBM,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAA,MAAA,GAAG,cAAc,GAAAA,qBAAA;IACjCE,MAAM,GAAAP,IAAA,CAANO,MAAM;AACHC,IAAAA,cAAc,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA,CAAA;AAEjB,EAAA,IAAMC,UAAU,GAAGC,UAAU,CAC5B,sBAAsB,EACtB;AACC,IAAA,CAACC,MAAM,CAAC,sBAAsB,CAAC,GAAG,IAAI;IACtC,CAACA,MAAM,0BAAAC,MAAA,CAA0BV,IAAI,CAAA,CAAG,GAAGA,IAAI,KAAK,SAAS;AAC7D,IAAA,CAACS,MAAM,CAAC,+BAA+B,CAAC,GAAGE,OAAO,CAACR,MAAM;GACzD,EACDL,SACD,CAAC;AAED,EAAA,oBACCc,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASV,cAAc,EAAA;AAAEN,IAAAA,SAAS,EAAES,UAAW;IAAC,YAAA,EAAA,MAAA,CAAAG,MAAA,CAAmBR,gBAAgB;AAAG,GAAA,CAAA,EACpFC,MAAM,GAAGA,MAAM,GAAG,EACf,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlBadgeNotification.js","sources":["../../../../../src/components/badge/MrlBadgeNotification/MrlBadgeNotification.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\n\nimport { MrlComponentProps } from '../../../utils';\nimport styles from './MrlBadgeNotification.module.scss';\n\nexport type MrlBadgeNotificationKinds = 'general' | 'info';\n\nexport interface MrlBadgeNotificationProps\n\textends Omit<MrlComponentProps, 'style' | 'attrs'>,\n\t\tReact.ComponentProps<'div'> {\n\tclassName?: string;\n\t/** Visual variant of the notification badge. */\n\tkind?: MrlBadgeNotificationKinds;\n\t/**\n\t * A string of text to tell screen reader users what type of notification this is.\n\t * Defaults to 'notification'.\n\t */\n\tnotificationText?: string;\n\t/**\n\t * Used to turn a notification from a hint to numeric.\n\t * NOTE: Must pass a `number`, not a `string`.\n\t */\n\tnumber?: number;\n}\n\n/**\n * Badge notifications are a common user interface element that can be used to\n * draw attention to new or unread content, alerts, or updates.\n * @param props - component props\n * @returns a MrlBadgeNotification React component.\n */\nexport const MrlBadgeNotification = ({\n\tclassName = '',\n\tkind = 'general',\n\tnotificationText = 'notification',\n\tnumber,\n\t...remainingProps\n}: MrlBadgeNotificationProps): JSX.Element => {\n\tconst allClasses = classnames(\n\t\t'MrlBadgeNotification',\n\t\t{\n\t\t\t[styles['MrlBadgeNotification']]: true,\n\t\t\t[styles[`MrlBadgeNotification--${kind}`]]: kind !== 'general',\n\t\t\t[styles['MrlBadgeNotification--numeric']]: Boolean(number)\n\t\t},\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<div {...remainingProps} className={allClasses} aria-label={`New ${notificationText}`}>\n\t\t\t{number ? number : ''}\n\t\t</div>\n\t);\n};\n"],"names":["MrlBadgeNotification","_ref","_ref$className","className","_ref$kind","kind","_ref$notificationText","notificationText","number","remainingProps","_objectWithoutProperties","_excluded","allClasses","classnames","styles","concat","Boolean","React","createElement","_extends"],"mappings":";;;;;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,oBAAoB,GAAGC,IAAA,IAMU;AAAA,EAAA,IAAAC,cAAA,GAAAD,IAAA,CAL7CE,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IAAAE,SAAA,GAAAH,IAAA,CACdI,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,SAAS,GAAAA,SAAA;IAAAE,qBAAA,GAAAL,IAAA,CAChBM,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAA,MAAA,GAAG,cAAc,GAAAA,qBAAA;IACjCE,MAAM,GAAAP,IAAA,CAANO,MAAM;AACHC,IAAAA,cAAc,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA,CAAA;AAEjB,EAAA,IAAMC,UAAU,GAAGC,UAAU,CAC5B,sBAAsB,EACtB;AACC,IAAA,CAACC,MAAM,CAAC,sBAAsB,CAAC,GAAG,IAAI;IACtC,CAACA,MAAM,0BAAAC,MAAA,CAA0BV,IAAI,CAAA,CAAG,GAAGA,IAAI,KAAK,SAAS;AAC7D,IAAA,CAACS,MAAM,CAAC,+BAA+B,CAAC,GAAGE,OAAO,CAACR,MAAM;GACzD,EACDL,SACD,CAAC;AAED,EAAA,oBACCc,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASV,cAAc,EAAA;AAAEN,IAAAA,SAAS,EAAES,UAAW;IAAC,YAAA,EAAA,MAAA,CAAAG,MAAA,CAAmBR,gBAAgB;AAAG,GAAA,CAAA,EACpFC,MAAM,GAAGA,MAAM,GAAG,EACf,CAAC;AAER;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MrlAnimatedIconButton.js","sources":["../../../../../src/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport * as React from 'react';\nimport { setAttributes } from '../../../utils';\nimport { MrlSvgAnimate, MrlSvgAnimateProps } from '../../svg/MrlSvgAnimate/MrlSvgAnimate';\nimport { AnimatedState } from '../../svg/constants';\nimport { MrlTooltip } from '../../tooltip';\nimport { MrlTooltipDefaults } from '../../tooltip/constants';\nimport { MrlIconButtonProps } from '../MrlIconButton/MrlIconButton';\nimport { buttonDefaults } from '../constants';\nimport { _isDisabled, _isSelected, _isToggleButton } from '../helpers';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nimport './MrlAnimatedIconButton.scss';\n\ninterface MrlAnimatedIconButtonProps extends Omit<MrlIconButtonProps, 'icon'> {\n\ticon: MrlSvgAnimateProps;\n}\n\ntype animationEvent = 'hover' | 'blur' | 'focus';\n\nexport const MrlAnimatedIconButton = React.forwardRef<\n\tHTMLButtonElement,\n\tMrlAnimatedIconButtonProps\n>(function MrlAnimatedIconButton(\n\t{\n\t\tattrs = {},\n\t\tbadge,\n\t\tdisableEvents = false,\n\t\ticon,\n\t\t// We intentionally deviate from the basic button for icon-buttons since the vast\n\t\t// majority of icon buttons are ghost buttons. The proptype remains\n\t\t// consistent with the basic button however to keep our code DRY.\n\t\tkind = 'ghost-inverse',\n\t\tloading = false,\n\t\tonClick,\n\t\tposition = MrlTooltipDefaults.position,\n\t\ttoggleAria = buttonDefaults.toggleAria,\n\t\ttoggleStyle,\n\t\ttext,\n\t\ttipAnchor = MrlTooltipDefaults.anchor,\n\t\ttooltipCustomRender,\n\t\teventId,\n\t\tsize = buttonDefaults.size,\n\t\tstate = buttonDefaults.state,\n\t\t...remainingProps\n\t}: MrlAnimatedIconButtonProps,\n\tref\n) {\n\t/**\n\t * State value to determine if the icon should be animating\n\t */\n\tconst [isAnimating, setAnimation] = React.useState<AnimatedState>('stop');\n\n\tconst [isHovered, setHover] = React.useState(false);\n\n\tconst [isSelected, setIsSelected] = React.useState(() => _isSelected(state));\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlAnimatedIconButton', eventId);\n\n\tconst buttonRef = React.useRef<HTMLButtonElement>(null);\n\t/**\n\t * `useImperativeHandle` customizes the instance value\n\t * that is exposed to parent components when using ref.\n\t */\n\tReact.useImperativeHandle<HTMLButtonElement | null, HTMLButtonElement | null>(\n\t\tref,\n\t\t() => buttonRef.current\n\t);\n\n\t/**\n\t * MrlAnimatedIconButton could behave as a toggle button if toggleStyle is 'default' or 'secondary'\n\t */\n\tconst isToggleButton = toggleStyle && _isToggleButton(toggleStyle);\n\n\t/**\n\t * We need to watch the value of state to keep in sync\n\t * the value of state passed as props and the internal\n\t * isSelected piece of state.\n\t */\n\tReact.useEffect(() => {\n\t\t// allows consumers to set the 'selected' or 'selected-disabled' state from a parent component.\n\t\tsetIsSelected(_isSelected(state));\n\t}, [state]);\n\n\t/**\n\t * Handle onClick events\n\t * @param {React.MouseEvent<HTMLButtonElement>} e - mouse event\n\t */\n\tconst handleOnClick = (e: React.MouseEvent<HTMLButtonElement>): void => {\n\t\te.stopPropagation();\n\n\t\tif (_isDisabled(state, loading) || disableEvents) {\n\t\t\treturn;\n\t\t}\n\n\t\ttrackInteraction({ action: 'click', variant: kind });\n\n\t\tif (isToggleButton) {\n\t\t\tsetIsSelected((prevIsSelected) => !prevIsSelected);\n\t\t}\n\n\t\tif (onClick && typeof onClick === 'function') {\n\t\t\tonClick(e);\n\t\t}\n\t};\n\n\t/**\n\t * Handle animation status for mouse events exclusively\n\t * @param {boolean} mouseEnter - Determines if this is a mouseEnter event\n\t * @returns {void}\n\t */\n\tconst handleMouseInteraction = (mouseEnter: boolean): void => {\n\t\t/** Set hover status of button */\n\t\tsetHover(mouseEnter);\n\n\t\t/**\n\t\t * If the button is in focus and we trigger a mouse event\n\t\t * we don't need to change the animation state.\n\t\t */\n\t\tif (document.activeElement === buttonRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isAnimating === 'play') {\n\t\t\tsetAnimation('stop');\n\t\t} else {\n\t\t\tsetAnimation('play');\n\t\t}\n\t};\n\n\t/**\n\t * Handle animation status for mouse and keyboard events\n\t * @param {animationEvent} eventType - The type of interaction that is triggering the animation update.\n\t * @param {boolean} startEvent - Whether or not this event should start an animation\n\t * @returns {void}\n\t */\n\tconst handleAnimation = (eventType: animationEvent, startEvent = false): void => {\n\t\t/** If the button is diabled or selected, the animation must be stopped */\n\t\tif (isSelected || _isDisabled(state, loading)) {\n\t\t\tsetAnimation('stop');\n\t\t\t/** We still need to track the hover state */\n\t\t\tsetHover(startEvent);\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If the event is a hover interaction, handle them appropriately.\n\t\t * We do this to ensure you can hover and focus without restarting\n\t\t * or stopping the animation incorrectly.\n\t\t */\n\t\tif (eventType === 'hover') {\n\t\t\thandleMouseInteraction(startEvent);\n\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Keyboard events\n\t\t */\n\t\tif (isAnimating === 'play') {\n\t\t\t/**\n\t\t\t * If a button is hovered and focused, do not stop the\n\t\t\t * animation on blur.\n\t\t\t */\n\t\t\tif (isHovered) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetAnimation('stop');\n\t\t\treturn;\n\t\t}\n\n\t\tsetAnimation('play');\n\t};\n\n\tconst handleBlur = () => {\n\t\thandleAnimation('blur');\n\t};\n\n\tconst handleFocus = () => {\n\t\thandleAnimation('focus');\n\t};\n\n\tconst handleMouseEnter = () => {\n\t\thandleAnimation('hover', true);\n\t};\n\n\tconst handleMouseLeave = () => {\n\t\thandleAnimation('hover');\n\t};\n\n\tconst classNames = classnames(\n\t\t'mrlIconButton',\n\t\t`mrlIconButton--${size}`,\n\t\t`mrlIconButton--${kind}`,\n\t\t'mrlAnimatedIconButton',\n\t\t`toggleStyle--${toggleStyle}`\n\t);\n\n\tconst attributes = setAttributes(attrs, {\n\t\t'aria-disabled': _isDisabled(state, loading),\n\t\t'aria-label': text,\n\t\t...(isToggleButton && { [`aria-${toggleAria}`]: isSelected || false }),\n\t\ttype: 'button'\n\t});\n\n\treturn (\n\t\t<MrlTooltip\n\t\t\tanchor={tipAnchor}\n\t\t\tposition={position}\n\t\t\ttext={text}\n\t\t\tcustomRender={tooltipCustomRender}\n\t\t>\n\t\t\t<button\n\t\t\t\t{...attributes}\n\t\t\t\t{...remainingProps}\n\t\t\t\tclassName={classNames}\n\t\t\t\tref={buttonRef}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonClick={handleOnClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\tonMouseEnter={handleMouseEnter}\n\t\t\t\tonMouseLeave={handleMouseLeave}\n\t\t\t>\n\t\t\t\t<div className=\"mrlAnimatedIconButton-iconContainer\">\n\t\t\t\t\t<MrlSvgAnimate {...icon} state={isAnimating} />\n\t\t\t\t</div>\n\t\t\t\t{badge}\n\t\t\t</button>\n\t\t</MrlTooltip>\n\t);\n});\n"],"names":["MrlAnimatedIconButton","React","forwardRef","_ref","ref","_ref$attrs","attrs","badge","_ref$disableEvents","disableEvents","icon","_ref$kind","kind","_ref$loading","loading","onClick","_ref$position","position","MrlTooltipDefaults","_ref$toggleAria","toggleAria","buttonDefaults","toggleStyle","text","_ref$tipAnchor","tipAnchor","anchor","tooltipCustomRender","eventId","_ref$size","size","_ref$state","state","remainingProps","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","isAnimating","setAnimation","_React$useState3","_React$useState4","isHovered","setHover","_React$useState5","_isSelected","_React$useState6","isSelected","setIsSelected","trackInteraction","useMrlTrackInteraction","buttonRef","useRef","useImperativeHandle","current","isToggleButton","_isToggleButton","useEffect","handleOnClick","e","stopPropagation","_isDisabled","action","variant","prevIsSelected","handleMouseInteraction","mouseEnter","document","activeElement","handleAnimation","eventType","startEvent","arguments","length","undefined","handleBlur","handleFocus","handleMouseEnter","handleMouseLeave","classNames","classnames","concat","attributes","setAttributes","_objectSpread","type","createElement","MrlTooltip","customRender","_extends","className","onBlur","onFocus","onMouseEnter","onMouseLeave","MrlSvgAnimate"],"mappings":";;;;;;;;;;;;AAoBO,IAAMA,qBAAqB,gBAAGC,KAAK,CAACC,UAAU,CAGnD,SAASF,qBAAqBA,CAAAG,IAAA,EAuB/BC,GAAG,EACF;AAAA,EAAA,IAAAC,UAAA,GAAAF,IAAA,CAtBAG,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IACVE,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAAC,kBAAA,GAAAL,IAAA,CACLM,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,kBAAA;IACrBE,IAAI,GAAAP,IAAA,CAAJO,IAAI;IAAAC,SAAA,GAAAR,IAAA,CAIJS,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,eAAe,GAAAA,SAAA;IAAAE,YAAA,GAAAV,IAAA,CACtBW,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAA,MAAA,GAAG,KAAK,GAAAA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YAAY,EAAE/D;GAAoB,eAElC1B,KAAA,CAAAuF,aAAA,CAAA,QAAA,EAAAG,QAAA,CAAA,EAAA,EACKP,UAAU,EACVnD,cAAc,EAAA;AAClB2D,IAAAA,SAAS,EAAEX,UAAW;AACtB7E,IAAAA,GAAG,EAAEiD,SAAU;AACfwC,IAAAA,MAAM,EAAEhB,UAAW;AACnB9D,IAAAA,OAAO,EAAE6C,aAAc;AACvBkC,IAAAA,OAAO,EAAEhB,WAAY;AACrBiB,IAAAA,YAAY,EAAEhB,gBAAiB;AAC/BiB,IAAAA,YAAY,EAAEhB;GAAiB,CAAA,eAE/B/E,KAAA,CAAAuF,aAAA,CAAA,KAAA,EAAA;AAAKI,IAAAA,SAAS,EAAC;GAAqC,eACnD3F,KAAA,CAAAuF,aAAA,CAACS,aAAa,EAAAN,QAAA,KAAKjF,IAAI,EAAA;AAAEsB,IAAAA,KAAK,EAAEQ;AAAY,GAAA,CAAE,CAC1C,CAAC,EACLjC,KACM,CACG,CAAC;AAEf,CAAC;;;;"}
1
+ {"version":3,"file":"MrlAnimatedIconButton.js","sources":["../../../../../src/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport * as React from 'react';\nimport { setAttributes } from '../../../utils';\nimport { MrlSvgAnimate, MrlSvgAnimateProps } from '../../svg/MrlSvgAnimate/MrlSvgAnimate';\nimport { AnimatedState } from '../../svg/constants';\nimport { MrlTooltip } from '../../tooltip';\nimport { MrlTooltipDefaults } from '../../tooltip/constants';\nimport { MrlIconButtonProps } from '../MrlIconButton/MrlIconButton';\nimport { buttonDefaults } from '../constants';\nimport { _isDisabled, _isSelected, _isToggleButton } from '../helpers';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nimport './MrlAnimatedIconButton.scss';\n\ninterface MrlAnimatedIconButtonProps extends Omit<MrlIconButtonProps, 'icon'> {\n\t/** Props of the animated icon to render. */\n\ticon: MrlSvgAnimateProps;\n}\n\ntype animationEvent = 'hover' | 'blur' | 'focus';\n\nexport const MrlAnimatedIconButton = React.forwardRef<\n\tHTMLButtonElement,\n\tMrlAnimatedIconButtonProps\n>(function MrlAnimatedIconButton(\n\t{\n\t\tattrs = {},\n\t\tbadge,\n\t\tdisableEvents = false,\n\t\ticon,\n\t\t// We intentionally deviate from the basic button for icon-buttons since the vast\n\t\t// majority of icon buttons are ghost buttons. The proptype remains\n\t\t// consistent with the basic button however to keep our code DRY.\n\t\tkind = 'ghost-inverse',\n\t\tloading = false,\n\t\tonClick,\n\t\tposition = MrlTooltipDefaults.position,\n\t\ttoggleAria = buttonDefaults.toggleAria,\n\t\ttoggleStyle,\n\t\ttext,\n\t\ttipAnchor = MrlTooltipDefaults.anchor,\n\t\ttooltipCustomRender,\n\t\teventId,\n\t\tsize = buttonDefaults.size,\n\t\tstate = buttonDefaults.state,\n\t\t...remainingProps\n\t}: MrlAnimatedIconButtonProps,\n\tref\n) {\n\t/**\n\t * State value to determine if the icon should be animating\n\t */\n\tconst [isAnimating, setAnimation] = React.useState<AnimatedState>('stop');\n\n\tconst [isHovered, setHover] = React.useState(false);\n\n\tconst [isSelected, setIsSelected] = React.useState(() => _isSelected(state));\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlAnimatedIconButton', eventId);\n\n\tconst buttonRef = React.useRef<HTMLButtonElement>(null);\n\t/**\n\t * `useImperativeHandle` customizes the instance value\n\t * that is exposed to parent components when using ref.\n\t */\n\tReact.useImperativeHandle<HTMLButtonElement | null, HTMLButtonElement | null>(\n\t\tref,\n\t\t() => buttonRef.current\n\t);\n\n\t/**\n\t * MrlAnimatedIconButton could behave as a toggle button if toggleStyle is 'default' or 'secondary'\n\t */\n\tconst isToggleButton = toggleStyle && _isToggleButton(toggleStyle);\n\n\t/**\n\t * We need to watch the value of state to keep in sync\n\t * the value of state passed as props and the internal\n\t * isSelected piece of state.\n\t */\n\tReact.useEffect(() => {\n\t\t// allows consumers to set the 'selected' or 'selected-disabled' state from a parent component.\n\t\tsetIsSelected(_isSelected(state));\n\t}, [state]);\n\n\t/**\n\t * Handle onClick events\n\t * @param {React.MouseEvent<HTMLButtonElement>} e - mouse event\n\t */\n\tconst handleOnClick = (e: React.MouseEvent<HTMLButtonElement>): void => {\n\t\te.stopPropagation();\n\n\t\tif (_isDisabled(state, loading) || disableEvents) {\n\t\t\treturn;\n\t\t}\n\n\t\ttrackInteraction({ action: 'click', variant: kind });\n\n\t\tif (isToggleButton) {\n\t\t\tsetIsSelected((prevIsSelected) => !prevIsSelected);\n\t\t}\n\n\t\tif (onClick && typeof onClick === 'function') {\n\t\t\tonClick(e);\n\t\t}\n\t};\n\n\t/**\n\t * Handle animation status for mouse events exclusively\n\t * @param {boolean} mouseEnter - Determines if this is a mouseEnter event\n\t * @returns {void}\n\t */\n\tconst handleMouseInteraction = (mouseEnter: boolean): void => {\n\t\t/** Set hover status of button */\n\t\tsetHover(mouseEnter);\n\n\t\t/**\n\t\t * If the button is in focus and we trigger a mouse event\n\t\t * we don't need to change the animation state.\n\t\t */\n\t\tif (document.activeElement === buttonRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isAnimating === 'play') {\n\t\t\tsetAnimation('stop');\n\t\t} else {\n\t\t\tsetAnimation('play');\n\t\t}\n\t};\n\n\t/**\n\t * Handle animation status for mouse and keyboard events\n\t * @param {animationEvent} eventType - The type of interaction that is triggering the animation update.\n\t * @param {boolean} startEvent - Whether or not this event should start an animation\n\t * @returns {void}\n\t */\n\tconst handleAnimation = (eventType: animationEvent, startEvent = false): void => {\n\t\t/** If the button is diabled or selected, the animation must be stopped */\n\t\tif (isSelected || _isDisabled(state, loading)) {\n\t\t\tsetAnimation('stop');\n\t\t\t/** We still need to track the hover state */\n\t\t\tsetHover(startEvent);\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If the event is a hover interaction, handle them appropriately.\n\t\t * We do this to ensure you can hover and focus without restarting\n\t\t * or stopping the animation incorrectly.\n\t\t */\n\t\tif (eventType === 'hover') {\n\t\t\thandleMouseInteraction(startEvent);\n\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Keyboard events\n\t\t */\n\t\tif (isAnimating === 'play') {\n\t\t\t/**\n\t\t\t * If a button is hovered and focused, do not stop the\n\t\t\t * animation on blur.\n\t\t\t */\n\t\t\tif (isHovered) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetAnimation('stop');\n\t\t\treturn;\n\t\t}\n\n\t\tsetAnimation('play');\n\t};\n\n\tconst handleBlur = () => {\n\t\thandleAnimation('blur');\n\t};\n\n\tconst handleFocus = () => {\n\t\thandleAnimation('focus');\n\t};\n\n\tconst handleMouseEnter = () => {\n\t\thandleAnimation('hover', true);\n\t};\n\n\tconst handleMouseLeave = () => {\n\t\thandleAnimation('hover');\n\t};\n\n\tconst classNames = classnames(\n\t\t'mrlIconButton',\n\t\t`mrlIconButton--${size}`,\n\t\t`mrlIconButton--${kind}`,\n\t\t'mrlAnimatedIconButton',\n\t\t`toggleStyle--${toggleStyle}`\n\t);\n\n\tconst attributes = setAttributes(attrs, {\n\t\t'aria-disabled': _isDisabled(state, loading),\n\t\t'aria-label': text,\n\t\t...(isToggleButton && { [`aria-${toggleAria}`]: isSelected || false }),\n\t\ttype: 'button'\n\t});\n\n\treturn (\n\t\t<MrlTooltip\n\t\t\tanchor={tipAnchor}\n\t\t\tposition={position}\n\t\t\ttext={text}\n\t\t\tcustomRender={tooltipCustomRender}\n\t\t>\n\t\t\t<button\n\t\t\t\t{...attributes}\n\t\t\t\t{...remainingProps}\n\t\t\t\tclassName={classNames}\n\t\t\t\tref={buttonRef}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonClick={handleOnClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\tonMouseEnter={handleMouseEnter}\n\t\t\t\tonMouseLeave={handleMouseLeave}\n\t\t\t>\n\t\t\t\t<div className=\"mrlAnimatedIconButton-iconContainer\">\n\t\t\t\t\t<MrlSvgAnimate {...icon} state={isAnimating} />\n\t\t\t\t</div>\n\t\t\t\t{badge}\n\t\t\t</button>\n\t\t</MrlTooltip>\n\t);\n});\n"],"names":["MrlAnimatedIconButton","React","forwardRef","_ref","ref","_ref$attrs","attrs","badge","_ref$disableEvents","disableEvents","icon","_ref$kind","kind","_ref$loading","loading","onClick","_ref$position","position","MrlTooltipDefaults","_ref$toggleAria","toggleAria","buttonDefaults","toggleStyle","text","_ref$tipAnchor","tipAnchor","anchor","tooltipCustomRender","eventId","_ref$size","size","_ref$state","state","remainingProps","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","isAnimating","setAnimation","_React$useState3","_React$useState4","isHovered","setHover","_React$useState5","_isSelected","_React$useState6","isSelected","setIsSelected","trackInteraction","useMrlTrackInteraction","buttonRef","useRef","useImperativeHandle","current","isToggleButton","_isToggleButton","useEffect","handleOnClick","e","stopPropagation","_isDisabled","action","variant","prevIsSelected","handleMouseInteraction","mouseEnter","document","activeElement","handleAnimation","eventType","startEvent","arguments","length","undefined","handleBlur","handleFocus","handleMouseEnter","handleMouseLeave","classNames","classnames","concat","attributes","setAttributes","_objectSpread","type","createElement","MrlTooltip","customRender","_extends","className","onBlur","onFocus","onMouseEnter","onMouseLeave","MrlSvgAnimate"],"mappings":";;;;;;;;;;;;AAqBO,IAAMA,qBAAqB,gBAAGC,KAAK,CAACC,UAAU,CAGnD,SAASF,qBAAqBA,CAAAG,IAAA,EAuB/BC,GAAG,EACF;AAAA,EAAA,IAAAC,UAAA,GAAAF,IAAA,CAtBAG,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IACVE,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAAC,kBAAA,GAAAL,IAAA,CACLM,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,kBAAA;IACrBE,IAAI,GAAAP,IAAA,CAAJO,IAAI;IAAAC,SAAA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