@economic/taco 0.0.30-alpha.0 → 0.0.31-alpha.2
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/Datepicker/Datepicker.js +52 -48
- package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/components/Form/Form.js +8 -6
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/Group/Group.js +8 -6
- package/dist/esm/components/Group/Group.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js +33 -25
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js +8 -7
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.js +11 -9
- package/dist/esm/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/components/Input/Input.js +24 -26
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js +25 -24
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js +43 -20
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/components/Item.js +5 -5
- package/dist/esm/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/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 +57 -45
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +11 -10
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/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/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.css +8 -5
- package/dist/index.css +8 -5
- package/dist/taco.cjs.development.js +754 -628
- 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
@@ -3122,17 +3122,17 @@ const icons = {
|
|
3122
3122
|
zoom: Zoom
|
3123
3123
|
};
|
3124
3124
|
|
3125
|
-
|
3125
|
+
var _excluded = ["name"];
|
3126
|
+
var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
3126
3127
|
var _props$className;
|
3127
3128
|
|
3128
|
-
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3132
|
-
const Component = icons[name];
|
3129
|
+
var name = props.name,
|
3130
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
3131
|
+
|
3132
|
+
var Component = icons[name];
|
3133
3133
|
/* 24x24 _at the base body font_ - must be em so that they scale with font size - tailwind spacing uses rem */
|
3134
3134
|
|
3135
|
-
|
3135
|
+
var className = cn('inline-flex h-[1.715em] w-[1.715em]', props.className, {
|
3136
3136
|
'p-[3px]': (_props$className = props.className) === null || _props$className === void 0 ? void 0 : _props$className.includes('rounded-full')
|
3137
3137
|
});
|
3138
3138
|
return Component ? React__default.createElement(Component, Object.assign({}, otherProps, {
|
@@ -3144,7 +3144,7 @@ const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
3144
3144
|
})) : null;
|
3145
3145
|
});
|
3146
3146
|
|
3147
|
-
var _excluded = ["id"],
|
3147
|
+
var _excluded$1 = ["id"],
|
3148
3148
|
_excluded2 = ["id", "defaultId", "onChange", "as"];
|
3149
3149
|
var AccordionContext = /*#__PURE__*/React__default.createContext({
|
3150
3150
|
as: 'h2'
|
@@ -3182,7 +3182,7 @@ var Content = /*#__PURE__*/React__default.forwardRef(function AccordionContent(p
|
|
3182
3182
|
|
3183
3183
|
var Item = function Item(props) {
|
3184
3184
|
var id = props.id,
|
3185
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
3185
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
3186
3186
|
|
3187
3187
|
return React__default.createElement(AccordionPrimitive.Item, Object.assign({}, otherProps, {
|
3188
3188
|
value: id
|
@@ -3237,7 +3237,7 @@ var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
|
|
3237
3237
|
}));
|
3238
3238
|
});
|
3239
3239
|
|
3240
|
-
|
3240
|
+
var 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
|
@@ -3283,7 +3283,7 @@ const getOutlineClasses = state => {
|
|
3283
3283
|
}
|
3284
3284
|
};
|
3285
3285
|
|
3286
|
-
var _excluded$
|
3286
|
+
var _excluded$2 = ["children", "compact", "outline", "state"];
|
3287
3287
|
var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
3288
3288
|
var _cn;
|
3289
3289
|
|
@@ -3293,7 +3293,7 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
3293
3293
|
_props$outline = props.outline,
|
3294
3294
|
outline = _props$outline === void 0 ? false : _props$outline,
|
3295
3295
|
state = props.state,
|
3296
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3296
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
|
3297
3297
|
|
3298
3298
|
var className = cn('rounded-full border font-bold text-xs uppercase overflow-hidden whitespace-nowrap inline-flex items-center justify-center h-5', (_cn = {}, _cn[getOutlineClasses(state)] = outline, _cn["border-transparent " + getStateClasses(state)] = !outline, _cn['h-2 w-2 min-w-0'] = compact, _cn['h-5 py-0 px-[0.354rem]'] = !compact, _cn), props.className);
|
3299
3299
|
return React.createElement("span", Object.assign({}, otherProps, {
|
@@ -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
|
+
var _excluded$3 = ["title", "children", "placement"];
|
3359
|
+
var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
3360
|
+
var title = props.title,
|
3361
|
+
children = props.children,
|
3362
|
+
placement = props.placement,
|
3363
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
3364
|
+
|
3365
3365
|
return React.createElement(TooltipPrimitive.Root, {
|
3366
3366
|
delayDuration: 50
|
3367
3367
|
}, React.createElement(TooltipPrimitive.Trigger, {
|
@@ -3383,7 +3383,7 @@ const 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
|
3386
|
+
return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] h-max inline-flex items-center justify-center border';
|
3387
3387
|
};
|
3388
3388
|
const getAppearanceClasses = (value, icon = false) => {
|
3389
3389
|
switch (value) {
|
@@ -3453,13 +3453,14 @@ const createButton = (props, className, ref) => {
|
|
3453
3453
|
return button;
|
3454
3454
|
};
|
3455
3455
|
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3459
|
-
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3456
|
+
var _excluded$4 = ["icon", "rounded"];
|
3457
|
+
var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
3458
|
+
var icon = props.icon,
|
3459
|
+
_props$rounded = props.rounded,
|
3460
|
+
rounded = _props$rounded === void 0 ? false : _props$rounded,
|
3461
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
3462
|
+
|
3463
|
+
var className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3463
3464
|
'rounded-full': rounded,
|
3464
3465
|
rounded: !rounded,
|
3465
3466
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3470,13 +3471,13 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref)
|
|
3470
3471
|
return null;
|
3471
3472
|
}
|
3472
3473
|
|
3473
|
-
return createButton({
|
3474
|
+
return createButton(_extends({}, otherProps, {
|
3474
3475
|
children: React.createElement(Icon, {
|
3475
3476
|
name: icon,
|
3476
3477
|
className: "m-0 p-0"
|
3477
3478
|
}),
|
3478
3479
|
'data-taco': 'icon-button'
|
3479
|
-
}, className, ref);
|
3480
|
+
}), className, ref);
|
3480
3481
|
});
|
3481
3482
|
|
3482
3483
|
var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
@@ -3496,10 +3497,10 @@ var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3496
3497
|
}) : null);
|
3497
3498
|
});
|
3498
3499
|
|
3499
|
-
var _excluded$
|
3500
|
+
var _excluded$5 = ["fluid"];
|
3500
3501
|
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3501
3502
|
var fluid = props.fluid,
|
3502
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
3503
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
|
3503
3504
|
|
3504
3505
|
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3505
3506
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3570,21 +3571,27 @@ function useTimer(duration = 0, callback) {
|
|
3570
3571
|
};
|
3571
3572
|
}
|
3572
3573
|
|
3573
|
-
|
3574
|
-
|
3575
|
-
|
3576
|
-
|
3577
|
-
|
3578
|
-
|
3579
|
-
|
3580
|
-
React__default.
|
3581
|
-
|
3574
|
+
var _excluded$6 = ["delay", "label"];
|
3575
|
+
var Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
3576
|
+
var _props$delay = props.delay,
|
3577
|
+
delay = _props$delay === void 0 ? 500 : _props$delay,
|
3578
|
+
label = props.label,
|
3579
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
|
3580
|
+
|
3581
|
+
var _React$useState = React__default.useState(!delay),
|
3582
|
+
visible = _React$useState[0],
|
3583
|
+
setVisibility = _React$useState[1];
|
3584
|
+
|
3585
|
+
React__default.useEffect(function () {
|
3586
|
+
var timeout;
|
3582
3587
|
|
3583
3588
|
if (delay) {
|
3584
|
-
timeout = window.setTimeout(
|
3589
|
+
timeout = window.setTimeout(function () {
|
3590
|
+
return setVisibility(true);
|
3591
|
+
}, delay);
|
3585
3592
|
}
|
3586
3593
|
|
3587
|
-
return ()
|
3594
|
+
return function () {
|
3588
3595
|
if (timeout) {
|
3589
3596
|
clearTimeout(timeout);
|
3590
3597
|
}
|
@@ -3595,7 +3602,7 @@ const Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props,
|
|
3595
3602
|
return null;
|
3596
3603
|
}
|
3597
3604
|
|
3598
|
-
|
3605
|
+
var className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
3599
3606
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
3600
3607
|
className: className,
|
3601
3608
|
"data-taco": "spinner",
|
@@ -3721,49 +3728,62 @@ const Toast = ({
|
|
3721
3728
|
}));
|
3722
3729
|
};
|
3723
3730
|
|
3724
|
-
|
3725
|
-
|
3731
|
+
var _excluded$7 = ["children"];
|
3732
|
+
var DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
|
3733
|
+
var ToastContext = /*#__PURE__*/React.createContext({});
|
3726
3734
|
|
3727
|
-
|
3728
|
-
|
3729
|
-
|
3735
|
+
var insertToastWithoutDuplicates = function insertToastWithoutDuplicates(currentToasts, id, content, options, close) {
|
3736
|
+
var nextToasts = [].concat(currentToasts);
|
3737
|
+
var existingToastIndex = currentToasts.findIndex(function (toast) {
|
3738
|
+
return JSON.stringify(toast.content) === JSON.stringify(content);
|
3739
|
+
});
|
3730
3740
|
|
3731
3741
|
if (existingToastIndex > -1) {
|
3732
3742
|
nextToasts[existingToastIndex].lastDuplicateId = id;
|
3733
3743
|
nextToasts[existingToastIndex].lastUpdated = Date.now();
|
3734
3744
|
} else {
|
3735
3745
|
nextToasts.push({
|
3736
|
-
id,
|
3746
|
+
id: id,
|
3737
3747
|
content: typeof content === 'function' ? content(close) : content,
|
3738
|
-
options
|
3748
|
+
options: options
|
3739
3749
|
});
|
3740
3750
|
}
|
3741
3751
|
|
3742
3752
|
return nextToasts;
|
3743
3753
|
};
|
3744
3754
|
|
3745
|
-
|
3746
|
-
children,
|
3747
|
-
|
3748
|
-
}) => {
|
3749
|
-
const [toasts, setToasts] = React.useState([]);
|
3755
|
+
var ToastProvider = function ToastProvider(_ref) {
|
3756
|
+
var children = _ref.children,
|
3757
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
3750
3758
|
|
3751
|
-
|
3752
|
-
|
3759
|
+
var _React$useState = React.useState([]),
|
3760
|
+
toasts = _React$useState[0],
|
3761
|
+
setToasts = _React$useState[1];
|
3762
|
+
|
3763
|
+
var handleClose = function handleClose(id) {
|
3764
|
+
setToasts(function (currentToasts) {
|
3765
|
+
return currentToasts.filter(function (toast) {
|
3766
|
+
return toast.id !== id;
|
3767
|
+
});
|
3768
|
+
});
|
3753
3769
|
}; // memoize (useCallback) this function,
|
3754
3770
|
// it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children
|
3755
3771
|
|
3756
3772
|
|
3757
|
-
|
3758
|
-
|
3773
|
+
var toaster = React.useCallback(function (content, options) {
|
3774
|
+
var id = uuid.v4();
|
3759
3775
|
|
3760
|
-
|
3776
|
+
var close = function close() {
|
3777
|
+
return handleClose(id);
|
3778
|
+
};
|
3761
3779
|
|
3762
|
-
setToasts(
|
3780
|
+
setToasts(function (currentToasts) {
|
3781
|
+
return insertToastWithoutDuplicates(currentToasts, id, content, options, close);
|
3782
|
+
});
|
3763
3783
|
|
3764
|
-
|
3765
|
-
setToasts(currentToasts
|
3766
|
-
|
3784
|
+
var update = function update(content, options) {
|
3785
|
+
setToasts(function (currentToasts) {
|
3786
|
+
var nextToasts = currentToasts.filter(function (toast) {
|
3767
3787
|
if (toast.lastDuplicateId) {
|
3768
3788
|
return toast.lastDuplicateId !== id;
|
3769
3789
|
}
|
@@ -3774,70 +3794,80 @@ const ToastProvider = ({
|
|
3774
3794
|
});
|
3775
3795
|
};
|
3776
3796
|
|
3777
|
-
|
3778
|
-
update(content, {
|
3779
|
-
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3780
|
-
|
3797
|
+
var success = function success(content, options) {
|
3798
|
+
update(content, _extends({
|
3799
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3800
|
+
}, options, {
|
3781
3801
|
type: 'success'
|
3782
|
-
});
|
3802
|
+
}));
|
3783
3803
|
};
|
3784
3804
|
|
3785
|
-
|
3786
|
-
update(content, {
|
3805
|
+
var error = function error(content, options) {
|
3806
|
+
update(content, _extends({}, options, {
|
3787
3807
|
type: 'error'
|
3788
|
-
});
|
3808
|
+
}));
|
3789
3809
|
};
|
3790
3810
|
|
3791
|
-
|
3792
|
-
update(content, {
|
3811
|
+
var warning = function warning(content, options) {
|
3812
|
+
update(content, _extends({}, options, {
|
3793
3813
|
type: 'warning'
|
3794
|
-
});
|
3814
|
+
}));
|
3795
3815
|
};
|
3796
3816
|
|
3797
|
-
|
3798
|
-
update(content, {
|
3817
|
+
var information = function information(content, options) {
|
3818
|
+
update(content, _extends({}, options, {
|
3799
3819
|
type: 'information'
|
3800
|
-
});
|
3820
|
+
}));
|
3801
3821
|
};
|
3802
3822
|
|
3803
|
-
|
3804
|
-
update(content, {
|
3823
|
+
var loading = function loading(content, options) {
|
3824
|
+
update(content, _extends({}, options, {
|
3805
3825
|
type: 'loading'
|
3806
|
-
});
|
3826
|
+
}));
|
3807
3827
|
};
|
3808
3828
|
|
3809
3829
|
return {
|
3810
|
-
success,
|
3811
|
-
error,
|
3812
|
-
warning,
|
3813
|
-
information,
|
3814
|
-
loading,
|
3815
|
-
close
|
3830
|
+
success: success,
|
3831
|
+
error: error,
|
3832
|
+
warning: warning,
|
3833
|
+
information: information,
|
3834
|
+
loading: loading,
|
3835
|
+
close: close
|
3816
3836
|
};
|
3817
3837
|
}, []); // no need to rebind these every render, do them once in an effect
|
3818
3838
|
|
3819
|
-
React.useEffect(()
|
3820
|
-
toaster.success = (content, options)
|
3821
|
-
|
3822
|
-
|
3823
|
-
|
3824
|
-
|
3839
|
+
React.useEffect(function () {
|
3840
|
+
toaster.success = function (content, options) {
|
3841
|
+
return toaster(content, _extends({
|
3842
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3843
|
+
}, options, {
|
3844
|
+
type: 'success'
|
3845
|
+
}));
|
3846
|
+
};
|
3825
3847
|
|
3826
|
-
toaster.error = (content, options)
|
3827
|
-
|
3828
|
-
|
3848
|
+
toaster.error = function (content, options) {
|
3849
|
+
return toaster(content, _extends({}, options, {
|
3850
|
+
type: 'error'
|
3851
|
+
}));
|
3852
|
+
};
|
3829
3853
|
|
3830
|
-
toaster.warning = (content, options)
|
3831
|
-
|
3832
|
-
|
3854
|
+
toaster.warning = function (content, options) {
|
3855
|
+
return toaster(content, _extends({}, options, {
|
3856
|
+
type: 'warning'
|
3857
|
+
}));
|
3858
|
+
};
|
3833
3859
|
|
3834
|
-
toaster.information = (content, options)
|
3835
|
-
|
3836
|
-
|
3860
|
+
toaster.information = function (content, options) {
|
3861
|
+
return toaster(content, _extends({}, options, {
|
3862
|
+
type: 'information'
|
3863
|
+
}));
|
3864
|
+
};
|
3837
3865
|
|
3838
|
-
toaster.loading = (content, options)
|
3839
|
-
|
3840
|
-
|
3866
|
+
toaster.loading = function (content, options) {
|
3867
|
+
return toaster(content, _extends({}, options, {
|
3868
|
+
type: 'loading'
|
3869
|
+
}));
|
3870
|
+
};
|
3841
3871
|
}, []);
|
3842
3872
|
return React.createElement(ToastContext.Provider, Object.assign({}, props, {
|
3843
3873
|
value: toaster
|
@@ -3847,37 +3877,43 @@ const ToastProvider = ({
|
|
3847
3877
|
role: "log"
|
3848
3878
|
}, React.createElement(framerMotion.AnimatePresence, {
|
3849
3879
|
initial: false
|
3850
|
-
}, toasts.map(
|
3851
|
-
|
3852
|
-
|
3853
|
-
type: 'spring',
|
3854
|
-
damping: 20,
|
3855
|
-
stiffness: 300
|
3856
|
-
},
|
3857
|
-
initial: {
|
3858
|
-
opacity: 0,
|
3859
|
-
y: 10,
|
3860
|
-
scale: 0.5
|
3861
|
-
},
|
3862
|
-
animate: {
|
3863
|
-
opacity: 1,
|
3864
|
-
y: 0,
|
3865
|
-
scale: 1
|
3866
|
-
},
|
3867
|
-
exit: {
|
3868
|
-
opacity: 0,
|
3869
|
-
scale: 0.5,
|
3880
|
+
}, toasts.map(function (toast) {
|
3881
|
+
return React.createElement(framerMotion.motion.div, {
|
3882
|
+
key: toast.id,
|
3870
3883
|
transition: {
|
3871
|
-
|
3884
|
+
type: 'spring',
|
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
|
+
}
|
3872
3904
|
}
|
3873
|
-
}
|
3874
|
-
|
3875
|
-
|
3876
|
-
|
3905
|
+
}, React.createElement(Toast, Object.assign({}, toast, {
|
3906
|
+
onClose: function onClose() {
|
3907
|
+
return handleClose(toast.id);
|
3908
|
+
}
|
3909
|
+
})));
|
3910
|
+
}))));
|
3911
|
+
};
|
3912
|
+
var useToast = function useToast() {
|
3913
|
+
return React.useContext(ToastContext);
|
3877
3914
|
};
|
3878
|
-
const useToast = () => React.useContext(ToastContext);
|
3879
3915
|
|
3880
|
-
|
3916
|
+
var defaultLocalisationTexts = {
|
3881
3917
|
calendar: {
|
3882
3918
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
3883
3919
|
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
@@ -3952,32 +3988,37 @@ const defaultLocalisationTexts = {
|
|
3952
3988
|
inputLabel: 'Search...'
|
3953
3989
|
}
|
3954
3990
|
};
|
3955
|
-
|
3991
|
+
var defaultLocalizationContext = {
|
3956
3992
|
locale: 'en-GB',
|
3957
3993
|
texts: defaultLocalisationTexts,
|
3958
3994
|
formatting: {
|
3959
3995
|
date: 'dd.mm.yy'
|
3960
3996
|
}
|
3961
3997
|
};
|
3962
|
-
|
3998
|
+
var Context = /*#__PURE__*/React.createContext({
|
3963
3999
|
localization: defaultLocalizationContext
|
3964
4000
|
});
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
3968
|
-
|
3969
|
-
|
3970
|
-
|
3971
|
-
|
3972
|
-
|
4001
|
+
var Provider = function Provider(props) {
|
4002
|
+
var children = props.children,
|
4003
|
+
_props$localization = props.localization,
|
4004
|
+
localization = _props$localization === void 0 ? defaultLocalizationContext : _props$localization;
|
4005
|
+
var value = React.useMemo(function () {
|
4006
|
+
return {
|
4007
|
+
localization: localization
|
4008
|
+
};
|
4009
|
+
}, [localization]);
|
3973
4010
|
return React.createElement(Context.Provider, {
|
3974
4011
|
value: value
|
3975
4012
|
}, React.createElement(ToastProvider, null, children));
|
3976
4013
|
};
|
3977
|
-
|
3978
|
-
|
4014
|
+
var useTaco = function useTaco() {
|
4015
|
+
return React.useContext(Context);
|
4016
|
+
};
|
4017
|
+
var useLocalization = function useLocalization() {
|
4018
|
+
return useTaco().localization;
|
4019
|
+
};
|
3979
4020
|
|
3980
|
-
var _excluded$
|
4021
|
+
var _excluded$8 = ["onChange", "value"];
|
3981
4022
|
|
3982
4023
|
var renderDay = function renderDay(day, modifiers) {
|
3983
4024
|
return modifiers.disabled ? React.createElement("span", {
|
@@ -4056,7 +4097,7 @@ var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
|
4056
4097
|
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4057
4098
|
var handleChange = props.onChange,
|
4058
4099
|
value = props.value,
|
4059
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4100
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
|
4060
4101
|
|
4061
4102
|
var _useLocalization2 = useLocalization(),
|
4062
4103
|
locale = _useLocalization2.locale,
|
@@ -4120,7 +4161,7 @@ var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4120
4161
|
})));
|
4121
4162
|
});
|
4122
4163
|
|
4123
|
-
var _excluded$
|
4164
|
+
var _excluded$9 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
|
4124
4165
|
var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4125
4166
|
var checked = props.checked,
|
4126
4167
|
highlighted = props.highlighted,
|
@@ -4128,7 +4169,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4128
4169
|
invalid = props.invalid,
|
4129
4170
|
label = props.label,
|
4130
4171
|
onChange = props.onChange,
|
4131
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
4172
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
|
4132
4173
|
|
4133
4174
|
var className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem]', {
|
4134
4175
|
'mr-2': !!label,
|
@@ -4202,22 +4243,21 @@ const getButtonStateClasses = invalid => {
|
|
4202
4243
|
return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
|
4203
4244
|
};
|
4204
4245
|
|
4205
|
-
|
4206
|
-
|
4207
|
-
|
4208
|
-
|
4209
|
-
|
4210
|
-
|
4211
|
-
|
4212
|
-
|
4213
|
-
|
4214
|
-
|
4215
|
-
|
4216
|
-
|
4217
|
-
const className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4246
|
+
var _excluded$a = ["button", "icon", "highlighted", "invalid", "onKeyDown", "autoFocus"];
|
4247
|
+
var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
4248
|
+
var button = props.button,
|
4249
|
+
icon = props.icon,
|
4250
|
+
invalid = props.invalid,
|
4251
|
+
onKeyDown = props.onKeyDown,
|
4252
|
+
autoFocus = props.autoFocus,
|
4253
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
|
4254
|
+
|
4255
|
+
var inputRef = useProxiedRef(ref);
|
4256
|
+
var hasContainer = button || icon;
|
4257
|
+
var className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4218
4258
|
'pr-8': !!hasContainer
|
4219
4259
|
}, !hasContainer && otherProps.className);
|
4220
|
-
React.useEffect(()
|
4260
|
+
React.useEffect(function () {
|
4221
4261
|
if (autoFocus && inputRef.current) {
|
4222
4262
|
inputRef.current.focus();
|
4223
4263
|
}
|
@@ -4225,10 +4265,10 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4225
4265
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
4226
4266
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
4227
4267
|
|
4228
|
-
|
4268
|
+
var handleKeyDown = function handleKeyDown(event) {
|
4229
4269
|
if (event.key === 'Home' || event.key === 'End') {
|
4230
4270
|
event.preventDefault();
|
4231
|
-
|
4271
|
+
var position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
4232
4272
|
event.currentTarget.setSelectionRange(position, position);
|
4233
4273
|
}
|
4234
4274
|
|
@@ -4237,7 +4277,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4237
4277
|
}
|
4238
4278
|
};
|
4239
4279
|
|
4240
|
-
|
4280
|
+
var input = React.createElement("input", Object.assign({}, otherProps, {
|
4241
4281
|
className: className,
|
4242
4282
|
"data-taco": "input",
|
4243
4283
|
onKeyDown: handleKeyDown,
|
@@ -4245,21 +4285,19 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4245
4285
|
}));
|
4246
4286
|
|
4247
4287
|
if (hasContainer) {
|
4248
|
-
|
4288
|
+
var extra;
|
4249
4289
|
|
4250
4290
|
if (button) {
|
4251
|
-
var _button$props$disable;
|
4291
|
+
var _button$props$disable, _cn;
|
4252
4292
|
|
4253
|
-
|
4254
|
-
|
4255
|
-
[getButtonStateClasses(invalid)]: !props.disabled
|
4256
|
-
}, button.props.className);
|
4293
|
+
var disabled = (_button$props$disable = button.props.disabled) !== null && _button$props$disable !== void 0 ? _button$props$disable : otherProps.disabled;
|
4294
|
+
var buttonClassName = cn('items-center flex justify-center border absolute rounded-l-none rounded-r right-0 h-full focus:rounded focus:outline-none', (_cn = {}, _cn[getButtonStateClasses(invalid)] = !props.disabled, _cn), button.props.className);
|
4257
4295
|
extra = React.cloneElement(button, {
|
4258
4296
|
className: buttonClassName,
|
4259
|
-
disabled
|
4297
|
+
disabled: disabled
|
4260
4298
|
});
|
4261
4299
|
} else if (icon) {
|
4262
|
-
|
4300
|
+
var iconClassName = cn('items-center flex justify-center absolute pointer-events-none mr-1 p-px right-0 w-5 top-1/2 -translate-y-1/2', {
|
4263
4301
|
'text-grey-dark': props.disabled,
|
4264
4302
|
'text-grey-darkest': !props.disabled
|
4265
4303
|
});
|
@@ -4271,7 +4309,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4271
4309
|
});
|
4272
4310
|
}
|
4273
4311
|
|
4274
|
-
|
4312
|
+
var containerClassName = cn('bg-white inline-flex relative rounded w-full', otherProps.className);
|
4275
4313
|
return React.createElement("div", {
|
4276
4314
|
className: containerClassName,
|
4277
4315
|
"data-taco": "input-container"
|
@@ -5045,12 +5083,12 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
5045
5083
|
return dimensions;
|
5046
5084
|
};
|
5047
5085
|
|
5048
|
-
var _excluded$
|
5086
|
+
var _excluded$b = ["className", "dialog", "style"];
|
5049
5087
|
var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5050
5088
|
var externalClassName = props.className,
|
5051
5089
|
dialog = props.dialog,
|
5052
5090
|
style = props.style,
|
5053
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5091
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
5054
5092
|
|
5055
5093
|
var _useCombobox = useCombobox(otherProps, ref),
|
5056
5094
|
combobox = _useCombobox.combobox,
|
@@ -5342,18 +5380,19 @@ function mergeRefs(refs) {
|
|
5342
5380
|
};
|
5343
5381
|
}
|
5344
5382
|
|
5345
|
-
|
5383
|
+
var _excluded$c = ["children", "trigger"];
|
5384
|
+
var PopoverContext = /*#__PURE__*/React.createContext({
|
5346
5385
|
props: {},
|
5347
5386
|
ref: null
|
5348
5387
|
});
|
5349
|
-
|
5388
|
+
var Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, ref) {
|
5350
5389
|
var _props$children;
|
5351
5390
|
|
5352
|
-
|
5353
|
-
|
5391
|
+
var context = React.useContext(PopoverContext);
|
5392
|
+
var children = props.children;
|
5354
5393
|
|
5355
5394
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5356
|
-
console.warn(
|
5395
|
+
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");
|
5357
5396
|
children = React.createElement("span", null, props.children);
|
5358
5397
|
}
|
5359
5398
|
|
@@ -5363,22 +5402,22 @@ const Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, r
|
|
5363
5402
|
asChild: true
|
5364
5403
|
}));
|
5365
5404
|
});
|
5366
|
-
|
5367
|
-
children,
|
5368
|
-
|
5369
|
-
|
5370
|
-
|
5405
|
+
var RenderPropWrapper = /*#__PURE__*/React.forwardRef(function RenderPropWrapper(_ref, ref) {
|
5406
|
+
var children = _ref.children,
|
5407
|
+
onClick = _ref.onClick;
|
5408
|
+
|
5409
|
+
var close = function close() {
|
5371
5410
|
onClick(new CustomEvent('hide'));
|
5372
5411
|
};
|
5373
5412
|
|
5374
5413
|
return children({
|
5375
|
-
close,
|
5376
|
-
ref
|
5414
|
+
close: close,
|
5415
|
+
ref: ref
|
5377
5416
|
});
|
5378
5417
|
});
|
5379
|
-
|
5380
|
-
|
5381
|
-
|
5418
|
+
var Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, ref) {
|
5419
|
+
var className = cn('bg-white focus:border-blue-light', props.className);
|
5420
|
+
var output;
|
5382
5421
|
|
5383
5422
|
if (typeof props.children === 'function') {
|
5384
5423
|
output = React.createElement(PopoverPrimitive.Close, {
|
@@ -5396,20 +5435,23 @@ const Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, r
|
|
5396
5435
|
className: "text-white"
|
5397
5436
|
}));
|
5398
5437
|
});
|
5399
|
-
|
5400
|
-
|
5401
|
-
|
5402
|
-
|
5403
|
-
|
5404
|
-
|
5405
|
-
|
5406
|
-
|
5407
|
-
|
5408
|
-
|
5409
|
-
|
5410
|
-
|
5411
|
-
|
5412
|
-
|
5438
|
+
var Close$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
5439
|
+
return React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
|
5440
|
+
ref: ref,
|
5441
|
+
asChild: true
|
5442
|
+
}));
|
5443
|
+
});
|
5444
|
+
var Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
5445
|
+
var children = props.children,
|
5446
|
+
trigger = props.trigger,
|
5447
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$c);
|
5448
|
+
|
5449
|
+
var context = React.useMemo(function () {
|
5450
|
+
return {
|
5451
|
+
props: otherProps,
|
5452
|
+
ref: ref
|
5453
|
+
};
|
5454
|
+
}, [otherProps]);
|
5413
5455
|
return React.createElement(PopoverContext.Provider, {
|
5414
5456
|
value: context
|
5415
5457
|
}, React.createElement(PopoverPrimitive.Root, null, trigger && React.createElement(Trigger$1, null, trigger), children));
|
@@ -5418,25 +5460,25 @@ Popover.Trigger = Trigger$1;
|
|
5418
5460
|
Popover.Content = Content$1;
|
5419
5461
|
Popover.Close = Close$1;
|
5420
5462
|
|
5421
|
-
|
5463
|
+
var _excluded$d = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
5464
|
+
var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5422
5465
|
var _input$disabled;
|
5423
5466
|
|
5424
|
-
|
5425
|
-
|
5426
|
-
|
5427
|
-
|
5428
|
-
|
5429
|
-
|
5430
|
-
|
5431
|
-
|
5432
|
-
|
5433
|
-
|
5434
|
-
|
5435
|
-
|
5436
|
-
|
5437
|
-
|
5438
|
-
|
5439
|
-
const className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5467
|
+
var externalClassName = props.className,
|
5468
|
+
handleReset = props.onReset,
|
5469
|
+
style = props.style,
|
5470
|
+
shortcuts = props.shortcuts,
|
5471
|
+
shortcutsText = props.shortcutsText,
|
5472
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
5473
|
+
|
5474
|
+
var _useDatepicker = useDatepicker(otherProps, ref),
|
5475
|
+
calendar = _useDatepicker.calendar,
|
5476
|
+
input = _useDatepicker.input;
|
5477
|
+
|
5478
|
+
var _useLocalization = useLocalization(),
|
5479
|
+
texts = _useLocalization.texts;
|
5480
|
+
|
5481
|
+
var className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5440
5482
|
return React.createElement("span", {
|
5441
5483
|
className: className,
|
5442
5484
|
"data-taco": "datepicker",
|
@@ -5446,37 +5488,40 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
5446
5488
|
"aria-label": texts.datepicker.expand,
|
5447
5489
|
disabled: (_input$disabled = input.disabled) !== null && _input$disabled !== void 0 ? _input$disabled : input.readOnly,
|
5448
5490
|
icon: "calendar"
|
5449
|
-
})), React.createElement(Popover.Content, null, ({
|
5450
|
-
close
|
5451
|
-
|
5452
|
-
|
5453
|
-
|
5454
|
-
|
5455
|
-
|
5456
|
-
|
5457
|
-
|
5458
|
-
|
5459
|
-
|
5460
|
-
|
5461
|
-
|
5462
|
-
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5470
|
-
|
5471
|
-
|
5472
|
-
|
5473
|
-
|
5474
|
-
|
5475
|
-
|
5476
|
-
|
5477
|
-
|
5478
|
-
|
5479
|
-
|
5491
|
+
})), React.createElement(Popover.Content, null, function (_ref) {
|
5492
|
+
var close = _ref.close;
|
5493
|
+
return React.createElement("div", {
|
5494
|
+
className: "flex -m-3"
|
5495
|
+
}, React.createElement(Calendar$1, Object.assign({}, calendar, {
|
5496
|
+
onChange: function onChange(date, event) {
|
5497
|
+
calendar.onChange(date, event);
|
5498
|
+
close();
|
5499
|
+
},
|
5500
|
+
tabIndex: -1
|
5501
|
+
})), shortcuts && React.createElement("div", {
|
5502
|
+
className: "border-l border-grey-dark flex flex-col"
|
5503
|
+
}, React.createElement("span", {
|
5504
|
+
className: "font-semibold text-xs m-4 flex items-center h-8 w-32 mb-3"
|
5505
|
+
}, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map(function (shortcut, i) {
|
5506
|
+
return React.createElement("li", {
|
5507
|
+
key: i
|
5508
|
+
}, React.createElement("button", {
|
5509
|
+
className: "w-full px-4 py-1 flex items-start hover:bg-grey-light text-xs",
|
5510
|
+
onClick: function onClick(event) {
|
5511
|
+
event.persist();
|
5512
|
+
shortcut.onClick(event);
|
5513
|
+
close();
|
5514
|
+
}
|
5515
|
+
}, shortcut.text));
|
5516
|
+
})), handleReset && React.createElement("button", {
|
5517
|
+
className: "text-blue hover:text-blue-light inline-flex border-none bg-transparent text-xs cursor-pointer mt-auto my-4 mx-auto",
|
5518
|
+
onClick: function onClick(event) {
|
5519
|
+
event.persist();
|
5520
|
+
handleReset(event);
|
5521
|
+
close();
|
5522
|
+
}
|
5523
|
+
}, texts.datepicker.clear)));
|
5524
|
+
}))
|
5480
5525
|
})));
|
5481
5526
|
});
|
5482
5527
|
|
@@ -5719,7 +5764,7 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5719
5764
|
});
|
5720
5765
|
Extra.displayName = 'DialogExtra';
|
5721
5766
|
|
5722
|
-
var _excluded$
|
5767
|
+
var _excluded$e = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
|
5723
5768
|
|
5724
5769
|
var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
5725
5770
|
return React.useMemo(function () {
|
@@ -5756,7 +5801,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
|
5756
5801
|
_props$size = props.size,
|
5757
5802
|
size = _props$size === void 0 ? 'sm' : _props$size,
|
5758
5803
|
trigger = props.trigger,
|
5759
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5804
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$e);
|
5760
5805
|
|
5761
5806
|
var _useSeparatedChildren = useSeparatedChildren(initialChildren),
|
5762
5807
|
children = _useSeparatedChildren[0],
|
@@ -5806,14 +5851,14 @@ Dialog.Extra = Extra;
|
|
5806
5851
|
Dialog.Drawer = Drawer;
|
5807
5852
|
Dialog.Close = Close$2;
|
5808
5853
|
|
5809
|
-
var _excluded$
|
5854
|
+
var _excluded$f = ["disabled", "children", "invalid", "message"];
|
5810
5855
|
var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5811
5856
|
var disabled = props.disabled,
|
5812
5857
|
children = props.children,
|
5813
5858
|
_props$invalid = props.invalid,
|
5814
5859
|
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
5815
5860
|
message = props.message,
|
5816
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
5861
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$f);
|
5817
5862
|
|
5818
5863
|
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5819
5864
|
'text-grey-dark': disabled
|
@@ -5833,12 +5878,13 @@ var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5833
5878
|
}, message));
|
5834
5879
|
});
|
5835
5880
|
|
5836
|
-
|
5837
|
-
|
5838
|
-
|
5839
|
-
|
5840
|
-
|
5841
|
-
|
5881
|
+
var _excluded$g = ["horizontal"];
|
5882
|
+
var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
5883
|
+
var _props$horizontal = props.horizontal,
|
5884
|
+
horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
|
5885
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$g);
|
5886
|
+
|
5887
|
+
var className = cn('yt-form', {
|
5842
5888
|
'yt-form--horizontal flex flex-wrap': horizontal
|
5843
5889
|
}, props.className);
|
5844
5890
|
return React.createElement("form", Object.assign({}, otherProps, {
|
@@ -5848,12 +5894,13 @@ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5848
5894
|
}));
|
5849
5895
|
});
|
5850
5896
|
|
5851
|
-
|
5852
|
-
|
5853
|
-
|
5854
|
-
|
5855
|
-
|
5856
|
-
|
5897
|
+
var _excluded$h = ["as"];
|
5898
|
+
var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5899
|
+
var _props$as = props.as,
|
5900
|
+
Tag = _props$as === void 0 ? 'span' : _props$as,
|
5901
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$h);
|
5902
|
+
|
5903
|
+
var className = cn('flex ', props.className);
|
5857
5904
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
5858
5905
|
className: className,
|
5859
5906
|
"data-taco": "group",
|
@@ -5861,18 +5908,19 @@ const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5861
5908
|
}));
|
5862
5909
|
});
|
5863
5910
|
|
5864
|
-
|
5911
|
+
var _excluded$i = ["anchor", "children", "defaultOpen"];
|
5912
|
+
var HangerContext = /*#__PURE__*/React.createContext({
|
5865
5913
|
props: {},
|
5866
5914
|
ref: null
|
5867
5915
|
});
|
5868
|
-
|
5916
|
+
var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
5869
5917
|
var _props$children;
|
5870
5918
|
|
5871
|
-
|
5872
|
-
|
5919
|
+
var context = React.useContext(HangerContext);
|
5920
|
+
var children = props.children;
|
5873
5921
|
|
5874
5922
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5875
|
-
console.warn(
|
5923
|
+
console.warn("Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '" + props.children.type.name + "' in React.forwardRef()? Taco has wrapped '" + props.children.type.name + "' in a 'span' to maintain functionality, but this may cause unintended behaviour");
|
5876
5924
|
children = React.createElement("span", null, props.children);
|
5877
5925
|
}
|
5878
5926
|
|
@@ -5882,14 +5930,15 @@ const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
|
5882
5930
|
asChild: true
|
5883
5931
|
}));
|
5884
5932
|
});
|
5885
|
-
|
5886
|
-
|
5887
|
-
|
5888
|
-
|
5889
|
-
|
5890
|
-
|
5933
|
+
var Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
|
5934
|
+
var context = React.useContext(HangerContext);
|
5935
|
+
|
5936
|
+
var _useLocalization = useLocalization(),
|
5937
|
+
texts = _useLocalization.texts;
|
5938
|
+
|
5939
|
+
var className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent', props.className);
|
5891
5940
|
|
5892
|
-
|
5941
|
+
var handleInteractOutside = function handleInteractOutside(event) {
|
5893
5942
|
event.preventDefault();
|
5894
5943
|
};
|
5895
5944
|
|
@@ -5911,20 +5960,25 @@ const Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, re
|
|
5911
5960
|
onClick: context.props.onClose
|
5912
5961
|
})));
|
5913
5962
|
});
|
5914
|
-
|
5915
|
-
|
5916
|
-
|
5917
|
-
|
5918
|
-
|
5919
|
-
|
5920
|
-
} = props;
|
5921
|
-
const context = React.useMemo(() => ({
|
5922
|
-
props: otherProps,
|
5923
|
-
ref
|
5924
|
-
}), [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
5963
|
+
var Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
5964
|
+
var anchor = props.anchor,
|
5965
|
+
children = props.children,
|
5966
|
+
_props$defaultOpen = props.defaultOpen,
|
5967
|
+
defaultOpen = _props$defaultOpen === void 0 ? true : _props$defaultOpen,
|
5968
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$i);
|
5925
5969
|
|
5926
|
-
|
5927
|
-
|
5970
|
+
var context = React.useMemo(function () {
|
5971
|
+
return {
|
5972
|
+
props: otherProps,
|
5973
|
+
ref: ref
|
5974
|
+
};
|
5975
|
+
}, [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
5976
|
+
|
5977
|
+
var _React$useState = React.useState(false),
|
5978
|
+
open = _React$useState[0],
|
5979
|
+
setOpen = _React$useState[1];
|
5980
|
+
|
5981
|
+
React.useEffect(function () {
|
5928
5982
|
if (defaultOpen) {
|
5929
5983
|
setOpen(defaultOpen);
|
5930
5984
|
}
|
@@ -6283,49 +6337,49 @@ const useMultiListbox = ({
|
|
6283
6337
|
};
|
6284
6338
|
};
|
6285
6339
|
|
6286
|
-
|
6287
|
-
|
6288
|
-
|
6289
|
-
|
6290
|
-
|
6291
|
-
|
6292
|
-
|
6293
|
-
|
6294
|
-
|
6295
|
-
|
6340
|
+
var _excluded$j = ["className"],
|
6341
|
+
_excluded2$1 = ["className"];
|
6342
|
+
var Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6343
|
+
var externalClassName = props.className,
|
6344
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$j);
|
6345
|
+
|
6346
|
+
var _useListbox = useListbox(otherProps, ref),
|
6347
|
+
list = _useListbox.list,
|
6348
|
+
input = _useListbox.input;
|
6349
|
+
|
6350
|
+
var className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6296
6351
|
return React.createElement("span", {
|
6297
6352
|
"data-taco": "listbox",
|
6298
6353
|
className: className
|
6299
6354
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6300
|
-
style: {
|
6355
|
+
style: _extends({}, list.style, {
|
6301
6356
|
maxHeight: 'calc(12rem + 2px)'
|
6302
6357
|
/* (6 * option height) + listbox border */
|
6303
6358
|
|
6304
|
-
}
|
6359
|
+
})
|
6305
6360
|
})), React.createElement("input", Object.assign({}, input, {
|
6306
6361
|
className: "hidden",
|
6307
6362
|
type: "text"
|
6308
6363
|
})));
|
6309
6364
|
});
|
6310
|
-
|
6311
|
-
|
6312
|
-
|
6313
|
-
|
6314
|
-
|
6315
|
-
|
6316
|
-
|
6317
|
-
|
6318
|
-
|
6319
|
-
const className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6365
|
+
var MultiListbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6366
|
+
var externalClassName = props.className,
|
6367
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$1);
|
6368
|
+
|
6369
|
+
var _useMultiListbox = useMultiListbox(otherProps, ref),
|
6370
|
+
list = _useMultiListbox.list,
|
6371
|
+
input = _useMultiListbox.input;
|
6372
|
+
|
6373
|
+
var className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6320
6374
|
return React.createElement("span", {
|
6321
6375
|
"data-taco": "listbox",
|
6322
6376
|
className: className
|
6323
6377
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6324
|
-
style: {
|
6378
|
+
style: _extends({}, list.style, {
|
6325
6379
|
maxHeight: 'calc(12rem + 2px + 2px)'
|
6326
6380
|
/* (6 * option height) + listbox border + ALL_OPTIONS bottom border */
|
6327
6381
|
|
6328
|
-
}
|
6382
|
+
})
|
6329
6383
|
})), React.createElement("input", Object.assign({}, input, {
|
6330
6384
|
className: "hidden",
|
6331
6385
|
type: "text"
|
@@ -6386,20 +6440,20 @@ const Icon$1 = ({
|
|
6386
6440
|
const getAppearanceClasses$2 = appearance => {
|
6387
6441
|
switch (appearance) {
|
6388
6442
|
case 'primary':
|
6389
|
-
return 'wcag-blue aria-disabled:text-blue-dark focus:wcag-blue-light';
|
6443
|
+
return 'wcag-blue aria-disabled:text-blue-dark hover:wcag-blue-light focus:wcag-blue-light';
|
6390
6444
|
|
6391
6445
|
case 'danger':
|
6392
|
-
return 'wcag-red aria-disabled:text-red-dark focus:wcag-red-light';
|
6446
|
+
return 'wcag-red aria-disabled:text-red-dark hover:wcag-red-light focus:wcag-red-light';
|
6393
6447
|
|
6394
6448
|
case 'ghost':
|
6395
|
-
return 'text-blue aria-disabled:text-grey focus:wcag-blue';
|
6449
|
+
return 'text-blue aria-disabled:text-grey hover:wcag-blue focus:wcag-blue';
|
6396
6450
|
|
6397
6451
|
case 'discrete':
|
6398
|
-
return 'text-black aria-disabled:text-grey focus:wcag-blue-lightest';
|
6452
|
+
return 'text-black aria-disabled:text-grey hover:wcag-blue-lightest focus:wcag-blue-lightest';
|
6399
6453
|
|
6400
6454
|
case 'default':
|
6401
6455
|
default:
|
6402
|
-
return 'wcag-grey-light aria-disabled:text-grey-darker focus:wcag-grey-dark';
|
6456
|
+
return 'wcag-grey-light aria-disabled:text-grey-darker hover:wcag-grey-dark focus:wcag-grey-dark';
|
6403
6457
|
}
|
6404
6458
|
};
|
6405
6459
|
|
@@ -6588,26 +6642,34 @@ const Checkbox$1 = props => {
|
|
6588
6642
|
})), children);
|
6589
6643
|
};
|
6590
6644
|
|
6591
|
-
|
6592
|
-
|
6593
|
-
|
6645
|
+
var _excluded$k = ["children", "value"],
|
6646
|
+
_excluded2$2 = ["children", "defaultValue", "disabled", "invalid", "onChange", "orientation", "value"];
|
6647
|
+
var getRadioGroupItemValueAsString = function getRadioGroupItemValueAsString(value) {
|
6648
|
+
return value === null ? '' : String(value);
|
6649
|
+
};
|
6650
|
+
var findByValue$1 = function findByValue(values, valueAsString) {
|
6651
|
+
return values.find(function (value) {
|
6652
|
+
return getRadioGroupItemValueAsString(value) === valueAsString;
|
6653
|
+
});
|
6654
|
+
};
|
6655
|
+
var RadioGroupContext = /*#__PURE__*/React.createContext({
|
6594
6656
|
disabled: false,
|
6595
6657
|
invalid: false
|
6596
6658
|
});
|
6597
|
-
|
6598
|
-
|
6599
|
-
|
6600
|
-
|
6601
|
-
|
6602
|
-
|
6603
|
-
|
6604
|
-
|
6605
|
-
|
6659
|
+
var RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(props, ref) {
|
6660
|
+
var context = React.useContext(RadioGroupContext);
|
6661
|
+
|
6662
|
+
var children = props.children,
|
6663
|
+
value = props.value,
|
6664
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$k);
|
6665
|
+
|
6666
|
+
var disabled = context.disabled || props.disabled;
|
6667
|
+
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 ', {
|
6606
6668
|
'border-grey-dark focus:border-blue focus:yt-focus aria-checked:bg-blue aria-checked:border-blue': !disabled && !context.invalid,
|
6607
6669
|
'border-grey cursor-not-allowed aria-checked:bg-grey-dark aria-checked:border-grey-dark': disabled,
|
6608
6670
|
'border-red text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red': context.invalid && !disabled
|
6609
6671
|
});
|
6610
|
-
|
6672
|
+
var labelClassName = cn('flex items-center cursor-pointer', {
|
6611
6673
|
'cursor-not-allowed text-grey-dark': disabled
|
6612
6674
|
}, props.className);
|
6613
6675
|
return React.createElement("label", {
|
@@ -6621,34 +6683,38 @@ const RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(pro
|
|
6621
6683
|
className: "h-2 w-2 rounded-full bg-white"
|
6622
6684
|
})), children);
|
6623
6685
|
});
|
6624
|
-
|
6625
|
-
|
6626
|
-
|
6627
|
-
|
6628
|
-
|
6629
|
-
|
6630
|
-
|
6631
|
-
|
6632
|
-
|
6633
|
-
|
6634
|
-
|
6635
|
-
|
6636
|
-
|
6637
|
-
React.Children.forEach(children, child
|
6686
|
+
var useRadioGroup = function useRadioGroup(props) {
|
6687
|
+
var children = props.children,
|
6688
|
+
defaultValue = props.defaultValue,
|
6689
|
+
disabled = props.disabled,
|
6690
|
+
invalid = props.invalid,
|
6691
|
+
onChange = props.onChange,
|
6692
|
+
_props$orientation = props.orientation,
|
6693
|
+
orientation = _props$orientation === void 0 ? 'vertical' : _props$orientation,
|
6694
|
+
value = props.value,
|
6695
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$2);
|
6696
|
+
|
6697
|
+
var values = React.useMemo(function () {
|
6698
|
+
var radioGroupItemValues = [];
|
6699
|
+
React.Children.forEach(children, function (child) {
|
6638
6700
|
if (React.isValidElement(child)) {
|
6639
6701
|
radioGroupItemValues.push(child.props.value);
|
6640
6702
|
}
|
6641
6703
|
});
|
6642
6704
|
return radioGroupItemValues;
|
6643
6705
|
}, [children]);
|
6644
|
-
|
6645
|
-
|
6646
|
-
|
6647
|
-
|
6648
|
-
|
6706
|
+
var context = React.useMemo(function () {
|
6707
|
+
return {
|
6708
|
+
disabled: disabled !== null && disabled !== void 0 ? disabled : false,
|
6709
|
+
invalid: invalid !== null && invalid !== void 0 ? invalid : false
|
6710
|
+
};
|
6711
|
+
}, [disabled, invalid]);
|
6712
|
+
var valueProps;
|
6649
6713
|
|
6650
6714
|
if (onChange !== undefined) {
|
6651
|
-
|
6715
|
+
var handleChange = function handleChange(value) {
|
6716
|
+
return onChange(findByValue$1(values, value));
|
6717
|
+
};
|
6652
6718
|
|
6653
6719
|
valueProps = {
|
6654
6720
|
onValueChange: handleChange,
|
@@ -6661,20 +6727,19 @@ const useRadioGroup = props => {
|
|
6661
6727
|
}
|
6662
6728
|
|
6663
6729
|
return {
|
6664
|
-
context,
|
6665
|
-
props: {
|
6666
|
-
|
6667
|
-
|
6668
|
-
|
6669
|
-
}
|
6730
|
+
context: context,
|
6731
|
+
props: _extends({}, otherProps, valueProps, {
|
6732
|
+
children: children,
|
6733
|
+
orientation: orientation
|
6734
|
+
})
|
6670
6735
|
};
|
6671
6736
|
};
|
6672
|
-
|
6673
|
-
|
6674
|
-
|
6675
|
-
|
6676
|
-
|
6677
|
-
|
6737
|
+
var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
6738
|
+
var _useRadioGroup = useRadioGroup(props),
|
6739
|
+
context = _useRadioGroup.context,
|
6740
|
+
otherProps = _useRadioGroup.props;
|
6741
|
+
|
6742
|
+
var className = cn('flex items-start', {
|
6678
6743
|
'flex-wrap space-x-4': otherProps.orientation === 'horizontal',
|
6679
6744
|
'flex-col space-y-2': otherProps.orientation === 'vertical'
|
6680
6745
|
}, otherProps.className);
|
@@ -6787,26 +6852,48 @@ const Header = props => {
|
|
6787
6852
|
}));
|
6788
6853
|
};
|
6789
6854
|
|
6790
|
-
|
6791
|
-
|
6792
|
-
|
6793
|
-
|
6794
|
-
|
6795
|
-
|
6796
|
-
|
6797
|
-
|
6798
|
-
|
6799
|
-
|
6800
|
-
|
6801
|
-
|
6802
|
-
|
6803
|
-
|
6804
|
-
|
6805
|
-
|
6806
|
-
|
6807
|
-
|
6808
|
-
|
6809
|
-
|
6855
|
+
var _excluded$l = ["appearance", "children", "trigger"];
|
6856
|
+
var Menu = function Menu(externalProps) {
|
6857
|
+
var externalAppearance = externalProps.appearance,
|
6858
|
+
children = externalProps.children,
|
6859
|
+
trigger = externalProps.trigger,
|
6860
|
+
props = _objectWithoutPropertiesLoose(externalProps, _excluded$l);
|
6861
|
+
|
6862
|
+
var _React$useState = React.useState(false),
|
6863
|
+
open = _React$useState[0],
|
6864
|
+
setOpen = _React$useState[1];
|
6865
|
+
|
6866
|
+
var _React$useState2 = React.useState(externalAppearance !== null && externalAppearance !== void 0 ? externalAppearance : 'default'),
|
6867
|
+
appearance = _React$useState2[0],
|
6868
|
+
_setAppearance = _React$useState2[1];
|
6869
|
+
|
6870
|
+
var _React$useState3 = React.useState(false),
|
6871
|
+
indented = _React$useState3[0],
|
6872
|
+
setIndented = _React$useState3[1];
|
6873
|
+
|
6874
|
+
var _React$useState4 = React.useState(undefined),
|
6875
|
+
minWidth = _React$useState4[0],
|
6876
|
+
_setMinWidth = _React$useState4[1];
|
6877
|
+
|
6878
|
+
var context = React.useMemo(function () {
|
6879
|
+
return {
|
6880
|
+
appearance: appearance,
|
6881
|
+
setAppearance: function setAppearance(appearance) {
|
6882
|
+
return _setAppearance(appearance);
|
6883
|
+
},
|
6884
|
+
indented: indented,
|
6885
|
+
registerIndentation: function registerIndentation() {
|
6886
|
+
return setIndented(true);
|
6887
|
+
},
|
6888
|
+
minWidth: minWidth,
|
6889
|
+
setMinWidth: function setMinWidth(width) {
|
6890
|
+
return _setMinWidth(width);
|
6891
|
+
},
|
6892
|
+
close: function close() {
|
6893
|
+
return setOpen(false);
|
6894
|
+
}
|
6895
|
+
};
|
6896
|
+
}, [indented, minWidth, appearance]);
|
6810
6897
|
return React.createElement(MenuContext.Provider, {
|
6811
6898
|
value: context
|
6812
6899
|
}, React.createElement(DropdownMenuPrimitive.Root, Object.assign({}, props, {
|
@@ -6824,39 +6911,44 @@ Menu.Separator = Separator;
|
|
6824
6911
|
Menu.Header = Header;
|
6825
6912
|
Menu.RadioGroup = RadioGroup$1;
|
6826
6913
|
|
6827
|
-
|
6914
|
+
var _excluded$m = ["children", "className", "expanded", "title", "fixed", "onClick"];
|
6915
|
+
var TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
6828
6916
|
return React__default.createElement("a", Object.assign({}, props, {
|
6829
6917
|
ref: ref
|
6830
6918
|
}));
|
6831
6919
|
});
|
6832
|
-
|
6833
|
-
|
6834
|
-
|
6835
|
-
|
6836
|
-
|
6837
|
-
|
6838
|
-
|
6839
|
-
|
6840
|
-
|
6841
|
-
|
6842
|
-
|
6843
|
-
|
6920
|
+
var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGroup(props, ref) {
|
6921
|
+
var children = props.children,
|
6922
|
+
externalClassName = props.className,
|
6923
|
+
_props$expanded = props.expanded,
|
6924
|
+
initialExpanded = _props$expanded === void 0 ? false : _props$expanded,
|
6925
|
+
title = props.title,
|
6926
|
+
fixed = props.fixed,
|
6927
|
+
onClick = props.onClick,
|
6928
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$m);
|
6929
|
+
|
6930
|
+
var _React$useState = React__default.useState(fixed || initialExpanded),
|
6931
|
+
expanded = _React$useState[0],
|
6932
|
+
setExpanded = _React$useState[1];
|
6933
|
+
|
6934
|
+
React__default.useEffect(function () {
|
6844
6935
|
if (!fixed) {
|
6845
6936
|
setExpanded(fixed || initialExpanded);
|
6846
6937
|
}
|
6847
6938
|
}, [fixed, initialExpanded]);
|
6848
|
-
|
6939
|
+
var listClassName = cn('flex-col mb-0', {
|
6849
6940
|
flex: expanded,
|
6850
6941
|
hidden: !expanded
|
6851
6942
|
});
|
6852
|
-
|
6943
|
+
|
6944
|
+
var itemProps = _extends({}, otherProps, {
|
6853
6945
|
'aria-expanded': expanded,
|
6854
6946
|
role: 'treeitem',
|
6855
6947
|
tabIndex: -1
|
6856
|
-
};
|
6948
|
+
});
|
6857
6949
|
|
6858
|
-
|
6859
|
-
|
6950
|
+
var handleClick = function handleClick(event) {
|
6951
|
+
var nextState = !expanded;
|
6860
6952
|
|
6861
6953
|
if (!fixed) {
|
6862
6954
|
setExpanded(nextState);
|
@@ -6867,7 +6959,7 @@ const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGr
|
|
6867
6959
|
}
|
6868
6960
|
};
|
6869
6961
|
|
6870
|
-
|
6962
|
+
var className = typeof externalClassName === 'function' ? externalClassName(expanded) : externalClassName;
|
6871
6963
|
return React__default.createElement("div", Object.assign({}, itemProps, {
|
6872
6964
|
className: className,
|
6873
6965
|
ref: ref
|
@@ -6876,14 +6968,18 @@ const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGr
|
|
6876
6968
|
}, typeof title === 'function' ? title(expanded) : title), React__default.createElement("ul", {
|
6877
6969
|
role: "group",
|
6878
6970
|
className: listClassName
|
6879
|
-
}, React__default.Children.toArray(children).filter(
|
6880
|
-
|
6881
|
-
|
6882
|
-
|
6883
|
-
|
6884
|
-
|
6971
|
+
}, React__default.Children.toArray(children).filter(function (item) {
|
6972
|
+
return !!item;
|
6973
|
+
}).map(function (item, i) {
|
6974
|
+
return React__default.createElement("li", {
|
6975
|
+
key: i,
|
6976
|
+
role: "none"
|
6977
|
+
}, React__default.cloneElement(item, {
|
6978
|
+
role: 'treeitem'
|
6979
|
+
}));
|
6980
|
+
})));
|
6885
6981
|
});
|
6886
|
-
|
6982
|
+
var Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props, ref) {
|
6887
6983
|
return React__default.createElement("div", Object.assign({}, props, {
|
6888
6984
|
ref: ref,
|
6889
6985
|
role: "tree"
|
@@ -6926,20 +7022,25 @@ const useDropTarget = onDrop => {
|
|
6926
7022
|
return [isDraggedOver, props];
|
6927
7023
|
};
|
6928
7024
|
|
6929
|
-
|
6930
|
-
|
6931
|
-
|
6932
|
-
|
6933
|
-
|
6934
|
-
|
6935
|
-
|
6936
|
-
|
6937
|
-
|
6938
|
-
|
6939
|
-
|
6940
|
-
|
6941
|
-
|
6942
|
-
|
7025
|
+
var _excluded$n = ["active", "children", "onDrop", "postfix", "prefix", "role"],
|
7026
|
+
_excluded2$3 = ["children"];
|
7027
|
+
var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
7028
|
+
var active = props.active,
|
7029
|
+
children = props.children,
|
7030
|
+
onDrop = props.onDrop,
|
7031
|
+
postfix = props.postfix,
|
7032
|
+
prefix = props.prefix,
|
7033
|
+
role = props.role,
|
7034
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$n);
|
7035
|
+
|
7036
|
+
var proxyRef = useProxiedRef(ref);
|
7037
|
+
|
7038
|
+
var _useDropTarget = useDropTarget(onDrop),
|
7039
|
+
isDraggedOver = _useDropTarget[0],
|
7040
|
+
dropTargetProps = _useDropTarget[1];
|
7041
|
+
|
7042
|
+
var isTreeitem = role === 'treeitem';
|
7043
|
+
var className = cn('yt-navigation__item cursor-pointer', {
|
6943
7044
|
'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,
|
6944
7045
|
'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,
|
6945
7046
|
'yt-navigation__item--active': active && !isDraggedOver,
|
@@ -6947,7 +7048,7 @@ const Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref)
|
|
6947
7048
|
'yt-navigation__item--dropping bg-blue': isDraggedOver
|
6948
7049
|
}, props.className);
|
6949
7050
|
|
6950
|
-
|
7051
|
+
var handleClick = function handleClick(event) {
|
6951
7052
|
if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {
|
6952
7053
|
return;
|
6953
7054
|
}
|
@@ -6970,19 +7071,19 @@ const Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref)
|
|
6970
7071
|
className: "yt-navigation__item__postfix ml-1"
|
6971
7072
|
}, postfix));
|
6972
7073
|
});
|
6973
|
-
|
7074
|
+
var Panel = /*#__PURE__*/React__default.forwardRef(function Panel(props, ref) {
|
6974
7075
|
return React__default.createElement("div", Object.assign({}, props, {
|
6975
7076
|
className: cn('w-full bg-white p-3', props.className),
|
6976
7077
|
ref: ref
|
6977
7078
|
}));
|
6978
7079
|
});
|
6979
|
-
|
6980
|
-
|
7080
|
+
var MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(props, ref) {
|
7081
|
+
var className = cn('flex-shrink-0 space-y-1 outline-none', {
|
6981
7082
|
'bg-white pb-2': props.fixed
|
6982
7083
|
}, props.className);
|
6983
7084
|
|
6984
|
-
|
6985
|
-
|
7085
|
+
var title = function title(expanded) {
|
7086
|
+
var className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {
|
6986
7087
|
'mb-1': expanded,
|
6987
7088
|
'cursor-pointer hover:text-blue': !props.fixed
|
6988
7089
|
});
|
@@ -6999,14 +7100,16 @@ const MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(prop
|
|
6999
7100
|
ref: ref
|
7000
7101
|
}));
|
7001
7102
|
});
|
7002
|
-
|
7003
|
-
|
7004
|
-
|
7005
|
-
React__default.Children.toArray(props.children).filter(
|
7103
|
+
var Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
|
7104
|
+
var scrollableAreas = React__default.useMemo(function () {
|
7105
|
+
var scrollableAreas = [];
|
7106
|
+
React__default.Children.toArray(props.children).filter(function (child) {
|
7107
|
+
return !!child;
|
7108
|
+
}).map(function (child) {
|
7006
7109
|
if (child.props.fixed) {
|
7007
7110
|
scrollableAreas.push(child);
|
7008
7111
|
} else {
|
7009
|
-
|
7112
|
+
var x = scrollableAreas[scrollableAreas.length - 1];
|
7010
7113
|
|
7011
7114
|
if (Array.isArray(x)) {
|
7012
7115
|
x.push(child);
|
@@ -7020,18 +7123,19 @@ const Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref)
|
|
7020
7123
|
return React__default.createElement(Treeview, Object.assign({}, props, {
|
7021
7124
|
className: cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className),
|
7022
7125
|
ref: ref
|
7023
|
-
}), scrollableAreas.map((area, i)
|
7024
|
-
|
7025
|
-
|
7026
|
-
|
7126
|
+
}), scrollableAreas.map(function (area, i) {
|
7127
|
+
return Array.isArray(area) ? React__default.createElement("div", {
|
7128
|
+
className: "divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
|
7129
|
+
key: i
|
7130
|
+
}, area) : area;
|
7131
|
+
}));
|
7027
7132
|
});
|
7028
7133
|
Menu$1.Group = MenuGroup;
|
7029
|
-
|
7030
|
-
|
7031
|
-
|
7032
|
-
|
7033
|
-
|
7034
|
-
const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
|
7134
|
+
var Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
|
7135
|
+
var children = props.children,
|
7136
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$3);
|
7137
|
+
|
7138
|
+
var className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
|
7035
7139
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
7036
7140
|
className: className,
|
7037
7141
|
"data-taco": "navigation",
|
@@ -7272,52 +7376,54 @@ const useSelect = ({
|
|
7272
7376
|
};
|
7273
7377
|
};
|
7274
7378
|
|
7275
|
-
|
7276
|
-
|
7277
|
-
|
7278
|
-
|
7279
|
-
|
7280
|
-
|
7281
|
-
|
7282
|
-
|
7283
|
-
|
7284
|
-
|
7285
|
-
|
7286
|
-
|
7287
|
-
|
7288
|
-
|
7289
|
-
|
7290
|
-
|
7291
|
-
|
7292
|
-
|
7293
|
-
|
7379
|
+
var _excluded$o = ["autoFocus", "className", "highlighted", "style"],
|
7380
|
+
_excluded2$4 = ["editable"];
|
7381
|
+
var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
|
7382
|
+
var autoFocus = props.autoFocus,
|
7383
|
+
externalClassName = props.className,
|
7384
|
+
style = props.style,
|
7385
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$o);
|
7386
|
+
|
7387
|
+
var _useSelect = useSelect(otherProps, ref),
|
7388
|
+
button = _useSelect.button,
|
7389
|
+
listbox = _useSelect.listbox,
|
7390
|
+
popover = _useSelect.popover,
|
7391
|
+
input = _useSelect.input,
|
7392
|
+
text = _useSelect.text,
|
7393
|
+
_useSelect$more = _useSelect.more,
|
7394
|
+
more = _useSelect$more === void 0 ? 0 : _useSelect$more;
|
7395
|
+
|
7396
|
+
var internalRef = React.useRef(null);
|
7397
|
+
var selectDimensions = useBoundingClientRectListener(internalRef);
|
7398
|
+
var className = cn('inline-flex relative w-full', {
|
7294
7399
|
'yt-select--readonly': props.readOnly
|
7295
7400
|
}, externalClassName);
|
7296
|
-
|
7401
|
+
var inputClassname = cn(getInputClasses(props), 'h-8 text-left pr-0', {
|
7297
7402
|
'border-blue': popover.open
|
7298
7403
|
});
|
7299
|
-
React.useEffect(()
|
7404
|
+
React.useEffect(function () {
|
7300
7405
|
if (autoFocus && internalRef.current) {
|
7301
7406
|
internalRef.current.focus();
|
7302
7407
|
}
|
7303
7408
|
}, []);
|
7304
7409
|
|
7305
|
-
|
7410
|
+
var renderMultiSelection = function renderMultiSelection() {
|
7306
7411
|
return React.createElement(React.Fragment, null, React.createElement("span", {
|
7307
7412
|
className: "flex-grow truncate text-left"
|
7308
7413
|
}, text), more > 0 && React.createElement(Badge, {
|
7309
7414
|
className: "ml-2"
|
7310
|
-
},
|
7415
|
+
}, "+" + more));
|
7311
7416
|
};
|
7312
7417
|
|
7313
|
-
|
7418
|
+
var commonListboxProps = _extends({}, listbox, {
|
7314
7419
|
className: 'w-auto',
|
7315
7420
|
invalid: undefined,
|
7316
7421
|
style: {
|
7317
7422
|
minWidth: selectDimensions === null || selectDimensions === void 0 ? void 0 : selectDimensions.width
|
7318
7423
|
},
|
7319
7424
|
tabIndex: popover.open ? 0 : -1
|
7320
|
-
};
|
7425
|
+
});
|
7426
|
+
|
7321
7427
|
return React.createElement("span", {
|
7322
7428
|
className: className,
|
7323
7429
|
"data-taco": "select",
|
@@ -7340,11 +7446,9 @@ const BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref)
|
|
7340
7446
|
type: "text"
|
7341
7447
|
}))));
|
7342
7448
|
});
|
7343
|
-
|
7344
|
-
|
7345
|
-
|
7346
|
-
...otherProps
|
7347
|
-
} = props;
|
7449
|
+
var Select = /*#__PURE__*/React.forwardRef(function Select(props, ref) {
|
7450
|
+
var editable = props.editable,
|
7451
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$4);
|
7348
7452
|
|
7349
7453
|
if (editable) {
|
7350
7454
|
return React.createElement(Combobox, Object.assign({}, otherProps, {
|
@@ -7415,41 +7519,47 @@ const usePagination = (initialPageIndex = 0, initialPageSize = 10) => {
|
|
7415
7519
|
};
|
7416
7520
|
};
|
7417
7521
|
|
7418
|
-
|
7419
|
-
|
7420
|
-
|
7522
|
+
var _excluded$p = ["length", "pageIndex", "pageSize", "pageSizes", "setPageIndex", "setPageSize", "showPageControls", "showPageNumbers", "showPageSize", "dangerouslyHijackGlobalKeyboardNavigation"];
|
7523
|
+
|
7524
|
+
var getShowingLabel = function getShowingLabel(length, pageIndex, pageSize, texts) {
|
7525
|
+
var minItemIndex = pageIndex * pageSize + 1;
|
7526
|
+
var maxItemIndex = (pageIndex + 1) * pageSize;
|
7421
7527
|
return texts.pagination.showingXofYofTotal.replace('[X]', length === 0 ? '0' : String(minItemIndex)).replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex)).replace('[total]', String(length));
|
7422
7528
|
};
|
7423
7529
|
|
7424
|
-
|
7425
|
-
|
7426
|
-
|
7427
|
-
|
7428
|
-
|
7429
|
-
|
7430
|
-
|
7431
|
-
|
7432
|
-
|
7433
|
-
|
7434
|
-
|
7435
|
-
|
7436
|
-
|
7437
|
-
|
7438
|
-
|
7439
|
-
|
7440
|
-
|
7441
|
-
|
7442
|
-
|
7530
|
+
var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
7531
|
+
var length = props.length,
|
7532
|
+
pageIndex = props.pageIndex,
|
7533
|
+
pageSize = props.pageSize,
|
7534
|
+
_props$pageSizes = props.pageSizes,
|
7535
|
+
pageSizes = _props$pageSizes === void 0 ? [10, 25, 50, 100, 500] : _props$pageSizes,
|
7536
|
+
setPageIndex = props.setPageIndex,
|
7537
|
+
setPageSize = props.setPageSize,
|
7538
|
+
_props$showPageContro = props.showPageControls,
|
7539
|
+
showPageControls = _props$showPageContro === void 0 ? true : _props$showPageContro,
|
7540
|
+
_props$showPageNumber = props.showPageNumbers,
|
7541
|
+
showPageNumbers = _props$showPageNumber === void 0 ? true : _props$showPageNumber,
|
7542
|
+
_props$showPageSize = props.showPageSize,
|
7543
|
+
showPageSize = _props$showPageSize === void 0 ? true : _props$showPageSize,
|
7544
|
+
_props$dangerouslyHij = props.dangerouslyHijackGlobalKeyboardNavigation,
|
7545
|
+
dangerouslyHijackGlobalKeyboardNavigation = _props$dangerouslyHij === void 0 ? false : _props$dangerouslyHij,
|
7546
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$p);
|
7547
|
+
|
7548
|
+
var _useLocalization = useLocalization(),
|
7549
|
+
texts = _useLocalization.texts;
|
7550
|
+
|
7551
|
+
var maxPageIndex = Math.ceil(length / pageSize) - 1;
|
7552
|
+
var showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;
|
7443
7553
|
usePaginationShortcuts({
|
7444
|
-
setPageIndex,
|
7445
|
-
maxPageIndex,
|
7446
|
-
pageIndex,
|
7447
|
-
dangerouslyHijackGlobalKeyboardNavigation
|
7554
|
+
setPageIndex: setPageIndex,
|
7555
|
+
maxPageIndex: maxPageIndex,
|
7556
|
+
pageIndex: pageIndex,
|
7557
|
+
dangerouslyHijackGlobalKeyboardNavigation: dangerouslyHijackGlobalKeyboardNavigation
|
7448
7558
|
});
|
7449
|
-
|
7450
|
-
|
7451
|
-
|
7452
|
-
|
7559
|
+
var pageCount = Math.ceil(length / pageSize);
|
7560
|
+
var canPreviousPage = pageIndex > 0;
|
7561
|
+
var canNextPage = pageIndex < pageCount - 1;
|
7562
|
+
var className = cn('inline-flex relative justify-between items-center', props.className);
|
7453
7563
|
return React.createElement("div", Object.assign({}, otherProps, {
|
7454
7564
|
className: className,
|
7455
7565
|
"data-taco": "pagination",
|
@@ -7459,11 +7569,13 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7459
7569
|
}, getShowingLabel(length, pageIndex, pageSize, texts), React.createElement(Select, {
|
7460
7570
|
"aria-label": texts.pagination.pageSize,
|
7461
7571
|
className: "ml-4 !w-20",
|
7462
|
-
data: pageSizes.map(pageSize
|
7463
|
-
|
7464
|
-
|
7465
|
-
|
7466
|
-
|
7572
|
+
data: pageSizes.map(function (pageSize) {
|
7573
|
+
return {
|
7574
|
+
text: String(pageSize),
|
7575
|
+
value: pageSize
|
7576
|
+
};
|
7577
|
+
}),
|
7578
|
+
onChange: function onChange(event) {
|
7467
7579
|
setPageIndex(0);
|
7468
7580
|
setPageSize(Number(event.target.value));
|
7469
7581
|
},
|
@@ -7475,14 +7587,18 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7475
7587
|
appearance: "default",
|
7476
7588
|
disabled: !canPreviousPage,
|
7477
7589
|
icon: "arrow-start",
|
7478
|
-
onClick: ()
|
7590
|
+
onClick: function onClick() {
|
7591
|
+
return setPageIndex(0);
|
7592
|
+
},
|
7479
7593
|
"aria-label": showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage,
|
7480
7594
|
tooltip: showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage
|
7481
7595
|
}), React.createElement(IconButton, {
|
7482
7596
|
appearance: "default",
|
7483
7597
|
disabled: !canPreviousPage,
|
7484
7598
|
icon: "arrow-left",
|
7485
|
-
onClick: ()
|
7599
|
+
onClick: function onClick() {
|
7600
|
+
return setPageIndex(pageIndex - 1);
|
7601
|
+
},
|
7486
7602
|
"aria-label": showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage,
|
7487
7603
|
tooltip: showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage
|
7488
7604
|
}), showPageNumbers && pageCount > 0 && React.createElement(PageNumbers, {
|
@@ -7493,36 +7609,43 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7493
7609
|
appearance: "default",
|
7494
7610
|
disabled: !canNextPage,
|
7495
7611
|
icon: "arrow-right",
|
7496
|
-
onClick: ()
|
7612
|
+
onClick: function onClick() {
|
7613
|
+
return setPageIndex(pageIndex + 1);
|
7614
|
+
},
|
7497
7615
|
"aria-label": showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage,
|
7498
7616
|
tooltip: showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage
|
7499
7617
|
}), React.createElement(IconButton, {
|
7500
7618
|
appearance: "default",
|
7501
7619
|
disabled: !canNextPage,
|
7502
7620
|
icon: "arrow-end",
|
7503
|
-
onClick: ()
|
7621
|
+
onClick: function onClick() {
|
7622
|
+
return setPageIndex(pageCount - 1);
|
7623
|
+
},
|
7504
7624
|
"aria-label": showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage,
|
7505
7625
|
tooltip: showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage
|
7506
7626
|
})));
|
7507
7627
|
});
|
7508
7628
|
|
7509
|
-
|
7510
|
-
|
7511
|
-
|
7512
|
-
|
7513
|
-
|
7629
|
+
var _excluded$q = ["duration"];
|
7630
|
+
var Progress = function Progress(_ref) {
|
7631
|
+
var _cn;
|
7632
|
+
|
7633
|
+
var _ref$duration = _ref.duration,
|
7634
|
+
duration = _ref$duration === void 0 ? undefined : _ref$duration,
|
7635
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
7636
|
+
|
7637
|
+
var style;
|
7514
7638
|
|
7515
7639
|
if (duration) {
|
7516
7640
|
style = {
|
7517
|
-
animationDuration:
|
7641
|
+
animationDuration: duration + "ms"
|
7518
7642
|
};
|
7519
7643
|
}
|
7520
7644
|
|
7521
|
-
|
7522
|
-
|
7523
|
-
"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
|
7524
|
-
|
7525
|
-
});
|
7645
|
+
var className = cn('bg-grey-light rounded block h-1 overflow-hidden w-full', props.className);
|
7646
|
+
var progressClassName = cn('yt-progress__bar block h-1', (_cn = {
|
7647
|
+
"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
|
7648
|
+
}, _cn["w-0 bg-grey-dark animate-[progress_linear]"] = duration, _cn));
|
7526
7649
|
return React__default.createElement("span", Object.assign({}, props, {
|
7527
7650
|
"data-taco": "progress",
|
7528
7651
|
className: className
|
@@ -9132,16 +9255,19 @@ const useTableRowCreation = (data, tableRef) => {
|
|
9132
9255
|
};
|
9133
9256
|
};
|
9134
9257
|
|
9135
|
-
|
9136
|
-
|
9137
|
-
id
|
9138
|
-
|
9139
|
-
|
9140
|
-
|
9141
|
-
|
9142
|
-
|
9143
|
-
|
9144
|
-
|
9258
|
+
var _excluded$r = ["id", "defaultId", "children", "onChange", "orientation"],
|
9259
|
+
_excluded2$5 = ["id", "disabled"],
|
9260
|
+
_excluded3 = ["id"];
|
9261
|
+
var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
9262
|
+
var id = props.id,
|
9263
|
+
defaultId = props.defaultId,
|
9264
|
+
children = props.children,
|
9265
|
+
onChange = props.onChange,
|
9266
|
+
_props$orientation = props.orientation,
|
9267
|
+
orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
|
9268
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$r);
|
9269
|
+
|
9270
|
+
var className = cn('yt-tabs', "yt-tabs--" + orientation, {
|
9145
9271
|
'flex w-full': orientation === 'vertical'
|
9146
9272
|
}, props.className);
|
9147
9273
|
return React.createElement(TabsPrimitive.Root, Object.assign({}, otherProps, {
|
@@ -9155,20 +9281,19 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
|
9155
9281
|
value: id
|
9156
9282
|
}), children);
|
9157
9283
|
});
|
9158
|
-
|
9159
|
-
|
9284
|
+
var TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9285
|
+
var className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);
|
9160
9286
|
return React.createElement(TabsPrimitive.List, Object.assign({}, props, {
|
9161
9287
|
className: className,
|
9162
9288
|
ref: ref
|
9163
9289
|
}));
|
9164
9290
|
});
|
9165
|
-
|
9166
|
-
|
9167
|
-
|
9168
|
-
|
9169
|
-
|
9170
|
-
|
9171
|
-
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);
|
9291
|
+
var TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9292
|
+
var id = props.id,
|
9293
|
+
disabled = props.disabled,
|
9294
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$5);
|
9295
|
+
|
9296
|
+
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);
|
9172
9297
|
return React.createElement(TabsPrimitive.Trigger, Object.assign({}, otherProps, {
|
9173
9298
|
className: className,
|
9174
9299
|
disabled: disabled,
|
@@ -9179,12 +9304,11 @@ const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
9179
9304
|
value: id
|
9180
9305
|
}));
|
9181
9306
|
});
|
9182
|
-
|
9183
|
-
|
9184
|
-
|
9185
|
-
|
9186
|
-
|
9187
|
-
const className = cn('yt-tab__panel outline-none', props.className);
|
9307
|
+
var TabContent = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9308
|
+
var id = props.id,
|
9309
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded3);
|
9310
|
+
|
9311
|
+
var className = cn('yt-tab__panel outline-none', props.className);
|
9188
9312
|
return React.createElement(TabsPrimitive.Content, Object.assign({}, otherProps, {
|
9189
9313
|
className: className,
|
9190
9314
|
ref: ref,
|
@@ -9195,22 +9319,19 @@ Tabs.List = TabList;
|
|
9195
9319
|
Tabs.Trigger = TabTrigger;
|
9196
9320
|
Tabs.Content = TabContent;
|
9197
9321
|
|
9198
|
-
|
9199
|
-
|
9200
|
-
|
9201
|
-
|
9202
|
-
|
9203
|
-
|
9204
|
-
...otherProps
|
9205
|
-
} = props;
|
9206
|
-
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
|
9322
|
+
var _excluded$s = ["defaultValue", "highlighted", "invalid", "onKeyDown"];
|
9323
|
+
var Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
9324
|
+
var onKeyDown = props.onKeyDown,
|
9325
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$s);
|
9326
|
+
|
9327
|
+
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
|
9207
9328
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
9208
9329
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
9209
9330
|
|
9210
|
-
|
9331
|
+
var handleKeyDown = function handleKeyDown(event) {
|
9211
9332
|
if (event.key === 'Home' || event.key === 'End') {
|
9212
9333
|
event.preventDefault();
|
9213
|
-
|
9334
|
+
var position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
9214
9335
|
event.currentTarget.setSelectionRange(position, position);
|
9215
9336
|
event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;
|
9216
9337
|
}
|
@@ -9228,18 +9349,18 @@ const Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
|
9228
9349
|
}));
|
9229
9350
|
});
|
9230
9351
|
|
9231
|
-
|
9232
|
-
|
9233
|
-
|
9234
|
-
|
9235
|
-
|
9236
|
-
|
9237
|
-
|
9352
|
+
var _excluded$t = ["label", "onChange"];
|
9353
|
+
var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
9354
|
+
var label = props.label,
|
9355
|
+
onChange = props.onChange,
|
9356
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$t);
|
9357
|
+
|
9358
|
+
var className = cn('group h-6 w-10 flex rounded-full inline-flex', {
|
9238
9359
|
'mr-2': !!label,
|
9239
9360
|
'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,
|
9240
9361
|
'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled
|
9241
9362
|
}, props.className);
|
9242
|
-
|
9363
|
+
var element = React.createElement(PrimitiveSwitch.Root, Object.assign({}, otherProps, {
|
9243
9364
|
className: className,
|
9244
9365
|
onCheckedChange: onChange,
|
9245
9366
|
ref: ref
|
@@ -9248,7 +9369,7 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9248
9369
|
}));
|
9249
9370
|
|
9250
9371
|
if (label) {
|
9251
|
-
|
9372
|
+
var labelClassName = cn('flex items-center cursor-pointer', {
|
9252
9373
|
'cursor-not-allowed text-grey-dark': props.disabled
|
9253
9374
|
});
|
9254
9375
|
return React.createElement("label", {
|
@@ -9259,22 +9380,23 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9259
9380
|
return element;
|
9260
9381
|
});
|
9261
9382
|
|
9262
|
-
|
9263
|
-
|
9264
|
-
|
9265
|
-
|
9266
|
-
|
9267
|
-
|
9268
|
-
|
9269
|
-
|
9270
|
-
|
9271
|
-
|
9272
|
-
|
9273
|
-
|
9274
|
-
|
9275
|
-
|
9276
|
-
React.
|
9277
|
-
|
9383
|
+
var _excluded$u = ["autoStart", "onComplete", "onClose", "onReady", "spotlightClicks", "disableCloseOnEsc", "disableScrollParentFix"];
|
9384
|
+
|
9385
|
+
var Tooltip$1 = function Tooltip(_ref) {
|
9386
|
+
var continuous = _ref.continuous,
|
9387
|
+
index = _ref.index,
|
9388
|
+
isLastStep = _ref.isLastStep,
|
9389
|
+
step = _ref.step,
|
9390
|
+
backProps = _ref.backProps,
|
9391
|
+
primaryProps = _ref.primaryProps,
|
9392
|
+
skipProps = _ref.skipProps,
|
9393
|
+
tooltipProps = _ref.tooltipProps,
|
9394
|
+
size = _ref.size,
|
9395
|
+
locale = _ref.locale,
|
9396
|
+
disableTourSkipOnEsc = _ref.disableTourSkipOnEsc;
|
9397
|
+
var skipButtonRef = React.useRef(null);
|
9398
|
+
React.useEffect(function () {
|
9399
|
+
var onWindowKeyDown = function onWindowKeyDown(event) {
|
9278
9400
|
if (!disableTourSkipOnEsc) {
|
9279
9401
|
if (event.keyCode === keycode('esc') && skipButtonRef.current !== null) {
|
9280
9402
|
event.preventDefault();
|
@@ -9285,7 +9407,7 @@ const Tooltip$1 = ({
|
|
9285
9407
|
};
|
9286
9408
|
|
9287
9409
|
window.addEventListener('keydown', onWindowKeyDown);
|
9288
|
-
return ()
|
9410
|
+
return function () {
|
9289
9411
|
window.removeEventListener('keydown', onWindowKeyDown);
|
9290
9412
|
};
|
9291
9413
|
}, []);
|
@@ -9304,30 +9426,30 @@ const Tooltip$1 = ({
|
|
9304
9426
|
appearance: "discrete"
|
9305
9427
|
}), locale.back), React.createElement(Button$1, Object.assign({}, primaryProps, {
|
9306
9428
|
appearance: "primary"
|
9307
|
-
}), continuous ? isLastStep ?
|
9429
|
+
}), continuous ? isLastStep ? locale.last + " (" + (index + 1) + "/" + size + ")" : locale.next + " (" + (index + 1) + "/" + size + ")" : locale.close)));
|
9308
9430
|
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
9309
9431
|
|
9310
9432
|
|
9311
|
-
|
9312
|
-
|
9313
|
-
|
9314
|
-
|
9315
|
-
|
9316
|
-
|
9317
|
-
|
9318
|
-
|
9319
|
-
|
9320
|
-
|
9321
|
-
|
9322
|
-
|
9323
|
-
|
9324
|
-
|
9325
|
-
|
9326
|
-
|
9327
|
-
|
9328
|
-
|
9329
|
-
return React.Children.map(props.children, child
|
9330
|
-
|
9433
|
+
var TourStep = function TourStep(_props) {
|
9434
|
+
return null;
|
9435
|
+
};
|
9436
|
+
var Tour = function Tour(props) {
|
9437
|
+
var _useLocalization = useLocalization(),
|
9438
|
+
tour = _useLocalization.texts.tour;
|
9439
|
+
|
9440
|
+
var run = props.autoStart,
|
9441
|
+
onComplete = props.onComplete,
|
9442
|
+
onClose = props.onClose,
|
9443
|
+
onReady = props.onReady,
|
9444
|
+
spotlightClicks = props.spotlightClicks,
|
9445
|
+
disableTourSkipOnEsc = props.disableCloseOnEsc,
|
9446
|
+
_props$disableScrollP = props.disableScrollParentFix,
|
9447
|
+
disableScrollParentFix = _props$disableScrollP === void 0 ? false : _props$disableScrollP,
|
9448
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$u);
|
9449
|
+
|
9450
|
+
var steps = React.useMemo(function () {
|
9451
|
+
return React.Children.map(props.children, function (child) {
|
9452
|
+
var step = {
|
9331
9453
|
disableBeacon: !child.props.showBeacon,
|
9332
9454
|
target: child.props.selector,
|
9333
9455
|
placement: child.props.position,
|
@@ -9337,10 +9459,12 @@ const Tour = props => {
|
|
9337
9459
|
return step;
|
9338
9460
|
});
|
9339
9461
|
}, [props.children]);
|
9340
|
-
|
9462
|
+
var getStep = React.useCallback(function (selector) {
|
9341
9463
|
var _props$children$find;
|
9342
9464
|
|
9343
|
-
return (_props$children$find = props.children.find(
|
9465
|
+
return (_props$children$find = props.children.find(function (child) {
|
9466
|
+
return child.props.selector === selector;
|
9467
|
+
})) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
9344
9468
|
}, [props.children]);
|
9345
9469
|
|
9346
9470
|
function callback(state) {
|
@@ -9370,10 +9494,12 @@ const Tour = props => {
|
|
9370
9494
|
floaterProps: {
|
9371
9495
|
disableAnimation: true
|
9372
9496
|
},
|
9373
|
-
tooltipComponent:
|
9374
|
-
|
9375
|
-
|
9376
|
-
|
9497
|
+
tooltipComponent: function tooltipComponent(tooltipProps) {
|
9498
|
+
return React.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
|
9499
|
+
locale: tour,
|
9500
|
+
disableTourSkipOnEsc: disableTourSkipOnEsc
|
9501
|
+
}));
|
9502
|
+
},
|
9377
9503
|
locale: tour,
|
9378
9504
|
spotlightPadding: 8,
|
9379
9505
|
spotlightClicks: spotlightClicks,
|
@@ -9414,22 +9540,22 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9414
9540
|
}, [ref, callback]);
|
9415
9541
|
};
|
9416
9542
|
|
9417
|
-
|
9418
|
-
|
9419
|
-
|
9420
|
-
|
9421
|
-
|
9422
|
-
|
9423
|
-
|
9543
|
+
var _excluded$v = ["onSearch"];
|
9544
|
+
var SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput(_ref, ref) {
|
9545
|
+
var onSearch = _ref.onSearch,
|
9546
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
9547
|
+
|
9548
|
+
var _useLocalization = useLocalization(),
|
9549
|
+
texts = _useLocalization.texts;
|
9424
9550
|
|
9425
|
-
|
9551
|
+
var handleClick = function handleClick() {
|
9426
9552
|
if (!props.disabled) {
|
9427
9553
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(props.value);
|
9428
9554
|
}
|
9429
9555
|
};
|
9430
9556
|
|
9431
|
-
|
9432
|
-
|
9557
|
+
var handleKeyDown = function handleKeyDown(event) {
|
9558
|
+
var isEnterKeyPressed = event.keyCode === keycode('enter');
|
9433
9559
|
|
9434
9560
|
if (isEnterKeyPressed) {
|
9435
9561
|
handleClick();
|