reykit 1.0.213 → 1.0.215

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/index.js CHANGED
@@ -49129,7 +49129,8 @@ const [hk, gk] = Z4(
49129
49129
  );
49130
49130
  function K4({
49131
49131
  path: a,
49132
- ...i
49132
+ loading: i,
49133
+ ...u
49133
49134
  }) {
49134
49135
  return /* @__PURE__ */ x.jsxs(pR, { children: [
49135
49136
  /* @__PURE__ */ x.jsx(
@@ -49140,11 +49141,11 @@ function K4({
49140
49141
  "img",
49141
49142
  {
49142
49143
  src: a,
49143
- loading: "lazy",
49144
+ loading: i,
49144
49145
  className: "size-full object-cover"
49145
49146
  }
49146
49147
  ),
49147
- ...i,
49148
+ ...u,
49148
49149
  nativeButton: !1
49149
49150
  }
49150
49151
  ),
@@ -49165,7 +49166,8 @@ function K4({
49165
49166
  }
49166
49167
  function $4({
49167
49168
  path: a,
49168
- ...i
49169
+ preload: i,
49170
+ ...u
49169
49171
  }) {
49170
49172
  return /* @__PURE__ */ x.jsxs(pR, { children: [
49171
49173
  /* @__PURE__ */ x.jsx(
@@ -49176,12 +49178,12 @@ function $4({
49176
49178
  "video",
49177
49179
  {
49178
49180
  src: a,
49179
- preload: "metadata",
49181
+ preload: i,
49180
49182
  playsInline: !0,
49181
49183
  className: "size-full object-cover"
49182
49184
  }
49183
49185
  ),
49184
- ...i,
49186
+ ...u,
49185
49187
  nativeButton: !1
49186
49188
  }
49187
49189
  ),
@@ -49207,41 +49209,46 @@ function $4({
49207
49209
  function vk({
49208
49210
  data: a,
49209
49211
  orientation: i = "auto",
49210
- showNum: u = 1,
49211
- showCount: d = !0,
49212
- language: m = "en"
49212
+ width: u = 2,
49213
+ showButton: d = !0,
49214
+ showControl: m = !0,
49215
+ language: g = "en"
49213
49216
  }) {
49214
49217
  i === "auto" && (i = PC(
49215
49218
  "vertical",
49216
49219
  "horizontal"
49217
49220
  ));
49218
- const g = {
49219
- 1: "basis-1/2",
49220
- 2: "basis-1/3",
49221
- 3: "basis-1/4",
49222
- 4: "basis-1/5",
49223
- 5: "basis-1/6"
49224
- }[u], [v, b] = Zo(1), [C, T] = Zo(), R = Dj(!1);
49221
+ const [v, b] = {
49222
+ 1: ["basis-1/1", 2],
49223
+ 2: ["basis-1/2", 3],
49224
+ 3: ["basis-1/3", 3],
49225
+ 4: ["basis-1/4", 4],
49226
+ 5: ["basis-1/5", 4],
49227
+ 6: ["basis-1/6", 5]
49228
+ }[u], [C, T] = Zo(1), [R, N] = Zo(), A = Dj(!1), M = /* @__PURE__ */ x.jsx("div", { className: "flex-1 text-sm md:text-base text-muted-foreground flex absolute max-md:-top-8 md:-bottom-8", children: { en: `${C} / ${a.length} item(s)`, zh: `第 ${C} / ${a.length} 个` }[g] });
49225
49229
  return wE(() => {
49226
- if (!C) return;
49227
- const N = () => {
49228
- b(C.selectedScrollSnap() + 1);
49230
+ if (!R) return;
49231
+ const O = () => {
49232
+ T(R.selectedScrollSnap() + 1);
49229
49233
  };
49230
- return N(), C.on("select", N), () => {
49231
- C.off("select", N);
49234
+ return O(), R.on("select", O), () => {
49235
+ R.off("select", O);
49232
49236
  };
49233
- }, [C]), /* @__PURE__ */ x.jsxs("div", { className: "flex flex-col place-items-center gap-4 size-full", children: [
49237
+ }, [R]), /* @__PURE__ */ x.jsxs("div", { className: "relative flex flex-col place-items-center gap-4 size-full", children: [
49238
+ m && i == "vertical" && M,
49234
49239
  /* @__PURE__ */ x.jsxs(
49235
49240
  O_,
49236
49241
  {
49237
49242
  opts: {
49238
49243
  align: "center",
49239
- loop: !0
49244
+ loop: !0,
49245
+ skipSnaps: !0,
49246
+ duration: 25
49240
49247
  },
49241
- setApi: T,
49242
- onWheel: (N) => {
49243
- R.current || (R.current = !0, N.deltaY > 0 ? C?.scrollNext() : C?.scrollPrev(), setTimeout(() => {
49244
- R.current = !1;
49248
+ setApi: N,
49249
+ onWheel: (O) => {
49250
+ A.current || (A.current = !0, O.deltaY > 0 ? R?.scrollNext() : R?.scrollPrev(), setTimeout(() => {
49251
+ A.current = !1;
49245
49252
  }, 300));
49246
49253
  },
49247
49254
  orientation: i,
@@ -49249,28 +49256,35 @@ function vk({
49249
49256
  "size-full",
49250
49257
  '[&_[data-slot="carousel-content"]]:absolute',
49251
49258
  '[&_[data-slot="carousel-content"]]:inset-0',
49252
- 'md:[&_[data-slot="carousel-content"]>div]:h-full',
49253
- 'min-md:[&_[data-slot="carousel-content"]>div]:w-full'
49259
+ '[&_[data-slot="carousel-content"]>div]:size-full'
49254
49260
  ),
49255
49261
  children: [
49256
- /* @__PURE__ */ x.jsx(A_, { size: "icon" }),
49257
- /* @__PURE__ */ x.jsx(N_, { className: "place-items-center m-1 md:m-2 max-h-1/1", children: a.map(({ type: N, path: A }, M) => /* @__PURE__ */ x.jsx(
49258
- M_,
49259
- {
49260
- className: ie(
49261
- g,
49262
- "overflow-hidden border md:h-[90%] md:max-h-[90%]",
49263
- "place-items-center flex p-0 rounded-2xl shadow-md my-1 md:mx-2"
49264
- ),
49265
- children: N === "image" ? /* @__PURE__ */ x.jsx(K4, { path: A }) : N === "video" ? /* @__PURE__ */ x.jsx($4, { path: A }) : null
49266
- },
49267
- M
49268
- )) }),
49269
- /* @__PURE__ */ x.jsx(D_, { size: "icon" })
49262
+ /* @__PURE__ */ x.jsx(N_, { className: "place-items-center m-1 md:m-2 size-full", children: a.map(({ type: O, path: z }, D) => {
49263
+ const U = Math.abs(D - C + 1);
49264
+ return /* @__PURE__ */ x.jsx(
49265
+ M_,
49266
+ {
49267
+ className: ie(
49268
+ v,
49269
+ "overflow-hidden border md:h-[90%] md:max-h-[95%] max-md:w-[90%] max-md:max-w-[95%]",
49270
+ "place-items-center flex p-0 rounded-2xl shadow-md my-1 md:mx-2"
49271
+ ),
49272
+ children: Math.min(
49273
+ U,
49274
+ a.length - U
49275
+ ) > b ? null : O === "image" ? /* @__PURE__ */ x.jsx(K4, { path: z }) : O === "video" ? /* @__PURE__ */ x.jsx($4, { path: z }) : null
49276
+ },
49277
+ D
49278
+ );
49279
+ }) }),
49280
+ d && /* @__PURE__ */ x.jsxs(x.Fragment, { children: [
49281
+ /* @__PURE__ */ x.jsx(A_, { size: "icon", className: "max-md:top-auto max-md:-bottom-12 max-md:left-1/3" }),
49282
+ /* @__PURE__ */ x.jsx(D_, { size: "icon", className: "max-md:-bottom-12 max-md:left-2/3" })
49283
+ ] })
49270
49284
  ]
49271
49285
  }
49272
49286
  ),
49273
- d && /* @__PURE__ */ x.jsx("div", { className: "flex-1 text-sm text-muted-foreground hidden md:flex", children: { en: `${v} / ${a.length} item(s)`, zh: `第 ${v} / ${a.length} 个` }[m] })
49287
+ m && i == "horizontal" && M
49274
49288
  ] });
49275
49289
  }
49276
49290
  function yk({
@@ -4,17 +4,21 @@ import * as ui from './ui';
4
4
  * Media component of pop up show image.
5
5
  *
6
6
  * @param path - Image path.
7
+ * @param loading - Loading scheme.
7
8
  */
8
- export declare function PopupImage({ path, ...args }: {
9
+ export declare function PopupImage({ path, loading, ...args }: {
9
10
  path: string;
11
+ loading?: 'eager' | 'lazy';
10
12
  } & ComponentProps<typeof ui.DialogTrigger>): import("react/jsx-runtime").JSX.Element;
11
13
  /**
12
14
  * Media component of pop up show video.
13
15
  *
14
16
  * @param path - Video path.
17
+ * @param preload - Preload scheme.
15
18
  */
16
- export declare function PopupVideo({ path, ...args }: {
19
+ export declare function PopupVideo({ path, preload, ...args }: {
17
20
  path: string;
21
+ preload?: 'metadata' | 'aotu' | 'none';
18
22
  } & ComponentProps<typeof ui.DialogTrigger>): import("react/jsx-runtime").JSX.Element;
19
23
  /**
20
24
  * Media component of carousel show image or video.
@@ -22,17 +26,19 @@ export declare function PopupVideo({ path, ...args }: {
22
26
  * @param data - Media data.
23
27
  * @param orientation - Carousel orientation.
24
28
  * - `auto` : Automatic set, when is mobile, then is `vertical`, otherwise is `horizontal`.
25
- * @param showNum - Show content number.
26
- * @param showCount - Whether show count text on non mobile client.
29
+ * @param width - Show content width.
30
+ * @param showButton - Whether show button.
31
+ * @param showControl - Whether show controls.
27
32
  * @param language - Language type.
28
33
  */
29
- export declare function CarouselMedia({ data, orientation, showNum, showCount, language }: {
34
+ export declare function CarouselMedia({ data, orientation, width, showButton, showControl, language }: {
30
35
  data: {
31
36
  type: 'image' | 'video';
32
37
  path: string;
33
38
  }[];
34
39
  orientation?: 'auto' | 'horizontal' | 'vertical';
35
- showNum?: 1 | 2 | 3 | 4 | 5;
36
- showCount?: boolean;
40
+ width?: 1 | 2 | 3 | 4 | 5 | 6;
41
+ showButton?: boolean;
42
+ showControl?: boolean;
37
43
  language?: 'en' | 'zh';
38
44
  }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.213",
3
+ "version": "1.0.215",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [