@orioro/react-ui-core 0.0.3 → 0.0.6

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 (103) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/AppHeader/AppHeaderContext.d.ts +11 -2
  3. package/dist/AppHeader/Root.d.ts +1 -1
  4. package/dist/AppHeader/index.d.ts +2 -2
  5. package/dist/Box/Box.d.ts +2 -0
  6. package/dist/Button/Button.d.ts +2 -2
  7. package/dist/Button/ButtonCore.d.ts +2 -0
  8. package/dist/Button/LinkButton.d.ts +2 -2
  9. package/dist/Debug/index.d.ts +1 -0
  10. package/dist/Dialog/AuthDialog/AuthDialog.d.ts +2 -1
  11. package/dist/Dialog/AuthDialog/SignUpForm.d.ts +2 -2
  12. package/dist/Dialog/AuthDialog/dialogSystemSpec.d.ts +2 -0
  13. package/dist/Dialog/AuthDialog/index.d.ts +1 -0
  14. package/dist/Dialog/ConfirmDialog/ConfirmDialog.d.ts +1 -1
  15. package/dist/Dialog/ConfirmDialog/dialogSystemSpec.d.ts +2 -0
  16. package/dist/Dialog/ConfirmDialog/index.d.ts +1 -0
  17. package/dist/Dialog/ConfirmDialog/types.d.ts +1 -0
  18. package/dist/Dialog/DialogSystem_legacy/DialogSystem_.d.ts +2 -0
  19. package/dist/Dialog/DialogSystem_legacy/index.stories_.d.ts +7 -0
  20. package/dist/Dialog/DialogSystem_legacy/prompt.stories_.d.ts +6 -0
  21. package/dist/Dialog/DialogSystem_legacy/tmpDialogSystem.d.ts +3 -0
  22. package/dist/Dialog/DialogSystem_legacy/types.d.ts +25 -0
  23. package/dist/Dialog/InfoDialog/dialogSystemSpec.d.ts +2 -0
  24. package/dist/Dialog/InfoDialog/index.d.ts +1 -0
  25. package/dist/Dialog/LoadingDialog/dialogSystemSpec.d.ts +2 -0
  26. package/dist/Dialog/LoadingDialog/index.d.ts +1 -0
  27. package/dist/Dialog/OptionsDialog/dialogSystemSpec.d.ts +2 -0
  28. package/dist/Dialog/OptionsDialog/index.d.ts +1 -0
  29. package/dist/Dialog/PromptDialog/dialogSystemSpec.d.ts +2 -0
  30. package/dist/Dialog/PromptDialog/index.d.ts +1 -0
  31. package/dist/Dialog/createDialogSystem/createDialogSystem.d.ts +3 -10
  32. package/dist/Dialog/createDialogSystem/dialogSystemReducer.d.ts +2 -0
  33. package/dist/Dialog/createDialogSystem/dialogSystemSpecs.d.ts +2 -0
  34. package/dist/Dialog/createDialogSystem/index.d.ts +2 -1
  35. package/dist/Dialog/createDialogSystem/tmp_util.d.ts +16 -0
  36. package/dist/Dialog/createDialogSystem/types.d.ts +48 -0
  37. package/dist/Dialog/createDialogSystem/useDialog.d.ts +6 -2
  38. package/dist/Dialog/createDialogSystem/util.d.ts +16 -0
  39. package/dist/Dialog/createDialogSystem2/createDialogSystem.d.ts +6 -0
  40. package/dist/Dialog/createDialogSystem2/dialogSystemReducer.d.ts +2 -0
  41. package/dist/Dialog/createDialogSystem2/index.d.ts +2 -0
  42. package/dist/Dialog/createDialogSystem2/proxyRef.d.ts +2 -0
  43. package/dist/Dialog/createDialogSystem2/types.d.ts +48 -0
  44. package/dist/Dialog/createDialogSystem2/util.d.ts +16 -0
  45. package/dist/Dialog/createDialogSystem_legacy/createDialogSystem.d.ts +13 -0
  46. package/dist/Dialog/createDialogSystem_legacy/index.d.ts +1 -0
  47. package/dist/Dialog/createDialogSystem_legacy/proxyRef.d.ts +2 -0
  48. package/dist/Dialog/createDialogSystem_legacy/useDialog.d.ts +22 -0
  49. package/dist/Dialog/specUtil/index.d.ts +5 -0
  50. package/dist/EvenSpacedList/EvenSpacedList.d.ts +6 -2
  51. package/dist/FileDropzone/index.d.ts +1 -0
  52. package/dist/Flex/Flex.d.ts +27 -16
  53. package/dist/FlexGrid/FlexGrid.d.ts +23 -1
  54. package/dist/Input/BooleanCheckboxInput/index.d.ts +28 -6
  55. package/dist/Input/InputGrid/index.d.ts +5 -1
  56. package/dist/Input/ObjectInput/index.d.ts +44 -8
  57. package/dist/Input/RangeInput/RangeInput.d.ts +11 -0
  58. package/dist/Input/RangeInput/index.d.ts +1 -0
  59. package/dist/Input/RichTextInput/RichTextInput.d.ts +13 -13
  60. package/dist/Input/RichTextInput/RichTextInput_20240730_backup_NO_MARKDOWN.d.ts +13 -13
  61. package/dist/Input/SingleFileInput/index.d.ts +65 -6
  62. package/dist/Input/SingleFileInput/middleware.d.ts +4 -0
  63. package/dist/Input/SliderInput/SliderInput.d.ts +16 -0
  64. package/dist/Input/SliderInput/index.d.ts +1 -0
  65. package/dist/Input/SwitchInput/index.d.ts +6 -0
  66. package/dist/Input/TextInput/index.d.ts +14 -13
  67. package/dist/Input/TextInput/parseValidator.d.ts +1 -1
  68. package/dist/Input/TextInput/types.d.ts +1 -0
  69. package/dist/Input/TextInput/useTextInput.d.ts +3 -2
  70. package/dist/Input/TextareaInput/index.d.ts +13 -13
  71. package/dist/Input/TreeSelectInput/TreeSelectInput.d.ts +42 -0
  72. package/dist/Input/TreeSelectInput/index.d.ts +1 -0
  73. package/dist/Input/index.d.ts +5 -0
  74. package/dist/Input/types.d.ts +1 -1
  75. package/dist/Input/useValidation/useValidation.d.ts +1 -1
  76. package/dist/Interaction/constants.d.ts +1 -0
  77. package/dist/Interaction/index.d.ts +1 -0
  78. package/dist/LanguageSelector/index.d.ts +3 -2
  79. package/dist/Markdown/index.d.ts +7 -0
  80. package/dist/Menu/ButtonBarMenu/ButtonBarMenu.d.ts +13 -0
  81. package/dist/Menu/ButtonBarMenu/OverflowableButtonBarMenu.d.ts +8 -0
  82. package/dist/Menu/ButtonBarMenu/index.d.ts +2 -13
  83. package/dist/UIContext/UIContext.d.ts +16 -0
  84. package/dist/UIContext/index.d.ts +1 -0
  85. package/dist/cascadingContextProvider/index.d.ts +8 -0
  86. package/dist/componentMaker/componentMaker.d.ts +4 -0
  87. package/dist/entriesByIdReducer/entriesByIdReducer.d.ts +26 -0
  88. package/dist/entriesByIdReducer/index.d.ts +1 -0
  89. package/dist/index.d.ts +5 -1
  90. package/dist/index.mjs +4494 -5208
  91. package/dist/makeLink/locationAwareLink.d.ts +1 -1
  92. package/dist/mergeable/index.d.ts +1 -0
  93. package/dist/mergeable/mergeRender.d.ts +3 -0
  94. package/dist/mergeable/types.d.ts +2 -2
  95. package/dist/mergeable/util.d.ts +1 -0
  96. package/dist/useByIdState/index.d.ts +8 -0
  97. package/dist/usePromptUI/renderPromptInput.d.ts +1 -1
  98. package/dist/usePromptUI/types.d.ts +1 -2
  99. package/dist/useRefByKey/index.d.ts +1 -0
  100. package/dist/util/htmlTagComponent.d.ts +2 -0
  101. package/dist/util/index.d.ts +1 -0
  102. package/dist/util/mergeChildren.d.ts +2 -0
  103. package/package.json +8 -5
