@schemavaults/ui 0.78.0 → 0.78.2

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.
@@ -4,6 +4,8 @@ export interface ThemedPageBackgroundProps extends PropsWithChildren {
4
4
  className?: string;
5
5
  /** Append classnames to the background gradient container */
6
6
  backgroundClassName?: string;
7
+ /** Gradient colors. Tuple of [from, to]. Any CSS color string works. */
8
+ gradientColors?: [from: string, to: string];
7
9
  }
8
10
  /**
9
11
  * @name ThemedPageBackground
@@ -12,5 +14,5 @@ export interface ThemedPageBackgroundProps extends PropsWithChildren {
12
14
  *
13
15
  * @returns A component that fills the background container with a colorful SchemaVaults-themed background; child content is displayed on top
14
16
  */
15
- export declare function ThemedPageBackground({ children, ...props }: ThemedPageBackgroundProps): ReactElement;
17
+ export declare function ThemedPageBackground({ children, gradientColors, ...props }: ThemedPageBackgroundProps): ReactElement;
16
18
  export default ThemedPageBackground;
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { cn } from "../../../lib/utils";
4
+ import { getSchemaVaultsBrandColor } from "@schemavaults/theme/brand_colors";
4
5
  /**
5
6
  * @name ThemedPageBackground
6
7
  *
@@ -8,16 +9,27 @@ import { cn } from "../../../lib/utils";
8
9
  *
9
10
  * @returns A component that fills the background container with a colorful SchemaVaults-themed background; child content is displayed on top
10
11
  */
