@clasing/ui 0.1.22 → 0.1.23
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 +10 -4
- package/dist/index.es.js +1073 -994
- 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';
|
|
@@ -60,9 +58,9 @@ declare type DropdownOption<T> = {
|
|
|
60
58
|
value: T;
|
|
61
59
|
};
|
|
62
60
|
|
|
63
|
-
export declare const DropdownSelect: ForwardRefExoticComponent<DropdownSelectProps<any> & RefAttributes<
|
|
61
|
+
export declare const DropdownSelect: ForwardRefExoticComponent<DropdownSelectProps<any> & RefAttributes<HTMLDivElement>>;
|
|
64
62
|
|
|
65
|
-
declare interface DropdownSelectProps<T> extends React.SelectHTMLAttributes<
|
|
63
|
+
declare interface DropdownSelectProps<T> extends React.SelectHTMLAttributes<HTMLDivElement> {
|
|
66
64
|
label?: string;
|
|
67
65
|
helperText?: string;
|
|
68
66
|
error?: string;
|
|
@@ -136,6 +134,7 @@ declare interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
136
134
|
helperText?: string;
|
|
137
135
|
error?: string;
|
|
138
136
|
touched?: boolean;
|
|
137
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
|
|
139
138
|
iconName?: {
|
|
140
139
|
name: TablerIconName;
|
|
141
140
|
stroke?: number;
|
|
@@ -172,6 +171,11 @@ declare interface ModalProps {
|
|
|
172
171
|
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
173
172
|
}
|
|
174
173
|
|
|
174
|
+
declare interface OutsideClickHandlerProps {
|
|
175
|
+
ref: React.RefObject<HTMLElement>;
|
|
176
|
+
handler: () => void;
|
|
177
|
+
}
|
|
178
|
+
|
|
175
179
|
export declare const Popover: ({ children, trigger, open, placement, closeOnAction, }: IPopoverProps) => JSX_2.Element;
|
|
176
180
|
|
|
177
181
|
declare type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
@@ -196,4 +200,6 @@ declare const textStyles: (props?: ({
|
|
|
196
200
|
weight?: "bold" | "light" | "regular" | "semibold" | null | undefined;
|
|
197
201
|
} & ClassProp) | undefined) => string;
|
|
198
202
|
|
|
203
|
+
export declare const useOutsideClick: ({ ref, handler }: OutsideClickHandlerProps) => void;
|
|
204
|
+
|
|
199
205
|
export { }
|