@economic/taco 0.0.30-alpha.0 → 0.0.31-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 +1 -19
- 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 +7 -5
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Button/Button.js +12 -13
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Button/util.js +1 -1
- package/dist/esm/components/Button/util.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js +56 -71
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- 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/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/Menu/components/Item.js +5 -5
- package/dist/esm/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/index.css +8 -5
- package/dist/index.css +8 -5
- package/dist/taco.cjs.development.js +213 -281
- 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
@@ -36,39 +36,6 @@ 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
|
-
|
72
39
|
function IconAccountPreview(props, svgRef) {
|
73
40
|
return React.createElement("svg", Object.assign({
|
74
41
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3144,14 +3111,12 @@ const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
3144
3111
|
})) : null;
|
3145
3112
|
});
|
3146
3113
|
|
3147
|
-
|
3148
|
-
_excluded2 = ["id", "defaultId", "onChange", "as"];
|
3149
|
-
var AccordionContext = /*#__PURE__*/React__default.createContext({
|
3114
|
+
const AccordionContext = /*#__PURE__*/React__default.createContext({
|
3150
3115
|
as: 'h2'
|
3151
3116
|
});
|
3152
|
-
|
3153
|
-
|
3154
|
-
|
3117
|
+
const StyledTrigger = /*#__PURE__*/React__default.forwardRef(function AccordionStyledTrigger(props, ref) {
|
3118
|
+
const isExpanded = !!props['aria-expanded'];
|
3119
|
+
const className = cn('w-full inline-flex justify-between items-center align-middle', 'focus:rounded-sm focus:border-blue focus:yt-focus', props.className);
|
3155
3120
|
return React__default.createElement("button", Object.assign({}, props, {
|
3156
3121
|
ref: ref,
|
3157
3122
|
className: className
|
@@ -3159,12 +3124,13 @@ var StyledTrigger = /*#__PURE__*/React__default.forwardRef(function AccordionSty
|
|
3159
3124
|
name: isExpanded ? 'chevron-up' : 'chevron-down'
|
3160
3125
|
}));
|
3161
3126
|
});
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
|
3167
|
-
|
3127
|
+
const Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger(props, ref) {
|
3128
|
+
const {
|
3129
|
+
children
|
3130
|
+
} = props;
|
3131
|
+
const {
|
3132
|
+
as: Heading
|
3133
|
+
} = React__default.useContext(AccordionContext);
|
3168
3134
|
return React__default.createElement(AccordionPrimitive.Header, {
|
3169
3135
|
asChild: true
|
3170
3136
|
}, React__default.createElement(Heading, {
|
@@ -3174,35 +3140,34 @@ var Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger(p
|
|
3174
3140
|
asChild: true
|
3175
3141
|
}, React__default.createElement(StyledTrigger, null, children))));
|
3176
3142
|
});
|
3177
|
-
|
3143
|
+
const Content = /*#__PURE__*/React__default.forwardRef(function AccordionContent(props, ref) {
|
3178
3144
|
return React__default.createElement(AccordionPrimitive.Content, Object.assign({}, props, {
|
3179
3145
|
ref: ref
|
3180
3146
|
}));
|
3181
3147
|
});
|
3182
3148
|
|
3183
|
-
|
3184
|
-
|
3185
|
-
|
3186
|
-
|
3149
|
+
const Item = props => {
|
3150
|
+
const {
|
3151
|
+
id,
|
3152
|
+
...otherProps
|
3153
|
+
} = props;
|
3187
3154
|
return React__default.createElement(AccordionPrimitive.Item, Object.assign({}, otherProps, {
|
3188
3155
|
value: id
|
3189
3156
|
}));
|
3190
3157
|
};
|
3191
3158
|
|
3192
|
-
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3204
|
-
}, [as]);
|
3205
|
-
var valueProps;
|
3159
|
+
const Accordion = props => {
|
3160
|
+
const {
|
3161
|
+
id,
|
3162
|
+
defaultId,
|
3163
|
+
onChange,
|
3164
|
+
as = 'h2',
|
3165
|
+
...otherProps
|
3166
|
+
} = props;
|
3167
|
+
const context = React__default.useMemo(() => ({
|
3168
|
+
as
|
3169
|
+
}), [as]);
|
3170
|
+
let valueProps;
|
3206
3171
|
|
3207
3172
|
if (defaultId) {
|
3208
3173
|
valueProps = {
|
@@ -3215,8 +3180,8 @@ var Accordion = function Accordion(props) {
|
|
3215
3180
|
};
|
3216
3181
|
}
|
3217
3182
|
|
3218
|
-
|
3219
|
-
|
3183
|
+
const type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';
|
3184
|
+
const className = cn('divide-y divide-grey', props.className);
|
3220
3185
|
return React__default.createElement(AccordionContext.Provider, {
|
3221
3186
|
value: context
|
3222
3187
|
}, React__default.createElement(AccordionPrimitive.Root, Object.assign({}, otherProps, valueProps, {
|
@@ -3283,19 +3248,20 @@ const getOutlineClasses = state => {
|
|
3283
3248
|
}
|
3284
3249
|
};
|
3285
3250
|
|
3286
|
-
|
3287
|
-
|
3288
|
-
|
3289
|
-
|
3290
|
-
|
3291
|
-
|
3292
|
-
|
3293
|
-
|
3294
|
-
|
3295
|
-
|
3296
|
-
|
3297
|
-
|
3298
|
-
|
3251
|
+
const Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
3252
|
+
const {
|
3253
|
+
children,
|
3254
|
+
compact = false,
|
3255
|
+
outline = false,
|
3256
|
+
state,
|
3257
|
+
...otherProps
|
3258
|
+
} = props;
|
3259
|
+
const className = cn('rounded-full border font-bold text-xs uppercase overflow-hidden whitespace-nowrap inline-flex items-center justify-center h-5', {
|
3260
|
+
[getOutlineClasses(state)]: outline,
|
3261
|
+
[`border-transparent ${getStateClasses(state)}`]: !outline,
|
3262
|
+
'h-2 w-2 min-w-0': compact,
|
3263
|
+
'h-5 py-0 px-[0.354rem]': !compact
|
3264
|
+
}, props.className);
|
3299
3265
|
return React.createElement("span", Object.assign({}, otherProps, {
|
3300
3266
|
"aria-atomic": "true",
|
3301
3267
|
"aria-live": "polite",
|
@@ -3383,7 +3349,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
|
3383
3349
|
});
|
3384
3350
|
|
3385
3351
|
const getButtonClasses = () => {
|
3386
|
-
return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] h-max
|
3352
|
+
return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] h-max inline-flex items-center justify-center border';
|
3387
3353
|
};
|
3388
3354
|
const getAppearanceClasses = (value, icon = false) => {
|
3389
3355
|
switch (value) {
|
@@ -3479,11 +3445,13 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref)
|
|
3479
3445
|
}, className, ref);
|
3480
3446
|
});
|
3481
3447
|
|
3482
|
-
|
3483
|
-
|
3484
|
-
|
3485
|
-
|
3486
|
-
|
3448
|
+
const Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
3449
|
+
const {
|
3450
|
+
children,
|
3451
|
+
state,
|
3452
|
+
onClose
|
3453
|
+
} = props;
|
3454
|
+
const className = cn('bg-white relative flex items-center px-4 h-12 shadow-lg z-10', props.className);
|
3487
3455
|
return React.createElement("div", {
|
3488
3456
|
className: className,
|
3489
3457
|
"data-taco": "banner",
|
@@ -3496,32 +3464,32 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3496
3464
|
}) : null);
|
3497
3465
|
});
|
3498
3466
|
|
3499
|
-
|
3500
|
-
|
3501
|
-
|
3502
|
-
|
3503
|
-
|
3504
|
-
|
3467
|
+
const Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3468
|
+
const {
|
3469
|
+
fluid,
|
3470
|
+
...otherProps
|
3471
|
+
} = props;
|
3472
|
+
const className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3505
3473
|
'cursor-not-allowed opacity-50': props.disabled,
|
3506
3474
|
'focus:yt-focus active:focus:yt-focus': !props.disabled,
|
3507
3475
|
'w-full': fluid
|
3508
3476
|
}, props.className);
|
3509
|
-
|
3477
|
+
let children = otherProps.children; // add a chevron icon to menu buttons
|
3510
3478
|
|
3511
3479
|
if (typeof otherProps.menu === 'function') {
|
3512
|
-
children = Array.isArray(children) ? [
|
3480
|
+
children = Array.isArray(children) ? [...children, React.createElement(Icon, {
|
3513
3481
|
key: "chevron-down",
|
3514
3482
|
name: "chevron-down"
|
3515
|
-
})]
|
3483
|
+
})] : [children, React.createElement(Icon, {
|
3516
3484
|
key: "chevron-down",
|
3517
3485
|
name: "chevron-down"
|
3518
3486
|
})];
|
3519
3487
|
}
|
3520
3488
|
|
3521
|
-
return createButton(
|
3522
|
-
children
|
3489
|
+
return createButton({ ...otherProps,
|
3490
|
+
children,
|
3523
3491
|
'data-taco': 'button'
|
3524
|
-
}
|
3492
|
+
}, className, ref);
|
3525
3493
|
});
|
3526
3494
|
|
3527
3495
|
function useTimer(duration = 0, callback) {
|
@@ -3977,37 +3945,37 @@ const Provider = props => {
|
|
3977
3945
|
const useTaco = () => React.useContext(Context);
|
3978
3946
|
const useLocalization = () => useTaco().localization;
|
3979
3947
|
|
3980
|
-
|
3948
|
+
const renderDay = (day, modifiers) => modifiers.disabled ? React.createElement("span", {
|
3949
|
+
className: "dot"
|
3950
|
+
}) : day.getDate();
|
3981
3951
|
|
3982
|
-
|
3983
|
-
|
3984
|
-
className: "dot"
|
3985
|
-
}) : day.getDate();
|
3986
|
-
};
|
3987
|
-
|
3988
|
-
var thisYear = /*#__PURE__*/new Date().getFullYear();
|
3989
|
-
var years = [];
|
3952
|
+
const thisYear = /*#__PURE__*/new Date().getFullYear();
|
3953
|
+
const years = [];
|
3990
3954
|
|
3991
|
-
for (
|
3955
|
+
for (let i = thisYear - 10; i <= thisYear + 10; i += 1) {
|
3992
3956
|
years.push(i);
|
3993
3957
|
}
|
3994
3958
|
|
3995
|
-
|
3996
|
-
|
3997
|
-
|
3998
|
-
|
3999
|
-
|
4000
|
-
|
4001
|
-
|
4002
|
-
|
4003
|
-
|
4004
|
-
|
4005
|
-
|
3959
|
+
const Navbar = /*#__PURE__*/React.memo(({
|
3960
|
+
onMonthChange,
|
3961
|
+
onNextClick,
|
3962
|
+
onPreviousClick,
|
3963
|
+
value = new Date()
|
3964
|
+
}) => {
|
3965
|
+
const {
|
3966
|
+
texts: {
|
3967
|
+
calendar: {
|
3968
|
+
actions,
|
3969
|
+
months
|
3970
|
+
}
|
3971
|
+
}
|
3972
|
+
} = useLocalization();
|
4006
3973
|
|
4007
|
-
|
4008
|
-
|
4009
|
-
|
4010
|
-
|
3974
|
+
const handleChange = function handleChange(event) {
|
3975
|
+
const {
|
3976
|
+
year,
|
3977
|
+
month
|
3978
|
+
} = event.target.form;
|
4011
3979
|
onMonthChange(new Date(year.value, month.value));
|
4012
3980
|
};
|
4013
3981
|
|
@@ -4020,59 +3988,49 @@ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
|
4020
3988
|
name: "month",
|
4021
3989
|
onChange: handleChange,
|
4022
3990
|
value: value.getMonth()
|
4023
|
-
}, months.map(
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
}, month);
|
4028
|
-
})), React.createElement("select", {
|
3991
|
+
}, months.map((month, i) => React.createElement("option", {
|
3992
|
+
key: month,
|
3993
|
+
value: i
|
3994
|
+
}, month))), React.createElement("select", {
|
4029
3995
|
className: "h-8 px-2",
|
4030
3996
|
name: "year",
|
4031
3997
|
onChange: handleChange,
|
4032
3998
|
value: value.getFullYear()
|
4033
|
-
}, years.map(
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4037
|
-
}, String(year));
|
4038
|
-
}))), React.createElement("div", null, React.createElement(IconButton, {
|
3999
|
+
}, years.map(year => React.createElement("option", {
|
4000
|
+
key: year,
|
4001
|
+
value: year
|
4002
|
+
}, String(year))))), React.createElement("div", null, React.createElement(IconButton, {
|
4039
4003
|
appearance: "discrete",
|
4040
4004
|
icon: "chevron-left",
|
4041
4005
|
"aria-label": actions.previousMonth,
|
4042
|
-
onClick:
|
4043
|
-
return onPreviousClick();
|
4044
|
-
},
|
4006
|
+
onClick: () => onPreviousClick(),
|
4045
4007
|
rounded: true
|
4046
4008
|
}), React.createElement(IconButton, {
|
4047
4009
|
appearance: "discrete",
|
4048
4010
|
icon: "chevron-right",
|
4049
4011
|
"aria-label": actions.nextMonth,
|
4050
|
-
onClick:
|
4051
|
-
return onNextClick();
|
4052
|
-
},
|
4012
|
+
onClick: () => onNextClick(),
|
4053
4013
|
rounded: true
|
4054
4014
|
})));
|
4055
4015
|
});
|
4056
|
-
|
4057
|
-
|
4058
|
-
|
4059
|
-
|
4060
|
-
|
4061
|
-
|
4062
|
-
|
4063
|
-
|
4064
|
-
|
4065
|
-
|
4066
|
-
|
4067
|
-
|
4068
|
-
|
4069
|
-
React.useEffect(function () {
|
4016
|
+
const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4017
|
+
const {
|
4018
|
+
onChange: handleChange,
|
4019
|
+
value,
|
4020
|
+
...otherProps
|
4021
|
+
} = props;
|
4022
|
+
const {
|
4023
|
+
locale,
|
4024
|
+
texts
|
4025
|
+
} = useLocalization();
|
4026
|
+
const [visibleMonth, setVisibleMonth] = React.useState(value !== null && value !== void 0 ? value : new Date());
|
4027
|
+
React.useEffect(() => {
|
4070
4028
|
if (visibleMonth !== value) {
|
4071
4029
|
setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
|
4072
4030
|
}
|
4073
4031
|
}, [value]);
|
4074
4032
|
|
4075
|
-
|
4033
|
+
const handleDayClick = (date, modifiers, event) => {
|
4076
4034
|
if (modifiers.outside || modifiers.disabled) {
|
4077
4035
|
return;
|
4078
4036
|
}
|
@@ -4080,8 +4038,8 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4080
4038
|
handleChange(date, event);
|
4081
4039
|
};
|
4082
4040
|
|
4083
|
-
|
4084
|
-
|
4041
|
+
const handleCalendarClickToday = () => {
|
4042
|
+
const today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
|
4085
4043
|
|
4086
4044
|
today.setHours(12);
|
4087
4045
|
today.setMinutes(0);
|
@@ -4089,7 +4047,7 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4089
4047
|
handleChange(today);
|
4090
4048
|
};
|
4091
4049
|
|
4092
|
-
|
4050
|
+
const className = cn('flex bg-white text-xs p-4', otherProps.className);
|
4093
4051
|
return React.createElement("div", {
|
4094
4052
|
"data-taco": "calendar"
|
4095
4053
|
}, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
|
@@ -4100,18 +4058,14 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4100
4058
|
firstDayOfWeek: 1,
|
4101
4059
|
months: texts.calendar.months,
|
4102
4060
|
weekdaysShort: texts.calendar.weekdaysShort,
|
4103
|
-
navbarElement:
|
4104
|
-
|
4105
|
-
|
4106
|
-
|
4107
|
-
}));
|
4108
|
-
},
|
4061
|
+
navbarElement: navProps => React.createElement(Navbar, Object.assign({}, navProps, {
|
4062
|
+
onMonthChange: setVisibleMonth,
|
4063
|
+
value: visibleMonth
|
4064
|
+
})),
|
4109
4065
|
onDayClick: handleDayClick,
|
4110
4066
|
onMonthChange: setVisibleMonth,
|
4111
4067
|
onTodayButtonClick: handleCalendarClickToday,
|
4112
|
-
captionElement:
|
4113
|
-
return null;
|
4114
|
-
},
|
4068
|
+
captionElement: () => null,
|
4115
4069
|
todayButton: texts.calendar.actions.today,
|
4116
4070
|
showOutsideDays: true,
|
4117
4071
|
renderDay: renderDay,
|
@@ -4120,32 +4074,30 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4120
4074
|
})));
|
4121
4075
|
});
|
4122
4076
|
|
4123
|
-
|
4124
|
-
|
4125
|
-
|
4126
|
-
|
4127
|
-
|
4128
|
-
|
4129
|
-
|
4130
|
-
|
4131
|
-
|
4132
|
-
|
4133
|
-
|
4077
|
+
const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4078
|
+
const {
|
4079
|
+
checked,
|
4080
|
+
highlighted,
|
4081
|
+
indeterminate,
|
4082
|
+
invalid,
|
4083
|
+
label,
|
4084
|
+
onChange,
|
4085
|
+
...otherProps
|
4086
|
+
} = props;
|
4087
|
+
const className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem]', {
|
4134
4088
|
'mr-2': !!label,
|
4135
4089
|
'border-grey-dark text-blue focus:border-blue focus:yt-focus': !props.disabled && !invalid,
|
4136
4090
|
'border-grey text-blue-light cursor-not-allowed': props.disabled,
|
4137
4091
|
'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
|
4138
4092
|
'border-red text-red focus:border-red focus:yt-focus-red': invalid && !props.disabled
|
4139
4093
|
});
|
4140
|
-
|
4094
|
+
let handleChange;
|
4141
4095
|
|
4142
4096
|
if (onChange) {
|
4143
|
-
handleChange =
|
4144
|
-
return onChange(checked === 'indeterminate' ? false : checked);
|
4145
|
-
};
|
4097
|
+
handleChange = checked => onChange(checked === 'indeterminate' ? false : checked);
|
4146
4098
|
}
|
4147
4099
|
|
4148
|
-
|
4100
|
+
const element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
|
4149
4101
|
"data-taco": "checkbox",
|
4150
4102
|
checked: indeterminate ? 'indeterminate' : checked,
|
4151
4103
|
className: className,
|
@@ -4159,7 +4111,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4159
4111
|
})));
|
4160
4112
|
|
4161
4113
|
if (label) {
|
4162
|
-
|
4114
|
+
const labelClassName = cn('flex items-center cursor-pointer', {
|
4163
4115
|
'cursor-not-allowed text-grey-dark': props.disabled
|
4164
4116
|
}, props.className);
|
4165
4117
|
return React.createElement("label", {
|
@@ -5045,27 +4997,26 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5045
4997
|
return dimensions;
|
5046
4998
|
};
|
5047
4999
|
|
5048
|
-
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5053
|
-
|
5054
|
-
|
5055
|
-
|
5056
|
-
|
5057
|
-
|
5058
|
-
|
5059
|
-
|
5060
|
-
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5066
|
-
|
5067
|
-
|
5068
|
-
var className = cn('inline-flex relative', {
|
5000
|
+
const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5001
|
+
const {
|
5002
|
+
className: externalClassName,
|
5003
|
+
dialog,
|
5004
|
+
style,
|
5005
|
+
...otherProps
|
5006
|
+
} = props;
|
5007
|
+
const {
|
5008
|
+
combobox,
|
5009
|
+
button,
|
5010
|
+
input,
|
5011
|
+
popover,
|
5012
|
+
list
|
5013
|
+
} = useCombobox(otherProps, ref);
|
5014
|
+
const internalRef = React.useRef(null);
|
5015
|
+
const {
|
5016
|
+
texts
|
5017
|
+
} = useLocalization();
|
5018
|
+
const selectDimensions = useBoundingClientRectListener(internalRef);
|
5019
|
+
const className = cn('inline-flex relative', {
|
5069
5020
|
'yt-combobox--inline': props.inline
|
5070
5021
|
}, externalClassName);
|
5071
5022
|
return React.createElement("span", {
|
@@ -5084,7 +5035,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5084
5035
|
appearance: "discrete",
|
5085
5036
|
className: "!border-l-0 focus:!border-none focus:!shadow-none active:!border-none",
|
5086
5037
|
icon: popover.open ? 'chevron-up' : 'chevron-down',
|
5087
|
-
onClick:
|
5038
|
+
onClick: () => {
|
5088
5039
|
var _input$ref$current;
|
5089
5040
|
|
5090
5041
|
popover.onOpenChange(true);
|
@@ -5095,7 +5046,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5095
5046
|
icon: "list-search",
|
5096
5047
|
disabled: props.readOnly || props.disabled,
|
5097
5048
|
dialog: dialog,
|
5098
|
-
onFocus:
|
5049
|
+
onFocus: event => {
|
5099
5050
|
var _input$ref$current2;
|
5100
5051
|
|
5101
5052
|
// Prevents the default focus behaviour of showing the tooltip, on parent tooltip element
|
@@ -5108,7 +5059,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5108
5059
|
}) : undefined
|
5109
5060
|
})))), React.createElement(PopoverPrimitive.Content, {
|
5110
5061
|
align: "start",
|
5111
|
-
onOpenAutoFocus:
|
5062
|
+
onOpenAutoFocus: event => {
|
5112
5063
|
event.preventDefault();
|
5113
5064
|
},
|
5114
5065
|
sideOffset: 4
|
@@ -5719,14 +5670,12 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5719
5670
|
});
|
5720
5671
|
Extra.displayName = 'DialogExtra';
|
5721
5672
|
|
5722
|
-
|
5723
|
-
|
5724
|
-
|
5725
|
-
|
5726
|
-
|
5727
|
-
|
5728
|
-
var extra;
|
5729
|
-
React.Children.toArray(initialChildren).forEach(function (child) {
|
5673
|
+
const useSeparatedChildren = initialChildren => {
|
5674
|
+
return React.useMemo(() => {
|
5675
|
+
const children = [];
|
5676
|
+
let drawer;
|
5677
|
+
let extra;
|
5678
|
+
React.Children.toArray(initialChildren).forEach(child => {
|
5730
5679
|
var _child$type, _child$type2;
|
5731
5680
|
|
5732
5681
|
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
|
@@ -5741,55 +5690,39 @@ var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
|
5741
5690
|
}, [initialChildren]);
|
5742
5691
|
};
|
5743
5692
|
|
5744
|
-
|
5745
|
-
|
5746
|
-
|
5747
|
-
|
5748
|
-
|
5749
|
-
|
5750
|
-
|
5751
|
-
|
5752
|
-
|
5753
|
-
|
5754
|
-
|
5755
|
-
|
5756
|
-
|
5757
|
-
|
5758
|
-
|
5759
|
-
|
5760
|
-
|
5761
|
-
|
5762
|
-
|
5763
|
-
|
5764
|
-
|
5765
|
-
|
5766
|
-
|
5767
|
-
|
5768
|
-
|
5769
|
-
|
5770
|
-
|
5771
|
-
|
5772
|
-
|
5773
|
-
|
5774
|
-
|
5775
|
-
|
5776
|
-
|
5777
|
-
return setDrawerOpen(function (isDrawerOpen) {
|
5778
|
-
return !isDrawerOpen;
|
5779
|
-
});
|
5780
|
-
}
|
5781
|
-
},
|
5782
|
-
elements: {
|
5783
|
-
drawer: drawer,
|
5784
|
-
extra: extra
|
5785
|
-
},
|
5786
|
-
onClose: onClose,
|
5787
|
-
props: otherProps,
|
5788
|
-
showCloseButton: showCloseButton,
|
5789
|
-
size: size,
|
5790
|
-
ref: ref
|
5791
|
-
};
|
5792
|
-
}, [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
|
5693
|
+
const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
5694
|
+
const {
|
5695
|
+
children: initialChildren,
|
5696
|
+
closeOnEscape = true,
|
5697
|
+
defaultOpen,
|
5698
|
+
draggable = false,
|
5699
|
+
onChange,
|
5700
|
+
onClose,
|
5701
|
+
open,
|
5702
|
+
showCloseButton = true,
|
5703
|
+
size = 'sm',
|
5704
|
+
trigger,
|
5705
|
+
...otherProps
|
5706
|
+
} = props;
|
5707
|
+
const [children, drawer, extra] = useSeparatedChildren(initialChildren);
|
5708
|
+
const [drawerOpen, setDrawerOpen] = React.useState(false);
|
5709
|
+
const context = React.useMemo(() => ({
|
5710
|
+
closeOnEscape,
|
5711
|
+
draggable,
|
5712
|
+
drawer: {
|
5713
|
+
open: drawerOpen,
|
5714
|
+
toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen)
|
5715
|
+
},
|
5716
|
+
elements: {
|
5717
|
+
drawer,
|
5718
|
+
extra
|
5719
|
+
},
|
5720
|
+
onClose,
|
5721
|
+
props: otherProps,
|
5722
|
+
showCloseButton,
|
5723
|
+
size,
|
5724
|
+
ref
|
5725
|
+
}), [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
|
5793
5726
|
return React.createElement(DialogContext.Provider, {
|
5794
5727
|
value: context
|
5795
5728
|
}, React.createElement(DialogPrimitive.Root, {
|
@@ -5806,19 +5739,18 @@ Dialog.Extra = Extra;
|
|
5806
5739
|
Dialog.Drawer = Drawer;
|
5807
5740
|
Dialog.Close = Close$2;
|
5808
5741
|
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
-
|
5813
|
-
|
5814
|
-
|
5815
|
-
|
5816
|
-
|
5817
|
-
|
5818
|
-
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5742
|
+
const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5743
|
+
const {
|
5744
|
+
disabled,
|
5745
|
+
children,
|
5746
|
+
invalid = false,
|
5747
|
+
message,
|
5748
|
+
...otherProps
|
5749
|
+
} = props;
|
5750
|
+
const className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5819
5751
|
'text-grey-dark': disabled
|
5820
5752
|
}, props.className);
|
5821
|
-
|
5753
|
+
const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
|
5822
5754
|
'text-grey-darkest': !invalid,
|
5823
5755
|
'text-red': invalid,
|
5824
5756
|
'opacity-50': disabled
|
@@ -6386,20 +6318,20 @@ const Icon$1 = ({
|
|
6386
6318
|
const getAppearanceClasses$2 = appearance => {
|
6387
6319
|
switch (appearance) {
|
6388
6320
|
case 'primary':
|
6389
|
-
return 'wcag-blue aria-disabled:text-blue-dark focus:wcag-blue-light';
|
6321
|
+
return 'wcag-blue aria-disabled:text-blue-dark hover:wcag-blue-light focus:wcag-blue-light';
|
6390
6322
|
|
6391
6323
|
case 'danger':
|
6392
|
-
return 'wcag-red aria-disabled:text-red-dark focus:wcag-red-light';
|
6324
|
+
return 'wcag-red aria-disabled:text-red-dark hover:wcag-red-light focus:wcag-red-light';
|
6393
6325
|
|
6394
6326
|
case 'ghost':
|
6395
|
-
return 'text-blue aria-disabled:text-grey focus:wcag-blue';
|
6327
|
+
return 'text-blue aria-disabled:text-grey hover:wcag-blue focus:wcag-blue';
|
6396
6328
|
|
6397
6329
|
case 'discrete':
|
6398
|
-
return 'text-black aria-disabled:text-grey focus:wcag-blue-lightest';
|
6330
|
+
return 'text-black aria-disabled:text-grey hover:wcag-blue-lightest focus:wcag-blue-lightest';
|
6399
6331
|
|
6400
6332
|
case 'default':
|
6401
6333
|
default:
|
6402
|
-
return 'wcag-grey-light aria-disabled:text-grey-darker focus:wcag-grey-dark';
|
6334
|
+
return 'wcag-grey-light aria-disabled:text-grey-darker hover:wcag-grey-dark focus:wcag-grey-dark';
|
6403
6335
|
}
|
6404
6336
|
};
|
6405
6337
|
|