no-frills-ui 0.0.14-alpha.8 → 0.0.14-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +2 -3
  2. package/dist/index.js +841 -710
  3. package/dist/index.js.map +1 -1
  4. package/lib-esm/components/Accordion/Accordion.d.ts +9 -13
  5. package/lib-esm/components/Accordion/Accordion.js +3 -10
  6. package/lib-esm/components/Accordion/Accordion.js.map +1 -1
  7. package/lib-esm/components/Accordion/AccordionStep.d.ts +22 -22
  8. package/lib-esm/components/Accordion/AccordionStep.js +33 -28
  9. package/lib-esm/components/Accordion/AccordionStep.js.map +1 -1
  10. package/lib-esm/components/Badge/Badge.d.ts +13 -16
  11. package/lib-esm/components/Badge/Badge.js +10 -20
  12. package/lib-esm/components/Badge/Badge.js.map +1 -1
  13. package/lib-esm/components/Button/ActionButton.d.ts +9 -5
  14. package/lib-esm/components/Button/ActionButton.js +18 -3
  15. package/lib-esm/components/Button/ActionButton.js.map +1 -1
  16. package/lib-esm/components/Button/Button.d.ts +9 -5
  17. package/lib-esm/components/Button/Button.js +17 -5
  18. package/lib-esm/components/Button/Button.js.map +1 -1
  19. package/lib-esm/components/Button/IconButton.d.ts +9 -5
  20. package/lib-esm/components/Button/IconButton.js +18 -3
  21. package/lib-esm/components/Button/IconButton.js.map +1 -1
  22. package/lib-esm/components/Button/LinkButton.d.ts +9 -5
  23. package/lib-esm/components/Button/LinkButton.js +18 -3
  24. package/lib-esm/components/Button/LinkButton.js.map +1 -1
  25. package/lib-esm/components/Button/RaisedButton.d.ts +9 -5
  26. package/lib-esm/components/Button/RaisedButton.js +18 -3
  27. package/lib-esm/components/Button/RaisedButton.js.map +1 -1
  28. package/lib-esm/components/Card/Card.d.ts +4 -6
  29. package/lib-esm/components/Card/Card.js +16 -3
  30. package/lib-esm/components/Card/Card.js.map +1 -1
  31. package/lib-esm/components/Chip/Chip.d.ts +2 -2
  32. package/lib-esm/components/Chip/Chip.js +14 -8
  33. package/lib-esm/components/Chip/Chip.js.map +1 -1
  34. package/lib-esm/components/ChipInput/ChipInput.d.ts +28 -39
  35. package/lib-esm/components/ChipInput/ChipInput.js +35 -36
  36. package/lib-esm/components/ChipInput/ChipInput.js.map +1 -1
  37. package/lib-esm/components/Dialog/AlertDialog.d.ts +11 -12
  38. package/lib-esm/components/Dialog/AlertDialog.js +4 -11
  39. package/lib-esm/components/Dialog/AlertDialog.js.map +1 -1
  40. package/lib-esm/components/Dialog/ConfirmDialog.d.ts +13 -14
  41. package/lib-esm/components/Dialog/ConfirmDialog.js +4 -12
  42. package/lib-esm/components/Dialog/ConfirmDialog.js.map +1 -1
  43. package/lib-esm/components/Dialog/Dialog.d.ts +8 -14
  44. package/lib-esm/components/Dialog/Dialog.js +11 -9
  45. package/lib-esm/components/Dialog/Dialog.js.map +1 -1
  46. package/lib-esm/components/Dialog/PromptDialog.d.ts +18 -19
  47. package/lib-esm/components/Dialog/PromptDialog.js +10 -18
  48. package/lib-esm/components/Dialog/PromptDialog.js.map +1 -1
  49. package/lib-esm/components/DragAndDrop/DragAndDrop.d.ts +37 -59
  50. package/lib-esm/components/DragAndDrop/DragAndDrop.js +23 -26
  51. package/lib-esm/components/DragAndDrop/DragAndDrop.js.map +1 -1
  52. package/lib-esm/components/DragAndDrop/DragItem.d.ts +2 -2
  53. package/lib-esm/components/DragAndDrop/DragItem.js +40 -38
  54. package/lib-esm/components/DragAndDrop/DragItem.js.map +1 -1
  55. package/lib-esm/components/DragAndDrop/types.d.ts +3 -3
  56. package/lib-esm/components/DragAndDrop/types.js.map +1 -1
  57. package/lib-esm/components/Drawer/Drawer.d.ts +24 -31
  58. package/lib-esm/components/Drawer/Drawer.js +49 -45
  59. package/lib-esm/components/Drawer/Drawer.js.map +1 -1
  60. package/lib-esm/components/Groups/Group.d.ts +6 -8
  61. package/lib-esm/components/Groups/Group.js +12 -10
  62. package/lib-esm/components/Groups/Group.js.map +1 -1
  63. package/lib-esm/components/Input/Checkbox.d.ts +12 -15
  64. package/lib-esm/components/Input/Checkbox.js +30 -26
  65. package/lib-esm/components/Input/Checkbox.js.map +1 -1
  66. package/lib-esm/components/Input/Dropdown.d.ts +8 -18
  67. package/lib-esm/components/Input/Dropdown.js +42 -17
  68. package/lib-esm/components/Input/Dropdown.js.map +1 -1
  69. package/lib-esm/components/Input/Input.d.ts +8 -3
  70. package/lib-esm/components/Input/Input.js +20 -19
  71. package/lib-esm/components/Input/Input.js.map +1 -1
  72. package/lib-esm/components/Input/Radio.d.ts +4 -8
  73. package/lib-esm/components/Input/Radio.js +16 -13
  74. package/lib-esm/components/Input/Radio.js.map +1 -1
  75. package/lib-esm/components/Input/RadioButton.d.ts +4 -8
  76. package/lib-esm/components/Input/RadioButton.js +15 -12
  77. package/lib-esm/components/Input/RadioButton.js.map +1 -1
  78. package/lib-esm/components/Input/Select.d.ts +6 -13
  79. package/lib-esm/components/Input/Select.js +21 -18
  80. package/lib-esm/components/Input/Select.js.map +1 -1
  81. package/lib-esm/components/Input/TextArea.d.ts +6 -13
  82. package/lib-esm/components/Input/TextArea.js +29 -24
  83. package/lib-esm/components/Input/TextArea.js.map +1 -1
  84. package/lib-esm/components/Input/Toggle.d.ts +4 -9
  85. package/lib-esm/components/Input/Toggle.js +12 -10
  86. package/lib-esm/components/Input/Toggle.js.map +1 -1
  87. package/lib-esm/components/Menu/Menu.d.ts +4 -14
  88. package/lib-esm/components/Menu/Menu.js +24 -16
  89. package/lib-esm/components/Menu/Menu.js.map +1 -1
  90. package/lib-esm/components/Menu/MenuContext.d.ts +4 -4
  91. package/lib-esm/components/Menu/MenuContext.js +1 -0
  92. package/lib-esm/components/Menu/MenuContext.js.map +1 -1
  93. package/lib-esm/components/Menu/MenuItem.d.ts +10 -4
  94. package/lib-esm/components/Menu/MenuItem.js +19 -5
  95. package/lib-esm/components/Menu/MenuItem.js.map +1 -1
  96. package/lib-esm/components/Modal/Modal.d.ts +17 -23
  97. package/lib-esm/components/Modal/Modal.js +37 -34
  98. package/lib-esm/components/Modal/Modal.js.map +1 -1
  99. package/lib-esm/components/Notification/Notification.d.ts +39 -34
  100. package/lib-esm/components/Notification/Notification.js +16 -39
  101. package/lib-esm/components/Notification/Notification.js.map +1 -1
  102. package/lib-esm/components/Notification/NotificationManager.d.ts +4 -4
  103. package/lib-esm/components/Notification/NotificationManager.js +18 -14
  104. package/lib-esm/components/Notification/NotificationManager.js.map +1 -1
  105. package/lib-esm/components/Notification/index.d.ts +1 -0
  106. package/lib-esm/components/Notification/style.d.ts +2 -3
  107. package/lib-esm/components/Notification/style.js +11 -11
  108. package/lib-esm/components/Notification/style.js.map +1 -1
  109. package/lib-esm/components/Popover/Popover.d.ts +21 -20
  110. package/lib-esm/components/Popover/Popover.js +42 -44
  111. package/lib-esm/components/Popover/Popover.js.map +1 -1
  112. package/lib-esm/components/Spinner/Spinner.d.ts +14 -15
  113. package/lib-esm/components/Spinner/Spinner.js +12 -13
  114. package/lib-esm/components/Spinner/Spinner.js.map +1 -1
  115. package/lib-esm/components/Stepper/Step.d.ts +15 -12
  116. package/lib-esm/components/Stepper/Step.js +10 -8
  117. package/lib-esm/components/Stepper/Step.js.map +1 -1
  118. package/lib-esm/components/Stepper/Stepper.d.ts +11 -17
  119. package/lib-esm/components/Stepper/Stepper.js +25 -23
  120. package/lib-esm/components/Stepper/Stepper.js.map +1 -1
  121. package/lib-esm/components/Tabs/Tab.d.ts +10 -16
  122. package/lib-esm/components/Tabs/Tab.js +0 -8
  123. package/lib-esm/components/Tabs/Tab.js.map +1 -1
  124. package/lib-esm/components/Tabs/Tabs.d.ts +11 -22
  125. package/lib-esm/components/Tabs/Tabs.js +39 -31
  126. package/lib-esm/components/Tabs/Tabs.js.map +1 -1
  127. package/lib-esm/components/Toast/Toast.d.ts +7 -7
  128. package/lib-esm/components/Toast/Toast.js +13 -12
  129. package/lib-esm/components/Toast/Toast.js.map +1 -1
  130. package/lib-esm/components/Toast/ToastStory.d.ts +21 -24
  131. package/lib-esm/components/Tooltip/Tooltip.d.ts +11 -14
  132. package/lib-esm/components/Tooltip/Tooltip.js +11 -21
  133. package/lib-esm/components/Tooltip/Tooltip.js.map +1 -1
  134. package/lib-esm/icons/CheckCircle.js +2 -2
  135. package/lib-esm/icons/CheckCircle.js.map +1 -1
  136. package/lib-esm/icons/ErrorOutline.js +2 -2
  137. package/lib-esm/icons/ErrorOutline.js.map +1 -1
  138. package/lib-esm/icons/Info.js +2 -2
  139. package/lib-esm/icons/Info.js.map +1 -1
  140. package/lib-esm/icons/ReportProblem.js +2 -2
  141. package/lib-esm/icons/ReportProblem.js.map +1 -1
  142. package/lib-esm/index.js +43 -0
  143. package/lib-esm/shared/LayerManager.d.ts +5 -4
  144. package/lib-esm/shared/LayerManager.js +123 -111
  145. package/lib-esm/shared/LayerManager.js.map +1 -1
  146. package/lib-esm/shared/styles.js +4 -4
  147. package/lib-esm/shared/styles.js.map +1 -1
  148. package/package.json +66 -31
  149. package/lib-esm/components/index.js +0 -43
  150. /package/lib-esm/{components/index.js.map → index.js.map} +0 -0
