@festo-ui/react 9.0.1-dev.815 → 9.0.1-dev.818
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.d.ts +3 -3
- package/dist/components/accordion/Accordion.js +2 -1
- package/dist/components/accordion/accordion-header/AccordionHeader.js +1 -0
- package/dist/components/accordion/accordion-item/AccordionItem.d.ts +1 -1
- package/dist/components/accordion/accordion-item/AccordionItem.js +2 -1
- package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +1 -0
- package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +1 -0
- package/dist/components/bottom-sheet/BottomSheet.d.ts +2 -3
- package/dist/components/bottom-sheet/BottomSheet.js +7 -4
- package/dist/components/breadcrumb/Breadcrumb.d.ts +3 -4
- package/dist/components/breadcrumb/Breadcrumb.js +10 -5
- package/dist/components/button/Button.js +1 -0
- package/dist/components/card/Card.d.ts +3 -5
- package/dist/components/card/Card.js +6 -4
- package/dist/components/card/CardBody.d.ts +3 -3
- package/dist/components/card/CardBody.js +6 -4
- package/dist/components/card/CardHeader.d.ts +3 -3
- package/dist/components/card/CardHeader.js +6 -4
- package/dist/components/card/CardNotification.d.ts +2 -3
- package/dist/components/card/CardNotification.js +6 -2
- package/dist/components/chips/chip/Chip.d.ts +4 -5
- package/dist/components/chips/chip/Chip.js +11 -4
- package/dist/components/chips/chip-container/ChipContainer.d.ts +3 -3
- package/dist/components/chips/chip-container/ChipContainer.js +6 -2
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +2 -2
- package/dist/components/loading-indicator/LoadingIndicator.js +1 -0
- package/dist/components/mobile-flyout/MobileFlyout.js +1 -0
- package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +1 -0
- package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +3 -2
- package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +4 -3
- package/dist/components/modals/AlertModal.d.ts +1 -1
- package/dist/components/modals/AlertModal.js +5 -4
- package/dist/components/modals/ConfirmModal.d.ts +1 -1
- package/dist/components/modals/ConfirmModal.js +5 -4
- package/dist/components/modals/CustomModal.js +1 -0
- package/dist/components/modals/Modal.js +1 -0
- package/dist/components/modals/ModalBase.js +1 -0
- package/dist/components/modals/ModalFooter.d.ts +2 -2
- package/dist/components/modals/ModalFooter.js +3 -1
- package/dist/components/modals/Prompt.d.ts +2 -3
- package/dist/components/modals/Prompt.js +9 -6
- package/dist/components/modals/image-gallery/ImageGallery.css +6 -6
- package/dist/components/modals/image-gallery/ImageGallery.d.ts +1 -1
- package/dist/components/modals/image-gallery/ImageGallery.js +1 -0
- package/dist/components/modals/image-gallery/ImageGallerySwiper.js +1 -1
- package/dist/components/pagination/Pagination.d.ts +3 -4
- package/dist/components/pagination/Pagination.js +17 -13
- package/dist/components/popovers/legend/Legend.d.ts +3 -2
- package/dist/components/popovers/legend/Legend.js +5 -2
- package/dist/components/popovers/popover/Popover.css +1 -1
- package/dist/components/popovers/popover/Popover.d.ts +4 -4
- package/dist/components/popovers/popover/Popover.js +14 -5
- package/dist/components/popovers/popover-menu/PopoverMenu.d.ts +4 -2
- package/dist/components/popovers/popover-menu/PopoverMenu.js +5 -3
- package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.d.ts +3 -2
- package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.js +7 -3
- package/dist/components/popovers/tooltip/Tooltip.d.ts +3 -2
- package/dist/components/popovers/tooltip/Tooltip.js +5 -4
- package/dist/components/progress/Progress.d.ts +2 -3
- package/dist/components/progress/Progress.js +6 -2
- package/dist/components/search-input/ClearButton.d.ts +1 -2
- package/dist/components/search-input/ClearButton.js +5 -4
- package/dist/components/search-input/SearchInput.d.ts +3 -4
- package/dist/components/search-input/SearchInput.js +9 -5
- package/dist/components/snackbar/Snackbar.d.ts +4 -4
- package/dist/components/snackbar/Snackbar.js +11 -7
- package/dist/components/snackbar/SnackbarProvider.d.ts +3 -3
- package/dist/components/snackbar/SnackbarProvider.js +7 -4
- package/dist/components/stepper-horizontal/StepperHorizontal.d.ts +2 -2
- package/dist/components/stepper-horizontal/StepperHorizontal.js +3 -2
- package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.js +2 -1
- package/dist/components/stepper-vertical/StepperVertical.js +1 -0
- package/dist/components/stepper-vertical/step-vertical/StepVertical.js +1 -0
- package/dist/components/tab/Tabs.js +2 -1
- package/dist/components/tab/tab-pane/TabPane.d.ts +3 -4
- package/dist/components/tab/tab-pane/TabPane.js +6 -2
- package/dist/components/table-header-cell/TableHeaderCell.d.ts +2 -1
- package/dist/components/table-header-cell/TableHeaderCell.js +1 -0
- package/dist/forms/checkbox/Checkbox.d.ts +3 -6
- package/dist/forms/checkbox/Checkbox.js +5 -2
- package/dist/forms/combobox/ComboBox.d.ts +6 -7
- package/dist/forms/combobox/ComboBox.js +2 -3
- package/dist/forms/multi-select/{MultiSelect_module.css → MultiSelect.css} +2 -2
- package/dist/forms/multi-select/MultiSelect.d.ts +2 -2
- package/dist/forms/multi-select/MultiSelect.js +4 -3
- package/dist/forms/radio/RadioButton.d.ts +4 -4
- package/dist/forms/radio/RadioButton.js +11 -10
- package/dist/forms/radio/RadioGroup.d.ts +4 -4
- package/dist/forms/radio/RadioGroup.js +1 -0
- package/dist/forms/segment/Segment.d.ts +4 -5
- package/dist/forms/segment/Segment.js +10 -8
- package/dist/forms/segment/segment-control/SegmentControl.d.ts +4 -8
- package/dist/forms/segment/segment-control/SegmentControl.js +8 -6
- package/dist/forms/select/Select.d.ts +6 -6
- package/dist/forms/select/Select.js +1 -0
- package/dist/forms/slider/Slider.d.ts +4 -7
- package/dist/forms/slider/Slider.js +11 -6
- package/dist/forms/switch/Switch.d.ts +4 -6
- package/dist/forms/switch/Switch.js +12 -6
- package/dist/forms/text-area/TextArea.d.ts +6 -15
- package/dist/forms/text-area/TextArea.js +42 -25
- package/dist/forms/text-input/TextInput.d.ts +5 -4
- package/dist/forms/text-input/TextInput.js +7 -2
- package/dist/forms/time-picker/TimePicker.d.ts +7 -6
- package/dist/forms/time-picker/TimePicker.js +4 -2
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +1 -0
- package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.js +1 -0
- package/dist/utils/types.d.ts +0 -13
- package/package.json +2 -9
- package/dist/forms/multi-select/MultiSelect.module.js +0 -8
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
const ModalFooter = /*#__PURE__*/ forwardRef(({ children, className }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
4
|
+
const ModalFooter = /*#__PURE__*/ forwardRef(({ children, className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
5
5
|
ref: ref,
|
|
6
6
|
className: classnames('fwe-modal-footer', className),
|
|
7
|
+
...props,
|
|
7
8
|
children: /*#__PURE__*/ jsx("div", {
|
|
8
9
|
className: classnames('fwe-modal-buttons'),
|
|
9
10
|
children: children
|
|
10
11
|
})
|
|
11
12
|
}));
|
|
13
|
+
ModalFooter.displayName = 'ModalFooter';
|
|
12
14
|
export { ModalFooter };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type ReactElement } from 'react';
|
|
3
2
|
import { type ModalProps } from './Modal';
|
|
4
3
|
export interface PromptProps extends Omit<ModalProps, 'head' | 'body' | 'children' | 'onChange'> {
|
|
5
4
|
readonly title: string;
|
|
@@ -7,10 +6,10 @@ export interface PromptProps extends Omit<ModalProps, 'head' | 'body' | 'childre
|
|
|
7
6
|
readonly hint?: string;
|
|
8
7
|
readonly label?: string;
|
|
9
8
|
readonly value?: string;
|
|
10
|
-
readonly onChange?: (event: React.
|
|
9
|
+
readonly onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
10
|
readonly cancel?: string;
|
|
12
11
|
readonly ok?: string;
|
|
13
12
|
readonly onCancel?: () => void;
|
|
14
13
|
readonly onOk: (value: string | undefined) => void;
|
|
15
14
|
}
|
|
16
|
-
export declare
|
|
15
|
+
export declare const Prompt: (props: PromptProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
2
|
+
import { forwardRef, useEffect, useState } from "react";
|
|
3
3
|
import { TextInput } from "../../forms/text-input/TextInput.js";
|
|
4
4
|
import { Modal } from "./Modal.js";
|
|
5
5
|
import { ModalFooter } from "./ModalFooter.js";
|
|
6
|
-
|
|
6
|
+
const Prompt = /*#__PURE__*/ forwardRef(({ title, subtitle, hint, label, value, onChange, onOk, onCancel, cancel, ok, className, ...props }, ref)=>{
|
|
7
7
|
const [innerValue, setInnerValue] = useState(value);
|
|
8
8
|
useEffect(()=>{
|
|
9
9
|
setInnerValue(value);
|
|
10
10
|
}, [
|
|
11
11
|
value
|
|
12
12
|
]);
|
|
13
|
-
function handleChange(e) {
|
|
14
|
-
setInnerValue(
|
|
15
|
-
if (onChange) onChange(e);
|
|
13
|
+
function handleChange(newValue, e) {
|
|
14
|
+
setInnerValue(newValue);
|
|
15
|
+
if (onChange) onChange(newValue, e);
|
|
16
16
|
}
|
|
17
17
|
return /*#__PURE__*/ jsx(Modal, {
|
|
18
|
+
className: className,
|
|
18
19
|
head: /*#__PURE__*/ jsxs(Fragment, {
|
|
19
20
|
children: [
|
|
20
21
|
subtitle && /*#__PURE__*/ jsx("h2", {
|
|
@@ -34,6 +35,7 @@ function Prompt({ title, subtitle, hint, label, value, onChange, onOk, onCancel,
|
|
|
34
35
|
value: innerValue,
|
|
35
36
|
autoFocus: true
|
|
36
37
|
}),
|
|
38
|
+
ref: ref,
|
|
37
39
|
...props,
|
|
38
40
|
children: (cancel || ok) && /*#__PURE__*/ jsxs(ModalFooter, {
|
|
39
41
|
children: [
|
|
@@ -54,5 +56,6 @@ function Prompt({ title, subtitle, hint, label, value, onChange, onOk, onCancel,
|
|
|
54
56
|
]
|
|
55
57
|
})
|
|
56
58
|
});
|
|
57
|
-
}
|
|
59
|
+
});
|
|
60
|
+
Prompt.displayName = 'Prompt';
|
|
58
61
|
export { Prompt };
|
|
@@ -316,7 +316,7 @@
|
|
|
316
316
|
display: none !important;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
& svg {
|
|
319
|
+
& ::slotted(svg), & svg {
|
|
320
320
|
object-fit: contain;
|
|
321
321
|
transform-origin: center;
|
|
322
322
|
fill: currentColor;
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
left: var(--swiper-navigation-sides-offset, 4px);
|
|
340
340
|
right: auto;
|
|
341
341
|
|
|
342
|
-
& .swiper-navigation-icon {
|
|
342
|
+
& ::slotted(.swiper-navigation-icon), & .swiper-navigation-icon {
|
|
343
343
|
transform: rotate(180deg);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
@@ -367,13 +367,13 @@
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
& .swiper-button-prev, & ~ .swiper-button-prev, &.swiper-rtl .swiper-button-next, &.swiper-rtl ~ .swiper-button-next {
|
|
370
|
-
& .swiper-navigation-icon {
|
|
370
|
+
& ::slotted(.swiper-navigation-icon), & .swiper-navigation-icon {
|
|
371
371
|
transform: rotate(180deg);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
&.swiper-rtl .swiper-button-prev, &.swiper-rtl ~ .swiper-button-prev {
|
|
376
|
-
& .swiper-navigation-icon {
|
|
376
|
+
& ::slotted(.swiper-navigation-icon), & .swiper-navigation-icon {
|
|
377
377
|
transform: rotate(0);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
top: var(--swiper-navigation-sides-offset, 4px);
|
|
392
392
|
bottom: auto;
|
|
393
393
|
|
|
394
|
-
& .swiper-navigation-icon {
|
|
394
|
+
& ::slotted(.swiper-navigation-icon), & .swiper-navigation-icon {
|
|
395
395
|
transform: rotate(-90deg);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
bottom: var(--swiper-navigation-sides-offset, 4px);
|
|
401
401
|
top: auto;
|
|
402
402
|
|
|
403
|
-
& .swiper-navigation-icon {
|
|
403
|
+
& ::slotted(.swiper-navigation-icon), & .swiper-navigation-icon {
|
|
404
404
|
transform: rotate(90deg);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
@@ -18,4 +18,4 @@ export interface ImageGalleryProps extends ComponentPropsWithoutRef<'div'>, Moda
|
|
|
18
18
|
descriptiveContent?: boolean | ((index: number) => React.ReactNode);
|
|
19
19
|
onSlideChanged?: (index: number) => void;
|
|
20
20
|
}
|
|
21
|
-
export declare const ImageGallery: (props: ImageGalleryProps & import("react").RefAttributes<
|
|
21
|
+
export declare const ImageGallery: (props: ImageGalleryProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import './Pagination.scss';
|
|
2
|
-
import type { ClassNameProps } from '../../utils/types';
|
|
3
2
|
export declare enum PaginationType {
|
|
4
3
|
Simple = "SIMPLE",
|
|
5
4
|
Numeric = "NUMERIC",
|
|
6
5
|
Dots = "DOTS"
|
|
7
6
|
}
|
|
8
|
-
export interface PaginationProps extends
|
|
7
|
+
export interface PaginationProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
9
8
|
readonly type?: PaginationType;
|
|
10
|
-
readonly onChange?: (page: number) => void;
|
|
9
|
+
readonly onChange?: (page: number, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
10
|
readonly pageCurrent?: number;
|
|
12
11
|
readonly defaultPageCurrent?: number;
|
|
13
12
|
readonly pageMax: number;
|
|
14
13
|
}
|
|
15
|
-
export declare
|
|
14
|
+
export declare const Pagination: (props: PaginationProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "./Pagination.css";
|
|
3
3
|
import classnames from "classnames";
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
4
|
+
import { forwardRef, useEffect, useState } from "react";
|
|
5
5
|
var Pagination_PaginationType = /*#__PURE__*/ function(PaginationType) {
|
|
6
6
|
PaginationType["Simple"] = "SIMPLE";
|
|
7
7
|
PaginationType["Numeric"] = "NUMERIC";
|
|
8
8
|
PaginationType["Dots"] = "DOTS";
|
|
9
9
|
return PaginationType;
|
|
10
10
|
}({});
|
|
11
|
-
|
|
12
|
-
const { pageMax, onChange, pageCurrent, defaultPageCurrent = 1, type = "NUMERIC", className } = props;
|
|
11
|
+
const Pagination = /*#__PURE__*/ forwardRef(({ pageMax, onChange, pageCurrent, defaultPageCurrent = 1, type = "NUMERIC", className, ...props }, ref)=>{
|
|
13
12
|
const controlled = void 0 !== pageCurrent;
|
|
14
13
|
const dotArray = Array.from(new Array(pageMax).keys());
|
|
15
14
|
const [innerPageCurrent, setInnerPageCurrent] = useState(controlled ? pageCurrent : defaultPageCurrent);
|
|
@@ -19,32 +18,34 @@ function Pagination(props) {
|
|
|
19
18
|
pageCurrent,
|
|
20
19
|
controlled
|
|
21
20
|
]);
|
|
22
|
-
function handleChange(newPage) {
|
|
21
|
+
function handleChange(newPage, event) {
|
|
23
22
|
if (!controlled) setInnerPageCurrent(newPage);
|
|
24
|
-
if (onChange) onChange(newPage);
|
|
23
|
+
if (onChange) onChange(newPage, event);
|
|
25
24
|
}
|
|
26
|
-
function onBtnDown() {
|
|
25
|
+
function onBtnDown(event) {
|
|
27
26
|
if (innerPageCurrent > 1) {
|
|
28
27
|
const newPageCurrent = innerPageCurrent - 1;
|
|
29
|
-
handleChange(newPageCurrent);
|
|
28
|
+
handleChange(newPageCurrent, event);
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
|
-
function onBtnUp() {
|
|
31
|
+
function onBtnUp(event) {
|
|
33
32
|
if (innerPageCurrent < pageMax) {
|
|
34
33
|
const newPageCurrent = innerPageCurrent + 1;
|
|
35
|
-
handleChange(newPageCurrent);
|
|
34
|
+
handleChange(newPageCurrent, event);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
function onDotClick(index) {
|
|
37
|
+
function onDotClick(index, event) {
|
|
39
38
|
const newPageCurrent = index + 1;
|
|
40
|
-
handleChange(newPageCurrent);
|
|
39
|
+
handleChange(newPageCurrent, event);
|
|
41
40
|
}
|
|
42
41
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
43
42
|
children: [
|
|
44
43
|
"DOTS" !== type && /*#__PURE__*/ jsxs("div", {
|
|
44
|
+
...props,
|
|
45
45
|
className: classnames('fwe-pagination', {
|
|
46
46
|
'fwe-d-none': pageMax < 2
|
|
47
47
|
}, className),
|
|
48
|
+
ref: ref,
|
|
48
49
|
children: [
|
|
49
50
|
/*#__PURE__*/ jsx("button", {
|
|
50
51
|
className: classnames('fwe-navigate-btn-down', {
|
|
@@ -78,9 +79,11 @@ function Pagination(props) {
|
|
|
78
79
|
]
|
|
79
80
|
}),
|
|
80
81
|
"DOTS" === type && /*#__PURE__*/ jsx("div", {
|
|
82
|
+
...props,
|
|
81
83
|
className: classnames({
|
|
82
84
|
'fwe-d-none': pageMax < 2
|
|
83
85
|
}, className),
|
|
86
|
+
ref: ref,
|
|
84
87
|
children: /*#__PURE__*/ jsx("div", {
|
|
85
88
|
className: "fwe-pagination",
|
|
86
89
|
children: dotArray.map((index)=>/*#__PURE__*/ jsx("button", {
|
|
@@ -88,7 +91,7 @@ function Pagination(props) {
|
|
|
88
91
|
className: classnames('fwe-page-dot', {
|
|
89
92
|
'fwe-selected': index + 1 === innerPageCurrent
|
|
90
93
|
}),
|
|
91
|
-
onClick: ()=>onDotClick(index),
|
|
94
|
+
onClick: (e)=>onDotClick(index, e),
|
|
92
95
|
"aria-label": `Go to page ${index + 1}`,
|
|
93
96
|
"aria-current": index + 1 === innerPageCurrent ? 'page' : void 0
|
|
94
97
|
}, index))
|
|
@@ -96,5 +99,6 @@ function Pagination(props) {
|
|
|
96
99
|
})
|
|
97
100
|
]
|
|
98
101
|
});
|
|
99
|
-
}
|
|
102
|
+
});
|
|
103
|
+
Pagination.displayName = 'Pagination';
|
|
100
104
|
export { Pagination, Pagination_PaginationType as PaginationType };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react';
|
|
2
1
|
import { type PopoverProps } from '../popover/Popover';
|
|
3
2
|
export interface LegendItem {
|
|
4
3
|
readonly name: string;
|
|
@@ -7,4 +6,6 @@ export interface LegendItem {
|
|
|
7
6
|
export interface LegendProps extends Omit<PopoverProps, 'content'> {
|
|
8
7
|
readonly items: LegendItem[];
|
|
9
8
|
}
|
|
10
|
-
export declare
|
|
9
|
+
export declare const Legend: (props: LegendProps & {
|
|
10
|
+
children?: import("react").ReactNode | undefined;
|
|
11
|
+
} & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
+
import { forwardRef } from "react";
|
|
3
4
|
import { Popover } from "../popover/Popover.js";
|
|
4
|
-
|
|
5
|
+
const Legend = /*#__PURE__*/ forwardRef(({ items, containerClassName, ...props }, ref)=>{
|
|
5
6
|
const content = items.map((item)=>/*#__PURE__*/ jsxs("dl", {
|
|
6
7
|
className: "fwe-popover-legend-content",
|
|
7
8
|
children: [
|
|
@@ -16,7 +17,9 @@ function Legend({ items, containerClassName, ...props }) {
|
|
|
16
17
|
return /*#__PURE__*/ jsx(Popover, {
|
|
17
18
|
content: content,
|
|
18
19
|
containerClassName: classnames('fwe-popover--legend', containerClassName),
|
|
20
|
+
ref: ref,
|
|
19
21
|
...props
|
|
20
22
|
});
|
|
21
|
-
}
|
|
23
|
+
});
|
|
24
|
+
Legend.displayName = 'Legend';
|
|
22
25
|
export { Legend };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './Popover.scss';
|
|
2
2
|
import { type Placement } from '@floating-ui/react';
|
|
3
|
-
import { type MouseEvent, type
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { type MouseEvent, type ReactNode } from 'react';
|
|
4
|
+
export interface PopoverProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'content' | 'onChange'> {
|
|
5
|
+
readonly 'data-testid'?: string;
|
|
6
6
|
readonly containerClassName?: string;
|
|
7
7
|
readonly content: ReactNode;
|
|
8
8
|
readonly position?: Placement;
|
|
@@ -16,4 +16,4 @@ export interface PopoverProps extends ComponentBase {
|
|
|
16
16
|
readonly onTriggerClick?: (event: MouseEvent) => void;
|
|
17
17
|
readonly stopPropagation?: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare
|
|
19
|
+
export declare const Popover: (props: PopoverProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -2,14 +2,17 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import "./Popover.css";
|
|
3
3
|
import { FloatingArrow, FloatingPortal, arrow, autoUpdate, flip, offset, shift, useClick, useDismiss, useFloating, useHover, useInteractions } from "@floating-ui/react";
|
|
4
4
|
import classnames from "classnames";
|
|
5
|
-
import { useRef } from "react";
|
|
5
|
+
import { forwardRef, useRef } from "react";
|
|
6
6
|
import { useControlled } from "../../../utils/useControlled.js";
|
|
7
|
-
|
|
7
|
+
import { useForkRef } from "../../../utils/useForkRef.js";
|
|
8
|
+
const Popover = /*#__PURE__*/ forwardRef(({ children, className, 'data-testid': dataTestId, style, containerClassName, content, position, fallbackPositions, isOpen, openOnHover = false, openByDefault = false, onChange, flip: enableFlip = true, showArrow = true, onTriggerClick, stopPropagation = false, ...props }, ref)=>{
|
|
8
9
|
const [showPopover, setShowPopover] = useControlled({
|
|
9
10
|
controlled: isOpen,
|
|
10
11
|
default: openByDefault
|
|
11
12
|
});
|
|
12
13
|
const arrowRef = useRef(null);
|
|
14
|
+
const triggerRef = useRef(null);
|
|
15
|
+
const handleRef = useForkRef(ref, triggerRef);
|
|
13
16
|
const { refs, floatingStyles, context } = useFloating({
|
|
14
17
|
placement: position,
|
|
15
18
|
open: showPopover,
|
|
@@ -49,10 +52,15 @@ function Popover({ children, className, 'data-testid': dataTestId, containerClas
|
|
|
49
52
|
]);
|
|
50
53
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
51
54
|
children: [
|
|
52
|
-
/*#__PURE__*/ jsx("
|
|
55
|
+
/*#__PURE__*/ jsx("div", {
|
|
53
56
|
className: className,
|
|
54
|
-
|
|
57
|
+
style: style,
|
|
58
|
+
ref: (node)=>{
|
|
59
|
+
refs.setReference(node);
|
|
60
|
+
if ('function' == typeof handleRef) handleRef(node);
|
|
61
|
+
},
|
|
55
62
|
...getReferenceProps({
|
|
63
|
+
...props,
|
|
56
64
|
onClick: (event)=>{
|
|
57
65
|
if (stopPropagation) event.stopPropagation();
|
|
58
66
|
onTriggerClick?.(event);
|
|
@@ -84,5 +92,6 @@ function Popover({ children, className, 'data-testid': dataTestId, containerClas
|
|
|
84
92
|
})
|
|
85
93
|
]
|
|
86
94
|
});
|
|
87
|
-
}
|
|
95
|
+
});
|
|
96
|
+
Popover.displayName = 'Popover';
|
|
88
97
|
export { Popover };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type PopoverProps } from '../popover/Popover';
|
|
3
3
|
import { type PopoverMenuItemProps } from './popover-menu-item/PopoverMenuItem';
|
|
4
4
|
export interface PopoverMenuProps extends Omit<PopoverProps, 'content' | 'isOpen' | 'onStateChange'> {
|
|
5
5
|
readonly items: PopoverMenuItemProps[] | ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare const PopoverMenu: (props: PopoverMenuProps & {
|
|
8
|
+
children?: ReactNode | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
-
import { useMemo, useState } from "react";
|
|
3
|
+
import { forwardRef, useMemo, useState } from "react";
|
|
4
4
|
import { Popover } from "../popover/Popover.js";
|
|
5
5
|
import { PopoverMenuContext } from "./PopoverMenuContext.js";
|
|
6
6
|
import { PopoverMenuItem } from "./popover-menu-item/PopoverMenuItem.js";
|
|
7
|
-
|
|
7
|
+
const PopoverMenu = /*#__PURE__*/ forwardRef(({ items, className, containerClassName, children, ...props }, ref)=>{
|
|
8
8
|
const [showPopoverMenu, setShowPopoverMenu] = useState(false);
|
|
9
9
|
const isPopoverMenuItemPropsArray = (items)=>Array.isArray(items) && items.length > 0 && 'text' in items[0];
|
|
10
10
|
let content = null;
|
|
@@ -23,9 +23,11 @@ function PopoverMenu({ items, className, containerClassName, children, ...props
|
|
|
23
23
|
position: "right",
|
|
24
24
|
isOpen: showPopoverMenu,
|
|
25
25
|
onChange: setShowPopoverMenu,
|
|
26
|
+
ref: ref,
|
|
26
27
|
...props,
|
|
27
28
|
children: children
|
|
28
29
|
})
|
|
29
30
|
});
|
|
30
|
-
}
|
|
31
|
+
});
|
|
32
|
+
PopoverMenu.displayName = 'PopoverMenu';
|
|
31
33
|
export { PopoverMenu };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface PopoverMenuItemProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick'> {
|
|
2
3
|
readonly text: string;
|
|
3
4
|
readonly icon: React.ReactNode;
|
|
4
5
|
readonly onClick?: (data: unknown) => void;
|
|
5
6
|
readonly data?: unknown;
|
|
6
7
|
}
|
|
7
|
-
export declare
|
|
8
|
+
export declare const PopoverMenuItem: (props: PopoverMenuItemProps & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext } from "react";
|
|
2
|
+
import { forwardRef, useContext } from "react";
|
|
3
3
|
import { IconWrapper } from "../../../icon-wrapper/IconWrapper.js";
|
|
4
4
|
import { PopoverMenuContext } from "../PopoverMenuContext.js";
|
|
5
|
-
|
|
5
|
+
const PopoverMenuItem = /*#__PURE__*/ forwardRef(({ text, icon, onClick, data, className, ...props }, ref)=>{
|
|
6
6
|
const { setShowPopoverMenu } = useContext(PopoverMenuContext);
|
|
7
7
|
function handleClick(e) {
|
|
8
8
|
e?.preventDefault();
|
|
@@ -12,7 +12,10 @@ function PopoverMenuItem({ text, icon, onClick, data }) {
|
|
|
12
12
|
}
|
|
13
13
|
return /*#__PURE__*/ jsxs("button", {
|
|
14
14
|
type: "button",
|
|
15
|
+
className: className,
|
|
15
16
|
onClick: handleClick,
|
|
17
|
+
ref: ref,
|
|
18
|
+
...props,
|
|
16
19
|
children: [
|
|
17
20
|
/*#__PURE__*/ jsx(IconWrapper, {
|
|
18
21
|
icon: icon
|
|
@@ -23,5 +26,6 @@ function PopoverMenuItem({ text, icon, onClick, data }) {
|
|
|
23
26
|
})
|
|
24
27
|
]
|
|
25
28
|
});
|
|
26
|
-
}
|
|
29
|
+
});
|
|
30
|
+
PopoverMenuItem.displayName = 'PopoverMenuItem';
|
|
27
31
|
export { PopoverMenuItem };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react';
|
|
2
1
|
import type { PopoverProps } from '../popover/Popover';
|
|
3
2
|
export interface TooltipProps extends Omit<PopoverProps, 'openOnHover'> {
|
|
4
3
|
}
|
|
5
|
-
export declare
|
|
4
|
+
export declare const Tooltip: (props: TooltipProps & {
|
|
5
|
+
children?: import("react").ReactNode | undefined;
|
|
6
|
+
} & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import { Popover } from "../popover/Popover.js";
|
|
3
|
-
|
|
4
|
-
return /*#__PURE__*/ jsx(Popover, {
|
|
4
|
+
const Tooltip = /*#__PURE__*/ forwardRef(({ content, children, ...props }, ref)=>/*#__PURE__*/ jsx(Popover, {
|
|
5
5
|
position: "bottom",
|
|
6
6
|
openOnHover: true,
|
|
7
7
|
content: content,
|
|
8
|
+
ref: ref,
|
|
8
9
|
...props,
|
|
9
10
|
children: children
|
|
10
|
-
});
|
|
11
|
-
|
|
11
|
+
}));
|
|
12
|
+
Tooltip.displayName = 'Tooltip';
|
|
12
13
|
export { Tooltip };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export interface ProgressProps extends ClassNameProps {
|
|
1
|
+
export interface ProgressProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
2
|
readonly progress: number;
|
|
4
3
|
readonly background?: 'white' | 'black' | 'background';
|
|
5
4
|
readonly error?: boolean;
|
|
6
5
|
}
|
|
7
|
-
export declare
|
|
6
|
+
export declare const Progress: (props: ProgressProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
-
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
const Progress = /*#__PURE__*/ forwardRef(({ background = 'white', error = false, progress, className, ...props }, ref)=>{
|
|
4
5
|
const classes = classnames('fwe-progress-bar', {
|
|
5
6
|
'fwe-bg-red': error
|
|
6
7
|
}, {
|
|
@@ -10,6 +11,8 @@ function Progress({ background = 'white', error = false, progress, className })
|
|
|
10
11
|
});
|
|
11
12
|
return /*#__PURE__*/ jsx("div", {
|
|
12
13
|
className: classnames('fwe-progress', className),
|
|
14
|
+
ref: ref,
|
|
15
|
+
...props,
|
|
13
16
|
children: /*#__PURE__*/ jsx("div", {
|
|
14
17
|
className: classes,
|
|
15
18
|
role: "progressbar",
|
|
@@ -22,5 +25,6 @@ function Progress({ background = 'white', error = false, progress, className })
|
|
|
22
25
|
"aria-label": "progressbar"
|
|
23
26
|
})
|
|
24
27
|
});
|
|
25
|
-
}
|
|
28
|
+
});
|
|
29
|
+
Progress.displayName = 'Progress';
|
|
26
30
|
export { Progress };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function ClearButton(props: ComponentPropsWithoutRef<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const ClearButton: (props: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
const ClearButton = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx("button", {
|
|
4
4
|
type: "button",
|
|
5
5
|
className: "fwe-clear-icon fr-search-input-clear-button",
|
|
6
6
|
"aria-label": "Clear",
|
|
7
|
+
ref: ref,
|
|
7
8
|
...props
|
|
8
|
-
});
|
|
9
|
-
|
|
9
|
+
}));
|
|
10
|
+
ClearButton.displayName = 'ClearButton';
|
|
10
11
|
export { ClearButton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './SearchInput.scss';
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
3
|
import type { SearchSuggestion } from './SearchSuggestion';
|
|
3
|
-
export interface SearchInputProps {
|
|
4
|
-
readonly disabled?: boolean;
|
|
4
|
+
export interface SearchInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'onChange' | 'value' | 'defaultValue'> {
|
|
5
5
|
readonly label?: string;
|
|
6
6
|
readonly defaultValue?: string;
|
|
7
7
|
readonly value?: string;
|
|
@@ -9,6 +9,5 @@ export interface SearchInputProps {
|
|
|
9
9
|
readonly onChange?: (value: string) => void;
|
|
10
10
|
readonly onKeyboardNavigate?: (value: string) => void;
|
|
11
11
|
readonly onSearch?: (value: string) => void;
|
|
12
|
-
readonly className?: string;
|
|
13
12
|
}
|
|
14
|
-
export declare
|
|
13
|
+
export declare const SearchInput: (props: SearchInputProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "./SearchInput.css";
|
|
3
3
|
import classnames from "classnames";
|
|
4
|
-
import { useRef } from "react";
|
|
4
|
+
import { forwardRef, useRef } from "react";
|
|
5
|
+
import { useForkRef } from "../../utils/useForkRef.js";
|
|
5
6
|
import { useOnClickOutside } from "../../utils/useOnClickOutside.js";
|
|
6
7
|
import { ClearButton } from "./ClearButton.js";
|
|
7
8
|
import { useSearchInput } from "./useSearchInput.js";
|
|
8
|
-
|
|
9
|
+
const SearchInput = /*#__PURE__*/ forwardRef(({ defaultValue, disabled, label, value, suggestions, onChange, onSearch, onKeyboardNavigate, className, ...props }, ref)=>{
|
|
9
10
|
const inputRef = useRef(null);
|
|
10
11
|
const containerRef = useRef(null);
|
|
12
|
+
const handleRef = useForkRef(ref, containerRef);
|
|
11
13
|
const cappedSuggestions = suggestions?.slice(0, 10) ?? [];
|
|
12
14
|
const { handleFocus, handleInput, handleClearQuery, handleSuggestionClick, handleOutsideClick, handleKeyDown, hideSuggestionList, selectedSuggestionIndex, innerValue } = useSearchInput(inputRef, cappedSuggestions, value, defaultValue, onChange, onSearch, onKeyboardNavigate);
|
|
13
15
|
useOnClickOutside(containerRef, handleOutsideClick);
|
|
14
16
|
return /*#__PURE__*/ jsxs("div", {
|
|
15
17
|
className: classnames('fwe-search-input', className),
|
|
16
|
-
ref:
|
|
18
|
+
ref: handleRef,
|
|
17
19
|
children: [
|
|
18
20
|
/*#__PURE__*/ jsx("input", {
|
|
19
21
|
ref: inputRef,
|
|
@@ -24,7 +26,8 @@ function SearchInput({ defaultValue, disabled, label, value, suggestions, onChan
|
|
|
24
26
|
"aria-label": "Search",
|
|
25
27
|
onInput: handleInput,
|
|
26
28
|
onKeyDown: handleKeyDown,
|
|
27
|
-
value: innerValue
|
|
29
|
+
value: innerValue,
|
|
30
|
+
...props
|
|
28
31
|
}),
|
|
29
32
|
/*#__PURE__*/ jsx("div", {
|
|
30
33
|
className: "fwe-search-icon"
|
|
@@ -57,5 +60,6 @@ function SearchInput({ defaultValue, disabled, label, value, suggestions, onChan
|
|
|
57
60
|
})
|
|
58
61
|
]
|
|
59
62
|
});
|
|
60
|
-
}
|
|
63
|
+
});
|
|
64
|
+
SearchInput.displayName = 'SearchInput';
|
|
61
65
|
export { SearchInput };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './Snackbar.scss';
|
|
2
|
-
|
|
3
|
-
export interface SnackbarConfig extends ClassNameProps {
|
|
2
|
+
export interface SnackbarConfig {
|
|
4
3
|
type?: 'info' | 'warning' | 'error';
|
|
5
4
|
variant?: 'a' | 'b' | 'c';
|
|
6
5
|
darkBackground?: boolean;
|
|
@@ -8,14 +7,15 @@ export interface SnackbarConfig extends ClassNameProps {
|
|
|
8
7
|
action?: string;
|
|
9
8
|
disappearAfter?: number | null;
|
|
10
9
|
key?: string | number;
|
|
10
|
+
'data-testid'?: string;
|
|
11
11
|
}
|
|
12
12
|
export interface SnackbarData extends SnackbarConfig {
|
|
13
13
|
text: string;
|
|
14
14
|
}
|
|
15
|
-
export interface SnackbarProps {
|
|
15
|
+
export interface SnackbarProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
16
16
|
readonly data?: SnackbarData;
|
|
17
17
|
readonly onAction?: () => void;
|
|
18
18
|
readonly onClose?: () => void;
|
|
19
19
|
readonly first?: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare
|
|
21
|
+
export declare const Snackbar: (props: SnackbarProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|