@economic/taco 0.0.1-alpha.1543 → 0.0.2-alpha.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 (108) hide show
  1. package/dist/components/Backdrop/Backdrop.d.ts +3 -0
  2. package/dist/components/Button/Button.d.ts +39 -1
  3. package/dist/components/Button/util.d.ts +2 -0
  4. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  5. package/dist/components/Combobox/useCombobox.d.ts +3 -3
  6. package/dist/components/Dialog/Context.d.ts +1 -0
  7. package/dist/components/Dialog/Dialog.d.ts +14 -12
  8. package/dist/components/Hanger/Hanger.d.ts +4 -9
  9. package/dist/components/IconButton/IconButton.d.ts +38 -1
  10. package/dist/components/Listbox/Listbox.d.ts +0 -1
  11. package/dist/components/Navigation/Navigation.d.ts +4 -4
  12. package/dist/components/Popover/Popover.d.ts +5 -9
  13. package/dist/components/RadioGroup/RadioGroup.d.ts +5 -5
  14. package/dist/components/Select/Select.d.ts +0 -1
  15. package/dist/components/Select/useSelect.d.ts +5 -4
  16. package/dist/components/Table/Table.storyexample.d.ts +1 -1
  17. package/dist/components/Table/components/PaginatedTable.d.ts +2 -2
  18. package/dist/components/Table/components/Table.d.ts +2 -2
  19. package/dist/components/Table/components/WindowedTable.d.ts +2 -2
  20. package/dist/components/Table/types.d.ts +2 -2
  21. package/dist/components/Tabs/Tabs.d.ts +2 -2
  22. package/dist/components/Tooltip/Tooltip.d.ts +11 -1
  23. package/dist/components/Treeview/Treeview.d.ts +2 -2
  24. package/dist/esm/index.css +75 -170
  25. package/dist/esm/src/components/Backdrop/Backdrop.js +12 -0
  26. package/dist/esm/src/components/Backdrop/Backdrop.js.map +1 -0
  27. package/dist/esm/src/components/Button/Button.js +6 -9
  28. package/dist/esm/src/components/Button/Button.js.map +1 -1
  29. package/dist/esm/src/components/Button/util.js +42 -1
  30. package/dist/esm/src/components/Button/util.js.map +1 -1
  31. package/dist/esm/src/components/Calendar/Calendar.js +1 -1
  32. package/dist/esm/src/components/Checkbox/Checkbox.js +9 -1
  33. package/dist/esm/src/components/Checkbox/Checkbox.js.map +1 -1
  34. package/dist/esm/src/components/Combobox/Combobox.js +28 -24
  35. package/dist/esm/src/components/Combobox/Combobox.js.map +1 -1
  36. package/dist/esm/src/components/Combobox/useCombobox.js +32 -38
  37. package/dist/esm/src/components/Combobox/useCombobox.js.map +1 -1
  38. package/dist/esm/src/components/Datepicker/Datepicker.js +2 -2
  39. package/dist/esm/src/components/Dialog/Context.js +1 -0
  40. package/dist/esm/src/components/Dialog/Context.js.map +1 -1
  41. package/dist/esm/src/components/Dialog/Dialog.js +5 -4
  42. package/dist/esm/src/components/Dialog/Dialog.js.map +1 -1
  43. package/dist/esm/src/components/Dialog/components/Content.js +13 -13
  44. package/dist/esm/src/components/Dialog/components/Content.js.map +1 -1
  45. package/dist/esm/src/components/Dialog/components/Drawer.js +2 -1
  46. package/dist/esm/src/components/Dialog/components/Drawer.js.map +1 -1
  47. package/dist/esm/src/components/Dialog/components/Extra.js +2 -1
  48. package/dist/esm/src/components/Dialog/components/Extra.js.map +1 -1
  49. package/dist/esm/src/components/Dialog/components/Trigger.js +2 -1
  50. package/dist/esm/src/components/Dialog/components/Trigger.js.map +1 -1
  51. package/dist/esm/src/components/Hanger/Hanger.js +12 -9
  52. package/dist/esm/src/components/Hanger/Hanger.js.map +1 -1
  53. package/dist/esm/src/components/IconButton/IconButton.js +9 -11
  54. package/dist/esm/src/components/IconButton/IconButton.js.map +1 -1
  55. package/dist/esm/src/components/Input/util.js +6 -6
  56. package/dist/esm/src/components/Input/util.js.map +1 -1
  57. package/dist/esm/src/components/Listbox/Listbox.js +21 -5
  58. package/dist/esm/src/components/Listbox/Listbox.js.map +1 -1
  59. package/dist/esm/src/components/Listbox/ScrollableList.js +7 -5
  60. package/dist/esm/src/components/Listbox/ScrollableList.js.map +1 -1
  61. package/dist/esm/src/components/Navigation/Navigation.js +5 -4
  62. package/dist/esm/src/components/Navigation/Navigation.js.map +1 -1
  63. package/dist/esm/src/components/Pagination/PageNumbers.js +1 -1
  64. package/dist/esm/src/components/Pagination/Pagination.js +2 -1
  65. package/dist/esm/src/components/Pagination/Pagination.js.map +1 -1
  66. package/dist/esm/src/components/Popover/Popover.js +9 -6
  67. package/dist/esm/src/components/Popover/Popover.js.map +1 -1
  68. package/dist/esm/src/components/RadioGroup/RadioGroup.js +17 -16
  69. package/dist/esm/src/components/RadioGroup/RadioGroup.js.map +1 -1
  70. package/dist/esm/src/components/SearchInput/SearchInput.js +8 -7
  71. package/dist/esm/src/components/SearchInput/SearchInput.js.map +1 -1
  72. package/dist/esm/src/components/Select/Select.js +27 -25
  73. package/dist/esm/src/components/Select/Select.js.map +1 -1
  74. package/dist/esm/src/components/Select/useSelect.js +77 -37
  75. package/dist/esm/src/components/Select/useSelect.js.map +1 -1
  76. package/dist/esm/src/components/Table/components/PaginatedTable.js.map +1 -1
  77. package/dist/esm/src/components/Table/components/Table.js.map +1 -1
  78. package/dist/esm/src/components/Table/components/WindowedTable.js.map +1 -1
  79. package/dist/esm/src/components/Table/hooks/plugins/useRowActions.js +11 -5
  80. package/dist/esm/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  81. package/dist/esm/src/components/Table/hooks/plugins/useRowSelect.js +3 -3
  82. package/dist/esm/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  83. package/dist/esm/src/components/Table/util/renderColumn.js +4 -3
  84. package/dist/esm/src/components/Table/util/renderColumn.js.map +1 -1
  85. package/dist/esm/src/components/Table/util/renderRow.js +4 -3
  86. package/dist/esm/src/components/Table/util/renderRow.js.map +1 -1
  87. package/dist/esm/src/components/Tabs/Tabs.js.map +1 -1
  88. package/dist/esm/src/components/Toast/Toast.js +1 -1
  89. package/dist/esm/src/components/Tooltip/Tooltip.js +11 -10
  90. package/dist/esm/src/components/Tooltip/Tooltip.js.map +1 -1
  91. package/dist/esm/src/components/Tour/Tour.js +2 -2
  92. package/dist/esm/src/components/Treeview/Treeview.js.map +1 -1
  93. package/dist/esm/src/index.js +8 -7
  94. package/dist/esm/src/index.js.map +1 -1
  95. package/dist/esm/src/primitives/Button.js +2 -12
  96. package/dist/esm/src/primitives/Button.js.map +1 -1
  97. package/dist/esm/src/utils/mergeRefs.js +14 -0
  98. package/dist/esm/src/utils/mergeRefs.js.map +1 -0
  99. package/dist/index.css +75 -170
  100. package/dist/index.d.ts +1 -0
  101. package/dist/primitives/Button.d.ts +0 -4
  102. package/dist/taco.cjs.development.js +1688 -1561
  103. package/dist/taco.cjs.development.js.map +1 -1
  104. package/dist/taco.cjs.production.min.js +1 -1
  105. package/dist/taco.cjs.production.min.js.map +1 -1
  106. package/dist/utils/mergeRefs.d.ts +2 -0
  107. package/package.json +4 -4
  108. package/types.json +7297 -0
@@ -9,17 +9,16 @@ var React__default = _interopDefault(React);
9
9
  var cn = _interopDefault(require('classnames'));
10
10
  var AccordionPrimitive = require('@radix-ui/react-accordion');
11
11
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
12
- var ReactDayPicker = _interopDefault(require('react-day-picker'));
12
+ var PopoverPrimitive = require('@radix-ui/react-popover');
13
13
  var uuid = require('uuid');
14
14
  var framerMotion = require('framer-motion');
15
+ var DialogPrimitive = require('@radix-ui/react-dialog');
16
+ var interactions = require('@react-aria/interactions');
17
+ var ReactDayPicker = _interopDefault(require('react-day-picker'));
15
18
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
16
- var Popover$1 = require('reakit/Popover');
17
19
  var keycode = _interopDefault(require('keycode'));
18
20
  var debounce = _interopDefault(require('lodash/debounce'));
19
21
  var dateFns = require('date-fns');
20
- var PopoverPrimitive = require('@radix-ui/react-popover');
21
- var DialogPrimitive = require('@radix-ui/react-dialog');
22
- var interactions = require('@react-aria/interactions');
23
22
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
24
23
  var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
25
24
  var reactTable = require('react-table');
@@ -3188,6 +3187,13 @@ Accordion.Item = Item;
3188
3187
  Accordion.Trigger = Trigger;
3189
3188
  Accordion.Content = Content;
3190
3189
 
3190
+ var Backdrop = function Backdrop(props) {
3191
+ var className = cn('fixed inset-0 cursor-default overflow-y-auto bg-[rgba(50,46,62,0.8)] animate-[fade-in_150ms] aria-hidden:hidden', props.className);
3192
+ return React.createElement("div", Object.assign({}, props, {
3193
+ className: className
3194
+ }));
3195
+ };
3196
+
3191
3197
  var VisuallyHidden = /*#__PURE__*/React.forwardRef(function VisuallyHidden(props, ref) {
3192
3198
  return React.createElement("span", Object.assign({}, props, {
3193
3199
  className: "sr-only",
@@ -3289,43 +3295,16 @@ var getBannerIcon = function getBannerIcon(type) {
3289
3295
  }
3290
3296
  };
3291
3297
 
3292
- var _excluded$3 = ["title", "children", "placement"];
3293
- var Tooltip = function Tooltip(_ref) {
3294
- var title = _ref.title,
3295
- children = _ref.children,
3296
- placement = _ref.placement,
3297
- otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$3);
3298
-
3299
- return React.createElement(TooltipPrimitive.Root, {
3300
- delayDuration: 50
3301
- }, React.createElement(TooltipPrimitive.Trigger, {
3302
- asChild: true
3303
- }, children), React.createElement(TooltipPrimitive.Content, Object.assign({}, otherProps, {
3304
- asChild: true,
3305
- side: placement,
3306
- sideOffset: 5
3307
- }), React.createElement("div", {
3308
- className: "px-2 py-1 rounded-sm wcag-purple text-xs font-bold animate-[fade-in_150ms]",
3309
- "data-taco": "tooltip",
3310
- style: {
3311
- transformOrigin: 'var(--radix-tooltip-content-transform-origin)'
3312
- }
3313
- }, React.createElement(TooltipPrimitive.Arrow, {
3314
- className: "fill-purple stroke-purple"
3315
- }), title)));
3316
- };
3317
-
3318
- var _excluded$4 = ["disabled", "target", "tooltip", "type"];
3298
+ var _excluded$3 = ["disabled", "target", "type"];
3319
3299
  var Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
3320
3300
  var disabled = props.disabled,
3321
3301
  target = props.target,
3322
- tooltip = props.tooltip,
3323
3302
  _props$type = props.type,
3324
3303
  type = _props$type === void 0 ? 'button' : _props$type,
3325
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
3304
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
3326
3305
 
3327
3306
  var Tag = props.href ? 'a' : 'button';
3328
- var button = React.createElement(Tag, Object.assign({}, otherProps, {
3307
+ return React.createElement(Tag, Object.assign({}, otherProps, {
3329
3308
  "aria-disabled": disabled ? 'true' : undefined,
3330
3309
  disabled: disabled,
3331
3310
  target: Tag === 'a' ? target : undefined,
@@ -3334,108 +3313,69 @@ var Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
3334
3313
  }), React.Children.count(props.children) > 1 ? React.Children.map(props.children, function (child) {
3335
3314
  return typeof child === 'string' ? React.createElement("span", null, child) : child;
3336
3315
  }) : props.children);
3337
-
3338
- if (tooltip) {
3339
- return React.createElement(Tooltip, {
3340
- title: tooltip
3341
- }, button);
3342
- }
3343
-
3344
- return button;
3345
3316
  });
3346
3317
 
3347
- var getButtonClasses = function getButtonClasses() {
3348
- return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] leading-6 inline-flex items-center justify-center transition-all delay-100 ease-in border';
3349
- };
3350
- var getAppearanceClasses = function getAppearanceClasses(value, icon) {
3351
- if (icon === void 0) {
3352
- icon = false;
3353
- }
3354
-
3355
- switch (value) {
3356
- case 'primary':
3357
- return "yt-blue-solid border-blue\n focus:bg-blue focus:text-white focus:yt-focus\n active:bg-blue-dark active:text-white \n hover:bg-blue-light hover:border-blue-light hover:text-white\n hover:focus:bg-blue-light hover:focus:border-blue-light hover:focus:text-white\n disabled:hover:yt-blue-solid";
3358
-
3359
- case 'danger':
3360
- return "yt-red-solid border-red\n focus:bg-red focus:text-white focus:yt-focus-red\n active:bg-red-dark active:text-white \n hover:bg-red-light hover:text-white\n hover:focus:bg-red-light hover:focus:text-white\n disabled:hover:yt-red-solid";
3361
-
3362
- case 'ghost':
3363
- return "yt-blue-inverted\n focus:bg-transparent focus:text-blue focus:yt-focus\n active:bg-blue-lightest active:border-blue active:text-blue-dark \n hover:bg-blue-lightest hover:border-blue-light hover:text-blue-light\n hover:focus:bg-blue-lightest hover:focus:border-blue-light hover:focus:text-blue-light\n disabled:hover:yt-blue-inverted";
3364
-
3365
- case 'discrete':
3366
- {
3367
- if (icon) {
3368
- return "bg-transparent text-black border-transparent\n focus:text-black focus:yt-focus\n active:text-black\n hover:text-grey-darkest\n hover:focus:text-grey-darkest\n disabled:hover:yt-transparent";
3369
- }
3370
-
3371
- return "yt-transparent border-transparent\n focus:text-blue focus:yt-focus\n active:text-blue-dark\n hover:text-blue-light\n hover:focus:text-blue-light\n disabled:hover:yt-transparent";
3372
- }
3373
-
3374
- default:
3375
- return "yt-grey-solid border-grey\n focus:bg-grey focus:yt-focus\n active:bg-grey-dark active:text-black\n hover:bg-grey-light hover:text-grey-darkest\n hover:focus:bg-grey-light hover:focus:text-grey-darkest\n disabled:hover:yt-grey-solid";
3376
- }
3377
- };
3378
-
3379
- var _excluded$5 = ["appearance", "icon", "rounded"];
3380
- var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
3381
- var appearance = props.appearance,
3382
- icon = props.icon,
3383
- _props$rounded = props.rounded,
3384
- rounded = _props$rounded === void 0 ? false : _props$rounded,
3385
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
3386
-
3387
- var className = cn(getButtonClasses(), getAppearanceClasses(appearance, true), {
3388
- 'rounded-full': rounded,
3389
- rounded: !rounded,
3390
- 'cursor-not-allowed opacity-50': props.disabled,
3391
- 'focus:yt-focus active:focus:yt-focus': !props.disabled
3392
- }, props.className);
3393
-
3394
- if (!icon) {
3395
- return null;
3396
- }
3318
+ var _excluded$4 = ["title", "children", "placement"];
3319
+ var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
3320
+ var title = props.title,
3321
+ children = props.children,
3322
+ placement = props.placement,
3323
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
3397
3324
 
3398
- return React.createElement(Button, Object.assign({}, otherProps, {
3399
- className: className,
3400
- "data-taco": "icon-button",
3325
+ return React.createElement(TooltipPrimitive.Root, {
3326
+ delayDuration: 50
3327
+ }, React.createElement(TooltipPrimitive.Trigger, {
3328
+ asChild: true,
3401
3329
  ref: ref
3402
- }), React.createElement(Icon, {
3403
- name: icon,
3404
- className: "m-0 p-0"
3405
- }));
3330
+ }, children), React.createElement(TooltipPrimitive.Content, Object.assign({}, otherProps, {
3331
+ asChild: true,
3332
+ side: placement,
3333
+ sideOffset: 3
3334
+ }), React.createElement("div", {
3335
+ className: "wcag-purple animate-[fade-in_150ms] rounded-sm px-2 py-1 text-xs font-bold",
3336
+ "data-taco": "tooltip",
3337
+ style: {
3338
+ transformOrigin: 'var(--radix-tooltip-content-transform-origin)'
3339
+ }
3340
+ }, React.createElement(TooltipPrimitive.Arrow, {
3341
+ className: "fill-purple stroke-purple"
3342
+ }), title)));
3406
3343
  });
3407
3344
 
3408
- var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
3409
- var children = props.children,
3410
- state = props.state,
3411
- onClose = props.onClose;
3412
- var className = cn('bg-white relative flex items-center px-4 h-12 shadow-lg z-10', props.className);
3413
- return React.createElement("div", {
3414
- className: className,
3415
- "data-taco": "banner",
3416
- ref: ref
3417
- }, getBannerIcon(state), children, onClose ? React.createElement(IconButton, {
3418
- className: "ml-auto",
3419
- icon: "close",
3420
- appearance: "discrete",
3421
- onClick: onClose
3422
- }) : null);
3345
+ var _excluded$5 = ["placement"];
3346
+ var UnstyledArrow = /*#__PURE__*/React.forwardRef(function (props, ref) {
3347
+ return React.createElement(PopoverPrimitive.Arrow, {
3348
+ className: "pointer-events-none -mt-px",
3349
+ asChild: true,
3350
+ offset: 2,
3351
+ width: 30,
3352
+ height: 11
3353
+ }, React.createElement("svg", Object.assign({}, props, {
3354
+ ref: ref,
3355
+ viewBox: "0 19 30 11",
3356
+ style: {
3357
+ transform: 'rotateZ(180deg)'
3358
+ }
3359
+ }), React.createElement("path", {
3360
+ className: "text-grey-dark group-focus:text-blue-light fill-current",
3361
+ d: "M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z"
3362
+ }), React.createElement("path", {
3363
+ className: "fill-current",
3364
+ d: "M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"
3365
+ })));
3423
3366
  });
3367
+ var UnstyledContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
3368
+ var side = props.placement,
3369
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
3424
3370
 
3425
- var _excluded$6 = ["appearance", "fluid"];
3426
- var Button$1 = /*#__PURE__*/React.forwardRef(function Button$1(props, ref) {
3427
- var appearance = props.appearance,
3428
- fluid = props.fluid,
3429
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
3430
-
3431
- var className = cn(getButtonClasses(), getAppearanceClasses(appearance), 'rounded px-3', {
3432
- 'cursor-not-allowed opacity-50': props.disabled,
3433
- 'focus:yt-focus active:focus:yt-focus': !props.disabled,
3434
- 'w-full': fluid
3435
- }, props.className);
3436
- return React.createElement(Button, Object.assign({}, otherProps, {
3371
+ var className = cn('border border-transparent rounded p-3 yt-shadow focus:yt-focus outline-none group ', props.className);
3372
+ return React.createElement(PopoverPrimitive.Content, Object.assign({}, otherProps, {
3437
3373
  className: className,
3438
- "data-taco": "button",
3374
+ side: side,
3375
+ sideOffset: 1,
3376
+ style: _extends({}, props.style, {
3377
+ zIndex: 996
3378
+ }),
3439
3379
  ref: ref
3440
3380
  }));
3441
3381
  });
@@ -3494,12 +3434,12 @@ function useTimer(duration, callback) {
3494
3434
  };
3495
3435
  }
3496
3436
 
3497
- var _excluded$7 = ["delay", "label"];
3437
+ var _excluded$6 = ["delay", "label"];
3498
3438
  var Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
3499
3439
  var _props$delay = props.delay,
3500
3440
  delay = _props$delay === void 0 ? 500 : _props$delay,
3501
3441
  label = props.label,
3502
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$7);
3442
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
3503
3443
 
3504
3444
  var _React$useState = React__default.useState(!delay),
3505
3445
  visible = _React$useState[0],
@@ -3582,13 +3522,13 @@ var getBadgeIcon = function getBadgeIcon(type) {
3582
3522
  }
3583
3523
  };
3584
3524
 
3585
- var _excluded$8 = ["content", "lastUpdated", "onClose", "options"];
3525
+ var _excluded$7 = ["content", "lastUpdated", "onClose", "options"];
3586
3526
  var Toast = function Toast(_ref) {
3587
3527
  var content = _ref.content,
3588
3528
  lastUpdated = _ref.lastUpdated,
3589
3529
  handleClose = _ref.onClose,
3590
3530
  options = _ref.options,
3591
- props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
3531
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
3592
3532
 
3593
3533
  var _useLocalization = useLocalization(),
3594
3534
  texts = _useLocalization.texts;
@@ -3651,7 +3591,7 @@ var Toast = function Toast(_ref) {
3651
3591
  }));
3652
3592
  };
3653
3593
 
3654
- var _excluded$9 = ["children"];
3594
+ var _excluded$8 = ["children"];
3655
3595
  var DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
3656
3596
  var ToastContext = /*#__PURE__*/React.createContext({});
3657
3597
 
