@zealicsolutions/web-ui 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/dist/cjs/index.js +20 -20
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/src/atoms/Buttons/Buttons.stories.d.ts +4 -4
  4. package/dist/cjs/src/atoms/Buttons/IconButton.d.ts +1 -1
  5. package/dist/cjs/src/containers/MoleculeItem.d.ts +1 -0
  6. package/dist/cjs/src/containers/mock-data.d.ts +1 -0
  7. package/dist/cjs/src/containers/types/moleculeTypes.d.ts +35 -2
  8. package/dist/cjs/src/containers/types/types.d.ts +7 -4
  9. package/dist/cjs/src/contexts/ButtonActionsContext/ButtonActionsContext.d.ts +11 -0
  10. package/dist/cjs/src/contexts/ButtonActionsContext/ButtonActionsContextProvider.d.ts +11 -0
  11. package/dist/cjs/src/contexts/hooks/useButtonActionsContext.d.ts +1 -0
  12. package/dist/cjs/src/contexts/index.d.ts +3 -0
  13. package/dist/cjs/src/molecules/Button/Button.d.ts +1 -2
  14. package/dist/cjs/src/molecules/Button/Button.stories.d.ts +2 -2
  15. package/dist/cjs/src/molecules/Drawer/Drawer.stories.d.ts +2 -2
  16. package/dist/cjs/src/molecules/Video/Video.stories.d.ts +1 -1
  17. package/dist/cjs/src/molecules/ZealUIModal/ZealUIModal.d.ts +20 -0
  18. package/dist/cjs/src/molecules/ZealUIModal/ZealUIModal.stories.d.ts +9 -0
  19. package/dist/cjs/src/molecules/index.d.ts +1 -0
  20. package/dist/cjs/src/organisms/Consent/Consent.stories.d.ts +2 -2
  21. package/dist/cjs/src/typescript.d.ts +3 -0
  22. package/dist/esm/index.js +1 -1
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/src/atoms/Buttons/Buttons.stories.d.ts +4 -4
  25. package/dist/esm/src/atoms/Buttons/IconButton.d.ts +1 -1
  26. package/dist/esm/src/containers/MoleculeItem.d.ts +1 -0
  27. package/dist/esm/src/containers/mock-data.d.ts +1 -0
  28. package/dist/esm/src/containers/types/moleculeTypes.d.ts +35 -2
  29. package/dist/esm/src/containers/types/types.d.ts +7 -4
  30. package/dist/esm/src/contexts/ButtonActionsContext/ButtonActionsContext.d.ts +11 -0
  31. package/dist/esm/src/contexts/ButtonActionsContext/ButtonActionsContextProvider.d.ts +11 -0
  32. package/dist/esm/src/contexts/hooks/useButtonActionsContext.d.ts +1 -0
  33. package/dist/esm/src/contexts/index.d.ts +3 -0
  34. package/dist/esm/src/molecules/Button/Button.d.ts +1 -2
  35. package/dist/esm/src/molecules/Button/Button.stories.d.ts +2 -2
  36. package/dist/esm/src/molecules/Drawer/Drawer.stories.d.ts +2 -2
  37. package/dist/esm/src/molecules/Video/Video.stories.d.ts +1 -1
  38. package/dist/esm/src/molecules/ZealUIModal/ZealUIModal.d.ts +20 -0
  39. package/dist/esm/src/molecules/ZealUIModal/ZealUIModal.stories.d.ts +9 -0
  40. package/dist/esm/src/molecules/index.d.ts +1 -0
  41. package/dist/esm/src/organisms/Consent/Consent.stories.d.ts +2 -2
  42. package/dist/esm/src/typescript.d.ts +3 -0
  43. package/dist/index.d.ts +82 -8
  44. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { ComponentStory } from '@storybook/react';
1
+ import type { StoryFn } from '@storybook/react';
2
2
  import { TextButtonProps } from 'atoms/Buttons/TextButton';
