@mittwald/flow-react-components 0.1.0-alpha.122 → 0.1.0-alpha.124

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 (130) hide show
  1. package/dist/{Accordion-9wwB377E.js → Accordion-Bszrsi-4.js} +4 -4
  2. package/dist/Accordion.js +1 -1
  3. package/dist/Action-7EQNT1az.js +217 -0
  4. package/dist/Action.js +1 -1
  5. package/dist/Avatar.js +22 -22
  6. package/dist/Breadcrumb.js +3 -3
  7. package/dist/{Button-BGCNzfmU.js → Button-tEtjVHFC.js} +6 -6
  8. package/dist/Button.js +1 -1
  9. package/dist/ButtonGroup.js +16 -16
  10. package/dist/{Checkbox-HtVxajw_.js → Checkbox-CHueH9FZ.js} +4 -4
  11. package/dist/Checkbox.js +1 -1
  12. package/dist/CheckboxButton-Ch3zxviG.js +29 -0
  13. package/dist/CheckboxButton.js +1 -1
  14. package/dist/CheckboxGroup.js +15 -15
  15. package/dist/{Content-CPAYV7wp.js → Content-xPY804ey.js} +1 -1
  16. package/dist/Content.js +1 -1
  17. package/dist/{ContextMenu-BGfJXwpB.js → ContextMenu-ChxMleeO.js} +3 -3
  18. package/dist/ContextMenu.js +2 -2
  19. package/dist/CopyButton.js +5 -5
  20. package/dist/FieldDescription.js +2 -2
  21. package/dist/{FieldError--Qpixa12.js → FieldError-Bl_SXH5M.js} +3 -3
  22. package/dist/FieldError.js +1 -1
  23. package/dist/Header.js +1 -1
  24. package/dist/HeaderNavigation.js +1 -1
  25. package/dist/{Heading-CYit9Nf-.js → Heading-CSfMC_V6.js} +2 -2
  26. package/dist/Heading.js +1 -1
  27. package/dist/{Icon-DhFv_0k_.js → Icon-DXq5lwp4.js} +7 -6
  28. package/dist/Icon.js +1 -1
  29. package/dist/{IconCheck-D8ys0_F5.js → IconCheck-BLXj9z4I.js} +1 -1
  30. package/dist/{IconCheckboxEmpty-DRlqWMgD.js → IconCheckboxEmpty-CseDZ77J.js} +1 -1
  31. package/dist/{IconCheckboxIndeterminate-CfK_tk87.js → IconCheckboxIndeterminate-BdEkNKEg.js} +1 -1
  32. package/dist/{IconChevronDown-gLJKgegq.js → IconChevronDown-DGMWVrr9.js} +1 -1
  33. package/dist/{IconChevronRight-CqgfPevo.js → IconChevronRight-Sd5qEgz9.js} +1 -1
  34. package/dist/{IconClose-BEe9M79E.js → IconClose-BuJDcvk1.js} +1 -1
  35. package/dist/{IconContextMenu-B9OI5d_u.js → IconContextMenu-BtDEfs_U.js} +1 -1
  36. package/dist/{IconCopy-A7uxuck-.js → IconCopy-Y4GR1Z03.js} +1 -1
  37. package/dist/{IconDanger-ALKH8dEk.js → IconDanger-D3n1sEDX.js} +1 -1
  38. package/dist/{IconPending-BV6Loio6.js → IconPending-C0IPPa0F.js} +1 -1
  39. package/dist/{IconPlus-eFn-agxn.js → IconPlus-BL-Zqbnv.js} +1 -1
  40. package/dist/{IconRadioOn--oXSoOvP.js → IconRadioOn-D0pCkmJ4.js} +1 -1
  41. package/dist/{IconSearch-BO1yNi13.js → IconSearch-B9UA2NmT.js} +1 -1
  42. package/dist/{IconSucceeded-d8xQyLF2.js → IconSucceeded-B4DEKa6J.js} +1 -1
  43. package/dist/{IconWarning-CAgZzx72.js → IconWarning-CmSsxAnH.js} +1 -1
  44. package/dist/Icons.js +16 -16
  45. package/dist/{IllustratedMessage-D1xVzeZO.js → IllustratedMessage-BUg2-svi.js} +1 -1
  46. package/dist/IllustratedMessage.js +1 -1
  47. package/dist/Image.js +5 -5
  48. package/dist/Initials.js +1 -1
  49. package/dist/InlineAlert.js +4 -4
  50. package/dist/{Label-DWCo1l63.js → Label-CfPzBQtx.js} +1 -1
  51. package/dist/Label.js +1 -1
  52. package/dist/LabeledValue.js +1 -1
  53. package/dist/LayoutCard.js +2 -2
  54. package/dist/{Link-BK57CeBv.js → Link-BNozTXoN.js} +2 -2
  55. package/dist/Link.js +1 -1
  56. package/dist/List.js +199 -204
  57. package/dist/{LoadingSpinner-BV4S5RsS.js → LoadingSpinner-smFm5pXR.js} +2 -2
  58. package/dist/LoadingSpinner.js +1 -1
  59. package/dist/MenuItem-CgrBX4na.js +54 -0
  60. package/dist/MenuItem.js +1 -1
  61. package/dist/Modal.js +13 -6
  62. package/dist/Navigation.js +3 -3
  63. package/dist/NumberField.js +7 -7
  64. package/dist/OffCanvas.js +7 -7
  65. package/dist/Overlay-CUZ1KZa8.js +33 -0
  66. package/dist/OverlayTrigger.js +3 -3
  67. package/dist/Popover-B6bARCOK.js +17 -0
  68. package/dist/ProgressBar.js +1 -1
  69. package/dist/PropsContextProvider-ChpH8eF2.js +81 -0
  70. package/dist/RadioGroup.js +46 -37
  71. package/dist/Section.js +18 -18
  72. package/dist/Select.js +6 -6
  73. package/dist/Skeleton-CKLaTmDR.js +22 -0
  74. package/dist/Skeleton.js +1 -1
  75. package/dist/StatusBadge.js +3 -3
  76. package/dist/{StatusIcon-CvIY_c35.js → StatusIcon-CzfeqAZQ.js} +3 -3
  77. package/dist/StatusIcon.js +1 -1
  78. package/dist/Switch.js +5 -5
  79. package/dist/Tabs.js +47 -39
  80. package/dist/{Text-DXApO_Re.js → Text-DOQUStg_.js} +2 -2
  81. package/dist/Text.js +1 -1
  82. package/dist/TextArea.js +2 -2
  83. package/dist/TextField.js +2 -2
  84. package/dist/{TextFieldBase-C7g5i_rC.js → TextFieldBase-B6lQlCmE.js} +2 -2
  85. package/dist/context-CEG7VfKL.js +58 -0
  86. package/dist/controller.js +1 -1
  87. package/dist/{flowComponent-Dha_9C4F.js → flowComponent-Cv_SURLH.js} +35 -34
  88. package/dist/hooks.js +1 -1
  89. package/dist/{index-0qLHBjoi.js → index-BlZLqtIV.js} +8 -8
  90. package/dist/react-hook-form.js +2 -2
  91. package/dist/styles.css +1 -1
  92. package/dist/types/components/Action/Action.d.ts +2 -12
  93. package/dist/types/components/Action/components/ActionButton.d.ts +4 -0
  94. package/dist/types/components/Action/components/ActionLink.d.ts +4 -0
  95. package/dist/types/components/Action/components/ConfirmationModal.d.ts +4 -0
  96. package/dist/types/components/Action/components/ConfirmationModalButton.d.ts +4 -0
  97. package/dist/types/components/Action/context.d.ts +15 -0
  98. package/dist/types/components/Action/index.d.ts +1 -1
  99. package/dist/types/components/Action/lib/execution/ActionExecution.d.ts +2 -2
  100. package/dist/types/components/Action/lib/execution/ActionState.d.ts +1 -1
  101. package/dist/types/components/Action/lib/execution/useActionController.d.ts +2 -3
  102. package/dist/types/components/Action/stories/Default.stories.d.ts +1 -1
  103. package/dist/types/components/Action/stories/EdgeCases.stories.d.ts +1 -1
  104. package/dist/types/components/Action/types.d.ts +11 -0
  105. package/dist/types/components/List/components/Items/ListItem/ListItem.d.ts +6 -0
  106. package/dist/types/components/List/components/Items/ListItem/index.d.ts +4 -0
  107. package/dist/types/components/List/index.d.ts +1 -0
  108. package/dist/types/components/List/stories/ListItem.stories.d.ts +1 -0
  109. package/dist/types/components/Modal/Modal.d.ts +1 -0
  110. package/dist/types/components/Overlay/Overlay.d.ts +1 -0
  111. package/dist/types/components/Popover/Popover.d.ts +3 -1
  112. package/dist/types/components/Popover/stories/Default.stories.d.ts +1 -0
  113. package/dist/types/components/Popover/stories/EdgeCases.stories.d.ts +7 -0
  114. package/dist/types/components/Skeleton/Skeleton.d.ts +4 -1
  115. package/dist/types/lib/promises/sleep.d.ts +1 -0
  116. package/package.json +24 -28
  117. package/dist/Action-5b_DWWiS.js +0 -191
  118. package/dist/CheckboxButton-BPC6RfJj.js +0 -29
  119. package/dist/MenuItem-CzSUuXS-.js +0 -49
  120. package/dist/Overlay-ofdfFqqi.js +0 -28
  121. package/dist/Popover-MmxZkKu3.js +0 -15
  122. package/dist/Popover.js +0 -7
  123. package/dist/PropsContextProvider-DZvwqHLP.js +0 -64
  124. package/dist/Skeleton-D97e6aVe.js +0 -14
  125. package/dist/context-DJetA3qV.js +0 -8
  126. package/dist/types/components/Action/lib/execution/breakAction.d.ts +0 -2
  127. package/dist/types/components/Action/lib/execution/useActionFunction.d.ts +0 -4
  128. package/dist/types/components/List/components/Items/Item/Item.d.ts +0 -5
  129. package/dist/types/components/List/components/Items/Item/index.d.ts +0 -5
  130. /package/dist/types/components/List/components/Items/{Item → ListItem}/FallbackRenderer.d.ts +0 -0
