lucent-ui 0.9.2 → 0.11.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/index.cjs +67 -36
- package/dist/index.d.ts +108 -8
- package/dist/index.js +2213 -1536
- package/dist-cli/cli/entry.js +32 -0
- package/dist-cli/cli/init/index.js +115 -0
- package/dist-cli/cli/init/prompts.js +25 -0
- package/dist-cli/src/tokens/presets/types.js +1 -0
- package/dist-server/server/index.js +45 -0
- package/dist-server/server/presets.js +105 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export declare type BadgeSize = 'sm' | 'md';
|
|
|
75
75
|
|
|
76
76
|
export declare type BadgeVariant = 'neutral' | 'success' | 'warning' | 'danger' | 'info' | 'accent';
|
|
77
77
|
|
|
78
|
+
export declare const brandPalette: ColorPalette;
|
|
79
|
+
|
|
78
80
|
/**
|
|
79
81
|
* Gold brand token overrides — the original lucentui.ai accent palette.
|
|
80
82
|
*
|
|
@@ -126,7 +128,7 @@ export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElem
|
|
|
126
128
|
|
|
127
129
|
export declare type ButtonSize = 'sm' | 'md' | 'lg';
|
|
128
130
|
|
|
129
|
-
export declare type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
131
|
+
export declare type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
|
|
130
132
|
|
|
131
133
|
export declare function Card({ header, footer, children, padding, shadow, radius, style, }: CardProps): JSX_2.Element;
|
|
132
134
|
|
|
@@ -214,6 +216,12 @@ export declare const COLOR_PICKER_MANIFEST: ComponentManifest;
|
|
|
214
216
|
|
|
215
217
|
export declare const COLOR_SWATCH_MANIFEST: ComponentManifest;
|
|
216
218
|
|
|
219
|
+
export declare interface ColorPalette {
|
|
220
|
+
name: string;
|
|
221
|
+
light: ThemeAnchors;
|
|
222
|
+
dark: ThemeAnchors;
|
|
223
|
+
}
|
|
224
|
+
|
|
217
225
|
export declare function ColorPicker({ value, onChange, label, disabled, presetGroups, id, style, }: ColorPickerProps): JSX_2.Element;
|
|
218
226
|
|
|
219
227
|
export declare namespace ColorPicker {
|
|
@@ -275,6 +283,8 @@ export declare interface CommandPaletteProps {
|
|
|
275
283
|
style?: CSSProperties;
|
|
276
284
|
}
|
|
277
285
|
|
|
286
|
+
export declare const compactDensity: DensityPreset;
|
|
287
|
+
|
|
278
288
|
/**
|
|
279
289
|
* The domain of a component.
|
|
280
290
|
* "neutral" means the component is domain-agnostic and reusable
|
|
@@ -445,6 +455,17 @@ export declare interface DateRangePickerProps {
|
|
|
445
455
|
style?: CSSProperties;
|
|
446
456
|
}
|
|
447
457
|
|
|
458
|
+
export declare const defaultDensity: DensityPreset;
|
|
459
|
+
|
|
460
|
+
export declare const defaultPalette: ColorPalette;
|
|
461
|
+
|
|
462
|
+
export declare type DensityName = 'compact' | 'default' | 'spacious';
|
|
463
|
+
|
|
464
|
+
export declare interface DensityPreset {
|
|
465
|
+
name: string;
|
|
466
|
+
tokens: SpacingTokens;
|
|
467
|
+
}
|
|
468
|
+
|
|
448
469
|
/**
|
|
449
470
|
* Derives a complete dark-mode token set from a light-mode token set.
|
|
450
471
|
*
|
|
@@ -482,6 +503,14 @@ export declare function deriveDarkFromLight(light: LucentTokens): LucentTokens;
|
|
|
482
503
|
*/
|
|
483
504
|
export declare function deriveTokens(overrides: Partial<LucentTokens>, merged: LucentTokens, theme: Theme): Partial<LucentTokens>;
|
|
484
505
|
|
|
506
|
+
export declare interface DesignPreset {
|
|
507
|
+
name: string;
|
|
508
|
+
palette: ColorPalette;
|
|
509
|
+
shape: ShapePreset;
|
|
510
|
+
density: DensityPreset;
|
|
511
|
+
shadow: ShadowPreset;
|
|
512
|
+
}
|
|
513
|
+
|
|
485
514
|
export declare function Divider({ orientation, label, spacing, style }: DividerProps): JSX_2.Element;
|
|
486
515
|
|
|
487
516
|
export declare const DividerManifest: ComponentManifest;
|
|
@@ -495,6 +524,10 @@ export declare interface DividerProps {
|
|
|
495
524
|
style?: CSSProperties;
|
|
496
525
|
}
|
|
497
526
|
|
|
527
|
+
export declare const elevatedShadow: ShadowPreset;
|
|
528
|
+
|
|
529
|
+
export declare const emeraldPalette: ColorPalette;
|
|
530
|
+
|
|
498
531
|
export declare function EmptyState({ illustration, title, description, action, style, }: EmptyStateProps): JSX_2.Element;
|
|
499
532
|
|
|
500
533
|
export declare const EmptyStateManifest: ComponentManifest;
|
|
@@ -507,6 +540,8 @@ export declare interface EmptyStateProps {
|
|
|
507
540
|
style?: CSSProperties;
|
|
508
541
|
}
|
|
509
542
|
|
|
543
|
+
export declare const enterprisePreset: DesignPreset;
|
|
544
|
+
|
|
510
545
|
export declare const FILE_UPLOAD_MANIFEST: ComponentManifest;
|
|
511
546
|
|
|
512
547
|
export declare function FileUpload({ accept, multiple, maxSize, value: controlledValue, onChange, onError, disabled, style, }: FileUploadProps): JSX_2.Element;
|
|
@@ -525,6 +560,8 @@ export declare interface FileUploadProps {
|
|
|
525
560
|
style?: CSSProperties;
|
|
526
561
|
}
|
|
527
562
|
|
|
563
|
+
export declare const flatShadow: ShadowPreset;
|
|
564
|
+
|
|
528
565
|
export declare function FormField({ label, htmlFor, required, helperText, errorMessage, children, style, }: FormFieldProps): JSX_2.Element;
|
|
529
566
|
|
|
530
567
|
export declare const FormFieldManifest: ComponentManifest;
|
|
@@ -540,14 +577,15 @@ export declare interface FormFieldProps {
|
|
|
540
577
|
}
|
|
541
578
|
|
|
542
579
|
/**
|
|
543
|
-
* Returns `'#000000'` or `'#ffffff'` — whichever
|
|
544
|
-
*
|
|
580
|
+
* Returns `'#000000'` or `'#ffffff'` — whichever is more readable on the
|
|
581
|
+
* given background, using APCA perceptual contrast.
|
|
545
582
|
*
|
|
546
|
-
*
|
|
583
|
+
* APCA correctly handles saturated blues/purples where WCAG 2.1 fails.
|
|
547
584
|
*
|
|
548
585
|
* @example
|
|
549
|
-
* getContrastText('#
|
|
550
|
-
* getContrastText('#
|
|
586
|
+
* getContrastText('#0ea5e9') // → '#ffffff' (sky blue → white, APCA says white is more readable)
|
|
587
|
+
* getContrastText('#e9c96b') // → '#000000' (gold → black)
|
|
588
|
+
* getContrastText('#111827') // → '#ffffff' (near-black → white)
|
|
551
589
|
*/
|
|
552
590
|
export declare function getContrastText(hex: string): '#000000' | '#ffffff';
|
|
553
591
|
|
|
@@ -568,6 +606,8 @@ export declare interface IconProps {
|
|
|
568
606
|
|
|
569
607
|
export declare type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
570
608
|
|
|
609
|
+
export declare const indigoPalette: ColorPalette;
|
|
610
|
+
|
|
571
611
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
572
612
|
|
|
573
613
|
export declare const InputManifest: ComponentManifest;
|
|
@@ -620,12 +660,20 @@ declare interface LucentContextValue {
|
|
|
620
660
|
* <App />
|
|
621
661
|
* </LucentProvider>
|
|
622
662
|
*/
|
|
623
|
-
export declare function LucentProvider({ theme, tokens: tokenOverrides, anchors, children, }: LucentProviderProps): JSX_2.Element;
|
|
663
|
+
export declare function LucentProvider({ theme, preset, tokens: tokenOverrides, anchors, children, }: LucentProviderProps): JSX_2.Element;
|
|
624
664
|
|
|
625
665
|
export declare const LucentProviderManifest: ComponentManifest;
|
|
626
666
|
|
|
627
667
|
export declare interface LucentProviderProps {
|
|
628
668
|
theme?: Theme;
|
|
669
|
+
/**
|
|
670
|
+
* A design preset that bundles palette, shape, density, and shadow tokens.
|
|
671
|
+
* Pass a combined preset name (`"modern"`, `"enterprise"`, `"playful"`) or
|
|
672
|
+
* an object to mix dimensions: `{ palette: 'indigo', shape: 'pill' }`.
|
|
673
|
+
*
|
|
674
|
+
* Precedence (later wins): base theme → preset → anchors → tokens.
|
|
675
|
+
*/
|
|
676
|
+
preset?: PresetProp;
|
|
629
677
|
/**
|
|
630
678
|
* Full or partial token overrides. Individual tokens can be set here and
|
|
631
679
|
* any missing variant tokens will be derived automatically.
|
|
@@ -655,6 +703,8 @@ export declare function makeLibraryCSS(tokens: LucentTokens, selector?: string):
|
|
|
655
703
|
|
|
656
704
|
export declare const MANIFEST_SPEC_VERSION = "1.0";
|
|
657
705
|
|
|
706
|
+
export declare const modernPreset: DesignPreset;
|
|
707
|
+
|
|
658
708
|
declare interface MotionTokens {
|
|
659
709
|
durationFast: string;
|
|
660
710
|
durationBase: string;
|
|
@@ -700,6 +750,8 @@ export declare interface NavLinkProps {
|
|
|
700
750
|
style?: CSSProperties;
|
|
701
751
|
}
|
|
702
752
|
|
|
753
|
+
export declare const oceanPalette: ColorPalette;
|
|
754
|
+
|
|
703
755
|
export declare function PageLayout({ children, header, sidebar, sidebarWidth, headerHeight, sidebarCollapsed, rightSidebar, rightSidebarWidth, rightSidebarCollapsed, footer, footerHeight, mainStyle, style, }: PageLayoutProps): JSX_2.Element;
|
|
704
756
|
|
|
705
757
|
export declare interface PageLayoutProps {
|
|
@@ -727,6 +779,21 @@ export declare interface PageLayoutProps {
|
|
|
727
779
|
style?: CSSProperties;
|
|
728
780
|
}
|
|
729
781
|
|
|
782
|
+
export declare type PaletteName = 'default' | 'brand' | 'indigo' | 'violet' | 'emerald' | 'teal' | 'rose' | 'coral' | 'amber' | 'ocean' | 'slate' | 'sage';
|
|
783
|
+
|
|
784
|
+
export declare const pillShape: ShapePreset;
|
|
785
|
+
|
|
786
|
+
export declare const playfulPreset: DesignPreset;
|
|
787
|
+
|
|
788
|
+
export declare type PresetName = 'modern' | 'enterprise' | 'playful';
|
|
789
|
+
|
|
790
|
+
export declare type PresetProp = PresetName | {
|
|
791
|
+
palette?: PaletteName | ColorPalette;
|
|
792
|
+
shape?: ShapeName | ShapePreset;
|
|
793
|
+
density?: DensityName | DensityPreset;
|
|
794
|
+
shadow?: ShadowName | ShadowPreset;
|
|
795
|
+
};
|
|
796
|
+
|
|
730
797
|
export declare interface PropDescriptor {
|
|
731
798
|
/** Prop name as it appears in the component API */
|
|
732
799
|
name: string;
|
|
@@ -786,7 +853,18 @@ declare interface RadiusTokens {
|
|
|
786
853
|
radiusFull: string;
|
|
787
854
|
}
|
|
788
855
|
|
|
789
|
-
|
|
856
|
+
/**
|
|
857
|
+
* Resolves a `PresetProp` into a flat `Partial<LucentTokens>` that can be
|
|
858
|
+
* spread over the base theme. Palette colors are fully derived via
|
|
859
|
+
* `createTheme()`, so all hover/active/subtle/text variants are included.
|
|
860
|
+
*/
|
|
861
|
+
export declare function resolvePreset(preset: PresetProp, theme: Theme): Partial<LucentTokens>;
|
|
862
|
+
|
|
863
|
+
export declare const rosePalette: ColorPalette;
|
|
864
|
+
|
|
865
|
+
export declare const roundedShape: ShapePreset;
|
|
866
|
+
|
|
867
|
+
export declare function SearchInput({ value, onChange, placeholder, size, results, onResultSelect, isLoading, disabled, id, style, }: SearchInputProps): JSX_2.Element;
|
|
790
868
|
|
|
791
869
|
export declare const SearchInputManifest: ComponentManifest;
|
|
792
870
|
|
|
@@ -794,6 +872,7 @@ export declare interface SearchInputProps {
|
|
|
794
872
|
value: string;
|
|
795
873
|
onChange: (value: string) => void;
|
|
796
874
|
placeholder?: string;
|
|
875
|
+
size?: InputSize;
|
|
797
876
|
results?: SearchResult[];
|
|
798
877
|
onResultSelect?: (result: SearchResult) => void;
|
|
799
878
|
isLoading?: boolean;
|
|
@@ -897,6 +976,14 @@ declare interface SemanticColorTokens {
|
|
|
897
976
|
focusRing: string;
|
|
898
977
|
}
|
|
899
978
|
|
|
979
|
+
export declare type ShadowName = 'flat' | 'subtle' | 'elevated';
|
|
980
|
+
|
|
981
|
+
export declare interface ShadowPreset {
|
|
982
|
+
name: string;
|
|
983
|
+
light: ShadowTokens;
|
|
984
|
+
dark: ShadowTokens;
|
|
985
|
+
}
|
|
986
|
+
|
|
900
987
|
declare interface ShadowTokens {
|
|
901
988
|
shadowNone: string;
|
|
902
989
|
shadowSm: string;
|
|
@@ -905,6 +992,15 @@ declare interface ShadowTokens {
|
|
|
905
992
|
shadowXl: string;
|
|
906
993
|
}
|
|
907
994
|
|
|
995
|
+
export declare type ShapeName = 'sharp' | 'rounded' | 'pill';
|
|
996
|
+
|
|
997
|
+
export declare interface ShapePreset {
|
|
998
|
+
name: string;
|
|
999
|
+
tokens: RadiusTokens;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
export declare const sharpShape: ShapePreset;
|
|
1003
|
+
|
|
908
1004
|
export declare function Skeleton({ variant, width, height, lines, animate, radius, style, }: SkeletonProps): JSX_2.Element;
|
|
909
1005
|
|
|
910
1006
|
export declare const SkeletonManifest: ComponentManifest;
|
|
@@ -955,6 +1051,8 @@ declare interface SpacingTokens {
|
|
|
955
1051
|
space24: string;
|
|
956
1052
|
}
|
|
957
1053
|
|
|
1054
|
+
export declare const spaciousDensity: DensityPreset;
|
|
1055
|
+
|
|
958
1056
|
export declare function Spinner({ size, label, color }: SpinnerProps): JSX_2.Element;
|
|
959
1057
|
|
|
960
1058
|
export declare const SpinnerManifest: ComponentManifest;
|
|
@@ -967,6 +1065,8 @@ export declare interface SpinnerProps {
|
|
|
967
1065
|
|
|
968
1066
|
export declare type SpinnerSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
969
1067
|
|
|
1068
|
+
export declare const subtleShadow: ShadowPreset;
|
|
1069
|
+
|
|
970
1070
|
export declare interface TabItem {
|
|
971
1071
|
value: string;
|
|
972
1072
|
label: ReactNode;
|