@zenkigen-inc/component-ui 1.1.3 → 1.3.0

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.
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function ModalBody({ children }: PropsWithChildren): import("react").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  type ModalReturnType = {
3
- width: number;
4
3
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
5
4
  };
6
5
  export declare const ModalContext: import("react").Context<ModalReturnType>;
@@ -0,0 +1,6 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ type Props = {
3
+ isNoBorder?: boolean;
4
+ };
5
+ export declare function ModalFooter({ children, isNoBorder }: PropsWithChildren<Props>): React.JSX.Element;
6
+ export {};
@@ -1,8 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  type Props = {
3
- children: ReactNode;
4
3
  isNoBorder?: boolean;
5
4
  isNoCloseButton?: boolean;
6
5
  };
7
- export declare function ModalHeader({ children, isNoBorder, isNoCloseButton }: Props): import("react").JSX.Element;
6
+ export declare function ModalHeader({ children, isNoBorder, isNoCloseButton }: PropsWithChildren<Props>): import("react").JSX.Element;
8
7
  export {};
@@ -1,22 +1,18 @@
1
- import { CSSProperties, MutableRefObject, ReactElement, ReactNode } from 'react';
2
- import { ModalButtonTab } from './modal-button-tab';
1
+ import { CSSProperties, MutableRefObject, PropsWithChildren } from 'react';
2
+ import { ModalBody } from './modal-body';
3
+ import { ModalFooter } from './modal-footer';
3
4
  import { ModalHeader } from './modal-header';
4
- import { ModalTab } from './modal-tab';
5
5
  type Props = {
6
- children?: ReactNode;
7
- width: number;
6
+ width?: CSSProperties['width'];
8
7
  height?: CSSProperties['height'];
9
8
  isOpen: boolean;
10
9
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
11
10
  portalTargetRef?: MutableRefObject<HTMLElement | null>;
12
- headerElement?: ReactElement;
13
- tabElement?: ReactElement;
14
- buttonTabElement?: ReactElement;
15
11
  };
16
- export declare function Modal({ children, width, height, isOpen, setIsOpen, portalTargetRef, headerElement, tabElement, buttonTabElement, }: Props): import("react").ReactPortal;
12
+ export declare function Modal({ children, width, height, isOpen, setIsOpen, portalTargetRef }: PropsWithChildren<Props>): import("react").ReactPortal;
17
13
  export declare namespace Modal {
14
+ var Body: typeof ModalBody;
18
15
  var Header: typeof ModalHeader;
19
- var Tab: typeof ModalTab;
20
- var ButtonTab: typeof ModalButtonTab;
16
+ var Footer: typeof ModalFooter;
21
17
  }
22
18
  export {};
@@ -1,7 +1,6 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import { CSSProperties, PropsWithChildren } from 'react';
2
2
  type Props = {
3
- children: ReactNode;
4
3
  maxHeight?: CSSProperties['height'];
5
4
  };
6
- export declare function SelectList({ children, maxHeight }: Props): import("react").JSX.Element;
5
+ export declare function SelectList({ children, maxHeight }: PropsWithChildren<Props>): import("react").JSX.Element;
7
6
  export {};
@@ -1,9 +1,8 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
1
  import { IconName } from '@zenkigen-inc/component-icons';
2
+ import { CSSProperties, PropsWithChildren } from 'react';
3
3
  import { SelectItem } from './select-item';
4
4
  import type { SelectOption } from './type';
