@seedgrid/fe-components 2026.3.11-7 → 2026.3.13

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.
Files changed (42) hide show
  1. package/dist/digits/roller3d-digit/SgRoller3DDigit.d.ts.map +1 -1
  2. package/dist/digits/roller3d-digit/SgRoller3DDigit.js +4 -2
  3. package/dist/digits/segment-digit/SgSegmentDigit.js +1 -1
  4. package/dist/gadgets/calendar/SgCalendar.js +1 -1
  5. package/dist/gadgets/clock/SgClock.d.ts.map +1 -1
  6. package/dist/gadgets/clock/SgClock.js +10 -5
  7. package/dist/gadgets/clock/themes/SgClockThemePicker.d.ts.map +1 -1
  8. package/dist/gadgets/clock/themes/SgClockThemePicker.js +3 -3
  9. package/dist/gadgets/clock/themes/renderTheme.d.ts.map +1 -1
  10. package/dist/gadgets/clock/themes/renderTheme.js +3 -1
  11. package/dist/gadgets/clock/themes/useDarkFlag.d.ts.map +1 -1
  12. package/dist/gadgets/clock/themes/useDarkFlag.js +34 -3
  13. package/dist/inputs/SgAutocomplete.js +3 -3
  14. package/dist/inputs/SgCombobox.js +4 -4
  15. package/dist/inputs/SgDatatable.js +3 -3
  16. package/dist/inputs/SgInputCurrency.d.ts.map +1 -1
  17. package/dist/inputs/SgInputCurrency.js +5 -3
  18. package/dist/inputs/SgInputDate.js +2 -2
  19. package/dist/inputs/SgInputNumber.d.ts.map +1 -1
  20. package/dist/inputs/SgInputNumber.js +8 -4
  21. package/dist/inputs/SgInputOTP.js +1 -1
  22. package/dist/inputs/SgInputSelect.js +3 -3
  23. package/dist/inputs/SgInputText.d.ts.map +1 -1
  24. package/dist/inputs/SgInputText.js +8 -4
  25. package/dist/inputs/SgInputTextArea.d.ts.map +1 -1
  26. package/dist/inputs/SgInputTextArea.js +8 -4
  27. package/dist/inputs/SgOrderList.js +2 -2
  28. package/dist/inputs/SgPickList.js +3 -3
  29. package/dist/inputs/SgTextEditor.d.ts.map +1 -1
  30. package/dist/inputs/SgTextEditor.js +9 -4
  31. package/dist/inputs/SgToggleSwitch.js +1 -1
  32. package/dist/layout/SgCarousel.js +3 -3
  33. package/dist/layout/SgGroupBox.js +1 -1
  34. package/dist/menus/SgDockMenu.d.ts.map +1 -1
  35. package/dist/menus/SgDockMenu.js +20 -10
  36. package/dist/others/SgPlayground.d.ts.map +1 -1
  37. package/dist/others/SgPlayground.js +24 -1
  38. package/dist/overlay/SgDialog.d.ts.map +1 -1
  39. package/dist/overlay/SgDialog.js +203 -1
  40. package/dist/sandbox.cjs +76 -76
  41. package/dist/wizard/SgWizard.js +4 -4
  42. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SgRoller3DDigit.d.ts","sourceRoot":"","sources":["../../../src/digits/roller3d-digit/SgRoller3DDigit.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,oBAAoB,GAAG;IACjC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,KAAqB,EACrB,QAAa,EACb,YAAkB,EAClB,SAAS,GACV,EAAE,oBAAoB,2CAoDtB"}
