@herca/r-kit 0.0.34 → 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.
- package/dist/components/calendar/index.cjs.map +1 -1
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/counter/index.cjs.map +1 -1
- package/dist/components/counter/index.js.map +1 -1
- package/dist/components/date-picker/index.cjs.map +1 -1
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/form/index.d.cts +2 -2
- package/dist/components/form/index.d.ts +2 -2
- package/dist/components/input/index.cjs.map +1 -1
- package/dist/components/input/index.d.cts +1 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input-file/index.cjs.map +1 -1
- package/dist/components/input-file/index.js.map +1 -1
- package/dist/components/input-otp/index.cjs.map +1 -1
- package/dist/components/input-otp/index.js.map +1 -1
- package/dist/components/sidebar/index.cjs.map +1 -1
- package/dist/components/sidebar/index.js.map +1 -1
- package/dist/components/table/index.cjs.map +1 -1
- package/dist/components/table/index.js.map +1 -1
- package/dist/hooks/use-copy.cjs +18 -0
- package/dist/hooks/use-copy.cjs.map +1 -0
- package/dist/hooks/use-copy.d.cts +6 -0
- package/dist/hooks/use-copy.d.ts +6 -0
- package/dist/hooks/use-copy.js +16 -0
- package/dist/hooks/use-copy.js.map +1 -0
- package/dist/hooks/use-mobile.cjs +43 -0
- package/dist/hooks/use-mobile.cjs.map +1 -0
- package/dist/hooks/use-mobile.d.cts +3 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-copy.ts
|
|
6
|
+
function useCopy() {
|
|
7
|
+
const [copied, setCopied] = react.useState(false);
|
|
8
|
+
const copy = async (text) => {
|
|
9
|
+
await navigator.clipboard.writeText(text);
|
|
10
|
+
setCopied(true);
|
|
11
|
+
setTimeout(() => setCopied(false), 1500);
|
|
12
|
+
};
|
|
13
|
+
return { copy, copied };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.useCopy = useCopy;
|
|
17
|
+
//# sourceMappingURL=use-copy.cjs.map
|
|
18
|
+
//# sourceMappingURL=use-copy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-copy.ts"],"names":["useState"],"mappings":";;;;;AAEO,SAAS,OAAA,GAAU;AACxB,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAIA,eAAS,KAAK,CAAA;AAE1C,EAAA,MAAM,IAAA,GAAO,OAAO,IAAA,KAAiB;AACnC,IAAA,MAAM,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,IAAI,CAAA;AACxC,IAAA,SAAA,CAAU,IAAI,CAAA;AACd,IAAA,UAAA,CAAW,MAAM,SAAA,CAAU,KAAK,CAAA,EAAG,IAAI,CAAA;AAAA,EACzC,CAAA;AAEA,EAAA,OAAO,EAAE,MAAM,MAAA,EAAO;AACxB","file":"use-copy.cjs","sourcesContent":["import { useState } from 'react';\n\nexport function useCopy() {\n const [copied, setCopied] = useState(false);\n\n const copy = async (text: string) => {\n await navigator.clipboard.writeText(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n };\n\n return { copy, copied };\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-copy.ts
|
|
4
|
+
function useCopy() {
|
|
5
|
+
const [copied, setCopied] = useState(false);
|
|
6
|
+
const copy = async (text) => {
|
|
7
|
+
await navigator.clipboard.writeText(text);
|
|
8
|
+
setCopied(true);
|
|
9
|
+
setTimeout(() => setCopied(false), 1500);
|
|
10
|
+
};
|
|
11
|
+
return { copy, copied };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { useCopy };
|
|
15
|
+
//# sourceMappingURL=use-copy.js.map
|
|
16
|
+
//# sourceMappingURL=use-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-copy.ts"],"names":[],"mappings":";;;AAEO,SAAS,OAAA,GAAU;AACxB,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,KAAK,CAAA;AAE1C,EAAA,MAAM,IAAA,GAAO,OAAO,IAAA,KAAiB;AACnC,IAAA,MAAM,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,IAAI,CAAA;AACxC,IAAA,SAAA,CAAU,IAAI,CAAA;AACd,IAAA,UAAA,CAAW,MAAM,SAAA,CAAU,KAAK,CAAA,EAAG,IAAI,CAAA;AAAA,EACzC,CAAA;AAEA,EAAA,OAAO,EAAE,MAAM,MAAA,EAAO;AACxB","file":"use-copy.js","sourcesContent":["import { useState } from 'react';\n\nexport function useCopy() {\n const [copied, setCopied] = useState(false);\n\n const copy = async (text: string) => {\n await navigator.clipboard.writeText(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n };\n\n return { copy, copied };\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
24
|
+
|
|
25
|
+
// src/hooks/use-mobile.ts
|
|
26
|
+
var MOBILE_BREAKPOINT = 768;
|
|
27
|
+
function useIsMobile() {
|
|
28
|
+
const [isMobile, setIsMobile] = React__namespace.useState(false);
|
|
29
|
+
React__namespace.useEffect(() => {
|
|
30
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
31
|
+
const onChange = () => {
|
|
32
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
33
|
+
};
|
|
34
|
+
mql.addEventListener("change", onChange);
|
|
35
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
36
|
+
return () => mql.removeEventListener("change", onChange);
|
|
37
|
+
}, []);
|
|
38
|
+
return !!isMobile;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.useIsMobile = useIsMobile;
|
|
42
|
+
//# sourceMappingURL=use-mobile.cjs.map
|
|
43
|
+
//# sourceMappingURL=use-mobile.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-mobile.ts"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,iBAAA,GAAoB,GAAA;AAEnB,SAAS,WAAA,GAAc;AAC5B,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAUA,0BAAkB,KAAK,CAAA;AAE7D,EAAMA,2BAAU,MAAM;AACpB,IAAA,MAAM,MAAM,MAAA,CAAO,UAAA,CAAW,CAAA,YAAA,EAAe,iBAAA,GAAoB,CAAC,CAAA,GAAA,CAAK,CAAA;AACvE,IAAA,MAAM,WAAW,MAAM;AACrB,MAAA,WAAA,CAAY,MAAA,CAAO,aAAa,iBAAiB,CAAA;AAAA,IACnD,CAAA;AACA,IAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACvC,IAAA,WAAA,CAAY,MAAA,CAAO,aAAa,iBAAiB,CAAA;AACjD,IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AAAA,EACzD,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,CAAC,CAAC,QAAA;AACX","file":"use-mobile.cjs","sourcesContent":["import * as React from 'react';\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean>(false);\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener('change', onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener('change', onChange);\n }, []);\n\n return !!isMobile;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-mobile.ts
|
|
4
|
+
var MOBILE_BREAKPOINT = 768;
|
|
5
|
+
function useIsMobile() {
|
|
6
|
+
const [isMobile, setIsMobile] = React.useState(false);
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
9
|
+
const onChange = () => {
|
|
10
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
11
|
+
};
|
|
12
|
+
mql.addEventListener("change", onChange);
|
|
13
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
14
|
+
return () => mql.removeEventListener("change", onChange);
|
|
15
|
+
}, []);
|
|
16
|
+
return !!isMobile;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { useIsMobile };
|
|
20
|
+
//# sourceMappingURL=use-mobile.js.map
|
|
21
|
+
//# sourceMappingURL=use-mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":";;;AAEA,IAAM,iBAAA,GAAoB,GAAA;AAEnB,SAAS,WAAA,GAAc;AAC5B,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAU,eAAkB,KAAK,CAAA;AAE7D,EAAM,gBAAU,MAAM;AACpB,IAAA,MAAM,MAAM,MAAA,CAAO,UAAA,CAAW,CAAA,YAAA,EAAe,iBAAA,GAAoB,CAAC,CAAA,GAAA,CAAK,CAAA;AACvE,IAAA,MAAM,WAAW,MAAM;AACrB,MAAA,WAAA,CAAY,MAAA,CAAO,aAAa,iBAAiB,CAAA;AAAA,IACnD,CAAA;AACA,IAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACvC,IAAA,WAAA,CAAY,MAAA,CAAO,aAAa,iBAAiB,CAAA;AACjD,IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AAAA,EACzD,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,CAAC,CAAC,QAAA;AACX","file":"use-mobile.js","sourcesContent":["import * as React from 'react';\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean>(false);\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener('change', onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener('change', onChange);\n }, []);\n\n return !!isMobile;\n}\n"]}
|