@economic/taco 0.0.31-alpha.1 → 0.0.33-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/components/Button/util.js +1 -1
- package/dist/esm/components/Button/util.js.map +1 -1
- package/dist/esm/components/Select/useSelect.js +0 -2
- package/dist/esm/components/Select/useSelect.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/Tabs/Tabs.js +25 -27
- package/dist/esm/components/Tabs/Tabs.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 +44 -50
- 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.css +3 -3
- package/dist/index.css +3 -3
- package/dist/taco.cjs.development.js +266 -315
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/tailwind.d.ts +1 -1
- package/package.json +3 -3
@@ -3237,7 +3237,7 @@ var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
|
|
3237
3237
|
}));
|
3238
3238
|
});
|
3239
3239
|
|
3240
|
-
|
3240
|
+
const VisuallyHidden = /*#__PURE__*/React.forwardRef(function VisuallyHidden(props, ref) {
|
3241
3241
|
return React.createElement("span", Object.assign({}, props, {
|
3242
3242
|
className: "sr-only",
|
3243
3243
|
ref: ref
|
@@ -3355,13 +3355,13 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
3355
3355
|
}), React.Children.count(props.children) > 1 ? React.Children.map(props.children, child => typeof child === 'string' ? React.createElement("span", null, child) : child) : props.children);
|
3356
3356
|
});
|
3357
3357
|
|
3358
|
-
|
3359
|
-
|
3360
|
-
|
3361
|
-
|
3362
|
-
|
3363
|
-
|
3364
|
-
|
3358
|
+
const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
3359
|
+
const {
|
3360
|
+
title,
|
3361
|
+
children,
|
3362
|
+
placement,
|
3363
|
+
...otherProps
|
3364
|
+
} = props;
|
3365
3365
|
return React.createElement(TooltipPrimitive.Root, {
|
3366
3366
|
delayDuration: 50
|
3367
3367
|
}, React.createElement(TooltipPrimitive.Trigger, {
|
@@ -3383,7 +3383,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
|
3383
3383
|
});
|
3384
3384
|
|
3385
3385
|
const getButtonClasses = () => {
|
3386
|
-
return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] h-max inline-flex items-center justify-center border';
|
3386
|
+
return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] gap-1 h-max inline-flex items-center justify-center border';
|
3387
3387
|
};
|
3388
3388
|
const getAppearanceClasses = (value, icon = false) => {
|
3389
3389
|
switch (value) {
|
@@ -3453,12 +3453,12 @@ const createButton = (props, className, ref) => {
|
|
3453
3453
|
return button;
|
3454
3454
|
};
|
3455
3455
|
|
3456
|
-
var _excluded$
|
3456
|
+
var _excluded$3 = ["icon", "rounded"];
|
3457
3457
|
var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
3458
3458
|
var icon = props.icon,
|
3459
3459
|
_props$rounded = props.rounded,
|
3460
3460
|
rounded = _props$rounded === void 0 ? false : _props$rounded,
|
3461
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3461
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
3462
3462
|
|
3463
3463
|
var className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3464
3464
|
'rounded-full': rounded,
|
@@ -3497,10 +3497,10 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3497
3497
|
}) : null);
|
3498
3498
|
});
|
3499
3499
|
|
3500
|
-
var _excluded$
|
3500
|
+
var _excluded$4 = ["fluid"];
|
3501
3501
|
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3502
3502
|
var fluid = props.fluid,
|
3503
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3503
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
3504
3504
|
|
3505
3505
|
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3506
3506
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3571,27 +3571,21 @@ function useTimer(duration = 0, callback) {
|
|
3571
3571
|
};
|
3572
3572
|
}
|
3573
3573
|
|
3574
|
-
|
3575
|
-
|
3576
|
-
|
3577
|
-
|
3578
|
-
|
3579
|
-
|
3580
|
-
|
3581
|
-
|
3582
|
-
|
3583
|
-
setVisibility = _React$useState[1];
|
3584
|
-
|
3585
|
-
React__default.useEffect(function () {
|
3586
|
-
var timeout;
|
3574
|
+
const Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
3575
|
+
const {
|
3576
|
+
delay = 500,
|
3577
|
+
label,
|
3578
|
+
...otherProps
|
3579
|
+
} = props;
|
3580
|
+
const [visible, setVisibility] = React__default.useState(!delay);
|
3581
|
+
React__default.useEffect(() => {
|
3582
|
+
let timeout;
|
3587
3583
|
|
3588
3584
|
if (delay) {
|
3589
|
-
timeout = window.setTimeout(
|
3590
|
-
return setVisibility(true);
|
3591
|
-
}, delay);
|
3585
|
+
timeout = window.setTimeout(() => setVisibility(true), delay);
|
3592
3586
|
}
|
3593
3587
|
|
3594
|
-
return
|
3588
|
+
return () => {
|
3595
3589
|
if (timeout) {
|
3596
3590
|
clearTimeout(timeout);
|
3597
3591
|
}
|
@@ -3602,7 +3596,7 @@ var Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, r
|
|
3602
3596
|
return null;
|
3603
3597
|
}
|
3604
3598
|
|
3605
|
-
|
3599
|
+
const className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
3606
3600
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
3607
3601
|
className: className,
|
3608
3602
|
"data-taco": "spinner",
|
@@ -3728,62 +3722,49 @@ const Toast = ({
|
|
3728
3722
|
}));
|
3729
3723
|
};
|
3730
3724
|
|
3731
|
-
|
3732
|
-
|
3733
|
-
var ToastContext = /*#__PURE__*/React.createContext({});
|
3725
|
+
const DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
|
3726
|
+
const ToastContext = /*#__PURE__*/React.createContext({});
|
3734
3727
|
|
3735
|
-
|
3736
|
-
|
3737
|
-
|
3738
|
-
return JSON.stringify(toast.content) === JSON.stringify(content);
|
3739
|
-
});
|
3728
|
+
const insertToastWithoutDuplicates = (currentToasts, id, content, options, close) => {
|
3729
|
+
const nextToasts = [...currentToasts];
|
3730
|
+
const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));
|
3740
3731
|
|
3741
3732
|
if (existingToastIndex > -1) {
|
3742
3733
|
nextToasts[existingToastIndex].lastDuplicateId = id;
|
3743
3734
|
nextToasts[existingToastIndex].lastUpdated = Date.now();
|
3744
3735
|
} else {
|
3745
3736
|
nextToasts.push({
|
3746
|
-
id
|
3737
|
+
id,
|
3747
3738
|
content: typeof content === 'function' ? content(close) : content,
|
3748
|
-
options
|
3739
|
+
options
|
3749
3740
|
});
|
3750
3741
|
}
|
3751
3742
|
|
3752
3743
|
return nextToasts;
|
3753
3744
|
};
|
3754
3745
|
|
3755
|
-
|
3756
|
-
|
3757
|
-
|
3758
|
-
|
3759
|
-
|
3760
|
-
toasts = _React$useState[0],
|
3761
|
-
setToasts = _React$useState[1];
|
3746
|
+
const ToastProvider = ({
|
3747
|
+
children,
|
3748
|
+
...props
|
3749
|
+
}) => {
|
3750
|
+
const [toasts, setToasts] = React.useState([]);
|
3762
3751
|
|
3763
|
-
|
3764
|
-
setToasts(
|
3765
|
-
return currentToasts.filter(function (toast) {
|
3766
|
-
return toast.id !== id;
|
3767
|
-
});
|
3768
|
-
});
|
3752
|
+
const handleClose = id => {
|
3753
|
+
setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));
|
3769
3754
|
}; // memoize (useCallback) this function,
|
3770
3755
|
// it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children
|
3771
3756
|
|
3772
3757
|
|
3773
|
-
|
3774
|
-
|
3758
|
+
const toaster = React.useCallback((content, options) => {
|
3759
|
+
const id = uuid.v4();
|
3775
3760
|
|
3776
|
-
|
3777
|
-
return handleClose(id);
|
3778
|
-
};
|
3761
|
+
const close = () => handleClose(id);
|
3779
3762
|
|
3780
|
-
setToasts(
|
3781
|
-
return insertToastWithoutDuplicates(currentToasts, id, content, options, close);
|
3782
|
-
});
|
3763
|
+
setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));
|
3783
3764
|
|
3784
|
-
|
3785
|
-
setToasts(
|
3786
|
-
|
3765
|
+
const update = (content, options) => {
|
3766
|
+
setToasts(currentToasts => {
|
3767
|
+
const nextToasts = currentToasts.filter(toast => {
|
3787
3768
|
if (toast.lastDuplicateId) {
|
3788
3769
|
return toast.lastDuplicateId !== id;
|
3789
3770
|
}
|
@@ -3794,80 +3775,70 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
3794
3775
|
});
|
3795
3776
|
};
|
3796
3777
|
|
3797
|
-
|
3798
|
-
update(content,
|
3799
|
-
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3800
|
-
|
3778
|
+
const success = (content, options) => {
|
3779
|
+
update(content, {
|
3780
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT,
|
3781
|
+
...options,
|
3801
3782
|
type: 'success'
|
3802
|
-
})
|
3783
|
+
});
|
3803
3784
|
};
|
3804
3785
|
|
3805
|
-
|
3806
|
-
update(content,
|
3786
|
+
const error = (content, options) => {
|
3787
|
+
update(content, { ...options,
|
3807
3788
|
type: 'error'
|
3808
|
-
})
|
3789
|
+
});
|
3809
3790
|
};
|
3810
3791
|
|
3811
|
-
|
3812
|
-
update(content,
|
3792
|
+
const warning = (content, options) => {
|
3793
|
+
update(content, { ...options,
|
3813
3794
|
type: 'warning'
|
3814
|
-
})
|
3795
|
+
});
|
3815
3796
|
};
|
3816
3797
|
|
3817
|
-
|
3818
|
-
update(content,
|
3798
|
+
const information = (content, options) => {
|
3799
|
+
update(content, { ...options,
|
3819
3800
|
type: 'information'
|
3820
|
-
})
|
3801
|
+
});
|
3821
3802
|
};
|
3822
3803
|
|
3823
|
-
|
3824
|
-
update(content,
|
3804
|
+
const loading = (content, options) => {
|
3805
|
+
update(content, { ...options,
|
3825
3806
|
type: 'loading'
|
3826
|
-
})
|
3807
|
+
});
|
3827
3808
|
};
|
3828
3809
|
|
3829
3810
|
return {
|
3830
|
-
success
|
3831
|
-
error
|
3832
|
-
warning
|
3833
|
-
information
|
3834
|
-
loading
|
3835
|
-
close
|
3811
|
+
success,
|
3812
|
+
error,
|
3813
|
+
warning,
|
3814
|
+
information,
|
3815
|
+
loading,
|
3816
|
+
close
|
3836
3817
|
};
|
3837
3818
|
}, []); // no need to rebind these every render, do them once in an effect
|
3838
3819
|
|
3839
|
-
React.useEffect(
|
3840
|
-
toaster.success =
|
3841
|
-
|
3842
|
-
|
3843
|
-
|
3844
|
-
|
3845
|
-
}));
|
3846
|
-
};
|
3820
|
+
React.useEffect(() => {
|
3821
|
+
toaster.success = (content, options) => toaster(content, {
|
3822
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT,
|
3823
|
+
...options,
|
3824
|
+
type: 'success'
|
3825
|
+
});
|
3847
3826
|
|
3848
|
-
toaster.error =
|
3849
|
-
|
3850
|
-
|
3851
|
-
}));
|
3852
|
-
};
|
3827
|
+
toaster.error = (content, options) => toaster(content, { ...options,
|
3828
|
+
type: 'error'
|
3829
|
+
});
|
3853
3830
|
|
3854
|
-
toaster.warning =
|
3855
|
-
|
3856
|
-
|
3857
|
-
}));
|
3858
|
-
};
|
3831
|
+
toaster.warning = (content, options) => toaster(content, { ...options,
|
3832
|
+
type: 'warning'
|
3833
|
+
});
|
3859
3834
|
|
3860
|
-
toaster.information =
|
3861
|
-
|
3862
|
-
|
3863
|
-
}));
|
3864
|
-
};
|
3835
|
+
toaster.information = (content, options) => toaster(content, { ...options,
|
3836
|
+
type: 'information'
|
3837
|
+
});
|
3865
3838
|
|
3866
|
-
toaster.loading =
|
3867
|
-
|
3868
|
-
|
3869
|
-
}));
|
3870
|
-
};
|
3839
|
+
toaster.loading = (content, options) => toaster(content, { ...options,
|
3840
|
+
type: 'loading'
|
3841
|
+
});
|
3871
3842
|
}, []);
|
3872
3843
|
return React.createElement(ToastContext.Provider, Object.assign({}, props, {
|
3873
3844
|
value: toaster
|
@@ -3877,41 +3848,35 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
3877
3848
|
role: "log"
|
3878
3849
|
}, React.createElement(framerMotion.AnimatePresence, {
|
3879
3850
|
initial: false
|
3880
|
-
}, toasts.map(
|
3881
|
-
|
3882
|
-
|
3851
|
+
}, toasts.map(toast => React.createElement(framerMotion.motion.div, {
|
3852
|
+
key: toast.id,
|
3853
|
+
transition: {
|
3854
|
+
type: 'spring',
|
3855
|
+
damping: 20,
|
3856
|
+
stiffness: 300
|
3857
|
+
},
|
3858
|
+
initial: {
|
3859
|
+
opacity: 0,
|
3860
|
+
y: 10,
|
3861
|
+
scale: 0.5
|
3862
|
+
},
|
3863
|
+
animate: {
|
3864
|
+
opacity: 1,
|
3865
|
+
y: 0,
|
3866
|
+
scale: 1
|
3867
|
+
},
|
3868
|
+
exit: {
|
3869
|
+
opacity: 0,
|
3870
|
+
scale: 0.5,
|
3883
3871
|
transition: {
|
3884
|
-
|
3885
|
-
damping: 20,
|
3886
|
-
stiffness: 300
|
3887
|
-
},
|
3888
|
-
initial: {
|
3889
|
-
opacity: 0,
|
3890
|
-
y: 10,
|
3891
|
-
scale: 0.5
|
3892
|
-
},
|
3893
|
-
animate: {
|
3894
|
-
opacity: 1,
|
3895
|
-
y: 0,
|
3896
|
-
scale: 1
|
3897
|
-
},
|
3898
|
-
exit: {
|
3899
|
-
opacity: 0,
|
3900
|
-
scale: 0.5,
|
3901
|
-
transition: {
|
3902
|
-
duration: 0.2
|
3903
|
-
}
|
3904
|
-
}
|
3905
|
-
}, React.createElement(Toast, Object.assign({}, toast, {
|
3906
|
-
onClose: function onClose() {
|
3907
|
-
return handleClose(toast.id);
|
3872
|
+
duration: 0.2
|
3908
3873
|
}
|
3909
|
-
}
|
3910
|
-
}
|
3911
|
-
|
3912
|
-
|
3913
|
-
return React.useContext(ToastContext);
|
3874
|
+
}
|
3875
|
+
}, React.createElement(Toast, Object.assign({}, toast, {
|
3876
|
+
onClose: () => handleClose(toast.id)
|
3877
|
+
})))))));
|
3914
3878
|
};
|
3879
|
+
const useToast = () => React.useContext(ToastContext);
|
3915
3880
|
|
3916
3881
|
var defaultLocalisationTexts = {
|
3917
3882
|
calendar: {
|
@@ -4018,7 +3983,7 @@ var useLocalization = function useLocalization() {
|
|
4018
3983
|
return useTaco().localization;
|
4019
3984
|
};
|
4020
3985
|
|
4021
|
-
var _excluded$
|
3986
|
+
var _excluded$5 = ["onChange", "value"];
|
4022
3987
|
|
4023
3988
|
var renderDay = function renderDay(day, modifiers) {
|
4024
3989
|
return modifiers.disabled ? React.createElement("span", {
|
@@ -4097,7 +4062,7 @@ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
|
4097
4062
|
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4098
4063
|
var handleChange = props.onChange,
|
4099
4064
|
value = props.value,
|
4100
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4065
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
|
4101
4066
|
|
4102
4067
|
var _useLocalization2 = useLocalization(),
|
4103
4068
|
locale = _useLocalization2.locale,
|
@@ -4161,7 +4126,7 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4161
4126
|
})));
|
4162
4127
|
});
|
4163
4128
|
|
4164
|
-
var _excluded$
|
4129
|
+
var _excluded$6 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
|
4165
4130
|
var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4166
4131
|
var checked = props.checked,
|
4167
4132
|
highlighted = props.highlighted,
|
@@ -4169,7 +4134,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4169
4134
|
invalid = props.invalid,
|
4170
4135
|
label = props.label,
|
4171
4136
|
onChange = props.onChange,
|
4172
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4137
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
|
4173
4138
|
|
4174
4139
|
var className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem]', {
|
4175
4140
|
'mr-2': !!label,
|
@@ -4243,14 +4208,14 @@ const getButtonStateClasses = invalid => {
|
|
4243
4208
|
return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
|
4244
4209
|
};
|
4245
4210
|
|
4246
|
-
var _excluded$
|
4211
|
+
var _excluded$7 = ["button", "icon", "highlighted", "invalid", "onKeyDown", "autoFocus"];
|
4247
4212
|
var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
4248
4213
|
var button = props.button,
|
4249
4214
|
icon = props.icon,
|
4250
4215
|
invalid = props.invalid,
|
4251
4216
|
onKeyDown = props.onKeyDown,
|
4252
4217
|
autoFocus = props.autoFocus,
|
4253
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4218
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$7);
|
4254
4219
|
|
4255
4220
|
var inputRef = useProxiedRef(ref);
|
4256
4221
|
var hasContainer = button || icon;
|
@@ -5083,12 +5048,12 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5083
5048
|
return dimensions;
|
5084
5049
|
};
|
5085
5050
|
|
5086
|
-
var _excluded$
|
5051
|
+
var _excluded$8 = ["className", "dialog", "style"];
|
5087
5052
|
var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5088
5053
|
var externalClassName = props.className,
|
5089
5054
|
dialog = props.dialog,
|
5090
5055
|
style = props.style,
|
5091
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5056
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
|
5092
5057
|
|
5093
5058
|
var _useCombobox = useCombobox(otherProps, ref),
|
5094
5059
|
combobox = _useCombobox.combobox,
|
@@ -5380,7 +5345,7 @@ function mergeRefs(refs) {
|
|
5380
5345
|
};
|
5381
5346
|
}
|
5382
5347
|
|
5383
|
-
var _excluded$
|
5348
|
+
var _excluded$9 = ["children", "trigger"];
|
5384
5349
|
var PopoverContext = /*#__PURE__*/React.createContext({
|
5385
5350
|
props: {},
|
5386
5351
|
ref: null
|
@@ -5444,7 +5409,7 @@ var Close$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
5444
5409
|
var Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
5445
5410
|
var children = props.children,
|
5446
5411
|
trigger = props.trigger,
|
5447
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5412
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
|
5448
5413
|
|
5449
5414
|
var context = React.useMemo(function () {
|
5450
5415
|
return {
|
@@ -5460,7 +5425,7 @@ Popover.Trigger = Trigger$1;
|
|
5460
5425
|
Popover.Content = Content$1;
|
5461
5426
|
Popover.Close = Close$1;
|
5462
5427
|
|
5463
|
-
var _excluded$
|
5428
|
+
var _excluded$a = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
5464
5429
|
var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5465
5430
|
var _input$disabled;
|
5466
5431
|
|
@@ -5469,7 +5434,7 @@ var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
|
5469
5434
|
style = props.style,
|
5470
5435
|
shortcuts = props.shortcuts,
|
5471
5436
|
shortcutsText = props.shortcutsText,
|
5472
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5437
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
|
5473
5438
|
|
5474
5439
|
var _useDatepicker = useDatepicker(otherProps, ref),
|
5475
5440
|
calendar = _useDatepicker.calendar,
|
@@ -5764,7 +5729,7 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5764
5729
|
});
|
5765
5730
|
Extra.displayName = 'DialogExtra';
|
5766
5731
|
|
5767
|
-
var _excluded$
|
5732
|
+
var _excluded$b = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
|
5768
5733
|
|
5769
5734
|
var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
5770
5735
|
return React.useMemo(function () {
|
@@ -5801,7 +5766,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
|
5801
5766
|
_props$size = props.size,
|
5802
5767
|
size = _props$size === void 0 ? 'sm' : _props$size,
|
5803
5768
|
trigger = props.trigger,
|
5804
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5769
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
5805
5770
|
|
5806
5771
|
var _useSeparatedChildren = useSeparatedChildren(initialChildren),
|
5807
5772
|
children = _useSeparatedChildren[0],
|
@@ -5851,14 +5816,14 @@ Dialog.Extra = Extra;
|
|
5851
5816
|
Dialog.Drawer = Drawer;
|
5852
5817
|
Dialog.Close = Close$2;
|
5853
5818
|
|
5854
|
-
var _excluded$
|
5819
|
+
var _excluded$c = ["disabled", "children", "invalid", "message"];
|
5855
5820
|
var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5856
5821
|
var disabled = props.disabled,
|
5857
5822
|
children = props.children,
|
5858
5823
|
_props$invalid = props.invalid,
|
5859
5824
|
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
5860
5825
|
message = props.message,
|
5861
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5826
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$c);
|
5862
5827
|
|
5863
5828
|
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5864
5829
|
'text-grey-dark': disabled
|
@@ -5878,11 +5843,11 @@ var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5878
5843
|
}, message));
|
5879
5844
|
});
|
5880
5845
|
|
5881
|
-
var _excluded$
|
5846
|
+
var _excluded$d = ["horizontal"];
|
5882
5847
|
var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
5883
5848
|
var _props$horizontal = props.horizontal,
|
5884
5849
|
horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
|
5885
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5850
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
5886
5851
|
|
5887
5852
|
var className = cn('yt-form', {
|
5888
5853
|
'yt-form--horizontal flex flex-wrap': horizontal
|
@@ -5894,11 +5859,11 @@ var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5894
5859
|
}));
|
5895
5860
|
});
|
5896
5861
|
|
5897
|
-
var _excluded$
|
5862
|
+
var _excluded$e = ["as"];
|
5898
5863
|
var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5899
5864
|
var _props$as = props.as,
|
5900
5865
|
Tag = _props$as === void 0 ? 'span' : _props$as,
|
5901
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5866
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$e);
|
5902
5867
|
|
5903
5868
|
var className = cn('flex ', props.className);
|
5904
5869
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
@@ -5908,7 +5873,7 @@ var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5908
5873
|
}));
|
5909
5874
|
});
|
5910
5875
|
|
5911
|
-
var _excluded$
|
5876
|
+
var _excluded$f = ["anchor", "children", "defaultOpen"];
|
5912
5877
|
var HangerContext = /*#__PURE__*/React.createContext({
|
5913
5878
|
props: {},
|
5914
5879
|
ref: null
|
@@ -5965,7 +5930,7 @@ var Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
|
5965
5930
|
children = props.children,
|
5966
5931
|
_props$defaultOpen = props.defaultOpen,
|
5967
5932
|
defaultOpen = _props$defaultOpen === void 0 ? true : _props$defaultOpen,
|
5968
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5933
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$f);
|
5969
5934
|
|
5970
5935
|
var context = React.useMemo(function () {
|
5971
5936
|
return {
|
@@ -6337,11 +6302,11 @@ const useMultiListbox = ({
|
|
6337
6302
|
};
|
6338
6303
|
};
|
6339
6304
|
|
6340
|
-
var _excluded$
|
6305
|
+
var _excluded$g = ["className"],
|
6341
6306
|
_excluded2$1 = ["className"];
|
6342
6307
|
var Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6343
6308
|
var externalClassName = props.className,
|
6344
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
6309
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$g);
|
6345
6310
|
|
6346
6311
|
var _useListbox = useListbox(otherProps, ref),
|
6347
6312
|
list = _useListbox.list,
|
@@ -6642,7 +6607,7 @@ const Checkbox$1 = props => {
|
|
6642
6607
|
})), children);
|
6643
6608
|
};
|
6644
6609
|
|
6645
|
-
var _excluded$
|
6610
|
+
var _excluded$h = ["children", "value"],
|
6646
6611
|
_excluded2$2 = ["children", "defaultValue", "disabled", "invalid", "onChange", "orientation", "value"];
|
6647
6612
|
var getRadioGroupItemValueAsString = function getRadioGroupItemValueAsString(value) {
|
6648
6613
|
return value === null ? '' : String(value);
|
@@ -6661,7 +6626,7 @@ var RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(props
|
|
6661
6626
|
|
6662
6627
|
var children = props.children,
|
6663
6628
|
value = props.value,
|
6664
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
6629
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$h);
|
6665
6630
|
|
6666
6631
|
var disabled = context.disabled || props.disabled;
|
6667
6632
|
var className = cn('flex flex-shrink-0 self-start items-center justify-center h-4 w-4 mr-2 mt-[0.2rem] rounded-full bg-white border-2 ', {
|
@@ -6852,12 +6817,12 @@ const Header = props => {
|
|
6852
6817
|
}));
|
6853
6818
|
};
|
6854
6819
|
|
6855
|
-
var _excluded$
|
6820
|
+
var _excluded$i = ["appearance", "children", "trigger"];
|
6856
6821
|
var Menu = function Menu(externalProps) {
|
6857
6822
|
var externalAppearance = externalProps.appearance,
|
6858
6823
|
children = externalProps.children,
|
6859
6824
|
trigger = externalProps.trigger,
|
6860
|
-
props = _objectWithoutPropertiesLoose(externalProps, _excluded$
|
6825
|
+
props = _objectWithoutPropertiesLoose(externalProps, _excluded$i);
|
6861
6826
|
|
6862
6827
|
var _React$useState = React.useState(false),
|
6863
6828
|
open = _React$useState[0],
|
@@ -6911,44 +6876,39 @@ Menu.Separator = Separator;
|
|
6911
6876
|
Menu.Header = Header;
|
6912
6877
|
Menu.RadioGroup = RadioGroup$1;
|
6913
6878
|
|
6914
|
-
|
6915
|
-
var TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
6879
|
+
const TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
6916
6880
|
return React__default.createElement("a", Object.assign({}, props, {
|
6917
6881
|
ref: ref
|
6918
6882
|
}));
|
6919
6883
|
});
|
6920
|
-
|
6921
|
-
|
6922
|
-
|
6923
|
-
|
6924
|
-
|
6925
|
-
|
6926
|
-
|
6927
|
-
|
6928
|
-
|
6929
|
-
|
6930
|
-
|
6931
|
-
|
6932
|
-
setExpanded = _React$useState[1];
|
6933
|
-
|
6934
|
-
React__default.useEffect(function () {
|
6884
|
+
const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGroup(props, ref) {
|
6885
|
+
const {
|
6886
|
+
children,
|
6887
|
+
className: externalClassName,
|
6888
|
+
expanded: initialExpanded = false,
|
6889
|
+
title,
|
6890
|
+
fixed,
|
6891
|
+
onClick,
|
6892
|
+
...otherProps
|
6893
|
+
} = props;
|
6894
|
+
const [expanded, setExpanded] = React__default.useState(fixed || initialExpanded);
|
6895
|
+
React__default.useEffect(() => {
|
6935
6896
|
if (!fixed) {
|
6936
6897
|
setExpanded(fixed || initialExpanded);
|
6937
6898
|
}
|
6938
6899
|
}, [fixed, initialExpanded]);
|
6939
|
-
|
6900
|
+
const listClassName = cn('flex-col mb-0', {
|
6940
6901
|
flex: expanded,
|
6941
6902
|
hidden: !expanded
|
6942
6903
|
});
|
6943
|
-
|
6944
|
-
var itemProps = _extends({}, otherProps, {
|
6904
|
+
const itemProps = { ...otherProps,
|
6945
6905
|
'aria-expanded': expanded,
|
6946
6906
|
role: 'treeitem',
|
6947
6907
|
tabIndex: -1
|
6948
|
-
}
|
6908
|
+
};
|
6949
6909
|
|
6950
|
-
|
6951
|
-
|
6910
|
+
const handleClick = event => {
|
6911
|
+
const nextState = !expanded;
|
6952
6912
|
|
6953
6913
|
if (!fixed) {
|
6954
6914
|
setExpanded(nextState);
|
@@ -6959,7 +6919,7 @@ var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGrou
|
|
6959
6919
|
}
|
6960
6920
|
};
|
6961
6921
|
|
6962
|
-
|
6922
|
+
const className = typeof externalClassName === 'function' ? externalClassName(expanded) : externalClassName;
|
6963
6923
|
return React__default.createElement("div", Object.assign({}, itemProps, {
|
6964
6924
|
className: className,
|
6965
6925
|
ref: ref
|
@@ -6968,18 +6928,14 @@ var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGrou
|
|
6968
6928
|
}, typeof title === 'function' ? title(expanded) : title), React__default.createElement("ul", {
|
6969
6929
|
role: "group",
|
6970
6930
|
className: listClassName
|
6971
|
-
}, React__default.Children.toArray(children).filter(
|
6972
|
-
|
6973
|
-
|
6974
|
-
|
6975
|
-
|
6976
|
-
|
6977
|
-
}, React__default.cloneElement(item, {
|
6978
|
-
role: 'treeitem'
|
6979
|
-
}));
|
6980
|
-
})));
|
6931
|
+
}, React__default.Children.toArray(children).filter(item => !!item).map((item, i) => React__default.createElement("li", {
|
6932
|
+
key: i,
|
6933
|
+
role: "none"
|
6934
|
+
}, React__default.cloneElement(item, {
|
6935
|
+
role: 'treeitem'
|
6936
|
+
})))));
|
6981
6937
|
});
|
6982
|
-
|
6938
|
+
const Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props, ref) {
|
6983
6939
|
return React__default.createElement("div", Object.assign({}, props, {
|
6984
6940
|
ref: ref,
|
6985
6941
|
role: "tree"
|
@@ -7022,7 +6978,7 @@ const useDropTarget = onDrop => {
|
|
7022
6978
|
return [isDraggedOver, props];
|
7023
6979
|
};
|
7024
6980
|
|
7025
|
-
var _excluded$
|
6981
|
+
var _excluded$j = ["active", "children", "onDrop", "postfix", "prefix", "role"],
|
7026
6982
|
_excluded2$3 = ["children"];
|
7027
6983
|
var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
7028
6984
|
var active = props.active,
|
@@ -7031,7 +6987,7 @@ var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
|
7031
6987
|
postfix = props.postfix,
|
7032
6988
|
prefix = props.prefix,
|
7033
6989
|
role = props.role,
|
7034
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
6990
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$j);
|
7035
6991
|
|
7036
6992
|
var proxyRef = useProxiedRef(ref);
|
7037
6993
|
|
@@ -7230,8 +7186,6 @@ const useSelect = ({
|
|
7230
7186
|
setInputValueByRef$1(internalInputRef.current, value);
|
7231
7187
|
} else if (value !== undefined && data.some(option => option.value === value)) {
|
7232
7188
|
setInputValueByRef$1(internalInputRef.current, value);
|
7233
|
-
} else if (data.length && defaultValue === undefined) {
|
7234
|
-
setInputValueByRef$1(internalInputRef.current, data[0].value);
|
7235
7189
|
}
|
7236
7190
|
}, []); // event handlers
|
7237
7191
|
|
@@ -7376,13 +7330,13 @@ const useSelect = ({
|
|
7376
7330
|
};
|
7377
7331
|
};
|
7378
7332
|
|
7379
|
-
var _excluded$
|
7333
|
+
var _excluded$k = ["autoFocus", "className", "highlighted", "style"],
|
7380
7334
|
_excluded2$4 = ["editable"];
|
7381
7335
|
var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
|
7382
7336
|
var autoFocus = props.autoFocus,
|
7383
7337
|
externalClassName = props.className,
|
7384
7338
|
style = props.style,
|
7385
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
7339
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$k);
|
7386
7340
|
|
7387
7341
|
var _useSelect = useSelect(otherProps, ref),
|
7388
7342
|
button = _useSelect.button,
|
@@ -7519,7 +7473,7 @@ const usePagination = (initialPageIndex = 0, initialPageSize = 10) => {
|
|
7519
7473
|
};
|
7520
7474
|
};
|
7521
7475
|
|
7522
|
-
var _excluded$
|
7476
|
+
var _excluded$l = ["length", "pageIndex", "pageSize", "pageSizes", "setPageIndex", "setPageSize", "showPageControls", "showPageNumbers", "showPageSize", "dangerouslyHijackGlobalKeyboardNavigation"];
|
7523
7477
|
|
7524
7478
|
var getShowingLabel = function getShowingLabel(length, pageIndex, pageSize, texts) {
|
7525
7479
|
var minItemIndex = pageIndex * pageSize + 1;
|
@@ -7543,7 +7497,7 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
|
7543
7497
|
showPageSize = _props$showPageSize === void 0 ? true : _props$showPageSize,
|
7544
7498
|
_props$dangerouslyHij = props.dangerouslyHijackGlobalKeyboardNavigation,
|
7545
7499
|
dangerouslyHijackGlobalKeyboardNavigation = _props$dangerouslyHij === void 0 ? false : _props$dangerouslyHij,
|
7546
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
7500
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$l);
|
7547
7501
|
|
7548
7502
|
var _useLocalization = useLocalization(),
|
7549
7503
|
texts = _useLocalization.texts;
|
@@ -7626,13 +7580,13 @@ var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
|
7626
7580
|
})));
|
7627
7581
|
});
|
7628
7582
|
|
7629
|
-
var _excluded$
|
7583
|
+
var _excluded$m = ["duration"];
|
7630
7584
|
var Progress = function Progress(_ref) {
|
7631
7585
|
var _cn;
|
7632
7586
|
|
7633
7587
|
var _ref$duration = _ref.duration,
|
7634
7588
|
duration = _ref$duration === void 0 ? undefined : _ref$duration,
|
7635
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
7589
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
7636
7590
|
|
7637
7591
|
var style;
|
7638
7592
|
|
@@ -9255,19 +9209,16 @@ const useTableRowCreation = (data, tableRef) => {
|
|
9255
9209
|
};
|
9256
9210
|
};
|
9257
9211
|
|
9258
|
-
|
9259
|
-
|
9260
|
-
|
9261
|
-
|
9262
|
-
|
9263
|
-
|
9264
|
-
|
9265
|
-
|
9266
|
-
|
9267
|
-
|
9268
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$r);
|
9269
|
-
|
9270
|
-
var className = cn('yt-tabs', "yt-tabs--" + orientation, {
|
9212
|
+
const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
9213
|
+
const {
|
9214
|
+
id,
|
9215
|
+
defaultId,
|
9216
|
+
children,
|
9217
|
+
onChange,
|
9218
|
+
orientation = 'horizontal',
|
9219
|
+
...otherProps
|
9220
|
+
} = props;
|
9221
|
+
const className = cn('yt-tabs', `yt-tabs--${orientation}`, {
|
9271
9222
|
'flex w-full': orientation === 'vertical'
|
9272
9223
|
}, props.className);
|
9273
9224
|
return React.createElement(TabsPrimitive.Root, Object.assign({}, otherProps, {
|
@@ -9281,19 +9232,20 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
|
9281
9232
|
value: id
|
9282
9233
|
}), children);
|
9283
9234
|
});
|
9284
|
-
|
9285
|
-
|
9235
|
+
const TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9236
|
+
const className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);
|
9286
9237
|
return React.createElement(TabsPrimitive.List, Object.assign({}, props, {
|
9287
9238
|
className: className,
|
9288
9239
|
ref: ref
|
9289
9240
|
}));
|
9290
9241
|
});
|
9291
|
-
|
9292
|
-
|
9293
|
-
|
9294
|
-
|
9295
|
-
|
9296
|
-
|
9242
|
+
const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9243
|
+
const {
|
9244
|
+
id,
|
9245
|
+
disabled,
|
9246
|
+
...otherProps
|
9247
|
+
} = props;
|
9248
|
+
const className = cn('yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4', disabled ? 'cursor-not-allowed !text-grey' : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue', props.className);
|
9297
9249
|
return React.createElement(TabsPrimitive.Trigger, Object.assign({}, otherProps, {
|
9298
9250
|
className: className,
|
9299
9251
|
disabled: disabled,
|
@@ -9304,11 +9256,12 @@ var TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
9304
9256
|
value: id
|
9305
9257
|
}));
|
9306
9258
|
});
|
9307
|
-
|
9308
|
-
|
9309
|
-
|
9310
|
-
|
9311
|
-
|
9259
|
+
const TabContent = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9260
|
+
const {
|
9261
|
+
id,
|
9262
|
+
...otherProps
|
9263
|
+
} = props;
|
9264
|
+
const className = cn('yt-tab__panel outline-none', props.className);
|
9312
9265
|
return React.createElement(TabsPrimitive.Content, Object.assign({}, otherProps, {
|
9313
9266
|
className: className,
|
9314
9267
|
ref: ref,
|
@@ -9319,19 +9272,22 @@ Tabs.List = TabList;
|
|
9319
9272
|
Tabs.Trigger = TabTrigger;
|
9320
9273
|
Tabs.Content = TabContent;
|
9321
9274
|
|
9322
|
-
|
9323
|
-
|
9324
|
-
|
9325
|
-
|
9326
|
-
|
9327
|
-
|
9275
|
+
const Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
9276
|
+
const {
|
9277
|
+
defaultValue: _,
|
9278
|
+
highlighted,
|
9279
|
+
invalid,
|
9280
|
+
onKeyDown,
|
9281
|
+
...otherProps
|
9282
|
+
} = props;
|
9283
|
+
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
|
9328
9284
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
9329
9285
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
9330
9286
|
|
9331
|
-
|
9287
|
+
const handleKeyDown = event => {
|
9332
9288
|
if (event.key === 'Home' || event.key === 'End') {
|
9333
9289
|
event.preventDefault();
|
9334
|
-
|
9290
|
+
const position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
9335
9291
|
event.currentTarget.setSelectionRange(position, position);
|
9336
9292
|
event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;
|
9337
9293
|
}
|
@@ -9349,18 +9305,18 @@ var Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
|
9349
9305
|
}));
|
9350
9306
|
});
|
9351
9307
|
|
9352
|
-
|
9353
|
-
|
9354
|
-
|
9355
|
-
|
9356
|
-
|
9357
|
-
|
9358
|
-
|
9308
|
+
const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
9309
|
+
const {
|
9310
|
+
label,
|
9311
|
+
onChange,
|
9312
|
+
...otherProps
|
9313
|
+
} = props;
|
9314
|
+
const className = cn('group h-6 w-10 flex rounded-full inline-flex', {
|
9359
9315
|
'mr-2': !!label,
|
9360
9316
|
'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,
|
9361
9317
|
'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled
|
9362
9318
|
}, props.className);
|
9363
|
-
|
9319
|
+
const element = React.createElement(PrimitiveSwitch.Root, Object.assign({}, otherProps, {
|
9364
9320
|
className: className,
|
9365
9321
|
onCheckedChange: onChange,
|
9366
9322
|
ref: ref
|
@@ -9369,7 +9325,7 @@ var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9369
9325
|
}));
|
9370
9326
|
|
9371
9327
|
if (label) {
|
9372
|
-
|
9328
|
+
const labelClassName = cn('flex items-center cursor-pointer', {
|
9373
9329
|
'cursor-not-allowed text-grey-dark': props.disabled
|
9374
9330
|
});
|
9375
9331
|
return React.createElement("label", {
|
@@ -9380,23 +9336,22 @@ var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9380
9336
|
return element;
|
9381
9337
|
});
|
9382
9338
|
|
9383
|
-
|
9384
|
-
|
9385
|
-
|
9386
|
-
|
9387
|
-
|
9388
|
-
|
9389
|
-
|
9390
|
-
|
9391
|
-
|
9392
|
-
|
9393
|
-
|
9394
|
-
|
9395
|
-
|
9396
|
-
|
9397
|
-
|
9398
|
-
|
9399
|
-
var onWindowKeyDown = function onWindowKeyDown(event) {
|
9339
|
+
const Tooltip$1 = ({
|
9340
|
+
continuous,
|
9341
|
+
index,
|
9342
|
+
isLastStep,
|
9343
|
+
step,
|
9344
|
+
backProps,
|
9345
|
+
primaryProps,
|
9346
|
+
skipProps,
|
9347
|
+
tooltipProps,
|
9348
|
+
size,
|
9349
|
+
locale,
|
9350
|
+
disableTourSkipOnEsc
|
9351
|
+
}) => {
|
9352
|
+
const skipButtonRef = React.useRef(null);
|
9353
|
+
React.useEffect(() => {
|
9354
|
+
const onWindowKeyDown = event => {
|
9400
9355
|
if (!disableTourSkipOnEsc) {
|
9401
9356
|
if (event.keyCode === keycode('esc') && skipButtonRef.current !== null) {
|
9402
9357
|
event.preventDefault();
|
@@ -9407,7 +9362,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
9407
9362
|
};
|
9408
9363
|
|
9409
9364
|
window.addEventListener('keydown', onWindowKeyDown);
|
9410
|
-
return
|
9365
|
+
return () => {
|
9411
9366
|
window.removeEventListener('keydown', onWindowKeyDown);
|
9412
9367
|
};
|
9413
9368
|
}, []);
|
@@ -9426,30 +9381,30 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
9426
9381
|
appearance: "discrete"
|
9427
9382
|
}), locale.back), React.createElement(Button$1, Object.assign({}, primaryProps, {
|
9428
9383
|
appearance: "primary"
|
9429
|
-
}), continuous ? isLastStep ? locale.last
|
9384
|
+
}), continuous ? isLastStep ? `${locale.last} (${index + 1}/${size})` : `${locale.next} (${index + 1}/${size})` : locale.close)));
|
9430
9385
|
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
9431
9386
|
|
9432
9387
|
|
9433
|
-
|
9434
|
-
|
9435
|
-
|
9436
|
-
|
9437
|
-
|
9438
|
-
|
9439
|
-
|
9440
|
-
|
9441
|
-
|
9442
|
-
|
9443
|
-
|
9444
|
-
|
9445
|
-
|
9446
|
-
|
9447
|
-
|
9448
|
-
|
9449
|
-
|
9450
|
-
|
9451
|
-
return React.Children.map(props.children,
|
9452
|
-
|
9388
|
+
const TourStep = _props => null;
|
9389
|
+
const Tour = props => {
|
9390
|
+
const {
|
9391
|
+
texts: {
|
9392
|
+
tour
|
9393
|
+
}
|
9394
|
+
} = useLocalization();
|
9395
|
+
const {
|
9396
|
+
autoStart: run,
|
9397
|
+
onComplete,
|
9398
|
+
onClose,
|
9399
|
+
onReady,
|
9400
|
+
spotlightClicks,
|
9401
|
+
disableCloseOnEsc: disableTourSkipOnEsc,
|
9402
|
+
disableScrollParentFix = false,
|
9403
|
+
...rest
|
9404
|
+
} = props;
|
9405
|
+
const steps = React.useMemo(() => {
|
9406
|
+
return React.Children.map(props.children, child => {
|
9407
|
+
const step = {
|
9453
9408
|
disableBeacon: !child.props.showBeacon,
|
9454
9409
|
target: child.props.selector,
|
9455
9410
|
placement: child.props.position,
|
@@ -9459,12 +9414,10 @@ var Tour = function Tour(props) {
|
|
9459
9414
|
return step;
|
9460
9415
|
});
|
9461
9416
|
}, [props.children]);
|
9462
|
-
|
9417
|
+
const getStep = React.useCallback(selector => {
|
9463
9418
|
var _props$children$find;
|
9464
9419
|
|
9465
|
-
return (_props$children$find = props.children.find(
|
9466
|
-
return child.props.selector === selector;
|
9467
|
-
})) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
9420
|
+
return (_props$children$find = props.children.find(child => child.props.selector === selector)) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
9468
9421
|
}, [props.children]);
|
9469
9422
|
|
9470
9423
|
function callback(state) {
|
@@ -9494,12 +9447,10 @@ var Tour = function Tour(props) {
|
|
9494
9447
|
floaterProps: {
|
9495
9448
|
disableAnimation: true
|
9496
9449
|
},
|
9497
|
-
tooltipComponent:
|
9498
|
-
|
9499
|
-
|
9500
|
-
|
9501
|
-
}));
|
9502
|
-
},
|
9450
|
+
tooltipComponent: tooltipProps => React.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
|
9451
|
+
locale: tour,
|
9452
|
+
disableTourSkipOnEsc: disableTourSkipOnEsc
|
9453
|
+
})),
|
9503
9454
|
locale: tour,
|
9504
9455
|
spotlightPadding: 8,
|
9505
9456
|
spotlightClicks: spotlightClicks,
|
@@ -9540,10 +9491,10 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9540
9491
|
}, [ref, callback]);
|
9541
9492
|
};
|
9542
9493
|
|
9543
|
-
var _excluded$
|
9494
|
+
var _excluded$n = ["onSearch"];
|
9544
9495
|
var SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput(_ref, ref) {
|
9545
9496
|
var onSearch = _ref.onSearch,
|
9546
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
9497
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
9547
9498
|
|
9548
9499
|
var _useLocalization = useLocalization(),
|
9549
9500
|
texts = _useLocalization.texts;
|