@@ -3,9 +3,9 @@ export declare enum ORIENTATION {
3
3
  VERTICAL = "vertical"
4
4
  }
5
5
  export declare const DragContext: import("react").Context<{
6
- startIndex: number;
6
+ startIndex: number | null;
7
7
  setStartIndex: (value: number) => void;
8
- drop: (index: number) => void;
8
+ drop: (index: number | null) => void;
9
9
  onDrop: (start: number, end: number) => void;
10
10
  cancel: () => void;
11
11
  startGrab: (index: number) => void;
@@ -28,4 +28,4 @@ export declare const DragContext: import("react").Context<{
28
28
  moveKeys?: string;
29
29
  }) => string;
30
30
  };
31
- }>;
31
+ } | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/components/DragAndDrop/types.ts"],"sourcesContent":["import { createContext } from 'react';\n\nexport enum ORIENTATION {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport const DragContext = createContext<{\n startIndex: number;\n setStartIndex: (value: number) => void;\n drop: (index: number) => void;\n onDrop: (start: number, end: number) => void;\n cancel: () => void;\n startGrab: (index: number) => void;\n isDragging: boolean;\n setIsDragging: (value: boolean) => void;\n setDragOver: (value: number) => void;\n i18n: {\n itemAriaLabelTemplate: string;\n dragHandleAriaLabel: string;\n grabbedAnnouncementTemplate: string;\n movedAnnouncementTemplate: string;\n droppedAnnouncementTemplate: string;\n cancelledAnnouncementTemplate: string;\n replacePlaceholders: (\n template: string,\n data: {\n position?: number;\n grabKey?: string;\n dropKey?: string;\n altDropKey?: string;\n cancelKey?: string;\n moveKeys?: string;\n },\n ) => string;\n };\n}>(null);\n"],"names":["ORIENTATION","DragContext","createContext"],"mappings":";;AAEO,IAAA,WAAKA,iBAAAA,SAAAA,WAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,WAAAA;AAGX,CAAA,CAAA,EAAA;AAEM,MAAMC,WAAAA,GAAcC,aAAAA,CA6BxB,IAAA;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/DragAndDrop/types.ts"],"sourcesContent":["import { createContext } from 'react';\n\nexport enum ORIENTATION {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport const DragContext = createContext<{\n startIndex: number | null;\n setStartIndex: (value: number) => void;\n drop: (index: number | null) => void;\n onDrop: (start: number, end: number) => void;\n cancel: () => void;\n startGrab: (index: number) => void;\n isDragging: boolean;\n setIsDragging: (value: boolean) => void;\n setDragOver: (value: number) => void;\n i18n: {\n itemAriaLabelTemplate: string;\n dragHandleAriaLabel: string;\n grabbedAnnouncementTemplate: string;\n movedAnnouncementTemplate: string;\n droppedAnnouncementTemplate: string;\n cancelledAnnouncementTemplate: string;\n replacePlaceholders: (\n template: string,\n data: {\n position?: number;\n grabKey?: string;\n dropKey?: string;\n altDropKey?: string;\n cancelKey?: string;\n moveKeys?: string;\n },\n ) => string;\n };\n} | null>(null);\n"],"names":["ORIENTATION","DragContext","createContext"],"mappings":";;AAEO,IAAA,WAAKA,iBAAAA,SAAAA,WAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,WAAAA;AAGX,CAAA,CAAA,EAAA;AAEM,MAAMC,WAAAA,GAAcC,aAAAA,CA6BjB,IAAA;;;;"}
@@ -1,28 +1,28 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  export { Header as DrawerHeader, Body as DrawerBody, Footer as DrawerFooter, } from '../../shared/styles';
4
3
  export declare enum DRAWER_POSITION {
5
4
  LEFT = "LEFT",
6
5
  RIGHT = "RIGHT",
7
6
  BOTTOM = "BOTTOM"
8
7
  }
9
- declare const drawerPropTypes: {
8
+ type DrawerProps = {
10
9
  /** Opens the drawer */
11
- open: PropTypes.Validator<boolean>;
10
+ open: boolean;
12
11
  /** position of the drawer */
13
- position: PropTypes.Requireable<DRAWER_POSITION>;
12
+ position: DRAWER_POSITION;
14
13
  /** size of the drawer */
15
- size: PropTypes.Requireable<string>;
14
+ size?: string;
16
15
  /** Shows an overlay behind the drawer. */
17
- overlay: PropTypes.Requireable<boolean>;
16
+ overlay?: boolean;
18
17
  /** Closes the drawer on esc */
19
- closeOnEsc: PropTypes.Requireable<boolean>;
18
+ closeOnEsc?: boolean;
20
19
  /** Closes the drawer on overlay click */
21
- closeOnOverlayClick: PropTypes.Requireable<boolean>;
20
+ closeOnOverlayClick?: boolean;
22
21
  /** Call back function called when the drawer closes. */
23
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
22
+ onClose?: () => void;
23
+ /** Ref forwarded to the underlying HTMLDivElement of the drawer container */
24
+ forwardRef?: React.Ref<HTMLDivElement> | React.MutableRefObject<HTMLDivElement | null>;
24
25
  };
25
- type DrawerProps = PropTypes.InferProps<typeof drawerPropTypes>;
26
26
  interface DrawerState {
27
27
  open: boolean;
28
28
  }
@@ -42,22 +42,6 @@ export default class Drawer extends React.Component<React.PropsWithChildren<Draw
42
42
  state: {
43
43
  open: boolean;
44
44
  };
45
- static propTypes: {
46
- /** Opens the drawer */
47
- open: PropTypes.Validator<boolean>;
48
- /** position of the drawer */
49
- position: PropTypes.Requireable<DRAWER_POSITION>;
50
- /** size of the drawer */
51
- size: PropTypes.Requireable<string>;
52
- /** Shows an overlay behind the drawer. */
53
- overlay: PropTypes.Requireable<boolean>;
54
- /** Closes the drawer on esc */
55
- closeOnEsc: PropTypes.Requireable<boolean>;
56
- /** Closes the drawer on overlay click */
57
- closeOnOverlayClick: PropTypes.Requireable<boolean>;
58
- /** Call back function called when the drawer closes. */
59
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
60
- };
61
45
  static defaultProps: {
62
46
  overlay: boolean;
63
47
  position: DRAWER_POSITION;
@@ -69,9 +53,9 @@ export default class Drawer extends React.Component<React.PropsWithChildren<Draw
69
53
  */
70
54
  static getDerivedStateFromProps(props: DrawerProps): {
71
55
  open: boolean;
72
- };
73
- private layer;
74
- private closeCallback;
56
+ } | null;
57
+ private layer?;
58
+ private closeCallback?;
75
59
  /**
76
60
  * Internal close handler.
77
61
  * Restores focus and calls the external onClose callback.
@@ -92,6 +76,10 @@ export default class Drawer extends React.Component<React.PropsWithChildren<Draw
92
76
  * Lifecycle method to save the currently focused element when the drawer mounts while open.
93
77
  */
94
78
  componentDidMount(): void;
79
+ /**
80
+ * Handles opening the drawer by creating the layer.
81
+ */
82
+ private handleOpen;
95
83
  /**
96
84
  * Lifecycle method to restore focus when the drawer unmounts.
97
85
  */
@@ -114,9 +102,14 @@ export default class Drawer extends React.Component<React.PropsWithChildren<Draw
114
102
  * Lifecycle method to handle Drawer updates.
115
103
  * Manages opening/closing logic via LayerManager and focus preservation.
116
104
  */
117
- getSnapshotBeforeUpdate(prevProps: DrawerProps): void;
105
+ getSnapshotBeforeUpdate(prevProps: DrawerProps): null;
106
+ /**
107
+ * Sets the ref prop passed to the Drawer Container component.
108
+ * @param node
109
+ */
110
+ setRefProp: (node: HTMLDivElement | null) => void;
118
111
  /**
119
112
  * Renders the Drawer component via the LayerManager portal.
120
113
  */
121
- render(): import("@emotion/react/jsx-runtime").JSX.Element;
114
+ render(): import("@emotion/react/jsx-runtime").JSX.Element | null;
122
115
  }
@@ -1,6 +1,5 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import styled from '@emotion/styled';
5
4
  import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
6
5
  import LayerManager, { LAYER_POSITION } from '../../shared/LayerManager.js';
@@ -11,7 +10,7 @@ var DRAWER_POSITION = /*#__PURE__*/ function(DRAWER_POSITION) {
11
10
  DRAWER_POSITION["BOTTOM"] = "BOTTOM";
12
11
  return DRAWER_POSITION;
13
12
  }({});
14
- const positionStyle = (size)=>({
13
+ const positionStyle$1 = (size)=>({
15
14
  ["LEFT"]: {
16
15
  before: `height: 100vh; min-width: ${size || '300px'}; transform: translateX(-100%);`,
17
16
  after: 'transform: translateX(0%);'
@@ -33,23 +32,10 @@ const positionStyle = (size)=>({
33
32
  }
34
33
  });
35
34
  const DrawerDiv = /*#__PURE__*/ styled("div", {
36
- target: "ehe19t90",
35
+ target: "e1topccf0",
37
36
  label: "DrawerDiv"
38
- })("display:flex;flex-direction:column;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transition:transform 0.3s ease;box-shadow:", getThemeValue(THEME_NAME.MODAL_SHADOW), ";", (props)=>positionStyle(props.size)[props.position].before, " .nf-layer-enter &{transform:translateX(0%);", (props)=>positionStyle(props.size)[props.position].after, "}");
39
- const drawerPropTypes = {
40
- /** Opens the drawer */ open: PropTypes.bool.isRequired,
41
- /** position of the drawer */ position: PropTypes.oneOf([
42
- "LEFT",
43
- "RIGHT",
44
- "BOTTOM"
45
- ]),
46
- /** size of the drawer */ size: PropTypes.string,
47
- /** Shows an overlay behind the drawer. */ overlay: PropTypes.bool,
48
- /** Closes the drawer on esc */ closeOnEsc: PropTypes.bool,
49
- /** Closes the drawer on overlay click */ closeOnOverlayClick: PropTypes.bool,
50
- /** Call back function called when the drawer closes. */ onClose: PropTypes.func
51
- };
52
- const positionMap = {
37
+ })("display:flex;flex-direction:column;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transition:transform 0.3s ease;box-shadow:", getThemeValue(THEME_NAME.MODAL_SHADOW), ";", (props)=>positionStyle$1(props.size)[props.position].before, " .nf-layer-enter &{transform:translateX(0%);", (props)=>positionStyle$1(props.size)[props.position].after, "}");
38
+ const positionMap$1 = {
53
39
  ["LEFT"]: LAYER_POSITION.TOP_LEFT,
54
40
  ["RIGHT"]: LAYER_POSITION.TOP_RIGHT,
55
41
  ["BOTTOM"]: LAYER_POSITION.BOTTOM_LEFT
@@ -70,6 +56,8 @@ class Drawer extends React.Component {
70
56
  */ componentDidMount() {
71
57
  if (this.props.open) {
72
58
  this.lastFocusedElement = document.activeElement;
59
+ // Handle initial open state
60
+ this.handleOpen();
73
61
  }
74
62
  }
75
63
  /**
@@ -83,7 +71,7 @@ class Drawer extends React.Component {
83
71
  * Lifecycle method to handle Drawer updates.
84
72
  * Manages opening/closing logic via LayerManager and focus preservation.
85
73
  */ getSnapshotBeforeUpdate(prevProps) {
86
- const { open, closeOnEsc, closeOnOverlayClick, overlay, position, children, size, ...rest } = this.props;
74
+ const { open } = this.props;
87
75
  if (prevProps.open && !open) {
88
76
  this.closeCallback?.();
89
77
  this.restoreFocus();
@@ -91,36 +79,18 @@ class Drawer extends React.Component {
91
79
  if (!prevProps.open && open) {
92
80
  // Save current focus
93
81
  this.lastFocusedElement = document.activeElement;
94
- this.layer = LayerManager.renderLayer({
95
- overlay,
96
- exitDelay: 300,
97
- position: positionMap[position],
98
- closeCallback: this.onClose,
99
- closeOnEsc,
100
- closeOnOverlayClick,
101
- component: /*#__PURE__*/ jsx(DrawerDiv, {
102
- ...rest,
103
- ref: this.setDrawerRef,
104
- role: "dialog",
105
- "aria-modal": "true",
106
- tabIndex: -1,
107
- onKeyDown: this.handleKeyDown,
108
- position: position,
109
- size: size,
110
- onClick: (e)=>e.stopPropagation(),
111
- children: children
112
- })
113
- });
114
- this.closeCallback = this.layer[1];
115
- this.forceUpdate();
82
+ this.handleOpen();
116
83
  }
84
+ return null;
117
85
  }
118
86
  /**
119
87
  * Renders the Drawer component via the LayerManager portal.
120
88
  */ render() {
121
89
  if (this.state.open && this.layer) {
122
90
  const [Component] = this.layer;
123
- return /*#__PURE__*/ jsx(Component, {});
91
+ return /*#__PURE__*/ jsx(Component, {
92
+ ref: this.setRefProp
93
+ });
124
94
  }
125
95
  return null;
126
96
  }
@@ -136,8 +106,8 @@ class Drawer extends React.Component {
136
106
  open: false
137
107
  });
138
108
  this.props.onClose?.();
139
- this.closeCallback = null;
140
- this.layer = null;
109
+ this.closeCallback = undefined;
110
+ this.layer = undefined;
141
111
  }, this.lastFocusedElement = null, this.drawerRef = /*#__PURE__*/ React.createRef(), /**
142
112
  * Retrieves all focusable elements within the drawer.
143
113
  */ this.getFocusableElements = ()=>{
@@ -165,6 +135,32 @@ class Drawer extends React.Component {
165
135
  }
166
136
  }
167
137
  }, /**
138
+ * Handles opening the drawer by creating the layer.
139
+ */ this.handleOpen = ()=>{
140
+ const { closeOnEsc, closeOnOverlayClick, position, size, overlay, children, ...rest } = this.props;
141
+ this.layer = LayerManager.renderLayer({
142
+ overlay,
143
+ exitDelay: 300,
144
+ position: positionMap$1[position],
145
+ closeCallback: this.onClose,
146
+ closeOnEsc,
147
+ closeOnOverlayClick,
148
+ component: /*#__PURE__*/ jsx(DrawerDiv, {
149
+ ...rest,
150
+ ref: this.setDrawerRef,
151
+ role: "dialog",
152
+ "aria-modal": "true",
153
+ tabIndex: -1,
154
+ onKeyDown: this.handleKeyDown,
155
+ position: position,
156
+ size: size,
157
+ onClick: (e)=>e.stopPropagation(),
158
+ children: children
159
+ })
160
+ });
161
+ this.closeCallback = this.layer[1];
162
+ this.forceUpdate();
163
+ }, /**
168
164
  * Restores focus to the element that was focused before the drawer opened.
169
165
  */ this.restoreFocus = ()=>{
170
166
  if (this.lastFocusedElement) {
@@ -209,10 +205,18 @@ class Drawer extends React.Component {
209
205
  // Fallback to container
210
206
  root.focus();
211
207
  }
208
+ }, /**
209
+ * Sets the ref prop passed to the Drawer Container component.
210
+ * @param node
211
+ */ this.setRefProp = (node)=>{
212
+ if (this.props.forwardRef && typeof this.props.forwardRef === 'function') {
213
+ this.props.forwardRef(node);
214
+ } else if (this.props.forwardRef && typeof this.props.forwardRef === 'object') {
215
+ this.props.forwardRef.current = node;
216
+ }
212
217
  };
213
218
  }
214
219
  }
215
- Drawer.propTypes = drawerPropTypes;
216
220
  Drawer.defaultProps = {
217
221
  overlay: true,
218
222
  position: "LEFT",
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport styled from '@emotion/styled';\nimport { getThemeValue, THEME_NAME } from '../../shared/constants';\nimport LayerManager, { LAYER_POSITION } from '../../shared/LayerManager';\n\nexport {\n Header as DrawerHeader,\n Body as DrawerBody,\n Footer as DrawerFooter,\n} from '../../shared/styles';\n\nexport enum DRAWER_POSITION {\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n BOTTOM = 'BOTTOM',\n}\n\nconst positionStyle = (size: string) => ({\n [DRAWER_POSITION.LEFT]: {\n before: `height: 100vh; min-width: ${size || '300px'}; transform: translateX(-100%);`,\n after: 'transform: translateX(0%);',\n },\n [DRAWER_POSITION.RIGHT]: {\n before: `height: 100vh; min-width: ${size || '300px'}; transform: translateX(100%);`,\n after: 'transform: translateX(0%);',\n },\n [DRAWER_POSITION.BOTTOM]: {\n before: `\n position: absolute;\n bottom: 0;\n width: 100%;\n height: ${size || '90vh'};\n transform: translateY(100%);\n border-radius: 15px 15px 0 0; \n `,\n after: 'transform: translateX(0%);',\n },\n});\n\nconst DrawerDiv = styled.div<{ position: DRAWER_POSITION; size: string }>`\n display: flex;\n flex-direction: column;\n background-color: ${getThemeValue(THEME_NAME.BACKGROUND)};\n transition: transform 0.3s ease;\n box-shadow: ${getThemeValue(THEME_NAME.MODAL_SHADOW)};\n ${(props) => positionStyle(props.size)[props.position].before}\n\n .nf-layer-enter & {\n transform: translateX(0%);\n ${(props) => positionStyle(props.size)[props.position].after}\n }\n`;\n\nconst drawerPropTypes = {\n /** Opens the drawer */\n open: PropTypes.bool.isRequired,\n /** position of the drawer */\n position: PropTypes.oneOf([\n DRAWER_POSITION.LEFT,\n DRAWER_POSITION.RIGHT,\n DRAWER_POSITION.BOTTOM,\n ]),\n /** size of the drawer */\n size: PropTypes.string,\n /** Shows an overlay behind the drawer. */\n overlay: PropTypes.bool,\n /** Closes the drawer on esc */\n closeOnEsc: PropTypes.bool,\n /** Closes the drawer on overlay click */\n closeOnOverlayClick: PropTypes.bool,\n /** Call back function called when the drawer closes. */\n onClose: PropTypes.func,\n};\n\ntype DrawerProps = PropTypes.InferProps<typeof drawerPropTypes>;\n\ninterface DrawerState {\n open: boolean;\n}\n\nconst positionMap = {\n [DRAWER_POSITION.LEFT]: LAYER_POSITION.TOP_LEFT,\n [DRAWER_POSITION.RIGHT]: LAYER_POSITION.TOP_RIGHT,\n [DRAWER_POSITION.BOTTOM]: LAYER_POSITION.BOTTOM_LEFT,\n};\n\n/**\n * Drawer component\n *\n * A panel that slides in from the edge of the screen.\n * It sits on top of the application content and is often used for navigation or details.\n *\n * Accessibility:\n * - Implements ARIA `role=\"dialog\"` and `aria-modal=\"true\"`.\n * - Traps focus effectively within the drawer while open.\n * - Restores focus to the triggering element upon closure.\n * - Supports closing via ESC key and overlay click.\n */\nexport default class Drawer extends React.Component<\n React.PropsWithChildren<DrawerProps>,\n DrawerState\n> {\n state = {\n open: false,\n };\n\n static propTypes = drawerPropTypes;\n\n static defaultProps = {\n overlay: true,\n position: DRAWER_POSITION.LEFT,\n closeOnEsc: true,\n closeOnOverlayClick: true,\n };\n\n /**\n * Syncs state with props.\n */\n static getDerivedStateFromProps(props: DrawerProps) {\n if (props.open) {\n return {\n open: true,\n };\n }\n return null;\n }\n\n private layer: ReturnType<typeof LayerManager.renderLayer>;\n\n private closeCallback: (resp?: unknown) => void;\n\n /**\n * Internal close handler.\n * Restores focus and calls the external onClose callback.\n */\n private onClose = () => {\n this.restoreFocus();\n this.setState({\n open: false,\n });\n this.props.onClose?.();\n this.closeCallback = null;\n this.layer = null;\n };\n\n private lastFocusedElement: HTMLElement | null = null;\n private drawerRef = React.createRef<HTMLDivElement>();\n\n /**\n * Retrieves all focusable elements within the drawer.\n */\n private getFocusableElements = (): HTMLElement[] => {\n if (!this.drawerRef.current) return [];\n return Array.from(\n this.drawerRef.current.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n ),\n ) as HTMLElement[];\n };\n\n /**\n * Handles keydown events to implement the focus trap.\n * Traps Tab and Shift+Tab within the drawer.\n */\n private handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Tab') {\n const focusableElements = this.getFocusableElements();\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0];\n const lastElement = focusableElements[focusableElements.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === firstElement) {\n lastElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastElement) {\n firstElement.focus();\n e.preventDefault();\n }\n }\n }\n };\n\n /**\n * Lifecycle method to save the currently focused element when the drawer mounts while open.\n */\n componentDidMount() {\n if (this.props.open) {\n this.lastFocusedElement = document.activeElement as HTMLElement;\n }\n }\n\n /**\n * Lifecycle method to restore focus when the drawer unmounts.\n */\n componentWillUnmount() {\n if (this.props.open) {\n this.restoreFocus();\n }\n }\n\n /**\n * Restores focus to the element that was focused before the drawer opened.\n */\n private restoreFocus = () => {\n if (this.lastFocusedElement) {\n // Check if the element is still in the document\n const elementToBeFocused = this.lastFocusedElement;\n this.lastFocusedElement = null;\n setTimeout(() => {\n if (document.body.contains(elementToBeFocused)) {\n elementToBeFocused.focus();\n }\n }, 100);\n }\n };\n\n /**\n * Callback ref to capture the Drawer DOM element.\n * Triggers initial focus setting when the element mounts.\n */\n private setDrawerRef = (node: HTMLDivElement | null) => {\n // Update ref\n (this.drawerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n\n if (node) {\n // Set initial focus when the node is mounted\n this.setInitialFocus(node);\n }\n };\n\n /**\n * Sets initial focus within the drawer.\n * Tries to focus the header first, then the first interactive element, or falls back to the container.\n */\n private setInitialFocus = (root: HTMLElement) => {\n // Try to find the header (assumed to be the first child)\n const firstChild = root.firstElementChild as HTMLElement;\n if (firstChild) {\n // Ensure it's focusable\n if (firstChild.getAttribute('tabindex') === null) {\n firstChild.setAttribute('tabindex', '-1');\n }\n firstChild.focus();\n return;\n }\n\n // Fallback to focusable elements\n const focusableElements = this.getFocusableElements();\n if (focusableElements.length > 0) {\n focusableElements[0].focus();\n } else {\n // Fallback to container\n root.focus();\n }\n };\n\n /**\n * Lifecycle method to handle Drawer updates.\n * Manages opening/closing logic via LayerManager and focus preservation.\n */\n getSnapshotBeforeUpdate(prevProps: DrawerProps) {\n const {\n open,\n closeOnEsc,\n closeOnOverlayClick,\n overlay,\n position,\n children,\n size,\n ...rest\n } = this.props;\n\n if (prevProps.open && !open) {\n this.closeCallback?.();\n this.restoreFocus();\n }\n\n if (!prevProps.open && open) {\n // Save current focus\n this.lastFocusedElement = document.activeElement as HTMLElement;\n\n this.layer = LayerManager.renderLayer({\n overlay,\n exitDelay: 300,\n position: positionMap[position],\n closeCallback: this.onClose,\n closeOnEsc,\n closeOnOverlayClick,\n component: (\n <DrawerDiv\n {...rest}\n ref={this.setDrawerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n onKeyDown={this.handleKeyDown}\n position={position}\n size={size}\n onClick={(e) => e.stopPropagation()}\n >\n {children}\n </DrawerDiv>\n ),\n });\n this.closeCallback = this.layer[1];\n this.forceUpdate();\n }\n }\n\n /**\n * Renders the Drawer component via the LayerManager portal.\n */\n render() {\n if (this.state.open && this.layer) {\n const [Component] = this.layer;\n return <Component />;\n }\n\n return null;\n }\n}\n"],"names":["DRAWER_POSITION","positionStyle","size","before","after","DrawerDiv","styled","getThemeValue","THEME_NAME","BACKGROUND","MODAL_SHADOW","props","position","drawerPropTypes","open","PropTypes","bool","isRequired","oneOf","string","overlay","closeOnEsc","closeOnOverlayClick","onClose","func","positionMap","LAYER_POSITION","TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","Drawer","React","Component","getDerivedStateFromProps","componentDidMount","lastFocusedElement","document","activeElement","componentWillUnmount","restoreFocus","getSnapshotBeforeUpdate","prevProps","children","rest","closeCallback","layer","LayerManager","renderLayer","exitDelay","component","_jsx","ref","setDrawerRef","role","aria-modal","tabIndex","onKeyDown","handleKeyDown","onClick","e","stopPropagation","forceUpdate","render","state","setState","drawerRef","createRef","getFocusableElements","current","Array","from","querySelectorAll","key","focusableElements","length","firstElement","lastElement","shiftKey","focus","preventDefault","elementToBeFocused","setTimeout","body","contains","node","setInitialFocus","root","firstChild","firstElementChild","getAttribute","setAttribute","propTypes","defaultProps"],"mappings":";;;;;;;AAYO,IAAA,eAAKA,iBAAAA,SAAAA,eAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,eAAAA;AAIX,CAAA,CAAA,EAAA;AAED,MAAMC,aAAAA,GAAgB,CAACC,IAAAA,IAAkB;AACrC,QAAA,CAAA,MAAA,GAAwB;AACpBC,YAAAA,MAAAA,EAAQ,CAAC,0BAA0B,EAAED,IAAAA,IAAQ,OAAA,CAAQ,+BAA+B,CAAC;YACrFE,KAAAA,EAAO;AACX,SAAA;AACA,QAAA,CAAA,OAAA,GAAyB;AACrBD,YAAAA,MAAAA,EAAQ,CAAC,0BAA0B,EAAED,IAAAA,IAAQ,OAAA,CAAQ,8BAA8B,CAAC;YACpFE,KAAAA,EAAO;AACX,SAAA;AACA,QAAA,CAAA,QAAA,GAA0B;AACtBD,YAAAA,MAAAA,EAAQ;;;;AAII,oBAAA,EAAED,QAAQ,MAAA,CAAO;;;QAG7B,CAAC;YACDE,KAAAA,EAAO;AACX;KACJ,CAAA;AAEA,MAAMC,SAAAA,iBAAYC,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react';\nimport styled from '@emotion/styled';\nimport { getThemeValue, THEME_NAME } from '../../shared/constants';\nimport LayerManager, { LAYER_POSITION } from '../../shared/LayerManager';\n\nexport {\n Header as DrawerHeader,\n Body as DrawerBody,\n Footer as DrawerFooter,\n} from '../../shared/styles';\n\nexport enum DRAWER_POSITION {\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n BOTTOM = 'BOTTOM',\n}\n\nconst positionStyle = (size?: string) => ({\n [DRAWER_POSITION.LEFT]: {\n before: `height: 100vh; min-width: ${size || '300px'}; transform: translateX(-100%);`,\n after: 'transform: translateX(0%);',\n },\n [DRAWER_POSITION.RIGHT]: {\n before: `height: 100vh; min-width: ${size || '300px'}; transform: translateX(100%);`,\n after: 'transform: translateX(0%);',\n },\n [DRAWER_POSITION.BOTTOM]: {\n before: `\n position: absolute;\n bottom: 0;\n width: 100%;\n height: ${size || '90vh'};\n transform: translateY(100%);\n border-radius: 15px 15px 0 0; \n `,\n after: 'transform: translateX(0%);',\n },\n});\n\nconst DrawerDiv = styled.div<{ position: DRAWER_POSITION; size?: string }>`\n display: flex;\n flex-direction: column;\n background-color: ${getThemeValue(THEME_NAME.BACKGROUND)};\n transition: transform 0.3s ease;\n box-shadow: ${getThemeValue(THEME_NAME.MODAL_SHADOW)};\n ${(props) => positionStyle(props.size)[props.position].before}\n\n .nf-layer-enter & {\n transform: translateX(0%);\n ${(props) => positionStyle(props.size)[props.position].after}\n }\n`;\n\ntype DrawerProps = {\n /** Opens the drawer */\n open: boolean;\n /** position of the drawer */\n position: DRAWER_POSITION;\n /** size of the drawer */\n size?: string;\n /** Shows an overlay behind the drawer. */\n overlay?: boolean;\n /** Closes the drawer on esc */\n closeOnEsc?: boolean;\n /** Closes the drawer on overlay click */\n closeOnOverlayClick?: boolean;\n /** Call back function called when the drawer closes. */\n onClose?: () => void;\n /** Ref forwarded to the underlying HTMLDivElement of the drawer container */\n forwardRef?: React.Ref<HTMLDivElement> | React.MutableRefObject<HTMLDivElement | null>;\n};\n\ninterface DrawerState {\n open: boolean;\n}\n\nconst positionMap = {\n [DRAWER_POSITION.LEFT]: LAYER_POSITION.TOP_LEFT,\n [DRAWER_POSITION.RIGHT]: LAYER_POSITION.TOP_RIGHT,\n [DRAWER_POSITION.BOTTOM]: LAYER_POSITION.BOTTOM_LEFT,\n};\n\n/**\n * Drawer component\n *\n * A panel that slides in from the edge of the screen.\n * It sits on top of the application content and is often used for navigation or details.\n *\n * Accessibility:\n * - Implements ARIA `role=\"dialog\"` and `aria-modal=\"true\"`.\n * - Traps focus effectively within the drawer while open.\n * - Restores focus to the triggering element upon closure.\n * - Supports closing via ESC key and overlay click.\n */\nexport default class Drawer extends React.Component<\n React.PropsWithChildren<DrawerProps>,\n DrawerState\n> {\n state = {\n open: false,\n };\n\n static defaultProps = {\n overlay: true,\n position: DRAWER_POSITION.LEFT,\n closeOnEsc: true,\n closeOnOverlayClick: true,\n };\n\n /**\n * Syncs state with props.\n */\n static getDerivedStateFromProps(props: DrawerProps) {\n if (props.open) {\n return {\n open: true,\n };\n }\n return null;\n }\n\n private layer?: ReturnType<typeof LayerManager.renderLayer>;\n\n private closeCallback?: (resp?: unknown) => void;\n\n /**\n * Internal close handler.\n * Restores focus and calls the external onClose callback.\n */\n private onClose = () => {\n this.restoreFocus();\n this.setState({\n open: false,\n });\n this.props.onClose?.();\n this.closeCallback = undefined;\n this.layer = undefined;\n };\n\n private lastFocusedElement: HTMLElement | null = null;\n private drawerRef = React.createRef<HTMLDivElement>();\n\n /**\n * Retrieves all focusable elements within the drawer.\n */\n private getFocusableElements = (): HTMLElement[] => {\n if (!this.drawerRef.current) return [];\n return Array.from(\n this.drawerRef.current.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n ),\n ) as HTMLElement[];\n };\n\n /**\n * Handles keydown events to implement the focus trap.\n * Traps Tab and Shift+Tab within the drawer.\n */\n private handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Tab') {\n const focusableElements = this.getFocusableElements();\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0];\n const lastElement = focusableElements[focusableElements.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === firstElement) {\n lastElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastElement) {\n firstElement.focus();\n e.preventDefault();\n }\n }\n }\n };\n\n /**\n * Lifecycle method to save the currently focused element when the drawer mounts while open.\n */\n componentDidMount() {\n if (this.props.open) {\n this.lastFocusedElement = document.activeElement as HTMLElement;\n // Handle initial open state\n this.handleOpen();\n }\n }\n\n /**\n * Handles opening the drawer by creating the layer.\n */\n private handleOpen = () => {\n const { closeOnEsc, closeOnOverlayClick, position, size, overlay, children, ...rest } =\n this.props;\n\n this.layer = LayerManager.renderLayer({\n overlay,\n exitDelay: 300,\n position: positionMap[position],\n closeCallback: this.onClose,\n closeOnEsc,\n closeOnOverlayClick,\n component: (\n <DrawerDiv\n {...rest}\n ref={this.setDrawerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n onKeyDown={this.handleKeyDown}\n position={position}\n size={size}\n onClick={(e) => e.stopPropagation()}\n >\n {children}\n </DrawerDiv>\n ),\n });\n this.closeCallback = this.layer[1];\n this.forceUpdate();\n };\n\n /**\n * Lifecycle method to restore focus when the drawer unmounts.\n */\n componentWillUnmount() {\n if (this.props.open) {\n this.restoreFocus();\n }\n }\n\n /**\n * Restores focus to the element that was focused before the drawer opened.\n */\n private restoreFocus = () => {\n if (this.lastFocusedElement) {\n // Check if the element is still in the document\n const elementToBeFocused = this.lastFocusedElement;\n this.lastFocusedElement = null;\n setTimeout(() => {\n if (document.body.contains(elementToBeFocused)) {\n elementToBeFocused.focus();\n }\n }, 100);\n }\n };\n\n /**\n * Callback ref to capture the Drawer DOM element.\n * Triggers initial focus setting when the element mounts.\n */\n private setDrawerRef = (node: HTMLDivElement | null) => {\n // Update ref\n (this.drawerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n\n if (node) {\n // Set initial focus when the node is mounted\n this.setInitialFocus(node);\n }\n };\n\n /**\n * Sets initial focus within the drawer.\n * Tries to focus the header first, then the first interactive element, or falls back to the container.\n */\n private setInitialFocus = (root: HTMLElement) => {\n // Try to find the header (assumed to be the first child)\n const firstChild = root.firstElementChild as HTMLElement;\n if (firstChild) {\n // Ensure it's focusable\n if (firstChild.getAttribute('tabindex') === null) {\n firstChild.setAttribute('tabindex', '-1');\n }\n firstChild.focus();\n return;\n }\n\n // Fallback to focusable elements\n const focusableElements = this.getFocusableElements();\n if (focusableElements.length > 0) {\n focusableElements[0].focus();\n } else {\n // Fallback to container\n root.focus();\n }\n };\n\n /**\n * Lifecycle method to handle Drawer updates.\n * Manages opening/closing logic via LayerManager and focus preservation.\n */\n getSnapshotBeforeUpdate(prevProps: DrawerProps) {\n const { open } = this.props;\n\n if (prevProps.open && !open) {\n this.closeCallback?.();\n this.restoreFocus();\n }\n\n if (!prevProps.open && open) {\n // Save current focus\n this.lastFocusedElement = document.activeElement as HTMLElement;\n this.handleOpen();\n }\n\n return null;\n }\n\n /**\n * Sets the ref prop passed to the Drawer Container component.\n * @param node\n */\n setRefProp = (node: HTMLDivElement | null) => {\n if (this.props.forwardRef && typeof this.props.forwardRef === 'function') {\n this.props.forwardRef(node);\n } else if (this.props.forwardRef && typeof this.props.forwardRef === 'object') {\n (this.props.forwardRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n };\n\n /**\n * Renders the Drawer component via the LayerManager portal.\n */\n render() {\n if (this.state.open && this.layer) {\n const [Component] = this.layer;\n return <Component ref={this.setRefProp} />;\n }\n\n return null;\n }\n}\n"],"names":["DRAWER_POSITION","positionStyle","size","before","after","DrawerDiv","styled","getThemeValue","THEME_NAME","BACKGROUND","MODAL_SHADOW","props","position","positionMap","LAYER_POSITION","TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","Drawer","React","Component","getDerivedStateFromProps","open","componentDidMount","lastFocusedElement","document","activeElement","handleOpen","componentWillUnmount","restoreFocus","getSnapshotBeforeUpdate","prevProps","closeCallback","render","state","layer","_jsx","ref","setRefProp","onClose","setState","undefined","drawerRef","createRef","getFocusableElements","current","Array","from","querySelectorAll","handleKeyDown","e","key","focusableElements","length","firstElement","lastElement","shiftKey","focus","preventDefault","closeOnEsc","closeOnOverlayClick","overlay","children","rest","LayerManager","renderLayer","exitDelay","component","setDrawerRef","role","aria-modal","tabIndex","onKeyDown","onClick","stopPropagation","forceUpdate","elementToBeFocused","setTimeout","body","contains","node","setInitialFocus","root","firstChild","firstElementChild","getAttribute","setAttribute","forwardRef","defaultProps"],"mappings":";;;;;;AAWO,IAAA,eAAKA,iBAAAA,SAAAA,eAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,eAAAA;AAIX,CAAA,CAAA,EAAA;AAED,MAAMC,eAAAA,GAAgB,CAACC,IAAAA,IAAmB;AACtC,QAAA,CAAA,MAAA,GAAwB;AACpBC,YAAAA,MAAAA,EAAQ,CAAC,0BAA0B,EAAED,IAAAA,IAAQ,OAAA,CAAQ,+BAA+B,CAAC;YACrFE,KAAAA,EAAO;AACX,SAAA;AACA,QAAA,CAAA,OAAA,GAAyB;AACrBD,YAAAA,MAAAA,EAAQ,CAAC,0BAA0B,EAAED,IAAAA,IAAQ,OAAA,CAAQ,8BAA8B,CAAC;YACpFE,KAAAA,EAAO;AACX,SAAA;AACA,QAAA,CAAA,QAAA,GAA0B;AACtBD,YAAAA,MAAAA,EAAQ;;;;AAII,oBAAA,EAAED,QAAQ,MAAA,CAAO;;;QAG7B,CAAC;YACDE,KAAAA,EAAO;AACX;KACJ,CAAA;AAEA,MAAMC,SAAAA,iBAAYC,MAAAA,CAAAA,KAAAA,EAAAA;;;AAGMC,CAAAA,CAAAA,CAAAA,sDAAAA,EAAAA,aAAAA,CAAcC,UAAAA,CAAWC,UAAU,CAAA,EAAA,6CAAA,EAEzCF,aAAAA,CAAcC,UAAAA,CAAWE,YAAY,CAAA,EAAA,GAAA,EACjD,CAACC,KAAAA,GA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
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- declare function Group(props: React.PropsWithChildren<PropTypes.InferProps<typeof Group.propTypes>>): import("@emotion/react/jsx-runtime").JSX.Element;
4
- declare namespace Group {
5
- var propTypes: {
6
- /** Error Message for the group */
7
- errorText: PropTypes.Requireable<string>;
8
- };
9
- }
2
+ declare const Group: React.ForwardRefExoticComponent<{
3
+ /** Error Message for the group */
4
+ errorText?: string;
5
+ } & {
6
+ children?: React.ReactNode | undefined;
7
+ } & React.RefAttributes<HTMLDivElement>>;
10
8
  export default Group;
@@ -1,11 +1,10 @@
1
1
  import { jsxs, Fragment, jsx } from '@emotion/react/jsx-runtime';
2
- import { useId } from 'react';
3
- import PropTypes from 'prop-types';
2
+ import React, { useId } from 'react';
4
3
  import styled from '@emotion/styled';
5
4
  import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
6
5
 
7
- const Container = /*#__PURE__*/ styled("div", {
8
- target: "e10z40ez0",
6
+ const Container$3 = /*#__PURE__*/ styled("div", {
7
+ target: "eahc3qe0",
9
8
  label: "Container"
10
9
  })("display:inline-flex;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:3px;margin:5px;& button,& label{margin:0;border:none;border-radius:0;border-left:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";box-shadow:none;height:32px;}& > div button{border-left:none;}& input,& select{border:none;height:32px;}& input,& select{border-radius:0;}& input:active,& select:active{box-shadow:none;}& > div > span{top:8px;}& > *:first-child,& > label:first-child input,& > label:first-child select,& > *:first-child label,& > *:first-child input{border-left:none;border-radius:2px 0 0 2px;}& > *:last-child,& > label:last-child input,& > label:last-child select,& > *:last-child label,& > *:last-child input{border-radius:0 2px 2px 0;}& *:focus,& *:focus + span{z-index:1;}&:focus-within,&:hover{box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";}", (props)=>props.errorText ? `
11
10
  border-color: ${getThemeValue(THEME_NAME.ERROR)};
@@ -15,15 +14,20 @@ const Container = /*#__PURE__*/ styled("div", {
15
14
  }
16
15
  ` : '');
17
16
  const ErrorContainer = /*#__PURE__*/ styled("div", {
18
- target: "e10z40ez1",
17
+ target: "eahc3qe1",
19
18
  label: "ErrorContainer"
20
19
  })("color:", getThemeValue(THEME_NAME.ERROR), ";margin-left:8px;font-size:12px;");
21
- function Group(props) {
20
+ /**
21
+ * Group Component
22
+ * @param props - Component props
23
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
24
+ */ function GroupComponent(props, ref) {
22
25
  const errorId = useId();
23
26
  return /*#__PURE__*/ jsxs(Fragment, {
24
27
  children: [
25
- /*#__PURE__*/ jsx(Container, {
28
+ /*#__PURE__*/ jsx(Container$3, {
26
29
  ...props,
30
+ ref: ref,
27
31
  "aria-describedby": props.errorText ? errorId : undefined,
28
32
  children: props.children
29
33
  }),
@@ -34,9 +38,7 @@ function Group(props) {
34
38
  ]
35
39
  });
36
40
  }
37
- Group.propTypes = {
38
- /** Error Message for the group */ errorText: PropTypes.string
39
- };
41
+ const Group = /*#__PURE__*/ React.forwardRef(GroupComponent);
40
42
 
41
43
  export { Group as default };
42
44
  //# sourceMappingURL=Group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Group.js","sources":["../../../src/components/Groups/Group.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from '@emotion/styled';\nimport { getThemeValue, THEME_NAME } from '../../shared/constants';\n\nconst Container = styled.div<PropTypes.InferProps<typeof Group.propTypes>>`\n display: inline-flex;\n border: 1px solid ${getThemeValue(THEME_NAME.BORDER_COLOR)};\n border-radius: 3px;\n margin: 5px;\n\n /* overrides */\n & button,\n & label {\n margin: 0;\n border: none;\n border-radius: 0;\n border-left: 1px solid ${getThemeValue(THEME_NAME.BORDER_COLOR)};\n box-shadow: none;\n height: 32px;\n }\n\n & > div button {\n border-left: none;\n }\n\n & input,\n & select {\n border: none;\n height: 32px;\n }\n\n & input,\n & select {\n border-radius: 0;\n }\n\n & input:active,\n & select:active {\n box-shadow: none;\n }\n\n & > div > span {\n top: 8px;\n }\n\n /* Handling for first and last child */\n & > *:first-child,\n & > label:first-child input,\n & > label:first-child select,\n & > *:first-child label,\n & > *:first-child input {\n border-left: none;\n border-radius: 2px 0 0 2px;\n }\n\n & > *:last-child,\n & > label:last-child input,\n & > label:last-child select,\n & > *:last-child label,\n & > *:last-child input {\n border-radius: 0 2px 2px 0;\n }\n\n /* focus */\n & *:focus,\n & *:focus + span {\n z-index: 1;\n }\n\n &:focus-within,\n &:hover {\n box-shadow: ${getThemeValue(THEME_NAME.HOVER_SHADOW)};\n }\n\n ${(props) =>\n props.errorText\n ? `\n border-color: ${getThemeValue(THEME_NAME.ERROR)};\n\n & > button, & > label {\n border-color: ${getThemeValue(THEME_NAME.ERROR)};\n }\n `\n : ''}\n`;\n\nconst ErrorContainer = styled.div`\n color: ${getThemeValue(THEME_NAME.ERROR)};\n margin-left: 8px;\n font-size: 12px;\n`;\n\nexport default function Group(\n props: React.PropsWithChildren<PropTypes.InferProps<typeof Group.propTypes>>,\n) {\n const errorId = useId();\n\n return (\n <>\n <Container {...props} aria-describedby={props.errorText ? errorId : undefined}>\n {props.children}\n </Container>\n {props.errorText && <ErrorContainer id={errorId}>{props.errorText}</ErrorContainer>}\n </>\n );\n}\n\nGroup.propTypes = {\n /** Error Message for the group */\n errorText: PropTypes.string,\n};\n"],"names":["Container","styled","getThemeValue","THEME_NAME","BORDER_COLOR","HOVER_SHADOW","props","errorText","ERROR","ErrorContainer","Group","errorId","useId","_jsxs","_Fragment","_jsx","aria-describedby","undefined","children","id","propTypes","PropTypes","string"],"mappings":";;;;;;AAKA,MAAMA,SAAAA,iBAAYC,MAAAA,CAAAA,KAAAA,EAAAA;;;AAEMC,CAAAA,CAAAA,CAAAA,uCAAAA,EAAAA,aAAAA,CAAcC,WAAWC,YAAY,CAAA,EAAA,4GAAA,EAU5BF,aAAAA,CAAcC,UAAAA,CAAWC,YAAY,CAAA,EAAA,qlBAAA,EAuDhDF,aAAAA,CAAcC,UAAAA,CAAWE,YAAY,SAGrD,CAACC,KAAAA,GACCA,KAAAA,CAAMC,SAAS,GACT;sBACQ,EAAEL,aAAAA,CAAcC,UAAAA,CAAWK,KAAK,CAAA,CAAE;;;0BAG9B,EAAEN,aAAAA,CAAcC,UAAAA,CAAWK,KAAK,CAAA,CAAE;;AAExD,IAAA,CAAC,GACS,EAAA,CAAA;AAGd,MAAMC,cAAAA,iBAAiBR,MAAAA,CAAAA,KAAAA,EAAAA;;;AACVC,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,aAAAA,CAAcC,WAAWK,KAAK,CAAA,EAAA,kCAAA,CAAA;AAK5B,SAASE,MACpBJ,KAA4E,EAAA;AAE5E,IAAA,MAAMK,OAAAA,GAAUC,KAAAA,EAAAA;IAEhB,qBACIC,IAAA,CAAAC,QAAA,EAAA;;0BACIC,GAAA,CAACf,SAAAA,EAAAA;AAAW,gBAAA,GAAGM,KAAK;gBAAEU,kBAAAA,EAAkBV,KAAAA,CAAMC,SAAS,GAAGI,OAAAA,GAAUM,SAAAA;AAC/DX,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMY;;YAEVZ,KAAAA,CAAMC,SAAS,kBAAIQ,GAAA,CAACN,cAAAA,EAAAA;gBAAeU,EAAAA,EAAIR,OAAAA;AAAUL,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMC;;;;AAGpE;AAEAG,KAAAA,CAAMU,SAAS,GAAG;uCAEdb,SAAAA,EAAWc,SAAAA,CAAUC;AACzB,CAAA;;;;"}
1
+ {"version":3,"file":"Group.js","sources":["../../../src/components/Groups/Group.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport styled from '@emotion/styled';\nimport { getThemeValue, THEME_NAME } from '../../shared/constants';\n\nconst Container = styled.div<GroupProps>`\n display: inline-flex;\n border: 1px solid ${getThemeValue(THEME_NAME.BORDER_COLOR)};\n border-radius: 3px;\n margin: 5px;\n\n /* overrides */\n & button,\n & label {\n margin: 0;\n border: none;\n border-radius: 0;\n border-left: 1px solid ${getThemeValue(THEME_NAME.BORDER_COLOR)};\n box-shadow: none;\n height: 32px;\n }\n\n & > div button {\n border-left: none;\n }\n\n & input,\n & select {\n border: none;\n height: 32px;\n }\n\n & input,\n & select {\n border-radius: 0;\n }\n\n & input:active,\n & select:active {\n box-shadow: none;\n }\n\n & > div > span {\n top: 8px;\n }\n\n /* Handling for first and last child */\n & > *:first-child,\n & > label:first-child input,\n & > label:first-child select,\n & > *:first-child label,\n & > *:first-child input {\n border-left: none;\n border-radius: 2px 0 0 2px;\n }\n\n & > *:last-child,\n & > label:last-child input,\n & > label:last-child select,\n & > *:last-child label,\n & > *:last-child input {\n border-radius: 0 2px 2px 0;\n }\n\n /* focus */\n & *:focus,\n & *:focus + span {\n z-index: 1;\n }\n\n &:focus-within,\n &:hover {\n box-shadow: ${getThemeValue(THEME_NAME.HOVER_SHADOW)};\n }\n\n ${(props) =>\n props.errorText\n ? `\n border-color: ${getThemeValue(THEME_NAME.ERROR)};\n\n & > button, & > label {\n border-color: ${getThemeValue(THEME_NAME.ERROR)};\n }\n `\n : ''}\n`;\n\nconst ErrorContainer = styled.div`\n color: ${getThemeValue(THEME_NAME.ERROR)};\n margin-left: 8px;\n font-size: 12px;\n`;\n\ntype GroupProps = React.PropsWithChildren<{\n /** Error Message for the group */\n errorText?: string;\n}>;\n\n/**\n * Group Component\n * @param props - Component props\n * @param ref - Ref forwarded to the underlying HTMLDivElement\n */\nfunction GroupComponent(\n props: React.PropsWithChildren<GroupProps>,\n ref: React.Ref<HTMLDivElement>,\n) {\n const errorId = useId();\n\n return (\n <>\n <Container\n {...props}\n ref={ref}\n aria-describedby={props.errorText ? errorId : undefined}\n >\n {props.children}\n </Container>\n {props.errorText && <ErrorContainer id={errorId}>{props.errorText}</ErrorContainer>}\n </>\n );\n}\n\nconst Group = React.forwardRef<HTMLDivElement, GroupProps>(GroupComponent);\nexport default Group;\n"],"names":["Container","styled","getThemeValue","THEME_NAME","BORDER_COLOR","HOVER_SHADOW","props","errorText","ERROR","ErrorContainer","GroupComponent","ref","errorId","useId","_jsxs","_Fragment","_jsx","aria-describedby","undefined","children","id","Group","React","forwardRef"],"mappings":";;;;;AAIA,MAAMA,WAAAA,iBAAYC,MAAAA,CAAAA,KAAAA,EAAAA;;;AAEMC,CAAAA,CAAAA,CAAAA,uCAAAA,EAAAA,aAAAA,CAAcC,WAAWC,YAAY,CAAA,EAAA,4GAAA,EAU5BF,aAAAA,CAAcC,UAAAA,CAAWC,YAAY,CAAA,EAAA,qlBAAA,EAuDhDF,aAAAA,CAAcC,UAAAA,CAAWE,YAAY,SAGrD,CAACC,KAAAA,GACCA,KAAAA,CAAMC,SAAS,GACT;sBACQ,EAAEL,aAAAA,CAAcC,UAAAA,CAAWK,KAAK,CAAA,CAAE;;;0BAG9B,EAAEN,aAAAA,CAAcC,UAAAA,CAAWK,KAAK,CAAA,CAAE;;AAExD,IAAA,CAAC,GACS,EAAA,CAAA;AAGd,MAAMC,cAAAA,iBAAiBR,MAAAA,CAAAA,KAAAA,EAAAA;;;AACVC,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,aAAAA,CAAcC,WAAWK,KAAK,CAAA,EAAA,kCAAA,CAAA;AAU3C;;;;AAIC,IACD,SAASE,cAAAA,CACLJ,KAA0C,EAC1CK,GAA8B,EAAA;AAE9B,IAAA,MAAMC,OAAAA,GAAUC,KAAAA,EAAAA;IAEhB,qBACIC,IAAA,CAAAC,QAAA,EAAA;;0BACIC,GAAA,CAAChB,WAAAA,EAAAA;AACI,gBAAA,GAAGM,KAAK;gBACTK,GAAAA,EAAKA,GAAAA;gBACLM,kBAAAA,EAAkBX,KAAAA,CAAMC,SAAS,GAAGK,OAAAA,GAAUM,SAAAA;AAE7CZ,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMa;;YAEVb,KAAAA,CAAMC,SAAS,kBAAIS,GAAA,CAACP,cAAAA,EAAAA;gBAAeW,EAAAA,EAAIR,OAAAA;AAAUN,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMC;;;;AAGpE;AAEA,MAAMc,KAAAA,iBAAQC,KAAAA,CAAMC,UAAU,CAA6Bb,cAAAA;;;;"}
@@ -1,17 +1,14 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- type CheckboxProps = Omit<React.HTMLProps<HTMLInputElement>, 'as'> & PropTypes.InferProps<typeof Checkbox.propTypes>;
4
- declare function Checkbox(props: CheckboxProps): import("@emotion/react/jsx-runtime").JSX.Element;
5
- declare namespace Checkbox {
6
- var propTypes: {
7
- /** Label for the field */
8
- label: PropTypes.Requireable<string>;
9
- /** If the field is in indeterminate state */
10
- indeterminate: PropTypes.Requireable<boolean>;
11
- };
12
- var defaultProps: {
13
- indeterminate: boolean;
14
- label: string;
15
- };
16
- }
2
+ declare const Checkbox: React.ForwardRefExoticComponent<{
3
+ /**
4
+ * Label for the field
5
+ * @default ''
6
+ */
7
+ label?: string;
8
+ /**
9
+ * If the field is in indeterminate state
10
+ * @default false
11
+ */
12
+ indeterminate?: boolean;
13
+ } & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
17
14
  export default Checkbox;
@@ -1,54 +1,58 @@
1
1
  import { jsxs, jsx } from '@emotion/react/jsx-runtime';
2
- import { useCallback } from 'react';
3
- import PropTypes from 'prop-types';
2
+ import React, { useCallback } from 'react';
4
3
  import styled from '@emotion/styled';
5
4
  import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
6
5
 
7
- const Label = /*#__PURE__*/ styled("label", {
8
- target: "e16qfxit0",
6
+ const Label$2 = /*#__PURE__*/ styled("label", {
7
+ target: "e10ud8wb0",
9
8
  label: "Label"
10
9
  })("margin:5px 0;position:relative;display:inline-flex;align-items:center;cursor:pointer;");
11
10
  const StyledCheckmark = /*#__PURE__*/ styled("span", {
12
- target: "e16qfxit1",
11
+ target: "e10ud8wb1",
13
12
  label: "StyledCheckmark"
14
13
  })("width:16px;height:16px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;border-radius:3px;margin-right:5px;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transition:all 0.3s ease;position:relative;flex-shrink:0;&::after{content:'';width:3px;height:10px;border-right:2px solid ", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-bottom:2px solid ", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";position:absolute;top:1px;left:6px;opacity:0;transform:rotate(45deg) scale(0);transition:all 0.2s ease;}");
15
- const HiddenInput = /*#__PURE__*/ styled("input", {
16
- target: "e16qfxit2",
14
+ const HiddenInput$1 = /*#__PURE__*/ styled("input", {
15
+ target: "e10ud8wb2",
17
16
  label: "HiddenInput"
18
17
  })("opacity:0;width:0;height:0;position:absolute;margin:0;&:checked + ", StyledCheckmark, "{background-color:", getThemeValue(THEME_NAME.PRIMARY), ";border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:checked + ", StyledCheckmark, "::after{opacity:1;transform:rotate(45deg) scale(1);}&:indeterminate + ", StyledCheckmark, "{background-color:", getThemeValue(THEME_NAME.PRIMARY), ";border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:indeterminate + ", StyledCheckmark, "::after{opacity:1;height:0;width:8px;border-right:none;border-bottom:2px solid ", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";transform:rotate(0deg) scale(1);top:7px;left:4px;}&:enabled:active + ", StyledCheckmark, ",&:focus + ", StyledCheckmark, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:active ~ span,&:focus ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover + ", StyledCheckmark, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled + ", StyledCheckmark, "{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";cursor:not-allowed;}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED), ";cursor:not-allowed;}&:checked:disabled + ", StyledCheckmark, ",&:indeterminate:disabled + ", StyledCheckmark, "{background-color:", getThemeValue(THEME_NAME.DISABLED), ";}");
19
- function Checkbox(props) {
18
+ /**
19
+ * Checkbox Component
20
+ * @param props - Component props
21
+ * @param fwdRef - Ref forwarded to the underlying HTMLInputElement
22
+ */ function CheckboxComponent(props, fwdRef) {
23
+ const { label = '', indeterminate = false, checked, ...rest } = props;
20
24
  const ref = useCallback((node)=>{
21
- if (node !== null) {
22
- if (props.indeterminate) {
23
- node.indeterminate = true;
24
- }
25
+ // Ensure the DOM `indeterminate` flag always matches the prop
26
+ if (node) {
27
+ node.indeterminate = !!indeterminate;
28
+ }
29
+ // Forward the node (or null) to the parent ref (supports function or ref object)
30
+ if (typeof fwdRef === 'function') {
31
+ fwdRef(node);
32
+ } else if (fwdRef) {
33
+ fwdRef.current = node;
25
34
  }
26
35
  }, [
27
- props.indeterminate
36
+ indeterminate,
37
+ fwdRef
28
38
  ]);
29
- return /*#__PURE__*/ jsxs(Label, {
39
+ return /*#__PURE__*/ jsxs(Label$2, {
30
40
  children: [
31
- /*#__PURE__*/ jsx(HiddenInput, {
32
- ...props,
41
+ /*#__PURE__*/ jsx(HiddenInput$1, {
42
+ ...rest,
33
43
  ref: ref,
34
44
  type: "checkbox",
35
- "aria-checked": props.indeterminate ? 'mixed' : props.checked
45
+ checked: checked,
46
+ "aria-checked": indeterminate ? 'mixed' : checked
36
47
  }),
37
48
  /*#__PURE__*/ jsx(StyledCheckmark, {}),
38
49
  /*#__PURE__*/ jsx("span", {
39
- children: props.label
50
+ children: label
40
51
  })
41
52
  ]
42
53
  });
43
54
  }
44
- Checkbox.propTypes = {
45
- /** Label for the field */ label: PropTypes.string,
46
- /** If the field is in indeterminate state */ indeterminate: PropTypes.bool
47
- };
48
- Checkbox.defaultProps = {
49
- indeterminate: false,
50
- label: ''
51
- };
55
+ const Checkbox = /*#__PURE__*/ React.forwardRef(CheckboxComponent);
52
56
 
53
57
  export { Checkbox as default };
54
58
  //# sourceMappingURL=Checkbox.js.map