@economic/taco 1.1.9-alpha.1 → 1.1.9-alpha.2

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 (35) hide show
  1. package/dist/esm/components/Badge/Badge.js +14 -14
  2. package/dist/esm/components/Badge/Badge.js.map +1 -1
  3. package/dist/esm/components/Calendar/Calendar.js +56 -71
  4. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  5. package/dist/esm/components/Card/Card.js +14 -12
  6. package/dist/esm/components/Card/Card.js.map +1 -1
  7. package/dist/esm/components/Checkbox/Checkbox.js +15 -18
  8. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  9. package/dist/esm/components/Combobox/Combobox.js +23 -25
  10. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  11. package/dist/esm/components/Datepicker/Datepicker.js +48 -52
  12. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  13. package/dist/esm/components/Dialog/Dialog.js +39 -58
  14. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  15. package/dist/esm/components/Field/Field.js +10 -12
  16. package/dist/esm/components/Field/Field.js.map +1 -1
  17. package/dist/esm/components/Form/Form.js +6 -8
  18. package/dist/esm/components/Form/Form.js.map +1 -1
  19. package/dist/esm/components/Group/Group.js +6 -8
  20. package/dist/esm/components/Group/Group.js.map +1 -1
  21. package/dist/esm/components/Hanger/Hanger.js +27 -35
  22. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  23. package/dist/esm/components/SearchInput/SearchInput.js +1 -0
  24. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  25. package/dist/esm/index.js +1 -0
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/utils/hooks/useDropTarget.js +10 -7
  28. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  29. package/dist/index.d.ts +1 -0
  30. package/dist/taco.cjs.development.js +270 -311
  31. package/dist/taco.cjs.development.js.map +1 -1
  32. package/dist/taco.cjs.production.min.js +1 -1
  33. package/dist/taco.cjs.production.min.js.map +1 -1
  34. package/package.json +1 -1
  35. package/tailwind.config.js +4 -0
@@ -3349,19 +3349,20 @@ const getOutlineClasses = state => {
3349
3349
  }
3350
3350
  };
3351
3351
 
3352
- var _excluded$1 = ["children", "compact", "outline", "state"];
3353
- var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
3354
- var _cn;
3355
-
3356
- var children = props.children,
3357
- _props$compact = props.compact,
3358
- compact = _props$compact === void 0 ? false : _props$compact,
3359
- _props$outline = props.outline,
3360
- outline = _props$outline === void 0 ? false : _props$outline,
3361
- state = props.state,
3362
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
3363
-
3364
- var className = cn('rounded-full border font-bold text-xs uppercase overflow-hidden whitespace-nowrap inline-flex items-center justify-center h-5', (_cn = {}, _cn[getOutlineClasses(state)] = outline, _cn["border-transparent " + getStateClasses(state)] = !outline, _cn['h-2 w-2 min-w-0'] = compact, _cn['h-5 py-0 px-1.5'] = !compact, _cn), props.className);
3352
+ const Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
3353
+ const {
3354
+ children,
3355
+ compact = false,
3356
+ outline = false,
3357
+ state,
3358
+ ...otherProps
3359
+ } = props;
3360
+ const className = cn('rounded-full border font-bold text-xs uppercase overflow-hidden whitespace-nowrap inline-flex items-center justify-center h-5', {
3361
+ [getOutlineClasses(state)]: outline,
3362
+ [`border-transparent ${getStateClasses(state)}`]: !outline,
3363
+ 'h-2 w-2 min-w-0': compact,
3364
+ 'h-5 py-0 px-1.5': !compact
3365
+ }, props.className);
3365
3366
  return React.createElement("span", Object.assign({}, otherProps, {
3366
3367
  "aria-atomic": "true",
3367
3368
  "aria-live": "polite",
@@ -3562,10 +3563,10 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
3562
3563
  }) : null);
3563
3564
  });
3564
3565
 
3565
- var _excluded$2 = ["fluid"];
3566
+ var _excluded$1 = ["fluid"];
3566
3567
  var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
3567
3568
  var fluid = props.fluid,
3568
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
3569
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
3569
3570
 
3570
3571
  var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
3571
3572
  'cursor-not-allowed opacity-50': props.disabled,
