@economic/taco 1.24.0 → 1.25.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Button/Button.d.ts +13 -0
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/components/DialogDrawer.d.ts +10 -0
- package/dist/components/Drawer/Context.d.ts +18 -0
- package/dist/components/Drawer/Drawer.d.ts +51 -0
- package/dist/components/Drawer/components/Content.d.ts +53 -0
- package/dist/components/Drawer/components/Trigger.d.ts +3 -0
- package/dist/components/Drawer/images.d.ts +1 -0
- package/dist/components/Drawer/types.d.ts +2 -0
- package/dist/components/Drawer/util.d.ts +7 -0
- package/dist/components/Navigation2/components/Group.d.ts +5 -3
- package/dist/components/Navigation2/components/util.d.ts +1 -0
- package/dist/components/Provider/Localization.d.ts +6 -0
- package/dist/esm/packages/taco/src/components/Button/Button.js +2 -0
- package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/util.js +5 -0
- package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js +3 -3
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/{Drawer.js → DialogDrawer.js} +4 -4
- package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Drawer/Context.js +19 -0
- package/dist/esm/packages/taco/src/components/Drawer/Context.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +102 -0
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +292 -0
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js +12 -0
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Drawer/util.js +37 -0
- package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +4 -2
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Button.js +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Link.js +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +1 -0
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Menu.js +2 -2
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Link.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +2 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +6 -6
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +2 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +2 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js +12 -0
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +3 -0
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/Search.js +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js +1 -1
- package/dist/esm/packages/taco/src/index.js +2 -1
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js +8 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/taco.cjs.development.js +559 -107
- 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 -2
- package/tailwind.config.js +1 -0
- package/types.json +331 -4
- package/dist/components/Dialog/components/Drawer.d.ts +0 -10
- package/dist/esm/packages/taco/src/components/Dialog/components/Drawer.js.map +0 -1
@@ -19,14 +19,14 @@ var dateFns = require('date-fns');
|
|
19
19
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
20
20
|
var interactions = require('@react-aria/interactions');
|
21
21
|
var framerMotion = require('framer-motion');
|
22
|
+
var focus = require('@react-aria/focus');
|
23
|
+
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
24
|
+
var reactUseControllableState = require('@radix-ui/react-use-controllable-state');
|
22
25
|
var HoverCardPrimitive = require('@radix-ui/react-hover-card');
|
23
26
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
24
|
-
var reactUseControllableState = require('@radix-ui/react-use-controllable-state');
|
25
27
|
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
26
|
-
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
27
28
|
var reactTable = require('react-table');
|
28
29
|
var reactIntersectionObserver = require('react-intersection-observer');
|
29
|
-
var focus = require('@react-aria/focus');
|
30
30
|
var reactWindow = require('react-window');
|
31
31
|
var InfiniteLoader = _interopDefault(require('react-window-infinite-loader'));
|
32
32
|
var set = _interopDefault(require('lodash/set'));
|
@@ -3649,6 +3649,7 @@ const createButtonWithTooltip = (props, className, ref) => {
|
|
3649
3649
|
const createButtonWithOverlays = (props, buttonBase) => {
|
3650
3650
|
const {
|
3651
3651
|
dialog,
|
3652
|
+
drawer,
|
3652
3653
|
hanger,
|
3653
3654
|
menu,
|
3654
3655
|
popover
|
@@ -3658,6 +3659,10 @@ const createButtonWithOverlays = (props, buttonBase) => {
|
|
3658
3659
|
button = dialog({
|
3659
3660
|
trigger: button
|
3660
3661
|
});
|
3662
|
+
} else if (typeof drawer === 'function') {
|
3663
|
+
button = drawer({
|
3664
|
+
trigger: button
|
3665
|
+
});
|
3661
3666
|
} else if (typeof menu === 'function') {
|
3662
3667
|
button = menu({
|
3663
3668
|
trigger: button
|
@@ -3900,6 +3905,9 @@ const defaultLocalisationTexts = {
|
|
3900
3905
|
last: 'Done',
|
3901
3906
|
next: 'Next',
|
3902
3907
|
open: 'Open'
|
3908
|
+
},
|
3909
|
+
drawer: {
|
3910
|
+
close: 'Close'
|
3903
3911
|
}
|
3904
3912
|
};
|
3905
3913
|
const defaultLocalizationContext = {
|
@@ -3961,6 +3969,7 @@ const Base$1 = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
3961
3969
|
const Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3962
3970
|
const {
|
3963
3971
|
dialog,
|
3972
|
+
drawer,
|
3964
3973
|
hanger,
|
3965
3974
|
menu,
|
3966
3975
|
popover,
|
@@ -3982,6 +3991,7 @@ const Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
3982
3991
|
}), children);
|
3983
3992
|
return createButtonWithOverlays({
|
3984
3993
|
dialog,
|
3994
|
+
drawer,
|
3985
3995
|
hanger,
|
3986
3996
|
menu,
|
3987
3997
|
popover
|
@@ -5531,10 +5541,17 @@ const useDraggable = ref => {
|
|
5531
5541
|
setDragging(false);
|
5532
5542
|
}
|
5533
5543
|
});
|
5544
|
+
const resetPosition = () => {
|
5545
|
+
setPosition({
|
5546
|
+
x: 0,
|
5547
|
+
y: 0
|
5548
|
+
});
|
5549
|
+
};
|
5534
5550
|
return {
|
5535
5551
|
position,
|
5536
5552
|
dragging,
|
5537
|
-
handleProps: moveProps
|
5553
|
+
handleProps: moveProps,
|
5554
|
+
resetPosition
|
5538
5555
|
};
|
5539
5556
|
};
|
5540
5557
|
|
@@ -5641,7 +5658,7 @@ const Content$4 = /*#__PURE__*/React.forwardRef(function DialogContent(props, re
|
|
5641
5658
|
})) : null), dialog.elements.drawer, dialog.elements.extra))));
|
5642
5659
|
});
|
5643
5660
|
|
5644
|
-
const
|
5661
|
+
const DialogDrawer = /*#__PURE__*/React.forwardRef(function DialogDrawer(props, ref) {
|
5645
5662
|
var _dialog$drawer, _dialog$drawer2;
|
5646
5663
|
const dialog = useCurrentDialog();
|
5647
5664
|
const className = cn('absolute top-0 -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left', props.className);
|
@@ -5673,7 +5690,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function DialogDrawer(props, ref) {
|
|
5673
5690
|
ref: ref
|
5674
5691
|
}), typeof props.children === 'function' ? props.children(dialog.drawer) : props.children);
|
5675
5692
|
});
|
5676
|
-
|
5693
|
+
DialogDrawer.displayName = 'DialogDrawer';
|
5677
5694
|
|
5678
5695
|
const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
5679
5696
|
const className = cn('wcag-grey-100 absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left', props.className);
|
@@ -5692,7 +5709,7 @@ const useSeparatedChildren = initialChildren => {
|
|
5692
5709
|
let extra;
|
5693
5710
|
React.Children.toArray(initialChildren).forEach(child => {
|
5694
5711
|
var _child$type, _child$type2;
|
5695
|
-
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) ===
|
5712
|
+
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === DialogDrawer.displayName) {
|
5696
5713
|
drawer = child;
|
5697
5714
|
} else if (((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === Extra.displayName) {
|
5698
5715
|
extra = child;
|
@@ -5749,9 +5766,491 @@ Dialog.Content = Content$4;
|
|
5749
5766
|
Dialog.Title = Title$1;
|
5750
5767
|
Dialog.Footer = Footer$1;
|
5751
5768
|
Dialog.Extra = Extra;
|
5752
|
-
Dialog.Drawer =
|
5769
|
+
Dialog.Drawer = DialogDrawer;
|
5753
5770
|
Dialog.Close = Close$2;
|
5754
5771
|
|
5772
|
+
const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5773
|
+
const {
|
5774
|
+
as: Tag = 'span',
|
5775
|
+
orientation = 'horizontal',
|
5776
|
+
...otherProps
|
5777
|
+
} = props;
|
5778
|
+
const className = cn('flex ', 'gap-2', {
|
5779
|
+
'flex-col ': orientation === 'vertical'
|
5780
|
+
}, props.className);
|
5781
|
+
return /*#__PURE__*/React.createElement(Tag, Object.assign({}, otherProps, {
|
5782
|
+
className: className,
|
5783
|
+
"data-taco": "group",
|
5784
|
+
ref: ref
|
5785
|
+
}));
|
5786
|
+
});
|
5787
|
+
|
5788
|
+
const MenuContext = /*#__PURE__*/React.createContext(undefined);
|
5789
|
+
const useCurrentMenu = () => {
|
5790
|
+
return React.useContext(MenuContext);
|
5791
|
+
};
|
5792
|
+
|
5793
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
5794
|
+
const DrawerContext = /*#__PURE__*/React.createContext({
|
5795
|
+
closeOnEscape: true,
|
5796
|
+
showCloseButton: true,
|
5797
|
+
onClose: () => {},
|
5798
|
+
onResize: () => {},
|
5799
|
+
props: {},
|
5800
|
+
ref: null,
|
5801
|
+
size: 'md',
|
5802
|
+
variant: 'embedded'
|
5803
|
+
});
|
5804
|
+
const useCurrentDrawer = () => {
|
5805
|
+
return React.useContext(DrawerContext);
|
5806
|
+
};
|
5807
|
+
|
5808
|
+
const getDrawerSizeClassnames = size => {
|
5809
|
+
switch (size) {
|
5810
|
+
case 'lg':
|
5811
|
+
return 'w-[600px]';
|
5812
|
+
case 'md':
|
5813
|
+
default:
|
5814
|
+
return 'w-[420px]';
|
5815
|
+
}
|
5816
|
+
};
|
5817
|
+
const getDrawerContentClassNames = (size, variant, open) => {
|
5818
|
+
return cn('bg-white h-full bottom-0 top-0 right-0 transition-none', {
|
5819
|
+
block: open,
|
5820
|
+
hidden: !open,
|
5821
|
+
fixed: variant === 'overlay',
|
5822
|
+
'relative h-full overflow-hidden': variant === 'embedded'
|
5823
|
+
}, getDrawerSizeClassnames(size));
|
5824
|
+
};
|
5825
|
+
const getDrawerContainerClassNames = variant => {
|
5826
|
+
return cn('bg-white mx-auto absolute h-full w-full flex flex-col ', {
|
5827
|
+
'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]': variant === 'overlay',
|
5828
|
+
'border-l border-grey h-full': variant === 'embedded'
|
5829
|
+
});
|
5830
|
+
};
|
5831
|
+
const getDrawerDragHandlerClassNames = () => {
|
5832
|
+
return cn('border-[2px] absolute border-transparent top-0 w-2 h-full cursor-ew-resize left-0 hover:border-l-blue-500');
|
5833
|
+
};
|
5834
|
+
const getBackdropClassNames = open => {
|
5835
|
+
return cn({
|
5836
|
+
block: open,
|
5837
|
+
hidden: !open
|
5838
|
+
});
|
5839
|
+
};
|
5840
|
+
|
5841
|
+
const useGlobalKeyboardShortcut = handler => {
|
5842
|
+
React__default.useEffect(() => {
|
5843
|
+
document.addEventListener('keydown', handler);
|
5844
|
+
return () => {
|
5845
|
+
document.removeEventListener('keydown', handler);
|
5846
|
+
};
|
5847
|
+
}, [handler]);
|
5848
|
+
};
|
5849
|
+
|
5850
|
+
const Bar = props => {
|
5851
|
+
const className = cn(`flex select-none touch-none transition-colors hover:bg-grey`, {
|
5852
|
+
'w-[7px] hover:w-[14px] mr-[2px] hover:px-[2px] hover:mr-0': props.orientation === 'vertical',
|
5853
|
+
'flex-col h-[7px] hover:h-[14px] mb-[2px] hover:py-[2px] hover:mb-0': props.orientation === 'horizontal'
|
5854
|
+
});
|
5855
|
+
return /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Scrollbar, Object.assign({}, props, {
|
5856
|
+
className: className
|
5857
|
+
}));
|
5858
|
+
};
|
5859
|
+
const Thumb = props => /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Thumb, Object.assign({}, props, {
|
5860
|
+
className: "flex-[1] rounded bg-black opacity-50"
|
5861
|
+
}));
|
5862
|
+
const Corner = props => /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Corner, Object.assign({}, props, {
|
5863
|
+
classname: "bg-grey-500"
|
5864
|
+
}));
|
5865
|
+
const ScrollArea = props => {
|
5866
|
+
const {
|
5867
|
+
children,
|
5868
|
+
...otherProps
|
5869
|
+
} = props;
|
5870
|
+
return /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Root, Object.assign({}, otherProps, {
|
5871
|
+
className: cn('overflow-hidden', props.className)
|
5872
|
+
}), /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Viewport, {
|
5873
|
+
className: "h-full w-full"
|
5874
|
+
}, children), /*#__PURE__*/React__default.createElement(Bar, {
|
5875
|
+
orientation: "vertical"
|
5876
|
+
}, /*#__PURE__*/React__default.createElement(Thumb, null)), /*#__PURE__*/React__default.createElement(Bar, {
|
5877
|
+
orientation: "horizontal"
|
5878
|
+
}, /*#__PURE__*/React__default.createElement(Thumb, null)), /*#__PURE__*/React__default.createElement(Corner, null));
|
5879
|
+
};
|
5880
|
+
|
5881
|
+
const RESIZE_MIN = 360;
|
5882
|
+
const RESIZE_MAX = 1000;
|
5883
|
+
var DrawerAnimationDefinition;
|
5884
|
+
(function (DrawerAnimationDefinition) {
|
5885
|
+
DrawerAnimationDefinition["Visible"] = "visible";
|
5886
|
+
DrawerAnimationDefinition["Hidden"] = "hidden";
|
5887
|
+
})(DrawerAnimationDefinition || (DrawerAnimationDefinition = {}));
|
5888
|
+
const RenderPropWrapper$2 = /*#__PURE__*/React__default.forwardRef(function RenderPropWrapper({
|
5889
|
+
children,
|
5890
|
+
onClick,
|
5891
|
+
renderProps
|
5892
|
+
}, ref) {
|
5893
|
+
const close = () => {
|
5894
|
+
onClick(new CustomEvent('close'));
|
5895
|
+
};
|
5896
|
+
return children({
|
5897
|
+
close,
|
5898
|
+
ref,
|
5899
|
+
...renderProps
|
5900
|
+
});
|
5901
|
+
});
|
5902
|
+
const Title$2 = /*#__PURE__*/React__default.forwardRef(function DrawerTitle(props, ref) {
|
5903
|
+
const {
|
5904
|
+
className,
|
5905
|
+
children,
|
5906
|
+
...otherProps
|
5907
|
+
} = props;
|
5908
|
+
/**
|
5909
|
+
* By design in default drawer version Title has grey separator, but we might have exceptions like Drawer + Tabs scenario,
|
5910
|
+
* where we might want to hide the grey separator. For this reason separator was rendedr with using of classNames,
|
5911
|
+
* so it can be easily overriden in exceptional scenarious.
|
5912
|
+
* */
|
5913
|
+
const cName = cn('grow-0 py-4 pl-4 justyfy-self-start mb-0 border-b-[1px] border-grey-300', className);
|
5914
|
+
return /*#__PURE__*/React__default.createElement(DialogPrimitive.Title, Object.assign({
|
5915
|
+
className: cName
|
5916
|
+
}, otherProps, {
|
5917
|
+
ref: ref
|
5918
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
5919
|
+
className: "line-clamp-2 inline-block w-4/6 overflow-y-hidden"
|
5920
|
+
}, children));
|
5921
|
+
});
|
5922
|
+
const Footer$2 = /*#__PURE__*/React__default.forwardRef(function DrawerFooter(props, ref) {
|
5923
|
+
const {
|
5924
|
+
className,
|
5925
|
+
...otherProps
|
5926
|
+
} = props;
|
5927
|
+
/**
|
5928
|
+
* The same scenario as Title, grey separator rendered using classNames to have posibility to override it.
|
5929
|
+
*/
|
5930
|
+
const cName = cn('mt-auto flex justify-end grow-0 p-4 border-t-[1px] border-grey-300', props.className);
|
5931
|
+
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, otherProps, {
|
5932
|
+
className: cName,
|
5933
|
+
ref: ref
|
5934
|
+
}));
|
5935
|
+
});
|
5936
|
+
const Actions = /*#__PURE__*/React__default.forwardRef(function Actions(props, ref) {
|
5937
|
+
const {
|
5938
|
+
className,
|
5939
|
+
...otherProps
|
5940
|
+
} = props;
|
5941
|
+
const cName = cn('absolute top-0 right-10 mr-[8px] mt-4', className);
|
5942
|
+
return /*#__PURE__*/React__default.createElement(Group, Object.assign({}, otherProps, {
|
5943
|
+
className: cName,
|
5944
|
+
ref: ref
|
5945
|
+
}));
|
5946
|
+
});
|
5947
|
+
const Close$3 = /*#__PURE__*/React__default.forwardRef(function DrawerClose(props, ref) {
|
5948
|
+
const {
|
5949
|
+
onClose
|
5950
|
+
} = useCurrentDrawer();
|
5951
|
+
return /*#__PURE__*/React__default.createElement(DialogPrimitive.Close, Object.assign({}, props, {
|
5952
|
+
onClick: onClose,
|
5953
|
+
ref: ref,
|
5954
|
+
asChild: true
|
5955
|
+
}));
|
5956
|
+
});
|
5957
|
+
const InnerContent = /*#__PURE__*/React__default.forwardRef(function InnerContent(props, ref) {
|
5958
|
+
const {
|
5959
|
+
className,
|
5960
|
+
isScrollable = true,
|
5961
|
+
children,
|
5962
|
+
...otherProps
|
5963
|
+
} = props;
|
5964
|
+
const cName = cn('grow-1 p-4', className);
|
5965
|
+
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, otherProps, {
|
5966
|
+
className: cName,
|
5967
|
+
ref: ref
|
5968
|
+
}), isScrollable ? /*#__PURE__*/React__default.createElement(ScrollArea, {
|
5969
|
+
className: "w-full gap-y-0.5"
|
5970
|
+
}, children) : {
|
5971
|
+
children
|
5972
|
+
});
|
5973
|
+
});
|
5974
|
+
const Portal = props => {
|
5975
|
+
const {
|
5976
|
+
children,
|
5977
|
+
...otherProps
|
5978
|
+
} = props;
|
5979
|
+
const {
|
5980
|
+
open = false,
|
5981
|
+
variant,
|
5982
|
+
outlet
|
5983
|
+
} = useCurrentDrawer();
|
5984
|
+
const backdropClassNames = React__default.useMemo(() => {
|
5985
|
+
return getBackdropClassNames(open);
|
5986
|
+
}, [open]);
|
5987
|
+
if (!outlet) {
|
5988
|
+
return null;
|
5989
|
+
}
|
5990
|
+
return /*#__PURE__*/React__default.createElement(DialogPrimitive.Portal, Object.assign({}, otherProps, {
|
5991
|
+
container: outlet !== null && outlet !== void 0 ? outlet : undefined
|
5992
|
+
}), variant === 'overlay' ? /*#__PURE__*/React__default.createElement(DialogPrimitive.Overlay, {
|
5993
|
+
forceMount: true
|
5994
|
+
}, /*#__PURE__*/React__default.createElement(Backdrop, {
|
5995
|
+
className: backdropClassNames
|
5996
|
+
})) : null, children);
|
5997
|
+
};
|
5998
|
+
const UntrappedFocusDrawerContent = /*#__PURE__*/React__default.forwardRef(function EmbeddedDrawerContent(props, ref) {
|
5999
|
+
const {
|
6000
|
+
onEscape,
|
6001
|
+
children,
|
6002
|
+
...otherProps
|
6003
|
+
} = props;
|
6004
|
+
useGlobalKeyboardShortcut(event => {
|
6005
|
+
if (event.key === 'Escape') {
|
6006
|
+
onEscape(event);
|
6007
|
+
}
|
6008
|
+
});
|
6009
|
+
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, otherProps, {
|
6010
|
+
ref: ref
|
6011
|
+
}), /*#__PURE__*/React__default.createElement(focus.FocusScope, {
|
6012
|
+
autoFocus: true,
|
6013
|
+
restoreFocus: true
|
6014
|
+
}, children));
|
6015
|
+
});
|
6016
|
+
const DrawerContent = /*#__PURE__*/React__default.forwardRef(function Content(props, externalRef) {
|
6017
|
+
const {
|
6018
|
+
size,
|
6019
|
+
onClose,
|
6020
|
+
onResize,
|
6021
|
+
open = false,
|
6022
|
+
closeOnEscape,
|
6023
|
+
variant,
|
6024
|
+
focusTrap,
|
6025
|
+
showCloseButton,
|
6026
|
+
setOpen
|
6027
|
+
} = useCurrentDrawer();
|
6028
|
+
const {
|
6029
|
+
className,
|
6030
|
+
style,
|
6031
|
+
children,
|
6032
|
+
...otherProps
|
6033
|
+
} = props;
|
6034
|
+
const {
|
6035
|
+
texts
|
6036
|
+
} = useLocalization();
|
6037
|
+
const ref = useMergedRef(externalRef);
|
6038
|
+
// if the drawer was opened by a menu, we need to close the menu when the drawer closes
|
6039
|
+
// the menu is still open (and mounted) because it is the trigger for the drawer
|
6040
|
+
const menu = useCurrentMenu();
|
6041
|
+
let handleCloseAutoFocus;
|
6042
|
+
if (menu) {
|
6043
|
+
handleCloseAutoFocus = () => {
|
6044
|
+
menu.close();
|
6045
|
+
};
|
6046
|
+
}
|
6047
|
+
const containerClassName = React__default.useMemo(() => cn(getDrawerContainerClassNames(variant), className), [className]);
|
6048
|
+
const {
|
6049
|
+
contentClassName,
|
6050
|
+
dragHandlerClassName
|
6051
|
+
} = React__default.useMemo(() => {
|
6052
|
+
const contentClassName = getDrawerContentClassNames(size, variant, open);
|
6053
|
+
const dragHandlerClassName = getDrawerDragHandlerClassNames();
|
6054
|
+
return {
|
6055
|
+
contentClassName,
|
6056
|
+
dragHandlerClassName
|
6057
|
+
};
|
6058
|
+
}, [size, variant, open]);
|
6059
|
+
const handleEscapeKeyDown = event => {
|
6060
|
+
var _ref$current;
|
6061
|
+
const isTargetInsideDrawerContent = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.contains(event.target);
|
6062
|
+
if (isTargetInsideDrawerContent) {
|
6063
|
+
if (!closeOnEscape) {
|
6064
|
+
event.preventDefault();
|
6065
|
+
} else {
|
6066
|
+
setOpen && setOpen(false);
|
6067
|
+
if (onClose) {
|
6068
|
+
onClose();
|
6069
|
+
}
|
6070
|
+
}
|
6071
|
+
}
|
6072
|
+
};
|
6073
|
+
const [containerWidth, setContainerWidth] = React__default.useState();
|
6074
|
+
const dragHandlerRef = React__default.useRef(null);
|
6075
|
+
const {
|
6076
|
+
position,
|
6077
|
+
dragging,
|
6078
|
+
handleProps: dragHandleProps,
|
6079
|
+
resetPosition
|
6080
|
+
} = useDraggable(useMergedRef(dragHandlerRef));
|
6081
|
+
const contentRef = React__default.useRef(null);
|
6082
|
+
React__default.useEffect(() => {
|
6083
|
+
if (onResize) {
|
6084
|
+
onResize(position.x);
|
6085
|
+
}
|
6086
|
+
}, [position]);
|
6087
|
+
React__default.useEffect(() => {
|
6088
|
+
var _contentRef$current;
|
6089
|
+
setContainerWidth((_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.offsetWidth);
|
6090
|
+
}, [contentRef, open]);
|
6091
|
+
const resizedWidth = React__default.useMemo(() => {
|
6092
|
+
if (containerWidth) {
|
6093
|
+
return Math.min(RESIZE_MAX, Math.max(RESIZE_MIN, containerWidth - position.x || 0));
|
6094
|
+
}
|
6095
|
+
return;
|
6096
|
+
}, [containerWidth, position]);
|
6097
|
+
React__default.useEffect(() => {
|
6098
|
+
if (!dragging && resizedWidth) {
|
6099
|
+
setContainerWidth(resizedWidth);
|
6100
|
+
resetPosition();
|
6101
|
+
}
|
6102
|
+
}, [dragging]);
|
6103
|
+
let output;
|
6104
|
+
if (typeof children === 'function') {
|
6105
|
+
output = /*#__PURE__*/React__default.createElement(Close$3, null, /*#__PURE__*/React__default.createElement(RenderPropWrapper$2, null, children));
|
6106
|
+
} else {
|
6107
|
+
output = children;
|
6108
|
+
}
|
6109
|
+
const content = /*#__PURE__*/React__default.createElement("div", {
|
6110
|
+
ref: contentRef,
|
6111
|
+
"data-taco": "drawer",
|
6112
|
+
className: containerClassName
|
6113
|
+
}, /*#__PURE__*/React__default.createElement("div", Object.assign({
|
6114
|
+
className: dragHandlerClassName
|
6115
|
+
}, dragHandleProps, {
|
6116
|
+
"data-testid": "resize-handler",
|
6117
|
+
ref: dragHandlerRef
|
6118
|
+
})), output, showCloseButton ? /*#__PURE__*/React__default.createElement(Close$3, null, /*#__PURE__*/React__default.createElement(IconButton, {
|
6119
|
+
appearance: "discrete",
|
6120
|
+
"aria-label": texts.drawer.close,
|
6121
|
+
className: "absolute top-0 right-0 mt-4 mr-2",
|
6122
|
+
icon: "close"
|
6123
|
+
})) : null);
|
6124
|
+
const styleProp = {
|
6125
|
+
...style,
|
6126
|
+
...{
|
6127
|
+
width: resizedWidth
|
6128
|
+
}
|
6129
|
+
};
|
6130
|
+
return focusTrap ? /*#__PURE__*/React__default.createElement(DialogPrimitive.Content, Object.assign({
|
6131
|
+
forceMount: true
|
6132
|
+
}, otherProps, {
|
6133
|
+
className: contentClassName,
|
6134
|
+
onEscapeKeyDown: handleEscapeKeyDown,
|
6135
|
+
onInteractOutside: variant === 'overlay' ? undefined : event => event.preventDefault(),
|
6136
|
+
onCloseAutoFocus: handleCloseAutoFocus,
|
6137
|
+
ref: ref,
|
6138
|
+
style: styleProp
|
6139
|
+
}), content) : /*#__PURE__*/React__default.createElement(UntrappedFocusDrawerContent, {
|
6140
|
+
onEscape: handleEscapeKeyDown,
|
6141
|
+
className: contentClassName,
|
6142
|
+
style: styleProp,
|
6143
|
+
ref: ref
|
6144
|
+
}, content);
|
6145
|
+
});
|
6146
|
+
const Content$5 = /*#__PURE__*/React__default.forwardRef(function Content(props, externalRef) {
|
6147
|
+
const {
|
6148
|
+
children
|
6149
|
+
} = props;
|
6150
|
+
return /*#__PURE__*/React__default.createElement(Portal, null, /*#__PURE__*/React__default.createElement(DrawerContent, Object.assign({}, props, {
|
6151
|
+
ref: externalRef
|
6152
|
+
}), children));
|
6153
|
+
});
|
6154
|
+
|
6155
|
+
const Trigger$4 = /*#__PURE__*/React.forwardRef(function DrawerTrigger(props, ref) {
|
6156
|
+
return /*#__PURE__*/React.createElement(DialogPrimitive.Trigger, Object.assign({}, props, {
|
6157
|
+
ref: ref,
|
6158
|
+
asChild: true
|
6159
|
+
}));
|
6160
|
+
});
|
6161
|
+
|
6162
|
+
const Outlet = /*#__PURE__*/React.forwardRef(function Outlet(props, ref) {
|
6163
|
+
const className = cn('h-full ml-auto overflow-hidden flex-shrink-0', props.className);
|
6164
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
|
6165
|
+
className: className,
|
6166
|
+
"data-taco": "drawer-outlet",
|
6167
|
+
ref: ref
|
6168
|
+
}));
|
6169
|
+
});
|
6170
|
+
// drawerStack getting set by previous drawer instance, to be able to close previous instance, when new instance getting opened.
|
6171
|
+
let drawerStack;
|
6172
|
+
const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(props, ref) {
|
6173
|
+
const {
|
6174
|
+
open: openProp,
|
6175
|
+
defaultOpen: defaultOpenProp,
|
6176
|
+
// if onChange is not provided, then replace it with empty function, needed for useControllableState
|
6177
|
+
onChange = () => {
|
6178
|
+
// do nothing.
|
6179
|
+
},
|
6180
|
+
variant = 'embedded',
|
6181
|
+
className,
|
6182
|
+
closeOnEscape = true,
|
6183
|
+
onResize,
|
6184
|
+
onClose,
|
6185
|
+
size = 'md',
|
6186
|
+
trigger,
|
6187
|
+
children,
|
6188
|
+
focusTrap = props.focusTrap === undefined && props.variant === 'overlay' ? true : props.focusTrap,
|
6189
|
+
showCloseButton = true,
|
6190
|
+
...otherProps
|
6191
|
+
} = props;
|
6192
|
+
const [open, setOpen] = reactUseControllableState.useControllableState({
|
6193
|
+
prop: openProp,
|
6194
|
+
defaultProp: defaultOpenProp,
|
6195
|
+
onChange
|
6196
|
+
});
|
6197
|
+
const [outlet, setOutlet] = React.useState();
|
6198
|
+
const context = React.useMemo(() => ({
|
6199
|
+
closeOnEscape,
|
6200
|
+
onClose,
|
6201
|
+
onResize,
|
6202
|
+
props: otherProps,
|
6203
|
+
size,
|
6204
|
+
ref,
|
6205
|
+
open,
|
6206
|
+
setOpen,
|
6207
|
+
variant,
|
6208
|
+
focusTrap,
|
6209
|
+
showCloseButton,
|
6210
|
+
outlet
|
6211
|
+
}), [closeOnEscape, open, setOpen, otherProps, variant, onResize, onClose, size, focusTrap, showCloseButton, outlet]);
|
6212
|
+
// this prevents two drawers being open at once and used when one drawer getting opened before another one got closed.
|
6213
|
+
const close = React.useCallback(() => {
|
6214
|
+
setOpen(false);
|
6215
|
+
onClose && onClose();
|
6216
|
+
}, []);
|
6217
|
+
React.useEffect(() => {
|
6218
|
+
var _document$querySelect;
|
6219
|
+
const outletElement = (_document$querySelect = document.querySelector('[data-taco="drawer-outlet"]')) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.body;
|
6220
|
+
setOutlet(outletElement);
|
6221
|
+
}, []);
|
6222
|
+
React.useEffect(() => {
|
6223
|
+
if (open) {
|
6224
|
+
// if drawerStack is defined, this means that another drawer was opened before
|
6225
|
+
if (drawerStack) {
|
6226
|
+
drawerStack();
|
6227
|
+
}
|
6228
|
+
drawerStack = close;
|
6229
|
+
} else {
|
6230
|
+
// if drawerStack is equal to current close callback,
|
6231
|
+
// this means that drawer getting closed completely instead of getting closed on re-open
|
6232
|
+
if (drawerStack === close) {
|
6233
|
+
drawerStack = undefined;
|
6234
|
+
}
|
6235
|
+
}
|
6236
|
+
}, [open]);
|
6237
|
+
return /*#__PURE__*/React.createElement(DrawerContext.Provider, {
|
6238
|
+
value: context
|
6239
|
+
}, /*#__PURE__*/React.createElement(DialogPrimitive.Root, {
|
6240
|
+
modal: variant === 'overlay' ? true : false,
|
6241
|
+
open: open,
|
6242
|
+
onOpenChange: setOpen
|
6243
|
+
}, trigger && /*#__PURE__*/React.createElement(Trigger$4, null, trigger), children));
|
6244
|
+
});
|
6245
|
+
Drawer.Trigger = Trigger$4;
|
6246
|
+
Drawer.Content = Content$5;
|
6247
|
+
Drawer.InnerContent = InnerContent;
|
6248
|
+
Drawer.Title = Title$2;
|
6249
|
+
Drawer.Footer = Footer$2;
|
6250
|
+
Drawer.Close = Close$3;
|
6251
|
+
Drawer.Actions = Actions;
|
6252
|
+
Drawer.Outlet = Outlet;
|
6253
|
+
|
5755
6254
|
const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5756
6255
|
const {
|
5757
6256
|
disabled,
|
@@ -5793,22 +6292,6 @@ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5793
6292
|
}));
|
5794
6293
|
});
|
5795
6294
|
|
5796
|
-
const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5797
|
-
const {
|
5798
|
-
as: Tag = 'span',
|
5799
|
-
orientation = 'horizontal',
|
5800
|
-
...otherProps
|
5801
|
-
} = props;
|
5802
|
-
const className = cn('flex ', 'gap-2', {
|
5803
|
-
'flex-col ': orientation === 'vertical'
|
5804
|
-
}, props.className);
|
5805
|
-
return /*#__PURE__*/React.createElement(Tag, Object.assign({}, otherProps, {
|
5806
|
-
className: className,
|
5807
|
-
"data-taco": "group",
|
5808
|
-
ref: ref
|
5809
|
-
}));
|
5810
|
-
});
|
5811
|
-
|
5812
6295
|
const HangerContext = /*#__PURE__*/React.createContext({
|
5813
6296
|
onClose: undefined,
|
5814
6297
|
props: {},
|
@@ -5831,14 +6314,14 @@ const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, extern
|
|
5831
6314
|
asChild: true
|
5832
6315
|
}), children);
|
5833
6316
|
});
|
5834
|
-
const Title$
|
6317
|
+
const Title$3 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
|
5835
6318
|
const className = cn('mb-1 text-base font-bold flex w-full', props.className);
|
5836
6319
|
return /*#__PURE__*/React.createElement("span", Object.assign({}, props, {
|
5837
6320
|
className: className,
|
5838
6321
|
ref: ref
|
5839
6322
|
}));
|
5840
6323
|
});
|
5841
|
-
const Content$
|
6324
|
+
const Content$6 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
|
5842
6325
|
const {
|
5843
6326
|
placement: side
|
5844
6327
|
} = props;
|
@@ -5897,8 +6380,8 @@ const Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
|
5897
6380
|
}, anchor && /*#__PURE__*/React.createElement(Anchor, null, anchor), children));
|
5898
6381
|
});
|
5899
6382
|
Hanger.Anchor = Anchor;
|
5900
|
-
Hanger.Content = Content$
|
5901
|
-
Hanger.Title = Title$
|
6383
|
+
Hanger.Content = Content$6;
|
6384
|
+
Hanger.Title = Title$3;
|
5902
6385
|
|
5903
6386
|
const UnstyledArrow$1 = /*#__PURE__*/React.forwardRef(function HoverCardArrow(props, ref) {
|
5904
6387
|
return /*#__PURE__*/React.createElement(HoverCardPrimitive.Arrow, {
|
@@ -5922,13 +6405,13 @@ const UnstyledArrow$1 = /*#__PURE__*/React.forwardRef(function HoverCardArrow(pr
|
|
5922
6405
|
})));
|
5923
6406
|
});
|
5924
6407
|
|
5925
|
-
const Trigger$
|
6408
|
+
const Trigger$5 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
|
5926
6409
|
return /*#__PURE__*/React.createElement(HoverCardPrimitive.Trigger, Object.assign({}, props, {
|
5927
6410
|
asChild: true,
|
5928
6411
|
ref: ref
|
5929
6412
|
}));
|
5930
6413
|
});
|
5931
|
-
const Content$
|
6414
|
+
const Content$7 = /*#__PURE__*/React.forwardRef(function HoverCardContent(props, ref) {
|
5932
6415
|
const {
|
5933
6416
|
placement: side
|
5934
6417
|
} = props;
|
@@ -5948,8 +6431,8 @@ const HoverCard = props => {
|
|
5948
6431
|
openDelay: 300
|
5949
6432
|
}));
|
5950
6433
|
};
|
5951
|
-
HoverCard.Trigger = Trigger$
|
5952
|
-
HoverCard.Content = Content$
|
6434
|
+
HoverCard.Trigger = Trigger$5;
|
6435
|
+
HoverCard.Content = Content$7;
|
5953
6436
|
|
5954
6437
|
const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
|
5955
6438
|
onSearch,
|
@@ -6407,12 +6890,7 @@ const MultiListbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref)
|
|
6407
6890
|
})));
|
6408
6891
|
});
|
6409
6892
|
|
6410
|
-
const
|
6411
|
-
const useCurrentMenu = () => {
|
6412
|
-
return React.useContext(MenuContext);
|
6413
|
-
};
|
6414
|
-
|
6415
|
-
const Content$7 = /*#__PURE__*/React.forwardRef(function MenuContent(props, ref) {
|
6893
|
+
const Content$8 = /*#__PURE__*/React.forwardRef(function MenuContent(props, ref) {
|
6416
6894
|
const internalRef = useMergedRef(ref);
|
6417
6895
|
const menu = useCurrentMenu();
|
6418
6896
|
const {
|
@@ -6545,7 +7023,7 @@ const Link = /*#__PURE__*/React.forwardRef(function MenuLink(props, ref) {
|
|
6545
7023
|
}), props.children));
|
6546
7024
|
});
|
6547
7025
|
|
6548
|
-
const Trigger$
|
7026
|
+
const Trigger$6 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref) {
|
6549
7027
|
const menu = useCurrentMenu();
|
6550
7028
|
const internalRef = useMergedRef(ref);
|
6551
7029
|
React.useEffect(() => {
|
@@ -6774,12 +7252,12 @@ const Menu$1 = /*#__PURE__*/React.forwardRef(function Menu(externalProps, ref) {
|
|
6774
7252
|
modal: false,
|
6775
7253
|
open: open,
|
6776
7254
|
onOpenChange: setOpen
|
6777
|
-
}), trigger && /*#__PURE__*/React.createElement(Trigger$
|
7255
|
+
}), trigger && /*#__PURE__*/React.createElement(Trigger$6, {
|
6778
7256
|
ref: ref
|
6779
7257
|
}, trigger), children));
|
6780
7258
|
});
|
6781
|
-
Menu$1.Trigger = Trigger$
|
6782
|
-
Menu$1.Content = Content$
|
7259
|
+
Menu$1.Trigger = Trigger$6;
|
7260
|
+
Menu$1.Content = Content$8;
|
6783
7261
|
Menu$1.Item = Item$1;
|
6784
7262
|
Menu$1.Link = Link;
|
6785
7263
|
Menu$1.Checkbox = Checkbox$1;
|
@@ -8013,7 +8491,7 @@ const Group$1 = /*#__PURE__*/React__default.forwardRef(function Listbox2Group(pr
|
|
8013
8491
|
const Listbox2GroupContext = /*#__PURE__*/React__default.createContext({});
|
8014
8492
|
const useListbox2GroupContext = () => React__default.useContext(Listbox2GroupContext);
|
8015
8493
|
|
8016
|
-
const Title$
|
8494
|
+
const Title$4 = /*#__PURE__*/React__default.forwardRef(function Listbox2Group(props, ref) {
|
8017
8495
|
const {
|
8018
8496
|
id: nativeId,
|
8019
8497
|
...otherProps
|
@@ -8373,14 +8851,14 @@ const Group$2 = /*#__PURE__*/React__default.forwardRef(function Select2Group(pro
|
|
8373
8851
|
return /*#__PURE__*/React__default.createElement(Group$1, Object.assign({}, attributes, {
|
8374
8852
|
className: className,
|
8375
8853
|
ref: ref
|
8376
|
-
}), /*#__PURE__*/React__default.createElement(Title$
|
8854
|
+
}), /*#__PURE__*/React__default.createElement(Title$4, {
|
8377
8855
|
className: "sticky top-0 bg-white px-2 font-bold leading-8"
|
8378
8856
|
}, heading), children);
|
8379
8857
|
});
|
8380
8858
|
|
8381
|
-
const Title$
|
8859
|
+
const Title$5 = /*#__PURE__*/React__default.forwardRef(function Select2Title(props, ref) {
|
8382
8860
|
const className = cn('flex items-center text-xs pl-2 h-8', props.className);
|
8383
|
-
return /*#__PURE__*/React__default.createElement(Title$
|
8861
|
+
return /*#__PURE__*/React__default.createElement(Title$4, Object.assign({}, props, {
|
8384
8862
|
className: className,
|
8385
8863
|
ref: ref
|
8386
8864
|
}));
|
@@ -8403,38 +8881,7 @@ const getIndexOfFirstChildOverflowingParent = (element, overscan = 0) => {
|
|
8403
8881
|
return boundaryChildIndex;
|
8404
8882
|
};
|
8405
8883
|
|
8406
|
-
const
|
8407
|
-
const className = cn(`flex select-none touch-none transition-colors hover:bg-grey`, {
|
8408
|
-
'w-[7px] hover:w-[14px] mr-[2px] hover:px-[2px] hover:mr-0': props.orientation === 'vertical',
|
8409
|
-
'flex-col h-[7px] hover:h-[14px] mb-[2px] hover:py-[2px] hover:mb-0': props.orientation === 'horizontal'
|
8410
|
-
});
|
8411
|
-
return /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Scrollbar, Object.assign({}, props, {
|
8412
|
-
className: className
|
8413
|
-
}));
|
8414
|
-
};
|
8415
|
-
const Thumb = props => /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Thumb, Object.assign({}, props, {
|
8416
|
-
className: "flex-[1] rounded bg-black opacity-50"
|
8417
|
-
}));
|
8418
|
-
const Corner = props => /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Corner, Object.assign({}, props, {
|
8419
|
-
classname: "bg-grey-500"
|
8420
|
-
}));
|
8421
|
-
const ScrollArea = props => {
|
8422
|
-
const {
|
8423
|
-
children,
|
8424
|
-
...otherProps
|
8425
|
-
} = props;
|
8426
|
-
return /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Root, Object.assign({}, otherProps, {
|
8427
|
-
className: cn('overflow-hidden', props.className)
|
8428
|
-
}), /*#__PURE__*/React__default.createElement(ScrollAreaPrimitive.Viewport, {
|
8429
|
-
className: "h-full w-full"
|
8430
|
-
}, children), /*#__PURE__*/React__default.createElement(Bar, {
|
8431
|
-
orientation: "vertical"
|
8432
|
-
}, /*#__PURE__*/React__default.createElement(Thumb, null)), /*#__PURE__*/React__default.createElement(Bar, {
|
8433
|
-
orientation: "horizontal"
|
8434
|
-
}, /*#__PURE__*/React__default.createElement(Thumb, null)), /*#__PURE__*/React__default.createElement(Corner, null));
|
8435
|
-
};
|
8436
|
-
|
8437
|
-
const Trigger$6 = /*#__PURE__*/React__default.forwardRef(function Select2Trigger(props, ref) {
|
8884
|
+
const Trigger$7 = /*#__PURE__*/React__default.forwardRef(function Select2Trigger(props, ref) {
|
8438
8885
|
const {
|
8439
8886
|
multiple,
|
8440
8887
|
value
|
@@ -9073,7 +9520,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
9073
9520
|
}), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Trigger, {
|
9074
9521
|
asChild: true,
|
9075
9522
|
"data-taco": "Select2"
|
9076
|
-
}, /*#__PURE__*/React__default.createElement(Trigger$
|
9523
|
+
}, /*#__PURE__*/React__default.createElement(Trigger$7, Object.assign({}, otherProps, {
|
9077
9524
|
"aria-haspopup": "listbox",
|
9078
9525
|
onBlur: handleBlur,
|
9079
9526
|
onKeyDown: handleKeyDown,
|
@@ -9124,7 +9571,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
9124
9571
|
});
|
9125
9572
|
Select2.Option = Option$1;
|
9126
9573
|
Select2.Group = Group$2;
|
9127
|
-
Select2.Title = Title$
|
9574
|
+
Select2.Title = Title$5;
|
9128
9575
|
const ControlledHiddenField = props => {
|
9129
9576
|
const {
|
9130
9577
|
emptyValue,
|
@@ -12174,7 +12621,7 @@ const HeaderMenu = ({
|
|
12174
12621
|
})) : null;
|
12175
12622
|
};
|
12176
12623
|
|
12177
|
-
const Footer$
|
12624
|
+
const Footer$3 = function Footer(props) {
|
12178
12625
|
const {
|
12179
12626
|
children,
|
12180
12627
|
footer,
|
@@ -13474,15 +13921,6 @@ const guessComparatorsBasedOnControl = (instance, control) => {
|
|
13474
13921
|
}
|
13475
13922
|
};
|
13476
13923
|
|
13477
|
-
const useGlobalKeyboardShortcut = handler => {
|
13478
|
-
React__default.useEffect(() => {
|
13479
|
-
document.addEventListener('keydown', handler);
|
13480
|
-
return () => {
|
13481
|
-
document.removeEventListener('keydown', handler);
|
13482
|
-
};
|
13483
|
-
}, [handler]);
|
13484
|
-
};
|
13485
|
-
|
13486
13924
|
const FiltersButton = ({
|
13487
13925
|
length,
|
13488
13926
|
table
|
@@ -14021,7 +14459,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
|
|
14021
14459
|
key: footerGroup.id,
|
14022
14460
|
role: "row",
|
14023
14461
|
className: "contents"
|
14024
|
-
}, footerGroup.headers.map((footer, cellIndex) => /*#__PURE__*/React__default.createElement(Footer$
|
14462
|
+
}, footerGroup.headers.map((footer, cellIndex) => /*#__PURE__*/React__default.createElement(Footer$3, {
|
14025
14463
|
key: footer.id,
|
14026
14464
|
footer: footer,
|
14027
14465
|
index: cellIndex,
|
@@ -14269,6 +14707,7 @@ const Button$3 = /*#__PURE__*/React__default.forwardRef(function Button(props, r
|
|
14269
14707
|
}, /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, attributes, {
|
14270
14708
|
appearance: "discrete",
|
14271
14709
|
className: className,
|
14710
|
+
"data-taco": "header-button",
|
14272
14711
|
ref: ref
|
14273
14712
|
})));
|
14274
14713
|
});
|
@@ -14290,6 +14729,7 @@ const Link$1 = /*#__PURE__*/React__default.forwardRef(function Link(props, ref)
|
|
14290
14729
|
const className = cn(getLinkClasses(icon), 'relative', props.className);
|
14291
14730
|
let link = /*#__PURE__*/React__default.createElement("a", Object.assign({}, otherProps, {
|
14292
14731
|
className: className,
|
14732
|
+
"data-taco": "header-link",
|
14293
14733
|
ref: ref,
|
14294
14734
|
tabIndex: 0
|
14295
14735
|
}), icon ? /*#__PURE__*/React__default.createElement(Icon, {
|
@@ -14515,6 +14955,7 @@ const MenuButton = /*#__PURE__*/React__default.forwardRef(function MenuButton(pr
|
|
14515
14955
|
const className = cn(getButtonClasses$1(), 'ml-1 -mr-1 !bg-transparent hover:!bg-white/[.08] focus:!bg-white/[.08]] lg:hidden');
|
14516
14956
|
return /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, props, {
|
14517
14957
|
className: className,
|
14958
|
+
"data-taco": "header-toggle-sidebar",
|
14518
14959
|
icon: "menu",
|
14519
14960
|
ref: ref
|
14520
14961
|
}));
|
@@ -14588,7 +15029,8 @@ const Image = /*#__PURE__*/React__default.forwardRef(function AccountImage(props
|
|
14588
15029
|
|
14589
15030
|
const Container$1 = props => {
|
14590
15031
|
return /*#__PURE__*/React__default.createElement("div", {
|
14591
|
-
className: "-ml-3 flex flex-shrink-0 flex-grow-0 items-center gap-2 xl:ml-auto xl:w-64 xl:pr-2"
|
15032
|
+
className: "-ml-3 flex flex-shrink-0 flex-grow-0 items-center gap-2 xl:ml-auto xl:w-64 xl:pr-2",
|
15033
|
+
"data-taco": "header-agreements"
|
14592
15034
|
}, /*#__PURE__*/React__default.createElement("span", {
|
14593
15035
|
className: "hidden h-8 w-px flex-shrink-0 flex-grow-0 bg-white/[0.3] xl:flex"
|
14594
15036
|
}), props.children);
|
@@ -14697,6 +15139,7 @@ const isCurrentAgreement = (agreement, currentAgreement) => {
|
|
14697
15139
|
const createAgreementButton = (agreement, fallbackImageSrc, onChangeAgreement, isCurrentAgreement = false) => /*#__PURE__*/React__default.createElement("button", {
|
14698
15140
|
"aria-current": isCurrentAgreement ? 'true' : undefined,
|
14699
15141
|
className: "focus:yt-focus-dark w-full rounded outline-none",
|
15142
|
+
"data-taco": "header-agreements-agreement",
|
14700
15143
|
key: `${agreement.number}_${agreement.userId}`,
|
14701
15144
|
onClick: () => onChangeAgreement(agreement),
|
14702
15145
|
onKeyDown: () => onChangeAgreement(agreement),
|
@@ -14729,7 +15172,7 @@ const LayoutContext = /*#__PURE__*/React__default.createContext({
|
|
14729
15172
|
setSidebarOpen: () => undefined
|
14730
15173
|
});
|
14731
15174
|
|
14732
|
-
const Content$
|
15175
|
+
const Content$9 = /*#__PURE__*/React__default.forwardRef(function LayoutContent(props, ref) {
|
14733
15176
|
const className = cn('flex-grow overflow-y-auto bg-white flex flex-shrink flex-col relative', props.className);
|
14734
15177
|
return /*#__PURE__*/React__default.createElement("main", Object.assign({}, props, {
|
14735
15178
|
className: className,
|
@@ -14861,7 +15304,7 @@ const Layout$1 = /*#__PURE__*/React__default.forwardRef(function Layout(props, r
|
|
14861
15304
|
Layout$1.Top = Top;
|
14862
15305
|
Layout$1.Page = Page;
|
14863
15306
|
Layout$1.Sidebar = Sidebar;
|
14864
|
-
Layout$1.Content = Content$
|
15307
|
+
Layout$1.Content = Content$9;
|
14865
15308
|
|
14866
15309
|
const Group$3 = /*#__PURE__*/React__default.forwardRef(function Group(props, ref) {
|
14867
15310
|
const {
|
@@ -14879,18 +15322,18 @@ const Group$3 = /*#__PURE__*/React__default.forwardRef(function Group(props, ref
|
|
14879
15322
|
onClick(event);
|
14880
15323
|
}
|
14881
15324
|
};
|
14882
|
-
return /*#__PURE__*/React__default.createElement("li", {
|
15325
|
+
return /*#__PURE__*/React__default.createElement("li", Object.assign({}, attributes, {
|
14883
15326
|
role: "none",
|
14884
|
-
className: "[[role=menubar]>&]:px-3"
|
14885
|
-
|
14886
|
-
|
15327
|
+
className: "[[role=menubar]>&]:px-3",
|
15328
|
+
ref: ref
|
15329
|
+
}), /*#__PURE__*/React__default.createElement("button", {
|
15330
|
+
"aria-haspopup": "true",
|
14887
15331
|
"aria-expanded": expanded,
|
14888
15332
|
"data-taco": "navigation2-group",
|
14889
15333
|
className: className,
|
14890
15334
|
onClick: handleClick,
|
14891
|
-
ref: ref,
|
14892
15335
|
role: "menuitem"
|
14893
|
-
}
|
15336
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
14894
15337
|
className: "-ml-2 !h-5 !w-5",
|
14895
15338
|
name: expanded ? 'chevron-down-solid' : 'chevron-right-solid'
|
14896
15339
|
}), /*#__PURE__*/React__default.createElement("span", {
|
@@ -14903,6 +15346,14 @@ const Group$3 = /*#__PURE__*/React__default.forwardRef(function Group(props, ref
|
|
14903
15346
|
}, children));
|
14904
15347
|
});
|
14905
15348
|
|
15349
|
+
const getAdjacentClasses = () => cn(
|
15350
|
+
// styling if the element is proceeded by a link item
|
15351
|
+
'[[role=menubar]>[data-taco=navigation2-link-item]+&]:mt-2', "[[role=menubar]>[data-taco='navigation2-link-item']+&]:border-t-2", "[[role=menubar]>[data-taco='navigation2-link-item']+&]:pt-2 ",
|
15352
|
+
// styling if the element is proceeded by content
|
15353
|
+
"[[role=menubar]>[data-taco='navigation2-content']+&]:border-t-2", "[[role=menubar]>[data-taco='navigation2-content']+&]:pt-2",
|
15354
|
+
// styling if the element is proceeded by a section
|
15355
|
+
"[[role=menubar]>[data-taco='navigation2-section']+&]:border-t-2", "[[role=menubar]>[data-taco='navigation2-section']+&]:pt-2");
|
15356
|
+
|
14906
15357
|
const getNavigationLinkClasses = (isDraggedOver = false) => cn('group relative flex w-full items-center rounded leading-8 !text-black px-2 focus-visible:yt-focus-dark',
|
14907
15358
|
// override styles for links that are children of collapsible menus
|
14908
15359
|
'font-bold [[role=menu]>li>&]:font-normal [[role=menu]>li>&]:pl-5',
|
@@ -14925,7 +15376,7 @@ const Link$2 = /*#__PURE__*/React__default.forwardRef(function Link(props, ref)
|
|
14925
15376
|
} = props;
|
14926
15377
|
const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);
|
14927
15378
|
const className = cn(getNavigationLinkClasses(isDraggedOver), attributes.className);
|
14928
|
-
const listClassName = cn('[[role=menubar]>&]:px-3', {
|
15379
|
+
const listClassName = cn('[[role=menubar]>&]:px-3 border-grey-200', getAdjacentClasses(), {
|
14929
15380
|
'[&>*]:pointer-events-none': isDraggedOver
|
14930
15381
|
});
|
14931
15382
|
return /*#__PURE__*/React__default.createElement("li", Object.assign({}, dropTargetProps, {
|
@@ -14971,7 +15422,7 @@ const Section = /*#__PURE__*/React__default.forwardRef(function Navigation2(prop
|
|
14971
15422
|
heading,
|
14972
15423
|
...attributes
|
14973
15424
|
} = props;
|
14974
|
-
const className = cn('w-full overflow-auto px-3 py-2 -
|
15425
|
+
const className = cn('w-full overflow-auto px-3 py-2 flex-grow border-grey-200 bg-grey-50 [[role=menubar]>&:first-child]:pt-0', getAdjacentClasses(), props.className);
|
14975
15426
|
return /*#__PURE__*/React__default.createElement("li", Object.assign({}, attributes, {
|
14976
15427
|
className: className,
|
14977
15428
|
"data-taco": "navigation2-section",
|
@@ -14984,12 +15435,12 @@ const Section = /*#__PURE__*/React__default.forwardRef(function Navigation2(prop
|
|
14984
15435
|
}, children));
|
14985
15436
|
});
|
14986
15437
|
|
14987
|
-
const Content$
|
15438
|
+
const Content$a = /*#__PURE__*/React__default.forwardRef(function Navigation2(props, ref) {
|
14988
15439
|
const {
|
14989
15440
|
children,
|
14990
15441
|
...attributes
|
14991
15442
|
} = props;
|
14992
|
-
const className = cn('w-full overflow-auto p-3 mt-auto border-grey-200 flex-shrink-0 z-10 bg-grey-50
|
15443
|
+
const className = cn('w-full overflow-auto p-3 mt-auto border-grey-200 flex-shrink-0 z-10 bg-grey-50 [[role=menubar]>&:last-child]:pb-0', getAdjacentClasses(), props.className);
|
14993
15444
|
return /*#__PURE__*/React__default.createElement("li", Object.assign({}, attributes, {
|
14994
15445
|
className: className,
|
14995
15446
|
"data-taco": "navigation2-content",
|
@@ -15003,7 +15454,7 @@ const Navigation2 = /*#__PURE__*/React__default.forwardRef(function Navigation2(
|
|
15003
15454
|
children,
|
15004
15455
|
...attributes
|
15005
15456
|
} = props;
|
15006
|
-
const className = cn('
|
15457
|
+
const className = cn('m-0 py-2 flex flex-col gap-y-px overflow-auto h-full w-full bg-grey-50', props.className);
|
15007
15458
|
return /*#__PURE__*/React__default.createElement("ul", Object.assign({}, attributes, {
|
15008
15459
|
className: className,
|
15009
15460
|
"data-taco": "navigation2",
|
@@ -15017,7 +15468,7 @@ const Navigation2 = /*#__PURE__*/React__default.forwardRef(function Navigation2(
|
|
15017
15468
|
Navigation2.Group = Group$3;
|
15018
15469
|
Navigation2.Link = Link$2;
|
15019
15470
|
Navigation2.Section = Section;
|
15020
|
-
Navigation2.Content = Content$
|
15471
|
+
Navigation2.Content = Content$a;
|
15021
15472
|
|
15022
15473
|
const useOnClickOutside = (ref, callback) => {
|
15023
15474
|
React__default.useEffect(() => {
|
@@ -15053,6 +15504,7 @@ exports.CollectionPrimitive = Collection;
|
|
15053
15504
|
exports.Combobox = Combobox;
|
15054
15505
|
exports.Datepicker = Datepicker;
|
15055
15506
|
exports.Dialog = Dialog;
|
15507
|
+
exports.Drawer = Drawer;
|
15056
15508
|
exports.Field = Field;
|
15057
15509
|
exports.Form = Form;
|
15058
15510
|
exports.Group = Group;
|
@@ -15087,7 +15539,7 @@ exports.Table2 = Table2;
|
|
15087
15539
|
exports.Tabs = Tabs;
|
15088
15540
|
exports.Tag = Tag$1;
|
15089
15541
|
exports.Textarea = Textarea;
|
15090
|
-
exports.Title = Title$
|
15542
|
+
exports.Title = Title$3;
|
15091
15543
|
exports.ToastProvider = ToastProvider;
|
15092
15544
|
exports.Tooltip = Tooltip;
|
15093
15545
|
exports.Tour = Tour;
|