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.
Files changed (175) hide show
  1. package/dist/components/Container.d.ts +7 -1
  2. package/dist/components/Fieldset.d.ts +6 -0
  3. package/dist/components/Filter.d.ts +27 -0
  4. package/dist/components/Grid.d.ts +1 -1
  5. package/dist/components/Modal.d.ts +7 -2
  6. package/dist/components/ThemeController.d.ts +12 -4
  7. package/dist/index.d.ts +4 -2
  8. package/dist/index.js +167 -165
  9. package/dist/index.js.map +1 -1
  10. package/dist/index100.js +44 -11
  11. package/dist/index100.js.map +1 -1
  12. package/dist/index101.js +10 -12
  13. package/dist/index101.js.map +1 -1
  14. package/dist/index102.js +14 -7
  15. package/dist/index102.js.map +1 -1
  16. package/dist/index103.js +7 -12
  17. package/dist/index103.js.map +1 -1
  18. package/dist/index104.js +11 -29
  19. package/dist/index104.js.map +1 -1
  20. package/dist/index105.js +29 -16
  21. package/dist/index105.js.map +1 -1
  22. package/dist/index106.js +21 -0
  23. package/dist/index106.js.map +1 -0
  24. package/dist/index18.js +23 -15
  25. package/dist/index18.js.map +1 -1
  26. package/dist/index2.js +41 -34
  27. package/dist/index2.js.map +1 -1
  28. package/dist/index21.js +1 -1
  29. package/dist/index25.js +8 -8
  30. package/dist/index25.js.map +1 -1
  31. package/dist/index27.js +13 -8
  32. package/dist/index27.js.map +1 -1
  33. package/dist/index29.js +50 -61
  34. package/dist/index29.js.map +1 -1
  35. package/dist/index30.js +60 -181
  36. package/dist/index30.js.map +1 -1
  37. package/dist/index31.js +184 -18
  38. package/dist/index31.js.map +1 -1
  39. package/dist/index32.js +15 -217
  40. package/dist/index32.js.map +1 -1
  41. package/dist/index33.js +216 -1078
  42. package/dist/index33.js.map +1 -1
  43. package/dist/index34.js +1086 -17
  44. package/dist/index34.js.map +1 -1
  45. package/dist/index35.js +17 -121
  46. package/dist/index35.js.map +1 -1
  47. package/dist/index36.js +119 -37
  48. package/dist/index36.js.map +1 -1
  49. package/dist/index37.js +34 -208
  50. package/dist/index37.js.map +1 -1
  51. package/dist/index38.js +214 -97
  52. package/dist/index38.js.map +1 -1
  53. package/dist/index39.js +93 -158
  54. package/dist/index39.js.map +1 -1
  55. package/dist/index40.js +155 -139
  56. package/dist/index40.js.map +1 -1
  57. package/dist/index41.js +146 -15
  58. package/dist/index41.js.map +1 -1
  59. package/dist/index42.js +15 -17
  60. package/dist/index42.js.map +1 -1
  61. package/dist/index43.js +17 -21
  62. package/dist/index43.js.map +1 -1
  63. package/dist/index44.js +18 -116
  64. package/dist/index44.js.map +1 -1
  65. package/dist/index45.js +116 -10
  66. package/dist/index45.js.map +1 -1
  67. package/dist/index46.js +13 -35
  68. package/dist/index46.js.map +1 -1
  69. package/dist/index47.js +35 -34
  70. package/dist/index47.js.map +1 -1
  71. package/dist/index48.js +34 -116
  72. package/dist/index48.js.map +1 -1
  73. package/dist/index49.js +114 -174
  74. package/dist/index49.js.map +1 -1
  75. package/dist/index50.js +165 -136
  76. package/dist/index50.js.map +1 -1
  77. package/dist/index51.js +146 -11
  78. package/dist/index51.js.map +1 -1
  79. package/dist/index52.js +10 -20
  80. package/dist/index52.js.map +1 -1
  81. package/dist/index53.js +22 -14
  82. package/dist/index53.js.map +1 -1
  83. package/dist/index54.js +14 -7
  84. package/dist/index54.js.map +1 -1
  85. package/dist/index55.js +6 -268
  86. package/dist/index55.js.map +1 -1
  87. package/dist/index56.js +311 -17
  88. package/dist/index56.js.map +1 -1
  89. package/dist/index57.js +17 -122
  90. package/dist/index57.js.map +1 -1
  91. package/dist/index58.js +120 -108
  92. package/dist/index58.js.map +1 -1
  93. package/dist/index59.js +107 -167
  94. package/dist/index59.js.map +1 -1
  95. package/dist/index60.js +167 -29
  96. package/dist/index60.js.map +1 -1
  97. package/dist/index61.js +30 -120
  98. package/dist/index61.js.map +1 -1
  99. package/dist/index62.js +116 -80
  100. package/dist/index62.js.map +1 -1
  101. package/dist/index63.js +85 -19
  102. package/dist/index63.js.map +1 -1
  103. package/dist/index64.js +19 -73
  104. package/dist/index64.js.map +1 -1
  105. package/dist/index65.js +71 -54
  106. package/dist/index65.js.map +1 -1
  107. package/dist/index66.js +56 -44
  108. package/dist/index66.js.map +1 -1
  109. package/dist/index67.js +42 -49
  110. package/dist/index67.js.map +1 -1
  111. package/dist/index68.js +52 -62
  112. package/dist/index68.js.map +1 -1
  113. package/dist/index69.js +56 -101
  114. package/dist/index69.js.map +1 -1
  115. package/dist/index70.js +107 -41
  116. package/dist/index70.js.map +1 -1
  117. package/dist/index71.js +41 -68
  118. package/dist/index71.js.map +1 -1
  119. package/dist/index72.js +66 -19
  120. package/dist/index72.js.map +1 -1
  121. package/dist/index73.js +18 -43
  122. package/dist/index73.js.map +1 -1
  123. package/dist/index74.js +44 -132
  124. package/dist/index74.js.map +1 -1
  125. package/dist/index75.js +132 -50
  126. package/dist/index75.js.map +1 -1
  127. package/dist/index76.js +51 -21
  128. package/dist/index76.js.map +1 -1
  129. package/dist/index77.js +22 -31
  130. package/dist/index77.js.map +1 -1
  131. package/dist/index78.js +31 -22
  132. package/dist/index78.js.map +1 -1
  133. package/dist/index79.js +20 -327
  134. package/dist/index79.js.map +1 -1
  135. package/dist/index80.js +323 -50
  136. package/dist/index80.js.map +1 -1
  137. package/dist/index81.js +56 -40
  138. package/dist/index81.js.map +1 -1
  139. package/dist/index82.js +40 -23
  140. package/dist/index82.js.map +1 -1
  141. package/dist/index83.js +21 -93
  142. package/dist/index83.js.map +1 -1
  143. package/dist/index84.js +88 -123
  144. package/dist/index84.js.map +1 -1
  145. package/dist/index85.js +147 -152
  146. package/dist/index85.js.map +1 -1
  147. package/dist/index86.js +159 -63
  148. package/dist/index86.js.map +1 -1
  149. package/dist/index87.js +65 -35
  150. package/dist/index87.js.map +1 -1
  151. package/dist/index88.js +35 -234
  152. package/dist/index88.js.map +1 -1
  153. package/dist/index89.js +231 -31
  154. package/dist/index89.js.map +1 -1
  155. package/dist/index90.js +34 -210
  156. package/dist/index90.js.map +1 -1
  157. package/dist/index91.js +195 -198
  158. package/dist/index91.js.map +1 -1
  159. package/dist/index92.js +159 -241
  160. package/dist/index92.js.map +1 -1
  161. package/dist/index93.js +283 -166
  162. package/dist/index93.js.map +1 -1
  163. package/dist/index94.js +173 -253
  164. package/dist/index94.js.map +1 -1
  165. package/dist/index95.js +258 -14
  166. package/dist/index95.js.map +1 -1
  167. package/dist/index96.js +12 -31
  168. package/dist/index96.js.map +1 -1
  169. package/dist/index97.js +32 -5
  170. package/dist/index97.js.map +1 -1
  171. package/dist/index98.js +5 -13
  172. package/dist/index98.js.map +1 -1
  173. package/dist/index99.js +11 -43
  174. package/dist/index99.js.map +1 -1
  175. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index101.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;"}
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 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;
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
- f as usePrevious
16
+ m as useClickOutside
10
17
  };
