@festo-ui/react 9.0.0-dev.715 → 9.0.0-dev.716
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/package.json +1 -1
- package/dist/components/accordion/Accordion.css +0 -4
- package/dist/components/accordion/Accordion.d.ts +0 -10
- package/dist/components/accordion/Accordion.js +0 -41
- package/dist/components/accordion/AccordionContext.d.ts +0 -11
- package/dist/components/accordion/AccordionContext.js +0 -3
- package/dist/components/accordion/accordion-header/AccordionHeader.css +0 -11
- package/dist/components/accordion/accordion-header/AccordionHeader.d.ts +0 -2
- package/dist/components/accordion/accordion-header/AccordionHeader.js +0 -11
- package/dist/components/accordion/accordion-item/AccordionItem.css +0 -64
- package/dist/components/accordion/accordion-item/AccordionItem.d.ts +0 -8
- package/dist/components/accordion/accordion-item/AccordionItem.js +0 -60
- package/dist/components/accordion/accordion-item/AccordionItemContext.d.ts +0 -7
- package/dist/components/accordion/accordion-item/AccordionItemContext.js +0 -3
- package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.css +0 -76
- package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +0 -2
- package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +0 -61
- package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.css +0 -11
- package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +0 -2
- package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +0 -20
- package/dist/components/bottom-sheet/BottomSheet.css +0 -18
- package/dist/components/bottom-sheet/BottomSheet.d.ts +0 -12
- package/dist/components/bottom-sheet/BottomSheet.js +0 -101
- package/dist/components/breadcrumb/Breadcrumb.d.ts +0 -13
- package/dist/components/breadcrumb/Breadcrumb.js +0 -32
- package/dist/components/button/Button.d.ts +0 -11
- package/dist/components/button/Button.js +0 -36
- package/dist/components/card/Card.d.ts +0 -4
- package/dist/components/card/Card.js +0 -9
- package/dist/components/card/CardBody.d.ts +0 -5
- package/dist/components/card/CardBody.js +0 -15
- package/dist/components/card/CardHeader.d.ts +0 -8
- package/dist/components/card/CardHeader.js +0 -31
- package/dist/components/card/CardHeader.stories.helper.js +0 -7
- package/dist/components/card/CardNotification.d.ts +0 -6
- package/dist/components/card/CardNotification.js +0 -26
- package/dist/components/chips/chip/Chip.d.ts +0 -17
- package/dist/components/chips/chip/Chip.js +0 -38
- package/dist/components/chips/chip-container/ChipContainer.d.ts +0 -5
- package/dist/components/chips/chip-container/ChipContainer.js +0 -12
- package/dist/components/icon-wrapper/IconWrapper.d.ts +0 -3
- package/dist/components/icon-wrapper/IconWrapper.js +0 -13
- package/dist/components/link-button/LinkButton.d.ts +0 -8
- package/dist/components/link-button/LinkButton.js +0 -26
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +0 -5
- package/dist/components/loading-indicator/LoadingIndicator.js +0 -41
- package/dist/components/mobile-flyout/MobileFlyout.d.ts +0 -11
- package/dist/components/mobile-flyout/MobileFlyout.js +0 -88
- package/dist/components/mobile-flyout/MobileFlyoutContext.d.ts +0 -8
- package/dist/components/mobile-flyout/MobileFlyoutContext.js +0 -3
- package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +0 -17
- package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +0 -36
- package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.css +0 -5
- package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.d.ts +0 -8
- package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +0 -35
- package/dist/components/modals/AlertModal.d.ts +0 -12
- package/dist/components/modals/AlertModal.js +0 -53
- package/dist/components/modals/ConfirmModal.d.ts +0 -11
- package/dist/components/modals/ConfirmModal.js +0 -46
- package/dist/components/modals/CustomModal.d.ts +0 -8
- package/dist/components/modals/CustomModal.js +0 -38
- package/dist/components/modals/Modal.css +0 -39
- package/dist/components/modals/Modal.d.ts +0 -8
- package/dist/components/modals/Modal.js +0 -31
- package/dist/components/modals/ModalBase.d.ts +0 -9
- package/dist/components/modals/ModalBase.js +0 -124
- package/dist/components/modals/ModalFooter.d.ts +0 -2
- package/dist/components/modals/ModalFooter.js +0 -12
- package/dist/components/modals/Prompt.d.ts +0 -15
- package/dist/components/modals/Prompt.js +0 -58
- package/dist/components/modals/image-gallery/ImageGallery.css +0 -790
- package/dist/components/modals/image-gallery/ImageGallery.d.ts +0 -18
- package/dist/components/modals/image-gallery/ImageGallery.helper.d.ts +0 -2
- package/dist/components/modals/image-gallery/ImageGallery.helper.js +0 -13
- package/dist/components/modals/image-gallery/ImageGallery.js +0 -75
- package/dist/components/modals/image-gallery/ImageGallery.stories.helper.js +0 -112
- package/dist/components/modals/image-gallery/ImageGalleryContent.d.ts +0 -9
- package/dist/components/modals/image-gallery/ImageGalleryContent.js +0 -15
- package/dist/components/modals/image-gallery/ImageGalleryContext.d.ts +0 -10
- package/dist/components/modals/image-gallery/ImageGalleryContext.js +0 -4
- package/dist/components/modals/image-gallery/ImageGallerySwiper.d.ts +0 -8
- package/dist/components/modals/image-gallery/ImageGallerySwiper.js +0 -29
- package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.d.ts +0 -5
- package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.js +0 -23
- package/dist/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.css +0 -10
- package/dist/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.d.ts +0 -11
- package/dist/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.js +0 -24
- package/dist/components/modals/image-gallery/internal/BaseGallery.d.ts +0 -17
- package/dist/components/modals/image-gallery/internal/BaseGallery.js +0 -50
- package/dist/components/modals/image-gallery/internal/CloseButton.d.ts +0 -6
- package/dist/components/modals/image-gallery/internal/CloseButton.js +0 -14
- package/dist/components/modals/image-gallery/internal/ImageGalleryContainer.d.ts +0 -5
- package/dist/components/modals/image-gallery/internal/ImageGalleryContainer.js +0 -8
- package/dist/components/modals/image-gallery/internal/ImageGalleryPagination.d.ts +0 -5
- package/dist/components/modals/image-gallery/internal/ImageGalleryPagination.js +0 -29
- package/dist/components/modals/image-gallery/internal/ScaleButton.d.ts +0 -4
- package/dist/components/modals/image-gallery/internal/ScaleButton.js +0 -17
- package/dist/components/pagination/Pagination.css +0 -10
- package/dist/components/pagination/Pagination.d.ts +0 -15
- package/dist/components/pagination/Pagination.js +0 -100
- package/dist/components/popovers/legend/Legend.css +0 -21
- package/dist/components/popovers/legend/Legend.d.ts +0 -11
- package/dist/components/popovers/legend/Legend.js +0 -24
- package/dist/components/popovers/popover/Popover.css +0 -56
- package/dist/components/popovers/popover/Popover.d.ts +0 -20
- package/dist/components/popovers/popover/Popover.js +0 -107
- package/dist/components/popovers/popover-menu/PopoverMenu.css +0 -20
- package/dist/components/popovers/popover-menu/PopoverMenu.d.ts +0 -8
- package/dist/components/popovers/popover-menu/PopoverMenu.js +0 -37
- package/dist/components/popovers/popover-menu/PopoverMenuContext.d.ts +0 -3
- package/dist/components/popovers/popover-menu/PopoverMenuContext.js +0 -5
- package/dist/components/popovers/popover-menu-item/PopoverMenuItem.css +0 -35
- package/dist/components/popovers/popover-menu-item/PopoverMenuItem.d.ts +0 -10
- package/dist/components/popovers/popover-menu-item/PopoverMenuItem.js +0 -30
- package/dist/components/popovers/tooltip/Tooltip.d.ts +0 -5
- package/dist/components/popovers/tooltip/Tooltip.js +0 -12
- package/dist/components/progress/Progress.d.ts +0 -7
- package/dist/components/progress/Progress.js +0 -26
- package/dist/components/scroll-area/ScrollArea.d.ts +0 -4
- package/dist/components/scroll-area/ScrollArea.js +0 -10
- package/dist/components/scroll-area/ScrollArea.stories.css +0 -9
- package/dist/components/search-input/ClearButton.d.ts +0 -2
- package/dist/components/search-input/ClearButton.js +0 -10
- package/dist/components/search-input/SearchInput.css +0 -13
- package/dist/components/search-input/SearchInput.d.ts +0 -14
- package/dist/components/search-input/SearchInput.js +0 -61
- package/dist/components/search-input/SearchSuggestion.d.ts +0 -17
- package/dist/components/search-input/SearchSuggestion.js +0 -21
- package/dist/components/search-input/useSearchInput.d.ts +0 -13
- package/dist/components/search-input/useSearchInput.js +0 -85
- package/dist/components/snackbar/Snackbar.css +0 -55
- package/dist/components/snackbar/Snackbar.d.ts +0 -21
- package/dist/components/snackbar/Snackbar.js +0 -78
- package/dist/components/snackbar/SnackbarContext.d.ts +0 -7
- package/dist/components/snackbar/SnackbarContext.js +0 -3
- package/dist/components/snackbar/SnackbarProvider.d.ts +0 -8
- package/dist/components/snackbar/SnackbarProvider.js +0 -66
- package/dist/components/snackbar/useSnackbar.d.ts +0 -2
- package/dist/components/snackbar/useSnackbar.js +0 -4
- package/dist/components/stepper-horizontal/StepperHorizontal.css +0 -6
- package/dist/components/stepper-horizontal/StepperHorizontal.d.ts +0 -7
- package/dist/components/stepper-horizontal/StepperHorizontal.js +0 -48
- package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.css +0 -24
- package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +0 -6
- package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.js +0 -16
- package/dist/components/stepper-vertical/StepperVertical.d.ts +0 -6
- package/dist/components/stepper-vertical/StepperVertical.js +0 -26
- package/dist/components/stepper-vertical/step-vertical/StepVertical.css +0 -10
- package/dist/components/stepper-vertical/step-vertical/StepVertical.d.ts +0 -11
- package/dist/components/stepper-vertical/step-vertical/StepVertical.js +0 -58
- package/dist/components/tab/Tabs.css +0 -285
- package/dist/components/tab/Tabs.d.ts +0 -23
- package/dist/components/tab/Tabs.js +0 -194
- package/dist/components/tab/interfaces.d.ts +0 -5
- package/dist/components/tab/interfaces.js +0 -0
- package/dist/components/tab/tab-pane/TabPane.css +0 -8
- package/dist/components/tab/tab-pane/TabPane.d.ts +0 -9
- package/dist/components/tab/tab-pane/TabPane.js +0 -18
- package/dist/components/tab/useTabScroll.d.ts +0 -25
- package/dist/components/tab/useTabScroll.js +0 -151
- package/dist/components/table-header-cell/TableHeaderCell.d.ts +0 -5
- package/dist/components/table-header-cell/TableHeaderCell.js +0 -21
- package/dist/forms/checkbox/Checkbox.css +0 -134
- package/dist/forms/checkbox/Checkbox.d.ts +0 -15
- package/dist/forms/checkbox/Checkbox.js +0 -80
- package/dist/forms/radio/RadioButton.d.ts +0 -14
- package/dist/forms/radio/RadioButton.js +0 -61
- package/dist/forms/radio/RadioGroup.d.ts +0 -12
- package/dist/forms/radio/RadioGroup.js +0 -50
- package/dist/forms/radio/RadioGroupContext.d.ts +0 -12
- package/dist/forms/radio/RadioGroupContext.js +0 -3
- package/dist/forms/segment/Segment.d.ts +0 -13
- package/dist/forms/segment/Segment.js +0 -59
- package/dist/forms/segment/segment-control/SegmentControl.d.ts +0 -14
- package/dist/forms/segment/segment-control/SegmentControl.js +0 -57
- package/dist/forms/select/Select.css +0 -160
- package/dist/forms/select/Select.d.ts +0 -26
- package/dist/forms/select/Select.js +0 -95
- package/dist/forms/select/internal/HiddenInput.d.ts +0 -8
- package/dist/forms/select/internal/HiddenInput.js +0 -15
- package/dist/forms/select/internal/ListItem.d.ts +0 -18
- package/dist/forms/select/internal/ListItem.js +0 -69
- package/dist/forms/select/internal/SelectButton.d.ts +0 -12
- package/dist/forms/select/internal/SelectButton.js +0 -49
- package/dist/forms/select/internal/SelectButtonContent.d.ts +0 -7
- package/dist/forms/select/internal/SelectButtonContent.js +0 -31
- package/dist/forms/select/internal/SelectCheckbox.d.ts +0 -4
- package/dist/forms/select/internal/SelectCheckbox.js +0 -13
- package/dist/forms/select/internal/SelectLabel.d.ts +0 -7
- package/dist/forms/select/internal/SelectLabel.js +0 -12
- package/dist/forms/select/internal/SelectOptionsContainer.d.ts +0 -17
- package/dist/forms/select/internal/SelectOptionsContainer.js +0 -103
- package/dist/forms/select/internal/SelectScrollContainer.d.ts +0 -8
- package/dist/forms/select/internal/SelectScrollContainer.js +0 -15
- package/dist/forms/select/internal/SelectWrapper.d.ts +0 -6
- package/dist/forms/select/internal/SelectWrapper.js +0 -12
- package/dist/forms/select/internal/index.d.ts +0 -6
- package/dist/forms/select/internal/index.js +0 -7
- package/dist/forms/select/internal/utils.d.ts +0 -7
- package/dist/forms/select/internal/utils.js +0 -30
- package/dist/forms/select/select-option/SelectOption.d.ts +0 -14
- package/dist/forms/select/select-option/SelectOption.js +0 -12
- package/dist/forms/select/utils.d.ts +0 -2
- package/dist/forms/select/utils.js +0 -12
- package/dist/forms/slider/Slider.css +0 -50
- package/dist/forms/slider/Slider.d.ts +0 -17
- package/dist/forms/slider/Slider.js +0 -93
- package/dist/forms/switch/Switch.d.ts +0 -12
- package/dist/forms/switch/Switch.js +0 -42
- package/dist/forms/text-area/TextArea.css +0 -14
- package/dist/forms/text-area/TextArea.d.ts +0 -22
- package/dist/forms/text-area/TextArea.js +0 -99
- package/dist/forms/text-input/TextInput.d.ts +0 -24
- package/dist/forms/text-input/TextInput.js +0 -74
- package/dist/forms/time-picker/TimePicker.css +0 -10
- package/dist/forms/time-picker/TimePicker.d.ts +0 -24
- package/dist/forms/time-picker/TimePicker.js +0 -140
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.css +0 -4
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.d.ts +0 -19
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +0 -202
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.d.ts +0 -9
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.js +0 -14
- package/dist/index.d.ts +0 -63
- package/dist/index.js +0 -60
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -7
- package/dist/utils/setRef.d.ts +0 -1
- package/dist/utils/setRef.js +0 -5
- package/dist/utils/types.d.ts +0 -29
- package/dist/utils/types.js +0 -0
- package/dist/utils/useControlled.d.ts +0 -7
- package/dist/utils/useControlled.js +0 -20
- package/dist/utils/useForkRef.d.ts +0 -2
- package/dist/utils/useForkRef.js +0 -15
- package/dist/utils/useId.d.ts +0 -1
- package/dist/utils/useId.js +0 -20
- package/dist/utils/useOnClickOutside.d.ts +0 -2
- package/dist/utils/useOnClickOutside.js +0 -20
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "./SearchInput.css";
|
|
3
|
-
import classnames from "classnames";
|
|
4
|
-
import { useRef } from "react";
|
|
5
|
-
import { useOnClickOutside } from "../../utils/useOnClickOutside.js";
|
|
6
|
-
import { ClearButton } from "./ClearButton.js";
|
|
7
|
-
import { useSearchInput } from "./useSearchInput.js";
|
|
8
|
-
function SearchInput({ defaultValue, disabled, label, value, suggestions, onChange, onSearch, onKeyboardNavigate, className }) {
|
|
9
|
-
const inputRef = useRef(null);
|
|
10
|
-
const containerRef = useRef(null);
|
|
11
|
-
const cappedSuggestions = suggestions?.slice(0, 10) ?? [];
|
|
12
|
-
const { handleFocus, handleInput, handleClearQuery, handleSuggestionClick, handleOutsideClick, handleKeyDown, hideSuggestionList, selectedSuggestionIndex, innerValue } = useSearchInput(inputRef, cappedSuggestions, value, defaultValue, onChange, onSearch, onKeyboardNavigate);
|
|
13
|
-
useOnClickOutside(containerRef, handleOutsideClick);
|
|
14
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
15
|
-
className: classnames('fwe-search-input', className),
|
|
16
|
-
ref: containerRef,
|
|
17
|
-
children: [
|
|
18
|
-
/*#__PURE__*/ jsx("input", {
|
|
19
|
-
ref: inputRef,
|
|
20
|
-
disabled: disabled,
|
|
21
|
-
placeholder: label,
|
|
22
|
-
onFocus: handleFocus,
|
|
23
|
-
type: "search",
|
|
24
|
-
"aria-label": "Search",
|
|
25
|
-
onInput: handleInput,
|
|
26
|
-
onKeyDown: handleKeyDown,
|
|
27
|
-
value: innerValue
|
|
28
|
-
}),
|
|
29
|
-
/*#__PURE__*/ jsx("div", {
|
|
30
|
-
className: "fwe-search-icon"
|
|
31
|
-
}),
|
|
32
|
-
/*#__PURE__*/ jsx(ClearButton, {
|
|
33
|
-
onClick: handleClearQuery
|
|
34
|
-
}),
|
|
35
|
-
Boolean(suggestions?.length) && !hideSuggestionList && /*#__PURE__*/ jsxs("div", {
|
|
36
|
-
className: "fwe-search-suggestions",
|
|
37
|
-
role: "listbox",
|
|
38
|
-
children: [
|
|
39
|
-
cappedSuggestions.map((suggestion, i)=>/*#__PURE__*/ jsx("div", {
|
|
40
|
-
role: "option",
|
|
41
|
-
tabIndex: -1,
|
|
42
|
-
"aria-label": suggestion.value,
|
|
43
|
-
"aria-selected": selectedSuggestionIndex === i,
|
|
44
|
-
onClick: ()=>handleSuggestionClick(suggestion),
|
|
45
|
-
className: `fwe-search-suggestion ${selectedSuggestionIndex === i ? 'fwe-selected' : ''}`,
|
|
46
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
47
|
-
dangerouslySetInnerHTML: {
|
|
48
|
-
__html: suggestion.template
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
}, suggestion.value)),
|
|
52
|
-
suggestions && suggestions.length > 10 && /*#__PURE__*/ jsx("div", {
|
|
53
|
-
className: "fwe-ml-xxs",
|
|
54
|
-
children: "..."
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
})
|
|
58
|
-
]
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
export { SearchInput };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare class SearchSuggestion {
|
|
2
|
-
/**
|
|
3
|
-
* a html-string. e.g.: '<b> hello </b>'
|
|
4
|
-
*/
|
|
5
|
-
template: string;
|
|
6
|
-
/**
|
|
7
|
-
* This Value will be used as new query when the user selects the suggestion.
|
|
8
|
-
*/
|
|
9
|
-
value: string;
|
|
10
|
-
/**
|
|
11
|
-
* Creates a basic Suggestion from a string. The first query match is highlighted by bold tags.
|
|
12
|
-
* @param suggestionString The suggested string (should contain the whole query)
|
|
13
|
-
* @param query The current query. This string will be highlighted.
|
|
14
|
-
* @returns a html-string.
|
|
15
|
-
*/
|
|
16
|
-
static basicSuggestion(suggestionString: string, query: string): SearchSuggestion;
|
|
17
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
class SearchSuggestion {
|
|
2
|
-
template;
|
|
3
|
-
value;
|
|
4
|
-
static basicSuggestion(suggestionString, query) {
|
|
5
|
-
const i = suggestionString.toLocaleLowerCase().indexOf(query.toLocaleLowerCase());
|
|
6
|
-
let template = suggestionString;
|
|
7
|
-
if (-1 !== i) {
|
|
8
|
-
const boldStart = i;
|
|
9
|
-
const boldEnd = i + query.length;
|
|
10
|
-
const part1 = suggestionString.substring(0, boldStart);
|
|
11
|
-
const part2 = suggestionString.substring(boldStart, boldEnd);
|
|
12
|
-
const part3 = suggestionString.substring(boldEnd, suggestionString.length);
|
|
13
|
-
template = `${part1}<strong>${part2}</strong>${part3}`;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
value: suggestionString,
|
|
17
|
-
template
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export { SearchSuggestion };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { SearchSuggestion } from './SearchSuggestion';
|
|
3
|
-
export declare 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
|
-
innerValue: string | undefined;
|
|
5
|
-
hideSuggestionList: boolean;
|
|
6
|
-
selectedSuggestionIndex: number;
|
|
7
|
-
handleClearQuery: () => void;
|
|
8
|
-
handleFocus: () => void;
|
|
9
|
-
handleInput: (event: any) => void;
|
|
10
|
-
handleSuggestionClick: (suggestion: SearchSuggestion) => void;
|
|
11
|
-
handleOutsideClick: () => void;
|
|
12
|
-
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
13
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { useControlled } from "../../utils/useControlled.js";
|
|
3
|
-
function useSearchInput(inputRef, cappedSuggestions, value, defaultValue = '', onChange, onSearch, onKeyboardNavigate) {
|
|
4
|
-
const [innerValue, setValue] = useControlled({
|
|
5
|
-
controlled: value,
|
|
6
|
-
default: defaultValue
|
|
7
|
-
});
|
|
8
|
-
const [hideSuggestionList, setHideSuggestionList] = useState(false);
|
|
9
|
-
const [selectedSuggestionIndex, setSelectedSuggestionIndex] = useState(-1);
|
|
10
|
-
function blurInput() {
|
|
11
|
-
if (inputRef.current) inputRef.current.blur();
|
|
12
|
-
}
|
|
13
|
-
function reset() {
|
|
14
|
-
setSelectedSuggestionIndex(-1);
|
|
15
|
-
setHideSuggestionList(true);
|
|
16
|
-
blurInput();
|
|
17
|
-
}
|
|
18
|
-
function handleSearch() {
|
|
19
|
-
reset();
|
|
20
|
-
if (void 0 !== innerValue) onSearch?.(innerValue);
|
|
21
|
-
}
|
|
22
|
-
function updateValue(newValue) {
|
|
23
|
-
setValue(newValue);
|
|
24
|
-
onChange?.(newValue);
|
|
25
|
-
onSearch?.(newValue);
|
|
26
|
-
}
|
|
27
|
-
function handleClearQuery() {
|
|
28
|
-
reset();
|
|
29
|
-
updateValue('');
|
|
30
|
-
}
|
|
31
|
-
function handleArrowKey(newSuggestionIndex) {
|
|
32
|
-
if (!cappedSuggestions || !cappedSuggestions.length) return;
|
|
33
|
-
const selectedSuggestion = cappedSuggestions[newSuggestionIndex];
|
|
34
|
-
setSelectedSuggestionIndex(newSuggestionIndex);
|
|
35
|
-
setValue(selectedSuggestion.value);
|
|
36
|
-
onKeyboardNavigate?.(selectedSuggestion.value);
|
|
37
|
-
}
|
|
38
|
-
function handleUpArrowKey() {
|
|
39
|
-
handleArrowKey(selectedSuggestionIndex > 0 ? selectedSuggestionIndex - 1 : cappedSuggestions.length - 1);
|
|
40
|
-
}
|
|
41
|
-
function handleDownArrowKey() {
|
|
42
|
-
handleArrowKey(selectedSuggestionIndex >= cappedSuggestions.length - 1 ? 0 : selectedSuggestionIndex + 1);
|
|
43
|
-
}
|
|
44
|
-
function handleKeyDown(event) {
|
|
45
|
-
switch(event.key){
|
|
46
|
-
case 'Enter':
|
|
47
|
-
handleSearch();
|
|
48
|
-
break;
|
|
49
|
-
case 'Escape':
|
|
50
|
-
handleClearQuery();
|
|
51
|
-
break;
|
|
52
|
-
case 'ArrowUp':
|
|
53
|
-
handleUpArrowKey();
|
|
54
|
-
break;
|
|
55
|
-
case 'ArrowDown':
|
|
56
|
-
handleDownArrowKey();
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const handleFocus = ()=>setHideSuggestionList(false);
|
|
63
|
-
const handleOutsideClick = ()=>setHideSuggestionList(true);
|
|
64
|
-
function handleSuggestionClick(suggestion) {
|
|
65
|
-
reset();
|
|
66
|
-
updateValue(suggestion.value);
|
|
67
|
-
}
|
|
68
|
-
function handleInput(event) {
|
|
69
|
-
setSelectedSuggestionIndex(-1);
|
|
70
|
-
setValue(event.target.value);
|
|
71
|
-
onChange?.(event.target.value);
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
innerValue,
|
|
75
|
-
hideSuggestionList,
|
|
76
|
-
selectedSuggestionIndex,
|
|
77
|
-
handleClearQuery,
|
|
78
|
-
handleFocus,
|
|
79
|
-
handleInput,
|
|
80
|
-
handleSuggestionClick,
|
|
81
|
-
handleOutsideClick,
|
|
82
|
-
handleKeyDown
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
export { useSearchInput };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
.fr-snackbar-wrapper {
|
|
2
|
-
opacity: 0;
|
|
3
|
-
opacity: 1;
|
|
4
|
-
margin-bottom: 24px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.fr-snackbar-wrapper-enter-done {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
transition: opacity .6s ease-out;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.fr-snackbar-wrapper-exit {
|
|
13
|
-
opacity: 1;
|
|
14
|
-
height: 48px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.fr-snackbar-wrapper-exit-active {
|
|
18
|
-
opacity: 0;
|
|
19
|
-
height: 0;
|
|
20
|
-
margin-bottom: 0;
|
|
21
|
-
transition: height .3s ease-out .3s, opacity .3s ease-out, margin-bottom .3s ease-out .3s;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.fr-snackbar-wrapper--first {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
margin-bottom: 24px;
|
|
27
|
-
transform: translateY(100px);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.fr-snackbar-wrapper--first-enter-done {
|
|
31
|
-
opacity: 1;
|
|
32
|
-
transition: opacity .6s ease-out;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.fr-snackbar-wrapper--first-exit {
|
|
36
|
-
opacity: 1;
|
|
37
|
-
height: 48px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.fr-snackbar-wrapper--first-exit-active {
|
|
41
|
-
opacity: 0;
|
|
42
|
-
height: 0;
|
|
43
|
-
margin-bottom: 0;
|
|
44
|
-
transition: height .3s ease-out .3s, opacity .3s ease-out, margin-bottom .3s ease-out .3s;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.fr-snackbar-wrapper--first-enter-done {
|
|
48
|
-
transition: transform .6s ease-out;
|
|
49
|
-
transform: translateY(0);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.fr-snackbar-wrapper--first-exit-active {
|
|
53
|
-
transform: translateY(0);
|
|
54
|
-
}
|
|
55
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ClassNameProps } from '../../utils/types';
|
|
2
|
-
import './Snackbar.scss';
|
|
3
|
-
export interface SnackbarConfig extends ClassNameProps {
|
|
4
|
-
type?: 'info' | 'warning' | 'error';
|
|
5
|
-
variant?: 'a' | 'b' | 'c';
|
|
6
|
-
darkBackground?: boolean;
|
|
7
|
-
showClose?: boolean;
|
|
8
|
-
action?: string;
|
|
9
|
-
disappearAfter?: number | null;
|
|
10
|
-
key?: string | number;
|
|
11
|
-
}
|
|
12
|
-
export interface SnackbarData extends SnackbarConfig {
|
|
13
|
-
text: string;
|
|
14
|
-
}
|
|
15
|
-
export interface SnackbarProps {
|
|
16
|
-
data?: SnackbarData;
|
|
17
|
-
onAction?: () => void;
|
|
18
|
-
onClose?: () => void;
|
|
19
|
-
first?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare function Snackbar(props: SnackbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { CSSTransition } from "react-transition-group";
|
|
5
|
-
import "./Snackbar.css";
|
|
6
|
-
function Snackbar(props) {
|
|
7
|
-
const { data, onAction, onClose, first = false } = props;
|
|
8
|
-
const [show, setShow] = useState(true);
|
|
9
|
-
const nodeRef = useRef(null);
|
|
10
|
-
useEffect(()=>{
|
|
11
|
-
let disappearAfter = 5000;
|
|
12
|
-
if (data?.disappearAfter !== null) {
|
|
13
|
-
if (data?.disappearAfter && data?.disappearAfter > 0) disappearAfter = data?.disappearAfter;
|
|
14
|
-
const timer = setTimeout(()=>setShow(false), disappearAfter);
|
|
15
|
-
return ()=>{
|
|
16
|
-
clearTimeout(timer);
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}, [
|
|
20
|
-
data
|
|
21
|
-
]);
|
|
22
|
-
function handleClose() {
|
|
23
|
-
setShow(false);
|
|
24
|
-
}
|
|
25
|
-
const classes = first ? 'fr-snackbar-wrapper--first' : 'fr-snackbar-wrapper';
|
|
26
|
-
return /*#__PURE__*/ jsx(CSSTransition, {
|
|
27
|
-
nodeRef: nodeRef,
|
|
28
|
-
onExited: ()=>onClose ? onClose() : void 0,
|
|
29
|
-
unmountOnExit: true,
|
|
30
|
-
timeout: {
|
|
31
|
-
exit: 600
|
|
32
|
-
},
|
|
33
|
-
in: show,
|
|
34
|
-
classNames: classes,
|
|
35
|
-
appear: true,
|
|
36
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
37
|
-
ref: nodeRef,
|
|
38
|
-
className: classes,
|
|
39
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
40
|
-
className: classnames({
|
|
41
|
-
'fwe-snackbar': true,
|
|
42
|
-
'fwe-snackbar-b': data?.variant === 'b',
|
|
43
|
-
'fwe-snackbar-c': data?.variant === 'c',
|
|
44
|
-
'fwe-snackbar-info': data?.type === 'info',
|
|
45
|
-
'fwe-snackbar-warning': data?.type === 'warning',
|
|
46
|
-
'fwe-snackbar-error': data?.type === 'error',
|
|
47
|
-
'fwe-snackbar-shadow': data?.darkBackground
|
|
48
|
-
}, data?.className),
|
|
49
|
-
children: [
|
|
50
|
-
/*#__PURE__*/ jsx("span", {
|
|
51
|
-
children: data?.text
|
|
52
|
-
}),
|
|
53
|
-
data?.action && /*#__PURE__*/ jsx("button", {
|
|
54
|
-
"aria-label": "UserAction",
|
|
55
|
-
type: "button",
|
|
56
|
-
className: "fwe-snackbar-link-btn",
|
|
57
|
-
onClick: ()=>onAction ? onAction() : void 0,
|
|
58
|
-
children: data?.action
|
|
59
|
-
}),
|
|
60
|
-
data?.action && data?.showClose && /*#__PURE__*/ jsx("div", {
|
|
61
|
-
className: "fwe-snackbar-separator"
|
|
62
|
-
}),
|
|
63
|
-
data?.showClose && /*#__PURE__*/ jsx("button", {
|
|
64
|
-
"aria-label": "Close",
|
|
65
|
-
type: "button",
|
|
66
|
-
className: "fwe-snackbar-close-btn",
|
|
67
|
-
onClick: handleClose,
|
|
68
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
69
|
-
className: "fwe-sr-only",
|
|
70
|
-
children: "Close"
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
})
|
|
75
|
-
})
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
export { Snackbar };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SnackbarData } from './Snackbar';
|
|
3
|
-
export interface ProviderContext {
|
|
4
|
-
addSnackbar: (data: SnackbarData, onAction?: () => void, onClose?: () => void) => void;
|
|
5
|
-
closeSnackbar: (key: number | string) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const SnackbarContext: React.Context<ProviderContext>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ClassNamePropsWithChildren } from '../../utils/types';
|
|
2
|
-
import { type SnackbarConfig, type SnackbarData } from './Snackbar';
|
|
3
|
-
interface SnackbarProviderProps extends ClassNamePropsWithChildren {
|
|
4
|
-
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;
|
|
8
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
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 };
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,48 +0,0 @@
|
|
|
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: "fwe-stepper-horizontal",
|
|
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 };
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import './StepHorizontal.scss';
|
|
2
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
-
export interface StepHorizontalProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare const StepHorizontal: (props: StepHorizontalProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,16 +0,0 @@
|
|
|
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 };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export interface StepperVerticalProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
3
|
-
stepIndex?: number;
|
|
4
|
-
onChange?: (stepIndex: number) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const StepperVertical: (props: StepperVerticalProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
...child.props,
|
|
11
|
-
isActive: i === stepIndex,
|
|
12
|
-
index: i,
|
|
13
|
-
isDone: i < stepIndex,
|
|
14
|
-
isLastElement: i === react.Children.count(children) - 1,
|
|
15
|
-
onStepClick: ()=>handleStepClick(i)
|
|
16
|
-
});
|
|
17
|
-
return null;
|
|
18
|
-
});
|
|
19
|
-
return /*#__PURE__*/ jsx("div", {
|
|
20
|
-
ref: ref,
|
|
21
|
-
className: classnames('fwe-stepper-vertical', className),
|
|
22
|
-
...props,
|
|
23
|
-
children: stepComponents
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
export { StepperVertical };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import './StepVertical.scss';
|
|
2
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
-
export interface StepVerticalProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
isLastElement?: boolean;
|
|
6
|
-
isDone?: boolean;
|
|
7
|
-
index?: number;
|
|
8
|
-
title?: string;
|
|
9
|
-
onStepClick?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const StepVertical: (props: StepVerticalProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|