@economic/taco 0.0.31-alpha.0 → 0.0.32-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/_virtual/_rollupPluginBabelHelpers.js +19 -1
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js +14 -14
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js +5 -7
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Button/Button.js +13 -12
- package/dist/esm/components/Button/Button.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/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 +33 -25
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js +8 -7
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.js +11 -9
- package/dist/esm/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/components/Input/Input.js +24 -26
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js +25 -24
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +11 -10
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/taco.cjs.development.js +422 -344
- 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/package.json +3 -3
@@ -36,6 +36,39 @@ var PrimitiveSwitch = require('@radix-ui/react-switch');
|
|
36
36
|
var Joyride = require('react-joyride');
|
37
37
|
var Joyride__default = _interopDefault(Joyride);
|
38
38
|
|
39
|
+
function _extends() {
|
40
|
+
_extends = Object.assign || function (target) {
|
41
|
+
for (var i = 1; i < arguments.length; i++) {
|
42
|
+
var source = arguments[i];
|
43
|
+
|
44
|
+
for (var key in source) {
|
45
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
46
|
+
target[key] = source[key];
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
return target;
|
52
|
+
};
|
53
|
+
|
54
|
+
return _extends.apply(this, arguments);
|
55
|
+
}
|
56
|
+
|
57
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
58
|
+
if (source == null) return {};
|
59
|
+
var target = {};
|
60
|
+
var sourceKeys = Object.keys(source);
|
61
|
+
var key, i;
|
62
|
+
|
63
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
64
|
+
key = sourceKeys[i];
|
65
|
+
if (excluded.indexOf(key) >= 0) continue;
|
66
|
+
target[key] = source[key];
|
67
|
+
}
|
68
|
+
|
69
|
+
return target;
|
70
|
+
}
|
71
|
+
|
39
72
|
function IconAccountPreview(props, svgRef) {
|
40
73
|
return React.createElement("svg", Object.assign({
|
41
74
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3089,17 +3122,17 @@ const icons = {
|
|
3089
3122
|
zoom: Zoom
|
3090
3123
|
};
|
3091
3124
|
|
3092
|
-
|
3125
|
+
var _excluded = ["name"];
|
3126
|
+
var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
3093
3127
|
var _props$className;
|
3094
3128
|
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
const Component = icons[name];
|
3129
|
+
var name = props.name,
|
3130
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
3131
|
+
|
3132
|
+
var Component = icons[name];
|
3100
3133
|
/* 24x24 _at the base body font_ - must be em so that they scale with font size - tailwind spacing uses rem */
|
3101
3134
|
|
3102
|
-
|
3135
|
+
var className = cn('inline-flex h-[1.715em] w-[1.715em]', props.className, {
|
3103
3136
|
'p-[3px]': (_props$className = props.className) === null || _props$className === void 0 ? void 0 : _props$className.includes('rounded-full')
|
3104
3137
|
});
|
3105
3138
|
return Component ? React__default.createElement(Component, Object.assign({}, otherProps, {
|
@@ -3111,12 +3144,14 @@ const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
3111
3144
|
})) : null;
|
3112
3145
|
});
|
3113
3146
|
|
3114
|
-
|
3147
|
+
var _excluded$1 = ["id"],
|
3148
|
+
_excluded2 = ["id", "defaultId", "onChange", "as"];
|
3149
|
+
var AccordionContext = /*#__PURE__*/React__default.createContext({
|
3115
3150
|
as: 'h2'
|
3116
3151
|
});
|
3117
|
-
|
3118
|
-
|
3119
|
-
|
3152
|
+
var StyledTrigger = /*#__PURE__*/React__default.forwardRef(function AccordionStyledTrigger(props, ref) {
|
3153
|
+
var isExpanded = !!props['aria-expanded'];
|
3154
|
+
var className = cn('w-full inline-flex justify-between items-center align-middle', 'focus:rounded-sm focus:border-blue focus:yt-focus', props.className);
|
3120
3155
|
return React__default.createElement("button", Object.assign({}, props, {
|
3121
3156
|
ref: ref,
|
3122
3157
|
className: className
|
@@ -3124,13 +3159,12 @@ const StyledTrigger = /*#__PURE__*/React__default.forwardRef(function AccordionS
|
|
3124
3159
|
name: isExpanded ? 'chevron-up' : 'chevron-down'
|
3125
3160
|
}));
|
3126
3161
|
});
|
3127
|
-
|
3128
|
-
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3132
|
-
|
3133
|
-
} = React__default.useContext(AccordionContext);
|
3162
|
+
var Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger(props, ref) {
|
3163
|
+
var children = props.children;
|
3164
|
+
|
3165
|
+
var _React$useContext = React__default.useContext(AccordionContext),
|
3166
|
+
Heading = _React$useContext.as;
|
3167
|
+
|
3134
3168
|
return React__default.createElement(AccordionPrimitive.Header, {
|
3135
3169
|
asChild: true
|
3136
3170
|
}, React__default.createElement(Heading, {
|
@@ -3140,34 +3174,35 @@ const Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger
|
|
3140
3174
|
asChild: true
|
3141
3175
|
}, React__default.createElement(StyledTrigger, null, children))));
|
3142
3176
|
});
|
3143
|
-
|
3177
|
+
var Content = /*#__PURE__*/React__default.forwardRef(function AccordionContent(props, ref) {
|
3144
3178
|
return React__default.createElement(AccordionPrimitive.Content, Object.assign({}, props, {
|
3145
3179
|
ref: ref
|
3146
3180
|
}));
|
3147
3181
|
});
|
3148
3182
|
|
3149
|
-
|
3150
|
-
|
3151
|
-
|
3152
|
-
|
3153
|
-
} = props;
|
3183
|
+
var Item = function Item(props) {
|
3184
|
+
var id = props.id,
|
3185
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
3186
|
+
|
3154
3187
|
return React__default.createElement(AccordionPrimitive.Item, Object.assign({}, otherProps, {
|
3155
3188
|
value: id
|
3156
3189
|
}));
|
3157
3190
|
};
|
3158
3191
|
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3192
|
+
var Accordion = function Accordion(props) {
|
3193
|
+
var id = props.id,
|
3194
|
+
defaultId = props.defaultId,
|
3195
|
+
onChange = props.onChange,
|
3196
|
+
_props$as = props.as,
|
3197
|
+
as = _props$as === void 0 ? 'h2' : _props$as,
|
3198
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2);
|
3199
|
+
|
3200
|
+
var context = React__default.useMemo(function () {
|
3201
|
+
return {
|
3202
|
+
as: as
|
3203
|
+
};
|
3204
|
+
}, [as]);
|
3205
|
+
var valueProps;
|
3171
3206
|
|
3172
3207
|
if (defaultId) {
|
3173
3208
|
valueProps = {
|
@@ -3180,8 +3215,8 @@ const Accordion = props => {
|
|
3180
3215
|
};
|
3181
3216
|
}
|
3182
3217
|
|
3183
|
-
|
3184
|
-
|
3218
|
+
var type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';
|
3219
|
+
var className = cn('divide-y divide-grey', props.className);
|
3185
3220
|
return React__default.createElement(AccordionContext.Provider, {
|
3186
3221
|
value: context
|
3187
3222
|
}, React__default.createElement(AccordionPrimitive.Root, Object.assign({}, otherProps, valueProps, {
|
@@ -3248,20 +3283,19 @@ const getOutlineClasses = state => {
|
|
3248
3283
|
}
|
3249
3284
|
};
|
3250
3285
|
|
3251
|
-
|
3252
|
-
|
3253
|
-
|
3254
|
-
|
3255
|
-
|
3256
|
-
|
3257
|
-
|
3258
|
-
|
3259
|
-
|
3260
|
-
|
3261
|
-
|
3262
|
-
|
3263
|
-
|
3264
|
-
}, props.className);
|
3286
|
+
var _excluded$2 = ["children", "compact", "outline", "state"];
|
3287
|
+
var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
3288
|
+
var _cn;
|
3289
|
+
|
3290
|
+
var children = props.children,
|
3291
|
+
_props$compact = props.compact,
|
3292
|
+
compact = _props$compact === void 0 ? false : _props$compact,
|
3293
|
+
_props$outline = props.outline,
|
3294
|
+
outline = _props$outline === void 0 ? false : _props$outline,
|
3295
|
+
state = props.state,
|
3296
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
|
3297
|
+
|
3298
|
+
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-[0.354rem]'] = !compact, _cn), props.className);
|
3265
3299
|
return React.createElement("span", Object.assign({}, otherProps, {
|
3266
3300
|
"aria-atomic": "true",
|
3267
3301
|
"aria-live": "polite",
|
@@ -3419,13 +3453,14 @@ const createButton = (props, className, ref) => {
|
|
3419
3453
|
return button;
|
3420
3454
|
};
|
3421
3455
|
|
3422
|
-
|
3423
|
-
|
3424
|
-
|
3425
|
-
|
3426
|
-
|
3427
|
-
|
3428
|
-
|
3456
|
+
var _excluded$3 = ["icon", "rounded"];
|
3457
|
+
var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
3458
|
+
var icon = props.icon,
|
3459
|
+
_props$rounded = props.rounded,
|
3460
|
+
rounded = _props$rounded === void 0 ? false : _props$rounded,
|
3461
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
3462
|
+
|
3463
|
+
var className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3429
3464
|
'rounded-full': rounded,
|
3430
3465
|
rounded: !rounded,
|
3431
3466
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3436,22 +3471,20 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref)
|
|
3436
3471
|
return null;
|
3437
3472
|
}
|
3438
3473
|
|
3439
|
-
return createButton({
|
3474
|
+
return createButton(_extends({}, otherProps, {
|
3440
3475
|
children: React.createElement(Icon, {
|
3441
3476
|
name: icon,
|
3442
3477
|
className: "m-0 p-0"
|
3443
3478
|
}),
|
3444
3479
|
'data-taco': 'icon-button'
|
3445
|
-
}, className, ref);
|
3480
|
+
}), className, ref);
|
3446
3481
|
});
|
3447
3482
|
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
3452
|
-
|
3453
|
-
} = props;
|
3454
|
-
const className = cn('bg-white relative flex items-center px-4 h-12 shadow-lg z-10', props.className);
|
3483
|
+
var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
3484
|
+
var children = props.children,
|
3485
|
+
state = props.state,
|
3486
|
+
onClose = props.onClose;
|
3487
|
+
var className = cn('bg-white relative flex items-center px-4 h-12 shadow-lg z-10', props.className);
|
3455
3488
|
return React.createElement("div", {
|
3456
3489
|
className: className,
|
3457
3490
|
"data-taco": "banner",
|
@@ -3464,32 +3497,32 @@ const Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3464
3497
|
}) : null);
|
3465
3498
|
});
|
3466
3499
|
|
3467
|
-
|
3468
|
-
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3472
|
-
|
3500
|
+
var _excluded$4 = ["fluid"];
|
3501
|
+
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3502
|
+
var fluid = props.fluid,
|
3503
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
3504
|
+
|
3505
|
+
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3473
3506
|
'cursor-not-allowed opacity-50': props.disabled,
|
3474
3507
|
'focus:yt-focus active:focus:yt-focus': !props.disabled,
|
3475
3508
|
'w-full': fluid
|
3476
3509
|
}, props.className);
|
3477
|
-
|
3510
|
+
var children = otherProps.children; // add a chevron icon to menu buttons
|
3478
3511
|
|
3479
3512
|
if (typeof otherProps.menu === 'function') {
|
3480
|
-
children = Array.isArray(children) ? [
|
3513
|
+
children = Array.isArray(children) ? [].concat(children, [React.createElement(Icon, {
|
3481
3514
|
key: "chevron-down",
|
3482
3515
|
name: "chevron-down"
|
3483
|
-
})] : [children, React.createElement(Icon, {
|
3516
|
+
})]) : [children, React.createElement(Icon, {
|
3484
3517
|
key: "chevron-down",
|
3485
3518
|
name: "chevron-down"
|
3486
3519
|
})];
|
3487
3520
|
}
|
3488
3521
|
|
3489
|
-
return createButton({
|
3490
|
-
children,
|
3522
|
+
return createButton(_extends({}, otherProps, {
|
3523
|
+
children: children,
|
3491
3524
|
'data-taco': 'button'
|
3492
|
-
}, className, ref);
|
3525
|
+
}), className, ref);
|
3493
3526
|
});
|
3494
3527
|
|
3495
3528
|
function useTimer(duration = 0, callback) {
|
@@ -3945,37 +3978,37 @@ const Provider = props => {
|
|
3945
3978
|
const useTaco = () => React.useContext(Context);
|
3946
3979
|
const useLocalization = () => useTaco().localization;
|
3947
3980
|
|
3948
|
-
|
3949
|
-
|
3950
|
-
|
3981
|
+
var _excluded$5 = ["onChange", "value"];
|
3982
|
+
|
3983
|
+
var renderDay = function renderDay(day, modifiers) {
|
3984
|
+
return modifiers.disabled ? React.createElement("span", {
|
3985
|
+
className: "dot"
|
3986
|
+
}) : day.getDate();
|
3987
|
+
};
|
3951
3988
|
|
3952
|
-
|
3953
|
-
|
3989
|
+
var thisYear = /*#__PURE__*/new Date().getFullYear();
|
3990
|
+
var years = [];
|
3954
3991
|
|
3955
|
-
for (
|
3992
|
+
for (var i = thisYear - 10; i <= thisYear + 10; i += 1) {
|
3956
3993
|
years.push(i);
|
3957
3994
|
}
|
3958
3995
|
|
3959
|
-
|
3960
|
-
onMonthChange,
|
3961
|
-
|
3962
|
-
|
3963
|
-
|
3964
|
-
|
3965
|
-
const {
|
3966
|
-
texts: {
|
3967
|
-
calendar: {
|
3968
|
-
actions,
|
3969
|
-
months
|
3970
|
-
}
|
3971
|
-
}
|
3972
|
-
} = useLocalization();
|
3996
|
+
var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
3997
|
+
var onMonthChange = _ref.onMonthChange,
|
3998
|
+
onNextClick = _ref.onNextClick,
|
3999
|
+
onPreviousClick = _ref.onPreviousClick,
|
4000
|
+
_ref$value = _ref.value,
|
4001
|
+
value = _ref$value === void 0 ? new Date() : _ref$value;
|
3973
4002
|
|
3974
|
-
|
3975
|
-
|
3976
|
-
|
3977
|
-
|
3978
|
-
|
4003
|
+
var _useLocalization = useLocalization(),
|
4004
|
+
_useLocalization$text = _useLocalization.texts.calendar,
|
4005
|
+
actions = _useLocalization$text.actions,
|
4006
|
+
months = _useLocalization$text.months;
|
4007
|
+
|
4008
|
+
var handleChange = function handleChange(event) {
|
4009
|
+
var _event$target$form = event.target.form,
|
4010
|
+
year = _event$target$form.year,
|
4011
|
+
month = _event$target$form.month;
|
3979
4012
|
onMonthChange(new Date(year.value, month.value));
|
3980
4013
|
};
|
3981
4014
|
|
@@ -3988,49 +4021,59 @@ const Navbar = /*#__PURE__*/React.memo(({
|
|
3988
4021
|
name: "month",
|
3989
4022
|
onChange: handleChange,
|
3990
4023
|
value: value.getMonth()
|
3991
|
-
}, months.map((month, i)
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
4024
|
+
}, months.map(function (month, i) {
|
4025
|
+
return React.createElement("option", {
|
4026
|
+
key: month,
|
4027
|
+
value: i
|
4028
|
+
}, month);
|
4029
|
+
})), React.createElement("select", {
|
3995
4030
|
className: "h-8 px-2",
|
3996
4031
|
name: "year",
|
3997
4032
|
onChange: handleChange,
|
3998
4033
|
value: value.getFullYear()
|
3999
|
-
}, years.map(
|
4000
|
-
|
4001
|
-
|
4002
|
-
|
4034
|
+
}, years.map(function (year) {
|
4035
|
+
return React.createElement("option", {
|
4036
|
+
key: year,
|
4037
|
+
value: year
|
4038
|
+
}, String(year));
|
4039
|
+
}))), React.createElement("div", null, React.createElement(IconButton, {
|
4003
4040
|
appearance: "discrete",
|
4004
4041
|
icon: "chevron-left",
|
4005
4042
|
"aria-label": actions.previousMonth,
|
4006
|
-
onClick: ()
|
4043
|
+
onClick: function onClick() {
|
4044
|
+
return onPreviousClick();
|
4045
|
+
},
|
4007
4046
|
rounded: true
|
4008
4047
|
}), React.createElement(IconButton, {
|
4009
4048
|
appearance: "discrete",
|
4010
4049
|
icon: "chevron-right",
|
4011
4050
|
"aria-label": actions.nextMonth,
|
4012
|
-
onClick: ()
|
4051
|
+
onClick: function onClick() {
|
4052
|
+
return onNextClick();
|
4053
|
+
},
|
4013
4054
|
rounded: true
|
4014
4055
|
})));
|
4015
4056
|
});
|
4016
|
-
|
4017
|
-
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4021
|
-
|
4022
|
-
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4057
|
+
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4058
|
+
var handleChange = props.onChange,
|
4059
|
+
value = props.value,
|
4060
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
|
4061
|
+
|
4062
|
+
var _useLocalization2 = useLocalization(),
|
4063
|
+
locale = _useLocalization2.locale,
|
4064
|
+
texts = _useLocalization2.texts;
|
4065
|
+
|
4066
|
+
var _React$useState = React.useState(value !== null && value !== void 0 ? value : new Date()),
|
4067
|
+
visibleMonth = _React$useState[0],
|
4068
|
+
setVisibleMonth = _React$useState[1];
|
4069
|
+
|
4070
|
+
React.useEffect(function () {
|
4028
4071
|
if (visibleMonth !== value) {
|
4029
4072
|
setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
|
4030
4073
|
}
|
4031
4074
|
}, [value]);
|
4032
4075
|
|
4033
|
-
|
4076
|
+
var handleDayClick = function handleDayClick(date, modifiers, event) {
|
4034
4077
|
if (modifiers.outside || modifiers.disabled) {
|
4035
4078
|
return;
|
4036
4079
|
}
|
@@ -4038,8 +4081,8 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4038
4081
|
handleChange(date, event);
|
4039
4082
|
};
|
4040
4083
|
|
4041
|
-
|
4042
|
-
|
4084
|
+
var handleCalendarClickToday = function handleCalendarClickToday() {
|
4085
|
+
var today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
|
4043
4086
|
|
4044
4087
|
today.setHours(12);
|
4045
4088
|
today.setMinutes(0);
|
@@ -4047,7 +4090,7 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4047
4090
|
handleChange(today);
|
4048
4091
|
};
|
4049
4092
|
|
4050
|
-
|
4093
|
+
var className = cn('flex bg-white text-xs p-4', otherProps.className);
|
4051
4094
|
return React.createElement("div", {
|
4052
4095
|
"data-taco": "calendar"
|
4053
4096
|
}, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
|
@@ -4058,14 +4101,18 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4058
4101
|
firstDayOfWeek: 1,
|
4059
4102
|
months: texts.calendar.months,
|
4060
4103
|
weekdaysShort: texts.calendar.weekdaysShort,
|
4061
|
-
navbarElement:
|
4062
|
-
|
4063
|
-
|
4064
|
-
|
4104
|
+
navbarElement: function navbarElement(navProps) {
|
4105
|
+
return React.createElement(Navbar, Object.assign({}, navProps, {
|
4106
|
+
onMonthChange: setVisibleMonth,
|
4107
|
+
value: visibleMonth
|
4108
|
+
}));
|
4109
|
+
},
|
4065
4110
|
onDayClick: handleDayClick,
|
4066
4111
|
onMonthChange: setVisibleMonth,
|
4067
4112
|
onTodayButtonClick: handleCalendarClickToday,
|
4068
|
-
captionElement: ()
|
4113
|
+
captionElement: function captionElement() {
|
4114
|
+
return null;
|
4115
|
+
},
|
4069
4116
|
todayButton: texts.calendar.actions.today,
|
4070
4117
|
showOutsideDays: true,
|
4071
4118
|
renderDay: renderDay,
|
@@ -4074,30 +4121,32 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4074
4121
|
})));
|
4075
4122
|
});
|
4076
4123
|
|
4077
|
-
|
4078
|
-
|
4079
|
-
|
4080
|
-
|
4081
|
-
|
4082
|
-
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
4086
|
-
|
4087
|
-
|
4124
|
+
var _excluded$6 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
|
4125
|
+
var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4126
|
+
var checked = props.checked,
|
4127
|
+
highlighted = props.highlighted,
|
4128
|
+
indeterminate = props.indeterminate,
|
4129
|
+
invalid = props.invalid,
|
4130
|
+
label = props.label,
|
4131
|
+
onChange = props.onChange,
|
4132
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
|
4133
|
+
|
4134
|
+
var className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem]', {
|
4088
4135
|
'mr-2': !!label,
|
4089
4136
|
'border-grey-dark text-blue focus:border-blue focus:yt-focus': !props.disabled && !invalid,
|
4090
4137
|
'border-grey text-blue-light cursor-not-allowed': props.disabled,
|
4091
4138
|
'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
|
4092
4139
|
'border-red text-red focus:border-red focus:yt-focus-red': invalid && !props.disabled
|
4093
4140
|
});
|
4094
|
-
|
4141
|
+
var handleChange;
|
4095
4142
|
|
4096
4143
|
if (onChange) {
|
4097
|
-
handleChange =
|
4144
|
+
handleChange = function handleChange(checked) {
|
4145
|
+
return onChange(checked === 'indeterminate' ? false : checked);
|
4146
|
+
};
|
4098
4147
|
}
|
4099
4148
|
|
4100
|
-
|
4149
|
+
var element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
|
4101
4150
|
"data-taco": "checkbox",
|
4102
4151
|
checked: indeterminate ? 'indeterminate' : checked,
|
4103
4152
|
className: className,
|
@@ -4111,7 +4160,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4111
4160
|
})));
|
4112
4161
|
|
4113
4162
|
if (label) {
|
4114
|
-
|
4163
|
+
var labelClassName = cn('flex items-center cursor-pointer', {
|
4115
4164
|
'cursor-not-allowed text-grey-dark': props.disabled
|
4116
4165
|
}, props.className);
|
4117
4166
|
return React.createElement("label", {
|
@@ -4154,22 +4203,21 @@ const getButtonStateClasses = invalid => {
|
|
4154
4203
|
return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
|
4155
4204
|
};
|
4156
4205
|
|
4157
|
-
|
4158
|
-
|
4159
|
-
|
4160
|
-
|
4161
|
-
|
4162
|
-
|
4163
|
-
|
4164
|
-
|
4165
|
-
|
4166
|
-
|
4167
|
-
|
4168
|
-
|
4169
|
-
const className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4206
|
+
var _excluded$7 = ["button", "icon", "highlighted", "invalid", "onKeyDown", "autoFocus"];
|
4207
|
+
var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
4208
|
+
var button = props.button,
|
4209
|
+
icon = props.icon,
|
4210
|
+
invalid = props.invalid,
|
4211
|
+
onKeyDown = props.onKeyDown,
|
4212
|
+
autoFocus = props.autoFocus,
|
4213
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$7);
|
4214
|
+
|
4215
|
+
var inputRef = useProxiedRef(ref);
|
4216
|
+
var hasContainer = button || icon;
|
4217
|
+
var className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4170
4218
|
'pr-8': !!hasContainer
|
4171
4219
|
}, !hasContainer && otherProps.className);
|
4172
|
-
React.useEffect(()
|
4220
|
+
React.useEffect(function () {
|
4173
4221
|
if (autoFocus && inputRef.current) {
|
4174
4222
|
inputRef.current.focus();
|
4175
4223
|
}
|
@@ -4177,10 +4225,10 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4177
4225
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
4178
4226
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
4179
4227
|
|
4180
|
-
|
4228
|
+
var handleKeyDown = function handleKeyDown(event) {
|
4181
4229
|
if (event.key === 'Home' || event.key === 'End') {
|
4182
4230
|
event.preventDefault();
|
4183
|
-
|
4231
|
+
var position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
4184
4232
|
event.currentTarget.setSelectionRange(position, position);
|
4185
4233
|
}
|
4186
4234
|
|
@@ -4189,7 +4237,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4189
4237
|
}
|
4190
4238
|
};
|
4191
4239
|
|
4192
|
-
|
4240
|
+
var input = React.createElement("input", Object.assign({}, otherProps, {
|
4193
4241
|
className: className,
|
4194
4242
|
"data-taco": "input",
|
4195
4243
|
onKeyDown: handleKeyDown,
|
@@ -4197,21 +4245,19 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4197
4245
|
}));
|
4198
4246
|
|
4199
4247
|
if (hasContainer) {
|
4200
|
-
|
4248
|
+
var extra;
|
4201
4249
|
|
4202
4250
|
if (button) {
|
4203
|
-
var _button$props$disable;
|
4251
|
+
var _button$props$disable, _cn;
|
4204
4252
|
|
4205
|
-
|
4206
|
-
|
4207
|
-
[getButtonStateClasses(invalid)]: !props.disabled
|
4208
|
-
}, button.props.className);
|
4253
|
+
var disabled = (_button$props$disable = button.props.disabled) !== null && _button$props$disable !== void 0 ? _button$props$disable : otherProps.disabled;
|
4254
|
+
var buttonClassName = cn('items-center flex justify-center border absolute rounded-l-none rounded-r right-0 h-full focus:rounded focus:outline-none', (_cn = {}, _cn[getButtonStateClasses(invalid)] = !props.disabled, _cn), button.props.className);
|
4209
4255
|
extra = React.cloneElement(button, {
|
4210
4256
|
className: buttonClassName,
|
4211
|
-
disabled
|
4257
|
+
disabled: disabled
|
4212
4258
|
});
|
4213
4259
|
} else if (icon) {
|
4214
|
-
|
4260
|
+
var iconClassName = cn('items-center flex justify-center absolute pointer-events-none mr-1 p-px right-0 w-5 top-1/2 -translate-y-1/2', {
|
4215
4261
|
'text-grey-dark': props.disabled,
|
4216
4262
|
'text-grey-darkest': !props.disabled
|
4217
4263
|
});
|
@@ -4223,7 +4269,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4223
4269
|
});
|
4224
4270
|
}
|
4225
4271
|
|
4226
|
-
|
4272
|
+
var containerClassName = cn('bg-white inline-flex relative rounded w-full', otherProps.className);
|
4227
4273
|
return React.createElement("div", {
|
4228
4274
|
className: containerClassName,
|
4229
4275
|
"data-taco": "input-container"
|
@@ -4997,26 +5043,27 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
4997
5043
|
return dimensions;
|
4998
5044
|
};
|
4999
5045
|
|
5000
|
-
|
5001
|
-
|
5002
|
-
|
5003
|
-
|
5004
|
-
|
5005
|
-
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
|
5019
|
-
|
5046
|
+
var _excluded$8 = ["className", "dialog", "style"];
|
5047
|
+
var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5048
|
+
var externalClassName = props.className,
|
5049
|
+
dialog = props.dialog,
|
5050
|
+
style = props.style,
|
5051
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
|
5052
|
+
|
5053
|
+
var _useCombobox = useCombobox(otherProps, ref),
|
5054
|
+
combobox = _useCombobox.combobox,
|
5055
|
+
button = _useCombobox.button,
|
5056
|
+
input = _useCombobox.input,
|
5057
|
+
popover = _useCombobox.popover,
|
5058
|
+
list = _useCombobox.list;
|
5059
|
+
|
5060
|
+
var internalRef = React.useRef(null);
|
5061
|
+
|
5062
|
+
var _useLocalization = useLocalization(),
|
5063
|
+
texts = _useLocalization.texts;
|
5064
|
+
|
5065
|
+
var selectDimensions = useBoundingClientRectListener(internalRef);
|
5066
|
+
var className = cn('inline-flex relative', {
|
5020
5067
|
'yt-combobox--inline': props.inline
|
5021
5068
|
}, externalClassName);
|
5022
5069
|
return React.createElement("span", {
|
@@ -5035,7 +5082,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5035
5082
|
appearance: "discrete",
|
5036
5083
|
className: "!border-l-0 focus:!border-none focus:!shadow-none active:!border-none",
|
5037
5084
|
icon: popover.open ? 'chevron-up' : 'chevron-down',
|
5038
|
-
onClick: ()
|
5085
|
+
onClick: function onClick() {
|
5039
5086
|
var _input$ref$current;
|
5040
5087
|
|
5041
5088
|
popover.onOpenChange(true);
|
@@ -5046,7 +5093,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5046
5093
|
icon: "list-search",
|
5047
5094
|
disabled: props.readOnly || props.disabled,
|
5048
5095
|
dialog: dialog,
|
5049
|
-
onFocus: event
|
5096
|
+
onFocus: function onFocus(event) {
|
5050
5097
|
var _input$ref$current2;
|
5051
5098
|
|
5052
5099
|
// Prevents the default focus behaviour of showing the tooltip, on parent tooltip element
|
@@ -5059,7 +5106,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5059
5106
|
}) : undefined
|
5060
5107
|
})))), React.createElement(PopoverPrimitive.Content, {
|
5061
5108
|
align: "start",
|
5062
|
-
onOpenAutoFocus: event
|
5109
|
+
onOpenAutoFocus: function onOpenAutoFocus(event) {
|
5063
5110
|
event.preventDefault();
|
5064
5111
|
},
|
5065
5112
|
sideOffset: 4
|
@@ -5369,25 +5416,25 @@ Popover.Trigger = Trigger$1;
|
|
5369
5416
|
Popover.Content = Content$1;
|
5370
5417
|
Popover.Close = Close$1;
|
5371
5418
|
|
5372
|
-
|
5419
|
+
var _excluded$9 = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
5420
|
+
var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5373
5421
|
var _input$disabled;
|
5374
5422
|
|
5375
|
-
|
5376
|
-
|
5377
|
-
|
5378
|
-
|
5379
|
-
|
5380
|
-
|
5381
|
-
|
5382
|
-
|
5383
|
-
|
5384
|
-
|
5385
|
-
|
5386
|
-
|
5387
|
-
|
5388
|
-
|
5389
|
-
|
5390
|
-
const className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5423
|
+
var externalClassName = props.className,
|
5424
|
+
handleReset = props.onReset,
|
5425
|
+
style = props.style,
|
5426
|
+
shortcuts = props.shortcuts,
|
5427
|
+
shortcutsText = props.shortcutsText,
|
5428
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
|
5429
|
+
|
5430
|
+
var _useDatepicker = useDatepicker(otherProps, ref),
|
5431
|
+
calendar = _useDatepicker.calendar,
|
5432
|
+
input = _useDatepicker.input;
|
5433
|
+
|
5434
|
+
var _useLocalization = useLocalization(),
|
5435
|
+
texts = _useLocalization.texts;
|
5436
|
+
|
5437
|
+
var className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5391
5438
|
return React.createElement("span", {
|
5392
5439
|
className: className,
|
5393
5440
|
"data-taco": "datepicker",
|
@@ -5397,37 +5444,40 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
5397
5444
|
"aria-label": texts.datepicker.expand,
|
5398
5445
|
disabled: (_input$disabled = input.disabled) !== null && _input$disabled !== void 0 ? _input$disabled : input.readOnly,
|
5399
5446
|
icon: "calendar"
|
5400
|
-
})), React.createElement(Popover.Content, null, ({
|
5401
|
-
close
|
5402
|
-
|
5403
|
-
|
5404
|
-
|
5405
|
-
|
5406
|
-
|
5407
|
-
|
5408
|
-
|
5409
|
-
|
5410
|
-
|
5411
|
-
|
5412
|
-
|
5413
|
-
|
5414
|
-
|
5415
|
-
|
5416
|
-
|
5417
|
-
|
5418
|
-
|
5419
|
-
|
5420
|
-
|
5421
|
-
|
5422
|
-
|
5423
|
-
|
5424
|
-
|
5425
|
-
|
5426
|
-
|
5427
|
-
|
5428
|
-
|
5429
|
-
|
5430
|
-
|
5447
|
+
})), React.createElement(Popover.Content, null, function (_ref) {
|
5448
|
+
var close = _ref.close;
|
5449
|
+
return React.createElement("div", {
|
5450
|
+
className: "flex -m-3"
|
5451
|
+
}, React.createElement(Calendar$1, Object.assign({}, calendar, {
|
5452
|
+
onChange: function onChange(date, event) {
|
5453
|
+
calendar.onChange(date, event);
|
5454
|
+
close();
|
5455
|
+
},
|
5456
|
+
tabIndex: -1
|
5457
|
+
})), shortcuts && React.createElement("div", {
|
5458
|
+
className: "border-l border-grey-dark flex flex-col"
|
5459
|
+
}, React.createElement("span", {
|
5460
|
+
className: "font-semibold text-xs m-4 flex items-center h-8 w-32 mb-3"
|
5461
|
+
}, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map(function (shortcut, i) {
|
5462
|
+
return React.createElement("li", {
|
5463
|
+
key: i
|
5464
|
+
}, React.createElement("button", {
|
5465
|
+
className: "w-full px-4 py-1 flex items-start hover:bg-grey-light text-xs",
|
5466
|
+
onClick: function onClick(event) {
|
5467
|
+
event.persist();
|
5468
|
+
shortcut.onClick(event);
|
5469
|
+
close();
|
5470
|
+
}
|
5471
|
+
}, shortcut.text));
|
5472
|
+
})), handleReset && React.createElement("button", {
|
5473
|
+
className: "text-blue hover:text-blue-light inline-flex border-none bg-transparent text-xs cursor-pointer mt-auto my-4 mx-auto",
|
5474
|
+
onClick: function onClick(event) {
|
5475
|
+
event.persist();
|
5476
|
+
handleReset(event);
|
5477
|
+
close();
|
5478
|
+
}
|
5479
|
+
}, texts.datepicker.clear)));
|
5480
|
+
}))
|
5431
5481
|
})));
|
5432
5482
|
});
|
5433
5483
|
|
@@ -5670,12 +5720,14 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5670
5720
|
});
|
5671
5721
|
Extra.displayName = 'DialogExtra';
|
5672
5722
|
|
5673
|
-
|
5674
|
-
|
5675
|
-
|
5676
|
-
|
5677
|
-
|
5678
|
-
|
5723
|
+
var _excluded$a = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
|
5724
|
+
|
5725
|
+
var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
5726
|
+
return React.useMemo(function () {
|
5727
|
+
var children = [];
|
5728
|
+
var drawer;
|
5729
|
+
var extra;
|
5730
|
+
React.Children.toArray(initialChildren).forEach(function (child) {
|
5679
5731
|
var _child$type, _child$type2;
|
5680
5732
|
|
5681
5733
|
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
|
@@ -5690,39 +5742,55 @@ const useSeparatedChildren = initialChildren => {
|
|
5690
5742
|
}, [initialChildren]);
|
5691
5743
|
};
|
5692
5744
|
|
5693
|
-
|
5694
|
-
|
5695
|
-
|
5696
|
-
|
5697
|
-
|
5698
|
-
|
5699
|
-
|
5700
|
-
|
5701
|
-
|
5702
|
-
|
5703
|
-
|
5704
|
-
|
5705
|
-
|
5706
|
-
|
5707
|
-
|
5708
|
-
|
5709
|
-
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
|
5718
|
-
|
5719
|
-
|
5720
|
-
|
5721
|
-
|
5722
|
-
|
5723
|
-
|
5724
|
-
|
5725
|
-
|
5745
|
+
var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
5746
|
+
var initialChildren = props.children,
|
5747
|
+
_props$closeOnEscape = props.closeOnEscape,
|
5748
|
+
closeOnEscape = _props$closeOnEscape === void 0 ? true : _props$closeOnEscape,
|
5749
|
+
defaultOpen = props.defaultOpen,
|
5750
|
+
_props$draggable = props.draggable,
|
5751
|
+
draggable = _props$draggable === void 0 ? false : _props$draggable,
|
5752
|
+
onChange = props.onChange,
|
5753
|
+
onClose = props.onClose,
|
5754
|
+
open = props.open,
|
5755
|
+
_props$showCloseButto = props.showCloseButton,
|
5756
|
+
showCloseButton = _props$showCloseButto === void 0 ? true : _props$showCloseButto,
|
5757
|
+
_props$size = props.size,
|
5758
|
+
size = _props$size === void 0 ? 'sm' : _props$size,
|
5759
|
+
trigger = props.trigger,
|
5760
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
|
5761
|
+
|
5762
|
+
var _useSeparatedChildren = useSeparatedChildren(initialChildren),
|
5763
|
+
children = _useSeparatedChildren[0],
|
5764
|
+
drawer = _useSeparatedChildren[1],
|
5765
|
+
extra = _useSeparatedChildren[2];
|
5766
|
+
|
5767
|
+
var _React$useState = React.useState(false),
|
5768
|
+
drawerOpen = _React$useState[0],
|
5769
|
+
setDrawerOpen = _React$useState[1];
|
5770
|
+
|
5771
|
+
var context = React.useMemo(function () {
|
5772
|
+
return {
|
5773
|
+
closeOnEscape: closeOnEscape,
|
5774
|
+
draggable: draggable,
|
5775
|
+
drawer: {
|
5776
|
+
open: drawerOpen,
|
5777
|
+
toggle: function toggle() {
|
5778
|
+
return setDrawerOpen(function (isDrawerOpen) {
|
5779
|
+
return !isDrawerOpen;
|
5780
|
+
});
|
5781
|
+
}
|
5782
|
+
},
|
5783
|
+
elements: {
|
5784
|
+
drawer: drawer,
|
5785
|
+
extra: extra
|
5786
|
+
},
|
5787
|
+
onClose: onClose,
|
5788
|
+
props: otherProps,
|
5789
|
+
showCloseButton: showCloseButton,
|
5790
|
+
size: size,
|
5791
|
+
ref: ref
|
5792
|
+
};
|
5793
|
+
}, [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
|
5726
5794
|
return React.createElement(DialogContext.Provider, {
|
5727
5795
|
value: context
|
5728
5796
|
}, React.createElement(DialogPrimitive.Root, {
|
@@ -5739,18 +5807,19 @@ Dialog.Extra = Extra;
|
|
5739
5807
|
Dialog.Drawer = Drawer;
|
5740
5808
|
Dialog.Close = Close$2;
|
5741
5809
|
|
5742
|
-
|
5743
|
-
|
5744
|
-
|
5745
|
-
|
5746
|
-
|
5747
|
-
|
5748
|
-
|
5749
|
-
|
5750
|
-
|
5810
|
+
var _excluded$b = ["disabled", "children", "invalid", "message"];
|
5811
|
+
var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5812
|
+
var disabled = props.disabled,
|
5813
|
+
children = props.children,
|
5814
|
+
_props$invalid = props.invalid,
|
5815
|
+
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
5816
|
+
message = props.message,
|
5817
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
5818
|
+
|
5819
|
+
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5751
5820
|
'text-grey-dark': disabled
|
5752
5821
|
}, props.className);
|
5753
|
-
|
5822
|
+
var messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
|
5754
5823
|
'text-grey-darkest': !invalid,
|
5755
5824
|
'text-red': invalid,
|
5756
5825
|
'opacity-50': disabled
|
@@ -5765,12 +5834,13 @@ const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5765
5834
|
}, message));
|
5766
5835
|
});
|
5767
5836
|
|
5768
|
-
|
5769
|
-
|
5770
|
-
|
5771
|
-
|
5772
|
-
|
5773
|
-
|
5837
|
+
var _excluded$c = ["horizontal"];
|
5838
|
+
var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
5839
|
+
var _props$horizontal = props.horizontal,
|
5840
|
+
horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
|
5841
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$c);
|
5842
|
+
|
5843
|
+
var className = cn('yt-form', {
|
5774
5844
|
'yt-form--horizontal flex flex-wrap': horizontal
|
5775
5845
|
}, props.className);
|
5776
5846
|
return React.createElement("form", Object.assign({}, otherProps, {
|
@@ -5780,12 +5850,13 @@ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5780
5850
|
}));
|
5781
5851
|
});
|
5782
5852
|
|
5783
|
-
|
5784
|
-
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5788
|
-
|
5853
|
+
var _excluded$d = ["as"];
|
5854
|
+
var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5855
|
+
var _props$as = props.as,
|
5856
|
+
Tag = _props$as === void 0 ? 'span' : _props$as,
|
5857
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
5858
|
+
|
5859
|
+
var className = cn('flex ', props.className);
|
5789
5860
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
5790
5861
|
className: className,
|
5791
5862
|
"data-taco": "group",
|
@@ -5793,18 +5864,19 @@ const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5793
5864
|
}));
|
5794
5865
|
});
|
5795
5866
|
|
5796
|
-
|
5867
|
+
var _excluded$e = ["anchor", "children", "defaultOpen"];
|
5868
|
+
var HangerContext = /*#__PURE__*/React.createContext({
|
5797
5869
|
props: {},
|
5798
5870
|
ref: null
|
5799
5871
|
});
|
5800
|
-
|
5872
|
+
var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
5801
5873
|
var _props$children;
|
5802
5874
|
|
5803
|
-
|
5804
|
-
|
5875
|
+
var context = React.useContext(HangerContext);
|
5876
|
+
var children = props.children;
|
5805
5877
|
|
5806
5878
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5807
|
-
console.warn(
|
5879
|
+
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");
|
5808
5880
|
children = React.createElement("span", null, props.children);
|
5809
5881
|
}
|
5810
5882
|
|
@@ -5814,14 +5886,15 @@ const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
|
5814
5886
|
asChild: true
|
5815
5887
|
}));
|
5816
5888
|
});
|
5817
|
-
|
5818
|
-
|
5819
|
-
|
5820
|
-
|
5821
|
-
|
5822
|
-
const className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent', props.className);
|
5889
|
+
var Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
|
5890
|
+
var context = React.useContext(HangerContext);
|
5891
|
+
|
5892
|
+
var _useLocalization = useLocalization(),
|
5893
|
+
texts = _useLocalization.texts;
|
5823
5894
|
|
5824
|
-
|
5895
|
+
var className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent', props.className);
|
5896
|
+
|
5897
|
+
var handleInteractOutside = function handleInteractOutside(event) {
|
5825
5898
|
event.preventDefault();
|
5826
5899
|
};
|
5827
5900
|
|
@@ -5843,20 +5916,25 @@ const Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, re
|
|
5843
5916
|
onClick: context.props.onClose
|
5844
5917
|
})));
|
5845
5918
|
});
|
5846
|
-
|
5847
|
-
|
5848
|
-
|
5849
|
-
|
5850
|
-
|
5851
|
-
|
5852
|
-
|
5853
|
-
|
5854
|
-
|
5855
|
-
|
5856
|
-
|
5919
|
+
var Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
5920
|
+
var anchor = props.anchor,
|
5921
|
+
children = props.children,
|
5922
|
+
_props$defaultOpen = props.defaultOpen,
|
5923
|
+
defaultOpen = _props$defaultOpen === void 0 ? true : _props$defaultOpen,
|
5924
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$e);
|
5925
|
+
|
5926
|
+
var context = React.useMemo(function () {
|
5927
|
+
return {
|
5928
|
+
props: otherProps,
|
5929
|
+
ref: ref
|
5930
|
+
};
|
5931
|
+
}, [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
5857
5932
|
|
5858
|
-
|
5859
|
-
|
5933
|
+
var _React$useState = React.useState(false),
|
5934
|
+
open = _React$useState[0],
|
5935
|
+
setOpen = _React$useState[1];
|
5936
|
+
|
5937
|
+
React.useEffect(function () {
|
5860
5938
|
if (defaultOpen) {
|
5861
5939
|
setOpen(defaultOpen);
|
5862
5940
|
}
|
@@ -9346,22 +9424,22 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9346
9424
|
}, [ref, callback]);
|
9347
9425
|
};
|
9348
9426
|
|
9349
|
-
|
9350
|
-
|
9351
|
-
|
9352
|
-
|
9353
|
-
|
9354
|
-
|
9355
|
-
|
9427
|
+
var _excluded$f = ["onSearch"];
|
9428
|
+
var SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput(_ref, ref) {
|
9429
|
+
var onSearch = _ref.onSearch,
|
9430
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
9431
|
+
|
9432
|
+
var _useLocalization = useLocalization(),
|
9433
|
+
texts = _useLocalization.texts;
|
9356
9434
|
|
9357
|
-
|
9435
|
+
var handleClick = function handleClick() {
|
9358
9436
|
if (!props.disabled) {
|
9359
9437
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(props.value);
|
9360
9438
|
}
|
9361
9439
|
};
|
9362
9440
|
|
9363
|
-
|
9364
|
-
|
9441
|
+
var handleKeyDown = function handleKeyDown(event) {
|
9442
|
+
var isEnterKeyPressed = event.keyCode === keycode('enter');
|
9365
9443
|
|
9366
9444
|
if (isEnterKeyPressed) {
|
9367
9445
|
handleClick();
|