@renge-ui/react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1404 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ANIMATION_NAMES: () => import_tokens3.ANIMATION_NAMES,
24
+ Alert: () => Alert,
25
+ Avatar: () => Avatar,
26
+ Badge: () => Badge,
27
+ Button: () => Button,
28
+ Card: () => Card,
29
+ Chip: () => Chip,
30
+ Divider: () => Divider,
31
+ EnergyRing: () => EnergyRing,
32
+ FIBONACCI: () => import_tokens3.FIBONACCI,
33
+ FlowField: () => FlowField,
34
+ FormField: () => FormField,
35
+ GOLDEN_ANGLE: () => import_tokens3.GOLDEN_ANGLE,
36
+ Grid: () => Grid,
37
+ Heading: () => Heading,
38
+ Input: () => Input,
39
+ Navbar: () => Navbar,
40
+ PHI: () => import_tokens3.PHI,
41
+ Progress: () => Progress,
42
+ Pulse: () => Pulse,
43
+ RengeProvider: () => RengeProvider,
44
+ Section: () => Section,
45
+ Spinner: () => Spinner,
46
+ Stack: () => Stack,
47
+ Stat: () => Stat,
48
+ Text: () => Text,
49
+ createRengeTheme: () => import_tokens3.createRengeTheme,
50
+ useRenge: () => useRenge,
51
+ useRengeTheme: () => useRengeTheme
52
+ });
53
+ module.exports = __toCommonJS(index_exports);
54
+
55
+ // src/provider.tsx
56
+ var import_react3 = require("react");
57
+ var import_tokens = require("@renge-ui/tokens");
58
+
59
+ // src/context.ts
60
+ var import_react = require("react");
61
+ var RengeContext = (0, import_react.createContext)(null);
62
+
63
+ // src/hooks/useRenge.ts
64
+ var import_react2 = require("react");
65
+ function useRenge() {
66
+ const context = (0, import_react2.useContext)(RengeContext);
67
+ if (!context) {
68
+ throw new Error("useRenge must be used within a RengeProvider");
69
+ }
70
+ return context;
71
+ }
72
+
73
+ // src/provider.tsx
74
+ var import_jsx_runtime = require("react/jsx-runtime");
75
+ function RengeProvider({
76
+ children,
77
+ config: {
78
+ baseUnit,
79
+ typeBase,
80
+ scaleRatio,
81
+ profile,
82
+ variance,
83
+ varianceSeed,
84
+ includeReset,
85
+ selector
86
+ } = {},
87
+ injectCSS = true
88
+ }) {
89
+ const theme = (0, import_react3.useMemo)(
90
+ () => (0, import_tokens.createRengeTheme)({ baseUnit, typeBase, scaleRatio, profile, variance, varianceSeed, includeReset, selector }),
91
+ [baseUnit, typeBase, scaleRatio, profile, variance, varianceSeed, includeReset, selector]
92
+ );
93
+ (0, import_react3.useInsertionEffect)(() => {
94
+ if (!injectCSS || typeof document === "undefined") return;
95
+ const styleId = "renge-theme";
96
+ let styleEl = document.getElementById(styleId);
97
+ if (!styleEl) {
98
+ styleEl = document.createElement("style");
99
+ styleEl.id = styleId;
100
+ document.head.appendChild(styleEl);
101
+ }
102
+ styleEl.textContent = theme.css;
103
+ }, [theme.css, injectCSS]);
104
+ const value = (0, import_react3.useMemo)(() => ({
105
+ theme,
106
+ profile: profile ?? "ocean"
107
+ }), [theme, profile]);
108
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RengeContext.Provider, { value, children });
109
+ }
110
+ function useRengeTheme(config) {
111
+ return (0, import_react3.useMemo)(() => (0, import_tokens.createRengeTheme)(config), [config]);
112
+ }
113
+
114
+ // src/components/Stack.tsx
115
+ var import_react4 = require("react");
116
+ var import_jsx_runtime2 = require("react/jsx-runtime");
117
+ var Stack = (0, import_react4.forwardRef)(
118
+ function Stack2({
119
+ gap = "3",
120
+ direction = "vertical",
121
+ align = "stretch",
122
+ justify = "start",
123
+ as: Component = "div",
124
+ style,
125
+ children,
126
+ ...props
127
+ }, ref) {
128
+ const alignMap = {
129
+ start: "flex-start",
130
+ center: "center",
131
+ end: "flex-end",
132
+ stretch: "stretch"
133
+ };
134
+ const justifyMap = {
135
+ start: "flex-start",
136
+ center: "center",
137
+ end: "flex-end",
138
+ between: "space-between",
139
+ around: "space-around"
140
+ };
141
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
142
+ Component,
143
+ {
144
+ ref,
145
+ style: {
146
+ display: "flex",
147
+ flexDirection: direction === "vertical" ? "column" : "row",
148
+ gap: `var(--renge-space-${gap})`,
149
+ alignItems: alignMap[align],
150
+ justifyContent: justifyMap[justify],
151
+ ...style
152
+ },
153
+ ...props,
154
+ children
155
+ }
156
+ );
157
+ }
158
+ );
159
+
160
+ // src/components/Grid.tsx
161
+ var import_react5 = require("react");
162
+ var import_jsx_runtime3 = require("react/jsx-runtime");
163
+ var Grid = (0, import_react5.forwardRef)(
164
+ function Grid2({
165
+ columns = 1,
166
+ rows,
167
+ gap = "3",
168
+ gapX,
169
+ gapY,
170
+ align = "stretch",
171
+ justify = "stretch",
172
+ style,
173
+ children,
174
+ ...props
175
+ }, ref) {
176
+ const getTemplate = (value) => {
177
+ if (value === void 0) return void 0;
178
+ if (typeof value === "number") return `repeat(${value}, 1fr)`;
179
+ return value;
180
+ };
181
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
182
+ "div",
183
+ {
184
+ ref,
185
+ style: {
186
+ display: "grid",
187
+ gridTemplateColumns: getTemplate(columns),
188
+ gridTemplateRows: getTemplate(rows),
189
+ columnGap: gapX ? `var(--renge-space-${gapX})` : `var(--renge-space-${gap})`,
190
+ rowGap: gapY ? `var(--renge-space-${gapY})` : `var(--renge-space-${gap})`,
191
+ alignItems: align,
192
+ justifyItems: justify,
193
+ ...style
194
+ },
195
+ ...props,
196
+ children
197
+ }
198
+ );
199
+ }
200
+ );
201
+
202
+ // src/components/Text.tsx
203
+ var import_react6 = require("react");
204
+ var import_jsx_runtime4 = require("react/jsx-runtime");
205
+ var Text = (0, import_react6.forwardRef)(
206
+ function Text2({
207
+ size = "base",
208
+ color = "fg",
209
+ weight = "normal",
210
+ align,
211
+ animation,
212
+ as: Component = "span",
213
+ style,
214
+ children,
215
+ ...props
216
+ }, ref) {
217
+ const weightMap = {
218
+ normal: 400,
219
+ medium: 500,
220
+ semibold: 600,
221
+ bold: 700
222
+ };
223
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
224
+ Component,
225
+ {
226
+ ref,
227
+ style: {
228
+ fontSize: `var(--renge-font-size-${size})`,
229
+ lineHeight: `var(--renge-line-height-${size})`,
230
+ color: `var(--renge-color-${color})`,
231
+ fontWeight: weightMap[weight],
232
+ textAlign: align,
233
+ animation: animation ? `var(--renge-animation-${animation})` : void 0,
234
+ ...style
235
+ },
236
+ ...props,
237
+ children
238
+ }
239
+ );
240
+ }
241
+ );
242
+
243
+ // src/components/Heading.tsx
244
+ var import_react7 = require("react");
245
+ var import_jsx_runtime5 = require("react/jsx-runtime");
246
+ var defaultSizeForLevel = {
247
+ 1: "3xl",
248
+ 2: "2xl",
249
+ 3: "xl",
250
+ 4: "lg",
251
+ 5: "lg",
252
+ 6: "lg"
253
+ };
254
+ var Heading = (0, import_react7.forwardRef)(
255
+ function Heading2({
256
+ level = 2,
257
+ size,
258
+ color = "fg",
259
+ animation,
260
+ style,
261
+ children,
262
+ ...props
263
+ }, ref) {
264
+ const Component = `h${level}`;
265
+ const resolvedSize = size ?? defaultSizeForLevel[level];
266
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
267
+ Component,
268
+ {
269
+ ref,
270
+ style: {
271
+ fontSize: `var(--renge-font-size-${resolvedSize})`,
272
+ lineHeight: `var(--renge-line-height-${resolvedSize})`,
273
+ color: `var(--renge-color-${color})`,
274
+ fontWeight: 600,
275
+ margin: 0,
276
+ animation: animation ? `var(--renge-animation-${animation})` : void 0,
277
+ ...style
278
+ },
279
+ ...props,
280
+ children
281
+ }
282
+ );
283
+ }
284
+ );
285
+
286
+ // src/components/Card.tsx
287
+ var import_react8 = require("react");
288
+ var import_jsx_runtime6 = require("react/jsx-runtime");
289
+ var Card = (0, import_react8.forwardRef)(
290
+ function Card2({
291
+ padding = "4",
292
+ radius = "3",
293
+ variant = "elevated",
294
+ animation,
295
+ style,
296
+ children,
297
+ ...props
298
+ }, ref) {
299
+ const variantStyles = {
300
+ elevated: {
301
+ backgroundColor: `var(--renge-color-bg)`,
302
+ boxShadow: "0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06)"
303
+ },
304
+ outlined: {
305
+ backgroundColor: `var(--renge-color-bg)`,
306
+ border: `1px solid var(--renge-color-border)`
307
+ },
308
+ filled: {
309
+ backgroundColor: `var(--renge-color-bg-subtle)`
310
+ }
311
+ };
312
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
313
+ "div",
314
+ {
315
+ ref,
316
+ style: {
317
+ padding: `var(--renge-space-${padding})`,
318
+ borderRadius: `var(--renge-radius-${radius})`,
319
+ ...variantStyles[variant],
320
+ animation: animation ? `var(--renge-animation-${animation})` : void 0,
321
+ ...style
322
+ },
323
+ ...props,
324
+ children
325
+ }
326
+ );
327
+ }
328
+ );
329
+
330
+ // src/components/Button.tsx
331
+ var import_react9 = require("react");
332
+ var import_jsx_runtime7 = require("react/jsx-runtime");
333
+ var sizeStyles = {
334
+ sm: {
335
+ padding: "var(--renge-space-1) var(--renge-space-2)",
336
+ fontSize: "var(--renge-font-size-sm)"
337
+ },
338
+ md: {
339
+ padding: "var(--renge-space-2) var(--renge-space-4)",
340
+ fontSize: "var(--renge-font-size-base)"
341
+ },
342
+ lg: {
343
+ padding: "var(--renge-space-3) var(--renge-space-5)",
344
+ fontSize: "var(--renge-font-size-lg)"
345
+ }
346
+ };
347
+ var Button = (0, import_react9.forwardRef)(
348
+ function Button2({
349
+ size = "md",
350
+ variant = "solid",
351
+ colorScheme = "accent",
352
+ fullWidth = false,
353
+ animation,
354
+ style,
355
+ children,
356
+ ...props
357
+ }, ref) {
358
+ const getVariantStyles = () => {
359
+ switch (variant) {
360
+ case "solid":
361
+ return {
362
+ backgroundColor: `var(--renge-color-${colorScheme})`,
363
+ color: "var(--renge-color-fg-inverse)",
364
+ border: "none"
365
+ };
366
+ case "outline":
367
+ return {
368
+ backgroundColor: "transparent",
369
+ color: `var(--renge-color-${colorScheme})`,
370
+ border: `1px solid var(--renge-color-${colorScheme})`
371
+ };
372
+ case "ghost":
373
+ return {
374
+ backgroundColor: "transparent",
375
+ color: `var(--renge-color-${colorScheme})`,
376
+ border: "none"
377
+ };
378
+ }
379
+ };
380
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
381
+ "button",
382
+ {
383
+ ref,
384
+ style: {
385
+ ...sizeStyles[size],
386
+ ...getVariantStyles(),
387
+ borderRadius: "var(--renge-radius-2)",
388
+ fontWeight: 500,
389
+ cursor: "pointer",
390
+ transition: `all var(--renge-duration-2) var(--renge-easing-ease-out)`,
391
+ width: fullWidth ? "100%" : void 0,
392
+ animation: animation ? `var(--renge-animation-${animation})` : void 0,
393
+ ...style
394
+ },
395
+ ...props,
396
+ children
397
+ }
398
+ );
399
+ }
400
+ );
401
+
402
+ // src/components/Divider.tsx
403
+ var import_react10 = require("react");
404
+ var import_jsx_runtime8 = require("react/jsx-runtime");
405
+ var Divider = (0, import_react10.forwardRef)(
406
+ function Divider2({
407
+ orientation = "horizontal",
408
+ spacing = "3",
409
+ color = "border-subtle",
410
+ style,
411
+ ...props
412
+ }, ref) {
413
+ const isHorizontal = orientation === "horizontal";
414
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
415
+ "hr",
416
+ {
417
+ ref,
418
+ style: {
419
+ border: "none",
420
+ backgroundColor: `var(--renge-color-${color})`,
421
+ ...isHorizontal ? {
422
+ height: "1px",
423
+ width: "100%",
424
+ marginBlock: `var(--renge-space-${spacing})`
425
+ } : {
426
+ width: "1px",
427
+ height: "100%",
428
+ marginInline: `var(--renge-space-${spacing})`
429
+ },
430
+ ...style
431
+ },
432
+ ...props
433
+ }
434
+ );
435
+ }
436
+ );
437
+
438
+ // src/components/Section.tsx
439
+ var import_react11 = require("react");
440
+ var import_jsx_runtime9 = require("react/jsx-runtime");
441
+ var maxWidthMap = {
442
+ sm: "640px",
443
+ md: "768px",
444
+ lg: "1024px",
445
+ xl: "1280px",
446
+ full: "100%",
447
+ none: void 0
448
+ };
449
+ var Section = (0, import_react11.forwardRef)(
450
+ function Section2({
451
+ padding,
452
+ paddingX = "4",
453
+ paddingY = "6",
454
+ maxWidth = "lg",
455
+ center = true,
456
+ animation,
457
+ as: Component = "section",
458
+ style,
459
+ children,
460
+ ...props
461
+ }, ref) {
462
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
463
+ Component,
464
+ {
465
+ ref,
466
+ style: {
467
+ paddingInline: padding ? `var(--renge-space-${padding})` : `var(--renge-space-${paddingX})`,
468
+ paddingBlock: padding ? `var(--renge-space-${padding})` : `var(--renge-space-${paddingY})`,
469
+ maxWidth: maxWidthMap[maxWidth],
470
+ marginInline: center ? "auto" : void 0,
471
+ animation: animation ? `var(--renge-animation-${animation})` : void 0,
472
+ ...style
473
+ },
474
+ ...props,
475
+ children
476
+ }
477
+ );
478
+ }
479
+ );
480
+
481
+ // src/components/Badge.tsx
482
+ var import_react12 = require("react");
483
+ var import_jsx_runtime10 = require("react/jsx-runtime");
484
+ var colorVars = (variant) => {
485
+ if (variant === "neutral") {
486
+ return {
487
+ background: "var(--renge-color-bg-subtle)",
488
+ color: "var(--renge-color-fg-muted)",
489
+ borderColor: "var(--renge-color-border-subtle)"
490
+ };
491
+ }
492
+ return {
493
+ background: `var(--renge-color-${variant}-subtle)`,
494
+ color: `var(--renge-color-${variant})`,
495
+ borderColor: `var(--renge-color-${variant})`
496
+ };
497
+ };
498
+ var sizeStyles2 = {
499
+ sm: { padding: "var(--renge-space-1) var(--renge-space-2)", fontSize: "var(--renge-font-size-xs)" },
500
+ md: { padding: "var(--renge-space-1) var(--renge-space-3)", fontSize: "var(--renge-font-size-xs)" },
501
+ lg: { padding: "var(--renge-space-2) var(--renge-space-3)", fontSize: "var(--renge-font-size-sm)" }
502
+ };
503
+ var Badge = (0, import_react12.forwardRef)(
504
+ function Badge2({ variant = "neutral", size = "md", style, children, ...props }, ref) {
505
+ const { background, color, borderColor } = colorVars(variant);
506
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
507
+ "span",
508
+ {
509
+ ref,
510
+ style: {
511
+ display: "inline-flex",
512
+ alignItems: "center",
513
+ lineHeight: 1,
514
+ fontWeight: 500,
515
+ borderRadius: "var(--renge-radius-full)",
516
+ border: `1px solid ${borderColor}`,
517
+ background,
518
+ color,
519
+ ...sizeStyles2[size],
520
+ ...style
521
+ },
522
+ ...props,
523
+ children
524
+ }
525
+ );
526
+ }
527
+ );
528
+
529
+ // src/components/Avatar.tsx
530
+ var import_react13 = require("react");
531
+ var import_jsx_runtime11 = require("react/jsx-runtime");
532
+ var sizePx = {
533
+ "1": 20,
534
+ "2": 32,
535
+ "3": 52,
536
+ "4": 84,
537
+ "5": 136
538
+ };
539
+ var fontSizeFor = {
540
+ "1": "var(--renge-font-size-xs)",
541
+ "2": "var(--renge-font-size-sm)",
542
+ "3": "var(--renge-font-size-base)",
543
+ "4": "var(--renge-font-size-lg)",
544
+ "5": "var(--renge-font-size-xl)"
545
+ };
546
+ var Avatar = (0, import_react13.forwardRef)(
547
+ function Avatar2({ src, alt, initials, size = "3", shape = "circle", style, ...props }, ref) {
548
+ const px = sizePx[size];
549
+ const radius = shape === "circle" ? "var(--renge-radius-full)" : "var(--renge-radius-3)";
550
+ const label = initials ? initials.slice(0, 2).toUpperCase() : void 0;
551
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
552
+ "div",
553
+ {
554
+ ref,
555
+ "aria-label": alt,
556
+ role: alt ? "img" : void 0,
557
+ style: {
558
+ display: "inline-flex",
559
+ alignItems: "center",
560
+ justifyContent: "center",
561
+ width: px,
562
+ height: px,
563
+ borderRadius: radius,
564
+ overflow: "hidden",
565
+ flexShrink: 0,
566
+ background: src ? void 0 : "var(--renge-color-bg-muted)",
567
+ color: "var(--renge-color-fg-inverse)",
568
+ fontSize: fontSizeFor[size],
569
+ fontWeight: 600,
570
+ userSelect: "none",
571
+ ...style
572
+ },
573
+ ...props,
574
+ children: src ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
575
+ "img",
576
+ {
577
+ src,
578
+ alt: alt ?? "",
579
+ style: { width: "100%", height: "100%", objectFit: "cover", display: "block" }
580
+ }
581
+ ) : label
582
+ }
583
+ );
584
+ }
585
+ );
586
+
587
+ // src/components/Spinner.tsx
588
+ var import_react14 = require("react");
589
+ var import_jsx_runtime12 = require("react/jsx-runtime");
590
+ if (typeof document !== "undefined") {
591
+ const id = "renge-spinner-kf";
592
+ if (!document.getElementById(id)) {
593
+ const s = document.createElement("style");
594
+ s.id = id;
595
+ s.textContent = "@keyframes rengeSpinnerSpin { to { transform: rotate(360deg); } }";
596
+ document.head.appendChild(s);
597
+ }
598
+ }
599
+ var sizePx2 = { sm: 16, md: 24, lg: 32 };
600
+ var borderWidth = { sm: "2px", md: "2px", lg: "3px" };
601
+ var Spinner = (0, import_react14.forwardRef)(
602
+ function Spinner2({ size = "md", color = "accent", label = "Loading", style, ...props }, ref) {
603
+ const px = sizePx2[size];
604
+ const bw = borderWidth[size];
605
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
606
+ "span",
607
+ {
608
+ ref,
609
+ role: "status",
610
+ "aria-label": label,
611
+ style: {
612
+ display: "inline-block",
613
+ width: px,
614
+ height: px,
615
+ borderRadius: "var(--renge-radius-full)",
616
+ border: `${bw} solid var(--renge-color-border-subtle)`,
617
+ borderTopColor: `var(--renge-color-${color})`,
618
+ animation: `rengeSpinnerSpin var(--renge-duration-3) linear infinite`,
619
+ flexShrink: 0,
620
+ ...style
621
+ },
622
+ ...props
623
+ }
624
+ );
625
+ }
626
+ );
627
+
628
+ // src/components/Progress.tsx
629
+ var import_react15 = require("react");
630
+ var import_jsx_runtime13 = require("react/jsx-runtime");
631
+ var trackHeight = { sm: 4, md: 8, lg: 12 };
632
+ var Progress = (0, import_react15.forwardRef)(
633
+ function Progress2({ value, color = "accent", size = "md", radius = "full", label, style, ...props }, ref) {
634
+ const clamped = Math.min(100, Math.max(0, value));
635
+ const borderRadius = radius === "full" ? "var(--renge-radius-full)" : "0px";
636
+ const height = trackHeight[size];
637
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
638
+ "div",
639
+ {
640
+ ref,
641
+ role: "progressbar",
642
+ "aria-valuenow": clamped,
643
+ "aria-valuemin": 0,
644
+ "aria-valuemax": 100,
645
+ "aria-label": label,
646
+ style: {
647
+ width: "100%",
648
+ height,
649
+ borderRadius,
650
+ background: "var(--renge-color-bg-muted)",
651
+ overflow: "hidden",
652
+ ...style
653
+ },
654
+ ...props,
655
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
656
+ "div",
657
+ {
658
+ style: {
659
+ height: "100%",
660
+ width: `${clamped}%`,
661
+ borderRadius,
662
+ background: `var(--renge-color-${color})`,
663
+ transition: `width var(--renge-duration-3) var(--renge-easing-ease-out)`
664
+ }
665
+ }
666
+ )
667
+ }
668
+ );
669
+ }
670
+ );
671
+
672
+ // src/components/Input.tsx
673
+ var import_react16 = require("react");
674
+ var import_jsx_runtime14 = require("react/jsx-runtime");
675
+ var sizeStyles3 = {
676
+ sm: {
677
+ padding: "var(--renge-space-1) var(--renge-space-2)",
678
+ fontSize: "var(--renge-font-size-sm)"
679
+ },
680
+ md: {
681
+ padding: "var(--renge-space-2) var(--renge-space-3)",
682
+ fontSize: "var(--renge-font-size-base)"
683
+ },
684
+ lg: {
685
+ padding: "var(--renge-space-2) var(--renge-space-4)",
686
+ fontSize: "var(--renge-font-size-base)"
687
+ }
688
+ };
689
+ var stateColor = {
690
+ default: "var(--renge-color-border)",
691
+ error: "var(--renge-color-danger)",
692
+ success: "var(--renge-color-success)"
693
+ };
694
+ var Input = (0, import_react16.forwardRef)(
695
+ function Input2({ size = "md", state = "default", fullWidth = false, style, ...props }, ref) {
696
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
697
+ "input",
698
+ {
699
+ ref,
700
+ style: {
701
+ ...sizeStyles3[size],
702
+ display: "block",
703
+ width: fullWidth ? "100%" : void 0,
704
+ background: "var(--renge-color-bg)",
705
+ color: "var(--renge-color-fg)",
706
+ border: `1px solid ${stateColor[state]}`,
707
+ borderRadius: "var(--renge-radius-2)",
708
+ outline: "none",
709
+ transition: `border-color var(--renge-duration-1) var(--renge-easing-ease-out)`,
710
+ // Focus is handled via :focus-visible pseudo-class but inline styles can't do that.
711
+ // We set a CSS custom property approach via box-shadow as focus ring instead.
712
+ boxSizing: "border-box",
713
+ fontFamily: "inherit",
714
+ ...style
715
+ },
716
+ onFocus: (e) => {
717
+ e.currentTarget.style.outline = `2px solid var(--renge-color-border-focus)`;
718
+ e.currentTarget.style.outlineOffset = "2px";
719
+ props.onFocus?.(e);
720
+ },
721
+ onBlur: (e) => {
722
+ e.currentTarget.style.outline = "none";
723
+ props.onBlur?.(e);
724
+ },
725
+ ...props
726
+ }
727
+ );
728
+ }
729
+ );
730
+
731
+ // src/components/Chip.tsx
732
+ var import_react17 = require("react");
733
+ var import_jsx_runtime15 = require("react/jsx-runtime");
734
+ var colorVars2 = (variant) => {
735
+ if (variant === "neutral") {
736
+ return {
737
+ background: "var(--renge-color-bg-subtle)",
738
+ color: "var(--renge-color-fg-muted)",
739
+ borderColor: "var(--renge-color-border-subtle)"
740
+ };
741
+ }
742
+ return {
743
+ background: `var(--renge-color-${variant}-subtle)`,
744
+ color: `var(--renge-color-${variant})`,
745
+ borderColor: `var(--renge-color-${variant})`
746
+ };
747
+ };
748
+ var Chip = (0, import_react17.forwardRef)(
749
+ function Chip2({ variant = "neutral", onDismiss, style, children, ...props }, ref) {
750
+ const { background, color, borderColor } = colorVars2(variant);
751
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
752
+ "span",
753
+ {
754
+ ref,
755
+ style: {
756
+ display: "inline-flex",
757
+ alignItems: "center",
758
+ gap: "var(--renge-space-2)",
759
+ padding: "var(--renge-space-2) var(--renge-space-3)",
760
+ fontSize: "var(--renge-font-size-sm)",
761
+ fontWeight: 500,
762
+ lineHeight: 1,
763
+ borderRadius: "var(--renge-radius-full)",
764
+ border: `1px solid ${borderColor}`,
765
+ background,
766
+ color,
767
+ ...style
768
+ },
769
+ ...props,
770
+ children: [
771
+ children,
772
+ onDismiss && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
773
+ "button",
774
+ {
775
+ onClick: onDismiss,
776
+ "aria-label": "Dismiss",
777
+ style: {
778
+ display: "inline-flex",
779
+ alignItems: "center",
780
+ justifyContent: "center",
781
+ background: "none",
782
+ border: "none",
783
+ padding: 0,
784
+ cursor: "pointer",
785
+ color: "inherit",
786
+ fontSize: "var(--renge-font-size-sm)",
787
+ lineHeight: 1,
788
+ opacity: 0.7
789
+ },
790
+ children: "\xD7"
791
+ }
792
+ )
793
+ ]
794
+ }
795
+ );
796
+ }
797
+ );
798
+
799
+ // src/components/Alert.tsx
800
+ var import_react18 = require("react");
801
+ var import_jsx_runtime16 = require("react/jsx-runtime");
802
+ var Alert = (0, import_react18.forwardRef)(
803
+ function Alert2({ status = "info", title, style, children, ...props }, ref) {
804
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
805
+ "div",
806
+ {
807
+ ref,
808
+ role: "alert",
809
+ style: {
810
+ display: "flex",
811
+ flexDirection: "column",
812
+ gap: title && children ? "var(--renge-space-1)" : void 0,
813
+ padding: "var(--renge-space-3) var(--renge-space-4)",
814
+ borderRadius: "var(--renge-radius-2)",
815
+ borderLeft: `3px solid var(--renge-color-${status})`,
816
+ background: `var(--renge-color-${status}-subtle)`,
817
+ color: "var(--renge-color-fg)",
818
+ ...style
819
+ },
820
+ ...props,
821
+ children: [
822
+ title && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
823
+ "strong",
824
+ {
825
+ style: {
826
+ fontSize: "var(--renge-font-size-sm)",
827
+ fontWeight: 600,
828
+ color: "var(--renge-color-fg)"
829
+ },
830
+ children: title
831
+ }
832
+ ),
833
+ children && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: "var(--renge-font-size-sm)", color: "var(--renge-color-fg)" }, children })
834
+ ]
835
+ }
836
+ );
837
+ }
838
+ );
839
+
840
+ // src/components/FormField.tsx
841
+ var import_react19 = require("react");
842
+ var import_jsx_runtime17 = require("react/jsx-runtime");
843
+ var FormField = (0, import_react19.forwardRef)(
844
+ function FormField2({ label, htmlFor, helperText, errorText, required, style, children, ...props }, ref) {
845
+ const subText = errorText ?? helperText;
846
+ const subColor = errorText ? "var(--renge-color-danger)" : "var(--renge-color-fg-muted)";
847
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
848
+ "div",
849
+ {
850
+ ref,
851
+ style: {
852
+ display: "flex",
853
+ flexDirection: "column",
854
+ gap: "var(--renge-space-2)",
855
+ ...style
856
+ },
857
+ ...props,
858
+ children: [
859
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
860
+ "label",
861
+ {
862
+ htmlFor,
863
+ style: {
864
+ fontSize: "var(--renge-font-size-sm)",
865
+ fontWeight: 500,
866
+ color: "var(--renge-color-fg)",
867
+ display: "flex",
868
+ alignItems: "center",
869
+ gap: "var(--renge-space-1)"
870
+ },
871
+ children: [
872
+ label,
873
+ required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", style: { color: "var(--renge-color-danger)" }, children: "*" })
874
+ ]
875
+ }
876
+ ),
877
+ children,
878
+ subText && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
879
+ "span",
880
+ {
881
+ style: {
882
+ fontSize: "var(--renge-font-size-xs)",
883
+ color: subColor
884
+ },
885
+ children: subText
886
+ }
887
+ )
888
+ ]
889
+ }
890
+ );
891
+ }
892
+ );
893
+
894
+ // src/components/Stat.tsx
895
+ var import_react20 = require("react");
896
+ var import_jsx_runtime18 = require("react/jsx-runtime");
897
+ var trendColor = {
898
+ up: "var(--renge-color-success)",
899
+ down: "var(--renge-color-danger)",
900
+ neutral: "var(--renge-color-fg-muted)"
901
+ };
902
+ var trendBg = {
903
+ up: "var(--renge-color-success-subtle)",
904
+ down: "var(--renge-color-danger-subtle)",
905
+ neutral: "var(--renge-color-bg-subtle)"
906
+ };
907
+ var trendBorder = {
908
+ up: "var(--renge-color-success)",
909
+ down: "var(--renge-color-danger)",
910
+ neutral: "var(--renge-color-border-subtle)"
911
+ };
912
+ var trendSymbol = {
913
+ up: "\u2191",
914
+ down: "\u2193",
915
+ neutral: "\u2014"
916
+ };
917
+ var Stat = (0, import_react20.forwardRef)(
918
+ function Stat2({ value, label, trend, trendValue, caption, style, ...props }, ref) {
919
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
920
+ "div",
921
+ {
922
+ ref,
923
+ style: {
924
+ display: "flex",
925
+ flexDirection: "column",
926
+ padding: "var(--renge-space-4)",
927
+ ...style
928
+ },
929
+ ...props,
930
+ children: [
931
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
932
+ "span",
933
+ {
934
+ style: {
935
+ fontSize: "var(--renge-font-size-xs)",
936
+ color: "var(--renge-color-fg-muted)",
937
+ marginBottom: "var(--renge-space-1)",
938
+ fontWeight: 500
939
+ },
940
+ children: label
941
+ }
942
+ ),
943
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
944
+ "div",
945
+ {
946
+ style: {
947
+ display: "flex",
948
+ alignItems: "baseline",
949
+ gap: "var(--renge-space-3)",
950
+ flexWrap: "wrap"
951
+ },
952
+ children: [
953
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
954
+ "span",
955
+ {
956
+ style: {
957
+ fontSize: "var(--renge-font-size-3xl)",
958
+ lineHeight: 1.2,
959
+ fontWeight: 600,
960
+ color: "var(--renge-color-fg)"
961
+ },
962
+ children: value
963
+ }
964
+ ),
965
+ trend && trendValue && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
966
+ "span",
967
+ {
968
+ style: {
969
+ display: "inline-flex",
970
+ alignItems: "center",
971
+ gap: "var(--renge-space-1)",
972
+ padding: "var(--renge-space-1) var(--renge-space-2)",
973
+ fontSize: "var(--renge-font-size-xs)",
974
+ fontWeight: 500,
975
+ lineHeight: 1,
976
+ borderRadius: "var(--renge-radius-full)",
977
+ border: `1px solid ${trendBorder[trend]}`,
978
+ background: trendBg[trend],
979
+ color: trendColor[trend]
980
+ },
981
+ children: [
982
+ trendSymbol[trend],
983
+ " ",
984
+ trendValue
985
+ ]
986
+ }
987
+ )
988
+ ]
989
+ }
990
+ ),
991
+ caption && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
992
+ "span",
993
+ {
994
+ style: {
995
+ fontSize: "var(--renge-font-size-xs)",
996
+ color: "var(--renge-color-fg-muted)",
997
+ marginTop: "var(--renge-space-1)"
998
+ },
999
+ children: caption
1000
+ }
1001
+ )
1002
+ ]
1003
+ }
1004
+ );
1005
+ }
1006
+ );
1007
+
1008
+ // src/components/Navbar.tsx
1009
+ var import_react21 = require("react");
1010
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1011
+ var Navbar = (0, import_react21.forwardRef)(
1012
+ function Navbar2({ sticky = false, border = true, height = "56px", paddingX = "5", style, children, ...props }, ref) {
1013
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1014
+ "nav",
1015
+ {
1016
+ ref,
1017
+ style: {
1018
+ display: "flex",
1019
+ alignItems: "center",
1020
+ minHeight: height,
1021
+ padding: `0 var(--renge-space-${paddingX})`,
1022
+ background: "var(--renge-color-bg)",
1023
+ borderBottom: border ? "1px solid var(--renge-color-border-subtle)" : void 0,
1024
+ position: sticky ? "sticky" : void 0,
1025
+ top: sticky ? 0 : void 0,
1026
+ zIndex: sticky ? 100 : void 0,
1027
+ boxSizing: "border-box",
1028
+ ...style
1029
+ },
1030
+ ...props,
1031
+ children
1032
+ }
1033
+ );
1034
+ }
1035
+ );
1036
+
1037
+ // src/components/EnergyRing.tsx
1038
+ var import_react22 = require("react");
1039
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1040
+ var KEYFRAMES = `
1041
+ @keyframes rengeRingPulse {
1042
+ 0%, 100% { opacity: 1; }
1043
+ 50% { opacity: 0.382; }
1044
+ }
1045
+ `;
1046
+ if (typeof document !== "undefined") {
1047
+ const id = "__renge-ring-keyframes__";
1048
+ if (!document.getElementById(id)) {
1049
+ const style = document.createElement("style");
1050
+ style.id = id;
1051
+ style.textContent = KEYFRAMES;
1052
+ document.head.appendChild(style);
1053
+ }
1054
+ }
1055
+ var SIZE_CONFIG = {
1056
+ sm: { diameter: 32, stroke: 3, fontSize: "var(--renge-font-size-xs)" },
1057
+ md: { diameter: 52, stroke: 4, fontSize: "var(--renge-font-size-xs)" },
1058
+ lg: { diameter: 84, stroke: 5, fontSize: "var(--renge-font-size-sm)" },
1059
+ xl: { diameter: 136, stroke: 6, fontSize: "var(--renge-font-size-base)" }
1060
+ };
1061
+ var PULSE_DURATION = {
1062
+ rest: "var(--renge-duration-7)",
1063
+ // 2100ms — slow, resting breath
1064
+ active: "var(--renge-duration-5)",
1065
+ // 800ms — normal active pulse
1066
+ fire: "var(--renge-duration-4)"
1067
+ // 500ms — intense, rapid
1068
+ };
1069
+ var EnergyRing = (0, import_react22.forwardRef)(
1070
+ function EnergyRing2({
1071
+ value,
1072
+ size = "md",
1073
+ color = "accent",
1074
+ pulse = false,
1075
+ rate = "active",
1076
+ label,
1077
+ style,
1078
+ ...props
1079
+ }, ref) {
1080
+ const { diameter, stroke, fontSize } = SIZE_CONFIG[size];
1081
+ const radius = (diameter - stroke) / 2;
1082
+ const circumference = 2 * Math.PI * radius;
1083
+ const clampedValue = Math.min(100, Math.max(0, value));
1084
+ const offset = circumference * (1 - clampedValue / 100);
1085
+ const center = diameter / 2;
1086
+ const colorVar = `var(--renge-color-${color})`;
1087
+ const colorSubtleVar = `var(--renge-color-${color}-subtle)`;
1088
+ const pulseStyle = pulse ? {
1089
+ animation: `rengeRingPulse ${PULSE_DURATION[rate]} var(--renge-easing-ease-in-out) infinite`
1090
+ } : {};
1091
+ const showLabel = label !== null && (size === "lg" || size === "xl");
1092
+ const labelText = label !== void 0 ? label : `${clampedValue}%`;
1093
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1094
+ "div",
1095
+ {
1096
+ ref,
1097
+ role: "progressbar",
1098
+ "aria-valuenow": clampedValue,
1099
+ "aria-valuemin": 0,
1100
+ "aria-valuemax": 100,
1101
+ style: {
1102
+ display: "inline-flex",
1103
+ alignItems: "center",
1104
+ justifyContent: "center",
1105
+ width: `${diameter}px`,
1106
+ height: `${diameter}px`,
1107
+ position: "relative",
1108
+ flexShrink: 0,
1109
+ ...style
1110
+ },
1111
+ ...props,
1112
+ children: [
1113
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1114
+ "svg",
1115
+ {
1116
+ width: diameter,
1117
+ height: diameter,
1118
+ viewBox: `0 0 ${diameter} ${diameter}`,
1119
+ style: { position: "absolute", top: 0, left: 0, ...pulseStyle },
1120
+ "aria-hidden": "true",
1121
+ children: [
1122
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1123
+ "circle",
1124
+ {
1125
+ cx: center,
1126
+ cy: center,
1127
+ r: radius,
1128
+ fill: "none",
1129
+ stroke: colorSubtleVar,
1130
+ strokeWidth: stroke
1131
+ }
1132
+ ),
1133
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1134
+ "circle",
1135
+ {
1136
+ cx: center,
1137
+ cy: center,
1138
+ r: radius,
1139
+ fill: "none",
1140
+ stroke: colorVar,
1141
+ strokeWidth: stroke,
1142
+ strokeLinecap: "round",
1143
+ strokeDasharray: circumference,
1144
+ strokeDashoffset: offset,
1145
+ style: {
1146
+ transform: "rotate(-90deg)",
1147
+ transformOrigin: `${center}px ${center}px`,
1148
+ transition: `stroke-dashoffset var(--renge-duration-5) var(--renge-easing-ease-out)`
1149
+ }
1150
+ }
1151
+ )
1152
+ ]
1153
+ }
1154
+ ),
1155
+ showLabel && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1156
+ "span",
1157
+ {
1158
+ style: {
1159
+ fontSize,
1160
+ color: colorVar,
1161
+ fontVariantNumeric: "tabular-nums",
1162
+ lineHeight: 1,
1163
+ pointerEvents: "none"
1164
+ },
1165
+ children: labelText
1166
+ }
1167
+ )
1168
+ ]
1169
+ }
1170
+ );
1171
+ }
1172
+ );
1173
+
1174
+ // src/components/Pulse.tsx
1175
+ var import_react23 = require("react");
1176
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1177
+ var KEYFRAMES2 = `
1178
+ @keyframes rengePulseBreathe {
1179
+ 0%, 100% {
1180
+ transform: scale(1);
1181
+ opacity: 1;
1182
+ }
1183
+ 50% {
1184
+ transform: scale(1.618);
1185
+ opacity: 0.382;
1186
+ }
1187
+ }
1188
+ @keyframes rengePulseRipple {
1189
+ 0% { transform: scale(1); opacity: 0.5; }
1190
+ 100% { transform: scale(2.618); opacity: 0; }
1191
+ }
1192
+ `;
1193
+ if (typeof document !== "undefined") {
1194
+ const id = "__renge-pulse-keyframes__";
1195
+ if (!document.getElementById(id)) {
1196
+ const style = document.createElement("style");
1197
+ style.id = id;
1198
+ style.textContent = KEYFRAMES2;
1199
+ document.head.appendChild(style);
1200
+ }
1201
+ }
1202
+ var SIZE_PX = {
1203
+ sm: 6,
1204
+ md: 10,
1205
+ lg: 16
1206
+ };
1207
+ var RATE_DURATION = {
1208
+ rest: "var(--renge-duration-7)",
1209
+ // 2100ms
1210
+ active: "var(--renge-duration-5)",
1211
+ // 800ms
1212
+ fire: "var(--renge-duration-4)"
1213
+ // 500ms
1214
+ };
1215
+ var Pulse = (0, import_react23.forwardRef)(
1216
+ function Pulse2({
1217
+ rate = "active",
1218
+ color = "accent",
1219
+ size = "md",
1220
+ ripple = false,
1221
+ style,
1222
+ ...props
1223
+ }, ref) {
1224
+ const diameter = SIZE_PX[size];
1225
+ const duration = RATE_DURATION[rate];
1226
+ const colorVar = `var(--renge-color-${color})`;
1227
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1228
+ "span",
1229
+ {
1230
+ ref,
1231
+ "aria-hidden": "true",
1232
+ style: {
1233
+ display: "inline-flex",
1234
+ alignItems: "center",
1235
+ justifyContent: "center",
1236
+ position: "relative",
1237
+ width: `${diameter}px`,
1238
+ height: `${diameter}px`,
1239
+ flexShrink: 0,
1240
+ ...style
1241
+ },
1242
+ ...props,
1243
+ children: [
1244
+ ripple && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1245
+ "span",
1246
+ {
1247
+ style: {
1248
+ position: "absolute",
1249
+ inset: 0,
1250
+ borderRadius: "9999px",
1251
+ backgroundColor: colorVar,
1252
+ animation: `rengePulseRipple ${duration} var(--renge-easing-ease-out) infinite`
1253
+ }
1254
+ }
1255
+ ),
1256
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1257
+ "span",
1258
+ {
1259
+ style: {
1260
+ width: `${diameter}px`,
1261
+ height: `${diameter}px`,
1262
+ borderRadius: "9999px",
1263
+ backgroundColor: colorVar,
1264
+ display: "block",
1265
+ animation: `rengePulseBreathe ${duration} var(--renge-easing-ease-in-out) infinite`
1266
+ }
1267
+ }
1268
+ )
1269
+ ]
1270
+ }
1271
+ );
1272
+ }
1273
+ );
1274
+
1275
+ // src/components/FlowField.tsx
1276
+ var import_react24 = require("react");
1277
+ var import_tokens2 = require("@renge-ui/tokens");
1278
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1279
+ var KEYFRAMES3 = `
1280
+ @keyframes rengeFlowPulse {
1281
+ 0%, 100% { opacity: var(--ff-base-opacity); r: var(--ff-base-r); }
1282
+ 50% { opacity: var(--ff-peak-opacity); r: var(--ff-peak-r); }
1283
+ }
1284
+ `;
1285
+ if (typeof document !== "undefined") {
1286
+ const id = "__renge-flow-keyframes__";
1287
+ if (!document.getElementById(id)) {
1288
+ const style = document.createElement("style");
1289
+ style.id = id;
1290
+ style.textContent = KEYFRAMES3;
1291
+ document.head.appendChild(style);
1292
+ }
1293
+ }
1294
+ var ENERGY_CONFIG = {
1295
+ void: { density: 0.2, baseOpacity: 0.06, peakOpacity: 0.15, baseR: 1, peakR: 1.4, duration: "var(--renge-duration-8)" },
1296
+ // 3400ms
1297
+ rest: { density: 0.45, baseOpacity: 0.12, peakOpacity: 0.28, baseR: 1.2, peakR: 1.8, duration: "var(--renge-duration-6)" },
1298
+ // 1300ms
1299
+ active: { density: 0.72, baseOpacity: 0.22, peakOpacity: 0.55, baseR: 1.4, peakR: 2.2, duration: "var(--renge-duration-5)" },
1300
+ // 800ms
1301
+ fire: { density: 1, baseOpacity: 0.35, peakOpacity: 0.82, baseR: 1.6, peakR: 2.618, duration: "var(--renge-duration-4)" }
1302
+ // 500ms
1303
+ };
1304
+ var FlowField = (0, import_react24.forwardRef)(
1305
+ function FlowField2({
1306
+ count = 144,
1307
+ size = 400,
1308
+ energy = "active",
1309
+ color = "accent",
1310
+ style,
1311
+ ...props
1312
+ }, ref) {
1313
+ const cfg = ENERGY_CONFIG[energy];
1314
+ const visibleCount = Math.round(count * cfg.density);
1315
+ const colorVar = `var(--renge-color-${color})`;
1316
+ const points = (0, import_react24.useMemo)(() => {
1317
+ const spread = size / (2 * Math.sqrt(count));
1318
+ return (0, import_tokens2.phyllotaxis)({ count, spread, scale: 1 });
1319
+ }, [count, size]);
1320
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1321
+ "div",
1322
+ {
1323
+ ref,
1324
+ style: {
1325
+ width: `${size}px`,
1326
+ height: `${size}px`,
1327
+ position: "relative",
1328
+ overflow: "hidden",
1329
+ flexShrink: 0,
1330
+ // CSS vars for SVG animation — set at container level
1331
+ ["--ff-base-opacity"]: String(cfg.baseOpacity),
1332
+ ["--ff-peak-opacity"]: String(cfg.peakOpacity),
1333
+ ["--ff-base-r"]: `${cfg.baseR}px`,
1334
+ ["--ff-peak-r"]: `${cfg.peakR}px`,
1335
+ ...style
1336
+ },
1337
+ ...props,
1338
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1339
+ "svg",
1340
+ {
1341
+ width: size,
1342
+ height: size,
1343
+ viewBox: `${-size / 2} ${-size / 2} ${size} ${size}`,
1344
+ "aria-hidden": "true",
1345
+ style: { display: "block" },
1346
+ children: points.slice(0, visibleCount).map((pt) => {
1347
+ const delayFraction = pt.index / visibleCount;
1348
+ const delayMs = delayFraction * 2100;
1349
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1350
+ "circle",
1351
+ {
1352
+ cx: pt.x,
1353
+ cy: pt.y,
1354
+ r: cfg.baseR,
1355
+ fill: colorVar,
1356
+ style: {
1357
+ animation: `rengeFlowPulse ${cfg.duration} var(--renge-easing-ease-in-out) ${delayMs.toFixed(0)}ms infinite`
1358
+ }
1359
+ },
1360
+ pt.index
1361
+ );
1362
+ })
1363
+ }
1364
+ )
1365
+ }
1366
+ );
1367
+ }
1368
+ );
1369
+
1370
+ // src/index.ts
1371
+ var import_tokens3 = require("@renge-ui/tokens");
1372
+ // Annotate the CommonJS export names for ESM import in node:
1373
+ 0 && (module.exports = {
1374
+ ANIMATION_NAMES,
1375
+ Alert,
1376
+ Avatar,
1377
+ Badge,
1378
+ Button,
1379
+ Card,
1380
+ Chip,
1381
+ Divider,
1382
+ EnergyRing,
1383
+ FIBONACCI,
1384
+ FlowField,
1385
+ FormField,
1386
+ GOLDEN_ANGLE,
1387
+ Grid,
1388
+ Heading,
1389
+ Input,
1390
+ Navbar,
1391
+ PHI,
1392
+ Progress,
1393
+ Pulse,
1394
+ RengeProvider,
1395
+ Section,
1396
+ Spinner,
1397
+ Stack,
1398
+ Stat,
1399
+ Text,
1400
+ createRengeTheme,
1401
+ useRenge,
1402
+ useRengeTheme
1403
+ });
1404
+ //# sourceMappingURL=index.js.map