11
18
  //# sourceMappingURL=index102.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index102.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;"}
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 { 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);
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 useHover
9
+ f as usePrevious
15
10
  };
16
11
  //# sourceMappingURL=index103.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index103.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;"}
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 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);
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
- }, [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]);
11
+ }, []), { ref: n, isHovered: o };
29
12
  }
30
13
  export {
31
- c as useKeyPress,
32
- y as useKeyPressCallback
14
+ f as useHover
33
15
  };
34
16
  //# sourceMappingURL=index104.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index104.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;"}
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 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
- });
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
- return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
16
- }, []), i;
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
- r as useWindowSize
31
+ c as useKeyPress,
32
+ y as useKeyPressCallback
20
33
  };
21
34
  //# sourceMappingURL=index105.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index105.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;"}
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;"}
@@ -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 e } from "react/jsx-runtime";
2
- const n = ({
3
- children: s,
4
- size: l = "lg",
5
- className: x = "",
6
- ...a
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 m = ["mx-auto px-4 sm:px-6 lg:px-8", {
9
- sm: "max-w-2xl",
10
- md: "max-w-4xl",
11
- lg: "max-w-6xl",
12
- xl: "max-w-7xl",
13
- full: "max-w-full"
14
- }[l], x].filter(Boolean).join(" ");
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
- n as Container
26
+ c as Container
19
27
  };
20
28
  //# sourceMappingURL=index18.js.map
@@ -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}\n\nexport const Container: React.FC<ContainerProps> = ({\n children,\n size = 'lg',\n className = '',\n ...rest\n}) => {\n const sizeClasses = {\n sm: 'max-w-2xl',\n md: 'max-w-4xl',\n lg: 'max-w-6xl',\n xl: 'max-w-7xl',\n full: 'max-w-full',\n }\n\n const classes = ['mx-auto px-4 sm:px-6 lg:px-8', sizeClasses[size], className]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n"],"names":["Container","children","size","className","rest","classes"],"mappings":";AAOO,MAAMA,IAAsC,CAAC;AAAA,EAClD,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AASJ,QAAMC,IAAU,CAAC,gCARG;AAAA,IAClB,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EAAA,EAGqDH,CAAI,GAAGC,CAAS,EAC1E,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWE,GAAU,GAAGD,GAAO,UAAAH,GAAS;AACtD;"}
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 { jsxs as z, jsx as v } from "react/jsx-runtime";
2
- import { useState as f, useRef as p, useEffect as L } from "react";
3
- const H = ({
4
- children: y,
5
- offsetTop: i,
6
- offsetBottom: n,
7
- target: d,
8
- onChange: w,
9
- className: S = "",
10
- ...g
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, m] = f(!1), [R, h] = f({}), [A, u] = f({}), s = p(null), o = p(null);
13
- return L(() => {
14
- const x = d ? d() : window, t = () => {
15
- if (!s.current || !o.current) return;
16
- const l = s.current.getBoundingClientRect(), a = o.current.getBoundingClientRect();
17
- let e = !1, c = {};
18
- if (i !== void 0)
19
- e = l.top < i, e && (c = {
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: i,
22
- width: l.width,
23
+ top: t,
24
+ width: s.width,
23
25
  zIndex: 100
24
26
  });
25
- else if (n !== void 0) {
27
+ else if (i !== void 0) {
26
28
  const E = window.innerHeight;
27
- e = l.bottom > E - n, e && (c = {
29
+ e = s.bottom > E - i, e && (f = {
28
30
  position: "fixed",
29
- bottom: n,
30
- width: l.width,
31
+ bottom: i,
32
+ width: s.width,
31
33
  zIndex: 100
32
34
  });
33
35
  }
34
- e !== r && (m(e), w?.(e)), e ? (h({
35
- width: a.width,
36
- height: a.height
37
- }), u(c)) : (h({}), u({}));
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 x.addEventListener("scroll", t), window.addEventListener("resize", t), t(), () => {
40
- x.removeEventListener("scroll", t), window.removeEventListener("resize", t);
41
+ return c.addEventListener("scroll", n), window.addEventListener("resize", n), n(), () => {
42
+ c.removeEventListener("scroll", n), window.removeEventListener("resize", n);
41
43
  };
42
- }, [d, i, n, r, w]), /* @__PURE__ */ z("div", { ref: s, className: S, "data-state": r ? "affixed" : "normal", ...g, children: [
43
- r && /* @__PURE__ */ v("div", { style: R }),
44
- /* @__PURE__ */ v("div", { ref: o, style: A, children: y })
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
- H as Affix
55
+ j as Affix
49
56
  };
50
57
  //# sourceMappingURL=index2.js.map
@@ -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 const scrollTarget = target ? target() : 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 }, [target, offsetTop, offsetBottom, affixed, onChange])\n\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","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;AAE9C,SAAAE,EAAU,MAAM;AACd,UAAMC,IAAef,IAASA,EAAA,IAAW,QAEnCgB,IAAe,MAAM;AACzB,UAAI,CAACL,EAAW,WAAW,CAACE,EAAW,QAAS;AAEhD,YAAMI,IAAON,EAAW,QAAQ,sBAAA,GAC1BO,IAAcL,EAAW,QAAQ,sBAAA;AAEvC,UAAIM,IAAc,IACdC,IAAqC,CAAA;AAEzC,UAAItB,MAAc;AAEhB,QAAAqB,IAAcF,EAAK,MAAMnB,GACrBqB,MACFC,IAAgB;AAAA,UACd,UAAU;AAAA,UACV,KAAKtB;AAAA,UACL,OAAOmB,EAAK;AAAA,UACZ,QAAQ;AAAA,QAAA;AAAA,eAGHlB,MAAiB,QAAW;AAErC,cAAMsB,IAAiB,OAAO;AAC9B,QAAAF,IAAcF,EAAK,SAASI,IAAiBtB,GACzCoB,MACFC,IAAgB;AAAA,UACd,UAAU;AAAA,UACV,QAAQrB;AAAA,UACR,OAAOkB,EAAK;AAAA,UACZ,QAAQ;AAAA,QAAA;AAAA,MAGd;AAEA,MAAIE,MAAgBf,MAClBC,EAAWc,CAAW,GACtBlB,IAAWkB,CAAW,IAGpBA,KACFX,EAAoB;AAAA,QAClB,OAAOU,EAAY;AAAA,QACnB,QAAQA,EAAY;AAAA,MAAA,CACrB,GACDR,EAAcU,CAAa,MAE3BZ,EAAoB,CAAA,CAAE,GACtBE,EAAc,CAAA,CAAE;AAAA,IAEpB;AAEA,WAAAK,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,CAAChB,GAAQF,GAAWC,GAAcK,GAASH,CAAQ,CAAC,GAGrD,gBAAAqB,EAAC,OAAA,EAAI,KAAKX,GAAY,WAAAT,GAAsB,cAAYE,IAAU,YAAY,UAAW,GAAGD,GACzF,UAAA;AAAA,IAAAC,KAAW,gBAAAmB,EAAC,OAAA,EAAI,OAAOhB,EAAA,CAAkB;AAAA,sBACzC,OAAA,EAAI,KAAKM,GAAY,OAAOJ,GAC1B,UAAAZ,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
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 "./index39.js";
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 o } from "react/jsx-runtime";
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 t = {
10
+ const o = {
11
11
  start: "divider-start",
12
12
  center: "",
13
13
  end: "divider-end"
14
- }, a = {
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
- }, c = [
23
+ }, a = [
24
24
  "divider",
25
- e === "vertical" && "divider-vertical",
26
- t[d],
27
- i && a[i],
25
+ e === "vertical" && "divider-horizontal",
26
+ o[d],
27
+ i && t[i],
28
28
  n
29
29
  ].filter(Boolean).join(" ");
30
- return /* @__PURE__ */ o("div", { className: c, ...s, children: r });
30
+ return /* @__PURE__ */ c("div", { className: a, ...s, children: r });
31
31
  }
32
32
  export {
33
33
  l as Divider
@@ -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-vertical',\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;"}
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 t } from "react/jsx-runtime";
2
- function i({ children: e, className: s = "", ...n }) {
3
- const l = ["fieldset", s].filter(Boolean).join(" ");
4
- return /* @__PURE__ */ t("fieldset", { className: l, ...n, children: e });
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__ */ t("legend", { className: `fieldset-legend ${s}`, children: e });
7
+ return /* @__PURE__ */ n("legend", { className: `fieldset-legend ${s}`, children: e });
8
8
  }
9
- const c = Object.assign(i, {
10
- Legend: o
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
- c as Fieldset
18
+ d as Fieldset
14
19
  };
15
20
  //# sourceMappingURL=index27.js.map
@@ -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":";AAYA,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;AAEO,MAAMK,IAAW,OAAO,OAAON,GAAc;AAAA,EAClD,QAAQK;AACV,CAAC;"}
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;"}