@loomlyne/ui-system-react 0.0.0-stage → 0.1.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.
@@ -0,0 +1,59 @@
1
+ import * as React from 'react';
2
+ import type { BackNav, LogoVariant, Placement } from '@loomlyne/ui-system-core';
3
+ import { type AppUser, type NavAction, type NavLink, type NavSection, type Workspace } from './shared';
4
+ interface BaseBackProps {
5
+ sections?: NavSection[];
6
+ user?: AppUser | null;
7
+ logoPlacement?: Placement;
8
+ logoVariant?: LogoVariant;
9
+ className?: string;
10
+ style?: React.CSSProperties;
11
+ }
12
+ export interface AppSidebarProps extends BaseBackProps {
13
+ workspace?: Workspace | null;
14
+ search?: boolean | string;
15
+ footer?: React.ReactNode;
16
+ }
17
+ export declare function AppSidebar({ sections, user, workspace, search, logoPlacement, logoVariant, footer, className, style }: AppSidebarProps): React.JSX.Element;
18
+ export interface AppRailProps extends BaseBackProps {
19
+ footerItems?: NavLink[];
20
+ /** Label of an item whose tooltip is pinned open (for static mockups). */
21
+ tip?: string;
22
+ }
23
+ export declare function AppRail({ sections, user, footerItems, tip, className, style }: AppRailProps): React.JSX.Element;
24
+ export interface AppTopbarProps extends BaseBackProps {
25
+ links?: NavLink[];
26
+ actions?: NavAction[];
27
+ search?: boolean | string;
28
+ }
29
+ export declare function AppTopbar({ links, sections, actions, user, search, logoPlacement, logoVariant, className, style }: AppTopbarProps): React.JSX.Element;
30
+ export interface AppDockProps extends BaseBackProps {
31
+ items?: NavLink[];
32
+ search?: boolean | string;
33
+ tip?: string;
34
+ }
35
+ export declare function AppDock({ items, sections, user, search, tip, className, style }: AppDockProps): React.JSX.Element;
36
+ export interface AppShellProps extends BaseBackProps {
37
+ variant?: BackNav;
38
+ workspace?: Workspace | null;
39
+ search?: boolean | string;
40
+ actions?: NavAction[];
41
+ footerItems?: NavLink[];
42
+ tip?: string;
43
+ /** Extra content for the slim header used by the dock layout. */
44
+ header?: React.ReactNode;
45
+ children?: React.ReactNode;
46
+ }
47
+ export declare function AppShell({ variant, children, header, ...p }: AppShellProps): React.JSX.Element;
48
+ export interface PageHeaderProps {
49
+ title: string;
50
+ description?: string;
51
+ crumbs?: string[];
52
+ actions?: React.ReactNode;
53
+ /** Children render in the actions slot (handy from visual tools). */
54
+ children?: React.ReactNode;
55
+ className?: string;
56
+ style?: React.CSSProperties;
57
+ }
58
+ export declare function PageHeader({ title, description, crumbs, actions, children, className, style }: PageHeaderProps): React.JSX.Element;
59
+ export {};
@@ -0,0 +1,69 @@
1
+ import * as React from 'react';
2
+ import type { FrontNav, LogoVariant, Placement } from '@loomlyne/ui-system-core';
3
+ import { type NavAction, type NavCta, type NavLink } from './shared';
4
+ interface BaseFrontProps {
5
+ links?: NavLink[];
6
+ actions?: NavAction[];
7
+ cta?: NavCta | null;
8
+ /** Where the logo sits. Defaults to the brand's placement. */
9
+ logoPlacement?: Placement;
10
+ logoVariant?: LogoVariant;
11
+ /** 'image' = sits on photography: light text, transparent where it applies. */
12
+ tone?: 'default' | 'image';
13
+ className?: string;
14
+ style?: React.CSSProperties;
15
+ }
16
+ export interface NavDockProps extends Omit<BaseFrontProps, 'logoPlacement'> {
17
+ /** Header logo position, 'dock' puts the mark inside the dock, 'none' hides it. */
18
+ logoPlacement?: Placement | 'dock' | 'none';
19
+ /** Show the menu toggle that opens the explore panel. */
20
+ menu?: boolean;
21
+ /** Explore panel open. */
22
+ open?: boolean;
23
+ panelTitle?: string;
24
+ panel?: React.ReactNode;
25
+ fixed?: boolean;
26
+ }
27
+ export declare function NavDock({ links, actions, cta, logoPlacement, logoVariant, tone, menu, open, panelTitle, panel, fixed, className, style }: NavDockProps): React.JSX.Element;
28
+ export interface NavIslandProps extends BaseFrontProps {
29
+ fixed?: boolean;
30
+ width?: number;
31
+ }
32
+ export declare function NavIsland({ links, actions, cta, logoPlacement, logoVariant, tone, fixed, width, className, style }: NavIslandProps): React.JSX.Element;
33
+ export interface NavBarProps extends BaseFrontProps {
34
+ transparent?: boolean;
35
+ sticky?: boolean;
36
+ secondary?: NavCta | null;
37
+ }
38
+ export declare function NavBar({ links, actions, cta, secondary, logoPlacement, logoVariant, tone, transparent, sticky, className, style }: NavBarProps): React.JSX.Element;
39
+ export interface NavStackedProps extends BaseFrontProps {
40
+ utility?: {
41
+ text?: string;
42
+ links?: NavLink[];
43
+ } | null;
44
+ search?: boolean;
45
+ }
46
+ export declare function NavStacked({ links, actions, logoPlacement, logoVariant, utility, search, className, style }: NavStackedProps): React.JSX.Element;
47
+ export interface NavMinimalProps extends BaseFrontProps {
48
+ open?: boolean;
49
+ menuLabel?: string;
50
+ /** Bar: 'classic' logo + CTA + Menu button, 'corners' text-only MENU / logo / CTA, 'capsule' centered floating Menu capsule. */
51
+ layout?: 'classic' | 'corners' | 'capsule';
52
+ /** Open menu: 'fullscreen' index, 'split' dark index + brand panel, 'drawer' side panel. */
53
+ menuStyle?: 'fullscreen' | 'split' | 'drawer';
54
+ /** Content for the open menu's side column (contact, address). Children work too. */
55
+ aside?: React.ReactNode;
56
+ children?: React.ReactNode;
57
+ }
58
+ export declare function NavMinimal({ links, cta, logoPlacement, logoVariant, tone, open, menuLabel, layout, menuStyle, aside, children, className, style }: NavMinimalProps): React.JSX.Element;
59
+ export interface NavMobileProps extends BaseFrontProps {
60
+ variant?: 'sheet' | 'tabbar' | 'floating';
61
+ open?: boolean;
62
+ transparent?: boolean;
63
+ }
64
+ export declare function NavMobile({ variant, links, actions, cta, logoPlacement, logoVariant, tone, open, transparent, className, style }: NavMobileProps): React.JSX.Element;
65
+ export type SiteNavProps = {
66
+ variant?: FrontNav;
67
+ } & NavDockProps & NavIslandProps & NavBarProps & NavStackedProps & NavMinimalProps;
68
+ export declare function SiteNav({ variant, ...props }: SiteNavProps): React.JSX.Element;
69
+ export {};
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import type { IconName } from '../Icon';
3
+ import type { ButtonProps } from '../primitives';
4
+ export interface NavLink {
5
+ label: string;
6
+ href?: string;
7
+ icon?: IconName | string;
8
+ active?: boolean;
9
+ badge?: string | number;
10
+ onClick?: () => void;
11
+ }
12
+ export interface NavAction {
13
+ icon: IconName | string;
14
+ label: string;
15
+ href?: string;
16
+ count?: number | string;
17
+ dot?: boolean;
18
+ onClick?: () => void;
19
+ }
20
+ export interface NavCta {
21
+ label: string;
22
+ href?: string;
23
+ icon?: IconName | string;
24
+ variant?: ButtonProps['variant'];
25
+ onClick?: () => void;
26
+ }
27
+ export interface NavSection {
28
+ label?: string;
29
+ items: NavLink[];
30
+ }
31
+ export interface AppUser {
32
+ name: string;
33
+ meta?: string;
34
+ initials?: string;
35
+ src?: string;
36
+ }
37
+ export interface Workspace {
38
+ name: string;
39
+ plan?: string;
40
+ initials?: string;
41
+ }
42
+ export declare function A({ link, className, children, title }: {
43
+ link: NavLink;
44
+ className: string;
45
+ children: React.ReactNode;
46
+ title?: string;
47
+ }): React.JSX.Element;
48
+ export declare const arr: <T>(v: T[] | undefined | null) => T[];
@@ -0,0 +1,243 @@
1
+ import * as React from 'react';
2
+ import { type IconName } from './Icon';
3
+ type Anchorish = {
4
+ href?: string;
5
+ onClick?: React.MouseEventHandler;
6
+ target?: string;
7
+ };
8
+ export interface ButtonProps extends Anchorish {
9
+ variant?: 'primary' | 'accent' | 'secondary' | 'outline' | 'ghost' | 'soft' | 'danger' | 'light' | 'glass';
10
+ size?: 'sm' | 'md' | 'lg';
11
+ icon?: IconName | string;
12
+ iconRight?: IconName | string;
13
+ iconOnly?: boolean;
14
+ block?: boolean;
15
+ disabled?: boolean;
16
+ type?: 'button' | 'submit' | 'reset';
17
+ label?: string;
18
+ className?: string;
19
+ style?: React.CSSProperties;
20
+ children?: React.ReactNode;
21
+ }
22
+ export declare function Button({ variant, size, icon, iconRight, iconOnly, block, disabled, type, label, href, onClick, target, className, style, children }: ButtonProps): React.JSX.Element;
23
+ export interface IconButtonProps extends Anchorish {
24
+ icon: IconName | string;
25
+ label: string;
26
+ count?: number | string;
27
+ dot?: boolean;
28
+ className?: string;
29
+ style?: React.CSSProperties;
30
+ }
31
+ export declare function IconButton({ icon, label, count, dot, href, onClick, className, style }: IconButtonProps): React.JSX.Element;
32
+ export type Tone = 'neutral' | 'primary' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
33
+ export interface BadgeProps {
34
+ tone?: Tone;
35
+ solid?: boolean;
36
+ outline?: boolean;
37
+ dot?: boolean;
38
+ className?: string;
39
+ style?: React.CSSProperties;
40
+ children?: React.ReactNode;
41
+ }
42
+ export declare function Badge({ tone, solid, outline, dot, className, style, children }: BadgeProps): React.JSX.Element;
43
+ export interface FieldProps {
44
+ label?: string;
45
+ hint?: string;
46
+ error?: string;
47
+ id?: string;
48
+ className?: string;
49
+ style?: React.CSSProperties;
50
+ children?: React.ReactNode;
51
+ }
52
+ export declare function Field({ label, hint, error, id, className, style, children }: FieldProps): React.JSX.Element;
53
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
54
+ label?: string;
55
+ hint?: string;
56
+ error?: string;
57
+ icon?: IconName | string;
58
+ kbd?: string;
59
+ size?: 'sm' | 'md';
60
+ /** 'search' reads --uis-r-search, --uis-search-bg and --uis-search-border (a grey pill in atelier). */
61
+ variant?: 'default' | 'search';
62
+ }
63
+ export declare function Input({ label, hint, error, icon, kbd, size, variant, id, type, className, style, ...rest }: InputProps): React.JSX.Element;
64
+ export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
65
+ label?: string;
66
+ hint?: string;
67
+ options: Array<string | {
68
+ label: string;
69
+ value: string;
70
+ }>;
71
+ }
72
+ export declare function Select({ label, hint, options, id, className, style, ...rest }: SelectProps): React.JSX.Element;
73
+ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
74
+ label?: string;
75
+ hint?: string;
76
+ }
77
+ export declare function Textarea({ label, hint, id, className, style, ...rest }: TextareaProps): React.JSX.Element;
78
+ export interface ToggleProps {
79
+ label?: string;
80
+ checked?: boolean;
81
+ defaultChecked?: boolean;
82
+ onChange?: (checked: boolean) => void;
83
+ className?: string;
84
+ style?: React.CSSProperties;
85
+ }
86
+ export declare function Switch({ label, checked, defaultChecked, onChange, className, style }: ToggleProps): React.JSX.Element;
87
+ export declare function Checkbox({ label, checked, defaultChecked, onChange, className, style }: ToggleProps): React.JSX.Element;
88
+ export interface CardProps {
89
+ variant?: 'default' | 'flat' | 'raised' | 'sunken';
90
+ interactive?: boolean;
91
+ flush?: boolean;
92
+ as?: 'div' | 'article' | 'section' | 'a';
93
+ href?: string;
94
+ className?: string;
95
+ style?: React.CSSProperties;
96
+ children?: React.ReactNode;
97
+ }
98
+ export declare function Card({ variant, interactive, flush, as, href, className, style, children }: CardProps): React.JSX.Element;
99
+ export declare function Media({ src, alt, ratio, className, style, children }: {
100
+ src?: string;
101
+ alt?: string;
102
+ ratio?: string;
103
+ className?: string;
104
+ style?: React.CSSProperties;
105
+ children?: React.ReactNode;
106
+ }): React.JSX.Element;
107
+ export declare function Divider({ vertical, className, style }: {
108
+ vertical?: boolean;
109
+ className?: string;
110
+ style?: React.CSSProperties;
111
+ }): React.JSX.Element;
112
+ export declare function Kbd({ children, className, style }: {
113
+ children?: React.ReactNode;
114
+ className?: string;
115
+ style?: React.CSSProperties;
116
+ }): React.JSX.Element;
117
+ export interface TabItem {
118
+ label: string;
119
+ value?: string;
120
+ icon?: IconName | string;
121
+ href?: string;
122
+ }
123
+ export interface TabsProps {
124
+ items: Array<TabItem | string>;
125
+ value?: string;
126
+ defaultValue?: string;
127
+ onChange?: (value: string) => void;
128
+ variant?: 'segmented' | 'pill' | 'underline' | 'plain';
129
+ className?: string;
130
+ style?: React.CSSProperties;
131
+ }
132
+ export declare function Tabs({ items, value, defaultValue, onChange, variant, className, style }: TabsProps): React.JSX.Element;
133
+ export { Avatar, AvatarGroup, avatarSvg, AVATAR_STYLES, type AvatarProps } from './Avatar';
134
+ export declare function Tooltip({ children, className, style }: {
135
+ children?: React.ReactNode;
136
+ className?: string;
137
+ style?: React.CSSProperties;
138
+ }): React.JSX.Element;
139
+ export declare function Toast({ title, children, icon, action, className, style }: {
140
+ title?: string;
141
+ children?: React.ReactNode;
142
+ icon?: IconName | string;
143
+ action?: React.ReactNode;
144
+ className?: string;
145
+ style?: React.CSSProperties;
146
+ }): React.JSX.Element;
147
+ export declare function Alert({ tone, title, children, icon, className, style }: {
148
+ tone?: 'info' | 'success' | 'warning' | 'danger';
149
+ title?: string;
150
+ children?: React.ReactNode;
151
+ icon?: IconName | string;
152
+ className?: string;
153
+ style?: React.CSSProperties;
154
+ }): React.JSX.Element;
155
+ export declare function Progress({ value, className, style }: {
156
+ value?: number;
157
+ className?: string;
158
+ style?: React.CSSProperties;
159
+ }): React.JSX.Element;
160
+ export interface StatProps {
161
+ label: string;
162
+ value: React.ReactNode;
163
+ delta?: string;
164
+ trend?: 'up' | 'down';
165
+ icon?: IconName | string;
166
+ className?: string;
167
+ style?: React.CSSProperties;
168
+ }
169
+ export declare function Stat({ label, value, delta, trend, icon, className, style }: StatProps): React.JSX.Element;
170
+ export interface TableColumn {
171
+ key: string;
172
+ label: string;
173
+ align?: 'left' | 'right' | 'center';
174
+ width?: string | number;
175
+ }
176
+ /** A cell is any node, or data: { tone, label } renders a status Badge, { strong } bold text. */
177
+ export type TableCell = React.ReactNode | {
178
+ tone: Tone;
179
+ label: string;
180
+ } | {
181
+ strong: string;
182
+ };
183
+ export interface TableProps {
184
+ columns: TableColumn[];
185
+ rows: Array<Record<string, TableCell>>;
186
+ className?: string;
187
+ style?: React.CSSProperties;
188
+ }
189
+ export declare function Table({ columns, rows, className, style }: TableProps): React.JSX.Element;
190
+ export declare function Popover({ title, className, style, children }: {
191
+ title?: string;
192
+ className?: string;
193
+ style?: React.CSSProperties;
194
+ children?: React.ReactNode;
195
+ }): React.JSX.Element;
196
+ export interface MenuItem {
197
+ label: string;
198
+ icon?: IconName | string;
199
+ href?: string;
200
+ kbd?: string;
201
+ onClick?: () => void;
202
+ }
203
+ export declare function Menu({ items, className, style }: {
204
+ items: MenuItem[];
205
+ className?: string;
206
+ style?: React.CSSProperties;
207
+ }): React.JSX.Element;
208
+ export declare function Chips({ items, className, style }: {
209
+ items: Array<{
210
+ label: string;
211
+ href?: string;
212
+ onClick?: () => void;
213
+ }>;
214
+ className?: string;
215
+ style?: React.CSSProperties;
216
+ }): React.JSX.Element;
217
+ export declare function Scrim({ onClick }: {
218
+ onClick?: () => void;
219
+ }): React.JSX.Element;
220
+ export interface DrawerProps {
221
+ title?: string;
222
+ open?: boolean;
223
+ side?: 'right' | 'left';
224
+ floating?: boolean;
225
+ footer?: React.ReactNode;
226
+ onClose?: () => void;
227
+ scrim?: boolean;
228
+ className?: string;
229
+ style?: React.CSSProperties;
230
+ children?: React.ReactNode;
231
+ }
232
+ export declare function Drawer({ title, open, side, floating, footer, onClose, scrim, className, style, children }: DrawerProps): React.JSX.Element | null;
233
+ export interface DialogProps {
234
+ title?: string;
235
+ description?: string;
236
+ open?: boolean;
237
+ actions?: React.ReactNode;
238
+ onClose?: () => void;
239
+ className?: string;
240
+ style?: React.CSSProperties;
241
+ children?: React.ReactNode;
242
+ }
243
+ export declare function Dialog({ title, description, open, actions, onClose, className, style, children }: DialogProps): React.JSX.Element | null;