@datalayer/primer-addons 1.0.8 → 1.0.9
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/lib/components/overlay/Overlay.js +15 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/theme/DatalayerBrandThemeProvider.d.ts +41 -0
- package/lib/theme/DatalayerBrandThemeProvider.js +32 -0
- package/lib/theme/DatalayerThemeProvider.d.ts +36 -0
- package/lib/theme/DatalayerThemeProvider.js +35 -0
- package/lib/theme/Palette.d.ts +4 -0
- package/lib/theme/Palette.js +10 -0
- package/lib/theme/colors/datalayerColors.d.ts +15 -0
- package/lib/theme/colors/datalayerColors.js +21 -0
- package/lib/theme/colors/index.d.ts +4 -0
- package/lib/theme/colors/index.js +8 -0
- package/lib/theme/colors/lovelyColors.d.ts +15 -0
- package/lib/theme/colors/lovelyColors.js +21 -0
- package/lib/theme/colors/matrixColors.d.ts +20 -0
- package/lib/theme/colors/matrixColors.js +26 -0
- package/lib/theme/colors/spatialColors.d.ts +15 -0
- package/lib/theme/colors/spatialColors.js +21 -0
- package/lib/theme/index.d.ts +11 -0
- package/lib/theme/index.js +15 -0
- package/lib/theme/themes/createThemeCSSVars.d.ts +131 -0
- package/lib/theme/themes/createThemeCSSVars.js +172 -0
- package/lib/theme/themes/datalayerTheme.d.ts +1093 -0
- package/lib/theme/themes/datalayerTheme.js +191 -0
- package/lib/theme/themes/lovelyTheme.d.ts +1093 -0
- package/lib/theme/themes/lovelyTheme.js +190 -0
- package/lib/theme/themes/matrixTheme.d.ts +1093 -0
- package/lib/theme/themes/matrixTheme.js +190 -0
- package/lib/theme/themes/spatialTheme.d.ts +1093 -0
- package/lib/theme/themes/spatialTheme.js +190 -0
- package/lib/theme/themes-brand/index.d.ts +1 -0
- package/lib/theme/themes-brand/index.js +5 -0
- package/lib/theme/themes-brand/spatialBrandTheme.d.ts +16 -0
- package/lib/theme/themes-brand/spatialBrandTheme.js +157 -0
- package/lib/theme/useSystemColorMode.d.ts +9 -0
- package/lib/theme/useSystemColorMode.js +26 -0
- package/package.json +1 -1
|
@@ -12,6 +12,19 @@ const PrimerAddonOverlay = (props) => {
|
|
|
12
12
|
setTop(headingRef?.current?.getBoundingClientRect().bottom ?? 0);
|
|
13
13
|
}, [headingRef]);
|
|
14
14
|
const closeOverlay = () => setIsOpen(false);
|
|
15
|
+
/**
|
|
16
|
+
* Don't close the overlay when the click outside lands on a portaled
|
|
17
|
+
* Dialog (role="dialog"). Primer Dialogs render in a portal at
|
|
18
|
+
* document.body, so they are "outside" the Overlay DOM tree and would
|
|
19
|
+
* otherwise trigger an unwanted close.
|
|
20
|
+
*/
|
|
21
|
+
const handleClickOutside = (e) => {
|
|
22
|
+
if (e.target instanceof HTMLElement &&
|
|
23
|
+
e.target.closest('[role="dialog"]')) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
closeOverlay();
|
|
27
|
+
};
|
|
15
28
|
const overlayContent = (_jsx(ThemeProvider, { theme: theme, colorMode: colorMode, children: _jsx(BaseStyles, { children: _jsxs(Box, { sx: {
|
|
16
29
|
/* We need to remove the padding */
|
|
17
30
|
height: `calc(100vh - ${top}px - 8px)`,
|
|
@@ -28,9 +41,9 @@ const PrimerAddonOverlay = (props) => {
|
|
|
28
41
|
return (closeButtonRef && openButtonRef ?
|
|
29
42
|
_jsx(_Fragment, { children: isOpen ?
|
|
30
43
|
direction === 'left' ?
|
|
31
|
-
_jsx(Box, { sx: { zIndex }, children: _jsx(PrimerOverlay, { initialFocusRef: closeButtonRef, returnFocusRef: openButtonRef, ignoreClickRefs: [openButtonRef], onEscape: closeOverlay, onClickOutside:
|
|
44
|
+
_jsx(Box, { sx: { zIndex }, children: _jsx(PrimerOverlay, { initialFocusRef: closeButtonRef, returnFocusRef: openButtonRef, ignoreClickRefs: [openButtonRef], onEscape: closeOverlay, onClickOutside: handleClickOutside, width: "auto", anchorSide: "inside-right", left: 0, position: "fixed", top: top, children: overlayContent }) })
|
|
32
45
|
:
|
|
33
|
-
_jsx(Box, { sx: { zIndex }, children: _jsx(PrimerOverlay, { initialFocusRef: closeButtonRef, returnFocusRef: openButtonRef, ignoreClickRefs: [openButtonRef], onEscape: closeOverlay, onClickOutside:
|
|
46
|
+
_jsx(Box, { sx: { zIndex }, children: _jsx(PrimerOverlay, { initialFocusRef: closeButtonRef, returnFocusRef: openButtonRef, ignoreClickRefs: [openButtonRef], onEscape: closeOverlay, onClickOutside: handleClickOutside, width: "auto", anchorSide: 'inside-left', right: 0, position: "fixed", top: top, children: overlayContent }) })
|
|
34
47
|
: _jsx(_Fragment, {}) })
|
|
35
48
|
:
|
|
36
49
|
_jsx(_Fragment, {}));
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import type { BrandTheme } from './themes-brand/spatialBrandTheme';
|
|
3
|
+
export type ColorMode = 'light' | 'dark' | 'auto';
|
|
4
|
+
export interface IDatalayerBrandThemeProviderProps {
|
|
5
|
+
/**
|
|
6
|
+
* Color mode to use.
|
|
7
|
+
* - `'light'` / `'dark'` — explicit override
|
|
8
|
+
* - `'auto'` — follow the operating system preference (prefers-color-scheme)
|
|
9
|
+
*/
|
|
10
|
+
colorMode?: ColorMode;
|
|
11
|
+
/**
|
|
12
|
+
* A brand theme object with per-mode CSS variable overrides.
|
|
13
|
+
* Each key (`light` / `dark`) is a `CSSProperties` map whose entries
|
|
14
|
+
* are `--brand-color-*` / `--brand-button-*` custom properties.
|
|
15
|
+
*
|
|
16
|
+
* When omitted, the default Primer Brand tokens are used unchanged.
|
|
17
|
+
*/
|
|
18
|
+
brandTheme?: BrandTheme;
|
|
19
|
+
/**
|
|
20
|
+
* Additional inline styles merged on top of the resolved brand theme.
|
|
21
|
+
*/
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Theme provider for Primer Brand (`@primer/react-brand`) components.
|
|
27
|
+
*
|
|
28
|
+
* Works by passing CSS custom-property overrides as inline `style` to
|
|
29
|
+
* `ThemeProvider`, which scopes them to its DOM subtree — exactly how
|
|
30
|
+
* the VS Code extension re-skins Primer via CSS variables.
|
|
31
|
+
*
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { DatalayerBrandThemeProvider } from '@datalayer/core/lib/theme';
|
|
34
|
+
* import { spatialBrandTheme } from '@datalayer/core/lib/theme/themes-brand/spatialBrandTheme';
|
|
35
|
+
*
|
|
36
|
+
* <DatalayerBrandThemeProvider colorMode="dark" brandTheme={spatialBrandTheme}>
|
|
37
|
+
* <Hero>…</Hero>
|
|
38
|
+
* </DatalayerBrandThemeProvider>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function DatalayerBrandThemeProvider({ colorMode, brandTheme, style, children, }: IDatalayerBrandThemeProviderProps): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ThemeProvider as PrimerBrandThemeProvider } from '@primer/react-brand';
|
|
3
|
+
import { useSystemColorMode } from './useSystemColorMode';
|
|
4
|
+
/**
|
|
5
|
+
* Theme provider for Primer Brand (`@primer/react-brand`) components.
|
|
6
|
+
*
|
|
7
|
+
* Works by passing CSS custom-property overrides as inline `style` to
|
|
8
|
+
* `ThemeProvider`, which scopes them to its DOM subtree — exactly how
|
|
9
|
+
* the VS Code extension re-skins Primer via CSS variables.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { DatalayerBrandThemeProvider } from '@datalayer/core/lib/theme';
|
|
13
|
+
* import { spatialBrandTheme } from '@datalayer/core/lib/theme/themes-brand/spatialBrandTheme';
|
|
14
|
+
*
|
|
15
|
+
* <DatalayerBrandThemeProvider colorMode="dark" brandTheme={spatialBrandTheme}>
|
|
16
|
+
* <Hero>…</Hero>
|
|
17
|
+
* </DatalayerBrandThemeProvider>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export function DatalayerBrandThemeProvider({ colorMode = 'light', brandTheme, style, children, }) {
|
|
21
|
+
const systemMode = useSystemColorMode();
|
|
22
|
+
const resolved = colorMode === 'auto' ? systemMode : colorMode;
|
|
23
|
+
const themeOverrides = brandTheme
|
|
24
|
+
? resolved === 'dark'
|
|
25
|
+
? brandTheme.dark
|
|
26
|
+
: brandTheme.light
|
|
27
|
+
: undefined;
|
|
28
|
+
return (_jsx(PrimerBrandThemeProvider, { colorMode: resolved, style: {
|
|
29
|
+
...themeOverrides,
|
|
30
|
+
...style,
|
|
31
|
+
}, children: children }));
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { ThemeProviderProps } from '@primer/react';
|
|
3
|
+
export interface IDatalayerThemeProviderProps extends Omit<ThemeProviderProps, 'theme' | 'colorMode'> {
|
|
4
|
+
/**
|
|
5
|
+
* Color mode to use.
|
|
6
|
+
* - `'light'` / `'dark'` — explicit override
|
|
7
|
+
* - `'auto'` — follow the operating system preference (prefers-color-scheme)
|
|
8
|
+
* - Primer's `'day'` / `'night'` are still accepted.
|
|
9
|
+
*/
|
|
10
|
+
colorMode?: 'light' | 'dark' | 'auto' | 'day' | 'night';
|
|
11
|
+
/**
|
|
12
|
+
* Additional base styles merged on top of theme defaults.
|
|
13
|
+
*/
|
|
14
|
+
baseStyles?: CSSProperties;
|
|
15
|
+
/**
|
|
16
|
+
* Optional Primer theme object. Defaults to the built-in datalayerTheme
|
|
17
|
+
* (which is the unmodified default Primer theme — all theming is done
|
|
18
|
+
* via CSS custom-property overrides in `themeStyles`).
|
|
19
|
+
*/
|
|
20
|
+
theme?: Record<string, any>;
|
|
21
|
+
/**
|
|
22
|
+
* Per-mode CSS-property overrides (background, foreground, and all
|
|
23
|
+
* Primer functional-token CSS custom properties).
|
|
24
|
+
*
|
|
25
|
+
* When provided, these replace the built-in datalayer styles entirely.
|
|
26
|
+
* The `baseStyles` prop is still merged on top.
|
|
27
|
+
*
|
|
28
|
+
* Use the `buildThemeStyles` helper from `./themes/createThemeCSSVars`
|
|
29
|
+
* to generate comprehensive overrides from a `ThemeColorDefs` pair.
|
|
30
|
+
*/
|
|
31
|
+
themeStyles?: {
|
|
32
|
+
light: CSSProperties;
|
|
33
|
+
dark: CSSProperties;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare function DatalayerThemeProvider(props: React.PropsWithChildren<IDatalayerThemeProviderProps>): JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BaseStyles, ThemeProvider } from '@primer/react';
|
|
3
|
+
import { useSystemColorMode } from './useSystemColorMode';
|
|
4
|
+
import { datalayerTheme, datalayerThemeStyles } from './themes/datalayerTheme';
|
|
5
|
+
/**
|
|
6
|
+
* Shared typographic rhythm — clean, spacious feel inspired by
|
|
7
|
+
* modern developer-blog aesthetics (generous line-height, open
|
|
8
|
+
* letter-spacing on headings, crisp body text).
|
|
9
|
+
*/
|
|
10
|
+
const typographyVars = {
|
|
11
|
+
'--text-body-lineHeight': '1.7',
|
|
12
|
+
'--text-title-lineHeight': '1.2',
|
|
13
|
+
'--text-title-letterSpacing': '-0.02em',
|
|
14
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
|
|
15
|
+
WebkitFontSmoothing: 'antialiased',
|
|
16
|
+
MozOsxFontSmoothing: 'grayscale',
|
|
17
|
+
textRendering: 'optimizeLegibility',
|
|
18
|
+
};
|
|
19
|
+
export function DatalayerThemeProvider(props) {
|
|
20
|
+
const { children, colorMode, baseStyles, theme, themeStyles, ...rest } = props;
|
|
21
|
+
// Resolve 'auto' → actual system preference ('light' or 'dark').
|
|
22
|
+
const systemMode = useSystemColorMode();
|
|
23
|
+
const resolvedColorMode = colorMode === 'auto' ? systemMode : (colorMode ?? 'light');
|
|
24
|
+
const isDark = resolvedColorMode === 'dark' || resolvedColorMode === 'night';
|
|
25
|
+
const resolvedTheme = theme ?? datalayerTheme;
|
|
26
|
+
const styles = themeStyles ?? datalayerThemeStyles;
|
|
27
|
+
const resolvedStyles = isDark ? styles.dark : styles.light;
|
|
28
|
+
return (_jsx(ThemeProvider, { colorMode: resolvedColorMode, theme: resolvedTheme, ...rest, children: _jsx(BaseStyles, { style: {
|
|
29
|
+
lineHeight: '1.7',
|
|
30
|
+
transition: 'background-color 0.25s ease, color 0.25s ease',
|
|
31
|
+
...typographyVars,
|
|
32
|
+
...resolvedStyles,
|
|
33
|
+
...baseStyles,
|
|
34
|
+
}, children: children }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
// export const RESERVATION_CIRCLE_COLOR_VAR = '--data-yellow-color';
|
|
6
|
+
export const RESERVATION_CIRCLE_COLOR = '#656D76';
|
|
7
|
+
// export const CREDITS_CIRCLE_COLOR_VAR = '--data-blue-color';
|
|
8
|
+
export const CREDITS_CIRCLE_COLOR = '#16A085';
|
|
9
|
+
export const JOINED_INVITE_COLOR = '#0366d6';
|
|
10
|
+
export const PENDING_INVITE_COLOR = '#cfd3d7';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Datalayer Accessible Color System
|
|
3
|
+
* Based on Datalayer's brand manual - WCAG AA/AAA compliant
|
|
4
|
+
*/
|
|
5
|
+
export declare const datalayerColors: {
|
|
6
|
+
black: string;
|
|
7
|
+
gray: string;
|
|
8
|
+
white: string;
|
|
9
|
+
greenBrand: string;
|
|
10
|
+
greenAccent: string;
|
|
11
|
+
greenText: string;
|
|
12
|
+
greenTint: string;
|
|
13
|
+
greenBright: string;
|
|
14
|
+
greenHover: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Datalayer Accessible Color System
|
|
7
|
+
* Based on Datalayer's brand manual - WCAG AA/AAA compliant
|
|
8
|
+
*/
|
|
9
|
+
export const datalayerColors = {
|
|
10
|
+
// Core Neutrals
|
|
11
|
+
black: '#000000', // Primary text - AAA on white
|
|
12
|
+
gray: '#59595C', // Secondary text - AA on white
|
|
13
|
+
white: '#FFFFFF', // Background
|
|
14
|
+
// Greens (Brand & Accessibility)
|
|
15
|
+
greenBrand: '#16A085', // Brand accent, icons, dividers, headings
|
|
16
|
+
greenAccent: '#1ABC9C', // Icons, charts, highlights on dark surfaces
|
|
17
|
+
greenText: '#117A65', // Accessible green for text & buttons (AA+ on white)
|
|
18
|
+
greenTint: '#E9F7F1', // Soft background for success / callouts
|
|
19
|
+
greenBright: '#2ECC71', // Highlights and glow on dark backgrounds
|
|
20
|
+
greenHover: '#0E6655', // Primary button hover
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
export { datalayerColors } from './datalayerColors';
|
|
6
|
+
export { spatialColors } from './spatialColors';
|
|
7
|
+
export { lovelyColors } from './lovelyColors';
|
|
8
|
+
export { matrixColors } from './matrixColors';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lovely Color System – Warm & Pink-Inspired
|
|
3
|
+
* Rose, magenta, blush — designed for light-first usage.
|
|
4
|
+
*/
|
|
5
|
+
export declare const lovelyColors: {
|
|
6
|
+
black: string;
|
|
7
|
+
gray: string;
|
|
8
|
+
white: string;
|
|
9
|
+
roseBrand: string;
|
|
10
|
+
roseAccent: string;
|
|
11
|
+
roseText: string;
|
|
12
|
+
roseTint: string;
|
|
13
|
+
roseBright: string;
|
|
14
|
+
roseHover: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Lovely Color System – Warm & Pink-Inspired
|
|
7
|
+
* Rose, magenta, blush — designed for light-first usage.
|
|
8
|
+
*/
|
|
9
|
+
export const lovelyColors = {
|
|
10
|
+
// Core Neutrals
|
|
11
|
+
black: '#1A0A14', // Deep plum — primary dark background
|
|
12
|
+
gray: '#9D7A8F', // Mauve gray — secondary text
|
|
13
|
+
white: '#FFF5F7', // Rose white — primary light background
|
|
14
|
+
// Rose / Pink palette
|
|
15
|
+
roseBrand: '#DB2777', // Core brand — headings, icons, dividers
|
|
16
|
+
roseAccent: '#EC4899', // Charts, highlights on dark surfaces
|
|
17
|
+
roseText: '#9D174D', // Accessible text & buttons on light (AA+)
|
|
18
|
+
roseTint: '#FDF2F8', // Soft background for callouts
|
|
19
|
+
roseBright: '#F472B6', // Highlights & glow on dark
|
|
20
|
+
roseHover: '#831843', // Primary button hover
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matrix Color System – Terminal & Phosphor-Green
|
|
3
|
+
*
|
|
4
|
+
* Inspired by the iconic green-on-black aesthetic of The Matrix.
|
|
5
|
+
* Dark-first, CRT feel. Uses Datalayer brand greens for accessible text
|
|
6
|
+
* and introduces phosphor-green accents for the signature glow.
|
|
7
|
+
*/
|
|
8
|
+
export declare const matrixColors: {
|
|
9
|
+
black: string;
|
|
10
|
+
gray: string;
|
|
11
|
+
white: string;
|
|
12
|
+
greenBrand: string;
|
|
13
|
+
greenAccent: string;
|
|
14
|
+
greenText: string;
|
|
15
|
+
greenTint: string;
|
|
16
|
+
greenPhosphor: string;
|
|
17
|
+
greenGlow: string;
|
|
18
|
+
greenHover: string;
|
|
19
|
+
greenTerminal: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Matrix Color System – Terminal & Phosphor-Green
|
|
7
|
+
*
|
|
8
|
+
* Inspired by the iconic green-on-black aesthetic of The Matrix.
|
|
9
|
+
* Dark-first, CRT feel. Uses Datalayer brand greens for accessible text
|
|
10
|
+
* and introduces phosphor-green accents for the signature glow.
|
|
11
|
+
*/
|
|
12
|
+
export const matrixColors = {
|
|
13
|
+
// Core Neutrals — CRT / terminal aesthetic
|
|
14
|
+
black: '#0D0208', // Matrix void — near-black with faint warm undertone
|
|
15
|
+
gray: '#4A7856', // Dim terminal gray-green — secondary text
|
|
16
|
+
white: '#F0FFF0', // Honeydew — light bg with subtle green cast (CRT paper)
|
|
17
|
+
// Green palette — Datalayer brand greens + Matrix phosphor highlights
|
|
18
|
+
greenBrand: '#16A085', // Datalayer brand — headings, icons, dividers
|
|
19
|
+
greenAccent: '#1ABC9C', // Datalayer accent — icons, charts on dark surfaces
|
|
20
|
+
greenText: '#117A65', // Datalayer text — accessible buttons & text on light (AA+)
|
|
21
|
+
greenTint: '#E8F5E9', // Matrix-tinted soft background for callouts
|
|
22
|
+
greenPhosphor: '#00FF41', // Iconic Matrix falling-code green — dark mode highlights
|
|
23
|
+
greenGlow: '#39FF14', // Neon phosphor glow — brightest accent on dark
|
|
24
|
+
greenHover: '#0E6655', // Datalayer hover — primary button hover
|
|
25
|
+
greenTerminal: '#003B00', // Deep terminal — dark mode subtle/canvas
|
|
26
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spatial Color System – Cosmic & Space-Inspired
|
|
3
|
+
* Deep blues, indigo, nebula purples — designed for dark-first usage.
|
|
4
|
+
*/
|
|
5
|
+
export declare const spatialColors: {
|
|
6
|
+
black: string;
|
|
7
|
+
gray: string;
|
|
8
|
+
white: string;
|
|
9
|
+
indigoBrand: string;
|
|
10
|
+
indigoAccent: string;
|
|
11
|
+
indigoText: string;
|
|
12
|
+
indigoTint: string;
|
|
13
|
+
indigoBright: string;
|
|
14
|
+
indigoHover: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Spatial Color System – Cosmic & Space-Inspired
|
|
7
|
+
* Deep blues, indigo, nebula purples — designed for dark-first usage.
|
|
8
|
+
*/
|
|
9
|
+
export const spatialColors = {
|
|
10
|
+
// Core Neutrals
|
|
11
|
+
black: '#0B1120', // Deep space — primary dark background
|
|
12
|
+
gray: '#8892B0', // Nebula gray — secondary text
|
|
13
|
+
white: '#F8FAFF', // Star white — primary light background
|
|
14
|
+
// Indigo / Cosmic palette
|
|
15
|
+
indigoBrand: '#4F46E5', // Core brand — headings, icons, dividers
|
|
16
|
+
indigoAccent: '#6366F1', // Charts, highlights on dark surfaces
|
|
17
|
+
indigoText: '#3730A3', // Accessible text & buttons on light (AA+)
|
|
18
|
+
indigoTint: '#EEF2FF', // Soft background for callouts
|
|
19
|
+
indigoBright: '#818CF8', // Highlights & glow on dark
|
|
20
|
+
indigoHover: '#312E81', // Primary button hover
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './colors';
|
|
2
|
+
export * from './themes/createThemeCSSVars';
|
|
3
|
+
export * from './themes/datalayerTheme';
|
|
4
|
+
export * from './DatalayerThemeProvider';
|
|
5
|
+
export * from './DatalayerBrandThemeProvider';
|
|
6
|
+
export * from './themes/spatialTheme';
|
|
7
|
+
export * from './themes/lovelyTheme';
|
|
8
|
+
export * from './themes/matrixTheme';
|
|
9
|
+
export * from './themes-brand/spatialBrandTheme';
|
|
10
|
+
export * from './Palette';
|
|
11
|
+
export * from './useSystemColorMode';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
export * from './colors';
|
|
6
|
+
export * from './themes/createThemeCSSVars';
|
|
7
|
+
export * from './themes/datalayerTheme';
|
|
8
|
+
export * from './DatalayerThemeProvider';
|
|
9
|
+
export * from './DatalayerBrandThemeProvider';
|
|
10
|
+
export * from './themes/spatialTheme';
|
|
11
|
+
export * from './themes/lovelyTheme';
|
|
12
|
+
export * from './themes/matrixTheme';
|
|
13
|
+
export * from './themes-brand/spatialBrandTheme';
|
|
14
|
+
export * from './Palette';
|
|
15
|
+
export * from './useSystemColorMode';
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Structured colour definitions that mirror the *old* Primer
|
|
4
|
+
* `colorSchemes.*.colors` shape. Each theme file provides one of
|
|
5
|
+
* these for light mode and one for dark mode.
|
|
6
|
+
*
|
|
7
|
+
* The {@link colorDefsToCSS} helper converts them into a flat
|
|
8
|
+
* `CSSProperties` bag of Primer CSS custom-property overrides so
|
|
9
|
+
* the `<DatalayerThemeProvider>` can apply them via
|
|
10
|
+
* `<BaseStyles style={…}>`.
|
|
11
|
+
*/
|
|
12
|
+
export interface ThemeColorDefs {
|
|
13
|
+
canvas: {
|
|
14
|
+
default: string;
|
|
15
|
+
subtle?: string;
|
|
16
|
+
};
|
|
17
|
+
fg: {
|
|
18
|
+
default: string;
|
|
19
|
+
muted: string;
|
|
20
|
+
onEmphasis: string;
|
|
21
|
+
};
|
|
22
|
+
accent: {
|
|
23
|
+
fg: string;
|
|
24
|
+
emphasis: string;
|
|
25
|
+
muted: string;
|
|
26
|
+
subtle?: string;
|
|
27
|
+
};
|
|
28
|
+
success: {
|
|
29
|
+
fg: string;
|
|
30
|
+
emphasis: string;
|
|
31
|
+
muted: string;
|
|
32
|
+
subtle?: string;
|
|
33
|
+
};
|
|
34
|
+
btn: {
|
|
35
|
+
text: string;
|
|
36
|
+
bg: string;
|
|
37
|
+
border: string;
|
|
38
|
+
hoverBg: string;
|
|
39
|
+
hoverBorder: string;
|
|
40
|
+
activeBg: string;
|
|
41
|
+
activeBorder: string;
|
|
42
|
+
selectedBg: string;
|
|
43
|
+
counterBg: string;
|
|
44
|
+
primary: {
|
|
45
|
+
text: string;
|
|
46
|
+
bg: string;
|
|
47
|
+
border: string;
|
|
48
|
+
hoverBg: string;
|
|
49
|
+
hoverBorder: string;
|
|
50
|
+
selectedBg: string;
|
|
51
|
+
disabledText: string;
|
|
52
|
+
disabledBg: string;
|
|
53
|
+
disabledBorder: string;
|
|
54
|
+
icon: string;
|
|
55
|
+
counterBg: string;
|
|
56
|
+
};
|
|
57
|
+
outline: {
|
|
58
|
+
text: string;
|
|
59
|
+
hoverText: string;
|
|
60
|
+
hoverBg: string;
|
|
61
|
+
hoverBorder: string;
|
|
62
|
+
hoverCounterBg: string;
|
|
63
|
+
selectedText: string;
|
|
64
|
+
selectedBg: string;
|
|
65
|
+
selectedBorder: string;
|
|
66
|
+
disabledText: string;
|
|
67
|
+
disabledBg: string;
|
|
68
|
+
disabledCounterBg: string;
|
|
69
|
+
counterBg: string;
|
|
70
|
+
counterFg: string;
|
|
71
|
+
hoverCounterFg: string;
|
|
72
|
+
disabledCounterFg: string;
|
|
73
|
+
};
|
|
74
|
+
danger: {
|
|
75
|
+
text: string;
|
|
76
|
+
hoverText: string;
|
|
77
|
+
hoverBg: string;
|
|
78
|
+
hoverBorder: string;
|
|
79
|
+
hoverCounterBg: string;
|
|
80
|
+
selectedText: string;
|
|
81
|
+
selectedBg: string;
|
|
82
|
+
selectedBorder: string;
|
|
83
|
+
disabledText: string;
|
|
84
|
+
disabledBg: string;
|
|
85
|
+
disabledCounterBg: string;
|
|
86
|
+
counterBg: string;
|
|
87
|
+
counterFg: string;
|
|
88
|
+
hoverCounterFg: string;
|
|
89
|
+
disabledCounterFg: string;
|
|
90
|
+
icon: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Convert a structured `ThemeColorDefs` object into a flat
|
|
96
|
+
* `CSSProperties` bag of Primer React CSS custom-property overrides.
|
|
97
|
+
*
|
|
98
|
+
* These variables are the *functional tokens* consumed by Primer
|
|
99
|
+
* React components (sourced from `@primer/primitives`). Setting
|
|
100
|
+
* them on a parent element is enough to retheme every Primer
|
|
101
|
+
* component in the sub-tree.
|
|
102
|
+
*
|
|
103
|
+
* ### Variable families covered
|
|
104
|
+
*
|
|
105
|
+
* | Family | Example variable |
|
|
106
|
+
* |------------------|----------------------------------------|
|
|
107
|
+
* | Background | `--bgColor-default` |
|
|
108
|
+
* | Foreground | `--fgColor-default` |
|
|
109
|
+
* | Border | `--borderColor-default` |
|
|
110
|
+
* | Link | `--fgColor-link` |
|
|
111
|
+
* | Accent / Success | `--bgColor-accent-emphasis` |
|
|
112
|
+
* | Default button | `--button-default-bgColor-rest` |
|
|
113
|
+
* | Primary button | `--button-primary-bgColor-rest` |
|
|
114
|
+
* | Outline button | `--button-outline-fgColor-rest` |
|
|
115
|
+
* | Danger button | `--button-danger-bgColor-hover` |
|
|
116
|
+
* | Button counters | `--buttonCounter-primary-bgColor-rest` |
|
|
117
|
+
* | Legacy aliases | `--color-btn-primary-bg` |
|
|
118
|
+
* | Brand (custom) | `--brand-color-canvas-default` |
|
|
119
|
+
*/
|
|
120
|
+
export declare function colorDefsToCSS(defs: ThemeColorDefs): CSSProperties;
|
|
121
|
+
/** Light + dark CSS-property pairs for the `themeStyles` prop. */
|
|
122
|
+
export interface ThemeStyles {
|
|
123
|
+
light: CSSProperties;
|
|
124
|
+
dark: CSSProperties;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Build a complete `ThemeStyles` object from light / dark
|
|
128
|
+
* `ThemeColorDefs`. The result is ready to pass straight to
|
|
129
|
+
* `<DatalayerThemeProvider themeStyles={…}>`.
|
|
130
|
+
*/
|
|
131
|
+
export declare function buildThemeStyles(light: ThemeColorDefs, dark: ThemeColorDefs): ThemeStyles;
|