@dimasbaguspm/versaur 0.0.20 → 0.0.21
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 +22 -6
- package/dist/js/{bottom-sheet-DbtyWwsy.js → bottom-sheet-Eqduh3eY.js} +17 -15
- package/dist/js/{bottom-sheet-input-C7cYfBaK.js → bottom-sheet-input-DFGibm1I.js} +2 -2
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-DH7v2xvp.js → image-rectangle-C6cgL8R9.js} +329 -284
- package/dist/js/index.js +30 -29
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/overlays/index.js +1 -1
- package/dist/js/primitive/index.js +12 -11
- package/dist/js/{side-bar-CHhcp0yS.js → side-bar-BUACYQUo.js} +4 -4
- package/dist/types/primitive/icon/types.d.ts +1 -1
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/primitive/no-results/index.d.ts +2 -0
- package/dist/types/primitive/no-results/no-results.d.ts +15 -0
- package/dist/types/primitive/no-results/types.d.ts +30 -0
- package/dist/utils/enforce-subpath-import.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
|
|
1
2
|
# Versaur UI
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
<p align="left">
|
|
5
|
+
<a href="https://www.npmjs.com/package/@dimasbaguspm/versaur" target="_blank" rel="noopener noreferrer">
|
|
6
|
+
<img src="https://img.shields.io/npm/v/%40dimasbaguspm%2Fversaur?style=flat-square&color=%23e07a5f" alt="NPM Version" />
|
|
7
|
+
</a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@dimasbaguspm/versaur" target="_blank" rel="noopener noreferrer">
|
|
9
|
+
<img src="https://img.shields.io/npm/dy/%40dimasbaguspm%2Fversaur?style=flat-square&color=%2381b29a" alt="NPM Downloads" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@dimasbaguspm/versaur" target="_blank" rel="noopener noreferrer">
|
|
12
|
+
<img src="https://img.shields.io/npm/last-update/%40dimasbaguspm%2Fversaur?style=flat-square&color=%2384a5c0" alt="NPM Last Update" />
|
|
13
|
+
</a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
A modern React UI library built with TypeScript and Tailwind CSS, featuring tree-shakable components
|
|
17
|
+
|
|
18
|
+
Website: [versaur.dimasbaguspm.com](https://versaur.dimasbaguspm.com)
|
|
5
19
|
|
|
6
20
|
|
|
7
21
|
## Features
|
|
@@ -19,7 +33,9 @@ components
|
|
|
19
33
|
## Installation
|
|
20
34
|
|
|
21
35
|
```bash
|
|
22
|
-
|
|
36
|
+
npm install @dimasbaguspm/versaur
|
|
37
|
+
yarn add @dimasbaguspm/versaur
|
|
38
|
+
bun add @dimasbaguspm/versaur
|
|
23
39
|
```
|
|
24
40
|
|
|
25
41
|
## Usage
|
|
@@ -27,13 +43,13 @@ yarn install @dimasbaguspm/versaur
|
|
|
27
43
|
### Import all components
|
|
28
44
|
|
|
29
45
|
```tsx
|
|
30
|
-
import { Button, Input,
|
|
46
|
+
import { Button, Input, Drawer } from '@dimasbaguspm/versaur'
|
|
31
47
|
```
|
|
32
48
|
|
|
33
49
|
### Tree-shakable imports
|
|
34
50
|
|
|
35
51
|
```tsx
|
|
36
|
-
//
|
|
52
|
+
// import only what you need
|
|
37
53
|
import { Button } from '@dimasbaguspm/versaur/primitive'
|
|
38
54
|
```
|
|
39
55
|
|
|
@@ -47,7 +63,7 @@ Versaur provides an ESLint rule to enforce sub-path imports for optimal tree-sha
|
|
|
47
63
|
1. In your FlatConfig file (e.g., `eslint.config.js`), import and spread the rule:
|
|
48
64
|
|
|
49
65
|
```js
|
|
50
|
-
// eslint.config.js
|
|
66
|
+
// eslint.config.{js|ts}
|
|
51
67
|
import { versaurEnforceSubpathImport } from '@dimasbaguspm/versaur/enforce-subpath-import'
|
|
52
68
|
|
|
53
69
|
export default [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as i, j as o, a as l } from "./index-DOdDlCoL.js";
|
|
2
|
-
import m, { createContext as
|
|
2
|
+
import m, { createContext as h, useContext as g, forwardRef as d, useRef as R, useEffect as w, useCallback as k } from "react";
|
|
3
3
|
import C from "react-dom";
|
|
4
|
-
const
|
|
4
|
+
const y = h(null);
|
|
5
5
|
function D() {
|
|
6
|
-
const t =
|
|
6
|
+
const t = g(y);
|
|
7
7
|
if (!t)
|
|
8
8
|
throw new Error(
|
|
9
9
|
"Modal components must be used within a ModalRoot component"
|
|
@@ -99,12 +99,14 @@ const E = i(
|
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
101
|
function p(t, a, e) {
|
|
102
|
-
const r =
|
|
103
|
-
return
|
|
102
|
+
const r = R(null);
|
|
103
|
+
return w(() => {
|
|
104
|
+
r.current && r.current.focus();
|
|
105
|
+
}, []), w(() => {
|
|
104
106
|
const n = (s) => {
|
|
105
107
|
s.key === "Escape" && t && r.current && r.current.contains(document.activeElement) && !e && a();
|
|
106
108
|
};
|
|
107
|
-
return t && (document.addEventListener("keydown", n), document.body.style.overflow = "hidden"
|
|
109
|
+
return t && (document.addEventListener("keydown", n), document.body.style.overflow = "hidden"), () => {
|
|
108
110
|
document.removeEventListener("keydown", n), document.body.style.overflow = "unset";
|
|
109
111
|
};
|
|
110
112
|
}, [t, a, e, r]), r;
|
|
@@ -132,7 +134,7 @@ const b = ({
|
|
|
132
134
|
size: e,
|
|
133
135
|
placement: r
|
|
134
136
|
}, f = p(t, a);
|
|
135
|
-
return /* @__PURE__ */ o.jsx(b, { container: s, children: /* @__PURE__ */ o.jsx(
|
|
137
|
+
return /* @__PURE__ */ o.jsx(b, { container: s, children: /* @__PURE__ */ o.jsx(y.Provider, { value: c, children: /* @__PURE__ */ o.jsxs(
|
|
136
138
|
"div",
|
|
137
139
|
{
|
|
138
140
|
className: l(
|
|
@@ -160,9 +162,9 @@ const b = ({
|
|
|
160
162
|
Header: M,
|
|
161
163
|
Body: z,
|
|
162
164
|
Footer: S
|
|
163
|
-
}),
|
|
165
|
+
}), j = h(null);
|
|
164
166
|
function x() {
|
|
165
|
-
const t =
|
|
167
|
+
const t = g(j);
|
|
166
168
|
if (!t)
|
|
167
169
|
throw new Error(
|
|
168
170
|
"Drawer components must be used within a DrawerRoot component"
|
|
@@ -326,19 +328,19 @@ const T = i(
|
|
|
326
328
|
variant: u = "default",
|
|
327
329
|
transitionType: c = "slide",
|
|
328
330
|
className: f,
|
|
329
|
-
...
|
|
331
|
+
...V
|
|
330
332
|
}) => {
|
|
331
333
|
const v = k(() => {
|
|
332
334
|
r(!1);
|
|
333
|
-
}, [r]),
|
|
335
|
+
}, [r]), B = {
|
|
334
336
|
isOpen: e,
|
|
335
337
|
onClose: v,
|
|
336
338
|
position: n,
|
|
337
339
|
size: s,
|
|
338
340
|
variant: u,
|
|
339
341
|
transitionType: c
|
|
340
|
-
},
|
|
341
|
-
return /* @__PURE__ */ o.jsx(b, { container: t, children: /* @__PURE__ */ o.jsx(
|
|
342
|
+
}, N = p(e, v);
|
|
343
|
+
return /* @__PURE__ */ o.jsx(b, { container: t, children: /* @__PURE__ */ o.jsx(j.Provider, { value: B, children: /* @__PURE__ */ o.jsxs(
|
|
342
344
|
"div",
|
|
343
345
|
{
|
|
344
346
|
className: l(
|
|
@@ -350,7 +352,7 @@ const T = i(
|
|
|
350
352
|
/* @__PURE__ */ o.jsx(
|
|
351
353
|
"div",
|
|
352
354
|
{
|
|
353
|
-
ref:
|
|
355
|
+
ref: N,
|
|
354
356
|
tabIndex: -1,
|
|
355
357
|
role: e ? "dialog" : void 0,
|
|
356
358
|
"aria-modal": e ? "true" : void 0,
|
|
@@ -370,7 +372,7 @@ const T = i(
|
|
|
370
372
|
],
|
|
371
373
|
f
|
|
372
374
|
),
|
|
373
|
-
...
|
|
375
|
+
...V,
|
|
374
376
|
children: e && a
|
|
375
377
|
}
|
|
376
378
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as j, j as e, a as p } from "./index-DOdDlCoL.js";
|
|
2
2
|
import x, { createContext as S, useContext as V, useRef as $, forwardRef as I, useState as O, useId as D, useEffect as X, useMemo as P } from "react";
|
|
3
3
|
import { Check as F, Calendar as Y, SearchIcon as Z, Clock as ee, Banknote as re, MailIcon as te } from "lucide-react";
|
|
4
|
-
import { I as z } from "./image-rectangle-
|
|
4
|
+
import { I as z } from "./image-rectangle-C6cgL8R9.js";
|
|
5
5
|
import "./snackbar-DH8jCh2V.js";
|
|
6
6
|
import "./text-CRsIInRA.js";
|
|
7
|
-
import { M, D as E, B as R } from "./bottom-sheet-
|
|
7
|
+
import { M, D as E, B as R } from "./bottom-sheet-Eqduh3eY.js";
|
|
8
8
|
const oe = j("space-y-2", {
|
|
9
9
|
variants: {
|
|
10
10
|
direction: {
|
package/dist/js/forms/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as a, C as n, b as p, a as u, D as s, k as I, E as i, M as l, P as S, R as c, d as r, c as g, S as h, e as o, j as m, i as M, h as b, f as k, T as x, g as C } from "../bottom-sheet-input-
|
|
1
|
+
import { B as a, C as n, b as p, a as u, D as s, k as I, E as i, M as l, P as S, R as c, d as r, c as g, S as h, e as o, j as m, i as M, h as b, f as k, T as x, g as C } from "../bottom-sheet-input-DFGibm1I.js";
|
|
2
2
|
export {
|
|
3
3
|
a as BottomSheetInput,
|
|
4
4
|
n as CheckboxInput,
|