1
+ {"version":3,"file":"SgRoller3DDigit.d.ts","sourceRoot":"","sources":["../../../src/digits/roller3d-digit/SgRoller3DDigit.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,oBAAoB,GAAG;IACjC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,KAAqB,EACrB,QAAa,EACb,YAAkB,EAClB,SAAS,GACV,EAAE,oBAAoB,2CAsDtB"}
@@ -34,7 +34,7 @@ export function SgRoller3DDigit({ value, items = DEFAULT_ITEMS, fontSize = 32, t
34
34
  const w = Math.round(fontSize * (0.7 * charCount + 0.7));
35
35
  const h = Math.round(fontSize * 2.7);
36
36
  const translateY = -idx * itemH + h / 2 - itemH / 2;
37
- return (_jsxs("div", { className: cn("relative overflow-hidden rounded-2xl", "bg-white dark:bg-neutral-800", "ring-1 ring-black/5 dark:ring-white/10", "shadow-[inset_0_0_28px_rgba(0,0,0,0.08),0_8px_28px_rgba(0,0,0,0.12)]",
37
+ return (_jsxs("div", { className: cn("relative overflow-hidden rounded-2xl", "bg-[rgb(var(--sg-surface,var(--sg-bg)))]", "ring-1 ring-[rgb(var(--sg-border))]/70", "shadow-[inset_0_0_28px_rgba(0,0,0,0.08),0_8px_28px_rgba(0,0,0,0.12)]",
38
38
  // top fade
39
39
  "before:absolute before:inset-0 before:z-10 before:bg-gradient-to-b before:from-black/[0.06] before:to-transparent before:content-['']",
40
40
  // bottom fade
@@ -42,6 +42,8 @@ export function SgRoller3DDigit({ value, items = DEFAULT_ITEMS, fontSize = 32, t
42
42
  height: itemH,
43
43
  fontSize,
44
44
  lineHeight: 1,
45
- color: i === idx ? "rgb(30 30 34)" : "rgb(163 163 170)",
45
+ color: i === idx
46
+ ? "rgb(var(--sg-text,var(--sg-fg)))"
47
+ : "rgb(var(--sg-muted,var(--sg-fg)))",
46
48
  }, children: item }, `${item}-${i}`))) })] }));
47
49
  }
@@ -92,5 +92,5 @@ export function SgSegmentDigit({ value, size = 16, color, className, style }) {
92
92
  const scale = Math.max(0.2, size / viewHeight);
93
93
  const width = round(viewWidth * scale);
94
94
  const height = round(viewHeight * scale);
95
- return (_jsx("svg", { role: "img", "aria-label": value, width: width, height: height, viewBox: `0 0 ${viewWidth} ${viewHeight}`, className: cn("inline-block align-middle text-neutral-800 dark:text-neutral-200", className), style: { color, ...style }, children: glyph.map((segment, idx) => (_jsx("rect", { x: segment.x, y: segment.y, width: segment.w, height: segment.h, rx: 0.3, fill: "currentColor" }, `${normalized}-${idx}`))) }));
95
+ return (_jsx("svg", { role: "img", "aria-label": value, width: width, height: height, viewBox: `0 0 ${viewWidth} ${viewHeight}`, className: cn("inline-block align-middle text-[rgb(var(--sg-text,var(--sg-fg)))]", className), style: { color, ...style }, children: glyph.map((segment, idx) => (_jsx("rect", { x: segment.x, y: segment.y, width: segment.w, height: segment.h, rx: 0.3, fill: "currentColor" }, `${normalized}-${idx}`))) }));
96
96
  }
@@ -224,7 +224,7 @@ export function SgCalendar(props) {
224
224
  maxWidth: "100%",
225
225
  ...(cardProps?.style ?? {})
226
226
  };
227
- return (_jsx(SgCard, { title: resolvedCardTitle, collapsible: true, defaultOpen: true, collapseToggleAlign: "right", collapseIconSize: 20, draggable: true, bgColor: "#ffffff", bgColorTitle: "#f3f4f6", cardStyle: "outlined", ...cardProps, className: mergedCardClassName, bodyClassName: mergedCardBodyClassName, style: mergedCardStyle, children: _jsxs("div", { className: cn("inline-flex max-w-full select-none flex-col gap-3", className), style: style, ...rest, children: [_jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg border border-border/70 bg-background px-4 py-3", children: [_jsx("div", { className: "min-h-6 text-sm font-medium text-foreground", children: selectedLabel }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: () => setMonthViewDate(addMonths(monthViewDate, -1)), className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": uiLabels.previousMonth, title: uiLabels.previousMonth, children: _jsx("svg", { viewBox: "0 0 20 20", className: "h-4 w-4", "aria-hidden": "true", children: _jsx("path", { d: "m12.5 5.8-4.2 4.2 4.2 4.2", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), _jsx("button", { type: "button", onClick: () => setMonthViewDate(addMonths(monthViewDate, 1)), className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": uiLabels.nextMonth, title: uiLabels.nextMonth, children: _jsx("svg", { viewBox: "0 0 20 20", className: "h-4 w-4", "aria-hidden": "true", children: _jsx("path", { d: "m7.5 5.8 4.2 4.2-4.2 4.2", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), showTodayShortcut ? (_jsx("button", { type: "button", onClick: handleGoToday, className: "inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/70 bg-muted/40 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": uiLabels.goToday, title: uiLabels.goToday, children: _jsx("svg", { viewBox: "0 0 20 20", className: "h-4 w-4", "aria-hidden": "true", children: _jsx("path", { d: "M5.6 7.6 10 12l4.4-4.4", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) })) : null] })] }), _jsx("div", { className: "max-h-full max-w-full overflow-auto", children: _jsx("div", { className: "grid gap-4", style: monthGridStyle, children: monthDates.map((monthDate) => {
227
+ return (_jsx(SgCard, { title: resolvedCardTitle, collapsible: true, defaultOpen: true, collapseToggleAlign: "right", collapseIconSize: 20, draggable: true, bgColor: "rgb(var(--sg-surface,var(--sg-bg)))", bgColorTitle: "rgb(var(--sg-surface-2,var(--sg-surface,var(--sg-bg))))", cardStyle: "outlined", ...cardProps, className: mergedCardClassName, bodyClassName: mergedCardBodyClassName, style: mergedCardStyle, children: _jsxs("div", { className: cn("inline-flex max-w-full select-none flex-col gap-3", className), style: style, ...rest, children: [_jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg border border-border/70 bg-background px-4 py-3", children: [_jsx("div", { className: "min-h-6 text-sm font-medium text-foreground", children: selectedLabel }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: () => setMonthViewDate(addMonths(monthViewDate, -1)), className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": uiLabels.previousMonth, title: uiLabels.previousMonth, children: _jsx("svg", { viewBox: "0 0 20 20", className: "h-4 w-4", "aria-hidden": "true", children: _jsx("path", { d: "m12.5 5.8-4.2 4.2 4.2 4.2", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), _jsx("button", { type: "button", onClick: () => setMonthViewDate(addMonths(monthViewDate, 1)), className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": uiLabels.nextMonth, title: uiLabels.nextMonth, children: _jsx("svg", { viewBox: "0 0 20 20", className: "h-4 w-4", "aria-hidden": "true", children: _jsx("path", { d: "m7.5 5.8 4.2 4.2-4.2 4.2", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), showTodayShortcut ? (_jsx("button", { type: "button", onClick: handleGoToday, className: "inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/70 bg-muted/40 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "aria-label": uiLabels.goToday, title: uiLabels.goToday, children: _jsx("svg", { viewBox: "0 0 20 20", className: "h-4 w-4", "aria-hidden": "true", children: _jsx("path", { d: "M5.6 7.6 10 12l4.4-4.4", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) })) : null] })] }), _jsx("div", { className: "max-h-full max-w-full overflow-auto", children: _jsx("div", { className: "grid gap-4", style: monthGridStyle, children: monthDates.map((monthDate) => {
228
228
  const firstDayOfMonth = startOfMonth(monthDate);
229
229
  const firstDayOffset = (firstDayOfMonth.getDay() - safeWeekStartsOn + 7) % 7;
230
230
  const gridStart = addDays(firstDayOfMonth, -firstDayOffset);
@@ -1 +1 @@
1
- {"version":3,"file":"SgClock.d.ts","sourceRoot":"","sources":["../../../src/gadgets/clock/SgClock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAUnD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA2C/D,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,SAAS,G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cAAc,GACd,UAAU,GACV,MAAM,GACN,MAAM,GACN,QAAQ,GACR,MAAM,GACN,SAAS,CAAC;AAigBd,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CAsG1C"}
@@ -107,7 +107,7 @@ function AnalogClock({ size = 280, initialServerTime, timezone, locale = "pt-BR"
107
107
  const hourDeg = (((h % 12) + m / 60 + sec / 3600) / 12) * 360;
108
108
  const themeObj = theme ??
109
109
  (resolver ? resolveTheme(resolver, themeId, "classic") : getTheme(themeId) ?? getTheme("classic"));
110
- return (_jsx("div", { className: className, style: style, children: _jsxs("svg", { width: size, height: size, viewBox: "0 0 100 100", className: "block", "aria-label": "Analog clock", children: [_jsx("g", { id: "theme", children: themeObj ? _jsx(ThemeLayer, { theme: themeObj, args: { size, dark } }) : null }), _jsxs("g", { id: "hands", children: [_jsx("g", { transform: `rotate(${hourDeg} 50 50)`, children: _jsx("line", { x1: "50", y1: "50", x2: "50", y2: "28", className: "stroke-neutral-800 dark:stroke-neutral-200", strokeWidth: "2.6", strokeLinecap: "round" }) }), _jsx("g", { transform: `rotate(${minDeg} 50 50)`, children: _jsx("line", { x1: "50", y1: "50", x2: "50", y2: "18", className: "stroke-neutral-800 dark:stroke-neutral-200", strokeWidth: "1.7", strokeLinecap: "round" }) }), showSeconds && (_jsx("g", { transform: `rotate(${secDeg} 50 50)`, children: _jsx("line", { x1: "50", y1: "54", x2: "50", y2: "14", className: "stroke-rose-500", strokeWidth: "0.9", strokeLinecap: "round" }) }))] }), _jsx("circle", { cx: "50", cy: "50", r: "2.2", className: "fill-neutral-800 dark:fill-neutral-200" }), showSeconds ? _jsx("circle", { cx: "50", cy: "50", r: "1.1", className: "fill-rose-500" }) : null, centerOverlay ? (_jsx("foreignObject", { x: "35", y: "35", width: "30", height: "30", children: _jsx("div", { className: "flex h-full w-full items-center justify-center", children: centerOverlay }) })) : null] }) }));
110
+ return (_jsx("div", { className: className, style: style, children: _jsxs("svg", { width: size, height: size, viewBox: "0 0 100 100", className: cn("block", dark ? "dark" : undefined), "aria-label": "Analog clock", children: [_jsx("g", { id: "theme", children: themeObj ? _jsx(ThemeLayer, { theme: themeObj, args: { size, dark } }) : null }), _jsxs("g", { id: "hands", children: [_jsx("g", { transform: `rotate(${hourDeg} 50 50)`, children: _jsx("line", { x1: "50", y1: "50", x2: "50", y2: "28", className: "stroke-neutral-800 dark:stroke-neutral-200", strokeWidth: "2.6", strokeLinecap: "round" }) }), _jsx("g", { transform: `rotate(${minDeg} 50 50)`, children: _jsx("line", { x1: "50", y1: "50", x2: "50", y2: "18", className: "stroke-neutral-800 dark:stroke-neutral-200", strokeWidth: "1.7", strokeLinecap: "round" }) }), showSeconds && (_jsx("g", { transform: `rotate(${secDeg} 50 50)`, children: _jsx("line", { x1: "50", y1: "54", x2: "50", y2: "14", className: "stroke-rose-500", strokeWidth: "0.9", strokeLinecap: "round" }) }))] }), _jsx("circle", { cx: "50", cy: "50", r: "2.2", className: "fill-neutral-800 dark:fill-neutral-200" }), showSeconds ? _jsx("circle", { cx: "50", cy: "50", r: "1.1", className: "fill-rose-500" }) : null, centerOverlay ? (_jsx("foreignObject", { x: "35", y: "35", width: "30", height: "30", children: _jsx("div", { className: "flex h-full w-full items-center justify-center", children: centerOverlay }) })) : null] }) }));
111
111
  }
112
112
  function DigitalClock({ initialServerTime, timezone, locale = "pt-BR", format = "24h", showSeconds = true, size = "md", digitalStyle = "default", className, style }) {
113
113
  const { nowMs, hasProvider, providerTick } = useClockNowMs(initialServerTime);
@@ -147,12 +147,17 @@ function DigitalClock({ initialServerTime, timezone, locale = "pt-BR", format =
147
147
  const digitFont = Math.round(sizePx * 1.4);
148
148
  // Approx card height: fontSize * line-height(1.4) from the library CSS
149
149
  const cardH = Math.round(digitFont * 1.4);
150
- const Colon = () => (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2", style: { height: cardH }, children: [_jsx("div", { className: "h-2 w-2 rounded-full bg-[#edebeb]/80" }), _jsx("div", { className: "h-2 w-2 rounded-full bg-[#edebeb]/80" })] }));
151
- const PeriodCell = ({ value }) => (_jsx("div", { className: "flex items-center justify-center rounded bg-[#333232]", style: {
150
+ const Colon = () => (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2", style: { height: cardH }, children: [_jsx("div", { className: "h-2 w-2 rounded-full bg-[rgb(var(--sg-muted,var(--sg-fg)))]/80" }), _jsx("div", { className: "h-2 w-2 rounded-full bg-[rgb(var(--sg-muted,var(--sg-fg)))]/80" })] }));
151
+ const PeriodCell = ({ value }) => (_jsx("div", { className: "flex items-center justify-center rounded border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface,var(--sg-bg)))]", style: {
152
152
  height: cardH,
153
153
  padding: `0 ${Math.round(sizePx * 0.4)}px`,
154
154
  boxShadow: "0 .125em .3125em rgba(0,0,0,.25)",
155
- }, children: _jsx("span", { style: { fontSize: Math.round(sizePx * 0.9), color: "#edebeb", fontWeight: 700, lineHeight: 1 }, children: value }) }));
155
+ }, children: _jsx("span", { style: {
156
+ fontSize: Math.round(sizePx * 0.9),
157
+ color: "rgb(var(--sg-text,var(--sg-fg)))",
158
+ fontWeight: 700,
159
+ lineHeight: 1
160
+ }, children: value }) }));
156
161
  return (_jsxs("div", { className: cn("flex items-center gap-2", className), style: style, "aria-label": "Digital clock", children: [_jsx(SgFlipDigit, { value: hh.charAt(0), fontSize: digitFont }), _jsx(SgFlipDigit, { value: hh.charAt(1), fontSize: digitFont }), _jsx(Colon, {}), _jsx(SgFlipDigit, { value: mm.charAt(0), fontSize: digitFont }), _jsx(SgFlipDigit, { value: mm.charAt(1), fontSize: digitFont }), showSeconds ? (_jsxs(_Fragment, { children: [_jsx(Colon, {}), _jsx(SgFlipDigit, { value: ss.charAt(0), fontSize: digitFont }), _jsx(SgFlipDigit, { value: ss.charAt(1), fontSize: digitFont })] })) : null, format === "12h" && dayPeriod ? _jsx(PeriodCell, { value: dayPeriod.toUpperCase() }) : null] }));
157
162
  }
158
163
  if (digitalStyle === "roller3d") {
@@ -293,5 +298,5 @@ export function SgClock(props) {
293
298
  const analogSize = typeof size === "number" ? size : size === "sm" ? 140 : size === "lg" ? 320 : 240;
294
299
  return (_jsx(AnalogClock, { size: analogSize, initialServerTime: initialServerTime, themeId: themeId, theme: theme, timezone: timezone, locale: locale, showSeconds: showSeconds, secondHandMode: secondHandMode, className: className, style: style, centerOverlay: centerOverlay }));
295
300
  })()) : (_jsx(DigitalClock, { timezone: timezone, initialServerTime: initialServerTime, locale: locale, format: format, showSeconds: showSeconds, size: size, digitalStyle: digitalStyle, className: className, style: style }));
296
- return (_jsx(SgCard, { title: resolvedCardTitle, collapsible: true, defaultOpen: true, collapseToggleAlign: "right", collapseIconSize: 20, draggable: true, bgColor: "#ffffff", bgColorTitle: "#f3f4f6", cardStyle: "outlined", ...cardProps, className: mergedCardClassName, bodyClassName: mergedCardBodyClassName, style: mergedCardStyle, dragPersistKey: resolvedDragPersistKey, children: clockNode }));
301
+ return (_jsx(SgCard, { title: resolvedCardTitle, collapsible: true, defaultOpen: true, collapseToggleAlign: "right", collapseIconSize: 20, draggable: true, bgColor: "rgb(var(--sg-surface,var(--sg-bg)))", bgColorTitle: "rgb(var(--sg-surface-2,var(--sg-surface,var(--sg-bg))))", cardStyle: "outlined", ...cardProps, className: mergedCardClassName, bodyClassName: mergedCardBodyClassName, style: mergedCardStyle, dragPersistKey: resolvedDragPersistKey, children: clockNode }));
297
302
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SgClockThemePicker.d.ts","sourceRoot":"","sources":["../../../../src/gadgets/clock/themes/SgClockThemePicker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAS5C,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,KAAe,EACf,WAAiC,EACjC,SAAS,EACT,MAAM,EACN,WAAgB,EAChB,UAAiB,EACjB,eAA2B,EAC5B,EAAE,uBAAuB,2CAsJzB"}
1
+ {"version":3,"file":"SgClockThemePicker.d.ts","sourceRoot":"","sources":["../../../../src/gadgets/clock/themes/SgClockThemePicker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAS5C,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,KAAe,EACf,WAAiC,EACjC,SAAS,EACT,MAAM,EACN,WAAgB,EAChB,UAAiB,EACjB,eAA2B,EAC5B,EAAE,uBAAuB,2CAoJzB"}
@@ -44,7 +44,7 @@ export function SgClockThemePicker({ value, onChange, label = "Theme", placehold
44
44
  document.addEventListener("mousedown", onDoc);
45
45
  return () => document.removeEventListener("mousedown", onDoc);
46
46
  }, [open]);
47
- return (_jsxs("div", { ref: rootRef, className: cn("relative", className), children: [label ? _jsx("div", { className: "mb-1 text-xs font-medium opacity-70", children: label }) : null, _jsx("button", { type: "button", onClick: () => setOpen((v) => !v), className: cn("w-full rounded-lg border border-neutral-200 bg-white px-3 py-2 text-left shadow-sm", "hover:bg-neutral-50", "dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-900/40"), children: _jsxs("div", { className: "flex items-center gap-3", children: [currentTheme ? (_jsx("div", { className: "text-neutral-800 dark:text-neutral-200", children: _jsx(SgClockThemePreview, { theme: currentTheme, size: previewSize }) })) : (_jsx("div", { className: "h-[56px] w-[56px] rounded-md border border-neutral-200 dark:border-neutral-800" })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium", children: currentTheme?.label ?? currentTheme?.id ?? placeholder }), _jsx("div", { className: "truncate text-xs opacity-60", children: currentTheme?.id ?? "" })] }), _jsx("div", { className: "text-xs opacity-60", children: open ? "^" : "v" })] }) }), open && (_jsxs("div", { className: cn("absolute z-50 mt-2 w-full overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-lg", "dark:border-neutral-800 dark:bg-neutral-950"), children: [searchable && (_jsx("div", { className: "p-2", children: _jsx(SgAutocomplete, { id: "sg-clock-theme-search", label: "Search theme", placeholder: "Search theme...", openOnFocus: true, showDropDownButton: true, clearOnSelect: true, minLengthForSearch: 0, source: (query) => {
47
+ return (_jsxs("div", { ref: rootRef, className: cn("relative", className), children: [label ? _jsx("div", { className: "mb-1 text-xs font-medium opacity-70", children: label }) : null, _jsx("button", { type: "button", onClick: () => setOpen((v) => !v), className: cn("w-full rounded-lg border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface,var(--sg-bg)))] px-3 py-2 text-left text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-sm", "hover:bg-[rgb(var(--sg-surface-2,var(--sg-surface,var(--sg-bg))))]"), children: _jsxs("div", { className: "flex items-center gap-3", children: [currentTheme ? (_jsx("div", { className: "text-[rgb(var(--sg-text,var(--sg-fg)))]", children: _jsx(SgClockThemePreview, { theme: currentTheme, size: previewSize }) })) : (_jsx("div", { className: "h-[56px] w-[56px] rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface-2,var(--sg-surface,var(--sg-bg))))]" })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium", children: currentTheme?.label ?? currentTheme?.id ?? placeholder }), _jsx("div", { className: "truncate text-xs opacity-60", children: currentTheme?.id ?? "" })] }), _jsx("div", { className: "text-xs opacity-60", children: open ? "^" : "v" })] }) }), open && (_jsxs("div", { className: cn("absolute z-50 mt-2 w-full overflow-hidden rounded-xl border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface,var(--sg-bg)))] text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-lg"), children: [searchable && (_jsx("div", { className: "p-2", children: _jsx(SgAutocomplete, { id: "sg-clock-theme-search", label: "Search theme", placeholder: "Search theme...", openOnFocus: true, showDropDownButton: true, clearOnSelect: true, minLengthForSearch: 0, source: (query) => {
48
48
  const s = (query ?? "").trim().toLowerCase();
49
49
  const items = all.map((t) => ({
50
50
  id: t.id,
@@ -65,7 +65,7 @@ export function SgClockThemePicker({ value, onChange, label = "Theme", placehold
65
65
  onChange(t.id);
66
66
  setOpen(false);
67
67
  }, className: cn("w-full rounded-lg p-2 text-left transition", active
68
- ? "bg-neutral-900 text-white dark:bg-white dark:text-neutral-900"
69
- : "hover:bg-neutral-50 dark:hover:bg-neutral-900/40"), children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: cn(active ? "text-white dark:text-neutral-900" : "text-neutral-800 dark:text-neutral-200"), children: _jsx(SgClockThemePreview, { theme: t, size: 44 }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium", children: t.label ?? t.id }), _jsx("div", { className: cn("truncate text-xs", active ? "opacity-80" : "opacity-60"), children: t.id })] }), active ? _jsx("div", { className: "text-xs opacity-80", children: "OK" }) : null] }) }, t.id));
68
+ ? "bg-[rgb(var(--sg-primary))] text-[rgb(var(--sg-primary-contrast,var(--sg-bg)))]"
69
+ : "hover:bg-[rgb(var(--sg-surface-2,var(--sg-surface,var(--sg-bg))))]"), children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: cn(active ? "text-[rgb(var(--sg-primary-contrast,var(--sg-bg)))]" : "text-[rgb(var(--sg-text,var(--sg-fg)))]"), children: _jsx(SgClockThemePreview, { theme: t, size: 44 }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium", children: t.label ?? t.id }), _jsx("div", { className: cn("truncate text-xs", active ? "opacity-80" : "opacity-60"), children: t.id })] }), active ? _jsx("div", { className: "text-xs opacity-80", children: "OK" }) : null] }) }, t.id));
70
70
  }) })) })] }))] }));
71
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"renderTheme.d.ts","sourceRoot":"","sources":["../../../../src/gadgets/clock/themes/renderTheme.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAQ1F,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACL,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,sBAAsB,CAAC;CAC9B,2CA+BA;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,oBAAoB,GAAG,IAAI,EACrC,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GACtB,YAAY,GAAG,IAAI,CAKrB"}
1
+ {"version":3,"file":"renderTheme.d.ts","sourceRoot":"","sources":["../../../../src/gadgets/clock/themes/renderTheme.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAQ1F,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACL,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,sBAAsB,CAAC;CAC9B,2CAiCA;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,oBAAoB,GAAG,IAAI,EACrC,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GACtB,YAAY,GAAG,IAAI,CAKrB"}
@@ -9,6 +9,8 @@ function extractInnerSvg(svgText) {
9
9
  export function ThemeLayer({ theme, args }) {
10
10
  const [inner, setInner] = React.useState(null);
11
11
  const url = theme.url;
12
+ const darkClassName = args.dark ? "dark" : undefined;
13
+ const renderedTheme = theme.render?.(args) ?? null;
12
14
  React.useEffect(() => {
13
15
  let alive = true;
14
16
  setInner(null);
@@ -29,7 +31,7 @@ export function ThemeLayer({ theme, args }) {
29
31
  alive = false;
30
32
  };
31
33
  }, [url]);
32
- return (_jsxs(_Fragment, { children: [theme.render?.(args), url && inner && _jsx("g", { dangerouslySetInnerHTML: { __html: inner } })] }));
34
+ return (_jsxs(_Fragment, { children: [renderedTheme ? _jsx("g", { className: darkClassName, children: renderedTheme }) : null, url && inner ? _jsx("g", { className: darkClassName, dangerouslySetInnerHTML: { __html: inner } }) : null] }));
33
35
  }
34
36
  export function resolveTheme(resolver, themeId, fallbackThemeId) {
35
37
  const t = resolver?.resolve(themeId) ?? null;
@@ -1 +1 @@
1
- {"version":3,"file":"useDarkFlag.d.ts","sourceRoot":"","sources":["../../../../src/gadgets/clock/themes/useDarkFlag.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAgB1B"}
1
+ {"version":3,"file":"useDarkFlag.d.ts","sourceRoot":"","sources":["../../../../src/gadgets/clock/themes/useDarkFlag.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YA8C1B"}
@@ -4,11 +4,42 @@ export function useDarkFlag() {
4
4
  const [dark, setDark] = React.useState(false);
5
5
  React.useEffect(() => {
6
6
  const root = document.documentElement;
7
- const compute = () => setDark(root.classList.contains("dark"));
7
+ const compute = () => {
8
+ const mode = getComputedStyle(root).getPropertyValue("--sg-mode").trim().toLowerCase();
9
+ if (mode === "dark") {
10
+ setDark(true);
11
+ return;
12
+ }
13
+ if (mode === "light") {
14
+ setDark(false);
15
+ return;
16
+ }
17
+ if (root.classList.contains("dark")) {
18
+ setDark(true);
19
+ return;
20
+ }
21
+ setDark(window.matchMedia("(prefers-color-scheme: dark)").matches);
22
+ };
8
23
  compute();
9
24
  const obs = new MutationObserver(() => compute());
10
- obs.observe(root, { attributes: true, attributeFilter: ["class"] });
11
- return () => obs.disconnect();
25
+ obs.observe(root, { attributes: true, attributeFilter: ["class", "style"] });
26
+ const media = window.matchMedia("(prefers-color-scheme: dark)");
27
+ const onMediaChange = () => compute();
28
+ if (media.addEventListener) {
29
+ media.addEventListener("change", onMediaChange);
30
+ }
31
+ else {
32
+ media.addListener(onMediaChange);
33
+ }
34
+ return () => {
35
+ obs.disconnect();
36
+ if (media.removeEventListener) {
37
+ media.removeEventListener("change", onMediaChange);
38
+ }
39
+ else {
40
+ media.removeListener(onMediaChange);
41
+ }
42
+ };
12
43
  }, []);
13
44
  return dark;
14
45
  }
@@ -222,7 +222,7 @@ function SgAutocompleteBase(props) {
222
222
  return (_jsxs("div", { className: `group relative cursor-pointer px-3 py-2 text-sm ${isActive ? "bg-muted/60" : ""} ${item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-muted/40"}`, onMouseEnter: () => setActiveIndex(flatIndex), onMouseDown: (event) => {
223
223
  event.preventDefault();
224
224
  ignoreBlurRef.current = true;
225
- }, onClick: () => selectItem(item), children: [renderItem ? renderItem(item, isActive) : item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-white px-2 py-1 text-xs shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(item) })) : null] }, item.id));
225
+ }, onClick: () => selectItem(item), children: [renderItem ? renderItem(item, isActive) : item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] px-2 py-1 text-xs text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(item) })) : null] }, item.id));
226
226
  })] }, group || "default")));
227
227
  }
228
228
  return items.map((item, index) => {
@@ -230,7 +230,7 @@ function SgAutocompleteBase(props) {
230
230
  return (_jsxs("div", { className: `group relative cursor-pointer px-3 py-2 text-sm ${isActive ? "bg-muted/60" : ""} ${item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-muted/40"}`, onMouseEnter: () => setActiveIndex(index), onMouseDown: (event) => {
231
231
  event.preventDefault();
232
232
  ignoreBlurRef.current = true;
233
- }, onClick: () => selectItem(item), children: [renderItem ? renderItem(item, isActive) : item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-white px-2 py-1 text-xs shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(item) })) : null] }, item.id));
233
+ }, onClick: () => selectItem(item), children: [renderItem ? renderItem(item, isActive) : item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] px-2 py-1 text-xs text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(item) })) : null] }, item.id));
234
234
  });
235
235
  };
236
236
  return (_jsxs("div", { className: "relative", ref: wrapperRef, children: [_jsx(SgInputText, { ...rest, enabled: enabled, readOnly: readOnly, borderRadius: borderRadius, iconButtons: mergedIconButtons, inputProps: {
@@ -253,5 +253,5 @@ function SgAutocompleteBase(props) {
253
253
  inputProps?.onKeyDown?.(event);
254
254
  handleKeyDown(event);
255
255
  }
256
- } }), open && !(enabled === false || readOnly) ? (_jsxs("div", { className: "absolute left-0 right-0 z-30 mt-1 overflow-hidden rounded-md border border-border bg-white shadow-lg", style: resolvedBorderRadius ? { borderRadius: resolvedBorderRadius } : undefined, children: [_jsx("div", { className: "max-h-64 overflow-auto", children: listContent() }), renderFooter ? (_jsx("div", { className: "border-t border-border bg-white px-3 py-2", children: renderFooter(inputValue, items.length > 0) })) : null] })) : null] }));
256
+ } }), open && !(enabled === false || readOnly) ? (_jsxs("div", { className: "absolute left-0 right-0 z-30 mt-1 overflow-hidden rounded-md border border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-lg", style: resolvedBorderRadius ? { borderRadius: resolvedBorderRadius } : undefined, children: [_jsx("div", { className: "max-h-64 overflow-auto", children: listContent() }), renderFooter ? (_jsx("div", { className: "border-t border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] px-3 py-2", children: renderFooter(inputValue, items.length > 0) })) : null] })) : null] }));
257
257
  }
@@ -338,17 +338,17 @@ export function SgCombobox(props) {
338
338
  }
339
339
  }
340
340
  }
341
- } }), open && !isDisabled ? (_jsxs("div", { className: "absolute left-0 right-0 z-30 mt-1 overflow-hidden rounded-md border border-border bg-white shadow-lg", style: resolvedBorderRadius ? { borderRadius: resolvedBorderRadius } : undefined, children: [_jsx("div", { className: "max-h-64 overflow-auto", children: loading ? (_jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: loadingText })) : entries.length === 0 ? (_jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: emptyText })) : groupedEntries ? (groupedEntries.map(({ group, list }) => (_jsxs("div", { className: "border-b border-border last:border-b-0", children: [_jsx("div", { className: "px-3 py-1 text-xs font-semibold text-muted-foreground", children: renderGroupHeader ? renderGroupHeader(group) : group || " " }), list.map(({ entry, index }) => {
341
+ } }), open && !isDisabled ? (_jsxs("div", { className: "absolute left-0 right-0 z-30 mt-1 overflow-hidden rounded-md border border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-lg", style: resolvedBorderRadius ? { borderRadius: resolvedBorderRadius } : undefined, children: [_jsx("div", { className: "max-h-64 overflow-auto", children: loading ? (_jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: loadingText })) : entries.length === 0 ? (_jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: emptyText })) : groupedEntries ? (groupedEntries.map(({ group, list }) => (_jsxs("div", { className: "border-b border-border last:border-b-0", children: [_jsx("div", { className: "px-3 py-1 text-xs font-semibold text-muted-foreground", children: renderGroupHeader ? renderGroupHeader(group) : group || " " }), list.map(({ entry, index }) => {
342
342
  const isActive = activeIndex === index;
343
343
  return (_jsxs("div", { className: `group relative cursor-pointer px-3 py-2 text-sm ${isActive ? "bg-muted/60" : ""} ${entry.item.disabled ? "cursor-not-allowed opacity-50" : "hover:bg-muted/40"}`, onMouseEnter: () => setActiveIndex(index), onMouseDown: (event) => {
344
344
  event.preventDefault();
345
345
  ignoreBlurRef.current = true;
346
- }, onClick: () => selectIndex(index), children: [renderItem ? renderItem(entry.item, isActive) : entry.item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-white px-2 py-1 text-xs shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(entry.item) })) : null] }, entry.item.id));
346
+ }, onClick: () => selectIndex(index), children: [renderItem ? renderItem(entry.item, isActive) : entry.item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] px-2 py-1 text-xs text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(entry.item) })) : null] }, entry.item.id));
347
347
  })] }, group || "default")))) : (entries.map((entry, index) => {
348
348
  const isActive = activeIndex === index;
349
349
  return (_jsxs("div", { className: `group relative cursor-pointer px-3 py-2 text-sm ${isActive ? "bg-muted/60" : ""} ${entry.item.disabled ? "cursor-not-allowed opacity-50" : "hover:bg-muted/40"}`, onMouseEnter: () => setActiveIndex(index), onMouseDown: (event) => {
350
350
  event.preventDefault();
351
351
  ignoreBlurRef.current = true;
352
- }, onClick: () => selectIndex(index), children: [renderItem ? renderItem(entry.item, isActive) : entry.item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-white px-2 py-1 text-xs shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(entry.item) })) : null] }, entry.item.id));
353
- })) }), renderFooter ? (_jsx("div", { className: "border-t border-border bg-white px-3 py-2", children: renderFooter("", entries.length > 0) })) : null] })) : null] }));
352
+ }, onClick: () => selectIndex(index), children: [renderItem ? renderItem(entry.item, isActive) : entry.item.label, itemTooltip ? (_jsx("div", { className: "pointer-events-none absolute left-full top-1/2 z-20 ml-2 -translate-y-1/2 rounded border border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] px-2 py-1 text-xs text-[rgb(var(--sg-text,var(--sg-fg)))] shadow-md opacity-0 transition-opacity group-hover:opacity-100", children: itemTooltip(entry.item) })) : null] }, entry.item.id));
353
+ })) }), renderFooter ? (_jsx("div", { className: "border-t border-border bg-[rgb(var(--sg-surface,var(--sg-bg)))] px-3 py-2", children: renderFooter("", entries.length > 0) })) : null] })) : null] }));
354
354
  }
