@seedgrid/fe-components 0.2.10 → 2026.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/buttons/SgFloatActionButton.d.ts.map +1 -1
  2. package/dist/buttons/SgFloatActionButton.js +168 -38
  3. package/dist/commons/SgAvatar.d.ts +66 -0
  4. package/dist/commons/SgAvatar.d.ts.map +1 -0
  5. package/dist/commons/SgAvatar.js +136 -0
  6. package/dist/commons/SgSkeleton.d.ts +16 -0
  7. package/dist/commons/SgSkeleton.d.ts.map +1 -0
  8. package/dist/commons/SgSkeleton.js +58 -0
  9. package/dist/digits/discard-digit/SgDiscardDigit.d.ts +39 -0
  10. package/dist/digits/discard-digit/SgDiscardDigit.d.ts.map +1 -0
  11. package/dist/digits/discard-digit/SgDiscardDigit.js +303 -0
  12. package/dist/digits/discard-digit/index.d.ts +3 -0
  13. package/dist/digits/discard-digit/index.d.ts.map +1 -0
  14. package/dist/digits/discard-digit/index.js +1 -0
  15. package/dist/digits/fade-digit/SgFadeDigit.d.ts +27 -0
  16. package/dist/digits/fade-digit/SgFadeDigit.d.ts.map +1 -0
  17. package/dist/digits/fade-digit/SgFadeDigit.js +85 -0
  18. package/dist/digits/fade-digit/index.d.ts +3 -0
  19. package/dist/digits/fade-digit/index.d.ts.map +1 -0
  20. package/dist/digits/fade-digit/index.js +1 -0
  21. package/dist/digits/flip-digit/SgFlipDigit.d.ts +27 -0
  22. package/dist/digits/flip-digit/SgFlipDigit.d.ts.map +1 -0
  23. package/dist/digits/flip-digit/SgFlipDigit.js +70 -0
  24. package/dist/digits/flip-digit/index.d.ts.map +1 -0
  25. package/dist/digits/matrix-digit/SgMatrixDigit.d.ts +32 -0
  26. package/dist/digits/matrix-digit/SgMatrixDigit.d.ts.map +1 -0
  27. package/dist/digits/matrix-digit/SgMatrixDigit.js +86 -0
  28. package/dist/digits/matrix-digit/index.d.ts +3 -0
  29. package/dist/digits/matrix-digit/index.d.ts.map +1 -0
  30. package/dist/digits/matrix-digit/index.js +1 -0
  31. package/dist/digits/neon-digit/SgNeonDigit.d.ts +37 -0
  32. package/dist/digits/neon-digit/SgNeonDigit.d.ts.map +1 -0
  33. package/dist/digits/neon-digit/SgNeonDigit.js +59 -0
  34. package/dist/digits/neon-digit/index.d.ts +3 -0
  35. package/dist/digits/neon-digit/index.d.ts.map +1 -0
  36. package/dist/digits/neon-digit/index.js +1 -0
  37. package/dist/digits/roller3d-digit/SgRoller3DDigit.d.ts +37 -0
  38. package/dist/digits/roller3d-digit/SgRoller3DDigit.d.ts.map +1 -0
  39. package/dist/digits/roller3d-digit/SgRoller3DDigit.js +47 -0
  40. package/dist/digits/roller3d-digit/index.d.ts +3 -0
  41. package/dist/digits/roller3d-digit/index.d.ts.map +1 -0
  42. package/dist/digits/roller3d-digit/index.js +1 -0
  43. package/dist/environment/SgEnvironmentProvider.d.ts +1 -0
  44. package/dist/environment/SgEnvironmentProvider.d.ts.map +1 -1
  45. package/dist/environment/SgEnvironmentProvider.js +51 -12
  46. package/dist/gadgets/clock/SgClock.d.ts +3 -1
  47. package/dist/gadgets/clock/SgClock.d.ts.map +1 -1
  48. package/dist/gadgets/clock/SgClock.js +111 -180
  49. package/dist/gadgets/clock/SgTimeProvider.d.ts +1 -0
  50. package/dist/gadgets/clock/SgTimeProvider.d.ts.map +1 -1
  51. package/dist/gadgets/clock/SgTimeProvider.js +11 -4
  52. package/dist/gadgets/gauge/SgLinearGauge.d.ts +59 -0
  53. package/dist/gadgets/gauge/SgLinearGauge.d.ts.map +1 -0
  54. package/dist/gadgets/gauge/SgLinearGauge.js +258 -0
  55. package/dist/gadgets/gauge/SgRadialGauge.d.ts +73 -0
  56. package/dist/gadgets/gauge/SgRadialGauge.d.ts.map +1 -0
  57. package/dist/gadgets/gauge/SgRadialGauge.js +311 -0
  58. package/dist/gadgets/gauge/index.d.ts +5 -0
  59. package/dist/gadgets/gauge/index.d.ts.map +1 -0
  60. package/dist/gadgets/gauge/index.js +2 -0
  61. package/dist/gadgets/string-animator/SgStringAnimator.d.ts +91 -0
  62. package/dist/gadgets/string-animator/SgStringAnimator.d.ts.map +1 -0
  63. package/dist/gadgets/string-animator/SgStringAnimator.js +145 -0
  64. package/dist/gadgets/string-animator/index.d.ts +3 -0
  65. package/dist/gadgets/string-animator/index.d.ts.map +1 -0
  66. package/dist/gadgets/string-animator/index.js +1 -0
  67. package/dist/i18n/en-US.json +9 -1
  68. package/dist/i18n/es.json +55 -47
  69. package/dist/i18n/index.d.ts +32 -0
  70. package/dist/i18n/index.d.ts.map +1 -1
  71. package/dist/i18n/pt-BR.json +9 -1
  72. package/dist/i18n/pt-PT.json +9 -1
  73. package/dist/index.d.ts +46 -4
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +22 -1
  76. package/dist/inputs/SgAutocomplete.js +21 -5
  77. package/dist/inputs/SgCombobox.d.ts.map +1 -1
  78. package/dist/inputs/SgCombobox.js +8 -3
  79. package/dist/inputs/SgRadioGroup.d.ts +37 -0
  80. package/dist/inputs/SgRadioGroup.d.ts.map +1 -0
  81. package/dist/inputs/SgRadioGroup.js +139 -0
  82. package/dist/inputs/SgRating.d.ts +55 -0
  83. package/dist/inputs/SgRating.d.ts.map +1 -0
  84. package/dist/inputs/SgRating.js +135 -0
  85. package/dist/inputs/SgSlider.d.ts +20 -0
  86. package/dist/inputs/SgSlider.d.ts.map +1 -0
  87. package/dist/inputs/SgSlider.js +40 -0
  88. package/dist/inputs/SgStepperInput.d.ts +22 -0
  89. package/dist/inputs/SgStepperInput.d.ts.map +1 -0
  90. package/dist/inputs/SgStepperInput.js +51 -0
  91. package/dist/inputs/SgTextEditor.d.ts +1 -0
  92. package/dist/inputs/SgTextEditor.d.ts.map +1 -1
  93. package/dist/inputs/SgTextEditor.js +19 -3
  94. package/dist/layout/SgAccordion.d.ts +39 -0
  95. package/dist/layout/SgAccordion.d.ts.map +1 -0
  96. package/dist/layout/SgAccordion.js +116 -0
  97. package/dist/layout/SgBreadcrumb.d.ts +33 -0
  98. package/dist/layout/SgBreadcrumb.d.ts.map +1 -0
  99. package/dist/layout/SgBreadcrumb.js +121 -0
  100. package/dist/layout/SgCarousel.d.ts +43 -0
  101. package/dist/layout/SgCarousel.d.ts.map +1 -0
  102. package/dist/layout/SgCarousel.js +166 -0
  103. package/dist/layout/SgDockLayout.d.ts +14 -0
  104. package/dist/layout/SgDockLayout.d.ts.map +1 -1
  105. package/dist/layout/SgDockLayout.js +145 -13
  106. package/dist/layout/SgDockScreen.d.ts +15 -0
  107. package/dist/layout/SgDockScreen.d.ts.map +1 -0
  108. package/dist/layout/SgDockScreen.js +13 -0
  109. package/dist/layout/SgDockZone.d.ts.map +1 -1
  110. package/dist/layout/SgDockZone.js +36 -2
  111. package/dist/layout/SgExpandablePanel.d.ts +50 -0
  112. package/dist/layout/SgExpandablePanel.d.ts.map +1 -0
  113. package/dist/layout/SgExpandablePanel.js +302 -0
  114. package/dist/layout/SgMainPanel.d.ts.map +1 -1
  115. package/dist/layout/SgMainPanel.js +36 -14
  116. package/dist/layout/SgMenu.d.ts +91 -0
  117. package/dist/layout/SgMenu.d.ts.map +1 -0
  118. package/dist/layout/SgMenu.js +939 -0
  119. package/dist/layout/SgPageControl.d.ts +49 -0
  120. package/dist/layout/SgPageControl.d.ts.map +1 -0
  121. package/dist/layout/SgPageControl.js +152 -0
  122. package/dist/layout/SgPanel.d.ts.map +1 -1
  123. package/dist/layout/SgPanel.js +10 -1
  124. package/dist/layout/SgScreen.d.ts +2 -0
  125. package/dist/layout/SgScreen.d.ts.map +1 -1
  126. package/dist/layout/SgScreen.js +4 -2
  127. package/dist/layout/SgToolBar.d.ts +9 -3
  128. package/dist/layout/SgToolBar.d.ts.map +1 -1
  129. package/dist/layout/SgToolBar.js +461 -55
  130. package/dist/menus/SgDockMenu.d.ts +62 -0
  131. package/dist/menus/SgDockMenu.d.ts.map +1 -0
  132. package/dist/menus/SgDockMenu.js +480 -0
  133. package/dist/others/SgPlayground.js +72 -72
  134. package/package.json +72 -63
  135. package/dist/gadgets/flip-digit/SgFlipDigit.d.ts +0 -23
  136. package/dist/gadgets/flip-digit/SgFlipDigit.d.ts.map +0 -1
  137. package/dist/gadgets/flip-digit/SgFlipDigit.js +0 -118
  138. package/dist/gadgets/flip-digit/index.d.ts.map +0 -1
  139. /package/dist/{gadgets → digits}/flip-digit/index.d.ts +0 -0
  140. /package/dist/{gadgets → digits}/flip-digit/index.js +0 -0
