cekat-ui 1.0.3 → 1.0.5
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 +107 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/ButtonIcon.d.ts +2 -0
- package/dist/components/Button/ButtonText.d.ts +2 -0
- package/dist/components/Button/button.styles.d.ts +5 -0
- package/dist/components/Button/button.types.d.ts +16 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Radio.d.ts +2 -0
- package/dist/components/Toggle.d.ts +2 -0
- package/dist/components/Tooltip.d.ts +2 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.es.js +447 -404
- package/dist/index.umd.js +2 -2
- package/dist/style.css +40 -14
- package/package.json +4 -2
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# cekat-ui
|
|
2
|
+
|
|
3
|
+
A modern, lightweight **React UI component library** built with **TypeScript**, **Tailwind CSS**, and **Storybook**.
|
|
4
|
+
|
|
5
|
+
`cekat-ui` is designed to be:
|
|
6
|
+
- ✅ Composable (shadcn / Radix-inspired)
|
|
7
|
+
- ✅ Tree-shakeable
|
|
8
|
+
- ✅ Fully typed
|
|
9
|
+
- ✅ Framework-agnostic (works with Next.js, Vite, CRA, etc.)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## ✨ Features
|
|
14
|
+
|
|
15
|
+
- Button (compound component)
|
|
16
|
+
- Checkbox
|
|
17
|
+
- Radio Group
|
|
18
|
+
- Toggle (Switch)
|
|
19
|
+
- Tooltip
|
|
20
|
+
- Tailwind CSS styling
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📦 Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install cekat-ui
|
|
28
|
+
|
|
29
|
+
or
|
|
30
|
+
|
|
31
|
+
yarn add cekat-ui
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Styles
|
|
35
|
+
|
|
36
|
+
`cekat-ui` ships with prebuilt styles. Import once in your app entry file.
|
|
37
|
+
|
|
38
|
+
Next.js (App Router):
|
|
39
|
+
```ts
|
|
40
|
+
import 'cekat-ui/style.css';
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Button
|
|
47
|
+
```tsx
|
|
48
|
+
import { Button } from 'cekat-ui';
|
|
49
|
+
|
|
50
|
+
export default function Example() {
|
|
51
|
+
return (
|
|
52
|
+
<Button size="md" tone="primary" variant="solid">
|
|
53
|
+
Click me
|
|
54
|
+
</Button>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Compound usage
|
|
60
|
+
```tsx
|
|
61
|
+
<Button>
|
|
62
|
+
<Button.Icon>
|
|
63
|
+
<IconChevronLeft size={16} />
|
|
64
|
+
</Button.Icon>
|
|
65
|
+
<Button.Text>Submit</Button.Text>
|
|
66
|
+
</Button>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Components API
|
|
70
|
+
|
|
71
|
+
All components support:
|
|
72
|
+
- `className` override
|
|
73
|
+
- Controlled & uncontrolled usage
|
|
74
|
+
- Keyboard & screen reader accessibility
|
|
75
|
+
- Size variants (`sm`, `md`, `lg`)
|
|
76
|
+
|
|
77
|
+
For full props reference, see Storybook.
|
|
78
|
+
|
|
79
|
+
## Storybook
|
|
80
|
+
|
|
81
|
+
Run Storybook locally:
|
|
82
|
+
```bash
|
|
83
|
+
yarn dev
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Build static Storybook:
|
|
87
|
+
```bash
|
|
88
|
+
yarn build:storybook
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Peer Dependencies
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"react": ">=18",
|
|
96
|
+
"react-dom": ">=18"
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Tech Stack
|
|
101
|
+
|
|
102
|
+
- React
|
|
103
|
+
- TypeScript
|
|
104
|
+
- Tailwind CSS
|
|
105
|
+
- class-variance-authority
|
|
106
|
+
- Storybook
|
|
107
|
+
- Vite
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const buttonStyles: (props?: {
|
|
2
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
3
|
+
tone?: "primary" | "destructive";
|
|
4
|
+
variant?: "solid" | "outline" | "ghost" | "outline-primary" | "ghost-primary" | "plain" | "plain-black";
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ButtonTone = 'primary';
|
|
3
|
+
export type ButtonVariant = 'solid';
|
|
4
|
+
export type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
+
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
6
|
+
tone?: ButtonTone;
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
}
|
|
10
|
+
export interface ButtonSubComponentProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export type ButtonCompound = React.FC<ButtonProps> & {
|
|
14
|
+
Icon: React.FC<ButtonSubComponentProps>;
|
|
15
|
+
Text: React.FC<ButtonSubComponentProps>;
|
|
16
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '../
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
1
|
+
export * from './components/Button';
|
|
2
|
+
export * from '../src/components/Checkbox';
|
|
3
|
+
export * from './components/Radio';
|
|
4
|
+
export * from './components/Toggle';
|
|
5
|
+
export * from './components/Tooltip';
|