@economic/taco 1.1.9-alpha.0 → 1.1.9-alpha.1
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/components/Tour/Tour.d.ts +2 -0
- package/dist/esm/components/Badge/Badge.js +14 -14
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js +71 -56
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Card/Card.js +12 -13
- 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/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 +35 -27
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +2 -0
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/taco.cjs.development.js +306 -259
- 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/tailwind.d.ts +1 -1
- package/package.json +2 -2
- package/tailwind.config.js +1 -1
- package/types.json +7 -1
@@ -3349,20 +3349,19 @@ const getOutlineClasses = state => {
|
|
3349
3349
|
}
|
3350
3350
|
};
|
3351
3351
|
|
3352
|
-
|
3353
|
-
|
3354
|
-
|
3355
|
-
|
3356
|
-
|
3357
|
-
|
3358
|
-
|
3359
|
-
|
3360
|
-
|
3361
|
-
|
3362
|
-
|
3363
|
-
|
3364
|
-
|
3365
|
-
}, props.className);
|
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);
|
3366
3365
|
return React.createElement("span", Object.assign({}, otherProps, {
|
3367
3366
|
"aria-atomic": "true",
|
3368
3367
|
"aria-live": "polite",
|
@@ -3563,10 +3562,10 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3563
3562
|
}) : null);
|
3564
3563
|
});
|
3565
3564
|
|
3566
|
-
var _excluded$
|
3565
|
+
var _excluded$2 = ["fluid"];
|
3567
3566
|
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3568
3567
|
var fluid = props.fluid,
|
3569
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3568
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
|
3570
3569
|
|
3571
3570
|
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3572
3571
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -4044,37 +4043,37 @@ const Provider = props => {
|
|
4044
4043
|
const useTaco = () => React.useContext(Context);
|
4045
4044
|
const useLocalization = () => useTaco().localization;
|
4046
4045
|
|
4047
|
-
|
4048
|
-
|
4049
|
-
|
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
|
+
};
|
4050
4053
|
|
4051
|
-
|
4052
|
-
|
4054
|
+
var thisYear = /*#__PURE__*/new Date().getFullYear();
|
4055
|
+
var years = [];
|
4053
4056
|
|
4054
|
-
for (
|
4057
|
+
for (var i = thisYear - 10; i <= thisYear + 10; i += 1) {
|
4055
4058
|
years.push(i);
|
4056
4059
|
}
|
4057
4060
|
|
4058
|
-
|
4059
|
-
onMonthChange,
|
4060
|
-
|
4061
|
-
|
4062
|
-
|
4063
|
-
|
4064
|
-
const {
|
4065
|
-
texts: {
|
4066
|
-
calendar: {
|
4067
|
-
actions,
|
4068
|
-
months
|
4069
|
-
}
|
4070
|
-
}
|
4071
|
-
} = useLocalization();
|
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;
|
4072
4067
|
|
4073
|
-
|
4074
|
-
|
4075
|
-
|
4076
|
-
|
4077
|
-
|
4068
|
+
var _useLocalization = useLocalization(),
|
4069
|
+
_useLocalization$text = _useLocalization.texts.calendar,
|
4070
|
+
actions = _useLocalization$text.actions,
|
4071
|
+
months = _useLocalization$text.months;
|
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;
|
4078
4077
|
onMonthChange(new Date(year.value, month.value));
|
4079
4078
|
};
|
4080
4079
|
|
@@ -4087,49 +4086,59 @@ const Navbar = /*#__PURE__*/React.memo(({
|
|
4087
4086
|
name: "month",
|
4088
4087
|
onChange: handleChange,
|
4089
4088
|
value: value.getMonth()
|
4090
|
-
}, months.map((month, i)
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4089
|
+
}, months.map(function (month, i) {
|
4090
|
+
return React.createElement("option", {
|
4091
|
+
key: month,
|
4092
|
+
value: i
|
4093
|
+
}, month);
|
4094
|
+
})), React.createElement("select", {
|
4094
4095
|
className: "h-8 px-2",
|
4095
4096
|
name: "year",
|
4096
4097
|
onChange: handleChange,
|
4097
4098
|
value: value.getFullYear()
|
4098
|
-
}, years.map(
|
4099
|
-
|
4100
|
-
|
4101
|
-
|
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, {
|
4102
4105
|
appearance: "discrete",
|
4103
4106
|
icon: "chevron-left",
|
4104
4107
|
"aria-label": actions.previousMonth,
|
4105
|
-
onClick: ()
|
4108
|
+
onClick: function onClick() {
|
4109
|
+
return onPreviousClick();
|
4110
|
+
},
|
4106
4111
|
rounded: true
|
4107
4112
|
}), React.createElement(IconButton, {
|
4108
4113
|
appearance: "discrete",
|
4109
4114
|
icon: "chevron-right",
|
4110
4115
|
"aria-label": actions.nextMonth,
|
4111
|
-
onClick: ()
|
4116
|
+
onClick: function onClick() {
|
4117
|
+
return onNextClick();
|
4118
|
+
},
|
4112
4119
|
rounded: true
|
4113
4120
|
})));
|
4114
4121
|
});
|
4115
|
-
|
4116
|
-
|
4117
|
-
|
4118
|
-
|
4119
|
-
|
4120
|
-
|
4121
|
-
|
4122
|
-
|
4123
|
-
|
4124
|
-
|
4125
|
-
|
4126
|
-
|
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 () {
|
4127
4136
|
if (visibleMonth !== value) {
|
4128
4137
|
setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
|
4129
4138
|
}
|
4130
4139
|
}, [value]);
|
4131
4140
|
|
4132
|
-
|
4141
|
+
var handleDayClick = function handleDayClick(date, modifiers, event) {
|
4133
4142
|
if (modifiers.outside || modifiers.disabled) {
|
4134
4143
|
return;
|
4135
4144
|
}
|
@@ -4137,8 +4146,8 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4137
4146
|
handleChange(date, event);
|
4138
4147
|
};
|
4139
4148
|
|
4140
|
-
|
4141
|
-
|
4149
|
+
var handleCalendarClickToday = function handleCalendarClickToday() {
|
4150
|
+
var today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
|
4142
4151
|
|
4143
4152
|
today.setHours(12);
|
4144
4153
|
today.setMinutes(0);
|
@@ -4146,7 +4155,7 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4146
4155
|
handleChange(today);
|
4147
4156
|
};
|
4148
4157
|
|
4149
|
-
|
4158
|
+
var className = cn('flex bg-white text-xs p-4', otherProps.className);
|
4150
4159
|
return React.createElement("div", {
|
4151
4160
|
"data-taco": "calendar"
|
4152
4161
|
}, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
|
@@ -4157,14 +4166,18 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4157
4166
|
firstDayOfWeek: 1,
|
4158
4167
|
months: texts.calendar.months,
|
4159
4168
|
weekdaysShort: texts.calendar.weekdaysShort,
|
4160
|
-
navbarElement:
|
4161
|
-
|
4162
|
-
|
4163
|
-
|
4169
|
+
navbarElement: function navbarElement(navProps) {
|
4170
|
+
return React.createElement(Navbar, Object.assign({}, navProps, {
|
4171
|
+
onMonthChange: setVisibleMonth,
|
4172
|
+
value: visibleMonth
|
4173
|
+
}));
|
4174
|
+
},
|
4164
4175
|
onDayClick: handleDayClick,
|
4165
4176
|
onMonthChange: setVisibleMonth,
|
4166
4177
|
onTodayButtonClick: handleCalendarClickToday,
|
4167
|
-
captionElement: ()
|
4178
|
+
captionElement: function captionElement() {
|
4179
|
+
return null;
|
4180
|
+
},
|
4168
4181
|
todayButton: texts.calendar.actions.today,
|
4169
4182
|
showOutsideDays: true,
|
4170
4183
|
renderDay: renderDay,
|
@@ -4173,30 +4186,32 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4173
4186
|
})));
|
4174
4187
|
});
|
4175
4188
|
|
4176
|
-
|
4177
|
-
|
4178
|
-
|
4179
|
-
|
4180
|
-
|
4181
|
-
|
4182
|
-
|
4183
|
-
|
4184
|
-
|
4185
|
-
|
4186
|
-
|
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)]
|
4187
4200
|
props.className, {
|
4188
4201
|
'border-grey-dark text-blue hover:text-blue-light focus:border-blue focus:hover:border-blue-light': !props.disabled && !invalid,
|
4189
4202
|
'border-grey text-blue-light cursor-not-allowed': props.disabled,
|
4190
4203
|
'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
|
4191
4204
|
'border-red text-red hover:text-red-light hover:border-red-light focus:border-red focus:hover:border-red-light': invalid && !props.disabled
|
4192
4205
|
});
|
4193
|
-
|
4206
|
+
var handleChange;
|
4194
4207
|
|
4195
4208
|
if (onChange) {
|
4196
|
-
handleChange =
|
4209
|
+
handleChange = function handleChange(checked) {
|
4210
|
+
return onChange(checked === 'indeterminate' ? false : checked);
|
4211
|
+
};
|
4197
4212
|
}
|
4198
4213
|
|
4199
|
-
|
4214
|
+
var element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
|
4200
4215
|
"data-taco": "checkbox",
|
4201
4216
|
checked: indeterminate ? 'indeterminate' : checked,
|
4202
4217
|
className: className,
|
@@ -4210,7 +4225,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4210
4225
|
})));
|
4211
4226
|
|
4212
4227
|
if (label) {
|
4213
|
-
|
4228
|
+
var labelClassName = cn('flex items-center cursor-pointer gap-2', {
|
4214
4229
|
'cursor-not-allowed text-grey-dark': props.disabled
|
4215
4230
|
}, props.className);
|
4216
4231
|
return React.createElement("label", {
|
@@ -5091,26 +5106,27 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5091
5106
|
return dimensions;
|
5092
5107
|
};
|
5093
5108
|
|
5094
|
-
|
5095
|
-
|
5096
|
-
|
5097
|
-
|
5098
|
-
|
5099
|
-
|
5100
|
-
|
5101
|
-
|
5102
|
-
|
5103
|
-
|
5104
|
-
|
5105
|
-
|
5106
|
-
|
5107
|
-
|
5108
|
-
|
5109
|
-
|
5110
|
-
|
5111
|
-
|
5112
|
-
|
5113
|
-
|
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', {
|
5114
5130
|
'yt-combobox--inline': props.inline
|
5115
5131
|
}, externalClassName);
|
5116
5132
|
return React.createElement("span", {
|
@@ -5129,7 +5145,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5129
5145
|
appearance: "discrete",
|
5130
5146
|
className: "!border-l-0 focus:!border-none focus:!shadow-none active:!border-none",
|
5131
5147
|
icon: popover.open ? 'chevron-up' : 'chevron-down',
|
5132
|
-
onClick: ()
|
5148
|
+
onClick: function onClick() {
|
5133
5149
|
var _input$ref$current;
|
5134
5150
|
|
5135
5151
|
popover.onOpenChange(true);
|
@@ -5140,7 +5156,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5140
5156
|
icon: "list-search",
|
5141
5157
|
disabled: props.readOnly || props.disabled,
|
5142
5158
|
dialog: dialog,
|
5143
|
-
onFocus: event
|
5159
|
+
onFocus: function onFocus(event) {
|
5144
5160
|
var _input$ref$current2;
|
5145
5161
|
|
5146
5162
|
// Prevents the default focus behaviour of showing the tooltip, on parent tooltip element
|
@@ -5153,7 +5169,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5153
5169
|
}) : undefined
|
5154
5170
|
})))), React.createElement(PopoverPrimitive.Content, {
|
5155
5171
|
align: "start",
|
5156
|
-
onOpenAutoFocus: event
|
5172
|
+
onOpenAutoFocus: function onOpenAutoFocus(event) {
|
5157
5173
|
event.preventDefault();
|
5158
5174
|
},
|
5159
5175
|
sideOffset: 4
|
@@ -5463,23 +5479,23 @@ Popover.Trigger = Trigger$1;
|
|
5463
5479
|
Popover.Content = Content$1;
|
5464
5480
|
Popover.Close = Close$1;
|
5465
5481
|
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5470
|
-
|
5471
|
-
|
5472
|
-
|
5473
|
-
|
5474
|
-
|
5475
|
-
|
5476
|
-
|
5477
|
-
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
-
|
5482
|
-
|
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);
|
5483
5499
|
return React.createElement("span", {
|
5484
5500
|
className: className,
|
5485
5501
|
"data-taco": "datepicker",
|
@@ -5489,37 +5505,40 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
5489
5505
|
"aria-label": texts.datepicker.expand,
|
5490
5506
|
disabled: input.disabled || input.readOnly,
|
5491
5507
|
icon: "calendar"
|
5492
|
-
})), React.createElement(Popover.Content, null, ({
|
5493
|
-
close
|
5494
|
-
|
5495
|
-
|
5496
|
-
|
5497
|
-
|
5498
|
-
|
5499
|
-
|
5500
|
-
|
5501
|
-
|
5502
|
-
|
5503
|
-
|
5504
|
-
|
5505
|
-
|
5506
|
-
|
5507
|
-
|
5508
|
-
|
5509
|
-
|
5510
|
-
|
5511
|
-
|
5512
|
-
|
5513
|
-
|
5514
|
-
|
5515
|
-
|
5516
|
-
|
5517
|
-
|
5518
|
-
|
5519
|
-
|
5520
|
-
|
5521
|
-
|
5522
|
-
|
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
|
+
}))
|
5523
5542
|
})));
|
5524
5543
|
});
|
5525
5544
|
|
@@ -5762,12 +5781,14 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5762
5781
|
});
|
5763
5782
|
Extra.displayName = 'DialogExtra';
|
5764
5783
|
|
5765
|
-
|
5766
|
-
|
5767
|
-
|
5768
|
-
|
5769
|
-
|
5770
|
-
|
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) {
|
5771
5792
|
var _child$type, _child$type2;
|
5772
5793
|
|
5773
5794
|
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
|
@@ -5782,39 +5803,55 @@ const useSeparatedChildren = initialChildren => {
|
|
5782
5803
|
}, [initialChildren]);
|
5783
5804
|
};
|
5784
5805
|
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5788
|
-
|
5789
|
-
|
5790
|
-
|
5791
|
-
|
5792
|
-
|
5793
|
-
|
5794
|
-
|
5795
|
-
|
5796
|
-
|
5797
|
-
|
5798
|
-
|
5799
|
-
|
5800
|
-
|
5801
|
-
|
5802
|
-
|
5803
|
-
|
5804
|
-
|
5805
|
-
|
5806
|
-
|
5807
|
-
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
-
|
5813
|
-
|
5814
|
-
|
5815
|
-
|
5816
|
-
|
5817
|
-
|
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]);
|
5818
5855
|
return React.createElement(DialogContext.Provider, {
|
5819
5856
|
value: context
|
5820
5857
|
}, React.createElement(DialogPrimitive.Root, {
|
@@ -5831,18 +5868,19 @@ Dialog.Extra = Extra;
|
|
5831
5868
|
Dialog.Drawer = Drawer;
|
5832
5869
|
Dialog.Close = Close$2;
|
5833
5870
|
|
5834
|
-
|
5835
|
-
|
5836
|
-
|
5837
|
-
|
5838
|
-
|
5839
|
-
|
5840
|
-
|
5841
|
-
|
5842
|
-
|
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)]', {
|
5843
5881
|
'text-grey-dark': disabled
|
5844
5882
|
}, props.className);
|
5845
|
-
|
5883
|
+
var messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
|
5846
5884
|
'text-grey-darkest': !invalid,
|
5847
5885
|
'text-red': invalid,
|
5848
5886
|
'opacity-50': disabled
|
@@ -5857,12 +5895,13 @@ const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5857
5895
|
}, message));
|
5858
5896
|
});
|
5859
5897
|
|
5860
|
-
|
5861
|
-
|
5862
|
-
|
5863
|
-
|
5864
|
-
|
5865
|
-
|
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', {
|
5866
5905
|
'yt-form--horizontal flex flex-wrap': horizontal
|
5867
5906
|
}, props.className);
|
5868
5907
|
return React.createElement("form", Object.assign({}, otherProps, {
|
@@ -5872,12 +5911,13 @@ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5872
5911
|
}));
|
5873
5912
|
});
|
5874
5913
|
|
5875
|
-
|
5876
|
-
|
5877
|
-
|
5878
|
-
|
5879
|
-
|
5880
|
-
|
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);
|
5881
5921
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
5882
5922
|
className: className,
|
5883
5923
|
"data-taco": "group",
|
@@ -5885,18 +5925,19 @@ const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5885
5925
|
}));
|
5886
5926
|
});
|
5887
5927
|
|
5888
|
-
|
5928
|
+
var _excluded$b = ["anchor", "children", "defaultOpen"];
|
5929
|
+
var HangerContext = /*#__PURE__*/React.createContext({
|
5889
5930
|
props: {},
|
5890
5931
|
ref: null
|
5891
5932
|
});
|
5892
|
-
|
5933
|
+
var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
5893
5934
|
var _props$children;
|
5894
5935
|
|
5895
|
-
|
5896
|
-
|
5936
|
+
var context = React.useContext(HangerContext);
|
5937
|
+
var children = props.children;
|
5897
5938
|
|
5898
5939
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5899
|
-
console.warn(
|
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");
|
5900
5941
|
children = React.createElement("span", null, props.children);
|
5901
5942
|
}
|
5902
5943
|
|
@@ -5906,21 +5947,22 @@ const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
|
5906
5947
|
asChild: true
|
5907
5948
|
}));
|
5908
5949
|
});
|
5909
|
-
|
5910
|
-
|
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);
|
5911
5952
|
return React.createElement("span", Object.assign({}, props, {
|
5912
5953
|
className: className,
|
5913
5954
|
ref: ref
|
5914
5955
|
}));
|
5915
5956
|
});
|
5916
|
-
|
5917
|
-
|
5918
|
-
|
5919
|
-
|
5920
|
-
|
5921
|
-
|
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);
|
5922
5964
|
|
5923
|
-
|
5965
|
+
var handleInteractOutside = function handleInteractOutside(event) {
|
5924
5966
|
event.preventDefault();
|
5925
5967
|
};
|
5926
5968
|
|
@@ -5942,20 +5984,25 @@ const Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, re
|
|
5942
5984
|
onClick: context.props.onClose
|
5943
5985
|
})));
|
5944
5986
|
});
|
5945
|
-
|
5946
|
-
|
5947
|
-
|
5948
|
-
|
5949
|
-
|
5950
|
-
|
5951
|
-
|
5952
|
-
|
5953
|
-
|
5954
|
-
|
5955
|
-
|
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
|
5956
6000
|
|
5957
|
-
|
5958
|
-
|
6001
|
+
var _React$useState = React.useState(false),
|
6002
|
+
open = _React$useState[0],
|
6003
|
+
setOpen = _React$useState[1];
|
6004
|
+
|
6005
|
+
React.useEffect(function () {
|
5959
6006
|
if (defaultOpen) {
|
5960
6007
|
setOpen(defaultOpen);
|
5961
6008
|
}
|
@@ -9318,6 +9365,7 @@ const Tour = props => {
|
|
9318
9365
|
spotlightClicks,
|
9319
9366
|
disableCloseOnEsc: disableTourSkipOnEsc,
|
9320
9367
|
disableScrollParentFix = false,
|
9368
|
+
scrollOffset,
|
9321
9369
|
...rest
|
9322
9370
|
} = props;
|
9323
9371
|
const steps = React.useMemo(() => {
|
@@ -9374,6 +9422,7 @@ const Tour = props => {
|
|
9374
9422
|
spotlightClicks: spotlightClicks,
|
9375
9423
|
disableScrollParentFix: disableScrollParentFix,
|
9376
9424
|
callback: callback,
|
9425
|
+
scrollOffset: scrollOffset,
|
9377
9426
|
styles: {
|
9378
9427
|
/** style beacon */
|
9379
9428
|
options: {
|
@@ -9409,12 +9458,12 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9409
9458
|
}, [ref, callback]);
|
9410
9459
|
};
|
9411
9460
|
|
9412
|
-
|
9413
|
-
|
9414
|
-
|
9415
|
-
|
9416
|
-
|
9417
|
-
|
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', {
|
9418
9467
|
'mx-4 mb-4': !noPadding
|
9419
9468
|
}, props.className);
|
9420
9469
|
return React.createElement("div", Object.assign({}, props, {
|
@@ -9422,13 +9471,11 @@ const Content$6 = /*#__PURE__*/React.forwardRef(function CardContent(externalPro
|
|
9422
9471
|
ref: ref
|
9423
9472
|
}));
|
9424
9473
|
});
|
9425
|
-
|
9426
|
-
|
9427
|
-
|
9428
|
-
|
9429
|
-
|
9430
|
-
} = props;
|
9431
|
-
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);
|
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);
|
9432
9479
|
return React.createElement("div", {
|
9433
9480
|
className: className,
|
9434
9481
|
"data-taco": "card",
|