11
- export function ThemedPageBackground({ children, ...props }) {
12
+ export function ThemedPageBackground({ children, gradientColors = [
13
+ getSchemaVaultsBrandColor("schemavaults-brand-red"),
14
+ getSchemaVaultsBrandColor("schemavaults-brand-blue"),
15
+ ], ...props }) {
16
+ if (!Array.isArray(gradientColors) ||
17
+ typeof gradientColors[0] !== "string" ||
18
+ typeof gradientColors[1] !== "string") {
19
+ throw new TypeError("Expected a [from, to] tuple containing classNames for the <ThemedPageBackground /> gradient!");
20
+ }
21
+ const fromColor = gradientColors[0];
22
+ const toColor = gradientColors[1];
12
23
  const backgroundClassNames = [
13
24
  "schemavaults-themed-page-background",
14
25
  "relative min-h-full w-full shrink-0",
15
- "bg-schemavaults-brand-blue bg-gradient-to-b from-schemavaults-brand-red to-transparent",
16
26
  ];
17
27
  if (typeof props.backgroundClassName === "string") {
18
28
  backgroundClassNames.push(props.backgroundClassName);
19
29
  }
20
- return (_jsx("div", { className: backgroundClassNames.join(" "), children: _jsx("div", { className: cn("schemavaults-themed-page-background-internal-content", "relative z-10", "w-full min-h-full", props.className), children: children }) }));
30
+ return (_jsx("div", { className: backgroundClassNames.join(" "), children: _jsx("div", { className: cn("schemavaults-themed-page-background-internal-content", "relative z-10", "w-full min-h-full", props.className), style: {
31
+ backgroundImage: `linear-gradient(to bottom, ${fromColor}, ${toColor})`,
32
+ }, children: children }) }));
21
33
  }
22
34
  export default ThemedPageBackground;
23
35
  //# sourceMappingURL=themed-page-background.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"themed-page-background.js","sourceRoot":"","sources":["../../../../src/components/ui/themed-page-background/themed-page-background.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AASjC;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,QAAQ,EACR,GAAG,KAAK,EACkB;IAC1B,MAAM,oBAAoB,GAAa;QACrC,qCAAqC;QACrC,qCAAqC;QACrC,wFAAwF;KACzF,CAAC;IACF,IAAI,OAAO,KAAK,CAAC,mBAAmB,KAAK,QAAQ,EAAE,CAAC;QAClD,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAE,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,YAC5C,cACE,SAAS,EAAE,EAAE,CACX,sDAAsD,EACtD,eAAe,EACf,mBAAmB,EACnB,KAAK,CAAC,SAAS,CAChB,YAEA,QAAQ,GACL,GACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"themed-page-background.js","sourceRoot":"","sources":["../../../../src/components/ui/themed-page-background/themed-page-background.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAa7E;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,QAAQ,EACR,cAAc,GAAG;IACf,yBAAyB,CAAC,wBAAwB,CAAC;IACnD,yBAAyB,CAAC,yBAAyB,CAAC;CAC5C,EACV,GAAG,KAAK,EACkB;IAC1B,IACE,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;QAC9B,OAAO,cAAc,CAAC,CAAC,CAAC,KAAK,QAAQ;QACrC,OAAO,cAAc,CAAC,CAAC,CAAC,KAAK,QAAQ,EACrC,CAAC;QACD,MAAM,IAAI,SAAS,CACjB,8FAA8F,CAC/F,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAW,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAW,cAAc,CAAC,CAAC,CAAC,CAAC;IAE1C,MAAM,oBAAoB,GAAa;QACrC,qCAAqC;QACrC,qCAAqC;KACtC,CAAC;IACF,IAAI,OAAO,KAAK,CAAC,mBAAmB,KAAK,QAAQ,EAAE,CAAC;QAClD,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAE,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,YAC5C,cACE,SAAS,EAAE,EAAE,CACX,sDAAsD,EACtD,eAAe,EACf,mBAAmB,EACnB,KAAK,CAAC,SAAS,CAChB,EACD,KAAK,EAAE;gBACL,eAAe,EAAE,8BAA8B,SAAS,KAAK,OAAO,GAAG;aACxE,YAEA,QAAQ,GACL,GACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,oBAAoB,CAAC"}
@@ -1,6 +1,14 @@
1
1
  import type { ReactElement } from "react";
2
2
  export interface WordmarkProps {
3
+ /**
4
+ * @description The actual string to (beautifully) render
5
+ */
6
+ wordmarkText?: string;
7
+ /**
8
+ * @example ["from-schemavaults-brand-blue", "to-schemavaults-brand-red"]
9
+ */
10
+ gradientColors?: [fromClassName: string, toClassName: string];
3
11
  className?: string;
4
12
  }
5
- export declare function Wordmark({ className }: WordmarkProps): ReactElement;
13
+ export declare function Wordmark({ wordmarkText, gradientColors, className, }: WordmarkProps): ReactElement;
6
14
  export default Wordmark;
@@ -1,8 +1,27 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from "../../../lib/utils";
4
- export function Wordmark({ className }) {
5
- return (_jsx("span", { className: cn("text-transparent bg-clip-text bg-gradient-to-br", "from-schemavaults-brand-blue to-schemavaults-brand-red", "text-nowrap", className), children: "SchemaVaults" }));
3
+ import { getSchemaVaultsBrandColor } from "@schemavaults/theme/brand_colors";
4
+ const DEFAULT_WORDMARK_TEXT = "SchemaVaults";
5
+ export function Wordmark({ wordmarkText = DEFAULT_WORDMARK_TEXT, gradientColors = [
6
+ getSchemaVaultsBrandColor("schemavaults-brand-blue"),
7
+ getSchemaVaultsBrandColor("schemavaults-brand-red"),
8
+ ], className, }) {
9
+ if (typeof wordmarkText !== "string" || !(wordmarkText.length > 0)) {
10
+ throw new TypeError("Expected 'wordmarkText' to render to be a non-empty string!");
11
+ }
12
+ if (!Array.isArray(gradientColors) ||
13
+ typeof gradientColors[0] !== "string" ||
14
+ typeof gradientColors[1] !== "string") {
15
+ throw new TypeError("Expected a [from, to] tuple containing classNames for the <Wordmark /> gradient!");
16
+ }
17
+ const fromColor = gradientColors[0];
18
+ const toColor = gradientColors[1];
19
+ return (_jsx("span", { className: className, style: {
20
+ textWrap: "nowrap",
21
+ color: "transparent",
22
+ backgroundClip: "text",
23
+ backgroundImage: `linear-gradient(to bottom right, ${fromColor}, ${toColor})`,
24
+ }, children: wordmarkText }));
6
25
  }
7
26
  export default Wordmark;
8
27
  //# sourceMappingURL=wordmark.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wordmark.js","sourceRoot":"","sources":["../../../../src/components/ui/wordmark/wordmark.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAOjC,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAiB;IACnD,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,iDAAiD,EACjD,wDAAwD,EACxD,aAAa,EACb,SAAS,CACV,6BAGI,CACR,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"wordmark.js","sourceRoot":"","sources":["../../../../src/components/ui/wordmark/wordmark.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,MAAM,qBAAqB,GAAG,cAAuB,CAAC;AAgBtD,MAAM,UAAU,QAAQ,CAAC,EACvB,YAAY,GAAG,qBAAqB,EACpC,cAAc,GAAG;IACf,yBAAyB,CAAC,yBAAyB,CAAC;IACpD,yBAAyB,CAAC,wBAAwB,CAAC;CAC3C,EACV,SAAS,GACK;IACd,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,SAAS,CACjB,6DAA6D,CAC9D,CAAC;IACJ,CAAC;IAED,IACE,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;QAC9B,OAAO,cAAc,CAAC,CAAC,CAAC,KAAK,QAAQ;QACrC,OAAO,cAAc,CAAC,CAAC,CAAC,KAAK,QAAQ,EACrC,CAAC;QACD,MAAM,IAAI,SAAS,CACjB,kFAAkF,CACnF,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAW,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAW,cAAc,CAAC,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,eACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE;YACL,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,aAAa;YACpB,cAAc,EAAE,MAAM;YACtB,eAAe,EAAE,oCAAoC,SAAS,KAAK,OAAO,GAAG;SAC9E,YAEA,YAAY,GACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schemavaults/ui",
3
- "version": "0.78.0",
3
+ "version": "0.78.2",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "description": "React.js UI components for SchemaVaults frontend applications",
@@ -36,7 +36,7 @@
36
36
  "@radix-ui/react-toast": "1.2.14",
37
37
  "@radix-ui/react-tooltip": "1.2.7",
38
38
  "@radix-ui/react-visually-hidden": "1.2.3",
39
- "@schemavaults/theme": "0.25.9",
39
+ "@schemavaults/theme": "0.26.1",
40
40
  "@tanstack/react-table": "8.20.1",
41
41
  "class-variance-authority": "0.7.1",
42
42
  "clsx": "2.1.1",