@procore/core-react 12.39.0 → 12.40.0
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/CHANGELOG.md +12 -0
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +9 -9
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +3 -3
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.js +6 -11
- package/dist/FileToken/FileToken.js.map +1 -1
- package/dist/FileToken/FileToken.styles.d.ts +2 -0
- package/dist/FileToken/FileToken.styles.js +14 -4
- package/dist/FileToken/FileToken.styles.js.map +1 -1
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.styles.js +13 -13
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.styles.js +11 -11
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/MultiSelect/MultiSelect.styles.js +8 -8
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.d.ts +1 -2
- package/dist/Panel/Panel.js +27 -49
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/Panel/Panel.styles.js +13 -13
- package/dist/Panel/Panel.styles.js.map +1 -1
- package/dist/Panel/Panel.types.d.ts +0 -14
- package/dist/Panel/Panel.types.js.map +1 -1
- package/dist/Pill/Pill.styles.js +3 -3
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.styles.js +8 -8
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +10 -10
- package/dist/SplitViewCard/SplitViewCard.styles.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +38 -38
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.js +23 -9
- package/dist/Tabs/Tabs.js.map +1 -1
- package/dist/Tabs/Tabs.styles.d.ts +2 -2
- package/dist/Tabs/Tabs.styles.js +26 -26
- package/dist/Tabs/Tabs.styles.js.map +1 -1
- package/dist/Tabs/Tabs.types.d.ts +6 -0
- package/dist/Tabs/Tabs.types.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.js +3 -1
- package/dist/ToolHeader/ToolHeader.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/Tooltip/Tooltip.styles.js +3 -3
- package/dist/Tree/Tree.js +1 -1
- package/dist/Tree/Tree.styles.js +10 -10
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/I18n.d.ts +170 -0
- package/dist/_locales/de-DE.json +12 -2
- package/dist/_locales/en-AU.json +12 -2
- package/dist/_locales/en-CA.json +12 -2
- package/dist/_locales/en-GB.json +12 -2
- package/dist/_locales/es-ES.json +12 -2
- package/dist/_locales/es.json +12 -2
- package/dist/_locales/fr-CA.json +12 -2
- package/dist/_locales/fr-FR.json +12 -2
- package/dist/_locales/is-IS.json +12 -2
- package/dist/_locales/it-IT.json +12 -2
- package/dist/_locales/ja-JP.json +12 -2
- package/dist/_locales/pl-PL.json +12 -2
- package/dist/_locales/pt-BR.json +12 -2
- package/dist/_locales/pt-PT.json +13 -3
- package/dist/_locales/th-TH.json +12 -2
- package/dist/_locales/zh-SG.json +12 -2
- package/dist/_locales/zh-TW.json +12 -2
- package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
- package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +15 -15
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +13 -13
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +31 -31
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +760 -760
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +54 -54
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +1 -1
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +77 -77
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +33 -33
- package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +48 -48
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +33 -33
- package/dist/_typedoc/PageLayout/PageLayout.types.json +28 -28
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +27 -63
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +67 -67
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
- package/dist/_typedoc/Table/Table.types.json +102 -102
- package/dist/_typedoc/Tabs/Tabs.types.json +30 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +11 -11
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +43 -43
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +29 -29
- package/dist/_typedoc/Tile/Tile.types.json +8 -8
- package/dist/_typedoc/Title/Title.types.json +1 -1
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +7 -7
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +8 -8
- package/dist/_typedoc/Tooltip/Tooltip.types.json +15 -15
- package/dist/_typedoc/Tree/Tree.types.json +88 -88
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/package.json +3 -3
package/dist/Tabs/Tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","names":["CaretDown","CaretUp","React","useButton","MenuImperative","OverlayTrigger","useOverlayTriggerContext","useI18nContext","useResize","spacing","addSubcomponents","getBoundingRect","mergeRefs","getStyledComponents","StyledOverlay","StyledTabList","StyledTabs","ExtraTabSpacing","xxl","HelixHeaderExtraTabSpacing","sm","noop","Link","forwardRef","_ref","ref","children","_ref$UNSAFE_helixHead","UNSAFE_helixHeader","props","_objectWithoutProperties","_excluded","Styled","createElement","_extends","TabInternal","_ref2","as","disabled","role","_ref2$active","active","_ref2$selected","selected","onBlur","onFocus","_ref2$onMount","onMount","_ref2$onUnmount","onUnmount","_ref2$overflowing","overflowing","_ref2$dropdown","dropdown","_ref2$variant","variant","_ref2$UNSAFE_helixHea","_excluded2","_ref3","onPress","onClick","value","buttonPropsBase","_excluded3","elementType","_useButton","_objectSpread","isDisabled","type","buttonProps","a11yProps","$clickable","innerRef","useRef","useEffect","current","validChild","isValidElement","tabSelected","roleSpecificProps","Tab","$selected","$dark","dark","TabInner","cloneElement","undefined","MoreMenu","_ref4","id","ctx","menuRef","_menuRef$current","_menuRef$current$el","_menuRef$current2","_menuRef$current3","el","focus","highlightFirst","highlightSelected","onSelect","selection","hide","event","Options","Children","map","child","i","Item","item","key","Tabs_","Tabs","_ref5","className","_ref5$dark","qa","_ref5$UNSAFE_helixHea","_excluded4","i18n","_React$useState","useState","_React$useState2","_slicedToArray","moreMenuIsShown","setMoreMenuIsShown","_React$useState3","_React$useState4","tabElements","setTabElements","_React$useState5","_React$useState6","cutoffIndex","setCutoffIndex","containerRef","recalculate","container","_tabElements$reduce","reduce","acc","rect","extraSpace","subtotals","concat","_toConsumableArray","total","width","Array","index","findIndex","val","onResize","filtered","toArray","filter","slice","isOverflowingSelected","some","elements","oldElements","autoFocus","beforeShow","afterHide","trigger","passA11yPropsToOverlay","placement","overlay","DropdownTab","length","DropdownTabInner","more","t","size","displayName"],"sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import { CaretDown, CaretUp } from '@procore/core-icons/dist'\nimport React from 'react'\n\nimport { useButton } from '@react-aria/button'\nimport { MenuImperative } from '../MenuImperative/MenuImperative'\nimport type { MenuRef, Selection } from '../MenuImperative/MenuImperative.types'\nimport {\n OverlayTrigger,\n useOverlayTriggerContext,\n} from '../OverlayTrigger/OverlayTrigger'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useResize } from '../_hooks/Resize'\nimport { spacing } from '../_styles/spacing'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport { getBoundingRect } from '../_utils/dom'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport {\n getStyledComponents,\n StyledOverlay,\n StyledTabList,\n StyledTabs,\n} from './Tabs.styles'\nimport type {\n BaseTabProps,\n TabDropdownProps,\n TabProps,\n TabRef,\n TabRole,\n TabRoleType,\n TabsProps,\n} from './Tabs.types'\n\nconst ExtraTabSpacing = spacing.xxl\nconst HelixHeaderExtraTabSpacing = spacing.sm\n\nfunction noop() {}\n\nexport const Link = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement> & {\n /** @deprecated @experimental Alternative style variant. To be used on Helix Header ONLY */\n UNSAFE_helixHeader?: boolean\n }\n>(function Link({ children, UNSAFE_helixHeader = false, ...props }, ref) {\n const Styled = getStyledComponents(UNSAFE_helixHeader)\n\n return (\n <Styled.Link ref={ref} {...props}>\n {children}\n </Styled.Link>\n )\n})\n\nfunction TabInternal(\n {\n as,\n disabled,\n role,\n active = false,\n selected = false,\n children,\n onBlur,\n onFocus,\n onMount = noop,\n onUnmount = noop,\n overflowing = false,\n dropdown = false,\n variant = '',\n UNSAFE_helixHeader = false,\n ...props\n }: TabProps<TabRoleType>,\n ref: TabRef<TabRoleType>\n) {\n const { onPress, onClick, value, ...buttonPropsBase } =\n props as TabProps<'button'>\n\n const elementType =\n role === 'link' ? 'a' : role === 'button' ? 'button' : 'div'\n\n const { buttonProps } = useButton(\n {\n ...buttonPropsBase,\n onBlur: onBlur as (e: React.FocusEvent) => void,\n onFocus: onFocus as (e: React.FocusEvent) => void,\n elementType,\n isDisabled: disabled,\n onPress,\n type: 'button',\n },\n ref as unknown as React.RefObject<HTMLElement>\n )\n\n const a11yProps =\n role === 'button'\n ? {\n ...buttonProps,\n 'aria-current': selected || active,\n as: as || 'button',\n $clickable: !disabled,\n }\n : role === 'link'\n ? {\n ...buttonProps,\n 'aria-current': selected || active,\n as: as || 'a',\n $clickable: !disabled,\n }\n : role === 'tab'\n ? { role: 'tab', onBlur, onFocus }\n : { onBlur, onFocus }\n\n const innerRef = React.useRef<HTMLDivElement>(null)\n\n React.useEffect(() => {\n onMount(innerRef.current)\n return onUnmount\n }, [])\n\n const validChild = React.isValidElement(children)\n const tabSelected = active || variant === 'active' || selected\n\n const Styled = getStyledComponents(UNSAFE_helixHeader)\n\n // For button/link roles, spread buttonPropsBase to preserve useButton's onClick\n // For other roles, spread all props\n const roleSpecificProps =\n role === 'button' || role === 'link'\n ? (buttonPropsBase as Omit<\n TabProps<'button'>,\n 'onPress' | 'onClick' | 'value'\n >)\n : (props as TabProps<TabRoleType>)\n\n return (\n <Styled.Tab\n $selected={tabSelected}\n $dark={props.dark}\n ref={\n mergeRefs(\n (ref || null) as unknown as React.Ref<HTMLDivElement>,\n innerRef\n ) as unknown as React.RefCallback<HTMLDivElement>\n }\n {...(a11yProps as Record<string, unknown>)}\n {...(roleSpecificProps as Record<string, unknown>)}\n >\n <Styled.TabInner $selected={tabSelected} $dark={props.dark}>\n {validChild\n ? React.cloneElement(\n children as React.ReactElement<\n Record<string, unknown>,\n string | React.JSXElementConstructor<unknown>\n >,\n {\n 'aria-current': tabSelected ? true : undefined,\n }\n )\n : children}\n </Styled.TabInner>\n </Styled.Tab>\n )\n}\n\nexport const Tab = React.forwardRef(TabInternal) as <Role extends TabRole>(\n props:\n | TabProps<Role>\n | (BaseTabProps & { ref?: React.ComponentPropsWithRef<'div'>['ref'] })\n) => ReturnType<typeof TabInternal>\n\nexport const MoreMenu = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & TabDropdownProps\n>(function MoreMenu({ children, id }, ref) {\n const ctx = useOverlayTriggerContext()\n\n const menuRef = React.useRef<MenuRef | null>(null)\n\n React.useEffect(function () {\n menuRef.current?.el?.focus()\n menuRef.current?.highlightFirst()\n menuRef.current?.highlightSelected()\n }, [])\n\n function onSelect(selection: Selection) {\n ctx.hide(selection.event)\n }\n\n return (\n <StyledOverlay ref={ref}>\n <MenuImperative id={id} role=\"menu\" ref={menuRef} onSelect={onSelect}>\n <MenuImperative.Options>\n {React.Children.map(children, (child, i) => {\n if (React.isValidElement<BaseTabProps>(child)) {\n return (\n <MenuImperative.Item\n item={null}\n key={i}\n selected={child.props.selected || child.props.active}\n >\n {React.cloneElement(\n child as React.ReactElement<BaseTabProps>,\n { ref: null } as Partial<BaseTabProps>\n )}\n </MenuImperative.Item>\n )\n }\n })}\n </MenuImperative.Options>\n </MenuImperative>\n </StyledOverlay>\n )\n})\n\nconst Tabs_ = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & TabsProps\n>(function Tabs(\n {\n children,\n className,\n dark = false,\n qa,\n UNSAFE_helixHeader = false,\n ...props\n },\n ref\n) {\n const i18n = useI18nContext()\n\n const [moreMenuIsShown, setMoreMenuIsShown] = React.useState(false)\n const [tabElements, setTabElements] = React.useState<\n (HTMLDivElement | null)[]\n >([])\n const [cutoffIndex, setCutoffIndex] = React.useState(0)\n\n const containerRef = React.useRef<HTMLDivElement>(null)\n\n function recalculate() {\n const container = getBoundingRect(containerRef.current!)\n\n const { subtotals } = tabElements.reduce(\n (acc, el) => {\n if (!el) {\n return acc\n }\n const rect = getBoundingRect(el)\n const extraSpace = UNSAFE_helixHeader\n ? HelixHeaderExtraTabSpacing\n : ExtraTabSpacing\n return {\n subtotals: [...acc.subtotals, acc.total + rect.width],\n total: acc.total + rect.width + extraSpace,\n }\n },\n { subtotals: new Array(), total: 0 }\n )\n\n const index = subtotals.findIndex((val: number) => val >= container.width)\n\n setCutoffIndex(index)\n }\n\n useResize({ onResize: recalculate })\n\n React.useEffect(recalculate)\n\n const filtered = React.Children.toArray(children).filter((child) => child)\n\n const overflowing = filtered.slice(cutoffIndex - 1)\n\n const isOverflowingSelected = React.Children.toArray(overflowing).some(\n (child) =>\n React.isValidElement(child) &&\n (child.props.active || child.props.selected)\n )\n\n const Styled = getStyledComponents(UNSAFE_helixHeader)\n\n return (\n <StyledTabs ref={ref} $dark={dark} index={cutoffIndex} {...props}>\n <StyledTabList ref={containerRef}>\n {filtered.map((child, i) => {\n if (React.isValidElement(child))\n return React.cloneElement(\n child as React.ReactElement<\n BaseTabProps & {\n dark?: boolean\n onMount?: (el: HTMLDivElement | null) => void\n onUnmount?: () => void\n }\n >,\n {\n dark,\n onMount: (el: HTMLDivElement | null) => {\n setTabElements((elements) => {\n const oldElements = [...elements]\n oldElements[i] = el\n return oldElements\n })\n },\n onUnmount: () => {\n setTabElements((elements) => {\n const oldElements = [...elements]\n oldElements[i] = null\n return oldElements\n })\n },\n }\n )\n })}\n\n <OverlayTrigger\n autoFocus\n beforeShow={() => setMoreMenuIsShown(true)}\n afterHide={() => setMoreMenuIsShown(false)}\n trigger=\"click\"\n passA11yPropsToOverlay\n placement=\"bottom-right\"\n overlay={<MoreMenu>{overflowing}</MoreMenu>}\n ref={ref}\n role=\"menu\"\n >\n <Styled.DropdownTab\n $selected={isOverflowingSelected}\n $dark={dark}\n aria-hidden={!overflowing.length}\n as=\"button\"\n >\n <Styled.DropdownTabInner\n $selected={isOverflowingSelected}\n $dark={dark}\n >\n <Styled.Link data-qa={qa?.more}>\n {i18n.t('core.tabs.more')}\n </Styled.Link>\n {moreMenuIsShown ? (\n <CaretUp size=\"sm\" />\n ) : (\n <CaretDown size=\"sm\" />\n )}\n </Styled.DropdownTabInner>\n </Styled.DropdownTab>\n </OverlayTrigger>\n </StyledTabList>\n </StyledTabs>\n )\n})\n\nTabs_.displayName = 'Tabs'\n\nLink.displayName = 'Tabs.Link'\n\n// @ts-ignore\nTab.displayName = 'Tabs.Tab'\n\n/**\n\n We use tabs to navigate between different, but related content.\n Tabs are commonly used on tool landing pages and on item detail pages.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-tabs--demo)\n\n @see [Design Guidelines](https://design.procore.com/tabs)\n\n */\nexport const Tabs = addSubcomponents(\n {\n Link,\n Tab,\n },\n Tabs_\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,0BAA0B;AAC7D,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,cAAc,QAAQ,kCAAkC;AAEjE,SACEC,cAAc,EACdC,wBAAwB,QACnB,kCAAkC;AACzC,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SACEC,mBAAmB,EACnBC,aAAa,EACbC,aAAa,EACbC,UAAU,QACL,eAAe;AAWtB,IAAMC,eAAe,GAA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+B,aAAA,CAACD,MAAM,CAACwI,WAAW;IACjBvF,SAAS,EAAE4E,qBAAsB;IACjC3E,KAAK,EAAEC,IAAK;IACZ,eAAa,CAAChC,WAAW,CAACsH,MAAO;IACjCpI,EAAE,EAAC;EAAQ,gBAEXnC,KAAA,CAAA+B,aAAA,CAACD,MAAM,CAAC0I,gBAAgB;IACtBzF,SAAS,EAAE4E,qBAAsB;IACjC3E,KAAK,EAAEC;EAAK,gBAEZjF,KAAA,CAAA+B,aAAA,CAACD,MAAM,CAACV,IAAI;IAAC,WAAS+F,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CAAEsD;EAAK,GAC5BnD,IAAI,CAACoD,CAAC,CAAC,gBAAgB,CACb,CAAC,EACb/C,eAAe,gBACd3H,KAAA,CAAA+B,aAAA,CAAChC,OAAO;IAAC4K,IAAI,EAAC;EAAI,CAAE,CAAC,gBAErB3K,KAAA,CAAA+B,aAAA,CAACjC,SAAS;IAAC6K,IAAI,EAAC;EAAI,CAAE,CAED,CACP,CACN,CACH,CACL,CAAC;AAEjB,CAAC,CAAC;AAEF7D,KAAK,CAAC8D,WAAW,GAAG,MAAM;AAE1BxJ,IAAI,CAACwJ,WAAW,GAAG,WAAW;;AAE9B;AACA9F,GAAG,CAAC8F,WAAW,GAAG,UAAU;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAM7D,IAAI,GAAGvG,gBAAgB,CAClC;EACEY,IAAI,EAAJA,IAAI;EACJ0D,GAAG,EAAHA;AACF,CAAC,EACDgC,KACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":["CaretDown","CaretUp","React","useButton","MenuImperative","OverlayTrigger","useOverlayTriggerContext","useI18nContext","useResize","spacing","addSubcomponents","getBoundingRect","mergeRefs","getStyledComponents","StyledOverlay","StyledTabList","StyledTabs","ExtraTabSpacing","xxl","HelixHeaderExtraTabSpacing","sm","noop","Link","forwardRef","_ref","ref","children","_ref$UNSAFE_helixHead","UNSAFE_helixHeader","props","_objectWithoutProperties","_excluded","Styled","createElement","_extends","TabInternal","_ref2","as","disabled","role","_ref2$active","active","_ref2$selected","selected","onBlur","onFocus","_ref2$onMount","onMount","_ref2$onUnmount","onUnmount","_ref2$overflowing","overflowing","_ref2$dropdown","dropdown","_ref2$variant","variant","_ref2$UNSAFE_helixHea","_excluded2","_ref3","onPress","onClick","value","buttonPropsBase","_excluded3","elementType","_useButton","_objectSpread","isDisabled","type","buttonProps","shouldDefaultToButton","a11yProps","$clickable","innerRef","useRef","useEffect","current","validChild","isValidElement","tabSelected","roleSpecificProps","Tab","$selected","$dark","dark","TabInner","cloneElement","undefined","MoreMenu","_ref4","id","ctx","menuRef","_menuRef$current","_menuRef$current$el","_menuRef$current2","_menuRef$current3","el","focus","highlightFirst","highlightSelected","onSelect","selection","hide","event","onChangeActiveDescendant","Options","Children","map","child","i","Item","item","key","Tabs_","Tabs","_ref5","className","_ref5$dark","qa","_ref5$UNSAFE_helixHea","_excluded4","i18n","_React$useState","useState","_React$useState2","_slicedToArray","moreMenuIsShown","setMoreMenuIsShown","_React$useState3","_React$useState4","tabElements","setTabElements","_React$useState5","_React$useState6","cutoffIndex","setCutoffIndex","containerRef","recalculate","container","_tabElements$reduce","reduce","acc","rect","extraSpace","subtotals","concat","_toConsumableArray","total","width","Array","index","findIndex","val","onResize","filtered","toArray","filter","slice","isOverflowingSelected","some","$index","elements","oldElements","t","beforeShow","afterHide","trigger","placement","overlay","DropdownTab","length","DropdownTabInner","more","size","displayName"],"sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import { CaretDown, CaretUp } from '@procore/core-icons/dist'\nimport React from 'react'\n\nimport { useButton } from '@react-aria/button'\nimport { MenuImperative } from '../MenuImperative/MenuImperative'\nimport type { MenuRef, Selection } from '../MenuImperative/MenuImperative.types'\nimport {\n OverlayTrigger,\n useOverlayTriggerContext,\n} from '../OverlayTrigger/OverlayTrigger'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useResize } from '../_hooks/Resize'\nimport { spacing } from '../_styles/spacing'\nimport { addSubcomponents } from '../_utils/addSubcomponents'\nimport { getBoundingRect } from '../_utils/dom'\nimport { mergeRefs } from '../_utils/mergeRefs'\nimport {\n getStyledComponents,\n StyledOverlay,\n StyledTabList,\n StyledTabs,\n} from './Tabs.styles'\nimport type {\n BaseTabProps,\n TabDropdownProps,\n TabProps,\n TabRef,\n TabRole,\n TabRoleType,\n TabsProps,\n} from './Tabs.types'\n\nconst ExtraTabSpacing = spacing.xxl\nconst HelixHeaderExtraTabSpacing = spacing.sm\n\nfunction noop() {}\n\nexport const Link = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement> & {\n /** @deprecated @experimental Alternative style variant. To be used on Helix Header ONLY */\n UNSAFE_helixHeader?: boolean\n }\n>(function Link({ children, UNSAFE_helixHeader = false, ...props }, ref) {\n const Styled = getStyledComponents(UNSAFE_helixHeader)\n\n return (\n <Styled.Link ref={ref} {...props}>\n {children}\n </Styled.Link>\n )\n})\n\nfunction TabInternal(\n {\n as,\n disabled,\n role,\n active = false,\n selected = false,\n children,\n onBlur,\n onFocus,\n onMount = noop,\n onUnmount = noop,\n overflowing = false,\n dropdown = false,\n variant = '',\n UNSAFE_helixHeader = false,\n ...props\n }: TabProps<TabRoleType>,\n ref: TabRef<TabRoleType>\n) {\n const { onPress, onClick, value, ...buttonPropsBase } =\n props as TabProps<'button'>\n\n const elementType =\n role === 'link' ? 'a' : role === 'button' ? 'button' : 'div'\n\n const { buttonProps } = useButton(\n {\n ...buttonPropsBase,\n onBlur: onBlur as (e: React.FocusEvent) => void,\n onFocus: onFocus as (e: React.FocusEvent) => void,\n elementType,\n isDisabled: disabled,\n // @ts-expect-error Type 'PressEvent' is missing properties from type 'MouseEvent<HTMLButtonElement, MouseEvent>', the expected type comes from property 'onPress' which is declared here on type 'AriaButtonOptions<ElementType>'\n onPress: onPress || onClick,\n type: 'button',\n },\n ref as unknown as React.RefObject<HTMLElement>\n )\n\n // See if we should make the component a button if event handlers are given.\n // The no role check addition allows overrides / opt-out, for like\n // role = presentation or role = link having click handlers for some reason.\n const shouldDefaultToButton = (!role && onPress) || (!role && onClick)\n\n const a11yProps =\n role === 'button' || shouldDefaultToButton\n ? {\n ...buttonProps,\n role: 'button',\n 'aria-current': selected || active,\n as: as || 'button',\n $clickable: !disabled,\n }\n : role === 'link'\n ? {\n ...buttonProps,\n role: 'link',\n 'aria-current': selected || active,\n as: as || 'a',\n $clickable: !disabled,\n }\n : role === 'tab'\n ? { role: 'tab', onBlur, onFocus }\n : { role, onBlur, onFocus }\n\n const innerRef = React.useRef<HTMLDivElement>(null)\n\n React.useEffect(() => {\n onMount(innerRef.current)\n return onUnmount\n }, [])\n\n const validChild = React.isValidElement(children)\n const tabSelected = active || variant === 'active' || selected\n\n const Styled = getStyledComponents(UNSAFE_helixHeader)\n\n // For button/link roles, spread buttonPropsBase to preserve useButton's onClick\n // For other roles, spread all props\n const roleSpecificProps =\n role === 'button' || role === 'link'\n ? (buttonPropsBase as Omit<\n TabProps<'button'>,\n 'onPress' | 'onClick' | 'value'\n >)\n : (props as TabProps<TabRoleType>)\n\n return (\n <Styled.Tab\n $selected={tabSelected}\n $dark={props.dark}\n ref={\n mergeRefs(\n (ref || null) as unknown as React.Ref<HTMLDivElement>,\n innerRef\n ) as unknown as React.RefCallback<HTMLDivElement>\n }\n {...(a11yProps as Record<string, unknown>)}\n {...(roleSpecificProps as Record<string, unknown>)}\n >\n <Styled.TabInner $selected={tabSelected} $dark={props.dark}>\n {validChild\n ? React.cloneElement(\n children as React.ReactElement<\n Record<string, unknown>,\n string | React.JSXElementConstructor<unknown>\n >,\n {\n 'aria-current': tabSelected ? true : undefined,\n }\n )\n : children}\n </Styled.TabInner>\n </Styled.Tab>\n )\n}\n\nexport const Tab = React.forwardRef(TabInternal) as <Role extends TabRole>(\n props:\n | TabProps<Role>\n | (BaseTabProps & { ref?: React.ComponentPropsWithRef<'div'>['ref'] })\n) => ReturnType<typeof TabInternal>\n\nexport const MoreMenu = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & TabDropdownProps\n>(function MoreMenu({ children, id }, ref) {\n const ctx = useOverlayTriggerContext()\n\n const menuRef = React.useRef<MenuRef | null>(null)\n\n React.useEffect(function () {\n menuRef.current?.el?.focus()\n menuRef.current?.highlightFirst()\n menuRef.current?.highlightSelected()\n }, [])\n\n function onSelect(selection: Selection) {\n ctx.hide(selection.event)\n }\n\n return (\n <StyledOverlay ref={ref}>\n <MenuImperative\n role=\"none\"\n id={id}\n ref={menuRef}\n onSelect={onSelect}\n onChangeActiveDescendant={() => null} // remove arrow keyboard\n >\n <MenuImperative.Options aria-label={null}>\n {React.Children.map(children, (child, i) => {\n if (React.isValidElement<BaseTabProps>(child)) {\n return (\n <MenuImperative.Item\n item={null}\n key={i}\n selected={child.props.selected || child.props.active}\n >\n {React.cloneElement(\n child as React.ReactElement<BaseTabProps>,\n {\n ref: null,\n } as Partial<BaseTabProps>\n )}\n </MenuImperative.Item>\n )\n }\n })}\n </MenuImperative.Options>\n </MenuImperative>\n </StyledOverlay>\n )\n})\n\nconst Tabs_ = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & TabsProps\n>(function Tabs(\n {\n children,\n className,\n dark = false,\n qa,\n UNSAFE_helixHeader = false,\n ...props\n },\n ref\n) {\n const i18n = useI18nContext()\n\n const [moreMenuIsShown, setMoreMenuIsShown] = React.useState(false)\n const [tabElements, setTabElements] = React.useState<\n (HTMLDivElement | null)[]\n >([])\n const [cutoffIndex, setCutoffIndex] = React.useState(0)\n\n const containerRef = React.useRef<HTMLDivElement>(null)\n\n function recalculate() {\n const container = getBoundingRect(containerRef.current!)\n\n const { subtotals } = tabElements.reduce(\n (acc, el) => {\n if (!el) {\n return acc\n }\n const rect = getBoundingRect(el)\n const extraSpace = UNSAFE_helixHeader\n ? HelixHeaderExtraTabSpacing\n : ExtraTabSpacing\n return {\n subtotals: [...acc.subtotals, acc.total + rect.width],\n total: acc.total + rect.width + extraSpace,\n }\n },\n { subtotals: new Array(), total: 0 }\n )\n\n const index = subtotals.findIndex((val: number) => val >= container.width)\n\n setCutoffIndex(index)\n }\n\n useResize({ onResize: recalculate })\n\n React.useEffect(recalculate)\n\n const filtered = React.Children.toArray(children).filter((child) => child)\n\n const overflowing = filtered.slice(cutoffIndex - 1)\n\n const isOverflowingSelected = React.Children.toArray(overflowing).some(\n (child) =>\n React.isValidElement(child) &&\n (child.props.active || child.props.selected)\n )\n\n const Styled = getStyledComponents(UNSAFE_helixHeader)\n\n return (\n <StyledTabs\n ref={ref}\n role=\"group\"\n $dark={dark}\n $index={cutoffIndex}\n {...props}\n >\n <StyledTabList ref={containerRef}>\n {filtered.map((child, i) => {\n if (React.isValidElement(child))\n return React.cloneElement(\n child as React.ReactElement<\n BaseTabProps & {\n dark?: boolean\n onMount?: (el: HTMLDivElement | null) => void\n onUnmount?: () => void\n }\n >,\n {\n dark,\n onMount: (el: HTMLDivElement | null) => {\n setTabElements((elements) => {\n const oldElements = [...elements]\n oldElements[i] = el\n return oldElements\n })\n },\n onUnmount: () => {\n setTabElements((elements) => {\n const oldElements = [...elements]\n oldElements[i] = null\n return oldElements\n })\n },\n }\n )\n })}\n\n <OverlayTrigger\n aria-label={i18n.t('core.tabs.more')}\n beforeShow={() => setMoreMenuIsShown(true)}\n afterHide={() => setMoreMenuIsShown(false)}\n trigger=\"click\"\n placement=\"bottom-right\"\n overlay={<MoreMenu>{overflowing}</MoreMenu>}\n ref={ref}\n role=\"dialog\"\n >\n <Styled.DropdownTab\n $selected={isOverflowingSelected}\n $dark={dark}\n aria-hidden={!overflowing.length}\n as=\"button\"\n >\n <Styled.DropdownTabInner\n $selected={isOverflowingSelected}\n $dark={dark}\n >\n <Styled.Link data-qa={qa?.more}>\n {i18n.t('core.tabs.more')}\n </Styled.Link>\n {moreMenuIsShown ? (\n <CaretUp size=\"sm\" />\n ) : (\n <CaretDown size=\"sm\" />\n )}\n </Styled.DropdownTabInner>\n </Styled.DropdownTab>\n </OverlayTrigger>\n </StyledTabList>\n </StyledTabs>\n )\n})\n\nTabs_.displayName = 'Tabs'\n\nLink.displayName = 'Tabs.Link'\n\n// @ts-ignore\nTab.displayName = 'Tabs.Tab'\n\n/**\n\n We use tabs to navigate between different, but related content.\n Tabs are commonly used on tool landing pages and on item detail pages.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-tabs--demo)\n\n @see [Design Guidelines](https://design.procore.com/tabs)\n\n */\nexport const Tabs = addSubcomponents(\n {\n Link,\n Tab,\n },\n Tabs_\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,0BAA0B;AAC7D,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,cAAc,QAAQ,kCAAkC;AAEjE,SACEC,cAAc,EACdC,wBAAwB,QACnB,kCAAkC;AACzC,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SACEC,mBAAmB,EACnBC,aAAa,EACbC,aAAa,EACbC,UAAU,QACL,eAAe;AAWtB,IAAMC,eAAe,GAAGR,OAAO,CAACS,GAAG;AACnC,IAAMC,0BAA0B,GAAGV,OAAO,CAACW,EAAE;AAE7C,SAASC,IAAIA,CAAA,EAAG,CAAC;AAEjB,OAAO,IAAMC,IAAI,gBAAGpB,KAAK,CAACqB,UAAU,CAMlC,SAASD,IAAIA,CAAAE,IAAA,EAAqDC,GAAG,EAAE;EAAA,IAAvDC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAAC,qBAAA,GAAA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,CAACuD,QAAQ,QAAErC,WAAsB,CAAE;IAC5C1B,GAAG,EAAEA,GAAI;IACTc,IAAI,EAAC;EAAQ,gBAEbrC,KAAA,CAAA+B,aAAA,CAACD,MAAM,CAAC0I,WAAW;IACjBxF,SAAS,EAAE6E,qBAAsB;IACjC5E,KAAK,EAAEC,IAAK;IACZ,eAAa,CAACjC,WAAW,CAACwH,MAAO;IACjCtI,EAAE,EAAC;EAAQ,gBAEXnC,KAAA,CAAA+B,aAAA,CAACD,MAAM,CAAC4I,gBAAgB;IACtB1F,SAAS,EAAE6E,qBAAsB;IACjC5E,KAAK,EAAEC;EAAK,gBAEZlF,KAAA,CAAA+B,aAAA,CAACD,MAAM,CAACV,IAAI;IAAC,WAASiG,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CAAEsD;EAAK,GAC5BnD,IAAI,CAAC0C,CAAC,CAAC,gBAAgB,CACb,CAAC,EACbrC,eAAe,gBACd7H,KAAA,CAAA+B,aAAA,CAAChC,OAAO;IAAC6K,IAAI,EAAC;EAAI,CAAE,CAAC,gBAErB5K,KAAA,CAAA+B,aAAA,CAACjC,SAAS;IAAC8K,IAAI,EAAC;EAAI,CAAE,CAED,CACP,CACN,CACH,CACL,CAAC;AAEjB,CAAC,CAAC;AAEF5D,KAAK,CAAC6D,WAAW,GAAG,MAAM;AAE1BzJ,IAAI,CAACyJ,WAAW,GAAG,WAAW;;AAE9B;AACA9F,GAAG,CAAC8F,WAAW,GAAG,UAAU;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAM5D,IAAI,GAAGzG,gBAAgB,CAClC;EACEY,IAAI,EAAJA,IAAI;EACJ2D,GAAG,EAAHA;AACF,CAAC,EACDiC,KACF,CAAC"}
|
|
@@ -7,9 +7,9 @@ export declare const StyledOverlay: import("styled-components/dist/types").IStyl
|
|
|
7
7
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
8
8
|
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("../Card").CardProps & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
9
9
|
export declare const StyledTabList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
|
-
export declare const StyledTabs: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<
|
|
10
|
+
export declare const StyledTabs: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
11
11
|
$dark?: boolean | undefined;
|
|
12
|
-
index?: number | undefined;
|
|
12
|
+
$index?: number | undefined;
|
|
13
13
|
}>> & string;
|
|
14
14
|
/**
|
|
15
15
|
* Switches between different Tab styles of traditional and helix header navigation.
|
package/dist/Tabs/Tabs.styles.js
CHANGED
|
@@ -17,17 +17,17 @@ var borderRadius = /*#__PURE__*/css(["border-radius:", "px ", "px 0 0;"], spacin
|
|
|
17
17
|
*/
|
|
18
18
|
var StyledTabBase = /*#__PURE__*/styled.div.withConfig({
|
|
19
19
|
displayName: "StyledTabBase",
|
|
20
|
-
componentId: "core-
|
|
20
|
+
componentId: "core-12_40_0__sc-17s58xs-0"
|
|
21
21
|
})(["align-items:center;box-sizing:border-box;cursor:pointer;display:inline-flex;flex:0 0 auto;justify-content:center;position:relative;white-space:nowrap;text-decoration:none;background-color:transparent;border:none;font-family:inherit;padding:0;"]);
|
|
22
22
|
var StyledTabInnerBase = /*#__PURE__*/styled.div.withConfig({
|
|
23
23
|
displayName: "StyledTabInnerBase",
|
|
24
|
-
componentId: "core-
|
|
24
|
+
componentId: "core-12_40_0__sc-17s58xs-1"
|
|
25
25
|
})(["align-self:baseline;box-sizing:border-box;&,> a{display:flex;text-decoration:none;width:100%;}"]);
|
|
26
26
|
|
|
27
27
|
// This so that it can be visible/hidden via CSS down below
|
|
28
28
|
var StyledDropdownTabBase = /*#__PURE__*/styled(StyledTabBase).withConfig({
|
|
29
29
|
displayName: "StyledDropdownTabBase",
|
|
30
|
-
componentId: "core-
|
|
30
|
+
componentId: "core-12_40_0__sc-17s58xs-2"
|
|
31
31
|
})(["", ""], hiddenTab);
|
|
32
32
|
|
|
33
33
|
//// END BASE LAYOUT COMPONENTS FOR TABS ////
|
|
@@ -38,7 +38,7 @@ var StyledDropdownTabBase = /*#__PURE__*/styled(StyledTabBase).withConfig({
|
|
|
38
38
|
* Styles specific to the Design System general cases (not Global nav)
|
|
39
39
|
*/
|
|
40
40
|
function getTabStyle() {
|
|
41
|
-
return css(["", ";height:26px;& + ", "{margin-left:", "px;}a&{", "}&,a&,button&{", "}&:focus
|
|
41
|
+
return css(["", ";height:26px;& + ", "{margin-left:", "px;}a&{", "}&,a&,button&{", "}&:focus-visible,&:hover{background:", ";}&:focus-visible{box-shadow:inset 0 0 0 2px ", ";outline:none;a{outline:none;}}"], borderRadius, StyledTabBase, spacing.xl, borderRadius, function (_ref) {
|
|
42
42
|
var $selected = _ref.$selected;
|
|
43
43
|
if ($selected) {
|
|
44
44
|
return css(["border-bottom:3px solid ", ";"], colors.gray15);
|
|
@@ -50,15 +50,15 @@ function getTabStyle() {
|
|
|
50
50
|
}
|
|
51
51
|
var StyledTab = /*#__PURE__*/styled(StyledTabBase).withConfig({
|
|
52
52
|
displayName: "StyledTab",
|
|
53
|
-
componentId: "core-
|
|
53
|
+
componentId: "core-12_40_0__sc-17s58xs-3"
|
|
54
54
|
})(["", ""], getTabStyle);
|
|
55
55
|
var StyledTabInner = /*#__PURE__*/styled(StyledTabInnerBase).withConfig({
|
|
56
56
|
displayName: "StyledTabInner",
|
|
57
|
-
componentId: "core-
|
|
58
|
-
})(["", " padding:0 ", "px;font-weight:", ";&,> a{", ";color:", ";height:23px;}", ""], getTypographyIntent('body'), spacing.xs, function (_ref3) {
|
|
57
|
+
componentId: "core-12_40_0__sc-17s58xs-4"
|
|
58
|
+
})(["", " padding:0 ", "px;font-weight:", ";&,> a{", ";color:", ";height:23px;}& a:focus-visible{outline:2px solid ", ";outline-offset:-1px;border-radius:", "px;}", ""], getTypographyIntent('body'), spacing.xs, function (_ref3) {
|
|
59
59
|
var $selected = _ref3.$selected;
|
|
60
60
|
return $selected ? 600 : 400;
|
|
61
|
-
}, borderRadius, colors.gray15, function (_ref4) {
|
|
61
|
+
}, borderRadius, colors.gray15, colors.blue40, spacing.xs, function (_ref4) {
|
|
62
62
|
var $selected = _ref4.$selected,
|
|
63
63
|
$dark = _ref4.$dark;
|
|
64
64
|
if ($dark) {
|
|
@@ -67,15 +67,15 @@ var StyledTabInner = /*#__PURE__*/styled(StyledTabInnerBase).withConfig({
|
|
|
67
67
|
});
|
|
68
68
|
var StyledDropdownTab = /*#__PURE__*/styled(StyledDropdownTabBase).withConfig({
|
|
69
69
|
displayName: "StyledDropdownTab",
|
|
70
|
-
componentId: "core-
|
|
70
|
+
componentId: "core-12_40_0__sc-17s58xs-5"
|
|
71
71
|
})(["", ""], getTabStyle);
|
|
72
72
|
var StyledDropdownTabInner = /*#__PURE__*/styled(StyledTabInner).withConfig({
|
|
73
73
|
displayName: "StyledDropdownTabInner",
|
|
74
|
-
componentId: "core-
|
|
74
|
+
componentId: "core-12_40_0__sc-17s58xs-6"
|
|
75
75
|
})(["align-items:center;cursor:pointer;display:inline-flex;"]);
|
|
76
76
|
var StyledLink = /*#__PURE__*/styled.span.withConfig({
|
|
77
77
|
displayName: "StyledLink",
|
|
78
|
-
componentId: "core-
|
|
78
|
+
componentId: "core-12_40_0__sc-17s58xs-7"
|
|
79
79
|
})(["align-items:center;display:flex;height:23px;", ";box-sizing:border-box;"], borderRadius);
|
|
80
80
|
|
|
81
81
|
//// END TRADITIONAL DESIGN SYSTEM TAB STYLES ////
|
|
@@ -83,7 +83,7 @@ var StyledLink = /*#__PURE__*/styled.span.withConfig({
|
|
|
83
83
|
//// START HELIX GLOBAL NAVIGATION TAB STYLES ////
|
|
84
84
|
|
|
85
85
|
function getHelixHeaderTabStyles() {
|
|
86
|
-
return css(["border-radius:4px;color:", ";height:24px;overflow:hidden;padding:", "px;text-align:center;", ";font-weight:600;& + ", "{margin-left:", "px;}&:hover{background:rgba(117,131,138,0.3);color:", ";text-decoration:none;}&:focus{outline:2px solid ", ";outline-offset:-2px;background:rgba(117,131,138,0.3);}", ""], colors.white, spacing.xs, getTypographyIntent('small'), StyledTabBase, spacing.sm, colors.white, colors.blue70, function (_ref5) {
|
|
86
|
+
return css(["border-radius:4px;color:", ";height:24px;overflow:hidden;padding:", "px;text-align:center;", ";font-weight:600;& + ", "{margin-left:", "px;}&:hover{background:rgba(117,131,138,0.3);color:", ";text-decoration:none;}&:focus-visible{outline:2px solid ", ";outline-offset:-2px;background:rgba(117,131,138,0.3);}", ""], colors.white, spacing.xs, getTypographyIntent('small'), StyledTabBase, spacing.sm, colors.white, colors.blue70, function (_ref5) {
|
|
87
87
|
var $selected = _ref5.$selected;
|
|
88
88
|
if ($selected) {
|
|
89
89
|
return css(["background:", ";"], colors.gray30);
|
|
@@ -92,44 +92,44 @@ function getHelixHeaderTabStyles() {
|
|
|
92
92
|
}
|
|
93
93
|
var StyledGlobalNavigationTab = /*#__PURE__*/styled(StyledTabBase).withConfig({
|
|
94
94
|
displayName: "StyledGlobalNavigationTab",
|
|
95
|
-
componentId: "core-
|
|
95
|
+
componentId: "core-12_40_0__sc-17s58xs-8"
|
|
96
96
|
})(["", ""], getHelixHeaderTabStyles);
|
|
97
97
|
var StyledGlobalNavigationDropdownTab = /*#__PURE__*/styled(StyledDropdownTabBase).withConfig({
|
|
98
98
|
displayName: "StyledGlobalNavigationDropdownTab",
|
|
99
|
-
componentId: "core-
|
|
99
|
+
componentId: "core-12_40_0__sc-17s58xs-9"
|
|
100
100
|
})(["", ""], getHelixHeaderTabStyles);
|
|
101
101
|
var StyledGlobalNavigationDropdownTabInner = /*#__PURE__*/styled(StyledTabInnerBase).withConfig({
|
|
102
102
|
displayName: "StyledGlobalNavigationDropdownTabInner",
|
|
103
|
-
componentId: "core-
|
|
103
|
+
componentId: "core-12_40_0__sc-17s58xs-10"
|
|
104
104
|
})(["align-items:center;cursor:pointer;display:inline-flex;"]);
|
|
105
105
|
var StyledGlobalNavigationLink = /*#__PURE__*/styled.span.withConfig({
|
|
106
106
|
displayName: "StyledGlobalNavigationLink",
|
|
107
|
-
componentId: "core-
|
|
107
|
+
componentId: "core-12_40_0__sc-17s58xs-11"
|
|
108
108
|
})(["padding-left:6px;padding-right:6px;"]);
|
|
109
109
|
|
|
110
110
|
//// END HELIX GLOBAL NAVIGATION TAB STYLES ////
|
|
111
111
|
|
|
112
112
|
export var StyledOverlay = /*#__PURE__*/styled(Card).withConfig({
|
|
113
113
|
displayName: "StyledOverlay",
|
|
114
|
-
componentId: "core-
|
|
115
|
-
})(["max-height:40vh;", "{padding:0;display:flex;justify-content:center;a{margin:unset;padding:unset;}}", "{padding:0;display:flex;}", "{padding:2px 16px 4px 16px;}", ",", "{color:", ";border-radius:0;display:flex;width:100%;background:inherit;font-weight:inherit;font-size:inherit;padding:0;}[data-selected='true']{", ",", "{border-bottom-color:transparent;color:", ";}}"], StyledItem, StyledLink, StyledTabInnerBase, StyledLink, StyledTabBase, colors.gray15, StyledLink, StyledTabBase, colors.blue50);
|
|
114
|
+
componentId: "core-12_40_0__sc-17s58xs-12"
|
|
115
|
+
})(["max-height:40vh;", "{padding:0;display:flex;justify-content:center;a{margin:unset;padding:unset;&:focus-visible{outline-offset:1px;}}}", "{padding:0;display:flex;}", "{padding:2px 16px 4px 16px;}", ",", "{color:", ";border-radius:0;display:flex;width:100%;background:inherit;font-weight:inherit;font-size:inherit;padding:0;}[data-selected='true']{", ",", "{border-bottom-color:transparent;color:", ";}}"], StyledItem, StyledLink, StyledTabInnerBase, StyledLink, StyledTabBase, colors.gray15, StyledLink, StyledTabBase, colors.blue50);
|
|
116
116
|
export var StyledTabList = /*#__PURE__*/styled.div.withConfig({
|
|
117
117
|
displayName: "StyledTabList",
|
|
118
|
-
componentId: "core-
|
|
118
|
+
componentId: "core-12_40_0__sc-17s58xs-13"
|
|
119
119
|
})(["display:flex;width:100%;"]);
|
|
120
|
-
export var StyledTabs = /*#__PURE__*/styled.
|
|
120
|
+
export var StyledTabs = /*#__PURE__*/styled.div.withConfig({
|
|
121
121
|
displayName: "StyledTabs",
|
|
122
|
-
componentId: "core-
|
|
122
|
+
componentId: "core-12_40_0__sc-17s58xs-14"
|
|
123
123
|
})(["background-color:", ";display:flex;overflow:hidden;width:100%;", "{&:nth-child(1n + ", "){&:not(", "){", "}}}", ""], function (_ref6) {
|
|
124
124
|
var $dark = _ref6.$dark;
|
|
125
125
|
return $dark && colors.gray15;
|
|
126
126
|
}, StyledTabBase, function (_ref7) {
|
|
127
|
-
var index = _ref7
|
|
128
|
-
return index;
|
|
127
|
+
var $index = _ref7.$index;
|
|
128
|
+
return $index;
|
|
129
129
|
}, StyledDropdownTabBase, hiddenTab, function (_ref8) {
|
|
130
|
-
var _ref8
|
|
131
|
-
index = _ref8
|
|
132
|
-
return index >= 0 && css(["", "{", "}"], StyledDropdownTabBase, visible);
|
|
130
|
+
var _ref8$$index = _ref8.$index,
|
|
131
|
+
$index = _ref8$$index === void 0 ? -1 : _ref8$$index;
|
|
132
|
+
return $index >= 0 && css(["", "{", "}"], StyledDropdownTabBase, visible);
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.styles.js","names":["styled","css","Card","StyledItem","getTypographyIntent","colors","spacing","hiddenTab","visible","borderRadius","xs","StyledTabBase","div","withConfig","displayName","componentId","StyledTabInnerBase","StyledDropdownTabBase","getTabStyle","xl","_ref","$selected","gray15","_ref2","$dark","gray90","blue40","StyledTab","StyledTabInner","_ref3","_ref4","white","gray70","StyledDropdownTab","StyledDropdownTabInner","StyledLink","span","getHelixHeaderTabStyles","sm","blue70","_ref5","gray30","StyledGlobalNavigationTab","StyledGlobalNavigationDropdownTab","StyledGlobalNavigationDropdownTabInner","StyledGlobalNavigationLink","StyledOverlay","blue50","StyledTabList","StyledTabs","nav","_ref6","_ref7","index","_ref8","_ref8$index","getStyledComponents","helixHeader","arguments","length","undefined","Tab","TabInner","Link","DropdownTab","DropdownTabInner"],"sources":["../../src/Tabs/Tabs.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { Card } from '../Card'\nimport { StyledItem } from '../MenuImperative/MenuImperative.styles'\nimport { getTypographyIntent } from '../Typography'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\n\ntype TabStyleProps = {\n $selected?: boolean\n $dark?: boolean\n}\n\nconst hiddenTab = css`\n pointer-events: none;\n position: absolute;\n visibility: hidden;\n`\n\nconst visible = css`\n pointer-events: all;\n position: relative;\n visibility: visible;\n`\n\nconst borderRadius = css`\n border-radius: ${spacing.xs}px ${spacing.xs}px 0 0;\n`\n\n//// START BASE LAYOUT COMPONENTS FOR TABS ////\n\n/**\n * Elements to handle general layout and browser resets.\n * Will be the referencable element (class) other selectors\n * that need to target general layout references.\n */\nconst StyledTabBase = styled.div<TabStyleProps>`\n align-items: center;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n flex: 0 0 auto;\n justify-content: center;\n position: relative;\n white-space: nowrap;\n\n // Browser button and anchor style resets\n text-decoration: none;\n background-color: transparent;\n border: none;\n font-family: inherit;\n padding: 0;\n`\n\nconst StyledTabInnerBase = styled.div<TabStyleProps>`\n align-self: baseline;\n box-sizing: border-box;\n\n &,\n > a {\n display: flex;\n text-decoration: none;\n width: 100%;\n }\n`\n\n// This so that it can be visible/hidden via CSS down below\nconst StyledDropdownTabBase = styled(StyledTabBase)`\n ${hiddenTab}\n`\n\n//// END BASE LAYOUT COMPONENTS FOR TABS ////\n\n//// START TRADITIONAL DESIGN SYSTEM TAB STYLES ////\n\n/**\n * Styles specific to the Design System general cases (not Global nav)\n */\nfunction getTabStyle() {\n return css<TabStyleProps>`\n ${borderRadius};\n height: 26px;\n\n & + ${StyledTabBase} {\n margin-left: ${spacing.xl}px;\n }\n\n a& {\n ${borderRadius}\n }\n\n &,\n a&,\n button& {\n ${({ $selected }) => {\n if ($selected) {\n return css`\n border-bottom: 3px solid ${colors.gray15};\n `\n }\n }}\n }\n\n &:focus,\n &:focus-within,\n &:hover {\n background: ${({ $dark }) => ($dark ? 'transparent' : colors.gray90)};\n }\n\n &:focus,\n &:focus-within {\n box-shadow: inset 0 0 0 2px ${colors.blue40};\n outline: none;\n\n a {\n outline: none;\n }\n }\n `\n}\n\nconst StyledTab = styled(StyledTabBase)<TabStyleProps>`\n ${getTabStyle}\n`\n\nconst StyledTabInner = styled(StyledTabInnerBase)<TabStyleProps>`\n ${getTypographyIntent('body')}\n\n padding: 0 ${spacing.xs}px;\n font-weight: ${({ $selected }) => ($selected ? 600 : 400)};\n\n &,\n > a {\n ${borderRadius};\n color: ${colors.gray15};\n height: 23px;\n }\n\n /* TODO: Dark mode was not considered for helix updates,\n * matching previous UX patterns - April 2nd 2024\n */\n ${({ $selected, $dark }) => {\n if ($dark) {\n return css`\n &,\n > a,\n button&,\n a& {\n color: ${$selected ? colors.white : colors.gray70};\n\n &:hover {\n color: white;\n }\n }\n `\n }\n }}\n`\n\nconst StyledDropdownTab = styled(StyledDropdownTabBase)`\n ${getTabStyle}\n`\n\nconst StyledDropdownTabInner = styled(StyledTabInner)`\n align-items: center;\n cursor: pointer;\n display: inline-flex;\n`\n\nconst StyledLink = styled.span`\n align-items: center;\n display: flex;\n height: 23px; // TODO one-off\n ${borderRadius};\n box-sizing: border-box;\n`\n\n//// END TRADITIONAL DESIGN SYSTEM TAB STYLES ////\n\n//// START HELIX GLOBAL NAVIGATION TAB STYLES ////\n\nfunction getHelixHeaderTabStyles() {\n return css<TabStyleProps>`\n border-radius: 4px;\n color: ${colors.white};\n height: 24px;\n overflow: hidden;\n padding: ${spacing.xs}px;\n text-align: center;\n\n ${getTypographyIntent('small')};\n font-weight: 600; // Different than typograhy intent small, must be defined after\n\n & + ${StyledTabBase} {\n margin-left: ${spacing.sm}px;\n }\n\n &:hover {\n background: rgba(117, 131, 138, 0.3);\n color: ${colors.white};\n text-decoration: none;\n }\n\n &:focus {\n outline: 2px solid ${colors.blue70};\n outline-offset: -2px;\n background: rgba(117, 131, 138, 0.3);\n }\n\n ${({ $selected }) => {\n if ($selected) {\n return css`\n background: ${colors.gray30};\n `\n }\n }}\n `\n}\n\nconst StyledGlobalNavigationTab = styled(StyledTabBase)`\n ${getHelixHeaderTabStyles}\n`\n\nconst StyledGlobalNavigationDropdownTab = styled(StyledDropdownTabBase)`\n ${getHelixHeaderTabStyles}\n`\n\nconst StyledGlobalNavigationDropdownTabInner = styled(StyledTabInnerBase)`\n align-items: center;\n cursor: pointer;\n display: inline-flex;\n`\n\nconst StyledGlobalNavigationLink = styled.span`\n padding-left: 6px;\n padding-right: 6px;\n`\n\n//// END HELIX GLOBAL NAVIGATION TAB STYLES ////\n\nexport const StyledOverlay = styled(Card)`\n max-height: 40vh;\n\n ${StyledItem} {\n padding: 0;\n display: flex;\n justify-content: center;\n\n a {\n margin: unset;\n padding: unset;\n }\n }\n\n ${StyledLink} {\n padding: 0;\n display: flex;\n }\n\n ${StyledTabInnerBase} {\n // unsure why top and bottom are not uniform\n // design docs show uniform 4px\n padding: 2px 16px 4px 16px;\n }\n\n ${StyledLink},\n ${StyledTabBase} {\n color: ${colors.gray15};\n border-radius: 0;\n display: flex;\n width: 100%;\n\n background: inherit;\n font-weight: inherit;\n font-size: inherit;\n padding: 0;\n }\n\n [data-selected='true'] {\n ${StyledLink}, ${StyledTabBase} {\n border-bottom-color: transparent;\n color: ${colors.blue50};\n }\n }\n`\n\nexport const StyledTabList = styled.div`\n display: flex;\n width: 100%;\n`\n\nexport const StyledTabs = styled.nav<{\n $dark?: boolean\n index?: number\n}>`\n background-color: ${({ $dark }) => $dark && colors.gray15};\n display: flex;\n overflow: hidden;\n width: 100%;\n\n ${StyledTabBase} {\n // we want to hide all tabs after overflow index\n &:nth-child(1n + ${({ index }) => index}) {\n // but not the \"More\" dropdown tab\n &:not(${StyledDropdownTabBase}) {\n ${hiddenTab}\n }\n }\n }\n\n ${({ index = -1 }) =>\n index >= 0 &&\n css`\n ${StyledDropdownTabBase} {\n ${visible}\n }\n `}\n`\n\n/**\n * Switches between different Tab styles of traditional and helix header navigation.\n * Allows separate style CSS without conditionals across all the components.\n * @returns Subcomponents to render\n */\nexport function getStyledComponents(helixHeader = false) {\n if (helixHeader) {\n return {\n Tab: StyledGlobalNavigationTab,\n TabInner: StyledTabInnerBase,\n Link: StyledGlobalNavigationLink,\n DropdownTab: StyledGlobalNavigationDropdownTab,\n DropdownTabInner: StyledGlobalNavigationDropdownTabInner,\n }\n }\n return {\n Tab: StyledTab,\n TabInner: StyledTabInner,\n Link: StyledLink,\n DropdownTab: StyledDropdownTab,\n DropdownTabInner: StyledDropdownTabInner,\n }\n}\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,UAAU,QAAQ,yCAAyC;AACpE,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAO5C,IAAMC,SAAS,gBAAGN,GAAG,8DAIpB;AAED,IAAMO,OAAO,gBAAGP,GAAG,8DAIlB;AAED,IAAMQ,YAAY,gBAAGR,GAAG,uCACLK,OAAO,CAACI,EAAE,EAAMJ,OAAO,CAACI,EAAE,CAC5C;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,gBAAGX,MAAM,CAACY,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0PAg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ArBC,WAAW,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EACrD,IAAID,WAAW,EAAE;IACf,OAAO;MACLI,GAAG,EAAEnB,yBAAyB;MAC9BoB,QAAQ,EAAE9C,kBAAkB;MAC5B+C,IAAI,EAAElB,0BAA0B;MAChCmB,WAAW,EAAErB,iCAAiC;MAC9CsB,gBAAgB,EAAErB;IACpB,CAAC;EACH;EACA,OAAO;IACLiB,GAAG,EAAElC,SAAS;IACdmC,QAAQ,EAAElC,cAAc;IACxBmC,IAAI,EAAE5B,UAAU;IAChB6B,WAAW,EAAE/B,iBAAiB;IAC9BgC,gBAAgB,EAAE/B;EACpB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"Tabs.styles.js","names":["styled","css","Card","StyledItem","getTypographyIntent","colors","spacing","hiddenTab","visible","borderRadius","xs","StyledTabBase","div","withConfig","displayName","componentId","StyledTabInnerBase","StyledDropdownTabBase","getTabStyle","xl","_ref","$selected","gray15","_ref2","$dark","gray90","blue40","StyledTab","StyledTabInner","_ref3","_ref4","white","gray70","StyledDropdownTab","StyledDropdownTabInner","StyledLink","span","getHelixHeaderTabStyles","sm","blue70","_ref5","gray30","StyledGlobalNavigationTab","StyledGlobalNavigationDropdownTab","StyledGlobalNavigationDropdownTabInner","StyledGlobalNavigationLink","StyledOverlay","blue50","StyledTabList","StyledTabs","_ref6","_ref7","$index","_ref8","_ref8$$index","getStyledComponents","helixHeader","arguments","length","undefined","Tab","TabInner","Link","DropdownTab","DropdownTabInner"],"sources":["../../src/Tabs/Tabs.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { Card } from '../Card'\nimport { StyledItem } from '../MenuImperative/MenuImperative.styles'\nimport { getTypographyIntent } from '../Typography'\nimport { colors } from '../_styles/colors'\nimport { spacing } from '../_styles/spacing'\n\ntype TabStyleProps = {\n $selected?: boolean\n $dark?: boolean\n}\n\nconst hiddenTab = css`\n pointer-events: none;\n position: absolute;\n visibility: hidden;\n`\n\nconst visible = css`\n pointer-events: all;\n position: relative;\n visibility: visible;\n`\n\nconst borderRadius = css`\n border-radius: ${spacing.xs}px ${spacing.xs}px 0 0;\n`\n\n//// START BASE LAYOUT COMPONENTS FOR TABS ////\n\n/**\n * Elements to handle general layout and browser resets.\n * Will be the referencable element (class) other selectors\n * that need to target general layout references.\n */\nconst StyledTabBase = styled.div<TabStyleProps>`\n align-items: center;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n flex: 0 0 auto;\n justify-content: center;\n position: relative;\n white-space: nowrap;\n\n // Browser button and anchor style resets\n text-decoration: none;\n background-color: transparent;\n border: none;\n font-family: inherit;\n padding: 0;\n`\n\nconst StyledTabInnerBase = styled.div<TabStyleProps>`\n align-self: baseline;\n box-sizing: border-box;\n\n &,\n > a {\n display: flex;\n text-decoration: none;\n width: 100%;\n }\n`\n\n// This so that it can be visible/hidden via CSS down below\nconst StyledDropdownTabBase = styled(StyledTabBase)`\n ${hiddenTab}\n`\n\n//// END BASE LAYOUT COMPONENTS FOR TABS ////\n\n//// START TRADITIONAL DESIGN SYSTEM TAB STYLES ////\n\n/**\n * Styles specific to the Design System general cases (not Global nav)\n */\nfunction getTabStyle() {\n return css<TabStyleProps>`\n ${borderRadius};\n height: 26px;\n\n & + ${StyledTabBase} {\n margin-left: ${spacing.xl}px;\n }\n\n a& {\n ${borderRadius}\n }\n\n &,\n a&,\n button& {\n ${({ $selected }) => {\n if ($selected) {\n return css`\n border-bottom: 3px solid ${colors.gray15};\n `\n }\n }}\n }\n\n &:focus-visible,\n &:hover {\n background: ${({ $dark }) => ($dark ? 'transparent' : colors.gray90)};\n }\n\n &:focus-visible {\n box-shadow: inset 0 0 0 2px ${colors.blue40};\n outline: none;\n\n a {\n outline: none;\n }\n }\n `\n}\n\nconst StyledTab = styled(StyledTabBase)<TabStyleProps>`\n ${getTabStyle}\n`\n\nconst StyledTabInner = styled(StyledTabInnerBase)<TabStyleProps>`\n ${getTypographyIntent('body')}\n\n padding: 0 ${spacing.xs}px;\n font-weight: ${({ $selected }) => ($selected ? 600 : 400)};\n\n &,\n > a {\n ${borderRadius};\n color: ${colors.gray15};\n height: 23px;\n }\n\n & a:focus-visible {\n outline: 2px solid ${colors.blue40};\n outline-offset: -1px;\n border-radius: ${spacing.xs}px;\n }\n\n /* TODO: Dark mode was not considered for helix updates,\n * matching previous UX patterns - April 2nd 2024\n */\n ${({ $selected, $dark }) => {\n if ($dark) {\n return css`\n &,\n > a,\n button&,\n a& {\n color: ${$selected ? colors.white : colors.gray70};\n\n &:hover {\n color: white;\n }\n }\n `\n }\n }}\n`\n\nconst StyledDropdownTab = styled(StyledDropdownTabBase)`\n ${getTabStyle}\n`\n\nconst StyledDropdownTabInner = styled(StyledTabInner)`\n align-items: center;\n cursor: pointer;\n display: inline-flex;\n`\n\nconst StyledLink = styled.span`\n align-items: center;\n display: flex;\n height: 23px; // TODO one-off\n ${borderRadius};\n box-sizing: border-box;\n`\n\n//// END TRADITIONAL DESIGN SYSTEM TAB STYLES ////\n\n//// START HELIX GLOBAL NAVIGATION TAB STYLES ////\n\nfunction getHelixHeaderTabStyles() {\n return css<TabStyleProps>`\n border-radius: 4px;\n color: ${colors.white};\n height: 24px;\n overflow: hidden;\n padding: ${spacing.xs}px;\n text-align: center;\n\n ${getTypographyIntent('small')};\n font-weight: 600; // Different than typograhy intent small, must be defined after\n\n & + ${StyledTabBase} {\n margin-left: ${spacing.sm}px;\n }\n\n &:hover {\n background: rgba(117, 131, 138, 0.3);\n color: ${colors.white};\n text-decoration: none;\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.blue70};\n outline-offset: -2px;\n background: rgba(117, 131, 138, 0.3);\n }\n\n ${({ $selected }) => {\n if ($selected) {\n return css`\n background: ${colors.gray30};\n `\n }\n }}\n `\n}\n\nconst StyledGlobalNavigationTab = styled(StyledTabBase)`\n ${getHelixHeaderTabStyles}\n`\n\nconst StyledGlobalNavigationDropdownTab = styled(StyledDropdownTabBase)`\n ${getHelixHeaderTabStyles}\n`\n\nconst StyledGlobalNavigationDropdownTabInner = styled(StyledTabInnerBase)`\n align-items: center;\n cursor: pointer;\n display: inline-flex;\n`\n\nconst StyledGlobalNavigationLink = styled.span`\n padding-left: 6px;\n padding-right: 6px;\n`\n\n//// END HELIX GLOBAL NAVIGATION TAB STYLES ////\n\nexport const StyledOverlay = styled(Card)`\n max-height: 40vh;\n\n ${StyledItem} {\n padding: 0;\n display: flex;\n justify-content: center;\n\n a {\n margin: unset;\n padding: unset;\n &:focus-visible {\n outline-offset: 1px;\n }\n }\n }\n\n ${StyledLink} {\n padding: 0;\n display: flex;\n }\n\n ${StyledTabInnerBase} {\n // unsure why top and bottom are not uniform\n // design docs show uniform 4px\n padding: 2px 16px 4px 16px;\n }\n\n ${StyledLink},\n ${StyledTabBase} {\n color: ${colors.gray15};\n border-radius: 0;\n display: flex;\n width: 100%;\n\n background: inherit;\n font-weight: inherit;\n font-size: inherit;\n padding: 0;\n }\n\n [data-selected='true'] {\n ${StyledLink}, ${StyledTabBase} {\n border-bottom-color: transparent;\n color: ${colors.blue50};\n }\n }\n`\n\nexport const StyledTabList = styled.div`\n display: flex;\n width: 100%;\n`\n\nexport const StyledTabs = styled.div<{\n $dark?: boolean\n $index?: number\n}>`\n background-color: ${({ $dark }) => $dark && colors.gray15};\n display: flex;\n overflow: hidden;\n width: 100%;\n\n ${StyledTabBase} {\n // we want to hide all tabs after overflow index\n &:nth-child(1n + ${({ $index }) => $index}) {\n // but not the \"More\" dropdown tab\n &:not(${StyledDropdownTabBase}) {\n ${hiddenTab}\n }\n }\n }\n\n ${({ $index = -1 }) =>\n $index >= 0 &&\n css`\n ${StyledDropdownTabBase} {\n ${visible}\n }\n `}\n`\n\n/**\n * Switches between different Tab styles of traditional and helix header navigation.\n * Allows separate style CSS without conditionals across all the components.\n * @returns Subcomponents to render\n */\nexport function getStyledComponents(helixHeader = false) {\n if (helixHeader) {\n return {\n Tab: StyledGlobalNavigationTab,\n TabInner: StyledTabInnerBase,\n Link: StyledGlobalNavigationLink,\n DropdownTab: StyledGlobalNavigationDropdownTab,\n DropdownTabInner: StyledGlobalNavigationDropdownTabInner,\n }\n }\n return {\n Tab: StyledTab,\n TabInner: StyledTabInner,\n Link: StyledLink,\n DropdownTab: StyledDropdownTab,\n DropdownTabInner: StyledDropdownTabInner,\n }\n}\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,UAAU,QAAQ,yCAAyC;AACpE,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,oBAAoB;AAO5C,IAAMC,SAAS,gBAAGN,GAAG,8DAIpB;AAED,IAAMO,OAAO,gBAAGP,GAAG,8DAIlB;AAED,IAAMQ,YAAY,gBAAGR,GAAG,uCACLK,OAAO,CAACI,EAAE,EAAMJ,OAAO,CAACI,EAAE,CAC5C;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,gBAAGX,MAAM,CAACY,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0PAgB/B;AAED,IAAMC,kBAAkB,gBAAGhB,MAAM,CAACY,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,sGAUpC;;AAED;AACA,IAAME,qBAAqB,gBAAGjB,MAAM,CAACW,aAAa,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aAC/CR,SAAS,CACZ;;AAED;;AAEA;;AAEA;AACA;AACA;AACA,SAASW,WAAWA,CAAA,EAAG;EACrB,OAAOjB,GAAG,sMACNQ,YAAY,EAGRE,aAAa,EACFL,OAAO,CAACa,EAAE,EAIvBV,YAAY,EAMZ,UAAAW,IAAA,EAAmB;IAAA,IAAhBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACZ,IAA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E9B,iBAAiB;IAC9B+B,gBAAgB,EAAE9B;EACpB,CAAC;AACH"}
|
|
@@ -103,6 +103,12 @@ export interface QaTags {
|
|
|
103
103
|
more?: string;
|
|
104
104
|
}
|
|
105
105
|
export interface TabsProps extends Props {
|
|
106
|
+
/**
|
|
107
|
+
* @since 12.36.0
|
|
108
|
+
*
|
|
109
|
+
* Can specify as a `navigational` element for when tabs are links.
|
|
110
|
+
*/
|
|
111
|
+
role?: 'navigation';
|
|
106
112
|
/**
|
|
107
113
|
* @since 10.19.0
|
|
108
114
|
* @deprecated Custom styles intended for the global navigation header.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.types.js","names":["tabVariant","none","active","dark","dropdown","hover","overflowing"],"sources":["../../src/Tabs/Tabs.types.ts"],"sourcesContent":["import type { AriaButtonProps } from '@react-aria/button'\nimport type React from 'react'\nimport type { Polymorphic } from '../_utils/polymorphic'\nimport type { Props } from '../_utils/types'\n\nexport type TabRoleType = 'link' | 'button'\n\nexport interface TabPolyMap extends Record<TabRoleType, React.ElementType> {\n button: 'button'\n link: 'a'\n}\n\nexport type TabRole = TabRoleType | undefined\n\nexport type TabRef<Role extends TabRole = undefined> = Role extends TabRoleType\n ? Polymorphic.Ref<TabPolyMap, Role>\n : React.ComponentPropsWithRef<'div'>['ref']\n\nexport type TabProps<Role extends TabRole = undefined> = Role extends 'link'\n ? Polymorphic.ComponentPropsWithRef<TabPolyMap, 'link', 'href', BaseTabProps>\n : Role extends 'button'\n ? Polymorphic.ComponentPropsWithRef<\n TabPolyMap,\n 'button',\n never,\n BaseTabProps & { onPress: AriaButtonProps['onPress'] }\n >\n : BaseTabProps & { ref?: TabRef<undefined> }\n\nexport const tabVariant = {\n none: '',\n active: 'active',\n dark: 'dark',\n dropdown: 'dropdown',\n hover: 'hover',\n overflowing: 'overflowing',\n} as const\n\ntype TabVariant = (typeof tabVariant)[keyof typeof tabVariant]\n\nexport interface BaseTabProps extends Props {\n /**\n * The tab is active\n * @since 10.19.0\n * @deprecated Please use `selected` instead\n * @deprecatedSince 12.18.0\n */\n active?: boolean\n\n /**\n * The tab is selected\n * @since 12.18.0\n */\n selected?: boolean\n\n /**\n * Whether or not tab is in dark mode\n * @private\n * @since 10.19.0\n * @deprecated Custom styles intended for the global navigation header.\n * Future Core-React will look holistically at themes and dark mode support.\n *\n * AFTER - Regular Tab styles. If needing dark support, please reach out.\n * @deprecatedSince 12.8.0\n */\n dark?: boolean\n\n /**\n * @private\n * @since 10.19.0\n */\n onMount?: (el: HTMLDivElement | null) => void\n\n /**\n * @private\n */\n onUnmount?: () => void\n\n /**\n * @deprecated This was never intended to be a public facing API and does not\n * do anything. It will be removed in the future.\n * @deprecatedSince 11\n * @since 10.19.0\n */\n dropdown?: boolean\n\n /**\n * @deprecated This was never intended to be a public facing API and does not\n * do anything. It will be removed in the future.\n * @deprecatedSince 11\n * @since 10.19.0\n */\n overflowing?: boolean\n\n /**\n * @deprecated please use the `selected` props to configure style. The\n * `dropdown`, `hover`, and `overflowing` variants were only for internal use\n * and should not be used in clients\n * @deprecatedSince 11\n * @since 10.19.0\n */\n variant?: TabVariant\n /**\n * @since 11.6.0\n */\n disabled?: boolean\n /**\n * Sets the Tab's role\n * @since 11.6.0\n */\n role?: TabRole\n /**\n * Tab styles specific to the global navigation header.\n * @deprecated @experimental Alternative style variant. To be used on Helix Header ONLY\n * @since 12.8.0\n */\n UNSAFE_helixHeader?: boolean\n}\n\nexport interface TabsTabProps extends BaseTabProps {}\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n more?: string\n}\n\nexport interface TabsProps extends Props {\n /**\n * @since 10.19.0\n * @deprecated Custom styles intended for the global navigation header.\n * Future Core-React will look holistically at themes and dark mode support.\n *\n * AFTER - Regular Tab styles. If needing dark support, please reach out.\n * @deprecatedSince 12.8.0\n */\n dark?: boolean\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n /**\n * Tab styles specific to the global navigation header.\n * @deprecated @experimental Alternative style variant. To be used on Helix Header ONLY\n * @since 12.8.0\n */\n UNSAFE_helixHeader?: boolean\n}\n\nexport interface TabDropdownProps extends Props {\n /**\n * @since 10.19.0\n */\n visible?: boolean\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n}\n"],"mappings":"AA6BA,OAAO,IAAMA,UAAU,GAAG;EACxBC,IAAI,EAAE,EAAE;EACRC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,MAAM;EACZC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE;AACf,CAAU"}
|
|
1
|
+
{"version":3,"file":"Tabs.types.js","names":["tabVariant","none","active","dark","dropdown","hover","overflowing"],"sources":["../../src/Tabs/Tabs.types.ts"],"sourcesContent":["import type { AriaButtonProps } from '@react-aria/button'\nimport type React from 'react'\nimport type { Polymorphic } from '../_utils/polymorphic'\nimport type { Props } from '../_utils/types'\n\nexport type TabRoleType = 'link' | 'button'\n\nexport interface TabPolyMap extends Record<TabRoleType, React.ElementType> {\n button: 'button'\n link: 'a'\n}\n\nexport type TabRole = TabRoleType | undefined\n\nexport type TabRef<Role extends TabRole = undefined> = Role extends TabRoleType\n ? Polymorphic.Ref<TabPolyMap, Role>\n : React.ComponentPropsWithRef<'div'>['ref']\n\nexport type TabProps<Role extends TabRole = undefined> = Role extends 'link'\n ? Polymorphic.ComponentPropsWithRef<TabPolyMap, 'link', 'href', BaseTabProps>\n : Role extends 'button'\n ? Polymorphic.ComponentPropsWithRef<\n TabPolyMap,\n 'button',\n never,\n BaseTabProps & { onPress: AriaButtonProps['onPress'] }\n >\n : BaseTabProps & { ref?: TabRef<undefined> }\n\nexport const tabVariant = {\n none: '',\n active: 'active',\n dark: 'dark',\n dropdown: 'dropdown',\n hover: 'hover',\n overflowing: 'overflowing',\n} as const\n\ntype TabVariant = (typeof tabVariant)[keyof typeof tabVariant]\n\nexport interface BaseTabProps extends Props {\n /**\n * The tab is active\n * @since 10.19.0\n * @deprecated Please use `selected` instead\n * @deprecatedSince 12.18.0\n */\n active?: boolean\n\n /**\n * The tab is selected\n * @since 12.18.0\n */\n selected?: boolean\n\n /**\n * Whether or not tab is in dark mode\n * @private\n * @since 10.19.0\n * @deprecated Custom styles intended for the global navigation header.\n * Future Core-React will look holistically at themes and dark mode support.\n *\n * AFTER - Regular Tab styles. If needing dark support, please reach out.\n * @deprecatedSince 12.8.0\n */\n dark?: boolean\n\n /**\n * @private\n * @since 10.19.0\n */\n onMount?: (el: HTMLDivElement | null) => void\n\n /**\n * @private\n */\n onUnmount?: () => void\n\n /**\n * @deprecated This was never intended to be a public facing API and does not\n * do anything. It will be removed in the future.\n * @deprecatedSince 11\n * @since 10.19.0\n */\n dropdown?: boolean\n\n /**\n * @deprecated This was never intended to be a public facing API and does not\n * do anything. It will be removed in the future.\n * @deprecatedSince 11\n * @since 10.19.0\n */\n overflowing?: boolean\n\n /**\n * @deprecated please use the `selected` props to configure style. The\n * `dropdown`, `hover`, and `overflowing` variants were only for internal use\n * and should not be used in clients\n * @deprecatedSince 11\n * @since 10.19.0\n */\n variant?: TabVariant\n /**\n * @since 11.6.0\n */\n disabled?: boolean\n /**\n * Sets the Tab's role\n * @since 11.6.0\n */\n role?: TabRole\n /**\n * Tab styles specific to the global navigation header.\n * @deprecated @experimental Alternative style variant. To be used on Helix Header ONLY\n * @since 12.8.0\n */\n UNSAFE_helixHeader?: boolean\n}\n\nexport interface TabsTabProps extends BaseTabProps {}\n\nexport interface QaTags {\n /**\n * @since 10.19.0\n */\n more?: string\n}\n\nexport interface TabsProps extends Props {\n /**\n * @since 12.36.0\n *\n * Can specify as a `navigational` element for when tabs are links.\n */\n role?: 'navigation'\n /**\n * @since 10.19.0\n * @deprecated Custom styles intended for the global navigation header.\n * Future Core-React will look holistically at themes and dark mode support.\n *\n * AFTER - Regular Tab styles. If needing dark support, please reach out.\n * @deprecatedSince 12.8.0\n */\n dark?: boolean\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n /**\n * Tab styles specific to the global navigation header.\n * @deprecated @experimental Alternative style variant. To be used on Helix Header ONLY\n * @since 12.8.0\n */\n UNSAFE_helixHeader?: boolean\n}\n\nexport interface TabDropdownProps extends Props {\n /**\n * @since 10.19.0\n */\n visible?: boolean\n /**\n * @since 10.19.0\n */\n qa?: QaTags\n}\n"],"mappings":"AA6BA,OAAO,IAAMA,UAAU,GAAG;EACxBC,IAAI,EAAE,EAAE;EACRC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,MAAM;EACZC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE;AACf,CAAU"}
|
|
@@ -46,7 +46,7 @@ var getSlideOutAnimation = function getSlideOutAnimation($placement) {
|
|
|
46
46
|
};
|
|
47
47
|
export var StyledTearsheetContent = /*#__PURE__*/styled.div.withConfig({
|
|
48
48
|
displayName: "StyledTearsheetContent",
|
|
49
|
-
componentId: "core-
|
|
49
|
+
componentId: "core-12_40_0__sc-ljrxoq-0"
|
|
50
50
|
})(["display:flex;z-index:2;width:100%;", " ", " ", " ", ""], function (_ref) {
|
|
51
51
|
var $open = _ref.$open,
|
|
52
52
|
$placement = _ref.$placement;
|
|
@@ -66,7 +66,7 @@ export var StyledTearsheetContent = /*#__PURE__*/styled.div.withConfig({
|
|
|
66
66
|
export var minScrimSize = spacing.xxl * 3;
|
|
67
67
|
export var StyledTearsheetBody = /*#__PURE__*/styled.div.withConfig({
|
|
68
68
|
displayName: "StyledTearsheetBody",
|
|
69
|
-
componentId: "core-
|
|
69
|
+
componentId: "core-12_40_0__sc-ljrxoq-1"
|
|
70
70
|
})(["display:flex;overflow-y:auto;flex-direction:column;background-color:", ";&:focus-visible{", "}", ""], colors.white, getGapOutlineFocus('inside'), function (_ref5) {
|
|
71
71
|
var $block = _ref5.$block,
|
|
72
72
|
$placement = _ref5.$placement,
|
|
@@ -78,7 +78,7 @@ var zoomIn = /*#__PURE__*/keyframes(["from{transform:scale(0);}to{transform:scal
|
|
|
78
78
|
var zoomOut = /*#__PURE__*/keyframes(["from{transform:scale(1);}to{transform:scale(0);}"]);
|
|
79
79
|
export var StyledScrimContainer = /*#__PURE__*/styled.div.withConfig({
|
|
80
80
|
displayName: "StyledScrimContainer",
|
|
81
|
-
componentId: "core-
|
|
81
|
+
componentId: "core-12_40_0__sc-ljrxoq-2"
|
|
82
82
|
})(["", ""], function (_ref6) {
|
|
83
83
|
var $placement = _ref6.$placement;
|
|
84
84
|
var minSizeProp = ['top', 'bottom'].includes($placement) ? 'min-height' : 'min-width';
|
|
@@ -86,7 +86,7 @@ export var StyledScrimContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
86
86
|
});
|
|
87
87
|
export var StyledButtonContainer = /*#__PURE__*/styled.div.withConfig({
|
|
88
88
|
displayName: "StyledButtonContainer",
|
|
89
|
-
componentId: "core-
|
|
89
|
+
componentId: "core-12_40_0__sc-ljrxoq-3"
|
|
90
90
|
})(["", ""], function (_ref7) {
|
|
91
91
|
var $placement = _ref7.$placement;
|
|
92
92
|
switch ($placement) {
|
|
@@ -101,7 +101,7 @@ export var StyledButtonContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
101
101
|
});
|
|
102
102
|
export var StyledButtonCard = /*#__PURE__*/styled(Card).withConfig({
|
|
103
103
|
displayName: "StyledButtonCard",
|
|
104
|
-
componentId: "core-
|
|
104
|
+
componentId: "core-12_40_0__sc-ljrxoq-4"
|
|
105
105
|
})(["display:inline-flex;margin:", "px;", " ", " ", ""], spacing.xl, function (_ref8) {
|
|
106
106
|
var $open = _ref8.$open;
|
|
107
107
|
return $open ? css(["transform:scale(1);"]) : css(["transform:scale(0);"]);
|
|
@@ -3,7 +3,7 @@ import { getInputStyles } from '../Input/Input.styles';
|
|
|
3
3
|
import { spacing } from '../_styles/spacing';
|
|
4
4
|
export var StyledTextArea = /*#__PURE__*/styled.textarea.withConfig({
|
|
5
5
|
displayName: "StyledTextArea",
|
|
6
|
-
componentId: "core-
|
|
6
|
+
componentId: "core-12_40_0__sc-u5mow1-0"
|
|
7
7
|
})(["", ";height:auto;min-height:64px;padding:", "px ", "px;resize:", ";"], getInputStyles, spacing.sm, spacing.md, function (_ref) {
|
|
8
8
|
var _ref$$resize = _ref.$resize,
|
|
9
9
|
$resize = _ref$$resize === void 0 ? 'both' : _ref$$resize;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
|
|
3
3
|
displayName: "StyledEditor",
|
|
4
|
-
componentId: "core-
|
|
4
|
+
componentId: "core-12_40_0__sc-1lje1b0-0"
|
|
5
5
|
})(["> .tox-tinymce{border:none;}"]);
|
|
6
6
|
//# sourceMappingURL=TextEditorOutput.styles.js.map
|
|
@@ -27,35 +27,35 @@ var captionBase = /*#__PURE__*/css(["color:", ";font-size:12px;line-height:16px;
|
|
|
27
27
|
});
|
|
28
28
|
export var StyledMultilineCaption = /*#__PURE__*/styled.div.withConfig({
|
|
29
29
|
displayName: "StyledMultilineCaption",
|
|
30
|
-
componentId: "core-
|
|
30
|
+
componentId: "core-12_40_0__sc-195f70c-0"
|
|
31
31
|
})(["", ";display:flex;word-wrap:break-word;overflow-wrap:break-word;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:", "px;"], captionBase, multilineCaptionMaxHeight);
|
|
32
32
|
export var StyledCaptionText = /*#__PURE__*/styled.span.withConfig({
|
|
33
33
|
displayName: "StyledCaptionText",
|
|
34
|
-
componentId: "core-
|
|
34
|
+
componentId: "core-12_40_0__sc-195f70c-1"
|
|
35
35
|
})(["width:100%;"]);
|
|
36
36
|
export var StyledPlaceholderCaption = /*#__PURE__*/styled.div.withConfig({
|
|
37
37
|
displayName: "StyledPlaceholderCaption",
|
|
38
|
-
componentId: "core-
|
|
38
|
+
componentId: "core-12_40_0__sc-195f70c-2"
|
|
39
39
|
})(["", ""], captionBase);
|
|
40
40
|
export var StyledSingleLineCaption = /*#__PURE__*/styled.div.withConfig({
|
|
41
41
|
displayName: "StyledSingleLineCaption",
|
|
42
|
-
componentId: "core-
|
|
42
|
+
componentId: "core-12_40_0__sc-195f70c-3"
|
|
43
43
|
})(["display:flex;", ""], captionBase);
|
|
44
44
|
export var StyledSinglelineCaptionBody = /*#__PURE__*/styled.span.withConfig({
|
|
45
45
|
displayName: "StyledSinglelineCaptionBody",
|
|
46
|
-
componentId: "core-
|
|
46
|
+
componentId: "core-12_40_0__sc-195f70c-4"
|
|
47
47
|
})(["", ""], getEllipsis);
|
|
48
48
|
export var StyledSinglelineCaptionEnding = /*#__PURE__*/styled.span.withConfig({
|
|
49
49
|
displayName: "StyledSinglelineCaptionEnding",
|
|
50
|
-
componentId: "core-
|
|
50
|
+
componentId: "core-12_40_0__sc-195f70c-5"
|
|
51
51
|
})(["max-width:50%;white-space:nowrap;flex-shrink:0;"]);
|
|
52
52
|
export var StyledLabelText = /*#__PURE__*/styled(Typography).withConfig({
|
|
53
53
|
displayName: "StyledLabelText",
|
|
54
|
-
componentId: "core-
|
|
54
|
+
componentId: "core-12_40_0__sc-195f70c-6"
|
|
55
55
|
})(["", ""], getEllipsis());
|
|
56
56
|
export var StyledThumbnailFigCaption = /*#__PURE__*/styled.figcaption.withConfig({
|
|
57
57
|
displayName: "StyledThumbnailFigCaption",
|
|
58
|
-
componentId: "core-
|
|
58
|
+
componentId: "core-12_40_0__sc-195f70c-7"
|
|
59
59
|
})(["", " ", " color:", ";font-weight:", ";text-align:center;width:100%;position:absolute;bottom:0;right:0;left:0;opacity:0.85;height:", "px;padding:", "px ", "px;background-color:", ";"], getTypographyIntent('small'), getEllipsis(), function (_ref5) {
|
|
60
60
|
var _ref5$$color = _ref5.$color,
|
|
61
61
|
$color = _ref5$$color === void 0 ? 'gray15' : _ref5$$color;
|
|
@@ -63,7 +63,7 @@ export var StyledThumbnailFigCaption = /*#__PURE__*/styled.figcaption.withConfig
|
|
|
63
63
|
}, typographyWeights.bold, labelHeight, spacing.sm / 2, spacing.sm, colors.white);
|
|
64
64
|
export var StyledLabel = /*#__PURE__*/styled.div.withConfig({
|
|
65
65
|
displayName: "StyledLabel",
|
|
66
|
-
componentId: "core-
|
|
66
|
+
componentId: "core-12_40_0__sc-195f70c-8"
|
|
67
67
|
})(["display:flex;justify-content:center;position:absolute;bottom:0;right:0;left:0;opacity:0.85;height:", "px;padding:", "px ", "px;font-size:", "px;background-color:", ";"], labelHeight, spacing.sm / 2, spacing.sm, labelFontSize, colors.white);
|
|
68
68
|
var thumbnailBase = /*#__PURE__*/css(["display:flex;justify-content:center;align-items:center;position:relative;overflow:hidden;border:1px solid ", ";border-radius:", "px;margin:0;", " ", " &:focus{", ";}", " ", " ", ""], colors.gray85, borderRadius.md, function (_ref6) {
|
|
69
69
|
var $clickable = _ref6.$clickable;
|
|
@@ -85,7 +85,7 @@ var thumbnailBase = /*#__PURE__*/css(["display:flex;justify-content:center;align
|
|
|
85
85
|
});
|
|
86
86
|
export var StyledTickIcon = /*#__PURE__*/styled.svg.withConfig({
|
|
87
87
|
displayName: "StyledTickIcon",
|
|
88
|
-
componentId: "core-
|
|
88
|
+
componentId: "core-12_40_0__sc-195f70c-9"
|
|
89
89
|
})(["position:absolute;top:", "px;right:", "px;width:", "px;height:", "px;opacity:0;transform:scale(0.75);transition:transform 250ms ease-out,opacity 100ms ease-out;", " ", ""], spacing.sm, spacing.sm, tickSize, tickSize, function (_ref1) {
|
|
90
90
|
var $selected = _ref1.$selected;
|
|
91
91
|
return $selected && css(["opacity:1;transform:scale(1);"]);
|
|
@@ -95,28 +95,28 @@ export var StyledTickIcon = /*#__PURE__*/styled.svg.withConfig({
|
|
|
95
95
|
});
|
|
96
96
|
export var StyledFileIcon = /*#__PURE__*/styled(DocumentIcon).withConfig({
|
|
97
97
|
displayName: "StyledFileIcon",
|
|
98
|
-
componentId: "core-
|
|
98
|
+
componentId: "core-12_40_0__sc-195f70c-10"
|
|
99
99
|
})(["width:36.5%;height:auto;"]);
|
|
100
100
|
export var StyledImageThumbnailPreview = /*#__PURE__*/styled.div.withConfig({
|
|
101
101
|
displayName: "StyledImageThumbnailPreview",
|
|
102
|
-
componentId: "core-
|
|
102
|
+
componentId: "core-12_40_0__sc-195f70c-11"
|
|
103
103
|
})(["width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:center;", ""], function (_ref11) {
|
|
104
104
|
var $bgImage = _ref11.$bgImage;
|
|
105
105
|
return css(["background-image:url(", ");"], $bgImage);
|
|
106
106
|
});
|
|
107
107
|
export var StyledImageThumbnailOverlay = /*#__PURE__*/styled.div.withConfig({
|
|
108
108
|
displayName: "StyledImageThumbnailOverlay",
|
|
109
|
-
componentId: "core-
|
|
109
|
+
componentId: "core-12_40_0__sc-195f70c-12"
|
|
110
110
|
})(["display:none;position:absolute;top:0;bottom:0;left:0;right:0;"]);
|
|
111
111
|
var blackOverlay = "\n background-color: ".concat(colors.black, ";\n opacity: 0.2;\n");
|
|
112
112
|
var whiteOverlay = "\n background-color: ".concat(colors.white, ";\n opacity: 0.5;\n");
|
|
113
113
|
export var StyledImageThumbnailImage = /*#__PURE__*/styled.img.withConfig({
|
|
114
114
|
displayName: "StyledImageThumbnailImage",
|
|
115
|
-
componentId: "core-
|
|
115
|
+
componentId: "core-12_40_0__sc-195f70c-13"
|
|
116
116
|
})([""]);
|
|
117
117
|
export var StyledImageThumbnail = /*#__PURE__*/styled.div.withConfig({
|
|
118
118
|
displayName: "StyledImageThumbnail",
|
|
119
|
-
componentId: "core-
|
|
119
|
+
componentId: "core-12_40_0__sc-195f70c-14"
|
|
120
120
|
})(["", ";flex-direction:column;", " ", " ", " ", " ", " ", ""], thumbnailBase, function (_ref12) {
|
|
121
121
|
var $disabled = _ref12.$disabled;
|
|
122
122
|
return $disabled && css(["&,&:hover{", "{display:block;", "}}", ",", ",", "{filter:saturate(0);}", "{filter:saturate(0);z-index:-1;}"], StyledImageThumbnailOverlay, whiteOverlay, StyledImageThumbnailPreview, StyledTickIcon, StyledImageThumbnailImage, StyledFileIcon);
|
|
@@ -145,7 +145,7 @@ export var StyledImageThumbnail = /*#__PURE__*/styled.div.withConfig({
|
|
|
145
145
|
});
|
|
146
146
|
export var StyledThumbnailWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
147
147
|
displayName: "StyledThumbnailWrapper",
|
|
148
|
-
componentId: "core-
|
|
148
|
+
componentId: "core-12_40_0__sc-195f70c-15"
|
|
149
149
|
})(["display:flex;", " ", ""], function (_ref18) {
|
|
150
150
|
var $size = _ref18.$size;
|
|
151
151
|
return $size === 'lg' ? "\n width: ".concat(thumbnailSizeLg, "px;\n ") : '';
|
|
@@ -156,7 +156,7 @@ export var StyledThumbnailWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
156
156
|
});
|
|
157
157
|
export var StyledPlaceholderThumbnail = /*#__PURE__*/styled.div.withConfig({
|
|
158
158
|
displayName: "StyledPlaceholderThumbnail",
|
|
159
|
-
componentId: "core-
|
|
159
|
+
componentId: "core-12_40_0__sc-195f70c-16"
|
|
160
160
|
})(["", " ", " ", " ", " ", ""], thumbnailBase, function (_ref20) {
|
|
161
161
|
var $clickable = _ref20.$clickable;
|
|
162
162
|
return $clickable && css(["&:hover{background-color:", ";}"], colors.gray96);
|
|
@@ -7,31 +7,31 @@ import { getEllipsis } from '../_styles/mixins';
|
|
|
7
7
|
import { spacing } from '../_styles/spacing';
|
|
8
8
|
export var StyledCheckbox = /*#__PURE__*/styled(Checkbox).withConfig({
|
|
9
9
|
displayName: "StyledCheckbox",
|
|
10
|
-
componentId: "core-
|
|
10
|
+
componentId: "core-12_40_0__sc-1inrbm9-0"
|
|
11
11
|
})(["input{z-index:2;}"]);
|
|
12
12
|
export var StyledGroupCell = /*#__PURE__*/styled.div.withConfig({
|
|
13
13
|
displayName: "StyledGroupCell",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_40_0__sc-1inrbm9-1"
|
|
15
15
|
})(["display:flex;align-items:flex-end;padding-bottom:", "px;"], spacing.md);
|
|
16
16
|
export var StyledThumbnail = /*#__PURE__*/styled(Thumbnail).withConfig({
|
|
17
17
|
displayName: "StyledThumbnail",
|
|
18
|
-
componentId: "core-
|
|
18
|
+
componentId: "core-12_40_0__sc-1inrbm9-2"
|
|
19
19
|
})(["display:inline-flex;&:focus{outline:none;}"]);
|
|
20
20
|
// VariableSizeGrid has provided width and height as inline style, so to make it flexible and support responsive !important was added
|
|
21
21
|
export var StyledVariableSizeGrid = /*#__PURE__*/styled(VariableSizeGrid).withConfig({
|
|
22
22
|
displayName: "StyledVariableSizeGrid",
|
|
23
|
-
componentId: "core-
|
|
23
|
+
componentId: "core-12_40_0__sc-1inrbm9-3"
|
|
24
24
|
})(["height:100% !important;& > div{width:100% !important;}"]);
|
|
25
25
|
export var StyledGroupTitle = /*#__PURE__*/styled(Typography).withConfig({
|
|
26
26
|
displayName: "StyledGroupTitle",
|
|
27
|
-
componentId: "core-
|
|
27
|
+
componentId: "core-12_40_0__sc-1inrbm9-4"
|
|
28
28
|
})(["", ""], getEllipsis);
|
|
29
29
|
export var StyledSpinnerWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
30
30
|
displayName: "StyledSpinnerWrapper",
|
|
31
|
-
componentId: "core-
|
|
31
|
+
componentId: "core-12_40_0__sc-1inrbm9-5"
|
|
32
32
|
})(["display:flex;justify-content:center;align-items:center;width:100%;height:100%;"]);
|
|
33
33
|
export var StyledThumbnailGrid = /*#__PURE__*/styled.div.withConfig({
|
|
34
34
|
displayName: "StyledThumbnailGrid",
|
|
35
|
-
componentId: "core-
|
|
35
|
+
componentId: "core-12_40_0__sc-1inrbm9-6"
|
|
36
36
|
})(["display:flex;flex-wrap:wrap;outline:none;"]);
|
|
37
37
|
//# sourceMappingURL=ThumbnailGrid.styles.js.map
|