@beweco/aurora-ui 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +109 -49
- package/dist/index.esm.js +109 -49
- package/dist/types/components/row-steps/RowSteps.d.ts +0 -1
- package/dist/types/components/row-steps/RowSteps.d.ts.map +1 -1
- package/dist/types/components/vertical-steps/VerticalSteps.d.ts +0 -1
- package/dist/types/components/vertical-steps/VerticalSteps.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -5,8 +5,8 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var react$1 = require('@iconify/react');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var recharts = require('recharts');
|
|
8
|
-
var framerMotion = require('framer-motion');
|
|
9
8
|
var reactDom = require('react-dom');
|
|
9
|
+
var framerMotion = require('framer-motion');
|
|
10
10
|
var useTheme = require('@heroui/use-theme');
|
|
11
11
|
|
|
12
12
|
/******************************************************************************
|
|
@@ -2501,6 +2501,45 @@ var VALID_STEP_COLORS$1 = [
|
|
|
2501
2501
|
var defaultTranslations$7 = {
|
|
2502
2502
|
checkIconTitle: "Check",
|
|
2503
2503
|
};
|
|
2504
|
+
function getContainerCSSVars$1(color) {
|
|
2505
|
+
var baseColor = "hsl(var(--heroui-".concat(color, "))");
|
|
2506
|
+
var fgColor = "hsl(var(--heroui-".concat(color, "-foreground))");
|
|
2507
|
+
var inactiveColor = "hsl(var(--heroui-default-300))";
|
|
2508
|
+
return {
|
|
2509
|
+
"--step-color": baseColor,
|
|
2510
|
+
"--step-fg-color": fgColor,
|
|
2511
|
+
"--active-fg-color": fgColor,
|
|
2512
|
+
"--active-border-color": baseColor,
|
|
2513
|
+
"--active-color": baseColor,
|
|
2514
|
+
"--complete-background-color": baseColor,
|
|
2515
|
+
"--complete-border-color": baseColor,
|
|
2516
|
+
"--inactive-border-color": inactiveColor,
|
|
2517
|
+
"--inactive-color": inactiveColor,
|
|
2518
|
+
"--inactive-bar-color": inactiveColor,
|
|
2519
|
+
};
|
|
2520
|
+
}
|
|
2521
|
+
function getCircleStyle$1(status) {
|
|
2522
|
+
switch (status) {
|
|
2523
|
+
case "complete":
|
|
2524
|
+
return {
|
|
2525
|
+
backgroundColor: "var(--complete-background-color)",
|
|
2526
|
+
borderColor: "var(--complete-border-color)",
|
|
2527
|
+
color: "var(--active-fg-color)",
|
|
2528
|
+
};
|
|
2529
|
+
case "active":
|
|
2530
|
+
return {
|
|
2531
|
+
backgroundColor: "transparent",
|
|
2532
|
+
borderColor: "var(--active-border-color)",
|
|
2533
|
+
color: "var(--active-color)",
|
|
2534
|
+
};
|
|
2535
|
+
default:
|
|
2536
|
+
return {
|
|
2537
|
+
backgroundColor: "transparent",
|
|
2538
|
+
borderColor: "var(--inactive-border-color)",
|
|
2539
|
+
color: "var(--inactive-color)",
|
|
2540
|
+
};
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2504
2543
|
var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
2505
2544
|
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, _f = _a.hideInactiveDescriptions, hideInactiveDescriptions = _f === void 0 ? false : _f, stepClassName = _a.stepClassName, className = _a.className, translations = _a.translations, props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "hideInactiveDescriptions", "stepClassName", "className", "translations"]);
|
|
2506
2545
|
var _g = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _g[0], setCurrentStep = _g[1];
|
|
@@ -2514,10 +2553,11 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
2514
2553
|
var stepColor = VALID_STEP_COLORS$1.includes(color)
|
|
2515
2554
|
? color
|
|
2516
2555
|
: "primary";
|
|
2517
|
-
|
|
2556
|
+
var containerVars = React.useMemo(function () { return getContainerCSSVars$1(stepColor); }, [stepColor]);
|
|
2557
|
+
return (jsxRuntime.jsx("nav", { "aria-label": "Progress", className: "max-w-fit", children: jsxRuntime.jsx("ol", { "data-step-color": stepColor, className: react.cn("flex flex-col gap-y-3", className), style: containerVars, children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
|
|
2518
2558
|
var status = currentStep === stepIdx
|
|
2519
2559
|
? "active"
|
|
2520
|
-
: step.isCompleted
|
|
2560
|
+
: stepIdx < currentStep || step.isCompleted
|
|
2521
2561
|
? "complete"
|
|
2522
2562
|
: "inactive";
|
|
2523
2563
|
var isDisabled = status === "inactive";
|
|
@@ -2525,35 +2565,25 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
2525
2565
|
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
2526
2566
|
jsxRuntime.jsxs("li", { className: "relative", children: [jsxRuntime.jsx("div", { className: "flex w-full max-w-full items-center", children: jsxRuntime.jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: react.cn("group rounded-large flex w-full cursor-pointer items-center justify-center gap-4 px-3 py-2.5", stepClassName, {
|
|
2527
2567
|
"cursor-not-allowed": isDisabled,
|
|
2528
|
-
}), onClick: function () { return setCurrentStep(stepIdx); }, disabled: isDisabled }, props, { children: [jsxRuntime.jsx("div", { className: "flex h-full items-center", children: jsxRuntime.jsx(
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
},
|
|
2536
|
-
active: {
|
|
2537
|
-
backgroundColor: "transparent",
|
|
2538
|
-
borderColor: "var(--active-border-color)",
|
|
2539
|
-
color: "var(--active-color)",
|
|
2540
|
-
},
|
|
2541
|
-
complete: {
|
|
2542
|
-
backgroundColor: "var(--complete-background-color)",
|
|
2543
|
-
borderColor: "var(--complete-border-color)",
|
|
2544
|
-
},
|
|
2545
|
-
}, children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), jsxRuntime.jsx("div", { className: "flex-1 text-left", children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { className: react.cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2546
|
-
"text-default-300": status === "inactive",
|
|
2568
|
+
}), onClick: function () { return setCurrentStep(stepIdx); }, disabled: isDisabled }, props, { children: [jsxRuntime.jsx("div", { className: "flex h-full items-center", children: jsxRuntime.jsx("div", { className: "relative", children: jsxRuntime.jsx("div", { className: react.cn("border-medium text-large relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", "transition-[background-color,border-color,color,box-shadow] duration-300", {
|
|
2569
|
+
"shadow-lg": status === "complete",
|
|
2570
|
+
}), "data-status": status, style: getCircleStyle$1(status), children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: "font-bold", style: {
|
|
2571
|
+
color: "var(--active-fg-color)",
|
|
2572
|
+
}, icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }), jsxRuntime.jsx("div", { className: "flex-1 text-left", children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { className: react.cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2573
|
+
"text-default-300": status ===
|
|
2574
|
+
"inactive",
|
|
2547
2575
|
}), children: step.title }), (!hideInactiveDescriptions ||
|
|
2548
2576
|
status === "active") && (jsxRuntime.jsx("div", { className: react.cn("text-tiny text-default-600 lg:text-small transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2549
|
-
"text-default-300": status ===
|
|
2550
|
-
|
|
2577
|
+
"text-default-300": status ===
|
|
2578
|
+
"inactive",
|
|
2579
|
+
}), children: step.description }))] }) })] }), stepIdx) }), stepIdx < steps.length - 1 &&
|
|
2580
|
+
!hideProgressBars && (jsxRuntime.jsx("div", { "aria-hidden": "true", className: react.cn("pointer-events-none absolute top-[calc(64px*var(--idx)+1)] left-3 flex h-1/2 -translate-y-1/3 items-center px-4", {
|
|
2551
2581
|
"h-1/4": stepIdx === currentStep,
|
|
2552
2582
|
}), style: {
|
|
2553
|
-
// @ts-ignore
|
|
2554
2583
|
"--idx": stepIdx,
|
|
2555
2584
|
}, children: jsxRuntime.jsx("div", { className: react.cn("relative h-full w-0.5 bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-0 after:w-full after:bg-[var(--active-border-color)] after:transition-[height] after:duration-300 after:content-['']", {
|
|
2556
|
-
"after:h-full": stepIdx <
|
|
2585
|
+
"after:h-full": stepIdx <
|
|
2586
|
+
currentStep,
|
|
2557
2587
|
}) }) }))] }, stepIdx));
|
|
2558
2588
|
}) }) }));
|
|
2559
2589
|
});
|
|
@@ -3237,6 +3267,45 @@ var VALID_STEP_COLORS = [
|
|
|
3237
3267
|
"danger",
|
|
3238
3268
|
"default",
|
|
3239
3269
|
];
|
|
3270
|
+
function getContainerCSSVars(color) {
|
|
3271
|
+
var baseColor = "hsl(var(--heroui-".concat(color, "))");
|
|
3272
|
+
var fgColor = "hsl(var(--heroui-".concat(color, "-foreground))");
|
|
3273
|
+
var inactiveColor = "hsl(var(--heroui-default-300))";
|
|
3274
|
+
return {
|
|
3275
|
+
"--step-color": baseColor,
|
|
3276
|
+
"--step-fg-color": fgColor,
|
|
3277
|
+
"--active-fg-color": fgColor,
|
|
3278
|
+
"--active-border-color": baseColor,
|
|
3279
|
+
"--active-color": baseColor,
|
|
3280
|
+
"--complete-background-color": baseColor,
|
|
3281
|
+
"--complete-border-color": baseColor,
|
|
3282
|
+
"--inactive-border-color": inactiveColor,
|
|
3283
|
+
"--inactive-color": inactiveColor,
|
|
3284
|
+
"--inactive-bar-color": inactiveColor,
|
|
3285
|
+
};
|
|
3286
|
+
}
|
|
3287
|
+
function getCircleStyle(status) {
|
|
3288
|
+
switch (status) {
|
|
3289
|
+
case "complete":
|
|
3290
|
+
return {
|
|
3291
|
+
backgroundColor: "var(--complete-background-color)",
|
|
3292
|
+
borderColor: "var(--complete-border-color)",
|
|
3293
|
+
color: "var(--active-fg-color)",
|
|
3294
|
+
};
|
|
3295
|
+
case "active":
|
|
3296
|
+
return {
|
|
3297
|
+
backgroundColor: "transparent",
|
|
3298
|
+
borderColor: "var(--active-border-color)",
|
|
3299
|
+
color: "var(--active-color)",
|
|
3300
|
+
};
|
|
3301
|
+
default:
|
|
3302
|
+
return {
|
|
3303
|
+
backgroundColor: "transparent",
|
|
3304
|
+
borderColor: "var(--inactive-border-color)",
|
|
3305
|
+
color: "var(--inactive-color)",
|
|
3306
|
+
};
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3240
3309
|
var RowSteps = React.forwardRef(function (_a, ref) {
|
|
3241
3310
|
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className; _a.translations; var props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
3242
3311
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
@@ -3249,36 +3318,27 @@ var RowSteps = React.forwardRef(function (_a, ref) {
|
|
|
3249
3318
|
var stepColor = VALID_STEP_COLORS.includes(color)
|
|
3250
3319
|
? color
|
|
3251
3320
|
: "primary";
|
|
3252
|
-
|
|
3321
|
+
var containerVars = React.useMemo(function () { return getContainerCSSVars(stepColor); }, [stepColor]);
|
|
3322
|
+
return (jsxRuntime.jsx("nav", { "aria-label": "Progress", className: "-my-4 max-w-fit overflow-x-auto py-4", children: jsxRuntime.jsx("ol", { "data-step-color": stepColor, className: react.cn("flex flex-row flex-nowrap gap-x-3", className), style: containerVars, children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
|
|
3253
3323
|
var status = currentStep === stepIdx
|
|
3254
3324
|
? "active"
|
|
3255
3325
|
: currentStep < stepIdx
|
|
3256
3326
|
? "inactive"
|
|
3257
3327
|
: "complete";
|
|
3258
|
-
return (jsxRuntime.jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxRuntime.jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: react.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsxRuntime.jsx("div", { className: "h-ful relative flex items-center", children: jsxRuntime.jsx(
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
borderColor: "var(--active-border-color)",
|
|
3269
|
-
color: "var(--active-color)",
|
|
3270
|
-
},
|
|
3271
|
-
complete: {
|
|
3272
|
-
backgroundColor: "var(--complete-background-color)",
|
|
3273
|
-
borderColor: "var(--complete-border-color)",
|
|
3274
|
-
},
|
|
3275
|
-
}, children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded" })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), step.title && (jsxRuntime.jsx("div", { className: "max-w-full flex-1 text-start", children: jsxRuntime.jsx("div", { className: react.cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
|
|
3276
|
-
"text-default-300": status === "inactive",
|
|
3277
|
-
}), children: step.title }) })), stepIdx < steps.length - 1 && !hideProgressBars && (jsxRuntime.jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
|
|
3278
|
-
// @ts-ignore
|
|
3328
|
+
return (jsxRuntime.jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxRuntime.jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: react.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsxRuntime.jsx("div", { className: "h-ful relative flex items-center", children: jsxRuntime.jsx("div", { className: "relative", children: jsxRuntime.jsx("div", { className: react.cn("border-medium text-large relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", "transition-[background-color,border-color,color,box-shadow] duration-300", {
|
|
3329
|
+
"shadow-lg": status ===
|
|
3330
|
+
"complete",
|
|
3331
|
+
}), "data-status": status, style: getCircleStyle(status), children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: "font-bold", style: {
|
|
3332
|
+
color: "var(--active-fg-color)",
|
|
3333
|
+
}, icon: "material-symbols:check-rounded" })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }), step.title && (jsxRuntime.jsx("div", { className: "max-w-full flex-1 text-start", children: jsxRuntime.jsx("div", { className: react.cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
|
|
3334
|
+
"text-default-300": status ===
|
|
3335
|
+
"inactive",
|
|
3336
|
+
}), children: step.title }) })), stepIdx < steps.length - 1 &&
|
|
3337
|
+
!hideProgressBars && (jsxRuntime.jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
|
|
3279
3338
|
"--idx": stepIdx,
|
|
3280
3339
|
}, children: jsxRuntime.jsx("div", { className: react.cn("relative h-0.5 w-full bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-full after:w-0 after:bg-[var(--active-border-color)] after:transition-[width] after:duration-300 after:content-['']", {
|
|
3281
|
-
"after:w-full": stepIdx <
|
|
3340
|
+
"after:w-full": stepIdx <
|
|
3341
|
+
currentStep,
|
|
3282
3342
|
}) }) }))] }), stepIdx) }, stepIdx));
|
|
3283
3343
|
}) }) }));
|
|
3284
3344
|
});
|
package/dist/index.esm.js
CHANGED
|
@@ -6,8 +6,8 @@ import { Icon } from '@iconify/react';
|
|
|
6
6
|
export { loadIcons } from '@iconify/react';
|
|
7
7
|
import React, { useId, useState, useCallback, useMemo, useEffect, createContext, useContext, memo, useRef, createElement, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
|
|
8
8
|
import { ResponsiveContainer, AreaChart, CartesianGrid, XAxis, Tooltip, Area, LineChart, YAxis, Line } from 'recharts';
|
|
9
|
-
import { LazyMotion, domAnimation, m, motion, AnimatePresence } from 'framer-motion';
|
|
10
9
|
import { createPortal } from 'react-dom';
|
|
10
|
+
import { motion, AnimatePresence } from 'framer-motion';
|
|
11
11
|
import { useTheme } from '@heroui/use-theme';
|
|
12
12
|
|
|
13
13
|
/******************************************************************************
|
|
@@ -2502,6 +2502,45 @@ var VALID_STEP_COLORS$1 = [
|
|
|
2502
2502
|
var defaultTranslations$7 = {
|
|
2503
2503
|
checkIconTitle: "Check",
|
|
2504
2504
|
};
|
|
2505
|
+
function getContainerCSSVars$1(color) {
|
|
2506
|
+
var baseColor = "hsl(var(--heroui-".concat(color, "))");
|
|
2507
|
+
var fgColor = "hsl(var(--heroui-".concat(color, "-foreground))");
|
|
2508
|
+
var inactiveColor = "hsl(var(--heroui-default-300))";
|
|
2509
|
+
return {
|
|
2510
|
+
"--step-color": baseColor,
|
|
2511
|
+
"--step-fg-color": fgColor,
|
|
2512
|
+
"--active-fg-color": fgColor,
|
|
2513
|
+
"--active-border-color": baseColor,
|
|
2514
|
+
"--active-color": baseColor,
|
|
2515
|
+
"--complete-background-color": baseColor,
|
|
2516
|
+
"--complete-border-color": baseColor,
|
|
2517
|
+
"--inactive-border-color": inactiveColor,
|
|
2518
|
+
"--inactive-color": inactiveColor,
|
|
2519
|
+
"--inactive-bar-color": inactiveColor,
|
|
2520
|
+
};
|
|
2521
|
+
}
|
|
2522
|
+
function getCircleStyle$1(status) {
|
|
2523
|
+
switch (status) {
|
|
2524
|
+
case "complete":
|
|
2525
|
+
return {
|
|
2526
|
+
backgroundColor: "var(--complete-background-color)",
|
|
2527
|
+
borderColor: "var(--complete-border-color)",
|
|
2528
|
+
color: "var(--active-fg-color)",
|
|
2529
|
+
};
|
|
2530
|
+
case "active":
|
|
2531
|
+
return {
|
|
2532
|
+
backgroundColor: "transparent",
|
|
2533
|
+
borderColor: "var(--active-border-color)",
|
|
2534
|
+
color: "var(--active-color)",
|
|
2535
|
+
};
|
|
2536
|
+
default:
|
|
2537
|
+
return {
|
|
2538
|
+
backgroundColor: "transparent",
|
|
2539
|
+
borderColor: "var(--inactive-border-color)",
|
|
2540
|
+
color: "var(--inactive-color)",
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2505
2544
|
var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
2506
2545
|
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, _f = _a.hideInactiveDescriptions, hideInactiveDescriptions = _f === void 0 ? false : _f, stepClassName = _a.stepClassName, className = _a.className, translations = _a.translations, props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "hideInactiveDescriptions", "stepClassName", "className", "translations"]);
|
|
2507
2546
|
var _g = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _g[0], setCurrentStep = _g[1];
|
|
@@ -2515,10 +2554,11 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
2515
2554
|
var stepColor = VALID_STEP_COLORS$1.includes(color)
|
|
2516
2555
|
? color
|
|
2517
2556
|
: "primary";
|
|
2518
|
-
|
|
2557
|
+
var containerVars = React.useMemo(function () { return getContainerCSSVars$1(stepColor); }, [stepColor]);
|
|
2558
|
+
return (jsx("nav", { "aria-label": "Progress", className: "max-w-fit", children: jsx("ol", { "data-step-color": stepColor, className: cn("flex flex-col gap-y-3", className), style: containerVars, children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
|
|
2519
2559
|
var status = currentStep === stepIdx
|
|
2520
2560
|
? "active"
|
|
2521
|
-
: step.isCompleted
|
|
2561
|
+
: stepIdx < currentStep || step.isCompleted
|
|
2522
2562
|
? "complete"
|
|
2523
2563
|
: "inactive";
|
|
2524
2564
|
var isDisabled = status === "inactive";
|
|
@@ -2526,35 +2566,25 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
2526
2566
|
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
2527
2567
|
jsxs("li", { className: "relative", children: [jsx("div", { className: "flex w-full max-w-full items-center", children: jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: cn("group rounded-large flex w-full cursor-pointer items-center justify-center gap-4 px-3 py-2.5", stepClassName, {
|
|
2528
2568
|
"cursor-not-allowed": isDisabled,
|
|
2529
|
-
}), onClick: function () { return setCurrentStep(stepIdx); }, disabled: isDisabled }, props, { children: [jsx("div", { className: "flex h-full items-center", children: jsx(
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
},
|
|
2537
|
-
active: {
|
|
2538
|
-
backgroundColor: "transparent",
|
|
2539
|
-
borderColor: "var(--active-border-color)",
|
|
2540
|
-
color: "var(--active-color)",
|
|
2541
|
-
},
|
|
2542
|
-
complete: {
|
|
2543
|
-
backgroundColor: "var(--complete-background-color)",
|
|
2544
|
-
borderColor: "var(--complete-border-color)",
|
|
2545
|
-
},
|
|
2546
|
-
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), jsx("div", { className: "flex-1 text-left", children: jsxs("div", { children: [jsx("div", { className: cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2547
|
-
"text-default-300": status === "inactive",
|
|
2569
|
+
}), onClick: function () { return setCurrentStep(stepIdx); }, disabled: isDisabled }, props, { children: [jsx("div", { className: "flex h-full items-center", children: jsx("div", { className: "relative", children: jsx("div", { className: cn("border-medium text-large relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", "transition-[background-color,border-color,color,box-shadow] duration-300", {
|
|
2570
|
+
"shadow-lg": status === "complete",
|
|
2571
|
+
}), "data-status": status, style: getCircleStyle$1(status), children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: "font-bold", style: {
|
|
2572
|
+
color: "var(--active-fg-color)",
|
|
2573
|
+
}, icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }), jsx("div", { className: "flex-1 text-left", children: jsxs("div", { children: [jsx("div", { className: cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2574
|
+
"text-default-300": status ===
|
|
2575
|
+
"inactive",
|
|
2548
2576
|
}), children: step.title }), (!hideInactiveDescriptions ||
|
|
2549
2577
|
status === "active") && (jsx("div", { className: cn("text-tiny text-default-600 lg:text-small transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2550
|
-
"text-default-300": status ===
|
|
2551
|
-
|
|
2578
|
+
"text-default-300": status ===
|
|
2579
|
+
"inactive",
|
|
2580
|
+
}), children: step.description }))] }) })] }), stepIdx) }), stepIdx < steps.length - 1 &&
|
|
2581
|
+
!hideProgressBars && (jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none absolute top-[calc(64px*var(--idx)+1)] left-3 flex h-1/2 -translate-y-1/3 items-center px-4", {
|
|
2552
2582
|
"h-1/4": stepIdx === currentStep,
|
|
2553
2583
|
}), style: {
|
|
2554
|
-
// @ts-ignore
|
|
2555
2584
|
"--idx": stepIdx,
|
|
2556
2585
|
}, children: jsx("div", { className: cn("relative h-full w-0.5 bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-0 after:w-full after:bg-[var(--active-border-color)] after:transition-[height] after:duration-300 after:content-['']", {
|
|
2557
|
-
"after:h-full": stepIdx <
|
|
2586
|
+
"after:h-full": stepIdx <
|
|
2587
|
+
currentStep,
|
|
2558
2588
|
}) }) }))] }, stepIdx));
|
|
2559
2589
|
}) }) }));
|
|
2560
2590
|
});
|
|
@@ -3238,6 +3268,45 @@ var VALID_STEP_COLORS = [
|
|
|
3238
3268
|
"danger",
|
|
3239
3269
|
"default",
|
|
3240
3270
|
];
|
|
3271
|
+
function getContainerCSSVars(color) {
|
|
3272
|
+
var baseColor = "hsl(var(--heroui-".concat(color, "))");
|
|
3273
|
+
var fgColor = "hsl(var(--heroui-".concat(color, "-foreground))");
|
|
3274
|
+
var inactiveColor = "hsl(var(--heroui-default-300))";
|
|
3275
|
+
return {
|
|
3276
|
+
"--step-color": baseColor,
|
|
3277
|
+
"--step-fg-color": fgColor,
|
|
3278
|
+
"--active-fg-color": fgColor,
|
|
3279
|
+
"--active-border-color": baseColor,
|
|
3280
|
+
"--active-color": baseColor,
|
|
3281
|
+
"--complete-background-color": baseColor,
|
|
3282
|
+
"--complete-border-color": baseColor,
|
|
3283
|
+
"--inactive-border-color": inactiveColor,
|
|
3284
|
+
"--inactive-color": inactiveColor,
|
|
3285
|
+
"--inactive-bar-color": inactiveColor,
|
|
3286
|
+
};
|
|
3287
|
+
}
|
|
3288
|
+
function getCircleStyle(status) {
|
|
3289
|
+
switch (status) {
|
|
3290
|
+
case "complete":
|
|
3291
|
+
return {
|
|
3292
|
+
backgroundColor: "var(--complete-background-color)",
|
|
3293
|
+
borderColor: "var(--complete-border-color)",
|
|
3294
|
+
color: "var(--active-fg-color)",
|
|
3295
|
+
};
|
|
3296
|
+
case "active":
|
|
3297
|
+
return {
|
|
3298
|
+
backgroundColor: "transparent",
|
|
3299
|
+
borderColor: "var(--active-border-color)",
|
|
3300
|
+
color: "var(--active-color)",
|
|
3301
|
+
};
|
|
3302
|
+
default:
|
|
3303
|
+
return {
|
|
3304
|
+
backgroundColor: "transparent",
|
|
3305
|
+
borderColor: "var(--inactive-border-color)",
|
|
3306
|
+
color: "var(--inactive-color)",
|
|
3307
|
+
};
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3241
3310
|
var RowSteps = React.forwardRef(function (_a, ref) {
|
|
3242
3311
|
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className; _a.translations; var props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
3243
3312
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
@@ -3250,36 +3319,27 @@ var RowSteps = React.forwardRef(function (_a, ref) {
|
|
|
3250
3319
|
var stepColor = VALID_STEP_COLORS.includes(color)
|
|
3251
3320
|
? color
|
|
3252
3321
|
: "primary";
|
|
3253
|
-
|
|
3322
|
+
var containerVars = React.useMemo(function () { return getContainerCSSVars(stepColor); }, [stepColor]);
|
|
3323
|
+
return (jsx("nav", { "aria-label": "Progress", className: "-my-4 max-w-fit overflow-x-auto py-4", children: jsx("ol", { "data-step-color": stepColor, className: cn("flex flex-row flex-nowrap gap-x-3", className), style: containerVars, children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
|
|
3254
3324
|
var status = currentStep === stepIdx
|
|
3255
3325
|
? "active"
|
|
3256
3326
|
: currentStep < stepIdx
|
|
3257
3327
|
? "inactive"
|
|
3258
3328
|
: "complete";
|
|
3259
|
-
return (jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsx("div", { className: "h-ful relative flex items-center", children: jsx(
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
borderColor: "var(--active-border-color)",
|
|
3270
|
-
color: "var(--active-color)",
|
|
3271
|
-
},
|
|
3272
|
-
complete: {
|
|
3273
|
-
backgroundColor: "var(--complete-background-color)",
|
|
3274
|
-
borderColor: "var(--complete-border-color)",
|
|
3275
|
-
},
|
|
3276
|
-
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded" })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), step.title && (jsx("div", { className: "max-w-full flex-1 text-start", children: jsx("div", { className: cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
|
|
3277
|
-
"text-default-300": status === "inactive",
|
|
3278
|
-
}), children: step.title }) })), stepIdx < steps.length - 1 && !hideProgressBars && (jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
|
|
3279
|
-
// @ts-ignore
|
|
3329
|
+
return (jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsx("div", { className: "h-ful relative flex items-center", children: jsx("div", { className: "relative", children: jsx("div", { className: cn("border-medium text-large relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", "transition-[background-color,border-color,color,box-shadow] duration-300", {
|
|
3330
|
+
"shadow-lg": status ===
|
|
3331
|
+
"complete",
|
|
3332
|
+
}), "data-status": status, style: getCircleStyle(status), children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: "font-bold", style: {
|
|
3333
|
+
color: "var(--active-fg-color)",
|
|
3334
|
+
}, icon: "material-symbols:check-rounded" })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }), step.title && (jsx("div", { className: "max-w-full flex-1 text-start", children: jsx("div", { className: cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
|
|
3335
|
+
"text-default-300": status ===
|
|
3336
|
+
"inactive",
|
|
3337
|
+
}), children: step.title }) })), stepIdx < steps.length - 1 &&
|
|
3338
|
+
!hideProgressBars && (jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
|
|
3280
3339
|
"--idx": stepIdx,
|
|
3281
3340
|
}, children: jsx("div", { className: cn("relative h-0.5 w-full bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-full after:w-0 after:bg-[var(--active-border-color)] after:transition-[width] after:duration-300 after:content-['']", {
|
|
3282
|
-
"after:w-full": stepIdx <
|
|
3341
|
+
"after:w-full": stepIdx <
|
|
3342
|
+
currentStep,
|
|
3283
3343
|
}) }) }))] }), stepIdx) }, stepIdx));
|
|
3284
3344
|
}) }) }));
|
|
3285
3345
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowSteps.d.ts","sourceRoot":"","sources":["../../../../src/components/row-steps/RowSteps.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RowSteps.d.ts","sourceRoot":"","sources":["../../../../src/components/row-steps/RowSteps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAwDpE,eAAO,MAAM,QAAQ,yFAkKpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalSteps.d.ts","sourceRoot":"","sources":["../../../../src/components/vertical-steps/VerticalSteps.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerticalSteps.d.ts","sourceRoot":"","sources":["../../../../src/components/vertical-steps/VerticalSteps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAEX,kBAAkB,EAElB,MAAM,uBAAuB,CAAC;AA4D/B,eAAO,MAAM,aAAa,8FA8LzB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":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