@@ -3677,7 +3617,7 @@ var insertToastWithoutDuplicates = function insertToastWithoutDuplicates(current
3677
3617
 
3678
3618
  var ToastProvider = function ToastProvider(_ref) {
3679
3619
  var children = _ref.children,
3680
- props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
3620
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
3681
3621
 
3682
3622
  var _React$useState = React.useState([]),
3683
3623
  toasts = _React$useState[0],
@@ -3938,187 +3878,102 @@ var useLocalization = function useLocalization() {
3938
3878
  return useTaco().localization;
3939
3879
  };
3940
3880
 
3941
- var _excluded$a = ["onChange", "value"];
3942
-
3943
- var renderDay = function renderDay(day, modifiers) {
3944
- return modifiers.disabled ? React.createElement("span", {
3945
- className: "dot"
3946
- }) : day.getDate();
3947
- };
3948
-
3949
- var thisYear = /*#__PURE__*/new Date().getFullYear();
3950
- var years = [];
3951
-
3952
- for (var i = thisYear - 10; i <= thisYear + 10; i += 1) {
3953
- years.push(i);
3881
+ function mergeRefs(refs) {
3882
+ return function (value) {
3883
+ refs.forEach(function (ref) {
3884
+ if (typeof ref === 'function') {
3885
+ ref(value);
3886
+ } else if (ref != null) {
3887
+ ref.current = value;
3888
+ }
3889
+ });
3890
+ };
3954
3891
  }
3955
3892
 
3956
- var Navbar = /*#__PURE__*/React.memo(function (_ref) {
3957
- var onMonthChange = _ref.onMonthChange,
3958
- onNextClick = _ref.onNextClick,
3959
- onPreviousClick = _ref.onPreviousClick,
3960
- _ref$value = _ref.value,
3961
- value = _ref$value === void 0 ? new Date() : _ref$value;
3962
-
3893
+ var _excluded$9 = ["children"];
3894
+ var HangerContext = /*#__PURE__*/React.createContext({
3895
+ props: {},
3896
+ ref: null
3897
+ });
3898
+ var Anchor = /*#__PURE__*/React.forwardRef(function (props, ref) {
3899
+ var context = React.useContext(HangerContext);
3900
+ return React.createElement(PopoverPrimitive.Anchor, Object.assign({}, context.props, props, {
3901
+ ref: mergeRefs([context.ref, ref]),
3902
+ asChild: true
3903
+ }));
3904
+ });
3905
+ var Content$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
3963
3906
  var _useLocalization = useLocalization(),
3964
- _useLocalization$text = _useLocalization.texts.calendar,
3965
- actions = _useLocalization$text.actions,
3966
- months = _useLocalization$text.months;
3907
+ texts = _useLocalization.texts;
3967
3908
 
3968
- var handleChange = function handleChange(event) {
3969
- var _event$target$form = event.target.form,
3970
- year = _event$target$form.year,
3971
- month = _event$target$form.month;
3972
- onMonthChange(new Date(year.value, month.value));
3909
+ var className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent', props.className);
3910
+
3911
+ var handleInteractOutside = function handleInteractOutside(event) {
3912
+ event.preventDefault();
3973
3913
  };
3974
3914
 
3975
- return React.createElement("div", {
3976
- className: "flex justify-between items-center mb-2"
3977
- }, React.createElement("form", {
3978
- className: "inline-flex space-x-1"
3979
- }, React.createElement("select", {
3980
- className: "h-8 px-2",
3981
- name: "month",
3982
- onChange: handleChange,
3983
- value: value.getMonth()
3984
- }, months.map(function (month, i) {
3985
- return React.createElement("option", {
3986
- value: i
3987
- }, month);
3988
- })), React.createElement("select", {
3989
- className: "h-8 px-2",
3990
- name: "year",
3991
- onChange: handleChange,
3992
- value: value.getFullYear()
3993
- }, years.map(function (year) {
3994
- return React.createElement("option", {
3995
- value: year
3996
- }, String(year));
3997
- }))), React.createElement("div", null, React.createElement(IconButton, {
3998
- appearance: "discrete",
3999
- icon: "chevron-left",
4000
- "aria-label": actions.previousMonth,
4001
- onClick: function onClick() {
4002
- return onPreviousClick();
4003
- },
4004
- rounded: true
4005
- }), React.createElement(IconButton, {
4006
- appearance: "discrete",
4007
- icon: "chevron-right",
4008
- "aria-label": actions.nextMonth,
4009
- onClick: function onClick() {
4010
- return onNextClick();
4011
- },
4012
- rounded: true
4013
- })));
4014
- });
4015
- var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4016
- var handleChange = props.onChange,
4017
- value = props.value,
4018
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
4019
-
4020
- var _useLocalization2 = useLocalization(),
4021
- locale = _useLocalization2.locale,
4022
- texts = _useLocalization2.texts;
4023
-
4024
- var _React$useState = React.useState(value !== null && value !== void 0 ? value : new Date()),
4025
- visibleMonth = _React$useState[0],
4026
- setVisibleMonth = _React$useState[1];
4027
-
4028
- React.useEffect(function () {
4029
- if (visibleMonth !== value) {
4030
- setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
4031
- }
4032
- }, [value]);
4033
-
4034
- var handleDayClick = function handleDayClick(date, modifiers, event) {
4035
- if (modifiers.outside || modifiers.disabled) {
4036
- return;
4037
- }
4038
-
4039
- handleChange(date, event);
4040
- };
4041
-
4042
- var handleCalendarClickToday = function handleCalendarClickToday() {
4043
- var today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
4044
-
4045
- today.setHours(12);
4046
- today.setMinutes(0);
4047
- today.setSeconds(0);
4048
- handleChange(today);
4049
- };
4050
-
4051
- var className = cn('flex bg-white text-xs p-4', otherProps.className);
4052
- return React.createElement("div", {
4053
- "data-taco": "calendar"
4054
- }, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
3915
+ return React.createElement(UnstyledContent, {
4055
3916
  className: className,
4056
- month: visibleMonth,
4057
- selectedDays: value,
4058
- locale: locale.substring(0, 2),
4059
- firstDayOfWeek: 1,
4060
- months: texts.calendar.months,
4061
- weekdaysShort: texts.calendar.weekdaysShort,
4062
- navbarElement: function navbarElement(navProps) {
4063
- return React.createElement(Navbar, Object.assign({}, navProps, {
4064
- onMonthChange: setVisibleMonth,
4065
- value: visibleMonth
4066
- }));
4067
- },
4068
- onDayClick: handleDayClick,
4069
- onMonthChange: setVisibleMonth,
4070
- onTodayButtonClick: handleCalendarClickToday,
4071
- captionElement: function captionElement() {
4072
- return null;
4073
- },
4074
- todayButton: texts.calendar.actions.today,
4075
- showOutsideDays: true,
4076
- renderDay: renderDay,
4077
- numberOfMonths: 1,
3917
+ "data-taco": "hanger",
3918
+ onInteractOutside: handleInteractOutside,
3919
+ placement: props.placement,
4078
3920
  ref: ref
3921
+ }, props.children, React.createElement(UnstyledArrow, {
3922
+ className: "text-blue"
3923
+ }), React.createElement(PopoverPrimitive.Close, {
3924
+ asChild: true
3925
+ }, React.createElement(IconButton, {
3926
+ appearance: "primary",
3927
+ "aria-label": texts.hanger.close,
3928
+ className: "absolute top-0 right-0 ml-2 mr-2 mt-2 text-white",
3929
+ icon: "close",
3930
+ onClick: props.onClose
4079
3931
  })));
4080
3932
  });
3933
+ var Hanger = /*#__PURE__*/React.forwardRef(function (props, ref) {
3934
+ var children = props.children,
3935
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
4081
3936
 
4082
- var _excluded$b = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
4083
- var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
4084
- var checked = props.checked,
4085
- highlighted = props.highlighted,
4086
- indeterminate = props.indeterminate,
4087
- invalid = props.invalid,
4088
- label = props.label,
4089
- onChange = props.onChange,
4090
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
4091
-
4092
- var className = cn('h-5 w-5 border rounded text-sm', {
4093
- 'mr-2': !!label,
4094
- 'border-grey-dark text-blue focus:border-blue focus:yt-focus': !props.disabled && !invalid,
4095
- 'border-grey text-blue-light cursor-not-allowed': props.disabled,
4096
- 'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
4097
- 'border-red text-red focus:border-red focus:yt-focus-red': invalid && !props.disabled
4098
- }, props.className);
4099
- var element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
4100
- "data-taco": "checkbox",
4101
- checked: indeterminate ? 'indeterminate' : checked,
4102
- className: className,
4103
- onCheckedChange: onChange,
4104
- ref: ref
4105
- }), React.createElement(CheckboxPrimitive.Indicator, {
4106
- className: "flex h-full w-full"
4107
- }, React.createElement(Icon, {
4108
- name: indeterminate ? 'line' : 'tick',
4109
- className: "!h-full !w-full"
4110
- })));
3937
+ var context = React.useMemo(function () {
3938
+ return {
3939
+ props: otherProps,
3940
+ ref: ref
3941
+ };
3942
+ }, [otherProps]);
3943
+ return React.createElement(HangerContext.Provider, {
3944
+ value: context
3945
+ }, React.createElement(PopoverPrimitive.Root, {
3946
+ children: children,
3947
+ defaultOpen: true
3948
+ }));
3949
+ });
3950
+ Hanger.Anchor = Anchor;
3951
+ Hanger.Content = Content$1;
4111
3952
 
4112
- if (label) {
4113
- var labelClassName = cn('flex items-center cursor-pointer', {
4114
- 'cursor-not-allowed text-grey-dark': props.disabled
4115
- });
4116
- return React.createElement("label", {
4117
- className: labelClassName
4118
- }, element, label);
4119
- }
3953
+ /* eslint-disable @typescript-eslint/no-empty-function */
3954
+ var DialogContext = /*#__PURE__*/React.createContext({
3955
+ close: function close() {},
3956
+ draggable: false,
3957
+ drawer: undefined,
3958
+ elements: {
3959
+ drawer: undefined,
3960
+ extra: undefined
3961
+ },
3962
+ onClose: function onClose() {},
3963
+ props: {},
3964
+ ref: null,
3965
+ size: 'sm'
3966
+ });
3967
+ var useCurrentDialog = function useCurrentDialog() {
3968
+ return React.useContext(DialogContext);
3969
+ };
4120
3970
 
4121
- return element;
3971
+ var Trigger$1 = /*#__PURE__*/React.forwardRef(function DialogTrigger(props, ref) {
3972
+ var dialog = useCurrentDialog();
3973
+ return React.createElement(DialogPrimitive.Trigger, Object.assign({}, dialog.props, props, {
3974
+ ref: mergeRefs([dialog.ref, ref]),
3975
+ asChild: true
3976
+ }));
4122
3977
  });
4123
3978
 
4124
3979
  var useProxiedRef = function useProxiedRef(ref) {
@@ -4135,238 +3990,906 @@ var useProxiedRef = function useProxiedRef(ref) {
4135
3990
  return internalRef;
4136
3991
  };
4137
3992
 
4138
- var getInputClasses = function getInputClasses(props) {
4139
- var _cn;
3993
+ var useDraggable = function useDraggable(ref) {
3994
+ var _React$useState = React__default.useState({
3995
+ x: 0,
3996
+ y: 0
3997
+ }),
3998
+ position = _React$useState[0],
3999
+ setPosition = _React$useState[1];
4140
4000
 
4141
- return cn('bg-white text-black text-sm border font-normal not-italic no-underline rounded inline-flex leading-6 px-2 relative w-full text-ellipsis transition-all delay-100 ease-in flex items-center', (_cn = {
4142
- 'cursor-not-allowed text-black bg-grey': props.readOnly,
4143
- 'border-grey text-opacity-25 cursor-not-allowed': props.disabled
4144
- }, _cn[getStateClasses$1(props.state)] = !props.disabled, _cn['bg-[rgba(255,255,0,0.075)]'] = props.highlighted && props.disabled, _cn['bg-[rgba(255,255,0,0.2)]'] = props.highlighted && !props.disabled, _cn));
4145
- };
4146
- var getStateClasses$1 = function getStateClasses(value) {
4147
- switch (value) {
4148
- case 'success':
4149
- return 'border-green hover:shadow-[0_0_0.15rem_theme(colors.green.DEFAULT)] focus:border-green-light focus:yt-focus-green active:border-green-dark';
4001
+ var _useMove = interactions.useMove({
4002
+ onMove: function onMove(event) {
4003
+ var _ref$current;
4150
4004
 
4151
- case 'error':
4152
- return 'border-red hover:shadow-[0_0_0.15rem_theme(colors.red.DEFAULT)] focus:border-red-light focus:yt-focus-red active:border-red-dark';
4005
+ var rect = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect(); // Prevent dragging out of bounds
4153
4006
 
4154
- case 'warning':
4155
- return 'border-yellow-dark hover:shadow-[0_0_0.15rem_theme(colors.yellow.dark)] focus:yt-focus-yellow active:border-yellow-dark';
4007
+ // Prevent dragging out of bounds
4008
+ if (rect && (rect.left + event.deltaX < 0 || rect.right + event.deltaX > window.innerWidth || rect.top + event.deltaY < 0 || rect.bottom + event.deltaY > window.innerHeight)) {
4009
+ return;
4010
+ }
4156
4011
 
4157
- case 'information':
4158
- return 'border-blue hover:shadow-[0_0_0.15rem_theme(colors.blue.dark)] focus:border-blue-light focus:yt-focus active:border-blue-dark';
4012
+ setPosition(function (_ref) {
4013
+ var x = _ref.x,
4014
+ y = _ref.y;
4015
+ x += event.deltaX;
4016
+ y += event.deltaY;
4017
+ return {
4018
+ x: x,
4019
+ y: y
4020
+ };
4021
+ });
4022
+ }
4023
+ }),
4024
+ moveProps = _useMove.moveProps;
4159
4025
 
4160
- default:
4161
- return 'border-grey-dark hover:shadow-[0_0_0.1rem_theme(colors.grey.darker)] focus:border-blue-light focus:yt-focus active:border-blue-dark';
4162
- }
4026
+ return {
4027
+ position: position,
4028
+ handleProps: moveProps
4029
+ };
4163
4030
  };
4164
- var getButtonStateClasses = function getButtonStateClasses(value) {
4165
- switch (value) {
4166
- case 'success':
4167
- return 'border-green focus:border-green-light focus:yt-focus-green peer-focus:border-green-light peer-focus:peer-active:border-green-dark';
4168
-
4169
- case 'error':
4170
- return 'border-red focus:border-red-light focus:yt-focus-red peer-focus:border-red-light peer-focus:peer-active:border-red-dark';
4171
-
4172
- case 'warning':
4173
- return 'border-yellow-dark focus:border-yellow-dark focus:yt-focus-yellow peer-focus:peer-active:border-yellow-dark';
4174
-
4175
- case 'information':
4176
- return 'border-blue focus:border-blue-light peer-focus:border-blue-light peer-focus:peer-active:border-blue-dark';
4177
4031
 
4178
- default:
4179
- return 'border-grey-dark focus:border-blue-light peer-focus:border-blue-light peer-focus:peer-active:border-blue-dark';
4180
- }
4032
+ var MenuContext = /*#__PURE__*/React.createContext(undefined);
4033
+ var useCurrentMenu = function useCurrentMenu() {
4034
+ return React.useContext(MenuContext);
4181
4035
  };
4182
4036
 
4183
- var _excluded$c = ["button", "defaultValue", "icon", "highlighted", "state", "autoFocus"];
4184
- var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
4185
- var button = props.button,
4186
- icon = props.icon,
4187
- state = props.state,
4188
- autoFocus = props.autoFocus,
4189
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$c);
4037
+ var _excluded$a = ["as"];
4038
+ var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
4039
+ var _props$as = props.as,
4040
+ Tag = _props$as === void 0 ? 'span' : _props$as,
4041
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
4190
4042
 
4191
- var inputRef = useProxiedRef(ref);
4192
- var hasContainer = button || icon;
4193
- var className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
4194
- 'pr-8': !!hasContainer
4195
- }, !hasContainer && otherProps.className);
4196
- React.useEffect(function () {
4197
- if (autoFocus && inputRef.current) {
4198
- inputRef.current.focus();
4199
- }
4200
- }, []);
4201
- var input = React.createElement("input", Object.assign({}, otherProps, {
4043
+ var className = cn('flex ', props.className);
4044
+ return React.createElement(Tag, Object.assign({}, otherProps, {
4202
4045
  className: className,
4203
- "data-taco": "input",
4204
- ref: inputRef
4046
+ "data-taco": "group",
4047
+ ref: ref
4205
4048
  }));
4049
+ });
4206
4050
 
4207
- if (hasContainer) {
4208
- var extra;
4209
-
4210
- if (button) {
4211
- var _button$props$disable, _cn;
4212
-
4213
- var disabled = (_button$props$disable = button.props.disabled) !== null && _button$props$disable !== void 0 ? _button$props$disable : otherProps.disabled;
4214
- var buttonClassName = cn('items-center flex justify-center border absolute rounded-l-none rounded-r right-0 h-full focus:rounded focus:outline-none', (_cn = {}, _cn[getButtonStateClasses(state)] = !props.disabled, _cn), button.props.className);
4215
- extra = React.cloneElement(button, {
4216
- className: buttonClassName,
4217
- disabled: disabled
4218
- });
4219
- } else if (icon) {
4220
- var iconClassName = cn('items-center flex justify-center absolute pointer-events-none mr-1 p-px right-0 w-5 top-1/2 -translate-y-1/2', {
4221
- 'text-grey-dark': props.disabled,
4222
- 'text-grey-darkest': !props.disabled
4223
- });
4224
- extra = typeof icon === 'string' ? React.createElement(Icon, {
4225
- className: iconClassName,
4226
- name: icon
4227
- }) : React.cloneElement(icon, {
4228
- className: cn(iconClassName, icon.props.className)
4229
- });
4230
- }
4231
-
4232
- var containerClassName = cn('bg-white inline-flex relative rounded w-full', otherProps.className);
4233
- return React.createElement("div", {
4234
- className: containerClassName,
4235
- "data-taco": "input-container"
4236
- }, input, extra);
4237
- }
4238
-
4239
- return input;
4051
+ var Title = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
4052
+ return React.createElement(DialogPrimitive.Title, Object.assign({}, props, {
4053
+ className: "text-center",
4054
+ ref: ref
4055
+ }));
4240
4056
  });
4057
+ var Footer = /*#__PURE__*/React.forwardRef(function DialogFooter(props, ref) {
4058
+ return React.createElement("div", Object.assign({}, props, {
4059
+ className: "mt-8 flex justify-end",
4060
+ ref: ref
4061
+ }), React.createElement(Group, null, props.children));
4062
+ });
4063
+ var Close$1 = /*#__PURE__*/React.forwardRef(function DialogClose(props, ref) {
4064
+ var dialog = useCurrentDialog();
4065
+ return React.createElement(DialogPrimitive.Close, Object.assign({
4066
+ onClick: dialog.onClose
4067
+ }, props, {
4068
+ ref: ref,
4069
+ asChild: true
4070
+ }));
4071
+ });
4072
+ var Content$2 = /*#__PURE__*/React.forwardRef(function DialogContent(props, ref) {
4073
+ var dialog = useCurrentDialog();
4074
+ var internalRef = useProxiedRef(ref);
4241
4075
 
4242
- var getNextIndexFromKeycode = function getNextIndexFromKeycode(keyCode, length, index, direction) {
4243
- if (direction === void 0) {
4244
- direction = 'vertical';
4245
- }
4246
-
4247
- var previousKey = direction === 'horizontal' ? 'left' : 'up';
4248
- var nextKey = direction === 'horizontal' ? 'right' : 'down';
4249
-
4250
- switch (keyCode) {
4251
- case keycode(previousKey):
4252
- return index !== undefined ? index - 1 < 0 ? 0 : index - 1 : index;
4253
-
4254
- case keycode(nextKey):
4255
- return index !== undefined ? index + 1 >= length ? index : index + 1 : index;
4076
+ var _useDraggable = useDraggable(internalRef),
4077
+ position = _useDraggable.position,
4078
+ dragHandleProps = _useDraggable.handleProps;
4256
4079
 
4257
- case keycode('home'):
4258
- return 0;
4080
+ var _useLocalization = useLocalization(),
4081
+ texts = _useLocalization.texts; // if the dialog was opened by a menu, we need to close the menu when the dialog closes
4082
+ // the menu is still open (and mounted) because it is the trigger for the dialog
4259
4083
 
4260
- case keycode('end'):
4261
- return length - 1;
4262
4084
 
4263
- default:
4264
- return;
4265
- }
4266
- };
4267
- var useListKeyboardNavigation = function useListKeyboardNavigation(length, options) {
4268
- if (length === void 0) {
4269
- length = 0;
4270
- }
4085
+ var menu = useCurrentMenu();
4086
+ var handleCloseAutoFocus;
4271
4087
 
4272
- if (options === void 0) {
4273
- options = {
4274
- direction: 'vertical'
4088
+ if (menu) {
4089
+ handleCloseAutoFocus = function handleCloseAutoFocus() {
4090
+ return menu.close();
4275
4091
  };
4276
4092
  }
4277
4093
 
4278
- var _React$useState = React__default.useState(options.initialIndex),
4279
- index = _React$useState[0],
4280
- setIndex = _React$useState[1];
4094
+ var className = cn('bg-white rounded mt-16 mx-auto', {
4095
+ 'w-128 text-center justify-center': dialog.size === 'dialog',
4096
+ 'w-xs': dialog.size === 'xs',
4097
+ 'w-sm': dialog.size === 'sm',
4098
+ 'w-md': dialog.size === 'md',
4099
+ 'w-lg': dialog.size === 'lg'
4100
+ });
4101
+ var containerClassName = cn('bg-white p-6 rounded relative z-[999]', 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]', {
4102
+ 'rounded-b-none': !!dialog.elements.extra
4103
+ }, props.className); // the chosen behaviour in taco is that outside clicks do not close the dialog
4281
4104
 
4282
- var getNextIndex = function getNextIndex(event) {
4283
- var nextIndex = getNextIndexFromKeycode(event.keyCode, length, index, options.direction);
4105
+ var handleInteractOutside = function handleInteractOutside(event) {
4106
+ return event.preventDefault();
4107
+ };
4284
4108
 
4285
- if (nextIndex !== undefined) {
4286
- event.preventDefault();
4287
- }
4109
+ var output;
4288
4110
 
4289
- return nextIndex;
4290
- };
4111
+ if (typeof props.children === 'function') {
4112
+ output = props.children({
4113
+ drawer: dialog.drawer,
4114
+ close: dialog.close
4115
+ });
4116
+ } else {
4117
+ output = props.children;
4118
+ }
4291
4119
 
4292
- return [index, setIndex, getNextIndex];
4293
- };
4120
+ return React.createElement(DialogPrimitive.Portal, null, React.createElement(DialogPrimitive.Overlay, {
4121
+ asChild: true
4122
+ }, React.createElement(Backdrop, null, React.createElement(DialogPrimitive.Content, Object.assign({}, props, {
4123
+ className: className,
4124
+ onEscapeKeyDown: dialog.onClose,
4125
+ onInteractOutside: handleInteractOutside,
4126
+ onCloseAutoFocus: handleCloseAutoFocus,
4127
+ ref: ref,
4128
+ style: _extends({}, props.style, {
4129
+ left: dialog.draggable ? "calc(50% + " + position.x + "px)" : undefined,
4130
+ top: dialog.draggable ? "calc(50% + " + position.y + "px)" : undefined
4131
+ })
4132
+ }), React.createElement("div", {
4133
+ className: containerClassName,
4134
+ "data-taco": "dialog"
4135
+ }, output, dialog.draggable && React.createElement("div", Object.assign({}, dragHandleProps, {
4136
+ "aria-label": texts.dialog.drag,
4137
+ className: "yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center"
4138
+ })), React.createElement(DialogPrimitive.Close, {
4139
+ asChild: true,
4140
+ onClick: dialog.onClose
4141
+ }, React.createElement(IconButton, {
4142
+ appearance: "discrete",
4143
+ "aria-label": texts.dialog.close,
4144
+ className: "absolute top-0 right-0 mt-2 mr-2",
4145
+ icon: "close"
4146
+ }))), dialog.elements.drawer, dialog.elements.extra))));
4147
+ });
4294
4148
 
4295
- var scrollToChildElement = function scrollToChildElement(parent, child) {
4296
- var clientHeight = parent.clientHeight;
4149
+ var Drawer = /*#__PURE__*/React.forwardRef(function DialogDrawer(props, ref) {
4150
+ var _dialog$drawer, _dialog$drawer2;
4297
4151
 
4298
- if (parent.scrollHeight > clientHeight) {
4299
- var scrollTop = parent.scrollTop;
4300
- var scrollBottom = clientHeight + scrollTop;
4301
- var childBottom = child.offsetTop + child.offsetHeight;
4152
+ var dialog = useCurrentDialog();
4153
+ return React.createElement(framerMotion.motion.div, Object.assign({}, props, {
4154
+ className: "absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left",
4155
+ "data-taco": "dialog-drawer",
4156
+ "aria-hidden": !((_dialog$drawer = dialog.drawer) !== null && _dialog$drawer !== void 0 && _dialog$drawer.open),
4157
+ variants: {
4158
+ visible: {
4159
+ left: '100%',
4160
+ display: 'block',
4161
+ transition: {
4162
+ ease: 'easeOut',
4163
+ duration: 0.2
4164
+ }
4165
+ },
4166
+ hidden: {
4167
+ left: '0%',
4168
+ transition: {
4169
+ ease: 'easeOut',
4170
+ duration: 0.2
4171
+ },
4172
+ transitionEnd: {
4173
+ display: 'none'
4174
+ }
4175
+ }
4176
+ },
4177
+ animate: (_dialog$drawer2 = dialog.drawer) !== null && _dialog$drawer2 !== void 0 && _dialog$drawer2.open ? 'visible' : 'hidden',
4178
+ ref: ref
4179
+ }));
4180
+ });
4302
4181
 
4303
- if (childBottom > scrollBottom) {
4304
- parent.scrollTop = childBottom - clientHeight;
4305
- } else if (child.offsetTop < scrollTop) {
4306
- parent.scrollTop = child.offsetTop;
4307
- }
4308
- }
4309
- };
4182
+ var Extra = /*#__PURE__*/React.forwardRef(function (props, ref) {
4183
+ return React.createElement("div", Object.assign({}, props, {
4184
+ className: "bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left",
4185
+ "data-taco": "dialog-extra",
4186
+ ref: ref
4187
+ }));
4188
+ });
4310
4189
 
