@akanjs/ui 0.9.33 → 0.9.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Input.d.ts CHANGED
@@ -23,7 +23,7 @@ export declare const Input: {
23
23
  Checkbox: ({ checked, onChange, className, ...rest }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
24
24
  };
25
25
  export type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "type" | "onChange" | "onPressEnter"> & {
26
- inputRef?: RefObject<HTMLTextAreaElement>;
26
+ inputRef?: RefObject<HTMLTextAreaElement | null>;
27
27
  value: string;
28
28
  nullable?: boolean;
29
29
  inputClassName?: string;
package/Load/Units.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { DataList } from "@akanjs/base";
2
2
  import { ClientInit } from "@akanjs/signal";
3
- import { MutableRefObject, ReactNode } from "react";
3
+ import { ReactNode, RefObject } from "react";
4
4
  interface DefaultProps<L extends {
5
5
  id: string;
6
6
  }> {
7
- containerRef?: MutableRefObject<HTMLDivElement | null>;
7
+ containerRef?: RefObject<HTMLDivElement>;
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
10
  noDiv?: boolean;
@@ -1,7 +1,6 @@
1
1
  import type { BaseClientEnv } from "@akanjs/base";
2
- import { type Location } from "@akanjs/client";
3
- import { AnimatedComponent } from "@react-spring/web";
4
- import { ExoticComponent, HTMLAttributes, MutableRefObject } from "react";
2
+ import { type Location, type TransitionStyle } from "@akanjs/client";
3
+ import { HTMLAttributes, RefObject } from "react";
5
4
  export declare const Client: {
6
5
  (): import("react/jsx-runtime").JSX.Element;
7
6
  Wrapper: ({ children, theme }: ClientWrapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -16,10 +15,10 @@ interface ClientWrapperProps {
16
15
  export declare const ClientWrapper: ({ children, theme }: ClientWrapperProps) => import("react/jsx-runtime").JSX.Element;
17
16
  interface ClientPathWrapperProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
18
17
  bind?: () => any;
19
- wrapperRef?: MutableRefObject<HTMLDivElement | null> | null;
18
+ wrapperRef?: RefObject<HTMLDivElement> | null;
20
19
  pageType?: "current" | "prev" | "cached";
21
20
  location?: Location;
22
- style?: NonNullable<AnimatedComponent<ExoticComponent>["defaultProps"]>["style"];
21
+ style?: TransitionStyle;
23
22
  prefix?: string;
24
23
  children?: any;
25
24
  layoutStyle?: "web" | "mobile";
package/animated.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare const animated: {
2
+ div: import("react-spring").AnimatedComponent<"div">;
3
+ g: import("react-spring").AnimatedComponent<"g">;
4
+ progress: import("react-spring").AnimatedComponent<"progress">;
5
+ };
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(BottomSheet_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_client = require("@akanjs/client");
26
26
  var import_store = require("@akanjs/store");
27
+ var import_ui = require("@akanjs/ui");
27
28
  var import_react = require("@use-gesture/react");
28
29
  var import_react2 = require("react");
29
30
  var import_bi = require("react-icons/bi");
@@ -69,7 +70,7 @@ const BottomSheet = (0, import_react2.forwardRef)(
69
70
  }, [open]);
70
71
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
71
72
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
- import_react_spring.a.div,
73
+ import_ui.animated.div,
73
74
  {
74
75
  style: {
75
76
  opacity
@@ -82,7 +83,7 @@ const BottomSheet = (0, import_react2.forwardRef)(
82
83
  }
83
84
  ),
84
85
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
85
- import_react_spring.a.div,
86
+ import_ui.animated.div,
86
87
  {
87
88
  ref,
88
89
  style: { y, paddingTop: type === "full" ? pageState.topSafeArea : 0 },
@@ -91,7 +92,7 @@ const BottomSheet = (0, import_react2.forwardRef)(
91
92
  "h-[100vh]": type === "full"
92
93
  }),
93
94
  children: [
94
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-8 w-full items-start justify-center pt-2", children: type === "half" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spring.a.div, { ...bind(), className: "flex h-8 w-full items-start justify-center pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 w-32 rounded-full bg-gray-300" }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-8 w-full items-start justify-center pt-2", children: type === "half" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.animated.div, { ...bind(), className: "flex h-8 w-full items-start justify-center pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 w-32 rounded-full bg-gray-300" }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
96
  "button",
96
97
  {
97
98
  onClick: () => void closeModal(),
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(Modal_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_client = require("@akanjs/client");
36
36
  var import_next = require("@akanjs/next");
37
+ var import_ui = require("@akanjs/ui");
37
38
  var Dialog = __toESM(require("@radix-ui/react-dialog"));
38
39
  var import_react = require("@use-gesture/react");
39
40
  var import_react2 = require("react");
@@ -47,7 +48,7 @@ const interpolate = (o, i, t) => {
47
48
  };
48
49
  const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) => {
49
50
  const { open, setOpen, title, action } = (0, import_react2.useContext)(import_context.DialogContext);
50
- const openRef = (0, import_react2.useRef)(null);
51
+ const openRef = (0, import_react2.useRef)(open);
51
52
  const { l } = (0, import_next.usePage)();
52
53
  const ref = (0, import_react2.useRef)(null);
53
54
  const [{ translate }, api] = (0, import_react_spring.useSpring)(() => ({ translate: 1 }));
@@ -117,7 +118,7 @@ const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) =
117
118
  className: "fixed top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
118
119
  asChild: true,
119
120
  forceMount: true,
120
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "z-10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_spring.a.div, { ref, style: { translateY, opacity }, children: [
121
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "z-10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.animated.div, { ref, style: { translateY, opacity }, children: [
121
122
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
123
  "button",
123
124
  {
@@ -135,17 +136,17 @@ const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) =
135
136
  ),
136
137
  children: [
137
138
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Dialog.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
138
- import_react_spring.a.div,
139
+ import_ui.animated.div,
139
140
  {
140
141
  ...bind(),
141
- className: "animate-fadeIn relative z-10 flex w-full cursor-pointer flex-col items-center justify-center px-4 pt-1",
142
+ className: "animate-fadeIn relative z-10 flex w-full cursor-pointer touch-pan-y flex-col items-center justify-center px-4 pt-1",
142
143
  children: [
143
144
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex w-full cursor-pointer items-center justify-center pt-1 opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-1 w-24 rounded-full bg-gray-500" }) }),
144
145
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex w-full items-center justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full text-start text-lg font-bold", children: title }) })
145
146
  ]
146
147
  }
147
148
  ) }),
148
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Dialog.Description, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
150
  "div",
150
151
  {
151
152
  className: (0, import_client.clsx)(
@@ -154,7 +155,7 @@ const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) =
154
155
  ),
155
156
  children
156
157
  }
157
- ),
158
+ ) }),
158
159
  action ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full", children: action }) : null
159
160
  ]
