lucent-ui 0.26.0 → 0.27.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.
package/dist/index.d.ts CHANGED
@@ -15,6 +15,43 @@ import { TdHTMLAttributes } from 'react';
15
15
  import { TextareaHTMLAttributes } from 'react';
16
16
  import { ThHTMLAttributes } from 'react';
17
17
 
18
+ /**
19
+ * The 5 accent tokens that form the accent layer.
20
+ *
21
+ * These are the only tokens that change when the user picks a different brand
22
+ * color. Backgrounds, surfaces, borders, and text remain neutral.
23
+ */
24
+ export declare interface AccentTokens {
25
+ accentDefault: string;
26
+ accentHover: string;
27
+ accentSubtle: string;
28
+ accentBorder: string;
29
+ accentFg: string;
30
+ }
31
+
32
+ /**
33
+ * Derive the complete set of 5 accent tokens from a single hex color.
34
+ *
35
+ * This is the standalone equivalent of the accent derivation that
36
+ * `LucentProvider` and `createTheme` perform internally. Use it when you
37
+ * need accent tokens outside of the provider (e.g. for a charting library,
38
+ * email template, or server-side rendering).
39
+ *
40
+ * @param color - The accent hex color (e.g. `'#6366f1'`).
41
+ * @param theme - Target theme; defaults to `'light'`.
42
+ * @returns The 5 accent tokens ready to spread into a `Partial<LucentTokens>`.
43
+ *
44
+ * @example
45
+ * const accent = accentTokens('#6366f1');
46
+ * // { accentDefault: '#6366f1', accentHover: '...', accentSubtle: '...', accentBorder: '...', accentFg: '#ffffff' }
47
+ *
48
+ * @example
49
+ * <LucentProvider tokens={{ ...accentTokens('#8b5cf6') }}>
50
+ * <App />
51
+ * </LucentProvider>
52
+ */
53
+ export declare function accentTokens(color: string, theme?: Theme): AccentTokens;
54
+
18
55
  export declare interface AccessibilityDescriptor {
19
56
  /** ARIA role applied to the root element */
20
57
  role?: string;
@@ -82,8 +119,8 @@ export declare const brandPalette: ColorPalette;
82
119
  * Gold brand token overrides — the original lucentui.ai accent palette.
83
120
  *
84
121
  * Pass to `<LucentProvider tokens={brandTokens}>` to opt in to the gold accent.
85
- * `textOnAccent` is automatically computed by the provider via `getContrastText`,
86
- * so text on accent surfaces will always meet WCAG AA contrast.
122
+ * `accentFg` is automatically computed by the provider via `getContrastText`,
123
+ * so text on accent surfaces will always have sufficient APCA contrast.
87
124
  *
88
125
  * @example
89
126
  * import { brandTokens } from 'lucent-ui';
@@ -680,6 +717,20 @@ export declare interface FormFieldProps {
680
717
  style?: CSSProperties;
681
718
  }
682
719
 
720
+ /**
721
+ * Returns a hue-tinted foreground color for text/icons on an accent surface.
722
+ *
723
+ * Unlike `getContrastText` which returns pure black or white, this preserves
724
+ * the accent's hue at a very low (or very high) lightness, producing
725
+ * text that feels "of the same family" as the accent.
726
+ *
727
+ * - Bright accent → very dark hue-tinted fg: `hsl(H, min(S, 60%), 12%)`
728
+ * - Dark accent → very light hue-tinted fg: `hsl(H, min(S, 20%), 95%)`
729
+ *
730
+ * Polarity (dark vs light fg) is determined by APCA.
731
+ */
732
+ export declare function getAccentFg(accentHex: string): string;
733
+
683
734
  /**
684
735
  * Returns `'#000000'` or `'#ffffff'` — whichever is more readable on the
685
736
  * given background, using APCA perceptual contrast.
@@ -1020,7 +1071,7 @@ export declare interface PageLayoutProps {
1020
1071
  /** Footer height in px or any CSS value. Default: 48 */
1021
1072
  footerHeight?: number | string;
1022
1073
  /** Background token for chrome regions (header, sidebar, footer). Default: "bgBase" */
1023
- chromeBackground?: 'bgBase' | 'bgSubtle' | 'surface';
1074
+ chromeBackground?: 'bgBase' | 'bgSubtle' | 'surface' | 'surfaceSecondary';
1024
1075
  /** Style overrides for the main content card (border, borderRadius, boxShadow, etc.) */
1025
1076
  mainStyle?: CSSProperties;
1026
1077
  style?: CSSProperties;
@@ -1259,12 +1310,11 @@ declare interface SemanticColorTokens {
1259
1310
  textSecondary: string;
1260
1311
  textDisabled: string;
1261
1312
  textInverse: string;
1262
- textOnAccent: string;
1263
1313
  accentDefault: string;
1264
1314
  accentHover: string;
1265
- accentActive: string;
1266
1315
  accentSubtle: string;
1267
1316
  accentBorder: string;
1317
+ accentFg: string;
1268
1318
  successDefault: string;
1269
1319
  successSubtle: string;
1270
1320
  successText: string;
@@ -1278,7 +1328,6 @@ declare interface SemanticColorTokens {
1278
1328
  infoDefault: string;
1279
1329
  infoSubtle: string;
1280
1330
  infoText: string;
1281
- focusRing: string;
1282
1331
  }
1283
1332
 
1284
1333
  export declare type ShadowName = 'flat' | 'subtle' | 'elevated';