@economic/taco 1.1.11 → 1.1.12-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.
- package/dist/esm/components/Card/Card.js +3 -0
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +18 -15
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js +25 -23
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Datepicker/Datepicker.js +52 -48
- package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +58 -39
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/components/Field/Field.js +12 -10
- package/dist/esm/components/Field/Field.js.map +1 -1
- package/dist/esm/components/Form/Form.js +8 -6
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/Group/Group.js +8 -6
- package/dist/esm/components/Group/Group.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js +1 -1
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +1 -1
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +3 -0
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/hooks/useDropTarget.js +10 -7
- package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
- package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
- package/dist/esm/utils/mergeRefs.js +3 -3
- package/dist/esm/utils/mergeRefs.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/taco.cjs.development.js +266 -222
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/mergeRefs.d.ts +1 -1
- package/package.json +130 -131
- package/tailwind.config.js +9 -0
@@ -4058,37 +4058,37 @@ const Provider = props => {
|
|
4058
4058
|
const useTaco = () => React.useContext(Context);
|
4059
4059
|
const useLocalization = () => useTaco().localization;
|
4060
4060
|
|
4061
|
-
|
4062
|
-
className: "dot"
|
4063
|
-
}) : day.getDate();
|
4061
|
+
var _excluded$3 = ["onChange", "value"];
|
4064
4062
|
|
4065
|
-
|
4066
|
-
|
4063
|
+
var renderDay = function renderDay(day, modifiers) {
|
4064
|
+
return modifiers.disabled ? React.createElement("span", {
|
4065
|
+
className: "dot"
|
4066
|
+
}) : day.getDate();
|
4067
|
+
};
|
4068
|
+
|
4069
|
+
var thisYear = /*#__PURE__*/new Date().getFullYear();
|
4070
|
+
var years = [];
|
4067
4071
|
|
4068
|
-
for (
|
4072
|
+
for (var i = thisYear - 10; i <= thisYear + 10; i += 1) {
|
4069
4073
|
years.push(i);
|
4070
4074
|
}
|
4071
4075
|
|
4072
|
-
|
4073
|
-
onMonthChange,
|
4074
|
-
|
4075
|
-
|
4076
|
-
|
4077
|
-
|
4078
|
-
const {
|
4079
|
-
texts: {
|
4080
|
-
calendar: {
|
4081
|
-
actions,
|
4082
|
-
months
|
4083
|
-
}
|
4084
|
-
}
|
4085
|
-
} = useLocalization();
|
4076
|
+
var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
4077
|
+
var onMonthChange = _ref.onMonthChange,
|
4078
|
+
onNextClick = _ref.onNextClick,
|
4079
|
+
onPreviousClick = _ref.onPreviousClick,
|
4080
|
+
_ref$value = _ref.value,
|
4081
|
+
value = _ref$value === void 0 ? new Date() : _ref$value;
|
4086
4082
|
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4083
|
+
var _useLocalization = useLocalization(),
|
4084
|
+
_useLocalization$text = _useLocalization.texts.calendar,
|
4085
|
+
actions = _useLocalization$text.actions,
|
4086
|
+
months = _useLocalization$text.months;
|
4087
|
+
|
4088
|
+
var handleChange = function handleChange(event) {
|
4089
|
+
var _event$target$form = event.target.form,
|
4090
|
+
year = _event$target$form.year,
|
4091
|
+
month = _event$target$form.month;
|
4092
4092
|
onMonthChange(new Date(year.value, month.value));
|
4093
4093
|
};
|
4094
4094
|
|
@@ -4101,49 +4101,59 @@ const Navbar = /*#__PURE__*/React.memo(({
|
|
4101
4101
|
name: "month",
|
4102
4102
|
onChange: handleChange,
|
4103
4103
|
value: value.getMonth()
|
4104
|
-
}, months.map((month, i)
|
4105
|
-
|
4106
|
-
|
4107
|
-
|
4104
|
+
}, months.map(function (month, i) {
|
4105
|
+
return React.createElement("option", {
|
4106
|
+
key: month,
|
4107
|
+
value: i
|
4108
|
+
}, month);
|
4109
|
+
})), React.createElement("select", {
|
4108
4110
|
className: "h-8 px-2",
|
4109
4111
|
name: "year",
|
4110
4112
|
onChange: handleChange,
|
4111
4113
|
value: value.getFullYear()
|
4112
|
-
}, years.map(
|
4113
|
-
|
4114
|
-
|
4115
|
-
|
4114
|
+
}, years.map(function (year) {
|
4115
|
+
return React.createElement("option", {
|
4116
|
+
key: year,
|
4117
|
+
value: year
|
4118
|
+
}, String(year));
|
4119
|
+
}))), React.createElement("div", null, React.createElement(IconButton, {
|
4116
4120
|
appearance: "discrete",
|
4117
4121
|
icon: "chevron-left",
|
4118
4122
|
"aria-label": actions.previousMonth,
|
4119
|
-
onClick: ()
|
4123
|
+
onClick: function onClick() {
|
4124
|
+
return onPreviousClick();
|
4125
|
+
},
|
4120
4126
|
rounded: true
|
4121
4127
|
}), React.createElement(IconButton, {
|
4122
4128
|
appearance: "discrete",
|
4123
4129
|
icon: "chevron-right",
|
4124
4130
|
"aria-label": actions.nextMonth,
|
4125
|
-
onClick: ()
|
4131
|
+
onClick: function onClick() {
|
4132
|
+
return onNextClick();
|
4133
|
+
},
|
4126
4134
|
rounded: true
|
4127
4135
|
})));
|
4128
4136
|
});
|
4129
|
-
|
4130
|
-
|
4131
|
-
|
4132
|
-
|
4133
|
-
|
4134
|
-
|
4135
|
-
|
4136
|
-
|
4137
|
-
|
4138
|
-
|
4139
|
-
|
4140
|
-
|
4137
|
+
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4138
|
+
var handleChange = props.onChange,
|
4139
|
+
value = props.value,
|
4140
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
4141
|
+
|
4142
|
+
var _useLocalization2 = useLocalization(),
|
4143
|
+
locale = _useLocalization2.locale,
|
4144
|
+
texts = _useLocalization2.texts;
|
4145
|
+
|
4146
|
+
var _React$useState = React.useState(value !== null && value !== void 0 ? value : new Date()),
|
4147
|
+
visibleMonth = _React$useState[0],
|
4148
|
+
setVisibleMonth = _React$useState[1];
|
4149
|
+
|
4150
|
+
React.useEffect(function () {
|
4141
4151
|
if (visibleMonth !== value) {
|
4142
4152
|
setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
|
4143
4153
|
}
|
4144
4154
|
}, [value]);
|
4145
4155
|
|
4146
|
-
|
4156
|
+
var handleDayClick = function handleDayClick(date, modifiers, event) {
|
4147
4157
|
if (modifiers.outside || modifiers.disabled) {
|
4148
4158
|
return;
|
4149
4159
|
}
|
@@ -4151,8 +4161,8 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4151
4161
|
handleChange(date, event);
|
4152
4162
|
};
|
4153
4163
|
|
4154
|
-
|
4155
|
-
|
4164
|
+
var handleCalendarClickToday = function handleCalendarClickToday() {
|
4165
|
+
var today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
|
4156
4166
|
|
4157
4167
|
today.setHours(12);
|
4158
4168
|
today.setMinutes(0);
|
@@ -4160,7 +4170,7 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4160
4170
|
handleChange(today);
|
4161
4171
|
};
|
4162
4172
|
|
4163
|
-
|
4173
|
+
var className = cn('flex bg-white text-xs p-4', otherProps.className);
|
4164
4174
|
return React.createElement("div", {
|
4165
4175
|
"data-taco": "calendar"
|
4166
4176
|
}, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
|
@@ -4171,14 +4181,18 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4171
4181
|
firstDayOfWeek: 1,
|
4172
4182
|
months: texts.calendar.months,
|
4173
4183
|
weekdaysShort: texts.calendar.weekdaysShort,
|
4174
|
-
navbarElement:
|
4175
|
-
|
4176
|
-
|
4177
|
-
|
4184
|
+
navbarElement: function navbarElement(navProps) {
|
4185
|
+
return React.createElement(Navbar, Object.assign({}, navProps, {
|
4186
|
+
onMonthChange: setVisibleMonth,
|
4187
|
+
value: visibleMonth
|
4188
|
+
}));
|
4189
|
+
},
|
4178
4190
|
onDayClick: handleDayClick,
|
4179
4191
|
onMonthChange: setVisibleMonth,
|
4180
4192
|
onTodayButtonClick: handleCalendarClickToday,
|
4181
|
-
captionElement: ()
|
4193
|
+
captionElement: function captionElement() {
|
4194
|
+
return null;
|
4195
|
+
},
|
4182
4196
|
todayButton: texts.calendar.actions.today,
|
4183
4197
|
showOutsideDays: true,
|
4184
4198
|
renderDay: renderDay,
|
@@ -4187,30 +4201,32 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4187
4201
|
})));
|
4188
4202
|
});
|
4189
4203
|
|
4190
|
-
|
4191
|
-
|
4192
|
-
|
4193
|
-
|
4194
|
-
|
4195
|
-
|
4196
|
-
|
4197
|
-
|
4198
|
-
|
4199
|
-
|
4200
|
-
|
4204
|
+
var _excluded$4 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
|
4205
|
+
var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4206
|
+
var checked = props.checked,
|
4207
|
+
highlighted = props.highlighted,
|
4208
|
+
indeterminate = props.indeterminate,
|
4209
|
+
invalid = props.invalid,
|
4210
|
+
label = props.label,
|
4211
|
+
onChange = props.onChange,
|
4212
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
4213
|
+
|
4214
|
+
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)]
|
4201
4215
|
props.className, {
|
4202
4216
|
'border-grey-dark text-blue hover:text-blue-light focus:border-blue focus:hover:border-blue-light': !props.disabled && !invalid,
|
4203
4217
|
'border-grey text-blue-light cursor-not-allowed': props.disabled,
|
4204
4218
|
'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
|
4205
4219
|
'border-red text-red hover:text-red-light hover:border-red-light focus:border-red focus:hover:border-red-light': invalid && !props.disabled
|
4206
4220
|
});
|
4207
|
-
|
4221
|
+
var handleChange;
|
4208
4222
|
|
4209
4223
|
if (onChange) {
|
4210
|
-
handleChange =
|
4224
|
+
handleChange = function handleChange(checked) {
|
4225
|
+
return onChange(checked === 'indeterminate' ? false : checked);
|
4226
|
+
};
|
4211
4227
|
}
|
4212
4228
|
|
4213
|
-
|
4229
|
+
var element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
|
4214
4230
|
"data-taco": "checkbox",
|
4215
4231
|
checked: indeterminate ? 'indeterminate' : checked,
|
4216
4232
|
className: className,
|
@@ -4224,7 +4240,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4224
4240
|
})));
|
4225
4241
|
|
4226
4242
|
if (label) {
|
4227
|
-
|
4243
|
+
var labelClassName = cn('flex items-center cursor-pointer gap-2', {
|
4228
4244
|
'cursor-not-allowed text-grey-dark': props.disabled
|
4229
4245
|
}, props.className);
|
4230
4246
|
return React.createElement("label", {
|
@@ -4235,9 +4251,9 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4235
4251
|
return element;
|
4236
4252
|
});
|
4237
4253
|
|
4238
|
-
|
4239
|
-
|
4240
|
-
React.useEffect(()
|
4254
|
+
var useProxiedRef = function useProxiedRef(ref) {
|
4255
|
+
var internalRef = React.useRef(null);
|
4256
|
+
React.useEffect(function () {
|
4241
4257
|
if (ref) {
|
4242
4258
|
if (typeof ref === 'function') {
|
4243
4259
|
ref(internalRef.current);
|
@@ -5105,26 +5121,27 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5105
5121
|
return dimensions;
|
5106
5122
|
};
|
5107
5123
|
|
5108
|
-
|
5109
|
-
|
5110
|
-
|
5111
|
-
|
5112
|
-
|
5113
|
-
|
5114
|
-
|
5115
|
-
|
5116
|
-
|
5117
|
-
|
5118
|
-
|
5119
|
-
|
5120
|
-
|
5121
|
-
|
5122
|
-
|
5123
|
-
|
5124
|
-
|
5125
|
-
|
5126
|
-
|
5127
|
-
|
5124
|
+
var _excluded$5 = ["className", "dialog", "style"];
|
5125
|
+
var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5126
|
+
var externalClassName = props.className,
|
5127
|
+
dialog = props.dialog,
|
5128
|
+
style = props.style,
|
5129
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
|
5130
|
+
|
5131
|
+
var _useCombobox = useCombobox(otherProps, ref),
|
5132
|
+
combobox = _useCombobox.combobox,
|
5133
|
+
button = _useCombobox.button,
|
5134
|
+
input = _useCombobox.input,
|
5135
|
+
popover = _useCombobox.popover,
|
5136
|
+
list = _useCombobox.list;
|
5137
|
+
|
5138
|
+
var internalRef = React.useRef(null);
|
5139
|
+
|
5140
|
+
var _useLocalization = useLocalization(),
|
5141
|
+
texts = _useLocalization.texts;
|
5142
|
+
|
5143
|
+
var selectDimensions = useBoundingClientRectListener(internalRef);
|
5144
|
+
var className = cn('inline-flex relative', {
|
5128
5145
|
'yt-combobox--inline': props.inline
|
5129
5146
|
}, externalClassName);
|
5130
5147
|
return React.createElement("span", {
|
@@ -5143,7 +5160,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5143
5160
|
appearance: "discrete",
|
5144
5161
|
className: "!border-l-0 focus:!border-none focus:!shadow-none active:!border-none",
|
5145
5162
|
icon: popover.open ? 'chevron-up' : 'chevron-down',
|
5146
|
-
onClick: ()
|
5163
|
+
onClick: function onClick() {
|
5147
5164
|
var _input$ref$current;
|
5148
5165
|
|
5149
5166
|
popover.onOpenChange(true);
|
@@ -5155,7 +5172,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5155
5172
|
icon: "list-search",
|
5156
5173
|
disabled: props.readOnly || props.disabled,
|
5157
5174
|
dialog: dialog,
|
5158
|
-
onFocus: event
|
5175
|
+
onFocus: function onFocus(event) {
|
5159
5176
|
var _input$ref$current2;
|
5160
5177
|
|
5161
5178
|
// Prevents the default focus behaviour of showing the tooltip, on parent tooltip element
|
@@ -5168,7 +5185,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5168
5185
|
}) : undefined
|
5169
5186
|
})))), React.createElement(PopoverPrimitive.Content, {
|
5170
5187
|
align: "start",
|
5171
|
-
onOpenAutoFocus: event
|
5188
|
+
onOpenAutoFocus: function onOpenAutoFocus(event) {
|
5172
5189
|
event.preventDefault();
|
5173
5190
|
},
|
5174
5191
|
sideOffset: 4
|
@@ -5391,8 +5408,8 @@ const UnstyledContent = /*#__PURE__*/React.forwardRef(function PopoverContent(pr
|
|
5391
5408
|
});
|
5392
5409
|
|
5393
5410
|
function mergeRefs(refs) {
|
5394
|
-
return value
|
5395
|
-
refs.forEach(ref
|
5411
|
+
return function (value) {
|
5412
|
+
refs.forEach(function (ref) {
|
5396
5413
|
if (typeof ref === 'function') {
|
5397
5414
|
ref(value);
|
5398
5415
|
} else if (ref != null) {
|
@@ -5478,23 +5495,23 @@ Popover.Trigger = Trigger$1;
|
|
5478
5495
|
Popover.Content = Content$1;
|
5479
5496
|
Popover.Close = Close$1;
|
5480
5497
|
|
5481
|
-
|
5482
|
-
|
5483
|
-
|
5484
|
-
|
5485
|
-
|
5486
|
-
|
5487
|
-
|
5488
|
-
|
5489
|
-
|
5490
|
-
|
5491
|
-
|
5492
|
-
|
5493
|
-
|
5494
|
-
|
5495
|
-
|
5496
|
-
|
5497
|
-
|
5498
|
+
var _excluded$6 = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
5499
|
+
var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5500
|
+
var externalClassName = props.className,
|
5501
|
+
handleReset = props.onReset,
|
5502
|
+
style = props.style,
|
5503
|
+
shortcuts = props.shortcuts,
|
5504
|
+
shortcutsText = props.shortcutsText,
|
5505
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
|
5506
|
+
|
5507
|
+
var _useDatepicker = useDatepicker(otherProps, ref),
|
5508
|
+
calendar = _useDatepicker.calendar,
|
5509
|
+
input = _useDatepicker.input;
|
5510
|
+
|
5511
|
+
var _useLocalization = useLocalization(),
|
5512
|
+
texts = _useLocalization.texts;
|
5513
|
+
|
5514
|
+
var className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5498
5515
|
return React.createElement("span", {
|
5499
5516
|
className: className,
|
5500
5517
|
"data-taco": "datepicker",
|
@@ -5504,37 +5521,40 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
5504
5521
|
"aria-label": texts.datepicker.expand,
|
5505
5522
|
disabled: input.disabled || input.readOnly,
|
5506
5523
|
icon: "calendar"
|
5507
|
-
})), React.createElement(Popover.Content, null, ({
|
5508
|
-
close
|
5509
|
-
|
5510
|
-
|
5511
|
-
|
5512
|
-
|
5513
|
-
|
5514
|
-
|
5515
|
-
|
5516
|
-
|
5517
|
-
|
5518
|
-
|
5519
|
-
|
5520
|
-
|
5521
|
-
|
5522
|
-
|
5523
|
-
|
5524
|
-
|
5525
|
-
|
5526
|
-
|
5527
|
-
|
5528
|
-
|
5529
|
-
|
5530
|
-
|
5531
|
-
|
5532
|
-
|
5533
|
-
|
5534
|
-
|
5535
|
-
|
5536
|
-
|
5537
|
-
|
5524
|
+
})), React.createElement(Popover.Content, null, function (_ref) {
|
5525
|
+
var close = _ref.close;
|
5526
|
+
return React.createElement("div", {
|
5527
|
+
className: "-m-3 flex"
|
5528
|
+
}, React.createElement(Calendar$1, Object.assign({}, calendar, {
|
5529
|
+
onChange: function onChange(date, event) {
|
5530
|
+
calendar.onChange(date, event);
|
5531
|
+
close();
|
5532
|
+
},
|
5533
|
+
tabIndex: -1
|
5534
|
+
})), shortcuts && React.createElement("div", {
|
5535
|
+
className: "border-grey-dark flex flex-col border-l"
|
5536
|
+
}, React.createElement("span", {
|
5537
|
+
className: "m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold"
|
5538
|
+
}, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map(function (shortcut, i) {
|
5539
|
+
return React.createElement("li", {
|
5540
|
+
key: i
|
5541
|
+
}, React.createElement("button", {
|
5542
|
+
className: "hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs",
|
5543
|
+
onClick: function onClick(event) {
|
5544
|
+
event.persist();
|
5545
|
+
shortcut.onClick(event);
|
5546
|
+
close();
|
5547
|
+
}
|
5548
|
+
}, shortcut.text));
|
5549
|
+
})), handleReset && React.createElement("button", {
|
5550
|
+
className: "text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs",
|
5551
|
+
onClick: function onClick(event) {
|
5552
|
+
event.persist();
|
5553
|
+
handleReset(event);
|
5554
|
+
close();
|
5555
|
+
}
|
5556
|
+
}, texts.datepicker.clear)));
|
5557
|
+
}))
|
5538
5558
|
})));
|
5539
5559
|
});
|
5540
5560
|
|
@@ -5777,12 +5797,14 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5777
5797
|
});
|
5778
5798
|
Extra.displayName = 'DialogExtra';
|
5779
5799
|
|
5780
|
-
|
5781
|
-
|
5782
|
-
|
5783
|
-
|
5784
|
-
|
5785
|
-
|
5800
|
+
var _excluded$7 = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
|
5801
|
+
|
5802
|
+
var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
5803
|
+
return React.useMemo(function () {
|
5804
|
+
var children = [];
|
5805
|
+
var drawer;
|
5806
|
+
var extra;
|
5807
|
+
React.Children.toArray(initialChildren).forEach(function (child) {
|
5786
5808
|
var _child$type, _child$type2;
|
5787
5809
|
|
5788
5810
|
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
|
@@ -5797,39 +5819,55 @@ const useSeparatedChildren = initialChildren => {
|
|
5797
5819
|
}, [initialChildren]);
|
5798
5820
|
};
|
5799
5821
|
|
5800
|
-
|
5801
|
-
|
5802
|
-
|
5803
|
-
|
5804
|
-
|
5805
|
-
|
5806
|
-
|
5807
|
-
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
-
|
5813
|
-
|
5814
|
-
|
5815
|
-
|
5816
|
-
|
5817
|
-
|
5818
|
-
|
5819
|
-
|
5820
|
-
|
5821
|
-
|
5822
|
-
|
5823
|
-
|
5824
|
-
|
5825
|
-
|
5826
|
-
|
5827
|
-
|
5828
|
-
|
5829
|
-
|
5830
|
-
|
5831
|
-
|
5832
|
-
|
5822
|
+
var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
5823
|
+
var initialChildren = props.children,
|
5824
|
+
_props$closeOnEscape = props.closeOnEscape,
|
5825
|
+
closeOnEscape = _props$closeOnEscape === void 0 ? true : _props$closeOnEscape,
|
5826
|
+
defaultOpen = props.defaultOpen,
|
5827
|
+
_props$draggable = props.draggable,
|
5828
|
+
draggable = _props$draggable === void 0 ? false : _props$draggable,
|
5829
|
+
onChange = props.onChange,
|
5830
|
+
onClose = props.onClose,
|
5831
|
+
open = props.open,
|
5832
|
+
_props$showCloseButto = props.showCloseButton,
|
5833
|
+
showCloseButton = _props$showCloseButto === void 0 ? true : _props$showCloseButto,
|
5834
|
+
_props$size = props.size,
|
5835
|
+
size = _props$size === void 0 ? 'sm' : _props$size,
|
5836
|
+
trigger = props.trigger,
|
5837
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$7);
|
5838
|
+
|
5839
|
+
var _useSeparatedChildren = useSeparatedChildren(initialChildren),
|
5840
|
+
children = _useSeparatedChildren[0],
|
5841
|
+
drawer = _useSeparatedChildren[1],
|
5842
|
+
extra = _useSeparatedChildren[2];
|
5843
|
+
|
5844
|
+
var _React$useState = React.useState(false),
|
5845
|
+
drawerOpen = _React$useState[0],
|
5846
|
+
setDrawerOpen = _React$useState[1];
|
5847
|
+
|
5848
|
+
var context = React.useMemo(function () {
|
5849
|
+
return {
|
5850
|
+
closeOnEscape: closeOnEscape,
|
5851
|
+
draggable: draggable,
|
5852
|
+
drawer: {
|
5853
|
+
open: drawerOpen,
|
5854
|
+
toggle: function toggle() {
|
5855
|
+
return setDrawerOpen(function (isDrawerOpen) {
|
5856
|
+
return !isDrawerOpen;
|
5857
|
+
});
|
5858
|
+
}
|
5859
|
+
},
|
5860
|
+
elements: {
|
5861
|
+
drawer: drawer,
|
5862
|
+
extra: extra
|
5863
|
+
},
|
5864
|
+
onClose: onClose,
|
5865
|
+
props: otherProps,
|
5866
|
+
showCloseButton: showCloseButton,
|
5867
|
+
size: size,
|
5868
|
+
ref: ref
|
5869
|
+
};
|
5870
|
+
}, [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
|
5833
5871
|
return React.createElement(DialogContext.Provider, {
|
5834
5872
|
value: context
|
5835
5873
|
}, React.createElement(DialogPrimitive.Root, {
|
@@ -5846,18 +5884,19 @@ Dialog.Extra = Extra;
|
|
5846
5884
|
Dialog.Drawer = Drawer;
|
5847
5885
|
Dialog.Close = Close$2;
|
5848
5886
|
|
5849
|
-
|
5850
|
-
|
5851
|
-
|
5852
|
-
|
5853
|
-
|
5854
|
-
|
5855
|
-
|
5856
|
-
|
5857
|
-
|
5887
|
+
var _excluded$8 = ["disabled", "children", "invalid", "message"];
|
5888
|
+
var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5889
|
+
var disabled = props.disabled,
|
5890
|
+
children = props.children,
|
5891
|
+
_props$invalid = props.invalid,
|
5892
|
+
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
5893
|
+
message = props.message,
|
5894
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
|
5895
|
+
|
5896
|
+
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5858
5897
|
'text-grey-dark': disabled
|
5859
5898
|
}, props.className);
|
5860
|
-
|
5899
|
+
var messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
|
5861
5900
|
'text-grey-darkest': !invalid,
|
5862
5901
|
'text-red': invalid,
|
5863
5902
|
'opacity-50': disabled
|
@@ -5887,12 +5926,13 @@ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5887
5926
|
}));
|
5888
5927
|
});
|
5889
5928
|
|
5890
|
-
|
5891
|
-
|
5892
|
-
|
5893
|
-
|
5894
|
-
|
5895
|
-
|
5929
|
+
var _excluded$9 = ["as"];
|
5930
|
+
var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5931
|
+
var _props$as = props.as,
|
5932
|
+
Tag = _props$as === void 0 ? 'span' : _props$as,
|
5933
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
|
5934
|
+
|
5935
|
+
var className = cn('flex ', props.className);
|
5896
5936
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
5897
5937
|
className: className,
|
5898
5938
|
"data-taco": "group",
|
@@ -6882,23 +6922,26 @@ const Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props,
|
|
6882
6922
|
Treeview.Group = TreeviewGroup;
|
6883
6923
|
Treeview.Item = TreeviewItem;
|
6884
6924
|
|
6885
|
-
|
6886
|
-
|
6887
|
-
|
6925
|
+
var useDropTarget = function useDropTarget(onDrop) {
|
6926
|
+
var _React$useState = React__default.useState(false),
|
6927
|
+
isDraggedOver = _React$useState[0],
|
6928
|
+
setDraggedOver = _React$useState[1];
|
6929
|
+
|
6930
|
+
var handleDragEnter = React__default.useCallback(function (event) {
|
6888
6931
|
event.preventDefault();
|
6889
6932
|
setDraggedOver(true);
|
6890
6933
|
}, []);
|
6891
|
-
|
6934
|
+
var handleDragLeave = React__default.useCallback(function (event) {
|
6892
6935
|
event.preventDefault();
|
6893
6936
|
|
6894
6937
|
if (event.target === event.currentTarget) {
|
6895
6938
|
setDraggedOver(false);
|
6896
6939
|
}
|
6897
6940
|
}, []);
|
6898
|
-
|
6941
|
+
var handleDragOver = React__default.useCallback(function (event) {
|
6899
6942
|
event.preventDefault();
|
6900
6943
|
}, []);
|
6901
|
-
|
6944
|
+
var handleDrop = React__default.useCallback(function (event) {
|
6902
6945
|
event.preventDefault();
|
6903
6946
|
event.persist();
|
6904
6947
|
setDraggedOver(false);
|
@@ -6907,7 +6950,7 @@ const useDropTarget = onDrop => {
|
|
6907
6950
|
onDrop(event);
|
6908
6951
|
}
|
6909
6952
|
}, [onDrop]);
|
6910
|
-
|
6953
|
+
var props = onDrop ? {
|
6911
6954
|
onDragEnter: handleDragEnter,
|
6912
6955
|
onDragLeave: handleDragLeave,
|
6913
6956
|
onDragOver: handleDragOver,
|
@@ -9426,12 +9469,12 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9426
9469
|
}, [ref, callback]);
|
9427
9470
|
};
|
9428
9471
|
|
9429
|
-
|
9430
|
-
|
9431
|
-
|
9432
|
-
|
9433
|
-
|
9434
|
-
|
9472
|
+
var _excluded$a = ["noPadding"];
|
9473
|
+
var Content$6 = /*#__PURE__*/React.forwardRef(function CardContent(externalProps, ref) {
|
9474
|
+
var noPadding = externalProps.noPadding,
|
9475
|
+
props = _objectWithoutPropertiesLoose(externalProps, _excluded$a);
|
9476
|
+
|
9477
|
+
var className = cn('flex-grow overflow-auto', {
|
9435
9478
|
'mx-4 mb-4': !noPadding
|
9436
9479
|
}, props.className);
|
9437
9480
|
return React.createElement("div", Object.assign({}, props, {
|
@@ -9439,13 +9482,11 @@ const Content$6 = /*#__PURE__*/React.forwardRef(function CardContent(externalPro
|
|
9439
9482
|
ref: ref
|
9440
9483
|
}));
|
9441
9484
|
});
|
9442
|
-
|
9443
|
-
|
9444
|
-
|
9445
|
-
|
9446
|
-
|
9447
|
-
} = props;
|
9448
|
-
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);
|
9485
|
+
var Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
|
9486
|
+
var title = props.title,
|
9487
|
+
menu = props.menu,
|
9488
|
+
children = props.children;
|
9489
|
+
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);
|
9449
9490
|
return React.createElement("div", {
|
9450
9491
|
className: className,
|
9451
9492
|
"data-taco": "card",
|
@@ -9517,16 +9558,19 @@ exports.getParentRowIndexPath = getParentRowIndexPath;
|
|
9517
9558
|
exports.getRadioGroupItemValueAsString = getRadioGroupItemValueAsString;
|
9518
9559
|
exports.icons = icons;
|
9519
9560
|
exports.insertChildTableRow = insertChildTableRow;
|
9561
|
+
exports.mergeRefs = mergeRefs;
|
9520
9562
|
exports.parseFromCustomString = parseFromCustomString;
|
9521
9563
|
exports.parseFromISOString = parseFromISOString;
|
9522
9564
|
exports.removeChildTableRow = removeChildTableRow;
|
9523
9565
|
exports.setByRowIndexPath = setByRowIndexPath;
|
9524
9566
|
exports.useBoundingClientRectListener = useBoundingClientRectListener;
|
9567
|
+
exports.useDropTarget = useDropTarget;
|
9525
9568
|
exports.useListKeyboardNavigation = useListKeyboardNavigation;
|
9526
9569
|
exports.useListScrollTo = useListScrollTo;
|
9527
9570
|
exports.useLocalization = useLocalization;
|
9528
9571
|
exports.useOnClickOutside = useOnClickOutside;
|
9529
9572
|
exports.usePagination = usePagination;
|
9573
|
+
exports.useProxiedRef = useProxiedRef;
|
9530
9574
|
exports.useRadioGroup = useRadioGroup;
|
9531
9575
|
exports.useTableRowCreation = useTableRowCreation;
|
9532
9576
|
exports.useTaco = useTaco;
|