@@ -1,14 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- import { ActionFn } from './types';
3
- import { OverlayController } from '../../lib/controller/overlay';
1
+ import { FC } from 'react';
2
+ import { ActionProps } from './types';
4
3
 
5
- export interface ActionProps extends PropsWithChildren {
6
- action?: ActionFn;
7
- closeOverlay?: boolean | OverlayController;
8
- openOverlay?: boolean | OverlayController;
9
- toggleOverlay?: boolean | OverlayController;
10
- break?: boolean;
11
- showFeedback?: boolean;
12
- }
13
4
  export declare const Action: FC<ActionProps>;
14
- export default Action;
@@ -0,0 +1,4 @@
1
+ import { FlowRenderFn } from '../../../lib/types/props';
2
+ import { ButtonProps } from '../../Button';
3
+
4
+ export declare const ActionButton: FlowRenderFn<ButtonProps>;
@@ -0,0 +1,4 @@
1
+ import { FlowRenderFn } from '../../../lib/types/props';
2
+ import { LinkProps } from '../../Link';
3
+
4
+ export declare const ActionLink: FlowRenderFn<LinkProps>;
@@ -0,0 +1,4 @@
1
+ import { FlowRenderFn } from '../../../lib/types/props';
2
+ import { ModalProps } from '../../Modal';
3
+
4
+ export declare const ConfirmationModal: FlowRenderFn<ModalProps>;
@@ -0,0 +1,4 @@
1
+ import { FlowRenderFn } from '../../../lib/types/props';
2
+ import { ButtonProps } from '../../Button';
3
+
4
+ export declare const ConfirmationModalButton: FlowRenderFn<ButtonProps>;
@@ -0,0 +1,15 @@
1
+ import { ActionProps } from './types';
2
+ import { OverlayController } from '../../lib/controller';
3
+ import { ActionState } from './lib/execution/ActionState';
4
+
5
+ export interface ActionContextValue {
6
+ actionProps: ActionProps;
7
+ parentContext?: ActionContextValue;
8
+ confirmationModalController: OverlayController;
9
+ needsConfirmation: boolean;
10
+ overlayController: OverlayController;
11
+ state: ActionState;
12
+ }
13
+ export declare const ActionContextProvider: import('react').Provider<ActionContextValue>;
14
+ export declare const useActionContext: () => ActionContextValue;
15
+ export declare const useNewActionContext: (props: ActionProps) => ActionContextValue;
@@ -1,5 +1,5 @@
1
1
  import { Action } from './Action';
