asterui 0.12.6 → 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 (176) 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/FloatButton.d.ts +50 -11
  5. package/dist/components/Grid.d.ts +1 -1
  6. package/dist/components/Modal.d.ts +7 -2
  7. package/dist/components/ThemeController.d.ts +12 -4
  8. package/dist/index.d.ts +4 -2
  9. package/dist/index.js +167 -165
  10. package/dist/index.js.map +1 -1
  11. package/dist/index100.js +44 -11
  12. package/dist/index100.js.map +1 -1
  13. package/dist/index101.js +10 -12
  14. package/dist/index101.js.map +1 -1
  15. package/dist/index102.js +14 -7
  16. package/dist/index102.js.map +1 -1
  17. package/dist/index103.js +7 -12
  18. package/dist/index103.js.map +1 -1
  19. package/dist/index104.js +11 -29
  20. package/dist/index104.js.map +1 -1
  21. package/dist/index105.js +29 -16
  22. package/dist/index105.js.map +1 -1
  23. package/dist/index106.js +21 -0
  24. package/dist/index106.js.map +1 -0
  25. package/dist/index18.js +23 -15
  26. package/dist/index18.js.map +1 -1
  27. package/dist/index2.js +41 -34
  28. package/dist/index2.js.map +1 -1
  29. package/dist/index21.js +1 -1
  30. package/dist/index25.js +8 -8
  31. package/dist/index25.js.map +1 -1
  32. package/dist/index27.js +13 -8
  33. package/dist/index27.js.map +1 -1
  34. package/dist/index29.js +50 -61
  35. package/dist/index29.js.map +1 -1
  36. package/dist/index30.js +60 -77
  37. package/dist/index30.js.map +1 -1
  38. package/dist/index31.js +184 -18
  39. package/dist/index31.js.map +1 -1
  40. package/dist/index32.js +15 -217
  41. package/dist/index32.js.map +1 -1
  42. package/dist/index33.js +216 -1078
  43. package/dist/index33.js.map +1 -1
  44. package/dist/index34.js +1086 -17
  45. package/dist/index34.js.map +1 -1
  46. package/dist/index35.js +17 -121
  47. package/dist/index35.js.map +1 -1
  48. package/dist/index36.js +119 -37
  49. package/dist/index36.js.map +1 -1
  50. package/dist/index37.js +34 -208
  51. package/dist/index37.js.map +1 -1
  52. package/dist/index38.js +214 -97
  53. package/dist/index38.js.map +1 -1
  54. package/dist/index39.js +93 -158
  55. package/dist/index39.js.map +1 -1
  56. package/dist/index40.js +155 -139
  57. package/dist/index40.js.map +1 -1
  58. package/dist/index41.js +146 -15
  59. package/dist/index41.js.map +1 -1
  60. package/dist/index42.js +15 -17
  61. package/dist/index42.js.map +1 -1
  62. package/dist/index43.js +17 -21
  63. package/dist/index43.js.map +1 -1
  64. package/dist/index44.js +18 -116
  65. package/dist/index44.js.map +1 -1
  66. package/dist/index45.js +116 -10
  67. package/dist/index45.js.map +1 -1
  68. package/dist/index46.js +13 -35
  69. package/dist/index46.js.map +1 -1
  70. package/dist/index47.js +35 -34
  71. package/dist/index47.js.map +1 -1
  72. package/dist/index48.js +34 -116
  73. package/dist/index48.js.map +1 -1
  74. package/dist/index49.js +114 -174
  75. package/dist/index49.js.map +1 -1
  76. package/dist/index50.js +165 -136
  77. package/dist/index50.js.map +1 -1
  78. package/dist/index51.js +146 -11
  79. package/dist/index51.js.map +1 -1
  80. package/dist/index52.js +10 -20
  81. package/dist/index52.js.map +1 -1
  82. package/dist/index53.js +22 -14
  83. package/dist/index53.js.map +1 -1
  84. package/dist/index54.js +14 -7
  85. package/dist/index54.js.map +1 -1
  86. package/dist/index55.js +6 -268
  87. package/dist/index55.js.map +1 -1
  88. package/dist/index56.js +311 -17
  89. package/dist/index56.js.map +1 -1
  90. package/dist/index57.js +17 -122
  91. package/dist/index57.js.map +1 -1
  92. package/dist/index58.js +120 -108
  93. package/dist/index58.js.map +1 -1
  94. package/dist/index59.js +107 -167
  95. package/dist/index59.js.map +1 -1
  96. package/dist/index60.js +167 -29
  97. package/dist/index60.js.map +1 -1
  98. package/dist/index61.js +30 -120
  99. package/dist/index61.js.map +1 -1
  100. package/dist/index62.js +116 -80
  101. package/dist/index62.js.map +1 -1
  102. package/dist/index63.js +85 -19
  103. package/dist/index63.js.map +1 -1
  104. package/dist/index64.js +19 -73
  105. package/dist/index64.js.map +1 -1
  106. package/dist/index65.js +71 -54
  107. package/dist/index65.js.map +1 -1
  108. package/dist/index66.js +56 -44
  109. package/dist/index66.js.map +1 -1
  110. package/dist/index67.js +42 -49
  111. package/dist/index67.js.map +1 -1
  112. package/dist/index68.js +52 -62
  113. package/dist/index68.js.map +1 -1
  114. package/dist/index69.js +56 -101
  115. package/dist/index69.js.map +1 -1
  116. package/dist/index70.js +107 -41
  117. package/dist/index70.js.map +1 -1
  118. package/dist/index71.js +41 -68
  119. package/dist/index71.js.map +1 -1
  120. package/dist/index72.js +66 -19
  121. package/dist/index72.js.map +1 -1
  122. package/dist/index73.js +18 -43
  123. package/dist/index73.js.map +1 -1
  124. package/dist/index74.js +44 -132
  125. package/dist/index74.js.map +1 -1
  126. package/dist/index75.js +132 -50
  127. package/dist/index75.js.map +1 -1
  128. package/dist/index76.js +51 -21
  129. package/dist/index76.js.map +1 -1
  130. package/dist/index77.js +22 -31
  131. package/dist/index77.js.map +1 -1
  132. package/dist/index78.js +31 -22
  133. package/dist/index78.js.map +1 -1
  134. package/dist/index79.js +20 -327
  135. package/dist/index79.js.map +1 -1
  136. package/dist/index80.js +323 -50
  137. package/dist/index80.js.map +1 -1
  138. package/dist/index81.js +56 -40
  139. package/dist/index81.js.map +1 -1
  140. package/dist/index82.js +40 -23
  141. package/dist/index82.js.map +1 -1
  142. package/dist/index83.js +21 -93
  143. package/dist/index83.js.map +1 -1
  144. package/dist/index84.js +88 -123
  145. package/dist/index84.js.map +1 -1
  146. package/dist/index85.js +147 -152
  147. package/dist/index85.js.map +1 -1
  148. package/dist/index86.js +159 -63
  149. package/dist/index86.js.map +1 -1
  150. package/dist/index87.js +65 -35
  151. package/dist/index87.js.map +1 -1
  152. package/dist/index88.js +35 -234
  153. package/dist/index88.js.map +1 -1
  154. package/dist/index89.js +231 -31
  155. package/dist/index89.js.map +1 -1
  156. package/dist/index90.js +34 -210
  157. package/dist/index90.js.map +1 -1
  158. package/dist/index91.js +195 -198
  159. package/dist/index91.js.map +1 -1
  160. package/dist/index92.js +159 -241
  161. package/dist/index92.js.map +1 -1
  162. package/dist/index93.js +283 -166
  163. package/dist/index93.js.map +1 -1
  164. package/dist/index94.js +173 -253
  165. package/dist/index94.js.map +1 -1
  166. package/dist/index95.js +258 -14
  167. package/dist/index95.js.map +1 -1
  168. package/dist/index96.js +12 -31
  169. package/dist/index96.js.map +1 -1
  170. package/dist/index97.js +32 -5
  171. package/dist/index97.js.map +1 -1
  172. package/dist/index98.js +5 -13
  173. package/dist/index98.js.map +1 -1
  174. package/dist/index99.js +11 -43
  175. package/dist/index99.js.map +1 -1
  176. package/package.json +2 -2
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;"}
package/dist/index29.js CHANGED
@@ -1,66 +1,55 @@
1
- import { jsx as v } from "react/jsx-runtime";
2
- const y = ({
3
- direction: t,
4
- justify: r,
5
- align: s,
6
- wrap: m,
7
- gap: e,
8
- flex: o,
9
- inline: a = !1,
10
- minHeight: l,
11
- minWidth: f,
12
- className: x = "",
13
- style: c,
14
- children: i,
15
- ...u
1
+ import { jsxs as N, jsx as i } from "react/jsx-runtime";
2
+ import { useId as I, useState as R } from "react";
3
+ const o = {
4
+ xs: "btn-xs",
5
+ sm: "btn-sm",
6
+ md: "",
7
+ lg: "btn-lg"
8
+ }, $ = ({
9
+ options: d,
10
+ value: s,
11
+ defaultValue: c,
12
+ onChange: t,
13
+ name: m,
14
+ size: a = "md",
15
+ showReset: u = !0,
16
+ resetLabel: l = "×",
17
+ className: b = ""
16
18
  }) => {
17
- const n = typeof e == "number", w = [
18
- a ? "inline-flex" : "flex",
19
- t === "row" && "flex-row",
20
- t === "column" && "flex-col",
21
- t === "row-reverse" && "flex-row-reverse",
22
- t === "column-reverse" && "flex-col-reverse",
23
- r === "start" && "justify-start",
24
- r === "end" && "justify-end",
25
- r === "center" && "justify-center",
26
- r === "between" && "justify-between",
27
- r === "around" && "justify-around",
28
- r === "evenly" && "justify-evenly",
29
- s === "start" && "items-start",
30
- s === "end" && "items-end",
31
- s === "center" && "items-center",
32
- s === "baseline" && "items-baseline",
33
- s === "stretch" && "items-stretch",
34
- m === !0 && "flex-wrap",
35
- m === "wrap" && "flex-wrap",
36
- m === "nowrap" && "flex-nowrap",
37
- m === "wrap-reverse" && "flex-wrap-reverse",
38
- !n && e === "xs" && "gap-1",
39
- !n && e === "sm" && "gap-2",
40
- !n && e === "md" && "gap-4",
41
- !n && e === "lg" && "gap-6",
42
- !n && e === "xl" && "gap-8",
43
- o === "1" && "flex-1",
44
- o === "auto" && "flex-auto",
45
- o === "initial" && "flex-initial",
46
- o === "none" && "flex-none",
47
- l === "screen" && "min-h-screen",
48
- l === "full" && "min-h-full",
49
- l === "fit" && "min-h-fit",
50
- l === "min" && "min-h-min",
51
- l === "max" && "min-h-max",
52
- f === "full" && "min-w-full",
53
- f === "fit" && "min-w-fit",
54
- f === "min" && "min-w-min",
55
- f === "max" && "min-w-max",
56
- x
57
- ].filter(Boolean).join(" "), p = {
58
- ...c,
59
- ...n ? { gap: `${e}px` } : {}
60
- };
61
- return /* @__PURE__ */ v("div", { className: w, style: p, ...u, children: i });
19
+ const f = I(), v = m || `filter-${f}`, [g, n] = R(c), h = s !== void 0 ? s : g, r = s !== void 0, p = d.map(
20
+ (e) => typeof e == "string" ? { label: e, value: e } : e
21
+ ), x = (e) => {
22
+ r || n(e), t?.(e);
23
+ }, C = () => {
24
+ r || n(void 0), t?.(void 0);
25
+ }, j = ["btn", o[a]].filter(Boolean).join(" "), y = ["btn", "btn-square", o[a]].filter(Boolean).join(" ");
26
+ return /* @__PURE__ */ N("form", { className: `filter ${b}`.trim(), onReset: C, children: [
27
+ u && /* @__PURE__ */ i(
28
+ "input",
29
+ {
30
+ className: y,
31
+ type: "reset",
32
+ value: typeof l == "string" ? l : void 0,
33
+ "aria-label": "Reset filter"
34
+ }
35
+ ),
36
+ p.map((e) => /* @__PURE__ */ i(
37
+ "input",
38
+ {
39
+ className: j,
40
+ type: "radio",
41
+ name: v,
42
+ value: e.value,
43
+ "aria-label": e.label,
44
+ checked: h === e.value,
45
+ onChange: () => x(e.value),
46
+ disabled: e.disabled
47
+ },
48
+ e.value
49
+ ))
50
+ ] });
62
51
  };
63
52
  export {
64
- y as Flex
53
+ $ as Filter
65
54
  };
66
55
  //# sourceMappingURL=index29.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index29.js","sources":["../src/components/Flex.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse'\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n flex?: '1' | 'auto' | 'initial' | 'none'\n inline?: boolean\n minHeight?: 'screen' | 'full' | 'fit' | 'min' | 'max'\n minWidth?: 'full' | 'fit' | 'min' | 'max'\n children?: React.ReactNode\n}\n\nexport const Flex: React.FC<FlexProps> = ({\n direction,\n justify,\n align,\n wrap,\n gap,\n flex,\n inline = false,\n minHeight,\n minWidth,\n className = '',\n style,\n children,\n ...rest\n}) => {\n const isNumericGap = typeof gap === 'number'\n\n const classes = [\n inline ? 'inline-flex' : 'flex',\n direction === 'row' && 'flex-row',\n direction === 'column' && 'flex-col',\n direction === 'row-reverse' && 'flex-row-reverse',\n direction === 'column-reverse' && 'flex-col-reverse',\n justify === 'start' && 'justify-start',\n justify === 'end' && 'justify-end',\n justify === 'center' && 'justify-center',\n justify === 'between' && 'justify-between',\n justify === 'around' && 'justify-around',\n justify === 'evenly' && 'justify-evenly',\n align === 'start' && 'items-start',\n align === 'end' && 'items-end',\n align === 'center' && 'items-center',\n align === 'baseline' && 'items-baseline',\n align === 'stretch' && 'items-stretch',\n wrap === true && 'flex-wrap',\n wrap === 'wrap' && 'flex-wrap',\n wrap === 'nowrap' && 'flex-nowrap',\n wrap === 'wrap-reverse' && 'flex-wrap-reverse',\n !isNumericGap && gap === 'xs' && 'gap-1',\n !isNumericGap && gap === 'sm' && 'gap-2',\n !isNumericGap && gap === 'md' && 'gap-4',\n !isNumericGap && gap === 'lg' && 'gap-6',\n !isNumericGap && gap === 'xl' && 'gap-8',\n flex === '1' && 'flex-1',\n flex === 'auto' && 'flex-auto',\n flex === 'initial' && 'flex-initial',\n flex === 'none' && 'flex-none',\n minHeight === 'screen' && 'min-h-screen',\n minHeight === 'full' && 'min-h-full',\n minHeight === 'fit' && 'min-h-fit',\n minHeight === 'min' && 'min-h-min',\n minHeight === 'max' && 'min-h-max',\n minWidth === 'full' && 'min-w-full',\n minWidth === 'fit' && 'min-w-fit',\n minWidth === 'min' && 'min-w-min',\n minWidth === 'max' && 'min-w-max',\n className,\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericGap ? { gap: `${gap}px` } : {}),\n }\n\n return (\n <div className={classes} style={combinedStyle} {...rest}>\n {children}\n </div>\n )\n}\n"],"names":["Flex","direction","justify","align","wrap","gap","flex","inline","minHeight","minWidth","className","style","children","rest","isNumericGap","classes","combinedStyle","jsx"],"mappings":";AAeO,MAA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IACvBA,MAAc,SAAS;AAAA,IACvBA,MAAc,SAAS;AAAA,IACvBC,MAAa,UAAU;AAAA,IACvBA,MAAa,SAAS;AAAA,IACtBA,MAAa,SAAS;AAAA,IACtBA,MAAa,SAAS;AAAA,IACtBC;AAAA,EAAA,EACA,OAAO,OAAO,EAAE,KAAK,GAAG,GAEpBM,IAAqC;AAAA,IACzC,GAAGL;AAAA,IACH,GAAIG,IAAe,EAAE,KAAK,GAAGT,CAAG,SAAS,CAAA;AAAA,EAAC;AAG5C,SACE,gBAAAY,EAAC,SAAI,WAAWF,GAAS,OAAOC,GAAgB,GAAGH,GAChD,UAAAD,GACH;AAEJ;"}
1
+ {"version":3,"file":"index29.js","sources":["../src/components/Filter.tsx"],"sourcesContent":["import React, { useState, useId } from 'react'\n\nexport interface FilterOption {\n label: string\n value: string\n disabled?: boolean\n}\n\nexport interface FilterProps {\n /** Filter options */\n options: (string | FilterOption)[]\n /** Controlled value */\n value?: string\n /** Default value for uncontrolled mode */\n defaultValue?: string\n /** Change handler */\n onChange?: (value: string | undefined) => void\n /** Radio group name (auto-generated if not provided) */\n name?: string\n /** Button size */\n size?: 'xs' | 'sm' | 'md' | 'lg'\n /** Show reset button */\n showReset?: boolean\n /** Reset button label */\n resetLabel?: React.ReactNode\n /** Additional CSS classes for container */\n className?: string\n}\n\nconst sizeClasses: Record<string, string> = {\n xs: 'btn-xs',\n sm: 'btn-sm',\n md: '',\n lg: 'btn-lg',\n}\n\nexport const Filter: React.FC<FilterProps> = ({\n options,\n value,\n defaultValue,\n onChange,\n name,\n size = 'md',\n showReset = true,\n resetLabel = '×',\n className = '',\n}) => {\n const autoId = useId()\n const groupName = name || `filter-${autoId}`\n\n const [internalValue, setInternalValue] = useState<string | undefined>(defaultValue)\n const currentValue = value !== undefined ? value : internalValue\n const isControlled = value !== undefined\n\n const normalizedOptions: FilterOption[] = options.map((opt) =>\n typeof opt === 'string' ? { label: opt, value: opt } : opt\n )\n\n const handleChange = (newValue: string) => {\n if (!isControlled) {\n setInternalValue(newValue)\n }\n onChange?.(newValue)\n }\n\n const handleReset = () => {\n if (!isControlled) {\n setInternalValue(undefined)\n }\n onChange?.(undefined)\n }\n\n const buttonClasses = ['btn', sizeClasses[size]].filter(Boolean).join(' ')\n const resetClasses = ['btn', 'btn-square', sizeClasses[size]].filter(Boolean).join(' ')\n\n return (\n <form className={`filter ${className}`.trim()} onReset={handleReset}>\n {showReset && (\n <input\n className={resetClasses}\n type=\"reset\"\n value={typeof resetLabel === 'string' ? resetLabel : undefined}\n aria-label=\"Reset filter\"\n />\n )}\n {normalizedOptions.map((option) => (\n <input\n key={option.value}\n className={buttonClasses}\n type=\"radio\"\n name={groupName}\n value={option.value}\n aria-label={option.label}\n checked={currentValue === option.value}\n onChange={() => handleChange(option.value)}\n disabled={option.disabled}\n />\n ))}\n </form>\n )\n}\n"],"names":["sizeClasses","Filter","options","value","defaultValue","onChange","name","size","showReset","resetLabel","className","autoId","useId","groupName","internalValue","setInternalValue","useState","currentValue","isControlled","normalizedOptions","opt","handleChange","newValue","handleReset","buttonClasses","resetClasses","jsxs","jsx","option"],"mappings":";;AA6BA,MAAMA,IAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAgC,CAAC;AAAA,EAC5C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC,IAAY;AACd,MAAM;AACJ,QAAMC,IAASC,EAAA,GACTC,IAAYP,KAAQ,UAAUK,CAAM,IAEpC,CAACG,GAAeC,CAAgB,IAAIC,EAA6BZ,CAAY,GAC7Ea,IAAed,MAAU,SAAYA,IAAQW,GAC7CI,IAAef,MAAU,QAEzBgB,IAAoCjB,EAAQ;AAAA,IAAI,CAACkB,MACrD,OAAOA,KAAQ,WAAW,EAAE,OAAOA,GAAK,OAAOA,MAAQA;AAAA,EAAA,GAGnDC,IAAe,CAACC,MAAqB;AACzC,IAAKJ,KACHH,EAAiBO,CAAQ,GAE3BjB,IAAWiB,CAAQ;AAAA,EACrB,GAEMC,IAAc,MAAM;AACxB,IAAKL,KACHH,EAAiB,MAAS,GAE5BV,IAAW,MAAS;AAAA,EACtB,GAEMmB,IAAgB,CAAC,OAAOxB,EAAYO,CAAI,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GACnEkB,IAAe,CAAC,OAAO,cAAczB,EAAYO,CAAI,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAEtF,SACE,gBAAAmB,EAAC,UAAK,WAAW,UAAUhB,CAAS,GAAG,KAAA,GAAQ,SAASa,GACrD,UAAA;AAAA,IAAAf,KACC,gBAAAmB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWF;AAAA,QACX,MAAK;AAAA,QACL,OAAO,OAAOhB,KAAe,WAAWA,IAAa;AAAA,QACrD,cAAW;AAAA,MAAA;AAAA,IAAA;AAAA,IAGdU,EAAkB,IAAI,CAACS,MACtB,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWH;AAAA,QACX,MAAK;AAAA,QACL,MAAMX;AAAA,QACN,OAAOe,EAAO;AAAA,QACd,cAAYA,EAAO;AAAA,QACnB,SAASX,MAAiBW,EAAO;AAAA,QACjC,UAAU,MAAMP,EAAaO,EAAO,KAAK;AAAA,QACzC,UAAUA,EAAO;AAAA,MAAA;AAAA,MARZA,EAAO;AAAA,IAAA,CAUf;AAAA,EAAA,GACH;AAEJ;"}
package/dist/index30.js CHANGED
@@ -1,83 +1,66 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useState as g, useEffect as v } from "react";
3
- const k = {
4
- left: "tooltip-left",
5
- right: "tooltip-right",
6
- top: "tooltip-top",
7
- bottom: "tooltip-bottom"
8
- }, f = ({
9
- children: s,
10
- onClick: n,
11
- type: d = "default",
12
- shape: p = "circle",
13
- position: l = "bottom-right",
14
- offset: e = 24,
15
- className: h = "",
16
- tooltip: r,
17
- tooltipPlacement: u = "left",
18
- ...i
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ const y = ({
3
+ direction: t,
4
+ justify: r,
5
+ align: s,
6
+ wrap: m,
7
+ gap: e,
8
+ flex: o,
9
+ inline: a = !1,
10
+ minHeight: l,
11
+ minWidth: f,
12
+ className: x = "",
13
+ style: c,
14
+ children: i,
15
+ ...u
19
16
  }) => {
20
- const c = [
21
- "btn",
22
- "btn-lg",
23
- "shadow-lg",
24
- p === "circle" ? "btn-circle" : "btn-square",
25
- {
26
- default: "btn-neutral",
27
- primary: "btn-primary",
28
- secondary: "btn-secondary",
29
- accent: "btn-accent"
30
- }[d],
31
- h
32
- ].filter(Boolean).join(" "), a = {
33
- position: "fixed",
34
- zIndex: 1e3,
35
- ...l.includes("bottom") ? { bottom: e } : { top: e },
36
- ...l.includes("right") ? { right: e } : { left: e }
37
- }, o = /* @__PURE__ */ t("button", { className: c, onClick: n, style: a, ...i, children: s || /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }) });
38
- return r ? /* @__PURE__ */ t("div", { className: `tooltip ${k[u]}`, "data-tip": r, style: a, children: /* @__PURE__ */ t("button", { className: c, onClick: n, style: { position: "static" }, ...i, children: s || /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }) }) }) : o;
39
- }, x = ({
40
- visibilityHeight: s = 400,
41
- target: n,
42
- onClick: d,
43
- children: p,
44
- position: l = "bottom-right",
45
- offset: e = 24,
46
- className: h = "",
47
- ...r
48
- }) => {
49
- const [u, i] = g(!1);
50
- v(() => {
51
- const o = n ? n() : window, m = () => {
52
- const b = o instanceof Window ? window.scrollY : o.scrollTop;
53
- i(b >= s);
54
- };
55
- return o.addEventListener("scroll", m), m(), () => o.removeEventListener("scroll", m);
56
- }, [n, s]);
57
- const w = () => {
58
- d?.();
59
- const o = n ? n() : window;
60
- o instanceof Window ? window.scrollTo({ top: 0, behavior: "smooth" }) : o.scrollTo({ top: 0, behavior: "smooth" });
61
- };
62
- if (!u) return null;
63
- const c = [
64
- "btn",
65
- "btn-lg",
66
- "btn-circle",
67
- "btn-neutral",
68
- "shadow-lg",
69
- "transition-opacity",
70
- h
71
- ].filter(Boolean).join(" "), a = {
72
- position: "fixed",
73
- zIndex: 1e3,
74
- bottom: e,
75
- ...l.includes("right") ? { right: e } : { left: e }
17
+ const n = typeof e == "number", w = [
18
+ a ? "inline-flex" : "flex",
19
+ t === "row" && "flex-row",
20
+ t === "column" && "flex-col",
21
+ t === "row-reverse" && "flex-row-reverse",
22
+ t === "column-reverse" && "flex-col-reverse",
23
+ r === "start" && "justify-start",
24
+ r === "end" && "justify-end",
25
+ r === "center" && "justify-center",
26
+ r === "between" && "justify-between",
27
+ r === "around" && "justify-around",
28
+ r === "evenly" && "justify-evenly",
29
+ s === "start" && "items-start",
30
+ s === "end" && "items-end",
31
+ s === "center" && "items-center",
32
+ s === "baseline" && "items-baseline",
33
+ s === "stretch" && "items-stretch",
34
+ m === !0 && "flex-wrap",
35
+ m === "wrap" && "flex-wrap",
36
+ m === "nowrap" && "flex-nowrap",
37
+ m === "wrap-reverse" && "flex-wrap-reverse",
38
+ !n && e === "xs" && "gap-1",
39
+ !n && e === "sm" && "gap-2",
40
+ !n && e === "md" && "gap-4",
41
+ !n && e === "lg" && "gap-6",
42
+ !n && e === "xl" && "gap-8",
43
+ o === "1" && "flex-1",
44
+ o === "auto" && "flex-auto",
45
+ o === "initial" && "flex-initial",
46
+ o === "none" && "flex-none",
47
+ l === "screen" && "min-h-screen",
48
+ l === "full" && "min-h-full",
49
+ l === "fit" && "min-h-fit",
50
+ l === "min" && "min-h-min",
51
+ l === "max" && "min-h-max",
52
+ f === "full" && "min-w-full",
53
+ f === "fit" && "min-w-fit",
54
+ f === "min" && "min-w-min",
55
+ f === "max" && "min-w-max",
56
+ x
57
+ ].filter(Boolean).join(" "), p = {
58
+ ...c,
59
+ ...n ? { gap: `${e}px` } : {}
76
60
  };
77
- return /* @__PURE__ */ t("button", { className: c, onClick: w, style: a, ...r, children: p || /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) });
61
+ return /* @__PURE__ */ v("div", { className: w, style: p, ...u, children: i });
78
62
  };
79
- f.BackTop = x;
80
63
  export {
81
- f as FloatButton
64
+ y as Flex
82
65
  };
83
66
  //# sourceMappingURL=index30.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index30.js","sources":["../src/components/FloatButton.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react'\n\nexport interface FloatButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Button content (icon or text) */\n children?: React.ReactNode\n /** Button type/color */\n type?: 'default' | 'primary' | 'secondary' | 'accent'\n /** Button shape */\n shape?: 'circle' | 'square'\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n /** Distance from edge in pixels */\n offset?: number\n /** Tooltip text */\n tooltip?: string\n /** Tooltip placement */\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom'\n}\n\nexport interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'> {\n /** Scroll threshold to show button (pixels) */\n visibilityHeight?: number\n /** Scroll target (default: window) */\n target?: () => HTMLElement | Window\n /** Click handler (called before scrolling) */\n onClick?: () => void\n /** Custom content */\n children?: React.ReactNode\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left'\n /** Distance from edge in pixels */\n offset?: number\n}\n\nconst tooltipPlacementClasses = {\n left: 'tooltip-left',\n right: 'tooltip-right',\n top: 'tooltip-top',\n bottom: 'tooltip-bottom',\n}\n\nexport const FloatButton: React.FC<FloatButtonProps> & { BackTop: React.FC<BackTopProps> } = ({\n children,\n onClick,\n type = 'default',\n shape = 'circle',\n position = 'bottom-right',\n offset = 24,\n className = '',\n tooltip,\n tooltipPlacement = 'left',\n ...rest\n}) => {\n const typeClasses = {\n default: 'btn-neutral',\n primary: 'btn-primary',\n secondary: 'btn-secondary',\n accent: 'btn-accent',\n }\n\n const buttonClasses = [\n 'btn',\n 'btn-lg',\n 'shadow-lg',\n shape === 'circle' ? 'btn-circle' : 'btn-square',\n typeClasses[type],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n ...(position.includes('bottom') ? { bottom: offset } : { top: offset }),\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n }\n\n const button = (\n <button className={buttonClasses} onClick={onClick} style={style} {...rest}>\n {children || (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 4v16m8-8H4\" />\n </svg>\n )}\n </button>\n )\n\n if (tooltip) {\n return (\n <div className={`tooltip ${tooltipPlacementClasses[tooltipPlacement]}`} data-tip={tooltip} style={style}>\n <button className={buttonClasses} onClick={onClick} style={{ position: 'static' }} {...rest}>\n {children || (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 4v16m8-8H4\" />\n </svg>\n )}\n </button>\n </div>\n )\n }\n\n return button\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n visibilityHeight = 400,\n target,\n onClick,\n children,\n position = 'bottom-right',\n offset = 24,\n className = '',\n ...rest\n}) => {\n const [visible, setVisible] = useState(false)\n\n useEffect(() => {\n const scrollTarget = target ? target() : window\n\n const handleScroll = () => {\n const scrollTop =\n scrollTarget instanceof Window\n ? window.scrollY\n : (scrollTarget as HTMLElement).scrollTop\n\n setVisible(scrollTop >= visibilityHeight)\n }\n\n scrollTarget.addEventListener('scroll', handleScroll)\n handleScroll()\n\n return () => scrollTarget.removeEventListener('scroll', handleScroll)\n }, [target, visibilityHeight])\n\n const handleClick = () => {\n onClick?.()\n const scrollTarget = target ? target() : window\n if (scrollTarget instanceof Window) {\n window.scrollTo({ top: 0, behavior: 'smooth' })\n } else {\n (scrollTarget as HTMLElement).scrollTo({ top: 0, behavior: 'smooth' })\n }\n }\n\n if (!visible) return null\n\n const buttonClasses = [\n 'btn',\n 'btn-lg',\n 'btn-circle',\n 'btn-neutral',\n 'shadow-lg',\n 'transition-opacity',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n bottom: offset,\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n }\n\n return (\n <button className={buttonClasses} onClick={handleClick} style={style} {...rest}>\n {children || (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 10l7-7m0 0l7 7m-7-7v18\" />\n </svg>\n )}\n </button>\n )\n}\n\nFloatButton.BackTop = BackTop\n"],"names":["tooltipPlacementClasses","FloatButton","children","onClick","type","shape","position","offset","className","tooltip","tooltipPlacement","rest","buttonClasses","style","button","jsx","BackTop","visibilityHeight","target","visible","setVisible","useState","useEffect","scrollTarget","handleScroll","scrollTop","handleClick"],"mappings":";;AAkCA,MAAMA,IAA0B;AAAA,EAC9B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AACV,GAEaC,IAAgF,CAAC;AAAA,EAC5F,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,SAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,GAAGC;AACL,MAAM;AAQJ,QAAMC,IAAgB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACAP,MAAU,WAAW,eAAe;AAAA,IAXlB;AAAA,MAClB,SAAS;AAAA,MACT,SAAS;AAAA,MACT,WAAW;AAAA,MACX,QAAQ;AAAA,IAAA,EAQID,CAAI;AAAA,IAChBI;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELK,IAA6B;AAAA,IACjC,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,GAAIP,EAAS,SAAS,QAAQ,IAAI,EAAE,QAAQC,EAAA,IAAW,EAAE,KAAKA,EAAA;AAAA,IAC9D,GAAID,EAAS,SAAS,OAAO,IAAI,EAAE,OAAOC,EAAA,IAAW,EAAE,MAAMA,EAAA;AAAA,EAAO,GAGhEO,IACJ,gBAAAC,EAAC,UAAA,EAAO,WAAWH,GAAe,SAAAT,GAAkB,OAAAU,GAAe,GAAGF,GACnE,UAAAT,KACC,gBAAAa,EAAC,OAAA,EAAI,OAAM,8BAA6B,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACjG,4BAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,iBAA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,EAEzE;AAEA,MAAI,CAACJ,EAAS,QAAO;AAErB,QAAMP,IAAgB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAJ;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELK,IAA6B;AAAA,IACjC,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQN;AAAA,IACR,GAAID,EAAS,SAAS,OAAO,IAAI,EAAE,OAAOC,EAAA,IAAW,EAAE,MAAMA,EAAA;AAAA,EAAO;AAGtE,SACE,gBAAAQ,EAAC,UAAA,EAAO,WAAWH,GAAe,SAASc,GAAa,OAAAb,GAAe,GAAGF,GACvE,UAAAT,KACC,gBAAAa,EAAC,OAAA,EAAI,OAAM,8BAA6B,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACjG,4BAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,4BAAA,CAA4B,GACnG,GAEJ;AAEJ;AAEAd,EAAY,UAAUe;"}
