lucent-ui 0.40.0 → 0.42.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.
Files changed (26) hide show
  1. package/dist/LucentProvider-CIiTlQ5E.cjs +109 -0
  2. package/dist/{LucentProvider-Bm39MMvv.js → LucentProvider-tSCR4lQw.js} +969 -939
  3. package/dist/devtools.cjs +1 -1
  4. package/dist/devtools.js +27 -27
  5. package/dist/index.cjs +47 -42
  6. package/dist/index.d.ts +45 -4
  7. package/dist/index.js +2281 -2026
  8. package/dist-server/server/pattern-registry.js +6 -0
  9. package/dist-server/server/recipe-registry.js +18 -0
  10. package/dist-server/src/components/molecules/PageLayout/PageLayout.manifest.js +65 -8
  11. package/dist-server/src/manifest/patterns/index.js +2 -0
  12. package/dist-server/src/manifest/patterns/multi-step-wizard.pattern.js +180 -0
  13. package/dist-server/src/manifest/patterns/search-filter-panel.pattern.js +188 -0
  14. package/dist-server/src/manifest/patterns/tab-page.pattern.js +152 -0
  15. package/dist-server/src/manifest/recipes/action-bar.recipe.js +91 -0
  16. package/dist-server/src/manifest/recipes/collapsible-card.recipe.js +100 -0
  17. package/dist-server/src/manifest/recipes/empty-state-card.recipe.js +72 -0
  18. package/dist-server/src/manifest/recipes/form-layout.recipe.js +98 -0
  19. package/dist-server/src/manifest/recipes/index.js +8 -0
  20. package/dist-server/src/manifest/recipes/profile-card.recipe.js +101 -0
  21. package/dist-server/src/manifest/recipes/search-filter-bar.recipe.js +122 -0
  22. package/dist-server/src/manifest/recipes/settings-panel.recipe.js +167 -0
  23. package/dist-server/src/manifest/recipes/stats-row.recipe.js +106 -0
  24. package/dist-server/src/manifest/validate.test.js +28 -0
  25. package/package.json +5 -1
  26. package/dist/LucentProvider-CzEDW5SL.cjs +0 -109
package/dist/index.d.ts CHANGED
@@ -1187,6 +1187,9 @@ export declare interface LucentTokens extends SemanticColorTokens, TypographyTok
1187
1187
  * Generates a CSS string of custom properties from a token set.
1188
1188
  * Inject the result into a <style> tag or a CSS-in-JS solution.
1189
1189
  *
