seppia 0.0.0-stage → 0.1.0

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 (252) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -3
  3. package/dist/chunk-2PABDSNH.cjs +208 -0
  4. package/dist/chunk-2Z4YKJMT.js +329 -0
  5. package/dist/chunk-344MRWFO.js +25 -0
  6. package/dist/chunk-3A2LHCPV.cjs +30 -0
  7. package/dist/chunk-3NQ776G6.cjs +204 -0
  8. package/dist/chunk-3XIEBFVO.cjs +130 -0
  9. package/dist/chunk-4IHNW52F.cjs +197 -0
  10. package/dist/chunk-4YGBUMQC.js +160 -0
  11. package/dist/chunk-5ARTY5RT.cjs +66 -0
  12. package/dist/chunk-5PAJS63K.cjs +156 -0
  13. package/dist/chunk-5Z32CAHE.cjs +261 -0
  14. package/dist/chunk-66ITQTT2.js +108 -0
  15. package/dist/chunk-6EABLOB7.js +190 -0
  16. package/dist/chunk-6FF73V3S.js +190 -0
  17. package/dist/chunk-6LRDNOZX.cjs +138 -0
  18. package/dist/chunk-76MEQHGW.js +192 -0
  19. package/dist/chunk-7B2YEOYF.js +26 -0
  20. package/dist/chunk-7Y22U2ZF.js +370 -0
  21. package/dist/chunk-AFGJQET4.js +186 -0
  22. package/dist/chunk-AG3OBSP5.cjs +216 -0
  23. package/dist/chunk-AHRXESD2.js +126 -0
  24. package/dist/chunk-AJPI65BL.cjs +153 -0
  25. package/dist/chunk-CCDDQHCS.js +182 -0
  26. package/dist/chunk-CGX6YCV6.js +130 -0
  27. package/dist/chunk-CPUW5LDN.cjs +28 -0
  28. package/dist/chunk-DAO7YH2R.cjs +165 -0
  29. package/dist/chunk-DO5WEBTN.cjs +139 -0
  30. package/dist/chunk-DUUDPN7C.cjs +203 -0
  31. package/dist/chunk-EOPY2VWT.cjs +185 -0
  32. package/dist/chunk-EUQ6BCML.cjs +175 -0
  33. package/dist/chunk-EYO4XMKU.js +145 -0
  34. package/dist/chunk-F7UECO7G.js +175 -0
  35. package/dist/chunk-FGJDDSUJ.js +303 -0
  36. package/dist/chunk-G5UZZ2XG.cjs +52 -0
  37. package/dist/chunk-GJ6WO63L.js +216 -0
  38. package/dist/chunk-GP32TY6P.cjs +409 -0
  39. package/dist/chunk-HQLB5Z37.cjs +275 -0
  40. package/dist/chunk-HSXGQNQ6.js +143 -0
  41. package/dist/chunk-I2XZ2WMY.js +385 -0
  42. package/dist/chunk-I525FOTN.cjs +214 -0
  43. package/dist/chunk-IAPRIVJO.js +157 -0
  44. package/dist/chunk-IUSSIILO.cjs +393 -0
  45. package/dist/chunk-JV6GJ3JJ.js +92 -0
  46. package/dist/chunk-KPG24YFL.js +30 -0
  47. package/dist/chunk-LGBMJIY6.js +174 -0
  48. package/dist/chunk-LYEOVFOQ.cjs +148 -0
  49. package/dist/chunk-LYYMITLC.js +238 -0
  50. package/dist/chunk-M42F5QS5.cjs +212 -0
  51. package/dist/chunk-NN3HMY7H.cjs +260 -0
  52. package/dist/chunk-NU5MGYFP.cjs +167 -0
  53. package/dist/chunk-OCIKUJ3U.js +117 -0
  54. package/dist/chunk-PBMXL53R.cjs +39 -0
  55. package/dist/chunk-PGEK6DFE.cjs +351 -0
  56. package/dist/chunk-QPWVBVDC.cjs +130 -0
  57. package/dist/chunk-QWYHH465.cjs +117 -0
  58. package/dist/chunk-RFCZJPGM.js +116 -0
  59. package/dist/chunk-RIBXHAKG.cjs +179 -0
  60. package/dist/chunk-SDWRKTFC.cjs +158 -0
  61. package/dist/chunk-SMY24MVU.js +92 -0
  62. package/dist/chunk-SSARMSS3.cjs +325 -0
  63. package/dist/chunk-T533JPW5.js +131 -0
  64. package/dist/chunk-T7AMVHIB.js +221 -0
  65. package/dist/chunk-TVGVZSIA.js +130 -0
  66. package/dist/chunk-UFU5S3LK.cjs +244 -0
  67. package/dist/chunk-UFUN2OKY.js +35 -0
  68. package/dist/chunk-VDSMO63G.cjs +153 -0
  69. package/dist/chunk-VHXWP5OX.cjs +115 -0
  70. package/dist/chunk-VW32EE3I.js +153 -0
  71. package/dist/chunk-WGFJLFTP.js +40 -0
  72. package/dist/chunk-WSL2OVTO.js +136 -0
  73. package/dist/chunk-WVWVJSU2.cjs +309 -0
  74. package/dist/chunk-XLZPYDNI.js +287 -0
  75. package/dist/chunk-XUBFOAT4.js +239 -0
  76. package/dist/chunk-Y3UCNSXF.js +253 -0
  77. package/dist/chunk-YDJMVDAJ.cjs +196 -0
  78. package/dist/chunk-ZF5HY2K4.cjs +238 -0
  79. package/dist/chunk-ZXKEYL6L.js +181 -0
  80. package/dist/chunk-ZZYMYQU2.js +108 -0
  81. package/dist/components/accordion.cjs +26 -0
  82. package/dist/components/accordion.d.cts +41 -0
  83. package/dist/components/accordion.d.ts +41 -0
  84. package/dist/components/accordion.js +5 -0
  85. package/dist/components/calendar.cjs +14 -0
  86. package/dist/components/calendar.d.cts +41 -0
  87. package/dist/components/calendar.d.ts +41 -0
  88. package/dist/components/calendar.js +5 -0
  89. package/dist/components/checkbox.cjs +14 -0
  90. package/dist/components/checkbox.d.cts +27 -0
  91. package/dist/components/checkbox.d.ts +27 -0
  92. package/dist/components/checkbox.js +5 -0
  93. package/dist/components/chip-select.cjs +14 -0
  94. package/dist/components/chip-select.d.cts +31 -0
  95. package/dist/components/chip-select.d.ts +31 -0
  96. package/dist/components/chip-select.js +5 -0
  97. package/dist/components/clock.cjs +12 -0
  98. package/dist/components/clock.d.cts +25 -0
  99. package/dist/components/clock.d.ts +25 -0
  100. package/dist/components/clock.js +3 -0
  101. package/dist/components/color-picker.cjs +14 -0
  102. package/dist/components/color-picker.d.cts +23 -0
  103. package/dist/components/color-picker.d.ts +23 -0
  104. package/dist/components/color-picker.js +5 -0
  105. package/dist/components/command-palette.cjs +20 -0
  106. package/dist/components/command-palette.d.cts +53 -0
  107. package/dist/components/command-palette.d.ts +53 -0
  108. package/dist/components/command-palette.js +7 -0
  109. package/dist/components/date-picker.cjs +18 -0
  110. package/dist/components/date-picker.d.cts +40 -0
  111. package/dist/components/date-picker.d.ts +40 -0
  112. package/dist/components/date-picker.js +9 -0
  113. package/dist/components/drawer.cjs +16 -0
  114. package/dist/components/drawer.d.cts +22 -0
  115. package/dist/components/drawer.d.ts +22 -0
  116. package/dist/components/drawer.js +7 -0
  117. package/dist/components/floating-panel.cjs +13 -0
  118. package/dist/components/floating-panel.d.cts +25 -0
  119. package/dist/components/floating-panel.d.ts +25 -0
  120. package/dist/components/floating-panel.js +4 -0
  121. package/dist/components/hold-button.cjs +13 -0
  122. package/dist/components/hold-button.d.cts +30 -0
  123. package/dist/components/hold-button.d.ts +30 -0
  124. package/dist/components/hold-button.js +4 -0
  125. package/dist/components/knob.cjs +15 -0
  126. package/dist/components/knob.d.cts +33 -0
  127. package/dist/components/knob.d.ts +33 -0
  128. package/dist/components/knob.js +6 -0
  129. package/dist/components/magnetic-button.cjs +13 -0
  130. package/dist/components/magnetic-button.d.cts +23 -0
  131. package/dist/components/magnetic-button.d.ts +23 -0
  132. package/dist/components/magnetic-button.js +4 -0
  133. package/dist/components/morph-button.cjs +13 -0
  134. package/dist/components/morph-button.d.cts +34 -0
  135. package/dist/components/morph-button.d.ts +34 -0
  136. package/dist/components/morph-button.js +4 -0
  137. package/dist/components/morph-dialog.cjs +32 -0
  138. package/dist/components/morph-dialog.d.cts +30 -0
  139. package/dist/components/morph-dialog.d.ts +30 -0
  140. package/dist/components/morph-dialog.js +7 -0
  141. package/dist/components/number-field.cjs +15 -0
  142. package/dist/components/number-field.d.cts +32 -0
  143. package/dist/components/number-field.d.ts +32 -0
  144. package/dist/components/number-field.js +6 -0
  145. package/dist/components/pin-input.cjs +14 -0
  146. package/dist/components/pin-input.d.cts +29 -0
  147. package/dist/components/pin-input.d.ts +29 -0
  148. package/dist/components/pin-input.js +5 -0
  149. package/dist/components/popover.cjs +16 -0
  150. package/dist/components/popover.d.cts +26 -0
  151. package/dist/components/popover.d.ts +26 -0
  152. package/dist/components/popover.js +7 -0
  153. package/dist/components/progress.cjs +17 -0
  154. package/dist/components/progress.d.cts +39 -0
  155. package/dist/components/progress.d.ts +39 -0
  156. package/dist/components/progress.js +4 -0
  157. package/dist/components/radial-menu.cjs +14 -0
  158. package/dist/components/radial-menu.d.cts +31 -0
  159. package/dist/components/radial-menu.d.ts +31 -0
  160. package/dist/components/radial-menu.js +5 -0
  161. package/dist/components/radio-group.cjs +14 -0
  162. package/dist/components/radio-group.d.cts +34 -0
  163. package/dist/components/radio-group.d.ts +34 -0
  164. package/dist/components/radio-group.js +5 -0
  165. package/dist/components/resizable-panels.cjs +18 -0
  166. package/dist/components/resizable-panels.d.cts +24 -0
  167. package/dist/components/resizable-panels.d.ts +24 -0
  168. package/dist/components/resizable-panels.js +5 -0
  169. package/dist/components/segmented-control.cjs +14 -0
  170. package/dist/components/segmented-control.d.cts +34 -0
  171. package/dist/components/segmented-control.d.ts +34 -0
  172. package/dist/components/segmented-control.js +5 -0
  173. package/dist/components/slider.cjs +15 -0
  174. package/dist/components/slider.d.cts +39 -0
  175. package/dist/components/slider.d.ts +39 -0
  176. package/dist/components/slider.js +6 -0
  177. package/dist/components/sortable-list.cjs +13 -0
  178. package/dist/components/sortable-list.d.cts +24 -0
  179. package/dist/components/sortable-list.d.ts +24 -0
  180. package/dist/components/sortable-list.js +4 -0
  181. package/dist/components/sparkline.cjs +14 -0
  182. package/dist/components/sparkline.d.cts +28 -0
  183. package/dist/components/sparkline.d.ts +28 -0
  184. package/dist/components/sparkline.js +5 -0
  185. package/dist/components/swipe-confirm.cjs +13 -0
  186. package/dist/components/swipe-confirm.d.cts +18 -0
  187. package/dist/components/swipe-confirm.d.ts +18 -0
  188. package/dist/components/swipe-confirm.js +4 -0
  189. package/dist/components/switch.cjs +15 -0
  190. package/dist/components/switch.d.cts +29 -0
  191. package/dist/components/switch.d.ts +29 -0
  192. package/dist/components/switch.js +6 -0
  193. package/dist/components/tabs.cjs +30 -0
  194. package/dist/components/tabs.d.cts +29 -0
  195. package/dist/components/tabs.d.ts +29 -0
  196. package/dist/components/tabs.js +5 -0
  197. package/dist/components/tether.cjs +16 -0
  198. package/dist/components/tether.d.cts +35 -0
  199. package/dist/components/tether.d.ts +35 -0
  200. package/dist/components/tether.js +3 -0
  201. package/dist/components/theme-switch.cjs +14 -0
  202. package/dist/components/theme-switch.d.cts +24 -0
  203. package/dist/components/theme-switch.d.ts +24 -0
  204. package/dist/components/theme-switch.js +5 -0
  205. package/dist/components/toaster.cjs +21 -0
  206. package/dist/components/toaster.d.cts +71 -0
  207. package/dist/components/toaster.d.ts +71 -0
  208. package/dist/components/toaster.js +4 -0
  209. package/dist/components/wheel-picker.cjs +15 -0
  210. package/dist/components/wheel-picker.d.cts +27 -0
  211. package/dist/components/wheel-picker.d.ts +27 -0
  212. package/dist/components/wheel-picker.js +6 -0
  213. package/dist/css/accordion.css +2 -0
  214. package/dist/css/base.css +2 -0
  215. package/dist/css/calendar.css +2 -0
  216. package/dist/css/checkbox.css +2 -0
  217. package/dist/css/chip-select.css +2 -0
  218. package/dist/css/clock.css +2 -0
  219. package/dist/css/color-picker.css +2 -0
  220. package/dist/css/command-palette.css +2 -0
  221. package/dist/css/date-picker.css +2 -0
  222. package/dist/css/drawer.css +2 -0
  223. package/dist/css/floating-panel.css +2 -0
  224. package/dist/css/hold-button.css +2 -0
  225. package/dist/css/knob.css +2 -0
  226. package/dist/css/magnetic-button.css +2 -0
  227. package/dist/css/morph-button.css +2 -0
  228. package/dist/css/morph-dialog.css +2 -0
  229. package/dist/css/number-field.css +2 -0
  230. package/dist/css/pin-input.css +2 -0
  231. package/dist/css/popover.css +2 -0
  232. package/dist/css/progress.css +2 -0
  233. package/dist/css/radial-menu.css +2 -0
  234. package/dist/css/radio-group.css +2 -0
  235. package/dist/css/resizable-panels.css +2 -0
  236. package/dist/css/segmented-control.css +2 -0
  237. package/dist/css/slider.css +2 -0
  238. package/dist/css/sortable-list.css +2 -0
  239. package/dist/css/sparkline.css +2 -0
  240. package/dist/css/swipe-confirm.css +2 -0
  241. package/dist/css/switch.css +2 -0
  242. package/dist/css/tabs.css +2 -0
  243. package/dist/css/tether.css +2 -0
  244. package/dist/css/theme-switch.css +2 -0
  245. package/dist/css/toaster.css +2 -0
  246. package/dist/css/wheel-picker.css +2 -0
  247. package/dist/index.cjs +249 -0
  248. package/dist/index.d.cts +77 -0
  249. package/dist/index.d.ts +77 -0
  250. package/dist/index.js +40 -0
  251. package/dist/styles.css +2 -0
  252. package/package.json +98 -6
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ // src/internal/math.ts
3
+ var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
4
+ var decimalsOf = (step) => {
5
+ const s = String(step);
6
+ const i = s.indexOf(".");
7
+ return i === -1 ? 0 : s.length - i - 1;
8
+ };
9
+ var snapToStep = (value, step, min) => {
10
+ if (!step) return value;
11
+ const snapped = Math.round((value - min) / step) * step + min;
12
+ return Number(snapped.toFixed(decimalsOf(step)));
13
+ };
14
+ var rubberband = (overflow, dimension, constant = 0.55) => {
15
+ const sign = Math.sign(overflow);
16
+ const d = Math.abs(overflow);
17
+ return sign * (d * dimension * constant / (dimension + constant * d));
18
+ };
19
+ var rubberClamp = (value, min, max, dimension, constant = 0.55) => {
20
+ if (value < min) return min + rubberband(value - min, dimension, constant);
21
+ if (value > max) return max + rubberband(value - max, dimension, constant);
22
+ return value;
23
+ };
24
+
25
+ export { clamp, rubberClamp, rubberband, snapToStep };
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ // src/internal/math.ts
5
+ var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
6
+ var decimalsOf = (step) => {
7
+ const s = String(step);
8
+ const i = s.indexOf(".");
9
+ return i === -1 ? 0 : s.length - i - 1;
10
+ };
11
+ var snapToStep = (value, step, min) => {
12
+ if (!step) return value;
13
+ const snapped = Math.round((value - min) / step) * step + min;
14
+ return Number(snapped.toFixed(decimalsOf(step)));
15
+ };
16
+ var rubberband = (overflow, dimension, constant = 0.55) => {
17
+ const sign = Math.sign(overflow);
18
+ const d = Math.abs(overflow);
19
+ return sign * (d * dimension * constant / (dimension + constant * d));
20
+ };
21
+ var rubberClamp = (value, min, max, dimension, constant = 0.55) => {
22
+ if (value < min) return min + rubberband(value - min, dimension, constant);
23
+ if (value > max) return max + rubberband(value - max, dimension, constant);
24
+ return value;
25
+ };
26
+
27
+ exports.clamp = clamp;
28
+ exports.rubberClamp = rubberClamp;
29
+ exports.rubberband = rubberband;
30
+ exports.snapToStep = snapToStep;
@@ -0,0 +1,204 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ var chunk5ARTY5RT_cjs = require('./chunk-5ARTY5RT.cjs');
5
+ var chunkPBMXL53R_cjs = require('./chunk-PBMXL53R.cjs');
6
+ var React = require('react');
7
+ var react = require('motion/react');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
+
30
+ var WIDTH = { type: "spring", stiffness: 380, damping: 30 };
31
+ var SWAP = { type: "spring", stiffness: 520, damping: 34 };
32
+ var MorphButton = React__namespace.forwardRef(function MorphButton2({
33
+ onAction,
34
+ status: statusProp,
35
+ variant = "collapse",
36
+ progress = 0,
37
+ children,
38
+ loadingLabel = "Working",
39
+ successLabel = "Done",
40
+ errorLabel = "Try again",
41
+ resetAfter = 1800,
42
+ tone = "ink",
43
+ size = "md",
44
+ haptics = true,
45
+ onStatusChange,
46
+ className,
47
+ disabled,
48
+ ...rest
49
+ }, ref) {
50
+ const [internal, setInternal] = React__namespace.useState("idle");
51
+ const status = statusProp ?? internal;
52
+ const { t, reduced } = chunkPBMXL53R_cjs.useMotionPreset();
53
+ const local = React__namespace.useRef(null);
54
+ const measureRef = React__namespace.useRef(null);
55
+ const width = react.useMotionValue("auto");
56
+ const fill = react.useMotionValue(0);
57
+ const fillScale = react.useTransform(fill, (v) => v);
58
+ const timer = React__namespace.useRef(void 0);
59
+ const mounted = React__namespace.useRef(true);
60
+ React__namespace.useEffect(() => () => {
61
+ mounted.current = false;
62
+ clearTimeout(timer.current);
63
+ }, []);
64
+ const prev = React__namespace.useRef(status);
65
+ React__namespace.useEffect(() => {
66
+ if (prev.current === status) return;
67
+ prev.current = status;
68
+ onStatusChange?.(status);
69
+ if (haptics && status === "success") chunk5ARTY5RT_cjs.haptic([6, 40, 10]);
70
+ if (haptics && status === "error") chunk5ARTY5RT_cjs.haptic([20, 30, 20]);
71
+ if (status === "error" && local.current && !reduced) {
72
+ react.animate(local.current, { x: [0, -7, 6, -4, 3, 0] }, { duration: 0.42, ease: "easeOut" });
73
+ }
74
+ if ((status === "success" || status === "error") && statusProp === void 0 && resetAfter > 0) {
75
+ clearTimeout(timer.current);
76
+ timer.current = setTimeout(() => mounted.current && setInternal("idle"), resetAfter);
77
+ }
78
+ }, [status]);
79
+ chunk5ARTY5RT_cjs.useIsoLayoutEffect(() => {
80
+ const el = local.current;
81
+ const measure = measureRef.current;
82
+ if (!el || !measure) return;
83
+ if (variant !== "collapse") {
84
+ width.set("auto");
85
+ return;
86
+ }
87
+ const natural = measure.offsetWidth;
88
+ const circle = el.offsetHeight;
89
+ const target = status === "loading" ? circle : status === "idle" ? natural : Math.max(circle, natural * 0.86);
90
+ if (width.get() === "auto") {
91
+ width.set(target);
92
+ return;
93
+ }
94
+ react.animate(width, target, t(status === "loading" ? { type: "spring", stiffness: 420, damping: 32 } : { type: "spring", stiffness: 300, damping: 19 }));
95
+ }, [status, variant, size, children, successLabel, errorLabel]);
96
+ React__namespace.useEffect(() => {
97
+ if (variant !== "progress") return;
98
+ const target = status === "loading" ? progress : status === "success" ? 1 : 0;
99
+ react.animate(fill, target, t(status === "idle" ? { duration: 0.2 } : { type: "spring", stiffness: 120, damping: 22 }));
100
+ }, [progress, status, variant]);
101
+ const handleClick = async (event) => {
102
+ if (status === "loading" || disabled) return;
103
+ const result = onAction?.(event);
104
+ if (statusProp !== void 0 || !(result instanceof Promise || result && typeof result.then === "function")) return;
105
+ clearTimeout(timer.current);
106
+ setInternal("loading");
107
+ try {
108
+ await result;
109
+ if (mounted.current) setInternal("success");
110
+ } catch {
111
+ if (mounted.current) setInternal("error");
112
+ }
113
+ };
114
+ const label = status === "loading" ? loadingLabel : status === "success" ? successLabel : status === "error" ? errorLabel : children;
115
+ const percent = Math.round(Math.min(1, Math.max(0, progress)) * 100);
116
+ return /* @__PURE__ */ jsxRuntime.jsxs(
117
+ react.motion.button,
118
+ {
119
+ ...rest,
120
+ ref: chunk5ARTY5RT_cjs.mergeRefs(local, ref),
121
+ type: rest.type ?? "button",
122
+ layout: variant === "inline" ? true : void 0,
123
+ transition: t(WIDTH),
124
+ style: { ...rest.style, width: variant === "collapse" ? width : void 0, borderRadius: 999 },
125
+ className: chunkPBMXL53R_cjs.cx("fl-reset-button fl-morph", className),
126
+ "data-variant": variant,
127
+ "data-status": status,
128
+ "data-tone": tone,
129
+ "data-size": size,
130
+ disabled,
131
+ "aria-disabled": status === "loading" || void 0,
132
+ "aria-busy": status === "loading" || void 0,
133
+ whileTap: reduced || status === "loading" ? void 0 : { scale: 0.96 },
134
+ onClick: handleClick,
135
+ children: [
136
+ variant === "collapse" && /* @__PURE__ */ jsxRuntime.jsx("span", { ref: measureRef, className: "fl-morph__measure", "aria-hidden": true, children }),
137
+ variant === "progress" && /* @__PURE__ */ jsxRuntime.jsx(react.motion.span, { className: "fl-morph__fill", "aria-hidden": true, style: { scaleX: fillScale } }),
138
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "fl-morph__stage", children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
139
+ react.motion.span,
140
+ {
141
+ className: "fl-morph__content",
142
+ layout: variant === "inline" ? "position" : void 0,
143
+ initial: { opacity: 0, y: variant === "collapse" ? 0 : 14, scale: variant === "collapse" ? 0.6 : 1, filter: "blur(3px)" },
144
+ animate: { opacity: 1, y: 0, scale: 1, filter: "blur(0px)" },
145
+ exit: { opacity: 0, y: variant === "collapse" ? 0 : -14, scale: variant === "collapse" ? 0.6 : 1, filter: "blur(3px)" },
146
+ transition: t({ ...SWAP, filter: { duration: 0.18, ease: "easeOut" } }),
147
+ children: [
148
+ status === "loading" && /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}),
149
+ status === "success" && /* @__PURE__ */ jsxRuntime.jsx(Glyph, { kind: "success" }),
150
+ status === "error" && /* @__PURE__ */ jsxRuntime.jsx(Glyph, { kind: "error" }),
151
+ !(variant === "collapse" && status === "loading") && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "fl-morph__label", children: [
152
+ label,
153
+ variant === "progress" && status === "loading" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "fl-morph__percent", children: [
154
+ " ",
155
+ percent,
156
+ "%"
157
+ ] })
158
+ ] })
159
+ ]
160
+ },
161
+ status
162
+ ) }) }),
163
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "fl-sr-only", "aria-live": "polite", children: status === "idle" ? "" : typeof label === "string" ? label : status })
164
+ ]
165
+ }
166
+ );
167
+ });
168
+ function Spinner() {
169
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "fl-morph__spinner", viewBox: "0 0 20 20", "aria-hidden": true, children: [
170
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "10", r: "7.5", fill: "none", stroke: "currentColor", strokeOpacity: "0.22", strokeWidth: "2" }),
171
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "10", r: "7.5", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeDasharray: "14 33.1" })
172
+ ] });
173
+ }
174
+ function Glyph({ kind }) {
175
+ const { t } = chunkPBMXL53R_cjs.useMotionPreset();
176
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "fl-morph__glyph", viewBox: "0 0 20 20", "aria-hidden": true, children: kind === "success" ? /* @__PURE__ */ jsxRuntime.jsx(
177
+ react.motion.path,
178
+ {
179
+ d: "M5 10.4 L8.4 13.6 L15 6.6",
180
+ fill: "none",
181
+ stroke: "currentColor",
182
+ strokeWidth: "2.2",
183
+ strokeLinecap: "round",
184
+ strokeLinejoin: "round",
185
+ initial: { pathLength: 0 },
186
+ animate: { pathLength: 1 },
187
+ transition: t({ type: "spring", stiffness: 200, damping: 22, delay: 0.1 })
188
+ }
189
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
190
+ react.motion.path,
191
+ {
192
+ d: "M6 6 L14 14 M14 6 L6 14",
193
+ fill: "none",
194
+ stroke: "currentColor",
195
+ strokeWidth: "2.2",
196
+ strokeLinecap: "round",
197
+ initial: { pathLength: 0 },
198
+ animate: { pathLength: 1 },
199
+ transition: t({ type: "spring", stiffness: 220, damping: 24, delay: 0.08 })
200
+ }
201
+ ) });
202
+ }
203
+
204
+ exports.MorphButton = MorphButton;
@@ -0,0 +1,130 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ var chunkNU5MGYFP_cjs = require('./chunk-NU5MGYFP.cjs');
5
+ var chunkPGEK6DFE_cjs = require('./chunk-PGEK6DFE.cjs');
6
+ var chunkG5UZZ2XG_cjs = require('./chunk-G5UZZ2XG.cjs');
7
+ var chunkPBMXL53R_cjs = require('./chunk-PBMXL53R.cjs');
8
+ var React = require('react');
9
+ var react = require('motion/react');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+
12
+ function _interopNamespace(e) {
13
+ if (e && e.__esModule) return e;
14
+ var n = Object.create(null);
15
+ if (e) {
16
+ Object.keys(e).forEach(function (k) {
17
+ if (k !== 'default') {
18
+ var d = Object.getOwnPropertyDescriptor(e, k);
19
+ Object.defineProperty(n, k, d.get ? d : {
20
+ enumerable: true,
21
+ get: function () { return e[k]; }
22
+ });
23
+ }
24
+ });
25
+ }
26
+ n.default = e;
27
+ return Object.freeze(n);
28
+ }
29
+
30
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
31
+
32
+ var DatePicker = React__namespace.forwardRef(function DatePicker2(props, ref) {
33
+ const {
34
+ mode = "single",
35
+ value: valueProp,
36
+ defaultValue,
37
+ onValueChange,
38
+ placeholder,
39
+ locale,
40
+ formatOptions = { month: "short", day: "numeric", year: "numeric" },
41
+ min,
42
+ max,
43
+ isDateDisabled,
44
+ weekStartsOn = 1,
45
+ placement = "bottom-start",
46
+ size = "md",
47
+ disabled,
48
+ className,
49
+ container,
50
+ today
51
+ } = props;
52
+ const isRange = mode === "range";
53
+ const [value, setValue] = chunkG5UZZ2XG_cjs.useControllableState({
54
+ value: valueProp,
55
+ defaultValue: defaultValue ?? (isRange ? { start: null, end: null } : null),
56
+ onChange: onValueChange
57
+ });
58
+ const [open, setOpen] = React__namespace.useState(false);
59
+ const { t } = chunkPBMXL53R_cjs.useMotionPreset();
60
+ const fmt = React__namespace.useMemo(() => new Intl.DateTimeFormat(locale, formatOptions), [locale, JSON.stringify(formatOptions)]);
61
+ const text = isRange ? value?.start ? `${fmt.format(value.start)} \u2013 ${value.end ? fmt.format(value.end) : "\u2026"}` : "" : value ? fmt.format(value) : "";
62
+ return /* @__PURE__ */ jsxRuntime.jsx(
63
+ chunkNU5MGYFP_cjs.Popover,
64
+ {
65
+ open,
66
+ onOpenChange: setOpen,
67
+ placement,
68
+ container,
69
+ className: "fl-date-picker__popover",
70
+ "aria-label": isRange ? "Choose dates" : "Choose a date",
71
+ content: isRange ? /* @__PURE__ */ jsxRuntime.jsx(
72
+ chunkPGEK6DFE_cjs.Calendar,
73
+ {
74
+ mode: "range",
75
+ value,
76
+ onValueChange: (next) => {
77
+ setValue(next);
78
+ if (next.start && next.end) setTimeout(() => setOpen(false), 260);
79
+ },
80
+ locale,
81
+ min,
82
+ max,
83
+ isDateDisabled,
84
+ weekStartsOn,
85
+ today
86
+ }
87
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
88
+ chunkPGEK6DFE_cjs.Calendar,
89
+ {
90
+ value,
91
+ onValueChange: (next) => {
92
+ setValue(next);
93
+ setTimeout(() => setOpen(false), 220);
94
+ },
95
+ locale,
96
+ min,
97
+ max,
98
+ isDateDisabled,
99
+ weekStartsOn,
100
+ today
101
+ }
102
+ ),
103
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
104
+ "button",
105
+ {
106
+ ref,
107
+ type: "button",
108
+ disabled,
109
+ className: chunkPBMXL53R_cjs.cx("fl-reset-button fl-date-picker", className),
110
+ "data-size": size,
111
+ "data-empty": !text || void 0,
112
+ children: [
113
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "fl-date-picker__icon", viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": true, children: [
114
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2", y: "3", width: "12", height: "11", rx: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.3" }),
115
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 6.5h12M5.5 1.8v2.4M10.5 1.8v2.4", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
116
+ ] }),
117
+ props["aria-label"] && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "fl-sr-only", children: [
118
+ props["aria-label"],
119
+ ": "
120
+ ] }),
121
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "fl-date-picker__text", children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsxRuntime.jsx(react.motion.span, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -8 }, transition: t({ type: "spring", stiffness: 500, damping: 34 }), children: text || placeholder || (isRange ? "Select dates" : "Select a date") }, text || "empty") }) }),
122
+ /* @__PURE__ */ jsxRuntime.jsx(react.motion.svg, { className: "fl-date-picker__chevron", viewBox: "0 0 12 12", width: "12", height: "12", "aria-hidden": true, animate: { rotate: open ? 180 : 0 }, transition: t({ type: "spring", stiffness: 500, damping: 30 }), children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 4.5 6 7.5 9 4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
123
+ ]
124
+ }
125
+ )
126
+ }
127
+ );
128
+ });
129
+
130
+ exports.DatePicker = DatePicker;
@@ -0,0 +1,197 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ var chunk5ARTY5RT_cjs = require('./chunk-5ARTY5RT.cjs');
5
+ var chunkG5UZZ2XG_cjs = require('./chunk-G5UZZ2XG.cjs');
6
+ var chunkPBMXL53R_cjs = require('./chunk-PBMXL53R.cjs');
7
+ var React = require('react');
8
+ var react = require('motion/react');
9
+ var jsxRuntime = require('react/jsx-runtime');
10
+
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
+
31
+ var CHECK = "M4.6 9.4 L7.7 12.4 L13.6 6";
32
+ var DASH = "M5 9 L9 9 L13 9";
33
+ var PRESS = { type: "spring", stiffness: 900, damping: 40 };
34
+ var RELEASE = { type: "spring", stiffness: 520, damping: 14, mass: 0.7 };
35
+ var Checkbox = React__namespace.forwardRef(function Checkbox2({
36
+ checked: checkedProp,
37
+ defaultChecked = false,
38
+ onCheckedChange,
39
+ variant = "draw",
40
+ size = "md",
41
+ children,
42
+ description,
43
+ haptics = true,
44
+ disabled,
45
+ className,
46
+ style,
47
+ rootProps,
48
+ id,
49
+ ...rest
50
+ }, ref) {
51
+ const [state, setState] = chunkG5UZZ2XG_cjs.useControllableState({
52
+ value: checkedProp,
53
+ defaultValue: defaultChecked,
54
+ onChange: (next) => onCheckedChange?.(next === true)
55
+ });
56
+ const { t, reduced } = chunkPBMXL53R_cjs.useMotionPreset();
57
+ const inputRef = React__namespace.useRef(null);
58
+ const boxRef = React__namespace.useRef(null);
59
+ const [pressed, setPressed] = React__namespace.useState(false);
60
+ const [origin, setOrigin] = React__namespace.useState({ x: 50, y: 50 });
61
+ const generatedId = React__namespace.useId();
62
+ const inputId = id ?? generatedId;
63
+ const descriptionId = description ? `${inputId}-description` : void 0;
64
+ const labelId = children ? `${inputId}-label` : void 0;
65
+ const checked = state === true;
66
+ const indeterminate = state === "indeterminate";
67
+ const on = checked || indeterminate;
68
+ chunk5ARTY5RT_cjs.useIsoLayoutEffect(() => {
69
+ if (inputRef.current) inputRef.current.indeterminate = indeterminate;
70
+ }, [indeterminate]);
71
+ const onPointerDown = (event) => {
72
+ rootProps?.onPointerDown?.(event);
73
+ if (disabled || event.button !== 0) return;
74
+ setPressed(true);
75
+ const rect = boxRef.current?.getBoundingClientRect();
76
+ if (rect && rect.width) {
77
+ const inside = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
78
+ setOrigin(inside ? { x: (event.clientX - rect.left) / rect.width * 100, y: (event.clientY - rect.top) / rect.height * 100 } : { x: 50, y: 50 });
79
+ }
80
+ };
81
+ const release = () => setPressed(false);
82
+ const scale = pressed ? 0.84 : 1;
83
+ const boxTransition = t(pressed ? PRESS : RELEASE);
84
+ const mark = /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "fl-checkbox__mark", viewBox: "0 0 18 18", "aria-hidden": true, children: variant === "ink" ? /* @__PURE__ */ jsxRuntime.jsx(
85
+ react.motion.path,
86
+ {
87
+ d: indeterminate ? DASH : CHECK,
88
+ initial: false,
89
+ animate: on ? { scale: 1, opacity: 1, rotate: 0 } : { scale: 0.4, opacity: 0, rotate: -12 },
90
+ transition: t({ type: "spring", stiffness: 600, damping: 18, delay: on ? 0.05 : 0 }),
91
+ style: { originX: "9px", originY: "9px" }
92
+ }
93
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
94
+ react.motion.path,
95
+ {
96
+ initial: false,
97
+ animate: { d: indeterminate ? DASH : CHECK, pathLength: on ? 1 : 0, opacity: on ? 1 : 0 },
98
+ transition: t({
99
+ d: { type: "spring", stiffness: 420, damping: 26 },
100
+ pathLength: on ? { type: "spring", stiffness: 260, damping: 24, delay: 0.05 } : { duration: 0.14, ease: [0.4, 0, 1, 1] },
101
+ opacity: { duration: on ? 0.01 : 0.12, delay: on ? 0.05 : 0.08 }
102
+ })
103
+ }
104
+ ) });
105
+ return /* @__PURE__ */ jsxRuntime.jsxs(
106
+ "label",
107
+ {
108
+ ...rootProps,
109
+ htmlFor: inputId,
110
+ className: chunkPBMXL53R_cjs.cx("fl-checkbox", className, rootProps?.className),
111
+ style: { ...rootProps?.style, ...style },
112
+ "data-variant": variant,
113
+ "data-size": size,
114
+ "data-state": indeterminate ? "indeterminate" : checked ? "checked" : "unchecked",
115
+ "data-disabled": disabled || void 0,
116
+ onPointerDown,
117
+ onPointerUp: release,
118
+ onPointerLeave: release,
119
+ onPointerCancel: release,
120
+ children: [
121
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "fl-checkbox__control", children: [
122
+ /* @__PURE__ */ jsxRuntime.jsx(
123
+ "input",
124
+ {
125
+ ...rest,
126
+ ref: chunk5ARTY5RT_cjs.mergeRefs(inputRef, ref),
127
+ id: inputId,
128
+ type: "checkbox",
129
+ className: "fl-checkbox__input",
130
+ checked,
131
+ disabled,
132
+ "aria-labelledby": labelId,
133
+ "aria-describedby": descriptionId,
134
+ onChange: (event) => {
135
+ if (haptics) chunk5ARTY5RT_cjs.haptic(6);
136
+ setState(event.target.checked);
137
+ },
138
+ onKeyDown: (event) => {
139
+ rest.onKeyDown?.(event);
140
+ if (event.key === " " && !event.repeat) {
141
+ setOrigin({ x: 50, y: 50 });
142
+ setPressed(true);
143
+ }
144
+ },
145
+ onKeyUp: (event) => {
146
+ rest.onKeyUp?.(event);
147
+ if (event.key === " ") setPressed(false);
148
+ },
149
+ onBlur: (event) => {
150
+ rest.onBlur?.(event);
151
+ setPressed(false);
152
+ }
153
+ }
154
+ ),
155
+ /* @__PURE__ */ jsxRuntime.jsxs(react.motion.span, { ref: boxRef, className: "fl-checkbox__box", "aria-hidden": true, initial: false, animate: { scale }, transition: boxTransition, children: [
156
+ variant === "ink" ? /* @__PURE__ */ jsxRuntime.jsx(
157
+ react.motion.span,
158
+ {
159
+ className: "fl-checkbox__fill",
160
+ initial: false,
161
+ animate: { clipPath: on ? `circle(150% at ${origin.x}% ${origin.y}%)` : `circle(0% at ${origin.x}% ${origin.y}%)` },
162
+ transition: t(on ? { duration: 0.42, ease: [0.22, 1, 0.36, 1] } : { duration: 0.24, ease: [0.4, 0, 0.6, 1] })
163
+ }
164
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
165
+ react.motion.span,
166
+ {
167
+ className: "fl-checkbox__fill",
168
+ initial: false,
169
+ animate: on ? { scale: 1, opacity: 1 } : { scale: reduced ? 1 : 0.35, opacity: 0 },
170
+ transition: t(on ? { type: "spring", stiffness: 560, damping: 24 } : { duration: 0.16 })
171
+ }
172
+ ),
173
+ mark
174
+ ] })
175
+ ] }),
176
+ (children || description) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "fl-checkbox__text", children: [
177
+ children && /* @__PURE__ */ jsxRuntime.jsxs("span", { id: labelId, className: "fl-checkbox__label", children: [
178
+ children,
179
+ variant === "strike" && /* @__PURE__ */ jsxRuntime.jsx(
180
+ react.motion.span,
181
+ {
182
+ className: "fl-checkbox__strike",
183
+ "aria-hidden": true,
184
+ initial: false,
185
+ animate: { scaleX: checked ? 1 : 0, originX: checked ? 0 : 1 },
186
+ transition: t({ type: "spring", stiffness: 300, damping: 30, delay: checked ? 0.12 : 0 })
187
+ }
188
+ )
189
+ ] }),
190
+ description && /* @__PURE__ */ jsxRuntime.jsx("span", { id: descriptionId, className: "fl-checkbox__description", children: description })
191
+ ] })
192
+ ]
193
+ }
194
+ );
195
+ });
196
+
197
+ exports.Checkbox = Checkbox;