@@ -4043,37 +4044,37 @@ const Provider = props => {
4043
4044
  const useTaco = () => React.useContext(Context);
4044
4045
  const useLocalization = () => useTaco().localization;
4045
4046
 
4046
- var _excluded$3 = ["onChange", "value"];
4047
-
4048
- var renderDay = function renderDay(day, modifiers) {
4049
- return modifiers.disabled ? React.createElement("span", {
4050
- className: "dot"
4051
- }) : day.getDate();
4052
- };
4047
+ const renderDay = (day, modifiers) => modifiers.disabled ? React.createElement("span", {
4048
+ className: "dot"
4049
+ }) : day.getDate();
4053
4050
 
4054
- var thisYear = /*#__PURE__*/new Date().getFullYear();
4055
- var years = [];
4051
+ const thisYear = /*#__PURE__*/new Date().getFullYear();
4052
+ const years = [];
4056
4053
 
4057
- for (var i = thisYear - 10; i <= thisYear + 10; i += 1) {
4054
+ for (let i = thisYear - 10; i <= thisYear + 10; i += 1) {
4058
4055
  years.push(i);
4059
4056
  }
4060
4057
 
4061
- var Navbar = /*#__PURE__*/React.memo(function (_ref) {
4062
- var onMonthChange = _ref.onMonthChange,
4063
- onNextClick = _ref.onNextClick,
4064
- onPreviousClick = _ref.onPreviousClick,
4065
- _ref$value = _ref.value,
4066
- value = _ref$value === void 0 ? new Date() : _ref$value;
4067
-
4068
- var _useLocalization = useLocalization(),
4069
- _useLocalization$text = _useLocalization.texts.calendar,
4070
- actions = _useLocalization$text.actions,
4071
- months = _useLocalization$text.months;
4058
+ const Navbar = /*#__PURE__*/React.memo(({
4059
+ onMonthChange,
4060
+ onNextClick,
4061
+ onPreviousClick,
4062
+ value = new Date()
4063
+ }) => {
4064
+ const {
4065
+ texts: {
4066
+ calendar: {
4067
+ actions,
4068
+ months
4069
+ }
4070
+ }
4071
+ } = useLocalization();
4072
4072
 
4073
- var handleChange = function handleChange(event) {
4074
- var _event$target$form = event.target.form,
4075
- year = _event$target$form.year,
4076
- month = _event$target$form.month;
4073
+ const handleChange = function handleChange(event) {
4074
+ const {
4075
+ year,
4076
+ month
4077
+ } = event.target.form;
4077
4078
  onMonthChange(new Date(year.value, month.value));
4078
4079
  };
4079
4080
 
@@ -4086,59 +4087,49 @@ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
4086
4087
  name: "month",
4087
4088
  onChange: handleChange,
4088
4089
  value: value.getMonth()
4089
- }, months.map(function (month, i) {
4090
- return React.createElement("option", {
4091
- key: month,
4092
- value: i
4093
- }, month);
4094
- })), React.createElement("select", {
4090
+ }, months.map((month, i) => React.createElement("option", {
4091
+ key: month,
4092
+ value: i
4093
+ }, month))), React.createElement("select", {
4095
4094
  className: "h-8 px-2",
4096
4095
  name: "year",
4097
4096
  onChange: handleChange,
4098
4097
  value: value.getFullYear()
4099
- }, years.map(function (year) {
4100
- return React.createElement("option", {
4101
- key: year,
4102
- value: year
4103
- }, String(year));
4104
- }))), React.createElement("div", null, React.createElement(IconButton, {
4098
+ }, years.map(year => React.createElement("option", {
4099
+ key: year,
4100
+ value: year
4101
+ }, String(year))))), React.createElement("div", null, React.createElement(IconButton, {
4105
4102
  appearance: "discrete",
4106
4103
  icon: "chevron-left",
4107
4104
  "aria-label": actions.previousMonth,
4108
- onClick: function onClick() {
4109
- return onPreviousClick();
4110
- },
4105
+ onClick: () => onPreviousClick(),
4111
4106
  rounded: true
4112
4107
  }), React.createElement(IconButton, {
4113
4108
  appearance: "discrete",
4114
4109
  icon: "chevron-right",
4115
4110
  "aria-label": actions.nextMonth,
4116
- onClick: function onClick() {
4117
- return onNextClick();
4118
- },
4111
+ onClick: () => onNextClick(),
4119
4112
  rounded: true
4120
4113
  })));
4121
4114
  });
4122
- var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4123
- var handleChange = props.onChange,
4124
- value = props.value,
4125
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
4126
-
4127
- var _useLocalization2 = useLocalization(),
4128
- locale = _useLocalization2.locale,
4129
- texts = _useLocalization2.texts;
4130
-
4131
- var _React$useState = React.useState(value !== null && value !== void 0 ? value : new Date()),
4132
- visibleMonth = _React$useState[0],
4133
- setVisibleMonth = _React$useState[1];
4134
-
4135
- React.useEffect(function () {
4115
+ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4116
+ const {
4117
+ onChange: handleChange,
4118
+ value,
4119
+ ...otherProps
4120
+ } = props;
4121
+ const {
4122
+ locale,
4123
+ texts
4124
+ } = useLocalization();
4125
+ const [visibleMonth, setVisibleMonth] = React.useState(value !== null && value !== void 0 ? value : new Date());
4126
+ React.useEffect(() => {
4136
4127
  if (visibleMonth !== value) {
4137
4128
  setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
4138
4129
  }
4139
4130
  }, [value]);
4140
4131
 
4141
- var handleDayClick = function handleDayClick(date, modifiers, event) {
4132
+ const handleDayClick = (date, modifiers, event) => {
4142
4133
  if (modifiers.outside || modifiers.disabled) {
4143
4134
  return;
4144
4135
  }
@@ -4146,8 +4137,8 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4146
4137
  handleChange(date, event);
4147
4138
  };
4148
4139
 
4149
- var handleCalendarClickToday = function handleCalendarClickToday() {
4150
- var today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
4140
+ const handleCalendarClickToday = () => {
4141
+ const today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
4151
4142
 
4152
4143
  today.setHours(12);
4153
4144
  today.setMinutes(0);
@@ -4155,7 +4146,7 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4155
4146
  handleChange(today);
4156
4147
  };
4157
4148
 
4158
- var className = cn('flex bg-white text-xs p-4', otherProps.className);
4149
+ const className = cn('flex bg-white text-xs p-4', otherProps.className);
4159
4150
  return React.createElement("div", {
4160
4151
  "data-taco": "calendar"
4161
4152
  }, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
@@ -4166,18 +4157,14 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4166
4157
  firstDayOfWeek: 1,
4167
4158
  months: texts.calendar.months,
4168
4159
  weekdaysShort: texts.calendar.weekdaysShort,
4169
- navbarElement: function navbarElement(navProps) {
4170
- return React.createElement(Navbar, Object.assign({}, navProps, {
4171
- onMonthChange: setVisibleMonth,
4172
- value: visibleMonth
4173
- }));
4174
- },
4160
+ navbarElement: navProps => React.createElement(Navbar, Object.assign({}, navProps, {
4161
+ onMonthChange: setVisibleMonth,
4162
+ value: visibleMonth
4163
+ })),
4175
4164
  onDayClick: handleDayClick,
4176
4165
  onMonthChange: setVisibleMonth,
4177
4166
  onTodayButtonClick: handleCalendarClickToday,
4178
- captionElement: function captionElement() {
4179
- return null;
4180
- },
4167
+ captionElement: () => null,
4181
4168
  todayButton: texts.calendar.actions.today,
4182
4169
  showOutsideDays: true,
4183
4170
  renderDay: renderDay,
@@ -4186,32 +4173,30 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4186
4173
  })));
4187
4174
  });
