reshaped 2.7.4 → 2.7.5-beta.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/CHANGELOG.md +12 -0
- package/bin/cli.js +2 -4
- package/bundle.css +1 -1
- package/bundle.js +8 -8
- package/cli/theming/index.d.ts +3 -3
- package/cli/theming/index.js +4 -8
- package/components/Actionable/Actionable.module.css +1 -1
- package/components/Alert/Alert.types.d.ts +1 -1
- package/components/Alert/tests/Alert.stories.js +10 -0
- package/components/Avatar/Avatar.module.css +1 -1
- package/components/Avatar/Avatar.types.d.ts +1 -1
- package/components/Avatar/tests/Avatar.stories.js +6 -0
- package/components/Badge/Badge.module.css +1 -1
- package/components/Badge/Badge.types.d.ts +1 -1
- package/components/Badge/tests/Badge.stories.js +12 -0
- package/components/Button/Button.module.css +1 -1
- package/components/Calendar/useCalendarKeyboardNavigation.js +0 -1
- package/components/Carousel/Carousel.module.css +1 -1
- package/components/Checkbox/Checkbox.module.css +1 -1
- package/components/Divider/Divider.module.css +1 -1
- package/components/Hidden/Hidden.module.css +1 -1
- package/components/Icon/Icon.module.css +1 -1
- package/components/Icon/Icon.types.d.ts +1 -1
- package/components/Image/Image.module.css +1 -1
- package/components/Loader/Loader.module.css +1 -1
- package/components/MenuItem/MenuItem.module.css +1 -1
- package/components/Modal/Modal.module.css +1 -1
- package/components/Popover/Popover.module.css +1 -1
- package/components/Progress/Progress.module.css +1 -1
- package/components/Progress/Progress.types.d.ts +1 -1
- package/components/Progress/tests/Progress.stories.js +3 -0
- package/components/Radio/Radio.module.css +1 -1
- package/components/Reshaped/Reshaped.css +1 -1
- package/components/Select/Select.module.css +1 -1
- package/components/Slider/Slider.module.css +1 -1
- package/components/Slider/SliderThumb.js +2 -2
- package/components/Table/Table.module.css +1 -1
- package/components/Tabs/Tabs.module.css +1 -1
- package/components/Text/Text.module.css +1 -1
- package/components/Text/Text.types.d.ts +1 -1
- package/components/Text/tests/Text.stories.js +3 -0
- package/components/TextArea/TextArea.module.css +1 -1
- package/components/TextField/TextField.module.css +1 -1
- package/components/Theme/Theme.module.css +1 -1
- package/components/Toast/Toast.module.css +1 -1
- package/components/View/View.module.css +1 -1
- package/components/View/View.types.d.ts +2 -2
- package/components/View/tests/View.stories.js +22 -0
- package/config/postcss.d.ts +18 -3
- package/config/postcss.js +18 -4
- package/config/tailwind.d.ts +2 -2
- package/config/tailwind.js +1 -2
- package/package.json +5 -5
- package/styles/aspectRatio/aspectRatio.module.css +1 -1
- package/styles/bleed/bleed.module.css +1 -1
- package/styles/height/height.module.css +1 -1
- package/styles/inset/inset.module.css +1 -1
- package/styles/maxHeight/maxHeight.module.css +1 -1
- package/styles/maxWidth/maxWidth.module.css +1 -1
- package/styles/minWidth/minWidth.module.css +1 -1
- package/styles/padding/padding.module.css +1 -1
- package/styles/position/position.module.css +1 -1
- package/styles/radius/radius.module.css +1 -1
- package/styles/width/width.module.css +1 -1
- package/themes/_generator/constants.js +2 -0
- package/themes/_generator/definitions/figma.d.ts +2 -2
- package/themes/_generator/definitions/figma.js +6 -0
- package/themes/_generator/definitions/reshaped.d.ts +2 -2
- package/themes/_generator/definitions/reshaped.js +5 -0
- package/themes/_generator/definitions/slate.d.ts +2 -2
- package/themes/_generator/tests/themes.stories.js +25 -1
- package/themes/_generator/tokens/color/color.types.d.ts +3 -3
- package/themes/_generator/tokens/transforms.d.ts +1 -1
- package/themes/_generator/tokens/types.d.ts +13 -14
- package/themes/_generator/tokens/viewport/viewport.transforms.d.ts +1 -1
- package/themes/_generator/tokens/viewport/viewport.types.d.ts +6 -2
- package/themes/_generator/transform.js +7 -2
- package/themes/_generator/types.d.ts +0 -1
- package/themes/_generator/utilities/color.d.ts +5 -1
- package/themes/_generator/utilities/color.js +18 -13
- package/themes/_generator/utilities/generateColors.d.ts +2 -0
- package/themes/_generator/utilities/generateColors.js +15 -10
- package/themes/figma/media.css +1 -0
- package/themes/figma/theme.css +1 -1
- package/themes/index.d.ts +1 -1
- package/themes/index.js +2 -4
- package/themes/reshaped/media.css +1 -0
- package/themes/reshaped/theme.css +1 -1
- package/themes/slate/media.css +1 -0
- package/themes/slate/theme.css +1 -1
- package/types/config.d.ts +3 -3
- package/utilities/storybook/Example.js +1 -2
- package/themes/_generator/definitions/base.d.ts +0 -3
- package/themes/_generator/definitions/base.js +0 -11
- package/themes/media.css +0 -5
@@ -5,6 +5,7 @@ import Button from "../../../components/Button/index.js";
|
|
5
5
|
import Badge from "../../../components/Badge/index.js";
|
6
6
|
import Alert from "../../../components/Alert/index.js";
|
7
7
|
import Card from "../../../components/Card/index.js";
|
8
|
+
import Avatar from "../../../components/Avatar/index.js";
|
8
9
|
import DropdownMenu from "../../../components/DropdownMenu/index.js";
|
9
10
|
import Theme from "../../../components/Theme/index.js";
|
10
11
|
import { getThemeCSS, generateThemeColors, baseThemeDefinition } from "../../index.js";
|
@@ -50,12 +51,35 @@ const componentExamples = (<View gap={4}>
|
|
50
51
|
<View.Item columns={6}>
|
51
52
|
<Alert color="critical">Critical</Alert>
|
52
53
|
</View.Item>
|
54
|
+
<View.Item columns={6}>
|
55
|
+
<Alert color="warning">warning</Alert>
|
56
|
+
</View.Item>
|
53
57
|
<View.Item columns={6}>
|
54
58
|
<Alert color="positive">Positive</Alert>
|
55
59
|
</View.Item>
|
56
60
|
<View.Item columns={6}>
|
57
61
|
<Alert color="neutral">Neutral</Alert>
|
58
62
|
</View.Item>
|
63
|
+
<View.Item columns={12}>
|
64
|
+
<View direction="row" gap={2}>
|
65
|
+
<View backgroundColor="neutral" width={10} height={10}/>
|
66
|
+
<View backgroundColor="neutral-faded" width={10} height={10}/>
|
67
|
+
<View backgroundColor="primary" width={10} height={10}/>
|
68
|
+
<View backgroundColor="primary-faded" width={10} height={10}/>
|
69
|
+
<View backgroundColor="critical" width={10} height={10}/>
|
70
|
+
<View backgroundColor="critical-faded" width={10} height={10}/>
|
71
|
+
<View backgroundColor="warning" width={10} height={10}/>
|
72
|
+
<View backgroundColor="warning-faded" width={10} height={10}/>
|
73
|
+
<View backgroundColor="positive" width={10} height={10}/>
|
74
|
+
<View backgroundColor="positive-faded" width={10} height={10}/>
|
75
|
+
</View>
|
76
|
+
</View.Item>
|
77
|
+
<View.Item columns={12}>
|
78
|
+
<View direction="row" gap={2}>
|
79
|
+
<Avatar initials="RS" color="warning" variant="faded"/>
|
80
|
+
<Badge color="warning">Warning</Badge>
|
81
|
+
</View>
|
82
|
+
</View.Item>
|
59
83
|
<View.Item columns={6}>
|
60
84
|
<Card>
|
61
85
|
<View gap={2} align="start">
|
@@ -93,7 +117,7 @@ export const base = () => (<Example>
|
|
93
117
|
</Example.Item>
|
94
118
|
</Example>);
|
95
119
|
export const generation = () => (<Example>
|
96
|
-
<Example.Item
|
120
|
+
<Example.Item>
|
97
121
|
<style>{cssGenerated}</style>
|
98
122
|
<View gap={4}>
|
99
123
|
<View.Item>Generated theme</View.Item>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export type Name = "foregroundNeutral" | "foregroundNeutralFaded" | "foregroundDisabled" | "foregroundPrimary" | "foregroundCritical" | "foregroundPositive" | "borderNeutral" | "borderNeutralFaded" | "borderDisabled" | "borderPrimary" | "borderPrimaryFaded" | "borderCritical" | "borderCriticalFaded" | "borderPositive" | "borderPositiveFaded" | "backgroundNeutral" | "backgroundNeutralFaded" | "backgroundNeutralHighlighted" | "backgroundDisabled" | "backgroundDisabledFaded" | "backgroundPrimary" | "backgroundPrimaryFaded" | "backgroundPrimaryHighlighted" | "backgroundCritical" | "backgroundCriticalFaded" | "backgroundCriticalHighlighted" | "backgroundPositive" | "backgroundPositiveFaded" | "backgroundPositiveHighlighted" | "backgroundPage" | "backgroundPageFaded" | "backgroundElevationBase" | "backgroundElevationRaised" | "backgroundElevationOverlay" | "white" | "black";
|
2
|
-
export type GeneratedOnName = "onBackgroundNeutral" | "onBackgroundPrimary" | "onBackgroundPositive" | "onBackgroundCritical";
|
3
|
-
export type GeneratedRGBName = "rgbBackgroundNeutral" | "rgbBackgroundNeutralFaded" | "rgbBackgroundNeutralHighlighted" | "rgbBackgroundDisabled" | "rgbBackgroundDisabledFaded" | "rgbBackgroundPrimary" | "rgbBackgroundPrimaryFaded" | "rgbBackgroundPrimaryHighlighted" | "rgbBackgroundCritical" | "rgbBackgroundCriticalFaded" | "rgbBackgroundCriticalHighlighted" | "rgbBackgroundPositive" | "rgbBackgroundPositiveFaded" | "rgbBackgroundPositiveHighlighted" | "rgbBackgroundPage" | "rgbBackgroundPageFaded" | "rgbBackgroundElevationBase" | "rgbBackgroundElevationRaised" | "rgbBackgroundElevationOverlay";
|
1
|
+
export type Name = "foregroundNeutral" | "foregroundNeutralFaded" | "foregroundDisabled" | "foregroundPrimary" | "foregroundCritical" | "foregrounwarning" | "foregroundPositive" | "borderNeutral" | "borderNeutralFaded" | "borderDisabled" | "borderPrimary" | "borderPrimaryFaded" | "borderCritical" | "borderCriticalFaded" | "borderwarning" | "borderwarningFaded" | "borderPositive" | "borderPositiveFaded" | "backgroundNeutral" | "backgroundNeutralFaded" | "backgroundNeutralHighlighted" | "backgroundDisabled" | "backgroundDisabledFaded" | "backgroundPrimary" | "backgroundPrimaryFaded" | "backgroundPrimaryHighlighted" | "backgroundCritical" | "backgroundCriticalFaded" | "backgroundCriticalHighlighted" | "backgroundWarning" | "backgroundWarningFaded" | "backgroundWarningHighlighted" | "backgroundPositive" | "backgroundPositiveFaded" | "backgroundPositiveHighlighted" | "backgroundPage" | "backgroundPageFaded" | "backgroundElevationBase" | "backgroundElevationRaised" | "backgroundElevationOverlay" | "brand" | "white" | "black";
|
2
|
+
export type GeneratedOnName = "onBackgroundNeutral" | "onBackgroundPrimary" | "onBackgroundPositive" | "onBackgroundWarning" | "onBackgroundCritical";
|
3
|
+
export type GeneratedRGBName = "rgbBackgroundNeutral" | "rgbBackgroundNeutralFaded" | "rgbBackgroundNeutralHighlighted" | "rgbBackgroundDisabled" | "rgbBackgroundDisabledFaded" | "rgbBackgroundPrimary" | "rgbBackgroundPrimaryFaded" | "rgbBackgroundPrimaryHighlighted" | "rgbBackgroundCritical" | "rgbBackgroundCriticalFaded" | "rgbBackgroundCriticalHighlighted" | "rgbBackgroundWarning" | "rgbBackgroundWarningFaded" | "rgbBackgroundWarningHighlighted" | "rgbBackgroundPositive" | "rgbBackgroundPositiveFaded" | "rgbBackgroundPositiveHighlighted" | "rgbBackgroundPage" | "rgbBackgroundPageFaded" | "rgbBackgroundElevationBase" | "rgbBackgroundElevationRaised" | "rgbBackgroundElevationOverlay";
|
4
4
|
export type Token = {
|
5
5
|
hex: string;
|
6
6
|
hexDark?: string;
|
@@ -7,5 +7,5 @@ export declare const css: {
|
|
7
7
|
fontWeight: import("./types").Transformer<import("./fontWeight/fontWeight.types").Token>;
|
8
8
|
shadow: import("./types").Transformer<import("./shadow/shadow.types").Token>;
|
9
9
|
unit: import("./types").Transformer<import("./unit/unit.types").Token>;
|
10
|
-
viewport: import("./types").Transformer<import("./viewport/viewport.types").Token>;
|
10
|
+
viewport: import("./types").Transformer<import("./viewport/viewport.types").Token | import("./viewport/viewport.types").SToken>;
|
11
11
|
};
|
@@ -9,13 +9,10 @@ import type * as TUnit from "./unit/unit.types";
|
|
9
9
|
import type * as TViewport from "./viewport/viewport.types";
|
10
10
|
export type TokenType = "fontFamily" | "fontWeight" | "unit" | "viewport" | "font" | "color" | "duration" | "easing" | "shadow";
|
11
11
|
export type ColorHue = "primary" | "positive" | "critical" | "neutral";
|
12
|
-
export type BaseThemeDefinition = {
|
13
|
-
viewport: Record<TViewport.Name, TViewport.Token>;
|
14
|
-
};
|
15
12
|
type TokenSet<Name extends string, Token> = Record<Name, Token> & {
|
16
13
|
[tokenName: string]: Token;
|
17
14
|
};
|
18
|
-
export type
|
15
|
+
export type ThemeDefinition = {
|
19
16
|
unit: TokenSet<TUnit.Name, TUnit.Token>;
|
20
17
|
fontFamily: TokenSet<TFontFamily.Name, TFontFamily.Token>;
|
21
18
|
fontWeight: TokenSet<TFontWeight.Name, TFontWeight.Token>;
|
@@ -24,21 +21,23 @@ export type UserThemeDefinition = {
|
|
24
21
|
duration: TokenSet<TDuration.Name, TDuration.Token>;
|
25
22
|
easing: TokenSet<TEasing.Name, TEasing.Token>;
|
26
23
|
shadow: TokenSet<TShadow.Name, TShadow.Token>;
|
24
|
+
viewport: Record<Exclude<TViewport.Name, "s">, TViewport.Token>;
|
27
25
|
};
|
28
|
-
export type
|
29
|
-
unit?: Partial<
|
30
|
-
fontFamily?: Partial<
|
31
|
-
fontWeight?: Partial<
|
32
|
-
font?: Partial<
|
33
|
-
color?: Partial<
|
34
|
-
duration?: Partial<
|
35
|
-
easing?: Partial<
|
36
|
-
shadow?: Partial<
|
26
|
+
export type PartialThemeDefinition = {
|
27
|
+
unit?: Partial<ThemeDefinition["unit"]>;
|
28
|
+
fontFamily?: Partial<ThemeDefinition["fontFamily"]>;
|
29
|
+
fontWeight?: Partial<ThemeDefinition["fontWeight"]>;
|
30
|
+
font?: Partial<ThemeDefinition["font"]>;
|
31
|
+
color?: Partial<ThemeDefinition["color"]>;
|
32
|
+
duration?: Partial<ThemeDefinition["duration"]>;
|
33
|
+
easing?: Partial<ThemeDefinition["easing"]>;
|
34
|
+
shadow?: Partial<ThemeDefinition["shadow"]>;
|
35
|
+
viewport?: Partial<ThemeDefinition["viewport"]>;
|
37
36
|
};
|
38
|
-
export type ThemeDefinition = BaseThemeDefinition & UserThemeDefinition;
|
39
37
|
export type FullThemeDefinition = ThemeDefinition & {
|
40
38
|
color: Record<TColor.GeneratedOnName | TColor.GeneratedRGBName | TColor.Name, TColor.Token>;
|
41
39
|
unit: Record<TUnit.GeneratedName | TUnit.Name, TUnit.Token>;
|
40
|
+
viewport: Record<TViewport.Name, TViewport.Token | TViewport.SToken>;
|
42
41
|
};
|
43
42
|
export type TransformedToken = {
|
44
43
|
name: string;
|
@@ -31,9 +31,14 @@ const css_1 = require("./utilities/css");
|
|
31
31
|
const generateBackgroundColors_1 = __importDefault(require("./utilities/generateBackgroundColors"));
|
32
32
|
const generateUnits_1 = __importDefault(require("./utilities/generateUnits"));
|
33
33
|
const transform = (name, definition, options) => {
|
34
|
-
|
34
|
+
var _a, _b;
|
35
|
+
const { isFragment, themeOptions } = options;
|
35
36
|
(0, generateBackgroundColors_1.default)(definition, themeOptions);
|
36
37
|
(0, generateUnits_1.default)(definition);
|
38
|
+
// Generate s viewport
|
39
|
+
if ((_b = (_a = definition.viewport) === null || _a === void 0 ? void 0 : _a.m) === null || _b === void 0 ? void 0 : _b.minPx) {
|
40
|
+
definition.viewport.s = { maxPx: definition.viewport.m.minPx - 1 };
|
41
|
+
}
|
37
42
|
const transformedStorage = {
|
38
43
|
variable: [],
|
39
44
|
media: [],
|
@@ -51,7 +56,7 @@ const transform = (name, definition, options) => {
|
|
51
56
|
});
|
52
57
|
return {
|
53
58
|
variables: (0, css_1.variablesTemplate)(name, transformedStorage.variable),
|
54
|
-
media:
|
59
|
+
media: !isFragment ? (0, css_1.mediaTemplate)(transformedStorage.media) : undefined,
|
55
60
|
};
|
56
61
|
};
|
57
62
|
exports.default = transform;
|
@@ -4,7 +4,6 @@ export type PartialDeep<T> = T extends Primitive ? Partial<T> : {
|
|
4
4
|
[Key in keyof T]?: PartialDeep<T[Key]>;
|
5
5
|
};
|
6
6
|
export type PublicOptions = {
|
7
|
-
isPrivate?: boolean;
|
8
7
|
themeOptions?: ReshapedConfig["themeOptions"];
|
9
8
|
};
|
10
9
|
export type PrivateOptions = PublicOptions & {
|
@@ -74,7 +74,11 @@ export declare const hslToHex: (hsl: HslColor) => string;
|
|
74
74
|
/**
|
75
75
|
* Normalizing utilities
|
76
76
|
*/
|
77
|
-
export declare const
|
77
|
+
export declare const getDarkModeColor: (hsl: HslColor) => {
|
78
|
+
s: number;
|
79
|
+
l: number;
|
80
|
+
h: number;
|
81
|
+
};
|
78
82
|
export declare const getLuminanceDelta: (luminance: number) => number;
|
79
83
|
export declare function getRgbLuminance({ r, g, b }: RgbColor): number;
|
80
84
|
export declare const getOnColor: (args: {
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* They have been rewritten for easier color transformations in the theme generation case
|
5
5
|
*/
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
-
exports.getOnColor = exports.getRgbLuminance = exports.getLuminanceDelta = exports.
|
7
|
+
exports.getOnColor = exports.getRgbLuminance = exports.getLuminanceDelta = exports.getDarkModeColor = exports.hslToHex = exports.hexToHsluv = exports.hexToHsl = exports.hsluvToHex = exports.hsluvToLch = exports.lchToHsluv = exports.lchToLuv = exports.luvToLch = exports.luvToXyz = exports.xyzToLuv = exports.lToY = exports.yToL = exports.xyzToRgb = exports.rgbToXyz = exports.fromLinear = exports.toLinear = exports.rgbToHex = exports.hslToRgb = exports.rgbToHsl = exports.hexToRgb = exports.calcMaxChromaHsluv = exports.distanceFromOriginAngle = exports.calculateBoundingLines = void 0;
|
8
8
|
/**
|
9
9
|
* Constants
|
10
10
|
*/
|
@@ -293,19 +293,24 @@ exports.hslToHex = hslToHex;
|
|
293
293
|
/**
|
294
294
|
* Normalizing utilities
|
295
295
|
*/
|
296
|
-
const
|
297
|
-
const
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
296
|
+
const getDarkModeColor = (hsl) => {
|
297
|
+
const { s, l } = hsl;
|
298
|
+
/**
|
299
|
+
* Colors with lower saturation should have bigger lightness delta, for example it can be
|
300
|
+
* Neutral: l: 97 -> l dark: 13
|
301
|
+
* Warning: l: 53 -> l dark: 47
|
302
|
+
*
|
303
|
+
* Therefor we calculate the dark mode lightness based on a saturation modifier, which should be between 0 and 1
|
304
|
+
* We take base saturation:
|
305
|
+
* Neutral: 20 -> 0.2 modifier, Warning: 96 -> 0.96 modifier
|
306
|
+
*
|
307
|
+
* And we also adjust that value with a modifier of 0.9-2 based on the saturation
|
308
|
+
* That way satured colors won't change much from its original value
|
309
|
+
*/
|
310
|
+
const sModifier = (s / 100) * (0.96 + (100 - s) / 100);
|
311
|
+
return Object.assign(Object.assign({}, hsl), { s: s - 7, l: l * sModifier });
|
307
312
|
};
|
308
|
-
exports.
|
313
|
+
exports.getDarkModeColor = getDarkModeColor;
|
309
314
|
const getLuminanceDelta = (luminance) => {
|
310
315
|
return Math.max(0, luminance - 50) / 5;
|
311
316
|
};
|
@@ -1,8 +1,10 @@
|
|
1
1
|
declare const generate: (args?: {
|
2
2
|
primary?: string;
|
3
3
|
critical?: string;
|
4
|
+
warning?: string;
|
4
5
|
positive?: string;
|
5
6
|
neutral?: string;
|
7
|
+
brand?: string;
|
6
8
|
}) => Record<import("../tokens/color/color.types").Name, import("../tokens/color/color.types").Token> & {
|
7
9
|
[tokenName: string]: import("../tokens/color/color.types").Token;
|
8
10
|
};
|
@@ -13,27 +13,25 @@ const generateColorValues = (args) => {
|
|
13
13
|
const hsluv = (0, color_1.hexToHsluv)(hex);
|
14
14
|
const luminance = (0, color_1.getRgbLuminance)(rgb);
|
15
15
|
const luminanceDelta = (0, color_1.getLuminanceDelta)(luminance);
|
16
|
-
const
|
17
|
-
const hslDark = Object.assign(Object.assign({}, hsl), { l: hsl.l - darkModeLigthnessDelta });
|
16
|
+
const hslDark = (0, color_1.getDarkModeColor)(hsl);
|
18
17
|
const bgHex = hex;
|
19
18
|
const bgHexDark = (0, color_1.hslToHex)(hslDark);
|
20
19
|
const hsluvDark = (0, color_1.hexToHsluv)(bgHexDark);
|
21
20
|
const bdHex = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, hsluv), { l: hsluv.l - 5 - luminanceDelta }));
|
22
|
-
const bdHexDark = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, hsluvDark), {
|
23
|
-
// s: Math.min(hsluvDark.s, 70),
|
24
|
-
l: key === "neutral" ? 35 : FG_L_DARK }));
|
21
|
+
const bdHexDark = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, hsluvDark), { l: key === "neutral" ? 35 : FG_L_DARK }));
|
25
22
|
const fgHsluv = Object.assign(Object.assign({}, hsluv), { l: 43 });
|
26
23
|
const fgHsluvDark = Object.assign(Object.assign({}, hsluv), { l: key === "neutral" ? 80 : FG_L_DARK });
|
27
24
|
const fgHex = (0, color_1.hsluvToHex)(fgHsluv);
|
28
25
|
const fgHexDark = (0, color_1.hsluvToHex)(fgHsluvDark);
|
29
|
-
const
|
26
|
+
const sturationModifier = hsl.s / 40;
|
27
|
+
const bgFadedHex = (0, color_1.rgbToHex)((0, color_1.hslToRgb)(Object.assign(Object.assign({}, hsl), { l: 98 - sturationModifier })));
|
30
28
|
const bgFadedHsluv = (0, color_1.hexToHsluv)(bgFadedHex);
|
31
29
|
const bgFadedHsluvDark = Object.assign(Object.assign({}, hsluv), { l: 16, s: 32 });
|
32
30
|
const bgFadedHexDark = (0, color_1.hsluvToHex)(bgFadedHsluvDark);
|
33
31
|
const fadedLuminance = (0, color_1.getRgbLuminance)((0, color_1.hexToRgb)(bgFadedHex));
|
34
32
|
const fadedLuminanceDark = (0, color_1.getRgbLuminance)((0, color_1.hexToRgb)(bgFadedHexDark));
|
35
33
|
const fadedLuminanceDeltaDark = (0, color_1.getLuminanceDelta)(fadedLuminanceDark);
|
36
|
-
const bdFadedHex = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, bgFadedHsluv), { s: Math.max(0, bgFadedHsluv.s - 6 - Math.max(0, fadedLuminance - 98) * 20), l: bgFadedHsluv.l - 7 }));
|
34
|
+
const bdFadedHex = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, bgFadedHsluv), { s: Math.max(0, bgFadedHsluv.s - 6 - Math.max(0, fadedLuminance - 98) * 20), l: bgFadedHsluv.l - 7 + sturationModifier }));
|
37
35
|
const bdFadedHexDark = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, bgFadedHsluvDark), { s: 40, l: bgFadedHsluvDark.l + 7 - fadedLuminanceDeltaDark }));
|
38
36
|
const output = {
|
39
37
|
[`background${capitalizedKey}`]: {
|
@@ -117,10 +115,17 @@ const generateColorValues = (args) => {
|
|
117
115
|
};
|
118
116
|
const validateHexColor = (color) => {
|
119
117
|
const hexColorRegex = /^#([A-Fa-f0-9]{3}){2}$/;
|
120
|
-
|
118
|
+
if (!hexColorRegex.test(color)) {
|
119
|
+
throw new Error(`Invalid hex color: ${color}`);
|
120
|
+
}
|
121
|
+
return color;
|
121
122
|
};
|
122
123
|
const generate = (args = {}) => {
|
123
|
-
const { primary, critical, positive, neutral } = args;
|
124
|
-
|
124
|
+
const { primary = "#5a58f2", critical = "#e22c2c", warning = "#facc15", positive = "#118850", neutral = "#dfe2ea", brand, } = args;
|
125
|
+
const primaryColors = generateColorValues({
|
126
|
+
key: "primary",
|
127
|
+
hex: validateHexColor(primary),
|
128
|
+
});
|
129
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, primaryColors), generateColorValues({ key: "critical", hex: validateHexColor(critical) })), generateColorValues({ key: "warning", hex: validateHexColor(warning) })), generateColorValues({ key: "positive", hex: validateHexColor(positive) })), generateColorValues({ key: "neutral", hex: validateHexColor(neutral) })), { brand: { hex: brand || primary }, white: { hex: "#ffffff" }, black: { hex: "#000000" } });
|
125
130
|
};
|
126
131
|
exports.default = generate;
|
@@ -0,0 +1 @@
|
|
1
|
+
@custom-media --rs-viewport-s (max-width: 659px);@custom-media --rs-viewport-m (min-width: 660px);@custom-media --rs-viewport-l (min-width: 900px);@custom-media --rs-viewport-xl (min-width: 1280px);
|
package/themes/figma/theme.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
[data-rs-theme=figma]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-heavy:800;--rs-font-weight-black:900;--rs-font-size-title-1:80px;--rs-line-height-title-1:84px;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-semibold);--rs-font-size-title-2:64px;--rs-line-height-title-2:68px;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-semibold);--rs-font-size-title-3:56px;--rs-line-height-title-3:60px;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-semibold);--rs-font-size-title-4:40px;--rs-line-height-title-4:44px;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-semibold);--rs-font-size-title-5:36px;--rs-line-height-title-5:40px;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-semibold);--rs-font-size-title-6:24px;--rs-line-height-title-6:28px;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-semibold);--rs-font-size-featured-1:22px;--rs-line-height-featured-1:28px;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-font-size-featured-2:20px;--rs-line-height-featured-2:28px;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-font-size-featured-3:18px;--rs-line-height-featured-3:24px;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-font-size-body-1:14px;--rs-line-height-body-1:20px;--rs-font-family-body-1:var(--rs-font-family-body);--rs-font-size-body-2:13px;--rs-line-height-body-2:20px;--rs-font-family-body-2:var(--rs-font-family-body);--rs-font-size-body-3:11px;--rs-line-height-body-3:16px;--rs-font-family-body-3:var(--rs-font-family-body);--rs-font-size-caption-1:11px;--rs-line-height-caption-1:16px;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-font-size-caption-2:10px;--rs-line-height-caption-2:12px;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-unit-base:4px;--rs-unit-radius-small:4px;--rs-unit-radius-medium:4px;--rs-unit-radius-large:4px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-positive:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 1px 3px 0px rgba(0,0,0,.15);--rs-shadow-overlay:0px 10px 24px 0px rgba(0,0,0,.1),0px 2px 5px 0px rgba(0,0,0,.04)}[data-rs-theme=figma][data-rs-color-mode=light]{--rs-color-background-primary:#0d99ff;--rs-color-background-primary-faded:#e5f4ff;--rs-color-background-primary-highlighted:#007be5;--rs-color-border-primary:#007be5;--rs-color-border-primary-faded:#bde3ff;--rs-color-foreground-primary:#007be5;--rs-color-background-critical:#f24822;--rs-color-background-critical-faded:#ffe2e0;--rs-color-background-critical-highlighted:#dc3412;--rs-color-border-critical:#dc3412;--rs-color-border-critical-faded:#ffc7c2;--rs-color-foreground-critical:#dc3412;--rs-color-background-positive:#14ae5c;--rs-color-background-positive-faded:#daecdf;--rs-color-background-positive-highlighted:#009951;--rs-color-border-positive:#009951;--rs-color-border-positive-faded:#bbddc6;--rs-color-foreground-positive:#009951;--rs-color-background-neutral:#dfe2ea;--rs-color-background-neutral-faded:#f5f5f5;--rs-color-background-neutral-highlighted:#d4d8e3;--rs-color-border-neutral:#e6e6e6;--rs-color-border-neutral-faded:#e6e6e6;--rs-color-foreground-neutral:#191919;--rs-color-foreground-neutral-faded:#474747;--rs-color-background-disabled:#e4e4e4;--rs-color-background-disabled-faded:#f5f5f5;--rs-color-border-disabled:#e6e6e6;--rs-color-foreground-disabled:#b2b2b2;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#fafafa;--rs-color-rgb-background-primary:13,153,255;--rs-color-rgb-background-primary-faded:229,244,255;--rs-color-rgb-background-primary-highlighted:0,123,229;--rs-color-rgb-border-primary:0,123,229;--rs-color-rgb-border-primary-faded:189,227,255;--rs-color-rgb-background-critical:242,72,34;--rs-color-rgb-background-critical-faded:255,226,224;--rs-color-rgb-background-critical-highlighted:220,52,18;--rs-color-rgb-border-critical:220,52,18;--rs-color-rgb-border-critical-faded:255,199,194;--rs-color-rgb-background-positive:20,174,92;--rs-color-rgb-background-positive-faded:218,236,223;--rs-color-rgb-background-positive-highlighted:0,153,81;--rs-color-rgb-border-positive:0,153,81;--rs-color-rgb-border-positive-faded:187,221,198;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:223,226,234;--rs-color-rgb-background-neutral-faded:245,245,245;--rs-color-rgb-background-neutral-highlighted:212,216,227;--rs-color-rgb-border-neutral:230,230,230;--rs-color-rgb-border-neutral-faded:230,230,230;--rs-color-rgb-background-disabled:228,228,228;--rs-color-rgb-background-disabled-faded:245,245,245;--rs-color-rgb-border-disabled:230,230,230;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:250,250,250}[data-rs-theme=figma][data-rs-color-mode=dark]{--rs-color-background-primary:#0c8ce9;--rs-color-background-primary-faded:#394360;--rs-color-background-primary-highlighted:#0a6dc2;--rs-color-border-primary:#7cc4f8;--rs-color-border-primary-faded:#2a4d72;--rs-color-foreground-primary:#7cc4f8;--rs-color-background-critical:#e03e1a;--rs-color-background-critical-faded:#60332a;--rs-color-background-critical-highlighted:#c4381c;--rs-color-border-critical:#fca397;--rs-color-border-critical-faded:#803226;--rs-color-foreground-critical:#fca397;--rs-color-background-positive:#198f51;--rs-color-background-positive-faded:#3d5749;--rs-color-background-positive-highlighted:#078348;--rs-color-border-positive:#79d297;--rs-color-border-positive-faded:#086338;--rs-color-foreground-positive:#79d297;--rs-color-background-neutral:#444;--rs-color-background-neutral-faded:#383838;--rs-color-background-neutral-highlighted:#525252;--rs-color-border-neutral:#444;--rs-color-border-neutral-faded:#444;--rs-color-foreground-neutral:#fff;--rs-color-foreground-neutral-faded:#b2b2b2;--rs-color-background-disabled:#474747;--rs-color-background-disabled-faded:#3a3a3a;--rs-color-border-disabled:#3e3e3e;--rs-color-foreground-disabled:#656565;--rs-color-background-elevation-base:#2c2c2c;--rs-color-background-elevation-raised:#2c2c2c;--rs-color-background-elevation-overlay:#2c2c2c;--rs-color-background-page:#2c2c2c;--rs-color-background-page-faded:#1e1e1e;--rs-color-rgb-background-primary:12,140,233;--rs-color-rgb-background-primary-faded:57,67,96;--rs-color-rgb-background-primary-highlighted:10,109,194;--rs-color-rgb-border-primary:124,196,248;--rs-color-rgb-border-primary-faded:42,77,114;--rs-color-rgb-background-critical:224,62,26;--rs-color-rgb-background-critical-faded:96,51,42;--rs-color-rgb-background-critical-highlighted:196,56,28;--rs-color-rgb-border-critical:252,163,151;--rs-color-rgb-border-critical-faded:128,50,38;--rs-color-rgb-background-positive:25,143,81;--rs-color-rgb-background-positive-faded:61,87,73;--rs-color-rgb-background-positive-highlighted:7,131,72;--rs-color-rgb-border-positive:121,210,151;--rs-color-rgb-border-positive-faded:8,99,56;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:68,68,68;--rs-color-rgb-background-neutral-faded:56,56,56;--rs-color-rgb-background-neutral-highlighted:82,82,82;--rs-color-rgb-border-neutral:68,68,68;--rs-color-rgb-border-neutral-faded:68,68,68;--rs-color-rgb-background-disabled:71,71,71;--rs-color-rgb-background-disabled-faded:58,58,58;--rs-color-rgb-border-disabled:62,62,62;--rs-color-rgb-background-elevation-base:44,44,44;--rs-color-rgb-background-elevation-raised:44,44,44;--rs-color-rgb-background-elevation-overlay:44,44,44;--rs-color-rgb-background-page:44,44,44;--rs-color-rgb-background-page-faded:30,30,30}
|
1
|
+
[data-rs-theme=figma]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-heavy:800;--rs-font-weight-black:900;--rs-font-size-title-1:80px;--rs-line-height-title-1:84px;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-semibold);--rs-font-size-title-2:64px;--rs-line-height-title-2:68px;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-semibold);--rs-font-size-title-3:56px;--rs-line-height-title-3:60px;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-semibold);--rs-font-size-title-4:40px;--rs-line-height-title-4:44px;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-semibold);--rs-font-size-title-5:36px;--rs-line-height-title-5:40px;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-semibold);--rs-font-size-title-6:24px;--rs-line-height-title-6:28px;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-semibold);--rs-font-size-featured-1:22px;--rs-line-height-featured-1:28px;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-font-size-featured-2:20px;--rs-line-height-featured-2:28px;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-font-size-featured-3:18px;--rs-line-height-featured-3:24px;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-font-size-body-1:14px;--rs-line-height-body-1:20px;--rs-font-family-body-1:var(--rs-font-family-body);--rs-font-size-body-2:13px;--rs-line-height-body-2:20px;--rs-font-family-body-2:var(--rs-font-family-body);--rs-font-size-body-3:11px;--rs-line-height-body-3:16px;--rs-font-family-body-3:var(--rs-font-family-body);--rs-font-size-caption-1:11px;--rs-line-height-caption-1:16px;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-font-size-caption-2:10px;--rs-line-height-caption-2:12px;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-unit-base:4px;--rs-unit-radius-small:4px;--rs-unit-radius-medium:4px;--rs-unit-radius-large:4px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-color-brand:#5a58f2;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-warning:#000;--rs-color-on-background-positive:#fff;--rs-color-on-brand:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 1px 3px 0px rgba(0,0,0,.15);--rs-shadow-overlay:0px 10px 24px 0px rgba(0,0,0,.1),0px 2px 5px 0px rgba(0,0,0,.04)}[data-rs-theme=figma][data-rs-color-mode=light]{--rs-color-background-primary:#0d99ff;--rs-color-background-primary-faded:#e5f4ff;--rs-color-background-primary-highlighted:#007be5;--rs-color-border-primary:#007be5;--rs-color-border-primary-faded:#bde3ff;--rs-color-foreground-primary:#007be5;--rs-color-background-critical:#f24822;--rs-color-background-critical-faded:#ffe2e0;--rs-color-background-critical-highlighted:#dc3412;--rs-color-border-critical:#dc3412;--rs-color-border-critical-faded:#ffc7c2;--rs-color-foreground-critical:#dc3412;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#fffae9;--rs-color-background-warning-highlighted:#edc113;--rs-color-border-warning:#cfa90f;--rs-color-border-warning-faded:#faedbb;--rs-color-foreground-warning:#7b6305;--rs-color-background-positive:#14ae5c;--rs-color-background-positive-faded:#daecdf;--rs-color-background-positive-highlighted:#009951;--rs-color-border-positive:#009951;--rs-color-border-positive-faded:#bbddc6;--rs-color-foreground-positive:#009951;--rs-color-background-neutral:#dfe2ea;--rs-color-background-neutral-faded:#f5f5f5;--rs-color-background-neutral-highlighted:#d4d8e3;--rs-color-border-neutral:#e6e6e6;--rs-color-border-neutral-faded:#e6e6e6;--rs-color-foreground-neutral:#191919;--rs-color-foreground-neutral-faded:#474747;--rs-color-background-disabled:#e4e4e4;--rs-color-background-disabled-faded:#f5f5f5;--rs-color-border-disabled:#e6e6e6;--rs-color-foreground-disabled:#b2b2b2;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#fafafa;--rs-color-rgb-background-primary:13,153,255;--rs-color-rgb-background-primary-faded:229,244,255;--rs-color-rgb-background-primary-highlighted:0,123,229;--rs-color-rgb-border-primary:0,123,229;--rs-color-rgb-border-primary-faded:189,227,255;--rs-color-rgb-background-critical:242,72,34;--rs-color-rgb-background-critical-faded:255,226,224;--rs-color-rgb-background-critical-highlighted:220,52,18;--rs-color-rgb-border-critical:220,52,18;--rs-color-rgb-border-critical-faded:255,199,194;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:255,250,233;--rs-color-rgb-background-warning-highlighted:237,193,19;--rs-color-rgb-border-warning:207,169,15;--rs-color-rgb-border-warning-faded:250,237,187;--rs-color-rgb-background-positive:20,174,92;--rs-color-rgb-background-positive-faded:218,236,223;--rs-color-rgb-background-positive-highlighted:0,153,81;--rs-color-rgb-border-positive:0,153,81;--rs-color-rgb-border-positive-faded:187,221,198;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:223,226,234;--rs-color-rgb-background-neutral-faded:245,245,245;--rs-color-rgb-background-neutral-highlighted:212,216,227;--rs-color-rgb-border-neutral:230,230,230;--rs-color-rgb-border-neutral-faded:230,230,230;--rs-color-rgb-background-disabled:228,228,228;--rs-color-rgb-background-disabled-faded:245,245,245;--rs-color-rgb-border-disabled:230,230,230;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:250,250,250}[data-rs-theme=figma][data-rs-color-mode=dark]{--rs-color-background-primary:#0c8ce9;--rs-color-background-primary-faded:#394360;--rs-color-background-primary-highlighted:#0a6dc2;--rs-color-border-primary:#7cc4f8;--rs-color-border-primary-faded:#2a4d72;--rs-color-foreground-primary:#7cc4f8;--rs-color-background-critical:#e03e1a;--rs-color-background-critical-faded:#60332a;--rs-color-background-critical-highlighted:#c4381c;--rs-color-border-critical:#fca397;--rs-color-border-critical-faded:#803226;--rs-color-foreground-critical:#fca397;--rs-color-background-warning:#f1c512;--rs-color-background-warning-faded:#2c271f;--rs-color-background-warning-highlighted:#fed014;--rs-color-border-warning:#b4920a;--rs-color-border-warning-faded:#3d3628;--rs-color-foreground-warning:#b4920c;--rs-color-background-positive:#198f51;--rs-color-background-positive-faded:#3d5749;--rs-color-background-positive-highlighted:#078348;--rs-color-border-positive:#79d297;--rs-color-border-positive-faded:#086338;--rs-color-foreground-positive:#79d297;--rs-color-background-neutral:#444;--rs-color-background-neutral-faded:#383838;--rs-color-background-neutral-highlighted:#525252;--rs-color-border-neutral:#444;--rs-color-border-neutral-faded:#444;--rs-color-foreground-neutral:#fff;--rs-color-foreground-neutral-faded:#b2b2b2;--rs-color-background-disabled:#474747;--rs-color-background-disabled-faded:#3a3a3a;--rs-color-border-disabled:#3e3e3e;--rs-color-foreground-disabled:#656565;--rs-color-background-elevation-base:#2c2c2c;--rs-color-background-elevation-raised:#2c2c2c;--rs-color-background-elevation-overlay:#2c2c2c;--rs-color-background-page:#2c2c2c;--rs-color-background-page-faded:#1e1e1e;--rs-color-rgb-background-primary:12,140,233;--rs-color-rgb-background-primary-faded:57,67,96;--rs-color-rgb-background-primary-highlighted:10,109,194;--rs-color-rgb-border-primary:124,196,248;--rs-color-rgb-border-primary-faded:42,77,114;--rs-color-rgb-background-critical:224,62,26;--rs-color-rgb-background-critical-faded:96,51,42;--rs-color-rgb-background-critical-highlighted:196,56,28;--rs-color-rgb-border-critical:252,163,151;--rs-color-rgb-border-critical-faded:128,50,38;--rs-color-rgb-background-warning:241,197,18;--rs-color-rgb-background-warning-faded:44,39,31;--rs-color-rgb-background-warning-highlighted:254,208,20;--rs-color-rgb-border-warning:180,146,10;--rs-color-rgb-border-warning-faded:61,54,40;--rs-color-rgb-background-positive:25,143,81;--rs-color-rgb-background-positive-faded:61,87,73;--rs-color-rgb-background-positive-highlighted:7,131,72;--rs-color-rgb-border-positive:121,210,151;--rs-color-rgb-border-positive-faded:8,99,56;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:68,68,68;--rs-color-rgb-background-neutral-faded:56,56,56;--rs-color-rgb-background-neutral-highlighted:82,82,82;--rs-color-rgb-border-neutral:68,68,68;--rs-color-rgb-border-neutral-faded:68,68,68;--rs-color-rgb-background-disabled:71,71,71;--rs-color-rgb-background-disabled-faded:58,58,58;--rs-color-rgb-border-disabled:62,62,62;--rs-color-rgb-background-elevation-base:44,44,44;--rs-color-rgb-background-elevation-raised:44,44,44;--rs-color-rgb-background-elevation-overlay:44,44,44;--rs-color-rgb-background-page:44,44,44;--rs-color-rgb-background-page-faded:30,30,30}
|
package/themes/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type * as T from "./_generator/types";
|
2
2
|
import type { FullThemeDefinition } from "./_generator/tokens/types";
|
3
|
-
export
|
3
|
+
export { default as baseThemeDefinition } from "./_generator/definitions/reshaped";
|
4
4
|
export declare const generateThemeColors: (options: {
|
5
5
|
primary: string;
|
6
6
|
critical?: string;
|
package/themes/index.js
CHANGED
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getThemeCSS = exports.generateThemeColors = exports.baseThemeDefinition = void 0;
|
7
7
|
const transform_1 = __importDefault(require("./_generator/transform"));
|
8
8
|
const generateColors_1 = __importDefault(require("./_generator/utilities/generateColors"));
|
9
|
-
|
10
|
-
|
11
|
-
const mergeDefinitions_1 = __importDefault(require("./_generator/utilities/mergeDefinitions"));
|
12
|
-
exports.baseThemeDefinition = (0, mergeDefinitions_1.default)(reshaped_1.default, base_1.default);
|
9
|
+
var reshaped_1 = require("./_generator/definitions/reshaped");
|
10
|
+
Object.defineProperty(exports, "baseThemeDefinition", { enumerable: true, get: function () { return __importDefault(reshaped_1).default; } });
|
13
11
|
const generateThemeColors = (options) => {
|
14
12
|
return (0, generateColors_1.default)(options);
|
15
13
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
@custom-media --rs-viewport-s (max-width: 659px);@custom-media --rs-viewport-m (min-width: 660px);@custom-media --rs-viewport-l (min-width: 900px);@custom-media --rs-viewport-xl (min-width: 1280px);
|
@@ -1 +1 @@
|
|
1
|
-
[data-rs-theme=reshaped]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-heavy:800;--rs-font-weight-black:900;--rs-font-size-title-1:96px;--rs-line-height-title-1:100px;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-heavy);--rs-font-size-title-2:80px;--rs-line-height-title-2:84px;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-heavy);--rs-font-size-title-3:64px;--rs-line-height-title-3:68px;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-heavy);--rs-font-size-title-4:56px;--rs-line-height-title-4:60px;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-font-size-title-5:48px;--rs-line-height-title-5:52px;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-font-size-title-6:36px;--rs-line-height-title-6:40px;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-font-size-featured-1:32px;--rs-line-height-featured-1:40px;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-font-size-featured-2:24px;--rs-line-height-featured-2:32px;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-font-size-featured-3:20px;--rs-line-height-featured-3:28px;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-font-size-body-1:18px;--rs-line-height-body-1:28px;--rs-font-family-body-1:var(--rs-font-family-body);--rs-font-size-body-2:16px;--rs-line-height-body-2:24px;--rs-font-family-body-2:var(--rs-font-family-body);--rs-font-size-body-3:14px;--rs-line-height-body-3:20px;--rs-font-family-body-3:var(--rs-font-family-body);--rs-font-size-caption-1:12px;--rs-line-height-caption-1:16px;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-font-size-caption-2:10px;--rs-line-height-caption-2:12px;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-unit-base:4px;--rs-unit-radius-small:4px;--rs-unit-radius-medium:8px;--rs-unit-radius-large:12px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-positive:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 2px 3px 0px rgba(0,0,0,.1),0px 1px 2px -1px rgba(0,0,0,.1);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07)}[data-rs-theme=reshaped][data-rs-color-mode=light]{--rs-color-background-primary:#5a58f2;--rs-color-background-primary-faded:#
|
1
|
+
[data-rs-theme=reshaped]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-heavy:800;--rs-font-weight-black:900;--rs-font-size-title-1:96px;--rs-line-height-title-1:100px;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-heavy);--rs-font-size-title-2:80px;--rs-line-height-title-2:84px;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-heavy);--rs-font-size-title-3:64px;--rs-line-height-title-3:68px;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-heavy);--rs-font-size-title-4:56px;--rs-line-height-title-4:60px;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-font-size-title-5:48px;--rs-line-height-title-5:52px;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-font-size-title-6:36px;--rs-line-height-title-6:40px;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-font-size-featured-1:32px;--rs-line-height-featured-1:40px;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-font-size-featured-2:24px;--rs-line-height-featured-2:32px;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-font-size-featured-3:20px;--rs-line-height-featured-3:28px;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-font-size-body-1:18px;--rs-line-height-body-1:28px;--rs-font-family-body-1:var(--rs-font-family-body);--rs-font-size-body-2:16px;--rs-line-height-body-2:24px;--rs-font-family-body-2:var(--rs-font-family-body);--rs-font-size-body-3:14px;--rs-line-height-body-3:20px;--rs-font-family-body-3:var(--rs-font-family-body);--rs-font-size-caption-1:12px;--rs-line-height-caption-1:16px;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-font-size-caption-2:10px;--rs-line-height-caption-2:12px;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-unit-base:4px;--rs-unit-radius-small:4px;--rs-unit-radius-medium:8px;--rs-unit-radius-large:12px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-color-brand:#5a58f2;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-warning:#000;--rs-color-on-background-positive:#fff;--rs-color-on-brand:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 2px 3px 0px rgba(0,0,0,.1),0px 1px 2px -1px rgba(0,0,0,.1);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07)}[data-rs-theme=reshaped][data-rs-color-mode=light]{--rs-color-background-primary:#5a58f2;--rs-color-background-primary-faded:#ecebfe;--rs-color-background-primary-highlighted:#4d4af0;--rs-color-border-primary:#3b38ed;--rs-color-border-primary-faded:#dedcfb;--rs-color-foreground-primary:#4f4cf0;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#fdeded;--rs-color-background-critical-highlighted:#d02828;--rs-color-border-critical:#bf2424;--rs-color-border-critical-faded:#fadbdb;--rs-color-foreground-critical:#c42525;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#fffae9;--rs-color-background-warning-highlighted:#edc113;--rs-color-border-warning:#cfa90f;--rs-color-border-warning-faded:#faedbb;--rs-color-foreground-warning:#7b6305;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#edfdf5;--rs-color-background-positive-highlighted:#0f7d49;--rs-color-border-positive:#0c6e40;--rs-color-border-positive-faded:#d0f3e2;--rs-color-foreground-positive:#0d7544;--rs-color-background-neutral:#dfe2ea;--rs-color-background-neutral-faded:#f7f8fa;--rs-color-background-neutral-highlighted:#d2d7e2;--rs-color-border-neutral:#b3bbce;--rs-color-border-neutral-faded:#e5e5e7;--rs-color-foreground-neutral:#14181f;--rs-color-foreground-neutral-faded:#5b667e;--rs-color-background-disabled:#eceef2;--rs-color-background-disabled-faded:#f5f6f9;--rs-color-border-disabled:#dfe2ea;--rs-color-foreground-disabled:#c6ccda;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#f9f9fb;--rs-color-rgb-background-primary:90,88,242;--rs-color-rgb-background-primary-faded:236,235,254;--rs-color-rgb-background-primary-highlighted:77,74,240;--rs-color-rgb-border-primary:59,56,237;--rs-color-rgb-border-primary-faded:222,220,251;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:253,237,237;--rs-color-rgb-background-critical-highlighted:208,40,40;--rs-color-rgb-border-critical:191,36,36;--rs-color-rgb-border-critical-faded:250,219,219;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:255,250,233;--rs-color-rgb-background-warning-highlighted:237,193,19;--rs-color-rgb-border-warning:207,169,15;--rs-color-rgb-border-warning-faded:250,237,187;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:237,253,245;--rs-color-rgb-background-positive-highlighted:15,125,73;--rs-color-rgb-border-positive:12,110,64;--rs-color-rgb-border-positive-faded:208,243,226;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:223,226,234;--rs-color-rgb-background-neutral-faded:247,248,250;--rs-color-rgb-background-neutral-highlighted:210,215,226;--rs-color-rgb-border-neutral:179,187,206;--rs-color-rgb-border-neutral-faded:229,229,231;--rs-color-rgb-background-disabled:236,238,242;--rs-color-rgb-background-disabled-faded:245,246,249;--rs-color-rgb-border-disabled:223,226,234;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:249,249,251}[data-rs-theme=reshaped][data-rs-color-mode=dark]{--rs-color-background-primary:#524fea;--rs-color-background-primary-faded:#252544;--rs-color-background-primary-highlighted:#5f5ced;--rs-color-border-primary:#8c8bf3;--rs-color-border-primary-faded:#323164;--rs-color-foreground-primary:#8b8af7;--rs-color-background-critical:#d02626;--rs-color-background-critical-faded:#3e1f1f;--rs-color-background-critical-highlighted:#e22a2a;--rs-color-border-critical:#f46969;--rs-color-border-critical-faded:#582929;--rs-color-foreground-critical:#f36a6a;--rs-color-background-warning:#f1c512;--rs-color-background-warning-faded:#2c271f;--rs-color-background-warning-highlighted:#fed014;--rs-color-border-warning:#b4920a;--rs-color-border-warning-faded:#3d3628;--rs-color-foreground-warning:#b4920c;--rs-color-background-positive:#14784a;--rs-color-background-positive-faded:#1f2a23;--rs-color-background-positive-highlighted:#178351;--rs-color-border-positive:#21ab6b;--rs-color-border-positive-faded:#293b2f;--rs-color-foreground-positive:#18ab66;--rs-color-background-neutral:#494f60;--rs-color-background-neutral-faded:#222835;--rs-color-background-neutral-highlighted:#52586b;--rs-color-border-neutral:#4c5264;--rs-color-border-neutral-faded:#2d374c;--rs-color-foreground-neutral:#eff1f5;--rs-color-foreground-neutral-faded:#c0c6d6;--rs-color-background-disabled:#1e212a;--rs-color-background-disabled-faded:#171921;--rs-color-border-disabled:#262a34;--rs-color-foreground-disabled:#434959;--rs-color-background-elevation-base:#15171e;--rs-color-background-elevation-raised:#191b23;--rs-color-background-elevation-overlay:#1c1f28;--rs-color-background-page:#0f1116;--rs-color-background-page-faded:#111319;--rs-color-rgb-background-primary:82,79,234;--rs-color-rgb-background-primary-faded:37,37,68;--rs-color-rgb-background-primary-highlighted:95,92,237;--rs-color-rgb-border-primary:140,139,243;--rs-color-rgb-border-primary-faded:50,49,100;--rs-color-rgb-background-critical:208,38,38;--rs-color-rgb-background-critical-faded:62,31,31;--rs-color-rgb-background-critical-highlighted:226,42,42;--rs-color-rgb-border-critical:244,105,105;--rs-color-rgb-border-critical-faded:88,41,41;--rs-color-rgb-background-warning:241,197,18;--rs-color-rgb-background-warning-faded:44,39,31;--rs-color-rgb-background-warning-highlighted:254,208,20;--rs-color-rgb-border-warning:180,146,10;--rs-color-rgb-border-warning-faded:61,54,40;--rs-color-rgb-background-positive:20,120,74;--rs-color-rgb-background-positive-faded:31,42,35;--rs-color-rgb-background-positive-highlighted:23,131,81;--rs-color-rgb-border-positive:33,171,107;--rs-color-rgb-border-positive-faded:41,59,47;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:73,79,96;--rs-color-rgb-background-neutral-faded:34,40,53;--rs-color-rgb-background-neutral-highlighted:82,88,107;--rs-color-rgb-border-neutral:76,82,100;--rs-color-rgb-border-neutral-faded:45,55,76;--rs-color-rgb-background-disabled:30,33,42;--rs-color-rgb-background-disabled-faded:23,25,33;--rs-color-rgb-border-disabled:38,42,52;--rs-color-rgb-background-elevation-base:21,23,30;--rs-color-rgb-background-elevation-raised:25,27,35;--rs-color-rgb-background-elevation-overlay:28,31,40;--rs-color-rgb-background-page:15,17,22;--rs-color-rgb-background-page-faded:17,19,25}
|
@@ -0,0 +1 @@
|
|
1
|
+
@custom-media --rs-viewport-s (max-width: 659px);@custom-media --rs-viewport-m (min-width: 660px);@custom-media --rs-viewport-l (min-width: 900px);@custom-media --rs-viewport-xl (min-width: 1280px);
|
package/themes/slate/theme.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
[data-rs-theme=slate]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-heavy:800;--rs-font-weight-black:900;--rs-font-size-title-1:96px;--rs-line-height-title-1:100px;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-heavy);--rs-font-size-title-2:80px;--rs-line-height-title-2:84px;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-heavy);--rs-font-size-title-3:64px;--rs-line-height-title-3:68px;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-heavy);--rs-font-size-title-4:56px;--rs-line-height-title-4:60px;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-font-size-title-5:48px;--rs-line-height-title-5:52px;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-font-size-title-6:36px;--rs-line-height-title-6:40px;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-font-size-featured-1:32px;--rs-line-height-featured-1:40px;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-font-size-featured-2:24px;--rs-line-height-featured-2:32px;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-font-size-featured-3:20px;--rs-line-height-featured-3:28px;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-font-size-body-1:18px;--rs-line-height-body-1:28px;--rs-font-family-body-1:var(--rs-font-family-body);--rs-font-size-body-2:16px;--rs-line-height-body-2:24px;--rs-font-family-body-2:var(--rs-font-family-body);--rs-font-size-body-3:14px;--rs-line-height-body-3:20px;--rs-font-family-body-3:var(--rs-font-family-body);--rs-font-size-caption-1:12px;--rs-line-height-caption-1:16px;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-font-size-caption-2:10px;--rs-line-height-caption-2:12px;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-unit-base:4px;--rs-unit-radius-small:2px;--rs-unit-radius-medium:4px;--rs-unit-radius-large:6px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-positive:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 2px 3px 0px rgba(0,0,0,.1),0px 1px 2px -1px rgba(0,0,0,.1);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07)}[data-rs-theme=slate][data-rs-color-mode=light]{--rs-color-background-primary:#2383e2;--rs-color-background-primary-faded:#e5f4fb;--rs-color-background-primary-highlighted:#3273cc;--rs-color-border-primary:#3d76c7;--rs-color-border-primary-faded:#c6d9f4;--rs-color-foreground-primary:#2383e2;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#
|
1
|
+
[data-rs-theme=slate]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-heavy:800;--rs-font-weight-black:900;--rs-font-size-title-1:96px;--rs-line-height-title-1:100px;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-heavy);--rs-font-size-title-2:80px;--rs-line-height-title-2:84px;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-heavy);--rs-font-size-title-3:64px;--rs-line-height-title-3:68px;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-heavy);--rs-font-size-title-4:56px;--rs-line-height-title-4:60px;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-font-size-title-5:48px;--rs-line-height-title-5:52px;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-font-size-title-6:36px;--rs-line-height-title-6:40px;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-font-size-featured-1:32px;--rs-line-height-featured-1:40px;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-font-size-featured-2:24px;--rs-line-height-featured-2:32px;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-font-size-featured-3:20px;--rs-line-height-featured-3:28px;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-font-size-body-1:18px;--rs-line-height-body-1:28px;--rs-font-family-body-1:var(--rs-font-family-body);--rs-font-size-body-2:16px;--rs-line-height-body-2:24px;--rs-font-family-body-2:var(--rs-font-family-body);--rs-font-size-body-3:14px;--rs-line-height-body-3:20px;--rs-font-family-body-3:var(--rs-font-family-body);--rs-font-size-caption-1:12px;--rs-line-height-caption-1:16px;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-font-size-caption-2:10px;--rs-line-height-caption-2:12px;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-unit-base:4px;--rs-unit-radius-small:2px;--rs-unit-radius-medium:4px;--rs-unit-radius-large:6px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-color-brand:#5a58f2;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-warning:#000;--rs-color-on-background-positive:#fff;--rs-color-on-brand:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 2px 3px 0px rgba(0,0,0,.1),0px 1px 2px -1px rgba(0,0,0,.1);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07)}[data-rs-theme=slate][data-rs-color-mode=light]{--rs-color-background-primary:#2383e2;--rs-color-background-primary-faded:#e5f4fb;--rs-color-background-primary-highlighted:#3273cc;--rs-color-border-primary:#3d76c7;--rs-color-border-primary-faded:#c6d9f4;--rs-color-foreground-primary:#2383e2;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#fdeded;--rs-color-background-critical-highlighted:#d02828;--rs-color-border-critical:#bf2424;--rs-color-border-critical-faded:#fadbdb;--rs-color-foreground-critical:#c42525;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#fffae9;--rs-color-background-warning-highlighted:#edc113;--rs-color-border-warning:#cfa90f;--rs-color-border-warning-faded:#faedbb;--rs-color-foreground-warning:#7b6305;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#edfdf5;--rs-color-background-positive-highlighted:#0f7d49;--rs-color-border-positive:#0c6e40;--rs-color-border-positive-faded:#d0f3e2;--rs-color-foreground-positive:#0d7544;--rs-color-background-neutral:#e3e3e5;--rs-color-background-neutral-faded:#f2f3f5;--rs-color-background-neutral-highlighted:#dedee1;--rs-color-border-neutral:#d2d2d2;--rs-color-border-neutral-faded:#e2e2e2;--rs-color-foreground-neutral:#161a26;--rs-color-foreground-neutral-faded:#717787;--rs-color-background-disabled:#eceef3;--rs-color-background-disabled-faded:#f4f5f7;--rs-color-border-disabled:#e2e2e2;--rs-color-foreground-disabled:#d4d0d0;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#f7f7f5;--rs-color-rgb-background-primary:35,131,226;--rs-color-rgb-background-primary-faded:229,244,251;--rs-color-rgb-background-primary-highlighted:50,115,204;--rs-color-rgb-border-primary:61,118,199;--rs-color-rgb-border-primary-faded:198,217,244;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:253,237,237;--rs-color-rgb-background-critical-highlighted:208,40,40;--rs-color-rgb-border-critical:191,36,36;--rs-color-rgb-border-critical-faded:250,219,219;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:255,250,233;--rs-color-rgb-background-warning-highlighted:237,193,19;--rs-color-rgb-border-warning:207,169,15;--rs-color-rgb-border-warning-faded:250,237,187;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:237,253,245;--rs-color-rgb-background-positive-highlighted:15,125,73;--rs-color-rgb-border-positive:12,110,64;--rs-color-rgb-border-positive-faded:208,243,226;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:227,227,229;--rs-color-rgb-background-neutral-faded:242,243,245;--rs-color-rgb-background-neutral-highlighted:222,222,225;--rs-color-rgb-border-neutral:210,210,210;--rs-color-rgb-border-neutral-faded:226,226,226;--rs-color-rgb-background-disabled:236,238,243;--rs-color-rgb-background-disabled-faded:244,245,247;--rs-color-rgb-border-disabled:226,226,226;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:247,247,245}[data-rs-theme=slate][data-rs-color-mode=dark]{--rs-color-background-primary:#4281db;--rs-color-background-primary-faded:#1e2c45;--rs-color-background-primary-highlighted:#3273cc;--rs-color-border-primary:#5a91e0;--rs-color-border-primary-faded:#163a6a;--rs-color-foreground-primary:#5098ff;--rs-color-background-critical:#d02626;--rs-color-background-critical-faded:#3e1f1f;--rs-color-background-critical-highlighted:#e22a2a;--rs-color-border-critical:#f46969;--rs-color-border-critical-faded:#582929;--rs-color-foreground-critical:#f36a6a;--rs-color-background-warning:#f1c512;--rs-color-background-warning-faded:#2c271f;--rs-color-background-warning-highlighted:#fed014;--rs-color-border-warning:#b4920a;--rs-color-border-warning-faded:#3d3628;--rs-color-foreground-warning:#b4920c;--rs-color-background-positive:#14784a;--rs-color-background-positive-faded:#1f2a23;--rs-color-background-positive-highlighted:#178351;--rs-color-border-positive:#21ab6b;--rs-color-border-positive-faded:#293b2f;--rs-color-foreground-positive:#18ab66;--rs-color-background-neutral:#4f5155;--rs-color-background-neutral-faded:#34363f;--rs-color-background-neutral-highlighted:#595c60;--rs-color-border-neutral:#414141;--rs-color-border-neutral-faded:#464646;--rs-color-foreground-neutral:#f2f3f5;--rs-color-foreground-neutral-faded:#9f9e9e;--rs-color-background-disabled:#313131;--rs-color-background-disabled-faded:#262626;--rs-color-border-disabled:#404040;--rs-color-foreground-disabled:#656565;--rs-color-background-elevation-base:#232323;--rs-color-background-elevation-raised:#262626;--rs-color-background-elevation-overlay:#292929;--rs-color-background-page:#191919;--rs-color-background-page-faded:#202020;--rs-color-rgb-background-primary:66,129,219;--rs-color-rgb-background-primary-faded:30,44,69;--rs-color-rgb-background-primary-highlighted:50,115,204;--rs-color-rgb-border-primary:90,145,224;--rs-color-rgb-border-primary-faded:22,58,106;--rs-color-rgb-background-critical:208,38,38;--rs-color-rgb-background-critical-faded:62,31,31;--rs-color-rgb-background-critical-highlighted:226,42,42;--rs-color-rgb-border-critical:244,105,105;--rs-color-rgb-border-critical-faded:88,41,41;--rs-color-rgb-background-warning:241,197,18;--rs-color-rgb-background-warning-faded:44,39,31;--rs-color-rgb-background-warning-highlighted:254,208,20;--rs-color-rgb-border-warning:180,146,10;--rs-color-rgb-border-warning-faded:61,54,40;--rs-color-rgb-background-positive:20,120,74;--rs-color-rgb-background-positive-faded:31,42,35;--rs-color-rgb-background-positive-highlighted:23,131,81;--rs-color-rgb-border-positive:33,171,107;--rs-color-rgb-border-positive-faded:41,59,47;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:79,81,85;--rs-color-rgb-background-neutral-faded:52,54,63;--rs-color-rgb-background-neutral-highlighted:89,92,96;--rs-color-rgb-border-neutral:65,65,65;--rs-color-rgb-border-neutral-faded:70,70,70;--rs-color-rgb-background-disabled:49,49,49;--rs-color-rgb-background-disabled-faded:38,38,38;--rs-color-rgb-border-disabled:64,64,64;--rs-color-rgb-background-elevation-base:35,35,35;--rs-color-rgb-background-elevation-raised:38,38,38;--rs-color-rgb-background-elevation-overlay:41,41,41;--rs-color-rgb-background-page:25,25,25;--rs-color-rgb-background-page-faded:32,32,32}
|
package/types/config.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { PartialThemeDefinition, ColorHue } from "../themes/_generator/tokens/types";
|
2
2
|
export type ReshapedConfig = {
|
3
|
-
themes?: Record<string,
|
4
|
-
themeFragments?: Record<string,
|
3
|
+
themes?: Record<string, PartialThemeDefinition>;
|
4
|
+
themeFragments?: Record<string, PartialThemeDefinition>;
|
5
5
|
themeOptions?: {
|
6
6
|
generateOnColorsFor?: string[];
|
7
7
|
onColorValues?: {
|
@@ -11,8 +11,7 @@ const ExampleItem = (props) => {
|
|
11
11
|
const { children } = props;
|
12
12
|
const title = typeof props.title === "string" ? [props.title] : props.title;
|
13
13
|
return (React.createElement(View, { borderColor: "neutral-faded", borderRadius: "medium", overflow: "hidden" },
|
14
|
-
React.createElement(View, { paddingInline: 4, paddingBlock: 3, backgroundColor: "neutral-faded" }, title
|
15
|
-
title.map((line, index) => (React.createElement(Text, { variant: "body-3", color: index > 0 ? "neutral-faded" : "neutral", key: index }, line)))),
|
14
|
+
title && (React.createElement(View, { paddingInline: 4, paddingBlock: 3, backgroundColor: "neutral-faded" }, title.map((line, index) => (React.createElement(Text, { variant: "body-3", color: index > 0 ? "neutral-faded" : "neutral", key: index }, line))))),
|
16
15
|
React.createElement(View, { padding: 4, className: s.root }, children)));
|
17
16
|
};
|
18
17
|
Example.Item = ExampleItem;
|