@axzydev/axzy_ui_system 1.7.4 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +204 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +200 -104
- package/dist/index.js.map +1 -1
- package/dist/layered.css +1 -1
- package/package.json +1 -1
- package/src/components/atoms/button/button.tsx +7 -0
- package/src/components/atoms/input/input.tsx +5 -0
- package/src/components/atoms/segmented-control/segmented-control.tsx +22 -5
- package/src/components/molecules/card/card.props.ts +12 -0
- package/src/components/molecules/card/card.tsx +52 -22
- package/src/components/molecules/chip-input/chip-input.tsx +2 -0
- package/src/components/molecules/multi-select/multi-select.tsx +2 -0
- package/src/components/molecules/tabs/tabs.tsx +22 -8
- package/src/components/organisms/page-header/page-header.tsx +22 -6
- package/src/components/organisms/sidebar/sidebar.tsx +8 -5
- package/src/components/organisms/topbar/topbar.props.ts +2 -0
- package/src/components/organisms/topbar/topbar.tsx +56 -34
- package/src/components/templates/layout/layout.tsx +3 -2
- package/src/components/theme-provider/themeProvider.props.ts +1 -1
- package/src/components/theme-provider/themeProvider.tsx +54 -1
- package/src/index.ts +4 -4
- package/src/json-renderer/catalog/axzyCatalog.ts +5 -0
- package/src/sandbox/axzyConfig.test.ts +4 -0
- package/src/sandbox/axzyConfig.ts +1 -1
- package/src/sandbox/i18n.ts +6 -0
- package/src/showcases/FeedbackShowcases.tsx +2 -1
- package/src/showcases/StructureShowcases.tsx +17 -2
- package/src/theme/theme-context.ts +10 -2
- package/src/theme/theme.ts +1 -1
- package/src/theme/theme.types.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -703,7 +703,7 @@ var components = {
|
|
|
703
703
|
input: {
|
|
704
704
|
backgroundColor: "var(--it-input-bg, #ffffff)",
|
|
705
705
|
borderColor: `var(--it-input-border, ${semanticColors.gray[300]})`,
|
|
706
|
-
borderRadius: "var(--radius-md)",
|
|
706
|
+
borderRadius: "var(--it-input-radius, var(--radius-md))",
|
|
707
707
|
focus: {
|
|
708
708
|
borderColor: `var(--it-input-focus-border, ${semanticColors.primary[500]})`,
|
|
709
709
|
ring: `var(--it-input-focus-ring, 0 0 0 3px ${semanticColors.primary[100]})`
|
|
@@ -872,6 +872,26 @@ function ITText({
|
|
|
872
872
|
);
|
|
873
873
|
}
|
|
874
874
|
|
|
875
|
+
// src/theme/theme-context.ts
|
|
876
|
+
import { createContext, useContext } from "react";
|
|
877
|
+
var ITThemeContext = createContext(void 0);
|
|
878
|
+
var useITTheme = () => {
|
|
879
|
+
const context = useContext(ITThemeContext);
|
|
880
|
+
if (!context) {
|
|
881
|
+
throw new Error("useITTheme must be used within an ITThemeProvider");
|
|
882
|
+
}
|
|
883
|
+
return context;
|
|
884
|
+
};
|
|
885
|
+
var useITThemeSafe = () => {
|
|
886
|
+
return useContext(ITThemeContext);
|
|
887
|
+
};
|
|
888
|
+
var useITAppearance = () => {
|
|
889
|
+
return useContext(ITThemeContext)?.appearance ?? "soft";
|
|
890
|
+
};
|
|
891
|
+
var useITFlatAppearance = () => {
|
|
892
|
+
return useITAppearance() === "flat";
|
|
893
|
+
};
|
|
894
|
+
|
|
875
895
|
// src/components/atoms/button/button.tsx
|
|
876
896
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
877
897
|
function ITButton({
|
|
@@ -890,6 +910,7 @@ function ITButton({
|
|
|
890
910
|
}) {
|
|
891
911
|
const [isHovered, setIsHovered] = useState5(false);
|
|
892
912
|
const [isFocused, setIsFocused] = useState5(false);
|
|
913
|
+
const bento = useITAppearance() === "bento";
|
|
893
914
|
const isIconOnly = variant === "icon-only";
|
|
894
915
|
const isIconOnlyContent = isIconOnly && Boolean(icon) && !children;
|
|
895
916
|
const themeBtn = theme.button;
|
|
@@ -909,6 +930,9 @@ function ITButton({
|
|
|
909
930
|
// Default from theme
|
|
910
931
|
transition: themeConfig.transition || "all 0.2s"
|
|
911
932
|
};
|
|
933
|
+
if (bento) {
|
|
934
|
+
style.borderRadius = `var(--it-bento-pill-radius, ${themeConfig.borderRadius})`;
|
|
935
|
+
}
|
|
912
936
|
if (variant === "rounded") {
|
|
913
937
|
style.borderRadius = "9999px";
|
|
914
938
|
}
|
|
@@ -977,23 +1001,6 @@ function ITButton({
|
|
|
977
1001
|
import clsx2 from "clsx";
|
|
978
1002
|
import { useState as useState6 } from "react";
|
|
979
1003
|
|
|
980
|
-
// src/theme/theme-context.ts
|
|
981
|
-
import { createContext, useContext } from "react";
|
|
982
|
-
var ITThemeContext = createContext(void 0);
|
|
983
|
-
var useITTheme = () => {
|
|
984
|
-
const context = useContext(ITThemeContext);
|
|
985
|
-
if (!context) {
|
|
986
|
-
throw new Error("useITTheme must be used within an ITThemeProvider");
|
|
987
|
-
}
|
|
988
|
-
return context;
|
|
989
|
-
};
|
|
990
|
-
var useITThemeSafe = () => {
|
|
991
|
-
return useContext(ITThemeContext);
|
|
992
|
-
};
|
|
993
|
-
var useITFlatAppearance = () => {
|
|
994
|
-
return useContext(ITThemeContext)?.appearance === "flat";
|
|
995
|
-
};
|
|
996
|
-
|
|
997
1004
|
// src/i18n/provider.tsx
|
|
998
1005
|
import { useMemo as useMemo3 } from "react";
|
|
999
1006
|
|
|
@@ -1500,6 +1507,7 @@ function useITTranslation() {
|
|
|
1500
1507
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1501
1508
|
function ITCard({
|
|
1502
1509
|
title,
|
|
1510
|
+
tone,
|
|
1503
1511
|
headerActions,
|
|
1504
1512
|
image,
|
|
1505
1513
|
alt,
|
|
@@ -1514,26 +1522,35 @@ function ITCard({
|
|
|
1514
1522
|
}) {
|
|
1515
1523
|
const { t } = useITTranslation();
|
|
1516
1524
|
const [isHovered, setIsHovered] = useState6(false);
|
|
1517
|
-
const
|
|
1525
|
+
const appearance = useITAppearance();
|
|
1526
|
+
const bento = appearance === "bento";
|
|
1527
|
+
const flat = appearance === "flat";
|
|
1518
1528
|
const resolvedAlt = alt ?? t("card.imageAlt");
|
|
1519
1529
|
const containerStyle = {
|
|
1520
1530
|
backgroundColor: "var(--it-card-bg, #ffffff)",
|
|
1521
|
-
borderColor: flat ? "var(--it-card-flat-border, var(--color-secondary-200))" : "var(--it-card-border, rgba(15, 23, 42, 0.06))",
|
|
1522
|
-
borderWidth: "1px",
|
|
1531
|
+
borderColor: bento ? "transparent" : flat ? "var(--it-card-flat-border, var(--color-secondary-200))" : "var(--it-card-border, rgba(15, 23, 42, 0.06))",
|
|
1532
|
+
borderWidth: bento ? "0px" : "1px",
|
|
1523
1533
|
borderStyle: "solid",
|
|
1524
|
-
borderRadius: flat ? "var(--it-card-radius, var(--radius-lg))" : "var(--it-card-radius, var(--radius-2xl))",
|
|
1534
|
+
borderRadius: bento ? "var(--it-card-radius, var(--it-bento-card-radius, var(--radius-2xl)))" : flat ? "var(--it-card-radius, var(--radius-lg))" : "var(--it-card-radius, var(--radius-2xl))",
|
|
1525
1535
|
// Soft depth: every card floats a little at rest; interactive cards
|
|
1526
1536
|
// gain visual weight on hover instead of appearing flat until clicked.
|
|
1527
1537
|
// Flat appearance: the hairline border carries the surface, so a card
|
|
1528
1538
|
// only gets a shadow as hover feedback when it is clickable.
|
|
1529
|
-
|
|
1539
|
+
// Bento: borderless, a diffuse shadow at rest and a stronger one on hover.
|
|
1540
|
+
boxShadow: bento ? onClick && isHovered ? "var(--it-bento-card-shadow-hover, var(--shadow-lg))" : "var(--it-bento-card-shadow, var(--shadow-sm))" : flat ? onClick && isHovered ? "var(--shadow-sm)" : "none" : onClick ? isHovered ? "var(--shadow-lg)" : "var(--shadow-sm)" : "var(--shadow-sm)",
|
|
1530
1541
|
transition: onClick ? "box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out" : "none",
|
|
1531
|
-
transform: onClick && isHovered && !flat ? "translateY(-2px)" : "translateY(0)",
|
|
1542
|
+
transform: onClick && isHovered && !flat && !bento ? "translateY(-2px)" : "translateY(0)",
|
|
1532
1543
|
cursor: onClick ? "pointer" : "default"
|
|
1533
1544
|
};
|
|
1545
|
+
if (tone) {
|
|
1546
|
+
const soft = `var(--color-${tone}-soft)`;
|
|
1547
|
+
containerStyle.backgroundImage = `linear-gradient(${soft}, ${soft})`;
|
|
1548
|
+
if (!bento) containerStyle.borderColor = `var(--color-${tone}-soft-border)`;
|
|
1549
|
+
}
|
|
1534
1550
|
const bodyStyle = {
|
|
1535
|
-
padding: "1.25rem"
|
|
1551
|
+
padding: bento ? "var(--it-bento-card-padding, 1.5rem)" : "1.25rem"
|
|
1536
1552
|
};
|
|
1553
|
+
const titleTypography = bento ? "text-lg font-bold" : flat ? "text-base font-semibold" : "text-xl font-semibold";
|
|
1537
1554
|
return /* @__PURE__ */ jsxs2(
|
|
1538
1555
|
"div",
|
|
1539
1556
|
{
|
|
@@ -1565,7 +1582,7 @@ function ITCard({
|
|
|
1565
1582
|
ITText,
|
|
1566
1583
|
{
|
|
1567
1584
|
as: "h3",
|
|
1568
|
-
className: clsx2(
|
|
1585
|
+
className: clsx2(titleTypography, titleClassName),
|
|
1569
1586
|
children: title
|
|
1570
1587
|
}
|
|
1571
1588
|
),
|
|
@@ -1574,7 +1591,7 @@ function ITCard({
|
|
|
1574
1591
|
ITText,
|
|
1575
1592
|
{
|
|
1576
1593
|
as: "h3",
|
|
1577
|
-
className: clsx2(flat ? "
|
|
1594
|
+
className: clsx2(titleTypography, flat ? "mb-3" : bento ? "mb-4" : "mb-2", titleClassName),
|
|
1578
1595
|
children: title
|
|
1579
1596
|
}
|
|
1580
1597
|
) : null,
|
|
@@ -3034,6 +3051,7 @@ function ITChipInput({
|
|
|
3034
3051
|
style.alignItems = "center";
|
|
3035
3052
|
style.gap = "0.375rem";
|
|
3036
3053
|
style.minHeight = "2.5rem";
|
|
3054
|
+
style.borderRadius = "var(--it-bento-field-radius, var(--radius-md))";
|
|
3037
3055
|
if (disabled) {
|
|
3038
3056
|
style.backgroundColor = inputTheme.disabled?.backgroundColor || style.backgroundColor;
|
|
3039
3057
|
style.borderColor = inputTheme.disabled?.borderColor || style.borderColor;
|
|
@@ -3430,6 +3448,9 @@ function ITInput({
|
|
|
3430
3448
|
const inputTheme = theme.input || {};
|
|
3431
3449
|
const getStyle = () => {
|
|
3432
3450
|
const style = inputFieldStyle(inputTheme, size);
|
|
3451
|
+
if (isTextArea) {
|
|
3452
|
+
style.borderRadius = "var(--it-bento-field-radius, var(--radius-md))";
|
|
3453
|
+
}
|
|
3433
3454
|
if (disabled) {
|
|
3434
3455
|
style.backgroundColor = inputTheme.disabled?.backgroundColor || style.backgroundColor;
|
|
3435
3456
|
style.borderColor = inputTheme.disabled?.borderColor || style.borderColor;
|
|
@@ -4112,6 +4133,7 @@ function ITMultiSelect({
|
|
|
4112
4133
|
style.alignItems = "center";
|
|
4113
4134
|
style.gap = "0.375rem";
|
|
4114
4135
|
style.minHeight = "2.5rem";
|
|
4136
|
+
style.borderRadius = "var(--it-bento-field-radius, var(--radius-md))";
|
|
4115
4137
|
if (disabled) {
|
|
4116
4138
|
style.backgroundColor = inputTheme.disabled?.backgroundColor || style.backgroundColor;
|
|
4117
4139
|
style.borderColor = inputTheme.disabled?.borderColor || style.borderColor;
|
|
@@ -7333,7 +7355,9 @@ function ITPageHeader({
|
|
|
7333
7355
|
}) {
|
|
7334
7356
|
const { t } = useITTranslation();
|
|
7335
7357
|
const showTopRow = breadcrumbs?.length || backAction;
|
|
7336
|
-
const
|
|
7358
|
+
const appearance = useITAppearance();
|
|
7359
|
+
const bento = appearance === "bento";
|
|
7360
|
+
const flat = appearance === "flat";
|
|
7337
7361
|
return /* @__PURE__ */ jsxs30("div", { className: `${className} space-y-3`, children: [
|
|
7338
7362
|
showTopRow && /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7339
7363
|
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
@@ -7341,7 +7365,8 @@ function ITPageHeader({
|
|
|
7341
7365
|
"button",
|
|
7342
7366
|
{
|
|
7343
7367
|
onClick: backAction,
|
|
7344
|
-
className: "flex items-center justify-center w-9 h-9 rounded-full border border-slate-200 dark:border-slate-700 text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:border-slate-300 dark:hover:border-slate-600 hover:bg-slate-50 dark:hover:bg-slate-800/60 transition-all duration-200 flex-shrink-0",
|
|
7368
|
+
className: bento ? "flex items-center justify-center w-10 h-10 rounded-full hover:opacity-80 transition-opacity duration-200 flex-shrink-0" : "flex items-center justify-center w-9 h-9 rounded-full border border-slate-200 dark:border-slate-700 text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:border-slate-300 dark:hover:border-slate-600 hover:bg-slate-50 dark:hover:bg-slate-800/60 transition-all duration-200 flex-shrink-0",
|
|
7369
|
+
style: bento ? { backgroundColor: "var(--it-bento-control-bg, #f1f5f9)", color: "var(--it-bento-control-text, #475569)" } : void 0,
|
|
7345
7370
|
"aria-label": t("pageHeader.back"),
|
|
7346
7371
|
children: /* @__PURE__ */ jsx42(FaChevronLeft3, { size: 14 })
|
|
7347
7372
|
}
|
|
@@ -7352,7 +7377,7 @@ function ITPageHeader({
|
|
|
7352
7377
|
] }),
|
|
7353
7378
|
/* @__PURE__ */ jsxs30("div", { className: "flex items-start justify-between gap-6", children: [
|
|
7354
7379
|
/* @__PURE__ */ jsxs30("div", { className: "flex items-start gap-4 min-w-0", children: [
|
|
7355
|
-
icon && !flat && /* @__PURE__ */ jsx42(
|
|
7380
|
+
icon && !flat && !bento && /* @__PURE__ */ jsx42(
|
|
7356
7381
|
"div",
|
|
7357
7382
|
{
|
|
7358
7383
|
className: "flex items-center justify-center w-12 h-12 rounded-full border border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50 text-slate-600 dark:text-slate-300 flex-shrink-0 transition-all duration-200 hover:border-slate-300 dark:hover:border-slate-500 hover:shadow-sm",
|
|
@@ -7365,7 +7390,7 @@ function ITPageHeader({
|
|
|
7365
7390
|
ITText,
|
|
7366
7391
|
{
|
|
7367
7392
|
as: "h1",
|
|
7368
|
-
className: flat ? "text-[1.625rem] font-bold text-slate-900 dark:text-white tracking-tight leading-tight" : "text-3xl font-bold text-slate-800 dark:text-white tracking-tight leading-tight",
|
|
7393
|
+
className: bento ? "text-3xl font-bold text-slate-900 dark:text-white tracking-tighter leading-tight" : flat ? "text-[1.625rem] font-bold text-slate-900 dark:text-white tracking-tight leading-tight" : "text-3xl font-bold text-slate-800 dark:text-white tracking-tight leading-tight",
|
|
7369
7394
|
children: title
|
|
7370
7395
|
}
|
|
7371
7396
|
),
|
|
@@ -7373,7 +7398,7 @@ function ITPageHeader({
|
|
|
7373
7398
|
ITText,
|
|
7374
7399
|
{
|
|
7375
7400
|
as: "p",
|
|
7376
|
-
className: flat ? "text-sm font-normal text-slate-500 dark:text-slate-400 mt-0.5 leading-relaxed" : "text-sm font-light text-slate-500 dark:text-slate-400 mt-1 leading-relaxed",
|
|
7401
|
+
className: bento ? "text-sm font-normal text-slate-500 dark:text-slate-400 mt-1.5 leading-relaxed" : flat ? "text-sm font-normal text-slate-500 dark:text-slate-400 mt-0.5 leading-relaxed" : "text-sm font-light text-slate-500 dark:text-slate-400 mt-1 leading-relaxed",
|
|
7377
7402
|
children: description
|
|
7378
7403
|
}
|
|
7379
7404
|
)
|
|
@@ -8285,16 +8310,19 @@ function ITSegmentedControl({
|
|
|
8285
8310
|
disabled = false
|
|
8286
8311
|
}) {
|
|
8287
8312
|
const { button, container } = sizeMap3[size];
|
|
8313
|
+
const bento = useITAppearance() === "bento";
|
|
8288
8314
|
return /* @__PURE__ */ jsx59(
|
|
8289
8315
|
"div",
|
|
8290
8316
|
{
|
|
8291
8317
|
role: "group",
|
|
8292
8318
|
className: clsx40(
|
|
8293
|
-
"inline-flex
|
|
8319
|
+
"inline-flex",
|
|
8320
|
+
bento ? "rounded-full" : "rounded-xl bg-slate-100 dark:bg-slate-800 border border-slate-200 dark:border-slate-700",
|
|
8294
8321
|
container,
|
|
8295
8322
|
disabled && "opacity-50 cursor-not-allowed",
|
|
8296
8323
|
className
|
|
8297
8324
|
),
|
|
8325
|
+
style: bento ? { backgroundColor: "var(--it-bento-control-bg, #f1f5f9)" } : void 0,
|
|
8298
8326
|
children: options.map((opt) => {
|
|
8299
8327
|
const isActive = opt.value === value;
|
|
8300
8328
|
return /* @__PURE__ */ jsxs41(
|
|
@@ -8306,10 +8334,14 @@ function ITSegmentedControl({
|
|
|
8306
8334
|
disabled,
|
|
8307
8335
|
className: clsx40(
|
|
8308
8336
|
button,
|
|
8309
|
-
"
|
|
8310
|
-
isActive ? "bg-white dark:bg-slate-700 text-slate-800 dark:text-white shadow-sm border border-slate-200 dark:border-slate-600" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300 border border-transparent",
|
|
8337
|
+
"font-semibold transition-all flex items-center gap-1.5",
|
|
8338
|
+
bento ? "rounded-full border border-transparent" : isActive ? "rounded-lg bg-white dark:bg-slate-700 text-slate-800 dark:text-white shadow-sm border border-slate-200 dark:border-slate-600" : "rounded-lg text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300 border border-transparent",
|
|
8311
8339
|
disabled && "pointer-events-none"
|
|
8312
8340
|
),
|
|
8341
|
+
style: bento ? {
|
|
8342
|
+
backgroundColor: isActive ? "var(--it-bento-ink-bg, #0f172a)" : "transparent",
|
|
8343
|
+
color: isActive ? "var(--it-bento-ink-text, #ffffff)" : "var(--it-bento-control-text, #475569)"
|
|
8344
|
+
} : void 0,
|
|
8313
8345
|
children: [
|
|
8314
8346
|
opt.icon && /* @__PURE__ */ jsx59("span", { children: opt.icon }),
|
|
8315
8347
|
/* @__PURE__ */ jsx59(ITText, { as: "span", children: opt.label })
|
|
@@ -8362,7 +8394,9 @@ function ITSidebar({
|
|
|
8362
8394
|
onToggleCollapse,
|
|
8363
8395
|
expandOnHover = true
|
|
8364
8396
|
}) {
|
|
8365
|
-
const
|
|
8397
|
+
const appearance = useITAppearance();
|
|
8398
|
+
const bento = appearance === "bento";
|
|
8399
|
+
const flat = appearance === "flat" || bento;
|
|
8366
8400
|
const { t } = useITTranslation();
|
|
8367
8401
|
const [expandedItems, setExpandedItems] = useState27(/* @__PURE__ */ new Set());
|
|
8368
8402
|
const [isHovering, setIsHovering] = useState27(false);
|
|
@@ -8454,7 +8488,7 @@ function ITSidebar({
|
|
|
8454
8488
|
color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
|
|
8455
8489
|
backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
8456
8490
|
fontSize: flat ? "0.84rem" : "0.78rem",
|
|
8457
|
-
fontWeight: subitem.isActive ? 600 : 500,
|
|
8491
|
+
fontWeight: subitem.isActive ? bento ? 700 : 600 : 500,
|
|
8458
8492
|
letterSpacing: "0.01em",
|
|
8459
8493
|
marginLeft: subitemConnector === "|" ? "-1px" : "0"
|
|
8460
8494
|
},
|
|
@@ -8611,7 +8645,7 @@ function ITSidebar({
|
|
|
8611
8645
|
style: {
|
|
8612
8646
|
zIndex: 50,
|
|
8613
8647
|
backgroundColor: "var(--it-sidebar-bg, rgba(255, 255, 255, 0.90))",
|
|
8614
|
-
borderRight: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
8648
|
+
borderRight: bento ? "none" : "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
8615
8649
|
...flat ? {} : { WebkitBackdropFilter: "blur(12px)", backdropFilter: "blur(12px)" }
|
|
8616
8650
|
},
|
|
8617
8651
|
children: [
|
|
@@ -8705,7 +8739,7 @@ function ITSidebar({
|
|
|
8705
8739
|
style: {
|
|
8706
8740
|
color: active ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
8707
8741
|
fontSize: flat ? "0.875rem" : "0.8rem",
|
|
8708
|
-
fontWeight: active ? "600" : "500"
|
|
8742
|
+
fontWeight: active ? bento ? "700" : "600" : "500"
|
|
8709
8743
|
},
|
|
8710
8744
|
children: item.label
|
|
8711
8745
|
}
|
|
@@ -9874,6 +9908,7 @@ var ITTabs = ({
|
|
|
9874
9908
|
className = "",
|
|
9875
9909
|
containerClassName = ""
|
|
9876
9910
|
}) => {
|
|
9911
|
+
const bento = useITAppearance() === "bento" && variant === "pill";
|
|
9877
9912
|
const [activeId, setActiveId] = useState31(defaultActiveId || items[0]?.id);
|
|
9878
9913
|
const handleTabClick = (id, disabled) => {
|
|
9879
9914
|
if (disabled) return;
|
|
@@ -9882,39 +9917,50 @@ var ITTabs = ({
|
|
|
9882
9917
|
};
|
|
9883
9918
|
const activeContent = items.find((item) => item.id === activeId)?.content;
|
|
9884
9919
|
return /* @__PURE__ */ jsxs48("div", { className: clsx47("w-full", containerClassName), children: [
|
|
9885
|
-
/* @__PURE__ */ jsx67(
|
|
9886
|
-
"
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
{
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
"
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9920
|
+
/* @__PURE__ */ jsx67(
|
|
9921
|
+
"div",
|
|
9922
|
+
{
|
|
9923
|
+
className: clsx47(
|
|
9924
|
+
"flex border-secondary-200 mb-4",
|
|
9925
|
+
variant === "line" ? "border-b" : bento ? "gap-2 p-1 rounded-full w-fit" : "gap-2 p-1 bg-secondary-100 rounded-lg w-fit",
|
|
9926
|
+
className
|
|
9927
|
+
),
|
|
9928
|
+
style: bento ? { backgroundColor: "var(--it-bento-control-bg, #f1f5f9)", borderColor: "transparent" } : void 0,
|
|
9929
|
+
children: items.map((item) => {
|
|
9930
|
+
const isActive = item.id === activeId;
|
|
9931
|
+
return /* @__PURE__ */ jsxs48(
|
|
9932
|
+
"button",
|
|
9933
|
+
{
|
|
9934
|
+
onClick: () => handleTabClick(item.id, item.disabled),
|
|
9935
|
+
disabled: item.disabled,
|
|
9936
|
+
className: clsx47(
|
|
9937
|
+
"flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all duration-200 outline-none",
|
|
9938
|
+
// LINE VARIANT
|
|
9939
|
+
variant === "line" && [
|
|
9940
|
+
"border-b-2 -mb-[2px]",
|
|
9941
|
+
isActive ? "border-primary-500 text-primary-600" : "border-transparent text-secondary-500 hover:text-secondary-700 hover:border-secondary-300"
|
|
9942
|
+
],
|
|
9943
|
+
// PILL VARIANT
|
|
9944
|
+
variant === "pill" && (bento ? "rounded-full" : [
|
|
9945
|
+
"rounded-md",
|
|
9946
|
+
isActive ? "bg-white text-primary-600 shadow-sm" : "text-secondary-500 hover:text-secondary-700"
|
|
9947
|
+
]),
|
|
9948
|
+
item.disabled && "opacity-50 cursor-not-allowed"
|
|
9949
|
+
),
|
|
9950
|
+
style: bento ? {
|
|
9951
|
+
backgroundColor: isActive ? "var(--it-bento-ink-bg, #0f172a)" : "transparent",
|
|
9952
|
+
color: isActive ? "var(--it-bento-ink-text, #ffffff)" : "var(--it-bento-control-text, #475569)"
|
|
9953
|
+
} : void 0,
|
|
9954
|
+
children: [
|
|
9955
|
+
item.icon && /* @__PURE__ */ jsx67("span", { className: "w-4 h-4", children: item.icon }),
|
|
9956
|
+
/* @__PURE__ */ jsx67(ITText, { as: "span", children: item.label })
|
|
9957
|
+
]
|
|
9958
|
+
},
|
|
9959
|
+
item.id
|
|
9960
|
+
);
|
|
9961
|
+
})
|
|
9962
|
+
}
|
|
9963
|
+
),
|
|
9918
9964
|
/* @__PURE__ */ jsx67("div", { className: "tab-content animate-fadeIn", children: activeContent })
|
|
9919
9965
|
] });
|
|
9920
9966
|
};
|
|
@@ -12408,6 +12454,11 @@ var AXZY_CATALOG_ENTRIES = [
|
|
|
12408
12454
|
summary: "Tarjeta con t\xEDtulo, imagen y contenido.",
|
|
12409
12455
|
props: {
|
|
12410
12456
|
title: { kind: "string" },
|
|
12457
|
+
tone: {
|
|
12458
|
+
kind: "enum",
|
|
12459
|
+
values: ["primary", "secondary", "ternary", "success", "info", "warning", "danger"],
|
|
12460
|
+
doc: "Tinte pastel de la tarjeta (token --color-<tone>-soft)."
|
|
12461
|
+
},
|
|
12411
12462
|
image: { kind: "string", doc: "URL de la imagen de cabecera." },
|
|
12412
12463
|
alt: { kind: "string" },
|
|
12413
12464
|
onClick: { kind: "action" },
|
|
@@ -15061,9 +15112,13 @@ function ITTopBar({
|
|
|
15061
15112
|
hideBrandOnDesktop = false,
|
|
15062
15113
|
showDesktopMenuButton = false
|
|
15063
15114
|
}) {
|
|
15064
|
-
const
|
|
15115
|
+
const appearance = useITAppearance();
|
|
15116
|
+
const bento = appearance === "bento";
|
|
15117
|
+
const flat = appearance === "flat" || bento;
|
|
15065
15118
|
const { t } = useITTranslation();
|
|
15066
15119
|
const initials = (userMenu?.userName ?? "").trim().split(/\s+/).slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
15120
|
+
const userRestBg = bento ? "var(--it-bento-control-bg, #f1f5f9)" : "transparent";
|
|
15121
|
+
const userHoverBg = bento ? "var(--it-bento-control-bg-hover, #e2e8f0)" : "var(--it-topbar-user-hover, #f1f5f9)";
|
|
15067
15122
|
const [isUserMenuOpen, setIsUserMenuOpen] = useState41(false);
|
|
15068
15123
|
const userMenuRef = useRef24(null);
|
|
15069
15124
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
@@ -15072,8 +15127,8 @@ function ITTopBar({
|
|
|
15072
15127
|
{
|
|
15073
15128
|
className: `sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`,
|
|
15074
15129
|
style: {
|
|
15075
|
-
backgroundColor: "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
|
|
15076
|
-
borderBottom: "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
15130
|
+
backgroundColor: bento ? "var(--it-layout-bg, #f4f4f6)" : "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
|
|
15131
|
+
borderBottom: bento ? "none" : "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
15077
15132
|
boxShadow: flat ? "none" : "var(--shadow-xs)"
|
|
15078
15133
|
},
|
|
15079
15134
|
children: /* @__PURE__ */ jsxs56("div", { className: `flex items-center justify-between px-6 lg:px-8 ${flat ? "h-[64px]" : "h-[72px]"}`, children: [
|
|
@@ -15083,12 +15138,13 @@ function ITTopBar({
|
|
|
15083
15138
|
{
|
|
15084
15139
|
type: "button",
|
|
15085
15140
|
"aria-label": t("common.menu"),
|
|
15086
|
-
className: `${showDesktopMenuButton ? "" : "lg:hidden"} p-2.5 -ml-2.5 rounded-xl transition-colors duration-200`,
|
|
15141
|
+
className: `${showDesktopMenuButton ? "" : "lg:hidden"} ${bento ? "w-10 h-10 flex items-center justify-center rounded-full" : "p-2.5 -ml-2.5 rounded-xl"} transition-colors duration-200`,
|
|
15087
15142
|
style: {
|
|
15088
|
-
color: "var(--it-topbar-icon, #64748b)"
|
|
15143
|
+
color: bento ? "var(--it-bento-control-text, #475569)" : "var(--it-topbar-icon, #64748b)",
|
|
15144
|
+
backgroundColor: bento ? "var(--it-bento-control-bg, #f1f5f9)" : void 0
|
|
15089
15145
|
},
|
|
15090
|
-
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "var(--it-topbar-user-hover, #f1f5f9)",
|
|
15091
|
-
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent",
|
|
15146
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = bento ? "var(--it-bento-control-bg-hover, #e2e8f0)" : "var(--it-topbar-user-hover, #f1f5f9)",
|
|
15147
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = bento ? "var(--it-bento-control-bg, #f1f5f9)" : "transparent",
|
|
15092
15148
|
onClick: onToggleMobileMenu,
|
|
15093
15149
|
children: /* @__PURE__ */ jsx78(FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
15094
15150
|
}
|
|
@@ -15105,27 +15161,40 @@ function ITTopBar({
|
|
|
15105
15161
|
}
|
|
15106
15162
|
)
|
|
15107
15163
|
] }),
|
|
15108
|
-
navItems && navItems.length > 0 && /* @__PURE__ */ jsx78(
|
|
15109
|
-
"
|
|
15164
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ jsx78(
|
|
15165
|
+
"nav",
|
|
15110
15166
|
{
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
|
|
15127
|
-
|
|
15128
|
-
|
|
15167
|
+
className: bento ? "hidden md:flex ml-4 gap-2" : "hidden md:flex ml-8 space-x-1 border-l pl-8",
|
|
15168
|
+
style: bento ? void 0 : { borderColor: "var(--it-topbar-border, rgba(15, 23, 42, 0.06))" },
|
|
15169
|
+
children: navItems.map((item) => {
|
|
15170
|
+
const restBg = bento ? item.isActive ? "var(--it-bento-ink-bg, #0f172a)" : "var(--it-bento-control-bg, #f1f5f9)" : item.isActive ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent";
|
|
15171
|
+
const restColor = bento ? item.isActive ? "var(--it-bento-ink-text, #ffffff)" : "var(--it-bento-control-text, #475569)" : "var(--it-topbar-text, #475569)";
|
|
15172
|
+
return /* @__PURE__ */ jsx78(
|
|
15173
|
+
"button",
|
|
15174
|
+
{
|
|
15175
|
+
onClick: () => onNavItemClick?.(item.id),
|
|
15176
|
+
"aria-current": item.isActive ? "page" : void 0,
|
|
15177
|
+
className: `px-4 py-2 ${bento ? "rounded-full" : "rounded-lg"} font-medium text-[0.9rem] transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)]`,
|
|
15178
|
+
style: { color: restColor, backgroundColor: restBg },
|
|
15179
|
+
onMouseEnter: (e) => {
|
|
15180
|
+
if (bento && item.isActive) return;
|
|
15181
|
+
e.currentTarget.style.color = bento ? "var(--it-bento-control-text, #0f172a)" : "var(--it-topbar-text, #0f172a)";
|
|
15182
|
+
e.currentTarget.style.backgroundColor = bento ? "var(--it-bento-control-bg-hover, #e2e8f0)" : "var(--it-topbar-user-hover, #f1f5f9)";
|
|
15183
|
+
},
|
|
15184
|
+
onMouseLeave: (e) => {
|
|
15185
|
+
e.currentTarget.style.color = restColor;
|
|
15186
|
+
e.currentTarget.style.backgroundColor = restBg;
|
|
15187
|
+
},
|
|
15188
|
+
children: /* @__PURE__ */ jsxs56("div", { className: "flex items-center gap-2", children: [
|
|
15189
|
+
item.icon && /* @__PURE__ */ jsx78("span", { className: "opacity-70", children: item.icon }),
|
|
15190
|
+
/* @__PURE__ */ jsx78(ITText, { as: "span", children: item.label })
|
|
15191
|
+
] })
|
|
15192
|
+
},
|
|
15193
|
+
item.id
|
|
15194
|
+
);
|
|
15195
|
+
})
|
|
15196
|
+
}
|
|
15197
|
+
)
|
|
15129
15198
|
] }),
|
|
15130
15199
|
centerContent && /* @__PURE__ */ jsx78("div", { className: `hidden lg:flex flex-1 min-w-0 items-center ${hideBrandOnDesktop ? "justify-start pr-4" : "justify-center px-4"}`, children: /* @__PURE__ */ jsx78("div", { className: "w-full max-w-[420px]", children: centerContent }) }),
|
|
15131
15200
|
(children || userMenu) && /* @__PURE__ */ jsxs56("div", { className: "flex items-center gap-2", children: [
|
|
@@ -15135,15 +15204,15 @@ function ITTopBar({
|
|
|
15135
15204
|
"button",
|
|
15136
15205
|
{
|
|
15137
15206
|
type: "button",
|
|
15138
|
-
className: `flex items-center gap-3 rounded-full py-1.5 transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)] border border-transparent hover:border-secondary-200 ${flat ? "flex-row-reverse pl-4 pr-2" : "pl-2 pr-4"}`,
|
|
15207
|
+
className: `flex items-center gap-3 rounded-full py-1.5 transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)] border border-transparent ${bento ? "" : "hover:border-secondary-200"} ${flat ? "flex-row-reverse pl-4 pr-2" : "pl-2 pr-4"}`,
|
|
15139
15208
|
style: {
|
|
15140
|
-
backgroundColor: isUserMenuOpen ?
|
|
15209
|
+
backgroundColor: isUserMenuOpen ? userHoverBg : userRestBg
|
|
15141
15210
|
},
|
|
15142
15211
|
onMouseEnter: (e) => {
|
|
15143
|
-
if (!isUserMenuOpen) e.currentTarget.style.backgroundColor =
|
|
15212
|
+
if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = userHoverBg;
|
|
15144
15213
|
},
|
|
15145
15214
|
onMouseLeave: (e) => {
|
|
15146
|
-
if (!isUserMenuOpen) e.currentTarget.style.backgroundColor =
|
|
15215
|
+
if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = userRestBg;
|
|
15147
15216
|
},
|
|
15148
15217
|
onClick: () => setIsUserMenuOpen(!isUserMenuOpen),
|
|
15149
15218
|
children: [
|
|
@@ -15255,7 +15324,7 @@ function ITLayout({
|
|
|
15255
15324
|
}) {
|
|
15256
15325
|
const [internalCollapsed, setInternalCollapsed] = useState42(true);
|
|
15257
15326
|
const [mobileSidebarOpen, setMobileSidebarOpen] = useState42(false);
|
|
15258
|
-
const flat =
|
|
15327
|
+
const flat = useITAppearance() !== "soft";
|
|
15259
15328
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
15260
15329
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
15261
15330
|
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
@@ -15981,6 +16050,32 @@ function ITThemeProvider({
|
|
|
15981
16050
|
surfaceStyle?.remove();
|
|
15982
16051
|
};
|
|
15983
16052
|
}, [radius, shadow]);
|
|
16053
|
+
useLayoutEffect5(() => {
|
|
16054
|
+
const STYLE_ID = "it-theme-bento-tokens";
|
|
16055
|
+
let tag = document.getElementById(STYLE_ID);
|
|
16056
|
+
if (appearance !== "bento") {
|
|
16057
|
+
tag?.remove();
|
|
16058
|
+
return;
|
|
16059
|
+
}
|
|
16060
|
+
if (!tag) {
|
|
16061
|
+
tag = document.createElement("style");
|
|
16062
|
+
tag.id = STYLE_ID;
|
|
16063
|
+
document.head.appendChild(tag);
|
|
16064
|
+
}
|
|
16065
|
+
const hasRadius = typeof radius === "number" && isFinite(radius);
|
|
16066
|
+
const hasShadow = shadowLevel(shadow) !== null;
|
|
16067
|
+
const shapeLight = hasRadius ? "" : "--it-bento-card-radius:24px;--it-bento-pill-radius:9999px;--it-bento-field-radius:1rem;--it-input-radius:var(--it-bento-pill-radius);";
|
|
16068
|
+
const shadowLight = hasShadow ? "" : "--it-bento-card-shadow:0 1px 2px rgba(16,24,40,.04),0 12px 32px -16px rgba(16,24,40,.10);--it-bento-card-shadow-hover:0 1px 2px rgba(16,24,40,.06),0 18px 40px -16px rgba(16,24,40,.18);";
|
|
16069
|
+
const shadowDark = hasShadow ? "" : "--it-bento-card-shadow:0 1px 2px rgba(0,0,0,.4),0 12px 32px -16px rgba(0,0,0,.55);--it-bento-card-shadow-hover:0 1px 2px rgba(0,0,0,.5),0 18px 40px -16px rgba(0,0,0,.7);";
|
|
16070
|
+
const navTokens = "--it-sidebar-active-bg:var(--it-bento-nav-active-bg);--it-sidebar-active-color:var(--it-bento-nav-active-text);--it-sidebar-active-icon:var(--it-bento-nav-active-text);";
|
|
16071
|
+
const light = "--it-layout-bg:#f4f4f6;--it-card-bg:#ffffff;--it-bento-card-padding:1.5rem;--it-input-bg:#f1f5f9;--it-input-border:transparent;--it-input-focus-ring:0 0 0 2px color-mix(in srgb,var(--color-primary) 50%,transparent);--it-bento-control-bg:#f1f5f9;--it-bento-control-bg-hover:#e2e8f0;--it-bento-control-text:#475569;--it-bento-ink-bg:#0f172a;--it-bento-ink-text:#ffffff;--it-bento-nav-active-bg:#f1f5f9;--it-bento-nav-active-text:#0f172a;" + navTokens;
|
|
16072
|
+
const dark = "--it-layout-bg:#020617;--it-card-bg:#0f172a;--it-input-bg:#1e293b;--it-input-border:transparent;--it-bento-control-bg:#1e293b;--it-bento-control-bg-hover:#334155;--it-bento-control-text:#cbd5e1;--it-bento-ink-bg:#ffffff;--it-bento-ink-text:#0f172a;--it-bento-nav-active-bg:#1e293b;--it-bento-nav-active-text:#ffffff;" + navTokens;
|
|
16073
|
+
const A = '[data-it-appearance="bento"]';
|
|
16074
|
+
tag.textContent = `:root${A}{${light}${shapeLight}${shadowLight}}:root${A}.dark,:root${A} .dark,:root${A} [data-theme="dark"]{${dark}${shadowDark}}:root${A} [data-theme="light"]{${light}${shadowLight}}`;
|
|
16075
|
+
return () => {
|
|
16076
|
+
tag?.remove();
|
|
16077
|
+
};
|
|
16078
|
+
}, [appearance, radius, shadow]);
|
|
15984
16079
|
useEffect22(() => {
|
|
15985
16080
|
const injectStyles = (obj, prefix = "") => {
|
|
15986
16081
|
Object.entries(obj).forEach(([key, val]) => {
|
|
@@ -17537,6 +17632,7 @@ export {
|
|
|
17537
17632
|
useDebouncedSearch,
|
|
17538
17633
|
useEditableRow,
|
|
17539
17634
|
useFloatingPanel,
|
|
17635
|
+
useITAppearance,
|
|
17540
17636
|
useITFlatAppearance,
|
|
17541
17637
|
useITTheme,
|
|
17542
17638
|
useITThemeSafe,
|