@festo-ui/react 10.1.0-dev.864 → 10.1.0-dev.866

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 (207) hide show
  1. package/dist/components/accordion/Accordion.css +4 -0
  2. package/dist/components/accordion/Accordion.d.ts +10 -0
  3. package/dist/components/accordion/Accordion.js +42 -0
  4. package/dist/components/accordion/AccordionContext.d.ts +11 -0
  5. package/dist/components/accordion/AccordionContext.js +3 -0
  6. package/dist/components/accordion/accordion-header/AccordionHeader.css +11 -0
  7. package/dist/components/accordion/accordion-header/AccordionHeader.d.ts +2 -0
  8. package/dist/components/accordion/accordion-header/AccordionHeader.js +12 -0
  9. package/dist/components/accordion/accordion-item/AccordionItem.css +64 -0
  10. package/dist/components/accordion/accordion-item/AccordionItem.d.ts +8 -0
  11. package/dist/components/accordion/accordion-item/AccordionItem.js +61 -0
  12. package/dist/components/accordion/accordion-item/AccordionItemContext.d.ts +7 -0
  13. package/dist/components/accordion/accordion-item/AccordionItemContext.js +3 -0
  14. package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.css +76 -0
  15. package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +2 -0
  16. package/dist/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +56 -0
  17. package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.css +11 -0
  18. package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +2 -0
  19. package/dist/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +21 -0
  20. package/dist/components/bottom-sheet/BottomSheet.css +18 -0
  21. package/dist/components/bottom-sheet/BottomSheet.d.ts +10 -0
  22. package/dist/components/bottom-sheet/BottomSheet.js +104 -0
  23. package/dist/components/breadcrumb/Breadcrumb.d.ts +13 -0
  24. package/dist/components/breadcrumb/Breadcrumb.js +61 -0
  25. package/dist/components/button/Button.d.ts +11 -0
  26. package/dist/components/button/Button.js +37 -0
  27. package/dist/components/card/Card.d.ts +3 -0
  28. package/dist/components/card/Card.js +11 -0
  29. package/dist/components/card/CardBody.d.ts +5 -0
  30. package/dist/components/card/CardBody.js +17 -0
  31. package/dist/components/card/CardHeader.d.ts +8 -0
  32. package/dist/components/card/CardHeader.js +33 -0
  33. package/dist/components/card/CardHeader.stories.helper.js +7 -0
  34. package/dist/components/card/CardNotification.d.ts +5 -0
  35. package/dist/components/card/CardNotification.js +30 -0
  36. package/dist/components/chips/chip/Chip.d.ts +16 -0
  37. package/dist/components/chips/chip/Chip.js +45 -0
  38. package/dist/components/chips/chip-container/ChipContainer.d.ts +5 -0
  39. package/dist/components/chips/chip-container/ChipContainer.js +16 -0
  40. package/dist/components/icon-wrapper/IconWrapper.d.ts +7 -0
  41. package/dist/components/icon-wrapper/IconWrapper.js +13 -0
  42. package/dist/components/loading-indicator/LoadingIndicator.d.ts +5 -0
  43. package/dist/components/loading-indicator/LoadingIndicator.js +42 -0
  44. package/dist/components/mobile-flyout/MobileFlyout.d.ts +11 -0
  45. package/dist/components/mobile-flyout/MobileFlyout.js +89 -0
  46. package/dist/components/mobile-flyout/MobileFlyoutContext.d.ts +8 -0
  47. package/dist/components/mobile-flyout/MobileFlyoutContext.js +3 -0
  48. package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +18 -0
  49. package/dist/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +37 -0
  50. package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.css +5 -0
  51. package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.d.ts +8 -0
  52. package/dist/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +36 -0
  53. package/dist/components/modals/AlertModal.d.ts +12 -0
  54. package/dist/components/modals/AlertModal.js +54 -0
  55. package/dist/components/modals/ConfirmModal.d.ts +11 -0
  56. package/dist/components/modals/ConfirmModal.js +47 -0
  57. package/dist/components/modals/CustomModal.d.ts +8 -0
  58. package/dist/components/modals/CustomModal.js +39 -0
  59. package/dist/components/modals/Modal.css +39 -0
  60. package/dist/components/modals/Modal.d.ts +8 -0
  61. package/dist/components/modals/Modal.js +32 -0
  62. package/dist/components/modals/ModalBase.d.ts +10 -0
  63. package/dist/components/modals/ModalBase.js +125 -0
  64. package/dist/components/modals/ModalFooter.d.ts +2 -0
  65. package/dist/components/modals/ModalFooter.js +14 -0
  66. package/dist/components/modals/Prompt.d.ts +15 -0
  67. package/dist/components/modals/Prompt.js +61 -0
  68. package/dist/components/modals/image-gallery/ImageGallery.css +833 -0
  69. package/dist/components/modals/image-gallery/ImageGallery.d.ts +21 -0
  70. package/dist/components/modals/image-gallery/ImageGallery.helper.d.ts +2 -0
  71. package/dist/components/modals/image-gallery/ImageGallery.helper.js +13 -0
  72. package/dist/components/modals/image-gallery/ImageGallery.js +104 -0
  73. package/dist/components/modals/image-gallery/ImageGallery.stories.helper.js +112 -0
  74. package/dist/components/modals/image-gallery/ImageGalleryContent.d.ts +8 -0
  75. package/dist/components/modals/image-gallery/ImageGalleryContent.js +15 -0
  76. package/dist/components/modals/image-gallery/ImageGalleryScale.d.ts +6 -0
  77. package/dist/components/modals/image-gallery/ImageGalleryScale.js +15 -0
  78. package/dist/components/modals/image-gallery/ImageGallerySwiper.d.ts +12 -0
  79. package/dist/components/modals/image-gallery/ImageGallerySwiper.js +40 -0
  80. package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.d.ts +7 -0
  81. package/dist/components/modals/image-gallery/ImageGalleryThumbsSwiper.js +27 -0
  82. package/dist/components/modals/image-gallery/internal/CloseButton.d.ts +6 -0
  83. package/dist/components/modals/image-gallery/internal/CloseButton.js +14 -0
  84. package/dist/components/modals/image-gallery/internal/ImageGalleryContainer.d.ts +5 -0
  85. package/dist/components/modals/image-gallery/internal/ImageGalleryContainer.js +8 -0
  86. package/dist/components/modals/image-gallery/internal/ImageGalleryPagination.d.ts +5 -0
  87. package/dist/components/modals/image-gallery/internal/ImageGalleryPagination.js +29 -0
  88. package/dist/components/pagination/Pagination.css +10 -0
  89. package/dist/components/pagination/Pagination.d.ts +10 -0
  90. package/dist/components/pagination/Pagination.js +98 -0
  91. package/dist/components/popovers/legend/Legend.d.ts +11 -0
  92. package/dist/components/popovers/legend/Legend.js +25 -0
  93. package/dist/components/popovers/popover/Popover.css +9 -0
  94. package/dist/components/popovers/popover/Popover.d.ts +19 -0
  95. package/dist/components/popovers/popover/Popover.js +99 -0
  96. package/dist/components/popovers/popover-menu/PopoverMenu.d.ts +9 -0
  97. package/dist/components/popovers/popover-menu/PopoverMenu.js +33 -0
  98. package/dist/components/popovers/popover-menu/PopoverMenuContext.d.ts +4 -0
  99. package/dist/components/popovers/popover-menu/PopoverMenuContext.js +5 -0
  100. package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.d.ts +9 -0
  101. package/dist/components/popovers/popover-menu/popover-menu-item/PopoverMenuItem.js +31 -0
  102. package/dist/components/popovers/tooltip/Tooltip.d.ts +6 -0
  103. package/dist/components/popovers/tooltip/Tooltip.js +13 -0
  104. package/dist/components/progress/Progress.d.ts +6 -0
  105. package/dist/components/progress/Progress.js +30 -0
  106. package/dist/components/search-input/SearchInput.css +25 -0
  107. package/dist/components/search-input/SearchInput.d.ts +25 -0
  108. package/dist/components/search-input/SearchInput.js +89 -0
  109. package/dist/components/search-input/SearchInputOption.d.ts +5 -0
  110. package/dist/components/search-input/SearchInputOption.js +18 -0
  111. package/dist/components/search-input/SearchResult.d.ts +8 -0
  112. package/dist/components/search-input/SearchResult.js +48 -0
  113. package/dist/components/snackbar/Snackbar.css +55 -0
  114. package/dist/components/snackbar/Snackbar.d.ts +21 -0
  115. package/dist/components/snackbar/Snackbar.js +82 -0
  116. package/dist/components/snackbar/SnackbarContext.d.ts +7 -0
  117. package/dist/components/snackbar/SnackbarContext.js +3 -0
  118. package/dist/components/snackbar/SnackbarProvider.d.ts +7 -0
  119. package/dist/components/snackbar/SnackbarProvider.js +69 -0
  120. package/dist/components/snackbar/useSnackbar.d.ts +2 -0
  121. package/dist/components/snackbar/useSnackbar.js +4 -0
  122. package/dist/components/stepper-horizontal/StepperHorizontal.css +6 -0
  123. package/dist/components/stepper-horizontal/StepperHorizontal.d.ts +7 -0
  124. package/dist/components/stepper-horizontal/StepperHorizontal.js +49 -0
  125. package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.css +24 -0
  126. package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +6 -0
  127. package/dist/components/stepper-horizontal/step-horizontal/StepHorizontal.js +17 -0
  128. package/dist/components/stepper-vertical/StepperVertical.d.ts +6 -0
  129. package/dist/components/stepper-vertical/StepperVertical.js +26 -0
  130. package/dist/components/stepper-vertical/step-vertical/StepVertical.css +10 -0
  131. package/dist/components/stepper-vertical/step-vertical/StepVertical.d.ts +11 -0
  132. package/dist/components/stepper-vertical/step-vertical/StepVertical.js +59 -0
  133. package/dist/components/tab/Tabs.css +285 -0
  134. package/dist/components/tab/Tabs.d.ts +22 -0
  135. package/dist/components/tab/Tabs.js +194 -0
  136. package/dist/components/tab/interfaces.d.ts +5 -0
  137. package/dist/components/tab/interfaces.js +0 -0
  138. package/dist/components/tab/tab-pane/TabPane.css +8 -0
  139. package/dist/components/tab/tab-pane/TabPane.d.ts +8 -0
  140. package/dist/components/tab/tab-pane/TabPane.js +22 -0
  141. package/dist/components/tab/useTabScroll.d.ts +25 -0
  142. package/dist/components/tab/useTabScroll.js +151 -0
  143. package/dist/components/table-header-cell/TableHeaderCell.d.ts +6 -0
  144. package/dist/components/table-header-cell/TableHeaderCell.js +22 -0
  145. package/dist/forms/checkbox/Checkbox.css +134 -0
  146. package/dist/forms/checkbox/Checkbox.d.ts +12 -0
  147. package/dist/forms/checkbox/Checkbox.js +83 -0
  148. package/dist/forms/combobox/ComboBox.css +124 -0
  149. package/dist/forms/combobox/ComboBox.d.ts +27 -0
  150. package/dist/forms/combobox/ComboBox.js +174 -0
  151. package/dist/forms/multi-select/MultiSelect.css +13 -0
  152. package/dist/forms/multi-select/MultiSelect.d.ts +20 -0
  153. package/dist/forms/multi-select/MultiSelect.js +192 -0
  154. package/dist/forms/radio/RadioButton.d.ts +14 -0
  155. package/dist/forms/radio/RadioButton.js +57 -0
  156. package/dist/forms/radio/RadioGroup.d.ts +12 -0
  157. package/dist/forms/radio/RadioGroup.js +51 -0
  158. package/dist/forms/radio/RadioGroupContext.d.ts +12 -0
  159. package/dist/forms/radio/RadioGroupContext.js +3 -0
  160. package/dist/forms/segment/Segment.d.ts +12 -0
  161. package/dist/forms/segment/Segment.js +60 -0
  162. package/dist/forms/segment/segment-control/SegmentControl.d.ts +10 -0
  163. package/dist/forms/segment/segment-control/SegmentControl.js +59 -0
  164. package/dist/forms/select/Select.d.ts +25 -0
  165. package/dist/forms/select/Select.js +93 -0
  166. package/dist/forms/select/internal/SelectButton.d.ts +0 -0
  167. package/dist/forms/select/internal/SelectButton.js +0 -0
  168. package/dist/forms/select/internal/SelectButtonContent.d.ts +0 -0
  169. package/dist/forms/select/internal/SelectButtonContent.js +0 -0
  170. package/dist/forms/select/internal/SelectOptionsContainer.d.ts +0 -0
  171. package/dist/forms/select/internal/SelectOptionsContainer.js +0 -0
  172. package/dist/forms/slider/Slider.css +50 -0
  173. package/dist/forms/slider/Slider.d.ts +14 -0
  174. package/dist/forms/slider/Slider.js +98 -0
  175. package/dist/forms/switch/Switch.d.ts +10 -0
  176. package/dist/forms/switch/Switch.js +48 -0
  177. package/dist/forms/text-area/TextArea.css +14 -0
  178. package/dist/forms/text-area/TextArea.d.ts +13 -0
  179. package/dist/forms/text-area/TextArea.js +116 -0
  180. package/dist/forms/text-input/TextInput.css +31 -0
  181. package/dist/forms/text-input/TextInput.d.ts +13 -0
  182. package/dist/forms/text-input/TextInput.js +65 -0
  183. package/dist/forms/time-picker/TimePicker.css +10 -0
  184. package/dist/forms/time-picker/TimePicker.d.ts +25 -0
  185. package/dist/forms/time-picker/TimePicker.js +125 -0
  186. package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.css +4 -0
  187. package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.d.ts +19 -0
  188. package/dist/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +209 -0
  189. package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.d.ts +9 -0
  190. package/dist/forms/time-picker/time-picker-dropdown/TimePickerInput.js +15 -0
  191. package/dist/index.d.ts +61 -0
  192. package/dist/index.js +61 -0
  193. package/dist/utils/index.d.ts +1 -0
  194. package/dist/utils/index.js +7 -0
  195. package/dist/utils/setRef.d.ts +1 -0
  196. package/dist/utils/setRef.js +5 -0
  197. package/dist/utils/types.d.ts +23 -0
  198. package/dist/utils/types.js +0 -0
  199. package/dist/utils/useControlled.d.ts +7 -0
  200. package/dist/utils/useControlled.js +20 -0
  201. package/dist/utils/useForkRef.d.ts +2 -0
  202. package/dist/utils/useForkRef.js +15 -0
  203. package/dist/utils/useId.d.ts +1 -0
  204. package/dist/utils/useId.js +20 -0
  205. package/dist/utils/useOnClickOutside.d.ts +2 -0
  206. package/dist/utils/useOnClickOutside.js +20 -0
  207. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import './Popover.scss';