4188
4175
 
4189
- var _excluded$4 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
4190
- var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
4191
- var checked = props.checked,
4192
- highlighted = props.highlighted,
4193
- indeterminate = props.indeterminate,
4194
- invalid = props.invalid,
4195
- label = props.label,
4196
- onChange = props.onChange,
4197
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
4198
-
4199
- var className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem] focus:yt-focus', //hover:shadow-[0_0_0_1px_rgba(235,235,235,1)]
4176
+ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
4177
+ const {
4178
+ checked,
4179
+ highlighted,
4180
+ indeterminate,
4181
+ invalid,
4182
+ label,
4183
+ onChange,
4184
+ ...otherProps
4185
+ } = props;
4186
+ const className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem] focus:yt-focus', //hover:shadow-[0_0_0_1px_rgba(235,235,235,1)]
4200
4187
  props.className, {
4201
4188
  'border-grey-dark text-blue hover:text-blue-light focus:border-blue focus:hover:border-blue-light': !props.disabled && !invalid,
4202
4189
  'border-grey text-blue-light cursor-not-allowed': props.disabled,
4203
4190
  'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
4204
4191
  'border-red text-red hover:text-red-light hover:border-red-light focus:border-red focus:hover:border-red-light': invalid && !props.disabled
4205
4192
  });
4206
- var handleChange;
4193
+ let handleChange;
4207
4194
 