5
5
  type Props = {
6
- children: ReactNode;
7
6
  size?: 'x-small' | 'small' | 'medium' | 'large';
8
7
  variant?: 'outline' | 'text';
9
8
  width?: CSSProperties['width'];
@@ -14,7 +13,7 @@ type Props = {
14
13
  isDisabled?: boolean;
15
14
  onChange?: (option: SelectOption | null) => void;
16
15
  };
17
- export declare function Select({ children, size, variant, width, placeholder, placeholderIcon, selectedOption, isDisabled, onChange, optionListMaxHeight, }: Props): import("react").JSX.Element;
16
+ export declare function Select({ children, size, variant, width, placeholder, placeholderIcon, selectedOption, isDisabled, onChange, optionListMaxHeight, }: PropsWithChildren<Props>): import("react").JSX.Element;
18
17
  export declare namespace Select {
19
18
  var Option: typeof SelectItem;
20
19
  }
@@ -1,8 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  type Props = {
3
- children: ReactNode;
4
3
  isSortKey: boolean;
5
4
  onClickItem: () => void;
6
5
  };
7
- export declare function SelectItem({ children, isSortKey, onClickItem }: Props): import("react").JSX.Element;
6
+ export declare function SelectItem({ children, isSortKey, onClickItem }: PropsWithChildren<Props>): import("react").JSX.Element;
8
7
  export {};
@@ -1,3 +1,3 @@
1
1
  export { Table } from './table';
2
- export { TableRow } from './table-row';
3
2
  export { TableCell } from './table-cell';
3
+ export { TableRow } from './table-row';
@@ -0,0 +1 @@
1
+ export { TextInput } from './text-input';
@@ -0,0 +1,9 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
3
+ size?: 'medium' | 'large';
4
+ value: string;
5
+ isError?: boolean;
6
+ onClickClearButton?: () => void;
7
+ }
8
+ export declare const TextInput: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLInputElement>>;
9
+ export {};
@@ -1,7 +1,6 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import { CSSProperties, PropsWithChildren } from 'react';
2
2
  import { TooltipHorizontalAlign, TooltipSize, TooltipVerticalPosition } from './type';
3
3
  type Props = {
4
- children: ReactNode;
5
4
  content: string;
6
5
  size?: TooltipSize;
7
6
  maxWidth?: CSSProperties['width'];
@@ -9,5 +8,5 @@ type Props = {
9
8
  horizontalAlign?: TooltipHorizontalAlign;
10
9
  isDisabledHover?: boolean;
11
10
  };
12
- export declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, }: Props): import("react").JSX.Element;
11
+ export declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, }: PropsWithChildren<Props>): import("react").JSX.Element;
13
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenkigen-inc/component-ui",
3
- "version": "1.1.3",
3
+ "version": "1.3.0",
4
4
  "repository": "https://github.com/zenkigen/zenkigen-component",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -26,8 +26,8 @@
26
26
  "react": "^18.0.0"
27
27
  },
28
28
  "dependencies": {
29
- "@zenkigen-inc/component-icons": "1.1.3",
30
- "@zenkigen-inc/component-theme": "1.1.3",
29
+ "@zenkigen-inc/component-icons": "1.3.0",
30
+ "@zenkigen-inc/component-theme": "1.3.0",
31
31
  "clsx": "2.0.0"
32
32
  }
33
33
  }
@@ -1,25 +0,0 @@
1
- /// <reference types="react" />
2
- type Props = {
3
- primaryButtonLabel: string;
4
- secondaryButtonLabel: string;
5
- onClickPrimaryButton: () => void;
6
- onClickSecondaryButton: () => void;
7
- isDanger?: boolean;
8
- isNoBorder?: boolean;
9
- } & ({
10
- isWithCheckbox?: boolean;
11
- checkboxLabel?: string;
12
- isChecked?: boolean;
13
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
14
- subButtonLabel?: never;
15
- onClickSubButton?: never;
16
- } | {
17
- isWithCheckbox?: never;
18
- checkboxLabel?: never;
19
- isChecked?: never;
20
- onChange?: never;
21
- subButtonLabel?: string;
22
- onClickSubButton?: () => void;
23
- });
24
- export declare function ModalButtonTab({ primaryButtonLabel, secondaryButtonLabel, onClickPrimaryButton, onClickSecondaryButton, isDanger, isNoBorder, isWithCheckbox, checkboxLabel, isChecked, onChange, subButtonLabel, onClickSubButton, }: Props): import("react").JSX.Element;
25
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- type Props = {
3
- tabItems: {
4
- id: string;
5
- label: string;
6
- }[];
7
- selectedTab: string;
8
- setSelectedTab: React.Dispatch<React.SetStateAction<string>>;
9
- };
10
- export declare function ModalTab({ tabItems, selectedTab, setSelectedTab }: Props): import("react").JSX.Element;
11
- export {};