package/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # @orioro/react-ui-core
2
+
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - fix changeset release with yarn
8
+ - Updated dependencies
9
+ - @orioro/resolve@0.1.2
10
+ - @orioro/tree-model@0.0.2
11
+ - @orioro/react-select@3.0.2
12
+ - @orioro/react-tree@0.0.2
13
+ - @orioro/util@0.11.2
14
+ - @orioro/validate@0.0.2
15
+
16
+ ## 0.0.5
17
+
18
+ ### Patch Changes
19
+
20
+ - f26720d: Initialize package version control using changeset
21
+ - Updated dependencies [f26720d]
22
+ - @orioro/tree-model@0.0.1
23
+ - @orioro/resolve@0.1.1
24
+ - @orioro/react-select@3.0.1
25
+ - @orioro/react-tree@0.0.1
26
+ - @orioro/validate@0.0.1
27
+ - @orioro/util@0.11.1
@@ -1,5 +1,14 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  export type AppHeaderContextType = {
3
3
  headerHeight: number;
4
+ menuOpen: boolean;
5
+ setMenuOpen: (nextMenuOpen: boolean) => void;
4
6
  };
5
- export declare const AppHeaderContext: import("react").Context<AppHeaderContextType>;
7
+ export declare const AppHeaderContext: React.Context<AppHeaderContextType>;
8
+ export type AppHeaderProviderProps = {
9
+ initialMenuOpen: boolean;
10
+ headerHeight: number;
11
+ children: React.ReactNode;
12
+ };
13
+ export declare function AppHeaderProvider({ initialMenuOpen, headerHeight, children, }: AppHeaderProviderProps): React.JSX.Element;
14
+ export declare function useAppHeader(): AppHeaderContextType;
@@ -6,4 +6,4 @@ export type RootProps = Omit<ContainerProps, 'as'> & {
6
6
  children: React.ReactNode;
7
7
  gap?: ResponsiveValueInput<CSSLength>;
8
8
  };
