@bbki.ng/components 2.6.14 → 3.0.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 (149) hide show
  1. package/dist/Button.d.ts +1 -0
  2. package/dist/_virtual/_commonjsHelpers.mjs +6 -0
  3. package/dist/_virtual/index.mjs +4 -0
  4. package/dist/_virtual/jsx-runtime.mjs +7 -0
  5. package/dist/_virtual/jsx-runtime2.mjs +4 -0
  6. package/dist/_virtual/react-jsx-runtime.development.mjs +4 -0
  7. package/dist/_virtual/react-jsx-runtime.production.min.mjs +4 -0
  8. package/dist/article/Article.d.ts +11 -0
  9. package/dist/article/Article.mjs +43 -0
  10. package/dist/blink-dot/BlinkDot.d.ts +5 -0
  11. package/dist/blink-dot/BlinkDot.mjs +20 -0
  12. package/dist/blur-cover/BlurCover.d.ts +6 -0
  13. package/dist/blur-cover/BlurCover.mjs +28 -0
  14. package/dist/breadcrumb/Breadcrumb.d.ts +9 -0
  15. package/dist/breadcrumb/Breadcrumb.mjs +35 -0
  16. package/dist/button/Button.d.ts +18 -0
  17. package/dist/button/Button.mjs +35 -0
  18. package/dist/canvas/Canvas.d.ts +23 -0
  19. package/dist/canvas/Canvas.mjs +85 -0
  20. package/dist/canvas/useRenderer.d.ts +10 -0
  21. package/dist/canvas/useRenderer.mjs +31 -0
  22. package/dist/context-menu/index.d.ts +27 -0
  23. package/dist/context-menu/index.mjs +131 -0
  24. package/dist/drop-image/DropImage.d.ts +25 -0
  25. package/dist/drop-image/DropImage.mjs +151 -0
  26. package/dist/drop-image/useDropImage.d.ts +19 -0
  27. package/dist/drop-image/useDropImage.mjs +67 -0
  28. package/dist/drop-image/utils.d.ts +2 -0
  29. package/dist/drop-image/utils.mjs +4 -0
  30. package/dist/drop-zone/DropZone.d.ts +9 -0
  31. package/dist/drop-zone/DropZone.mjs +44 -0
  32. package/dist/img/Gallery.d.ts +11 -0
  33. package/dist/img/Gallery.mjs +37 -0
  34. package/dist/img/Img.d.ts +3 -0
  35. package/dist/img/Img.mjs +80 -0
  36. package/dist/img/RandomRowsLayout.d.ts +9 -0
  37. package/dist/img/RandomRowsLayout.mjs +49 -0
  38. package/dist/img/types.d.ts +21 -0
  39. package/dist/img/types.mjs +4 -0
  40. package/dist/img/utils.d.ts +7 -0
  41. package/dist/img/utils.mjs +15 -0
  42. package/dist/index.d.ts +25 -380
  43. package/dist/index.mjs +79 -0
  44. package/dist/input/index.d.ts +3 -0
  45. package/dist/input/index.mjs +17 -0
  46. package/dist/label/index.d.ts +5 -0
  47. package/dist/label/index.mjs +17 -0
  48. package/dist/layout/layout.d.ts +7 -0
  49. package/dist/layout/layout.mjs +27 -0
  50. package/dist/link/Link.d.ts +17 -0
  51. package/dist/link/Link.mjs +83 -0
  52. package/dist/list/list.d.ts +23 -0
  53. package/dist/list/list.mjs +76 -0
  54. package/dist/loading-spiral/LoadingSpiral.d.ts +5 -0
  55. package/dist/loading-spiral/LoadingSpiral.mjs +37 -0
  56. package/dist/loading-spiral/constants.d.ts +6 -0
  57. package/dist/loading-spiral/constants.mjs +61 -0
  58. package/dist/loading-spiral/createOptions.d.ts +17 -0
  59. package/dist/loading-spiral/createOptions.mjs +30 -0
  60. package/dist/loading-spiral/createSettings.d.ts +16 -0
  61. package/dist/loading-spiral/createSettings.mjs +21 -0
  62. package/dist/loading-spiral/useCanvasRef.d.ts +4 -0
  63. package/dist/loading-spiral/utils.d.ts +1 -0
  64. package/dist/logo/Logo.d.ts +6 -0
  65. package/dist/logo/Logo.mjs +36 -0
  66. package/dist/nav/Nav.d.ts +10 -0
  67. package/dist/nav/Nav.mjs +27 -0
  68. package/dist/node_modules/.pnpm/@babel_runtime@7.18.9/node_modules/@babel/runtime/helpers/esm/extends.mjs +13 -0
  69. package/dist/node_modules/.pnpm/@floating-ui_core@1.6.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +519 -0
  70. package/dist/node_modules/.pnpm/@floating-ui_dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +373 -0
  71. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.0.8_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +182 -0
  72. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +108 -0
  73. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +120 -0
  74. package/dist/node_modules/.pnpm/@radix-ui_primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs +9 -0
  75. package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.0.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-arrow/dist/index.mjs +19 -0
  76. package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.0.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom_04e7d2b59cf7ec97f40d26a998d7601d/node_modules/@radix-ui/react-collection/dist/index.mjs +60 -0
  77. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +16 -0
  78. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +25 -0
  79. package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.1.5_@types_react-dom@18.0.6_@types_react@18.0.15_react-d_1ce4db5e792f73d797e22c043cc3d326/node_modules/@radix-ui/react-context-menu/dist/index.mjs +213 -0
  80. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.mjs +88 -0
  81. package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs +9 -0
  82. package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.0.5_@types_react-dom@18.0.6_@types_react@18.0.15_re_0263a24376d55e4c2bb8fa2f75f1db3c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +136 -0
  83. package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +20 -0
  84. package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.0.4_@types_react-dom@18.0.6_@types_react@18.0.15_react-do_a79d961df31bbecb3b2c94878dbb0724/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +188 -0
  85. package/dist/node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.mjs +61 -0
  86. package/dist/node_modules/.pnpm/@radix-ui_react-id@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs +18 -0
  87. package/dist/node_modules/.pnpm/@radix-ui_react-label@2.1.1_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-label/dist/index.mjs +20 -0
  88. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.0.6_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-menu/dist/index.mjs +657 -0
  89. package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.1.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-popper/dist/index.mjs +218 -0
  90. package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.0.4_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-portal/dist/index.mjs +14 -0
  91. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.0.1_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-presence/dist/index.mjs +81 -0
  92. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@1.0.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs +44 -0
  93. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.1_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs +31 -0
  94. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.0.4_@types_react-dom@18.0.6_@types_react@18.0.15_react-d_69cf2e3e4b4e2c2fefdb8ea262543b5e/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +199 -0
  95. package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.0.2_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs +53 -0
  96. package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs +48 -0
  97. package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +16 -0
  98. package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +37 -0
  99. package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.0.3_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +17 -0
  100. package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +6 -0
  101. package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs +37 -0
  102. package/dist/node_modules/.pnpm/aria-hidden@1.2.3/node_modules/aria-hidden/dist/es2015/index.mjs +49 -0
  103. package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs +6 -0
  104. package/dist/node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs +40 -0
  105. package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs +23 -0
  106. package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.mjs +7 -0
  107. package/dist/node_modules/.pnpm/phenomenon@1.6.0/node_modules/phenomenon/dist/phenomenon.mjs +109 -0
  108. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.mjs +61 -0
  109. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs +7 -0
  110. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs +25 -0
  111. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.mjs +17 -0
  112. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.mjs +116 -0
  113. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/UI.mjs +46 -0
  114. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs +16 -0
  115. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs +62 -0
  116. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/medium.mjs +5 -0
  117. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.mjs +7 -0
  118. package/dist/node_modules/.pnpm/react-style-singleton@2.2.1_@types_react@18.0.15_react@18.2.0/node_modules/react-style-singleton/dist/es2015/component.mjs +11 -0
  119. package/dist/node_modules/.pnpm/react-style-singleton@2.2.1_@types_react@18.0.15_react@18.2.0/node_modules/react-style-singleton/dist/es2015/hook.mjs +15 -0
  120. package/dist/node_modules/.pnpm/react-style-singleton@2.2.1_@types_react@18.0.15_react@18.2.0/node_modules/react-style-singleton/dist/es2015/singleton.mjs +30 -0
  121. package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.mjs +589 -0
  122. package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.mjs +32 -0
  123. package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.mjs +8 -0
  124. package/dist/node_modules/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.es6.mjs +29 -0
  125. package/dist/node_modules/.pnpm/use-callback-ref@1.3.1_@types_react@18.0.15_react@18.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.mjs +6 -0
  126. package/dist/node_modules/.pnpm/use-callback-ref@1.3.1_@types_react@18.0.15_react@18.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs +26 -0
  127. package/dist/node_modules/.pnpm/use-callback-ref@1.3.1_@types_react@18.0.15_react@18.2.0/node_modules/use-callback-ref/dist/es2015/useRef.mjs +25 -0
  128. package/dist/node_modules/.pnpm/use-sidecar@1.1.2_@types_react@18.0.15_react@18.2.0/node_modules/use-sidecar/dist/es2015/exports.mjs +21 -0
  129. package/dist/node_modules/.pnpm/use-sidecar@1.1.2_@types_react@18.0.15_react@18.2.0/node_modules/use-sidecar/dist/es2015/medium.mjs +67 -0
  130. package/dist/page/Page.d.ts +28 -0
  131. package/dist/page/Page.mjs +67 -0
  132. package/dist/panel/Panel.d.ts +6 -0
  133. package/dist/panel/Panel.mjs +17 -0
  134. package/dist/pop-confirm/PopConfirm.d.ts +10 -0
  135. package/dist/pop-confirm/PopConfirm.mjs +40 -0
  136. package/dist/skeleton/Seleton.d.ts +23 -0
  137. package/dist/skeleton/Seleton.mjs +69 -0
  138. package/dist/spinner/Spinner.d.ts +7 -0
  139. package/dist/table/Table.d.ts +18 -0
  140. package/dist/table/Table.mjs +34 -0
  141. package/dist/tag/Tag.d.ts +10 -0
  142. package/dist/tag/Tag.mjs +33 -0
  143. package/package.json +22 -13
  144. package/dist/index.cjs +0 -1814
  145. package/dist/index.cjs.map +0 -1
  146. package/dist/index.css +0 -1816
  147. package/dist/index.css.map +0 -1
  148. package/dist/index.js +0 -1736
  149. package/dist/index.js.map +0 -1