@@ -0,0 +1,303 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ function cn(...parts) {
4
+ return parts.filter(Boolean).join(" ");
5
+ }
6
+ function createRandomMotion(fontSize) {
7
+ const side = Math.random() < 0.5 ? -1 : 1;
8
+ const base = Math.max(26, Math.round(fontSize * 0.55));
9
+ return {
10
+ tx: side * (base + Math.round(Math.random() * base * 0.55)),
11
+ ty: Math.max(56, Math.round(fontSize * 1.45 + Math.random() * fontSize * 0.55)),
12
+ rotateZ: side * (8 + Math.round(Math.random() * 12)),
13
+ rotateX: -(10 + Math.round(Math.random() * 16)),
14
+ scale: 0.68 + Math.random() * 0.14,
15
+ };
16
+ }
17
+ /** px that each sheet peeks below the one above — visible "spine" line */
18
+ const PER_LAYER_Y = 3;
19
+ /** horizontal drift per layer — subtle perspective illusion */
20
+ const PER_LAYER_X = 0;
21
+ export const SgDiscardDigit = React.forwardRef(function SgDiscardDigit({ value, color = "#0f172a", font, backgroundColor = "#f8fafc", fontSize = 64, fontWeight = 700, animateOnChange = true, transitionMs = 640, stackDepth = 20, totalNumberPages, changeAnimationMode = "discard", className, style, }, ref) {
22
+ const [currentPage, setCurrentPage] = React.useState(1);
23
+ const directionRef = React.useRef("next");
24
+ React.useImperativeHandle(ref, () => ({
25
+ decreasePage() {
26
+ directionRef.current = "prev";
27
+ setCurrentPage((p) => Math.max(1, p - 1));
28
+ },
29
+ increasePage() {
30
+ directionRef.current = "next";
31
+ setCurrentPage((p) => (totalNumberPages != null ? Math.min(totalNumberPages, p + 1) : p + 1));
32
+ },
33
+ page() {
34
+ return currentPage;
35
+ },
36
+ }), [currentPage, totalNumberPages]);
37
+ const depth = totalNumberPages != null
38
+ ? Math.max(1, Math.min(30, totalNumberPages - currentPage + 1))
39
+ : Math.max(2, Math.min(30, stackDepth));
40
+ // ── Dimensions ─────────────────────────────────────────────────────────────
41
+ const cardW = Math.max(74, Math.round(fontSize * 1.14));
42
+ const cardH = Math.max(96, Math.round(fontSize * 1.52));
43
+ const radius = Math.max(8, Math.round(fontSize * 0.15));
44
+ const textSize = Math.max(18, Math.round(fontSize * 0.86));
45
+ // depth-1 backing layers so total visible sheets = depth
46
+ const numStack = depth - 1;
47
+ const PAD = 10;
48
+ const containerW = cardW + PAD * 2 + Math.ceil(numStack * PER_LAYER_X);
49
+ const containerH = cardH + numStack * PER_LAYER_Y + PAD * 2;
50
+ // Left edge where cards start (horizontally centered)
51
+ const cardLeft = Math.floor((containerW - cardW) / 2);
52
+ // ── Paper aesthetics ────────────────────────────────────────────────────────
53
+ const paperEdgeSoft = "rgba(15, 23, 42, 0.16)";
54
+ const paperEdgeMid = "rgba(15, 23, 42, 0.26)";
55
+ const paperTexture = "repeating-linear-gradient(0deg, rgba(15,23,42,0.025) 0px, rgba(15,23,42,0.025) 1px, transparent 1px, transparent 4px)";
56
+ // ── State ───────────────────────────────────────────────────────────────────
57
+ const [displayValue, setDisplayValue] = React.useState(value);
58
+ const [activeDiscard, setActiveDiscard] = React.useState(null);
59
+ const [activeIncoming, setActiveIncoming] = React.useState(null);
60
+ const discardIdRef = React.useRef(0);
61
+ const latestValueRef = React.useRef(value);
62
+ React.useEffect(() => {
63
+ latestValueRef.current = value;
64
+ }, [value]);
65
+ React.useEffect(() => {
66
+ if (!animateOnChange) {
67
+ setActiveDiscard(null);
68
+ setActiveIncoming(null);
69
+ setDisplayValue(value);
70
+ return;
71
+ }
72
+ if (value === displayValue && activeDiscard === null && activeIncoming === null)
73
+ return;
74
+ const shouldUseIncoming = directionRef.current === "prev" || changeAnimationMode === "incoming";
75
+ if (shouldUseIncoming) {
76
+ // Incoming: nova folha sobe por baixo revelando o valor anterior
77
+ if (activeIncoming === null && value !== displayValue) {
78
+ const nextId = ++discardIdRef.current;
79
+ setActiveIncoming({
80
+ id: nextId,
81
+ value,
82
+ motion: createRandomMotion(fontSize),
83
+ started: false,
84
+ });
85
+ // displayValue permanece no valor antigo; atualiza só ao fim da animacao
86
+ }
87
+ }
88
+ else {
89
+ // Discard: folha atual voa para fora, revelando o novo valor
90
+ if (activeIncoming === null) {
91
+ if (activeDiscard === null) {
92
+ const nextId = ++discardIdRef.current;
93
+ setActiveDiscard({
94
+ id: nextId,
95
+ value: displayValue,
96
+ motion: createRandomMotion(fontSize),
97
+ started: false,
98
+ });
99
+ }
100
+ setDisplayValue(value);
101
+ }
102
+ }
103
+ directionRef.current = "next";
104
+ }, [activeDiscard, activeIncoming, animateOnChange, changeAnimationMode, displayValue, fontSize, value]);
105
+ // ── RAF: discard ─────────────────────────────────────────────────────────
106
+ React.useEffect(() => {
107
+ if (!activeDiscard || activeDiscard.started)
108
+ return;
109
+ let raf = 0;
110
+ raf = window.requestAnimationFrame(() => {
111
+ setActiveDiscard((prev) => prev && prev.id === activeDiscard.id ? { ...prev, started: true } : prev);
112
+ });
113
+ return () => window.cancelAnimationFrame(raf);
114
+ }, [activeDiscard]);
115
+ // ── RAF: incoming ────────────────────────────────────────────────────────
116
+ React.useEffect(() => {
117
+ if (!activeIncoming || activeIncoming.started)
118
+ return;
119
+ let raf = 0;
120
+ raf = window.requestAnimationFrame(() => {
121
+ setActiveIncoming((prev) => prev && prev.id === activeIncoming.id ? { ...prev, started: true } : prev);
122
+ });
123
+ return () => window.cancelAnimationFrame(raf);
124
+ }, [activeIncoming]);
125
+ // ── Cleanup: discard ─────────────────────────────────────────────────────
126
+ React.useEffect(() => {
127
+ if (!activeDiscard || !activeDiscard.started)
128
+ return;
129
+ const currentId = activeDiscard.id;
130
+ const timer = window.setTimeout(() => {
131
+ setActiveDiscard((prev) => (prev && prev.id === currentId ? null : prev));
132
+ const latest = latestValueRef.current;
133
+ setDisplayValue((prev) => (prev === latest ? prev : latest));
134
+ }, Math.max(120, transitionMs));
135
+ return () => window.clearTimeout(timer);
136
+ }, [activeDiscard, transitionMs]);
137
+ // ── Cleanup: incoming ────────────────────────────────────────────────────
138
+ React.useEffect(() => {
139
+ if (!activeIncoming || !activeIncoming.started)
140
+ return;
141
+ const currentId = activeIncoming.id;
142
+ const timer = window.setTimeout(() => {
143
+ setActiveIncoming((prev) => (prev && prev.id === currentId ? null : prev));
144
+ setDisplayValue(latestValueRef.current);
145
+ }, Math.max(120, transitionMs));
146
+ return () => window.clearTimeout(timer);
147
+ }, [activeIncoming, transitionMs]);
148
+ // ── Stack layers ────────────────────────────────────────────────────────────
149
+ // i=0 → BOTTOM of stack (most displaced, lowest z-index = 1)
150
+ // i=numStack-1 → just below main card (least displaced, highest z-index = numStack)
151
+ // Each layer shows exactly PER_LAYER_Y px of its bottom edge.
152
+ const stackLayers = React.useMemo(() => {
153
+ return Array.from({ length: numStack }, (_, i) => {
154
+ const distFromTop = numStack - i; // 1 = closest to main, numStack = bottom
155
+ return {
156
+ top: PAD + distFromTop * PER_LAYER_Y,
157
+ left: cardLeft + distFromTop * PER_LAYER_X,
158
+ // Subtle darkening toward the bottom of the stack
159
+ opacity: Math.max(0.80, 1 - (distFromTop - 1) * 0.007),
160
+ zIndex: i + 1, // bottom=1 (behind), top-of-stack=numStack (in front)
161
+ };
162
+ });
163
+ }, [numStack, cardLeft]);
164
+ const shadowTone = "rgba(2, 8, 23, 0.28)";
165
+ const subtleTone = "rgba(2, 8, 23, 0.12)";
166
+ return (_jsxs("div", { role: "img", "aria-label": value, className: cn("inline-block", className), style: {
167
+ position: "relative",
168
+ width: containerW,
169
+ height: containerH,
170
+ perspective: "1000px",
171
+ ...style,
172
+ }, children: [_jsx("div", { "aria-hidden": "true", style: {
173
+ position: "absolute",
174
+ width: Math.round(cardW * 0.88),
175
+ height: Math.max(14, Math.round(cardH * 0.12)),
176
+ left: "50%",
177
+ top: PAD + cardH + numStack * PER_LAYER_Y + 2,
178
+ transform: "translateX(-50%)",
179
+ filter: "blur(8px)",
180
+ background: "radial-gradient(ellipse at center, rgba(2,8,23,0.30) 0%, rgba(2,8,23,0.05) 70%, transparent 100%)",
181
+ } }), stackLayers.map((layer, i) => (_jsx("div", { "aria-hidden": "true", style: {
182
+ position: "absolute",
183
+ top: layer.top,
184
+ left: layer.left,
185
+ width: cardW,
186
+ height: cardH,
187
+ borderRadius: radius,
188
+ backgroundColor,
189
+ // Visible top + side borders; bottom border slightly stronger so each
190
+ // 3-px strip is legible as a distinct sheet edge.
191
+ border: `1px solid ${paperEdgeSoft}`,
192
+ borderBottom: `1px solid ${paperEdgeMid}`,
193
+ boxShadow: `inset 0 1px 0 rgba(255,255,255,0.70), inset 0 -1px 0 rgba(15,23,42,0.06)`,
194
+ opacity: layer.opacity,
195
+ zIndex: layer.zIndex,
196
+ } }, `sheet-${i}`))), _jsxs("div", { style: {
197
+ position: "absolute",
198
+ top: PAD,
199
+ left: cardLeft,
200
+ width: cardW,
201
+ height: cardH,
202
+ borderRadius: radius,
203
+ backgroundColor,
204
+ border: `1px solid ${paperEdgeSoft}`,
205
+ display: "flex",
206
+ alignItems: "center",
207
+ justifyContent: "center",
208
+ boxShadow: `0 8px 16px ${subtleTone}, 0 0 0 1px rgba(255,255,255,0.22), inset 0 1px 0 rgba(255,255,255,0.80), inset 0 -1px 0 rgba(15,23,42,0.07)`,
209
+ transition: `opacity ${Math.round(transitionMs * 0.52)}ms ease`,
210
+ zIndex: numStack + 1,
211
+ overflow: "hidden",
212
+ }, children: [_jsx("div", { "aria-hidden": "true", style: {
213
+ position: "absolute",
214
+ inset: 0,
215
+ background: `linear-gradient(160deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.12) 28%, rgba(255,255,255,0) 55%), linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.09) 100%), ${paperTexture}`,
216
+ pointerEvents: "none",
217
+ } }), _jsx("span", { style: {
218
+ position: "relative",
219
+ zIndex: 1,
220
+ color,
221
+ fontFamily: font,
222
+ fontSize: textSize,
223
+ fontWeight,
224
+ lineHeight: 1,
225
+ userSelect: "none",
226
+ textShadow: `0 1px 0 rgba(255,255,255,0.45), 0 10px 16px rgba(2,8,23,0.10)`,
227
+ }, children: displayValue })] }), activeIncoming ? (_jsxs("div", { style: {
228
+ position: "absolute",
229
+ top: PAD,
230
+ left: cardLeft,
231
+ width: cardW,
232
+ height: cardH,
233
+ borderRadius: radius,
234
+ backgroundColor,
235
+ border: `1px solid ${paperEdgeMid}`,
236
+ display: "flex",
237
+ alignItems: "center",
238
+ justifyContent: "center",
239
+ transform: activeIncoming.started
240
+ ? "translate3d(0, 0, 80px) rotateX(0deg) rotateZ(0deg) scale(1)"
241
+ : `translate3d(${activeIncoming.motion.tx}px, ${activeIncoming.motion.ty}px, 74px) rotateX(${activeIncoming.motion.rotateX}deg) rotateZ(${activeIncoming.motion.rotateZ}deg) scale(${activeIncoming.motion.scale})`,
242
+ transformOrigin: "50% 80%",
243
+ opacity: activeIncoming.started ? 1 : 0,
244
+ boxShadow: `0 16px 22px ${shadowTone}, 0 30px 30px rgba(2,8,23,0.18), 0 0 0 1px rgba(255,255,255,0.26), inset 0 1px 0 rgba(255,255,255,0.82), inset 0 -1px 0 rgba(15,23,42,0.10)`,
245
+ transition: `transform ${transitionMs}ms cubic-bezier(0.18, 0.78, 0.18, 1), opacity ${Math.round(transitionMs * 0.6)}ms ease`,
246
+ zIndex: numStack + 20,
247
+ overflow: "hidden",
248
+ }, children: [_jsx("div", { "aria-hidden": "true", style: {
249
+ position: "absolute",
250
+ inset: 0,
251
+ background: `linear-gradient(160deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.16) 30%, rgba(255,255,255,0) 58%), linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.12) 100%), ${paperTexture}`,
252
+ pointerEvents: "none",
253
+ } }), _jsx("span", { style: {
254
+ position: "relative",
255
+ zIndex: 1,
256
+ color,
257
+ fontFamily: font,
258
+ fontSize: textSize,
259
+ fontWeight,
260
+ lineHeight: 1,
261
+ userSelect: "none",
262
+ textShadow: `0 1px 0 rgba(255,255,255,0.45), 0 12px 18px rgba(2,8,23,0.13)`,
263
+ }, children: activeIncoming.value })] })) : null, activeDiscard ? (_jsxs("div", { style: {
264
+ position: "absolute",
265
+ top: PAD,
266
+ left: cardLeft,
267
+ width: cardW,
268
+ height: cardH,
269
+ borderRadius: radius,
270
+ backgroundColor,
271
+ border: `1px solid ${paperEdgeMid}`,
272
+ display: "flex",
273
+ alignItems: "center",
274
+ justifyContent: "center",
275
+ transform: activeDiscard.started
276
+ ? `translate3d(${activeDiscard.motion.tx}px, ${activeDiscard.motion.ty}px, 74px) rotateX(${activeDiscard.motion.rotateX}deg) rotateZ(${activeDiscard.motion.rotateZ}deg) scale(${activeDiscard.motion.scale})`
277
+ : "translate3d(0, 0, 80px) rotateX(0deg) rotateZ(0deg) scale(1)",
278
+ transformOrigin: "50% 20%",
279
+ opacity: activeDiscard.started ? 0 : 1,
280
+ boxShadow: activeDiscard.started
281
+ ? `0 7px 15px ${shadowTone}, 0 22px 26px rgba(2,8,23,0.14), inset 0 1px 0 rgba(255,255,255,0.72)`
282
+ : `0 16px 22px ${shadowTone}, 0 30px 30px rgba(2,8,23,0.18), 0 0 0 1px rgba(255,255,255,0.26), inset 0 1px 0 rgba(255,255,255,0.82), inset 0 -1px 0 rgba(15,23,42,0.10)`,
283
+ transition: `transform ${transitionMs}ms cubic-bezier(0.2, 0.82, 0.2, 1), opacity ${transitionMs}ms ease, box-shadow ${Math.round(transitionMs * 0.65)}ms ease`,
284
+ zIndex: numStack + 20,
285
+ overflow: "hidden",
286
+ }, children: [_jsx("div", { "aria-hidden": "true", style: {
287
+ position: "absolute",
288
+ inset: 0,
289
+ background: `linear-gradient(160deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.16) 30%, rgba(255,255,255,0) 58%), linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.12) 100%), ${paperTexture}`,
290
+ pointerEvents: "none",
291
+ } }), _jsx("span", { style: {
292
+ position: "relative",
293
+ zIndex: 1,
294
+ color,
295
+ fontFamily: font,
296
+ fontSize: textSize,
297
+ fontWeight,
298
+ lineHeight: 1,
299
+ userSelect: "none",
300
+ textShadow: `0 1px 0 rgba(255,255,255,0.45), 0 12px 18px rgba(2,8,23,0.13)`,
301
+ }, children: activeDiscard.value })] })) : null] }));
302
+ });
303
+ SgDiscardDigit.displayName = "SgDiscardDigit";
@@ -0,0 +1,3 @@
1
+ export { SgDiscardDigit } from "./SgDiscardDigit";
2
+ export type { SgDiscardDigitProps, SgDiscardDigitHandle } from "./SgDiscardDigit";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/digits/discard-digit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ export { SgDiscardDigit } from "./SgDiscardDigit";
@@ -0,0 +1,27 @@
1
+ export type SgFadeDigitProps = {
2
+ /** Character to display. When changed, the current digit fades out and the new one fades in. */
3
+ value: string;
4
+ /** Text color of the digit. @default "#edebeb" */
5
+ color?: string;
6
+ /** Card background color. @default "#333232" */
7
+ backgroundColor?: string;
8
+ /**
9
+ * CSS font-family for the digit.
10
+ * @default undefined (browser default)
11
+ */
12
+ font?: string;
13
+ /** Font size in pixels — controls overall card scale. @default 70 */
14
+ fontSize?: number;
15
+ /** Additional CSS classes on the outer card wrapper. */
16
+ className?: string;
17
+ };
18
+ /**
19
+ * SgFadeDigit — an animated card that "turns off" its current digit (fade to
20
+ * transparent) and "turns on" the new one (fade in), simulating a bulb or
21
+ * display switching effect.
22
+ *
23
+ * The card style matches SgFlipDigit (same proportions, divider line and
24
+ * shadow) so both components can be mixed in clock-style layouts.
25
+ */
26
+ export declare function SgFadeDigit({ value, color, backgroundColor, font, fontSize, className, }: SgFadeDigitProps): import("react/jsx-runtime").JSX.Element;
27
+ //# sourceMappingURL=SgFadeDigit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SgFadeDigit.d.ts","sourceRoot":"","sources":["../../../src/digits/fade-digit/SgFadeDigit.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gGAAgG;IAChG,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAiB,EACjB,eAA2B,EAC3B,IAAI,EACJ,QAAa,EACb,SAAS,GACV,EAAE,gBAAgB,2CAyGlB"}
@@ -0,0 +1,85 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ /** Duration of each fade phase (out and in) in ms */
5
+ const FADE_MS = 200;
6
+ /**
7
+ * SgFadeDigit — an animated card that "turns off" its current digit (fade to
8
+ * transparent) and "turns on" the new one (fade in), simulating a bulb or
9
+ * display switching effect.
10
+ *
11
+ * The card style matches SgFlipDigit (same proportions, divider line and
12
+ * shadow) so both components can be mixed in clock-style layouts.
13
+ */
14
+ export function SgFadeDigit({ value, color = "#edebeb", backgroundColor = "#333232", font, fontSize = 70, className, }) {
15
+ /**
16
+ * What is rendered in the card. Lags behind `value` during animation:
17
+ * we first fade out the old value, swap here, then fade in the new one.
18
+ */
19
+ const [displayValue, setDisplayValue] = React.useState(value);
20
+ /** Drives the CSS opacity transition (1 = fully visible, 0 = invisible). */
21
+ const [opacity, setOpacity] = React.useState(1);
22
+ React.useEffect(() => {
23
+ // Nothing to do — already showing the right value
24
+ if (value === displayValue)
25
+ return;
26
+ // Phase 1: fade out
27
+ setOpacity(0);
28
+ // Phase 2: after fade-out completes, swap text and fade in
29
+ const t = window.setTimeout(() => {
30
+ setDisplayValue(value); // swap while invisible
31
+ setOpacity(1); // fade in with new value
32
+ }, FADE_MS);
33
+ return () => window.clearTimeout(t);
34
+ // displayValue intentionally in deps: when setDisplayValue fires it causes
35
+ // a re-run, which returns early (value === displayValue) — no loop.
36
+ // eslint-disable-next-line react-hooks/exhaustive-deps
37
+ }, [value, displayValue]);
38
+ // ── Card dimensions (proportional to fontSize, matching SgFlipDigit) ──────
39
+ const cardW = Math.round(fontSize * 0.88);
40
+ const cardH = Math.round(fontSize * 1.38);
41
+ const cardRadius = Math.max(2, Math.round(fontSize * 0.04));
42
+ return (_jsxs("div", { "aria-label": displayValue, className: className, style: {
43
+ display: "inline-block",
44
+ position: "relative",
45
+ width: cardW,
46
+ height: cardH,
47
+ borderRadius: cardRadius,
48
+ backgroundColor,
49
+ boxShadow: "0 .125em .3125em rgba(0,0,0,.25), 0 .02125em .06125em rgba(0,0,0,.25)",
50
+ overflow: "hidden",
51
+ flexShrink: 0,
52
+ }, children: [_jsx("div", { "aria-hidden": "true", style: {
53
+ position: "absolute",
54
+ left: 0,
55
+ right: 0,
56
+ top: Math.round(cardH / 2),
57
+ height: 1,
58
+ backgroundColor: "rgba(0,0,0,0.35)",
59
+ zIndex: 1,
60
+ pointerEvents: "none",
61
+ } }), _jsx("div", { "aria-hidden": "true", style: {
62
+ position: "absolute",
63
+ inset: 0,
64
+ background: "linear-gradient(to bottom, rgba(255,255,255,0.045) 0%, transparent 52%)",
65
+ zIndex: 2,
66
+ pointerEvents: "none",
67
+ } }), _jsx("div", { style: {
68
+ position: "absolute",
69
+ inset: 0,
70
+ display: "flex",
71
+ alignItems: "center",
72
+ justifyContent: "center",
73
+ fontSize,
74
+ color,
75
+ fontFamily: font,
76
+ fontWeight: "bold",
77
+ lineHeight: 1,
78
+ userSelect: "none",
79
+ opacity,
80
+ // Transition is CONSTANT — direction never changes, so the browser
81
+ // always animates when opacity goes 1→0 or 0→1.
82
+ transition: `opacity ${FADE_MS}ms ease`,
83
+ zIndex: 3,
84
+ }, children: displayValue })] }));
85
+ }
@@ -0,0 +1,3 @@
1
+ export { SgFadeDigit } from "./SgFadeDigit";
2
+ export type { SgFadeDigitProps } from "./SgFadeDigit";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/digits/fade-digit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ export { SgFadeDigit } from "./SgFadeDigit";
@@ -0,0 +1,27 @@
1
+ export type SgFlipDigitProps = {
2
+ /** The character to display (single char) */
3
+ value: string;
4
+ /** Font size in pixels — controls overall scale */
5
+ fontSize?: number;
6
+ /** Additional CSS classes applied to the outer wrapper */
7
+ className?: string;
8
+ /**
9
+ * @deprecated Use fontSize to control size. width/height are ignored when using @pqina/flip.
10
+ */
11
+ width?: number;
12
+ /**
13
+ * @deprecated Use fontSize to control size. width/height are ignored when using @pqina/flip.
14
+ */
15
+ height?: number;
16
+ };
17
+ /**
18
+ * SgFlipDigit - Animated flip card powered by @pqina/flip (MIT)
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const [digit, setDigit] = useState("0");
23
+ * <SgFlipDigit value={digit} fontSize={70} />
24
+ * ```
25
+ */
26
+ export declare function SgFlipDigit({ value, fontSize, className, }: SgFlipDigitProps): import("react/jsx-runtime").JSX.Element;
27
+ //# sourceMappingURL=SgFlipDigit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SgFlipDigit.d.ts","sourceRoot":"","sources":["../../../src/digits/flip-digit/SgFlipDigit.tsx"],"names":[],"mappings":"AAuBA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAa,EACb,SAAS,GACV,EAAE,gBAAgB,2CAwDlB"}
@@ -0,0 +1,70 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ // CSS from @pqina/flip v1.8.4 (MIT) — embedded to avoid CSS import in tsc-only build
4
+ const FLIP_CSS = `.tick{box-sizing:border-box;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:default;position:relative;z-index:1;line-height:1.4}.tick *{box-sizing:inherit}.tick [data-view]{max-width:100%}.tick span[data-view]{display:inline-block}.tick .tick-credits{display:none}.tick [data-layout~=pad]{margin:-.25em}.tick [data-layout~=pad]>*{margin:.25em}.tick [data-layout~=horizontal]{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}.tick [data-layout~=horizontal][data-layout~=baseline]{-ms-flex-align:baseline;align-items:baseline}.tick [data-layout~=horizontal][data-layout~=center]{-ms-flex-pack:center;justify-content:center}.tick [data-layout~=horizontal][data-layout~=right]{-ms-flex-pack:end;justify-content:flex-end}.tick [data-layout~=horizontal][data-layout~=left]{-ms-flex-pack:start;justify-content:flex-start}.tick [data-layout~=horizontal][data-layout~=fill],.tick [data-layout~=horizontal][data-layout~=stretch]{-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.tick [data-layout~=horizontal][data-layout~=fill]>*,.tick [data-layout~=horizontal][data-layout~=stretch]>*{-ms-flex:1 0 0px;flex:1 0 0;width:100%}.tick [data-layout~=horizontal][data-layout~=multi-line]{-ms-flex-wrap:wrap;flex-wrap:wrap}.tick [data-layout~=horizontal][data-layout~=fit]{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-line-pack:center;align-content:center;white-space:nowrap;-ms-flex-pack:start;justify-content:flex-start}.tick [data-layout~=vertical]{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.tick [data-layout~=vertical][data-layout~=top]{-ms-flex-pack:start;justify-content:flex-start}.tick [data-layout~=vertical][data-layout~=bottom]{-ms-flex-pack:end;justify-content:flex-end;min-height:100%}.tick [data-layout~=vertical][data-layout~=middle]{-ms-flex-pack:center;justify-content:center;min-height:100%}.tick [data-layout~=vertical][data-layout~=left]{-ms-flex-align:start;align-items:flex-start}.tick [data-layout~=vertical][data-layout~=right]{-ms-flex-align:end;align-items:flex-end}.tick [data-layout~=vertical][data-layout~=center]{text-align:center}.tick [data-layout~=vertical][data-layout~=fill],.tick [data-layout~=vertical][data-layout~=stretch]{-ms-flex-align:stretch;align-items:stretch;min-height:100%}.tick [data-layout~=vertical][data-layout~=fill]>*,.tick [data-layout~=vertical][data-layout~=stretch]>*{-ms-flex:1 0 0px;flex:1 0 0}.tick [data-layout~=vertical]>*+*{margin-top:.5em}.tick [data-layout~=overlay]{position:relative}.tick [data-layout~=overlay]>*{margin:0}.tick [data-layout~=overlay][data-layout~=center]{text-align:center}.tick [data-layout~=overlay][data-layout~=left]{text-align:left}.tick [data-layout~=overlay][data-layout~=right]{text-align:right}.tick [data-layout~=overlay]>[data-overlay=fill],.tick [data-layout~=overlay]>[data-overlay=stretch]{position:absolute;left:0;right:0;top:0;bottom:0}.tick [data-layout~=overlay]>[data-overlay=center]{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;position:absolute;left:0;right:0;top:0;bottom:0}.tick-flip{position:relative;text-align:center}.tick-flip *{border-radius:inherit;white-space:pre;letter-spacing:inherit;text-indent:inherit}.tick-flip-front{border-bottom-left-radius:0;border-bottom-right-radius:0}.tick-flip-back{border-top-left-radius:0;border-top-right-radius:0}.tick-flip-spacer{display:block;visibility:hidden}.tick-flip-shadow{position:absolute;left:1px;right:1px;top:1px;bottom:1px;color:transparent!important;background:transparent!important}.tick-flip-shadow-top{bottom:calc(50% - 1px)}.tick-flip-shadow-bottom{top:calc(50% + 1px)}.tick-flip-card-shadow{position:absolute;left:.15em;right:.15em;bottom:.125em;height:.5em;background-color:transparent;border-radius:0;opacity:0;transform-origin:0 100%;box-shadow:0 .125em .25em rgba(0,0,0,.5),0 .125em .5em rgba(0,0,0,.75);z-index:0}.tick-flip-card{position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;perspective:4em}.tick-flip-panel-back,.tick-flip-panel-front{position:absolute;left:0;width:100%;height:51%;backface-visibility:hidden;transform-style:preserve-3d}.tick-flip-panel-back-text,.tick-flip-panel-front-text{position:absolute;left:-1px;top:0;right:-1px;height:100%;overflow:hidden}.tick-flip-panel-text-wrapper{position:absolute;left:0;top:0;right:0;height:100%}.tick-flip-panel-back-text .tick-flip-panel-text-wrapper{height:200%;top:-100%}.tick-flip-panel-front{transform-origin:center bottom;top:0;z-index:2;box-shadow:inset 0 1px hsla(0,0%,100%,.05)}.tick-flip-panel-back{transform-origin:center top;top:50%;z-index:1;box-shadow:inset 0 -1px rgba(0,0,0,.1)}.tick-flip-panel-back:after{z-index:1;content:"";position:absolute;left:0;top:0;width:100%;height:100%;background-image:linear-gradient(180deg,rgba(0,0,0,.3) 1px,rgba(0,0,0,.15) 0,transparent 30%)}.tick-flip-panel-back-shadow{z-index:2}.tick-flip-panel-back-highlight{z-index:3}.tick-flip-panel-back-highlight,.tick-flip-panel-back-shadow{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.tick-flip-panel-back-highlight,.tick-flip-panel-back-shadow,.tick-flip-panel-front-shadow{position:absolute;left:0;top:0;right:0;bottom:0;opacity:0}.tick-flip-panel-front-shadow{background-image:linear-gradient(0deg,rgba(0,0,0,.8),rgba(0,0,0,.3))}.tick-flip-panel-back-shadow{background-image:linear-gradient(180deg,rgba(0,0,0,.7),rgba(0,0,0,.5))}.tick-flip-panel-back-highlight{background-image:linear-gradient(180deg,hsla(0,0%,100%,.15),hsla(0,0%,100%,.3))}.tick [data-style*="shadow:inner"],.tick [data-style*="shadow:inner"] .tick-flip-card-shadow,.tick [data-style*="shadow:none"] .tick-flip-card-shadow,.tick [data-style*="shadow:none"] .tick-flip-panel-back,.tick [data-style*="shadow:none"] .tick-flip-panel-front,.tick [data-style*="shadow:none"] .tick-flip-shadow{box-shadow:none}.tick [data-style*="shadow:none"] .tick-flip-back:after,.tick [data-style*="shadow:none"] .tick-flip-panel-back-shadow,.tick [data-style*="shadow:none"] .tick-flip-panel-back-text:after,.tick [data-style*="shadow:none"] .tick-flip-panel-front-shadow{background-image:none}.tick [data-style*="rounded:none"]{border-radius:0}.tick [data-style*="rounded:panels"] .tick-flip-front,.tick [data-style*="rounded:panels"] .tick-flip-shadow-bottom{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.tick [data-style*="rounded:panels"] .tick-flip-back,.tick [data-style*="rounded:panels"] .tick-flip-panel-back:after,.tick [data-style*="rounded:panels"] .tick-flip-shadow-top{border-top-left-radius:inherit;border-top-right-radius:inherit}.tick-flip{margin-left:.0625em;margin-right:.0625em;min-width:1.125em;border-radius:.125em;letter-spacing:.25em;text-indent:.25em}.tick-flip-panel{color:#edebeb;background-color:#333232}.tick-flip-shadow{box-shadow:0 .125em .3125em rgba(0,0,0,.25),0 .02125em .06125em rgba(0,0,0,.25)}`;
5
+ let flipCssInjected = false;
6
+ function ensureFlipCss() {
7
+ if (flipCssInjected || typeof document === "undefined")
8
+ return;
9
+ if (document.getElementById("pqina-flip-css")) {
10
+ flipCssInjected = true;
11
+ return;
12
+ }
13
+ const style = document.createElement("style");
14
+ style.id = "pqina-flip-css";
15
+ style.textContent = FLIP_CSS;
16
+ document.head.appendChild(style);
17
+ flipCssInjected = true;
18
+ }
19
+ /**
20
+ * SgFlipDigit - Animated flip card powered by @pqina/flip (MIT)
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * const [digit, setDigit] = useState("0");
25
+ * <SgFlipDigit value={digit} fontSize={70} />
26
+ * ```
27
+ */
28
+ export function SgFlipDigit({ value, fontSize = 70, className, }) {
29
+ const containerRef = React.useRef(null);
30
+ const tickRef = React.useRef(null);
31
+ const valueRef = React.useRef(value);
32
+ // Mount: inject CSS + create Tick instance
33
+ React.useEffect(() => {
34
+ ensureFlipCss();
35
+ const el = containerRef.current;
36
+ if (!el)
37
+ return;
38
+ let cancelled = false;
39
+ let destroyFn = null;
40
+ // Dynamic import: @pqina/flip touches window/document at module evaluation,
41
+ // so it must never run on the server (SSR). useEffect is client-only.
42
+ import("@pqina/flip").then(({ default: Tick }) => {
43
+ if (cancelled || !el.isConnected)
44
+ return;
45
+ // Build the required inner DOM structure for @pqina/flip
46
+ const repeat = document.createElement("div");
47
+ repeat.setAttribute("data-repeat", "true");
48
+ repeat.setAttribute("aria-hidden", "true");
49
+ const flipSpan = document.createElement("span");
50
+ flipSpan.setAttribute("data-view", "flip");
51
+ repeat.appendChild(flipSpan);
52
+ el.appendChild(repeat);
53
+ tickRef.current = Tick.DOM.create(el, { value: valueRef.current });
54
+ destroyFn = () => Tick.DOM.destroy(el);
55
+ });
56
+ return () => {
57
+ cancelled = true;
58
+ destroyFn?.();
59
+ tickRef.current = null;
60
+ };
61
+ }, []);
62
+ // Update value
63
+ React.useEffect(() => {
64
+ valueRef.current = value;
65
+ if (tickRef.current) {
66
+ tickRef.current.value = value;
67
+ }
68
+ }, [value]);
69
+ return (_jsx("div", { ref: containerRef, className: ["tick", className].filter(Boolean).join(" "), style: { fontSize, display: "inline-block" } }));
70
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/digits/flip-digit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ export type SgMatrixDigitProps = {
3
+ /**
4
+ * Text to render using matrix dots.
5
+ * Supports letters, numbers and common symbols.
6
+ */
7
+ value: string;
8
+ /** Color of active dots. */
9
+ color?: string;
10
+ /** Background color of the matrix container. */
11
+ backgroundColor?: string;
12
+ /** Color of inactive dots. */
13
+ offColor?: string;
14
+ /** Dot size in pixels. */
15
+ dotSize?: number;
16
+ /** Gap between dots in pixels. */
17
+ gap?: number;
18
+ /** Gap between characters in pixels. */
19
+ charGap?: number;
20
+ /** Internal padding in pixels. */
21
+ padding?: number;
22
+ /** Border radius of the matrix container in pixels. */
23
+ rounded?: number;
24
+ /** Add a subtle glow around active dots. */
25
+ glow?: boolean;
26
+ /** Additional CSS classes for the outer wrapper. */
27
+ className?: string;
28
+ /** Additional CSS style for the outer wrapper. */
29
+ style?: React.CSSProperties;
30
+ };
31
+ export declare function SgMatrixDigit({ value, color, backgroundColor, offColor, dotSize, gap, charGap, padding, rounded, glow, className, style }: Readonly<SgMatrixDigitProps>): import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=SgMatrixDigit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SgMatrixDigit.d.ts","sourceRoot":"","sources":["../../../src/digits/matrix-digit/SgMatrixDigit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAuDF,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAiB,EACjB,eAA2B,EAC3B,QAAsC,EACtC,OAAW,EACX,GAAO,EACP,OAAW,EACX,OAAW,EACX,OAAY,EACZ,IAAW,EACX,SAAS,EACT,KAAK,EACN,EAAE,QAAQ,CAAC,kBAAkB,CAAC,2CAyD9B"}