2
2
 
3
- export { type ActionProps, Action } from './Action';
3
+ export { Action } from './Action';
4
4
  export * from './types';
5
5
  export default Action;
@@ -13,8 +13,8 @@ export declare class ActionExecution {
13
13
  error: unknown;
14
14
  constructor(state: ActionState, args: unknown[], options?: ActionExecutionOptions);
15
15
  onAsyncStart(): void;
16
- onSucceeded(): void;
17
- onFailed(error: unknown): void;
16
+ onSucceeded(): Promise<void>;
17
+ onFailed(error: unknown): Promise<void>;
18
18
  private startFailedFeedback;
19
19
  private startSucceededFeedback;
20
20
  private resetAfterDone;
@@ -1,7 +1,7 @@
1
1
  export type ActionStateValue = "isIdle" | "isSucceeded" | "isPending" | "isExecuting" | "isFailed";
2
2
  export declare class ActionState {
3
3
  state: ActionStateValue;
4
- private constructor();
4
+ constructor();
5
5
  static useNew(): ActionState;
6
6
  updateState(newState: ActionStateValue): void;
7
7
  useState(): ActionStateValue;
@@ -1,10 +1,9 @@
1
1
  import { ActionFn } from '../../types';
2
- import { ActionProps } from '../../Action';
3
2
  import { ActionState } from './ActionState';
4
3
 
5
4
  interface UseActionController {
6
- callAction: ActionFn;
5
+ execute: ActionFn;
7
6
  state: ActionState;
8
7
  }
9
- export declare const useActionController: (actionProps: ActionProps) => UseActionController;
8
+ export declare const useActionController: () => UseActionController;
10
9
  export {};
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
- import { default as Action } from '../Action';
2
+ import { Action } from '..';
3
3
 
4
4
  declare const meta: Meta<typeof Action>;
5
5
  export default meta;
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
- import { default as Action } from '../Action';
2
+ import { Action } from '..';
3
3
 
4
4
  declare const meta: Meta<typeof Action>;
5
5
  export default meta;
@@ -1 +1,12 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { OverlayController } from '../../lib/controller';
3
+
1
4
  export type ActionFn = (...args: unknown[]) => unknown;
5
+ export interface ActionProps extends PropsWithChildren {
6
+ action?: ActionFn;
7
+ closeOverlay?: boolean | OverlayController;
8
+ openOverlay?: boolean | OverlayController;
9
+ toggleOverlay?: boolean | OverlayController;
10
+ break?: boolean;
11
+ showFeedback?: boolean;
12
+ }
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren, default as React } from 'react';
2
+ import { LinkDOMProps } from '@react-types/shared';
3
+
4
+ type Props = PropsWithChildren & LinkDOMProps;
5
+ export declare const ListItem: (props: Props) => React.JSX.Element;
6
+ export default ListItem;
@@ -0,0 +1,4 @@
1
+ import { ListItem } from './ListItem';
2
+
3
+ export { ListItem } from './ListItem';
4
+ export default ListItem;
@@ -4,6 +4,7 @@ export * from './List';
4
4
  export * from './components/Header/ListFilter';
5
5
  export * from './components/Header/ListSorting';
6
6
  export * from './components/Items/ListItemView';
7
+ export * from './components/Items/ListItem';
7
8
  export * from './components/ListLoaderAsync';
8
9
  export * from './components/ListStaticData';
9
10
  export default List;
@@ -7,5 +7,6 @@ type Story = StoryObj<typeof List>;
7
7
  export declare const Default: Story;
8
8
  export declare const WithTopContent: Story;
9
9
  export declare const WithContent: Story;
10
+ export declare const WithLink: Story;
10
11
  export declare const WithButton: Story;
11
12
  export declare const SmallSpace: Story;
@@ -8,6 +8,7 @@ export interface ModalProps extends PropsWithChildren, FlowComponentProps<"Modal
8
8
  offCanvas?: boolean;
9
9
  controller?: OverlayController;
10
10
  slot?: string;
11
+ isDismissable?: boolean;
11
12
  }
