@wizleap-inc/wiz-ui-react 0.72.0 → 1.0.1

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 (24) hide show
  1. package/dist/components/base/inputs/index.d.ts +1 -0
  2. package/dist/components/base/inputs/number-input/components/index.d.ts +1 -0
  3. package/dist/components/base/inputs/number-input/components/number-input.d.ts +18 -0
  4. package/dist/components/base/inputs/number-input/index.d.ts +1 -0
  5. package/dist/components/base/inputs/number-input/stories/number-input.stories.d.ts +9 -0
  6. package/dist/components/base/inputs/search-input/components/search-input.d.ts +9 -7
  7. package/dist/components/base/inputs/search-input/components/search-popup-panel.d.ts +6 -7
  8. package/dist/components/base/inputs/search-input/components/types.d.ts +4 -3
  9. package/dist/components/base/inputs/search-input/stories/search-input.stories.d.ts +1 -1
  10. package/dist/components/base/inputs/search-selector/components/popup-button-group/components/button-item.d.ts +3 -4
  11. package/dist/components/base/inputs/search-selector/components/popup-button-group/components/group-item.d.ts +3 -4
  12. package/dist/components/base/inputs/search-selector/components/popup-button-group/components/popup-button-group.d.ts +3 -4
  13. package/dist/components/base/inputs/search-selector/components/popup-button-group/types.d.ts +9 -9
  14. package/dist/components/base/inputs/search-selector/components/search-selector-helper.d.ts +1 -1
  15. package/dist/components/base/inputs/search-selector/components/search-selector.d.ts +8 -6
  16. package/dist/components/base/inputs/search-selector/components/types.d.ts +2 -2
  17. package/dist/components/base/inputs/search-selector/stories/search-selector.stories.d.ts +1 -1
  18. package/dist/components/base/inputs/selectbox/components/selectbox.d.ts +10 -8
  19. package/dist/components/base/inputs/selectbox/stories/selectbox.stories.d.ts +1 -1
  20. package/dist/components/custom/chat/components/chat-card.d.ts +9 -6
  21. package/dist/style.css +1 -1
  22. package/dist/wiz-ui.es.js +2375 -2291
  23. package/dist/wiz-ui.umd.js +24 -24
  24. package/package.json +3 -3
@@ -13,3 +13,4 @@ export * from './time-picker';
13
13
  export * from './upload';
14
14
  export * from './date-picker';
15
15
  export * from './date-range-picker';
16
+ export * from './number-input';
@@ -0,0 +1 @@
1
+ export { WizNumberInput } from './number-input';
@@ -0,0 +1,18 @@
1
+ import { BaseProps } from '../../../../../types';
2
+ type Props = BaseProps & {
3
+ value?: number;
4
+ onChange?: (e: number | undefined) => void;
5
+ placeholder?: string;
6
+ disabled?: boolean;
7
+ width?: string;
8
+ error?: boolean;
9
+ min?: number;
10
+ max?: number;
11
+ step?: number;
12
+ precision?: number;
13
+ };
14
+ export declare const WizNumberInput: {
15
+ (props: Props): import("react/jsx-runtime").JSX.Element;
16
+ displayName: "WizNumberInput";
17
+ };
18
+ export {};
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { WizNumberInput } from '..';
3
+ declare const meta: Meta<typeof WizNumberInput>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof WizNumberInput>;
6
+ export declare const Default: Story;
7
+ export declare const Placeholder: Story;
8
+ export declare const WithValue: Story;
9
+ export declare const Disabled: Story;
@@ -1,10 +1,9 @@
1
- import { FC } from 'react';
2
1
  import { TIcon } from '../../../..';
3
2
  import { BaseProps } from '../../../../../types';
