@nous-research/ui 0.2.5 → 0.2.7

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.
@@ -1,9 +1,16 @@
1
- import React from 'react';
2
- export declare function Stats({ className, items, ...props }: StatsProps): import("react/jsx-runtime").JSX.Element;
1
+ import React, { ReactNode } from 'react';
2
+ export declare function Stats({ className, items, flip, ...props }: StatsProps): import("react/jsx-runtime").JSX.Element;
3
3
  interface StatsProps extends React.ComponentProps<'div'> {
4
4
  items: {
5
- label: string;
6
- value: string;
5
+ label: string | {
6
+ key: string;
7
+ node: ReactNode;
8
+ };
9
+ value: string | {
10
+ key: string;
11
+ node: ReactNode;
12
+ };
7
13
  }[];
14
+ flip?: boolean;
8
15
  }
9
16
  export {};
@@ -1,7 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from '../../utils';
3
3
  import { Typography } from './typography';
4
- export function Stats({ className, items, ...props }) {
5
- return (_jsx("div", { className: cn('flex w-full flex-col gap-5', className), ...props, children: items.map(({ label, value }) => (_jsxs("div", { className: "text-midground grid grid-cols-[auto_1fr_auto] items-center gap-2.5 uppercase", children: [_jsx(Typography, { className: "text-xs leading-[1.4] tracking-widest", expanded: true, children: value }), _jsx(Typography, { className: "min-w-0 overflow-hidden text-[13px] leading-[1.4] tracking-[0.4em] opacity-20", expanded: true, children: '·'.repeat(100) }), _jsx(Typography, { className: "leading-none tracking-[0.2em] opacity-60", mono: true, children: label })] }, label))) }));
4
+ export function Stats({ className, items, flip, ...props }) {
5
+ return (_jsx("div", { className: cn('flex w-full flex-col gap-5', className), ...props, children: items.map(({ label, value }) => {
6
+ const valueText = (_jsx(Typography, { className: "text-xs leading-[1.4] tracking-widest", expanded: true, children: typeof value === 'string' ? value : value.node }));
7
+ const labelText = (_jsx(Typography, { className: "leading-none tracking-[0.2em] opacity-60", mono: true, children: typeof label === 'string' ? label : label.node }));
8
+ return (_jsxs("div", { className: "text-midground grid grid-cols-[auto_1fr_auto] items-center gap-2.5 uppercase", children: [flip ? labelText : valueText, _jsx(Typography, { className: "min-w-0 overflow-hidden text-[13px] leading-[1.4] tracking-[0.4em] opacity-20", expanded: true, children: '·'.repeat(100) }), flip ? valueText : labelText] }, (typeof label === 'string' ? label : label.key) + '@@@' + (typeof value === 'string' ? value : value.key)));
9
+ }) }));
6
10
  }
7
11
  //# sourceMappingURL=stats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/ui/components/stats.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAc;IAC9D,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,KAAM,KAAK,YACnE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC/B,eACE,SAAS,EAAC,8EAA8E,aAGxF,KAAC,UAAU,IACT,SAAS,EAAC,uCAAuC,EACjD,QAAQ,kBAEP,KAAK,GACK,EAEb,KAAC,UAAU,IACT,SAAS,EAAC,+EAA+E,EACzF,QAAQ,kBAEP,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GACL,EAEb,KAAC,UAAU,IAAC,SAAS,EAAC,0CAA0C,EAAC,IAAI,kBAClE,KAAK,GACK,KAlBR,KAAK,CAmBN,CACP,CAAC,GACE,CACP,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/ui/components/stats.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;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