reykit 1.0.211 → 1.0.213

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
@@ -27549,7 +27549,7 @@ function _0() {
27549
27549
  }, []), i;
27550
27550
  }
27551
27551
  function PC(a, i) {
27552
- return _0() ? i : a;
27552
+ return _0() ? a : i;
27553
27553
  }
27554
27554
  function T6(a, ...i) {
27555
27555
  wE(
@@ -49141,7 +49141,7 @@ function K4({
49141
49141
  {
49142
49142
  src: a,
49143
49143
  loading: "lazy",
49144
- className: "size-full"
49144
+ className: "size-full object-cover"
49145
49145
  }
49146
49146
  ),
49147
49147
  ...i,
@@ -49178,7 +49178,7 @@ function $4({
49178
49178
  src: a,
49179
49179
  preload: "metadata",
49180
49180
  playsInline: !0,
49181
- className: "size-full"
49181
+ className: "size-full object-cover"
49182
49182
  }
49183
49183
  ),
49184
49184
  ...i,
@@ -49207,23 +49207,30 @@ function $4({
49207
49207
  function vk({
49208
49208
  data: a,
49209
49209
  orientation: i = "auto",
49210
- showCount: u = !0,
49211
- language: d = "en"
49210
+ showNum: u = 1,
49211
+ showCount: d = !0,
49212
+ language: m = "en"
49212
49213
  }) {
49213
49214
  i === "auto" && (i = PC(
49214
- "horizontal",
49215
- "vertical"
49215
+ "vertical",
49216
+ "horizontal"
49216
49217
  ));
49217
- const [m, g] = Zo(1), [v, b] = Zo(), C = Dj(!1);
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);
49218
49225
  return wE(() => {
49219
- if (!v) return;
49220
- const T = () => {
49221
- g(v.selectedScrollSnap() + 1);
49226
+ if (!C) return;
49227
+ const N = () => {
49228
+ b(C.selectedScrollSnap() + 1);
49222
49229
  };
49223
- return T(), v.on("select", T), () => {
49224
- v.off("select", T);
49230
+ return N(), C.on("select", N), () => {
49231
+ C.off("select", N);
49225
49232
  };
49226
- }, [v]), /* @__PURE__ */ x.jsxs("div", { className: "flex flex-col place-items-center gap-4", children: [
49233
+ }, [C]), /* @__PURE__ */ x.jsxs("div", { className: "flex flex-col place-items-center gap-4 size-full", children: [
49227
49234
  /* @__PURE__ */ x.jsxs(
49228
49235
  O_,
49229
49236
  {
@@ -49231,32 +49238,39 @@ function vk({
49231
49238
  align: "center",
49232
49239
  loop: !0
49233
49240
  },
49234
- setApi: b,
49235
- onWheel: (T) => {
49236
- C.current || (C.current = !0, T.deltaY > 0 ? v?.scrollNext() : v?.scrollPrev(), setTimeout(() => {
49237
- C.current = !1;
49241
+ setApi: T,
49242
+ onWheel: (N) => {
49243
+ R.current || (R.current = !0, N.deltaY > 0 ? C?.scrollNext() : C?.scrollPrev(), setTimeout(() => {
49244
+ R.current = !1;
49238
49245
  }, 300));
49239
49246
  },
49240
49247
  orientation: i,
49241
- className: "w-3/4",
49248
+ className: ie(
49249
+ "size-full",
49250
+ '[&_[data-slot="carousel-content"]]:absolute',
49251
+ '[&_[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'
49254
+ ),
49242
49255
  children: [
49243
49256
  /* @__PURE__ */ x.jsx(A_, { size: "icon" }),
49244
- /* @__PURE__ */ x.jsx(N_, { className: "place-items-center m-1 md:m-2 max-h-[70vh]", children: a.map(({ type: T, path: R }, N) => /* @__PURE__ */ x.jsx(
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(
49245
49258
  M_,
49246
49259
  {
49247
49260
  className: ie(
49248
- "basis-1/2 h-[50vh] overflow-hidden border max-h-[50vh] place-items-center flex p-0 rounded-2xl shadow-md",
49249
- "my-1 md:mx-2"
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"
49250
49264
  ),
49251
- children: T === "image" ? /* @__PURE__ */ x.jsx(K4, { path: R }) : T === "video" ? /* @__PURE__ */ x.jsx($4, { path: R }) : void 0
49265
+ children: N === "image" ? /* @__PURE__ */ x.jsx(K4, { path: A }) : N === "video" ? /* @__PURE__ */ x.jsx($4, { path: A }) : null
49252
49266
  },
49253
- N
49267
+ M
49254
49268
  )) }),
49255
49269
  /* @__PURE__ */ x.jsx(D_, { size: "icon" })
49256
49270
  ]
49257
49271
  }
49258
49272
  ),
49259
- /* @__PURE__ */ x.jsx("div", { className: "flex-1 text-sm text-muted-foreground hidden md:flex", children: { en: `${m} / ${a.length} item(s)`, zh: `第 ${m} / ${a.length} 个` }[d] })
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] })
49260
49274
  ] });
49261
49275
  }
49262
49276
  function yk({
@@ -49356,7 +49370,7 @@ function Sk({
49356
49370
  mobilePageSize: C = 10,
49357
49371
  language: T = "en"
49358
49372
  }) {
49359
- const R = PC(b, C), [N, A] = Zo(R), [M, O] = Zo(1);
49373
+ const R = PC(C, b), [N, A] = Zo(R), [M, O] = Zo(1);
49360
49374
  u || (u = Array.from(
49361
49375
  new Set(
49362
49376
  a.flatMap((ne) => Object.keys(ne))
@@ -50147,7 +50161,7 @@ function Ok({
50147
50161
  {
50148
50162
  className: ie(
50149
50163
  "grid place-content-center size-full transition group-data-[open=false]:opacity-0 absolute",
50150
- m ? "group-data-[open=false]:-rotate-90" : void 0
50164
+ m ? "group-data-[open=false]:-rotate-90" : null
50151
50165
  ),
50152
50166
  children: a
50153
50167
  }
@@ -50157,7 +50171,7 @@ function Ok({
50157
50171
  {
50158
50172
  className: ie(
50159
50173
  "grid place-content-center size-full transition group-data-[open=true]:opacity-0 absolute",
50160
- m ? "group-data-[open=true]:rotate-90" : void 0
50174
+ m ? "group-data-[open=true]:rotate-90" : null
50161
50175
  ),
50162
50176
  children: i
50163
50177
  }
@@ -22,14 +22,17 @@ export declare function PopupVideo({ path, ...args }: {
22
22
  * @param data - Media data.
23
23
  * @param orientation - Carousel orientation.
24
24
  * - `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.
25
27
  * @param language - Language type.
26
28
  */
27
- export declare function CarouselMedia({ data, orientation, showCount, language }: {
29
+ export declare function CarouselMedia({ data, orientation, showNum, showCount, language }: {
28
30
  data: {
29
31
  type: 'image' | 'video';
30
32
  path: string;
31
33
  }[];
32
34
  orientation?: 'auto' | 'horizontal' | 'vertical';
35
+ showNum?: 1 | 2 | 3 | 4 | 5;
33
36
  showCount?: boolean;
34
37
  language?: 'en' | 'zh';
35
38
  }): import("react/jsx-runtime").JSX.Element;
@@ -46,11 +46,11 @@ export declare function useIsMobile(): boolean;
46
46
  /**
47
47
  * Get value by client type.
48
48
  *
49
- * @param value - Value of non mobile client.
50
49
  * @param mobileValue - Value of mobile client.
50
+ * @param value - Value of non mobile client.
51
51
  * @returns Value.
52
52
  */
53
- export declare function useValueByMobile<Value, MobileValue>(value: Value, mobileValue: MobileValue): Value | MobileValue;
53
+ export declare function useValueByMobile<Value, MobileValue>(mobileValue: MobileValue, value: Value): Value | MobileValue;
54
54
  /**
55
55
  * Execute once after rendering.
56
56
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.211",
3
+ "version": "1.0.213",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [