reaxify 0.0.33 → 0.0.35
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("../../node_modules/react/jsx-runtime.cjs.js"),u=require("react"),d=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const a=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),c=u.createContext({striped:!1,bordered:!1,hover:!1});function h({className:r,children:s,...o}){const e=d(t=>t.table.container.base);return n.jsxRuntimeExports.jsx("div",{className:a.twMerge("w-full overflow-auto",e,r),...o,children:s})}function i({striped:r=!1,bordered:s=!1,hover:o=!1,className:e,children:t,...l}){const x=d(b=>b.table.base);return n.jsxRuntimeExports.jsx("table",{className:a.twMerge("min-w-full border-collapse border-spacing-0",x,e),...l,children:n.jsxRuntimeExports.jsx(c.Provider,{value:{bordered:s,hover:o,striped:r},children:t})})}function j({sticky:r=!1,className:s,children:o,...e}){const t=d(l=>l.table.header);return n.jsxRuntimeExports.jsx("thead",{className:a.twMerge(t==null?void 0:t.base,r&&"sticky top-0 left-0 right-0 z-[2]",r&&(t==null?void 0:t.sticky),s),...e,children:o})}function w({className:r,children:s,...o}){const e=d(t=>t.table.body.base);return n.jsxRuntimeExports.jsx("tbody",{className:a.twMerge(e,r),...o,children:s})}function g({className:r,children:s,...o}){const e=d(
|
|
1
|
+
"use strict";const n=require("../../node_modules/react/jsx-runtime.cjs.js"),u=require("react"),d=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const a=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),c=u.createContext({striped:!1,bordered:!1,hover:!1});function h({className:r,children:s,...o}){const e=d(t=>t.table.container.base);return n.jsxRuntimeExports.jsx("div",{className:a.twMerge("w-full overflow-auto",e,r),...o,children:s})}function i({striped:r=!1,bordered:s=!1,hover:o=!1,className:e,children:t,...l}){const x=d(b=>b.table.base);return n.jsxRuntimeExports.jsx("table",{className:a.twMerge("min-w-full border-collapse border-spacing-0",x,e),...l,children:n.jsxRuntimeExports.jsx(c.Provider,{value:{bordered:s,hover:o,striped:r},children:t})})}function j({sticky:r=!1,className:s,children:o,...e}){const t=d(l=>l.table.header);return n.jsxRuntimeExports.jsx("thead",{className:a.twMerge(t==null?void 0:t.base,r&&"sticky top-0 left-0 right-0 z-[2]",r&&(t==null?void 0:t.sticky),s),...e,children:o})}function w({className:r,children:s,...o}){const e=d(t=>t.table.body.base);return n.jsxRuntimeExports.jsx("tbody",{className:a.twMerge(e,r),...o,children:s})}function g({className:r,children:s,...o}){const e=d(m=>m.table.row),{bordered:t,hover:l,striped:x}=u.useContext(c),b=!!t,f=t==="dashed",p=t==="solid";return n.jsxRuntimeExports.jsx("tr",{className:a.twMerge("bg-white",e==null?void 0:e.base,b&&"border-b border-solid border-[#e8eaee]",f&&"border-dashed",p&&"border-solid",b&&(e==null?void 0:e.bordered),l&&"cursor-pointer transition-colors hover:bg-gray-200",l&&(e==null?void 0:e.hover),x&&"even:bg-gray-100",x&&(e==null?void 0:e.hover),r),...o,children:s})}function R({sticky:r=!1,className:s,children:o,...e}){return n.jsxRuntimeExports.jsx("th",{className:a.twMerge("font-medium text-sm py-2 px-4 whitespace-nowrap text-center first:text-start last:text-end",r&&"bg-inherit sticky end-0 z-[1]",s),...e,children:o})}function y({sticky:r=!1,className:s,children:o,...e}){return n.jsxRuntimeExports.jsx("td",{className:a.twMerge("font-normal text-sm py-2 px-4 whitespace-nowrap text-center first:text-start last:text-end",r&&"bg-inherit sticky end-0 z-[1]",s),...e,children:o})}i.Container=h;i.Header=j;i.Body=w;i.Row=g;i.HeaderCell=R;i.DataCell=y;module.exports=i;
|
|
@@ -71,18 +71,18 @@ function g({ className: r, children: o, ...a }) {
|
|
|
71
71
|
return /* @__PURE__ */ s.jsx("tbody", { className: n(e, r), ...a, children: o });
|
|
72
72
|
}
|
|
73
73
|
function j({ className: r, children: o, ...a }) {
|
|
74
|
-
const e = i((
|
|
74
|
+
const e = i((m) => m.table.row), { bordered: t, hover: l, striped: b } = h(f), c = !!t, u = t === "dashed", x = t === "solid";
|
|
75
75
|
return /* @__PURE__ */ s.jsx(
|
|
76
76
|
"tr",
|
|
77
77
|
{
|
|
78
78
|
className: n(
|
|
79
79
|
"bg-white",
|
|
80
80
|
e == null ? void 0 : e.base,
|
|
81
|
-
c && "border-b border-solid",
|
|
81
|
+
c && "border-b border-solid border-[#e8eaee]",
|
|
82
|
+
u && "border-dashed",
|
|
83
|
+
x && "border-solid",
|
|
82
84
|
c && (e == null ? void 0 : e.bordered),
|
|
83
|
-
|
|
84
|
-
m && "border-solid",
|
|
85
|
-
l && "transition-colors hover:bg-gray-200",
|
|
85
|
+
l && "cursor-pointer transition-colors hover:bg-gray-200",
|
|
86
86
|
l && (e == null ? void 0 : e.hover),
|
|
87
87
|
b && "even:bg-gray-100",
|
|
88
88
|
b && (e == null ? void 0 : e.hover),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("react");function w(n,t){const[u,i]=o.useState(null);return o.useEffect(()=>{const d=e=>n?Array.isArray(n)?n.includes(e):e===n:!1,s=e=>{i(e.key),d(e.key)&&t&&t(e.key)},r=()=>{i(null)};return window.addEventListener("keydown",s),window.addEventListener("keyup",r),window.addEventListener("blur",r),()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",r),window.removeEventListener("blur",r)}},[n,t]),u}module.exports=w;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
export default function useKeyDown(targetKey?: string | string[], callback?: Dispatch<string>): string | null;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
3
|
-
const [
|
|
1
|
+
import { useState as u, useEffect as w } from "react";
|
|
2
|
+
function v(n, t) {
|
|
3
|
+
const [d, o] = u(null);
|
|
4
4
|
return w(() => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
|
|
5
|
+
const s = (e) => n ? Array.isArray(n) ? n.includes(e) : e === n : !1, i = (e) => {
|
|
6
|
+
o(e.key), s(e.key) && t && t(e.key);
|
|
7
|
+
}, r = () => {
|
|
8
|
+
o(null);
|
|
9
9
|
};
|
|
10
|
-
return window.addEventListener("keydown",
|
|
11
|
-
window.removeEventListener("keydown",
|
|
10
|
+
return window.addEventListener("keydown", i), window.addEventListener("keyup", r), window.addEventListener("blur", r), () => {
|
|
11
|
+
window.removeEventListener("keydown", i), window.removeEventListener("keyup", r), window.removeEventListener("blur", r);
|
|
12
12
|
};
|
|
13
|
-
}, []),
|
|
13
|
+
}, [n, t]), d;
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
v as default
|
|
17
17
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reaxify",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.35",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -48,8 +48,7 @@
|
|
|
48
48
|
"dev": "vite",
|
|
49
49
|
"build": "tsc && vite build",
|
|
50
50
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
51
|
-
"
|
|
52
|
-
"release": "npm run build && npm run publish",
|
|
51
|
+
"release": "npm run build && npm version patch --no-git-tag-version --no-commit-hooks && npm publish",
|
|
53
52
|
"preview": "vite preview",
|
|
54
53
|
"storybook": "storybook dev -p 3000",
|
|
55
54
|
"build-storybook": "storybook build"
|