baseui 0.0.0-next-0494f3c → 0.0.0-next-79ec2e2

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.
@@ -285,7 +285,7 @@ class Select extends React.Component {
285
285
  switch (event.keyCode) {
286
286
  case 8:
287
287
  // backspace
288
- if (!this.state.inputValue && this.props.backspaceRemoves) {
288
+ if (!this.state.inputValue && this.props.clearable && this.props.backspaceRemoves) {
289
289
  event.preventDefault();
290
290
  this.backspaceValue();
291
291
  }
@@ -6,4 +6,4 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  export { default as colors } from './colors';
8
8
  export * from './types';
9
- /** @deprecated use ColorTokens instead. To be removed in future versions.*/
9
+ /** @deprecated use PrimitiveColorTokens instead. To be removed in future versions.*/
@@ -361,7 +361,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
361
361
  switch (event.keyCode) {
362
362
  case 8:
363
363
  // backspace
364
- if (!_this.state.inputValue && _this.props.backspaceRemoves) {
364
+ if (!_this.state.inputValue && _this.props.clearable && _this.props.backspaceRemoves) {
365
365
  event.preventDefault();
366
366
 
367
367
  _this.backspaceValue();
@@ -6,4 +6,4 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  export { default as colors } from './colors';
8
8
  export * from './types';
9
- /** @deprecated use ColorTokens instead. To be removed in future versions.*/
9
+ /** @deprecated use PrimitiveColorTokens instead. To be removed in future versions.*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseui",
3
- "version": "0.0.0-next-0494f3c",
3
+ "version": "0.0.0-next-79ec2e2",
4
4
  "description": "A React Component library implementing the Base design language",
5
5
  "keywords": [
6
6
  "react",
@@ -382,7 +382,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
382
382
  switch (event.keyCode) {
383
383
  case 8:
384
384
  // backspace
385
- if (!_this.state.inputValue && _this.props.backspaceRemoves) {
385
+ if (!_this.state.inputValue && _this.props.clearable && _this.props.backspaceRemoves) {
386
386
  event.preventDefault();
387
387
 
388
388
  _this.backspaceValue();
package/styles/types.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type { IconProps } from '../icon';
3
- import type { ColorTokens, ComponentColorTokens, SemanticColorTokens, Animation, Breakpoints, Border, Borders, Font, Grid, Lighting, MediaQuery, Sizing, Typography, ZIndex } from '../themes';
4
- import type { ColorTokens as PrimitiveColorTokens } from '../tokens';
3
+ import type { FoundationColorTokens, ComponentColorTokens, SemanticColorTokens, Animation, Breakpoints, Border, Borders, Font, Grid, Lighting, MediaQuery, Sizing, Typography, ZIndex } from '../themes';
4
+ import type { PrimitiveColorTokens } from '../tokens';
5
5
  export type { Animation, Breakpoints, Border, Borders, Font, Grid, Lighting, MediaQuery, Sizing, Typography, ZIndex, };
6
- export type Colors = {} & PrimitiveColorTokens & ColorTokens & ComponentColorTokens & SemanticColorTokens;
6
+ export type ColorTokens = {} & PrimitiveColorTokens & FoundationColorTokens & ComponentColorTokens & SemanticColorTokens;
7
7
  export type Theme = {
8
8
  name: string;
9
9
  animation: Animation;
10
10
  borders: Borders;
11
11
  breakpoints: Breakpoints;
12
- colors: Colors;
12
+ colors: ColorTokens;
13
13
  direction: 'auto' | 'rtl' | 'ltr';
14
14
  grid: Grid;
15
15
  icons?: Icon;
@@ -9,7 +9,7 @@ import type { ComponentType } from 'react';
9
9
  import type { IconPropsT } from '../icon/types.js';
10
10
 
11
11
  import type {
12
- ColorTokensT,
12
+ FoundationColorTokensT,
13
13
  ComponentColorTokensT,
14
14
  SemanticColorTokensT,
15
15
  AnimationT,
@@ -24,7 +24,7 @@ import type {
24
24
  TypographyT,
25
25
  ZIndexT,
26
26
  } from '../themes/types.js';
27
- import type { ColorTokensT as PrimitiveColorTokensT } from '../tokens/types.js';
27
+ import type { PrimitiveColorTokensT } from '../tokens/types.js';
28
28
 
29
29
  export type {
30
30
  AnimationT,
@@ -41,9 +41,9 @@ export type {
41
41
  };
42
42
 
43
43
  // $FlowFixMe[cannot-spread-inexact]
44
- export type ColorsT = {
44
+ export type ColorTokensT = {
45
45
  ...PrimitiveColorTokensT,
46
- ...ColorTokensT,
46
+ ...FoundationColorTokensT,
47
47
  ...ComponentColorTokensT,
48
48
  ...SemanticColorTokensT,
49
49
  };
@@ -53,7 +53,7 @@ export type ThemeT = {|
53
53
  animation: AnimationT,
54
54
  borders: BordersT,
55
55
  breakpoints: BreakpointsT,
56
- colors: ColorsT,
56
+ colors: ColorTokensT,
57
57
  direction: 'auto' | 'rtl' | 'ltr',
58
58
  grid: GridT,
59
59
  icons?: IconT,
@@ -1,3 +1,3 @@
1
- import type { ColorTokens, ComponentColorTokens } from '../types';
2
- declare const _default: (themePrimitives?: ColorTokens) => ComponentColorTokens;
1
+ import type { FoundationColorTokens, ComponentColorTokens } from '../types';
2
+ declare const _default: (themePrimitives?: FoundationColorTokens) => ComponentColorTokens;
3
3
  export default _default;
@@ -6,7 +6,7 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
8
  import defaultFoundationColorTokens from './color-tokens.js';
9
- import type { ColorTokensT, ComponentColorTokensT } from '../types.js';
9
+ import type { FoundationColorTokensT, ComponentColorTokensT } from '../types.js';
10
10
 
11
11
  const tagHoverBackground = `rgba(255, 255, 255, 0.2)`;
12
12
 
@@ -16,7 +16,7 @@ const tagHoverBackground = `rgba(255, 255, 255, 0.2)`;
16
16
  // Due to the legacy `createTheme` type the values
17
17
  // need to be overrideable through primitives
18
18
  export default (
19
- themePrimitives: ColorTokensT = defaultFoundationColorTokens
19
+ themePrimitives: FoundationColorTokensT = defaultFoundationColorTokens
20
20
  ): ComponentColorTokensT => ({
21
21
  bannerActionLowInfo: themePrimitives.accent600,
22
22
  bannerActionLowNegative: themePrimitives.negative600,
@@ -1,3 +1,3 @@
1
- import type { ColorTokens, SemanticColorTokens } from '../types';
2
- declare const _default: (foundation?: ColorTokens) => SemanticColorTokens;
1
+ import type { FoundationColorTokens, SemanticColorTokens } from '../types';
2
+ declare const _default: (foundation?: FoundationColorTokens) => SemanticColorTokens;
3
3
  export default _default;
@@ -6,7 +6,7 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
8
  import type {
9
- ColorTokensT,
9
+ FoundationColorTokensT,
10
10
  CoreSemanticColorTokensT,
11
11
  CoreExtensionSemanticColorTokensT,
12
12
  DeprecatedSemanticColorTokensT,
@@ -18,7 +18,7 @@ import colors from '../../tokens/colors.js';
18
18
 
19
19
  export default (
20
20
  // themePrimitives or foundation colors
21
- foundation: ColorTokensT = defaultFoundationColorTokens
21
+ foundation: FoundationColorTokensT = defaultFoundationColorTokens
22
22
  ): SemanticColorTokensT => {
23
23
  const core: CoreSemanticColorTokensT = {
24
24
  // Background
@@ -1,3 +1,3 @@
1
- import type { ColorTokens } from '../types';
2
- export declare const darkColorTokens: ColorTokens;
1
+ import type { FoundationColorTokens } from '../types';
2
+ export declare const darkColorTokens: FoundationColorTokens;
3
3
  export default darkColorTokens;
@@ -6,10 +6,10 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
8
  import { colors } from '../../tokens/index.js';
9
- import type { ColorTokensT } from '../types.js';
9
+ import type { FoundationColorTokensT } from '../types.js';
10
10
 
11
11
  // color constants
12
- export const darkColorTokens: ColorTokensT = {
12
+ export const darkColorTokens: FoundationColorTokensT = {
13
13
  // Primary Palette
14
14
  primaryA: colors.gray200,
15
15
  primaryB: colors.gray900,
@@ -20,7 +20,7 @@ import lighting from '../shared/lighting.js';
20
20
  import mediaQuery from '../shared/media-query.js';
21
21
  import sizing from '../shared/sizing.js';
22
22
 
23
- import type { PrimitivesT, ColorTokensT } from '../types.js';
23
+ import type { PrimitivesT, FoundationColorTokensT } from '../types.js';
24
24
  import type { ThemeT } from '../../styles/types.js';
25
25
 
26
26
  export default function createDarkTheme(
@@ -32,7 +32,7 @@ export default function createDarkTheme(
32
32
  // Extract font tokens and color tokens from primitives
33
33
  const { primaryFontFamily, ...customFoundationColorTokens } = primitives;
34
34
  // Assemble color tokens by overriding defaults with custom color tokens
35
- const foundationColorTokens: ColorTokensT = {
35
+ const foundationColorTokens: FoundationColorTokensT = {
36
36
  ...defaultFoundationColorTokens,
37
37
  ...customFoundationColorTokens,
38
38
  };
package/themes/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import createLightTheme from './light-theme/create-light-theme';
7
7
  import darkThemePrimitives from './dark-theme/primitives';
8
8
  import lightThemePrimitives from './light-theme/primitives';
9
9
  import type { Primitives } from './types';
10
- import type { Colors as StyleColors } from '../styles';
10
+ import type { ColorTokens as StyleColors } from '../styles';
11
11
  export { createDarkTheme, createLightTheme, createLightTheme as createTheme, LightTheme, LightThemeMove, lightThemePrimitives, DarkTheme, DarkThemeMove, darkThemePrimitives, DarkTheme as darkThemeOverrides, };
12
12
  export * from './types';
13
13
  /** @deprecated use ColorTokens instead. To be removed in future versions.*/
@@ -1,3 +1,3 @@
1
- import type { ColorTokens, ComponentColorTokens } from '../types';
2
- declare const _default: (themePrimitives?: ColorTokens) => ComponentColorTokens;
1
+ import type { FoundationColorTokens, ComponentColorTokens } from '../types';
2
+ declare const _default: (themePrimitives?: FoundationColorTokens) => ComponentColorTokens;
3
3
  export default _default;
@@ -6,7 +6,7 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
8
  import defaultFoundationColorTokens from './color-tokens.js';
9
- import type { ColorTokensT, ComponentColorTokensT } from '../types.js';
9
+ import type { FoundationColorTokensT, ComponentColorTokensT } from '../types.js';
10
10
 
11
11
  const tagHoverBackground = `rgba(0, 0, 0, 0.08)`;
12
12
 
@@ -16,7 +16,7 @@ const tagHoverBackground = `rgba(0, 0, 0, 0.08)`;
16
16
  // Due to the legacy `createTheme` type the value need to be
17
17
  // overrideable through primitives (`foundation` )
18
18
  export default (
19
- themePrimitives: ColorTokensT = defaultFoundationColorTokens
19
+ themePrimitives: FoundationColorTokensT = defaultFoundationColorTokens
20
20
  ): ComponentColorTokensT => ({
21
21
  bannerActionLowInfo: themePrimitives.accent100,
22
22
  bannerActionLowNegative: themePrimitives.negative100,
@@ -1,3 +1,3 @@
1
- import type { ColorTokens, SemanticColorTokens } from '../types';
2
- declare const _default: (foundation?: ColorTokens) => SemanticColorTokens;
1
+ import type { FoundationColorTokens, SemanticColorTokens } from '../types';
2
+ declare const _default: (foundation?: FoundationColorTokens) => SemanticColorTokens;
3
3
  export default _default;
@@ -6,7 +6,7 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
8
  import type {
9
- ColorTokensT,
9
+ FoundationColorTokensT,
10
10
  CoreSemanticColorTokensT,
11
11
  CoreExtensionSemanticColorTokensT,
12
12
  DeprecatedSemanticColorTokensT,
@@ -18,7 +18,7 @@ import colors from '../../tokens/colors.js';
18
18
 
19
19
  export default (
20
20
  // themePrimitives or foundation colors
21
- foundation: ColorTokensT = defaultFoundationColorTokens
21
+ foundation: FoundationColorTokensT = defaultFoundationColorTokens
22
22
  ): SemanticColorTokensT => {
23
23
  const core: CoreSemanticColorTokensT = {
24
24
  // Background
@@ -1,3 +1,3 @@
1
- import type { ColorTokens } from '../types';
2
- declare const lightColorTokens: ColorTokens;
1
+ import type { FoundationColorTokens } from '../types';
2
+ declare const lightColorTokens: FoundationColorTokens;
3
3
  export default lightColorTokens;
@@ -6,10 +6,10 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
8
  import { colors } from '../../tokens/index.js';
9
- import type { ColorTokensT } from '../types.js';
9
+ import type { FoundationColorTokensT } from '../types.js';
10
10
 
11
11
  // color constants
12
- const lightColorTokens: ColorTokensT = {
12
+ const lightColorTokens: FoundationColorTokensT = {
13
13
  // Primary Palette
14
14
  primaryA: colors.black,
15
15
  primaryB: colors.white,
@@ -20,7 +20,7 @@ import lighting from '../shared/lighting.js';
20
20
  import mediaQuery from '../shared/media-query.js';
21
21
  import sizing from '../shared/sizing.js';
22
22
 
23
- import type { PrimitivesT, ColorTokensT } from '../types.js';
23
+ import type { PrimitivesT, FoundationColorTokensT } from '../types.js';
24
24
  import type { ThemeT } from '../../styles/types.js';
25
25
 
26
26
  export default function createLightTheme(
@@ -32,7 +32,7 @@ export default function createLightTheme(
32
32
  // Extract font tokens and color tokens from primitives
33
33
  const { primaryFontFamily, ...customFoundationColorTokens } = primitives;
34
34
  // Assemble color tokens by overriding defaults with custom color tokens
35
- const colorFoundationTokens: ColorTokensT = {
35
+ const foundationColorTokens: FoundationColorTokensT = {
36
36
  ...defaultFoundationColorTokens,
37
37
  ...customFoundationColorTokens,
38
38
  };
@@ -43,9 +43,9 @@ export default function createLightTheme(
43
43
  // $FlowFixMe[cannot-spread-inexact]
44
44
  colors: {
45
45
  ...primitiveColorTokens,
46
- ...colorFoundationTokens,
47
- ...getComponentColorTokens(colorFoundationTokens),
48
- ...getSemanticColorTokens(colorFoundationTokens),
46
+ ...foundationColorTokens,
47
+ ...getComponentColorTokens(foundationColorTokens),
48
+ ...getSemanticColorTokens(foundationColorTokens),
49
49
  },
50
50
  direction: 'auto',
51
51
  grid,
package/themes/types.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { Properties } from 'csstype';
2
2
  import type { Responsive, CSSLengthUnit } from '../layout-grid';
3
3
  export type Globals = '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'unset';
4
4
  export type LineStyle = 'dashed' | 'dotted' | 'double' | 'groove' | 'hidden' | 'inset' | 'none' | 'outset' | 'ridge' | 'solid';
5
- export type ColorTokens = {
5
+ export type FoundationColorTokens = {
6
6
  primaryA: string;
7
7
  primaryB: string;
8
8
  primary: string;
@@ -429,7 +429,7 @@ export type ComponentColorTokens = {
429
429
  export type FontTokens = {
430
430
  primaryFontFamily: string;
431
431
  };
432
- export type Primitives = {} & ColorTokens & FontTokens;
432
+ export type Primitives = {} & FoundationColorTokens & FontTokens;
433
433
  export type Font = {
434
434
  fontFamily: string;
435
435
  fontWeight: Globals | 'bold' | 'normal' | 'bolder' | 'lighter' | number;
@@ -21,7 +21,7 @@ export type LineStyle =
21
21
  | 'ridge'
22
22
  | 'solid';
23
23
 
24
- export type ColorTokensT = {
24
+ export type FoundationColorTokensT = {
25
25
  // Primary Palette
26
26
  primaryA: string,
27
27
  primaryB: string,
@@ -535,7 +535,7 @@ export type FontTokensT = {|
535
535
 
536
536
  // TODO(#2318) Deprecate in the next major version
537
537
  export type PrimitivesT = {
538
- ...ColorTokensT,
538
+ ...FoundationColorTokensT,
539
539
  ...FontTokensT,
540
540
  };
541
541
 
@@ -1,3 +1,3 @@
1
- import type { ColorTokens } from './types';
2
- declare const colors: ColorTokens;
1
+ import type { PrimitiveColorTokens } from './types';
2
+ declare const colors: PrimitiveColorTokens;
3
3
  export default colors;
@@ -5,9 +5,9 @@ This source code is licensed under the MIT license found in the
5
5
  LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
- import type { ColorTokensT } from './types.js';
8
+ import type { PrimitiveColorTokensT } from './types.js';
9
9
 
10
- const colors: ColorTokensT = {
10
+ const colors: PrimitiveColorTokensT = {
11
11
  white: '#FFFFFF',
12
12
  gray50: '#F6F6F6',
13
13
  gray100: '#EEEEEE',
package/tokens/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { ColorTokens } from './types';
1
+ import type { PrimitiveColorTokens } from './types';
2
2
  export { default as colors } from './colors';
3
3
  export * from './types';
4
- /** @deprecated use ColorTokens instead. To be removed in future versions.*/
5
- export type TokenColors = ColorTokens;
4
+ /** @deprecated use PrimitiveColorTokens instead. To be removed in future versions.*/
5
+ export type TokenColors = PrimitiveColorTokens;
package/tokens/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type ColorTokens = {
1
+ export type PrimitiveColorTokens = {
2
2
  white: string;
3
3
  black: string;
4
4
  gray50: string;
@@ -5,7 +5,7 @@ This source code is licensed under the MIT license found in the
5
5
  LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  // @flow
8
- export type ColorTokensT = {
8
+ export type PrimitiveColorTokensT = {
9
9
  white: string,
10
10
  black: string,
11
11