4311
- var useListScrollTo = function useListScrollTo(internalRef, itemRefs) {
4312
- var scrollTo = function scrollTo(index) {
4313
- if (internalRef && internalRef.current) {
4314
- if (index !== undefined) {
4315
- var activeRef = itemRefs[index];
4190
+ var _excluded$b = ["children", "draggable", "onClose", "open", "size"];
4316
4191
 
4317
- if (activeRef && activeRef.current) {
4318
- scrollToChildElement(internalRef.current, activeRef.current);
4319
- }
4192
+ var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
4193
+ return React.useMemo(function () {
4194
+ var children = [];
4195
+ var drawer;
4196
+ var extra;
4197
+ React.Children.forEach(initialChildren, function (child) {
4198
+ if (child.type.displayName === 'Drawer') {
4199
+ drawer = child;
4200
+ } else if (child.type.displayName === 'Extra') {
4201
+ extra = child;
4320
4202
  } else {
4321
- internalRef.current.scrollTop = 0;
4203
+ children.push(child);
4322
4204
  }
4323
- }
4324
- };
4325
-
4326
- return {
4327
- scrollTo: scrollTo
4328
- };
4205
+ });
4206
+ return [children, drawer, extra];
4207
+ }, [initialChildren]);
4329
4208
  };
4330
4209
 
4331
- var _excluded$d = ["data", "disabled", "highlighted", "id", "loading", "onChange", "onClick", "onFocus", "onKeyDown", "readOnly", "scrollOnFocus", "state", "value", "multiselect", "selectedIndexes", "allOptionsSelected"],
4332
- _excluded2$1 = ["children", "icon"];
4333
- var getId = function getId(id, value) {
4334
- return id + "_" + value;
4335
- };
4210
+ var Dialog = /*#__PURE__*/React.forwardRef(function (props, ref) {
4211
+ var initialChildren = props.children,
4212
+ _props$draggable = props.draggable,
4213
+ draggable = _props$draggable === void 0 ? false : _props$draggable,
4214
+ onClose = props.onClose,
4215
+ defaultOpen = props.open,
4216
+ _props$size = props.size,
4217
+ size = _props$size === void 0 ? 'sm' : _props$size,
4218
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
4336
4219
 
4337
- var getNextEnabledItem = function getNextEnabledItem(event, data, index) {
4338
- var nextIndex = getNextIndexFromKeycode(event.keyCode, data.length, index);
4220
+ var _useSeparatedChildren = useSeparatedChildren(initialChildren),
4221
+ children = _useSeparatedChildren[0],
4222
+ drawer = _useSeparatedChildren[1],
4223
+ extra = _useSeparatedChildren[2];
4339
4224
 
4340
- if (nextIndex) {
4341
- if (nextIndex === index) {
4342
- return index;
4343
- } else if (data[nextIndex] && data[nextIndex].disabled) {
4344
- return getNextEnabledItem(event, data, nextIndex);
4345
- }
4346
- }
4225
+ var _React$useState = React.useState(defaultOpen),
4226
+ open = _React$useState[0],
4227
+ setOpen = _React$useState[1];
4347
4228
 
4348
- return nextIndex;
4349
- };
4229
+ var _React$useState2 = React.useState(false),
4230
+ drawerOpen = _React$useState2[0],
4231
+ setDrawerOpen = _React$useState2[1];
4350
4232
 
4351
- var ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(props, ref) {
4352
- var data = props.data,
4353
- disabled = props.disabled,
4354
- id = props.id,
4355
- loading = props.loading,
4356
- setCurrentIndex = props.onChange,
4357
- onClick = props.onClick,
4358
- onFocus = props.onFocus,
4359
- onKeyDown = props.onKeyDown,
4360
- readOnly = props.readOnly,
4361
- _props$scrollOnFocus = props.scrollOnFocus,
4362
- scrollOnFocus = _props$scrollOnFocus === void 0 ? false : _props$scrollOnFocus,
4363
- currentIndex = props.value,
4364
- multiselect = props.multiselect,
4365
- _props$selectedIndexe = props.selectedIndexes,
4366
- selectedIndexes = _props$selectedIndexe === void 0 ? [] : _props$selectedIndexe,
4367
- _props$allOptionsSele = props.allOptionsSelected,
4233
+ var context = React.useMemo(function () {
4234
+ return {
4235
+ close: function close() {
4236
+ return setOpen(false);
4237
+ },
4238
+ draggable: draggable,
4239
+ drawer: {
4240
+ open: drawerOpen,
4241
+ toggle: function toggle() {
4242
+ return setDrawerOpen(function (isDrawerOpen) {
4243
+ return !isDrawerOpen;
4244
+ });
4245
+ }
4246
+ },
4247
+ elements: {
4248
+ drawer: drawer,
4249
+ extra: extra
4250
+ },
4251
+ onClose: onClose,
4252
+ props: otherProps,
4253
+ size: size,
4254
+ ref: ref
4255
+ };
4256
+ }, [open, drawerOpen, drawer, extra, otherProps]);
4257
+ return React.createElement(DialogContext.Provider, {
4258
+ value: context
4259
+ }, React.createElement(DialogPrimitive.Root, {
4260
+ children: children,
4261
+ open: open,
4262
+ onOpenChange: setOpen
4263
+ }));
4264
+ });
4265
+ Dialog.Trigger = Trigger$1;
4266
+ Dialog.Content = Content$2;
4267
+ Dialog.Title = Title;
4268
+ Dialog.Footer = Footer;
4269
+ Dialog.Extra = Extra;
4270
+ Dialog.Drawer = Drawer;
4271
+ Dialog.Close = Close$1;
4272
+
4273
+ var _excluded$c = ["children"];
4274
+ var PopoverContext = /*#__PURE__*/React.createContext({
4275
+ props: {},
4276
+ ref: null
4277
+ });
4278
+ var Trigger$2 = /*#__PURE__*/React.forwardRef(function (props, ref) {
4279
+ var context = React.useContext(PopoverContext);
4280
+ return React.createElement(PopoverPrimitive.Trigger, Object.assign({}, context.props, props, {
4281
+ ref: mergeRefs([context.ref, ref]),
4282
+ asChild: true
4283
+ }));
4284
+ });
4285
+ var RenderPropWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
4286
+ var children = _ref.children,
4287
+ onClick = _ref.onClick;
4288
+
4289
+ var close = function close() {
4290
+ onClick(new CustomEvent('hide'));
4291
+ };
4292
+
4293
+ return children({
4294
+ close: close,
4295
+ ref: ref
4296
+ });
4297
+ });
4298
+ var Content$3 = /*#__PURE__*/React.forwardRef(function (props, ref) {
4299
+ var className = cn('bg-white focus:border-blue-light', props.className);
4300
+ var output;
4301
+
4302
+ if (typeof props.children === 'function') {
4303
+ output = React.createElement(PopoverPrimitive.Close, {
4304
+ asChild: true
4305
+ }, React.createElement(RenderPropWrapper, null, props.children));
4306
+ } else {
4307
+ output = props.children;
4308
+ }
4309
+
4310
+ return React.createElement(UnstyledContent, {
4311
+ className: className,
4312
+ placement: props.placement,
4313
+ ref: ref
4314
+ }, output, React.createElement(UnstyledArrow, {
4315
+ className: "text-white"
4316
+ }));
4317
+ });
4318
+ var Close$2 = /*#__PURE__*/React.forwardRef(function (props, ref) {
4319
+ return React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
4320
+ ref: ref,
4321
+ asChild: true
4322
+ }));
4323
+ });
4324
+ var Popover = /*#__PURE__*/React.forwardRef(function (props, ref) {
4325
+ var children = props.children,
4326
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$c);
4327
+
4328
+ var context = React.useMemo(function () {
4329
+ return {
4330
+ props: otherProps,
4331
+ ref: ref
4332
+ };
4333
+ }, [otherProps]);
4334
+ return React.createElement(PopoverContext.Provider, {
4335
+ value: context
4336
+ }, React.createElement(PopoverPrimitive.Root, {
4337
+ children: children
4338
+ }));
4339
+ });
4340
+ Popover.Trigger = Trigger$2;
4341
+ Popover.Content = Content$3;
4342
+ Popover.Close = Close$2;
4343
+
4344
+ var _excluded$d = ["dialog", "hanger", "popover", "tooltip"];
4345
+ var getButtonClasses = function getButtonClasses() {
4346
+ return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] leading-6 inline-flex items-center justify-center transition-all delay-100 ease-in border';
4347
+ };
4348
+ var getAppearanceClasses = function getAppearanceClasses(value, icon) {
4349
+ if (icon === void 0) {
4350
+ icon = false;
4351
+ }
4352
+
4353
+ switch (value) {
4354
+ case 'primary':
4355
+ return "yt-blue-solid border-blue\n focus:bg-blue focus:text-white focus:yt-focus\n active:bg-blue-dark active:text-white \n hover:bg-blue-light hover:border-blue-light hover:text-white\n hover:focus:bg-blue-light hover:focus:border-blue-light hover:focus:text-white\n disabled:hover:yt-blue-solid";
4356
+
4357
+ case 'danger':
4358
+ return "yt-red-solid border-red\n focus:bg-red focus:text-white focus:yt-focus-red\n active:bg-red-dark active:text-white \n hover:bg-red-light hover:text-white\n hover:focus:bg-red-light hover:focus:text-white\n disabled:hover:yt-red-solid";
4359
+
4360
+ case 'ghost':
4361
+ return "yt-blue-inverted\n focus:bg-transparent focus:text-blue focus:yt-focus\n active:bg-blue-lightest active:border-blue active:text-blue-dark \n hover:bg-blue-lightest hover:border-blue-light hover:text-blue-light\n hover:focus:bg-blue-lightest hover:focus:border-blue-light hover:focus:text-blue-light\n disabled:hover:yt-blue-inverted";
4362
+
4363
+ case 'discrete':
4364
+ {
4365
+ if (icon) {
4366
+ return "bg-transparent text-black border-transparent\n focus:text-black focus:yt-focus\n active:text-black\n hover:text-grey-darkest\n hover:focus:text-grey-darkest\n disabled:hover:yt-transparent";
4367
+ }
4368
+
4369
+ return "yt-transparent border-transparent\n focus:text-blue focus:yt-focus\n active:text-blue-dark\n hover:text-blue-light\n hover:focus:text-blue-light\n disabled:hover:yt-transparent";
4370
+ }
4371
+
4372
+ default:
4373
+ return "yt-grey-solid border-grey\n focus:bg-grey focus:yt-focus\n active:bg-grey-dark active:text-black\n hover:bg-grey-light hover:text-grey-darkest\n hover:focus:bg-grey-light hover:focus:text-grey-darkest\n disabled:hover:yt-grey-solid";
4374
+ }
4375
+ };
4376
+ var createButton = function createButton(props, className, ref) {
4377
+ var dialog = props.dialog,
4378
+ hanger = props.hanger,
4379
+ popover = props.popover,
4380
+ tooltip = props.tooltip,
4381
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$d);
4382
+
4383
+ var button = React__default.createElement(Button, Object.assign({}, otherProps, {
4384
+ className: className,
4385
+ ref: ref
4386
+ }));
4387
+
4388
+ if (hanger) {
4389
+ button = React__default.createElement(Hanger, Object.assign({}, hanger.props), React__default.createElement(Hanger.Anchor, null, button), hanger.props.children);
4390
+ }
4391
+
4392
+ if (dialog) {
4393
+ button = React__default.createElement(Dialog, Object.assign({}, dialog.props), React__default.createElement(Dialog.Trigger, null, button), dialog.props.children);
4394
+ }
4395
+
4396
+ if (popover) {
4397
+ button = React__default.createElement(Popover, Object.assign({}, popover.props), React__default.createElement(Popover.Trigger, null, button), popover.props.children);
4398
+ }
4399
+
4400
+ if (tooltip) {
4401
+ button = React__default.createElement(Tooltip, {
4402
+ title: tooltip
4403
+ }, button);
4404
+ }
4405
+
4406
+ return button;
4407
+ };
4408
+
4409
+ var _excluded$e = ["appearance", "icon", "rounded"];
4410
+ var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
4411
+ var appearance = props.appearance,
4412
+ icon = props.icon,
4413
+ _props$rounded = props.rounded,
4414
+ rounded = _props$rounded === void 0 ? false : _props$rounded,
4415
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$e);
4416
+
4417
+ var className = cn(getButtonClasses(), getAppearanceClasses(appearance, true), {
4418
+ 'rounded-full': rounded,
4419
+ rounded: !rounded,
4420
+ 'cursor-not-allowed opacity-50': props.disabled,
4421
+ 'focus:yt-focus active:focus:yt-focus': !props.disabled
4422
+ }, props.className);
4423
+
4424
+ if (!icon) {
4425
+ return null;
4426
+ }
4427
+
4428
+ return createButton(_extends({}, otherProps, {
4429
+ children: React.createElement(Icon, {
4430
+ name: icon,
4431
+ className: "m-0 p-0"
4432
+ }),
4433
+ 'data-taco': 'icon-button'
4434
+ }), className, ref);
4435
+ });
4436
+
4437
+ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
4438
+ var children = props.children,
4439
+ state = props.state,
4440
+ onClose = props.onClose;
4441
+ var className = cn('bg-white relative flex items-center px-4 h-12 shadow-lg z-10', props.className);
4442
+ return React.createElement("div", {
4443
+ className: className,
4444
+ "data-taco": "banner",
4445
+ ref: ref
4446
+ }, getBannerIcon(state), children, onClose ? React.createElement(IconButton, {
4447
+ className: "ml-auto",
4448
+ icon: "close",
4449
+ appearance: "discrete",
4450
+ onClick: onClose
4451
+ }) : null);
4452
+ });
4453
+
4454
+ var _excluded$f = ["appearance", "fluid"];
4455
+ var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
4456
+ var appearance = props.appearance,
4457
+ fluid = props.fluid,
4458
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$f);
4459
+
4460
+ var className = cn(getButtonClasses(), getAppearanceClasses(appearance), 'rounded px-3', {
4461
+ 'cursor-not-allowed opacity-50': props.disabled,
4462
+ 'focus:yt-focus active:focus:yt-focus': !props.disabled,
4463
+ 'w-full': fluid
4464
+ }, props.className);
4465
+ return createButton(_extends({}, otherProps, {
4466
+ 'data-taco': 'button'
4467
+ }), className, ref);
4468
+ });
4469
+
4470
+ var _excluded$g = ["onChange", "value"];
4471
+
4472
+ var renderDay = function renderDay(day, modifiers) {
4473
+ return modifiers.disabled ? React.createElement("span", {
4474
+ className: "dot"
4475
+ }) : day.getDate();
4476
+ };
4477
+
4478
+ var thisYear = /*#__PURE__*/new Date().getFullYear();
4479
+ var years = [];
4480
+
4481
+ for (var i = thisYear - 10; i <= thisYear + 10; i += 1) {
4482
+ years.push(i);
4483
+ }
4484
+
4485
+ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
4486
+ var onMonthChange = _ref.onMonthChange,
4487
+ onNextClick = _ref.onNextClick,
4488
+ onPreviousClick = _ref.onPreviousClick,
4489
+ _ref$value = _ref.value,
4490
+ value = _ref$value === void 0 ? new Date() : _ref$value;
4491
+
4492
+ var _useLocalization = useLocalization(),
4493
+ _useLocalization$text = _useLocalization.texts.calendar,
4494
+ actions = _useLocalization$text.actions,
4495
+ months = _useLocalization$text.months;
4496
+
4497
+ var handleChange = function handleChange(event) {
4498
+ var _event$target$form = event.target.form,
4499
+ year = _event$target$form.year,
4500
+ month = _event$target$form.month;
4501
+ onMonthChange(new Date(year.value, month.value));
4502
+ };
4503
+
4504
+ return React.createElement("div", {
4505
+ className: "flex justify-between items-center mb-2"
4506
+ }, React.createElement("form", {
4507
+ className: "inline-flex space-x-1"
4508
+ }, React.createElement("select", {
4509
+ className: "h-8 px-2",
4510
+ name: "month",
4511
+ onChange: handleChange,
4512
+ value: value.getMonth()
4513
+ }, months.map(function (month, i) {
4514
+ return React.createElement("option", {
4515
+ value: i
4516
+ }, month);
4517
+ })), React.createElement("select", {
4518
+ className: "h-8 px-2",
4519
+ name: "year",
4520
+ onChange: handleChange,
4521
+ value: value.getFullYear()
4522
+ }, years.map(function (year) {
4523
+ return React.createElement("option", {
4524
+ value: year
4525
+ }, String(year));
4526
+ }))), React.createElement("div", null, React.createElement(IconButton, {
4527
+ appearance: "discrete",
4528
+ icon: "chevron-left",
4529
+ "aria-label": actions.previousMonth,
4530
+ onClick: function onClick() {
4531
+ return onPreviousClick();
4532
+ },
4533
+ rounded: true
4534
+ }), React.createElement(IconButton, {
4535
+ appearance: "discrete",
4536
+ icon: "chevron-right",
4537
+ "aria-label": actions.nextMonth,
4538
+ onClick: function onClick() {
4539
+ return onNextClick();
4540
+ },
4541
+ rounded: true
4542
+ })));
4543
+ });
4544
+ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4545
+ var handleChange = props.onChange,
4546
+ value = props.value,
4547
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$g);
4548
+
4549
+ var _useLocalization2 = useLocalization(),
4550
+ locale = _useLocalization2.locale,
4551
+ texts = _useLocalization2.texts;
4552
+
4553
+ var _React$useState = React.useState(value !== null && value !== void 0 ? value : new Date()),
4554
+ visibleMonth = _React$useState[0],
4555
+ setVisibleMonth = _React$useState[1];
4556
+
4557
+ React.useEffect(function () {
4558
+ if (visibleMonth !== value) {
4559
+ setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
4560
+ }
4561
+ }, [value]);
4562
+
4563
+ var handleDayClick = function handleDayClick(date, modifiers, event) {
4564
+ if (modifiers.outside || modifiers.disabled) {
4565
+ return;
4566
+ }
4567
+
4568
+ handleChange(date, event);
4569
+ };
4570
+
4571
+ var handleCalendarClickToday = function handleCalendarClickToday() {
4572
+ var today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
4573
+
4574
+ today.setHours(12);
4575
+ today.setMinutes(0);
4576
+ today.setSeconds(0);
4577
+ handleChange(today);
4578
+ };
4579
+
4580
+ var className = cn('flex bg-white text-xs p-4', otherProps.className);
4581
+ return React.createElement("div", {
4582
+ "data-taco": "calendar"
4583
+ }, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
4584
+ className: className,
4585
+ month: visibleMonth,
4586
+ selectedDays: value,
4587
+ locale: locale.substring(0, 2),
4588
+ firstDayOfWeek: 1,
4589
+ months: texts.calendar.months,
4590
+ weekdaysShort: texts.calendar.weekdaysShort,
4591
+ navbarElement: function navbarElement(navProps) {
4592
+ return React.createElement(Navbar, Object.assign({}, navProps, {
4593
+ onMonthChange: setVisibleMonth,
4594
+ value: visibleMonth
4595
+ }));
4596
+ },
4597
+ onDayClick: handleDayClick,
4598
+ onMonthChange: setVisibleMonth,
4599
+ onTodayButtonClick: handleCalendarClickToday,
4600
+ captionElement: function captionElement() {
4601
+ return null;
4602
+ },
4603
+ todayButton: texts.calendar.actions.today,
4604
+ showOutsideDays: true,
4605
+ renderDay: renderDay,
4606
+ numberOfMonths: 1,
4607
+ ref: ref
4608
+ })));
4609
+ });
4610
+
4611
+ var _excluded$h = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
4612
+ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
4613
+ var checked = props.checked,
4614
+ highlighted = props.highlighted,
4615
+ indeterminate = props.indeterminate,
4616
+ invalid = props.invalid,
4617
+ label = props.label,
4618
+ onChange = props.onChange,
4619
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$h);
4620
+
4621
+ var className = cn('h-5 w-5 border rounded text-sm', {
4622
+ 'mr-2': !!label,
4623
+ 'border-grey-dark text-blue focus:border-blue focus:yt-focus': !props.disabled && !invalid,
4624
+ 'border-grey text-blue-light cursor-not-allowed': props.disabled,
4625
+ 'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
4626
+ 'border-red text-red focus:border-red focus:yt-focus-red': invalid && !props.disabled
4627
+ }, props.className);
4628
+ var handleChange;
4629
+
4630
+ if (onChange) {
4631
+ handleChange = function handleChange(checked) {
4632
+ return onChange(checked === 'indeterminate' ? false : checked);
4633
+ };
4634
+ }
4635
+
4636
+ var element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
4637
+ "data-taco": "checkbox",
4638
+ checked: indeterminate ? 'indeterminate' : checked,
4639
+ className: className,
4640
+ onCheckedChange: handleChange,
4641
+ ref: ref
4642
+ }), React.createElement(CheckboxPrimitive.Indicator, {
4643
+ className: "flex h-full w-full"
4644
+ }, React.createElement(Icon, {
4645
+ name: indeterminate ? 'line' : 'tick',
4646
+ className: "!h-full !w-full"
4647
+ })));
4648
+
4649
+ if (label) {
4650
+ var labelClassName = cn('flex items-center cursor-pointer', {
4651
+ 'cursor-not-allowed text-grey-dark': props.disabled
4652
+ });
4653
+ return React.createElement("label", {
4654
+ className: labelClassName
4655
+ }, element, label);
4656
+ }
4657
+
4658
+ return element;
4659
+ });
4660
+
4661
+ var getInputClasses = function getInputClasses(props) {
4662
+ var _cn;
4663
+
4664
+ return cn('peer bg-white text-black text-sm border font-normal not-italic no-underline rounded inline-flex leading-6 px-2 relative w-full text-ellipsis transition-all delay-100 ease-in flex items-center', (_cn = {
4665
+ 'cursor-not-allowed text-black bg-grey': props.readOnly,
4666
+ 'border-grey text-opacity-25 cursor-not-allowed': props.disabled
4667
+ }, _cn[getStateClasses$1(props.state)] = !props.disabled, _cn['bg-[rgba(255,255,0,0.075)]'] = props.highlighted && props.disabled, _cn['bg-[rgba(255,255,0,0.2)]'] = props.highlighted && !props.disabled, _cn));
4668
+ };
4669
+ var getStateClasses$1 = function getStateClasses(value) {
4670
+ switch (value) {
4671
+ case 'success':
4672
+ return 'border-green hover:shadow-[0_0_0.15rem_theme(colors.green.DEFAULT)] focus:border-green-light focus:yt-focus-green active:border-green-dark';
4673
+
4674
+ case 'error':
4675
+ return 'border-red hover:shadow-[0_0_0.15rem_theme(colors.red.DEFAULT)] focus:border-red-light focus:yt-focus-red active:border-red-dark';
4676
+
4677
+ case 'warning':
4678
+ return 'border-yellow-dark hover:shadow-[0_0_0.15rem_theme(colors.yellow.dark)] focus:yt-focus-yellow active:border-yellow-dark';
4679
+
4680
+ case 'information':
4681
+ return 'border-blue hover:shadow-[0_0_0.15rem_theme(colors.blue.dark)] focus:border-blue-light focus:yt-focus active:border-blue-dark';
4682
+
4683
+ default:
4684
+ return 'border-grey-dark hover:shadow-[0_0_0.1rem_theme(colors.grey.darker)] focus:border-blue-light focus:yt-focus active:border-blue-dark';
4685
+ }
4686
+ };
4687
+ var getButtonStateClasses = function getButtonStateClasses(value) {
4688
+ switch (value) {
4689
+ case 'success':
4690
+ return '!border-green focus:!border-green-light focus:yt-focus-green peer-focus:!border-green-light peer-focus:peer-active:!border-green-dark';
4691
+
4692
+ case 'error':
4693
+ return '!border-red focus:!border-red-light focus:yt-focus-red peer-focus:!border-red-light peer-focus:peer-active:!border-red-dark';
4694
+
4695
+ case 'warning':
4696
+ return '!border-yellow-dark focus:!border-yellow-dark focus:yt-focus-yellow peer-focus:peer-active:!border-yellow-dark';
4697
+
4698
+ case 'information':
4699
+ return '!border-blue focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
4700
+
4701
+ default:
4702
+ return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
4703
+ }
4704
+ };
4705
+
4706
+ var _excluded$i = ["button", "defaultValue", "icon", "highlighted", "state", "autoFocus"];
4707
+ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
4708
+ var button = props.button,
4709
+ icon = props.icon,
4710
+ state = props.state,
4711
+ autoFocus = props.autoFocus,
4712
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$i);
4713
+
4714
+ var inputRef = useProxiedRef(ref);
4715
+ var hasContainer = button || icon;
4716
+ var className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
4717
+ 'pr-8': !!hasContainer
4718
+ }, !hasContainer && otherProps.className);
4719
+ React.useEffect(function () {
4720
+ if (autoFocus && inputRef.current) {
4721
+ inputRef.current.focus();
4722
+ }
4723
+ }, []);
4724
+ var input = React.createElement("input", Object.assign({}, otherProps, {
4725
+ className: className,
4726
+ "data-taco": "input",
4727
+ ref: inputRef
4728
+ }));
4729
+
4730
+ if (hasContainer) {
4731
+ var extra;
4732
+
4733
+ if (button) {
4734
+ var _button$props$disable, _cn;
4735
+
4736
+ var disabled = (_button$props$disable = button.props.disabled) !== null && _button$props$disable !== void 0 ? _button$props$disable : otherProps.disabled;
4737
+ var buttonClassName = cn('items-center flex justify-center border absolute rounded-l-none rounded-r right-0 h-full focus:rounded focus:outline-none', (_cn = {}, _cn[getButtonStateClasses(state)] = !props.disabled, _cn), button.props.className);
4738
+ extra = React.cloneElement(button, {
4739
+ className: buttonClassName,
4740
+ disabled: disabled
4741
+ });
4742
+ } else if (icon) {
4743
+ var iconClassName = cn('items-center flex justify-center absolute pointer-events-none mr-1 p-px right-0 w-5 top-1/2 -translate-y-1/2', {
4744
+ 'text-grey-dark': props.disabled,
4745
+ 'text-grey-darkest': !props.disabled
4746
+ });
4747
+ extra = typeof icon === 'string' ? React.createElement(Icon, {
4748
+ className: iconClassName,
4749
+ name: icon
4750
+ }) : React.cloneElement(icon, {
4751
+ className: cn(iconClassName, icon.props.className)
4752
+ });
4753
+ }
4754
+
4755
+ var containerClassName = cn('bg-white inline-flex relative rounded w-full', otherProps.className);
4756
+ return React.createElement("div", {
4757
+ className: containerClassName,
4758
+ "data-taco": "input-container"
4759
+ }, input, extra);
4760
+ }
4761
+
4762
+ return input;
4763
+ });
4764
+
4765
+ var getNextIndexFromKeycode = function getNextIndexFromKeycode(keyCode, length, index, direction) {
4766
+ if (direction === void 0) {
4767
+ direction = 'vertical';
4768
+ }
4769
+
4770
+ var previousKey = direction === 'horizontal' ? 'left' : 'up';
4771
+ var nextKey = direction === 'horizontal' ? 'right' : 'down';
4772
+
4773
+ switch (keyCode) {
4774
+ case keycode(previousKey):
4775
+ return index !== undefined ? index - 1 < 0 ? 0 : index - 1 : index;
4776
+
4777
+ case keycode(nextKey):
4778
+ return index !== undefined ? index + 1 >= length ? index : index + 1 : index;
4779
+
4780
+ case keycode('home'):
4781
+ return 0;
4782
+
4783
+ case keycode('end'):
4784
+ return length - 1;
4785
+
4786
+ default:
4787
+ return;
4788
+ }
4789
+ };
4790
+ var useListKeyboardNavigation = function useListKeyboardNavigation(length, options) {
4791
+ if (length === void 0) {
4792
+ length = 0;
4793
+ }
4794
+
4795
+ if (options === void 0) {
4796
+ options = {
4797
+ direction: 'vertical'
4798
+ };
4799
+ }
4800
+
4801
+ var _React$useState = React__default.useState(options.initialIndex),
4802
+ index = _React$useState[0],
4803
+ setIndex = _React$useState[1];
4804
+
4805
+ var getNextIndex = function getNextIndex(event) {
4806
+ var nextIndex = getNextIndexFromKeycode(event.keyCode, length, index, options.direction);
4807
+
4808
+ if (nextIndex !== undefined) {
4809
+ event.preventDefault();
4810
+ }
4811
+
4812
+ return nextIndex;
4813
+ };
4814
+
4815
+ return [index, setIndex, getNextIndex];
4816
+ };
4817
+
4818
+ var scrollToChildElement = function scrollToChildElement(parent, child) {
4819
+ var clientHeight = parent.clientHeight;
4820
+
4821
+ if (parent.scrollHeight > clientHeight) {
4822
+ var scrollTop = parent.scrollTop;
4823
+ var scrollBottom = clientHeight + scrollTop;
4824
+ var childBottom = child.offsetTop + child.offsetHeight;
4825
+
4826
+ if (childBottom > scrollBottom) {
4827
+ parent.scrollTop = childBottom - clientHeight;
4828
+ } else if (child.offsetTop < scrollTop) {
4829
+ parent.scrollTop = child.offsetTop;
4830
+ }
4831
+ }
4832
+ };
4833
+
4834
+ var useListScrollTo = function useListScrollTo(internalRef, itemRefs) {
4835
+ var scrollTo = function scrollTo(index) {
4836
+ if (internalRef && internalRef.current) {
4837
+ if (index !== undefined) {
4838
+ var activeRef = itemRefs[index];
4839
+
4840
+ if (activeRef && activeRef.current) {
4841
+ scrollToChildElement(internalRef.current, activeRef.current);
4842
+ }
4843
+ } else {
4844
+ internalRef.current.scrollTop = 0;
4845
+ }
4846
+ }
4847
+ };
4848
+
4849
+ return {
4850
+ scrollTo: scrollTo
4851
+ };
4852
+ };
4853
+
4854
+ var _excluded$j = ["data", "disabled", "highlighted", "id", "loading", "onChange", "onClick", "onFocus", "onKeyDown", "readOnly", "scrollOnFocus", "state", "value", "multiselect", "selectedIndexes", "allOptionsSelected"],
4855
+ _excluded2$1 = ["children", "icon"];
4856
+ var getId = function getId(id, value) {
4857
+ return id + "_" + value;
4858
+ };
4859
+
4860
+ var getNextEnabledItem = function getNextEnabledItem(event, data, index) {
4861
+ var nextIndex = getNextIndexFromKeycode(event.keyCode, data.length, index);
4862
+
4863
+ if (nextIndex) {
4864
+ if (nextIndex === index) {
4865
+ return index;
4866
+ } else if (data[nextIndex] && data[nextIndex].disabled) {
4867
+ return getNextEnabledItem(event, data, nextIndex);
4868
+ }
4869
+ }
4870
+
4871
+ return nextIndex;
4872
+ };
4873
+
4874
+ var ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(props, ref) {
4875
+ var data = props.data,
4876
+ disabled = props.disabled,
4877
+ id = props.id,
4878
+ loading = props.loading,
4879
+ setCurrentIndex = props.onChange,
4880
+ onClick = props.onClick,
4881
+ onFocus = props.onFocus,
4882
+ onKeyDown = props.onKeyDown,
4883
+ readOnly = props.readOnly,
4884
+ _props$scrollOnFocus = props.scrollOnFocus,
4885
+ scrollOnFocus = _props$scrollOnFocus === void 0 ? false : _props$scrollOnFocus,
4886
+ currentIndex = props.value,
4887
+ multiselect = props.multiselect,
4888
+ _props$selectedIndexe = props.selectedIndexes,
4889
+ selectedIndexes = _props$selectedIndexe === void 0 ? [] : _props$selectedIndexe,
4890
+ _props$allOptionsSele = props.allOptionsSelected,
4368
4891
  allOptionsSelected = _props$allOptionsSele === void 0 ? false : _props$allOptionsSele,
4369
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$d);
4892
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$j);
4370
4893
 
4371
4894
  var listRef = useProxiedRef(ref);
4372
4895
  var itemRefs = React.useMemo(function () {
@@ -4437,7 +4960,9 @@ var ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(props
4437
4960
 
4438
4961
  var list = _extends({}, otherProps, {
4439
4962
  className: cn('inline-flex flex-col list-none !p-0 m-0 overflow-y-auto h-auto', getInputClasses(props), {
4440
- 'yt-list--multiselect': multiselect
4963
+ 'yt-list--multiselect': multiselect,
4964
+ 'pointer-events-none': disabled,
4965
+ 'cursor-not-allowed': disabled || readOnly
4441
4966
  }, otherProps.className),
4442
4967
  disabled: disabled,
4443
4968
  id: id,
@@ -4455,7 +4980,7 @@ var ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(props
4455
4980
  'aria-selected': multiselect ? getOptionCheckedState(String(option.value), index) : currentIndex === index,
4456
4981
  'data-focused': currentIndex === index,
4457
4982
  children: option.text,
4458
- className: cn('flex items-center px-3 w-full cursor-pointer bg-white flex-[0_0_2rem] focus:wcag-blue', {
4983
+ className: cn('flex items-center px-3 w-full cursor-pointer bg-white flex-[0_0_2rem] focus:wcag-blue focus:border-blue', {
4459
4984
  'sticky top-0 font-bold': depth === 0 && !!option.hasChildren
4460
4985
  }),
4461
4986
  disabled: option.disabled,
@@ -4482,13 +5007,13 @@ var ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(props
4482
5007
  optionProps = _objectWithoutPropertiesLoose(_ref, _excluded2$1);
4483
5008
 
4484
5009
  return React.createElement("li", Object.assign({}, optionProps), icon, React.createElement("span", {
4485
- className: "flex-grow text-left truncate"
5010
+ className: "flex-grow truncate text-left"
4486
5011
  }, children), multiselect && React.createElement(Checkbox, {
4487
5012
  checked: optionProps['aria-selected'],
4488
5013
  onChange: function onChange() {
4489
5014
  return null;
4490
5015
  },
4491
- className: "ml-2 flex items-center justify-end pointer-events-none overflow-visible p-px"
5016
+ className: "pointer-events-none ml-2 flex items-center justify-end overflow-visible p-px"
4492
5017
  }));
4493
5018
  }) : React.createElement("li", {
4494
5019
  className: "yt-list__empty"
@@ -4546,7 +5071,7 @@ var setInputValueByRef = function setInputValueByRef(input, value, event) {
4546
5071
  input.dispatchEvent(createCustomEvent(event));
4547
5072
  };
4548
5073
 
4549
- var _excluded$e = ["hasChildren", "path"];
5074
+ var _excluded$k = ["hasChildren", "path"];
4550
5075
  var setInputValueByRef$1 = function setInputValueByRef$1(input, value, event) {
4551
5076
  if (event === void 0) {
4552
5077
  event = 'change';
@@ -4664,7 +5189,7 @@ var useFlattenedData = function useFlattenedData(data) {
4664
5189
  };
4665
5190
  var sanitizeItem = function sanitizeItem(item) {
4666
5191
  if (item) {
4667
- var rest = _objectWithoutPropertiesLoose(item, _excluded$e);
5192
+ var rest = _objectWithoutPropertiesLoose(item, _excluded$k);
4668
5193
 
4669
5194
  return rest;
4670
5195
  }
@@ -4728,15 +5253,14 @@ var filterData = function filterData(data, value) {
4728
5253
  });
4729
5254
  };
4730
5255
 
4731
- var _excluded$f = ["aria-label", "aria-labelledby", "data", "defaultValue", "disabled", "id", "inline", "loading", "onChange", "onClick", "onKeyDown", "readOnly", "value"];
5256
+ var _excluded$l = ["aria-label", "aria-labelledby", "data", "defaultValue", "disabled", "id", "inline", "loading", "onChange", "onClick", "onKeyDown", "readOnly", "value"];
4732
5257
 
4733
5258
  var convertToInputValue = function convertToInputValue(value) {
4734
5259
  return String(value !== null && value !== void 0 ? value : '');
4735
5260
  };
4736
5261
 
4737
5262
  var useCombobox = function useCombobox(_ref, ref) {
4738
- var ariaLabel = _ref['aria-label'],
4739
- ariaLabelledBy = _ref['aria-labelledby'],
5263
+ var ariaLabelledBy = _ref['aria-labelledby'],
4740
5264
  _ref$data = _ref.data,
4741
5265
  unfilteredData = _ref$data === void 0 ? [] : _ref$data,
4742
5266
  defaultValue = _ref.defaultValue,
@@ -4747,21 +5271,22 @@ var useCombobox = function useCombobox(_ref, ref) {
4747
5271
  onKeyDown = _ref.onKeyDown,
4748
5272
  readOnly = _ref.readOnly,
4749
5273
  value = _ref.value,
4750
- props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
5274
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
5275
+
5276
+ var inputRef = useProxiedRef(ref);
5277
+ var listRef = React.useRef(null);
5278
+
5279
+ var _React$useState = React.useState(false),
5280
+ open = _React$useState[0],
5281
+ setOpen = _React$useState[1];
4751
5282
 
4752
- var inputRef = useProxiedRef(ref);
4753
- var listRef = React.useRef(null);
4754
- var popover = Popover$1.usePopoverState({
4755
- gutter: 4,
4756
- placement: 'bottom-start'
4757
- });
4758
5283
  var listId = React.useMemo(function () {
4759
5284
  return uuid.v4();
4760
5285
  }, []);
4761
5286
 
4762
- var _React$useState = React.useState(convertToInputValue(value)),
4763
- inputValue = _React$useState[0],
4764
- setInputValue = _React$useState[1];
5287
+ var _React$useState2 = React.useState(convertToInputValue(value)),
5288
+ inputValue = _React$useState2[0],
5289
+ setInputValue = _React$useState2[1];
4765
5290
 
4766
5291
  var shouldFilterData = !inline || inline && inputValue !== convertToInputValue(value);
4767
5292
  var flattenedData = useFlattenedData(unfilteredData);
@@ -4769,9 +5294,9 @@ var useCombobox = function useCombobox(_ref, ref) {
4769
5294
  return shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData;
4770
5295
  }, [shouldFilterData, inputValue, flattenedData]); // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state
4771
5296
 
4772
- var _React$useState2 = React.useState(inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined),
4773
- currentIndex = _React$useState2[0],
4774
- setCurrentIndex = _React$useState2[1];
5297
+ var _React$useState3 = React.useState(inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined),
5298
+ currentIndex = _React$useState3[0],
5299
+ setCurrentIndex = _React$useState3[1];
4775
5300
 
4776
5301
  var setInputValueByIndex = function setInputValueByIndex(index) {
4777
5302
  if (index !== undefined) {
@@ -4819,932 +5344,521 @@ var useCombobox = function useCombobox(_ref, ref) {
4819
5344
  if (inputValue && data.length && !isCurrentValue) {
4820
5345
  setCurrentIndex(0);
4821
5346
 
4822
- if (!popover.visible) {
4823
- popover.show();
5347
+ if (!open) {
5348
+ setOpen(true);
4824
5349
  }
4825
5350
  } else {
4826
- popover.hide();
5351
+ setOpen(false);
4827
5352
  }
4828
5353
  }, [inputValue, data]);
4829
5354
  React.useEffect(function () {
4830
- if (popover.visible) {
5355
+ if (open) {
4831
5356
  setCurrentIndex(getIndexFromValue(data, inputValue) || 0);
4832
5357
  } else {
4833
5358
  setCurrentIndex(undefined);
4834
5359
  }
4835
- }, [popover.visible]); // event handlers
4836
-
4837
- var handleInputBlur = function handleInputBlur(event) {
4838
- event.persist();
4839
-
4840
- if (event.relatedTarget === listRef.current) {
4841
- event.preventDefault();
4842
- return;
4843
- }
4844
-
4845
- if (onChange && event.target.value !== value) {
4846
- var item = findByValue(flattenedData, event.target.value);
4847
- event.detail = sanitizeItem(item);
4848
- var parents = getOptionParents(flattenedData, item === null || item === void 0 ? void 0 : item.path);
4849
-
4850
- if (parents !== null && parents.length > 0) {
4851
- event.detail.parents = parents;
4852
- }
4853
-
4854
- onChange(event);
4855
- }
4856
-
4857
- if (props.onBlur) {
4858
- props.onBlur(event);
4859
- }
4860
- };
4861
-
4862
- var handleInputChange = function handleInputChange(event) {
4863
- setInputValue(event.target.value);
4864
- };
4865
-
4866
- var handleInputClick = function handleInputClick(event) {
4867
- if (inline || !popover.visible && inputValue && data.length) {
4868
- popover.show();
4869
- }
4870
-
4871
- if (onClick) {
4872
- event.persist();
4873
- onClick(event);
4874
- }
4875
- };
4876
-
4877
- var handleInputKeyDown = function handleInputKeyDown(event) {
4878
- event.persist();
4879
-
4880
- switch (event.keyCode) {
4881
- case keycode('backspace'):
4882
- {
4883
- return;
4884
- }
4885
-
4886
- case keycode('escape'):
4887
- {
4888
- event.preventDefault();
4889
- setInputValue(convertToInputValue(value));
4890
- popover.hide();
4891
- return;
4892
- }
4893
-
4894
- case keycode('tab'):
4895
- case keycode('enter'):
4896
- {
4897
- if (event.keyCode !== keycode('tab')) {
4898
- event.preventDefault();
4899
- }
4900
-
4901
- setCurrentValue(currentIndex);
4902
- popover.hide();
4903
- return;
4904
- }
4905
-
4906
- case keycode('up'):
4907
- case keycode('down'):
4908
- case keycode('home'):
4909
- case keycode('end'):
4910
- {
4911
- if (popover.visible) {
4912
- event.preventDefault();
4913
- }
4914
-
4915
- break;
4916
- }
4917
- } // we aren't focused on the list, so manually forward the keydown event to it
4918
-
4919
-
4920
- if (listRef.current) {
4921
- listRef.current.dispatchEvent(createCustomKeyboardEvent(event));
4922
- }
4923
-
4924
- if (inline && !popover.visible) {
4925
- if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {
4926
- event.preventDefault();
4927
- var initialIndex = event.keyCode === keycode('up') ? data.length - 1 : 0;
4928
- setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);
4929
- popover.show();
4930
- }
4931
- }
4932
-
4933
- if (!event.isDefaultPrevented() && onKeyDown) {
4934
- event.persist();
4935
- onKeyDown(event);
4936
- }
4937
- };
4938
-
4939
- var handleListboxChange = function handleListboxChange(index) {
4940
- setCurrentIndex(index);
4941
- };
4942
-
4943
- var handleListboxClick = function handleListboxClick(event, index) {
4944
- event.preventDefault();
4945
- setCurrentValue(index);
4946
- popover.hide();
4947
- };
4948
-
4949
- var combobox = {
4950
- 'aria-expanded': popover.visible,
4951
- 'aria-owns': listId,
4952
- 'aria-haspopup': 'listbox',
4953
- role: 'combobox'
4954
- };
4955
-
4956
- var input = _extends({}, props, {
4957
- 'aria-controls': listId,
4958
- // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions
4959
- // are related to the string that is present in the textbox
4960
- 'aria-autocomplete': 'list',
4961
- // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element
4962
- 'aria-activedescendant': currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,
4963
- 'aria-labelledby': ariaLabelledBy,
4964
- disabled: disabled,
4965
- onBlur: !disabled && !readOnly ? handleInputBlur : undefined,
4966
- onChange: !disabled && !readOnly ? handleInputChange : undefined,
4967
- onClick: !disabled && !readOnly ? handleInputClick : undefined,
4968
- onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,
4969
- readOnly: readOnly,
4970
- ref: inputRef,
4971
- type: 'text',
4972
- value: inputValue || ''
4973
- });
4974
-
4975
- var list = {
4976
- 'aria-labelledby': ariaLabelledBy,
4977
- data: data,
4978
- disabled: disabled,
4979
- id: listId,
4980
- onChange: handleListboxChange,
4981
- onClick: handleListboxClick,
4982
- ref: listRef,
4983
- scrollOnFocus: false,
4984
- tabIndex: -1,
4985
- value: currentIndex
4986
- };
4987
- return {
4988
- combobox: combobox,
4989
- input: input,
4990
- list: list,
4991
- popover: _extends({}, popover, {
4992
- visible: !data.length ? false : popover.visible,
4993
- container: {
4994
- tabIndex: -1,
4995
- 'aria-label': ariaLabel,
4996
- 'aria-labelledby': ariaLabelledBy,
4997
- unstable_initialFocusRef: inputRef
4998
- }
4999
- })
5000
- };
5001
- };
5002
-
5003
- var getVisibility = function getVisibility(element) {
5004
- return Boolean(element && (element.offsetWidth || element.offsetHeight || element.getClientRects().length));
5005
- };
5006
-
5007
- var useBoundingClientRectListener = function useBoundingClientRectListener(ref) {
5008
- var _React$useState = React.useState(undefined),
5009
- dimensions = _React$useState[0],
5010
- setDimensions = _React$useState[1];
5011
-
5012
- var isRefElementVisible = getVisibility(ref.current);
5013
-
5014
- var _React$useState2 = React.useState(isRefElementVisible),
5015
- visibility = _React$useState2[0],
5016
- setVisibility = _React$useState2[1];
5017
-
5018
- var resize = function resize() {
5019
- if (visibility) {
5020
- var _ref$current;
5021
-
5022
- setDimensions((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect());
5023
- }
5024
- };
5025
-
5026
- React.useEffect(function () {
5027
- var timeout = setTimeout(resize, 0);
5028
- var debouncedResize = debounce(resize, 250);
5029
- window.addEventListener('resize', debouncedResize);
5030
- return function () {
5031
- clearTimeout(timeout);
5032
- window.removeEventListener('resize', debouncedResize);
5033
- };
5034
- }, [ref.current, visibility]);
5035
- React.useEffect(function () {
5036
- var newRefElementVisibility = getVisibility(ref.current);
5037
-
5038
- if (visibility !== newRefElementVisibility) {
5039
- // When visibility of an element changes, then the new visibility of the element can only be checked after the
5040
- // component has rendered. That's why the visibility check is inside the useEffect. This useEffect will cause
5041
- // the consumer to rerender and that will cause the above hook to recalculate the dimensions
5042
- setVisibility(newRefElementVisibility);
5043
- }
5044
- });
5045
- return dimensions;
5046
- };
5047
-
5048
- var _excluded$g = ["className", "style"],
5049
- _excluded2$2 = ["container"];
5050
- var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
5051
- var externalClassName = props.className,
5052
- style = props.style,
5053
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$g);
5054
-
5055
- var _useCombobox = useCombobox(otherProps, ref),
5056
- combobox = _useCombobox.combobox,
5057
- input = _useCombobox.input,
5058
- popover = _useCombobox.popover,
5059
- list = _useCombobox.list;
5060
-
5061
- var container = popover.container,
5062
- base = _objectWithoutPropertiesLoose(popover, _excluded2$2);
5063
-
5064
- var internalRef = React.useRef(null);
5065
- var selectDimensions = useBoundingClientRectListener(internalRef);
5066
- var className = cn('inline-flex relative', {
5067
- 'yt-combobox--inline': props.inline
5068
- }, externalClassName);
5069
- return React.createElement("span", {
5070
- className: className,
5071
- "data-taco": "combobox",
5072
- style: style
5073
- }, React.createElement(Popover$1.PopoverDisclosure, Object.assign({}, base, {
5074
- ref: internalRef
5075
- }), function (_ref) {
5076
- var ref = _ref.ref;
5077
- return React.createElement("span", Object.assign({}, combobox, {
5078
- className: "w-full",
5079
- ref: ref
5080
- }), React.createElement(Input, Object.assign({}, input, {
5081
- autoComplete: "off",
5082
- button: props.inline ? React.createElement(IconButton, {
5083
- icon: popover.visible ? 'chevron-up' : 'chevron-down',
5084
- onClick: popover.toggle,
5085
- tabIndex: -1
5086
- }) : props.button
5087
- })));
5088
- }), !otherProps.disabled && React.createElement(Popover$1.Popover, Object.assign({}, base, container), React.createElement(ScrollableList, Object.assign({}, list, {
5089
- className: cn('border-blue w-auto max-w-[theme(spacing.96)] max-h-[calc(12rem+2px)]'),
5090
- style: {
5091
- minWidth: selectDimensions === null || selectDimensions === void 0 ? void 0 : selectDimensions.width
5092
- },
5093
- tabIndex: popover.visible ? 0 : -1
5094
- }))));
5095
- });
5096
-
5097
- var format = function format(date, mask) {
5098
- if (mask === void 0) {
5099
- mask = 'dd.mm.yy';
5100
- }
5101
-
5102
- if (!date) {
5103
- return undefined;
5104
- }
5360
+ }, [open]); // event handlers
5105
5361
 
5106
- var value = dateFns.isDate(date) ? date : dateFns.toDate(date);
5107
-
5108
- if (!dateFns.isValid(value)) {
5109
- return undefined;
5110
- }
5111
-
5112
- var pad = function pad(v) {
5113
- return String(v).length === 1 ? "0" + v : v.toString();
5114
- };
5115
-
5116
- return mask.replace('dd', pad(value.getDate())).replace('mm', pad(value.getMonth() + 1)).replace('yy', String(value.getFullYear()).slice(2));
5117
- };
5118
- var parseFromCustomString = function parseFromCustomString(date, mask) {
5119
- if (date === void 0) {
5120
- date = '';
5121
- }
5362
+ var handleInputBlur = function handleInputBlur(event) {
5363
+ event.persist();
5122
5364
 
5123
- if (mask === void 0) {
5124
- mask = 'dd.mm.yy';
5125
- }
5365
+ if (event.relatedTarget === listRef.current) {
5366
+ event.preventDefault();
5367
+ return;
5368
+ }
5126
5369
 
5127
- if (!date || !date.length) {
5128
- return undefined;
5129
- }
5370
+ if (onChange && event.target.value !== value) {
5371
+ var item = findByValue(flattenedData, event.target.value);
5372
+ event.detail = sanitizeItem(item);
5373
+ var parents = getOptionParents(flattenedData, item === null || item === void 0 ? void 0 : item.path);
5130
5374
 
5131
- var sanitizedMask = mask.split(/[^dmy]/);
5132
- var dd = sanitizedMask.findIndex(function (x) {
5133
- return x === 'dd';
5134
- });
5135
- var mm = sanitizedMask.findIndex(function (x) {
5136
- return x === 'mm';
5137
- });
5138
- var yy = sanitizedMask.findIndex(function (x) {
5139
- return x === 'yy' || x === 'yyyy';
5140
- });
5141
- var day;
5142
- var month;
5143
- var year;
5375
+ if (parents !== null && parents.length > 0) {
5376
+ event.detail.parents = parents;
5377
+ }
5144
5378
 
5145
- var getFullYear = function getFullYear(y) {
5146
- if (y && y.length === 2) {
5147
- var z = Number.parseInt(y, 10);
5148
- return z > 50 ? "19" + y : "20" + y;
5379
+ onChange(event);
5149
5380
  }
5150
5381
 
5151
- return y;
5382
+ if (props.onBlur) {
5383
+ props.onBlur(event);
5384
+ }
5152
5385
  };
5153
5386
 
5154
- var inputParts = date.split(/\D/);
5387
+ var handleInputChange = function handleInputChange(event) {
5388
+ setInputValue(event.target.value);
5389
+ };
5155
5390
 
5156
- if (inputParts.length === 1) {
5157
- var fullDate = inputParts[0];
5158
- var unseparatedMask = mask.replace(/[^dmy]/g, '');
5159
- day = fullDate.slice(unseparatedMask.indexOf('d'), unseparatedMask.lastIndexOf('d') + 1);
5160
- month = fullDate.slice(unseparatedMask.indexOf('m'), unseparatedMask.lastIndexOf('m') + 1);
5161
- year = getFullYear(fullDate.slice(unseparatedMask.indexOf('y'), unseparatedMask.lastIndexOf('y') + 3)); // account for full years
5162
- } else {
5163
- day = inputParts[dd];
5164
- month = inputParts[mm];
5165
- year = getFullYear(inputParts[yy]);
5166
- }
5391
+ var handleInputClick = function handleInputClick(event) {
5392
+ if (inline || !open && inputValue && data.length) {
5393
+ setOpen(true);
5394
+ }
5167
5395
 
5168
- day = Number.parseInt(day, 10);
5169
- month = Number.parseInt(month, 10);
5170
- year = Number.parseInt(year, 10);
5171
- var currentDate = new Date();
5172
- return new Date(
5173
- /* year */
5174
- Object.is(year, NaN) ? currentDate.getFullYear() : year,
5175
- /* month */
5176
- Object.is(month, NaN) ? currentDate.getMonth() : month - 1, // months are zero based in javascript, so subtract a day
5396
+ if (onClick) {
5397
+ event.persist();
5398
+ onClick(event);
5399
+ }
5400
+ };
5177
5401
 
5178
- /* day */
5179
- Object.is(day, NaN) ? currentDate.getDate() : day,
5180
- /* hours */
5181
- 12,
5182
- /* minutes */
5183
- 0 // set to midday to avoid UTC offset causing dates to be mismatched server side
5184
- );
5185
- };
5186
- var parseFromISOString = function parseFromISOString(date) {
5187
- var tempDate = new Date(date);
5188
- return dateFns.isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;
5189
- };
5402
+ var handleInputKeyDown = function handleInputKeyDown(event) {
5403
+ event.persist();
5190
5404
 
5191
- var _excluded$h = ["defaultValue", "calendar", "onBlur", "onChange", "value"];
5192
- var useDatepicker = function useDatepicker(_ref, ref) {
5193
- var calendar = _ref.calendar,
5194
- onBlur = _ref.onBlur,
5195
- onChange = _ref.onChange,
5196
- value = _ref.value,
5197
- props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
5405
+ switch (event.keyCode) {
5406
+ case keycode('backspace'):
5407
+ {
5408
+ return;
5409
+ }
5198
5410
 
5199
- var inputRef = useProxiedRef(ref);
5411
+ case keycode('escape'):
5412
+ {
5413
+ event.preventDefault();
5414
+ setInputValue(convertToInputValue(value));
5415
+ setOpen(false);
5416
+ return;
5417
+ }
5200
5418
 
5201
- var _useLocalization = useLocalization(),
5202
- formatting = _useLocalization.formatting;
5419
+ case keycode('tab'):
5420
+ case keycode('enter'):
5421
+ {
5422
+ if (event.keyCode !== keycode('tab')) {
5423
+ event.preventDefault();
5424
+ }
5203
5425
 
5204
- var _React$useState = React.useState(value ? format(value, formatting.date) : ''),
5205
- internalValue = _React$useState[0],
5206
- setInternalValue = _React$useState[1]; // update internal value if it changed 'externally'
5426
+ setCurrentValue(currentIndex);
5427
+ setOpen(false);
5428
+ return;
5429
+ }
5207
5430
 
5431
+ case keycode('up'):
5432
+ case keycode('down'):
5433
+ case keycode('home'):
5434
+ case keycode('end'):
5435
+ {
5436
+ if (open) {
5437
+ event.preventDefault();
5438
+ }
5208
5439
 
5209
- React.useEffect(function () {
5210
- if (value) {
5211
- var formattedValue = format(value, formatting.date);
5440
+ break;
5441
+ }
5442
+ } // we aren't focused on the list, so manually forward the keydown event to it
5212
5443
 
5213
- if (formattedValue !== internalValue) {
5214
- setInternalValue(formattedValue);
5215
- }
5216
- } else {
5217
- setInternalValue('');
5218
- }
5219
- }, [value]); // event handlers
5220
5444
 
5221
- var handleInputBlur = function handleInputBlur(event) {
5222
- event.persist();
5223
- var valueAsDate = parseFromCustomString(event.target.value);
5224
- var formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
5225
- event.target.value = formattedValue;
5445
+ if (listRef.current) {
5446
+ listRef.current.dispatchEvent(createCustomKeyboardEvent(event));
5447
+ }
5226
5448
 
5227
- if (onChange) {
5228
- event.detail = valueAsDate;
5229
- onChange(event);
5230
- } else {
5231
- // update the internal value to use the formatted date
5232
- setInternalValue(formattedValue);
5449
+ if (inline && !open) {
5450
+ if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {
5451
+ event.preventDefault();
5452
+ var initialIndex = event.keyCode === keycode('up') ? data.length - 1 : 0;
5453
+ setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);
5454
+ setOpen(true);
5455
+ }
5233
5456
  }
5234
5457
 
5235
- if (onBlur) {
5236
- onBlur(event);
5458
+ if (!event.isDefaultPrevented() && onKeyDown) {
5459
+ event.persist();
5460
+ onKeyDown(event);
5237
5461
  }
5238
5462
  };
5239
5463
 
5240
- var handleInputChange = function handleInputChange(event) {
5241
- setInternalValue(event.target.value);
5464
+ var handleListboxChange = function handleListboxChange(index) {
5465
+ setCurrentIndex(index);
5242
5466
  };
5243
5467
 
5244
- var handleChange = function handleChange(date) {
5245
- setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');
5468
+ var handleListboxClick = function handleListboxClick(event, index) {
5469
+ event.preventDefault();
5470
+ setCurrentValue(index);
5471
+ setOpen(false);
5246
5472
  };
5247
5473
 
5248
- var inputProps = _extends({}, props, {
5249
- autoComplete: 'off',
5250
- onBlur: handleInputBlur,
5251
- onChange: handleInputChange,
5474
+ var combobox = {
5475
+ 'aria-expanded': open,
5476
+ 'aria-owns': listId,
5477
+ 'aria-haspopup': 'listbox',
5478
+ role: 'combobox'
5479
+ };
5480
+
5481
+ var input = _extends({}, props, {
5482
+ 'aria-controls': listId,
5483
+ // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions
5484
+ // are related to the string that is present in the textbox
5485
+ 'aria-autocomplete': 'list',
5486
+ // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element
5487
+ 'aria-activedescendant': currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,
5488
+ 'aria-labelledby': ariaLabelledBy,
5489
+ disabled: disabled,
5490
+ onBlur: !disabled && !readOnly ? handleInputBlur : undefined,
5491
+ onChange: !disabled && !readOnly ? handleInputChange : undefined,
5492
+ onClick: !disabled && !readOnly ? handleInputClick : undefined,
5493
+ onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,
5494
+ readOnly: readOnly,
5252
5495
  ref: inputRef,
5253
5496
  type: 'text',
5254
- value: internalValue
5255
- });
5256
-
5257
- var calendarProps = _extends({}, calendar, {
5258
- onChange: handleChange,
5259
- value: value
5497
+ value: inputValue || ''
5260
5498
  });
5261
5499
 
5500
+ var list = {
5501
+ 'aria-labelledby': ariaLabelledBy,
5502
+ data: data,
5503
+ disabled: disabled,
5504
+ id: listId,
5505
+ onChange: handleListboxChange,
5506
+ onClick: handleListboxClick,
5507
+ ref: listRef,
5508
+ scrollOnFocus: false,
5509
+ tabIndex: -1,
5510
+ value: currentIndex
5511
+ };
5262
5512
  return {
5263
- input: inputProps,
5264
- calendar: calendarProps
5513
+ combobox: combobox,
5514
+ input: input,
5515
+ list: list,
5516
+ popover: {
5517
+ open: open,
5518
+ onOpenChange: setOpen
5519
+ }
5265
5520
  };
5266
5521
  };
5267
5522
 
5268
- var _excluded$i = ["placement"];
5269
- var UnstyledArrow = /*#__PURE__*/React.forwardRef(function (props, ref) {
5270
- return React.createElement(PopoverPrimitive.Arrow, {
5271
- className: "pointer-events-none -mt-px",
5272
- asChild: true,
5273
- offset: 2,
5274
- width: 30,
5275
- height: 11
5276
- }, React.createElement("svg", Object.assign({}, props, {
5277
- ref: ref,
5278
- viewBox: "0 19 30 11",
5279
- style: {
5280
- transform: 'rotateZ(180deg)'
5281
- }
5282
- }), React.createElement("path", {
5283
- className: "text-grey-dark group-focus:text-blue-light fill-current",
5284
- d: "M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z"
5285
- }), React.createElement("path", {
5286
- className: "fill-current",
5287
- d: "M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"
5288
- })));
5289
- });
5290
- var UnstyledContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
5291
- var side = props.placement,
5292
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$i);
5293
-
5294
- var className = cn('border border-transparent rounded p-3 yt-shadow focus:yt-focus outline-none group ', props.className);
5295
- return React.createElement(PopoverPrimitive.Content, Object.assign({}, otherProps, {
5296
- className: className,
5297
- side: side,
5298
- sideOffset: 1,
5299
- style: _extends({}, props.style, {
5300
- zIndex: 996
5301
- }),
5302
- ref: ref
5303
- }));
5304
- });
5523
+ var getVisibility = function getVisibility(element) {
5524
+ return Boolean(element && (element.offsetWidth || element.offsetHeight || element.getClientRects().length));
5525
+ };
5305
5526
 
5306
- var _excluded$j = ["children"];
5307
- var PopoverContext = /*#__PURE__*/React.createContext({
5308
- props: {}
5309
- });
5310
- var Trigger$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
5311
- var context = React.useContext(PopoverContext);
5312
- return React.createElement(PopoverPrimitive.Trigger, Object.assign({}, context.props, props, {
5313
- ref: ref,
5314
- asChild: true
5315
- }));
5316
- });
5317
- var RenderPropWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
5318
- var children = _ref.children,
5319
- onClick = _ref.onClick;
5527
+ var useBoundingClientRectListener = function useBoundingClientRectListener(ref) {
5528
+ var _React$useState = React.useState(undefined),
5529
+ dimensions = _React$useState[0],
5530
+ setDimensions = _React$useState[1];
5320
5531
 
5321
- var close = function close() {
5322
- onClick(new CustomEvent('hide'));
5323
- };
5532
+ var isRefElementVisible = getVisibility(ref.current);
5324
5533
 
5325
- return children({
5326
- close: close,
5327
- ref: ref
5328
- });
5329
- });
5330
- var Content$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
5331
- var className = cn('bg-white focus:border-blue-light', props.className);
5332
- var output;
5534
+ var _React$useState2 = React.useState(isRefElementVisible),
5535
+ visibility = _React$useState2[0],
5536
+ setVisibility = _React$useState2[1];
5333
5537
 
5334
- if (typeof props.children === 'function') {
5335
- output = React.createElement(PopoverPrimitive.Close, {
5336
- asChild: true
5337
- }, React.createElement(RenderPropWrapper, null, props.children));
5338
- } else {
5339
- output = props.children;
5340
- }
5538
+ var resize = function resize() {
5539
+ if (visibility) {
5540
+ var _ref$current;
5341
5541
 
5342
- return React.createElement(UnstyledContent, {
5343
- className: className,
5344
- placement: props.placement,
5345
- ref: ref
5346
- }, output, React.createElement(UnstyledArrow, {
5347
- className: "text-white"
5348
- }));
5349
- });
5350
- var Close$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
5351
- return React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
5352
- ref: ref,
5353
- asChild: true
5354
- }));
5355
- });
5356
- var Popover = function Popover(props) {
5357
- var children = props.children,
5358
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$j);
5542
+ setDimensions((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect());
5543
+ }
5544
+ };
5359
5545
 
5360
- var context = React.useMemo(function () {
5361
- return {
5362
- props: otherProps
5546
+ React.useEffect(function () {
5547
+ var timeout = setTimeout(resize, 0);
5548
+ var debouncedResize = debounce(resize, 250);
5549
+ window.addEventListener('resize', debouncedResize);
5550
+ return function () {
5551
+ clearTimeout(timeout);
5552
+ window.removeEventListener('resize', debouncedResize);
5363
5553
  };
5364
- }, [otherProps]);
5365
- return React.createElement(PopoverContext.Provider, {
5366
- value: context
5367
- }, React.createElement(PopoverPrimitive.Root, {
5368
- children: children
5369
- }));
5370
- };
5371
- Popover.Trigger = Trigger$1;
5372
- Popover.Content = Content$1;
5373
- Popover.Close = Close$1;
5554
+ }, [ref.current, visibility]);
5555
+ React.useEffect(function () {
5556
+ var newRefElementVisibility = getVisibility(ref.current);
5374
5557
 
5375
- var _excluded$k = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
5376
- var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
5377
- var _input$disabled;
5558
+ if (visibility !== newRefElementVisibility) {
5559
+ // When visibility of an element changes, then the new visibility of the element can only be checked after the
5560
+ // component has rendered. That's why the visibility check is inside the useEffect. This useEffect will cause
5561
+ // the consumer to rerender and that will cause the above hook to recalculate the dimensions
5562
+ setVisibility(newRefElementVisibility);
5563
+ }
5564
+ });
5565
+ return dimensions;
5566
+ };
5378
5567
 
5568
+ var _excluded$m = ["className", "style"];
5569
+ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
5379
5570
  var externalClassName = props.className,
5380
- handleReset = props.onReset,
5381
5571
  style = props.style,
5382
- shortcuts = props.shortcuts,
5383
- shortcutsText = props.shortcutsText,
5384
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$k);
5385
-
5386
- var _useDatepicker = useDatepicker(otherProps, ref),
5387
- calendar = _useDatepicker.calendar,
5388
- input = _useDatepicker.input;
5572
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$m);
5389
5573
 
5390
- var _useLocalization = useLocalization(),
5391
- texts = _useLocalization.texts;
5574
+ var _useCombobox = useCombobox(otherProps, ref),
5575
+ combobox = _useCombobox.combobox,
5576
+ input = _useCombobox.input,
5577
+ popover = _useCombobox.popover,
5578
+ list = _useCombobox.list;
5392
5579
 
5393
- var className = cn('inline-flex w-full text-black font-normal', externalClassName);
5580
+ var internalRef = React.useRef(null);
5581
+ var selectDimensions = useBoundingClientRectListener(internalRef);
5582
+ var className = cn('inline-flex relative', {
5583
+ 'yt-combobox--inline': props.inline
5584
+ }, externalClassName);
5394
5585
  return React.createElement("span", {
5395
5586
  className: className,
5396
- "data-taco": "datepicker",
5587
+ "data-taco": "combobox",
5397
5588
  style: style
5398
- }, React.createElement(Input, Object.assign({}, input, {
5399
- button: React.createElement(Popover, null, React.createElement(Popover.Trigger, null, React.createElement(IconButton, {
5400
- "aria-label": texts.datepicker.expand,
5401
- disabled: (_input$disabled = input.disabled) !== null && _input$disabled !== void 0 ? _input$disabled : input.readOnly,
5402
- icon: "calendar"
5403
- })), React.createElement(Popover.Content, null, function (_ref) {
5404
- var close = _ref.close;
5405
- return React.createElement("div", {
5406
- className: "flex -m-3"
5407
- }, React.createElement(Calendar$1, Object.assign({}, calendar, {
5408
- onChange: function onChange(date, event) {
5409
- calendar.onChange(date, event);
5410
- close();
5411
- },
5412
- tabIndex: -1
5413
- })), shortcuts && React.createElement("div", {
5414
- className: "border-l border-grey-dark flex flex-col"
5415
- }, React.createElement("span", {
5416
- className: "font-semibold text-xs m-4 flex items-center h-8 w-32 mb-3"
5417
- }, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map(function (shortcut, i) {
5418
- return React.createElement("li", {
5419
- key: i
5420
- }, React.createElement("button", {
5421
- className: "w-full px-4 py-1 flex items-start hover:bg-grey-light text-xs",
5422
- onClick: function onClick(event) {
5423
- event.persist();
5424
- shortcut.onClick(event);
5425
- close();
5426
- }
5427
- }, shortcut.text));
5428
- })), handleReset && React.createElement("button", {
5429
- className: "text-blue hover:text-blue-light inline-flex border-none bg-transparent text-xs cursor-pointer mt-auto my-4 mx-auto",
5430
- onClick: function onClick(event) {
5431
- event.persist();
5432
- handleReset(event);
5433
- close();
5434
- }
5435
- }, texts.datepicker.clear)));
5436
- }))
5437
- })));
5589
+ }, React.createElement(PopoverPrimitive.Root, Object.assign({}, popover), React.createElement(PopoverPrimitive.Anchor, {
5590
+ asChild: true,
5591
+ ref: internalRef
5592
+ }, React.createElement("div", Object.assign({}, combobox, {
5593
+ className: "inline w-full",
5594
+ ref: ref
5595
+ }), React.createElement(Input, Object.assign({}, input, {
5596
+ autoComplete: "off",
5597
+ button: props.inline ? React.createElement(IconButton, {
5598
+ appearance: "discrete",
5599
+ className: "focus:!border-none focus:!shadow-none active:!border-none",
5600
+ icon: popover.open ? 'chevron-up' : 'chevron-down',
5601
+ onClick: function onClick() {
5602
+ return popover.onOpenChange(true);
5603
+ },
5604
+ tabIndex: -1
5605
+ }) : props.button
5606
+ })))), React.createElement(PopoverPrimitive.Content, {
5607
+ align: "start",
5608
+ onOpenAutoFocus: function onOpenAutoFocus(event) {
5609
+ event.preventDefault();
5610
+ },
5611
+ sideOffset: 4
5612
+ }, React.createElement(ScrollableList, Object.assign({}, list, {
5613
+ className: cn('border-blue max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)]'),
5614
+ style: {
5615
+ minWidth: selectDimensions === null || selectDimensions === void 0 ? void 0 : selectDimensions.width
5616
+ },
5617
+ tabIndex: popover.open ? 0 : -1
5618
+ })))));
5438
5619
  });
5439
5620
 
5440
- /* eslint-disable @typescript-eslint/no-empty-function */
5441
- var DialogContext = /*#__PURE__*/React.createContext({
5442
- close: function close() {},
5443
- draggable: false,
5444
- drawer: undefined,
5445
- elements: {
5446
- drawer: undefined,
5447
- extra: undefined
5448
- },
5449
- onClose: function onClose() {},
5450
- props: {},
5451
- size: 'sm'
5452
- });
5453
- var useCurrentDialog = function useCurrentDialog() {
5454
- return React.useContext(DialogContext);
5455
- };
5621
+ var format = function format(date, mask) {
5622
+ if (mask === void 0) {
5623
+ mask = 'dd.mm.yy';
5624
+ }
5456
5625
 
5457
- var Trigger$2 = /*#__PURE__*/React.forwardRef(function DialogTrigger(props, ref) {
5458
- var dialog = useCurrentDialog();
5459
- return React.createElement(DialogPrimitive.Trigger, Object.assign({}, dialog.props, props, {
5460
- ref: ref,
5461
- asChild: true
5462
- }));
5463
- });
5626
+ if (!date) {
5627
+ return undefined;
5628
+ }
5464
5629
 
5465
- var useDraggable = function useDraggable(ref) {
5466
- var _React$useState = React__default.useState({
5467
- x: 0,
5468
- y: 0
5469
- }),
5470
- position = _React$useState[0],
5471
- setPosition = _React$useState[1];
5630
+ var value = dateFns.isDate(date) ? date : dateFns.toDate(date);
5472
5631
 
5473
- var _useMove = interactions.useMove({
5474
- onMove: function onMove(event) {
5475
- var _ref$current;
5632
+ if (!dateFns.isValid(value)) {
5633
+ return undefined;
5634
+ }
5476
5635
 
5477
- var rect = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect(); // Prevent dragging out of bounds
5636
+ var pad = function pad(v) {
5637
+ return String(v).length === 1 ? "0" + v : v.toString();
5638
+ };
5478
5639
 
5479
- // Prevent dragging out of bounds
5480
- if (rect && (rect.left + event.deltaX < 0 || rect.right + event.deltaX > window.innerWidth || rect.top + event.deltaY < 0 || rect.bottom + event.deltaY > window.innerHeight)) {
5481
- return;
5482
- }
5640
+ return mask.replace('dd', pad(value.getDate())).replace('mm', pad(value.getMonth() + 1)).replace('yy', String(value.getFullYear()).slice(2));
5641
+ };
5642
+ var parseFromCustomString = function parseFromCustomString(date, mask) {
5643
+ if (date === void 0) {
5644
+ date = '';
5645
+ }
5483
5646
 
5484
- setPosition(function (_ref) {
5485
- var x = _ref.x,
5486
- y = _ref.y;
5487
- x += event.deltaX;
5488
- y += event.deltaY;
5489
- return {
5490
- x: x,
5491
- y: y
5492
- };
5493
- });
5647
+ if (mask === void 0) {
5648
+ mask = 'dd.mm.yy';
5649
+ }
5650
+
5651
+ if (!date || !date.length) {
5652
+ return undefined;
5653
+ }
5654
+
5655
+ var sanitizedMask = mask.split(/[^dmy]/);
5656
+ var dd = sanitizedMask.findIndex(function (x) {
5657
+ return x === 'dd';
5658
+ });
5659
+ var mm = sanitizedMask.findIndex(function (x) {
5660
+ return x === 'mm';
5661
+ });
5662
+ var yy = sanitizedMask.findIndex(function (x) {
5663
+ return x === 'yy' || x === 'yyyy';
5664
+ });
5665
+ var day;
5666
+ var month;
5667
+ var year;
5668
+
5669
+ var getFullYear = function getFullYear(y) {
5670
+ if (y && y.length === 2) {
5671
+ var z = Number.parseInt(y, 10);
5672
+ return z > 50 ? "19" + y : "20" + y;
5494
5673
  }
5495
- }),
5496
- moveProps = _useMove.moveProps;
5497
5674
 
5498
- return {
5499
- position: position,
5500
- handleProps: moveProps
5675
+ return y;
5501
5676
  };
5502
- };
5503
5677
 
5504
- var MenuContext = /*#__PURE__*/React.createContext(undefined);
5505
- var useCurrentMenu = function useCurrentMenu() {
5506
- return React.useContext(MenuContext);
5507
- };
5678
+ var inputParts = date.split(/\D/);
5508
5679
 
5509
- var _excluded$l = ["as"];
5510
- var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
5511
- var _props$as = props.as,
5512
- Tag = _props$as === void 0 ? 'span' : _props$as,
5513
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$l);
5680
+ if (inputParts.length === 1) {
5681
+ var fullDate = inputParts[0];
5682
+ var unseparatedMask = mask.replace(/[^dmy]/g, '');
5683
+ day = fullDate.slice(unseparatedMask.indexOf('d'), unseparatedMask.lastIndexOf('d') + 1);
5684
+ month = fullDate.slice(unseparatedMask.indexOf('m'), unseparatedMask.lastIndexOf('m') + 1);
5685
+ year = getFullYear(fullDate.slice(unseparatedMask.indexOf('y'), unseparatedMask.lastIndexOf('y') + 3)); // account for full years
5686
+ } else {
5687
+ day = inputParts[dd];
5688
+ month = inputParts[mm];
5689
+ year = getFullYear(inputParts[yy]);
5690
+ }
5514
5691
 
5515
- var className = cn('flex ', props.className);
5516
- return React.createElement(Tag, Object.assign({}, otherProps, {
5517
- className: className,
5518
- "data-taco": "group",
5519
- ref: ref
5520
- }));
5521
- });
5692
+ day = Number.parseInt(day, 10);
5693
+ month = Number.parseInt(month, 10);
5694
+ year = Number.parseInt(year, 10);
5695
+ var currentDate = new Date();
5696
+ return new Date(
5697
+ /* year */
5698
+ Object.is(year, NaN) ? currentDate.getFullYear() : year,
5699
+ /* month */
5700
+ Object.is(month, NaN) ? currentDate.getMonth() : month - 1, // months are zero based in javascript, so subtract a day
5522
5701
 
5523
- var Title = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
5524
- return React.createElement(DialogPrimitive.Title, Object.assign({}, props, {
5525
- className: "text-center",
5526
- ref: ref
5527
- }));
5528
- });
5529
- var Footer = /*#__PURE__*/React.forwardRef(function DialogFooter(props, ref) {
5530
- return React.createElement("div", Object.assign({}, props, {
5531
- className: "flex justify-end mt-8",
5532
- ref: ref
5533
- }), React.createElement(Group, null, props.children));
5534
- });
5535
- var Close$2 = /*#__PURE__*/React.forwardRef(function DialogClose(props, ref) {
5536
- var dialog = useCurrentDialog();
5537
- return React.createElement(DialogPrimitive.Close, Object.assign({
5538
- onClick: dialog.onClose
5539
- }, props, {
5540
- ref: ref,
5541
- asChild: true
5542
- }));
5543
- });
5544
- var Content$2 = /*#__PURE__*/React.forwardRef(function DialogContent(props, ref) {
5545
- var dialog = useCurrentDialog();
5546
- var internalRef = useProxiedRef(ref);
5702
+ /* day */
5703
+ Object.is(day, NaN) ? currentDate.getDate() : day,
5704
+ /* hours */
5705
+ 12,
5706
+ /* minutes */
5707
+ 0 // set to midday to avoid UTC offset causing dates to be mismatched server side
5708
+ );
5709
+ };
5710
+ var parseFromISOString = function parseFromISOString(date) {
5711
+ var tempDate = new Date(date);
5712
+ return dateFns.isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;
5713
+ };
5547
5714
 
