@economic/taco 1.0.6 → 1.0.7
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/Checkbox/Checkbox.js +15 -18
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js +23 -25
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Datepicker/Datepicker.js +48 -52
- package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +39 -58
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Field/Field.js +10 -12
- package/dist/esm/components/Field/Field.js.map +1 -1
- package/dist/esm/components/Form/Form.js +6 -8
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/Group/Group.js +6 -8
- package/dist/esm/components/Group/Group.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js +27 -35
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/HoverCard/HoverCard.js +8 -9
- package/dist/esm/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js +7 -8
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.js +9 -11
- package/dist/esm/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/components/Input/Input.js +25 -25
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js +24 -25
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js +20 -43
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +6 -5
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +10 -11
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/taco.cjs.development.js +291 -346
- 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 +3 -3
@@ -3139,17 +3139,17 @@ const icons = {
|
|
3139
3139
|
zoom: Zoom
|
3140
3140
|
};
|
3141
3141
|
|
3142
|
-
|
3143
|
-
var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
3142
|
+
const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
3144
3143
|
var _props$className;
|
3145
3144
|
|
3146
|
-
|
3147
|
-
|
3148
|
-
|
3149
|
-
|
3145
|
+
const {
|
3146
|
+
name,
|
3147
|
+
...otherProps
|
3148
|
+
} = props;
|
3149
|
+
const Component = icons[name];
|
3150
3150
|
/* 24x24 _at the base body font_ - must be em so that they scale with font size - tailwind spacing uses rem */
|
3151
3151
|
|
3152
|
-
|
3152
|
+
const className = cn('inline-flex h-[1.715em] w-[1.715em] flex-shrink-0', props.className, {
|
3153
3153
|
'p-[3px]': (_props$className = props.className) === null || _props$className === void 0 ? void 0 : _props$className.includes('rounded-full')
|
3154
3154
|
});
|
3155
3155
|
return Component ? React__default.createElement(Component, Object.assign({}, otherProps, {
|
@@ -3161,7 +3161,7 @@ var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
3161
3161
|
})) : null;
|
3162
3162
|
});
|
3163
3163
|
|
3164
|
-
var _excluded
|
3164
|
+
var _excluded = ["id"],
|
3165
3165
|
_excluded2 = ["id", "defaultId", "onChange", "as"];
|
3166
3166
|
var AccordionContext = /*#__PURE__*/React__default.createContext({
|
3167
3167
|
as: 'h2'
|
@@ -3199,7 +3199,7 @@ var Content = /*#__PURE__*/React__default.forwardRef(function AccordionContent(p
|
|
3199
3199
|
|
3200
3200
|
var Item = function Item(props) {
|
3201
3201
|
var id = props.id,
|
3202
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded
|
3202
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
3203
3203
|
|
3204
3204
|
return React__default.createElement(AccordionPrimitive.Item, Object.assign({}, otherProps, {
|
3205
3205
|
value: id
|
@@ -3300,7 +3300,7 @@ const getOutlineClasses = state => {
|
|
3300
3300
|
}
|
3301
3301
|
};
|
3302
3302
|
|
3303
|
-
var _excluded$
|
3303
|
+
var _excluded$1 = ["children", "compact", "outline", "state"];
|
3304
3304
|
var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
3305
3305
|
var _cn;
|
3306
3306
|
|
@@ -3310,7 +3310,7 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
3310
3310
|
_props$outline = props.outline,
|
3311
3311
|
outline = _props$outline === void 0 ? false : _props$outline,
|
3312
3312
|
state = props.state,
|
3313
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3313
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
3314
3314
|
|
3315
3315
|
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);
|
3316
3316
|
return React.createElement("span", Object.assign({}, otherProps, {
|
@@ -3470,14 +3470,13 @@ const createButton = (props, className, ref) => {
|
|
3470
3470
|
return button;
|
3471
3471
|
};
|
3472
3472
|
|
3473
|
-
|
3474
|
-
|
3475
|
-
|
3476
|
-
|
3477
|
-
|
3478
|
-
|
3479
|
-
|
3480
|
-
var className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3473
|
+
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
3474
|
+
const {
|
3475
|
+
icon,
|
3476
|
+
rounded = false,
|
3477
|
+
...otherProps
|
3478
|
+
} = props;
|
3479
|
+
const className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3481
3480
|
'rounded-full': rounded,
|
3482
3481
|
rounded: !rounded,
|
3483
3482
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3488,13 +3487,13 @@ var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
|
3488
3487
|
return null;
|
3489
3488
|
}
|
3490
3489
|
|
3491
|
-
return createButton(
|
3490
|
+
return createButton({ ...otherProps,
|
3492
3491
|
children: React.createElement(Icon, {
|
3493
3492
|
name: icon,
|
3494
3493
|
className: "m-0 p-0"
|
3495
3494
|
}),
|
3496
3495
|
'data-taco': 'icon-button'
|
3497
|
-
}
|
3496
|
+
}, className, ref);
|
3498
3497
|
});
|
3499
3498
|
|
3500
3499
|
var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
@@ -3514,10 +3513,10 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3514
3513
|
}) : null);
|
3515
3514
|
});
|
3516
3515
|
|
3517
|
-
var _excluded$
|
3516
|
+
var _excluded$2 = ["fluid"];
|
3518
3517
|
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3519
3518
|
var fluid = props.fluid,
|
3520
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3519
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
|
3521
3520
|
|
3522
3521
|
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3523
3522
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3995,7 +3994,7 @@ const Provider = props => {
|
|
3995
3994
|
const useTaco = () => React.useContext(Context);
|
3996
3995
|
const useLocalization = () => useTaco().localization;
|
3997
3996
|
|
3998
|
-
var _excluded$
|
3997
|
+
var _excluded$3 = ["onChange", "value"];
|
3999
3998
|
|
4000
3999
|
var renderDay = function renderDay(day, modifiers) {
|
4001
4000
|
return modifiers.disabled ? React.createElement("span", {
|
@@ -4074,7 +4073,7 @@ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
|
4074
4073
|
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4075
4074
|
var handleChange = props.onChange,
|
4076
4075
|
value = props.value,
|
4077
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4076
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
4078
4077
|
|
4079
4078
|
var _useLocalization2 = useLocalization(),
|
4080
4079
|
locale = _useLocalization2.locale,
|
@@ -4138,32 +4137,30 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4138
4137
|
})));
|
4139
4138
|
});
|
4140
4139
|
|
4141
|
-
|
4142
|
-
|
4143
|
-
|
4144
|
-
|
4145
|
-
|
4146
|
-
|
4147
|
-
|
4148
|
-
|
4149
|
-
|
4150
|
-
|
4151
|
-
|
4140
|
+
const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4141
|
+
const {
|
4142
|
+
checked,
|
4143
|
+
highlighted,
|
4144
|
+
indeterminate,
|
4145
|
+
invalid,
|
4146
|
+
label,
|
4147
|
+
onChange,
|
4148
|
+
...otherProps
|
4149
|
+
} = props;
|
4150
|
+
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)]
|
4152
4151
|
props.className, {
|
4153
4152
|
'border-grey-dark text-blue hover:text-blue-light focus:border-blue focus:hover:border-blue-light': !props.disabled && !invalid,
|
4154
4153
|
'border-grey text-blue-light cursor-not-allowed': props.disabled,
|
4155
4154
|
'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
|
4156
4155
|
'border-red text-red hover:text-red-light hover:border-red-light focus:border-red focus:hover:border-red-light': invalid && !props.disabled
|
4157
4156
|
});
|
4158
|
-
|
4157
|
+
let handleChange;
|
4159
4158
|
|
4160
4159
|
if (onChange) {
|
4161
|
-
handleChange =
|
4162
|
-
return onChange(checked === 'indeterminate' ? false : checked);
|
4163
|
-
};
|
4160
|
+
handleChange = checked => onChange(checked === 'indeterminate' ? false : checked);
|
4164
4161
|
}
|
4165
4162
|
|
4166
|
-
|
4163
|
+
const element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
|
4167
4164
|
"data-taco": "checkbox",
|
4168
4165
|
checked: indeterminate ? 'indeterminate' : checked,
|
4169
4166
|
className: className,
|
@@ -4177,7 +4174,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4177
4174
|
})));
|
4178
4175
|
|
4179
4176
|
if (label) {
|
4180
|
-
|
4177
|
+
const labelClassName = cn('flex items-center cursor-pointer gap-2', {
|
4181
4178
|
'cursor-not-allowed text-grey-dark': props.disabled
|
4182
4179
|
}, props.className);
|
4183
4180
|
return React.createElement("label", {
|
@@ -4220,21 +4217,22 @@ const getButtonStateClasses = invalid => {
|
|
4220
4217
|
return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
|
4221
4218
|
};
|
4222
4219
|
|
4223
|
-
|
4224
|
-
|
4225
|
-
|
4226
|
-
|
4227
|
-
|
4228
|
-
|
4229
|
-
|
4230
|
-
|
4231
|
-
|
4232
|
-
|
4233
|
-
|
4234
|
-
|
4220
|
+
const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
4221
|
+
const {
|
4222
|
+
button,
|
4223
|
+
icon,
|
4224
|
+
highlighted,
|
4225
|
+
invalid,
|
4226
|
+
onKeyDown,
|
4227
|
+
autoFocus,
|
4228
|
+
...otherProps
|
4229
|
+
} = props;
|
4230
|
+
const inputRef = useProxiedRef(ref);
|
4231
|
+
const hasContainer = button || icon;
|
4232
|
+
const className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4235
4233
|
'pr-8': !!hasContainer
|
4236
4234
|
}, !hasContainer && otherProps.className);
|
4237
|
-
React.useEffect(
|
4235
|
+
React.useEffect(() => {
|
4238
4236
|
if (autoFocus && inputRef.current) {
|
4239
4237
|
inputRef.current.focus();
|
4240
4238
|
}
|
@@ -4242,10 +4240,10 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4242
4240
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
4243
4241
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
4244
4242
|
|
4245
|
-
|
4243
|
+
const handleKeyDown = event => {
|
4246
4244
|
if (!event.shiftKey && (event.key === 'Home' || event.key === 'End')) {
|
4247
4245
|
event.preventDefault();
|
4248
|
-
|
4246
|
+
const position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
4249
4247
|
event.currentTarget.setSelectionRange(position, position);
|
4250
4248
|
}
|
4251
4249
|
|
@@ -4254,7 +4252,7 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4254
4252
|
}
|
4255
4253
|
};
|
4256
4254
|
|
4257
|
-
|
4255
|
+
const input = React.createElement("input", Object.assign({}, otherProps, {
|
4258
4256
|
className: className,
|
4259
4257
|
"data-taco": "input",
|
4260
4258
|
onKeyDown: handleKeyDown,
|
@@ -4262,19 +4260,19 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4262
4260
|
}));
|
4263
4261
|
|
4264
4262
|
if (hasContainer) {
|
4265
|
-
|
4263
|
+
let extra;
|
4266
4264
|
|
4267
4265
|
if (button) {
|
4268
|
-
|
4269
|
-
|
4270
|
-
|
4271
|
-
|
4266
|
+
const disabled = button.props.disabled || otherProps.disabled;
|
4267
|
+
const buttonClassName = cn('items-center flex justify-center border absolute rounded-l-none rounded-r right-0 h-full focus:rounded focus:outline-none', {
|
4268
|
+
[getButtonStateClasses(invalid)]: !props.disabled
|
4269
|
+
}, button.props.className);
|
4272
4270
|
extra = React.cloneElement(button, {
|
4273
4271
|
className: buttonClassName,
|
4274
|
-
disabled
|
4272
|
+
disabled
|
4275
4273
|
});
|
4276
4274
|
} else if (icon) {
|
4277
|
-
|
4275
|
+
const iconClassName = cn('items-center flex justify-center absolute pointer-events-none mr-1 p-px right-0 w-5 top-1/2 -translate-y-1/2', {
|
4278
4276
|
'text-grey-dark': props.disabled,
|
4279
4277
|
'text-grey-darkest': !props.disabled
|
4280
4278
|
});
|
@@ -4286,7 +4284,7 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4286
4284
|
});
|
4287
4285
|
}
|
4288
4286
|
|
4289
|
-
|
4287
|
+
const containerClassName = cn('bg-white inline-flex relative rounded w-full', otherProps.className);
|
4290
4288
|
return React.createElement("div", {
|
4291
4289
|
className: containerClassName,
|
4292
4290
|
"data-taco": "input-container"
|
@@ -5057,27 +5055,26 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5057
5055
|
return dimensions;
|
5058
5056
|
};
|
5059
5057
|
|
5060
|
-
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5066
|
-
|
5067
|
-
|
5068
|
-
|
5069
|
-
|
5070
|
-
|
5071
|
-
|
5072
|
-
|
5073
|
-
|
5074
|
-
|
5075
|
-
|
5076
|
-
|
5077
|
-
|
5078
|
-
|
5079
|
-
|
5080
|
-
var className = cn('inline-flex relative', {
|
5058
|
+
const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5059
|
+
const {
|
5060
|
+
className: externalClassName,
|
5061
|
+
dialog,
|
5062
|
+
style,
|
5063
|
+
...otherProps
|
5064
|
+
} = props;
|
5065
|
+
const {
|
5066
|
+
combobox,
|
5067
|
+
button,
|
5068
|
+
input,
|
5069
|
+
popover,
|
5070
|
+
list
|
5071
|
+
} = useCombobox(otherProps, ref);
|
5072
|
+
const internalRef = React.useRef(null);
|
5073
|
+
const {
|
5074
|
+
texts
|
5075
|
+
} = useLocalization();
|
5076
|
+
const selectDimensions = useBoundingClientRectListener(internalRef);
|
5077
|
+
const className = cn('inline-flex relative', {
|
5081
5078
|
'yt-combobox--inline': props.inline
|
5082
5079
|
}, externalClassName);
|
5083
5080
|
return React.createElement("span", {
|
@@ -5096,7 +5093,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5096
5093
|
appearance: "discrete",
|
5097
5094
|
className: "!border-l-0 focus:!border-none focus:!shadow-none active:!border-none",
|
5098
5095
|
icon: popover.open ? 'chevron-up' : 'chevron-down',
|
5099
|
-
onClick:
|
5096
|
+
onClick: () => {
|
5100
5097
|
var _input$ref$current;
|
5101
5098
|
|
5102
5099
|
popover.onOpenChange(true);
|
@@ -5107,7 +5104,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5107
5104
|
icon: "list-search",
|
5108
5105
|
disabled: props.readOnly || props.disabled,
|
5109
5106
|
dialog: dialog,
|
5110
|
-
onFocus:
|
5107
|
+
onFocus: event => {
|
5111
5108
|
var _input$ref$current2;
|
5112
5109
|
|
5113
5110
|
// Prevents the default focus behaviour of showing the tooltip, on parent tooltip element
|
@@ -5120,7 +5117,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5120
5117
|
}) : undefined
|
5121
5118
|
})))), React.createElement(PopoverPrimitive.Content, {
|
5122
5119
|
align: "start",
|
5123
|
-
onOpenAutoFocus:
|
5120
|
+
onOpenAutoFocus: event => {
|
5124
5121
|
event.preventDefault();
|
5125
5122
|
},
|
5126
5123
|
sideOffset: 4
|
@@ -5430,23 +5427,23 @@ Popover.Trigger = Trigger$1;
|
|
5430
5427
|
Popover.Content = Content$1;
|
5431
5428
|
Popover.Close = Close$1;
|
5432
5429
|
|
5433
|
-
|
5434
|
-
|
5435
|
-
|
5436
|
-
|
5437
|
-
|
5438
|
-
|
5439
|
-
|
5440
|
-
|
5441
|
-
|
5442
|
-
|
5443
|
-
|
5444
|
-
|
5445
|
-
|
5446
|
-
|
5447
|
-
|
5448
|
-
|
5449
|
-
|
5430
|
+
const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5431
|
+
const {
|
5432
|
+
className: externalClassName,
|
5433
|
+
onReset: handleReset,
|
5434
|
+
style,
|
5435
|
+
shortcuts,
|
5436
|
+
shortcutsText,
|
5437
|
+
...otherProps
|
5438
|
+
} = props;
|
5439
|
+
const {
|
5440
|
+
calendar,
|
5441
|
+
input
|
5442
|
+
} = useDatepicker(otherProps, ref);
|
5443
|
+
const {
|
5444
|
+
texts
|
5445
|
+
} = useLocalization();
|
5446
|
+
const className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5450
5447
|
return React.createElement("span", {
|
5451
5448
|
className: className,
|
5452
5449
|
"data-taco": "datepicker",
|
@@ -5456,40 +5453,37 @@ var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
|
5456
5453
|
"aria-label": texts.datepicker.expand,
|
5457
5454
|
disabled: input.disabled || input.readOnly,
|
5458
5455
|
icon: "calendar"
|
5459
|
-
})), React.createElement(Popover.Content, null,
|
5460
|
-
|
5461
|
-
|
5462
|
-
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5470
|
-
|
5471
|
-
|
5472
|
-
|
5473
|
-
|
5474
|
-
|
5475
|
-
|
5476
|
-
|
5477
|
-
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
-
|
5482
|
-
|
5483
|
-
|
5484
|
-
|
5485
|
-
|
5486
|
-
|
5487
|
-
|
5488
|
-
|
5489
|
-
|
5490
|
-
}
|
5491
|
-
}, texts.datepicker.clear)));
|
5492
|
-
}))
|
5456
|
+
})), React.createElement(Popover.Content, null, ({
|
5457
|
+
close
|
5458
|
+
}) => React.createElement("div", {
|
5459
|
+
className: "-m-3 flex"
|
5460
|
+
}, React.createElement(Calendar$1, Object.assign({}, calendar, {
|
5461
|
+
onChange: (date, event) => {
|
5462
|
+
calendar.onChange(date, event);
|
5463
|
+
close();
|
5464
|
+
},
|
5465
|
+
tabIndex: -1
|
5466
|
+
})), shortcuts && React.createElement("div", {
|
5467
|
+
className: "border-grey-dark flex flex-col border-l"
|
5468
|
+
}, React.createElement("span", {
|
5469
|
+
className: "m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold"
|
5470
|
+
}, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map((shortcut, i) => React.createElement("li", {
|
5471
|
+
key: i
|
5472
|
+
}, React.createElement("button", {
|
5473
|
+
className: "hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs",
|
5474
|
+
onClick: event => {
|
5475
|
+
event.persist();
|
5476
|
+
shortcut.onClick(event);
|
5477
|
+
close();
|
5478
|
+
}
|
5479
|
+
}, shortcut.text)))), handleReset && React.createElement("button", {
|
5480
|
+
className: "text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs",
|
5481
|
+
onClick: event => {
|
5482
|
+
event.persist();
|
5483
|
+
handleReset(event);
|
5484
|
+
close();
|
5485
|
+
}
|
5486
|
+
}, texts.datepicker.clear)))))
|
5493
5487
|
})));
|
5494
5488
|
});
|
5495
5489
|
|
@@ -5732,14 +5726,12 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5732
5726
|
});
|
5733
5727
|
Extra.displayName = 'DialogExtra';
|
5734
5728
|
|
5735
|
-
|
5736
|
-
|
5737
|
-
|
5738
|
-
|
5739
|
-
|
5740
|
-
|
5741
|
-
var extra;
|
5742
|
-
React.Children.toArray(initialChildren).forEach(function (child) {
|
5729
|
+
const useSeparatedChildren = initialChildren => {
|
5730
|
+
return React.useMemo(() => {
|
5731
|
+
const children = [];
|
5732
|
+
let drawer;
|
5733
|
+
let extra;
|
5734
|
+
React.Children.toArray(initialChildren).forEach(child => {
|
5743
5735
|
var _child$type, _child$type2;
|
5744
5736
|
|
5745
5737
|
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
|
@@ -5754,55 +5746,39 @@ var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
|
5754
5746
|
}, [initialChildren]);
|
5755
5747
|
};
|
5756
5748
|
|
5757
|
-
|
5758
|
-
|
5759
|
-
|
5760
|
-
|
5761
|
-
|
5762
|
-
|
5763
|
-
|
5764
|
-
|
5765
|
-
|
5766
|
-
|
5767
|
-
|
5768
|
-
|
5769
|
-
|
5770
|
-
|
5771
|
-
|
5772
|
-
|
5773
|
-
|
5774
|
-
|
5775
|
-
|
5776
|
-
|
5777
|
-
|
5778
|
-
|
5779
|
-
|
5780
|
-
|
5781
|
-
|
5782
|
-
|
5783
|
-
|
5784
|
-
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5788
|
-
|
5789
|
-
|
5790
|
-
return setDrawerOpen(function (isDrawerOpen) {
|
5791
|
-
return !isDrawerOpen;
|
5792
|
-
});
|
5793
|
-
}
|
5794
|
-
},
|
5795
|
-
elements: {
|
5796
|
-
drawer: drawer,
|
5797
|
-
extra: extra
|
5798
|
-
},
|
5799
|
-
onClose: onClose,
|
5800
|
-
props: otherProps,
|
5801
|
-
showCloseButton: showCloseButton,
|
5802
|
-
size: size,
|
5803
|
-
ref: ref
|
5804
|
-
};
|
5805
|
-
}, [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
|
5749
|
+
const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
5750
|
+
const {
|
5751
|
+
children: initialChildren,
|
5752
|
+
closeOnEscape = true,
|
5753
|
+
defaultOpen,
|
5754
|
+
draggable = false,
|
5755
|
+
onChange,
|
5756
|
+
onClose,
|
5757
|
+
open,
|
5758
|
+
showCloseButton = true,
|
5759
|
+
size = 'sm',
|
5760
|
+
trigger,
|
5761
|
+
...otherProps
|
5762
|
+
} = props;
|
5763
|
+
const [children, drawer, extra] = useSeparatedChildren(initialChildren);
|
5764
|
+
const [drawerOpen, setDrawerOpen] = React.useState(false);
|
5765
|
+
const context = React.useMemo(() => ({
|
5766
|
+
closeOnEscape,
|
5767
|
+
draggable,
|
5768
|
+
drawer: {
|
5769
|
+
open: drawerOpen,
|
5770
|
+
toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen)
|
5771
|
+
},
|
5772
|
+
elements: {
|
5773
|
+
drawer,
|
5774
|
+
extra
|
5775
|
+
},
|
5776
|
+
onClose,
|
5777
|
+
props: otherProps,
|
5778
|
+
showCloseButton,
|
5779
|
+
size,
|
5780
|
+
ref
|
5781
|
+
}), [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
|
5806
5782
|
return React.createElement(DialogContext.Provider, {
|
5807
5783
|
value: context
|
5808
5784
|
}, React.createElement(DialogPrimitive.Root, {
|
@@ -5819,19 +5795,18 @@ Dialog.Extra = Extra;
|
|
5819
5795
|
Dialog.Drawer = Drawer;
|
5820
5796
|
Dialog.Close = Close$2;
|
5821
5797
|
|
5822
|
-
|
5823
|
-
|
5824
|
-
|
5825
|
-
|
5826
|
-
|
5827
|
-
|
5828
|
-
|
5829
|
-
|
5830
|
-
|
5831
|
-
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5798
|
+
const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5799
|
+
const {
|
5800
|
+
disabled,
|
5801
|
+
children,
|
5802
|
+
invalid = false,
|
5803
|
+
message,
|
5804
|
+
...otherProps
|
5805
|
+
} = props;
|
5806
|
+
const className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5832
5807
|
'text-grey-dark': disabled
|
5833
5808
|
}, props.className);
|
5834
|
-
|
5809
|
+
const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
|
5835
5810
|
'text-grey-darkest': !invalid,
|
5836
5811
|
'text-red': invalid,
|
5837
5812
|
'opacity-50': disabled
|
@@ -5846,13 +5821,12 @@ var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5846
5821
|
}, message));
|
5847
5822
|
});
|
5848
5823
|
|
5849
|
-
|
5850
|
-
|
5851
|
-
|
5852
|
-
|
5853
|
-
|
5854
|
-
|
5855
|
-
var className = cn('yt-form', {
|
5824
|
+
const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
5825
|
+
const {
|
5826
|
+
horizontal = false,
|
5827
|
+
...otherProps
|
5828
|
+
} = props;
|
5829
|
+
const className = cn('yt-form', {
|
5856
5830
|
'yt-form--horizontal flex flex-wrap': horizontal
|
5857
5831
|
}, props.className);
|
5858
5832
|
return React.createElement("form", Object.assign({}, otherProps, {
|
@@ -5862,13 +5836,12 @@ var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5862
5836
|
}));
|
5863
5837
|
});
|
5864
5838
|
|
5865
|
-
|
5866
|
-
|
5867
|
-
|
5868
|
-
|
5869
|
-
|
5870
|
-
|
5871
|
-
var className = cn('flex ', props.className);
|
5839
|
+
const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5840
|
+
const {
|
5841
|
+
as: Tag = 'span',
|
5842
|
+
...otherProps
|
5843
|
+
} = props;
|
5844
|
+
const className = cn('flex ', props.className);
|
5872
5845
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
5873
5846
|
className: className,
|
5874
5847
|
"data-taco": "group",
|
@@ -5876,19 +5849,18 @@ var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5876
5849
|
}));
|
5877
5850
|
});
|
5878
5851
|
|
5879
|
-
|
5880
|
-
var HangerContext = /*#__PURE__*/React.createContext({
|
5852
|
+
const HangerContext = /*#__PURE__*/React.createContext({
|
5881
5853
|
props: {},
|
5882
5854
|
ref: null
|
5883
5855
|
});
|
5884
|
-
|
5856
|
+
const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
5885
5857
|
var _props$children;
|
5886
5858
|
|
5887
|
-
|
5888
|
-
|
5859
|
+
const context = React.useContext(HangerContext);
|
5860
|
+
let children = props.children;
|
5889
5861
|
|
5890
5862
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5891
|
-
console.warn(
|
5863
|
+
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`);
|
5892
5864
|
children = React.createElement("span", null, props.children);
|
5893
5865
|
}
|
5894
5866
|
|
@@ -5898,22 +5870,21 @@ var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
|
5898
5870
|
asChild: true
|
5899
5871
|
}));
|
5900
5872
|
});
|
5901
|
-
|
5902
|
-
|
5873
|
+
const Title$1 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
|
5874
|
+
const className = cn('mb-1 text-base font-bold flex w-full', props.className);
|
5903
5875
|
return React.createElement("span", Object.assign({}, props, {
|
5904
5876
|
className: className,
|
5905
5877
|
ref: ref
|
5906
5878
|
}));
|
5907
5879
|
});
|
5908
|
-
|
5909
|
-
|
5910
|
-
|
5911
|
-
|
5912
|
-
|
5913
|
-
|
5914
|
-
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);
|
5880
|
+
const Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
|
5881
|
+
const context = React.useContext(HangerContext);
|
5882
|
+
const {
|
5883
|
+
texts
|
5884
|
+
} = useLocalization();
|
5885
|
+
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);
|
5915
5886
|
|
5916
|
-
|
5887
|
+
const handleInteractOutside = event => {
|
5917
5888
|
event.preventDefault();
|
5918
5889
|
};
|
5919
5890
|
|
@@ -5935,25 +5906,20 @@ var Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref)
|
|
5935
5906
|
onClick: context.props.onClose
|
5936
5907
|
})));
|
5937
5908
|
});
|
5938
|
-
|
5939
|
-
|
5940
|
-
|
5941
|
-
|
5942
|
-
|
5943
|
-
|
5944
|
-
|
5945
|
-
|
5946
|
-
|
5947
|
-
|
5948
|
-
|
5949
|
-
};
|
5950
|
-
}, [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
5951
|
-
|
5952
|
-
var _React$useState = React.useState(false),
|
5953
|
-
open = _React$useState[0],
|
5954
|
-
setOpen = _React$useState[1];
|
5909
|
+
const Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
5910
|
+
const {
|
5911
|
+
anchor,
|
5912
|
+
children,
|
5913
|
+
defaultOpen = true,
|
5914
|
+
...otherProps
|
5915
|
+
} = props;
|
5916
|
+
const context = React.useMemo(() => ({
|
5917
|
+
props: otherProps,
|
5918
|
+
ref
|
5919
|
+
}), [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
5955
5920
|
|
5956
|
-
React.
|
5921
|
+
const [open, setOpen] = React.useState(false);
|
5922
|
+
React.useEffect(() => {
|
5957
5923
|
if (defaultOpen) {
|
5958
5924
|
setOpen(defaultOpen);
|
5959
5925
|
}
|
@@ -5969,25 +5935,25 @@ Hanger.Anchor = Anchor;
|
|
5969
5935
|
Hanger.Content = Content$3;
|
5970
5936
|
Hanger.Title = Title$1;
|
5971
5937
|
|
5972
|
-
|
5973
|
-
var Trigger$3 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
|
5938
|
+
const Trigger$3 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
|
5974
5939
|
return React.createElement(HoverCardPrimitive.Trigger, Object.assign({}, props, {
|
5975
5940
|
asChild: true,
|
5976
5941
|
ref: ref
|
5977
5942
|
}));
|
5978
5943
|
});
|
5979
|
-
|
5980
|
-
|
5981
|
-
|
5982
|
-
|
5983
|
-
|
5944
|
+
const Content$4 = /*#__PURE__*/React.forwardRef(function HoverCardContent(externalProps, ref) {
|
5945
|
+
const {
|
5946
|
+
placement,
|
5947
|
+
...props
|
5948
|
+
} = externalProps;
|
5949
|
+
const className = cn('bg-white rounded p-3 yt-shadow', props.className);
|
5984
5950
|
return React.createElement(HoverCardPrimitive.Content, Object.assign({}, props, {
|
5985
5951
|
className: className,
|
5986
5952
|
ref: ref,
|
5987
5953
|
side: placement
|
5988
5954
|
}));
|
5989
5955
|
});
|
5990
|
-
|
5956
|
+
const HoverCard = props => {
|
5991
5957
|
return React.createElement(HoverCardPrimitive.Root, Object.assign({}, props, {
|
5992
5958
|
openDelay: 300
|
5993
5959
|
}));
|
@@ -6340,49 +6306,49 @@ const useMultiListbox = ({
|
|
6340
6306
|
};
|
6341
6307
|
};
|
6342
6308
|
|
6343
|
-
|
6344
|
-
|
6345
|
-
|
6346
|
-
|
6347
|
-
|
6348
|
-
|
6349
|
-
|
6350
|
-
|
6351
|
-
|
6352
|
-
|
6353
|
-
var className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6309
|
+
const Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6310
|
+
const {
|
6311
|
+
className: externalClassName,
|
6312
|
+
...otherProps
|
6313
|
+
} = props;
|
6314
|
+
const {
|
6315
|
+
list,
|
6316
|
+
input
|
6317
|
+
} = useListbox(otherProps, ref);
|
6318
|
+
const className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6354
6319
|
return React.createElement("span", {
|
6355
6320
|
"data-taco": "listbox",
|
6356
6321
|
className: className
|
6357
6322
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6358
|
-
style:
|
6323
|
+
style: { ...list.style,
|
6359
6324
|
maxHeight: 'calc(12rem + 2px)'
|
6360
6325
|
/* (6 * option height) + listbox border */
|
6361
6326
|
|
6362
|
-
}
|
6327
|
+
}
|
6363
6328
|
})), React.createElement("input", Object.assign({}, input, {
|
6364
6329
|
className: "hidden",
|
6365
6330
|
type: "text"
|
6366
6331
|
})));
|
6367
6332
|
});
|
6368
|
-
|
6369
|
-
|
6370
|
-
|
6371
|
-
|
6372
|
-
|
6373
|
-
|
6374
|
-
|
6375
|
-
|
6376
|
-
|
6333
|
+
const MultiListbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6334
|
+
const {
|
6335
|
+
className: externalClassName,
|
6336
|
+
...otherProps
|
6337
|
+
} = props;
|
6338
|
+
const {
|
6339
|
+
list,
|
6340
|
+
input
|
6341
|
+
} = useMultiListbox(otherProps, ref);
|
6342
|
+
const className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6377
6343
|
return React.createElement("span", {
|
6378
6344
|
"data-taco": "listbox",
|
6379
6345
|
className: className
|
6380
6346
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6381
|
-
style:
|
6347
|
+
style: { ...list.style,
|
6382
6348
|
maxHeight: 'calc(12rem + 2px + 2px)'
|
6383
6349
|
/* (6 * option height) + listbox border + ALL_OPTIONS bottom border */
|
6384
6350
|
|
6385
|
-
}
|
6351
|
+
}
|
6386
6352
|
})), React.createElement("input", Object.assign({}, input, {
|
6387
6353
|
className: "hidden",
|
6388
6354
|
type: "text"
|
@@ -6645,7 +6611,7 @@ const Checkbox$1 = props => {
|
|
6645
6611
|
})), children);
|
6646
6612
|
};
|
6647
6613
|
|
6648
|
-
const getRadioGroupItemValueAsString = value => value
|
6614
|
+
const getRadioGroupItemValueAsString = value => String(value !== null && value !== void 0 ? value : '');
|
6649
6615
|
const findByValue$1 = (values, valueAsString) => values.find(value => getRadioGroupItemValueAsString(value) === valueAsString);
|
6650
6616
|
const RadioGroupContext = /*#__PURE__*/React.createContext({
|
6651
6617
|
disabled: false,
|
@@ -6659,12 +6625,13 @@ const RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(pro
|
|
6659
6625
|
...otherProps
|
6660
6626
|
} = props;
|
6661
6627
|
const isDisabled = context.disabled || props.disabled;
|
6662
|
-
const className = cn('flex flex-shrink-0 self-start items-center justify-center h-4 w-4 mt-[0.2rem] rounded-full bg-white border-2
|
6663
|
-
'border-grey-dark focus:yt-focus aria-checked:bg-blue aria-checked:border-blue hover:aria-checked:border-blue-light': !isDisabled && !context.invalid,
|
6628
|
+
const className = cn('flex flex-shrink-0 self-start items-center justify-center h-4 w-4 mt-[0.2rem] rounded-full bg-white border-2', {
|
6629
|
+
'border-grey-dark hover:border-4 focus:yt-focus aria-checked:bg-blue aria-checked:border-blue hover:aria-checked:border-blue-light': !isDisabled && !context.invalid,
|
6664
6630
|
'border-grey cursor-not-allowed aria-checked:bg-blue-light aria-checked:border-blue-light ': isDisabled,
|
6665
|
-
'border-red text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red': context.invalid && !isDisabled
|
6631
|
+
'border-red hover:border-4 text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red': context.invalid && !isDisabled
|
6666
6632
|
});
|
6667
|
-
const labelClassName = cn('flex items-center
|
6633
|
+
const labelClassName = cn('flex items-center gap-2', {
|
6634
|
+
'cursor-pointer': !isDisabled,
|
6668
6635
|
'cursor-not-allowed text-grey-dark': isDisabled
|
6669
6636
|
}, props.className);
|
6670
6637
|
return React.createElement("label", {
|
@@ -6844,48 +6811,26 @@ const Header = props => {
|
|
6844
6811
|
}));
|
6845
6812
|
};
|
6846
6813
|
|
6847
|
-
|
6848
|
-
|
6849
|
-
|
6850
|
-
|
6851
|
-
|
6852
|
-
|
6853
|
-
|
6854
|
-
|
6855
|
-
|
6856
|
-
|
6857
|
-
|
6858
|
-
|
6859
|
-
|
6860
|
-
|
6861
|
-
|
6862
|
-
|
6863
|
-
|
6864
|
-
|
6865
|
-
|
6866
|
-
|
6867
|
-
minWidth = _React$useState4[0],
|
6868
|
-
_setMinWidth = _React$useState4[1];
|
6869
|
-
|
6870
|
-
var context = React.useMemo(function () {
|
6871
|
-
return {
|
6872
|
-
appearance: appearance,
|
6873
|
-
setAppearance: function setAppearance(appearance) {
|
6874
|
-
return _setAppearance(appearance);
|
6875
|
-
},
|
6876
|
-
indented: indented,
|
6877
|
-
registerIndentation: function registerIndentation() {
|
6878
|
-
return setIndented(true);
|
6879
|
-
},
|
6880
|
-
minWidth: minWidth,
|
6881
|
-
setMinWidth: function setMinWidth(width) {
|
6882
|
-
return _setMinWidth(width);
|
6883
|
-
},
|
6884
|
-
close: function close() {
|
6885
|
-
return setOpen(false);
|
6886
|
-
}
|
6887
|
-
};
|
6888
|
-
}, [indented, minWidth, appearance]);
|
6814
|
+
const Menu = externalProps => {
|
6815
|
+
const {
|
6816
|
+
appearance: externalAppearance,
|
6817
|
+
children,
|
6818
|
+
trigger,
|
6819
|
+
...props
|
6820
|
+
} = externalProps;
|
6821
|
+
const [open, setOpen] = React.useState(false);
|
6822
|
+
const [appearance, setAppearance] = React.useState(externalAppearance !== null && externalAppearance !== void 0 ? externalAppearance : 'default');
|
6823
|
+
const [indented, setIndented] = React.useState(false);
|
6824
|
+
const [minWidth, setMinWidth] = React.useState(undefined);
|
6825
|
+
const context = React.useMemo(() => ({
|
6826
|
+
appearance,
|
6827
|
+
setAppearance: appearance => setAppearance(appearance),
|
6828
|
+
indented,
|
6829
|
+
registerIndentation: () => setIndented(true),
|
6830
|
+
minWidth,
|
6831
|
+
setMinWidth: width => setMinWidth(width),
|
6832
|
+
close: () => setOpen(false)
|
6833
|
+
}), [indented, minWidth, appearance]);
|
6889
6834
|
return React.createElement(MenuContext.Provider, {
|
6890
6835
|
value: context
|
6891
6836
|
}, React.createElement(DropdownMenuPrimitive.Root, Object.assign({}, props, {
|
@@ -9507,24 +9452,24 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9507
9452
|
}, [ref, callback]);
|
9508
9453
|
};
|
9509
9454
|
|
9510
|
-
|
9511
|
-
|
9512
|
-
|
9513
|
-
|
9514
|
-
|
9515
|
-
|
9516
|
-
|
9455
|
+
const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
|
9456
|
+
onSearch,
|
9457
|
+
...props
|
9458
|
+
}, ref) {
|
9459
|
+
const {
|
9460
|
+
texts
|
9461
|
+
} = useLocalization();
|
9517
9462
|
|
9518
|
-
|
9463
|
+
const handleClick = () => {
|
9519
9464
|
if (!props.disabled) {
|
9520
9465
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(props.value);
|
9521
9466
|
}
|
9522
9467
|
};
|
9523
9468
|
|
9524
|
-
|
9469
|
+
const handleKeyDown = event => {
|
9525
9470
|
var _props$onKeyDown;
|
9526
9471
|
|
9527
|
-
|
9472
|
+
const isEnterKeyPressed = event.keyCode === keycode('enter');
|
9528
9473
|
|
9529
9474
|
if (isEnterKeyPressed) {
|
9530
9475
|
handleClick();
|