@seedgrid/fe-components 2026.3.5 → 2026.3.11

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 (122) hide show
  1. package/dist/buttons/SgFloatActionButton.d.ts +2 -3
  2. package/dist/buttons/SgFloatActionButton.d.ts.map +1 -1
  3. package/dist/buttons/SgFloatActionButton.js +3 -3
  4. package/dist/buttons/SgSplitButton.d.ts +1 -0
  5. package/dist/buttons/SgSplitButton.d.ts.map +1 -1
  6. package/dist/buttons/SgSplitButton.js +2 -2
  7. package/dist/commons/SgBadge.d.ts +2 -1
  8. package/dist/commons/SgBadge.d.ts.map +1 -1
  9. package/dist/commons/SgBadge.js +8 -7
  10. package/dist/commons/SgBadgeOverlay.d.ts +1 -0
  11. package/dist/commons/SgBadgeOverlay.d.ts.map +1 -1
  12. package/dist/commons/SgBadgeOverlay.js +2 -2
  13. package/dist/commons/SgToastHost.d.ts +17 -0
  14. package/dist/commons/SgToastHost.d.ts.map +1 -0
  15. package/dist/commons/SgToastHost.js +45 -0
  16. package/dist/commons/SgToaster.d.ts +3 -1
  17. package/dist/commons/SgToaster.d.ts.map +1 -1
  18. package/dist/commons/SgToaster.js +13 -0
  19. package/dist/commons/sgToastHostRegistry.d.ts +7 -0
  20. package/dist/commons/sgToastHostRegistry.d.ts.map +1 -0
  21. package/dist/commons/sgToastHostRegistry.js +41 -0
  22. package/dist/digits/segment-digit/SgSegmentDigit.d.ts +15 -0
  23. package/dist/digits/segment-digit/SgSegmentDigit.d.ts.map +1 -0
  24. package/dist/digits/segment-digit/SgSegmentDigit.js +96 -0
  25. package/dist/digits/segment-digit/index.d.ts +3 -0
  26. package/dist/digits/segment-digit/index.d.ts.map +1 -0
  27. package/dist/digits/segment-digit/index.js +1 -0
  28. package/dist/digits/seven-segment-digit/SgSevenSegmentDigit.d.ts +36 -0
  29. package/dist/digits/seven-segment-digit/SgSevenSegmentDigit.d.ts.map +1 -0
  30. package/dist/digits/seven-segment-digit/SgSevenSegmentDigit.js +123 -0
  31. package/dist/digits/seven-segment-digit/index.d.ts +3 -0
  32. package/dist/digits/seven-segment-digit/index.d.ts.map +1 -0
  33. package/dist/digits/seven-segment-digit/index.js +1 -0
  34. package/dist/gadgets/calendar/SgCalendar.d.ts +29 -0
  35. package/dist/gadgets/calendar/SgCalendar.d.ts.map +1 -0
  36. package/dist/gadgets/calendar/SgCalendar.js +248 -0
  37. package/dist/gadgets/calendar/index.d.ts +3 -0
  38. package/dist/gadgets/calendar/index.d.ts.map +1 -0
  39. package/dist/gadgets/calendar/index.js +1 -0
  40. package/dist/gadgets/clock/SgClock.d.ts +6 -2
  41. package/dist/gadgets/clock/SgClock.d.ts.map +1 -1
  42. package/dist/gadgets/clock/SgClock.js +84 -125
  43. package/dist/gadgets/string-animator/SgStringAnimator.d.ts +1 -1
  44. package/dist/gadgets/string-animator/SgStringAnimator.d.ts.map +1 -1
  45. package/dist/gadgets/string-animator/SgStringAnimator.js +1 -1
  46. package/dist/i18n/en-US.d.ts.map +1 -1
  47. package/dist/i18n/en-US.js +26 -1
  48. package/dist/i18n/es.d.ts.map +1 -1
  49. package/dist/i18n/es.js +26 -1
  50. package/dist/i18n/pt-BR.d.ts.map +1 -1
  51. package/dist/i18n/pt-BR.js +26 -1
  52. package/dist/i18n/pt-PT.d.ts.map +1 -1
  53. package/dist/i18n/pt-PT.js +26 -1
  54. package/dist/index.d.ts +22 -4
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +10 -1
  57. package/dist/inputs/SgCheckboxGroup.d.ts +46 -0
  58. package/dist/inputs/SgCheckboxGroup.d.ts.map +1 -0
  59. package/dist/inputs/SgCheckboxGroup.js +158 -0
  60. package/dist/inputs/SgDatatable.d.ts +104 -0
  61. package/dist/inputs/SgDatatable.d.ts.map +1 -0
  62. package/dist/inputs/SgDatatable.js +441 -0
  63. package/dist/inputs/{SgCurrencyEdit.d.ts → SgInputCurrency.d.ts} +5 -3
  64. package/dist/inputs/SgInputCurrency.d.ts.map +1 -0
  65. package/dist/inputs/{SgCurrencyEdit.js → SgInputCurrency.js} +7 -5
  66. package/dist/inputs/SgOrderList.d.ts +52 -0
  67. package/dist/inputs/SgOrderList.d.ts.map +1 -0
  68. package/dist/inputs/SgOrderList.js +316 -0
  69. package/dist/inputs/SgPickList.d.ts +71 -0
  70. package/dist/inputs/SgPickList.d.ts.map +1 -0
  71. package/dist/inputs/SgPickList.js +362 -0
  72. package/dist/inputs/SgRadioGroup.d.ts +1 -2
  73. package/dist/inputs/SgRadioGroup.d.ts.map +1 -1
  74. package/dist/inputs/SgRadioGroup.js +5 -49
  75. package/dist/inputs/SgRating.d.ts +2 -0
  76. package/dist/inputs/SgRating.d.ts.map +1 -1
  77. package/dist/inputs/SgRating.js +2 -2
  78. package/dist/inputs/SgTextEditor.d.ts +2 -0
  79. package/dist/inputs/SgTextEditor.d.ts.map +1 -1
  80. package/dist/inputs/SgTextEditor.js +2 -2
  81. package/dist/layout/SgCard.d.ts +13 -1
  82. package/dist/layout/SgCard.d.ts.map +1 -1
  83. package/dist/layout/SgCard.js +231 -15
  84. package/dist/layout/SgCarousel.d.ts +2 -0
  85. package/dist/layout/SgCarousel.d.ts.map +1 -1
  86. package/dist/layout/SgCarousel.js +2 -2
  87. package/dist/layout/SgDockLayout.d.ts +1 -0
  88. package/dist/layout/SgDockLayout.d.ts.map +1 -1
  89. package/dist/layout/SgDockLayout.js +2 -2
  90. package/dist/layout/SgDockZone.d.ts +1 -0
  91. package/dist/layout/SgDockZone.d.ts.map +1 -1
  92. package/dist/layout/SgDockZone.js +2 -2
  93. package/dist/layout/SgGroupBox.d.ts +1 -0
  94. package/dist/layout/SgGroupBox.d.ts.map +1 -1
  95. package/dist/layout/SgGroupBox.js +3 -2
  96. package/dist/layout/SgMenu.d.ts +2 -2
  97. package/dist/layout/SgMenu.d.ts.map +1 -1
  98. package/dist/layout/SgMenu.js +22 -22
  99. package/dist/layout/SgPageControl.d.ts +2 -1
  100. package/dist/layout/SgPageControl.d.ts.map +1 -1
  101. package/dist/layout/SgPageControl.js +4 -4
  102. package/dist/layout/SgToolBar.d.ts +2 -0
  103. package/dist/layout/SgToolBar.d.ts.map +1 -1
  104. package/dist/layout/SgToolBar.js +4 -3
  105. package/dist/layout/SgTreeView.d.ts +1 -0
  106. package/dist/layout/SgTreeView.d.ts.map +1 -1
  107. package/dist/layout/SgTreeView.js +2 -2
  108. package/dist/others/SgPlayground.d.ts +2 -0
  109. package/dist/others/SgPlayground.d.ts.map +1 -1
  110. package/dist/others/SgPlayground.js +4 -4
  111. package/dist/overlay/SgConfirmationDialog.d.ts +34 -0
  112. package/dist/overlay/SgConfirmationDialog.d.ts.map +1 -0
  113. package/dist/overlay/SgConfirmationDialog.js +81 -0
  114. package/dist/overlay/SgDialog.d.ts +6 -0
  115. package/dist/overlay/SgDialog.d.ts.map +1 -1
  116. package/dist/overlay/SgDialog.js +28 -3
  117. package/dist/sandbox.cjs +100 -82
  118. package/dist/wizard/SgWizard.d.ts +2 -0
  119. package/dist/wizard/SgWizard.d.ts.map +1 -1
  120. package/dist/wizard/SgWizard.js +2 -2
  121. package/package.json +1 -1
  122. package/dist/inputs/SgCurrencyEdit.d.ts.map +0 -1
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  export type FABPosition = "left-top" | "left-center" | "left-bottom" | "center-top" | "center-bottom" | "right-top" | "right-center" | "right-bottom";
3
3
  export type FABSeverity = "primary" | "secondary" | "success" | "info" | "warning" | "help" | "danger" | "plain";
