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
package/dist/index.js CHANGED
@@ -2,10 +2,8 @@
2
2
 
3
3
  var jsxRuntime = require('@emotion/react/jsx-runtime');
4
4
  var React = require('react');
5
- var PropTypes = require('prop-types');
6
- var react = require('@emotion/react');
7
5
  var styled = require('@emotion/styled');
8
- var ReactDOM = require('react-dom');
6
+ var reactDom = require('react-dom');
9
7
  var client = require('react-dom/client');
10
8
 
11
9
  function Accordion(props) {
@@ -26,20 +24,14 @@ function Accordion(props) {
26
24
  if (!/*#__PURE__*/ React.isValidElement(child)) {
27
25
  return child;
28
26
  }
29
- return /*#__PURE__*/ React.cloneElement(child, {
27
+ const reactElement = child;
28
+ return /*#__PURE__*/ React.cloneElement(reactElement, {
30
29
  open: active === index,
31
- onStepClick: onStepClick(index, child.props.disabled)
30
+ onStepClick: onStepClick(index, reactElement.props.disabled || false)
32
31
  });
33
32
  })
34
33
  });
35
34
  }
36
- Accordion.propTypes = {
37
- /** Currently opened step */ active: PropTypes.number,
38
- /** Handler for click event on a step */ onStepClick: PropTypes.func
39
- };
40
- Accordion.defaultProps = {
41
- active: -1
42
- };
43
35
 