9
- export declare function Root({ children, gap, ...containerProps }: RootProps): React.JSX.Element;
9
+ export declare const Root: React.ForwardRefExoticComponent<Omit<RootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { Root } from './Root';
3
2
  import { OverlayMenu } from './OverlayMenu';
3
+ export * from './AppHeaderContext';
4
4
  export declare const AppHeader: {
5
- Root: typeof Root;
5
+ Root: import("react").ForwardRefExoticComponent<Omit<import("./Root").RootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
6
  Logo: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
7
7
  Main: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
8
8
  OverlayMenu: typeof OverlayMenu;
package/dist/Box/Box.d.ts CHANGED
@@ -6,7 +6,9 @@ type InsetDirection = 'top' | 'bottom' | 'left' | 'right';
6
6
  export type BoxProps = SpacingStyles & ResponsiveProps & {
7
7
  children?: React.ReactNode;
8
8
  width?: ResponsiveValueInput<CSSLength>;
9
+ maxWidth?: ResponsiveValueInput<CSSLength>;
9
10
  height?: ResponsiveValueInput<CSSLength>;
11
+ maxHeight?: ResponsiveValueInput<CSSLength>;
10
12
  position?: ResponsiveValueInput<CSSPosition>;
11
13
  top?: ResponsiveValueInput<CSSLength>;
12
14
  right?: ResponsiveValueInput<CSSLength>;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  export declare const Button: import("react").ForwardRefExoticComponent<(Omit<{
3
3
  value?: string | number | readonly string[] | undefined;
4
- form?: string | undefined;
5
4
  key?: import("react").Key | null | undefined;
5
+ form?: string | undefined;
6
6
  m?: import("@radix-ui/themes/dist/cjs/props/prop-def").Responsive<import("@radix-ui/themes/dist/cjs/props/prop-def").Union<string, "1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
7
7
  my?: import("@radix-ui/themes/dist/cjs/props/prop-def").Responsive<import("@radix-ui/themes/dist/cjs/props/prop-def").Union<string, "1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
8
8
  mx?: import("@radix-ui/themes/dist/cjs/props/prop-def").Responsive<import("@radix-ui/themes/dist/cjs/props/prop-def").Union<string, "1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
@@ -78,7 +78,7 @@ export declare const Button: import("react").ForwardRefExoticComponent<(Omit<{
78
78
  results?: number | undefined;
79
79
  security?: string | undefined;
80
80
  unselectable?: "on" | "off" | undefined;
81
- inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
81
+ inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
82
82
  is?: string | undefined;
83
83
  "aria-activedescendant"?: string | undefined;
84
84
  "aria-atomic"?: (boolean | "false" | "true") | undefined;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ButtonCore: React.ForwardRefExoticComponent<import("@radix-ui/themes/dist/cjs/components/button").ButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -7,8 +7,8 @@ declare const DefaultLinkComponent: import("styled-components").IStyledComponent
7
7
  export declare function makeLinkButton(LinkComponent: typeof DefaultLinkComponent): React.FC<LinkButtonProps>;
8
8
  export declare const LinkButton: React.FC<{
9
9
  value?: string | number | readonly string[] | undefined;
10
- form?: string | undefined;
11
10
  key?: React.Key | null | undefined;
11
+ form?: string | undefined;
12
12
  m?: import("@radix-ui/themes/dist/cjs/props/prop-def").Responsive<import("@radix-ui/themes/dist/cjs/props/prop-def").Union<string, "1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
13
13
  my?: import("@radix-ui/themes/dist/cjs/props/prop-def").Responsive<import("@radix-ui/themes/dist/cjs/props/prop-def").Union<string, "1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
14
14
  mx?: import("@radix-ui/themes/dist/cjs/props/prop-def").Responsive<import("@radix-ui/themes/dist/cjs/props/prop-def").Union<string, "1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
@@ -84,7 +84,7 @@ export declare const LinkButton: React.FC<{
84
84
  results?: number | undefined;
85
85
  security?: string | undefined;
86
86
  unselectable?: "on" | "off" | undefined;
87
- inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
87
+ inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
88
88
  is?: string | undefined;
89
89
  "aria-activedescendant"?: string | undefined;
90
90
  "aria-atomic"?: (boolean | "false" | "true") | undefined;
@@ -6,4 +6,5 @@ export * from './RandomIcon';
6
6
  export type DebugProps = {
7
7
  data: any;
8
8
  };
9
+ export declare function safeJSONStringify(obj: unknown): string;
9
10
  export declare function Debug({ data, ...props }: DebugProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- export function AuthDialog({ open, onCancel, onAuthed, onLogIn, onSignUp, onRequestAccountRecovery, initialValue, initialActiveTab, DialogsContext, messages, localeOptions, locale, onSetLocale, ...props }: {
1
+ export function AuthDialog({ open, onCancel, onAuthed, onLogIn, onSignUp, onRequestAccountRecovery, initialValue, initialActiveTab, DialogsContext, onInfo, messages, localeOptions, locale, onSetLocale, ...props }: {
2
2
  [x: string]: any;
3
3
  open: any;
4
4
  onCancel: any;
@@ -9,6 +9,7 @@ export function AuthDialog({ open, onCancel, onAuthed, onLogIn, onSignUp, onRequ
9
9
  initialValue?: {} | undefined;
10
10
  initialActiveTab?: string | undefined;
11
11
  DialogsContext: any;
12
+ onInfo: any;
12
13
  messages?: {
13
14
  dialogTitle: string;
14
15
  logIn: string;
@@ -1,4 +1,4 @@
1
- export function SignupForm({ onSignUp, onCancel, initialValue, DialogsContext, messages, __lockInitialValue, }: {
1
+ export function SignupForm({ onSignUp, onCancel, initialValue, onInfo, messages, __lockInitialValue, }: {
2
2
  onSignUp: any;
3
3
  onCancel: any;
4
4
  initialValue?: {
@@ -7,7 +7,7 @@ export function SignupForm({ onSignUp, onCancel, initialValue, DialogsContext, m
7
7
  primaryEmail: string;
8
8
  password: string;
9
9
  } | undefined;
10
- DialogsContext: any;
10
+ onInfo: any;
11
11
  messages: any;
12
12
  __lockInitialValue?: boolean | undefined;
13
13
  }): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DialogSpec } from '../createDialogSystem';
2
+ export declare const AUTH_DIALOG: DialogSpec;
@@ -1,3 +1,4 @@
1
1
  export * from "./AuthDialog";
2
2
  export * from "./useAuthDialog";
3
3
  export * from "./constants";
4
+ export * from "./dialogSystemSpec";
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { AlertDialog } from '@radix-ui/themes';
3
3
  import { ConfirmDialogContentProps, ConfirmDialogProps } from './types';
4
- export declare function ConfirmDialogContent({ title, message, cancel, confirm, onConfirm, onCancel, }: ConfirmDialogContentProps): React.JSX.Element;
4
+ export declare function ConfirmDialogContent({ title, message, cancel, confirm, dismissable, onConfirm, onCancel, }: ConfirmDialogContentProps): React.JSX.Element;
5
5
  export declare function ConfirmDialog({ open, ...contentProps }: ConfirmDialogProps): React.JSX.Element;
6
6
  export declare namespace ConfirmDialog {
7
7
  var Root: React.FC<AlertDialog.RootProps>;
@@ -0,0 +1,2 @@
1
+ import { DialogSpec } from '../createDialogSystem';
2
+ export declare const CONFIRM_DIALOG: DialogSpec;
@@ -1,2 +1,3 @@
1
1
  export * from './ConfirmDialog';
2
2
  export * from './useConfirmDialog';
3
+ export * from './dialogSystemSpec';
@@ -8,6 +8,7 @@ export type ConfirmDialogLabels = {
8
8
  export type ConfirmDialogContentProps = {
9
9
  onConfirm: () => void | Promise<void>;
10
10
  onCancel?: () => void | Promise<void>;
11
+ dismissable?: boolean;
11
12
  } & Partial<ConfirmDialogLabels>;
12
13
  export type ConfirmDialogProps = ConfirmDialogContentProps & {
13
14
  open?: boolean;
@@ -0,0 +1,2 @@
1
+ import { DialogSpecList } from '../createDialogSystem';
2
+ export declare const DIALOGS: DialogSpecList;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ decorators: ((Story: any) => React.JSX.Element)[];
5
+ };
6
+ export default _default;
7
+ export declare const Basic: () => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Basic: () => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { DialogSystemProps } from './types';
3
+ export declare function DialogSystem({ children, ...props }: DialogSystemProps): React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { useConfirmDialog } from '../ConfirmDialog';
3
+ import { ConfirmDialogProps } from '../ConfirmDialog/types';
4
+ import { InfoDialogProps, useInfoDialog } from '../InfoDialog';
5
+ import { LoadingDialogProps, useLoadingDialog } from '../LoadingDialog';
6
+ import { PromptDialogProps, usePromptDialog } from '../PromptDialog';
7
+ import { OptionsDialogProps } from '../OptionsDialog/types';
8
+ import { useOptionsDialog } from '../OptionsDialog';
9
+ export type DialogSystemDialogProps = Partial<{
10
+ info: InfoDialogProps;
11
+ loading: LoadingDialogProps;
12
+ prompt: PromptDialogProps;
13
+ confirm: ConfirmDialogProps;
14
+ options: OptionsDialogProps;
15
+ }>;
16
+ export type DialogSystemProps = DialogSystemDialogProps & {
17
+ children: React.ReactNode;
18
+ };
19
+ export type DialogSystemContextValue = {
20
+ info: ReturnType<typeof useInfoDialog>[1];
21
+ loading: ReturnType<typeof useLoadingDialog>[1];
22
+ prompt: ReturnType<typeof usePromptDialog>[1];
23
+ confirm: ReturnType<typeof useConfirmDialog>[1];
24
+ options: ReturnType<typeof useOptionsDialog>[1];
25
+ };
@@ -0,0 +1,2 @@
1
+ import { DialogSpec } from '../createDialogSystem';
2
+ export declare const INFO_DIALOG: DialogSpec;
@@ -1,3 +1,4 @@
1
1
  export * from './InfoDialog';
2
2
  export * from './types';
3
3
  export * from './useInfoDialog';
4
+ export * from './dialogSystemSpec';
@@ -0,0 +1,2 @@
1
+ import { DialogSpec } from '../createDialogSystem';
2
+ export declare const LOADING_DIALOG: DialogSpec;
@@ -1,3 +1,4 @@
1
1
  export * from './LoadingDialog';
2
2
  export * from './types';
3
3
  export * from './useLoadingDialog';
4
+ export * from './dialogSystemSpec';
@@ -0,0 +1,2 @@
1
+ import { DialogSpec } from '../createDialogSystem';
2
+ export declare const OPTIONS_DIALOG: DialogSpec;
@@ -1,2 +1,3 @@
1
1
  export * from './OptionsDialog';
2
2
  export * from './useOptionsDialog';
3
+ export * from './dialogSystemSpec';
@@ -0,0 +1,2 @@
1
+ import { DialogSpec } from '../createDialogSystem';
2
+ export declare const PROMPT_DIALOG: DialogSpec;
@@ -1,3 +1,4 @@
1
1
  export * from './PromptDialog';
2
2
  export * from './usePromptDialog';
3
3
  export * from './types';
4
+ export * from './dialogSystemSpec';
@@ -1,13 +1,6 @@
1
1
  import React from 'react';
2
- import { UseDialogOptions } from './useDialog';
3
- export type DialogSpecs = {
4
- [key: string]: ((props: any) => React.ReactElement) | [(props: any) => React.ReactElement, UseDialogOptions?];
5
- };
6
- type CreateDialogSystemProps = {
7
- dialogs: DialogSpecs;
8
- };
9
- export declare function createDialogSystem({ dialogs }: CreateDialogSystemProps): (React.Context<{}> | (({ children, ...props }: {
2
+ import { CreateDialogSystemProps, DialogSpecList, DialogsAPI } from './types';
3
+ export declare function createDialogSystem<T extends DialogSpecList = DialogSpecList>({ dialogs: dialogSpecs, unmountDelay, }: CreateDialogSystemProps): [({ children, ...props }: {
10
4
  [key: string]: Record<string, any>;
11
5
  children: React.ReactElement;
12
- }) => React.JSX.Element) | (() => {}))[];
13
- export {};
6
+ }) => React.JSX.Element, () => DialogsAPI<T>, React.Context<DialogsAPI<T>>];
@@ -0,0 +1,2 @@
1
+ import { DialogSytemAction, DialogSytemState } from './types';
2
+ export declare function dialogSystemReducer(currentState: DialogSytemState, action: DialogSytemAction): DialogSytemState;
@@ -0,0 +1,2 @@
1
+ import { DialogSpecList } from '../createDialogSystem';
2
+ export declare const DIALOGS: DialogSpecList;
@@ -1,2 +1,3 @@
1
1
  export * from './createDialogSystem';
2
- export * from './useDialog';
2
+ export * from './dialogSystemSpecs';
3
+ export * from './types';
@@ -0,0 +1,16 @@
1
+ export interface Deferred<T> {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: any) => void;
5
+ }
6
+ export declare function makeDeferred<T>(): Deferred<T>;
7
+ type AnyFn = (...args: any[]) => any;
8
+ type Hooks = Partial<{
9
+ input: AnyFn;
10
+ validate: AnyFn;
11
+ before: AnyFn;
12
+ output: AnyFn;
13
+ after: AnyFn;
14
+ }>;
15
+ export declare function hook(fn: AnyFn, { input, validate, before, output, after }: Hooks): (...args: any[]) => Promise<any>;
16
+ export {};
@@ -0,0 +1,48 @@
1
+ /// <reference types="react" />
2
+ import { Deferred } from './util';
3
+ export type DialogPropSetter = Record<string, any> | ((currentProps: Record<string, any>) => Record<string, any>);
4
+ export type DialogInstanceCtrl = {
5
+ resolve: (result?: any) => void;
6
+ reject: (err?: any) => void;
7
+ dialogs: Record<string, (...args: any[]) => any>;
8
+ setProps: (nextProps: DialogPropSetter) => void;
9
+ props: Record<string, any> | null;
10
+ };
11
+ export type DialogSpec<ComponentT extends React.FC<any> = React.FC<any>, ArgsT extends any[] = any[]> = [
12
+ ComponentT,
13
+ {
14
+ getProps: (ctrl: DialogInstanceCtrl, ...args: ArgsT) => Record<string, any> | false;
15
+ }
16
+ ];
17
+ export type DialogSpecList = {
18
+ [key: string]: DialogSpec;
19
+ };
20
+ export type DialogsAPI<T extends DialogSpecList> = {
21
+ [K in keyof T]: (...args: Parameters<T[K][1]['getProps']>[1]) => Promise<any>;
22
+ };
23
+ export type CreateDialogSystemProps = {
24
+ dialogs: DialogSpecList;
25
+ unmountDelay?: number;
26
+ };
27
+ export type DialogInstanceState = {
28
+ id: string;
29
+ methodName: string;
30
+ deferred: Deferred<any>;
31
+ props: Record<string, any>;
32
+ };
33
+ export type DialogSytemState = {
34
+ dialogInstances: DialogInstanceState[];
35
+ };
36
+ export type DialogSytemAction = {
37
+ type: 'addInstance';
38
+ payload: DialogInstanceState;
39
+ } | {
40
+ type: 'setInstanceProps';
41
+ payload: {
42
+ id: DialogInstanceState['id'];
43
+ props: Record<string, any> | ((currProps: Record<string, any>) => Record<string, any>);
44
+ };
45
+ } | {
46
+ type: 'removeInstance';
47
+ payload: DialogInstanceState['id'];
48
+ };
@@ -1,13 +1,16 @@
1
+ type DialogsAPI = Record<string, (...args: any[]) => Promise<any>>;
1
2
  export type UseDialogOptions = {
2
- props?: (defer: {
3
+ dialogs: DialogsAPI;
4
+ props?: (api: {
3
5
  resolve: (result?: any) => void;
4
6
  reject: (err: any) => void;
7
+ dialogs: DialogsAPI;
5
8
  }, ...args: any[]) => Record<string, any>;
6
9
  };
7
10
  /**
8
11
  * Utility hook that sets up promise resolution systems
9
12
  */
10
- export declare function useDialog<DialogProps, OnExecuteResultType = any>(baseDialogProps?: Partial<DialogProps>, options?: UseDialogOptions): {
13
+ export declare function useDialog<DialogProps, OnExecuteResultType = any>(baseDialogProps: Partial<DialogProps> | undefined, options: UseDialogOptions): {
11
14
  dialogProps: Partial<DialogProps> & {
12
15
  [key: string]: any;
13
16
  open?: boolean | undefined;
@@ -16,3 +19,4 @@ export declare function useDialog<DialogProps, OnExecuteResultType = any>(baseDi
16
19
  reject: (error: any) => Promise<void>;
17
20
  invoke: (...args: any[]) => Promise<OnExecuteResultType>;
18
21
  };
22
+ export {};
@@ -0,0 +1,16 @@
1
+ export interface Deferred<T> {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: any) => void;
5
+ }
6
+ export declare function makeDeferred<T>(): Deferred<T>;
7
+ type AnyFn = (...args: any[]) => any;
8
+ type Hooks = Partial<{
9
+ input: AnyFn;
10
+ validate: AnyFn;
11
+ before: AnyFn;
12
+ output: AnyFn;
13
+ after: AnyFn;
14
+ }>;
15
+ export declare function hook(fn: AnyFn, { input, validate, before, output, after }: Hooks): (...args: any[]) => Promise<any>;
16
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CreateDialogSystemProps, DialogSpecList, DialogsAPI } from './types';
3
+ export declare function createDialogSystem<T extends DialogSpecList = DialogSpecList>({ dialogs: dialogSpecs, unmountDelay, }: CreateDialogSystemProps): [({ children, ...props }: {
4
+ [key: string]: Record<string, any>;
5
+ children: React.ReactElement;
6
+ }) => React.JSX.Element, () => DialogsAPI<T>, React.Context<DialogsAPI<T>>];
@@ -0,0 +1,2 @@
1
+ import { DialogSytemAction, DialogSytemState } from './types';
2
+ export declare function dialogSystemReducer(currentState: DialogSytemState, action: DialogSytemAction): DialogSytemState;
@@ -0,0 +1,2 @@
1
+ export * from './createDialogSystem';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function proxyRef(keys: string[], toRef: React.RefObject<Record<string, any>>): Record<string, any>;
@@ -0,0 +1,48 @@
1
+ /// <reference types="react" />
2
+ import { Deferred } from './util';
3
+ export type DialogPropSetter = Record<string, any> | ((currentProps: Record<string, any>) => Record<string, any>);
4
+ export type DialogInstanceCtrl = {
5
+ resolve: (result?: any) => void;
6
+ reject: (err?: any) => void;
7
+ dialogs: Record<string, (...args: any[]) => any>;
8
+ setProps: (nextProps: DialogPropSetter) => void;
9
+ props: Record<string, any> | null;
10
+ };
11
+ export type DialogSpec<ComponentT extends React.FC<any> = React.FC<any>, ArgsT extends any[] = any[]> = [
12
+ ComponentT,
13
+ {
14
+ getProps: (ctrl: DialogInstanceCtrl, ...args: ArgsT) => Record<string, any>;
15
+ }
16
+ ];
17
+ export type DialogSpecList = {
18
+ [key: string]: DialogSpec;
19
+ };
20
+ export type DialogsAPI<T extends DialogSpecList> = {
21
+ [K in keyof T]: (...args: Parameters<T[K][1]['getProps']>[1]) => Promise<any>;
22
+ };
23
+ export type CreateDialogSystemProps = {
24
+ dialogs: DialogSpecList;
25
+ unmountDelay?: number;
26
+ };
27
+ export type DialogInstanceState = {
28
+ id: string;
29
+ methodName: string;
30
+ deferred: Deferred<any>;
31
+ props: Record<string, any>;
32
+ };
33
+ export type DialogSytemState = {
34
+ dialogInstances: DialogInstanceState[];
35
+ };
36
+ export type DialogSytemAction = {
37
+ type: 'addInstance';
38
+ payload: DialogInstanceState;
39
+ } | {
40
+ type: 'setInstanceProps';
41
+ payload: {
42
+ id: DialogInstanceState['id'];
43
+ props: Record<string, any> | ((currProps: Record<string, any>) => Record<string, any>);
44
+ };
45
+ } | {
46
+ type: 'removeInstance';
47
+ payload: DialogInstanceState['id'];
48
+ };
@@ -0,0 +1,16 @@
1
+ export interface Deferred<T> {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: any) => void;
5
+ }
6
+ export declare function makeDeferred<T>(): Deferred<T>;
7
+ type AnyFn = (...args: any[]) => any;
8
+ type Hooks = Partial<{
9
+ input: AnyFn;
10
+ validate: AnyFn;
11
+ before: AnyFn;
12
+ output: AnyFn;
13
+ after: AnyFn;
14
+ }>;
15
+ export declare function hook(fn: AnyFn, { input, validate, before, output, after }: Hooks): (...args: any[]) => Promise<any>;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { UseDialogOptions } from './useDialog';
3
+ export type DialogSpecs = {
4
+ [key: string]: ((props: any) => React.ReactElement) | [(props: any) => React.ReactElement, Partial<UseDialogOptions>?];
5
+ };
6
+ type CreateDialogSystemProps = {
7
+ dialogs: DialogSpecs;
8
+ };
9
+ export declare function createDialogSystem({ dialogs: dialogSpecs, }: CreateDialogSystemProps): (React.Context<{}> | (({ children, ...props }: {
10
+ [key: string]: Record<string, any>;
11
+ children: React.ReactElement;
12
+ }) => React.JSX.Element) | (() => {}))[];
13
+ export {};
@@ -0,0 +1 @@
1
+ export * from '../createDialogSystem2';
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function proxyRef(keys: string[], toRef: React.RefObject<Record<string, any>>): Record<string, any>;
@@ -0,0 +1,22 @@
1
+ type DialogsAPI = Record<string, (...args: any[]) => Promise<any>>;
2
+ export type UseDialogOptions = {
3
+ dialogs: DialogsAPI;
4
+ props?: (api: {
5
+ resolve: (result?: any) => void;
6
+ reject: (err: any) => void;
7
+ dialogs: DialogsAPI;
8
+ }, ...args: any[]) => Record<string, any>;
9
+ };
10
+ /**
11
+ * Utility hook that sets up promise resolution systems
12
+ */
13
+ export declare function useDialog<DialogProps, OnExecuteResultType = any>(baseDialogProps: Partial<DialogProps> | undefined, options: UseDialogOptions): {
14
+ dialogProps: Partial<DialogProps> & {
15
+ [key: string]: any;
16
+ open?: boolean | undefined;
17
+ };
18
+ resolve: (value: OnExecuteResultType) => Promise<void>;
19
+ reject: (error: any) => Promise<void>;
20
+ invoke: (...args: any[]) => Promise<OnExecuteResultType>;
21
+ };
22
+ export {};
@@ -0,0 +1,5 @@
1
+ export function dialogStory({ label, onClick, useDialogs }: {
2
+ label: any;
3
+ onClick: any;
4
+ useDialogs: any;
5
+ }): () => import("react").JSX.Element;
@@ -9,10 +9,12 @@ export declare const EvenSpacedList: import("styled-components").IStyledComponen
9
9
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
10
10
  }, keyof import("..").ResponsiveProps> & import("..").ResponsiveProps, import("styled-components/dist/types").FastOmit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
11
11
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
12
- }, keyof import("..").ResponsiveProps> & import("..").ResponsiveProps>, never>, keyof import("..").ResponsiveProps | "top" | "bottom" | "left" | "right" | "width" | "height" | "position" | "flexShrink" | "flexGrow" | "inset" | keyof import("../Box/spacing").SpacingStyles> & import("../Box/spacing").SpacingStyles & import("..").ResponsiveProps & {
12
+ }, keyof import("..").ResponsiveProps> & import("..").ResponsiveProps>, never>, "maxWidth" | keyof import("..").ResponsiveProps | "top" | "bottom" | "left" | "right" | "width" | "height" | "maxHeight" | "position" | "flexShrink" | "flexGrow" | "inset" | keyof import("../Box/spacing").SpacingStyles> & import("../Box/spacing").SpacingStyles & import("..").ResponsiveProps & {
13
13
  children?: import("react").ReactNode;
14
14
  width?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
15
+ maxWidth?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
15
16
  height?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
17
+ maxHeight?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
16
18
  position?: import("..").ResponsiveValueInput<import("..").CSSPosition> | undefined;
17
19
  top?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
18
20
  right?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
@@ -25,10 +27,12 @@ export declare const EvenSpacedList: import("styled-components").IStyledComponen
25
27
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
26
28
  }, keyof import("..").ResponsiveProps> & import("..").ResponsiveProps, import("styled-components/dist/types").FastOmit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
27
29
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
28
- }, keyof import("..").ResponsiveProps> & import("..").ResponsiveProps>, never>, keyof import("..").ResponsiveProps | "top" | "bottom" | "left" | "right" | "width" | "height" | "position" | "flexShrink" | "flexGrow" | "inset" | keyof import("../Box/spacing").SpacingStyles> & import("../Box/spacing").SpacingStyles & import("..").ResponsiveProps & {
30
+ }, keyof import("..").ResponsiveProps> & import("..").ResponsiveProps>, never>, "maxWidth" | keyof import("..").ResponsiveProps | "top" | "bottom" | "left" | "right" | "width" | "height" | "maxHeight" | "position" | "flexShrink" | "flexGrow" | "inset" | keyof import("../Box/spacing").SpacingStyles> & import("../Box/spacing").SpacingStyles & import("..").ResponsiveProps & {
29
31
  children?: import("react").ReactNode;
30
32
  width?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
33
+ maxWidth?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
31
34
  height?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
35
+ maxHeight?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
32
36
  position?: import("..").ResponsiveValueInput<import("..").CSSPosition> | undefined;
33
37
  top?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
34
38
  right?: import("..").ResponsiveValueInput<import("..").CSSLength> | undefined;
@@ -14,5 +14,6 @@ type DropzoneStateProps = {
14
14
  isDragAccept: boolean;
15
15
  isFileDialogActive: boolean;
16
16
  };
17
+ export declare function fileDropzoneLabel({ isDragReject, isDragActive, }: DropzoneStateProps): React.JSX.Element | "Solte seus arquivos aqui" | "Solte arquivos aqui ou clique para selecionar";
17
18
  export declare function FileDropzone({ dropzoneLabel, accept, style, ...props }: FileDropzoneProps): React.JSX.Element;
18
19
  export {};