4208
4195
  if (onChange) {
4209
- handleChange = function handleChange(checked) {
4210
- return onChange(checked === 'indeterminate' ? false : checked);
4211
- };
4196
+ handleChange = checked => onChange(checked === 'indeterminate' ? false : checked);
4212
4197
  }
4213
4198
 
4214
- var element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
4199
+ const element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
4215
4200
  "data-taco": "checkbox",
4216
4201
  checked: indeterminate ? 'indeterminate' : checked,
4217
4202
  className: className,
@@ -4225,7 +4210,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
4225
4210
  })));
4226
4211
 
4227
4212
  if (label) {
4228
- var labelClassName = cn('flex items-center cursor-pointer gap-2', {
4213
+ const labelClassName = cn('flex items-center cursor-pointer gap-2', {
4229
4214
  'cursor-not-allowed text-grey-dark': props.disabled
4230
4215
  }, props.className);
4231
4216
  return React.createElement("label", {
@@ -5106,27 +5091,26 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
5106
5091
  return dimensions;
5107
5092
  };
5108
5093
 
5109
- var _excluded$5 = ["className", "dialog", "style"];
5110
- var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
5111
- var externalClassName = props.className,
5112
- dialog = props.dialog,
5113
- style = props.style,
5114
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
5115
-
5116
- var _useCombobox = useCombobox(otherProps, ref),
5117
- combobox = _useCombobox.combobox,
5118
- button = _useCombobox.button,
5119
- input = _useCombobox.input,
5120
- popover = _useCombobox.popover,
5121
- list = _useCombobox.list;
5122
-
5123
- var internalRef = React.useRef(null);
5124
-
5125
- var _useLocalization = useLocalization(),
5126
- texts = _useLocalization.texts;
5127
-
5128
- var selectDimensions = useBoundingClientRectListener(internalRef);
5129
- var className = cn('inline-flex relative', {
5094
+ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
5095
+ const {
5096
+ className: externalClassName,
5097
+ dialog,
5098
+ style,
5099
+ ...otherProps
5100
+ } = props;
5101
+ const {
5102
+ combobox,
5103
+ button,
5104
+ input,
5105
+ popover,
5106
+ list
5107
+ } = useCombobox(otherProps, ref);
5108
+ const internalRef = React.useRef(null);
5109
+ const {
5110
+ texts
5111
+ } = useLocalization();
5112
+ const selectDimensions = useBoundingClientRectListener(internalRef);
5113
+ const className = cn('inline-flex relative', {
5130
5114
  'yt-combobox--inline': props.inline
5131
5115
  }, externalClassName);
5132
5116
  return React.createElement("span", {
@@ -5145,7 +5129,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
5145
5129
  appearance: "discrete",
5146
5130
  className: "!border-l-0 focus:!border-none focus:!shadow-none active:!border-none",
5147
5131
  icon: popover.open ? 'chevron-up' : 'chevron-down',
5148
- onClick: function onClick() {
5132
+ onClick: () => {
5149
5133
  var _input$ref$current;
5150
5134
 
5151
5135
  popover.onOpenChange(true);
@@ -5156,7 +5140,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
5156
5140
  icon: "list-search",
5157
5141
  disabled: props.readOnly || props.disabled,
5158
5142
  dialog: dialog,
5159
- onFocus: function onFocus(event) {
5143
+ onFocus: event => {
5160
5144
  var _input$ref$current2;
5161
5145
 
5162
5146
  // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element
@@ -5169,7 +5153,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
5169
5153
  }) : undefined
5170
5154
  })))), React.createElement(PopoverPrimitive.Content, {
5171
5155
  align: "start",
5172
- onOpenAutoFocus: function onOpenAutoFocus(event) {
5156
+ onOpenAutoFocus: event => {
5173
5157
  event.preventDefault();
5174
5158
  },
5175
5159
  sideOffset: 4
@@ -5479,23 +5463,23 @@ Popover.Trigger = Trigger$1;
5479
5463
  Popover.Content = Content$1;
5480
5464
  Popover.Close = Close$1;
5481
5465
 
5482
- var _excluded$6 = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
5483
- var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
5484
- var externalClassName = props.className,
5485
- handleReset = props.onReset,
5486
- style = props.style,
5487
- shortcuts = props.shortcuts,
5488
- shortcutsText = props.shortcutsText,
5489
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
5490
-
5491
- var _useDatepicker = useDatepicker(otherProps, ref),
5492
- calendar = _useDatepicker.calendar,
5493
- input = _useDatepicker.input;
5494
-
5495
- var _useLocalization = useLocalization(),
5496
- texts = _useLocalization.texts;
5497
-
5498
- var className = cn('inline-flex w-full text-black font-normal', externalClassName);
5466
+ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
5467
+ const {
5468
+ className: externalClassName,
5469
+ onReset: handleReset,
5470
+ style,
5471
+ shortcuts,
5472
+ shortcutsText,
5473
+ ...otherProps
5474
+ } = props;
5475
+ const {
5476
+ calendar,
5477
+ input
5478
+ } = useDatepicker(otherProps, ref);
5479
+ const {
5480
+ texts
5481
+ } = useLocalization();
5482
+ const className = cn('inline-flex w-full text-black font-normal', externalClassName);
5499
5483
  return React.createElement("span", {
5500
5484
  className: className,
5501
5485
  "data-taco": "datepicker",
@@ -5505,40 +5489,37 @@ var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
5505
5489
  "aria-label": texts.datepicker.expand,
5506
5490
  disabled: input.disabled || input.readOnly,
5507
5491
  icon: "calendar"
5508
- })), React.createElement(Popover.Content, null, function (_ref) {
5509
- var close = _ref.close;
5510
- return React.createElement("div", {
5511
- className: "-m-3 flex"
5512
- }, React.createElement(Calendar$1, Object.assign({}, calendar, {
5513
- onChange: function onChange(date, event) {
5514
- calendar.onChange(date, event);
5515
- close();
5516
- },
5517
- tabIndex: -1
5518
- })), shortcuts && React.createElement("div", {
5519
- className: "border-grey-dark flex flex-col border-l"
5520
- }, React.createElement("span", {
5521
- className: "m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold"
5522
- }, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map(function (shortcut, i) {
5523
- return React.createElement("li", {
5524
- key: i
5525
- }, React.createElement("button", {
5526
- className: "hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs",
5527
- onClick: function onClick(event) {
5528
- event.persist();
5529
- shortcut.onClick(event);
5530
- close();
5531
- }
5532
- }, shortcut.text));
5533
- })), handleReset && React.createElement("button", {
5534
- className: "text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs",
5535
- onClick: function onClick(event) {
5536
- event.persist();
5537
- handleReset(event);
5538
- close();
5539
- }
5540
- }, texts.datepicker.clear)));
5541
- }))
5492
+ })), React.createElement(Popover.Content, null, ({
5493
+ close
5494
+ }) => React.createElement("div", {
5495
+ className: "-m-3 flex"
5496
+ }, React.createElement(Calendar$1, Object.assign({}, calendar, {
5497
+ onChange: (date, event) => {
5498
+ calendar.onChange(date, event);
5499
+ close();
5500
+ },
5501
+ tabIndex: -1
5502
+ })), shortcuts && React.createElement("div", {
5503
+ className: "border-grey-dark flex flex-col border-l"
5504
+ }, React.createElement("span", {
5505
+ className: "m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold"
5506
+ }, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map((shortcut, i) => React.createElement("li", {
5507
+ key: i
5508
+ }, React.createElement("button", {
5509
+ className: "hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs",
5510
+ onClick: event => {
5511
+ event.persist();
5512
+ shortcut.onClick(event);
5513
+ close();
5514
+ }
5515
+ }, shortcut.text)))), handleReset && React.createElement("button", {
5516
+ className: "text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs",
5517
+ onClick: event => {
5518
+ event.persist();
5519
+ handleReset(event);
5520
+ close();
5521
+ }
5522
+ }, texts.datepicker.clear)))))
5542
5523
  })));
