@rubenpazch/info-row 1.0.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.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # InfoRow
2
+
3
+ Generated component package.
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ type InfoRowVariant = "default" | "blue" | "yellow" | "purple" | "green" | "red" | "indigo" | "gray";
3
+ type InfoRowSize = "xs" | "sm" | "md" | "lg";
4
+ type InfoRowLayout = "vertical" | "horizontal" | "inline" | "compact";
5
+ interface InfoRowProps {
6
+ icon: React.ReactNode;
7
+ label: string;
8
+ value: string;
9
+ variant?: InfoRowVariant;
10
+ size?: InfoRowSize;
11
+ layout?: InfoRowLayout;
12
+ hideIcon?: boolean;
13
+ hideLabel?: boolean;
14
+ className?: string;
15
+ action?: React.ReactNode;
16
+ }
17
+ /**
18
+ * InfoRow component
19
+ * Displays a row of information with an icon, label, and value
20
+ * Used in detail views to present structured data
21
+ *
22
+ * @param variant - Color variant for the background. Options:
23
+ * - 'default': No background color (gray text)
24
+ * - 'blue': Blue background (for far/distance vision)
25
+ * - 'yellow': Yellow background (for near vision)
26
+ * - 'purple': Purple background (for both vision types)
27
+ * - 'green': Green background
28
+ * - 'red': Red background
29
+ * - 'indigo': Indigo background
30
+ * - 'gray': Gray background
31
+ *
32
+ * @param size - Size variant. Options: 'xs' | 'sm' | 'md' | 'lg'
33
+ * @param layout - Layout variant. Options:
34
+ * - 'vertical': Icon and text stacked (default)
35
+ * - 'horizontal': All elements in one line
36
+ * - 'inline': Compact single line without much spacing
37
+ * - 'compact': Minimal spacing for dense layouts
38
+ * @param hideIcon - Hide the icon (useful for responsive layouts)
39
+ * @param hideLabel - Hide the label, show only value (useful for mobile)
40
+ * @param className - Additional CSS classes
41
+ * @param action - Optional actionable element (link, button, icon button) positioned on the right
42
+ */
43
+ declare const InfoRow: React.FC<InfoRowProps>;
44
+ export default InfoRow;
45
+ //# sourceMappingURL=InfoRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoRow.d.ts","sourceRoot":"","sources":["../src/InfoRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,cAAc,GACf,SAAS,GACT,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,KAAK,GACL,QAAQ,GACR,MAAM,CAAC;AAEX,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,KAAK,aAAa,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtE,UAAU,YAAY;IACpB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAqOnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,614 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('react');
4
+
5
+ var jsxRuntime = {exports: {}};
6
+
7
+ var reactJsxRuntime_production = {};
8
+
9
+ /**
10
+ * @license React
11
+ * react-jsx-runtime.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+
19
+ var hasRequiredReactJsxRuntime_production;
20
+
21
+ function requireReactJsxRuntime_production () {
22
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
23
+ hasRequiredReactJsxRuntime_production = 1;
24
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
25
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
26
+ function jsxProd(type, config, maybeKey) {
27
+ var key = null;
28
+ void 0 !== maybeKey && (key = "" + maybeKey);
29
+ void 0 !== config.key && (key = "" + config.key);
30
+ if ("key" in config) {
31
+ maybeKey = {};
32
+ for (var propName in config)
33
+ "key" !== propName && (maybeKey[propName] = config[propName]);
34
+ } else maybeKey = config;
35
+ config = maybeKey.ref;
36
+ return {
37
+ $$typeof: REACT_ELEMENT_TYPE,
38
+ type: type,
39
+ key: key,
40
+ ref: void 0 !== config ? config : null,
41
+ props: maybeKey
42
+ };
43
+ }
44
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
45
+ reactJsxRuntime_production.jsx = jsxProd;
46
+ reactJsxRuntime_production.jsxs = jsxProd;
47
+ return reactJsxRuntime_production;
48
+ }
49
+
50
+ var reactJsxRuntime_development = {};
51
+
52
+ /**
53
+ * @license React
54
+ * react-jsx-runtime.development.js
55
+ *
56
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
57
+ *
58
+ * This source code is licensed under the MIT license found in the
59
+ * LICENSE file in the root directory of this source tree.
60
+ */
61
+
62
+ var hasRequiredReactJsxRuntime_development;
63
+
64
+ function requireReactJsxRuntime_development () {
65
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
66
+ hasRequiredReactJsxRuntime_development = 1;
67
+ "production" !== process.env.NODE_ENV &&
68
+ (function () {
69
+ function getComponentNameFromType(type) {
70
+ if (null == type) return null;
71
+ if ("function" === typeof type)
72
+ return type.$$typeof === REACT_CLIENT_REFERENCE
73
+ ? null
74
+ : type.displayName || type.name || null;
75
+ if ("string" === typeof type) return type;
76
+ switch (type) {
77
+ case REACT_FRAGMENT_TYPE:
78
+ return "Fragment";
79
+ case REACT_PROFILER_TYPE:
80
+ return "Profiler";
81
+ case REACT_STRICT_MODE_TYPE:
82
+ return "StrictMode";
83
+ case REACT_SUSPENSE_TYPE:
84
+ return "Suspense";
85
+ case REACT_SUSPENSE_LIST_TYPE:
86
+ return "SuspenseList";
87
+ case REACT_ACTIVITY_TYPE:
88
+ return "Activity";
89
+ }
90
+ if ("object" === typeof type)
91
+ switch (
92
+ ("number" === typeof type.tag &&
93
+ console.error(
94
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
95
+ ),
96
+ type.$$typeof)
97
+ ) {
98
+ case REACT_PORTAL_TYPE:
99
+ return "Portal";
100
+ case REACT_CONTEXT_TYPE:
101
+ return type.displayName || "Context";
102
+ case REACT_CONSUMER_TYPE:
103
+ return (type._context.displayName || "Context") + ".Consumer";
104
+ case REACT_FORWARD_REF_TYPE:
105
+ var innerType = type.render;
106
+ type = type.displayName;
107
+ type ||
108
+ ((type = innerType.displayName || innerType.name || ""),
109
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
110
+ return type;
111
+ case REACT_MEMO_TYPE:
112
+ return (
113
+ (innerType = type.displayName || null),
114
+ null !== innerType
115
+ ? innerType
116
+ : getComponentNameFromType(type.type) || "Memo"
117
+ );
118
+ case REACT_LAZY_TYPE:
119
+ innerType = type._payload;
120
+ type = type._init;
121
+ try {
122
+ return getComponentNameFromType(type(innerType));
123
+ } catch (x) {}
124
+ }
125
+ return null;
126
+ }
127
+ function testStringCoercion(value) {
128
+ return "" + value;
129
+ }
130
+ function checkKeyStringCoercion(value) {
131
+ try {
132
+ testStringCoercion(value);
133
+ var JSCompiler_inline_result = !1;
134
+ } catch (e) {
135
+ JSCompiler_inline_result = true;
136
+ }
137
+ if (JSCompiler_inline_result) {
138
+ JSCompiler_inline_result = console;
139
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
140
+ var JSCompiler_inline_result$jscomp$0 =
141
+ ("function" === typeof Symbol &&
142
+ Symbol.toStringTag &&
143
+ value[Symbol.toStringTag]) ||
144
+ value.constructor.name ||
145
+ "Object";
146
+ JSCompiler_temp_const.call(
147
+ JSCompiler_inline_result,
148
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
149
+ JSCompiler_inline_result$jscomp$0
150
+ );
151
+ return testStringCoercion(value);
152
+ }
153
+ }
154
+ function getTaskName(type) {
155
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
156
+ if (
157
+ "object" === typeof type &&
158
+ null !== type &&
159
+ type.$$typeof === REACT_LAZY_TYPE
160
+ )
161
+ return "<...>";
162
+ try {
163
+ var name = getComponentNameFromType(type);
164
+ return name ? "<" + name + ">" : "<...>";
165
+ } catch (x) {
166
+ return "<...>";
167
+ }
168
+ }
169
+ function getOwner() {
170
+ var dispatcher = ReactSharedInternals.A;
171
+ return null === dispatcher ? null : dispatcher.getOwner();
172
+ }
173
+ function UnknownOwner() {
174
+ return Error("react-stack-top-frame");
175
+ }
176
+ function hasValidKey(config) {
177
+ if (hasOwnProperty.call(config, "key")) {
178
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
179
+ if (getter && getter.isReactWarning) return false;
180
+ }
181
+ return void 0 !== config.key;
182
+ }
183
+ function defineKeyPropWarningGetter(props, displayName) {
184
+ function warnAboutAccessingKey() {
185
+ specialPropKeyWarningShown ||
186
+ ((specialPropKeyWarningShown = true),
187
+ console.error(
188
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
189
+ displayName
190
+ ));
191
+ }
192
+ warnAboutAccessingKey.isReactWarning = true;
193
+ Object.defineProperty(props, "key", {
194
+ get: warnAboutAccessingKey,
195
+ configurable: true
196
+ });
197
+ }
198
+ function elementRefGetterWithDeprecationWarning() {
199
+ var componentName = getComponentNameFromType(this.type);
200
+ didWarnAboutElementRef[componentName] ||
201
+ ((didWarnAboutElementRef[componentName] = true),
202
+ console.error(
203
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
204
+ ));
205
+ componentName = this.props.ref;
206
+ return void 0 !== componentName ? componentName : null;
207
+ }
208
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
209
+ var refProp = props.ref;
210
+ type = {
211
+ $$typeof: REACT_ELEMENT_TYPE,
212
+ type: type,
213
+ key: key,
214
+ props: props,
215
+ _owner: owner
216
+ };
217
+ null !== (void 0 !== refProp ? refProp : null)
218
+ ? Object.defineProperty(type, "ref", {
219
+ enumerable: false,
220
+ get: elementRefGetterWithDeprecationWarning
221
+ })
222
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
223
+ type._store = {};
224
+ Object.defineProperty(type._store, "validated", {
225
+ configurable: false,
226
+ enumerable: false,
227
+ writable: true,
228
+ value: 0
229
+ });
230
+ Object.defineProperty(type, "_debugInfo", {
231
+ configurable: false,
232
+ enumerable: false,
233
+ writable: true,
234
+ value: null
235
+ });
236
+ Object.defineProperty(type, "_debugStack", {
237
+ configurable: false,
238
+ enumerable: false,
239
+ writable: true,
240
+ value: debugStack
241
+ });
242
+ Object.defineProperty(type, "_debugTask", {
243
+ configurable: false,
244
+ enumerable: false,
245
+ writable: true,
246
+ value: debugTask
247
+ });
248
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
249
+ return type;
250
+ }
251
+ function jsxDEVImpl(
252
+ type,
253
+ config,
254
+ maybeKey,
255
+ isStaticChildren,
256
+ debugStack,
257
+ debugTask
258
+ ) {
259
+ var children = config.children;
260
+ if (void 0 !== children)
261
+ if (isStaticChildren)
262
+ if (isArrayImpl(children)) {
263
+ for (
264
+ isStaticChildren = 0;
265
+ isStaticChildren < children.length;
266
+ isStaticChildren++
267
+ )
268
+ validateChildKeys(children[isStaticChildren]);
269
+ Object.freeze && Object.freeze(children);
270
+ } else
271
+ console.error(
272
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
273
+ );
274
+ else validateChildKeys(children);
275
+ if (hasOwnProperty.call(config, "key")) {
276
+ children = getComponentNameFromType(type);
277
+ var keys = Object.keys(config).filter(function (k) {
278
+ return "key" !== k;
279
+ });
280
+ isStaticChildren =
281
+ 0 < keys.length
282
+ ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
283
+ : "{key: someKey}";
284
+ didWarnAboutKeySpread[children + isStaticChildren] ||
285
+ ((keys =
286
+ 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
287
+ console.error(
288
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
289
+ isStaticChildren,
290
+ children,
291
+ keys,
292
+ children
293
+ ),
294
+ (didWarnAboutKeySpread[children + isStaticChildren] = true));
295
+ }
296
+ children = null;
297
+ void 0 !== maybeKey &&
298
+ (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
299
+ hasValidKey(config) &&
300
+ (checkKeyStringCoercion(config.key), (children = "" + config.key));
301
+ if ("key" in config) {
302
+ maybeKey = {};
303
+ for (var propName in config)
304
+ "key" !== propName && (maybeKey[propName] = config[propName]);
305
+ } else maybeKey = config;
306
+ children &&
307
+ defineKeyPropWarningGetter(
308
+ maybeKey,
309
+ "function" === typeof type
310
+ ? type.displayName || type.name || "Unknown"
311
+ : type
312
+ );
313
+ return ReactElement(
314
+ type,
315
+ children,
316
+ maybeKey,
317
+ getOwner(),
318
+ debugStack,
319
+ debugTask
320
+ );
321
+ }
322
+ function validateChildKeys(node) {
323
+ isValidElement(node)
324
+ ? node._store && (node._store.validated = 1)
325
+ : "object" === typeof node &&
326
+ null !== node &&
327
+ node.$$typeof === REACT_LAZY_TYPE &&
328
+ ("fulfilled" === node._payload.status
329
+ ? isValidElement(node._payload.value) &&
330
+ node._payload.value._store &&
331
+ (node._payload.value._store.validated = 1)
332
+ : node._store && (node._store.validated = 1));
333
+ }
334
+ function isValidElement(object) {
335
+ return (
336
+ "object" === typeof object &&
337
+ null !== object &&
338
+ object.$$typeof === REACT_ELEMENT_TYPE
339
+ );
340
+ }
341
+ var React = require$$0,
342
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
343
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
344
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
345
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
346
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
347
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
348
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
349
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
350
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
351
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
352
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
353
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
354
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
355
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
356
+ ReactSharedInternals =
357
+ React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
358
+ hasOwnProperty = Object.prototype.hasOwnProperty,
359
+ isArrayImpl = Array.isArray,
360
+ createTask = console.createTask
361
+ ? console.createTask
362
+ : function () {
363
+ return null;
364
+ };
365
+ React = {
366
+ react_stack_bottom_frame: function (callStackForError) {
367
+ return callStackForError();
368
+ }
369
+ };
370
+ var specialPropKeyWarningShown;
371
+ var didWarnAboutElementRef = {};
372
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
373
+ React,
374
+ UnknownOwner
375
+ )();
376
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
377
+ var didWarnAboutKeySpread = {};
378
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
379
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
380
+ var trackActualOwner =
381
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
382
+ return jsxDEVImpl(
383
+ type,
384
+ config,
385
+ maybeKey,
386
+ false,
387
+ trackActualOwner
388
+ ? Error("react-stack-top-frame")
389
+ : unknownOwnerDebugStack,
390
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
391
+ );
392
+ };
393
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
394
+ var trackActualOwner =
395
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
396
+ return jsxDEVImpl(
397
+ type,
398
+ config,
399
+ maybeKey,
400
+ true,
401
+ trackActualOwner
402
+ ? Error("react-stack-top-frame")
403
+ : unknownOwnerDebugStack,
404
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
405
+ );
406
+ };
407
+ })();
408
+ return reactJsxRuntime_development;
409
+ }
410
+
411
+ var hasRequiredJsxRuntime;
412
+
413
+ function requireJsxRuntime () {
414
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
415
+ hasRequiredJsxRuntime = 1;
416
+
417
+ if (process.env.NODE_ENV === 'production') {
418
+ jsxRuntime.exports = requireReactJsxRuntime_production();
419
+ } else {
420
+ jsxRuntime.exports = requireReactJsxRuntime_development();
421
+ }
422
+ return jsxRuntime.exports;
423
+ }
424
+
425
+ var jsxRuntimeExports = requireJsxRuntime();
426
+
427
+ /**
428
+ * InfoRow component
429
+ * Displays a row of information with an icon, label, and value
430
+ * Used in detail views to present structured data
431
+ *
432
+ * @param variant - Color variant for the background. Options:
433
+ * - 'default': No background color (gray text)
434
+ * - 'blue': Blue background (for far/distance vision)
435
+ * - 'yellow': Yellow background (for near vision)
436
+ * - 'purple': Purple background (for both vision types)
437
+ * - 'green': Green background
438
+ * - 'red': Red background
439
+ * - 'indigo': Indigo background
440
+ * - 'gray': Gray background
441
+ *
442
+ * @param size - Size variant. Options: 'xs' | 'sm' | 'md' | 'lg'
443
+ * @param layout - Layout variant. Options:
444
+ * - 'vertical': Icon and text stacked (default)
445
+ * - 'horizontal': All elements in one line
446
+ * - 'inline': Compact single line without much spacing
447
+ * - 'compact': Minimal spacing for dense layouts
448
+ * @param hideIcon - Hide the icon (useful for responsive layouts)
449
+ * @param hideLabel - Hide the label, show only value (useful for mobile)
450
+ * @param className - Additional CSS classes
451
+ * @param action - Optional actionable element (link, button, icon button) positioned on the right
452
+ */
453
+ const InfoRow = ({ icon, label, value, variant = "default", size = "md", layout = "vertical", hideIcon = false, hideLabel = false, className = "", action, }) => {
454
+ const variantClasses = {
455
+ default: {
456
+ bg: "",
457
+ border: "",
458
+ iconColor: "text-gray-400",
459
+ labelColor: "text-gray-500",
460
+ },
461
+ blue: {
462
+ bg: "bg-blue-50",
463
+ border: "border border-blue-200",
464
+ iconColor: "text-blue-500",
465
+ labelColor: "text-blue-700",
466
+ },
467
+ yellow: {
468
+ bg: "bg-yellow-50",
469
+ border: "border border-yellow-200",
470
+ iconColor: "text-yellow-600",
471
+ labelColor: "text-yellow-700",
472
+ },
473
+ purple: {
474
+ bg: "bg-purple-50",
475
+ border: "border border-purple-200",
476
+ iconColor: "text-purple-500",
477
+ labelColor: "text-purple-700",
478
+ },
479
+ green: {
480
+ bg: "bg-green-50",
481
+ border: "border border-green-200",
482
+ iconColor: "text-green-500",
483
+ labelColor: "text-green-700",
484
+ },
485
+ red: {
486
+ bg: "bg-red-50",
487
+ border: "border border-red-200",
488
+ iconColor: "text-red-500",
489
+ labelColor: "text-red-700",
490
+ },
491
+ indigo: {
492
+ bg: "bg-indigo-50",
493
+ border: "border border-indigo-200",
494
+ iconColor: "text-indigo-500",
495
+ labelColor: "text-indigo-700",
496
+ },
497
+ gray: {
498
+ bg: "bg-gray-50",
499
+ border: "border border-gray-200",
500
+ iconColor: "text-gray-500",
501
+ labelColor: "text-gray-700",
502
+ },
503
+ };
504
+ const classes = variantClasses[variant];
505
+ // Size configurations
506
+ const sizeClasses = {
507
+ xs: {
508
+ padding: "p-1",
509
+ iconSize: "w-3 h-3",
510
+ labelText: "text-xs",
511
+ valueText: "text-xs font-medium",
512
+ spacing: "space-x-1",
513
+ },
514
+ sm: {
515
+ padding: "p-1.5",
516
+ iconSize: "w-4 h-4",
517
+ labelText: "text-xs",
518
+ valueText: "text-sm font-medium",
519
+ spacing: "space-x-2",
520
+ },
521
+ md: {
522
+ padding: "p-2",
523
+ iconSize: "w-5 h-5",
524
+ labelText: "text-sm",
525
+ valueText: "text-sm font-medium",
526
+ spacing: "space-x-3",
527
+ },
528
+ lg: {
529
+ padding: "p-3",
530
+ iconSize: "w-6 h-6",
531
+ labelText: "text-base",
532
+ valueText: "text-base font-semibold",
533
+ spacing: "space-x-4",
534
+ },
535
+ };
536
+ const sizeConfig = sizeClasses[size];
537
+ // Layout configurations
538
+ const getLayoutClasses = () => {
539
+ switch (layout) {
540
+ case "horizontal":
541
+ // All elements in one horizontal line with better spacing
542
+ return {
543
+ container: `flex items-center ${sizeConfig.spacing}`,
544
+ content: "flex items-center gap-3",
545
+ labelValueWrapper: "flex items-center gap-3",
546
+ };
547
+ case "inline":
548
+ // Compact single line
549
+ return {
550
+ container: "flex items-center space-x-1.5",
551
+ content: "flex items-center space-x-1",
552
+ labelValueWrapper: "flex items-center space-x-1",
553
+ };
554
+ case "compact":
555
+ // Minimal spacing for dense layouts
556
+ return {
557
+ container: "flex items-start space-x-1.5",
558
+ content: "flex-1 min-w-0",
559
+ labelValueWrapper: "space-y-0.5",
560
+ };
561
+ case "vertical":
562
+ default:
563
+ // Traditional vertical layout - label on top, value below
564
+ return {
565
+ container: `flex items-start ${sizeConfig.spacing}`,
566
+ content: "flex-1",
567
+ labelValueWrapper: "flex flex-col space-y-0.5",
568
+ };
569
+ }
570
+ };
571
+ const layoutClasses = getLayoutClasses();
572
+ // Build container classes
573
+ const containerClasses = [
574
+ layoutClasses.container,
575
+ variant === "default"
576
+ ? sizeConfig.padding
577
+ : `${sizeConfig.padding} rounded-lg ${classes.bg} ${classes.border}`,
578
+ className,
579
+ ]
580
+ .filter(Boolean)
581
+ .join(" ");
582
+ // Render icon conditionally
583
+ const renderIcon = () => {
584
+ if (hideIcon)
585
+ return null;
586
+ return (jsxRuntimeExports.jsx("div", { className: `${classes.iconColor} ${layout === "horizontal" || layout === "inline" ? "flex-shrink-0" : "mt-0.5"}`, children: icon }));
587
+ };
588
+ // Render label conditionally
589
+ const renderLabel = () => {
590
+ if (hideLabel)
591
+ return null;
592
+ return (jsxRuntimeExports.jsx("span", { className: `${sizeConfig.labelText} ${classes.labelColor}`, children: label }));
593
+ };
594
+ // Render value
595
+ const renderValue = () => {
596
+ return (jsxRuntimeExports.jsx("span", { className: `${sizeConfig.valueText} text-gray-900`, children: value }));
597
+ };
598
+ // Render content based on layout
599
+ const renderContent = () => {
600
+ if (layout === "horizontal") {
601
+ // Horizontal layout: label and value on same line with better separation
602
+ return (jsxRuntimeExports.jsxs("div", { className: layoutClasses.content, children: [!hideLabel && renderLabel(), renderValue()] }));
603
+ }
604
+ if (layout === "inline") {
605
+ // Inline layout: compact with colon separator
606
+ return (jsxRuntimeExports.jsxs("div", { className: layoutClasses.content, children: [!hideLabel && renderLabel(), !hideLabel && jsxRuntimeExports.jsx("span", { className: "text-gray-400", children: ":" }), renderValue()] }));
607
+ }
608
+ // Vertical and compact layouts: label on top, value below
609
+ return (jsxRuntimeExports.jsx("div", { className: layoutClasses.content, children: jsxRuntimeExports.jsxs("div", { className: layoutClasses.labelValueWrapper, children: [!hideLabel && renderLabel(), renderValue()] }) }));
610
+ };
611
+ return (jsxRuntimeExports.jsxs("div", { className: containerClasses, children: [renderIcon(), renderContent(), action && jsxRuntimeExports.jsx("div", { className: "ml-auto flex-shrink-0", children: action })] }));
612
+ };
613
+
614
+ module.exports = InfoRow;
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+
3
+ type InfoRowVariant = "default" | "blue" | "yellow" | "purple" | "green" | "red" | "indigo" | "gray";
4
+ type InfoRowSize = "xs" | "sm" | "md" | "lg";
5
+ type InfoRowLayout = "vertical" | "horizontal" | "inline" | "compact";
6
+ interface InfoRowProps {
7
+ icon: React.ReactNode;
8
+ label: string;
9
+ value: string;
10
+ variant?: InfoRowVariant;
11
+ size?: InfoRowSize;
12
+ layout?: InfoRowLayout;
13
+ hideIcon?: boolean;
14
+ hideLabel?: boolean;
15
+ className?: string;
16
+ action?: React.ReactNode;
17
+ }
18
+ /**
19
+ * InfoRow component
20
+ * Displays a row of information with an icon, label, and value
21
+ * Used in detail views to present structured data
22
+ *
23
+ * @param variant - Color variant for the background. Options:
24
+ * - 'default': No background color (gray text)
25
+ * - 'blue': Blue background (for far/distance vision)
26
+ * - 'yellow': Yellow background (for near vision)
27
+ * - 'purple': Purple background (for both vision types)
28
+ * - 'green': Green background
29
+ * - 'red': Red background
30
+ * - 'indigo': Indigo background
31
+ * - 'gray': Gray background
32
+ *
33
+ * @param size - Size variant. Options: 'xs' | 'sm' | 'md' | 'lg'
34
+ * @param layout - Layout variant. Options:
35
+ * - 'vertical': Icon and text stacked (default)
36
+ * - 'horizontal': All elements in one line
37
+ * - 'inline': Compact single line without much spacing
38
+ * - 'compact': Minimal spacing for dense layouts
39
+ * @param hideIcon - Hide the icon (useful for responsive layouts)
40
+ * @param hideLabel - Hide the label, show only value (useful for mobile)
41
+ * @param className - Additional CSS classes
42
+ * @param action - Optional actionable element (link, button, icon button) positioned on the right
43
+ */
44
+ declare const InfoRow: React.FC<InfoRowProps>;
45
+ //# sourceMappingURL=InfoRow.d.ts.map
46
+
47
+ export { InfoRow as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,612 @@
1
+ import require$$0 from 'react';
2
+
3
+ var jsxRuntime = {exports: {}};
4
+
5
+ var reactJsxRuntime_production = {};
6
+
7
+ /**
8
+ * @license React
9
+ * react-jsx-runtime.production.js
10
+ *
11
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+
17
+ var hasRequiredReactJsxRuntime_production;
18
+
19
+ function requireReactJsxRuntime_production () {
20
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
21
+ hasRequiredReactJsxRuntime_production = 1;
22
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
23
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
24
+ function jsxProd(type, config, maybeKey) {
25
+ var key = null;
26
+ void 0 !== maybeKey && (key = "" + maybeKey);
27
+ void 0 !== config.key && (key = "" + config.key);
28
+ if ("key" in config) {
29
+ maybeKey = {};
30
+ for (var propName in config)
31
+ "key" !== propName && (maybeKey[propName] = config[propName]);
32
+ } else maybeKey = config;
33
+ config = maybeKey.ref;
34
+ return {
35
+ $$typeof: REACT_ELEMENT_TYPE,
36
+ type: type,
37
+ key: key,
38
+ ref: void 0 !== config ? config : null,
39
+ props: maybeKey
40
+ };
41
+ }
42
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
43
+ reactJsxRuntime_production.jsx = jsxProd;
44
+ reactJsxRuntime_production.jsxs = jsxProd;
45
+ return reactJsxRuntime_production;
46
+ }
47
+
48
+ var reactJsxRuntime_development = {};
49
+
50
+ /**
51
+ * @license React
52
+ * react-jsx-runtime.development.js
53
+ *
54
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
55
+ *
56
+ * This source code is licensed under the MIT license found in the
57
+ * LICENSE file in the root directory of this source tree.
58
+ */
59
+
60
+ var hasRequiredReactJsxRuntime_development;
61
+
62
+ function requireReactJsxRuntime_development () {
63
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
64
+ hasRequiredReactJsxRuntime_development = 1;
65
+ "production" !== process.env.NODE_ENV &&
66
+ (function () {
67
+ function getComponentNameFromType(type) {
68
+ if (null == type) return null;
69
+ if ("function" === typeof type)
70
+ return type.$$typeof === REACT_CLIENT_REFERENCE
71
+ ? null
72
+ : type.displayName || type.name || null;
73
+ if ("string" === typeof type) return type;
74
+ switch (type) {
75
+ case REACT_FRAGMENT_TYPE:
76
+ return "Fragment";
77
+ case REACT_PROFILER_TYPE:
78
+ return "Profiler";
79
+ case REACT_STRICT_MODE_TYPE:
80
+ return "StrictMode";
81
+ case REACT_SUSPENSE_TYPE:
82
+ return "Suspense";
83
+ case REACT_SUSPENSE_LIST_TYPE:
84
+ return "SuspenseList";
85
+ case REACT_ACTIVITY_TYPE:
86
+ return "Activity";
87
+ }
88
+ if ("object" === typeof type)
89
+ switch (
90
+ ("number" === typeof type.tag &&
91
+ console.error(
92
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
93
+ ),
94
+ type.$$typeof)
95
+ ) {
96
+ case REACT_PORTAL_TYPE:
97
+ return "Portal";
98
+ case REACT_CONTEXT_TYPE:
99
+ return type.displayName || "Context";
100
+ case REACT_CONSUMER_TYPE:
101
+ return (type._context.displayName || "Context") + ".Consumer";
102
+ case REACT_FORWARD_REF_TYPE:
103
+ var innerType = type.render;
104
+ type = type.displayName;
105
+ type ||
106
+ ((type = innerType.displayName || innerType.name || ""),
107
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
108
+ return type;
109
+ case REACT_MEMO_TYPE:
110
+ return (
111
+ (innerType = type.displayName || null),
112
+ null !== innerType
113
+ ? innerType
114
+ : getComponentNameFromType(type.type) || "Memo"
115
+ );
116
+ case REACT_LAZY_TYPE:
117
+ innerType = type._payload;
118
+ type = type._init;
119
+ try {
120
+ return getComponentNameFromType(type(innerType));
121
+ } catch (x) {}
122
+ }
123
+ return null;
124
+ }
125
+ function testStringCoercion(value) {
126
+ return "" + value;
127
+ }
128
+ function checkKeyStringCoercion(value) {
129
+ try {
130
+ testStringCoercion(value);
131
+ var JSCompiler_inline_result = !1;
132
+ } catch (e) {
133
+ JSCompiler_inline_result = true;
134
+ }
135
+ if (JSCompiler_inline_result) {
136
+ JSCompiler_inline_result = console;
137
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
138
+ var JSCompiler_inline_result$jscomp$0 =
139
+ ("function" === typeof Symbol &&
140
+ Symbol.toStringTag &&
141
+ value[Symbol.toStringTag]) ||
142
+ value.constructor.name ||
143
+ "Object";
144
+ JSCompiler_temp_const.call(
145
+ JSCompiler_inline_result,
146
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
147
+ JSCompiler_inline_result$jscomp$0
148
+ );
149
+ return testStringCoercion(value);
150
+ }
151
+ }
152
+ function getTaskName(type) {
153
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
154
+ if (
155
+ "object" === typeof type &&
156
+ null !== type &&
157
+ type.$$typeof === REACT_LAZY_TYPE
158
+ )
159
+ return "<...>";
160
+ try {
161
+ var name = getComponentNameFromType(type);
162
+ return name ? "<" + name + ">" : "<...>";
163
+ } catch (x) {
164
+ return "<...>";
165
+ }
166
+ }
167
+ function getOwner() {
168
+ var dispatcher = ReactSharedInternals.A;
169
+ return null === dispatcher ? null : dispatcher.getOwner();
170
+ }
171
+ function UnknownOwner() {
172
+ return Error("react-stack-top-frame");
173
+ }
174
+ function hasValidKey(config) {
175
+ if (hasOwnProperty.call(config, "key")) {
176
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
177
+ if (getter && getter.isReactWarning) return false;
178
+ }
179
+ return void 0 !== config.key;
180
+ }
181
+ function defineKeyPropWarningGetter(props, displayName) {
182
+ function warnAboutAccessingKey() {
183
+ specialPropKeyWarningShown ||
184
+ ((specialPropKeyWarningShown = true),
185
+ console.error(
186
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
187
+ displayName
188
+ ));
189
+ }
190
+ warnAboutAccessingKey.isReactWarning = true;
191
+ Object.defineProperty(props, "key", {
192
+ get: warnAboutAccessingKey,
193
+ configurable: true
194
+ });
195
+ }
196
+ function elementRefGetterWithDeprecationWarning() {
197
+ var componentName = getComponentNameFromType(this.type);
198
+ didWarnAboutElementRef[componentName] ||
199
+ ((didWarnAboutElementRef[componentName] = true),
200
+ console.error(
201
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
202
+ ));
203
+ componentName = this.props.ref;
204
+ return void 0 !== componentName ? componentName : null;
205
+ }
206
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
207
+ var refProp = props.ref;
208
+ type = {
209
+ $$typeof: REACT_ELEMENT_TYPE,
210
+ type: type,
211
+ key: key,
212
+ props: props,
213
+ _owner: owner
214
+ };
215
+ null !== (void 0 !== refProp ? refProp : null)
216
+ ? Object.defineProperty(type, "ref", {
217
+ enumerable: false,
218
+ get: elementRefGetterWithDeprecationWarning
219
+ })
220
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
221
+ type._store = {};
222
+ Object.defineProperty(type._store, "validated", {
223
+ configurable: false,
224
+ enumerable: false,
225
+ writable: true,
226
+ value: 0
227
+ });
228
+ Object.defineProperty(type, "_debugInfo", {
229
+ configurable: false,
230
+ enumerable: false,
231
+ writable: true,
232
+ value: null
233
+ });
234
+ Object.defineProperty(type, "_debugStack", {
235
+ configurable: false,
236
+ enumerable: false,
237
+ writable: true,
238
+ value: debugStack
239
+ });
240
+ Object.defineProperty(type, "_debugTask", {
241
+ configurable: false,
242
+ enumerable: false,
243
+ writable: true,
244
+ value: debugTask
245
+ });
246
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
247
+ return type;
248
+ }
249
+ function jsxDEVImpl(
250
+ type,
251
+ config,
252
+ maybeKey,
253
+ isStaticChildren,
254
+ debugStack,
255
+ debugTask
256
+ ) {
257
+ var children = config.children;
258
+ if (void 0 !== children)
259
+ if (isStaticChildren)
260
+ if (isArrayImpl(children)) {
261
+ for (
262
+ isStaticChildren = 0;
263
+ isStaticChildren < children.length;
264
+ isStaticChildren++
265
+ )
266
+ validateChildKeys(children[isStaticChildren]);
267
+ Object.freeze && Object.freeze(children);
268
+ } else
269
+ console.error(
270
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
271
+ );
272
+ else validateChildKeys(children);
273
+ if (hasOwnProperty.call(config, "key")) {
274
+ children = getComponentNameFromType(type);
275
+ var keys = Object.keys(config).filter(function (k) {
276
+ return "key" !== k;
277
+ });
278
+ isStaticChildren =
279
+ 0 < keys.length
280
+ ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
281
+ : "{key: someKey}";
282
+ didWarnAboutKeySpread[children + isStaticChildren] ||
283
+ ((keys =
284
+ 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
285
+ console.error(
286
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
287
+ isStaticChildren,
288
+ children,
289
+ keys,
290
+ children
291
+ ),
292
+ (didWarnAboutKeySpread[children + isStaticChildren] = true));
293
+ }
294
+ children = null;
295
+ void 0 !== maybeKey &&
296
+ (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
297
+ hasValidKey(config) &&
298
+ (checkKeyStringCoercion(config.key), (children = "" + config.key));
299
+ if ("key" in config) {
300
+ maybeKey = {};
301
+ for (var propName in config)
302
+ "key" !== propName && (maybeKey[propName] = config[propName]);
303
+ } else maybeKey = config;
304
+ children &&
305
+ defineKeyPropWarningGetter(
306
+ maybeKey,
307
+ "function" === typeof type
308
+ ? type.displayName || type.name || "Unknown"
309
+ : type
310
+ );
311
+ return ReactElement(
312
+ type,
313
+ children,
314
+ maybeKey,
315
+ getOwner(),
316
+ debugStack,
317
+ debugTask
318
+ );
319
+ }
320
+ function validateChildKeys(node) {
321
+ isValidElement(node)
322
+ ? node._store && (node._store.validated = 1)
323
+ : "object" === typeof node &&
324
+ null !== node &&
325
+ node.$$typeof === REACT_LAZY_TYPE &&
326
+ ("fulfilled" === node._payload.status
327
+ ? isValidElement(node._payload.value) &&
328
+ node._payload.value._store &&
329
+ (node._payload.value._store.validated = 1)
330
+ : node._store && (node._store.validated = 1));
331
+ }
332
+ function isValidElement(object) {
333
+ return (
334
+ "object" === typeof object &&
335
+ null !== object &&
336
+ object.$$typeof === REACT_ELEMENT_TYPE
337
+ );
338
+ }
339
+ var React = require$$0,
340
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
341
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
342
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
343
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
344
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
345
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
346
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
347
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
348
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
349
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
350
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
351
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
352
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
353
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
354
+ ReactSharedInternals =
355
+ React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
356
+ hasOwnProperty = Object.prototype.hasOwnProperty,
357
+ isArrayImpl = Array.isArray,
358
+ createTask = console.createTask
359
+ ? console.createTask
360
+ : function () {
361
+ return null;
362
+ };
363
+ React = {
364
+ react_stack_bottom_frame: function (callStackForError) {
365
+ return callStackForError();
366
+ }
367
+ };
368
+ var specialPropKeyWarningShown;
369
+ var didWarnAboutElementRef = {};
370
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
371
+ React,
372
+ UnknownOwner
373
+ )();
374
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
375
+ var didWarnAboutKeySpread = {};
376
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
377
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
378
+ var trackActualOwner =
379
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
380
+ return jsxDEVImpl(
381
+ type,
382
+ config,
383
+ maybeKey,
384
+ false,
385
+ trackActualOwner
386
+ ? Error("react-stack-top-frame")
387
+ : unknownOwnerDebugStack,
388
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
389
+ );
390
+ };
391
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
392
+ var trackActualOwner =
393
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
394
+ return jsxDEVImpl(
395
+ type,
396
+ config,
397
+ maybeKey,
398
+ true,
399
+ trackActualOwner
400
+ ? Error("react-stack-top-frame")
401
+ : unknownOwnerDebugStack,
402
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
403
+ );
404
+ };
405
+ })();
406
+ return reactJsxRuntime_development;
407
+ }
408
+
409
+ var hasRequiredJsxRuntime;
410
+
411
+ function requireJsxRuntime () {
412
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
413
+ hasRequiredJsxRuntime = 1;
414
+
415
+ if (process.env.NODE_ENV === 'production') {
416
+ jsxRuntime.exports = requireReactJsxRuntime_production();
417
+ } else {
418
+ jsxRuntime.exports = requireReactJsxRuntime_development();
419
+ }
420
+ return jsxRuntime.exports;
421
+ }
422
+
423
+ var jsxRuntimeExports = requireJsxRuntime();
424
+
425
+ /**
426
+ * InfoRow component
427
+ * Displays a row of information with an icon, label, and value
428
+ * Used in detail views to present structured data
429
+ *
430
+ * @param variant - Color variant for the background. Options:
431
+ * - 'default': No background color (gray text)
432
+ * - 'blue': Blue background (for far/distance vision)
433
+ * - 'yellow': Yellow background (for near vision)
434
+ * - 'purple': Purple background (for both vision types)
435
+ * - 'green': Green background
436
+ * - 'red': Red background
437
+ * - 'indigo': Indigo background
438
+ * - 'gray': Gray background
439
+ *
440
+ * @param size - Size variant. Options: 'xs' | 'sm' | 'md' | 'lg'
441
+ * @param layout - Layout variant. Options:
442
+ * - 'vertical': Icon and text stacked (default)
443
+ * - 'horizontal': All elements in one line
444
+ * - 'inline': Compact single line without much spacing
445
+ * - 'compact': Minimal spacing for dense layouts
446
+ * @param hideIcon - Hide the icon (useful for responsive layouts)
447
+ * @param hideLabel - Hide the label, show only value (useful for mobile)
448
+ * @param className - Additional CSS classes
449
+ * @param action - Optional actionable element (link, button, icon button) positioned on the right
450
+ */
451
+ const InfoRow = ({ icon, label, value, variant = "default", size = "md", layout = "vertical", hideIcon = false, hideLabel = false, className = "", action, }) => {
452
+ const variantClasses = {
453
+ default: {
454
+ bg: "",
455
+ border: "",
456
+ iconColor: "text-gray-400",
457
+ labelColor: "text-gray-500",
458
+ },
459
+ blue: {
460
+ bg: "bg-blue-50",
461
+ border: "border border-blue-200",
462
+ iconColor: "text-blue-500",
463
+ labelColor: "text-blue-700",
464
+ },
465
+ yellow: {
466
+ bg: "bg-yellow-50",
467
+ border: "border border-yellow-200",
468
+ iconColor: "text-yellow-600",
469
+ labelColor: "text-yellow-700",
470
+ },
471
+ purple: {
472
+ bg: "bg-purple-50",
473
+ border: "border border-purple-200",
474
+ iconColor: "text-purple-500",
475
+ labelColor: "text-purple-700",
476
+ },
477
+ green: {
478
+ bg: "bg-green-50",
479
+ border: "border border-green-200",
480
+ iconColor: "text-green-500",
481
+ labelColor: "text-green-700",
482
+ },
483
+ red: {
484
+ bg: "bg-red-50",
485
+ border: "border border-red-200",
486
+ iconColor: "text-red-500",
487
+ labelColor: "text-red-700",
488
+ },
489
+ indigo: {
490
+ bg: "bg-indigo-50",
491
+ border: "border border-indigo-200",
492
+ iconColor: "text-indigo-500",
493
+ labelColor: "text-indigo-700",
494
+ },
495
+ gray: {
496
+ bg: "bg-gray-50",
497
+ border: "border border-gray-200",
498
+ iconColor: "text-gray-500",
499
+ labelColor: "text-gray-700",
500
+ },
501
+ };
502
+ const classes = variantClasses[variant];
503
+ // Size configurations
504
+ const sizeClasses = {
505
+ xs: {
506
+ padding: "p-1",
507
+ iconSize: "w-3 h-3",
508
+ labelText: "text-xs",
509
+ valueText: "text-xs font-medium",
510
+ spacing: "space-x-1",
511
+ },
512
+ sm: {
513
+ padding: "p-1.5",
514
+ iconSize: "w-4 h-4",
515
+ labelText: "text-xs",
516
+ valueText: "text-sm font-medium",
517
+ spacing: "space-x-2",
518
+ },
519
+ md: {
520
+ padding: "p-2",
521
+ iconSize: "w-5 h-5",
522
+ labelText: "text-sm",
523
+ valueText: "text-sm font-medium",
524
+ spacing: "space-x-3",
525
+ },
526
+ lg: {
527
+ padding: "p-3",
528
+ iconSize: "w-6 h-6",
529
+ labelText: "text-base",
530
+ valueText: "text-base font-semibold",
531
+ spacing: "space-x-4",
532
+ },
533
+ };
534
+ const sizeConfig = sizeClasses[size];
535
+ // Layout configurations
536
+ const getLayoutClasses = () => {
537
+ switch (layout) {
538
+ case "horizontal":
539
+ // All elements in one horizontal line with better spacing
540
+ return {
541
+ container: `flex items-center ${sizeConfig.spacing}`,
542
+ content: "flex items-center gap-3",
543
+ labelValueWrapper: "flex items-center gap-3",
544
+ };
545
+ case "inline":
546
+ // Compact single line
547
+ return {
548
+ container: "flex items-center space-x-1.5",
549
+ content: "flex items-center space-x-1",
550
+ labelValueWrapper: "flex items-center space-x-1",
551
+ };
552
+ case "compact":
553
+ // Minimal spacing for dense layouts
554
+ return {
555
+ container: "flex items-start space-x-1.5",
556
+ content: "flex-1 min-w-0",
557
+ labelValueWrapper: "space-y-0.5",
558
+ };
559
+ case "vertical":
560
+ default:
561
+ // Traditional vertical layout - label on top, value below
562
+ return {
563
+ container: `flex items-start ${sizeConfig.spacing}`,
564
+ content: "flex-1",
565
+ labelValueWrapper: "flex flex-col space-y-0.5",
566
+ };
567
+ }
568
+ };
569
+ const layoutClasses = getLayoutClasses();
570
+ // Build container classes
571
+ const containerClasses = [
572
+ layoutClasses.container,
573
+ variant === "default"
574
+ ? sizeConfig.padding
575
+ : `${sizeConfig.padding} rounded-lg ${classes.bg} ${classes.border}`,
576
+ className,
577
+ ]
578
+ .filter(Boolean)
579
+ .join(" ");
580
+ // Render icon conditionally
581
+ const renderIcon = () => {
582
+ if (hideIcon)
583
+ return null;
584
+ return (jsxRuntimeExports.jsx("div", { className: `${classes.iconColor} ${layout === "horizontal" || layout === "inline" ? "flex-shrink-0" : "mt-0.5"}`, children: icon }));
585
+ };
586
+ // Render label conditionally
587
+ const renderLabel = () => {
588
+ if (hideLabel)
589
+ return null;
590
+ return (jsxRuntimeExports.jsx("span", { className: `${sizeConfig.labelText} ${classes.labelColor}`, children: label }));
591
+ };
592
+ // Render value
593
+ const renderValue = () => {
594
+ return (jsxRuntimeExports.jsx("span", { className: `${sizeConfig.valueText} text-gray-900`, children: value }));
595
+ };
596
+ // Render content based on layout
597
+ const renderContent = () => {
598
+ if (layout === "horizontal") {
599
+ // Horizontal layout: label and value on same line with better separation
600
+ return (jsxRuntimeExports.jsxs("div", { className: layoutClasses.content, children: [!hideLabel && renderLabel(), renderValue()] }));
601
+ }
602
+ if (layout === "inline") {
603
+ // Inline layout: compact with colon separator
604
+ return (jsxRuntimeExports.jsxs("div", { className: layoutClasses.content, children: [!hideLabel && renderLabel(), !hideLabel && jsxRuntimeExports.jsx("span", { className: "text-gray-400", children: ":" }), renderValue()] }));
605
+ }
606
+ // Vertical and compact layouts: label on top, value below
607
+ return (jsxRuntimeExports.jsx("div", { className: layoutClasses.content, children: jsxRuntimeExports.jsxs("div", { className: layoutClasses.labelValueWrapper, children: [!hideLabel && renderLabel(), renderValue()] }) }));
608
+ };
609
+ return (jsxRuntimeExports.jsxs("div", { className: containerClasses, children: [renderIcon(), renderContent(), action && jsxRuntimeExports.jsx("div", { className: "ml-auto flex-shrink-0", children: action })] }));
610
+ };
611
+
612
+ export { InfoRow as default };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@rubenpazch/info-row",
3
+ "version": "1.0.1",
4
+ "description": "InfoRow component",
5
+ "private": false,
6
+ "main": "dist/index.cjs.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/rubenpazch/lbyte-ui-library.git",
12
+ "directory": "packages/info-row"
13
+ },
14
+ "author": "Ruben Paz Chuspe <rubenpazchuspe@outlook.com>",
15
+ "license": "MIT",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "sideEffects": false,
20
+ "exports": {
21
+ ".": {
22
+ "import": "./dist/index.esm.js",
23
+ "require": "./dist/index.cjs.js",
24
+ "types": "./dist/index.d.ts"
25
+ }
26
+ },
27
+ "peerDependencies": {
28
+ "react": "^19.0.0",
29
+ "react-dom": "^19.0.0"
30
+ },
31
+ "devDependencies": {
32
+ "@rubenpazch/typescript-config": "3.0.0"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "scripts": {
38
+ "build": "rollup -c",
39
+ "test": "jest --passWithNoTests"
40
+ }
41
+ }