@nextworks/blocks-core 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/components/AppProviders.server.d.ts +4 -0
- package/dist/components/AppProviders.server.d.ts.map +1 -0
- package/dist/components/AppProviders.server.js +60 -0
- package/dist/components/enhanced-theme-provider.d.ts +25 -0
- package/dist/components/enhanced-theme-provider.d.ts.map +1 -0
- package/dist/components/enhanced-theme-provider.js +105 -0
- package/dist/components/theme-provider.d.ts +12 -0
- package/dist/components/theme-provider.d.ts.map +1 -0
- package/dist/components/theme-provider.js +6 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/lib/themes.d.ts +32 -0
- package/dist/lib/themes.d.ts.map +1 -0
- package/dist/lib/themes.js +396 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +3 -0
- package/dist/ui/alert-dialog.d.ts +15 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert-dialog.js +59 -0
- package/dist/ui/brand-node.d.ts +43 -0
- package/dist/ui/brand-node.d.ts.map +1 -0
- package/dist/ui/brand-node.js +37 -0
- package/dist/ui/button.d.ts +16 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +71 -0
- package/dist/ui/card.d.ts +10 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +46 -0
- package/dist/ui/checkbox.d.ts +5 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +24 -0
- package/dist/ui/cta-button.d.ts +40 -0
- package/dist/ui/cta-button.d.ts.map +1 -0
- package/dist/ui/cta-button.js +47 -0
- package/dist/ui/dropdown-menu.d.ts +28 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +72 -0
- package/dist/ui/feature-card.d.ts +32 -0
- package/dist/ui/feature-card.d.ts.map +1 -0
- package/dist/ui/feature-card.js +14 -0
- package/dist/ui/input.d.ts +5 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +24 -0
- package/dist/ui/label.d.ts +6 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +25 -0
- package/dist/ui/pricing-card.d.ts +50 -0
- package/dist/ui/pricing-card.d.ts.map +1 -0
- package/dist/ui/pricing-card.js +22 -0
- package/dist/ui/select.d.ts +5 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +20 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/skeleton.js +17 -0
- package/dist/ui/switch.d.ts +9 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/switch.js +24 -0
- package/dist/ui/table.d.ts +9 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +39 -0
- package/dist/ui/testimonial-card.d.ts +35 -0
- package/dist/ui/testimonial-card.d.ts.map +1 -0
- package/dist/ui/testimonial-card.js +36 -0
- package/dist/ui/textarea.d.ts +5 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +24 -0
- package/dist/ui/theme-selector.d.ts +9 -0
- package/dist/ui/theme-selector.d.ts.map +1 -0
- package/dist/ui/theme-selector.js +56 -0
- package/dist/ui/theme-toggle.d.ts +15 -0
- package/dist/ui/theme-toggle.d.ts.map +1 -0
- package/dist/ui/theme-toggle.js +19 -0
- package/dist/ui/toaster.d.ts +2 -0
- package/dist/ui/toaster.d.ts.map +1 -0
- package/dist/ui/toaster.js +6 -0
- package/package.json +43 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
const Select = React.forwardRef((_a, ref) => {
|
|
16
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
17
|
+
return (_jsx("select", Object.assign({ ref: ref, className: cn("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/30 dark:aria-invalid:focus-visible:ring-destructive/40 flex h-10 w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", "bg-[var(--input-bg)] text-[var(--input-fg)]", className) }, props, { children: children })));
|
|
18
|
+
});
|
|
19
|
+
Select.displayName = "Select";
|
|
20
|
+
export { Select };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/ui/skeleton.tsx"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,2CAOtC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cn } from "../lib/utils";
|
|
14
|
+
export function Skeleton(_a) {
|
|
15
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
+
return (_jsx("div", Object.assign({ className: cn("bg-muted animate-pulse rounded-md", className) }, props)));
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SwitchProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
3
|
+
isLoading?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const Switch: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export { Switch };
|
|
9
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/ui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IACtE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,MAAM;gBAHE,OAAO;0CAqEpB,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
const Switch = React.forwardRef((_a, ref) => {
|
|
16
|
+
var { className, isLoading, disabled } = _a, props = __rest(_a, ["className", "isLoading", "disabled"]);
|
|
17
|
+
const checked = !!props.checked;
|
|
18
|
+
const isDisabled = !!disabled || !!isLoading;
|
|
19
|
+
return (_jsxs("label", { className: cn("focus-within:ring-offset-background inline-flex items-center rounded-full focus-within:ring-2 focus-within:ring-[var(--ring)] focus-within:ring-offset-2", isDisabled ? "cursor-not-allowed opacity-80" : "cursor-pointer", className), children: [_jsx("input", Object.assign({ type: "checkbox", role: "switch", ref: ref, className: "sr-only", disabled: isDisabled, "aria-busy": isLoading ? "true" : undefined }, props)), _jsxs("span", { "aria-hidden": true, className: cn("relative inline-flex h-6 w-11 flex-shrink-0 rounded-full transition-colors duration-200", checked ? "bg-[var(--primary)]" : "bg-[var(--primary)]/80"), children: [_jsx("span", { className: cn(
|
|
20
|
+
// Thumb should adjust for theme to guarantee contrast
|
|
21
|
+
"absolute top-0.5 left-0.5 h-5 w-5 transform rounded-full bg-[var(--switch-thumb)] shadow-md transition-transform duration-200 ease-in-out", checked ? "translate-x-5" : "translate-x-0") }), isLoading && (_jsx("span", { className: "absolute inset-0 flex items-center justify-center", children: _jsxs("svg", { className: "h-4 w-4 animate-spin text-white", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "aria-hidden": true, children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z" })] }) }))] })] }));
|
|
22
|
+
});
|
|
23
|
+
Switch.displayName = "Switch";
|
|
24
|
+
export { Switch };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare function Table({ className, ...props }: React.HTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function TableHeader(props: React.HTMLAttributes<HTMLTableSectionElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function TableBody(props: React.HTMLAttributes<HTMLTableSectionElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function TableRow(props: React.HTMLAttributes<HTMLTableRowElement>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function TableHead(props: React.ThHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function TableCell(props: React.TdHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableCaption(props: React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/ui/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,2CAcxC;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,uBAAuB,CAAC,2CAYrD;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,uBAAuB,CAAC,2CAWrD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,2CAUxE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,2CAU5E;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,2CAU5E;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,2CAUpE"}
|
package/dist/ui/table.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cn } from "../lib/utils";
|
|
14
|
+
export function Table(_a) {
|
|
15
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
+
return (_jsx("div", { className: "relative w-full overflow-auto", children: _jsx("table", Object.assign({ className: cn("w-full caption-bottom text-sm",
|
|
17
|
+
// Optional fg override
|
|
18
|
+
"text-[var(--table-fg)]", className) }, props)) }));
|
|
19
|
+
}
|
|
20
|
+
export function TableHeader(props) {
|
|
21
|
+
return (_jsx("thead", Object.assign({ className: cn("[&_tr]:border-b",
|
|
22
|
+
// Variable hooks for border color and head text
|
|
23
|
+
"text-[var(--table-head-fg)] [&_tr]:border-[var(--table-border)]") }, props)));
|
|
24
|
+
}
|
|
25
|
+
export function TableBody(props) {
|
|
26
|
+
return (_jsx("tbody", Object.assign({ className: cn("[&_tr:last-child]:border-0", "[&_tr]:border-[var(--table-border)]") }, props)));
|
|
27
|
+
}
|
|
28
|
+
export function TableRow(props) {
|
|
29
|
+
return (_jsx("tr", Object.assign({ className: cn("hover:bg-muted/50 border-b transition-colors", "border-[var(--table-border)] hover:bg-[var(--table-row-hover-bg)]") }, props)));
|
|
30
|
+
}
|
|
31
|
+
export function TableHead(props) {
|
|
32
|
+
return (_jsx("th", Object.assign({ className: cn("text-muted-foreground h-10 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0", "text-[var(--table-head-fg)]") }, props)));
|
|
33
|
+
}
|
|
34
|
+
export function TableCell(props) {
|
|
35
|
+
return (_jsx("td", Object.assign({ className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", "text-[var(--table-fg)]") }, props)));
|
|
36
|
+
}
|
|
37
|
+
export function TableCaption(props) {
|
|
38
|
+
return (_jsx("caption", Object.assign({ className: cn("text-muted-foreground mt-4 text-sm", "text-[var(--table-muted-fg)]") }, props)));
|
|
39
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface TestimonialCardProps {
|
|
2
|
+
/** Optional id for root card */
|
|
3
|
+
id?: string;
|
|
4
|
+
/** Optional root className merged with card.className */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Legacy props (kept for backward compatibility) */
|
|
7
|
+
testimonialText?: string;
|
|
8
|
+
testimonialAuthor?: string;
|
|
9
|
+
testimonialAuthorInitials?: string;
|
|
10
|
+
/** New props to align with upgraded sections */
|
|
11
|
+
quote?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
role?: string;
|
|
14
|
+
/** Styling configuration objects */
|
|
15
|
+
card?: {
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
content?: {
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
text?: {
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
author?: {
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
avatar?: {
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
avatarText?: {
|
|
31
|
+
className?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export declare function TestimonialCard({ id, className, testimonialText, testimonialAuthor, testimonialAuthorInitials, quote, name, role, card, content, text, author, avatar, avatarText, }: TestimonialCardProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=testimonial-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testimonial-card.d.ts","sourceRoot":"","sources":["../../src/ui/testimonial-card.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oCAAoC;IACpC,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAWD,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,SAAS,EAET,eAA4E,EAC5E,iBAAsC,EACtC,yBAAgC,EAEhC,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAGC,EACD,OAEC,EACD,IAGC,EACD,MAGC,EACD,MAGC,EACD,UAEC,GACF,EAAE,oBAAoB,2CAuBtB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
function getInitials(from) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
if (!from)
|
|
7
|
+
return undefined;
|
|
8
|
+
const parts = from.trim().split(/\s+/);
|
|
9
|
+
const first = ((_a = parts[0]) === null || _a === void 0 ? void 0 : _a[0]) || "";
|
|
10
|
+
const last = parts.length > 1 ? ((_b = parts[parts.length - 1]) === null || _b === void 0 ? void 0 : _b[0]) || "" : "";
|
|
11
|
+
const res = `${first}${last}`.toUpperCase();
|
|
12
|
+
return res || undefined;
|
|
13
|
+
}
|
|
14
|
+
export function TestimonialCard({ id, className,
|
|
15
|
+
// legacy defaults
|
|
16
|
+
testimonialText = "Lorem ipsum dolor sit amet! Consectetur adipiscing elit.", testimonialAuthor = " - Cillum Dolore", testimonialAuthorInitials = "JD",
|
|
17
|
+
// new props (no defaults, we derive below)
|
|
18
|
+
quote, name, role, card = {
|
|
19
|
+
className: "bg-card text-card-foreground p-6 rounded-lg border border-border shadow-md transition-transform duration-200 hover:-translate-y-1 bg-[var(--card-bg)] text-[var(--card-fg)] border-[var(--card-border)] shadow-[var(--card-shadow)]",
|
|
20
|
+
}, content = {
|
|
21
|
+
className: "flex flex-col space-y-4",
|
|
22
|
+
}, text = {
|
|
23
|
+
className: "text-muted-foreground text-base leading-relaxed italic text-[var(--card-fg)]",
|
|
24
|
+
}, author = {
|
|
25
|
+
className: "text-muted-foreground text-sm font-medium text-[var(--card-muted-fg)]",
|
|
26
|
+
}, avatar = {
|
|
27
|
+
className: "w-12 h-12 bg-primary text-primary-foreground rounded-full flex items-center justify-center text-lg font-bold bg-[var(--badge-bg)] text-[var(--badge-fg)] border-[var(--badge-border)]",
|
|
28
|
+
}, avatarText = {
|
|
29
|
+
className: "text-white font-bold",
|
|
30
|
+
}, }) {
|
|
31
|
+
var _a;
|
|
32
|
+
const displayText = quote !== null && quote !== void 0 ? quote : testimonialText;
|
|
33
|
+
const computedAuthor = testimonialAuthor !== null && testimonialAuthor !== void 0 ? testimonialAuthor : (name ? ` - ${name}${role ? `, ${role}` : ""}` : " - Cillum Dolore");
|
|
34
|
+
const initials = (_a = testimonialAuthorInitials !== null && testimonialAuthorInitials !== void 0 ? testimonialAuthorInitials : getInitials(name)) !== null && _a !== void 0 ? _a : "JD";
|
|
35
|
+
return (_jsx("div", { id: id, className: cn(card.className, className), children: _jsxs("div", { className: content.className, children: [_jsx("div", { className: avatar.className, children: _jsx("span", { className: avatarText.className, children: initials }) }), _jsxs("p", { className: text.className, children: ["\u201C", displayText, "\u201D"] }), _jsx("p", { className: author.className, children: computedAuthor })] }) }));
|
|
36
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
3
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
4
|
+
export { Textarea };
|
|
5
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/ui/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAE9E,QAAA,MAAM,QAAQ,2FAgBb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
const Textarea = React.forwardRef((_a, ref) => {
|
|
16
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
+
return (_jsx("textarea", Object.assign({ className: cn(
|
|
18
|
+
// Base structural + token fallbacks
|
|
19
|
+
"border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/30 dark:aria-invalid:focus-visible:ring-destructive/40 flex min-h-[80px] w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
// CSS variable hooks (preset-first). When vars are unset, tokens above apply.
|
|
21
|
+
"border-[var(--input-border)] bg-[var(--input-bg)] text-[var(--input-fg)] placeholder:text-[var(--input-placeholder)] focus-visible:ring-[var(--input-focus-ring)] focus-visible:ring-offset-[var(--input-ring-offset)]", className), ref: ref }, props)));
|
|
22
|
+
});
|
|
23
|
+
Textarea.displayName = "Textarea";
|
|
24
|
+
export { Textarea };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "../ui/button";
|
|
3
|
+
type ThemeSelectorProps = React.ComponentPropsWithoutRef<typeof Button> & {
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function ThemeSelector({ ariaLabel, label, className, ...buttonProps }: ThemeSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=theme-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-selector.d.ts","sourceRoot":"","sources":["../../src/ui/theme-selector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAUtC,KAAK,kBAAkB,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC,GAAG;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,SAA+B,EAC/B,KAAe,EACf,SAAS,EACT,GAAG,WAAW,EACf,EAAE,kBAAkB,2CAqNpB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { Check, Palette, Wrench } from "lucide-react";
|
|
16
|
+
import { useTheme } from "next-themes";
|
|
17
|
+
import { useThemeVariant } from "../components/enhanced-theme-provider";
|
|
18
|
+
import { themes, darkThemes, } from "../lib/themes";
|
|
19
|
+
import { Button } from "../ui/button";
|
|
20
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "../ui/dropdown-menu";
|
|
21
|
+
export function ThemeSelector(_a) {
|
|
22
|
+
var _b, _c, _d;
|
|
23
|
+
var { ariaLabel = "Demo: Color theme", label = "Theme", className } = _a, buttonProps = __rest(_a, ["ariaLabel", "label", "className"]);
|
|
24
|
+
const { theme, setTheme } = useTheme();
|
|
25
|
+
const { themeVariant, setThemeVariant, setCustomBrandColors } = useThemeVariant();
|
|
26
|
+
const isDark = theme === "dark";
|
|
27
|
+
const [showCustom, setShowCustom] = React.useState(false);
|
|
28
|
+
const [custom, setCustom] = React.useState({});
|
|
29
|
+
function openCustomDialog() {
|
|
30
|
+
setCustom({});
|
|
31
|
+
setShowCustom(true);
|
|
32
|
+
}
|
|
33
|
+
function applyCustom() {
|
|
34
|
+
setCustomBrandColors(custom);
|
|
35
|
+
document.cookie = `theme-variant=custom; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
36
|
+
document.cookie = `theme-custom=${encodeURIComponent(JSON.stringify(custom))}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
37
|
+
setShowCustom(false);
|
|
38
|
+
}
|
|
39
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, Object.assign({ variant: "outline", size: "sm", className: `gap-2 ${className !== null && className !== void 0 ? className : ""}`, "aria-label": ariaLabel }, buttonProps, { children: [_jsx(Palette, { className: "h-4 w-4" }), label] })) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-64", children: [_jsxs(DropdownMenuLabel, { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { children: "Color theme variants" }), _jsx("span", { "aria-hidden": "true", className: "border-border bg-muted/50 text-muted-foreground rounded-md border px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase", children: "Gallery" })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: "Affects this preview only ( button is not part of the shared Navbar. )" })] }), _jsx(DropdownMenuSeparator, {}), Object.entries(themes).map(([key, themeConfig]) => (_jsxs(DropdownMenuItem, { onClick: () => {
|
|
40
|
+
setThemeVariant(key);
|
|
41
|
+
document.cookie = `theme-variant=${key}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
42
|
+
}, className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-4 w-4 rounded-full border", style: {
|
|
43
|
+
backgroundColor: isDark
|
|
44
|
+
? darkThemes[key].colors.primary
|
|
45
|
+
: themeConfig.colors.primary,
|
|
46
|
+
} }), themeConfig.name] }), themeVariant === key && _jsx(Check, { className: "h-4 w-4" })] }, key))), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { children: "Custom" }), _jsxs(DropdownMenuItem, { onClick: openCustomDialog, className: "flex items-center gap-2", children: [_jsx(Wrench, { className: "h-4 w-4" }), "Customize brand colors\u2026"] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { children: "Appearance" }), _jsx(DropdownMenuItem, { onClick: () => setTheme("light"), children: "Light" }), _jsx(DropdownMenuItem, { onClick: () => setTheme("dark"), children: "Dark" }), _jsx(DropdownMenuItem, { onClick: () => setTheme("system"), children: "System" })] }), showCustom && (_jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 p-4", children: _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": "customBrandColorsTitle", className: "bg-popover text-popover-foreground w-full max-w-md rounded-md border p-4 shadow-lg", children: [_jsx("div", { id: "customBrandColorsTitle", className: "mb-3 text-sm font-semibold", children: "Custom brand colors" }), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("label", { className: "w-28 text-sm", children: "primary" }), _jsx("input", { type: "text", placeholder: "oklch(...) or #hex", className: "bg-background flex-1 rounded border p-2 text-sm", value: (_b = custom.primary) !== null && _b !== void 0 ? _b : "", onChange: (e) => setCustom((c) => (Object.assign(Object.assign({}, c), { primary: e.target.value }))) }), _jsx("input", { type: "color", className: "h-8 w-10 cursor-pointer", value: typeof custom.primary === "string" &&
|
|
47
|
+
custom.primary.startsWith("#")
|
|
48
|
+
? custom.primary
|
|
49
|
+
: "#000000", onChange: (e) => setCustom((c) => (Object.assign(Object.assign({}, c), { primary: e.target.value }))) })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("label", { className: "w-28 text-sm", children: "accent" }), _jsx("input", { type: "text", placeholder: "oklch(...) or #hex", className: "bg-background flex-1 rounded border p-2 text-sm", value: (_c = custom.accent) !== null && _c !== void 0 ? _c : "", onChange: (e) => setCustom((c) => (Object.assign(Object.assign({}, c), { accent: e.target.value }))) }), _jsx("input", { type: "color", className: "h-8 w-10 cursor-pointer", value: typeof custom.accent === "string" &&
|
|
50
|
+
custom.accent.startsWith("#")
|
|
51
|
+
? custom.accent
|
|
52
|
+
: "#000000", onChange: (e) => setCustom((c) => (Object.assign(Object.assign({}, c), { accent: e.target.value }))) })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("label", { className: "w-28 text-sm", children: "ring" }), _jsx("input", { type: "text", placeholder: "oklch(...) or #hex", className: "bg-background flex-1 rounded border p-2 text-sm", value: (_d = custom.ring) !== null && _d !== void 0 ? _d : "", onChange: (e) => setCustom((c) => (Object.assign(Object.assign({}, c), { ring: e.target.value }))) }), _jsx("input", { type: "color", className: "h-8 w-10 cursor-pointer", value: typeof custom.ring === "string" &&
|
|
53
|
+
custom.ring.startsWith("#")
|
|
54
|
+
? custom.ring
|
|
55
|
+
: "#000000", onChange: (e) => setCustom((c) => (Object.assign(Object.assign({}, c), { ring: e.target.value }))) })] })] }), _jsxs("div", { className: "mt-4 flex justify-end gap-2", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setShowCustom(false), children: "Cancel" }), _jsx(Button, { size: "sm", onClick: applyCustom, children: "Apply" })] })] }) }))] }));
|
|
56
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "../ui/button";
|
|
3
|
+
type ButtonProps = React.ComponentProps<typeof Button>;
|
|
4
|
+
export type ThemeToggleProps = {
|
|
5
|
+
/** Forwarded to internal Button. You can set unstyled, className, variant, size, etc. */
|
|
6
|
+
buttonProps?: Partial<ButtonProps>;
|
|
7
|
+
/** Optional aria-label override */
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
/** Optional class overrides for icons */
|
|
10
|
+
moonClassName?: string;
|
|
11
|
+
sunClassName?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function ThemeToggle({ buttonProps, ariaLabel, moonClassName, sunClassName, }: ThemeToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=theme-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-toggle.d.ts","sourceRoot":"","sources":["../../src/ui/theme-toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yFAAyF;IACzF,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACnC,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,WAAW,EACX,SAA0B,EAC1B,aAAa,EACb,YAAY,GACb,EAAE,gBAAgB,2CA+ClB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Moon, Sun } from "lucide-react";
|
|
4
|
+
import { useTheme } from "next-themes";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
import { Button } from "../ui/button";
|
|
7
|
+
export function ThemeToggle({ buttonProps, ariaLabel = "Toggle theme", moonClassName, sunClassName, }) {
|
|
8
|
+
const { theme, setTheme } = useTheme();
|
|
9
|
+
const mergedButtonProps = Object.assign(Object.assign({ variant: "outline", size: "icon" }, buttonProps), { className: cn("relative",
|
|
10
|
+
// Prefer preset variables if provided on Navbar
|
|
11
|
+
"bg-[var(--navbar-toggle-bg)] text-[var(--navbar-accent)] hover:bg-[var(--navbar-hover-bg)] focus-visible:ring-[var(--navbar-ring)]",
|
|
12
|
+
// Ensure border uses preset variable; provide width for unstyled cases
|
|
13
|
+
"border border-[var(--navbar-border)]", buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.className),
|
|
14
|
+
// Inline style ensures our accent wins over token classes even under dark: variants
|
|
15
|
+
style: Object.assign(Object.assign({}, buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.style), { color: "var(--navbar-accent)", backgroundColor: "var(--navbar-toggle-bg)", borderColor: "var(--navbar-border)",
|
|
16
|
+
// Tell Tailwind ring utilities which ring color to use
|
|
17
|
+
"--tw-ring-color": "var(--navbar-ring)" }) });
|
|
18
|
+
return (_jsxs(Button, Object.assign({}, mergedButtonProps, { onClick: () => setTheme(theme === "light" ? "dark" : "light"), "aria-label": ariaLabel, children: [_jsx(Moon, { className: cn("h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90", moonClassName) }), _jsx(Sun, { className: cn("absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0", sunClassName) }), _jsx("span", { className: "sr-only", children: ariaLabel })] })));
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../../src/ui/toaster.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,UAAU,4CAEjC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nextworks/blocks-core",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"package.json",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap --outDir dist-types",
|
|
17
|
+
"build": "tsc -p tsconfig.build.json && npm run build:types && node scripts/postbuild.js"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"next-themes": "^0.4.6",
|
|
21
|
+
"clsx": "^2.1.1",
|
|
22
|
+
"tailwind-merge": "^3.3.1"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^19.0.0",
|
|
26
|
+
"react-dom": "^19.0.0",
|
|
27
|
+
"next": "^15.0.0 || ^16.0.0"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./server": {
|
|
35
|
+
"types": "./dist/server.d.ts",
|
|
36
|
+
"default": "./dist/server.js"
|
|
37
|
+
},
|
|
38
|
+
"./lib/themes": {
|
|
39
|
+
"types": "./dist/lib/themes.d.ts",
|
|
40
|
+
"default": "./dist/lib/themes.js"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|