@seeqdev/qomponents 0.0.45 → 0.0.47
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/Button/Button.types.d.ts +2 -1
- package/dist/Modal/Modal.d.ts +5 -0
- package/dist/Modal/Modal.stories.d.ts +10 -0
- package/dist/Modal/Modal.test.d.ts +1 -0
- package/dist/Modal/Modal.types.d.ts +44 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Tabs/Tabs.types.d.ts +5 -3
- package/dist/TextField/TextField.types.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +425 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +424 -14
- package/dist/index.js.map +1 -1
- package/dist/styles.css +287 -5
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -183,7 +183,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
183
183
|
}
|
|
184
184
|
return (React.createElement("button", { id: id, ...tooltipData, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
|
|
185
185
|
stopPropagation && e.stopPropagation();
|
|
186
|
-
onClick && onClick();
|
|
186
|
+
onClick && onClick(e);
|
|
187
187
|
}, onMouseDown: (e) => {
|
|
188
188
|
if (preventBlur) {
|
|
189
189
|
e.preventDefault();
|
|
@@ -3285,6 +3285,14 @@ const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac
|
|
|
3285
3285
|
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
3286
3286
|
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
3287
3287
|
|
|
3288
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
3289
|
+
var _globalThis$document;
|
|
3290
|
+
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
3291
|
+
return container ? /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
3292
|
+
ref: forwardedRef
|
|
3293
|
+
})), container) : null;
|
|
3294
|
+
});
|
|
3295
|
+
|
|
3288
3296
|
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
3289
3297
|
return React.useReducer((state, event)=>{
|
|
3290
3298
|
const nextState = machine[state][event];
|
|
@@ -4285,7 +4293,7 @@ var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
|
4285
4293
|
|
|
4286
4294
|
var ReactRemoveScroll = React__namespace.forwardRef(function (props, ref) { return (React__namespace.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: SideCar }))); });
|
|
4287
4295
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
4288
|
-
var $
|
|
4296
|
+
var $67UHm$RemoveScroll = ReactRemoveScroll;
|
|
4289
4297
|
|
|
4290
4298
|
/* -------------------------------------------------------------------------------------------------
|
|
4291
4299
|
* Popover
|
|
@@ -4376,7 +4384,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef
|
|
|
4376
4384
|
const content = contentRef.current;
|
|
4377
4385
|
if (content) return hideOthers(content);
|
|
4378
4386
|
}, []);
|
|
4379
|
-
return /*#__PURE__*/ React.createElement($
|
|
4387
|
+
return /*#__PURE__*/ React.createElement($67UHm$RemoveScroll, {
|
|
4380
4388
|
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
4381
4389
|
allowPinchZoom: true
|
|
4382
4390
|
}, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends({}, props, {
|
|
@@ -4578,7 +4586,7 @@ const sizeClasses = {
|
|
|
4578
4586
|
* Textfield.
|
|
4579
4587
|
*/
|
|
4580
4588
|
const TextField = React.forwardRef((props, ref) => {
|
|
4581
|
-
const { readonly = false, onChange, onKeyUp, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, } = props;
|
|
4589
|
+
const { readonly = false, onChange, onKeyUp, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, required = false, } = props;
|
|
4582
4590
|
const internalRef = React.useRef(null);
|
|
4583
4591
|
const [cursor, setCursor] = React.useState(null);
|
|
4584
4592
|
const setAllRefs = (receivedRef) => {
|
|
@@ -4614,7 +4622,7 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
4614
4622
|
borderRadius = 'tw-rounded-r-sm tw-border-l-0 focus:tw-border-l active:tw-border-l';
|
|
4615
4623
|
}
|
|
4616
4624
|
const appliedClasses = `${baseClasses$3} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$1} ${darkTheme$1} ${borderRadius} ${showError ? errorClasses$2 : borderColorClasses$2} `;
|
|
4617
|
-
return (React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, autoComplete: "none", onChange: handleChange, onKeyUp: onKeyUp, step: step }));
|
|
4625
|
+
return (React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: readonly, autoComplete: "none", onChange: handleChange, onKeyUp: onKeyUp, step: step, required: required }));
|
|
4618
4626
|
});
|
|
4619
4627
|
|
|
4620
4628
|
const alignment = 'tw-flex';
|
|
@@ -9319,7 +9327,7 @@ var keyframes = function keyframes() {
|
|
|
9319
9327
|
};
|
|
9320
9328
|
};
|
|
9321
9329
|
|
|
9322
|
-
var classnames = function classnames(args) {
|
|
9330
|
+
var classnames$1 = function classnames(args) {
|
|
9323
9331
|
var len = args.length;
|
|
9324
9332
|
var i = 0;
|
|
9325
9333
|
var cls = '';
|
|
@@ -9423,7 +9431,7 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
9423
9431
|
args[_key2] = arguments[_key2];
|
|
9424
9432
|
}
|
|
9425
9433
|
|
|
9426
|
-
return merge(cache.registered, css, classnames(args));
|
|
9434
|
+
return merge(cache.registered, css, classnames$1(args));
|
|
9427
9435
|
};
|
|
9428
9436
|
|
|
9429
9437
|
var content = {
|
|
@@ -9505,7 +9513,7 @@ function applyPrefixToName(prefix, name) {
|
|
|
9505
9513
|
return prefix + '__' + name;
|
|
9506
9514
|
}
|
|
9507
9515
|
}
|
|
9508
|
-
function classNames(prefix, state) {
|
|
9516
|
+
function classNames$1(prefix, state) {
|
|
9509
9517
|
for (var _len = arguments.length, classNameList = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
9510
9518
|
classNameList[_key - 2] = arguments[_key];
|
|
9511
9519
|
}
|
|
@@ -12120,7 +12128,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
12120
12128
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12121
12129
|
args[_key] = arguments[_key];
|
|
12122
12130
|
}
|
|
12123
|
-
return classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
|
|
12131
|
+
return classNames$1.apply(void 0, [_this.props.classNamePrefix].concat(args));
|
|
12124
12132
|
};
|
|
12125
12133
|
_this.getOptionLabel = function (data) {
|
|
12126
12134
|
return getOptionLabel(_this.props, data);
|
|
@@ -13689,6 +13697,408 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13689
13697
|
return creatable ? React.createElement(CreatableSelect$1, { ...props }) : React.createElement(StateManagedSelect$1, { ...props });
|
|
13690
13698
|
};
|
|
13691
13699
|
|
|
13700
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13701
|
+
* Dialog
|
|
13702
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
|
|
13703
|
+
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13704
|
+
const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13705
|
+
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
|
|
13706
|
+
const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
13707
|
+
const triggerRef = React.useRef(null);
|
|
13708
|
+
const contentRef = React.useRef(null);
|
|
13709
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
13710
|
+
prop: openProp,
|
|
13711
|
+
defaultProp: defaultOpen,
|
|
13712
|
+
onChange: onOpenChange
|
|
13713
|
+
});
|
|
13714
|
+
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogProvider, {
|
|
13715
|
+
scope: __scopeDialog,
|
|
13716
|
+
triggerRef: triggerRef,
|
|
13717
|
+
contentRef: contentRef,
|
|
13718
|
+
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
13719
|
+
titleId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
13720
|
+
descriptionId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
13721
|
+
open: open,
|
|
13722
|
+
onOpenChange: setOpen,
|
|
13723
|
+
onOpenToggle: React.useCallback(()=>setOpen((prevOpen)=>!prevOpen
|
|
13724
|
+
)
|
|
13725
|
+
, [
|
|
13726
|
+
setOpen
|
|
13727
|
+
]),
|
|
13728
|
+
modal: modal
|
|
13729
|
+
}, children);
|
|
13730
|
+
};
|
|
13731
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13732
|
+
* DialogPortal
|
|
13733
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal';
|
|
13734
|
+
const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, {
|
|
13735
|
+
forceMount: undefined
|
|
13736
|
+
});
|
|
13737
|
+
const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
|
|
13738
|
+
const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
|
|
13739
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog);
|
|
13740
|
+
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
|
|
13741
|
+
scope: __scopeDialog,
|
|
13742
|
+
forceMount: forceMount
|
|
13743
|
+
}, React.Children.map(children, (child)=>/*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13744
|
+
present: forceMount || context.open
|
|
13745
|
+
}, /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
13746
|
+
asChild: true,
|
|
13747
|
+
container: container
|
|
13748
|
+
}, child))
|
|
13749
|
+
));
|
|
13750
|
+
};
|
|
13751
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13752
|
+
* DialogOverlay
|
|
13753
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
|
|
13754
|
+
const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13755
|
+
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
|
13756
|
+
const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
|
|
13757
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
|
13758
|
+
return context.modal ? /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13759
|
+
present: forceMount || context.open
|
|
13760
|
+
}, /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, {
|
|
13761
|
+
ref: forwardedRef
|
|
13762
|
+
}))) : null;
|
|
13763
|
+
});
|
|
13764
|
+
const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13765
|
+
const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
|
|
13766
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
|
|
13767
|
+
return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
13768
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
13769
|
+
React.createElement($67UHm$RemoveScroll, {
|
|
13770
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
13771
|
+
allowPinchZoom: true,
|
|
13772
|
+
shards: [
|
|
13773
|
+
context.contentRef
|
|
13774
|
+
]
|
|
13775
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
13776
|
+
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
|
|
13777
|
+
}, overlayProps, {
|
|
13778
|
+
ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
|
|
13779
|
+
,
|
|
13780
|
+
style: {
|
|
13781
|
+
pointerEvents: 'auto',
|
|
13782
|
+
...overlayProps.style
|
|
13783
|
+
}
|
|
13784
|
+
}))));
|
|
13785
|
+
});
|
|
13786
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13787
|
+
* DialogContent
|
|
13788
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
|
|
13789
|
+
const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13790
|
+
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13791
|
+
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
13792
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13793
|
+
return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13794
|
+
present: forceMount || context.open
|
|
13795
|
+
}, context.modal ? /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
|
|
13796
|
+
ref: forwardedRef
|
|
13797
|
+
})) : /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, {
|
|
13798
|
+
ref: forwardedRef
|
|
13799
|
+
})));
|
|
13800
|
+
});
|
|
13801
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13802
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13803
|
+
const contentRef = React.useRef(null);
|
|
13804
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
13805
|
+
React.useEffect(()=>{
|
|
13806
|
+
const content = contentRef.current;
|
|
13807
|
+
if (content) return hideOthers(content);
|
|
13808
|
+
}, []);
|
|
13809
|
+
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
|
13810
|
+
ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
|
|
13811
|
+
,
|
|
13812
|
+
trapFocus: context.open,
|
|
13813
|
+
disableOutsidePointerEvents: true,
|
|
13814
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
13815
|
+
var _context$triggerRef$c;
|
|
13816
|
+
event.preventDefault();
|
|
13817
|
+
(_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
13818
|
+
}),
|
|
13819
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
13820
|
+
const originalEvent = event.detail.originalEvent;
|
|
13821
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
13822
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
|
|
13823
|
+
// it is effectively as if we right-clicked the `Overlay`.
|
|
13824
|
+
if (isRightClick) event.preventDefault();
|
|
13825
|
+
}) // When focus is trapped, a `focusout` event may still happen.
|
|
13826
|
+
,
|
|
13827
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
13828
|
+
)
|
|
13829
|
+
}));
|
|
13830
|
+
});
|
|
13831
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13832
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13833
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
13834
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
|
13835
|
+
return /*#__PURE__*/ React.createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
|
13836
|
+
ref: forwardedRef,
|
|
13837
|
+
trapFocus: false,
|
|
13838
|
+
disableOutsidePointerEvents: false,
|
|
13839
|
+
onCloseAutoFocus: (event)=>{
|
|
13840
|
+
var _props$onCloseAutoFoc;
|
|
13841
|
+
(_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
|
|
13842
|
+
if (!event.defaultPrevented) {
|
|
13843
|
+
var _context$triggerRef$c2;
|
|
13844
|
+
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
|
|
13845
|
+
event.preventDefault();
|
|
13846
|
+
}
|
|
13847
|
+
hasInteractedOutsideRef.current = false;
|
|
13848
|
+
hasPointerDownOutsideRef.current = false;
|
|
13849
|
+
},
|
|
13850
|
+
onInteractOutside: (event)=>{
|
|
13851
|
+
var _props$onInteractOuts, _context$triggerRef$c3;
|
|
13852
|
+
(_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
|
|
13853
|
+
if (!event.defaultPrevented) {
|
|
13854
|
+
hasInteractedOutsideRef.current = true;
|
|
13855
|
+
if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
|
|
13856
|
+
} // Prevent dismissing when clicking the trigger.
|
|
13857
|
+
// As the trigger is already setup to close, without doing so would
|
|
13858
|
+
// cause it to close and immediately open.
|
|
13859
|
+
const target = event.target;
|
|
13860
|
+
const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
|
|
13861
|
+
if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
|
|
13862
|
+
// we will get the pointer down outside event on the trigger, but then a subsequent
|
|
13863
|
+
// focus outside event on the container, we ignore any focus outside event when we've
|
|
13864
|
+
// already had a pointer down outside event.
|
|
13865
|
+
if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
13866
|
+
}
|
|
13867
|
+
}));
|
|
13868
|
+
});
|
|
13869
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13870
|
+
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
|
13871
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
|
|
13872
|
+
const contentRef = React.useRef(null);
|
|
13873
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
13874
|
+
// the last element in the DOM (beacuse of the `Portal`)
|
|
13875
|
+
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
13876
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
13877
|
+
asChild: true,
|
|
13878
|
+
loop: true,
|
|
13879
|
+
trapped: trapFocus,
|
|
13880
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
13881
|
+
onUnmountAutoFocus: onCloseAutoFocus
|
|
13882
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
|
13883
|
+
role: "dialog",
|
|
13884
|
+
id: context.contentId,
|
|
13885
|
+
"aria-describedby": context.descriptionId,
|
|
13886
|
+
"aria-labelledby": context.titleId,
|
|
13887
|
+
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
|
|
13888
|
+
}, contentProps, {
|
|
13889
|
+
ref: composedRefs,
|
|
13890
|
+
onDismiss: ()=>context.onOpenChange(false)
|
|
13891
|
+
}))), false);
|
|
13892
|
+
});
|
|
13893
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13894
|
+
* DialogTitle
|
|
13895
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle';
|
|
13896
|
+
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13897
|
+
const { __scopeDialog: __scopeDialog , ...titleProps } = props;
|
|
13898
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
|
|
13899
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
|
|
13900
|
+
id: context.titleId
|
|
13901
|
+
}, titleProps, {
|
|
13902
|
+
ref: forwardedRef
|
|
13903
|
+
}));
|
|
13904
|
+
});
|
|
13905
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13906
|
+
* DialogDescription
|
|
13907
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription';
|
|
13908
|
+
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13909
|
+
const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
|
|
13910
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
|
|
13911
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
|
|
13912
|
+
id: context.descriptionId
|
|
13913
|
+
}, descriptionProps, {
|
|
13914
|
+
ref: forwardedRef
|
|
13915
|
+
}));
|
|
13916
|
+
});
|
|
13917
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13918
|
+
* DialogClose
|
|
13919
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CLOSE_NAME = 'DialogClose';
|
|
13920
|
+
const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
13921
|
+
const { __scopeDialog: __scopeDialog , ...closeProps } = props;
|
|
13922
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
|
|
13923
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
13924
|
+
type: "button"
|
|
13925
|
+
}, closeProps, {
|
|
13926
|
+
ref: forwardedRef,
|
|
13927
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>context.onOpenChange(false)
|
|
13928
|
+
)
|
|
13929
|
+
}));
|
|
13930
|
+
});
|
|
13931
|
+
/* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) {
|
|
13932
|
+
return open ? 'open' : 'closed';
|
|
13933
|
+
}
|
|
13934
|
+
const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153;
|
|
13935
|
+
const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0;
|
|
13936
|
+
const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17;
|
|
13937
|
+
const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf;
|
|
13938
|
+
const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f7638e4a34b909;
|
|
13939
|
+
const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
|
|
13940
|
+
const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac;
|
|
13941
|
+
|
|
13942
|
+
var classnamesExports = {};
|
|
13943
|
+
var classnames = {
|
|
13944
|
+
get exports(){ return classnamesExports; },
|
|
13945
|
+
set exports(v){ classnamesExports = v; },
|
|
13946
|
+
};
|
|
13947
|
+
|
|
13948
|
+
/*!
|
|
13949
|
+
Copyright (c) 2018 Jed Watson.
|
|
13950
|
+
Licensed under the MIT License (MIT), see
|
|
13951
|
+
http://jedwatson.github.io/classnames
|
|
13952
|
+
*/
|
|
13953
|
+
|
|
13954
|
+
(function (module) {
|
|
13955
|
+
/* global define */
|
|
13956
|
+
|
|
13957
|
+
(function () {
|
|
13958
|
+
|
|
13959
|
+
var hasOwn = {}.hasOwnProperty;
|
|
13960
|
+
|
|
13961
|
+
function classNames() {
|
|
13962
|
+
var classes = [];
|
|
13963
|
+
|
|
13964
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
13965
|
+
var arg = arguments[i];
|
|
13966
|
+
if (!arg) continue;
|
|
13967
|
+
|
|
13968
|
+
var argType = typeof arg;
|
|
13969
|
+
|
|
13970
|
+
if (argType === 'string' || argType === 'number') {
|
|
13971
|
+
classes.push(arg);
|
|
13972
|
+
} else if (Array.isArray(arg)) {
|
|
13973
|
+
if (arg.length) {
|
|
13974
|
+
var inner = classNames.apply(null, arg);
|
|
13975
|
+
if (inner) {
|
|
13976
|
+
classes.push(inner);
|
|
13977
|
+
}
|
|
13978
|
+
}
|
|
13979
|
+
} else if (argType === 'object') {
|
|
13980
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
13981
|
+
classes.push(arg.toString());
|
|
13982
|
+
continue;
|
|
13983
|
+
}
|
|
13984
|
+
|
|
13985
|
+
for (var key in arg) {
|
|
13986
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
13987
|
+
classes.push(key);
|
|
13988
|
+
}
|
|
13989
|
+
}
|
|
13990
|
+
}
|
|
13991
|
+
}
|
|
13992
|
+
|
|
13993
|
+
return classes.join(' ');
|
|
13994
|
+
}
|
|
13995
|
+
|
|
13996
|
+
if (module.exports) {
|
|
13997
|
+
classNames.default = classNames;
|
|
13998
|
+
module.exports = classNames;
|
|
13999
|
+
} else {
|
|
14000
|
+
window.classNames = classNames;
|
|
14001
|
+
}
|
|
14002
|
+
}());
|
|
14003
|
+
} (classnames));
|
|
14004
|
+
|
|
14005
|
+
var classNames = classnamesExports;
|
|
14006
|
+
|
|
14007
|
+
const Dialog = $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9;
|
|
14008
|
+
const DialogPortal = $5d3850c4d0b4e6c7$export$602eac185826482c;
|
|
14009
|
+
const DialogClose = $5d3850c4d0b4e6c7$export$f39c2d165cd861fe;
|
|
14010
|
+
const DialogOverlay = React.forwardRef(({ className = '', ...props }, ref) => (React.createElement($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { ref: ref, className: `tw-pointer-events-none tw-fixed tw-w-full tw-h-full tw-opacity-50 tw-inset-0 tw-z-[1000] tw-bg-sq-dark-background
|
|
14011
|
+
data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
14012
|
+
data-[state=open]:fade-in-0 ${className}`, ...props })));
|
|
14013
|
+
DialogOverlay.displayName = $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff.displayName;
|
|
14014
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DialogPortal, null,
|
|
14015
|
+
React.createElement(DialogOverlay, null),
|
|
14016
|
+
React.createElement($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { ref: ref, className: `tw-fixed tw-left-[50%] tw-top-0 tw-my-6 tw-translate-x-[-50%] tw-z-[1001] tw-grid
|
|
14017
|
+
tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
|
|
14018
|
+
tw-rounded-lg ${className}`, ...props }, children))));
|
|
14019
|
+
DialogContent.displayName = $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2.displayName;
|
|
14020
|
+
const DialogHeader = ({ className, ...props }) => (React.createElement("div", { className: "tw-w-full tw-justify-between" },
|
|
14021
|
+
React.createElement("div", { className: `flex flex-col space-y-1.5 text-center sm:text-left ${className}`, ...props })));
|
|
14022
|
+
DialogHeader.displayName = 'DialogHeader';
|
|
14023
|
+
const DialogFooter = ({ className, ...props }) => (React.createElement("div", { className: `flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${className}`, ...props }));
|
|
14024
|
+
DialogFooter.displayName = 'DialogFooter';
|
|
14025
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (React.createElement($5d3850c4d0b4e6c7$export$f99233281efd08a0, { ref: ref, className: `text-lg font-semibold leading-none tracking-tight ${className}`, ...props })));
|
|
14026
|
+
DialogTitle.displayName = $5d3850c4d0b4e6c7$export$f99233281efd08a0.displayName;
|
|
14027
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (React.createElement($5d3850c4d0b4e6c7$export$393edc798c47379d, { ref: ref, className: `text-sm text-muted-foreground ${className}`, ...props })));
|
|
14028
|
+
DialogDescription.displayName = $5d3850c4d0b4e6c7$export$393edc798c47379d.displayName;
|
|
14029
|
+
const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React.createElement(React.Fragment, null), customButtonVariant = 'outline', }) => {
|
|
14030
|
+
// the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
|
|
14031
|
+
React.useEffect(() => {
|
|
14032
|
+
if (open) {
|
|
14033
|
+
// Pushing the change to the end of the call stack
|
|
14034
|
+
const timer = setTimeout(() => {
|
|
14035
|
+
document.body.style.pointerEvents = '';
|
|
14036
|
+
}, 0);
|
|
14037
|
+
return () => clearTimeout(timer);
|
|
14038
|
+
}
|
|
14039
|
+
else {
|
|
14040
|
+
document.body.style.pointerEvents = 'auto';
|
|
14041
|
+
}
|
|
14042
|
+
}, [open]);
|
|
14043
|
+
const renderTitle = () => {
|
|
14044
|
+
let titleIconElement = React.createElement(React.Fragment, null);
|
|
14045
|
+
if (titleIcon) {
|
|
14046
|
+
if (typeof titleIcon === 'string') {
|
|
14047
|
+
titleIconElement =
|
|
14048
|
+
React.createElement(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" });
|
|
14049
|
+
}
|
|
14050
|
+
else {
|
|
14051
|
+
titleIconElement = React.createElement("div", { className: "tw-mt-1.5" }, titleIcon);
|
|
14052
|
+
}
|
|
14053
|
+
}
|
|
14054
|
+
return (React.createElement(React.Fragment, null,
|
|
14055
|
+
titleIcon && titleIconPosition === 'left' ?
|
|
14056
|
+
React.createElement("div", { className: "tw-flex tw-mr-2" }, titleIconElement) :
|
|
14057
|
+
React.createElement(React.Fragment, null),
|
|
14058
|
+
React.createElement(DialogTitle, { asChild: true }, isTitleEditable ? (React.createElement("div", { className: "tw-flex tw-w-full tw-items-center" },
|
|
14059
|
+
React.createElement(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }),
|
|
14060
|
+
titleError && React.createElement("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0" }, titleError))) :
|
|
14061
|
+
customHeader ?? (React.createElement("div", { "data-testid": "modalTitle", className: "modal-title" },
|
|
14062
|
+
React.createElement("div", { className: "tw-flex tw-items-center" },
|
|
14063
|
+
React.createElement("h3", null, title),
|
|
14064
|
+
titleSuffixLabel &&
|
|
14065
|
+
React.createElement("span", { className: "tw-text-xl tw-pl-0.5" }, titleSuffixLabel)),
|
|
14066
|
+
subtitle &&
|
|
14067
|
+
React.createElement("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle" }, subtitle)))),
|
|
14068
|
+
titleIcon && titleIconPosition === 'right' ?
|
|
14069
|
+
React.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React.createElement(React.Fragment, null)));
|
|
14070
|
+
};
|
|
14071
|
+
return open ? (React.createElement(Dialog, { open: true, onOpenChange: onClose, modal: true },
|
|
14072
|
+
React.createElement(DialogContent, { onPointerDownOutside: (e) => e.preventDefault(), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
|
|
14073
|
+
'tw-max-w-xs': size === 'xs',
|
|
14074
|
+
'tw-max-w-sm': size === 'sm',
|
|
14075
|
+
'tw-max-w-md': size === 'md',
|
|
14076
|
+
'tw-max-w-lg': size === 'lg',
|
|
14077
|
+
'tw-max-w-xl': size === 'xl',
|
|
14078
|
+
'tw-max-w-2xl': size === '2xl',
|
|
14079
|
+
'tw-max-w-3xl': size === '3xl',
|
|
14080
|
+
'tw-max-w-4xl': size === '4xl',
|
|
14081
|
+
'tw-max-w-5xl': size === '5xl',
|
|
14082
|
+
'tw-max-w-6xl': size === '6xl',
|
|
14083
|
+
}, dialogClassName) },
|
|
14084
|
+
React.createElement(DialogHeader, { className: "modal-header tw-flex tw-w-full tw-justify-between tw-border-sq-disabled-gray\n dark:tw-border-sq-dark-disabled-gray tw-border-0 tw-border-b tw-px-6 tw-py-4" },
|
|
14085
|
+
React.createElement("div", { className: "tw-flex tw-w-full" }, renderTitle()),
|
|
14086
|
+
!hideCloseIcon && React.createElement(DialogClose, { autoFocus: false, className: "[&:has(:focus-visible)]:none tw-opacity-70 tw-bg-transparent hover:tw-opacity-100 close tw-cursor-pointer tw-ml-4", "data-testid": "closeButton" },
|
|
14087
|
+
React.createElement("span", { className: "tw-cursor-pointer" }, "\u00D7"))),
|
|
14088
|
+
React.createElement(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true }, children),
|
|
14089
|
+
!hideFooterButtons && React.createElement(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4" }, modalFooter ??
|
|
14090
|
+
React.createElement("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter" },
|
|
14091
|
+
React.createElement("div", { className: "tw-flex tw-justify-start" }, customButton &&
|
|
14092
|
+
React.createElement(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-w-24", testId: "customButton", variant: customButtonVariant })),
|
|
14093
|
+
React.createElement("div", { className: "tw-flex tw-justify-end" },
|
|
14094
|
+
React.createElement("div", { className: "tw-flex tw-items-center" }, middleFooterSection),
|
|
14095
|
+
!hideCancelButton &&
|
|
14096
|
+
React.createElement(DialogClose, { asChild: true },
|
|
14097
|
+
React.createElement(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-2 tw-w-24", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" })),
|
|
14098
|
+
!hideSubmitButton &&
|
|
14099
|
+
React.createElement(Button, { label: submitButtonLabel, onClick: onSubmit, disabled: disableSubmitButton, variant: "theme", stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, testId: "submitButton", extraClassNames: "tw-w-24" }))))))) : React.createElement(React.Fragment, null);
|
|
14100
|
+
};
|
|
14101
|
+
|
|
13692
14102
|
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
13693
14103
|
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
13694
14104
|
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
@@ -14149,14 +14559,14 @@ const $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d
|
|
|
14149
14559
|
const $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba;
|
|
14150
14560
|
const $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;
|
|
14151
14561
|
|
|
14152
|
-
const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames, testId, id, }) => {
|
|
14562
|
+
const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames, testId, id, stretchTabs = false, }) => {
|
|
14153
14563
|
const handleTabSelect = (tabId) => {
|
|
14154
14564
|
if (activeTab === tabId)
|
|
14155
14565
|
return;
|
|
14156
14566
|
onTabSelect && onTabSelect(tabId);
|
|
14157
14567
|
};
|
|
14158
|
-
return (React.createElement($69cb30bb0017df05$export$be92b6f5f03c0fe9, { className: `tw-flex tw-flex-col tw-min-w-[300px] ${extraClassNames || ''}`, defaultValue: defaultActiveTab, "data-testid": testId, id: id, value: activeTab, onValueChange: handleTabSelect },
|
|
14159
|
-
React.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, { className: `tw-
|
|
14568
|
+
return (React.createElement($69cb30bb0017df05$export$be92b6f5f03c0fe9, { className: `tw-flex tw-flex-col tw-min-w-[300px] tw-max-w-full h-full ${extraClassNames || ''}`, defaultValue: defaultActiveTab, "data-testid": testId, id: id, value: activeTab, onValueChange: handleTabSelect },
|
|
14569
|
+
React.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, { className: `tw-flex tw-flex-row tw-flex-wrap tw-z-[1001]` }, tabs.map(({ id, icon, label, tabExtraClassNames, testId: tabsTestId, disabled }, index) => (React.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-h-[45px] tw-min-w-[100px] tw-px-4 tw-border-solid dark:tw-border-gray-700 tw-flex tw-flex-1 tw-justify-center tw-items-center tw-border-r-[2px] last:tw-border-r-0 ${stretchTabs ? '' : 'tw-max-w-max tw-min-w-fit'} ${tabExtraClassNames || ''} ${activeTab === id
|
|
14160
14570
|
? 'tw-border-b-sq-color-dark dark:tw-border-b-sq-color-dark tw-border-b-[3px]'
|
|
14161
14571
|
: 'hover:tw-bg-sq-light-gray tw-border-b-[1px] hover:dark:tw-bg-gray-700'}`, "data-testid": tabsTestId, disabled: disabled, key: `${label}-${id}-${index}`, value: id },
|
|
14162
14572
|
React.createElement("span", null,
|
|
@@ -14164,13 +14574,13 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
14164
14574
|
React.createElement("span", { className: `tw-text-[14px] tw-font-medium ${activeTab === id
|
|
14165
14575
|
? 'dark:tw-text-sq-dark-text tw-text-gray-500'
|
|
14166
14576
|
: 'dark:tw-text-sq-color-dark-dark tw-text-sq-color-dark'}` }, label)))))),
|
|
14167
|
-
tabs.map((tab, index) => (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { key: `${tab.label}_${index}_content`, value: tab.id },
|
|
14168
|
-
React.createElement("div", { className: "tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-4" }, tab.content))))));
|
|
14577
|
+
tabs.map((tab, index) => (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-h-full tw-overflow-y-auto -tw-mt-[1px] tw-border-t-[1px] tw-z-[500] ${tab.tabContentExtraClassNames || ''}`, key: `${tab.label}_${index}_content`, value: tab.id }, tab.content)))));
|
|
14169
14578
|
};
|
|
14170
14579
|
|
|
14171
14580
|
exports.Button = Button;
|
|
14172
14581
|
exports.Checkbox = Checkbox;
|
|
14173
14582
|
exports.Icon = Icon;
|
|
14583
|
+
exports.Modal = Modal;
|
|
14174
14584
|
exports.QTip = QTip;
|
|
14175
14585
|
exports.Select = Select;
|
|
14176
14586
|
exports.Tabs = Tabs;
|