12
13
  export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<never>>;
13
14
  export default Modal;
@@ -3,6 +3,7 @@ import { OverlayController } from '../../lib/controller';
3
3
 
4
4
  export interface OverlayProps extends PropsWithChildren {
5
5
  controller?: OverlayController;
6
+ isDismissable?: boolean;
6
7
  className?: string;
7
8
  }
8
9
  export declare const Overlay: FC<OverlayProps>;
@@ -1,6 +1,8 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
 
3
3
  import * as Aria from "react-aria-components";
4
- export type PopoverProps = PropsWithChildren<Omit<Aria.PopoverProps, "children">>;
4
+ export interface PopoverProps extends PropsWithChildren<Omit<Aria.PopoverProps, "children">> {
5
+ withTip?: boolean;
6
+ }
5
7
  export declare const Popover: FC<PopoverProps>;
6
8
  export default Popover;
@@ -5,3 +5,4 @@ declare const meta: Meta<typeof Popover>;
5
5
  export default meta;
6
6
  type Story = StoryObj<typeof Popover>;
7
7
  export declare const Default: Story;
8
+ export declare const WithTip: Story;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Popover } from '..';
3
+
4
+ declare const meta: Meta<typeof Popover>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof Popover>;
7
+ export declare const LongContent: Story;
@@ -1,5 +1,8 @@
1
1
  import { ComponentProps, FC } from 'react';
2
2
 
3
- export type SkeletonProps = ComponentProps<"div">;
3
+ export interface SkeletonProps extends ComponentProps<"div"> {
4
+ width?: string;
5
+ height?: string;
6
+ }
4
7
  export declare const Skeleton: FC<SkeletonProps>;
5
8
  export default Skeleton;
