orbital-ds 0.14.0 → 0.16.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/AGENTS.md +5 -0
- package/README.md +97 -93
- package/components.manifest.json +79 -1
- package/dist/hooks/use-ds-messages.d.ts +5 -0
- package/dist/lib/i18n.d.ts +5 -0
- package/dist/lib/i18n.js +18 -3
- package/dist/styles.css +1108 -1041
- package/dist/themes/fractalia.css +77 -1
- package/dist/themes/fractalia.guide.md +10 -3
- package/dist/themes/fractalia.meta.json +16 -3
- package/dist/themes/fractalia.scoped.css +77 -1
- package/dist/themes/liquid.css +502 -500
- package/dist/themes/liquid.fonts.css +7 -7
- package/dist/themes/liquid.guide.md +82 -73
- package/dist/themes/liquid.meta.json +134 -134
- package/dist/themes/liquid.scoped.css +502 -500
- package/dist/ui/ai-tag.d.ts +8 -0
- package/dist/ui/ai-tag.js +45 -0
- package/dist/ui/alert.js +18 -9
- package/dist/ui/avatar.d.ts +4 -1
- package/dist/ui/avatar.js +10 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/bottom-nav.d.ts +15 -0
- package/dist/ui/bottom-nav.js +97 -0
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/choice-card.d.ts +16 -0
- package/dist/ui/choice-card.js +98 -0
- package/dist/ui/copy-button.d.ts +14 -0
- package/dist/ui/copy-button.js +112 -0
- package/dist/ui/icon-tile.d.ts +1 -1
- package/dist/ui/input-group.d.ts +1 -1
- package/dist/ui/item.d.ts +1 -1
- package/dist/ui/marker.d.ts +1 -1
- package/dist/ui/progress.d.ts +4 -1
- package/dist/ui/progress.js +5 -1
- package/dist/ui/sparkline.d.ts +1 -1
- package/dist/ui/status-badge.d.ts +2 -2
- package/dist/ui/tabs.d.ts +1 -1
- package/package.json +181 -180
- package/scripts/brand-file.mjs +221 -0
- package/scripts/cli.mjs +452 -370
- package/scripts/init.mjs +176 -72
- package/scripts/setup.mjs +90 -10
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare function AiTag({ className, children, iconOnly, ...props }: React.ComponentProps<"span"> & {
|
|
4
|
+
iconOnly?: boolean;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function AiTagMeta({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { AiTag, AiTagMeta };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SparklesIcon } from "lucide-react";
|
|
3
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
function AiTag({
|
|
6
|
+
className,
|
|
7
|
+
children,
|
|
8
|
+
iconOnly = false,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
const t = useDsMessages();
|
|
12
|
+
const text = children ?? t.aiGenerated;
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "ai-tag",
|
|
17
|
+
"data-icon-only": iconOnly ? "" : void 0,
|
|
18
|
+
role: iconOnly ? "img" : void 0,
|
|
19
|
+
"aria-label": iconOnly && typeof text === "string" ? text : void 0,
|
|
20
|
+
className: cn(
|
|
21
|
+
"inline-flex w-fit shrink-0 items-center gap-1 rounded-badge border border-(--ds-badge-ai-border) bg-(image:--ds-badge-ai-bg) px-(--ds-badge-px) py-(--ds-badge-py) text-xs font-(--ds-badge-weight) whitespace-nowrap text-(--ds-badge-ai-fg) data-icon-only:px-(--ds-badge-py) [&>svg]:size-3.5 [&>svg]:shrink-0",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsx(SparklesIcon, { "aria-hidden": "true" }),
|
|
27
|
+
iconOnly ? null : text
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function AiTagMeta({ className, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"span",
|
|
35
|
+
{
|
|
36
|
+
"data-slot": "ai-tag-meta",
|
|
37
|
+
className: cn("text-muted-foreground", className),
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
AiTag,
|
|
44
|
+
AiTagMeta
|
|
45
|
+
};
|
package/dist/ui/alert.js
CHANGED
|
@@ -2,18 +2,27 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
const alertVariants = cva(
|
|
5
|
-
|
|
5
|
+
// Forma, texto y disco del icono salen de los huecos --ds-alert-* (neutros en el núcleo). El
|
|
6
|
+
// icono toma el tono de la variante (--alert-tone) o el color del texto; con
|
|
7
|
+
// --ds-alert-icon-fill: 1 el tono pasa a ser un disco y el icono va en --ds-alert-icon-on.
|
|
8
|
+
[
|
|
9
|
+
"group/alert relative grid w-full gap-0.5 rounded-(--ds-radius-alert) border-(length:--ds-alert-border-w) px-(--ds-alert-px) py-(--ds-alert-py) text-left text-(length:--ds-alert-text) leading-(--ds-alert-leading) shadow-(--ds-shadow-alert) has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5",
|
|
10
|
+
"*:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:box-border *:[svg]:rounded-full *:[svg]:p-(--ds-alert-icon-pad) *:[svg:not([class*='size-'])]:size-(--ds-alert-icon)",
|
|
11
|
+
"*:[svg]:text-[color:color-mix(in_srgb,var(--ds-alert-icon-on)_calc(var(--ds-alert-icon-fill)*100%),var(--alert-tone,currentColor))]",
|
|
12
|
+
"*:[svg]:bg-[color:color-mix(in_srgb,var(--alert-tone,currentColor)_calc(var(--ds-alert-icon-fill)*100%),transparent)]"
|
|
13
|
+
],
|
|
6
14
|
{
|
|
7
15
|
variants: {
|
|
8
16
|
variant: {
|
|
9
17
|
default: "bg-card text-card-foreground",
|
|
10
|
-
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90
|
|
11
|
-
// Estados: fondo suave; texto del estado o, si el tema
|
|
12
|
-
// y el borde siguen siendo del estado). Contraste AA
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90",
|
|
19
|
+
// Estados: fondo suave (o --ds-alert-bg si el tema lo define); texto del estado o, si el tema
|
|
20
|
+
// define --ds-on-soft, en tinta (el icono y el borde siguen siendo del estado). Contraste AA
|
|
21
|
+
// comprobado por check:ds.
|
|
22
|
+
info: "[--alert-tone:var(--info)] border-info/30 bg-[color:var(--ds-alert-bg,var(--info-soft))] text-[color:var(--ds-on-soft,var(--info))] *:data-[slot=alert-description]:text-[color:var(--ds-on-soft,var(--info))]",
|
|
23
|
+
success: "[--alert-tone:var(--success)] border-success/30 bg-[color:var(--ds-alert-bg,var(--success-soft))] text-[color:var(--ds-on-soft,var(--success))] *:data-[slot=alert-description]:text-[color:var(--ds-on-soft,var(--success))]",
|
|
24
|
+
warning: "[--alert-tone:var(--warning)] border-warning/30 bg-[color:var(--ds-alert-bg,var(--warning-soft))] text-[color:var(--ds-on-soft,var(--warning))] *:data-[slot=alert-description]:text-[color:var(--ds-on-soft,var(--warning))]",
|
|
25
|
+
danger: "[--alert-tone:var(--danger)] border-danger/30 bg-[color:var(--ds-alert-bg,var(--danger-soft))] text-[color:var(--ds-on-soft,var(--danger))] *:data-[slot=alert-description]:text-[color:var(--ds-on-soft,var(--danger))]"
|
|
17
26
|
}
|
|
18
27
|
},
|
|
19
28
|
defaultVariants: {
|
|
@@ -59,7 +68,7 @@ function AlertDescription({
|
|
|
59
68
|
{
|
|
60
69
|
"data-slot": "alert-description",
|
|
61
70
|
className: cn(
|
|
62
|
-
"text-
|
|
71
|
+
"text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
63
72
|
className
|
|
64
73
|
),
|
|
65
74
|
...props
|
package/dist/ui/avatar.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
|
|
3
|
+
import { DsDataTone } from './legend.js';
|
|
3
4
|
|
|
4
5
|
declare function Avatar({ className, size, ...props }: Avatar$1.Root.Props & {
|
|
5
6
|
size?: "default" | "sm" | "lg";
|
|
6
7
|
}): React.JSX.Element;
|
|
7
8
|
declare function AvatarImage({ className, ...props }: Avatar$1.Image.Props): React.JSX.Element;
|
|
8
|
-
declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props
|
|
9
|
+
declare function AvatarFallback({ className, tone, style, ...props }: Avatar$1.Fallback.Props & {
|
|
10
|
+
tone?: DsDataTone;
|
|
11
|
+
}): React.JSX.Element;
|
|
9
12
|
declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
10
13
|
declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
14
|
declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
package/dist/ui/avatar.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { dataToneSoftVar, dataToneVar } from "./legend.js";
|
|
4
5
|
function Avatar({
|
|
5
6
|
className,
|
|
6
7
|
size = "default",
|
|
@@ -34,16 +35,24 @@ function AvatarImage({ className, ...props }) {
|
|
|
34
35
|
}
|
|
35
36
|
function AvatarFallback({
|
|
36
37
|
className,
|
|
38
|
+
tone,
|
|
39
|
+
style,
|
|
37
40
|
...props
|
|
38
41
|
}) {
|
|
39
42
|
return /* @__PURE__ */ jsx(
|
|
40
43
|
AvatarPrimitive.Fallback,
|
|
41
44
|
{
|
|
42
45
|
"data-slot": "avatar-fallback",
|
|
46
|
+
"data-tone": tone,
|
|
43
47
|
className: cn(
|
|
44
|
-
"flex size-full items-center justify-center rounded-avatar bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
|
|
48
|
+
"flex size-full items-center justify-center rounded-avatar bg-muted font-(family-name:--ds-avatar-font) font-(--ds-avatar-weight) text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
|
|
45
49
|
className
|
|
46
50
|
),
|
|
51
|
+
style: tone ? (state) => ({
|
|
52
|
+
backgroundColor: dataToneSoftVar[tone],
|
|
53
|
+
color: dataToneVar[tone],
|
|
54
|
+
...typeof style === "function" ? style(state) : style
|
|
55
|
+
}) : style,
|
|
47
56
|
...props
|
|
48
57
|
}
|
|
49
58
|
);
|
package/dist/ui/badge.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | "info" | "success" | "warning" | "danger" | "neutral" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
10
10
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
|
|
4
|
+
declare function BottomNav({ className, position, ...props }: React.ComponentProps<"nav"> & {
|
|
5
|
+
position?: "fixed" | "static";
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function BottomNavItem({ className, active, render, ...props }: useRender.ComponentProps<"a"> & {
|
|
8
|
+
active?: boolean;
|
|
9
|
+
}): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
10
|
+
declare function BottomNavIcon({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
11
|
+
declare function BottomNavLabel({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
12
|
+
/** Contador o punto sobre el icono (avisos sin leer). Sin hijos, solo el punto. */
|
|
13
|
+
declare function BottomNavBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { BottomNav, BottomNavBadge, BottomNavIcon, BottomNavItem, BottomNavLabel };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
function BottomNav({
|
|
8
|
+
className,
|
|
9
|
+
position = "fixed",
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
const t = useDsMessages();
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"nav",
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "bottom-nav",
|
|
17
|
+
"data-position": position,
|
|
18
|
+
"aria-label": t.bottomNav,
|
|
19
|
+
className: cn(
|
|
20
|
+
"z-(--ds-z-sticky) flex h-[calc(var(--ds-bottom-nav-h)+env(safe-area-inset-bottom))] items-start justify-around gap-1 overflow-hidden rounded-(--ds-radius-bottom-nav) border-t-(length:--ds-bottom-nav-border-w) border-border bg-(--ds-bottom-nav-bg) px-(--ds-bottom-nav-px) pb-[env(safe-area-inset-bottom)] shadow-(--ds-shadow-bottom-nav)",
|
|
21
|
+
"data-[position=fixed]:fixed data-[position=fixed]:inset-x-(--ds-bottom-nav-inset) data-[position=fixed]:bottom-[calc(var(--ds-bottom-nav-inset)+env(safe-area-inset-bottom))] data-[position=fixed]:pb-0",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function BottomNavItem({
|
|
29
|
+
className,
|
|
30
|
+
active = false,
|
|
31
|
+
render,
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
return useRender({
|
|
35
|
+
defaultTagName: "a",
|
|
36
|
+
props: mergeProps(
|
|
37
|
+
{
|
|
38
|
+
className: cn(
|
|
39
|
+
"group/bottom-nav-item flex h-(--ds-bottom-nav-h) min-w-(--ds-touch-target) flex-1 flex-col items-center justify-center gap-1 text-(length:--ds-bottom-nav-label) text-(--ds-bottom-nav-item-fg) outline-none transition-colors duration-(--ds-motion-snap) select-none focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color) focus-visible:ring-inset data-active:font-(--ds-nav-active-weight) data-active:text-(--ds-bottom-nav-item-active-fg) aria-disabled:pointer-events-none aria-disabled:opacity-(--ds-disabled-opacity)",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
"aria-current": active ? "page" : void 0
|
|
43
|
+
},
|
|
44
|
+
props
|
|
45
|
+
),
|
|
46
|
+
render,
|
|
47
|
+
state: { slot: "bottom-nav-item", active },
|
|
48
|
+
stateAttributesMapping: {
|
|
49
|
+
slot: (slot) => ({ "data-slot": slot }),
|
|
50
|
+
active: (value) => value ? { "data-active": "" } : null
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function BottomNavIcon({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"span",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "bottom-nav-icon",
|
|
59
|
+
"aria-hidden": "true",
|
|
60
|
+
className: cn(
|
|
61
|
+
"relative flex h-(--ds-bottom-nav-icon-box-h) w-(--ds-bottom-nav-icon-box-w) items-center justify-center rounded-(--ds-radius-bottom-nav-item) bg-(--ds-bottom-nav-item-bg) transition-colors duration-(--ds-motion-snap) group-data-active/bottom-nav-item:bg-(--ds-bottom-nav-item-active-bg) group-data-active/bottom-nav-item:text-(--ds-bottom-nav-icon-active-fg) [&_svg:not([class*='size-'])]:size-(--ds-bottom-nav-icon) [&_svg]:shrink-0",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function BottomNavLabel({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"span",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "bottom-nav-label",
|
|
73
|
+
className: cn("max-w-full truncate leading-none", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function BottomNavBadge({ className, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "bottom-nav-badge",
|
|
83
|
+
className: cn(
|
|
84
|
+
"absolute -top-1 -end-1 flex min-w-2.5 h-2.5 items-center justify-center rounded-full bg-destructive px-1 text-(length:--ds-bottom-nav-label) leading-none font-(--ds-strong-weight) text-destructive-foreground not-empty:h-4 not-empty:min-w-4 ring-(length:--ds-avatar-ring-w) ring-(--ds-bottom-nav-bg)",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
BottomNav,
|
|
93
|
+
BottomNavBadge,
|
|
94
|
+
BottomNavIcon,
|
|
95
|
+
BottomNavItem,
|
|
96
|
+
BottomNavLabel
|
|
97
|
+
};
|
package/dist/ui/bubble.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
7
|
declare const bubbleVariants: (props?: ({
|
|
8
|
-
variant?: "default" | "
|
|
8
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "muted" | "tinted" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
11
11
|
align?: "start" | "end";
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
8
8
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Button({ className, variant, size, render, nativeButton: _nativeButton, ...props }: useRender.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Radio } from '@base-ui/react/radio';
|
|
3
|
+
import { RadioGroup } from '@base-ui/react/radio-group';
|
|
4
|
+
|
|
5
|
+
declare function ChoiceCardGroup({ className, ...props }: RadioGroup.Props): React.JSX.Element;
|
|
6
|
+
declare function ChoiceCard({ className, orientation, ...props }: Radio.Root.Props & {
|
|
7
|
+
orientation?: "horizontal" | "vertical";
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function ChoiceCardMedia({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
10
|
+
declare function ChoiceCardContent({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
11
|
+
declare function ChoiceCardTitle({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
12
|
+
declare function ChoiceCardDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
13
|
+
/** Marca de seleccionado (opcional): un círculo con punto en la esquina, como un radio. */
|
|
14
|
+
declare function ChoiceCardIndicator({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { ChoiceCard, ChoiceCardContent, ChoiceCardDescription, ChoiceCardGroup, ChoiceCardIndicator, ChoiceCardMedia, ChoiceCardTitle };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
function ChoiceCardGroup({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
RadioGroupPrimitive,
|
|
9
|
+
{
|
|
10
|
+
"data-slot": "choice-card-group",
|
|
11
|
+
className: cn("grid w-full gap-3 sm:grid-cols-[repeat(auto-fill,minmax(10rem,1fr))]", className),
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function ChoiceCard({
|
|
17
|
+
className,
|
|
18
|
+
orientation = "horizontal",
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
RadioPrimitive.Root,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "choice-card",
|
|
25
|
+
"data-orientation": orientation,
|
|
26
|
+
className: cn(
|
|
27
|
+
"group/choice-card relative flex min-h-(--ds-touch-target) items-center gap-(--ds-choice-card-gap) rounded-(--ds-radius-choice-card) border border-(--ds-choice-card-border) bg-(--ds-choice-card-bg) px-(--ds-choice-card-px) py-(--ds-choice-card-py) text-start text-foreground outline-none transition-colors duration-(--ds-motion-snap) select-none",
|
|
28
|
+
"hover:border-(--ds-choice-card-selected-border) focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color)",
|
|
29
|
+
"data-checked:border-(--ds-choice-card-selected-border) data-checked:bg-(--ds-choice-card-selected-bg) data-checked:text-(--ds-choice-card-selected-fg) data-checked:font-(--ds-choice-card-selected-weight)",
|
|
30
|
+
"data-disabled:cursor-not-allowed data-disabled:border-(--ds-choice-card-disabled-bg) data-disabled:bg-(--ds-choice-card-disabled-bg) data-disabled:text-(--ds-choice-card-disabled-fg) data-disabled:opacity-(--ds-choice-card-disabled-opacity)",
|
|
31
|
+
"data-[orientation=vertical]:flex-col data-[orientation=vertical]:justify-center data-[orientation=vertical]:text-center",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function ChoiceCardMedia({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "choice-card-media",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
className: cn(
|
|
45
|
+
"flex shrink-0 items-center justify-center text-(--ds-choice-card-icon-fg) group-data-checked/choice-card:text-(--ds-choice-card-selected-accent) group-data-disabled/choice-card:text-current [&_svg:not([class*='size-'])]:size-(--ds-choice-card-icon)",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function ChoiceCardContent({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "choice-card-content",
|
|
57
|
+
className: cn("flex min-w-0 flex-1 flex-col gap-0.5", className),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function ChoiceCardTitle({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("span", { "data-slot": "choice-card-title", className: cn("text-sm", className), ...props });
|
|
64
|
+
}
|
|
65
|
+
function ChoiceCardDescription({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
"span",
|
|
68
|
+
{
|
|
69
|
+
"data-slot": "choice-card-description",
|
|
70
|
+
className: cn("text-xs font-normal text-muted-foreground group-data-disabled/choice-card:text-current", className),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function ChoiceCardIndicator({ className, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
"data-slot": "choice-card-indicator",
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
className: cn(
|
|
82
|
+
"flex size-(--ds-check-size) shrink-0 items-center justify-center rounded-full border border-input bg-(--ds-check-bg) group-data-checked/choice-card:border-(--ds-choice-card-selected-accent) group-data-checked/choice-card:bg-(--ds-choice-card-selected-accent) group-data-[orientation=vertical]/choice-card:absolute group-data-[orientation=vertical]/choice-card:top-2 group-data-[orientation=vertical]/choice-card:end-2",
|
|
83
|
+
className
|
|
84
|
+
),
|
|
85
|
+
...props,
|
|
86
|
+
children: /* @__PURE__ */ jsx("span", { className: "size-2 scale-0 rounded-full bg-primary-foreground transition-transform duration-(--ds-motion-snap) group-data-checked/choice-card:scale-100" })
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
ChoiceCard,
|
|
92
|
+
ChoiceCardContent,
|
|
93
|
+
ChoiceCardDescription,
|
|
94
|
+
ChoiceCardGroup,
|
|
95
|
+
ChoiceCardIndicator,
|
|
96
|
+
ChoiceCardMedia,
|
|
97
|
+
ChoiceCardTitle
|
|
98
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from './button.js';
|
|
3
|
+
import 'class-variance-authority/types';
|
|
4
|
+
import '@base-ui/react/use-render';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare function CopyButton({ value, className, onClick, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "value" | "children"> & {
|
|
8
|
+
value: string;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function CopyField({ value, children, className, onClick, ...props }: Omit<React.ComponentProps<"button">, "value"> & {
|
|
11
|
+
value: string;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { CopyButton, CopyField };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
5
|
+
import { useDsMessages } from "../hooks/use-ds-messages.js";
|
|
6
|
+
import { dsFormat } from "../lib/i18n.js";
|
|
7
|
+
import { cn } from "../lib/utils.js";
|
|
8
|
+
import { Button } from "./button.js";
|
|
9
|
+
function useCopy(value) {
|
|
10
|
+
const [copied, setCopied] = React.useState(false);
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
if (!copied) return;
|
|
13
|
+
const id = window.setTimeout(() => setCopied(false), 2e3);
|
|
14
|
+
return () => window.clearTimeout(id);
|
|
15
|
+
}, [copied]);
|
|
16
|
+
const copy = React.useCallback(async () => {
|
|
17
|
+
try {
|
|
18
|
+
await navigator.clipboard.writeText(value);
|
|
19
|
+
setCopied(true);
|
|
20
|
+
} catch {
|
|
21
|
+
}
|
|
22
|
+
}, [value]);
|
|
23
|
+
return { copied, copy };
|
|
24
|
+
}
|
|
25
|
+
function CopyStatus({ copied }) {
|
|
26
|
+
const t = useDsMessages();
|
|
27
|
+
return /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "polite", children: copied ? t.copied : null });
|
|
28
|
+
}
|
|
29
|
+
function CopyButton({
|
|
30
|
+
value,
|
|
31
|
+
className,
|
|
32
|
+
onClick,
|
|
33
|
+
variant = "ghost",
|
|
34
|
+
size = "icon-sm",
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
const t = useDsMessages();
|
|
38
|
+
const { copied, copy } = useCopy(value);
|
|
39
|
+
const label = copied ? t.copied : t.copy;
|
|
40
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
Button,
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "copy-button",
|
|
45
|
+
"data-copied": copied ? "" : void 0,
|
|
46
|
+
type: "button",
|
|
47
|
+
variant,
|
|
48
|
+
size,
|
|
49
|
+
"aria-label": label,
|
|
50
|
+
title: label,
|
|
51
|
+
className,
|
|
52
|
+
onClick: (event) => {
|
|
53
|
+
onClick?.(event);
|
|
54
|
+
void copy();
|
|
55
|
+
},
|
|
56
|
+
...props,
|
|
57
|
+
children: copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {})
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsx(CopyStatus, { copied })
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
function CopyField({
|
|
64
|
+
value,
|
|
65
|
+
children,
|
|
66
|
+
className,
|
|
67
|
+
onClick,
|
|
68
|
+
...props
|
|
69
|
+
}) {
|
|
70
|
+
const t = useDsMessages();
|
|
71
|
+
const { copied, copy } = useCopy(value);
|
|
72
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ jsxs(
|
|
74
|
+
"button",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "copy-field",
|
|
77
|
+
"data-copied": copied ? "" : void 0,
|
|
78
|
+
type: "button",
|
|
79
|
+
"aria-label": dsFormat(t.copyValue, { value }),
|
|
80
|
+
title: copied ? t.copied : t.copy,
|
|
81
|
+
className: cn(
|
|
82
|
+
"group/copy-field inline-flex max-w-full min-h-(--ds-touch-target) items-center gap-(--ds-copy-field-gap) rounded-(--ds-radius-copy-field) border border-(--ds-copy-field-border) bg-transparent px-(--ds-copy-field-px) py-(--ds-copy-field-py) text-start text-(length:--ds-copy-field-text) text-foreground outline-none transition-colors duration-(--ds-motion-snap)",
|
|
83
|
+
"hover:border-(--ds-copy-field-hover) focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color)",
|
|
84
|
+
"disabled:cursor-not-allowed disabled:opacity-(--ds-disabled-opacity)",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
onClick: (event) => {
|
|
88
|
+
onClick?.(event);
|
|
89
|
+
void copy();
|
|
90
|
+
},
|
|
91
|
+
...props,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "copy-field-value", className: "min-w-0 truncate", children: children ?? value }),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
"span",
|
|
96
|
+
{
|
|
97
|
+
"data-slot": "copy-field-icon",
|
|
98
|
+
"aria-hidden": "true",
|
|
99
|
+
className: "flex shrink-0 text-(--ds-copy-field-icon-fg) group-hover/copy-field:text-(--ds-copy-field-hover) group-focus-visible/copy-field:text-(--ds-ring-color) [&_svg]:size-4",
|
|
100
|
+
children: copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {})
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ jsx(CopyStatus, { copied })
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
CopyButton,
|
|
111
|
+
CopyField
|
|
112
|
+
};
|
package/dist/ui/icon-tile.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
declare const iconTileVariants: (props?: ({
|
|
6
|
-
tone?: "info" | "success" | "warning" | "danger" | "
|
|
6
|
+
tone?: "info" | "success" | "warning" | "danger" | "primary" | "neutral" | "accent" | null | undefined;
|
|
7
7
|
size?: "sm" | "lg" | "md" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare function IconTile({ className, tone, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof iconTileVariants>): React.JSX.Element;
|
package/dist/ui/input-group.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import '@base-ui/react/use-render';
|
|
|
6
6
|
|
|
7
7
|
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
8
|
declare const inputGroupAddonVariants: (props?: ({
|
|
9
|
-
align?: "inline-end" | "inline-start" | "block-
|
|
9
|
+
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
12
12
|
declare const inputGroupButtonVariants: (props?: ({
|
package/dist/ui/item.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const itemVariants: (props?: ({
|
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
14
|
declare function Item({ className, variant, size, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof itemVariants>): React.JSX.Element;
|
|
15
15
|
declare const itemMediaVariants: (props?: ({
|
|
16
|
-
variant?: "
|
|
16
|
+
variant?: "image" | "default" | "icon" | null | undefined;
|
|
17
17
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
18
18
|
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): React.JSX.Element;
|
|
19
19
|
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
package/dist/ui/marker.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const markerVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "separator" | "default" | "border" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Marker({ className, variant, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof markerVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
10
10
|
declare function MarkerIcon({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
package/dist/ui/progress.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Progress as Progress$1 } from '@base-ui/react/progress';
|
|
3
|
+
import { DsDataTone } from './legend.js';
|
|
3
4
|
|
|
4
|
-
declare function Progress({ className, value, ...props }: Progress$1.Root.Props
|
|
5
|
+
declare function Progress({ className, value, tone, ...props }: Progress$1.Root.Props & {
|
|
6
|
+
tone?: DsDataTone;
|
|
7
|
+
}): React.JSX.Element;
|
|
5
8
|
|
|
6
9
|
export { Progress };
|
package/dist/ui/progress.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { dataToneVar } from "./legend.js";
|
|
5
6
|
function Progress({
|
|
6
7
|
className,
|
|
7
8
|
value,
|
|
9
|
+
tone,
|
|
8
10
|
...props
|
|
9
11
|
}) {
|
|
10
12
|
return /* @__PURE__ */ jsx(ProgressPrimitive.Root, { "data-slot": "progress", value, ...props, children: /* @__PURE__ */ jsx(
|
|
@@ -19,7 +21,9 @@ function Progress({
|
|
|
19
21
|
ProgressPrimitive.Indicator,
|
|
20
22
|
{
|
|
21
23
|
"data-slot": "progress-indicator",
|
|
22
|
-
|
|
24
|
+
"data-tone": tone,
|
|
25
|
+
className: "h-full bg-(--ds-progress-fill) transition-all duration-(--ds-motion-snap) data-complete:bg-(--ds-progress-fill-complete)",
|
|
26
|
+
style: tone ? { backgroundColor: dataToneVar[tone] } : void 0
|
|
23
27
|
}
|
|
24
28
|
)
|
|
25
29
|
}
|
package/dist/ui/sparkline.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
type SparklineSeries = 1 | 2 | 3 | 4 | 5;
|
|
5
5
|
type SparklineTone = "info" | "success" | "warning" | "danger" | "neutral";
|
|
6
6
|
declare const sparklineVariants: (props?: ({
|
|
7
|
-
color?: "
|
|
7
|
+
color?: "current" | "info" | "success" | "warning" | "danger" | "neutral" | "series-1" | "series-2" | "series-3" | "series-4" | "series-5" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
type SparklineProps = Omit<React.ComponentProps<"svg">, "children" | "color"> & {
|
|
10
10
|
/** Serie de valores; `null` = sin dato (hueco), nunca cero. */
|