@economic/taco 1.0.6 → 1.0.9
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/Card/Card.d.ts +14 -0
- package/dist/esm/components/Card/Card.js +75 -0
- package/dist/esm/components/Card/Card.js.map +1 -0
- package/dist/esm/components/Navigation/Navigation.js +44 -35
- package/dist/esm/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +56 -39
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +34 -29
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js +15 -11
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Provider/Provider.js +18 -13
- package/dist/esm/components/Provider/Provider.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +60 -47
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +1 -0
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.js +31 -30
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +19 -12
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +10 -9
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +27 -25
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +9 -11
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/components/Toast/Toaster.js +118 -88
- package/dist/esm/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +8 -7
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +50 -44
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Treeview/Treeview.js +36 -26
- 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 +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/taco.cjs.development.js +613 -496
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +3 -3
- package/types.json +531 -459
@@ -3254,7 +3254,7 @@ var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
|
|
3254
3254
|
}));
|
3255
3255
|
});
|
3256
3256
|
|
3257
|
-
|
3257
|
+
var VisuallyHidden = /*#__PURE__*/React.forwardRef(function VisuallyHidden(props, ref) {
|
3258
3258
|
return React.createElement("span", Object.assign({}, props, {
|
3259
3259
|
className: "sr-only",
|
3260
3260
|
ref: ref
|
@@ -3372,13 +3372,13 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
3372
3372
|
}), React.Children.count(props.children) > 1 ? React.Children.map(props.children, child => typeof child === 'string' ? React.createElement("span", null, child) : child) : props.children);
|
3373
3373
|
});
|
3374
3374
|
|
3375
|
-
|
3376
|
-
|
3377
|
-
|
3378
|
-
|
3379
|
-
|
3380
|
-
|
3381
|
-
|
3375
|
+
var _excluded$3 = ["title", "children", "placement"];
|
3376
|
+
var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
3377
|
+
var title = props.title,
|
3378
|
+
children = props.children,
|
3379
|
+
placement = props.placement,
|
3380
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
3381
|
+
|
3382
3382
|
return React.createElement(TooltipPrimitive.Root, {
|
3383
3383
|
delayDuration: 50
|
3384
3384
|
}, React.createElement(TooltipPrimitive.Trigger, {
|
@@ -3470,12 +3470,12 @@ const createButton = (props, className, ref) => {
|
|
3470
3470
|
return button;
|
3471
3471
|
};
|
3472
3472
|
|
3473
|
-
var _excluded$
|
3473
|
+
var _excluded$4 = ["icon", "rounded"];
|
3474
3474
|
var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
3475
3475
|
var icon = props.icon,
|
3476
3476
|
_props$rounded = props.rounded,
|
3477
3477
|
rounded = _props$rounded === void 0 ? false : _props$rounded,
|
3478
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3478
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
3479
3479
|
|
3480
3480
|
var className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3481
3481
|
'rounded-full': rounded,
|
@@ -3514,10 +3514,10 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3514
3514
|
}) : null);
|
3515
3515
|
});
|
3516
3516
|
|
3517
|
-
var _excluded$
|
3517
|
+
var _excluded$5 = ["fluid"];
|
3518
3518
|
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3519
3519
|
var fluid = props.fluid,
|
3520
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3520
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
|
3521
3521
|
|
3522
3522
|
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3523
3523
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3588,21 +3588,27 @@ function useTimer(duration = 0, callback) {
|
|
3588
3588
|
};
|
3589
3589
|
}
|
3590
3590
|
|
3591
|
-
|
3592
|
-
|
3593
|
-
|
3594
|
-
|
3595
|
-
|
3596
|
-
|
3597
|
-
|
3598
|
-
React__default.
|
3599
|
-
|
3591
|
+
var _excluded$6 = ["delay", "label"];
|
3592
|
+
var Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
3593
|
+
var _props$delay = props.delay,
|
3594
|
+
delay = _props$delay === void 0 ? 500 : _props$delay,
|
3595
|
+
label = props.label,
|
3596
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
|
3597
|
+
|
3598
|
+
var _React$useState = React__default.useState(!delay),
|
3599
|
+
visible = _React$useState[0],
|
3600
|
+
setVisibility = _React$useState[1];
|
3601
|
+
|
3602
|
+
React__default.useEffect(function () {
|
3603
|
+
var timeout;
|
3600
3604
|
|
3601
3605
|
if (delay) {
|
3602
|
-
timeout = window.setTimeout(
|
3606
|
+
timeout = window.setTimeout(function () {
|
3607
|
+
return setVisibility(true);
|
3608
|
+
}, delay);
|
3603
3609
|
}
|
3604
3610
|
|
3605
|
-
return ()
|
3611
|
+
return function () {
|
3606
3612
|
if (timeout) {
|
3607
3613
|
clearTimeout(timeout);
|
3608
3614
|
}
|
@@ -3613,7 +3619,7 @@ const Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props,
|
|
3613
3619
|
return null;
|
3614
3620
|
}
|
3615
3621
|
|
3616
|
-
|
3622
|
+
var className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
3617
3623
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
3618
3624
|
className: className,
|
3619
3625
|
"data-taco": "spinner",
|
@@ -3739,49 +3745,62 @@ const Toast = ({
|
|
3739
3745
|
}));
|
3740
3746
|
};
|
3741
3747
|
|
3742
|
-
|
3743
|
-
|
3748
|
+
var _excluded$7 = ["children"];
|
3749
|
+
var DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
|
3750
|
+
var ToastContext = /*#__PURE__*/React.createContext({});
|
3744
3751
|
|
3745
|
-
|
3746
|
-
|
3747
|
-
|
3752
|
+
var insertToastWithoutDuplicates = function insertToastWithoutDuplicates(currentToasts, id, content, options, close) {
|
3753
|
+
var nextToasts = [].concat(currentToasts);
|
3754
|
+
var existingToastIndex = currentToasts.findIndex(function (toast) {
|
3755
|
+
return JSON.stringify(toast.content) === JSON.stringify(content);
|
3756
|
+
});
|
3748
3757
|
|
3749
3758
|
if (existingToastIndex > -1) {
|
3750
3759
|
nextToasts[existingToastIndex].lastDuplicateId = id;
|
3751
3760
|
nextToasts[existingToastIndex].lastUpdated = Date.now();
|
3752
3761
|
} else {
|
3753
3762
|
nextToasts.push({
|
3754
|
-
id,
|
3763
|
+
id: id,
|
3755
3764
|
content: typeof content === 'function' ? content(close) : content,
|
3756
|
-
options
|
3765
|
+
options: options
|
3757
3766
|
});
|
3758
3767
|
}
|
3759
3768
|
|
3760
3769
|
return nextToasts;
|
3761
3770
|
};
|
3762
3771
|
|
3763
|
-
|
3764
|
-
children,
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3772
|
+
var ToastProvider = function ToastProvider(_ref) {
|
3773
|
+
var children = _ref.children,
|
3774
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
3775
|
+
|
3776
|
+
var _React$useState = React.useState([]),
|
3777
|
+
toasts = _React$useState[0],
|
3778
|
+
setToasts = _React$useState[1];
|
3768
3779
|
|
3769
|
-
|
3770
|
-
setToasts(
|
3780
|
+
var handleClose = function handleClose(id) {
|
3781
|
+
setToasts(function (currentToasts) {
|
3782
|
+
return currentToasts.filter(function (toast) {
|
3783
|
+
return toast.id !== id;
|
3784
|
+
});
|
3785
|
+
});
|
3771
3786
|
}; // memoize (useCallback) this function,
|
3772
3787
|
// it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children
|
3773
3788
|
|
3774
3789
|
|
3775
|
-
|
3776
|
-
|
3790
|
+
var toaster = React.useCallback(function (content, options) {
|
3791
|
+
var id = uuid.v4();
|
3777
3792
|
|
3778
|
-
|
3793
|
+
var close = function close() {
|
3794
|
+
return handleClose(id);
|
3795
|
+
};
|
3779
3796
|
|
3780
|
-
setToasts(
|
3797
|
+
setToasts(function (currentToasts) {
|
3798
|
+
return insertToastWithoutDuplicates(currentToasts, id, content, options, close);
|
3799
|
+
});
|
3781
3800
|
|
3782
|
-
|
3783
|
-
setToasts(currentToasts
|
3784
|
-
|
3801
|
+
var update = function update(content, options) {
|
3802
|
+
setToasts(function (currentToasts) {
|
3803
|
+
var nextToasts = currentToasts.filter(function (toast) {
|
3785
3804
|
if (toast.lastDuplicateId) {
|
3786
3805
|
return toast.lastDuplicateId !== id;
|
3787
3806
|
}
|
@@ -3792,70 +3811,80 @@ const ToastProvider = ({
|
|
3792
3811
|
});
|
3793
3812
|
};
|
3794
3813
|
|
3795
|
-
|
3796
|
-
update(content, {
|
3797
|
-
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3798
|
-
|
3814
|
+
var success = function success(content, options) {
|
3815
|
+
update(content, _extends({
|
3816
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3817
|
+
}, options, {
|
3799
3818
|
type: 'success'
|
3800
|
-
});
|
3819
|
+
}));
|
3801
3820
|
};
|
3802
3821
|
|
3803
|
-
|
3804
|
-
update(content, {
|
3822
|
+
var error = function error(content, options) {
|
3823
|
+
update(content, _extends({}, options, {
|
3805
3824
|
type: 'error'
|
3806
|
-
});
|
3825
|
+
}));
|
3807
3826
|
};
|
3808
3827
|
|
3809
|
-
|
3810
|
-
update(content, {
|
3828
|
+
var warning = function warning(content, options) {
|
3829
|
+
update(content, _extends({}, options, {
|
3811
3830
|
type: 'warning'
|
3812
|
-
});
|
3831
|
+
}));
|
3813
3832
|
};
|
3814
3833
|
|
3815
|
-
|
3816
|
-
update(content, {
|
3834
|
+
var information = function information(content, options) {
|
3835
|
+
update(content, _extends({}, options, {
|
3817
3836
|
type: 'information'
|
3818
|
-
});
|
3837
|
+
}));
|
3819
3838
|
};
|
3820
3839
|
|
3821
|
-
|
3822
|
-
update(content, {
|
3840
|
+
var loading = function loading(content, options) {
|
3841
|
+
update(content, _extends({}, options, {
|
3823
3842
|
type: 'loading'
|
3824
|
-
});
|
3843
|
+
}));
|
3825
3844
|
};
|
3826
3845
|
|
3827
3846
|
return {
|
3828
|
-
success,
|
3829
|
-
error,
|
3830
|
-
warning,
|
3831
|
-
information,
|
3832
|
-
loading,
|
3833
|
-
close
|
3847
|
+
success: success,
|
3848
|
+
error: error,
|
3849
|
+
warning: warning,
|
3850
|
+
information: information,
|
3851
|
+
loading: loading,
|
3852
|
+
close: close
|
3834
3853
|
};
|
3835
3854
|
}, []); // no need to rebind these every render, do them once in an effect
|
3836
3855
|
|
3837
|
-
React.useEffect(()
|
3838
|
-
toaster.success = (content, options)
|
3839
|
-
|
3840
|
-
|
3841
|
-
|
3842
|
-
|
3856
|
+
React.useEffect(function () {
|
3857
|
+
toaster.success = function (content, options) {
|
3858
|
+
return toaster(content, _extends({
|
3859
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3860
|
+
}, options, {
|
3861
|
+
type: 'success'
|
3862
|
+
}));
|
3863
|
+
};
|
3843
3864
|
|
3844
|
-
toaster.error = (content, options)
|
3845
|
-
|
3846
|
-
|
3865
|
+
toaster.error = function (content, options) {
|
3866
|
+
return toaster(content, _extends({}, options, {
|
3867
|
+
type: 'error'
|
3868
|
+
}));
|
3869
|
+
};
|
3847
3870
|
|
3848
|
-
toaster.warning = (content, options)
|
3849
|
-
|
3850
|
-
|
3871
|
+
toaster.warning = function (content, options) {
|
3872
|
+
return toaster(content, _extends({}, options, {
|
3873
|
+
type: 'warning'
|
3874
|
+
}));
|
3875
|
+
};
|
3851
3876
|
|
3852
|
-
toaster.information = (content, options)
|
3853
|
-
|
3854
|
-
|
3877
|
+
toaster.information = function (content, options) {
|
3878
|
+
return toaster(content, _extends({}, options, {
|
3879
|
+
type: 'information'
|
3880
|
+
}));
|
3881
|
+
};
|
3855
3882
|
|
3856
|
-
toaster.loading = (content, options)
|
3857
|
-
|
3858
|
-
|
3883
|
+
toaster.loading = function (content, options) {
|
3884
|
+
return toaster(content, _extends({}, options, {
|
3885
|
+
type: 'loading'
|
3886
|
+
}));
|
3887
|
+
};
|
3859
3888
|
}, []);
|
3860
3889
|
return React.createElement(ToastContext.Provider, Object.assign({}, props, {
|
3861
3890
|
value: toaster
|
@@ -3865,37 +3894,43 @@ const ToastProvider = ({
|
|
3865
3894
|
role: "log"
|
3866
3895
|
}, React.createElement(framerMotion.AnimatePresence, {
|
3867
3896
|
initial: false
|
3868
|
-
}, toasts.map(
|
3869
|
-
|
3870
|
-
|
3871
|
-
type: 'spring',
|
3872
|
-
damping: 20,
|
3873
|
-
stiffness: 300
|
3874
|
-
},
|
3875
|
-
initial: {
|
3876
|
-
opacity: 0,
|
3877
|
-
y: 10,
|
3878
|
-
scale: 0.5
|
3879
|
-
},
|
3880
|
-
animate: {
|
3881
|
-
opacity: 1,
|
3882
|
-
y: 0,
|
3883
|
-
scale: 1
|
3884
|
-
},
|
3885
|
-
exit: {
|
3886
|
-
opacity: 0,
|
3887
|
-
scale: 0.5,
|
3897
|
+
}, toasts.map(function (toast) {
|
3898
|
+
return React.createElement(framerMotion.motion.div, {
|
3899
|
+
key: toast.id,
|
3888
3900
|
transition: {
|
3889
|
-
|
3901
|
+
type: 'spring',
|
3902
|
+
damping: 20,
|
3903
|
+
stiffness: 300
|
3904
|
+
},
|
3905
|
+
initial: {
|
3906
|
+
opacity: 0,
|
3907
|
+
y: 10,
|
3908
|
+
scale: 0.5
|
3909
|
+
},
|
3910
|
+
animate: {
|
3911
|
+
opacity: 1,
|
3912
|
+
y: 0,
|
3913
|
+
scale: 1
|
3914
|
+
},
|
3915
|
+
exit: {
|
3916
|
+
opacity: 0,
|
3917
|
+
scale: 0.5,
|
3918
|
+
transition: {
|
3919
|
+
duration: 0.2
|
3920
|
+
}
|
3890
3921
|
}
|
3891
|
-
}
|
3892
|
-
|
3893
|
-
|
3894
|
-
|
3922
|
+
}, React.createElement(Toast, Object.assign({}, toast, {
|
3923
|
+
onClose: function onClose() {
|
3924
|
+
return handleClose(toast.id);
|
3925
|
+
}
|
3926
|
+
})));
|
3927
|
+
}))));
|
3928
|
+
};
|
3929
|
+
var useToast = function useToast() {
|
3930
|
+
return React.useContext(ToastContext);
|
3895
3931
|
};
|
3896
|
-
const useToast = () => React.useContext(ToastContext);
|
3897
3932
|
|
3898
|
-
|
3933
|
+
var defaultLocalisationTexts = {
|
3899
3934
|
calendar: {
|
3900
3935
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
3901
3936
|
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
@@ -3970,32 +4005,37 @@ const defaultLocalisationTexts = {
|
|
3970
4005
|
inputLabel: 'Search...'
|
3971
4006
|
}
|
3972
4007
|
};
|
3973
|
-
|
4008
|
+
var defaultLocalizationContext = {
|
3974
4009
|
locale: 'en-GB',
|
3975
4010
|
texts: defaultLocalisationTexts,
|
3976
4011
|
formatting: {
|
3977
4012
|
date: 'dd.mm.yy'
|
3978
4013
|
}
|
3979
4014
|
};
|
3980
|
-
|
4015
|
+
var Context = /*#__PURE__*/React.createContext({
|
3981
4016
|
localization: defaultLocalizationContext
|
3982
4017
|
});
|
3983
|
-
|
3984
|
-
|
3985
|
-
|
3986
|
-
|
3987
|
-
|
3988
|
-
|
3989
|
-
|
3990
|
-
|
4018
|
+
var Provider = function Provider(props) {
|
4019
|
+
var children = props.children,
|
4020
|
+
_props$localization = props.localization,
|
4021
|
+
localization = _props$localization === void 0 ? defaultLocalizationContext : _props$localization;
|
4022
|
+
var value = React.useMemo(function () {
|
4023
|
+
return {
|
4024
|
+
localization: localization
|
4025
|
+
};
|
4026
|
+
}, [localization]);
|
3991
4027
|
return React.createElement(Context.Provider, {
|
3992
4028
|
value: value
|
3993
4029
|
}, React.createElement(ToastProvider, null, children));
|
3994
4030
|
};
|
3995
|
-
|
3996
|
-
|
4031
|
+
var useTaco = function useTaco() {
|
4032
|
+
return React.useContext(Context);
|
4033
|
+
};
|
4034
|
+
var useLocalization = function useLocalization() {
|
4035
|
+
return useTaco().localization;
|
4036
|
+
};
|
3997
4037
|
|
3998
|
-
var _excluded$
|
4038
|
+
var _excluded$8 = ["onChange", "value"];
|
3999
4039
|
|
4000
4040
|
var renderDay = function renderDay(day, modifiers) {
|
4001
4041
|
return modifiers.disabled ? React.createElement("span", {
|
@@ -4074,7 +4114,7 @@ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
|
4074
4114
|
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4075
4115
|
var handleChange = props.onChange,
|
4076
4116
|
value = props.value,
|
4077
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4117
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
|
4078
4118
|
|
4079
4119
|
var _useLocalization2 = useLocalization(),
|
4080
4120
|
locale = _useLocalization2.locale,
|
@@ -4138,7 +4178,7 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4138
4178
|
})));
|
4139
4179
|
});
|
4140
4180
|
|
4141
|
-
var _excluded$
|
4181
|
+
var _excluded$9 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
|
4142
4182
|
var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4143
4183
|
var checked = props.checked,
|
4144
4184
|
highlighted = props.highlighted,
|
@@ -4146,7 +4186,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4146
4186
|
invalid = props.invalid,
|
4147
4187
|
label = props.label,
|
4148
4188
|
onChange = props.onChange,
|
4149
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4189
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
|
4150
4190
|
|
4151
4191
|
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)]
|
4152
4192
|
props.className, {
|
@@ -4220,14 +4260,14 @@ const getButtonStateClasses = invalid => {
|
|
4220
4260
|
return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
|
4221
4261
|
};
|
4222
4262
|
|
4223
|
-
var _excluded$
|
4263
|
+
var _excluded$a = ["button", "icon", "highlighted", "invalid", "onKeyDown", "autoFocus"];
|
4224
4264
|
var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
4225
4265
|
var button = props.button,
|
4226
4266
|
icon = props.icon,
|
4227
4267
|
invalid = props.invalid,
|
4228
4268
|
onKeyDown = props.onKeyDown,
|
4229
4269
|
autoFocus = props.autoFocus,
|
4230
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4270
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
|
4231
4271
|
|
4232
4272
|
var inputRef = useProxiedRef(ref);
|
4233
4273
|
var hasContainer = button || icon;
|
@@ -5057,12 +5097,12 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5057
5097
|
return dimensions;
|
5058
5098
|
};
|
5059
5099
|
|
5060
|
-
var _excluded$
|
5100
|
+
var _excluded$b = ["className", "dialog", "style"];
|
5061
5101
|
var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5062
5102
|
var externalClassName = props.className,
|
5063
5103
|
dialog = props.dialog,
|
5064
5104
|
style = props.style,
|
5065
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5105
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
5066
5106
|
|
5067
5107
|
var _useCombobox = useCombobox(otherProps, ref),
|
5068
5108
|
combobox = _useCombobox.combobox,
|
@@ -5354,18 +5394,19 @@ function mergeRefs(refs) {
|
|
5354
5394
|
};
|
5355
5395
|
}
|
5356
5396
|
|
5357
|
-
|
5397
|
+
var _excluded$c = ["children", "trigger"];
|
5398
|
+
var PopoverContext = /*#__PURE__*/React.createContext({
|
5358
5399
|
props: {},
|
5359
5400
|
ref: null
|
5360
5401
|
});
|
5361
|
-
|
5402
|
+
var Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, ref) {
|
5362
5403
|
var _props$children;
|
5363
5404
|
|
5364
|
-
|
5365
|
-
|
5405
|
+
var context = React.useContext(PopoverContext);
|
5406
|
+
var children = props.children;
|
5366
5407
|
|
5367
5408
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5368
|
-
console.warn(
|
5409
|
+
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");
|
5369
5410
|
children = React.createElement("span", null, props.children);
|
5370
5411
|
}
|
5371
5412
|
|
@@ -5375,22 +5416,22 @@ const Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, r
|
|
5375
5416
|
asChild: true
|
5376
5417
|
}));
|
5377
5418
|
});
|
5378
|
-
|
5379
|
-
children,
|
5380
|
-
|
5381
|
-
|
5382
|
-
|
5419
|
+
var RenderPropWrapper = /*#__PURE__*/React.forwardRef(function RenderPropWrapper(_ref, ref) {
|
5420
|
+
var children = _ref.children,
|
5421
|
+
onClick = _ref.onClick;
|
5422
|
+
|
5423
|
+
var close = function close() {
|
5383
5424
|
onClick(new CustomEvent('hide'));
|
5384
5425
|
};
|
5385
5426
|
|
5386
5427
|
return children({
|
5387
|
-
close,
|
5388
|
-
ref
|
5428
|
+
close: close,
|
5429
|
+
ref: ref
|
5389
5430
|
});
|
5390
5431
|
});
|
5391
|
-
|
5392
|
-
|
5393
|
-
|
5432
|
+
var Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, ref) {
|
5433
|
+
var className = cn('bg-white focus:border-blue-light', props.className);
|
5434
|
+
var output;
|
5394
5435
|
|
5395
5436
|
if (typeof props.children === 'function') {
|
5396
5437
|
output = React.createElement(PopoverPrimitive.Close, {
|
@@ -5408,20 +5449,23 @@ const Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, r
|
|
5408
5449
|
className: "text-white"
|
5409
5450
|
}));
|
5410
5451
|
});
|
5411
|
-
|
5412
|
-
|
5413
|
-
|
5414
|
-
|
5415
|
-
|
5416
|
-
|
5417
|
-
|
5418
|
-
|
5419
|
-
|
5420
|
-
|
5421
|
-
|
5422
|
-
|
5423
|
-
|
5424
|
-
|
5452
|
+
var Close$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
5453
|
+
return React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
|
5454
|
+
ref: ref,
|
5455
|
+
asChild: true
|
5456
|
+
}));
|
5457
|
+
});
|
5458
|
+
var Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
5459
|
+
var children = props.children,
|
5460
|
+
trigger = props.trigger,
|
5461
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$c);
|
5462
|
+
|
5463
|
+
var context = React.useMemo(function () {
|
5464
|
+
return {
|
5465
|
+
props: otherProps,
|
5466
|
+
ref: ref
|
5467
|
+
};
|
5468
|
+
}, [otherProps]);
|
5425
5469
|
return React.createElement(PopoverContext.Provider, {
|
5426
5470
|
value: context
|
5427
5471
|
}, React.createElement(PopoverPrimitive.Root, null, trigger && React.createElement(Trigger$1, null, trigger), children));
|
@@ -5430,14 +5474,14 @@ Popover.Trigger = Trigger$1;
|
|
5430
5474
|
Popover.Content = Content$1;
|
5431
5475
|
Popover.Close = Close$1;
|
5432
5476
|
|
5433
|
-
var _excluded$
|
5477
|
+
var _excluded$d = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
5434
5478
|
var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5435
5479
|
var externalClassName = props.className,
|
5436
5480
|
handleReset = props.onReset,
|
5437
5481
|
style = props.style,
|
5438
5482
|
shortcuts = props.shortcuts,
|
5439
5483
|
shortcutsText = props.shortcutsText,
|
5440
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5484
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
5441
5485
|
|
5442
5486
|
var _useDatepicker = useDatepicker(otherProps, ref),
|
5443
5487
|
calendar = _useDatepicker.calendar,
|
@@ -5732,7 +5776,7 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5732
5776
|
});
|
5733
5777
|
Extra.displayName = 'DialogExtra';
|
5734
5778
|
|
5735
|
-
var _excluded$
|
5779
|
+
var _excluded$e = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
|
5736
5780
|
|
5737
5781
|
var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
5738
5782
|
return React.useMemo(function () {
|
@@ -5769,7 +5813,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
|
5769
5813
|
_props$size = props.size,
|
5770
5814
|
size = _props$size === void 0 ? 'sm' : _props$size,
|
5771
5815
|
trigger = props.trigger,
|
5772
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5816
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$e);
|
5773
5817
|
|
5774
5818
|
var _useSeparatedChildren = useSeparatedChildren(initialChildren),
|
5775
5819
|
children = _useSeparatedChildren[0],
|
@@ -5819,14 +5863,14 @@ Dialog.Extra = Extra;
|
|
5819
5863
|
Dialog.Drawer = Drawer;
|
5820
5864
|
Dialog.Close = Close$2;
|
5821
5865
|
|
5822
|
-
var _excluded$
|
5866
|
+
var _excluded$f = ["disabled", "children", "invalid", "message"];
|
5823
5867
|
var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5824
5868
|
var disabled = props.disabled,
|
5825
5869
|
children = props.children,
|
5826
5870
|
_props$invalid = props.invalid,
|
5827
5871
|
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
5828
5872
|
message = props.message,
|
5829
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5873
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$f);
|
5830
5874
|
|
5831
5875
|
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5832
5876
|
'text-grey-dark': disabled
|
@@ -5846,11 +5890,11 @@ var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5846
5890
|
}, message));
|
5847
5891
|
});
|
5848
5892
|
|
5849
|
-
var _excluded$
|
5893
|
+
var _excluded$g = ["horizontal"];
|
5850
5894
|
var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
5851
5895
|
var _props$horizontal = props.horizontal,
|
5852
5896
|
horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
|
5853
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5897
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$g);
|
5854
5898
|
|
5855
5899
|
var className = cn('yt-form', {
|
5856
5900
|
'yt-form--horizontal flex flex-wrap': horizontal
|
@@ -5862,11 +5906,11 @@ var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5862
5906
|
}));
|
5863
5907
|
});
|
5864
5908
|
|
5865
|
-
var _excluded$
|
5909
|
+
var _excluded$h = ["as"];
|
5866
5910
|
var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5867
5911
|
var _props$as = props.as,
|
5868
5912
|
Tag = _props$as === void 0 ? 'span' : _props$as,
|
5869
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5913
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$h);
|
5870
5914
|
|
5871
5915
|
var className = cn('flex ', props.className);
|
5872
5916
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
@@ -5876,7 +5920,7 @@ var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5876
5920
|
}));
|
5877
5921
|
});
|
5878
5922
|
|
5879
|
-
var _excluded$
|
5923
|
+
var _excluded$i = ["anchor", "children", "defaultOpen"];
|
5880
5924
|
var HangerContext = /*#__PURE__*/React.createContext({
|
5881
5925
|
props: {},
|
5882
5926
|
ref: null
|
@@ -5940,7 +5984,7 @@ var Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
|
5940
5984
|
children = props.children,
|
5941
5985
|
_props$defaultOpen = props.defaultOpen,
|
5942
5986
|
defaultOpen = _props$defaultOpen === void 0 ? true : _props$defaultOpen,
|
5943
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5987
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$i);
|
5944
5988
|
|
5945
5989
|
var context = React.useMemo(function () {
|
5946
5990
|
return {
|
@@ -5969,7 +6013,7 @@ Hanger.Anchor = Anchor;
|
|
5969
6013
|
Hanger.Content = Content$3;
|
5970
6014
|
Hanger.Title = Title$1;
|
5971
6015
|
|
5972
|
-
var _excluded$
|
6016
|
+
var _excluded$j = ["placement"];
|
5973
6017
|
var Trigger$3 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
|
5974
6018
|
return React.createElement(HoverCardPrimitive.Trigger, Object.assign({}, props, {
|
5975
6019
|
asChild: true,
|
@@ -5978,7 +6022,7 @@ var Trigger$3 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, r
|
|
5978
6022
|
});
|
5979
6023
|
var Content$4 = /*#__PURE__*/React.forwardRef(function HoverCardContent(externalProps, ref) {
|
5980
6024
|
var placement = externalProps.placement,
|
5981
|
-
props = _objectWithoutPropertiesLoose(externalProps, _excluded$
|
6025
|
+
props = _objectWithoutPropertiesLoose(externalProps, _excluded$j);
|
5982
6026
|
|
5983
6027
|
var className = cn('bg-white rounded p-3 yt-shadow', props.className);
|
5984
6028
|
return React.createElement(HoverCardPrimitive.Content, Object.assign({}, props, {
|
@@ -5995,6 +6039,47 @@ var HoverCard = function HoverCard(props) {
|
|
5995
6039
|
HoverCard.Trigger = Trigger$3;
|
5996
6040
|
HoverCard.Content = Content$4;
|
5997
6041
|
|
6042
|
+
var _excluded$k = ["onSearch"];
|
6043
|
+
var SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput(_ref, ref) {
|
6044
|
+
var onSearch = _ref.onSearch,
|
6045
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
6046
|
+
|
6047
|
+
var _useLocalization = useLocalization(),
|
6048
|
+
texts = _useLocalization.texts;
|
6049
|
+
|
6050
|
+
var handleClick = function handleClick() {
|
6051
|
+
if (!props.disabled) {
|
6052
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(props.value);
|
6053
|
+
}
|
6054
|
+
};
|
6055
|
+
|
6056
|
+
var handleKeyDown = function handleKeyDown(event) {
|
6057
|
+
var _props$onKeyDown;
|
6058
|
+
|
6059
|
+
var isEnterKeyPressed = event.keyCode === keycode('enter');
|
6060
|
+
|
6061
|
+
if (isEnterKeyPressed) {
|
6062
|
+
handleClick();
|
6063
|
+
}
|
6064
|
+
|
6065
|
+
(_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
|
6066
|
+
};
|
6067
|
+
|
6068
|
+
return React.createElement(Input, Object.assign({
|
6069
|
+
"aria-label": texts.searchInput.inputLabel
|
6070
|
+
}, props, {
|
6071
|
+
button: React.createElement(IconButton, {
|
6072
|
+
icon: "search",
|
6073
|
+
className: "!border-transparent !bg-transparent focus:!border-transparent peer-focus:!border-transparent peer-focus:peer-active:!border-transparent",
|
6074
|
+
disabled: props.disabled,
|
6075
|
+
onClick: handleClick
|
6076
|
+
}),
|
6077
|
+
onKeyDown: handleKeyDown,
|
6078
|
+
ref: ref,
|
6079
|
+
type: "search"
|
6080
|
+
}));
|
6081
|
+
});
|
6082
|
+
|
5998
6083
|
const useTypeahead = ({
|
5999
6084
|
data,
|
6000
6085
|
currentIndex
|
@@ -6340,11 +6425,11 @@ const useMultiListbox = ({
|
|
6340
6425
|
};
|
6341
6426
|
};
|
6342
6427
|
|
6343
|
-
var _excluded$
|
6428
|
+
var _excluded$l = ["className"],
|
6344
6429
|
_excluded2$1 = ["className"];
|
6345
6430
|
var Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6346
6431
|
var externalClassName = props.className,
|
6347
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
6432
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$l);
|
6348
6433
|
|
6349
6434
|
var _useListbox = useListbox(otherProps, ref),
|
6350
6435
|
list = _useListbox.list,
|
@@ -6645,26 +6730,35 @@ const Checkbox$1 = props => {
|
|
6645
6730
|
})), children);
|
6646
6731
|
};
|
6647
6732
|
|
6648
|
-
|
6649
|
-
|
6650
|
-
|
6733
|
+
var _excluded$m = ["children", "value"],
|
6734
|
+
_excluded2$2 = ["children", "defaultValue", "disabled", "invalid", "onChange", "orientation", "value"];
|
6735
|
+
var getRadioGroupItemValueAsString = function getRadioGroupItemValueAsString(value) {
|
6736
|
+
return String(value !== null && value !== void 0 ? value : '');
|
6737
|
+
};
|
6738
|
+
var findByValue$1 = function findByValue(values, valueAsString) {
|
6739
|
+
return values.find(function (value) {
|
6740
|
+
return getRadioGroupItemValueAsString(value) === valueAsString;
|
6741
|
+
});
|
6742
|
+
};
|
6743
|
+
var RadioGroupContext = /*#__PURE__*/React.createContext({
|
6651
6744
|
disabled: false,
|
6652
6745
|
invalid: false
|
6653
6746
|
});
|
6654
|
-
|
6655
|
-
|
6656
|
-
|
6657
|
-
|
6658
|
-
|
6659
|
-
|
6660
|
-
|
6661
|
-
|
6662
|
-
|
6663
|
-
'border-grey-dark focus:yt-focus aria-checked:bg-blue aria-checked:border-blue hover:aria-checked:border-blue-light': !isDisabled && !context.invalid,
|
6747
|
+
var RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(props, ref) {
|
6748
|
+
var context = React.useContext(RadioGroupContext);
|
6749
|
+
|
6750
|
+
var children = props.children,
|
6751
|
+
value = props.value,
|
6752
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$m);
|
6753
|
+
|
6754
|
+
var isDisabled = context.disabled || props.disabled;
|
6755
|
+
var 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', {
|
6756
|
+
'border-grey-dark hover:border-4 focus:yt-focus aria-checked:bg-blue aria-checked:border-blue hover:aria-checked:border-blue-light': !isDisabled && !context.invalid,
|
6664
6757
|
'border-grey cursor-not-allowed aria-checked:bg-blue-light aria-checked:border-blue-light ': isDisabled,
|
6665
|
-
'border-red text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red': context.invalid && !isDisabled
|
6758
|
+
'border-red hover:border-4 text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red': context.invalid && !isDisabled
|
6666
6759
|
});
|
6667
|
-
|
6760
|
+
var labelClassName = cn('flex items-center gap-2', {
|
6761
|
+
'cursor-pointer': !isDisabled,
|
6668
6762
|
'cursor-not-allowed text-grey-dark': isDisabled
|
6669
6763
|
}, props.className);
|
6670
6764
|
return React.createElement("label", {
|
@@ -6678,34 +6772,38 @@ const RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(pro
|
|
6678
6772
|
className: "h-2 w-2 rounded-full bg-white"
|
6679
6773
|
})), children);
|
6680
6774
|
});
|
6681
|
-
|
6682
|
-
|
6683
|
-
|
6684
|
-
|
6685
|
-
|
6686
|
-
|
6687
|
-
|
6688
|
-
|
6689
|
-
|
6690
|
-
|
6691
|
-
|
6692
|
-
|
6693
|
-
|
6694
|
-
React.Children.forEach(children, child
|
6775
|
+
var useRadioGroup = function useRadioGroup(props) {
|
6776
|
+
var children = props.children,
|
6777
|
+
defaultValue = props.defaultValue,
|
6778
|
+
disabled = props.disabled,
|
6779
|
+
invalid = props.invalid,
|
6780
|
+
onChange = props.onChange,
|
6781
|
+
_props$orientation = props.orientation,
|
6782
|
+
orientation = _props$orientation === void 0 ? 'vertical' : _props$orientation,
|
6783
|
+
value = props.value,
|
6784
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$2);
|
6785
|
+
|
6786
|
+
var values = React.useMemo(function () {
|
6787
|
+
var radioGroupItemValues = [];
|
6788
|
+
React.Children.forEach(children, function (child) {
|
6695
6789
|
if (React.isValidElement(child)) {
|
6696
6790
|
radioGroupItemValues.push(child.props.value);
|
6697
6791
|
}
|
6698
6792
|
});
|
6699
6793
|
return radioGroupItemValues;
|
6700
6794
|
}, [children]);
|
6701
|
-
|
6702
|
-
|
6703
|
-
|
6704
|
-
|
6705
|
-
|
6795
|
+
var context = React.useMemo(function () {
|
6796
|
+
return {
|
6797
|
+
disabled: disabled !== null && disabled !== void 0 ? disabled : false,
|
6798
|
+
invalid: invalid !== null && invalid !== void 0 ? invalid : false
|
6799
|
+
};
|
6800
|
+
}, [disabled, invalid]);
|
6801
|
+
var valueProps;
|
6706
6802
|
|
6707
6803
|
if (onChange !== undefined) {
|
6708
|
-
|
6804
|
+
var handleChange = function handleChange(value) {
|
6805
|
+
return onChange(findByValue$1(values, value));
|
6806
|
+
};
|
6709
6807
|
|
6710
6808
|
valueProps = {
|
6711
6809
|
onValueChange: handleChange,
|
@@ -6718,20 +6816,19 @@ const useRadioGroup = props => {
|
|
6718
6816
|
}
|
6719
6817
|
|
6720
6818
|
return {
|
6721
|
-
context,
|
6722
|
-
props: {
|
6723
|
-
|
6724
|
-
|
6725
|
-
|
6726
|
-
}
|
6819
|
+
context: context,
|
6820
|
+
props: _extends({}, otherProps, valueProps, {
|
6821
|
+
children: children,
|
6822
|
+
orientation: orientation
|
6823
|
+
})
|
6727
6824
|
};
|
6728
6825
|
};
|
6729
|
-
|
6730
|
-
|
6731
|
-
|
6732
|
-
|
6733
|
-
|
6734
|
-
|
6826
|
+
var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
6827
|
+
var _useRadioGroup = useRadioGroup(props),
|
6828
|
+
context = _useRadioGroup.context,
|
6829
|
+
otherProps = _useRadioGroup.props;
|
6830
|
+
|
6831
|
+
var className = cn('flex items-start gap-y-2', {
|
6735
6832
|
'flex-wrap gap-x-4 ': otherProps.orientation === 'horizontal',
|
6736
6833
|
'flex-col': otherProps.orientation === 'vertical'
|
6737
6834
|
}, otherProps.className);
|
@@ -6844,12 +6941,12 @@ const Header = props => {
|
|
6844
6941
|
}));
|
6845
6942
|
};
|
6846
6943
|
|
6847
|
-
var _excluded$
|
6944
|
+
var _excluded$n = ["appearance", "children", "trigger"];
|
6848
6945
|
var Menu = function Menu(externalProps) {
|
6849
6946
|
var externalAppearance = externalProps.appearance,
|
6850
6947
|
children = externalProps.children,
|
6851
6948
|
trigger = externalProps.trigger,
|
6852
|
-
props = _objectWithoutPropertiesLoose(externalProps, _excluded$
|
6949
|
+
props = _objectWithoutPropertiesLoose(externalProps, _excluded$n);
|
6853
6950
|
|
6854
6951
|
var _React$useState = React.useState(false),
|
6855
6952
|
open = _React$useState[0],
|
@@ -6903,39 +7000,44 @@ Menu.Separator = Separator;
|
|
6903
7000
|
Menu.Header = Header;
|
6904
7001
|
Menu.RadioGroup = RadioGroup$1;
|
6905
7002
|
|
6906
|
-
|
7003
|
+
var _excluded$o = ["children", "className", "expanded", "title", "fixed", "onClick"];
|
7004
|
+
var TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
6907
7005
|
return React__default.createElement("a", Object.assign({}, props, {
|
6908
7006
|
ref: ref
|
6909
7007
|
}));
|
6910
7008
|
});
|
6911
|
-
|
6912
|
-
|
6913
|
-
|
6914
|
-
|
6915
|
-
|
6916
|
-
|
6917
|
-
|
6918
|
-
|
6919
|
-
|
6920
|
-
|
6921
|
-
|
6922
|
-
|
7009
|
+
var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGroup(props, ref) {
|
7010
|
+
var children = props.children,
|
7011
|
+
externalClassName = props.className,
|
7012
|
+
_props$expanded = props.expanded,
|
7013
|
+
initialExpanded = _props$expanded === void 0 ? false : _props$expanded,
|
7014
|
+
title = props.title,
|
7015
|
+
fixed = props.fixed,
|
7016
|
+
onClick = props.onClick,
|
7017
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$o);
|
7018
|
+
|
7019
|
+
var _React$useState = React__default.useState(fixed || initialExpanded),
|
7020
|
+
expanded = _React$useState[0],
|
7021
|
+
setExpanded = _React$useState[1];
|
7022
|
+
|
7023
|
+
React__default.useEffect(function () {
|
6923
7024
|
if (!fixed) {
|
6924
7025
|
setExpanded(fixed || initialExpanded);
|
6925
7026
|
}
|
6926
7027
|
}, [fixed, initialExpanded]);
|
6927
|
-
|
7028
|
+
var listClassName = cn('flex-col mb-0', {
|
6928
7029
|
flex: expanded,
|
6929
7030
|
hidden: !expanded
|
6930
7031
|
});
|
6931
|
-
|
7032
|
+
|
7033
|
+
var itemProps = _extends({}, otherProps, {
|
6932
7034
|
'aria-expanded': expanded,
|
6933
7035
|
role: 'treeitem',
|
6934
7036
|
tabIndex: -1
|
6935
|
-
};
|
7037
|
+
});
|
6936
7038
|
|
6937
|
-
|
6938
|
-
|
7039
|
+
var handleClick = function handleClick(event) {
|
7040
|
+
var nextState = !expanded;
|
6939
7041
|
|
6940
7042
|
if (!fixed) {
|
6941
7043
|
setExpanded(nextState);
|
@@ -6946,7 +7048,7 @@ const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGr
|
|
6946
7048
|
}
|
6947
7049
|
};
|
6948
7050
|
|
6949
|
-
|
7051
|
+
var className = typeof externalClassName === 'function' ? externalClassName(expanded) : externalClassName;
|
6950
7052
|
return React__default.createElement("div", Object.assign({}, itemProps, {
|
6951
7053
|
className: className,
|
6952
7054
|
ref: ref
|
@@ -6955,14 +7057,18 @@ const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGr
|
|
6955
7057
|
}, typeof title === 'function' ? title(expanded) : title), React__default.createElement("ul", {
|
6956
7058
|
role: "group",
|
6957
7059
|
className: listClassName
|
6958
|
-
}, React__default.Children.toArray(children).filter(
|
6959
|
-
|
6960
|
-
|
6961
|
-
|
6962
|
-
|
6963
|
-
|
7060
|
+
}, React__default.Children.toArray(children).filter(function (item) {
|
7061
|
+
return !!item;
|
7062
|
+
}).map(function (item, i) {
|
7063
|
+
return React__default.createElement("li", {
|
7064
|
+
key: i,
|
7065
|
+
role: "none"
|
7066
|
+
}, React__default.cloneElement(item, {
|
7067
|
+
role: 'treeitem'
|
7068
|
+
}));
|
7069
|
+
})));
|
6964
7070
|
});
|
6965
|
-
|
7071
|
+
var Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props, ref) {
|
6966
7072
|
return React__default.createElement("div", Object.assign({}, props, {
|
6967
7073
|
ref: ref,
|
6968
7074
|
role: "tree"
|
@@ -7005,20 +7111,25 @@ const useDropTarget = onDrop => {
|
|
7005
7111
|
return [isDraggedOver, props];
|
7006
7112
|
};
|
7007
7113
|
|
7008
|
-
|
7009
|
-
|
7010
|
-
|
7011
|
-
|
7012
|
-
|
7013
|
-
|
7014
|
-
|
7015
|
-
|
7016
|
-
|
7017
|
-
|
7018
|
-
|
7019
|
-
|
7020
|
-
|
7021
|
-
|
7114
|
+
var _excluded$p = ["active", "children", "onDrop", "postfix", "prefix", "role"],
|
7115
|
+
_excluded2$3 = ["children"];
|
7116
|
+
var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
7117
|
+
var active = props.active,
|
7118
|
+
children = props.children,
|
7119
|
+
onDrop = props.onDrop,
|
7120
|
+
postfix = props.postfix,
|
7121
|
+
prefix = props.prefix,
|
7122
|
+
role = props.role,
|
7123
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$p);
|
7124
|
+
|
7125
|
+
var proxyRef = useProxiedRef(ref);
|
7126
|
+
|
7127
|
+
var _useDropTarget = useDropTarget(onDrop),
|
7128
|
+
isDraggedOver = _useDropTarget[0],
|
7129
|
+
dropTargetProps = _useDropTarget[1];
|
7130
|
+
|
7131
|
+
var isTreeitem = role === 'treeitem';
|
7132
|
+
var className = cn('yt-navigation__item cursor-pointer', {
|
7022
7133
|
'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,
|
7023
7134
|
'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,
|
7024
7135
|
'yt-navigation__item--active': active && !isDraggedOver,
|
@@ -7026,7 +7137,7 @@ const Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref)
|
|
7026
7137
|
'yt-navigation__item--dropping bg-blue': isDraggedOver
|
7027
7138
|
}, props.className);
|
7028
7139
|
|
7029
|
-
|
7140
|
+
var handleClick = function handleClick(event) {
|
7030
7141
|
if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {
|
7031
7142
|
return;
|
7032
7143
|
}
|
@@ -7049,19 +7160,19 @@ const Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref)
|
|
7049
7160
|
className: "yt-navigation__item__postfix ml-1"
|
7050
7161
|
}, postfix));
|
7051
7162
|
});
|
7052
|
-
|
7163
|
+
var Panel = /*#__PURE__*/React__default.forwardRef(function Panel(props, ref) {
|
7053
7164
|
return React__default.createElement("div", Object.assign({}, props, {
|
7054
7165
|
className: cn('w-full bg-white p-3', props.className),
|
7055
7166
|
ref: ref
|
7056
7167
|
}));
|
7057
7168
|
});
|
7058
|
-
|
7059
|
-
|
7169
|
+
var MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(props, ref) {
|
7170
|
+
var className = cn('flex-shrink-0 space-y-1 outline-none', {
|
7060
7171
|
'bg-white pb-2': props.fixed
|
7061
7172
|
}, props.className);
|
7062
7173
|
|
7063
|
-
|
7064
|
-
|
7174
|
+
var title = function title(expanded) {
|
7175
|
+
var className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {
|
7065
7176
|
'mb-1': expanded,
|
7066
7177
|
'cursor-pointer hover:text-blue': !props.fixed
|
7067
7178
|
});
|
@@ -7078,14 +7189,16 @@ const MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(prop
|
|
7078
7189
|
ref: ref
|
7079
7190
|
}));
|
7080
7191
|
});
|
7081
|
-
|
7082
|
-
|
7083
|
-
|
7084
|
-
React__default.Children.toArray(props.children).filter(
|
7192
|
+
var Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
|
7193
|
+
var scrollableAreas = React__default.useMemo(function () {
|
7194
|
+
var scrollableAreas = [];
|
7195
|
+
React__default.Children.toArray(props.children).filter(function (child) {
|
7196
|
+
return !!child;
|
7197
|
+
}).map(function (child) {
|
7085
7198
|
if (child.props.fixed) {
|
7086
7199
|
scrollableAreas.push(child);
|
7087
7200
|
} else {
|
7088
|
-
|
7201
|
+
var x = scrollableAreas[scrollableAreas.length - 1];
|
7089
7202
|
|
7090
7203
|
if (Array.isArray(x)) {
|
7091
7204
|
x.push(child);
|
@@ -7099,18 +7212,19 @@ const Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref)
|
|
7099
7212
|
return React__default.createElement(Treeview, Object.assign({}, props, {
|
7100
7213
|
className: cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className),
|
7101
7214
|
ref: ref
|
7102
|
-
}), scrollableAreas.map((area, i)
|
7103
|
-
|
7104
|
-
|
7105
|
-
|
7215
|
+
}), scrollableAreas.map(function (area, i) {
|
7216
|
+
return Array.isArray(area) ? React__default.createElement("div", {
|
7217
|
+
className: "divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
|
7218
|
+
key: i
|
7219
|
+
}, area) : area;
|
7220
|
+
}));
|
7106
7221
|
});
|
7107
7222
|
Menu$1.Group = MenuGroup;
|
7108
|
-
|
7109
|
-
|
7110
|
-
|
7111
|
-
|
7112
|
-
|
7113
|
-
const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
|
7223
|
+
var Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
|
7224
|
+
var children = props.children,
|
7225
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$3);
|
7226
|
+
|
7227
|
+
var className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
|
7114
7228
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
7115
7229
|
className: className,
|
7116
7230
|
"data-taco": "navigation",
|
@@ -7366,52 +7480,54 @@ const useSelect = ({
|
|
7366
7480
|
};
|
7367
7481
|
};
|
7368
7482
|
|
7369
|
-
|
7370
|
-
|
7371
|
-
|
7372
|
-
|
7373
|
-
|
7374
|
-
|
7375
|
-
|
7376
|
-
|
7377
|
-
|
7378
|
-
|
7379
|
-
|
7380
|
-
|
7381
|
-
|
7382
|
-
|
7383
|
-
|
7384
|
-
|
7385
|
-
|
7386
|
-
|
7387
|
-
|
7483
|
+
var _excluded$q = ["autoFocus", "className", "highlighted", "style"],
|
7484
|
+
_excluded2$4 = ["editable"];
|
7485
|
+
var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
|
7486
|
+
var autoFocus = props.autoFocus,
|
7487
|
+
externalClassName = props.className,
|
7488
|
+
style = props.style,
|
7489
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$q);
|
7490
|
+
|
7491
|
+
var _useSelect = useSelect(otherProps, ref),
|
7492
|
+
button = _useSelect.button,
|
7493
|
+
listbox = _useSelect.listbox,
|
7494
|
+
popover = _useSelect.popover,
|
7495
|
+
input = _useSelect.input,
|
7496
|
+
text = _useSelect.text,
|
7497
|
+
_useSelect$more = _useSelect.more,
|
7498
|
+
more = _useSelect$more === void 0 ? 0 : _useSelect$more;
|
7499
|
+
|
7500
|
+
var internalRef = React.useRef(null);
|
7501
|
+
var selectDimensions = useBoundingClientRectListener(internalRef);
|
7502
|
+
var className = cn('inline-flex relative w-full', {
|
7388
7503
|
'yt-select--readonly': props.readOnly
|
7389
7504
|
}, externalClassName);
|
7390
|
-
|
7505
|
+
var inputClassname = cn(getInputClasses(props), 'h-8 text-left pr-0', {
|
7391
7506
|
'border-blue': popover.open
|
7392
7507
|
});
|
7393
|
-
React.useEffect(()
|
7508
|
+
React.useEffect(function () {
|
7394
7509
|
if (autoFocus && internalRef.current) {
|
7395
7510
|
internalRef.current.focus();
|
7396
7511
|
}
|
7397
7512
|
}, []);
|
7398
7513
|
|
7399
|
-
|
7514
|
+
var renderMultiSelection = function renderMultiSelection() {
|
7400
7515
|
return React.createElement(React.Fragment, null, React.createElement("span", {
|
7401
7516
|
className: "flex-grow truncate text-left"
|
7402
7517
|
}, text), more > 0 && React.createElement(Badge, {
|
7403
7518
|
className: "ml-2"
|
7404
|
-
},
|
7519
|
+
}, "+" + more));
|
7405
7520
|
};
|
7406
7521
|
|
7407
|
-
|
7522
|
+
var commonListboxProps = _extends({}, listbox, {
|
7408
7523
|
className: 'w-auto',
|
7409
7524
|
invalid: undefined,
|
7410
7525
|
style: {
|
7411
7526
|
minWidth: selectDimensions === null || selectDimensions === void 0 ? void 0 : selectDimensions.width
|
7412
7527
|
},
|
7413
7528
|
tabIndex: popover.open ? 0 : -1
|
7414
|
-
};
|
7529
|
+
});
|
7530
|
+
|
7415
7531
|
return React.createElement("span", {
|
7416
7532
|
className: className,
|
7417
7533
|
"data-taco": "select",
|
@@ -7434,11 +7550,9 @@ const BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref)
|
|
7434
7550
|
type: "text"
|
7435
7551
|
}))));
|
7436
7552
|
});
|
7437
|
-
|
7438
|
-
|
7439
|
-
|
7440
|
-
...otherProps
|
7441
|
-
} = props;
|
7553
|
+
var Select = /*#__PURE__*/React.forwardRef(function Select(props, ref) {
|
7554
|
+
var editable = props.editable,
|
7555
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$4);
|
7442
7556
|
|
7443
7557
|
if (editable) {
|
7444
7558
|
return React.createElement(Combobox, Object.assign({}, otherProps, {
|
@@ -7509,41 +7623,47 @@ const usePagination = (initialPageIndex = 0, initialPageSize = 10) => {
|
|
7509
7623
|
};
|
7510
7624
|
};
|
7511
7625
|
|
7512
|
-
|
7513
|
-
|
7514
|
-
|
7626
|
+
var _excluded$r = ["length", "pageIndex", "pageSize", "pageSizes", "setPageIndex", "setPageSize", "showPageControls", "showPageNumbers", "showPageSize", "dangerouslyHijackGlobalKeyboardNavigation"];
|
7627
|
+
|
7628
|
+
var getShowingLabel = function getShowingLabel(length, pageIndex, pageSize, texts) {
|
7629
|
+
var minItemIndex = pageIndex * pageSize + 1;
|
7630
|
+
var maxItemIndex = (pageIndex + 1) * pageSize;
|
7515
7631
|
return texts.pagination.showingXofYofTotal.replace('[X]', length === 0 ? '0' : String(minItemIndex)).replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex)).replace('[total]', String(length));
|
7516
7632
|
};
|
7517
7633
|
|
7518
|
-
|
7519
|
-
|
7520
|
-
|
7521
|
-
|
7522
|
-
|
7523
|
-
|
7524
|
-
|
7525
|
-
|
7526
|
-
|
7527
|
-
|
7528
|
-
|
7529
|
-
|
7530
|
-
|
7531
|
-
|
7532
|
-
|
7533
|
-
|
7534
|
-
|
7535
|
-
|
7536
|
-
|
7634
|
+
var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
7635
|
+
var length = props.length,
|
7636
|
+
pageIndex = props.pageIndex,
|
7637
|
+
pageSize = props.pageSize,
|
7638
|
+
_props$pageSizes = props.pageSizes,
|
7639
|
+
pageSizes = _props$pageSizes === void 0 ? [10, 25, 50, 100, 500] : _props$pageSizes,
|
7640
|
+
setPageIndex = props.setPageIndex,
|
7641
|
+
setPageSize = props.setPageSize,
|
7642
|
+
_props$showPageContro = props.showPageControls,
|
7643
|
+
showPageControls = _props$showPageContro === void 0 ? true : _props$showPageContro,
|
7644
|
+
_props$showPageNumber = props.showPageNumbers,
|
7645
|
+
showPageNumbers = _props$showPageNumber === void 0 ? true : _props$showPageNumber,
|
7646
|
+
_props$showPageSize = props.showPageSize,
|
7647
|
+
showPageSize = _props$showPageSize === void 0 ? true : _props$showPageSize,
|
7648
|
+
_props$dangerouslyHij = props.dangerouslyHijackGlobalKeyboardNavigation,
|
7649
|
+
dangerouslyHijackGlobalKeyboardNavigation = _props$dangerouslyHij === void 0 ? false : _props$dangerouslyHij,
|
7650
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$r);
|
7651
|
+
|
7652
|
+
var _useLocalization = useLocalization(),
|
7653
|
+
texts = _useLocalization.texts;
|
7654
|
+
|
7655
|
+
var maxPageIndex = Math.ceil(length / pageSize) - 1;
|
7656
|
+
var showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;
|
7537
7657
|
usePaginationShortcuts({
|
7538
|
-
setPageIndex,
|
7539
|
-
maxPageIndex,
|
7540
|
-
pageIndex,
|
7541
|
-
dangerouslyHijackGlobalKeyboardNavigation
|
7658
|
+
setPageIndex: setPageIndex,
|
7659
|
+
maxPageIndex: maxPageIndex,
|
7660
|
+
pageIndex: pageIndex,
|
7661
|
+
dangerouslyHijackGlobalKeyboardNavigation: dangerouslyHijackGlobalKeyboardNavigation
|
7542
7662
|
});
|
7543
|
-
|
7544
|
-
|
7545
|
-
|
7546
|
-
|
7663
|
+
var pageCount = Math.ceil(length / pageSize);
|
7664
|
+
var canPreviousPage = pageIndex > 0;
|
7665
|
+
var canNextPage = pageIndex < pageCount - 1;
|
7666
|
+
var className = cn('inline-flex relative justify-between items-center', props.className);
|
7547
7667
|
return React.createElement("div", Object.assign({}, otherProps, {
|
7548
7668
|
className: className,
|
7549
7669
|
"data-taco": "pagination",
|
@@ -7553,11 +7673,13 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7553
7673
|
}, getShowingLabel(length, pageIndex, pageSize, texts), React.createElement(Select, {
|
7554
7674
|
"aria-label": texts.pagination.pageSize,
|
7555
7675
|
className: "ml-4 !w-20",
|
7556
|
-
data: pageSizes.map(pageSize
|
7557
|
-
|
7558
|
-
|
7559
|
-
|
7560
|
-
|
7676
|
+
data: pageSizes.map(function (pageSize) {
|
7677
|
+
return {
|
7678
|
+
text: String(pageSize),
|
7679
|
+
value: pageSize
|
7680
|
+
};
|
7681
|
+
}),
|
7682
|
+
onChange: function onChange(event) {
|
7561
7683
|
setPageIndex(0);
|
7562
7684
|
setPageSize(Number(event.target.value));
|
7563
7685
|
},
|
@@ -7569,14 +7691,18 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7569
7691
|
appearance: "default",
|
7570
7692
|
disabled: !canPreviousPage,
|
7571
7693
|
icon: "arrow-start",
|
7572
|
-
onClick: ()
|
7694
|
+
onClick: function onClick() {
|
7695
|
+
return setPageIndex(0);
|
7696
|
+
},
|
7573
7697
|
"aria-label": showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage,
|
7574
7698
|
tooltip: showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage
|
7575
7699
|
}), React.createElement(IconButton, {
|
7576
7700
|
appearance: "default",
|
7577
7701
|
disabled: !canPreviousPage,
|
7578
7702
|
icon: "arrow-left",
|
7579
|
-
onClick: ()
|
7703
|
+
onClick: function onClick() {
|
7704
|
+
return setPageIndex(pageIndex - 1);
|
7705
|
+
},
|
7580
7706
|
"aria-label": showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage,
|
7581
7707
|
tooltip: showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage
|
7582
7708
|
}), showPageNumbers && pageCount > 0 && React.createElement(PageNumbers, {
|
@@ -7587,36 +7713,43 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7587
7713
|
appearance: "default",
|
7588
7714
|
disabled: !canNextPage,
|
7589
7715
|
icon: "arrow-right",
|
7590
|
-
onClick: ()
|
7716
|
+
onClick: function onClick() {
|
7717
|
+
return setPageIndex(pageIndex + 1);
|
7718
|
+
},
|
7591
7719
|
"aria-label": showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage,
|
7592
7720
|
tooltip: showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage
|
7593
7721
|
}), React.createElement(IconButton, {
|
7594
7722
|
appearance: "default",
|
7595
7723
|
disabled: !canNextPage,
|
7596
7724
|
icon: "arrow-end",
|
7597
|
-
onClick: ()
|
7725
|
+
onClick: function onClick() {
|
7726
|
+
return setPageIndex(pageCount - 1);
|
7727
|
+
},
|
7598
7728
|
"aria-label": showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage,
|
7599
7729
|
tooltip: showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage
|
7600
7730
|
})));
|
7601
7731
|
});
|
7602
7732
|
|
7603
|
-
|
7604
|
-
|
7605
|
-
|
7606
|
-
|
7607
|
-
|
7733
|
+
var _excluded$s = ["duration"];
|
7734
|
+
var Progress = function Progress(_ref) {
|
7735
|
+
var _cn;
|
7736
|
+
|
7737
|
+
var _ref$duration = _ref.duration,
|
7738
|
+
duration = _ref$duration === void 0 ? undefined : _ref$duration,
|
7739
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
7740
|
+
|
7741
|
+
var style;
|
7608
7742
|
|
7609
7743
|
if (duration) {
|
7610
7744
|
style = {
|
7611
|
-
animationDuration:
|
7745
|
+
animationDuration: duration + "ms"
|
7612
7746
|
};
|
7613
7747
|
}
|
7614
7748
|
|
7615
|
-
|
7616
|
-
|
7617
|
-
"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
|
7618
|
-
|
7619
|
-
});
|
7749
|
+
var className = cn('bg-grey-light rounded block h-1 overflow-hidden w-full', props.className);
|
7750
|
+
var progressClassName = cn('yt-progress__bar block h-1', (_cn = {
|
7751
|
+
"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
|
7752
|
+
}, _cn["w-0 bg-grey-dark animate-[progress_linear]"] = duration, _cn));
|
7620
7753
|
return React__default.createElement("span", Object.assign({}, props, {
|
7621
7754
|
"data-taco": "progress",
|
7622
7755
|
className: className
|
@@ -9225,16 +9358,19 @@ const useTableRowCreation = (data, tableRef) => {
|
|
9225
9358
|
};
|
9226
9359
|
};
|
9227
9360
|
|
9228
|
-
|
9229
|
-
|
9230
|
-
id
|
9231
|
-
|
9232
|
-
|
9233
|
-
|
9234
|
-
|
9235
|
-
|
9236
|
-
|
9237
|
-
|
9361
|
+
var _excluded$t = ["id", "defaultId", "children", "onChange", "orientation"],
|
9362
|
+
_excluded2$5 = ["id", "disabled"],
|
9363
|
+
_excluded3 = ["id"];
|
9364
|
+
var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
9365
|
+
var id = props.id,
|
9366
|
+
defaultId = props.defaultId,
|
9367
|
+
children = props.children,
|
9368
|
+
onChange = props.onChange,
|
9369
|
+
_props$orientation = props.orientation,
|
9370
|
+
orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
|
9371
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$t);
|
9372
|
+
|
9373
|
+
var className = cn('yt-tabs', "yt-tabs--" + orientation, {
|
9238
9374
|
'flex w-full': orientation === 'vertical'
|
9239
9375
|
}, props.className);
|
9240
9376
|
return React.createElement(TabsPrimitive.Root, Object.assign({}, otherProps, {
|
@@ -9248,20 +9384,19 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
|
9248
9384
|
value: id
|
9249
9385
|
}), children);
|
9250
9386
|
});
|
9251
|
-
|
9252
|
-
|
9387
|
+
var TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9388
|
+
var className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);
|
9253
9389
|
return React.createElement(TabsPrimitive.List, Object.assign({}, props, {
|
9254
9390
|
className: className,
|
9255
9391
|
ref: ref
|
9256
9392
|
}));
|
9257
9393
|
});
|
9258
|
-
|
9259
|
-
|
9260
|
-
|
9261
|
-
|
9262
|
-
|
9263
|
-
|
9264
|
-
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);
|
9394
|
+
var TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9395
|
+
var id = props.id,
|
9396
|
+
disabled = props.disabled,
|
9397
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$5);
|
9398
|
+
|
9399
|
+
var 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);
|
9265
9400
|
return React.createElement(TabsPrimitive.Trigger, Object.assign({}, otherProps, {
|
9266
9401
|
className: className,
|
9267
9402
|
disabled: disabled,
|
@@ -9272,12 +9407,11 @@ const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
9272
9407
|
value: id
|
9273
9408
|
}));
|
9274
9409
|
});
|
9275
|
-
|
9276
|
-
|
9277
|
-
|
9278
|
-
|
9279
|
-
|
9280
|
-
const className = cn('yt-tab__panel outline-none', props.className);
|
9410
|
+
var TabContent = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9411
|
+
var id = props.id,
|
9412
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded3);
|
9413
|
+
|
9414
|
+
var className = cn('yt-tab__panel outline-none', props.className);
|
9281
9415
|
return React.createElement(TabsPrimitive.Content, Object.assign({}, otherProps, {
|
9282
9416
|
className: className,
|
9283
9417
|
ref: ref,
|
@@ -9288,22 +9422,19 @@ Tabs.List = TabList;
|
|
9288
9422
|
Tabs.Trigger = TabTrigger;
|
9289
9423
|
Tabs.Content = TabContent;
|
9290
9424
|
|
9291
|
-
|
9292
|
-
|
9293
|
-
|
9294
|
-
|
9295
|
-
|
9296
|
-
|
9297
|
-
...otherProps
|
9298
|
-
} = props;
|
9299
|
-
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
|
9425
|
+
var _excluded$u = ["defaultValue", "highlighted", "invalid", "onKeyDown"];
|
9426
|
+
var Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
9427
|
+
var onKeyDown = props.onKeyDown,
|
9428
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$u);
|
9429
|
+
|
9430
|
+
var 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
|
9300
9431
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
9301
9432
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
9302
9433
|
|
9303
|
-
|
9434
|
+
var handleKeyDown = function handleKeyDown(event) {
|
9304
9435
|
if (event.key === 'Home' || event.key === 'End') {
|
9305
9436
|
event.preventDefault();
|
9306
|
-
|
9437
|
+
var position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
9307
9438
|
event.currentTarget.setSelectionRange(position, position);
|
9308
9439
|
event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;
|
9309
9440
|
}
|
@@ -9321,18 +9452,18 @@ const Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
|
9321
9452
|
}));
|
9322
9453
|
});
|
9323
9454
|
|
9324
|
-
|
9325
|
-
|
9326
|
-
|
9327
|
-
|
9328
|
-
|
9329
|
-
|
9330
|
-
|
9455
|
+
var _excluded$v = ["label", "onChange"];
|
9456
|
+
var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
9457
|
+
var label = props.label,
|
9458
|
+
onChange = props.onChange,
|
9459
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$v);
|
9460
|
+
|
9461
|
+
var className = cn('group h-5 w-9 flex rounded-full inline-flex', {
|
9331
9462
|
'mr-2': !!label,
|
9332
9463
|
'bg-grey-darker hover:bg-grey-dark aria-checked:bg-blue aria-checked:hover:bg-blue-light focus:yt-focus': !props.disabled,
|
9333
9464
|
'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled
|
9334
9465
|
}, props.className);
|
9335
|
-
|
9466
|
+
var element = React.createElement(PrimitiveSwitch.Root, Object.assign({}, otherProps, {
|
9336
9467
|
className: className,
|
9337
9468
|
onCheckedChange: onChange,
|
9338
9469
|
ref: ref
|
@@ -9341,7 +9472,7 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9341
9472
|
}));
|
9342
9473
|
|
9343
9474
|
if (label) {
|
9344
|
-
|
9475
|
+
var labelClassName = cn('flex items-center cursor-pointer', {
|
9345
9476
|
'cursor-not-allowed text-grey-dark': props.disabled
|
9346
9477
|
});
|
9347
9478
|
return React.createElement("label", {
|
@@ -9352,22 +9483,23 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9352
9483
|
return element;
|
9353
9484
|
});
|
9354
9485
|
|
9355
|
-
|
9356
|
-
|
9357
|
-
|
9358
|
-
|
9359
|
-
|
9360
|
-
|
9361
|
-
|
9362
|
-
|
9363
|
-
|
9364
|
-
|
9365
|
-
|
9366
|
-
|
9367
|
-
|
9368
|
-
|
9369
|
-
React.
|
9370
|
-
|
9486
|
+
var _excluded$w = ["autoStart", "onComplete", "onClose", "onReady", "spotlightClicks", "disableCloseOnEsc", "disableScrollParentFix"];
|
9487
|
+
|
9488
|
+
var Tooltip$1 = function Tooltip(_ref) {
|
9489
|
+
var continuous = _ref.continuous,
|
9490
|
+
index = _ref.index,
|
9491
|
+
isLastStep = _ref.isLastStep,
|
9492
|
+
step = _ref.step,
|
9493
|
+
backProps = _ref.backProps,
|
9494
|
+
primaryProps = _ref.primaryProps,
|
9495
|
+
skipProps = _ref.skipProps,
|
9496
|
+
tooltipProps = _ref.tooltipProps,
|
9497
|
+
size = _ref.size,
|
9498
|
+
locale = _ref.locale,
|
9499
|
+
disableTourSkipOnEsc = _ref.disableTourSkipOnEsc;
|
9500
|
+
var skipButtonRef = React.useRef(null);
|
9501
|
+
React.useEffect(function () {
|
9502
|
+
var onWindowKeyDown = function onWindowKeyDown(event) {
|
9371
9503
|
if (!disableTourSkipOnEsc) {
|
9372
9504
|
if (event.keyCode === keycode('esc') && skipButtonRef.current !== null) {
|
9373
9505
|
event.preventDefault();
|
@@ -9378,7 +9510,7 @@ const Tooltip$1 = ({
|
|
9378
9510
|
};
|
9379
9511
|
|
9380
9512
|
window.addEventListener('keydown', onWindowKeyDown);
|
9381
|
-
return ()
|
9513
|
+
return function () {
|
9382
9514
|
window.removeEventListener('keydown', onWindowKeyDown);
|
9383
9515
|
};
|
9384
9516
|
}, []);
|
@@ -9397,30 +9529,30 @@ const Tooltip$1 = ({
|
|
9397
9529
|
appearance: "discrete"
|
9398
9530
|
}), locale.back), React.createElement(Button$1, Object.assign({}, primaryProps, {
|
9399
9531
|
appearance: "primary"
|
9400
|
-
}), continuous ? isLastStep ?
|
9532
|
+
}), continuous ? isLastStep ? locale.last + " (" + (index + 1) + "/" + size + ")" : locale.next + " (" + (index + 1) + "/" + size + ")" : locale.close)));
|
9401
9533
|
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
9402
9534
|
|
9403
9535
|
|
9404
|
-
|
9405
|
-
|
9406
|
-
|
9407
|
-
|
9408
|
-
|
9409
|
-
|
9410
|
-
|
9411
|
-
|
9412
|
-
|
9413
|
-
|
9414
|
-
|
9415
|
-
|
9416
|
-
|
9417
|
-
|
9418
|
-
|
9419
|
-
|
9420
|
-
|
9421
|
-
|
9422
|
-
return React.Children.map(props.children, child
|
9423
|
-
|
9536
|
+
var TourStep = function TourStep(_props) {
|
9537
|
+
return null;
|
9538
|
+
};
|
9539
|
+
var Tour = function Tour(props) {
|
9540
|
+
var _useLocalization = useLocalization(),
|
9541
|
+
tour = _useLocalization.texts.tour;
|
9542
|
+
|
9543
|
+
var run = props.autoStart,
|
9544
|
+
onComplete = props.onComplete,
|
9545
|
+
onClose = props.onClose,
|
9546
|
+
onReady = props.onReady,
|
9547
|
+
spotlightClicks = props.spotlightClicks,
|
9548
|
+
disableTourSkipOnEsc = props.disableCloseOnEsc,
|
9549
|
+
_props$disableScrollP = props.disableScrollParentFix,
|
9550
|
+
disableScrollParentFix = _props$disableScrollP === void 0 ? false : _props$disableScrollP,
|
9551
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$w);
|
9552
|
+
|
9553
|
+
var steps = React.useMemo(function () {
|
9554
|
+
return React.Children.map(props.children, function (child) {
|
9555
|
+
var step = {
|
9424
9556
|
disableBeacon: !child.props.showBeacon,
|
9425
9557
|
target: child.props.selector,
|
9426
9558
|
placement: child.props.position,
|
@@ -9430,10 +9562,12 @@ const Tour = props => {
|
|
9430
9562
|
return step;
|
9431
9563
|
});
|
9432
9564
|
}, [props.children]);
|
9433
|
-
|
9565
|
+
var getStep = React.useCallback(function (selector) {
|
9434
9566
|
var _props$children$find;
|
9435
9567
|
|
9436
|
-
return (_props$children$find = props.children.find(
|
9568
|
+
return (_props$children$find = props.children.find(function (child) {
|
9569
|
+
return child.props.selector === selector;
|
9570
|
+
})) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
9437
9571
|
}, [props.children]);
|
9438
9572
|
|
9439
9573
|
function callback(state) {
|
@@ -9463,10 +9597,12 @@ const Tour = props => {
|
|
9463
9597
|
floaterProps: {
|
9464
9598
|
disableAnimation: true
|
9465
9599
|
},
|
9466
|
-
tooltipComponent:
|
9467
|
-
|
9468
|
-
|
9469
|
-
|
9600
|
+
tooltipComponent: function tooltipComponent(tooltipProps) {
|
9601
|
+
return React.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
|
9602
|
+
locale: tour,
|
9603
|
+
disableTourSkipOnEsc: disableTourSkipOnEsc
|
9604
|
+
}));
|
9605
|
+
},
|
9470
9606
|
locale: tour,
|
9471
9607
|
spotlightPadding: 8,
|
9472
9608
|
spotlightClicks: spotlightClicks,
|
@@ -9507,45 +9643,25 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9507
9643
|
}, [ref, callback]);
|
9508
9644
|
};
|
9509
9645
|
|
9510
|
-
var
|
9511
|
-
var
|
9512
|
-
|
9513
|
-
|
9514
|
-
|
9515
|
-
|
9516
|
-
|
9517
|
-
|
9518
|
-
|
9519
|
-
|
9520
|
-
|
9521
|
-
|
9522
|
-
|
9523
|
-
|
9524
|
-
|
9525
|
-
|
9526
|
-
|
9527
|
-
|
9528
|
-
|
9529
|
-
if (isEnterKeyPressed) {
|
9530
|
-
handleClick();
|
9531
|
-
}
|
9532
|
-
|
9533
|
-
(_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
|
9534
|
-
};
|
9535
|
-
|
9536
|
-
return React.createElement(Input, Object.assign({
|
9537
|
-
"aria-label": texts.searchInput.inputLabel
|
9538
|
-
}, props, {
|
9539
|
-
button: React.createElement(IconButton, {
|
9540
|
-
icon: "search",
|
9541
|
-
className: "!border-transparent !bg-transparent focus:!border-transparent peer-focus:!border-transparent peer-focus:peer-active:!border-transparent",
|
9542
|
-
disabled: props.disabled,
|
9543
|
-
onClick: handleClick
|
9544
|
-
}),
|
9545
|
-
onKeyDown: handleKeyDown,
|
9546
|
-
ref: ref,
|
9547
|
-
type: "search"
|
9548
|
-
}));
|
9646
|
+
var Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
|
9647
|
+
var title = props.title,
|
9648
|
+
menu = props.menu,
|
9649
|
+
children = props.children;
|
9650
|
+
var className = cn('bg-white p-4 rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]', props.className);
|
9651
|
+
return React.createElement("div", {
|
9652
|
+
className: className,
|
9653
|
+
"data-taco": "card",
|
9654
|
+
ref: ref
|
9655
|
+
}, React.createElement("span", {
|
9656
|
+
className: "flex"
|
9657
|
+
}, title && React.createElement("h4", {
|
9658
|
+
className: "flex-grow text-left"
|
9659
|
+
}, title), menu ? React.createElement(IconButton, {
|
9660
|
+
icon: "ellipsis-horizontal",
|
9661
|
+
appearance: "discrete",
|
9662
|
+
menu: menu,
|
9663
|
+
className: "-mt-[4px]"
|
9664
|
+
}) : null), children);
|
9549
9665
|
});
|
9550
9666
|
|
9551
9667
|
exports.Accordion = Accordion;
|
@@ -9554,6 +9670,7 @@ exports.Badge = Badge;
|
|
9554
9670
|
exports.Banner = Banner;
|
9555
9671
|
exports.Button = Button$1;
|
9556
9672
|
exports.Calendar = Calendar$1;
|
9673
|
+
exports.Card = Card;
|
9557
9674
|
exports.Checkbox = Checkbox;
|
9558
9675
|
exports.Combobox = Combobox;
|
9559
9676
|
exports.Datepicker = Datepicker;
|