@@ -0,0 +1 @@
1
+ export declare const sleep: (ms: number) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.122",
3
+ "version": "0.1.0-alpha.124",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -162,10 +162,6 @@
162
162
  "types": "./dist/types/components/Overlay/components/OverlayTrigger/index.d.ts",
163
163
  "import": "./dist/OverlayTrigger.js"
164
164
  },
165
- "./Popover": {
166
- "types": "./dist/types/components/Popover/index.d.ts",
167
- "import": "./dist/Popover.js"
168
- },
169
165
  "./ProgressBar": {
170
166
  "types": "./dist/types/components/ProgressBar/index.d.ts",
171
167
  "import": "./dist/ProgressBar.js"
@@ -255,12 +251,12 @@
255
251
  },
256
252
  "dependencies": {
257
253
  "@chakra-ui/live-region": "^2.1.0",
258
- "@mittwald/react-tunnel": "^0.1.0-alpha.122",
254
+ "@mittwald/react-tunnel": "^0.1.0-alpha.124",
259
255
  "@mittwald/react-use-promise": "^2.3.13",
260
256
  "@react-aria/utils": "^3.24.0",
261
257
  "@react-types/shared": "^3.23.0",
262
- "@storybook/test": "^8.1.0",
263
- "@tabler/icons-react": "^3.3.0",
258
+ "@storybook/test": "^8.1.1",
259
+ "@tabler/icons-react": "^3.4.0",
264
260
  "@tanstack/react-table": "^8.17.3",
265
261
  "clsx": "^2.1.1",
266
262
  "copy-to-clipboard": "^3.3.3",
@@ -279,22 +275,22 @@
279
275
  },
280
276
  "devDependencies": {
281
277
  "@faker-js/faker": "^8.4.1",
282
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.122",
278
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.124",
283
279
  "@mittwald/react-use-promise": "^2.3.13",
284
- "@nx/storybook": "^19.0.3",
285
- "@storybook/addon-a11y": "^8.1.0",
286
- "@storybook/addon-actions": "^8.1.0",
287
- "@storybook/addon-essentials": "^8.1.0",
288
- "@storybook/addon-interactions": "^8.1.0",
289
- "@storybook/addon-links": "^8.1.0",
290
- "@storybook/blocks": "^8.1.0",
291
- "@storybook/components": "^8.1.0",
292
- "@storybook/core-events": "^8.1.0",
293
- "@storybook/manager-api": "^8.1.0",
294
- "@storybook/preview-api": "^8.1.0",
295
- "@storybook/react": "^8.1.0",
296
- "@storybook/react-vite": "^8.1.0",
297
- "@storybook/theming": "^8.1.0",
280
+ "@nx/storybook": "^19.0.4",
281
+ "@storybook/addon-a11y": "^8.1.1",
282
+ "@storybook/addon-actions": "^8.1.1",
283
+ "@storybook/addon-essentials": "^8.1.1",
284
+ "@storybook/addon-interactions": "^8.1.1",
285
+ "@storybook/addon-links": "^8.1.1",
286
+ "@storybook/blocks": "^8.1.1",
287
+ "@storybook/components": "^8.1.1",
288
+ "@storybook/core-events": "^8.1.1",
289
+ "@storybook/manager-api": "^8.1.1",
290
+ "@storybook/preview-api": "^8.1.1",
291
+ "@storybook/react": "^8.1.1",
292
+ "@storybook/react-vite": "^8.1.1",
293
+ "@storybook/theming": "^8.1.1",
298
294
  "@testing-library/dom": "^10.1.0",
299
295
  "@testing-library/jest-dom": "^6.4.5",
300
296
  "@testing-library/react": "~15.0.7",
@@ -312,7 +308,7 @@
312
308
  "fs-jetpack": "^5.1.0",
313
309
  "happy-dom": "^14.11.0",
314
310
  "next": "^14.2.3",
315
- "nx": "^19.0.3",
311
+ "nx": "^19.0.4",
316
312
  "postcss": "^8.4.38",
317
313
  "postcss-nested-import": "^1.3.0",
318
314
  "postcss-nesting": "^12.1.4",
@@ -323,10 +319,10 @@
323
319
  "react-element-to-jsx-string": "^15.0.0",
324
320
  "react-hook-form": "^7.51.4",
325
321
  "rollup": "^4.17.2",
326
- "sass": "^1.77.1",
327
- "storybook": "^8.1.0",
322
+ "sass": "^1.77.2",
323
+ "storybook": "^8.1.1",
328
324
  "storybook-addon-rtl": "^1.0.0",
329
- "tsx": "^4.10.2",
325
+ "tsx": "^4.10.4",
330
326
  "typescript": "^5.4.5",
331
327
  "typescript-plugin-css-modules": "^5.1.0",
332
328
  "vite": "^5.2.11",
@@ -355,5 +351,5 @@
355
351
  "optional": true
356
352
  }
