@festo-ui/react 9.0.1-dev.809 → 9.0.1-dev.817

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.
Files changed (110) hide show
  1. package/dist/components/accordion/Accordion.d.ts +3 -3
  2. package/dist/components/accordion/Accordion.js +2 -1
  3. package/dist/components/accordion/accordion-header/AccordionHeader.js +1 -0
  4. package/dist/components/accordion/accordion-item/AccordionItem.d.ts +1 -1
  5. package/dist/components/accordion/accordion-item/AccordionItem.js +2 -1
  6. package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +1 -0
  7. package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +1 -0
  8. package/dist/components/bottom-sheet/BottomSheet.d.ts +2 -3
  9. package/dist/components/bottom-sheet/BottomSheet.js +7 -4
  10. package/dist/components/breadcrumb/Breadcrumb.d.ts +3 -4
  11. package/dist/components/breadcrumb/Breadcrumb.js +10 -5
  12. package/dist/components/button/Button.js +1 -0
  13. package/dist/components/card/Card.d.ts +3 -5
  14. package/dist/components/card/Card.js +6 -4
  15. package/dist/components/card/CardBody.d.ts +3 -3
  16. package/dist/components/card/CardBody.js +6 -4
  17. package/dist/components/card/CardHeader.d.ts +3 -3
  18. package/dist/components/card/CardHeader.js +6 -4
  19. package/dist/components/card/CardNotification.d.ts +2 -3
  20. package/dist/components/card/CardNotification.js +6 -2
  21. package/dist/components/chips/chip/Chip.d.ts +4 -5
  22. package/dist/components/chips/chip/Chip.js +11 -4
  23. package/dist/components/chips/chip-container/ChipContainer.d.ts +3 -3
  24. package/dist/components/chips/chip-container/ChipContainer.js +6 -2
  25. package/dist/components/loading-indicator/LoadingIndicator.d.ts +2 -2
  26. package/dist/components/loading-indicator/LoadingIndicator.js +1 -0
  27. package/dist/components/mobile-flyout/MobileFlyout.js +1 -0
  28. package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +1 -0
  29. package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +3 -2
  30. package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +4 -3
  31. package/dist/components/modals/AlertModal.d.ts +1 -1
  32. package/dist/components/modals/AlertModal.js +5 -4
  33. package/dist/components/modals/ConfirmModal.d.ts +1 -1
  34. package/dist/components/modals/ConfirmModal.js +5 -4
  35. package/dist/components/modals/CustomModal.js +1 -0
  36. package/dist/components/modals/Modal.js +1 -0
  37. package/dist/components/modals/ModalBase.js +1 -0
  38. package/dist/components/modals/ModalFooter.d.ts +2 -2
  39. package/dist/components/modals/ModalFooter.js +3 -1
  40. package/dist/components/modals/Prompt.d.ts +2 -3
  41. package/dist/components/modals/Prompt.js +9 -6
  42. package/dist/components/modals/image-gallery/ImageGallery.css +6 -6
  43. package/dist/components/modals/image-gallery/ImageGallery.d.ts +1 -1
  44. package/dist/components/modals/image-gallery/ImageGallery.js +1 -0
  45. package/dist/components/modals/image-gallery/ImageGallerySwiper.js +1 -1
  46. package/dist/components/pagination/Pagination.d.ts +3 -4
  47. package/dist/components/pagination/Pagination.js +17 -13
  48. package/dist/components/popovers/legend/Legend.d.ts +3 -2
  49. package/dist/components/popovers/legend/Legend.js +5 -2
  50. package/dist/components/popovers/popover/Popover.css +1 -1
  51. package/dist/components/popovers/popover/Popover.d.ts +4 -4
  52. package/dist/components/popovers/popover/Popover.js +14 -5
  53. package/dist/components/popovers/popover-menu/PopoverMenu.d.ts +4 -2
  54. package/dist/components/popovers/popover-menu/PopoverMenu.js +5 -3
  55. package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.d.ts +3 -2
  56. package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.js +7 -3
  57. package/dist/components/popovers/tooltip/Tooltip.d.ts +3 -2
  58. package/dist/components/popovers/tooltip/Tooltip.js +5 -4
  59. package/dist/components/progress/Progress.d.ts +2 -3
  60. package/dist/components/progress/Progress.js +6 -2
  61. package/dist/components/search-input/ClearButton.d.ts +1 -2
  62. package/dist/components/search-input/ClearButton.js +5 -4
  63. package/dist/components/search-input/SearchInput.d.ts +3 -4
  64. package/dist/components/search-input/SearchInput.js +9 -5
  65. package/dist/components/snackbar/Snackbar.d.ts +4 -4
  66. package/dist/components/snackbar/Snackbar.js +11 -7
  67. package/dist/components/snackbar/SnackbarProvider.d.ts +3 -3
  68. package/dist/components/snackbar/SnackbarProvider.js +7 -4
  69. package/dist/components/stepper-horizontal/StepperHorizontal.d.ts +2 -2
  70. package/dist/components/stepper-horizontal/StepperHorizontal.js +3 -2
  71. package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.js +2 -1
  72. package/dist/components/stepper-vertical/StepperVertical.js +1 -0
  73. package/dist/components/stepper-vertical/step-vertical/StepVertical.js +1 -0
  74. package/dist/components/tab/Tabs.js +2 -1
  75. package/dist/components/tab/tab-pane/TabPane.d.ts +3 -4
  76. package/dist/components/tab/tab-pane/TabPane.js +6 -2
  77. package/dist/components/table-header-cell/TableHeaderCell.d.ts +2 -1
  78. package/dist/components/table-header-cell/TableHeaderCell.js +1 -0
  79. package/dist/forms/checkbox/Checkbox.d.ts +3 -6
  80. package/dist/forms/checkbox/Checkbox.js +5 -2
  81. package/dist/forms/combobox/ComboBox.d.ts +6 -7
  82. package/dist/forms/combobox/ComboBox.js +2 -3
  83. package/dist/forms/multi-select/{MultiSelect_module.css → MultiSelect.css} +2 -2
  84. package/dist/forms/multi-select/MultiSelect.d.ts +2 -2
  85. package/dist/forms/multi-select/MultiSelect.js +4 -3
  86. package/dist/forms/radio/RadioButton.d.ts +4 -4
  87. package/dist/forms/radio/RadioButton.js +11 -10
  88. package/dist/forms/radio/RadioGroup.d.ts +4 -4
  89. package/dist/forms/radio/RadioGroup.js +1 -0
  90. package/dist/forms/segment/Segment.d.ts +4 -5
  91. package/dist/forms/segment/Segment.js +10 -8
  92. package/dist/forms/segment/segment-control/SegmentControl.d.ts +4 -8
  93. package/dist/forms/segment/segment-control/SegmentControl.js +8 -6
  94. package/dist/forms/select/Select.d.ts +6 -6
  95. package/dist/forms/select/Select.js +1 -0
  96. package/dist/forms/slider/Slider.d.ts +4 -7
  97. package/dist/forms/slider/Slider.js +11 -6
  98. package/dist/forms/switch/Switch.d.ts +4 -6
  99. package/dist/forms/switch/Switch.js +12 -6
  100. package/dist/forms/text-area/TextArea.d.ts +6 -15
  101. package/dist/forms/text-area/TextArea.js +42 -25
  102. package/dist/forms/text-input/TextInput.d.ts +5 -4
  103. package/dist/forms/text-input/TextInput.js +7 -2
  104. package/dist/forms/time-picker/TimePicker.d.ts +7 -6
  105. package/dist/forms/time-picker/TimePicker.js +4 -2
  106. package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +1 -0
  107. package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.js +1 -0
  108. package/dist/utils/types.d.ts +0 -13
  109. package/package.json +2 -9
  110. package/dist/forms/multi-select/MultiSelect.module.js +0 -8
