@schemavaults/ui 0.14.12 → 0.16.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.
@@ -3,7 +3,7 @@ import { type VariantProps } from "class-variance-authority";
3
3
  import { type BreadcrumbSeparatorVariant, type BreadcrumbSize, type BreadcrumbVariant } from "./breadcrumb-variants";
4
4
  declare const breadcrumbListVariants: (props?: ({
5
5
  size?: "sm" | "default" | "lg" | null | undefined;
6
- variant?: "default" | "ghost" | "muted" | "primary" | null | undefined;
6
+ variant?: "default" | "ghost" | "primary" | "muted" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export interface BreadcrumbProps extends ComponentPropsWithoutRef<"nav"> {
9
9
  separator?: BreadcrumbSeparatorVariant;
@@ -96,3 +96,7 @@ export * from "./progress-bar";
96
96
  export type * from "./progress-bar";
97
97
  export * from "./breadcrumb";
98
98
  export type * from "./breadcrumb";
99
+ export * from "./kbd";
100
+ export type * from "./kbd";
101
+ export * from "./spinner";
102
+ export type * from "./spinner";
@@ -47,4 +47,6 @@ export * from "./slider";
47
47
  export * from "./switch";
48
48
  export * from "./progress-bar";
49
49
  export * from "./breadcrumb";
50
+ export * from "./kbd";
51
+ export * from "./spinner";
50
52
  //# 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,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,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,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC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ariantIds, kbdSizeIds } from "./kbd-variants";
4
+ export type { KbdVariant, KbdSize } from "./kbd-variants";
@@ -0,0 +1,3 @@
1
+ export { Kbd, Kbd as default, KbdGroup, kbdVariants, kbdGroupVariants } from "./kbd";
2
+ export { kbdVariantIds, kbdSizeIds } from "./kbd-variants";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/kbd/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const kbdVariantIds: readonly ["default", "outline", "solid", "subtle"];
2
+ export type KbdVariant = (typeof kbdVariantIds)[number];
3
+ export declare const kbdSizeIds: readonly ["sm", "md", "lg"];
4
+ export type KbdSize = (typeof kbdSizeIds)[number];
@@ -0,0 +1,8 @@
1
+ export const kbdVariantIds = [
2
+ "default",
3
+ "outline",
4
+ "solid",
5
+ "subtle",
6
+ ];
7
+ export const kbdSizeIds = ["sm", "md", "lg"];
8
+ //# sourceMappingURL=kbd-variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kbd-variants.js","sourceRoot":"","sources":["../../../../src/components/ui/kbd/kbd-variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;CAC4B,CAAC;AAGvC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAsC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type { HTMLAttributes, ReactElement, ReactNode, Ref } from "react";
3
+ import { type KbdSize, type KbdVariant, kbdSizeIds, kbdVariantIds } from "./kbd-variants";
4
+ declare const kbdVariants: (props?: ({
5
+ variant?: "default" | "outline" | "solid" | "subtle" | null | undefined;
6
+ size?: "sm" | "lg" | "md" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export interface KbdProps extends HTMLAttributes<HTMLElement>, VariantProps<typeof kbdVariants> {
9
+ ref?: Ref<HTMLElement>;
10
+ }
11
+ declare function Kbd({ className, variant, size, ref, ...props }: KbdProps): ReactElement;
12
+ declare namespace Kbd {
13
+ var displayName: string;
14
+ }
15
+ declare const kbdGroupVariants: (props?: ({
16
+ size?: "sm" | "lg" | "md" | null | undefined;
17
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
+ export interface KbdGroupProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof kbdGroupVariants> {
19
+ ref?: Ref<HTMLSpanElement>;
20
+ /**
21
+ * Optional separator rendered between children.
22
+ * Common values: "+", "·", "then"
23
+ */
24
+ separator?: ReactNode;
25
+ }
26
+ declare function KbdGroup({ className, size, separator, children, ref, ...props }: KbdGroupProps): ReactElement;
27
+ declare namespace KbdGroup {
28
+ var displayName: string;
29
+ }
30
+ export { Kbd, KbdGroup, kbdVariants, kbdGroupVariants, kbdSizeIds, kbdVariantIds };
31
+ export type { KbdSize, KbdVariant };
32
+ export default Kbd;
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../../../lib/utils";
5
+ import { kbdSizeIds, kbdVariantIds, } from "./kbd-variants";
6
+ const kbdVariants = cva("inline-flex items-center justify-center font-mono font-medium select-none whitespace-nowrap align-middle tracking-tight", {
7
+ variants: {
8
+ variant: {
9
+ default: "rounded border border-border bg-muted text-muted-foreground shadow-[inset_0_-1px_0_0_hsl(var(--border))]",
10
+ outline: "rounded border border-border bg-background text-foreground",
11
+ solid: "rounded border border-primary/20 bg-primary text-primary-foreground shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.2)]",
12
+ subtle: "rounded bg-muted/60 text-muted-foreground",
13
+ },
14
+ size: {
15
+ sm: "h-5 min-w-[1.25rem] px-1 text-[10px] leading-none",
16
+ md: "h-6 min-w-[1.5rem] px-1.5 text-xs leading-none",
17
+ lg: "h-7 min-w-[1.75rem] px-2 text-sm leading-none",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ size: "md",
23
+ },
24
+ });
25
+ function Kbd({ className, variant, size, ref, ...props }) {
26
+ return (_jsx("kbd", { ref: ref, "data-slot": "kbd", className: cn(kbdVariants({ variant, size }), className), ...props }));
27
+ }
28
+ Kbd.displayName = "Kbd";
29
+ const kbdGroupVariants = cva("inline-flex items-center align-middle", {
30
+ variants: {
31
+ size: {
32
+ sm: "gap-0.5 text-[10px]",
33
+ md: "gap-1 text-xs",
34
+ lg: "gap-1.5 text-sm",
35
+ },
36
+ },
37
+ defaultVariants: {
38
+ size: "md",
39
+ },
40
+ });
41
+ function KbdGroup({ className, size, separator, children, ref, ...props }) {
42
+ if (separator === undefined) {
43
+ return (_jsx("span", { ref: ref, "data-slot": "kbd-group", className: cn(kbdGroupVariants({ size }), className), ...props, children: children }));
44
+ }
45
+ const items = Array.isArray(children) ? children : [children];
46
+ const visible = items.filter((c) => c !== null && c !== undefined && c !== false);
47
+ return (_jsx("span", { ref: ref, "data-slot": "kbd-group", className: cn(kbdGroupVariants({ size }), className), ...props, children: visible.map((child, idx) => {
48
+ const isLast = idx === visible.length - 1;
49
+ return (_jsxs("span", { className: "inline-flex items-center gap-1", children: [child, !isLast ? (_jsx("span", { "aria-hidden": "true", className: "text-muted-foreground/70 select-none", children: separator })) : null] }, idx));
50
+ }) }));
51
+ }
52
+ KbdGroup.displayName = "KbdGroup";
53
+ export { Kbd, KbdGroup, kbdVariants, kbdGroupVariants, kbdSizeIds, kbdVariantIds };
54
+ export default Kbd;
55
+ //# sourceMappingURL=kbd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kbd.js","sourceRoot":"","sources":["../../../../src/components/ui/kbd/kbd.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAGL,UAAU,EACV,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,GAAG,GAAG,CACrB,yHAAyH,EACzH;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EACL,0GAA0G;YAC5G,OAAO,EACL,4DAA4D;YAC9D,KAAK,EACH,+GAA+G;YACjH,MAAM,EACJ,2CAA2C;SACT;QACtC,IAAI,EAAE;YACJ,EAAE,EAAE,mDAAmD;YACvD,EAAE,EAAE,gDAAgD;YACpD,EAAE,EAAE,+CAA+C;SAClB;KACpC;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;KACX;CACF,CACF,CAAC;AAQF,SAAS,GAAG,CAAC,EACX,SAAS,EACT,OAAO,EACP,IAAI,EACJ,GAAG,EACH,GAAG,KAAK,EACC;IACT,OAAO,CACL,cACE,GAAG,EAAE,GAAG,eACE,KAAK,EACf,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KACpD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AACD,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;AAExB,MAAM,gBAAgB,GAAG,GAAG,CAAC,uCAAuC,EAAE;IACpE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,qBAAqB;YACzB,EAAE,EAAE,eAAe;YACnB,EAAE,EAAE,iBAAiB;SACY;KACpC;IACD,eAAe,EAAE;QACf,IAAI,EAAE,IAAI;KACX;CACF,CAAC,CAAC;AAaH,SAAS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QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AAGnF,eAAe,GAAG,CAAC"}
@@ -1,5 +1,6 @@
1
+ import type { ReactElement } from "react";
1
2
  export interface LoadingPageProps {
2
3
  message?: string;
3
4
  }
4
- export declare function LoadingPage({ message }: LoadingPageProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function LoadingPage({ message }: LoadingPageProps): ReactElement;
5
6
  export default LoadingPage;
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Spinner } from "../spinner";
3
4
  export function LoadingPage({ message }) {
4
- return (_jsxs("div", { className: "w-full h-full flex grow flex-col items-center justify-center gap-4 min-h-[75vh]", children: [_jsx("div", { className: "inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]", role: "status", children: _jsx("span", { className: "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]" }) }), message && (_jsx("p", { className: "text-xs font-light text-muted-foreground", children: message }))] }));
5
+ return (_jsxs("div", { className: "w-full h-full flex grow flex-col items-center justify-center gap-4 min-h-[75vh]", children: [_jsx(Spinner, { size: "lg", label: message ?? "Loading" }), message && (_jsx("p", { className: "text-xs font-light text-muted-foreground", children: message }))] }));
5
6
  }
6
7
  export default LoadingPage;
7
8
  //# sourceMappingURL=loading-page.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loading-page.js","sourceRoot":"","sources":["../../../../src/components/ui/loading-page/loading-page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAMb,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,EAAoB;IACvD,OAAO,CACL,eAAK,SAAS,EAAC,iFAAiF,aAC9F,cACE,SAAS,EAAC,6KAA6K,EACvL,IAAI,EAAC,QAAQ,YAEb,eAAM,SAAS,EAAC,uGAAuG,GAAQ,GAC3H,EACL,OAAO,IAAI,CACV,YAAG,SAAS,EAAC,0CAA0C,YAAE,OAAO,GAAK,CACtE,IACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"loading-page.js","sourceRoot":"","sources":["../../../../src/components/ui/loading-page/loading-page.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAMrC,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,EAAoB;IACvD,OAAO,CACL,eAAK,SAAS,EAAC,iFAAiF,aAC9F,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,OAAO,IAAI,SAAS,GAAI,EACjD,OAAO,IAAI,CACV,YAAG,SAAS,EAAC,0CAA0C,YAAE,OAAO,GAAK,CACtE,IACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Spinner, Spinner as default, spinnerCircleVariants, spinnerSizeIds, spinnerVariantIds, } from "./spinner";
2
+ export type { SpinnerProps, SpinnerSize, SpinnerVariant } from "./spinner";
@@ -0,0 +1,2 @@
1
+ export { Spinner, Spinner as default, spinnerCircleVariants, spinnerSizeIds, spinnerVariantIds, } from "./spinner";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,OAAO,IAAI,OAAO,EAClB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,GAClB,MAAM,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const spinnerSizeIds: readonly ["xs", "sm", "md", "lg", "xl"];
2
+ export type SpinnerSize = (typeof spinnerSizeIds)[number];
3
+ export declare const spinnerVariantIds: readonly ["default", "primary", "secondary", "brand", "destructive", "warning", "muted"];
4
+ export type SpinnerVariant = (typeof spinnerVariantIds)[number];
@@ -0,0 +1,17 @@
1
+ export const spinnerSizeIds = [
2
+ "xs",
3
+ "sm",
4
+ "md",
5
+ "lg",
6
+ "xl",
7
+ ];
8
+ export const spinnerVariantIds = [
9
+ "default",
10
+ "primary",
11
+ "secondary",
12
+ "brand",
13
+ "destructive",
14
+ "warning",
15
+ "muted",
16
+ ];
17
+ //# sourceMappingURL=spinner-variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner-variants.js","sourceRoot":"","sources":["../../../../src/components/ui/spinner/spinner-variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACgC,CAAC;AAGvC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,SAAS;IACT,SAAS;IACT,WAAW;IACX,OAAO;IACP,aAAa;IACb,SAAS;IACT,OAAO;CAC6B,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type { HTMLAttributes, ReactElement, ReactNode, Ref } from "react";
3
+ import { type SpinnerSize, type SpinnerVariant, spinnerSizeIds, spinnerVariantIds } from "./spinner-variants";
4
+ /**
5
+ * Visual styling for the spinning circle itself. Border color uses
6
+ * `border-current` so the color is inherited from the wrapping element's
7
+ * text color (set by the variant).
8
+ */
9
+ declare const spinnerCircleVariants: (props?: ({
10
+ size?: "xs" | "sm" | "lg" | "xl" | "md" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ export interface SpinnerProps extends Omit<HTMLAttributes<HTMLSpanElement>, "role" | "aria-label">, VariantProps<typeof spinnerCircleVariants> {
13
+ /**
14
+ * Color/intent variant. Defaults to "default" (foreground).
15
+ */
16
+ variant?: SpinnerVariant;
17
+ /**
18
+ * Accessible label describing what is loading. Announced to screen readers.
19
+ * Defaults to "Loading".
20
+ */
21
+ label?: string;
22
+ /**
23
+ * If true, the label is rendered visibly next to the spinner.
24
+ * If false (default), the label is only available to screen readers.
25
+ */
26
+ showLabel?: boolean;
27
+ /**
28
+ * Optional content rendered alongside the spinner. When provided, the
29
+ * content is rendered visibly and replaces the default visible label.
30
+ * The wrapping element retains the spinner's color so any nested text
31
+ * inherits it automatically.
32
+ */
33
+ children?: ReactNode;
34
+ ref?: Ref<HTMLSpanElement>;
35
+ }
36
+ declare function Spinner({ className, size, variant, label, showLabel, children, ref, ...props }: SpinnerProps): ReactElement;
37
+ declare namespace Spinner {
38
+ var displayName: string;
39
+ }
40
+ export { Spinner, spinnerCircleVariants, spinnerSizeIds, spinnerVariantIds, };
41
+ export type { SpinnerSize, SpinnerVariant };
42
+ export default Spinner;
@@ -0,0 +1,62 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../../../lib/utils";
5
+ import { spinnerSizeIds, spinnerVariantIds, } from "./spinner-variants";
6
+ /**
7
+ * Visual styling for the spinning circle itself. Border color uses
8
+ * `border-current` so the color is inherited from the wrapping element's
9
+ * text color (set by the variant).
10
+ */
11
+ const spinnerCircleVariants = cva("inline-block rounded-full border-solid border-current border-r-transparent animate-spin motion-reduce:animate-[spin_1.5s_linear_infinite] align-[-0.125em]", {
12
+ variants: {
13
+ size: {
14
+ xs: "h-3 w-3 border-2",
15
+ sm: "h-4 w-4 border-2",
16
+ md: "h-6 w-6 border-[3px]",
17
+ lg: "h-8 w-8 border-4",
18
+ xl: "h-12 w-12 border-4",
19
+ },
20
+ },
21
+ defaultVariants: {
22
+ size: "md",
23
+ },
24
+ });
25
+ const spinnerLabelSizes = {
26
+ xs: "text-[10px]",
27
+ sm: "text-xs",
28
+ md: "text-sm",
29
+ lg: "text-base",
30
+ xl: "text-lg",
31
+ };
32
+ const spinnerWrapperGapSizes = {
33
+ xs: "gap-1.5",
34
+ sm: "gap-2",
35
+ md: "gap-2.5",
36
+ lg: "gap-3",
37
+ xl: "gap-3.5",
38
+ };
39
+ const spinnerVariantColors = {
40
+ default: "text-foreground",
41
+ primary: "text-primary",
42
+ secondary: "text-secondary-foreground",
43
+ brand: "text-schemavaults-brand-blue",
44
+ destructive: "text-destructive",
45
+ warning: "text-warning",
46
+ muted: "text-muted-foreground",
47
+ };
48
+ function Spinner({ className, size, variant, label = "Loading", showLabel = false, children, ref, ...props }) {
49
+ const resolvedSize = size ?? "md";
50
+ const resolvedVariant = variant ?? "default";
51
+ const colorClass = spinnerVariantColors[resolvedVariant];
52
+ const hasVisibleContent = showLabel || children !== undefined;
53
+ if (!hasVisibleContent) {
54
+ return (_jsxs("span", { ref: ref, role: "status", "aria-live": "polite", "aria-label": label, "data-slot": "spinner", className: cn("inline-flex items-center", colorClass, className), ...props, children: [_jsx("span", { "aria-hidden": "true", className: cn(spinnerCircleVariants({ size: resolvedSize })) }), _jsx("span", { className: "sr-only", children: label })] }));
55
+ }
56
+ const visibleLabel = children ?? label;
57
+ return (_jsxs("span", { ref: ref, role: "status", "aria-live": "polite", "data-slot": "spinner", className: cn("inline-flex items-center", spinnerWrapperGapSizes[resolvedSize], colorClass, className), ...props, children: [_jsx("span", { "aria-hidden": "true", className: cn(spinnerCircleVariants({ size: resolvedSize })) }), _jsx("span", { className: cn("font-medium", spinnerLabelSizes[resolvedSize]), children: visibleLabel })] }));
58
+ }
59
+ Spinner.displayName = "Spinner";
60
+ export { Spinner, spinnerCircleVariants, spinnerSizeIds, spinnerVariantIds, };
61
+ export default Spinner;
62
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/ui/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC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B,GAAY,SAAS,IAAI,QAAQ,KAAK,SAAS,CAAC;IAEvE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,CACL,gBACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,eACH,QAAQ,gBACN,KAAK,eACP,SAAS,EACnB,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,UAAU,EAAE,SAAS,CAAC,KAC5D,KAAK,aAET,8BACc,MAAM,EAClB,SAAS,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,GAC5D,EACF,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,GAAQ,IACnC,CACR,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAc,QAAQ,IAAI,KAAK,CAAC;IAElD,OAAO,CACL,gBACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,eACH,QAAQ,eACR,SAAS,EACnB,SAAS,EAAE,EAAE,CACX,0BAA0B,EAC1B,sBAAsB,CAAC,YAAY,CAAC,EACpC,UAAU,EACV,SAAS,CACV,KACG,KAAK,aAET,8BACc,MAAM,EAClB,SAAS,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,GAC5D,EACF,eAAM,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,YAChE,YAAY,GACR,IACF,CACR,CAAC;AACJ,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAEhC,OAAO,EACL,OAAO,EACP,qBAAqB,EACrB,cAAc,EACd,iBAAiB,GAClB,CAAC;AAGF,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schemavaults/ui",
3
- "version": "0.14.12",
3
+ "version": "0.16.1",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "description": "React.js UI components for SchemaVaults frontend applications",