@openfin/ui-library 0.23.11 → 0.23.12-alpha.1708023891

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.
@@ -3,8 +3,4 @@ export declare const Fonts: {
3
3
  italic: any;
4
4
  semiBold: any;
5
5
  semiBoldItalic: any;
6
- hanSansJapanese: any;
7
- hanSansKorean: any;
8
- hanSansChineseSimplified: any;
9
- hanSansChineseTraditional: any;
10
6
  };
@@ -150,12 +150,10 @@ export declare const Shadow: {
150
150
  base: string;
151
151
  };
152
152
  /**
153
- * FontStack --
154
153
  * Design System uses "Inter" and we include @font-face definitions to load a CDN hosted version of the font
155
154
  * The rest of the stack includes reasonable fallbacks for contingency cases where the CDN asset fails to load
156
155
  */
157
- export declare const FontStack: "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif";
158
- export declare const LocalizedFontStack: "HanSansJapanese, HanSansKorean, HanSansChineseSimplified, HanSansChineseTraditional";
156
+ export declare const FontFamily: string;
159
157
  /**
160
158
  * FontSize --
161
159
  * Design System font sizes using standard scale
@@ -188,16 +186,6 @@ export declare const LineHeight: {
188
186
  readonly heading: 1.2;
189
187
  readonly text: 1.5;
190
188
  };
191
- /**
192
- * Typography --
193
- * Design System typography is a full set of values for a `font:...` property.
194
- * @example "12px/16px Inter, ..."
195
- * @example "20px/24px Inter, ..."
196
- */
197
- export declare const Typography: {
198
- readonly base: "12px/1.5 Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif";
199
- readonly localize: "12px/1.5 HanSansJapanese, HanSansKorean, HanSansChineseSimplified, HanSansChineseTraditional";
200
- };
201
189
  /**
202
190
  * Transitions --
203
191
  * Design System transition easings because UI motion feels better if everything moves the same way.
@@ -212,8 +200,6 @@ export declare const Transition: {
212
200
  * @link https://icons.modulz.app/
213
201
  * @link https://github.com/radix-ui/icons
214
202
  *
215
-
216
-
217
203
  * This exposes them as a named set through OpenFin UI Library
218
204
  */
