@hybr1d-tech/charizard 0.3.36
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 +44 -0
- package/dist/button/Button.d.ts +52 -0
- package/dist/button/actions-dropdown.stories.d.ts +6 -0
- package/dist/button/button.stories.d.ts +10 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/menu-button.stories.d.ts +6 -0
- package/dist/checkbox/Checkbox.d.ts +44 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/combo-box/ComboBox.d.ts +23 -0
- package/dist/combo-box/combo-box.stories.d.ts +10 -0
- package/dist/combo-box/index.d.ts +1 -0
- package/dist/drawer/Drawer.d.ts +71 -0
- package/dist/drawer/index.d.ts +1 -0
- package/dist/empty-state/EmptyState.d.ts +13 -0
- package/dist/empty-state/empty-state.stories.d.ts +6 -0
- package/dist/empty-state/index.d.ts +1 -0
- package/dist/hybr1d-ui.js +8024 -0
- package/dist/hybr1d-ui.umd.cjs +61 -0
- package/dist/index.d.ts +20 -0
- package/dist/input/Input.d.ts +63 -0
- package/dist/input/InputAddon.d.ts +44 -0
- package/dist/input/InputContainer.d.ts +28 -0
- package/dist/input/InputElement.d.ts +21 -0
- package/dist/input/InputGroup.d.ts +17 -0
- package/dist/input/InputLabel.d.ts +42 -0
- package/dist/input/index.d.ts +6 -0
- package/dist/input/types.d.ts +13 -0
- package/dist/layout-tabs/LayoutTabs.d.ts +22 -0
- package/dist/layout-tabs/index.d.ts +1 -0
- package/dist/loader/Loader.d.ts +17 -0
- package/dist/loader/index.d.ts +1 -0
- package/dist/loader/loader.stories.d.ts +13 -0
- package/dist/modal/Modal.d.ts +30 -0
- package/dist/modal/ModalBody.d.ts +17 -0
- package/dist/modal/ModalContent.d.ts +18 -0
- package/dist/modal/ModalFooter.d.ts +34 -0
- package/dist/modal/ModalHeader.d.ts +21 -0
- package/dist/modal/ModalOverlay.d.ts +9 -0
- package/dist/modal/index.d.ts +6 -0
- package/dist/modal/usage.d.ts +1 -0
- package/dist/popover/Popover.d.ts +26 -0
- package/dist/popover/PopoverCloseButton.d.ts +23 -0
- package/dist/popover/PopoverContent.d.ts +32 -0
- package/dist/popover/PopoverDescription.d.ts +23 -0
- package/dist/popover/PopoverTitle.d.ts +23 -0
- package/dist/popover/PopoverTrigger.d.ts +29 -0
- package/dist/popover/index.d.ts +6 -0
- package/dist/popover/usage.d.ts +1 -0
- package/dist/progress/Progress.d.ts +63 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/radio-group/RadioGroup.d.ts +43 -0
- package/dist/radio-group/index.d.ts +1 -0
- package/dist/search/Search.d.ts +9 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/segmented-control/SegmentedControl.d.ts +22 -0
- package/dist/segmented-control/index.d.ts +1 -0
- package/dist/select/Common.d.ts +9 -0
- package/dist/select/CreatableSelect.d.ts +100 -0
- package/dist/select/Select.d.ts +91 -0
- package/dist/select/SelectAsync.d.ts +83 -0
- package/dist/select/config.d.ts +3 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/types.d.ts +15 -0
- package/dist/selectors/Selectors.d.ts +7 -0
- package/dist/selectors/index.d.ts +1 -0
- package/dist/style.css +1 -0
- package/dist/svg/SVG.d.ts +11 -0
- package/dist/svg/index.d.ts +1 -0
- package/dist/switch/Switch.d.ts +12 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/table/Table.d.ts +87 -0
- package/dist/table/constants.d.ts +3 -0
- package/dist/table/index.d.ts +1 -0
- package/dist/table/store.d.ts +14 -0
- package/dist/table/table-actions/TableActions.d.ts +7 -0
- package/dist/table/table-actions/index.d.ts +1 -0
- package/dist/table/table-columns/TableCheckbox.d.ts +11 -0
- package/dist/table/table-columns/TableRadio.d.ts +7 -0
- package/dist/table/table-columns/index.d.ts +2 -0
- package/dist/table/table-empty/TableEmpty.d.ts +5 -0
- package/dist/table/table-empty/index.d.ts +1 -0
- package/dist/table/table-filters/FilterCheckbox.d.ts +12 -0
- package/dist/table/table-filters/FilterTooltip.d.ts +8 -0
- package/dist/table/table-filters/TableFilter.d.ts +13 -0
- package/dist/table/table-filters/TableFilters.d.ts +6 -0
- package/dist/table/table-filters/index.d.ts +1 -0
- package/dist/table/table-loader/TableLoader.d.ts +4 -0
- package/dist/table/table-loader/index.d.ts +1 -0
- package/dist/table/table-selected-actions/TableSelectedActions.d.ts +7 -0
- package/dist/table/table-selected-actions/index.d.ts +1 -0
- package/dist/table/types.d.ts +36 -0
- package/dist/tooltip/Tooltip.d.ts +28 -0
- package/dist/tooltip/TooltipContent.d.ts +24 -0
- package/dist/tooltip/TooltipTrigger.d.ts +16 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Charizard (Hybr1d UI)
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/hybr1d-ui)
|
|
4
|
+
|
|
5
|
+
A collection of reusable React components for building beautiful user interfaces. This library is
|
|
6
|
+
built using Vite for fast development and Storybook for component documentation and showcase.
|
|
7
|
+
|
|
8
|
+
## Installation on external repos
|
|
9
|
+
|
|
10
|
+
To install the library, use pnpm i
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm i @hybr1d/charizard
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
To update the library
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm up @hybr1d/charizard -L
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Publishing to npm
|
|
23
|
+
|
|
24
|
+
Use the following commands, _follow semver for version upgrade_
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm version patch
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
before the PR, the github action will automatically publish it to npm
|
|
31
|
+
|
|
32
|
+
## Storybook
|
|
33
|
+
|
|
34
|
+
To start the local storybook playground
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm storybook
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## How to add a new component
|
|
41
|
+
|
|
42
|
+
- use named export for the component
|
|
43
|
+
- export the prop types
|
|
44
|
+
- add named export in the index.ts file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PositioningOptions } from '@zag-js/popper';
|
|
3
|
+
export declare enum BUTTON_VARIANT {
|
|
4
|
+
PRIMARY = "primary",
|
|
5
|
+
SECONDARY = "secondary",
|
|
6
|
+
GHOST = "ghost",
|
|
7
|
+
DANGER = "danger",
|
|
8
|
+
LINK = "link",
|
|
9
|
+
MINIMAL = "minimal"
|
|
10
|
+
}
|
|
11
|
+
export type ButtonProps = {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
variant?: BUTTON_VARIANT;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
16
|
+
type?: 'button' | 'submit' | 'reset';
|
|
17
|
+
size?: 'xs' | 'sm' | 'md' | 'adapt';
|
|
18
|
+
customStyles?: React.CSSProperties;
|
|
19
|
+
};
|
|
20
|
+
export declare function Button({ children, variant, disabled, onClick, type, size, customStyles, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace Button {
|
|
22
|
+
var MenuButton: ({ children, variant, disabled, menuItems, onClick, isCustomTrigger, isSingleBtnTrigger, customData, size, actionsDropdownOptions, positionerProps, }: MenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
var ActionsDropdown: typeof MenuActionsDropdown;
|
|
24
|
+
}
|
|
25
|
+
export type MenuItem = {
|
|
26
|
+
label: string;
|
|
27
|
+
iconSrc?: string;
|
|
28
|
+
onClick: any;
|
|
29
|
+
filterFn?: any;
|
|
30
|
+
};
|
|
31
|
+
export interface MenuButtonProps {
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
variant?: BUTTON_VARIANT;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
menuItems: MenuItem[];
|
|
36
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
37
|
+
isCustomTrigger?: boolean;
|
|
38
|
+
isSingleBtnTrigger?: boolean;
|
|
39
|
+
customData?: any;
|
|
40
|
+
size?: 'sm' | 'md';
|
|
41
|
+
actionsDropdownOptions?: {
|
|
42
|
+
setIsActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
43
|
+
};
|
|
44
|
+
positionerProps?: PositioningOptions;
|
|
45
|
+
}
|
|
46
|
+
export type MenuActionsDropdownProps = {
|
|
47
|
+
menuItems: MenuItem[];
|
|
48
|
+
data?: any;
|
|
49
|
+
variant?: 'regular' | 'small';
|
|
50
|
+
};
|
|
51
|
+
declare function MenuActionsDropdown({ menuItems, data, variant }: MenuActionsDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button } from './Button';
|
|
3
|
+
declare const meta: Meta<typeof Button.ActionsDropdown>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button.ActionsDropdown>;
|
|
6
|
+
export declare const ActionsDropdown: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button } from './Button';
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Secondary: Story;
|
|
8
|
+
export declare const Ghost: Story;
|
|
9
|
+
export declare const Link: Story;
|
|
10
|
+
export declare const Minimal: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type CheckboxProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox id
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Checkbox name
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* children
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* handle checkbox clicked
|
|
16
|
+
*/
|
|
17
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* custom classes
|
|
20
|
+
*/
|
|
21
|
+
customClasses?: string;
|
|
22
|
+
/**
|
|
23
|
+
* custom styles
|
|
24
|
+
*/
|
|
25
|
+
customStyles?: React.CSSProperties;
|
|
26
|
+
/**
|
|
27
|
+
* error message
|
|
28
|
+
*/
|
|
29
|
+
errorMsg?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Checkbox checked
|
|
32
|
+
*/
|
|
33
|
+
checked?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Checkbox indeterminate state
|
|
36
|
+
*/
|
|
37
|
+
indeterminate?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Checkbox disabled
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export declare function Checkbox({ id, name, children, onChange, customClasses, customStyles, errorMsg, checked, indeterminate, disabled, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox } from './Checkbox';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type option = {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
listComponent?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type ComboboxProps = {
|
|
9
|
+
value: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
labelClassName?: string;
|
|
14
|
+
inputClassName?: string;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
defaultOptions?: option[] | [];
|
|
18
|
+
isAPIFilter?: boolean;
|
|
19
|
+
onChange?: (text: string) => void;
|
|
20
|
+
onSelect: (selected?: option) => void;
|
|
21
|
+
optionsMaxHeight?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function Combobox({ label, isLoading, required, labelClassName, inputClassName, disabled, defaultOptions, isAPIFilter, onChange, onSelect, placeholder, optionsMaxHeight, value, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Combobox } from './ComboBox';
|
|
3
|
+
declare const meta: Meta<typeof Combobox>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Combobox>;
|
|
6
|
+
export declare const clientSideSearch: Story;
|
|
7
|
+
export declare const serverSideSearch: Story;
|
|
8
|
+
export declare const disabledCombobox: Story;
|
|
9
|
+
export declare const clientSideSearchWithNoResult: Story;
|
|
10
|
+
export declare const serverSideSearchWithNoResult: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ComboBox';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FooterButtons } from '../modal/ModalFooter';
|
|
3
|
+
type DrawerProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Drawer footer className
|
|
6
|
+
*/
|
|
7
|
+
footerClassName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Drawer header className
|
|
10
|
+
*/
|
|
11
|
+
headerClassName?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Drawer content className
|
|
14
|
+
*/
|
|
15
|
+
contentClassName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Drawer is open or not
|
|
18
|
+
*/
|
|
19
|
+
isOpen: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function when drawer is closed
|
|
22
|
+
*/
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Drawer content
|
|
26
|
+
*/
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Drawer title
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Custom drawer header
|
|
34
|
+
*/
|
|
35
|
+
customHeader?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Custom drawer footer
|
|
38
|
+
*/
|
|
39
|
+
customFooter?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Drawer size
|
|
42
|
+
*/
|
|
43
|
+
size?: 'sm' | 'md' | 'lg' | 'xlg' | 'xxlg';
|
|
44
|
+
/**
|
|
45
|
+
* Show backdrop or not
|
|
46
|
+
*/
|
|
47
|
+
showBackdrop?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Show header or not
|
|
50
|
+
*/
|
|
51
|
+
showHeader?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Show footer or not
|
|
54
|
+
*/
|
|
55
|
+
showFooter?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* footer buttons to show
|
|
58
|
+
*/
|
|
59
|
+
buttons?: FooterButtons;
|
|
60
|
+
footerAddon?: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* show header border or not
|
|
63
|
+
*/
|
|
64
|
+
showHeaderBorder?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Drawer position
|
|
67
|
+
*/
|
|
68
|
+
drawerPosition?: 'left' | 'right';
|
|
69
|
+
};
|
|
70
|
+
export declare function Drawer({ isOpen, onClose, children, title, customHeader, customFooter, size, showBackdrop, showHeader, showFooter, buttons, footerAddon, headerClassName, contentClassName, footerClassName, showHeaderBorder, drawerPosition, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Drawer';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type EmptyStateProps = {
|
|
3
|
+
icon: string;
|
|
4
|
+
title: string;
|
|
5
|
+
desc?: string;
|
|
6
|
+
flexDir?: 'row' | 'column';
|
|
7
|
+
btnText?: string;
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* adapts to parent's width and height
|
|
12
|
+
*/
|
|
13
|
+
export declare function EmptyState({ icon, title, desc, flexDir, btnText, onClick, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EmptyState';
|