@fileverse/ui 5.1.9 → 5.1.10

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.
@@ -359,15 +359,9 @@ export declare const DrawerTrigger: React_2.ForwardRefExoticComponent<DialogPrim
359
359
  * forwards its `ref` and spreads props onto the underlying Radix primitive, so
360
360
  * any Radix prop works without extra wiring.
361
361
  *
362
- * Parts: {@link DropdownMenuTrigger}, {@link DropdownMenuContent},
363
- * {@link DropdownMenuItem}, {@link DropdownMenuCheckboxItem},
364
- * {@link DropdownMenuRadioGroup}/{@link DropdownMenuRadioItem},
365
- * {@link DropdownMenuLabel}, {@link DropdownMenuSeparator},
366
- * {@link DropdownMenuShortcut}, {@link DropdownMenuGroup},
367
- * {@link DropdownMenuSub}/{@link DropdownMenuSubTrigger}/{@link DropdownMenuSubContent},
368
- * {@link DropdownMenuPortal}, {@link DropdownMenuArrow}.
362
+ * @example
369
363
  *
370
- * @example Basic menu
364
+ * Basic menu
371
365
  * ```tsx
372
366
  * <DropdownMenu>
373
367
  * <DropdownMenuTrigger asChild>
@@ -384,7 +378,9 @@ export declare const DrawerTrigger: React_2.ForwardRefExoticComponent<DialogPrim
384
378
  * </DropdownMenu>
385
379
  * ```
386
380
  *
