@seeqdev/qomponents 0.0.54 → 0.0.56

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/index.js CHANGED
@@ -14537,6 +14537,404 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
14537
14537
  tabs.map((tab, index) => (React.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-overflow-y-auto -tw-mt-[1px] tw-border-t-[1px] tw-z-[500] tw-flex tw-flex-col tw-flex-grow ${tab.tabContentExtraClassNames || ''}`, key: `${tab.label}_${index}_content`, value: tab.id }, tab.content)))));
14538
14538
  };
14539
14539
 
14540
+ /* -------------------------------------------------------------------------------------------------
14541
+ * Collapsible
14542
+ * -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$COLLAPSIBLE_NAME = 'Collapsible';
14543
+ const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
14544
+ const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
14545
+ const $409067139f391064$export$6eb0f7ddcda6131f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14546
+ const { __scopeCollapsible: __scopeCollapsible , open: openProp , defaultOpen: defaultOpen , disabled: disabled , onOpenChange: onOpenChange , ...collapsibleProps } = props;
14547
+ const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
14548
+ prop: openProp,
14549
+ defaultProp: defaultOpen,
14550
+ onChange: onOpenChange
14551
+ });
14552
+ return /*#__PURE__*/ React.createElement($409067139f391064$var$CollapsibleProvider, {
14553
+ scope: __scopeCollapsible,
14554
+ disabled: disabled,
14555
+ contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
14556
+ open: open,
14557
+ onOpenToggle: React.useCallback(()=>setOpen((prevOpen)=>!prevOpen
14558
+ )
14559
+ , [
14560
+ setOpen
14561
+ ])
14562
+ }, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
14563
+ "data-state": $409067139f391064$var$getState(open),
14564
+ "data-disabled": disabled ? '' : undefined
14565
+ }, collapsibleProps, {
14566
+ ref: forwardedRef
14567
+ })));
14568
+ });
14569
+ /* -------------------------------------------------------------------------------------------------
14570
+ * CollapsibleTrigger
14571
+ * -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$TRIGGER_NAME = 'CollapsibleTrigger';
14572
+ const $409067139f391064$export$c135dce7b15bbbdc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14573
+ const { __scopeCollapsible: __scopeCollapsible , ...triggerProps } = props;
14574
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
14575
+ return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
14576
+ type: "button",
14577
+ "aria-controls": context.contentId,
14578
+ "aria-expanded": context.open || false,
14579
+ "data-state": $409067139f391064$var$getState(context.open),
14580
+ "data-disabled": context.disabled ? '' : undefined,
14581
+ disabled: context.disabled
14582
+ }, triggerProps, {
14583
+ ref: forwardedRef,
14584
+ onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
14585
+ }));
14586
+ });
14587
+ /* -------------------------------------------------------------------------------------------------
14588
+ * CollapsibleContent
14589
+ * -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$CONTENT_NAME = 'CollapsibleContent';
14590
+ const $409067139f391064$export$aadde00976f34151 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14591
+ const { forceMount: forceMount , ...contentProps } = props;
14592
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
14593
+ return /*#__PURE__*/ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
14594
+ present: forceMount || context.open
14595
+ }, ({ present: present })=>/*#__PURE__*/ React.createElement($409067139f391064$var$CollapsibleContentImpl, _extends({}, contentProps, {
14596
+ ref: forwardedRef,
14597
+ present: present
14598
+ }))
14599
+ );
14600
+ });
14601
+ /* -----------------------------------------------------------------------------------------------*/ const $409067139f391064$var$CollapsibleContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14602
+ const { __scopeCollapsible: __scopeCollapsible , present: present , children: children , ...contentProps } = props;
14603
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
14604
+ const [isPresent, setIsPresent] = React.useState(present);
14605
+ const ref = React.useRef(null);
14606
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
14607
+ const heightRef = React.useRef(0);
14608
+ const height = heightRef.current;
14609
+ const widthRef = React.useRef(0);
14610
+ const width = widthRef.current; // when opening we want it to immediately open to retrieve dimensions
14611
+ // when closing we delay `present` to retrieve dimensions before closing
14612
+ const isOpen = context.open || isPresent;
14613
+ const isMountAnimationPreventedRef = React.useRef(isOpen);
14614
+ const originalStylesRef = React.useRef();
14615
+ React.useEffect(()=>{
14616
+ const rAF = requestAnimationFrame(()=>isMountAnimationPreventedRef.current = false
14617
+ );
14618
+ return ()=>cancelAnimationFrame(rAF)
14619
+ ;
14620
+ }, []);
14621
+ $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
14622
+ const node = ref.current;
14623
+ if (node) {
14624
+ originalStylesRef.current = originalStylesRef.current || {
14625
+ transitionDuration: node.style.transitionDuration,
14626
+ animationName: node.style.animationName
14627
+ }; // block any animations/transitions so the element renders at its full dimensions
14628
+ node.style.transitionDuration = '0s';
14629
+ node.style.animationName = 'none'; // get width and height from full dimensions
14630
+ const rect = node.getBoundingClientRect();
14631
+ heightRef.current = rect.height;
14632
+ widthRef.current = rect.width; // kick off any animations/transitions that were originally set up if it isn't the initial mount
14633
+ if (!isMountAnimationPreventedRef.current) {
14634
+ node.style.transitionDuration = originalStylesRef.current.transitionDuration;
14635
+ node.style.animationName = originalStylesRef.current.animationName;
14636
+ }
14637
+ setIsPresent(present);
14638
+ }
14639
+ /**
14640
+ * depends on `context.open` because it will change to `false`
14641
+ * when a close is triggered but `present` will be `false` on
14642
+ * animation end (so when close finishes). This allows us to
14643
+ * retrieve the dimensions *before* closing.
14644
+ */ }, [
14645
+ context.open,
14646
+ present
14647
+ ]);
14648
+ return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
14649
+ "data-state": $409067139f391064$var$getState(context.open),
14650
+ "data-disabled": context.disabled ? '' : undefined,
14651
+ id: context.contentId,
14652
+ hidden: !isOpen
14653
+ }, contentProps, {
14654
+ ref: composedRefs,
14655
+ style: {
14656
+ [`--radix-collapsible-content-height`]: height ? `${height}px` : undefined,
14657
+ [`--radix-collapsible-content-width`]: width ? `${width}px` : undefined,
14658
+ ...props.style
14659
+ }
14660
+ }), isOpen && children);
14661
+ });
14662
+ /* -----------------------------------------------------------------------------------------------*/ function $409067139f391064$var$getState(open) {
14663
+ return open ? 'open' : 'closed';
14664
+ }
14665
+ const $409067139f391064$export$be92b6f5f03c0fe9 = $409067139f391064$export$6eb0f7ddcda6131f;
14666
+ const $409067139f391064$export$41fb9f06171c75f4 = $409067139f391064$export$c135dce7b15bbbdc;
14667
+ const $409067139f391064$export$7c6e2c02157bb7d2 = $409067139f391064$export$aadde00976f34151;
14668
+
14669
+ /* -------------------------------------------------------------------------------------------------
14670
+ * Accordion
14671
+ * -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$ACCORDION_NAME = 'Accordion';
14672
+ const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
14673
+ 'Home',
14674
+ 'End',
14675
+ 'ArrowDown',
14676
+ 'ArrowUp',
14677
+ 'ArrowLeft',
14678
+ 'ArrowRight'
14679
+ ];
14680
+ const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
14681
+ const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
14682
+ $1bf158f521e1b1b4$var$createCollectionScope,
14683
+ $409067139f391064$export$952b32dcbe73087a
14684
+ ]);
14685
+ const $1bf158f521e1b1b4$var$useCollapsibleScope = $409067139f391064$export$952b32dcbe73087a();
14686
+ const $1bf158f521e1b1b4$export$a766cd26d0d69044 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14687
+ const { type: type , ...accordionProps } = props;
14688
+ const singleProps = accordionProps;
14689
+ const multipleProps = accordionProps;
14690
+ return /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$Collection.Provider, {
14691
+ scope: props.__scopeAccordion
14692
+ }, type === 'multiple' ? /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionImplMultiple, _extends({}, multipleProps, {
14693
+ ref: forwardedRef
14694
+ })) : /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionImplSingle, _extends({}, singleProps, {
14695
+ ref: forwardedRef
14696
+ })));
14697
+ });
14698
+ $1bf158f521e1b1b4$export$a766cd26d0d69044.propTypes = {
14699
+ type (props) {
14700
+ const value = props.value || props.defaultValue;
14701
+ if (props.type && ![
14702
+ 'single',
14703
+ 'multiple'
14704
+ ].includes(props.type)) return new Error('Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.');
14705
+ if (props.type === 'multiple' && typeof value === 'string') return new Error('Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.');
14706
+ if (props.type === 'single' && Array.isArray(value)) return new Error('Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.');
14707
+ return null;
14708
+ }
14709
+ };
14710
+ /* -----------------------------------------------------------------------------------------------*/ const [$1bf158f521e1b1b4$var$AccordionValueProvider, $1bf158f521e1b1b4$var$useAccordionValueContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
14711
+ const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var$useAccordionCollapsibleContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, {
14712
+ collapsible: false
14713
+ });
14714
+ const $1bf158f521e1b1b4$var$AccordionImplSingle = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14715
+ const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , collapsible: collapsible = false , ...accordionSingleProps } = props;
14716
+ const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
14717
+ prop: valueProp,
14718
+ defaultProp: defaultValue,
14719
+ onChange: onValueChange
14720
+ });
14721
+ return /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
14722
+ scope: props.__scopeAccordion,
14723
+ value: value ? [
14724
+ value
14725
+ ] : [],
14726
+ onItemOpen: setValue,
14727
+ onItemClose: React.useCallback(()=>collapsible && setValue('')
14728
+ , [
14729
+ collapsible,
14730
+ setValue
14731
+ ])
14732
+ }, /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
14733
+ scope: props.__scopeAccordion,
14734
+ collapsible: collapsible
14735
+ }, /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends({}, accordionSingleProps, {
14736
+ ref: forwardedRef
14737
+ }))));
14738
+ });
14739
+ /* -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$AccordionImplMultiple = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14740
+ const { value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange = ()=>{} , ...accordionMultipleProps } = props;
14741
+ const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
14742
+ prop: valueProp,
14743
+ defaultProp: defaultValue,
14744
+ onChange: onValueChange
14745
+ });
14746
+ const handleItemOpen = React.useCallback((itemValue)=>setValue((prevValue = [])=>[
14747
+ ...prevValue,
14748
+ itemValue
14749
+ ]
14750
+ )
14751
+ , [
14752
+ setValue
14753
+ ]);
14754
+ const handleItemClose = React.useCallback((itemValue)=>setValue((prevValue = [])=>prevValue.filter((value)=>value !== itemValue
14755
+ )
14756
+ )
14757
+ , [
14758
+ setValue
14759
+ ]);
14760
+ return /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
14761
+ scope: props.__scopeAccordion,
14762
+ value: value1,
14763
+ onItemOpen: handleItemOpen,
14764
+ onItemClose: handleItemClose
14765
+ }, /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
14766
+ scope: props.__scopeAccordion,
14767
+ collapsible: true
14768
+ }, /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends({}, accordionMultipleProps, {
14769
+ ref: forwardedRef
14770
+ }))));
14771
+ });
14772
+ /* -----------------------------------------------------------------------------------------------*/ const [$1bf158f521e1b1b4$var$AccordionImplProvider, $1bf158f521e1b1b4$var$useAccordionContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
14773
+ const $1bf158f521e1b1b4$var$AccordionImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14774
+ const { __scopeAccordion: __scopeAccordion , disabled: disabled , dir: dir , orientation: orientation = 'vertical' , ...accordionProps } = props;
14775
+ const accordionRef = React.useRef(null);
14776
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
14777
+ const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
14778
+ const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
14779
+ const isDirectionLTR = direction === 'ltr';
14780
+ const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
14781
+ var _triggerCollection$cl;
14782
+ if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key)) return;
14783
+ const target = event.target;
14784
+ const triggerCollection = getItems().filter((item)=>{
14785
+ var _item$ref$current;
14786
+ return !((_item$ref$current = item.ref.current) !== null && _item$ref$current !== void 0 && _item$ref$current.disabled);
14787
+ });
14788
+ const triggerIndex = triggerCollection.findIndex((item)=>item.ref.current === target
14789
+ );
14790
+ const triggerCount = triggerCollection.length;
14791
+ if (triggerIndex === -1) return; // Prevents page scroll while user is navigating
14792
+ event.preventDefault();
14793
+ let nextIndex = triggerIndex;
14794
+ const homeIndex = 0;
14795
+ const endIndex = triggerCount - 1;
14796
+ const moveNext = ()=>{
14797
+ nextIndex = triggerIndex + 1;
14798
+ if (nextIndex > endIndex) nextIndex = homeIndex;
14799
+ };
14800
+ const movePrev = ()=>{
14801
+ nextIndex = triggerIndex - 1;
14802
+ if (nextIndex < homeIndex) nextIndex = endIndex;
14803
+ };
14804
+ switch(event.key){
14805
+ case 'Home':
14806
+ nextIndex = homeIndex;
14807
+ break;
14808
+ case 'End':
14809
+ nextIndex = endIndex;
14810
+ break;
14811
+ case 'ArrowRight':
14812
+ if (orientation === 'horizontal') {
14813
+ if (isDirectionLTR) moveNext();
14814
+ else movePrev();
14815
+ }
14816
+ break;
14817
+ case 'ArrowDown':
14818
+ if (orientation === 'vertical') moveNext();
14819
+ break;
14820
+ case 'ArrowLeft':
14821
+ if (orientation === 'horizontal') {
14822
+ if (isDirectionLTR) movePrev();
14823
+ else moveNext();
14824
+ }
14825
+ break;
14826
+ case 'ArrowUp':
14827
+ if (orientation === 'vertical') movePrev();
14828
+ break;
14829
+ }
14830
+ const clampedIndex = nextIndex % triggerCount;
14831
+ (_triggerCollection$cl = triggerCollection[clampedIndex].ref.current) === null || _triggerCollection$cl === void 0 || _triggerCollection$cl.focus();
14832
+ });
14833
+ return /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionImplProvider, {
14834
+ scope: __scopeAccordion,
14835
+ disabled: disabled,
14836
+ direction: dir,
14837
+ orientation: orientation
14838
+ }, /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
14839
+ scope: __scopeAccordion
14840
+ }, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, accordionProps, {
14841
+ "data-orientation": orientation,
14842
+ ref: composedRefs,
14843
+ onKeyDown: disabled ? undefined : handleKeyDown
14844
+ }))));
14845
+ });
14846
+ /* -------------------------------------------------------------------------------------------------
14847
+ * AccordionItem
14848
+ * -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$ITEM_NAME = 'AccordionItem';
14849
+ const [$1bf158f521e1b1b4$var$AccordionItemProvider, $1bf158f521e1b1b4$var$useAccordionItemContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME);
14850
+ /**
14851
+ * `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`.
14852
+ */ const $1bf158f521e1b1b4$export$d99097c13d4dac9f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14853
+ const { __scopeAccordion: __scopeAccordion , value: value , ...accordionItemProps } = props;
14854
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
14855
+ const valueContext = $1bf158f521e1b1b4$var$useAccordionValueContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
14856
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
14857
+ const triggerId = $1746a345f3d73bb7$export$f680877a34711e37();
14858
+ const open1 = value && valueContext.value.includes(value) || false;
14859
+ const disabled = accordionContext.disabled || props.disabled;
14860
+ return /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$AccordionItemProvider, {
14861
+ scope: __scopeAccordion,
14862
+ open: open1,
14863
+ disabled: disabled,
14864
+ triggerId: triggerId
14865
+ }, /*#__PURE__*/ React.createElement($409067139f391064$export$be92b6f5f03c0fe9, _extends({
14866
+ "data-orientation": accordionContext.orientation,
14867
+ "data-state": $1bf158f521e1b1b4$var$getState(open1)
14868
+ }, collapsibleScope, accordionItemProps, {
14869
+ ref: forwardedRef,
14870
+ disabled: disabled,
14871
+ open: open1,
14872
+ onOpenChange: (open)=>{
14873
+ if (open) valueContext.onItemOpen(value);
14874
+ else valueContext.onItemClose(value);
14875
+ }
14876
+ })));
14877
+ });
14878
+ /* -------------------------------------------------------------------------------------------------
14879
+ * AccordionTrigger
14880
+ * -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$TRIGGER_NAME = 'AccordionTrigger';
14881
+ /**
14882
+ * `AccordionTrigger` is the trigger that toggles the collapsed state of an `AccordionItem`. It
14883
+ * should always be nested inside of an `AccordionHeader`.
14884
+ */ const $1bf158f521e1b1b4$export$94e939b1f85bdd73 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14885
+ const { __scopeAccordion: __scopeAccordion , ...triggerProps } = props;
14886
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
14887
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
14888
+ const collapsibleContext = $1bf158f521e1b1b4$var$useAccordionCollapsibleContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
14889
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
14890
+ return /*#__PURE__*/ React.createElement($1bf158f521e1b1b4$var$Collection.ItemSlot, {
14891
+ scope: __scopeAccordion
14892
+ }, /*#__PURE__*/ React.createElement($409067139f391064$export$41fb9f06171c75f4, _extends({
14893
+ "aria-disabled": itemContext.open && !collapsibleContext.collapsible || undefined,
14894
+ "data-orientation": accordionContext.orientation,
14895
+ id: itemContext.triggerId
14896
+ }, collapsibleScope, triggerProps, {
14897
+ ref: forwardedRef
14898
+ })));
14899
+ });
14900
+ /* -------------------------------------------------------------------------------------------------
14901
+ * AccordionContent
14902
+ * -----------------------------------------------------------------------------------------------*/ const $1bf158f521e1b1b4$var$CONTENT_NAME = 'AccordionContent';
14903
+ /**
14904
+ * `AccordionContent` contains the collapsible content for an `AccordionItem`.
14905
+ */ const $1bf158f521e1b1b4$export$985b9a77379b54a0 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
14906
+ const { __scopeAccordion: __scopeAccordion , ...contentProps } = props;
14907
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
14908
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$CONTENT_NAME, __scopeAccordion);
14909
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
14910
+ return /*#__PURE__*/ React.createElement($409067139f391064$export$7c6e2c02157bb7d2, _extends({
14911
+ role: "region",
14912
+ "aria-labelledby": itemContext.triggerId,
14913
+ "data-orientation": accordionContext.orientation
14914
+ }, collapsibleScope, contentProps, {
14915
+ ref: forwardedRef,
14916
+ style: {
14917
+ ['--radix-accordion-content-height']: 'var(--radix-collapsible-content-height)',
14918
+ ['--radix-accordion-content-width']: 'var(--radix-collapsible-content-width)',
14919
+ ...props.style
14920
+ }
14921
+ }));
14922
+ });
14923
+ /* -----------------------------------------------------------------------------------------------*/ function $1bf158f521e1b1b4$var$getState(open) {
14924
+ return open ? 'open' : 'closed';
14925
+ }
14926
+ const $1bf158f521e1b1b4$export$be92b6f5f03c0fe9 = $1bf158f521e1b1b4$export$a766cd26d0d69044;
14927
+ const $1bf158f521e1b1b4$export$6d08773d2e66f8f2 = $1bf158f521e1b1b4$export$d99097c13d4dac9f;
14928
+ const $1bf158f521e1b1b4$export$41fb9f06171c75f4 = $1bf158f521e1b1b4$export$94e939b1f85bdd73;
14929
+ const $1bf158f521e1b1b4$export$7c6e2c02157bb7d2 = $1bf158f521e1b1b4$export$985b9a77379b54a0;
14930
+
14931
+ const Accordion = ({ accordionItems, defaultValue, value, onItemSelect, disabled, extraClassNames, testId, }) => {
14932
+ return (React.createElement($1bf158f521e1b1b4$export$be92b6f5f03c0fe9, { className: "rounded-md w-full", type: "single", defaultValue: defaultValue, value: value, collapsible: true, "data-testid": testId, onValueChange: (_value) => onItemSelect(_value) }, accordionItems.map((item) => (React.createElement($1bf158f521e1b1b4$export$6d08773d2e66f8f2, { className: `tw-bg-transparent tw-p-0 tw-flex tw-flex-col tw-w-full ${extraClassNames || ''}`, key: item.value, disabled: disabled, value: item.value },
14933
+ React.createElement($1bf158f521e1b1b4$export$41fb9f06171c75f4, { disabled: disabled, className: `tw-w-full tw-cursor-default` }, item.trigger),
14934
+ React.createElement($1bf158f521e1b1b4$export$7c6e2c02157bb7d2, { className: `data-[state=open]:tw-animate-slideDown data-[state=closed]:tw-animate-slideUp tw-overflow-hidden ${item.contentClassNames || ''}` }, item.content))))));
14935
+ };
14936
+
14937
+ exports.Accordion = Accordion;
14540
14938
  exports.Button = Button;
14541
14939
  exports.Checkbox = Checkbox;
14542
14940
  exports.Icon = Icon;