5543
5524
  });
5544
5525
 
@@ -5781,14 +5762,12 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
5781
5762
  });
5782
5763
  Extra.displayName = 'DialogExtra';
5783
5764
 
5784
- var _excluded$7 = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
5785
-
5786
- var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
5787
- return React.useMemo(function () {
5788
- var children = [];
5789
- var drawer;
5790
- var extra;
5791
- React.Children.toArray(initialChildren).forEach(function (child) {
5765
+ const useSeparatedChildren = initialChildren => {
5766
+ return React.useMemo(() => {
5767
+ const children = [];
5768
+ let drawer;
5769
+ let extra;
5770
+ React.Children.toArray(initialChildren).forEach(child => {
5792
5771
  var _child$type, _child$type2;
5793
5772
 
5794
5773
  if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
@@ -5803,55 +5782,39 @@ var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
5803
5782
  }, [initialChildren]);
5804
5783
  };
5805
5784
 
5806
- var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
5807
- var initialChildren = props.children,
5808
- _props$closeOnEscape = props.closeOnEscape,
5809
- closeOnEscape = _props$closeOnEscape === void 0 ? true : _props$closeOnEscape,
5810
- defaultOpen = props.defaultOpen,
5811
- _props$draggable = props.draggable,
5812
- draggable = _props$draggable === void 0 ? false : _props$draggable,
5813
- onChange = props.onChange,
5814
- onClose = props.onClose,
5815
- open = props.open,
5816
- _props$showCloseButto = props.showCloseButton,
5817
- showCloseButton = _props$showCloseButto === void 0 ? true : _props$showCloseButto,
5818
- _props$size = props.size,
5819
- size = _props$size === void 0 ? 'sm' : _props$size,
5820
- trigger = props.trigger,
5821
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$7);
5822
-
5823
- var _useSeparatedChildren = useSeparatedChildren(initialChildren),
5824
- children = _useSeparatedChildren[0],
5825
- drawer = _useSeparatedChildren[1],
5826
- extra = _useSeparatedChildren[2];
5827
-
5828
- var _React$useState = React.useState(false),
5829
- drawerOpen = _React$useState[0],
5830
- setDrawerOpen = _React$useState[1];
5831
-
5832
- var context = React.useMemo(function () {
5833
- return {
5834
- closeOnEscape: closeOnEscape,
5835
- draggable: draggable,
5836
- drawer: {
5837
- open: drawerOpen,
5838
- toggle: function toggle() {
5839
- return setDrawerOpen(function (isDrawerOpen) {
5840
- return !isDrawerOpen;
5841
- });
5842
- }
5843
- },
5844
- elements: {
5845
- drawer: drawer,
5846
- extra: extra
5847
- },
5848
- onClose: onClose,
5849
- props: otherProps,
5850
- showCloseButton: showCloseButton,
5851
- size: size,
5852
- ref: ref
5853
- };
5854
- }, [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
5785
+ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
5786
+ const {
5787
+ children: initialChildren,
5788
+ closeOnEscape = true,
5789
+ defaultOpen,
5790
+ draggable = false,
5791
+ onChange,
5792
+ onClose,
5793
+ open,
5794
+ showCloseButton = true,
5795
+ size = 'sm',
5796
+ trigger,
5797
+ ...otherProps
5798
+ } = props;
5799
+ const [children, drawer, extra] = useSeparatedChildren(initialChildren);
5800
+ const [drawerOpen, setDrawerOpen] = React.useState(false);
5801
+ const context = React.useMemo(() => ({
5802
+ closeOnEscape,
5803
+ draggable,
5804
+ drawer: {
5805
+ open: drawerOpen,
5806
+ toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen)
5807
+ },
5808
+ elements: {
5809
+ drawer,
5810
+ extra
5811
+ },
5812
+ onClose,
5813
+ props: otherProps,
5814
+ showCloseButton,
5815
+ size,
5816
+ ref
5817
+ }), [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
5855
5818
  return React.createElement(DialogContext.Provider, {
5856
5819
  value: context
5857
5820
  }, React.createElement(DialogPrimitive.Root, {
@@ -5868,19 +5831,18 @@ Dialog.Extra = Extra;
5868
5831
  Dialog.Drawer = Drawer;
5869
5832
  Dialog.Close = Close$2;
5870
5833
 
5871
- var _excluded$8 = ["disabled", "children", "invalid", "message"];
5872
- var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
5873
- var disabled = props.disabled,
5874
- children = props.children,
5875
- _props$invalid = props.invalid,
5876
- invalid = _props$invalid === void 0 ? false : _props$invalid,
5877
- message = props.message,
5878
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
5879
-
5880
- var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
5834
+ const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
5835
+ const {
5836
+ disabled,
5837
+ children,
5838
+ invalid = false,
5839
+ message,
5840
+ ...otherProps
5841
+ } = props;
5842
+ const className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
5881
5843
  'text-grey-dark': disabled
5882
5844
  }, props.className);
5883
- var messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
5845
+ const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
5884
5846
  'text-grey-darkest': !invalid,
5885
5847
  'text-red': invalid,
5886
5848
  'opacity-50': disabled
@@ -5895,13 +5857,12 @@ var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
5895
5857
  }, message));
5896
5858
  });
5897
5859
 
5898
- var _excluded$9 = ["horizontal"];
5899
- var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
5900
- var _props$horizontal = props.horizontal,
5901
- horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
5902
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
5903
-
5904
- var className = cn('yt-form', {
5860
+ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
5861
+ const {
5862
+ horizontal = false,
5863
+ ...otherProps
5864
+ } = props;
5865
+ const className = cn('yt-form', {
5905
5866
  'yt-form--horizontal flex flex-wrap': horizontal
5906
5867
  }, props.className);
5907
5868
  return React.createElement("form", Object.assign({}, otherProps, {
@@ -5911,13 +5872,12 @@ var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
5911
5872
  }));
5912
5873
  });
5913
5874
 
5914
- var _excluded$a = ["as"];
5915
- var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
5916
- var _props$as = props.as,
5917
- Tag = _props$as === void 0 ? 'span' : _props$as,
5918
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
5919
-
5920
- var className = cn('flex ', props.className);
5875
+ const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
5876
+ const {
5877
+ as: Tag = 'span',
5878
+ ...otherProps
5879
+ } = props;
5880
+ const className = cn('flex ', props.className);
5921
5881
  return React.createElement(Tag, Object.assign({}, otherProps, {
5922
5882
  className: className,
5923
5883
  "data-taco": "group",
@@ -5925,19 +5885,18 @@ var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
5925
5885
  }));
5926
5886
  });
5927
5887
 
5928
- var _excluded$b = ["anchor", "children", "defaultOpen"];
5929
- var HangerContext = /*#__PURE__*/React.createContext({
5888
+ const HangerContext = /*#__PURE__*/React.createContext({
5930
5889
  props: {},
5931
5890
  ref: null
5932
5891
  });
5933
- var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
5892
+ const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
5934
5893
  var _props$children;
5935
5894
 
5936
- var context = React.useContext(HangerContext);
5937
- var children = props.children;
5895
+ const context = React.useContext(HangerContext);
5896
+ let children = props.children;
5938
5897
 
5939
5898
  if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
5940
- console.warn("Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '" + props.children.type.name + "' in React.forwardRef()? Taco has wrapped '" + props.children.type.name + "' in a 'span' to maintain functionality, but this may cause unintended behaviour");
5899
+ console.warn(`Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`);
5941
5900
  children = React.createElement("span", null, props.children);
5942
5901
  }
5943
5902
 
@@ -5947,22 +5906,21 @@ var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
5947
5906
  asChild: true
5948
5907
  }));
