@camox/ui 0.68.0 → 0.69.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.
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority";
2
2
  import { useRender } from "@base-ui/react/use-render";
3
3
  //#region src/components/badge.d.ts
4
4
  declare const badgeVariants: (props?: ({
5
- variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
5
+ variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
6
6
  size?: "default" | "sm" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function Badge({ className, variant, size, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -4,7 +4,7 @@ import { useRender } from "@base-ui/react/use-render";
4
4
  //#region src/components/bubble.d.ts
5
5
  declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
6
6
  declare const bubbleVariants: (props?: ({
7
- variant?: "default" | "outline" | "destructive" | "secondary" | "ghost" | "muted" | "tinted" | null | undefined;
7
+ variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "muted" | "tinted" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
10
10
  align?: "start" | "end";
@@ -2,8 +2,8 @@ import { Button as Button$1 } from "@base-ui/react/button";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  //#region src/components/button.d.ts
4
4
  declare const buttonVariants: (props?: ({
5
- variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
6
- size?: "default" | "sm" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
5
+ variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
6
+ size?: "default" | "sm" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
9
9
  //#endregion
@@ -3,7 +3,8 @@ import * as React from "react";
3
3
  /** Why `file` can't be a favicon, or `null` when it can. Mirrors the API's own checks. */
4
4
  declare function validateFaviconFile(file: File): "Use a PNG, SVG, or ICO file." | "Favicon must be 500 KB or smaller." | null;
5
5
  /**
6
- * A large area to drop or browse for a favicon, which previews `previewUrl` in its center.
6
+ * A large area to drop or browse for a favicon, which previews `previewUrl`
7
+ * on a light and a dark background side by side.
7
8
  * It only picks the file: saving it is up to the caller.
8
9
  */
9
10
  declare function FaviconDropZone({ previewUrl, prompt, disabled, onFileSelected, className }: {
@@ -18,8 +18,17 @@ function validateFaviconFile(file) {
18
18
  if (file.size > FAVICON_MAX_BYTES) return "Favicon must be 500 KB or smaller.";
19
19
  return null;
20
20
  }
21
+ /** Browsers show favicons on both, so the preview checks the icon reads on each. */
22
+ const PREVIEW_BACKGROUNDS = [{
23
+ label: "Light",
24
+ className: "border-neutral-200 bg-white"
25
+ }, {
26
+ label: "Dark",
27
+ className: "border-neutral-800 bg-neutral-950"
28
+ }];
21
29
  /**
22
- * A large area to drop or browse for a favicon, which previews `previewUrl` in its center.
30
+ * A large area to drop or browse for a favicon, which previews `previewUrl`
31
+ * on a light and a dark background side by side.
23
32
  * It only picks the file: saving it is up to the caller.
24
33
  */
25
34
  function FaviconDropZone({ previewUrl, prompt, disabled, onFileSelected, className }) {
@@ -65,12 +74,21 @@ function FaviconDropZone({ previewUrl, prompt, disabled, onFileSelected, classNa
65
74
  onClick: () => fileInputRef.current?.click(),
66
75
  className: "hover:bg-accent/50 focus-visible:ring-ring/50 flex w-full flex-col items-center gap-5 rounded-xl border-2 border-dashed px-6 py-10 transition-colors outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50",
67
76
  children: [/* @__PURE__ */ jsx("span", {
68
- className: "bg-background flex size-20 items-center justify-center rounded-2xl border shadow-xs",
69
- children: /* @__PURE__ */ jsx("img", {
70
- src: previewUrl,
71
- alt: "",
72
- className: "size-12 object-contain"
73
- })
77
+ className: "flex gap-4",
78
+ children: PREVIEW_BACKGROUNDS.map((background) => /* @__PURE__ */ jsxs("span", {
79
+ className: "flex flex-col items-center gap-2",
80
+ children: [/* @__PURE__ */ jsx("span", {
81
+ className: cn("flex size-20 items-center justify-center rounded-2xl border shadow-xs", background.className),
82
+ children: /* @__PURE__ */ jsx("img", {
83
+ src: previewUrl,
84
+ alt: "",
85
+ className: "size-12 object-contain"
86
+ })
87
+ }), /* @__PURE__ */ jsx("span", {
88
+ className: "text-muted-foreground text-xs",
89
+ children: background.label
90
+ })]
91
+ }, background.label))
74
92
  }), /* @__PURE__ */ jsxs("span", {
75
93
  className: "space-y-1 text-center",
76
94
  children: [/* @__PURE__ */ jsx("span", {
@@ -3,7 +3,7 @@ import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
3
3
  //#region src/components/tabs.d.ts
4
4
  declare function Tabs({ className, orientation, ...props }: Tabs$1.Root.Props): import("react").JSX.Element;
5
5
  declare const tabsListVariants: (props?: ({
6
- variant?: "line" | "default" | null | undefined;
6
+ variant?: "default" | "line" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function TabsList({ className, variant, ...props }: Tabs$1.List.Props & VariantProps<typeof tabsListVariants>): import("react").JSX.Element;
9
9
  declare function TabsTrigger({ className, ...props }: Tabs$1.Tab.Props): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camox/ui",
3
- "version": "0.68.0",
3
+ "version": "0.69.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"