3
3
  import { FC } from 'react';
4
4
  import { IconButton as IconButtonComponent } from './IconButton';
@@ -11,6 +11,6 @@ declare const _default: {
11
11
  }, never>;
12
12
  };
13
13
  export default _default;
14
- export declare const TouchableOpacity: ComponentStory<FC<TouchableOpacityProps>>;
15
- export declare const TextButton: ComponentStory<FC<TextButtonProps>>;
16
- export declare const IconButton: ComponentStory<typeof IconButtonComponent>;
14
+ export declare const TouchableOpacity: StoryFn<FC<TouchableOpacityProps>>;
15
+ export declare const TextButton: StoryFn<FC<TextButtonProps>>;
16
+ export declare const IconButton: StoryFn<typeof IconButtonComponent>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ThemeColors } from 'theme';
3
3
  import { IconNames, TouchableOpacityProps } from 'atoms';
4
- import { Callback } from 'typescript';
4
+ import type { Callback } from 'typescript';
5
5
  export declare type IconButtonProps = {
6
6
  name: IconNames;
7
7
  size?: number;
@@ -3,6 +3,7 @@ import { Molecule } from 'containers';
3
3
  import { TabGroupProps } from 'molecules';
4
4
  export declare const getFullLink: (url: string) => string;
5
5
  export declare const navigateToPage: (url: string) => void;
6
+ export declare const downloadFile: (url?: string, name?: string) => Promise<void>;
6
7
  export declare const MoleculeItem: ({ type, config, attributes, tabsProps, form, id: moleculeId, }: Molecule & {
7
8
  tabsProps?: Pick<TabGroupProps<string, string>, "tabs" | "activeTabKey" | "onTabChange"> | undefined;
8
9
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
1
  import { ContainerComponentProps } from 'containers';
2
+ export declare const sliderContainerProps: ContainerComponentProps;
2
3
  export declare const formContainerProps: ContainerComponentProps;
3
4
  export declare const columnContainerProps: ContainerComponentProps;
@@ -2,12 +2,38 @@ import { SelectOption } from 'atoms';
2
2
  import { AdditionalTabContainerProps, ButtonProps, CheckboxFieldProps, ImageProps, InputFieldProps, RadioButtonFieldProps, SelectFieldProps, TabGroupProps, TextMoleculeProps } from 'molecules';
3
3
  import { UseFormReturn } from 'react-hook-form';
4
4
  import { CSSProperties } from 'styled-components';
5
- import type { Nullable, StrictUnion } from 'typescript';
5
+ import type { AnyObject, Nullable, StrictUnion } from 'typescript';
6
+ import { ContainerComponentProps } from './types';
7
+ export declare type ActionTypes = 'link' | 'popup' | 'drawer' | 'download' | 'submit' | 'reset' | 'destroy';
8
+ export declare type DownloadFile = {
9
+ url: string;
10
+ name: string;
11
+ };
12
+ declare type LinkAction = LinkAttributes;
13
+ declare type PopupDrawerAction = ContainerComponentProps;
14
+ declare type DownloadAction = DownloadFile;
15
+ declare type SubmitAction = AnyObject;
16
+ declare type CancelAction = AnyObject;
17
+ declare type ResetAction = AnyObject;
18
+ declare type DestroyAction = AnyObject;
19
+ declare type Action = {
20
+ type: ActionTypes;
21
+ } & Partial<{
22
+ link: LinkAction;
23
+ popup: PopupDrawerAction;
24
+ drawer: PopupDrawerAction;
25
+ download: DownloadAction;
26
+ submit: SubmitAction;
27
+ cancel: CancelAction;
28
+ reset: ResetAction;
29
+ destroy: DestroyAction;
30
+ }>;
6
31
  export declare type ImageAttributes = {
7
32
  attributeType: 'image';
8
33
  imageSource: string;
9
34
  };
10
35
  export interface TextAttributes {
36
+ id?: string;
11
37
  attributeType: 'text';
12
38
  isRichText: boolean;
13
39
  text: string;
@@ -16,6 +42,10 @@ export interface VideoAttributes {
16
42
  attributeType: 'video';
17
43
  videoSource: string;
18
44
  }
45
+ export interface ActionAttributes {
46
+ attributeType: 'action';
47
+ action: Action;
48
+ }
19
49
  export interface LinkAttributes {
20
50
  id: string;
21
51
  attributeType: 'link';
@@ -25,6 +55,7 @@ export interface LinkAttributes {
25
55
  name: string;
26
56
  }
27
57
  export interface SelectAttributes {
58
+ id?: string;
28
59
  attributeType: 'select';
29
60
  value: string;
30
61
  options: SelectOption[];
@@ -42,6 +73,7 @@ export interface BaseMolecule {
42
73
  id: string;
43
74
  instance: 'molecule';
44
75
  type: MoleculeTypes;
76
+ metadata?: AnyObject;
45
77
  }
46
78
  export interface ImageMolecule extends BaseMolecule {
47
79
  type: 'image';
@@ -68,7 +100,7 @@ export interface ButtonMolecule extends BaseMolecule {
68
100
  type: 'button';
69
101
  attributes: {
70
102
  title: TextAttributes;
71
- buttonLink: LinkAttributes;
103
+ action: ActionAttributes;
72
104
  };
73
105
  config: {
74
106
  props: Partial<Omit<ButtonProps, 'disabled' | 'children' | 'link' | 'text' | 'onClick' | 'elementId'>>;
@@ -153,3 +185,4 @@ export interface CheckboxFieldMolecule extends BaseMolecule {
153
185
  export declare type Molecule = StrictUnion<ImageMolecule | TextMoleculeType | ButtonMolecule | VideoMolecule | TabGroupMolecule | TextInputMolecule | SelectFieldMolecule | RadioButtonFieldMolecule | CheckboxFieldMolecule> & {
154
186
  form?: UseFormReturn<any>;
155
187
  };
188
+ export {};
@@ -1,11 +1,11 @@
1
1
  import { TabGroupProps } from 'molecules';
2
2
  import { PropsWithChildren } from 'react';
3
3
  import { CSSProperties } from 'styled-components';
4
- import { Molecule } from './moleculeTypes';
5
4
  import { ValidationMode } from 'react-hook-form';
6
- import { StylesType } from 'typescript';
5
+ import type { AnyObject, StylesType } from 'typescript';
6
+ import { Molecule } from './moleculeTypes';
7
7
  export declare type ContainerType = 'row' | 'column' | 'slider' | 'form';
8
- export declare type ContainerPositionType = 'fixed' | 'sticky' | 'static';
8
+ export declare type ContainerPositionType = 'fixed' | 'sticky' | 'static' | 'relative';
9
9
  export declare type ContainerScrollBehaviourType = 'vertical' | 'horizontal' | 'auto' | 'none';
10
10
  export declare type ContainerPropsType = Partial<{
11
11
  position: ContainerPositionType;
@@ -30,11 +30,14 @@ export declare type ContainerComponentProps = {
30
30
  id: string;
31
31
  instance: 'container';
32
32
  type: ContainerType;
33
+ items: (ContainerComponentProps | Molecule)[];
33
34
  config: {
34
35
  wide?: AdditionalContainerProps;
35
36
  compact?: AdditionalContainerProps;
36
37
  props?: ContainerPropsType;
37
38
  };
38
- items: (ContainerComponentProps | Molecule)[];
39
39
  tabsProps?: Pick<TabGroupProps, 'tabs' | 'activeTabKey' | 'onTabChange'>;
40
+ metadata?: AnyObject;
41
+ attributes?: AnyObject;
42
+ containerLibraryId?: string;
40
43
  };
@@ -0,0 +1,11 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { ContainerComponentProps } from 'containers';
3
+ export declare type ButtonActionsContextType = {
4
+ actionContent?: ContainerComponentProps;
5
+ setActionContent: Dispatch<SetStateAction<ContainerComponentProps>>;
6
+ isModalVisible: boolean;
7
+ setModalVisible: Dispatch<SetStateAction<boolean>>;
8
+ isDrawerVisible: boolean;
9
+ setDrawerVisible: Dispatch<SetStateAction<boolean>>;
10
+ };
11
+ export declare const ButtonActionsContext: import("react").Context<ButtonActionsContextType>;
@@ -0,0 +1,11 @@
1
+ import { Dispatch, PropsWithChildren, SetStateAction } from 'react';
2
+ import { ContainerComponentProps } from 'containers';
3
+ export declare type ButtonActionsProviderProps = PropsWithChildren<Partial<{
4
+ actionContent: ContainerComponentProps;
5
+ setActionContent: Dispatch<SetStateAction<ContainerComponentProps>>;
6
+ isModalVisible: boolean;
7
+ setModalVisible: Dispatch<SetStateAction<boolean>>;
8
+ setDrawerVisible: Dispatch<SetStateAction<boolean>>;
9
+ isDrawerVisible: boolean;
10
+ }>>;
11
+ export declare const ButtonActionsProvider: ({ children }: ButtonActionsProviderProps) => JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const useButtonActionsContext: () => import("contexts/ButtonActionsContext/ButtonActionsContext").ButtonActionsContextType;
@@ -2,3 +2,6 @@ export * from './MlrRichTextViewerContext/MlrRichTextViewerProvider';
2
2
  export * from './MlrRichTextViewerContext/MlrRichTextViewerContext';
3
3
  export * from './MlrRichTextViewerContext/types';
4
4
  export * from './hooks/useMlrRichTextViewerContext';
5
+ export * from './hooks/useButtonActionsContext';
6
+ export * from './ButtonActionsContext/ButtonActionsContext';
7
+ export * from './ButtonActionsContext/ButtonActionsContextProvider';
@@ -1,7 +1,6 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { FontSizesTypes, SizesTypes, ThemeColors } from 'theme';
3
- import type { Callback } from 'typescript';
4
- import { StylesType } from 'typescript';
3
+ import type { Callback, StylesType } from 'typescript';
5
4
  export declare type ButtonVariant = 'primary' | 'secondary' | 'text' | 'custom';
6
5
  export declare type ButtonType = 'button' | 'submit' | 'reset';
7
6
  export declare type BaseButtonProps = PropsWithChildren<{
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import type { StoryFn } from '@storybook/react';
3
- import { Button as ButtonComponent } from 'molecules/Button/Button';
3
+ import { Button as ButtonComponent } from 'molecules';
4
4
  declare const _default: {
5
5
  title: string;
6
- component: ({ text: textProp, onClick, loading, disabled, variant, isRichText, fullWidth, elementId, link, containerStyle, children, buttonStyle, size, textColor, inactiveTextColor, state, href, ...props }: import("molecules/Button/Button").ButtonProps) => JSX.Element | null;
6
+ component: ({ text: textProp, onClick, loading, disabled, variant, isRichText, fullWidth, elementId, link, containerStyle, children, buttonStyle, size, textColor, inactiveTextColor, state, href, ...props }: import("molecules").ButtonProps) => JSX.Element | null;
7
7
  };
8
8
  export default _default;
9
9
  export declare const Button: StoryFn<typeof ButtonComponent>;
@@ -1,4 +1,4 @@
1
- import type { ComponentStory } from '@storybook/react';
1
+ import type { StoryFn } from '@storybook/react';
2
2
  import React from 'react';
3
3
  import { Drawer as DrawerComponent } from './Drawer';
4
4
  declare const _default: {
@@ -6,4 +6,4 @@ declare const _default: {
6
6
  component: ({ children, closeIconColor, ...props }: React.PropsWithChildren<import("./styles").DrawerProps>) => JSX.Element;
7
7
  };
8
8
  export default _default;
9
- export declare const Drawer: ComponentStory<typeof DrawerComponent>;
9
+ export declare const Drawer: StoryFn<typeof DrawerComponent>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { StoryFn } from '@storybook/react';
2
+ import type { StoryFn } from '@storybook/react';
3
3
  import { Video as VideoComponent } from './Video';
4
4
  declare const _default: {
5
5
  title: string;
@@ -0,0 +1,20 @@
1
+ import { ModalProps as MUIModalProps } from '@mui/material';
2
+ import React, { KeyboardEvent, PropsWithChildren } from 'react';
3
+ import { CSSProperties } from 'styled-components';
4
+ import type { Callback, OverrideStyles } from 'typescript';
5
+ export declare type ZealUIModalProps = PropsWithChildren<Pick<MUIModalProps, 'open'>> & {
6
+ padding?: number | string;
7
+ wrapperStyles?: CSSProperties;
8
+ onKeyDown?: <T extends HTMLElement>(event: KeyboardEvent<T>) => void;
9
+ modalStyles?: CSSProperties;
10
+ onClose?: Callback;
11
+ };
12
+ export declare const ZealUIModal: ({ children, wrapperStyles, padding, onKeyDown, modalStyles, ...rest }: ZealUIModalProps) => JSX.Element;
13
+ export declare const ModalWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, OverrideStyles, never>;
14
+ export declare const IconWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
15
+ activeOpacity?: number | undefined;
16
+ withoutOpacityEffect?: boolean | undefined;
17
+ disabled?: boolean | undefined;
18
+ } & {
19
+ children?: React.ReactNode;
20
+ }, never>;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { StoryFn } from '@storybook/react';
3
+ import { ZealUIModal as ZealUIModalComponent } from './ZealUIModal';
4
+ declare const _default: {
5
+ title: string;
6
+ component: ({ children, wrapperStyles, padding, onKeyDown, modalStyles, ...rest }: import("./ZealUIModal").ZealUIModalProps) => JSX.Element;
7
+ };
8
+ export default _default;
9
+ export declare const ZealUIModal: StoryFn<typeof ZealUIModalComponent>;
@@ -27,3 +27,4 @@ export * from './Image/Image';
27
27
  export * from './Caruser/Carousel';
28
28
  export * from './TextMolecule/TextMolecule';
29
29
  export * from './Button/Button';
30
+ export * from './ZealUIModal/ZealUIModal';
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { ComponentStory } from '@storybook/react';
2
+ import type { StoryFn } from '@storybook/react';
3
3
  import { Consent as ConsentComponent } from './Consent';
4
4
  declare const _default: {
5
5
  title: string;
6
6
  component: <T extends string>({ text, consentCaptureProps, containerStyles, clearStyles, }: import("./Consent").ConsentProps<T>) => JSX.Element;
7
7
  };
8
8
  export default _default;
9
- export declare const Consent: ComponentStory<typeof ConsentComponent>;
9
+ export declare const Consent: StoryFn<typeof ConsentComponent>;
@@ -1,4 +1,5 @@
1
1
  import { DefaultTheme, ThemedCssFunction } from 'styled-components';
2
+ export declare type FileType = 'image' | 'video' | 'document' | 'audio';
2
3
  export declare type StylesType = ReturnType<ThemedCssFunction<DefaultTheme>>;
3
4
  export declare type StyledTransientProps<T> = {
4
5
  [K in keyof T & string as `$${K}`]: T[K];
@@ -11,4 +12,6 @@ export declare type Nullable<T> = T | null;
11
12
  declare type UnionKeys<T> = T extends any ? keyof T : never;
12
13
  declare type StrictUnionHelper<T, TAll> = T extends any ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>> : never;
13
14
  export declare type StrictUnion<T> = StrictUnionHelper<T, T>;
15
+ export declare type AnyObject = Record<string, unknown>;
16
+ export declare type LooseObject = Record<string, any>;
14
17
  export {};