@bbki.ng/components 2.6.16 → 4.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.
- package/dist/Button.d.ts +1 -0
- package/dist/_virtual/_commonjsHelpers.mjs +6 -0
- package/dist/_virtual/index.mjs +4 -0
- package/dist/_virtual/jsx-runtime.mjs +7 -0
- package/dist/_virtual/jsx-runtime2.mjs +4 -0
- package/dist/_virtual/react-jsx-runtime.development.mjs +4 -0
- package/dist/_virtual/react-jsx-runtime.production.min.mjs +4 -0
- package/dist/article/Article.d.ts +11 -0
- package/dist/article/Article.mjs +43 -0
- package/dist/blink-dot/BlinkDot.d.ts +5 -0
- package/dist/blink-dot/BlinkDot.mjs +20 -0
- package/dist/blur-cover/BlurCover.d.ts +6 -0
- package/dist/blur-cover/BlurCover.mjs +28 -0
- package/dist/breadcrumb/Breadcrumb.d.ts +9 -0
- package/dist/breadcrumb/Breadcrumb.mjs +35 -0
- package/dist/button/Button.d.ts +18 -0
- package/dist/button/Button.mjs +35 -0
- package/dist/canvas/Canvas.d.ts +23 -0
- package/dist/canvas/Canvas.mjs +85 -0
- package/dist/canvas/useRenderer.d.ts +10 -0
- package/dist/canvas/useRenderer.mjs +31 -0
- package/dist/context-menu/index.d.ts +27 -0
- package/dist/context-menu/index.mjs +131 -0
- package/dist/drop-image/DropImage.d.ts +25 -0
- package/dist/drop-image/DropImage.mjs +151 -0
- package/dist/drop-image/useDropImage.d.ts +19 -0
- package/dist/drop-image/useDropImage.mjs +67 -0
- package/dist/drop-image/utils.d.ts +2 -0
- package/dist/drop-image/utils.mjs +4 -0
- package/dist/drop-zone/DropZone.d.ts +9 -0
- package/dist/drop-zone/DropZone.mjs +44 -0
- package/dist/img/Gallery.d.ts +11 -0
- package/dist/img/Gallery.mjs +37 -0
- package/dist/img/Img.d.ts +3 -0
- package/dist/img/Img.mjs +80 -0
- package/dist/img/RandomRowsLayout.d.ts +9 -0
- package/dist/img/RandomRowsLayout.mjs +49 -0
- package/dist/img/types.d.ts +21 -0
- package/dist/img/types.mjs +4 -0
- package/dist/img/utils.d.ts +7 -0
- package/dist/img/utils.mjs +15 -0
- package/dist/index.d.ts +25 -380
- package/dist/index.mjs +79 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.mjs +17 -0
- package/dist/label/index.d.ts +5 -0
- package/dist/label/index.mjs +17 -0
- package/dist/layout/layout.d.ts +7 -0
- package/dist/layout/layout.mjs +27 -0
- package/dist/link/Link.d.ts +17 -0
- package/dist/link/Link.mjs +83 -0
- package/dist/list/list.d.ts +23 -0
- package/dist/list/list.mjs +76 -0
- package/dist/loading-spiral/LoadingSpiral.d.ts +5 -0
- package/dist/loading-spiral/LoadingSpiral.mjs +37 -0
- package/dist/loading-spiral/constants.d.ts +6 -0
- package/dist/loading-spiral/constants.mjs +61 -0
- package/dist/loading-spiral/createOptions.d.ts +17 -0
- package/dist/loading-spiral/createOptions.mjs +30 -0
- package/dist/loading-spiral/createSettings.d.ts +16 -0
- package/dist/loading-spiral/createSettings.mjs +21 -0
- package/dist/loading-spiral/useCanvasRef.d.ts +4 -0
- package/dist/loading-spiral/utils.d.ts +1 -0
- package/dist/logo/Logo.d.ts +6 -0
- package/dist/logo/Logo.mjs +36 -0
- package/dist/nav/Nav.d.ts +10 -0
- package/dist/nav/Nav.mjs +27 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.18.9/node_modules/@babel/runtime/helpers/esm/extends.mjs +13 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.6.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +519 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +373 -0
- 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
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +108 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +120 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs +9 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/aria-hidden@1.2.3/node_modules/aria-hidden/dist/es2015/index.mjs +49 -0
- package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs +6 -0
- package/dist/node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs +40 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs +23 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.mjs +7 -0
- package/dist/node_modules/.pnpm/phenomenon@1.6.0/node_modules/phenomenon/dist/phenomenon.mjs +109 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.mjs +589 -0
- package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.mjs +32 -0
- package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.mjs +8 -0
- package/dist/node_modules/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.es6.mjs +29 -0
- 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
- 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
- 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
- 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
- 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
- package/dist/page/Page.d.ts +28 -0
- package/dist/page/Page.mjs +67 -0
- package/dist/panel/Panel.d.ts +6 -0
- package/dist/panel/Panel.mjs +17 -0
- package/dist/pop-confirm/PopConfirm.d.ts +10 -0
- package/dist/pop-confirm/PopConfirm.mjs +40 -0
- package/dist/skeleton/Seleton.d.ts +23 -0
- package/dist/skeleton/Seleton.mjs +69 -0
- package/dist/spinner/Spinner.d.ts +7 -0
- package/dist/table/Table.d.ts +18 -0
- package/dist/table/Table.mjs +34 -0
- package/dist/tag/Tag.d.ts +10 -0
- package/dist/tag/Tag.mjs +33 -0
- package/package.json +22 -13
- package/dist/index.cjs +0 -1816
- package/dist/index.cjs.map +0 -1
- package/dist/index.css +0 -1821
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -1738
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { SubTrigger as i, SubContent as l, Portal as f, Content as p, Item as m, CheckboxItem as u, ItemIndicator as x, RadioItem as b, Label as $, Separator as g, Root as h, Trigger as N, Group as y, Sub as C, RadioGroup as w } from "../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";
|
|
3
|
+
import { ChevronRightIcon as M, CheckIcon as R, DotFilledIcon as v } from "../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";
|
|
4
|
+
import n from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
5
|
+
import { jsxs as c, jsx as o } from "../_virtual/jsx-runtime.mjs";
|
|
6
|
+
const B = h, E = N, H = y, J = f, K = C, O = w, I = s.forwardRef(({
|
|
7
|
+
className: e,
|
|
8
|
+
inset: t,
|
|
9
|
+
children: a,
|
|
10
|
+
...d
|
|
11
|
+
}, r) => /* @__PURE__ */ c(i, {
|
|
12
|
+
ref: r,
|
|
13
|
+
className: n("flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", t && "pl-32", e),
|
|
14
|
+
...d,
|
|
15
|
+
children: [a, /* @__PURE__ */ o(M, {
|
|
16
|
+
className: "ml-auto"
|
|
17
|
+
})]
|
|
18
|
+
}));
|
|
19
|
+
I.displayName = i.displayName;
|
|
20
|
+
const S = s.forwardRef(({
|
|
21
|
+
className: e,
|
|
22
|
+
...t
|
|
23
|
+
}, a) => /* @__PURE__ */ o(l, {
|
|
24
|
+
ref: a,
|
|
25
|
+
className: n("z-50 min-w-32 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", e),
|
|
26
|
+
...t
|
|
27
|
+
}));
|
|
28
|
+
S.displayName = l.displayName;
|
|
29
|
+
const z = s.forwardRef(({
|
|
30
|
+
className: e,
|
|
31
|
+
...t
|
|
32
|
+
}, a) => /* @__PURE__ */ o(f, {
|
|
33
|
+
children: /* @__PURE__ */ o(p, {
|
|
34
|
+
ref: a,
|
|
35
|
+
className: n("z-50 min-w-32 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", e),
|
|
36
|
+
...t
|
|
37
|
+
})
|
|
38
|
+
}));
|
|
39
|
+
z.displayName = p.displayName;
|
|
40
|
+
const j = s.forwardRef(({
|
|
41
|
+
className: e,
|
|
42
|
+
inset: t,
|
|
43
|
+
...a
|
|
44
|
+
}, d) => /* @__PURE__ */ o(m, {
|
|
45
|
+
ref: d,
|
|
46
|
+
className: n("relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", t && "pl-32", e),
|
|
47
|
+
...a
|
|
48
|
+
}));
|
|
49
|
+
j.displayName = m.displayName;
|
|
50
|
+
const k = s.forwardRef(({
|
|
51
|
+
className: e,
|
|
52
|
+
children: t,
|
|
53
|
+
checked: a,
|
|
54
|
+
...d
|
|
55
|
+
}, r) => /* @__PURE__ */ c(u, {
|
|
56
|
+
ref: r,
|
|
57
|
+
className: n("relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-32 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", e),
|
|
58
|
+
checked: a,
|
|
59
|
+
...d,
|
|
60
|
+
children: [/* @__PURE__ */ o("span", {
|
|
61
|
+
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
62
|
+
children: /* @__PURE__ */ o(x, {
|
|
63
|
+
children: /* @__PURE__ */ o(R, {
|
|
64
|
+
className: "h-4 w-4"
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
}), t]
|
|
68
|
+
}));
|
|
69
|
+
k.displayName = u.displayName;
|
|
70
|
+
const G = s.forwardRef(({
|
|
71
|
+
className: e,
|
|
72
|
+
children: t,
|
|
73
|
+
...a
|
|
74
|
+
}, d) => /* @__PURE__ */ c(b, {
|
|
75
|
+
ref: d,
|
|
76
|
+
className: n("relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-32 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", e),
|
|
77
|
+
...a,
|
|
78
|
+
children: [/* @__PURE__ */ o("span", {
|
|
79
|
+
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
80
|
+
children: /* @__PURE__ */ o(x, {
|
|
81
|
+
children: /* @__PURE__ */ o(v, {
|
|
82
|
+
className: "h-4 w-4 fill-current"
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
}), t]
|
|
86
|
+
}));
|
|
87
|
+
G.displayName = b.displayName;
|
|
88
|
+
const T = s.forwardRef(({
|
|
89
|
+
className: e,
|
|
90
|
+
inset: t,
|
|
91
|
+
...a
|
|
92
|
+
}, d) => /* @__PURE__ */ o($, {
|
|
93
|
+
ref: d,
|
|
94
|
+
className: n("px-2 py-1.5 text-sm font-semibold text-foreground", t && "pl-32", e),
|
|
95
|
+
...a
|
|
96
|
+
}));
|
|
97
|
+
T.displayName = $.displayName;
|
|
98
|
+
const L = s.forwardRef(({
|
|
99
|
+
className: e,
|
|
100
|
+
...t
|
|
101
|
+
}, a) => /* @__PURE__ */ o(g, {
|
|
102
|
+
ref: a,
|
|
103
|
+
className: n("-mx-1 my-1 h-px bg-border", e),
|
|
104
|
+
...t
|
|
105
|
+
}));
|
|
106
|
+
L.displayName = g.displayName;
|
|
107
|
+
const P = ({
|
|
108
|
+
className: e,
|
|
109
|
+
...t
|
|
110
|
+
}) => /* @__PURE__ */ o("span", {
|
|
111
|
+
className: n("ml-auto text-xs tracking-widest text-muted-foreground", e),
|
|
112
|
+
...t
|
|
113
|
+
});
|
|
114
|
+
P.displayName = "ContextMenuShortcut";
|
|
115
|
+
export {
|
|
116
|
+
B as ContextMenu,
|
|
117
|
+
k as ContextMenuCheckboxItem,
|
|
118
|
+
z as ContextMenuContent,
|
|
119
|
+
H as ContextMenuGroup,
|
|
120
|
+
j as ContextMenuItem,
|
|
121
|
+
T as ContextMenuLabel,
|
|
122
|
+
J as ContextMenuPortal,
|
|
123
|
+
O as ContextMenuRadioGroup,
|
|
124
|
+
G as ContextMenuRadioItem,
|
|
125
|
+
L as ContextMenuSeparator,
|
|
126
|
+
P as ContextMenuShortcut,
|
|
127
|
+
K as ContextMenuSub,
|
|
128
|
+
S as ContextMenuSubContent,
|
|
129
|
+
I as ContextMenuSubTrigger,
|
|
130
|
+
E as ContextMenuTrigger
|
|
131
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React, FunctionComponent, Ref, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export interface ImagePreviewerProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
imageRef: Ref<HTMLImageElement>;
|
|
6
|
+
imageSrc: string;
|
|
7
|
+
imageSize: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface ImageDropProps<T> {
|
|
13
|
+
uploader: (file: File, img?: HTMLImageElement) => Promise<T>;
|
|
14
|
+
onDrop?: (events: React.DragEvent<Element>, file: File) => void;
|
|
15
|
+
onUploadFinish?: (result: T) => void;
|
|
16
|
+
waitTimeAfterFinish?: number;
|
|
17
|
+
defaultBgColor?: string;
|
|
18
|
+
dragOverBgColor?: string;
|
|
19
|
+
dropAreaStyle?: CSSProperties;
|
|
20
|
+
placeholder?: any;
|
|
21
|
+
className?: string;
|
|
22
|
+
ghost?: boolean;
|
|
23
|
+
children?: (props: ImagePreviewerProps) => ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const DropImage: FunctionComponent<ImageDropProps<any>>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import x from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
2
|
+
import { useState as O, useCallback as z, useEffect as A } from "react";
|
|
3
|
+
import { wait as D } from "./utils.mjs";
|
|
4
|
+
import { useDropImage as N } from "./useDropImage.mjs";
|
|
5
|
+
import { jsx as p, jsxs as C, Fragment as P } from "../_virtual/jsx-runtime.mjs";
|
|
6
|
+
const E = (t) => {
|
|
7
|
+
const {
|
|
8
|
+
visible: e,
|
|
9
|
+
imageRef: l,
|
|
10
|
+
imageSize: i,
|
|
11
|
+
imageSrc: c,
|
|
12
|
+
className: g
|
|
13
|
+
} = t;
|
|
14
|
+
return /* @__PURE__ */ p("img", {
|
|
15
|
+
className: x(g, "max-w-full", "h-auto", "duration-300", "transition-opacity", "opacity-100", {
|
|
16
|
+
"opacity-0": !e,
|
|
17
|
+
"m-0!": !e,
|
|
18
|
+
"p-0!": !e
|
|
19
|
+
}),
|
|
20
|
+
ref: l,
|
|
21
|
+
src: c,
|
|
22
|
+
width: i.width,
|
|
23
|
+
height: i.height
|
|
24
|
+
});
|
|
25
|
+
}, V = (t) => {
|
|
26
|
+
const {
|
|
27
|
+
onDrop: e = () => {
|
|
28
|
+
},
|
|
29
|
+
onUploadFinish: l = () => {
|
|
30
|
+
},
|
|
31
|
+
uploader: i,
|
|
32
|
+
waitTimeAfterFinish: c = 2e3,
|
|
33
|
+
className: g = "",
|
|
34
|
+
children: u,
|
|
35
|
+
placeholder: b
|
|
36
|
+
} = t, [o, m] = O(!1), [s, n] = O(!1), h = z(() => {
|
|
37
|
+
m(!0);
|
|
38
|
+
}, []), {
|
|
39
|
+
handleDragLeave: f,
|
|
40
|
+
handleDragOver: F,
|
|
41
|
+
handleDrop: y,
|
|
42
|
+
imageRef: v,
|
|
43
|
+
imageSize: d,
|
|
44
|
+
imageSrc: a,
|
|
45
|
+
reset: r
|
|
46
|
+
} = N({
|
|
47
|
+
onImageLoad: () => {
|
|
48
|
+
n(!0);
|
|
49
|
+
},
|
|
50
|
+
onDrop: async (S, w) => {
|
|
51
|
+
e(S, w), m(!1);
|
|
52
|
+
const L = await i(w);
|
|
53
|
+
await D(c), l(L), n(!1), r();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
A(() => (document.addEventListener("dragenter", h), () => {
|
|
57
|
+
document.removeEventListener("dragenter", h);
|
|
58
|
+
}), []);
|
|
59
|
+
const I = x("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
60
|
+
"lqip-blur": o,
|
|
61
|
+
"z-999": o,
|
|
62
|
+
block: o,
|
|
63
|
+
hidden: !o
|
|
64
|
+
});
|
|
65
|
+
return /* @__PURE__ */ C(P, {
|
|
66
|
+
children: [/* @__PURE__ */ p("div", {
|
|
67
|
+
className: I,
|
|
68
|
+
onDragLeave: () => {
|
|
69
|
+
f(), m(!1);
|
|
70
|
+
},
|
|
71
|
+
onDragOver: F,
|
|
72
|
+
onDrop: y
|
|
73
|
+
}), !s && b, u ? u({
|
|
74
|
+
visible: s,
|
|
75
|
+
imageRef: v,
|
|
76
|
+
imageSize: d,
|
|
77
|
+
imageSrc: a
|
|
78
|
+
}) : /* @__PURE__ */ p(E, {
|
|
79
|
+
className: g,
|
|
80
|
+
visible: s,
|
|
81
|
+
imageRef: v,
|
|
82
|
+
imageSrc: a,
|
|
83
|
+
imageSize: d
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
}, q = (t) => {
|
|
87
|
+
const {
|
|
88
|
+
uploader: e,
|
|
89
|
+
defaultBgColor: l = "#F3F4F6",
|
|
90
|
+
onDrop: i,
|
|
91
|
+
dragOverBgColor: c = "#EFF6FF",
|
|
92
|
+
waitTimeAfterFinish: g = 2e3,
|
|
93
|
+
placeholder: u = "",
|
|
94
|
+
className: b = "",
|
|
95
|
+
onUploadFinish: o = () => {
|
|
96
|
+
},
|
|
97
|
+
ghost: m,
|
|
98
|
+
children: s,
|
|
99
|
+
dropAreaStyle: n = {
|
|
100
|
+
width: 300,
|
|
101
|
+
height: 300
|
|
102
|
+
}
|
|
103
|
+
} = t;
|
|
104
|
+
if (m)
|
|
105
|
+
return /* @__PURE__ */ p(V, {
|
|
106
|
+
...t
|
|
107
|
+
});
|
|
108
|
+
const [h, f] = O(!1), {
|
|
109
|
+
handleDragLeave: F,
|
|
110
|
+
handleDragOver: y,
|
|
111
|
+
handleDrop: v,
|
|
112
|
+
imageRef: d,
|
|
113
|
+
imageSize: a,
|
|
114
|
+
imageSrc: r,
|
|
115
|
+
isDragOver: I,
|
|
116
|
+
reset: S
|
|
117
|
+
} = N({
|
|
118
|
+
onDrop: i,
|
|
119
|
+
onImageLoad: async (L, j) => {
|
|
120
|
+
await D(500), f(!0), await o(await e(j, L)), await D(g), f(!1), await D(500), S();
|
|
121
|
+
}
|
|
122
|
+
}), w = () => Object.assign({}, n, {
|
|
123
|
+
background: I ? c : l,
|
|
124
|
+
width: a.width || n.width,
|
|
125
|
+
height: a.height || n.height
|
|
126
|
+
});
|
|
127
|
+
return /* @__PURE__ */ C("div", {
|
|
128
|
+
className: x(b, "transition-all items-center justify-center flex duration-200 ease-in-out", {
|
|
129
|
+
"shadow-input": !r,
|
|
130
|
+
"shadow-empty": r
|
|
131
|
+
}),
|
|
132
|
+
onDragLeave: F,
|
|
133
|
+
onDragOver: y,
|
|
134
|
+
onDrop: v,
|
|
135
|
+
style: w(),
|
|
136
|
+
children: [s ? s({
|
|
137
|
+
visible: h,
|
|
138
|
+
imageRef: d,
|
|
139
|
+
imageSize: a,
|
|
140
|
+
imageSrc: r
|
|
141
|
+
}) : /* @__PURE__ */ p(E, {
|
|
142
|
+
visible: h,
|
|
143
|
+
imageRef: d,
|
|
144
|
+
imageSrc: r,
|
|
145
|
+
imageSize: a
|
|
146
|
+
}), !r && u]
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
export {
|
|
150
|
+
q as DropImage
|
|
151
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DragEvent, DragEventHandler } from 'react';
|
|
2
|
+
export declare const useDropImage: (params?: {
|
|
3
|
+
portraitImageWidth?: number | undefined;
|
|
4
|
+
landscapeImageWidth?: number | undefined;
|
|
5
|
+
onDrop?: ((e: DragEvent<Element>, file: File) => void) | undefined;
|
|
6
|
+
onImageLoad?: ((img: HTMLImageElement, file: File) => void) | undefined;
|
|
7
|
+
} | undefined) => {
|
|
8
|
+
isDragOver: boolean;
|
|
9
|
+
imageSrc: string;
|
|
10
|
+
imageRef: (input: HTMLImageElement) => void;
|
|
11
|
+
imageSize: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
handleDragOver: DragEventHandler<Element>;
|
|
16
|
+
handleDragLeave: () => void;
|
|
17
|
+
handleDrop: DragEventHandler<Element>;
|
|
18
|
+
reset: () => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useState as i, useRef as F, useCallback as s } from "react";
|
|
2
|
+
const H = (l) => {
|
|
3
|
+
const [f, a] = i(!1), [u, o] = i(""), [g, h] = i({ width: 0, height: 0 }), r = F(), {
|
|
4
|
+
portraitImageWidth: m = 384,
|
|
5
|
+
landscapeImageWidth: p = 500,
|
|
6
|
+
onDrop: D = () => {
|
|
7
|
+
},
|
|
8
|
+
onImageLoad: I = () => {
|
|
9
|
+
}
|
|
10
|
+
} = l || {}, w = () => {
|
|
11
|
+
o(""), h({ width: 0, height: 0 }), a(!1), r.current = null;
|
|
12
|
+
}, S = (e, t) => {
|
|
13
|
+
const { width: n, height: c } = e, O = n / c, T = n > c, d = t || (T ? p : m);
|
|
14
|
+
return {
|
|
15
|
+
width: d,
|
|
16
|
+
height: d / O
|
|
17
|
+
};
|
|
18
|
+
}, v = (e) => {
|
|
19
|
+
try {
|
|
20
|
+
o(URL.createObjectURL(e));
|
|
21
|
+
} catch {
|
|
22
|
+
o("");
|
|
23
|
+
}
|
|
24
|
+
}, y = s((e) => {
|
|
25
|
+
e.preventDefault(), a(!0), e.dataTransfer && (e.dataTransfer.dropEffect = "move");
|
|
26
|
+
}, []), L = s(() => {
|
|
27
|
+
a(!1);
|
|
28
|
+
}, []), R = s((e) => {
|
|
29
|
+
e.preventDefault(), a(!1);
|
|
30
|
+
const t = e.dataTransfer ? e.dataTransfer.files[0] : void 0;
|
|
31
|
+
!t || !t.type.startsWith("image") || (r.current = t, v(t), D(e, t));
|
|
32
|
+
}, []), W = (e) => {
|
|
33
|
+
const t = async () => {
|
|
34
|
+
const n = "decode" in e ? e.decode : Promise.resolve;
|
|
35
|
+
try {
|
|
36
|
+
await n();
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
h(
|
|
40
|
+
S({
|
|
41
|
+
width: e.naturalWidth,
|
|
42
|
+
height: e.naturalHeight
|
|
43
|
+
})
|
|
44
|
+
), r.current && I(e, r.current);
|
|
45
|
+
};
|
|
46
|
+
if (e.complete) {
|
|
47
|
+
t().then();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
e.onload = t;
|
|
51
|
+
}, z = s((e) => {
|
|
52
|
+
e && W(e);
|
|
53
|
+
}, []);
|
|
54
|
+
return {
|
|
55
|
+
isDragOver: f,
|
|
56
|
+
imageSrc: u,
|
|
57
|
+
imageRef: z,
|
|
58
|
+
imageSize: g,
|
|
59
|
+
handleDragOver: y,
|
|
60
|
+
handleDragLeave: L,
|
|
61
|
+
handleDrop: R,
|
|
62
|
+
reset: w
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
H as useDropImage
|
|
67
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface DropZoneProps {
|
|
3
|
+
onDrop: (files: File) => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const DropZone: (props: DropZoneProps) => JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useState as v, useCallback as m, useEffect as D } from "react";
|
|
2
|
+
import p from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
3
|
+
import { jsx as a, Fragment as l, jsxs as g } from "../_virtual/jsx-runtime.mjs";
|
|
4
|
+
const L = (n) => {
|
|
5
|
+
const {
|
|
6
|
+
onDrop: c,
|
|
7
|
+
children: o,
|
|
8
|
+
className: h,
|
|
9
|
+
style: b
|
|
10
|
+
} = n, [r, t] = v(!1), f = (e) => {
|
|
11
|
+
e.preventDefault(), t(!1);
|
|
12
|
+
const u = e.dataTransfer.files[0];
|
|
13
|
+
c(u);
|
|
14
|
+
}, s = m((e) => {
|
|
15
|
+
e.preventDefault(), t(!0);
|
|
16
|
+
}, []);
|
|
17
|
+
if (D(() => (document.addEventListener("dragenter", s), () => {
|
|
18
|
+
document.removeEventListener("dragenter", s);
|
|
19
|
+
}), []), n.disabled)
|
|
20
|
+
return /* @__PURE__ */ a(l, {
|
|
21
|
+
children: o
|
|
22
|
+
});
|
|
23
|
+
const d = (e) => {
|
|
24
|
+
e.preventDefault(), t(!0);
|
|
25
|
+
}, i = p("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
26
|
+
"text-blur": r,
|
|
27
|
+
"z-999": r,
|
|
28
|
+
block: r,
|
|
29
|
+
hidden: !r
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ g(l, {
|
|
32
|
+
children: [/* @__PURE__ */ a("div", {
|
|
33
|
+
className: i,
|
|
34
|
+
onDragLeave: () => {
|
|
35
|
+
t(!1);
|
|
36
|
+
},
|
|
37
|
+
onDragOver: d,
|
|
38
|
+
onDrop: f
|
|
39
|
+
}), o]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
L as DropZone
|
|
44
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { RandomRowsLayoutProps } from './RandomRowsLayout';
|
|
3
|
+
import { ImgProps } from './types';
|
|
4
|
+
export declare type ImageRenderer = (Img: ReactElement, index: number, col: number, randBool: boolean) => ReactNode;
|
|
5
|
+
export interface GalleryProps extends Omit<RandomRowsLayoutProps, "classNames" | "cellsCount" | "cellRenderer"> {
|
|
6
|
+
className?: string;
|
|
7
|
+
images: ImgProps[];
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
imageRenderer?: ImageRenderer;
|
|
10
|
+
}
|
|
11
|
+
export declare const Gallery: (props: GalleryProps) => JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import a from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
2
|
+
import { RandomRowsLayout as f } from "./RandomRowsLayout.mjs";
|
|
3
|
+
import { Img as x } from "./Img.mjs";
|
|
4
|
+
import { jsxs as g, jsx as n } from "../_virtual/jsx-runtime.mjs";
|
|
5
|
+
const p = (r, m, e) => /* @__PURE__ */ n("div", {
|
|
6
|
+
className: a("mb-128", {
|
|
7
|
+
"md:mr-64": e === 0,
|
|
8
|
+
"md:ml-64": e !== 0
|
|
9
|
+
}),
|
|
10
|
+
children: r
|
|
11
|
+
}), w = (r) => {
|
|
12
|
+
const {
|
|
13
|
+
images: m,
|
|
14
|
+
children: e,
|
|
15
|
+
imageRenderer: o = p,
|
|
16
|
+
className: c = "",
|
|
17
|
+
...i
|
|
18
|
+
} = r, d = (l, t, u) => {
|
|
19
|
+
const s = m[l];
|
|
20
|
+
return s ? o(/* @__PURE__ */ n(x, {
|
|
21
|
+
...s,
|
|
22
|
+
size: t ? "large" : "normal"
|
|
23
|
+
}), l, u, t) : null;
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ g("div", {
|
|
26
|
+
className: a("w-full flex justify-center", c),
|
|
27
|
+
children: [/* @__PURE__ */ n(f, {
|
|
28
|
+
classNames: "mx-32 mt-128 max-w-(--breakpoint-xl)",
|
|
29
|
+
cellsCount: m.length,
|
|
30
|
+
cellRenderer: d,
|
|
31
|
+
...i
|
|
32
|
+
}), e]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
w as Gallery
|
|
37
|
+
};
|
package/dist/img/Img.mjs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import t from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
2
|
+
import { useState as i } from "react";
|
|
3
|
+
import { ossProcessType as c } from "./types.mjs";
|
|
4
|
+
import { calcDefaultImgSize as P, addOssWebpProcessStyle as l } from "./utils.mjs";
|
|
5
|
+
import { jsxs as w, jsx as d } from "../_virtual/jsx-runtime.mjs";
|
|
6
|
+
const N = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", E = (a) => {
|
|
7
|
+
const {
|
|
8
|
+
src: r,
|
|
9
|
+
className: A,
|
|
10
|
+
renderedWidth: m,
|
|
11
|
+
avgColor: u,
|
|
12
|
+
thumbnailSrc: s,
|
|
13
|
+
processType: g,
|
|
14
|
+
size: p,
|
|
15
|
+
removeBlurBgAfterLoad: y
|
|
16
|
+
} = a, {
|
|
17
|
+
width: f,
|
|
18
|
+
height: b
|
|
19
|
+
} = P(a, m, p === "normal" ? 0.6 : 1), [h, B] = i(!1), [o, I] = i(!1), S = {
|
|
20
|
+
width: "initial",
|
|
21
|
+
height: "initial",
|
|
22
|
+
backgroundSize: "cover",
|
|
23
|
+
backgroundColor: u || "#f1f1f1",
|
|
24
|
+
backgroundPosition: "0% 0%",
|
|
25
|
+
backgroundImage: `url(${s || l(r, c.THUMBNAIL)})`
|
|
26
|
+
}, k = h && y ? {
|
|
27
|
+
backgroundImage: "none"
|
|
28
|
+
} : {}, v = (e) => {
|
|
29
|
+
const n = async () => {
|
|
30
|
+
const L = "decode" in e ? e.decode : Promise.resolve;
|
|
31
|
+
try {
|
|
32
|
+
await L();
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
I(!0), B(!0);
|
|
36
|
+
};
|
|
37
|
+
if (e.complete) {
|
|
38
|
+
n().then();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
e.onload = n;
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ w("span", {
|
|
44
|
+
className: t(A, "inline-block", "relative", "overflow-hidden", "duration-500", "leading-none", "align-bottom", "border-0"),
|
|
45
|
+
draggable: !1,
|
|
46
|
+
style: Object.assign({}, S, k),
|
|
47
|
+
children: [/* @__PURE__ */ d("img", {
|
|
48
|
+
ref: (e) => {
|
|
49
|
+
e && v(e);
|
|
50
|
+
},
|
|
51
|
+
width: f,
|
|
52
|
+
height: b,
|
|
53
|
+
src: l(r, g || c.WEBP),
|
|
54
|
+
decoding: "async",
|
|
55
|
+
loading: "lazy",
|
|
56
|
+
crossOrigin: "anonymous",
|
|
57
|
+
style: {
|
|
58
|
+
contentVisibility: "auto"
|
|
59
|
+
},
|
|
60
|
+
className: t("transition-opacity", "opacity-100", "duration-500", {
|
|
61
|
+
"opacity-0": !o
|
|
62
|
+
})
|
|
63
|
+
}), /* @__PURE__ */ d("img", {
|
|
64
|
+
src: N,
|
|
65
|
+
className: t("lqip-blur", "absolute", "h-full", "w-full", "duration-500", "transition-opacity", {
|
|
66
|
+
"opacity-100": !o,
|
|
67
|
+
"opacity-0": o
|
|
68
|
+
}),
|
|
69
|
+
crossOrigin: "anonymous",
|
|
70
|
+
style: {
|
|
71
|
+
top: 0,
|
|
72
|
+
left: 0
|
|
73
|
+
}
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
E as Img,
|
|
79
|
+
c as ossProcessType
|
|
80
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const generateRandomBoolean: (p?: number) => boolean;
|
|
3
|
+
export interface RandomRowsLayoutProps {
|
|
4
|
+
classNames?: string;
|
|
5
|
+
cellWrapperClsGenerator?: (colNum: number, randBoolean: boolean) => string;
|
|
6
|
+
cellsCount: number;
|
|
7
|
+
cellRenderer: (index: number, randomBool: boolean, col: number) => React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const RandomRowsLayout: React.MemoExoticComponent<(props: RandomRowsLayoutProps) => JSX.Element>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import p from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { jsx as c } from "../_virtual/jsx-runtime.mjs";
|
|
4
|
+
const x = (e) => e.length < 2 ? e[0] : e[e.length - 1], N = (e, n) => `md:basis-${e === 1 ? n ? "full" : "1/2" : "1/2"}`, i = (e = 0.5) => Math.random() < e, R = (e) => {
|
|
5
|
+
const n = [];
|
|
6
|
+
if (e <= 2)
|
|
7
|
+
return [e];
|
|
8
|
+
let l = 0;
|
|
9
|
+
for (; l < e; ) {
|
|
10
|
+
const t = x(n) === 2 ? 0.9 : 0.5, s = i(t) ? 1 : 2;
|
|
11
|
+
n.push(s), l += s;
|
|
12
|
+
}
|
|
13
|
+
return n;
|
|
14
|
+
}, W = (e, n) => {
|
|
15
|
+
let l = 0;
|
|
16
|
+
for (let t = 0; t < n; t++)
|
|
17
|
+
l += e[t];
|
|
18
|
+
return l;
|
|
19
|
+
}, A = g.memo((e) => {
|
|
20
|
+
const {
|
|
21
|
+
cellsCount: n,
|
|
22
|
+
cellRenderer: l,
|
|
23
|
+
classNames: t = "",
|
|
24
|
+
cellWrapperClsGenerator: s = N
|
|
25
|
+
} = e, a = R(n);
|
|
26
|
+
return /* @__PURE__ */ c("div", {
|
|
27
|
+
className: t,
|
|
28
|
+
children: a.map((o, u) => {
|
|
29
|
+
const m = i(
|
|
30
|
+
o < 2 ? 0.6 : 0.5
|
|
31
|
+
/* 增加单列大图概率 */
|
|
32
|
+
), d = [m, !m];
|
|
33
|
+
return /* @__PURE__ */ c("div", {
|
|
34
|
+
className: "flex items-center flex-wrap",
|
|
35
|
+
children: new Array(o).fill(null).map((w, r) => {
|
|
36
|
+
const f = s(o, i()), h = W(a, u) + r, C = p("flex items-center justify-center shrink-0 grow-0", "basis-full", f);
|
|
37
|
+
return /* @__PURE__ */ c("div", {
|
|
38
|
+
className: C,
|
|
39
|
+
children: l(h, d[r], r)
|
|
40
|
+
}, r);
|
|
41
|
+
})
|
|
42
|
+
}, u);
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}, (e, n) => e.cellsCount === n.cellsCount);
|
|
46
|
+
export {
|
|
47
|
+
A as RandomRowsLayout,
|
|
48
|
+
i as generateRandomBoolean
|
|
49
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum ossProcessType {
|
|
2
|
+
THUMBNAIL = "thumbnail",
|
|
3
|
+
WEBP = "webp",
|
|
4
|
+
NULL = "null",
|
|
5
|
+
oWEBP = "owebp",
|
|
6
|
+
PROG = "prog"
|
|
7
|
+
}
|
|
8
|
+
export interface Photo {
|
|
9
|
+
src: string;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
processType?: ossProcessType;
|
|
13
|
+
avgColor?: string;
|
|
14
|
+
thumbnailSrc?: string;
|
|
15
|
+
renderedWidth?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ImgProps extends Photo {
|
|
18
|
+
className?: string;
|
|
19
|
+
size?: "large" | "normal";
|
|
20
|
+
removeBlurBgAfterLoad?: boolean;
|
|
21
|
+
}
|