@festo-ui/react 8.2.0-dev.582 → 8.2.0-dev.584
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/index.css +1 -1
- package/index.d.ts +63 -63
- package/lib/components/accordion/Accordion.d.ts +3 -3
- package/lib/components/accordion/Accordion.js +6 -6
- package/lib/components/accordion/AccordionContext.js +1 -1
- package/lib/components/accordion/accordion-header/AccordionHeader.d.ts +1 -1
- package/lib/components/accordion/accordion-header/AccordionHeader.js +3 -3
- package/lib/components/accordion/accordion-item/AccordionItem.d.ts +3 -3
- package/lib/components/accordion/accordion-item/AccordionItem.js +6 -6
- package/lib/components/accordion/accordion-item/AccordionItemContext.js +1 -1
- package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +1 -1
- package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +7 -7
- package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +1 -1
- package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +5 -5
- package/lib/components/bottom-sheet/BottomSheet.d.ts +1 -1
- package/lib/components/bottom-sheet/BottomSheet.js +11 -11
- package/lib/components/bottom-sheet/BottomSheet.stories.d.ts +2 -2
- package/lib/components/bottom-sheet/BottomSheet.stories.js +3 -3
- package/lib/components/breadcrumb/Breadcrumb.d.ts +2 -2
- package/lib/components/breadcrumb/Breadcrumb.js +4 -4
- package/lib/components/buttons/button/Button.d.ts +2 -2
- package/lib/components/buttons/button/Button.js +10 -10
- package/lib/components/buttons/button/Button.stories.d.ts +2 -2
- package/lib/components/buttons/button/Button.stories.js +10 -10
- package/lib/components/card/Card.d.ts +1 -1
- package/lib/components/card/Card.js +2 -2
- package/lib/components/card/CardBody.d.ts +1 -1
- package/lib/components/card/CardBody.js +2 -2
- package/lib/components/card/CardHeader.d.ts +1 -1
- package/lib/components/card/CardHeader.js +3 -3
- package/lib/components/card/CardHeader.stories.helper.d.ts +1 -1
- package/lib/components/card/CardHeader.stories.helper.js +2 -2
- package/lib/components/card/CardNotification.d.ts +1 -1
- package/lib/components/chips/chip/Chip.d.ts +1 -1
- package/lib/components/chips/chip/Chip.js +8 -8
- package/lib/components/chips/chip-container/ChipContainer.d.ts +1 -1
- package/lib/components/chips/chip-container/ChipContainer.js +3 -3
- package/lib/components/icon-wrapper/IconWrapper.js +2 -2
- package/lib/components/link-button/LinkButton.d.ts +2 -2
- package/lib/components/link-button/LinkButton.js +5 -5
- package/lib/components/loading-indicator/LoadingIndicator.d.ts +4 -4
- package/lib/components/loading-indicator/LoadingIndicator.js +8 -8
- package/lib/components/mobile-flyout/MobileFlyout.d.ts +2 -2
- package/lib/components/mobile-flyout/MobileFlyout.js +7 -7
- package/lib/components/mobile-flyout/MobileFlyoutContext.js +1 -1
- package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.d.ts +2 -2
- package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +5 -5
- package/lib/components/modals/AlertModal.d.ts +3 -3
- package/lib/components/modals/AlertModal.js +10 -10
- package/lib/components/modals/ConfirmModal.d.ts +2 -2
- package/lib/components/modals/ConfirmModal.js +3 -3
- package/lib/components/modals/CustomModal.d.ts +1 -1
- package/lib/components/modals/CustomModal.js +3 -3
- package/lib/components/modals/Modal.d.ts +4 -4
- package/lib/components/modals/Modal.js +1 -1
- package/lib/components/modals/ModalBase.d.ts +2 -2
- package/lib/components/modals/ModalBase.js +9 -9
- package/lib/components/modals/ModalFooter.d.ts +1 -1
- package/lib/components/modals/ModalFooter.js +4 -4
- package/lib/components/modals/Prompt.d.ts +3 -3
- package/lib/components/modals/Prompt.js +1 -1
- package/lib/components/modals/image-gallery/ImageGallery.d.ts +5 -5
- package/lib/components/modals/image-gallery/ImageGallery.helper.d.ts +1 -1
- package/lib/components/modals/image-gallery/ImageGallery.helper.js +2 -2
- package/lib/components/modals/image-gallery/ImageGallery.js +3 -3
- package/lib/components/modals/image-gallery/ImageGallery.stories.helper.d.ts +1 -1
- package/lib/components/modals/image-gallery/ImageGallery.stories.helper.js +29 -29
- package/lib/components/modals/image-gallery/ImageGalleryContext.d.ts +1 -1
- package/lib/components/modals/image-gallery/ImageGalleryContext.js +1 -1
- package/lib/components/modals/image-gallery/ImageGallerySwiper.js +6 -6
- package/lib/components/modals/image-gallery/ImageGalleryThumbsSwiper.js +3 -3
- package/lib/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.d.ts +2 -2
- package/lib/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.js +8 -8
- package/lib/components/modals/image-gallery/internal/BaseGallery.d.ts +4 -4
- package/lib/components/modals/image-gallery/internal/BaseGallery.js +1 -1
- package/lib/components/modals/image-gallery/internal/CloseButton.js +4 -4
- package/lib/components/modals/image-gallery/internal/ScaleButton.js +1 -1
- package/lib/components/pagination/Pagination.d.ts +2 -2
- package/lib/components/pagination/Pagination.js +14 -14
- package/lib/components/popovers/legend/Legend.d.ts +3 -3
- package/lib/components/popovers/popover/Popover.d.ts +4 -4
- package/lib/components/popovers/popover/Popover.js +11 -11
- package/lib/components/popovers/popover-menu/PopoverMenu.d.ts +3 -3
- package/lib/components/popovers/popover-menu/PopoverMenu.js +3 -3
- package/lib/components/popovers/tooltip/Tooltip.d.ts +1 -1
- package/lib/components/progress/Progress.d.ts +2 -2
- package/lib/components/progress/Progress.js +7 -7
- package/lib/components/scroll-area/ScrollArea.d.ts +1 -1
- package/lib/components/scroll-area/ScrollArea.js +1 -1
- package/lib/components/search-input/ClearButton.d.ts +2 -2
- package/lib/components/search-input/SearchInput.d.ts +2 -2
- package/lib/components/search-input/SearchInput.js +2 -2
- package/lib/components/search-input/useSearchInput.d.ts +2 -2
- package/lib/components/search-input/useSearchInput.js +7 -7
- package/lib/components/snackbar/Snackbar.d.ts +4 -4
- package/lib/components/snackbar/Snackbar.js +11 -11
- package/lib/components/snackbar/SnackbarContext.d.ts +2 -2
- package/lib/components/snackbar/SnackbarContext.js +1 -1
- package/lib/components/snackbar/SnackbarProvider.d.ts +2 -2
- package/lib/components/snackbar/SnackbarProvider.js +3 -3
- package/lib/components/snackbar/useSnackbar.d.ts +1 -1
- package/lib/components/snackbar/useSnackbar.js +1 -1
- package/lib/components/stepper-horizontal/StepperHorizontal.d.ts +2 -2
- package/lib/components/stepper-horizontal/StepperHorizontal.js +7 -7
- package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +3 -3
- package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.js +3 -3
- package/lib/components/stepper-vertical/StepperVertical.d.ts +2 -2
- package/lib/components/stepper-vertical/StepperVertical.js +3 -3
- package/lib/components/stepper-vertical/step-vertical/StepVertical.d.ts +3 -3
- package/lib/components/stepper-vertical/step-vertical/StepVertical.js +9 -9
- package/lib/components/tab/Tabs.d.ts +5 -5
- package/lib/components/tab/Tabs.js +24 -24
- package/lib/components/tab/tab-pane/TabPane.d.ts +3 -3
- package/lib/components/tab/tab-pane/TabPane.js +3 -3
- package/lib/components/tab/useTabScroll.d.ts +1 -1
- package/lib/components/tab/useTabScroll.js +11 -11
- package/lib/components/table-header-cell/TableHeaderCell.js +6 -6
- package/lib/forms/checkbox/Checkbox.d.ts +4 -4
- package/lib/forms/checkbox/Checkbox.js +11 -11
- package/lib/forms/color-indicator/ColorIndicator.d.ts +2 -2
- package/lib/forms/color-indicator/ColorIndicator.js +6 -6
- package/lib/forms/color-picker/ColorHelper.d.ts +4 -4
- package/lib/forms/radio/RadioButton.d.ts +2 -2
- package/lib/forms/radio/RadioButton.js +8 -8
- package/lib/forms/radio/RadioGroup.d.ts +3 -3
- package/lib/forms/radio/RadioGroup.js +3 -3
- package/lib/forms/radio/RadioGroupContext.d.ts +1 -1
- package/lib/forms/radio/RadioGroupContext.js +1 -1
- package/lib/forms/segment/Segment.d.ts +2 -2
- package/lib/forms/segment/Segment.js +7 -7
- package/lib/forms/segment/segment-control/SegmentControl.d.ts +2 -2
- package/lib/forms/segment/segment-control/SegmentControl.js +8 -8
- package/lib/forms/select/Select.d.ts +5 -5
- package/lib/forms/select/Select.js +3 -3
- package/lib/forms/select/internal/HiddenInput.d.ts +1 -1
- package/lib/forms/select/internal/ListItem.d.ts +3 -3
- package/lib/forms/select/internal/ListItem.js +11 -11
- package/lib/forms/select/internal/SelectButton.js +9 -9
- package/lib/forms/select/internal/SelectCheckbox.d.ts +1 -1
- package/lib/forms/select/internal/SelectLabel.js +4 -4
- package/lib/forms/select/internal/SelectScrollContainer.d.ts +1 -1
- package/lib/forms/select/internal/SelectWrapper.d.ts +2 -2
- package/lib/forms/select/internal/SelectWrapper.js +4 -4
- package/lib/forms/select/internal/index.d.ts +6 -6
- package/lib/forms/select/internal/utils.d.ts +2 -2
- package/lib/forms/select/internal/utils.js +3 -3
- package/lib/forms/select/select-option/SelectOption.d.ts +2 -2
- package/lib/forms/select/select-option/SelectOption.js +1 -1
- package/lib/forms/select/utils.d.ts +1 -1
- package/lib/forms/slider/Slider.d.ts +3 -3
- package/lib/forms/slider/Slider.js +9 -9
- package/lib/forms/switch/Switch.d.ts +2 -2
- package/lib/forms/switch/Switch.js +4 -4
- package/lib/forms/text-area/TextArea.d.ts +3 -3
- package/lib/forms/text-area/TextArea.js +12 -12
- package/lib/forms/text-editor/TextEditor.d.ts +1 -1
- package/lib/forms/text-editor/TextEditor.js +42 -38
- package/lib/forms/text-editor/TextEditorButton.d.ts +3 -2
- package/lib/forms/text-editor/TextEditorButton.js +13 -13
- package/lib/forms/text-input/TextInput.d.ts +1 -1
- package/lib/forms/text-input/TextInput.js +6 -6
- package/lib/forms/time-picker/time-picker-dropdown/TimePickerInput.d.ts +1 -1
- package/lib/forms/time-picker/time-picker-dropdown/TimePickerInput.js +2 -2
- package/lib/helper/index.js +2 -2
- package/lib/helper/setRef.js +1 -1
- package/lib/helper/types.d.ts +2 -2
- package/lib/helper/useControlled.d.ts +1 -1
- package/lib/helper/useControlled.js +2 -2
- package/lib/helper/useForkRef.d.ts +1 -1
- package/lib/helper/useForkRef.js +1 -1
- package/lib/helper/useId.js +2 -2
- package/lib/helper/useOnClickOutside.d.ts +1 -1
- package/lib/helper/useOnClickOutside.js +5 -5
- package/node/lib/components/accordion/Accordion.js +4 -4
- package/node/lib/components/accordion/accordion-header/AccordionHeader.js +1 -1
- package/node/lib/components/accordion/accordion-item/AccordionItem.js +4 -4
- package/node/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +4 -4
- package/node/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +3 -3
- package/node/lib/components/bottom-sheet/BottomSheet.js +9 -9
- package/node/lib/components/bottom-sheet/BottomSheet.stories.js +2 -2
- package/node/lib/components/breadcrumb/Breadcrumb.js +2 -2
- package/node/lib/components/buttons/button/Button.js +8 -8
- package/node/lib/components/buttons/button/Button.stories.js +9 -9
- package/node/lib/components/card/Card.js +1 -1
- package/node/lib/components/card/CardBody.js +1 -1
- package/node/lib/components/card/CardHeader.js +2 -2
- package/node/lib/components/card/CardHeader.stories.helper.js +2 -2
- package/node/lib/components/chips/chip/Chip.js +7 -7
- package/node/lib/components/chips/chip-container/ChipContainer.js +2 -2
- package/node/lib/components/icon-wrapper/IconWrapper.js +2 -2
- package/node/lib/components/link-button/LinkButton.js +3 -3
- package/node/lib/components/loading-indicator/LoadingIndicator.js +6 -6
- package/node/lib/components/mobile-flyout/MobileFlyout.js +5 -5
- package/node/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +3 -3
- package/node/lib/components/modals/AlertModal.js +9 -9
- package/node/lib/components/modals/ConfirmModal.js +2 -2
- package/node/lib/components/modals/CustomModal.js +1 -1
- package/node/lib/components/modals/ModalBase.js +4 -4
- package/node/lib/components/modals/ModalFooter.js +2 -2
- package/node/lib/components/modals/image-gallery/ImageGallery.helper.js +1 -1
- package/node/lib/components/modals/image-gallery/ImageGallery.js +2 -2
- package/node/lib/components/modals/image-gallery/ImageGallery.stories.helper.js +29 -29
- package/node/lib/components/modals/image-gallery/ImageGallerySwiper.js +3 -3
- package/node/lib/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.js +5 -5
- package/node/lib/components/modals/image-gallery/internal/CloseButton.js +3 -3
- package/node/lib/components/pagination/Pagination.js +12 -12
- package/node/lib/components/popovers/popover/Popover.js +8 -8
- package/node/lib/components/popovers/popover-menu/PopoverMenu.js +1 -1
- package/node/lib/components/progress/Progress.js +6 -6
- package/node/lib/components/search-input/SearchInput.js +1 -1
- package/node/lib/components/search-input/useSearchInput.js +6 -6
- package/node/lib/components/snackbar/Snackbar.js +8 -8
- package/node/lib/components/snackbar/SnackbarProvider.js +1 -1
- package/node/lib/components/stepper-horizontal/StepperHorizontal.js +5 -5
- package/node/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.js +1 -1
- package/node/lib/components/stepper-vertical/StepperVertical.js +1 -1
- package/node/lib/components/stepper-vertical/step-vertical/StepVertical.js +7 -7
- package/node/lib/components/tab/Tabs.js +22 -22
- package/node/lib/components/tab/tab-pane/TabPane.js +2 -2
- package/node/lib/components/tab/useTabScroll.js +10 -10
- package/node/lib/components/table-header-cell/TableHeaderCell.js +4 -4
- package/node/lib/forms/checkbox/Checkbox.js +9 -9
- package/node/lib/forms/color-indicator/ColorIndicator.js +4 -4
- package/node/lib/forms/radio/RadioButton.js +6 -6
- package/node/lib/forms/radio/RadioGroup.js +1 -1
- package/node/lib/forms/segment/Segment.js +5 -5
- package/node/lib/forms/segment/segment-control/SegmentControl.js +6 -6
- package/node/lib/forms/select/Select.js +1 -1
- package/node/lib/forms/select/internal/ListItem.js +9 -9
- package/node/lib/forms/select/internal/SelectButton.js +7 -7
- package/node/lib/forms/select/internal/SelectLabel.js +3 -3
- package/node/lib/forms/select/internal/SelectWrapper.js +2 -2
- package/node/lib/forms/select/internal/utils.js +1 -1
- package/node/lib/forms/slider/Slider.js +7 -7
- package/node/lib/forms/switch/Switch.js +3 -3
- package/node/lib/forms/text-area/TextArea.js +10 -10
- package/node/lib/forms/text-editor/TextEditor.js +39 -35
- package/node/lib/forms/text-editor/TextEditorButton.js +11 -11
- package/node/lib/forms/text-input/TextInput.js +4 -4
- package/node/lib/forms/time-picker/time-picker-dropdown/TimePickerInput.js +1 -1
- package/node/lib/helper/index.js +2 -2
- package/node/lib/helper/setRef.js +1 -1
- package/node/lib/helper/useControlled.js +1 -1
- package/node/lib/helper/useId.js +1 -1
- package/node/lib/helper/useOnClickOutside.js +4 -4
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import classNames from
|
|
1
|
+
import classNames from "classnames";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
function Progress(_ref) {
|
|
4
4
|
let {
|
|
5
|
-
background =
|
|
5
|
+
background = "white",
|
|
6
6
|
error = false,
|
|
7
7
|
progress,
|
|
8
8
|
className
|
|
9
9
|
} = _ref;
|
|
10
|
-
const classes = classNames(
|
|
11
|
-
|
|
10
|
+
const classes = classNames("fwe-progress-bar", {
|
|
11
|
+
"fwe-bg-red": error
|
|
12
12
|
}, {
|
|
13
|
-
|
|
13
|
+
"fwe-progress-bar-black": background === "black"
|
|
14
14
|
}, {
|
|
15
|
-
|
|
15
|
+
"fwe-progress-bar-background": background === "background"
|
|
16
16
|
});
|
|
17
17
|
return /*#__PURE__*/_jsx("div", {
|
|
18
|
-
className: classNames(
|
|
18
|
+
className: classNames("fwe-progress", className),
|
|
19
19
|
children: /*#__PURE__*/_jsx("div", {
|
|
20
20
|
className: classes,
|
|
21
21
|
role: "progressbar",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface ScrollAreaProps extends React.ComponentPropsWithoutRef<
|
|
1
|
+
interface ScrollAreaProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
2
2
|
scrollbarMinSize?: number;
|
|
3
3
|
}
|
|
4
4
|
export default function ScrollArea({ children, scrollbarMinSize, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from
|
|
2
|
-
export default function ClearButton(props: ComponentPropsWithoutRef<
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export default function ClearButton(props: ComponentPropsWithoutRef<"div">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRef } from
|
|
1
|
+
import { useRef } from "react";
|
|
2
2
|
import useSearchInput from "./useSearchInput.js";
|
|
3
3
|
import useOnClickOutside from "../../helper/useOnClickOutside.js";
|
|
4
4
|
import ClearButton from "./ClearButton.js";
|
|
@@ -58,7 +58,7 @@ function SearchInput(_ref) {
|
|
|
58
58
|
"aria-label": suggestion.value,
|
|
59
59
|
"aria-selected": selectedSuggestionIndex === i,
|
|
60
60
|
onClick: () => handleSuggestionClick(suggestion),
|
|
61
|
-
className: `fwe-search-suggestion ${selectedSuggestionIndex === i ?
|
|
61
|
+
className: `fwe-search-suggestion ${selectedSuggestionIndex === i ? "fwe-selected" : ""}`,
|
|
62
62
|
children: /*#__PURE__*/_jsx("div", {
|
|
63
63
|
// eslint-disable-next-line react/no-danger
|
|
64
64
|
dangerouslySetInnerHTML: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import SearchSuggestion from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import SearchSuggestion from "./SearchSuggestion";
|
|
3
3
|
export default function useSearchInput(inputRef: React.MutableRefObject<HTMLInputElement | null>, cappedSuggestions: SearchSuggestion[], value?: string, defaultValue?: string, onChange?: (value: string) => void, onSearch?: (value: string) => void, onKeyboardNavigate?: (value: string) => void): {
|
|
4
4
|
innerValue: string | undefined;
|
|
5
5
|
hideSuggestionList: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useState } from
|
|
1
|
+
import { useState } from "react";
|
|
2
2
|
import useControlled from "../../helper/useControlled.js";
|
|
3
3
|
export default function useSearchInput(inputRef, cappedSuggestions, value) {
|
|
4
|
-
let defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] :
|
|
4
|
+
let defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
|
|
5
5
|
let onChange = arguments.length > 4 ? arguments[4] : undefined;
|
|
6
6
|
let onSearch = arguments.length > 5 ? arguments[5] : undefined;
|
|
7
7
|
let onKeyboardNavigate = arguments.length > 6 ? arguments[6] : undefined;
|
|
@@ -34,7 +34,7 @@ export default function useSearchInput(inputRef, cappedSuggestions, value) {
|
|
|
34
34
|
}
|
|
35
35
|
function handleClearQuery() {
|
|
36
36
|
reset();
|
|
37
|
-
updateValue(
|
|
37
|
+
updateValue("");
|
|
38
38
|
}
|
|
39
39
|
function handleArrowKey(newSuggestionIndex) {
|
|
40
40
|
if (!cappedSuggestions || !cappedSuggestions.length) {
|
|
@@ -53,16 +53,16 @@ export default function useSearchInput(inputRef, cappedSuggestions, value) {
|
|
|
53
53
|
}
|
|
54
54
|
function handleKeyDown(event) {
|
|
55
55
|
switch (event.key) {
|
|
56
|
-
case
|
|
56
|
+
case "Enter":
|
|
57
57
|
handleSearch();
|
|
58
58
|
break;
|
|
59
|
-
case
|
|
59
|
+
case "Escape":
|
|
60
60
|
handleClearQuery();
|
|
61
61
|
break;
|
|
62
|
-
case
|
|
62
|
+
case "ArrowUp":
|
|
63
63
|
handleUpArrowKey();
|
|
64
64
|
break;
|
|
65
|
-
case
|
|
65
|
+
case "ArrowDown":
|
|
66
66
|
handleDownArrowKey();
|
|
67
67
|
break;
|
|
68
68
|
default:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ClassNameProps } from
|
|
2
|
-
import
|
|
1
|
+
import { ClassNameProps } from "../../helper/types";
|
|
2
|
+
import "./Snackbar.scss";
|
|
3
3
|
export interface SnackbarConfig extends ClassNameProps {
|
|
4
|
-
type?:
|
|
5
|
-
variant?:
|
|
4
|
+
type?: "info" | "warning" | "error";
|
|
5
|
+
variant?: "a" | "b" | "c";
|
|
6
6
|
darkBackground?: boolean;
|
|
7
7
|
showClose?: boolean;
|
|
8
8
|
action?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from
|
|
2
|
-
import classNames from
|
|
3
|
-
import { CSSTransition } from
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { CSSTransition } from "react-transition-group";
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
function Snackbar(props) {
|
|
6
6
|
const {
|
|
@@ -27,7 +27,7 @@ function Snackbar(props) {
|
|
|
27
27
|
function handleClose() {
|
|
28
28
|
setShow(false);
|
|
29
29
|
}
|
|
30
|
-
const classes = first ?
|
|
30
|
+
const classes = first ? "fr-snackbar-wrapper--first" : "fr-snackbar-wrapper";
|
|
31
31
|
return /*#__PURE__*/_jsx(CSSTransition, {
|
|
32
32
|
nodeRef: nodeRef,
|
|
33
33
|
onExited: () => onClose ? onClose() : undefined,
|
|
@@ -43,13 +43,13 @@ function Snackbar(props) {
|
|
|
43
43
|
className: classes,
|
|
44
44
|
children: /*#__PURE__*/_jsxs("div", {
|
|
45
45
|
className: classNames({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
"fwe-snackbar": true,
|
|
47
|
+
"fwe-snackbar-b": data?.variant === "b",
|
|
48
|
+
"fwe-snackbar-c": data?.variant === "c",
|
|
49
|
+
"fwe-snackbar-info": data?.type === "info",
|
|
50
|
+
"fwe-snackbar-warning": data?.type === "warning",
|
|
51
|
+
"fwe-snackbar-error": data?.type === "error",
|
|
52
|
+
"fwe-snackbar-shadow": data?.darkBackground
|
|
53
53
|
}, data?.className),
|
|
54
54
|
children: [/*#__PURE__*/_jsx("span", {
|
|
55
55
|
children: data?.text
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { SnackbarData } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SnackbarData } from "./Snackbar";
|
|
3
3
|
export interface ProviderContext {
|
|
4
4
|
addSnackbar: (data: SnackbarData, onAction?: () => void, onClose?: () => void) => void;
|
|
5
5
|
closeSnackbar: (key: number | string) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export default /*#__PURE__*/React.createContext(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClassNamePropsWithChildren } from
|
|
2
|
-
import { SnackbarConfig } from
|
|
1
|
+
import { ClassNamePropsWithChildren } from "../../helper/types";
|
|
2
|
+
import { SnackbarConfig } from "./Snackbar";
|
|
3
3
|
interface SnackbarProviderProps extends ClassNamePropsWithChildren {
|
|
4
4
|
config?: SnackbarConfig;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from
|
|
2
|
-
import classNames from
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
3
|
import Snackbar from "./Snackbar.js";
|
|
4
4
|
import SnackbarContext from "./SnackbarContext.js";
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -44,7 +44,7 @@ function SnackbarProvider(props) {
|
|
|
44
44
|
return /*#__PURE__*/_jsxs(SnackbarContext.Provider, {
|
|
45
45
|
value: contextValue,
|
|
46
46
|
children: [children, /*#__PURE__*/_jsx("div", {
|
|
47
|
-
className: classNames(
|
|
47
|
+
className: classNames("fwe-snackbar-container", className),
|
|
48
48
|
children: snacks.map(snack => /*#__PURE__*/_jsx(Snackbar, {
|
|
49
49
|
data: snack.data,
|
|
50
50
|
onAction: () => snack.onAction ? snack.onAction() : undefined,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { ComponentPropsWithoutRef } from
|
|
2
|
-
interface StepperHorizontalProps extends Omit<ComponentPropsWithoutRef<
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
interface StepperHorizontalProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
3
3
|
stepIndex?: number;
|
|
4
4
|
onChange?: (stepIndex: number) => void;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import cn from
|
|
2
|
-
import React, { forwardRef } from
|
|
1
|
+
import cn from "classnames";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
4
|
const StepperHorizontal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
5
5
|
let {
|
|
@@ -19,12 +19,12 @@ const StepperHorizontal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
const handleKeyDown = i => event => {
|
|
22
|
-
if (event.key ===
|
|
22
|
+
if (event.key === "Enter") {
|
|
23
23
|
handleStepClick(i);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
const handleKeyUp = i => event => {
|
|
27
|
-
if (event.key ===
|
|
27
|
+
if (event.key === " ") {
|
|
28
28
|
handleStepClick(i);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
@@ -37,9 +37,9 @@ const StepperHorizontal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
37
37
|
ref: ref,
|
|
38
38
|
onKeyDown: handleKeyDown(i),
|
|
39
39
|
onKeyUp: handleKeyUp(i),
|
|
40
|
-
className: cn(
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
className: cn("fwe-step-container", {
|
|
41
|
+
"fwe-step-done": stepIndex > i,
|
|
42
|
+
"fwe-step-active": i === stepIndex
|
|
43
43
|
}),
|
|
44
44
|
onClick: () => handleStepClick(i),
|
|
45
45
|
...props,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ComponentPropsWithoutRef } from
|
|
3
|
-
export interface StepHorizontalProps extends ComponentPropsWithoutRef<
|
|
1
|
+
import "./StepHorizontal.scss";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export interface StepHorizontalProps extends ComponentPropsWithoutRef<"div"> {
|
|
4
4
|
isActive?: boolean;
|
|
5
5
|
}
|
|
6
6
|
declare const StepHorizontal: (props: StepHorizontalProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import cn from
|
|
2
|
-
import { forwardRef } from
|
|
1
|
+
import cn from "classnames";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
const StepHorizontal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
5
5
|
let {
|
|
@@ -10,7 +10,7 @@ const StepHorizontal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
10
10
|
} = _ref;
|
|
11
11
|
return /*#__PURE__*/_jsx("div", {
|
|
12
12
|
ref: ref,
|
|
13
|
-
className: cn(
|
|
13
|
+
className: cn("overflow-hidden", {
|
|
14
14
|
hidden: !isActive
|
|
15
15
|
}),
|
|
16
16
|
...props,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { ComponentPropsWithoutRef } from
|
|
2
|
-
interface StepperVerticalProps extends Omit<ComponentPropsWithoutRef<
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
interface StepperVerticalProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
3
3
|
stepIndex?: number;
|
|
4
4
|
onChange?: (stepIndex: number) => void;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import cn from
|
|
2
|
-
import React, { forwardRef } from
|
|
1
|
+
import cn from "classnames";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
const StepperVertical = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
5
5
|
let {
|
|
@@ -29,7 +29,7 @@ const StepperVertical = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
29
29
|
});
|
|
30
30
|
return /*#__PURE__*/_jsx("div", {
|
|
31
31
|
ref: ref,
|
|
32
|
-
className: cn(
|
|
32
|
+
className: cn("fwe-stepper-vertical", className),
|
|
33
33
|
...props,
|
|
34
34
|
children: stepComponents
|
|
35
35
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ComponentPropsWithoutRef } from
|
|
3
|
-
interface StepVerticalProps extends ComponentPropsWithoutRef<
|
|
1
|
+
import "./StepVertical.scss";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
interface StepVerticalProps extends ComponentPropsWithoutRef<"div"> {
|
|
4
4
|
isActive?: boolean;
|
|
5
5
|
isLastElement?: boolean;
|
|
6
6
|
isDone?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import cn from
|
|
2
|
-
import { forwardRef, useEffect, useRef } from
|
|
1
|
+
import cn from "classnames";
|
|
2
|
+
import { forwardRef, useEffect, useRef } from "react";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
const StepVertical = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
5
5
|
let {
|
|
@@ -21,7 +21,7 @@ const StepVertical = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
21
21
|
const itemHeight = contentRef.current?.offsetHeight;
|
|
22
22
|
containerRef.current.style.height = `${itemHeight}px`;
|
|
23
23
|
} else {
|
|
24
|
-
containerRef.current.style.height =
|
|
24
|
+
containerRef.current.style.height = "20px";
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}, [isActive]);
|
|
@@ -31,21 +31,21 @@ const StepVertical = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
const handleKeyDown = event => {
|
|
34
|
-
if (event.key ===
|
|
34
|
+
if (event.key === "Enter") {
|
|
35
35
|
handleClick();
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
const handleKeyUp = event => {
|
|
39
|
-
if (event.key ===
|
|
39
|
+
if (event.key === " ") {
|
|
40
40
|
handleClick();
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
return /*#__PURE__*/_jsxs("div", {
|
|
44
44
|
ref: ref,
|
|
45
|
-
className: cn(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
className: cn("fwe-step-container", {
|
|
46
|
+
"fwe-last-element": isLastElement,
|
|
47
|
+
"fwe-step-active": isActive,
|
|
48
|
+
"fwe-step-done": isDone
|
|
49
49
|
}),
|
|
50
50
|
...props,
|
|
51
51
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { ComponentPropsWithoutRef } from
|
|
3
|
-
type TabItemAppearance =
|
|
4
|
-
export type TabViewType =
|
|
1
|
+
import "./Tabs.scss";
|
|
2
|
+
import React, { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
type TabItemAppearance = "fill" | "equal" | "default";
|
|
4
|
+
export type TabViewType = "legacy" | "responsive";
|
|
5
5
|
export interface TabsConfiguration {
|
|
6
6
|
tabBar?: {
|
|
7
7
|
fullWidth?: boolean;
|
|
@@ -10,7 +10,7 @@ export interface TabsConfiguration {
|
|
|
10
10
|
appearance: TabItemAppearance;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
interface TabsProps extends Omit<ComponentPropsWithoutRef<
|
|
13
|
+
interface TabsProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
14
14
|
config?: TabsConfiguration;
|
|
15
15
|
viewType?: TabViewType;
|
|
16
16
|
showDivider?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import classNames from
|
|
2
|
-
import React, { forwardRef, isValidElement, useEffect, useRef, useState } from
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import React, { forwardRef, isValidElement, useEffect, useRef, useState } from "react";
|
|
3
3
|
import useForkRef from "../../helper/useForkRef.js";
|
|
4
4
|
import useTabScroll from "./useTabScroll.js";
|
|
5
5
|
import IconWrapper from "../icon-wrapper/IconWrapper.js"; // legacy: recommended for desktop only applications
|
|
@@ -12,7 +12,7 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
12
12
|
children,
|
|
13
13
|
className,
|
|
14
14
|
onChange,
|
|
15
|
-
viewType =
|
|
15
|
+
viewType = "responsive",
|
|
16
16
|
showDivider = false,
|
|
17
17
|
...props
|
|
18
18
|
} = _ref;
|
|
@@ -23,10 +23,10 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
23
23
|
const scrollContent = useRef(null);
|
|
24
24
|
const scrollArea = useRef(null);
|
|
25
25
|
const observer = useRef(null);
|
|
26
|
-
let activeId =
|
|
26
|
+
let activeId = "";
|
|
27
27
|
React.Children.forEach(children, (element, i) => {
|
|
28
28
|
if (/*#__PURE__*/React.isValidElement(element)) {
|
|
29
|
-
if (activeId ===
|
|
29
|
+
if (activeId === "") {
|
|
30
30
|
activeId = `${componentId.current}-tab-panel-${i}`;
|
|
31
31
|
} else if (element.props.active) {
|
|
32
32
|
activeId = `${componentId.current}-tab-panel-${i}`;
|
|
@@ -101,16 +101,16 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
101
101
|
/*#__PURE__*/
|
|
102
102
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
103
103
|
_jsx(_Fragment, {
|
|
104
|
-
children: viewType ===
|
|
105
|
-
className: classNames(
|
|
104
|
+
children: viewType === "legacy" ? /*#__PURE__*/_jsxs("div", {
|
|
105
|
+
className: classNames("fwe-legacy-tabs", className),
|
|
106
106
|
children: [/*#__PURE__*/_jsx("ul", {
|
|
107
107
|
role: "tablist",
|
|
108
|
-
className: classNames(
|
|
109
|
-
|
|
108
|
+
className: classNames("fwe-legacy-tab-bar", {
|
|
109
|
+
"fwe-legacy-tab-bar-full-width": config?.tabBar?.fullWidth
|
|
110
110
|
}, {
|
|
111
|
-
|
|
111
|
+
"fwe-legacy-tab-items-equal-width": config?.tabItems?.appearance === "equal"
|
|
112
112
|
}, {
|
|
113
|
-
|
|
113
|
+
"fwe-legacy-tab-items-fill": config?.tabItems?.appearance === "fill"
|
|
114
114
|
}),
|
|
115
115
|
children: innerChildren && innerChildren.map((child, i) => {
|
|
116
116
|
const {
|
|
@@ -124,8 +124,8 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
124
124
|
/*#__PURE__*/
|
|
125
125
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
126
126
|
_jsx("li", {
|
|
127
|
-
className: classNames(
|
|
128
|
-
|
|
127
|
+
className: classNames("fwe-legacy-tab-item", {
|
|
128
|
+
"fwe-active": active
|
|
129
129
|
}),
|
|
130
130
|
onClick: () => showTabPane(id),
|
|
131
131
|
children: icon ?
|
|
@@ -133,8 +133,8 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
133
133
|
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
134
134
|
_jsxs("a", {
|
|
135
135
|
id: tabId,
|
|
136
|
-
className: classNames(
|
|
137
|
-
|
|
136
|
+
className: classNames("fwe-legacy-tab-link", {
|
|
137
|
+
"fwe-can-swap-icon": innerChildren.length === 2 && i === 1
|
|
138
138
|
}),
|
|
139
139
|
role: "tab",
|
|
140
140
|
"aria-controls": id,
|
|
@@ -168,15 +168,15 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
168
168
|
ref: combinedRef,
|
|
169
169
|
...props,
|
|
170
170
|
children: [/*#__PURE__*/_jsx("div", {
|
|
171
|
-
className: classNames(
|
|
171
|
+
className: classNames("fr-tab-scroller", classes),
|
|
172
172
|
children: /*#__PURE__*/_jsx("div", {
|
|
173
|
-
className: classNames(
|
|
174
|
-
|
|
173
|
+
className: classNames("fr-tab-scroller-scroll-area fr-tab-scroller-scroll-area--scroll", {
|
|
174
|
+
"fr-tab-scroller-scroll-area--compact": useCompactDensity
|
|
175
175
|
}),
|
|
176
176
|
ref: scrollArea,
|
|
177
177
|
children: /*#__PURE__*/_jsxs("div", {
|
|
178
|
-
className: classNames(
|
|
179
|
-
|
|
178
|
+
className: classNames("fr-tab-scroller-scroll-content", {
|
|
179
|
+
"fr-tab-scroller-scroll-content--with-divider": showDivider
|
|
180
180
|
}),
|
|
181
181
|
ref: scrollContent,
|
|
182
182
|
style: style,
|
|
@@ -190,8 +190,8 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
190
190
|
return /*#__PURE__*/_jsxs("button", {
|
|
191
191
|
type: "button",
|
|
192
192
|
role: "tab",
|
|
193
|
-
className: classNames(
|
|
194
|
-
|
|
193
|
+
className: classNames("fr-tab", {
|
|
194
|
+
"fr-tab--active": active
|
|
195
195
|
}),
|
|
196
196
|
id: tabId,
|
|
197
197
|
"aria-controls": id,
|
|
@@ -205,8 +205,8 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
205
205
|
children: name
|
|
206
206
|
})
|
|
207
207
|
}), /*#__PURE__*/_jsx("span", {
|
|
208
|
-
className: classNames(
|
|
209
|
-
|
|
208
|
+
className: classNames("fr-tab-indicator", {
|
|
209
|
+
"fr-tab-indicator--active": active
|
|
210
210
|
}),
|
|
211
211
|
children: /*#__PURE__*/_jsx("span", {
|
|
212
212
|
className: "fr-tab-indicator-content fr-tab-indicator-content--underline"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClassNamePropsWithChildren } from
|
|
2
|
-
import { Tab } from
|
|
3
|
-
import
|
|
1
|
+
import { ClassNamePropsWithChildren } from "../../../helper/types";
|
|
2
|
+
import { Tab } from "../interfaces";
|
|
3
|
+
import "./TabPane.scss";
|
|
4
4
|
export interface TabPaneProps extends ClassNamePropsWithChildren, Tab {
|
|
5
5
|
id?: string;
|
|
6
6
|
isVisible?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import classNames from
|
|
1
|
+
import classNames from "classnames";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
function TabPane(_ref) {
|
|
4
4
|
let {
|
|
@@ -9,9 +9,9 @@ function TabPane(_ref) {
|
|
|
9
9
|
id
|
|
10
10
|
} = _ref;
|
|
11
11
|
const tabPaneClasses = classNames({
|
|
12
|
-
|
|
12
|
+
"fr-show": isVisible
|
|
13
13
|
}, {
|
|
14
|
-
|
|
14
|
+
"fr-hide": !isVisible
|
|
15
15
|
}, className);
|
|
16
16
|
return /*#__PURE__*/_jsx("div", {
|
|
17
17
|
id: id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from
|
|
1
|
+
import { useState } from "react";
|
|
2
2
|
|
|
3
3
|
// provides details about the left and right edges of the tab element and the tab content element
|
|
4
4
|
// these values are used to determine the visual position of the tab with respect of its parent container
|
|
@@ -10,13 +10,13 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
10
10
|
scrollArea
|
|
11
11
|
} = refs;
|
|
12
12
|
const [style, setStyle] = useState({});
|
|
13
|
-
const [classes, setClasses] = useState(
|
|
13
|
+
const [classes, setClasses] = useState("");
|
|
14
14
|
function getScrollContentStyleValue(propName) {
|
|
15
|
-
return scrollContent.current ? window.getComputedStyle(scrollContent.current).getPropertyValue(propName) :
|
|
15
|
+
return scrollContent.current ? window.getComputedStyle(scrollContent.current).getPropertyValue(propName) : "";
|
|
16
16
|
}
|
|
17
17
|
function calculateCurrentTranslateX() {
|
|
18
|
-
const transformValue = getScrollContentStyleValue(
|
|
19
|
-
if (transformValue ===
|
|
18
|
+
const transformValue = getScrollContentStyleValue("transform");
|
|
19
|
+
if (transformValue === "none") {
|
|
20
20
|
return 0;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -29,7 +29,7 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
29
29
|
const matrixParams = match[1];
|
|
30
30
|
// we need value of tx -> translateX
|
|
31
31
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
-
const [a, b, c, d, tx, ty] = matrixParams.split(
|
|
32
|
+
const [a, b, c, d, tx, ty] = matrixParams.split(",");
|
|
33
33
|
return parseFloat(tx);
|
|
34
34
|
}
|
|
35
35
|
function getScrollPosition() {
|
|
@@ -66,9 +66,9 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
66
66
|
}
|
|
67
67
|
function stopScrollAnimation() {
|
|
68
68
|
const currentScrollPosition = getAnimatingScrollPosition();
|
|
69
|
-
setClasses(
|
|
69
|
+
setClasses("");
|
|
70
70
|
setStyle({
|
|
71
|
-
transform:
|
|
71
|
+
transform: "translateX(0px)"
|
|
72
72
|
});
|
|
73
73
|
if (scrollArea.current) {
|
|
74
74
|
scrollArea.current.scrollLeft = currentScrollPosition;
|
|
@@ -95,9 +95,9 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
95
95
|
scrollArea.current.getBoundingClientRect();
|
|
96
96
|
}
|
|
97
97
|
requestAnimationFrame(() => {
|
|
98
|
-
setClasses(
|
|
98
|
+
setClasses("fr-tab-scroller--animating");
|
|
99
99
|
setStyle({
|
|
100
|
-
transform:
|
|
100
|
+
transform: "none"
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
103
|
}
|
|
@@ -112,7 +112,7 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
112
112
|
function computeDimensions(tab) {
|
|
113
113
|
const rootWidth = tab.offsetWidth;
|
|
114
114
|
const rootLeft = tab.offsetLeft;
|
|
115
|
-
const tabContent = tab.querySelector(
|
|
115
|
+
const tabContent = tab.querySelector(".fr-tab-content");
|
|
116
116
|
const contentWidth = tabContent?.offsetWidth ?? 0;
|
|
117
117
|
const contentLeft = tabContent?.offsetLeft ?? 0;
|
|
118
118
|
return {
|