@@ -1,22 +1,22 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type Ref } from 'react';
3
- import type { ComponentBase } from '../../utils/types';
4
3
  export interface SelectOption<T> {
5
4
  readonly data: T;
6
5
  readonly label: ReactNode;
7
6
  readonly disabled?: boolean;
8
7
  }
9
- export interface SelectProps<T> extends ComponentBase {
10
- readonly defaultValue?: T;
8
+ export interface SelectProps<T> extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'value' | 'defaultValue'> {
11
9
  readonly value?: T;
10
+ readonly defaultValue?: T;
11
+ readonly name?: string;
12
+ readonly disabled?: boolean;
13
+ readonly required?: boolean;
12
14
  readonly label?: string;
13
15
  readonly options?: SelectOption<T>[];
14
- readonly onChange?: (value: T) => void;
15
- readonly disabled?: boolean;
16
- readonly name?: string;
17
16
  readonly hint?: string;
18
17
  readonly error?: string;
19
18
  readonly placeholder?: string;
19
+ readonly onChange?: (value: T) => void;
20
20
  }
21
21
  declare function SelectComponent<T>({ defaultValue, value: controlled, label, options, onChange, disabled, name, id: idProp, hint, error, placeholder, className, ...props }: SelectProps<T>, ref: Ref<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
22
22
  export declare const Select: <T>(props: SelectProps<T> & {
@@ -89,4 +89,5 @@ function SelectComponent({ defaultValue = '', value: controlled, label, options
89
89
  });
90
90
  }
91
91
  const Select = /*#__PURE__*/ forwardRef(SelectComponent);
92
+ Select.displayName = 'Select';
92
93
  export { Select };
@@ -1,8 +1,6 @@
1
1
  import './Slider.scss';
2
- import type React from 'react';
3
- import type { ClassNameProps } from '../../utils/types';
4
- export interface SliderProps extends ClassNameProps {
5
- readonly disabled?: boolean;
2
+ import { type ComponentPropsWithoutRef } from 'react';
3
+ export interface SliderProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'onChange' | 'value' | 'defaultValue' | 'min' | 'max' | 'step'> {
6
4
  readonly min: number;
7
5
  readonly max: number;
8
6
  readonly step?: number;
@@ -10,8 +8,7 @@ export interface SliderProps extends ClassNameProps {
10
8
  readonly onChangeCommitted?: (value: number) => void;
11
9
  readonly label?: string;
12
10
  readonly showValue?: boolean;
13
- readonly onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: number) => void;
14
- readonly id?: string;
11
+ readonly onChange?: (value: number, event: React.ChangeEvent<HTMLInputElement>) => void;
15
12
  readonly widthOffset?: number;
16
13
  }
17
- export declare function Slider({ disabled, label, max, min, onChange, onChangeCommitted, step, value, showValue, className, id: idProps, widthOffset, }: SliderProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare const Slider: (props: SliderProps & import("react").RefAttributes<HTMLLabelElement>) => React.ReactElement | null;
@@ -1,14 +1,16 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "./Slider.css";
3
3
  import classnames from "classnames";
4
- import { useCallback, useEffect, useRef, useState } from "react";
4
+ import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
5
+ import { useForkRef } from "../../utils/useForkRef.js";
5
6
  import { useId } from "../../utils/useId.js";
6
- function Slider({ disabled = false, label, max, min, onChange, onChangeCommitted, step, value, showValue = true, className, id: idProps, widthOffset = 8 }) {
7
+ const Slider = /*#__PURE__*/ forwardRef(({ disabled = false, label, name, max, min, onChange, onChangeCommitted, step, value, showValue = true, className, id: idProps, widthOffset = 8, ...props }, ref)=>{
7
8
  const id = useId(idProps);
8
9
  const [innerValue, setInnerValue] = useState(value);
9
10
  const [left, setLeft] = useState(null);
10
11
  const [numberOffset, setNumberOffset] = useState(0);
11
12
  const labelEl = useRef(null);
13
+ const handleRef = useForkRef(ref, labelEl);
12
14
  const classes = classnames('fwe-slider', {
13
15
  'fr-slider-value': !label && showValue
14
16
  }, {
@@ -40,7 +42,7 @@ function Slider({ disabled = false, label, max, min, onChange, onChangeCommitted
40
42
  const handleChange = (e)=>{
41
43
  const newValue = Number.parseFloat(e.target.value);
42
44
  setInnerValue(newValue);
43
- if (onChange) onChange(e, newValue);
45
+ if (onChange) onChange(newValue, e);
44
46
  };
45
47
  useEffect(()=>{
46
48
  function handleResize() {
@@ -53,7 +55,7 @@ function Slider({ disabled = false, label, max, min, onChange, onChangeCommitted
53
55
  updateValuePosition
54
56
  ]);
55
57
  return /*#__PURE__*/ jsxs("label", {
56
- ref: labelEl,
58
+ ref: handleRef,
57
59
  className: classes,
58
60
  htmlFor: id,
59
61
  children: [
@@ -64,6 +66,7 @@ function Slider({ disabled = false, label, max, min, onChange, onChangeCommitted
64
66
  id: id,
65
67
  className: "fwe-slider-input",
66
68
  type: "range",
69
+ name: name,
67
70
  disabled: disabled,
68
71
  min: min,
69
72
  max: max,
@@ -72,7 +75,8 @@ function Slider({ disabled = false, label, max, min, onChange, onChangeCommitted
72
75
  value: innerValue,
73
76
  onKeyUp: handleAfterChange,
74
77
  onMouseUp: handleAfterChange,
75
- onTouchEnd: handleAfterChange
78
+ onTouchEnd: handleAfterChange,
79
+ ...props
76
80
  }),
77
81
  showValue && null !== left && /*#__PURE__*/ jsx("span", {
78
82
  className: "fr-slider-value",
@@ -89,5 +93,6 @@ function Slider({ disabled = false, label, max, min, onChange, onChangeCommitted
89
93
  })
90
94
  ]
91
95
  });
92
- }
96
+ });
97
+ Slider.displayName = 'Slider';
93
98
  export { Slider };
@@ -1,12 +1,10 @@
1
- import type { ClassNameProps } from '../../utils/types';
2
- export interface SwitchProps extends ClassNameProps {
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ export interface SwitchProps extends Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'onChange' | 'value' | 'defaultValue' | 'checked'> {
3
3
  readonly labelPosition?: 'before' | 'after' | 'below';
4
4
  readonly large?: boolean;
5
5
  readonly title: string;
6
6
  readonly value?: boolean;
7
7
  readonly defaultValue?: boolean;
8
- readonly disabled?: boolean;
9
- readonly onChange?: (value: boolean) => void;
10
- readonly id?: string;
8
+ readonly onChange?: (value: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
11
9
  }
12
- export declare function Switch({ labelPosition, large, title, value, defaultValue, disabled, onChange, className, id: idProps, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare const Switch: (props: SwitchProps & import("react").RefAttributes<HTMLLabelElement>) => React.ReactElement | null;
@@ -1,8 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
+ import { forwardRef } from "react";
3
4
  import { useControlled } from "../../utils/useControlled.js";
4
5
  import { useId } from "../../utils/useId.js";
5
- function Switch({ labelPosition = 'after', large = false, title, value, defaultValue, disabled = false, onChange, className, id: idProps }) {
6
+ const Switch = /*#__PURE__*/ forwardRef(({ labelPosition = 'after', large = false, title, name, required = false, value, defaultValue, disabled = false, onChange, className, id: idProps, ...props }, ref)=>{
6
7
  const id = useId(idProps);
7
8
  const labelClassName = classnames('fwe-switch', {
8
9
  [`fwe-switch-label-${labelPosition}`]: true
@@ -13,21 +14,25 @@ function Switch({ labelPosition = 'after', large = false, title, value, defaultV
13
14
  controlled: value,
14
15
  default: defaultValue
15
16
  });
16
- const handleChange = ()=>{
17
+ const handleChange = (event)=>{
17
18
  const newValue = !currentValue;
18
19
  setCurrentValue(newValue);
19
- if (onChange) onChange(newValue);
20
+ if (onChange) onChange(newValue, event);
20
21
  };
21
22
  return /*#__PURE__*/ jsxs("label", {
22
23
  className: labelClassName,
23
24
  htmlFor: id,
25
+ ref: ref,
24
26
  children: [
25
27
  /*#__PURE__*/ jsx("input", {
26
28
  type: "checkbox",
29
+ name: name,
30
+ required: required,
27
31
  disabled: disabled,
28
32
  checked: currentValue,
29
- onChange: ()=>handleChange(),
30
- id: id
33
+ onChange: handleChange,
34
+ id: id,
35
+ ...props
31
36
  }),
32
37
  /*#__PURE__*/ jsx("div", {
33
38
  className: "fwe-switch-track"
@@ -38,5 +43,6 @@ function Switch({ labelPosition = 'after', large = false, title, value, defaultV
38
43
  })
39
44
  ]
40
45
  });
41
- }
46
+ });
47
+ Switch.displayName = 'Switch';
42
48
  export { Switch };
@@ -1,22 +1,13 @@
1
1
  import './TextArea.scss';
2
- import React from 'react';
3
- import type { ClassNameProps } from '../../utils/types';
4
- export interface TextAreaProps extends ClassNameProps {
5
- readonly disabled?: boolean;
6
- readonly required?: boolean;
7
- readonly readonly?: boolean;
8
- readonly onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
9
- readonly onFocus?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
10
- readonly onInput?: (event: React.FormEvent<HTMLTextAreaElement>) => void;
11
- readonly onBlur?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
2
+ import React, { type ComponentPropsWithoutRef } from 'react';
3
+ export interface TextAreaProps extends Omit<ComponentPropsWithoutRef<'textarea'>, 'onChange' | 'value' | 'defaultValue'> {
4
+ readonly value?: string;
5
+ readonly defaultValue?: string;
6
+ readonly onChange?: (value: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
12
7
  readonly label: string;
13
8
  readonly hint?: string;
14
9
  readonly error?: string;
15
- readonly value?: string;
16
- readonly defaultValue?: string;
17
- readonly name?: string;
18
10
  readonly rows?: number;
19
- readonly maxLength?: number;
20
11
  readonly id?: string;
21
12
  }
22
- export declare function TextArea({ disabled, onBlur, onChange, onFocus, onInput, readonly, required, label, error, hint, value, defaultValue, name, rows, maxLength, className, id: idProps, }: Readonly<TextAreaProps>): import("react/jsx-runtime").JSX.Element;
13
+ export declare const TextArea: (props: TextAreaProps & React.RefAttributes<HTMLLabelElement>) => React.ReactElement | null;
@@ -1,40 +1,62 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "./TextArea.css";
3
3
  import classnames from "classnames";
4
- import react, { useEffect, useState } from "react";
4
+ import react, { forwardRef, useEffect, useLayoutEffect, useState } from "react";
5
5
  import { useId } from "../../utils/useId.js";
6
- function TextArea({ disabled, onBlur, onChange, onFocus, onInput, readonly, required, label, error, hint, value, defaultValue, name, rows, maxLength, className, id: idProps }) {
6
+ const TextArea = /*#__PURE__*/ forwardRef(({ onChange, label, error, hint, value, defaultValue, rows, maxLength, className, id: idProps, ...props }, ref)=>{
7
7
  const controlled = void 0 !== value;
8
- const [innerValue, setInnerValue] = useState(controlled ? value : defaultValue);
8
+ const [innerValue, setInnerValue] = useState(controlled ? value : defaultValue ?? '');
9
9
  const id = useId(idProps);
10
10
  const hintClasses = classnames('fwe-input-text-info');
11
11
  const shadowRef = react.useRef(null);
12
- const ref = react.useRef(null);
12
+ const textareaRef = react.useRef(null);
13
13
  const [height, setHeight] = useState(void 0);
14
+ const resizeToContent = react.useCallback(()=>{
15
+ const input = textareaRef.current;
16
+ const shadow = shadowRef.current;
17
+ const minRows = 2;
18
+ if (shadow && input) {
19
+ shadow.value = input.value || innerValue || 'x';
20
+ shadow.style.width = input.clientWidth.toString();
21
+ const newHeight = Math.max(24 * minRows, shadow.scrollHeight);
22
+ setHeight(newHeight + 4 + 4 + 1);
23
+ }
24
+ }, [
25
+ innerValue
26
+ ]);
14
27
  useEffect(()=>{
15
28
  if (controlled) setInnerValue(value);
16
29
  }, [
17
30
  value,
18
31
  controlled
19
32
  ]);
33
+ useLayoutEffect(()=>{
34
+ if (rows) return;
35
+ resizeToContent();
36
+ }, [
37
+ rows,
38
+ resizeToContent
39
+ ]);
20
40
  useEffect(()=>{
21
- const input = ref.current;
22
- const shadow = shadowRef.current;
23
- const minRows = 2;
24
- if (shadow && input) {
25
- shadow.value = input.value || 'x';
26
- shadow.style.width = `${input.clientWidth}`;
27
- const newHeight = Math.max(24 * minRows, shadow.scrollHeight);
28
- setHeight(newHeight + 4 + 4 + 1);
29
- }
30
- }, []);
41
+ if (rows) return;
42
+ const handleResize = ()=>resizeToContent();
43
+ window.addEventListener('resize', handleResize);
44
+ return ()=>{
45
+ window.removeEventListener('resize', handleResize);
46
+ };
47
+ }, [
48
+ rows,
49
+ resizeToContent
50
+ ]);
31
51
  function handleChange(event) {
32
52
  if (!controlled) setInnerValue(event.target.value);
33
- if (onChange) onChange(event);
53
+ if (!rows) resizeToContent();
54
+ if (onChange) onChange(event.target.value, event);
34
55
  }
35
56
  return /*#__PURE__*/ jsxs("label", {
36
57
  className: classnames('fwe-input-text', className),
37
58
  htmlFor: id,
59
+ ref: ref,
38
60
  children: [
39
61
  /*#__PURE__*/ jsx("textarea", {
40
62
  style: {
@@ -43,21 +65,15 @@ function TextArea({ disabled, onBlur, onChange, onFocus, onInput, readonly, requ
43
65
  overflow: 'hidden'
44
66
  }
45
67
  },
46
- ref: ref,
47
- name: name,
68
+ ref: textareaRef,
48
69
  className: classnames('fr-textarea', `fwe-row-${rows}`),
49
- disabled: disabled,
50
- readOnly: readonly,
51
- required: required,
52
70
  autoComplete: "off",
53
71
  onChange: handleChange,
54
- onFocus: onFocus,
55
- onInput: onInput,
56
- onBlur: onBlur,
57
72
  maxLength: maxLength,
58
73
  defaultValue: defaultValue,
59
74
  value: value,
60
- id: id
75
+ id: id,
76
+ ...props
61
77
  }),
62
78
  /*#__PURE__*/ jsx("textarea", {
63
79
  style: {
@@ -95,5 +111,6 @@ function TextArea({ disabled, onBlur, onChange, onFocus, onInput, readonly, requ
95
111
  })
96
112
  ]
97
113
  });
98
- }
114
+ });
115
+ TextArea.displayName = 'TextArea';
99
116
  export { TextArea };
@@ -1,12 +1,13 @@
1
1
  import './TextInput.scss';
2
- import type React from 'react';
3
- export interface TextInputProps extends React.HTMLProps<HTMLInputElement> {
2
+ import React, { type ComponentPropsWithoutRef, type ReactNode } from 'react';
3
+ export interface TextInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'onChange'> {
4
4
  readonly?: boolean;
5
5
  value?: string;
6
6
  defaultValue?: string;
7
+ label?: string;
7
8
  hint?: string;
8
9
  error?: string;
9
- labelClassName?: string;
10
- icon?: React.ReactNode;
10
+ icon?: ReactNode;
11
+ onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
11
12
  }
12
13
  export declare const TextInput: (props: TextInputProps & React.RefAttributes<HTMLLabelElement>) => React.ReactElement | null;
@@ -9,9 +9,12 @@ const SUPPORTED_INPUT_TYPES = [
9
9
  'password',
10
10
  'datetime-local'
11
11
  ];
12
- const TextInput = /*#__PURE__*/ forwardRef(({ readonly, type, value, defaultValue, error, hint, label, labelClassName, icon, id: idProps, autoFocus, ...props }, ref)=>{
12
+ const TextInput = /*#__PURE__*/ forwardRef(({ readonly, type, value, defaultValue, error, hint, label, icon, onChange, className, id: idProps, autoFocus, ...props }, ref)=>{
13
13
  const id = useId(idProps);
14
14
  const inputRef = useRef(null);
15
+ const handleChange = (e)=>{
16
+ onChange?.(e.target.value, e);
17
+ };
15
18
  useEffect(()=>{
16
19
  if (autoFocus && inputRef.current) {
17
20
  const timer = setTimeout(()=>{
@@ -25,7 +28,7 @@ const TextInput = /*#__PURE__*/ forwardRef(({ readonly, type, value, defaultValu
25
28
  const innerType = type && SUPPORTED_INPUT_TYPES.includes(type) ? type : 'text';
26
29
  const labelClasses = classnames('fwe-input-text', {
27
30
  'fwe-input-text-icon': icon
28
- }, labelClassName);
31
+ }, className);
29
32
  return /*#__PURE__*/ jsxs("label", {
30
33
  className: labelClasses,
31
34
  htmlFor: id,
@@ -37,6 +40,7 @@ const TextInput = /*#__PURE__*/ forwardRef(({ readonly, type, value, defaultValu
37
40
  type: innerType,
38
41
  value: value,
39
42
  defaultValue: defaultValue,
43
+ onChange: handleChange,
40
44
  id: id,
41
45
  ref: inputRef,
42
46
  ...props
@@ -57,4 +61,5 @@ const TextInput = /*#__PURE__*/ forwardRef(({ readonly, type, value, defaultValu
57
61
  ]
58
62
  });
59
63
  });
64
+ TextInput.displayName = 'TextInput';
60
65
  export { TextInput };
@@ -1,6 +1,5 @@
1
1
  import './TimePicker.scss';
2
2
  import type React from 'react';
3
- import { type ComponentPropsWithoutRef } from 'react';
4
3
  export interface TimePickerOptions {
5
4
  readonly timeFormat?: '12' | '24';
6
5
  readonly showSeconds?: boolean;
@@ -10,13 +9,15 @@ export interface TimePickerOptions {
10
9
  maxValue: Date;
11
10
  };
12
11
  }
13
- export interface TimePickerProps extends Omit<ComponentPropsWithoutRef<'button'>, 'value' | 'defaultValue' | 'onChange'> {
14
- readonly error?: string;
15
- readonly hint?: string;
16
- readonly required?: boolean;
17
- readonly disabled?: boolean;
12
+ export interface TimePickerProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'onChange' | 'value' | 'defaultValue' | 'children'> {
18
13
  readonly value?: Date;
19
14
  readonly defaultValue?: Date;
15
+ readonly name?: string;
16
+ readonly required?: boolean;
17
+ readonly disabled?: boolean;
18
+ readonly children?: React.ReactNode;
19
+ readonly error?: string;
20
+ readonly hint?: string;
20
21
  readonly options?: TimePickerOptions;
21
22
  readonly formatDate?: (date: Date) => string;
22
23
  readonly onChange?: (date: Date) => void;
@@ -8,7 +8,7 @@ import { createPortal } from "react-dom";
8
8
  import { useForkRef } from "../../utils/useForkRef.js";
9
9
  import { useId } from "../../utils/useId.js";
10
10
  import { TimePickerDropdown } from "./time-picker-dropdown/TimePickerDropdown.js";
11
- const TimePicker = /*#__PURE__*/ forwardRef(({ error, hint, required, disabled, children, value, options, defaultValue, formatDate, onChange, id: idProps, ...props }, ref)=>{
11
+ const TimePicker = /*#__PURE__*/ forwardRef(({ error, hint, required, disabled, children, value, options, defaultValue, formatDate, name, onChange, id: idProps, className, ...props }, ref)=>{
12
12
  const id = useId(idProps);
13
13
  const innerFormatDate = formatDate ?? Intl.DateTimeFormat('default', {
14
14
  hour: 'numeric',
@@ -62,7 +62,7 @@ const TimePicker = /*#__PURE__*/ forwardRef(({ error, hint, required, disabled,
62
62
  ref: allRefs,
63
63
  onClick: toggle,
64
64
  disabled: disabled,
65
- className: "fr-time-picker",
65
+ className: classnames('fr-time-picker', className),
66
66
  ...props,
67
67
  children: /*#__PURE__*/ jsxs("label", {
68
68
  htmlFor: id,
@@ -79,6 +79,7 @@ const TimePicker = /*#__PURE__*/ forwardRef(({ error, hint, required, disabled,
79
79
  id: id,
80
80
  "aria-label": "picked time",
81
81
  type: "text",
82
+ name: name,
82
83
  readOnly: true,
83
84
  required: required,
84
85
  className: classnames({
@@ -120,4 +121,5 @@ const TimePicker = /*#__PURE__*/ forwardRef(({ error, hint, required, disabled,
120
121
  ]
121
122
  });
122
123
  });
124
+ TimePicker.displayName = 'TimePicker';
123
125
  export { TimePicker };
@@ -205,4 +205,5 @@ const TimePickerDropdown = /*#__PURE__*/ forwardRef(({ timeFormat, date, onDateC
205
205
  ]
206
206
  });
207
207
  });
208
+ TimePickerDropdown.displayName = 'TimePickerDropdown';
208
209
  export { TimePickerDropdown };
@@ -11,4 +11,5 @@ const TimePickerInput = /*#__PURE__*/ forwardRef(({ min, max, value, onInput, 'a
11
11
  onInput: onInput,
12
12
  ref: ref
13
13
  }));
14
+ TimePickerInput.displayName = 'TimePickerInput';
14
15
  export { TimePickerInput };
@@ -1,16 +1,3 @@
1
- import type { CSSProperties } from 'react';
2
- export interface ComponentBase {
3
- readonly className?: string;
4
- readonly style?: CSSProperties;
5
- readonly 'data-testid'?: string;
6
- readonly id?: string;
7
- }
8
- export interface ClassNameProps {
9
- className?: string;
10
- }
11
- export interface ClassNamePropsWithChildren extends ClassNameProps {
12
- children?: React.ReactNode;
13
- }
14
1
  export interface Image {
15
2
  src: string;
16
3
  alt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@festo-ui/react",
3
- "version": "9.0.1-dev.809",
3
+ "version": "9.0.1-dev.817",
4
4
  "author": "Festo UI (styleguide@festo.com)",
5
5
  "copyright": "Copyright (c) 2025 Festo SE & Co. KG. All rights reserved.",
6
6
  "license": "apache-2.0",
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@festo-ui/react-icons": "*",
37
- "@headlessui/react": "^2.2.9",
38
37
  "@floating-ui/react": "^0.26.0",
38
+ "@headlessui/react": "^2.2.9",
39
39
  "classnames": "^2.2.6",
40
40
  "react-remove-scroll": "^2.7.2",
41
41
  "react-transition-group": "^4.4.5",
@@ -52,7 +52,6 @@
52
52
  "@rstest/core": "^0.6.5",
53
53
  "@rstest/coverage-istanbul": "^0.0.5",
54
54
  "@storybook/addon-docs": "^10.2.3",
55
- "@storybook/preset-scss": "^1.0.3",
56
55
  "@testing-library/dom": "^10.4.0",
57
56
  "@testing-library/jest-dom": "^6.9.1",
58
57
  "@testing-library/react": "^16.3.0",
@@ -60,21 +59,15 @@
60
59
  "@types/react": "^19.2.0",
61
60
  "@types/react-dom": "^19.2.0",
62
61
  "@types/react-transition-group": "^4.4.5",
63
- "autoprefixer": "^10.4.13",
64
62
  "cross-env": "^10.1.0",
65
- "css-minimizer-webpack-plugin": "^4.2.2",
66
63
  "jsdom": "^26.1.0",
67
- "mini-css-extract-plugin": "^2.9.2",
68
64
  "postcss": "^8.4.49",
69
- "postcss-loader": "^8.1.1",
70
65
  "react": "^19.2.0",
71
66
  "react-dom": "^19.2.0",
72
67
  "sass": "^1.82.0",
73
- "sass-loader": "^16.0.4",
74
68
  "storybook": "^10.2.3",
75
69
  "storybook-addon-rslib": "^3.2.2",
76
70
  "storybook-react-rsbuild": "^3.2.2",
77
- "ts-loader": "^9.4.2",
78
71
  "typescript": "^5.9.3"
79
72
  },
80
73
  "peerDependencies": {
@@ -1,8 +0,0 @@
1
- import "./MultiSelect_module.css";
2
- const MultiSelect_module = {
3
- "chip-container": "chip-container-VYPHrz",
4
- chipContainer: "chip-container-VYPHrz",
5
- "chip-ellipsis": "chip-ellipsis-AW26fc",
6
- chipEllipsis: "chip-ellipsis-AW26fc"
7
- };
8
- export { MultiSelect_module as default };