@keenthemes/ktui 1.0.3 → 1.0.4
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 +189 -79
- package/package.json +1 -4
package/README.md
CHANGED
|
@@ -6,119 +6,229 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Before you begin, ensure you have installed [Node.js](https://nodejs.org) and [Tailwind CSS](https://tailwindcss.com/), and have a working Tailwind based project.
|
|
12
|
+
|
|
13
|
+
### Install via NPM
|
|
10
14
|
|
|
11
15
|
```bash
|
|
12
|
-
|
|
13
|
-
yarn install
|
|
14
|
-
# or
|
|
15
|
-
npm install
|
|
16
|
-
|
|
17
|
-
# Build the library (development mode)
|
|
18
|
-
yarn build
|
|
19
|
-
# or
|
|
20
|
-
npm run build
|
|
16
|
+
npm i @keenthemes/ktui
|
|
21
17
|
```
|
|
22
18
|
|
|
23
19
|
---
|
|
24
20
|
|
|
25
|
-
##
|
|
21
|
+
## Variables
|
|
22
|
+
|
|
23
|
+
Include KTUI variables in your Tailwind entry file `style.css`:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
/** Colors **/
|
|
27
|
+
:root {
|
|
28
|
+
/** Base Colors **/
|
|
29
|
+
--background: oklch(1 0 0); /* --color-white */
|
|
30
|
+
--foreground: oklch(14.1% 0.005 285.823); /* --color-zinc-950 */
|
|
31
|
+
--card: oklch(1 0 0); /* --color-white */
|
|
32
|
+
--card-foreground: oklch(14.1% 0.005 285.823); /* --color-zinc-950 */
|
|
33
|
+
--popover: oklch(1 0 0); /* --color-white */
|
|
34
|
+
--popover-foreground: oklch(14.1% 0.005 285.823); /* --color-zinc-950 */
|
|
35
|
+
--primary: oklch(62.3% 0.214 259.815); /* --color-blue-500 */
|
|
36
|
+
--primary-foreground: oklch(1 0 0); /* --color-white */
|
|
37
|
+
--secondary: oklch(96.7% 0.003 264.542); /* --color-zinc-100 */
|
|
38
|
+
--secondary-foreground: oklch(21% 0.006 285.885); /* --color-zinc-900 */
|
|
39
|
+
--muted: oklch(96.7% 0.003 264.542); /* --color-zinc-100 */
|
|
40
|
+
--muted-foreground: oklch(55.2% 0.016 285.938); /* --color-zinc-500 */
|
|
41
|
+
--accent: oklch(96.7% 0.003 264.542); /* --color-zinc-100 */
|
|
42
|
+
--accent-foreground: oklch(21% 0.006 285.885); /* --color-zinc-900 */
|
|
43
|
+
--destructive: oklch(57.7% 0.245 27.325); /* --color-red-600 */
|
|
44
|
+
--destructive-foreground: oklch(1 0 0); /* --color-white */
|
|
45
|
+
--mono: oklch(14.1% 0.005 285.823); /* --color-zinc-950 */
|
|
46
|
+
--mono-foreground: oklch(1 0 0); /* --color-white */
|
|
47
|
+
|
|
48
|
+
/** Base Styles **/
|
|
49
|
+
--border: oklch(94% 0.004 286.32); /* between --color-zinc-100 and --color-zinc-200 */
|
|
50
|
+
--input: oklch(92% 0.004 286.32); /* --color-zinc-200 */
|
|
51
|
+
--ring: oklch(87.1% 0.006 286.286); /* --color-zinc-400 */
|
|
52
|
+
--radius: 0.5rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.dark {
|
|
56
|
+
/** Base Colors **/
|
|
57
|
+
--background: oklch(14.1% 0.005 285.823); /* --color-zinc-950 */
|
|
58
|
+
--foreground: oklch(98.5% 0 0); /* --color-zinc-50 */
|
|
59
|
+
--card: oklch(14.1% 0.005 285.823); /* --color-zinc-950 */
|
|
60
|
+
--card-foreground: oklch(98.5% 0 0); /* --color-zinc-50 */
|
|
61
|
+
--popover: oklch(14.1% 0.005 285.823); /* --color-zinc-950 */
|
|
62
|
+
--popover-foreground: oklch(98.5% 0 0); /* --color-zinc-50 */
|
|
63
|
+
--primary: oklch(54.6% 0.245 262.881); /* --color-blue-600 */
|
|
64
|
+
--primary-foreground: oklch(1 0 0); /* --color-white */
|
|
65
|
+
--secondary: oklch(27.4% 0.006 286.033); /* --color-zinc-800 */
|
|
66
|
+
--secondary-foreground: oklch(98.5% 0 0); /* --color-zinc-50 */
|
|
67
|
+
--muted: oklch(21% 0.006 285.885); /* --color-zinc-900 */
|
|
68
|
+
--muted-foreground: oklch(55.2% 0.016 285.938); /* --color-zinc-500 */
|
|
69
|
+
--accent: oklch(21% 0.006 285.885); /* --color-zinc-900 */
|
|
70
|
+
--accent-foreground: oklch(98.5% 0 0); /* --color-zinc-50 */
|
|
71
|
+
--destructive: oklch(57.7% 0.245 27.325); /* --color-red-600 */
|
|
72
|
+
--destructive-foreground: oklch(1 0 0); /* --color-white */
|
|
73
|
+
--mono: oklch(87.1% 0.006 286.286); /* --color-zinc-300 */
|
|
74
|
+
--mono-foreground: oklch(0 0 0); /* --color-black */
|
|
75
|
+
|
|
76
|
+
/** Base Styles **/
|
|
77
|
+
--border: oklch(27.4% 0.006 286.033); /* --color-zinc-800 */
|
|
78
|
+
--input: oklch(27.4% 0.006 286.033); /* --color-zinc-800 */
|
|
79
|
+
--ring: oklch(27.4% 0.006 286.033); /* --color-zinc-600 */
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Theme Setup **/
|
|
83
|
+
@theme inline {
|
|
84
|
+
/** Base Colors **/
|
|
85
|
+
--color-background: var(--background);
|
|
86
|
+
--color-foreground: var(--foreground);
|
|
87
|
+
|
|
88
|
+
--color-card: var(--card);
|
|
89
|
+
--color-card-foreground: var(--card-foreground);
|
|
90
|
+
|
|
91
|
+
--color-popover: var(--popover);
|
|
92
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
93
|
+
|
|
94
|
+
--color-muted: var(--muted);
|
|
95
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
96
|
+
|
|
97
|
+
--color-accent: var(--accent);
|
|
98
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
99
|
+
|
|
100
|
+
--color-primary: var(--primary);
|
|
101
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
102
|
+
|
|
103
|
+
--color-secondary: var(--secondary);
|
|
104
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
105
|
+
|
|
106
|
+
--color-destructive: var(--destructive);
|
|
107
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
108
|
+
|
|
109
|
+
--color-mono: var(--mono);
|
|
110
|
+
--color-mono-foreground: var(--mono-foreground);
|
|
111
|
+
|
|
112
|
+
/** Base Styles **/
|
|
113
|
+
--color-border: var(--border);
|
|
114
|
+
--color-input: var(--input);
|
|
115
|
+
--color-ring: var(--ring);
|
|
116
|
+
|
|
117
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
118
|
+
--radius-lg: var(--radius);
|
|
119
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
120
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
26
123
|
|
|
27
|
-
|
|
124
|
+
---
|
|
28
125
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
126
|
+
## Dark Mode
|
|
127
|
+
|
|
128
|
+
To enable automated dark mode support add below Tailwind variant in your Tailwind entry file `style.css`:
|
|
129
|
+
|
|
130
|
+
```css
|
|
131
|
+
@custom-variant dark (&:is(.dark *));
|
|
33
132
|
```
|
|
34
133
|
|
|
35
134
|
---
|
|
36
135
|
|
|
37
|
-
##
|
|
136
|
+
## Styles
|
|
38
137
|
|
|
39
|
-
|
|
138
|
+
Include KTUI styles in your Tailwind entry file `style.css`:
|
|
40
139
|
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
<script src="/path/to/ktui/dist/ktui.js"></script>
|
|
44
|
-
<script>
|
|
45
|
-
// Initialize all KTUI components after DOM is ready
|
|
46
|
-
window.KTComponents.init();
|
|
47
|
-
</script>
|
|
140
|
+
```css
|
|
141
|
+
@import "./node_modules/ktui/styles.css";
|
|
48
142
|
```
|
|
49
143
|
|
|
50
|
-
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Font
|
|
147
|
+
|
|
148
|
+
Specify a font family of your choice in your Tailwind entry file `style.css`:
|
|
51
149
|
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
150
|
+
```css
|
|
151
|
+
@theme {
|
|
152
|
+
--default-font-family: Inter;
|
|
153
|
+
}
|
|
55
154
|
```
|
|
56
155
|
|
|
57
|
-
|
|
156
|
+
Include the font file:
|
|
58
157
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- **Scrollable** (`KTScrollable`)
|
|
72
|
-
- **Scrollto** (`KTScrollto`)
|
|
73
|
-
- **Sticky** (`KTSticky`)
|
|
74
|
-
- **Reparent** (`KTReparent`)
|
|
75
|
-
- **Toggle** (`KTToggle`)
|
|
76
|
-
- **Tooltip** (`KTTooltip`)
|
|
77
|
-
- **Stepper** (`KTStepper`)
|
|
78
|
-
- **Theme Switch** (`KTThemeSwitch`)
|
|
79
|
-
- **Image Input** (`KTImageInput`)
|
|
80
|
-
- **Toggle Password** (`KTTogglePassword`)
|
|
81
|
-
- **DataTable** (`KTDataTable`)
|
|
82
|
-
- **Datepicker** (`KTDatepicker`)
|
|
83
|
-
- **Select** (`KTSelect`)
|
|
158
|
+
```html
|
|
159
|
+
<html>
|
|
160
|
+
<head>
|
|
161
|
+
...
|
|
162
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"/>
|
|
163
|
+
...
|
|
164
|
+
</head>
|
|
165
|
+
<body className="antialiased">
|
|
166
|
+
....
|
|
167
|
+
</body>
|
|
168
|
+
</html>
|
|
169
|
+
```
|
|
84
170
|
|
|
85
171
|
---
|
|
86
172
|
|
|
87
|
-
##
|
|
173
|
+
## Assets
|
|
88
174
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
175
|
+
Include KTUI JavaScript, Tailwind CSS, and fonts:
|
|
176
|
+
|
|
177
|
+
```html
|
|
178
|
+
<html>
|
|
179
|
+
<head>
|
|
180
|
+
...
|
|
181
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"/>
|
|
182
|
+
<link href="my_project_root/css/styles.css" rel="stylesheet"/>
|
|
183
|
+
...
|
|
184
|
+
</head>
|
|
185
|
+
<body className="antialiased">
|
|
186
|
+
....
|
|
187
|
+
</body>
|
|
188
|
+
<script src="./node_modules/@keenthemes/ktui/dist/ktui.min.js">
|
|
189
|
+
</script>
|
|
190
|
+
</html>
|
|
191
|
+
```
|
|
95
192
|
|
|
96
193
|
---
|
|
97
194
|
|
|
98
|
-
##
|
|
195
|
+
## RTL Support
|
|
99
196
|
|
|
100
|
-
|
|
101
|
-
- `npm run build:prod` – Build the library using webpack in production mode
|
|
102
|
-
- `npm run build:lib` – Build the library outputs for CommonJS and ES Modules using TypeScript
|
|
103
|
-
- `npm run lint` – Lint the source files with ESLint
|
|
104
|
-
- `npm run format` – Format the source files with Prettier
|
|
197
|
+
To globally setup the RTL direction add a `dir="rtl"` attribute on the html as shown below:
|
|
105
198
|
|
|
106
|
-
|
|
199
|
+
```html
|
|
200
|
+
<!-- Setup rtl mode -->
|
|
201
|
+
<html dir="rtl">
|
|
202
|
+
<!-- HTML markup -->
|
|
203
|
+
</html>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
KTUI utilizes the logical CSS properties as the default method for handling RTL support. This approach simplifies RTL support by using context-aware properties that adjust based on the document's text direction.
|
|
107
207
|
|
|
108
|
-
|
|
208
|
+
```html
|
|
209
|
+
<!-- Using logical properties -->
|
|
210
|
+
<div class="text-start ps-5">
|
|
211
|
+
Example text
|
|
212
|
+
</div>
|
|
213
|
+
```
|
|
109
214
|
|
|
110
|
-
|
|
215
|
+
For specific cases, you can use the `rtl:*` Tailwind modifier to easily control alignments for both LTR and RTL directions.
|
|
216
|
+
|
|
217
|
+
```html
|
|
218
|
+
<!-- Using rtl modifier -->
|
|
219
|
+
<div class="text-left pl-5 rtl:text-right rtl:pr-5">
|
|
220
|
+
Example text
|
|
221
|
+
</div>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
111
225
|
|
|
112
|
-
|
|
113
|
-
2. Create your feature branch (`git checkout -b feature/YourFeature`)
|
|
114
|
-
3. Commit your changes (`git commit -m 'Add some feature'`)
|
|
115
|
-
4. Push to the branch (`git push origin feature/YourFeature`)
|
|
116
|
-
5. Open a pull request
|
|
226
|
+
## License
|
|
117
227
|
|
|
118
|
-
|
|
228
|
+
KTUI is distributed under the MIT license. See [LICENSE.md](https://github.com/keenthemes/reui/blob/main/LICENSE.md) for full details.
|
|
119
229
|
|
|
120
230
|
---
|
|
121
231
|
|
|
122
|
-
##
|
|
232
|
+
## Contributing
|
|
123
233
|
|
|
124
|
-
|
|
234
|
+
Please see our [CONTRIBUTING.md](https://github.com/keenthemes/reui/blob/main/CONTRIBUTING.md) for guidelines if you wish to contribute to KTUI.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keenthemes/ktui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Free & Open-Source Tailwind UI Components by Keenthemes",
|
|
5
5
|
"homepage": "https://ktui.io",
|
|
6
6
|
"keywords": [
|
|
@@ -78,8 +78,5 @@
|
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@popperjs/core": "^2.11.8"
|
|
81
|
-
},
|
|
82
|
-
"publishConfig": {
|
|
83
|
-
"access": "public"
|
|
84
81
|
}
|
|
85
82
|
}
|