4
- export type FABVariant = FABSeverity;
5
4
  export type FABSize = "sm" | "md" | "lg";
6
5
  export type FABShape = "circle" | "rounded" | "square";
7
6
  export type FABElevation = "none" | "sm" | "md" | "lg";
@@ -13,7 +12,7 @@ export type SgFABAction = {
13
12
  label?: string;
14
13
  onClick?: () => void;
15
14
  severity?: FABSeverity;
16
- variant?: FABSeverity;
15
+ floatActionButtonStyle?: FABSeverity;
17
16
  disabled?: boolean;
18
17
  };
19
18
  export type SgFloatActionButtonProps = {
@@ -30,7 +29,7 @@ export type SgFloatActionButtonProps = {
30
29
  enableDragDrop?: boolean;
31
30
  dragId?: string;
32
31
  severity?: FABSeverity;
33
- variant?: FABSeverity;
32
+ floatActionButtonStyle?: FABSeverity;
34
33
  color?: string;
35
34
  size?: FABSize;
36
35
  shape?: FABShape;
@@ -1 +1 @@
1
- {"version":3,"file":"SgFloatActionButton.d.ts","sourceRoot":"","sources":["../../src/buttons/SgFloatActionButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuC/B,MAAM,MAAM,WAAW,GACnB,UAAU,GAAG,aAAa,GAAG,aAAa,GAC1C,YAAY,GAAG,eAAe,GAC9B,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;AAElD,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,MAAM,GACN,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AACrC,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AACpF,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEnF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO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AAC,EAAE,YAAY,CAAC;IACzB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC7C,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA6NF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,2CAyhB5E;yBAzhBe,mBAAmB"}
@@ -214,7 +214,7 @@ export function SgFloatActionButton(props) {
214
214
  const i18n = useComponentsI18n();
215
215
  const hasEnvironmentProvider = useHasSgEnvironmentProvider();
216
216
  const { load: loadPersistedState, save: savePersistedState, clear: clearPersistedState } = useSgPersistence();
217
- const { hint, hintDelay = 300, icon, activeIcon, position = "right-bottom", offset, enableDragDrop = false, dragId, severity = "primary", variant, color, size = "md", shape = "circle", elevation = "md", disabled = false, loading = false, autoHideOnScroll = false, hideDirection = "down", animation = "scale", animationOn = "mount", animationDuration = 200, type = "linear", radius, transitionDelay = 30, actions, onClick, className, style, zIndex = 50, absolute = false, } = props;
217
+ const { hint, hintDelay = 300, icon, activeIcon, position = "right-bottom", offset, enableDragDrop = false, dragId, severity = "primary", floatActionButtonStyle, color, size = "md", shape = "circle", elevation = "md", disabled = false, loading = false, autoHideOnScroll = false, hideDirection = "down", animation = "scale", animationOn = "mount", animationDuration = 200, type = "linear", radius, transitionDelay = 30, actions, onClick, className, style, zIndex = 50, absolute = false, } = props;
218
218
  const hintPos = props.hintPosition ?? DEFAULT_HINT[position];
219
219
  const dir = props.direction ?? DEFAULT_DIR[position];
220
220
  const [mounted, setMounted] = React.useState(false);
@@ -512,7 +512,7 @@ export function SgFloatActionButton(props) {
512
512
  dragMoved.current = false;
513
513
  }, [clearStoredPosition, dragId]);
514
514
  /* colors */
515
- const resolvedSeverity = severity ?? variant ?? "primary";
515
+ const resolvedSeverity = severity ?? floatActionButtonStyle ?? "primary";
516
516
  const c = COLORS[resolvedSeverity];
517
517
  const bg = color ?? c.bg;
518
518
  const fg = color ? "white" : c.fg;
@@ -629,7 +629,7 @@ export function SgFloatActionButton(props) {
629
629
  handleContextMenu(event);
630
630
  }, children: [animation === "pulse" && (_jsx("style", { children: `@keyframes sg-fab-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}` })), actions?.map((a, i) => {
631
631
  const p = actPos[i] ?? { x: 0, y: 0 };
632
- const actionSeverity = a.severity ?? a.variant ?? "plain";
632
+ const actionSeverity = a.severity ?? a.floatActionButtonStyle ?? "plain";
633
633
  const ac = COLORS[actionSeverity];
634
634
  return (_jsx("div", { className: "absolute", style: {
635
635
  transform: open ? `translate(${p.x}px, ${p.y}px) scale(1)` : "translate(0,0) scale(0)",
@@ -26,6 +26,7 @@ export type SgSplitButtonProps = {
26
26
  items: SgSplitButtonItem[];
27
27
  customColors?: SgButtonCustomColors;
28
28
  className?: string;
29
+ style?: React.CSSProperties;
29
30
  };
30
31
  export declare const SgSplitButton: React.ForwardRefExoticComponent<SgSplitButtonProps & React.RefAttributes<HTMLDivElement>>;
31
32
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"SgSplitButton.d.ts","sourceRoot":"","sources":["../../src/buttons/SgSplitButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,KAAK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AC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAmBF,eAAO,MAAM,aAAa,2FAkIzB,CAAC"}
@@ -5,7 +5,7 @@ import { SgButton } from "./SgButton";
5
5
  function ChevronDown({ className }) {
6
6
  return (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m6 9 6 6 6-6" }) }));
7
7
  }
8
- export const SgSplitButton = React.forwardRef(({ label, leftIcon, severity = "primary", appearance = "solid", size = "md", shape = "default", elevation = "none", disabled = false, loading = false, onClick, items, customColors, className }, ref) => {
8
+ export const SgSplitButton = React.forwardRef(({ label, leftIcon, severity = "primary", appearance = "solid", size = "md", shape = "default", elevation = "none", disabled = false, loading = false, onClick, items, customColors, className, style }, ref) => {
9
9
  const [open, setOpen] = React.useState(false);
10
10
  const containerRef = React.useRef(null);
11
11
  const menuRef = React.useRef(null);
@@ -50,6 +50,6 @@ export const SgSplitButton = React.forwardRef(({ label, leftIcon, severity = "pr
50
50
  lg: { menu: "min-w-[180px]", item: "px-5 py-2.5", text: "text-base", iconSize: "size-5" }
51
51
  };
52
52
  const s = sizeClasses[size];
53
- return (_jsxs("div", { ref: containerRef, className: `relative inline-flex ${className ?? ""}`, children: [_jsx(SgButton, { severity: severity, appearance: appearance, size: size, shape: shape, elevation: elevation, disabled: disabled, loading: loading, leftIcon: leftIcon, onClick: onClick, customColors: customColors, className: "rounded-r-none", children: label }), _jsx(SgButton, { severity: severity, appearance: appearance, size: size, shape: shape, elevation: elevation, disabled: disabled || loading, leftIcon: _jsx(ChevronDown, { className: "size-4" }), onClick: toggle, customColors: customColors, className: `rounded-l-none ${dividerBorderClass}`, "aria-haspopup": "true", "aria-expanded": open }), open && (_jsx("div", { ref: menuRef, role: "menu", className: `absolute left-0 top-full z-50 mt-1 ${s.menu} overflow-hidden rounded-lg shadow-lg bg-background text-foreground border border-border`, children: items.map((item, i) => (_jsxs(React.Fragment, { children: [item.separator && i > 0 ? (_jsx("div", { className: "my-0.5 border-t border-border" })) : null, _jsxs("button", { role: "menuitem", type: "button", disabled: item.disabled, className: `flex w-full items-center gap-2 ${s.item} ${s.text} transition-colors hover:bg-muted/60 disabled:opacity-50 disabled:cursor-not-allowed`, onClick: () => handleItemClick(item), children: [item.icon ? _jsx("span", { className: `shrink-0 ${s.iconSize}`, children: item.icon }) : null, _jsx("span", { children: item.label })] })] }, i))) }))] }));
53
+ return (_jsxs("div", { ref: containerRef, className: `relative inline-flex ${className ?? ""}`, style: style, children: [_jsx(SgButton, { severity: severity, appearance: appearance, size: size, shape: shape, elevation: elevation, disabled: disabled, loading: loading, leftIcon: leftIcon, onClick: onClick, customColors: customColors, className: "rounded-r-none", children: label }), _jsx(SgButton, { severity: severity, appearance: appearance, size: size, shape: shape, elevation: elevation, disabled: disabled || loading, leftIcon: _jsx(ChevronDown, { className: "size-4" }), onClick: toggle, customColors: customColors, className: `rounded-l-none ${dividerBorderClass}`, "aria-haspopup": "true", "aria-expanded": open }), open && (_jsx("div", { ref: menuRef, role: "menu", className: `absolute left-0 top-full z-50 mt-1 ${s.menu} overflow-hidden rounded-lg shadow-lg bg-background text-foreground border border-border`, children: items.map((item, i) => (_jsxs(React.Fragment, { children: [item.separator && i > 0 ? (_jsx("div", { className: "my-0.5 border-t border-border" })) : null, _jsxs("button", { role: "menuitem", type: "button", disabled: item.disabled, className: `flex w-full items-center gap-2 ${s.item} ${s.text} transition-colors hover:bg-muted/60 disabled:opacity-50 disabled:cursor-not-allowed`, onClick: () => handleItemClick(item), children: [item.icon ? _jsx("span", { className: `shrink-0 ${s.iconSize}`, children: item.icon }) : null, _jsx("span", { children: item.label })] })] }, i))) }))] }));
54
54
  });
55
55
  SgSplitButton.displayName = "SgSplitButton";
@@ -22,7 +22,7 @@ export type SgBadgePartsClassName = {
22
22
  export type SgBadgeProps = {
23
23
  value?: React.ReactNode;
24
24
  severity?: SgBadgeSeverity;
25
- variant?: SgBadgeVariant;
25
+ badgeStyle?: SgBadgeVariant;
26
26
  size?: SgBadgeSize;
27
27
  rounded?: boolean;
28
28
  dot?: boolean;
@@ -41,6 +41,7 @@ export type SgBadgeProps = {
41
41
  hint?: string;
42
42
  customColors?: SgBadgeCustomColors;
43
43
  className?: string;
44
+ style?: React.CSSProperties;
44
45
  partsClassName?: SgBadgePartsClassName;
45
46
  "aria-label"?: string;
46
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SgBadge.d.ts","sourceRoot":"","sources":["../../src/commons/SgBadge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG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AAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AA0HF,wBAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,kDAmHpD;yBAnHe,OAAO"}
@@ -108,11 +108,12 @@ function getDisplayValue(value, max, showZero) {
108
108
  return value ?? null;
109
109
  }
110
110
  export function SgBadge(props) {
111
- const { value, severity = "primary", variant = "solid", size = "md", rounded = true, dot = false, pulse = false, max, showZero = true, leftIcon, rightIcon, removable = false, onRemove, removeAriaLabel = "Remover", autoRemove = false, onClick, disabled, title, hint, customColors, className, partsClassName, ...aria } = props;
111
+ const { value, severity = "primary", badgeStyle = "solid", size = "md", rounded = true, dot = false, pulse = false, max, showZero = true, leftIcon, rightIcon, removable = false, onRemove, removeAriaLabel = "Remover", autoRemove = false, onClick, disabled, title, hint, customColors, className, style, partsClassName, ...aria } = props;
112
112
  const displayValue = getDisplayValue(value, max, showZero);
113
113
  const [autoRemoved, setAutoRemoved] = React.useState(false);
114
+ const cssVars = buildVars(severity, customColors);
114
115
  if (dot) {
115
- return (_jsxs("span", { title: hint ?? title, className: cn("relative inline-flex items-center justify-center", partsClassName?.dot, className), style: buildVars(severity, customColors), ...aria, children: [pulse ? (_jsx("span", { className: "absolute inline-flex size-3 rounded-full bg-[var(--sg-badge-bg)] opacity-75 animate-ping" })) : null, _jsx("span", { className: "inline-flex size-2.5 rounded-full bg-[var(--sg-badge-bg)]" })] }));
116
+ return (_jsxs("span", { title: hint ?? title, className: cn("relative inline-flex items-center justify-center", partsClassName?.dot, className), style: { ...cssVars, ...style }, ...aria, children: [pulse ? (_jsx("span", { className: "absolute inline-flex size-3 rounded-full bg-[var(--sg-badge-bg)] opacity-75 animate-ping" })) : null, _jsx("span", { className: "inline-flex size-2.5 rounded-full bg-[var(--sg-badge-bg)]" })] }));
116
117
  }
117
118
  if (autoRemoved)
118
119
  return null;
@@ -120,18 +121,18 @@ export function SgBadge(props) {
120
121
  return null;
121
122
  const isButton = typeof onClick === "function";
122
123
  const Tag = isButton ? "button" : "span";
123
- const base = cn("inline-flex items-center gap-1.5 whitespace-nowrap font-medium", "transition-[color,background-color,border-color] duration-150", SIZE[size], rounded ? "rounded-full" : "rounded-md", variant === "solid"
124
+ const base = cn("inline-flex items-center gap-1.5 whitespace-nowrap font-medium", "transition-[color,background-color,border-color] duration-150", SIZE[size], rounded ? "rounded-full" : "rounded-md", badgeStyle === "solid"
124
125
  ? "bg-[var(--sg-badge-bg)] text-[var(--sg-badge-fg)] border border-[var(--sg-badge-border)]"
125
- : variant === "soft"
126
+ : badgeStyle === "soft"
126
127
  ? "bg-[var(--sg-badge-soft-bg)] text-[var(--sg-badge-soft-fg)] border border-transparent"
127
- : variant === "outline"
128
+ : badgeStyle === "outline"
128
129
  ? "bg-transparent text-[var(--sg-badge-bg)] border border-[var(--sg-badge-border)]"
129
- : "bg-transparent text-[var(--sg-badge-bg)] border border-transparent", variant === "ghost" || variant === "outline"
130
+ : "bg-transparent text-[var(--sg-badge-bg)] border border-transparent", badgeStyle === "ghost" || badgeStyle === "outline"
130
131
  ? "hover:bg-[var(--sg-badge-hover-bg)] hover:text-[var(--sg-badge-hover-fg)] hover:border-[var(--sg-badge-hover-border)]"
131
132
  : "", isButton
132
133
  ? cn("cursor-pointer select-none", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--sg-badge-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background", disabled ? "pointer-events-none opacity-50" : "")
133
134
  : "", className, partsClassName?.container);
134
- return (_jsxs(Tag, { type: isButton ? "button" : undefined, title: hint ?? title, onClick: disabled ? undefined : onClick, disabled: isButton ? disabled : undefined, style: buildVars(severity, customColors), className: base, role: isButton ? undefined : "status", ...aria, children: [leftIcon ? _jsx("span", { className: cn("inline-flex", ICON_SIZE[size]), children: leftIcon }) : null, displayValue !== null ? _jsx("span", { className: cn("inline-flex items-center", partsClassName?.label), children: displayValue }) : null, rightIcon ? _jsx("span", { className: cn("inline-flex", ICON_SIZE[size]), children: rightIcon }) : null, removable ? (_jsx("button", { type: "button", onClick: (e) => {
135
+ return (_jsxs(Tag, { type: isButton ? "button" : undefined, title: hint ?? title, onClick: disabled ? undefined : onClick, disabled: isButton ? disabled : undefined, style: { ...cssVars, ...style }, className: base, role: isButton ? undefined : "status", ...aria, children: [leftIcon ? _jsx("span", { className: cn("inline-flex", ICON_SIZE[size]), children: leftIcon }) : null, displayValue !== null ? _jsx("span", { className: cn("inline-flex items-center", partsClassName?.label), children: displayValue }) : null, rightIcon ? _jsx("span", { className: cn("inline-flex", ICON_SIZE[size]), children: rightIcon }) : null, removable ? (_jsx("button", { type: "button", onClick: (e) => {
135
136
  e.stopPropagation();
136
137
  if (autoRemove)
137
138
  setAutoRemoved(true);
@@ -5,6 +5,7 @@ export type SgBadgeOverlayProps = {
5
5
  badge: React.ReactNode;
6
6
  placement?: SgBadgeOverlayPlacement;
7
7
  className?: string;
8
+ style?: React.CSSProperties;
8
9
  };
9
10
  export declare function SgBadgeOverlay(props: Readonly<SgBadgeOverlayProps>): import("react/jsx-runtime").JSX.Element;
10
11
  export declare namespace SgBadgeOverlay {
@@ -1 +1 @@
1
- {"version":3,"file":"SgBadgeOverlay.d.ts","sourceRoot":"","sources":["../../src/commons/SgBadgeOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,OAAO,GACP,MAAM,GACN,KAAK,GACL,QAAQ,CAAC;AAEb,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,2CAmBlE;yBAnBe,cAAc"}
1
+ {"version":3,"file":"SgBadgeOverlay.d.ts","sourceRoot":"","sources":["../../src/commons/SgBadgeOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,OAAO,GACP,MAAM,GACN,KAAK,GACL,QAAQ,CAAC;AAEb,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,2CAmBlE;yBAnBe,cAAc"}
@@ -4,7 +4,7 @@ function cn(...parts) {
4
4
  return parts.filter(Boolean).join(" ");
5
5
  }
6
6
  export function SgBadgeOverlay(props) {
7
- const { children, badge, placement = "top-right", className } = props;
7
+ const { children, badge, placement = "top-right", className, style } = props;
8
8
  const pos = {
9
9
  "top-left": "left-0 top-0 -translate-x-1/3 -translate-y-1/3",
10
10
  "top-right": "right-0 top-0 translate-x-1/3 -translate-y-1/3",
@@ -15,6 +15,6 @@ export function SgBadgeOverlay(props) {
15
15
  top: "top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",
16
16
  bottom: "bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2"
17
17
  };
18
- return (_jsxs("span", { className: cn("relative inline-flex", className), children: [children, _jsx("span", { className: cn("absolute", pos[placement]), children: badge })] }));
18
+ return (_jsxs("span", { className: cn("relative inline-flex", className), style: style, children: [children, _jsx("span", { className: cn("absolute", pos[placement]), children: badge })] }));
19
19
  }
20
20
  SgBadgeOverlay.displayName = "SgBadgeOverlay";
@@ -0,0 +1,17 @@
1
+ import { type SgToasterProps } from "./SgToaster";
2
+ export type SgToastHostProps = SgToasterProps;
3
+ /**
4
+ * SgToastHost — marks the location where toasts will appear.
5
+ *
6
+ * Drop it anywhere in your tree. If multiple hosts exist simultaneously
7
+ * (e.g. one in a layout and one inside the page), the one deeper in the
8
+ * React tree (last to mount) takes priority. When that host unmounts the
9
+ * next most-recently-mounted host becomes active automatically.
10
+ *
11
+ * When any SgToastHost is present, SgToaster automatically defers to it
12
+ * and stops rendering, so both components can coexist without duplication.
13
+ *
14
+ * Accepts the same props as SgToaster (position, duration, richColors, etc.).
15
+ */
16
+ export declare function SgToastHost(props: SgToastHostProps): import("react/jsx-runtime").JSX.Element | null;
17
+ //# sourceMappingURL=SgToastHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SgToastHost.d.ts","sourceRoot":"","sources":["../../src/commons/SgToastHost.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAanF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kDAiClD"}
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { SgToaster, SgToasterHostContext } from "./SgToaster";
5
+ import { registerHost, unregisterHost, getActiveHostId, subscribeHostRegistry, nextHostId } from "./sgToastHostRegistry";
6
+ /**
7
+ * SgToastHost — marks the location where toasts will appear.
8
+ *
9
+ * Drop it anywhere in your tree. If multiple hosts exist simultaneously
10
+ * (e.g. one in a layout and one inside the page), the one deeper in the
11
+ * React tree (last to mount) takes priority. When that host unmounts the
12
+ * next most-recently-mounted host becomes active automatically.
13
+ *
14
+ * When any SgToastHost is present, SgToaster automatically defers to it
15
+ * and stops rendering, so both components can coexist without duplication.
16
+ *
17
+ * Accepts the same props as SgToaster (position, duration, richColors, etc.).
18
+ */
19
+ export function SgToastHost(props) {
20
+ // Stable ID across re-renders, generated once per component instance.
21
+ const idRef = React.useRef(null);
22
+ if (idRef.current === null) {
23
+ idRef.current = nextHostId();
24
+ }
25
+ const id = idRef.current;
26
+ // Start as inactive to avoid SSR hydration mismatches.
27
+ const [isActive, setIsActive] = React.useState(false);
28
+ // Register on mount, unregister on unmount.
29
+ React.useEffect(() => {
30
+ registerHost(id);
31
+ setIsActive(getActiveHostId() === id);
32
+ return () => {
33
+ unregisterHost(id);
34
+ };
35
+ }, [id]);
36
+ // React to other hosts registering / unregistering.
37
+ React.useEffect(() => {
38
+ return subscribeHostRegistry(() => {
39
+ setIsActive(getActiveHostId() === id);
40
+ });
41
+ }, [id]);
42
+ if (!isActive)
43
+ return null;
44
+ return (_jsx(SgToasterHostContext.Provider, { value: true, children: _jsx(SgToaster, { ...props }) }));
45
+ }
@@ -16,5 +16,7 @@ export type SgToasterProps = Omit<React.HTMLAttributes<HTMLDivElement>, "childre
16
16
  transparency?: number;
17
17
  customColors?: SgToasterCustomColors;
18
18
  };
19
- export declare function SgToaster(props: SgToasterProps): import("react/jsx-runtime").JSX.Element;
19
+ /** @internal used by SgToastHost to skip the host-presence check */
20
+ export declare const SgToasterHostContext: React.Context<boolean>;
21
+ export declare function SgToaster(props: SgToasterProps): import("react/jsx-runtime").JSX.Element | null;
20
22
  //# sourceMappingURL=SgToaster.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SgToaster.d.ts","sourceRoot":"","sources":["../../src/commons/SgToaster.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAMlF,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,UAAU,GACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,eAAe,CAAC;AAEpB,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,CACnD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC,CAAC;AAgGF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAkI9C"}
1
+ {"version":3,"file":"SgToaster.d.ts","sourceRoot":"","sources":["../../src/commons/SgToaster.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAOlF,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,UAAU,GACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,eAAe,CAAC;AAEpB,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,CACnD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC,CAAC;AAgGF,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,wBAA6B,CAAC;AAE/D,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,kDA6I9C"}
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { dismissSgToast, subscribeSgToasts } from "./SgToast";
5
+ import { hasAnyHost, subscribeHostRegistry } from "./sgToastHostRegistry";
5
6
  function cn(...parts) {
6
7
  return parts.filter(Boolean).join(" ");
7
8
  }
@@ -91,11 +92,21 @@ function resolveToastColors(type, richColors, customColors) {
91
92
  fg: custom?.fg ?? base.fg
92
93
  };
93
94
  }
95
+ /** @internal — used by SgToastHost to skip the host-presence check */
96
+ export const SgToasterHostContext = React.createContext(false);
94
97
  export function SgToaster(props) {
98
+ const renderedByHost = React.useContext(SgToasterHostContext);
95
99
  const { position = "top-right", duration = 4000, visibleToasts = 6, closeButton = true, richColors = true, transparency = 0, customColors, className, style, ...rest } = props;
96
100
  const [toasts, setToasts] = React.useState([]);
97
101
  const timersRef = React.useRef({});
102
+ const [hostPresent, setHostPresent] = React.useState(() => !renderedByHost && hasAnyHost());
98
103
  React.useEffect(() => subscribeSgToasts(setToasts), []);
104
+ React.useEffect(() => {
105
+ if (renderedByHost)
106
+ return;
107
+ setHostPresent(hasAnyHost());
108
+ return subscribeHostRegistry(() => setHostPresent(hasAnyHost()));
109
+ }, [renderedByHost]);
99
110
  const visible = React.useMemo(() => {
100
111
  if (visibleToasts <= 0) {
101
112
  return [];
@@ -137,6 +148,8 @@ export function SgToaster(props) {
137
148
  };
138
149
  }, []);
139
150
  const toastOpacity = 1 - clampTransparency(transparency) / 100;
151
+ if (hostPresent)
152
+ return null;
140
153
  return (_jsx("div", { className: cn("pointer-events-none fixed z-[1100] flex max-h-screen w-full flex-col gap-2 p-4 sm:w-auto", POSITION_CLASS[position], className), style: style, ...rest, children: visible.map((toast) => {
141
154
  const typeColors = resolveToastColors(toast.type, richColors, customColors);
142
155
  const canClose = toast.closeButton ?? closeButton;
@@ -0,0 +1,7 @@
1
+ export declare function registerHost(id: string): void;
2
+ export declare function unregisterHost(id: string): void;
3
+ export declare function getActiveHostId(): string | null;
4
+ export declare function hasAnyHost(): boolean;
5
+ export declare function subscribeHostRegistry(fn: () => void): () => void;
6
+ export declare function nextHostId(): string;
7
+ //# sourceMappingURL=sgToastHostRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sgToastHostRegistry.d.ts","sourceRoot":"","sources":["../../src/commons/sgToastHostRegistry.ts"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,QAKtC;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,QAMxC;AAED,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAKhE;AAED,wBAAgB,UAAU,IAAI,MAAM,CAGnC"}
@@ -0,0 +1,41 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Shared host registry — used by both SgToastHost and SgToaster.
3
+ //
4
+ // SgToastHost instances push/pop themselves onto this stack.
5
+ // SgToaster subscribes: if the stack is non-empty it yields to the active host.
6
+ // ---------------------------------------------------------------------------
7
+ let _counter = 0;
8
+ const _stack = [];
9
+ const _listeners = new Set();
10
+ function _notify() {
11
+ _listeners.forEach((fn) => fn());
12
+ }
13
+ export function registerHost(id) {
14
+ if (!_stack.includes(id)) {
15
+ _stack.push(id);
16
+ _notify();
17
+ }
18
+ }
19
+ export function unregisterHost(id) {
20
+ const i = _stack.indexOf(id);
21
+ if (i >= 0) {
22
+ _stack.splice(i, 1);
23
+ _notify();
24
+ }
25
+ }
26
+ export function getActiveHostId() {
27
+ return _stack[_stack.length - 1] ?? null;
28
+ }
29
+ export function hasAnyHost() {
30
+ return _stack.length > 0;
31
+ }
32
+ export function subscribeHostRegistry(fn) {
33
+ _listeners.add(fn);
34
+ return () => {
35
+ _listeners.delete(fn);
36
+ };
37
+ }
38
+ export function nextHostId() {
39
+ _counter += 1;
40
+ return `sg-toast-host-${_counter}`;
41
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ export type SgSegmentDigitProps = {
3
+ /** Character rendered by the component (first character is used). */
4
+ value: string;
5
+ /** Display height in pixels. */
6
+ size?: number;
7
+ /** Color of active segments. */
8
+ color?: string;
9
+ /** Additional classes on outer wrapper. */
10
+ className?: string;
11
+ /** Additional inline styles on outer wrapper. */
12
+ style?: React.CSSProperties;
13
+ };
14
+ export declare function SgSegmentDigit({ value, size, color, className, style }: Readonly<SgSegmentDigitProps>): import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=SgSegmentDigit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SgSegmentDigit.d.ts","sourceRoot":"","sources":["../../../src/digits/segment-digit/SgSegmentDigit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2F/B,MAAM,MAAM,mBAAmB,GAAG;IAChC,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,IAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,EACN,EAAE,QAAQ,CAAC,mBAAmB,CAAC,2CAkC/B"}
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ function cn(...parts) {
3
+ return parts.filter(Boolean).join(" ");
4
+ }
5
+ function round(n) {
6
+ return Math.round(n * 1000) / 1000;
7
+ }
8
+ const DIGIT_GLYPHS = {
9
+ "0": [
10
+ { x: 1, y: 0, w: 4, h: 1 },
11
+ { x: 5, y: 1, w: 1, h: 4 },
12
+ { x: 5, y: 5, w: 1, h: 4 },
13
+ { x: 1, y: 9, w: 4, h: 1 },
14
+ { x: 0, y: 5, w: 1, h: 4 },
15
+ { x: 0, y: 1, w: 1, h: 4 }
16
+ ],
17
+ "1": [
18
+ { x: 5, y: 1, w: 1, h: 4 },
19
+ { x: 5, y: 5, w: 1, h: 4 }
20
+ ],
21
+ "2": [
22
+ { x: 1, y: 0, w: 4, h: 1 },
23
+ { x: 5, y: 1, w: 1, h: 4 },
24
+ { x: 1, y: 4.5, w: 4, h: 1 },
25
+ { x: 0, y: 5, w: 1, h: 4 },
26
+ { x: 1, y: 9, w: 4, h: 1 }
27
+ ],
28
+ "3": [
29
+ { x: 1, y: 0, w: 4, h: 1 },
30
+ { x: 5, y: 1, w: 1, h: 4 },
31
+ { x: 1, y: 4.5, w: 4, h: 1 },
32
+ { x: 5, y: 5, w: 1, h: 4 },
33
+ { x: 1, y: 9, w: 4, h: 1 }
34
+ ],
35
+ "4": [
36
+ { x: 0, y: 1, w: 1, h: 4 },
37
+ { x: 5, y: 1, w: 1, h: 4 },
38
+ { x: 1, y: 4.5, w: 4, h: 1 },
39
+ { x: 5, y: 5, w: 1, h: 4 }
40
+ ],
41
+ "5": [
42
+ { x: 1, y: 0, w: 4, h: 1 },
43
+ { x: 0, y: 1, w: 1, h: 4 },
44
+ { x: 1, y: 4.5, w: 4, h: 1 },
45
+ { x: 5, y: 5, w: 1, h: 4 },
46
+ { x: 1, y: 9, w: 4, h: 1 }
47
+ ],
48
+ "6": [
49
+ { x: 1, y: 0, w: 4, h: 1 },
50
+ { x: 0, y: 1, w: 1, h: 4 },
51
+ { x: 1, y: 4.5, w: 4, h: 1 },
52
+ { x: 0, y: 5, w: 1, h: 4 },
53
+ { x: 5, y: 5, w: 1, h: 4 },
54
+ { x: 1, y: 9, w: 4, h: 1 }
55
+ ],
56
+ "7": [
57
+ { x: 1, y: 0, w: 4, h: 1 },
58
+ { x: 5, y: 1, w: 1, h: 4 },
59
+ { x: 5, y: 5, w: 1, h: 4 }
60
+ ],
61
+ "8": [
62
+ { x: 1, y: 0, w: 4, h: 1 },
63
+ { x: 5, y: 1, w: 1, h: 4 },
64
+ { x: 5, y: 5, w: 1, h: 4 },
65
+ { x: 1, y: 9, w: 4, h: 1 },
66
+ { x: 0, y: 5, w: 1, h: 4 },
67
+ { x: 0, y: 1, w: 1, h: 4 },
68
+ { x: 1, y: 4.5, w: 4, h: 1 }
69
+ ],
70
+ "9": [
71
+ { x: 1, y: 0, w: 4, h: 1 },
72
+ { x: 5, y: 1, w: 1, h: 4 },
73
+ { x: 5, y: 5, w: 1, h: 4 },
74
+ { x: 1, y: 9, w: 4, h: 1 },
75
+ { x: 0, y: 1, w: 1, h: 4 },
76
+ { x: 1, y: 4.5, w: 4, h: 1 }
77
+ ],
78
+ "-": [{ x: 1, y: 4.5, w: 4, h: 1 }],
79
+ " ": []
80
+ };
81
+ const COLON_GLYPH = [
82
+ { x: 1.5, y: 2, w: 1, h: 1 },
83
+ { x: 1.5, y: 7, w: 1, h: 1 }
84
+ ];
85
+ export function SgSegmentDigit({ value, size = 16, color, className, style }) {
86
+ const char = (value ?? " ").charAt(0);
87
+ const normalized = char === ":" ? ":" : (DIGIT_GLYPHS[char] ? char : " ");
88
+ const isColon = normalized === ":";
89
+ const glyph = isColon ? COLON_GLYPH : DIGIT_GLYPHS[normalized] ?? DIGIT_GLYPHS[" "] ?? [];
90
+ const viewWidth = isColon ? 4 : 6;
91
+ const viewHeight = 10;
92
+ const scale = Math.max(0.2, size / viewHeight);
93
+ const width = round(viewWidth * scale);
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}`))) }));
96
+ }
@@ -0,0 +1,3 @@
1
+ export { SgSegmentDigit } from "./SgSegmentDigit";
2
+ export type { SgSegmentDigitProps } from "./SgSegmentDigit";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/digits/segment-digit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ export { SgSegmentDigit } from "./SgSegmentDigit";
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ export type SgSevenSegmentDigitPalette = "red" | "blue" | "yellow" | "green" | "white";
3
+ export type SgSevenSegmentDigitProps = {
4
+ /** Character rendered by the component (first character is used). */
5
+ value: string;
6
+ /** Preset visual palette for active, inactive and background colors. */
7
+ palette?: SgSevenSegmentDigitPalette;
8
+ /** Color of active segments. */
9
+ color?: string;
10
+ /** Background color of the component panel. */
11
+ backgroundColor?: string;
12
+ /** Color of inactive segments. */
13
+ offColor?: string;
14
+ /** Component height in pixels. */
15
+ size?: number;
16
+ /** Component width in pixels. By default, derived from `size`. */
17
+ width?: number;
18
+ /** Segment thickness in pixels. */
19
+ thickness?: number;
20
+ /** Internal panel padding in pixels. */
21
+ padding?: number;
22
+ /** Border radius of the panel in pixels. */
23
+ rounded?: number;
24
+ /** Applies a subtle skew to mimic classic LED displays. */
25
+ skew?: number;
26
+ /** Enables glow effect on active segments. */
27
+ glow?: boolean;
28
+ /** Segment transition duration in milliseconds. */
29
+ transitionMs?: number;
30
+ /** Additional classes on outer wrapper. */
31
+ className?: string;
32
+ /** Additional inline styles on outer wrapper. */
33
+ style?: React.CSSProperties;
34
+ };
35
+ export declare function SgSevenSegmentDigit({ value, palette, color, backgroundColor, offColor, size, width, thickness, padding, rounded, skew, glow, transitionMs, className, style }: Readonly<SgSevenSegmentDigitProps>): import("react/jsx-runtime").JSX.Element;
36
+ //# sourceMappingURL=SgSevenSegmentDigit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SgSevenSegmentDigit.d.ts","sourceRoot":"","sources":["../../../src/digits/seven-segment-digit/SgSeven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