@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 CHANGED
@@ -1,7 +1,21 @@
1
+
1
2
  # Versaur UI
2
3
 
3
- A modern React UI library built with TypeScript and Tailwind CSS, featuring tree-shakable
4
- components
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
- yarn install @dimasbaguspm/versaur
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, Card } from '@dimasbaguspm/versaur'
46
+ import { Button, Input, Drawer } from '@dimasbaguspm/versaur'
31
47
  ```
32
48
 
33
49
  ### Tree-shakable imports
34
50
 
35
51
  ```tsx
36
- // Import only what you need
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 w, useContext as h, forwardRef as d, useRef as N, useEffect as R, useCallback as k } from "react";
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 g = w(null);
4
+ const y = h(null);
5
5
  function D() {
6
- const t = h(g);
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 = N(null);
103
- return R(() => {
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", r.current?.focus()), () => {
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(g.Provider, { value: c, children: /* @__PURE__ */ o.jsxs(
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
- }), y = w(null);
165
+ }), j = h(null);
164
166
  function x() {
165
- const t = h(y);
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
- ...j
331
+ ...V
330
332
  }) => {
331
333
  const v = k(() => {
332
334
  r(!1);
333
- }, [r]), V = {
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
- }, B = p(e, v);
341
- return /* @__PURE__ */ o.jsx(b, { container: t, children: /* @__PURE__ */ o.jsx(y.Provider, { value: V, children: /* @__PURE__ */ o.jsxs(
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: B,
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
- ...j,
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-DH7v2xvp.js";
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-DbtyWwsy.js";
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: {
@@ -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-C7cYfBaK.js";
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,