asterui 0.12.7 → 0.12.8
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/Container.d.ts +7 -1
- package/dist/components/Fieldset.d.ts +6 -0
- package/dist/components/Filter.d.ts +27 -0
- package/dist/components/Grid.d.ts +1 -1
- package/dist/components/Modal.d.ts +7 -2
- package/dist/components/ThemeController.d.ts +12 -4
- package/dist/index.d.ts +4 -2
- package/dist/index.js +167 -165
- package/dist/index.js.map +1 -1
- package/dist/index100.js +44 -11
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +10 -12
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +14 -7
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +7 -12
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +11 -29
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +29 -16
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +21 -0
- package/dist/index106.js.map +1 -0
- package/dist/index18.js +23 -15
- package/dist/index18.js.map +1 -1
- package/dist/index2.js +41 -34
- package/dist/index2.js.map +1 -1
- package/dist/index21.js +1 -1
- package/dist/index25.js +8 -8
- package/dist/index25.js.map +1 -1
- package/dist/index27.js +13 -8
- package/dist/index27.js.map +1 -1
- package/dist/index29.js +50 -61
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +60 -181
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +184 -18
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +15 -217
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +216 -1078
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +1086 -17
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +17 -121
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +119 -37
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +34 -208
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +214 -97
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +93 -158
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +155 -139
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +146 -15
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +15 -17
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +17 -21
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +18 -116
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +116 -10
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +13 -35
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +35 -34
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +34 -116
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +114 -174
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +165 -136
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +146 -11
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +10 -20
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +22 -14
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +14 -7
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +6 -268
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +311 -17
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +17 -122
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +120 -108
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +107 -167
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +167 -29
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +30 -120
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +116 -80
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +85 -19
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +19 -73
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +71 -54
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +56 -44
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +42 -49
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +52 -62
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +56 -101
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +107 -41
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +41 -68
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +66 -19
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +18 -43
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +44 -132
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +132 -50
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +51 -21
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +22 -31
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +31 -22
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +20 -327
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +323 -50
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +56 -40
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +40 -23
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +21 -93
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +88 -123
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +147 -152
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +159 -63
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +65 -35
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +35 -234
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +231 -31
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +34 -210
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +195 -198
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +159 -241
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +283 -166
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +173 -253
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +258 -14
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +12 -31
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +32 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +5 -13
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +11 -43
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index101.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index101.js","sources":["../src/hooks/
|
|
1
|
+
{"version":3,"file":"index101.js","sources":["../src/hooks/useDebounce.ts"],"sourcesContent":["import { useState, useEffect } from 'react'\n\n/**\n * Hook that delays updating a value until after a specified delay.\n * Useful for search inputs to avoid excessive API calls.\n *\n * @param value - Value to debounce\n * @param delay - Delay in milliseconds (default: 300)\n * @returns Debounced value\n *\n * @example\n * const [search, setSearch] = useState('')\n * const debouncedSearch = useDebounce(search, 500)\n *\n * useEffect(() => {\n * // This runs 500ms after user stops typing\n * fetchResults(debouncedSearch)\n * }, [debouncedSearch])\n */\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value)\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n\n return () => {\n clearTimeout(timer)\n }\n }, [value, delay])\n\n return debouncedValue\n}\n"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","useEffect","timer"],"mappings":";AAmBO,SAASA,EAAeC,GAAUC,IAAQ,KAAQ;AACvD,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAYJ,CAAK;AAE7D,SAAAK,EAAU,MAAM;AACd,UAAMC,IAAQ,WAAW,MAAM;AAC7B,MAAAH,EAAkBH,CAAK;AAAA,IACzB,GAAGC,CAAK;AAER,WAAO,MAAM;AACX,mBAAaK,CAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAACN,GAAOC,CAAK,CAAC,GAEVC;AACT;"}
|
package/dist/index102.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useRef as s, useEffect as c } from "react";
|
|
2
|
+
function m(t, n = !0) {
|
|
3
|
+
const r = s(null);
|
|
4
|
+
return c(() => {
|
|
5
|
+
if (!n) return;
|
|
6
|
+
const e = (o) => {
|
|
7
|
+
const u = r.current;
|
|
8
|
+
!u || u.contains(o.target) || t(o);
|
|
9
|
+
};
|
|
10
|
+
return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e), () => {
|
|
11
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
|
|
12
|
+
};
|
|
13
|
+
}, [t, n]), r;
|
|
7
14
|
}
|
|
8
15
|
export {
|
|
9
|
-
|
|
16
|
+
m as useClickOutside
|
|
10
17
|
};
|
|
11
18
|
//# sourceMappingURL=index102.js.map
|
package/dist/index102.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index102.js","sources":["../src/hooks/
|
|
1
|
+
{"version":3,"file":"index102.js","sources":["../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect, useRef, type RefObject } from 'react'\n\n/**\n * Hook that detects clicks outside of a referenced element.\n * Useful for closing dropdowns, modals, or menus.\n *\n * @param handler - Callback when click outside is detected\n * @param enabled - Whether the listener is active (default: true)\n * @returns Ref to attach to the element\n *\n * @example\n * const ref = useClickOutside(() => setIsOpen(false))\n *\n * <div ref={ref}>\n * <Dropdown>...</Dropdown>\n * </div>\n */\nexport function useClickOutside<T extends HTMLElement = HTMLElement>(\n handler: (event: MouseEvent | TouchEvent) => void,\n enabled = true\n): RefObject<T | null> {\n const ref = useRef<T>(null)\n\n useEffect(() => {\n if (!enabled) return\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref.current\n if (!el || el.contains(event.target as Node)) {\n return\n }\n handler(event)\n }\n\n document.addEventListener('mousedown', listener)\n document.addEventListener('touchstart', listener)\n\n return () => {\n document.removeEventListener('mousedown', listener)\n document.removeEventListener('touchstart', listener)\n }\n }, [handler, enabled])\n\n return ref\n}\n"],"names":["useClickOutside","handler","enabled","ref","useRef","useEffect","listener","event","el"],"mappings":";AAiBO,SAASA,EACdC,GACAC,IAAU,IACW;AACrB,QAAMC,IAAMC,EAAU,IAAI;AAE1B,SAAAC,EAAU,MAAM;AACd,QAAI,CAACH,EAAS;AAEd,UAAMI,IAAW,CAACC,MAAmC;AACnD,YAAMC,IAAKL,EAAI;AACf,MAAI,CAACK,KAAMA,EAAG,SAASD,EAAM,MAAc,KAG3CN,EAAQM,CAAK;AAAA,IACf;AAEA,oBAAS,iBAAiB,aAAaD,CAAQ,GAC/C,SAAS,iBAAiB,cAAcA,CAAQ,GAEzC,MAAM;AACX,eAAS,oBAAoB,aAAaA,CAAQ,GAClD,SAAS,oBAAoB,cAAcA,CAAQ;AAAA,IACrD;AAAA,EACF,GAAG,CAACL,GAASC,CAAO,CAAC,GAEdC;AACT;"}
|
package/dist/index103.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function f() {
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const r = () => t(!0), s = () => t(!1);
|
|
8
|
-
return e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", s), () => {
|
|
9
|
-
e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", s);
|
|
10
|
-
};
|
|
11
|
-
}, []), { ref: n, isHovered: o };
|
|
1
|
+
import { useRef as t, useEffect as o } from "react";
|
|
2
|
+
function f(r) {
|
|
3
|
+
const e = t(void 0);
|
|
4
|
+
return o(() => {
|
|
5
|
+
e.current = r;
|
|
6
|
+
}, [r]), e.current;
|
|
12
7
|
}
|
|
13
8
|
export {
|
|
14
|
-
f as
|
|
9
|
+
f as usePrevious
|
|
15
10
|
};
|
|
16
11
|
//# sourceMappingURL=index103.js.map
|
package/dist/index103.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index103.js","sources":["../src/hooks/
|
|
1
|
+
{"version":3,"file":"index103.js","sources":["../src/hooks/usePrevious.ts"],"sourcesContent":["import { useRef, useEffect } from 'react'\n\n/**\n * Hook that returns the previous value of a variable.\n * Useful for comparing current and previous values in effects.\n *\n * @param value - Current value\n * @returns Previous value (undefined on first render)\n *\n * @example\n * const [count, setCount] = useState(0)\n * const prevCount = usePrevious(count)\n *\n * // prevCount is the value from previous render\n * console.log(`Changed from ${prevCount} to ${count}`)\n */\nexport function usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T | undefined>(undefined)\n\n useEffect(() => {\n ref.current = value\n }, [value])\n\n return ref.current\n}\n"],"names":["usePrevious","value","ref","useRef","useEffect"],"mappings":";AAgBO,SAASA,EAAeC,GAAyB;AACtD,QAAMC,IAAMC,EAAsB,MAAS;AAE3C,SAAAC,EAAU,MAAM;AACd,IAAAF,EAAI,UAAUD;AAAA,EAChB,GAAG,CAACA,CAAK,CAAC,GAEHC,EAAI;AACb;"}
|
package/dist/index104.js
CHANGED
|
@@ -1,34 +1,16 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
e.key === n && d(!1);
|
|
11
|
-
},
|
|
12
|
-
[n]
|
|
13
|
-
);
|
|
14
|
-
return l(() => {
|
|
15
|
-
const e = u ?? window;
|
|
16
|
-
return o === "keydown" ? (e.addEventListener("keydown", t), e.addEventListener("keyup", s)) : e.addEventListener("keyup", t), () => {
|
|
17
|
-
e.removeEventListener("keydown", t), e.removeEventListener("keyup", s);
|
|
1
|
+
import { useState as u, useRef as v, useEffect as a } from "react";
|
|
2
|
+
function f() {
|
|
3
|
+
const [o, t] = u(!1), n = v(null);
|
|
4
|
+
return a(() => {
|
|
5
|
+
const e = n.current;
|
|
6
|
+
if (!e) return;
|
|
7
|
+
const r = () => t(!0), s = () => t(!1);
|
|
8
|
+
return e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", s), () => {
|
|
9
|
+
e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", s);
|
|
18
10
|
};
|
|
19
|
-
}, [
|
|
20
|
-
}
|
|
21
|
-
function y(n, f, u = {}) {
|
|
22
|
-
const { target: o, event: r = "keydown", preventDefault: a = !1 } = u;
|
|
23
|
-
l(() => {
|
|
24
|
-
const d = o ?? window, t = (s) => {
|
|
25
|
-
s.key === n && (a && s.preventDefault(), f(s));
|
|
26
|
-
};
|
|
27
|
-
return d.addEventListener(r, t), () => d.removeEventListener(r, t);
|
|
28
|
-
}, [o, n, f, r, a]);
|
|
11
|
+
}, []), { ref: n, isHovered: o };
|
|
29
12
|
}
|
|
30
13
|
export {
|
|
31
|
-
|
|
32
|
-
y as useKeyPressCallback
|
|
14
|
+
f as useHover
|
|
33
15
|
};
|
|
34
16
|
//# sourceMappingURL=index104.js.map
|
package/dist/index104.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index104.js","sources":["../src/hooks/
|
|
1
|
+
{"version":3,"file":"index104.js","sources":["../src/hooks/useHover.ts"],"sourcesContent":["import { useState, useRef, useEffect, type RefObject } from 'react'\n\nexport interface UseHoverReturn<T extends HTMLElement> {\n ref: RefObject<T | null>\n isHovered: boolean\n}\n\n/**\n * Hook that tracks hover state of an element.\n *\n * @returns Object with ref and isHovered state\n *\n * @example\n * const { ref, isHovered } = useHover<HTMLDivElement>()\n *\n * <div ref={ref} className={isHovered ? 'bg-blue-500' : 'bg-gray-500'}>\n * Hover me!\n * </div>\n */\nexport function useHover<T extends HTMLElement = HTMLElement>(): UseHoverReturn<T> {\n const [isHovered, setIsHovered] = useState(false)\n const ref = useRef<T>(null)\n\n useEffect(() => {\n const node = ref.current\n if (!node) return\n\n const handleMouseEnter = () => setIsHovered(true)\n const handleMouseLeave = () => setIsHovered(false)\n\n node.addEventListener('mouseenter', handleMouseEnter)\n node.addEventListener('mouseleave', handleMouseLeave)\n\n return () => {\n node.removeEventListener('mouseenter', handleMouseEnter)\n node.removeEventListener('mouseleave', handleMouseLeave)\n }\n }, [])\n\n return { ref, isHovered }\n}\n"],"names":["useHover","isHovered","setIsHovered","useState","ref","useRef","useEffect","node","handleMouseEnter","handleMouseLeave"],"mappings":";AAmBO,SAASA,IAAmE;AACjF,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1CC,IAAMC,EAAU,IAAI;AAE1B,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAOH,EAAI;AACjB,QAAI,CAACG,EAAM;AAEX,UAAMC,IAAmB,MAAMN,EAAa,EAAI,GAC1CO,IAAmB,MAAMP,EAAa,EAAK;AAEjD,WAAAK,EAAK,iBAAiB,cAAcC,CAAgB,GACpDD,EAAK,iBAAiB,cAAcE,CAAgB,GAE7C,MAAM;AACX,MAAAF,EAAK,oBAAoB,cAAcC,CAAgB,GACvDD,EAAK,oBAAoB,cAAcE,CAAgB;AAAA,IACzD;AAAA,EACF,GAAG,CAAA,CAAE,GAEE,EAAE,KAAAL,GAAK,WAAAH,EAAA;AAChB;"}
|
package/dist/index105.js
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
n(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useState as v, useCallback as i, useEffect as l } from "react";
|
|
2
|
+
function c(n, f = {}) {
|
|
3
|
+
const { target: u, event: o = "keydown", preventDefault: r = !1 } = f, [a, d] = v(!1), t = i(
|
|
4
|
+
(e) => {
|
|
5
|
+
e.key === n && (r && e.preventDefault(), d(!0));
|
|
6
|
+
},
|
|
7
|
+
[n, r]
|
|
8
|
+
), s = i(
|
|
9
|
+
(e) => {
|
|
10
|
+
e.key === n && d(!1);
|
|
11
|
+
},
|
|
12
|
+
[n]
|
|
13
|
+
);
|
|
14
|
+
return l(() => {
|
|
15
|
+
const e = u ?? window;
|
|
16
|
+
return o === "keydown" ? (e.addEventListener("keydown", t), e.addEventListener("keyup", s)) : e.addEventListener("keyup", t), () => {
|
|
17
|
+
e.removeEventListener("keydown", t), e.removeEventListener("keyup", s);
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
}, [u, o, t, s]), a;
|
|
20
|
+
}
|
|
21
|
+
function y(n, f, u = {}) {
|
|
22
|
+
const { target: o, event: r = "keydown", preventDefault: a = !1 } = u;
|
|
23
|
+
l(() => {
|
|
24
|
+
const d = o ?? window, t = (s) => {
|
|
25
|
+
s.key === n && (a && s.preventDefault(), f(s));
|
|
26
|
+
};
|
|
27
|
+
return d.addEventListener(r, t), () => d.removeEventListener(r, t);
|
|
28
|
+
}, [o, n, f, r, a]);
|
|
17
29
|
}
|
|
18
30
|
export {
|
|
19
|
-
|
|
31
|
+
c as useKeyPress,
|
|
32
|
+
y as useKeyPressCallback
|
|
20
33
|
};
|
|
21
34
|
//# sourceMappingURL=index105.js.map
|
package/dist/index105.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index105.js","sources":["../src/hooks/
|
|
1
|
+
{"version":3,"file":"index105.js","sources":["../src/hooks/useKeyPress.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\n\nexport interface UseKeyPressOptions {\n /** Target element (default: window) */\n target?: HTMLElement | Window | null\n /** Event type: 'keydown' | 'keyup' (default: 'keydown') */\n event?: 'keydown' | 'keyup'\n /** Prevent default browser behavior */\n preventDefault?: boolean\n}\n\n/**\n * Hook that detects when a specific key is pressed.\n *\n * @param targetKey - Key to detect (e.g., 'Enter', 'Escape', 'a')\n * @param options - Configuration options\n * @returns Whether the key is currently pressed\n *\n * @example\n * const enterPressed = useKeyPress('Enter')\n * const escapePressed = useKeyPress('Escape')\n *\n * useEffect(() => {\n * if (escapePressed) closeModal()\n * }, [escapePressed])\n *\n * @example\n * // With callback for immediate action\n * useKeyPress('Escape', { preventDefault: true })\n */\nexport function useKeyPress(\n targetKey: string,\n options: UseKeyPressOptions = {}\n): boolean {\n const { target, event = 'keydown', preventDefault = false } = options\n const [keyPressed, setKeyPressed] = useState(false)\n\n const downHandler = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n if (preventDefault) e.preventDefault()\n setKeyPressed(true)\n }\n },\n [targetKey, preventDefault]\n )\n\n const upHandler = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n setKeyPressed(false)\n }\n },\n [targetKey]\n )\n\n useEffect(() => {\n const targetElement = target ?? window\n\n if (event === 'keydown') {\n targetElement.addEventListener('keydown', downHandler as EventListener)\n targetElement.addEventListener('keyup', upHandler as EventListener)\n } else {\n targetElement.addEventListener('keyup', downHandler as EventListener)\n }\n\n return () => {\n targetElement.removeEventListener('keydown', downHandler as EventListener)\n targetElement.removeEventListener('keyup', upHandler as EventListener)\n }\n }, [target, event, downHandler, upHandler])\n\n return keyPressed\n}\n\n/**\n * Hook that calls a callback when a specific key is pressed.\n *\n * @param targetKey - Key to detect\n * @param callback - Function to call when key is pressed\n * @param options - Configuration options\n *\n * @example\n * useKeyPressCallback('Escape', () => closeModal())\n * useKeyPressCallback('Enter', () => submitForm(), { preventDefault: true })\n */\nexport function useKeyPressCallback(\n targetKey: string,\n callback: (event: KeyboardEvent) => void,\n options: UseKeyPressOptions = {}\n): void {\n const { target, event = 'keydown', preventDefault = false } = options\n\n useEffect(() => {\n const targetElement = target ?? window\n\n const handler = (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n if (preventDefault) e.preventDefault()\n callback(e)\n }\n }\n\n targetElement.addEventListener(event, handler as EventListener)\n return () => targetElement.removeEventListener(event, handler as EventListener)\n }, [target, targetKey, callback, event, preventDefault])\n}\n"],"names":["useKeyPress","targetKey","options","target","event","preventDefault","keyPressed","setKeyPressed","useState","downHandler","useCallback","upHandler","useEffect","targetElement","useKeyPressCallback","callback","handler","e"],"mappings":";AA8BO,SAASA,EACdC,GACAC,IAA8B,IACrB;AACT,QAAM,EAAE,QAAAC,GAAQ,OAAAC,IAAQ,WAAW,gBAAAC,IAAiB,OAAUH,GACxD,CAACI,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAE5CC,IAAcC;AAAA,IAClB,CAAC,MAAqB;AACpB,MAAI,EAAE,QAAQT,MACRI,OAAkB,eAAA,GACtBE,EAAc,EAAI;AAAA,IAEtB;AAAA,IACA,CAACN,GAAWI,CAAc;AAAA,EAAA,GAGtBM,IAAYD;AAAA,IAChB,CAAC,MAAqB;AACpB,MAAI,EAAE,QAAQT,KACZM,EAAc,EAAK;AAAA,IAEvB;AAAA,IACA,CAACN,CAAS;AAAA,EAAA;AAGZ,SAAAW,EAAU,MAAM;AACd,UAAMC,IAAgBV,KAAU;AAEhC,WAAIC,MAAU,aACZS,EAAc,iBAAiB,WAAWJ,CAA4B,GACtEI,EAAc,iBAAiB,SAASF,CAA0B,KAElEE,EAAc,iBAAiB,SAASJ,CAA4B,GAG/D,MAAM;AACX,MAAAI,EAAc,oBAAoB,WAAWJ,CAA4B,GACzEI,EAAc,oBAAoB,SAASF,CAA0B;AAAA,IACvE;AAAA,EACF,GAAG,CAACR,GAAQC,GAAOK,GAAaE,CAAS,CAAC,GAEnCL;AACT;AAaO,SAASQ,EACdb,GACAc,GACAb,IAA8B,CAAA,GACxB;AACN,QAAM,EAAE,QAAAC,GAAQ,OAAAC,IAAQ,WAAW,gBAAAC,IAAiB,OAAUH;AAE9D,EAAAU,EAAU,MAAM;AACd,UAAMC,IAAgBV,KAAU,QAE1Ba,IAAU,CAACC,MAAqB;AACpC,MAAIA,EAAE,QAAQhB,MACRI,OAAkB,eAAA,GACtBU,EAASE,CAAC;AAAA,IAEd;AAEA,WAAAJ,EAAc,iBAAiBT,GAAOY,CAAwB,GACvD,MAAMH,EAAc,oBAAoBT,GAAOY,CAAwB;AAAA,EAChF,GAAG,CAACb,GAAQF,GAAWc,GAAUX,GAAOC,CAAc,CAAC;AACzD;"}
|
package/dist/index106.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useState as t, useEffect as d } from "react";
|
|
2
|
+
function r() {
|
|
3
|
+
const [i, n] = t(() => typeof window > "u" ? { width: 0, height: 0 } : {
|
|
4
|
+
width: window.innerWidth,
|
|
5
|
+
height: window.innerHeight
|
|
6
|
+
});
|
|
7
|
+
return d(() => {
|
|
8
|
+
if (typeof window > "u") return;
|
|
9
|
+
const e = () => {
|
|
10
|
+
n({
|
|
11
|
+
width: window.innerWidth,
|
|
12
|
+
height: window.innerHeight
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
16
|
+
}, []), i;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
r as useWindowSize
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index106.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index106.js","sources":["../src/hooks/useWindowSize.ts"],"sourcesContent":["import { useState, useEffect } from 'react'\n\nexport interface WindowSize {\n width: number\n height: number\n}\n\n/**\n * Hook that tracks window dimensions.\n * Updates on window resize.\n *\n * @returns Object with current width and height\n *\n * @example\n * const { width, height } = useWindowSize()\n *\n * return (\n * <div>\n * Window: {width} x {height}\n * {width < 768 && <MobileNav />}\n * </div>\n * )\n */\nexport function useWindowSize(): WindowSize {\n const [windowSize, setWindowSize] = useState<WindowSize>(() => {\n if (typeof window === 'undefined') {\n return { width: 0, height: 0 }\n }\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n }\n })\n\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const handleResize = () => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n }\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [])\n\n return windowSize\n}\n"],"names":["useWindowSize","windowSize","setWindowSize","useState","useEffect","handleResize"],"mappings":";AAuBO,SAASA,IAA4B;AAC1C,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAqB,MACnD,OAAO,SAAW,MACb,EAAE,OAAO,GAAG,QAAQ,EAAA,IAEtB;AAAA,IACL,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,EAAA,CAElB;AAED,SAAAC,EAAU,MAAM;AACd,QAAI,OAAO,SAAW,IAAa;AAEnC,UAAMC,IAAe,MAAM;AACzB,MAAAH,EAAc;AAAA,QACZ,OAAO,OAAO;AAAA,QACd,QAAQ,OAAO;AAAA,MAAA,CAChB;AAAA,IACH;AAEA,kBAAO,iBAAiB,UAAUG,CAAY,GACvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAChE,GAAG,CAAA,CAAE,GAEEJ;AACT;"}
|
package/dist/index18.js
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
const o = {
|
|
3
|
+
sm: "max-w-screen-sm",
|
|
4
|
+
md: "max-w-screen-md",
|
|
5
|
+
lg: "max-w-screen-lg",
|
|
6
|
+
xl: "max-w-screen-xl",
|
|
7
|
+
"2xl": "max-w-screen-2xl",
|
|
8
|
+
full: "max-w-full"
|
|
9
|
+
}, c = ({
|
|
10
|
+
children: e,
|
|
11
|
+
size: s = "xl",
|
|
12
|
+
centered: l = !0,
|
|
13
|
+
padding: x = !0,
|
|
14
|
+
className: m = "",
|
|
15
|
+
...r
|
|
7
16
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return /* @__PURE__ */ e("div", { className: m, ...a, children: s });
|
|
17
|
+
const a = [
|
|
18
|
+
o[s],
|
|
19
|
+
l && "mx-auto",
|
|
20
|
+
x && "px-4 sm:px-6 lg:px-8",
|
|
21
|
+
m
|
|
22
|
+
].filter(Boolean).join(" ");
|
|
23
|
+
return /* @__PURE__ */ n("div", { className: a, ...r, children: e });
|
|
16
24
|
};
|
|
17
25
|
export {
|
|
18
|
-
|
|
26
|
+
c as Container
|
|
19
27
|
};
|
|
20
28
|
//# sourceMappingURL=index18.js.map
|
package/dist/index18.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index18.js","sources":["../src/components/Container.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'full'\n
|
|
1
|
+
{"version":3,"file":"index18.js","sources":["../src/components/Container.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Container content */\n children: React.ReactNode\n /** Max width size */\n size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'\n /** Center container horizontally */\n centered?: boolean\n /** Add horizontal padding */\n padding?: boolean\n}\n\nconst sizeClasses: Record<string, string> = {\n sm: 'max-w-screen-sm',\n md: 'max-w-screen-md',\n lg: 'max-w-screen-lg',\n xl: 'max-w-screen-xl',\n '2xl': 'max-w-screen-2xl',\n full: 'max-w-full',\n}\n\nexport const Container: React.FC<ContainerProps> = ({\n children,\n size = 'xl',\n centered = true,\n padding = true,\n className = '',\n ...rest\n}) => {\n const classes = [\n sizeClasses[size],\n centered && 'mx-auto',\n padding && 'px-4 sm:px-6 lg:px-8',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n"],"names":["sizeClasses","Container","children","size","centered","padding","className","rest","classes"],"mappings":";AAaA,MAAMA,IAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AACR,GAEaC,IAAsC,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAU;AAAA,IACdR,EAAYG,CAAI;AAAA,IAChBC,KAAY;AAAA,IACZC,KAAW;AAAA,IACXC;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAAO,UAAAL,GAAS;AACtD;"}
|
package/dist/index2.js
CHANGED
|
@@ -1,50 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
4
|
-
children:
|
|
5
|
-
offsetTop:
|
|
6
|
-
offsetBottom:
|
|
7
|
-
target:
|
|
8
|
-
onChange:
|
|
9
|
-
className:
|
|
10
|
-
...
|
|
1
|
+
import { jsx as u, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as S, useEffect as b } from "react";
|
|
3
|
+
const j = ({
|
|
4
|
+
children: a,
|
|
5
|
+
offsetTop: t,
|
|
6
|
+
offsetBottom: i,
|
|
7
|
+
target: m,
|
|
8
|
+
onChange: h,
|
|
9
|
+
className: x = "",
|
|
10
|
+
...v
|
|
11
11
|
}) => {
|
|
12
|
-
const [r,
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const [r, R] = w(!1), [z, y] = w({}), [A, g] = w({}), l = S(null), d = S(null), o = !!m;
|
|
13
|
+
return b(() => {
|
|
14
|
+
if (o)
|
|
15
|
+
return;
|
|
16
|
+
const c = window, n = () => {
|
|
17
|
+
if (!l.current || !d.current) return;
|
|
18
|
+
const s = l.current.getBoundingClientRect(), p = d.current.getBoundingClientRect();
|
|
19
|
+
let e = !1, f = {};
|
|
20
|
+
if (t !== void 0)
|
|
21
|
+
e = s.top < t, e && (f = {
|
|
20
22
|
position: "fixed",
|
|
21
|
-
top:
|
|
22
|
-
width:
|
|
23
|
+
top: t,
|
|
24
|
+
width: s.width,
|
|
23
25
|
zIndex: 100
|
|
24
26
|
});
|
|
25
|
-
else if (
|
|
27
|
+
else if (i !== void 0) {
|
|
26
28
|
const E = window.innerHeight;
|
|
27
|
-
e =
|
|
29
|
+
e = s.bottom > E - i, e && (f = {
|
|
28
30
|
position: "fixed",
|
|
29
|
-
bottom:
|
|
30
|
-
width:
|
|
31
|
+
bottom: i,
|
|
32
|
+
width: s.width,
|
|
31
33
|
zIndex: 100
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
|
-
e !== r && (
|
|
35
|
-
width:
|
|
36
|
-
height:
|
|
37
|
-
}),
|
|
36
|
+
e !== r && (R(e), h?.(e)), e ? (y({
|
|
37
|
+
width: p.width,
|
|
38
|
+
height: p.height
|
|
39
|
+
}), g(f)) : (y({}), g({}));
|
|
38
40
|
};
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
+
return c.addEventListener("scroll", n), window.addEventListener("resize", n), n(), () => {
|
|
42
|
+
c.removeEventListener("scroll", n), window.removeEventListener("resize", n);
|
|
41
43
|
};
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
}, [o, t, i, r, h]), o ? /* @__PURE__ */ u("div", { className: x, style: {
|
|
45
|
+
position: "sticky",
|
|
46
|
+
top: t,
|
|
47
|
+
bottom: i,
|
|
48
|
+
zIndex: 100
|
|
49
|
+
}, ...v, children: a }) : /* @__PURE__ */ L("div", { ref: l, className: x, "data-state": r ? "affixed" : "normal", ...v, children: [
|
|
50
|
+
r && /* @__PURE__ */ u("div", { style: z }),
|
|
51
|
+
/* @__PURE__ */ u("div", { ref: d, style: A, children: a })
|
|
45
52
|
] });
|
|
46
53
|
};
|
|
47
54
|
export {
|
|
48
|
-
|
|
55
|
+
j as Affix
|
|
49
56
|
};
|
|
50
57
|
//# sourceMappingURL=index2.js.map
|
package/dist/index2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":["../src/components/Affix.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react'\n\nexport interface AffixProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Content to make sticky */\n children: React.ReactNode\n /** Offset from top when fixed (pixels) */\n offsetTop?: number\n /** Offset from bottom when fixed (pixels) */\n offsetBottom?: number\n /** Scroll target (default: window) */\n target?: () => HTMLElement | Window\n /** Callback when affix state changes */\n onChange?: (affixed: boolean) => void\n}\n\nexport const Affix: React.FC<AffixProps> = ({\n children,\n offsetTop,\n offsetBottom,\n target,\n onChange,\n className = '',\n ...rest\n}) => {\n const [affixed, setAffixed] = useState(false)\n const [placeholderStyle, setPlaceholderStyle] = useState<React.CSSProperties>({})\n const [affixStyle, setAffixStyle] = useState<React.CSSProperties>({})\n const wrapperRef = useRef<HTMLDivElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n
|
|
1
|
+
{"version":3,"file":"index2.js","sources":["../src/components/Affix.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react'\n\nexport interface AffixProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Content to make sticky */\n children: React.ReactNode\n /** Offset from top when fixed (pixels) */\n offsetTop?: number\n /** Offset from bottom when fixed (pixels) */\n offsetBottom?: number\n /** Scroll target (default: window) */\n target?: () => HTMLElement | Window\n /** Callback when affix state changes */\n onChange?: (affixed: boolean) => void\n}\n\nexport const Affix: React.FC<AffixProps> = ({\n children,\n offsetTop,\n offsetBottom,\n target,\n onChange,\n className = '',\n ...rest\n}) => {\n const [affixed, setAffixed] = useState(false)\n const [placeholderStyle, setPlaceholderStyle] = useState<React.CSSProperties>({})\n const [affixStyle, setAffixStyle] = useState<React.CSSProperties>({})\n const wrapperRef = useRef<HTMLDivElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n\n // For custom targets, use CSS sticky positioning\n const hasCustomTarget = !!target\n\n useEffect(() => {\n // For custom targets, use CSS sticky - no JS needed for positioning\n if (hasCustomTarget) {\n return\n }\n\n const scrollTarget = window\n\n const handleScroll = () => {\n if (!wrapperRef.current || !contentRef.current) return\n\n const rect = wrapperRef.current.getBoundingClientRect()\n const contentRect = contentRef.current.getBoundingClientRect()\n\n let shouldAffix = false\n let newAffixStyle: React.CSSProperties = {}\n\n if (offsetTop !== undefined) {\n // Affix to top\n shouldAffix = rect.top < offsetTop\n if (shouldAffix) {\n newAffixStyle = {\n position: 'fixed',\n top: offsetTop,\n width: rect.width,\n zIndex: 100,\n }\n }\n } else if (offsetBottom !== undefined) {\n // Affix to bottom\n const viewportHeight = window.innerHeight\n shouldAffix = rect.bottom > viewportHeight - offsetBottom\n if (shouldAffix) {\n newAffixStyle = {\n position: 'fixed',\n bottom: offsetBottom,\n width: rect.width,\n zIndex: 100,\n }\n }\n }\n\n if (shouldAffix !== affixed) {\n setAffixed(shouldAffix)\n onChange?.(shouldAffix)\n }\n\n if (shouldAffix) {\n setPlaceholderStyle({\n width: contentRect.width,\n height: contentRect.height,\n })\n setAffixStyle(newAffixStyle)\n } else {\n setPlaceholderStyle({})\n setAffixStyle({})\n }\n }\n\n scrollTarget.addEventListener('scroll', handleScroll)\n window.addEventListener('resize', handleScroll)\n handleScroll()\n\n return () => {\n scrollTarget.removeEventListener('scroll', handleScroll)\n window.removeEventListener('resize', handleScroll)\n }\n }, [hasCustomTarget, offsetTop, offsetBottom, affixed, onChange])\n\n // For custom scroll containers, use CSS sticky\n if (hasCustomTarget) {\n const stickyStyle: React.CSSProperties = {\n position: 'sticky',\n top: offsetTop,\n bottom: offsetBottom,\n zIndex: 100,\n }\n\n return (\n <div className={className} style={stickyStyle} {...rest}>\n {children}\n </div>\n )\n }\n\n // For window scrolling, use fixed positioning with JS\n return (\n <div ref={wrapperRef} className={className} data-state={affixed ? 'affixed' : 'normal'} {...rest}>\n {affixed && <div style={placeholderStyle} />}\n <div ref={contentRef} style={affixStyle}>\n {children}\n </div>\n </div>\n )\n}\n"],"names":["Affix","children","offsetTop","offsetBottom","target","onChange","className","rest","affixed","setAffixed","useState","placeholderStyle","setPlaceholderStyle","affixStyle","setAffixStyle","wrapperRef","useRef","contentRef","hasCustomTarget","useEffect","scrollTarget","handleScroll","rect","contentRect","shouldAffix","newAffixStyle","viewportHeight","jsxs","jsx"],"mappings":";;AAeO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtC,CAACC,GAAkBC,CAAmB,IAAIF,EAA8B,CAAA,CAAE,GAC1E,CAACG,GAAYC,CAAa,IAAIJ,EAA8B,CAAA,CAAE,GAC9DK,IAAaC,EAAuB,IAAI,GACxCC,IAAaD,EAAuB,IAAI,GAGxCE,IAAkB,CAAC,CAACd;AAwE1B,SAtEAe,EAAU,MAAM;AAEd,QAAID;AACF;AAGF,UAAME,IAAe,QAEfC,IAAe,MAAM;AACzB,UAAI,CAACN,EAAW,WAAW,CAACE,EAAW,QAAS;AAEhD,YAAMK,IAAOP,EAAW,QAAQ,sBAAA,GAC1BQ,IAAcN,EAAW,QAAQ,sBAAA;AAEvC,UAAIO,IAAc,IACdC,IAAqC,CAAA;AAEzC,UAAIvB,MAAc;AAEhB,QAAAsB,IAAcF,EAAK,MAAMpB,GACrBsB,MACFC,IAAgB;AAAA,UACd,UAAU;AAAA,UACV,KAAKvB;AAAA,UACL,OAAOoB,EAAK;AAAA,UACZ,QAAQ;AAAA,QAAA;AAAA,eAGHnB,MAAiB,QAAW;AAErC,cAAMuB,IAAiB,OAAO;AAC9B,QAAAF,IAAcF,EAAK,SAASI,IAAiBvB,GACzCqB,MACFC,IAAgB;AAAA,UACd,UAAU;AAAA,UACV,QAAQtB;AAAA,UACR,OAAOmB,EAAK;AAAA,UACZ,QAAQ;AAAA,QAAA;AAAA,MAGd;AAEA,MAAIE,MAAgBhB,MAClBC,EAAWe,CAAW,GACtBnB,IAAWmB,CAAW,IAGpBA,KACFZ,EAAoB;AAAA,QAClB,OAAOW,EAAY;AAAA,QACnB,QAAQA,EAAY;AAAA,MAAA,CACrB,GACDT,EAAcW,CAAa,MAE3Bb,EAAoB,CAAA,CAAE,GACtBE,EAAc,CAAA,CAAE;AAAA,IAEpB;AAEA,WAAAM,EAAa,iBAAiB,UAAUC,CAAY,GACpD,OAAO,iBAAiB,UAAUA,CAAY,GAC9CA,EAAA,GAEO,MAAM;AACX,MAAAD,EAAa,oBAAoB,UAAUC,CAAY,GACvD,OAAO,oBAAoB,UAAUA,CAAY;AAAA,IACnD;AAAA,EACF,GAAG,CAACH,GAAiBhB,GAAWC,GAAcK,GAASH,CAAQ,CAAC,GAG5Da,sBASC,OAAA,EAAI,WAAAZ,GAAsB,OARY;AAAA,IACvC,UAAU;AAAA,IACV,KAAKJ;AAAA,IACL,QAAQC;AAAA,IACR,QAAQ;AAAA,EAAA,GAIwC,GAAGI,GAChD,UAAAN,GACH,IAMF,gBAAA0B,EAAC,OAAA,EAAI,KAAKZ,GAAY,WAAAT,GAAsB,cAAYE,IAAU,YAAY,UAAW,GAAGD,GACzF,UAAA;AAAA,IAAAC,KAAW,gBAAAoB,EAAC,OAAA,EAAI,OAAOjB,EAAA,CAAkB;AAAA,sBACzC,OAAA,EAAI,KAAKM,GAAY,OAAOJ,GAC1B,UAAAZ,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
|
package/dist/index21.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useState as h, useRef as j, useEffect as y } from "react";
|
|
3
|
-
import { Input as T } from "./
|
|
3
|
+
import { Input as T } from "./index40.js";
|
|
4
4
|
const $ = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], I = [
|
|
5
5
|
"January",
|
|
6
6
|
"February",
|
package/dist/index25.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
function l({
|
|
3
3
|
children: r,
|
|
4
4
|
orientation: e = "horizontal",
|
|
@@ -7,11 +7,11 @@ function l({
|
|
|
7
7
|
className: n = "",
|
|
8
8
|
...s
|
|
9
9
|
}) {
|
|
10
|
-
const
|
|
10
|
+
const o = {
|
|
11
11
|
start: "divider-start",
|
|
12
12
|
center: "",
|
|
13
13
|
end: "divider-end"
|
|
14
|
-
},
|
|
14
|
+
}, t = {
|
|
15
15
|
neutral: "divider-neutral",
|
|
16
16
|
primary: "divider-primary",
|
|
17
17
|
secondary: "divider-secondary",
|
|
@@ -20,14 +20,14 @@ function l({
|
|
|
20
20
|
warning: "divider-warning",
|
|
21
21
|
info: "divider-info",
|
|
22
22
|
error: "divider-error"
|
|
23
|
-
},
|
|
23
|
+
}, a = [
|
|
24
24
|
"divider",
|
|
25
|
-
e === "vertical" && "divider-
|
|
26
|
-
|
|
27
|
-
i &&
|
|
25
|
+
e === "vertical" && "divider-horizontal",
|
|
26
|
+
o[d],
|
|
27
|
+
i && t[i],
|
|
28
28
|
n
|
|
29
29
|
].filter(Boolean).join(" ");
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ c("div", { className: a, ...s, children: r });
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
33
|
l as Divider
|
package/dist/index25.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index25.js","sources":["../src/components/Divider.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode\n orientation?: 'horizontal' | 'vertical'\n position?: 'start' | 'center' | 'end'\n type?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'success' | 'warning' | 'info' | 'error'\n}\n\nexport function Divider({\n children,\n orientation = 'horizontal',\n position = 'center',\n type,\n className = '',\n ...rest\n}: DividerProps) {\n const positionClasses: Record<string, string> = {\n start: 'divider-start',\n center: '',\n end: 'divider-end',\n }\n\n const typeClasses: Record<string, string> = {\n neutral: 'divider-neutral',\n primary: 'divider-primary',\n secondary: 'divider-secondary',\n accent: 'divider-accent',\n success: 'divider-success',\n warning: 'divider-warning',\n info: 'divider-info',\n error: 'divider-error',\n }\n\n const classes = [\n 'divider',\n orientation === 'vertical' && 'divider-
|
|
1
|
+
{"version":3,"file":"index25.js","sources":["../src/components/Divider.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode\n orientation?: 'horizontal' | 'vertical'\n position?: 'start' | 'center' | 'end'\n type?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'success' | 'warning' | 'info' | 'error'\n}\n\nexport function Divider({\n children,\n orientation = 'horizontal',\n position = 'center',\n type,\n className = '',\n ...rest\n}: DividerProps) {\n const positionClasses: Record<string, string> = {\n start: 'divider-start',\n center: '',\n end: 'divider-end',\n }\n\n const typeClasses: Record<string, string> = {\n neutral: 'divider-neutral',\n primary: 'divider-primary',\n secondary: 'divider-secondary',\n accent: 'divider-accent',\n success: 'divider-success',\n warning: 'divider-warning',\n info: 'divider-info',\n error: 'divider-error',\n }\n\n const classes = [\n 'divider',\n orientation === 'vertical' && 'divider-horizontal',\n positionClasses[position],\n type && typeClasses[type],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n"],"names":["Divider","children","orientation","position","type","className","rest","positionClasses","typeClasses","classes"],"mappings":";AASO,SAASA,EAAQ;AAAA,EACtB,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAiB;AACf,QAAMC,IAA0C;AAAA,IAC9C,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,KAAK;AAAA,EAAA,GAGDC,IAAsC;AAAA,IAC1C,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,GAGHC,IAAU;AAAA,IACd;AAAA,IACAP,MAAgB,cAAc;AAAA,IAC9BK,EAAgBJ,CAAQ;AAAA,IACxBC,KAAQI,EAAYJ,CAAI;AAAA,IACxBC;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWI,GAAU,GAAGH,GAAO,UAAAL,GAAS;AACtD;"}
|
package/dist/index27.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
function i({ children: e, className: s = "", ...
|
|
3
|
-
const
|
|
4
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
function i({ children: e, className: s = "", ...l }) {
|
|
3
|
+
const t = ["fieldset", s].filter(Boolean).join(" ");
|
|
4
|
+
return /* @__PURE__ */ n("fieldset", { className: t, ...l, children: e });
|
|
5
5
|
}
|
|
6
6
|
function o({ children: e, className: s = "" }) {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ n("legend", { className: `fieldset-legend ${s}`, children: e });
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
function a({ children: e, className: s = "", ...l }) {
|
|
10
|
+
const t = ["fieldset-label", s].filter(Boolean).join(" ");
|
|
11
|
+
return /* @__PURE__ */ n("label", { className: t, ...l, children: e });
|
|
12
|
+
}
|
|
13
|
+
const d = Object.assign(i, {
|
|
14
|
+
Legend: o,
|
|
15
|
+
Label: a
|
|
11
16
|
});
|
|
12
17
|
export {
|
|
13
|
-
|
|
18
|
+
d as Fieldset
|
|
14
19
|
};
|
|
15
20
|
//# sourceMappingURL=index27.js.map
|
package/dist/index27.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index27.js","sources":["../src/components/Fieldset.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {\n children: React.ReactNode\n className?: string\n}\n\nexport interface FieldsetLegendProps {\n children: React.ReactNode\n className?: string\n}\n\nfunction FieldsetRoot({ children, className = '', ...props }: FieldsetProps) {\n const classes = ['fieldset', className].filter(Boolean).join(' ')\n\n return (\n <fieldset className={classes} {...props}>\n {children}\n </fieldset>\n )\n}\n\nfunction FieldsetLegend({ children, className = '' }: FieldsetLegendProps) {\n return <legend className={`fieldset-legend ${className}`}>{children}</legend>\n}\n\nexport const Fieldset = Object.assign(FieldsetRoot, {\n Legend: FieldsetLegend,\n})\n"],"names":["FieldsetRoot","children","className","props","classes","FieldsetLegend","Fieldset"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index27.js","sources":["../src/components/Fieldset.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {\n children: React.ReactNode\n className?: string\n}\n\nexport interface FieldsetLegendProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface FieldsetLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n children: React.ReactNode\n className?: string\n}\n\nfunction FieldsetRoot({ children, className = '', ...props }: FieldsetProps) {\n const classes = ['fieldset', className].filter(Boolean).join(' ')\n\n return (\n <fieldset className={classes} {...props}>\n {children}\n </fieldset>\n )\n}\n\nfunction FieldsetLegend({ children, className = '' }: FieldsetLegendProps) {\n return <legend className={`fieldset-legend ${className}`}>{children}</legend>\n}\n\nfunction FieldsetLabel({ children, className = '', ...props }: FieldsetLabelProps) {\n const classes = ['fieldset-label', className].filter(Boolean).join(' ')\n return <label className={classes} {...props}>{children}</label>\n}\n\nexport const Fieldset = Object.assign(FieldsetRoot, {\n Legend: FieldsetLegend,\n Label: FieldsetLabel,\n})\n"],"names":["FieldsetRoot","children","className","props","classes","FieldsetLegend","FieldsetLabel","Fieldset"],"mappings":";AAiBA,SAASA,EAAa,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAAwB;AAC3E,QAAMC,IAAU,CAAC,YAAYF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAEhE,2BACG,YAAA,EAAS,WAAWE,GAAU,GAAGD,GAC/B,UAAAF,GACH;AAEJ;AAEA,SAASI,EAAe,EAAE,UAAAJ,GAAU,WAAAC,IAAY,MAA2B;AACzE,2BAAQ,UAAA,EAAO,WAAW,mBAAmBA,CAAS,IAAK,UAAAD,GAAS;AACtE;AAEA,SAASK,EAAc,EAAE,UAAAL,GAAU,WAAAC,IAAY,IAAI,GAAGC,KAA6B;AACjF,QAAMC,IAAU,CAAC,kBAAkBF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACtE,2BAAQ,SAAA,EAAM,WAAWE,GAAU,GAAGD,GAAQ,UAAAF,GAAS;AACzD;AAEO,MAAMM,IAAW,OAAO,OAAOP,GAAc;AAAA,EAClD,QAAQK;AAAA,EACR,OAAOC;AACT,CAAC;"}
|