@festo-ui/react-extra 9.0.1 → 10.0.0-dev.827

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  Install the dependencies:
6
6
 
7
7
  ```bash
8
- pnpm install
8
+ npm install
9
9
  ```
10
10
 
11
11
  ## Get started
@@ -13,11 +13,11 @@ pnpm install
13
13
  Build the library:
14
14
 
15
15
  ```bash
16
- pnpm build
16
+ npm run build
17
17
  ```
18
18
 
19
19
  Build the library in watch mode:
20
20
 
21
21
  ```bash
22
- pnpm dev
22
+ npm run dev
23
23
  ```
@@ -1,11 +1,11 @@
1
- import { type JSX, type PropsWithChildren } from 'react';
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
2
  import './ColorIndicator.scss';
3
- export interface ColorIndicatorProps {
4
- className?: string;
3
+ export interface ColorIndicatorProps extends Omit<ComponentPropsWithoutRef<'div'>, 'color'> {
5
4
  text: string;
6
5
  label: string;
7
6
  color?: string;
8
- showPopOver?: boolean;
9
- disabled?: boolean;
7
+ showPopover?: boolean;
10
8
  }
11
- export declare function ColorIndicator({ text, label, color, className, showPopOver, children, disabled, }: PropsWithChildren<ColorIndicatorProps>): JSX.Element;
9
+ export declare const ColorIndicator: (props: ColorIndicatorProps & {
10
+ children?: import("react").ReactNode | undefined;
11
+ } & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,10 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Popover } from "@festo-ui/react";
3
3
  import classnames from "classnames";
4
- import { useState } from "react";
4
+ import { forwardRef, useState } from "react";
5
5
  import "./ColorIndicator.css";
6
- function ColorIndicator({ text, label, color, className, showPopOver = false, children, disabled }) {
7
- const classes = classnames('fwe-color-indicator', className, disabled);
6
+ const ColorIndicator = /*#__PURE__*/ forwardRef(({ text, label, color, className, showPopover = false, children, ...props }, ref)=>{
8
7
  const [isEditorOpen, setEditorOpen] = useState(false);
9
8
  function getBorderColor() {
10
9
  if (!color || '#FFFFFF' === color.toUpperCase() || '#F0F2F3' === color.toUpperCase()) return '#b6bec6';
@@ -14,7 +13,8 @@ function ColorIndicator({ text, label, color, className, showPopOver = false, ch
14
13
  className: "fwe-color-box",
15
14
  style: {
16
15
  background: color,
17
- borderColor: getBorderColor()
16
+ borderColor: getBorderColor(),
17
+ cursor: showPopover ? 'pointer' : 'default'
18
18
  },
19
19
  children: !color && /*#__PURE__*/ jsxs("svg", {
20
20
  className: "fwe-no-color-pattern",
@@ -82,42 +82,38 @@ function ColorIndicator({ text, label, color, className, showPopOver = false, ch
82
82
  ]
83
83
  })
84
84
  });
85
- const wrapperProperties = showPopOver ? {
86
- onClick: ()=>setEditorOpen((prevOpen)=>!prevOpen)
87
- } : {};
88
- const wrapper = (wrapperChildren)=>/*#__PURE__*/ jsxs("div", {
89
- className: classes,
90
- ...wrapperProperties,
91
- children: [
92
- /*#__PURE__*/ jsx("div", {
93
- style: {
94
- opacity: isEditorOpen ? 0 : 1
95
- },
96
- className: "fwe-color-label",
97
- children: label
98
- }),
99
- /*#__PURE__*/ jsxs("div", {
100
- className: "fwe-color-container",
101
- children: [
102
- wrapperChildren,
103
- ' ',
104
- text && /*#__PURE__*/ jsx("div", {
105
- className: "fwe-color-indicator-text",
106
- children: text
107
- }),
108
- ' '
109
- ]
110
- })
111
- ]
112
- });
113
- return showPopOver ? /*#__PURE__*/ jsx(Popover, {
114
- position: "top",
115
- wrapper: wrapper,
116
- popoverContent: children,
117
- open: isEditorOpen,
118
- onStatusChange: setEditorOpen,
119
- stopPropagation: true,
120
- children: colorBox
121
- }) : wrapper(colorBox);
122
- }
85
+ return /*#__PURE__*/ jsxs("div", {
86
+ className: classnames('fwe-color-indicator', className),
87
+ ref: ref,
88
+ ...props,
89
+ children: [
90
+ /*#__PURE__*/ jsx("div", {
91
+ style: {
92
+ opacity: isEditorOpen ? 0 : 1
93
+ },
94
+ className: "fwe-color-label",
95
+ children: label
96
+ }),
97
+ /*#__PURE__*/ jsxs("div", {
98
+ className: "fwe-color-container",
99
+ children: [
100
+ showPopover ? /*#__PURE__*/ jsx(Popover, {
101
+ position: "top",
102
+ content: children,
103
+ isOpen: isEditorOpen,
104
+ onChange: setEditorOpen,
105
+ stopPropagation: true,
106
+ children: colorBox
107
+ }) : colorBox,
108
+ text && /*#__PURE__*/ jsx("div", {
109
+ className: "fwe-color-indicator-text",
110
+ children: text
111
+ }),
112
+ ' '
113
+ ]
114
+ })
115
+ ]
116
+ });
117
+ });
118
+ ColorIndicator.displayName = 'ColorIndicator';
123
119
  export { ColorIndicator };
@@ -1,4 +1,6 @@
1
- export interface ScrollAreaProps extends React.ComponentPropsWithoutRef<'div'> {
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ import type SimpleBarCore from 'simplebar-core';
3
+ export interface ScrollAreaProps extends ComponentPropsWithoutRef<'div'> {
2
4
  readonly scrollbarMinSize?: number;
3
5
  }
4
- export declare function ScrollArea({ children, scrollbarMinSize, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare const ScrollArea: (props: ScrollAreaProps & import("react").RefAttributes<SimpleBarCore | null>) => React.ReactElement | null;
@@ -1,10 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import { forwardRef } from "react";
2
4
  import simplebar_react from "simplebar-react";
3
- function ScrollArea({ children, scrollbarMinSize = 25, ...props }) {
4
- return /*#__PURE__*/ jsx(simplebar_react, {
5
+ const ScrollArea = /*#__PURE__*/ forwardRef(({ children, className, scrollbarMinSize = 25, ...props }, ref)=>/*#__PURE__*/ jsx(simplebar_react, {
6
+ ref: ref,
7
+ className: classnames(className),
5
8
  ...props,
6
9
  scrollbarMinSize: scrollbarMinSize,
7
10
  children: children
8
- });
9
- }
11
+ }));
12
+ ScrollArea.displayName = 'ScrollArea';
10
13
  export { ScrollArea };
@@ -33,7 +33,9 @@ function rgbToHsv(rgb) {
33
33
  };
34
34
  }
35
35
  function hsvToRgb(_hsv) {
36
- const hsv = _hsv;
36
+ const hsv = {
37
+ ..._hsv
38
+ };
37
39
  hsv.h = limitToOne(_hsv.h);
38
40
  hsv.s = limitToOne(_hsv.s);
39
41
  hsv.v = limitToOne(_hsv.v);
@@ -100,7 +102,9 @@ function numberToHex(rgb) {
100
102
  return hex.toUpperCase();
101
103
  }
102
104
  function rgbToHex(_rgb) {
103
- const rgb = _rgb;
105
+ const rgb = {
106
+ ..._rgb
107
+ };
104
108
  rgb.r = limitToByte(rgb.r);
105
109
  rgb.g = limitToByte(rgb.g);
106
110
  rgb.b = limitToByte(rgb.b);
@@ -153,7 +153,7 @@
153
153
  padding: 16px;
154
154
  }
155
155
 
156
- .fwe-popover-menu-trigger .fwe-popover-menu-trigger-button {
156
+ .fwe-popover-menu-trigger {
157
157
  cursor: pointer;
158
158
  background: none;
159
159
  border: none;
@@ -163,7 +163,7 @@
163
163
  display: block;
164
164
  }
165
165
 
166
- .fwe-popover-menu-trigger .fwe-popover-menu-trigger-button:hover {
166
+ .fwe-popover-menu-trigger:hover {
167
167
  color: var(--fwe-hero);
168
168
  }
169
169
 
@@ -358,6 +358,7 @@
358
358
  align-items: center;
359
359
  margin-bottom: 8px;
360
360
  margin-right: 8px;
361
+ padding: 0;
361
362
  display: flex;
362
363
  }
363
364
 
@@ -1,6 +1,8 @@
1
+ import type React from 'react';
2
+ import { type ComponentPropsWithoutRef } from 'react';
1
3
  import './ColorPicker.scss';
2
- export interface ColorPickerProps {
3
- readonly className?: string;
4
+ export interface ColorPickerProps extends Omit<ComponentPropsWithoutRef<'div'>, 'color' | 'onChange'> {
5
+ readonly name?: string;
4
6
  readonly palette?: string[];
5
7
  readonly useAlpha?: boolean;
6
8
  readonly alpha?: number;
@@ -9,4 +11,4 @@ export interface ColorPickerProps {
9
11
  readonly onChange?: (color?: string | null) => void;
10
12
  readonly onAlphaChange?: (alpha?: number) => void;
11
13
  }
12
- export declare function ColorPicker({ className, palette, useAlpha, alpha, paletteOnly, color, onChange, onAlphaChange, }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare const ColorPicker: (props: ColorPickerProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { IconCheckSmall, IconCollapse } from "@festo-ui/react-icons";
3
3
  import classnames from "classnames";
4
- import { useCallback, useEffect, useRef, useState } from "react";
4
+ import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
5
5
  import react_draggable from "react-draggable";
6
6
  import "./ColorPicker.css";
7
7
  import { useId } from "../../utils/useId.js";
@@ -19,7 +19,7 @@ const PREDEFINED_COLORS = [
19
19
  '#ff9600',
20
20
  '#d50000'
21
21
  ];
22
- function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false, alpha = 100, paletteOnly, color = '#FFFFFF', onChange, onAlphaChange }) {
22
+ const ColorPicker = /*#__PURE__*/ forwardRef(({ className, name, palette = PREDEFINED_COLORS, useAlpha = false, alpha = 100, paletteOnly, color = '#FFFFFF', onChange, onAlphaChange, ...props }, ref)=>{
23
23
  const baseSize = 184;
24
24
  const initialRgb = hexToRgb(color);
25
25
  const defaultHsv = {
@@ -43,6 +43,7 @@ function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false,
43
43
  const blueId = useId();
44
44
  const hexId = useId();
45
45
  const alphaId = useId();
46
+ const patternId = useId();
46
47
  const gradientKnobRef = useRef(null);
47
48
  const hueKnobRef = useRef(null);
48
49
  const alphaKnobRef = useRef(null);
@@ -210,10 +211,17 @@ function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false,
210
211
  else updateColorRgb();
211
212
  }
212
213
  return /*#__PURE__*/ jsxs("div", {
214
+ ref: ref,
213
215
  className: classnames('fwe-color-picker', {
214
216
  'fwe-alpha-active': useAlpha
215
217
  }, className),
218
+ ...props,
216
219
  children: [
220
+ name && /*#__PURE__*/ jsx("input", {
221
+ type: "hidden",
222
+ name: name,
223
+ value: innerColor ?? ''
224
+ }),
217
225
  !paletteOnly && /*#__PURE__*/ jsxs("div", {
218
226
  className: "fwe-d-flex",
219
227
  children: [
@@ -345,7 +353,7 @@ function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false,
345
353
  children: [
346
354
  /*#__PURE__*/ jsx("defs", {
347
355
  children: /*#__PURE__*/ jsxs("pattern", {
348
- id: "bwsquare2px",
356
+ id: `bwsquare-alpha-${patternId}`,
349
357
  width: "4",
350
358
  height: "4",
351
359
  patternUnits: "userSpaceOnUse",
@@ -392,7 +400,7 @@ function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false,
392
400
  ry: "4",
393
401
  width: "8",
394
402
  height: "184",
395
- fill: "url(#bwsquare2px)",
403
+ fill: `url(#bwsquare-alpha-${patternId})`,
396
404
  strokeWidth: "0"
397
405
  })
398
406
  ]
@@ -594,7 +602,7 @@ function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false,
594
602
  children: [
595
603
  /*#__PURE__*/ jsx("defs", {
596
604
  children: /*#__PURE__*/ jsxs("pattern", {
597
- id: "bwsquare2px",
605
+ id: `bwsquare-remove-${patternId}`,
598
606
  width: "4",
599
607
  height: "4",
600
608
  patternUnits: "userSpaceOnUse",
@@ -641,7 +649,7 @@ function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false,
641
649
  ry: "0",
642
650
  width: "18",
643
651
  height: "18",
644
- fill: "url(#bwsquare2px)",
652
+ fill: `url(#bwsquare-remove-${patternId})`,
645
653
  strokeWidth: "0"
646
654
  })
647
655
  ]
@@ -671,5 +679,6 @@ function ColorPicker({ className, palette = PREDEFINED_COLORS, useAlpha = false,
671
679
  })
672
680
  ]
673
681
  });
674
- }
682
+ });
683
+ ColorPicker.displayName = 'ColorPicker';
675
684
  export { ColorPicker };
@@ -1,25 +1,24 @@
1
- import { type PropsWithChildren } from 'react';
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
2
  import './DatePicker.scss';
3
- export interface DatePickerOptions {
4
- minDate?: Date;
5
- maxDate?: Date;
6
- keepOpenOnDateChange?: boolean;
7
- position?: 'auto' | 'above' | 'below' | 'auto left' | 'auto center' | 'auto right' | 'above left' | 'above center' | 'above right' | 'below left' | 'below center' | 'below right';
8
- }
9
- export interface DatePickerProps {
10
- className?: string;
3
+ export interface DatePickerProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onChange' | 'value' | 'defaultValue' | 'disabled' | 'name'> {
11
4
  disabled?: boolean;
12
5
  required?: boolean;
6
+ name?: string;
13
7
  hint?: string;
14
8
  error?: string;
15
9
  value?: Date;
16
10
  defaultValue?: Date;
17
11
  formatDate?: (date: Date) => string;
18
- options?: DatePickerOptions;
12
+ minDate?: Date;
13
+ maxDate?: Date;
14
+ keepOpenOnDateChange?: boolean;
15
+ position?: 'auto' | 'above' | 'below' | 'auto left' | 'auto center' | 'auto right' | 'above left' | 'above center' | 'above right' | 'below left' | 'below center' | 'below right';
19
16
  onChange?: (date: Date) => void;
20
17
  id?: string;
21
18
  allowManualInput?: boolean;
22
19
  dateFormat?: string;
23
20
  openOnInputClick?: boolean;
24
21
  }
25
- export declare function DatePicker({ children, className, disabled, required, error, hint, value, defaultValue, formatDate, options, onChange, id: idProps, allowManualInput, dateFormat, openOnInputClick, }: PropsWithChildren<DatePickerProps>): import("react/jsx-runtime").JSX.Element;
22
+ export declare const DatePicker: (props: DatePickerProps & {
23
+ children?: import("react").ReactNode | undefined;
24
+ } & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
@@ -2,13 +2,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { IconCalendar } from "@festo-ui/react-icons";
3
3
  import classnames from "classnames";
4
4
  import flatpickr from "flatpickr";
5
- import { useEffect, useRef, useState } from "react";
5
+ import { forwardRef, useEffect, useRef, useState } from "react";
6
6
  import "./DatePicker.css";
7
7
  import { useId } from "../../utils/useId.js";
8
- function DatePicker({ children, className, disabled, required, error, hint, value, defaultValue = new Date(), formatDate = Intl.DateTimeFormat().format, options, onChange, id: idProps, allowManualInput = false, dateFormat = 'd/m/Y', openOnInputClick = true }) {
8
+ const DatePicker = /*#__PURE__*/ forwardRef(({ children, className, disabled, required, error, hint, name, value, defaultValue = new Date(), formatDate = Intl.DateTimeFormat().format, minDate, maxDate, keepOpenOnDateChange, position = 'below center', onChange, id: idProps, allowManualInput = false, dateFormat = 'd/m/Y', openOnInputClick = true, ...props }, ref)=>{
9
9
  const id = useId(idProps);
10
10
  const [open, setOpen] = useState(false);
11
11
  const [calendar, setCalendar] = useState(null);
12
+ const [selectedDate, setSelectedDate] = useState(value || defaultValue);
12
13
  const innerDefaultValue = value || defaultValue;
13
14
  function toggle() {
14
15
  const newOpen = !open;
@@ -17,9 +18,11 @@ function DatePicker({ children, className, disabled, required, error, hint, valu
17
18
  else calendar?.close();
18
19
  }
19
20
  const datePickerRef = useRef(null);
20
- const { keepOpenOnDateChange, maxDate, minDate, position = 'below center' } = options || {};
21
21
  useEffect(()=>{
22
- if (null !== calendar && void 0 !== value) calendar.setDate(value);
22
+ if (null !== calendar && void 0 !== value) {
23
+ calendar.setDate(value);
24
+ setSelectedDate(value);
25
+ }
23
26
  }, [
24
27
  calendar,
25
28
  value
@@ -27,6 +30,7 @@ function DatePicker({ children, className, disabled, required, error, hint, valu
27
30
  useEffect(()=>{
28
31
  function handleChange(date) {
29
32
  datePickerRef.current?.blur();
33
+ setSelectedDate(date);
30
34
  if (onChange) onChange(date);
31
35
  }
32
36
  function handleClose() {
@@ -78,61 +82,71 @@ function DatePicker({ children, className, disabled, required, error, hint, valu
78
82
  const handleKeyUp = (event)=>{
79
83
  if (' ' === event.key) toggle();
80
84
  };
81
- return /*#__PURE__*/ jsx("button", {
82
- className: "fr-date-picker",
85
+ return /*#__PURE__*/ jsxs("button", {
86
+ ref: ref,
87
+ className: classnames('fr-date-picker', className),
83
88
  type: "button",
84
89
  onClick: toggle,
85
90
  onKeyDown: handleKeyDown,
86
91
  onKeyUp: handleKeyUp,
87
- children: /*#__PURE__*/ jsxs("label", {
88
- className: classnames('fwe-input-text fwe-input-text-icon', className),
89
- htmlFor: id,
90
- children: [
91
- /*#__PURE__*/ jsx(IconCalendar, {
92
- className: classnames({
93
- 'fwe-color-hero': open && !disabled,
94
- 'fwe-color-control-disabled': disabled,
95
- 'icon-hover': allowManualInput && !openOnInputClick
96
- })
97
- }),
98
- /*#__PURE__*/ jsx("input", {
99
- id: id,
100
- ref: datePickerRef,
101
- "aria-label": "picked date",
102
- type: "text",
103
- readOnly: !allowManualInput,
104
- onClick: (e)=>{
105
- if (allowManualInput && !openOnInputClick) e.stopPropagation();
106
- },
107
- onKeyDown: (e)=>{
108
- if (allowManualInput && !openOnInputClick) e.stopPropagation();
109
- },
110
- onBlur: ()=>{
111
- if (allowManualInput && calendar && datePickerRef.current) {
112
- const raw = datePickerRef.current.value;
113
- if (raw) calendar.setDate(raw, true, dateFormat);
114
- }
115
- },
116
- required: required,
117
- className: classnames({
118
- 'fwe-border-hero': open && !disabled
92
+ ...props,
93
+ children: [
94
+ name && /*#__PURE__*/ jsx("input", {
95
+ type: "hidden",
96
+ name: name,
97
+ value: selectedDate ? selectedDate.toISOString() : ''
98
+ }),
99
+ /*#__PURE__*/ jsxs("label", {
100
+ className: 'fwe-input-text fwe-input-text-icon',
101
+ htmlFor: id,
102
+ children: [
103
+ /*#__PURE__*/ jsx(IconCalendar, {
104
+ className: classnames({
105
+ 'fwe-color-hero': open && !disabled,
106
+ 'fwe-color-control-disabled': disabled,
107
+ 'icon-hover': allowManualInput && !openOnInputClick
108
+ })
109
+ }),
110
+ /*#__PURE__*/ jsx("input", {
111
+ id: id,
112
+ ref: datePickerRef,
113
+ "aria-label": "picked date",
114
+ type: "text",
115
+ readOnly: !allowManualInput,
116
+ onClick: (e)=>{
117
+ if (allowManualInput && !openOnInputClick) e.stopPropagation();
118
+ },
119
+ onKeyDown: (e)=>{
120
+ if (allowManualInput && !openOnInputClick) e.stopPropagation();
121
+ },
122
+ onBlur: ()=>{
123
+ if (allowManualInput && calendar && datePickerRef.current) {
124
+ const raw = datePickerRef.current.value;
125
+ if (raw) calendar.setDate(raw, true, dateFormat);
126
+ }
127
+ },
128
+ required: required,
129
+ className: classnames({
130
+ 'fwe-border-hero': open && !disabled
131
+ }),
132
+ disabled: disabled
119
133
  }),
120
- disabled: disabled
121
- }),
122
- /*#__PURE__*/ jsx("span", {
123
- className: "fwe-input-text-label",
124
- children: children
125
- }),
126
- hint && /*#__PURE__*/ jsx("span", {
127
- className: "fwe-input-text-info",
128
- children: hint
129
- }),
130
- error && /*#__PURE__*/ jsx("span", {
131
- className: "fwe-input-text-invalid fwe-d-block",
132
- children: error
133
- })
134
- ]
135
- })
134
+ /*#__PURE__*/ jsx("span", {
135
+ className: "fwe-input-text-label",
136
+ children: children
137
+ }),
138
+ hint && /*#__PURE__*/ jsx("span", {
139
+ className: "fwe-input-text-info",
140
+ children: hint
141
+ }),
142
+ error && /*#__PURE__*/ jsx("span", {
143
+ className: "fwe-input-text-invalid fwe-d-block",
144
+ children: error
145
+ })
146
+ ]
147
+ })
148
+ ]
136
149
  });
137
- }
150
+ });
151
+ DatePicker.displayName = 'DatePicker';
138
152
  export { DatePicker };
@@ -1,19 +1,19 @@
1
- import { type PropsWithChildren } from 'react';
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
2
  import './DateRangePicker.scss';
3
- export interface DateRangePickerOptions {
4
- maxDate?: Date;
5
- minDate?: Date;
6
- keepOpenOnDateChange?: boolean;
7
- }
8
- export interface DateRangePickerProps {
9
- className?: string;
3
+ export interface DateRangePickerProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onChange' | 'defaultValue' | 'disabled' | 'name' | 'value'> {
10
4
  disabled?: boolean;
11
5
  required?: boolean;
6
+ name?: string;
12
7
  hint?: string;
13
8
  error?: string;
9
+ value?: Date[];
14
10
  defaultValue?: Date;
15
11
  formatDate?: (date: Date) => string;
16
- options?: DateRangePickerOptions;
12
+ minDate?: Date;
13
+ maxDate?: Date;
14
+ keepOpenOnDateChange?: boolean;
17
15
  onChange?: (dates: Date[]) => void;
18
16
  }
19
- export declare function DateRangePicker({ className, children, disabled, error, formatDate, hint, onChange, options, required, defaultValue, }: PropsWithChildren<DateRangePickerProps>): import("react/jsx-runtime").JSX.Element;
17
+ export declare const DateRangePicker: (props: DateRangePickerProps & {
18
+ children?: import("react").ReactNode | undefined;
19
+ } & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
@@ -1,14 +1,15 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { IconCalendar } from "@festo-ui/react-icons";
3
3
  import classnames from "classnames";
4
4
  import flatpickr from "flatpickr";
5
5
  import rangePlugin from "flatpickr/dist/plugins/rangePlugin.js";
6
- import { useEffect, useRef, useState } from "react";
6
+ import { forwardRef, useEffect, useRef, useState } from "react";
7
7
  import "./DateRangePicker.css";
8
8
  import { useId } from "../../utils/useId.js";
9
- function DateRangePicker({ className, children, disabled, error, formatDate, hint, onChange, options, required, defaultValue = new Date() }) {
9
+ const DateRangePicker = /*#__PURE__*/ forwardRef(({ className, children, disabled, error, formatDate, hint, name, onChange, minDate, maxDate, keepOpenOnDateChange, required, value, defaultValue = new Date(), ...props }, ref)=>{
10
10
  const [open, setOpen] = useState(false);
11
11
  const [calendar, setCalendar] = useState(null);
12
+ const [selectedDates, setSelectedDates] = useState([]);
12
13
  const id = useId();
13
14
  function toggle() {
14
15
  const newOpen = !open;
@@ -21,6 +22,7 @@ function DateRangePicker({ className, children, disabled, error, formatDate, hin
21
22
  const containerRef = useRef(null);
22
23
  useEffect(()=>{
23
24
  function handleChange(dates) {
25
+ setSelectedDates(dates);
24
26
  if (onChange) onChange(dates);
25
27
  }
26
28
  function handleClose() {
@@ -39,18 +41,29 @@ function DateRangePicker({ className, children, disabled, error, formatDate, hin
39
41
  position: 'below center',
40
42
  positionElement: containerRef.current,
41
43
  formatDate,
42
- closeOnSelect: !options?.keepOpenOnDateChange || true,
44
+ closeOnSelect: !keepOpenOnDateChange,
43
45
  clickOpens: false,
44
46
  onClose: handleClose,
45
- minDate: options?.minDate,
46
- maxDate: options?.maxDate
47
+ minDate,
48
+ maxDate
47
49
  }));
48
50
  }, [
49
51
  formatDate,
50
52
  onChange,
51
53
  calendar,
52
54
  defaultValue,
53
- options
55
+ keepOpenOnDateChange,
56
+ minDate,
57
+ maxDate
58
+ ]);
59
+ useEffect(()=>{
60
+ if (null !== calendar && void 0 !== value) {
61
+ calendar.setDate(value);
62
+ setSelectedDates(value);
63
+ }
64
+ }, [
65
+ calendar,
66
+ value
54
67
  ]);
55
68
  useEffect(()=>()=>{
56
69
  if (null !== calendar) calendar.destroy();
@@ -63,68 +76,86 @@ function DateRangePicker({ className, children, disabled, error, formatDate, hin
63
76
  const handleKeyUp = (event)=>{
64
77
  if (' ' === event.key) toggle();
65
78
  };
66
- return /*#__PURE__*/ jsx("button", {
67
- tabIndex: 0,
79
+ return /*#__PURE__*/ jsxs("button", {
80
+ ref: ref,
68
81
  type: "button",
69
82
  className: classnames('fr-date-range-picker', className),
70
83
  onClick: toggle,
71
84
  onKeyDown: handleKeyDown,
72
85
  onKeyUp: handleKeyUp,
73
- children: /*#__PURE__*/ jsxs("label", {
74
- className: "fwe-input-text fwe-input-text-icon",
75
- htmlFor: id,
76
- children: [
77
- /*#__PURE__*/ jsx(IconCalendar, {
78
- className: classnames({
79
- 'fwe-color-hero': open && !disabled,
80
- 'fwe-color-control-disabled': disabled
86
+ ...props,
87
+ children: [
88
+ name && /*#__PURE__*/ jsxs(Fragment, {
89
+ children: [
90
+ /*#__PURE__*/ jsx("input", {
91
+ type: "hidden",
92
+ name: `${name}-start`,
93
+ value: selectedDates[0] ? selectedDates[0].toISOString() : ''
94
+ }),
95
+ /*#__PURE__*/ jsx("input", {
96
+ type: "hidden",
97
+ name: `${name}-end`,
98
+ value: selectedDates[1] ? selectedDates[1].toISOString() : ''
81
99
  })
82
- }),
83
- /*#__PURE__*/ jsxs("div", {
84
- ref: containerRef,
85
- className: "fr-date-range-picker-inputs",
86
- children: [
87
- /*#__PURE__*/ jsx("input", {
88
- ref: inputRef,
89
- "aria-label": "picked start date",
90
- type: "text",
91
- readOnly: true,
92
- required: required,
93
- className: classnames({
94
- 'fwe-border-hero': open && !disabled
100
+ ]
101
+ }),
102
+ /*#__PURE__*/ jsxs("label", {
103
+ className: "fwe-input-text fwe-input-text-icon",
104
+ htmlFor: id,
105
+ children: [
106
+ /*#__PURE__*/ jsx(IconCalendar, {
107
+ className: classnames({
108
+ 'fwe-color-hero': open && !disabled,
109
+ 'fwe-color-control-disabled': disabled
110
+ })
111
+ }),
112
+ /*#__PURE__*/ jsxs("div", {
113
+ ref: containerRef,
114
+ className: "fr-date-range-picker-inputs",
115
+ children: [
116
+ /*#__PURE__*/ jsx("input", {
117
+ ref: inputRef,
118
+ "aria-label": "picked start date",
119
+ type: "text",
120
+ readOnly: true,
121
+ required: required,
122
+ className: classnames({
123
+ 'fwe-border-hero': open && !disabled
124
+ }),
125
+ disabled: disabled,
126
+ id: id
95
127
  }),
96
- disabled: disabled,
97
- id: id
128
+ /*#__PURE__*/ jsx("input", {
129
+ ref: input2Ref,
130
+ "aria-label": "picked end date",
131
+ type: "text",
132
+ readOnly: true,
133
+ required: required,
134
+ className: classnames({
135
+ 'fwe-border-hero': open && !disabled
136
+ }),
137
+ disabled: disabled
138
+ })
139
+ ]
140
+ }),
141
+ /*#__PURE__*/ jsx("span", {
142
+ className: classnames('fwe-input-text-label', {
143
+ 'fwe-color-text-disabled': disabled
98
144
  }),
99
- /*#__PURE__*/ jsx("input", {
100
- ref: input2Ref,
101
- "aria-label": "picked end date",
102
- type: "text",
103
- readOnly: true,
104
- required: required,
105
- className: classnames({
106
- 'fwe-border-hero': open && !disabled
107
- }),
108
- disabled: disabled
109
- })
110
- ]
111
- }),
112
- /*#__PURE__*/ jsx("span", {
113
- className: classnames('fwe-input-text-label', {
114
- 'fwe-color-text-disabled': disabled
145
+ children: children
115
146
  }),
116
- children: children
117
- }),
118
- hint && /*#__PURE__*/ jsx("span", {
119
- className: "fwe-input-text-info",
120
- children: hint
121
- }),
122
- error && /*#__PURE__*/ jsx("span", {
123
- className: "fwe-input-text-invalid fwe-d-block",
124
- children: error
125
- })
126
- ]
127
- })
147
+ hint && /*#__PURE__*/ jsx("span", {
148
+ className: "fwe-input-text-info",
149
+ children: hint
150
+ }),
151
+ error && /*#__PURE__*/ jsx("span", {
152
+ className: "fwe-input-text-invalid fwe-d-block",
153
+ children: error
154
+ })
155
+ ]
156
+ })
157
+ ]
128
158
  });
129
- }
159
+ });
160
+ DateRangePicker.displayName = 'DateRangePicker';
130
161
  export { DateRangePicker };
@@ -1,20 +1,20 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
1
2
  import './TextEditor.scss';
2
- export interface TextEditorConfiguration {
3
- toolbar?: {
4
- bold?: boolean;
5
- italic?: boolean;
6
- underline?: boolean;
7
- alignCenter?: boolean;
8
- alignRight?: boolean;
9
- bulletList?: boolean;
10
- orderedList?: boolean;
11
- image?: boolean;
12
- link?: boolean;
13
- };
3
+ export interface TextEditorToolbarConfig {
4
+ bold?: boolean;
5
+ italic?: boolean;
6
+ underline?: boolean;
7
+ alignCenter?: boolean;
8
+ alignRight?: boolean;
9
+ bulletList?: boolean;
10
+ orderedList?: boolean;
11
+ image?: boolean;
12
+ link?: boolean;
14
13
  }
15
- export interface TextEditorProps {
14
+ export interface TextEditorProps extends Omit<ComponentPropsWithoutRef<'label'>, 'onChange' | 'defaultValue'> {
16
15
  readonly disabled?: boolean;
17
16
  readonly label: string;
17
+ readonly name?: string;
18
18
  readonly maxLength?: number;
19
19
  readonly value?: string;
20
20
  readonly defaultValue?: string;
@@ -22,7 +22,6 @@ export interface TextEditorProps {
22
22
  readonly error?: string;
23
23
  readonly readOnly?: boolean;
24
24
  readonly onChange?: (value: string | null) => void;
25
- readonly className?: string;
26
- readonly config?: TextEditorConfiguration;
25
+ readonly toolbarConfig?: TextEditorToolbarConfig;
27
26
  }
28
- export declare function TextEditor({ disabled, defaultValue, label, maxLength, value, hint, error, readOnly, onChange, className, config: configProps, }: TextEditorProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare const TextEditor: (props: TextEditorProps & import("react").RefAttributes<HTMLLabelElement>) => React.ReactElement | null;
@@ -1,38 +1,34 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
- import { useCallback, useEffect, useRef, useState } from "react";
3
+ import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
4
4
  import "./TextEditor.css";
5
5
  import { IconAlignCenter, IconAlignRight, IconEnumeration, IconImage, IconLink, IconListView } from "@festo-ui/react-icons";
6
6
  import quill from "quill";
7
7
  import { filterXSS, whiteList as external_xss_whiteList } from "xss";
8
8
  import { useId } from "../../utils/useId.js";
9
9
  import { TextEditorButton } from "./TextEditorButton.js";
10
- const defaultConfig = {
11
- toolbar: {
12
- bold: true,
13
- italic: true,
14
- underline: true,
15
- alignCenter: false,
16
- alignRight: false,
17
- bulletList: true,
18
- orderedList: true,
19
- image: true,
20
- link: true
21
- }
10
+ const defaultToolbarConfig = {
11
+ bold: true,
12
+ italic: true,
13
+ underline: true,
14
+ alignCenter: false,
15
+ alignRight: false,
16
+ bulletList: true,
17
+ orderedList: true,
18
+ image: true,
19
+ link: true
22
20
  };
23
21
  function postpone(fn) {
24
22
  Promise.resolve().then(fn);
25
23
  }
26
- function TextEditor({ disabled = false, defaultValue, label, maxLength, value, hint, error, readOnly = false, onChange, className, config: configProps }) {
24
+ const TextEditor = /*#__PURE__*/ forwardRef(({ disabled = false, defaultValue, label, name, maxLength, value, hint, error, readOnly = false, onChange, className, toolbarConfig: toolbarConfigProps, ...props }, ref)=>{
27
25
  const editorRef = useRef(null);
28
26
  const [editor, setEditor] = useState(null);
29
27
  const id = useId();
30
28
  const [innerValue, setInnerValue] = useState(null);
31
- const config = {
32
- toolbar: {
33
- ...defaultConfig.toolbar,
34
- ...configProps?.toolbar
35
- }
29
+ const toolbar = {
30
+ ...defaultToolbarConfig,
31
+ ...toolbarConfigProps
36
32
  };
37
33
  const setEditorContents = useCallback((e, v)=>{
38
34
  if (e) {
@@ -90,16 +86,22 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
90
86
  defaultValue
91
87
  ]);
92
88
  useEffect(()=>{
93
- if (editor) editor.on('text-change', ()=>{
94
- let html = editor.getSemanticHTML();
95
- if ('<p><br></p>' === html || '<div><br></div>' === html || void 0 === html) html = null;
96
- if (null !== html) {
97
- const relativeLinkRegex = /href="(?!https?:\/\/|mailto:|tel:)([^"]+)"/g;
98
- html = html.replace(relativeLinkRegex, 'href="https://$1"');
99
- }
100
- if (onChange) onChange(html);
101
- setInnerValue(html);
102
- });
89
+ if (editor) {
90
+ const handler = ()=>{
91
+ let html = editor.getSemanticHTML();
92
+ if ('<p><br></p>' === html || '<div><br></div>' === html || void 0 === html) html = null;
93
+ if (null !== html) {
94
+ const relativeLinkRegex = /href="(?!https?:\/\/|mailto:|tel:)([^"]+)"/g;
95
+ html = html.replace(relativeLinkRegex, 'href="https://$1"');
96
+ }
97
+ if (onChange) onChange(html);
98
+ setInnerValue(html);
99
+ };
100
+ editor.on('text-change', handler);
101
+ return ()=>{
102
+ editor.off('text-change', handler);
103
+ };
104
+ }
103
105
  }, [
104
106
  editor,
105
107
  onChange
@@ -116,10 +118,10 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
116
118
  return innerValue?.length || 0;
117
119
  }
118
120
  function hideDivider(name) {
119
- const linkOrImage = config.toolbar?.image || config.toolbar?.link;
120
- const lists = config.toolbar?.bulletList || config.toolbar?.orderedList;
121
- const typos = config.toolbar?.bold || config.toolbar?.italic || config.toolbar?.underline;
122
- const textAlign = config.toolbar?.alignCenter || config.toolbar?.alignRight;
121
+ const linkOrImage = toolbar.image || toolbar.link;
122
+ const lists = toolbar.bulletList || toolbar.orderedList;
123
+ const typos = toolbar.bold || toolbar.italic || toolbar.underline;
124
+ const textAlign = toolbar.alignCenter || toolbar.alignRight;
123
125
  switch(name){
124
126
  case 'typo':
125
127
  return !typos || !textAlign && !linkOrImage && !lists;
@@ -128,39 +130,39 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
128
130
  case 'lists':
129
131
  return !lists || !linkOrImage;
130
132
  case 'image':
131
- return !config.toolbar?.image || !config.toolbar.link;
133
+ return !toolbar.image || !toolbar.link;
132
134
  default:
133
135
  break;
134
136
  }
135
137
  return true;
136
138
  }
137
139
  return /*#__PURE__*/ jsxs("label", {
140
+ ref: ref,
138
141
  className: classnames('fwe-input-text', {
139
- disabled
140
- }),
142
+ 'fwe-disabled': disabled
143
+ }, className),
141
144
  htmlFor: `editor-label-${id}`,
145
+ ...props,
142
146
  children: [
143
147
  /*#__PURE__*/ jsx("div", {
144
- className: classnames('fwe-editor-toolbar', {
145
- [`fwe-editor-toolbar-${className}`]: className
146
- }),
148
+ className: 'fwe-editor-toolbar',
147
149
  id: `editor-toolbar-${id}`,
148
150
  children: /*#__PURE__*/ jsxs("span", {
149
151
  className: "ql-formats fwe-mr-3",
150
152
  children: [
151
- config?.toolbar?.bold && /*#__PURE__*/ jsx(TextEditorButton, {
153
+ toolbar.bold && /*#__PURE__*/ jsx(TextEditorButton, {
152
154
  disabled: disabled,
153
155
  type: "bold",
154
156
  className: "fwe-mr-3",
155
157
  label: "B"
156
158
  }),
157
- config?.toolbar?.italic && /*#__PURE__*/ jsx(TextEditorButton, {
159
+ toolbar.italic && /*#__PURE__*/ jsx(TextEditorButton, {
158
160
  disabled: disabled,
159
161
  type: "italic",
160
162
  className: "fwe-mr-3",
161
163
  label: "I"
162
164
  }),
163
- config?.toolbar?.underline && /*#__PURE__*/ jsx(TextEditorButton, {
165
+ toolbar.underline && /*#__PURE__*/ jsx(TextEditorButton, {
164
166
  disabled: disabled,
165
167
  type: "underline",
166
168
  label: "U"
@@ -168,7 +170,7 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
168
170
  !hideDivider('typo') && /*#__PURE__*/ jsx("div", {
169
171
  className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
170
172
  }),
171
- config?.toolbar?.alignCenter && /*#__PURE__*/ jsx(TextEditorButton, {
173
+ toolbar.alignCenter && /*#__PURE__*/ jsx(TextEditorButton, {
172
174
  disabled: disabled,
173
175
  category: "align",
174
176
  type: "align-center",
@@ -179,10 +181,10 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
179
181
  }),
180
182
  value: "center",
181
183
  className: classnames({
182
- 'fwe-mr-3': config?.toolbar?.alignRight
184
+ 'fwe-mr-3': toolbar.alignRight
183
185
  })
184
186
  }),
185
- config?.toolbar?.alignRight && /*#__PURE__*/ jsx(TextEditorButton, {
187
+ toolbar.alignRight && /*#__PURE__*/ jsx(TextEditorButton, {
186
188
  disabled: disabled,
187
189
  category: "align",
188
190
  type: "align-right",
@@ -196,7 +198,7 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
196
198
  !hideDivider('text-align') && /*#__PURE__*/ jsx("div", {
197
199
  className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
198
200
  }),
199
- config?.toolbar?.bulletList && /*#__PURE__*/ jsx(TextEditorButton, {
201
+ toolbar.bulletList && /*#__PURE__*/ jsx(TextEditorButton, {
200
202
  disabled: disabled,
201
203
  className: "fwe-mr-3",
202
204
  type: "ul",
@@ -204,14 +206,14 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
204
206
  icon: /*#__PURE__*/ jsx(IconListView, {}),
205
207
  value: "bullet"
206
208
  }),
207
- config?.toolbar?.orderedList && /*#__PURE__*/ jsx(TextEditorButton, {
209
+ toolbar.orderedList && /*#__PURE__*/ jsx(TextEditorButton, {
208
210
  disabled: disabled,
209
211
  type: "ol",
210
212
  list: true,
211
213
  icon: /*#__PURE__*/ jsx(IconEnumeration, {}),
212
214
  value: "ordered"
213
215
  }),
214
- config?.toolbar?.image && /*#__PURE__*/ jsxs(Fragment, {
216
+ toolbar.image && /*#__PURE__*/ jsxs(Fragment, {
215
217
  children: [
216
218
  /*#__PURE__*/ jsx("div", {
217
219
  className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
@@ -224,7 +226,7 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
224
226
  })
225
227
  ]
226
228
  }),
227
- config?.toolbar?.link && /*#__PURE__*/ jsxs(Fragment, {
229
+ toolbar.link && /*#__PURE__*/ jsxs(Fragment, {
228
230
  children: [
229
231
  /*#__PURE__*/ jsx("div", {
230
232
  className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
@@ -254,6 +256,11 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
254
256
  className: "fwe-input-text-label",
255
257
  children: label
256
258
  }),
259
+ name && /*#__PURE__*/ jsx("input", {
260
+ type: "hidden",
261
+ name: name,
262
+ value: innerValue ?? ''
263
+ }),
257
264
  error && /*#__PURE__*/ jsx("span", {
258
265
  className: "fwe-text-editor-invalid",
259
266
  children: error
@@ -262,11 +269,12 @@ function TextEditor({ disabled = false, defaultValue, label, maxLength, value, h
262
269
  className: "fwe-text-editor-info",
263
270
  children: hint
264
271
  }),
265
- maxLength && maxLength > 0 && null != value && /*#__PURE__*/ jsx("span", {
272
+ maxLength && maxLength > 0 && (null != innerValue || null != value) && /*#__PURE__*/ jsx("span", {
266
273
  className: "fwe-input-text-count",
267
274
  children: `${currentLength()} / ${maxLength}`
268
275
  })
269
276
  ]
270
277
  });
271
- }
278
+ });
279
+ TextEditor.displayName = 'TextEditor';
272
280
  export { TextEditor };
@@ -6,7 +6,6 @@ function TextEditorButton({ disabled, label, type, className, icon, list, value,
6
6
  const btnRef = useRef(null);
7
7
  function handleClick() {
8
8
  const btn = btnRef.current;
9
- setActive((prevActive)=>!prevActive);
10
9
  btn?.click();
11
10
  }
12
11
  useEffect(()=>{
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { ColorIndicator, type ColorIndicatorProps, } from './components/color-indicator/ColorIndicator';
2
2
  export { ScrollArea, type ScrollAreaProps, } from './components/scroll-area/ScrollArea';
3
3
  export { ColorPicker, type ColorPickerProps, } from './forms/color-picker/ColorPicker';
4
- export { DatePicker, type DatePickerOptions, type DatePickerProps, } from './forms/date-picker/DatePicker';
5
- export { DateRangePicker, type DateRangePickerOptions, type DateRangePickerProps, } from './forms/date-range-picker/DateRangePicker';
6
- export { TextEditor, type TextEditorConfiguration, type TextEditorProps, } from './forms/text-editor/TextEditor';
4
+ export { DatePicker, type DatePickerProps, } from './forms/date-picker/DatePicker';
5
+ export { DateRangePicker, type DateRangePickerProps, } from './forms/date-range-picker/DateRangePicker';
6
+ export { TextEditor, type TextEditorProps, type TextEditorToolbarConfig, } from './forms/text-editor/TextEditor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@festo-ui/react-extra",
3
- "version": "9.0.1",
3
+ "version": "10.0.0-dev.827",
4
4
  "license": "apache-2.0",
5
5
  "author": "Festo UI (styleguide@festo.com)",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "dev": "rslib build --watch",
26
26
  "format": "biome check --write",
27
27
  "lint": "biome check",
28
- "storybook": "storybook dev -p 6006",
28
+ "storybook": "storybook dev -p 6008",
29
29
  "test": "rstest",
30
30
  "test:watch": "rstest --watch"
31
31
  },
@@ -40,7 +40,8 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@biomejs/biome": "2.3.2",
43
- "@chromatic-com/storybook": "^4.1.1",
43
+ "@chromatic-com/storybook": "^5.0.0",
44
+ "@festo-ui/react": "9.0.1-dev.785",
44
45
  "@rsbuild/core": "~1.6.2",
45
46
  "@rsbuild/plugin-react": "^1.4.1",
46
47
  "@rsbuild/plugin-sass": "^1.4.0",
@@ -48,25 +49,25 @@
48
49
  "@rslib/core": "^0.17.1",
49
50
  "@rstest/core": "^0.6.5",
50
51
  "@rstest/coverage-istanbul": "^0.0.5",
51
- "@storybook/addon-docs": "^9.1.16",
52
- "@storybook/react": "^9.1.16",
52
+ "@storybook/addon-docs": "^10.2.3",
53
53
  "@testing-library/jest-dom": "^6.9.1",
54
54
  "@testing-library/react": "^16.3.0",
55
- "@types/react": "^18.2.0",
55
+ "@types/react": "^19.2.0",
56
+ "@types/react-dom": "^19.2.0",
56
57
  "cross-env": "^10.1.0",
57
58
  "jsdom": "^26.1.0",
58
- "react": "^18.2.0",
59
- "react-dom": "^18.2.0",
60
- "storybook": "^9.1.16",
61
- "storybook-addon-rslib": "^2.1.3",
62
- "storybook-react-rsbuild": "^2.1.3",
59
+ "react": "^19.2.0",
60
+ "react-dom": "^19.2.0",
61
+ "storybook": "^10.2.3",
62
+ "storybook-addon-rslib": "^3.2.2",
63
+ "storybook-react-rsbuild": "^3.2.2",
63
64
  "typescript": "^5.9.3"
64
65
  },
65
66
  "peerDependencies": {
66
- "@festo-ui/react": ">=9.0.0 || >=9.0.0-dev",
67
- "@festo-ui/web-essentials": ">=9.0.0 || >=9.0.0-dev",
68
- "react": ">=17.0.0",
69
- "react-dom": ">=17.0.0"
67
+ "@festo-ui/react": "*",
68
+ "@festo-ui/web-essentials": "*",
69
+ "react": ">=18.0.0",
70
+ "react-dom": ">=18.0.0"
70
71
  },
71
72
  "copyright": "Copyright (c) 2025 Festo SE & Co. KG. All rights reserved."
72
73
  }