@mittwald/flow-react-components 0.1.0-alpha.56 → 0.1.0-alpha.57

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 (48) hide show
  1. package/dist/ButtonGroup.js +13 -13
  2. package/dist/{Checkbox-DBT4VBSr.js → Checkbox-gCtHl4pE.js} +8 -7
  3. package/dist/Checkbox.js +1 -1
  4. package/dist/{CheckboxButton-CoEvnLRt.js → CheckboxButton-CW6TfZFj.js} +1 -1
  5. package/dist/CheckboxButton.js +1 -1
  6. package/dist/CheckboxGroup.js +1 -1
  7. package/dist/ContextMenu.js +63 -22
  8. package/dist/IconCheckboxEmpty-BNFRkCm2.js +10 -0
  9. package/dist/IconCheckboxIndeterminate-Bsk1h92j.js +9 -0
  10. package/dist/Icons.js +34 -33
  11. package/dist/List.js +226 -221
  12. package/dist/deepHas-ocYuTM8M.js +7 -0
  13. package/dist/styles.css +1 -1
  14. package/dist/types/components/Button/Button.d.ts +1 -1
  15. package/dist/types/components/Content/Content.d.ts +1 -1
  16. package/dist/types/components/ContextMenu/ContextMenu.d.ts +2 -2
  17. package/dist/types/components/ContextMenu/components/ContextMenuItem/ContextMenuItem.d.ts +2 -2
  18. package/dist/types/components/ContextMenu/components/ContextMenuItem/ContextMenuItemContent.d.ts +6 -0
  19. package/dist/types/components/ContextMenu/stories/Default.stories.d.ts +2 -0
  20. package/dist/types/components/CopyButton/CopyButton.d.ts +1 -1
  21. package/dist/types/components/FieldError/FieldError.d.ts +1 -1
  22. package/dist/types/components/Header/Header.d.ts +1 -1
  23. package/dist/types/components/Icon/Icon.d.ts +1 -1
  24. package/dist/types/components/Image/Image.d.ts +1 -1
  25. package/dist/types/components/Initials/Initials.d.ts +1 -1
  26. package/dist/types/components/InlineAlert/InlineAlert.d.ts +1 -1
  27. package/dist/types/components/Label/Label.d.ts +1 -1
  28. package/dist/types/components/LayoutCard/LayoutCard.d.ts +1 -1
  29. package/dist/types/components/Link/Link.d.ts +1 -2
  30. package/dist/types/components/List/List.d.ts +2 -1
  31. package/dist/types/components/List/components/Item/Item.d.ts +1 -1
  32. package/dist/types/components/List/components/ShowNextBatchButton/ShowNextBatchButton.d.ts +5 -0
  33. package/dist/types/components/List/components/ShowNextBatchButton/index.d.ts +4 -0
  34. package/dist/types/components/List/model/List.d.ts +2 -2
  35. package/dist/types/components/List/model/loading/IncrementalLoader.d.ts +2 -3
  36. package/dist/types/components/List/model/pagination/BatchesController.d.ts +17 -0
  37. package/dist/types/components/List/model/pagination/types.d.ts +2 -2
  38. package/dist/types/components/List/model/types.d.ts +2 -2
  39. package/dist/types/components/RadioGroup/components/Radio/Radio.d.ts +1 -2
  40. package/dist/types/components/StatusBadge/StatusBadge.d.ts +1 -1
  41. package/dist/types/components/Switch/Switch.d.ts +1 -1
  42. package/dist/types/components/Text/Text.d.ts +1 -1
  43. package/dist/types/lib/types/props.d.ts +1 -3
  44. package/package.json +3 -3
  45. package/dist/IconCheckboxIndeterminate-B6FOeb87.js +0 -11
  46. package/dist/types/components/List/components/ShowMoreItemsButton/ShowMoreItemsButton.d.ts +0 -5
  47. package/dist/types/components/List/components/ShowMoreItemsButton/index.d.ts +0 -4
  48. package/dist/types/components/List/model/pagination/Pagination.d.ts +0 -17