4
- import { SearchInputOption } from './types';
5
- type Props = BaseProps & {
6
- options: SearchInputOption[];
7
- values: number[];
3
+ import { CheckboxOption, SearchInputOption } from './types';
4
+ type Props<T extends CheckboxOption> = BaseProps & {
5
+ options: SearchInputOption<T>[];
6
+ values: T[];
8
7
  name?: string;
9
8
  placeholder?: string;
10
9
  disabled?: boolean;
@@ -17,7 +16,10 @@ type Props = BaseProps & {
17
16
  icon?: TIcon;
18
17
  showSelectedItem?: boolean;
19
18
  showParentLabel?: boolean;
20
- onChangeValues: (values: number[]) => void;
19
+ onChangeValues: (values: T[]) => void;
20
+ };
21
+ export declare const WizSearchInput: {
22
+ <T extends CheckboxOption>({ className, style, options, values, name, placeholder, disabled, expand, singleSelect, inputWidth, popupWidth, isDirectionFixed, emptyMessage, showSelectedItem, onChangeValues, showParentLabel, icon, }: Props<T>): import("react/jsx-runtime").JSX.Element;
23
+ displayName: "WizSearchInput";
21
24
  };
22
- export declare const WizSearchInput: FC<Props>;
23
25
  export {};
@@ -1,14 +1,13 @@
1
- import { FC } from 'react';
2
1
  import { BaseProps } from '../../../../../types';
3
- import { SearchInputOption } from './types';
4
- type Props = BaseProps & {
5
- options: SearchInputOption[];
6
- values: number[];
2
+ import { CheckboxOption, SearchInputOption } from './types';
3
+ type Props<T extends CheckboxOption> = BaseProps & {
4
+ options: SearchInputOption<T>[];
5
+ values: T[];
7
6
  width?: string;
8
7
  emptyMessage: string;
9
8
  singleSelect?: boolean;
10
- onChangeValues: (values: number[]) => void;
9
+ onChangeValues: (values: T[]) => void;
11
10
  closePopup: () => void;
12
11
  };
13
- export declare const SearchPopupPanel: FC<Props>;
12
+ export declare const SearchPopupPanel: <T extends CheckboxOption>({ className, style, options, values, width, emptyMessage, singleSelect, onChangeValues, closePopup, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
14
13
  export {};
@@ -1,9 +1,10 @@
1
1
  export type Tag = {
2
2
  label: string;
3
3
  };
4
- export type SearchInputOption = {
4
+ export type CheckboxOption = string | number | string[];
5
+ export type SearchInputOption<T = number> = {
5
6
  label: string;
6
- value: number;
7
- children?: SearchInputOption[];
7
+ value: T;
8
+ children?: SearchInputOption<T>[];
8
9
  tag?: Tag;
9
10
  };
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
2
2
  import { WizSearchInput } from '..';
3
3
  declare const meta: Meta<typeof WizSearchInput>;
4
4
  export default meta;
5
- type Story = StoryObj<typeof WizSearchInput>;
5
+ type Story = StoryObj<typeof WizSearchInput<number>>;
6
6
  export declare const Default: Story;
7
7
  export declare const LongLabel: Story;
8
8
  export declare const Tag: Story;
@@ -1,10 +1,9 @@
1
- import { FC } from 'react';
2
1
  import { BaseProps } from '../../../../../../../types';
3
2
  import { ButtonItem as ButtonItemType } from '../types';
4
- type Props = BaseProps & {
5
- item: ButtonItemType;
3
+ type Props<T> = BaseProps & {
4
+ item: ButtonItemType<T>;
6
5
  disabled: boolean;
7
6
  depth: number;
8
7
  };
9
- export declare const ButtonItem: FC<Props>;
8
+ export declare const ButtonItem: <T>({ className, style, item, disabled, depth, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,10 +1,9 @@
1
- import { FC } from 'react';
2
1
  import { BaseProps } from '../../../../../../../types';
3
2
  import { GroupItem as GroupItemType } from '../types';
4
- type Props = BaseProps & {
5
- item: GroupItemType;
3
+ type Props<T> = BaseProps & {
4
+ item: GroupItemType<T>;
6
5
  disabled: boolean;
7
6
  depth: number;
8
7
  };
9
- export declare const GroupItem: FC<Props>;
8
+ export declare const GroupItem: <T>({ className, style, item, disabled, depth, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,9 +1,8 @@
1
1
  import { SpacingKeys } from '@wizleap-inc/wiz-ui-constants';
2
- import { FC } from 'react';
3
2
  import { BaseProps } from '../../../../../../../types';
4
3
  import { ButtonGroupItem } from '../types';
5
- type Props = BaseProps & {
6
- options: ButtonGroupItem[];
4
+ type Props<T> = BaseProps & {
5
+ options: ButtonGroupItem<T>[];
7
6
  width?: string;
8
7
  p?: SpacingKeys;
9
8
  borderRadius?: SpacingKeys;
@@ -13,5 +12,5 @@ type Props = BaseProps & {
13
12
  buttonDivider?: boolean;
14
13
  depth?: number;
15
14
  };
16
- export declare const PopupButtonGroup: FC<Props>;
15
+ export declare const PopupButtonGroup: <T>({ className, style, options, width, p, borderRadius, disabled, expand, groupDivider, buttonDivider, depth, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
17
16
  export {};
@@ -1,30 +1,30 @@
1
1
  import { TIcon } from '../../../../..';
2
- export interface PopupButtonOption {
2
+ export interface PopupButtonOption<T> {
3
3
  label: string;
4
- value: number;
4
+ value?: T;
5
5
  exLabel?: string;
6
6
  icon?: TIcon;
7
7
  iconDefaultColor?: "green.800" | "gray.500";
8
8
  disabled?: boolean;
9
9
  onClick: () => void;
10
10
  }
11
- export interface ButtonItem {
11
+ export interface ButtonItem<T> {
12
12
  kind: "button";
13
- option: PopupButtonOption;
13
+ option: PopupButtonOption<T>;
14
14
  }
15
15
  interface DividerItem {
16
16
  kind: "divider";
17
17
  }
18
- export interface GroupItem {
18
+ export interface GroupItem<T> {
19
19
  kind: "group";
20
20
  title: string;
21
- items: ButtonGroupItem[];
21
+ items: ButtonGroupItem<T>[];
22
22
  groupDivider?: boolean;
23
23
  buttonDivider?: boolean;
24
24
  }
25
- export type ButtonGroupItem = ButtonItem | DividerItem | GroupItem;
26
- export type ItemElement = DividerItem | {
25
+ export type ButtonGroupItem<T> = ButtonItem<T> | DividerItem | GroupItem<T>;
26
+ export type ItemElement<T> = DividerItem | {
27
27
  kind: "item";
28
- item: Exclude<ButtonGroupItem, DividerItem>;
28
+ item: Exclude<ButtonGroupItem<T>, DividerItem>;
29
29
  };
30
30
  export {};
@@ -1,2 +1,2 @@
1
1
  import { SearchSelectorOption } from './types';
2
- export declare function filterOptions(options: SearchSelectorOption[], searchText: string, threshold: number): SearchSelectorOption[];
2
+ export declare function filterOptions<T>(options: SearchSelectorOption<T>[], searchText: string, threshold: number): SearchSelectorOption<T>[];
@@ -1,9 +1,8 @@
1
- import { FC } from 'react';
2
1
  import { BaseProps } from '../../../../../types';
3
2
  import { SearchSelectorOption } from './types';
4
- type Props = BaseProps & {
5
- options: SearchSelectorOption[];
6
- values: number[];
3
+ type Props<T> = BaseProps & {
4
+ options: SearchSelectorOption<T>[];
5
+ values: T[];
7
6
  placeholder?: string;
8
7
  width?: string;
9
8
  disabled?: boolean;
@@ -21,9 +20,12 @@ type Props = BaseProps & {
21
20
  * @default 0.75
22
21
  */
23
22
  threshold?: number;
24
- onChangeValues: (values: number[]) => void;
23
+ onChangeValues: (values: T[]) => void;
25
24
  onCreate?: (label: string) => void;
26
25
  onInputSearchText?: (text: string) => void;
27
26
  };
28
- export declare const WizSearchSelector: FC<Props>;
27
+ export declare const WizSearchSelector: {
28
+ <T>({ className, style, options, values, placeholder, width, disabled, expand, multiSelectable, addable, error, isDirectionFixed, showExLabel, dropdownMaxHeight, threshold, onChangeValues, onCreate, onInputSearchText, }: Props<T>): import("react/jsx-runtime").JSX.Element;
29
+ displayName: "WizSearchSelector";
30
+ };
29
31
  export {};
@@ -1,6 +1,6 @@
1
- export type SearchSelectorOption = {
1
+ export type SearchSelectorOption<T = number> = {
2
2
  label: string;
3
- value: number;
3
+ value: T;
4
4
  exLabel?: string;
5
5
  disabled?: boolean;
6
6
  };
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
2
2
  import { WizSearchSelector } from '..';
3
3
  declare const meta: Meta<typeof WizSearchSelector>;
4
4
  export default meta;
5
- type Story = StoryObj<typeof WizSearchSelector>;
5
+ type Story = StoryObj<typeof WizSearchSelector<number>>;
6
6
  export declare const Default: Story;
7
7
  export declare const LongWordSelector: Story;
8
8
  export declare const Disabled: Story;
@@ -1,14 +1,13 @@
1
- import { FC } from 'react';
2
1
  import { BaseProps } from '../../../../../types';
3
- type SelectBoxOption = {
2
+ type SelectBoxOption<T = number> = {
4
3
  label: string;
5
4
  exLabel?: string;
6
- value: number;
5
+ value: T;
7
6
  disabled?: boolean;
8
7
  };
9
- type Props = BaseProps & {
10
- options: SelectBoxOption[];
11
- value: number | null;
8
+ type Props<T> = BaseProps & {
9
+ options: SelectBoxOption<T>[];
10
+ value: T | null;
12
11
  placeholder?: string;
13
12
  width?: string;
14
13
  disabled?: boolean;
@@ -17,7 +16,10 @@ type Props = BaseProps & {
17
16
  isDirectionFixed?: boolean;
18
17
  showExLabel?: boolean;
19
18
  dropdownMaxHeight?: string;
20
- onChange: (value: number | null) => void;
19
+ onChange: (value: T | null) => void;
20
+ };
21
+ export declare const WizSelectBox: {
22
+ <T>({ className, style, options, value, placeholder, width, disabled, expand, error, isDirectionFixed, showExLabel, dropdownMaxHeight, onChange, }: Props<T>): import("react/jsx-runtime").JSX.Element;
23
+ displayName: "WizSelectBox";
21
24
  };
22
- export declare const WizSelectBox: FC<Props>;
23
25
  export {};
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
2
2
  import { WizSelectBox } from '..';
3
3
  declare const meta: Meta<typeof WizSelectBox>;
4
4
  export default meta;
5
- type Story = StoryObj<typeof WizSelectBox>;
5
+ type Story = StoryObj<typeof WizSelectBox<number>>;
6
6
  export declare const Default: Story;
7
7
  export declare const Disabled: Story;
8
8
  export declare const DisabledItems: Story;
@@ -1,8 +1,8 @@
1
- import { ComponentProps, FC } from 'react';
1
+ import { ComponentProps } from 'react';
2
2
  import { WizSelectBox } from '../../..';
3
3
  import { BaseProps } from '../../../../types';
4
4
  import { Message } from './types';
5
- type Props = BaseProps & {
5
+ type Props<T> = BaseProps & {
6
6
  textValue: string;
7
7
  username: string;
8
8
  isOpen: boolean;
@@ -11,13 +11,16 @@ type Props = BaseProps & {
11
11
  haveNewMessage?: boolean;
12
12
  formRows?: number;
13
13
  typingUsername?: string;
14
- status?: number | null;
15
- statusOptions?: ComponentProps<typeof WizSelectBox>["options"];
14
+ status?: T | null;
15
+ statusOptions?: ComponentProps<typeof WizSelectBox<T>>["options"];
16
16
  statusPlaceholder?: string;
17
- onChangeStatus?: (status: number | null) => void;
17
+ onChangeStatus?: (status: T | null) => void;
18
18
  onChangeTextValue: (value: string) => void;
19
19
  onSubmit: () => void;
20
20
  onToggle: () => void;
21
21
  };
22
- export declare const WizChatCard: FC<Props>;
22
+ export declare const WizChatCard: {
23
+ <T>({ className, style, isOpen, textValue, username, placeholder, messages, haveNewMessage, formRows, typingUsername, status, statusOptions, statusPlaceholder, onChangeStatus, onChangeTextValue, onSubmit, onToggle, }: Props<T>): import("react/jsx-runtime").JSX.Element;
24
+ displayName: "WizChatCard";
25
+ };
23
26
  export {};