@festo-ui/react 8.2.0-dev.582 → 8.2.0-dev.584
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +1 -1
- package/index.d.ts +63 -63
- package/lib/components/accordion/Accordion.d.ts +3 -3
- package/lib/components/accordion/Accordion.js +6 -6
- package/lib/components/accordion/AccordionContext.js +1 -1
- package/lib/components/accordion/accordion-header/AccordionHeader.d.ts +1 -1
- package/lib/components/accordion/accordion-header/AccordionHeader.js +3 -3
- package/lib/components/accordion/accordion-item/AccordionItem.d.ts +3 -3
- package/lib/components/accordion/accordion-item/AccordionItem.js +6 -6
- package/lib/components/accordion/accordion-item/AccordionItemContext.js +1 -1
- package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +1 -1
- package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +7 -7
- package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +1 -1
- package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +5 -5
- package/lib/components/bottom-sheet/BottomSheet.d.ts +1 -1
- package/lib/components/bottom-sheet/BottomSheet.js +11 -11
- package/lib/components/bottom-sheet/BottomSheet.stories.d.ts +2 -2
- package/lib/components/bottom-sheet/BottomSheet.stories.js +3 -3
- package/lib/components/breadcrumb/Breadcrumb.d.ts +2 -2
- package/lib/components/breadcrumb/Breadcrumb.js +4 -4
- package/lib/components/buttons/button/Button.d.ts +2 -2
- package/lib/components/buttons/button/Button.js +10 -10
- package/lib/components/buttons/button/Button.stories.d.ts +2 -2
- package/lib/components/buttons/button/Button.stories.js +10 -10
- package/lib/components/card/Card.d.ts +1 -1
- package/lib/components/card/Card.js +2 -2
- package/lib/components/card/CardBody.d.ts +1 -1
- package/lib/components/card/CardBody.js +2 -2
- package/lib/components/card/CardHeader.d.ts +1 -1
- package/lib/components/card/CardHeader.js +3 -3
- package/lib/components/card/CardHeader.stories.helper.d.ts +1 -1
- package/lib/components/card/CardHeader.stories.helper.js +2 -2
- package/lib/components/card/CardNotification.d.ts +1 -1
- package/lib/components/chips/chip/Chip.d.ts +1 -1
- package/lib/components/chips/chip/Chip.js +8 -8
- package/lib/components/chips/chip-container/ChipContainer.d.ts +1 -1
- package/lib/components/chips/chip-container/ChipContainer.js +3 -3
- package/lib/components/icon-wrapper/IconWrapper.js +2 -2
- package/lib/components/link-button/LinkButton.d.ts +2 -2
- package/lib/components/link-button/LinkButton.js +5 -5
- package/lib/components/loading-indicator/LoadingIndicator.d.ts +4 -4
- package/lib/components/loading-indicator/LoadingIndicator.js +8 -8
- package/lib/components/mobile-flyout/MobileFlyout.d.ts +2 -2
- package/lib/components/mobile-flyout/MobileFlyout.js +7 -7
- package/lib/components/mobile-flyout/MobileFlyoutContext.js +1 -1
- package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.d.ts +2 -2
- package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +5 -5
- package/lib/components/modals/AlertModal.d.ts +3 -3
- package/lib/components/modals/AlertModal.js +10 -10
- package/lib/components/modals/ConfirmModal.d.ts +2 -2
- package/lib/components/modals/ConfirmModal.js +3 -3
- package/lib/components/modals/CustomModal.d.ts +1 -1
- package/lib/components/modals/CustomModal.js +3 -3
- package/lib/components/modals/Modal.d.ts +4 -4
- package/lib/components/modals/Modal.js +1 -1
- package/lib/components/modals/ModalBase.d.ts +2 -2
- package/lib/components/modals/ModalBase.js +9 -9
- package/lib/components/modals/ModalFooter.d.ts +1 -1
- package/lib/components/modals/ModalFooter.js +4 -4
- package/lib/components/modals/Prompt.d.ts +3 -3
- package/lib/components/modals/Prompt.js +1 -1
- package/lib/components/modals/image-gallery/ImageGallery.d.ts +5 -5
- package/lib/components/modals/image-gallery/ImageGallery.helper.d.ts +1 -1
- package/lib/components/modals/image-gallery/ImageGallery.helper.js +2 -2
- package/lib/components/modals/image-gallery/ImageGallery.js +3 -3
- package/lib/components/modals/image-gallery/ImageGallery.stories.helper.d.ts +1 -1
- package/lib/components/modals/image-gallery/ImageGallery.stories.helper.js +29 -29
- package/lib/components/modals/image-gallery/ImageGalleryContext.d.ts +1 -1
- package/lib/components/modals/image-gallery/ImageGalleryContext.js +1 -1
- package/lib/components/modals/image-gallery/ImageGallerySwiper.js +6 -6
- package/lib/components/modals/image-gallery/ImageGalleryThumbsSwiper.js +3 -3
- package/lib/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.d.ts +2 -2
- package/lib/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.js +8 -8
- package/lib/components/modals/image-gallery/internal/BaseGallery.d.ts +4 -4
- package/lib/components/modals/image-gallery/internal/BaseGallery.js +1 -1
- package/lib/components/modals/image-gallery/internal/CloseButton.js +4 -4
- package/lib/components/modals/image-gallery/internal/ScaleButton.js +1 -1
- package/lib/components/pagination/Pagination.d.ts +2 -2
- package/lib/components/pagination/Pagination.js +14 -14
- package/lib/components/popovers/legend/Legend.d.ts +3 -3
- package/lib/components/popovers/popover/Popover.d.ts +4 -4
- package/lib/components/popovers/popover/Popover.js +11 -11
- package/lib/components/popovers/popover-menu/PopoverMenu.d.ts +3 -3
- package/lib/components/popovers/popover-menu/PopoverMenu.js +3 -3
- package/lib/components/popovers/tooltip/Tooltip.d.ts +1 -1
- package/lib/components/progress/Progress.d.ts +2 -2
- package/lib/components/progress/Progress.js +7 -7
- package/lib/components/scroll-area/ScrollArea.d.ts +1 -1
- package/lib/components/scroll-area/ScrollArea.js +1 -1
- package/lib/components/search-input/ClearButton.d.ts +2 -2
- package/lib/components/search-input/SearchInput.d.ts +2 -2
- package/lib/components/search-input/SearchInput.js +2 -2
- package/lib/components/search-input/useSearchInput.d.ts +2 -2
- package/lib/components/search-input/useSearchInput.js +7 -7
- package/lib/components/snackbar/Snackbar.d.ts +4 -4
- package/lib/components/snackbar/Snackbar.js +11 -11
- package/lib/components/snackbar/SnackbarContext.d.ts +2 -2
- package/lib/components/snackbar/SnackbarContext.js +1 -1
- package/lib/components/snackbar/SnackbarProvider.d.ts +2 -2
- package/lib/components/snackbar/SnackbarProvider.js +3 -3
- package/lib/components/snackbar/useSnackbar.d.ts +1 -1
- package/lib/components/snackbar/useSnackbar.js +1 -1
- package/lib/components/stepper-horizontal/StepperHorizontal.d.ts +2 -2
- package/lib/components/stepper-horizontal/StepperHorizontal.js +7 -7
- package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +3 -3
- package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.js +3 -3
- package/lib/components/stepper-vertical/StepperVertical.d.ts +2 -2
- package/lib/components/stepper-vertical/StepperVertical.js +3 -3
- package/lib/components/stepper-vertical/step-vertical/StepVertical.d.ts +3 -3
- package/lib/components/stepper-vertical/step-vertical/StepVertical.js +9 -9
- package/lib/components/tab/Tabs.d.ts +5 -5
- package/lib/components/tab/Tabs.js +24 -24
- package/lib/components/tab/tab-pane/TabPane.d.ts +3 -3
- package/lib/components/tab/tab-pane/TabPane.js +3 -3
- package/lib/components/tab/useTabScroll.d.ts +1 -1
- package/lib/components/tab/useTabScroll.js +11 -11
- package/lib/components/table-header-cell/TableHeaderCell.js +6 -6
- package/lib/forms/checkbox/Checkbox.d.ts +4 -4
- package/lib/forms/checkbox/Checkbox.js +11 -11
- package/lib/forms/color-indicator/ColorIndicator.d.ts +2 -2
- package/lib/forms/color-indicator/ColorIndicator.js +6 -6
- package/lib/forms/color-picker/ColorHelper.d.ts +4 -4
- package/lib/forms/radio/RadioButton.d.ts +2 -2
- package/lib/forms/radio/RadioButton.js +8 -8
- package/lib/forms/radio/RadioGroup.d.ts +3 -3
- package/lib/forms/radio/RadioGroup.js +3 -3
- package/lib/forms/radio/RadioGroupContext.d.ts +1 -1
- package/lib/forms/radio/RadioGroupContext.js +1 -1
- package/lib/forms/segment/Segment.d.ts +2 -2
- package/lib/forms/segment/Segment.js +7 -7
- package/lib/forms/segment/segment-control/SegmentControl.d.ts +2 -2
- package/lib/forms/segment/segment-control/SegmentControl.js +8 -8
- package/lib/forms/select/Select.d.ts +5 -5
- package/lib/forms/select/Select.js +3 -3
- package/lib/forms/select/internal/HiddenInput.d.ts +1 -1
- package/lib/forms/select/internal/ListItem.d.ts +3 -3
- package/lib/forms/select/internal/ListItem.js +11 -11
- package/lib/forms/select/internal/SelectButton.js +9 -9
- package/lib/forms/select/internal/SelectCheckbox.d.ts +1 -1
- package/lib/forms/select/internal/SelectLabel.js +4 -4
- package/lib/forms/select/internal/SelectScrollContainer.d.ts +1 -1
- package/lib/forms/select/internal/SelectWrapper.d.ts +2 -2
- package/lib/forms/select/internal/SelectWrapper.js +4 -4
- package/lib/forms/select/internal/index.d.ts +6 -6
- package/lib/forms/select/internal/utils.d.ts +2 -2
- package/lib/forms/select/internal/utils.js +3 -3
- package/lib/forms/select/select-option/SelectOption.d.ts +2 -2
- package/lib/forms/select/select-option/SelectOption.js +1 -1
- package/lib/forms/select/utils.d.ts +1 -1
- package/lib/forms/slider/Slider.d.ts +3 -3
- package/lib/forms/slider/Slider.js +9 -9
- package/lib/forms/switch/Switch.d.ts +2 -2
- package/lib/forms/switch/Switch.js +4 -4
- package/lib/forms/text-area/TextArea.d.ts +3 -3
- package/lib/forms/text-area/TextArea.js +12 -12
- package/lib/forms/text-editor/TextEditor.d.ts +1 -1
- package/lib/forms/text-editor/TextEditor.js +42 -38
- package/lib/forms/text-editor/TextEditorButton.d.ts +3 -2
- package/lib/forms/text-editor/TextEditorButton.js +13 -13
- package/lib/forms/text-input/TextInput.d.ts +1 -1
- package/lib/forms/text-input/TextInput.js +6 -6
- package/lib/forms/time-picker/time-picker-dropdown/TimePickerInput.d.ts +1 -1
- package/lib/forms/time-picker/time-picker-dropdown/TimePickerInput.js +2 -2
- package/lib/helper/index.js +2 -2
- package/lib/helper/setRef.js +1 -1
- package/lib/helper/types.d.ts +2 -2
- package/lib/helper/useControlled.d.ts +1 -1
- package/lib/helper/useControlled.js +2 -2
- package/lib/helper/useForkRef.d.ts +1 -1
- package/lib/helper/useForkRef.js +1 -1
- package/lib/helper/useId.js +2 -2
- package/lib/helper/useOnClickOutside.d.ts +1 -1
- package/lib/helper/useOnClickOutside.js +5 -5
- package/node/lib/components/accordion/Accordion.js +4 -4
- package/node/lib/components/accordion/accordion-header/AccordionHeader.js +1 -1
- package/node/lib/components/accordion/accordion-item/AccordionItem.js +4 -4
- package/node/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +4 -4
- package/node/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +3 -3
- package/node/lib/components/bottom-sheet/BottomSheet.js +9 -9
- package/node/lib/components/bottom-sheet/BottomSheet.stories.js +2 -2
- package/node/lib/components/breadcrumb/Breadcrumb.js +2 -2
- package/node/lib/components/buttons/button/Button.js +8 -8
- package/node/lib/components/buttons/button/Button.stories.js +9 -9
- package/node/lib/components/card/Card.js +1 -1
- package/node/lib/components/card/CardBody.js +1 -1
- package/node/lib/components/card/CardHeader.js +2 -2
- package/node/lib/components/card/CardHeader.stories.helper.js +2 -2
- package/node/lib/components/chips/chip/Chip.js +7 -7
- package/node/lib/components/chips/chip-container/ChipContainer.js +2 -2
- package/node/lib/components/icon-wrapper/IconWrapper.js +2 -2
- package/node/lib/components/link-button/LinkButton.js +3 -3
- package/node/lib/components/loading-indicator/LoadingIndicator.js +6 -6
- package/node/lib/components/mobile-flyout/MobileFlyout.js +5 -5
- package/node/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +3 -3
- package/node/lib/components/modals/AlertModal.js +9 -9
- package/node/lib/components/modals/ConfirmModal.js +2 -2
- package/node/lib/components/modals/CustomModal.js +1 -1
- package/node/lib/components/modals/ModalBase.js +4 -4
- package/node/lib/components/modals/ModalFooter.js +2 -2
- package/node/lib/components/modals/image-gallery/ImageGallery.helper.js +1 -1
- package/node/lib/components/modals/image-gallery/ImageGallery.js +2 -2
- package/node/lib/components/modals/image-gallery/ImageGallery.stories.helper.js +29 -29
- package/node/lib/components/modals/image-gallery/ImageGallerySwiper.js +3 -3
- package/node/lib/components/modals/image-gallery/image-gallery-item/ImageGalleryItem.js +5 -5
- package/node/lib/components/modals/image-gallery/internal/CloseButton.js +3 -3
- package/node/lib/components/pagination/Pagination.js +12 -12
- package/node/lib/components/popovers/popover/Popover.js +8 -8
- package/node/lib/components/popovers/popover-menu/PopoverMenu.js +1 -1
- package/node/lib/components/progress/Progress.js +6 -6
- package/node/lib/components/search-input/SearchInput.js +1 -1
- package/node/lib/components/search-input/useSearchInput.js +6 -6
- package/node/lib/components/snackbar/Snackbar.js +8 -8
- package/node/lib/components/snackbar/SnackbarProvider.js +1 -1
- package/node/lib/components/stepper-horizontal/StepperHorizontal.js +5 -5
- package/node/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.js +1 -1
- package/node/lib/components/stepper-vertical/StepperVertical.js +1 -1
- package/node/lib/components/stepper-vertical/step-vertical/StepVertical.js +7 -7
- package/node/lib/components/tab/Tabs.js +22 -22
- package/node/lib/components/tab/tab-pane/TabPane.js +2 -2
- package/node/lib/components/tab/useTabScroll.js +10 -10
- package/node/lib/components/table-header-cell/TableHeaderCell.js +4 -4
- package/node/lib/forms/checkbox/Checkbox.js +9 -9
- package/node/lib/forms/color-indicator/ColorIndicator.js +4 -4
- package/node/lib/forms/radio/RadioButton.js +6 -6
- package/node/lib/forms/radio/RadioGroup.js +1 -1
- package/node/lib/forms/segment/Segment.js +5 -5
- package/node/lib/forms/segment/segment-control/SegmentControl.js +6 -6
- package/node/lib/forms/select/Select.js +1 -1
- package/node/lib/forms/select/internal/ListItem.js +9 -9
- package/node/lib/forms/select/internal/SelectButton.js +7 -7
- package/node/lib/forms/select/internal/SelectLabel.js +3 -3
- package/node/lib/forms/select/internal/SelectWrapper.js +2 -2
- package/node/lib/forms/select/internal/utils.js +1 -1
- package/node/lib/forms/slider/Slider.js +7 -7
- package/node/lib/forms/switch/Switch.js +3 -3
- package/node/lib/forms/text-area/TextArea.js +10 -10
- package/node/lib/forms/text-editor/TextEditor.js +39 -35
- package/node/lib/forms/text-editor/TextEditorButton.js +11 -11
- package/node/lib/forms/text-input/TextInput.js +4 -4
- package/node/lib/forms/time-picker/time-picker-dropdown/TimePickerInput.js +1 -1
- package/node/lib/helper/index.js +2 -2
- package/node/lib/helper/setRef.js +1 -1
- package/node/lib/helper/useControlled.js +1 -1
- package/node/lib/helper/useId.js +1 -1
- package/node/lib/helper/useOnClickOutside.js +4 -4
- package/package.json +1 -1
|
@@ -15,13 +15,13 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
15
15
|
scrollArea
|
|
16
16
|
} = refs;
|
|
17
17
|
const [style, setStyle] = (0, _react.useState)({});
|
|
18
|
-
const [classes, setClasses] = (0, _react.useState)(
|
|
18
|
+
const [classes, setClasses] = (0, _react.useState)("");
|
|
19
19
|
function getScrollContentStyleValue(propName) {
|
|
20
|
-
return scrollContent.current ? window.getComputedStyle(scrollContent.current).getPropertyValue(propName) :
|
|
20
|
+
return scrollContent.current ? window.getComputedStyle(scrollContent.current).getPropertyValue(propName) : "";
|
|
21
21
|
}
|
|
22
22
|
function calculateCurrentTranslateX() {
|
|
23
|
-
const transformValue = getScrollContentStyleValue(
|
|
24
|
-
if (transformValue ===
|
|
23
|
+
const transformValue = getScrollContentStyleValue("transform");
|
|
24
|
+
if (transformValue === "none") {
|
|
25
25
|
return 0;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -34,7 +34,7 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
34
34
|
const matrixParams = match[1];
|
|
35
35
|
// we need value of tx -> translateX
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
|
-
const [a, b, c, d, tx, ty] = matrixParams.split(
|
|
37
|
+
const [a, b, c, d, tx, ty] = matrixParams.split(",");
|
|
38
38
|
return parseFloat(tx);
|
|
39
39
|
}
|
|
40
40
|
function getScrollPosition() {
|
|
@@ -71,9 +71,9 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
71
71
|
}
|
|
72
72
|
function stopScrollAnimation() {
|
|
73
73
|
const currentScrollPosition = getAnimatingScrollPosition();
|
|
74
|
-
setClasses(
|
|
74
|
+
setClasses("");
|
|
75
75
|
setStyle({
|
|
76
|
-
transform:
|
|
76
|
+
transform: "translateX(0px)"
|
|
77
77
|
});
|
|
78
78
|
if (scrollArea.current) {
|
|
79
79
|
scrollArea.current.scrollLeft = currentScrollPosition;
|
|
@@ -100,9 +100,9 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
100
100
|
scrollArea.current.getBoundingClientRect();
|
|
101
101
|
}
|
|
102
102
|
requestAnimationFrame(() => {
|
|
103
|
-
setClasses(
|
|
103
|
+
setClasses("fr-tab-scroller--animating");
|
|
104
104
|
setStyle({
|
|
105
|
-
transform:
|
|
105
|
+
transform: "none"
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
}
|
|
@@ -117,7 +117,7 @@ const useTabScroll = (tabLength, componentId, refs) => {
|
|
|
117
117
|
function computeDimensions(tab) {
|
|
118
118
|
const rootWidth = tab.offsetWidth;
|
|
119
119
|
const rootLeft = tab.offsetLeft;
|
|
120
|
-
const tabContent = tab.querySelector(
|
|
120
|
+
const tabContent = tab.querySelector(".fr-tab-content");
|
|
121
121
|
const contentWidth = tabContent?.offsetWidth ?? 0;
|
|
122
122
|
const contentLeft = tabContent?.offsetLeft ?? 0;
|
|
123
123
|
return {
|
|
@@ -22,12 +22,12 @@ const TableHeaderCell = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
22
22
|
}
|
|
23
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
24
24
|
...props,
|
|
25
|
-
className: (0, _classnames.default)(
|
|
26
|
-
|
|
25
|
+
className: (0, _classnames.default)("fwe-table-order", {
|
|
26
|
+
"fwe-active": active
|
|
27
27
|
}, {
|
|
28
|
-
|
|
28
|
+
"fwe-table-order-ascending": active && ascending
|
|
29
29
|
}, {
|
|
30
|
-
|
|
30
|
+
"fwe-table-order-descending": active && !ascending
|
|
31
31
|
}, className),
|
|
32
32
|
onClick: handleClick,
|
|
33
33
|
ref: ref
|
|
@@ -18,7 +18,7 @@ function Checkbox(_ref) {
|
|
|
18
18
|
name,
|
|
19
19
|
large = false,
|
|
20
20
|
valid = true,
|
|
21
|
-
labelPosition =
|
|
21
|
+
labelPosition = "after",
|
|
22
22
|
required,
|
|
23
23
|
disabled = false,
|
|
24
24
|
indeterminate = false,
|
|
@@ -35,20 +35,20 @@ function Checkbox(_ref) {
|
|
|
35
35
|
setChecked(newChecked);
|
|
36
36
|
onChange?.(newChecked, e);
|
|
37
37
|
};
|
|
38
|
-
const containerClasses = (0, _classnames.default)(
|
|
39
|
-
|
|
38
|
+
const containerClasses = (0, _classnames.default)("fwe-checkbox-container", {
|
|
39
|
+
"fr-checkbox-large": large
|
|
40
40
|
}, {
|
|
41
|
-
|
|
41
|
+
"fr-checkbox-invalid": !valid || required
|
|
42
42
|
}, {
|
|
43
|
-
|
|
43
|
+
"fwe-disabled": disabled
|
|
44
44
|
}, {
|
|
45
|
-
|
|
45
|
+
"fwe-checked": isChecked
|
|
46
46
|
}, {
|
|
47
|
-
|
|
47
|
+
"fwe-label-below": labelPosition === "below"
|
|
48
48
|
}, {
|
|
49
|
-
|
|
49
|
+
"fwe-label-before": labelPosition === "before"
|
|
50
50
|
}, {
|
|
51
|
-
|
|
51
|
+
"fr-checkbox-indeterminate": indeterminate
|
|
52
52
|
}, className);
|
|
53
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
54
54
|
className: containerClasses,
|
|
@@ -21,11 +21,11 @@ function ColorIndicator(_ref) {
|
|
|
21
21
|
children,
|
|
22
22
|
disabled
|
|
23
23
|
} = _ref;
|
|
24
|
-
const classes = (0, _classnames.default)(
|
|
24
|
+
const classes = (0, _classnames.default)("fwe-color-indicator", className, disabled);
|
|
25
25
|
const [isEditorOpen, setEditorOpen] = (0, _react.useState)(false);
|
|
26
26
|
function getBorderColor() {
|
|
27
|
-
if (!color || color.toUpperCase() ===
|
|
28
|
-
return
|
|
27
|
+
if (!color || color.toUpperCase() === "#FFFFFF" || color.toUpperCase() === "#F0F2F3") {
|
|
28
|
+
return "#b6bec6"; // = $control-border
|
|
29
29
|
}
|
|
30
30
|
return color;
|
|
31
31
|
}
|
|
@@ -108,7 +108,7 @@ function ColorIndicator(_ref) {
|
|
|
108
108
|
children: [wrapperChildren, " ", text && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
109
109
|
className: "fwe-color-indicator-text",
|
|
110
110
|
children: text
|
|
111
|
-
}),
|
|
111
|
+
}), " "]
|
|
112
112
|
})]
|
|
113
113
|
});
|
|
114
114
|
return showPopOver ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
@@ -18,7 +18,7 @@ function Radio(props) {
|
|
|
18
18
|
name,
|
|
19
19
|
defaultChecked: defaultCheckedProp,
|
|
20
20
|
checked,
|
|
21
|
-
labelPosition =
|
|
21
|
+
labelPosition = "after",
|
|
22
22
|
large = false,
|
|
23
23
|
disabled = false,
|
|
24
24
|
required = false,
|
|
@@ -36,12 +36,12 @@ function Radio(props) {
|
|
|
36
36
|
isControlled
|
|
37
37
|
} = (0, _react.useContext)(_RadioGroupContext.default);
|
|
38
38
|
const innerLabelPosition = groupLabelPosition ?? labelPosition;
|
|
39
|
-
const classes = (0, _classnames.default)(
|
|
40
|
-
|
|
39
|
+
const classes = (0, _classnames.default)("fwe-radio", {
|
|
40
|
+
"fwe-radio-label-below": innerLabelPosition === "below"
|
|
41
41
|
}, {
|
|
42
|
-
|
|
42
|
+
"fwe-radio-label-before": innerLabelPosition === "before"
|
|
43
43
|
}, {
|
|
44
|
-
|
|
44
|
+
"fwe-radio-lg": large || groupLarge
|
|
45
45
|
}, className);
|
|
46
46
|
const controlledChecked = checked !== undefined || isControlled && groupValue !== undefined ? Boolean(checked || groupValue === value) : undefined;
|
|
47
47
|
const getDefaultChecked = () => {
|
|
@@ -82,7 +82,7 @@ function Radio(props) {
|
|
|
82
82
|
required: required || groupRequired
|
|
83
83
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
84
84
|
className: "fwe-radio-checkmark"
|
|
85
|
-
}),
|
|
85
|
+
}), " "]
|
|
86
86
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
87
87
|
className: "fwe-radio-label-content",
|
|
88
88
|
children: children
|
|
@@ -48,7 +48,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
48
48
|
value: contextValue,
|
|
49
49
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
50
50
|
ref: ref,
|
|
51
|
-
className: (0, _classnames.default)(
|
|
51
|
+
className: (0, _classnames.default)("fwe-radio-group", className),
|
|
52
52
|
role: "radiogroup",
|
|
53
53
|
...props,
|
|
54
54
|
children: children
|
|
@@ -28,7 +28,7 @@ function Segment(props) {
|
|
|
28
28
|
};
|
|
29
29
|
let useIcon = false;
|
|
30
30
|
let useIconAndText = false;
|
|
31
|
-
let tmpValue =
|
|
31
|
+
let tmpValue = "";
|
|
32
32
|
_react.default.Children.forEach(children, (child, index) => {
|
|
33
33
|
if (! /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
34
34
|
return null;
|
|
@@ -56,10 +56,10 @@ function Segment(props) {
|
|
|
56
56
|
setValue(_value);
|
|
57
57
|
};
|
|
58
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("fieldset", {
|
|
59
|
-
className: (0, _classnames.default)(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
className: (0, _classnames.default)("fwe-segment", {
|
|
60
|
+
"fwe-segment-outline": innerConfig.outline,
|
|
61
|
+
"fwe-segment-icon": useIcon,
|
|
62
|
+
"fwe-segment-icon-text": useIconAndText
|
|
63
63
|
}, className),
|
|
64
64
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("legend", {
|
|
65
65
|
className: "fwe-sr-only fwe-d-inline-block",
|
|
@@ -24,10 +24,10 @@ function SegmentControl(props) {
|
|
|
24
24
|
className,
|
|
25
25
|
iconOnly
|
|
26
26
|
} = props;
|
|
27
|
-
const componentId = (0, _react.useRef)(id ?? (Math.random() * Date.now()).toString().replace(
|
|
28
|
-
let viewMode =
|
|
27
|
+
const componentId = (0, _react.useRef)(id ?? (Math.random() * Date.now()).toString().replace(".", "-"));
|
|
28
|
+
let viewMode = "text";
|
|
29
29
|
if (icon) {
|
|
30
|
-
viewMode = iconOnly ?
|
|
30
|
+
viewMode = iconOnly ? "icon" : "icon-text";
|
|
31
31
|
}
|
|
32
32
|
const handleChange = event => {
|
|
33
33
|
if (onChange) {
|
|
@@ -45,16 +45,16 @@ function SegmentControl(props) {
|
|
|
45
45
|
disabled: disabled,
|
|
46
46
|
onChange: e => handleChange(e)
|
|
47
47
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
48
|
-
className: (0, _classnames.default)(
|
|
48
|
+
className: (0, _classnames.default)("fwe-segment-label", className),
|
|
49
49
|
htmlFor: componentId.current,
|
|
50
|
-
children: [viewMode ===
|
|
50
|
+
children: [viewMode === "icon" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
51
51
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
52
52
|
className: "fwe-sr-only",
|
|
53
53
|
children: label
|
|
54
54
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconWrapper.default, {
|
|
55
55
|
icon: icon
|
|
56
56
|
})]
|
|
57
|
-
}), viewMode ===
|
|
57
|
+
}), viewMode === "text" && label, viewMode === "icon-text" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
58
58
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconWrapper.default, {
|
|
59
59
|
icon: icon
|
|
60
60
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
@@ -14,7 +14,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
function SelectComponent(_ref, ref) {
|
|
16
16
|
let {
|
|
17
|
-
defaultValue =
|
|
17
|
+
defaultValue = "",
|
|
18
18
|
open,
|
|
19
19
|
defaultOpen = false,
|
|
20
20
|
value: controlled,
|
|
@@ -34,25 +34,25 @@ function ListItemComponent(_ref, ref) {
|
|
|
34
34
|
} : {};
|
|
35
35
|
const checked = Array.isArray(selectedLabel) ? selectedLabel.includes(option.label) : selectedLabel === option.label;
|
|
36
36
|
function handleKeyDown(e) {
|
|
37
|
-
const arrowKeys = [
|
|
38
|
-
const validKeys = [
|
|
37
|
+
const arrowKeys = ["ArrowDown", "ArrowUp"];
|
|
38
|
+
const validKeys = ["Enter", " "];
|
|
39
39
|
if (arrowKeys.concat(validKeys).includes(e.key)) {
|
|
40
40
|
e.preventDefault();
|
|
41
41
|
}
|
|
42
|
-
if (e.key ===
|
|
42
|
+
if (e.key === "ArrowDown") {
|
|
43
43
|
onFocusChange((index + 1) % options.length);
|
|
44
44
|
}
|
|
45
|
-
if (e.key ===
|
|
45
|
+
if (e.key === "ArrowUp") {
|
|
46
46
|
const nextIndex = (index - 1 + options.length) % options.length;
|
|
47
47
|
onFocusChange(nextIndex);
|
|
48
48
|
}
|
|
49
|
-
if ([
|
|
49
|
+
if (["Enter", " "].includes(e.key)) {
|
|
50
50
|
if (option.disabled) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
onOptionChange(option);
|
|
54
54
|
}
|
|
55
|
-
if (e.key ===
|
|
55
|
+
if (e.key === "Escape") {
|
|
56
56
|
onClose();
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -62,15 +62,15 @@ function ListItemComponent(_ref, ref) {
|
|
|
62
62
|
}
|
|
63
63
|
onOptionChange(option);
|
|
64
64
|
}
|
|
65
|
-
const itemRef = typeof ref !==
|
|
65
|
+
const itemRef = typeof ref !== "function" ? ref?.current?.[index] : undefined;
|
|
66
66
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
67
67
|
onClick: handleClick,
|
|
68
68
|
ref: itemRef,
|
|
69
69
|
role: "option",
|
|
70
70
|
onKeyDown: handleKeyDown,
|
|
71
71
|
"aria-selected": checked,
|
|
72
|
-
className: (0, _classnames.default)(
|
|
73
|
-
|
|
72
|
+
className: (0, _classnames.default)("fwe-select-option", {
|
|
73
|
+
"fwe-empty": !option.label
|
|
74
74
|
}, className),
|
|
75
75
|
tabIndex: 0,
|
|
76
76
|
...restProps,
|
|
@@ -25,7 +25,7 @@ const SelectButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
25
25
|
if (disabled) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const validKeys = [
|
|
28
|
+
const validKeys = ["Enter", " ", "ArrowUp", "ArrowDown"];
|
|
29
29
|
if (validKeys.includes(e.key)) {
|
|
30
30
|
e.preventDefault();
|
|
31
31
|
onToggle();
|
|
@@ -41,12 +41,12 @@ const SelectButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
41
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
42
42
|
role: "button",
|
|
43
43
|
tabIndex: 0,
|
|
44
|
-
className: (0, _classnames.default)(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
className: (0, _classnames.default)("fwe-select", {
|
|
45
|
+
"fwe-focus": focused,
|
|
46
|
+
"fwe-empty": empty,
|
|
47
|
+
"fwe-required": required,
|
|
48
|
+
"fwe-disabled": disabled,
|
|
49
|
+
"fwe-invalid": error
|
|
50
50
|
}),
|
|
51
51
|
onClick: handleClick,
|
|
52
52
|
ref: ref,
|
|
@@ -14,10 +14,10 @@ function SelectLabel(_ref) {
|
|
|
14
14
|
id
|
|
15
15
|
} = _ref;
|
|
16
16
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
17
|
-
className: (0, _classnames.default)(
|
|
18
|
-
|
|
17
|
+
className: (0, _classnames.default)("fwe-select-label", {
|
|
18
|
+
"fwe-sr-only": hideLabel
|
|
19
19
|
}),
|
|
20
20
|
htmlFor: id,
|
|
21
|
-
children: label ||
|
|
21
|
+
children: label || ""
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -18,8 +18,8 @@ const SelectWrapper = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
18
18
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
19
|
...props,
|
|
20
20
|
ref: ref,
|
|
21
|
-
className: (0, _classnames.default)(
|
|
22
|
-
|
|
21
|
+
className: (0, _classnames.default)("fwe-select-wrapper", {
|
|
22
|
+
"fwe-disabled": disabled
|
|
23
23
|
}, className),
|
|
24
24
|
children: children
|
|
25
25
|
});
|
|
@@ -17,7 +17,7 @@ function getChildren(children) {
|
|
|
17
17
|
if (/*#__PURE__*/_react.default.isValidElement(element)) {
|
|
18
18
|
if (/*#__PURE__*/_react.default.isValidElement(element) && element.type === _SelectOption.default) {
|
|
19
19
|
foundFirstOption = true;
|
|
20
|
-
const className = (0, _classnames.default)(
|
|
20
|
+
const className = (0, _classnames.default)("fwe-select-option-content", element.props.className);
|
|
21
21
|
const {
|
|
22
22
|
props
|
|
23
23
|
} = element;
|
|
@@ -30,12 +30,12 @@ function Slider(_ref) {
|
|
|
30
30
|
const [left, setLeft] = (0, _react.useState)(null);
|
|
31
31
|
const [numberoffset, setNumberOffset] = (0, _react.useState)(0);
|
|
32
32
|
const labelEl = (0, _react.useRef)(null);
|
|
33
|
-
const classes = (0, _classnames.default)(
|
|
34
|
-
|
|
33
|
+
const classes = (0, _classnames.default)("fwe-slider", {
|
|
34
|
+
"fr-slider-value": !label && showValue
|
|
35
35
|
}, {
|
|
36
|
-
|
|
36
|
+
"fr-slider-label": label && !showValue
|
|
37
37
|
}, {
|
|
38
|
-
|
|
38
|
+
"fr-slider-value-label": label && showValue
|
|
39
39
|
}, className);
|
|
40
40
|
(0, _react.useEffect)(() => {
|
|
41
41
|
setInnerValue(value);
|
|
@@ -66,11 +66,11 @@ function Slider(_ref) {
|
|
|
66
66
|
function handleResize() {
|
|
67
67
|
updateValuePosition();
|
|
68
68
|
}
|
|
69
|
-
window.addEventListener(
|
|
69
|
+
window.addEventListener("resize", handleResize);
|
|
70
70
|
handleResize();
|
|
71
71
|
|
|
72
72
|
// Remove event listener on cleanup
|
|
73
|
-
return () => window.removeEventListener(
|
|
73
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
74
74
|
}, [updateValuePosition]);
|
|
75
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
76
76
|
ref: labelEl,
|
|
@@ -98,7 +98,7 @@ function Slider(_ref) {
|
|
|
98
98
|
},
|
|
99
99
|
children: innerValue
|
|
100
100
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
101
|
-
className: `fr-slider-indicator${disabled ?
|
|
101
|
+
className: `fr-slider-indicator${disabled ? " disabled" : ""}`,
|
|
102
102
|
style: {
|
|
103
103
|
width: `${left}px`
|
|
104
104
|
}
|
|
@@ -11,7 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
function Switch(_ref) {
|
|
13
13
|
let {
|
|
14
|
-
labelPosition =
|
|
14
|
+
labelPosition = "after",
|
|
15
15
|
large = false,
|
|
16
16
|
title,
|
|
17
17
|
value,
|
|
@@ -22,10 +22,10 @@ function Switch(_ref) {
|
|
|
22
22
|
id: idProps
|
|
23
23
|
} = _ref;
|
|
24
24
|
const id = (0, _useId.default)(idProps);
|
|
25
|
-
const labelClassName = (0, _classnames.default)(
|
|
25
|
+
const labelClassName = (0, _classnames.default)("fwe-switch", {
|
|
26
26
|
[`fwe-switch-label-${labelPosition}`]: true
|
|
27
27
|
}, {
|
|
28
|
-
|
|
28
|
+
"fwe-switch-lg": large
|
|
29
29
|
}, className);
|
|
30
30
|
const [currentValue, setCurrentValue] = (0, _useControlled.default)({
|
|
31
31
|
controlled: value,
|
|
@@ -33,7 +33,7 @@ function TextArea(_ref) {
|
|
|
33
33
|
const controlled = value !== undefined;
|
|
34
34
|
const [innerValue, setInnerValue] = (0, _react.useState)(controlled ? value : defaultValue);
|
|
35
35
|
const id = (0, _useId.default)(idProps);
|
|
36
|
-
const hintClasses = (0, _classnames.default)(
|
|
36
|
+
const hintClasses = (0, _classnames.default)("fwe-input-text-info");
|
|
37
37
|
const shadowRef = _react.default.useRef(null);
|
|
38
38
|
const ref = _react.default.useRef(null);
|
|
39
39
|
const [height, setHeight] = (0, _react.useState)(undefined);
|
|
@@ -47,7 +47,7 @@ function TextArea(_ref) {
|
|
|
47
47
|
const shadow = shadowRef.current;
|
|
48
48
|
const minRows = 2;
|
|
49
49
|
if (shadow && input) {
|
|
50
|
-
shadow.value = input.value ||
|
|
50
|
+
shadow.value = input.value || "x";
|
|
51
51
|
shadow.style.width = `${input.clientWidth}`;
|
|
52
52
|
const newHeight = Math.max(minRows * 24, shadow.scrollHeight);
|
|
53
53
|
setHeight(newHeight + 4 + 4 + 1);
|
|
@@ -62,17 +62,17 @@ function TextArea(_ref) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
65
|
-
className: (0, _classnames.default)(
|
|
65
|
+
className: (0, _classnames.default)("fwe-input-text", className),
|
|
66
66
|
htmlFor: id,
|
|
67
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
|
|
68
68
|
style: {
|
|
69
69
|
...(!rows && {
|
|
70
70
|
height,
|
|
71
|
-
overflow:
|
|
71
|
+
overflow: "hidden"
|
|
72
72
|
})
|
|
73
73
|
},
|
|
74
74
|
ref: ref,
|
|
75
|
-
className: (0, _classnames.default)(
|
|
75
|
+
className: (0, _classnames.default)("fr-textarea", `fwe-row-${rows}`),
|
|
76
76
|
disabled: disabled,
|
|
77
77
|
readOnly: readonly,
|
|
78
78
|
required: required,
|
|
@@ -87,14 +87,14 @@ function TextArea(_ref) {
|
|
|
87
87
|
id: id
|
|
88
88
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
|
|
89
89
|
style: {
|
|
90
|
-
visibility:
|
|
91
|
-
position:
|
|
92
|
-
overflow:
|
|
90
|
+
visibility: "hidden",
|
|
91
|
+
position: "absolute",
|
|
92
|
+
overflow: "hidden",
|
|
93
93
|
height: 0,
|
|
94
94
|
top: 0,
|
|
95
95
|
left: 0,
|
|
96
|
-
transform:
|
|
97
|
-
padding:
|
|
96
|
+
transform: "translateZ(0)",
|
|
97
|
+
padding: "0"
|
|
98
98
|
},
|
|
99
99
|
ref: shadowRef,
|
|
100
100
|
readOnly: true
|