@festo-ui/react 9.0.1 → 10.0.0-dev.826

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 (150) 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 +9 -9
  11. package/dist/components/breadcrumb/Breadcrumb.js +86 -26
  12. package/dist/components/button/Button.js +1 -0
  13. package/dist/components/card/Card.d.ts +3 -4
  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/icon-wrapper/IconWrapper.d.ts +2 -1
  26. package/dist/components/loading-indicator/LoadingIndicator.d.ts +2 -2
  27. package/dist/components/loading-indicator/LoadingIndicator.js +1 -0
  28. package/dist/components/mobile-flyout/MobileFlyout.js +1 -0
  29. package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +1 -0
  30. package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +3 -2
  31. package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +4 -3
  32. package/dist/components/modals/AlertModal.d.ts +1 -1
  33. package/dist/components/modals/AlertModal.js +5 -4
  34. package/dist/components/modals/ConfirmModal.d.ts +1 -1
  35. package/dist/components/modals/ConfirmModal.js +5 -4
  36. package/dist/components/modals/CustomModal.js +1 -0
  37. package/dist/components/modals/Modal.js +1 -0
  38. package/dist/components/modals/ModalBase.js +1 -0
  39. package/dist/components/modals/ModalFooter.d.ts +2 -2
  40. package/dist/components/modals/ModalFooter.js +3 -1
  41. package/dist/components/modals/Prompt.d.ts +3 -3
  42. package/dist/components/modals/Prompt.js +9 -6
  43. package/dist/components/modals/image-gallery/ImageGallery.css +24 -6
  44. package/dist/components/modals/image-gallery/ImageGallery.d.ts +1 -1
  45. package/dist/components/modals/image-gallery/ImageGallery.js +1 -0
  46. package/dist/components/modals/image-gallery/ImageGallerySwiper.js +1 -1
  47. package/dist/components/modals/image-gallery/internal/ImageGalleryContainer.d.ts +1 -1
  48. package/dist/components/pagination/Pagination.d.ts +3 -4
  49. package/dist/components/pagination/Pagination.js +17 -13
  50. package/dist/components/popovers/legend/Legend.d.ts +6 -4
  51. package/dist/components/popovers/legend/Legend.js +8 -4
  52. package/dist/components/popovers/popover/Popover.css +5 -52
  53. package/dist/components/popovers/popover/Popover.d.ts +12 -14
  54. package/dist/components/popovers/popover/Popover.js +82 -91
  55. package/dist/components/popovers/popover-menu/PopoverMenu.d.ts +6 -4
  56. package/dist/components/popovers/popover-menu/PopoverMenu.js +23 -27
  57. package/dist/components/popovers/popover-menu/PopoverMenuContext.d.ts +2 -1
  58. package/dist/components/popovers/popover-menu/PopoverMenuContext.js +1 -1
  59. package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.d.ts +8 -0
  60. package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.js +31 -0
  61. package/dist/components/popovers/tooltip/Tooltip.d.ts +4 -3
  62. package/dist/components/popovers/tooltip/Tooltip.js +7 -6
  63. package/dist/components/progress/Progress.d.ts +2 -3
  64. package/dist/components/progress/Progress.js +6 -2
  65. package/dist/components/search-input/ClearButton.d.ts +1 -2
  66. package/dist/components/search-input/ClearButton.js +5 -4
  67. package/dist/components/search-input/SearchInput.d.ts +3 -4
  68. package/dist/components/search-input/SearchInput.js +9 -5
  69. package/dist/components/snackbar/Snackbar.d.ts +4 -4
  70. package/dist/components/snackbar/Snackbar.js +11 -7
  71. package/dist/components/snackbar/SnackbarProvider.d.ts +3 -3
  72. package/dist/components/snackbar/SnackbarProvider.js +7 -4
  73. package/dist/components/stepper-horizontal/StepperHorizontal.d.ts +2 -2
  74. package/dist/components/stepper-horizontal/StepperHorizontal.js +4 -3
  75. package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.js +2 -1
  76. package/dist/components/stepper-vertical/StepperVertical.js +1 -1
  77. package/dist/components/stepper-vertical/step-vertical/StepVertical.js +1 -0
  78. package/dist/components/tab/Tabs.js +3 -3
  79. package/dist/components/tab/tab-pane/TabPane.d.ts +3 -4
  80. package/dist/components/tab/tab-pane/TabPane.js +6 -2
  81. package/dist/components/table-header-cell/TableHeaderCell.d.ts +2 -1
  82. package/dist/components/table-header-cell/TableHeaderCell.js +1 -0
  83. package/dist/forms/checkbox/Checkbox.d.ts +3 -6
  84. package/dist/forms/checkbox/Checkbox.js +5 -2
  85. package/dist/forms/combobox/ComboBox.css +124 -0
  86. package/dist/forms/combobox/ComboBox.d.ts +27 -0
  87. package/dist/forms/combobox/ComboBox.js +174 -0
  88. package/dist/forms/multi-select/MultiSelect.css +13 -0
  89. package/dist/forms/multi-select/MultiSelect.d.ts +20 -0
  90. package/dist/forms/multi-select/MultiSelect.js +192 -0
  91. package/dist/forms/radio/RadioButton.d.ts +4 -4
  92. package/dist/forms/radio/RadioButton.js +11 -10
  93. package/dist/forms/radio/RadioGroup.d.ts +4 -4
  94. package/dist/forms/radio/RadioGroup.js +1 -0
  95. package/dist/forms/segment/Segment.d.ts +4 -5
  96. package/dist/forms/segment/Segment.js +10 -9
  97. package/dist/forms/segment/segment-control/SegmentControl.d.ts +4 -8
  98. package/dist/forms/segment/segment-control/SegmentControl.js +8 -6
  99. package/dist/forms/select/Select.d.ts +16 -17
  100. package/dist/forms/select/Select.js +80 -82
  101. package/dist/forms/select/internal/SelectButton.d.ts +0 -12
  102. package/dist/forms/select/internal/SelectButton.js +0 -49
  103. package/dist/forms/select/internal/SelectButtonContent.d.ts +0 -7
  104. package/dist/forms/select/internal/SelectButtonContent.js +0 -31
  105. package/dist/forms/select/internal/SelectOptionsContainer.d.ts +0 -17
  106. package/dist/forms/select/internal/SelectOptionsContainer.js +0 -103
  107. package/dist/forms/slider/Slider.d.ts +4 -7
  108. package/dist/forms/slider/Slider.js +11 -6
  109. package/dist/forms/switch/Switch.d.ts +4 -6
  110. package/dist/forms/switch/Switch.js +12 -6
  111. package/dist/forms/text-area/TextArea.d.ts +6 -15
  112. package/dist/forms/text-area/TextArea.js +42 -25
  113. package/dist/forms/text-input/TextInput.css +31 -0
  114. package/dist/forms/text-input/TextInput.d.ts +6 -17
  115. package/dist/forms/text-input/TextInput.js +16 -25
  116. package/dist/forms/time-picker/TimePicker.d.ts +7 -6
  117. package/dist/forms/time-picker/TimePicker.js +16 -31
  118. package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +1 -0
  119. package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.js +1 -0
  120. package/dist/index.d.ts +7 -5
  121. package/dist/index.js +4 -3
  122. package/dist/utils/types.d.ts +0 -6
  123. package/dist/utils/useControlled.js +4 -4
  124. package/dist/utils/useForkRef.d.ts +2 -2
  125. package/dist/utils/useForkRef.js +2 -2
  126. package/dist/utils/useOnClickOutside.d.ts +1 -1
  127. package/package.json +17 -28
  128. package/dist/components/popovers/popover-menu-item/PopoverMenuItem.d.ts +0 -9
  129. package/dist/components/popovers/popover-menu-item/PopoverMenuItem.js +0 -29
  130. package/dist/forms/select/Select.css +0 -160
  131. package/dist/forms/select/internal/HiddenInput.d.ts +0 -8
  132. package/dist/forms/select/internal/HiddenInput.js +0 -15
  133. package/dist/forms/select/internal/ListItem.d.ts +0 -18
  134. package/dist/forms/select/internal/ListItem.js +0 -69
  135. package/dist/forms/select/internal/SelectCheckbox.d.ts +0 -4
  136. package/dist/forms/select/internal/SelectCheckbox.js +0 -13
  137. package/dist/forms/select/internal/SelectLabel.d.ts +0 -7
  138. package/dist/forms/select/internal/SelectLabel.js +0 -12
  139. package/dist/forms/select/internal/SelectScrollContainer.d.ts +0 -8
  140. package/dist/forms/select/internal/SelectScrollContainer.js +0 -15
  141. package/dist/forms/select/internal/SelectWrapper.d.ts +0 -6
  142. package/dist/forms/select/internal/SelectWrapper.js +0 -12
  143. package/dist/forms/select/internal/index.d.ts +0 -6
  144. package/dist/forms/select/internal/index.js +0 -7
  145. package/dist/forms/select/internal/utils.d.ts +0 -7
  146. package/dist/forms/select/internal/utils.js +0 -30
  147. package/dist/forms/select/select-option/SelectOption.d.ts +0 -14
  148. package/dist/forms/select/select-option/SelectOption.js +0 -12
  149. package/dist/forms/select/utils.d.ts +0 -2
  150. package/dist/forms/select/utils.js +0 -12