@@ -1,5 +1,5 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
- import { default as React, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren, default as React } from 'react';
3
3
 
4
4
  import * as Aria from "react-aria-components";
5
5
  export interface ButtonProps extends PropsWithChildren<Omit<Aria.ButtonProps, "style">>, FlowComponentProps {
@@ -1,6 +1,6 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { PropsWithElementType } from '../../lib/types/props';
3
- import { default as React, PropsWithChildren } from 'react';
3
+ import { PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  export interface ContentProps extends PropsWithChildren, PropsWithElementType, FlowComponentProps {
6
6
  }
@@ -1,9 +1,9 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { ContextMenuItemProps } from './components/ContextMenuItem';
3
- import { default as React, PropsWithChildren } from 'react';
3
+ import { PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  import * as Aria from "react-aria-components";
6
- export interface ContextMenuProps extends Omit<Aria.PopoverProps, "children">, Pick<Aria.MenuProps<ContextMenuItemProps>, "onAction">, PropsWithChildren, FlowComponentProps {
6
+ export interface ContextMenuProps extends Omit<Aria.PopoverProps, "children">, Pick<Aria.MenuProps<ContextMenuItemProps>, "onAction" | "selectionMode" | "selectedKeys" | "defaultSelectedKeys" | "onSelectionChange">, PropsWithChildren, FlowComponentProps {
7
7
  }
8
8
  export declare const ContextMenu: React.ComponentClass<ContextMenuProps, any> | React.FunctionComponent<ContextMenuProps>;
9
9
  export default ContextMenu;
@@ -1,7 +1,7 @@
1
- import { FC } from 'react';
1
+ import { FC, PropsWithChildren } from 'react';
2
2
 
3
3
  import * as Aria from "react-aria-components";
4
- export interface ContextMenuItemProps extends Aria.MenuItemProps {
4
+ export interface ContextMenuItemProps extends Omit<Aria.MenuItemProps, "children">, PropsWithChildren {
5
5
  }
6
6
  export declare const ContextMenuItem: FC<ContextMenuItemProps>;
7
7
  export default ContextMenuItem;
@@ -0,0 +1,6 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+
3
+ import type * as Aria from "react-aria-components";
4
+ type Props = Aria.MenuItemRenderProps & PropsWithChildren;
5
+ export declare const ContextMenuItemContent: FC<Props>;
6
+ export {};
@@ -5,3 +5,5 @@ declare const meta: Meta<typeof ContextMenu>;
5
5
  export default meta;
6
6
  type Story = StoryObj<typeof ContextMenu>;
7
7
  export declare const Default: Story;
8
+ export declare const SingleSelection: Story;
9
+ export declare const MultipleSelection: Story;
@@ -1,6 +1,6 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { ButtonProps } from '../Button';
3
- import { default as React, ReactNode } from 'react';
3
+ import { ReactNode, default as React } from 'react';
4
4
 
5
5
  export interface CopyButtonProps extends Omit<ButtonProps, "onPress" | "aria-label">, FlowComponentProps {
6
6
  text: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
- import { default as React, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren, default as React } from 'react';
3
3
 
4
4
  import * as Aria from "react-aria-components";
5
5
  export interface FieldErrorProps extends PropsWithChildren<Omit<Aria.FieldErrorProps, "children">>, FlowComponentProps {
@@ -1,6 +1,6 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { PropsWithElementType } from '../../lib/types/props';
3
- import { default as React, PropsWithChildren } from 'react';
3
+ import { PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  export interface HeaderProps extends PropsWithChildren, PropsWithElementType, FlowComponentProps {
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
- import { default as React, PropsWithChildren, SVGAttributes } from 'react';
2
+ import { PropsWithChildren, SVGAttributes, default as React } from 'react';
3
3
 
4
4
  type SvgAttributeProps = SVGAttributes<SVGSVGElement>;
5
5
  export interface IconProps extends PropsWithChildren<Omit<SvgAttributeProps, "name">>, FlowComponentProps {
@@ -1,5 +1,5 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
- import { default as React, ComponentProps } from 'react';
2
+ import { ComponentProps, default as React } from 'react';
3
3
 
4
4
  export interface ImageProps extends ComponentProps<"img">, FlowComponentProps {
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
- import { default as React, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren, default as React } from 'react';
3
3
 
4
4
  export interface InitialsProps extends PropsWithChildren, FlowComponentProps {
5
5
  className?: string;
@@ -1,6 +1,6 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { PropsWithStatus } from '../../lib/types/props';
3
- import { default as React, ComponentProps, PropsWithChildren } from 'react';
3
+ import { ComponentProps, PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  export interface InlineAlertProps extends PropsWithChildren<ComponentProps<"aside">>, PropsWithStatus, FlowComponentProps {
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
- import { default as React, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren, default as React } from 'react';
3
3
 
4
4
  import * as Aria from "react-aria-components";
5
5
  export interface LabelProps extends PropsWithChildren<Omit<Aria.LabelProps, "children">>, FlowComponentProps {
@@ -1,6 +1,6 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { PropsWithElementType } from '../../lib/types/props';
3
- import { default as React, PropsWithChildren } from 'react';
3
+ import { PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  export interface LayoutCardProps extends PropsWithChildren, PropsWithElementType, FlowComponentProps {
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { PropsWithClassName } from '../../lib/types/props';
2
2
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
3
- import { default as React, ComponentProps, ComponentType, PropsWithChildren } from 'react';
3
+ import { ComponentProps, ComponentType, PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  import * as Aria from "react-aria-components";
6
6
  export interface LinkProps extends PropsWithChildren<Omit<Aria.LinkProps, "children" | "slot" | "className">>, FlowComponentProps, PropsWithClassName {
@@ -8,7 +8,6 @@ export interface LinkProps extends PropsWithChildren<Omit<Aria.LinkProps, "child
8
8
  variant?: "default" | "danger";
9
9
  inline?: boolean;
10
10
  linkComponent?: ComponentType<Omit<ComponentProps<"a">, "ref">>;
11
- unstyled?: boolean;
12
11
  "aria-current"?: string;
13
12
  }
14
13
  export declare const Link: React.ComponentClass<LinkProps, any> | React.FunctionComponent<LinkProps>;
@@ -1,8 +1,9 @@
1
1
  import { ListShape } from './model/types';
2
2
  import { AnyData } from './model/item/types';
3
- import { default as React, PropsWithChildren } from 'react';
3
+ import { PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  interface Props extends PropsWithChildren, Pick<ListShape<AnyData>, "enableMultiSort"> {
6
+ batchSize?: number;
6
7
  }
7
8
  export declare function List(props: Props): React.JSX.Element;
8
9
  export default List;
@@ -1,4 +1,4 @@
1
- import { default as React, PropsWithChildren } from 'react';
1
+ import { PropsWithChildren, default as React } from 'react';
2
2
 
3
3
  interface Props extends PropsWithChildren {
4
4
  }
@@ -0,0 +1,5 @@
1
+ import { ButtonProps } from '../../../Button';
2
+ import { FC } from 'react';
3
+
4
+ export declare const ShowNextBatchButton: FC<ButtonProps>;
5
+ export default ShowNextBatchButton;
@@ -0,0 +1,4 @@
1
+ import { ShowNextBatchButton } from './ShowNextBatchButton';
2
+
3
+ export { ShowNextBatchButton } from './ShowNextBatchButton';
4
+ export default ShowNextBatchButton;
@@ -4,7 +4,7 @@ import { default as ReactTable } from './ReactTable';
4
4
  import { Sorting } from './sorting/Sorting';
5
5
  import { Filter } from './filter/Filter';
6
6
  import { RenderItemFn } from './item/Item';
7
- import { Pagination } from './pagination/Pagination';
7
+ import { BatchesController } from './pagination/BatchesController';
8
8
  import { ItemCollection } from './item/ItemCollection';
9
9
 
10
10
  export declare class List<T> {
@@ -13,7 +13,7 @@ export declare class List<T> {
13
13
  readonly items: ItemCollection<T>;
14
14
  readonly render?: RenderItemFn<T>;
15
15
  readonly reactTable: ReactTable<T>;
16
- readonly pagination: Pagination<T>;
16
+ readonly batches: BatchesController<T>;
17
17
  readonly loader: IncrementalLoader<T>;
18
18
  private constructor();
19
19
  static useNew<T>(shape: ListShape<T>): List<T>;
@@ -15,8 +15,7 @@ export declare class IncrementalLoader<T> {
15
15
  useIsLoading(): boolean;
16
16
  useData(): T[];
17
17
  getLoaderInvocationHooks(): Array<() => void>;
18
- private useLoadPage;
18
+ private useLoadBatch;
19
19
  private getDataLoaderOptions;
20
- private getPageDataAsyncResource;
21
- loadMore(): void;
20
+ private getBatchDataAsyncResource;
22
21
  }
@@ -0,0 +1,17 @@
1
+ import { BatchesControllerShape } from './types';
2
+ import { default as List } from '../List';
3
+
4
+ export declare class BatchesController<T> {
5
+ readonly batchSize: number;
6
+ private readonly list;
7
+ constructor(list: List<T>, shape?: BatchesControllerShape);
8
+ private get reactTable();
9
+ getBatchIndex(): number;
10
+ hasNextBatch(): boolean;
11
+ getTotalItemsCount(): number | undefined;
12
+ getFilteredItemsCount(): number;
13
+ getVisibleItemsCount(): number | undefined;
14
+ updateItemTotalCount(value: number): void;
15
+ reset(): void;
16
+ nextBatch(): void;
17
+ }
@@ -1,3 +1,3 @@
1
- export interface PaginationShape {
2
- pageSize?: number;
1
+ export interface BatchesControllerShape {
2
+ batchSize?: number;
3
3
  }
@@ -1,6 +1,6 @@
1
1
  import { IncrementalLoaderShape } from './loading/types';
2
2
  import { FilterShape } from './filter/types';
3
- import { PaginationShape } from './pagination/types';
3
+ import { BatchesControllerShape } from './pagination/types';
4
4
  import { SortingShape } from './sorting/types';
5
5
  import { PropertyName, RenderItemFn } from './item/Item';
6
6
 
@@ -9,7 +9,7 @@ export interface ListShape<T> {
9
9
  render?: RenderItemFn<T>;
10
10
  filters?: FilterShape<T>[];
11
11
  sorting?: SortingShape<T>[];
12
- pagination?: PaginationShape;
12
+ batchesController?: BatchesControllerShape;
13
13
  enableMultiSort?: boolean;
14
14
  }
15
15
  export type PropertyRecord<T, TValue> = Partial<Record<PropertyName<T>, TValue>>;
@@ -1,9 +1,8 @@
1
1
  import { FlowComponentProps } from '../../../../lib/componentFactory/flowComponent';
2
- import { default as React, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren, default as React } from 'react';
3
3
 
4
4
  import * as Aria from "react-aria-components";
5
5
  export interface RadioProps extends PropsWithChildren<Omit<Aria.RadioProps, "children">>, FlowComponentProps {
6
- unstyled?: boolean;
7
6
  }
8
7
  export declare const Radio: React.ComponentClass<RadioProps, any> | React.FunctionComponent<RadioProps>;
9
8
  export default Radio;
@@ -1,6 +1,6 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { PropsWithStatus } from '../../lib/types/props';
3
- import { default as React, PropsWithChildren } from 'react';
3
+ import { PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  export interface StatusBadgeProps extends PropsWithChildren, PropsWithStatus, FlowComponentProps {
6
6
  className?: string;
@@ -1,5 +1,5 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
- import { default as React, PropsWithChildren } from 'react';
2
+ import { PropsWithChildren, default as React } from 'react';
3
3
 
4
4
  import * as Aria from "react-aria-components";
5
5
  export interface SwitchProps extends PropsWithChildren<Omit<Aria.SwitchProps, "children">>, FlowComponentProps {
@@ -1,6 +1,6 @@
1
1
  import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
2
2
  import { PropsWithElementType } from '../../lib/types/props';
3
- import { default as React, PropsWithChildren } from 'react';
3
+ import { PropsWithChildren, default as React } from 'react';
4
4
 
5
5
  import * as Aria from "react-aria-components";
6
6
  export interface TextProps extends PropsWithChildren, Omit<Aria.TextProps, "children" | "elementType">, PropsWithElementType, FlowComponentProps {
@@ -1,14 +1,12 @@
1
- import { ExoticComponent, HTMLAttributes, ReactElement, ReactHTML } from 'react';
1
+ import { ExoticComponent, HTMLAttributes, ReactHTML } from 'react';
2
2
 
3
3
  export type Status = "info" | "success" | "warning" | "danger";
4
4
  export type PropsWithStatus<T extends Status = Status, P = unknown> = P & {
5
5
  status?: T;
6
6
  };
7
7
  export interface PropsWithTunnel {
8
- tunnelId?: string;
9
8
  }
10
9
  export interface PropsWithHOC<P> {
11
- hoc?: (element: ReactElement, props: P) => ReactElement;
12
10
  }
13
11
  export interface PropsWithClassName {
14
12
  className?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.56",
3
+ "version": "0.1.0-alpha.57",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -198,7 +198,7 @@
198
198
  "test:unit": "run vitest run"
199
199
  },
200
200
  "dependencies": {
201
- "@mittwald/react-tunnel": "^0.1.0-alpha.56",
201
+ "@mittwald/react-tunnel": "^0.1.0-alpha.57",
202
202
  "@mittwald/react-use-promise": "^2.3.13",
203
203
  "@react-aria/utils": "^3.23.2",
204
204
  "@react-types/shared": "^3.22.1",
@@ -291,5 +291,5 @@
291
291
  "optional": true
292
292
  }
293
293
  },
294
- "gitHead": "afc7a47e25fa101440ff55f8f642d70c2c48f685"
294
+ "gitHead": "a0fc4a2ceded7435fca7697c224ae5e3e76db85c"
295
295
  }
@@ -1,11 +0,0 @@
1
- "use client"
2
- /* */
3
- import e from "react";
4
- import { IconSquareCheckFilled as n, IconSquare as o, IconSquareMinusFilled as r } from "@tabler/icons-react";
5
- import { I as c } from "./Icon-DK_xMxr-.js";
6
- const I = (t) => /* @__PURE__ */ e.createElement(c, { ...t }, /* @__PURE__ */ e.createElement(n, null)), s = (t) => /* @__PURE__ */ e.createElement(c, { ...t }, /* @__PURE__ */ e.createElement(o, null)), i = (t) => /* @__PURE__ */ e.createElement(c, { ...t }, /* @__PURE__ */ e.createElement(r, null));
7
- export {
8
- I,
9
- i as a,
10
- s as b
11
- };
@@ -1,5 +0,0 @@
1
- import { ButtonProps } from '../../../Button';
2
- import { FC } from 'react';
3
-
4
- export declare const ShowMoreItemsButton: FC<ButtonProps>;
5
- export default ShowMoreItemsButton;
@@ -1,4 +0,0 @@
1
- import { ShowMoreItemsButton } from './ShowMoreItemsButton';
2
-
3
- export { ShowMoreItemsButton } from './ShowMoreItemsButton';
4
- export default ShowMoreItemsButton;
@@ -1,17 +0,0 @@
1
- import { PaginationShape } from './types';
2
- import { default as List } from '../List';
3
-
4
- export declare class Pagination<T> {
5
- private readonly list;
6
- readonly initialPageSize: number;
7
- constructor(list: List<T>, shape?: PaginationShape);
8
- getPageIndex(): number;
9
- hasNextPage(): boolean;
10
- nextPage(): void;
11
- updatePageSize(size: number): void;
12
- getPageSize(): number;
13
- getTotalItemsCount(): number | undefined;
14
- getFilteredItemsCount(): number;
15
- getVisibleItemsCount(): number | undefined;
16
- updateItemTotalCount(value: number): void;
17
- }