baseui 16.0.0 → 16.1.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/checkbox-v2/checkbox.d.ts +7 -0
- package/checkbox-v2/checkbox.js +202 -0
- package/checkbox-v2/constants.d.ts +7 -0
- package/checkbox-v2/constants.js +23 -0
- package/checkbox-v2/index.d.ts +6 -0
- package/checkbox-v2/index.js +95 -0
- package/checkbox-v2/stateful-checkbox-container.d.ts +3 -0
- package/checkbox-v2/stateful-checkbox-container.js +102 -0
- package/checkbox-v2/stateful-checkbox.d.ts +7 -0
- package/checkbox-v2/stateful-checkbox.js +26 -0
- package/checkbox-v2/styled-components.d.ts +6 -0
- package/checkbox-v2/styled-components.js +263 -0
- package/checkbox-v2/types.d.ts +163 -0
- package/checkbox-v2/types.js +1 -0
- package/package.json +2 -3
- package/switch/constants.d.ts +11 -0
- package/switch/constants.js +24 -0
- package/switch/index.d.ts +6 -0
- package/switch/index.js +102 -0
- package/switch/stateful-switch-container.d.ts +3 -0
- package/switch/stateful-switch-container.js +97 -0
- package/switch/stateful-switch.d.ts +7 -0
- package/switch/stateful-switch.js +26 -0
- package/switch/styled-components.d.ts +6 -0
- package/switch/styled-components.js +264 -0
- package/switch/switch.d.ts +4 -0
- package/switch/switch.js +199 -0
- package/switch/types.d.ts +145 -0
- package/switch/types.js +1 -0
- package/themes/dark-theme/color-semantic-tokens.js +14 -1
- package/themes/light-theme/color-semantic-tokens.js +14 -1
- package/themes/types.d.ts +12 -0
- package/tokens/color-primitive-tokens.js +23 -1
- package/tokens/types.d.ts +20 -0
- package/utils/get-shared-styles.d.ts +13 -0
- package/utils/get-shared-styles.js +37 -0
|
@@ -37,7 +37,20 @@ foundation = _colorFoundationTokens.default) => {
|
|
|
37
37
|
borderSelected: foundation.primaryA,
|
|
38
38
|
borderInverseOpaque: _colorPrimitiveTokens.default.gray800,
|
|
39
39
|
borderInverseTransparent: (0, _util.hexToRgb)(foundation.primaryB, '0.2') || (0, _util.hexToRgb)(_colorFoundationTokens.default.primaryB, '0.2') || '',
|
|
40
|
-
borderInverseSelected: foundation.primaryB
|
|
40
|
+
borderInverseSelected: foundation.primaryB,
|
|
41
|
+
// brand default
|
|
42
|
+
brandBackgroundPrimary: _colorPrimitiveTokens.default.brandDefault600,
|
|
43
|
+
brandBackgroundSecondary: _colorPrimitiveTokens.default.brandDefault50,
|
|
44
|
+
brandBackgroundTertiary: _colorPrimitiveTokens.default.white,
|
|
45
|
+
brandBackgroundDisabled: _colorPrimitiveTokens.default.brandDefault50,
|
|
46
|
+
brandContentPrimary: _colorPrimitiveTokens.default.brandDefault600,
|
|
47
|
+
brandContentOnPrimary: _colorPrimitiveTokens.default.white,
|
|
48
|
+
brandContentOnSecondary: _colorPrimitiveTokens.default.brandDefault700,
|
|
49
|
+
brandContentOnTertiary: _colorPrimitiveTokens.default.black,
|
|
50
|
+
brandContentOnGradient: _colorPrimitiveTokens.default.white,
|
|
51
|
+
brandContentDisabled: _colorPrimitiveTokens.default.brandDefault300,
|
|
52
|
+
brandBorderAccessible: _colorPrimitiveTokens.default.brandDefault600,
|
|
53
|
+
brandBorderSubtle: _colorPrimitiveTokens.default.brandDefault100
|
|
41
54
|
};
|
|
42
55
|
const coreExtensions = {
|
|
43
56
|
// Backgrounds
|
package/themes/types.d.ts
CHANGED
|
@@ -133,6 +133,18 @@ export type CoreSemanticColors = {
|
|
|
133
133
|
borderInverseOpaque: string;
|
|
134
134
|
borderInverseTransparent: string;
|
|
135
135
|
borderInverseSelected: string;
|
|
136
|
+
brandBackgroundPrimary: string;
|
|
137
|
+
brandBackgroundSecondary: string;
|
|
138
|
+
brandBackgroundTertiary: string;
|
|
139
|
+
brandBackgroundDisabled: string;
|
|
140
|
+
brandContentPrimary: string;
|
|
141
|
+
brandContentOnPrimary: string;
|
|
142
|
+
brandContentOnSecondary: string;
|
|
143
|
+
brandContentOnTertiary: string;
|
|
144
|
+
brandContentOnGradient: string;
|
|
145
|
+
brandContentDisabled: string;
|
|
146
|
+
brandBorderAccessible: string;
|
|
147
|
+
brandBorderSubtle: string;
|
|
136
148
|
};
|
|
137
149
|
export type CoreExtensionSemanticColors = {
|
|
138
150
|
backgroundStateDisabled: string;
|
|
@@ -175,6 +175,17 @@ const primitiveColors = exports.default = {
|
|
|
175
175
|
brown600: '#5C3C2E',
|
|
176
176
|
/* @deprecated use orange color tokens instead */
|
|
177
177
|
brown700: '#3D281E',
|
|
178
|
+
// Brand colors
|
|
179
|
+
brandDefault50: '#EFF4FE',
|
|
180
|
+
brandDefault100: '#DEE9FE',
|
|
181
|
+
brandDefault200: '#CDDEFF',
|
|
182
|
+
brandDefault300: '#A9C9FF',
|
|
183
|
+
brandDefault400: '#6DAAFB',
|
|
184
|
+
brandDefault500: '#068BEE',
|
|
185
|
+
brandDefault600: '#276EF1',
|
|
186
|
+
brandDefault700: '#175BCC',
|
|
187
|
+
brandDefault800: '#1948A3',
|
|
188
|
+
brandDefault900: '#002661',
|
|
178
189
|
/***** dark color tokens *****/
|
|
179
190
|
gray50Dark: '#161616',
|
|
180
191
|
gray100Dark: '#292929',
|
|
@@ -285,7 +296,18 @@ const primitiveColors = exports.default = {
|
|
|
285
296
|
magenta600Dark: '#C664A9',
|
|
286
297
|
magenta700Dark: '#E099C9',
|
|
287
298
|
magenta800Dark: '#EEB6DB',
|
|
288
|
-
magenta900Dark: '#F1D4E7'
|
|
299
|
+
magenta900Dark: '#F1D4E7',
|
|
300
|
+
// Brand colors
|
|
301
|
+
brandDefault50Dark: '#09152C',
|
|
302
|
+
brandDefault100Dark: '#182946',
|
|
303
|
+
brandDefault200Dark: '#22375C',
|
|
304
|
+
brandDefault300Dark: '#2D4775',
|
|
305
|
+
brandDefault400Dark: '#335BA3',
|
|
306
|
+
brandDefault500Dark: '#3F6EC5',
|
|
307
|
+
brandDefault600Dark: '#5E8BDB',
|
|
308
|
+
brandDefault700Dark: '#93B4EE',
|
|
309
|
+
brandDefault800Dark: '#B3CCF6',
|
|
310
|
+
brandDefault900Dark: '#D1DFF6'
|
|
289
311
|
};
|
|
290
312
|
const primitiveLightColors = exports.primitiveLightColors = {};
|
|
291
313
|
const primitiveDarkColors = exports.primitiveDarkColors = {};
|
package/tokens/types.d.ts
CHANGED
|
@@ -161,6 +161,16 @@ export type PrimitiveColors = {
|
|
|
161
161
|
cobalt600: string;
|
|
162
162
|
/** @deprecated use blue color tokens instead */
|
|
163
163
|
cobalt700: string;
|
|
164
|
+
brandDefault50: string;
|
|
165
|
+
brandDefault100: string;
|
|
166
|
+
brandDefault200: string;
|
|
167
|
+
brandDefault300: string;
|
|
168
|
+
brandDefault400: string;
|
|
169
|
+
brandDefault500: string;
|
|
170
|
+
brandDefault600: string;
|
|
171
|
+
brandDefault700: string;
|
|
172
|
+
brandDefault800: string;
|
|
173
|
+
brandDefault900: string;
|
|
164
174
|
gray50Dark: string;
|
|
165
175
|
gray100Dark: string;
|
|
166
176
|
gray200Dark: string;
|
|
@@ -271,6 +281,16 @@ export type PrimitiveColors = {
|
|
|
271
281
|
magenta700Dark: string;
|
|
272
282
|
magenta800Dark: string;
|
|
273
283
|
magenta900Dark: string;
|
|
284
|
+
brandDefault50Dark: string;
|
|
285
|
+
brandDefault100Dark: string;
|
|
286
|
+
brandDefault200Dark: string;
|
|
287
|
+
brandDefault300Dark: string;
|
|
288
|
+
brandDefault400Dark: string;
|
|
289
|
+
brandDefault500Dark: string;
|
|
290
|
+
brandDefault600Dark: string;
|
|
291
|
+
brandDefault700Dark: string;
|
|
292
|
+
brandDefault800Dark: string;
|
|
293
|
+
brandDefault900Dark: string;
|
|
274
294
|
};
|
|
275
295
|
export type PrimitiveLightColors = {
|
|
276
296
|
[K in keyof PrimitiveColors as K extends `${infer _}Dark` ? never : K]: PrimitiveColors[K];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Theme } from '../styles';
|
|
2
|
+
export declare const getFocusOutlineStyle: (theme: Theme) => {
|
|
3
|
+
outline: string;
|
|
4
|
+
outlineOffset: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const getOverlayColor: ({ $theme, $disabled, $error, }: {
|
|
7
|
+
$theme: Theme;
|
|
8
|
+
$disabled: boolean;
|
|
9
|
+
$error: boolean;
|
|
10
|
+
}) => {
|
|
11
|
+
hoveredColor: string;
|
|
12
|
+
pressedColor: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getOverlayColor = exports.getFocusOutlineStyle = void 0;
|
|
7
|
+
const getFocusOutlineStyle = theme => {
|
|
8
|
+
const {
|
|
9
|
+
colors,
|
|
10
|
+
sizing
|
|
11
|
+
} = theme;
|
|
12
|
+
return {
|
|
13
|
+
// 2px for the outline and 2px for the outline offset(Accessible 4px focus ring)
|
|
14
|
+
outline: `${sizing.scale0} solid ${colors.brandBorderAccessible}`,
|
|
15
|
+
outlineOffset: sizing.scale0
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Get overlay (for example, backplate background) color based on disabled and error states
|
|
20
|
+
// Used in Checkbox, Radio, and Switch components Or any other component that requires an overlay(for example, backplate) for hovering and pressing states
|
|
21
|
+
exports.getFocusOutlineStyle = getFocusOutlineStyle;
|
|
22
|
+
const getOverlayColor = ({
|
|
23
|
+
$theme,
|
|
24
|
+
$disabled,
|
|
25
|
+
$error
|
|
26
|
+
}) => {
|
|
27
|
+
const {
|
|
28
|
+
colors
|
|
29
|
+
} = $theme;
|
|
30
|
+
const hoveredColor = $disabled ? 'transparent' : $error ? colors.hoverNegativeAlpha : colors.hoverOverlayAlpha;
|
|
31
|
+
const pressedColor = $disabled ? 'transparent' : $error ? colors.pressedNegativeAlpha : colors.pressedOverlayAlpha;
|
|
32
|
+
return {
|
|
33
|
+
hoveredColor,
|
|
34
|
+
pressedColor
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
exports.getOverlayColor = getOverlayColor;
|