160
161
  }
package/cjs/DragAction.js CHANGED
@@ -23,6 +23,7 @@ __export(DragAction_exports, {
23
23
  module.exports = __toCommonJS(DragAction_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_client = require("@akanjs/client");
26
+ var import_ui = require("@akanjs/ui");
26
27
  var import_react = require("@use-gesture/react");
27
28
  var import_react2 = require("react");
28
29
  var import_react_spring = require("react-spring");
@@ -81,13 +82,13 @@ const DragAction = ({ className, children, onClick, onLeft, onRight }) => {
81
82
  };
82
83
  const Body = ({ children }) => {
83
84
  const { bind, x, onClick } = (0, import_react2.useContext)(DragActionContext);
84
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spring.animated.div, { className: "cursor-pointer", ...bind(), style: { x, touchAction: "pan-y" }, children });
85
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.animated.div, { className: "cursor-pointer", ...bind(), style: { x, touchAction: "pan-y" }, children });
85
86
  };
86
87
  DragAction.Body = Body;
87
88
  const Left = ({ children }) => {
88
89
  const { bind, leftOpacity, leftWidth } = (0, import_react2.useContext)(DragActionContext);
89
90
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
- import_react_spring.animated.div,
91
+ import_ui.animated.div,
91
92
  {
92
93
  ...bind(),
93
94
  style: { touchAction: "pan-y", opacity: leftOpacity, width: leftWidth },
@@ -100,7 +101,7 @@ DragAction.Left = Left;
100
101
  const Right = ({ children }) => {
101
102
  const { bind, rightOpacity, rightWidth } = (0, import_react2.useContext)(DragActionContext);
102
103
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
- import_react_spring.animated.div,
104
+ import_ui.animated.div,
104
105
  {
105
106
  ...bind(),
106
107
  style: { opacity: rightOpacity, width: rightWidth },
@@ -33,6 +33,7 @@ __export(DraggableList_exports, {
33
33
  module.exports = __toCommonJS(DraggableList_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_client = require("@akanjs/client");
36
+ var import_ui = require("@akanjs/ui");
36
37
  var import_web = require("@react-spring/web");
37
38
  var import_react = require("@use-gesture/react");
38
39
  var import_lodash = __toESM(require("lodash.clamp"));
@@ -93,7 +94,7 @@ const DragList = ({ className, mode = "vertical", children, onChange, onRemove }
93
94
  }
94
95
  });
95
96
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)(`flex gap-0`, { "flex-col": mode === "vertical" }, className), children: springs.map(({ zIndex, shadow, movement, scale }, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
96
- import_web.animated.div,
97
+ import_ui.animated.div,
97
98
  {
98
99
  ref: (el) => {
99
100
  refs.current[i] = el;
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(KeyboardAvoiding_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_client = require("@akanjs/client");
26
26
  var import_store = require("@akanjs/store");
27
+ var import_ui = require("@akanjs/ui");
27
28
  var import_react = require("react");
28
29
  var import_react_spring = require("react-spring");
29
30
  const KeyboardAvoiding = ({ children, className }) => {
@@ -62,5 +63,5 @@ const KeyboardAvoiding = ({ children, className }) => {
62
63
  defaultHeight.current = heightNum;
63
64
  }
64
65
  }, []);
65
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spring.a.div, { className: "h-auto", style: { marginBottom: height }, children });
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.animated.div, { className: "h-auto", style: { marginBottom: height }, children });
66
67
  };
@@ -23,30 +23,66 @@ __export(Sider_exports, {
23
23
  module.exports = __toCommonJS(Sider_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_client = require("@akanjs/client");
26
+ var import_store = require("@akanjs/store");
27
+ var import_ui = require("@akanjs/ui");
28
+ var import_react = require("react");
26
29
  var import_ai = require("react-icons/ai");
27
30
  var import_bi = require("react-icons/bi");
31
+ var import_react_spring = require("react-spring");
28
32
  const Sider = ({ className, bgClassName, children }) => {
33
+ const [isOpen, setIsOpen] = (0, import_react.useState)(false);
34
+ const path = import_store.st.use.path();
35
+ (0, import_react.useEffect)(() => {
36
+ setIsOpen(false);
37
+ }, [path]);
38
+ const siderAnimation = (0, import_react_spring.useSpring)({
39
+ translateX: isOpen ? "0%" : "-100%",
40
+ config: { tension: 300, friction: 30 }
41
+ });
42
+ const overlayAnimation = (0, import_react_spring.useSpring)({
43
+ opacity: isOpen ? 1 : 0,
44
+ config: { tension: 300, friction: 30 }
45
+ });
29
46
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
30
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "drawer-content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "sider", className: "btn btn-ghost", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineMenu, {}) }) }),
31
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "drawer drawer-start fixed", children: [
32
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "sider", type: "checkbox", className: "drawer-toggle" }),
33
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "drawer-side", children: [
34
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "sider", className: (0, import_client.clsx)("drawer-overlay", bgClassName) }),
35
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_client.clsx)("bg-base-200 text-base-content h-full w-3/4 p-4 md:w-80", className), children: [
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
+ "button",
49
+ {
50
+ className: "btn btn-ghost",
51
+ onClick: () => {
52
+ setIsOpen(true);
53
+ },
54
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineMenu, {})
55
+ }
56
+ ),
57
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
+ import_ui.animated.div,
59
+ {
60
+ style: overlayAnimation,
61
+ className: (0, import_client.clsx)("fixed inset-0 z-40 h-screen w-screen", bgClassName),
62
+ onClick: () => {
63
+ setIsOpen(false);
64
+ }
65
+ }
66
+ ) : null,
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
68
+ import_ui.animated.div,
69
+ {
70
+ style: siderAnimation,
71
+ className: (0, import_client.clsx)("bg-base-200 text-base-content fixed top-0 left-0 z-50 h-full w-3/4 p-4 md:w-80", className),
72
+ children: [
36
73
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
74
  "button",
38
75
  {
39
76
  className: "absolute top-4 left-4 text-lg",
40
- onClick: (e) => {
41
- e.preventDefault();
42
- document.getElementById("sider")?.click();
77
+ onClick: () => {
78
+ setIsOpen(false);
43
79
  },
44
80
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_bi.BiX, {})
45
81
  }
46
82
  ),
47
83
  children
48
- ] })
49
- ] })
50
- ] })
84
+ ]
85
+ }
86
+ )
51
87
  ] });
52
88
  };
@@ -23,5 +23,5 @@ module.exports = __toCommonJS(Template_exports);
23
23
  var import_jsx_runtime = require("react/jsx-runtime");
24
24
  var import_client = require("@akanjs/client");
25
25
  const Template = ({ className, children }) => {
26
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)("flex w-full max-w-[100vw] flex-col gap-6 p-2", className), children });
26
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)("flex w-full flex-col gap-6 p-2", className), children });
27
27
  };
@@ -23,21 +23,22 @@ __export(PageCSR_exports, {
23
23
  module.exports = __toCommonJS(PageCSR_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_react = require("react");
26
- const setFetchedData = (target, data) => {
27
- Reflect.defineMetadata("fetchedData", data, target);
26
+ const setFetchedData = (target, data, pathname) => {
27
+ const fetchedData = Reflect.getMetadata("fetchedData", target) ?? {};
28
+ Reflect.defineMetadata("fetchedData", { ...fetchedData, [pathname]: data }, target);
28
29
  };
29
- const getFetchedData = (target) => {
30
- const data = Reflect.getMetadata("fetchedData", target);
31
- return data ?? null;
30
+ const getFetchedData = (target, pathname) => {
31
+ const data = Reflect.getMetadata("fetchedData", target) ?? {};
32
+ return data[pathname] ?? null;
32
33
  };
33
34
  const PageCSR = ({ of, loader, render, loading, noCache = false }) => {
34
35
  const fetchData = (0, import_react.useMemo)(() => {
35
- const cachedData = getFetchedData(of);
36
+ const cachedData = getFetchedData(of, location.pathname);
36
37
  if (!noCache && cachedData)
37
38
  return cachedData;
38
39
  else
39
40
  return loader();
40
- }, []);
41
+ }, [location.pathname]);
41
42
  const [fetchState, setFetchState] = (0, import_react.useState)(
42
43
  fetchData instanceof Promise ? { fulfilled: false, value: null } : { fulfilled: true, value: fetchData }
43
44
  );
@@ -48,7 +49,7 @@ const PageCSR = ({ of, loader, render, loading, noCache = false }) => {
48
49
  try {
49
50
  const ret = await fetchData;
50
51
  setFetchState({ fulfilled: true, value: ret });
51
- setFetchedData(of, ret);
52
+ setFetchedData(of, ret, location.pathname);
52
53
  } catch (err) {
53
54
  }
54
55
  })();
@@ -23,8 +23,9 @@ __export(ProgressBar_exports, {
23
23
  module.exports = __toCommonJS(ProgressBar_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_client = require("@akanjs/client");
26
+ var import_ui = require("@akanjs/ui");
26
27
  var import_react_spring = require("react-spring");
27
28
  const ProgressBar = ({ className, value, max }) => {
28
29
  const progress = (0, import_react_spring.useSpring)({ value: 0, to: { value } });
29
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spring.a.progress, { className: (0, import_client.clsx)("progress w-full", className), value: progress.value, max });
30
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.animated.progress, { className: (0, import_client.clsx)("progress w-full", className), value: progress.value, max });
30
31
  };
package/cjs/Popconfirm.js CHANGED
@@ -27,6 +27,7 @@ var import_next = require("@akanjs/next");
27
27
  var import_web = require("@react-spring/web");
28
28
  var import_react = require("react");
29
29
  var import_bi = require("react-icons/bi");
30
+ var import_animated = require("./animated");
30
31
  //! 디자인 수정, 테마 적용 안됨
31
32
  const Popconfirm = ({
32
33
  title,
@@ -81,7 +82,7 @@ const Popconfirm = ({
81
82
  }
82
83
  ),
83
84
  isConfirming && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
84
- import_web.animated.div,
85
+ import_animated.animated.div,
85
86
  {
86
87
  className: "popconfirm border-base-300 bg-base-100 absolute -right-2 bottom-0 z-10 translate-y-[106%] rounded-lg border p-4 shadow-xl",
87
88
  style: popconfirmProps,
@@ -23,6 +23,7 @@ __export(ScreenNavigator_exports, {
23
23
  module.exports = __toCommonJS(ScreenNavigator_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_client = require("@akanjs/client");
26
+ var import_ui = require("@akanjs/ui");
26
27
  var import_react = require("@use-gesture/react");
27
28
  var import_react2 = require("react");
28
29
  var import_react_spring = require("react-spring");
@@ -100,7 +101,7 @@ const ScreenNavigator = ({
100
101
  setCurrentMenu(menus[1]);
101
102
  }
102
103
  };
103
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScreenNavigatorContext.Provider, { value: { bind, xValue, onClickMenu, menus, currentMenu, setMenu }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spring.a.div, { ...bind(), className: "flex h-full w-[200vw] overflow-x-scroll", style: { x: xValue }, ref, children }) });
104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScreenNavigatorContext.Provider, { value: { bind, xValue, onClickMenu, menus, currentMenu, setMenu }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.animated.div, { ...bind(), className: "flex h-full w-[200vw] overflow-x-scroll", style: { x: xValue }, ref, children }) });
104
105
  };
105
106
  const NavbarItem = ({ menu, children, className }) => {
106
107
  const { onClickMenu, currentMenu } = (0, import_react2.useContext)(ScreenNavigatorContext);
package/cjs/System/CSR.js CHANGED
@@ -26,7 +26,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_client = require("@akanjs/client");
27
27
  var import_next = require("@akanjs/next");
28
28
  var import_store = require("@akanjs/store");
29
- var import_web = require("@react-spring/web");
29
+ var import_ui = require("@akanjs/ui");
30
30
  var import_react = require("react");
31
31
  var import_react_dom = require("react-dom");
32
32
  var import_FontFace = require("../FontFace");
@@ -151,7 +151,7 @@ const CSRWrapper = ({
151
151
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "pageContainers", className: "isolate" }),
152
152
  csrLoaded ? pathRoutes.map((pathRoute) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CSRPageContainer, { pathRoute, prefix, layoutStyle }, pathRoute.path)) : null,
153
153
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
154
- import_web.a.div,
154
+ import_ui.animated.div,
155
155
  {
156
156
  id: "topSafeArea",
157
157
  className: (0, import_client.clsx)("bg-base-100 fixed inset-x-0 top-0", {}),
@@ -160,7 +160,7 @@ const CSRWrapper = ({
160
160
  }
161
161
  ),
162
162
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
163
- import_web.a.div,
163
+ import_ui.animated.div,
164
164
  {
165
165
  id: "topInsetContainer",
166
166
  className: (0, import_client.clsx)("bg-base-100 fixed inset-x-0 isolate", {}),
@@ -168,7 +168,7 @@ const CSRWrapper = ({
168
168
  }
169
169
  ),
170
170
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
171
- import_web.a.div,
171
+ import_ui.animated.div,
172
172
  {
173
173
  id: "topLeftActionContainer",
174
174
  className: (0, import_client.clsx)("aspect-1 absolute top-0 isolate flex items-center justify-center", {}),
@@ -176,7 +176,7 @@ const CSRWrapper = ({
176
176
  }
177
177
  ),
178
178
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
179
- import_web.a.div,
179
+ import_ui.animated.div,
180
180
  {
181
181
  id: "bottomInsetContainer",
182
182
  className: (0, import_client.clsx)("fixed inset-x-0 isolate", {}),
@@ -184,7 +184,7 @@ const CSRWrapper = ({
184
184
  }
185
185
  ),
186
186
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
187
- import_web.a.div,
187
+ import_ui.animated.div,
188
188
  {
189
189
  id: "bottomSafeArea",
190
190
  className: "bg-base-100 fixed inset-x-0",
@@ -305,7 +305,7 @@ const CSRPageContainer = ({ pathRoute, prefix, layoutStyle }) => {
305
305
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
306
306
  (0, import_react_dom.createPortal)(
307
307
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
308
- import_web.a.div,
308
+ import_ui.animated.div,
309
309
  {
310
310
  id: `pageContainer-${pathRoute.path}`,
311
311
  style: { ...page?.containerStyle ?? {}, zIndex },
@@ -33,7 +33,7 @@ var import_common = require("@akanjs/common");
33
33
  var import_next = require("@akanjs/next");
34
34
  var import_signal = require("@akanjs/signal");
35
35
  var import_store = require("@akanjs/store");
36
- var import_web = require("@react-spring/web");
36
+ var import_ui = require("@akanjs/ui");
37
37
  var import_navigation = require("next/navigation");
38
38
  var import_next_themes = require("next-themes");
39
39
  var import_react = require("react");
@@ -87,7 +87,7 @@ const ClientPathWrapper = ({
87
87
  setGestureEnabled
88
88
  },
89
89
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
- import_web.a.div,
90
+ import_ui.animated.div,
91
91
  {
92
92
  ...bind && pathRoute.pageState.gesture && gestureEnabled ? bind() : {},
93
93
  className: (0, import_client.clsx)("group/path", className),
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var animated_exports = {};
20
+ __export(animated_exports, {
21
+ animated: () => animated
22
+ });
23
+ module.exports = __toCommonJS(animated_exports);
24
+ var import_web = require("@react-spring/web");
25
+ const animated = {
26
+ div: (0, import_web.a)("div"),
27
+ g: (0, import_web.a)("g"),
28
+ progress: (0, import_web.a)("progress")
29
+ };
package/cjs/index.js CHANGED
@@ -57,7 +57,8 @@ __export(ui_exports, {
57
57
  Tab: () => import_Tab.Tab,
58
58
  Table: () => import_Table.Table,
59
59
  ToggleSelect: () => import_ToggleSelect.ToggleSelect,
60
- Unauthorized: () => import_Unauthorized.Unauthorized
60
+ Unauthorized: () => import_Unauthorized.Unauthorized,
61
+ animated: () => import_animated.animated
61
62
  });
62
63
  module.exports = __toCommonJS(ui_exports);
63
64
  var import_Data = require("./Data");
@@ -101,3 +102,4 @@ var import_Select = require("./Select");
101
102
  var import_Table = require("./Table");
102
103
  var import_ToggleSelect = require("./ToggleSelect");
103
104
  var import_Unauthorized = require("./Unauthorized");
105
+ var import_animated = require("./animated");
@@ -2,10 +2,11 @@
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
4
  import { st } from "@akanjs/store";
5
+ import { animated } from "@akanjs/ui";
5
6
  import { useDrag } from "@use-gesture/react";
6
7
  import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
7
8
  import { BiX } from "react-icons/bi";
8
- import { a, config, useSpring } from "react-spring";
9
+ import { config, useSpring } from "react-spring";
9
10
  const BottomSheet = forwardRef(
10
11
  ({ open, onCancel, type = "half", children }, bottomSheetRef) => {
11
12
  const ref = useRef(null);
@@ -47,7 +48,7 @@ const BottomSheet = forwardRef(
47
48
  }, [open]);
48
49
  return /* @__PURE__ */ jsxs(Fragment, { children: [
49
50
  /* @__PURE__ */ jsx(
50
- a.div,
51
+ animated.div,
51
52
  {
52
53
  style: {
53
54
  opacity
@@ -60,7 +61,7 @@ const BottomSheet = forwardRef(
60
61
  }
61
62
  ),
62
63
  /* @__PURE__ */ jsxs(
63
- a.div,
64
+ animated.div,
64
65
  {
65
66
  ref,
66
67
  style: { y, paddingTop: type === "full" ? pageState.topSafeArea : 0 },
@@ -69,7 +70,7 @@ const BottomSheet = forwardRef(
69
70
  "h-[100vh]": type === "full"
70
71
  }),
71
72
  children: [
72
- /* @__PURE__ */ jsx("div", { className: "flex h-8 w-full items-start justify-center pt-2", children: type === "half" ? /* @__PURE__ */ jsx(a.div, { ...bind(), className: "flex h-8 w-full items-start justify-center pt-2", children: /* @__PURE__ */ jsx("div", { className: "h-2 w-32 rounded-full bg-gray-300" }) }) : /* @__PURE__ */ jsx(
73
+ /* @__PURE__ */ jsx("div", { className: "flex h-8 w-full items-start justify-center pt-2", children: type === "half" ? /* @__PURE__ */ jsx(animated.div, { ...bind(), className: "flex h-8 w-full items-start justify-center pt-2", children: /* @__PURE__ */ jsx("div", { className: "h-2 w-32 rounded-full bg-gray-300" }) }) : /* @__PURE__ */ jsx(
73
74
  "button",
74
75
  {
75
76
  onClick: () => void closeModal(),
@@ -2,11 +2,12 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
4
  import { usePage } from "@akanjs/next";
5
+ import { animated } from "@akanjs/ui";
5
6
  import * as Dialog from "@radix-ui/react-dialog";
6
7
  import { useDrag } from "@use-gesture/react";
7
8
  import { useContext, useEffect, useRef, useState } from "react";
8
9
  import { BiX } from "react-icons/bi";
9
- import { a, config, useSpring } from "react-spring";
10
+ import { config, useSpring } from "react-spring";
10
11
  import { DialogContext } from "./context";
11
12
  const MODAL_MARGIN = 0;
12
13
  const OPACITY = { START: 0, END: 1 };
@@ -15,7 +16,7 @@ const interpolate = (o, i, t) => {
15
16
  };
16
17
  const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) => {
17
18
  const { open, setOpen, title, action } = useContext(DialogContext);
18
- const openRef = useRef(null);
19
+ const openRef = useRef(open);
19
20
  const { l } = usePage();
20
21
  const ref = useRef(null);
21
22
  const [{ translate }, api] = useSpring(() => ({ translate: 1 }));
@@ -85,7 +86,7 @@ const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) =
85
86
  className: "fixed top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
86
87
  asChild: true,
87
88
  forceMount: true,
88
- children: /* @__PURE__ */ jsx("div", { className: "z-10", children: /* @__PURE__ */ jsxs(a.div, { ref, style: { translateY, opacity }, children: [
89
+ children: /* @__PURE__ */ jsx("div", { className: "z-10", children: /* @__PURE__ */ jsxs(animated.div, { ref, style: { translateY, opacity }, children: [
89
90
  /* @__PURE__ */ jsx(
90
91
  "button",
91
92
  {
@@ -103,17 +104,17 @@ const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) =
103
104
  ),
104
105
  children: [
105
106
  /* @__PURE__ */ jsx(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsxs(
106
- a.div,
107
+ animated.div,
107
108
  {
108
109
  ...bind(),
109
- className: "animate-fadeIn relative z-10 flex w-full cursor-pointer flex-col items-center justify-center px-4 pt-1",
110
+ className: "animate-fadeIn relative z-10 flex w-full cursor-pointer touch-pan-y flex-col items-center justify-center px-4 pt-1",
110
111
  children: [
111
112
  /* @__PURE__ */ jsx("div", { className: "flex w-full cursor-pointer items-center justify-center pt-1 opacity-50", children: /* @__PURE__ */ jsx("div", { className: "h-1 w-24 rounded-full bg-gray-500" }) }),
112
113
  /* @__PURE__ */ jsx("div", { className: "flex w-full items-center justify-start", children: /* @__PURE__ */ jsx("div", { className: "w-full text-start text-lg font-bold", children: title }) })
113
114
  ]
114
115
  }
115
116
  ) }),
116
- /* @__PURE__ */ jsx(
117
+ /* @__PURE__ */ jsx(Dialog.Description, { asChild: true, children: /* @__PURE__ */ jsx(
117
118
  "div",
118
119
  {
119
120
  className: clsx(
@@ -122,7 +123,7 @@ const Modal = ({ className, bodyClassName, confirmClose, children, onCancel }) =
122
123
  ),
123
124
  children
124
125
  }
125
- ),
126
+ ) }),
126
127
  action ? /* @__PURE__ */ jsx("div", { className: "w-full", children: action }) : null
127
128
  ]
128
129
  }
package/esm/DragAction.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
+ import { animated } from "@akanjs/ui";
4
5
  import { useGesture } from "@use-gesture/react";
5
6
  import { createContext, useContext, useRef } from "react";
6
- import { animated, SpringValue, useSpring } from "react-spring";
7
+ import { SpringValue, useSpring } from "react-spring";
7
8
  const DragActionContext = createContext({
8
9
  bind: () => ({}),
9
10
  x: new SpringValue(0),
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
- import { animated, config, useSprings } from "@react-spring/web";
4
+ import { animated } from "@akanjs/ui";
5
+ import { config, useSprings } from "@react-spring/web";
5
6
  import { useGesture } from "@use-gesture/react";
6
7
  import clamp from "lodash.clamp";
7
8
  import swap from "lodash-move";
@@ -2,8 +2,9 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useCsr } from "@akanjs/client";
4
4
  import { st } from "@akanjs/store";
5
+ import { animated } from "@akanjs/ui";
5
6
  import { useEffect, useRef } from "react";
6
- import { a, useSpring } from "react-spring";
7
+ import { useSpring } from "react-spring";
7
8
  const KeyboardAvoiding = ({ children, className }) => {
8
9
  const keyboardHeight = st.use.keyboardHeight();
9
10
  const defaultHeight = useRef(null);
@@ -40,7 +41,7 @@ const KeyboardAvoiding = ({ children, className }) => {
40
41
  defaultHeight.current = heightNum;
41
42
  }
42
43
  }, []);
43
- return /* @__PURE__ */ jsx(a.div, { className: "h-auto", style: { marginBottom: height }, children });
44
+ return /* @__PURE__ */ jsx(animated.div, { className: "h-auto", style: { marginBottom: height }, children });
44
45
  };
45
46
  export {
46
47
  KeyboardAvoiding
@@ -1,31 +1,67 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
+ import { st } from "@akanjs/store";
5
+ import { animated } from "@akanjs/ui";
6
+ import { useEffect, useState } from "react";
4
7
  import { AiOutlineMenu } from "react-icons/ai";
5
8
  import { BiX } from "react-icons/bi";
9
+ import { useSpring } from "react-spring";
6
10
  const Sider = ({ className, bgClassName, children }) => {
11
+ const [isOpen, setIsOpen] = useState(false);
12
+ const path = st.use.path();
13
+ useEffect(() => {
14
+ setIsOpen(false);
15
+ }, [path]);
16
+ const siderAnimation = useSpring({
17
+ translateX: isOpen ? "0%" : "-100%",
18
+ config: { tension: 300, friction: 30 }
19
+ });
20
+ const overlayAnimation = useSpring({
21
+ opacity: isOpen ? 1 : 0,
22
+ config: { tension: 300, friction: 30 }
23
+ });
7
24
  return /* @__PURE__ */ jsxs(Fragment, { children: [
8
- /* @__PURE__ */ jsx("div", { className: "drawer-content", children: /* @__PURE__ */ jsx("label", { htmlFor: "sider", className: "btn btn-ghost", children: /* @__PURE__ */ jsx(AiOutlineMenu, {}) }) }),
9
- /* @__PURE__ */ jsxs("div", { className: "drawer drawer-start fixed", children: [
10
- /* @__PURE__ */ jsx("input", { id: "sider", type: "checkbox", className: "drawer-toggle" }),
11
- /* @__PURE__ */ jsxs("div", { className: "drawer-side", children: [
12
- /* @__PURE__ */ jsx("label", { htmlFor: "sider", className: clsx("drawer-overlay", bgClassName) }),
13
- /* @__PURE__ */ jsxs("div", { className: clsx("bg-base-200 text-base-content h-full w-3/4 p-4 md:w-80", className), children: [
25
+ /* @__PURE__ */ jsx(
26
+ "button",
27
+ {
28
+ className: "btn btn-ghost",
29
+ onClick: () => {
30
+ setIsOpen(true);
31
+ },
32
+ children: /* @__PURE__ */ jsx(AiOutlineMenu, {})
33
+ }
34
+ ),
35
+ isOpen ? /* @__PURE__ */ jsx(
36
+ animated.div,
37
+ {
38
+ style: overlayAnimation,
39
+ className: clsx("fixed inset-0 z-40 h-screen w-screen", bgClassName),
40
+ onClick: () => {
41
+ setIsOpen(false);
42
+ }
43
+ }
44
+ ) : null,
45
+ /* @__PURE__ */ jsxs(
46
+ animated.div,
47
+ {
48
+ style: siderAnimation,
49
+ className: clsx("bg-base-200 text-base-content fixed top-0 left-0 z-50 h-full w-3/4 p-4 md:w-80", className),
50
+ children: [
14
51
  /* @__PURE__ */ jsx(
15
52
  "button",
16
53
  {
17
54
  className: "absolute top-4 left-4 text-lg",
18
- onClick: (e) => {
19
- e.preventDefault();
20
- document.getElementById("sider")?.click();
55
+ onClick: () => {
56
+ setIsOpen(false);
21
57
  },
22
58
  children: /* @__PURE__ */ jsx(BiX, {})
23
59
  }
24
60
  ),
25
61
  children
26
- ] })
27
- ] })
28
- ] })
62
+ ]
63
+ }
64
+ )
29
65
  ] });
30
66
  };
31
67
  export {
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { clsx } from "@akanjs/client";
3
3
  const Template = ({ className, children }) => {
4
- return /* @__PURE__ */ jsx("div", { className: clsx("flex w-full max-w-[100vw] flex-col gap-6 p-2", className), children });
4
+ return /* @__PURE__ */ jsx("div", { className: clsx("flex w-full flex-col gap-6 p-2", className), children });
5
5
  };
6
6
  export {
7
7
  Template
@@ -1,21 +1,22 @@
1
1
  "use client";
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { useEffect, useMemo, useState } from "react";
4
- const setFetchedData = (target, data) => {
5
- Reflect.defineMetadata("fetchedData", data, target);
4
+ const setFetchedData = (target, data, pathname) => {
5
+ const fetchedData = Reflect.getMetadata("fetchedData", target) ?? {};
6
+ Reflect.defineMetadata("fetchedData", { ...fetchedData, [pathname]: data }, target);
6
7
  };
7
- const getFetchedData = (target) => {
8
- const data = Reflect.getMetadata("fetchedData", target);
9
- return data ?? null;
8
+ const getFetchedData = (target, pathname) => {
9
+ const data = Reflect.getMetadata("fetchedData", target) ?? {};
10
+ return data[pathname] ?? null;
10
11
  };
11
12
  const PageCSR = ({ of, loader, render, loading, noCache = false }) => {
12
13
  const fetchData = useMemo(() => {
13
- const cachedData = getFetchedData(of);
14
+ const cachedData = getFetchedData(of, location.pathname);
14
15
  if (!noCache && cachedData)
15
16
  return cachedData;
16
17
  else
17
18
  return loader();
18
- }, []);
19
+ }, [location.pathname]);
19
20
  const [fetchState, setFetchState] = useState(
20
21
  fetchData instanceof Promise ? { fulfilled: false, value: null } : { fulfilled: true, value: fetchData }
21
22
  );
@@ -26,7 +27,7 @@ const PageCSR = ({ of, loader, render, loading, noCache = false }) => {
26
27
  try {
27
28
  const ret = await fetchData;
28
29
  setFetchState({ fulfilled: true, value: ret });
29
- setFetchedData(of, ret);
30
+ setFetchedData(of, ret, location.pathname);
30
31
  } catch (err) {
31
32
  }
32
33
  })();
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
- import { a, useSpring } from "react-spring";
4
+ import { animated } from "@akanjs/ui";
5
+ import { useSpring } from "react-spring";
5
6
  const ProgressBar = ({ className, value, max }) => {
6
7
  const progress = useSpring({ value: 0, to: { value } });
7
- return /* @__PURE__ */ jsx(a.progress, { className: clsx("progress w-full", className), value: progress.value, max });
8
+ return /* @__PURE__ */ jsx(animated.progress, { className: clsx("progress w-full", className), value: progress.value, max });
8
9
  };
9
10
  export {
10
11
  ProgressBar
package/esm/Popconfirm.js CHANGED
@@ -3,9 +3,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  //! 디자인 수정, 테마 적용 안됨
4
4
  import { clsx } from "@akanjs/client";
5
5
  import { usePage } from "@akanjs/next";
6
- import { animated, useSpring } from "@react-spring/web";
6
+ import { useSpring } from "@react-spring/web";
7
7
  import { useEffect, useState } from "react";
8
8
  import { BiMessageRoundedError } from "react-icons/bi";
9
+ import { animated } from "./animated";
9
10
  const Popconfirm = ({
10
11
  title,
11
12
  description,
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
+ import { animated } from "@akanjs/ui";
4
5
  import { useDrag } from "@use-gesture/react";
5
6
  import { createContext, useContext, useEffect, useRef, useState } from "react";
6
- import { a, SpringValue, useSpringValue } from "react-spring";
7
+ import { SpringValue, useSpringValue } from "react-spring";
7
8
  const ScreenNavigatorContext = createContext({
8
9
  bind: () => ({}),
9
10
  xValue: new SpringValue(0),
@@ -78,7 +79,7 @@ const ScreenNavigator = ({
78
79
  setCurrentMenu(menus[1]);
79
80
  }
80
81
  };
81
- return /* @__PURE__ */ jsx(ScreenNavigatorContext.Provider, { value: { bind, xValue, onClickMenu, menus, currentMenu, setMenu }, children: /* @__PURE__ */ jsx(a.div, { ...bind(), className: "flex h-full w-[200vw] overflow-x-scroll", style: { x: xValue }, ref, children }) });
82
+ return /* @__PURE__ */ jsx(ScreenNavigatorContext.Provider, { value: { bind, xValue, onClickMenu, menus, currentMenu, setMenu }, children: /* @__PURE__ */ jsx(animated.div, { ...bind(), className: "flex h-full w-[200vw] overflow-x-scroll", style: { x: xValue }, ref, children }) });
82
83
  };
83
84
  const NavbarItem = ({ menu, children, className }) => {
84
85
  const { onClickMenu, currentMenu } = useContext(ScreenNavigatorContext);
package/esm/System/CSR.js CHANGED
@@ -3,7 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { clsx, device, getPathInfo, router, useCsr } from "@akanjs/client";
4
4
  import { usePushNoti } from "@akanjs/next";
5
5
  import { st } from "@akanjs/store";
6
- import { a } from "@react-spring/web";
6
+ import { animated } from "@akanjs/ui";
7
7
  import { useEffect } from "react";
8
8
  import { createPortal } from "react-dom";
9
9
  import { FontFace } from "../FontFace";
@@ -128,7 +128,7 @@ const CSRWrapper = ({
128
128
  /* @__PURE__ */ jsx("div", { id: "pageContainers", className: "isolate" }),
129
129
  csrLoaded ? pathRoutes.map((pathRoute) => /* @__PURE__ */ jsx(CSRPageContainer, { pathRoute, prefix, layoutStyle }, pathRoute.path)) : null,
130
130
  /* @__PURE__ */ jsx(
131
- a.div,
131
+ animated.div,
132
132
  {
133
133
  id: "topSafeArea",
134
134
  className: clsx("bg-base-100 fixed inset-x-0 top-0", {}),
@@ -137,7 +137,7 @@ const CSRWrapper = ({
137
137
  }
138
138
  ),
139
139
  /* @__PURE__ */ jsx(
140
- a.div,
140
+ animated.div,
141
141
  {
142
142
  id: "topInsetContainer",
143
143
  className: clsx("bg-base-100 fixed inset-x-0 isolate", {}),
@@ -145,7 +145,7 @@ const CSRWrapper = ({
145
145
  }
146
146
  ),
147
147
  /* @__PURE__ */ jsx(
148
- a.div,
148
+ animated.div,
149
149
  {
150
150
  id: "topLeftActionContainer",
151
151
  className: clsx("aspect-1 absolute top-0 isolate flex items-center justify-center", {}),
@@ -153,7 +153,7 @@ const CSRWrapper = ({
153
153
  }
154
154
  ),
155
155
  /* @__PURE__ */ jsx(
156
- a.div,
156
+ animated.div,
157
157
  {
158
158
  id: "bottomInsetContainer",
159
159
  className: clsx("fixed inset-x-0 isolate", {}),
@@ -161,7 +161,7 @@ const CSRWrapper = ({
161
161
  }
162
162
  ),
163
163
  /* @__PURE__ */ jsx(
164
- a.div,
164
+ animated.div,
165
165
  {
166
166
  id: "bottomSafeArea",
167
167
  className: "bg-base-100 fixed inset-x-0",
@@ -282,7 +282,7 @@ const CSRPageContainer = ({ pathRoute, prefix, layoutStyle }) => {
282
282
  return /* @__PURE__ */ jsxs(Fragment, { children: [
283
283
  createPortal(
284
284
  /* @__PURE__ */ jsx(
285
- a.div,
285
+ animated.div,
286
286
  {
287
287
  id: `pageContainer-${pathRoute.path}`,
288
288
  style: { ...page?.containerStyle ?? {}, zIndex },
@@ -16,7 +16,7 @@ import { Logger } from "@akanjs/common";
16
16
  import { useFetch } from "@akanjs/next";
17
17
  import { fetch } from "@akanjs/signal";
18
18
  import { st } from "@akanjs/store";
19
- import { a } from "@react-spring/web";
19
+ import { animated } from "@akanjs/ui";
20
20
  import { useParams, usePathname, useRouter, useSearchParams } from "next/navigation";
21
21
  import { ThemeProvider, useTheme } from "next-themes";
22
22
  import { useEffect, useState } from "react";
@@ -70,7 +70,7 @@ const ClientPathWrapper = ({
70
70
  setGestureEnabled
71
71
  },
72
72
  children: /* @__PURE__ */ jsx(
73
- a.div,
73
+ animated.div,
74
74
  {
75
75
  ...bind && pathRoute.pageState.gesture && gestureEnabled ? bind() : {},
76
76
  className: clsx("group/path", className),
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { a } from "@react-spring/web";
3
+ const animated = {
4
+ div: a("div"),
5
+ g: a("g"),
6
+ progress: a("progress")
7
+ };
8
+ export {
9
+ animated
10
+ };
package/esm/index.js CHANGED
@@ -39,6 +39,7 @@ import { Select } from "./Select";
39
39
  import { Table } from "./Table";
40
40
  import { ToggleSelect } from "./ToggleSelect";
41
41
  import { Unauthorized } from "./Unauthorized";
42
+ import { animated } from "./animated";
42
43
  export {
43
44
  BottomSheet,
44
45
  Button,
@@ -80,5 +81,6 @@ export {
80
81
  Tab,
81
82
  Table,
82
83
  ToggleSelect,
83
- Unauthorized
84
+ Unauthorized,
85
+ animated
84
86
  };
package/index.d.ts CHANGED
@@ -39,3 +39,4 @@ export { Select } from "./Select";
39
39
  export { Table } from "./Table";
40
40
  export { ToggleSelect } from "./ToggleSelect";
41
41
  export { Unauthorized } from "./Unauthorized";
42
+ export { animated } from "./animated";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/ui",
3
- "version": "0.9.33",
3
+ "version": "0.9.35",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@capacitor/browser": "7.0.1",
19
- "@radix-ui/react-dialog": "1.1.4",
19
+ "@radix-ui/react-dialog": "1.1.14",
20
20
  "@react-spring/web": "^9.7.5",
21
21
  "@use-gesture/react": "^10.3.1",
22
22
  "clsx": "^2.1.1",
@@ -27,11 +27,11 @@
27
27
  "lodash.clamp": "^4.0.3",
28
28
  "next": "15.3.2",
29
29
  "next-themes": "0.4.4",
30
- "react": "18.3.1",
30
+ "react": "19.1.1",
31
31
  "react-copy-to-clipboard": "5.1.0",
32
32
  "react-datepicker": "7.5.0",
33
33
  "react-device-detect": "^2.2.3",
34
- "react-dom": "18.3.1",
34
+ "react-dom": "19.1.1",
35
35
  "react-easy-crop": "^5.2.0",
36
36
  "react-icons": "^5.4.0",
37
37
  "react-simple-pull-to-refresh": "^1.3.3",