@schemavaults/ui 0.73.0 → 0.75.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.
@@ -0,0 +1,66 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type { HTMLAttributes, ReactElement, Ref } from "react";
3
+ export declare const descriptionListLayoutIds: ["stacked", "inline", "grid", "responsive"];
4
+ export type DescriptionListLayoutId = (typeof descriptionListLayoutIds)[number];
5
+ export declare const descriptionListSizeIds: ["sm", "md", "lg"];
6
+ export type DescriptionListSizeId = (typeof descriptionListSizeIds)[number];
7
+ export declare const descriptionListVariantIds: ["default", "card", "muted"];
8
+ export type DescriptionListVariantId = (typeof descriptionListVariantIds)[number];
9
+ declare const descriptionListVariants: (props?: ({
10
+ variant?: "default" | "muted" | "card" | null | undefined;
11
+ size?: "sm" | "lg" | "md" | null | undefined;
12
+ padded?: boolean | null | undefined;
13
+ divided?: boolean | null | undefined;
14
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
+ export interface DescriptionListProps extends HTMLAttributes<HTMLDListElement>, Omit<VariantProps<typeof descriptionListVariants>, "padded" | "divided"> {
16
+ /**
17
+ * Controls how each term/details pair is laid out.
18
+ * - `stacked`: dt above dd (default)
19
+ * - `inline`: dt and dd on the same row
20
+ * - `grid`: 1/3 + 2/3 grid columns on all sizes
21
+ * - `responsive`: stacked on mobile, grid on `sm:` and up
22
+ */
23
+ layout?: DescriptionListLayoutId;
24
+ /**
25
+ * Adds horizontal padding so the list sits nicely inside `card`/`muted`
26
+ * containers. Defaults to true when `variant` is `card` or `muted`.
27
+ */
28
+ padded?: boolean;
29
+ /** Add a thin divider between consecutive items. */
30
+ divided?: boolean;
31
+ ref?: Ref<HTMLDListElement>;
32
+ }
33
+ declare function DescriptionList({ className, variant, size, layout, padded, divided, ref, ...props }: DescriptionListProps): ReactElement;
34
+ declare namespace DescriptionList {
35
+ var displayName: string;
36
+ }
37
+ declare const descriptionItemVariants: (props?: ({
38
+ layout?: "grid" | "inline" | "stacked" | "responsive" | null | undefined;
39
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
40
+ export interface DescriptionItemProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof descriptionItemVariants> {
41
+ ref?: Ref<HTMLDivElement>;
42
+ }
43
+ declare function DescriptionItem({ className, layout, ref, ...props }: DescriptionItemProps): ReactElement;
44
+ declare namespace DescriptionItem {
45
+ var displayName: string;
46
+ }
47
+ export interface DescriptionTermProps extends HTMLAttributes<HTMLElement> {
48
+ ref?: Ref<HTMLElement>;
49
+ }
50
+ declare function DescriptionTerm({ className, ref, ...props }: DescriptionTermProps): ReactElement;
51
+ declare namespace DescriptionTerm {
52
+ var displayName: string;
53
+ }
54
+ export interface DescriptionDetailsProps extends HTMLAttributes<HTMLElement> {
55
+ /**
56
+ * When true, render a skeleton placeholder in place of the value. Useful for
57
+ * async data fetches where the term is known but the value is still loading.
58
+ */
59
+ loading?: boolean;
60
+ ref?: Ref<HTMLElement>;
61
+ }
62
+ declare function DescriptionDetails({ className, loading, children, ref, ...props }: DescriptionDetailsProps): ReactElement;
63
+ declare namespace DescriptionDetails {
64
+ var displayName: string;
65
+ }
66
+ export { DescriptionList, DescriptionItem, DescriptionTerm, DescriptionDetails, descriptionListVariants, descriptionItemVariants, };
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../../../lib/utils";
5
+ import { Skeleton } from "../skeleton/skeleton";
6
+ export const descriptionListLayoutIds = [
7
+ "stacked",
8
+ "inline",
9
+ "grid",
10
+ "responsive",
11
+ ];
12
+ export const descriptionListSizeIds = ["sm", "md", "lg"];
13
+ export const descriptionListVariantIds = [
14
+ "default",
15
+ "card",
16
+ "muted",
17
+ ];
18
+ const descriptionListVariants = cva("w-full text-foreground", {
19
+ variants: {
20
+ variant: {
21
+ default: "",
22
+ card: "rounded-lg border border-border bg-card text-card-foreground shadow-sm",
23
+ muted: "rounded-lg bg-muted/40",
24
+ },
25
+ size: {
26
+ sm: "text-xs [&_dt]:text-xs [&_dd]:text-xs",
27
+ md: "text-sm [&_dt]:text-sm [&_dd]:text-sm",
28
+ lg: "text-base [&_dt]:text-base [&_dd]:text-base",
29
+ },
30
+ padded: {
31
+ true: "",
32
+ false: "",
33
+ },
34
+ divided: {
35
+ true: "[&>*+*]:border-t [&>*+*]:border-border",
36
+ false: "",
37
+ },
38
+ },
39
+ compoundVariants: [
40
+ { variant: "card", padded: true, class: "px-4 py-2" },
41
+ { variant: "muted", padded: true, class: "px-4 py-2" },
42
+ { variant: "default", padded: true, class: "py-1" },
43
+ ],
44
+ defaultVariants: {
45
+ variant: "default",
46
+ size: "md",
47
+ padded: false,
48
+ divided: false,
49
+ },
50
+ });
51
+ function DescriptionList({ className, variant = "default", size = "md", layout = "stacked", padded, divided = false, ref, ...props }) {
52
+ const resolvedPadded = padded ?? (variant === "card" || variant === "muted");
53
+ return (_jsx("dl", { ref: ref, "data-slot": "description-list", "data-layout": layout, "data-variant": variant ?? "default", className: cn(descriptionListVariants({
54
+ variant,
55
+ size,
56
+ padded: resolvedPadded,
57
+ divided,
58
+ }), className), ...props }));
59
+ }
60
+ DescriptionList.displayName = "DescriptionList";
61
+ const descriptionItemVariants = cva("", {
62
+ variants: {
63
+ layout: {
64
+ stacked: "flex flex-col gap-1 py-2",
65
+ inline: "flex flex-row items-baseline justify-between gap-4 py-2",
66
+ grid: "grid grid-cols-3 gap-4 py-2",
67
+ responsive: "flex flex-col gap-1 py-2 sm:grid sm:grid-cols-3 sm:gap-4",
68
+ },
69
+ },
70
+ defaultVariants: {
71
+ layout: "stacked",
72
+ },
73
+ });
74
+ function DescriptionItem({ className, layout, ref, ...props }) {
75
+ return (_jsx("div", { ref: ref, "data-slot": "description-item", className: cn(descriptionItemVariants({ layout }), className), ...props }));
76
+ }
77
+ DescriptionItem.displayName = "DescriptionItem";
78
+ function DescriptionTerm({ className, ref, ...props }) {
79
+ return (_jsx("dt", { ref: ref, "data-slot": "description-term", className: cn("font-medium text-muted-foreground leading-snug", className), ...props }));
80
+ }
81
+ DescriptionTerm.displayName = "DescriptionTerm";
82
+ function DescriptionDetails({ className, loading = false, children, ref, ...props }) {
83
+ return (_jsx("dd", { ref: ref, "data-slot": "description-details", className: cn("text-foreground leading-snug sm:col-span-2", className), ...props, children: loading ? (_jsx(Skeleton, { "data-slot": "description-details-skeleton", className: "h-4 w-32" })) : (children) }));
84
+ }
85
+ DescriptionDetails.displayName = "DescriptionDetails";
86
+ export { DescriptionList, DescriptionItem, DescriptionTerm, DescriptionDetails, descriptionListVariants, descriptionItemVariants, };
87
+ //# sourceMappingURL=description-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"description-list.js","sourceRoot":"","sources":["../../../../src/components/ui/description-list/description-list.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS;IACT,QAAQ;IACR,MAAM;IACN,YAAY;CACe,CAAC;AAI9B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAA6B,CAAC;AAIrF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS;IACT,MAAM;IACN,OAAO;CACoB,CAAC;AAI9B,MAAM,uBAAuB,GAAG,GAAG,CAAC,wBAAwB,EAAE;IAC5D,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,wEAAwE;YAC9E,KAAK,EAAE,wBAAwB;SACmB;QACpD,IAAI,EAAE;YACJ,EAAE,EAAE,uCAAuC;YAC3C,EAAE,EAAE,uC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ACf,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { DescriptionList, DescriptionItem, DescriptionTerm, DescriptionDetails, descriptionListVariants, descriptionItemVariants, descriptionListLayoutIds, descriptionListSizeIds, descriptionListVariantIds, } from "./description-list";
2
+ export type { DescriptionListProps, DescriptionItemProps, DescriptionTermProps, DescriptionDetailsProps, DescriptionListLayoutId, DescriptionListSizeId, DescriptionListVariantId, } from "./description-list";
3
+ export { DescriptionList as default } from "./description-list";
@@ -0,0 +1,3 @@
1
+ export { DescriptionList, DescriptionItem, DescriptionTerm, DescriptionDetails, descriptionListVariants, descriptionItemVariants, descriptionListLayoutIds, descriptionListSizeIds, descriptionListVariantIds, } from "./description-list";
2
+ export { DescriptionList as default } from "./description-list";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/description-list/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAW5B,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const httpMethodIds: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD", "TRACE", "CONNECT"];
2
+ export type HttpMethod = (typeof httpMethodIds)[number];
3
+ export declare const httpMethodBadgeAppearanceIds: readonly ["solid", "soft", "outline"];
4
+ export type HttpMethodBadgeAppearance = (typeof httpMethodBadgeAppearanceIds)[number];
5
+ export declare const httpMethodBadgeSizeIds: readonly ["sm", "md", "lg"];
6
+ export type HttpMethodBadgeSize = (typeof httpMethodBadgeSizeIds)[number];
@@ -0,0 +1,22 @@
1
+ export const httpMethodIds = [
2
+ "GET",
3
+ "POST",
4
+ "PUT",
5
+ "PATCH",
6
+ "DELETE",
7
+ "OPTIONS",
8
+ "HEAD",
9
+ "TRACE",
10
+ "CONNECT",
11
+ ];
12
+ export const httpMethodBadgeAppearanceIds = [
13
+ "solid",
14
+ "soft",
15
+ "outline",
16
+ ];
17
+ export const httpMethodBadgeSizeIds = [
18
+ "sm",
19
+ "md",
20
+ "lg",
21
+ ];
22
+ //# sourceMappingURL=http-method-badge-variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-method-badge-variants.js","sourceRoot":"","sources":["../../../../src/components/ui/http-method-badge/http-method-badge-variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK;IACL,MAAM;IACN,KAAK;IACL,OAAO;IACP,QAAQ;IACR,SAAS;IACT,MAAM;IACN,OAAO;IACP,SAAS;CAC2B,CAAC;AAGvC,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,OAAO;IACP,MAAM;IACN,SAAS;CAC2B,CAAC;AAIvC,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI;IACJ,IAAI;IACJ,IAAI;CACgC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type { ComponentProps, ReactElement, Ref } from "react";
3
+ import { httpMethodBadgeAppearanceIds, httpMethodBadgeSizeIds, httpMethodIds, type HttpMethod, type HttpMethodBadgeAppearance, type HttpMethodBadgeSize } from "./http-method-badge-variants";
4
+ /**
5
+ * Color palette per HTTP method. Each method maps to its own semantic colour
6
+ * across the three appearance modes (solid / soft / outline). Theme tokens
7
+ * (`primary`, `destructive`, `warning`, `muted`) are preferred where the
8
+ * semantics line up; the remaining methods use Tailwind colour primitives so
9
+ * they still adapt to light/dark mode.
10
+ */
11
+ declare const httpMethodColors: Record<HttpMethod, Record<HttpMethodBadgeAppearance, string>>;
12
+ declare const httpMethodBadgeVariants: (props?: ({
13
+ size?: "sm" | "lg" | "md" | null | undefined;
14
+ width?: "auto" | "fixed" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ type CvaRootProps = VariantProps<typeof httpMethodBadgeVariants>;
17
+ export interface HttpMethodBadgeProps extends Omit<ComponentProps<"span">, "children">, Omit<CvaRootProps, "width"> {
18
+ /** HTTP method to render. Case-insensitive — always rendered upper-case. */
19
+ method: HttpMethod | Lowercase<HttpMethod>;
20
+ /** Colour intensity. `soft` (default) is best for dense lists; `solid` for emphasis. */
21
+ appearance?: HttpMethodBadgeAppearance;
22
+ /**
23
+ * When `fixed`, the badge takes a constant width so methods stack neatly
24
+ * in endpoint lists. Defaults to `auto`.
25
+ */
26
+ width?: "auto" | "fixed";
27
+ /** Override the label rendered inside the badge. Defaults to the method name. */
28
+ label?: string;
29
+ ref?: Ref<HTMLSpanElement>;
30
+ }
31
+ declare function HttpMethodBadge({ className, method, appearance, size, width, label, ref, ...props }: HttpMethodBadgeProps): ReactElement;
32
+ declare namespace HttpMethodBadge {
33
+ var displayName: string;
34
+ }
35
+ export { HttpMethodBadge, httpMethodBadgeVariants, httpMethodColors, httpMethodIds, httpMethodBadgeAppearanceIds, httpMethodBadgeSizeIds, };
36
+ export type { HttpMethod, HttpMethodBadgeAppearance, HttpMethodBadgeSize };
37
+ export default HttpMethodBadge;
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../../../lib/utils";
5
+ import { httpMethodBadgeAppearanceIds, httpMethodBadgeSizeIds, httpMethodIds, } from "./http-method-badge-variants";
6
+ /**
7
+ * Color palette per HTTP method. Each method maps to its own semantic colour
8
+ * across the three appearance modes (solid / soft / outline). Theme tokens
9
+ * (`primary`, `destructive`, `warning`, `muted`) are preferred where the
10
+ * semantics line up; the remaining methods use Tailwind colour primitives so
11
+ * they still adapt to light/dark mode.
12
+ */
13
+ const httpMethodColors = {
14
+ GET: {
15
+ solid: "bg-sky-600 text-white border-sky-600 dark:bg-sky-500 dark:border-sky-500",
16
+ soft: "bg-sky-500/15 text-sky-700 border-sky-500/30 dark:text-sky-300 dark:bg-sky-500/20",
17
+ outline: "bg-transparent text-sky-700 border-sky-500/50 dark:text-sky-300 dark:border-sky-400/60",
18
+ },
19
+ POST: {
20
+ solid: "bg-emerald-600 text-white border-emerald-600 dark:bg-emerald-500 dark:border-emerald-500",
21
+ soft: "bg-emerald-500/15 text-emerald-700 border-emerald-500/30 dark:text-emerald-300 dark:bg-emerald-500/20",
22
+ outline: "bg-transparent text-emerald-700 border-emerald-500/50 dark:text-emerald-300 dark:border-emerald-400/60",
23
+ },
24
+ PUT: {
25
+ solid: "bg-warning text-warning-foreground border-warning",
26
+ soft: "bg-warning/15 text-warning-foreground border-warning/40 dark:bg-warning/20",
27
+ outline: "bg-transparent text-warning-foreground border-warning/50 dark:border-warning/70",
28
+ },
29
+ PATCH: {
30
+ solid: "bg-violet-600 text-white border-violet-600 dark:bg-violet-500 dark:border-violet-500",
31
+ soft: "bg-violet-500/15 text-violet-700 border-violet-500/30 dark:text-violet-300 dark:bg-violet-500/20",
32
+ outline: "bg-transparent text-violet-700 border-violet-500/50 dark:text-violet-300 dark:border-violet-400/60",
33
+ },
34
+ DELETE: {
35
+ solid: "bg-destructive text-white border-destructive",
36
+ soft: "bg-destructive/15 text-destructive border-destructive/30",
37
+ outline: "bg-transparent text-destructive border-destructive/50 dark:border-destructive/70",
38
+ },
39
+ OPTIONS: {
40
+ solid: "bg-foreground text-background border-foreground",
41
+ soft: "bg-muted text-muted-foreground border-border",
42
+ outline: "bg-transparent text-muted-foreground border-border",
43
+ },
44
+ HEAD: {
45
+ solid: "bg-slate-600 text-white border-slate-600 dark:bg-slate-500 dark:border-slate-500",
46
+ soft: "bg-slate-500/15 text-slate-700 border-slate-500/30 dark:text-slate-300 dark:bg-slate-500/20",
47
+ outline: "bg-transparent text-slate-700 border-slate-500/50 dark:text-slate-300 dark:border-slate-400/60",
48
+ },
49
+ TRACE: {
50
+ solid: "bg-zinc-600 text-white border-zinc-600 dark:bg-zinc-500 dark:border-zinc-500",
51
+ soft: "bg-zinc-500/15 text-zinc-700 border-zinc-500/30 dark:text-zinc-300 dark:bg-zinc-500/20",
52
+ outline: "bg-transparent text-zinc-700 border-zinc-500/50 dark:text-zinc-300 dark:border-zinc-400/60",
53
+ },
54
+ CONNECT: {
55
+ solid: "bg-stone-600 text-white border-stone-600 dark:bg-stone-500 dark:border-stone-500",
56
+ soft: "bg-stone-500/15 text-stone-700 border-stone-500/30 dark:text-stone-300 dark:bg-stone-500/20",
57
+ outline: "bg-transparent text-stone-700 border-stone-500/50 dark:text-stone-300 dark:border-stone-400/60",
58
+ },
59
+ };
60
+ const httpMethodBadgeVariants = cva("inline-flex items-center justify-center rounded-md border font-mono font-semibold uppercase tracking-wide whitespace-nowrap select-none align-middle transition-colors", {
61
+ variants: {
62
+ size: {
63
+ sm: "h-5 px-1.5 text-[10px] leading-none",
64
+ md: "h-6 px-2 text-xs leading-none",
65
+ lg: "h-7 px-2.5 text-sm leading-none",
66
+ },
67
+ width: {
68
+ auto: "",
69
+ // Fixed width keeps badges vertically aligned in endpoint lists. The
70
+ // widest method we render is "OPTIONS" / "CONNECT" (7 chars).
71
+ fixed: "",
72
+ },
73
+ },
74
+ compoundVariants: [
75
+ { size: "sm", width: "fixed", className: "w-[3.75rem]" },
76
+ { size: "md", width: "fixed", className: "w-[4.25rem]" },
77
+ { size: "lg", width: "fixed", className: "w-[5rem]" },
78
+ ],
79
+ defaultVariants: {
80
+ size: "md",
81
+ width: "auto",
82
+ },
83
+ });
84
+ function normalizeMethod(method) {
85
+ return method.toUpperCase();
86
+ }
87
+ function HttpMethodBadge({ className, method, appearance = "soft", size, width = "auto", label, ref, ...props }) {
88
+ const normalized = normalizeMethod(method);
89
+ const palette = httpMethodColors[normalized];
90
+ return (_jsx("span", { ref: ref, "data-slot": "http-method-badge", "data-method": normalized, "data-appearance": appearance, className: cn(httpMethodBadgeVariants({ size, width }), palette[appearance], className), ...props, children: label ?? normalized }));
91
+ }
92
+ HttpMethodBadge.displayName = "HttpMethodBadge";
93
+ export { HttpMethodBadge, httpMethodBadgeVariants, httpMethodColors, httpMethodIds, httpMethodBadgeAppearanceIds, httpMethodBadgeSizeIds, };
94
+ export default HttpMethodBadge;
95
+ //# sourceMappingURL=http-method-badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-method-badge.js","sourceRoot":"","sources":["../../../../src/components/ui/http-method-badge/http-method-badge.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,GAId,MAAM,8BAA8B,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,gBAAgB,GAGlB;IACF,GAAG,EAAE;QACH,KAAK,EACH,0EAA0E;QAC5E,IAAI,EAAE,mFAAmF;QACzF,OAAO,EACL,wFAAwF;KAC3F;IACD,IAAI,EAAE;QACJ,KAAK,EACH,0FAA0F;QAC5F,IAAI,EAAE,uGAAuG;QAC7G,OAAO,EACL,wGAAwG;KAC3G;IACD,GAAG,EAAE;QACH,KAAK,EAAE,mDAAmD;QAC1D,IAAI,EAAE,4EAA4E;QAClF,OAAO,EACL,iFAAiF;KACpF;IACD,KAAK,EAAE;QACL,KAAK,EACH,sFAAsF;QACxF,IAAI,EAAE,kGAAkG;QACxG,OAAO,EACL,oGAAoG;KACvG;IACD,MAAM,EAAE;QACN,KAAK,EAAE,8CAA8C;QACrD,IAAI,EAAE,0DAA0D;QAChE,OAAO,EACL,kFAAkF;KACrF;IACD,OAAO,EAAE;QACP,KAAK,EACH,iDAAiD;QACnD,IAAI,EAAE,8CAA8C;QACpD,OAAO,EAAE,oDAAoD;KAC9D;IACD,IAAI,EAAE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,MAAM,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC7C,OAAO,CACL,eACE,GAAG,EAAE,GAAG,eACE,mBAAmB,iBAChB,UAAU,qBACN,UAAU,EAC3B,SAAS,EAAE,EAAE,CACX,uBAAuB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EACxC,OAAO,CAAC,UAAU,CAAC,EACnB,SAAS,CACV,KACG,KAAK,YAER,KAAK,IAAI,UAAU,GACf,CACR,CAAC;AACJ,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,aAAa,EACb,4BAA4B,EAC5B,sBAAsB,GACvB,CAAC;AAGF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { HttpMethodBadge, HttpMethodBadge as default, httpMethodBadgeVariants, httpMethodColors, } from "./http-method-badge";
2
+ export type { HttpMethodBadgeProps } from "./http-method-badge";
3
+ export { httpMethodIds, httpMethodBadgeAppearanceIds, httpMethodBadgeSizeIds, } from "./http-method-badge-variants";
4
+ export type { HttpMethod, HttpMethodBadgeAppearance, HttpMethodBadgeSize, } from "./http-method-badge-variants";
@@ -0,0 +1,3 @@
1
+ export { HttpMethodBadge, HttpMethodBadge as default, httpMethodBadgeVariants, httpMethodColors, } from "./http-method-badge";
2
+ export { httpMethodIds, httpMethodBadgeAppearanceIds, httpMethodBadgeSizeIds, } from "./http-method-badge-variants";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/http-method-badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,8BAA8B,CAAC"}
@@ -78,6 +78,8 @@ export * from "./skeleton";
78
78
  export type * from "./skeleton";
79
79
  export * from "./key-value-with-skeleton";
80
80
  export type * from "./key-value-with-skeleton";
81
+ export * from "./description-list";
82
+ export type * from "./description-list";
81
83
  export * from "./status-blinker";
82
84
  export type * from "./status-blinker";
83
85
  export * from "./context-menu";
@@ -196,5 +198,7 @@ export * from "./time-picker";
196
198
  export type * from "./time-picker";
197
199
  export * from "./mark";
198
200
  export type * from "./mark";
201
+ export * from "./http-method-badge";
202
+ export type * from "./http-method-badge";
199
203
  export * from "./browser-frame";
200
204
  export type * from "./browser-frame";
@@ -38,6 +38,7 @@ export * from "./hover-card";
38
38
  export * from "./radio-group";
39
39
  export * from "./skeleton";
40
40
  export * from "./key-value-with-skeleton";
41
+ export * from "./description-list";
41
42
  export * from "./status-blinker";
42
43
  export * from "./context-menu";
43
44
  export * from "./inline-menu";
@@ -97,5 +98,6 @@ export * from "./date-picker";
97
98
  export * from "./date-range-picker";
98
99
  export * from "./time-picker";
99
100
  export * from "./mark";
101
+ export * from "./http-method-badge";
100
102
  export * from "./browser-frame";
101
103
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAGlC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,kCAAkC,CAAC;AAGjD,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,C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-1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schemavaults/ui",
3
- "version": "0.73.0",
3
+ "version": "0.75.0",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "description": "React.js UI components for SchemaVaults frontend applications",