1
+ {"version":3,"file":"index30.js","sources":["../src/components/Flex.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse'\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n flex?: '1' | 'auto' | 'initial' | 'none'\n inline?: boolean\n minHeight?: 'screen' | 'full' | 'fit' | 'min' | 'max'\n minWidth?: 'full' | 'fit' | 'min' | 'max'\n children?: React.ReactNode\n}\n\nexport const Flex: React.FC<FlexProps> = ({\n direction,\n justify,\n align,\n wrap,\n gap,\n flex,\n inline = false,\n minHeight,\n minWidth,\n className = '',\n style,\n children,\n ...rest\n}) => {\n const isNumericGap = typeof gap === 'number'\n\n const classes = [\n inline ? 'inline-flex' : 'flex',\n direction === 'row' && 'flex-row',\n direction === 'column' && 'flex-col',\n direction === 'row-reverse' && 'flex-row-reverse',\n direction === 'column-reverse' && 'flex-col-reverse',\n justify === 'start' && 'justify-start',\n justify === 'end' && 'justify-end',\n justify === 'center' && 'justify-center',\n justify === 'between' && 'justify-between',\n justify === 'around' && 'justify-around',\n justify === 'evenly' && 'justify-evenly',\n align === 'start' && 'items-start',\n align === 'end' && 'items-end',\n align === 'center' && 'items-center',\n align === 'baseline' && 'items-baseline',\n align === 'stretch' && 'items-stretch',\n wrap === true && 'flex-wrap',\n wrap === 'wrap' && 'flex-wrap',\n wrap === 'nowrap' && 'flex-nowrap',\n wrap === 'wrap-reverse' && 'flex-wrap-reverse',\n !isNumericGap && gap === 'xs' && 'gap-1',\n !isNumericGap && gap === 'sm' && 'gap-2',\n !isNumericGap && gap === 'md' && 'gap-4',\n !isNumericGap && gap === 'lg' && 'gap-6',\n !isNumericGap && gap === 'xl' && 'gap-8',\n flex === '1' && 'flex-1',\n flex === 'auto' && 'flex-auto',\n flex === 'initial' && 'flex-initial',\n flex === 'none' && 'flex-none',\n minHeight === 'screen' && 'min-h-screen',\n minHeight === 'full' && 'min-h-full',\n minHeight === 'fit' && 'min-h-fit',\n minHeight === 'min' && 'min-h-min',\n minHeight === 'max' && 'min-h-max',\n minWidth === 'full' && 'min-w-full',\n minWidth === 'fit' && 'min-w-fit',\n minWidth === 'min' && 'min-w-min',\n minWidth === 'max' && 'min-w-max',\n className,\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericGap ? { gap: `${gap}px` } : {}),\n }\n\n return (\n <div className={classes} style={combinedStyle} {...rest}>\n {children}\n </div>\n )\n}\n"],"names":["Flex","direction","justify","align","wrap","gap","flex","inline","minHeight","minWidth","className","style","children","rest","isNumericGap","classes","combinedStyle","jsx"],"mappings":";AAeO,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