2
+ import { type Placement } from '@floating-ui/react';
3
+ import { type MouseEvent, type ReactNode } from 'react';
4
+ export interface PopoverProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'content' | 'onChange'> {
5
+ readonly 'data-testid'?: string;
6
+ readonly containerClassName?: string;
7
+ readonly content: ReactNode;
8
+ readonly position?: Placement;
9
+ readonly fallbackPositions?: Placement[];
10
+ readonly isOpen?: boolean;
11
+ readonly openOnHover?: boolean;
12
+ readonly openByDefault?: boolean;
13
+ readonly onChange?: (isOpen: boolean) => void;
14
+ readonly flip?: boolean;
15
+ readonly showArrow?: boolean;
16
+ readonly onTriggerClick?: (event: MouseEvent) => void;
17
+ readonly stopPropagation?: boolean;
18
+ }
19
+ export declare const Popover: (props: PopoverProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -0,0 +1,99 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import "./Popover.css";
3
+ import { FloatingArrow, FloatingPortal, arrow, autoUpdate, flip, offset, shift, useClick, useDismiss, useFloating, useHover, useInteractions } from "@floating-ui/react";
4
+ import classnames from "classnames";
5
+ import { forwardRef, useRef } from "react";
6
+ import { useControlled } from "../../../utils/useControlled.js";
7
+ import { useForkRef } from "../../../utils/useForkRef.js";
8
+ const Popover = /*#__PURE__*/ forwardRef(({ children, className, style, containerClassName, content, position, fallbackPositions, isOpen, openOnHover = false, openByDefault = false, onChange, flip: enableFlip = true, showArrow = true, onTriggerClick, stopPropagation = false, ...props }, ref)=>{
9
+ const [showPopover, setShowPopover] = useControlled({
10
+ controlled: isOpen,
11
+ default: openByDefault
12
+ });
13
+ const arrowRef = useRef(null);
14
+ const triggerRef = useRef(null);
15
+ const handleRef = useForkRef(ref, triggerRef);
16
+ const { refs, floatingStyles, context } = useFloating({
17
+ placement: position,
18
+ open: showPopover,
19
+ onOpenChange: (isOpen)=>{
20
+ setShowPopover(isOpen);
21
+ onChange?.(isOpen);
22
+ },
23
+ middleware: [
24
+ offset(12),
25
+ enableFlip && flip({
26
+ fallbackPlacements: fallbackPositions || void 0,
27
+ fallbackAxisSideDirection: 'end'
28
+ }),
29
+ shift({
30
+ padding: 8
31
+ }),
32
+ showArrow && arrow({
33
+ element: arrowRef,
34
+ padding: 8
35
+ })
36
+ ].filter(Boolean),
37
+ whileElementsMounted: autoUpdate
38
+ });
39
+ const dismiss = useDismiss(context);
40
+ const click = useClick(context, {
41
+ enabled: !openOnHover,
42
+ event: 'click',
43
+ stickIfOpen: true
44
+ });
45
+ const hover = useHover(context, {
46
+ enabled: openOnHover
47
+ });
48
+ const { getReferenceProps, getFloatingProps } = useInteractions([
49
+ dismiss,
50
+ click,
51
+ hover
52
+ ]);
53
+ return /*#__PURE__*/ jsxs(Fragment, {
54
+ children: [
55
+ /*#__PURE__*/ jsx("div", {
56
+ className: className,
57
+ style: style,
58
+ ref: (node)=>{
59
+ refs.setReference(node);
60
+ if ('function' == typeof handleRef) handleRef(node);
61
+ },
62
+ ...getReferenceProps({
63
+ ...props,
64
+ onClick: (e)=>{
65
+ if (stopPropagation) {
66
+ e.preventDefault();
67
+ e.stopPropagation();
68
+ }
69
+ onTriggerClick?.(e);
70
+ }
71
+ }),
72
+ children: children
73
+ }),
74
+ showPopover && /*#__PURE__*/ jsx(FloatingPortal, {
75
+ children: /*#__PURE__*/ jsxs("div", {
76
+ className: "fwe-popover-container",
77
+ ref: refs.setFloating,
78
+ style: floatingStyles,
79
+ ...getFloatingProps(),
80
+ children: [
81
+ showArrow && /*#__PURE__*/ jsx(FloatingArrow, {
82
+ ref: arrowRef,
83
+ context: context,
84
+ fill: "white",
85
+ width: 16,
86
+ height: 8
87
+ }),
88
+ /*#__PURE__*/ jsx("div", {
89
+ className: classnames('fwe-popover', containerClassName),
90
+ children: content
91
+ })
92
+ ]
93
+ })
94
+ })
95
+ ]
96
+ });
97
+ });
98
+ Popover.displayName = 'Popover';
99
+ export { Popover };
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type PopoverProps } from '../popover/Popover';
3
+ import { type PopoverMenuItemProps } from './popover-menu-item/PopoverMenuItem';
4
+ export interface PopoverMenuProps extends Omit<PopoverProps, 'content' | 'isOpen' | 'onStateChange'> {
5
+ readonly items: PopoverMenuItemProps[] | ReactNode;
6
+ }
7
+ export declare const PopoverMenu: (props: PopoverMenuProps & {
8
+ children?: ReactNode | undefined;
9
+ } & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -0,0 +1,33 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import { forwardRef, useMemo, useState } from "react";
4
+ import { Popover } from "../popover/Popover.js";
5
+ import { PopoverMenuContext } from "./PopoverMenuContext.js";
6
+ import { PopoverMenuItem } from "./popover-menu-item/PopoverMenuItem.js";
7
+ const PopoverMenu = /*#__PURE__*/ forwardRef(({ items, className, containerClassName, children, ...props }, ref)=>{
8
+ const [showPopoverMenu, setShowPopoverMenu] = useState(false);
9
+ const isPopoverMenuItemPropsArray = (items)=>Array.isArray(items) && items.length > 0 && 'text' in items[0];
10
+ let content = null;
11
+ content = isPopoverMenuItemPropsArray(items) ? items.map((item)=>/*#__PURE__*/ jsx(PopoverMenuItem, {
12
+ ...item
13
+ }, item.text)) : items;
14
+ const popoverMenuContextValue = useMemo(()=>({
15
+ setShowPopoverMenu: setShowPopoverMenu
16
+ }), []);
17
+ return /*#__PURE__*/ jsx(PopoverMenuContext.Provider, {
18
+ value: popoverMenuContextValue,
19
+ children: /*#__PURE__*/ jsx(Popover, {
20
+ className: classnames('fwe-popover-menu-trigger', className),
21
+ containerClassName: classnames('fwe-popover--menu', containerClassName),
22
+ content: content,
23
+ position: "right",
24
+ isOpen: showPopoverMenu,
25
+ onChange: setShowPopoverMenu,
26
+ ref: ref,
27
+ ...props,
28
+ children: children
29
+ })
30
+ });
31
+ });
32
+ PopoverMenu.displayName = 'PopoverMenu';
33
+ export { PopoverMenu };
@@ -0,0 +1,4 @@
1
+ import { type Dispatch, type SetStateAction } from 'react';
2
+ export declare const PopoverMenuContext: import("react").Context<{
3
+ setShowPopoverMenu: Dispatch<SetStateAction<boolean>>;
4
+ }>;
@@ -0,0 +1,5 @@
1
+ import { createContext } from "react";
2
+ const PopoverMenuContext = createContext({
3
+ setShowPopoverMenu: ()=>{}
4
+ });
5
+ export { PopoverMenuContext };
@@ -0,0 +1,9 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ export interface PopoverMenuItemProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick'> {
3
+ readonly 'data-testid'?: string;
4
+ readonly text: string;
5
+ readonly icon: React.ReactNode;
6
+ readonly onClick?: (data: unknown) => void;
7
+ readonly data?: unknown;
8
+ }
9
+ export declare const PopoverMenuItem: (props: PopoverMenuItemProps & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
@@ -0,0 +1,31 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useContext } from "react";
3
+ import { IconWrapper } from "../../../icon-wrapper/IconWrapper.js";
4
+ import { PopoverMenuContext } from "../PopoverMenuContext.js";
5
+ const PopoverMenuItem = /*#__PURE__*/ forwardRef(({ text, icon, onClick, data, className, ...props }, ref)=>{
6
+ const { setShowPopoverMenu } = useContext(PopoverMenuContext);
7
+ function handleClick(e) {
8
+ e?.preventDefault();
9
+ e?.stopPropagation();
10
+ if (setShowPopoverMenu) setShowPopoverMenu(false);
11
+ if (onClick) onClick(data);
12
+ }
13
+ return /*#__PURE__*/ jsxs("button", {
14
+ type: "button",
15
+ className: className,
16
+ onClick: handleClick,
17
+ ref: ref,
18
+ ...props,
19
+ children: [
20
+ /*#__PURE__*/ jsx(IconWrapper, {
21
+ icon: icon
22
+ }),
23
+ /*#__PURE__*/ jsx("span", {
24
+ className: "fwe-mr-xxs",
25
+ children: text
26
+ })
27
+ ]
28
+ });
29
+ });
30
+ PopoverMenuItem.displayName = 'PopoverMenuItem';
31
+ export { PopoverMenuItem };
@@ -0,0 +1,6 @@
1
+ import type { PopoverProps } from '../popover/Popover';
2
+ export interface TooltipProps extends Omit<PopoverProps, 'openOnHover'> {
3
+ }
4
+ export declare const Tooltip: (props: TooltipProps & {
5
+ children?: import("react").ReactNode | undefined;
6
+ } & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -0,0 +1,13 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Popover } from "../popover/Popover.js";
4
+ const Tooltip = /*#__PURE__*/ forwardRef(({ content, children, ...props }, ref)=>/*#__PURE__*/ jsx(Popover, {
5
+ position: "bottom",
6
+ openOnHover: true,
7
+ content: content,
8
+ ref: ref,
9
+ ...props,
10
+ children: children
11
+ }));
12
+ Tooltip.displayName = 'Tooltip';
13
+ export { Tooltip };
@@ -0,0 +1,6 @@
1
+ export interface ProgressProps extends React.ComponentPropsWithoutRef<'div'> {
2
+ readonly progress: number;
3
+ readonly background?: 'white' | 'black' | 'background';
4
+ readonly error?: boolean;
5
+ }
6
+ export declare const Progress: (props: ProgressProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -0,0 +1,30 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import { forwardRef } from "react";
4
+ const Progress = /*#__PURE__*/ forwardRef(({ background = 'white', error = false, progress, className, ...props }, ref)=>{
5
+ const classes = classnames('fwe-progress-bar', {
6
+ 'fwe-bg-red': error
7
+ }, {
8
+ 'fwe-progress-bar-black': 'black' === background
9
+ }, {
10
+ 'fwe-progress-bar-background': 'background' === background
11
+ });
12
+ return /*#__PURE__*/ jsx("div", {
13
+ className: classnames('fwe-progress', className),
14
+ ref: ref,
15
+ ...props,
16
+ children: /*#__PURE__*/ jsx("div", {
17
+ className: classes,
18
+ role: "progressbar",
19
+ style: {
20
+ width: `${progress}%`
21
+ },
22
+ "aria-valuenow": progress,
23
+ "aria-valuemin": 0,
24
+ "aria-valuemax": 100,
25
+ "aria-label": "progressbar"
26
+ })
27
+ });
28
+ });
29
+ Progress.displayName = 'Progress';
30
+ export { Progress };
@@ -0,0 +1,25 @@
1
+ .fwe-search-suggestion {
2
+ height: 40px;
3
+ }
4
+
5
+ .fwe-search-suggestions {
6
+ top: unset;
7
+ left: unset;
8
+ right: unset;
9
+ position: static;
10
+ }
11
+
12
+ .fr-search-input-clear-button {
13
+ background: none;
14
+ border: none;
15
+ justify-content: center;
16
+ align-items: center;
17
+ padding: 0;
18
+ display: flex;
19
+ }
20
+
21
+ .fr-search-result-highlight {
22
+ font-weight: unset;
23
+ color: var(--fwe-hero, #0091dc);
24
+ }
25
+
@@ -0,0 +1,25 @@
1
+ import './SearchInput.scss';
2
+ import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
3
+ export interface SearchInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'onChange' | 'value' | 'defaultValue' | 'children'> {
4
+ /** Placeholder text shown in the input. */
5
+ readonly label?: string;
6
+ /** Controlled value. */
7
+ readonly value?: string;
8
+ /** Initial value for uncontrolled usage. */
9
+ readonly defaultValue?: string;
10
+ /** Debounce time in milliseconds before `onChange` fires. Default: 300. */
11
+ readonly debounceTime?: number;
12
+ /**
13
+ * Called after the debounce interval when the user types.
14
+ * Use this to trigger a search and update the children (suggestions).
15
+ */
16
+ readonly onChange?: (value: string) => void;
17
+ /** Called when the user presses Enter or selects a suggestion. */
18
+ readonly onSearch?: (value: string) => void;
19
+ /**
20
+ * Render search suggestions as children.
21
+ * Use `<SearchInputOption>` for each item.
22
+ */
23
+ readonly children?: ReactNode;
24
+ }
25
+ export declare const SearchInput: (props: SearchInputProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -0,0 +1,89 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "./SearchInput.css";
3
+ import { Combobox, ComboboxButton, ComboboxInput, ComboboxOptions } from "@headlessui/react";
4
+ import classnames from "classnames";
5
+ import { Children, forwardRef, useCallback, useRef } from "react";
6
+ import { useControlled } from "../../utils/useControlled.js";
7
+ const SearchInput = /*#__PURE__*/ forwardRef(({ defaultValue, disabled, label, value: controlledValue, debounceTime = 300, onChange, onSearch, children, className, ...props }, ref)=>{
8
+ const [innerValue, setInnerValue] = useControlled({
9
+ controlled: controlledValue,
10
+ default: defaultValue ?? ''
11
+ });
12
+ const debounceRef = useRef(null);
13
+ const debouncedOnChange = useCallback((val)=>{
14
+ if (debounceRef.current) clearTimeout(debounceRef.current);
15
+ debounceRef.current = setTimeout(()=>{
16
+ onChange?.(val);
17
+ }, debounceTime);
18
+ }, [
19
+ onChange,
20
+ debounceTime
21
+ ]);
22
+ function handleInputChange(event) {
23
+ const val = event.target.value;
24
+ setInnerValue(val);
25
+ debouncedOnChange(val);
26
+ }
27
+ function handleSelect(val) {
28
+ if (null == val) return;
29
+ setInnerValue(val);
30
+ onSearch?.(val);
31
+ }
32
+ function handleClear() {
33
+ setInnerValue('');
34
+ if (debounceRef.current) clearTimeout(debounceRef.current);
35
+ onChange?.('');
36
+ onSearch?.('');
37
+ }
38
+ function handleKeyDown(event) {
39
+ if ('Enter' === event.key && innerValue) onSearch?.(innerValue);
40
+ if ('Escape' === event.key) handleClear();
41
+ }
42
+ const hasChildren = Children.count(children) > 0;
43
+ return /*#__PURE__*/ jsx(Combobox, {
44
+ value: innerValue,
45
+ onChange: handleSelect,
46
+ disabled: disabled,
47
+ immediate: true,
48
+ children: /*#__PURE__*/ jsxs("div", {
49
+ className: classnames('fwe-search-input', className),
50
+ ref: ref,
51
+ children: [
52
+ /*#__PURE__*/ jsx(ComboboxInput, {
53
+ disabled: disabled,
54
+ placeholder: label,
55
+ type: "search",
56
+ "aria-label": label ?? 'Search',
57
+ value: innerValue,
58
+ onChange: handleInputChange,
59
+ onKeyDown: handleKeyDown,
60
+ autoComplete: "off",
61
+ ...props
62
+ }),
63
+ /*#__PURE__*/ jsx("div", {
64
+ className: "fwe-search-icon"
65
+ }),
66
+ /*#__PURE__*/ jsx(ComboboxButton, {
67
+ className: "fwe-clear-icon fr-search-input-clear-button",
68
+ "aria-label": "Clear",
69
+ onClick: handleClear
70
+ }),
71
+ hasChildren && /*#__PURE__*/ jsx(ComboboxOptions, {
72
+ className: "fwe-search-suggestions",
73
+ as: "div",
74
+ portal: false,
75
+ anchor: {
76
+ to: 'bottom start',
77
+ gap: 4
78
+ },
79
+ style: {
80
+ minWidth: 'var(--input-width)'
81
+ },
82
+ children: children
83
+ })
84
+ ]
85
+ })
86
+ });
87
+ });
88
+ SearchInput.displayName = 'SearchInput';
89
+ export { SearchInput };
@@ -0,0 +1,5 @@
1
+ import { type ComboboxOptionProps } from '@headlessui/react';
2
+ export interface SearchInputOptionProps extends Omit<ComboboxOptionProps, 'as'> {
3
+ readonly value: string;
4
+ }
5
+ export declare const SearchInputOption: (props: SearchInputOptionProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ComboboxOption } from "@headlessui/react";
3
+ import classnames from "classnames";
4
+ import { forwardRef } from "react";
5
+ function SearchInputOptionComponent({ children, className, ...props }, ref) {
6
+ return /*#__PURE__*/ jsx(ComboboxOption, {
7
+ ref: ref,
8
+ as: "div",
9
+ className: ({ focus, selected })=>classnames('fwe-search-suggestion', className, {
10
+ 'fwe-selected': focus || selected
11
+ }),
12
+ ...props,
13
+ children: children
14
+ });
15
+ }
16
+ const SearchInputOption = /*#__PURE__*/ forwardRef(SearchInputOptionComponent);
17
+ SearchInputOption.displayName = 'SearchInputOption';
18
+ export { SearchInputOption };
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ export interface SearchResultProps extends ComponentPropsWithoutRef<'span'> {
3
+ /** The full label text to display. */
4
+ readonly label: string;
5
+ /** The current search query — matching parts will be highlighted. */
6
+ readonly query?: string;
7
+ }
8
+ export declare const SearchResult: (props: SearchResultProps & import("react").RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
@@ -0,0 +1,48 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import { forwardRef } from "react";
4
+ function getHighlightedParts(label, query) {
5
+ if (!query) return [
6
+ {
7
+ text: label,
8
+ highlighted: false
9
+ }
10
+ ];
11
+ const parts = [];
12
+ const lowerLabel = label.toLowerCase();
13
+ const lowerQuery = query.toLowerCase();
14
+ let currentIndex = 0;
15
+ while(currentIndex < label.length){
16
+ const matchIndex = lowerLabel.indexOf(lowerQuery, currentIndex);
17
+ if (-1 === matchIndex) {
18
+ parts.push({
19
+ text: label.slice(currentIndex),
20
+ highlighted: false
21
+ });
22
+ break;
23
+ }
24
+ if (matchIndex > currentIndex) parts.push({
25
+ text: label.slice(currentIndex, matchIndex),
26
+ highlighted: false
27
+ });
28
+ parts.push({
29
+ text: label.slice(matchIndex, matchIndex + query.length),
30
+ highlighted: true
31
+ });
32
+ currentIndex = matchIndex + query.length;
33
+ }
34
+ return parts;
35
+ }
36
+ const SearchResult = /*#__PURE__*/ forwardRef(({ label, query = '', className, ...props }, ref)=>/*#__PURE__*/ jsx("span", {
37
+ ref: ref,
38
+ className: classnames('fr-search-result', className),
39
+ ...props,
40
+ children: getHighlightedParts(label, query).map((part, index)=>/*#__PURE__*/ jsx("span", {
41
+ className: classnames({
42
+ 'fr-search-result-highlight': part.highlighted
43
+ }),
44
+ children: part.text
45
+ }, `${part.text}-${index}`))
46
+ }));
47
+ SearchResult.displayName = 'SearchResult';
48
+ export { SearchResult };
@@ -0,0 +1,55 @@
1
+ .fr-snackbar-wrapper {
2
+ opacity: 0;
3
+ opacity: 1;
4
+ margin-bottom: 24px;
5
+ }
6
+
7
+ .fr-snackbar-wrapper-enter-done {
8
+ opacity: 1;
9
+ transition: opacity .6s ease-out;
10
+ }
11
+
12
+ .fr-snackbar-wrapper-exit {
13
+ opacity: 1;
14
+ height: 48px;
15
+ }
16
+
17
+ .fr-snackbar-wrapper-exit-active {
18
+ opacity: 0;
19
+ height: 0;
20
+ margin-bottom: 0;
21
+ transition: height .3s ease-out .3s, opacity .3s ease-out, margin-bottom .3s ease-out .3s;
22
+ }
23
+
24
+ .fr-snackbar-wrapper--first {
25
+ opacity: 1;
26
+ margin-bottom: 24px;
27
+ transform: translateY(100px);
28
+ }
29
+
30
+ .fr-snackbar-wrapper--first-enter-done {
31
+ opacity: 1;
32
+ transition: opacity .6s ease-out;
33
+ }
34
+
35
+ .fr-snackbar-wrapper--first-exit {
36
+ opacity: 1;
37
+ height: 48px;
38
+ }
39
+
40
+ .fr-snackbar-wrapper--first-exit-active {
41
+ opacity: 0;
42
+ height: 0;
43
+ margin-bottom: 0;
44
+ transition: height .3s ease-out .3s, opacity .3s ease-out, margin-bottom .3s ease-out .3s;
45
+ }
46
+
47
+ .fr-snackbar-wrapper--first-enter-done {
48
+ transition: transform .6s ease-out;
49
+ transform: translateY(0);
50
+ }
51
+
52
+ .fr-snackbar-wrapper--first-exit-active {
53
+ transform: translateY(0);
54
+ }
55
+
@@ -0,0 +1,21 @@
1
+ import './Snackbar.scss';
2
+ export interface SnackbarConfig {
3
+ type?: 'info' | 'warning' | 'error';
4
+ variant?: 'a' | 'b' | 'c';
5
+ darkBackground?: boolean;
6
+ showClose?: boolean;
7
+ action?: string;
8
+ disappearAfter?: number | null;
9
+ key?: string | number;
10
+ 'data-testid'?: string;
11
+ }
12
+ export interface SnackbarData extends SnackbarConfig {
13
+ text: string;
14
+ }
15
+ export interface SnackbarProps extends React.ComponentPropsWithoutRef<'div'> {
16
+ readonly data?: SnackbarData;
17
+ readonly onAction?: () => void;
18
+ readonly onClose?: () => void;
19
+ readonly first?: boolean;
20
+ }
21
+ export declare const Snackbar: (props: SnackbarProps & import("react").RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -0,0 +1,82 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "./Snackbar.css";
3
+ import classnames from "classnames";
4
+ import { forwardRef, useEffect, useRef, useState } from "react";
5
+ import { CSSTransition } from "react-transition-group";
6
+ import { useForkRef } from "../../utils/useForkRef.js";
7
+ const Snackbar = /*#__PURE__*/ forwardRef(({ data, onAction, onClose, first = false, className, ...props }, ref)=>{
8
+ const [show, setShow] = useState(true);
9
+ const nodeRef = useRef(null);
10
+ const handleRef = useForkRef(ref, nodeRef);
11
+ useEffect(()=>{
12
+ let disappearAfter = 5000;
13
+ if (data?.disappearAfter !== null) {
14
+ if (data?.disappearAfter && data?.disappearAfter > 0) disappearAfter = data?.disappearAfter;
15
+ const timer = setTimeout(()=>setShow(false), disappearAfter);
16
+ return ()=>{
17
+ clearTimeout(timer);
18
+ };
19
+ }
20
+ }, [
21
+ data
22
+ ]);
23
+ function handleClose() {
24
+ setShow(false);
25
+ }
26
+ const classes = first ? 'fr-snackbar-wrapper--first' : 'fr-snackbar-wrapper';
27
+ return /*#__PURE__*/ jsx(CSSTransition, {
28
+ nodeRef: nodeRef,
29
+ onExited: ()=>onClose ? onClose() : void 0,
30
+ unmountOnExit: true,
31
+ timeout: {
32
+ exit: 600
33
+ },
34
+ in: show,
35
+ classNames: classes,
36
+ appear: true,
37
+ children: /*#__PURE__*/ jsx("div", {
38
+ ref: handleRef,
39
+ className: classnames(classes, className),
40
+ ...props,
41
+ children: /*#__PURE__*/ jsxs("div", {
42
+ className: classnames({
43
+ 'fwe-snackbar': true,
44
+ 'fwe-snackbar-b': data?.variant === 'b',
45
+ 'fwe-snackbar-c': data?.variant === 'c',
46
+ 'fwe-snackbar-info': data?.type === 'info',
47
+ 'fwe-snackbar-warning': data?.type === 'warning',
48
+ 'fwe-snackbar-error': data?.type === 'error',
49
+ 'fwe-snackbar-shadow': data?.darkBackground
50
+ }),
51
+ "data-testid": data?.['data-testid'],
52
+ children: [
53
+ /*#__PURE__*/ jsx("span", {
54
+ children: data?.text
55
+ }),
56
+ data?.action && /*#__PURE__*/ jsx("button", {
57
+ "aria-label": "UserAction",
58
+ type: "button",
59
+ className: "fwe-snackbar-link-btn",
60
+ onClick: ()=>onAction ? onAction() : void 0,
61
+ children: data?.action
62
+ }),
63
+ data?.action && data?.showClose && /*#__PURE__*/ jsx("div", {
64
+ className: "fwe-snackbar-separator"
65
+ }),
66
+ data?.showClose && /*#__PURE__*/ jsx("button", {
67
+ "aria-label": "Close",
68
+ type: "button",
69
+ className: "fwe-snackbar-close-btn",
70
+ onClick: handleClose,
71
+ children: /*#__PURE__*/ jsx("span", {
72
+ className: "fwe-sr-only",
73
+ children: "Close"
74
+ })
75
+ })
76
+ ]
77
+ })
78
+ })
79
+ });
80
+ });
81
+ Snackbar.displayName = 'Snackbar';
82
+ export { Snackbar };