datocms-react-ui 2.1.4 → 3.0.1-alpha.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/dist/cjs/Button/styles.module.css.json +1 -1
- package/dist/cjs/ButtonGroup/Button/styles.module.css.json +1 -1
- package/dist/cjs/ButtonGroup/Group/styles.module.css.json +1 -1
- package/dist/cjs/Canvas/index.js +181 -276
- package/dist/cjs/Canvas/index.js.map +1 -1
- package/dist/cjs/Canvas/styles.module.css.json +1 -1
- package/dist/cjs/ContextInspector/styles.module.css.json +1 -1
- package/dist/cjs/Dropdown/styles.module.css.json +1 -1
- package/dist/cjs/FieldError/styles.module.css.json +1 -1
- package/dist/cjs/FieldHint/styles.module.css.json +1 -1
- package/dist/cjs/FormLabel/styles.module.css.json +1 -1
- package/dist/cjs/HotKey/styles.module.css.json +1 -1
- package/dist/cjs/Section/styles.module.css.json +1 -1
- package/dist/cjs/SelectInput/index.js +41 -22
- package/dist/cjs/SelectInput/index.js.map +1 -1
- package/dist/cjs/SidebarPanel/index.js +4 -11
- package/dist/cjs/SidebarPanel/index.js.map +1 -1
- package/dist/cjs/SidebarPanel/styles.module.css.json +1 -1
- package/dist/cjs/Spinner/styles.module.css.json +1 -1
- package/dist/cjs/SplitView/SplitViewSash/styles.module.css.json +1 -1
- package/dist/cjs/SwitchField/styles.module.css.json +1 -1
- package/dist/cjs/SwitchInput/styles.module.css.json +1 -1
- package/dist/cjs/TextInput/styles.module.css.json +1 -1
- package/dist/cjs/TextareaInput/styles.module.css.json +1 -1
- package/dist/cjs/Toolbar/Button/styles.module.css.json +1 -1
- package/dist/cjs/Toolbar/Toolbar/index.js +3 -3
- package/dist/cjs/Toolbar/Toolbar/styles.module.css.json +1 -1
- package/dist/cjs/Tooltip/TooltipContent/styles.module.css.json +1 -1
- package/dist/cjs/Tooltip/TooltipDelayGroup/index.js +2 -2
- package/dist/cjs/VerticalSplit/index.js +4 -4
- package/dist/cjs/VerticalSplit/styles.module.css.json +1 -1
- package/dist/cjs/generateStyleFromCtx/index.js +133 -2
- package/dist/cjs/generateStyleFromCtx/index.js.map +1 -1
- package/dist/cjs/icons.js +8 -8
- package/dist/cjs/icons.js.map +1 -1
- package/dist/esm/Button/styles.module.css.json +1 -1
- package/dist/esm/ButtonGroup/Button/styles.module.css.json +1 -1
- package/dist/esm/ButtonGroup/Group/styles.module.css.json +1 -1
- package/dist/esm/Canvas/index.d.ts +181 -276
- package/dist/esm/Canvas/index.js +181 -276
- package/dist/esm/Canvas/index.js.map +1 -1
- package/dist/esm/Canvas/styles.module.css.json +1 -1
- package/dist/esm/ContextInspector/styles.module.css.json +1 -1
- package/dist/esm/Dropdown/styles.module.css.json +1 -1
- package/dist/esm/FieldError/styles.module.css.json +1 -1
- package/dist/esm/FieldHint/styles.module.css.json +1 -1
- package/dist/esm/FormLabel/styles.module.css.json +1 -1
- package/dist/esm/HotKey/styles.module.css.json +1 -1
- package/dist/esm/Section/styles.module.css.json +1 -1
- package/dist/esm/SelectInput/index.js +41 -22
- package/dist/esm/SelectInput/index.js.map +1 -1
- package/dist/esm/SidebarPanel/index.d.ts +2 -2
- package/dist/esm/SidebarPanel/index.js +4 -11
- package/dist/esm/SidebarPanel/index.js.map +1 -1
- package/dist/esm/SidebarPanel/styles.module.css.json +1 -1
- package/dist/esm/Spinner/styles.module.css.json +1 -1
- package/dist/esm/SplitView/SplitViewSash/styles.module.css.json +1 -1
- package/dist/esm/SwitchField/styles.module.css.json +1 -1
- package/dist/esm/SwitchInput/styles.module.css.json +1 -1
- package/dist/esm/TextInput/styles.module.css.json +1 -1
- package/dist/esm/TextareaInput/styles.module.css.json +1 -1
- package/dist/esm/Toolbar/Button/styles.module.css.json +1 -1
- package/dist/esm/Toolbar/Toolbar/index.d.ts +3 -3
- package/dist/esm/Toolbar/Toolbar/index.js +3 -3
- package/dist/esm/Toolbar/Toolbar/styles.module.css.json +1 -1
- package/dist/esm/Tooltip/TooltipContent/styles.module.css.json +1 -1
- package/dist/esm/Tooltip/TooltipDelayGroup/index.d.ts +2 -2
- package/dist/esm/Tooltip/TooltipDelayGroup/index.js +2 -2
- package/dist/esm/VerticalSplit/index.d.ts +4 -4
- package/dist/esm/VerticalSplit/index.js +4 -4
- package/dist/esm/VerticalSplit/styles.module.css.json +1 -1
- package/dist/esm/generateStyleFromCtx/index.js +133 -2
- package/dist/esm/generateStyleFromCtx/index.js.map +1 -1
- package/dist/esm/icons.js +8 -8
- package/dist/esm/icons.js.map +1 -1
- package/dist/types/Canvas/index.d.ts +181 -276
- package/dist/types/SidebarPanel/index.d.ts +2 -2
- package/dist/types/Toolbar/Toolbar/index.d.ts +3 -3
- package/dist/types/Tooltip/TooltipDelayGroup/index.d.ts +2 -2
- package/dist/types/VerticalSplit/index.d.ts +4 -4
- package/package.json +3 -3
- package/src/Button/styles.module.css +19 -19
- package/src/Button/styles.module.css.json +1 -1
- package/src/ButtonGroup/Button/styles.module.css +15 -17
- package/src/ButtonGroup/Button/styles.module.css.json +1 -1
- package/src/ButtonGroup/Group/styles.module.css +1 -1
- package/src/ButtonGroup/Group/styles.module.css.json +1 -1
- package/src/Canvas/index.tsx +181 -276
- package/src/Canvas/styles.module.css +75 -16
- package/src/Canvas/styles.module.css.json +1 -1
- package/src/ContextInspector/styles.module.css +10 -10
- package/src/ContextInspector/styles.module.css.json +1 -1
- package/src/Dropdown/styles.module.css +30 -28
- package/src/Dropdown/styles.module.css.json +1 -1
- package/src/FieldError/styles.module.css +1 -1
- package/src/FieldError/styles.module.css.json +1 -1
- package/src/FieldHint/styles.module.css +1 -1
- package/src/FieldHint/styles.module.css.json +1 -1
- package/src/FormLabel/styles.module.css +2 -2
- package/src/FormLabel/styles.module.css.json +1 -1
- package/src/HotKey/styles.module.css +1 -1
- package/src/HotKey/styles.module.css.json +1 -1
- package/src/Section/styles.module.css +8 -8
- package/src/Section/styles.module.css.json +1 -1
- package/src/SelectInput/index.tsx +53 -26
- package/src/SidebarPanel/index.tsx +4 -29
- package/src/SidebarPanel/styles.module.css +6 -6
- package/src/SidebarPanel/styles.module.css.json +1 -1
- package/src/Spinner/styles.module.css +1 -1
- package/src/Spinner/styles.module.css.json +1 -1
- package/src/SplitView/SplitViewSash/styles.module.css +7 -7
- package/src/SplitView/SplitViewSash/styles.module.css.json +1 -1
- package/src/SwitchField/styles.module.css +1 -1
- package/src/SwitchField/styles.module.css.json +1 -1
- package/src/SwitchInput/styles.module.css +16 -13
- package/src/SwitchInput/styles.module.css.json +1 -1
- package/src/TextInput/styles.module.css +13 -11
- package/src/TextInput/styles.module.css.json +1 -1
- package/src/TextareaInput/styles.module.css +13 -11
- package/src/TextareaInput/styles.module.css.json +1 -1
- package/src/Toolbar/Button/styles.module.css +4 -4
- package/src/Toolbar/Button/styles.module.css.json +1 -1
- package/src/Toolbar/Toolbar/index.tsx +3 -3
- package/src/Toolbar/Toolbar/styles.module.css +2 -2
- package/src/Toolbar/Toolbar/styles.module.css.json +1 -1
- package/src/Tooltip/TooltipContent/styles.module.css +2 -2
- package/src/Tooltip/TooltipContent/styles.module.css.json +1 -1
- package/src/Tooltip/TooltipDelayGroup/index.tsx +2 -2
- package/src/VerticalSplit/index.tsx +4 -4
- package/src/VerticalSplit/styles.module.css +7 -11
- package/src/VerticalSplit/styles.module.css.json +1 -1
- package/src/generateStyleFromCtx/index.ts +153 -0
- package/src/icons.tsx +8 -0
- package/styles.css +29 -1
- package/types.json +517 -389
|
@@ -25,19 +25,19 @@ import RawSelect from 'react-select';
|
|
|
25
25
|
import RawAsyncSelect from 'react-select/async';
|
|
26
26
|
import RawAsyncCreatableSelect from 'react-select/async-creatable';
|
|
27
27
|
import RawCreatableSelect from 'react-select/creatable';
|
|
28
|
-
var themeConfig = function (existing) { return (__assign(__assign({}, existing), { borderRadius: 0, colors: __assign(__assign({}, existing.colors), { primary25: 'var(--
|
|
28
|
+
var themeConfig = function (existing) { return (__assign(__assign({}, existing), { borderRadius: 0, colors: __assign(__assign({}, existing.colors), { primary25: 'var(--color--surface-hover)',
|
|
29
29
|
// disabled
|
|
30
|
-
neutral10: 'var(--border
|
|
30
|
+
neutral10: 'var(--color--border)',
|
|
31
31
|
// normal
|
|
32
|
-
neutral20: 'var(--border
|
|
32
|
+
neutral20: 'var(--color--border)',
|
|
33
33
|
// focused
|
|
34
|
-
primary: 'var(--
|
|
34
|
+
primary: 'var(--color--focus--border)',
|
|
35
35
|
// hover
|
|
36
|
-
neutral30: 'var(--
|
|
36
|
+
neutral30: 'var(--color--border-hover)' }) })); };
|
|
37
37
|
var useStyles = function (isDisabled, error) {
|
|
38
38
|
return useMemo(function () {
|
|
39
39
|
return {
|
|
40
|
-
placeholder: function (provided) { return (__assign(__assign({}, provided), { color: 'var(--placeholder
|
|
40
|
+
placeholder: function (provided) { return (__assign(__assign({}, provided), { color: 'var(--color--ink-placeholder)' })); },
|
|
41
41
|
container: function (provided) {
|
|
42
42
|
return __assign(__assign({}, provided), { fontSize: 'inherit' });
|
|
43
43
|
},
|
|
@@ -46,32 +46,51 @@ var useStyles = function (isDisabled, error) {
|
|
|
46
46
|
var result = provided;
|
|
47
47
|
result = __assign(__assign({}, result), { minHeight: 40 });
|
|
48
48
|
if (isFocused) {
|
|
49
|
-
return __assign(__assign({}, result), { borderColor: error
|
|
50
|
-
? '
|
|
51
|
-
: 'var(--
|
|
52
|
-
|
|
49
|
+
return __assign(__assign({}, result), { borderColor: error
|
|
50
|
+
? 'var(--color--feedback-fail--border)'
|
|
51
|
+
: 'var(--color--focus--border)', backgroundColor: isDisabled
|
|
52
|
+
? 'var(--color--disabled--surface)'
|
|
53
|
+
: 'var(--color--surface)', boxShadow: "0 0 0 3px ".concat(error
|
|
54
|
+
? 'var(--color--feedback-fail--outline)'
|
|
55
|
+
: 'var(--color--focus--outline)'), '&:hover': {
|
|
56
|
+
borderColor: error
|
|
57
|
+
? 'var(--color--feedback-fail--border)'
|
|
58
|
+
: 'var(--color--focus--border)',
|
|
53
59
|
} });
|
|
54
60
|
}
|
|
55
|
-
return __assign(__assign({}, result), { borderColor: error
|
|
61
|
+
return __assign(__assign({}, result), { borderColor: error
|
|
62
|
+
? 'var(--color--feedback-fail--border)'
|
|
63
|
+
: 'var(--color--border)', backgroundColor: isDisabled
|
|
64
|
+
? 'var(--color--disabled--surface)'
|
|
65
|
+
: 'var(--color--surface)', '&:hover': {
|
|
56
66
|
borderColor: error
|
|
57
|
-
? 'var(--
|
|
58
|
-
: 'var(--
|
|
67
|
+
? 'var(--color--feedback-fail--border)'
|
|
68
|
+
: 'var(--color--border-hover)',
|
|
59
69
|
} });
|
|
60
70
|
},
|
|
61
|
-
multiValueRemove: function (provided) { return (__assign(__assign({}, provided), { cursor: 'pointer'
|
|
71
|
+
multiValueRemove: function (provided) { return (__assign(__assign({}, provided), { cursor: 'pointer', color: 'var(--color--tinted--ink)', ':hover': {
|
|
72
|
+
backgroundColor: 'var(--color--tinted--surface-hover)',
|
|
73
|
+
color: 'var(--color--tinted--ink)',
|
|
74
|
+
} })); },
|
|
62
75
|
menu: function (provided) {
|
|
63
|
-
return __assign(__assign({}, provided), { zIndex: 1000, minWidth: 250 });
|
|
76
|
+
return __assign(__assign({}, provided), { zIndex: 1000, minWidth: 250, backgroundColor: 'var(--color--raised--surface)' });
|
|
64
77
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
singleValue: function (provided) { return (__assign(__assign({}, provided), { color: 'var(--color--ink)' })); },
|
|
79
|
+
input: function (provided) { return (__assign(__assign({}, provided), { color: 'var(--color--ink)', boxShadow: 'none', 'input:focus': {
|
|
80
|
+
boxShadow: 'none',
|
|
81
|
+
} })); },
|
|
82
|
+
option: function (provided, _a) {
|
|
83
|
+
var isFocused = _a.isFocused, isSelected = _a.isSelected;
|
|
84
|
+
return (__assign(__assign({}, provided), { backgroundColor: isSelected
|
|
85
|
+
? 'var(--color--selected--surface)'
|
|
86
|
+
: isFocused
|
|
87
|
+
? 'var(--color--surface-hover)'
|
|
88
|
+
: undefined, color: 'var(--color--ink)' }));
|
|
70
89
|
},
|
|
71
90
|
multiValue: function (provided) {
|
|
72
|
-
return __assign(__assign({}, provided), { zIndex: 100, backgroundColor: 'var(--
|
|
91
|
+
return __assign(__assign({}, provided), { zIndex: 100, backgroundColor: 'var(--color--tinted--surface)', userSelect: 'none' });
|
|
73
92
|
},
|
|
74
|
-
multiValueLabel: function (provided) { return (__assign(__assign({}, provided), { fontSize: 'inherit', padding: 3 })); },
|
|
93
|
+
multiValueLabel: function (provided) { return (__assign(__assign({}, provided), { fontSize: 'inherit', padding: 3, color: 'var(--color--tinted--ink)' })); },
|
|
75
94
|
};
|
|
76
95
|
}, [isDisabled, error]);
|
|
77
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SelectInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAKN,MAAM,cAAc,CAAC;AACtB,OAAO,cAAmC,MAAM,oBAAoB,CAAC;AACrE,OAAO,uBAEN,MAAM,8BAA8B,CAAC;AACtC,OAAO,kBAEN,MAAM,wBAAwB,CAAC;AAEhC,IAAM,WAAW,GAAgB,UAAC,QAAQ,IAAK,OAAA,uBAC1C,QAAQ,KACX,YAAY,EAAE,CAAC,EACf,MAAM,wBACD,QAAQ,CAAC,MAAM,KAClB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SelectInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAKN,MAAM,cAAc,CAAC;AACtB,OAAO,cAAmC,MAAM,oBAAoB,CAAC;AACrE,OAAO,uBAEN,MAAM,8BAA8B,CAAC;AACtC,OAAO,kBAEN,MAAM,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AAE,UAAU,EACtB,KAAK,EAAE,WAAW;QAClB,8DAA8D;QAC9D,MAAM,EAAE,MAAa,IACrB,CACH,CAAC;AACJ,CAAC;AASD,MAAM,UAAU,yBAAyB,CAIvC,EAIuD;IAHvD,IAAA,UAAU,gBAAA,EACV,KAAK,WAAA,EACF,KAAK,cAHR,uBAID,CADS;IAER,IAAM,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,uBAAuB,eAClB,KAAK,IACT,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,WAAW;QAClB,8DAA8D;QAC9D,MAAM,EAAE,MAAa,IACrB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,7 @@ export declare type SidebarPanelProps = {
|
|
|
14
14
|
* <div
|
|
15
15
|
* style={{
|
|
16
16
|
* width: '300px',
|
|
17
|
-
* borderRight: '1px solid var(--border
|
|
17
|
+
* borderRight: '1px solid var(--color--border)',
|
|
18
18
|
* }}
|
|
19
19
|
* >
|
|
20
20
|
* <SidebarPanel title="Default">Content</SidebarPanel>
|
|
@@ -31,7 +31,7 @@ export declare type SidebarPanelProps = {
|
|
|
31
31
|
* display: 'flex',
|
|
32
32
|
* justifyContent: 'center',
|
|
33
33
|
* alignItems: 'center',
|
|
34
|
-
* background: 'var(--
|
|
34
|
+
* background: 'var(--color--surface-muted)',
|
|
35
35
|
* }}
|
|
36
36
|
* >
|
|
37
37
|
* Main content
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
+
import { CaretDownIcon, CaretUpIcon } from '../icons';
|
|
3
4
|
import s from './styles.module.css.json';
|
|
4
|
-
function ChevronDownIcon() {
|
|
5
|
-
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", width: "1em", height: "1em" },
|
|
6
|
-
React.createElement("path", { d: "M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" })));
|
|
7
|
-
}
|
|
8
|
-
function ChevronUpIcon() {
|
|
9
|
-
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", width: "1em", height: "1em" },
|
|
10
|
-
React.createElement("path", { d: "M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z" })));
|
|
11
|
-
}
|
|
12
5
|
/**
|
|
13
6
|
* @example Basic example
|
|
14
7
|
*
|
|
@@ -18,7 +11,7 @@ function ChevronUpIcon() {
|
|
|
18
11
|
* <div
|
|
19
12
|
* style={{
|
|
20
13
|
* width: '300px',
|
|
21
|
-
* borderRight: '1px solid var(--border
|
|
14
|
+
* borderRight: '1px solid var(--color--border)',
|
|
22
15
|
* }}
|
|
23
16
|
* >
|
|
24
17
|
* <SidebarPanel title="Default">Content</SidebarPanel>
|
|
@@ -35,7 +28,7 @@ function ChevronUpIcon() {
|
|
|
35
28
|
* display: 'flex',
|
|
36
29
|
* justifyContent: 'center',
|
|
37
30
|
* alignItems: 'center',
|
|
38
|
-
* background: 'var(--
|
|
31
|
+
* background: 'var(--color--surface-muted)',
|
|
39
32
|
* }}
|
|
40
33
|
* >
|
|
41
34
|
* Main content
|
|
@@ -54,7 +47,7 @@ export function SidebarPanel(_a) {
|
|
|
54
47
|
return (React.createElement("div", { className: s.SidebarPanel },
|
|
55
48
|
title && (React.createElement("button", { type: "button", className: s.SidebarPanel__header, onClick: handleToggle },
|
|
56
49
|
React.createElement("div", { className: s.SidebarPanel__header__title }, title),
|
|
57
|
-
React.createElement("div", { className: s.SidebarPanel__header__chevron }, open ? React.createElement(
|
|
50
|
+
React.createElement("div", { className: s.SidebarPanel__header__chevron }, open ? React.createElement(CaretDownIcon, null) : React.createElement(CaretUpIcon, null)))),
|
|
58
51
|
open && (React.createElement("div", { className: classNames(s.SidebarPanel__content, (_b = {},
|
|
59
52
|
_b[s['SidebarPanel__content--no-padding']] = noPadding,
|
|
60
53
|
_b)) }, children))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SidebarPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SidebarPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,CAAC,MAAM,0BAA0B,CAAC;AASzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,YAAY,CAAC,EAKT;;QAJlB,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACjB,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,SAAS,eAAA;IAEH,IAAA,KAAkB,QAAQ,CAAC,SAAS,CAAC,EAApC,IAAI,QAAA,EAAE,OAAO,QAAuB,CAAC;IAE5C,IAAM,YAAY,GAAG;QACnB,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAE,CAAC,CAAC,YAAY;QAC3B,KAAK,IAAI,CACR,gCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,CAAC,CAAC,oBAAoB,EACjC,OAAO,EAAE,YAAY;YAErB,6BAAK,SAAS,EAAE,CAAC,CAAC,2BAA2B,IAAG,KAAK,CAAO;YAC5D,6BAAK,SAAS,EAAE,CAAC,CAAC,6BAA6B,IAC5C,IAAI,CAAC,CAAC,CAAC,oBAAC,aAAa,OAAG,CAAC,CAAC,CAAC,oBAAC,WAAW,OAAG,CACvC,CACC,CACV;QACA,IAAI,IAAI,CACP,6BACE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,qBAAqB;gBAC3C,GAAC,CAAC,CAAC,mCAAmC,CAAC,IAAG,SAAS;oBACnD,IAED,QAAQ,CACL,CACP,CACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "SidebarPanel": "
|
|
1
|
+
{ "SidebarPanel": "_SidebarPanel_q32h5_1", "SidebarPanel__header": "_SidebarPanel__header_q32h5_5", "SidebarPanel__header__title": "_SidebarPanel__header__title_q32h5_30", "SidebarPanel__header__chevron": "_SidebarPanel__header__chevron_q32h5_36", "SidebarPanel__content": "_SidebarPanel__content_q32h5_42", "SidebarPanel__content--no-padding": "_SidebarPanel__content--no-padding_q32h5_47" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "Spinner--inline": "_Spinner--
|
|
1
|
+
{ "Spinner--inline": "_Spinner--inline_1u42l_1", "Spinner--centered": "_Spinner--centered_1u42l_7", "Spinner__bar": "_Spinner__bar_1u42l_13", "Spinner__spin": "_Spinner__spin_1u42l_1" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "SplitViewSash": "
|
|
1
|
+
{ "SplitViewSash": "_SplitViewSash_5k1ng_1", "SplitViewSash--dragging": "_SplitViewSash--dragging_5k1ng_15", "SplitViewSash__content": "_SplitViewSash__content_5k1ng_19", "SplitViewSash--no-resize": "_SplitViewSash--no-resize_5k1ng_24", "SplitViewSash--vertical": "_SplitViewSash--vertical_5k1ng_28", "SplitViewSash--horizontal": "_SplitViewSash--horizontal_5k1ng_32", "SplitViewSash__content__button": "_SplitViewSash__content__button_5k1ng_46" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "switchField__flex": "
|
|
1
|
+
{ "switchField__flex": "_switchField__flex_ietsf_1", "switchField__switchInput": "_switchField__switchInput_ietsf_6", "switchField__label": "_switchField__label_ietsf_10", "switchField__below": "_switchField__below_ietsf_22" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "switchInput__inner": "
|
|
1
|
+
{ "switchInput__inner": "_switchInput__inner_190is_1", "switchInput": "_switchInput_190is_1", "switchInput__off": "_switchInput__off_190is_1", "switchInput__on": "_switchInput__on_190is_1", "switchInput__checked": "_switchInput__checked_190is_50", "switchInput__disabled": "_switchInput__disabled_190is_63", "none": "_none_190is_1" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "TextInput": "
|
|
1
|
+
{ "TextInput": "_TextInput_it0d0_1", "TextInput--monospaced": "_TextInput--monospaced_it0d0_32", "TextInput--disabled": "_TextInput--disabled_it0d0_37", "TextInput--error": "_TextInput--error_it0d0_43" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "TextareaInput": "
|
|
1
|
+
{ "TextareaInput": "_TextareaInput_3v51p_1", "TextareaInput--monospaced": "_TextareaInput--monospaced_3v51p_32", "TextareaInput--disabled": "_TextareaInput--disabled_3v51p_37", "TextareaInput--error": "_TextareaInput--error_3v51p_43" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "Button": "
|
|
1
|
+
{ "Button": "_Button_36kvr_1" }
|
|
@@ -19,7 +19,7 @@ export declare type ToolbarProps = {
|
|
|
19
19
|
* display: 'flex',
|
|
20
20
|
* justifyContent: 'center',
|
|
21
21
|
* alignItems: 'center',
|
|
22
|
-
* background: 'var(--
|
|
22
|
+
* background: 'var(--color--surface-muted)',
|
|
23
23
|
* height: '150px',
|
|
24
24
|
* }}
|
|
25
25
|
* >
|
|
@@ -50,7 +50,7 @@ export declare type ToolbarProps = {
|
|
|
50
50
|
* display: 'flex',
|
|
51
51
|
* justifyContent: 'center',
|
|
52
52
|
* alignItems: 'center',
|
|
53
|
-
* background: 'var(--
|
|
53
|
+
* background: 'var(--color--surface-muted)',
|
|
54
54
|
* height: '150px',
|
|
55
55
|
* }}
|
|
56
56
|
* >
|
|
@@ -79,7 +79,7 @@ export declare type ToolbarProps = {
|
|
|
79
79
|
* display: 'flex',
|
|
80
80
|
* justifyContent: 'center',
|
|
81
81
|
* alignItems: 'center',
|
|
82
|
-
* background: 'var(--
|
|
82
|
+
* background: 'var(--color--surface-muted)',
|
|
83
83
|
* height: '150px',
|
|
84
84
|
* }}
|
|
85
85
|
* >
|
|
@@ -16,7 +16,7 @@ import s from './styles.module.css.json';
|
|
|
16
16
|
* display: 'flex',
|
|
17
17
|
* justifyContent: 'center',
|
|
18
18
|
* alignItems: 'center',
|
|
19
|
-
* background: 'var(--
|
|
19
|
+
* background: 'var(--color--surface-muted)',
|
|
20
20
|
* height: '150px',
|
|
21
21
|
* }}
|
|
22
22
|
* >
|
|
@@ -47,7 +47,7 @@ import s from './styles.module.css.json';
|
|
|
47
47
|
* display: 'flex',
|
|
48
48
|
* justifyContent: 'center',
|
|
49
49
|
* alignItems: 'center',
|
|
50
|
-
* background: 'var(--
|
|
50
|
+
* background: 'var(--color--surface-muted)',
|
|
51
51
|
* height: '150px',
|
|
52
52
|
* }}
|
|
53
53
|
* >
|
|
@@ -76,7 +76,7 @@ import s from './styles.module.css.json';
|
|
|
76
76
|
* display: 'flex',
|
|
77
77
|
* justifyContent: 'center',
|
|
78
78
|
* alignItems: 'center',
|
|
79
|
-
* background: 'var(--
|
|
79
|
+
* background: 'var(--color--surface-muted)',
|
|
80
80
|
* height: '150px',
|
|
81
81
|
* }}
|
|
82
82
|
* >
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "Toolbar": "
|
|
1
|
+
{ "Toolbar": "_Toolbar_50246_1" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "tooltip": "
|
|
1
|
+
{ "tooltip": "_tooltip_m9vka_1" }
|
|
@@ -87,8 +87,8 @@ export declare type TooltipDelayGroupProps = {
|
|
|
87
87
|
* display: 'flex',
|
|
88
88
|
* gap: 'var(--spacing-xs)',
|
|
89
89
|
* padding: 'var(--spacing-s)',
|
|
90
|
-
* borderRadius: '
|
|
91
|
-
* backgroundColor: 'var(--
|
|
90
|
+
* borderRadius: '4px',
|
|
91
|
+
* backgroundColor: 'var(--color--surface-muted)'
|
|
92
92
|
* }}>
|
|
93
93
|
* <Tooltip>
|
|
94
94
|
* <TooltipTrigger>
|
|
@@ -78,8 +78,8 @@ import * as React from 'react';
|
|
|
78
78
|
* display: 'flex',
|
|
79
79
|
* gap: 'var(--spacing-xs)',
|
|
80
80
|
* padding: 'var(--spacing-s)',
|
|
81
|
-
* borderRadius: '
|
|
82
|
-
* backgroundColor: 'var(--
|
|
81
|
+
* borderRadius: '4px',
|
|
82
|
+
* backgroundColor: 'var(--color--surface-muted)'
|
|
83
83
|
* }}>
|
|
84
84
|
* <Tooltip>
|
|
85
85
|
* <TooltipTrigger>
|
|
@@ -36,7 +36,7 @@ export declare type VerticalSplitProps = {
|
|
|
36
36
|
* Main content
|
|
37
37
|
* </div>
|
|
38
38
|
* </div>
|
|
39
|
-
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--border
|
|
39
|
+
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--color--border)' }}>
|
|
40
40
|
* <Toolbar>
|
|
41
41
|
* <ToolbarStack stackSize="l">
|
|
42
42
|
* <ToolbarTitle>Secondary</ToolbarTitle>
|
|
@@ -83,7 +83,7 @@ export declare type VerticalSplitProps = {
|
|
|
83
83
|
* Sidebar
|
|
84
84
|
* </div>
|
|
85
85
|
* </div>
|
|
86
|
-
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--border
|
|
86
|
+
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--color--border)' }}>
|
|
87
87
|
* <Toolbar>
|
|
88
88
|
* <ToolbarStack stackSize="l">
|
|
89
89
|
* <ToolbarTitle>Primary</ToolbarTitle>
|
|
@@ -143,7 +143,7 @@ export declare type VerticalSplitProps = {
|
|
|
143
143
|
* display: 'flex',
|
|
144
144
|
* flexDirection: 'column',
|
|
145
145
|
* height: '100%',
|
|
146
|
-
* borderLeft: '1px solid var(--border
|
|
146
|
+
* borderLeft: '1px solid var(--color--border)',
|
|
147
147
|
* }}
|
|
148
148
|
* >
|
|
149
149
|
* <Toolbar>
|
|
@@ -208,7 +208,7 @@ export declare type VerticalSplitProps = {
|
|
|
208
208
|
* display: 'flex',
|
|
209
209
|
* flexDirection: 'column',
|
|
210
210
|
* height: '100%',
|
|
211
|
-
* borderLeft: '1px solid var(--border
|
|
211
|
+
* borderLeft: '1px solid var(--color--border)',
|
|
212
212
|
* }}
|
|
213
213
|
* >
|
|
214
214
|
* <Toolbar>
|
|
@@ -47,7 +47,7 @@ function calculateSizes(_a) {
|
|
|
47
47
|
* Main content
|
|
48
48
|
* </div>
|
|
49
49
|
* </div>
|
|
50
|
-
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--border
|
|
50
|
+
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--color--border)' }}>
|
|
51
51
|
* <Toolbar>
|
|
52
52
|
* <ToolbarStack stackSize="l">
|
|
53
53
|
* <ToolbarTitle>Secondary</ToolbarTitle>
|
|
@@ -94,7 +94,7 @@ function calculateSizes(_a) {
|
|
|
94
94
|
* Sidebar
|
|
95
95
|
* </div>
|
|
96
96
|
* </div>
|
|
97
|
-
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--border
|
|
97
|
+
* <div style={{ display: 'flex', flexDirection: 'column', height: '100%', borderLeft: '1px solid var(--color--border)' }}>
|
|
98
98
|
* <Toolbar>
|
|
99
99
|
* <ToolbarStack stackSize="l">
|
|
100
100
|
* <ToolbarTitle>Primary</ToolbarTitle>
|
|
@@ -154,7 +154,7 @@ function calculateSizes(_a) {
|
|
|
154
154
|
* display: 'flex',
|
|
155
155
|
* flexDirection: 'column',
|
|
156
156
|
* height: '100%',
|
|
157
|
-
* borderLeft: '1px solid var(--border
|
|
157
|
+
* borderLeft: '1px solid var(--color--border)',
|
|
158
158
|
* }}
|
|
159
159
|
* >
|
|
160
160
|
* <Toolbar>
|
|
@@ -219,7 +219,7 @@ function calculateSizes(_a) {
|
|
|
219
219
|
* display: 'flex',
|
|
220
220
|
* flexDirection: 'column',
|
|
221
221
|
* height: '100%',
|
|
222
|
-
* borderLeft: '1px solid var(--border
|
|
222
|
+
* borderLeft: '1px solid var(--color--border)',
|
|
223
223
|
* }}
|
|
224
224
|
* >
|
|
225
225
|
* <Toolbar>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "VerticalSplitPane__expand": "
|
|
1
|
+
{ "VerticalSplitPane__expand": "_VerticalSplitPane__expand_1j6ko_1", "VerticalSplitPane__expand--left": "_VerticalSplitPane__expand--left_1j6ko_22", "VerticalSplitPane__expand--right": "_VerticalSplitPane__expand--right_1j6ko_25", "VerticalSplitPaneOverlay": "_VerticalSplitPaneOverlay_1j6ko_42", "VerticalSplitPaneOverlay__primary": "_VerticalSplitPaneOverlay__primary_1j6ko_54", "VerticalSplitPaneOverlay__primary--left": "_VerticalSplitPaneOverlay__primary--left_1j6ko_63", "VerticalSplitPaneOverlay__primary--right": "_VerticalSplitPaneOverlay__primary--right_1j6ko_67", "VerticalSplitPaneOverlay__secondary": "_VerticalSplitPaneOverlay__secondary_1j6ko_71", "VerticalSplitPaneOverlay__secondary--left": "_VerticalSplitPaneOverlay__secondary--left_1j6ko_79", "VerticalSplitPaneOverlay__secondary--right": "_VerticalSplitPaneOverlay__secondary--right_1j6ko_83", "VerticalSplitPaneOverlay__sash": "_VerticalSplitPaneOverlay__sash_1j6ko_87" }
|
|
@@ -15,9 +15,131 @@ function camelToDash(str) {
|
|
|
15
15
|
}
|
|
16
16
|
return str.replace(/[A-Z]/g, function (m) { return "-".concat(m.toLowerCase()); });
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Maps camelCase semantic token keys to their CSS custom property names
|
|
20
|
+
* (without the `--` prefix). The CSS names preserve the double-dash
|
|
21
|
+
* namespace separators used by the host application.
|
|
22
|
+
*/
|
|
23
|
+
var semanticTokenCssNames = {
|
|
24
|
+
/* --- Standalone --- */
|
|
25
|
+
colorSurface: 'color--surface',
|
|
26
|
+
colorSurfaceHover: 'color--surface-hover',
|
|
27
|
+
colorSurfaceMuted: 'color--surface-muted',
|
|
28
|
+
colorInk: 'color--ink',
|
|
29
|
+
colorInkSubtle: 'color--ink-subtle',
|
|
30
|
+
colorInkHover: 'color--ink-hover',
|
|
31
|
+
colorInkMuted: 'color--ink-muted',
|
|
32
|
+
colorInkPlaceholder: 'color--ink-placeholder',
|
|
33
|
+
colorInkPrimary: 'color--ink-primary',
|
|
34
|
+
colorInkAccent: 'color--ink-accent',
|
|
35
|
+
colorInkDisabled: 'color--ink-disabled',
|
|
36
|
+
colorBorder: 'color--border',
|
|
37
|
+
colorBorderHover: 'color--border-hover',
|
|
38
|
+
/* --- Context: raised --- */
|
|
39
|
+
colorRaisedSurface: 'color--raised--surface',
|
|
40
|
+
colorRaisedSurfaceHover: 'color--raised--surface-hover',
|
|
41
|
+
colorRaisedSurfaceActive: 'color--raised--surface-active',
|
|
42
|
+
/* --- Context: primary --- */
|
|
43
|
+
colorPrimarySurface: 'color--primary--surface',
|
|
44
|
+
colorPrimarySurfaceHover: 'color--primary--surface-hover',
|
|
45
|
+
colorPrimarySurfaceActive: 'color--primary--surface-active',
|
|
46
|
+
colorPrimarySurfaceMuted: 'color--primary--surface-muted',
|
|
47
|
+
colorPrimaryInk: 'color--primary--ink',
|
|
48
|
+
colorPrimaryBorder: 'color--primary--border',
|
|
49
|
+
/* --- Context: tinted --- */
|
|
50
|
+
colorTintedSurface: 'color--tinted--surface',
|
|
51
|
+
colorTintedSurfaceHover: 'color--tinted--surface-hover',
|
|
52
|
+
colorTintedSurfaceActive: 'color--tinted--surface-active',
|
|
53
|
+
colorTintedInk: 'color--tinted--ink',
|
|
54
|
+
/* --- Context: accent --- */
|
|
55
|
+
colorAccentSurface: 'color--accent--surface',
|
|
56
|
+
colorAccentInk: 'color--accent--ink',
|
|
57
|
+
/* --- Context: selected --- */
|
|
58
|
+
colorSelectedSurface: 'color--selected--surface',
|
|
59
|
+
colorSelectedInk: 'color--selected--ink',
|
|
60
|
+
colorSelectedBorder: 'color--selected--border',
|
|
61
|
+
/* --- Context: disabled --- */
|
|
62
|
+
colorDisabledSurface: 'color--disabled--surface',
|
|
63
|
+
colorDisabledInk: 'color--disabled--ink',
|
|
64
|
+
/* --- Context: danger --- */
|
|
65
|
+
colorDangerSurface: 'color--danger--surface',
|
|
66
|
+
colorDangerInk: 'color--danger--ink',
|
|
67
|
+
/* --- Context: enterprise --- */
|
|
68
|
+
colorEnterpriseSurface: 'color--enterprise--surface',
|
|
69
|
+
/* --- Context: focus --- */
|
|
70
|
+
colorFocusBorder: 'color--focus--border',
|
|
71
|
+
colorFocusOutline: 'color--focus--outline',
|
|
72
|
+
/* --- Feedback --- */
|
|
73
|
+
colorFeedbackFailInk: 'color--feedback-fail--ink',
|
|
74
|
+
colorFeedbackFailBorder: 'color--feedback-fail--border',
|
|
75
|
+
colorFeedbackFailOutline: 'color--feedback-fail--outline',
|
|
76
|
+
colorFeedbackWarningInk: 'color--feedback-warning--ink',
|
|
77
|
+
colorFeedbackWarningSurface: 'color--feedback-warning--surface',
|
|
78
|
+
colorFeedbackSuccessInk: 'color--feedback-success--ink',
|
|
79
|
+
colorFeedbackWarningBorder: 'color--feedback-warning--border',
|
|
80
|
+
colorFeedbackSuccessBorder: 'color--feedback-success--border',
|
|
81
|
+
/* --- Context: highlight --- */
|
|
82
|
+
colorHighlightSurface: 'color--highlight--surface',
|
|
83
|
+
/* --- Diffs --- */
|
|
84
|
+
colorDiffAddedSurface: 'color--diff-added--surface',
|
|
85
|
+
colorDiffRemovedSurface: 'color--diff-removed--surface',
|
|
86
|
+
colorDiffChangedSurface: 'color--diff-changed--surface',
|
|
87
|
+
colorDiffAddedSurfaceSubtle: 'color--diff-added--surface-subtle',
|
|
88
|
+
colorDiffRemovedSurfaceSubtle: 'color--diff-removed--surface-subtle',
|
|
89
|
+
colorDiffChangedSurfaceSubtle: 'color--diff-changed--surface-subtle',
|
|
90
|
+
colorDiffAddedOutlineSubtle: 'color--diff-added--outline-subtle',
|
|
91
|
+
colorDiffRemovedOutlineSubtle: 'color--diff-removed--outline-subtle',
|
|
92
|
+
colorDiffChangedOutlineSubtle: 'color--diff-changed--outline-subtle',
|
|
93
|
+
colorDiffChangedBorder: 'color--diff-changed--border',
|
|
94
|
+
colorDiffChangedBorderNegative: 'color--diff-changed--border-negative',
|
|
95
|
+
/* --- Status --- */
|
|
96
|
+
colorStatusDraftInk: 'color--status-draft--ink',
|
|
97
|
+
colorStatusOutdatedInk: 'color--status-outdated--ink',
|
|
98
|
+
colorStatusPublishedInk: 'color--status-published--ink',
|
|
99
|
+
/* --- Backdrop --- */
|
|
100
|
+
colorBackdropSurface: 'color--backdrop--surface',
|
|
101
|
+
colorBackdropInk: 'color--backdrop--ink',
|
|
102
|
+
/* --- Overlay --- */
|
|
103
|
+
colorOverlaySurface: 'color--overlay--surface',
|
|
104
|
+
colorOverlaySurfaceSubtle: 'color--overlay--surface-subtle',
|
|
105
|
+
colorOverlayInk: 'color--overlay--ink',
|
|
106
|
+
/* --- Stacked --- */
|
|
107
|
+
colorStackedSurfaceBase: 'color--stacked--surface-base',
|
|
108
|
+
colorStackedSurface: 'color--stacked--surface',
|
|
109
|
+
colorStackedSurfaceRaised: 'color--stacked--surface-raised',
|
|
110
|
+
colorStackedInk: 'color--stacked--ink',
|
|
111
|
+
colorStackedInkSubtle: 'color--stacked--ink-subtle',
|
|
112
|
+
colorStackedBorder: 'color--stacked--border',
|
|
113
|
+
colorStackedSurfaceHover: 'color--stacked--surface-hover',
|
|
114
|
+
colorStackedSurfaceTranslucent: 'color--stacked--surface-translucent',
|
|
115
|
+
colorStackedSurfaceButton: 'color--stacked--surface-button',
|
|
116
|
+
colorStackedSurfaceButtonActive: 'color--stacked--surface-button-active',
|
|
117
|
+
/* --- Progress --- */
|
|
118
|
+
colorProgressTrack: 'color--progress--track',
|
|
119
|
+
colorProgressFill: 'color--progress--fill',
|
|
120
|
+
colorProgressFillHover: 'color--progress--fill-hover',
|
|
121
|
+
/* --- Tooltip --- */
|
|
122
|
+
colorTooltipSurface: 'color--tooltip--surface',
|
|
123
|
+
colorTooltipSurfaceHover: 'color--tooltip--surface-hover',
|
|
124
|
+
colorTooltipInk: 'color--tooltip--ink',
|
|
125
|
+
colorTooltipInkSubtle: 'color--tooltip--ink-subtle',
|
|
126
|
+
/* --- Code --- */
|
|
127
|
+
colorCodeSurface: 'color--code--surface',
|
|
128
|
+
colorCodeInk: 'color--code--ink',
|
|
129
|
+
/* --- Shadows --- */
|
|
130
|
+
colorShadowSubtle: 'color--shadow-subtle',
|
|
131
|
+
colorShadow: 'color--shadow',
|
|
132
|
+
colorShadowStrong: 'color--shadow-strong',
|
|
133
|
+
/* --- Scrollbar --- */
|
|
134
|
+
colorScrollbar: 'color--scrollbar',
|
|
135
|
+
/* --- Shadow composites --- */
|
|
136
|
+
shadowElevated: 'shadow--elevated',
|
|
137
|
+
shadowFloat: 'shadow--float',
|
|
138
|
+
shadowAmbient: 'shadow--ambient',
|
|
139
|
+
};
|
|
18
140
|
export function generateStyleFromCtx(ctx, noBodyPadding) {
|
|
19
141
|
if (noBodyPadding === void 0) { noBodyPadding = false; }
|
|
20
|
-
return __assign({ padding: noBodyPadding
|
|
142
|
+
return __assign(__assign({ padding: noBodyPadding
|
|
21
143
|
? undefined
|
|
22
144
|
: ctx.bodyPadding.map(function (p) { return "".concat(p, "px"); }).join(' ') }, Object.fromEntries(Object.entries(ctx.theme).flatMap(function (_a) {
|
|
23
145
|
var _b;
|
|
@@ -29,6 +151,15 @@ export function generateStyleFromCtx(ctx, noBodyPadding) {
|
|
|
29
151
|
((_b = v.match(/rgb\((\d+, \d+, \d+)\)/)) === null || _b === void 0 ? void 0 : _b[1]) || undefined,
|
|
30
152
|
],
|
|
31
153
|
];
|
|
32
|
-
})))
|
|
154
|
+
}))), (ctx.semanticColorTokensTheme
|
|
155
|
+
? Object.fromEntries(Object.entries(ctx.semanticColorTokensTheme).map(function (_a) {
|
|
156
|
+
var _b;
|
|
157
|
+
var k = _a[0], v = _a[1];
|
|
158
|
+
return [
|
|
159
|
+
"--".concat((_b = semanticTokenCssNames[k]) !== null && _b !== void 0 ? _b : camelToDash(k)),
|
|
160
|
+
v,
|
|
161
|
+
];
|
|
162
|
+
}))
|
|
163
|
+
: undefined));
|
|
33
164
|
}
|
|
34
165
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generateStyleFromCtx/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE,EAAE;QAC7B,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,WAAI,CAAC,CAAC,WAAW,EAAE,CAAE,EAArB,CAAqB,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,GAAY,EACZ,aAAqB;IAArB,8BAAA,EAAA,qBAAqB;IAErB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generateStyleFromCtx/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,SAAS,WAA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