@festo-ui/react 5.0.0-dev.112 → 5.0.0-dev.115

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 (37) hide show
  1. package/index.d.ts +3 -0
  2. package/index.js +3 -0
  3. package/lib/components/accordion/Accordion.d.ts +1 -1
  4. package/lib/components/accordion/accordion-header/AccordionHeader.d.ts +1 -1
  5. package/lib/components/accordion/accordion-item/AccordionItem.d.ts +1 -1
  6. package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +1 -1
  7. package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +1 -1
  8. package/lib/components/loading-indicator/LoadingIndicator.d.ts +1 -1
  9. package/lib/components/mobile-flyout/MobileFlyout.d.ts +12 -0
  10. package/lib/components/mobile-flyout/MobileFlyout.js +83 -0
  11. package/lib/components/mobile-flyout/MobileFlyoutContext.d.ts +9 -0
  12. package/lib/components/mobile-flyout/MobileFlyoutContext.js +2 -0
  13. package/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +19 -0
  14. package/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +54 -0
  15. package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.d.ts +8 -0
  16. package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +47 -0
  17. package/lib/components/modals/Modal.d.ts +1 -1
  18. package/lib/components/modals/ModalFooter.d.ts +1 -1
  19. package/lib/components/stepper-horizontal/StepperHorizontal.d.ts +1 -1
  20. package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +1 -1
  21. package/lib/components/stepper-vertical/StepperVertical.d.ts +1 -1
  22. package/lib/components/stepper-vertical/step-vertical/StepVertical.d.ts +1 -1
  23. package/lib/components/tab/Tabs.d.ts +1 -1
  24. package/lib/components/table-header-cell/TableHeaderCell.d.ts +1 -1
  25. package/lib/forms/select/Select.d.ts +1 -1
  26. package/lib/forms/select/list-item/ListItem.d.ts +1 -1
  27. package/lib/forms/select/select-option/SelectOption.d.ts +1 -1
  28. package/lib/forms/text-input/TextInput.d.ts +1 -1
  29. package/lib/forms/time-picker/TimePicker.d.ts +1 -1
  30. package/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.d.ts +1 -1
  31. package/lib/helper/types.d.ts +10 -0
  32. package/node/index.js +21 -0
  33. package/node/lib/components/mobile-flyout/MobileFlyout.js +90 -0
  34. package/node/lib/components/mobile-flyout/MobileFlyoutContext.js +9 -0
  35. package/node/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +71 -0
  36. package/node/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +54 -0
  37. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -13,6 +13,9 @@ export { default as ChipContainer } from './lib/components/chips/chip-container/
13
13
  export { ChipType, default as Chip } from './lib/components/chips/chip/Chip';
14
14
  export { default as LinkButton } from './lib/components/link-button/LinkButton';
15
15
  export { default as LoadingIndicator } from './lib/components/loading-indicator/LoadingIndicator';
16
+ export { default as MobileFlyout } from './lib/components/mobile-flyout/MobileFlyout';
17
+ export { default as MobileFlyoutItem } from './lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem';
18
+ export { default as MobileFlyoutPage } from './lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage';
16
19
  export { default as AlertModal } from './lib/components/modals/AlertModal';
17
20
  export { default as ConfirmModal } from './lib/components/modals/ConfirmModal';
18
21
  export { default as Prompt } from './lib/components/modals/Prompt';
package/index.js CHANGED
@@ -13,6 +13,9 @@ export { default as ChipContainer } from './lib/components/chips/chip-container/
13
13
  export { ChipType, default as Chip } from './lib/components/chips/chip/Chip';
14
14
  export { default as LinkButton } from './lib/components/link-button/LinkButton';
15
15
  export { default as LoadingIndicator } from './lib/components/loading-indicator/LoadingIndicator';
