lucent-ui 0.37.0 → 0.38.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/{LucentProvider-F0EN_7TD.js → LucentProvider-Bm39MMvv.js} +550 -532
- package/dist/{LucentProvider-LqNc0AxD.cjs → LucentProvider-CzEDW5SL.cjs} +6 -6
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +1 -1
- package/dist/index.cjs +87 -41
- package/dist/index.d.ts +92 -5
- package/dist/index.js +1519 -1285
- package/dist-server/src/components/atoms/Row/Row.manifest.js +10 -2
- package/dist-server/src/components/atoms/Stack/Stack.manifest.js +6 -2
- package/dist-server/src/components/molecules/Breadcrumb/Breadcrumb.manifest.js +27 -0
- package/dist-server/src/components/molecules/PageHeader/PageHeader.manifest.js +144 -0
- package/dist-server/src/manifest/examples/button.manifest.js +39 -1
- package/dist-server/src/manifest/patterns/action-bar.pattern.js +34 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
2
3
|
import { Context } from 'react';
|
|
3
4
|
import { CSSProperties } from 'react';
|
|
4
5
|
import { default as default_2 } from 'react';
|
|
@@ -7,6 +8,7 @@ import { HTMLAttributes } from 'react';
|
|
|
7
8
|
import { ImgHTMLAttributes } from 'react';
|
|
8
9
|
import { InputHTMLAttributes } from 'react';
|
|
9
10
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
10
12
|
import { MouseEventHandler } from 'react';
|
|
11
13
|
import { ReactNode } from 'react';
|
|
12
14
|
import { RefAttributes } from 'react';
|
|
@@ -142,7 +144,7 @@ export declare const brandPalette: ColorPalette;
|
|
|
142
144
|
*/
|
|
143
145
|
export declare const brandTokens: Partial<LucentTokens>;
|
|
144
146
|
|
|
145
|
-
export declare function Breadcrumb({ items, separator, style }: BreadcrumbProps): JSX_2.Element;
|
|
147
|
+
export declare function Breadcrumb({ items, separator, style, LinkComponent }: BreadcrumbProps): JSX_2.Element;
|
|
146
148
|
|
|
147
149
|
export declare interface BreadcrumbItem {
|
|
148
150
|
label: ReactNode;
|
|
@@ -150,11 +152,44 @@ export declare interface BreadcrumbItem {
|
|
|
150
152
|
onClick?: () => void;
|
|
151
153
|
}
|
|
152
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Props that Breadcrumb passes to a user-supplied `LinkComponent`.
|
|
157
|
+
* Shape mirrors a native `<a>` so simple drop-ins work and custom link
|
|
158
|
+
* primitives (react-router `<Link>`, Next.js `<Link>`, etc.) can adapt
|
|
159
|
+
* with a thin wrapper.
|
|
160
|
+
*/
|
|
161
|
+
export declare interface BreadcrumbLinkProps {
|
|
162
|
+
href: string;
|
|
163
|
+
children: ReactNode;
|
|
164
|
+
style?: CSSProperties;
|
|
165
|
+
onClick?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
166
|
+
onMouseEnter?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
167
|
+
onMouseLeave?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
168
|
+
}
|
|
169
|
+
|
|
153
170
|
export declare interface BreadcrumbProps {
|
|
154
171
|
items: BreadcrumbItem[];
|
|
155
172
|
/** Separator between items. Defaults to "/" */
|
|
156
173
|
separator?: ReactNode;
|
|
157
174
|
style?: CSSProperties;
|
|
175
|
+
/**
|
|
176
|
+
* Optional custom link component used for items with an `href`.
|
|
177
|
+
* Enables SPA-friendly navigation (react-router, Next.js, etc.) without
|
|
178
|
+
* falling back to a full-page reload.
|
|
179
|
+
*
|
|
180
|
+
* The component receives `{ href, children, style, onClick, onMouseEnter, onMouseLeave }`.
|
|
181
|
+
* If your link primitive uses a different prop name for the URL (e.g. react-router's
|
|
182
|
+
* `to`), wrap it in a small adapter:
|
|
183
|
+
*
|
|
184
|
+
* ```tsx
|
|
185
|
+
* const RouterLink = ({ href, ...rest }) => <Link to={href} {...rest} />;
|
|
186
|
+
* <Breadcrumb LinkComponent={RouterLink} items={...} />
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* Your adapter must forward `style` to the rendered DOM element so Breadcrumb's
|
|
190
|
+
* typography and hover styling are preserved.
|
|
191
|
+
*/
|
|
192
|
+
LinkComponent?: ComponentType<BreadcrumbLinkProps>;
|
|
158
193
|
}
|
|
159
194
|
|
|
160
195
|
/**
|
|
@@ -177,7 +212,7 @@ export declare const brutalistPreset: DesignPreset;
|
|
|
177
212
|
*/
|
|
178
213
|
export declare const brutalistShadow: ShadowPreset;
|
|
179
214
|
|
|
180
|
-
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
215
|
+
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
181
216
|
|
|
182
217
|
export declare function ButtonGroup({ children, style, }: ButtonGroupProps): JSX_2.Element;
|
|
183
218
|
|
|
@@ -196,7 +231,7 @@ export declare interface ButtonGroupProps {
|
|
|
196
231
|
|
|
197
232
|
export declare const ButtonManifest: ComponentManifest;
|
|
198
233
|
|
|
199
|
-
export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
234
|
+
export declare interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'href'> {
|
|
200
235
|
variant?: ButtonVariant;
|
|
201
236
|
size?: ButtonSize;
|
|
202
237
|
loading?: boolean;
|
|
@@ -211,6 +246,20 @@ export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElem
|
|
|
211
246
|
disableHoverStyles?: boolean;
|
|
212
247
|
/** If false, the component renders without any border. Useful when you want a solid "flat" look. */
|
|
213
248
|
bordered?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* When set, renders the Button as an `<a href={href}>` instead of a native `<button>`.
|
|
251
|
+
* Preserves full anchor affordances — middle-click, cmd-click, right-click "copy link",
|
|
252
|
+
* and "open in new tab" — which an onClick handler cannot.
|
|
253
|
+
*
|
|
254
|
+
* Useful for `mailto:`/`tel:` quick actions and external links that should look like buttons.
|
|
255
|
+
* When combined with `disabled`, the anchor is rendered with `aria-disabled="true"` and its
|
|
256
|
+
* `href` is removed so it can't be navigated.
|
|
257
|
+
*/
|
|
258
|
+
href?: string;
|
|
259
|
+
/** Forwarded to the `<a>` element when `href` is set. */
|
|
260
|
+
target?: string;
|
|
261
|
+
/** Forwarded to the `<a>` element when `href` is set. */
|
|
262
|
+
rel?: string;
|
|
214
263
|
}
|
|
215
264
|
|
|
216
265
|
export declare type ButtonSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
@@ -1253,6 +1302,44 @@ export declare const neumorphicShadow: ShadowPreset;
|
|
|
1253
1302
|
|
|
1254
1303
|
export declare const oceanPalette: ColorPalette;
|
|
1255
1304
|
|
|
1305
|
+
export declare function PageHeader({ title, subtitle, breadcrumbs, action, secondaryActions, hideDivider, style, }: PageHeaderProps): JSX_2.Element;
|
|
1306
|
+
|
|
1307
|
+
export declare interface PageHeaderAction {
|
|
1308
|
+
label: ReactNode;
|
|
1309
|
+
onClick?: () => void;
|
|
1310
|
+
/** Optional href — when set, the underlying Button renders as a link via onClick navigation. */
|
|
1311
|
+
href?: string;
|
|
1312
|
+
/** Override the default variant. Primary action defaults to "primary", secondary actions to "outline". */
|
|
1313
|
+
variant?: ButtonVariant;
|
|
1314
|
+
leftIcon?: ReactNode;
|
|
1315
|
+
rightIcon?: ReactNode;
|
|
1316
|
+
disabled?: boolean;
|
|
1317
|
+
loading?: boolean;
|
|
1318
|
+
'aria-label'?: string;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
export declare const PageHeaderManifest: ComponentManifest;
|
|
1322
|
+
|
|
1323
|
+
export declare interface PageHeaderProps {
|
|
1324
|
+
/** Page title — rendered as an h1 in display font. */
|
|
1325
|
+
title: string;
|
|
1326
|
+
/** Optional subtitle or metadata line below the title. */
|
|
1327
|
+
subtitle?: ReactNode;
|
|
1328
|
+
/** Breadcrumb items rendered above the title. */
|
|
1329
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
1330
|
+
/** Primary CTA rendered rightmost. Pass `null` to explicitly omit. */
|
|
1331
|
+
action?: PageHeaderAction | null;
|
|
1332
|
+
/**
|
|
1333
|
+
* 0–3 secondary actions rendered to the left of the primary `action`.
|
|
1334
|
+
* Defaults to `variant="outline"` so they stay visually subordinate to the primary CTA.
|
|
1335
|
+
* For more than 3 actions, use a SplitButton or overflow menu instead.
|
|
1336
|
+
*/
|
|
1337
|
+
secondaryActions?: PageHeaderAction[];
|
|
1338
|
+
/** Hide the bottom divider. Default: false. */
|
|
1339
|
+
hideDivider?: boolean;
|
|
1340
|
+
style?: CSSProperties;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1256
1343
|
export declare function PageLayout({ children, header, sidebar, sidebarWidth, headerHeight, sidebarCollapsed, rightSidebar, rightSidebarWidth, rightSidebarCollapsed, footer, footerHeight, chromeBackground, mainStyle, style, }: PageLayoutProps): JSX_2.Element;
|
|
1257
1344
|
|
|
1258
1345
|
export declare interface PageLayoutProps {
|
|
@@ -1394,7 +1481,7 @@ export declare function Row({ gap, align, justify, as, wrap, children, style, ..
|
|
|
1394
1481
|
|
|
1395
1482
|
export declare type RowAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
1396
1483
|
|
|
1397
|
-
export declare type RowAs = 'div' | 'section' | 'nav' | 'form' | 'fieldset' | 'ul' | 'ol';
|
|
1484
|
+
export declare type RowAs = 'div' | 'section' | 'nav' | 'header' | 'footer' | 'main' | 'aside' | 'article' | 'form' | 'fieldset' | 'ul' | 'ol';
|
|
1398
1485
|
|
|
1399
1486
|
export declare type RowGap = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '8' | '10' | '12' | '16' | '20' | '24';
|
|
1400
1487
|
|
|
@@ -1681,7 +1768,7 @@ export declare function Stack({ gap, align, justify, as, wrap, children, style,
|
|
|
1681
1768
|
|
|
1682
1769
|
export declare type StackAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
1683
1770
|
|
|
1684
|
-
export declare type StackAs = 'div' | 'section' | 'nav' | 'form' | 'fieldset' | 'ul' | 'ol';
|
|
1771
|
+
export declare type StackAs = 'div' | 'section' | 'nav' | 'header' | 'footer' | 'main' | 'aside' | 'article' | 'form' | 'fieldset' | 'ul' | 'ol';
|
|
1685
1772
|
|
|
1686
1773
|
export declare type StackGap = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '8' | '10' | '12' | '16' | '20' | '24';
|
|
1687
1774
|
|