@helsenorge/designsystem-react 7.12.0 → 7.13.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 +8 -0
- package/_virtual/dynamic-import-helper.js +11 -4
- package/_virtual/dynamic-import-helper.js.map +1 -1
- package/_virtual/index.js +2 -2
- package/components/AnchorLink/AnchorLink.js +16 -16
- package/components/AnchorLink/AnchorLink.js.map +1 -1
- package/components/Avatar/Avatar.js +9 -9
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Badge/Badge.js +7 -7
- package/components/Badge/Badge.js.map +1 -1
- package/components/Badge/NotificationBadge.js +5 -5
- package/components/Badge/NotificationBadge.js.map +1 -1
- package/components/Button/Button.js +23 -23
- package/components/Button/Button.js.map +1 -1
- package/components/ButtonWithModal/ButtonWithModal.js +5 -5
- package/components/ButtonWithModal/ButtonWithModal.js.map +1 -1
- package/components/Checkbox/Checkbox.js +41 -42
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Checkbox/index.js +2 -3
- package/components/Checkbox/index.js.map +1 -1
- package/components/Checkbox/styles.module.scss +2 -2
- package/components/Close/Close.js +9 -9
- package/components/Close/Close.js.map +1 -1
- package/components/DictionaryTrigger/DictionaryTrigger.js +14 -15
- package/components/DictionaryTrigger/DictionaryTrigger.js.map +1 -1
- package/components/DictionaryTrigger/styles.module.scss +1 -2
- package/components/Dropdown/Dropdown.js +24 -24
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/styles.module.scss +1 -1
- package/components/Duolist/Duolist.d.ts +3 -0
- package/components/Duolist/Duolist.js +45 -36
- package/components/Duolist/Duolist.js.map +1 -1
- package/components/Duolist/index.js +5 -5
- package/components/Duolist/styles.module.scss +4 -0
- package/components/Duolist/styles.module.scss.d.ts +1 -0
- package/components/EmptyState/EmptyState.js +3 -3
- package/components/EmptyState/EmptyState.js.map +1 -1
- package/components/EmptyState/NobodyHome.js +3 -3
- package/components/EmptyState/NobodyHome.js.map +1 -1
- package/components/ErrorWrapper/ErrorWrapper.js +4 -4
- package/components/ErrorWrapper/ErrorWrapper.js.map +1 -1
- package/components/ErrorWrapper/index.js +2 -3
- package/components/ErrorWrapper/index.js.map +1 -1
- package/components/Expander/Expander.js +10 -10
- package/components/Expander/Expander.js.map +1 -1
- package/components/Expander/styles.module.scss +1 -1
- package/components/ExpanderHierarchy/Expander.js +5 -5
- package/components/ExpanderHierarchy/Expander.js.map +1 -1
- package/components/ExpanderHierarchy/ExpanderButton.js +7 -7
- package/components/ExpanderHierarchy/ExpanderButton.js.map +1 -1
- package/components/ExpanderHierarchy/ExpanderHierarchy.js +13 -14
- package/components/ExpanderHierarchy/ExpanderHierarchy.js.map +1 -1
- package/components/ExpanderHierarchy/expander.module.scss +2 -2
- package/components/ExpanderList/ExpanderList.js +34 -35
- package/components/ExpanderList/ExpanderList.js.map +1 -1
- package/components/ExpanderList/index.js +2 -3
- package/components/ExpanderList/index.js.map +1 -1
- package/components/ExpanderList/styles.module.scss +1 -1
- package/components/FormExample/FormExample.d.ts +0 -1
- package/components/FormExample/FormExample.js +12 -12
- package/components/FormExample/FormExample.js.map +1 -1
- package/components/FormExample/index.js +5 -5
- package/components/FormGroup/FormGroup.js +37 -38
- package/components/FormGroup/FormGroup.js.map +1 -1
- package/components/FormGroup/index.js +2 -3
- package/components/FormGroup/index.js.map +1 -1
- package/components/FormLayout/FormLayout.js +16 -17
- package/components/FormLayout/FormLayout.js.map +1 -1
- package/components/FormLayout/index.js +4 -4
- package/components/GridExample/GridExample.js +3 -3
- package/components/GridExample/GridExample.js.map +1 -1
- package/components/GridExample/index.js +3 -4
- package/components/GridExample/index.js.map +1 -1
- package/components/HelpBubble/HelpBubble.js +26 -27
- package/components/HelpBubble/HelpBubble.js.map +1 -1
- package/components/HelpBubble/styles.module.scss +1 -1
- package/components/HelpBubbleExample/HelpBubbleExample.js +3 -3
- package/components/HelpBubbleExample/HelpBubbleExample.js.map +1 -1
- package/components/HelpPanel/HelpPanel.js +11 -11
- package/components/HelpPanel/HelpPanel.js.map +1 -1
- package/components/HelpQuestion/HelpQuestion.js +16 -17
- package/components/HelpQuestion/HelpQuestion.js.map +1 -1
- package/components/HighlightBox/HighlightBox.js +16 -16
- package/components/HighlightBox/HighlightBox.js.map +1 -1
- package/components/HighlightBox/styles.module.scss +4 -4
- package/components/HorizontalScroll/HorizontalScroll.js +4 -4
- package/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/components/HorizontalScroll/index.js +2 -3
- package/components/HorizontalScroll/index.js.map +1 -1
- package/components/Illustration/Illustration.js +16 -17
- package/components/Illustration/Illustration.js.map +1 -1
- package/components/Illustration/index.js +5 -5
- package/components/Input/Input.js +65 -67
- package/components/Input/Input.js.map +1 -1
- package/components/Label/Label.js +16 -16
- package/components/Label/Label.js.map +1 -1
- package/components/LazyIcon/ErrorBoundary.js +7 -8
- package/components/LazyIcon/ErrorBoundary.js.map +1 -1
- package/components/LazyIcon/LazyIcon.js +4 -4
- package/components/LazyIcon/LazyIcon.js.map +1 -1
- package/components/LazyIcon/index.js +3 -3
- package/components/LazyIllustration/LazyIllustration.js +10 -10
- package/components/LazyIllustration/LazyIllustration.js.map +1 -1
- package/components/LazyIllustration/index.js +5 -5
- package/components/LinkList/LinkList.js +36 -37
- package/components/LinkList/LinkList.js.map +1 -1
- package/components/LinkList/index.js +2 -3
- package/components/LinkList/index.js.map +1 -1
- package/components/List/List.js +7 -8
- package/components/List/List.js.map +1 -1
- package/components/ListHeader/ListHeader.js +1 -1
- package/components/ListHeader/ListHeader.js.map +1 -1
- package/components/ListHeader/ListHeaderText/ListHeaderText.js +18 -19
- package/components/ListHeader/ListHeaderText/ListHeaderText.js.map +1 -1
- package/components/ListHeader/ListHeaderText/index.js +2 -3
- package/components/ListHeader/ListHeaderText/index.js.map +1 -1
- package/components/Loader/Loader.js +2 -2
- package/components/Loader/Loader.js.map +1 -1
- package/components/Logo/Logo.js +5 -5
- package/components/Logo/Logo.js.map +1 -1
- package/components/MaxCharacters/MaxCharacters.js +5 -5
- package/components/MaxCharacters/MaxCharacters.js.map +1 -1
- package/components/Modal/Modal.js +32 -33
- package/components/Modal/Modal.js.map +1 -1
- package/components/Modal/styles.module.scss +8 -8
- package/components/NotificationPanel/NotificationPanel.js +14 -14
- package/components/NotificationPanel/NotificationPanel.js.map +1 -1
- package/components/NotificationPanel/styles.module.scss +3 -3
- package/components/Panel/Panel.js +25 -25
- package/components/Panel/Panel.js.map +1 -1
- package/components/Panel/styles.module.scss +3 -3
- package/components/PanelList/PanelList.js +8 -8
- package/components/PanelList/PanelList.js.map +1 -1
- package/components/PopMenu/PopMenu.js +14 -14
- package/components/PopMenu/PopMenu.js.map +1 -1
- package/components/PopMenu/index.js +3 -3
- package/components/PopOver/PopOver.js +27 -28
- package/components/PopOver/PopOver.js.map +1 -1
- package/components/Portal/index.js.map +1 -1
- package/components/Progressbar/Progressbar.js +13 -13
- package/components/Progressbar/Progressbar.js.map +1 -1
- package/components/PromoPanel/PromoPanel.js +16 -16
- package/components/PromoPanel/PromoPanel.js.map +1 -1
- package/components/RadioButton/RadioButton.js +52 -53
- package/components/RadioButton/RadioButton.js.map +1 -1
- package/components/RadioButton/index.js +4 -4
- package/components/RadioButton/styles.module.scss +2 -2
- package/components/Select/Select.js +21 -21
- package/components/Select/Select.js.map +1 -1
- package/components/Select/index.js +2 -3
- package/components/Select/index.js.map +1 -1
- package/components/ServiceMessage/ServiceMessage.js +30 -30
- package/components/ServiceMessage/ServiceMessage.js.map +1 -1
- package/components/ServiceMessage/styles.module.scss +10 -10
- package/components/SharingStatus/SharingStatus.js +7 -7
- package/components/SharingStatus/SharingStatus.js.map +1 -1
- package/components/Slider/Slider.js +15 -17
- package/components/Slider/Slider.js.map +1 -1
- package/components/Slider/index.js +2 -3
- package/components/Slider/index.js.map +1 -1
- package/components/Spacer/Spacer.js +4 -4
- package/components/Spacer/Spacer.js.map +1 -1
- package/components/StatusDot/StatusDot.js +8 -8
- package/components/StatusDot/StatusDot.js.map +1 -1
- package/components/Step/Step.js +10 -10
- package/components/Step/Step.js.map +1 -1
- package/components/StepButtons/StepButtons.js +4 -4
- package/components/StepButtons/StepButtons.js.map +1 -1
- package/components/StepButtons/index.js +2 -3
- package/components/StepButtons/index.js.map +1 -1
- package/components/Stepper/Dot.js +3 -3
- package/components/Stepper/Dot.js.map +1 -1
- package/components/Stepper/DotList.js +4 -4
- package/components/Stepper/DotList.js.map +1 -1
- package/components/Stepper/Stepper.js +10 -10
- package/components/Stepper/Stepper.js.map +1 -1
- package/components/Table/Table.js +1 -1
- package/components/Table/TableBody/TableBody.js +3 -3
- package/components/Table/TableBody/TableBody.js.map +1 -1
- package/components/Table/TableBody/index.js +3 -4
- package/components/Table/TableBody/index.js.map +1 -1
- package/components/Table/TableCell/TableCell.js +10 -10
- package/components/Table/TableCell/TableCell.js.map +1 -1
- package/components/Table/TableCell/index.js +4 -4
- package/components/Table/TableExpandedRow/TableExpandedRow.js +8 -8
- package/components/Table/TableExpandedRow/TableExpandedRow.js.map +1 -1
- package/components/Table/TableExpandedRow/index.js +3 -4
- package/components/Table/TableExpandedRow/index.js.map +1 -1
- package/components/Table/TableExpanderCell/TableExpanderCell.js +3 -3
- package/components/Table/TableExpanderCell/TableExpanderCell.js.map +1 -1
- package/components/Table/TableExpanderCell/TableExpanderCellMobile.js +11 -11
- package/components/Table/TableExpanderCell/TableExpanderCellMobile.js.map +1 -1
- package/components/Table/TableExpanderCell/index.js +3 -4
- package/components/Table/TableExpanderCell/index.js.map +1 -1
- package/components/Table/TableHead/TableHead.js +9 -9
- package/components/Table/TableHead/TableHead.js.map +1 -1
- package/components/Table/TableHead/index.js +4 -4
- package/components/Table/TableHeadCell/TableHeadCell.js +15 -15
- package/components/Table/TableHeadCell/TableHeadCell.js.map +1 -1
- package/components/Table/TableHeadCell/index.js +4 -4
- package/components/Table/TableRow/TableRow.js +16 -16
- package/components/Table/TableRow/TableRow.js.map +1 -1
- package/components/Table/TableRow/index.js +3 -4
- package/components/Table/TableRow/index.js.map +1 -1
- package/components/Table/styles.module.scss +3 -3
- package/components/Table/utils.d.ts +1 -1
- package/components/Tabs/Tab.js +2 -2
- package/components/Tabs/Tab.js.map +1 -1
- package/components/Tabs/TabList/TabList.js +43 -38
- package/components/Tabs/TabList/TabList.js.map +1 -1
- package/components/Tabs/TabList/styles.module.scss +14 -4
- package/components/Tabs/TabPanel/TabPanel.d.ts +5 -1
- package/components/Tabs/TabPanel/TabPanel.js +13 -9
- package/components/Tabs/TabPanel/TabPanel.js.map +1 -1
- package/components/Tabs/TabPanel/styles.module.scss +48 -6
- package/components/Tabs/TabPanel/styles.module.scss.d.ts +4 -0
- package/components/Tabs/Tabs.d.ts +8 -4
- package/components/Tabs/Tabs.js +85 -16
- package/components/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/styles.module.scss +38 -2
- package/components/Tabs/styles.module.scss.d.ts +7 -1
- package/components/Tag/Tag.js +3 -3
- package/components/Tag/Tag.js.map +1 -1
- package/components/TagList/TagList.js +1 -1
- package/components/TagList/TagList.js.map +1 -1
- package/components/Textarea/Textarea.js +48 -49
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Tile/Tile.js +14 -15
- package/components/Tile/Tile.js.map +1 -1
- package/components/Tile/index.js +2 -3
- package/components/Tile/index.js.map +1 -1
- package/components/Title/Title.js +10 -10
- package/components/Title/Title.js.map +1 -1
- package/components/Title/index.js +4 -4
- package/components/Tooltip/Tooltip.js +4 -4
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/Tooltip/TooltipWord/TooltipWord.js +17 -18
- package/components/Tooltip/TooltipWord/TooltipWord.js.map +1 -1
- package/components/Tooltip/index.js +5 -5
- package/components/TooltipExample/TooltipExample.js +4 -4
- package/components/TooltipExample/TooltipExample.js.map +1 -1
- package/components/Trigger/HelpSign.js +3 -3
- package/components/Trigger/HelpSign.js.map +1 -1
- package/components/Trigger/Trigger.js +25 -26
- package/components/Trigger/Trigger.js.map +1 -1
- package/components/Validation/ErrorList.js +5 -5
- package/components/Validation/ErrorList.js.map +1 -1
- package/components/Validation/ErrorListItem.js +8 -8
- package/components/Validation/ErrorListItem.js.map +1 -1
- package/components/Validation/Validation.js +13 -14
- package/components/Validation/Validation.js.map +1 -1
- package/components/Validation/ValidationSummary.js +4 -4
- package/components/Validation/ValidationSummary.js.map +1 -1
- package/components/Validation/index.js +3 -4
- package/components/Validation/index.js.map +1 -1
- package/components/Validation/types.d.ts +0 -1
- package/constants.d.ts +2 -1
- package/constants.js +1 -1
- package/constants.js.map +1 -1
- package/hooks/useIcons.d.ts +0 -1
- package/hooks/useIcons.js +1 -1
- package/hooks/useLayoutEvent.js +1 -2
- package/hooks/useLayoutEvent.js.map +1 -1
- package/hooks/useSticky.d.ts +1 -1
- package/package.json +1 -1
- package/scss/_palette.scss +1 -0
- package/scss/typography.module.scss +1 -1
- package/scss/typography.module.scss.d.ts +1 -1
- package/scss/typography.stories.tsx +157 -0
- package/theme/currys/color.d.ts +1 -1
- package/utils/accessibility.d.ts +2 -1
- package/utils/accessibility.js +1 -1
- package/utils/accessibility.js.map +1 -1
- package/utils/component.d.ts +3 -3
- package/utils/refs.d.ts +1 -2
- package/_virtual/index2.js +0 -5
- package/_virtual/index2.js.map +0 -1
- package/_virtual/index3.js +0 -5
- package/_virtual/index3.js.map +0 -1
- package/components/AnchorLink/AnchorLink.stories.d.ts +0 -31
- package/components/Avatar/Avatar.stories.d.ts +0 -36
- package/components/Badge/Badge.stories.d.ts +0 -42
- package/components/Button/Button.stories.d.ts +0 -56
- package/components/Checkbox/Checkbox.stories.d.ts +0 -54
- package/components/Close/Close.stories.d.ts +0 -29
- package/components/DictionaryTrigger/DictionaryTrigger.stories.d.ts +0 -30
- package/components/Dropdown/Dropdown.stories.d.ts +0 -67
- package/components/Duolist/Duolist.stories.d.ts +0 -32
- package/components/EmptyState/EmptyState.stories.d.ts +0 -26
- package/components/Expander/Expander.stories.d.ts +0 -60
- package/components/ExpanderHierarchy/ExpanderHierarchy.stories.d.ts +0 -44
- package/components/ExpanderList/ExpanderList.stories.d.ts +0 -59
- package/components/FormGroup/FormGroup.stories.d.ts +0 -50
- package/components/FormLayout/FormLayout.stories.d.ts +0 -32
- package/components/HelpBubble/HelpBubble.stories.d.ts +0 -46
- package/components/HelpPanel/HelpPanel.stories.d.ts +0 -31
- package/components/HelpQuestion/HelpQuestion.stories.d.ts +0 -29
- package/components/HighlightBox/HighlightBox.stories.d.ts +0 -42
- package/components/Icon/Icon.stories.d.ts +0 -38
- package/components/Illustration/Illustration.stories.d.ts +0 -34
- package/components/Illustration/Illustrations.stories.d.ts +0 -41
- package/components/Input/Input.stories.d.ts +0 -94
- package/components/Label/Label.stories.d.ts +0 -25
- package/components/LazyIcon/LazyIcon.stories.d.ts +0 -25
- package/components/LazyIllustration/LazyIllustration.stories.d.ts +0 -38
- package/components/LinkList/LinkList.stories.d.ts +0 -49
- package/components/List/List.stories.d.ts +0 -52
- package/components/Loader/Loader.stories.d.ts +0 -31
- package/components/Logo/Logo.stories.d.ts +0 -37
- package/components/Modal/Modal.stories.d.ts +0 -76
- package/components/NotificationPanel/NotificationPanel.stories.d.ts +0 -60
- package/components/Panel/Panel.stories.d.ts +0 -89
- package/components/PanelList/PanelList.stories.d.ts +0 -27
- package/components/PopMenu/PopMenu.stories.d.ts +0 -39
- package/components/PopOver/PopOver.stories.d.ts +0 -38
- package/components/Progressbar/Progressbar.stories.d.ts +0 -43
- package/components/PromoPanel/PromoPanel.stories.d.ts +0 -45
- package/components/RadioButton/RadioButton.stories.d.ts +0 -57
- package/components/Select/Select.stories.d.ts +0 -38
- package/components/ServiceMessage/ServiceMessage.stories.d.ts +0 -71
- package/components/SharingStatus/SharingStatus.stories.d.ts +0 -31
- package/components/Slider/Slider.stories.d.ts +0 -52
- package/components/Spacer/Spacer.stories.d.ts +0 -17
- package/components/StatusDot/StatusDot.stories.d.ts +0 -31
- package/components/Step/Step.stories.d.ts +0 -32
- package/components/StepButtons/StepButtons.stories.d.ts +0 -19
- package/components/Stepper/Stepper.stories.d.ts +0 -38
- package/components/Table/Table.stories.d.ts +0 -90
- package/components/Tabs/Tabs.stories.d.ts +0 -50
- package/components/Tag/Tag.stories.d.ts +0 -48
- package/components/TagList/TagList.stories.d.ts +0 -17
- package/components/Textarea/Textarea.stories.d.ts +0 -94
- package/components/Tile/Tile.stories.d.ts +0 -65
- package/components/Title/Title.stories.d.ts +0 -40
- package/components/Tooltip/Tooltip.stories.d.ts +0 -34
- package/components/Trigger/Trigger.stories.d.ts +0 -52
- package/components/Validation/Validation.stories.d.ts +0 -37
- package/hoc/withBreakpoint/withBreakpoint.stories.d.ts +0 -17
- package/hooks/useBreakpoint.stories.d.ts +0 -16
- package/hooks/useDelayedState.stories.d.ts +0 -27
- package/hooks/useElementList.stories.d.ts +0 -16
- package/hooks/useFocusToggle.stories.d.ts +0 -16
- package/hooks/useFocusTrap.stories.d.ts +0 -16
- package/hooks/useFocusableElements.stories.d.ts +0 -16
- package/hooks/useHover.stories.d.ts +0 -16
- package/hooks/useIntersectionObserver.stories.d.ts +0 -16
- package/hooks/useInterval.stories.d.ts +0 -16
- package/hooks/useIsVisible.stories.d.ts +0 -27
- package/hooks/useKeyboardEvent.stories.d.ts +0 -16
- package/hooks/useLayoutEvent.stories.d.ts +0 -16
- package/hooks/useOutsideEvent.stories.d.ts +0 -16
- package/hooks/usePseudoClasses.stories.d.ts +0 -16
- package/hooks/useResizeObserver.stories.d.ts +0 -16
- package/hooks/useRovingFocus.stories.d.ts +0 -17
- package/hooks/useSize.stories.d.ts +0 -16
- package/hooks/useSticky.stories.d.ts +0 -16
- package/hooks/useUuid.stories.d.ts +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeadCell.js","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icon';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'th'>, 'style'> {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell: React.FC<Props> = ({\n sortable,\n onClick,\n className,\n children,\n sortDir,\n mode = ModeType.normal,\n scope = 'col',\n ...rest\n}) => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable && !children) {\n return <td className={tableHeadCellDefaultClass}></td>;\n }\n\n if (!sortable) {\n return (\n <th scope={scope} className={tableHeadCellDefaultClass} {...rest}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(tableHeadCellDefaultClass, tableStyles['table__head-cell--sortable'], className);\n\n const renderSortIcon = (): React.JSX.Element | undefined =>\n sortDir && (\n <div className={tableStyles['table__head-cell-sort-icon-wrapper']}>\n <Icon svgIcon={sortDir == SortDirection.asc ? ArrowDown : ArrowUp} size={IconSize.XXSmall} />\n </div>\n );\n\n const getSortDirection = (): React.AriaAttributes['aria-sort'] => {\n switch (sortDir) {\n case SortDirection.asc:\n return 'ascending';\n case SortDirection.desc:\n return 'descending';\n }\n };\n\n return (\n <th scope={scope} className={sortableClasses} aria-sort={getSortDirection()} {...rest}>\n <button type=\"button\" onClick={onClick} className={tableStyles['table__sort-button']} aria-pressed={sortDir ? !!sortDir : undefined}>\n {renderSortIcon()}\n {children}\n </button>\n </th>\n );\n};\n\nexport default TableHeadCell;\n"],"names":["SortDirection","TableHeadCell","sortable","onClick","className","children","sortDir","mode","ModeType","scope","rest","tableHeadCellDefaultClass","classNames","tableStyles","React","sortableClasses","renderSortIcon","Icon","ArrowDown","ArrowUp","IconSize","getSortDirection"
|
|
1
|
+
{"version":3,"file":"TableHeadCell.js","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icon';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'th'>, 'style'> {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell: React.FC<Props> = ({\n sortable,\n onClick,\n className,\n children,\n sortDir,\n mode = ModeType.normal,\n scope = 'col',\n ...rest\n}) => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable && !children) {\n return <td className={tableHeadCellDefaultClass}></td>;\n }\n\n if (!sortable) {\n return (\n <th scope={scope} className={tableHeadCellDefaultClass} {...rest}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(tableHeadCellDefaultClass, tableStyles['table__head-cell--sortable'], className);\n\n const renderSortIcon = (): React.JSX.Element | undefined =>\n sortDir && (\n <div className={tableStyles['table__head-cell-sort-icon-wrapper']}>\n <Icon svgIcon={sortDir == SortDirection.asc ? ArrowDown : ArrowUp} size={IconSize.XXSmall} />\n </div>\n );\n\n const getSortDirection = (): React.AriaAttributes['aria-sort'] => {\n switch (sortDir) {\n case SortDirection.asc:\n return 'ascending';\n case SortDirection.desc:\n return 'descending';\n }\n };\n\n return (\n <th scope={scope} className={sortableClasses} aria-sort={getSortDirection()} {...rest}>\n <button type=\"button\" onClick={onClick} className={tableStyles['table__sort-button']} aria-pressed={sortDir ? !!sortDir : undefined}>\n {renderSortIcon()}\n {children}\n </button>\n </th>\n );\n};\n\nexport default TableHeadCell;\n"],"names":["SortDirection","TableHeadCell","sortable","onClick","className","children","sortDir","mode","ModeType","scope","rest","tableHeadCellDefaultClass","classNames","tableStyles","React","sortableClasses","renderSortIcon","Icon","ArrowDown","ArrowUp","IconSize","getSortDirection"],"mappings":";;;;;;;;AAUY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,OAAO,QAFGA,IAAAA,KAAA,CAAA,CAAA;AAoBL,MAAMC,IAAiC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAAA,EAChB,OAAAC,IAAQ;AAAA,EACR,GAAGC;AACL,MAAM;AACJ,QAAMC,IAA4BC,EAAWC,EAAY,kBAAkB,GAAGT,GAAW;AAAA,IACvF,CAACS,EAAY,2BAA2B,CAAC,GAAGN,MAASC,EAAS;AAAA,EAAA,CAC/D;AAEG,MAAA,CAACN,KAAY,CAACG;AACT,WAAAS,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,EAA2B,CAAA;AAGnD,MAAI,CAACT;AACH,2CACG,MAAG,EAAA,OAAAO,GAAc,WAAWE,GAA4B,GAAGD,KACzDL,CACH;AAIJ,QAAMU,IAAkBH,EAAWD,GAA2BE,EAAY,4BAA4B,GAAGT,CAAS,GAE5GY,IAAiB,MACrBV,qCACG,OAAI,EAAA,WAAWO,EAAY,oCAAoC,EAAA,mCAC7DI,GAAK,EAAA,SAASX,KAAW,QAAoBY,IAAYC,GAAS,MAAMC,EAAS,SAAS,CAC7F,GAGEC,IAAmB,MAAyC;AAChE,YAAQf,GAAS;AAAA,MACf,KAAK;AACI,eAAA;AAAA,MACT,KAAK;AACI,eAAA;AAAA,IACX;AAAA,EAAA;AAGF,SACGQ,gBAAAA,EAAA,cAAA,MAAA,EAAG,OAAAL,GAAc,WAAWM,GAAiB,aAAWM,EAAiB,GAAI,GAAGX,EAAA,GAC9EI,gBAAAA,EAAA,cAAA,UAAA,EAAO,MAAK,UAAS,SAAAX,GAAkB,WAAWU,EAAY,oBAAoB,GAAG,gBAAcP,IAAU,CAAC,CAACA,IAAU,OACvH,GAAAU,EACA,GAAAX,CACH,CACF;AAEJ;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SortDirection as a
|
|
1
|
+
import { TableHeadCell as o } from "./TableHeadCell.js";
|
|
2
|
+
import { SortDirection as a } from "./TableHeadCell.js";
|
|
3
3
|
export {
|
|
4
4
|
a as SortDirection,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
o as TableHeadCell,
|
|
6
|
+
o as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ModeType as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
2
|
+
import E from "classnames";
|
|
3
|
+
import o from "../../Table/styles.module.scss";
|
|
4
|
+
import { ModeType as d } from "../Table.js";
|
|
5
|
+
import w from "../TableExpanderCell/TableExpanderCellMobile.js";
|
|
6
|
+
const x = ({
|
|
7
7
|
rowKey: m,
|
|
8
8
|
hideDetailsText: s,
|
|
9
9
|
showDetailsText: n,
|
|
@@ -11,19 +11,19 @@ const R = ({
|
|
|
11
11
|
expanded: p,
|
|
12
12
|
onClick: a,
|
|
13
13
|
className: b,
|
|
14
|
-
children:
|
|
15
|
-
mode: l =
|
|
16
|
-
...
|
|
14
|
+
children: f,
|
|
15
|
+
mode: l = d.normal,
|
|
16
|
+
...i
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const c = E(
|
|
19
|
+
o["table-row"],
|
|
20
20
|
{
|
|
21
|
-
[
|
|
21
|
+
[o["table__row--expandable"]]: t
|
|
22
22
|
},
|
|
23
23
|
b
|
|
24
24
|
);
|
|
25
|
-
return /* @__PURE__ */ e.createElement("tr", { className:
|
|
26
|
-
|
|
25
|
+
return /* @__PURE__ */ e.createElement("tr", { className: c, onClick: a, key: m, ...i }, e.Children.map(f, (r) => e.isValidElement(r) && e.cloneElement(r, { mode: l })), t && /* @__PURE__ */ e.createElement(
|
|
26
|
+
w,
|
|
27
27
|
{
|
|
28
28
|
expanded: p,
|
|
29
29
|
onClick: a,
|
|
@@ -32,9 +32,9 @@ const R = ({
|
|
|
32
32
|
mode: l
|
|
33
33
|
}
|
|
34
34
|
));
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
x as TableRow,
|
|
38
|
+
x as default
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=TableRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.js","sources":["../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\nimport TableExpanderCellMobile from '../TableExpanderCell/TableExpanderCellMobile';\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'tr'>, 'style'> {\n /** Sets if expanded row can be expanded */\n expandable?: boolean;\n /** Sets if expanded row is expanded */\n expanded?: boolean;\n /** When hide/show button for expanded row is clicked. */\n onClick?: () => void;\n /** Text for expanded row hide button. */\n hideDetailsText?: string;\n /** Text for expanded row show button. */\n showDetailsText?: string;\n /** Key attribute for row */\n rowKey?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the cells of the table row element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableRow: React.FC<Props> = ({\n rowKey,\n hideDetailsText,\n showDetailsText,\n expandable,\n expanded,\n onClick,\n className,\n children,\n mode = ModeType.normal,\n ...rest\n}) => {\n const tableRowClass = classNames(\n tableStyles['table-row'],\n {\n [tableStyles['table__row--expandable']]: expandable,\n },\n className\n );\n\n return (\n <tr className={tableRowClass} onClick={onClick} key={rowKey} {...rest}>\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n {expandable && (\n <TableExpanderCellMobile\n expanded={expanded}\n onClick={onClick}\n hideDetailsText={hideDetailsText}\n showDetailsText={showDetailsText}\n mode={mode}\n />\n )}\n </tr>\n );\n};\n\nexport default TableRow;\n"],"names":["TableRow","rowKey","hideDetailsText","showDetailsText","expandable","expanded","onClick","className","children","mode","ModeType","rest","tableRowClass","classNames","tableStyles","React","child","TableExpanderCellMobile"
|
|
1
|
+
{"version":3,"file":"TableRow.js","sources":["../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\nimport TableExpanderCellMobile from '../TableExpanderCell/TableExpanderCellMobile';\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'tr'>, 'style'> {\n /** Sets if expanded row can be expanded */\n expandable?: boolean;\n /** Sets if expanded row is expanded */\n expanded?: boolean;\n /** When hide/show button for expanded row is clicked. */\n onClick?: () => void;\n /** Text for expanded row hide button. */\n hideDetailsText?: string;\n /** Text for expanded row show button. */\n showDetailsText?: string;\n /** Key attribute for row */\n rowKey?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the cells of the table row element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableRow: React.FC<Props> = ({\n rowKey,\n hideDetailsText,\n showDetailsText,\n expandable,\n expanded,\n onClick,\n className,\n children,\n mode = ModeType.normal,\n ...rest\n}) => {\n const tableRowClass = classNames(\n tableStyles['table-row'],\n {\n [tableStyles['table__row--expandable']]: expandable,\n },\n className\n );\n\n return (\n <tr className={tableRowClass} onClick={onClick} key={rowKey} {...rest}>\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n {expandable && (\n <TableExpanderCellMobile\n expanded={expanded}\n onClick={onClick}\n hideDetailsText={hideDetailsText}\n showDetailsText={showDetailsText}\n mode={mode}\n />\n )}\n </tr>\n );\n};\n\nexport default TableRow;\n"],"names":["TableRow","rowKey","hideDetailsText","showDetailsText","expandable","expanded","onClick","className","children","mode","ModeType","rest","tableRowClass","classNames","tableStyles","React","child","TableExpanderCellMobile"],"mappings":";;;;;AA6BO,MAAMA,IAA4B,CAAC;AAAA,EACxC,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAAA,EAChB,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAgBC;AAAA,IACpBC,EAAY,WAAW;AAAA,IACvB;AAAA,MACE,CAACA,EAAY,wBAAwB,CAAC,GAAGV;AAAA,IAC3C;AAAA,IACAG;AAAA,EAAA;AAIA,SAAAQ,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,GAAe,SAAAN,GAAkB,KAAKL,GAAS,GAAGU,EAAA,GAC9DI,EAAM,SAAS,IAAIP,GAAU,OAASO,EAAM,eAAoCC,CAAK,KAAKD,EAAM,aAAaC,GAAO,EAAE,MAAAP,EAAM,CAAA,CAAC,GAC7HL,KACCW,gBAAAA,EAAA;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAAZ;AAAA,MACA,SAAAC;AAAA,MACA,iBAAAJ;AAAA,MACA,iBAAAC;AAAA,MACA,MAAAM;AAAA,IAAA;AAAA,EAAA,CAGN;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -134,7 +134,7 @@ table .table-body .table-row {
|
|
|
134
134
|
width: 100%;
|
|
135
135
|
border-collapse: collapse;
|
|
136
136
|
|
|
137
|
-
@each $breakpoint in map
|
|
137
|
+
@each $breakpoint in map.keys($grid-breakpoints) {
|
|
138
138
|
&--centeredoverflow-#{$breakpoint} {
|
|
139
139
|
@include media-breakpoint-down($breakpoint) {
|
|
140
140
|
@include centeredoverflow;
|
|
@@ -215,13 +215,13 @@ table .table-body .table-row {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
&--compact {
|
|
218
|
-
padding: getSpacer(2xs) getSpacer(3xs) getSpacer(4xs)
|
|
218
|
+
padding: getSpacer(2xs) getSpacer(3xs) getSpacer(4xs);
|
|
219
219
|
line-height: 18px;
|
|
220
220
|
font-size: 14px;
|
|
221
221
|
height: unset;
|
|
222
222
|
|
|
223
223
|
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
224
|
-
padding: getSpacer(s) getSpacer(3xs) getSpacer(3xs)
|
|
224
|
+
padding: getSpacer(s) getSpacer(3xs) getSpacer(3xs);
|
|
225
225
|
line-height: 20px;
|
|
226
226
|
font-size: $font-size-xs;
|
|
227
227
|
height: unset;
|
|
@@ -8,7 +8,7 @@ import { Breakpoint } from '../../hooks/useBreakpoint';
|
|
|
8
8
|
* @param tableWidth Bredde på tabell i px
|
|
9
9
|
* @returns Konfigurasjon for responsiv oppførsel uten fallbackVariant
|
|
10
10
|
*/
|
|
11
|
-
export declare const getCurrentConfig: (config: BreakpointConfig | BreakpointConfig[], breakpoint: Breakpoint, tableWidth: number, windowWidth: number) => Omit<BreakpointConfig,
|
|
11
|
+
export declare const getCurrentConfig: (config: BreakpointConfig | BreakpointConfig[], breakpoint: Breakpoint, tableWidth: number, windowWidth: number) => Omit<BreakpointConfig, "fallbackVariant"> | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Finn klassenavn for responsiv oppførsel
|
|
14
14
|
* @param config Konfigurasjon for responsiv oppførsel
|
package/components/Tabs/Tab.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
const
|
|
2
|
+
const r = (t) => /* @__PURE__ */ e.createElement(e.Fragment, null, t.children ?? null);
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
r as default
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.js","sources":["../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\n\nexport interface TabProps {\n /** Sets the tab panel content */\n children?: React.ReactNode;\n /** Optional icon on the tab */\n icon?: SvgIcon | IconName;\n /** Called when tab is selected */\n onTabClick?: (index: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Title on the tab */\n title?: string;\n}\n\nconst Tab: React.FC<TabProps> = props => {\n return <>{props.children ?? null}</>;\n};\n\nexport default Tab;\n"],"names":["Tab","props","React"
|
|
1
|
+
{"version":3,"file":"Tab.js","sources":["../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\n\nexport interface TabProps {\n /** Sets the tab panel content */\n children?: React.ReactNode;\n /** Optional icon on the tab */\n icon?: SvgIcon | IconName;\n /** Called when tab is selected */\n onTabClick?: (index: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Title on the tab */\n title?: string;\n}\n\nconst Tab: React.FC<TabProps> = props => {\n return <>{props.children ?? null}</>;\n};\n\nexport default Tab;\n"],"names":["Tab","props","React"],"mappings":";AAkBA,MAAMA,IAA0B,CAASC,MAChCC,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAGD,EAAM,YAAY,IAAK;"}
|
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import t, { useRef as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
[
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import t, { useRef as k } from "react";
|
|
2
|
+
import C from "classnames";
|
|
3
|
+
import { useIsVisible as L } from "../../../hooks/useIsVisible.js";
|
|
4
|
+
import { useRovingFocus as V } from "../../../hooks/useRovingFocus.js";
|
|
5
|
+
import { palette as a } from "../../../theme/palette.js";
|
|
6
|
+
import { isComponent as w } from "../../../utils/component.js";
|
|
7
|
+
import { uuid as X } from "../../../utils/uuid.js";
|
|
8
|
+
import { Icon as B } from "../../Icon/Icon.js";
|
|
9
|
+
import { IconSize as y } from "../../../constants.js";
|
|
10
|
+
import { LazyIcon as F } from "../../LazyIcon/LazyIcon.js";
|
|
11
|
+
import j from "../Tab.js";
|
|
12
|
+
import o from "../../Tabs/TabList/styles.module.scss";
|
|
13
|
+
const W = (h) => {
|
|
14
|
+
const { selectedTab: I, onTabListClick: m, children: b, color: T = "white", type: E = "normal" } = h, i = k(null), r = k(t.Children.map(b, () => t.createRef()));
|
|
15
|
+
V(m, r, i, !0);
|
|
16
|
+
const R = C(o["tab-list"], o[`tab-list--${E}`]), f = X(), $ = L(i);
|
|
17
|
+
return /* @__PURE__ */ t.createElement("ul", { className: R, ref: i, role: "tablist", "aria-orientation": "horizontal" }, t.Children.map(b, (u, e) => {
|
|
18
|
+
if (w(u, j)) {
|
|
19
|
+
const s = e === I, { title: n, onTabClick: p, icon: l, testId: z } = u.props, N = () => {
|
|
20
|
+
p && p(e), m(e), _(e);
|
|
21
|
+
}, S = C(o["tab-list__tab"], o[`tab-list__tab--${T}`], {
|
|
22
|
+
[o["tab-list__tab--selected"]]: s,
|
|
23
|
+
[o["tab-list__tab--first"]]: e == 0
|
|
24
|
+
}), g = r.current && r.current[e], _ = (v) => {
|
|
25
|
+
var d;
|
|
26
|
+
const c = r.current && r.current[v];
|
|
27
|
+
(d = c == null ? void 0 : c.current) == null || d.scrollIntoView({ behavior: "smooth", inline: "center", block: "nearest" });
|
|
28
|
+
};
|
|
29
|
+
return s && $ && _(e), /* @__PURE__ */ t.createElement("li", { role: "presentation", key: `${n}-${f}` }, /* @__PURE__ */ t.createElement(
|
|
25
30
|
"button",
|
|
26
31
|
{
|
|
27
32
|
role: "tab",
|
|
28
|
-
"aria-selected":
|
|
29
|
-
onClick:
|
|
30
|
-
className:
|
|
31
|
-
key: `${
|
|
32
|
-
"data-testid":
|
|
33
|
-
ref:
|
|
33
|
+
"aria-selected": s,
|
|
34
|
+
onClick: N,
|
|
35
|
+
className: S,
|
|
36
|
+
key: `${n}-${f}`,
|
|
37
|
+
"data-testid": z,
|
|
38
|
+
ref: g
|
|
34
39
|
},
|
|
35
|
-
/* @__PURE__ */ t.createElement("span", { className:
|
|
36
|
-
|
|
40
|
+
/* @__PURE__ */ t.createElement("span", { className: o["tab-list__tab__title-and-icon"] }, l && (typeof l == "string" ? /* @__PURE__ */ t.createElement(
|
|
41
|
+
F,
|
|
37
42
|
{
|
|
38
|
-
iconName:
|
|
39
|
-
size:
|
|
40
|
-
color:
|
|
43
|
+
iconName: l,
|
|
44
|
+
size: y.XSmall,
|
|
45
|
+
color: s ? a.black : a.blueberry500
|
|
41
46
|
}
|
|
42
|
-
) : /* @__PURE__ */ t.createElement(
|
|
47
|
+
) : /* @__PURE__ */ t.createElement(B, { svgIcon: l, size: y.XSmall, color: s ? a.black : a.blueberry500 })), n)
|
|
43
48
|
));
|
|
44
49
|
}
|
|
45
50
|
return null;
|
|
46
51
|
}));
|
|
47
|
-
}
|
|
52
|
+
};
|
|
48
53
|
export {
|
|
49
|
-
|
|
54
|
+
W as default
|
|
50
55
|
};
|
|
51
56
|
//# sourceMappingURL=TabList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabList.js","sources":["../../../../src/components/Tabs/TabList/TabList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useRovingFocus } from '../../../hooks/useRovingFocus';\nimport { palette } from '../../../theme/palette';\nimport { isComponent } from '../../../utils/component';\nimport uuid from '../../../utils/uuid';\nimport Icon, { IconSize } from '../../Icon';\nimport { IconName } from '../../Icons/IconNames';\nimport LazyIcon from '../../LazyIcon';\nimport Tab from '../Tab';\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\ninterface TabListProps {\n children: React.ReactNode;\n onTabListClick: (index: number) => void;\n selectedTab: number;\n color?: TabsColors;\n type?: TabsType;\n}\n\nconst TabList: React.FC<TabListProps> = props => {\n const { selectedTab, onTabListClick, children, color = 'white', type = 'normal' } = props;\n\n const listRef = useRef<HTMLUListElement>(null);\n\n const tabRefs = useRef(React.Children.map(children, () => React.createRef<HTMLButtonElement>()));\n useRovingFocus(onTabListClick, tabRefs, listRef, true);\n\n const tablistClasses = classNames(styles['tab-list'], styles[`tab-list--${type}`]);\n\n const id = uuid();\n\n return (\n <ul className={tablistClasses} ref={listRef} role=\"tablist\" aria-orientation=\"horizontal\">\n {React.Children.map(children, (child, index) => {\n if (isComponent(child, Tab)) {\n const isSelected = index === selectedTab;\n const { title, onTabClick, icon, testId } = child.props;\n const handleClick = (): void => {\n onTabClick && onTabClick(index);\n onTabListClick(index);\n };\n const tabButtonClasses = classNames(styles['tab-list__tab'], styles[`tab-list__tab--${color}`], {\n [styles['tab-list__tab--selected']]: isSelected,\n [styles['tab-list__tab--first']]: index == 0,\n });\n\n const currentRef = tabRefs.current && tabRefs.current[index];\n\n return (\n <li role=\"presentation\">\n <button\n role=\"tab\"\n aria-selected={isSelected}\n onClick={handleClick}\n className={tabButtonClasses}\n key={`${title}-${id}`}\n data-testid={testId}\n ref={currentRef as React.RefObject<HTMLButtonElement>}\n >\n <span className={styles['tab-list__tab__title-and-icon']}>\n {icon &&\n (typeof icon === 'string' ? (\n <LazyIcon\n iconName={icon as IconName}\n size={IconSize.XSmall}\n color={isSelected ? palette[`black`] : palette['blueberry500']}\n />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} color={isSelected ? palette[`black`] : palette['blueberry500']} />\n ))}\n {title}\n </span>\n </button>\n </li>\n );\n }\n return null;\n })}\n </ul>\n );\n};\n\nexport default TabList;\n"],"names":["TabList","props","selectedTab","onTabListClick","children","color","type","listRef","useRef","tabRefs","React","useRovingFocus","tablistClasses","classNames","styles","id","uuid","child","index","isComponent","Tab","isSelected","title","onTabClick","icon","testId","handleClick","tabButtonClasses","currentRef","LazyIcon","IconSize","palette","Icon"
|
|
1
|
+
{"version":3,"file":"TabList.js","sources":["../../../../src/components/Tabs/TabList/TabList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../../hooks/useIsVisible';\nimport { useRovingFocus } from '../../../hooks/useRovingFocus';\nimport { palette } from '../../../theme/palette';\nimport { isComponent } from '../../../utils/component';\nimport uuid from '../../../utils/uuid';\nimport Icon, { IconSize } from '../../Icon';\nimport { IconName } from '../../Icons/IconNames';\nimport LazyIcon from '../../LazyIcon';\nimport Tab from '../Tab';\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\ninterface TabListProps {\n children: React.ReactNode;\n onTabListClick: (index: number) => void;\n selectedTab: number;\n color?: TabsColors;\n type?: TabsType;\n}\n\nconst TabList: React.FC<TabListProps> = props => {\n const { selectedTab, onTabListClick, children, color = 'white', type = 'normal' } = props;\n\n const listRef = useRef<HTMLUListElement>(null);\n\n const tabRefs = useRef(React.Children.map(children, () => React.createRef<HTMLButtonElement>()));\n useRovingFocus(onTabListClick, tabRefs, listRef, true);\n\n const tablistClasses = classNames(styles['tab-list'], styles[`tab-list--${type}`]);\n\n const id = uuid();\n const isVisible = useIsVisible(listRef);\n\n return (\n <ul className={tablistClasses} ref={listRef} role=\"tablist\" aria-orientation=\"horizontal\">\n {React.Children.map(children, (child, index) => {\n if (isComponent(child, Tab)) {\n const isSelected = index === selectedTab;\n const { title, onTabClick, icon, testId } = child.props;\n const handleClick = (): void => {\n onTabClick && onTabClick(index);\n onTabListClick(index);\n scrollToTab(index);\n };\n const tabButtonClasses = classNames(styles['tab-list__tab'], styles[`tab-list__tab--${color}`], {\n [styles['tab-list__tab--selected']]: isSelected,\n [styles['tab-list__tab--first']]: index == 0,\n });\n\n const currentRef = tabRefs.current && tabRefs.current[index];\n\n const scrollToTab = (index: number): void => {\n const currentRef = tabRefs.current && tabRefs.current[index];\n currentRef?.current?.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' });\n };\n\n if (isSelected && isVisible) scrollToTab(index);\n\n return (\n <li role=\"presentation\" key={`${title}-${id}`}>\n <button\n role=\"tab\"\n aria-selected={isSelected}\n onClick={handleClick}\n className={tabButtonClasses}\n key={`${title}-${id}`}\n data-testid={testId}\n ref={currentRef as React.RefObject<HTMLButtonElement>}\n >\n <span className={styles['tab-list__tab__title-and-icon']}>\n {icon &&\n (typeof icon === 'string' ? (\n <LazyIcon\n iconName={icon as IconName}\n size={IconSize.XSmall}\n color={isSelected ? palette[`black`] : palette['blueberry500']}\n />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} color={isSelected ? palette[`black`] : palette['blueberry500']} />\n ))}\n {title}\n </span>\n </button>\n </li>\n );\n }\n return null;\n })}\n </ul>\n );\n};\n\nexport default TabList;\n"],"names":["TabList","props","selectedTab","onTabListClick","children","color","type","listRef","useRef","tabRefs","React","useRovingFocus","tablistClasses","classNames","styles","id","uuid","isVisible","useIsVisible","child","index","isComponent","Tab","isSelected","title","onTabClick","icon","testId","handleClick","scrollToTab","tabButtonClasses","currentRef","LazyIcon","IconSize","palette","Icon"],"mappings":";;;;;;;;;;;;AAwBA,MAAMA,IAAkC,CAASC,MAAA;AACzC,QAAA,EAAE,aAAAC,GAAa,gBAAAC,GAAgB,UAAAC,GAAU,OAAAC,IAAQ,SAAS,MAAAC,IAAO,SAAa,IAAAL,GAE9EM,IAAUC,EAAyB,IAAI,GAEvCC,IAAUD,EAAOE,EAAM,SAAS,IAAIN,GAAU,MAAMM,EAAM,UAA8B,CAAA,CAAC;AAChF,EAAAC,EAAAR,GAAgBM,GAASF,GAAS,EAAI;AAE/C,QAAAK,IAAiBC,EAAWC,EAAO,UAAU,GAAGA,EAAO,aAAaR,CAAI,EAAE,CAAC,GAE3ES,IAAKC,KACLC,IAAYC,EAAaX,CAAO;AAEtC,yCACG,MAAG,EAAA,WAAWK,GAAgB,KAAKL,GAAS,MAAK,WAAU,oBAAiB,aAAA,GAC1EG,EAAM,SAAS,IAAIN,GAAU,CAACe,GAAOC,MAAU;AAC1C,QAAAC,EAAYF,GAAOG,CAAG,GAAG;AAC3B,YAAMC,IAAaH,MAAUlB,GACvB,EAAE,OAAAsB,GAAO,YAAAC,GAAY,MAAAC,GAAM,QAAAC,MAAWR,EAAM,OAC5CS,IAAc,MAAY;AAC9B,QAAAH,KAAcA,EAAWL,CAAK,GAC9BjB,EAAeiB,CAAK,GACpBS,EAAYT,CAAK;AAAA,MAAA,GAEbU,IAAmBjB,EAAWC,EAAO,eAAe,GAAGA,EAAO,kBAAkBT,CAAK,EAAE,GAAG;AAAA,QAC9F,CAACS,EAAO,yBAAyB,CAAC,GAAGS;AAAA,QACrC,CAACT,EAAO,sBAAsB,CAAC,GAAGM,KAAS;AAAA,MAAA,CAC5C,GAEKW,IAAatB,EAAQ,WAAWA,EAAQ,QAAQW,CAAK,GAErDS,IAAc,CAACT,MAAwB;;AAC3C,cAAMW,IAAatB,EAAQ,WAAWA,EAAQ,QAAQW,CAAK;AAC3DW,SAAAA,IAAAA,KAAAA,gBAAAA,EAAY,YAAZA,QAAAA,EAAqB,eAAe,EAAE,UAAU,UAAU,QAAQ,UAAU,OAAO,UAAA;AAAA,MAAW;AAG5F,aAAAR,KAAcN,KAAWY,EAAYT,CAAK,GAG5CV,gBAAAA,EAAA,cAAC,QAAG,MAAK,gBAAe,KAAK,GAAGc,CAAK,IAAIT,CAAE,GACzC,GAAAL,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,iBAAea;AAAA,UACf,SAASK;AAAA,UACT,WAAWE;AAAA,UACX,KAAK,GAAGN,CAAK,IAAIT,CAAE;AAAA,UACnB,eAAaY;AAAA,UACb,KAAKI;AAAA,QAAA;AAAA,QAELrB,gBAAAA,EAAA,cAAC,UAAK,WAAWI,EAAO,+BAA+B,EACpD,GAAAY,MACE,OAAOA,KAAS,WACfhB,gBAAAA,EAAA;AAAA,UAACsB;AAAA,UAAA;AAAA,YACC,UAAUN;AAAA,YACV,MAAMO,EAAS;AAAA,YACf,OAAOV,IAAaW,EAAQ,QAAWA,EAAQ;AAAA,UAAc;AAAA,QAAA,IAG9DxB,gBAAAA,EAAA,cAAAyB,GAAA,EAAK,SAAST,GAAM,MAAMO,EAAS,QAAQ,OAAOV,IAAaW,EAAQ,QAAWA,EAAQ,aAAc,CAAG,IAE/GV,CACH;AAAA,MAAA,CAEJ;AAAA,IAEJ;AACO,WAAA;AAAA,EACR,CAAA,CACH;AAEJ;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
1
2
|
@import '../../../scss/supernova/styles/colors';
|
|
3
|
+
@import '../../../scss/breakpoints';
|
|
2
4
|
|
|
3
5
|
.tab-list {
|
|
4
6
|
$tab-list: &;
|
|
@@ -9,12 +11,12 @@
|
|
|
9
11
|
gap: 0.25rem;
|
|
10
12
|
list-style-type: none;
|
|
11
13
|
white-space: nowrap;
|
|
12
|
-
overflow
|
|
13
|
-
overflow-y: initial;
|
|
14
|
+
overflow: hidden;
|
|
14
15
|
height: 3rem;
|
|
15
16
|
z-index: 0;
|
|
16
17
|
margin: 0;
|
|
17
18
|
margin-bottom: -1px;
|
|
19
|
+
background-color: var(--color-base-background-white);
|
|
18
20
|
|
|
19
21
|
&__tab {
|
|
20
22
|
display: flex;
|
|
@@ -56,11 +58,19 @@
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
&--normal {
|
|
59
|
-
padding-left:
|
|
61
|
+
padding-left: 0.5rem;
|
|
62
|
+
|
|
63
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
64
|
+
padding-left: 1rem;
|
|
65
|
+
}
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
&--framed {
|
|
63
|
-
padding-left: 0;
|
|
69
|
+
padding-left: 0.5rem;
|
|
70
|
+
|
|
71
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
72
|
+
padding-left: 0;
|
|
73
|
+
}
|
|
64
74
|
|
|
65
75
|
#{$tab-list}__tab {
|
|
66
76
|
background-color: var(--color-base-background-white);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TabsColors, TabsType } from '../Tabs';
|
|
3
3
|
interface TabPanelProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
4
5
|
color?: TabsColors;
|
|
5
6
|
type?: TabsType;
|
|
6
7
|
isFirst?: boolean;
|
|
8
|
+
translateX?: number;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
animate: 'left' | 'right' | null;
|
|
7
11
|
}
|
|
8
|
-
declare const TabPanel: React.
|
|
12
|
+
declare const TabPanel: React.ForwardRefExoticComponent<TabPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
13
|
export default TabPanel;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import s, { forwardRef as y } from "react";
|
|
2
|
+
import l from "classnames";
|
|
3
3
|
import a from "../../Tabs/TabPanel/styles.module.scss";
|
|
4
|
-
const
|
|
5
|
-
const n =
|
|
6
|
-
[a["tab-panel--first"]]:
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const h = y((n, r) => {
|
|
5
|
+
const { children: o, animate: t, color: m = "white", type: i = "normal", isFirst: c = !1, translateX: e, style: f } = n, p = l(a["tab-panel"], a[`tab-panel--${m}`], a[`tab-panel--${i}`], {
|
|
6
|
+
[a["tab-panel--first"]]: c
|
|
7
|
+
}), b = l({
|
|
8
|
+
[a["tab-panel--animate-left"]]: t === "left",
|
|
9
|
+
[a["tab-panel--animate-right"]]: t === "right"
|
|
10
|
+
}), d = e != 0 ? { transform: `translateX(${e}px)` } : {};
|
|
11
|
+
return /* @__PURE__ */ s.createElement("div", { ref: r, className: p, style: f }, /* @__PURE__ */ s.createElement("div", { className: b, style: d }, o));
|
|
12
|
+
});
|
|
13
|
+
h.displayName = "TabPanel";
|
|
10
14
|
export {
|
|
11
|
-
|
|
15
|
+
h as default
|
|
12
16
|
};
|
|
13
17
|
//# sourceMappingURL=TabPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabPanel.js","sources":["../../../../src/components/Tabs/TabPanel/TabPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\n\ninterface TabPanelProps {\n color?: TabsColors;\n type?: TabsType;\n isFirst?: boolean;\n}\n\nconst TabPanel
|
|
1
|
+
{"version":3,"file":"TabPanel.js","sources":["../../../../src/components/Tabs/TabPanel/TabPanel.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\n\ninterface TabPanelProps {\n children?: React.ReactNode;\n color?: TabsColors;\n type?: TabsType;\n isFirst?: boolean;\n translateX?: number;\n style?: React.CSSProperties;\n animate: 'left' | 'right' | null;\n}\n\nconst TabPanel = forwardRef<HTMLDivElement, TabPanelProps>((props, ref) => {\n const { children, animate, color = 'white', type = 'normal', isFirst = false, translateX, style } = props;\n const tabPanelClasses = classNames(styles['tab-panel'], styles[`tab-panel--${color}`], styles[`tab-panel--${type}`], {\n [styles['tab-panel--first']]: isFirst,\n });\n const contentClasses = classNames({\n [styles['tab-panel--animate-left']]: animate === 'left',\n [styles['tab-panel--animate-right']]: animate === 'right',\n });\n const transformStyle: React.CSSProperties = translateX != 0 ? { transform: `translateX(${translateX}px)` } : {};\n\n return (\n <div ref={ref} className={tabPanelClasses} style={style}>\n <div className={contentClasses} style={transformStyle}>\n {children}\n </div>\n </div>\n );\n});\n\nTabPanel.displayName = 'TabPanel';\nexport default TabPanel;\n"],"names":["TabPanel","forwardRef","props","ref","children","animate","color","type","isFirst","translateX","style","tabPanelClasses","classNames","styles","contentClasses","transformStyle","React"],"mappings":";;;AAkBA,MAAMA,IAAWC,EAA0C,CAACC,GAAOC,MAAQ;AACnE,QAAA,EAAE,UAAAC,GAAU,SAAAC,GAAS,OAAAC,IAAQ,SAAS,MAAAC,IAAO,UAAU,SAAAC,IAAU,IAAO,YAAAC,GAAY,OAAAC,EAAA,IAAUR,GAC9FS,IAAkBC,EAAWC,EAAO,WAAW,GAAGA,EAAO,cAAcP,CAAK,EAAE,GAAGO,EAAO,cAAcN,CAAI,EAAE,GAAG;AAAA,IACnH,CAACM,EAAO,kBAAkB,CAAC,GAAGL;AAAA,EAAA,CAC/B,GACKM,IAAiBF,EAAW;AAAA,IAChC,CAACC,EAAO,yBAAyB,CAAC,GAAGR,MAAY;AAAA,IACjD,CAACQ,EAAO,0BAA0B,CAAC,GAAGR,MAAY;AAAA,EAAA,CACnD,GACKU,IAAsCN,KAAc,IAAI,EAAE,WAAW,cAAcA,CAAU,MAAM,IAAI;AAE7G,SACGO,gBAAAA,EAAA,cAAA,OAAA,EAAI,KAAAb,GAAU,WAAWQ,GAAiB,OAAAD,KACxCM,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWF,GAAgB,OAAOC,EAAA,GACpCX,CACH,CACF;AAEJ,CAAC;AAEDJ,EAAS,cAAc;"}
|
|
@@ -8,24 +8,38 @@
|
|
|
8
8
|
.tab-panel {
|
|
9
9
|
$tab-panel: &;
|
|
10
10
|
|
|
11
|
-
border-top: 1px solid var(--color-action-border-onlight-focus);
|
|
12
11
|
padding: 2rem;
|
|
13
|
-
position: relative;
|
|
14
|
-
z-index: 1;
|
|
15
12
|
|
|
16
13
|
$colors: 'blueberry', 'neutral', 'white';
|
|
17
14
|
|
|
15
|
+
width: 100%;
|
|
16
|
+
padding-left: 0;
|
|
17
|
+
|
|
18
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
&--normal {
|
|
19
23
|
padding: 0;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
&--framed {
|
|
23
27
|
padding: 2rem;
|
|
24
|
-
border: 1px solid var(--color-action-border-onlight-focus);
|
|
25
|
-
border-radius: 0
|
|
28
|
+
border-bottom: 1px solid var(--color-action-border-onlight-focus);
|
|
29
|
+
border-radius: 0;
|
|
30
|
+
|
|
31
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
32
|
+
border-radius: 0 0 0.5rem 0.5rem;
|
|
33
|
+
border: 1px solid var(--color-action-border-onlight-focus);
|
|
34
|
+
border-top: 0;
|
|
35
|
+
}
|
|
26
36
|
|
|
27
37
|
&#{$tab-panel}--first {
|
|
28
|
-
border-radius: 0
|
|
38
|
+
border-radius: 0;
|
|
39
|
+
|
|
40
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
41
|
+
border-radius: 0 0 0.5rem 0.5rem;
|
|
42
|
+
}
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
@each $color in $colors {
|
|
@@ -35,3 +49,31 @@
|
|
|
35
49
|
}
|
|
36
50
|
}
|
|
37
51
|
}
|
|
52
|
+
|
|
53
|
+
.tab-panel--animate-left {
|
|
54
|
+
animation: slide-left 0.5s forwards;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.tab-panel--animate-right {
|
|
58
|
+
animation: slide-right 0.5s forwards;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@keyframes slide-right {
|
|
62
|
+
0% {
|
|
63
|
+
transform: translateX(-100%);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
100% {
|
|
67
|
+
transform: translateX(0%);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@keyframes slide-left {
|
|
72
|
+
0% {
|
|
73
|
+
transform: translateX(100%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
100% {
|
|
77
|
+
transform: translateX(0%);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export type Styles = {
|
|
2
|
+
'slide-left': string;
|
|
3
|
+
'slide-right': string;
|
|
2
4
|
'tab-panel': string;
|
|
5
|
+
'tab-panel--animate-left': string;
|
|
6
|
+
'tab-panel--animate-right': string;
|
|
3
7
|
'tab-panel--blueberry': string;
|
|
4
8
|
'tab-panel--first': string;
|
|
5
9
|
'tab-panel--framed': string;
|
|
@@ -5,14 +5,18 @@ export type { TabProps } from './Tab';
|
|
|
5
5
|
export type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;
|
|
6
6
|
export type TabsType = 'normal' | 'framed';
|
|
7
7
|
export interface TabsProps {
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/** Controlled state for Tabs component */
|
|
9
|
+
activeTab?: number;
|
|
10
|
+
/** Adds custom classes to the element. */
|
|
11
|
+
className?: string;
|
|
10
12
|
/** Sets the color of the tabs. Default: white */
|
|
11
13
|
color?: TabsColors;
|
|
14
|
+
/** Whether the tab list should be sticky */
|
|
15
|
+
sticky?: boolean;
|
|
16
|
+
/** Sets the data-testid attribute. */
|
|
17
|
+
testId?: string;
|
|
12
18
|
/** Sets the visual type of the tabs */
|
|
13
19
|
type?: TabsType;
|
|
14
|
-
/** Controlled state for Tabs component */
|
|
15
|
-
activeTab?: number;
|
|
16
20
|
}
|
|
17
21
|
declare const TabsRoot: React.FC<TabsProps>;
|
|
18
22
|
type TabsComponent = typeof TabsRoot & {
|