387
- * @example Checkbox items, a radio group, and a nested sub-menu
381
+ * @example
382
+ *
383
+ * Checkbox items, a radio group, and a nested sub-menu
388
384
  * ```tsx
389
385
  * <DropdownMenuContent>
390
386
  * <DropdownMenuCheckboxItem checked={show} onCheckedChange={setShow}>
@@ -1088,7 +1084,12 @@ declare type ThemeProviderProps = {
1088
1084
  defaultTheme?: Theme;
1089
1085
  };
1090
1086
 
1091
- export declare const ThemeToggle: () => JSX_2.Element;
1087
+ export declare const ThemeToggle: ({ defaultOpen }?: ThemeToggleProps) => JSX_2.Element;
1088
+
1089
+ declare interface ThemeToggleProps {
1090
+ /** Opens the "More themes" dropdown on first mount (uncontrolled). */
1091
+ defaultOpen?: boolean;
1092
+ }
1092
1093
 
1093
1094
  export declare const TimePeriodSelect: React_2.ForwardRefExoticComponent<PeriodSelectorProps & React_2.RefAttributes<HTMLButtonElement>>;
1094
1095
 
package/dist/index.es.js CHANGED
@@ -67165,21 +67165,21 @@ const vIe = ({
67165
67165
  disabled: !0,
67166
67166
  comingSoon: !0
67167
67167
  }
67168
- ], kIe = () => {
67169
- const { theme: e, setTheme: t } = jLe(), [n, a] = le(!1);
67168
+ ], kIe = ({ defaultOpen: e = !1 } = {}) => {
67169
+ const { theme: t, setTheme: n } = jLe(), [a, o] = le(e);
67170
67170
  return /* @__PURE__ */ d.jsxs("div", { className: "h-9 px-[3px] rounded outline outline-1 outline-offset-[-1px] outline-[hsl(var(--color-border-default))] inline-flex justify-start items-center", children: [
67171
67171
  /* @__PURE__ */ d.jsx(
67172
67172
  "button",
67173
67173
  {
67174
- onClick: () => t("light"),
67175
- className: `w-7 h-7 max-h-7 min-h-7 p-1.5 rounded flex justify-center items-center transition-all ${e === "light" ? "bg-black/5" : ""}`,
67174
+ onClick: () => n("light"),
67175
+ className: `w-7 h-7 max-h-7 min-h-7 p-1.5 rounded flex justify-center items-center transition-all ${t === "light" ? "bg-black/5" : ""}`,
67176
67176
  "aria-label": "Light mode",
67177
67177
  children: /* @__PURE__ */ d.jsx(
67178
67178
  ye,
67179
67179
  {
67180
67180
  name: "Sun",
67181
67181
  size: "sm",
67182
- className: e === "light" ? "color-text-default" : "color-icon-secondary"
67182
+ className: t === "light" ? "color-text-default" : "color-icon-secondary"
67183
67183
  }
67184
67184
  )
67185
67185
  }
@@ -67187,20 +67187,20 @@ const vIe = ({
67187
67187
  /* @__PURE__ */ d.jsx(
67188
67188
  "button",
67189
67189
  {
67190
- onClick: () => t("dark"),
67191
- className: `w-7 h-7 max-h-7 min-h-7 p-1.5 rounded flex justify-center items-center transition-all ${e === "dark" ? "bg-black/5" : ""}`,
67190
+ onClick: () => n("dark"),
67191
+ className: `w-7 h-7 max-h-7 min-h-7 p-1.5 rounded flex justify-center items-center transition-all ${t === "dark" ? "bg-black/5" : ""}`,
67192
67192
  "aria-label": "Dark mode",
67193
67193
  children: /* @__PURE__ */ d.jsx(
67194
67194
  ye,
67195
67195
  {
67196
67196
  name: "Moon",
67197
67197
  size: "sm",
67198
- className: e === "dark" ? "color-text-default" : "color-icon-secondary"
67198
+ className: t === "dark" ? "color-text-default" : "color-icon-secondary"
67199
67199
  }
67200
67200
  )
67201
67201
  }
67202
67202
  ),
67203
- /* @__PURE__ */ d.jsxs(F2, { open: n, onOpenChange: a, children: [
67203
+ /* @__PURE__ */ d.jsxs(F2, { open: a, onOpenChange: o, children: [
67204
67204
  /* @__PURE__ */ d.jsx($2, { asChild: !0, children: /* @__PURE__ */ d.jsx(
67205
67205
  "button",
67206
67206
  {
@@ -67227,22 +67227,22 @@ const vIe = ({
67227
67227
  /* @__PURE__ */ d.jsx("span", { className: "text-heading-xsm color-text-default", children: "Themes" }),
67228
67228
  /* @__PURE__ */ d.jsx(fxe, { asChild: !0, children: /* @__PURE__ */ d.jsx("button", { className: "p-1 rounded hover:color-bg-default-hover transition-colors", children: /* @__PURE__ */ d.jsx(ye, { name: "X", size: "sm" }) }) })
67229
67229
  ] }),
67230
- /* @__PURE__ */ d.jsx("div", { className: "grid grid-cols-2 gap-2", children: LLe.map((o, r) => {
67231
- const i = e === o.value && !o.disabled;
67230
+ /* @__PURE__ */ d.jsx("div", { className: "grid grid-cols-2 gap-2", children: LLe.map((r, i) => {
67231
+ const c = t === r.value && !r.disabled;
67232
67232
  return /* @__PURE__ */ d.jsxs(
67233
67233
  "button",
67234
67234
  {
67235
- onClick: o.disabled ? void 0 : () => t(o.value),
67236
- disabled: o.disabled,
67237
- className: `flex flex-col items-center gap-1 p-1.5 rounded-lg transition-all ${o.disabled ? "cursor-not-allowed" : "cursor-pointer hover:color-bg-default-hover"}`,
67235
+ onClick: r.disabled ? void 0 : () => n(r.value),
67236
+ disabled: r.disabled,
67237
+ className: `flex flex-col items-center gap-1 p-1.5 rounded-lg transition-all ${r.disabled ? "cursor-not-allowed" : "cursor-pointer hover:color-bg-default-hover"}`,
67238
67238
  children: [
67239
67239
  /* @__PURE__ */ d.jsxs(
67240
67240
  "div",
67241
67241
  {
67242
67242
  className: "relative w-full h-14 rounded-xl transition-all flex items-center justify-center border border-black/10 shadow-sm",
67243
- style: { backgroundColor: o.color },
67243
+ style: { backgroundColor: r.color },
67244
67244
  children: [
67245
- i && /* @__PURE__ */ d.jsx("div", { className: "w-5 h-5 rounded-full color-bg-default-inverse flex items-center justify-center", children: /* @__PURE__ */ d.jsx(
67245
+ c && /* @__PURE__ */ d.jsx("div", { className: "w-5 h-5 rounded-full color-bg-default-inverse flex items-center justify-center", children: /* @__PURE__ */ d.jsx(
67246
67246
  ye,
67247
67247
  {
67248
67248
  name: "Check",
@@ -67250,14 +67250,14 @@ const vIe = ({
67250
67250
  className: "text-[hsl(var(--color-bg-default))] w-3 h-3"
67251
67251
  }
67252
67252
  ) }),
67253
- o.comingSoon && /* @__PURE__ */ d.jsx("span", { className: "absolute bottom-1 text-[9px] font-medium text-white/60 tracking-wide", children: "Coming soon" })
67253
+ r.comingSoon && /* @__PURE__ */ d.jsx("span", { className: "absolute bottom-1 text-[9px] font-medium text-white/60 tracking-wide", children: "Coming soon" })
67254
67254
  ]
67255
67255
  }
67256
67256
  ),
67257
- /* @__PURE__ */ d.jsx("span", { className: "text-helper-text-sm color-text-default whitespace-nowrap", children: o.label })
67257
+ /* @__PURE__ */ d.jsx("span", { className: "text-helper-text-sm color-text-default whitespace-nowrap", children: r.label })
67258
67258
  ]
67259
67259
  },
67260
- `${o.value}-${r}`
67260
+ `${r.value}-${i}`
67261
67261
  );
67262
67262
  }) })
67263
67263
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse/ui",
3
- "version": "5.1.9",
3
+ "version": "5.1.10",
4
4
  "files": [
5
5
  "/dist"
6
6
  ],