package/dist/index.js DELETED
@@ -1,1736 +0,0 @@
1
- // lib/article/Article.tsx
2
- import classNames2 from "classnames";
3
- import React3 from "react";
4
-
5
- // lib/blink-dot/BlinkDot.tsx
6
- import classNames from "classnames";
7
- import React from "react";
8
- var BlinkDot = (props) => {
9
- const { className } = props;
10
- const status = props.status || "hidden";
11
- const statusCls = classNames({
12
- "animate-ping-fast": status === "blink",
13
- hidden: status === "hidden"
14
- });
15
- return /* @__PURE__ */ React.createElement("span", {
16
- className: classNames("inline-flex justify-center items-center relative")
17
- }, /* @__PURE__ */ React.createElement("span", {
18
- className: `absolute inline-flex h-full w-full rounded-full text-red-600 -top-[28px] -left-[3px] ${statusCls} ${className}`
19
- }, "."));
20
- };
21
-
22
- // lib/blur-cover/BlurCover.tsx
23
- import React2 from "react";
24
- import cls from "classnames";
25
- var BlurCover = (props) => {
26
- const { status } = props;
27
- const coverCls = cls(
28
- "absolute",
29
- "block",
30
- "text-blur",
31
- "transition-all",
32
- "duration-200",
33
- "top-0",
34
- "left-0",
35
- "h-full",
36
- "w-full",
37
- {
38
- "z-[49]": status === "show",
39
- "opacity-0": status === "silent",
40
- "opacity-100": status === "show",
41
- "pointer-events-none": status === "silent"
42
- },
43
- props.className
44
- );
45
- return /* @__PURE__ */ React2.createElement("div", {
46
- className: coverCls
47
- });
48
- };
49
-
50
- // lib/article/Article.tsx
51
- var Article = (props) => {
52
- const { title, content, children, date, className, description } = props;
53
- return /* @__PURE__ */ React3.createElement("div", {
54
- className: classNames2("article", className)
55
- }, /* @__PURE__ */ React3.createElement("div", {
56
- className: "mb-16 leading-none"
57
- }, /* @__PURE__ */ React3.createElement("span", {
58
- className: "text-[2.25rem] p-16"
59
- }, title), props.loading && title && /* @__PURE__ */ React3.createElement(BlinkDot, {
60
- status: "blink",
61
- className: "!-top-[42px] !-left-16"
62
- }), date ? /* @__PURE__ */ React3.createElement("div", {
63
- className: "py-16 px-18 pb-0 text-gray-400"
64
- }, /* @__PURE__ */ React3.createElement("small", null, date)) : null), description && /* @__PURE__ */ React3.createElement("div", {
65
- className: "mb-128"
66
- }, description), /* @__PURE__ */ React3.createElement("div", {
67
- className: "text-black relative p-16"
68
- }, children || content, /* @__PURE__ */ React3.createElement(BlurCover, {
69
- status: props.loading ? "show" : "silent"
70
- })));
71
- };
72
-
73
- // lib/button/Button.tsx
74
- import React4 from "react";
75
- import classNames3 from "classnames";
76
- var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
77
- ButtonType2["DANGER"] = "danger";
78
- ButtonType2["PRIMARY"] = "primary";
79
- ButtonType2["NORMAL"] = "normal";
80
- ButtonType2["DISABLED"] = "disabled";
81
- return ButtonType2;
82
- })(ButtonType || {});
83
- function Button(props) {
84
- const typeClsMap = {
85
- ["danger" /* DANGER */]: "text-red-500",
86
- ["primary" /* PRIMARY */]: "text-blue-600",
87
- ["disabled" /* DISABLED */]: "text-gray-400 cursor-not-allowed",
88
- ["normal" /* NORMAL */]: "text-black"
89
- };
90
- const [pressed, setPressed] = React4.useState(false);
91
- const { type = "normal" /* NORMAL */, className = "", onClick, btnType } = props;
92
- const shadowTransCls = type === "disabled" /* DISABLED */ ? "" : classNames3(
93
- "transition-all duration-200 ease-in-out shadow-button active:shadow-empty",
94
- {
95
- "shadow-empty": pressed,
96
- "hover:shadow-button-hover": !pressed
97
- }
98
- );
99
- const handleClick = (e) => {
100
- if (type === "disabled" /* DISABLED */) {
101
- return;
102
- }
103
- setPressed(true);
104
- setTimeout(() => {
105
- setPressed(false);
106
- onClick(e);
107
- }, 280);
108
- };
109
- return /* @__PURE__ */ React4.createElement("button", {
110
- className: `${typeClsMap[type]} ${className} ${shadowTransCls} py-8 px-16 transition-all duration-200 ease-in-out`,
111
- onClick: handleClick,
112
- type: btnType
113
- }, props.children);
114
- }
115
- Button.displayName = "Button";
116
-
117
- // lib/logo/Logo.tsx
118
- import * as React5 from "react";
119
- var Logo = React5.memo(
120
- (props) => /* @__PURE__ */ React5.createElement("svg", {
121
- xmlns: "http://www.w3.org/2000/svg",
122
- width: "48",
123
- height: "48",
124
- viewBox: "0 0 48 48",
125
- fill: "none",
126
- onClick: props.onClick,
127
- className: props.className
128
- }, /* @__PURE__ */ React5.createElement("path", {
129
- d: "M29.1152 21.3106C32.0605 21.3106 34.4481 18.9101 34.4481 15.9489V24.6457C34.4481 25.7585 33.5508 26.6607 32.444 26.6607H15.1207C14.0138 26.6607 13.1166 25.7585 13.1166 24.6457V15.9489C13.1166 18.9101 15.5042 21.3106 18.4494 21.3106C21.3947 21.3106 23.7823 18.9101 23.7823 15.9489C23.7823 18.9101 26.17 21.3106 29.1152 21.3106Z",
130
- fill: "#9CA3AF"
131
- }), /* @__PURE__ */ React5.createElement("path", {
132
- d: "M23.7823 15.9373L23.7823 15.9489C23.7823 15.9451 23.7823 15.9412 23.7823 15.9373Z",
133
- fill: "#9CA3AF"
134
- }), /* @__PURE__ */ React5.createElement("path", {
135
- d: "M23.1143 28.004C23.1205 30.9598 25.5057 33.3541 28.4472 33.3541C31.3886 33.3541 33.7738 30.9598 33.7801 28.004H23.1143Z",
136
- fill: "#9CA3AF"
137
- }), /* @__PURE__ */ React5.createElement("path", {
138
- d: "M13.7846 28.004C13.7846 28.0079 13.7846 28.0117 13.7846 28.0156C13.7908 30.9714 16.1761 33.3657 19.1175 33.3657C22.0589 33.3657 24.4442 30.9714 24.4504 28.0156H13.7846V28.004Z",
139
- fill: "#9CA3AF"
140
- }), /* @__PURE__ */ React5.createElement("path", {
141
- d: "M14.4527 15.9373C14.4527 16.6792 13.8545 17.2806 13.1166 17.2806C12.3786 17.2806 11.7805 16.6792 11.7805 15.9373C11.7805 15.1954 12.3786 14.594 13.1166 14.594C13.8545 14.594 14.4527 15.1954 14.4527 15.9373Z",
142
- fill: "#9CA3AF"
143
- }), /* @__PURE__ */ React5.createElement("path", {
144
- d: "M25.1184 15.2657C25.1184 16.0076 24.5202 16.609 23.7823 16.609C23.0444 16.609 22.4462 16.0076 22.4462 15.2657C22.4462 14.5238 23.0444 13.9224 23.7823 13.9224C24.5202 13.9224 25.1184 14.5238 25.1184 15.2657Z",
145
- fill: "#9CA3AF"
146
- }), /* @__PURE__ */ React5.createElement("path", {
147
- d: "M35.7842 15.9373C35.7842 16.6792 35.186 17.2806 34.4481 17.2806C33.7102 17.2806 33.112 16.6792 33.112 15.9373C33.112 15.1954 33.7102 14.594 34.4481 14.594C35.186 14.594 35.7842 15.1954 35.7842 15.9373Z",
148
- fill: "#9CA3AF"
149
- })),
150
- () => {
151
- return true;
152
- }
153
- );
154
-
155
- // lib/nav/Nav.tsx
156
- import React8 from "react";
157
-
158
- // lib/breadcrumb/Breadcrumb.tsx
159
- import React7 from "react";
160
- import classNames5 from "classnames";
161
-
162
- // lib/link/Link.tsx
163
- import classNames4 from "classnames";
164
- import { Link as BaseLink } from "react-router-dom";
165
- import React6 from "react";
166
- var LinkColor = /* @__PURE__ */ ((LinkColor2) => {
167
- LinkColor2["BLUE"] = "blue";
168
- LinkColor2["RED"] = "red";
169
- LinkColor2["GRAY"] = "gray";
170
- return LinkColor2;
171
- })(LinkColor || {});
172
- var COLOR_MAPPING = {
173
- ["blue" /* BLUE */]: "text-blue-600",
174
- ["red" /* RED */]: "text-red-500",
175
- ["gray" /* GRAY */]: "text-gray-400"
176
- };
177
- var HOVER_COLOR_MAPPING = {
178
- ["blue" /* BLUE */]: "[&:not(:focus)]:hover:md:bg-blue-100 [&:not(:focus)]:hover:md:text-blue-600",
179
- ["red" /* RED */]: "[&:not(:focus)]:hover:md:bg-red-100 [&:not(:focus)]:hover:md:text-red-500",
180
- ["gray" /* GRAY */]: "[&:not(:focus)]:hover:md:bg-gray-100 [&:not(:focus)]:hover:md:text-gray-400"
181
- };
182
- var FOCUS_BG_COLOR_MAPPING = {
183
- ["blue" /* BLUE */]: "focus:bg-blue-100",
184
- ["red" /* RED */]: "focus:bg-red-100",
185
- ["gray" /* GRAY */]: "focus:bg-gray-100"
186
- };
187
- var Link = (props) => {
188
- const {
189
- color = "blue" /* BLUE */,
190
- external,
191
- className,
192
- children,
193
- status,
194
- readonly,
195
- ...rest
196
- } = props;
197
- const linkCls = classNames4(
198
- className,
199
- "rounded",
200
- "!no-underline",
201
- "transition-colors",
202
- COLOR_MAPPING[color],
203
- HOVER_COLOR_MAPPING[color],
204
- FOCUS_BG_COLOR_MAPPING[color]
205
- );
206
- if (external) {
207
- return /* @__PURE__ */ React6.createElement("a", {
208
- href: props.to,
209
- className: linkCls,
210
- target: "_blank",
211
- rel: "noreferrer",
212
- style: { padding: 4 }
213
- }, children);
214
- }
215
- if (readonly) {
216
- const isNonEnName = !/^[a-zA-Z~]+$/.test(children);
217
- const offsetCls = classNames4({ "relative top-[2px]": isNonEnName });
218
- return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement("span", {
219
- className: classNames4("text-gray-400", offsetCls),
220
- style: { padding: 4 }
221
- }, children), /* @__PURE__ */ React6.createElement(BlinkDot, {
222
- status
223
- }));
224
- }
225
- return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(BaseLink, {
226
- ...rest,
227
- className: linkCls,
228
- style: { padding: 4 }
229
- }, children), /* @__PURE__ */ React6.createElement(BlinkDot, {
230
- className: "-top-3 left-1",
231
- status
232
- }));
233
- };
234
-
235
- // lib/breadcrumb/Breadcrumb.tsx
236
- var Breadcrumb = (props) => {
237
- const { paths, loading } = props;
238
- const PathElements = paths.map(({ path, name }, index) => {
239
- const slash = index === 0 ? null : /* @__PURE__ */ React7.createElement("span", {
240
- className: "text-gray-400"
241
- }, "/");
242
- const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
243
- const offsetCls = classNames5({ "relative top-[2px]": isNonEnName });
244
- const isLast = index === paths.length - 1;
245
- const status = loading && isLast ? "blink" : "hidden";
246
- return /* @__PURE__ */ React7.createElement("span", {
247
- key: path || name
248
- }, slash, /* @__PURE__ */ React7.createElement(Link, {
249
- to: path ?? "",
250
- className: offsetCls,
251
- readonly: !path,
252
- status
253
- }, name));
254
- });
255
- return /* @__PURE__ */ React7.createElement("div", {
256
- className: "breadcrumb"
257
- }, PathElements);
258
- };
259
-
260
- // lib/nav/Nav.tsx
261
- import { useNavigate } from "react-router-dom";
262
- var Nav = (props) => {
263
- if (props.mini) {
264
- return /* @__PURE__ */ React8.createElement("div", {
265
- className: `p-8 w-full flex items-center ${props.className}`
266
- }, /* @__PURE__ */ React8.createElement(Breadcrumb, {
267
- paths: props.paths
268
- }));
269
- }
270
- const nav = useNavigate();
271
- return /* @__PURE__ */ React8.createElement("div", {
272
- className: `p-8 w-full flex items-center ${props.className}`
273
- }, props.customLogo || /* @__PURE__ */ React8.createElement(Logo, {
274
- className: "mr-8",
275
- onClick: () => {
276
- nav("/");
277
- }
278
- }), /* @__PURE__ */ React8.createElement(Breadcrumb, {
279
- paths: props.paths,
280
- loading: props.loading
281
- }));
282
- };
283
-
284
- // lib/tag/Tag.tsx
285
- import classNames6 from "classnames";
286
- import React9 from "react";
287
- var Tag = (props) => {
288
- return /* @__PURE__ */ React9.createElement(Link, {
289
- ...props,
290
- color: "gray" /* GRAY */
291
- }, /* @__PURE__ */ React9.createElement("small", null, props.prefix || "#", props.children));
292
- };
293
- var Tags = (props) => {
294
- const { tags, className } = props;
295
- return /* @__PURE__ */ React9.createElement("div", {
296
- className: classNames6(className, "inline-block")
297
- }, tags.map((tag, index) => {
298
- const isLast = index === tags.length - 1;
299
- return /* @__PURE__ */ React9.createElement(Tag, {
300
- ...tag,
301
- key: tag.to,
302
- className: classNames6({ "mr-8": !isLast })
303
- });
304
- }));
305
- };
306
-
307
- // lib/panel/Panel.tsx
308
- import React10, { useEffect, useState } from "react";
309
- var Panel = (props) => {
310
- const { className = "", children } = props;
311
- const [show, setShow] = useState(false);
312
- useEffect(() => {
313
- setShow(true);
314
- }, []);
315
- return /* @__PURE__ */ React10.createElement("div", {
316
- className: `transition-all ease-in-out duration-900 ${className} ${show ? "shadow-panel" : "shadow-empty"} p-32`
317
- }, children);
318
- };
319
-
320
- // lib/page/Page.tsx
321
- import React11 from "react";
322
- var Page = (props) => {
323
- const { nav, main } = props;
324
- return /* @__PURE__ */ React11.createElement("main", {
325
- className: "flex flex-col h-full"
326
- }, /* @__PURE__ */ React11.createElement("div", {
327
- className: `flx-grow-0 w-full fixed top-0 z-50`
328
- }, nav), /* @__PURE__ */ React11.createElement("section", {
329
- className: "flex-grow flex-shrink-0 px-6"
330
- }, main));
331
- };
332
- var NotFound = (props) => {
333
- return /* @__PURE__ */ React11.createElement(Error2, {
334
- error: { name: "404", message: "Not Found" }
335
- });
336
- };
337
- var Error2 = (props) => {
338
- const { error } = props;
339
- return /* @__PURE__ */ React11.createElement("div", {
340
- className: "prose"
341
- }, /* @__PURE__ */ React11.createElement("pre", null, /* @__PURE__ */ React11.createElement("code", {
342
- className: "javascript language-javascript"
343
- }, error.name, ":", error.message)));
344
- };
345
- var ErrorBoundary = class extends React11.Component {
346
- constructor(props) {
347
- super(props);
348
- this.state = { hasError: false };
349
- }
350
- static getDerivedStateFromError(error) {
351
- return { hasError: true, error };
352
- }
353
- render() {
354
- if (this.state.error && this.state.hasError) {
355
- return /* @__PURE__ */ React11.createElement(Article, {
356
- title: "\u51FA\u9519"
357
- }, /* @__PURE__ */ React11.createElement("div", {
358
- className: "relative h-256"
359
- }, /* @__PURE__ */ React11.createElement(Error2, {
360
- error: this.state.error
361
- })));
362
- }
363
- return this.props.children;
364
- }
365
- };
366
-
367
- // lib/pop-confirm/PopConfirm.tsx
368
- import React12, { useState as useState2 } from "react";
369
- var PopConfirm = (props) => {
370
- const [loading, setLoading] = useState2(false);
371
- const { onOk, onCancel, children, content, className } = props;
372
- return /* @__PURE__ */ React12.createElement(Panel, {
373
- className
374
- }, /* @__PURE__ */ React12.createElement("div", {
375
- className: "mb-32"
376
- }, children || content), /* @__PURE__ */ React12.createElement("div", {
377
- className: "flex justify-end"
378
- }, onCancel && /* @__PURE__ */ React12.createElement(Button, {
379
- onClick: onCancel,
380
- type: "normal" /* NORMAL */
381
- }, "Cancel"), onOk && /* @__PURE__ */ React12.createElement(Button, {
382
- onClick: async (e) => {
383
- setLoading(true);
384
- await onOk(e);
385
- setLoading(false);
386
- },
387
- className: "ml-16 relative",
388
- type: loading ? "disabled" /* DISABLED */ : "primary" /* PRIMARY */
389
- }, "OK", loading && /* @__PURE__ */ React12.createElement(BlinkDot, {
390
- className: "!absolute top-2 right-2"
391
- }))));
392
- };
393
-
394
- // lib/table/Table.tsx
395
- import React13 from "react";
396
- var Table = (props) => {
397
- const { rowCount, rowRenderer, headerRenderer, className } = props;
398
- const rows = [];
399
- for (let i = 0; i < rowCount; i++) {
400
- rows.push(/* @__PURE__ */ React13.createElement("tr", {
401
- key: i
402
- }, rowRenderer(i)));
403
- }
404
- return /* @__PURE__ */ React13.createElement("table", {
405
- className
406
- }, headerRenderer && /* @__PURE__ */ React13.createElement("thead", null, /* @__PURE__ */ React13.createElement("tr", null, headerRenderer())), /* @__PURE__ */ React13.createElement("tbody", null, rows));
407
- };
408
- Table.HCell = (props) => /* @__PURE__ */ React13.createElement("th", {
409
- ...props
410
- }, props.children);
411
- Table.Cell = (props) => /* @__PURE__ */ React13.createElement("td", {
412
- ...props
413
- }, props.children);
414
-
415
- // lib/skeleton/Seleton.tsx
416
- import classNames7 from "classnames";
417
- import React15 from "react";
418
-
419
- // lib/list/list.tsx
420
- import cls2 from "classnames";
421
- import React14 from "react";
422
- var List = (props) => {
423
- const { items, itemRenderer, className, horizontal, compact, footer } = props;
424
- const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-16";
425
- return /* @__PURE__ */ React14.createElement("ul", {
426
- className: cls2(className, "list-style-none", {
427
- flex: horizontal,
428
- "items-center": horizontal
429
- })
430
- }, items.map((item, index) => {
431
- return /* @__PURE__ */ React14.createElement("li", {
432
- key: item.id || index,
433
- className: cls2(spaceCls, "flex-shrink-0", { "!my-0": horizontal })
434
- }, itemRenderer(item, index));
435
- }), footer && /* @__PURE__ */ React14.createElement("li", {
436
- key: "footer",
437
- className: cls2(spaceCls, "flex-shrink-0", { "!my-0": horizontal })
438
- }, footer));
439
- };
440
- var TitledList = (props) => {
441
- const { title, description, ...rest } = props;
442
- if (!title) {
443
- return /* @__PURE__ */ React14.createElement(List, {
444
- ...rest
445
- });
446
- }
447
- return /* @__PURE__ */ React14.createElement(Article, {
448
- title,
449
- description,
450
- className: "w-fit"
451
- }, /* @__PURE__ */ React14.createElement(List, {
452
- ...rest
453
- }));
454
- };
455
- var LinkList = (props) => {
456
- const { title, description, links, ...rest } = props;
457
- const renderLink = ({ name, to, external, ...rest2 }) => {
458
- return /* @__PURE__ */ React14.createElement(Link, {
459
- to,
460
- key: name,
461
- external,
462
- ...rest2
463
- }, name);
464
- };
465
- return /* @__PURE__ */ React14.createElement(TitledList, {
466
- title,
467
- description,
468
- items: links,
469
- itemRenderer: renderLink,
470
- ...rest
471
- });
472
- };
473
-
474
- // lib/skeleton/Seleton.tsx
475
- var SkeletonColor = /* @__PURE__ */ ((SkeletonColor2) => {
476
- SkeletonColor2["BLUE"] = "blue";
477
- SkeletonColor2["RED"] = "red";
478
- SkeletonColor2["GRAY"] = "gray";
479
- SkeletonColor2["BLACK"] = "black";
480
- return SkeletonColor2;
481
- })(SkeletonColor || {});
482
- var COLOR_MAPPING2 = {
483
- ["blue" /* BLUE */]: "bg-blue-100",
484
- ["red" /* RED */]: "bg-red-100",
485
- ["gray" /* GRAY */]: "bg-gray-100",
486
- ["black" /* BLACK */]: "bg-gray-200"
487
- };
488
- var Skeleton = (props) => {
489
- const {
490
- bgColor = "gray" /* GRAY */,
491
- width = 26,
492
- height = 24,
493
- className
494
- } = props;
495
- return /* @__PURE__ */ React15.createElement("div", {
496
- className: classNames7(
497
- COLOR_MAPPING2[bgColor],
498
- "animate-pulse",
499
- "rounded",
500
- className
501
- ),
502
- style: { width, height }
503
- });
504
- };
505
- var ArticleSkeleton = (props) => {
506
- const { children, titleLength = 0, descriptionLength } = props;
507
- return /* @__PURE__ */ React15.createElement(Article, {
508
- title: /* @__PURE__ */ React15.createElement(Skeleton, {
509
- width: 36 * titleLength,
510
- height: 36,
511
- bgColor: "black" /* BLACK */
512
- }),
513
- description: descriptionLength && /* @__PURE__ */ React15.createElement(Skeleton, {
514
- width: 16 * descriptionLength
515
- })
516
- }, children);
517
- };
518
- var LinkListSkeleton = (props) => {
519
- const { linksLength, ...rest } = props;
520
- const renderSkeleton = (length) => {
521
- return /* @__PURE__ */ React15.createElement(Skeleton, {
522
- className: "inline-block align-middle",
523
- width: length * 16,
524
- bgColor: "blue" /* BLUE */
525
- });
526
- };
527
- if (!rest.titleLength) {
528
- return /* @__PURE__ */ React15.createElement(List, {
529
- items: linksLength,
530
- itemRenderer: renderSkeleton
531
- });
532
- }
533
- return /* @__PURE__ */ React15.createElement(ArticleSkeleton, {
534
- ...rest
535
- }, /* @__PURE__ */ React15.createElement(List, {
536
- items: linksLength,
537
- itemRenderer: renderSkeleton
538
- }));
539
- };
540
-
541
- // lib/drop-image/DropImage.tsx
542
- import cls3 from "classnames";
543
- import React16, {
544
- useEffect as useEffect2,
545
- useCallback as useCallback2
546
- } from "react";
547
- import { useState as useState4 } from "react";
548
-
549
- // lib/drop-image/utils.ts
550
- var wait = (d) => new Promise((r) => setTimeout(r, d));
551
-
552
- // lib/drop-image/useDropImage.ts
553
- import {
554
- useState as useState3,
555
- useCallback,
556
- useRef
557
- } from "react";
558
- var useDropImage = (params) => {
559
- const [isDragOver, setIsDragOver] = useState3(false);
560
- const [imageSrc, setImageSrc] = useState3("");
561
- const [imageSize, setImageSize] = useState3({ width: 0, height: 0 });
562
- const imageFile = useRef();
563
- const {
564
- portraitImageWidth = 384,
565
- landscapeImageWidth = 500,
566
- onDrop = () => {
567
- },
568
- onImageLoad = () => {
569
- }
570
- } = params || {};
571
- const reset = () => {
572
- setImageSrc("");
573
- setImageSize({ width: 0, height: 0 });
574
- setIsDragOver(false);
575
- imageFile.current = null;
576
- };
577
- const calcDefaultImgSize2 = (img, defaultWidth) => {
578
- const { width, height } = img;
579
- const whRatio = width / height;
580
- const isHorizontal = width > height;
581
- const finalWidth = defaultWidth || (isHorizontal ? landscapeImageWidth : portraitImageWidth);
582
- return {
583
- width: finalWidth,
584
- height: finalWidth / whRatio
585
- };
586
- };
587
- const setPreviewImageSrcByFile = (file) => {
588
- try {
589
- setImageSrc(URL.createObjectURL(file));
590
- } catch (e) {
591
- setImageSrc("");
592
- }
593
- };
594
- const handleDragOver = useCallback((ev) => {
595
- ev.preventDefault();
596
- setIsDragOver(true);
597
- if (!ev.dataTransfer) {
598
- return;
599
- }
600
- ev.dataTransfer.dropEffect = "move";
601
- }, []);
602
- const handleDragLeave = useCallback(() => {
603
- setIsDragOver(false);
604
- }, []);
605
- const handleDrop = useCallback((ev) => {
606
- ev.preventDefault();
607
- setIsDragOver(false);
608
- const file = ev.dataTransfer ? ev.dataTransfer.files[0] : void 0;
609
- if (!file || !file.type.startsWith("image")) {
610
- return;
611
- }
612
- imageFile.current = file;
613
- setPreviewImageSrcByFile(file);
614
- onDrop(ev, file);
615
- }, []);
616
- const handleImgLoad = (img) => {
617
- const updateFunc = async () => {
618
- const p = "decode" in img ? img.decode : Promise.resolve;
619
- try {
620
- await p();
621
- } catch (e) {
622
- }
623
- setImageSize(
624
- calcDefaultImgSize2({
625
- width: img.naturalWidth,
626
- height: img.naturalHeight
627
- })
628
- );
629
- if (!imageFile.current) {
630
- return;
631
- }
632
- onImageLoad(img, imageFile.current);
633
- };
634
- if (img.complete) {
635
- updateFunc().then();
636
- return;
637
- }
638
- img.onload = updateFunc;
639
- };
640
- const imageRef = useCallback((input) => {
641
- if (!input) {
642
- return;
643
- }
644
- handleImgLoad(input);
645
- }, []);
646
- return {
647
- isDragOver,
648
- imageSrc,
649
- imageRef,
650
- imageSize,
651
- handleDragOver,
652
- handleDragLeave,
653
- handleDrop,
654
- reset
655
- };
656
- };
657
-
658
- // lib/drop-image/DropImage.tsx
659
- var ImagePreviewer = (props) => {
660
- const {
661
- visible: showImagePreviewer,
662
- imageRef,
663
- imageSize,
664
- imageSrc,
665
- className
666
- } = props;
667
- return /* @__PURE__ */ React16.createElement("img", {
668
- className: cls3(
669
- className,
670
- "max-w-[100%]",
671
- "h-[auto]",
672
- "duration-300",
673
- "transition-opacity",
674
- "opacity-100",
675
- {
676
- "opacity-0": !showImagePreviewer,
677
- "!m-0": !showImagePreviewer,
678
- "!p-0": !showImagePreviewer
679
- }
680
- ),
681
- ref: imageRef,
682
- src: imageSrc,
683
- width: imageSize.width,
684
- height: imageSize.height
685
- });
686
- };
687
- var GhostDropImage = (props) => {
688
- const {
689
- onDrop = () => {
690
- },
691
- onUploadFinish = () => {
692
- },
693
- uploader,
694
- waitTimeAfterFinish = 2e3,
695
- className = "",
696
- children,
697
- placeholder
698
- } = props;
699
- const [coverVisible, setCoverVisible] = useState4(false);
700
- const [imageVisible, setImageVisible] = useState4(false);
701
- const handleDocDragEnter = useCallback2(() => {
702
- setCoverVisible(true);
703
- }, []);
704
- const {
705
- handleDragLeave,
706
- handleDragOver,
707
- handleDrop,
708
- imageRef,
709
- imageSize,
710
- imageSrc,
711
- reset
712
- } = useDropImage({
713
- onImageLoad: () => {
714
- setImageVisible(true);
715
- },
716
- onDrop: async (e, file) => {
717
- onDrop(e, file);
718
- setCoverVisible(false);
719
- const result = await uploader(file);
720
- await wait(waitTimeAfterFinish);
721
- onUploadFinish(result);
722
- setImageVisible(false);
723
- reset();
724
- }
725
- });
726
- useEffect2(() => {
727
- document.addEventListener("dragenter", handleDocDragEnter);
728
- return () => {
729
- document.removeEventListener("dragenter", handleDocDragEnter);
730
- };
731
- }, []);
732
- const coverCls = cls3("fixed", "top-0", "left-0", "h-full", "w-full", {
733
- "lqip-blur": coverVisible,
734
- "z-[999]": coverVisible,
735
- block: coverVisible,
736
- hidden: !coverVisible
737
- });
738
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", {
739
- className: coverCls,
740
- onDragLeave: () => {
741
- handleDragLeave();
742
- setCoverVisible(false);
743
- },
744
- onDragOver: handleDragOver,
745
- onDrop: handleDrop
746
- }), !imageVisible && placeholder, children ? children({
747
- visible: imageVisible,
748
- imageRef,
749
- imageSize,
750
- imageSrc
751
- }) : /* @__PURE__ */ React16.createElement(ImagePreviewer, {
752
- className,
753
- visible: imageVisible,
754
- imageRef,
755
- imageSrc,
756
- imageSize
757
- }));
758
- };
759
- var DropImage = (props) => {
760
- const {
761
- uploader,
762
- defaultBgColor = "#F3F4F6",
763
- onDrop,
764
- dragOverBgColor = "#EFF6FF",
765
- waitTimeAfterFinish = 2e3,
766
- placeholder = "",
767
- className = "",
768
- onUploadFinish = () => {
769
- },
770
- ghost,
771
- children,
772
- dropAreaStyle = {
773
- width: 300,
774
- height: 300
775
- }
776
- } = props;
777
- if (ghost) {
778
- return /* @__PURE__ */ React16.createElement(GhostDropImage, {
779
- ...props
780
- });
781
- }
782
- const [showImagePreviewer, setShowImagePreviewer] = useState4(false);
783
- const {
784
- handleDragLeave,
785
- handleDragOver,
786
- handleDrop,
787
- imageRef,
788
- imageSize,
789
- imageSrc,
790
- isDragOver,
791
- reset
792
- } = useDropImage({
793
- onDrop,
794
- onImageLoad: async (image, file) => {
795
- await wait(500);
796
- setShowImagePreviewer(true);
797
- await onUploadFinish(await uploader(file, image));
798
- await wait(waitTimeAfterFinish);
799
- setShowImagePreviewer(false);
800
- await wait(500);
801
- reset();
802
- }
803
- });
804
- const getDropAreaStyle = () => {
805
- return Object.assign({}, dropAreaStyle, {
806
- background: isDragOver ? dragOverBgColor : defaultBgColor,
807
- width: imageSize.width || dropAreaStyle.width,
808
- height: imageSize.height || dropAreaStyle.height
809
- });
810
- };
811
- return /* @__PURE__ */ React16.createElement("div", {
812
- className: cls3(
813
- className,
814
- "transition-all items-center justify-center flex duration-200 ease-in-out",
815
- {
816
- "shadow-input": !imageSrc,
817
- "shadow-empty": imageSrc
818
- }
819
- ),
820
- onDragLeave: handleDragLeave,
821
- onDragOver: handleDragOver,
822
- onDrop: handleDrop,
823
- style: getDropAreaStyle()
824
- }, children ? children({
825
- visible: showImagePreviewer,
826
- imageRef,
827
- imageSize,
828
- imageSrc
829
- }) : /* @__PURE__ */ React16.createElement(ImagePreviewer, {
830
- visible: showImagePreviewer,
831
- imageRef,
832
- imageSrc,
833
- imageSize
834
- }), !imageSrc && placeholder);
835
- };
836
-
837
- // lib/layout/layout.tsx
838
- import cls4 from "classnames";
839
- import React17 from "react";
840
- var ThreeColLayout = (props) => {
841
- const { leftRenderer, middleRenderer, rightRenderer } = props;
842
- const colCls = cls4("max-h-full overflow-auto xl:!block py-128");
843
- return /* @__PURE__ */ React17.createElement("div", {
844
- className: "grid grid-cols-1 xl:grid-cols-3 gap-4 h-full w-full"
845
- }, /* @__PURE__ */ React17.createElement("div", {
846
- className: cls4("hidden", colCls)
847
- }, leftRenderer && leftRenderer()), /* @__PURE__ */ React17.createElement("div", {
848
- className: cls4(colCls, "sm:px-128 xl:px-0 no-scrollbar", "relative", {
849
- hidden: !middleRenderer
850
- })
851
- }, middleRenderer && middleRenderer()), /* @__PURE__ */ React17.createElement("div", {
852
- className: cls4("hidden", colCls)
853
- }, rightRenderer && rightRenderer()));
854
- };
855
-
856
- // lib/img/Img.tsx
857
- import classnames from "classnames";
858
- import React18, { useState as useState5 } from "react";
859
-
860
- // lib/img/types.ts
861
- var ossProcessType = /* @__PURE__ */ ((ossProcessType2) => {
862
- ossProcessType2["THUMBNAIL"] = "thumbnail";
863
- ossProcessType2["WEBP"] = "webp";
864
- ossProcessType2["NULL"] = "null";
865
- ossProcessType2["oWEBP"] = "owebp";
866
- ossProcessType2["PROG"] = "prog";
867
- return ossProcessType2;
868
- })(ossProcessType || {});
869
-
870
- // lib/img/utils.ts
871
- var addOssWebpProcessStyle = (originUrl, style) => {
872
- const OSS_ADDRESS = "https://zjh-im-res.oss-cn-shenzhen.aliyuncs.com";
873
- const isInvalidOSSImgUrl = !originUrl.startsWith(OSS_ADDRESS);
874
- const isProcessedOssImg = /x-oss-process=style\/\w+/.test(originUrl);
875
- const isWebpImg = /webp$/.test(originUrl);
876
- if (isInvalidOSSImgUrl || isProcessedOssImg || isWebpImg && style === "webp" /* WEBP */ || style === "null" /* NULL */) {
877
- return originUrl;
878
- }
879
- return `${originUrl}?x-oss-process=style/${style}`;
880
- };
881
- var calcDefaultImgSize = (img, defaultWidth, scale) => {
882
- const { width, height } = img;
883
- const whRatio = width / height;
884
- const isHorizontal = width > height;
885
- const finalWidth = (defaultWidth || (isHorizontal ? 576 : 384)) * (scale || 1);
886
- return {
887
- width: finalWidth,
888
- height: finalWidth / whRatio
889
- };
890
- };
891
-
892
- // lib/img/Img.tsx
893
- var emptyDataURL = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
894
- var Img = (props) => {
895
- const {
896
- src,
897
- className,
898
- renderedWidth,
899
- avgColor,
900
- thumbnailSrc,
901
- processType,
902
- size,
903
- removeBlurBgAfterLoad
904
- } = props;
905
- const { width, height } = calcDefaultImgSize(
906
- props,
907
- renderedWidth,
908
- size === "normal" ? 0.6 : 1
909
- );
910
- const [loaded, setLoaded] = useState5(false);
911
- const [decoded, setDecoded] = useState5(false);
912
- const baseWrapperStyle = {
913
- width: "initial",
914
- height: "initial",
915
- backgroundSize: "cover",
916
- backgroundColor: avgColor || "#f1f1f1",
917
- backgroundPosition: "0% 0%",
918
- backgroundImage: `url(${thumbnailSrc ? thumbnailSrc : addOssWebpProcessStyle(src, "thumbnail" /* THUMBNAIL */)})`
919
- };
920
- const dynamicWrapperStyle = loaded && removeBlurBgAfterLoad ? { backgroundImage: "none" } : {};
921
- const handleImgLoad = (img) => {
922
- const updateFunc = async () => {
923
- const p = "decode" in img ? img.decode : Promise.resolve;
924
- try {
925
- await p();
926
- } catch (e) {
927
- }
928
- setDecoded(true);
929
- setLoaded(true);
930
- };
931
- if (img.complete) {
932
- updateFunc().then();
933
- return;
934
- }
935
- img.onload = updateFunc;
936
- };
937
- return /* @__PURE__ */ React18.createElement("span", {
938
- className: classnames(
939
- className,
940
- "inline-block",
941
- "relative",
942
- "overflow-hidden",
943
- "duration-500",
944
- "leading-none",
945
- "align-bottom",
946
- "border-0"
947
- ),
948
- draggable: false,
949
- style: Object.assign({}, baseWrapperStyle, dynamicWrapperStyle)
950
- }, /* @__PURE__ */ React18.createElement("img", {
951
- ref: (input) => {
952
- if (!input) {
953
- return;
954
- }
955
- handleImgLoad(input);
956
- },
957
- width,
958
- height,
959
- src: addOssWebpProcessStyle(src, processType || "webp" /* WEBP */),
960
- decoding: "async",
961
- loading: "lazy",
962
- crossOrigin: "anonymous",
963
- style: {
964
- contentVisibility: "auto"
965
- },
966
- className: classnames(
967
- "transition-opacity",
968
- "opacity-100",
969
- "duration-500",
970
- {
971
- "opacity-0": !decoded
972
- }
973
- )
974
- }), /* @__PURE__ */ React18.createElement("img", {
975
- src: emptyDataURL,
976
- className: classnames(
977
- "lqip-blur",
978
- "absolute",
979
- "h-full",
980
- "w-full",
981
- "duration-500",
982
- "transition-opacity",
983
- {
984
- "opacity-100": !decoded,
985
- "opacity-0": decoded
986
- }
987
- ),
988
- crossOrigin: "anonymous",
989
- style: { top: 0, left: 0 }
990
- }));
991
- };
992
-
993
- // lib/img/Gallery.tsx
994
- import classnames3 from "classnames";
995
- import React20 from "react";
996
-
997
- // lib/img/RandomRowsLayout.tsx
998
- import classnames2 from "classnames";
999
- import React19 from "react";
1000
- var last = (arr) => {
1001
- if (arr.length < 2) {
1002
- return arr[0];
1003
- }
1004
- return arr[arr.length - 1];
1005
- };
1006
- var defaultCellClsGenerator = (colNum, isCenterSingleCell) => {
1007
- const isSingleCell = colNum === 1;
1008
- const singleCellWidth = isCenterSingleCell ? "full" : "1/2";
1009
- const cellWidth = isSingleCell ? singleCellWidth : "1/2";
1010
- return `md:basis-${cellWidth}`;
1011
- };
1012
- var generateRandomBoolean = (p = 0.5) => Math.random() < p;
1013
- var generateRandomColNum = (total) => {
1014
- const colNumArr = [];
1015
- if (total <= 2) {
1016
- return [total];
1017
- }
1018
- let colSum = 0;
1019
- while (colSum < total) {
1020
- const p = last(colNumArr) === 2 ? 0.9 : 0.5;
1021
- const num = generateRandomBoolean(p) ? 1 : 2;
1022
- colNumArr.push(num);
1023
- colSum += num;
1024
- }
1025
- return colNumArr;
1026
- };
1027
- var sumColNumByIdx = (colNums, idx) => {
1028
- let sum = 0;
1029
- for (let i = 0; i < idx; i++) {
1030
- sum += colNums[i];
1031
- }
1032
- return sum;
1033
- };
1034
- var RandomRowsLayout = React19.memo(
1035
- (props) => {
1036
- const {
1037
- cellsCount,
1038
- cellRenderer,
1039
- classNames: classNames9 = "",
1040
- cellWrapperClsGenerator = defaultCellClsGenerator
1041
- } = props;
1042
- const colNums = generateRandomColNum(cellsCount);
1043
- return /* @__PURE__ */ React19.createElement("div", {
1044
- className: classNames9
1045
- }, colNums.map((colNum, row) => {
1046
- const randBool = generateRandomBoolean(
1047
- colNum < 2 ? 0.6 : 0.5
1048
- );
1049
- const randBoolArr = [randBool, !randBool];
1050
- return /* @__PURE__ */ React19.createElement("div", {
1051
- className: "flex items-center flex-wrap",
1052
- key: row
1053
- }, new Array(colNum).fill(null).map((_, col) => {
1054
- const generatedCls = cellWrapperClsGenerator(
1055
- colNum,
1056
- generateRandomBoolean()
1057
- );
1058
- const currentIdx = sumColNumByIdx(colNums, row) + col;
1059
- const cls6 = classnames2(
1060
- "flex items-center justify-center flex-shrink-0 flex-grow-0",
1061
- "basis-full",
1062
- generatedCls
1063
- );
1064
- return /* @__PURE__ */ React19.createElement("div", {
1065
- className: cls6,
1066
- key: col
1067
- }, cellRenderer(currentIdx, randBoolArr[col], col));
1068
- }));
1069
- }));
1070
- },
1071
- (prevProps, nextProps) => {
1072
- return prevProps.cellsCount === nextProps.cellsCount;
1073
- }
1074
- );
1075
-
1076
- // lib/img/Gallery.tsx
1077
- var defaultImageRenderer = (img, index, col) => {
1078
- return /* @__PURE__ */ React20.createElement("div", {
1079
- className: classnames3("mb-128", {
1080
- "md:mr-64": col === 0,
1081
- "md:ml-64": col !== 0
1082
- })
1083
- }, img);
1084
- };
1085
- var Gallery = (props) => {
1086
- const {
1087
- images,
1088
- children,
1089
- imageRenderer = defaultImageRenderer,
1090
- className = "",
1091
- ...rest
1092
- } = props;
1093
- const renderImage = (index, isLargeImage, col) => {
1094
- const image = images[index];
1095
- if (!image) {
1096
- return null;
1097
- }
1098
- return imageRenderer(
1099
- /* @__PURE__ */ React20.createElement(Img, {
1100
- ...image,
1101
- size: isLargeImage ? "large" : "normal"
1102
- }),
1103
- index,
1104
- col,
1105
- isLargeImage
1106
- );
1107
- };
1108
- return /* @__PURE__ */ React20.createElement("div", {
1109
- className: classnames3("w-full flex justify-center", className)
1110
- }, /* @__PURE__ */ React20.createElement(RandomRowsLayout, {
1111
- classNames: "mx-32 mt-128 max-w-screen-xl",
1112
- cellsCount: images.length,
1113
- cellRenderer: renderImage,
1114
- ...rest
1115
- }), children);
1116
- };
1117
-
1118
- // lib/loading-spiral/LoadingSpiral.tsx
1119
- import Phenomenon from "phenomenon";
1120
- import classNames8 from "classnames";
1121
- import React21, { useEffect as useEffect3, useRef as useRef2 } from "react";
1122
-
1123
- // lib/loading-spiral/createSettings.ts
1124
- var createSettings = (settings) => {
1125
- const { canvas, step = 0.09 } = settings;
1126
- const uniforms = {
1127
- uProgress: {
1128
- type: "float",
1129
- value: 0
1130
- }
1131
- };
1132
- return {
1133
- uniforms,
1134
- devicePixelRatio: window.devicePixelRatio,
1135
- shouldRender: true,
1136
- canvas,
1137
- onRender: (r) => {
1138
- const { uProgress } = r.uniforms;
1139
- uProgress.value += step;
1140
- }
1141
- };
1142
- };
1143
-
1144
- // lib/loading-spiral/constants.ts
1145
- var VERTEX_SHADER = `
1146
- attribute float ${"aPercent" /* PERCENT */};
1147
- attribute float ${"aPointSize" /* POINT_SIZE */};
1148
-
1149
- uniform mat4 uProjectionMatrix;
1150
- uniform mat4 uModelMatrix;
1151
- uniform mat4 uViewMatrix;
1152
- uniform float uProgress;
1153
-
1154
- varying vec3 vColor;
1155
-
1156
- vec3 curve(float _percent) {
1157
- const float PI2 = 3.141592653589793 * 2.0;
1158
- const float _length = 0.3;
1159
- const float radius = 0.056;
1160
- float t = mod(_percent, 0.25) / 0.25;
1161
- t = mod(_percent, 0.25) - (2.0 * (1.0 - t) * t * -0.0185 + t * t * 0.25);
1162
- float x = _length * sin(PI2 * _percent);
1163
- float y = radius * cos(PI2 * 3.0 * _percent);
1164
-
1165
- if (
1166
- floor(_percent / 0.25) == 0.0
1167
- || floor(_percent / 0.25) == 2.0
1168
- ) {
1169
- t = t * -1.0;
1170
- }
1171
- float z = radius * sin(PI2 * 2.0 * (_percent - t));
1172
- return vec3(x, y, z);
1173
- }
1174
-
1175
- mat4 rotateX(float _angle){
1176
- return mat4(
1177
- 1.0, 0.0, 0.0, 0.0,
1178
- 0.0, cos(_angle), -sin(_angle), 0.0,
1179
- 0.0, sin(_angle), cos(_angle), 0.0,
1180
- 0.0, 0.0, 0.0, 1.0
1181
- );
1182
- }
1183
-
1184
- void main(){
1185
- gl_Position = uProjectionMatrix
1186
- * uModelMatrix
1187
- * uViewMatrix
1188
- * rotateX(uProgress)
1189
- * vec4(curve(${"aPercent" /* PERCENT */}), 1.0);
1190
-
1191
- gl_PointSize = ${"aPointSize" /* POINT_SIZE */};
1192
- }
1193
- `;
1194
- var FRAGMENT_SHADER = `
1195
- precision mediump float;
1196
- uniform float uProgress;
1197
- void main(){
1198
- gl_FragColor = vec4(0.81, 0.83, 0.85, 1.0);
1199
- }
1200
- `;
1201
-
1202
- // lib/loading-spiral/createOptions.ts
1203
- var createOptions = () => {
1204
- const attributes = [
1205
- {
1206
- name: "aPercent" /* PERCENT */,
1207
- data: (i, total) => [i / total],
1208
- size: 1
1209
- },
1210
- {
1211
- name: "aPointSize" /* POINT_SIZE */,
1212
- data: () => [window.devicePixelRatio * 1.3],
1213
- size: 1
1214
- }
1215
- ];
1216
- const uniforms = {
1217
- uProgress: {
1218
- type: "float",
1219
- value: [0]
1220
- }
1221
- };
1222
- return {
1223
- uniforms,
1224
- attributes,
1225
- multiplier: 4e3,
1226
- vertex: VERTEX_SHADER,
1227
- fragment: FRAGMENT_SHADER
1228
- };
1229
- };
1230
-
1231
- // lib/loading-spiral/LoadingSpiral.tsx
1232
- var LoadingSpiral = (props) => {
1233
- const { className, step } = props || {};
1234
- const canvasRef = useRef2(null);
1235
- useEffect3(() => {
1236
- if (!canvasRef.current) {
1237
- return;
1238
- }
1239
- const phenomenon = new Phenomenon({
1240
- settings: createSettings({ canvas: canvasRef.current, step }),
1241
- context: {
1242
- antialias: true,
1243
- alpha: true
1244
- }
1245
- });
1246
- phenomenon.add(
1247
- "spiral",
1248
- createOptions()
1249
- );
1250
- }, []);
1251
- return /* @__PURE__ */ React21.createElement("canvas", {
1252
- style: {
1253
- maxWidth: 500,
1254
- maxHeight: 500,
1255
- imageRendering: "pixelated"
1256
- },
1257
- ref: canvasRef,
1258
- className: classNames8(
1259
- "h-full w-full overflow-hidden flex justify-center items-center aspect-1",
1260
- className
1261
- )
1262
- });
1263
- };
1264
-
1265
- // lib/drop-zone/DropZone.tsx
1266
- import React22, { useCallback as useCallback3, useEffect as useEffect4, useState as useState6 } from "react";
1267
- import cls5 from "classnames";
1268
- var DropZone = (props) => {
1269
- const { onDrop, children, className, style } = props;
1270
- const [coverVisible, setCoverVisible] = useState6(false);
1271
- const handleDrop = (e) => {
1272
- e.preventDefault();
1273
- setCoverVisible(false);
1274
- const file = e.dataTransfer.files[0];
1275
- onDrop(file);
1276
- };
1277
- const handleDocDragEnter = useCallback3((e) => {
1278
- e.preventDefault();
1279
- setCoverVisible(true);
1280
- }, []);
1281
- useEffect4(() => {
1282
- document.addEventListener("dragenter", handleDocDragEnter);
1283
- return () => {
1284
- document.removeEventListener("dragenter", handleDocDragEnter);
1285
- };
1286
- }, []);
1287
- if (props.disabled) {
1288
- return /* @__PURE__ */ React22.createElement(React22.Fragment, null, children);
1289
- }
1290
- const handleDragOver = (e) => {
1291
- e.preventDefault();
1292
- setCoverVisible(true);
1293
- };
1294
- const coverCls = cls5("fixed", "top-0", "left-0", "h-full", "w-full", {
1295
- "text-blur": coverVisible,
1296
- "z-[999]": coverVisible,
1297
- block: coverVisible,
1298
- hidden: !coverVisible
1299
- });
1300
- return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", {
1301
- className: coverCls,
1302
- onDragLeave: () => {
1303
- setCoverVisible(false);
1304
- },
1305
- onDragOver: handleDragOver,
1306
- onDrop: handleDrop
1307
- }), children);
1308
- };
1309
-
1310
- // lib/context-menu/index.tsx
1311
- import * as React23 from "react";
1312
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
1313
- import {
1314
- CheckIcon,
1315
- ChevronRightIcon,
1316
- DotFilledIcon
1317
- } from "@radix-ui/react-icons";
1318
- import cn from "classnames";
1319
- "use client";
1320
- var ContextMenu = ContextMenuPrimitive.Root;
1321
- var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
1322
- var ContextMenuGroup = ContextMenuPrimitive.Group;
1323
- var ContextMenuPortal = ContextMenuPrimitive.Portal;
1324
- var ContextMenuSub = ContextMenuPrimitive.Sub;
1325
- var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
1326
- var ContextMenuSubTrigger = React23.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubTrigger, {
1327
- ref,
1328
- className: cn(
1329
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1330
- inset && "pl-32",
1331
- className
1332
- ),
1333
- ...props
1334
- }, children, /* @__PURE__ */ React23.createElement(ChevronRightIcon, {
1335
- className: "ml-auto"
1336
- })));
1337
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
1338
- var ContextMenuSubContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubContent, {
1339
- ref,
1340
- className: cn(
1341
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1342
- className
1343
- ),
1344
- ...props
1345
- }));
1346
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
1347
- var ContextMenuContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Content, {
1348
- ref,
1349
- className: cn(
1350
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1351
- className
1352
- ),
1353
- ...props
1354
- })));
1355
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
1356
- var ContextMenuItem = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Item, {
1357
- ref,
1358
- className: cn(
1359
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1360
- inset && "pl-32",
1361
- className
1362
- ),
1363
- ...props
1364
- }));
1365
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
1366
- var ContextMenuCheckboxItem = React23.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.CheckboxItem, {
1367
- ref,
1368
- className: cn(
1369
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-32 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1370
- className
1371
- ),
1372
- checked,
1373
- ...props
1374
- }, /* @__PURE__ */ React23.createElement("span", {
1375
- className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
1376
- }, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(CheckIcon, {
1377
- className: "h-4 w-4"
1378
- }))), children));
1379
- ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
1380
- var ContextMenuRadioItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.RadioItem, {
1381
- ref,
1382
- className: cn(
1383
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-32 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1384
- className
1385
- ),
1386
- ...props
1387
- }, /* @__PURE__ */ React23.createElement("span", {
1388
- className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
1389
- }, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(DotFilledIcon, {
1390
- className: "h-4 w-4 fill-current"
1391
- }))), children));
1392
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
1393
- var ContextMenuLabel = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Label, {
1394
- ref,
1395
- className: cn(
1396
- "px-2 py-1.5 text-sm font-semibold text-foreground",
1397
- inset && "pl-32",
1398
- className
1399
- ),
1400
- ...props
1401
- }));
1402
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
1403
- var ContextMenuSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Separator, {
1404
- ref,
1405
- className: cn("-mx-1 my-1 h-px bg-border", className),
1406
- ...props
1407
- }));
1408
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
1409
- var ContextMenuShortcut = ({
1410
- className,
1411
- ...props
1412
- }) => {
1413
- return /* @__PURE__ */ React23.createElement("span", {
1414
- className: cn(
1415
- "ml-auto text-xs tracking-widest text-muted-foreground",
1416
- className
1417
- ),
1418
- ...props
1419
- });
1420
- };
1421
- ContextMenuShortcut.displayName = "ContextMenuShortcut";
1422
-
1423
- // lib/form/index.tsx
1424
- import * as React25 from "react";
1425
- import { z } from "zod";
1426
- import { Slot } from "@radix-ui/react-slot";
1427
- import { zodResolver } from "@hookform/resolvers/zod";
1428
- import {
1429
- Controller,
1430
- useForm,
1431
- FormProvider,
1432
- useFormContext
1433
- } from "react-hook-form";
1434
- import cn3 from "classnames";
1435
-
1436
- // lib/label/index.tsx
1437
- import * as React24 from "react";
1438
- import * as LabelPrimitive from "@radix-ui/react-label";
1439
- import { cva } from "class-variance-authority";
1440
- import cn2 from "classnames";
1441
- "use client";
1442
- var labelVariants = cva(
1443
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1444
- );
1445
- var Label2 = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React24.createElement(LabelPrimitive.Root, {
1446
- ref,
1447
- className: cn2(labelVariants(), className),
1448
- ...props
1449
- }));
1450
- Label2.displayName = LabelPrimitive.Root.displayName;
1451
-
1452
- // lib/form/index.tsx
1453
- "use client";
1454
- var Form = FormProvider;
1455
- var FormFieldContext = React25.createContext(
1456
- {}
1457
- );
1458
- var FormField = ({
1459
- ...props
1460
- }) => {
1461
- return /* @__PURE__ */ React25.createElement(FormFieldContext.Provider, {
1462
- value: { name: props.name }
1463
- }, /* @__PURE__ */ React25.createElement(Controller, {
1464
- ...props
1465
- }));
1466
- };
1467
- var useFormField = () => {
1468
- const fieldContext = React25.useContext(FormFieldContext);
1469
- const itemContext = React25.useContext(FormItemContext);
1470
- const { getFieldState, formState } = useFormContext();
1471
- const fieldState = getFieldState(fieldContext.name, formState);
1472
- if (!fieldContext) {
1473
- throw new Error("useFormField should be used within <FormField>");
1474
- }
1475
- const { id } = itemContext;
1476
- return {
1477
- id,
1478
- name: fieldContext.name,
1479
- formItemId: `${id}-form-item`,
1480
- formDescriptionId: `${id}-form-item-description`,
1481
- formMessageId: `${id}-form-item-message`,
1482
- ...fieldState
1483
- };
1484
- };
1485
- var FormItemContext = React25.createContext(
1486
- {}
1487
- );
1488
- var FormItem = React25.forwardRef(({ className, ...props }, ref) => {
1489
- const id = React25.useId();
1490
- return /* @__PURE__ */ React25.createElement(FormItemContext.Provider, {
1491
- value: { id }
1492
- }, /* @__PURE__ */ React25.createElement("div", {
1493
- ref,
1494
- className: cn3("space-y-2", className),
1495
- ...props
1496
- }));
1497
- });
1498
- FormItem.displayName = "FormItem";
1499
- var FormLabel = React25.forwardRef(({ className, ...props }, ref) => {
1500
- const { error, formItemId } = useFormField();
1501
- return /* @__PURE__ */ React25.createElement(Label2, {
1502
- ref,
1503
- className: cn3(error && "text-destructive", className),
1504
- htmlFor: formItemId,
1505
- ...props
1506
- });
1507
- });
1508
- FormLabel.displayName = "FormLabel";
1509
- var FormControl = React25.forwardRef(({ ...props }, ref) => {
1510
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
1511
- return /* @__PURE__ */ React25.createElement(Slot, {
1512
- ref,
1513
- id: formItemId,
1514
- "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
1515
- "aria-invalid": !!error,
1516
- ...props
1517
- });
1518
- });
1519
- FormControl.displayName = "FormControl";
1520
- var FormDescription = React25.forwardRef(({ className, ...props }, ref) => {
1521
- const { formDescriptionId } = useFormField();
1522
- return /* @__PURE__ */ React25.createElement("p", {
1523
- ref,
1524
- id: formDescriptionId,
1525
- className: cn3("text-sm text-muted-foreground", className),
1526
- ...props
1527
- });
1528
- });
1529
- FormDescription.displayName = "FormDescription";
1530
- var FormMessage = React25.forwardRef(({ className, children, ...props }, ref) => {
1531
- const { error, formMessageId } = useFormField();
1532
- const body = error ? String(error == null ? void 0 : error.message) : children;
1533
- if (!body) {
1534
- return null;
1535
- }
1536
- return /* @__PURE__ */ React25.createElement("p", {
1537
- ref,
1538
- id: formMessageId,
1539
- className: cn3("text-sm font-medium text-destructive", className),
1540
- ...props
1541
- }, body);
1542
- });
1543
- FormMessage.displayName = "FormMessage";
1544
-
1545
- // lib/input/index.tsx
1546
- import * as React26 from "react";
1547
- import cn4 from "classnames";
1548
- var Input = React26.forwardRef(
1549
- ({ className, type, ...props }, ref) => {
1550
- return /* @__PURE__ */ React26.createElement("input", {
1551
- type,
1552
- className: cn4(
1553
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1554
- className
1555
- ),
1556
- ref,
1557
- ...props
1558
- });
1559
- }
1560
- );
1561
- Input.displayName = "Input";
1562
-
1563
- // lib/canvas/Canvas.tsx
1564
- import React27, { useEffect as useEffect6 } from "react";
1565
-
1566
- // lib/canvas/useRenderer.ts
1567
- import { useEffect as useEffect5, useRef as useRef3, useState as useState7 } from "react";
1568
- import Phenomenon2 from "phenomenon";
1569
- var useRenderer = (uniform) => {
1570
- const canvasRef = useRef3(null);
1571
- const [renderer, setRenderer] = useState7(null);
1572
- useEffect5(() => {
1573
- if (!canvasRef.current) {
1574
- return;
1575
- }
1576
- const renderer2 = new Phenomenon2({
1577
- settings: {
1578
- uniforms: uniform,
1579
- devicePixelRatio: window.devicePixelRatio,
1580
- shouldRender: true,
1581
- canvas: canvasRef.current,
1582
- mode: 4
1583
- },
1584
- context: {
1585
- antialias: true,
1586
- alpha: true
1587
- }
1588
- });
1589
- setRenderer(renderer2);
1590
- return () => {
1591
- renderer2 == null ? void 0 : renderer2.destroy();
1592
- window.removeEventListener("resize", renderer2 == null ? void 0 : renderer2.resize);
1593
- };
1594
- }, [canvasRef.current]);
1595
- return {
1596
- canvasRef,
1597
- renderer
1598
- };
1599
- };
1600
-
1601
- // lib/canvas/Canvas.tsx
1602
- var Canvas = (props) => {
1603
- const {
1604
- fragment,
1605
- vertex,
1606
- uniforms = {},
1607
- name,
1608
- attributes = [],
1609
- onRender,
1610
- ...rest
1611
- } = props;
1612
- const { canvasRef, renderer } = useRenderer(uniforms);
1613
- const instName = name ?? "default";
1614
- useEffect6(() => {
1615
- if (renderer == null || canvasRef.current == null) {
1616
- return;
1617
- }
1618
- const aCopy = attributes.map((attr) => ({
1619
- ...attr,
1620
- data: (i, total) => attr.data(i, total)
1621
- }));
1622
- const uCopy = Object.keys(uniforms).reduce((acc, key) => {
1623
- acc[key] = {
1624
- ...uniforms[key],
1625
- value: [...uniforms[key].value]
1626
- };
1627
- return acc;
1628
- }, {});
1629
- const vertices = [
1630
- { x: -100, y: 100, z: 0 },
1631
- { x: -100, y: -100, z: 0 },
1632
- { x: 100, y: 100, z: 0 },
1633
- { x: 100, y: -100, z: 0 },
1634
- { x: -100, y: -100, z: 0 },
1635
- { x: 100, y: 100, z: 0 }
1636
- ];
1637
- renderer.add(instName, {
1638
- uniforms: {
1639
- ...uCopy,
1640
- uProgress: {
1641
- type: "float",
1642
- value: 0
1643
- }
1644
- },
1645
- attributes: aCopy,
1646
- fragment,
1647
- vertex,
1648
- mode: 4,
1649
- geometry: { vertices },
1650
- onRender: (inst) => {
1651
- if (inst.uniforms.uProgress != void 0) {
1652
- inst.uniforms.uProgress.value += 0.09;
1653
- }
1654
- if (onRender) {
1655
- onRender(inst);
1656
- }
1657
- }
1658
- });
1659
- return () => {
1660
- renderer.remove(instName);
1661
- };
1662
- }, [renderer]);
1663
- return /* @__PURE__ */ React27.createElement("canvas", {
1664
- style: {
1665
- ...props.style,
1666
- imageRendering: "pixelated"
1667
- },
1668
- ref: canvasRef,
1669
- ...rest
1670
- });
1671
- };
1672
- export {
1673
- Article,
1674
- ArticleSkeleton,
1675
- BlinkDot,
1676
- BlurCover,
1677
- Breadcrumb,
1678
- Button,
1679
- ButtonType,
1680
- Canvas,
1681
- ContextMenu,
1682
- ContextMenuCheckboxItem,
1683
- ContextMenuContent,
1684
- ContextMenuGroup,
1685
- ContextMenuItem,
1686
- ContextMenuLabel,
1687
- ContextMenuPortal,
1688
- ContextMenuRadioGroup,
1689
- ContextMenuRadioItem,
1690
- ContextMenuSeparator,
1691
- ContextMenuShortcut,
1692
- ContextMenuSub,
1693
- ContextMenuSubContent,
1694
- ContextMenuSubTrigger,
1695
- ContextMenuTrigger,
1696
- DropImage,
1697
- DropZone,
1698
- Error2 as Error,
1699
- ErrorBoundary,
1700
- Form,
1701
- FormControl,
1702
- FormDescription,
1703
- FormField,
1704
- FormItem,
1705
- FormLabel,
1706
- FormMessage,
1707
- Gallery,
1708
- Img,
1709
- Input,
1710
- Label2 as Label,
1711
- Link,
1712
- LinkColor,
1713
- LinkList,
1714
- LinkListSkeleton,
1715
- List,
1716
- LoadingSpiral,
1717
- Logo,
1718
- Nav,
1719
- NotFound,
1720
- Page,
1721
- Panel,
1722
- PopConfirm,
1723
- Skeleton,
1724
- SkeletonColor,
1725
- Table,
1726
- Tag,
1727
- Tags,
1728
- ThreeColLayout,
1729
- TitledList,
1730
- ossProcessType,
1731
- useForm,
1732
- useFormField,
1733
- z,
1734
- zodResolver
1735
- };
1736
- //# sourceMappingURL=index.js.map