5548
- var _useDraggable = useDraggable(internalRef),
5549
- position = _useDraggable.position,
5550
- dragHandleProps = _useDraggable.handleProps;
5715
+ var _excluded$n = ["defaultValue", "calendar", "onBlur", "onChange", "value"];
5716
+ var useDatepicker = function useDatepicker(_ref, ref) {
5717
+ var calendar = _ref.calendar,
5718
+ onBlur = _ref.onBlur,
5719
+ onChange = _ref.onChange,
5720
+ value = _ref.value,
5721
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
5551
5722
 
5552
- var _useLocalization = useLocalization(),
5553
- texts = _useLocalization.texts; // if the dialog was opened by a menu, we need to close the menu when the dialog closes
5554
- // the menu is still open (and mounted) because it is the trigger for the dialog
5723
+ var inputRef = useProxiedRef(ref);
5555
5724
 
5725
+ var _useLocalization = useLocalization(),
5726
+ formatting = _useLocalization.formatting;
5556
5727
 
5557
- var menu = useCurrentMenu();
5558
- var handleCloseAutoFocus;
5728
+ var _React$useState = React.useState(value ? format(value, formatting.date) : ''),
5729
+ internalValue = _React$useState[0],
5730
+ setInternalValue = _React$useState[1]; // update internal value if it changed 'externally'
5559
5731
 
5560
- if (menu) {
5561
- handleCloseAutoFocus = function handleCloseAutoFocus() {
5562
- return menu.close();
5563
- };
5564
- }
5565
5732
 
5566
- var className = cn('bg-white rounded fixed-center', {
5567
- 'w-128 text-center justify-center': dialog.size === 'dialog',
5568
- 'w-xs': dialog.size === 'xs',
5569
- 'w-sm': dialog.size === 'sm',
5570
- 'w-md': dialog.size === 'md',
5571
- 'w-lg': dialog.size === 'lg'
5572
- });
5573
- var containerClassName = cn('yt-dialog bg-white p-6 rounded relative z-[999]', 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]', {
5574
- 'rounded-b-none': !!dialog.elements.extra
5575
- }, props.className);
5576
- var overlayClassName = cn('fixed inset-0 cursor-default overflow-y-auto bg-[rgba(50,46,62,0.8)] animate-[fade-in_150ms] aria-hidden:hidden'); // the chosen behaviour in taco is that outside clicks do not close the dialog
5733
+ React.useEffect(function () {
5734
+ if (value) {
5735
+ var formattedValue = format(value, formatting.date);
5577
5736
 
5578
- var handleInteractOutside = function handleInteractOutside(event) {
5579
- return event.preventDefault();
5580
- };
5737
+ if (formattedValue !== internalValue) {
5738
+ setInternalValue(formattedValue);
5739
+ }
5740
+ } else {
5741
+ setInternalValue('');
5742
+ }
5743
+ }, [value]); // event handlers
5581
5744
 
5582
- var output;
5745
+ var handleInputBlur = function handleInputBlur(event) {
5746
+ event.persist();
5747
+ var valueAsDate = parseFromCustomString(event.target.value);
5748
+ var formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
5749
+ event.target.value = formattedValue;
5583
5750
 
5584
- if (typeof props.children === 'function') {
5585
- output = props.children({
5586
- drawer: dialog.drawer,
5587
- close: dialog.close
5588
- });
5589
- } else {
5590
- output = props.children;
5591
- }
5751
+ if (onChange) {
5752
+ event.detail = valueAsDate;
5753
+ onChange(event);
5754
+ } else {
5755
+ // update the internal value to use the formatted date
5756
+ setInternalValue(formattedValue);
5757
+ }
5592
5758
 
5593
- return React.createElement(DialogPrimitive.Portal, null, React.createElement(DialogPrimitive.Overlay, {
5594
- className: overlayClassName
5595
- }, React.createElement(DialogPrimitive.Content, Object.assign({}, props, {
5596
- className: className,
5597
- "data-taco": "dialog",
5598
- onEscapeKeyDown: dialog.onClose,
5599
- onInteractOutside: handleInteractOutside,
5600
- onCloseAutoFocus: handleCloseAutoFocus,
5601
- ref: ref,
5602
- style: _extends({}, props.style, {
5603
- left: dialog.draggable ? "calc(50% + " + position.x + "px)" : undefined,
5604
- top: dialog.draggable ? "calc(50% + " + position.y + "px)" : undefined
5605
- })
5606
- }), React.createElement("div", {
5607
- className: containerClassName
5608
- }, output, dialog.draggable && React.createElement("div", Object.assign({}, dragHandleProps, {
5609
- "aria-label": texts.dialog.drag,
5610
- className: "yt-dialog__drag absolute-center-x h-3 rounded bg-grey-light cursor-move text-center w-24 top-1.5"
5611
- })), React.createElement(DialogPrimitive.Close, {
5612
- asChild: true,
5613
- onClick: dialog.onClose
5614
- }, React.createElement(IconButton, {
5615
- appearance: "discrete",
5616
- "aria-label": texts.dialog.close,
5617
- className: "absolute top-0 right-0 mt-2 mr-2",
5618
- icon: "close"
5619
- }))), dialog.elements.drawer, dialog.elements.extra)));
5620
- });
5759
+ if (onBlur) {
5760
+ onBlur(event);
5761
+ }
5762
+ };
5621
5763
 
5622
- var Drawer = /*#__PURE__*/React.forwardRef(function DialogDrawer(props, ref) {
5623
- var _dialog$drawer, _dialog$drawer2;
5764
+ var handleInputChange = function handleInputChange(event) {
5765
+ setInternalValue(event.target.value);
5766
+ };
5624
5767
 
5625
- var dialog = useCurrentDialog();
5626
- return React.createElement(framerMotion.motion.div, Object.assign({}, props, {
5627
- className: "bg-white absolute top-0 h-full w-full hidden text-left p-6 overflow-y-auto rounded-r -ml-[4px] z-[998]",
5628
- "aria-hidden": !((_dialog$drawer = dialog.drawer) !== null && _dialog$drawer !== void 0 && _dialog$drawer.open),
5629
- variants: {
5630
- visible: {
5631
- left: '100%',
5632
- display: 'block',
5633
- transition: {
5634
- ease: 'easeOut',
5635
- duration: 0.2
5636
- }
5637
- },
5638
- hidden: {
5639
- left: '0%',
5640
- transition: {
5641
- ease: 'easeOut',
5642
- duration: 0.2
5643
- },
5644
- transitionEnd: {
5645
- display: 'none'
5646
- }
5647
- }
5648
- },
5649
- animate: (_dialog$drawer2 = dialog.drawer) !== null && _dialog$drawer2 !== void 0 && _dialog$drawer2.open ? 'visible' : 'hidden',
5650
- ref: ref
5651
- }));
5652
- });
5768
+ var handleChange = function handleChange(date) {
5769
+ setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');
5770
+ };
5653
5771
 
5654
- var Extra = /*#__PURE__*/React.forwardRef(function (props, ref) {
5655
- return React.createElement("div", Object.assign({}, props, {
5656
- className: "bg-grey-light rounded-t-none rounded-b absolute top-full w-full text-left p-6 left-0 -mt-px yt-shadow-inset",
5657
- ref: ref
5658
- }));
5659
- });
5772
+ var inputProps = _extends({}, props, {
5773
+ autoComplete: 'off',
5774
+ onBlur: handleInputBlur,
5775
+ onChange: handleInputChange,
5776
+ ref: inputRef,
5777
+ type: 'text',
5778
+ value: internalValue
5779
+ });
5660
5780
 
5661
- var _excluded$m = ["children", "draggable", "onClose", "open", "size"];
5781
+ var calendarProps = _extends({}, calendar, {
5782
+ onChange: handleChange,
5783
+ value: value
5784
+ });
5662
5785
 
5663
- var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
5664
- return React.useMemo(function () {
5665
- var children = [];
5666
- var drawer;
5667
- var extra;
5668
- React.Children.forEach(initialChildren, function (child) {
5669
- if (child.type.displayName === 'Drawer') {
5670
- drawer = child;
5671
- } else if (child.type.displayName === 'Extra') {
5672
- extra = child;
5673
- } else {
5674
- children.push(child);
5675
- }
5676
- });
5677
- return [children, drawer, extra];
5678
- }, [initialChildren]);
5786
+ return {
5787
+ input: inputProps,
5788
+ calendar: calendarProps
5789
+ };
5679
5790
  };
5680
5791
 
5681
- var Dialog = function Dialog(props) {
5682
- var initialChildren = props.children,
5683
- _props$draggable = props.draggable,
5684
- draggable = _props$draggable === void 0 ? false : _props$draggable,
5685
- onClose = props.onClose,
5686
- defaultOpen = props.open,
5687
- _props$size = props.size,
5688
- size = _props$size === void 0 ? 'sm' : _props$size,
5689
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$m);
5792
+ var _excluded$o = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
5793
+ var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
5794
+ var _input$disabled;
5690
5795
 
5691
- var _useSeparatedChildren = useSeparatedChildren(initialChildren),
5692
- children = _useSeparatedChildren[0],
5693
- drawer = _useSeparatedChildren[1],
5694
- extra = _useSeparatedChildren[2];
5796
+ var externalClassName = props.className,
5797
+ handleReset = props.onReset,
5798
+ style = props.style,
5799
+ shortcuts = props.shortcuts,
5800
+ shortcutsText = props.shortcutsText,
5801
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$o);
5695
5802
 
5696
- var _React$useState = React.useState(defaultOpen),
5697
- open = _React$useState[0],
5698
- setOpen = _React$useState[1];
5803
+ var _useDatepicker = useDatepicker(otherProps, ref),
5804
+ calendar = _useDatepicker.calendar,
5805
+ input = _useDatepicker.input;
5699
5806
 
5700
- var _React$useState2 = React.useState(false),
5701
- drawerOpen = _React$useState2[0],
5702
- setDrawerOpen = _React$useState2[1];
5807
+ var _useLocalization = useLocalization(),
5808
+ texts = _useLocalization.texts;
5703
5809
 
5704
- var context = React.useMemo(function () {
5705
- return {
5706
- close: function close() {
5707
- return setOpen(false);
5708
- },
5709
- draggable: draggable,
5710
- drawer: {
5711
- open: drawerOpen,
5712
- toggle: function toggle() {
5713
- return setDrawerOpen(function (isDrawerOpen) {
5714
- return !isDrawerOpen;
5715
- });
5810
+ var className = cn('inline-flex w-full text-black font-normal', externalClassName);
5811
+ return React.createElement("span", {
5812
+ className: className,
5813
+ "data-taco": "datepicker",
5814
+ style: style
5815
+ }, React.createElement(Input, Object.assign({}, input, {
5816
+ button: React.createElement(Popover, null, React.createElement(Popover.Trigger, null, React.createElement(IconButton, {
5817
+ "aria-label": texts.datepicker.expand,
5818
+ disabled: (_input$disabled = input.disabled) !== null && _input$disabled !== void 0 ? _input$disabled : input.readOnly,
5819
+ icon: "calendar"
5820
+ })), React.createElement(Popover.Content, null, function (_ref) {
5821
+ var close = _ref.close;
5822
+ return React.createElement("div", {
5823
+ className: "flex -m-3"
5824
+ }, React.createElement(Calendar$1, Object.assign({}, calendar, {
5825
+ onChange: function onChange(date, event) {
5826
+ calendar.onChange(date, event);
5827
+ close();
5828
+ },
5829
+ tabIndex: -1
5830
+ })), shortcuts && React.createElement("div", {
5831
+ className: "border-l border-grey-dark flex flex-col"
5832
+ }, React.createElement("span", {
5833
+ className: "font-semibold text-xs m-4 flex items-center h-8 w-32 mb-3"
5834
+ }, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map(function (shortcut, i) {
5835
+ return React.createElement("li", {
5836
+ key: i
5837
+ }, React.createElement("button", {
5838
+ className: "w-full px-4 py-1 flex items-start hover:bg-grey-light text-xs",
5839
+ onClick: function onClick(event) {
5840
+ event.persist();
5841
+ shortcut.onClick(event);
5842
+ close();
5843
+ }
5844
+ }, shortcut.text));
5845
+ })), handleReset && React.createElement("button", {
5846
+ className: "text-blue hover:text-blue-light inline-flex border-none bg-transparent text-xs cursor-pointer mt-auto my-4 mx-auto",
5847
+ onClick: function onClick(event) {
5848
+ event.persist();
5849
+ handleReset(event);
5850
+ close();
5716
5851
  }
5717
- },
5718
- elements: {
5719
- drawer: drawer,
5720
- extra: extra
5721
- },
5722
- onClose: onClose,
5723
- props: otherProps,
5724
- size: size
5725
- };
5726
- }, [open, drawerOpen, drawer, extra, otherProps]);
5727
- return React.createElement(DialogContext.Provider, {
5728
- value: context
5729
- }, React.createElement(DialogPrimitive.Root, {
5730
- children: children,
5731
- open: open,
5732
- onOpenChange: setOpen
5733
- }));
5734
- };
5735
- Dialog.Trigger = Trigger$2;
5736
- Dialog.Content = Content$2;
5737
- Dialog.Title = Title;
5738
- Dialog.Footer = Footer;
5739
- Dialog.Extra = Extra;
5740
- Dialog.Drawer = Drawer;
5741
- Dialog.Close = Close$2;
5852
+ }, texts.datepicker.clear)));
5853
+ }))
5854
+ })));
5855
+ });
5742
5856
 
5743
- var _excluded$n = ["horizontal"];
5857
+ var _excluded$p = ["horizontal"];
5744
5858
  var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
5745
5859
  var _props$horizontal = props.horizontal,
5746
5860
  horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
5747
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$n);
5861
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$p);
5748
5862
 
5749
5863
  var className = cn('yt-form', {
5750
5864
  'yt-form--horizontal flex flex-wrap': horizontal
@@ -5756,68 +5870,10 @@ var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
5756
5870
  }));
5757
5871
  });
5758
5872
 
5759
- var _excluded$o = ["children"];
5760
- var HangerContext = /*#__PURE__*/React.createContext({
5761
- props: {}
5762
- });
5763
- var Anchor = /*#__PURE__*/React.forwardRef(function (props, ref) {
5764
- var context = React.useContext(HangerContext);
5765
- return React.createElement(PopoverPrimitive.Anchor, Object.assign({}, context.props, props, {
5766
- ref: ref,
5767
- asChild: true
5768
- }));
5769
- });
5770
- var Content$3 = /*#__PURE__*/React.forwardRef(function (props, ref) {
5771
- var _useLocalization = useLocalization(),
5772
- texts = _useLocalization.texts;
5773
-
5774
- var className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent', props.className);
5775
-
5776
- var handleInteractOutside = function handleInteractOutside(event) {
5777
- event.preventDefault();
5778
- };
5779
-
5780
- return React.createElement(UnstyledContent, {
5781
- className: className,
5782
- "data-taco": "hanger",
5783
- onInteractOutside: handleInteractOutside,
5784
- placement: props.placement,
5785
- ref: ref
5786
- }, props.children, React.createElement(UnstyledArrow, {
5787
- className: "text-blue"
5788
- }), React.createElement(PopoverPrimitive.Close, {
5789
- asChild: true
5790
- }, React.createElement(IconButton, {
5791
- appearance: "primary",
5792
- "aria-label": texts.hanger.close,
5793
- className: "text-white ml-2 absolute top-0 right-0 mr-2 mt-2",
5794
- icon: "close",
5795
- onClick: props.onClose
5796
- })));
5797
- });
5798
- var Hanger = function Hanger(props) {
5799
- var children = props.children,
5800
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$o);
5801
-
5802
- var context = React.useMemo(function () {
5803
- return {
5804
- props: otherProps
5805
- };
5806
- }, [otherProps]);
5807
- return React.createElement(HangerContext.Provider, {
5808
- value: context
5809
- }, React.createElement(PopoverPrimitive.Root, {
5810
- children: children,
5811
- defaultOpen: true
5812
- }));
5813
- };
5814
- Hanger.Anchor = Anchor;
5815
- Hanger.Content = Content$3;
5816
-
5817
- var _excluded$p = ["onSearch"];
5873
+ var _excluded$q = ["onSearch"];
5818
5874
  var SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput(_ref, ref) {
5819
5875
  var onSearch = _ref.onSearch,
5820
- props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
5876
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
5821
5877
 
5822
5878
  var _useLocalization = useLocalization(),
5823
5879
  texts = _useLocalization.texts;
@@ -5850,13 +5906,13 @@ var SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput(_ref, ref)
5850
5906
  }));
5851
5907
  });
5852
5908
 
5853
- var _excluded$q = ["disabled", "children", "message", "state"];
5909
+ var _excluded$r = ["disabled", "children", "message", "state"];
5854
5910
  var Label = /*#__PURE__*/React.forwardRef(function Label(props, ref) {
5855
5911
  var disabled = props.disabled,
5856
5912
  children = props.children,
5857
5913
  message = props.message,
5858
5914
  state = props.state,
5859
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$q);
5915
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$r);
5860
5916
 
5861
5917
  var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
5862
5918
  'text-grey-dark': disabled
@@ -5900,7 +5956,7 @@ var useTypeahead = function useTypeahead(_ref) {
5900
5956
  };
5901
5957
  };
5902
5958
 
5903
- var _excluded$r = ["data", "defaultValue", "disabled", "emptyValue", "id", "name", "onChange", "onFocus", "onKeyDown", "value"];
5959
+ var _excluded$s = ["data", "defaultValue", "disabled", "emptyValue", "id", "name", "onChange", "onFocus", "onKeyDown", "value"];
5904
5960
  var useListbox = function useListbox(_ref, ref) {
5905
5961
  var _ref$data = _ref.data,
5906
5962
  externalData = _ref$data === void 0 ? [] : _ref$data,
@@ -5914,7 +5970,7 @@ var useListbox = function useListbox(_ref, ref) {
5914
5970
  onKeyDown = _ref.onKeyDown,
5915
5971
  _ref$value = _ref.value,
5916
5972
  value = _ref$value === void 0 ? emptyValue : _ref$value,
5917
- otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$r);
5973
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$s);
5918
5974
 
5919
5975
  var data = useFlattenedData(emptyValue !== undefined ? [{
5920
5976
  text: '',
@@ -6043,7 +6099,7 @@ var useListbox = function useListbox(_ref, ref) {
6043
6099
  };
6044
6100
  };
6045
6101
 
6046
- var _excluded$s = ["data", "defaultValue", "disabled", "id", "name", "onClick", "onChange", "onFocus", "onKeyDown", "value"];
6102
+ var _excluded$t = ["data", "defaultValue", "disabled", "id", "name", "onClick", "onChange", "onFocus", "onKeyDown", "value"];
6047
6103
  var useMultiListbox = function useMultiListbox(_ref, ref) {
6048
6104
  var _ref$data = _ref.data,
6049
6105
  externalData = _ref$data === void 0 ? [] : _ref$data,
@@ -6056,7 +6112,7 @@ var useMultiListbox = function useMultiListbox(_ref, ref) {
6056
6112
  onFocus = _ref.onFocus,
6057
6113
  onKeyDown = _ref.onKeyDown,
6058
6114
  value = _ref.value,
6059
- otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$s);
6115
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$t);
6060
6116
 
6061
6117
  var _useLocalization = useLocalization(),
6062
6118
  texts = _useLocalization.texts;
@@ -6255,40 +6311,56 @@ var useMultiListbox = function useMultiListbox(_ref, ref) {
6255
6311
  };
6256
6312
  };
6257
6313
 
6258
- var _excluded$t = ["className"],
6259
- _excluded2$3 = ["className"];
6314
+ var _excluded$u = ["className"],
6315
+ _excluded2$2 = ["className"];
6260
6316
  var Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
6261
6317
  var externalClassName = props.className,
6262
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$t);
6318
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$u);
6263
6319
 
6264
6320
  var _useListbox = useListbox(otherProps, ref),
6265
6321
  list = _useListbox.list,
6266
6322
  input = _useListbox.input;
6267
6323
 
6268
- var className = cn('yt-listbox', externalClassName);
6324
+ var className = cn('bg-white inline-flex relative w-full', externalClassName);
6269
6325
  return React.createElement("span", {
6326
+ "data-taco": "listbox",
6270
6327
  className: className
6271
- }, React.createElement(ScrollableList, Object.assign({}, list)), React.createElement("input", Object.assign({}, input, {
6328
+ }, React.createElement(ScrollableList, Object.assign({}, list, {
6329
+ style: _extends({}, list.style, {
6330
+ maxHeight: 'calc(12rem + 2px)'
6331
+ /* (6 * option height) + listbox border */
6332
+
6333
+ })
6334
+ })), React.createElement("input", Object.assign({}, input, {
6335
+ className: "hidden",
6272
6336
  type: "text"
6273
6337
  })));
6274
6338
  });
6275
6339
  var MultiListbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
6276
6340
  var externalClassName = props.className,
6277
- otherProps = _objectWithoutPropertiesLoose(props, _excluded2$3);
6341
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded2$2);
6278
6342
 
6279
6343
  var _useMultiListbox = useMultiListbox(otherProps, ref),
6280
6344
  list = _useMultiListbox.list,
6281
6345
  input = _useMultiListbox.input;
6282
6346
 
6283
- var className = cn('yt-listbox', externalClassName);
6347
+ var className = cn('bg-white inline-flex relative w-full', externalClassName);
6284
6348
  return React.createElement("span", {
6349
+ "data-taco": "listbox",
6285
6350
  className: className
6286
- }, React.createElement(ScrollableList, Object.assign({}, list)), React.createElement("input", Object.assign({}, input, {
6351
+ }, React.createElement(ScrollableList, Object.assign({}, list, {
6352
+ style: _extends({}, list.style, {
6353
+ maxHeight: 'calc(12rem + 2px + 2px)'
6354
+ /* (6 * option height) + listbox border + ALL_OPTIONS bottom border */
6355
+
6356
+ })
6357
+ })), React.createElement("input", Object.assign({}, input, {
6358
+ className: "hidden",
6287
6359
  type: "text"
6288
6360
  })));
6289
6361
  });