@@ -380,7 +380,7 @@ function SgDatatableBase(props, imperativeRef) {
380
380
  commitSelection(next);
381
381
  }, [selectionMode, currentSelection, dataKey, commitSelection]);
382
382
  const resolvedTitle = (groupBoxProps.title ?? title ?? "").trim() || " ";
383
- return (_jsx("div", { className: className, style: style, children: _jsx(SgGroupBox, { ...groupBoxProps, title: resolvedTitle, children: _jsxs("div", { className: "space-y-3", children: [shouldShowToolbar ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [showGlobalFilter ? (_jsx("input", { value: currentGlobalFilter, onChange: (event) => commitFilters(currentFilters, event.target.value), placeholder: globalFilterLabel, className: "min-w-[220px] flex-1 rounded-md border border-[rgb(var(--sg-border))] bg-white px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-[rgb(var(--sg-ring))]" })) : null, showClearFiltersButton ? (_jsx(SgButton, { size: "sm", appearance: "outline", onClick: clearFilters, children: clearFiltersLabel })) : null] })) : null, _jsx("div", { className: "relative", children: _jsx("div", { className: "overflow-x-auto rounded-lg border border-[rgb(var(--sg-border))] bg-white", children: _jsxs("table", { id: id, className: cn("min-w-full border-collapse text-sm", tableClassName), children: [_jsxs("thead", { children: [_jsx("tr", { className: "bg-[rgb(var(--sg-primary-50))]", children: visibleColumns.map((column, columnIndex) => {
383
+ return (_jsx("div", { className: className, style: style, children: _jsx(SgGroupBox, { ...groupBoxProps, title: resolvedTitle, children: _jsxs("div", { className: "space-y-3", children: [shouldShowToolbar ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [showGlobalFilter ? (_jsx("input", { value: currentGlobalFilter, onChange: (event) => commitFilters(currentFilters, event.target.value), placeholder: globalFilterLabel, className: "min-w-[220px] flex-1 rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-input-bg,var(--sg-surface)))] px-3 py-2 text-sm text-[rgb(var(--sg-input-fg,var(--sg-text)))] placeholder:text-[rgb(var(--sg-input-placeholder,var(--sg-muted)))] outline-none focus:ring-2 focus:ring-[rgb(var(--sg-ring))]" })) : null, showClearFiltersButton ? (_jsx(SgButton, { size: "sm", appearance: "outline", onClick: clearFilters, children: clearFiltersLabel })) : null] })) : null, _jsx("div", { className: "relative", children: _jsx("div", { className: "overflow-x-auto rounded-lg border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-surface))]", children: _jsxs("table", { id: id, className: cn("min-w-full border-collapse text-sm", tableClassName), children: [_jsxs("thead", { children: [_jsx("tr", { className: "bg-[rgb(var(--sg-primary-50))]", children: visibleColumns.map((column, columnIndex) => {
384
384
  const sortCandidate = column.sortField ?? column.field;
385
385
  const isSorted = Boolean(sortCandidate) && sortCandidate === currentSortField;
386
386
  const sortIcon = !column.sortable
@@ -403,7 +403,7 @@ function SgDatatableBase(props, imperativeRef) {
403
403
  };
404
404
  const normalized = normalizeFilters(nextFilters);
405
405
  commitFilters(normalized, currentGlobalFilter);
406
- }, placeholder: column.filterPlaceholder ?? `Filter ${String(column.header ?? "")}`, className: "w-full rounded-md border border-[rgb(var(--sg-border))] bg-white px-2 py-1 text-xs outline-none focus:ring-2 focus:ring-[rgb(var(--sg-ring))]" })) : null }, `filter-${column.field ?? columnIndex}`));
406
+ }, placeholder: column.filterPlaceholder ?? `Filter ${String(column.header ?? "")}`, className: "w-full rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-input-bg,var(--sg-surface)))] px-2 py-1 text-xs text-[rgb(var(--sg-input-fg,var(--sg-text)))] placeholder:text-[rgb(var(--sg-input-placeholder,var(--sg-muted)))] outline-none focus:ring-2 focus:ring-[rgb(var(--sg-ring))]" })) : null }, `filter-${column.field ?? columnIndex}`));
407
407
  }) })) : null] }), _jsx("tbody", { children: loading ? (_jsx("tr", { children: _jsx("td", { colSpan: Math.max(1, visibleColumns.length), className: "px-4 py-6 text-center text-sm text-[rgb(var(--sg-muted))]", children: loadingLabel }) })) : pagedRows.length === 0 ? (_jsx("tr", { children: _jsx("td", { colSpan: Math.max(1, visibleColumns.length), className: "px-4 py-6 text-center text-sm text-[rgb(var(--sg-muted))]", children: emptyLabel }) })) : (pagedRows.map((rowData, rowIndex) => {
408
408
  const absoluteRowIndex = safeFirst + rowIndex;
409
409
  const selected = isRowSelected(rowData);
@@ -436,6 +436,6 @@ function SgDatatableBase(props, imperativeRef) {
436
436
  }) }) })) : null] }) }) }), paginator ? (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(SgButton, { size: "sm", appearance: "outline", disabled: currentPage <= 1, onClick: () => goToPage(currentPage - 1), children: prevLabel }), pageWindow.map((pageNumber) => (_jsx(SgButton, { size: "sm", appearance: pageNumber === currentPage ? "solid" : "outline", onClick: () => goToPage(pageNumber), children: String(pageNumber) }, `page-${pageNumber}`))), _jsx(SgButton, { size: "sm", appearance: "outline", disabled: currentPage >= pageCount, onClick: () => goToPage(currentPage + 1), children: nextLabel }), _jsx("span", { className: "min-w-[180px] text-xs text-[rgb(var(--sg-muted))] md:ml-auto", children: pageReport }), rowsPerPageOptions && rowsPerPageOptions.length > 0 ? (_jsxs("label", { className: "ml-auto inline-flex items-center gap-2 text-xs text-[rgb(var(--sg-muted))] md:ml-0", children: [_jsx("span", { children: rowsPerPageLabel }), _jsx("select", { value: currentRows, onChange: (event) => {
437
437
  const nextRows = Number(event.target.value) || currentRows;
438
438
  commitPage(0, nextRows);
439
- }, className: "rounded-md border border-[rgb(var(--sg-border))] bg-white px-2 py-1 text-xs", children: rowsPerPageOptions.map((option) => (_jsx("option", { value: option, children: option }, option))) })] })) : null] })) : null] }) }) }));
439
+ }, className: "rounded-md border border-[rgb(var(--sg-border))] bg-[rgb(var(--sg-input-bg,var(--sg-surface)))] px-2 py-1 text-xs text-[rgb(var(--sg-input-fg,var(--sg-text)))]", children: rowsPerPageOptions.map((option) => (_jsx("option", { value: option, children: option }, option))) })] })) : null] })) : null] }) }) }));
440
440
  }