44
36
  function CheckCircle$4(props) {
45
37
  return /*#__PURE__*/ jsxRuntime.jsxs("svg", {
@@ -276,7 +268,7 @@ var BADGE_TYPE = /*#__PURE__*/ function(BADGE_TYPE) {
276
268
  return BADGE_TYPE;
277
269
  }({});
278
270
  const BadgeSpan = /*#__PURE__*/ styled("span", {
279
- target: "e5vd1rw0",
271
+ target: "e1aaenck0",
280
272
  label: "BadgeSpan"
281
273
  })("background-color:", (props)=>{
282
274
  switch(props.type){
@@ -292,69 +284,88 @@ const BadgeSpan = /*#__PURE__*/ styled("span", {
292
284
  return getThemeValue(THEME_NAME.PRIMARY);
293
285
  }
294
286
  }, ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:10px;padding:", (props)=>props.children ? '3px 10px' : '4px', ";display:inline-block;min-height:4px;min-width:4px;font-size:12px;margin:", (props)=>props.inline ? '0 5px' : '0', ";", (props)=>!props.inline && 'position: absolute; top: 0; right: 0; transform: translate(50%, -50%);', ";");
295
- function Badge(props) {
287
+ /**
288
+ * Badge Component
289
+ * @param props - Component props
290
+ * @param ref - Ref forwarded to the underlying HTMLSpanElement
291
+ */ function BadgeComponent(props, ref) {
296
292
  return /*#__PURE__*/ jsxRuntime.jsx(BadgeSpan, {
297
- ...props
293
+ ...props,
294
+ ref: ref
298
295
  });
299
296
  }
300
- Badge.propTypes = {
301
- /** Display badge inline or overlay on parent component */ inline: PropTypes.bool,
302
- /** Type of badge */ type: PropTypes.oneOf([
303
- "primary",
304
- "success",
305
- "warning",
306
- "danger",
307
- "disabled"
308
- ]),
309
- css: PropTypes.any
310
- };
311
- Badge.defaultProps = {
312
- inline: false,
313
- type: "primary"
314
- };
297
+ const Badge = /*#__PURE__*/ React.forwardRef(BadgeComponent);
315
298
 
316
- const Card = /*#__PURE__*/ styled("div", {
317
- target: "e1jmwjfy0",
318
- label: "Card"
299
+ const StyledCard = /*#__PURE__*/ styled("div", {
300
+ target: "ebufzie0",
301
+ label: "StyledCard"
319
302
  })("border-radius:10px;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";", (props)=>props.elevated ? `box-shadow: ${getThemeValue(THEME_NAME.MODAL_SHADOW)};` : `box-shadow: ${getThemeValue(THEME_NAME.SHADOW)};`, " margin:5px;overflow:auto;position:relative;");
303
+ /**
304
+ * Card Component
305
+ * @param props - Component props
306
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
307
+ */ function CardComponent(props, ref) {
308
+ return /*#__PURE__*/ jsxRuntime.jsx(StyledCard, {
309
+ ...props,
310
+ ref: ref
311
+ });
312
+ }
313
+ const Card = /*#__PURE__*/ React.forwardRef(CardComponent);
320
314
 
321
315
  const Step$1 = /*#__PURE__*/ styled(Card, {
322
- target: "e3zsr580",
316
+ target: "e14f46gi0",
323
317
  label: "Step"
324
318
  })("transition:all 0.6s ease;overflow:visible;", (props)=>props.open && `margin: 20px 5px;`);
325
319
  const StepHeader = /*#__PURE__*/ styled("button", {
326
- target: "e3zsr581",
320
+ target: "e14f46gi1",
327
321
  label: "StepHeader"
328
322
  })("padding:20px 15px;display:flex;justify-content:space-between;background:none;border:none;border-radius:10px;width:100%;font-size:inherit;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:focus-visible{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}& input{appearance:none;margin:0;}", (props)=>props.open && `border-bottom: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};`, " ", (props)=>props.disabled && `color: ${getThemeValue(THEME_NAME.DISABLED)};`);
329
323
  const HeaderContainer = /*#__PURE__*/ styled("div", {
330
- target: "e3zsr582",
324
+ target: "e14f46gi2",
331
325
  label: "HeaderContainer"
332
326
  })("display:flex;align-items:center;min-width:40px;& svg{vertical-align:top;margin-right:10px;fill:", (props)=>props.open ? getThemeValue(THEME_NAME.PRIMARY) : props.completed ? getThemeValue(THEME_NAME.SUCCESS) : getThemeValue(THEME_NAME.LIGHT_GREY), ";transform:", (props)=>props.open ? 'scale(0.8)' : 'scale(0.6)', ";transition:all 0.3s ease;min-width:24px;}");
333
327
  const ExpandContainer = /*#__PURE__*/ styled("div", {
334
- target: "e3zsr583",
328
+ target: "e14f46gi3",
335
329
  label: "ExpandContainer"
336
330
  })("display:flex;align-items:center;& svg{vertical-align:top;margin-right:10px;transition:all 0.6s ease;fill:currentColor;}", (props)=>props.open ? `& svg { transform: rotate(180deg); }` : '');
337
331
  const StepBody = /*#__PURE__*/ styled("div", {
338
- target: "e3zsr584",
332
+ target: "e14f46gi4",
339
333
  label: "StepBody"
340
334
  })("transition:all 0.6s ease;overflow:hidden;height:", (props)=>props.height || 0, "px;");
335
+ const AccordionBadge = /*#__PURE__*/ styled(Badge, {
336
+ target: "e14f46gi5",
337
+ label: "AccordionBadge"
338
+ })("margin-right:15px;");
341
339
  const AccordionStepBody = /*#__PURE__*/ styled("div", {
342
- target: "e3zsr585",
340
+ target: "e14f46gi6",
343
341
  label: "AccordionStepBody"
344
342
  })("padding:20px 15px;");
345
343
  const AccordionStepFooter = /*#__PURE__*/ styled("div", {
346
- target: "e3zsr586",
344
+ target: "e14f46gi7",
347
345
  label: "AccordionStepFooter"
348
346
  })("display:flex;justify-content:flex-end;padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";");
349
- function AccordionStep(props) {
347
+ /**
348
+ * AccordionStep Component
349
+ * @param props - Component props
350
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
351
+ */ function AccordionStepComponent(props, ref) {
350
352
  const [height, setHeight] = React.useState(0);
351
- const { open, disabled, header, errorText, completed, onStepClick, children, ...restProps } = props;
353
+ const { open, disabled = false, header, errorText, completed = false, onStepClick, children, ...restProps } = props;
352
354
  // Generate unique IDs for ARIA relationships
353
355
  const headerId = React.useId();
354
356
  const regionId = React.useId();
355
- const ref = (el)=>setHeight(el?.scrollHeight || 0);
357
+ const contentRef = React.useRef(null);
358
+ // Measure content height when `open` or children change.
359
+ React.useEffect(()=>{
360
+ const el = contentRef.current;
361
+ setHeight(el?.scrollHeight || 0);
362
+ }, [
363
+ open,
364
+ children
365
+ ]);
356
366
  return /*#__PURE__*/ jsxRuntime.jsxs(Step$1, {
357
367
  ...restProps,
368
+ ref: ref,
358
369
  open: open,
359
370
  elevated: open,
360
371
  completed: completed,
@@ -382,8 +393,7 @@ function AccordionStep(props) {
382
393
  /*#__PURE__*/ jsxRuntime.jsxs(ExpandContainer, {
383
394
  open: open,
384
395
  children: [
385
- errorText && /*#__PURE__*/ jsxRuntime.jsx(Badge, {
386
- css: /*#__PURE__*/ react.css("margin-right:15px;", "ref"),
396
+ errorText && /*#__PURE__*/ jsxRuntime.jsx(AccordionBadge, {
387
397
  inline: true,
388
398
  type: BADGE_TYPE.DANGER,
389
399
  children: errorText
@@ -396,7 +406,7 @@ function AccordionStep(props) {
396
406
  ]
397
407
  }),
398
408
  /*#__PURE__*/ jsxRuntime.jsx(StepBody, {
399
- ref: ref,
409
+ ref: contentRef,
400
410
  height: open ? height : 0,
401
411
  role: "region",
402
412
  id: regionId,
@@ -407,54 +417,111 @@ function AccordionStep(props) {
407
417
  ]
408
418
  });
409
419
  }
410
- AccordionStep.propTypes = {
411
- /** Header text for the step */ header: PropTypes.string.isRequired,
412
- /** Error text for the step */ errorText: PropTypes.string,
413
- /** If steps has been marked as completed */ completed: PropTypes.bool,
414
- /** If the step is disabled */ disabled: PropTypes.bool
415
- };
416
- AccordionStep.defaultProps = {
417
- completed: false,
418
- disabled: false
419
- };
420
+ const AccordionStep = /*#__PURE__*/ React.forwardRef(AccordionStepComponent);
420
421
 
421
422
  const StyledButton = /*#__PURE__*/ styled("button", {
422
- target: "e1p361zw0",
423
+ target: "e123477w0",
423
424
  label: "StyledButton"
424
425
  })("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:pointer;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;margin-left:-6px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
425
- StyledButton.defaultProps = {
426
- type: 'button'
427
- };
426
+ /**
427
+ * Button Component
428
+ * @param props - Component props
429
+ * @param ref - Ref forwarded to the underlying HTMLButtonElement
430
+ */ function ButtonComponent(props, ref) {
431
+ const { type = 'button', ...rest } = props;
432
+ return /*#__PURE__*/ jsxRuntime.jsx(StyledButton, {
433
+ ref: ref,
434
+ type: type,
435
+ ...rest
436
+ });
437
+ }
438
+ const Button$2 = /*#__PURE__*/ React.forwardRef(ButtonComponent);
428
439
 
429
- var LinkButton = /*#__PURE__*/ styled("button", {
430
- target: "ecu06nw0",
431
- label: ""
440
+ const StyledLinkButton = /*#__PURE__*/ styled("button", {
441
+ target: "e1d039580",
442
+ label: "StyledLinkButton"
432
443
  })("min-width:100px;font-size:14px;text-align:center;height:32px;cursor:pointer;background-color:transparent;border:none;color:", getThemeValue(THEME_NAME.PRIMARY), ";padding:0 12px;margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;margin-left:-6px;}&:enabled:hover,&:focus{text-decoration:underline;}&:disabled{border-color:", getThemeValue(THEME_NAME.BORDER_COLOR), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
444
+ /**
445
+ * LinkButton Component
446
+ * @param props - Component props
447
+ * @param ref - Ref forwarded to the underlying HTMLButtonElement
448
+ */ const LinkButtonComponent = (props, ref)=>{
449
+ const { type = 'button', ...rest } = props;
450
+ return /*#__PURE__*/ jsxRuntime.jsx(StyledLinkButton, {
451
+ ref: ref,
452
+ type: type,
453
+ ...rest
454
+ });
455
+ };
456
+ const LinkButton = /*#__PURE__*/ React.forwardRef(LinkButtonComponent);
433
457
 
434
- var RaisedButton = /*#__PURE__*/ styled("button", {
435
- target: "etv67u90",
436
- label: ""
458
+ const StyledRaisedButton = /*#__PURE__*/ styled("button", {
459
+ target: "e1p6mbrx0",
460
+ label: "StyledRaisedButton"
437
461
  })("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";color:inherit;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transform:translateY(-2px);box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;margin-left:-6px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}&:active{transform:translateY(0);box-shadow:", getThemeValue(THEME_NAME.SHADOW), ";}");
462
+ /**
463
+ * RaisedButton Component
464
+ * @param props - Component props
465
+ * @param ref - Ref forwarded to the underlying HTMLButtonElement
466
+ */ const RaisedButtonComponent = (props, ref)=>{
467
+ const { type = 'button', ...rest } = props;
468
+ return /*#__PURE__*/ jsxRuntime.jsx(StyledRaisedButton, {
469
+ ref: ref,
470
+ type: type,
471
+ ...rest
472
+ });
473
+ };
474
+ const RaisedButton = /*#__PURE__*/ React.forwardRef(RaisedButtonComponent);
438
475
 
439
- var ActionButton = /*#__PURE__*/ styled("button", {
440
- target: "e1s126ex0",
441
- label: ""
476
+ const StyledActionButton = /*#__PURE__*/ styled("button", {
477
+ target: "ec49rx60",
478
+ label: "StyledActionButton"
442
479
  })("border:1px solid ", getThemeValue(THEME_NAME.PRIMARY), ";background-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:pointer;margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;margin-left:-6px;}&:enabled:hover{box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";}&:focus{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{border:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
480
+ /**
481
+ * ActionButton Component
482
+ * @param props - Component props
483
+ * @param ref - Ref forwarded to the underlying HTMLButtonElement
484
+ */ function ActionButtonComponent(props, ref) {
485
+ const { type = 'button', ...rest } = props;
486
+ return /*#__PURE__*/ jsxRuntime.jsx(StyledActionButton, {
487
+ ref: ref,
488
+ type: type,
489
+ ...rest
490
+ });
491
+ }
492
+ const ActionButton = /*#__PURE__*/ React.forwardRef(ActionButtonComponent);
443
493
 
444
- var IconButton = /*#__PURE__*/ styled("button", {
445
- target: "eny3n5p0",
446
- label: ""
494
+ const StyledIconButton = /*#__PURE__*/ styled("button", {
495
+ target: "efmjh6j0",
496
+ label: "StyledIconButton"
447
497
  })("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;font-size:14px;text-align:center;padding:0 3px;cursor:pointer;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}&:disabled > svg{fill:", getThemeValue(THEME_NAME.DISABLED), ";}");
498
+ /**
499
+ * IconButton Component
500
+ * @param props - Component props
501
+ * @param ref - Ref forwarded to the underlying HTMLButtonElement
502
+ */ function IconButtonComponent(props, ref) {
503
+ const { type = 'button', ...rest } = props;
504
+ return /*#__PURE__*/ jsxRuntime.jsx(StyledIconButton, {
505
+ ref: ref,
506
+ type: type,
507
+ ...rest
508
+ });
509
+ }
510
+ const IconButton = /*#__PURE__*/ React.forwardRef(IconButtonComponent);
448
511
 
449
512
  const Container$8 = /*#__PURE__*/ styled("span", {
450
- target: "e1b6ywa20",
513
+ target: "eg8hsap0",
451
514
  label: "Container"
452
515
  })("padding:5px;padding-left:15px;border-radius:16px;background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";display:inline-flex;margin:5px;line-height:20px;align-items:center;");
453
516
  const Button$1 = /*#__PURE__*/ styled("button", {
454
- target: "e1b6ywa21",
517
+ target: "eg8hsap1",
455
518
  label: "Button"
456
519
  })("color:", getThemeValue(THEME_NAME.BACKGROUND), ";background-color:", getThemeValue(THEME_NAME.DISABLED), ";border-radius:50%;border:none;padding:4px;display:inline-flex;margin-left:5px;&:focus-within{outline:4px solid ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}");
457
- function Chip(props) {
520
+ /**
521
+ * Chip Component
522
+ * @param props - Component props
523
+ * @param ref - Ref forwarded to the underlying HTMLSpanElement
524
+ */ function ChipComponent(props, ref) {
458
525
  const { label, onCloseClick, closeButtonAriaLabel, ...rest } = props;
459
526
  const keyUpHandler = (e)=>{
460
527
  if (e.key === 'Backspace' || e.key === 'Delete') {
@@ -469,6 +536,7 @@ function Chip(props) {
469
536
  };
470
537
  return /*#__PURE__*/ jsxRuntime.jsxs(Container$8, {
471
538
  ...rest,
539
+ ref: ref,
472
540
  onKeyUp: keyUpHandler,
473
541
  children: [
474
542
  label,
@@ -484,6 +552,7 @@ function Chip(props) {
484
552
  ]
485
553
  });
486
554
  }
555
+ const Chip = /*#__PURE__*/ React.forwardRef(ChipComponent);
487
556
 
488
557
  var ORIENTATION = /*#__PURE__*/ function(ORIENTATION) {
489
558
  ORIENTATION["HORIZONTAL"] = "horizontal";
@@ -493,15 +562,15 @@ var ORIENTATION = /*#__PURE__*/ function(ORIENTATION) {
493
562
  const DragContext = React.createContext(null);
494
563
 
495
564
  /** Styled component for the draggable item container */ const Item = /*#__PURE__*/ styled("div", {
496
- target: "ews8uza0",
565
+ target: "ertl9d70",
497
566
  label: "Item"
498
- })("cursor:", (props)=>props.showIndicator ? 'default' : 'move', ";display:flex;user-select:", (props)=>props.showIndicator ? 'auto' : 'none', ";border-top:2px dashed\n ", (props)=>props.orientation === ORIENTATION.VERTICAL && props.active > 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";border-bottom:2px dashed\n ", (props)=>props.orientation === ORIENTATION.VERTICAL && props.active < 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";border-left:2px dashed\n ", (props)=>props.orientation === ORIENTATION.HORIZONTAL && props.active > 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";border-right:2px dashed\n ", (props)=>props.orientation === ORIENTATION.HORIZONTAL && props.active < 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";opacity:", (props)=>props.dragging ? 0.5 : 1, ";border-radius:10px;&:focus{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus:not(:focus-visible){box-shadow:none;}&:focus-visible{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}");
567
+ })("cursor:", (props)=>props.showIndicator ? 'default' : 'move', ";display:flex;user-select:", (props)=>props.showIndicator ? 'auto' : 'none', ";border-top:2px dashed\n ", (props)=>props.orientation === ORIENTATION.VERTICAL && props.active !== null && props.active > 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";border-bottom:2px dashed\n ", (props)=>props.orientation === ORIENTATION.VERTICAL && props.active !== null && props.active < 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";border-left:2px dashed\n ", (props)=>props.orientation === ORIENTATION.HORIZONTAL && props.active !== null && props.active > 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";border-right:2px dashed\n ", (props)=>props.orientation === ORIENTATION.HORIZONTAL && props.active !== null && props.active < 0 ? getThemeValue(THEME_NAME.PRIMARY) : 'transparent', ";opacity:", (props)=>props.dragging ? 0.5 : 1, ";border-radius:10px;&:focus{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus:not(:focus-visible){box-shadow:none;}&:focus-visible{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}");
499
568
  /** Styled component for the drag handle indicator */ const DragKnob = /*#__PURE__*/ styled("div", {
500
- target: "ews8uza1",
569
+ target: "ertl9d71",
501
570
  label: "DragKnob"
502
571
  })("padding-top:8px;cursor:move;touch-action:none;color:", getThemeValue(THEME_NAME.DISABLED), ";");
503
572
  /** Container for the children */ const Container$7 = /*#__PURE__*/ styled("div", {
504
- target: "ews8uza2",
573
+ target: "ertl9d72",
505
574
  label: "Container"
506
575
  })("flex:1;");
507
576
  /**
@@ -552,8 +621,8 @@ const DragContext = React.createContext(null);
552
621
  * Drag start event handler
553
622
  * @param e Event
554
623
  */ const dragStartHandler = ()=>{
555
- context.setStartIndex(index);
556
- context.setIsDragging(true);
624
+ context?.setStartIndex(index);
625
+ context?.setIsDragging(true);
557
626
  };
558
627
  /**
559
628
  * Drag over event handler
@@ -561,7 +630,9 @@ const DragContext = React.createContext(null);
561
630
  */ const dragOverHandler = (e)=>{
562
631
  e.preventDefault();
563
632
  e.stopPropagation();
564
- setActive(context.startIndex - index);
633
+ if (context && context.startIndex !== null) {
634
+ setActive(context.startIndex - index);
635
+ }
565
636
  };
566
637
  /**
567
638
  * Drag leave event handler
@@ -574,8 +645,8 @@ const DragContext = React.createContext(null);
574
645
  */ const dropHandler = (e)=>{
575
646
  e.preventDefault();
576
647
  setActive(0);
577
- context.drop(index);
578
- context.setIsDragging(false);
648
+ context?.drop(index);
649
+ context?.setIsDragging(false);
579
650
  };
580
651
  /**
581
652
  * Touch start event handler
@@ -586,9 +657,9 @@ const DragContext = React.createContext(null);
586
657
  clearTimeout(touchTimerRef.current);
587
658
  }
588
659
  touchTimerRef.current = setTimeout(()=>{
589
- context.setStartIndex(index);
590
- context.setIsDragging(true);
591
- context.setDragOver(index);
660
+ context?.setStartIndex(index);
661
+ context?.setIsDragging(true);
662
+ context?.setDragOver(index);
592
663
  document.body.style.overflow = 'hidden';
593
664
  vibrate(50);
594
665
  }, 200);
@@ -600,7 +671,7 @@ const DragContext = React.createContext(null);
600
671
  */ const touchMoveHandler = (e)=>{
601
672
  const touch = e.touches[0];
602
673
  if (!touch) return;
603
- if (context.isDragging) {
674
+ if (context?.isDragging) {
604
675
  e.preventDefault();
605
676
  // get the element under the touch point
606
677
  const el = document.elementFromPoint(touch.clientX, touch.clientY);
@@ -608,7 +679,7 @@ const DragContext = React.createContext(null);
608
679
  const overIndex = overAttr != null ? parseInt(overAttr, 10) : null;
609
680
  // if we know which index we're over, update visual state
610
681
  if (overIndex !== null) {
611
- context.setDragOver(overIndex);
682
+ context?.setDragOver(overIndex);
612
683
  }
613
684
  } else if (touchTimerRef.current) {
614
685
  clearTimeout(touchTimerRef.current);
@@ -623,10 +694,10 @@ const DragContext = React.createContext(null);
623
694
  clearTimeout(touchTimerRef.current);
624
695
  touchTimerRef.current = null;
625
696
  }
626
- if (context.isDragging) {
627
- context.drop(dragOver);
697
+ if (context?.isDragging) {
698
+ context?.drop(dragOver);
628
699
  vibrate(50);
629
- context.setIsDragging(false);
700
+ context?.setIsDragging(false);
630
701
  document.body.style.overflow = 'auto';
631
702
  }
632
703
  };
@@ -637,35 +708,35 @@ const DragContext = React.createContext(null);
637
708
  const isVertical = orientation === ORIENTATION.VERTICAL;
638
709
  const moveUp = isVertical ? 'ArrowUp' : 'ArrowLeft';
639
710
  const moveDown = isVertical ? 'ArrowDown' : 'ArrowRight';
640
- const isGrabbed = context.isDragging && context.startIndex === index;
711
+ const isGrabbed = context?.isDragging && context?.startIndex === index;
641
712
  // Space to grab/drop
642
713
  if (e.key === ' ' || e.key === 'Spacebar') {
643
714
  e.preventDefault();
644
715
  if (isGrabbed) {
645
716
  // Drop at current position
646
- context.drop(index);
647
- setAnnouncement(context.i18n.replacePlaceholders(context.i18n.droppedAnnouncementTemplate, {
717
+ context?.drop(index);
718
+ setAnnouncement(context?.i18n.replacePlaceholders(context?.i18n.droppedAnnouncementTemplate, {
648
719
  position: index + 1
649
720
  }));
650
721
  } else {
651
722
  // Grab item
652
- context.startGrab(index);
653
- setAnnouncement(context.i18n.replacePlaceholders(context.i18n.grabbedAnnouncementTemplate, {
723
+ context?.startGrab(index);
724
+ setAnnouncement(context?.i18n.replacePlaceholders(context?.i18n.grabbedAnnouncementTemplate, {
654
725
  position: index + 1
655
726
  }));
656
727
  }
657
728
  } else if (e.key === 'Enter' && isGrabbed) {
658
729
  e.preventDefault();
659
- context.drop(index);
660
- setAnnouncement(context.i18n.replacePlaceholders(context.i18n.droppedAnnouncementTemplate, {
730
+ context?.drop(index);
731
+ setAnnouncement(context?.i18n.replacePlaceholders(context?.i18n.droppedAnnouncementTemplate, {
661
732
  position: index + 1
662
733
  }));
663
734
  } else if (e.key === 'Escape' && isGrabbed) {
664
735
  e.preventDefault();
665
- context.cancel();
666
- setAnnouncement(context.i18n.cancelledAnnouncementTemplate);
736
+ context?.cancel();
737
+ setAnnouncement(context?.i18n.cancelledAnnouncementTemplate);
667
738
  } else if (isGrabbed) {
668
- if (e.key === moveUp && index > 0) {
739
+ if (e.key === moveUp && index > 0 && context.startIndex !== null) {
669
740
  e.preventDefault();
670
741
  // Move without dropping - just reorder and update startIndex
671
742
  const newIndex = index - 1;
@@ -674,7 +745,7 @@ const DragContext = React.createContext(null);
674
745
  setAnnouncement(context.i18n.replacePlaceholders(context.i18n.movedAnnouncementTemplate, {
675
746
  position: newIndex + 1
676
747
  }));
677
- } else if (e.key === moveDown && index < totalItems - 1) {
748
+ } else if (e.key === moveDown && index < totalItems - 1 && context.startIndex !== null) {
678
749
  e.preventDefault();
679
750
  // Move without dropping - just reorder and update startIndex
680
751
  const newIndex = index + 1;
@@ -696,30 +767,30 @@ const DragContext = React.createContext(null);
696
767
  };
697
768
  }, []);
698
769
  /** Update active state based on dragOver changes */ React.useEffect(()=>{
699
- if (context.isDragging && dragOver === index) {
700
- setActive(context.startIndex - index);
770
+ if (context?.isDragging && context?.startIndex !== null && dragOver === index) {
771
+ setActive(context?.startIndex - index);
701
772
  } else {
702
773
  setActive(0);
703
774
  }
704
775
  }, [
705
776
  dragOver,
706
- context.startIndex,
777
+ context?.startIndex,
707
778
  index,
708
- context.isDragging
779
+ context?.isDragging
709
780
  ]);
710
781
  return /*#__PURE__*/ jsxRuntime.jsxs(Item, {
711
782
  draggable: !showIndicator,
712
783
  showIndicator: showIndicator,
713
784
  active: active,
714
- dragging: context.isDragging && context.startIndex === index,
785
+ dragging: !!(context?.isDragging && context.startIndex === index),
715
786
  orientation: orientation,
716
787
  "data-drag-index": index,
717
788
  tabIndex: 0,
718
789
  role: "listitem",
719
- "aria-label": context.i18n.replacePlaceholders(context.i18n.itemAriaLabelTemplate, {
790
+ "aria-label": context?.i18n.replacePlaceholders(context.i18n.itemAriaLabelTemplate, {
720
791
  position: index + 1
721
792
  }),
722
- "aria-grabbed": context.isDragging && context.startIndex === index,
793
+ "aria-grabbed": context?.isDragging && context.startIndex === index,
723
794
  onKeyDown: handleKeyDown,
724
795
  onDragStart: !showIndicator ? dragStartHandler : undefined,
725
796
  onDragOver: dragOverHandler,
@@ -733,7 +804,7 @@ const DragContext = React.createContext(null);
733
804
  showIndicator && /*#__PURE__*/ jsxRuntime.jsx(DragKnob, {
734
805
  draggable: true,
735
806
  role: "button",
736
- "aria-label": context.i18n.dragHandleAriaLabel,
807
+ "aria-label": context?.i18n.dragHandleAriaLabel,
737
808
  onDragStart: dragStartHandler,
738
809
  onTouchStart: touchStartHandler,
739
810
  onKeyDown: handleKeyDown,
@@ -748,11 +819,11 @@ const DragContext = React.createContext(null);
748
819
  }
749
820
 
750
821
  /** Container Component */ const Container$6 = /*#__PURE__*/ styled("div", {
751
- target: "emx1u4x0",
822
+ target: "e18d6tqk0",
752
823
  label: "Container"
753
824
  })("flex:1;display:flex;position:relative;flex-wrap:wrap;flex-direction:", (props)=>props.orientation === ORIENTATION.HORIZONTAL ? 'row' : 'column', ";");
754
825
  /** Visually hidden but accessible to screen readers */ const VisuallyHidden$2 = /*#__PURE__*/ styled("div", {
755
- target: "emx1u4x1",
826
+ target: "e18d6tqk1",
756
827
  label: "VisuallyHidden"
757
828
  })("position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;");
758
829
  /**
@@ -772,15 +843,19 @@ const DragContext = React.createContext(null);
772
843
  * </DragAndDrop>
773
844
  * ```
774
845
  *
775
- * @param {DragAndDropProps} props - The component props
776
- * @param {ORIENTATION} props.orientation - Determines the layout direction (horizontal or vertical). Defaults to VERTICAL.
777
- * @param {(start: number, end: number) => void} props.onDrop - Callback fired when an item is dropped, receives the start and end indices
778
- * @param {boolean} props.showIndicator - Whether to display drag indicators for each list item. Defaults to false.
779
- * @param {React.ReactNode} props.children - Child elements to be rendered as draggable items
846
+ * @param props - The component props
847
+ * @param props.orientation - Determines the layout direction (horizontal or vertical). Defaults to VERTICAL.
848
+ * @param props.onDrop - Callback fired when an item is dropped, receives the start and end indices
849
+ * @param props.showIndicator - Whether to display drag indicators for each list item. Defaults to false.
850
+ * @param props.children - Child elements to be rendered as draggable items
780
851
  *
781
- * @returns {JSX.Element} A draggable container with reorderable items
782
- */ function DragAndDrop(props) {
783
- const { orientation, children, onDrop, showIndicator, itemAriaLabelTemplate, dragHandleAriaLabel, grabbedAnnouncementTemplate, movedAnnouncementTemplate, droppedAnnouncementTemplate, cancelledAnnouncementTemplate } = props;
852
+ * @returns A draggable container with reorderable items
853
+ */ /**
854
+ * DragAndDrop Component
855
+ * @param props - Component props
856
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
857
+ */ function DragAndDropComponent(props, ref) {
858
+ const { orientation = ORIENTATION.VERTICAL, children, onDrop, showIndicator = false, itemAriaLabelTemplate = 'Item {:position}. Press {:grabKey} to grab, {:moveKeys} to move, {:dropKey} or {:altDropKey} to drop', dragHandleAriaLabel = 'Drag to reorder', grabbedAnnouncementTemplate = 'Item {:position} grabbed. Use {:moveKeys} to move, {:dropKey} or {:altDropKey} to drop, {:cancelKey} to cancel', movedAnnouncementTemplate = 'Item moved to position {:position}', droppedAnnouncementTemplate = 'Item dropped at position {:position}', cancelledAnnouncementTemplate = 'Drag cancelled, item restored to original position', ...rest } = props;
784
859
  const [startIndex, setStartIndex] = React.useState(null);
785
860
  const [originalIndex, setOriginalIndex] = React.useState(null);
786
861
  const [isDragging, setIsDragging] = React.useState(false);
@@ -807,7 +882,7 @@ const DragContext = React.createContext(null);
807
882
  * Drop handler invoked when a draggable item is released.
808
883
  * @param index
809
884
  */ const drop = (index)=>{
810
- if (startIndex !== null) {
885
+ if (startIndex !== null && index !== null) {
811
886
  onDrop?.(startIndex, index);
812
887
  }
813
888
  setStartIndex(null);
@@ -847,6 +922,8 @@ const DragContext = React.createContext(null);
847
922
  i18n
848
923
  },
849
924
  children: /*#__PURE__*/ jsxRuntime.jsx(Container$6, {
925
+ ...rest,
926
+ ref: ref,
850
927
  orientation: orientation,
851
928
  role: "list",
852
929
  children: React.Children.map(childrenArray, (child, index)=>/*#__PURE__*/ jsxRuntime.jsx(DragItem, {
@@ -869,20 +946,11 @@ const DragContext = React.createContext(null);
869
946
  ]
870
947
  });
871
948
  }
872
- DragAndDrop.defaultProps = {
873
- /** Orientation of the list layout */ orientation: ORIENTATION.VERTICAL,
874
- /** Whether to display drag indicators for each list item */ showIndicator: false,
875
- /** Default item aria-label template */ itemAriaLabelTemplate: 'Item {:position}. Press {:grabKey} to grab, {:moveKeys} to move, {:dropKey} or {:altDropKey} to drop',
876
- /** Default drag handle aria-label */ dragHandleAriaLabel: 'Drag to reorder',
877
- /** Default grabbed announcement template */ grabbedAnnouncementTemplate: 'Item {:position} grabbed. Use {:moveKeys} to move, {:dropKey} or {:altDropKey} to drop, {:cancelKey} to cancel',
878
- /** Default moved announcement template */ movedAnnouncementTemplate: 'Item moved to position {:position}',
879
- /** Default dropped announcement template */ droppedAnnouncementTemplate: 'Item dropped at position {:position}',
880
- /** Default cancelled announcement template */ cancelledAnnouncementTemplate: 'Drag cancelled, item restored to original position'
881
- };
949
+ const DragAndDrop = /*#__PURE__*/ React.forwardRef(DragAndDropComponent);
882
950
 
883
951
  // Label component for the ChipInput
884
952
  const Label$6 = /*#__PURE__*/ styled("label", {
885
- target: "ey9yju70",
953
+ target: "e12jan4z0",
886
954
  label: "Label"
887
955
  })("display:inline-flex;flex-direction:column;flex:1;position:relative;margin:10px 5px;color:inherit;padding:0 8px;width:250px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";&:has(:focus),&:has(:active){border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:has(:focus) > span,&:has(:active) > span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:has(:disabled){border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:has(:disabled) > span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:has(:focus:invalid){border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
888
956
  &:has(:invalid) {
@@ -898,7 +966,11 @@ const Label$6 = /*#__PURE__*/ styled("label", {
898
966
  & > span {
899
967
  color: ${getThemeValue(THEME_NAME.ERROR)};
900
968
  }
901
- ` : '', " \n &:has(:required) > span:after{content:'*';margin-left:2px;color:", getThemeValue(THEME_NAME.ERROR), ";}& > input{border:none;outline:none;line-height:30px;min-height:30px;max-width:95%;}& > span{position:absolute;padding:0 5px;top:0px;left:4px;font-size:14px;line-height:32px;transition:all 300ms ease;}&:has(:focus) > span,&:has(:placeholder-shown) > span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}", (props)=>props.text !== '' ? `
969
+ ` : '', " \n ", (props)=>props.required ? `& > span:after {
970
+ content: '*';
971
+ margin-left: 2px;
972
+ color: ${getThemeValue(THEME_NAME.ERROR)};
973
+ }` : '', " \n\n & > input{border:none;outline:none;line-height:30px;min-height:30px;max-width:95%;}& > span{position:absolute;padding:0 5px;top:0px;left:4px;font-size:14px;line-height:32px;transition:all 300ms ease;}&:has(:focus) > span,&:has(:placeholder-shown) > span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}", (props)=>props.text !== '' ? `
902
974
  & > span {
903
975
  top: -8px;
904
976
  background: ${getThemeValue(THEME_NAME.BACKGROUND)};
@@ -908,12 +980,12 @@ const Label$6 = /*#__PURE__*/ styled("label", {
908
980
  ` : '');
909
981
  // Error message container
910
982
  const ErrorContainer$4 = /*#__PURE__*/ styled("div", {
911
- target: "ey9yju71",
983
+ target: "e12jan4z1",
912
984
  label: "ErrorContainer"
913
985
  })("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
914
986
  // Visually hidden but accessible to screen readers
915
987
  const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
916
- target: "ey9yju72",
988
+ target: "e12jan4z2",
917
989
  label: "VisuallyHidden"
918
990
  })("position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;& li{list-style:none;}");
919
991
  /**
@@ -928,26 +1000,35 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
928
1000
  * errorText="At least one tag is required"
929
1001
  * />
930
1002
  * ```
931
- */ function ChipInput(props) {
1003
+ */ function ChipInputComponent(props, ref) {
1004
+ const { value: propValue = [], closeButtonAriaLabel = `Remove {:label}`, addedAnnouncementTemplate = '{:label} was added', removedAnnouncementTemplate = '{:label} was removed' } = props;
932
1005
  const [text, setText] = React.useState('');
933
1006
  const [touched, setTouched] = React.useState(false);
934
- const [value, setValue] = React.useState(props.value || []);
1007
+ const [value, setValue] = React.useState(propValue || []);
935
1008
  const InputRef = React.useRef(null);
936
1009
  const [announcement, setAnnouncement] = React.useState('');
937
1010
  const errorId = React.useId();
1011
+ // Forward the underlying input element.
1012
+ React.useImperativeHandle(ref, ()=>InputRef.current);
938
1013
  /**
939
1014
  * Replace {:label} placeholder in template string
940
1015
  */ const replacePlaceholder = (template, label)=>{
941
1016
  if (!template) return undefined;
942
1017
  return template.replace(/\{:label\}/g, label);
943
1018
  };
1019
+ const prevPropValueRef = React.useRef(undefined);
944
1020
  // Sync internal value with props.value
945
1021
  React.useEffect(()=>{
946
- if (Array.isArray(props.value)) {
947
- setValue(props.value);
1022
+ if (Array.isArray(propValue)) {
1023
+ const prevValue = prevPropValueRef.current;
1024
+ const isEqual = prevValue && propValue.length === prevValue.length && propValue.every((val, index)=>val === prevValue[index]);
1025
+ if (!isEqual) {
1026
+ setValue(propValue);
1027
+ prevPropValueRef.current = propValue;
1028
+ }
948
1029
  }
949
1030
  }, [
950
- props.value
1031
+ propValue
951
1032
  ]);
952
1033
  /**
953
1034
  * Update the chip values and notify changes.
@@ -976,14 +1057,14 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
976
1057
  * Adds a new chip on Enter key press.
977
1058
  * @param e React keyboard event
978
1059
  */ const handleKeyUp = (e)=>{
979
- if (e.key === 'Enter' && text.trim() !== '' && InputRef.current.validity.valid) {
1060
+ if (e.key === 'Enter' && text.trim() !== '' && InputRef.current?.validity.valid) {
980
1061
  const newValue = [
981
1062
  ...value,
982
1063
  text.trim()
983
1064
  ];
984
1065
  updateValue(newValue);
985
1066
  setText('');
986
- setAnnouncement(replacePlaceholder(props.addedAnnouncementTemplate, text.trim()));
1067
+ setAnnouncement(replacePlaceholder(addedAnnouncementTemplate, text.trim()));
987
1068
  }
988
1069
  };
989
1070
  /**
@@ -992,7 +1073,7 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
992
1073
  */ const removeChip = (chipToRemove)=>{
993
1074
  const newValue = value.filter((chip)=>chip !== chipToRemove);
994
1075
  updateValue(newValue);
995
- setAnnouncement(replacePlaceholder(props.removedAnnouncementTemplate, chipToRemove));
1076
+ setAnnouncement(replacePlaceholder(removedAnnouncementTemplate, chipToRemove));
996
1077
  };
997
1078
  /**
998
1079
  * Moves a chip from one position to another.
@@ -1017,6 +1098,7 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
1017
1098
  text: text,
1018
1099
  touched: touched,
1019
1100
  errorText: props.errorText,
1101
+ required: props.required,
1020
1102
  children: [
1021
1103
  /*#__PURE__*/ jsxRuntime.jsx("input", {
1022
1104
  ...props,
@@ -1037,7 +1119,7 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
1037
1119
  children: value.map((chip)=>/*#__PURE__*/ jsxRuntime.jsx(Chip, {
1038
1120
  label: chip,
1039
1121
  onCloseClick: ()=>removeChip(chip),
1040
- closeButtonAriaLabel: replacePlaceholder(props.closeButtonAriaLabel, chip)
1122
+ closeButtonAriaLabel: replacePlaceholder(closeButtonAriaLabel, chip)
1041
1123
  }, chip))
1042
1124
  })
1043
1125
  }),
@@ -1058,21 +1140,7 @@ const VisuallyHidden$1 = /*#__PURE__*/ styled("ul", {
1058
1140
  ]
1059
1141
  });
1060
1142
  }
1061
- ChipInput.propTypes = {
1062
- /** Label for the field */ label: PropTypes.string.isRequired,
1063
- /** Error message for the field */ errorText: PropTypes.string,
1064
- /** Values to display as chips */ value: PropTypes.arrayOf(PropTypes.string),
1065
- /** Callback when chips change */ onChange: PropTypes.func,
1066
- /** Aria label for the close button on chip. Defaults to "Remove {label}" */ closeButtonAriaLabel: PropTypes.string,
1067
- /** Announcement text when a chip is added. Defaults to "{label} was added" */ addedAnnouncementTemplate: PropTypes.string,
1068
- /** Announcement text when a chip is removed. Defaults to "{label} was removed" */ removedAnnouncementTemplate: PropTypes.string
1069
- };
1070
- ChipInput.defaultProps = {
1071
- value: [],
1072
- closeButtonAriaLabel: 'Remove {:label}',
1073
- addedAnnouncementTemplate: '{:label} was added',
1074
- removedAnnouncementTemplate: '{:label} was removed'
1075
- };
1143
+ const ChipInput = /*#__PURE__*/ React.forwardRef(ChipInputComponent);
1076
1144
 
1077
1145
  /** Enums for layer position on screen. */ var LAYER_POSITION = /*#__PURE__*/ function(LAYER_POSITION) {
1078
1146
  LAYER_POSITION[LAYER_POSITION["TOP_LEFT"] = 0] = "TOP_LEFT";
@@ -1103,7 +1171,7 @@ ChipInput.defaultProps = {
1103
1171
  [6]: 'top: 0; left: 0; justify-content: center; align-items: center;'
1104
1172
  };
1105
1173
  /** Layer container component. */ const Container$5 = /*#__PURE__*/ styled("div", {
1106
- target: "euaj5y50",
1174
+ target: "erw6k0c0",
1107
1175
  label: "Container"
1108
1176
  })("position:fixed;display:flex;opacity:0;transition:opacity 0.3s ease;", (props)=>POSITION_STYLE[props.position], " ", (props)=>props.overlay && `
1109
1177
  width: 100%;
@@ -1158,7 +1226,7 @@ ChipInput.defaultProps = {
1158
1226
  * react to esc key press.
1159
1227
  */ constructor(){
1160
1228
  /** Layer stack */ this.layers = [];
1161
- /** z-index of the next layer */ this.nextIndex = 10000;
1229
+ /** z-index of the next layer */ this.nextIndex = 0;
1162
1230
  this.timeoutIds = new Map(); // Track timeouts
1163
1231
  // Add cleanup method
1164
1232
  this.destroy = ()=>{
@@ -1194,14 +1262,21 @@ ChipInput.defaultProps = {
1194
1262
  this.timeoutIds.delete(layer.id);
1195
1263
  try {
1196
1264
  layer.config.closeCallback?.(resp);
1197
- } catch (e) {
1198
- console.warn(e.message);
1265
+ } catch (err) {
1266
+ if (err instanceof Error) {
1267
+ console.warn(err.message);
1268
+ } else {
1269
+ console.warn(err);
1270
+ }
1199
1271
  }
1200
1272
  // Clear reference to help GC
1201
1273
  layer.config.component = null;
1202
1274
  }, layer.config.exitDelay);
1203
1275
  this.timeoutIds.set(layer.id, timeoutId);
1204
1276
  };
1277
+ this.Empty = ()=>{
1278
+ return null;
1279
+ };
1205
1280
  /**
1206
1281
  * Renders a layer.
1207
1282
  * @param config
@@ -1209,7 +1284,7 @@ ChipInput.defaultProps = {
1209
1284
  // SSR guard
1210
1285
  if (typeof document === 'undefined') {
1211
1286
  return [
1212
- ()=>null,
1287
+ /*#__PURE__*/ React.forwardRef(this.Empty),
1213
1288
  ()=>{}
1214
1289
  ];
1215
1290
  }
@@ -1219,10 +1294,12 @@ ChipInput.defaultProps = {
1219
1294
  ...config
1220
1295
  };
1221
1296
  // Get the z-index for the new layer
1222
- const currentIndex = layerConfig.alwaysOnTop ? 2147483647 : this.nextIndex++;
1297
+ const currentIndex = layerConfig.alwaysOnTop ? 2147483647 : 10000 + this.nextIndex;
1223
1298
  const className = layerConfig.alwaysOnTop ? 'nf-layer-manager-top' : 'nf-layer-manager';
1224
1299
  // Create a unique ID for tracking this layer
1225
- const layerId = `nf-layer-manager-${currentIndex}`;
1300
+ const layerId = `${className}-${currentIndex + this.nextIndex}`;
1301
+ // Always increment for next layer
1302
+ this.nextIndex += 1;
1226
1303
  const overlayClickHandler = ()=>{
1227
1304
  const layer = this.layers.find((l)=>l.id === layerId);
1228
1305
  if (layer && layer.config.closeOnOverlayClick !== false) {
@@ -1235,105 +1312,108 @@ ChipInput.defaultProps = {
1235
1312
  this.unmount(layer, resp);
1236
1313
  }
1237
1314
  };
1238
- // Return callback which will trigger the un-mount.
1239
- return [
1240
- ()=>{
1241
- const [divElement, setDivElement] = React.useState(null);
1242
- React.useEffect(()=>{
1243
- // Create the div element only once when component mounts
1244
- const div = document.createElement('div');
1245
- div.setAttribute('class', className);
1246
- div.setAttribute('id', layerId);
1247
- document.body.appendChild(div);
1248
- // Add layer to stack
1249
- const currentLayer = {
1250
- id: layerId,
1251
- config: layerConfig,
1252
- element: div
1253
- };
1254
- this.layers.push(currentLayer);
1255
- setDivElement(div);
1256
- // Add entry animation class after a short delay
1257
- setTimeout(()=>{
1258
- div.setAttribute('class', 'nf-layer-enter');
1259
- }, 10);
1260
- // Track elements modified for accessibility
1261
- const modifiedElements = [];
1262
- let originalBodyOverflow = null;
1263
- let originalBodyPosition = null;
1264
- let originalBodyWidth = null;
1265
- let originalBodyTop = null;
1266
- let scrollY = 0;
1267
- // Apply aria-hidden to siblings and body scroll lock for overlay modals
1268
- if (layerConfig.overlay) {
1269
- // Hide all body children except this layer portal, scripts, and styles
1270
- const bodyChildren = Array.from(document.body.children);
1271
- bodyChildren.forEach((child)=>{
1272
- if (child !== div && child.className !== 'nf-layer-manager-top' && child.tagName !== 'SCRIPT' && child.tagName !== 'STYLE') {
1273
- const hadAriaHidden = child.hasAttribute('aria-hidden');
1274
- const previousValue = child.getAttribute('aria-hidden');
1275
- // Only set aria-hidden if not already hidden
1276
- if (previousValue !== 'true') {
1277
- child.setAttribute('aria-hidden', 'true');
1278
- modifiedElements.push({
1279
- element: child,
1280
- hadAriaHidden,
1281
- previousValue
1282
- });
1283
- }
1315
+ const LayerContainer = (props, ref)=>{
1316
+ const [divElement, setDivElement] = React.useState(null);
1317
+ React.useEffect(()=>{
1318
+ // Create the div element only once when component mounts
1319
+ const div = document.createElement('div');
1320
+ div.setAttribute('class', className);
1321
+ div.setAttribute('id', layerId);
1322
+ document.body.appendChild(div);
1323
+ // Add layer to stack
1324
+ const currentLayer = {
1325
+ id: layerId,
1326
+ config: layerConfig,
1327
+ element: div
1328
+ };
1329
+ this.layers.push(currentLayer);
1330
+ setDivElement(div);
1331
+ // Add entry animation class after a short delay
1332
+ setTimeout(()=>{
1333
+ div.setAttribute('class', 'nf-layer-enter');
1334
+ }, 10);
1335
+ // Track elements modified for accessibility
1336
+ const modifiedElements = [];
1337
+ let originalBodyOverflow = null;
1338
+ let originalBodyPosition = null;
1339
+ let originalBodyWidth = null;
1340
+ let originalBodyTop = null;
1341
+ let scrollY = 0;
1342
+ // Apply aria-hidden to siblings and body scroll lock for overlay modals
1343
+ if (layerConfig.overlay) {
1344
+ // Hide all body children except this layer portal, scripts, and styles
1345
+ const bodyChildren = Array.from(document.body.children);
1346
+ bodyChildren.forEach((child)=>{
1347
+ if (child !== div && child.className !== 'nf-layer-manager-top' && child.tagName !== 'SCRIPT' && child.tagName !== 'STYLE') {
1348
+ const hadAriaHidden = child.hasAttribute('aria-hidden');
1349
+ const previousValue = child.getAttribute('aria-hidden');
1350
+ // Only set aria-hidden if not already hidden
1351
+ if (previousValue !== 'true') {
1352
+ child.setAttribute('aria-hidden', 'true');
1353
+ modifiedElements.push({
1354
+ element: child,
1355
+ hadAriaHidden,
1356
+ previousValue
1357
+ });
1284
1358
  }
1285
- });
1286
- // Prevent body scroll on iOS
1287
- scrollY = window.scrollY;
1288
- originalBodyOverflow = document.body.style.overflow;
1289
- originalBodyPosition = document.body.style.position;
1290
- originalBodyWidth = document.body.style.width;
1291
- originalBodyTop = document.body.style.top;
1292
- document.body.style.overflow = 'hidden';
1293
- document.body.style.position = 'fixed';
1294
- document.body.style.width = '100%';
1295
- document.body.style.top = `-${scrollY}px`;
1296
- }
1297
- // Cleanup function - remove div when component unmounts
1298
- return ()=>{
1299
- // Restore aria-hidden attributes
1300
- modifiedElements.forEach(({ element, hadAriaHidden, previousValue })=>{
1301
- if (document.body.contains(element)) {
1302
- if (hadAriaHidden && previousValue !== null) {
1303
- element.setAttribute('aria-hidden', previousValue);
1304
- } else {
1305
- element.removeAttribute('aria-hidden');
1306
- }
1307
- }
1308
- });
1309
- // Restore body scroll
1310
- if (layerConfig.overlay) {
1311
- document.body.style.overflow = originalBodyOverflow || '';
1312
- document.body.style.position = originalBodyPosition || '';
1313
- document.body.style.width = originalBodyWidth || '';
1314
- document.body.style.top = originalBodyTop || '';
1315
- window.scrollTo(0, scrollY);
1316
- }
1317
- if (document.body.contains(div)) {
1318
- document.body.removeChild(div);
1319
1359
  }
1320
- // Remove from layers array
1321
- const index = this.layers.findIndex((layer)=>layer.id === layerId);
1322
- if (index !== -1) {
1323
- this.layers.splice(index, 1);
1324
- }
1325
- };
1326
- }, []); // Empty dependency array - run only once
1327
- if (!divElement) {
1328
- return null;
1360
+ });
1361
+ // Prevent body scroll on iOS
1362
+ scrollY = window.scrollY;
1363
+ originalBodyOverflow = document.body.style.overflow;
1364
+ originalBodyPosition = document.body.style.position;
1365
+ originalBodyWidth = document.body.style.width;
1366
+ originalBodyTop = document.body.style.top;
1367
+ document.body.style.overflow = 'hidden';
1368
+ document.body.style.position = 'fixed';
1369
+ document.body.style.width = '100%';
1370
+ document.body.style.top = `-${scrollY}px`;
1329
1371
  }
1330
- return /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ jsxRuntime.jsx(Container$5, {
1331
- onClick: overlayClickHandler,
1332
- zIndex: currentIndex,
1333
- ...layerConfig,
1334
- children: layerConfig.component
1335
- }), divElement);
1336
- },
1372
+ // Cleanup function - remove div when component unmounts
1373
+ return ()=>{
1374
+ // Restore aria-hidden attributes
1375
+ modifiedElements.forEach(({ element, hadAriaHidden, previousValue })=>{
1376
+ if (document.body.contains(element)) {
1377
+ if (hadAriaHidden && previousValue !== null) {
1378
+ element.setAttribute('aria-hidden', previousValue);
1379
+ } else {
1380
+ element.removeAttribute('aria-hidden');
1381
+ }
1382
+ }
1383
+ });
1384
+ // Restore body scroll
1385
+ if (layerConfig.overlay) {
1386
+ document.body.style.overflow = originalBodyOverflow || '';
1387
+ document.body.style.position = originalBodyPosition || '';
1388
+ document.body.style.width = originalBodyWidth || '';
1389
+ document.body.style.top = originalBodyTop || '';
1390
+ window.scrollTo(0, scrollY);
1391
+ }
1392
+ if (document.body.contains(div)) {
1393
+ document.body.removeChild(div);
1394
+ }
1395
+ // Remove from layers array
1396
+ const index = this.layers.findIndex((layer)=>layer.id === layerId);
1397
+ if (index !== -1) {
1398
+ this.layers.splice(index, 1);
1399
+ }
1400
+ };
1401
+ }, []); // Empty dependency array - run only once
1402
+ if (!divElement) {
1403
+ return null;
1404
+ }
1405
+ return /*#__PURE__*/ reactDom.createPortal(/*#__PURE__*/ jsxRuntime.jsx(Container$5, {
1406
+ ...props,
1407
+ ref: ref,
1408
+ onClick: overlayClickHandler,
1409
+ zIndex: currentIndex,
1410
+ ...layerConfig,
1411
+ children: layerConfig.component
1412
+ }), divElement);
1413
+ };
1414
+ // Return callback which will trigger the un-mount.
1415
+ return [
1416
+ /*#__PURE__*/ React.forwardRef(LayerContainer),
1337
1417
  closeFn
1338
1418
  ];
1339
1419
  };
@@ -1355,7 +1435,7 @@ ChipInput.defaultProps = {
1355
1435
  var LayerManager$1 = new LayerManager();
1356
1436
 
1357
1437
  const DialogContainer = /*#__PURE__*/ styled(Card, {
1358
- target: "ej4fpry0",
1438
+ target: "e1sxvvof0",
1359
1439
  label: "DialogContainer"
1360
1440
  })("max-width:768px;max-height:80vh;transform:scale(0);opacity:0;transition:all 0.3s ease;.nf-layer-enter &{opacity:1;transform:scale(1);}.nf-layer-exit &{opacity:0;transform:scale(0);}");
1361
1441
  class Dialog extends React.Component {
@@ -1380,7 +1460,7 @@ class Dialog extends React.Component {
1380
1460
  }
1381
1461
  }
1382
1462
  constructor(...args){
1383
- super(...args), this.lastFocusedElement = null, this.dialogRef = /*#__PURE__*/ React.createRef(), this.state = {
1463
+ super(...args), this.closeDialog = null, this.onCloseFn = null, this.lastFocusedElement = null, this.dialogRef = /*#__PURE__*/ React.createRef(), this.state = {
1384
1464
  show: false,
1385
1465
  LayerComponent: undefined
1386
1466
  }, /**
@@ -1429,6 +1509,13 @@ class Dialog extends React.Component {
1429
1509
  if (node) {
1430
1510
  this.setInitialFocus(node);
1431
1511
  }
1512
+ if (this.props.forwardRef) {
1513
+ if (typeof this.props.forwardRef === 'function') {
1514
+ this.props.forwardRef(node);
1515
+ } else {
1516
+ this.props.forwardRef.current = node;
1517
+ }
1518
+ }
1432
1519
  }, /**
1433
1520
  * Sets initial focus within the dialog.
1434
1521
  * Tries to focus the header first, then the first interactive element, or falls back to the container.
@@ -1459,9 +1546,9 @@ class Dialog extends React.Component {
1459
1546
  closeOnOverlayClick,
1460
1547
  position: LAYER_POSITION.DIALOG,
1461
1548
  component: /*#__PURE__*/ jsxRuntime.jsx(DialogContainer, {
1549
+ role: "dialog",
1462
1550
  ...rest,
1463
1551
  ref: this.setDialogRef,
1464
- role: "dialog",
1465
1552
  "aria-modal": "true",
1466
1553
  tabIndex: -1,
1467
1554
  onKeyDown: this.handleKeyDown,
@@ -1475,7 +1562,7 @@ class Dialog extends React.Component {
1475
1562
  show: true,
1476
1563
  LayerComponent: Component
1477
1564
  });
1478
- this.onCloseFn = closeCallback;
1565
+ this.onCloseFn = closeCallback ?? null;
1479
1566
  }, this.close = (resp)=>{
1480
1567
  this.closeDialog?.(resp);
1481
1568
  }, this.closeCallback = (resp)=>{
@@ -1488,10 +1575,6 @@ class Dialog extends React.Component {
1488
1575
  };
1489
1576
  }
1490
1577
  }
1491
- Dialog.propTypes = {
1492
- /** Flag to close dialog on `esc` click. Default value is true. */ closeOnEsc: PropTypes.bool,
1493
- /** Close layer overlay is clicked. Default value is true. */ closeOnOverlayClick: PropTypes.bool
1494
- };
1495
1578
  Dialog.defaultProps = {
1496
1579
  closeOnEsc: true,
1497
1580
  closeOnOverlayClick: true
@@ -1520,7 +1603,7 @@ class AlertDialog extends React.Component {
1520
1603
  children: this.props.body
1521
1604
  }),
1522
1605
  /*#__PURE__*/ jsxRuntime.jsx(Footer$1, {
1523
- children: /*#__PURE__*/ jsxRuntime.jsx(StyledButton, {
1606
+ children: /*#__PURE__*/ jsxRuntime.jsx(Button$2, {
1524
1607
  onClick: this.close,
1525
1608
  children: this.props.buttonText
1526
1609
  })
@@ -1532,17 +1615,11 @@ class AlertDialog extends React.Component {
1532
1615
  super(...args), this.dialog = /*#__PURE__*/ React.createRef(), this.show = ()=>{
1533
1616
  return new Promise((resolve)=>{
1534
1617
  const onClose = ()=>resolve(null);
1535
- this.dialog.current.open(onClose);
1618
+ this.dialog.current?.open(onClose);
1536
1619
  });
1537
- }, this.close = ()=>this.dialog.current.close();
1620
+ }, this.close = ()=>this.dialog.current?.close();
1538
1621
  }
1539
1622
  }
1540
- AlertDialog.propTypes = {
1541
- /** Shown as header of the dialog */ header: PropTypes.string,
1542
- /** Rendered in the body. */ body: PropTypes.any.isRequired,
1543
- /** Accept button text, default value is `OK` */ buttonText: PropTypes.string,
1544
- /** props for the dialog */ dialogProps: PropTypes.object
1545
- };
1546
1623
  AlertDialog.defaultProps = {
1547
1624
  buttonText: 'OK'
1548
1625
  };
@@ -1564,7 +1641,7 @@ class ConfirmDialog extends React.Component {
1564
1641
  }),
1565
1642
  /*#__PURE__*/ jsxRuntime.jsxs(Footer$1, {
1566
1643
  children: [
1567
- /*#__PURE__*/ jsxRuntime.jsx(StyledButton, {
1644
+ /*#__PURE__*/ jsxRuntime.jsx(Button$2, {
1568
1645
  onClick: this.cancel,
1569
1646
  children: noText
1570
1647
  }),
@@ -1587,29 +1664,22 @@ class ConfirmDialog extends React.Component {
1587
1664
  reject();
1588
1665
  }
1589
1666
  };
1590
- this.dialog.current.open(onClose);
1667
+ this.dialog.current?.open(onClose);
1591
1668
  });
1592
- }, this.cancel = ()=>this.dialog.current.close(false), this.confirm = ()=>this.dialog.current.close(true);
1669
+ }, this.cancel = ()=>this.dialog.current?.close(false), this.confirm = ()=>this.dialog.current?.close(true);
1593
1670
  }
1594
1671
  }
1595
- ConfirmDialog.propTypes = {
1596
- /** Shown as header of the dialog */ header: PropTypes.string,
1597
- /** Rendered as body of the dialog */ body: PropTypes.string.isRequired,
1598
- /** Accept button text */ yesText: PropTypes.string,
1599
- /** Reject button text */ noText: PropTypes.string,
1600
- /** Props for the dialog */ dialogProps: PropTypes.object
1601
- };
1602
1672
  ConfirmDialog.defaultProps = {
1603
1673
  yesText: 'Yes',
1604
1674
  noText: 'No'
1605
1675
  };
1606
1676
 
1607
1677
  const Label$5 = /*#__PURE__*/ styled("label", {
1608
- target: "e1hw2ebx0",
1678
+ target: "el9i5v60",
1609
1679
  label: "Label"
1610
1680
  })("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
1611
1681
  const TextField$1 = /*#__PURE__*/ styled("input", {
1612
- target: "e1hw2ebx1",
1682
+ target: "el9i5v61",
1613
1683
  label: "TextField"
1614
1684
  })("outline:none;color:inherit;padding:0 8px;line-height:30px;min-height:30px;width:250px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";&:focus,&:active{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus + span,&:active + span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";padding:0 8px;}&:disabled + span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:focus:invalid{border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
1615
1685
  &:invalid {
@@ -1634,16 +1704,22 @@ const TextField$1 = /*#__PURE__*/ styled("input", {
1634
1704
  }
1635
1705
  ` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
1636
1706
  const ErrorContainer$3 = /*#__PURE__*/ styled("div", {
1637
- target: "e1hw2ebx2",
1707
+ target: "el9i5v62",
1638
1708
  label: "ErrorContainer"
1639
1709
  })("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
1640
- const Input$2 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
1710
+ /**
1711
+ * Input Component
1712
+ * @param props - Component props
1713
+ * @param ref - Ref forwarded to the underlying HTMLInputElement
1714
+ */ const Input$2 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
1641
1715
  const [touched, setTouched] = React.useState(false);
1642
1716
  const [value, setValue] = React.useState(props.value || '');
1643
1717
  const errorId = React.useId();
1718
+ const prevValueRef = React.useRef(undefined);
1644
1719
  React.useEffect(()=>{
1645
- if (props.value !== undefined) {
1720
+ if (props.value !== undefined && props.value !== prevValueRef.current) {
1646
1721
  setValue(props.value);
1722
+ prevValueRef.current = props.value;
1647
1723
  }
1648
1724
  }, [
1649
1725
  props.value
@@ -1686,17 +1762,13 @@ const Input$2 = /*#__PURE__*/ React.forwardRef((props, ref)=>{
1686
1762
  });
1687
1763
  });
1688
1764
  Input$2.displayName = 'Input';
1689
- Input$2.propTypes = {
1690
- /** Label for the field */ label: PropTypes.string,
1691
- /** Error text to be shown below the field */ errorText: PropTypes.string
1692
- };
1693
1765
 
1694
1766
  const Label$4 = /*#__PURE__*/ styled("label", {
1695
- target: "ee4amtm0",
1767
+ target: "e1j32tnv0",
1696
1768
  label: "Label"
1697
1769
  })("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;");
1698
1770
  const TextField = /*#__PURE__*/ styled("textarea", {
1699
- target: "ee4amtm1",
1771
+ target: "e1j32tnv1",
1700
1772
  label: "TextField"
1701
1773
  })("border:none;color:inherit;padding:8px;min-height:150px;min-width:250px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";&:focus,&:active{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus + span,&:active + span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:disabled + span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:focus:invalid{border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
1702
1774
  &:invalid {
@@ -1721,19 +1793,26 @@ const TextField = /*#__PURE__*/ styled("textarea", {
1721
1793
  }
1722
1794
  ` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
1723
1795
  const ErrorContainer$2 = /*#__PURE__*/ styled("div", {
1724
- target: "ee4amtm2",
1796
+ target: "e1j32tnv2",
1725
1797
  label: "ErrorContainer"
1726
1798
  })("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
1727
- function TextArea(props) {
1799
+ /**
1800
+ * TextArea Component
1801
+ * @param props - Component props
1802
+ * @param ref - Ref forwarded to the underlying HTMLTextAreaElement
1803
+ */ function TextAreaComponent(props, ref) {
1804
+ const { label, errorText, value: propsValue, required, ...rest } = props;
1728
1805
  const [touched, setTouched] = React.useState(false);
1729
- const [value, setValue] = React.useState(props.value || '');
1806
+ const [value, setValue] = React.useState(propsValue || '');
1730
1807
  const errorId = React.useId();
1808
+ const prevValueRef = React.useRef(undefined);
1731
1809
  React.useEffect(()=>{
1732
- if (props.value !== undefined) {
1733
- setValue(props.value);
1810
+ if (propsValue !== undefined && propsValue !== prevValueRef.current) {
1811
+ setValue(propsValue);
1812
+ prevValueRef.current = propsValue;
1734
1813
  }
1735
1814
  }, [
1736
- props.value
1815
+ propsValue
1737
1816
  ]);
1738
1817
  const handleFocus = (e)=>{
1739
1818
  setTouched(true);
@@ -1752,36 +1831,35 @@ function TextArea(props) {
1752
1831
  return /*#__PURE__*/ jsxRuntime.jsxs(Label$4, {
1753
1832
  children: [
1754
1833
  /*#__PURE__*/ jsxRuntime.jsx(TextField, {
1755
- ...props,
1834
+ ...rest,
1835
+ ref: ref,
1756
1836
  value: value,
1757
1837
  onChange: onChangeHandler,
1758
1838
  onFocus: handleFocus,
1759
1839
  touched: touched,
1760
- "aria-invalid": !!props.errorText,
1761
- "aria-required": props.required,
1762
- "aria-describedby": props.errorText ? errorId : undefined
1840
+ required: required,
1841
+ "aria-invalid": !!errorText,
1842
+ "aria-required": required,
1843
+ "aria-describedby": errorText ? errorId : undefined
1763
1844
  }),
1764
1845
  /*#__PURE__*/ jsxRuntime.jsx("span", {
1765
- children: props.label
1846
+ children: label
1766
1847
  }),
1767
- props.errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$2, {
1848
+ errorText && /*#__PURE__*/ jsxRuntime.jsx(ErrorContainer$2, {
1768
1849
  id: errorId,
1769
- children: props.errorText
1850
+ children: errorText
1770
1851
  })
1771
1852
  ]
1772
1853
  });
1773
1854
  }
1774
- TextArea.propTypes = {
1775
- /** Label for the field */ label: PropTypes.string,
1776
- /** Error text to be shown below the field */ errorText: PropTypes.string
1777
- };
1855
+ const TextArea = /*#__PURE__*/ React.forwardRef(TextAreaComponent);
1778
1856
 
1779
1857
  const Label$3 = /*#__PURE__*/ styled("label", {
1780
- target: "eao61d00",
1858
+ target: "e13b7jm0",
1781
1859
  label: "Label"
1782
1860
  })("display:inline-flex;flex-direction:column;position:relative;margin:10px 5px;pointer-events:none;max-width:268px;& svg{fill:currentColor;}");
1783
1861
  const SelectField = /*#__PURE__*/ styled("select", {
1784
- target: "eao61d01",
1862
+ target: "e13b7jm1",
1785
1863
  label: "SelectField"
1786
1864
  })("border:none;color:inherit;padding:0 8px;line-height:30px;min-height:32px;width:268px;border-radius:3px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";display:inline-block;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";pointer-events:auto;appearance:none;&:focus,&:active{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:focus ~ span,&:active ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED), ";}&:focus:invalid{border-color:", getThemeValue(THEME_NAME.ERROR), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.ERROR_LIGHT), ";}", (props)=>props.touched ? `
1787
1865
  &:invalid {
@@ -1806,20 +1884,26 @@ const SelectField = /*#__PURE__*/ styled("select", {
1806
1884
  }
1807
1885
  ` : '', " &:focus + span,&:placeholder-shown + span{top:-8px;background:", getThemeValue(THEME_NAME.BACKGROUND), ";font-size:12px;line-height:14px;}");
1808
1886
  const ErrorContainer$1 = /*#__PURE__*/ styled("div", {
1809
- target: "eao61d02",
1887
+ target: "e13b7jm2",
1810
1888
  label: "ErrorContainer"
1811
1889
  })("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;margin-left:3px;");
1812
1890
  const ArrowContainer$1 = /*#__PURE__*/ styled("span", {
1813
- target: "eao61d03",
1891
+ target: "e13b7jm3",
1814
1892
  label: "ArrowContainer"
1815
1893
  })("position:absolute;right:8px;top:8px;");
1816
- function Select(props) {
1894
+ /**
1895
+ * Select Component
1896
+ * @param props - Component props
1897
+ * @param ref - Ref forwarded to the underlying HTMLSelectElement
1898
+ */ function SelectComponent(props, ref) {
1817
1899
  const [touched, setTouched] = React.useState(false);
1818
1900
  const [value, setValue] = React.useState(props.value || '');
1819
1901
  const errorId = React.useId();
1902
+ const prevValueRef = React.useRef(undefined);
1820
1903
  React.useEffect(()=>{
1821
- if (props.value !== undefined) {
1904
+ if (props.value !== undefined && props.value !== prevValueRef.current) {
1822
1905
  setValue(props.value);
1906
+ prevValueRef.current = props.value;
1823
1907
  }
1824
1908
  }, [
1825
1909
  props.value
@@ -1842,6 +1926,7 @@ function Select(props) {
1842
1926
  children: [
1843
1927
  /*#__PURE__*/ jsxRuntime.jsxs(SelectField, {
1844
1928
  ...props,
1929
+ ref: ref,
1845
1930
  multiple: false,
1846
1931
  value: value,
1847
1932
  onChange: onChangeHandler,
@@ -1869,70 +1954,77 @@ function Select(props) {
1869
1954
  ]
1870
1955
  });
1871
1956
  }
1872
- Select.propTypes = {
1873
- /** Label for the field */ label: PropTypes.string,
1874
- /** Error text to be shown below the field */ errorText: PropTypes.string
1875
- };
1957
+ const Select = /*#__PURE__*/ React.forwardRef(SelectComponent);
1876
1958
 
1877
1959
  const Label$2 = /*#__PURE__*/ styled("label", {
1878
- target: "e16qfxit0",
1960
+ target: "e10ud8wb0",
1879
1961
  label: "Label"
1880
1962
  })("margin:5px 0;position:relative;display:inline-flex;align-items:center;cursor:pointer;");
1881
1963
  const StyledCheckmark = /*#__PURE__*/ styled("span", {
1882
- target: "e16qfxit1",
1964
+ target: "e10ud8wb1",
1883
1965
  label: "StyledCheckmark"
1884
1966
  })("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;}");
1885
1967
  const HiddenInput$1 = /*#__PURE__*/ styled("input", {
1886
- target: "e16qfxit2",
1968
+ target: "e10ud8wb2",
1887
1969
  label: "HiddenInput"
1888
1970
  })("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), ";}");
1889
- function Checkbox(props) {
1971
+ /**
1972
+ * Checkbox Component
1973
+ * @param props - Component props
1974
+ * @param fwdRef - Ref forwarded to the underlying HTMLInputElement
1975
+ */ function CheckboxComponent(props, fwdRef) {
1976
+ const { label = '', indeterminate = false, checked, ...rest } = props;
1890
1977
  const ref = React.useCallback((node)=>{
1891
- if (node !== null) {
1892
- if (props.indeterminate) {
1893
- node.indeterminate = true;
1894
- }
1978
+ // Ensure the DOM `indeterminate` flag always matches the prop
1979
+ if (node) {
1980
+ node.indeterminate = !!indeterminate;
1981
+ }
1982
+ // Forward the node (or null) to the parent ref (supports function or ref object)
1983
+ if (typeof fwdRef === 'function') {
1984
+ fwdRef(node);
1985
+ } else if (fwdRef) {
1986
+ fwdRef.current = node;
1895
1987
  }
1896
1988
  }, [
1897
- props.indeterminate
1989
+ indeterminate,
1990
+ fwdRef
1898
1991
  ]);
1899
1992
  return /*#__PURE__*/ jsxRuntime.jsxs(Label$2, {
1900
1993
  children: [
1901
1994
  /*#__PURE__*/ jsxRuntime.jsx(HiddenInput$1, {
1902
- ...props,
1995
+ ...rest,
1903
1996
  ref: ref,
1904
1997
  type: "checkbox",
1905
- "aria-checked": props.indeterminate ? 'mixed' : props.checked
1998
+ checked: checked,
1999
+ "aria-checked": indeterminate ? 'mixed' : checked
1906
2000
  }),
1907
2001
  /*#__PURE__*/ jsxRuntime.jsx(StyledCheckmark, {}),
1908
2002
  /*#__PURE__*/ jsxRuntime.jsx("span", {
1909
- children: props.label
2003
+ children: label
1910
2004
  })
1911
2005
  ]
1912
2006
  });
1913
2007
  }
1914
- Checkbox.propTypes = {
1915
- /** Label for the field */ label: PropTypes.string,
1916
- /** If the field is in indeterminate state */ indeterminate: PropTypes.bool
1917
- };
1918
- Checkbox.defaultProps = {
1919
- indeterminate: false,
1920
- label: ''
1921
- };
2008
+ const Checkbox = /*#__PURE__*/ React.forwardRef(CheckboxComponent);
1922
2009
 
1923
2010
  const Switch = /*#__PURE__*/ styled("label", {
1924
- target: "ecfiyvb0",
2011
+ target: "e185uavx0",
1925
2012
  label: "Switch"
1926
2013
  })("position:relative;display:inline-flex;margin:5px 0;");
1927
2014
  const Input$1 = /*#__PURE__*/ styled("input", {
1928
- target: "ecfiyvb1",
2015
+ target: "e185uavx1",
1929
2016
  label: "Input"
1930
2017
  })("position:absolute;width:0;height:0;appearance:none;margin:0;& + span{position:relative;cursor:pointer;width:30px;height:18px;background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";transition:0.4s;border-radius:10px;padding:0 3px;margin:0 10px 0 5px;}& + span:before{position:absolute;content:'';height:14px;width:14px;left:1px;top:1px;border:1px solid ", getThemeValue(THEME_NAME.DISABLED_BORDER), ";border-radius:50%;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";transition:0.4s;}&:checked + span{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:checked + span:before{transform:translateX(18px);border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:focus + span:before{box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover ~ span{cursor:pointer;color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}&:disabled + span{background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";cursor:not-allowed;}&:disabled + span:before{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}");
1931
- function Toggle(props) {
2018
+ /**
2019
+ * Toggle Component
2020
+ * @param props - Component props
2021
+ * @param ref - Ref forwarded to the underlying HTMLInputElement
2022
+ */ function ToggleComponent(props, ref) {
1932
2023
  return /*#__PURE__*/ jsxRuntime.jsxs(Switch, {
1933
2024
  children: [
1934
2025
  /*#__PURE__*/ jsxRuntime.jsx(Input$1, {
1935
2026
  ...props,
2027
+ ref: ref,
1936
2028
  type: "checkbox",
1937
2029
  role: "switch",
1938
2030
  "aria-checked": props.checked
@@ -1944,73 +2036,80 @@ function Toggle(props) {
1944
2036
  ]
1945
2037
  });
1946
2038
  }
1947
- Toggle.propTypes = {
1948
- /** Label for the field */ label: PropTypes.string
1949
- };
2039
+ const Toggle = /*#__PURE__*/ React.forwardRef(ToggleComponent);
1950
2040
 
1951
2041
  const Label$1 = /*#__PURE__*/ styled("label", {
1952
- target: "e1ji8xn0",
2042
+ target: "e12cx2u30",
1953
2043
  label: "Label"
1954
2044
  })("display:inline-flex;align-items:center;margin:5px 0;cursor:pointer;position:relative;");
1955
2045
  const StyledRadio = /*#__PURE__*/ styled("span", {
1956
- target: "e1ji8xn1",
2046
+ target: "e12cx2u31",
1957
2047
  label: "StyledRadio"
1958
2048
  })("width:16px;height:16px;margin-right:5px;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:50%;display:block;transition:background-color 0.3s ease;position:relative;flex-shrink:0;&::after{content:'';width:100%;height:100%;border-radius:50%;position:absolute;top:0;left:0;box-shadow:inset 0 0 0 3px ", getThemeValue(THEME_NAME.BACKGROUND), ";opacity:0;transition:opacity 0.2s ease;}");
1959
2049
  const HiddenInput = /*#__PURE__*/ styled("input", {
1960
- target: "e1ji8xn2",
2050
+ target: "e12cx2u32",
1961
2051
  label: "HiddenInput"
1962
2052
  })("opacity:0;width:0;height:0;position:absolute;margin:0;&:checked + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";background-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:checked + ", StyledRadio, "::after{opacity:1;}&:enabled:focus + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:checked:focus + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:hover + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:enabled:hover ~ span{color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:disabled + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";cursor:not-allowed;}&:disabled:checked + ", StyledRadio, "{border-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}&:disabled ~ span{color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";cursor:not-allowed;}");
1963
- function Radio(props) {
2053
+ /**
2054
+ * Radio Component
2055
+ * @param props - Component props
2056
+ * @param ref - Ref forwarded to the underlying HTMLInputElement
2057
+ */ function RadioComponent(props, ref) {
2058
+ const { label, ...rest } = props;
1964
2059
  return /*#__PURE__*/ jsxRuntime.jsxs(Label$1, {
1965
2060
  children: [
1966
2061
  /*#__PURE__*/ jsxRuntime.jsx(HiddenInput, {
1967
- ...props,
2062
+ ...rest,
2063
+ ref: ref,
1968
2064
  type: "radio"
1969
2065
  }),
1970
2066
  /*#__PURE__*/ jsxRuntime.jsx(StyledRadio, {}),
1971
2067
  /*#__PURE__*/ jsxRuntime.jsx("span", {
1972
- children: props.label
2068
+ children: label
1973
2069
  })
1974
2070
  ]
1975
2071
  });
1976
2072
  }
1977
- Radio.propTypes = {
1978
- /** Label for the field */ label: PropTypes.string
1979
- };
2073
+ const Radio = /*#__PURE__*/ React.forwardRef(RadioComponent);
1980
2074
 
1981
2075
  const Input = /*#__PURE__*/ styled("input", {
1982
- target: "e1ed8pyp0",
2076
+ target: "e1yp0s5y0",
1983
2077
  label: "Input"
1984
2078
  })("appearance:none;margin:0;width:0;& + span{color:", getThemeValue(THEME_NAME.PRIMARY), ";padding:6px 12px;border:none;border:1px solid ", getThemeValue(THEME_NAME.PRIMARY), ";cursor:pointer;margin-right:-1px;line-height:18px;}&:enabled:focus + span{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:enabled:hover + span{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";}&:enabled:checked + span{background-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";}&:disabled + span{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}&:disabled:checked + span{background-color:", getThemeValue(THEME_NAME.DISABLED_BORDER), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";}");
1985
2079
  const Label = /*#__PURE__*/ styled("label", {
1986
- target: "e1ed8pyp1",
2080
+ target: "e1yp0s5y1",
1987
2081
  label: "Label"
1988
2082
  })("display:inline-flex;&:focus-within{z-index:1;}");
1989
2083
  const RadioGroup = /*#__PURE__*/ styled("div", {
1990
- target: "e1ed8pyp2",
2084
+ target: "e1yp0s5y2",
1991
2085
  label: "RadioGroup"
1992
2086
  })("display:inline-flex;align-items:center;border-radius:3px;margin:5px 0;& ", Label, ":first-child > span{border-radius:3px 0 0 3px;}& ", Label, ":last-child > span{border-radius:0 3px 3px 0;}");
1993
- function RadioButton(props) {
2087
+ /**
2088
+ * RadioButton Component
2089
+ * @param props - Component props
2090
+ * @param ref - Ref forwarded to the underlying HTMLInputElement
2091
+ */ function RadioButtonComponent(props, ref) {
2092
+ const { label, ...rest } = props;
1994
2093
  return /*#__PURE__*/ jsxRuntime.jsxs(Label, {
1995
2094
  children: [
1996
2095
  /*#__PURE__*/ jsxRuntime.jsx(Input, {
1997
- ...props,
1998
- type: "radio"
2096
+ ...rest,
2097
+ type: "radio",
2098
+ ref: ref
1999
2099
  }),
2000
2100
  /*#__PURE__*/ jsxRuntime.jsx("span", {
2001
- children: props.label
2101
+ children: label
2002
2102
  })
2003
2103
  ]
2004
2104
  });
2005
2105
  }
2006
- RadioButton.propTypes = {
2007
- /** Label for the field */ label: PropTypes.string
2008
- };
2106
+ const RadioButton = /*#__PURE__*/ React.forwardRef(RadioButtonComponent);
2009
2107
 
2108
+ // Context may be undefined if used outside a Menu provider
2010
2109
  var MenuContext = React.createContext(undefined);
2011
2110
 
2012
2111
  const MenuContainer = /*#__PURE__*/ styled("div", {
2013
- target: "ez48lhb0",
2112
+ target: "e1qc23xy0",
2014
2113
  label: "MenuContainer"
2015
2114
  })("flex:1;display:flex;flex-direction:column;& div:last-child{border-bottom:none;}&:focus-within{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}");
2016
2115
  /**
@@ -2018,11 +2117,17 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
2018
2117
  * Supports single and multi-select modes and keyboard navigation.
2019
2118
  *
2020
2119
  * @template T - The type of value(s) in the menu.
2021
- * @param {MenuProps<T> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>} props - The menu properties.
2022
- * @param {ForwardedRef<HTMLDivElement>} ref - The ref forwarded to the menu container.
2023
- */ const Menu = /*#__PURE__*/ React.forwardRef(function(props, ref) {
2024
- const { multiSelect, onChange, value: propValue, ...rest } = props;
2025
- const [value, setValue] = React.useState(propValue || (multiSelect ? [] : ''));
2120
+ * @param props - The menu properties.
2121
+ * @param ref - The ref forwarded to the menu container.
2122
+ */ /**
2123
+ * Menu Component
2124
+ * @template T - The type of value(s) in the menu.
2125
+ * @param props - Component props
2126
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
2127
+ */ function MenuInner(props, ref) {
2128
+ const { multiSelect = false, onChange, value: propValue, children, ...rest } = props;
2129
+ // State holds either a single T or an array of T when multiSelect
2130
+ const [value, setValue] = React.useState(propValue);
2026
2131
  /**
2027
2132
  * Updates the selected value(s).
2028
2133
  * Handles both single and multi-select logic.
@@ -2040,6 +2145,10 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
2040
2145
  val
2041
2146
  ];
2042
2147
  }
2148
+ } else {
2149
+ newVal = [
2150
+ val
2151
+ ];
2043
2152
  }
2044
2153
  } else {
2045
2154
  newVal = val;
@@ -2105,10 +2214,11 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
2105
2214
  firstItem?.focus();
2106
2215
  }
2107
2216
  };
2108
- return /*#__PURE__*/ jsxRuntime.jsx(MenuContext.Provider, {
2217
+ return(// @ts-expect-error Generic context typing
2218
+ /*#__PURE__*/ jsxRuntime.jsx(MenuContext.Provider, {
2109
2219
  value: {
2110
- value,
2111
- multiSelect,
2220
+ value: value,
2221
+ multiSelect: !!multiSelect,
2112
2222
  updateValue
2113
2223
  },
2114
2224
  children: /*#__PURE__*/ jsxRuntime.jsx(MenuContainer, {
@@ -2119,27 +2229,38 @@ const MenuContainer = /*#__PURE__*/ styled("div", {
2119
2229
  tabIndex: 0,
2120
2230
  onKeyDown: handleKeyDown,
2121
2231
  onFocus: focusHandler,
2122
- children: props.children
2232
+ children: children
2123
2233
  })
2124
- });
2125
- });
2126
- Menu.displayName = 'Menu';
2127
- Menu.defaultProps = {
2128
- multiSelect: false
2129
- };
2234
+ }));
2235
+ }
2236
+ const Menu = /*#__PURE__*/ React.forwardRef(MenuInner);
2130
2237
 
2131
2238
  const Container$4 = /*#__PURE__*/ styled("button", {
2132
- target: "ea4jlaf0",
2239
+ target: "ebwocs30",
2133
2240
  label: "Container"
2134
2241
  })("font-weight:", (props)=>props.selected ? 'bold' : 'normal', ";padding:8px;border:none;border-left:4px solid\n ", (props)=>props.selected && !props.multiselect ? getThemeValue(THEME_NAME.TEXT_COLOR_DARK) : 'transparent', ";background-color:transparent;font-size:16px;border-bottom:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";min-height:41px;display:flex;align-items:center;cursor:pointer;position:relative;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:hover,&:focus,&:focus-within{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";}& > label{margin:0 4px 0 0;}");
2135
- const MenuItemInner = (props, ref)=>{
2242
+ /**
2243
+ * MenuItem Component
2244
+ * @template T - The type of value in the menu item.
2245
+ * @param props - Component props
2246
+ * @param ref - Ref forwarded to the underlying HTMLButtonElement
2247
+ */ const MenuItemInner = (props, ref)=>{
2136
2248
  const context = React.useContext(MenuContext);
2249
+ if (!context) {
2250
+ throw new Error('`MenuItem` must be used within a `Menu` provider');
2251
+ }
2137
2252
  const { value, children, ...rest } = props;
2138
2253
  const clickHandler = (e)=>{
2139
2254
  e.stopPropagation();
2140
2255
  context.updateValue(value);
2141
2256
  };
2142
- const selected = context.multiSelect ? context.value?.includes?.(value) : context.value === value;
2257
+ let selected = false;
2258
+ if (context.multiSelect) {
2259
+ const arr = context.value;
2260
+ selected = Array.isArray(arr) && arr.includes(value);
2261
+ } else {
2262
+ selected = context.value === value;
2263
+ }
2143
2264
  return /*#__PURE__*/ jsxRuntime.jsxs(Container$4, {
2144
2265
  ...rest,
2145
2266
  ref: ref,
@@ -2188,25 +2309,30 @@ const positionMap$2 = {
2188
2309
  `
2189
2310
  };
2190
2311
  const PopoverDiv = /*#__PURE__*/ styled("div", {
2191
- target: "e1oy1jnn0",
2312
+ target: "ejcb1ps0",
2192
2313
  label: "PopoverDiv"
2193
2314
  })("position:relative;display:inline-flex;");
2194
2315
  const Popper = /*#__PURE__*/ styled(Card, {
2195
- target: "e1oy1jnn1",
2316
+ target: "ejcb1ps1",
2196
2317
  label: "Popper"
2197
2318
  })("position:absolute;width:100%;min-width:200px;overflow:auto;animation:enter 0.3s linear;border-radius:3px;z-index:1;transform:translate(", (props)=>props.translateX, "px,", (props)=>props.translateY, "px);", (props)=>positionMap$2[props.position], " &.closing{animation:exit 0.3s linear;}@keyframes enter{from{max-height:0px;opacity:1;overflow:hidden;}to{max-height:300px;opacity:1;overflow:hidden;}}@keyframes exit{to{max-height:0px;opacity:1;overflow:hidden;}from{max-height:300px;opacity:1;overflow:hidden;}}");
2198
2319
  const KEY_CODES = {
2199
2320
  ESC: 27
2200
2321
  };
2201
- function Popover(props) {
2202
- const [open, setOpen] = React.useState(props.open);
2322
+ /**
2323
+ * Popover Component
2324
+ * @param props - Component props
2325
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
2326
+ */ function PopoverComponent(props, ref) {
2327
+ const { open: propsOpen, element, position = "BOTTOM_LEFT", closeOnEsc = true, onClose, children, ...rest } = props;
2328
+ const [open, setOpen] = React.useState(propsOpen);
2203
2329
  const [closing, setClosing] = React.useState(false);
2204
2330
  const [translate, setTranslate] = React.useState({
2205
2331
  x: 0,
2206
2332
  y: 0
2207
2333
  });
2208
- const popperRef = React.useRef();
2209
- const containerRef = React.useRef();
2334
+ const popperRef = React.useRef(null);
2335
+ const containerRef = React.useRef(null);
2210
2336
  const triggerRef = React.useRef(null);
2211
2337
  const closeTimeoutRef = React.useRef(null);
2212
2338
  const focusTimeoutRef = React.useRef(null);
@@ -2227,8 +2353,8 @@ function Popover(props) {
2227
2353
  x: 0,
2228
2354
  y: 0
2229
2355
  });
2230
- if (props.onClose) {
2231
- props.onClose();
2356
+ if (onClose) {
2357
+ onClose();
2232
2358
  }
2233
2359
  setClosing(false);
2234
2360
  // Restore focus to the trigger element after animation completes
@@ -2241,15 +2367,15 @@ function Popover(props) {
2241
2367
  closeTimeoutRef.current = null;
2242
2368
  }, 280);
2243
2369
  }, [
2244
- props
2370
+ onClose
2245
2371
  ]);
2246
2372
  const keyupEventHandler = React.useCallback((e)=>{
2247
- if (props.closeOnEsc && e.keyCode === KEY_CODES.ESC) {
2373
+ if (closeOnEsc && e.keyCode === KEY_CODES.ESC) {
2248
2374
  close();
2249
2375
  }
2250
2376
  }, [
2251
2377
  close,
2252
- props.closeOnEsc
2378
+ closeOnEsc
2253
2379
  ]);
2254
2380
  const clickOutsideHandler = React.useCallback((e)=>{
2255
2381
  if (containerRef.current && !containerRef.current.contains(e.target)) {
@@ -2269,7 +2395,7 @@ function Popover(props) {
2269
2395
  keyupEventHandler
2270
2396
  ]);
2271
2397
  React.useEffect(()=>{
2272
- if (props.open) {
2398
+ if (propsOpen) {
2273
2399
  setOpen(true);
2274
2400
  // Use requestAnimationFrame to add listener after current event loop
2275
2401
  const rafId = requestAnimationFrame(()=>{
@@ -2285,22 +2411,22 @@ function Popover(props) {
2285
2411
  }
2286
2412
  }
2287
2413
  }, [
2288
- props.open,
2414
+ propsOpen,
2289
2415
  open,
2290
2416
  clickOutsideHandler,
2291
2417
  close
2292
2418
  ]);
2293
2419
  React.useEffect(()=>{
2294
2420
  if (open) {
2295
- const { top, left, right } = popperRef.current.getBoundingClientRect();
2296
- const height = popperRef.current.scrollHeight;
2421
+ const { top = 0, left = 0, right = 0 } = popperRef.current?.getBoundingClientRect() ?? {};
2422
+ const height = popperRef.current?.scrollHeight ?? 0;
2297
2423
  const viewportWidth = document.documentElement.clientWidth;
2298
2424
  const viewportHeight = document.documentElement.clientHeight;
2299
2425
  const translation = {
2300
2426
  x: 0,
2301
2427
  y: 0
2302
2428
  };
2303
- if (props.position === "BOTTOM_LEFT") {
2429
+ if (position === "BOTTOM_LEFT") {
2304
2430
  // overflow can happen at bottom and right
2305
2431
  if (viewportHeight - top - height < 0) {
2306
2432
  translation.y = -1 * (Math.abs(viewportHeight - top - height) + 5);
@@ -2308,7 +2434,7 @@ function Popover(props) {
2308
2434
  if (viewportWidth - right < 0) {
2309
2435
  translation.x = -1 * (Math.abs(viewportWidth - right) + 5);
2310
2436
  }
2311
- } else if (props.position == "BOTTOM_RIGHT") {
2437
+ } else if (position == "BOTTOM_RIGHT") {
2312
2438
  // overflow can happen at bottom and left
2313
2439
  if (viewportHeight - top - height < 0) {
2314
2440
  translation.y = -1 * (Math.abs(viewportHeight - top - height) + 5);
@@ -2316,7 +2442,7 @@ function Popover(props) {
2316
2442
  if (left < 0) {
2317
2443
  translation.x = Math.abs(left) + 5;
2318
2444
  }
2319
- } else if (props.position === "TOP_LEFT") {
2445
+ } else if (position === "TOP_LEFT") {
2320
2446
  // overflow can happen at top and right
2321
2447
  if (top - height < 0) {
2322
2448
  translation.y = Math.abs(top - height) + 5;
@@ -2336,11 +2462,11 @@ function Popover(props) {
2336
2462
  // Note it can still overflow, but in that case fitting popper inside the
2337
2463
  // window is not possible.
2338
2464
  setTranslate(translation);
2339
- popperRef.current.focus();
2465
+ popperRef.current?.focus();
2340
2466
  }
2341
2467
  }, [
2342
2468
  open,
2343
- props.position
2469
+ position
2344
2470
  ]);
2345
2471
  /**
2346
2472
  * Cleanup timeouts on unmount
@@ -2354,10 +2480,19 @@ function Popover(props) {
2354
2480
  }
2355
2481
  };
2356
2482
  }, []);
2483
+ const forwardRef = (node)=>{
2484
+ containerRef.current = node;
2485
+ if (typeof ref === 'function') {
2486
+ ref(node);
2487
+ } else if (ref) {
2488
+ ref.current = node;
2489
+ }
2490
+ };
2357
2491
  return /*#__PURE__*/ jsxRuntime.jsxs(PopoverDiv, {
2358
- ref: containerRef,
2492
+ ref: forwardRef,
2493
+ ...rest,
2359
2494
  children: [
2360
- /*#__PURE__*/ React.createElement(props.element, {
2495
+ /*#__PURE__*/ React.createElement(element, {
2361
2496
  ref: triggerRef,
2362
2497
  id: triggerId,
2363
2498
  'aria-expanded': open,
@@ -2370,39 +2505,24 @@ function Popover(props) {
2370
2505
  role: "dialog",
2371
2506
  "aria-labelledby": triggerId,
2372
2507
  id: popperId,
2373
- position: props.position,
2508
+ position: position,
2374
2509
  translateX: translate.x,
2375
2510
  translateY: translate.y,
2376
- className: closing && 'closing',
2511
+ className: closing ? 'closing' : '',
2377
2512
  ref: popperRef,
2378
2513
  onClick: (e)=>{
2379
2514
  e.stopPropagation();
2380
2515
  e.nativeEvent.stopImmediatePropagation();
2381
2516
  },
2382
- children: props.children
2517
+ children: children
2383
2518
  })
2384
2519
  ]
2385
2520
  });
2386
2521
  }
2387
- Popover.propTypes = {
2388
- /** Opens the popover */ open: PropTypes.bool.isRequired,
2389
- /** Anchor element for the popover */ element: PropTypes.func,
2390
- /** Position of the popover around anchor element */ position: PropTypes.oneOf([
2391
- "TOP_LEFT",
2392
- "TOP_RIGHT",
2393
- "BOTTOM_LEFT",
2394
- "BOTTOM_RIGHT"
2395
- ]),
2396
- /** If the popover should close on `esc` key press */ closeOnEsc: PropTypes.bool,
2397
- /** Popover close callback */ onClose: PropTypes.func
2398
- };
2399
- Popover.defaultProps = {
2400
- closeOnEsc: true,
2401
- position: "BOTTOM_LEFT"
2402
- };
2522
+ const Popover = /*#__PURE__*/ React.forwardRef(PopoverComponent);
2403
2523
 
2404
2524
  const ArrowContainer = /*#__PURE__*/ styled("span", {
2405
- target: "elhmc4m0",
2525
+ target: "e1d5dyoc0",
2406
2526
  label: "ArrowContainer"
2407
2527
  })("position:absolute;right:12px;top:16px;pointer-events:none;");
2408
2528
  /**
@@ -2410,12 +2530,17 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
2410
2530
  * Supports single and multi-select modes.
2411
2531
  *
2412
2532
  * @template T - The type of the value(s) in the dropdown.
2413
- * @param {DropdownProps<T>} props - The properties for the Dropdown component.
2414
- * @returns {JSX.Element} The rendered Dropdown component.
2415
- */ function Dropdown(props) {
2416
- const { multiSelect, onChange } = props;
2533
+ * @param props - The properties for the Dropdown component.
2534
+ * @returns The rendered Dropdown component.
2535
+ */ /**
2536
+ * Dropdown Component
2537
+ * @template T - The type of value(s) in the dropdown.
2538
+ * @param props - Component props
2539
+ * @param outerRef - Ref forwarded to the underlying HTMLInputElement
2540
+ */ function DropdownComponent(props, outerRef) {
2541
+ const { multiSelect = false, onChange, children, value: propValue, label, errorText, required, disabled, ...rest } = props;
2417
2542
  const [open, setOpen] = React.useState(false);
2418
- const [value, setValue] = React.useState(props.value);
2543
+ const [value, setValue] = React.useState(propValue);
2419
2544
  const id = React.useId();
2420
2545
  const menuId = `${id}-menu`;
2421
2546
  const menuRef = React.useRef(null);
@@ -2470,19 +2595,40 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
2470
2595
  /**
2471
2596
  * Toggles the dropdown open state on click.
2472
2597
  */ const clickHandler = ()=>setOpen(true);
2473
- const TriggerElement = /*#__PURE__*/ React.forwardRef((passedProps, ref)=>/*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
2598
+ const TriggerElement = /*#__PURE__*/ React.forwardRef((passedProps, ref)=>{
2599
+ // Helper to assign both internal triggerRef and external forwarded ref
2600
+ const assignRefs = (node)=>{
2601
+ triggerRef.current = node;
2602
+ if (!outerRef) return;
2603
+ if (typeof outerRef === 'function') {
2604
+ outerRef(node);
2605
+ } else {
2606
+ outerRef.current = node;
2607
+ }
2608
+ };
2609
+ // Combine the ref passed by parent with our assignRefs so both are updated
2610
+ const combinedRef = (node)=>{
2611
+ assignRefs(node);
2612
+ if (typeof ref === 'function') {
2613
+ ref(node);
2614
+ } else if (ref) {
2615
+ ref.current = node;
2616
+ }
2617
+ };
2618
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
2474
2619
  children: [
2475
2620
  /*#__PURE__*/ jsxRuntime.jsx(Input$2, {
2621
+ ...rest,
2476
2622
  ...passedProps,
2477
- ref: ref,
2623
+ ref: combinedRef,
2478
2624
  type: "text",
2479
2625
  value: value && String(value),
2480
- label: props.label,
2481
- errorText: props.errorText,
2626
+ label: label,
2627
+ errorText: errorText,
2482
2628
  onClick: clickHandler,
2483
2629
  onKeyDown: onKeyDown,
2484
- required: props.required,
2485
- disabled: props.disabled,
2630
+ required: required,
2631
+ disabled: disabled,
2486
2632
  readOnly: true,
2487
2633
  role: "combobox",
2488
2634
  "aria-haspopup": "listbox",
@@ -2494,7 +2640,8 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
2494
2640
  children: /*#__PURE__*/ jsxRuntime.jsx(ExpandMore, {})
2495
2641
  })
2496
2642
  ]
2497
- }));
2643
+ });
2644
+ });
2498
2645
  TriggerElement.displayName = 'DropdownTrigger';
2499
2646
  return /*#__PURE__*/ jsxRuntime.jsx(Popover, {
2500
2647
  position: POPOVER_POSITION.BOTTOM_LEFT,
@@ -2510,24 +2657,22 @@ const ArrowContainer = /*#__PURE__*/ styled("span", {
2510
2657
  value: value,
2511
2658
  multiSelect: multiSelect,
2512
2659
  onChange: changeHandler,
2513
- children: props.children
2660
+ children: children
2514
2661
  })
2515
2662
  });
2516
2663
  }
2517
- Dropdown.defaultProps = {
2518
- multiSelect: false
2519
- };
2664
+ const Dropdown = /*#__PURE__*/ React.forwardRef(DropdownComponent);
2520
2665
 
2521
2666
  const BodyText = /*#__PURE__*/ styled("p", {
2522
- target: "ecd5j070",
2667
+ target: "e18k0mlw0",
2523
2668
  label: "BodyText"
2524
2669
  })("margin-top:0;");
2525
2670
  const InputContainer = /*#__PURE__*/ styled("div", {
2526
- target: "ecd5j071",
2671
+ target: "e18k0mlw1",
2527
2672
  label: "InputContainer"
2528
2673
  })("display:flex;flex:1;margin-top:10px;& > label{flex:1;width:100%;padding:0;& > input{width:100%;padding:0 8px;box-sizing:border-box;}}");
2529
2674
  const StyledInput = /*#__PURE__*/ styled(Input$2, {
2530
- target: "ecd5j072",
2675
+ target: "e18k0mlw2",
2531
2676
  label: "StyledInput"
2532
2677
  })("flex:1;padding:0;");
2533
2678
  class PromptDialog extends React.Component {
@@ -2560,12 +2705,13 @@ class PromptDialog extends React.Component {
2560
2705
  }),
2561
2706
  /*#__PURE__*/ jsxRuntime.jsxs(Footer$1, {
2562
2707
  children: [
2563
- /*#__PURE__*/ jsxRuntime.jsx(StyledButton, {
2708
+ /*#__PURE__*/ jsxRuntime.jsx(Button$2, {
2564
2709
  type: "button",
2565
2710
  onClick: this.cancel,
2566
2711
  children: cancelText
2567
2712
  }),
2568
2713
  /*#__PURE__*/ jsxRuntime.jsx(ActionButton, {
2714
+ onClick: this.submit,
2569
2715
  children: submitText
2570
2716
  })
2571
2717
  ]
@@ -2579,9 +2725,10 @@ class PromptDialog extends React.Component {
2579
2725
  this.setState({
2580
2726
  value: e.target.value
2581
2727
  });
2582
- }, this.cancel = ()=>this.dialog.current.close(), this.submit = (e)=>{
2728
+ }, this.cancel = ()=>this.dialog.current?.close(), this.submit = (e)=>{
2583
2729
  e.preventDefault();
2584
- this.dialog.current.close(this.state.value);
2730
+ if (!this.state.value) return;
2731
+ this.dialog.current?.close(this.state.value);
2585
2732
  }, this.show = ()=>{
2586
2733
  return new Promise((resolve, reject)=>{
2587
2734
  const onClose = (value)=>{
@@ -2594,7 +2741,7 @@ class PromptDialog extends React.Component {
2594
2741
  value: this.props.defaultValue
2595
2742
  });
2596
2743
  };
2597
- this.dialog.current.open(onClose);
2744
+ this.dialog.current?.open(onClose);
2598
2745
  });
2599
2746
  };
2600
2747
  this.state = {
@@ -2602,15 +2749,6 @@ class PromptDialog extends React.Component {
2602
2749
  };
2603
2750
  }
2604
2751
  }
2605
- PromptDialog.propTypes = {
2606
- /** Shown as header of the dialog */ header: PropTypes.string,
2607
- /** Rendered as the body of the dialog */ body: PropTypes.string,
2608
- /** Default value for the input. */ defaultValue: PropTypes.string,
2609
- /** Submit button text. Default value is 'Submit' */ submitText: PropTypes.string,
2610
- /** Cancel button text. Default value is 'Cancel' */ cancelText: PropTypes.string,
2611
- /** Props for the input. */ inputProps: PropTypes.object,
2612
- /** Additional props for the dialog. */ dialogProps: PropTypes.object
2613
- };
2614
2752
  PromptDialog.defaultProps = {
2615
2753
  cancelText: 'Cancel',
2616
2754
  submitText: 'Submit',
@@ -2645,22 +2783,9 @@ const positionStyle$1 = (size)=>({
2645
2783
  }
2646
2784
  });
2647
2785
  const DrawerDiv = /*#__PURE__*/ styled("div", {
2648
- target: "ehe19t90",
2786
+ target: "e1topccf0",
2649
2787
  label: "DrawerDiv"
2650
2788
  })("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, "}");
2651
- const drawerPropTypes = {
2652
- /** Opens the drawer */ open: PropTypes.bool.isRequired,
2653
- /** position of the drawer */ position: PropTypes.oneOf([
2654
- "LEFT",
2655
- "RIGHT",
2656
- "BOTTOM"
2657
- ]),
2658
- /** size of the drawer */ size: PropTypes.string,
2659
- /** Shows an overlay behind the drawer. */ overlay: PropTypes.bool,
2660
- /** Closes the drawer on esc */ closeOnEsc: PropTypes.bool,
2661
- /** Closes the drawer on overlay click */ closeOnOverlayClick: PropTypes.bool,
2662
- /** Call back function called when the drawer closes. */ onClose: PropTypes.func
2663
- };
2664
2789
  const positionMap$1 = {
2665
2790
  ["LEFT"]: LAYER_POSITION.TOP_LEFT,
2666
2791
  ["RIGHT"]: LAYER_POSITION.TOP_RIGHT,
@@ -2682,6 +2807,8 @@ class Drawer extends React.Component {
2682
2807
  */ componentDidMount() {
2683
2808
  if (this.props.open) {
2684
2809
  this.lastFocusedElement = document.activeElement;
2810
+ // Handle initial open state
2811
+ this.handleOpen();
2685
2812
  }
2686
2813
  }
2687
2814
  /**
@@ -2695,7 +2822,7 @@ class Drawer extends React.Component {
2695
2822
  * Lifecycle method to handle Drawer updates.
2696
2823
  * Manages opening/closing logic via LayerManager and focus preservation.
2697
2824
  */ getSnapshotBeforeUpdate(prevProps) {
2698
- const { open, closeOnEsc, closeOnOverlayClick, overlay, position, children, size, ...rest } = this.props;
2825
+ const { open } = this.props;
2699
2826
  if (prevProps.open && !open) {
2700
2827
  this.closeCallback?.();
2701
2828
  this.restoreFocus();
@@ -2703,36 +2830,18 @@ class Drawer extends React.Component {
2703
2830
  if (!prevProps.open && open) {
2704
2831
  // Save current focus
2705
2832
  this.lastFocusedElement = document.activeElement;
2706
- this.layer = LayerManager$1.renderLayer({
2707
- overlay,
2708
- exitDelay: 300,
2709
- position: positionMap$1[position],
2710
- closeCallback: this.onClose,
2711
- closeOnEsc,
2712
- closeOnOverlayClick,
2713
- component: /*#__PURE__*/ jsxRuntime.jsx(DrawerDiv, {
2714
- ...rest,
2715
- ref: this.setDrawerRef,
2716
- role: "dialog",
2717
- "aria-modal": "true",
2718
- tabIndex: -1,
2719
- onKeyDown: this.handleKeyDown,
2720
- position: position,
2721
- size: size,
2722
- onClick: (e)=>e.stopPropagation(),
2723
- children: children
2724
- })
2725
- });
2726
- this.closeCallback = this.layer[1];
2727
- this.forceUpdate();
2833
+ this.handleOpen();
2728
2834
  }
2835
+ return null;
2729
2836
  }
2730
2837
  /**
2731
2838
  * Renders the Drawer component via the LayerManager portal.
2732
2839
  */ render() {
2733
2840
  if (this.state.open && this.layer) {
2734
2841
  const [Component] = this.layer;
2735
- return /*#__PURE__*/ jsxRuntime.jsx(Component, {});
2842
+ return /*#__PURE__*/ jsxRuntime.jsx(Component, {
2843
+ ref: this.setRefProp
2844
+ });
2736
2845
  }
2737
2846
  return null;
2738
2847
  }
@@ -2748,8 +2857,8 @@ class Drawer extends React.Component {
2748
2857
  open: false
2749
2858
  });
2750
2859
  this.props.onClose?.();
2751
- this.closeCallback = null;
2752
- this.layer = null;
2860
+ this.closeCallback = undefined;
2861
+ this.layer = undefined;
2753
2862
  }, this.lastFocusedElement = null, this.drawerRef = /*#__PURE__*/ React.createRef(), /**
2754
2863
  * Retrieves all focusable elements within the drawer.
2755
2864
  */ this.getFocusableElements = ()=>{
@@ -2777,6 +2886,32 @@ class Drawer extends React.Component {
2777
2886
  }
2778
2887
  }
2779
2888
  }, /**
2889
+ * Handles opening the drawer by creating the layer.
2890
+ */ this.handleOpen = ()=>{
2891
+ const { closeOnEsc, closeOnOverlayClick, position, size, overlay, children, ...rest } = this.props;
2892
+ this.layer = LayerManager$1.renderLayer({
2893
+ overlay,
2894
+ exitDelay: 300,
2895
+ position: positionMap$1[position],
2896
+ closeCallback: this.onClose,
2897
+ closeOnEsc,
2898
+ closeOnOverlayClick,
2899
+ component: /*#__PURE__*/ jsxRuntime.jsx(DrawerDiv, {
2900
+ ...rest,
2901
+ ref: this.setDrawerRef,
2902
+ role: "dialog",
2903
+ "aria-modal": "true",
2904
+ tabIndex: -1,
2905
+ onKeyDown: this.handleKeyDown,
2906
+ position: position,
2907
+ size: size,
2908
+ onClick: (e)=>e.stopPropagation(),
2909
+ children: children
2910
+ })
2911
+ });
2912
+ this.closeCallback = this.layer[1];
2913
+ this.forceUpdate();
2914
+ }, /**
2780
2915
  * Restores focus to the element that was focused before the drawer opened.
2781
2916
  */ this.restoreFocus = ()=>{
2782
2917
  if (this.lastFocusedElement) {
@@ -2821,10 +2956,18 @@ class Drawer extends React.Component {
2821
2956
  // Fallback to container
2822
2957
  root.focus();
2823
2958
  }
2959
+ }, /**
2960
+ * Sets the ref prop passed to the Drawer Container component.
2961
+ * @param node
2962
+ */ this.setRefProp = (node)=>{
2963
+ if (this.props.forwardRef && typeof this.props.forwardRef === 'function') {
2964
+ this.props.forwardRef(node);
2965
+ } else if (this.props.forwardRef && typeof this.props.forwardRef === 'object') {
2966
+ this.props.forwardRef.current = node;
2967
+ }
2824
2968
  };
2825
2969
  }
2826
2970
  }
2827
- Drawer.propTypes = drawerPropTypes;
2828
2971
  Drawer.defaultProps = {
2829
2972
  overlay: true,
2830
2973
  position: "LEFT",
@@ -2833,7 +2976,7 @@ Drawer.defaultProps = {
2833
2976
  };
2834
2977
 
2835
2978
  const Container$3 = /*#__PURE__*/ styled("div", {
2836
- target: "e10z40ez0",
2979
+ target: "eahc3qe0",
2837
2980
  label: "Container"
2838
2981
  })("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 ? `
2839
2982
  border-color: ${getThemeValue(THEME_NAME.ERROR)};
@@ -2843,15 +2986,20 @@ const Container$3 = /*#__PURE__*/ styled("div", {
2843
2986
  }
2844
2987
  ` : '');
2845
2988
  const ErrorContainer = /*#__PURE__*/ styled("div", {
2846
- target: "e10z40ez1",
2989
+ target: "eahc3qe1",
2847
2990
  label: "ErrorContainer"
2848
2991
  })("color:", getThemeValue(THEME_NAME.ERROR), ";margin-left:8px;font-size:12px;");
2849
- function Group(props) {
2992
+ /**
2993
+ * Group Component
2994
+ * @param props - Component props
2995
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
2996
+ */ function GroupComponent(props, ref) {
2850
2997
  const errorId = React.useId();
2851
2998
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
2852
2999
  children: [
2853
3000
  /*#__PURE__*/ jsxRuntime.jsx(Container$3, {
2854
3001
  ...props,
3002
+ ref: ref,
2855
3003
  "aria-describedby": props.errorText ? errorId : undefined,
2856
3004
  children: props.children
2857
3005
  }),
@@ -2862,21 +3010,13 @@ function Group(props) {
2862
3010
  ]
2863
3011
  });
2864
3012
  }
2865
- Group.propTypes = {
2866
- /** Error Message for the group */ errorText: PropTypes.string
2867
- };
3013
+ const Group = /*#__PURE__*/ React.forwardRef(GroupComponent);
2868
3014
 
2869
3015
  var GroupLabel = /*#__PURE__*/ styled("label", {
2870
3016
  target: "e1kv3eb90",
2871
3017
  label: ""
2872
3018
  })("height:32px;background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";padding:0 4px;line-height:32px;min-width:24px;text-align:center;color:", getThemeValue(THEME_NAME.BORDER_COLOR), ";& > svg{height:24px;width:24px;vertical-align:middle;fill:currentColor;}");
2873
3019
 
2874
- const modalPropTypes = {
2875
- /** Opens the modal */ open: PropTypes.bool.isRequired,
2876
- /** Closes the modal on esc */ closeOnEsc: PropTypes.bool,
2877
- /** Closes the modal on overlay click */ closeOnOverlayClick: PropTypes.bool,
2878
- /** Call back function called when the modal closes. */ onClose: PropTypes.func
2879
- };
2880
3020
  class Modal extends React.Component {
2881
3021
  /**
2882
3022
  * Syncs state with props.
@@ -2893,6 +3033,8 @@ class Modal extends React.Component {
2893
3033
  */ componentDidMount() {
2894
3034
  if (this.props.open) {
2895
3035
  this.lastFocusedElement = document.activeElement;
3036
+ // Handle initial open state
3037
+ this.handleOpen();
2896
3038
  }
2897
3039
  }
2898
3040
  /**
@@ -2904,15 +3046,15 @@ class Modal extends React.Component {
2904
3046
  // Clean up layer references
2905
3047
  if (this.closeCallback) {
2906
3048
  this.closeCallback();
2907
- this.closeCallback = null;
3049
+ this.closeCallback = undefined;
2908
3050
  }
2909
- this.layer = null;
3051
+ this.layer = undefined;
2910
3052
  }
2911
3053
  /**
2912
3054
  * Lifecycle method to handle Modal updates.
2913
3055
  * Manages opening/closing logic via LayerManager and focus preservation.
2914
3056
  */ getSnapshotBeforeUpdate(prevProps) {
2915
- const { open, closeOnEsc, closeOnOverlayClick, children, ...rest } = this.props;
3057
+ const { open } = this.props;
2916
3058
  if (prevProps.open && !open) {
2917
3059
  this.closeCallback?.();
2918
3060
  this.restoreFocus();
@@ -2920,28 +3062,9 @@ class Modal extends React.Component {
2920
3062
  if (!prevProps.open && open) {
2921
3063
  // Save current focus
2922
3064
  this.lastFocusedElement = document.activeElement;
2923
- this.layer = LayerManager$1.renderLayer({
2924
- overlay: true,
2925
- exitDelay: 300,
2926
- position: LAYER_POSITION.DIALOG,
2927
- closeCallback: this.onClose,
2928
- closeOnEsc: closeOnEsc,
2929
- closeOnOverlayClick: closeOnOverlayClick,
2930
- component: /*#__PURE__*/ jsxRuntime.jsx(DialogContainer, {
2931
- ...rest,
2932
- ref: this.setModalRef,
2933
- role: "dialog",
2934
- "aria-modal": "true",
2935
- tabIndex: -1,
2936
- onKeyDown: this.handleKeyDown,
2937
- onClick: (e)=>e.stopPropagation(),
2938
- elevated: true,
2939
- children: children
2940
- })
2941
- });
2942
- this.closeCallback = this.layer[1];
2943
- this.forceUpdate();
3065
+ this.handleOpen();
2944
3066
  }
3067
+ return null;
2945
3068
  }
2946
3069
  /**
2947
3070
  * Renders the Modal component via the LayerManager portal.
@@ -2964,8 +3087,8 @@ class Modal extends React.Component {
2964
3087
  open: false
2965
3088
  });
2966
3089
  this.props.onClose?.();
2967
- this.closeCallback = null;
2968
- this.layer = null;
3090
+ this.closeCallback = undefined;
3091
+ this.layer = undefined;
2969
3092
  }, this.lastFocusedElement = null, this.modalRef = /*#__PURE__*/ React.createRef(), /**
2970
3093
  * Retrieves all focusable elements within the modal.
2971
3094
  */ this.getFocusableElements = ()=>{
@@ -2993,6 +3116,31 @@ class Modal extends React.Component {
2993
3116
  }
2994
3117
  }
2995
3118
  }, /**
3119
+ * Handles opening the modal by creating the layer.
3120
+ */ this.handleOpen = ()=>{
3121
+ const { closeOnEsc, closeOnOverlayClick, children, ...rest } = this.props;
3122
+ this.layer = LayerManager$1.renderLayer({
3123
+ overlay: true,
3124
+ exitDelay: 300,
3125
+ position: LAYER_POSITION.DIALOG,
3126
+ closeCallback: this.onClose,
3127
+ closeOnEsc: closeOnEsc,
3128
+ closeOnOverlayClick: closeOnOverlayClick,
3129
+ component: /*#__PURE__*/ jsxRuntime.jsx(DialogContainer, {
3130
+ ...rest,
3131
+ ref: this.setModalRef,
3132
+ role: "dialog",
3133
+ "aria-modal": "true",
3134
+ tabIndex: -1,
3135
+ onKeyDown: this.handleKeyDown,
3136
+ onClick: (e)=>e.stopPropagation(),
3137
+ elevated: true,
3138
+ children: children
3139
+ })
3140
+ });
3141
+ this.closeCallback = this.layer[1];
3142
+ this.forceUpdate();
3143
+ }, /**
2996
3144
  * Restores focus to the element that was focused before the modal opened.
2997
3145
  */ this.restoreFocus = ()=>{
2998
3146
  if (this.lastFocusedElement) {
@@ -3015,6 +3163,9 @@ class Modal extends React.Component {
3015
3163
  // Set initial focus when the node is mounted
3016
3164
  this.setInitialFocus(node);
3017
3165
  }
3166
+ if (this.props.forwardRef) {
3167
+ this.props.forwardRef.current = node;
3168
+ }
3018
3169
  }, /**
3019
3170
  * Sets initial focus within the modal.
3020
3171
  * Tries to focus the header (first child) first, then the first interactive element, or falls back to the container.
@@ -3040,7 +3191,6 @@ class Modal extends React.Component {
3040
3191
  };
3041
3192
  }
3042
3193
  }
3043
- Modal.propTypes = modalPropTypes;
3044
3194
  Modal.defaultProps = {
3045
3195
  closeOnEsc: true,
3046
3196
  closeOnOverlayClick: true
@@ -3116,39 +3266,39 @@ const getTypeStyle = (type)=>{
3116
3266
  }
3117
3267
  };
3118
3268
  const Container$2 = /*#__PURE__*/ styled("div", {
3119
- target: "e1cfscy10",
3269
+ target: "e10n1sw0",
3120
3270
  label: "Container"
3121
3271
  })("display:flex;flex-direction:", (props)=>props.position === NOTIFICATION_POSITION.TOP_LEFT || props.position === NOTIFICATION_POSITION.TOP_RIGHT ? 'column' : 'column-reverse', ";");
3122
3272
  const Notice = /*#__PURE__*/ styled(Card, {
3123
- target: "e1cfscy11",
3273
+ target: "e10n1sw1",
3124
3274
  label: "Notice"
3125
3275
  })("position:relative;border-radius:3px;border-left:4px solid ", (props)=>getBorderColor(props.type), ";width:300px;display:flex;padding:0 5px 5px 0;overflow:hidden;animation:", (props)=>getEntryAnimation(props.position), " 0.6s ease;& svg{fill:currentColor;vertical-align:middle;width:20px;height:20px;}&.leave{animation:", (props)=>getExitAnimation(props.position), " 0.6s;}@keyframes in-right{from{transform:translateX(100%);max-height:0;opacity:0;}to{transform:translateX(0%);max-height:150px;opacity:1;}}@keyframes out-right{to{transform:translateX(100%);max-height:0;opacity:0;}from{transform:translateX(0%);max-height:100px;opacity:1;}}@keyframes in-left{from{transform:translateX(-100%);max-height:0;opacity:0;}to{transform:translateX(0%);max-height:150px;opacity:1;}}@keyframes out-left{to{transform:translateX(-100%);max-height:0;opacity:0;}from{transform:translateX(0%);max-height:100px;opacity:1;}}");
3126
3276
  const Title = /*#__PURE__*/ styled("div", {
3127
- target: "e1cfscy12",
3277
+ target: "e10n1sw2",
3128
3278
  label: "Title"
3129
3279
  })("padding:5px 0;font-size:14px;color:", (props)=>getTitleColor(props.type), ";display:flex;align-items:center;");
3130
3280
  const FillParent = /*#__PURE__*/ styled("div", {
3131
- target: "e1cfscy13",
3281
+ target: "e10n1sw3",
3132
3282
  label: "FillParent"
3133
3283
  })("flex:1;");
3134
3284
  const CloseButton = /*#__PURE__*/ styled("button", {
3135
- target: "e1cfscy14",
3285
+ target: "e10n1sw4",
3136
3286
  label: "CloseButton"
3137
3287
  })("position:absolute;background-color:transparent;border:none;padding:0;top:4px;right:4px;cursor:pointer;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:focus{box-shadow:0 0 0 3px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";border-radius:3px;}");
3138
3288
  const Body = /*#__PURE__*/ styled("div", {
3139
- target: "e1cfscy15",
3289
+ target: "e10n1sw5",
3140
3290
  label: "Body"
3141
3291
  })("padding:5px 5px 5px 0;font-size:14px;");
3142
3292
  const IconContainer = /*#__PURE__*/ styled("div", {
3143
- target: "e1cfscy16",
3293
+ target: "e10n1sw6",
3144
3294
  label: "IconContainer"
3145
3295
  })("padding:6px 10px;", (props)=>getTypeStyle(props.type), ";");
3146
3296
  const Footer = /*#__PURE__*/ styled("div", {
3147
- target: "e1cfscy17",
3297
+ target: "e10n1sw7",
3148
3298
  label: "Footer"
3149
3299
  })("display:flex;justify-content:flex-end;padding:0 5px;");
3150
3300
  const VisuallyHidden = /*#__PURE__*/ styled("span", {
3151
- target: "e1cfscy18",
3301
+ target: "e10n1sw8",
3152
3302
  label: "VisuallyHidden"
3153
3303
  })("position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;");
3154
3304
 
@@ -3249,6 +3399,7 @@ const DEFAULT_DURATION$1 = 5000;
3249
3399
  *
3250
3400
  * @param id
3251
3401
  */ this.remove = (id)=>{
3402
+ if (!id) return;
3252
3403
  // Trigger leaving animation.
3253
3404
  this.setState({
3254
3405
  notices: this.state.notices.map((notice)=>({
@@ -3293,15 +3444,15 @@ const DEFAULT_DURATION$1 = 5000;
3293
3444
  const type = notice.type || NOTIFICATION_TYPE.INFO;
3294
3445
  const isUrgent = type === NOTIFICATION_TYPE.WARNING || type === NOTIFICATION_TYPE.DANGER;
3295
3446
  // Add notice to the top of stack.
3296
- this.setState({
3297
- notices: [
3298
- {
3299
- ...notice,
3300
- id
3301
- },
3302
- ...this.state.notices
3303
- ]
3304
- }, ()=>{
3447
+ this.setState((prevState)=>({
3448
+ notices: [
3449
+ {
3450
+ ...notice,
3451
+ id
3452
+ },
3453
+ ...prevState.notices
3454
+ ]
3455
+ }), ()=>{
3305
3456
  // Update live region after state update
3306
3457
  const announcement = `${notice.title} ${notice.description}`;
3307
3458
  this.updateLiveRegion(announcement, isUrgent);
@@ -3340,47 +3491,23 @@ const DEFAULT_DURATION$1 = 5000;
3340
3491
  *
3341
3492
  * @param id
3342
3493
  */ this.pause = (id)=>()=>{
3343
- clearTimeout(this.timeouts[id]);
3494
+ if (id && this.timeouts[id]) {
3495
+ clearTimeout(this.timeouts[id]);
3496
+ delete this.timeouts[id];
3497
+ }
3344
3498
  }, /**
3345
3499
  * Restart the removal of notification.
3346
3500
  *
3347
3501
  * @param id
3348
3502
  */ this.resume = (id)=>()=>{
3349
3503
  const notice = this.state.notices.find((notice)=>notice.id === id);
3350
- if (!notice.sticky) {
3504
+ if (!notice?.sticky && id && !this.timeouts[id]) {
3351
3505
  this.timeouts[id] = setTimeout(()=>this.remove(id), DEFAULT_DURATION$1);
3352
3506
  }
3353
3507
  };
3354
3508
  }
3355
3509
  }
3356
3510
 
3357
- /** This component is only used for storybook documentation */ class StoryProps extends React.Component {
3358
- render() {
3359
- return null;
3360
- }
3361
- }
3362
- StoryProps.propTypes = {
3363
- /** Title of the notification */ title: PropTypes.string.isRequired,
3364
- /** Body of the notification */ description: PropTypes.string.isRequired,
3365
- /** Id for the notification, helps in de-duplication. */ id: PropTypes.string,
3366
- /** Duration for the notification in milliseconds */ duration: PropTypes.number,
3367
- /** Creates sticky notification */ sticky: PropTypes.bool,
3368
- /** Type of notification */ type: PropTypes.oneOf([
3369
- NOTIFICATION_TYPE.INFO,
3370
- NOTIFICATION_TYPE.SUCCESS,
3371
- NOTIFICATION_TYPE.WARNING,
3372
- NOTIFICATION_TYPE.DANGER
3373
- ]),
3374
- /** Action button text */ buttonText: PropTypes.string,
3375
- /** Action button click callback */ buttonClick: PropTypes.func,
3376
- /** Notification close callback. */ onClose: PropTypes.func,
3377
- /** Aria label for the close button on the notification. Defaults to "Close notification" */ closeButtonAriaLabel: PropTypes.string
3378
- };
3379
- StoryProps.defaultProps = {
3380
- duration: 5000,
3381
- sticky: false,
3382
- type: NOTIFICATION_TYPE.INFO
3383
- };
3384
3511
  /** Maps notification position to layer position */ const positionMap = {
3385
3512
  [NOTIFICATION_POSITION.TOP_LEFT]: LAYER_POSITION.TOP_LEFT,
3386
3513
  [NOTIFICATION_POSITION.TOP_RIGHT]: LAYER_POSITION.TOP_RIGHT,
@@ -3390,6 +3517,7 @@ StoryProps.defaultProps = {
3390
3517
  /** Notification class */ class Notification {
3391
3518
  constructor(){
3392
3519
  /** Helps in maintaining single instance for different positions. */ this.containers = new Map();
3520
+ /** Pending add requests waiting for manager to mount */ this.pending = new Map();
3393
3521
  /**
3394
3522
  * Adds a notification
3395
3523
  *
@@ -3404,6 +3532,12 @@ StoryProps.defaultProps = {
3404
3532
  if (container) {
3405
3533
  container.manager = instance;
3406
3534
  }
3535
+ // Process pending requests
3536
+ const queue = this.pending.get(position);
3537
+ if (queue) {
3538
+ queue.forEach((cb)=>cb(instance));
3539
+ this.pending.delete(position);
3540
+ }
3407
3541
  }
3408
3542
  };
3409
3543
  const [Component] = LayerManager$1.renderLayer({
@@ -3428,7 +3562,7 @@ StoryProps.defaultProps = {
3428
3562
  div
3429
3563
  });
3430
3564
  // Render the Component which will trigger the LayerManager's useEffect
3431
- ReactDOM.flushSync(()=>{
3565
+ reactDom.flushSync(()=>{
3432
3566
  root.render(/*#__PURE__*/ jsxRuntime.jsx(Component, {}));
3433
3567
  });
3434
3568
  }
@@ -3436,14 +3570,13 @@ StoryProps.defaultProps = {
3436
3570
  if (container && container.manager) {
3437
3571
  return container.manager.add(options);
3438
3572
  }
3439
- // If manager is not ready yet, wait a bit and retry
3573
+ // If manager is not ready yet, add to pending queue
3440
3574
  return new Promise((resolve)=>{
3441
- setTimeout(()=>{
3442
- const container = this.containers.get(position);
3443
- if (container && container.manager) {
3444
- resolve(container.manager.add(options));
3445
- }
3446
- }, 10);
3575
+ const queue = this.pending.get(position) || [];
3576
+ queue.push((manager)=>{
3577
+ resolve(manager.add(options));
3578
+ });
3579
+ this.pending.set(position, queue);
3447
3580
  });
3448
3581
  };
3449
3582
  /**
@@ -3474,50 +3607,53 @@ StoryProps.defaultProps = {
3474
3607
  };
3475
3608
  }
3476
3609
  }
3477
- /** Export a singleton instance */ var Notification$1 = new Notification();
3610
+ /** Export a singleton instance */ var Notification_default = new Notification();
3478
3611
 
3479
3612
  const SpinnerDiv = /*#__PURE__*/ styled("div", {
3480
- target: "e12p7es30",
3613
+ target: "e14pfj3w0",
3481
3614
  label: "SpinnerDiv"
3482
3615
  })("border:4px solid ", getThemeValue(THEME_NAME.PRIMARY), ";border-top:4px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";border-radius:50%;width:", (props)=>props.size, "px;height:", (props)=>props.size, "px;margin:0 auto;animation:spin 1s linear infinite;@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}");
3483
- function Spinner(props) {
3484
- const { label, ...rest } = props;
3616
+ /**
3617
+ * Spinner Component
3618
+ * @param props - Component props
3619
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
3620
+ */ function SpinnerComponent(props, ref) {
3621
+ const { label = 'Loading', size = 30, ...rest } = props;
3485
3622
  return /*#__PURE__*/ jsxRuntime.jsx(SpinnerDiv, {
3486
3623
  ...rest,
3624
+ ref: ref,
3625
+ size: size,
3487
3626
  role: "status",
3488
- "aria-label": label,
3627
+ "aria-label": label || undefined,
3489
3628
  "aria-live": "polite",
3490
3629
  "aria-busy": "true"
3491
3630
  });
3492
3631
  }
3493
- Spinner.propTypes = {
3494
- /** Spinner's size */ size: PropTypes.number,
3495
- /** Accessible label for screen readers */ label: PropTypes.string
3496
- };
3497
- Spinner.defaultProps = {
3498
- size: 30,
3499
- label: 'Loading'
3500
- };
3632
+ const Spinner = /*#__PURE__*/ React.forwardRef(SpinnerComponent);
3501
3633
 
3502
3634
  const Container$1 = /*#__PURE__*/ styled("div", {
3503
- target: "e1n4tau0",
3635
+ target: "e14em2c80",
3504
3636
  label: "Container"
3505
3637
  })("flex:1;display:flex;flex-direction:column;min-height:400px;");
3506
3638
  const Header = /*#__PURE__*/ styled("div", {
3507
- target: "e1n4tau1",
3639
+ target: "e14em2c81",
3508
3640
  label: "Header"
3509
3641
  })("display:flex;flex-direction:row;justify-content:space-between;border-bottom:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";@media (min-width:601px){&::before{position:absolute;top:25px;left:0;right:0;height:2px;background-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";content:' ';z-index:0;}}& > *{z-index:1;}");
3510
3642
  const HeaderButton = /*#__PURE__*/ styled("button", {
3511
- target: "e1n4tau2",
3643
+ target: "e14em2c82",
3512
3644
  label: "HeaderButton"
3513
3645
  })("border:none;padding:16px 24px 16px 16px;font-size:16px;cursor:pointer;background-color:", (props)=>props.active ? getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR) : getThemeValue(THEME_NAME.BACKGROUND), ";font-weight:", (props)=>props.active ? 'bold' : 'normal', ";overflow:hidden;display:flex;align-items:center;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:disabled{cursor:not-allowed;background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";}&:enabled:hover,&:focus{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHTER), ";}@media (max-width:600px){&{display:none;}}");
3514
3646
  const MobileHeader = /*#__PURE__*/ styled("div", {
3515
- target: "e1n4tau3",
3647
+ target: "e14em2c83",
3516
3648
  label: "MobileHeader"
3517
3649
  })("padding:16px;font-size:16px;line-height:18px;align-items:center;font-weight:bold;flex:1;display:flex;flex-direction:row;justify-content:space-between;@media (min-width:601px){&{display:none;}}");
3518
- function Stepper(props) {
3519
- const [active, setActive] = React.useState(props.active);
3520
- const { children, onStepClick } = props;
3650
+ /**
3651
+ * Stepper Component
3652
+ * @param props - Component props
3653
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
3654
+ */ function StepperComponent(props, ref) {
3655
+ const { active: propsActive = 0, onStepClick, children, ...rest } = props;
3656
+ const [active, setActive] = React.useState(propsActive);
3521
3657
  const childrenArray = React.Children.toArray(children);
3522
3658
  const stepRefs = [];
3523
3659
  const stepClickHandler = (index)=>()=>{
@@ -3549,6 +3685,8 @@ function Stepper(props) {
3549
3685
  }
3550
3686
  };
3551
3687
  return /*#__PURE__*/ jsxRuntime.jsxs(Container$1, {
3688
+ ref: ref,
3689
+ ...rest,
3552
3690
  children: [
3553
3691
  /*#__PURE__*/ jsxRuntime.jsxs(Header, {
3554
3692
  role: "tablist",
@@ -3556,24 +3694,27 @@ function Stepper(props) {
3556
3694
  children: [
3557
3695
  React.Children.map(children, (child, index)=>{
3558
3696
  if (!/*#__PURE__*/ React.isValidElement(child)) return null;
3697
+ const reactElement = child;
3559
3698
  return /*#__PURE__*/ jsxRuntime.jsxs(HeaderButton, {
3560
- ref: (el)=>stepRefs[index] = el,
3699
+ ref: (el)=>{
3700
+ stepRefs[index] = el;
3701
+ },
3561
3702
  active: index === active,
3562
3703
  type: "button",
3563
3704
  role: "tab",
3564
3705
  "aria-selected": index === active,
3565
- "aria-disabled": !!child.props.disabled,
3706
+ "aria-disabled": !!reactElement.props.disabled,
3566
3707
  tabIndex: index === active ? 0 : -1,
3567
- disabled: child.props.disabled,
3708
+ disabled: reactElement.props.disabled,
3568
3709
  onClick: stepClickHandler(index),
3569
3710
  onKeyDown: onStepKeyDown(index),
3570
3711
  children: [
3571
3712
  /*#__PURE__*/ jsxRuntime.jsx(Badge, {
3572
3713
  inline: true,
3573
- type: getBadgeType(index, child.props.completed, child.props.disabled)
3714
+ type: getBadgeType(index, reactElement.props.completed || false, reactElement.props.disabled || false)
3574
3715
  }),
3575
3716
  /*#__PURE__*/ jsxRuntime.jsx(Ellipsis, {
3576
- children: child.props.name
3717
+ children: reactElement.props.name
3577
3718
  })
3578
3719
  ]
3579
3720
  });
@@ -3600,51 +3741,51 @@ function Stepper(props) {
3600
3741
  ]
3601
3742
  });
3602
3743
  }
3603
- Stepper.propTypes = {
3604
- /** Index of currently active step */ active: PropTypes.number,
3605
- /** Callback function for click event on a step */ onStepClick: PropTypes.func
3606
- };
3607
- Stepper.defaultProps = {
3608
- active: 0
3609
- };
3744
+ const Stepper = /*#__PURE__*/ React.forwardRef(StepperComponent);
3610
3745
 
3611
3746
  const Container = /*#__PURE__*/ styled("div", {
3612
- target: "eac2nqz0",
3747
+ target: "e1v23xop0",
3613
3748
  label: "Container"
3614
3749
  })("flex:1;display:flex;flex-direction:column;");
3615
- function Step(props) {
3750
+ /**
3751
+ * Step Component
3752
+ * @param props - Component props
3753
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
3754
+ */ function StepComponent(props, ref) {
3616
3755
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3617
3756
  const { name, disabled, completed, ...rest } = props;
3618
3757
  return /*#__PURE__*/ jsxRuntime.jsx(Container, {
3619
- ...rest
3758
+ ...rest,
3759
+ ref: ref
3620
3760
  });
3621
3761
  }
3622
- Step.defaultProps = {
3623
- disabled: false,
3624
- completed: false
3625
- };
3762
+ const Step = /*#__PURE__*/ React.forwardRef(StepComponent);
3626
3763
 
3627
3764
  const Button = /*#__PURE__*/ styled("button", {
3628
- target: "e6iym3a0",
3765
+ target: "ewz2woa0",
3629
3766
  label: "Button"
3630
3767
  })("background-color:transparent;border:none;padding:8px 12px;font-size:14px;border-radius:3px 3px 0 0;border-bottom:", (props)=>props.active ? `3px solid ${getThemeValue(THEME_NAME.PRIMARY)}` : 'none', ";color:", (props)=>props.active ? getThemeValue(THEME_NAME.PRIMARY) : getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";cursor:pointer;&:hover,&:focus{background-color:", getThemeValue(THEME_NAME.PRIMARY_LIGHTER), ";border-bottom:", (props)=>props.active ? `3px solid ${getThemeValue(THEME_NAME.PRIMARY)}` : `3px solid ${getThemeValue(THEME_NAME.PRIMARY)}`, ";}&[disabled]{background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";color:", getThemeValue(THEME_NAME.DISABLED), ";border-bottom:3px solid ", getThemeValue(THEME_NAME.DISABLED_BORDER), ";}");
3631
3768
  const ButtonContainer = /*#__PURE__*/ styled("div", {
3632
- target: "e6iym3a1",
3769
+ target: "ewz2woa1",
3633
3770
  label: "ButtonContainer"
3634
3771
  })("border-bottom:1px solid ", getThemeValue(THEME_NAME.DISABLED_BORDER), ";margin-bottom:5px;position:relative;");
3635
3772
  const TabBody = /*#__PURE__*/ styled("div", {
3636
- target: "e6iym3a2",
3773
+ target: "ewz2woa2",
3637
3774
  label: "TabBody"
3638
3775
  })("min-height:150px;");
3639
- function Tabs(props) {
3640
- const [active, setActive] = React.useState(props.active);
3641
- const { children } = props;
3776
+ /**
3777
+ * Tabs Component
3778
+ * @param props - Component props
3779
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
3780
+ */ function TabsComponent(props, ref) {
3781
+ const { active: propsActive = 0, onChange, bodyProps, children, ...rest } = props;
3782
+ const [active, setActive] = React.useState(propsActive);
3642
3783
  const tabRefs = [];
3643
3784
  const childrenArray = React.Children.toArray(children);
3644
3785
  const switchTab = (index)=>()=>{
3645
3786
  setActive(index);
3646
3787
  tabRefs[index]?.focus();
3647
- props.onChange?.(index);
3788
+ onChange?.(index);
3648
3789
  };
3649
3790
  // Keyboard navigation for tab buttons
3650
3791
  const onTabKeyDown = (index)=>(e)=>{
@@ -3659,29 +3800,41 @@ function Tabs(props) {
3659
3800
  }
3660
3801
  };
3661
3802
  React.useEffect(()=>{
3662
- setActive(props.active);
3663
- props.onChange?.(props.active);
3803
+ if (propsActive !== undefined) {
3804
+ setActive(propsActive);
3805
+ onChange?.(propsActive);
3806
+ }
3664
3807
  }, [
3665
- props
3808
+ propsActive,
3809
+ onChange
3666
3810
  ]);
3667
3811
  // Generate unique IDs for tabs and panels using sanitized tab name and index
3668
3812
  const sanitize = (str)=>str.replace(/[^a-zA-Z0-9_-]/g, '').toLowerCase();
3669
3813
  const tabIds = childrenArray.map((child, i)=>{
3670
3814
  const name = /*#__PURE__*/ React.isValidElement(child) && child.props.name ? child.props.name : `tab${i}`;
3671
- return `nfui-tab-${sanitize(name)}-${i}`;
3815
+ return `nfui-tab-${sanitize(name || '')}-${i}`;
3672
3816
  });
3673
3817
  const panelIds = childrenArray.map((child, i)=>{
3674
3818
  const name = /*#__PURE__*/ React.isValidElement(child) && child.props.name ? child.props.name : `tab${i}`;
3675
- return `nfui-tabpanel-${sanitize(name)}-${i}`;
3819
+ return `nfui-tabpanel-${sanitize(name || '')}-${i}`;
3676
3820
  });
3821
+ // Sanity check for active index
3822
+ if (active === undefined || active < 0 || active >= childrenArray.length) {
3823
+ return null;
3824
+ }
3677
3825
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
3678
3826
  children: [
3679
3827
  /*#__PURE__*/ jsxRuntime.jsx(ButtonContainer, {
3680
3828
  role: "tablist",
3681
3829
  "aria-label": "Tabs",
3682
- ...props.props,
3683
- children: childrenArray.map((child, index)=>/*#__PURE__*/ jsxRuntime.jsx(Button, {
3684
- ref: (el)=>tabRefs[index] = el,
3830
+ ref: ref,
3831
+ ...rest,
3832
+ children: childrenArray.map((child, index)=>{
3833
+ const reactElement = child;
3834
+ return /*#__PURE__*/ jsxRuntime.jsx(Button, {
3835
+ ref: (el)=>{
3836
+ tabRefs[index] = el;
3837
+ },
3685
3838
  id: tabIds[index],
3686
3839
  type: "button",
3687
3840
  role: "tab",
@@ -3691,31 +3844,24 @@ function Tabs(props) {
3691
3844
  active: active === index,
3692
3845
  onClick: switchTab(index),
3693
3846
  onKeyDown: onTabKeyDown(index),
3694
- disabled: /*#__PURE__*/ React.isValidElement(child) ? child.props.disabled : false,
3695
- "aria-disabled": /*#__PURE__*/ React.isValidElement(child) ? child.props.disabled : false,
3696
- children: /*#__PURE__*/ React.isValidElement(child) ? child.props.name : ''
3697
- }, tabIds[index]))
3847
+ disabled: /*#__PURE__*/ React.isValidElement(child) ? reactElement.props.disabled : false,
3848
+ "aria-disabled": /*#__PURE__*/ React.isValidElement(child) ? reactElement.props.disabled : false,
3849
+ children: /*#__PURE__*/ React.isValidElement(child) ? reactElement.props.name : ''
3850
+ }, tabIds[index]);
3851
+ })
3698
3852
  }),
3699
3853
  /*#__PURE__*/ jsxRuntime.jsx(TabBody, {
3854
+ ...bodyProps,
3700
3855
  id: panelIds[active],
3701
3856
  role: "tabpanel",
3702
3857
  "aria-labelledby": tabIds[active],
3703
3858
  tabIndex: 0,
3704
- ...props.bodyProps,
3705
3859
  children: childrenArray[active]
3706
3860
  })
3707
3861
  ]
3708
3862
  });
3709
3863
  }
3710
- Tabs.propTypes = {
3711
- /** Active Tab Index */ active: PropTypes.number,
3712
- /** OnChange event handler */ onChange: PropTypes.func,
3713
- /** Props for div that contains tab buttons */ props: PropTypes.object,
3714
- /** Props for div that contains tab body */ bodyProps: PropTypes.object
3715
- };
3716
- Tabs.defaultProps = {
3717
- active: 0
3718
- };
3864
+ const Tabs = /*#__PURE__*/ React.forwardRef(TabsComponent);
3719
3865
 
3720
3866
  const Tab = (props)=>{
3721
3867
  const { children } = props;
@@ -3723,13 +3869,6 @@ const Tab = (props)=>{
3723
3869
  children: children
3724
3870
  });
3725
3871
  };
3726
- Tab.propTypes = {
3727
- /** Name of the tab. This shown in the tab's button */ name: PropTypes.string.isRequired,
3728
- /** If the tab is disabled */ disabled: PropTypes.bool
3729
- };
3730
- Tab.defaultProps = {
3731
- disabled: false
3732
- };
3733
3872
 
3734
3873
  var TOAST_TYPE = /*#__PURE__*/ function(TOAST_TYPE) {
3735
3874
  TOAST_TYPE["NORMAL"] = "NORMAL";
@@ -3754,15 +3893,15 @@ const getBackgroundColor = (type)=>{
3754
3893
  }
3755
3894
  };
3756
3895
  const ToastContainer = /*#__PURE__*/ styled(Card, {
3757
- target: "ei8ihm80",
3896
+ target: "e1bc14ug0",
3758
3897
  label: "ToastContainer"
3759
3898
  })("box-sizing:border-box;border-radius:3px;padding:12px;background-color:", (props)=>getBackgroundColor(props.type), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";margin:20px;font-size:14px;line-height:20px;transform:translateY(100%);transition:transform 0.3s ease;width:344px;display:flex;align-items:center;position:relative;& svg{width:20px;height:20px;fill:currentColor;}@media (max-width:480px){&{margin:0;width:100vw;border-radius:0;}}.nf-layer-enter &{transform:translateY(0%);}");
3760
3899
  const TextContainer = /*#__PURE__*/ styled("div", {
3761
- target: "ei8ihm81",
3900
+ target: "e1bc14ug1",
3762
3901
  label: "TextContainer"
3763
3902
  })("flex:1;");
3764
3903
  const CloseContainer = /*#__PURE__*/ styled("button", {
3765
- target: "ei8ihm82",
3904
+ target: "e1bc14ug2",
3766
3905
  label: "CloseContainer"
3767
3906
  })("background-color:transparent;color:", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";padding:6px 10px;border:none;border-radius:3px;text-transform:uppercase;cursor:pointer;&:focus{background-color:rgba(255,255,255,0.1);}");
3768
3907
  const DEFAULT_DURATION = 2000;
@@ -3785,6 +3924,7 @@ const createAriaLiveRegion = (id, ariaLive)=>{
3785
3924
  };
3786
3925
  class Toast {
3787
3926
  add(options) {
3927
+ if (!this.element) return;
3788
3928
  const { text, buttonText, buttonClick, duration, type = "NORMAL" } = options;
3789
3929
  this.currentOptions = options;
3790
3930
  this.isPaused = false;
@@ -3843,9 +3983,9 @@ class Toast {
3843
3983
  if (this.ariaLiveContainer && document.body.contains(this.ariaLiveContainer)) {
3844
3984
  document.body.removeChild(this.ariaLiveContainer);
3845
3985
  }
3846
- this.politeRegion = null;
3847
- this.assertiveRegion = null;
3848
- this.ariaLiveContainer = null;
3986
+ this.politeRegion = undefined;
3987
+ this.assertiveRegion = undefined;
3988
+ this.ariaLiveContainer = undefined;
3849
3989
  };
3850
3990
  /**
3851
3991
  * Set up keyboard listener for dismissing toast with Escape key
@@ -3874,8 +4014,8 @@ class Toast {
3874
4014
  * Update the appropriate live region with toast content
3875
4015
  */ this.updateLiveRegion = (content, isAssertive)=>{
3876
4016
  const region = isAssertive ? this.assertiveRegion : this.politeRegion;
3877
- region.textContent = '';
3878
4017
  if (region) {
4018
+ region.textContent = '';
3879
4019
  // Add content after delay
3880
4020
  setTimeout(()=>{
3881
4021
  if (region) {
@@ -3889,16 +4029,16 @@ class Toast {
3889
4029
  this.toast[1]();
3890
4030
  if (this.timeout) {
3891
4031
  clearTimeout(this.timeout);
3892
- this.timeout = null;
4032
+ this.timeout = undefined;
3893
4033
  }
3894
4034
  }
3895
- this.toast = null;
4035
+ this.toast = undefined;
3896
4036
  this.currentOptions = null;
3897
4037
  this.isPaused = false;
3898
4038
  setTimeout(()=>{
3899
4039
  if (!this.toast && this.root) {
3900
4040
  this.root.unmount();
3901
- this.root = null;
4041
+ this.root = undefined;
3902
4042
  }
3903
4043
  }, 300);
3904
4044
  };
@@ -3943,7 +4083,7 @@ class Toast {
3943
4083
  this.setupKeyboardListeners();
3944
4084
  }
3945
4085
  }
3946
- var Toast$1 = new Toast();
4086
+ var Toast_default = new Toast();
3947
4087
 
3948
4088
  var TOOLTIP_POSITION = /*#__PURE__*/ function(TOOLTIP_POSITION) {
3949
4089
  TOOLTIP_POSITION["TOP"] = "TOP";
@@ -3985,15 +4125,19 @@ const positionHoverStyle = {
3985
4125
  `
3986
4126
  };
3987
4127
  const TooltipDiv = /*#__PURE__*/ styled("div", {
3988
- target: "es4cffs0",
4128
+ target: "e1dfj1r70",
3989
4129
  label: "TooltipDiv"
3990
4130
  })("position:absolute;background-color:", getThemeValue(THEME_NAME.TOOLTIP_COLOR), ";padding:5px;color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:3px;transition:transform 0.3s ease;font-size:12px;z-index:1;", (props)=>positionStyle[props.position]);
3991
4131
  const TooltipContainer = /*#__PURE__*/ styled("div", {
3992
- target: "es4cffs1",
4132
+ target: "e1dfj1r71",
3993
4133
  label: "TooltipContainer"
3994
4134
  })("position:relative;display:inline-flex;justify-content:center;align-items:center;&:hover ", TooltipDiv, ",&:focus-within ", TooltipDiv, "{", (props)=>positionHoverStyle[props.position], "}");
3995
- function Tooltip(props) {
3996
- const { children, position, ...rest } = props;
4135
+ /**
4136
+ * Tooltip Component
4137
+ * @param props - Component props
4138
+ * @param ref - Ref forwarded to the underlying HTMLDivElement
4139
+ */ function TooltipComponent(props, ref) {
4140
+ const { children, position = "BOTTOM", ...rest } = props;
3997
4141
  const tooltipId = React.useId();
3998
4142
  // Clone the child to inject aria-describedby and tabIndex if possible
3999
4143
  const trigger = /*#__PURE__*/ React.isValidElement(children) ? /*#__PURE__*/ React.cloneElement(children, {
@@ -4001,8 +4145,9 @@ function Tooltip(props) {
4001
4145
  tabIndex: children.props && typeof children.props.tabIndex !== 'undefined' ? children.props.tabIndex : 0
4002
4146
  }) : children;
4003
4147
  return /*#__PURE__*/ jsxRuntime.jsxs(TooltipContainer, {
4004
- position: position,
4005
4148
  ...rest,
4149
+ ref: ref,
4150
+ position: position,
4006
4151
  children: [
4007
4152
  trigger,
4008
4153
  /*#__PURE__*/ jsxRuntime.jsx(TooltipDiv, {
@@ -4015,21 +4160,7 @@ function Tooltip(props) {
4015
4160
  ]
4016
4161
  });
4017
4162
  }
4018
- Tooltip.propTypes = {
4019
- /** Text to show in the tooltip */ tooltipText: PropTypes.oneOfType([
4020
- PropTypes.string,
4021
- PropTypes.node
4022
- ]).isRequired,
4023
- /** Position of the tooltip */ position: PropTypes.oneOf([
4024
- "TOP",
4025
- "LEFT",
4026
- "RIGHT",
4027
- "BOTTOM"
4028
- ])
4029
- };
4030
- Tooltip.defaultProps = {
4031
- position: "BOTTOM"
4032
- };
4163
+ const Tooltip = /*#__PURE__*/ React.forwardRef(TooltipComponent);
4033
4164
 
4034
4165
  exports.Accordion = Accordion;
4035
4166
  exports.AccordionStep = AccordionStep;
@@ -4039,7 +4170,7 @@ exports.ActionButton = ActionButton;
4039
4170
  exports.AlertDialog = AlertDialog;
4040
4171
  exports.BADGE_TYPE = BADGE_TYPE;
4041
4172
  exports.Badge = Badge;
4042
- exports.Button = StyledButton;
4173
+ exports.Button = Button$2;
4043
4174
  exports.Card = Card;
4044
4175
  exports.CardBody = Body$1;
4045
4176
  exports.CardFooter = Footer$1;
@@ -4072,7 +4203,7 @@ exports.ModalFooter = Footer$1;
4072
4203
  exports.ModalHeader = Header$1;
4073
4204
  exports.NOTIFICATION_POSITION = NOTIFICATION_POSITION;
4074
4205
  exports.NOTIFICATION_TYPE = NOTIFICATION_TYPE;
4075
- exports.Notification = Notification$1;
4206
+ exports.Notification = Notification_default;
4076
4207
  exports.ORIENTATION = ORIENTATION;
4077
4208
  exports.POPOVER_POSITION = POPOVER_POSITION;
4078
4209
  exports.Popover = Popover;
@@ -4092,7 +4223,7 @@ exports.TOOLTIP_POSITION = TOOLTIP_POSITION;
4092
4223
  exports.Tab = Tab;
4093
4224
  exports.Tabs = Tabs;
4094
4225
  exports.TextArea = TextArea;
4095
- exports.Toast = Toast$1;
4226
+ exports.Toast = Toast_default;
4096
4227
  exports.Toggle = Toggle;
4097
4228
  exports.Tooltip = Tooltip;
4098
4229
  //# sourceMappingURL=index.js.map