@zenkigen-inc/component-ui 1.0.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.
- package/README.md +40 -0
- package/dist/avatar/avatar.d.ts +11 -0
- package/dist/avatar/index.d.ts +1 -0
- package/dist/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/dist/breadcrumb/breadcrumb.d.ts +6 -0
- package/dist/breadcrumb/index.d.ts +1 -0
- package/dist/button/button.d.ts +21 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/checkbox/checkbox.d.ts +14 -0
- package/dist/checkbox/checked-icon.d.ts +2 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/minus-icon.d.ts +2 -0
- package/dist/dropdown/dropdown-context.d.ts +13 -0
- package/dist/dropdown/dropdown-item.d.ts +8 -0
- package/dist/dropdown/dropdown-menu.d.ts +11 -0
- package/dist/dropdown/dropdown.d.ts +26 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/type.d.ts +9 -0
- package/dist/evaluation-star/evaluation-star.d.ts +9 -0
- package/dist/evaluation-star/index.d.ts +1 -0
- package/dist/heading/heading.d.ts +10 -0
- package/dist/heading/index.d.ts +1 -0
- package/dist/hooks/use-outside-click.d.ts +2 -0
- package/dist/icon/icon.d.ts +13 -0
- package/dist/icon/index.d.ts +1 -0
- package/dist/icon-button/icon-button.d.ts +20 -0
- package/dist/icon-button/index.d.ts +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.esm.js +32471 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +32420 -0
- package/dist/index.js.map +1 -0
- package/dist/loading/index.d.ts +1 -0
- package/dist/loading/loading.d.ts +8 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/modal-button-tab.d.ts +25 -0
- package/dist/modal/modal-context.d.ts +7 -0
- package/dist/modal/modal-header.d.ts +8 -0
- package/dist/modal/modal-tab.d.ts +11 -0
- package/dist/modal/modal.d.ts +22 -0
- package/dist/notification-inline/index.d.ts +1 -0
- package/dist/notification-inline/notification-inline.d.ts +13 -0
- package/dist/radio/index.d.ts +1 -0
- package/dist/radio/radio.d.ts +12 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/search/search.d.ts +11 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/select-context.d.ts +12 -0
- package/dist/select/select-item.d.ts +7 -0
- package/dist/select/select-list.d.ts +7 -0
- package/dist/select/select.d.ts +21 -0
- package/dist/select/type.d.ts +7 -0
- package/dist/select-sort/index.d.ts +2 -0
- package/dist/select-sort/select-item.d.ts +8 -0
- package/dist/select-sort/select-list.d.ts +11 -0
- package/dist/select-sort/select-sort.d.ts +15 -0
- package/dist/select-sort/type.d.ts +1 -0
- package/dist/tab/index.d.ts +2 -0
- package/dist/tab/tab-item.d.ts +10 -0
- package/dist/tab/tab.d.ts +6 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/table-cell.d.ts +7 -0
- package/dist/table/table-container.d.ts +8 -0
- package/dist/table/table-row-container.d.ts +7 -0
- package/dist/tag/delete-icon.d.ts +9 -0
- package/dist/tag/index.d.ts +2 -0
- package/dist/tag/tag.d.ts +17 -0
- package/dist/tag/type.d.ts +3 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/toast-provider.d.ts +13 -0
- package/dist/toast/toast.d.ts +12 -0
- package/dist/toast/type.d.ts +1 -0
- package/dist/toggle/index.d.ts +1 -0
- package/dist/toggle/toggle.d.ts +12 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/tail-icon.d.ts +9 -0
- package/dist/tooltip/tooltip.d.ts +13 -0
- package/dist/tooltip/type.d.ts +3 -0
- package/package.json +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loading } from './loading';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type Props = {
|
|
3
|
+
size?: 'small' | 'medium' | 'large';
|
|
4
|
+
position?: 'fixed' | 'absolute' | 'static';
|
|
5
|
+
height?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function Loading({ size, position, height }: Props): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Modal } from './modal';
|
|
@@ -0,0 +1,25 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CSSProperties, MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ModalButtonTab } from './modal-button-tab';
|
|
3
|
+
import { ModalHeader } from './modal-header';
|
|
4
|
+
import { ModalTab } from './modal-tab';
|
|
5
|
+
type Props = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
size?: 'small' | 'medium' | 'large' | 'x-large';
|
|
8
|
+
height?: CSSProperties['height'];
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
|
+
portalTargetRef?: MutableRefObject<HTMLElement | null>;
|
|
12
|
+
headerElement?: ReactElement;
|
|
13
|
+
tabElement?: ReactElement;
|
|
14
|
+
buttonTabElement?: ReactElement;
|
|
15
|
+
};
|
|
16
|
+
export declare function Modal({ children, size, height, isOpen, setIsOpen, portalTargetRef, headerElement, tabElement, buttonTabElement, }: Props): import("react").ReactPortal;
|
|
17
|
+
export declare namespace Modal {
|
|
18
|
+
var Header: typeof ModalHeader;
|
|
19
|
+
var Tab: typeof ModalTab;
|
|
20
|
+
var ButtonTab: typeof ModalButtonTab;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NotificationInline } from './notification-inline';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
state?: 'success' | 'warning' | 'information' | 'attention' | 'default';
|
|
4
|
+
size?: 'small' | 'medium';
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
} & ({
|
|
7
|
+
showClose?: false;
|
|
8
|
+
} | {
|
|
9
|
+
showClose: true;
|
|
10
|
+
onClickClose: () => void;
|
|
11
|
+
});
|
|
12
|
+
export declare function NotificationInline({ state, size, ...props }: Props): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Radio } from './radio';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
name?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
isChecked?: boolean;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function Radio({ name, value, id, label, isChecked, isDisabled, onChange }: Props): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Search } from './search';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChangeEvent, FormEvent } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
width?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
|
|
8
|
+
onClickSearchModal?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const Search: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectOption } from './type';
|
|
3
|
+
type UseSelectReturnType = {
|
|
4
|
+
size?: 'x-small' | 'small' | 'medium' | 'large';
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
selectedOption?: SelectOption | null;
|
|
7
|
+
setIsOptionListOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
|
+
onChange?: (option: SelectOption | null) => void;
|
|
9
|
+
variant?: 'text' | 'outline';
|
|
10
|
+
};
|
|
11
|
+
export declare const SelectContext: import("react").Context<UseSelectReturnType>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { IconName } from '@zenkigen-inc/component-icons';
|
|
3
|
+
import { SelectItem } from './select-item';
|
|
4
|
+
import type { SelectOption } from './type';
|
|
5
|
+
type Props = {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
size?: 'x-small' | 'small' | 'medium' | 'large';
|
|
8
|
+
variant?: 'outline' | 'text';
|
|
9
|
+
width?: CSSProperties['width'];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
placeholderIcon?: IconName;
|
|
12
|
+
selectedOption?: SelectOption | null;
|
|
13
|
+
optionListMaxHeight?: CSSProperties['height'];
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
onChange?: (option: SelectOption | null) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare function Select({ children, size, variant, width, placeholder, placeholderIcon, selectedOption, isDisabled, onChange, optionListMaxHeight, }: Props): import("react").JSX.Element;
|
|
18
|
+
export declare namespace Select {
|
|
19
|
+
var Option: typeof SelectItem;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { SortOrder } from './type';
|
|
3
|
+
type Props = {
|
|
4
|
+
size: 'x-small' | 'small' | 'medium' | 'large';
|
|
5
|
+
variant: 'text' | 'outline';
|
|
6
|
+
sortOrder: SortOrder;
|
|
7
|
+
onClickItem: (value: SortOrder) => void;
|
|
8
|
+
onClickDeselect?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function SelectList({ size, variant, sortOrder, onClickItem, onClickDeselect }: Props): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import type { SortOrder } from './type';
|
|
3
|
+
type Props = {
|
|
4
|
+
size?: 'x-small' | 'small' | 'medium' | 'large';
|
|
5
|
+
variant?: 'outline' | 'text';
|
|
6
|
+
width?: CSSProperties['width'];
|
|
7
|
+
label: string;
|
|
8
|
+
sortOrder: SortOrder;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
isSortKey?: boolean;
|
|
11
|
+
onChange?: (value: SortOrder) => void;
|
|
12
|
+
onClickDeselect?: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function SelectSort({ size, variant, width, label, sortOrder, isDisabled, isSortKey, onChange, onClickDeselect, }: Props): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type SortOrder = 'ascend' | 'descend' | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
isSelected?: boolean;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
onClick: (id: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const TabItem: (props: Props) => import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties, PropsWithChildren } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
width?: CSSProperties['width'];
|
|
4
|
+
rows?: CSSProperties['gridTemplateRows'];
|
|
5
|
+
columns?: CSSProperties['gridTemplateColumns'];
|
|
6
|
+
};
|
|
7
|
+
export declare function TableContainer({ width, rows, columns, children }: PropsWithChildren<Props>): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColorVariant, TagColor } from './type';
|
|
3
|
+
type Props = {
|
|
4
|
+
color?: TagColor;
|
|
5
|
+
variant?: ColorVariant;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const DeleteIcon: ({ color, variant, onClick }: Props) => import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColorVariant, TagColor } from './type';
|
|
3
|
+
type Props = {
|
|
4
|
+
id: string;
|
|
5
|
+
children: string;
|
|
6
|
+
color: TagColor;
|
|
7
|
+
variant?: ColorVariant;
|
|
8
|
+
size?: 'x-small' | 'small' | 'medium';
|
|
9
|
+
} & ({
|
|
10
|
+
isEditable: true;
|
|
11
|
+
onDelete: (id: string) => void;
|
|
12
|
+
} | {
|
|
13
|
+
isEditable?: undefined;
|
|
14
|
+
onDelete?: never;
|
|
15
|
+
});
|
|
16
|
+
export declare function Tag({ id, children, color, variant, size, isEditable, onDelete }: Props): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ToastState } from './type';
|
|
3
|
+
type AddToastArgs = {
|
|
4
|
+
message: string;
|
|
5
|
+
state: ToastState;
|
|
6
|
+
};
|
|
7
|
+
type ToastProviderProps = {
|
|
8
|
+
addToast: (args: AddToastArgs) => void;
|
|
9
|
+
removeToast: (id: number) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const ToastProvider: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
12
|
+
export declare const useToast: () => ToastProviderProps;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ToastState } from './type';
|
|
3
|
+
type Props = {
|
|
4
|
+
state?: ToastState;
|
|
5
|
+
width?: CSSProperties['width'];
|
|
6
|
+
isAutoClose?: boolean;
|
|
7
|
+
isAnimation?: boolean;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
onClickClose: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ToastState = 'success' | 'error' | 'warning' | 'information';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toggle } from './toggle';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
size: 'small' | 'medium';
|
|
5
|
+
isChecked: boolean;
|
|
6
|
+
onChange: () => void;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
labelPosition?: 'left' | 'right';
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function Toggle({ id, size, isChecked, onChange, label, labelPosition, isDisabled, }: Props): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './tooltip';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TooltipHorizontalAlign, TooltipSize, TooltipVerticalPosition } from './type';
|
|
3
|
+
type Props = {
|
|
4
|
+
size: TooltipSize;
|
|
5
|
+
verticalPosition: TooltipVerticalPosition;
|
|
6
|
+
horizontalAlign: TooltipHorizontalAlign;
|
|
7
|
+
};
|
|
8
|
+
export declare const TailIcon: (props: Props) => import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { TooltipHorizontalAlign, TooltipSize, TooltipVerticalPosition } from './type';
|
|
3
|
+
type Props = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
content: string;
|
|
6
|
+
size?: TooltipSize;
|
|
7
|
+
maxWidth?: CSSProperties['width'];
|
|
8
|
+
verticalPosition?: TooltipVerticalPosition;
|
|
9
|
+
horizontalAlign?: TooltipHorizontalAlign;
|
|
10
|
+
isDisabledHover?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, }: Props): import("react").JSX.Element;
|
|
13
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zenkigen-inc/component-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"repository": "https://github.com/zenkigen/zenkigen-component",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.esm.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": "./dist/index.js",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"type-check": "tsc --noEmit",
|
|
16
|
+
"generate-component": "hygen generator components",
|
|
17
|
+
"build": "rimraf dist && microbundle --no-compress -f modern,esm,cjs --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react --globals react/jsx-runtime=jsx --tsconfig tsconfig.build.json"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"hygen": "6.2.11",
|
|
21
|
+
"microbundle": "0.15.1",
|
|
22
|
+
"typescript": "5.1.6"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@types/react": "^18.0.0",
|
|
26
|
+
"react": "^18.0.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@zenkigen-inc/component-icons": "1.0.0",
|
|
30
|
+
"@zenkigen-inc/component-theme": "1.0.0",
|
|
31
|
+
"clsx": "2.0.0"
|
|
32
|
+
}
|
|
33
|
+
}
|