@alpic-ai/ui 1.168.2 → 1.169.1
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/components/accordion-card.d.mts +1 -1
- package/dist/components/accordion.d.mts +1 -1
- package/dist/components/alert.d.mts +2 -2
- package/dist/components/area-chart.mjs +1 -1
- package/dist/components/attachment-tile.mjs +1 -1
- package/dist/components/avatar.d.mts +1 -1
- package/dist/components/badge.d.mts +1 -1
- package/dist/components/bar-chart.mjs +1 -1
- package/dist/components/bar-list.mjs +2 -3
- package/dist/components/breadcrumb.mjs +1 -1
- package/dist/components/button.d.mts +2 -2
- package/dist/components/button.mjs +5 -4
- package/dist/components/chart-container.mjs +2 -2
- package/dist/components/combobox.d.mts +1 -1
- package/dist/components/combobox.mjs +1 -1
- package/dist/components/copyable.mjs +1 -1
- package/dist/components/dialog.d.mts +1 -1
- package/dist/components/dialog.mjs +1 -1
- package/dist/components/donut-chart.mjs +1 -1
- package/dist/components/dropdown-menu.d.mts +2 -2
- package/dist/components/dropdown-menu.mjs +1 -0
- package/dist/components/form.mjs +6 -5
- package/dist/components/heatmap-chart.mjs +2 -2
- package/dist/components/input-group.d.mts +1 -1
- package/dist/components/input.mjs +19 -18
- package/dist/components/line-chart.mjs +1 -1
- package/dist/components/scroll-area.mjs +1 -1
- package/dist/components/select.d.mts +1 -1
- package/dist/components/select.mjs +1 -1
- package/dist/components/sidebar.d.mts +2 -2
- package/dist/components/sidebar.mjs +3 -3
- package/dist/components/spinner.d.mts +1 -1
- package/dist/components/stat.mjs +1 -1
- package/dist/components/status-dot.d.mts +1 -1
- package/dist/components/switch.mjs +1 -1
- package/dist/components/table.mjs +2 -2
- package/dist/components/tabs.d.mts +1 -1
- package/dist/components/tabs.mjs +4 -4
- package/dist/components/textarea.mjs +11 -10
- package/dist/components/toggle-group.d.mts +2 -2
- package/dist/components/toggle-group.mjs +3 -3
- package/dist/components/tooltip-icon-button.mjs +1 -1
- package/dist/hooks/use-mobile.mjs +1 -2
- package/package.json +1 -1
- package/src/components/breadcrumb.tsx +1 -0
- package/src/components/button.tsx +5 -4
- package/src/components/dialog.tsx +1 -0
- package/src/components/dropdown-menu.tsx +1 -0
- package/src/components/form.tsx +12 -3
- package/src/components/scroll-area.tsx +1 -1
- package/src/components/select.tsx +1 -0
- package/src/components/switch.tsx +1 -0
- package/src/components/table.tsx +2 -2
- package/src/components/tabs.tsx +3 -4
- package/src/components/toggle-group.tsx +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
3
|
//#region src/components/accordion-card.d.ts
|
|
4
4
|
declare function AccordionCard({ defaultOpen, open, onOpenChange, disabled, className, children, ...props }: {
|
|
5
5
|
defaultOpen?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
3
|
//#region src/components/accordion.d.ts
|
|
4
4
|
declare function Accordion({ ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Root>): React$1.JSX.Element;
|
|
5
5
|
declare function AccordionItem({ className, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Item>): React$1.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/alert.d.ts
|
|
4
4
|
declare const alertVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "destructive" | "default" | "success" | "warning" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {}
|
|
8
8
|
declare function Alert({ className, variant, ...props }: AlertProps): React$1.JSX.Element;
|
|
@@ -6,8 +6,8 @@ import { ChartLegend } from "./chart-legend.mjs";
|
|
|
6
6
|
import { computeNumericMax, makeActiveDot, makeChartAxis, makeLastValueLabel, makeLegendItems, renderMarkers, renderReferenceLine } from "./chart-primitives.mjs";
|
|
7
7
|
import { ChartTooltipContent } from "./chart-tooltip.mjs";
|
|
8
8
|
import { Skeleton } from "./skeleton.mjs";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import * as React$1 from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Area, AreaChart as AreaChart$1, CartesianGrid, LabelList, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
|
12
12
|
//#region src/components/area-chart.tsx
|
|
13
13
|
const CURVE_TYPE = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
3
|
import { TooltipIconButton } from "./tooltip-icon-button.mjs";
|
|
4
|
+
import { useState } from "react";
|
|
4
5
|
import { FileText, XIcon } from "lucide-react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { useState } from "react";
|
|
7
7
|
//#region src/components/attachment-tile.tsx
|
|
8
8
|
function AttachmentTile({ src, isImage, label, onRemove, onClick, className }) {
|
|
9
9
|
const [hasError, setHasError] = useState(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
4
4
|
//#region src/components/avatar.d.ts
|
|
5
5
|
declare const avatarVariants: (props?: ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
//#region src/components/badge.d.ts
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "primary" | "secondary" | "success" | "warning" | "error" | null | undefined;
|
|
5
5
|
size?: "sm" | "md" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
interface BadgeProps extends React.ComponentProps<"span">, VariantProps<typeof badgeVariants> {}
|
|
@@ -6,8 +6,8 @@ import { ChartLegend } from "./chart-legend.mjs";
|
|
|
6
6
|
import { computeNumericMax, makeChartAxis, makeLegendItems, renderMarkers, renderReferenceLine } from "./chart-primitives.mjs";
|
|
7
7
|
import { ChartTooltipContent } from "./chart-tooltip.mjs";
|
|
8
8
|
import { Skeleton } from "./skeleton.mjs";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import * as React$1 from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Bar, BarChart as BarChart$1, CartesianGrid, Cell, LabelList, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
|
12
12
|
//#region src/components/bar-chart.tsx
|
|
13
13
|
const BAR_RADIUS = 4;
|
|
@@ -4,8 +4,8 @@ import { rampColor } from "../lib/chart-palette.mjs";
|
|
|
4
4
|
import { useChartContext } from "./chart-container.mjs";
|
|
5
5
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.mjs";
|
|
6
6
|
import { Badge } from "./badge.mjs";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import * as React$1 from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/bar-list.tsx
|
|
10
10
|
const SEMANTIC_KEY = {
|
|
11
11
|
error: "destructive",
|
|
@@ -19,7 +19,6 @@ const SECONDARY_BADGE_VARIANT = {
|
|
|
19
19
|
};
|
|
20
20
|
const PLACEHOLDER_HEIGHT = 168;
|
|
21
21
|
const RAMP_CEILING = .8;
|
|
22
|
-
const SEMANTIC_FLOOR = .62;
|
|
23
22
|
const IN_FILL_SHADOW = "0 1px 2px rgb(0 0 0 / 0.28)";
|
|
24
23
|
const ROW_INTERACTIVE_CLASS = "rounded-md text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card";
|
|
25
24
|
function BarList({ data, index, dataKey = "value", secondaryKey, secondaryVariantKey, titleKey, maxItems, palette, semantic, loading = false, valueFormatter = (value) => value.toLocaleString("en-US"), labelFormatter, className }) {
|
|
@@ -39,7 +38,7 @@ function BarList({ data, index, dataKey = "value", secondaryKey, secondaryVarian
|
|
|
39
38
|
const capped = maxItems ? mapped.slice(0, maxItems) : mapped;
|
|
40
39
|
return capped.map((row, rank) => {
|
|
41
40
|
const rankFraction = capped.length > 1 ? rank / (capped.length - 1) : 0;
|
|
42
|
-
const accentWeight = Math.round((1 - rankFraction *
|
|
41
|
+
const accentWeight = Math.round((1 - rankFraction * .38) * 100);
|
|
43
42
|
return {
|
|
44
43
|
...row,
|
|
45
44
|
color: accent ? `color-mix(in oklab, ${accent} ${accentWeight}%, white)` : rampColor(paletteName, rankFraction * RAMP_CEILING)
|
|
@@ -29,7 +29,7 @@ function BreadcrumbItem({ className, ...props }) {
|
|
|
29
29
|
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
30
30
|
return /* @__PURE__ */ jsx(asChild ? Slot : "a", {
|
|
31
31
|
"data-slot": "breadcrumb-link",
|
|
32
|
-
className: cn("type-text-sm font-medium text-subtle-foreground transition-colors [@media(hover:hover)]:hover:text-muted-foreground", className),
|
|
32
|
+
className: cn("type-text-sm font-medium text-subtle-foreground transition-colors [@media(hover:hover)]:hover:text-muted-foreground", "inline-flex items-center max-md:min-h-11", className),
|
|
33
33
|
...props
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/button.d.ts
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | "link" | "link-muted" | "destructive" | "cta" | null | undefined;
|
|
6
6
|
size?: "default" | "icon" | "icon-rounded" | "pill" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
interface ButtonProps extends React$1.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
@@ -8,6 +8,7 @@ import { Slot, Slottable } from "@radix-ui/react-slot";
|
|
|
8
8
|
const buttonVariants = cva([
|
|
9
9
|
"inline-flex items-center justify-center gap-1 whitespace-nowrap",
|
|
10
10
|
"h-8 px-2 rounded-md",
|
|
11
|
+
"max-md:min-h-11",
|
|
11
12
|
"font-medium",
|
|
12
13
|
"transition-colors",
|
|
13
14
|
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
@@ -24,13 +25,13 @@ const buttonVariants = cva([
|
|
|
24
25
|
"focus-visible:bg-background"
|
|
25
26
|
].join(" "),
|
|
26
27
|
link: [
|
|
27
|
-
"h-auto px-0 rounded-xs underline-offset-4",
|
|
28
|
+
"h-auto max-md:min-h-0 px-0 rounded-xs underline-offset-4",
|
|
28
29
|
"text-link",
|
|
29
30
|
"[@media(hover:hover)]:hover:underline",
|
|
30
31
|
"focus-visible:bg-background"
|
|
31
32
|
].join(" "),
|
|
32
33
|
"link-muted": [
|
|
33
|
-
"h-auto px-0 rounded-xs underline-offset-4",
|
|
34
|
+
"h-auto max-md:min-h-0 px-0 rounded-xs underline-offset-4",
|
|
34
35
|
"text-link-muted",
|
|
35
36
|
"[@media(hover:hover)]:hover:underline",
|
|
36
37
|
"focus-visible:bg-background"
|
|
@@ -46,8 +47,8 @@ const buttonVariants = cva([
|
|
|
46
47
|
},
|
|
47
48
|
size: {
|
|
48
49
|
default: "type-text-sm",
|
|
49
|
-
icon: "size-8 p-0 type-text-sm",
|
|
50
|
-
"icon-rounded": "size-8 p-0 rounded-full type-text-sm",
|
|
50
|
+
icon: "size-8 max-md:min-w-11 p-0 type-text-sm",
|
|
51
|
+
"icon-rounded": "size-8 max-md:min-w-11 p-0 rounded-full type-text-sm",
|
|
51
52
|
pill: "h-7 px-3 rounded-full type-text-xs"
|
|
52
53
|
}
|
|
53
54
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useChartTheme } from "../hooks/use-chart-theme.mjs";
|
|
2
3
|
import { cn } from "../lib/cn.mjs";
|
|
3
4
|
import { CHART_PALETTES } from "../lib/chart-palette.mjs";
|
|
4
|
-
import { useChartTheme } from "../hooks/use-chart-theme.mjs";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
5
|
import * as React$1 from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/chart-container.tsx
|
|
8
8
|
const ChartContext = React$1.createContext(null);
|
|
9
9
|
function ChartContainer({ palette = "magenta", className, ...props }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PopoverContent } from "./popover.mjs";
|
|
2
2
|
import { selectTriggerVariants } from "./select-trigger-variants.mjs";
|
|
3
|
-
import { VariantProps } from "class-variance-authority";
|
|
4
3
|
import { ReactNode } from "react";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import { Command } from "cmdk";
|
|
6
6
|
//#region src/components/combobox.d.ts
|
|
7
7
|
interface ComboboxBaseProps {
|
|
@@ -3,9 +3,9 @@ import { cn } from "../lib/cn.mjs";
|
|
|
3
3
|
import { Popover, PopoverContent, PopoverTrigger } from "./popover.mjs";
|
|
4
4
|
import { selectTriggerVariants } from "./select-trigger-variants.mjs";
|
|
5
5
|
import { TagDismissible } from "./tag.mjs";
|
|
6
|
+
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
6
7
|
import { CheckIcon, ChevronDownIcon, SearchIcon } from "lucide-react";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
9
9
|
import { Command } from "cmdk";
|
|
10
10
|
//#region src/components/combobox.tsx
|
|
11
11
|
const ComboboxContext = createContext(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useCopyToClipboard } from "../hooks/use-copy-to-clipboard.mjs";
|
|
2
3
|
import { cn } from "../lib/cn.mjs";
|
|
3
4
|
import { Button } from "./button.mjs";
|
|
4
|
-
import { useCopyToClipboard } from "../hooks/use-copy-to-clipboard.mjs";
|
|
5
5
|
import { Check, Copy } from "lucide-react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/copyable.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonProps } from "./button.mjs";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
2
|
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
5
5
|
//#region src/components/dialog.d.ts
|
|
6
6
|
declare function Dialog({ ...props }: React$1.ComponentProps<typeof DialogPrimitive.Root>): React$1.JSX.Element;
|
|
@@ -52,7 +52,7 @@ function DialogContent({ className, children, size, showCloseButton = true, ...p
|
|
|
52
52
|
...props,
|
|
53
53
|
children: [children, showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
|
|
54
54
|
"data-slot": "dialog-close",
|
|
55
|
-
className: cn("absolute top-3 right-4 flex size-8 items-center justify-center rounded-md", "text-subtle-foreground transition-colors", "[@media(hover:hover)]:hover:text-foreground", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", "disabled:pointer-events-none"),
|
|
55
|
+
className: cn("absolute top-3 right-4 flex size-8 items-center justify-center rounded-md", "max-md:before:absolute max-md:before:top-1/2 max-md:before:left-1/2 max-md:before:size-11 max-md:before:-translate-x-1/2 max-md:before:-translate-y-1/2 max-md:before:content-['']", "text-subtle-foreground transition-colors", "[@media(hover:hover)]:hover:text-foreground", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", "disabled:pointer-events-none"),
|
|
56
56
|
children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
57
57
|
className: "sr-only",
|
|
58
58
|
children: "Close"
|
|
@@ -3,8 +3,8 @@ import { cn } from "../lib/cn.mjs";
|
|
|
3
3
|
import { paletteColor } from "../lib/chart-palette.mjs";
|
|
4
4
|
import { formatShare } from "../lib/chart.mjs";
|
|
5
5
|
import { useChartContext } from "./chart-container.mjs";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import * as React$1 from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Cell, Pie, PieChart, ResponsiveContainer } from "recharts";
|
|
9
9
|
//#region src/components/donut-chart.tsx
|
|
10
10
|
const GEOMETRY = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
//#region src/components/dropdown-menu.d.ts
|
|
5
5
|
declare function DropdownMenu({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Root>): React$1.JSX.Element;
|
|
@@ -8,7 +8,7 @@ declare function DropdownMenuTrigger({ ...props }: React$1.ComponentProps<typeof
|
|
|
8
8
|
declare function DropdownMenuContent({ className, sideOffset, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Content>): React$1.JSX.Element;
|
|
9
9
|
declare function DropdownMenuGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Group>): React$1.JSX.Element;
|
|
10
10
|
declare const dropdownMenuItemVariants: (props?: ({
|
|
11
|
-
variant?: "
|
|
11
|
+
variant?: "destructive" | "default" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Item> & VariantProps<typeof dropdownMenuItemVariants> & {
|
|
14
14
|
inset?: boolean;
|
|
@@ -39,6 +39,7 @@ function DropdownMenuGroup({ ...props }) {
|
|
|
39
39
|
}
|
|
40
40
|
const dropdownMenuItemVariants = cva([
|
|
41
41
|
"relative flex cursor-default items-center gap-2 rounded-sm px-2.5 py-2 outline-hidden select-none",
|
|
42
|
+
"max-md:min-h-11",
|
|
42
43
|
"type-text-sm font-semibold",
|
|
43
44
|
"mx-1.5 my-px",
|
|
44
45
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
package/dist/components/form.mjs
CHANGED
|
@@ -7,9 +7,9 @@ import { Input } from "./input.mjs";
|
|
|
7
7
|
import { RadioGroup, RadioGroupItem } from "./radio-group.mjs";
|
|
8
8
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.mjs";
|
|
9
9
|
import { Textarea } from "./textarea.mjs";
|
|
10
|
+
import * as React$1 from "react";
|
|
10
11
|
import { Info } from "lucide-react";
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import * as React$1 from "react";
|
|
13
13
|
import { Slot } from "@radix-ui/react-slot";
|
|
14
14
|
import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
|
|
15
15
|
//#region src/components/form.tsx
|
|
@@ -218,7 +218,7 @@ function RadioField({ control, name, rules, required, label, description, toolti
|
|
|
218
218
|
disabled: option.disabled
|
|
219
219
|
}), /* @__PURE__ */ jsx(Label, {
|
|
220
220
|
htmlFor: itemId,
|
|
221
|
-
className: "type-text-sm font-normal",
|
|
221
|
+
className: "type-text-sm font-normal max-md:-ml-2 max-md:min-h-11 max-md:flex-1 max-md:pl-2",
|
|
222
222
|
children: option.label
|
|
223
223
|
})]
|
|
224
224
|
}, option.value);
|
|
@@ -251,16 +251,17 @@ function ChecklistField({ control, name, rules, required, label, description, to
|
|
|
251
251
|
onBlur: field.onBlur,
|
|
252
252
|
children: options.map((option) => {
|
|
253
253
|
const itemId = `${field.name}-${option.value}`;
|
|
254
|
+
const checked = selected.includes(option.value);
|
|
254
255
|
return /* @__PURE__ */ jsxs("div", {
|
|
255
256
|
className: "flex items-start gap-2",
|
|
256
257
|
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
257
258
|
id: itemId,
|
|
258
|
-
checked
|
|
259
|
+
checked,
|
|
259
260
|
onCheckedChange: (next) => toggle(option.value, Boolean(next)),
|
|
260
261
|
disabled: option.disabled
|
|
261
262
|
}), /* @__PURE__ */ jsx(Label, {
|
|
262
263
|
htmlFor: itemId,
|
|
263
|
-
className: "type-text-sm font-normal leading-tight",
|
|
264
|
+
className: "type-text-sm font-normal leading-tight max-md:-ml-2 max-md:min-h-11 max-md:flex-1 max-md:items-start max-md:pl-2",
|
|
264
265
|
children: option.label
|
|
265
266
|
})]
|
|
266
267
|
}, option.value);
|
|
@@ -287,7 +288,7 @@ function CheckboxField({ control, name, rules, label, description, tooltip }) {
|
|
|
287
288
|
onBlur: field.onBlur
|
|
288
289
|
}) }), label && /* @__PURE__ */ jsx(FormLabel, {
|
|
289
290
|
tooltip,
|
|
290
|
-
className: "font-normal",
|
|
291
|
+
className: "font-normal max-md:-ml-2 max-md:min-h-11 max-md:flex-1 max-md:items-start max-md:pl-2",
|
|
291
292
|
children: label
|
|
292
293
|
})]
|
|
293
294
|
}),
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
3
|
import { HEAT_EMPTY, heatColor, heatRamp } from "../lib/chart-palette.mjs";
|
|
4
4
|
import { useChartContext } from "./chart-container.mjs";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { createPortal } from "react-dom";
|
|
8
8
|
//#region src/components/heatmap-chart.tsx
|
|
9
9
|
const PLACEHOLDER_HEIGHT = 168;
|
|
@@ -85,7 +85,7 @@ function HeatmapChart({ data, xKey, yKey, dataKey = "value", variant = "square",
|
|
|
85
85
|
if (colorScale === "rank") {
|
|
86
86
|
const sorted = [...new Set(cells.map((cell) => cell.value).filter((value) => value > 0))].sort((lower, upper) => lower - upper);
|
|
87
87
|
const RANK_FLOOR = .18;
|
|
88
|
-
const fractionByValue = new Map(sorted.map((value, index) => [value, sorted.length > 1 ? RANK_FLOOR +
|
|
88
|
+
const fractionByValue = new Map(sorted.map((value, index) => [value, sorted.length > 1 ? RANK_FLOOR + .8200000000000001 * (index / (sorted.length - 1)) : 1]));
|
|
89
89
|
return (value) => value > 0 ? fractionByValue.get(value) ?? 0 : 0;
|
|
90
90
|
}
|
|
91
91
|
return (value) => maxValue > 0 ? value / maxValue : 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/input-group.d.ts
|
|
4
4
|
declare function InputGroup({ className, children, ...props }: React$1.ComponentProps<"fieldset">): React$1.JSX.Element;
|
|
5
5
|
declare const inputGroupAddonVariants: (props?: ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
3
|
import { Field } from "./field.mjs";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import * as React$1 from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/input.tsx
|
|
7
7
|
const inputSizeStyles = {
|
|
8
8
|
sm: {
|
|
@@ -45,6 +45,23 @@ function Input({ className, id, label, required, hint, error, tooltip, leadingTe
|
|
|
45
45
|
"aria-describedby": fieldId && (hint || error) ? `${fieldId}-description` : void 0,
|
|
46
46
|
...props
|
|
47
47
|
});
|
|
48
|
+
const wrappedInput = hasAddons ? /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: cn("flex items-center w-full overflow-hidden", sizes.wrapper, "bg-background border border-border rounded-md", "transition-colors", "has-[input:focus-visible]:border-ring has-[input:focus-visible]:border-2", "has-[input:disabled]:bg-disabled has-[input:disabled]:text-disabled-foreground has-[input:disabled]:cursor-not-allowed", error && "border-border-error"),
|
|
50
|
+
children: [
|
|
51
|
+
leadingIcon && /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: cn("flex items-center text-subtle-foreground [&_svg]:shrink-0", sizes.leadingIcon),
|
|
53
|
+
children: leadingIcon
|
|
54
|
+
}),
|
|
55
|
+
leadingText && /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: cn("flex items-center text-subtle-foreground whitespace-nowrap border-r border-border self-stretch", sizes.leadingText),
|
|
57
|
+
children: leadingText
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx("div", {
|
|
60
|
+
className: cn("flex flex-1 items-center min-w-0", sizes.inner),
|
|
61
|
+
children: inputElement
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}) : inputElement;
|
|
48
65
|
return /* @__PURE__ */ jsx(Field, {
|
|
49
66
|
fieldId,
|
|
50
67
|
label,
|
|
@@ -52,23 +69,7 @@ function Input({ className, id, label, required, hint, error, tooltip, leadingTe
|
|
|
52
69
|
hint,
|
|
53
70
|
error,
|
|
54
71
|
tooltip,
|
|
55
|
-
children:
|
|
56
|
-
className: cn("flex items-center w-full overflow-hidden", sizes.wrapper, "bg-background border border-border rounded-md", "transition-colors", "has-[input:focus-visible]:border-ring has-[input:focus-visible]:border-2", "has-[input:disabled]:bg-disabled has-[input:disabled]:text-disabled-foreground has-[input:disabled]:cursor-not-allowed", error && "border-border-error"),
|
|
57
|
-
children: [
|
|
58
|
-
leadingIcon && /* @__PURE__ */ jsx("span", {
|
|
59
|
-
className: cn("flex items-center text-subtle-foreground [&_svg]:shrink-0", sizes.leadingIcon),
|
|
60
|
-
children: leadingIcon
|
|
61
|
-
}),
|
|
62
|
-
leadingText && /* @__PURE__ */ jsx("span", {
|
|
63
|
-
className: cn("flex items-center text-subtle-foreground whitespace-nowrap border-r border-border self-stretch", sizes.leadingText),
|
|
64
|
-
children: leadingText
|
|
65
|
-
}),
|
|
66
|
-
/* @__PURE__ */ jsx("div", {
|
|
67
|
-
className: cn("flex flex-1 items-center min-w-0", sizes.inner),
|
|
68
|
-
children: inputElement
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
}) : inputElement
|
|
72
|
+
children: wrappedInput
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
75
|
//#endregion
|
|
@@ -6,8 +6,8 @@ import { ChartLegend } from "./chart-legend.mjs";
|
|
|
6
6
|
import { computeNumericMax, makeActiveDot, makeChartAxis, makeLastValueLabel, makeLegendItems, renderMarkers, renderReferenceLine } from "./chart-primitives.mjs";
|
|
7
7
|
import { ChartTooltipContent } from "./chart-tooltip.mjs";
|
|
8
8
|
import { Skeleton } from "./skeleton.mjs";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import * as React$1 from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { CartesianGrid, LabelList, Line, LineChart as LineChart$1, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
|
12
12
|
//#region src/components/line-chart.tsx
|
|
13
13
|
const CURVE_TYPE = {
|
|
@@ -6,7 +6,7 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
|
6
6
|
function ScrollArea({ className, children, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
8
8
|
"data-slot": "scroll-area",
|
|
9
|
-
className: cn("relative", className),
|
|
9
|
+
className: cn("relative min-w-0", className),
|
|
10
10
|
...props,
|
|
11
11
|
children: [
|
|
12
12
|
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectTriggerVariants } from "./select-trigger-variants.mjs";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
3
2
|
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
5
|
//#region src/components/select.d.ts
|
|
6
6
|
declare function Select({ ...props }: React$1.ComponentProps<typeof SelectPrimitive.Root>): React$1.JSX.Element;
|
|
@@ -56,7 +56,7 @@ function SelectLabel({ className, ...props }) {
|
|
|
56
56
|
function SelectItem({ className, children, ...props }) {
|
|
57
57
|
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
58
58
|
"data-slot": "select-item",
|
|
59
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pl-2 outline-hidden select-none", "type-text-md font-medium text-foreground mx-1 my-px", "[@media(hover:hover)]:hover:bg-background-hover", "focus:bg-background-hover", "data-[disabled]:pointer-events-none data-[disabled]:text-disabled-foreground", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
59
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pl-2 outline-hidden select-none", "max-md:min-h-11", "type-text-md font-medium text-foreground mx-1 my-px", "[@media(hover:hover)]:hover:bg-background-hover", "focus:bg-background-hover", "data-[disabled]:pointer-events-none data-[disabled]:text-disabled-foreground", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
60
60
|
...props,
|
|
61
61
|
children: [/* @__PURE__ */ jsx("span", {
|
|
62
62
|
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from "./button.mjs";
|
|
2
2
|
import { TooltipContent } from "./tooltip.mjs";
|
|
3
|
-
import { VariantProps } from "class-variance-authority";
|
|
4
3
|
import * as React$1 from "react";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
//#region src/components/sidebar.d.ts
|
|
6
6
|
type SidebarContextProps = {
|
|
7
7
|
state: "expanded" | "collapsed";
|
|
@@ -46,7 +46,7 @@ declare function SidebarMenu({ className, ...props }: React$1.ComponentProps<"ul
|
|
|
46
46
|
declare function SidebarMenuItem({ className, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
47
47
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
48
48
|
variant?: "default" | "outline" | null | undefined;
|
|
49
|
-
size?: "
|
|
49
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
50
50
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
51
51
|
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React$1.ComponentProps<"button"> & {
|
|
52
52
|
asChild?: boolean;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useIsMobile } from "../hooks/use-mobile.mjs";
|
|
2
3
|
import { cn } from "../lib/cn.mjs";
|
|
3
4
|
import { Skeleton } from "./skeleton.mjs";
|
|
4
5
|
import { Button } from "./button.mjs";
|
|
5
6
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.mjs";
|
|
6
7
|
import { Separator } from "./separator.mjs";
|
|
7
8
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.mjs";
|
|
8
|
-
import
|
|
9
|
+
import * as React$1 from "react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
import { cva } from "class-variance-authority";
|
|
11
|
-
import * as React$1 from "react";
|
|
12
12
|
import { Slot } from "@radix-ui/react-slot";
|
|
13
13
|
//#region src/components/sidebar.tsx
|
|
14
14
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
15
|
-
const SIDEBAR_COOKIE_MAX_AGE =
|
|
15
|
+
const SIDEBAR_COOKIE_MAX_AGE = 604800;
|
|
16
16
|
const SIDEBAR_WIDTH = "15rem";
|
|
17
17
|
const SIDEBAR_WIDTH_MOBILE = "16rem";
|
|
18
18
|
const SIDEBAR_WIDTH_ICON = "3.5rem";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
//#region src/components/spinner.d.ts
|
|
3
3
|
declare const spinnerVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "primary" | "secondary" | null | undefined;
|
|
5
5
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
interface SpinnerProps extends Omit<React.ComponentProps<"svg">, "children">, VariantProps<typeof spinnerVariants> {}
|
package/dist/components/stat.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
3
|
import { useChartContext } from "./chart-container.mjs";
|
|
4
|
+
import * as React$1 from "react";
|
|
4
5
|
import { ArrowDown, ArrowUp } from "lucide-react";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { cva } from "class-variance-authority";
|
|
7
|
-
import * as React$1 from "react";
|
|
8
8
|
import { Area, AreaChart, ResponsiveContainer } from "recharts";
|
|
9
9
|
//#region src/components/stat.tsx
|
|
10
10
|
const statDeltaVariants = cva("inline-flex items-center gap-0.5 rounded-md px-2 py-1 font-mono text-xs font-medium leading-none", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
//#region src/components/status-dot.d.ts
|
|
3
3
|
declare const statusDotVariants: (props?: ({
|
|
4
|
-
variant?: "destructive" | "
|
|
4
|
+
variant?: "destructive" | "success" | "warning" | "muted" | null | undefined;
|
|
5
5
|
pulse?: boolean | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
interface StatusDotProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof statusDotVariants> {}
|
|
@@ -6,7 +6,7 @@ import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
|
6
6
|
function Switch({ className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(SwitchPrimitive.Root, {
|
|
8
8
|
"data-slot": "switch",
|
|
9
|
-
className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full p-0.5", "bg-subtle data-[state=checked]:not-disabled:bg-primary", "transition-colors", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:pointer-events-none disabled:opacity-50", className),
|
|
9
|
+
className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full p-0.5", "max-md:relative max-md:before:absolute max-md:before:top-1/2 max-md:before:left-1/2 max-md:before:size-11 max-md:before:-translate-x-1/2 max-md:before:-translate-y-1/2 max-md:before:content-['']", "bg-subtle data-[state=checked]:not-disabled:bg-primary", "transition-colors", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:pointer-events-none disabled:opacity-50", className),
|
|
10
10
|
...props,
|
|
11
11
|
children: /* @__PURE__ */ jsx(SwitchPrimitive.Thumb, {
|
|
12
12
|
"data-slot": "switch-thumb",
|
|
@@ -43,14 +43,14 @@ function TableRow({ className, ...props }) {
|
|
|
43
43
|
function TableHead({ className, ...props }) {
|
|
44
44
|
return /* @__PURE__ */ jsx("th", {
|
|
45
45
|
"data-slot": "table-head",
|
|
46
|
-
className: cn("h-11 px-6 py-3 bg-muted text-left align-middle type-text-xs font-semibold text-placeholder dark:text-subtle-foreground whitespace-nowrap", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0", className),
|
|
46
|
+
className: cn("h-11 px-6 max-md:px-3 py-3 bg-muted text-left align-middle type-text-xs font-semibold text-placeholder dark:text-subtle-foreground whitespace-nowrap", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0", className),
|
|
47
47
|
...props
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
function TableCell({ className, interactive = false, ...props }) {
|
|
51
51
|
return /* @__PURE__ */ jsx("td", {
|
|
52
52
|
"data-slot": "table-cell",
|
|
53
|
-
className: cn("align-middle", interactive ? "h-px p-0" : "px-6 py-2", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0", className),
|
|
53
|
+
className: cn("align-middle", interactive ? "h-px p-0" : "px-6 max-md:px-3 py-2", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0", className),
|
|
54
54
|
...props
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4
4
|
//#region src/components/tabs.d.ts
|
|
5
5
|
declare const tabsTriggerVariants: (props?: ({
|
package/dist/components/tabs.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import { createContext, use } from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import { createContext, use } from "react";
|
|
6
6
|
import { Slot } from "@radix-ui/react-slot";
|
|
7
7
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
8
8
|
//#region src/components/tabs.tsx
|
|
@@ -15,13 +15,13 @@ const tabsTriggerVariants = cva([
|
|
|
15
15
|
variants: { variant: {
|
|
16
16
|
default: ["rounded-md border border-transparent px-2 py-1", "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"],
|
|
17
17
|
line: [
|
|
18
|
-
"h-8 pb-3 px-1",
|
|
18
|
+
"h-8 max-md:min-h-11 pb-3 px-1",
|
|
19
19
|
"text-quaternary-foreground",
|
|
20
20
|
"[@media(hover:hover)]:hover:text-muted-foreground-hover",
|
|
21
21
|
"data-[state=active]:border-b-2 data-[state=active]:border-foreground data-[state=active]:text-foreground"
|
|
22
22
|
],
|
|
23
23
|
pill: [
|
|
24
|
-
"rounded-md px-2 py-1.5",
|
|
24
|
+
"rounded-md max-md:min-h-11 px-2 py-1.5",
|
|
25
25
|
"text-quaternary-foreground",
|
|
26
26
|
"[@media(hover:hover)]:hover:bg-accent [@media(hover:hover)]:hover:text-muted-foreground",
|
|
27
27
|
"data-[state=active]:bg-accent data-[state=active]:text-muted-foreground"
|
|
@@ -41,7 +41,7 @@ function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
|
41
41
|
const TabsListVariantContext = createContext("default");
|
|
42
42
|
const tabsListVariants = cva("inline-flex w-fit items-center justify-center text-muted-foreground group-data-[orientation=vertical]/tabs:flex-col", {
|
|
43
43
|
variants: { variant: {
|
|
44
|
-
default: "rounded-lg bg-muted p-[3px] group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:bg-transparent group-data-[orientation=vertical]/tabs:p-0 group-data-[orientation=vertical]/tabs:rounded-none",
|
|
44
|
+
default: "rounded-lg bg-muted p-[3px] group-data-[orientation=horizontal]/tabs:h-9 max-md:group-data-[orientation=horizontal]/tabs:h-11 group-data-[orientation=vertical]/tabs:bg-transparent group-data-[orientation=vertical]/tabs:p-0 group-data-[orientation=vertical]/tabs:rounded-none",
|
|
45
45
|
line: "gap-3 rounded-none bg-transparent border-b border-subtle group-data-[orientation=horizontal]/tabs:flex-wrap"
|
|
46
46
|
} },
|
|
47
47
|
defaultVariants: { variant: "default" }
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
3
|
import { Field } from "./field.mjs";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import * as React$1 from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/textarea.tsx
|
|
7
7
|
function Textarea({ className, id, label, required, hint, error, tooltip, ...props }) {
|
|
8
8
|
const generatedId = React$1.useId();
|
|
9
9
|
const fieldId = id ?? generatedId;
|
|
10
|
+
const textarea = /* @__PURE__ */ jsx("textarea", {
|
|
11
|
+
id: fieldId,
|
|
12
|
+
"data-slot": "textarea",
|
|
13
|
+
className: cn("block w-full min-h-[120px] max-h-[480px] resize-y [field-sizing:content]", "px-3.5 py-3", "type-text-md text-foreground placeholder:text-placeholder", "bg-background border border-border rounded-md", "transition-colors", "outline-none focus-visible:border-ring focus-visible:border-2", "disabled:bg-disabled disabled:text-disabled-foreground disabled:cursor-not-allowed", "aria-invalid:border-border-error [@media(hover:hover)]:aria-invalid:hover:border-border-error", error && "border-border-error [@media(hover:hover)]:hover:border-border-error", className),
|
|
14
|
+
required,
|
|
15
|
+
"aria-invalid": error ? true : void 0,
|
|
16
|
+
"aria-describedby": fieldId && (hint || error) ? `${fieldId}-description` : void 0,
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
10
19
|
return /* @__PURE__ */ jsx(Field, {
|
|
11
20
|
fieldId,
|
|
12
21
|
label,
|
|
@@ -14,15 +23,7 @@ function Textarea({ className, id, label, required, hint, error, tooltip, ...pro
|
|
|
14
23
|
hint,
|
|
15
24
|
error,
|
|
16
25
|
tooltip,
|
|
17
|
-
children:
|
|
18
|
-
id: fieldId,
|
|
19
|
-
"data-slot": "textarea",
|
|
20
|
-
className: cn("block w-full min-h-[120px] max-h-[480px] resize-y [field-sizing:content]", "px-3.5 py-3", "type-text-md text-foreground placeholder:text-placeholder", "bg-background border border-border rounded-md", "transition-colors", "outline-none focus-visible:border-ring focus-visible:border-2", "disabled:bg-disabled disabled:text-disabled-foreground disabled:cursor-not-allowed", "aria-invalid:border-border-error [@media(hover:hover)]:aria-invalid:hover:border-border-error", error && "border-border-error [@media(hover:hover)]:hover:border-border-error", className),
|
|
21
|
-
required,
|
|
22
|
-
"aria-invalid": error ? true : void 0,
|
|
23
|
-
"aria-describedby": fieldId && (hint || error) ? `${fieldId}-description` : void 0,
|
|
24
|
-
...props
|
|
25
|
-
})
|
|
26
|
+
children: textarea
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4
4
|
//#region src/components/toggle-group.d.ts
|
|
5
5
|
declare const toggleGroupItemVariants: (props?: ({
|
|
6
6
|
variant?: "default" | "outline" | null | undefined;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "sm" | "default" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type ToggleGroupContextValue = VariantProps<typeof toggleGroupItemVariants>;
|
|
10
10
|
declare function ToggleGroup({ className, variant, size, children, ...props }: React$1.ComponentProps<typeof ToggleGroupPrimitive.Root> & ToggleGroupContextValue): React$1.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
|
+
import * as React$1 from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import * as React$1 from "react";
|
|
6
6
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
7
7
|
//#region src/components/toggle-group.tsx
|
|
8
8
|
const toggleGroupItemVariants = cva([
|
|
@@ -27,8 +27,8 @@ const toggleGroupItemVariants = cva([
|
|
|
27
27
|
].join(" ")
|
|
28
28
|
},
|
|
29
29
|
size: {
|
|
30
|
-
default: "h-8 px-2 min-w-8",
|
|
31
|
-
sm: "h-7 px-1.5 min-w-7"
|
|
30
|
+
default: "h-8 max-md:min-h-11 px-2 min-w-8",
|
|
31
|
+
sm: "h-7 max-md:min-h-11 px-1.5 min-w-7"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
defaultVariants: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Button } from "./button.mjs";
|
|
3
3
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.mjs";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Slottable } from "@radix-ui/react-slot";
|
|
7
7
|
//#region src/components/tooltip-icon-button.tsx
|
|
8
8
|
const TooltipIconButton = forwardRef(({ children, tooltip, side = "bottom", ...rest }, ref) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
//#region src/hooks/use-mobile.ts
|
|
3
|
-
const MOBILE_BREAKPOINT = 768;
|
|
4
3
|
function useIsMobile() {
|
|
5
4
|
const [isMobile, setIsMobile] = React$1.useState(void 0);
|
|
6
5
|
React$1.useEffect(() => {
|
|
7
|
-
const mql = window.matchMedia(`(max-width:
|
|
6
|
+
const mql = window.matchMedia(`(max-width: 767px)`);
|
|
8
7
|
const onChange = () => setIsMobile(mql.matches);
|
|
9
8
|
mql.addEventListener("change", onChange);
|
|
10
9
|
setIsMobile(mql.matches);
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"
|
|
|
31
31
|
data-slot="breadcrumb-link"
|
|
32
32
|
className={cn(
|
|
33
33
|
"type-text-sm font-medium text-subtle-foreground transition-colors [@media(hover:hover)]:hover:text-muted-foreground",
|
|
34
|
+
"inline-flex items-center max-md:min-h-11",
|
|
34
35
|
className,
|
|
35
36
|
)}
|
|
36
37
|
{...props}
|
|
@@ -11,6 +11,7 @@ const buttonVariants = cva(
|
|
|
11
11
|
[
|
|
12
12
|
"inline-flex items-center justify-center gap-1 whitespace-nowrap",
|
|
13
13
|
"h-8 px-2 rounded-md",
|
|
14
|
+
"max-md:min-h-11",
|
|
14
15
|
"font-medium",
|
|
15
16
|
"transition-colors",
|
|
16
17
|
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
@@ -31,13 +32,13 @@ const buttonVariants = cva(
|
|
|
31
32
|
"focus-visible:bg-background",
|
|
32
33
|
].join(" "),
|
|
33
34
|
link: [
|
|
34
|
-
"h-auto px-0 rounded-xs underline-offset-4",
|
|
35
|
+
"h-auto max-md:min-h-0 px-0 rounded-xs underline-offset-4",
|
|
35
36
|
"text-link",
|
|
36
37
|
"[@media(hover:hover)]:hover:underline",
|
|
37
38
|
"focus-visible:bg-background",
|
|
38
39
|
].join(" "),
|
|
39
40
|
"link-muted": [
|
|
40
|
-
"h-auto px-0 rounded-xs underline-offset-4",
|
|
41
|
+
"h-auto max-md:min-h-0 px-0 rounded-xs underline-offset-4",
|
|
41
42
|
"text-link-muted",
|
|
42
43
|
"[@media(hover:hover)]:hover:underline",
|
|
43
44
|
"focus-visible:bg-background",
|
|
@@ -56,8 +57,8 @@ const buttonVariants = cva(
|
|
|
56
57
|
},
|
|
57
58
|
size: {
|
|
58
59
|
default: "type-text-sm",
|
|
59
|
-
icon: "size-8 p-0 type-text-sm",
|
|
60
|
-
"icon-rounded": "size-8 p-0 rounded-full type-text-sm",
|
|
60
|
+
icon: "size-8 max-md:min-w-11 p-0 type-text-sm",
|
|
61
|
+
"icon-rounded": "size-8 max-md:min-w-11 p-0 rounded-full type-text-sm",
|
|
61
62
|
pill: "h-7 px-3 rounded-full type-text-xs",
|
|
62
63
|
},
|
|
63
64
|
},
|
|
@@ -77,6 +77,7 @@ function DialogContent({ className, children, size, showCloseButton = true, ...p
|
|
|
77
77
|
data-slot="dialog-close"
|
|
78
78
|
className={cn(
|
|
79
79
|
"absolute top-3 right-4 flex size-8 items-center justify-center rounded-md",
|
|
80
|
+
"max-md:before:absolute max-md:before:top-1/2 max-md:before:left-1/2 max-md:before:size-11 max-md:before:-translate-x-1/2 max-md:before:-translate-y-1/2 max-md:before:content-['']",
|
|
80
81
|
"text-subtle-foreground transition-colors",
|
|
81
82
|
"[@media(hover:hover)]:hover:text-foreground",
|
|
82
83
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
@@ -54,6 +54,7 @@ function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMen
|
|
|
54
54
|
const dropdownMenuItemVariants = cva(
|
|
55
55
|
[
|
|
56
56
|
"relative flex cursor-default items-center gap-2 rounded-sm px-2.5 py-2 outline-hidden select-none",
|
|
57
|
+
"max-md:min-h-11",
|
|
57
58
|
"type-text-sm font-semibold",
|
|
58
59
|
"mx-1.5 my-px",
|
|
59
60
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
package/src/components/form.tsx
CHANGED
|
@@ -362,7 +362,10 @@ function RadioField<TFieldValues extends FieldValues, TName extends FieldPath<TF
|
|
|
362
362
|
return (
|
|
363
363
|
<div key={option.value} className="flex items-center gap-2">
|
|
364
364
|
<RadioGroupItem id={itemId} value={option.value} disabled={option.disabled} />
|
|
365
|
-
<Label
|
|
365
|
+
<Label
|
|
366
|
+
htmlFor={itemId}
|
|
367
|
+
className="type-text-sm font-normal max-md:-ml-2 max-md:min-h-11 max-md:flex-1 max-md:pl-2"
|
|
368
|
+
>
|
|
366
369
|
{option.label}
|
|
367
370
|
</Label>
|
|
368
371
|
</div>
|
|
@@ -427,7 +430,10 @@ function ChecklistField<TFieldValues extends FieldValues, TName extends FieldPat
|
|
|
427
430
|
onCheckedChange={(next) => toggle(option.value, Boolean(next))}
|
|
428
431
|
disabled={option.disabled}
|
|
429
432
|
/>
|
|
430
|
-
<Label
|
|
433
|
+
<Label
|
|
434
|
+
htmlFor={itemId}
|
|
435
|
+
className="type-text-sm font-normal leading-tight max-md:-ml-2 max-md:min-h-11 max-md:flex-1 max-md:items-start max-md:pl-2"
|
|
436
|
+
>
|
|
431
437
|
{option.label}
|
|
432
438
|
</Label>
|
|
433
439
|
</div>
|
|
@@ -470,7 +476,10 @@ function CheckboxField<TFieldValues extends FieldValues, TName extends FieldPath
|
|
|
470
476
|
/>
|
|
471
477
|
</FormControl>
|
|
472
478
|
{label && (
|
|
473
|
-
<FormLabel
|
|
479
|
+
<FormLabel
|
|
480
|
+
tooltip={tooltip}
|
|
481
|
+
className="font-normal max-md:-ml-2 max-md:min-h-11 max-md:flex-1 max-md:items-start max-md:pl-2"
|
|
482
|
+
>
|
|
474
483
|
{label}
|
|
475
484
|
</FormLabel>
|
|
476
485
|
)}
|
|
@@ -7,7 +7,7 @@ import { cn } from "../lib/cn";
|
|
|
7
7
|
|
|
8
8
|
function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
9
9
|
return (
|
|
10
|
-
<ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn("relative", className)} {...props}>
|
|
10
|
+
<ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn("relative min-w-0", className)} {...props}>
|
|
11
11
|
<ScrollAreaPrimitive.Viewport
|
|
12
12
|
data-slot="scroll-area-viewport"
|
|
13
13
|
className="size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring"
|
|
@@ -101,6 +101,7 @@ function SelectItem({ className, children, ...props }: React.ComponentProps<type
|
|
|
101
101
|
data-slot="select-item"
|
|
102
102
|
className={cn(
|
|
103
103
|
"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pl-2 outline-hidden select-none",
|
|
104
|
+
"max-md:min-h-11",
|
|
104
105
|
"type-text-md font-medium text-foreground mx-1 my-px",
|
|
105
106
|
"[@media(hover:hover)]:hover:bg-background-hover",
|
|
106
107
|
"focus:bg-background-hover",
|
|
@@ -11,6 +11,7 @@ function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimi
|
|
|
11
11
|
data-slot="switch"
|
|
12
12
|
className={cn(
|
|
13
13
|
"peer inline-flex h-5 w-9 shrink-0 items-center rounded-full p-0.5",
|
|
14
|
+
"max-md:relative max-md:before:absolute max-md:before:top-1/2 max-md:before:left-1/2 max-md:before:size-11 max-md:before:-translate-x-1/2 max-md:before:-translate-y-1/2 max-md:before:content-['']",
|
|
14
15
|
"bg-subtle data-[state=checked]:not-disabled:bg-primary",
|
|
15
16
|
"transition-colors",
|
|
16
17
|
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
package/src/components/table.tsx
CHANGED
|
@@ -65,7 +65,7 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
|
65
65
|
<th
|
|
66
66
|
data-slot="table-head"
|
|
67
67
|
className={cn(
|
|
68
|
-
"h-11 px-6 py-3 bg-muted text-left align-middle type-text-xs font-semibold text-placeholder dark:text-subtle-foreground whitespace-nowrap",
|
|
68
|
+
"h-11 px-6 max-md:px-3 py-3 bg-muted text-left align-middle type-text-xs font-semibold text-placeholder dark:text-subtle-foreground whitespace-nowrap",
|
|
69
69
|
"[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0",
|
|
70
70
|
className,
|
|
71
71
|
)}
|
|
@@ -85,7 +85,7 @@ function TableCell({ className, interactive = false, ...props }: TableCellProps)
|
|
|
85
85
|
data-slot="table-cell"
|
|
86
86
|
className={cn(
|
|
87
87
|
"align-middle",
|
|
88
|
-
interactive ? "h-px p-0" : "px-6 py-2",
|
|
88
|
+
interactive ? "h-px p-0" : "px-6 max-md:px-3 py-2",
|
|
89
89
|
"[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:px-0",
|
|
90
90
|
className,
|
|
91
91
|
)}
|
package/src/components/tabs.tsx
CHANGED
|
@@ -25,13 +25,13 @@ const tabsTriggerVariants = cva(
|
|
|
25
25
|
"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
26
26
|
],
|
|
27
27
|
line: [
|
|
28
|
-
"h-8 pb-3 px-1",
|
|
28
|
+
"h-8 max-md:min-h-11 pb-3 px-1",
|
|
29
29
|
"text-quaternary-foreground",
|
|
30
30
|
"[@media(hover:hover)]:hover:text-muted-foreground-hover",
|
|
31
31
|
"data-[state=active]:border-b-2 data-[state=active]:border-foreground data-[state=active]:text-foreground",
|
|
32
32
|
],
|
|
33
33
|
pill: [
|
|
34
|
-
"rounded-md px-2 py-1.5",
|
|
34
|
+
"rounded-md max-md:min-h-11 px-2 py-1.5",
|
|
35
35
|
"text-quaternary-foreground",
|
|
36
36
|
"[@media(hover:hover)]:hover:bg-accent [@media(hover:hover)]:hover:text-muted-foreground",
|
|
37
37
|
"data-[state=active]:bg-accent data-[state=active]:text-muted-foreground",
|
|
@@ -71,7 +71,7 @@ const tabsListVariants = cva(
|
|
|
71
71
|
variants: {
|
|
72
72
|
variant: {
|
|
73
73
|
default:
|
|
74
|
-
"rounded-lg bg-muted p-[3px] group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:bg-transparent group-data-[orientation=vertical]/tabs:p-0 group-data-[orientation=vertical]/tabs:rounded-none",
|
|
74
|
+
"rounded-lg bg-muted p-[3px] group-data-[orientation=horizontal]/tabs:h-9 max-md:group-data-[orientation=horizontal]/tabs:h-11 group-data-[orientation=vertical]/tabs:bg-transparent group-data-[orientation=vertical]/tabs:p-0 group-data-[orientation=vertical]/tabs:rounded-none",
|
|
75
75
|
line: "gap-3 rounded-none bg-transparent border-b border-subtle group-data-[orientation=horizontal]/tabs:flex-wrap",
|
|
76
76
|
},
|
|
77
77
|
},
|
|
@@ -183,7 +183,6 @@ function TabsNavTrigger({
|
|
|
183
183
|
className={cn(
|
|
184
184
|
tabsTriggerVariants({ variant }),
|
|
185
185
|
"flex transition-colors",
|
|
186
|
-
// TODO(mobile): line h-8 (32px) is below 44px touch target minimum — desktop-primary nav per Figma spec
|
|
187
186
|
variant === "line" && "cursor-pointer",
|
|
188
187
|
className,
|
|
189
188
|
)}
|
|
@@ -30,8 +30,8 @@ const toggleGroupItemVariants = cva(
|
|
|
30
30
|
].join(" "),
|
|
31
31
|
},
|
|
32
32
|
size: {
|
|
33
|
-
default: "h-8 px-2 min-w-8",
|
|
34
|
-
sm: "h-7 px-1.5 min-w-7",
|
|
33
|
+
default: "h-8 max-md:min-h-11 px-2 min-w-8",
|
|
34
|
+
sm: "h-7 max-md:min-h-11 px-1.5 min-w-7",
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|