acai-ui-library 0.1.13 → 0.1.15
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/alert.cjs +3 -2
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.js +3 -2
- package/dist/components/alert.js.map +1 -1
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.cjs +2 -1
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +2 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/data-table.cjs +2 -1
- package/dist/components/data-table.cjs.map +1 -1
- package/dist/components/data-table.js +2 -1
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.cjs.map +1 -1
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +2 -2
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/impersonation-banner.cjs +137 -0
- package/dist/components/impersonation-banner.cjs.map +1 -0
- package/dist/components/impersonation-banner.d.cts +36 -0
- package/dist/components/impersonation-banner.d.ts +36 -0
- package/dist/components/impersonation-banner.js +101 -0
- package/dist/components/impersonation-banner.js.map +1 -0
- package/dist/components/input.cjs +2 -1
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.js +2 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.cjs +1 -2
- package/dist/components/item.cjs.map +1 -1
- package/dist/components/item.js +1 -2
- package/dist/components/item.js.map +1 -1
- package/dist/components/pagination.cjs +3 -1
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.d.cts +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +3 -1
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/read-only-guard.cjs +103 -0
- package/dist/components/read-only-guard.cjs.map +1 -0
- package/dist/components/read-only-guard.d.cts +40 -0
- package/dist/components/read-only-guard.d.ts +40 -0
- package/dist/components/read-only-guard.js +64 -0
- package/dist/components/read-only-guard.js.map +1 -0
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +2 -2
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.js +2 -2
- package/dist/components/switch.js.map +1 -1
- package/dist/components/typography.cjs +4 -4
- package/dist/components/typography.cjs.map +1 -1
- package/dist/components/typography.js +4 -4
- package/dist/components/typography.js.map +1 -1
- package/dist/index.cjs +240 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +228 -16
- package/dist/index.js.map +1 -1
- package/dist/lib/impersonation.cjs +127 -0
- package/dist/lib/impersonation.cjs.map +1 -0
- package/dist/lib/impersonation.d.cts +45 -0
- package/dist/lib/impersonation.d.ts +45 -0
- package/dist/lib/impersonation.js +86 -0
- package/dist/lib/impersonation.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/read-only-guard.tsx
|
|
31
|
+
var read_only_guard_exports = {};
|
|
32
|
+
__export(read_only_guard_exports, {
|
|
33
|
+
READ_ONLY_REASON: () => READ_ONLY_REASON,
|
|
34
|
+
ReadOnlyGuard: () => ReadOnlyGuard,
|
|
35
|
+
isGuarded: () => isGuarded
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(read_only_guard_exports);
|
|
38
|
+
|
|
39
|
+
// src/lib/utils.ts
|
|
40
|
+
var import_clsx = require("clsx");
|
|
41
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
42
|
+
function cn(...inputs) {
|
|
43
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/components/tooltip.tsx
|
|
47
|
+
var React = __toESM(require("react"), 1);
|
|
48
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
51
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
52
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
53
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
TooltipPrimitive.Content,
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
sideOffset,
|
|
58
|
+
className: cn(
|
|
59
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
));
|
|
65
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
66
|
+
|
|
67
|
+
// src/components/read-only-guard.tsx
|
|
68
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
69
|
+
var READ_ONLY_REASON = "Read-only support session: this action is turned off.";
|
|
70
|
+
function isGuarded({ mode, ops, op = "WRITE" }) {
|
|
71
|
+
if (ops) return !ops.includes(op);
|
|
72
|
+
return mode === "READ";
|
|
73
|
+
}
|
|
74
|
+
function ReadOnlyGuard({ mode, ops, op = "WRITE", reason = READ_ONLY_REASON, className, children }) {
|
|
75
|
+
if (!isGuarded({ mode, ops, op })) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
|
|
76
|
+
const swallow = (e) => {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
e.stopPropagation();
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TooltipProvider, { delayDuration: 150, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tooltip, { children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
82
|
+
"span",
|
|
83
|
+
{
|
|
84
|
+
tabIndex: 0,
|
|
85
|
+
"data-read-only": "",
|
|
86
|
+
"aria-disabled": "true",
|
|
87
|
+
className: cn("inline-flex cursor-not-allowed", className),
|
|
88
|
+
onClickCapture: swallow,
|
|
89
|
+
onSubmitCapture: swallow,
|
|
90
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("fieldset", { disabled: true, className: "contents", children })
|
|
91
|
+
}
|
|
92
|
+
) }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TooltipContent, { children: reason })
|
|
94
|
+
] }) });
|
|
95
|
+
}
|
|
96
|
+
ReadOnlyGuard.displayName = "ReadOnlyGuard";
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
READ_ONLY_REASON,
|
|
100
|
+
ReadOnlyGuard,
|
|
101
|
+
isGuarded
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=read-only-guard.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/read-only-guard.tsx","../../src/lib/utils.ts","../../src/components/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../lib/utils\"\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"./tooltip\"\nimport type { ImpersonationMode, OperationClass } from \"../lib/impersonation\"\n\nexport interface ReadOnlyGuardProps {\n /**\n * The session mode from useImpersonation (imp_mode). READ disables the children. null or undefined (no support\n * session) leaves them alone.\n */\n mode?: ImpersonationMode | null\n /**\n * Approved operation classes from useImpersonation (imp_ops). When given, the children are disabled unless `op` is\n * in the list. Takes precedence over `mode`.\n */\n ops?: readonly OperationClass[] | null\n /** The class the wrapped action needs. Default WRITE. FINANCIAL and SECURITY are never approved in a support session. */\n op?: OperationClass\n /** Tooltip text while disabled. */\n reason?: string\n className?: string\n children: React.ReactNode\n}\n\nexport const READ_ONLY_REASON = \"Read-only support session: this action is turned off.\"\n\n/** Whether a guard with these props disables its children. */\nexport function isGuarded({ mode, ops, op = \"WRITE\" }: Pick<ReadOnlyGuardProps, \"mode\" | \"ops\" | \"op\">): boolean {\n if (ops) return !ops.includes(op)\n return mode === \"READ\"\n}\n\n/**\n * Disables what it wraps during a support session that may not perform the action (acai-ai-platform#1274).\n *\n * In READ mode (or when `op` is not among the approved `ops`) the children sit in a disabled <fieldset>, so every\n * native button, input, select and textarea inside is disabled, and clicks on anything else (links) are swallowed. A\n * tooltip explains why. Outside a support session it renders the children unchanged.\n *\n * This is a display aid. The backend refuses the request anyway (403 IMPERSONATION_OP_NOT_APPROVED).\n */\nfunction ReadOnlyGuard({ mode, ops, op = \"WRITE\", reason = READ_ONLY_REASON, className, children }: ReadOnlyGuardProps) {\n if (!isGuarded({ mode, ops, op })) return <>{children}</>\n\n const swallow = (e: React.SyntheticEvent) => {\n e.preventDefault()\n e.stopPropagation()\n }\n\n return (\n <TooltipProvider delayDuration={150}>\n <Tooltip>\n <TooltipTrigger asChild>\n <span\n // The wrapper takes focus so keyboard users also get the explanation; the controls inside cannot.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n data-read-only=\"\"\n aria-disabled=\"true\"\n className={cn(\"inline-flex cursor-not-allowed\", className)}\n onClickCapture={swallow}\n onSubmitCapture={swallow}\n >\n <fieldset disabled className=\"contents\">\n {children}\n </fieldset>\n </span>\n </TooltipTrigger>\n <TooltipContent>{reason}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )\n}\nReadOnlyGuard.displayName = \"ReadOnlyGuard\"\n\nexport { ReadOnlyGuard }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\nimport { cn } from \"../lib/utils\"\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAuB;AACvB,uBAAkC;AAahC;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;;;AFkBV,IAAAA,sBAAA;AAlBrC,IAAM,mBAAmB;AAGzB,SAAS,UAAU,EAAE,MAAM,KAAK,KAAK,QAAQ,GAA6D;AAC/G,MAAI,IAAK,QAAO,CAAC,IAAI,SAAS,EAAE;AAChC,SAAO,SAAS;AAClB;AAWA,SAAS,cAAc,EAAE,MAAM,KAAK,KAAK,SAAS,SAAS,kBAAkB,WAAW,SAAS,GAAuB;AACtH,MAAI,CAAC,UAAU,EAAE,MAAM,KAAK,GAAG,CAAC,EAAG,QAAO,6EAAG,UAAS;AAEtD,QAAM,UAAU,CAAC,MAA4B;AAC3C,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB;AAEA,SACE,6CAAC,mBAAgB,eAAe,KAC9B,wDAAC,WACC;AAAA,iDAAC,kBAAe,SAAO,MACrB;AAAA,MAAC;AAAA;AAAA,QAGC,UAAU;AAAA,QACV,kBAAe;AAAA,QACf,iBAAc;AAAA,QACd,WAAW,GAAG,kCAAkC,SAAS;AAAA,QACzD,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QAEjB,uDAAC,cAAS,UAAQ,MAAC,WAAU,YAC1B,UACH;AAAA;AAAA,IACF,GACF;AAAA,IACA,6CAAC,kBAAgB,kBAAO;AAAA,KAC1B,GACF;AAEJ;AACA,cAAc,cAAc;","names":["import_jsx_runtime"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ImpersonationMode, OperationClass } from '../lib/impersonation.cjs';
|
|
4
|
+
|
|
5
|
+
interface ReadOnlyGuardProps {
|
|
6
|
+
/**
|
|
7
|
+
* The session mode from useImpersonation (imp_mode). READ disables the children. null or undefined (no support
|
|
8
|
+
* session) leaves them alone.
|
|
9
|
+
*/
|
|
10
|
+
mode?: ImpersonationMode | null;
|
|
11
|
+
/**
|
|
12
|
+
* Approved operation classes from useImpersonation (imp_ops). When given, the children are disabled unless `op` is
|
|
13
|
+
* in the list. Takes precedence over `mode`.
|
|
14
|
+
*/
|
|
15
|
+
ops?: readonly OperationClass[] | null;
|
|
16
|
+
/** The class the wrapped action needs. Default WRITE. FINANCIAL and SECURITY are never approved in a support session. */
|
|
17
|
+
op?: OperationClass;
|
|
18
|
+
/** Tooltip text while disabled. */
|
|
19
|
+
reason?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare const READ_ONLY_REASON = "Read-only support session: this action is turned off.";
|
|
24
|
+
/** Whether a guard with these props disables its children. */
|
|
25
|
+
declare function isGuarded({ mode, ops, op }: Pick<ReadOnlyGuardProps, "mode" | "ops" | "op">): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Disables what it wraps during a support session that may not perform the action (acai-ai-platform#1274).
|
|
28
|
+
*
|
|
29
|
+
* In READ mode (or when `op` is not among the approved `ops`) the children sit in a disabled <fieldset>, so every
|
|
30
|
+
* native button, input, select and textarea inside is disabled, and clicks on anything else (links) are swallowed. A
|
|
31
|
+
* tooltip explains why. Outside a support session it renders the children unchanged.
|
|
32
|
+
*
|
|
33
|
+
* This is a display aid. The backend refuses the request anyway (403 IMPERSONATION_OP_NOT_APPROVED).
|
|
34
|
+
*/
|
|
35
|
+
declare function ReadOnlyGuard({ mode, ops, op, reason, className, children }: ReadOnlyGuardProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare namespace ReadOnlyGuard {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { READ_ONLY_REASON, ReadOnlyGuard, type ReadOnlyGuardProps, isGuarded };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ImpersonationMode, OperationClass } from '../lib/impersonation.js';
|
|
4
|
+
|
|
5
|
+
interface ReadOnlyGuardProps {
|
|
6
|
+
/**
|
|
7
|
+
* The session mode from useImpersonation (imp_mode). READ disables the children. null or undefined (no support
|
|
8
|
+
* session) leaves them alone.
|
|
9
|
+
*/
|
|
10
|
+
mode?: ImpersonationMode | null;
|
|
11
|
+
/**
|
|
12
|
+
* Approved operation classes from useImpersonation (imp_ops). When given, the children are disabled unless `op` is
|
|
13
|
+
* in the list. Takes precedence over `mode`.
|
|
14
|
+
*/
|
|
15
|
+
ops?: readonly OperationClass[] | null;
|
|
16
|
+
/** The class the wrapped action needs. Default WRITE. FINANCIAL and SECURITY are never approved in a support session. */
|
|
17
|
+
op?: OperationClass;
|
|
18
|
+
/** Tooltip text while disabled. */
|
|
19
|
+
reason?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare const READ_ONLY_REASON = "Read-only support session: this action is turned off.";
|
|
24
|
+
/** Whether a guard with these props disables its children. */
|
|
25
|
+
declare function isGuarded({ mode, ops, op }: Pick<ReadOnlyGuardProps, "mode" | "ops" | "op">): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Disables what it wraps during a support session that may not perform the action (acai-ai-platform#1274).
|
|
28
|
+
*
|
|
29
|
+
* In READ mode (or when `op` is not among the approved `ops`) the children sit in a disabled <fieldset>, so every
|
|
30
|
+
* native button, input, select and textarea inside is disabled, and clicks on anything else (links) are swallowed. A
|
|
31
|
+
* tooltip explains why. Outside a support session it renders the children unchanged.
|
|
32
|
+
*
|
|
33
|
+
* This is a display aid. The backend refuses the request anyway (403 IMPERSONATION_OP_NOT_APPROVED).
|
|
34
|
+
*/
|
|
35
|
+
declare function ReadOnlyGuard({ mode, ops, op, reason, className, children }: ReadOnlyGuardProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare namespace ReadOnlyGuard {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { READ_ONLY_REASON, ReadOnlyGuard, type ReadOnlyGuardProps, isGuarded };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// src/lib/utils.ts
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// src/components/tooltip.tsx
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
13
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
14
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
15
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
16
|
+
TooltipPrimitive.Content,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
sideOffset,
|
|
20
|
+
className: cn(
|
|
21
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
28
|
+
|
|
29
|
+
// src/components/read-only-guard.tsx
|
|
30
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
31
|
+
var READ_ONLY_REASON = "Read-only support session: this action is turned off.";
|
|
32
|
+
function isGuarded({ mode, ops, op = "WRITE" }) {
|
|
33
|
+
if (ops) return !ops.includes(op);
|
|
34
|
+
return mode === "READ";
|
|
35
|
+
}
|
|
36
|
+
function ReadOnlyGuard({ mode, ops, op = "WRITE", reason = READ_ONLY_REASON, className, children }) {
|
|
37
|
+
if (!isGuarded({ mode, ops, op })) return /* @__PURE__ */ jsx2(Fragment, { children });
|
|
38
|
+
const swallow = (e) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsx2(TooltipProvider, { delayDuration: 150, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx2(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx2(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
tabIndex: 0,
|
|
47
|
+
"data-read-only": "",
|
|
48
|
+
"aria-disabled": "true",
|
|
49
|
+
className: cn("inline-flex cursor-not-allowed", className),
|
|
50
|
+
onClickCapture: swallow,
|
|
51
|
+
onSubmitCapture: swallow,
|
|
52
|
+
children: /* @__PURE__ */ jsx2("fieldset", { disabled: true, className: "contents", children })
|
|
53
|
+
}
|
|
54
|
+
) }),
|
|
55
|
+
/* @__PURE__ */ jsx2(TooltipContent, { children: reason })
|
|
56
|
+
] }) });
|
|
57
|
+
}
|
|
58
|
+
ReadOnlyGuard.displayName = "ReadOnlyGuard";
|
|
59
|
+
export {
|
|
60
|
+
READ_ONLY_REASON,
|
|
61
|
+
ReadOnlyGuard,
|
|
62
|
+
isGuarded
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=read-only-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/tooltip.tsx","../../src/components/read-only-guard.tsx"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\nimport { cn } from \"../lib/utils\"\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","import * as React from \"react\"\nimport { cn } from \"../lib/utils\"\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"./tooltip\"\nimport type { ImpersonationMode, OperationClass } from \"../lib/impersonation\"\n\nexport interface ReadOnlyGuardProps {\n /**\n * The session mode from useImpersonation (imp_mode). READ disables the children. null or undefined (no support\n * session) leaves them alone.\n */\n mode?: ImpersonationMode | null\n /**\n * Approved operation classes from useImpersonation (imp_ops). When given, the children are disabled unless `op` is\n * in the list. Takes precedence over `mode`.\n */\n ops?: readonly OperationClass[] | null\n /** The class the wrapped action needs. Default WRITE. FINANCIAL and SECURITY are never approved in a support session. */\n op?: OperationClass\n /** Tooltip text while disabled. */\n reason?: string\n className?: string\n children: React.ReactNode\n}\n\nexport const READ_ONLY_REASON = \"Read-only support session: this action is turned off.\"\n\n/** Whether a guard with these props disables its children. */\nexport function isGuarded({ mode, ops, op = \"WRITE\" }: Pick<ReadOnlyGuardProps, \"mode\" | \"ops\" | \"op\">): boolean {\n if (ops) return !ops.includes(op)\n return mode === \"READ\"\n}\n\n/**\n * Disables what it wraps during a support session that may not perform the action (acai-ai-platform#1274).\n *\n * In READ mode (or when `op` is not among the approved `ops`) the children sit in a disabled <fieldset>, so every\n * native button, input, select and textarea inside is disabled, and clicks on anything else (links) are swallowed. A\n * tooltip explains why. Outside a support session it renders the children unchanged.\n *\n * This is a display aid. The backend refuses the request anyway (403 IMPERSONATION_OP_NOT_APPROVED).\n */\nfunction ReadOnlyGuard({ mode, ops, op = \"WRITE\", reason = READ_ONLY_REASON, className, children }: ReadOnlyGuardProps) {\n if (!isGuarded({ mode, ops, op })) return <>{children}</>\n\n const swallow = (e: React.SyntheticEvent) => {\n e.preventDefault()\n e.stopPropagation()\n }\n\n return (\n <TooltipProvider delayDuration={150}>\n <Tooltip>\n <TooltipTrigger asChild>\n <span\n // The wrapper takes focus so keyboard users also get the explanation; the controls inside cannot.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n data-read-only=\"\"\n aria-disabled=\"true\"\n className={cn(\"inline-flex cursor-not-allowed\", className)}\n onClickCapture={swallow}\n onSubmitCapture={swallow}\n >\n <fieldset disabled className=\"contents\">\n {children}\n </fieldset>\n </span>\n </TooltipTrigger>\n <TooltipContent>{reason}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )\n}\nReadOnlyGuard.displayName = \"ReadOnlyGuard\"\n\nexport { ReadOnlyGuard }\n"],"mappings":";AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAahC;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;;;ACkBV,0BAAAA,MAStC,YATsC;AAlBrC,IAAM,mBAAmB;AAGzB,SAAS,UAAU,EAAE,MAAM,KAAK,KAAK,QAAQ,GAA6D;AAC/G,MAAI,IAAK,QAAO,CAAC,IAAI,SAAS,EAAE;AAChC,SAAO,SAAS;AAClB;AAWA,SAAS,cAAc,EAAE,MAAM,KAAK,KAAK,SAAS,SAAS,kBAAkB,WAAW,SAAS,GAAuB;AACtH,MAAI,CAAC,UAAU,EAAE,MAAM,KAAK,GAAG,CAAC,EAAG,QAAO,gBAAAA,KAAA,YAAG,UAAS;AAEtD,QAAM,UAAU,CAAC,MAA4B;AAC3C,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB;AAEA,SACE,gBAAAA,KAAC,mBAAgB,eAAe,KAC9B,+BAAC,WACC;AAAA,oBAAAA,KAAC,kBAAe,SAAO,MACrB,0BAAAA;AAAA,MAAC;AAAA;AAAA,QAGC,UAAU;AAAA,QACV,kBAAe;AAAA,QACf,iBAAc;AAAA,QACd,WAAW,GAAG,kCAAkC,SAAS;AAAA,QACzD,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QAEjB,0BAAAA,KAAC,cAAS,UAAQ,MAAC,WAAU,YAC1B,UACH;AAAA;AAAA,IACF,GACF;AAAA,IACA,gBAAAA,KAAC,kBAAgB,kBAAO;AAAA,KAC1B,GACF;AAEJ;AACA,cAAc,cAAc;","names":["jsx"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/stepper.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { Check } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\n/* ---------------------------------- Types --------------------------------- */\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Zero-indexed active step */\n activeStep: number\n /** When true, each step's circle+label is rendered inside a button. */\n clickable?: boolean\n /** Called when a clickable step is activated (click or Enter/Space). */\n onStepChange?: (index: number) => void\n}\n\nexport interface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Label displayed below the step circle */\n label: string\n}\n\n/* ----------------------------- Internal context ---------------------------- */\n\ninterface StepperContextValue {\n activeStep: number\n totalSteps: number\n clickable: boolean\n onStepChange?: (index: number) => void\n registerButton: (index: number, el: HTMLButtonElement | null) => void\n}\n\nconst StepperContext = React.createContext<StepperContextValue>({\n activeStep: 0,\n totalSteps: 0,\n clickable: false,\n registerButton: () => {},\n})\n\n/* --------------------------------- Stepper -------------------------------- */\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n activeStep,\n clickable = false,\n onStepChange,\n className,\n children,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const steps = React.Children.toArray(children)\n const buttonRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n\n const registerButton = React.useCallback(\n (index: number, el: HTMLButtonElement | null) => {\n buttonRefs.current[index] = el\n },\n []\n )\n\n const focusButton = (index: number) => {\n const btn = buttonRefs.current[index]\n if (btn && !btn.disabled) btn.focus()\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e)\n if (!clickable) return\n if (e.key !== \"ArrowLeft\" && e.key !== \"ArrowRight\") return\n\n const current = buttonRefs.current.findIndex(\n (b) => b === document.activeElement\n )\n if (current === -1) return\n\n const dir = e.key === \"ArrowRight\" ? 1 : -1\n const last = steps.length - 1\n let next = current + dir\n // Skip disabled (upcoming) buttons.\n while (next >= 0 && next <= last) {\n const btn = buttonRefs.current[next]\n if (btn && !btn.disabled) {\n e.preventDefault()\n focusButton(next)\n return\n }\n next += dir\n }\n }\n\n return (\n <StepperContext.Provider\n value={{\n activeStep,\n totalSteps: steps.length,\n clickable,\n onStepChange,\n registerButton,\n }}\n >\n <div\n ref={ref}\n className={cn(\"flex w-full items-start\", className)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {steps.map((child, index) => (\n <React.Fragment key={index}>\n {/* Render the StepperItem with injected index */}\n {React.isValidElement<StepperItemProps & { _index?: number }>(child)\n ? React.cloneElement(child, { _index: index } as any)\n : child}\n\n {/* Connecting line between steps */}\n {index < steps.length - 1 && (\n <div className=\"flex flex-1 items-center pt-[16px] px-2\">\n <div\n className={cn(\n \"h-[2px] w-full transition-colors duration-300 ease-out\",\n index < activeStep\n ? \"bg-[var(--hc-primary-600)]\"\n : \"bg-[var(--hc-grey-200)]\"\n )}\n />\n </div>\n )}\n </React.Fragment>\n ))}\n </div>\n </StepperContext.Provider>\n )\n }\n)\nStepper.displayName = \"Stepper\"\n\n/* ------------------------------- StepperItem ------------------------------ */\n\nconst StepperItem = React.forwardRef<\n HTMLDivElement,\n StepperItemProps & { _index?: number }\n>(({ label, className, _index = 0, ...props }, ref) => {\n const { activeStep, clickable, onStepChange, registerButton } =\n React.useContext(StepperContext)\n\n const status: \"completed\" | \"active\" | \"upcoming\" =\n _index < activeStep\n ? \"completed\"\n : _index === activeStep\n ? \"active\"\n : \"upcoming\"\n\n const circle = (\n <div\n className={cn(\n \"flex h-[32px] w-[32px] shrink-0 items-center justify-center rounded-full text-[14px] transition-colors duration-300 ease-out\",\n status === \"upcoming\" &&\n \"border-[2px] border-[var(--hc-grey-200)] bg-white text-[var(--hc-grey-400)]\",\n status === \"active\" &&\n \"bg-[var(--hc-primary-600)] font-semibold text-white\",\n status === \"completed\" && \"bg-[var(--hc-primary-600)] text-white\"\n )}\n >\n {status === \"completed\" ? (\n <Check className=\"h-[14px] w-[14px]\" />\n ) : (\n _index + 1\n )}\n </div>\n )\n\n const labelEl = (\n <span className=\"mt-[8px] text-center text-[12px] text-foreground\">\n {label}\n </span>\n )\n\n if (clickable) {\n const disabled = _index > activeStep\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n <button\n type=\"button\"\n ref={(el) => registerButton(_index, el)}\n disabled={disabled}\n tabIndex={status === \"active\" ? 0 : -1}\n onClick={() => !disabled && onStepChange?.(_index)}\n className={cn(\n \"flex flex-col items-center rounded-[4px] outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-[var(--hc-primary-600)] focus-visible:ring-offset-2\",\n disabled ? \"cursor-default\" : \"cursor-pointer\"\n )}\n aria-current={status === \"active\" ? \"step\" : undefined}\n >\n {circle}\n {labelEl}\n </button>\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n {circle}\n {labelEl}\n </div>\n )\n})\nStepperItem.displayName = \"StepperItem\"\n\nexport { Stepper, StepperItem }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,0BAAsB;;;ACDtB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;
|
|
1
|
+
{"version":3,"sources":["../../src/components/stepper.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { Check } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\n/* ---------------------------------- Types --------------------------------- */\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Zero-indexed active step */\n activeStep: number\n /** When true, each step's circle+label is rendered inside a button. */\n clickable?: boolean\n /** Called when a clickable step is activated (click or Enter/Space). */\n onStepChange?: (index: number) => void\n}\n\nexport interface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Label displayed below the step circle */\n label: string\n}\n\n/* ----------------------------- Internal context ---------------------------- */\n\ninterface StepperContextValue {\n activeStep: number\n totalSteps: number\n clickable: boolean\n onStepChange?: (index: number) => void\n registerButton: (index: number, el: HTMLButtonElement | null) => void\n}\n\nconst StepperContext = React.createContext<StepperContextValue>({\n activeStep: 0,\n totalSteps: 0,\n clickable: false,\n registerButton: () => {},\n})\n\n/* --------------------------------- Stepper -------------------------------- */\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n activeStep,\n clickable = false,\n onStepChange,\n className,\n children,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const steps = React.Children.toArray(children)\n const buttonRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n\n const registerButton = React.useCallback(\n (index: number, el: HTMLButtonElement | null) => {\n buttonRefs.current[index] = el\n },\n []\n )\n\n const focusButton = (index: number) => {\n const btn = buttonRefs.current[index]\n if (btn && !btn.disabled) btn.focus()\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e)\n if (!clickable) return\n if (e.key !== \"ArrowLeft\" && e.key !== \"ArrowRight\") return\n\n const current = buttonRefs.current.findIndex(\n (b) => b === document.activeElement\n )\n if (current === -1) return\n\n const dir = e.key === \"ArrowRight\" ? 1 : -1\n const last = steps.length - 1\n let next = current + dir\n // Skip disabled (upcoming) buttons.\n while (next >= 0 && next <= last) {\n const btn = buttonRefs.current[next]\n if (btn && !btn.disabled) {\n e.preventDefault()\n focusButton(next)\n return\n }\n next += dir\n }\n }\n\n return (\n <StepperContext.Provider\n value={{\n activeStep,\n totalSteps: steps.length,\n clickable,\n onStepChange,\n registerButton,\n }}\n >\n {/* Arrow keys bubble up from the focusable step buttons; the container only\n delegates them (roving focus), it is not itself an interactive element. */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n ref={ref}\n className={cn(\"flex w-full items-start\", className)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {steps.map((child, index) => (\n <React.Fragment key={index}>\n {/* Render the StepperItem with injected index */}\n {React.isValidElement<StepperItemProps & { _index?: number }>(child)\n ? React.cloneElement(child, { _index: index } as any)\n : child}\n\n {/* Connecting line between steps */}\n {index < steps.length - 1 && (\n <div className=\"flex flex-1 items-center pt-[16px] px-2\">\n <div\n className={cn(\n \"h-[2px] w-full transition-colors duration-300 ease-out\",\n index < activeStep\n ? \"bg-[var(--hc-primary-600)]\"\n : \"bg-[var(--hc-grey-200)]\"\n )}\n />\n </div>\n )}\n </React.Fragment>\n ))}\n </div>\n </StepperContext.Provider>\n )\n }\n)\nStepper.displayName = \"Stepper\"\n\n/* ------------------------------- StepperItem ------------------------------ */\n\nconst StepperItem = React.forwardRef<\n HTMLDivElement,\n StepperItemProps & { _index?: number }\n>(({ label, className, _index = 0, ...props }, ref) => {\n const { activeStep, clickable, onStepChange, registerButton } =\n React.useContext(StepperContext)\n\n const status: \"completed\" | \"active\" | \"upcoming\" =\n _index < activeStep\n ? \"completed\"\n : _index === activeStep\n ? \"active\"\n : \"upcoming\"\n\n const circle = (\n <div\n className={cn(\n \"flex h-[32px] w-[32px] shrink-0 items-center justify-center rounded-full text-[14px] transition-colors duration-300 ease-out\",\n status === \"upcoming\" &&\n \"border-[2px] border-[var(--hc-grey-200)] bg-white text-[var(--hc-grey-400)]\",\n status === \"active\" &&\n \"bg-[var(--hc-primary-600)] font-semibold text-white\",\n status === \"completed\" && \"bg-[var(--hc-primary-600)] text-white\"\n )}\n >\n {status === \"completed\" ? (\n <Check className=\"h-[14px] w-[14px]\" />\n ) : (\n _index + 1\n )}\n </div>\n )\n\n const labelEl = (\n <span className=\"mt-[8px] text-center text-[12px] text-foreground\">\n {label}\n </span>\n )\n\n if (clickable) {\n const disabled = _index > activeStep\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n <button\n type=\"button\"\n ref={(el) => registerButton(_index, el)}\n disabled={disabled}\n tabIndex={status === \"active\" ? 0 : -1}\n onClick={() => !disabled && onStepChange?.(_index)}\n className={cn(\n \"flex flex-col items-center rounded-[4px] outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-[var(--hc-primary-600)] focus-visible:ring-offset-2\",\n disabled ? \"cursor-default\" : \"cursor-pointer\"\n )}\n aria-current={status === \"active\" ? \"step\" : undefined}\n >\n {circle}\n {labelEl}\n </button>\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n {circle}\n {labelEl}\n </div>\n )\n})\nStepperItem.displayName = \"StepperItem\"\n\nexport { Stepper, StepperItem }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,0BAAsB;;;ACDtB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD2GY;AAlFZ,IAAM,iBAAuB,oBAAmC;AAAA,EAC9D,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,gBAAgB,MAAM;AAAA,EAAC;AACzB,CAAC;AAID,IAAM,UAAgB;AAAA,EACpB,CACE;AAAA,IACE;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,QAAc,eAAS,QAAQ,QAAQ;AAC7C,UAAM,aAAmB,aAAwC,CAAC,CAAC;AAEnE,UAAM,iBAAuB;AAAA,MAC3B,CAAC,OAAe,OAAiC;AAC/C,mBAAW,QAAQ,KAAK,IAAI;AAAA,MAC9B;AAAA,MACA,CAAC;AAAA,IACH;AAEA,UAAM,cAAc,CAAC,UAAkB;AACrC,YAAM,MAAM,W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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/stepper.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { Check } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\n/* ---------------------------------- Types --------------------------------- */\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Zero-indexed active step */\n activeStep: number\n /** When true, each step's circle+label is rendered inside a button. */\n clickable?: boolean\n /** Called when a clickable step is activated (click or Enter/Space). */\n onStepChange?: (index: number) => void\n}\n\nexport interface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Label displayed below the step circle */\n label: string\n}\n\n/* ----------------------------- Internal context ---------------------------- */\n\ninterface StepperContextValue {\n activeStep: number\n totalSteps: number\n clickable: boolean\n onStepChange?: (index: number) => void\n registerButton: (index: number, el: HTMLButtonElement | null) => void\n}\n\nconst StepperContext = React.createContext<StepperContextValue>({\n activeStep: 0,\n totalSteps: 0,\n clickable: false,\n registerButton: () => {},\n})\n\n/* --------------------------------- Stepper -------------------------------- */\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n activeStep,\n clickable = false,\n onStepChange,\n className,\n children,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const steps = React.Children.toArray(children)\n const buttonRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n\n const registerButton = React.useCallback(\n (index: number, el: HTMLButtonElement | null) => {\n buttonRefs.current[index] = el\n },\n []\n )\n\n const focusButton = (index: number) => {\n const btn = buttonRefs.current[index]\n if (btn && !btn.disabled) btn.focus()\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e)\n if (!clickable) return\n if (e.key !== \"ArrowLeft\" && e.key !== \"ArrowRight\") return\n\n const current = buttonRefs.current.findIndex(\n (b) => b === document.activeElement\n )\n if (current === -1) return\n\n const dir = e.key === \"ArrowRight\" ? 1 : -1\n const last = steps.length - 1\n let next = current + dir\n // Skip disabled (upcoming) buttons.\n while (next >= 0 && next <= last) {\n const btn = buttonRefs.current[next]\n if (btn && !btn.disabled) {\n e.preventDefault()\n focusButton(next)\n return\n }\n next += dir\n }\n }\n\n return (\n <StepperContext.Provider\n value={{\n activeStep,\n totalSteps: steps.length,\n clickable,\n onStepChange,\n registerButton,\n }}\n >\n <div\n ref={ref}\n className={cn(\"flex w-full items-start\", className)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {steps.map((child, index) => (\n <React.Fragment key={index}>\n {/* Render the StepperItem with injected index */}\n {React.isValidElement<StepperItemProps & { _index?: number }>(child)\n ? React.cloneElement(child, { _index: index } as any)\n : child}\n\n {/* Connecting line between steps */}\n {index < steps.length - 1 && (\n <div className=\"flex flex-1 items-center pt-[16px] px-2\">\n <div\n className={cn(\n \"h-[2px] w-full transition-colors duration-300 ease-out\",\n index < activeStep\n ? \"bg-[var(--hc-primary-600)]\"\n : \"bg-[var(--hc-grey-200)]\"\n )}\n />\n </div>\n )}\n </React.Fragment>\n ))}\n </div>\n </StepperContext.Provider>\n )\n }\n)\nStepper.displayName = \"Stepper\"\n\n/* ------------------------------- StepperItem ------------------------------ */\n\nconst StepperItem = React.forwardRef<\n HTMLDivElement,\n StepperItemProps & { _index?: number }\n>(({ label, className, _index = 0, ...props }, ref) => {\n const { activeStep, clickable, onStepChange, registerButton } =\n React.useContext(StepperContext)\n\n const status: \"completed\" | \"active\" | \"upcoming\" =\n _index < activeStep\n ? \"completed\"\n : _index === activeStep\n ? \"active\"\n : \"upcoming\"\n\n const circle = (\n <div\n className={cn(\n \"flex h-[32px] w-[32px] shrink-0 items-center justify-center rounded-full text-[14px] transition-colors duration-300 ease-out\",\n status === \"upcoming\" &&\n \"border-[2px] border-[var(--hc-grey-200)] bg-white text-[var(--hc-grey-400)]\",\n status === \"active\" &&\n \"bg-[var(--hc-primary-600)] font-semibold text-white\",\n status === \"completed\" && \"bg-[var(--hc-primary-600)] text-white\"\n )}\n >\n {status === \"completed\" ? (\n <Check className=\"h-[14px] w-[14px]\" />\n ) : (\n _index + 1\n )}\n </div>\n )\n\n const labelEl = (\n <span className=\"mt-[8px] text-center text-[12px] text-foreground\">\n {label}\n </span>\n )\n\n if (clickable) {\n const disabled = _index > activeStep\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n <button\n type=\"button\"\n ref={(el) => registerButton(_index, el)}\n disabled={disabled}\n tabIndex={status === \"active\" ? 0 : -1}\n onClick={() => !disabled && onStepChange?.(_index)}\n className={cn(\n \"flex flex-col items-center rounded-[4px] outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-[var(--hc-primary-600)] focus-visible:ring-offset-2\",\n disabled ? \"cursor-default\" : \"cursor-pointer\"\n )}\n aria-current={status === \"active\" ? \"step\" : undefined}\n >\n {circle}\n {labelEl}\n </button>\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n {circle}\n {labelEl}\n </div>\n )\n})\nStepperItem.displayName = \"StepperItem\"\n\nexport { Stepper, StepperItem }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,aAAa;;;ACDtB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;
|
|
1
|
+
{"version":3,"sources":["../../src/components/stepper.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { Check } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\n/* ---------------------------------- Types --------------------------------- */\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Zero-indexed active step */\n activeStep: number\n /** When true, each step's circle+label is rendered inside a button. */\n clickable?: boolean\n /** Called when a clickable step is activated (click or Enter/Space). */\n onStepChange?: (index: number) => void\n}\n\nexport interface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Label displayed below the step circle */\n label: string\n}\n\n/* ----------------------------- Internal context ---------------------------- */\n\ninterface StepperContextValue {\n activeStep: number\n totalSteps: number\n clickable: boolean\n onStepChange?: (index: number) => void\n registerButton: (index: number, el: HTMLButtonElement | null) => void\n}\n\nconst StepperContext = React.createContext<StepperContextValue>({\n activeStep: 0,\n totalSteps: 0,\n clickable: false,\n registerButton: () => {},\n})\n\n/* --------------------------------- Stepper -------------------------------- */\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n activeStep,\n clickable = false,\n onStepChange,\n className,\n children,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const steps = React.Children.toArray(children)\n const buttonRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n\n const registerButton = React.useCallback(\n (index: number, el: HTMLButtonElement | null) => {\n buttonRefs.current[index] = el\n },\n []\n )\n\n const focusButton = (index: number) => {\n const btn = buttonRefs.current[index]\n if (btn && !btn.disabled) btn.focus()\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e)\n if (!clickable) return\n if (e.key !== \"ArrowLeft\" && e.key !== \"ArrowRight\") return\n\n const current = buttonRefs.current.findIndex(\n (b) => b === document.activeElement\n )\n if (current === -1) return\n\n const dir = e.key === \"ArrowRight\" ? 1 : -1\n const last = steps.length - 1\n let next = current + dir\n // Skip disabled (upcoming) buttons.\n while (next >= 0 && next <= last) {\n const btn = buttonRefs.current[next]\n if (btn && !btn.disabled) {\n e.preventDefault()\n focusButton(next)\n return\n }\n next += dir\n }\n }\n\n return (\n <StepperContext.Provider\n value={{\n activeStep,\n totalSteps: steps.length,\n clickable,\n onStepChange,\n registerButton,\n }}\n >\n {/* Arrow keys bubble up from the focusable step buttons; the container only\n delegates them (roving focus), it is not itself an interactive element. */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n ref={ref}\n className={cn(\"flex w-full items-start\", className)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {steps.map((child, index) => (\n <React.Fragment key={index}>\n {/* Render the StepperItem with injected index */}\n {React.isValidElement<StepperItemProps & { _index?: number }>(child)\n ? React.cloneElement(child, { _index: index } as any)\n : child}\n\n {/* Connecting line between steps */}\n {index < steps.length - 1 && (\n <div className=\"flex flex-1 items-center pt-[16px] px-2\">\n <div\n className={cn(\n \"h-[2px] w-full transition-colors duration-300 ease-out\",\n index < activeStep\n ? \"bg-[var(--hc-primary-600)]\"\n : \"bg-[var(--hc-grey-200)]\"\n )}\n />\n </div>\n )}\n </React.Fragment>\n ))}\n </div>\n </StepperContext.Provider>\n )\n }\n)\nStepper.displayName = \"Stepper\"\n\n/* ------------------------------- StepperItem ------------------------------ */\n\nconst StepperItem = React.forwardRef<\n HTMLDivElement,\n StepperItemProps & { _index?: number }\n>(({ label, className, _index = 0, ...props }, ref) => {\n const { activeStep, clickable, onStepChange, registerButton } =\n React.useContext(StepperContext)\n\n const status: \"completed\" | \"active\" | \"upcoming\" =\n _index < activeStep\n ? \"completed\"\n : _index === activeStep\n ? \"active\"\n : \"upcoming\"\n\n const circle = (\n <div\n className={cn(\n \"flex h-[32px] w-[32px] shrink-0 items-center justify-center rounded-full text-[14px] transition-colors duration-300 ease-out\",\n status === \"upcoming\" &&\n \"border-[2px] border-[var(--hc-grey-200)] bg-white text-[var(--hc-grey-400)]\",\n status === \"active\" &&\n \"bg-[var(--hc-primary-600)] font-semibold text-white\",\n status === \"completed\" && \"bg-[var(--hc-primary-600)] text-white\"\n )}\n >\n {status === \"completed\" ? (\n <Check className=\"h-[14px] w-[14px]\" />\n ) : (\n _index + 1\n )}\n </div>\n )\n\n const labelEl = (\n <span className=\"mt-[8px] text-center text-[12px] text-foreground\">\n {label}\n </span>\n )\n\n if (clickable) {\n const disabled = _index > activeStep\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n <button\n type=\"button\"\n ref={(el) => registerButton(_index, el)}\n disabled={disabled}\n tabIndex={status === \"active\" ? 0 : -1}\n onClick={() => !disabled && onStepChange?.(_index)}\n className={cn(\n \"flex flex-col items-center rounded-[4px] outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-[var(--hc-primary-600)] focus-visible:ring-offset-2\",\n disabled ? \"cursor-default\" : \"cursor-pointer\"\n )}\n aria-current={status === \"active\" ? \"step\" : undefined}\n >\n {circle}\n {labelEl}\n </button>\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n >\n {circle}\n {labelEl}\n </div>\n )\n})\nStepperItem.displayName = \"StepperItem\"\n\nexport { Stepper, StepperItem }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,aAAa;;;ACDtB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD2GY,SASM,KATN;AAlFZ,IAAM,iBAAuB,oBAAmC;AAAA,EAC9D,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,gBAAgB,MAAM;AAAA,EAAC;AACzB,CAAC;AAID,IAAM,UAAgB;AAAA,EACpB,CACE;AAAA,IACE;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,QAAc,eAAS,QAAQ,QAAQ;AAC7C,UAAM,aAAmB,aAAwC,CAAC,CAAC;AAEnE,UAAM,iBAAuB;AAAA,MAC3B,CAAC,OAAe,OAAiC;AAC/C,mBAAW,QAAQ,KAAK,IAAI;AAAA,MAC9B;AAAA,MACA,CAAC;A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AAA;AAAA,EACH;AAEJ,CAAC;AACD,YAAY,cAAc;","names":[]}
|
|
@@ -48,7 +48,7 @@ function cn(...inputs) {
|
|
|
48
48
|
// src/components/switch.tsx
|
|
49
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
50
|
var switchVariants = (0, import_class_variance_authority.cva)(
|
|
51
|
-
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-
|
|
51
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-400,#7C7C83)] aria-[invalid=true]:ring-2 aria-[invalid=true]:ring-destructive aria-[invalid=true]:ring-offset-2",
|
|
52
52
|
{
|
|
53
53
|
variants: {
|
|
54
54
|
variant: {
|
|
@@ -83,7 +83,7 @@ var Switch = React.forwardRef(({ className, variant, size = "default", ...props
|
|
|
83
83
|
SwitchPrimitives.Thumb,
|
|
84
84
|
{
|
|
85
85
|
className: cn(
|
|
86
|
-
"pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 [[disabled]_&]:bg-[var(--hc-grey-300)]",
|
|
86
|
+
"pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 [[disabled]_&]:bg-[var(--hc-grey-300,#A2A2A6)]",
|
|
87
87
|
thumbStyles[size ?? "default"]
|
|
88
88
|
)
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/switch.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../lib/utils\"\n\ntype SwitchSize = \"sm\" | \"default\" | \"lg\"\n\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-
|
|
1
|
+
{"version":3,"sources":["../../src/components/switch.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../lib/utils\"\n\ntype SwitchSize = \"sm\" | \"default\" | \"lg\"\n\n// Unchecked track: grey-400 (>=3:1 on white and on dark surfaces); the fallback covers apps that do not load the library tokens.\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-400,#7C7C83)] aria-[invalid=true]:ring-2 aria-[invalid=true]:ring-destructive aria-[invalid=true]:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"data-[state=checked]:bg-[var(--hc-primary-600)]\",\n destructive: \"data-[state=checked]:bg-destructive\",\n success: \"data-[state=checked]:bg-success\",\n },\n size: {\n sm: \"h-5 w-9\",\n default: \"h-[28px] w-[52px]\",\n lg: \"h-[36px] w-[64px]\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nconst thumbStyles: Record<SwitchSize, string> = {\n sm: \"h-3.5 w-3.5 data-[state=unchecked]:translate-x-[3px] data-[state=checked]:translate-x-[15px]\",\n default:\n \"h-[22px] w-[22px] data-[state=unchecked]:translate-x-[3px] data-[state=checked]:translate-x-[23px]\",\n lg: \"h-[26px] w-[26px] data-[state=unchecked]:translate-x-[4px] data-[state=checked]:translate-x-[30px]\",\n}\n\nexport interface SwitchProps\n extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n SwitchProps\n>(({ className, variant, size = \"default\", ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(switchVariants({ variant, size }), className)}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 [[disabled]_&]:bg-[var(--hc-grey-300,#A2A2A6)]\",\n thumbStyles[(size ?? \"default\") as SwitchSize]\n )}\n />\n </SwitchPrimitives.Root>\n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch, switchVariants }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,uBAAkC;AAClC,sCAAuC;;;ACFvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD6CI;AA1CJ,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,MACX;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,IAAM,cAA0C;AAAA,EAC9C,IAAI;AAAA,EACJ,SACE;AAAA,EACF,IAAI;AACN;AAMA,IAAM,SAAe,iBAGnB,CAAC,EAAE,WAAW,SAAS,OAAO,WAAW,GAAG,MAAM,GAAG,QACrD;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC,WAAW,GAAG,eAAe,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS;AAAA,IACzD,GAAG;AAAA,IACJ;AAAA,IAEA;AAAA,MAAkB;AAAA,MAAjB;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,YAAa,QAAQ,SAAwB;AAAA,QAC/C;AAAA;AAAA,IACF;AAAA;AACF,CACD;AACD,OAAO,cAA+B,sBAAK;","names":[]}
|
|
@@ -13,7 +13,7 @@ function cn(...inputs) {
|
|
|
13
13
|
// src/components/switch.tsx
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
15
15
|
var switchVariants = cva(
|
|
16
|
-
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-
|
|
16
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-400,#7C7C83)] aria-[invalid=true]:ring-2 aria-[invalid=true]:ring-destructive aria-[invalid=true]:ring-offset-2",
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
@@ -48,7 +48,7 @@ var Switch = React.forwardRef(({ className, variant, size = "default", ...props
|
|
|
48
48
|
SwitchPrimitives.Thumb,
|
|
49
49
|
{
|
|
50
50
|
className: cn(
|
|
51
|
-
"pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 [[disabled]_&]:bg-[var(--hc-grey-300)]",
|
|
51
|
+
"pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 [[disabled]_&]:bg-[var(--hc-grey-300,#A2A2A6)]",
|
|
52
52
|
thumbStyles[size ?? "default"]
|
|
53
53
|
)
|
|
54
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/switch.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../lib/utils\"\n\ntype SwitchSize = \"sm\" | \"default\" | \"lg\"\n\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-
|
|
1
|
+
{"version":3,"sources":["../../src/components/switch.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../lib/utils\"\n\ntype SwitchSize = \"sm\" | \"default\" | \"lg\"\n\n// Unchecked track: grey-400 (>=3:1 on white and on dark surfaces); the fallback covers apps that do not load the library tokens.\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-[var(--hc-grey-400,#7C7C83)] aria-[invalid=true]:ring-2 aria-[invalid=true]:ring-destructive aria-[invalid=true]:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"data-[state=checked]:bg-[var(--hc-primary-600)]\",\n destructive: \"data-[state=checked]:bg-destructive\",\n success: \"data-[state=checked]:bg-success\",\n },\n size: {\n sm: \"h-5 w-9\",\n default: \"h-[28px] w-[52px]\",\n lg: \"h-[36px] w-[64px]\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nconst thumbStyles: Record<SwitchSize, string> = {\n sm: \"h-3.5 w-3.5 data-[state=unchecked]:translate-x-[3px] data-[state=checked]:translate-x-[15px]\",\n default:\n \"h-[22px] w-[22px] data-[state=unchecked]:translate-x-[3px] data-[state=checked]:translate-x-[23px]\",\n lg: \"h-[26px] w-[26px] data-[state=unchecked]:translate-x-[4px] data-[state=checked]:translate-x-[30px]\",\n}\n\nexport interface SwitchProps\n extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n SwitchProps\n>(({ className, variant, size = \"default\", ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(switchVariants({ variant, size }), className)}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 [[disabled]_&]:bg-[var(--hc-grey-300,#A2A2A6)]\",\n thumbStyles[(size ?? \"default\") as SwitchSize]\n )}\n />\n </SwitchPrimitives.Root>\n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch, switchVariants }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAClC,SAAS,WAA8B;;;ACFvC,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD6CI;AA1CJ,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,MACX;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,IAAM,cAA0C;AAAA,EAC9C,IAAI;AAAA,EACJ,SACE;AAAA,EACF,IAAI;AACN;AAMA,IAAM,SAAe,iBAGnB,CAAC,EAAE,WAAW,SAAS,OAAO,WAAW,GAAG,MAAM,GAAG,QACrD;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC,WAAW,GAAG,eAAe,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS;AAAA,IACzD,GAAG;AAAA,IACJ;AAAA,IAEA;AAAA,MAAkB;AAAA,MAAjB;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,YAAa,QAAQ,SAAwB;AAAA,QAC/C;AAAA;AAAA,IACF;AAAA;AACF,CACD;AACD,OAAO,cAA+B,sBAAK;","names":[]}
|
|
@@ -75,19 +75,19 @@ function resolveColor(color, defaultColorClass) {
|
|
|
75
75
|
return colorMap[color];
|
|
76
76
|
}
|
|
77
77
|
var H1 = React.forwardRef(
|
|
78
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { ref, className: cn("scroll-m-20 text-3xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
78
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { ref, className: cn("scroll-m-20 text-3xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
79
79
|
);
|
|
80
80
|
H1.displayName = "H1";
|
|
81
81
|
var H2 = React.forwardRef(
|
|
82
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { ref, className: cn("scroll-m-20 text-2xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
82
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { ref, className: cn("scroll-m-20 text-2xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
83
83
|
);
|
|
84
84
|
H2.displayName = "H2";
|
|
85
85
|
var H3 = React.forwardRef(
|
|
86
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { ref, className: cn("scroll-m-20 text-xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
86
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { ref, className: cn("scroll-m-20 text-xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
87
87
|
);
|
|
88
88
|
H3.displayName = "H3";
|
|
89
89
|
var H4 = React.forwardRef(
|
|
90
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { ref, className: cn("scroll-m-20 text-lg tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
90
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { ref, className: cn("scroll-m-20 text-lg tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
91
91
|
);
|
|
92
92
|
H4.displayName = "H4";
|
|
93
93
|
var Body = React.forwardRef(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/typography.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../lib/utils\"\n\nexport type TypographyWeight = \"extrabold\" | \"bold\" | \"semibold\" | \"medium\" | \"regular\" | \"light\"\n\nexport type TypographyColor =\n | \"default\"\n | \"secondary\"\n | \"foreground\"\n | \"muted\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"inherit\"\n\nconst weightMap: Record<TypographyWeight, string> = {\n extrabold: \"font-extrabold\",\n bold: \"font-bold\",\n semibold: \"font-semibold\",\n medium: \"font-medium\",\n regular: \"font-normal\",\n light: \"font-light\",\n}\n\nconst colorMap: Record<Exclude<TypographyColor, \"default\">, string> = {\n secondary: \"text-muted-foreground\",\n foreground: \"text-[var(--hc-color-foreground)]\",\n muted: \"text-muted-foreground\",\n success: \"text-[var(--hc-color-success)]\",\n warning: \"text-[var(--hc-color-warning)]\",\n destructive: \"text-[var(--hc-color-destructive)]\",\n inherit: \"text-inherit\",\n}\n\ninterface TypographyHeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\ninterface TypographyParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\nfunction resolveColor(color: TypographyColor | undefined, defaultColorClass: string): string {\n if (!color || color === \"default\") return defaultColorClass\n return colorMap[color]\n}\n\nconst H1 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, ...props }, ref) => (\n <h1 ref={ref} className={cn(\"scroll-m-20 text-3xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}
|
|
1
|
+
{"version":3,"sources":["../../src/components/typography.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../lib/utils\"\n\nexport type TypographyWeight = \"extrabold\" | \"bold\" | \"semibold\" | \"medium\" | \"regular\" | \"light\"\n\nexport type TypographyColor =\n | \"default\"\n | \"secondary\"\n | \"foreground\"\n | \"muted\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"inherit\"\n\nconst weightMap: Record<TypographyWeight, string> = {\n extrabold: \"font-extrabold\",\n bold: \"font-bold\",\n semibold: \"font-semibold\",\n medium: \"font-medium\",\n regular: \"font-normal\",\n light: \"font-light\",\n}\n\nconst colorMap: Record<Exclude<TypographyColor, \"default\">, string> = {\n secondary: \"text-muted-foreground\",\n foreground: \"text-[var(--hc-color-foreground)]\",\n muted: \"text-muted-foreground\",\n success: \"text-[var(--hc-color-success)]\",\n warning: \"text-[var(--hc-color-warning)]\",\n destructive: \"text-[var(--hc-color-destructive)]\",\n inherit: \"text-inherit\",\n}\n\ninterface TypographyHeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\ninterface TypographyParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\nfunction resolveColor(color: TypographyColor | undefined, defaultColorClass: string): string {\n if (!color || color === \"default\") return defaultColorClass\n return colorMap[color]\n}\n\nconst H1 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h1 ref={ref} className={cn(\"scroll-m-20 text-3xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h1>\n )\n)\nH1.displayName = \"H1\"\n\nconst H2 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h2 ref={ref} className={cn(\"scroll-m-20 text-2xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h2>\n )\n)\nH2.displayName = \"H2\"\n\nconst H3 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h3 ref={ref} className={cn(\"scroll-m-20 text-xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h3>\n )\n)\nH3.displayName = \"H3\"\n\nconst H4 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h4 ref={ref} className={cn(\"scroll-m-20 text-lg tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h4>\n )\n)\nH4.displayName = \"H4\"\n\nconst Body = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-base leading-7\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nBody.displayName = \"Body\"\n\nconst Small = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm\", resolveColor(color, \"text-muted-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nSmall.displayName = \"Small\"\n\nconst Caption = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-xs\", resolveColor(color, \"text-muted-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nCaption.displayName = \"Caption\"\n\nconst Lead = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"medium\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-lg\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nLead.displayName = \"Lead\"\n\nconst Muted = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm\", resolveColor(color, \"text-muted-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nMuted.displayName = \"Muted\"\n\nconst Code = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...props }, ref) => (\n <code\n ref={ref}\n className={cn(\n \"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold\",\n className\n )}\n {...props}\n />\n )\n)\nCode.displayName = \"Code\"\n\nexport { H1, H2, H3, H4, Body, Small, Caption, Lead, Muted, Code }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD8CI;AApCJ,IAAM,YAA8C;AAAA,EAClD,WAAW;AAAA,EACX,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AACT;AAEA,IAAM,WAAgE;AAAA,EACpE,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AACX;AAYA,SAAS,aAAa,OAAoC,mBAAmC;AAC3F,MAAI,CAAC,SAAS,UAAU,UAAW,QAAO;AAC1C,SAAO,SAAS,KAAK;AACvB;AAEA,IAAM,KAAW;AAAA,EACf,CAAC,EAAE,WAAW,SAAS,YAAY,OAAO,UAAU,GAAG,MAAM,GAAG,QAC9D,4CAAC,QAAG,KAAU,WAAW,GAAG,uCAAuC,aAAa,OAAO,iBAAiB,GAAG,UAAU,MAAM,GAAG,SAAS,GAAI,GAAG,OAC3I,UACH;AAEJ;AACA,GAAG,cAAc;AAEjB,IAAM,KAAW;AAA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,KAAU,WAAW,GAAG,WAAW,aAAa,OAAO,uBAAuB,GAAG,UAAU,MAAM,GAAG,SAAS,GAAI,GAAG,OAAO;AAElI;AACA,QAAQ,cAAc;AAEtB,IAAM,OAAa;AAAA,EACjB,CAAC,EAAE,WAAW,SAAS,UAAU,OAAO,GAAG,MAAM,GAAG,QAClD,4CAAC,OAAE,KAAU,WAAW,GAAG,WAAW,aAAa,OAAO,iBAAiB,GAAG,UAAU,MAAM,GAAG,SAAS,GAAI,GAAG,OAAO;AAE5H;AACA,KAAK,cAAc;AAEnB,IAAM,QAAc;AAAA,EAClB,CAAC,EAAE,WAAW,SAAS,WAAW,OAAO,GAAG,MAAM,GAAG,QACnD,4CAAC,OAAE,KAAU,WAAW,GAAG,WAAW,aAAa,OAAO,uBAAuB,GAAG,UAAU,MAAM,GAAG,SAAS,GAAI,GAAG,OAAO;AAElI;AACA,MAAM,cAAc;AAEpB,IAAM,OAAa;AAAA,EACjB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,KAAK,cAAc;","names":[]}
|
|
@@ -32,19 +32,19 @@ function resolveColor(color, defaultColorClass) {
|
|
|
32
32
|
return colorMap[color];
|
|
33
33
|
}
|
|
34
34
|
var H1 = React.forwardRef(
|
|
35
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ jsx("h1", { ref, className: cn("scroll-m-20 text-3xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
35
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ jsx("h1", { ref, className: cn("scroll-m-20 text-3xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
36
36
|
);
|
|
37
37
|
H1.displayName = "H1";
|
|
38
38
|
var H2 = React.forwardRef(
|
|
39
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ jsx("h2", { ref, className: cn("scroll-m-20 text-2xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
39
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ jsx("h2", { ref, className: cn("scroll-m-20 text-2xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
40
40
|
);
|
|
41
41
|
H2.displayName = "H2";
|
|
42
42
|
var H3 = React.forwardRef(
|
|
43
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("scroll-m-20 text-xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
43
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("scroll-m-20 text-xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
44
44
|
);
|
|
45
45
|
H3.displayName = "H3";
|
|
46
46
|
var H4 = React.forwardRef(
|
|
47
|
-
({ className, weight = "semibold", color, ...props }, ref) => /* @__PURE__ */ jsx("h4", { ref, className: cn("scroll-m-20 text-lg tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
|
|
47
|
+
({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ jsx("h4", { ref, className: cn("scroll-m-20 text-lg tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
|
|
48
48
|
);
|
|
49
49
|
H4.displayName = "H4";
|
|
50
50
|
var Body = React.forwardRef(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/typography.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../lib/utils\"\n\nexport type TypographyWeight = \"extrabold\" | \"bold\" | \"semibold\" | \"medium\" | \"regular\" | \"light\"\n\nexport type TypographyColor =\n | \"default\"\n | \"secondary\"\n | \"foreground\"\n | \"muted\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"inherit\"\n\nconst weightMap: Record<TypographyWeight, string> = {\n extrabold: \"font-extrabold\",\n bold: \"font-bold\",\n semibold: \"font-semibold\",\n medium: \"font-medium\",\n regular: \"font-normal\",\n light: \"font-light\",\n}\n\nconst colorMap: Record<Exclude<TypographyColor, \"default\">, string> = {\n secondary: \"text-muted-foreground\",\n foreground: \"text-[var(--hc-color-foreground)]\",\n muted: \"text-muted-foreground\",\n success: \"text-[var(--hc-color-success)]\",\n warning: \"text-[var(--hc-color-warning)]\",\n destructive: \"text-[var(--hc-color-destructive)]\",\n inherit: \"text-inherit\",\n}\n\ninterface TypographyHeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\ninterface TypographyParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\nfunction resolveColor(color: TypographyColor | undefined, defaultColorClass: string): string {\n if (!color || color === \"default\") return defaultColorClass\n return colorMap[color]\n}\n\nconst H1 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, ...props }, ref) => (\n <h1 ref={ref} className={cn(\"scroll-m-20 text-3xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}
|
|
1
|
+
{"version":3,"sources":["../../src/components/typography.tsx","../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"../lib/utils\"\n\nexport type TypographyWeight = \"extrabold\" | \"bold\" | \"semibold\" | \"medium\" | \"regular\" | \"light\"\n\nexport type TypographyColor =\n | \"default\"\n | \"secondary\"\n | \"foreground\"\n | \"muted\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"inherit\"\n\nconst weightMap: Record<TypographyWeight, string> = {\n extrabold: \"font-extrabold\",\n bold: \"font-bold\",\n semibold: \"font-semibold\",\n medium: \"font-medium\",\n regular: \"font-normal\",\n light: \"font-light\",\n}\n\nconst colorMap: Record<Exclude<TypographyColor, \"default\">, string> = {\n secondary: \"text-muted-foreground\",\n foreground: \"text-[var(--hc-color-foreground)]\",\n muted: \"text-muted-foreground\",\n success: \"text-[var(--hc-color-success)]\",\n warning: \"text-[var(--hc-color-warning)]\",\n destructive: \"text-[var(--hc-color-destructive)]\",\n inherit: \"text-inherit\",\n}\n\ninterface TypographyHeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\ninterface TypographyParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {\n weight?: TypographyWeight\n color?: TypographyColor\n}\n\nfunction resolveColor(color: TypographyColor | undefined, defaultColorClass: string): string {\n if (!color || color === \"default\") return defaultColorClass\n return colorMap[color]\n}\n\nconst H1 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h1 ref={ref} className={cn(\"scroll-m-20 text-3xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h1>\n )\n)\nH1.displayName = \"H1\"\n\nconst H2 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h2 ref={ref} className={cn(\"scroll-m-20 text-2xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h2>\n )\n)\nH2.displayName = \"H2\"\n\nconst H3 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h3 ref={ref} className={cn(\"scroll-m-20 text-xl tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h3>\n )\n)\nH3.displayName = \"H3\"\n\nconst H4 = React.forwardRef<HTMLHeadingElement, TypographyHeadingProps>(\n ({ className, weight = \"semibold\", color, children, ...props }, ref) => (\n <h4 ref={ref} className={cn(\"scroll-m-20 text-lg tracking-tight\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props}>\n {children}\n </h4>\n )\n)\nH4.displayName = \"H4\"\n\nconst Body = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-base leading-7\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nBody.displayName = \"Body\"\n\nconst Small = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm\", resolveColor(color, \"text-muted-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nSmall.displayName = \"Small\"\n\nconst Caption = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-xs\", resolveColor(color, \"text-muted-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nCaption.displayName = \"Caption\"\n\nconst Lead = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"medium\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-lg\", resolveColor(color, \"text-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nLead.displayName = \"Lead\"\n\nconst Muted = React.forwardRef<HTMLParagraphElement, TypographyParagraphProps>(\n ({ className, weight = \"regular\", color, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm\", resolveColor(color, \"text-muted-foreground\"), weightMap[weight], className)} {...props} />\n )\n)\nMuted.displayName = \"Muted\"\n\nconst Code = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...props }, ref) => (\n <code\n ref={ref}\n className={cn(\n \"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold\",\n className\n )}\n {...props}\n />\n )\n)\nCode.displayName = \"Code\"\n\nexport { H1, H2, H3, H4, Body, Small, Caption, Lead, Muted, Code }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD8CI;AApCJ,IAAM,YAA8C;AAAA,EAClD,WAAW;AAAA,EACX,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AACT;AAEA,IAAM,WAAgE;AAAA,EACpE,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AACX;AAYA,SAAS,aAAa,OAAoC,mBAAmC;AAC3F,MAAI,CAAC,SAAS,UAAU,UAAW,QAAO;AAC1C,SAAO,SAAS,KAAK;AACvB;AAEA,IAAM,KAAW;AAAA,EACf,CAAC,EAAE,WAAW,SAAS,YAAY,OAAO,UAAU,GAAG,MAAM,GAAG,QAC9D,oBAAC,QAAG,KAAU,WAAW,GAAG,uCAAuC,aAAa,OAAO,iBAAiB,GAAG,UAAU,MAAM,GAAG,SAAS,GAAI,GAAG,OAC3I,UACH;AAEJ;AACA,GAAG,cAAc;AAEjB,IAAM,KAAW;AAAA,EACf,CAAC,EAAE,WAAW,SAAS,YAAY,OAAO,UAAU,GAAG,MAAM,GAAG,QAC9D,oBAAC,QAAG,KAAU,WAAW,GAAG,uCAAuC,aAAa,OAAO,iBAAiB,GAAG,UAAU,MAAM,GAAG,SAAS,GAAI,GAAG,OAC3I,UACH;AAEJ;AACA,GAAG,cAAc;AAEjB,IAAM,KAAW;AAAA,EACf,CAAC,EAAE,WAA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