6290
6362
 
6291
- var _excluded$u = ["children", "placement"];
6363
+ var _excluded$v = ["children", "placement"];
6292
6364
 
6293
6365
  var getAppearanceClasses$1 = function getAppearanceClasses(appearance) {
6294
6366
  switch (appearance) {
@@ -6316,7 +6388,7 @@ var Content$4 = /*#__PURE__*/React.forwardRef(function (props, ref) {
6316
6388
 
6317
6389
  var children = props.children,
6318
6390
  side = props.placement,
6319
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$u);
6391
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$v);
6320
6392
 
6321
6393
  var className = cn('border rounded block outline-none p-1', getAppearanceClasses$1(menu === null || menu === void 0 ? void 0 : menu.appearance), props.className);
6322
6394
  return React.createElement(DropdownMenuPrimitive.Content, Object.assign({}, otherProps, {
@@ -6332,7 +6404,7 @@ var Content$4 = /*#__PURE__*/React.forwardRef(function (props, ref) {
6332
6404
  }), children);
6333
6405
  });
6334
6406
 
6335
- var _excluded$v = ["icon", "shortcut"];
6407
+ var _excluded$w = ["icon", "shortcut"];
6336
6408
  var Icon$1 = function Icon$1(_ref) {
6337
6409
  var name = _ref.name;
6338
6410
  return React.createElement("span", {
@@ -6415,7 +6487,7 @@ var Shortcut = function Shortcut(props) {
6415
6487
  var Item$1 = /*#__PURE__*/React.forwardRef(function MenuItem(props, ref) {
6416
6488
  var icon = props.icon,
6417
6489
  shortcut = props.shortcut,
6418
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$v);
6490
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$w);
6419
6491
 
6420
6492
  var className = useItemStyling({
6421
6493
  disabled: props.disabled,
@@ -6447,11 +6519,11 @@ var Item$1 = /*#__PURE__*/React.forwardRef(function MenuItem(props, ref) {
6447
6519
  }), props.children, shortcut && React.createElement(Shortcut, null, shortcut));
6448
6520
  });
6449
6521
 
6450
- var _excluded$w = ["href", "icon"];
6522
+ var _excluded$x = ["href", "icon"];
6451
6523
  var Link = /*#__PURE__*/React.forwardRef(function MenuLink(props, ref) {
6452
6524
  var href = props.href,
6453
6525
  icon = props.icon,
6454
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$w);
6526
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$x);
6455
6527
 
6456
6528
  var className = useItemStyling({
6457
6529
  disabled: props.disabled,
@@ -6496,12 +6568,12 @@ var Trigger$3 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref) {
6496
6568
  }));
6497
6569
  });
6498
6570
 
6499
- var _excluded$x = ["checked", "children", "onChange"];
6571
+ var _excluded$y = ["checked", "children", "onChange"];
6500
6572
  var Checkbox$1 = function Checkbox(props) {
6501
6573
  var checked = props.checked,
6502
6574
  children = props.children,
6503
6575
  onChange = props.onChange,
6504
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$x);
6576
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$y);
6505
6577
 
6506
6578
  var className = useItemStyling({
6507
6579
  disabled: props.disabled,
@@ -6520,10 +6592,10 @@ var Checkbox$1 = function Checkbox(props) {
6520
6592
  })), children);
6521
6593
  };
6522
6594
 
6523
- var _excluded$y = ["children", "value"],
6524
- _excluded2$4 = ["children", "defaultValue", "disabled", "invalid", "onChange", "orientation", "value"];
6595
+ var _excluded$z = ["children", "value"],
6596
+ _excluded2$3 = ["children", "defaultValue", "disabled", "invalid", "onChange", "orientation", "value"];
6525
6597
  var getRadioGroupItemValueAsString = function getRadioGroupItemValueAsString(value) {
6526
- return value === undefined || value === null ? '' : String(value);
6598
+ return value === null ? '' : String(value);
6527
6599
  };
6528
6600
  var findByValue$1 = function findByValue(values, valueAsString) {
6529
6601
  return values.find(function (value) {
@@ -6539,7 +6611,7 @@ var RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(props
6539
6611
 
6540
6612
  var children = props.children,
6541
6613
  value = props.value,
6542
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$y);
6614
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$z);
6543
6615
 
6544
6616
  var disabled = context.disabled || props.disabled;
6545
6617
  var className = cn('flex items-center justify-center h-4 w-4 mr-2 rounded-full bg-white border-2 ', {
@@ -6570,14 +6642,14 @@ var useRadioGroup = function useRadioGroup(props) {
6570
6642
  _props$orientation = props.orientation,
6571
6643
  orientation = _props$orientation === void 0 ? 'vertical' : _props$orientation,
6572
6644
  value = props.value,
6573
- otherProps = _objectWithoutPropertiesLoose(props, _excluded2$4);
6645
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded2$3);
6574
6646
 
6575
6647
  var values = React.useMemo(function () {
6576
- var _React$Children$map;
6577
-
6578
- return (_React$Children$map = React.Children.map(children, function (child) {
6579
- return child.props.value;
6580
- })) !== null && _React$Children$map !== void 0 ? _React$Children$map : [];
6648
+ var radioGroupItemValues = [];
6649
+ React.Children.forEach(children, function (child) {
6650
+ return radioGroupItemValues.push(child.props.value);
6651
+ });
6652
+ return radioGroupItemValues;
6581
6653
  }, [children]);
6582
6654
  var context = React.useMemo(function () {
6583
6655
  return {
@@ -6587,17 +6659,18 @@ var useRadioGroup = function useRadioGroup(props) {
6587
6659
  }, [disabled, invalid]);
6588
6660
  var valueProps;
6589
6661
 
6590
- if (defaultValue) {
6662
+ if (onChange !== undefined) {
6663
+ var handleChange = function handleChange(value) {
6664
+ return onChange(findByValue$1(values, value));
6665
+ };
6666
+
6591
6667
  valueProps = {
6592
- defaultValue: getRadioGroupItemValueAsString(defaultValue) || undefined
6668
+ onValueChange: handleChange,
6669
+ value: value !== undefined ? getRadioGroupItemValueAsString(value) : undefined
6593
6670
  };
6594
6671
  } else {
6595
- var handleChange = onChange ? function (value) {
6596
- return onChange(findByValue$1(values, value));
6597
- } : undefined;
6598
6672
  valueProps = {
6599
- onValueChange: handleChange,
6600
- value: getRadioGroupItemValueAsString(value) || undefined
6673
+ defaultValue: defaultValue !== undefined ? getRadioGroupItemValueAsString(defaultValue) : undefined
6601
6674
  };
6602
6675
  }
6603
6676
 
@@ -6615,9 +6688,9 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
6615
6688
  otherProps = _useRadioGroup.props;
6616
6689
 
6617
6690
  var className = cn('flex items-start', {
6618
- 'flex-wrap space-x-4': props.orientation === 'horizontal',
6619
- 'flex-col space-y-2': props.orientation === 'vertical'
6620
- }, props.className);
6691
+ 'flex-wrap space-x-4': otherProps.orientation === 'horizontal',
6692
+ 'flex-col space-y-2': otherProps.orientation === 'vertical'
6693
+ }, otherProps.className);
6621
6694
  return React.createElement(RadioGroupContext.Provider, {
6622
6695
  value: context
6623
6696
  }, React.createElement(RadioGroupPrimitive.Root, Object.assign({}, otherProps, {
@@ -6628,13 +6701,13 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
6628
6701
  });
6629
6702
  RadioGroup.Item = RadioGroupItem;
6630
6703
 
6631
- var _excluded$z = ["children", "value"];
6704
+ var _excluded$A = ["children", "value"];
6632
6705
  var RadioItem = function RadioItem(props) {
6633
6706
  var context = React.useContext(MenuRadioGroupContext);
6634
6707
 
6635
6708
  var children = props.children,
6636
6709
  value = props.value,
6637
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$z);
6710
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$A);
6638
6711
 
6639
6712
  var disabled = context.disabled || props.disabled;
6640
6713
  var className = useItemStyling({
@@ -6780,7 +6853,7 @@ Menu.Separator = Separator;
6780
6853
  Menu.Header = Header;
6781
6854
  Menu.RadioGroup = RadioGroup$1;
6782
6855
 
6783
- var _excluded$A = ["children", "className", "expanded", "title", "fixed", "onClick"];
6856
+ var _excluded$B = ["children", "className", "expanded", "title", "fixed", "onClick"];
6784
6857
  var TreeviewItem = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
6785
6858
  return React__default.createElement("a", Object.assign({}, props, {
6786
6859
  ref: ref
@@ -6794,7 +6867,7 @@ var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function (props, ref)
6794
6867
  title = props.title,
6795
6868
  fixed = props.fixed,
6796
6869
  onClick = props.onClick,
6797
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$A);
6870
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$B);
6798
6871
 
6799
6872
  var _React$useState = React__default.useState(fixed || initialExpanded),
6800
6873
  expanded = _React$useState[0],
@@ -6894,8 +6967,8 @@ var useDropTarget = function useDropTarget(onDrop) {
6894
6967
  return [isDraggedOver, props];
6895
6968
  };
6896
6969
 
6897
- var _excluded$B = ["active", "children", "onDrop", "postfix", "prefix", "role"],
6898
- _excluded2$5 = ["children"];
6970
+ var _excluded$C = ["active", "children", "onDrop", "postfix", "prefix", "role"],
6971
+ _excluded2$4 = ["children"];
6899
6972
  var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
6900
6973
  var active = props.active,
6901
6974
  children = props.children,
@@ -6903,7 +6976,7 @@ var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
6903
6976
  postfix = props.postfix,
6904
6977
  prefix = props.prefix,
6905
6978
  role = props.role,
6906
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$B);
6979
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$C);
6907
6980
 
6908
6981
  var proxyRef = useProxiedRef(ref);
6909
6982
 
@@ -6937,7 +7010,7 @@ var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
6937
7010
  }), prefix && React__default.createElement("span", {
6938
7011
  className: "yt-navigation__item__prefix flex items-center"
6939
7012
  }, prefix), React__default.createElement("a", Object.assign({}, otherProps, {
6940
- className: "flex-grow block truncate",
7013
+ className: "block flex-grow truncate",
6941
7014
  ref: proxyRef
6942
7015
  }), children), postfix && React__default.createElement("span", {
6943
7016
  className: "yt-navigation__item__postfix ml-1"
@@ -6945,7 +7018,7 @@ var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
6945
7018
  });
6946
7019
  var Panel = /*#__PURE__*/React__default.forwardRef(function Panel(props, ref) {
6947
7020
  return React__default.createElement("div", Object.assign({}, props, {
6948
- className: cn('bg-white p-3 w-full', props.className),
7021
+ className: cn('w-full bg-white p-3', props.className),
6949
7022
  ref: ref
6950
7023
  }));
6951
7024
  });
@@ -6993,11 +7066,11 @@ var Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
6993
7066
  return scrollableAreas;
6994
7067
  }, [props.children]);
6995
7068
  return React__default.createElement(Treeview, Object.assign({}, props, {
6996
- className: cn('flex flex-col flex-grow overflow-y-auto divide-y-2 divide-grey-light', props.className),
7069
+ className: cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className),
6997
7070
  ref: ref
6998
7071
  }), scrollableAreas.map(function (area, i) {
6999
7072
  return Array.isArray(area) ? React__default.createElement("div", {
7000
- className: "flex flex-col flex-auto flex-shrink-0 flex-grow overflow-y-auto divide-y-2 divide-grey-light h-0",
7073
+ className: "divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
7001
7074
  key: i
7002
7075
  }, area) : area;
7003
7076
  }));
@@ -7005,11 +7078,12 @@ var Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
7005
7078
  Menu$1.Group = MenuGroup;
7006
7079
  var Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
7007
7080
  var children = props.children,
7008
- otherProps = _objectWithoutPropertiesLoose(props, _excluded2$5);
7081
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded2$4);
7009
7082
 
7010
7083
  var className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
7011
7084
  return React__default.createElement("div", Object.assign({}, otherProps, {
7012
7085
  className: className,
7086
+ "data-taco": "navigation",
7013
7087
  ref: ref
7014
7088
  }), children);
7015
7089
  });
@@ -7066,57 +7140,61 @@ var PageNumbers = function PageNumbers(_ref) {
7066
7140
  }));
7067
7141
  };
7068
7142
 
7069
- var _excluded$C = ["aria-label", "aria-labelledby", "data", "disabled", "emptyValue", "id", "multiselect", "onClick", "readOnly", "value"];
7143
+ var _excluded$D = ["aria-label", "aria-labelledby", "data", "defaultValue", "disabled", "emptyValue", "id", "multiselect", "onClick", "onChange", "readOnly", "value"];
7070
7144
  var useSelect = function useSelect(_ref, ref) {
7071
7145
  var ariaLabel = _ref['aria-label'],
7072
7146
  ariaLabelledBy = _ref['aria-labelledby'],
7073
7147
  _ref$data = _ref.data,
7074
7148
  data = _ref$data === void 0 ? [] : _ref$data,
7149
+ defaultValue = _ref.defaultValue,
7075
7150
  disabled = _ref.disabled,
7076
7151
  emptyValue = _ref.emptyValue,
7077
7152
  nativeId = _ref.id,
7078
7153
  multiselect = _ref.multiselect,
7079
- onClick = _ref.onClick,
7154
+ onChange = _ref.onChange,
7080
7155
  readOnly = _ref.readOnly,
7081
7156
  _ref$value = _ref.value,
7082
7157
  value = _ref$value === void 0 ? emptyValue : _ref$value,
7083
- otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$C);
7158
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$D);
7084
7159
 
7085
7160
  var _useLocalization = useLocalization(),
7086
7161
  texts = _useLocalization.texts;
7087
7162
 
7088
7163
  var searchData = useFlattenedData(data);
7089
7164
  var inputRef = useProxiedRef(ref);
7090
- var popover = Popover$1.usePopoverState({
7091
- gutter: 4,
7092
- placement: 'bottom-start'
7093
- });
7165
+
7166
+ var _React$useState = React.useState(false),
7167
+ open = _React$useState[0],
7168
+ setOpen = _React$useState[1];
7169
+
7094
7170
  var id = React.useMemo(function () {
7095
7171
  return nativeId || "select_" + uuid.v4();
7096
7172
  }, [nativeId]);
7173
+ var internalInputRef = React.useRef(null);
7097
7174
  var buttonId = id + "-button"; // support 'escape' resetting to the value that was set when the listbox opened
7098
7175
 
7099
- var _React$useState = React.useState(value),
7100
- lastValue = _React$useState[0],
7101
- setLastValue = _React$useState[1];
7176
+ var _React$useState2 = React.useState(value),
7177
+ lastValue = _React$useState2[0],
7178
+ setLastValue = _React$useState2[1];
7102
7179
 
7103
7180
  React.useEffect(function () {
7104
7181
  setLastValue(value);
7105
- }, [popover.visible]); // event handlers
7106
-
7107
- var handleButtonClick = function handleButtonClick(event) {
7108
- popover.toggle();
7109
-
7110
- if (onClick) {
7111
- event.persist();
7112
- onClick(event);
7182
+ }, [open]);
7183
+ React.useEffect(function () {
7184
+ if (defaultValue !== undefined && value === undefined) {
7185
+ setInputValueByRef$1(internalInputRef.current, defaultValue);
7113
7186
  }
7114
- };
7187
+ }, [defaultValue]);
7188
+ React.useEffect(function () {
7189
+ if (value !== undefined) {
7190
+ setInputValueByRef$1(internalInputRef.current, value);
7191
+ }
7192
+ }, []); // event handlers
7115
7193
 
7116
7194
  var handleButtonKeyDown = function handleButtonKeyDown(event) {
7117
7195
  if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {
7118
7196
  event.preventDefault();
7119
- popover.toggle();
7197
+ setOpen(true);
7120
7198
  }
7121
7199
  };
7122
7200
 
@@ -7130,7 +7208,7 @@ var useSelect = function useSelect(_ref, ref) {
7130
7208
  setInputValueByRef$1(inputRef.current, lastValue);
7131
7209
  }
7132
7210
 
7133
- popover.hide();
7211
+ setOpen(false);
7134
7212
  break;
7135
7213
  }
7136
7214
 
@@ -7141,7 +7219,7 @@ var useSelect = function useSelect(_ref, ref) {
7141
7219
  event.preventDefault();
7142
7220
  }
7143
7221
 
7144
- popover.hide();
7222
+ setOpen(false);
7145
7223
  break;
7146
7224
  }
7147
7225
  }
@@ -7155,7 +7233,7 @@ var useSelect = function useSelect(_ref, ref) {
7155
7233
  event.preventDefault();
7156
7234
 
7157
7235
  if (!multiselect) {
7158
- popover.hide();
7236
+ setOpen(false);
7159
7237
  }
7160
7238
  };
7161
7239
 
@@ -7177,20 +7255,50 @@ var useSelect = function useSelect(_ref, ref) {
7177
7255
  more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;
7178
7256
  }
7179
7257
  } else {
7180
- var _findByValue2;
7258
+ var item = findByValue(searchData, value);
7181
7259
 
7182
- text = ((_findByValue2 = findByValue(searchData, value)) === null || _findByValue2 === void 0 ? void 0 : _findByValue2.text) || '';
7260
+ if (item) {
7261
+ text = item.icon ? React.createElement(React.Fragment, null, React.cloneElement(item.icon, {
7262
+ className: cn(item.icon.props.className, 'mr-1 -mt-px')
7263
+ }), item.text) : item.text;
7264
+ }
7183
7265
  }
7184
7266
  }
7185
7267
 
7268
+ var handleInputChange = function handleInputChange(event) {
7269
+ event.persist();
7270
+
7271
+ if (onChange) {
7272
+ var _item$path$split, _item$path;
7273
+
7274
+ var _item = findByValue(searchData, event.target.value);
7275
+
7276
+ event.detail = sanitizeItem(_item);
7277
+ var indexes = (_item$path$split = _item === null || _item === void 0 ? void 0 : (_item$path = _item.path) === null || _item$path === void 0 ? void 0 : _item$path.split('.')) !== null && _item$path$split !== void 0 ? _item$path$split : [];
7278
+
7279
+ if (indexes.length > 1) {
7280
+ // we don't want to map the current item
7281
+ indexes.pop(); // we need to rebuild the path as we map
7282
+
7283
+ var lastPath;
7284
+ event.detail.parents = indexes.map(function (i) {
7285
+ lastPath = lastPath ? [lastPath, i].join('.') : i;
7286
+ return sanitizeItem(searchData.find(function (i) {
7287
+ return i.path === lastPath;
7288
+ }));
7289
+ });
7290
+ }
7291
+
7292
+ onChange(event);
7293
+ }
7294
+ };
7295
+
7186
7296
  var button = {
7187
- 'aria-expanded': popover.visible,
7188
7297
  'aria-haspopup': 'listbox',
7189
7298
  'aria-label': ariaLabel ? ariaLabel + " " + text : undefined,
7190
7299
  'aria-labelledby': ariaLabelledBy ? ariaLabelledBy + " " + buttonId : undefined,
7191
7300
  disabled: disabled,
7192
7301
  id: buttonId,
7193
- onClick: !disabled && !readOnly ? handleButtonClick : undefined,
7194
7302
  onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,
7195
7303
  type: 'button'
7196
7304
  };
@@ -7202,53 +7310,58 @@ var useSelect = function useSelect(_ref, ref) {
7202
7310
  disabled: disabled,
7203
7311
  emptyValue: emptyValue,
7204
7312
  onClick: handleListboxClick,
7313
+ onChange: function onChange(event) {
7314
+ setInputValueByRef$1(internalInputRef.current, event.detail.value);
7315
+ },
7205
7316
  onKeyDown: handleListboxKeyDown,
7206
7317
  ref: inputRef,
7207
7318
  value: value,
7208
7319
  multiselect: multiselect
7209
7320
  });
7210
7321
 
7322
+ var input = {
7323
+ onChange: handleInputChange,
7324
+ ref: internalInputRef,
7325
+ value: value !== null && value !== void 0 ? value : ''
7326
+ };
7211
7327
  return {
7212
7328
  button: button,
7213
7329
  listbox: listbox,
7214
- popover: _extends({}, popover, {
7215
- container: {
7216
- tabIndex: -1,
7217
- 'aria-label': ariaLabel,
7218
- 'aria-labelledby': ariaLabelledBy
7219
- }
7220
- }),
7330
+ input: input,
7331
+ popover: {
7332
+ open: open,
7333
+ onOpenChange: setOpen
7334
+ },
7221
7335
  text: text,
7222
7336
  more: more
7223
7337
  };
7224
7338
  };
7225
7339
 
7226
- var _excluded$D = ["autoFocus", "className", "highlighted", "style"],
7227
- _excluded2$6 = ["container"],
7228
- _excluded3 = ["editable"];
7340
+ var _excluded$E = ["autoFocus", "className", "highlighted", "style"],
7341
+ _excluded2$5 = ["editable"];
7229
7342
  var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
7230
7343
  var autoFocus = props.autoFocus,
7231
7344
  externalClassName = props.className,
7232
7345
  style = props.style,
7233
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$D);
7346
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
7234
7347
 
7235
7348
  var _useSelect = useSelect(otherProps, ref),
7236
7349
  button = _useSelect.button,
7237
7350
  listbox = _useSelect.listbox,
7238
7351
  popover = _useSelect.popover,
7352
+ input = _useSelect.input,
7239
7353
  text = _useSelect.text,
7240
7354
  _useSelect$more = _useSelect.more,
7241
7355
  more = _useSelect$more === void 0 ? 0 : _useSelect$more;
7242
7356
 
7243
- var container = popover.container,
7244
- base = _objectWithoutPropertiesLoose(popover, _excluded2$6);
7245
-
7246
7357
  var internalRef = React.useRef(null);
7247
7358
  var selectDimensions = useBoundingClientRectListener(internalRef);
7248
7359
  var className = cn('inline-flex relative w-full', {
7249
7360
  'yt-select--readonly': props.readOnly
7250
7361
  }, externalClassName);
7251
- var inputClassname = cn(getInputClasses(props), 'text-left pr-0');
7362
+ var inputClassname = cn(getInputClasses(props), 'text-left pr-0', {
7363
+ 'border-blue': popover.open
7364
+ });
7252
7365
  React.useEffect(function () {
7253
7366
  if (autoFocus && internalRef.current) {
7254
7367
  internalRef.current.focus();
@@ -7256,7 +7369,9 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
7256
7369
  }, []);
7257
7370
 
7258
7371
  var renderMultiSelection = function renderMultiSelection() {
7259
- return React.createElement(React.Fragment, null, React.createElement("span", null, text), more > 0 && React.createElement(Badge, {
7372
+ return React.createElement(React.Fragment, null, React.createElement("span", {
7373
+ className: "flex-grow truncate text-left"
7374
+ }, text), more > 0 && React.createElement(Badge, {
7260
7375
  className: "ml-2"
7261
7376
  }, "+" + more));
7262
7377
  };
@@ -7266,33 +7381,34 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
7266
7381
  style: {
7267
7382
  minWidth: selectDimensions === null || selectDimensions === void 0 ? void 0 : selectDimensions.width
7268
7383
  },
7269
- tabIndex: popover.visible ? 0 : -1
7384
+ tabIndex: popover.open ? 0 : -1
7270
7385
  });
7271
7386
 
7272
7387
  return React.createElement("span", {
7273
7388
  className: className,
7274
7389
  "data-taco": "select",
7275
7390
  style: style
7276
- }, React.createElement(Popover$1.PopoverDisclosure, Object.assign({}, base, {
7391
+ }, React.createElement(PopoverPrimitive.Root, Object.assign({}, popover), React.createElement(PopoverPrimitive.Trigger, Object.assign({}, button, {
7392
+ className: inputClassname,
7277
7393
  ref: internalRef
7278
- }), function (_ref) {
7279
- var disclosureRef = _ref.ref;
7280
- return React.createElement("button", Object.assign({
7281
- ref: disclosureRef
7282
- }, button, {
7283
- className: inputClassname
7284
- }), props.multiselect ? renderMultiSelection() : React.createElement("span", {
7285
- className: "flex-grow"
7286
- }, text), React.createElement("span", {
7287
- className: "h-8 w-8 flex items-center justify-center"
7288
- }, React.createElement(Icon, {
7289
- name: popover.visible ? 'chevron-up' : 'chevron-down'
7290
- })));
7291
- }), !otherProps.disabled && React.createElement(Popover$1.Popover, Object.assign({}, base, container), props.multiselect ? React.createElement(MultiListbox, Object.assign({}, commonListboxProps)) : React.createElement(Listbox, Object.assign({}, commonListboxProps))));
7394
+ }), props.multiselect ? renderMultiSelection() : React.createElement("span", {
7395
+ className: "flex-grow truncate text-left"
7396
+ }, text), React.createElement("span", {
7397
+ className: "flex h-8 w-8 items-center justify-center"
7398
+ }, React.createElement(Icon, {
7399
+ className: "pointer-events-none",
7400
+ name: popover.open ? 'chevron-up' : 'chevron-down'
7401
+ }))), React.createElement(PopoverPrimitive.Content, {
7402
+ align: "start",
7403
+ sideOffset: 4
7404
+ }, props.multiselect ? React.createElement(MultiListbox, Object.assign({}, commonListboxProps)) : React.createElement(Listbox, Object.assign({}, commonListboxProps))), React.createElement("input", Object.assign({}, input, {
7405
+ className: "hidden",
7406
+ type: "text"
7407
+ }))));
7292
7408
  });