357
353
  },
358
- "gitHead": "590e97686d4e77e37651f64cf6938f724f88e8be"
354
+ "gitHead": "8ef429764a855586a064aaa1ce20262740e848ab"
359
355
  }
@@ -1,191 +0,0 @@
1
- "use client"
2
- /* */
3
- var C = Object.defineProperty;
4
- var E = (t, e, n) => e in t ? C(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
5
- var f = (t, e, n) => (E(t, typeof e != "symbol" ? e + "" : e, n), n);
6
- import c, { useRef as D, useMemo as g, useState as w, useEffect as P } from "react";
7
- import "./propsContext-CauylOgH.js";
8
- import { P as x } from "./PropsContextProvider-DZvwqHLP.js";
9
- import "@react-aria/utils";
10
- import { values as M, omit as O } from "remeda";
11
- import { u as R, O as B } from "./index-0qLHBjoi.js";
12
- import { u as I, A as T } from "./context-DJetA3qV.js";
13
- import { TunnelProvider as N, TunnelExit as $ } from "@mittwald/react-tunnel";
14
- import { makeObservable as G, observable as H, action as L } from "mobx";
15
- import { u as U } from "./useSelector-DpU7_HMO.js";
16
- const b = (t) => (...e) => {
17
- const n = [...t], s = n.shift();
18
- if (s) {
19
- const o = s(...e), r = () => n.length === 0 ? o : b(n)(...e);
20
- return o instanceof Promise ? o.then(r) : r();
21
- }
22
- }, F = "flowBreakActionMarker";
23
- function j(t) {
24
- return !!t && t instanceof Error && t.message === F;
25
- }
26
- const q = () => {
27
- throw new Error(F);
28
- }, v = {
29
- pending: 1e3,
30
- succeeded: 1500,
31
- failed: 2e3
32
- };
33
- class z {
34
- constructor(e, n, s = {}) {
35
- f(this, "options");
36
- f(this, "state");
37
- f(this, "args");
38
- f(this, "isDone", !1);
39
- f(this, "error");
40
- const {
41
- resetAfterDone: o = !0,
42
- onFeedbackDone: r = () => {
43
- },
44
- showFeedback: d = !1
45
- } = s;
46
- this.state = e, this.args = n, this.options = { resetAfterDone: o, onFeedbackDone: r, showFeedback: d };
47
- }
48
- onAsyncStart() {
49
- this.options.showFeedback = !0, this.state.updateState("isExecuting"), setTimeout(() => this.startPending(), v.pending);
50
- }
51
- onSucceeded() {
52
- this.onDone();
53
- }
54
- onFailed(e) {
55
- this.error = e ?? new Error("Unknown error"), console.error(e), this.onDone();
56
- }
57
- startFailedFeedback() {
58
- j(this.error) ? this.resetAfterDone() : (this.state.updateState("isFailed"), setTimeout(() => this.resetAfterDone(), v.failed));
59
- }
60
- startSucceededFeedback() {
61
- this.state.updateState("isSucceeded"), setTimeout(() => this.resetAfterDone(), v.succeeded);
62
- }
63
- resetAfterDone() {
64
- this.options.resetAfterDone && this.state.updateState("isIdle"), this.error || this.options.onFeedbackDone(...this.args);
65
- }
66
- onDone() {
67
- this.isDone = !0, this.options.showFeedback ? this.error ? this.startFailedFeedback() : this.startSucceededFeedback() : this.resetAfterDone();
68
- }
69
- startPending() {
70
- this.isDone || this.state.updateState("isPending");
71
- }
72
- }
73
- class k {
74
- constructor() {
75
- f(this, "state", "isIdle");
76
- G(this, {
77
- state: H,
78
- updateState: L
79
- });
80
- }
81
- static useNew() {
82
- return D(new k()).current;
83
- }
84
- updateState(e) {
85
- this.state = e;
86
- }
87
- useState() {
88
- return U(() => this.state, [this]);
89
- }
90
- }
91
- const J = () => {
92
- }, K = (t) => {
93
- const {
94
- action: e,
95
- toggleOverlay: n,
96
- openOverlay: s,
97
- closeOverlay: o,
98
- break: r
99
- } = t, d = R(), i = (m) => typeof m == "boolean" ? d : m;
100
- return e || (n ? i(n).toggle : s ? i(s).open : o ? i(o).close : r ? q : J);
101
- }, h = () => {
102
- }, Q = (t, e = {}) => {
103
- const {
104
- onSync: n = h,
105
- onAsync: s = h,
106
- then: o = h,
107
- catch: r = h,
108
- finally: d = h
109
- } = e;
110
- try {
111
- const i = t();
112
- return i instanceof Promise ? (s(), i.then(o).catch(r).finally(d)) : (n(), o(i), d(), i);
113
- } catch (i) {
114
- n(), r(i), d();
115
- }
116
- }, V = (t) => {
117
- const { isConfirmationAction: e, showFeedback: n } = t, s = K(t), o = I(), r = k.useNew(), d = !e, i = e ? void 0 : o, m = e ? o : void 0, u = b([s, i]), l = (...y) => {
118
- const p = new z(r, y, {
119
- onFeedbackDone: m,
120
- resetAfterDone: d,
121
- showFeedback: n
122
- });
123
- return Q(u, {
124
- onAsync: () => p.onAsyncStart(),
125
- then: () => p.onSucceeded(),
126
- catch: (S) => p.onFailed(S)
127
- });
128
- }, a = M(O(t, ["children"]));
129
- return g(
130
- () => ({
131
- callAction: l,
132
- state: r
133
- }),
134
- a
135
- );
136
- }, A = (t) => {
137
- const [e, n] = w(!1), s = B.useNew(), o = V(t), r = e ? s.open : o.callAction, m = {
138
- Link: {
139
- onPress: r
140
- },
141
- Button: {
142
- onPress: r,
143
- render: (u, l) => {
144
- const a = o.state.useState();
145
- return /* @__PURE__ */ c.createElement(
146
- u,
147
- {
148
- ...l,
149
- isPending: a === "isPending" ? !0 : void 0,
150
- "aria-disabled": a !== "isIdle" ? !0 : void 0,
151
- isSucceeded: a === "isSucceeded" ? !0 : void 0,
152
- isFailed: a === "isFailed" ? !0 : void 0
153
- }
154
- );
155
- }
156
- },
157
- Modal: {
158
- tunnelId: "outsideActionProvider",
159
- render: (u, l) => {
160
- const a = l.slot === "actionConfirm";
161
- return P(() => {
162
- if (a)
163
- return n(!0), () => {
164
- n(!1);
165
- };
166
- }, [a]), a ? /* @__PURE__ */ c.createElement(u, { controller: s, ...l }) : /* @__PURE__ */ c.createElement(u, { ...l });
167
- },
168
- ButtonGroup: {
169
- Button: {
170
- render: (u, l) => {
171
- const { color: a } = l;
172
- return a === "secondary" ? /* @__PURE__ */ c.createElement(A, { break: !0 }, /* @__PURE__ */ c.createElement(A, { closeOverlay: !0 }, /* @__PURE__ */ c.createElement(u, { ...l }))) : /* @__PURE__ */ c.createElement(A, { closeOverlay: !0 }, /* @__PURE__ */ c.createElement(A, { ...t, isConfirmationAction: !0 }, /* @__PURE__ */ c.createElement(u, { ...l })));
173
- }
174
- }
175
- }
176
- }
177
- };
178
- return /* @__PURE__ */ c.createElement(N, null, /* @__PURE__ */ c.createElement(
179
- x,
180
- {
181
- props: m,
182
- dependencies: [e, o],
183
- mergeInParentContext: !0
184
- },
185
- /* @__PURE__ */ c.createElement(T, { value: r }, t.children),
186
- /* @__PURE__ */ c.createElement($, { id: "outsideActionProvider" })
187
- ));
188
- };
189
- export {
190
- A
191
- };
@@ -1,29 +0,0 @@
1
- "use client"
2
- /* */
3
- import t from "react";
4
- import a from "clsx";
5
- import { C as m } from "./ClearPropsContext-CeCMjUK9.js";
6
- import { P as p } from "./PropsContextProvider-DZvwqHLP.js";
7
- import "@react-aria/utils";
8
- import "./propsContext-CauylOgH.js";
9
- import "remeda";
10
- import { C as b } from "./Checkbox-HtVxajw_.js";
11
- import { f as x } from "./flowComponent-Dha_9C4F.js";
12
- const C = "flow--checkbox-button", f = "flow--checkbox-button--label", i = "flow--checkbox-button--content", o = {
13
- checkboxButton: C,
14
- label: f,
15
- content: i
16
- }, v = x("CheckboxButton", (e) => {
17
- const { children: c, className: n, ...r } = e, s = a(o.checkboxButton, n), l = {
18
- Text: {
19
- className: o.label
20
- },
21
- Content: {
22
- className: o.content
23
- }
24
- };
25
- return /* @__PURE__ */ t.createElement(m, null, /* @__PURE__ */ t.createElement(b, { ...r, className: s }, /* @__PURE__ */ t.createElement(p, { props: l }, c)));
26
- });
27
- export {
28
- v as C
29
- };
@@ -1,49 +0,0 @@
1
- "use client"
2
- /* */
3
- import e from "react";
4
- import * as I from "react-aria-components";
5
- import p from "clsx";
6
- import "./propsContext-CauylOgH.js";
7
- import { P as a } from "./PropsContextProvider-DZvwqHLP.js";
8
- import "@react-aria/utils";
9
- import "remeda";
10
- import "@tabler/icons-react";
11
- import "./Icon-DhFv_0k_.js";
12
- import { I as x, a as d } from "./IconCheckboxEmpty-DRlqWMgD.js";
13
- import { I as E, a as C } from "./IconRadioOn--oXSoOvP.js";
14
- import { T as i } from "./Text-DXApO_Re.js";
15
- import { d as h } from "./deepFindOfType-6pG0fH7S.js";
16
- import { W as M } from "./Wrap-DGT1h1o3.js";
17
- import { f as N } from "./flowComponent-Dha_9C4F.js";
18
- const w = "flow--menu-item", T = "flow--menu-item--icon", g = "flow--menu-item--text", P = "flow--menu-item--control-icon", c = {
19
- menuItem: w,
20
- icon: T,
21
- text: g,
22
- controlIcon: P
23
- }, k = (o, t) => !!h(o, t), y = (o) => {
24
- const {
25
- selectionMode: t,
26
- isSelected: n,
27
- selectionVariant: r = "control",
28
- children: m
29
- } = o, s = {
30
- Icon: {
31
- className: c.icon
32
- },
33
- Text: {
34
- className: c.text
35
- }
36
- }, l = {
37
- Icon: {
38
- className: p(c.controlIcon, c.icon)
39
- }
40
- }, u = t === "none" || r === "navigation" ? null : t === "single" && n ? /* @__PURE__ */ e.createElement(E, null) : t === "single" && !n ? /* @__PURE__ */ e.createElement(C, null) : t === "multiple" && n ? /* @__PURE__ */ e.createElement(x, null) : /* @__PURE__ */ e.createElement(d, null), f = k(m, i);
41
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(a, { props: l }, u), /* @__PURE__ */ e.createElement(a, { props: s }, /* @__PURE__ */ e.createElement(M, { if: !f }, /* @__PURE__ */ e.createElement(i, null, m))));
42
- }, D = N("MenuItem", (o) => {
43
- const { children: t, className: n, selectionVariant: r, ...m } = o, s = p(c.menuItem, n);
44
- return /* @__PURE__ */ e.createElement(I.MenuItem, { ...m, className: s }, (l) => /* @__PURE__ */ e.createElement(y, { ...l, selectionVariant: r }, t));
45
- });
46
- export {
47
- D as M,
48
- k as d
49
- };
@@ -1,28 +0,0 @@
1
- "use client"
2
- /* */
3
- import * as r from "react-aria-components";
4
- import e from "react";
5
- import v from "clsx";
6
- import { u as y, a as p } from "./index-0qLHBjoi.js";
7
- import "mobx";
8
- const u = "flow--overlay", O = {
9
- overlay: u,
10
- "overlay-fade": "flow--overlay--overlay-fade"
11
- }, E = (l) => {
12
- const { controller: t, children: a, className: s } = l, n = y({
13
- reuseControllerFromContext: !0
14
- }), o = t ?? n, c = o.useIsOpen(), m = v(O.overlay, s);
15
- return /* @__PURE__ */ e.createElement(
16
- r.ModalOverlay,
17
- {
18
- className: m,
19
- isDismissable: !0,
20
- isOpen: c,
21
- onOpenChange: (i) => o.setOpen(i)
22
- },
23
- /* @__PURE__ */ e.createElement(r.Modal, null, /* @__PURE__ */ e.createElement(r.Dialog, null, /* @__PURE__ */ e.createElement(p, { value: o }, a)))
24
- );
25
- };
26
- export {
27
- E as O
28
- };
@@ -1,15 +0,0 @@
1
- "use client"
2
- /* */
3
- import t from "react";
4
- import * as a from "react-aria-components";
5
- import c from "clsx";
6
- const l = "flow--popover", m = {
7
- popover: l,
8
- "popover-slide": "flow--popover--popover-slide"
9
- }, i = (o) => {
10
- const { children: e, className: r, ...p } = o, s = c(m.popover, r);
11
- return /* @__PURE__ */ t.createElement(a.Popover, { ...p, className: s }, e);
12
- };
13
- export {
14
- i as P
15
- };
package/dist/Popover.js DELETED
@@ -1,7 +0,0 @@
1
- "use client"
2
- /* */
3
- import { P as r } from "./Popover-MmxZkKu3.js";
4
- export {
5
- r as Popover,
6
- r as default
7
- };