@@ -1,10 +1,10 @@
1
1
  import './Accordion.scss';
2
- import { type ComponentPropsWithoutRef } from 'react';
3
- export interface AccordionProps extends ComponentPropsWithoutRef<'div'> {
2
+ import type React from 'react';
3
+ export interface AccordionProps extends React.ComponentPropsWithoutRef<'div'> {
4
4
  showMore?: string;
5
5
  showLess?: string;
6
6
  keepItemsOpen?: boolean;
7
7
  transparent?: boolean;
8
8
  highlighted?: boolean;
9
9
  }
10
- export declare const Accordion: (props: AccordionProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
10
+ export declare const Accordion: (props: AccordionProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -30,12 +30,13 @@ const Accordion = /*#__PURE__*/ forwardRef(({ children, showMore = 'Show more',
30
30
  value: contextValue,
31
31
  children: /*#__PURE__*/ jsx("div", {
32
32
  ref: ref,
33
+ ...props,
33
34
  className: classnames('fr-accordion', {
34
35
  'fwe-bg-white': !transparent
35
36
  }, className),
36
- ...props,
37
37
  children: children
38
38
  })
39
39
  });
40
40
  });
41
+ Accordion.displayName = 'Accordion';
41
42
  export { Accordion };
@@ -8,4 +8,5 @@ const AccordionHeader = /*#__PURE__*/ forwardRef(({ children, className, ...prop
8
8
  ...props,
9
9
  children: children
10
10
  }));
11
+ AccordionHeader.displayName = 'AccordionHeader';
11
12
  export { AccordionHeader };
@@ -3,6 +3,6 @@ import { type ComponentPropsWithoutRef } from 'react';
3
3
  export interface AccordionItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
4
4
  expanded?: boolean;
5
5
  defaultExpanded?: boolean;
6
- onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
6
+ onChange?: (expanded: boolean, event: React.SyntheticEvent) => void;
7
7
  }
8
8
  export declare const AccordionItem: (props: AccordionItemProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -17,7 +17,7 @@ const AccordionItem = /*#__PURE__*/ forwardRef(({ expanded: expandedProp, defaul
17
17
  });
18
18
  const linkText = expanded ? showLess : showMore;
19
19
  const handleChange = useCallback((event)=>{
20
- if (onChange) onChange(event, !expanded);
20
+ if (onChange) onChange(!expanded, event);
21
21
  if (!keepItemsOpen) accordionToggle?.(id, !expanded);
22
22
  setExpanded(!expanded);
23
23
  }, [
@@ -57,4 +57,5 @@ const AccordionItem = /*#__PURE__*/ forwardRef(({ expanded: expandedProp, defaul
57
57
  })
58
58
  });
59
59
  });
60
+ AccordionItem.displayName = 'AccordionItem';
60
61
  export { AccordionItem };
@@ -58,4 +58,5 @@ const AccordionItemBody = /*#__PURE__*/ forwardRef(({ children, className, ...pr
58
58
  })
59
59
  });
60
60
  });
