@react-spectrum/s2 3.0.0-nightly-e3ed3c7f6-250130 → 3.0.0-nightly-016590a4a-250131

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/Tabs.mjs.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAyDM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwD;AAE/F,MAAM;;;;;;;;;;;;;;;;;;;;;;;;AASC,SAAS,0CAAS,KAAoB;IAC3C,qBACE,gBAAC,CAAA,GAAA,eAAW;QACT,GAAG,KAAK;QACT,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,+BAAS,MAAM,MAAM,MAAM;;AAE7E;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BN,MAAM;AAQC,SAAS,0CAAI,KAAe;IACjC,IAAI,WAAC,OAAO,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE,8CAAgB,CAAC;IAEnD,qBACE,gBAAC,CAAA,GAAA,UAAK;QACH,GAAG,KAAK;QACT,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0BAAI;gBAAC,GAAG,WAAW;yBAAE;YAAO,GAAG,MAAM,MAAM;kBACtG,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBAAC,MAAM;oBAAmB;iBAAE;gBAC1C;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;4BAAC,MAAM;4BAAQ,MAAM;wBAAmB;wBAC/D,QAAQ;oBACV;iBAAE;aACH;sBACA,OAAO,MAAM,QAAQ,KAAK,yBAAW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AAE,OAAO,GAAG,CAAC;YAE7B,IAAI,gBAAgB,cAClB,SAAS,KAAK,GAAG,GAAG,YAAY,WAAW,CAAC,EAAE,CAAC;iBAE/C,SAAS,MAAM,GAAG,GAAG,YAAY,YAAY,CAAC,EAAE,CAAC;YAEnD,SAAS;QACX;IACF,GAAG;QAAC;QAAW;QAAU;QAAa;KAAY;IAElD,CAAA,GAAA,sBAAc,EAAE;QACd;IACF,GAAG;QAAC;QAAU,OAAO,cAAc;QAAK;QAAW;QAAa;KAAQ;IAExE,qBACE,gBAAC;QAAI,OAAO;YAAC,GAAG,KAAK;QAAA;QAAG,WAAW,wCAAkB;wBAAC;yBAAY;QAAW;;AAEjF;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;AAeC,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA2B;IACxF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,WACF,UAAU,uBACV,UAAU,gBACV,YAAY,eACZ,cAAc,cACf,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,WAAM;QACJ,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,2BAAK;gBAAC,GAAG,WAAW;YAAA,GAAG,MAAM,MAAM;kBAC9F,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC;oBAAa;iCAAC;oCAAS;sCAAY;qCAAc;oBAAW;iBAAE;aAChE;sBACA,MAAM,QAAQ;;;AAIvB","sources":["packages/@react-spectrum/s2/src/Tabs.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps,\n ContextValue,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext,\n useSlottedContext\n } from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation} from '@react-types/shared';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useRef, useState} from 'react';\nimport {focusRing, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /**\n * The amount of space between the tabs.\n * @default 'regular'\n */\n density?: 'compact' | 'regular'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children?: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tablist. */\n children?: ReactNode\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst tabPanel = style({\n marginTop: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + tabPanel(null, props.styles)} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default'\n}, getAllowedOverrides());\n\nconst icon = style({\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density} = useSlottedContext(TabsContext) ?? {};\n\n return (\n <RACTab\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density}, props.styles)}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACTab>\n );\n}\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation} = useSlottedContext(TabsContext) ?? {};\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | null, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection || null, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, direction, orientation, density]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tabs = style({\n display: 'flex',\n flexShrink: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nexport const Tabs = forwardRef(function Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal'\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <RACTabs\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tabs({...renderProps}, props.styles)}>\n <Provider\n values={[\n [TabsContext, {density, isDisabled, disabledKeys, orientation}]\n ]}>\n {props.children}\n </Provider>\n </RACTabs>\n );\n});\n"],"names":[],"version":3,"file":"Tabs.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAgEM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwD;AAC/F,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAa,CAAC;AACtD,MAAM,sDAAkB,CAAA,GAAA,oBAAY,EAAE;IACpC,UAAU;IACV,QAAQ;IACR,SAAS;AACX;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeC,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA2B;IACxF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,WACF,UAAU,uBACV,UAAU,gBACV,YAAY,eAC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AAE;QAAgB;KAAY;IAEjD,CAAA,GAAA,gBAAQ,EAAE;QACR,kDAAkD;QAClD,SAAS,KAAK,EAAE,MAAM,KAAK,IAAM;IACjC,uDAAuD;IACzD,GAAG,EAAE;IAEL,IAAI,SAAS,CAAA,GAAA,YAAI;IACjB,IAAI,UAAU,CAAA,GAAA,YAAI;IAElB,IAAI;IACJ,IAAI,WACF,yBACE,gBAAC,CAAA,GAAA,WAAM;QACJ,GAAG,KAAK;QACT,OAAO;YAAC,SAAS;QAAU;kBAC1B,MAAM,QAAQ;;SAInB,yBACE;;0BACE,gBAAC;gBACC,IAAI;gBACJ,SAAS;gBACT,OAAO;gBACP,mBAAmB;gBACnB,cAAY,KAAK,CAAC,aAAa;gBAC/B,oBAAkB,KAAK,CAAC,kBAAkB;;0BAC5C,gBAAC,sCAAgB,QAAQ;gBAAC,OAAO;oBAAC,UAAU;4BAAO;6BAAQ;gBAAO;0BAC/D,MAAM,QAAQ;;;;IAMvB,qBACE,iBAAC;QAAI,OAAO,MAAM,YAAY;QAAE,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,2BAAK;yBAAC;QAAW,GAAG,MAAM,MAAM;QAAG,KAAK;;0BAClH,gBAAC;gBAAI,WAAW,8BAAQ;iCAAC;mCAAa;6BAAe;gBAAO;0BAC1D,cAAA,gBAAC;oBAAW,OAAO;oBAAU,SAAS;oBAAS,SAAS;;;0BAE1D,gBAAC,sCAAgB,QAAQ;gBAAC,OAAO;oBAAC,UAAU;4BAAM;6BAAQ;gBAAO;0BAC9D;;;;AAIT","sources":["packages/@react-spectrum/s2/src/Tabs.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps,\n ContextValue,\n Group,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation, RefObject} from '@react-types/shared';\nimport {CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {focusRing, size, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {Picker, PickerItem} from './TabsPicker';\nimport {Text, TextContext} from './Content';\nimport {useControlledState} from '@react-stately/utils';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useId, useLabels, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /**\n * The amount of space between the tabs.\n * @default 'regular'\n */\n density?: 'compact' | 'regular',\n /**\n * Defines if the text within the tabs should be hidden and only the icon should be shown.\n * The text is always visible when the item is collapsed into a picker.\n * @default 'show'\n */\n labelBehavior?: 'show' | 'hide'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'style' | 'className' | 'aria-label' | 'aria-labelledby'>, StyleProps {}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\nconst InternalTabsContext = createContext<TabsProps>({});\nconst CollapseContext = createContext({\n showTabs: true,\n menuId: '',\n valueId: ''\n});\n\nconst tabs = style({\n position: 'relative',\n display: 'flex',\n flexShrink: 0,\n font: 'ui',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nexport const Tabs = forwardRef(function Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal',\n labelBehavior = 'show'\n } = props;\n let domRef = useDOMRef(ref);\n let [value, setValue] = useControlledState(props.selectedKey, props.defaultSelectedKey ?? null!, props.onSelectionChange);\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n throw new Error('An aria-label or aria-labelledby prop is required on Tabs for accessibility.');\n }\n\n return (\n <Provider\n values={[\n [InternalTabsContext, {\n density,\n isDisabled,\n orientation,\n disabledKeys,\n selectedKey: value,\n onSelectionChange: setValue,\n labelBehavior,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby']\n }]\n ]}>\n <CollectionBuilder content={props.children}>\n {collection => (\n <CollapsingTabs\n {...props}\n selectedKey={value}\n onSelectionChange={setValue}\n collection={collection}\n containerRef={domRef} />\n )}\n </CollectionBuilder>\n </Provider>\n );\n});\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n },\n labelBehavior: {\n hide: {\n density: {\n compact: 16,\n regular: 24\n }\n }\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {showTabs} = useContext(CollapseContext) ?? {};\n\n if (showTabs) {\n return <TabListInner {...props} />;\n }\n}\n\nfunction TabListInner<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation, labelBehavior, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy} = useContext(InternalTabsContext) ?? {};\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, labelBehavior, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, density, direction, orientation]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default',\n paddingX: {\n labelBehavior: {\n hide: size(6)\n }\n }\n}, getAllowedOverrides());\n\nconst icon = style({\n display: 'block',\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density, labelBehavior} = useContext(InternalTabsContext) ?? {};\n\n let contentId = useId();\n let ariaLabelledBy = props['aria-labelledby'] || '';\n return (\n <RACTab\n {...props}\n // @ts-ignore\n originalProps={props}\n aria-labelledby={`${labelBehavior === 'hide' ? contentId : ''} ${ariaLabelledBy}`}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density, labelBehavior}, props.styles)}>\n {({\n // @ts-ignore\n isMenu\n }) => {\n if (isMenu) {\n return props.children;\n } else {\n return (\n <Provider\n values={[\n [TextContext, {\n id: contentId,\n styles:\n style({\n order: 1,\n display: {\n labelBehavior: {\n hide: 'none'\n }\n }\n })({labelBehavior})\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n );\n }\n }}\n </RACTab>\n );\n}\n\nconst tabPanel = style({\n ...focusRing(),\n display: 'flex',\n marginTop: 4,\n marginX: -4,\n paddingX: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0,\n overflow: 'auto'\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n let {showTabs} = useContext(CollapseContext);\n let {selectedKey} = useContext(InternalTabsContext);\n if (showTabs) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className ?? '') + tabPanel(renderProps, props.styles)} />\n );\n }\n\n if (props.id !== selectedKey) {\n return null;\n }\n\n return <CollapsedTabPanel {...props} />;\n}\n\nfunction CollapsedTabPanel(props: TabPanelProps) {\n let {UNSAFE_style, UNSAFE_className = '', ...otherProps} = props;\n let {menuId, valueId} = useContext(CollapseContext);\n let ref = useRef(null);\n let tabIndex = useHasTabbableChild(ref) ? undefined : 0;\n\n return (\n <Group\n {...otherProps}\n ref={ref}\n aria-labelledby={menuId + ' ' + valueId}\n tabIndex={tabIndex}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + tabPanel(renderProps, props.styles)} />\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | undefined, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\nlet HiddenTabs = function (props: {\n listRef: RefObject<HTMLDivElement | null>,\n items: Array<Node<any>>,\n size?: string,\n density?: 'compact' | 'regular'\n}) {\n let {listRef, items, size, density} = props;\n\n return (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={listRef}\n className={style({\n display: '[inherit]',\n flexDirection: '[inherit]',\n gap: '[inherit]',\n flexWrap: '[inherit]',\n position: 'absolute',\n inset: 0,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {items.map((item) => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n return (\n <div\n data-hidden-tab\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, density})}>\n {item.props.children({size, density})}\n </div>\n );\n })}\n </div>\n );\n};\n\nlet TabsMenu = (props: {valueId: string, items: Array<Node<any>>, onSelectionChange: TabsProps['onSelectionChange']} & TabsProps) => {\n let {id, items, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, valueId} = props;\n let {density, onSelectionChange, selectedKey, isDisabled, disabledKeys, labelBehavior} = useContext(InternalTabsContext);\n let state = useContext(TabListStateContext);\n let allKeysDisabled = useMemo(() => {\n return isAllTabsDisabled(state?.collection, disabledKeys ? new Set(disabledKeys) : new Set());\n }, [state?.collection, disabledKeys]);\n let labelProps = useLabels({\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n });\n\n return (\n <div\n className={style({\n display: 'flex',\n flexShrink: 0,\n alignItems: 'center',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n }})({density})}>\n <Picker\n id={id}\n valueId={valueId}\n {...labelProps}\n aria-describedby={props['aria-describedby']}\n aria-details={props['aria-details']}\n isDisabled={isDisabled || allKeysDisabled}\n density={density!}\n labelBehavior={labelBehavior}\n items={items}\n disabledKeys={disabledKeys}\n selectedKey={selectedKey}\n onSelectionChange={onSelectionChange}>\n {(item: Node<any>) => {\n return (\n <PickerItem\n {...item.props.originalProps}\n isDisabled={isDisabled || allKeysDisabled}\n key={item.key}>\n {item.props.children({density, isMenu: true})}\n </PickerItem>\n );\n }}\n </Picker>\n </div>\n );\n};\n\nlet CollapsingTabs = ({collection, containerRef, ...props}: {collection: Collection<Node<unknown>>, containerRef: any} & TabsProps) => {\n let {density = 'regular', orientation = 'horizontal', labelBehavior = 'show', onSelectionChange} = props;\n let [showItems, _setShowItems] = useState(true);\n showItems = orientation === 'vertical' ? true : showItems;\n let setShowItems = useCallback((value: boolean) => {\n if (orientation === 'vertical') {\n // if orientation is vertical, we always show the items\n _setShowItems(true);\n } else {\n _setShowItems(value);\n }\n }, [orientation]);\n\n let {direction} = useLocale();\n\n let children = useMemo(() => [...collection], [collection]);\n\n let listRef = useRef<HTMLDivElement | null>(null);\n let updateOverflow = useEffectEvent(() => {\n if (orientation === 'vertical' || !listRef.current || !containerRef?.current) {\n return;\n }\n let container = listRef.current;\n let containerRect = container.getBoundingClientRect();\n let tabs = container.querySelectorAll('[data-hidden-tab]');\n let lastTab = tabs[tabs.length - 1];\n let lastTabRect = lastTab.getBoundingClientRect();\n if (direction === 'ltr') {\n setShowItems?.(lastTabRect.right <= containerRect.right);\n } else {\n setShowItems?.(lastTabRect.left >= containerRect.left);\n }\n });\n\n useResizeObserver({ref: containerRef, onResize: updateOverflow});\n\n useLayoutEffect(() => {\n if (collection.size > 0) {\n queueMicrotask(updateOverflow);\n }\n }, [collection.size, updateOverflow]);\n\n let prevOrientation = useRef(orientation);\n useLayoutEffect(() => {\n if (collection.size > 0 && prevOrientation.current !== orientation) {\n updateOverflow();\n }\n prevOrientation.current = orientation;\n }, [collection.size, updateOverflow, orientation]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateOverflow());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let menuId = useId();\n let valueId = useId();\n\n let contents: ReactNode;\n if (showItems) {\n contents = (\n <RACTabs\n {...props}\n style={{display: 'contents'}}>\n {props.children}\n </RACTabs>\n );\n } else {\n contents = (\n <>\n <TabsMenu\n id={menuId}\n valueId={valueId}\n items={children}\n onSelectionChange={onSelectionChange}\n aria-label={props['aria-label']}\n aria-describedby={props['aria-labelledby']} />\n <CollapseContext.Provider value={{showTabs: false, menuId, valueId}}>\n {props.children}\n </CollapseContext.Provider>\n </>\n );\n }\n\n return (\n <div style={props.UNSAFE_style} className={(props.UNSAFE_className || '') + tabs({orientation}, props.styles)} ref={containerRef}>\n <div className={tablist({orientation, labelBehavior, density})}>\n <HiddenTabs items={children} density={density} listRef={listRef} />\n </div>\n <CollapseContext.Provider value={{showTabs: true, menuId, valueId}}>\n {contents}\n </CollapseContext.Provider>\n </div>\n );\n};\n"],"names":[],"version":3,"file":"Tabs.mjs.map"}
@@ -0,0 +1,415 @@
1
+ require("./TabsPicker.css");
2
+ var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
3
+ var $e741ea6b88ce4866$exports = require("./Menu.cjs");
4
+ var $dba2b18fc5727f9b$exports = require("./Checkmark.cjs");
5
+ var $1df9f1c9262ce5df$exports = require("./Chevron.cjs");
6
+ var $a0b996a550bb0891$exports = require("./Field.cjs");
7
+ var $6367bc87eb7d24ad$exports = require("./Content.cjs");
8
+ var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
9
+ var $493371ef39bf7a55$exports = require("./Popover.cjs");
10
+ var $2061c83559b50a66$exports = require("./pressScale.cjs");
11
+ var $bfa4962d90c8af48$exports = require("./Form.cjs");
12
+ var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
13
+ var $7pV4n$reactjsxruntime = require("react/jsx-runtime");
14
+ var $7pV4n$reactariacomponents = require("react-aria-components");
15
+ var $7pV4n$react = require("react");
16
+ var $7pV4n$reactspectrumutils = require("@react-spectrum/utils");
17
+
18
+
19
+ function $parcel$export(e, n, v, s) {
20
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
21
+ }
22
+
23
+ $parcel$export(module.exports, "Picker", () => $9d2c38978395d44a$export$ba25329847403e11);
24
+ $parcel$export(module.exports, "PickerItem", () => $9d2c38978395d44a$export$d601881f38163e28);
25
+ /*
26
+ * Copyright 2024 Adobe. All rights reserved.
27
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
+ * you may not use this file except in compliance with the License. You may obtain a copy
29
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software distributed under
32
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
+ * OF ANY KIND, either express or implied. See the License for the specific language
34
+ * governing permissions and limitations under the License.
35
+ */
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+ const $9d2c38978395d44a$export$b72b8dade9393cd5 = /*#__PURE__*/ (0, $7pV4n$react.createContext)(null);
51
+ const $9d2c38978395d44a$var$inputButton = function anonymous(props) {
52
+ let rules = " .";
53
+ if (props.isFocusVisible) rules += ' _Pb';
54
+ else rules += ' _Pa';
55
+ rules += ' ca_____M';
56
+ rules += ' cx';
57
+ rules += ' _Rc';
58
+ rules += ' _Q-3t1z';
59
+ rules += ' __e-g2ozi1';
60
+ rules += ' __f-g2ozi1';
61
+ rules += ' __g-g2ozi1';
62
+ rules += ' __h-g2ozi1';
63
+ if (props.size === "XL") rules += ' pj';
64
+ else if (props.size === "L") rules += ' pi';
65
+ else if (props.size === "S") rules += ' ph';
66
+ else if (props.size === "XS") rules += ' pg';
67
+ else rules += ' pf';
68
+ if (props.isQuiet) rules += ' __qa';
69
+ else rules += ' __q-1s8glxue';
70
+ if (props.size === "XL") rules += ' -usygro_k-____g';
71
+ else if (props.size === "L") rules += ' -usygro_k-___0';
72
+ else if (props.size === "S") rules += ' -usygro_k-___u';
73
+ else rules += ' -usygro_k-___K';
74
+ rules += ' l-rwozxi';
75
+ rules += ' Yc';
76
+ rules += ' _g-bc1l9oh';
77
+ rules += ' _g-1uotwbwg';
78
+ rules += ' _g-eo0c6sf';
79
+ rules += ' _g-enzzrge';
80
+ rules += ' _g-enzykdd';
81
+ rules += ' _g-enzwzjc';
82
+ rules += ' _g-enzrfpb';
83
+ rules += ' _ga';
84
+ rules += ' _hbf';
85
+ rules += ' _he';
86
+ rules += ' _ib';
87
+ rules += ' _j-1x99dlob';
88
+ rules += ' _ja';
89
+ if (props.isDisabled) rules += ' aj';
90
+ else {
91
+ if (props.isPressed) rules += ' ao';
92
+ else if (props.isFocusVisible) rules += ' ao';
93
+ else if (props.isHovered) rules += ' ao';
94
+ else rules += ' an';
95
+ }
96
+ rules += ' _3d';
97
+ rules += ' _na';
98
+ rules += ' zf';
99
+ rules += ' _zb';
100
+ rules += ' _Ab';
101
+ rules += ' _Bb';
102
+ rules += ' _Cb';
103
+ rules += ' _5c';
104
+ rules += ' _Sa';
105
+ rules += ' _U-375x7f';
106
+ rules += ' _Va';
107
+ rules += ' ibH';
108
+ rules += ' iG';
109
+ rules += ' F-375tnp';
110
+ rules += ' G-375tnq';
111
+ rules += ' ba';
112
+ if (props.isQuiet) rules += ' qd';
113
+ rules += ' __V-yksgrp';
114
+ if (props.density === "compact") rules += ' jU';
115
+ else rules += ' j_a';
116
+ rules += ' __ra';
117
+ rules += ' -_375tnp_F-a';
118
+ rules += ' -_375tnq_G-a';
119
+ return rules;
120
+ };
121
+ let $9d2c38978395d44a$export$b1e5508a851be14d = function anonymous(props) {
122
+ let rules = " .";
123
+ rules += ' _Pa';
124
+ rules += ' _3f';
125
+ rules += ' __l-n6rb9a';
126
+ rules += ' __ra';
127
+ rules += ' o-17zqamw';
128
+ rules += ' __za';
129
+ rules += ' __Aa';
130
+ rules += ' Hd';
131
+ rules += ' Id';
132
+ rules += ' Fd';
133
+ rules += ' Gd';
134
+ rules += ' _g-bc1l9oh';
135
+ rules += ' _g-1uotwbwg';
136
+ rules += ' _g-eo0c6sf';
137
+ rules += ' _g-enzzrge';
138
+ rules += ' _g-enzykdd';
139
+ rules += ' _g-enzwzjc';
140
+ rules += ' _g-enzrfpb';
141
+ rules += ' _ga';
142
+ if (props.size === "XL") {
143
+ rules += ' _hbj';
144
+ rules += ' _hi';
145
+ } else if (props.size === "L") {
146
+ rules += ' _hbh';
147
+ rules += ' _hg';
148
+ } else if (props.size === "S") {
149
+ rules += ' _hbd';
150
+ rules += ' _hc';
151
+ } else if (props.size === "XS") {
152
+ rules += ' _hbb';
153
+ rules += ' _ha';
154
+ } else {
155
+ rules += ' _hbf';
156
+ rules += ' _he';
157
+ }
158
+ return rules;
159
+ };
160
+ const $9d2c38978395d44a$var$valueStyles = " __d-3t1x __zb __Ab _qa _tb _3d _5c jb";
161
+ const $9d2c38978395d44a$var$iconStyles = " __c-3t1x U-3hn0u -rwx0fg_d-b";
162
+ const $9d2c38978395d44a$var$iconCenterWrapper = function anonymous(props) {
163
+ let rules = " .";
164
+ rules += ' _3d';
165
+ rules += ' __e-qb5q8i';
166
+ rules += ' __f-qb5q8i';
167
+ rules += ' __g-qb5q8i';
168
+ rules += ' __h-qb5q8i';
169
+ if (props.labelBehavior === "hide") rules += ' F-ve8p9e';
170
+ return rules;
171
+ };
172
+ let $9d2c38978395d44a$var$InsideSelectValueContext = /*#__PURE__*/ (0, $7pV4n$react.createContext)(false);
173
+ function $9d2c38978395d44a$var$Picker(props1, ref) {
174
+ [props1, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props1, ref, $9d2c38978395d44a$export$b72b8dade9393cd5);
175
+ let domRef = (0, $7pV4n$reactspectrumutils.useFocusableRef)(ref);
176
+ props1 = (0, $bfa4962d90c8af48$exports.useFormProps)(props1);
177
+ let { direction: direction = 'bottom', align: align = 'start', shouldFlip: shouldFlip = true, children: children, items: items, density: density, labelBehavior: labelBehavior = 'show', valueId: valueId, ...pickerProps } = props1;
178
+ let isQuiet = true;
179
+ const menuOffset = 6;
180
+ const size = 'M';
181
+ let ariaLabelledby = props1['aria-labelledby'] ?? '';
182
+ return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsxs)("div", {
183
+ children: [
184
+ /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.Select), {
185
+ ...pickerProps,
186
+ "aria-labelledby": `${labelBehavior === 'hide' ? valueId : ''} ${ariaLabelledby}`,
187
+ children: ({ isOpen: isOpen })=>/*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsxs)((0, $7pV4n$reactjsxruntime.Fragment), {
188
+ children: [
189
+ /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $a0b996a550bb0891$exports.FieldLabel), {
190
+ isQuiet: isQuiet
191
+ }),
192
+ /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsxs)((0, $7pV4n$reactariacomponents.Button), {
193
+ ref: domRef,
194
+ style: (renderProps)=>(0, $2061c83559b50a66$exports.pressScale)(domRef)(renderProps),
195
+ // Prevent press scale from sticking while Picker is open.
196
+ // @ts-ignore
197
+ isPressed: false,
198
+ className: (renderProps)=>$9d2c38978395d44a$var$inputButton({
199
+ ...renderProps,
200
+ size: 'M',
201
+ isOpen: isOpen,
202
+ isQuiet: isQuiet,
203
+ density: density
204
+ }),
205
+ children: [
206
+ /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.SelectValue), {
207
+ className: $9d2c38978395d44a$var$valueStyles + ' ' + "-u6zm92",
208
+ children: ({ defaultChildren: defaultChildren })=>{
209
+ return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.Provider), {
210
+ values: [
211
+ [
212
+ (0, $bde97c91243ed164$exports.IconContext),
213
+ {
214
+ slots: {
215
+ icon: {
216
+ render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
217
+ slot: 'icon',
218
+ styles: $9d2c38978395d44a$var$iconCenterWrapper({
219
+ labelBehavior: labelBehavior
220
+ })
221
+ }),
222
+ styles: (0, $e741ea6b88ce4866$exports.icon)
223
+ }
224
+ }
225
+ }
226
+ ],
227
+ [
228
+ (0, $6367bc87eb7d24ad$exports.TextContext),
229
+ {
230
+ slots: {
231
+ // Default slot is useful when converting other collections to PickerItems.
232
+ [(0, $7pV4n$reactariacomponents.DEFAULT_SLOT)]: {
233
+ id: valueId,
234
+ styles: function anonymous(props) {
235
+ let rules = " .";
236
+ if (props.labelBehavior === "hide") rules += ' _3j';
237
+ else rules += ' _3a';
238
+ rules += ' __d-3t1y';
239
+ rules += ' __zb';
240
+ rules += ' __Ab';
241
+ rules += ' _qa';
242
+ rules += ' _tb';
243
+ return rules;
244
+ }({
245
+ labelBehavior: labelBehavior
246
+ })
247
+ }
248
+ }
249
+ }
250
+ ],
251
+ [
252
+ $9d2c38978395d44a$var$InsideSelectValueContext,
253
+ true
254
+ ]
255
+ ],
256
+ children: defaultChildren
257
+ });
258
+ }
259
+ }),
260
+ /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $1df9f1c9262ce5df$exports.default), {
261
+ size: size,
262
+ className: $9d2c38978395d44a$var$iconStyles
263
+ })
264
+ ]
265
+ }),
266
+ /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $493371ef39bf7a55$exports.PopoverBase), {
267
+ hideArrow: true,
268
+ offset: menuOffset,
269
+ placement: `${direction} ${align}`,
270
+ shouldFlip: shouldFlip,
271
+ styles: " B-375tnl p___u k-13f72lm -_375tnl_B-M",
272
+ children: /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.Provider), {
273
+ values: [
274
+ [
275
+ (0, $6367bc87eb7d24ad$exports.HeaderContext),
276
+ {
277
+ styles: (0, $e741ea6b88ce4866$exports.sectionHeader)({
278
+ size: size
279
+ })
280
+ }
281
+ ],
282
+ [
283
+ (0, $6367bc87eb7d24ad$exports.HeadingContext),
284
+ {
285
+ styles: (0, $e741ea6b88ce4866$exports.sectionHeading)
286
+ }
287
+ ],
288
+ [
289
+ (0, $6367bc87eb7d24ad$exports.TextContext),
290
+ {
291
+ slots: {
292
+ description: {
293
+ styles: (0, $e741ea6b88ce4866$exports.description)({
294
+ size: size
295
+ })
296
+ }
297
+ }
298
+ }
299
+ ]
300
+ ],
301
+ children: /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.ListBox), {
302
+ items: items,
303
+ className: $9d2c38978395d44a$export$b1e5508a851be14d,
304
+ children: children
305
+ })
306
+ })
307
+ })
308
+ ]
309
+ })
310
+ }),
311
+ /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)($9d2c38978395d44a$var$TabLine, {
312
+ isDisabled: props1.isDisabled
313
+ })
314
+ ]
315
+ });
316
+ }
317
+ /**
318
+ * Pickers allow users to choose a single option from a collapsible list of options when space is limited.
319
+ */ let $9d2c38978395d44a$export$ba25329847403e11 = /*#__PURE__*/ (0, $7pV4n$react.forwardRef)($9d2c38978395d44a$var$Picker);
320
+ const $9d2c38978395d44a$var$selectedIndicator = function anonymous(props) {
321
+ let rules = " .";
322
+ if (props.isDisabled) rules += ' ba_____O';
323
+ else rules += ' ba_____M';
324
+ if (props.isDisabled) rules += ' bg';
325
+ else {
326
+ if (props.isPressed) rules += ' bo';
327
+ else if (props.isFocusVisible) rules += ' bo';
328
+ else if (props.isHovered) rules += ' bo';
329
+ else rules += ' bn';
330
+ }
331
+ rules += ' j-375zlr';
332
+ rules += ' zf';
333
+ rules += ' _zf';
334
+ rules += ' _Af';
335
+ rules += ' _Bf';
336
+ rules += ' _Cf';
337
+ rules += ' D-yj8a3w';
338
+ rules += ' _U-375x5l';
339
+ rules += ' _Va';
340
+ return rules;
341
+ };
342
+ function $9d2c38978395d44a$var$TabLine(props) {
343
+ return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)("div", {
344
+ className: $9d2c38978395d44a$var$selectedIndicator(props)
345
+ });
346
+ }
347
+ function $9d2c38978395d44a$export$d601881f38163e28(props) {
348
+ let ref = (0, $7pV4n$react.useRef)(null);
349
+ let isLink = props.href != null;
350
+ const size = 'M';
351
+ return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $7pV4n$reactariacomponents.ListBoxItem), {
352
+ ...props,
353
+ ref: ref,
354
+ textValue: props.textValue || (typeof props.children === 'string' ? props.children : undefined),
355
+ style: (0, $2061c83559b50a66$exports.pressScale)(ref, props.UNSAFE_style),
356
+ className: (renderProps)=>(props.UNSAFE_className || '') + (0, $e741ea6b88ce4866$exports.menuitem)({
357
+ ...renderProps,
358
+ size: size,
359
+ isLink: isLink
360
+ }, props.styles),
361
+ children: (renderProps)=>{
362
+ let { children: children } = props;
363
+ return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)($9d2c38978395d44a$var$DefaultProvider, {
364
+ context: (0, $bde97c91243ed164$exports.IconContext),
365
+ value: {
366
+ slots: {
367
+ icon: {
368
+ render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
369
+ slot: 'icon',
370
+ styles: $9d2c38978395d44a$var$iconCenterWrapper({})
371
+ }),
372
+ styles: (0, $e741ea6b88ce4866$exports.icon)
373
+ }
374
+ }
375
+ },
376
+ children: /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsxs)($9d2c38978395d44a$var$DefaultProvider, {
377
+ context: (0, $6367bc87eb7d24ad$exports.TextContext),
378
+ value: {
379
+ slots: {
380
+ [(0, $7pV4n$reactariacomponents.DEFAULT_SLOT)]: {
381
+ styles: (0, $e741ea6b88ce4866$exports.label)({
382
+ size: size
383
+ })
384
+ }
385
+ }
386
+ },
387
+ children: [
388
+ !isLink && /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $dba2b18fc5727f9b$exports.default), {
389
+ size: size,
390
+ className: (0, $e741ea6b88ce4866$exports.checkmark)({
391
+ ...renderProps,
392
+ size: size
393
+ })
394
+ }),
395
+ typeof children === 'string' ? /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
396
+ children: children
397
+ }) : children
398
+ ]
399
+ })
400
+ });
401
+ }
402
+ });
403
+ }
404
+ // A Context.Provider that only sets a value if not inside SelectValue.
405
+ function $9d2c38978395d44a$var$DefaultProvider({ context: context, value: value, children: children }) {
406
+ let inSelectValue = (0, $7pV4n$react.useContext)($9d2c38978395d44a$var$InsideSelectValueContext);
407
+ if (inSelectValue) return children;
408
+ return /*#__PURE__*/ (0, $7pV4n$reactjsxruntime.jsx)(context.Provider, {
409
+ value: value,
410
+ children: children
411
+ });
412
+ }
413
+
414
+
415
+ //# sourceMappingURL=TabsPicker.cjs.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AA+EM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAiF;AAC1H,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWX,MAAM;AAON,MAAM;AAQN,MAAM;;;;;;;;;;AASN,IAAI,+DAA2B,CAAA,GAAA,0BAAY,EAAE;AAC7C,SAAS,6BAAyB,MAAqB,EAAE,GAAoC;IAC3F,CAAC,QAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,QAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,SAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,aACF,YAAY,iBACZ,QAAQ,qBACR,aAAa,gBACb,QAAQ,SACR,KAAK,WACL,OAAO,iBACP,gBAAgB,iBAChB,OAAO,EACP,GAAG,aACJ,GAAG;IACJ,IAAI,UAAU;IACd,MAAM,aAAqB;IAC3B,MAAM,OAAO;IACb,IAAI,iBAAiB,MAAK,CAAC,kBAAkB,IAAI;IACjD,qBACE,iCAAC;;0BACC,gCAAC,CAAA,GAAA,iCAAS;gBACP,GAAG,WAAW;gBACf,mBAAiB,GAAG,kBAAkB,SAAS,UAAU,GAAG,CAAC,EAAE,gBAAgB;0BAC9E,CAAC,UAAC,MAAM,EAAC,iBACR;;0CACE,gCAAC,CAAA,GAAA,oCAAS;gCAAE,SAAS;;0CACrB,iCAAC,CAAA,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,QAAQ,CAAA,GAAA,8BAAG;wBAAC;oBAC5F;gBAAC;0BACD,cAAA,iCAAC;oBACC,SAAS,CAAA,GAAA,qCAAU;oBACnB,OAAO;wBACL,OAAO;4BACL,CAAC,CAAA,GAAA,uCAAW,EAAE,EAAE;gCAAC,QAAQ,CAAA,GAAA,+BAAI,EAAE;0CAAC;gCAAI;4BAAE;wBACxC;oBACF;;wBACC,CAAC,wBAAU,gCAAC,CAAA,GAAA,iCAAY;4BAAE,MAAM;4BAAM,WAAW,CAAA,GAAA,mCAAQ,EAAE;gCAAC,GAAG,WAAW;sCAAE;4BAAI;;wBAChF,OAAO,aAAa,yBAAW,gCAAC,CAAA,GAAA,8BAAG;sCAAG;6BAAmB;;;;QAIlE;;AAGN;AACA,uEAAuE;AACvE,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,YAAE,QAAQ,EAA2D;IAC3G,IAAI,gBAAgB,CAAA,GAAA,uBAAS,EAAE;IAC/B,IAAI,eACF,OAAO;IAET,qBAAO,gCAAC,QAAQ,QAAQ;QAAC,OAAO;kBAAQ;;AAC1C","sources":["packages/@react-spectrum/s2/src/TabsPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n Button,\n ContextValue,\n DEFAULT_SLOT,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SelectValue\n} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n icon,\n label,\n menuitem,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {edgeToText, focusRing, size, style} from '../style' with {type: 'macro'};\nimport {fieldInput, StyleProps} from './style-utils' with {type: 'macro'};\nimport {\n FieldLabel\n} from './Field';\nimport {FocusableRef, FocusableRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {IconContext} from './Icon';\nimport {Placement} from 'react-aria';\nimport {PopoverBase} from './Popover';\nimport {pressScale} from './pressScale';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\nexport interface PickerStyleProps {\n}\nexport interface PickerProps<T extends object> extends\n Omit<AriaSelectProps<T>, 'children' | 'style' | 'className' | 'placeholder'>,\n PickerStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number,\n /** Density of the tabs, affects the height of the picker. */\n density: 'compact' | 'regular',\n /**\n * If the tab picker should only display icon and no text for the button label.\n * @default 'show\n */\n labelBehavior?: 'show' | 'hide',\n /** Id for the SelectedValue so we can label using it. */\n valueId?: string\n}\nexport const PickerContext = createContext<ContextValue<Partial<PickerProps<any>>, FocusableRefValue<HTMLButtonElement>>>(null);\nconst inputButton = style({\n ...focusRing(),\n ...fieldInput(),\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n position: 'relative',\n font: 'ui',\n display: 'flex',\n textAlign: 'start',\n borderStyle: 'none',\n borderRadius: 'sm',\n alignItems: 'center',\n transition: 'default',\n columnGap: 'text-to-visual',\n paddingX: 0,\n backgroundColor: 'transparent',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n maxWidth: {\n isQuiet: 'max'\n },\n disableTapHighlight: true,\n height: {\n default: 48,\n density: {\n compact: 32\n }\n },\n boxSizing: 'border-box'\n});\nexport let menu = style({\n outlineStyle: 'none',\n display: 'grid',\n gridTemplateColumns: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(32)],\n boxSizing: 'border-box',\n maxHeight: '[inherit]',\n overflow: 'auto',\n padding: 8,\n fontFamily: 'sans',\n fontSize: 'control'\n});\nconst valueStyles = style({\n flexGrow: 0,\n truncate: true,\n display: 'flex',\n alignItems: 'center',\n height: 'full'\n});\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\nconst iconCenterWrapper = style({\n display: 'flex',\n gridArea: 'icon',\n paddingStart: {\n labelBehavior: {\n hide: size(6)\n }\n }\n});\nlet InsideSelectValueContext = createContext(false);\nfunction Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, PickerContext);\n let domRef = useFocusableRef(ref);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n children,\n items,\n density,\n labelBehavior = 'show',\n valueId,\n ...pickerProps\n } = props;\n let isQuiet = true;\n const menuOffset: number = 6;\n const size = 'M';\n let ariaLabelledby = props['aria-labelledby'] ?? '';\n return (\n <div>\n <AriaSelect\n {...pickerProps}\n aria-labelledby={`${labelBehavior === 'hide' ? valueId : ''} ${ariaLabelledby}`}>\n {({isOpen}) => (\n <>\n <FieldLabel isQuiet={isQuiet} />\n <Button\n ref={domRef}\n style={renderProps => pressScale(domRef)(renderProps)}\n // Prevent press scale from sticking while Picker is open.\n // @ts-ignore\n isPressed={false}\n className={renderProps => inputButton({\n ...renderProps,\n size: 'M',\n isOpen,\n isQuiet,\n density\n })}>\n <SelectValue className={valueStyles + ' ' + raw('&> * {display: none;}')}>\n {({defaultChildren}) => {\n return (\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {\n render: centerBaseline({slot: 'icon', styles: iconCenterWrapper({labelBehavior})}),\n styles: icon\n }\n }\n }],\n [TextContext, {\n slots: {\n // Default slot is useful when converting other collections to PickerItems.\n [DEFAULT_SLOT]: {\n id: valueId,\n styles: style({\n display: {\n default: 'block',\n labelBehavior: {\n hide: 'none'\n }\n },\n flexGrow: 1,\n truncate: true\n })({labelBehavior})\n }\n }\n }],\n [InsideSelectValueContext, true]\n ]}>\n {defaultChildren}\n </Provider>\n );\n }}\n </SelectValue>\n <ChevronIcon\n size={size}\n className={iconStyles} />\n </Button>\n <PopoverBase\n hideArrow\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n styles={style({\n marginStart: -12,\n minWidth: 192,\n width: '[calc(var(--trigger-width) + (-2 * self(marginStart)))]'\n })}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n description: {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu}>\n {children}\n </ListBox>\n </Provider>\n </PopoverBase>\n </>\n )}\n </AriaSelect>\n <TabLine isDisabled={props.isDisabled} />\n </div>\n );\n}\n/**\n * Pickers allow users to choose a single option from a collapsible list of options when space is limited.\n */\nlet _Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(Picker);\nexport {_Picker as Picker};\n\n\nconst selectedIndicator = style({\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: '[2px]',\n borderStyle: 'none',\n borderRadius: 'full',\n marginTop: '[-2px]',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\nfunction TabLine(props) {\n return <div className={selectedIndicator(props)} />;\n}\n\n\nexport interface PickerItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\nexport function PickerItem(props: PickerItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n const size = 'M';\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <DefaultProvider\n context={IconContext}\n value={{slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper({})}), styles: icon}\n }}}>\n <DefaultProvider\n context={TextContext}\n value={{\n slots: {\n [DEFAULT_SLOT]: {styles: label({size})}\n }\n }}>\n {!isLink && <CheckmarkIcon size={size} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text>{children}</Text> : children}\n </DefaultProvider>\n </DefaultProvider>\n );\n }}\n </ListBoxItem>\n );\n}\n// A Context.Provider that only sets a value if not inside SelectValue.\nfunction DefaultProvider({context, value, children}: {context: React.Context<any>, value: any, children: any}) {\n let inSelectValue = useContext(InsideSelectValueContext);\n if (inSelectValue) {\n return children;\n }\n return <context.Provider value={value}>{children}</context.Provider>;\n}\n"],"names":[],"version":3,"file":"TabsPicker.cjs.map"}