7293
7409
  var Select = /*#__PURE__*/React.forwardRef(function Select(props, ref) {
7294
7410
  var editable = props.editable,
7295
- otherProps = _objectWithoutPropertiesLoose(props, _excluded3);
7411
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded2$5);
7296
7412
 
7297
7413
  if (editable) {
7298
7414
  return React.createElement(Combobox, Object.assign({}, otherProps, {
@@ -7376,7 +7492,7 @@ var usePagination = function usePagination(initialPageIndex, initialPageSize) {
7376
7492
  };
7377
7493
  };
7378
7494
 
7379
- var _excluded$E = ["length", "pageIndex", "pageSize", "pageSizes", "setPageIndex", "setPageSize", "showPageControls", "showPageNumbers", "showPageSize", "dangerouslyHijackGlobalKeyboardNavigation"];
7495
+ var _excluded$F = ["length", "pageIndex", "pageSize", "pageSizes", "setPageIndex", "setPageSize", "showPageControls", "showPageNumbers", "showPageSize", "dangerouslyHijackGlobalKeyboardNavigation"];
7380
7496
 
7381
7497
  var getShowingLabel = function getShowingLabel(length, pageIndex, pageSize, texts) {
7382
7498
  var minItemIndex = pageIndex * pageSize + 1;
@@ -7400,7 +7516,7 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
7400
7516
  showPageSize = _props$showPageSize === void 0 ? true : _props$showPageSize,
7401
7517
  _props$dangerouslyHij = props.dangerouslyHijackGlobalKeyboardNavigation,
7402
7518
  dangerouslyHijackGlobalKeyboardNavigation = _props$dangerouslyHij === void 0 ? false : _props$dangerouslyHij,
7403
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
7519
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$F);
7404
7520
 
7405
7521
  var _useLocalization = useLocalization(),
7406
7522
  texts = _useLocalization.texts;
@@ -7419,6 +7535,7 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
7419
7535
  var className = cn('inline-flex relative justify-between items-center', props.className);
7420
7536
  return React.createElement("div", Object.assign({}, otherProps, {
7421
7537
  className: className,
7538
+ "data-taco": "pagination",
7422
7539
  ref: ref
7423
7540
  }), showPageSize && React.createElement("span", {
7424
7541
  className: "mr-4"
@@ -7482,13 +7599,13 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
7482
7599
  })));
7483
7600
  });
7484
7601
 
7485
- var _excluded$F = ["duration"];
7602
+ var _excluded$G = ["duration"];
7486
7603
  var Progress = function Progress(_ref) {
7487
7604
  var _cn;
7488
7605
 
7489
7606
  var _ref$duration = _ref.duration,
7490
7607
  duration = _ref$duration === void 0 ? undefined : _ref$duration,
7491
- props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
7608
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
7492
7609
 
7493
7610
  var style;
7494
7611
 
@@ -7512,7 +7629,7 @@ var Progress = function Progress(_ref) {
7512
7629
  }));
7513
7630
  };
7514
7631
 
7515
- var _excluded$G = ["children"];
7632
+ var _excluded$H = ["children"];
7516
7633
  var sanitizeRowProps = function sanitizeRowProps(row, rowExpansionRenderer) {
7517
7634
  var _row$subRows;
7518
7635
 
@@ -7552,7 +7669,7 @@ var getColumnsFromChildren = function getColumnsFromChildren(children, rowExpans
7552
7669
  .map(function (_ref) {
7553
7670
  var _ref$props = _ref.props,
7554
7671
  groupChildren = _ref$props.children,
7555
- props = _objectWithoutPropertiesLoose(_ref$props, _excluded$G);
7672
+ props = _objectWithoutPropertiesLoose(_ref$props, _excluded$H);
7556
7673
 
7557
7674
  var column = _extends({}, props);
7558
7675
 
@@ -7797,6 +7914,8 @@ var useRowEditing = function useRowEditing(uniqueId) {
7797
7914
  return plugin;
7798
7915
  };
7799
7916
 
7917
+ var actionGroupClassName = '-mt-1 -mb-1 h-8 flex';
7918
+
7800
7919
  var hasActions = function hasActions(inlineEditingUniqueId, handlers, actions) {
7801
7920
  return !!actions || handlers.onRowCreate || handlers.onRowCopy || handlers.onRowDelete || !!inlineEditingUniqueId || handlers.onRowEdit;
7802
7921
  };
@@ -7897,7 +8016,9 @@ var EditModeActions = function EditModeActions() {
7897
8016
  document.removeEventListener('keydown', listener);
7898
8017
  };
7899
8018
  }, []);
7900
- return React__default.createElement(Group, null, React__default.createElement(IconButton, {
8019
+ return React__default.createElement("div", {
8020
+ className: actionGroupClassName
8021
+ }, React__default.createElement(IconButton, {
7901
8022
  appearance: "primary",
7902
8023
  icon: "tick",
7903
8024
  type: "submit",
@@ -7922,7 +8043,7 @@ var useRowActions = function useRowActions(inlineEditingUniqueId, handlers, acti
7922
8043
  hooks.visibleColumns.push(function (columns) {
7923
8044
  return [].concat(columns, [{
7924
8045
  id: '_actions',
7925
- className: 'yt-table__cell__actions',
8046
+ className: 'flex justify-end px-1 overflow-visible',
7926
8047
  flex: "0 0 calc((" + actionsLength + " * 2rem) + .5rem)",
7927
8048
  Cell: function Cell(_ref) {
7928
8049
  var row = _ref.row;
@@ -8020,7 +8141,9 @@ var useRowActions = function useRowActions(inlineEditingUniqueId, handlers, acti
8020
8141
  }))) : null);
8021
8142
 
8022
8143
  if (windowed) {
8023
- return React__default.createElement(Group, null, output);
8144
+ return React__default.createElement("div", {
8145
+ className: actionGroupClassName
8146
+ }, output);
8024
8147
  }
8025
8148
 
8026
8149
  return React__default.createElement(reactIntersectionObserver.InView, {
@@ -8028,7 +8151,8 @@ var useRowActions = function useRowActions(inlineEditingUniqueId, handlers, acti
8028
8151
  }, function (_ref2) {
8029
8152
  var inView = _ref2.inView,
8030
8153
  ref = _ref2.ref;
8031
- return React__default.createElement(Group, {
8154
+ return React__default.createElement("div", {
8155
+ className: actionGroupClassName,
8032
8156
  ref: ref
8033
8157
  }, inView ? output : null);
8034
8158
  });
@@ -8042,8 +8166,8 @@ var useRowActions = function useRowActions(inlineEditingUniqueId, handlers, acti
8042
8166
  return plugin;
8043
8167
  };
8044
8168
 
8045
- var _excluded$H = ["onChange"],
8046
- _excluded2$7 = ["onChange"];
8169
+ var _excluded$I = ["onChange"],
8170
+ _excluded2$6 = ["onChange"];
8047
8171
 
8048
8172
  var toggleBetween = function toggleBetween(fromRowIndex, toRowIndex) {
8049
8173
  var fromIndex = toRowIndex < fromRowIndex ? toRowIndex : fromRowIndex;
@@ -8090,7 +8214,7 @@ var useRowSelect = function useRowSelect(onSelectedRows) {
8090
8214
  rows = _ref.rows;
8091
8215
 
8092
8216
  var _getToggleAllRowsSele = getToggleAllRowsSelectedProps(),
8093
- props = _objectWithoutPropertiesLoose(_getToggleAllRowsSele, _excluded$H);
8217
+ props = _objectWithoutPropertiesLoose(_getToggleAllRowsSele, _excluded$I);
8094
8218
 
8095
8219
  var onChange = function onChange(checked) {
8096
8220
  if (checked) {
@@ -8103,7 +8227,7 @@ var useRowSelect = function useRowSelect(onSelectedRows) {
8103
8227
 
8104
8228
  return React__default.createElement(Checkbox, Object.assign({}, props, {
8105
8229
  onChange: onChange,
8106
- className: "h-auto mt-px"
8230
+ className: "mt-px"
8107
8231
  }));
8108
8232
  },
8109
8233
  Cell: function Cell(_ref2) {
@@ -8111,7 +8235,7 @@ var useRowSelect = function useRowSelect(onSelectedRows) {
8111
8235
  rows = _ref2.rows;
8112
8236
 
8113
8237
  var _row$getToggleRowSele = row.getToggleRowSelectedProps(),
8114
- props = _objectWithoutPropertiesLoose(_row$getToggleRowSele, _excluded2$7); // row.index refers to the index in the original data, not the current index
8238
+ props = _objectWithoutPropertiesLoose(_row$getToggleRowSele, _excluded2$6); // row.index refers to the index in the original data, not the current index
8115
8239
 
8116
8240
 
8117
8241
  var sortedIndex = rows.findIndex(function (r) {
@@ -8135,7 +8259,7 @@ var useRowSelect = function useRowSelect(onSelectedRows) {
8135
8259
  };
8136
8260
 
8137
8261
  return React__default.createElement(Checkbox, Object.assign({}, props, {
8138
- className: "h-auto mt-px",
8262
+ className: "mt-px",
8139
8263
  onClick: onClick,
8140
8264
  // this is necessary to remove console spam from eslint
8141
8265
  onChange: function onChange() {
@@ -8144,7 +8268,7 @@ var useRowSelect = function useRowSelect(onSelectedRows) {
8144
8268
  }));
8145
8269
  },
8146
8270
  flex: '0 0 36px',
8147
- className: 'flex-col justify-start'
8271
+ className: 'flex-col justify-start !pb-0'
8148
8272
  }].concat(columns);
8149
8273
  });
8150
8274
  }
@@ -8404,8 +8528,8 @@ var useRowDraggable = function useRowDraggable(onRowDrag) {
8404
8528
  return plugin;
8405
8529
  };
8406
8530
 
8407
- var _excluded$I = ["children", "data", "dangerouslyHijackGlobalKeyboardNavigation", "onRowClick", "onRowDrag", "onSelectedRows", "rowClassName", "rowExpansionRenderer", "rowHeight", "selectedRows", "disableSorting", "manualSorting", "onSort", "sortRules", "disablePagination", "length", "onPaginate", "pageSize", "pageIndex", "inlineEditingUniqueId", "onRowCreate", "actions", "onRowEdit", "onRowCopy", "onRowDelete", "onRowActive", "windowed"],
8408
- _excluded2$8 = ["headerGroups", "rows", "sortedRows", "prepareRow", "state", "page", "gotoPage", "setPageSize"];
8531
+ var _excluded$J = ["children", "data", "dangerouslyHijackGlobalKeyboardNavigation", "onRowClick", "onRowDrag", "onSelectedRows", "rowClassName", "rowExpansionRenderer", "rowHeight", "selectedRows", "disableSorting", "manualSorting", "onSort", "sortRules", "disablePagination", "length", "onPaginate", "pageSize", "pageIndex", "inlineEditingUniqueId", "onRowCreate", "actions", "onRowEdit", "onRowCopy", "onRowDelete", "onRowActive", "windowed"],
8532
+ _excluded2$7 = ["headerGroups", "rows", "sortedRows", "prepareRow", "state", "page", "gotoPage", "setPageSize"];
8409
8533
 
8410
8534
  var useTableRowActive = function useTableRowActive(activeIndex, rows, rowExpansionRenderer, handleonRowActive) {
8411
8535
  React__default.useEffect(function () {
@@ -8509,7 +8633,7 @@ var useTable = function useTable(props, ref) {
8509
8633
  onRowActive = props.onRowActive,
8510
8634
  _props$windowed = props.windowed,
8511
8635
  windowed = _props$windowed === void 0 ? false : _props$windowed,
8512
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$I);
8636
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$J);
8513
8637
 
8514
8638
  if (onSelectedRows && !selectedRows || !onSelectedRows && selectedRows) {
8515
8639
  throw new Error('Selected rows in a Table component are fully controlled - you must pass both the `onSelectedRows` and `selectedRows` props when using row selection');
@@ -8569,7 +8693,7 @@ var useTable = function useTable(props, ref) {
8569
8693
  page = _useReactTable.page,
8570
8694
  gotoPage = _useReactTable.gotoPage,
8571
8695
  setPageSize = _useReactTable.setPageSize,
8572
- instance = _objectWithoutPropertiesLoose(_useReactTable, _excluded2$8);
8696
+ instance = _objectWithoutPropertiesLoose(_useReactTable, _excluded2$7);
8573
8697
 
8574
8698
  useTablePaginationListener(disablePagination, onPaginate, state);
8575
8699
  useTableSortingListener(data, sortedRows, onSort, !!manualSorting, state);
@@ -8626,13 +8750,13 @@ var useTable = function useTable(props, ref) {
8626
8750
  };
8627
8751
  };
8628
8752
 
8629
- var _excluded$J = ["row", "index", "instance", "headerGroups"];
8753
+ var _excluded$K = ["row", "index", "instance", "headerGroups"];
8630
8754
 
8631
8755
  var renderCell = function renderCell(cell, row) {
8632
8756
  var props = _extends({}, cell.getCellProps(), {
8633
8757
  className: cn('yt-table__cell', cell.column.className, {
8634
- 'yt-table__cell--align-left': cell.column.align === 'left',
8635
- 'yt-table__cell--align-right': cell.column.align === 'right'
8758
+ 'justify-start text-left': cell.column.align === 'left',
8759
+ 'justify-end text-right': cell.column.align === 'right'
8636
8760
  }),
8637
8761
  style: _extends({}, cell.column.style, {
8638
8762
  flex: typeof cell.column.flex === 'function' ? cell.column.flex(row) : cell.column.flex
@@ -8640,7 +8764,8 @@ var renderCell = function renderCell(cell, row) {
8640
8764
  });
8641
8765
 
8642
8766
  return React__default.createElement("div", Object.assign({}, props, {
8643
- role: "gridcell"
8767
+ role: "gridcell",
8768
+ "data-taco": "table-cell"
8644
8769
  }), cell.render('Cell') || null);
8645
8770
  };
8646
8771
 
@@ -8648,7 +8773,7 @@ var Row = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
8648
8773
  var row = _ref.row,
8649
8774
  index = _ref.index,
8650
8775
  instance = _ref.instance,
8651
- rowProps = _objectWithoutPropertiesLoose(_ref, _excluded$J);
8776
+ rowProps = _objectWithoutPropertiesLoose(_ref, _excluded$K);
8652
8777
 
8653
8778
  var activeIndex = rowProps.activeIndex,
8654
8779
  onRowClick = rowProps.onRowClick,
@@ -8735,8 +8860,8 @@ var Column = function Column(_ref) {
8735
8860
  className: cn('yt-table__cell', cell.className, {
8736
8861
  'yt-table__cell__group': !!cell.columns,
8737
8862
  'yt-table__cell--disable-sort': cell.disableSorting,
8738
- 'yt-table__cell--align-left': cell.align === 'left',
8739
- 'yt-table__cell--align-right': cell.align === 'right'
8863
+ 'justify-start text-left': cell.align === 'left',
8864
+ 'justify-end text-right': cell.align === 'right'
8740
8865
  }),
8741
8866
  style: _extends({}, cell.style, {
8742
8867
  flex: cell.flex
@@ -8748,13 +8873,14 @@ var Column = function Column(_ref) {
8748
8873
  }
8749
8874
 
8750
8875
  return React__default.createElement("div", Object.assign({}, props, {
8751
- key: cell.id
8876
+ key: cell.id,
8877
+ "data-taco": "table-column"
8752
8878
  }), React__default.createElement("span", null, cell.render('Header')), cell.isSorted ? React__default.createElement(Icon, {
8753
8879
  name: cell.isSortedDesc ? 'chevron-down-solid' : 'chevron-up-solid'
8754
8880
  }) : null);
8755
8881
  };
8756
8882
 
8757
- var _excluded$K = ["autoFocus", "children", "disableSorting", "headerGroups", "headerRef", "bodyRef"];
8883
+ var _excluded$L = ["autoFocus", "children", "disableSorting", "headerGroups", "headerRef", "bodyRef"];
8758
8884
  var DefaultEmptyState = function DefaultEmptyState() {
8759
8885
  return null;
8760
8886
  };
@@ -8766,7 +8892,7 @@ var BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props,
8766
8892
  headerGroups = props.headerGroups,
8767
8893
  headerRef = props.headerRef,
8768
8894
  bodyRef = props.bodyRef,
8769
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$K);
8895
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$L);
8770
8896
 
8771
8897
  React__default.useEffect(function () {
8772
8898
  if (autoFocus && tableRef.current) {
@@ -8801,11 +8927,11 @@ var BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props,
8801
8927
  }, children));
8802
8928
  });
8803
8929
 
8804
- var _excluded$L = ["emptyStateRenderer"];
8930
+ var _excluded$M = ["emptyStateRenderer"];
8805
8931
  var Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
8806
8932
  var _props$emptyStateRend = props.emptyStateRenderer,
8807
8933
  emptyStateRenderer = _props$emptyStateRend === void 0 ? DefaultEmptyState : _props$emptyStateRend,
8808
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$L);
8934
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$M);
8809
8935
 
8810
8936
  var tableRef = useProxiedRef(ref);
8811
8937
 
@@ -8870,14 +8996,14 @@ PaginatedTable.Group = function () {
8870
8996
  return null;
8871
8997
  };
8872
8998
 
8873
- var _excluded$M = ["height"],
8874
- _excluded2$9 = ["emptyStateRenderer", "length", "loadMore"];
8999
+ var _excluded$N = ["height"],
9000
+ _excluded2$8 = ["emptyStateRenderer", "length", "loadMore"];
8875
9001
  var ROW_HEIGHT = 40;
8876
9002
  var VariableRow = /*#__PURE__*/React__default.memo(function (_ref) {
8877
9003
  var data = _ref.data,
8878
9004
  index = _ref.index,
8879
9005
  _ref$style = _ref.style,
8880
- style = _objectWithoutPropertiesLoose(_ref$style, _excluded$M);
9006
+ style = _objectWithoutPropertiesLoose(_ref$style, _excluded$N);
8881
9007
 
8882
9008
  var _useLocalization = useLocalization(),
8883
9009
  texts = _useLocalization.texts;
@@ -8939,7 +9065,7 @@ var WindowedTable = /*#__PURE__*/React__default.forwardRef(function WindowedTabl
8939
9065
  emptyStateRenderer = _props$emptyStateRend === void 0 ? DefaultEmptyState : _props$emptyStateRend,
8940
9066
  length = props.length,
8941
9067
  loadMore = props.loadMore,
8942
- otherProps = _objectWithoutPropertiesLoose(props, _excluded2$9);
9068
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded2$8);
8943
9069
 
8944
9070
  var _useTable = useTable(_extends({}, otherProps, {
8945
9071
  windowed: true
@@ -9243,9 +9369,9 @@ var useTableRowCreation = function useTableRowCreation(data, tableRef) {
9243
9369
  };
9244
9370
  };
9245
9371
 
9246
- var _excluded$N = ["id", "defaultId", "children", "onChange", "orientation"],
9247
- _excluded2$a = ["id", "disabled"],
9248
- _excluded3$1 = ["id"];
9372
+ var _excluded$O = ["id", "defaultId", "children", "onChange", "orientation"],
9373
+ _excluded2$9 = ["id", "disabled"],
9374
+ _excluded3 = ["id"];
9249
9375
  var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
9250
9376
  var id = props.id,
9251
9377
  defaultId = props.defaultId,
@@ -9253,7 +9379,7 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
9253
9379
  onChange = props.onChange,
9254
9380
  _props$orientation = props.orientation,
9255
9381
  orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
9256
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$N);
9382
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$O);
9257
9383
 
9258
9384
  var className = cn('yt-tabs', "yt-tabs--" + orientation, {
9259
9385
  'flex w-full': orientation === 'vertical'
@@ -9279,7 +9405,7 @@ var TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
9279
9405
  var TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
9280
9406
  var id = props.id,
9281
9407
  disabled = props.disabled,
9282
- otherProps = _objectWithoutPropertiesLoose(props, _excluded2$a);
9408
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded2$9);
9283
9409
 
9284
9410
  var className = cn('yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4', disabled ? 'cursor-not-allowed !text-grey' : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue', props.className);
9285
9411
  return React.createElement(TabsPrimitive.Trigger, Object.assign({}, otherProps, {
@@ -9294,7 +9420,7 @@ var TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
9294
9420
  });
9295
9421
  var TabContent = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
9296
9422
  var id = props.id,
9297
- otherProps = _objectWithoutPropertiesLoose(props, _excluded3$1);
9423
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded3);
9298
9424
 
9299
9425
  var className = cn('yt-tab__panel outline-none', props.className);
9300
9426
  return React.createElement(TabsPrimitive.Content, Object.assign({}, otherProps, {
@@ -9307,9 +9433,9 @@ Tabs.List = TabList;
9307
9433
  Tabs.Trigger = TabTrigger;
9308
9434
  Tabs.Content = TabContent;
9309
9435
 
9310
- var _excluded$O = ["defaultValue", "highlighted", "state"];
9436
+ var _excluded$P = ["defaultValue", "highlighted", "state"];
9311
9437
  var Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
9312
- var otherProps = _objectWithoutPropertiesLoose(props, _excluded$O);
9438
+ var otherProps = _objectWithoutPropertiesLoose(props, _excluded$P);
9313
9439
 
9314
9440
  var classNames = cn(getInputClasses(props), 'py-1 min-h-[75px] disabled:resize-none', props.className);
9315
9441
  return React.createElement("textarea", Object.assign({}, otherProps, {
@@ -9318,11 +9444,11 @@ var Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
9318
9444
  }));
9319
9445
  });
9320
9446
 
9321
- var _excluded$P = ["label", "onChange"];
9447
+ var _excluded$Q = ["label", "onChange"];
9322
9448
  var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
9323
9449
  var label = props.label,
9324
9450
  onChange = props.onChange,
9325
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$P);
9451
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$Q);
9326
9452
 
9327
9453
  var className = cn('group h-6 w-10 flex rounded-full inline-flex', {
9328
9454
  'mr-2': !!label,
@@ -9658,7 +9784,7 @@ var tailwind_config = {
9658
9784
  };
9659
9785
  var tailwind_config_1 = tailwind_config.theme;
9660
9786
 
9661
- var _excluded$Q = ["autoStart", "onComplete", "onClose", "onReady", "spotlightClicks", "disableCloseOnEsc", "disableScrollParentFix"];
9787
+ var _excluded$R = ["autoStart", "onComplete", "onClose", "onReady", "spotlightClicks", "disableCloseOnEsc", "disableScrollParentFix"];
9662
9788
 
9663
9789
  var Tooltip$1 = function Tooltip(_ref) {
9664
9790
  var continuous = _ref.continuous,
@@ -9723,7 +9849,7 @@ var Tour = function Tour(props) {
9723
9849
  disableTourSkipOnEsc = props.disableCloseOnEsc,
9724
9850
  _props$disableScrollP = props.disableScrollParentFix,
9725
9851
  disableScrollParentFix = _props$disableScrollP === void 0 ? false : _props$disableScrollP,
9726
- rest = _objectWithoutPropertiesLoose(props, _excluded$Q);
9852
+ rest = _objectWithoutPropertiesLoose(props, _excluded$R);
9727
9853
 
9728
9854
  var steps = React.useMemo(function () {
9729
9855
  return React__default.Children.map(props.children, function (child) {
@@ -9818,6 +9944,7 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
9818
9944
  };
9819
9945
 
9820
9946
  exports.Accordion = Accordion;
9947
+ exports.Backdrop = Backdrop;
9821
9948
  exports.Badge = Badge;
9822
9949
  exports.Banner = Banner;
9823
9950
  exports.Button = Button$1;