@festo-ui/react 9.0.1-dev.783 → 9.0.1-dev.784
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/Accordion.css +4 -0
- package/dist/components/accordion/Accordion.d.ts +10 -0
- package/dist/components/accordion/Accordion.js +41 -0
- package/dist/components/accordion/AccordionContext.d.ts +11 -0
- package/dist/components/accordion/AccordionContext.js +3 -0
- package/dist/components/accordion/accordion-header/AccordionHeader.css +11 -0
- package/dist/components/accordion/accordion-header/AccordionHeader.d.ts +2 -0
- package/dist/components/accordion/accordion-header/AccordionHeader.js +11 -0
- package/dist/components/accordion/accordion-item/AccordionItem.css +64 -0
- package/dist/components/accordion/accordion-item/AccordionItem.d.ts +8 -0
- package/dist/components/accordion/accordion-item/AccordionItem.js +60 -0
- package/dist/components/accordion/accordion-item/AccordionItemContext.d.ts +7 -0
- package/dist/components/accordion/accordion-item/AccordionItemContext.js +3 -0
- package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.css +76 -0
- package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +2 -0
- package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +61 -0
- package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.css +11 -0
- package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +2 -0
- package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +20 -0
- package/dist/components/bottom-sheet/BottomSheet.css +18 -0
- package/dist/components/bottom-sheet/BottomSheet.d.ts +11 -0
- package/dist/components/bottom-sheet/BottomSheet.js +101 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +14 -0
- package/dist/components/breadcrumb/Breadcrumb.js +87 -0
- package/dist/components/button/Button.d.ts +11 -0
- package/dist/components/button/Button.js +36 -0
- package/dist/components/card/Card.d.ts +5 -0
- package/dist/components/card/Card.js +9 -0
- package/dist/components/card/CardBody.d.ts +5 -0
- package/dist/components/card/CardBody.js +15 -0
- package/dist/components/card/CardHeader.d.ts +8 -0
- package/dist/components/card/CardHeader.js +31 -0
- package/dist/components/card/CardHeader.stories.helper.js +7 -0
- package/dist/components/card/CardNotification.d.ts +6 -0
- package/dist/components/card/CardNotification.js +26 -0
- package/dist/components/chips/chip/Chip.d.ts +17 -0
- package/dist/components/chips/chip/Chip.js +38 -0
- package/dist/components/chips/chip-container/ChipContainer.d.ts +5 -0
- package/dist/components/chips/chip-container/ChipContainer.js +12 -0
- package/dist/components/icon-wrapper/IconWrapper.d.ts +7 -0
- package/dist/components/icon-wrapper/IconWrapper.js +13 -0
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +5 -0
- package/dist/components/loading-indicator/LoadingIndicator.js +41 -0
- package/dist/components/mobile-flyout/MobileFlyout.d.ts +11 -0
- package/dist/components/mobile-flyout/MobileFlyout.js +88 -0
- package/dist/components/mobile-flyout/MobileFlyoutContext.d.ts +8 -0
- package/dist/components/mobile-flyout/MobileFlyoutContext.js +3 -0
- package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +17 -0
- package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +36 -0
- package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.css +5 -0
- package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.d.ts +8 -0
- package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +35 -0
- package/dist/components/modals/AlertModal.d.ts +12 -0
- package/dist/components/modals/AlertModal.js +53 -0
- package/dist/components/modals/ConfirmModal.d.ts +11 -0
- package/dist/components/modals/ConfirmModal.js +46 -0
- package/dist/components/modals/CustomModal.d.ts +8 -0
- package/dist/components/modals/CustomModal.js +38 -0
- package/dist/components/modals/Modal.css +39 -0
- package/dist/components/modals/Modal.d.ts +8 -0
- package/dist/components/modals/Modal.js +31 -0
- package/dist/components/modals/ModalBase.d.ts +9 -0
- package/dist/components/modals/ModalBase.js +124 -0
- package/dist/components/modals/ModalFooter.d.ts +2 -0
- package/dist/components/modals/ModalFooter.js +12 -0
- package/dist/components/modals/Prompt.d.ts +16 -0
- package/dist/components/modals/Prompt.js +58 -0
- package/dist/components/modals/image-gallery/ImageGallery.css +833 -0
- package/dist/components/modals/image-gallery/ImageGallery.d.ts +21 -0
- package/dist/components/modals/image-gallery/ImageGallery.helper.d.ts +2 -0
- package/dist/components/modals/image-gallery/ImageGallery.helper.js +13 -0
- package/dist/components/modals/image-gallery/ImageGallery.js +103 -0
- package/dist/components/modals/image-gallery/ImageGallery.stories.helper.js +112 -0
- package/dist/components/modals/image-gallery/ImageGalleryContent.d.ts +8 -0
- package/dist/components/modals/image-gallery/ImageGalleryContent.js +15 -0
- package/dist/components/modals/image-gallery/ImageGalleryScale.d.ts +6 -0
- package/dist/components/modals/image-gallery/ImageGalleryScale.js +15 -0
- package/dist/components/modals/image-gallery/ImageGallerySwiper.d.ts +12 -0
- package/dist/components/modals/image-gallery/ImageGallerySwiper.js +40 -0
- package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.d.ts +7 -0
- package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.js +27 -0
- package/dist/components/modals/image-gallery/internal/CloseButton.d.ts +6 -0
- package/dist/components/modals/image-gallery/internal/CloseButton.js +14 -0
- package/dist/components/modals/image-gallery/internal/ImageGalleryContainer.d.ts +5 -0
- package/dist/components/modals/image-gallery/internal/ImageGalleryContainer.js +8 -0
- package/dist/components/modals/image-gallery/internal/ImageGalleryPagination.d.ts +5 -0
- package/dist/components/modals/image-gallery/internal/ImageGalleryPagination.js +29 -0
- package/dist/components/pagination/Pagination.css +10 -0
- package/dist/components/pagination/Pagination.d.ts +15 -0
- package/dist/components/pagination/Pagination.js +100 -0
- package/dist/components/popovers/legend/Legend.d.ts +10 -0
- package/dist/components/popovers/legend/Legend.js +22 -0
- package/dist/components/popovers/popover/Popover.css +8 -0
- package/dist/components/popovers/popover/Popover.d.ts +19 -0
- package/dist/components/popovers/popover/Popover.js +82 -0
- package/dist/components/popovers/popover-menu/PopoverMenu.d.ts +7 -0
- package/dist/components/popovers/popover-menu/PopoverMenu.js +31 -0
- package/dist/components/popovers/popover-menu/PopoverMenuContext.d.ts +4 -0
- package/dist/components/popovers/popover-menu/PopoverMenuContext.js +5 -0
- package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.d.ts +7 -0
- package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.js +27 -0
- package/dist/components/popovers/tooltip/Tooltip.d.ts +5 -0
- package/dist/components/popovers/tooltip/Tooltip.js +12 -0
- package/dist/components/progress/Progress.d.ts +7 -0
- package/dist/components/progress/Progress.js +26 -0
- package/dist/components/search-input/ClearButton.d.ts +2 -0
- package/dist/components/search-input/ClearButton.js +10 -0
- package/dist/components/search-input/SearchInput.css +13 -0
- package/dist/components/search-input/SearchInput.d.ts +14 -0
- package/dist/components/search-input/SearchInput.js +61 -0
- package/dist/components/search-input/SearchSuggestion.d.ts +17 -0
- package/dist/components/search-input/SearchSuggestion.js +21 -0
- package/dist/components/search-input/useSearchInput.d.ts +13 -0
- package/dist/components/search-input/useSearchInput.js +85 -0
- package/dist/components/snackbar/Snackbar.css +55 -0
- package/dist/components/snackbar/Snackbar.d.ts +21 -0
- package/dist/components/snackbar/Snackbar.js +78 -0
- package/dist/components/snackbar/SnackbarContext.d.ts +7 -0
- package/dist/components/snackbar/SnackbarContext.js +3 -0
- package/dist/components/snackbar/SnackbarProvider.d.ts +7 -0
- package/dist/components/snackbar/SnackbarProvider.js +66 -0
- package/dist/components/snackbar/useSnackbar.d.ts +2 -0
- package/dist/components/snackbar/useSnackbar.js +4 -0
- package/dist/components/stepper-horizontal/StepperHorizontal.css +6 -0
- package/dist/components/stepper-horizontal/StepperHorizontal.d.ts +7 -0
- package/dist/components/stepper-horizontal/StepperHorizontal.js +48 -0
- package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.css +24 -0
- package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +6 -0
- package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.js +16 -0
- package/dist/components/stepper-vertical/StepperVertical.d.ts +6 -0
- package/dist/components/stepper-vertical/StepperVertical.js +25 -0
- package/dist/components/stepper-vertical/step-vertical/StepVertical.css +10 -0
- package/dist/components/stepper-vertical/step-vertical/StepVertical.d.ts +11 -0
- package/dist/components/stepper-vertical/step-vertical/StepVertical.js +58 -0
- package/dist/components/tab/Tabs.css +285 -0
- package/dist/components/tab/Tabs.d.ts +22 -0
- package/dist/components/tab/Tabs.js +193 -0
- package/dist/components/tab/interfaces.d.ts +5 -0
- package/dist/components/tab/interfaces.js +0 -0
- package/dist/components/tab/tab-pane/TabPane.css +8 -0
- package/dist/components/tab/tab-pane/TabPane.d.ts +9 -0
- package/dist/components/tab/tab-pane/TabPane.js +18 -0
- package/dist/components/tab/useTabScroll.d.ts +25 -0
- package/dist/components/tab/useTabScroll.js +151 -0
- package/dist/components/table-header-cell/TableHeaderCell.d.ts +5 -0
- package/dist/components/table-header-cell/TableHeaderCell.js +21 -0
- package/dist/forms/checkbox/Checkbox.css +134 -0
- package/dist/forms/checkbox/Checkbox.d.ts +15 -0
- package/dist/forms/checkbox/Checkbox.js +80 -0
- package/dist/forms/combobox/ComboBox.css +124 -0
- package/dist/forms/combobox/ComboBox.d.ts +28 -0
- package/dist/forms/combobox/ComboBox.js +175 -0
- package/dist/forms/multi-select/MultiSelect.d.ts +20 -0
- package/dist/forms/multi-select/MultiSelect.js +191 -0
- package/dist/forms/multi-select/MultiSelect.module.js +8 -0
- package/dist/forms/multi-select/MultiSelect_module.css +13 -0
- package/dist/forms/radio/RadioButton.d.ts +14 -0
- package/dist/forms/radio/RadioButton.js +61 -0
- package/dist/forms/radio/RadioGroup.d.ts +12 -0
- package/dist/forms/radio/RadioGroup.js +50 -0
- package/dist/forms/radio/RadioGroupContext.d.ts +12 -0
- package/dist/forms/radio/RadioGroupContext.js +3 -0
- package/dist/forms/segment/Segment.d.ts +13 -0
- package/dist/forms/segment/Segment.js +58 -0
- package/dist/forms/segment/segment-control/SegmentControl.d.ts +14 -0
- package/dist/forms/segment/segment-control/SegmentControl.js +57 -0
- package/dist/forms/select/Select.d.ts +25 -0
- package/dist/forms/select/Select.js +92 -0
- package/dist/forms/select/internal/SelectButton.d.ts +0 -0
- package/dist/forms/select/internal/SelectButton.js +0 -0
- package/dist/forms/select/internal/SelectButtonContent.d.ts +0 -0
- package/dist/forms/select/internal/SelectButtonContent.js +0 -0
- package/dist/forms/select/internal/SelectOptionsContainer.d.ts +0 -0
- package/dist/forms/select/internal/SelectOptionsContainer.js +0 -0
- package/dist/forms/slider/Slider.css +50 -0
- package/dist/forms/slider/Slider.d.ts +17 -0
- package/dist/forms/slider/Slider.js +93 -0
- package/dist/forms/switch/Switch.d.ts +12 -0
- package/dist/forms/switch/Switch.js +42 -0
- package/dist/forms/text-area/TextArea.css +14 -0
- package/dist/forms/text-area/TextArea.d.ts +22 -0
- package/dist/forms/text-area/TextArea.js +99 -0
- package/dist/forms/text-input/TextInput.d.ts +24 -0
- package/dist/forms/text-input/TextInput.js +74 -0
- package/dist/forms/time-picker/TimePicker.css +10 -0
- package/dist/forms/time-picker/TimePicker.d.ts +24 -0
- package/dist/forms/time-picker/TimePicker.js +123 -0
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.css +4 -0
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.d.ts +19 -0
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +208 -0
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.d.ts +9 -0
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.js +14 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +60 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/setRef.d.ts +1 -0
- package/dist/utils/setRef.js +5 -0
- package/dist/utils/types.d.ts +36 -0
- package/dist/utils/types.js +0 -0
- package/dist/utils/useControlled.d.ts +7 -0
- package/dist/utils/useControlled.js +20 -0
- package/dist/utils/useForkRef.d.ts +2 -0
- package/dist/utils/useForkRef.js +15 -0
- package/dist/utils/useId.d.ts +1 -0
- package/dist/utils/useId.js +20 -0
- package/dist/utils/useOnClickOutside.d.ts +2 -0
- package/dist/utils/useOnClickOutside.js +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ClassNamePropsWithChildren } from '../../utils/types';
|
|
2
|
+
import { type SnackbarConfig, type SnackbarData } from './Snackbar';
|
|
3
|
+
export interface SnackbarProviderProps extends ClassNamePropsWithChildren {
|
|
4
|
+
readonly config?: SnackbarConfig;
|
|
5
|
+
}
|
|
6
|
+
export declare function SnackbarProvider(props: SnackbarProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const addSnackbar: (snackData: SnackbarData, onAction?: () => void, onClose?: () => void) => string | number;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import { useCallback, useMemo, useState } from "react";
|
|
4
|
+
import { Snackbar } from "./Snackbar.js";
|
|
5
|
+
import { SnackbarContext } from "./SnackbarContext.js";
|
|
6
|
+
let addSnackbarFunction;
|
|
7
|
+
function SnackbarProvider(props) {
|
|
8
|
+
const { config = {
|
|
9
|
+
darkBackground: true
|
|
10
|
+
}, children, className } = props;
|
|
11
|
+
const [snacks, setSnacks] = useState([]);
|
|
12
|
+
const addSnackbar = useCallback((snackData, onAction, onClose)=>{
|
|
13
|
+
const key = snackData.key ?? Date.now() + Math.random();
|
|
14
|
+
setSnacks((prevSnacks)=>[
|
|
15
|
+
{
|
|
16
|
+
data: {
|
|
17
|
+
...config,
|
|
18
|
+
...snackData
|
|
19
|
+
},
|
|
20
|
+
onAction,
|
|
21
|
+
onClose,
|
|
22
|
+
key,
|
|
23
|
+
first: 0 === prevSnacks.length
|
|
24
|
+
},
|
|
25
|
+
...prevSnacks
|
|
26
|
+
]);
|
|
27
|
+
return key;
|
|
28
|
+
}, [
|
|
29
|
+
config
|
|
30
|
+
]);
|
|
31
|
+
addSnackbarFunction = addSnackbar;
|
|
32
|
+
const closeSnackbar = useCallback((key)=>{
|
|
33
|
+
if (void 0 !== key) setSnacks((prevSnacks)=>prevSnacks.filter((snack)=>snack.key !== key));
|
|
34
|
+
}, []);
|
|
35
|
+
function handleClose(snack) {
|
|
36
|
+
closeSnackbar(snack.key);
|
|
37
|
+
if (snack.onClose) snack.onClose();
|
|
38
|
+
}
|
|
39
|
+
const contextValue = useMemo(()=>({
|
|
40
|
+
addSnackbar,
|
|
41
|
+
closeSnackbar
|
|
42
|
+
}), [
|
|
43
|
+
addSnackbar,
|
|
44
|
+
closeSnackbar
|
|
45
|
+
]);
|
|
46
|
+
return /*#__PURE__*/ jsxs(SnackbarContext.Provider, {
|
|
47
|
+
value: contextValue,
|
|
48
|
+
children: [
|
|
49
|
+
children,
|
|
50
|
+
/*#__PURE__*/ jsx("div", {
|
|
51
|
+
className: classnames('fwe-snackbar-container', className),
|
|
52
|
+
children: snacks.map((snack)=>/*#__PURE__*/ jsx(Snackbar, {
|
|
53
|
+
data: snack.data,
|
|
54
|
+
onAction: ()=>snack.onAction ? snack.onAction() : void 0,
|
|
55
|
+
onClose: ()=>handleClose(snack),
|
|
56
|
+
first: snack.first
|
|
57
|
+
}, snack.key))
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const SnackbarProvider_addSnackbar = (snackData, onAction, onClose)=>{
|
|
63
|
+
if (!addSnackbarFunction) throw new Error('SnackbarProvider is not mounted.');
|
|
64
|
+
return addSnackbarFunction(snackData, onAction, onClose);
|
|
65
|
+
};
|
|
66
|
+
export { SnackbarProvider, SnackbarProvider_addSnackbar as addSnackbar };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './StepperHorizontal.scss';
|
|
2
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export interface StepperHorizontalProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onChange'> {
|
|
4
|
+
stepIndex?: number;
|
|
5
|
+
onChange?: (stepIndex: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StepperHorizontal: (props: StepperHorizontalProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "./StepperHorizontal.css";
|
|
3
|
+
import classnames from "classnames";
|
|
4
|
+
import react, { forwardRef } from "react";
|
|
5
|
+
const StepperHorizontal = /*#__PURE__*/ forwardRef(({ children, className, stepIndex = 0, onChange, ...props }, ref)=>{
|
|
6
|
+
const stepComponents = react.Children.map(children, (child, i)=>/*#__PURE__*/ react.isValidElement(child) ? /*#__PURE__*/ react.cloneElement(child, {
|
|
7
|
+
...child.props,
|
|
8
|
+
isActive: i === stepIndex
|
|
9
|
+
}) : null);
|
|
10
|
+
function handleStepClick(index) {
|
|
11
|
+
if (stepIndex > index && onChange) onChange(index);
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ jsx("div", {
|
|
16
|
+
className: classnames('fwe-stepper-horizontal', className),
|
|
17
|
+
children: stepComponents?.map((step, i)=>/*#__PURE__*/ jsx("button", {
|
|
18
|
+
type: "button",
|
|
19
|
+
ref: ref,
|
|
20
|
+
className: classnames('fwe-step-container fr-step-container', {
|
|
21
|
+
'fwe-step-done': stepIndex > i,
|
|
22
|
+
'fwe-step-active': i === stepIndex
|
|
23
|
+
}),
|
|
24
|
+
onClick: ()=>handleStepClick(i),
|
|
25
|
+
disabled: stepIndex <= i,
|
|
26
|
+
"aria-label": `Step ${i + 1}: ${step.props.title}`,
|
|
27
|
+
"aria-current": i === stepIndex ? 'step' : void 0,
|
|
28
|
+
...props,
|
|
29
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
30
|
+
className: "fwe-step",
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ jsx("div", {
|
|
33
|
+
className: "fwe-step-no",
|
|
34
|
+
children: i + 1
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ jsx("div", {
|
|
37
|
+
className: "fwe-step-name",
|
|
38
|
+
children: step.props.title
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
}, step.props.title))
|
|
43
|
+
}),
|
|
44
|
+
stepComponents
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
export { StepperHorizontal };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.overflow-hidden {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@keyframes stepperAnimation {
|
|
6
|
+
from {
|
|
7
|
+
transform: translateX(100%);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
to {
|
|
11
|
+
transform: translateX(0%);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.fr-moving-container {
|
|
16
|
+
animation-name: stepperAnimation;
|
|
17
|
+
animation-duration: .3s;
|
|
18
|
+
animation-timing-function: ease;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.hidden {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './StepHorizontal.scss';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export interface StepHorizontalProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
readonly isActive?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const StepHorizontal: (props: StepHorizontalProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./StepHorizontal.css";
|
|
3
|
+
import classnames from "classnames";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
const StepHorizontal = /*#__PURE__*/ forwardRef(({ children, className, isActive, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
6
|
+
ref: ref,
|
|
7
|
+
className: classnames('overflow-hidden', {
|
|
8
|
+
hidden: !isActive
|
|
9
|
+
}),
|
|
10
|
+
...props,
|
|
11
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
12
|
+
className: "fr-moving-container",
|
|
13
|
+
children: children
|
|
14
|
+
})
|
|
15
|
+
}));
|
|
16
|
+
export { StepHorizontal };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface StepperVerticalProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
3
|
+
readonly stepIndex?: number;
|
|
4
|
+
readonly onChange?: (stepIndex: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const StepperVertical: (props: StepperVerticalProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import react, { forwardRef } from "react";
|
|
4
|
+
const StepperVertical = /*#__PURE__*/ forwardRef(({ children, className, stepIndex = 0, onChange, ...props }, ref)=>{
|
|
5
|
+
function handleStepClick(index) {
|
|
6
|
+
if (stepIndex > index && onChange) onChange(index);
|
|
7
|
+
}
|
|
8
|
+
const stepComponents = react.Children.map(children, (child, i)=>{
|
|
9
|
+
if (/*#__PURE__*/ react.isValidElement(child)) return /*#__PURE__*/ react.cloneElement(child, {
|
|
10
|
+
isActive: i === stepIndex,
|
|
11
|
+
index: i,
|
|
12
|
+
isDone: i < stepIndex,
|
|
13
|
+
isLastElement: i === react.Children.count(children) - 1,
|
|
14
|
+
onStepClick: ()=>handleStepClick(i)
|
|
15
|
+
});
|
|
16
|
+
return null;
|
|
17
|
+
});
|
|
18
|
+
return /*#__PURE__*/ jsx("div", {
|
|
19
|
+
ref: ref,
|
|
20
|
+
className: classnames('fwe-stepper-vertical', className),
|
|
21
|
+
...props,
|
|
22
|
+
children: stepComponents
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export { StepperVertical };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './StepVertical.scss';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export interface StepVerticalProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
readonly isActive?: boolean;
|
|
5
|
+
readonly isLastElement?: boolean;
|
|
6
|
+
readonly isDone?: boolean;
|
|
7
|
+
readonly index?: number;
|
|
8
|
+
readonly title?: string;
|
|
9
|
+
readonly onStepClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const StepVertical: (props: StepVerticalProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "./StepVertical.css";
|
|
3
|
+
import classnames from "classnames";
|
|
4
|
+
import { forwardRef, useEffect, useRef } from "react";
|
|
5
|
+
const StepVertical = /*#__PURE__*/ forwardRef(({ children, className, isActive, isLastElement, isDone, index, title, onStepClick, ...props }, ref)=>{
|
|
6
|
+
const containerRef = useRef(null);
|
|
7
|
+
const contentRef = useRef(null);
|
|
8
|
+
useEffect(()=>{
|
|
9
|
+
if (containerRef.current) if (isActive) {
|
|
10
|
+
const itemHeight = contentRef.current?.offsetHeight;
|
|
11
|
+
containerRef.current.style.height = `${itemHeight}px`;
|
|
12
|
+
} else containerRef.current.style.height = '20px';
|
|
13
|
+
}, [
|
|
14
|
+
isActive
|
|
15
|
+
]);
|
|
16
|
+
function handleClick() {
|
|
17
|
+
if (onStepClick) onStepClick();
|
|
18
|
+
}
|
|
19
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
20
|
+
ref: ref,
|
|
21
|
+
className: classnames('fwe-step-container', {
|
|
22
|
+
'fwe-last-element': isLastElement,
|
|
23
|
+
'fwe-step-active': isActive,
|
|
24
|
+
'fwe-step-done': isDone
|
|
25
|
+
}),
|
|
26
|
+
...props,
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ jsxs("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
className: "fwe-step fr-stepper-vertical-step",
|
|
31
|
+
onClick: handleClick,
|
|
32
|
+
"aria-label": `Step ${(index ?? 0) + 1}: ${title}`,
|
|
33
|
+
"aria-current": isActive ? 'step' : void 0,
|
|
34
|
+
disabled: !isDone && !isActive,
|
|
35
|
+
children: [
|
|
36
|
+
void 0 !== index && /*#__PURE__*/ jsx("div", {
|
|
37
|
+
className: "fwe-step-no",
|
|
38
|
+
children: index + 1
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ jsx("div", {
|
|
41
|
+
className: "fwe-step-name",
|
|
42
|
+
children: title
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ jsx("div", {
|
|
47
|
+
ref: containerRef,
|
|
48
|
+
className: "fwe-step-content-container",
|
|
49
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
50
|
+
ref: contentRef,
|
|
51
|
+
className: "fwe-step-content",
|
|
52
|
+
children: children
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
export { StepVertical };
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
.fwe-legacy-tabs {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
margin: 48px 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.fwe-legacy-tab-bar {
|
|
8
|
+
width: 75%;
|
|
9
|
+
font-size: var(--fwe-font-size-base);
|
|
10
|
+
flex-wrap: nowrap;
|
|
11
|
+
margin-top: 0;
|
|
12
|
+
margin-bottom: 0;
|
|
13
|
+
padding-left: 0;
|
|
14
|
+
list-style: none;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.fwe-legacy-tab-bar.fwe-legacy-tab-bar-full-width {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.fwe-legacy-tab-bar.fwe-legacy-tab-items-fill .fwe-legacy-tab-item {
|
|
23
|
+
flex: auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.fwe-legacy-tab-bar.fwe-legacy-tab-items-equal-width .fwe-legacy-tab-item {
|
|
27
|
+
flex: 1 1 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.fwe-legacy-tab-item {
|
|
31
|
+
background-color: var(--fwe-gray-300);
|
|
32
|
+
border-right: 2px solid var(--fwe-gray-100);
|
|
33
|
+
text-align: center;
|
|
34
|
+
height: 48px;
|
|
35
|
+
max-height: 48px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.fwe-legacy-tab-item:last-child {
|
|
39
|
+
border-right: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.fwe-legacy-tab-item.fwe-active {
|
|
43
|
+
background-color: var(--fwe-white);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.fwe-legacy-tab-item.fwe-active .fwe-legacy-tab-link {
|
|
47
|
+
color: var(--fwe-caerul);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.fwe-legacy-tab-item:not(.fwe-active) {
|
|
51
|
+
border-bottom: 2px solid var(--fwe-gray-100);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.fwe-legacy-tab-item:not(.fwe-active) .fwe-legacy-tab-link {
|
|
55
|
+
padding: 11px 16px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.fwe-legacy-tab-link {
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 48px;
|
|
62
|
+
color: var(--fwe-black);
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
background: none;
|
|
65
|
+
border: none;
|
|
66
|
+
padding: 11px 16px 13px;
|
|
67
|
+
line-height: 24px;
|
|
68
|
+
display: inline-block;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.fwe-legacy-tab-link .fwe-svg-icon {
|
|
72
|
+
margin-right: 8px;
|
|
73
|
+
line-height: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.fwe-legacy-tab-link i.fwe-icon {
|
|
77
|
+
vertical-align: initial;
|
|
78
|
+
padding-right: 8px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.fwe-legacy-tab-link i.fwe-icon.fwe-icon-lg {
|
|
82
|
+
position: relative;
|
|
83
|
+
top: 3px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.fwe-legacy-tab-link:hover {
|
|
87
|
+
color: var(--fwe-caerul);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.fwe-legacy-tab-link:active {
|
|
91
|
+
background-color: var(--fwe-white);
|
|
92
|
+
color: var(--fwe-caerul);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.fwe-legacy-tab-panel-content {
|
|
96
|
+
background-color: var(--fwe-white);
|
|
97
|
+
height: 100%;
|
|
98
|
+
padding: 48px 24px;
|
|
99
|
+
overflow: auto;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (width <= 375px) {
|
|
103
|
+
.fwe-legacy-tab-bar {
|
|
104
|
+
background-color: var(--fwe-white);
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
width: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.fwe-legacy-tab-item {
|
|
110
|
+
background-color: var(--fwe-white);
|
|
111
|
+
border-right: 2px solid var(--fwe-white);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.fwe-legacy-tab-item:not(.fwe-active) {
|
|
115
|
+
border-bottom: 2px solid var(--fwe-white);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.fwe-legacy-tab-item:not(.fwe-active) .fwe-legacy-tab-link, .fwe-legacy-tab-item:not(.fwe-active) .fwe-legacy-tab-link i.fwe-icon {
|
|
119
|
+
color: var(--fwe-hero-gray);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.fwe-legacy-tab-link.fwe-can-swap-icon {
|
|
123
|
+
direction: rtl;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.fwe-legacy-tab-link.fwe-can-swap-icon i.fwe-icon {
|
|
127
|
+
padding-left: 8px;
|
|
128
|
+
padding-right: 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.fr-tab-panel-content {
|
|
133
|
+
background-color: var(--fwe-white);
|
|
134
|
+
height: 100%;
|
|
135
|
+
padding: 48px 24px;
|
|
136
|
+
overflow: auto;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.fr-tab-bar {
|
|
140
|
+
width: 100%;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.fr-tab-scroller {
|
|
144
|
+
overflow-y: hidden;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.fr-tab-scroller-scroll-area {
|
|
148
|
+
display: flex;
|
|
149
|
+
position: relative;
|
|
150
|
+
overflow-x: hidden;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.fr-tab-scroller-scroll-area::-webkit-scrollbar {
|
|
154
|
+
display: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.fr-tab-scroller-scroll-area--scroll {
|
|
158
|
+
overflow-x: scroll;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.fr-tab-scroller-scroll-content {
|
|
162
|
+
will-change: transform;
|
|
163
|
+
flex: 1 0 auto;
|
|
164
|
+
padding: 0 17px 0 16px;
|
|
165
|
+
display: flex;
|
|
166
|
+
position: relative;
|
|
167
|
+
transform: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.fr-tab-scroller-scroll-content--with-divider .fr-tab-scroller-divider-line {
|
|
171
|
+
display: block;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.fr-tab-scroller--animating .fr-tab-scroller-scroll-content {
|
|
175
|
+
transition: transform .25s cubic-bezier(.4, 0, .2, 1);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.fr-tab-scroller-divider-line {
|
|
179
|
+
border-bottom: 1px solid var(--fwe-control);
|
|
180
|
+
display: none;
|
|
181
|
+
position: absolute;
|
|
182
|
+
inset: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.fr-tab-indicator {
|
|
186
|
+
pointer-events: none;
|
|
187
|
+
z-index: 1;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
width: 100%;
|
|
190
|
+
height: 100%;
|
|
191
|
+
display: flex;
|
|
192
|
+
position: absolute;
|
|
193
|
+
top: 0;
|
|
194
|
+
left: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.fr-tab-indicator-content {
|
|
198
|
+
transform-origin: 0;
|
|
199
|
+
opacity: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.fr-tab-indicator-content--underline {
|
|
203
|
+
box-sizing: border-box;
|
|
204
|
+
border-top-style: solid;
|
|
205
|
+
align-self: flex-end;
|
|
206
|
+
width: 100%;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.fr-tab-indicator .fr-tab-indicator-content {
|
|
210
|
+
transition: transform .25s cubic-bezier(.4, 0, .2, 1);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.fr-tab-indicator .fr-tab-indicator-content--underline {
|
|
214
|
+
border-top: 4px solid var(--fwe-caerul);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.fr-tab-indicator--active .fr-tab-indicator-content {
|
|
218
|
+
opacity: 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.fr-tab {
|
|
222
|
+
text-align: center;
|
|
223
|
+
white-space: nowrap;
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
-webkit-appearance: none;
|
|
226
|
+
z-index: 1;
|
|
227
|
+
background: none;
|
|
228
|
+
border: none;
|
|
229
|
+
outline: none;
|
|
230
|
+
flex: 1 0 auto;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
height: 36px;
|
|
233
|
+
margin: 0;
|
|
234
|
+
padding: 0;
|
|
235
|
+
display: flex;
|
|
236
|
+
position: relative;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.fr-tab:not(:last-child) {
|
|
240
|
+
margin-right: 32px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.fr-tab::-moz-focus-inner {
|
|
244
|
+
border: 0;
|
|
245
|
+
padding: 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.fr-tab .fr-tab-text-label {
|
|
249
|
+
color: var(--fwe-text);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.fr-tab--active .fr-tab-text-label {
|
|
253
|
+
color: var(--fwe-caerul);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.fr-tab-content {
|
|
257
|
+
height: inherit;
|
|
258
|
+
pointer-events: none;
|
|
259
|
+
justify-content: center;
|
|
260
|
+
align-items: flex-start;
|
|
261
|
+
display: flex;
|
|
262
|
+
position: relative;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.fr-tab-text-label {
|
|
266
|
+
z-index: 2;
|
|
267
|
+
display: inline-block;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.fr-tab-scroller-scroll-area:not(.fr-tab-scroller-scroll-area--compact) .fr-tab {
|
|
271
|
+
flex: none;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.fr-tab-scroller-scroll-area:not(.fr-tab-scroller-scroll-area--compact) .fr-tab:not(:last-child) {
|
|
275
|
+
margin-right: 64px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.fr-tab-scroller-scroll-area:not(.fr-tab-scroller-scroll-area--compact) .fr-tab-scroller-scroll-content {
|
|
279
|
+
padding: 0 32px;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.fr-tab-scroller-scroll-area:not(.fr-tab-scroller-scroll-area--compact) .fr-tab-scroller-divider-line {
|
|
283
|
+
padding-right: 64px;
|
|
284
|
+
}
|
|
285
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './Tabs.scss';
|
|
2
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export type TabItemAppearance = 'fill' | 'equal' | 'default';
|
|
4
|
+
export type TabViewType = 'legacy' | 'responsive';
|
|
5
|
+
export interface TabsConfiguration {
|
|
6
|
+
readonly tabBar?: {
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
};
|
|
9
|
+
readonly tabItems?: {
|
|
10
|
+
appearance: TabItemAppearance;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface TabsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
14
|
+
readonly config?: TabsConfiguration;
|
|
15
|
+
readonly viewType?: TabViewType;
|
|
16
|
+
readonly showDivider?: boolean;
|
|
17
|
+
readonly onChange?: (value: {
|
|
18
|
+
previous: string;
|
|
19
|
+
current: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const Tabs: (props: TabsProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|