@banyan_cloud/roots 2.0.44 → 2.0.46

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.
package/dist/esm/index.js CHANGED
@@ -3647,10 +3647,10 @@ var getCSSVariableValue = function getCSSVariableValue(variable) {
3647
3647
  return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
3648
3648
  };
3649
3649
  var doubleDigitted = function doubleDigitted(number) {
3650
- if (!number) {
3650
+ if (number === undefined) {
3651
3651
  return '';
3652
3652
  }
3653
- return number.toString().slice(-2).padStart(2, '0');
3653
+ return number.toString().padStart(2, '0');
3654
3654
  };
3655
3655
 
3656
3656
  var getJSDateFromEpoch = function getJSDateFromEpoch(epoch) {
@@ -17089,7 +17089,7 @@ var TextField = /*#__PURE__*/forwardRef(function (props, inputRef) {
17089
17089
  }))]
17090
17090
  }), autocompleteOptions && jsx(Popover, {
17091
17091
  anchorEl: anchorEl,
17092
- open: showAutocompleteOptions,
17092
+ open: autocompleteOptions && 'open' in autocompleteOptions ? typeof autocompleteOptions.open === 'function' ? autocompleteOptions.open(String(value !== null && value !== void 0 ? value : '')) : autocompleteOptions.open : showAutocompleteOptions,
17093
17093
  placement: autocompleteOptions.placement,
17094
17094
  middlewareOptions: autocompleteOptions.middlewareOptions,
17095
17095
  withOverlay: false,
@@ -18450,6 +18450,18 @@ var css$l = ".Dialog_module_root__afbc0e34 {\n padding: 0.25rem 0px;\n height:
18450
18450
  var modules_ca1540aa = {"root":"Dialog_module_root__afbc0e34","sm":"Dialog_module_sm__afbc0e34","md":"Dialog_module_md__afbc0e34","footer":"Dialog_module_footer__afbc0e34","cancel":"Dialog_module_cancel__afbc0e34","description":"Dialog_module_description__afbc0e34"};
18451
18451
  n(css$l,{});
18452
18452
 
18453
+ var DIALOG_DEFAULTS = {
18454
+ title: null,
18455
+ description: null,
18456
+ actionText: 'Done',
18457
+ cancelText: 'Dismiss',
18458
+ variant: 'primary',
18459
+ onAction: null,
18460
+ onCancel: null,
18461
+ size: 'md',
18462
+ customAction: null,
18463
+ body: null
18464
+ };
18453
18465
  var Header$1 = function Header(_ref) {
18454
18466
  var title = _ref.title;
18455
18467
  return jsx(Text, {
@@ -18495,9 +18507,6 @@ var Footer$1 = function Footer(_ref2) {
18495
18507
  })]
18496
18508
  });
18497
18509
  };
18498
- /* -------------------------------------------------------------------------- */
18499
- /* Main Dialog component */
18500
- /* -------------------------------------------------------------------------- */
18501
18510
  var DialogBox = /*#__PURE__*/forwardRef(function (_ref3, ref) {
18502
18511
  var _ref3$className = _ref3.className,
18503
18512
  className = _ref3$className === void 0 ? '' : _ref3$className,
@@ -18507,18 +18516,7 @@ var DialogBox = /*#__PURE__*/forwardRef(function (_ref3, ref) {
18507
18516
  _useState2 = _slicedToArray(_useState, 2),
18508
18517
  open = _useState2[0],
18509
18518
  setOpen = _useState2[1];
18510
- var _useState3 = useState({
18511
- title: null,
18512
- description: null,
18513
- actionText: 'Done',
18514
- cancelText: 'Dismiss',
18515
- variant: 'primary',
18516
- onAction: null,
18517
- onCancel: null,
18518
- size: 'md',
18519
- customAction: null,
18520
- body: null
18521
- }),
18519
+ var _useState3 = useState(DIALOG_DEFAULTS),
18522
18520
  _useState4 = _slicedToArray(_useState3, 2),
18523
18521
  dialogProps = _useState4[0],
18524
18522
  setDialogProps = _useState4[1];
@@ -18544,6 +18542,7 @@ var DialogBox = /*#__PURE__*/forwardRef(function (_ref3, ref) {
18544
18542
  var toggle = function toggle() {
18545
18543
  onCancel === null || onCancel === void 0 || onCancel();
18546
18544
  setOpen(false);
18545
+ setDialogProps(DIALOG_DEFAULTS);
18547
18546
  };
18548
18547
  // function exposed through ref
18549
18548
  var dialog = function dialog(appliedDialogProps) {
@@ -18556,7 +18555,6 @@ var DialogBox = /*#__PURE__*/forwardRef(function (_ref3, ref) {
18556
18555
  dialog: dialog
18557
18556
  };
18558
18557
  });
18559
- // open modal when dialogProps are populated
18560
18558
  useEffect(function () {
18561
18559
  if (dialogProps.title && (dialogProps.description || dialogProps.body)) {
18562
18560
  setOpen(true);
@@ -21332,7 +21330,6 @@ var generateOptions = function generateOptions(_ref) {
21332
21330
  onClick: optionData.onClick,
21333
21331
  leftComponent: function leftComponent() {
21334
21332
  return jsx(Maximize, {
21335
- v2: true,
21336
21333
  className: modules_6a0e74b6['expand-icon']
21337
21334
  });
21338
21335
  }
@@ -21375,13 +21372,16 @@ var generateOptions = function generateOptions(_ref) {
21375
21372
  }
21376
21373
  case 'toggle':
21377
21374
  {
21378
- var _styles$toggleBody;
21379
- return jsx(Toggle, {
21375
+ var _styles$toggleBody, _optionData$value;
21376
+ return jsx(Toggle, _objectSpread2({
21380
21377
  className: (_styles$toggleBody = modules_6a0e74b6['toggle-body']) !== null && _styles$toggleBody !== void 0 ? _styles$toggleBody : '',
21381
21378
  smooth: true,
21382
21379
  secondary: !header,
21383
- options: optionData.options
21384
- });
21380
+ options: optionData.options,
21381
+ value: (_optionData$value = optionData.value) !== null && _optionData$value !== void 0 ? _optionData$value : null
21382
+ }, optionData.onChange && {
21383
+ onChange: optionData.onChange
21384
+ }));
21385
21385
  }
21386
21386
  case 'custom':
21387
21387
  {