16
+ export { default as MobileFlyout } from './lib/components/mobile-flyout/MobileFlyout';
17
+ export { default as MobileFlyoutItem } from './lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem';
18
+ export { default as MobileFlyoutPage } from './lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage';
16
19
  export { default as AlertModal } from './lib/components/modals/AlertModal';
17
20
  export { default as ConfirmModal } from './lib/components/modals/ConfirmModal';
18
21
  export { default as Prompt } from './lib/components/modals/Prompt';
@@ -5,5 +5,5 @@ interface AccordionProps extends ComponentPropsWithoutRef<'div'> {
5
5
  showLess?: string;
6
6
  keepItemsOpen?: boolean;
7
7
  }
8
- declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ declare const Accordion: (props: AccordionProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
9
9
  export default Accordion;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import './AccordionHeader.scss';
3
- declare const AccordionHeader: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const AccordionHeader: (props: Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
4
4
  export default AccordionHeader;
@@ -5,5 +5,5 @@ interface AccordionItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onCh
5
5
  defaultExpanded?: boolean;
6
6
  onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
7
7
  }
8
- declare const AccordionItem: import("react").ForwardRefExoticComponent<AccordionItemProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ declare const AccordionItem: (props: AccordionItemProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
9
9
  export default AccordionItem;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import './AccordionItemBody.scss';
3
- declare const AccordionItemBody: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const AccordionItemBody: (props: Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
4
4
  export default AccordionItemBody;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import './AccordionItemHeader.scss';
3
- declare const AccordionItemHeader: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const AccordionItemHeader: (props: Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
4
4
  export default AccordionItemHeader;
@@ -3,5 +3,5 @@ import './LoadingIndicator.scss';
3
3
  interface LoadingIndicatorProps extends ComponentPropsWithRef<'div'> {
4
4
  size: 'large' | 'medium' | 'small';
5
5
  }
6
- export declare const LoadingIndicator: import("react").ForwardRefExoticComponent<Pick<LoadingIndicatorProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ export declare const LoadingIndicator: (props: LoadingIndicatorProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
7
7
  export default LoadingIndicator;
@@ -0,0 +1,12 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ interface MobileFlyoutProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
3
+ open?: boolean;
4
+ defaultOpen?: boolean;
5
+ visible?: string[];
6
+ defaultVisible?: string[];
7
+ onOpenChange?: (value: boolean) => void;
8
+ onVisibleChange?: (value: string) => void;
9
+ back?: string;
10
+ }
11
+ declare const MobileFlyout: (props: MobileFlyoutProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
12
+ export default MobileFlyout;
@@ -0,0 +1,83 @@
1
+ import { forwardRef, useCallback, useMemo, useRef } from 'react';
2
+ import cn from 'classnames';
3
+ import useForkRef from '../../helper/useForkRef';
4
+ import useOnClickOutside from '../../helper/useOnClickOutside';
5
+ import useControlled from '../../helper/useControlled';
6
+ import MobileFlyoutContext from './MobileFlyoutContext';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ const defaultVisibleValue = ['root'];
10
+ const MobileFlyout = /*#__PURE__*/forwardRef((_ref, ref) => {
11
+ let {
12
+ className,
13
+ children,
14
+ open,
15
+ onOpenChange,
16
+ onVisibleChange,
17
+ defaultOpen,
18
+ visible,
19
+ defaultVisible = defaultVisibleValue,
20
+ back,
21
+ ...props
22
+ } = _ref;
23
+ const [openState, setOpen] = useControlled({
24
+ controlled: open,
25
+ default: defaultOpen
26
+ });
27
+ const [visibleState, setVisible] = useControlled({
28
+ controlled: visible,
29
+ default: defaultVisible
30
+ });
31
+ const innerRef = useRef(null);
32
+ const combinedRef = useForkRef(ref, innerRef);
33
+ const handleVisibleChange = useCallback(v => {
34
+ if (visibleState !== undefined) {
35
+ if (visibleState.includes(v)) {
36
+ const newArray = visibleState.filter(entry => entry !== v);
37
+ setVisible(newArray);
38
+ } else {
39
+ const newArray = [...visibleState, v];
40
+ setVisible(newArray);
41
+ }
42
+ }
43
+ onVisibleChange?.(v);
44
+ }, [onVisibleChange, setVisible, visibleState]);
45
+ const handleOpenChange = useCallback(v => {
46
+ setOpen(v);
47
+ onOpenChange?.(v);
48
+ }, [onOpenChange, setOpen]);
49
+ function handleClickOutside() {
50
+ handleOpenChange(false);
51
+ }
52
+ function toggle() {
53
+ const newOpen = !openState;
54
+ handleOpenChange(newOpen);
55
+ }
56
+ useOnClickOutside(innerRef, handleClickOutside);
57
+ const contextValue = useMemo(() => ({
58
+ visible: visibleState ?? defaultVisibleValue,
59
+ setVisible: handleVisibleChange,
60
+ setOpen: handleOpenChange,
61
+ back
62
+ }), [handleVisibleChange, visibleState, back, handleOpenChange]);
63
+ return /*#__PURE__*/_jsxs("div", {
64
+ className: cn('fwe-mobile-flyout', className),
65
+ ...props,
66
+ ref: combinedRef,
67
+ children: [/*#__PURE__*/_jsx("button", {
68
+ "aria-label": "menu",
69
+ type: "button",
70
+ className: openState ? 'fwe-close-button' : 'fwe-burger-button',
71
+ onClick: toggle
72
+ }), /*#__PURE__*/_jsx("div", {
73
+ className: cn('fwe-mobile-flyout-container', {
74
+ 'fwe-opened': openState
75
+ }),
76
+ children: /*#__PURE__*/_jsx(MobileFlyoutContext.Provider, {
77
+ value: contextValue,
78
+ children: children
79
+ })
80
+ })]
81
+ });
82
+ });
83
+ export default MobileFlyout;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface MobileFlyoutContext {
3
+ visible: string[];
4
+ setVisible: (value: string) => void;
5
+ setOpen: (value: boolean) => void;
6
+ back?: string;
7
+ }
8
+ declare const _default: import("react").Context<MobileFlyoutContext>;
9
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export default /*#__PURE__*/createContext(null);
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { PolymorphicRef } from '../../../helper/types';
3
+ export { Ref, ReactElement, RefAttributes } from 'react';
4
+ declare module 'react' {
5
+ function forwardRef<T, P = {}>(render: (props: P, ref: Ref<T>) => ReactElement | null): (props: P & RefAttributes<T>) => ReactElement | null;
6
+ }
7
+ interface MobileFlyoutItemBaseProps {
8
+ icon?: string;
9
+ pageLink?: string;
10
+ active?: boolean;
11
+ }
12
+ declare const MobileFlyoutItem: <C extends import("react").ElementType<any> = "a">(props: MobileFlyoutItemBaseProps & {
13
+ component?: C | undefined;
14
+ } & {
15
+ children?: import("react").ReactNode;
16
+ } & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<C>>, "component" | keyof MobileFlyoutItemBaseProps> & {
17
+ ref?: PolymorphicRef<C> | undefined;
18
+ } & import("react").RefAttributes<unknown>) => ReactElement | null;
19
+ export default MobileFlyoutItem;
@@ -0,0 +1,54 @@
1
+ import cn from 'classnames';
2
+ import { forwardRef, useContext } from 'react';
3
+ import MobileFlyoutContext from '../MobileFlyoutContext';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ export { Ref, ReactElement, RefAttributes } from 'react';
7
+ /*
8
+ * Augment `forwardRef` only for this module so that storybook can infer controls
9
+ * (despite component being wrapped in forwardRef)
10
+ * https://fettblog.eu/typescript-react-generic-forward-refs/#option-3%3A-augment-forwardref
11
+ * https://github.com/microsoft/TypeScript/pull/30215
12
+ */
13
+
14
+ const MobileFlyoutItem = /*#__PURE__*/forwardRef((_ref, ref) => {
15
+ let {
16
+ component,
17
+ children,
18
+ pageLink,
19
+ icon,
20
+ onClick,
21
+ active,
22
+ ...props
23
+ } = _ref;
24
+ const Component = component || 'a';
25
+ const {
26
+ setVisible,
27
+ setOpen
28
+ } = useContext(MobileFlyoutContext);
29
+ function handleClick(e) {
30
+ if (pageLink) {
31
+ setVisible(pageLink);
32
+ } else {
33
+ setOpen(false);
34
+ }
35
+ onClick?.(e);
36
+ }
37
+ return /*#__PURE__*/_jsxs(Component, {
38
+ className: "fwe-mobile-flyout-item fwe-bb",
39
+ ...props,
40
+ ref: ref,
41
+ onClick: handleClick,
42
+ children: [icon && /*#__PURE__*/_jsx("i", {
43
+ className: `fwe-mr-xs fwe-icon fwe-icon-${icon}`
44
+ }), /*#__PURE__*/_jsx("div", {
45
+ className: cn('fwe-flex-grow-1', {
46
+ 'fwe-color-hero': active
47
+ }),
48
+ children: children
49
+ }), pageLink && /*#__PURE__*/_jsx("i", {
50
+ className: "fwe-icon fwe-icon-arrows-right-2"
51
+ })]
52
+ });
53
+ });
54
+ export default MobileFlyoutItem;
@@ -0,0 +1,8 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ interface MobileFlyoutPageProps extends ComponentPropsWithoutRef<'div'> {
3
+ back?: string;
4
+ name?: string;
5
+ root?: boolean;
6
+ }
7
+ declare const MobileFlyoutPage: (props: MobileFlyoutPageProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
8
+ export default MobileFlyoutPage;
@@ -0,0 +1,47 @@
1
+ import cn from 'classnames';
2
+ import { forwardRef, useContext } from 'react';
3
+ import MobileFlyoutContext from '../MobileFlyoutContext';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ const MobileFlyoutPage = /*#__PURE__*/forwardRef((_ref, ref) => {
7
+ let {
8
+ back,
9
+ children,
10
+ name,
11
+ root,
12
+ ...props
13
+ } = _ref;
14
+ const {
15
+ visible,
16
+ setVisible,
17
+ back: backContext
18
+ } = useContext(MobileFlyoutContext);
19
+ const innerVisible = root || name && visible.includes(name);
20
+ const innerBack = back ?? backContext ?? 'Back';
21
+ function handleChange() {
22
+ if (name) {
23
+ setVisible(name);
24
+ }
25
+ }
26
+ return /*#__PURE__*/_jsxs("div", {
27
+ className: cn('fwe-mobile-flyout-page', {
28
+ 'fwe-opened': innerVisible
29
+ }),
30
+ ref: ref,
31
+ ...props,
32
+ children: [!root && /*#__PURE__*/_jsxs("div", {
33
+ tabIndex: 0,
34
+ role: "button",
35
+ className: "fwe-page-back",
36
+ onClick: handleChange,
37
+ onKeyUp: handleChange,
38
+ children: [/*#__PURE__*/_jsx("i", {}), /*#__PURE__*/_jsx("div", {
39
+ children: innerBack
40
+ })]
41
+ }), /*#__PURE__*/_jsx("div", {
42
+ className: "fwe-mobile-flyout-item-container",
43
+ children: children
44
+ })]
45
+ });
46
+ });
47
+ export default MobileFlyoutPage;
@@ -7,5 +7,5 @@ export interface ModalProps extends ClassNamePropsWithChildren {
7
7
  onClose?: () => void;
8
8
  head: React.ReactNode;
9
9
  }
10
- declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
10
+ declare const Modal: (props: ModalProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
11
11
  export default Modal;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { ClassNamePropsWithChildren } from '../../helper/types';
3
- declare const ModalFooter: import("react").ForwardRefExoticComponent<ClassNamePropsWithChildren & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const ModalFooter: (props: ClassNamePropsWithChildren & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
4
4
  export default ModalFooter;
@@ -3,5 +3,5 @@ interface StepperHorizontalProps extends Omit<ComponentPropsWithoutRef<'div'>, '
3
3
  stepIndex?: number;
4
4
  onChange?: (stepIndex: number) => void;
5
5
  }
6
- declare const StepperHorizontal: React.ForwardRefExoticComponent<StepperHorizontalProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const StepperHorizontal: (props: StepperHorizontalProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
7
7
  export default StepperHorizontal;
@@ -3,5 +3,5 @@ import { ComponentPropsWithoutRef } from 'react';
3
3
  export interface StepHorizontalProps extends ComponentPropsWithoutRef<'div'> {
4
4
  isActive?: boolean;
5
5
  }
6
- declare const StepHorizontal: import("react").ForwardRefExoticComponent<StepHorizontalProps & import("react").RefAttributes<HTMLDivElement>>;
6
+ declare const StepHorizontal: (props: StepHorizontalProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
7
7
  export default StepHorizontal;
@@ -3,5 +3,5 @@ interface StepperVerticalProps extends Omit<ComponentPropsWithoutRef<'div'>, 'on
3
3
  stepIndex?: number;
4
4
  onChange?: (stepIndex: number) => void;
5
5
  }
6
- declare const StepperVertical: React.ForwardRefExoticComponent<StepperVerticalProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const StepperVertical: (props: StepperVerticalProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
7
7
  export default StepperVertical;
@@ -8,5 +8,5 @@ interface StepVerticalProps extends ComponentPropsWithoutRef<'div'> {
8
8
  title?: string;
9
9
  onStepClick?: () => void;
10
10
  }
11
- declare const StepVertical: import("react").ForwardRefExoticComponent<StepVerticalProps & import("react").RefAttributes<HTMLDivElement>>;
11
+ declare const StepVertical: (props: StepVerticalProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
12
12
  export default StepVertical;
@@ -19,5 +19,5 @@ interface TabsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> {
19
19
  current: string;
20
20
  }) => void;
21
21
  }
22
- declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
22
+ declare const Tabs: (props: TabsProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
23
23
  export default Tabs;
@@ -3,5 +3,5 @@ export interface TableHeaderCellProps extends React.ThHTMLAttributes<HTMLTableCe
3
3
  active?: boolean;
4
4
  ascending: boolean;
5
5
  }
6
- declare const TableHeaderCell: import("react").ForwardRefExoticComponent<TableHeaderCellProps & import("react").RefAttributes<HTMLTableHeaderCellElement>>;
6
+ declare const TableHeaderCell: (props: TableHeaderCellProps & import("react").RefAttributes<HTMLTableHeaderCellElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
7
7
  export default TableHeaderCell;
@@ -16,5 +16,5 @@ export interface SelectProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onCh
16
16
  hint?: string;
17
17
  error?: string;
18
18
  }
19
- declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLDivElement>>;
19
+ declare const Select: (props: SelectProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
20
20
  export default Select;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  export interface ListItemProps extends React.ComponentPropsWithoutRef<'li'> {
3
3
  empty?: boolean;
4
4
  }
5
- declare const ListItem: React.ForwardRefExoticComponent<ListItemProps & React.RefAttributes<HTMLLIElement>>;
5
+ declare const ListItem: (props: ListItemProps & React.RefAttributes<HTMLLIElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
6
6
  export default ListItem;
@@ -6,5 +6,5 @@ export interface SelectOptionType {
6
6
  export interface SelectOptionProps extends React.ComponentPropsWithoutRef<'span'> {
7
7
  option: SelectOptionType;
8
8
  }
9
- export declare const SelectOption: React.ForwardRefExoticComponent<SelectOptionProps & React.RefAttributes<HTMLDivElement>>;
9
+ export declare const SelectOption: (props: SelectOptionProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
10
10
  export default SelectOption;
@@ -17,5 +17,5 @@ interface TextInputProps {
17
17
  error?: string;
18
18
  labelClassName?: string;
19
19
  }
20
- declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputProps & React.HTMLProps<HTMLInputElement>, "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "value" | "list" | "step" | "type" | "height" | "start" | "content" | "size" | "default" | "wrap" | "open" | "multiple" | "disabled" | "href" | "action" | "selected" | "error" | "required" | "readonly" | "max" | "min" | "hint" | "labelClassName" | "accept" | "acceptCharset" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "maxLength" | "media" | "mediaGroup" | "method" | "minLength" | "muted" | "name" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "useMap" | "width" | "wmode"> & React.RefAttributes<HTMLLabelElement>>;
20
+ declare const TextInput: (props: TextInputProps & React.HTMLProps<HTMLInputElement> & React.RefAttributes<HTMLLabelElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
21
21
  export default TextInput;
@@ -14,5 +14,5 @@ export interface TimePickerProps extends Omit<ComponentPropsWithoutRef<'div'>, '
14
14
  formatDate?: (date: Date) => string;
15
15
  onChange?: (date: Date) => void;
16
16
  }
17
- declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLDivElement>>;
17
+ declare const TimePicker: (props: TimePickerProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
18
18
  export default TimePicker;
@@ -8,5 +8,5 @@ interface TimePickerDropdownProps {
8
8
  onClose: (date?: Date) => void;
9
9
  style?: React.CSSProperties;
10
10
  }
11
- declare const TimePickerDropdown: React.ForwardRefExoticComponent<TimePickerDropdownProps & React.RefAttributes<HTMLDivElement>>;
11
+ declare const TimePickerDropdown: (props: TimePickerDropdownProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
12
12
  export default TimePickerDropdown;
@@ -12,3 +12,13 @@ export interface SelectConfiguration {
12
12
  viewportSize?: number;
13
13
  };
14
14
  }
15
+ export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>["ref"];
16
+ type AsProp<C extends React.ElementType> = {
17
+ component?: C;
18
+ };
19
+ type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
20
+ type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = React.PropsWithChildren<Props & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
21
+ export type PolymorphicComponentPropWithRef<C extends React.ElementType, Props = {}> = PolymorphicComponentProp<C, Props> & {
22
+ ref?: PolymorphicRef<C>;
23
+ };
24
+ export {};
package/node/index.js CHANGED
@@ -141,6 +141,24 @@ Object.defineProperty(exports, "LoadingIndicator", {
141
141
  return _LoadingIndicator.default;
142
142
  }
143
143
  });
144
+ Object.defineProperty(exports, "MobileFlyout", {
145
+ enumerable: true,
146
+ get: function () {
147
+ return _MobileFlyout.default;
148
+ }
149
+ });
150
+ Object.defineProperty(exports, "MobileFlyoutItem", {
151
+ enumerable: true,
152
+ get: function () {
153
+ return _MobileFlyoutItem.default;
154
+ }
155
+ });
156
+ Object.defineProperty(exports, "MobileFlyoutPage", {
157
+ enumerable: true,
158
+ get: function () {
159
+ return _MobileFlyoutPage.default;
160
+ }
161
+ });
144
162
  Object.defineProperty(exports, "Pagination", {
145
163
  enumerable: true,
146
164
  get: function () {
@@ -330,6 +348,9 @@ var _ChipContainer = _interopRequireDefault(require("./lib/components/chips/chip
330
348
  var _Chip = _interopRequireWildcard(require("./lib/components/chips/chip/Chip"));
331
349
  var _LinkButton = _interopRequireDefault(require("./lib/components/link-button/LinkButton"));
332
350
  var _LoadingIndicator = _interopRequireDefault(require("./lib/components/loading-indicator/LoadingIndicator"));
351
+ var _MobileFlyout = _interopRequireDefault(require("./lib/components/mobile-flyout/MobileFlyout"));
352
+ var _MobileFlyoutItem = _interopRequireDefault(require("./lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem"));
353
+ var _MobileFlyoutPage = _interopRequireDefault(require("./lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage"));
333
354
  var _AlertModal = _interopRequireDefault(require("./lib/components/modals/AlertModal"));
334
355
  var _ConfirmModal = _interopRequireDefault(require("./lib/components/modals/ConfirmModal"));
335
356
  var _Prompt = _interopRequireDefault(require("./lib/components/modals/Prompt"));
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _useForkRef = _interopRequireDefault(require("../../helper/useForkRef"));
10
+ var _useOnClickOutside = _interopRequireDefault(require("../../helper/useOnClickOutside"));
11
+ var _useControlled = _interopRequireDefault(require("../../helper/useControlled"));
12
+ var _MobileFlyoutContext = _interopRequireDefault(require("./MobileFlyoutContext"));
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ const defaultVisibleValue = ['root'];
16
+ const MobileFlyout = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
17
+ let {
18
+ className,
19
+ children,
20
+ open,
21
+ onOpenChange,
22
+ onVisibleChange,
23
+ defaultOpen,
24
+ visible,
25
+ defaultVisible = defaultVisibleValue,
26
+ back,
27
+ ...props
28
+ } = _ref;
29
+ const [openState, setOpen] = (0, _useControlled.default)({
30
+ controlled: open,
31
+ default: defaultOpen
32
+ });
33
+ const [visibleState, setVisible] = (0, _useControlled.default)({
34
+ controlled: visible,
35
+ default: defaultVisible
36
+ });
37
+ const innerRef = (0, _react.useRef)(null);
38
+ const combinedRef = (0, _useForkRef.default)(ref, innerRef);
39
+ const handleVisibleChange = (0, _react.useCallback)(v => {
40
+ if (visibleState !== undefined) {
41
+ if (visibleState.includes(v)) {
42
+ const newArray = visibleState.filter(entry => entry !== v);
43
+ setVisible(newArray);
44
+ } else {
45
+ const newArray = [...visibleState, v];
46
+ setVisible(newArray);
47
+ }
48
+ }
49
+ onVisibleChange?.(v);
50
+ }, [onVisibleChange, setVisible, visibleState]);
51
+ const handleOpenChange = (0, _react.useCallback)(v => {
52
+ setOpen(v);
53
+ onOpenChange?.(v);
54
+ }, [onOpenChange, setOpen]);
55
+ function handleClickOutside() {
56
+ handleOpenChange(false);
57
+ }
58
+ function toggle() {
59
+ const newOpen = !openState;
60
+ handleOpenChange(newOpen);
61
+ }
62
+ (0, _useOnClickOutside.default)(innerRef, handleClickOutside);
63
+ const contextValue = (0, _react.useMemo)(() => ({
64
+ visible: visibleState ?? defaultVisibleValue,
65
+ setVisible: handleVisibleChange,
66
+ setOpen: handleOpenChange,
67
+ back
68
+ }), [handleVisibleChange, visibleState, back, handleOpenChange]);
69
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
70
+ className: (0, _classnames.default)('fwe-mobile-flyout', className),
71
+ ...props,
72
+ ref: combinedRef,
73
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
74
+ "aria-label": "menu",
75
+ type: "button",
76
+ className: openState ? 'fwe-close-button' : 'fwe-burger-button',
77
+ onClick: toggle
78
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
79
+ className: (0, _classnames.default)('fwe-mobile-flyout-container', {
80
+ 'fwe-opened': openState
81
+ }),
82
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileFlyoutContext.default.Provider, {
83
+ value: contextValue,
84
+ children: children
85
+ })
86
+ })]
87
+ });
88
+ });
89
+ var _default = MobileFlyout;
90
+ exports.default = _default;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _default = /*#__PURE__*/(0, _react.createContext)(null);
9
+ exports.default = _default;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ReactElement", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _react.ReactElement;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Ref", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _react.Ref;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "RefAttributes", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _react.RefAttributes;
22
+ }
23
+ });
24
+ exports.default = void 0;
25
+ var _classnames = _interopRequireDefault(require("classnames"));
26
+ var _react = require("react");
27
+ var _MobileFlyoutContext = _interopRequireDefault(require("../MobileFlyoutContext"));
28
+ var _jsxRuntime = require("react/jsx-runtime");
29
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
+ const MobileFlyoutItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
31
+ let {
32
+ component,
33
+ children,
34
+ pageLink,
35
+ icon,
36
+ onClick,
37
+ active,
38
+ ...props
39
+ } = _ref;
40
+ const Component = component || 'a';
41
+ const {
42
+ setVisible,
43
+ setOpen
44
+ } = (0, _react.useContext)(_MobileFlyoutContext.default);
45
+ function handleClick(e) {
46
+ if (pageLink) {
47
+ setVisible(pageLink);
48
+ } else {
49
+ setOpen(false);
50
+ }
51
+ onClick?.(e);
52
+ }
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Component, {
54
+ className: "fwe-mobile-flyout-item fwe-bb",
55
+ ...props,
56
+ ref: ref,
57
+ onClick: handleClick,
58
+ children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
59
+ className: `fwe-mr-xs fwe-icon fwe-icon-${icon}`
60
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
61
+ className: (0, _classnames.default)('fwe-flex-grow-1', {
62
+ 'fwe-color-hero': active
63
+ }),
64
+ children: children
65
+ }), pageLink && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
66
+ className: "fwe-icon fwe-icon-arrows-right-2"
67
+ })]
68
+ });
69
+ });
70
+ var _default = MobileFlyoutItem;
71
+ exports.default = _default;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _react = require("react");
9
+ var _MobileFlyoutContext = _interopRequireDefault(require("../MobileFlyoutContext"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ const MobileFlyoutPage = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
13
+ let {
14
+ back,
15
+ children,
16
+ name,
17
+ root,
18
+ ...props
19
+ } = _ref;
20
+ const {
21
+ visible,
22
+ setVisible,
23
+ back: backContext
24
+ } = (0, _react.useContext)(_MobileFlyoutContext.default);
25
+ const innerVisible = root || name && visible.includes(name);
26
+ const innerBack = back ?? backContext ?? 'Back';
27
+ function handleChange() {
28
+ if (name) {
29
+ setVisible(name);
30
+ }
31
+ }
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
33
+ className: (0, _classnames.default)('fwe-mobile-flyout-page', {
34
+ 'fwe-opened': innerVisible
35
+ }),
36
+ ref: ref,
37
+ ...props,
38
+ children: [!root && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
39
+ tabIndex: 0,
40
+ role: "button",
41
+ className: "fwe-page-back",
42
+ onClick: handleChange,
43
+ onKeyUp: handleChange,
44
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
45
+ children: innerBack
46
+ })]
47
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
48
+ className: "fwe-mobile-flyout-item-container",
49
+ children: children
50
+ })]
51
+ });
52
+ });
53
+ var _default = MobileFlyoutPage;
54
+ exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@festo-ui/react",
3
- "version": "5.0.0-dev.112",
3
+ "version": "5.0.0-dev.115",
4
4
  "author": "Festo UI (styleguide@festo.com)",
5
5
  "license": "apache-2.0",
6
6
  "peerDependencies": {