@clasing/ui 0.1.22 → 0.1.24
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 +33 -0
- package/dist/index.d.ts +33 -4
- package/dist/index.es.js +1146 -950
- package/dist/index.umd.js +10 -13
- package/dist/style.css +1 -1
- package/package.json +26 -25
- package/tailwind.config.js +1 -1
package/README.md
CHANGED
|
@@ -3,3 +3,36 @@
|
|
|
3
3
|
UI library for Clasing react/nextjs projects
|
|
4
4
|
|
|
5
5
|
## Initiliazing the project
|
|
6
|
+
|
|
7
|
+
- Ensure you have pnpm installed.
|
|
8
|
+
- run `pnpm install` and then `pnpm storybook`
|
|
9
|
+
|
|
10
|
+
## Installation Guide inside a React project
|
|
11
|
+
|
|
12
|
+
This guide will help you to install ClasingUI in your React project.
|
|
13
|
+
|
|
14
|
+
### Step 1: Install the package
|
|
15
|
+
|
|
16
|
+
To install the packages, you need to run the following command: `npm install @clasing/ui`, `yarn add @clasing/ui` or `pnpm add @clasing/ui`
|
|
17
|
+
|
|
18
|
+
### Step 2: Initial configuration
|
|
19
|
+
|
|
20
|
+
#### If you are not using TailwindCSS
|
|
21
|
+
|
|
22
|
+
If you are not using TailwindCSS in your project, you need to add the following line to your `index.tsx`, `layout.tsx` or root file: `import "@clasing/ui/styles"`
|
|
23
|
+
|
|
24
|
+
#### If you are using TailwindCSS
|
|
25
|
+
|
|
26
|
+
If you are using TailwindCSS in your project, you need to add the following line to your `tailwind.config.js` file (have in account that you should have the initial config of TailwindCSS):
|
|
27
|
+
|
|
28
|
+
- At `content` array, add `./node_modules/@clasing/ui/dist/index.umd.js`
|
|
29
|
+
- At `presets` array, add `require('@clasing/ui/tailwind.config.js')`
|
|
30
|
+
- Add the following line to your `index.tsx`, `layout.tsx` or root file: `import "@clasing/ui/styles"`
|
|
31
|
+
|
|
32
|
+
### Step 3: Using the components
|
|
33
|
+
|
|
34
|
+
Now you can use the components in your project. You can import the components like this: `import { Button } from "@clasing/ui"`
|
|
35
|
+
|
|
36
|
+
## Contributing
|
|
37
|
+
|
|
38
|
+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
1
|
import { ClassProp } from 'class-variance-authority/types';
|
|
4
2
|
import { default as default_2 } from 'react';
|
|
5
3
|
import { ForwardRefExoticComponent } from 'react';
|
|
@@ -55,14 +53,23 @@ declare const cardStyles: (props?: ({
|
|
|
55
53
|
shadow?: "none" | "sm" | "xs" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
56
54
|
} & ClassProp) | undefined) => string;
|
|
57
55
|
|
|
56
|
+
export declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLInputElement>>;
|
|
57
|
+
|
|
58
|
+
declare interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
59
|
+
label?: string;
|
|
60
|
+
helperText?: string;
|
|
61
|
+
error?: string;
|
|
62
|
+
touched?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
58
65
|
declare type DropdownOption<T> = {
|
|
59
66
|
label: string;
|
|
60
67
|
value: T;
|
|
61
68
|
};
|
|
62
69
|
|
|
63
|
-
export declare const DropdownSelect: ForwardRefExoticComponent<DropdownSelectProps<any> & RefAttributes<
|
|
70
|
+
export declare const DropdownSelect: ForwardRefExoticComponent<DropdownSelectProps<any> & RefAttributes<HTMLDivElement>>;
|
|
64
71
|
|
|
65
|
-
declare interface DropdownSelectProps<T> extends React.SelectHTMLAttributes<
|
|
72
|
+
declare interface DropdownSelectProps<T> extends React.SelectHTMLAttributes<HTMLDivElement> {
|
|
66
73
|
label?: string;
|
|
67
74
|
helperText?: string;
|
|
68
75
|
error?: string;
|
|
@@ -136,6 +143,7 @@ declare interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
136
143
|
helperText?: string;
|
|
137
144
|
error?: string;
|
|
138
145
|
touched?: boolean;
|
|
146
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
139
147
|
iconName?: {
|
|
140
148
|
name: TablerIconName;
|
|
141
149
|
stroke?: number;
|
|
@@ -163,6 +171,10 @@ declare interface ITextProps extends React.HTMLAttributes<HTMLSpanElement>, Vari
|
|
|
163
171
|
className?: string;
|
|
164
172
|
}
|
|
165
173
|
|
|
174
|
+
declare interface ITooltipProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof tooltipStyles> {
|
|
175
|
+
content: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
166
178
|
export declare const Modal: ({ className, children, isOpen, setIsOpen, }: ModalProps) => JSX_2.Element;
|
|
167
179
|
|
|
168
180
|
declare interface ModalProps {
|
|
@@ -172,6 +184,11 @@ declare interface ModalProps {
|
|
|
172
184
|
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
173
185
|
}
|
|
174
186
|
|
|
187
|
+
declare interface OutsideClickHandlerProps {
|
|
188
|
+
ref: React.RefObject<HTMLElement>;
|
|
189
|
+
handler: () => void;
|
|
190
|
+
}
|
|
191
|
+
|
|
175
192
|
export declare const Popover: ({ children, trigger, open, placement, closeOnAction, }: IPopoverProps) => JSX_2.Element;
|
|
176
193
|
|
|
177
194
|
declare type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
@@ -196,4 +213,16 @@ declare const textStyles: (props?: ({
|
|
|
196
213
|
weight?: "bold" | "light" | "regular" | "semibold" | null | undefined;
|
|
197
214
|
} & ClassProp) | undefined) => string;
|
|
198
215
|
|
|
216
|
+
export declare const Tooltip: ForwardRefExoticComponent<ITooltipProps & RefAttributes<HTMLSpanElement>>;
|
|
217
|
+
|
|
218
|
+
declare const tooltipStyles: (props?: ({
|
|
219
|
+
shadow?: "none" | "sm" | "xs" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
220
|
+
placement?: "top" | "bottom" | "left" | "right" | null | undefined;
|
|
221
|
+
delay?: 0 | 200 | 75 | 100 | 150 | 300 | 500 | null | undefined;
|
|
222
|
+
closeDelay?: 0 | 200 | 75 | 100 | 150 | 300 | 500 | null | undefined;
|
|
223
|
+
rounded?: "full" | "sm" | null | undefined;
|
|
224
|
+
} & ClassProp) | undefined) => string;
|
|
225
|
+
|
|
226
|
+
export declare const useOutsideClick: ({ ref, handler }: OutsideClickHandlerProps) => void;
|
|
227
|
+
|
|
199
228
|
export { }
|