219
205
  export declare const IconSet: {
@@ -544,9 +530,3 @@ export declare const IconSize: {
544
530
  readonly xxlarge: "32px";
545
531
  readonly xxxlarge: "48px";
546
532
  };
547
- /**
548
- * @font-face --
549
- * Generate @font-face CSS for CDN Loaded fonts
550
- */
551
- export declare const cdnFontFaceCss: import("styled-components").FlattenSimpleInterpolation;
552
- export declare const cdnLocalizedFontFaceCss: import("styled-components").FlattenSimpleInterpolation;
@@ -4,10 +4,6 @@ export interface ImportFonts {
4
4
  italic?: string;
5
5
  semiBold?: string;
6
6
  semiBoldItalic?: string;
7
- hanSansJapanese?: string;
8
- hanSansKorean?: string;
9
- hanSansChineseSimplified?: string;
10
- hanSansChineseTraditional?: string;
11
7
  }
12
8
  /**
13
9
  * Import global fonts using your own config.
@@ -1,10 +1,9 @@
1
- import { DefaultTheme } from 'styled-components';
2
1
  import { PaletteType } from '../lib/types';
2
+ import { DefaultTheme } from 'styled-components';
3
3
  /**
4
4
  * Create a theme by accepting an incomplete theme object and deriving the remaining colors based on button colors.
5
5
  *
6
6
  * @param {Partial<PaletteType>} palettePartial The provided theme keys, whether we or the end user defined them.
7
- * @param {string} schemeName The name of the scheme to use. Defaults to 'dark'.
8
7
  * @returns {DefaultTheme}
9
8
  */
10
- export declare const createTheme: (palettePartial: Partial<PaletteType>, schemeName?: 'light' | 'dark') => DefaultTheme;
9
+ export declare const createTheme: (palettePartial: Partial<PaletteType>) => DefaultTheme;
@@ -20,19 +20,16 @@ export declare const getRootCssVars: ({ theme }: {
20
20
  theme: DefaultTheme;
21
21
  }) => string;
22
22
  /**
23
- * Lazy Load font-faces based on Theme Configuration
23
+ * Retrive the correct palette value based on the provided status type.
24
+ * Falls back to optionally provided palette key, then to 'inherit'.
24
25
  */
25
- export declare const getFontFaces: ({ theme }: {
26
- theme: DefaultTheme;
27
- }) => import("styled-components").FlattenSimpleInterpolation;
26
+ export declare const getStatusColor: (theme: DefaultTheme, status?: StatusType, defaultKey?: keyof typeof Palette) => string;
28
27
  /**
29
- * Lazy Load Localized font-faces based on Theme Configuration
28
+ * A list of languages supported by the OpenFin UI.
30
29
  */
31
- export declare const getLocalizedFontFaces: ({ theme }: {
32
- theme: DefaultTheme;
33
- }) => import("styled-components").FlattenSimpleInterpolation;
30
+ export declare const SUPPORTED_LANGUAGES: readonly ["en-US", "ja-JP", "zh-CN", "ko-KR", "ru-RU", "de-DE", "zh-Hant"];
34
31
  /**
35
- * Retrive the correct palette value based on the provided status type.
36
- * Falls back to optionally provided palette key, then to 'inherit'.
32
+ * The type of the supported languages.
33
+ * @link supportedLanguages
37
34
  */
38
- export declare const getStatusColor: (theme: DefaultTheme, status?: StatusType, defaultKey?: keyof typeof Palette) => string;
35
+ export type Languages = typeof SUPPORTED_LANGUAGES[number];
@@ -1,5 +1,4 @@
1
1
  export * from './colors';
2
- export * from './config';
3
2
  export * from './constants';
4
3
  export * from './createFontFaceCss';
5
4
  export * from './createTheme';
@@ -1,5 +1,4 @@
1
- import { Color, FontSize, FontWeight, IconSize, LineHeight, Radius, Shadow, Transition, Unit, UnitPx } from './constants';
2
- import { ConfigurationType } from './config';
1
+ import { FontFamily, FontSize, FontWeight, IconSize, LineHeight, Radius, Shadow, Transition, Unit, UnitPx } from './constants';
3
2
  import { Palette } from './palette';
4
3
  declare module 'styled-components' {
5
4
  interface DefaultTheme {
@@ -9,8 +8,7 @@ declare module 'styled-components' {
9
8
  * - Provides some validation when providing an external theme
10
9
  * - Enables auto-completion in styled components.
11
10
  */
12
- _config: ConfigurationType;
13
- _color: typeof Color;
11
+ fontFamily: typeof FontFamily;
14
12
  fontSize: typeof FontSize;
15
13
  fontWeight: typeof FontWeight;
16
14
  lineHeight: typeof LineHeight;
@@ -21,6 +19,5 @@ declare module 'styled-components' {
21
19
  unit: typeof Unit;
22
20
  px: typeof UnitPx;
23
21
  palette: Record<keyof typeof Palette, string>;
24
- selectedScheme: 'light' | 'dark';
25
22
  }
26
23
  }
@@ -1,9 +1,8 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
- import { Color, FontSize, FontStack, FontWeight, IconSet, IconSize, LineHeight, Radius, Shadow, Size, Transition, Typography, Unit, UnitPx } from './constants';
2
+ import { FontFamily, FontSize, FontWeight, IconSet, IconSize, LineHeight, Radius, Shadow, Size, Transition, Unit, UnitPx } from './constants';
3
3
  import { Palette } from './palette';
4
- export type ColorType = keyof typeof Color;
4
+ export type FontFamilyType = keyof typeof FontFamily;
5
5
  export type FontSizeType = keyof typeof FontSize;
6
- export type FontStackType = keyof typeof FontStack;
7
6
  export type FontWeightType = keyof typeof FontWeight;
8
7
  export type IconSizeType = keyof typeof IconSize;
9
8
  export type IconType = keyof typeof IconSet;
@@ -12,7 +11,6 @@ export type RadiusType = keyof typeof Radius;
12
11
  export type ShadowType = keyof typeof Shadow;
13
12
  export type SizeType = keyof typeof Size;
14
13
  export type TransitionType = keyof typeof Transition;
15
- export type TypographyType = keyof typeof Typography;
16
14
  export type UnitPxType = keyof typeof UnitPx;
17
15
  export type UnitType = keyof typeof Unit;
18
16
  export type ThemeSet = {
@@ -21,14 +19,6 @@ export type ThemeSet = {
21
19
  };
22
20
  export type PaletteKeyType = keyof typeof Palette;
23
21
  export type PaletteType = Record<keyof typeof Palette, string>;
24
- export type ThemePaletteSet = {
25
- light: {
26
- palette: PaletteType;
27
- };
28
- dark: {
29
- palette: PaletteType;
30
- };
31
- };
32
22
  /**
33
23
  * # Utility Types
34
24
  * ========================================================
@@ -1,13 +1,10 @@
1
- import { FC, ReactNode } from 'react';
2
- import { ColorScheme } from '../../../hooks/useColorScheme';
3
- import { ConfigurationType } from './lib/config';
4
- import { ThemePaletteSet } from './lib/types';
1
+ import { FC } from 'react';
2
+ import { ColorSchemeType } from '../../../hooks/useColorScheme';
3
+ import { ThemeSet } from './lib/types';
4
+ import { DeepPartial } from '../../../types';
5
5
  export type ThemeProviderProps = {
6
- children: ReactNode;
7
- themes?: ThemePaletteSet;
8
- scheme?: keyof typeof ColorScheme;
9
- config?: ConfigurationType;
10
- includeGlobalStyles?: false;
6
+ themes?: DeepPartial<ThemeSet>;
7
+ scheme?: ColorSchemeType;
11
8
  };
12
9
  /**
13
10
  * ## OpenFin ThemeProvider
@@ -5,8 +5,15 @@ export declare const ColorScheme: {
5
5
  };
6
6
  export type ColorSchemeType = keyof typeof ColorScheme;
7
7
  type UseColorSchemeProps = {
8
- requestedScheme?: ColorSchemeType;
8
+ colorScheme?: ColorSchemeType;
9
9
  fallbackScheme?: Exclude<ColorSchemeType, 'system'>;
10
10
  };
11
- export declare const useColorScheme: ({ requestedScheme, fallbackScheme, }: UseColorSchemeProps) => "dark" | "light";
11
+ /**
12
+ * Hook to get the current color scheme.
13
+ *
14
+ * @param colorScheme
15
+ * @param fallbackScheme
16
+ * @returns the current color scheme
17
+ */
18
+ export declare const useColorScheme: ({ colorScheme, fallbackScheme, }: UseColorSchemeProps) => Exclude<ColorSchemeType, 'system'>;
12
19
  export {};
@@ -1,10 +1,8 @@
1
- import { ConfigurationType } from './../components/system/ThemeProvider/lib/config';
2
1
  import { DefaultTheme } from 'styled-components';
3
2
  import { ColorScheme } from '../hooks/useColorScheme';
4
- import { ThemePaletteSet } from '../components/system/ThemeProvider';
3
+ import { ThemeSet } from '../components/system/ThemeProvider';
5
4
  import type { DeepPartial } from '../types';
6
- export declare const useTheme: ({ themes, scheme, config, }: {
7
- themes?: DeepPartial<ThemePaletteSet> | undefined;
5
+ export declare const useTheme: ({ themes, scheme, }: {
6
+ themes?: DeepPartial<ThemeSet> | undefined;
8
7
  scheme?: "dark" | "light" | "system" | undefined;
9
- config?: ConfigurationType | undefined;
10
8
  }) => DefaultTheme;