@fanvue/ui 2.4.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Icons/ThumbDownFilledIcon.cjs +45 -0
- package/dist/cjs/components/Icons/ThumbDownFilledIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/ThumbUpFilledIcon.cjs +45 -0
- package/dist/cjs/components/Icons/ThumbUpFilledIcon.cjs.map +1 -0
- package/dist/cjs/components/Stepper/Stepper.cjs +72 -0
- package/dist/cjs/components/Stepper/Stepper.cjs.map +1 -0
- package/dist/cjs/components/Stepper/StepperStep.cjs +103 -0
- package/dist/cjs/components/Stepper/StepperStep.cjs.map +1 -0
- package/dist/cjs/components/TextField/TextField.cjs +41 -20
- package/dist/cjs/components/TextField/TextField.cjs.map +1 -1
- package/dist/cjs/index.cjs +8 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Icons/ThumbDownFilledIcon.mjs +28 -0
- package/dist/components/Icons/ThumbDownFilledIcon.mjs.map +1 -0
- package/dist/components/Icons/ThumbUpFilledIcon.mjs +28 -0
- package/dist/components/Icons/ThumbUpFilledIcon.mjs.map +1 -0
- package/dist/components/Stepper/Stepper.mjs +55 -0
- package/dist/components/Stepper/Stepper.mjs.map +1 -0
- package/dist/components/Stepper/StepperStep.mjs +86 -0
- package/dist/components/Stepper/StepperStep.mjs.map +1 -0
- package/dist/components/TextField/TextField.mjs +41 -20
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/index.d.ts +72 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +22 -10
- package/package.json +2 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const cn = require("../../utils/cn.cjs");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
24
|
+
const ThumbDownFilledIcon = React__namespace.forwardRef(
|
|
25
|
+
({ className, ...props }, ref) => {
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
viewBox: "0 0 24 24",
|
|
31
|
+
fill: "none",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
className: cn.cn("size-6", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(2 2)", children: [
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.38989 3.23001V13.39C6.38989 13.79 6.50989 14.18 6.72989 14.51L9.4599 18.57C9.8899 19.22 10.9599 19.68 11.8699 19.34C12.8499 19.01 13.4999 17.91 13.2899 16.93L12.7699 13.66C12.7299 13.36 12.8099 13.09 12.9799 12.88C13.1499 12.69 13.3999 12.57 13.6699 12.57H17.7799C18.5699 12.57 19.2499 12.25 19.6499 11.69C20.0299 11.15 20.0999 10.45 19.8499 9.74001L17.3899 2.25001C17.0799 1.01001 15.7299 5.72205e-06 14.3899 5.72205e-06H10.4899C9.8199 5.72205e-06 8.8799 0.230005 8.4499 0.660006L7.16989 1.65001C6.67989 2.02001 6.38989 2.61 6.38989 3.23001Z" }),
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.21 15.3398H2.18C0.63 15.3398 0 14.7398 0 13.2598V3.1998C0 1.7198 0.63 1.1198 2.18 1.1198H3.21C4.76 1.1198 5.39 1.7198 5.39 3.1998V13.2598C5.39 14.7398 4.76 15.3398 3.21 15.3398Z" })
|
|
38
|
+
] }) })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
ThumbDownFilledIcon.displayName = "ThumbDownFilledIcon";
|
|
44
|
+
exports.ThumbDownFilledIcon = ThumbDownFilledIcon;
|
|
45
|
+
//# sourceMappingURL=ThumbDownFilledIcon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbDownFilledIcon.cjs","sources":["../../../../src/components/Icons/ThumbDownFilledIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport type { IconProps } from \"./types\";\n\nexport const ThumbDownFilledIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ className, ...props }, ref) => {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\"size-6\", className)}\n {...props}\n >\n <g fill=\"currentColor\">\n <g transform=\"translate(2 2)\">\n <path d=\"M6.38989 3.23001V13.39C6.38989 13.79 6.50989 14.18 6.72989 14.51L9.4599 18.57C9.8899 19.22 10.9599 19.68 11.8699 19.34C12.8499 19.01 13.4999 17.91 13.2899 16.93L12.7699 13.66C12.7299 13.36 12.8099 13.09 12.9799 12.88C13.1499 12.69 13.3999 12.57 13.6699 12.57H17.7799C18.5699 12.57 19.2499 12.25 19.6499 11.69C20.0299 11.15 20.0999 10.45 19.8499 9.74001L17.3899 2.25001C17.0799 1.01001 15.7299 5.72205e-06 14.3899 5.72205e-06H10.4899C9.8199 5.72205e-06 8.8799 0.230005 8.4499 0.660006L7.16989 1.65001C6.67989 2.02001 6.38989 2.61 6.38989 3.23001Z\" />\n <path d=\"M3.21 15.3398H2.18C0.63 15.3398 0 14.7398 0 13.2598V3.1998C0 1.7198 0.63 1.1198 2.18 1.1198H3.21C4.76 1.1198 5.39 1.7198 5.39 3.1998V13.2598C5.39 14.7398 4.76 15.3398 3.21 15.3398Z\" />\n </g>\n </g>\n </svg>\n );\n },\n);\n\nThumbDownFilledIcon.displayName = \"ThumbDownFilledIcon\";\n"],"names":["React","jsx","cn","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,sBAAsBA,iBAAM;AAAA,EACvC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChC,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,WAAWC,GAAAA,GAAG,UAAU,SAAS;AAAA,QAChC,GAAG;AAAA,QAEJ,yCAAC,KAAA,EAAE,MAAK,gBACN,UAAAC,2BAAAA,KAAC,KAAA,EAAE,WAAU,kBACX,UAAA;AAAA,UAAAF,2BAAAA,IAAC,QAAA,EAAK,GAAE,oiBAAA,CAAoiB;AAAA,UAC5iBA,2BAAAA,IAAC,QAAA,EAAK,GAAE,uLAAA,CAAuL;AAAA,QAAA,EAAA,CACjM,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,oBAAoB,cAAc;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const cn = require("../../utils/cn.cjs");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
24
|
+
const ThumbUpFilledIcon = React__namespace.forwardRef(
|
|
25
|
+
({ className, ...props }, ref) => {
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
viewBox: "0 0 24 24",
|
|
31
|
+
fill: "none",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
className: cn.cn("size-6", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("g", { fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(2 2)", children: [
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.38989 16.2251V6.06508C6.38989 5.66508 6.50989 5.27508 6.72989 4.94508L9.4599 0.885083C9.8899 0.235083 10.9599 -0.224917 11.8699 0.115083C12.8499 0.445083 13.4999 1.54508 13.2899 2.52508L12.7699 5.79508C12.7299 6.09508 12.8099 6.36508 12.9799 6.57508C13.1499 6.76508 13.3999 6.88508 13.6699 6.88508H17.7799C18.5699 6.88508 19.2499 7.20508 19.6499 7.76507C20.0299 8.30507 20.0999 9.00507 19.8499 9.71507L17.3899 17.2051C17.0799 18.4451 15.7299 19.4551 14.3899 19.4551H10.4899C9.8199 19.4551 8.8799 19.2251 8.4499 18.7951L7.16989 17.8051C6.67989 17.4351 6.38989 16.8451 6.38989 16.2251Z" }),
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.21 4.11523H2.18C0.63 4.11523 0 4.71523 0 6.19523V16.2553C0 17.7353 0.63 18.3353 2.18 18.3353H3.21C4.76 18.3353 5.39 17.7353 5.39 16.2553V6.19523C5.39 4.71523 4.76 4.11523 3.21 4.11523Z" })
|
|
38
|
+
] }) })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
ThumbUpFilledIcon.displayName = "ThumbUpFilledIcon";
|
|
44
|
+
exports.ThumbUpFilledIcon = ThumbUpFilledIcon;
|
|
45
|
+
//# sourceMappingURL=ThumbUpFilledIcon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbUpFilledIcon.cjs","sources":["../../../../src/components/Icons/ThumbUpFilledIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport type { IconProps } from \"./types\";\n\nexport const ThumbUpFilledIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ className, ...props }, ref) => {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\"size-6\", className)}\n {...props}\n >\n <g fill=\"currentColor\">\n <g transform=\"translate(2 2)\">\n <path d=\"M6.38989 16.2251V6.06508C6.38989 5.66508 6.50989 5.27508 6.72989 4.94508L9.4599 0.885083C9.8899 0.235083 10.9599 -0.224917 11.8699 0.115083C12.8499 0.445083 13.4999 1.54508 13.2899 2.52508L12.7699 5.79508C12.7299 6.09508 12.8099 6.36508 12.9799 6.57508C13.1499 6.76508 13.3999 6.88508 13.6699 6.88508H17.7799C18.5699 6.88508 19.2499 7.20508 19.6499 7.76507C20.0299 8.30507 20.0999 9.00507 19.8499 9.71507L17.3899 17.2051C17.0799 18.4451 15.7299 19.4551 14.3899 19.4551H10.4899C9.8199 19.4551 8.8799 19.2251 8.4499 18.7951L7.16989 17.8051C6.67989 17.4351 6.38989 16.8451 6.38989 16.2251Z\" />\n <path d=\"M3.21 4.11523H2.18C0.63 4.11523 0 4.71523 0 6.19523V16.2553C0 17.7353 0.63 18.3353 2.18 18.3353H3.21C4.76 18.3353 5.39 17.7353 5.39 16.2553V6.19523C5.39 4.71523 4.76 4.11523 3.21 4.11523Z\" />\n </g>\n </g>\n </svg>\n );\n },\n);\n\nThumbUpFilledIcon.displayName = \"ThumbUpFilledIcon\";\n"],"names":["React","jsx","cn","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,oBAAoBA,iBAAM;AAAA,EACrC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChC,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,WAAWC,GAAAA,GAAG,UAAU,SAAS;AAAA,QAChC,GAAG;AAAA,QAEJ,yCAAC,KAAA,EAAE,MAAK,gBACN,UAAAC,2BAAAA,KAAC,KAAA,EAAE,WAAU,kBACX,UAAA;AAAA,UAAAF,2BAAAA,IAAC,QAAA,EAAK,GAAE,6kBAAA,CAA6kB;AAAA,UACrlBA,2BAAAA,IAAC,QAAA,EAAK,GAAE,8LAAA,CAA8L;AAAA,QAAA,EAAA,CACxM,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,kBAAkB,cAAc;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const cn = require("../../utils/cn.cjs");
|
|
7
|
+
const StepperStep = require("./StepperStep.cjs");
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
+
if (e) {
|
|
11
|
+
for (const k in e) {
|
|
12
|
+
if (k !== "default") {
|
|
13
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: () => e[k]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
25
|
+
const CONNECTOR_MARGIN = {
|
|
26
|
+
sm: "mt-3",
|
|
27
|
+
md: "mt-4",
|
|
28
|
+
lg: "mt-5"
|
|
29
|
+
};
|
|
30
|
+
const Stepper = React__namespace.forwardRef(
|
|
31
|
+
({ activeStep, steps, size = "md", className, ...props }, ref) => {
|
|
32
|
+
return (
|
|
33
|
+
// biome-ignore lint/a11y/useSemanticElements: <fieldset> adds unwanted browser styling for a non-interactive progress indicator
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
role: "group",
|
|
39
|
+
"aria-label": "Progress",
|
|
40
|
+
className: cn.cn("flex items-start", className),
|
|
41
|
+
...props,
|
|
42
|
+
children: steps.map((step, index) => {
|
|
43
|
+
const state = index < activeStep ? "completed" : index === activeStep ? "active" : "upcoming";
|
|
44
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
46
|
+
StepperStep.StepperStep,
|
|
47
|
+
{
|
|
48
|
+
state,
|
|
49
|
+
size,
|
|
50
|
+
stepNumber: index + 1,
|
|
51
|
+
title: step.title,
|
|
52
|
+
description: step.description,
|
|
53
|
+
className: "shrink-0"
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
index < steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: cn.cn("h-px min-w-6 flex-1 bg-border-primary", CONNECTOR_MARGIN[size]),
|
|
60
|
+
"aria-hidden": "true"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }, index);
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
Stepper.displayName = "Stepper";
|
|
71
|
+
exports.Stepper = Stepper;
|
|
72
|
+
//# sourceMappingURL=Stepper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.cjs","sources":["../../../../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { StepperStep, type StepperStepSize } from \"./StepperStep\";\n\n/** Configuration for a single step within a {@link Stepper}. */\nexport interface StepItem {\n /** Primary label for the step. */\n title: string;\n /** Secondary description for the step. */\n description?: string;\n}\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Zero-based index of the currently active step. Steps before this are marked completed. */\n activeStep: number;\n /** Configuration for each step. */\n steps: StepItem[];\n /** Size preset applied to all step indicators and labels. @default \"md\" */\n size?: StepperStepSize;\n}\n\nconst CONNECTOR_MARGIN: Record<StepperStepSize, string> = {\n sm: \"mt-3\",\n md: \"mt-4\",\n lg: \"mt-5\",\n};\n\n/**\n * A horizontal progress stepper that displays a sequence of steps with\n * completed, active, and upcoming states.\n *\n * @example\n * ```tsx\n * <Stepper\n * activeStep={1}\n * steps={[\n * { title: \"Account\", description: \"Create account\" },\n * { title: \"Profile\", description: \"Set up profile\" },\n * { title: \"Done\", description: \"All set!\" },\n * ]}\n * />\n * ```\n */\nexport const Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n ({ activeStep, steps, size = \"md\", className, ...props }, ref) => {\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> adds unwanted browser styling for a non-interactive progress indicator\n <div\n ref={ref}\n role=\"group\"\n aria-label=\"Progress\"\n className={cn(\"flex items-start\", className)}\n {...props}\n >\n {steps.map((step, index) => {\n const state =\n index < activeStep ? \"completed\" : index === activeStep ? \"active\" : \"upcoming\";\n\n return (\n <React.Fragment key={index}>\n <StepperStep\n state={state}\n size={size}\n stepNumber={index + 1}\n title={step.title}\n description={step.description}\n className=\"shrink-0\"\n />\n {index < steps.length - 1 && (\n <div\n className={cn(\"h-px min-w-6 flex-1 bg-border-primary\", CONNECTOR_MARGIN[size])}\n aria-hidden=\"true\"\n />\n )}\n </React.Fragment>\n );\n })}\n </div>\n );\n },\n);\n\nStepper.displayName = \"Stepper\";\n"],"names":["React","jsx","cn","jsxs","StepperStep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,mBAAoD;AAAA,EACxD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAkBO,MAAM,UAAUA,iBAAM;AAAA,EAC3B,CAAC,EAAE,YAAY,OAAO,OAAO,MAAM,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChE;AAAA;AAAA,MAEEC,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,MAAK;AAAA,UACL,cAAW;AAAA,UACX,WAAWC,GAAAA,GAAG,oBAAoB,SAAS;AAAA,UAC1C,GAAG;AAAA,UAEH,UAAA,MAAM,IAAI,CAAC,MAAM,UAAU;AAC1B,kBAAM,QACJ,QAAQ,aAAa,cAAc,UAAU,aAAa,WAAW;AAEvE,mBACEC,gCAACH,iBAAM,UAAN,EACC,UAAA;AAAA,cAAAC,2BAAAA;AAAAA,gBAACG,YAAAA;AAAAA,gBAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA,YAAY,QAAQ;AAAA,kBACpB,OAAO,KAAK;AAAA,kBACZ,aAAa,KAAK;AAAA,kBAClB,WAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEX,QAAQ,MAAM,SAAS,KACtBH,2BAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWC,GAAAA,GAAG,yCAAyC,iBAAiB,IAAI,CAAC;AAAA,kBAC7E,eAAY;AAAA,gBAAA;AAAA,cAAA;AAAA,YACd,EAAA,GAbiB,KAerB;AAAA,UAEJ,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EAGP;AACF;AAEA,QAAQ,cAAc;;"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const cn = require("../../utils/cn.cjs");
|
|
7
|
+
const CheckIcon = require("../Icons/CheckIcon.cjs");
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
+
if (e) {
|
|
11
|
+
for (const k in e) {
|
|
12
|
+
if (k !== "default") {
|
|
13
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: () => e[k]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
25
|
+
const INDICATOR_SIZE = {
|
|
26
|
+
sm: "size-6",
|
|
27
|
+
md: "size-8",
|
|
28
|
+
lg: "size-10"
|
|
29
|
+
};
|
|
30
|
+
const INDICATOR_STATE = {
|
|
31
|
+
completed: "bg-success-surface",
|
|
32
|
+
active: "border border-brand-primary-default bg-brand-primary-muted",
|
|
33
|
+
upcoming: "bg-neutral-alphas-50"
|
|
34
|
+
};
|
|
35
|
+
const NUMBER_TYPOGRAPHY = {
|
|
36
|
+
sm: "typography-semibold-body-sm",
|
|
37
|
+
md: "typography-semibold-body-md",
|
|
38
|
+
lg: "typography-semibold-body-lg"
|
|
39
|
+
};
|
|
40
|
+
const NUMBER_COLOR = {
|
|
41
|
+
completed: "",
|
|
42
|
+
active: "text-content-primary",
|
|
43
|
+
upcoming: "text-content-secondary"
|
|
44
|
+
};
|
|
45
|
+
const CONTAINER_GAP = {
|
|
46
|
+
sm: "gap-1",
|
|
47
|
+
md: "gap-2",
|
|
48
|
+
lg: "gap-2"
|
|
49
|
+
};
|
|
50
|
+
const TITLE_TYPOGRAPHY = {
|
|
51
|
+
sm: "typography-regular-body-sm",
|
|
52
|
+
md: "typography-regular-body-md",
|
|
53
|
+
lg: "typography-regular-body-lg"
|
|
54
|
+
};
|
|
55
|
+
const DESCRIPTION_TYPOGRAPHY = {
|
|
56
|
+
sm: "typography-regular-body-sm",
|
|
57
|
+
md: "typography-regular-body-sm",
|
|
58
|
+
lg: "typography-regular-body-md"
|
|
59
|
+
};
|
|
60
|
+
const LABEL_COLOR = {
|
|
61
|
+
completed: "text-content-secondary",
|
|
62
|
+
active: "text-content-primary",
|
|
63
|
+
upcoming: "text-content-tertiary"
|
|
64
|
+
};
|
|
65
|
+
const CHECK_ICON_SIZE = {
|
|
66
|
+
sm: "size-3",
|
|
67
|
+
md: "size-4",
|
|
68
|
+
lg: "size-5"
|
|
69
|
+
};
|
|
70
|
+
const StepperStep = React__namespace.forwardRef(
|
|
71
|
+
({ state = "upcoming", size = "md", stepNumber, title, description, className, ...props }, ref) => {
|
|
72
|
+
const hasLabels = title != null || description != null;
|
|
73
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
className: cn.cn("flex flex-col items-center", CONTAINER_GAP[size], className),
|
|
78
|
+
...props,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: cn.cn(
|
|
84
|
+
"flex shrink-0 items-center justify-center rounded-full",
|
|
85
|
+
INDICATOR_SIZE[size],
|
|
86
|
+
INDICATOR_STATE[state]
|
|
87
|
+
),
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
children: state === "completed" ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon.CheckIcon, { className: cn.cn(CHECK_ICON_SIZE[size], "text-success-content") }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn.cn(NUMBER_TYPOGRAPHY[size], NUMBER_COLOR[state]), children: stepNumber })
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
hasLabels && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn.cn("flex flex-col items-center gap-1 text-center", LABEL_COLOR[state]), children: [
|
|
93
|
+
title != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: TITLE_TYPOGRAPHY[size], children: title }),
|
|
94
|
+
description != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: DESCRIPTION_TYPOGRAPHY[size], children: description })
|
|
95
|
+
] })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
StepperStep.displayName = "StepperStep";
|
|
102
|
+
exports.StepperStep = StepperStep;
|
|
103
|
+
//# sourceMappingURL=StepperStep.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepperStep.cjs","sources":["../../../../src/components/Stepper/StepperStep.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { CheckIcon } from \"../Icons/CheckIcon\";\n\n/** Current state of a step in the stepper. */\nexport type StepperStepState = \"completed\" | \"active\" | \"upcoming\";\n\n/** Size preset for the step indicator and labels. */\nexport type StepperStepSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface StepperStepProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Current state of the step. @default \"upcoming\" */\n state?: StepperStepState;\n /** Size preset for the indicator and labels. @default \"md\" */\n size?: StepperStepSize;\n /** Step number displayed in the indicator for active and upcoming states. */\n stepNumber?: number;\n /** Primary label shown below the indicator. */\n title?: string;\n /** Secondary description shown below the title. */\n description?: string;\n}\n\nconst INDICATOR_SIZE: Record<StepperStepSize, string> = {\n sm: \"size-6\",\n md: \"size-8\",\n lg: \"size-10\",\n};\n\nconst INDICATOR_STATE: Record<StepperStepState, string> = {\n completed: \"bg-success-surface\",\n active: \"border border-brand-primary-default bg-brand-primary-muted\",\n upcoming: \"bg-neutral-alphas-50\",\n};\n\nconst NUMBER_TYPOGRAPHY: Record<StepperStepSize, string> = {\n sm: \"typography-semibold-body-sm\",\n md: \"typography-semibold-body-md\",\n lg: \"typography-semibold-body-lg\",\n};\n\nconst NUMBER_COLOR: Record<StepperStepState, string> = {\n completed: \"\",\n active: \"text-content-primary\",\n upcoming: \"text-content-secondary\",\n};\n\nconst CONTAINER_GAP: Record<StepperStepSize, string> = {\n sm: \"gap-1\",\n md: \"gap-2\",\n lg: \"gap-2\",\n};\n\nconst TITLE_TYPOGRAPHY: Record<StepperStepSize, string> = {\n sm: \"typography-regular-body-sm\",\n md: \"typography-regular-body-md\",\n lg: \"typography-regular-body-lg\",\n};\n\nconst DESCRIPTION_TYPOGRAPHY: Record<StepperStepSize, string> = {\n sm: \"typography-regular-body-sm\",\n md: \"typography-regular-body-sm\",\n lg: \"typography-regular-body-md\",\n};\n\nconst LABEL_COLOR: Record<StepperStepState, string> = {\n completed: \"text-content-secondary\",\n active: \"text-content-primary\",\n upcoming: \"text-content-tertiary\",\n};\n\nconst CHECK_ICON_SIZE: Record<StepperStepSize, string> = {\n sm: \"size-3\",\n md: \"size-4\",\n lg: \"size-5\",\n};\n\n/**\n * A single step indicator with optional labels, used standalone or within a {@link Stepper}.\n *\n * @example\n * ```tsx\n * <StepperStep state=\"active\" stepNumber={2} title=\"Profile\" description=\"Set up profile\" />\n * ```\n */\nexport const StepperStep = React.forwardRef<HTMLDivElement, StepperStepProps>(\n (\n { state = \"upcoming\", size = \"md\", stepNumber, title, description, className, ...props },\n ref,\n ) => {\n const hasLabels = title != null || description != null;\n\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", CONTAINER_GAP[size], className)}\n {...props}\n >\n <div\n className={cn(\n \"flex shrink-0 items-center justify-center rounded-full\",\n INDICATOR_SIZE[size],\n INDICATOR_STATE[state],\n )}\n aria-hidden=\"true\"\n >\n {state === \"completed\" ? (\n <CheckIcon className={cn(CHECK_ICON_SIZE[size], \"text-success-content\")} />\n ) : (\n <span className={cn(NUMBER_TYPOGRAPHY[size], NUMBER_COLOR[state])}>{stepNumber}</span>\n )}\n </div>\n\n {hasLabels && (\n <div className={cn(\"flex flex-col items-center gap-1 text-center\", LABEL_COLOR[state])}>\n {title != null && <span className={TITLE_TYPOGRAPHY[size]}>{title}</span>}\n {description != null && (\n <span className={DESCRIPTION_TYPOGRAPHY[size]}>{description}</span>\n )}\n </div>\n )}\n </div>\n );\n },\n);\n\nStepperStep.displayName = \"StepperStep\";\n"],"names":["React","jsxs","cn","jsx","CheckIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,iBAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,kBAAoD;AAAA,EACxD,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AACZ;AAEA,MAAM,oBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAiD;AAA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AI,WAAWA,GAAAA,GAAG,gDAAgD,YAAY,KAAK,CAAC,GAClF,UAAA;AAAA,YAAA,SAAS,QAAQC,+BAAC,QAAA,EAAK,WAAW,iBAAiB,IAAI,GAAI,UAAA,OAAM;AAAA,YACjE,eAAe,QACdA,2BAAAA,IAAC,QAAA,EAAK,WAAW,uBAAuB,IAAI,GAAI,UAAA,YAAA,CAAY;AAAA,UAAA,EAAA,CAEhE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,YAAY,cAAc;;"}
|
|
@@ -32,36 +32,38 @@ const INPUT_SIZE_CLASSES = {
|
|
|
32
32
|
"40": "py-2 typography-regular-body-lg",
|
|
33
33
|
"32": "py-2 typography-regular-body-md"
|
|
34
34
|
};
|
|
35
|
-
const
|
|
35
|
+
const INPUT_PL = {
|
|
36
|
+
"48": { default: "pl-4", withIcon: "pl-10" },
|
|
37
|
+
"40": { default: "pl-4", withIcon: "pl-10" },
|
|
38
|
+
"32": { default: "pl-3", withIcon: "pl-9" }
|
|
39
|
+
};
|
|
40
|
+
const INPUT_PR = {
|
|
41
|
+
"48": { default: "pr-4", withIcon: "pr-10" },
|
|
42
|
+
"40": { default: "pr-4", withIcon: "pr-10" },
|
|
43
|
+
"32": { default: "pr-3", withIcon: "pr-9" }
|
|
44
|
+
};
|
|
45
|
+
const ICON_INSET = {
|
|
36
46
|
"48": "px-4",
|
|
37
47
|
"40": "px-4",
|
|
38
48
|
"32": "px-3"
|
|
39
49
|
};
|
|
40
|
-
const ICON_SPACING = {
|
|
41
|
-
"48": "gap-2",
|
|
42
|
-
"40": "gap-2",
|
|
43
|
-
"32": "gap-2"
|
|
44
|
-
};
|
|
45
50
|
function getContainerClassName(size, error, disabled) {
|
|
46
51
|
return cn.cn(
|
|
47
|
-
"
|
|
52
|
+
"relative overflow-hidden rounded-sm border bg-neutral-alphas-50 has-focus-visible:outline-none motion-safe:transition-colors",
|
|
48
53
|
error ? "border-error-content" : "border-transparent",
|
|
49
54
|
!disabled && !error && "hover:border-neutral-alphas-400",
|
|
50
55
|
CONTAINER_HEIGHT[size],
|
|
51
|
-
PADDING_HORIZONTAL[size],
|
|
52
|
-
ICON_SPACING[size],
|
|
53
56
|
disabled && "opacity-50"
|
|
54
57
|
);
|
|
55
58
|
}
|
|
56
|
-
function getInputClassName(size) {
|
|
59
|
+
function getInputClassName(size, hasLeftIcon, hasRightIcon) {
|
|
57
60
|
return cn.cn(
|
|
58
|
-
"h-full
|
|
59
|
-
INPUT_SIZE_CLASSES[size]
|
|
61
|
+
"h-full w-full rounded-sm bg-transparent text-content-primary no-underline placeholder:text-content-secondary focus:outline-none disabled:cursor-not-allowed",
|
|
62
|
+
INPUT_SIZE_CLASSES[size],
|
|
63
|
+
hasLeftIcon ? INPUT_PL[size].withIcon : INPUT_PL[size].default,
|
|
64
|
+
hasRightIcon ? INPUT_PR[size].withIcon : INPUT_PR[size].default
|
|
60
65
|
);
|
|
61
66
|
}
|
|
62
|
-
function TextFieldIcon({ children }) {
|
|
63
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-4 shrink-0 items-center justify-center text-content-secondary", children });
|
|
64
|
-
}
|
|
65
67
|
function TextFieldHelperText({
|
|
66
68
|
id,
|
|
67
69
|
error,
|
|
@@ -125,7 +127,6 @@ const TextField = React__namespace.forwardRef(
|
|
|
125
127
|
}
|
|
126
128
|
),
|
|
127
129
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: getContainerClassName(size, error, disabled), children: [
|
|
128
|
-
leftIcon && /* @__PURE__ */ jsxRuntime.jsx(TextFieldIcon, { children: leftIcon }),
|
|
129
130
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
130
131
|
"input",
|
|
131
132
|
{
|
|
@@ -135,15 +136,35 @@ const TextField = React__namespace.forwardRef(
|
|
|
135
136
|
"aria-describedby": bottomText ? helperTextId : void 0,
|
|
136
137
|
"aria-invalid": error || void 0,
|
|
137
138
|
className: cn.cn(
|
|
138
|
-
getInputClassName(size),
|
|
139
|
-
// Hide native clear button for input[type="search"] in WebKit browsers (Safari/Chrome)
|
|
139
|
+
getInputClassName(size, !!leftIcon, !!(rightIcon || validated)),
|
|
140
140
|
"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none"
|
|
141
141
|
),
|
|
142
142
|
...props
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
className: cn.cn(
|
|
149
|
+
"pointer-events-none absolute inset-y-0 left-0 flex items-center text-content-secondary",
|
|
150
|
+
ICON_INSET[size]
|
|
151
|
+
),
|
|
152
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-4 shrink-0 items-center justify-center", children: leftIcon })
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
(rightIcon || validated) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
className: cn.cn(
|
|
159
|
+
"absolute inset-y-0 right-0 flex items-center gap-2 text-content-secondary",
|
|
160
|
+
ICON_INSET[size]
|
|
161
|
+
),
|
|
162
|
+
children: [
|
|
163
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-4 shrink-0 items-center justify-center", children: rightIcon }),
|
|
164
|
+
validated && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none flex size-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(CheckOutlineIcon.CheckOutlineIcon, { className: "text-success-content" }) })
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
)
|
|
147
168
|
] }),
|
|
148
169
|
bottomText && /* @__PURE__ */ jsxRuntime.jsx(TextFieldHelperText, { id: helperTextId, error, children: bottomText })
|
|
149
170
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.cjs","sources":["../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { CheckOutlineIcon } from \"@/index\";\nimport { cn } from \"../../utils/cn\";\n\n/** Text field height in pixels. */\nexport type TextFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface TextFieldProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\" | \"prefix\"> {\n /** Label text displayed above the input. Also used as the accessible name. */\n label?: string;\n /** Helper text displayed below the input. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the text field in pixels. @default \"48\" */\n size?: TextFieldSize;\n /** Whether the text field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the input. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Whether the text field is validated. @default false */\n validated?: boolean;\n /** Icon element displayed at the left side of the input. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed at the right side of the input. */\n rightIcon?: React.ReactNode;\n /** Whether the text field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n}\n\nconst CONTAINER_HEIGHT: Record<TextFieldSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<TextFieldSize, string> = {\n \"48\": \"py-3 typography-regular-body-lg\",\n \"40\": \"py-2 typography-regular-body-lg\",\n \"32\": \"py-2 typography-regular-body-md\",\n};\n\nconst PADDING_HORIZONTAL: Record<TextFieldSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nconst ICON_SPACING: Record<TextFieldSize, string> = {\n \"48\": \"gap-2\",\n \"40\": \"gap-2\",\n \"32\": \"gap-2\",\n};\n\nfunction getContainerClassName(size: TextFieldSize, error: boolean, disabled?: boolean) {\n return cn(\n \"flex items-center rounded-sm border bg-neutral-alphas-50 has-focus-visible:outline-none motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n PADDING_HORIZONTAL[size],\n ICON_SPACING[size],\n disabled && \"opacity-50\",\n );\n}\n\nfunction getInputClassName(size: TextFieldSize) {\n return cn(\n \"h-full min-w-0 flex-1 bg-transparent text-content-primary no-underline placeholder:text-content-secondary focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n );\n}\n\nfunction TextFieldIcon({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"flex size-4 shrink-0 items-center justify-center text-content-secondary\">\n {children}\n </div>\n );\n}\n\nfunction TextFieldHelperText({\n id,\n error,\n children,\n}: {\n id: string;\n error: boolean;\n children: React.ReactNode;\n}) {\n return (\n <p\n id={id}\n className={cn(\n \"typography-regular-body-sm px-2 pt-2 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {children}\n </p>\n );\n}\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"TextField: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A text input field with optional label, helper/error text, and icon slots.\n *\n * Provide at least one of `label`, `aria-label`, or `aria-labelledby` for\n * accessibility — a console warning is emitted in development if none are set.\n *\n * @example\n * ```tsx\n * <TextField\n * label=\"Email\"\n * placeholder=\"you@example.com\"\n * error={!!emailError}\n * errorMessage={emailError}\n * />\n * ```\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n label,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n validated = false,\n leftIcon,\n rightIcon,\n className,\n id,\n disabled,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const helperTextId = `${inputId}-helper`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n warnMissingAccessibleName(label, props[\"aria-label\"], props[\"aria-labelledby\"]);\n\n return (\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={inputId}\n className=\"typography-semibold-body-sm px-1 pt-1 pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <div className={getContainerClassName(size, error, disabled)}>\n {leftIcon && <TextFieldIcon>{leftIcon}</TextFieldIcon>}\n\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-describedby={bottomText ? helperTextId : undefined}\n aria-invalid={error || undefined}\n className={cn(\n getInputClassName(size),\n // Hide native clear button for input[type=\"search\"] in WebKit browsers (Safari/Chrome)\n \"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none\",\n )}\n {...props}\n />\n\n {rightIcon && <TextFieldIcon>{rightIcon}</TextFieldIcon>}\n {validated && (\n <TextFieldIcon>\n <CheckOutlineIcon className=\"text-success-content\" />\n </TextFieldIcon>\n )}\n </div>\n\n {bottomText && (\n <TextFieldHelperText id={helperTextId} error={error}>\n {bottomText}\n </TextFieldHelperText>\n )}\n </div>\n );\n },\n);\n\nTextField.displayName = \"TextField\";\n"],"names":["cn","jsx","React","jsxs","CheckOutlineIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,mBAAkD;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,eAA8C;AAAA,EAClD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,sBAAsB,MAAqB,OA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e;AAE1D,8BAA0B,OAAO,MAAM,YAAY,GAAG,MAAM,iBAAiB,CAAC;AAE9E,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH,GAAAA,GAAG,iBAAiB,aAAa,UAAU,SAAS;AAAA,QAC/D,iBAAe,WAAW,KAAK;AAAA,QAC/B,cAAY,QAAQ,KAAK;AAAA,QAExB,UAAA;AAAA,UAAA,SACCC,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,WAAU;AAAA,cAET,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,0CAIJ,OAAA,EAAI,WAAW,sBAAsB,MAAM,OAAO,QAAQ,GACxD,UAAA;AAAA,YAAA,YAAYA,2BAAAA,IAAC,iBAAe,UAAA,SAAA,CAAS;AAAA,YAEtCA,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA,IAAI;AAAA,gBACJ;AAAA,gBACA,oBAAkB,aAAa,eAAe;AAAA,gBAC9C,gBAAc,SAAS;AAAA,gBACvB,WAAWD,GAAAA;AAAAA,kBACT,kBAAkB,IAAI;AAAA;AAAA,kBAEtB;AAAA,gBAAA;AAAA,gBAED,GAAG;AAAA,cAAA;AAAA,YAAA;AAAA,YAGL,aAAaC,2BAAAA,IAAC,eAAA,EAAe,UAAA,UAAA,CAAU;AAAA,YACvC,aACCA,2BAAAA,IAAC,eAAA,EACC,yCAACG,iBAAAA,kBAAA,EAAiB,WAAU,wBAAuB,EAAA,CACrD;AAAA,UAAA,GAEJ;AAAA,UAEC,cACCH,2BAAAA,IAAC,qBAAA,EAAoB,IAAI,cAAc,OACpC,UAAA,WAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,UAAU,cAAc;;"}
|
|
1
|
+
{"version":3,"file":"TextField.cjs","sources":["../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { CheckOutlineIcon } from \"@/index\";\nimport { cn } from \"../../utils/cn\";\n\n/** Text field height in pixels. */\nexport type TextFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface TextFieldProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\" | \"prefix\"> {\n /** Label text displayed above the input. Also used as the accessible name. */\n label?: string;\n /** Helper text displayed below the input. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the text field in pixels. @default \"48\" */\n size?: TextFieldSize;\n /** Whether the text field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the input. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Whether the text field is validated. @default false */\n validated?: boolean;\n /** Icon element displayed at the left side of the input. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed at the right side of the input. */\n rightIcon?: React.ReactNode;\n /** Whether the text field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n}\n\nconst CONTAINER_HEIGHT: Record<TextFieldSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<TextFieldSize, string> = {\n \"48\": \"py-3 typography-regular-body-lg\",\n \"40\": \"py-2 typography-regular-body-lg\",\n \"32\": \"py-2 typography-regular-body-md\",\n};\n\nconst INPUT_PL: Record<TextFieldSize, { default: string; withIcon: string }> = {\n \"48\": { default: \"pl-4\", withIcon: \"pl-10\" },\n \"40\": { default: \"pl-4\", withIcon: \"pl-10\" },\n \"32\": { default: \"pl-3\", withIcon: \"pl-9\" },\n};\n\nconst INPUT_PR: Record<TextFieldSize, { default: string; withIcon: string }> = {\n \"48\": { default: \"pr-4\", withIcon: \"pr-10\" },\n \"40\": { default: \"pr-4\", withIcon: \"pr-10\" },\n \"32\": { default: \"pr-3\", withIcon: \"pr-9\" },\n};\n\nconst ICON_INSET: Record<TextFieldSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nfunction getContainerClassName(size: TextFieldSize, error: boolean, disabled?: boolean) {\n return cn(\n \"relative overflow-hidden rounded-sm border bg-neutral-alphas-50 has-focus-visible:outline-none motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n disabled && \"opacity-50\",\n );\n}\n\nfunction getInputClassName(size: TextFieldSize, hasLeftIcon: boolean, hasRightIcon: boolean) {\n return cn(\n \"h-full w-full rounded-sm bg-transparent text-content-primary no-underline placeholder:text-content-secondary focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n hasLeftIcon ? INPUT_PL[size].withIcon : INPUT_PL[size].default,\n hasRightIcon ? INPUT_PR[size].withIcon : INPUT_PR[size].default,\n );\n}\n\nfunction TextFieldHelperText({\n id,\n error,\n children,\n}: {\n id: string;\n error: boolean;\n children: React.ReactNode;\n}) {\n return (\n <p\n id={id}\n className={cn(\n \"typography-regular-body-sm px-2 pt-2 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {children}\n </p>\n );\n}\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"TextField: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A text input field with optional label, helper/error text, and icon slots.\n *\n * Provide at least one of `label`, `aria-label`, or `aria-labelledby` for\n * accessibility — a console warning is emitted in development if none are set.\n *\n * @example\n * ```tsx\n * <TextField\n * label=\"Email\"\n * placeholder=\"you@example.com\"\n * error={!!emailError}\n * errorMessage={emailError}\n * />\n * ```\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n label,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n validated = false,\n leftIcon,\n rightIcon,\n className,\n id,\n disabled,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const helperTextId = `${inputId}-helper`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n warnMissingAccessibleName(label, props[\"aria-label\"], props[\"aria-labelledby\"]);\n\n return (\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={inputId}\n className=\"typography-semibold-body-sm px-1 pt-1 pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <div className={getContainerClassName(size, error, disabled)}>\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-describedby={bottomText ? helperTextId : undefined}\n aria-invalid={error || undefined}\n className={cn(\n getInputClassName(size, !!leftIcon, !!(rightIcon || validated)),\n \"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none\",\n )}\n {...props}\n />\n\n {leftIcon && (\n <div\n className={cn(\n \"pointer-events-none absolute inset-y-0 left-0 flex items-center text-content-secondary\",\n ICON_INSET[size],\n )}\n >\n <div className=\"flex size-4 shrink-0 items-center justify-center\">{leftIcon}</div>\n </div>\n )}\n\n {(rightIcon || validated) && (\n <div\n className={cn(\n \"absolute inset-y-0 right-0 flex items-center gap-2 text-content-secondary\",\n ICON_INSET[size],\n )}\n >\n {rightIcon && (\n <div className=\"flex size-4 shrink-0 items-center justify-center\">{rightIcon}</div>\n )}\n {validated && (\n <div className=\"pointer-events-none flex size-4 shrink-0 items-center justify-center\">\n <CheckOutlineIcon className=\"text-success-content\" />\n </div>\n )}\n </div>\n )}\n </div>\n\n {bottomText && (\n <TextFieldHelperText id={helperTextId} error={error}>\n {bottomText}\n </TextFieldHelperText>\n )}\n </div>\n );\n },\n);\n\nTextField.displayName = \"TextField\";\n"],"names":["cn","jsx","React","jsxs","CheckOutlineIcon"],"mappings":";;;;;;;;;;;;;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;AAAAA,kBACT,kBAAkB,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,aAAa,UAAU;AAAA,kBAC9D;AAAA,gBAAA;AAAA,gBAED,GAAG;AAAA,cAAA;AAAA,YAAA;AAAA,YAGL,YACCC,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWD,GAAAA;AAAAA,kBACT;AAAA,kBACA,WAAW,IAAI;AAAA,gBAAA;AAAA,gBAGjB,UAAAC,2BAAAA,IAAC,OAAA,EAAI,WAAU,oDAAoD,UAAA,SAAA,CAAS;AAAA,cAAA;AAAA,YAAA;AAAA,aAI9E,aAAa,cACbE,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWH,GAAAA;AAAAA,kBACT;AAAA,kBACA,WAAW,IAAI;AAAA,gBAAA;AAAA,gBAGhB,UAAA;AAAA,kBAAA,aACCC,2BAAAA,IAAC,OAAA,EAAI,WAAU,oDAAoD,UAAA,WAAU;AAAA,kBAE9E,4CACE,OAAA,EAAI,WAAU,wEACb,UAAAA,2BAAAA,IAACG,iBAAAA,kBAAA,EAAiB,WAAU,uBAAA,CAAuB,EAAA,CACrD;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ,GAEJ;AAAA,UAEC,cACCH,2BAAAA,IAAC,qBAAA,EAAoB,IAAI,cAAc,OACpC,UAAA,WAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,UAAU,cAAc;;"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -130,7 +130,9 @@ const Support2Icon = require("./components/Icons/Support2Icon.cjs");
|
|
|
130
130
|
const SupportIcon = require("./components/Icons/SupportIcon.cjs");
|
|
131
131
|
const TagIcon = require("./components/Icons/TagIcon.cjs");
|
|
132
132
|
const TaskIcon = require("./components/Icons/TaskIcon.cjs");
|
|
133
|
+
const ThumbDownFilledIcon = require("./components/Icons/ThumbDownFilledIcon.cjs");
|
|
133
134
|
const ThumbDownIcon = require("./components/Icons/ThumbDownIcon.cjs");
|
|
135
|
+
const ThumbUpFilledIcon = require("./components/Icons/ThumbUpFilledIcon.cjs");
|
|
134
136
|
const ThumbUpIcon = require("./components/Icons/ThumbUpIcon.cjs");
|
|
135
137
|
const TickCircleIcon = require("./components/Icons/TickCircleIcon.cjs");
|
|
136
138
|
const TickCircleOffIcon = require("./components/Icons/TickCircleOffIcon.cjs");
|
|
@@ -167,6 +169,8 @@ const Select = require("./components/Select/Select.cjs");
|
|
|
167
169
|
const Skeleton = require("./components/Skeleton/Skeleton.cjs");
|
|
168
170
|
const Slider = require("./components/Slider/Slider.cjs");
|
|
169
171
|
const Snackbar = require("./components/Snackbar/Snackbar.cjs");
|
|
172
|
+
const Stepper = require("./components/Stepper/Stepper.cjs");
|
|
173
|
+
const StepperStep = require("./components/Stepper/StepperStep.cjs");
|
|
170
174
|
const Switch = require("./components/Switch/Switch.cjs");
|
|
171
175
|
const SwitchField = require("./components/SwitchField/SwitchField.cjs");
|
|
172
176
|
const SwitchToggle = require("./components/SwitchToggle/SwitchToggle.cjs");
|
|
@@ -346,7 +350,9 @@ exports.Support2Icon = Support2Icon.Support2Icon;
|
|
|
346
350
|
exports.SupportIcon = SupportIcon.SupportIcon;
|
|
347
351
|
exports.TagIcon = TagIcon.TagIcon;
|
|
348
352
|
exports.TaskIcon = TaskIcon.TaskIcon;
|
|
353
|
+
exports.ThumbDownFilledIcon = ThumbDownFilledIcon.ThumbDownFilledIcon;
|
|
349
354
|
exports.ThumbDownIcon = ThumbDownIcon.ThumbDownIcon;
|
|
355
|
+
exports.ThumbUpFilledIcon = ThumbUpFilledIcon.ThumbUpFilledIcon;
|
|
350
356
|
exports.ThumbUpIcon = ThumbUpIcon.ThumbUpIcon;
|
|
351
357
|
exports.TickCircleIcon = TickCircleIcon.TickCircleIcon;
|
|
352
358
|
exports.TickCircleOffIcon = TickCircleOffIcon.TickCircleOffIcon;
|
|
@@ -390,6 +396,8 @@ exports.SelectSeparator = Select.SelectSeparator;
|
|
|
390
396
|
exports.Skeleton = Skeleton.Skeleton;
|
|
391
397
|
exports.Slider = Slider.Slider;
|
|
392
398
|
exports.Snackbar = Snackbar.Snackbar;
|
|
399
|
+
exports.Stepper = Stepper.Stepper;
|
|
400
|
+
exports.StepperStep = StepperStep.StepperStep;
|
|
393
401
|
exports.Switch = Switch.Switch;
|
|
394
402
|
exports.SwitchField = SwitchField.SwitchField;
|
|
395
403
|
exports.SwitchToggle = SwitchToggle.SwitchToggle;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
const ThumbDownFilledIcon = React.forwardRef(
|
|
6
|
+
({ className, ...props }, ref) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
fill: "none",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
className: cn("size-6", className),
|
|
15
|
+
...props,
|
|
16
|
+
children: /* @__PURE__ */ jsx("g", { fill: "currentColor", children: /* @__PURE__ */ jsxs("g", { transform: "translate(2 2)", children: [
|
|
17
|
+
/* @__PURE__ */ jsx("path", { d: "M6.38989 3.23001V13.39C6.38989 13.79 6.50989 14.18 6.72989 14.51L9.4599 18.57C9.8899 19.22 10.9599 19.68 11.8699 19.34C12.8499 19.01 13.4999 17.91 13.2899 16.93L12.7699 13.66C12.7299 13.36 12.8099 13.09 12.9799 12.88C13.1499 12.69 13.3999 12.57 13.6699 12.57H17.7799C18.5699 12.57 19.2499 12.25 19.6499 11.69C20.0299 11.15 20.0999 10.45 19.8499 9.74001L17.3899 2.25001C17.0799 1.01001 15.7299 5.72205e-06 14.3899 5.72205e-06H10.4899C9.8199 5.72205e-06 8.8799 0.230005 8.4499 0.660006L7.16989 1.65001C6.67989 2.02001 6.38989 2.61 6.38989 3.23001Z" }),
|
|
18
|
+
/* @__PURE__ */ jsx("path", { d: "M3.21 15.3398H2.18C0.63 15.3398 0 14.7398 0 13.2598V3.1998C0 1.7198 0.63 1.1198 2.18 1.1198H3.21C4.76 1.1198 5.39 1.7198 5.39 3.1998V13.2598C5.39 14.7398 4.76 15.3398 3.21 15.3398Z" })
|
|
19
|
+
] }) })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
ThumbDownFilledIcon.displayName = "ThumbDownFilledIcon";
|
|
25
|
+
export {
|
|
26
|
+
ThumbDownFilledIcon
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ThumbDownFilledIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbDownFilledIcon.mjs","sources":["../../../src/components/Icons/ThumbDownFilledIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport type { IconProps } from \"./types\";\n\nexport const ThumbDownFilledIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ className, ...props }, ref) => {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\"size-6\", className)}\n {...props}\n >\n <g fill=\"currentColor\">\n <g transform=\"translate(2 2)\">\n <path d=\"M6.38989 3.23001V13.39C6.38989 13.79 6.50989 14.18 6.72989 14.51L9.4599 18.57C9.8899 19.22 10.9599 19.68 11.8699 19.34C12.8499 19.01 13.4999 17.91 13.2899 16.93L12.7699 13.66C12.7299 13.36 12.8099 13.09 12.9799 12.88C13.1499 12.69 13.3999 12.57 13.6699 12.57H17.7799C18.5699 12.57 19.2499 12.25 19.6499 11.69C20.0299 11.15 20.0999 10.45 19.8499 9.74001L17.3899 2.25001C17.0799 1.01001 15.7299 5.72205e-06 14.3899 5.72205e-06H10.4899C9.8199 5.72205e-06 8.8799 0.230005 8.4499 0.660006L7.16989 1.65001C6.67989 2.02001 6.38989 2.61 6.38989 3.23001Z\" />\n <path d=\"M3.21 15.3398H2.18C0.63 15.3398 0 14.7398 0 13.2598V3.1998C0 1.7198 0.63 1.1198 2.18 1.1198H3.21C4.76 1.1198 5.39 1.7198 5.39 3.1998V13.2598C5.39 14.7398 4.76 15.3398 3.21 15.3398Z\" />\n </g>\n </g>\n </svg>\n );\n },\n);\n\nThumbDownFilledIcon.displayName = \"ThumbDownFilledIcon\";\n"],"names":[],"mappings":";;;;AAIO,MAAM,sBAAsB,MAAM;AAAA,EACvC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,WAAW,GAAG,UAAU,SAAS;AAAA,QAChC,GAAG;AAAA,QAEJ,8BAAC,KAAA,EAAE,MAAK,gBACN,UAAA,qBAAC,KAAA,EAAE,WAAU,kBACX,UAAA;AAAA,UAAA,oBAAC,QAAA,EAAK,GAAE,oiBAAA,CAAoiB;AAAA,UAC5iB,oBAAC,QAAA,EAAK,GAAE,uLAAA,CAAuL;AAAA,QAAA,EAAA,CACjM,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,oBAAoB,cAAc;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
const ThumbUpFilledIcon = React.forwardRef(
|
|
6
|
+
({ className, ...props }, ref) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
fill: "none",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
className: cn("size-6", className),
|
|
15
|
+
...props,
|
|
16
|
+
children: /* @__PURE__ */ jsx("g", { fill: "currentColor", children: /* @__PURE__ */ jsxs("g", { transform: "translate(2 2)", children: [
|
|
17
|
+
/* @__PURE__ */ jsx("path", { d: "M6.38989 16.2251V6.06508C6.38989 5.66508 6.50989 5.27508 6.72989 4.94508L9.4599 0.885083C9.8899 0.235083 10.9599 -0.224917 11.8699 0.115083C12.8499 0.445083 13.4999 1.54508 13.2899 2.52508L12.7699 5.79508C12.7299 6.09508 12.8099 6.36508 12.9799 6.57508C13.1499 6.76508 13.3999 6.88508 13.6699 6.88508H17.7799C18.5699 6.88508 19.2499 7.20508 19.6499 7.76507C20.0299 8.30507 20.0999 9.00507 19.8499 9.71507L17.3899 17.2051C17.0799 18.4451 15.7299 19.4551 14.3899 19.4551H10.4899C9.8199 19.4551 8.8799 19.2251 8.4499 18.7951L7.16989 17.8051C6.67989 17.4351 6.38989 16.8451 6.38989 16.2251Z" }),
|
|
18
|
+
/* @__PURE__ */ jsx("path", { d: "M3.21 4.11523H2.18C0.63 4.11523 0 4.71523 0 6.19523V16.2553C0 17.7353 0.63 18.3353 2.18 18.3353H3.21C4.76 18.3353 5.39 17.7353 5.39 16.2553V6.19523C5.39 4.71523 4.76 4.11523 3.21 4.11523Z" })
|
|
19
|
+
] }) })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
ThumbUpFilledIcon.displayName = "ThumbUpFilledIcon";
|
|
25
|
+
export {
|
|
26
|
+
ThumbUpFilledIcon
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ThumbUpFilledIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbUpFilledIcon.mjs","sources":["../../../src/components/Icons/ThumbUpFilledIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport type { IconProps } from \"./types\";\n\nexport const ThumbUpFilledIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ className, ...props }, ref) => {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\"size-6\", className)}\n {...props}\n >\n <g fill=\"currentColor\">\n <g transform=\"translate(2 2)\">\n <path d=\"M6.38989 16.2251V6.06508C6.38989 5.66508 6.50989 5.27508 6.72989 4.94508L9.4599 0.885083C9.8899 0.235083 10.9599 -0.224917 11.8699 0.115083C12.8499 0.445083 13.4999 1.54508 13.2899 2.52508L12.7699 5.79508C12.7299 6.09508 12.8099 6.36508 12.9799 6.57508C13.1499 6.76508 13.3999 6.88508 13.6699 6.88508H17.7799C18.5699 6.88508 19.2499 7.20508 19.6499 7.76507C20.0299 8.30507 20.0999 9.00507 19.8499 9.71507L17.3899 17.2051C17.0799 18.4451 15.7299 19.4551 14.3899 19.4551H10.4899C9.8199 19.4551 8.8799 19.2251 8.4499 18.7951L7.16989 17.8051C6.67989 17.4351 6.38989 16.8451 6.38989 16.2251Z\" />\n <path d=\"M3.21 4.11523H2.18C0.63 4.11523 0 4.71523 0 6.19523V16.2553C0 17.7353 0.63 18.3353 2.18 18.3353H3.21C4.76 18.3353 5.39 17.7353 5.39 16.2553V6.19523C5.39 4.71523 4.76 4.11523 3.21 4.11523Z\" />\n </g>\n </g>\n </svg>\n );\n },\n);\n\nThumbUpFilledIcon.displayName = \"ThumbUpFilledIcon\";\n"],"names":[],"mappings":";;;;AAIO,MAAM,oBAAoB,MAAM;AAAA,EACrC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,WAAW,GAAG,UAAU,SAAS;AAAA,QAChC,GAAG;AAAA,QAEJ,8BAAC,KAAA,EAAE,MAAK,gBACN,UAAA,qBAAC,KAAA,EAAE,WAAU,kBACX,UAAA;AAAA,UAAA,oBAAC,QAAA,EAAK,GAAE,6kBAAA,CAA6kB;AAAA,UACrlB,oBAAC,QAAA,EAAK,GAAE,8LAAA,CAA8L;AAAA,QAAA,EAAA,CACxM,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,kBAAkB,cAAc;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
import { StepperStep } from "./StepperStep.mjs";
|
|
6
|
+
const CONNECTOR_MARGIN = {
|
|
7
|
+
sm: "mt-3",
|
|
8
|
+
md: "mt-4",
|
|
9
|
+
lg: "mt-5"
|
|
10
|
+
};
|
|
11
|
+
const Stepper = React.forwardRef(
|
|
12
|
+
({ activeStep, steps, size = "md", className, ...props }, ref) => {
|
|
13
|
+
return (
|
|
14
|
+
// biome-ignore lint/a11y/useSemanticElements: <fieldset> adds unwanted browser styling for a non-interactive progress indicator
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
role: "group",
|
|
20
|
+
"aria-label": "Progress",
|
|
21
|
+
className: cn("flex items-start", className),
|
|
22
|
+
...props,
|
|
23
|
+
children: steps.map((step, index) => {
|
|
24
|
+
const state = index < activeStep ? "completed" : index === activeStep ? "active" : "upcoming";
|
|
25
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
StepperStep,
|
|
28
|
+
{
|
|
29
|
+
state,
|
|
30
|
+
size,
|
|
31
|
+
stepNumber: index + 1,
|
|
32
|
+
title: step.title,
|
|
33
|
+
description: step.description,
|
|
34
|
+
className: "shrink-0"
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: cn("h-px min-w-6 flex-1 bg-border-primary", CONNECTOR_MARGIN[size]),
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }, index);
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
Stepper.displayName = "Stepper";
|
|
52
|
+
export {
|
|
53
|
+
Stepper
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=Stepper.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.mjs","sources":["../../../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { StepperStep, type StepperStepSize } from \"./StepperStep\";\n\n/** Configuration for a single step within a {@link Stepper}. */\nexport interface StepItem {\n /** Primary label for the step. */\n title: string;\n /** Secondary description for the step. */\n description?: string;\n}\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Zero-based index of the currently active step. Steps before this are marked completed. */\n activeStep: number;\n /** Configuration for each step. */\n steps: StepItem[];\n /** Size preset applied to all step indicators and labels. @default \"md\" */\n size?: StepperStepSize;\n}\n\nconst CONNECTOR_MARGIN: Record<StepperStepSize, string> = {\n sm: \"mt-3\",\n md: \"mt-4\",\n lg: \"mt-5\",\n};\n\n/**\n * A horizontal progress stepper that displays a sequence of steps with\n * completed, active, and upcoming states.\n *\n * @example\n * ```tsx\n * <Stepper\n * activeStep={1}\n * steps={[\n * { title: \"Account\", description: \"Create account\" },\n * { title: \"Profile\", description: \"Set up profile\" },\n * { title: \"Done\", description: \"All set!\" },\n * ]}\n * />\n * ```\n */\nexport const Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n ({ activeStep, steps, size = \"md\", className, ...props }, ref) => {\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> adds unwanted browser styling for a non-interactive progress indicator\n <div\n ref={ref}\n role=\"group\"\n aria-label=\"Progress\"\n className={cn(\"flex items-start\", className)}\n {...props}\n >\n {steps.map((step, index) => {\n const state =\n index < activeStep ? \"completed\" : index === activeStep ? \"active\" : \"upcoming\";\n\n return (\n <React.Fragment key={index}>\n <StepperStep\n state={state}\n size={size}\n stepNumber={index + 1}\n title={step.title}\n description={step.description}\n className=\"shrink-0\"\n />\n {index < steps.length - 1 && (\n <div\n className={cn(\"h-px min-w-6 flex-1 bg-border-primary\", CONNECTOR_MARGIN[size])}\n aria-hidden=\"true\"\n />\n )}\n </React.Fragment>\n );\n })}\n </div>\n );\n },\n);\n\nStepper.displayName = \"Stepper\";\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,mBAAoD;AAAA,EACxD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAkBO,MAAM,UAAU,MAAM;AAAA,EAC3B,CAAC,EAAE,YAAY,OAAO,OAAO,MAAM,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChE;AAAA;AAAA,MAEE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,MAAK;AAAA,UACL,cAAW;AAAA,UACX,WAAW,GAAG,oBAAoB,SAAS;AAAA,UAC1C,GAAG;AAAA,UAEH,UAAA,MAAM,IAAI,CAAC,MAAM,UAAU;AAC1B,kBAAM,QACJ,QAAQ,aAAa,cAAc,UAAU,aAAa,WAAW;AAEvE,mBACE,qBAAC,MAAM,UAAN,EACC,UAAA;AAAA,cAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA,YAAY,QAAQ;AAAA,kBACpB,OAAO,KAAK;AAAA,kBACZ,aAAa,KAAK;AAAA,kBAClB,WAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEX,QAAQ,MAAM,SAAS,KACtB;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAW,GAAG,yCAAyC,iBAAiB,IAAI,CAAC;AAAA,kBAC7E,eAAY;AAAA,gBAAA;AAAA,cAAA;AAAA,YACd,EAAA,GAbiB,KAerB;AAAA,UAEJ,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EAGP;AACF;AAEA,QAAQ,cAAc;"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
import { CheckIcon } from "../Icons/CheckIcon.mjs";
|
|
6
|
+
const INDICATOR_SIZE = {
|
|
7
|
+
sm: "size-6",
|
|
8
|
+
md: "size-8",
|
|
9
|
+
lg: "size-10"
|
|
10
|
+
};
|
|
11
|
+
const INDICATOR_STATE = {
|
|
12
|
+
completed: "bg-success-surface",
|
|
13
|
+
active: "border border-brand-primary-default bg-brand-primary-muted",
|
|
14
|
+
upcoming: "bg-neutral-alphas-50"
|
|
15
|
+
};
|
|
16
|
+
const NUMBER_TYPOGRAPHY = {
|
|
17
|
+
sm: "typography-semibold-body-sm",
|
|
18
|
+
md: "typography-semibold-body-md",
|
|
19
|
+
lg: "typography-semibold-body-lg"
|
|
20
|
+
};
|
|
21
|
+
const NUMBER_COLOR = {
|
|
22
|
+
completed: "",
|
|
23
|
+
active: "text-content-primary",
|
|
24
|
+
upcoming: "text-content-secondary"
|
|
25
|
+
};
|
|
26
|
+
const CONTAINER_GAP = {
|
|
27
|
+
sm: "gap-1",
|
|
28
|
+
md: "gap-2",
|
|
29
|
+
lg: "gap-2"
|
|
30
|
+
};
|
|
31
|
+
const TITLE_TYPOGRAPHY = {
|
|
32
|
+
sm: "typography-regular-body-sm",
|
|
33
|
+
md: "typography-regular-body-md",
|
|
34
|
+
lg: "typography-regular-body-lg"
|
|
35
|
+
};
|
|
36
|
+
const DESCRIPTION_TYPOGRAPHY = {
|
|
37
|
+
sm: "typography-regular-body-sm",
|
|
38
|
+
md: "typography-regular-body-sm",
|
|
39
|
+
lg: "typography-regular-body-md"
|
|
40
|
+
};
|
|
41
|
+
const LABEL_COLOR = {
|
|
42
|
+
completed: "text-content-secondary",
|
|
43
|
+
active: "text-content-primary",
|
|
44
|
+
upcoming: "text-content-tertiary"
|
|
45
|
+
};
|
|
46
|
+
const CHECK_ICON_SIZE = {
|
|
47
|
+
sm: "size-3",
|
|
48
|
+
md: "size-4",
|
|
49
|
+
lg: "size-5"
|
|
50
|
+
};
|
|
51
|
+
const StepperStep = React.forwardRef(
|
|
52
|
+
({ state = "upcoming", size = "md", stepNumber, title, description, className, ...props }, ref) => {
|
|
53
|
+
const hasLabels = title != null || description != null;
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
className: cn("flex flex-col items-center", CONTAINER_GAP[size], className),
|
|
59
|
+
...props,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: cn(
|
|
65
|
+
"flex shrink-0 items-center justify-center rounded-full",
|
|
66
|
+
INDICATOR_SIZE[size],
|
|
67
|
+
INDICATOR_STATE[state]
|
|
68
|
+
),
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
children: state === "completed" ? /* @__PURE__ */ jsx(CheckIcon, { className: cn(CHECK_ICON_SIZE[size], "text-success-content") }) : /* @__PURE__ */ jsx("span", { className: cn(NUMBER_TYPOGRAPHY[size], NUMBER_COLOR[state]), children: stepNumber })
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
hasLabels && /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center gap-1 text-center", LABEL_COLOR[state]), children: [
|
|
74
|
+
title != null && /* @__PURE__ */ jsx("span", { className: TITLE_TYPOGRAPHY[size], children: title }),
|
|
75
|
+
description != null && /* @__PURE__ */ jsx("span", { className: DESCRIPTION_TYPOGRAPHY[size], children: description })
|
|
76
|
+
] })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
StepperStep.displayName = "StepperStep";
|
|
83
|
+
export {
|
|
84
|
+
StepperStep
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=StepperStep.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepperStep.mjs","sources":["../../../src/components/Stepper/StepperStep.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { CheckIcon } from \"../Icons/CheckIcon\";\n\n/** Current state of a step in the stepper. */\nexport type StepperStepState = \"completed\" | \"active\" | \"upcoming\";\n\n/** Size preset for the step indicator and labels. */\nexport type StepperStepSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface StepperStepProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Current state of the step. @default \"upcoming\" */\n state?: StepperStepState;\n /** Size preset for the indicator and labels. @default \"md\" */\n size?: StepperStepSize;\n /** Step number displayed in the indicator for active and upcoming states. */\n stepNumber?: number;\n /** Primary label shown below the indicator. */\n title?: string;\n /** Secondary description shown below the title. */\n description?: string;\n}\n\nconst INDICATOR_SIZE: Record<StepperStepSize, string> = {\n sm: \"size-6\",\n md: \"size-8\",\n lg: \"size-10\",\n};\n\nconst INDICATOR_STATE: Record<StepperStepState, string> = {\n completed: \"bg-success-surface\",\n active: \"border border-brand-primary-default bg-brand-primary-muted\",\n upcoming: \"bg-neutral-alphas-50\",\n};\n\nconst NUMBER_TYPOGRAPHY: Record<StepperStepSize, string> = {\n sm: \"typography-semibold-body-sm\",\n md: \"typography-semibold-body-md\",\n lg: \"typography-semibold-body-lg\",\n};\n\nconst NUMBER_COLOR: Record<StepperStepState, string> = {\n completed: \"\",\n active: \"text-content-primary\",\n upcoming: \"text-content-secondary\",\n};\n\nconst CONTAINER_GAP: Record<StepperStepSize, string> = {\n sm: \"gap-1\",\n md: \"gap-2\",\n lg: \"gap-2\",\n};\n\nconst TITLE_TYPOGRAPHY: Record<StepperStepSize, string> = {\n sm: \"typography-regular-body-sm\",\n md: \"typography-regular-body-md\",\n lg: \"typography-regular-body-lg\",\n};\n\nconst DESCRIPTION_TYPOGRAPHY: Record<StepperStepSize, string> = {\n sm: \"typography-regular-body-sm\",\n md: \"typography-regular-body-sm\",\n lg: \"typography-regular-body-md\",\n};\n\nconst LABEL_COLOR: Record<StepperStepState, string> = {\n completed: \"text-content-secondary\",\n active: \"text-content-primary\",\n upcoming: \"text-content-tertiary\",\n};\n\nconst CHECK_ICON_SIZE: Record<StepperStepSize, string> = {\n sm: \"size-3\",\n md: \"size-4\",\n lg: \"size-5\",\n};\n\n/**\n * A single step indicator with optional labels, used standalone or within a {@link Stepper}.\n *\n * @example\n * ```tsx\n * <StepperStep state=\"active\" stepNumber={2} title=\"Profile\" description=\"Set up profile\" />\n * ```\n */\nexport const StepperStep = React.forwardRef<HTMLDivElement, StepperStepProps>(\n (\n { state = \"upcoming\", size = \"md\", stepNumber, title, description, className, ...props },\n ref,\n ) => {\n const hasLabels = title != null || description != null;\n\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col items-center\", CONTAINER_GAP[size], className)}\n {...props}\n >\n <div\n className={cn(\n \"flex shrink-0 items-center justify-center rounded-full\",\n INDICATOR_SIZE[size],\n INDICATOR_STATE[state],\n )}\n aria-hidden=\"true\"\n >\n {state === \"completed\" ? (\n <CheckIcon className={cn(CHECK_ICON_SIZE[size], \"text-success-content\")} />\n ) : (\n <span className={cn(NUMBER_TYPOGRAPHY[size], NUMBER_COLOR[state])}>{stepNumber}</span>\n )}\n </div>\n\n {hasLabels && (\n <div className={cn(\"flex flex-col items-center gap-1 text-center\", LABEL_COLOR[state])}>\n {title != null && <span className={TITLE_TYPOGRAPHY[size]}>{title}</span>}\n {description != null && (\n <span className={DESCRIPTION_TYPOGRAPHY[size]}>{description}</span>\n )}\n </div>\n )}\n </div>\n );\n },\n);\n\nStepperStep.displayName = \"StepperStep\";\n"],"names":[],"mappings":";;;;;AAuBA,MAAM,iBAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,kBAAoD;AAAA,EACxD,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AACZ;AAEA,MAAM,oBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAiD;AAAA,EACrD,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AACZ;AAEA,MAAM,gBAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,mBAAoD;A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A,CAEhE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,YAAY,cAAc;"}
|
|
@@ -13,36 +13,38 @@ const INPUT_SIZE_CLASSES = {
|
|
|
13
13
|
"40": "py-2 typography-regular-body-lg",
|
|
14
14
|
"32": "py-2 typography-regular-body-md"
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
const INPUT_PL = {
|
|
17
|
+
"48": { default: "pl-4", withIcon: "pl-10" },
|
|
18
|
+
"40": { default: "pl-4", withIcon: "pl-10" },
|
|
19
|
+
"32": { default: "pl-3", withIcon: "pl-9" }
|
|
20
|
+
};
|
|
21
|
+
const INPUT_PR = {
|
|
22
|
+
"48": { default: "pr-4", withIcon: "pr-10" },
|
|
23
|
+
"40": { default: "pr-4", withIcon: "pr-10" },
|
|
24
|
+
"32": { default: "pr-3", withIcon: "pr-9" }
|
|
25
|
+
};
|
|
26
|
+
const ICON_INSET = {
|
|
17
27
|
"48": "px-4",
|
|
18
28
|
"40": "px-4",
|
|
19
29
|
"32": "px-3"
|
|
20
30
|
};
|
|
21
|
-
const ICON_SPACING = {
|
|
22
|
-
"48": "gap-2",
|
|
23
|
-
"40": "gap-2",
|
|
24
|
-
"32": "gap-2"
|
|
25
|
-
};
|
|
26
31
|
function getContainerClassName(size, error, disabled) {
|
|
27
32
|
return cn(
|
|
28
|
-
"
|
|
33
|
+
"relative overflow-hidden rounded-sm border bg-neutral-alphas-50 has-focus-visible:outline-none motion-safe:transition-colors",
|
|
29
34
|
error ? "border-error-content" : "border-transparent",
|
|
30
35
|
!disabled && !error && "hover:border-neutral-alphas-400",
|
|
31
36
|
CONTAINER_HEIGHT[size],
|
|
32
|
-
PADDING_HORIZONTAL[size],
|
|
33
|
-
ICON_SPACING[size],
|
|
34
37
|
disabled && "opacity-50"
|
|
35
38
|
);
|
|
36
39
|
}
|
|
37
|
-
function getInputClassName(size) {
|
|
40
|
+
function getInputClassName(size, hasLeftIcon, hasRightIcon) {
|
|
38
41
|
return cn(
|
|
39
|
-
"h-full
|
|
40
|
-
INPUT_SIZE_CLASSES[size]
|
|
42
|
+
"h-full w-full rounded-sm bg-transparent text-content-primary no-underline placeholder:text-content-secondary focus:outline-none disabled:cursor-not-allowed",
|
|
43
|
+
INPUT_SIZE_CLASSES[size],
|
|
44
|
+
hasLeftIcon ? INPUT_PL[size].withIcon : INPUT_PL[size].default,
|
|
45
|
+
hasRightIcon ? INPUT_PR[size].withIcon : INPUT_PR[size].default
|
|
41
46
|
);
|
|
42
47
|
}
|
|
43
|
-
function TextFieldIcon({ children }) {
|
|
44
|
-
return /* @__PURE__ */ jsx("div", { className: "flex size-4 shrink-0 items-center justify-center text-content-secondary", children });
|
|
45
|
-
}
|
|
46
48
|
function TextFieldHelperText({
|
|
47
49
|
id,
|
|
48
50
|
error,
|
|
@@ -106,7 +108,6 @@ const TextField = React.forwardRef(
|
|
|
106
108
|
}
|
|
107
109
|
),
|
|
108
110
|
/* @__PURE__ */ jsxs("div", { className: getContainerClassName(size, error, disabled), children: [
|
|
109
|
-
leftIcon && /* @__PURE__ */ jsx(TextFieldIcon, { children: leftIcon }),
|
|
110
111
|
/* @__PURE__ */ jsx(
|
|
111
112
|
"input",
|
|
112
113
|
{
|
|
@@ -116,15 +117,35 @@ const TextField = React.forwardRef(
|
|
|
116
117
|
"aria-describedby": bottomText ? helperTextId : void 0,
|
|
117
118
|
"aria-invalid": error || void 0,
|
|
118
119
|
className: cn(
|
|
119
|
-
getInputClassName(size),
|
|
120
|
-
// Hide native clear button for input[type="search"] in WebKit browsers (Safari/Chrome)
|
|
120
|
+
getInputClassName(size, !!leftIcon, !!(rightIcon || validated)),
|
|
121
121
|
"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none"
|
|
122
122
|
),
|
|
123
123
|
...props
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
leftIcon && /* @__PURE__ */ jsx(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: cn(
|
|
130
|
+
"pointer-events-none absolute inset-y-0 left-0 flex items-center text-content-secondary",
|
|
131
|
+
ICON_INSET[size]
|
|
132
|
+
),
|
|
133
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex size-4 shrink-0 items-center justify-center", children: leftIcon })
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
(rightIcon || validated) && /* @__PURE__ */ jsxs(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
className: cn(
|
|
140
|
+
"absolute inset-y-0 right-0 flex items-center gap-2 text-content-secondary",
|
|
141
|
+
ICON_INSET[size]
|
|
142
|
+
),
|
|
143
|
+
children: [
|
|
144
|
+
rightIcon && /* @__PURE__ */ jsx("div", { className: "flex size-4 shrink-0 items-center justify-center", children: rightIcon }),
|
|
145
|
+
validated && /* @__PURE__ */ jsx("div", { className: "pointer-events-none flex size-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx(CheckOutlineIcon, { className: "text-success-content" }) })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
)
|
|
128
149
|
] }),
|
|
129
150
|
bottomText && /* @__PURE__ */ jsx(TextFieldHelperText, { id: helperTextId, error, children: bottomText })
|
|
130
151
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.mjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { CheckOutlineIcon } from \"@/index\";\nimport { cn } from \"../../utils/cn\";\n\n/** Text field height in pixels. */\nexport type TextFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface TextFieldProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\" | \"prefix\"> {\n /** Label text displayed above the input. Also used as the accessible name. */\n label?: string;\n /** Helper text displayed below the input. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the text field in pixels. @default \"48\" */\n size?: TextFieldSize;\n /** Whether the text field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the input. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Whether the text field is validated. @default false */\n validated?: boolean;\n /** Icon element displayed at the left side of the input. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed at the right side of the input. */\n rightIcon?: React.ReactNode;\n /** Whether the text field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n}\n\nconst CONTAINER_HEIGHT: Record<TextFieldSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<TextFieldSize, string> = {\n \"48\": \"py-3 typography-regular-body-lg\",\n \"40\": \"py-2 typography-regular-body-lg\",\n \"32\": \"py-2 typography-regular-body-md\",\n};\n\nconst PADDING_HORIZONTAL: Record<TextFieldSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nconst ICON_SPACING: Record<TextFieldSize, string> = {\n \"48\": \"gap-2\",\n \"40\": \"gap-2\",\n \"32\": \"gap-2\",\n};\n\nfunction getContainerClassName(size: TextFieldSize, error: boolean, disabled?: boolean) {\n return cn(\n \"flex items-center rounded-sm border bg-neutral-alphas-50 has-focus-visible:outline-none motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n PADDING_HORIZONTAL[size],\n ICON_SPACING[size],\n disabled && \"opacity-50\",\n );\n}\n\nfunction getInputClassName(size: TextFieldSize) {\n return cn(\n \"h-full min-w-0 flex-1 bg-transparent text-content-primary no-underline placeholder:text-content-secondary focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n );\n}\n\nfunction TextFieldIcon({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"flex size-4 shrink-0 items-center justify-center text-content-secondary\">\n {children}\n </div>\n );\n}\n\nfunction TextFieldHelperText({\n id,\n error,\n children,\n}: {\n id: string;\n error: boolean;\n children: React.ReactNode;\n}) {\n return (\n <p\n id={id}\n className={cn(\n \"typography-regular-body-sm px-2 pt-2 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {children}\n </p>\n );\n}\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"TextField: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A text input field with optional label, helper/error text, and icon slots.\n *\n * Provide at least one of `label`, `aria-label`, or `aria-labelledby` for\n * accessibility — a console warning is emitted in development if none are set.\n *\n * @example\n * ```tsx\n * <TextField\n * label=\"Email\"\n * placeholder=\"you@example.com\"\n * error={!!emailError}\n * errorMessage={emailError}\n * />\n * ```\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n label,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n validated = false,\n leftIcon,\n rightIcon,\n className,\n id,\n disabled,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const helperTextId = `${inputId}-helper`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n warnMissingAccessibleName(label, props[\"aria-label\"], props[\"aria-labelledby\"]);\n\n return (\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={inputId}\n className=\"typography-semibold-body-sm px-1 pt-1 pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <div className={getContainerClassName(size, error, disabled)}>\n {leftIcon && <TextFieldIcon>{leftIcon}</TextFieldIcon>}\n\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-describedby={bottomText ? helperTextId : undefined}\n aria-invalid={error || undefined}\n className={cn(\n getInputClassName(size),\n // Hide native clear button for input[type=\"search\"] in WebKit browsers (Safari/Chrome)\n \"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none\",\n )}\n {...props}\n />\n\n {rightIcon && <TextFieldIcon>{rightIcon}</TextFieldIcon>}\n {validated && (\n <TextFieldIcon>\n <CheckOutlineIcon className=\"text-success-content\" />\n </TextFieldIcon>\n )}\n </div>\n\n {bottomText && (\n <TextFieldHelperText id={helperTextId} error={error}>\n {bottomText}\n </TextFieldHelperText>\n )}\n </div>\n );\n },\n);\n\nTextField.displayName = \"TextField\";\n"],"names":[],"mappings":";;;;;AA6BA,MAAM,mBAAkD;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,eAA8C;AAAA,EAClD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,sBAAsB,MAAqB,OAAgB,UAAoB;AACtF,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,yBAAyB;AAAA,IACjC,CAAC,YAAY,CAAC,SAAS;AAAA,IACvB,iBAAiB,IAAI;AAAA,IACrB,mBAAmB,IAAI;AAAA,IACvB,aAAa,IAAI;AAAA,IACjB,YAAY;AAAA,EAAA;AAEhB;AAEA,SAAS,kBAAkB,MAAqB;AAC9C,SAAO;AAAA,IACL;AAAA,IACA,mBAAmB,IAAI;AAAA,EAAA;AAE3B;AAEA,SAAS,cAAc,EAAE,YAA2C;AAClE,SACE,oBAAC,OAAA,EAAI,WAAU,2EACZ,SAAA,CACH;AAEJ;AAEA,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAC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,gBACC;AAAA,gBACA,IAAI;AAAA,gBACJ;AAAA,gBACA,oBAAkB,aAAa,eAAe;AAAA,gBAC9C,gBAAc,SAAS;AAAA,gBACvB,WAAW;AAAA,kBACT,kBAAkB,IAAI;AAAA;AAAA,kBAEtB;AAAA,gBAAA;AAAA,gBAED,GAAG;AAAA,cAAA;AAAA,YAAA;AAAA,YAGL,aAAa,oBAAC,eAAA,EAAe,UAAA,UAAA,CAAU;AAAA,YACvC,aACC,oBAAC,eAAA,EACC,8BAAC,kBAAA,EAAiB,WAAU,wBAAuB,EAAA,CACrD;AAAA,UAAA,GAEJ;AAAA,UAEC,cACC,oBAAC,qBAAA,EAAoB,IAAI,cAAc,OACpC,UAAA,WAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,UAAU,cAAc;"}
|
|
1
|
+
{"version":3,"file":"TextField.mjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { CheckOutlineIcon } from \"@/index\";\nimport { cn } from \"../../utils/cn\";\n\n/** Text field height in pixels. */\nexport type TextFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface TextFieldProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\" | \"prefix\"> {\n /** Label text displayed above the input. Also used as the accessible name. */\n label?: string;\n /** Helper text displayed below the input. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the text field in pixels. @default \"48\" */\n size?: TextFieldSize;\n /** Whether the text field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the input. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Whether the text field is validated. @default false */\n validated?: boolean;\n /** Icon element displayed at the left side of the input. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed at the right side of the input. */\n rightIcon?: React.ReactNode;\n /** Whether the text field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n}\n\nconst CONTAINER_HEIGHT: Record<TextFieldSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<TextFieldSize, string> = {\n \"48\": \"py-3 typography-regular-body-lg\",\n \"40\": \"py-2 typography-regular-body-lg\",\n \"32\": \"py-2 typography-regular-body-md\",\n};\n\nconst INPUT_PL: Record<TextFieldSize, { default: string; withIcon: string }> = {\n \"48\": { default: \"pl-4\", withIcon: \"pl-10\" },\n \"40\": { default: \"pl-4\", withIcon: \"pl-10\" },\n \"32\": { default: \"pl-3\", withIcon: \"pl-9\" },\n};\n\nconst INPUT_PR: Record<TextFieldSize, { default: string; withIcon: string }> = {\n \"48\": { default: \"pr-4\", withIcon: \"pr-10\" },\n \"40\": { default: \"pr-4\", withIcon: \"pr-10\" },\n \"32\": { default: \"pr-3\", withIcon: \"pr-9\" },\n};\n\nconst ICON_INSET: Record<TextFieldSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nfunction getContainerClassName(size: TextFieldSize, error: boolean, disabled?: boolean) {\n return cn(\n \"relative overflow-hidden rounded-sm border bg-neutral-alphas-50 has-focus-visible:outline-none motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n disabled && \"opacity-50\",\n );\n}\n\nfunction getInputClassName(size: TextFieldSize, hasLeftIcon: boolean, hasRightIcon: boolean) {\n return cn(\n \"h-full w-full rounded-sm bg-transparent text-content-primary no-underline placeholder:text-content-secondary focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n hasLeftIcon ? INPUT_PL[size].withIcon : INPUT_PL[size].default,\n hasRightIcon ? INPUT_PR[size].withIcon : INPUT_PR[size].default,\n );\n}\n\nfunction TextFieldHelperText({\n id,\n error,\n children,\n}: {\n id: string;\n error: boolean;\n children: React.ReactNode;\n}) {\n return (\n <p\n id={id}\n className={cn(\n \"typography-regular-body-sm px-2 pt-2 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {children}\n </p>\n );\n}\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"TextField: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A text input field with optional label, helper/error text, and icon slots.\n *\n * Provide at least one of `label`, `aria-label`, or `aria-labelledby` for\n * accessibility — a console warning is emitted in development if none are set.\n *\n * @example\n * ```tsx\n * <TextField\n * label=\"Email\"\n * placeholder=\"you@example.com\"\n * error={!!emailError}\n * errorMessage={emailError}\n * />\n * ```\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n label,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n validated = false,\n leftIcon,\n rightIcon,\n className,\n id,\n disabled,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const helperTextId = `${inputId}-helper`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n warnMissingAccessibleName(label, props[\"aria-label\"], props[\"aria-labelledby\"]);\n\n return (\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={inputId}\n className=\"typography-semibold-body-sm px-1 pt-1 pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <div className={getContainerClassName(size, error, disabled)}>\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-describedby={bottomText ? helperTextId : undefined}\n aria-invalid={error || undefined}\n className={cn(\n getInputClassName(size, !!leftIcon, !!(rightIcon || validated)),\n \"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none\",\n )}\n {...props}\n />\n\n {leftIcon && (\n <div\n className={cn(\n \"pointer-events-none absolute inset-y-0 left-0 flex items-center text-content-secondary\",\n ICON_INSET[size],\n )}\n >\n <div className=\"flex size-4 shrink-0 items-center justify-center\">{leftIcon}</div>\n </div>\n )}\n\n {(rightIcon || validated) && (\n <div\n className={cn(\n \"absolute inset-y-0 right-0 flex items-center gap-2 text-content-secondary\",\n ICON_INSET[size],\n )}\n >\n {rightIcon && (\n <div className=\"flex size-4 shrink-0 items-center justify-center\">{rightIcon}</div>\n )}\n {validated && (\n <div className=\"pointer-events-none flex size-4 shrink-0 items-center justify-center\">\n <CheckOutlineIcon className=\"text-success-content\" />\n </div>\n )}\n </div>\n )}\n </div>\n\n {bottomText && (\n <TextFieldHelperText id={helperTextId} error={error}>\n {bottomText}\n </TextFieldHelperText>\n )}\n </div>\n );\n },\n);\n\nTextField.displayName = \"TextField\";\n"],"names":[],"mappings":";;;;;AA6BA,MAAM,mBAAkD;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,WAAyE;AAAA,EAC7E,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,OAAA;AACrC;AAEA,MAAM,WAAyE;AAAA,EAC7E,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,OAAA;AACrC;AAEA,MAAM,aAA4C;AAAA,EAChD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,sBAAsB,MAAqB,OAAgB,UAAoB;AACtF,SAAO;AAAA,IACL;A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Ac,OACpC,UAAA,WAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,UAAU,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2145,6 +2145,70 @@ export declare const StarIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttr
|
|
|
2145
2145
|
className?: string;
|
|
2146
2146
|
} & React_2.RefAttributes<SVGSVGElement>>;
|
|
2147
2147
|
|
|
2148
|
+
/** Configuration for a single step within a {@link Stepper}. */
|
|
2149
|
+
export declare interface StepItem {
|
|
2150
|
+
/** Primary label for the step. */
|
|
2151
|
+
title: string;
|
|
2152
|
+
/** Secondary description for the step. */
|
|
2153
|
+
description?: string;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
/**
|
|
2157
|
+
* A horizontal progress stepper that displays a sequence of steps with
|
|
2158
|
+
* completed, active, and upcoming states.
|
|
2159
|
+
*
|
|
2160
|
+
* @example
|
|
2161
|
+
* ```tsx
|
|
2162
|
+
* <Stepper
|
|
2163
|
+
* activeStep={1}
|
|
2164
|
+
* steps={[
|
|
2165
|
+
* { title: "Account", description: "Create account" },
|
|
2166
|
+
* { title: "Profile", description: "Set up profile" },
|
|
2167
|
+
* { title: "Done", description: "All set!" },
|
|
2168
|
+
* ]}
|
|
2169
|
+
* />
|
|
2170
|
+
* ```
|
|
2171
|
+
*/
|
|
2172
|
+
export declare const Stepper: React_2.ForwardRefExoticComponent<StepperProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
2173
|
+
|
|
2174
|
+
export declare interface StepperProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
2175
|
+
/** Zero-based index of the currently active step. Steps before this are marked completed. */
|
|
2176
|
+
activeStep: number;
|
|
2177
|
+
/** Configuration for each step. */
|
|
2178
|
+
steps: StepItem[];
|
|
2179
|
+
/** Size preset applied to all step indicators and labels. @default "md" */
|
|
2180
|
+
size?: StepperStepSize;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* A single step indicator with optional labels, used standalone or within a {@link Stepper}.
|
|
2185
|
+
*
|
|
2186
|
+
* @example
|
|
2187
|
+
* ```tsx
|
|
2188
|
+
* <StepperStep state="active" stepNumber={2} title="Profile" description="Set up profile" />
|
|
2189
|
+
* ```
|
|
2190
|
+
*/
|
|
2191
|
+
export declare const StepperStep: React_2.ForwardRefExoticComponent<StepperStepProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
2192
|
+
|
|
2193
|
+
export declare interface StepperStepProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
2194
|
+
/** Current state of the step. @default "upcoming" */
|
|
2195
|
+
state?: StepperStepState;
|
|
2196
|
+
/** Size preset for the indicator and labels. @default "md" */
|
|
2197
|
+
size?: StepperStepSize;
|
|
2198
|
+
/** Step number displayed in the indicator for active and upcoming states. */
|
|
2199
|
+
stepNumber?: number;
|
|
2200
|
+
/** Primary label shown below the indicator. */
|
|
2201
|
+
title?: string;
|
|
2202
|
+
/** Secondary description shown below the title. */
|
|
2203
|
+
description?: string;
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
/** Size preset for the step indicator and labels. */
|
|
2207
|
+
export declare type StepperStepSize = "sm" | "md" | "lg";
|
|
2208
|
+
|
|
2209
|
+
/** Current state of a step in the stepper. */
|
|
2210
|
+
export declare type StepperStepState = "completed" | "active" | "upcoming";
|
|
2211
|
+
|
|
2148
2212
|
export declare const StopIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
2149
2213
|
className?: string;
|
|
2150
2214
|
} & React_2.RefAttributes<SVGSVGElement>>;
|
|
@@ -2651,10 +2715,18 @@ export declare interface TextFieldProps extends Omit<React_2.InputHTMLAttributes
|
|
|
2651
2715
|
/** Text field height in pixels. */
|
|
2652
2716
|
export declare type TextFieldSize = "48" | "40" | "32";
|
|
2653
2717
|
|
|
2718
|
+
export declare const ThumbDownFilledIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
2719
|
+
className?: string;
|
|
2720
|
+
} & React_2.RefAttributes<SVGSVGElement>>;
|
|
2721
|
+
|
|
2654
2722
|
export declare const ThumbDownIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
2655
2723
|
className?: string;
|
|
2656
2724
|
} & React_2.RefAttributes<SVGSVGElement>>;
|
|
2657
2725
|
|
|
2726
|
+
export declare const ThumbUpFilledIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
2727
|
+
className?: string;
|
|
2728
|
+
} & React_2.RefAttributes<SVGSVGElement>>;
|
|
2729
|
+
|
|
2658
2730
|
export declare const ThumbUpIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
2659
2731
|
className?: string;
|
|
2660
2732
|
} & React_2.RefAttributes<SVGSVGElement>>;
|
package/dist/index.mjs
CHANGED
|
@@ -128,7 +128,9 @@ import { Support2Icon } from "./components/Icons/Support2Icon.mjs";
|
|
|
128
128
|
import { SupportIcon } from "./components/Icons/SupportIcon.mjs";
|
|
129
129
|
import { TagIcon } from "./components/Icons/TagIcon.mjs";
|
|
130
130
|
import { TaskIcon } from "./components/Icons/TaskIcon.mjs";
|
|
131
|
+
import { ThumbDownFilledIcon } from "./components/Icons/ThumbDownFilledIcon.mjs";
|
|
131
132
|
import { ThumbDownIcon } from "./components/Icons/ThumbDownIcon.mjs";
|
|
133
|
+
import { ThumbUpFilledIcon } from "./components/Icons/ThumbUpFilledIcon.mjs";
|
|
132
134
|
import { ThumbUpIcon } from "./components/Icons/ThumbUpIcon.mjs";
|
|
133
135
|
import { TickCircleIcon } from "./components/Icons/TickCircleIcon.mjs";
|
|
134
136
|
import { TickCircleOffIcon } from "./components/Icons/TickCircleOffIcon.mjs";
|
|
@@ -165,6 +167,8 @@ import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSepa
|
|
|
165
167
|
import { Skeleton } from "./components/Skeleton/Skeleton.mjs";
|
|
166
168
|
import { Slider } from "./components/Slider/Slider.mjs";
|
|
167
169
|
import { Snackbar } from "./components/Snackbar/Snackbar.mjs";
|
|
170
|
+
import { Stepper } from "./components/Stepper/Stepper.mjs";
|
|
171
|
+
import { StepperStep } from "./components/Stepper/StepperStep.mjs";
|
|
168
172
|
import { Switch } from "./components/Switch/Switch.mjs";
|
|
169
173
|
import { SwitchField } from "./components/SwitchField/SwitchField.mjs";
|
|
170
174
|
import { SwitchToggle } from "./components/SwitchToggle/SwitchToggle.mjs";
|
|
@@ -360,6 +364,8 @@ export {
|
|
|
360
364
|
Snackbar,
|
|
361
365
|
SpinnerIcon,
|
|
362
366
|
StarIcon,
|
|
367
|
+
Stepper,
|
|
368
|
+
StepperStep,
|
|
363
369
|
StopIcon,
|
|
364
370
|
SuccessIcon,
|
|
365
371
|
SunIcon,
|
|
@@ -396,7 +402,9 @@ export {
|
|
|
396
402
|
TaskIcon,
|
|
397
403
|
TextArea,
|
|
398
404
|
TextField,
|
|
405
|
+
ThumbDownFilledIcon,
|
|
399
406
|
ThumbDownIcon,
|
|
407
|
+
ThumbUpFilledIcon,
|
|
400
408
|
ThumbUpIcon,
|
|
401
409
|
TickCircleIcon,
|
|
402
410
|
TickCircleOffIcon,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/styles/theme.css
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/* Consumers must provide their own Tailwind import: @import "tailwindcss"; */
|
|
2
2
|
|
|
3
3
|
@variant dark (&:where(.dark, .dark *));
|
|
4
|
+
@custom-variant infloww (&:is([data-infloww] *));
|
|
5
|
+
|
|
6
|
+
@theme {
|
|
7
|
+
--breakpoint-*: initial;
|
|
8
|
+
--breakpoint-sm: 850px;
|
|
9
|
+
--breakpoint-md: 1024px;
|
|
10
|
+
--breakpoint-inflowwmd: 1223px;
|
|
11
|
+
--breakpoint-lg: 1280px;
|
|
12
|
+
}
|
|
4
13
|
|
|
5
14
|
@layer base {
|
|
6
15
|
html {
|
|
@@ -15,10 +24,19 @@
|
|
|
15
24
|
input:-webkit-autofill,
|
|
16
25
|
input:-webkit-autofill:hover,
|
|
17
26
|
input:-webkit-autofill:focus,
|
|
27
|
+
input:autofill,
|
|
28
|
+
input:autofill:hover,
|
|
29
|
+
input:autofill:focus,
|
|
18
30
|
textarea:-webkit-autofill,
|
|
19
31
|
textarea:-webkit-autofill:hover,
|
|
20
|
-
textarea:-webkit-autofill:focus
|
|
32
|
+
textarea:-webkit-autofill:focus,
|
|
33
|
+
textarea:autofill,
|
|
34
|
+
textarea:autofill:hover,
|
|
35
|
+
textarea:autofill:focus {
|
|
21
36
|
-webkit-text-fill-color: var(--color-content-primary);
|
|
37
|
+
-webkit-box-shadow: inset 0 0 0 1000px var(--color-neutral-alphas-50) !important;
|
|
38
|
+
box-shadow: inset 0 0 0 1000px var(--color-neutral-alphas-50) !important;
|
|
39
|
+
background-clip: padding-box !important;
|
|
22
40
|
transition: background-color 9999s ease-in-out 0s;
|
|
23
41
|
}
|
|
24
42
|
}
|
|
@@ -29,7 +47,8 @@
|
|
|
29
47
|
--shadow-lg: 0px 4px 8px -1px #00000014, 0px 8px 22px -1px #0000001a;
|
|
30
48
|
--shadow-blur-menu: 0px 6px 12px 0px #0000001a;
|
|
31
49
|
--shadow-blur-floating: 0px 12px 40px 2px #00000026;
|
|
32
|
-
--shadow-focus-ring:
|
|
50
|
+
--shadow-focus-ring:
|
|
51
|
+
0 0 0 2px var(--color-bg-primary), 0 0 0 4px var(--color-interaction-focus);
|
|
33
52
|
|
|
34
53
|
--radius-xs: 8px;
|
|
35
54
|
--radius-sm: 12px;
|
|
@@ -39,7 +58,6 @@
|
|
|
39
58
|
--radius-2xl: 40px;
|
|
40
59
|
--radius-full: 9999px;
|
|
41
60
|
|
|
42
|
-
|
|
43
61
|
--color-neutral-alphas-50: var(--primitives-color-blackalpha-50);
|
|
44
62
|
--color-neutral-alphas-100: var(--primitives-color-blackalpha-100);
|
|
45
63
|
--color-neutral-alphas-150: #15151526;
|
|
@@ -115,7 +133,6 @@
|
|
|
115
133
|
--color-icons-brand-green: var(--color-brand-primary-default);
|
|
116
134
|
--color-icons-brand-purple: var(--color-brand-secondary-default);
|
|
117
135
|
--color-icons-primary-inverted: var(--primitives-color-gray-white);
|
|
118
|
-
|
|
119
136
|
}
|
|
120
137
|
|
|
121
138
|
:root {
|
|
@@ -133,7 +150,6 @@
|
|
|
133
150
|
--spacing-sm: 12px;
|
|
134
151
|
--spacing-2xs: 4px;
|
|
135
152
|
|
|
136
|
-
|
|
137
153
|
--primitives-color-gray-50: #fafafaff;
|
|
138
154
|
--primitives-color-gray-75: #f7f7f7ff;
|
|
139
155
|
--primitives-color-gray-100: #f5f5f5ff;
|
|
@@ -269,7 +285,6 @@
|
|
|
269
285
|
--primitives-color-alpha-900: #ffffffe6;
|
|
270
286
|
--primitives-color-alpha-950: #fffffff2;
|
|
271
287
|
|
|
272
|
-
|
|
273
288
|
/* Light-mode semantic tokens must also live in :root because @theme
|
|
274
289
|
cannot resolve var() references to :root primitives at build time. */
|
|
275
290
|
--color-neutral-alphas-50: var(--primitives-color-blackalpha-50);
|
|
@@ -347,7 +362,6 @@
|
|
|
347
362
|
--color-icons-brand-green: var(--color-brand-primary-default);
|
|
348
363
|
--color-icons-brand-purple: var(--color-brand-secondary-default);
|
|
349
364
|
--color-icons-primary-inverted: var(--primitives-color-gray-white);
|
|
350
|
-
|
|
351
365
|
}
|
|
352
366
|
|
|
353
367
|
.dark {
|
|
@@ -426,7 +440,6 @@
|
|
|
426
440
|
--color-icons-brand-green: var(--color-brand-primary-default);
|
|
427
441
|
--color-icons-brand-purple: var(--color-brand-secondary-default);
|
|
428
442
|
--color-icons-primary-inverted: var(--primitives-color-gray-black);
|
|
429
|
-
|
|
430
443
|
}
|
|
431
444
|
|
|
432
445
|
@utility typography-regular-body-lg {
|
|
@@ -606,7 +619,6 @@
|
|
|
606
619
|
line-height: 64px;
|
|
607
620
|
}
|
|
608
621
|
|
|
609
|
-
|
|
610
622
|
@utility fv-skeleton-wave {
|
|
611
623
|
position: relative;
|
|
612
624
|
overflow: hidden;
|
|
@@ -658,4 +670,4 @@
|
|
|
658
670
|
|
|
659
671
|
@utility animate-accordion-collapse {
|
|
660
672
|
animation: accordion-collapse 200ms ease-out;
|
|
661
|
-
}
|
|
673
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanvue/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "React component library built with Tailwind CSS for Fanvue ecosystem",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"size-limit": [
|
|
167
167
|
{
|
|
168
168
|
"path": "dist/index.mjs",
|
|
169
|
-
"limit": "
|
|
169
|
+
"limit": "57 KB",
|
|
170
170
|
"ignore": [
|
|
171
171
|
"@radix-ui/*",
|
|
172
172
|
"clsx",
|