1190
+ * Token values are sanitized to prevent CSS injection — characters that
1191
+ * could break out of a property value context (`{};<>@\`) are stripped.
1192
+ *
1190
1193
  * @example
1191
1194
  * const css = makeLibraryCSS(lightTokens);
1192
1195
  * document.getElementById('lucent-tokens').textContent = css;
@@ -1448,18 +1451,34 @@ export declare interface PageHeaderProps {
1448
1451
  style?: CSSProperties;
1449
1452
  }
1450
1453
 
1451
- export declare function PageLayout({ children, header, sidebar, sidebarWidth, headerHeight, sidebarCollapsed, rightSidebar, rightSidebarWidth, rightSidebarCollapsed, footer, footerHeight, chromeBackground, mainStyle, style, }: PageLayoutProps): JSX_2.Element;
1454
+ export declare function PageLayout({ children, header, sidebar, sidebarHeader, sidebarFooter, sidebarWidth, sidebarCollapsedWidth, headerHeight, sidebarCollapsed, onSidebarCollapsedChange, sidebarMode, sidebarDrawerBreakpoint, sidebarDrawerOpen, onSidebarDrawerOpenChange, rightSidebar, rightSidebarWidth, rightSidebarCollapsed, footer, footerHeight, chromeBackground, mainStyle, style, }: PageLayoutProps): JSX_2.Element;
1452
1455
 
1453
1456
  export declare interface PageLayoutProps {
1454
1457
  children: ReactNode;
1455
1458
  header?: ReactNode;
1456
1459
  sidebar?: ReactNode;
1460
+ /** Pinned content at the top of the sidebar — logo, app name, branding. */
1461
+ sidebarHeader?: ReactNode;
1462
+ /** Pinned content at the bottom of the sidebar — account, help, secondary actions. */
1463
+ sidebarFooter?: ReactNode;
1457
1464
  /** Sidebar width in px or any CSS value. Default: 240 */
1458
1465
  sidebarWidth?: number | string;
1466
+ /** Width the sidebar collapses to (e.g. 56 for icon-only). Default: 0 */
1467
+ sidebarCollapsedWidth?: number | string;
1459
1468
  /** Header height in px or any CSS value. Default: 48 */
1460
1469
  headerHeight?: number | string;
1461
- /** Collapse the sidebar to zero width */
1470
+ /** Collapse the sidebar to sidebarCollapsedWidth */
1462
1471
  sidebarCollapsed?: boolean;
1472
+ /** Called when the sidebar collapse handle is clicked. When provided, renders a handle on the sidebar edge. */
1473
+ onSidebarCollapsedChange?: (collapsed: boolean) => void;
1474
+ /** Sidebar display mode. 'inline' = always inline, 'drawer' = always drawer overlay, 'auto' = switches at breakpoint. Default: 'auto' */
1475
+ sidebarMode?: 'inline' | 'drawer' | 'auto';
1476
+ /** Viewport width (px) below which sidebar switches to drawer mode. Only used when sidebarMode='auto'. Default: 768 */
1477
+ sidebarDrawerBreakpoint?: number;
1478
+ /** Controlled open state when sidebar is in drawer mode. */
1479
+ sidebarDrawerOpen?: boolean;
1480
+ /** Called when the drawer open state changes (backdrop click, escape key). */
1481
+ onSidebarDrawerOpenChange?: (open: boolean) => void;
1463
1482
  /** Right panel content rendered as a flex sibling of <main> */
1464
1483
  rightSidebar?: ReactNode;
1465
1484
  /** Right panel width in px or any CSS value. Default: 240 */
@@ -1612,6 +1631,15 @@ export declare interface RowProps {
1612
1631
  'aria-labelledby'?: string;
1613
1632
  }
1614
1633
 
1634
+ /**
1635
+ * Returns the href unchanged if it uses a safe protocol (http, https, mailto, tel,
1636
+ * or relative path), otherwise returns `undefined` to prevent navigation.
1637
+ *
1638
+ * Blocks `javascript:`, `data:`, `vbscript:`, and any other executable protocol
1639
+ * that could be used for XSS via href injection.
1640
+ */
1641
+ export declare function sanitizeHref(href: string | undefined): string | undefined;
1642
+
1615
1643
  export declare function SearchInput({ value, onChange, mode, placeholder, size, label, helperText, errorText, results, onResultSelect, isLoading, disabled, id, style, }: SearchInputProps): JSX_2.Element;
1616
1644
 
1617
1645
  export declare const SearchInputManifest: ComponentManifest;
@@ -1997,7 +2025,7 @@ export declare interface TableProps extends HTMLAttributes<HTMLTableElement> {
1997
2025
  striped?: boolean;
1998
2026
  }
1999
2027
 
2000
- export declare function Tabs({ tabs, defaultValue, value, onChange, variant, style }: TabsProps): JSX_2.Element;
2028
+ export declare function Tabs({ tabs, defaultValue, value, onChange, variant, size, style }: TabsProps): JSX_2.Element;
2001
2029
 
2002
2030
  export declare interface TabsProps {
2003
2031
  tabs: TabItem[];
@@ -2005,9 +2033,12 @@ export declare interface TabsProps {
2005
2033
  value?: string;
2006
2034
  onChange?: (value: string) => void;
2007
2035
  variant?: TabsVariant;
2036
+ size?: TabsSize;
2008
2037
  style?: CSSProperties;
2009
2038
  }
2010
2039
 
2040
+ export declare type TabsSize = 'sm' | 'md';
2041
+
2011
2042
  export declare type TabsVariant = 'underline' | 'pills';
2012
2043
 
2013
2044
  export declare function Tag({ children, variant, size, onDismiss, disabled }: TagProps): JSX_2.Element;
@@ -2219,7 +2250,7 @@ export declare interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputE
2219
2250
 
2220
2251
  export declare type ToggleSize = 'sm' | 'md' | 'lg';
2221
2252
 
2222
- export declare function Tooltip({ content, children, placement, delay, open }: TooltipProps): JSX_2.Element;
2253
+ export declare function Tooltip({ content, children, placement, delay, open, interactive }: TooltipProps): JSX_2.Element;
2223
2254
 
2224
2255
  export declare const TooltipManifest: ComponentManifest;
2225
2256
 
@@ -2233,6 +2264,8 @@ export declare interface TooltipProps {
2233
2264
  delay?: number;
2234
2265
  /** Controlled visibility. When provided, overrides hover behavior. */
2235
2266
  open?: boolean;
2267
+ /** When true, the popup stays visible while hovered and allows pointer events inside. */
2268
+ interactive?: boolean;
2236
2269
  }
2237
2270
 
2238
2271
  declare interface TypographyTokens {
@@ -2281,6 +2314,14 @@ export declare interface UsageExample {
2281
2314
  */
2282
2315
  export declare function useLucent(): LucentContextValue;
2283
2316
 
2317
+ /**
2318
+ * SSR-safe hook that subscribes to a CSS media query and returns whether it matches.
2319
+ *
2320
+ * @param query - A valid CSS media query string, e.g. `"(max-width: 767px)"`
2321
+ * @returns `true` when the query matches, `false` otherwise (and on SSR).
2322
+ */
2323
+ export declare function useMediaQuery(query: string): boolean;
2324
+
2284
2325
  export declare function useToast(): ToastContextValue;
2285
2326
 
2286
2327
  /**