61
+ AccordionItemBody.displayName = 'AccordionItemBody';
61
62
  export { AccordionItemBody };
@@ -17,4 +17,5 @@ const AccordionItemHeader = /*#__PURE__*/ forwardRef(({ children, className, ...
17
17
  children: children
18
18
  });
19
19
  });
20
+ AccordionItemHeader.displayName = 'AccordionItemHeader';
20
21
  export { AccordionItemHeader };
@@ -1,6 +1,5 @@
1
1
  import './BottomSheet.scss';
2
- import { type PropsWithChildren } from 'react';
3
- export interface BottomSheetProps extends PropsWithChildren {
2
+ export interface BottomSheetProps extends React.ComponentPropsWithoutRef<'div'> {
4
3
  readonly defaultExpanded?: boolean;
5
4
  readonly open?: boolean;
6
5
  readonly expandFrom?: 'center' | 'bottom';
@@ -8,4 +7,4 @@ export interface BottomSheetProps extends PropsWithChildren {
8
7
  readonly hideCloseIcon?: boolean;
9
8
  readonly onOpenChange?: (value: boolean) => void;
10
9
  }
11
- export declare function BottomSheet({ children, open, defaultExpanded, expandFrom, hasBackdrop, hideCloseIcon, onOpenChange, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare const BottomSheet: (props: BottomSheetProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,8 +1,8 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import "./BottomSheet.css";
3
3
  import classnames from "classnames";
4
- import { useState } from "react";
5
- function BottomSheet({ children, open, defaultExpanded, expandFrom = 'center', hasBackdrop = true, hideCloseIcon, onOpenChange }) {
4
+ import { forwardRef, useState } from "react";
5
+ const BottomSheet = /*#__PURE__*/ forwardRef(({ children, open, defaultExpanded, expandFrom = 'center', hasBackdrop = true, hideCloseIcon, onOpenChange, className, ...props }, ref)=>{
6
6
  const [expanded, setExpanded] = useState(defaultExpanded);
7
7
  const [isClosing, setIsClosing] = useState(false);
8
8
  const [startY, setStartY] = useState(0);
@@ -55,13 +55,15 @@ function BottomSheet({ children, open, defaultExpanded, expandFrom = 'center', h
55
55
  }
56
56
  }),
57
57
  /*#__PURE__*/ jsxs("div", {
58
+ ref: ref,
59
+ ...props,
58
60
  className: classnames('fwe-bottom-sheet-container', {
59
61
  'fwe-bottom-sheet-container--open': open,
60
62
  'fwe-bottom-sheet-container--expanded': expanded,
61
63
  'fwe-bottom-sheet-container--expand-from-center': 'center' === expandFrom,
62
64
  'fwe-bottom-sheet-container--with-backdrop': hasBackdrop,
63
65
  'fwe-bottom-sheet-container--closing': isClosing
64
- }),
66
+ }, className),
65
67
  onTouchStart: handleTouchStart,
66
68
  onTouchMove: handleTouchMove,
67
69
  children: [
@@ -97,5 +99,6 @@ function BottomSheet({ children, open, defaultExpanded, expandFrom = 'center', h
97
99
  })
98
100
  ]
99
101
  });
100
- }
102
+ });
103
+ BottomSheet.displayName = 'BottomSheet';
101
104
  export { BottomSheet };
@@ -1,13 +1,13 @@
1
- import React from 'react';
2
- import type { ClassNamePropsWithChildren } from '../../utils/types';
3
- export interface BreadcrumbProps extends ClassNamePropsWithChildren {
4
- readonly locations?: {
5
- label: string;
6
- url: string;
7
- }[];
8
- readonly onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
1
+ import { type ComponentPropsWithoutRef, type MouseEvent, type PropsWithChildren } from 'react';
2
+ export interface BreadcrumbLocation {
3
+ label: string;
4
+ url: string;
5
+ }
6
+ export interface BreadcrumbProps extends PropsWithChildren, ComponentPropsWithoutRef<'nav'> {
7
+ readonly locations?: BreadcrumbLocation[];
8
+ readonly onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
9
9
  }
10
10
  /**
11
11
  * Breadcrumb navigation can be used on pages with multiple navigation levels.
12
12
  */
13
- export declare function Breadcrumb({ locations, onClick, children, className, }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare const Breadcrumb: (props: BreadcrumbProps & import("react").RefAttributes<HTMLElement>) => React.ReactElement | null;
@@ -1,32 +1,92 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
- import react from "react";
4
- function Breadcrumb({ locations, onClick, children, className }) {
5
- const childrenList = [];
6
- react.Children.forEach(children, (element)=>{
7
- if (/*#__PURE__*/ react.isValidElement(element)) childrenList.push({
8
- ...element,
9
- props: {
10
- ...element.props,
11
- className: 'fr-breadcrumb-location'
12
- }
13
- });
3
+ import { Children, cloneElement, forwardRef, isValidElement, useCallback, useEffect, useRef, useState } from "react";
4
+ import { useForkRef } from "../../utils/useForkRef.js";
5
+ const Breadcrumb = /*#__PURE__*/ forwardRef(({ locations, onClick, children, className, ...props }, ref)=>{
6
+ const containerRef = useRef(null);
7
+ const measureRef = useRef(null);
8
+ const combinedRef = useForkRef(ref, containerRef);
9
+ const [isMobile, setIsMobile] = useState(false);
10
+ function isValidHtmlChildElement(child) {
11
+ return /*#__PURE__*/ isValidElement(child);
12
+ }
13
+ const childrenList = Children.toArray(children).filter(isValidHtmlChildElement);
14
+ const listItems = locations ? locations.map((location, index)=>{
15
+ const isCurrent = index === locations.length - 1;
16
+ return /*#__PURE__*/ jsx("li", {
17
+ children: /*#__PURE__*/ jsx("a", {
18
+ href: location.url,
19
+ onClick: (e)=>onClick ? onClick(e) : void 0,
20
+ "aria-current": isCurrent ? 'page' : void 0,
21
+ children: location.label
22
+ })
23
+ }, location.url);
24
+ }) : childrenList.map((child, index)=>{
25
+ const isCurrent = index === childrenList.length - 1;
26
+ const content = isCurrent ? /*#__PURE__*/ cloneElement(child, {
27
+ 'aria-current': child.props['aria-current'] ?? 'page'
28
+ }) : child;
29
+ return /*#__PURE__*/ jsx("li", {
30
+ children: content
31
+ }, child.key ?? index);
14
32
  });
15
- return /*#__PURE__*/ jsx("div", {
16
- className: classnames('fwe-breadcrumb', className),
17
- children: locations ? locations.map((location)=>/*#__PURE__*/ jsx(react.Fragment, {
18
- children: /*#__PURE__*/ jsx("a", {
19
- className: "fr-breadcrumb-location",
20
- href: location.url,
21
- onClick: (e)=>onClick ? onClick(e) : void 0,
22
- children: location.label
33
+ const measure = useCallback(()=>{
34
+ const container = containerRef.current;
35
+ const measureElement = measureRef.current;
36
+ if (!container || !measureElement) return;
37
+ const availableWidth = container.clientWidth;
38
+ const contentWidth = measureElement.scrollWidth;
39
+ const nextIsMobile = contentWidth > availableWidth;
40
+ setIsMobile((previous)=>previous === nextIsMobile ? previous : nextIsMobile);
41
+ }, []);
42
+ useEffect(()=>{
43
+ measure();
44
+ });
45
+ useEffect(()=>{
46
+ const container = containerRef.current;
47
+ const measureElement = measureRef.current;
48
+ if (!container || !measureElement) return;
49
+ if ('undefined' == typeof ResizeObserver) {
50
+ window.addEventListener('resize', measure);
51
+ return ()=>window.removeEventListener('resize', measure);
52
+ }
53
+ const observer = new ResizeObserver(()=>measure());
54
+ observer.observe(container);
55
+ observer.observe(measureElement);
56
+ return ()=>observer.disconnect();
57
+ }, [
58
+ measure
59
+ ]);
60
+ return /*#__PURE__*/ jsxs("div", {
61
+ className: className,
62
+ children: [
63
+ /*#__PURE__*/ jsx("nav", {
64
+ className: classnames('fwe-breadcrumb'),
65
+ ref: measureRef,
66
+ style: {
67
+ position: 'absolute',
68
+ visibility: 'hidden',
69
+ pointerEvents: 'none',
70
+ whiteSpace: 'nowrap',
71
+ height: 0,
72
+ overflow: 'hidden'
73
+ },
74
+ "aria-hidden": "true",
75
+ children: /*#__PURE__*/ jsx("ol", {
76
+ children: listItems
77
+ })
78
+ }),
79
+ /*#__PURE__*/ jsx("nav", {
80
+ ...props,
81
+ className: classnames('fwe-breadcrumb', isMobile && 'fwe-breadcrumb--mobile'),
82
+ ref: combinedRef,
83
+ "aria-label": "Breadcrumb",
84
+ children: /*#__PURE__*/ jsx("ol", {
85
+ children: listItems
23
86
  })
24
- }, location.url)) : childrenList.map((child)=>/*#__PURE__*/ jsxs(react.Fragment, {
25
- children: [
26
- child,
27
- " "
28
- ]
29
- }, child.props.children))
87
+ })
88
+ ]
30
89
  });
31
- }
90
+ });
91
+ Breadcrumb.displayName = 'Breadcrumb';
32
92
  export { Breadcrumb };
@@ -33,4 +33,5 @@ const Button = /*#__PURE__*/ forwardRef(({ icon, type = 'button', disabled = fal
33
33
  ]
34
34
  });
35
35
  });
36
+ Button.displayName = 'Button';
36
37
  export { Button };
@@ -1,4 +1,3 @@
1
- import type { ClassNamePropsWithChildren } from '../../utils/types';
2
- export interface CardProps extends ClassNamePropsWithChildren {
3
- }
4
- export declare function Card({ children, className }: CardProps): JSX.Element;
1
+ import type React from 'react';
2
+ export type CardProps = React.ComponentPropsWithoutRef<'div'>;
3
+ export declare const Card: (props: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,9 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
- function Card({ children, className }) {
4
- return /*#__PURE__*/ jsx("div", {
3
+ import { forwardRef } from "react";
4
+ const Card = /*#__PURE__*/ forwardRef(({ children, className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
5
5
  className: classnames('fwe-card', className),
6
+ ref: ref,
7
+ ...props,
6
8
  children: children
7
- });
8
- }
9
+ }));
10
+ Card.displayName = 'Card';
9
11
  export { Card };
@@ -1,5 +1,5 @@
1
- import type { ClassNamePropsWithChildren } from '../../utils/types';
2
- export interface CardBodyProps extends ClassNamePropsWithChildren {
1
+ import type React from 'react';
2
+ export interface CardBodyProps extends React.ComponentPropsWithoutRef<'div'> {
3
3
  text: string;
4
4
  }
5
- export declare function CardBody({ children, text, className }: CardBodyProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare const CardBody: (props: CardBodyProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,8 +1,10 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
- function CardBody({ children, text, className }) {
4
- return /*#__PURE__*/ jsxs("div", {
3
+ import { forwardRef } from "react";
4
+ const CardBody = /*#__PURE__*/ forwardRef(({ children, text, className, ...props }, ref)=>/*#__PURE__*/ jsxs("div", {
5
5
  className: classnames('fwe-card-body', className),
6
+ ref: ref,
7
+ ...props,
6
8
  children: [
7
9
  /*#__PURE__*/ jsx("div", {
8
10
  className: "fwe-card-text",
@@ -10,6 +12,6 @@ function CardBody({ children, text, className }) {
10
12
  }),
11
13
  children
12
14
  ]
13
- });
14
- }
15
+ }));
16
+ CardBody.displayName = 'CardBody';
15
17
  export { CardBody };
@@ -1,8 +1,8 @@
1
- import type { ClassNameProps, Image } from '../../utils/types';
2
- export interface CardHeaderProps extends ClassNameProps {
1
+ import type { Image } from '../../utils/types';
2
+ export interface CardHeaderProps extends React.ComponentPropsWithoutRef<'div'> {
3
3
  title: string;
4
4
  subtitle?: string;
5
5
  action?: React.ReactNode;
6
6
  image?: Image;
7
7
  }
8
- export declare function CardHeader({ title, subtitle, action, image, className, }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare const CardHeader: (props: CardHeaderProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
- function CardHeader({ title, subtitle, action, image, className }) {
4
- return /*#__PURE__*/ jsxs(Fragment, {
3
+ import { forwardRef } from "react";
4
+ const CardHeader = /*#__PURE__*/ forwardRef(({ title, subtitle, action, image, className, ...props }, ref)=>/*#__PURE__*/ jsxs(Fragment, {
5
5
  children: [
6
6
  image ? /*#__PURE__*/ jsx("img", {
7
7
  alt: image.alt,
@@ -10,6 +10,8 @@ function CardHeader({ title, subtitle, action, image, className }) {
10
10
  }) : null,
11
11
  /*#__PURE__*/ jsxs("div", {
12
12
  className: classnames('fwe-card-header', className),
13
+ ref: ref,
14
+ ...props,
13
15
  children: [
14
16
  /*#__PURE__*/ jsxs("div", {
15
17
  className: "fwe-card-title",
@@ -26,6 +28,6 @@ function CardHeader({ title, subtitle, action, image, className }) {
26
28
  ]
27
29
  })
28
30
  ]
29
- });
30
- }
31
+ }));
32
+ CardHeader.displayName = 'CardHeader';
31
33
  export { CardHeader };
@@ -1,6 +1,5 @@
1
- import type { ClassNameProps } from '../../utils/types';
2
- export interface CardNotificationProps extends ClassNameProps {
1
+ export interface CardNotificationProps extends React.ComponentPropsWithoutRef<'div'> {
3
2
  title: string;
4
3
  message?: string;
5
4
  }
6
- export declare function CardNotification({ className, title, message, }: CardNotificationProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare const CardNotification: (props: CardNotificationProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,10 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { IconWarning } from "@festo-ui/react-icons";
3
3
  import classnames from "classnames";
4
- function CardNotification({ className, title, message }) {
4
+ import { forwardRef } from "react";
5
+ const CardNotification = /*#__PURE__*/ forwardRef(({ className, title, message, ...props }, ref)=>{
5
6
  const classes = classnames('fwe-card-notification', className);
6
7
  return /*#__PURE__*/ jsxs("div", {
7
8
  className: classes,
9
+ ref: ref,
10
+ ...props,
8
11
  children: [
9
12
  /*#__PURE__*/ jsx(IconWarning, {
10
13
  size: 24
@@ -22,5 +25,6 @@ function CardNotification({ className, title, message }) {
22
25
  })
23
26
  ]
24
27
  });
25
- }
28
+ });
29
+ CardNotification.displayName = 'CardNotification';
26
30
  export { CardNotification };
@@ -1,17 +1,16 @@
1
1
  import type React from 'react';
2
- import type { ClassNamePropsWithChildren } from '../../../utils/types';
3
2
  export declare enum ChipType {
4
3
  Choice = 0,
5
4
  Category = 1,
6
5
  Filter = 2,
7
- Readonly = 3
6
+ Action = 3,
7
+ Readonly = 4
8
8
  }
9
- export interface ChipProps extends ClassNamePropsWithChildren {
9
+ export interface ChipProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'type'> {
10
10
  readonly type?: ChipType;
11
11
  readonly icon?: React.ReactNode;
12
12
  readonly selected?: boolean;
13
13
  readonly disabled?: boolean;
14
14
  readonly large?: boolean;
15
- readonly onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
16
15
  }
17
- export declare function Chip({ type, selected, disabled, large, icon, children, onClick, className, }: ChipProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare const Chip: (props: ChipProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
@@ -1,14 +1,16 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
+ import { forwardRef } from "react";
3
4
  import { IconWrapper } from "../../icon-wrapper/IconWrapper.js";
4
5
  var Chip_ChipType = /*#__PURE__*/ function(ChipType) {
5
6
  ChipType[ChipType["Choice"] = 0] = "Choice";
6
7
  ChipType[ChipType["Category"] = 1] = "Category";
7
8
  ChipType[ChipType["Filter"] = 2] = "Filter";
8
- ChipType[ChipType["Readonly"] = 3] = "Readonly";
9
+ ChipType[ChipType["Action"] = 3] = "Action";
10
+ ChipType[ChipType["Readonly"] = 4] = "Readonly";
9
11
  return ChipType;
10
12
  }({});
11
- function Chip({ type = 0, selected = false, disabled = false, large = false, icon, children, onClick, className }) {
13
+ const Chip = /*#__PURE__*/ forwardRef(({ type = 0, selected = false, disabled = false, large = false, icon, children, onClick, className, ...props }, ref)=>{
12
14
  const classes = classnames('fr-chip', 'fwe-chip', {
13
15
  'fwe-selected': selected
14
16
  }, {
@@ -20,13 +22,17 @@ function Chip({ type = 0, selected = false, disabled = false, large = false, ico
20
22
  }, {
21
23
  'fwe-filter': 2 === type
22
24
  }, {
23
- 'fwe-readonly': 3 === type
25
+ 'fwe-action': 3 === type
26
+ }, {
27
+ 'fwe-readonly': 4 === type
24
28
  }, className);
25
29
  return /*#__PURE__*/ jsxs("button", {
26
30
  type: "button",
27
31
  className: classes,
28
32
  onClick: onClick,
29
33
  disabled: disabled,
34
+ ref: ref,
35
+ ...props,
30
36
  children: [
31
37
  /*#__PURE__*/ jsx(IconWrapper, {
32
38
  icon: icon
@@ -34,5 +40,6 @@ function Chip({ type = 0, selected = false, disabled = false, large = false, ico
34
40
  children
35
41
  ]
36
42
  });
37
- }
43
+ });
44
+ Chip.displayName = 'Chip';
38
45
  export { Chip, Chip_ChipType as ChipType };
@@ -1,5 +1,5 @@
1
- import type { ClassNamePropsWithChildren } from '../../../utils/types';
2
- export interface ChipContainerProps extends ClassNamePropsWithChildren {
1
+ import type React from 'react';
2
+ export interface ChipContainerProps extends React.ComponentPropsWithoutRef<'div'> {
3
3
  readonly large?: boolean;
4
4
  }
5
- export declare function ChipContainer({ large, children, className, }: ChipContainerProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare const ChipContainer: (props: ChipContainerProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1,12 +1,16 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
- function ChipContainer({ large = false, children, className }) {
3
+ import { forwardRef } from "react";
4
+ const ChipContainer = /*#__PURE__*/ forwardRef(({ large = false, children, className, ...props }, ref)=>{
4
5
  const classes = classnames('fwe-chip-container', {
5
6
  'fwe-chip-container-lg': large
6
7
  }, className);
7
8
  return /*#__PURE__*/ jsx("div", {
8
9
  className: classes,
10
+ ref: ref,
11
+ ...props,
9
12
  children: children
10
13
  });
11
- }
14
+ });
15
+ ChipContainer.displayName = 'ChipContainer';
12
16
  export { ChipContainer };
@@ -1,6 +1,7 @@
1
+ import type { ReactNode } from 'react';
1
2
  /**
2
3
  * Internal wrapper for icons.
3
4
  */
4
5
  export declare function IconWrapper({ icon }: {
5
- readonly icon: React.ReactNode;
6
+ readonly icon: ReactNode;
6
7
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,5 +1,5 @@
1
- import { type ComponentPropsWithRef } from 'react';
2
- export interface LoadingIndicatorProps extends ComponentPropsWithRef<'div'> {
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ export interface LoadingIndicatorProps extends ComponentPropsWithoutRef<'div'> {
3
3
  readonly size: 'large' | 'medium' | 'small';
4
4
  }
5
5
  export declare const LoadingIndicator: (props: LoadingIndicatorProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -38,4 +38,5 @@ const LoadingIndicator = /*#__PURE__*/ forwardRef(({ size = 'large', children, c
38
38
  ]
39
39
  });
40
40
  });
41
+ LoadingIndicator.displayName = 'LoadingIndicator';
41
42
  export { LoadingIndicator };
@@ -85,4 +85,5 @@ const MobileFlyout = /*#__PURE__*/ forwardRef(({ className, children, open, onOp
85
85
  ]
86
86
  });
87
87
  });
88
+ MobileFlyout.displayName = 'MobileFlyout';
88
89
  export { MobileFlyout };
@@ -6,6 +6,7 @@ export interface MobileFlyoutItemBaseProps {
6
6
  icon?: React.ReactNode;
7
7
  pageLink?: string;
8
8
  active?: boolean;
9
+ className?: string;
9
10
  }
10
11
  export type MobileFlyoutItemProps<C extends React.ElementType> = PolymorphicComponentPropWithRef<C, MobileFlyoutItemBaseProps>;
11
12
  export declare const MobileFlyoutItem: <C extends React.ElementType = "a">(props: MobileFlyoutItemBaseProps & {
@@ -4,7 +4,7 @@ import classnames from "classnames";
4
4
  import { forwardRef, useContext } from "react";
5
5
  import { IconWrapper } from "../../icon-wrapper/IconWrapper.js";
6
6
  import { MobileFlyoutContext } from "../MobileFlyoutContext.js";
7
- const MobileFlyoutItem = /*#__PURE__*/ forwardRef(({ component, children, pageLink, icon, onClick, active, ...props }, ref)=>{
7
+ const MobileFlyoutItem = /*#__PURE__*/ forwardRef(({ component, children, pageLink, icon, onClick, active, className, ...props }, ref)=>{
8
8
  const Component = component || 'a';
9
9
  const { setVisible, setOpen } = useContext(MobileFlyoutContext);
10
10
  function handleClick(e) {
@@ -13,7 +13,7 @@ const MobileFlyoutItem = /*#__PURE__*/ forwardRef(({ component, children, pageLi
13
13
  onClick?.(e);
14
14
  }
15
15
  return /*#__PURE__*/ jsxs(Component, {
16
- className: "fwe-mobile-flyout-item fwe-bb",
16
+ className: classnames('fwe-mobile-flyout-item fwe-bb', className),
17
17
  ...props,
18
18
  ref: ref,
19
19
  onClick: handleClick,
@@ -33,4 +33,5 @@ const MobileFlyoutItem = /*#__PURE__*/ forwardRef(({ component, children, pageLi
33
33
  ]
34
34
  });
35
35
  });
36
+ MobileFlyoutItem.displayName = 'MobileFlyoutItem';
36
37
  export { MobileFlyoutItem };
@@ -3,7 +3,7 @@ import "./MobileFlyoutPage.css";
3
3
  import classnames from "classnames";
4
4
  import { forwardRef, useContext } from "react";
5
5
  import { MobileFlyoutContext } from "../MobileFlyoutContext.js";
6
- const MobileFlyoutPage = /*#__PURE__*/ forwardRef(({ back, children, name, root, ...props }, ref)=>{
6
+ const MobileFlyoutPage = /*#__PURE__*/ forwardRef(({ back, children, name, root, className, ...props }, ref)=>{
7
7
  const { visible, setVisible, back: backContext } = useContext(MobileFlyoutContext);
8
8
  const innerVisible = root || name && visible.includes(name);
9
9
  const innerBack = back ?? backContext ?? 'Back';
@@ -11,11 +11,11 @@ const MobileFlyoutPage = /*#__PURE__*/ forwardRef(({ back, children, name, root,
11
11
  if (name) setVisible(name);
12
12
  }
13
13
  return /*#__PURE__*/ jsxs("div", {
14
+ ...props,
14
15
  className: classnames('fwe-mobile-flyout-page', {
15
16
  'fwe-opened': innerVisible
16
- }),
17
+ }, className),
17
18
  ref: ref,
18
- ...props,
19
19
  children: [
20
20
  !root && /*#__PURE__*/ jsx("button", {
21
21
  type: "button",
@@ -32,4 +32,5 @@ const MobileFlyoutPage = /*#__PURE__*/ forwardRef(({ back, children, name, root,
32
32
  ]
33
33
  });
34
34
  });
35
+ MobileFlyoutPage.displayName = 'MobileFlyoutPage';
35
36
  export { MobileFlyoutPage };
@@ -9,4 +9,4 @@ export interface AlertModalProps extends Omit<ModalProps, 'head' | 'children'> {
9
9
  readonly onCancel?: () => void;
10
10
  readonly onOk?: () => void;
11
11
  }
12
- export declare function AlertModal({ title, subtitle, alertType, strong, cancel, ok, onCancel, onOk, className, body, ...props }: AlertModalProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare const AlertModal: (props: AlertModalProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;