@economic/taco 1.1.10-alpha.0 → 1.1.12-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Icon/components/Numbers.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/esm/components/Card/Card.js +1 -0
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js +1 -0
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js +28 -36
- 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/Icon/components/Numbers.js +18 -0
- package/dist/esm/components/Icon/components/Numbers.js.map +1 -0
- package/dist/esm/components/Icon/components/index.js +2 -0
- package/dist/esm/components/Icon/components/index.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 +16 -34
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Navigation/Navigation.js +35 -44
- package/dist/esm/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +39 -56
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +30 -35
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js +11 -15
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Provider/Provider.js +13 -18
- package/dist/esm/components/Provider/Provider.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +45 -57
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +11 -11
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.js +30 -31
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +12 -19
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +9 -10
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +11 -9
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/components/Toast/Toaster.js +88 -118
- package/dist/esm/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +7 -8
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +45 -51
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Treeview/Treeview.js +26 -36
- package/dist/esm/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/mergeRefs.js +3 -3
- package/dist/esm/utils/mergeRefs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/taco.cjs.development.js +574 -675
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/mergeRefs.d.ts +1 -1
- package/package.json +1 -1
- package/types.json +3 -2
@@ -2076,6 +2076,20 @@ function IconNote(props, svgRef) {
|
|
2076
2076
|
|
2077
2077
|
var Note = /*#__PURE__*/React.forwardRef(IconNote);
|
2078
2078
|
|
2079
|
+
function IconNumbers(props, svgRef) {
|
2080
|
+
return React.createElement("svg", Object.assign({
|
2081
|
+
fill: "none",
|
2082
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2083
|
+
viewBox: "0 0 24 24",
|
2084
|
+
ref: svgRef
|
2085
|
+
}, props), React.createElement("path", {
|
2086
|
+
d: "M3.203 16.625c0 .602.328.96.875.96.555 0 .875-.35.875-.96V7.898c0-.671-.437-1.132-1.078-1.132-.375 0-.742.14-1.273.515L1.125 8.344c-.367.25-.54.508-.54.789 0 .367.282.656.65.656.195 0 .382-.07.663-.266l1.258-.898h.047v8zm4.149.031c0 .516.414.844 1.046.844h5.22c.53 0 .843-.281.843-.734 0-.461-.328-.743-.844-.743H9.648v-.101l2.665-2.953c1.367-1.492 1.812-2.313 1.812-3.36 0-1.742-1.43-2.984-3.422-2.984-2.086 0-3.492 1.375-3.492 2.742 0 .485.312.813.766.813.367 0 .617-.211.804-.657.266-.906.93-1.43 1.82-1.43 1.063 0 1.774.665 1.774 1.657 0 .688-.344 1.313-1.21 2.266l-3.071 3.406c-.563.601-.742.89-.742 1.234zm8.562-1.375c0 1.242 1.555 2.446 3.617 2.446 2.274 0 3.867-1.297 3.867-3.141 0-1.352-.992-2.484-2.296-2.617v-.11c1.078-.171 1.953-1.257 1.953-2.421 0-1.649-1.461-2.813-3.524-2.813-1.984 0-3.414 1.156-3.414 2.39 0 .454.305.766.742.766.344 0 .578-.164.782-.578.367-.742 1.007-1.156 1.851-1.156 1.086 0 1.828.648 1.828 1.61 0 .952-.758 1.64-1.804 1.64h-.813c-.43 0-.726.305-.726.71 0 .423.304.735.726.735h.86c1.25 0 2.085.719 2.085 1.79 0 1.077-.82 1.765-2.093 1.765-.961 0-1.711-.422-2.14-1.188-.25-.414-.47-.57-.782-.57-.422 0-.719.313-.719.742z",
|
2087
|
+
fill: "currentColor"
|
2088
|
+
}));
|
2089
|
+
}
|
2090
|
+
|
2091
|
+
var Numbers = /*#__PURE__*/React.forwardRef(IconNumbers);
|
2092
|
+
|
2079
2093
|
function IconPartnerApi(props, svgRef) {
|
2080
2094
|
return React.createElement("svg", Object.assign({
|
2081
2095
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3122,6 +3136,7 @@ const icons = {
|
|
3122
3136
|
'note-follow-up': NoteFollowUp,
|
3123
3137
|
'note-read': NoteRead,
|
3124
3138
|
note: Note,
|
3139
|
+
numbers: Numbers,
|
3125
3140
|
'partner-api': PartnerApi,
|
3126
3141
|
period: Period,
|
3127
3142
|
'person-change': PersonChange,
|
@@ -3188,17 +3203,17 @@ const icons = {
|
|
3188
3203
|
zoom: Zoom
|
3189
3204
|
};
|
3190
3205
|
|
3191
|
-
|
3192
|
-
var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
3206
|
+
const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
3193
3207
|
var _props$className;
|
3194
3208
|
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3209
|
+
const {
|
3210
|
+
name,
|
3211
|
+
...otherProps
|
3212
|
+
} = props;
|
3213
|
+
const Component = icons[name];
|
3199
3214
|
/* 24x24 _at the base body font_ - must be em so that they scale with font size - tailwind spacing uses rem */
|
3200
3215
|
|
3201
|
-
|
3216
|
+
const className = cn('inline-flex h-[1.715em] w-[1.715em] flex-shrink-0', props.className, {
|
3202
3217
|
'p-[3px]': (_props$className = props.className) === null || _props$className === void 0 ? void 0 : _props$className.includes('rounded-full')
|
3203
3218
|
});
|
3204
3219
|
return Component ? React__default.createElement(Component, Object.assign({}, otherProps, {
|
@@ -3210,7 +3225,7 @@ var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
3210
3225
|
})) : null;
|
3211
3226
|
});
|
3212
3227
|
|
3213
|
-
var _excluded
|
3228
|
+
var _excluded = ["id"],
|
3214
3229
|
_excluded2 = ["id", "defaultId", "onChange", "as"];
|
3215
3230
|
var AccordionContext = /*#__PURE__*/React__default.createContext({
|
3216
3231
|
as: 'h2'
|
@@ -3248,7 +3263,7 @@ var Content = /*#__PURE__*/React__default.forwardRef(function AccordionContent(p
|
|
3248
3263
|
|
3249
3264
|
var Item = function Item(props) {
|
3250
3265
|
var id = props.id,
|
3251
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded
|
3266
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
3252
3267
|
|
3253
3268
|
return React__default.createElement(AccordionPrimitive.Item, Object.assign({}, otherProps, {
|
3254
3269
|
value: id
|
@@ -3303,7 +3318,7 @@ var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
|
|
3303
3318
|
}));
|
3304
3319
|
});
|
3305
3320
|
|
3306
|
-
|
3321
|
+
const VisuallyHidden = /*#__PURE__*/React.forwardRef(function VisuallyHidden(props, ref) {
|
3307
3322
|
return React.createElement("span", Object.assign({}, props, {
|
3308
3323
|
className: "sr-only",
|
3309
3324
|
ref: ref
|
@@ -3349,7 +3364,7 @@ const getOutlineClasses = state => {
|
|
3349
3364
|
}
|
3350
3365
|
};
|
3351
3366
|
|
3352
|
-
var _excluded$
|
3367
|
+
var _excluded$1 = ["children", "compact", "outline", "state"];
|
3353
3368
|
var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
3354
3369
|
var _cn;
|
3355
3370
|
|
@@ -3359,7 +3374,7 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
3359
3374
|
_props$outline = props.outline,
|
3360
3375
|
outline = _props$outline === void 0 ? false : _props$outline,
|
3361
3376
|
state = props.state,
|
3362
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3377
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
3363
3378
|
|
3364
3379
|
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);
|
3365
3380
|
return React.createElement("span", Object.assign({}, otherProps, {
|
@@ -3421,13 +3436,13 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
3421
3436
|
}), React.Children.count(props.children) > 1 ? React.Children.map(props.children, child => typeof child === 'string' ? React.createElement("span", null, child) : child) : props.children);
|
3422
3437
|
});
|
3423
3438
|
|
3424
|
-
|
3425
|
-
|
3426
|
-
|
3427
|
-
|
3428
|
-
|
3429
|
-
|
3430
|
-
|
3439
|
+
const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
3440
|
+
const {
|
3441
|
+
title,
|
3442
|
+
children,
|
3443
|
+
placement,
|
3444
|
+
...otherProps
|
3445
|
+
} = props;
|
3431
3446
|
return React.createElement(TooltipPrimitive.Root, {
|
3432
3447
|
delayDuration: 50
|
3433
3448
|
}, React.createElement(TooltipPrimitive.Trigger, {
|
@@ -3519,14 +3534,13 @@ const createButton = (props, className, ref) => {
|
|
3519
3534
|
return button;
|
3520
3535
|
};
|
3521
3536
|
|
3522
|
-
|
3523
|
-
|
3524
|
-
|
3525
|
-
|
3526
|
-
|
3527
|
-
|
3528
|
-
|
3529
|
-
var className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3537
|
+
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
3538
|
+
const {
|
3539
|
+
icon,
|
3540
|
+
rounded = false,
|
3541
|
+
...otherProps
|
3542
|
+
} = props;
|
3543
|
+
const className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3530
3544
|
'rounded-full': rounded,
|
3531
3545
|
rounded: !rounded,
|
3532
3546
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3537,13 +3551,13 @@ var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
|
3537
3551
|
return null;
|
3538
3552
|
}
|
3539
3553
|
|
3540
|
-
return createButton(
|
3554
|
+
return createButton({ ...otherProps,
|
3541
3555
|
children: React.createElement(Icon, {
|
3542
3556
|
name: icon,
|
3543
3557
|
className: "m-0 p-0"
|
3544
3558
|
}),
|
3545
3559
|
'data-taco': 'icon-button'
|
3546
|
-
}
|
3560
|
+
}, className, ref);
|
3547
3561
|
});
|
3548
3562
|
|
3549
3563
|
var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
@@ -3563,10 +3577,10 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3563
3577
|
}) : null);
|
3564
3578
|
});
|
3565
3579
|
|
3566
|
-
var _excluded$
|
3580
|
+
var _excluded$2 = ["fluid"];
|
3567
3581
|
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3568
3582
|
var fluid = props.fluid,
|
3569
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3583
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
|
3570
3584
|
|
3571
3585
|
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3572
3586
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3637,27 +3651,21 @@ function useTimer(duration = 0, callback) {
|
|
3637
3651
|
};
|
3638
3652
|
}
|
3639
3653
|
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3644
|
-
|
3645
|
-
|
3646
|
-
|
3647
|
-
|
3648
|
-
|
3649
|
-
setVisibility = _React$useState[1];
|
3650
|
-
|
3651
|
-
React__default.useEffect(function () {
|
3652
|
-
var timeout;
|
3654
|
+
const Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
3655
|
+
const {
|
3656
|
+
delay = 500,
|
3657
|
+
label,
|
3658
|
+
...otherProps
|
3659
|
+
} = props;
|
3660
|
+
const [visible, setVisibility] = React__default.useState(!delay);
|
3661
|
+
React__default.useEffect(() => {
|
3662
|
+
let timeout;
|
3653
3663
|
|
3654
3664
|
if (delay) {
|
3655
|
-
timeout = window.setTimeout(
|
3656
|
-
return setVisibility(true);
|
3657
|
-
}, delay);
|
3665
|
+
timeout = window.setTimeout(() => setVisibility(true), delay);
|
3658
3666
|
}
|
3659
3667
|
|
3660
|
-
return
|
3668
|
+
return () => {
|
3661
3669
|
if (timeout) {
|
3662
3670
|
clearTimeout(timeout);
|
3663
3671
|
}
|
@@ -3668,7 +3676,7 @@ var Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, r
|
|
3668
3676
|
return null;
|
3669
3677
|
}
|
3670
3678
|
|
3671
|
-
|
3679
|
+
const className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
3672
3680
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
3673
3681
|
className: className,
|
3674
3682
|
"data-taco": "spinner",
|
@@ -3794,62 +3802,49 @@ const Toast = ({
|
|
3794
3802
|
}));
|
3795
3803
|
};
|
3796
3804
|
|
3797
|
-
|
3798
|
-
|
3799
|
-
var ToastContext = /*#__PURE__*/React.createContext({});
|
3805
|
+
const DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
|
3806
|
+
const ToastContext = /*#__PURE__*/React.createContext({});
|
3800
3807
|
|
3801
|
-
|
3802
|
-
|
3803
|
-
|
3804
|
-
return JSON.stringify(toast.content) === JSON.stringify(content);
|
3805
|
-
});
|
3808
|
+
const insertToastWithoutDuplicates = (currentToasts, id, content, options, close) => {
|
3809
|
+
const nextToasts = [...currentToasts];
|
3810
|
+
const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));
|
3806
3811
|
|
3807
3812
|
if (existingToastIndex > -1) {
|
3808
3813
|
nextToasts[existingToastIndex].lastDuplicateId = id;
|
3809
3814
|
nextToasts[existingToastIndex].lastUpdated = Date.now();
|
3810
3815
|
} else {
|
3811
3816
|
nextToasts.push({
|
3812
|
-
id
|
3817
|
+
id,
|
3813
3818
|
content: typeof content === 'function' ? content(close) : content,
|
3814
|
-
options
|
3819
|
+
options
|
3815
3820
|
});
|
3816
3821
|
}
|
3817
3822
|
|
3818
3823
|
return nextToasts;
|
3819
3824
|
};
|
3820
3825
|
|
3821
|
-
|
3822
|
-
|
3823
|
-
|
3824
|
-
|
3825
|
-
|
3826
|
-
toasts = _React$useState[0],
|
3827
|
-
setToasts = _React$useState[1];
|
3826
|
+
const ToastProvider = ({
|
3827
|
+
children,
|
3828
|
+
...props
|
3829
|
+
}) => {
|
3830
|
+
const [toasts, setToasts] = React.useState([]);
|
3828
3831
|
|
3829
|
-
|
3830
|
-
setToasts(
|
3831
|
-
return currentToasts.filter(function (toast) {
|
3832
|
-
return toast.id !== id;
|
3833
|
-
});
|
3834
|
-
});
|
3832
|
+
const handleClose = id => {
|
3833
|
+
setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));
|
3835
3834
|
}; // memoize (useCallback) this function,
|
3836
3835
|
// it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children
|
3837
3836
|
|
3838
3837
|
|
3839
|
-
|
3840
|
-
|
3838
|
+
const toaster = React.useCallback((content, options) => {
|
3839
|
+
const id = uuid.v4();
|
3841
3840
|
|
3842
|
-
|
3843
|
-
return handleClose(id);
|
3844
|
-
};
|
3841
|
+
const close = () => handleClose(id);
|
3845
3842
|
|
3846
|
-
setToasts(
|
3847
|
-
return insertToastWithoutDuplicates(currentToasts, id, content, options, close);
|
3848
|
-
});
|
3843
|
+
setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));
|
3849
3844
|
|
3850
|
-
|
3851
|
-
setToasts(
|
3852
|
-
|
3845
|
+
const update = (content, options) => {
|
3846
|
+
setToasts(currentToasts => {
|
3847
|
+
const nextToasts = currentToasts.filter(toast => {
|
3853
3848
|
if (toast.lastDuplicateId) {
|
3854
3849
|
return toast.lastDuplicateId !== id;
|
3855
3850
|
}
|
@@ -3860,80 +3855,70 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
3860
3855
|
});
|
3861
3856
|
};
|
3862
3857
|
|
3863
|
-
|
3864
|
-
update(content,
|
3865
|
-
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3866
|
-
|
3858
|
+
const success = (content, options) => {
|
3859
|
+
update(content, {
|
3860
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT,
|
3861
|
+
...options,
|
3867
3862
|
type: 'success'
|
3868
|
-
})
|
3863
|
+
});
|
3869
3864
|
};
|
3870
3865
|
|
3871
|
-
|
3872
|
-
update(content,
|
3866
|
+
const error = (content, options) => {
|
3867
|
+
update(content, { ...options,
|
3873
3868
|
type: 'error'
|
3874
|
-
})
|
3869
|
+
});
|
3875
3870
|
};
|
3876
3871
|
|
3877
|
-
|
3878
|
-
update(content,
|
3872
|
+
const warning = (content, options) => {
|
3873
|
+
update(content, { ...options,
|
3879
3874
|
type: 'warning'
|
3880
|
-
})
|
3875
|
+
});
|
3881
3876
|
};
|
3882
3877
|
|
3883
|
-
|
3884
|
-
update(content,
|
3878
|
+
const information = (content, options) => {
|
3879
|
+
update(content, { ...options,
|
3885
3880
|
type: 'information'
|
3886
|
-
})
|
3881
|
+
});
|
3887
3882
|
};
|
3888
3883
|
|
3889
|
-
|
3890
|
-
update(content,
|
3884
|
+
const loading = (content, options) => {
|
3885
|
+
update(content, { ...options,
|
3891
3886
|
type: 'loading'
|
3892
|
-
})
|
3887
|
+
});
|
3893
3888
|
};
|
3894
3889
|
|
3895
3890
|
return {
|
3896
|
-
success
|
3897
|
-
error
|
3898
|
-
warning
|
3899
|
-
information
|
3900
|
-
loading
|
3901
|
-
close
|
3891
|
+
success,
|
3892
|
+
error,
|
3893
|
+
warning,
|
3894
|
+
information,
|
3895
|
+
loading,
|
3896
|
+
close
|
3902
3897
|
};
|
3903
3898
|
}, []); // no need to rebind these every render, do them once in an effect
|
3904
3899
|
|
3905
|
-
React.useEffect(
|
3906
|
-
toaster.success =
|
3907
|
-
|
3908
|
-
|
3909
|
-
|
3910
|
-
|
3911
|
-
}));
|
3912
|
-
};
|
3900
|
+
React.useEffect(() => {
|
3901
|
+
toaster.success = (content, options) => toaster(content, {
|
3902
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT,
|
3903
|
+
...options,
|
3904
|
+
type: 'success'
|
3905
|
+
});
|
3913
3906
|
|
3914
|
-
toaster.error =
|
3915
|
-
|
3916
|
-
|
3917
|
-
}));
|
3918
|
-
};
|
3907
|
+
toaster.error = (content, options) => toaster(content, { ...options,
|
3908
|
+
type: 'error'
|
3909
|
+
});
|
3919
3910
|
|
3920
|
-
toaster.warning =
|
3921
|
-
|
3922
|
-
|
3923
|
-
}));
|
3924
|
-
};
|
3911
|
+
toaster.warning = (content, options) => toaster(content, { ...options,
|
3912
|
+
type: 'warning'
|
3913
|
+
});
|
3925
3914
|
|
3926
|
-
toaster.information =
|
3927
|
-
|
3928
|
-
|
3929
|
-
}));
|
3930
|
-
};
|
3915
|
+
toaster.information = (content, options) => toaster(content, { ...options,
|
3916
|
+
type: 'information'
|
3917
|
+
});
|
3931
3918
|
|
3932
|
-
toaster.loading =
|
3933
|
-
|
3934
|
-
|
3935
|
-
}));
|
3936
|
-
};
|
3919
|
+
toaster.loading = (content, options) => toaster(content, { ...options,
|
3920
|
+
type: 'loading'
|
3921
|
+
});
|
3937
3922
|
}, []);
|
3938
3923
|
return React.createElement(ToastContext.Provider, Object.assign({}, props, {
|
3939
3924
|
value: toaster
|
@@ -3943,43 +3928,37 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
3943
3928
|
role: "log"
|
3944
3929
|
}, React.createElement(framerMotion.AnimatePresence, {
|
3945
3930
|
initial: false
|
3946
|
-
}, toasts.map(
|
3947
|
-
|
3948
|
-
|
3931
|
+
}, toasts.map(toast => React.createElement(framerMotion.motion.div, {
|
3932
|
+
key: toast.id,
|
3933
|
+
transition: {
|
3934
|
+
type: 'spring',
|
3935
|
+
damping: 20,
|
3936
|
+
stiffness: 300
|
3937
|
+
},
|
3938
|
+
initial: {
|
3939
|
+
opacity: 0,
|
3940
|
+
y: 10,
|
3941
|
+
scale: 0.5
|
3942
|
+
},
|
3943
|
+
animate: {
|
3944
|
+
opacity: 1,
|
3945
|
+
y: 0,
|
3946
|
+
scale: 1
|
3947
|
+
},
|
3948
|
+
exit: {
|
3949
|
+
opacity: 0,
|
3950
|
+
scale: 0.5,
|
3949
3951
|
transition: {
|
3950
|
-
|
3951
|
-
damping: 20,
|
3952
|
-
stiffness: 300
|
3953
|
-
},
|
3954
|
-
initial: {
|
3955
|
-
opacity: 0,
|
3956
|
-
y: 10,
|
3957
|
-
scale: 0.5
|
3958
|
-
},
|
3959
|
-
animate: {
|
3960
|
-
opacity: 1,
|
3961
|
-
y: 0,
|
3962
|
-
scale: 1
|
3963
|
-
},
|
3964
|
-
exit: {
|
3965
|
-
opacity: 0,
|
3966
|
-
scale: 0.5,
|
3967
|
-
transition: {
|
3968
|
-
duration: 0.2
|
3969
|
-
}
|
3952
|
+
duration: 0.2
|
3970
3953
|
}
|
3971
|
-
}
|
3972
|
-
|
3973
|
-
|
3974
|
-
|
3975
|
-
})));
|
3976
|
-
}))));
|
3977
|
-
};
|
3978
|
-
var useToast = function useToast() {
|
3979
|
-
return React.useContext(ToastContext);
|
3954
|
+
}
|
3955
|
+
}, React.createElement(Toast, Object.assign({}, toast, {
|
3956
|
+
onClose: () => handleClose(toast.id)
|
3957
|
+
})))))));
|
3980
3958
|
};
|
3959
|
+
const useToast = () => React.useContext(ToastContext);
|
3981
3960
|
|
3982
|
-
|
3961
|
+
const defaultLocalisationTexts = {
|
3983
3962
|
calendar: {
|
3984
3963
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
3985
3964
|
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
@@ -4054,37 +4033,32 @@ var defaultLocalisationTexts = {
|
|
4054
4033
|
inputLabel: 'Search...'
|
4055
4034
|
}
|
4056
4035
|
};
|
4057
|
-
|
4036
|
+
const defaultLocalizationContext = {
|
4058
4037
|
locale: 'en-GB',
|
4059
4038
|
texts: defaultLocalisationTexts,
|
4060
4039
|
formatting: {
|
4061
4040
|
date: 'dd.mm.yy'
|
4062
4041
|
}
|
4063
4042
|
};
|
4064
|
-
|
4043
|
+
const Context = /*#__PURE__*/React.createContext({
|
4065
4044
|
localization: defaultLocalizationContext
|
4066
4045
|
});
|
4067
|
-
|
4068
|
-
|
4069
|
-
|
4070
|
-
|
4071
|
-
|
4072
|
-
|
4073
|
-
|
4074
|
-
|
4075
|
-
}, [localization]);
|
4046
|
+
const Provider = props => {
|
4047
|
+
const {
|
4048
|
+
children,
|
4049
|
+
localization = defaultLocalizationContext
|
4050
|
+
} = props;
|
4051
|
+
const value = React.useMemo(() => ({
|
4052
|
+
localization
|
4053
|
+
}), [localization]);
|
4076
4054
|
return React.createElement(Context.Provider, {
|
4077
4055
|
value: value
|
4078
4056
|
}, React.createElement(ToastProvider, null, children));
|
4079
4057
|
};
|
4080
|
-
|
4081
|
-
|
4082
|
-
};
|
4083
|
-
var useLocalization = function useLocalization() {
|
4084
|
-
return useTaco().localization;
|
4085
|
-
};
|
4058
|
+
const useTaco = () => React.useContext(Context);
|
4059
|
+
const useLocalization = () => useTaco().localization;
|
4086
4060
|
|
4087
|
-
var _excluded$
|
4061
|
+
var _excluded$3 = ["onChange", "value"];
|
4088
4062
|
|
4089
4063
|
var renderDay = function renderDay(day, modifiers) {
|
4090
4064
|
return modifiers.disabled ? React.createElement("span", {
|
@@ -4163,7 +4137,7 @@ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
|
4163
4137
|
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4164
4138
|
var handleChange = props.onChange,
|
4165
4139
|
value = props.value,
|
4166
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4140
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
4167
4141
|
|
4168
4142
|
var _useLocalization2 = useLocalization(),
|
4169
4143
|
locale = _useLocalization2.locale,
|
@@ -4227,7 +4201,7 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4227
4201
|
})));
|
4228
4202
|
});
|
4229
4203
|
|
4230
|
-
var _excluded$
|
4204
|
+
var _excluded$4 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
|
4231
4205
|
var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4232
4206
|
var checked = props.checked,
|
4233
4207
|
highlighted = props.highlighted,
|
@@ -4235,7 +4209,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4235
4209
|
invalid = props.invalid,
|
4236
4210
|
label = props.label,
|
4237
4211
|
onChange = props.onChange,
|
4238
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4212
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
4239
4213
|
|
4240
4214
|
var className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem] focus:yt-focus', //hover:shadow-[0_0_0_1px_rgba(235,235,235,1)]
|
4241
4215
|
props.className, {
|
@@ -4309,21 +4283,22 @@ const getButtonStateClasses = invalid => {
|
|
4309
4283
|
return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
|
4310
4284
|
};
|
4311
4285
|
|
4312
|
-
|
4313
|
-
|
4314
|
-
|
4315
|
-
|
4316
|
-
|
4317
|
-
|
4318
|
-
|
4319
|
-
|
4320
|
-
|
4321
|
-
|
4322
|
-
|
4323
|
-
|
4286
|
+
const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
4287
|
+
const {
|
4288
|
+
button,
|
4289
|
+
icon,
|
4290
|
+
highlighted,
|
4291
|
+
invalid,
|
4292
|
+
onKeyDown,
|
4293
|
+
autoFocus,
|
4294
|
+
...otherProps
|
4295
|
+
} = props;
|
4296
|
+
const inputRef = useProxiedRef(ref);
|
4297
|
+
const hasContainer = button || icon;
|
4298
|
+
const className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4324
4299
|
'pr-8': !!hasContainer
|
4325
4300
|
}, !hasContainer && otherProps.className);
|
4326
|
-
React.useEffect(
|
4301
|
+
React.useEffect(() => {
|
4327
4302
|
if (autoFocus && inputRef.current) {
|
4328
4303
|
inputRef.current.focus();
|
4329
4304
|
}
|
@@ -4331,10 +4306,10 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4331
4306
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
4332
4307
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
4333
4308
|
|
4334
|
-
|
4309
|
+
const handleKeyDown = event => {
|
4335
4310
|
if (!event.shiftKey && (event.key === 'Home' || event.key === 'End')) {
|
4336
4311
|
event.preventDefault();
|
4337
|
-
|
4312
|
+
const position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
4338
4313
|
event.currentTarget.setSelectionRange(position, position);
|
4339
4314
|
}
|
4340
4315
|
|
@@ -4343,7 +4318,7 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4343
4318
|
}
|
4344
4319
|
};
|
4345
4320
|
|
4346
|
-
|
4321
|
+
const input = React.createElement("input", Object.assign({}, otherProps, {
|
4347
4322
|
className: className,
|
4348
4323
|
"data-taco": "input",
|
4349
4324
|
onKeyDown: handleKeyDown,
|
@@ -4351,19 +4326,19 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4351
4326
|
}));
|
4352
4327
|
|
4353
4328
|
if (hasContainer) {
|
4354
|
-
|
4329
|
+
let extra;
|
4355
4330
|
|
4356
4331
|
if (button) {
|
4357
|
-
|
4358
|
-
|
4359
|
-
|
4360
|
-
|
4332
|
+
const disabled = button.props.disabled || otherProps.disabled;
|
4333
|
+
const buttonClassName = cn('items-center flex justify-center border absolute rounded-l-none rounded-r right-0 h-full focus:rounded focus:outline-none', {
|
4334
|
+
[getButtonStateClasses(invalid)]: !props.disabled
|
4335
|
+
}, button.props.className);
|
4361
4336
|
extra = React.cloneElement(button, {
|
4362
4337
|
className: buttonClassName,
|
4363
|
-
disabled
|
4338
|
+
disabled
|
4364
4339
|
});
|
4365
4340
|
} else if (icon) {
|
4366
|
-
|
4341
|
+
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', {
|
4367
4342
|
'text-grey-dark': props.disabled,
|
4368
4343
|
'text-grey-darkest': !props.disabled
|
4369
4344
|
});
|
@@ -4375,7 +4350,7 @@ var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4375
4350
|
});
|
4376
4351
|
}
|
4377
4352
|
|
4378
|
-
|
4353
|
+
const containerClassName = cn('bg-white inline-flex relative rounded w-full', otherProps.className);
|
4379
4354
|
return React.createElement("div", {
|
4380
4355
|
className: containerClassName,
|
4381
4356
|
"data-taco": "input-container"
|
@@ -5146,12 +5121,12 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5146
5121
|
return dimensions;
|
5147
5122
|
};
|
5148
5123
|
|
5149
|
-
var _excluded$
|
5124
|
+
var _excluded$5 = ["className", "dialog", "style"];
|
5150
5125
|
var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5151
5126
|
var externalClassName = props.className,
|
5152
5127
|
dialog = props.dialog,
|
5153
5128
|
style = props.style,
|
5154
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5129
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
|
5155
5130
|
|
5156
5131
|
var _useCombobox = useCombobox(otherProps, ref),
|
5157
5132
|
combobox = _useCombobox.combobox,
|
@@ -5193,6 +5168,7 @@ var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5193
5168
|
},
|
5194
5169
|
tabIndex: -1
|
5195
5170
|
}) : dialog ? React.createElement(IconButton, {
|
5171
|
+
"aria-label": texts.combobox.tooltip,
|
5196
5172
|
icon: "list-search",
|
5197
5173
|
disabled: props.readOnly || props.disabled,
|
5198
5174
|
dialog: dialog,
|
@@ -5432,8 +5408,8 @@ const UnstyledContent = /*#__PURE__*/React.forwardRef(function PopoverContent(pr
|
|
5432
5408
|
});
|
5433
5409
|
|
5434
5410
|
function mergeRefs(refs) {
|
5435
|
-
return value
|
5436
|
-
refs.forEach(ref
|
5411
|
+
return function (value) {
|
5412
|
+
refs.forEach(function (ref) {
|
5437
5413
|
if (typeof ref === 'function') {
|
5438
5414
|
ref(value);
|
5439
5415
|
} else if (ref != null) {
|
@@ -5443,19 +5419,18 @@ function mergeRefs(refs) {
|
|
5443
5419
|
};
|
5444
5420
|
}
|
5445
5421
|
|
5446
|
-
|
5447
|
-
var PopoverContext = /*#__PURE__*/React.createContext({
|
5422
|
+
const PopoverContext = /*#__PURE__*/React.createContext({
|
5448
5423
|
props: {},
|
5449
5424
|
ref: null
|
5450
5425
|
});
|
5451
|
-
|
5426
|
+
const Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, ref) {
|
5452
5427
|
var _props$children;
|
5453
5428
|
|
5454
|
-
|
5455
|
-
|
5429
|
+
const context = React.useContext(PopoverContext);
|
5430
|
+
let children = props.children;
|
5456
5431
|
|
5457
5432
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5458
|
-
console.warn(
|
5433
|
+
console.warn(`Popover.Trigger 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`);
|
5459
5434
|
children = React.createElement("span", null, props.children);
|
5460
5435
|
}
|
5461
5436
|
|
@@ -5465,22 +5440,22 @@ var Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, ref
|
|
5465
5440
|
asChild: true
|
5466
5441
|
}));
|
5467
5442
|
});
|
5468
|
-
|
5469
|
-
|
5470
|
-
|
5471
|
-
|
5472
|
-
|
5443
|
+
const RenderPropWrapper = /*#__PURE__*/React.forwardRef(function RenderPropWrapper({
|
5444
|
+
children,
|
5445
|
+
onClick
|
5446
|
+
}, ref) {
|
5447
|
+
const close = () => {
|
5473
5448
|
onClick(new CustomEvent('hide'));
|
5474
5449
|
};
|
5475
5450
|
|
5476
5451
|
return children({
|
5477
|
-
close
|
5478
|
-
ref
|
5452
|
+
close,
|
5453
|
+
ref
|
5479
5454
|
});
|
5480
5455
|
});
|
5481
|
-
|
5482
|
-
|
5483
|
-
|
5456
|
+
const Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, ref) {
|
5457
|
+
const className = cn('bg-white focus:border-blue-light', props.className);
|
5458
|
+
let output;
|
5484
5459
|
|
5485
5460
|
if (typeof props.children === 'function') {
|
5486
5461
|
output = React.createElement(PopoverPrimitive.Close, {
|
@@ -5498,23 +5473,20 @@ var Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, ref
|
|
5498
5473
|
className: "text-white"
|
5499
5474
|
}));
|
5500
5475
|
});
|
5501
|
-
|
5502
|
-
|
5503
|
-
|
5504
|
-
|
5505
|
-
|
5506
|
-
|
5507
|
-
|
5508
|
-
|
5509
|
-
|
5510
|
-
|
5511
|
-
|
5512
|
-
|
5513
|
-
|
5514
|
-
|
5515
|
-
ref: ref
|
5516
|
-
};
|
5517
|
-
}, [otherProps]);
|
5476
|
+
const Close$1 = /*#__PURE__*/React.forwardRef((props, ref) => React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
|
5477
|
+
ref: ref,
|
5478
|
+
asChild: true
|
5479
|
+
})));
|
5480
|
+
const Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
5481
|
+
const {
|
5482
|
+
children,
|
5483
|
+
trigger,
|
5484
|
+
...otherProps
|
5485
|
+
} = props;
|
5486
|
+
const context = React.useMemo(() => ({
|
5487
|
+
props: otherProps,
|
5488
|
+
ref
|
5489
|
+
}), [otherProps]);
|
5518
5490
|
return React.createElement(PopoverContext.Provider, {
|
5519
5491
|
value: context
|
5520
5492
|
}, React.createElement(PopoverPrimitive.Root, null, trigger && React.createElement(Trigger$1, null, trigger), children));
|
@@ -5523,14 +5495,14 @@ Popover.Trigger = Trigger$1;
|
|
5523
5495
|
Popover.Content = Content$1;
|
5524
5496
|
Popover.Close = Close$1;
|
5525
5497
|
|
5526
|
-
var _excluded$
|
5498
|
+
var _excluded$6 = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
5527
5499
|
var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5528
5500
|
var externalClassName = props.className,
|
5529
5501
|
handleReset = props.onReset,
|
5530
5502
|
style = props.style,
|
5531
5503
|
shortcuts = props.shortcuts,
|
5532
5504
|
shortcutsText = props.shortcutsText,
|
5533
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5505
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
|
5534
5506
|
|
5535
5507
|
var _useDatepicker = useDatepicker(otherProps, ref),
|
5536
5508
|
calendar = _useDatepicker.calendar,
|
@@ -5825,7 +5797,7 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5825
5797
|
});
|
5826
5798
|
Extra.displayName = 'DialogExtra';
|
5827
5799
|
|
5828
|
-
var _excluded$
|
5800
|
+
var _excluded$7 = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
|
5829
5801
|
|
5830
5802
|
var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
5831
5803
|
return React.useMemo(function () {
|
@@ -5862,7 +5834,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
|
5862
5834
|
_props$size = props.size,
|
5863
5835
|
size = _props$size === void 0 ? 'sm' : _props$size,
|
5864
5836
|
trigger = props.trigger,
|
5865
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5837
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$7);
|
5866
5838
|
|
5867
5839
|
var _useSeparatedChildren = useSeparatedChildren(initialChildren),
|
5868
5840
|
children = _useSeparatedChildren[0],
|
@@ -5912,14 +5884,14 @@ Dialog.Extra = Extra;
|
|
5912
5884
|
Dialog.Drawer = Drawer;
|
5913
5885
|
Dialog.Close = Close$2;
|
5914
5886
|
|
5915
|
-
var _excluded$
|
5887
|
+
var _excluded$8 = ["disabled", "children", "invalid", "message"];
|
5916
5888
|
var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5917
5889
|
var disabled = props.disabled,
|
5918
5890
|
children = props.children,
|
5919
5891
|
_props$invalid = props.invalid,
|
5920
5892
|
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
5921
5893
|
message = props.message,
|
5922
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5894
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
|
5923
5895
|
|
5924
5896
|
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5925
5897
|
'text-grey-dark': disabled
|
@@ -5939,13 +5911,12 @@ var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5939
5911
|
}, message));
|
5940
5912
|
});
|
5941
5913
|
|
5942
|
-
|
5943
|
-
|
5944
|
-
|
5945
|
-
|
5946
|
-
|
5947
|
-
|
5948
|
-
var className = cn('yt-form', {
|
5914
|
+
const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
5915
|
+
const {
|
5916
|
+
horizontal = false,
|
5917
|
+
...otherProps
|
5918
|
+
} = props;
|
5919
|
+
const className = cn('yt-form', {
|
5949
5920
|
'yt-form--horizontal flex flex-wrap': horizontal
|
5950
5921
|
}, props.className);
|
5951
5922
|
return React.createElement("form", Object.assign({}, otherProps, {
|
@@ -5955,11 +5926,11 @@ var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5955
5926
|
}));
|
5956
5927
|
});
|
5957
5928
|
|
5958
|
-
var _excluded$
|
5929
|
+
var _excluded$9 = ["as"];
|
5959
5930
|
var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5960
5931
|
var _props$as = props.as,
|
5961
5932
|
Tag = _props$as === void 0 ? 'span' : _props$as,
|
5962
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5933
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
|
5963
5934
|
|
5964
5935
|
var className = cn('flex ', props.className);
|
5965
5936
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
@@ -5969,19 +5940,18 @@ var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5969
5940
|
}));
|
5970
5941
|
});
|
5971
5942
|
|
5972
|
-
|
5973
|
-
var HangerContext = /*#__PURE__*/React.createContext({
|
5943
|
+
const HangerContext = /*#__PURE__*/React.createContext({
|
5974
5944
|
props: {},
|
5975
5945
|
ref: null
|
5976
5946
|
});
|
5977
|
-
|
5947
|
+
const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
5978
5948
|
var _props$children;
|
5979
5949
|
|
5980
|
-
|
5981
|
-
|
5950
|
+
const context = React.useContext(HangerContext);
|
5951
|
+
let children = props.children;
|
5982
5952
|
|
5983
5953
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5984
|
-
console.warn(
|
5954
|
+
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`);
|
5985
5955
|
children = React.createElement("span", null, props.children);
|
5986
5956
|
}
|
5987
5957
|
|
@@ -5991,22 +5961,21 @@ var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
|
5991
5961
|
asChild: true
|
5992
5962
|
}));
|
5993
5963
|
});
|
5994
|
-
|
5995
|
-
|
5964
|
+
const Title$1 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
|
5965
|
+
const className = cn('mb-1 text-base font-bold flex w-full', props.className);
|
5996
5966
|
return React.createElement("span", Object.assign({}, props, {
|
5997
5967
|
className: className,
|
5998
5968
|
ref: ref
|
5999
5969
|
}));
|
6000
5970
|
});
|
6001
|
-
|
6002
|
-
|
6003
|
-
|
6004
|
-
|
6005
|
-
|
6006
|
-
|
6007
|
-
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);
|
5971
|
+
const Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
|
5972
|
+
const context = React.useContext(HangerContext);
|
5973
|
+
const {
|
5974
|
+
texts
|
5975
|
+
} = useLocalization();
|
5976
|
+
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);
|
6008
5977
|
|
6009
|
-
|
5978
|
+
const handleInteractOutside = event => {
|
6010
5979
|
event.preventDefault();
|
6011
5980
|
};
|
6012
5981
|
|
@@ -6028,25 +5997,20 @@ var Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref)
|
|
6028
5997
|
onClick: context.props.onClose
|
6029
5998
|
})));
|
6030
5999
|
});
|
6031
|
-
|
6032
|
-
|
6033
|
-
|
6034
|
-
|
6035
|
-
|
6036
|
-
|
6037
|
-
|
6038
|
-
|
6039
|
-
|
6040
|
-
|
6041
|
-
|
6042
|
-
};
|
6043
|
-
}, [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
6044
|
-
|
6045
|
-
var _React$useState = React.useState(false),
|
6046
|
-
open = _React$useState[0],
|
6047
|
-
setOpen = _React$useState[1];
|
6000
|
+
const Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
6001
|
+
const {
|
6002
|
+
anchor,
|
6003
|
+
children,
|
6004
|
+
defaultOpen = true,
|
6005
|
+
...otherProps
|
6006
|
+
} = props;
|
6007
|
+
const context = React.useMemo(() => ({
|
6008
|
+
props: otherProps,
|
6009
|
+
ref
|
6010
|
+
}), [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
6048
6011
|
|
6049
|
-
React.
|
6012
|
+
const [open, setOpen] = React.useState(false);
|
6013
|
+
React.useEffect(() => {
|
6050
6014
|
if (defaultOpen) {
|
6051
6015
|
setOpen(defaultOpen);
|
6052
6016
|
}
|
@@ -6062,25 +6026,25 @@ Hanger.Anchor = Anchor;
|
|
6062
6026
|
Hanger.Content = Content$3;
|
6063
6027
|
Hanger.Title = Title$1;
|
6064
6028
|
|
6065
|
-
|
6066
|
-
var Trigger$3 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
|
6029
|
+
const Trigger$3 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
|
6067
6030
|
return React.createElement(HoverCardPrimitive.Trigger, Object.assign({}, props, {
|
6068
6031
|
asChild: true,
|
6069
6032
|
ref: ref
|
6070
6033
|
}));
|
6071
6034
|
});
|
6072
|
-
|
6073
|
-
|
6074
|
-
|
6075
|
-
|
6076
|
-
|
6035
|
+
const Content$4 = /*#__PURE__*/React.forwardRef(function HoverCardContent(externalProps, ref) {
|
6036
|
+
const {
|
6037
|
+
placement,
|
6038
|
+
...props
|
6039
|
+
} = externalProps;
|
6040
|
+
const className = cn('bg-white rounded p-3 yt-shadow', props.className);
|
6077
6041
|
return React.createElement(HoverCardPrimitive.Content, Object.assign({}, props, {
|
6078
6042
|
className: className,
|
6079
6043
|
ref: ref,
|
6080
6044
|
side: placement
|
6081
6045
|
}));
|
6082
6046
|
});
|
6083
|
-
|
6047
|
+
const HoverCard = props => {
|
6084
6048
|
return React.createElement(HoverCardPrimitive.Root, Object.assign({}, props, {
|
6085
6049
|
openDelay: 300
|
6086
6050
|
}));
|
@@ -6088,24 +6052,24 @@ var HoverCard = function HoverCard(props) {
|
|
6088
6052
|
HoverCard.Trigger = Trigger$3;
|
6089
6053
|
HoverCard.Content = Content$4;
|
6090
6054
|
|
6091
|
-
|
6092
|
-
|
6093
|
-
|
6094
|
-
|
6095
|
-
|
6096
|
-
|
6097
|
-
|
6055
|
+
const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
|
6056
|
+
onSearch,
|
6057
|
+
...props
|
6058
|
+
}, ref) {
|
6059
|
+
const {
|
6060
|
+
texts
|
6061
|
+
} = useLocalization();
|
6098
6062
|
|
6099
|
-
|
6063
|
+
const handleClick = () => {
|
6100
6064
|
if (!props.disabled) {
|
6101
6065
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(props.value);
|
6102
6066
|
}
|
6103
6067
|
};
|
6104
6068
|
|
6105
|
-
|
6069
|
+
const handleKeyDown = event => {
|
6106
6070
|
var _props$onKeyDown;
|
6107
6071
|
|
6108
|
-
|
6072
|
+
const isEnterKeyPressed = event.keyCode === keycode('enter');
|
6109
6073
|
|
6110
6074
|
if (isEnterKeyPressed) {
|
6111
6075
|
handleClick();
|
@@ -6474,49 +6438,49 @@ const useMultiListbox = ({
|
|
6474
6438
|
};
|
6475
6439
|
};
|
6476
6440
|
|
6477
|
-
|
6478
|
-
|
6479
|
-
|
6480
|
-
|
6481
|
-
|
6482
|
-
|
6483
|
-
|
6484
|
-
|
6485
|
-
|
6486
|
-
|
6487
|
-
var className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6441
|
+
const Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6442
|
+
const {
|
6443
|
+
className: externalClassName,
|
6444
|
+
...otherProps
|
6445
|
+
} = props;
|
6446
|
+
const {
|
6447
|
+
list,
|
6448
|
+
input
|
6449
|
+
} = useListbox(otherProps, ref);
|
6450
|
+
const className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6488
6451
|
return React.createElement("span", {
|
6489
6452
|
"data-taco": "listbox",
|
6490
6453
|
className: className
|
6491
6454
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6492
|
-
style:
|
6455
|
+
style: { ...list.style,
|
6493
6456
|
maxHeight: 'calc(12rem + 2px)'
|
6494
6457
|
/* (6 * option height) + listbox border */
|
6495
6458
|
|
6496
|
-
}
|
6459
|
+
}
|
6497
6460
|
})), React.createElement("input", Object.assign({}, input, {
|
6498
6461
|
className: "hidden",
|
6499
6462
|
type: "text"
|
6500
6463
|
})));
|
6501
6464
|
});
|
6502
|
-
|
6503
|
-
|
6504
|
-
|
6505
|
-
|
6506
|
-
|
6507
|
-
|
6508
|
-
|
6509
|
-
|
6510
|
-
|
6465
|
+
const MultiListbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6466
|
+
const {
|
6467
|
+
className: externalClassName,
|
6468
|
+
...otherProps
|
6469
|
+
} = props;
|
6470
|
+
const {
|
6471
|
+
list,
|
6472
|
+
input
|
6473
|
+
} = useMultiListbox(otherProps, ref);
|
6474
|
+
const className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6511
6475
|
return React.createElement("span", {
|
6512
6476
|
"data-taco": "listbox",
|
6513
6477
|
className: className
|
6514
6478
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6515
|
-
style:
|
6479
|
+
style: { ...list.style,
|
6516
6480
|
maxHeight: 'calc(12rem + 2px + 2px)'
|
6517
6481
|
/* (6 * option height) + listbox border + ALL_OPTIONS bottom border */
|
6518
6482
|
|
6519
|
-
}
|
6483
|
+
}
|
6520
6484
|
})), React.createElement("input", Object.assign({}, input, {
|
6521
6485
|
className: "hidden",
|
6522
6486
|
type: "text"
|
@@ -6699,34 +6663,26 @@ const Checkbox$1 = props => {
|
|
6699
6663
|
})), children);
|
6700
6664
|
};
|
6701
6665
|
|
6702
|
-
|
6703
|
-
|
6704
|
-
|
6705
|
-
return String(value !== null && value !== void 0 ? value : '');
|
6706
|
-
};
|
6707
|
-
var findByValue$1 = function findByValue(values, valueAsString) {
|
6708
|
-
return values.find(function (value) {
|
6709
|
-
return getRadioGroupItemValueAsString(value) === valueAsString;
|
6710
|
-
});
|
6711
|
-
};
|
6712
|
-
var RadioGroupContext = /*#__PURE__*/React.createContext({
|
6666
|
+
const getRadioGroupItemValueAsString = value => String(value !== null && value !== void 0 ? value : '');
|
6667
|
+
const findByValue$1 = (values, valueAsString) => values.find(value => getRadioGroupItemValueAsString(value) === valueAsString);
|
6668
|
+
const RadioGroupContext = /*#__PURE__*/React.createContext({
|
6713
6669
|
disabled: false,
|
6714
6670
|
invalid: false
|
6715
6671
|
});
|
6716
|
-
|
6717
|
-
|
6718
|
-
|
6719
|
-
|
6720
|
-
|
6721
|
-
|
6722
|
-
|
6723
|
-
|
6724
|
-
|
6672
|
+
const RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(props, ref) {
|
6673
|
+
const context = React.useContext(RadioGroupContext);
|
6674
|
+
const {
|
6675
|
+
children,
|
6676
|
+
value,
|
6677
|
+
...otherProps
|
6678
|
+
} = props;
|
6679
|
+
const isDisabled = context.disabled || props.disabled;
|
6680
|
+
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', {
|
6725
6681
|
'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,
|
6726
6682
|
'border-grey cursor-not-allowed aria-checked:bg-blue-light aria-checked:border-blue-light ': isDisabled,
|
6727
6683
|
'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
|
6728
6684
|
});
|
6729
|
-
|
6685
|
+
const labelClassName = cn('flex items-center gap-2', {
|
6730
6686
|
'cursor-pointer': !isDisabled,
|
6731
6687
|
'cursor-not-allowed text-grey-dark': isDisabled
|
6732
6688
|
}, props.className);
|
@@ -6741,38 +6697,34 @@ var RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(props
|
|
6741
6697
|
className: "h-2 w-2 rounded-full bg-white"
|
6742
6698
|
})), children);
|
6743
6699
|
});
|
6744
|
-
|
6745
|
-
|
6746
|
-
|
6747
|
-
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6751
|
-
|
6752
|
-
|
6753
|
-
|
6754
|
-
|
6755
|
-
|
6756
|
-
|
6757
|
-
React.Children.forEach(children,
|
6700
|
+
const useRadioGroup = props => {
|
6701
|
+
const {
|
6702
|
+
children,
|
6703
|
+
defaultValue,
|
6704
|
+
disabled,
|
6705
|
+
invalid,
|
6706
|
+
onChange,
|
6707
|
+
orientation = 'vertical',
|
6708
|
+
value,
|
6709
|
+
...otherProps
|
6710
|
+
} = props;
|
6711
|
+
const values = React.useMemo(() => {
|
6712
|
+
const radioGroupItemValues = [];
|
6713
|
+
React.Children.forEach(children, child => {
|
6758
6714
|
if (React.isValidElement(child)) {
|
6759
6715
|
radioGroupItemValues.push(child.props.value);
|
6760
6716
|
}
|
6761
6717
|
});
|
6762
6718
|
return radioGroupItemValues;
|
6763
6719
|
}, [children]);
|
6764
|
-
|
6765
|
-
|
6766
|
-
|
6767
|
-
|
6768
|
-
|
6769
|
-
}, [disabled, invalid]);
|
6770
|
-
var valueProps;
|
6720
|
+
const context = React.useMemo(() => ({
|
6721
|
+
disabled: disabled !== null && disabled !== void 0 ? disabled : false,
|
6722
|
+
invalid: invalid !== null && invalid !== void 0 ? invalid : false
|
6723
|
+
}), [disabled, invalid]);
|
6724
|
+
let valueProps;
|
6771
6725
|
|
6772
6726
|
if (onChange !== undefined) {
|
6773
|
-
|
6774
|
-
return onChange(findByValue$1(values, value));
|
6775
|
-
};
|
6727
|
+
const handleChange = value => onChange(findByValue$1(values, value));
|
6776
6728
|
|
6777
6729
|
valueProps = {
|
6778
6730
|
onValueChange: handleChange,
|
@@ -6785,19 +6737,20 @@ var useRadioGroup = function useRadioGroup(props) {
|
|
6785
6737
|
}
|
6786
6738
|
|
6787
6739
|
return {
|
6788
|
-
context
|
6789
|
-
props:
|
6790
|
-
|
6791
|
-
|
6792
|
-
|
6740
|
+
context,
|
6741
|
+
props: { ...otherProps,
|
6742
|
+
...valueProps,
|
6743
|
+
children,
|
6744
|
+
orientation
|
6745
|
+
}
|
6793
6746
|
};
|
6794
6747
|
};
|
6795
|
-
|
6796
|
-
|
6797
|
-
|
6798
|
-
|
6799
|
-
|
6800
|
-
|
6748
|
+
const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
6749
|
+
const {
|
6750
|
+
context,
|
6751
|
+
props: otherProps
|
6752
|
+
} = useRadioGroup(props);
|
6753
|
+
const className = cn('flex items-start gap-y-2', {
|
6801
6754
|
'flex-wrap gap-x-4 ': otherProps.orientation === 'horizontal',
|
6802
6755
|
'flex-col': otherProps.orientation === 'vertical'
|
6803
6756
|
}, otherProps.className);
|
@@ -6868,39 +6821,22 @@ const Header = props => {
|
|
6868
6821
|
}));
|
6869
6822
|
};
|
6870
6823
|
|
6871
|
-
|
6872
|
-
|
6873
|
-
|
6874
|
-
|
6875
|
-
|
6876
|
-
|
6877
|
-
|
6878
|
-
|
6879
|
-
|
6880
|
-
|
6881
|
-
|
6882
|
-
|
6883
|
-
|
6884
|
-
|
6885
|
-
|
6886
|
-
|
6887
|
-
_setMinWidth = _React$useState3[1];
|
6888
|
-
|
6889
|
-
var context = React.useMemo(function () {
|
6890
|
-
return {
|
6891
|
-
indented: indented,
|
6892
|
-
registerIndentation: function registerIndentation() {
|
6893
|
-
return setIndented(true);
|
6894
|
-
},
|
6895
|
-
minWidth: minWidth,
|
6896
|
-
setMinWidth: function setMinWidth(width) {
|
6897
|
-
return _setMinWidth(width);
|
6898
|
-
},
|
6899
|
-
close: function close() {
|
6900
|
-
return setOpen(false);
|
6901
|
-
}
|
6902
|
-
};
|
6903
|
-
}, [indented, minWidth]);
|
6824
|
+
const Menu$1 = externalProps => {
|
6825
|
+
const {
|
6826
|
+
children,
|
6827
|
+
trigger,
|
6828
|
+
...props
|
6829
|
+
} = externalProps;
|
6830
|
+
const [open, setOpen] = React.useState(false);
|
6831
|
+
const [indented, setIndented] = React.useState(false);
|
6832
|
+
const [minWidth, setMinWidth] = React.useState(undefined);
|
6833
|
+
const context = React.useMemo(() => ({
|
6834
|
+
indented,
|
6835
|
+
registerIndentation: () => setIndented(true),
|
6836
|
+
minWidth,
|
6837
|
+
setMinWidth: width => setMinWidth(width),
|
6838
|
+
close: () => setOpen(false)
|
6839
|
+
}), [indented, minWidth]);
|
6904
6840
|
return React.createElement(MenuContext.Provider, {
|
6905
6841
|
value: context
|
6906
6842
|
}, React.createElement(DropdownMenuPrimitive.Root, Object.assign({}, props, {
|
@@ -6918,44 +6854,39 @@ Menu$1.Separator = Separator;
|
|
6918
6854
|
Menu$1.Header = Header;
|
6919
6855
|
Menu$1.RadioGroup = RadioGroup$1;
|
6920
6856
|
|
6921
|
-
|
6922
|
-
var TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
6857
|
+
const TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
6923
6858
|
return React__default.createElement("a", Object.assign({}, props, {
|
6924
6859
|
ref: ref
|
6925
6860
|
}));
|
6926
6861
|
});
|
6927
|
-
|
6928
|
-
|
6929
|
-
|
6930
|
-
|
6931
|
-
|
6932
|
-
|
6933
|
-
|
6934
|
-
|
6935
|
-
|
6936
|
-
|
6937
|
-
|
6938
|
-
|
6939
|
-
setExpanded = _React$useState[1];
|
6940
|
-
|
6941
|
-
React__default.useEffect(function () {
|
6862
|
+
const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGroup(props, ref) {
|
6863
|
+
const {
|
6864
|
+
children,
|
6865
|
+
className: externalClassName,
|
6866
|
+
expanded: initialExpanded = false,
|
6867
|
+
title,
|
6868
|
+
fixed,
|
6869
|
+
onClick,
|
6870
|
+
...otherProps
|
6871
|
+
} = props;
|
6872
|
+
const [expanded, setExpanded] = React__default.useState(fixed || initialExpanded);
|
6873
|
+
React__default.useEffect(() => {
|
6942
6874
|
if (!fixed) {
|
6943
6875
|
setExpanded(fixed || initialExpanded);
|
6944
6876
|
}
|
6945
6877
|
}, [fixed, initialExpanded]);
|
6946
|
-
|
6878
|
+
const listClassName = cn('flex-col mb-0', {
|
6947
6879
|
flex: expanded,
|
6948
6880
|
hidden: !expanded
|
6949
6881
|
});
|
6950
|
-
|
6951
|
-
var itemProps = _extends({}, otherProps, {
|
6882
|
+
const itemProps = { ...otherProps,
|
6952
6883
|
'aria-expanded': expanded,
|
6953
6884
|
role: 'treeitem',
|
6954
6885
|
tabIndex: -1
|
6955
|
-
}
|
6886
|
+
};
|
6956
6887
|
|
6957
|
-
|
6958
|
-
|
6888
|
+
const handleClick = event => {
|
6889
|
+
const nextState = !expanded;
|
6959
6890
|
|
6960
6891
|
if (!fixed) {
|
6961
6892
|
setExpanded(nextState);
|
@@ -6966,7 +6897,7 @@ var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGrou
|
|
6966
6897
|
}
|
6967
6898
|
};
|
6968
6899
|
|
6969
|
-
|
6900
|
+
const className = typeof externalClassName === 'function' ? externalClassName(expanded) : externalClassName;
|
6970
6901
|
return React__default.createElement("div", Object.assign({}, itemProps, {
|
6971
6902
|
className: className,
|
6972
6903
|
ref: ref
|
@@ -6975,18 +6906,14 @@ var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGrou
|
|
6975
6906
|
}, typeof title === 'function' ? title(expanded) : title), React__default.createElement("ul", {
|
6976
6907
|
role: "group",
|
6977
6908
|
className: listClassName
|
6978
|
-
}, React__default.Children.toArray(children).filter(
|
6979
|
-
|
6980
|
-
|
6981
|
-
|
6982
|
-
|
6983
|
-
|
6984
|
-
}, React__default.cloneElement(item, {
|
6985
|
-
role: 'treeitem'
|
6986
|
-
}));
|
6987
|
-
})));
|
6909
|
+
}, React__default.Children.toArray(children).filter(item => !!item).map((item, i) => React__default.createElement("li", {
|
6910
|
+
key: i,
|
6911
|
+
role: "none"
|
6912
|
+
}, React__default.cloneElement(item, {
|
6913
|
+
role: 'treeitem'
|
6914
|
+
})))));
|
6988
6915
|
});
|
6989
|
-
|
6916
|
+
const Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props, ref) {
|
6990
6917
|
return React__default.createElement("div", Object.assign({}, props, {
|
6991
6918
|
ref: ref,
|
6992
6919
|
role: "tree"
|
@@ -7032,25 +6959,20 @@ var useDropTarget = function useDropTarget(onDrop) {
|
|
7032
6959
|
return [isDraggedOver, props];
|
7033
6960
|
};
|
7034
6961
|
|
7035
|
-
|
7036
|
-
|
7037
|
-
|
7038
|
-
|
7039
|
-
|
7040
|
-
|
7041
|
-
|
7042
|
-
|
7043
|
-
|
7044
|
-
|
7045
|
-
|
7046
|
-
|
7047
|
-
|
7048
|
-
|
7049
|
-
isDraggedOver = _useDropTarget[0],
|
7050
|
-
dropTargetProps = _useDropTarget[1];
|
7051
|
-
|
7052
|
-
var isTreeitem = role === 'treeitem';
|
7053
|
-
var className = cn('yt-navigation__item cursor-pointer', {
|
6962
|
+
const Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
6963
|
+
const {
|
6964
|
+
active,
|
6965
|
+
children,
|
6966
|
+
onDrop,
|
6967
|
+
postfix,
|
6968
|
+
prefix,
|
6969
|
+
role,
|
6970
|
+
...otherProps
|
6971
|
+
} = props;
|
6972
|
+
const proxyRef = useProxiedRef(ref);
|
6973
|
+
const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);
|
6974
|
+
const isTreeitem = role === 'treeitem';
|
6975
|
+
const className = cn('yt-navigation__item cursor-pointer', {
|
7054
6976
|
'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,
|
7055
6977
|
'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,
|
7056
6978
|
'yt-navigation__item--active': active && !isDraggedOver,
|
@@ -7058,7 +6980,7 @@ var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
|
7058
6980
|
'yt-navigation__item--dropping bg-blue': isDraggedOver
|
7059
6981
|
}, props.className);
|
7060
6982
|
|
7061
|
-
|
6983
|
+
const handleClick = event => {
|
7062
6984
|
if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {
|
7063
6985
|
return;
|
7064
6986
|
}
|
@@ -7081,19 +7003,19 @@ var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
|
7081
7003
|
className: "yt-navigation__item__postfix ml-1"
|
7082
7004
|
}, postfix));
|
7083
7005
|
});
|
7084
|
-
|
7006
|
+
const Panel = /*#__PURE__*/React__default.forwardRef(function Panel(props, ref) {
|
7085
7007
|
return React__default.createElement("div", Object.assign({}, props, {
|
7086
7008
|
className: cn('w-full bg-white p-3', props.className),
|
7087
7009
|
ref: ref
|
7088
7010
|
}));
|
7089
7011
|
});
|
7090
|
-
|
7091
|
-
|
7012
|
+
const MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(props, ref) {
|
7013
|
+
const className = cn('flex-shrink-0 space-y-1 outline-none', {
|
7092
7014
|
'bg-white pb-2': props.fixed
|
7093
7015
|
}, props.className);
|
7094
7016
|
|
7095
|
-
|
7096
|
-
|
7017
|
+
const title = expanded => {
|
7018
|
+
const className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {
|
7097
7019
|
'mb-1': expanded,
|
7098
7020
|
'cursor-pointer hover:text-blue': !props.fixed
|
7099
7021
|
});
|
@@ -7110,16 +7032,14 @@ var MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(props,
|
|
7110
7032
|
ref: ref
|
7111
7033
|
}));
|
7112
7034
|
});
|
7113
|
-
|
7114
|
-
|
7115
|
-
|
7116
|
-
React__default.Children.toArray(props.children).filter(
|
7117
|
-
return !!child;
|
7118
|
-
}).map(function (child) {
|
7035
|
+
const Menu$2 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
|
7036
|
+
const scrollableAreas = React__default.useMemo(() => {
|
7037
|
+
const scrollableAreas = [];
|
7038
|
+
React__default.Children.toArray(props.children).filter(child => !!child).map(child => {
|
7119
7039
|
if (child.props.fixed) {
|
7120
7040
|
scrollableAreas.push(child);
|
7121
7041
|
} else {
|
7122
|
-
|
7042
|
+
const x = scrollableAreas[scrollableAreas.length - 1];
|
7123
7043
|
|
7124
7044
|
if (Array.isArray(x)) {
|
7125
7045
|
x.push(child);
|
@@ -7133,19 +7053,18 @@ var Menu$2 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
|
|
7133
7053
|
return React__default.createElement(Treeview, Object.assign({}, props, {
|
7134
7054
|
className: cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className),
|
7135
7055
|
ref: ref
|
7136
|
-
}), scrollableAreas.map(
|
7137
|
-
|
7138
|
-
|
7139
|
-
|
7140
|
-
}, area) : area;
|
7141
|
-
}));
|
7056
|
+
}), scrollableAreas.map((area, i) => Array.isArray(area) ? React__default.createElement("div", {
|
7057
|
+
className: "divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
|
7058
|
+
key: i
|
7059
|
+
}, area) : area));
|
7142
7060
|
});
|
7143
7061
|
Menu$2.Group = MenuGroup;
|
7144
|
-
|
7145
|
-
|
7146
|
-
|
7147
|
-
|
7148
|
-
|
7062
|
+
const Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
|
7063
|
+
const {
|
7064
|
+
children,
|
7065
|
+
...otherProps
|
7066
|
+
} = props;
|
7067
|
+
const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
|
7149
7068
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
7150
7069
|
className: className,
|
7151
7070
|
"data-taco": "navigation",
|
@@ -7401,54 +7320,52 @@ const useSelect = ({
|
|
7401
7320
|
};
|
7402
7321
|
};
|
7403
7322
|
|
7404
|
-
|
7405
|
-
|
7406
|
-
|
7407
|
-
|
7408
|
-
|
7409
|
-
|
7410
|
-
|
7411
|
-
|
7412
|
-
|
7413
|
-
|
7414
|
-
|
7415
|
-
|
7416
|
-
|
7417
|
-
|
7418
|
-
|
7419
|
-
|
7420
|
-
|
7421
|
-
|
7422
|
-
|
7423
|
-
var className = cn('inline-flex relative w-full', {
|
7323
|
+
const BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
|
7324
|
+
const {
|
7325
|
+
autoFocus,
|
7326
|
+
className: externalClassName,
|
7327
|
+
highlighted,
|
7328
|
+
style,
|
7329
|
+
...otherProps
|
7330
|
+
} = props;
|
7331
|
+
const {
|
7332
|
+
button,
|
7333
|
+
listbox,
|
7334
|
+
popover,
|
7335
|
+
input,
|
7336
|
+
text,
|
7337
|
+
more = 0
|
7338
|
+
} = useSelect(otherProps, ref);
|
7339
|
+
const internalRef = React.useRef(null);
|
7340
|
+
const selectDimensions = useBoundingClientRectListener(internalRef);
|
7341
|
+
const className = cn('inline-flex relative w-full', {
|
7424
7342
|
'yt-select--readonly': props.readOnly
|
7425
7343
|
}, externalClassName);
|
7426
|
-
|
7344
|
+
const inputClassname = cn(getInputClasses(props), 'h-8 text-left pr-0', {
|
7427
7345
|
'border-blue': popover.open
|
7428
7346
|
});
|
7429
|
-
React.useEffect(
|
7347
|
+
React.useEffect(() => {
|
7430
7348
|
if (autoFocus && internalRef.current) {
|
7431
7349
|
internalRef.current.focus();
|
7432
7350
|
}
|
7433
7351
|
}, []);
|
7434
7352
|
|
7435
|
-
|
7353
|
+
const renderMultiSelection = () => {
|
7436
7354
|
return React.createElement(React.Fragment, null, React.createElement("span", {
|
7437
7355
|
className: "flex-grow truncate text-left"
|
7438
7356
|
}, text), more > 0 && React.createElement(Badge, {
|
7439
7357
|
className: "ml-2"
|
7440
|
-
},
|
7358
|
+
}, `+${more}`));
|
7441
7359
|
};
|
7442
7360
|
|
7443
|
-
|
7361
|
+
const commonListboxProps = { ...listbox,
|
7444
7362
|
className: 'w-auto',
|
7445
7363
|
invalid: undefined,
|
7446
7364
|
style: {
|
7447
7365
|
minWidth: selectDimensions === null || selectDimensions === void 0 ? void 0 : selectDimensions.width
|
7448
7366
|
},
|
7449
7367
|
tabIndex: popover.open ? 0 : -1
|
7450
|
-
}
|
7451
|
-
|
7368
|
+
};
|
7452
7369
|
return React.createElement("span", {
|
7453
7370
|
className: className,
|
7454
7371
|
"data-taco": "select",
|
@@ -7471,9 +7388,11 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
|
|
7471
7388
|
type: "text"
|
7472
7389
|
}))));
|
7473
7390
|
});
|
7474
|
-
|
7475
|
-
|
7476
|
-
|
7391
|
+
const Select = /*#__PURE__*/React.forwardRef(function Select(props, ref) {
|
7392
|
+
const {
|
7393
|
+
editable,
|
7394
|
+
...otherProps
|
7395
|
+
} = props;
|
7477
7396
|
|
7478
7397
|
if (editable) {
|
7479
7398
|
return React.createElement(Combobox, Object.assign({}, otherProps, {
|
@@ -7544,47 +7463,41 @@ const usePagination = (initialPageIndex = 0, initialPageSize = 10) => {
|
|
7544
7463
|
};
|
7545
7464
|
};
|
7546
7465
|
|
7547
|
-
|
7548
|
-
|
7549
|
-
|
7550
|
-
var minItemIndex = pageIndex * pageSize + 1;
|
7551
|
-
var maxItemIndex = (pageIndex + 1) * pageSize;
|
7466
|
+
const getShowingLabel = (length, pageIndex, pageSize, texts) => {
|
7467
|
+
const minItemIndex = pageIndex * pageSize + 1;
|
7468
|
+
const maxItemIndex = (pageIndex + 1) * pageSize;
|
7552
7469
|
return texts.pagination.showingXofYofTotal.replace('[X]', length === 0 ? '0' : String(minItemIndex)).replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex)).replace('[total]', String(length));
|
7553
7470
|
};
|
7554
7471
|
|
7555
|
-
|
7556
|
-
|
7557
|
-
|
7558
|
-
|
7559
|
-
|
7560
|
-
|
7561
|
-
|
7562
|
-
|
7563
|
-
|
7564
|
-
|
7565
|
-
|
7566
|
-
|
7567
|
-
|
7568
|
-
|
7569
|
-
|
7570
|
-
|
7571
|
-
|
7572
|
-
|
7573
|
-
|
7574
|
-
texts = _useLocalization.texts;
|
7575
|
-
|
7576
|
-
var maxPageIndex = Math.ceil(length / pageSize) - 1;
|
7577
|
-
var showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;
|
7472
|
+
const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
7473
|
+
const {
|
7474
|
+
length,
|
7475
|
+
pageIndex,
|
7476
|
+
pageSize,
|
7477
|
+
pageSizes = [10, 25, 50, 100, 500],
|
7478
|
+
setPageIndex,
|
7479
|
+
setPageSize,
|
7480
|
+
showPageControls = true,
|
7481
|
+
showPageNumbers = true,
|
7482
|
+
showPageSize = true,
|
7483
|
+
dangerouslyHijackGlobalKeyboardNavigation = false,
|
7484
|
+
...otherProps
|
7485
|
+
} = props;
|
7486
|
+
const {
|
7487
|
+
texts
|
7488
|
+
} = useLocalization();
|
7489
|
+
const maxPageIndex = Math.ceil(length / pageSize) - 1;
|
7490
|
+
const showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;
|
7578
7491
|
usePaginationShortcuts({
|
7579
|
-
setPageIndex
|
7580
|
-
maxPageIndex
|
7581
|
-
pageIndex
|
7582
|
-
dangerouslyHijackGlobalKeyboardNavigation
|
7492
|
+
setPageIndex,
|
7493
|
+
maxPageIndex,
|
7494
|
+
pageIndex,
|
7495
|
+
dangerouslyHijackGlobalKeyboardNavigation
|
7583
7496
|
});
|
7584
|
-
|
7585
|
-
|
7586
|
-
|
7587
|
-
|
7497
|
+
const pageCount = Math.ceil(length / pageSize);
|
7498
|
+
const canPreviousPage = pageIndex > 0;
|
7499
|
+
const canNextPage = pageIndex < pageCount - 1;
|
7500
|
+
const className = cn('inline-flex relative justify-between items-center', props.className);
|
7588
7501
|
return React.createElement("div", Object.assign({}, otherProps, {
|
7589
7502
|
className: className,
|
7590
7503
|
"data-taco": "pagination",
|
@@ -7594,13 +7507,11 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
|
7594
7507
|
}, getShowingLabel(length, pageIndex, pageSize, texts), React.createElement(Select, {
|
7595
7508
|
"aria-label": texts.pagination.pageSize,
|
7596
7509
|
className: "ml-4 !w-20",
|
7597
|
-
data: pageSizes.map(
|
7598
|
-
|
7599
|
-
|
7600
|
-
|
7601
|
-
|
7602
|
-
}),
|
7603
|
-
onChange: function onChange(event) {
|
7510
|
+
data: pageSizes.map(pageSize => ({
|
7511
|
+
text: String(pageSize),
|
7512
|
+
value: pageSize
|
7513
|
+
})),
|
7514
|
+
onChange: event => {
|
7604
7515
|
setPageIndex(0);
|
7605
7516
|
setPageSize(Number(event.target.value));
|
7606
7517
|
},
|
@@ -7612,18 +7523,14 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
|
7612
7523
|
appearance: "default",
|
7613
7524
|
disabled: !canPreviousPage,
|
7614
7525
|
icon: "arrow-start",
|
7615
|
-
onClick:
|
7616
|
-
return setPageIndex(0);
|
7617
|
-
},
|
7526
|
+
onClick: () => setPageIndex(0),
|
7618
7527
|
"aria-label": showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage,
|
7619
7528
|
tooltip: showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage
|
7620
7529
|
}), React.createElement(IconButton, {
|
7621
7530
|
appearance: "default",
|
7622
7531
|
disabled: !canPreviousPage,
|
7623
7532
|
icon: "arrow-left",
|
7624
|
-
onClick:
|
7625
|
-
return setPageIndex(pageIndex - 1);
|
7626
|
-
},
|
7533
|
+
onClick: () => setPageIndex(pageIndex - 1),
|
7627
7534
|
"aria-label": showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage,
|
7628
7535
|
tooltip: showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage
|
7629
7536
|
}), showPageNumbers && pageCount > 0 && React.createElement(PageNumbers, {
|
@@ -7634,43 +7541,36 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
|
7634
7541
|
appearance: "default",
|
7635
7542
|
disabled: !canNextPage,
|
7636
7543
|
icon: "arrow-right",
|
7637
|
-
onClick:
|
7638
|
-
return setPageIndex(pageIndex + 1);
|
7639
|
-
},
|
7544
|
+
onClick: () => setPageIndex(pageIndex + 1),
|
7640
7545
|
"aria-label": showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage,
|
7641
7546
|
tooltip: showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage
|
7642
7547
|
}), React.createElement(IconButton, {
|
7643
7548
|
appearance: "default",
|
7644
7549
|
disabled: !canNextPage,
|
7645
7550
|
icon: "arrow-end",
|
7646
|
-
onClick:
|
7647
|
-
return setPageIndex(pageCount - 1);
|
7648
|
-
},
|
7551
|
+
onClick: () => setPageIndex(pageCount - 1),
|
7649
7552
|
"aria-label": showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage,
|
7650
7553
|
tooltip: showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage
|
7651
7554
|
})));
|
7652
7555
|
});
|
7653
7556
|
|
7654
|
-
|
7655
|
-
|
7656
|
-
|
7657
|
-
|
7658
|
-
|
7659
|
-
duration = _ref$duration === void 0 ? undefined : _ref$duration,
|
7660
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
7661
|
-
|
7662
|
-
var style;
|
7557
|
+
const Progress = ({
|
7558
|
+
duration = undefined,
|
7559
|
+
...props
|
7560
|
+
}) => {
|
7561
|
+
let style;
|
7663
7562
|
|
7664
7563
|
if (duration) {
|
7665
7564
|
style = {
|
7666
|
-
animationDuration: duration
|
7565
|
+
animationDuration: `${duration}ms`
|
7667
7566
|
};
|
7668
7567
|
}
|
7669
7568
|
|
7670
|
-
|
7671
|
-
|
7672
|
-
"w-full before:h-1 before:bg-grey-dark before:block before:animate-[progress-indeterminate_2s_cubic-bezier(0.4,0,0.2,1)_infinite] before:content-[' ']": !duration
|
7673
|
-
|
7569
|
+
const className = cn('bg-grey-light rounded block h-1 overflow-hidden w-full', props.className);
|
7570
|
+
const progressClassName = cn('yt-progress__bar block h-1', {
|
7571
|
+
"w-full before:h-1 before:bg-grey-dark before:block before:animate-[progress-indeterminate_2s_cubic-bezier(0.4,0,0.2,1)_infinite] before:content-[' ']": !duration,
|
7572
|
+
[`w-0 bg-grey-dark animate-[progress_linear]`]: duration
|
7573
|
+
});
|
7674
7574
|
return React__default.createElement("span", Object.assign({}, props, {
|
7675
7575
|
"data-taco": "progress",
|
7676
7576
|
className: className
|
@@ -9348,19 +9248,22 @@ Tabs.List = TabList;
|
|
9348
9248
|
Tabs.Trigger = TabTrigger;
|
9349
9249
|
Tabs.Content = TabContent;
|
9350
9250
|
|
9351
|
-
|
9352
|
-
|
9353
|
-
|
9354
|
-
|
9355
|
-
|
9356
|
-
|
9251
|
+
const Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
9252
|
+
const {
|
9253
|
+
defaultValue: _,
|
9254
|
+
highlighted,
|
9255
|
+
invalid,
|
9256
|
+
onKeyDown,
|
9257
|
+
...otherProps
|
9258
|
+
} = props;
|
9259
|
+
const classNames = cn(getInputClasses(props), 'py-1 min-h-[75px] disabled:resize-none', props.className); // home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll
|
9357
9260
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
9358
9261
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
9359
9262
|
|
9360
|
-
|
9263
|
+
const handleKeyDown = event => {
|
9361
9264
|
if (event.key === 'Home' || event.key === 'End') {
|
9362
9265
|
event.preventDefault();
|
9363
|
-
|
9266
|
+
const position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
9364
9267
|
event.currentTarget.setSelectionRange(position, position);
|
9365
9268
|
event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;
|
9366
9269
|
}
|
@@ -9378,18 +9281,18 @@ var Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
|
9378
9281
|
}));
|
9379
9282
|
});
|
9380
9283
|
|
9381
|
-
|
9382
|
-
|
9383
|
-
|
9384
|
-
|
9385
|
-
|
9386
|
-
|
9387
|
-
|
9284
|
+
const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
9285
|
+
const {
|
9286
|
+
label,
|
9287
|
+
onChange,
|
9288
|
+
...otherProps
|
9289
|
+
} = props;
|
9290
|
+
const className = cn('group h-5 w-9 flex rounded-full inline-flex', {
|
9388
9291
|
'mr-2': !!label,
|
9389
9292
|
'bg-grey-darker hover:bg-grey-dark aria-checked:bg-blue aria-checked:hover:bg-blue-light focus:yt-focus': !props.disabled,
|
9390
9293
|
'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled
|
9391
9294
|
}, props.className);
|
9392
|
-
|
9295
|
+
const element = React.createElement(PrimitiveSwitch.Root, Object.assign({}, otherProps, {
|
9393
9296
|
className: className,
|
9394
9297
|
onCheckedChange: onChange,
|
9395
9298
|
ref: ref
|
@@ -9398,7 +9301,7 @@ var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9398
9301
|
}));
|
9399
9302
|
|
9400
9303
|
if (label) {
|
9401
|
-
|
9304
|
+
const labelClassName = cn('flex items-center cursor-pointer', {
|
9402
9305
|
'cursor-not-allowed text-grey-dark': props.disabled
|
9403
9306
|
});
|
9404
9307
|
return React.createElement("label", {
|
@@ -9409,23 +9312,22 @@ var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9409
9312
|
return element;
|
9410
9313
|
});
|
9411
9314
|
|
9412
|
-
|
9413
|
-
|
9414
|
-
|
9415
|
-
|
9416
|
-
|
9417
|
-
|
9418
|
-
|
9419
|
-
|
9420
|
-
|
9421
|
-
|
9422
|
-
|
9423
|
-
|
9424
|
-
|
9425
|
-
|
9426
|
-
|
9427
|
-
|
9428
|
-
var onWindowKeyDown = function onWindowKeyDown(event) {
|
9315
|
+
const Tooltip$1 = ({
|
9316
|
+
continuous,
|
9317
|
+
index,
|
9318
|
+
isLastStep,
|
9319
|
+
step,
|
9320
|
+
backProps,
|
9321
|
+
primaryProps,
|
9322
|
+
skipProps,
|
9323
|
+
tooltipProps,
|
9324
|
+
size,
|
9325
|
+
locale,
|
9326
|
+
disableTourSkipOnEsc
|
9327
|
+
}) => {
|
9328
|
+
const skipButtonRef = React.useRef(null);
|
9329
|
+
React.useEffect(() => {
|
9330
|
+
const onWindowKeyDown = event => {
|
9429
9331
|
if (!disableTourSkipOnEsc) {
|
9430
9332
|
if (event.keyCode === keycode('esc') && skipButtonRef.current !== null) {
|
9431
9333
|
event.preventDefault();
|
@@ -9436,7 +9338,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
9436
9338
|
};
|
9437
9339
|
|
9438
9340
|
window.addEventListener('keydown', onWindowKeyDown);
|
9439
|
-
return
|
9341
|
+
return () => {
|
9440
9342
|
window.removeEventListener('keydown', onWindowKeyDown);
|
9441
9343
|
};
|
9442
9344
|
}, []);
|
@@ -9455,31 +9357,31 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
9455
9357
|
appearance: "discrete"
|
9456
9358
|
}), locale.back), React.createElement(Button$1, Object.assign({}, primaryProps, {
|
9457
9359
|
appearance: "primary"
|
9458
|
-
}), continuous ? isLastStep ? locale.last
|
9360
|
+
}), continuous ? isLastStep ? `${locale.last} (${index + 1}/${size})` : `${locale.next} (${index + 1}/${size})` : locale.close)));
|
9459
9361
|
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
9460
9362
|
|
9461
9363
|
|
9462
|
-
|
9463
|
-
|
9464
|
-
|
9465
|
-
|
9466
|
-
|
9467
|
-
|
9468
|
-
|
9469
|
-
|
9470
|
-
|
9471
|
-
|
9472
|
-
|
9473
|
-
|
9474
|
-
|
9475
|
-
|
9476
|
-
|
9477
|
-
|
9478
|
-
|
9479
|
-
|
9480
|
-
|
9481
|
-
return React.Children.map(props.children,
|
9482
|
-
|
9364
|
+
const TourStep = _props => null;
|
9365
|
+
const Tour = props => {
|
9366
|
+
const {
|
9367
|
+
texts: {
|
9368
|
+
tour
|
9369
|
+
}
|
9370
|
+
} = useLocalization();
|
9371
|
+
const {
|
9372
|
+
autoStart: run,
|
9373
|
+
onComplete,
|
9374
|
+
onClose,
|
9375
|
+
onReady,
|
9376
|
+
spotlightClicks,
|
9377
|
+
disableCloseOnEsc: disableTourSkipOnEsc,
|
9378
|
+
disableScrollParentFix = false,
|
9379
|
+
scrollOffset,
|
9380
|
+
...rest
|
9381
|
+
} = props;
|
9382
|
+
const steps = React.useMemo(() => {
|
9383
|
+
return React.Children.map(props.children, child => {
|
9384
|
+
const step = {
|
9483
9385
|
disableBeacon: !child.props.showBeacon,
|
9484
9386
|
target: child.props.selector,
|
9485
9387
|
placement: child.props.position,
|
@@ -9489,12 +9391,10 @@ var Tour = function Tour(props) {
|
|
9489
9391
|
return step;
|
9490
9392
|
});
|
9491
9393
|
}, [props.children]);
|
9492
|
-
|
9394
|
+
const getStep = React.useCallback(selector => {
|
9493
9395
|
var _props$children$find;
|
9494
9396
|
|
9495
|
-
return (_props$children$find = props.children.find(
|
9496
|
-
return child.props.selector === selector;
|
9497
|
-
})) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
9397
|
+
return (_props$children$find = props.children.find(child => child.props.selector === selector)) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
9498
9398
|
}, [props.children]);
|
9499
9399
|
|
9500
9400
|
function callback(state) {
|
@@ -9524,12 +9424,10 @@ var Tour = function Tour(props) {
|
|
9524
9424
|
floaterProps: {
|
9525
9425
|
disableAnimation: true
|
9526
9426
|
},
|
9527
|
-
tooltipComponent:
|
9528
|
-
|
9529
|
-
|
9530
|
-
|
9531
|
-
}));
|
9532
|
-
},
|
9427
|
+
tooltipComponent: tooltipProps => React.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
|
9428
|
+
locale: tour,
|
9429
|
+
disableTourSkipOnEsc: disableTourSkipOnEsc
|
9430
|
+
})),
|
9533
9431
|
locale: tour,
|
9534
9432
|
spotlightPadding: 8,
|
9535
9433
|
spotlightClicks: spotlightClicks,
|
@@ -9571,10 +9469,10 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9571
9469
|
}, [ref, callback]);
|
9572
9470
|
};
|
9573
9471
|
|
9574
|
-
var _excluded$
|
9472
|
+
var _excluded$a = ["noPadding"];
|
9575
9473
|
var Content$6 = /*#__PURE__*/React.forwardRef(function CardContent(externalProps, ref) {
|
9576
9474
|
var noPadding = externalProps.noPadding,
|
9577
|
-
props = _objectWithoutPropertiesLoose(externalProps, _excluded$
|
9475
|
+
props = _objectWithoutPropertiesLoose(externalProps, _excluded$a);
|
9578
9476
|
|
9579
9477
|
var className = cn('flex-grow overflow-auto', {
|
9580
9478
|
'mx-4 mb-4': !noPadding
|
@@ -9660,6 +9558,7 @@ exports.getParentRowIndexPath = getParentRowIndexPath;
|
|
9660
9558
|
exports.getRadioGroupItemValueAsString = getRadioGroupItemValueAsString;
|
9661
9559
|
exports.icons = icons;
|
9662
9560
|
exports.insertChildTableRow = insertChildTableRow;
|
9561
|
+
exports.mergeRefs = mergeRefs;
|
9663
9562
|
exports.parseFromCustomString = parseFromCustomString;
|
9664
9563
|
exports.parseFromISOString = parseFromISOString;
|
9665
9564
|
exports.removeChildTableRow = removeChildTableRow;
|