@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.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useCallback, createContext, useMemo, createElement, useContext, forwardRef, Children, isValidElement, cloneElement, Fragment, useEffect, useRef, useState, useLayoutEffect, useReducer, Component } from 'react';
|
|
3
3
|
import * as ReactDOM from 'react-dom';
|
|
4
|
-
import { flushSync, createPortal } from 'react-dom';
|
|
4
|
+
import ReactDOM__default, { flushSync, createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @exports the browser id (i.e., 'IE 11' 'Chrome 90')
|
|
@@ -163,7 +163,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
163
163
|
}
|
|
164
164
|
return (React__default.createElement("button", { id: id, ...tooltipData, disabled: disabled, "data-testid": testId, type: type === 'link' || (type === 'submit' && browserIsFirefox) ? 'button' : type, onClick: (e) => {
|
|
165
165
|
stopPropagation && e.stopPropagation();
|
|
166
|
-
onClick && onClick();
|
|
166
|
+
onClick && onClick(e);
|
|
167
167
|
}, onMouseDown: (e) => {
|
|
168
168
|
if (preventBlur) {
|
|
169
169
|
e.preventDefault();
|
|
@@ -3265,6 +3265,14 @@ const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac
|
|
|
3265
3265
|
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
3266
3266
|
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
3267
3267
|
|
|
3268
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
3269
|
+
var _globalThis$document;
|
|
3270
|
+
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;
|
|
3271
|
+
return container ? /*#__PURE__*/ ReactDOM__default.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
3272
|
+
ref: forwardedRef
|
|
3273
|
+
})), container) : null;
|
|
3274
|
+
});
|
|
3275
|
+
|
|
3268
3276
|
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
3269
3277
|
return useReducer((state, event)=>{
|
|
3270
3278
|
const nextState = machine[state][event];
|
|
@@ -4265,7 +4273,7 @@ var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
|
4265
4273
|
|
|
4266
4274
|
var ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: SideCar }))); });
|
|
4267
4275
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
4268
|
-
var $
|
|
4276
|
+
var $67UHm$RemoveScroll = ReactRemoveScroll;
|
|
4269
4277
|
|
|
4270
4278
|
/* -------------------------------------------------------------------------------------------------
|
|
4271
4279
|
* Popover
|
|
@@ -4356,7 +4364,7 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ forwardRef((prop
|
|
|
4356
4364
|
const content = contentRef.current;
|
|
4357
4365
|
if (content) return hideOthers(content);
|
|
4358
4366
|
}, []);
|
|
4359
|
-
return /*#__PURE__*/ createElement($
|
|
4367
|
+
return /*#__PURE__*/ createElement($67UHm$RemoveScroll, {
|
|
4360
4368
|
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
4361
4369
|
allowPinchZoom: true
|
|
4362
4370
|
}, /*#__PURE__*/ createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends({}, props, {
|
|
@@ -4558,7 +4566,7 @@ const sizeClasses = {
|
|
|
4558
4566
|
* Textfield.
|
|
4559
4567
|
*/
|
|
4560
4568
|
const TextField = React__default.forwardRef((props, ref) => {
|
|
4561
|
-
const { readonly = false, onChange, onKeyUp, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, } = props;
|
|
4569
|
+
const { readonly = false, onChange, onKeyUp, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, required = false, } = props;
|
|
4562
4570
|
const internalRef = useRef(null);
|
|
4563
4571
|
const [cursor, setCursor] = useState(null);
|
|
4564
4572
|
const setAllRefs = (receivedRef) => {
|
|
@@ -4594,7 +4602,7 @@ const TextField = React__default.forwardRef((props, ref) => {
|
|
|
4594
4602
|
borderRadius = 'tw-rounded-r-sm tw-border-l-0 focus:tw-border-l active:tw-border-l';
|
|
4595
4603
|
}
|
|
4596
4604
|
const appliedClasses = `${baseClasses$3} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$1} ${darkTheme$1} ${borderRadius} ${showError ? errorClasses$2 : borderColorClasses$2} `;
|
|
4597
|
-
return (React__default.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 }));
|
|
4605
|
+
return (React__default.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 }));
|
|
4598
4606
|
});
|
|
4599
4607
|
|
|
4600
4608
|
const alignment = 'tw-flex';
|
|
@@ -9299,7 +9307,7 @@ var keyframes = function keyframes() {
|
|
|
9299
9307
|
};
|
|
9300
9308
|
};
|
|
9301
9309
|
|
|
9302
|
-
var classnames = function classnames(args) {
|
|
9310
|
+
var classnames$1 = function classnames(args) {
|
|
9303
9311
|
var len = args.length;
|
|
9304
9312
|
var i = 0;
|
|
9305
9313
|
var cls = '';
|
|
@@ -9403,7 +9411,7 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
9403
9411
|
args[_key2] = arguments[_key2];
|
|
9404
9412
|
}
|
|
9405
9413
|
|
|
9406
|
-
return merge(cache.registered, css, classnames(args));
|
|
9414
|
+
return merge(cache.registered, css, classnames$1(args));
|
|
9407
9415
|
};
|
|
9408
9416
|
|
|
9409
9417
|
var content = {
|
|
@@ -9485,7 +9493,7 @@ function applyPrefixToName(prefix, name) {
|
|
|
9485
9493
|
return prefix + '__' + name;
|
|
9486
9494
|
}
|
|
9487
9495
|
}
|
|
9488
|
-
function classNames(prefix, state) {
|
|
9496
|
+
function classNames$1(prefix, state) {
|
|
9489
9497
|
for (var _len = arguments.length, classNameList = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
9490
9498
|
classNameList[_key - 2] = arguments[_key];
|
|
9491
9499
|
}
|
|
@@ -12100,7 +12108,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
12100
12108
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12101
12109
|
args[_key] = arguments[_key];
|
|
12102
12110
|
}
|
|
12103
|
-
return classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
|
|
12111
|
+
return classNames$1.apply(void 0, [_this.props.classNamePrefix].concat(args));
|
|
12104
12112
|
};
|
|
12105
12113
|
_this.getOptionLabel = function (data) {
|
|
12106
12114
|
return getOptionLabel(_this.props, data);
|
|
@@ -13669,6 +13677,408 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
13669
13677
|
return creatable ? React__default.createElement(CreatableSelect$1, { ...props }) : React__default.createElement(StateManagedSelect$1, { ...props });
|
|
13670
13678
|
};
|
|
13671
13679
|
|
|
13680
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13681
|
+
* Dialog
|
|
13682
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
|
|
13683
|
+
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13684
|
+
const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
13685
|
+
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
|
|
13686
|
+
const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
13687
|
+
const triggerRef = useRef(null);
|
|
13688
|
+
const contentRef = useRef(null);
|
|
13689
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
13690
|
+
prop: openProp,
|
|
13691
|
+
defaultProp: defaultOpen,
|
|
13692
|
+
onChange: onOpenChange
|
|
13693
|
+
});
|
|
13694
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogProvider, {
|
|
13695
|
+
scope: __scopeDialog,
|
|
13696
|
+
triggerRef: triggerRef,
|
|
13697
|
+
contentRef: contentRef,
|
|
13698
|
+
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
13699
|
+
titleId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
13700
|
+
descriptionId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
13701
|
+
open: open,
|
|
13702
|
+
onOpenChange: setOpen,
|
|
13703
|
+
onOpenToggle: useCallback(()=>setOpen((prevOpen)=>!prevOpen
|
|
13704
|
+
)
|
|
13705
|
+
, [
|
|
13706
|
+
setOpen
|
|
13707
|
+
]),
|
|
13708
|
+
modal: modal
|
|
13709
|
+
}, children);
|
|
13710
|
+
};
|
|
13711
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13712
|
+
* DialogPortal
|
|
13713
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal';
|
|
13714
|
+
const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, {
|
|
13715
|
+
forceMount: undefined
|
|
13716
|
+
});
|
|
13717
|
+
const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
|
|
13718
|
+
const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
|
|
13719
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog);
|
|
13720
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
|
|
13721
|
+
scope: __scopeDialog,
|
|
13722
|
+
forceMount: forceMount
|
|
13723
|
+
}, Children.map(children, (child)=>/*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13724
|
+
present: forceMount || context.open
|
|
13725
|
+
}, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
13726
|
+
asChild: true,
|
|
13727
|
+
container: container
|
|
13728
|
+
}, child))
|
|
13729
|
+
));
|
|
13730
|
+
};
|
|
13731
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13732
|
+
* DialogOverlay
|
|
13733
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
|
|
13734
|
+
const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13735
|
+
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
|
13736
|
+
const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
|
|
13737
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
|
13738
|
+
return context.modal ? /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13739
|
+
present: forceMount || context.open
|
|
13740
|
+
}, /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, {
|
|
13741
|
+
ref: forwardedRef
|
|
13742
|
+
}))) : null;
|
|
13743
|
+
});
|
|
13744
|
+
const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13745
|
+
const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
|
|
13746
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
|
|
13747
|
+
return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
13748
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
13749
|
+
createElement($67UHm$RemoveScroll, {
|
|
13750
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
13751
|
+
allowPinchZoom: true,
|
|
13752
|
+
shards: [
|
|
13753
|
+
context.contentRef
|
|
13754
|
+
]
|
|
13755
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
13756
|
+
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
|
|
13757
|
+
}, overlayProps, {
|
|
13758
|
+
ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
|
|
13759
|
+
,
|
|
13760
|
+
style: {
|
|
13761
|
+
pointerEvents: 'auto',
|
|
13762
|
+
...overlayProps.style
|
|
13763
|
+
}
|
|
13764
|
+
}))));
|
|
13765
|
+
});
|
|
13766
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13767
|
+
* DialogContent
|
|
13768
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
|
|
13769
|
+
const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13770
|
+
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13771
|
+
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
13772
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13773
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
13774
|
+
present: forceMount || context.open
|
|
13775
|
+
}, context.modal ? /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
|
|
13776
|
+
ref: forwardedRef
|
|
13777
|
+
})) : /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, {
|
|
13778
|
+
ref: forwardedRef
|
|
13779
|
+
})));
|
|
13780
|
+
});
|
|
13781
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13782
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13783
|
+
const contentRef = useRef(null);
|
|
13784
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
13785
|
+
useEffect(()=>{
|
|
13786
|
+
const content = contentRef.current;
|
|
13787
|
+
if (content) return hideOthers(content);
|
|
13788
|
+
}, []);
|
|
13789
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
|
13790
|
+
ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
|
|
13791
|
+
,
|
|
13792
|
+
trapFocus: context.open,
|
|
13793
|
+
disableOutsidePointerEvents: true,
|
|
13794
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
13795
|
+
var _context$triggerRef$c;
|
|
13796
|
+
event.preventDefault();
|
|
13797
|
+
(_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
13798
|
+
}),
|
|
13799
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
13800
|
+
const originalEvent = event.detail.originalEvent;
|
|
13801
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
13802
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
|
|
13803
|
+
// it is effectively as if we right-clicked the `Overlay`.
|
|
13804
|
+
if (isRightClick) event.preventDefault();
|
|
13805
|
+
}) // When focus is trapped, a `focusout` event may still happen.
|
|
13806
|
+
,
|
|
13807
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
13808
|
+
)
|
|
13809
|
+
}));
|
|
13810
|
+
});
|
|
13811
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13812
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
13813
|
+
const hasInteractedOutsideRef = useRef(false);
|
|
13814
|
+
const hasPointerDownOutsideRef = useRef(false);
|
|
13815
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
|
13816
|
+
ref: forwardedRef,
|
|
13817
|
+
trapFocus: false,
|
|
13818
|
+
disableOutsidePointerEvents: false,
|
|
13819
|
+
onCloseAutoFocus: (event)=>{
|
|
13820
|
+
var _props$onCloseAutoFoc;
|
|
13821
|
+
(_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
|
|
13822
|
+
if (!event.defaultPrevented) {
|
|
13823
|
+
var _context$triggerRef$c2;
|
|
13824
|
+
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
|
|
13825
|
+
event.preventDefault();
|
|
13826
|
+
}
|
|
13827
|
+
hasInteractedOutsideRef.current = false;
|
|
13828
|
+
hasPointerDownOutsideRef.current = false;
|
|
13829
|
+
},
|
|
13830
|
+
onInteractOutside: (event)=>{
|
|
13831
|
+
var _props$onInteractOuts, _context$triggerRef$c3;
|
|
13832
|
+
(_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
|
|
13833
|
+
if (!event.defaultPrevented) {
|
|
13834
|
+
hasInteractedOutsideRef.current = true;
|
|
13835
|
+
if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
|
|
13836
|
+
} // Prevent dismissing when clicking the trigger.
|
|
13837
|
+
// As the trigger is already setup to close, without doing so would
|
|
13838
|
+
// cause it to close and immediately open.
|
|
13839
|
+
const target = event.target;
|
|
13840
|
+
const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
|
|
13841
|
+
if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
|
|
13842
|
+
// we will get the pointer down outside event on the trigger, but then a subsequent
|
|
13843
|
+
// focus outside event on the container, we ignore any focus outside event when we've
|
|
13844
|
+
// already had a pointer down outside event.
|
|
13845
|
+
if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
13846
|
+
}
|
|
13847
|
+
}));
|
|
13848
|
+
});
|
|
13849
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13850
|
+
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
|
13851
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
|
|
13852
|
+
const contentRef = useRef(null);
|
|
13853
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
13854
|
+
// the last element in the DOM (beacuse of the `Portal`)
|
|
13855
|
+
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
13856
|
+
return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
13857
|
+
asChild: true,
|
|
13858
|
+
loop: true,
|
|
13859
|
+
trapped: trapFocus,
|
|
13860
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
13861
|
+
onUnmountAutoFocus: onCloseAutoFocus
|
|
13862
|
+
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
|
13863
|
+
role: "dialog",
|
|
13864
|
+
id: context.contentId,
|
|
13865
|
+
"aria-describedby": context.descriptionId,
|
|
13866
|
+
"aria-labelledby": context.titleId,
|
|
13867
|
+
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
|
|
13868
|
+
}, contentProps, {
|
|
13869
|
+
ref: composedRefs,
|
|
13870
|
+
onDismiss: ()=>context.onOpenChange(false)
|
|
13871
|
+
}))), false);
|
|
13872
|
+
});
|
|
13873
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13874
|
+
* DialogTitle
|
|
13875
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle';
|
|
13876
|
+
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13877
|
+
const { __scopeDialog: __scopeDialog , ...titleProps } = props;
|
|
13878
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
|
|
13879
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
|
|
13880
|
+
id: context.titleId
|
|
13881
|
+
}, titleProps, {
|
|
13882
|
+
ref: forwardedRef
|
|
13883
|
+
}));
|
|
13884
|
+
});
|
|
13885
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13886
|
+
* DialogDescription
|
|
13887
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription';
|
|
13888
|
+
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13889
|
+
const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
|
|
13890
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
|
|
13891
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
|
|
13892
|
+
id: context.descriptionId
|
|
13893
|
+
}, descriptionProps, {
|
|
13894
|
+
ref: forwardedRef
|
|
13895
|
+
}));
|
|
13896
|
+
});
|
|
13897
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13898
|
+
* DialogClose
|
|
13899
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CLOSE_NAME = 'DialogClose';
|
|
13900
|
+
const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
13901
|
+
const { __scopeDialog: __scopeDialog , ...closeProps } = props;
|
|
13902
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
|
|
13903
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
13904
|
+
type: "button"
|
|
13905
|
+
}, closeProps, {
|
|
13906
|
+
ref: forwardedRef,
|
|
13907
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, ()=>context.onOpenChange(false)
|
|
13908
|
+
)
|
|
13909
|
+
}));
|
|
13910
|
+
});
|
|
13911
|
+
/* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) {
|
|
13912
|
+
return open ? 'open' : 'closed';
|
|
13913
|
+
}
|
|
13914
|
+
const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153;
|
|
13915
|
+
const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0;
|
|
13916
|
+
const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17;
|
|
13917
|
+
const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf;
|
|
13918
|
+
const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f7638e4a34b909;
|
|
13919
|
+
const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
|
|
13920
|
+
const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac;
|
|
13921
|
+
|
|
13922
|
+
var classnamesExports = {};
|
|
13923
|
+
var classnames = {
|
|
13924
|
+
get exports(){ return classnamesExports; },
|
|
13925
|
+
set exports(v){ classnamesExports = v; },
|
|
13926
|
+
};
|
|
13927
|
+
|
|
13928
|
+
/*!
|
|
13929
|
+
Copyright (c) 2018 Jed Watson.
|
|
13930
|
+
Licensed under the MIT License (MIT), see
|
|
13931
|
+
http://jedwatson.github.io/classnames
|
|
13932
|
+
*/
|
|
13933
|
+
|
|
13934
|
+
(function (module) {
|
|
13935
|
+
/* global define */
|
|
13936
|
+
|
|
13937
|
+
(function () {
|
|
13938
|
+
|
|
13939
|
+
var hasOwn = {}.hasOwnProperty;
|
|
13940
|
+
|
|
13941
|
+
function classNames() {
|
|
13942
|
+
var classes = [];
|
|
13943
|
+
|
|
13944
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
13945
|
+
var arg = arguments[i];
|
|
13946
|
+
if (!arg) continue;
|
|
13947
|
+
|
|
13948
|
+
var argType = typeof arg;
|
|
13949
|
+
|
|
13950
|
+
if (argType === 'string' || argType === 'number') {
|
|
13951
|
+
classes.push(arg);
|
|
13952
|
+
} else if (Array.isArray(arg)) {
|
|
13953
|
+
if (arg.length) {
|
|
13954
|
+
var inner = classNames.apply(null, arg);
|
|
13955
|
+
if (inner) {
|
|
13956
|
+
classes.push(inner);
|
|
13957
|
+
}
|
|
13958
|
+
}
|
|
13959
|
+
} else if (argType === 'object') {
|
|
13960
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
13961
|
+
classes.push(arg.toString());
|
|
13962
|
+
continue;
|
|
13963
|
+
}
|
|
13964
|
+
|
|
13965
|
+
for (var key in arg) {
|
|
13966
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
13967
|
+
classes.push(key);
|
|
13968
|
+
}
|
|
13969
|
+
}
|
|
13970
|
+
}
|
|
13971
|
+
}
|
|
13972
|
+
|
|
13973
|
+
return classes.join(' ');
|
|
13974
|
+
}
|
|
13975
|
+
|
|
13976
|
+
if (module.exports) {
|
|
13977
|
+
classNames.default = classNames;
|
|
13978
|
+
module.exports = classNames;
|
|
13979
|
+
} else {
|
|
13980
|
+
window.classNames = classNames;
|
|
13981
|
+
}
|
|
13982
|
+
}());
|
|
13983
|
+
} (classnames));
|
|
13984
|
+
|
|
13985
|
+
var classNames = classnamesExports;
|
|
13986
|
+
|
|
13987
|
+
const Dialog = $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9;
|
|
13988
|
+
const DialogPortal = $5d3850c4d0b4e6c7$export$602eac185826482c;
|
|
13989
|
+
const DialogClose = $5d3850c4d0b4e6c7$export$f39c2d165cd861fe;
|
|
13990
|
+
const DialogOverlay = React__default.forwardRef(({ className = '', ...props }, ref) => (React__default.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
|
|
13991
|
+
data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
13992
|
+
data-[state=open]:fade-in-0 ${className}`, ...props })));
|
|
13993
|
+
DialogOverlay.displayName = $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff.displayName;
|
|
13994
|
+
const DialogContent = React__default.forwardRef(({ className, children, ...props }, ref) => (React__default.createElement(DialogPortal, null,
|
|
13995
|
+
React__default.createElement(DialogOverlay, null),
|
|
13996
|
+
React__default.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
|
|
13997
|
+
tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
|
|
13998
|
+
tw-rounded-lg ${className}`, ...props }, children))));
|
|
13999
|
+
DialogContent.displayName = $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2.displayName;
|
|
14000
|
+
const DialogHeader = ({ className, ...props }) => (React__default.createElement("div", { className: "tw-w-full tw-justify-between" },
|
|
14001
|
+
React__default.createElement("div", { className: `flex flex-col space-y-1.5 text-center sm:text-left ${className}`, ...props })));
|
|
14002
|
+
DialogHeader.displayName = 'DialogHeader';
|
|
14003
|
+
const DialogFooter = ({ className, ...props }) => (React__default.createElement("div", { className: `flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${className}`, ...props }));
|
|
14004
|
+
DialogFooter.displayName = 'DialogFooter';
|
|
14005
|
+
const DialogTitle = React__default.forwardRef(({ className, ...props }, ref) => (React__default.createElement($5d3850c4d0b4e6c7$export$f99233281efd08a0, { ref: ref, className: `text-lg font-semibold leading-none tracking-tight ${className}`, ...props })));
|
|
14006
|
+
DialogTitle.displayName = $5d3850c4d0b4e6c7$export$f99233281efd08a0.displayName;
|
|
14007
|
+
const DialogDescription = React__default.forwardRef(({ className, ...props }, ref) => (React__default.createElement($5d3850c4d0b4e6c7$export$393edc798c47379d, { ref: ref, className: `text-sm text-muted-foreground ${className}`, ...props })));
|
|
14008
|
+
DialogDescription.displayName = $5d3850c4d0b4e6c7$export$393edc798c47379d.displayName;
|
|
14009
|
+
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__default.createElement(React__default.Fragment, null), customButtonVariant = 'outline', }) => {
|
|
14010
|
+
// the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
|
|
14011
|
+
useEffect(() => {
|
|
14012
|
+
if (open) {
|
|
14013
|
+
// Pushing the change to the end of the call stack
|
|
14014
|
+
const timer = setTimeout(() => {
|
|
14015
|
+
document.body.style.pointerEvents = '';
|
|
14016
|
+
}, 0);
|
|
14017
|
+
return () => clearTimeout(timer);
|
|
14018
|
+
}
|
|
14019
|
+
else {
|
|
14020
|
+
document.body.style.pointerEvents = 'auto';
|
|
14021
|
+
}
|
|
14022
|
+
}, [open]);
|
|
14023
|
+
const renderTitle = () => {
|
|
14024
|
+
let titleIconElement = React__default.createElement(React__default.Fragment, null);
|
|
14025
|
+
if (titleIcon) {
|
|
14026
|
+
if (typeof titleIcon === 'string') {
|
|
14027
|
+
titleIconElement =
|
|
14028
|
+
React__default.createElement(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" });
|
|
14029
|
+
}
|
|
14030
|
+
else {
|
|
14031
|
+
titleIconElement = React__default.createElement("div", { className: "tw-mt-1.5" }, titleIcon);
|
|
14032
|
+
}
|
|
14033
|
+
}
|
|
14034
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
14035
|
+
titleIcon && titleIconPosition === 'left' ?
|
|
14036
|
+
React__default.createElement("div", { className: "tw-flex tw-mr-2" }, titleIconElement) :
|
|
14037
|
+
React__default.createElement(React__default.Fragment, null),
|
|
14038
|
+
React__default.createElement(DialogTitle, { asChild: true }, isTitleEditable ? (React__default.createElement("div", { className: "tw-flex tw-w-full tw-items-center" },
|
|
14039
|
+
React__default.createElement(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }),
|
|
14040
|
+
titleError && React__default.createElement("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0" }, titleError))) :
|
|
14041
|
+
customHeader ?? (React__default.createElement("div", { "data-testid": "modalTitle", className: "modal-title" },
|
|
14042
|
+
React__default.createElement("div", { className: "tw-flex tw-items-center" },
|
|
14043
|
+
React__default.createElement("h3", null, title),
|
|
14044
|
+
titleSuffixLabel &&
|
|
14045
|
+
React__default.createElement("span", { className: "tw-text-xl tw-pl-0.5" }, titleSuffixLabel)),
|
|
14046
|
+
subtitle &&
|
|
14047
|
+
React__default.createElement("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle" }, subtitle)))),
|
|
14048
|
+
titleIcon && titleIconPosition === 'right' ?
|
|
14049
|
+
React__default.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React__default.createElement(React__default.Fragment, null)));
|
|
14050
|
+
};
|
|
14051
|
+
return open ? (React__default.createElement(Dialog, { open: true, onOpenChange: onClose, modal: true },
|
|
14052
|
+
React__default.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`, {
|
|
14053
|
+
'tw-max-w-xs': size === 'xs',
|
|
14054
|
+
'tw-max-w-sm': size === 'sm',
|
|
14055
|
+
'tw-max-w-md': size === 'md',
|
|
14056
|
+
'tw-max-w-lg': size === 'lg',
|
|
14057
|
+
'tw-max-w-xl': size === 'xl',
|
|
14058
|
+
'tw-max-w-2xl': size === '2xl',
|
|
14059
|
+
'tw-max-w-3xl': size === '3xl',
|
|
14060
|
+
'tw-max-w-4xl': size === '4xl',
|
|
14061
|
+
'tw-max-w-5xl': size === '5xl',
|
|
14062
|
+
'tw-max-w-6xl': size === '6xl',
|
|
14063
|
+
}, dialogClassName) },
|
|
14064
|
+
React__default.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" },
|
|
14065
|
+
React__default.createElement("div", { className: "tw-flex tw-w-full" }, renderTitle()),
|
|
14066
|
+
!hideCloseIcon && React__default.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" },
|
|
14067
|
+
React__default.createElement("span", { className: "tw-cursor-pointer" }, "\u00D7"))),
|
|
14068
|
+
React__default.createElement(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true }, children),
|
|
14069
|
+
!hideFooterButtons && React__default.createElement(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4" }, modalFooter ??
|
|
14070
|
+
React__default.createElement("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter" },
|
|
14071
|
+
React__default.createElement("div", { className: "tw-flex tw-justify-start" }, customButton &&
|
|
14072
|
+
React__default.createElement(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-w-24", testId: "customButton", variant: customButtonVariant })),
|
|
14073
|
+
React__default.createElement("div", { className: "tw-flex tw-justify-end" },
|
|
14074
|
+
React__default.createElement("div", { className: "tw-flex tw-items-center" }, middleFooterSection),
|
|
14075
|
+
!hideCancelButton &&
|
|
14076
|
+
React__default.createElement(DialogClose, { asChild: true },
|
|
14077
|
+
React__default.createElement(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-2 tw-w-24", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" })),
|
|
14078
|
+
!hideSubmitButton &&
|
|
14079
|
+
React__default.createElement(Button, { label: submitButtonLabel, onClick: onSubmit, disabled: disableSubmitButton, variant: "theme", stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, testId: "submitButton", extraClassNames: "tw-w-24" }))))))) : React__default.createElement(React__default.Fragment, null);
|
|
14080
|
+
};
|
|
14081
|
+
|
|
13672
14082
|
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
13673
14083
|
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
13674
14084
|
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
@@ -14129,14 +14539,14 @@ const $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d
|
|
|
14129
14539
|
const $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba;
|
|
14130
14540
|
const $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;
|
|
14131
14541
|
|
|
14132
|
-
const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames, testId, id, }) => {
|
|
14542
|
+
const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames, testId, id, stretchTabs = false, }) => {
|
|
14133
14543
|
const handleTabSelect = (tabId) => {
|
|
14134
14544
|
if (activeTab === tabId)
|
|
14135
14545
|
return;
|
|
14136
14546
|
onTabSelect && onTabSelect(tabId);
|
|
14137
14547
|
};
|
|
14138
|
-
return (React__default.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 },
|
|
14139
|
-
React__default.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, { className: `tw-
|
|
14548
|
+
return (React__default.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 },
|
|
14549
|
+
React__default.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__default.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
|
|
14140
14550
|
? 'tw-border-b-sq-color-dark dark:tw-border-b-sq-color-dark tw-border-b-[3px]'
|
|
14141
14551
|
: '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 },
|
|
14142
14552
|
React__default.createElement("span", null,
|
|
@@ -14144,9 +14554,8 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
14144
14554
|
React__default.createElement("span", { className: `tw-text-[14px] tw-font-medium ${activeTab === id
|
|
14145
14555
|
? 'dark:tw-text-sq-dark-text tw-text-gray-500'
|
|
14146
14556
|
: 'dark:tw-text-sq-color-dark-dark tw-text-sq-color-dark'}` }, label)))))),
|
|
14147
|
-
tabs.map((tab, index) => (React__default.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { key: `${tab.label}_${index}_content`, value: tab.id },
|
|
14148
|
-
React__default.createElement("div", { className: "tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-4" }, tab.content))))));
|
|
14557
|
+
tabs.map((tab, index) => (React__default.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)))));
|
|
14149
14558
|
};
|
|
14150
14559
|
|
|
14151
|
-
export { Button, Checkbox, Icon, QTip, Select, Tabs, TextArea, TextField, ToolbarButton, Tooltip };
|
|
14560
|
+
export { Button, Checkbox, Icon, Modal, QTip, Select, Tabs, TextArea, TextField, ToolbarButton, Tooltip };
|
|
14152
14561
|
//# sourceMappingURL=index.esm.js.map
|