@chainberry/ui-components 1.0.0 → 1.0.2

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.d.ts CHANGED
@@ -1,149 +1,77 @@
1
- import { JSX } from 'react';
2
-
3
- /** FULL_NAV the complete app navigation. */
4
- export declare const FULL_NAV: NavGroupConfig[];
5
-
6
- /** Icon names, handy for control lists / selects. */
7
- export declare const ICON_NAMES: IconName[];
8
-
9
- /** Valid icon keys for the nav components. */
10
- export declare type IconName = keyof typeof ICONS;
11
-
12
- export declare const ICONS: {
13
- readonly grid: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1.5\"/></svg>";
14
- readonly checkc: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M8.5 12.5l2.5 2.5 4.5-5\"/></svg>";
15
- readonly swap: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M4 7h13M14 4l3 3-3 3M20 17H7M10 14l-3 3 3 3\"/></svg>";
16
- readonly shield: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6l8-3z\"/></svg>";
17
- readonly wallet: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"3\" y=\"6\" width=\"18\" height=\"13\" rx=\"2.5\"/><path d=\"M3 10h18M16 15h2\"/></svg>";
18
- readonly down: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M12 4v11M7 10l5 5 5-5M5 20h14\"/></svg>";
19
- readonly up: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M12 20V9M7 14l5-5 5 5M5 4h14\"/></svg>";
20
- readonly convert: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M20 12a8 8 0 1 1-2.3-5.7M20 3v5h-5\"/></svg>";
21
- readonly transfer: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M4 8h14M15 5l3 3-3 3M20 16H6M9 13l-3 3 3 3\"/></svg>";
22
- readonly autoflow: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M17 2l4 4-4 4M3 11V9a4 4 0 0 1 4-4h14M7 22l-4-4 4-4M21 13v2a4 4 0 0 1-4 4H3\"/></svg>";
23
- readonly book: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3V4z\"/><path d=\"M5 17a3 3 0 0 1 3-3h11\"/></svg>";
24
- readonly invoice: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M6 3h9l4 4v14H6z\"/><path d=\"M14 3v5h5M9 12h6M9 16h6\"/></svg>";
25
- readonly payout: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M4 6h10M4 12h7M4 18h10M17 9l4 3-4 3M21 12h-7\"/></svg>";
26
- readonly bank: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M3 9l9-5 9 5M4 9v9M20 9v9M8 12v6M12 12v6M16 12v6M3 21h18\"/></svg>";
27
- readonly chart: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M4 20V6M4 20h16M9 16v-5M14 16V8M19 16v-3\"/></svg>";
28
- readonly code: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 8l-5 4 5 4M16 8l5 4-5 4M13 5l-3 14\"/></svg>";
29
- readonly widget: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2.5\"/><path d=\"M3 9h18M9 9v11\"/></svg>";
30
- readonly org: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"4\" y=\"3\" width=\"16\" height=\"18\" rx=\"2\"/><path d=\"M9 7h2M13 7h2M9 11h2M13 11h2M9 15h2M13 15h2\"/></svg>";
31
- readonly users: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><circle cx=\"9\" cy=\"8.5\" r=\"3.5\"/><path d=\"M3 20c.8-3.2 3.2-5 6-5s5.2 1.8 6 5M16 5.5a3.5 3.5 0 0 1 0 6M17.5 15.2c2 .7 3 2.2 3.5 4.8\"/></svg>";
32
- readonly list: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01\"/></svg>";
33
- readonly card: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2.5\"/><path d=\"M3 10h18M7 15h4\"/></svg>";
34
- readonly help: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M9.5 9.5A2.5 2.5 0 1 1 12 12.5v1M12 17h.01\"/></svg>";
35
- };
36
-
37
- export declare function Logo({ src, alt, href, collapsed }: LogoProps): JSX.Element;
38
-
39
- export declare interface LogoProps {
40
- /** Image source (defaults to the Chainberry mark). */
41
- src?: string;
42
- alt?: string;
43
- /** Optional link wrapping the mark. */
44
- href?: string;
45
- /** Mini-rail sizing. */
46
- collapsed?: boolean;
47
- }
48
-
49
- /** Named presets, for app wiring and control selects. */
50
- export declare const NAV_PRESETS: {
51
- readonly primary: NavGroupConfig[];
52
- readonly full: NavGroupConfig[];
53
- };
54
-
55
- export declare function NavBadge({ variant, value }: NavBadgeProps): JSX.Element;
56
-
57
- export declare interface NavBadgeProps {
58
- variant?: NavBadgeVariant;
59
- /** Text for the count variant; ignored by soon/ext. */
60
- value?: string | number;
61
- }
62
-
63
- export declare type NavBadgeVariant = "count" | "soon" | "ext";
64
-
65
- export declare function NavDrawer({ config, preset, activeId, collapsed, logoSrc, onNavigate, }: NavDrawerProps): JSX.Element;
66
-
67
- export declare interface NavDrawerProps {
68
- /** Explicit nav config; overrides `preset`. */
69
- config?: NavGroupConfig[];
70
- preset?: NavPreset;
71
- activeId?: string;
72
- collapsed?: boolean;
73
- /** Override the logo image. */
74
- logoSrc?: string;
75
- onNavigate?: (id: string) => void;
76
- }
77
-
78
- export declare function NavGroup({ label, items, activeId, collapsed, onNavigate, }: NavGroupProps): JSX.Element;
79
-
80
- /** A titled group of nav items. */
81
- export declare interface NavGroupConfig {
82
- /** Section heading (hidden when the drawer is collapsed). */
83
- label: string;
84
- items: NavItemConfig[];
85
- }
86
-
87
- export declare interface NavGroupProps {
88
- /** Section heading (hidden when collapsed). */
89
- label?: string;
90
- items?: NavItemConfig[];
91
- /** Id of the active item. */
92
- activeId?: string;
93
- /** Icon-only rail. */
94
- collapsed?: boolean;
95
- onNavigate?: (id: string) => void;
96
- }
97
-
98
- export declare function NavIcon({ name, active }: NavIconProps): JSX.Element;
99
-
100
- export declare interface NavIconProps {
101
- name?: IconName;
102
- /** Full-opacity + text color when active. */
103
- active?: boolean;
104
- }
105
-
106
- export declare function NavItem({ id, label, icon, active, collapsed, badge, soon, ext, onNavigate, }: NavItemProps): JSX.Element;
107
-
108
- /** A single navigation entry. */
109
- export declare interface NavItemConfig {
110
- /** Stable key + route id. */
111
- id: string;
112
- /** Visible label text. */
113
- label: string;
114
- /** Icon key (see ICONS). */
115
- icon: IconName;
116
- /** Count pill shown on the trailing edge. */
117
- badge?: number;
118
- /** Renders a "SOON" tag instead of a badge. */
119
- soon?: boolean;
120
- /** External URL → renders as an anchor with a ↗ indicator. */
121
- ext?: string;
122
- }
123
-
124
- export declare interface NavItemProps extends NavItemConfig {
125
- /** Active/selected styling. */
126
- active?: boolean;
127
- /** Icon-only rail. */
128
- collapsed?: boolean;
129
- onNavigate?: (id: string) => void;
130
- }
131
-
132
- export declare function NavLabel({ text }: NavLabelProps): JSX.Element;
133
-
134
- export declare interface NavLabelProps {
135
- text?: string;
136
- }
137
-
138
- export declare type NavPreset = keyof typeof NAV_PRESETS;
139
-
140
- /** PRIMARY_NAV — trimmed navigation. */
141
- export declare const PRIMARY_NAV: NavGroupConfig[];
142
-
143
- export declare function SectionHeading({ label }: SectionHeadingProps): JSX.Element;
144
-
145
- export declare interface SectionHeadingProps {
146
- label?: string;
147
- }
1
+ import { Badge } from '../../../react-app/src/components/nav/Badge';
2
+ import { BadgeVariant } from '../../../react-app/src/components/nav/Badge';
3
+ import { Button } from '../../../react-app/src/components/ui/button';
4
+ import { buttonVariants } from '../../../react-app/src/components/ui/button';
5
+ import { ComponentProps } from '../../../react-app/node_modules/@types/react';
6
+ import { findNavItem } from '../../../react-app/src/components/nav/navConfig';
7
+ import { FULL_NAV } from '../../../react-app/src/components/nav/navConfig';
8
+ import { ICON_NAMES } from '../../../react-app/src/components/nav/icons';
9
+ import { IconName } from '../../../react-app/src/components/nav/icons';
10
+ import { ICONS } from '../../../react-app/src/components/nav/icons';
11
+ import { Logo } from '../../../react-app/src/components/nav/Logo';
12
+ import { NAV_ITEMS } from '../../../react-app/src/components/nav/navConfig';
13
+ import { NAV_PRESETS } from '../../../react-app/src/components/nav/navConfig';
14
+ import { NavDrawer } from '../../../react-app/src/components/nav/NavDrawer';
15
+ import { NavGroup } from '../../../react-app/src/components/nav/NavGroup';
16
+ import { NavGroupConfig } from '../../../react-app/src/components/nav/navConfig';
17
+ import { NavIcon } from '../../../react-app/src/components/nav/NavIcon';
18
+ import { NavItem } from '../../../react-app/src/components/nav/NavItem';
19
+ import { NavItemConfig } from '../../../react-app/src/components/nav/navConfig';
20
+ import { NavItemProps } from '../../../react-app/src/components/nav/NavItem';
21
+ import { NavLabel } from '../../../react-app/src/components/nav/NavLabel';
22
+ import { NavPreset } from '../../../react-app/src/components/nav/navConfig';
23
+ import { PRIMARY_NAV } from '../../../react-app/src/components/nav/navConfig';
24
+ import { SectionHeading } from '../../../react-app/src/components/nav/SectionHeading';
25
+
26
+ export { Badge }
27
+ export { Badge as NavBadge }
28
+
29
+ export { BadgeVariant }
30
+ export { BadgeVariant as NavBadgeVariant }
31
+
32
+ export { Button }
33
+
34
+ export { buttonVariants }
35
+
36
+ export { findNavItem }
37
+
38
+ export { FULL_NAV }
39
+
40
+ export { ICON_NAMES }
41
+
42
+ export { IconName }
43
+
44
+ export { ICONS }
45
+
46
+ export { Logo }
47
+
48
+ export { NAV_ITEMS }
49
+
50
+ export { NAV_PRESETS }
51
+
52
+ /** @deprecated use the props of `Badge` instead. */
53
+ export declare type NavBadgeProps = ComponentProps<typeof Badge>;
54
+
55
+ export { NavDrawer }
56
+
57
+ export { NavGroup }
58
+
59
+ export { NavGroupConfig }
60
+
61
+ export { NavIcon }
62
+
63
+ export { NavItem }
64
+
65
+ export { NavItemConfig }
66
+
67
+ export { NavItemProps }
68
+
69
+ export { NavLabel }
70
+
71
+ export { NavPreset }
72
+
73
+ export { PRIMARY_NAV }
74
+
75
+ export { SectionHeading }
148
76
 
149
77
  export { }