441
441
  export const SgDatatable = React.forwardRef(SgDatatableBase);
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputCurrency.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCurrency.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAGV,WAAW,EACX,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,MAAM,MAA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BAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAuD1D;AAGD,eAAO,MAAM,cAAc,wBAAkB,CAAC;AAC9C,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC"}
@@ -407,14 +407,16 @@ function SgInputCurrencyBase(props) {
407
407
  const hasSuffix = canShowClear || iconButtonsCount > 0;
408
408
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
409
409
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
410
- const baseClass = "peer h-11 w-full rounded-md text-sm placeholder-transparent focus:outline-none text-right";
410
+ const baseClass = "peer h-11 w-full rounded-md text-sm text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] placeholder-transparent disabled:text-[var(--sg-input-disabled-fg,hsl(var(--muted-foreground)))] disabled:bg-[var(--sg-input-disabled-bg,hsl(var(--muted)))] focus:outline-none text-right";
411
411
  const hasError = Boolean(props.error ?? internalError);
412
412
  const borderClass = (props.withBorder ?? true) || hasError
413
413
  ? hasError
414
414
  ? "border border-[hsl(var(--destructive))] shadow-sm focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
415
415
  : "border border-border shadow-sm focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]"
416
416
  : "border border-transparent";
417
- const bgClass = props.filled ? "bg-muted/40" : "bg-white";
417
+ const bgClass = props.filled
418
+ ? "bg-muted/40"
419
+ : "bg-[var(--sg-input-bg,hsl(var(--background)))]";
418
420
  const finalClass = [
419
421
  baseClass,
420
422
  borderClass,
@@ -452,7 +454,7 @@ function SgInputCurrencyBase(props) {
452
454
  ...(suffixText ? { borderTopRightRadius: 0, borderBottomRightRadius: 0, borderRightWidth: 0 } : {}),
453
455
  ...(inputProps.style ?? {})
454
456
  }, inputMode: props.textInputType ?? "decimal", readOnly: props.readOnly, disabled: props.enabled === false, ...restInputProps, ref: mergeRefs(inputRef, inputProps?.ref), onKeyDown: handleKeyDown, onChange: handleChange, onPaste: handlePaste, onBlur: handleBlur, onFocus: handleFocus }), suffixText ? (_jsx("span", { ref: suffixRef, className: "pointer-events-none absolute right-0 top-0 z-10 flex h-11 items-center rounded-r-md border border-border bg-muted/40 px-3 text-xs leading-none text-foreground/70", children: suffixText })) : null, _jsxs("label", { htmlFor: props.id, className: [
455
- "absolute bg-white px-1 transition-all",
457
+ "absolute bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 transition-all",
456
458
  isFilled
457
459
  ? "-top-2 left-3 text-xs"
458
460
  : `top-3 text-sm ${props.prefixIcon ? "left-10" : "left-3"}`,
@@ -110,7 +110,7 @@ export function SgInputDate(props) {
110
110
  : props.elevation === "lg"
111
111
  ? "shadow-lg"
112
112
  : "shadow-sm";
113
- const baseClass = "peer h-11 w-full rounded-md bg-white pl-3 pr-7 py-2.5 text-sm placeholder-transparent focus:outline-none";
113
+ const baseClass = "peer h-11 w-full rounded-md bg-[var(--sg-input-bg,hsl(var(--background)))] text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] pl-3 pr-7 py-2.5 text-sm placeholder-transparent focus:outline-none";
114
114
  const borderClass = hasError
115
115
  ? "border border-[hsl(var(--destructive))] focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
116
116
  : "border border-border focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]";
@@ -121,7 +121,7 @@ export function SgInputDate(props) {
121
121
  cursor: pointer;
122
122
  }
123
123
  ` }), showStaticLabel && labelText ? (_jsx("label", { htmlFor: rest.id, className: [
124
- "pointer-events-none absolute left-3 top-0 z-10 -translate-y-1/2 bg-white px-1 text-[11px] font-medium leading-none",
124
+ "pointer-events-none absolute left-3 top-0 z-10 -translate-y-1/2 bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 text-[11px] font-medium leading-none",
125
125
  hasError ? "text-[hsl(var(--destructive))]" : "text-foreground/70"
126
126
  ].join(" "), children: labelText })) : null, _jsx(SgInputText, { ...rest, type: "date", error: error ?? internalError ?? undefined, inputProps: mergedInputProps, className: inputClassName, labelClassName: showStaticLabel ? "sr-only" : undefined })] }));
127
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputNumber.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputNumber.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAGV,WAAW,EACX,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAA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,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACtC,GAAG,aAAa,CAAC;AA4lBlB,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAuDtD"}
@@ -355,8 +355,10 @@ function SgInputNumberBase(props) {
355
355
  const hasSuffix = canShowClear || iconButtonsCount > 0;
356
356
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
357
357
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
358
- const placeholderClass = isFloatLabel ? "placeholder-transparent" : "placeholder:text-foreground/50";
359
- const baseClass = `peer h-11 w-full rounded-md text-sm focus:outline-none text-right ${placeholderClass}`;
358
+ const placeholderClass = isFloatLabel
359
+ ? "placeholder-transparent"
360
+ : "placeholder:text-[var(--sg-input-placeholder,hsl(var(--muted-foreground)))]";
361
+ const baseClass = `peer h-11 w-full rounded-md text-sm text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] disabled:text-[var(--sg-input-disabled-fg,hsl(var(--muted-foreground)))] disabled:bg-[var(--sg-input-disabled-bg,hsl(var(--muted)))] focus:outline-none text-right ${placeholderClass}`;
360
362
  const hasError = Boolean(props.error ?? internalError);
361
363
  const elevationClass = props.elevation === "none"
362
364
  ? ""
@@ -370,7 +372,9 @@ function SgInputNumberBase(props) {
370
372
  ? "border border-[hsl(var(--destructive))] focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
371
373
  : "border border-border focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]"
372
374
  : "border border-transparent";
373
- const bgClass = props.filled ? "bg-muted/40" : "bg-white";
375
+ const bgClass = props.filled
376
+ ? "bg-muted/40"
377
+ : "bg-[var(--sg-input-bg,hsl(var(--background)))]";
374
378
  const finalClass = [
375
379
  baseClass,
376
380
  borderClass,
@@ -428,7 +432,7 @@ function SgInputNumberBase(props) {
428
432
  ...(props.suffixText ? { borderTopRightRadius: 0, borderBottomRightRadius: 0, borderRightWidth: 0 } : {}),
429
433
  ...(inputProps.style ?? {})
430
434
  }, inputMode: props.textInputType ?? "decimal", readOnly: props.readOnly, disabled: props.enabled === false, ...restInputProps, ref: mergeRefs(inputRef, inputProps?.ref), onKeyDown: handleKeyDown, onChange: handleChange, onPaste: handlePaste, onBlur: handleBlur, onFocus: handleFocus }), props.suffixText ? (_jsx("span", { ref: suffixRef, className: "pointer-events-none absolute right-0 top-0 z-10 flex h-11 items-center rounded-r-md border border-border bg-muted/40 px-3 text-xs leading-none text-foreground/70", children: props.suffixText })) : null, isFloatLabel ? (_jsxs("label", { htmlFor: props.id, className: [
431
- "absolute bg-white px-1 transition-all",
435
+ "absolute bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 transition-all",
432
436
  isFilled
433
437
  ? "-top-2 left-3 text-xs"
434
438
  : `top-3 text-sm ${props.prefixIcon ? "left-10" : "left-3"}`,
@@ -409,7 +409,7 @@ const SgInputOTPBase = React.forwardRef(function SgInputOTPBase(props, ref) {
409
409
  const isDisabled = enabled === false || Boolean(inputDisabled);
410
410
  const isReadOnly = readOnly || Boolean(inputReadOnly);
411
411
  const mergedSlotClass = [
412
- "h-12 w-11 border bg-white px-0 text-center text-base font-medium shadow-sm outline-none transition-all",
412
+ "h-12 w-11 border bg-[var(--sg-input-bg,hsl(var(--background)))] text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] px-0 text-center text-base font-medium shadow-sm outline-none transition-all",
413
413
  hasError
414
414
  ? "border-[hsl(var(--destructive))] focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
415
415
  : "border-border focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]",
@@ -76,18 +76,18 @@ function SgInputSelectBase(props) {
76
76
  };
77
77
  const alwaysFloat = props.alwaysFloat ?? (props.selectProps?.["data-floating"] === "always");
78
78
  return (_jsxs("div", { children: [_jsxs("div", { className: "relative", children: [alwaysFloat ? (_jsx("label", { htmlFor: props.id, className: [
79
- "pointer-events-none absolute left-3 top-0 z-10 -translate-y-1/2 bg-white px-1 text-[11px] font-medium leading-none",
79
+ "pointer-events-none absolute left-3 top-0 z-10 -translate-y-1/2 bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 text-[11px] font-medium leading-none",
80
80
  props.error ? "text-[hsl(var(--destructive))]" : "text-foreground/70"
81
81
  ].join(" "), children: props.label })) : null, (() => {
82
82
  const hasError = Boolean(props.error);
83
- const baseClass = "peer h-11 w-full rounded-md bg-white px-3 pt-4 text-sm shadow-sm focus:outline-none";
83
+ const baseClass = "peer h-11 w-full rounded-md bg-[var(--sg-input-bg,hsl(var(--background)))] text-[var(--sg-input-fg,hsl(var(--foreground)))] px-3 pt-4 text-sm shadow-sm focus:outline-none";
84
84
  const borderClass = hasError
85
85
  ? "border border-[hsl(var(--destructive))] focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
86
86
  : "border border-border focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]";
87
87
  const resolvedClassName = props.className ?? [baseClass, borderClass].join(" ");
88
88
  return (_jsxs("select", { id: props.id, className: resolvedClassName, ...props.selectProps, ref: setRefs, onChange: handleChange, onBlur: handleBlur, children: [_jsx("option", { value: "", children: "Selecione" }), props.options.map((opt) => (_jsx("option", { value: opt.value, children: opt.label }, opt.value)))] }));
89
89
  })(), alwaysFloat ? (_jsx("label", { htmlFor: props.id, className: "sr-only", children: props.label })) : (_jsx("label", { htmlFor: props.id, className: [
90
- "absolute left-3 bg-white px-1 transition-all",
90
+ "absolute left-3 bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 transition-all",
91
91
  isFilled ? "-top-2 text-xs" : "top-3 text-sm",
92
92
  props.error ? "text-[hsl(var(--destructive))]" : isFilled ? "text-[hsl(var(--primary))]" : "text-foreground/60",
93
93
  props.error
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputText.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputText.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAGV,WAAW,EACX,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;QAC1D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;K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AAI,CAAC;IAChD,QAAQ,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACtC,GAAG,aAAa,CAAC;AAydlB,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA8DlD"}
@@ -242,8 +242,10 @@ function SgInputTextBase(props) {
242
242
  const hasSuffix = canShowClear || (props.iconButtons?.length ?? 0) > 0;
243
243
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
244
244
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
245
- const placeholderClass = isFloatLabel ? "placeholder-transparent" : "placeholder:text-foreground/50";
246
- const baseClass = `peer h-11 w-full rounded-md text-sm focus:outline-none ${placeholderClass}`;
245
+ const placeholderClass = isFloatLabel
246
+ ? "placeholder-transparent"
247
+ : "placeholder:text-[var(--sg-input-placeholder,hsl(var(--muted-foreground)))]";
248
+ const baseClass = `peer h-11 w-full rounded-md text-sm text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] disabled:text-[var(--sg-input-disabled-fg,hsl(var(--muted-foreground)))] disabled:bg-[var(--sg-input-disabled-bg,hsl(var(--muted)))] focus:outline-none ${placeholderClass}`;
247
249
  const hasError = Boolean(props.error ?? internalError);
248
250
  const elevationClass = props.elevation === "none"
249
251
  ? ""
@@ -257,7 +259,9 @@ function SgInputTextBase(props) {
257
259
  ? "border border-[hsl(var(--destructive))] focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
258
260
  : "border border-border focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]"
259
261
  : "border border-transparent";
260
- const bgClass = props.filled ? "bg-muted/40" : "bg-white";
262
+ const bgClass = props.filled
263
+ ? "bg-muted/40"
264
+ : "bg-[var(--sg-input-bg,hsl(var(--background)))]";
261
265
  const finalClass = [
262
266
  baseClass,
263
267
  borderClass,
@@ -312,7 +316,7 @@ function SgInputTextBase(props) {
312
316
  ...(suffixText ? { borderTopRightRadius: 0, borderBottomRightRadius: 0, borderRightWidth: 0 } : {}),
313
317
  ...(resolvedInputProps.style ?? {})
314
318
  }, maxLength: props.maxLength, readOnly: props.readOnly, disabled: props.enabled === false, inputMode: props.textInputType ?? resolvedInputProps.inputMode, ...resolvedInputProps, ref: setRefs, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus }), suffixText ? (_jsx("span", { ref: suffixRef, className: "pointer-events-none absolute right-0 top-0 z-10 flex h-11 items-center rounded-r-md border border-border bg-muted/40 px-3 text-xs leading-none text-foreground/70", children: suffixText })) : null, isFloatLabel ? (_jsxs("label", { htmlFor: props.id, className: [
315
- "absolute bg-white px-1 transition-all",
319
+ "absolute bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 transition-all",
316
320
  isFilled
317
321
  ? "-top-2 left-3 text-xs"
318
322
  : `top-3 text-sm ${props.prefixIcon ? "left-10" : "left-3"}`,
@@ -1 +1 @@
1
- {"version":3,"file":"SgInputTextArea.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputTextArea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG5C,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MA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C;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD,GAAG,aAAa,CAAC;AAqVlB,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,2CAwBpE"}
@@ -164,8 +164,10 @@ function SgInputTextAreaBase(props) {
164
164
  const hasSuffix = canShowClear;
165
165
  const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
166
166
  const paddingRight = hasSuffix ? "pr-10" : "pr-3";
167
- const placeholderClass = isFloatLabel ? "placeholder-transparent" : "placeholder:text-foreground/50";
168
- const baseClass = `peer w-full rounded-md text-sm focus:outline-none ${placeholderClass}`;
167
+ const placeholderClass = isFloatLabel
168
+ ? "placeholder-transparent"
169
+ : "placeholder:text-[var(--sg-input-placeholder,hsl(var(--muted-foreground)))]";
170
+ const baseClass = `peer w-full rounded-md text-sm text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] disabled:text-[var(--sg-input-disabled-fg,hsl(var(--muted-foreground)))] disabled:bg-[var(--sg-input-disabled-bg,hsl(var(--muted)))] focus:outline-none ${placeholderClass}`;
169
171
  const hasError = Boolean(props.error ?? internalError);
170
172
  const elevationClass = props.elevation === "none"
171
173
  ? ""
@@ -179,7 +181,9 @@ function SgInputTextAreaBase(props) {
179
181
  ? "border border-[hsl(var(--destructive))] focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
180
182
  : "border border-border focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]"
181
183
  : "border border-transparent";
182
- const bgClass = props.filled ? "bg-muted/40" : "bg-white";
184
+ const bgClass = props.filled
185
+ ? "bg-muted/40"
186
+ : "bg-[var(--sg-input-bg,hsl(var(--background)))]";
183
187
  const finalClass = [
184
188
  baseClass,
185
189
  borderClass,
@@ -226,7 +230,7 @@ function SgInputTextAreaBase(props) {
226
230
  ? { ["--sg-input-label-width"]: resolvedLabelWidth }
227
231
  : undefined;
228
232
  const fieldNode = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative", children: [props.prefixIcon ? (_jsx("span", { className: "pointer-events-none absolute left-3 top-3 text-foreground/60", children: props.prefixIcon })) : null, _jsx("textarea", { id: props.id, placeholder: placeholder, className: props.className ?? finalClass, style: textareaStyle, maxLength: props.maxLength, rows: props.maxLines ?? 2, readOnly: props.enabled === false ? true : textareaProps.readOnly, disabled: props.enabled === false, ...textareaProps, ref: setRefs, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus }), isFloatLabel ? (_jsx("label", { htmlFor: props.id, className: [
229
- "absolute left-3 bg-white px-1 transition-all",
233
+ "absolute left-3 bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 transition-all",
230
234
  isFilled ? "-top-2 text-xs" : "top-3 text-sm",
231
235
  hasError ? "text-[hsl(var(--destructive))]" : isFilled ? "text-[hsl(var(--primary))]" : "text-foreground/60",
232
236
  hasError