5949
5908
  });
5950
- var Title$1 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
5951
- var className = cn('mb-1 text-base font-bold flex w-full', props.className);
5909
+ const Title$1 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
5910
+ const className = cn('mb-1 text-base font-bold flex w-full', props.className);
5952
5911
  return React.createElement("span", Object.assign({}, props, {
5953
5912
  className: className,
5954
5913
  ref: ref
5955
5914
  }));
5956
5915
  });
5957
- var Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
5958
- var context = React.useContext(HangerContext);
5959
-
5960
- var _useLocalization = useLocalization(),
5961
- texts = _useLocalization.texts;
5962
-
5963
- var className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent max-w-sm', props.className);
5916
+ const Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
5917
+ const context = React.useContext(HangerContext);
5918
+ const {
5919
+ texts
5920
+ } = useLocalization();
5921
+ const className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent max-w-sm', props.className);
5964
5922
 
5965
- var handleInteractOutside = function handleInteractOutside(event) {
5923
+ const handleInteractOutside = event => {
5966
5924
  event.preventDefault();
5967
5925
  };
5968
5926
 
@@ -5984,25 +5942,20 @@ var Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref)
5984
5942
  onClick: context.props.onClose
5985
5943
  })));
5986
5944
  });
5987
- var Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
5988
- var anchor = props.anchor,
5989
- children = props.children,
5990
- _props$defaultOpen = props.defaultOpen,
5991
- defaultOpen = _props$defaultOpen === void 0 ? true : _props$defaultOpen,
5992
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
5993
-
5994
- var context = React.useMemo(function () {
5995
- return {
5996
- props: otherProps,
5997
- ref: ref
5998
- };
5999
- }, [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
6000
-
6001
- var _React$useState = React.useState(false),
6002
- open = _React$useState[0],
6003
- setOpen = _React$useState[1];
5945
+ const Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
5946
+ const {
5947
+ anchor,
5948
+ children,
5949
+ defaultOpen = true,
5950
+ ...otherProps
5951
+ } = props;
5952
+ const context = React.useMemo(() => ({
5953
+ props: otherProps,
5954
+ ref
5955
+ }), [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
6004
5956
 
6005
- React.useEffect(function () {
5957
+ const [open, setOpen] = React.useState(false);
5958
+ React.useEffect(() => {
6006
5959
  if (defaultOpen) {
6007
5960
  setOpen(defaultOpen);
6008
5961
  }
@@ -6914,23 +6867,26 @@ const Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props,
6914
6867
  Treeview.Group = TreeviewGroup;
6915
6868
  Treeview.Item = TreeviewItem;
6916
6869
 
6917
- const useDropTarget = onDrop => {
6918
- const [isDraggedOver, setDraggedOver] = React__default.useState(false);
6919
- const handleDragEnter = React__default.useCallback(event => {
6870
+ var useDropTarget = function useDropTarget(onDrop) {
6871
+ var _React$useState = React__default.useState(false),
6872
+ isDraggedOver = _React$useState[0],
6873
+ setDraggedOver = _React$useState[1];
6874
+
6875
+ var handleDragEnter = React__default.useCallback(function (event) {
6920
6876
  event.preventDefault();
6921
6877
  setDraggedOver(true);
6922
6878
  }, []);
6923
- const handleDragLeave = React__default.useCallback(event => {
6879
+ var handleDragLeave = React__default.useCallback(function (event) {
6924
6880
  event.preventDefault();
6925
6881
 
6926
6882
  if (event.target === event.currentTarget) {
6927
6883
  setDraggedOver(false);
6928
6884
  }
6929
6885
  }, []);
6930
- const handleDragOver = React__default.useCallback(event => {
6886
+ var handleDragOver = React__default.useCallback(function (event) {
6931
6887
  event.preventDefault();
6932
6888
  }, []);
6933
- const handleDrop = React__default.useCallback(event => {
6889
+ var handleDrop = React__default.useCallback(function (event) {
6934
6890
  event.preventDefault();
6935
6891
  event.persist();
6936
6892
  setDraggedOver(false);
@@ -6939,7 +6895,7 @@ const useDropTarget = onDrop => {
6939
6895
  onDrop(event);
6940
6896
  }
6941
6897
  }, [onDrop]);
6942
- const props = onDrop ? {
6898
+ var props = onDrop ? {
6943
6899
  onDragEnter: handleDragEnter,
6944
6900
  onDragLeave: handleDragLeave,
6945
6901
  onDragOver: handleDragOver,
@@ -9458,12 +9414,12 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
9458
9414
  }, [ref, callback]);
9459
9415
  };
9460
9416
 
9461
- var _excluded$c = ["noPadding"];
9462
- var Content$6 = /*#__PURE__*/React.forwardRef(function CardContent(externalProps, ref) {
9463
- var noPadding = externalProps.noPadding,
9464
- props = _objectWithoutPropertiesLoose(externalProps, _excluded$c);
9465
-
9466
- var className = cn('flex-grow overflow-auto', {
9417
+ const Content$6 = /*#__PURE__*/React.forwardRef(function CardContent(externalProps, ref) {
9418
+ const {
9419
+ noPadding,
9420
+ ...props
9421
+ } = externalProps;
9422
+ const className = cn('flex-grow overflow-auto', {
9467
9423
  'mx-4 mb-4': !noPadding
9468
9424
  }, props.className);
9469
9425
  return React.createElement("div", Object.assign({}, props, {
@@ -9471,11 +9427,13 @@ var Content$6 = /*#__PURE__*/React.forwardRef(function CardContent(externalProps
9471
9427
  ref: ref
9472
9428
  }));
9473
9429
  });
9474
- var Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
9475
- var title = props.title,
9476
- menu = props.menu,
9477
- children = props.children;
9478
- var className = cn('bg-white flex flex-col rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]', props.className);
9430
+ const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
9431
+ const {
9432
+ title,
9433
+ menu,
9434
+ children
9435
+ } = props;
9436
+ const className = cn('bg-white flex flex-col rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]', props.className);
9479
9437
  return React.createElement("div", {
9480
9438
  className: className,
9481
9439
  "data-taco": "card",
@@ -9552,6 +9510,7 @@ exports.parseFromISOString = parseFromISOString;
9552
9510
  exports.removeChildTableRow = removeChildTableRow;
9553
9511
  exports.setByRowIndexPath = setByRowIndexPath;
9554
9512
  exports.useBoundingClientRectListener = useBoundingClientRectListener;
9513
+ exports.useDropTarget = useDropTarget;
9555
9514
  exports.useListKeyboardNavigation = useListKeyboardNavigation;
9556
9515
  exports.useListScrollTo = useListScrollTo;
9557
9516
  exports.useLocalization = useLocalization;