pixelize-design-library 2.4.2-beta.1 → 2.4.2-beta.3
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/Components/Header/HeaderActions.d.ts +3 -1
- package/dist/Components/Header/HeaderActions.js +7 -3
- package/dist/Components/PlanPill/PlanPill.js +1 -1
- package/dist/Theme/chakra/Menu.styles.d.ts +6 -6
- package/dist/Theme/chakra/Menu.styles.js +6 -5
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -3
- package/dist/Theme/chakra/Popover.styles.js +7 -6
- package/dist/Theme/chakra/Switch.styles.d.ts +1 -1
- package/dist/Theme/chakra/Switch.styles.js +7 -9
- package/dist/Theme/chakra/componentStyles.d.ts +9 -9
- package/dist/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/Theme/provider/ThemeSwitcher.js +10 -20
- package/dist/Theme/tokens/brands/emerald/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/lavender/palette.light.js +5 -116
- package/dist/Theme/tokens/brands/meadow/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/neutrals.d.ts +8 -0
- package/dist/Theme/tokens/brands/neutrals.js +119 -0
- package/dist/Theme/tokens/brands/radiant/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/rosewood/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/skyline/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/slate/palette.light.js +6 -12
- package/dist/Theme/tokens/brands/storefront/palette.light.js +5 -7
- package/dist/Theme/tokens/builders/brandInk.d.ts +11 -0
- package/dist/Theme/tokens/builders/brandInk.js +106 -0
- package/dist/Theme/tokens/types.d.ts +5 -0
- package/dist/esm/Components/Header/HeaderActions.js +8 -4
- package/dist/esm/Components/PlanPill/PlanPill.js +2 -2
- package/dist/esm/Theme/chakra/Menu.styles.js +6 -5
- package/dist/esm/Theme/chakra/Popover.styles.js +7 -6
- package/dist/esm/Theme/chakra/Switch.styles.js +7 -9
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/esm/Theme/provider/ThemeSwitcher.js +10 -20
- package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +5 -116
- package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/neutrals.js +116 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +6 -9
- package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/builders/brandInk.js +103 -0
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { OptionProp } from "../Select/SelectProps";
|
|
2
|
-
declare const HeaderActions: ({ select, edit, create, }: {
|
|
2
|
+
declare const HeaderActions: ({ select, edit, create, surface, }: {
|
|
3
|
+
/** Background this is drawn on. Header's bar is dark in BOTH modes — pass it there. */
|
|
4
|
+
surface?: string;
|
|
3
5
|
select?: {
|
|
4
6
|
isSelect?: boolean;
|
|
5
7
|
options?: OptionProp[];
|
|
@@ -9,20 +9,24 @@ const react_2 = __importDefault(require("react"));
|
|
|
9
9
|
const lucide_react_1 = require("lucide-react");
|
|
10
10
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
11
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
12
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
12
13
|
const Select_1 = __importDefault(require("../Select/Select"));
|
|
13
14
|
const Divider_1 = __importDefault(require("../Divider/Divider"));
|
|
14
|
-
const HeaderActions = ({ select, edit, create, }) => {
|
|
15
|
+
const HeaderActions = ({ select, edit, create, surface, }) => {
|
|
15
16
|
var _a, _b;
|
|
16
17
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
18
|
+
const canvas = surface !== null && surface !== void 0 ? surface : colors.backgroundColor.main;
|
|
19
|
+
const ink = (0, outlineRung_1.liftToContrast)(colors.secondary[500], canvas, accentText_1.AA_NORMAL_TEXT);
|
|
20
|
+
const iconInk = (0, outlineRung_1.liftToContrast)(colors.secondary[500], canvas, outlineRung_1.AA_NON_TEXT);
|
|
17
21
|
const elements = [];
|
|
18
22
|
if (select === null || select === void 0 ? void 0 : select.isSelect) {
|
|
19
23
|
elements.push((0, jsx_runtime_1.jsx)(react_1.Box, { width: (_a = select.width) !== null && _a !== void 0 ? _a : "12.5rem", children: (0, jsx_runtime_1.jsx)(Select_1.default, { options: (_b = select.options) !== null && _b !== void 0 ? _b : [], placeholder: select.selectPlaceholderText, onChange: (option) => { var _a; return (_a = select.onSelectChange) === null || _a === void 0 ? void 0 : _a.call(select, option); }, value: select.value }, "select") }, "select"));
|
|
20
24
|
}
|
|
21
25
|
if (edit === null || edit === void 0 ? void 0 : edit.isEditable) {
|
|
22
|
-
elements.push((0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = edit.onEdit) === null || _a === void 0 ? void 0 : _a.call(edit); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 16, color:
|
|
26
|
+
elements.push((0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = edit.onEdit) === null || _a === void 0 ? void 0 : _a.call(edit); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 16, color: iconInk }), (0, jsx_runtime_1.jsx)(react_1.Text, { color: ink, children: edit.label ? edit.label : "Edit Layout" })] }, "edit"));
|
|
23
27
|
}
|
|
24
28
|
if (create === null || create === void 0 ? void 0 : create.isCreatable) {
|
|
25
|
-
elements.push((0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = create.onCreate) === null || _a === void 0 ? void 0 : _a.call(create); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CirclePlus, { size: 16, color:
|
|
29
|
+
elements.push((0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = create.onCreate) === null || _a === void 0 ? void 0 : _a.call(create); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CirclePlus, { size: 16, color: iconInk }), (0, jsx_runtime_1.jsxs)(react_1.Text, { color: ink, children: [" ", create.label ? create.label : "Create New", " "] })] }, "create"));
|
|
26
30
|
}
|
|
27
31
|
return ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", gap: "0.625rem", children: elements.map((el, i) => ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [i > 0 && (0, jsx_runtime_1.jsx)(Divider_1.default, {}), el] }, i))) }));
|
|
28
32
|
};
|
|
@@ -15,7 +15,7 @@ const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient,
|
|
|
15
15
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
16
16
|
const c = theme.colors;
|
|
17
17
|
const toneGradient = {
|
|
18
|
-
normal: planPillGradient_1.
|
|
18
|
+
normal: (0, planPillGradient_1.inkSafeGradient)(c.gradient),
|
|
19
19
|
warning: (0, planPillGradient_1.statusGradient)(c.semantic.warning),
|
|
20
20
|
danger: (0, planPillGradient_1.statusGradient)(c.semantic.error),
|
|
21
21
|
};
|
|
@@ -25,26 +25,26 @@ declare const $itemBg: {
|
|
|
25
25
|
export declare const Menu: {
|
|
26
26
|
baseStyle?: (({ theme }: StyleFunctionProps) => {
|
|
27
27
|
list: {
|
|
28
|
-
[$bg.variable]:
|
|
28
|
+
[$bg.variable]: string;
|
|
29
29
|
bg: string;
|
|
30
|
-
color:
|
|
30
|
+
color: string;
|
|
31
31
|
};
|
|
32
32
|
item: {
|
|
33
33
|
bg: string;
|
|
34
34
|
_focus: {
|
|
35
|
-
[$itemBg.variable]:
|
|
35
|
+
[$itemBg.variable]: string;
|
|
36
36
|
bg: string;
|
|
37
37
|
};
|
|
38
38
|
_hover: {
|
|
39
|
-
[$itemBg.variable]:
|
|
39
|
+
[$itemBg.variable]: string;
|
|
40
40
|
bg: string;
|
|
41
41
|
};
|
|
42
42
|
_active: {
|
|
43
|
-
[$itemBg.variable]:
|
|
43
|
+
[$itemBg.variable]: string;
|
|
44
44
|
bg: string;
|
|
45
45
|
};
|
|
46
46
|
_expanded: {
|
|
47
|
-
[$itemBg.variable]:
|
|
47
|
+
[$itemBg.variable]: string;
|
|
48
48
|
bg: string;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Menu = void 0;
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
5
|
const anatomy_1 = require("@chakra-ui/anatomy");
|
|
6
|
+
const paletteFromTheme_1 = require("./paletteFromTheme");
|
|
6
7
|
const { defineMultiStyleConfig, definePartsStyle } = (0, react_1.createMultiStyleConfigHelpers)(anatomy_1.menuAnatomy.keys);
|
|
7
8
|
const $bg = (0, react_1.cssVar)("menu-bg");
|
|
8
9
|
/**
|
|
@@ -22,14 +23,14 @@ const $bg = (0, react_1.cssVar)("menu-bg");
|
|
|
22
23
|
*/
|
|
23
24
|
const $itemBg = (0, react_1.cssVar)("menu-item-bg");
|
|
24
25
|
const baseStyle = definePartsStyle(({ theme }) => {
|
|
25
|
-
|
|
26
|
-
const hoverBg =
|
|
27
|
-
const activeBg =
|
|
26
|
+
const colors = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
27
|
+
const hoverBg = colors.primary.opacity[8];
|
|
28
|
+
const activeBg = colors.primary.opacity[16];
|
|
28
29
|
return {
|
|
29
30
|
list: {
|
|
30
|
-
[$bg.variable]:
|
|
31
|
+
[$bg.variable]: colors.backgroundColor.light,
|
|
31
32
|
bg: $bg.reference,
|
|
32
|
-
color:
|
|
33
|
+
color: colors.text[900],
|
|
33
34
|
},
|
|
34
35
|
// Own CSS var (`--menu-item-bg`), NOT the list's `--menu-bg` — Chakra's stock item
|
|
35
36
|
// baseStyle rewrites `--menu-bg` itself on hover/focus, so reusing that same var name
|
|
@@ -10,10 +10,10 @@ declare const $arrowShadowColor: {
|
|
|
10
10
|
export declare const Popover: {
|
|
11
11
|
baseStyle?: (({ theme }: StyleFunctionProps) => {
|
|
12
12
|
content: {
|
|
13
|
-
[$popperBg.variable]:
|
|
14
|
-
[$arrowShadowColor.variable]:
|
|
13
|
+
[$popperBg.variable]: string;
|
|
14
|
+
[$arrowShadowColor.variable]: string;
|
|
15
15
|
bg: string;
|
|
16
|
-
color:
|
|
16
|
+
color: string;
|
|
17
17
|
};
|
|
18
18
|
}) | undefined;
|
|
19
19
|
sizes?: {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Popover = void 0;
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
5
|
const anatomy_1 = require("@chakra-ui/anatomy");
|
|
6
|
+
const paletteFromTheme_1 = require("./paletteFromTheme");
|
|
6
7
|
const { defineMultiStyleConfig, definePartsStyle } = (0, react_1.createMultiStyleConfigHelpers)(anatomy_1.popoverAnatomy.keys);
|
|
7
8
|
const $popperBg = (0, react_1.cssVar)("popper-bg");
|
|
8
9
|
const $arrowShadowColor = (0, react_1.cssVar)("popper-arrow-shadow-color");
|
|
@@ -15,15 +16,15 @@ const $arrowShadowColor = (0, react_1.cssVar)("popper-arrow-shadow-color");
|
|
|
15
16
|
* fixing `$popperBg` here fixes the arrow fill too.
|
|
16
17
|
*/
|
|
17
18
|
const baseStyle = definePartsStyle(({ theme }) => {
|
|
18
|
-
|
|
19
|
-
return
|
|
19
|
+
const colors = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
20
|
+
return {
|
|
20
21
|
content: {
|
|
21
|
-
[$popperBg.variable]:
|
|
22
|
+
[$popperBg.variable]: colors.backgroundColor.light,
|
|
22
23
|
bg: $popperBg.reference,
|
|
23
|
-
[$arrowShadowColor.variable]:
|
|
24
|
-
color:
|
|
24
|
+
[$arrowShadowColor.variable]: colors.border[200],
|
|
25
|
+
color: colors.text[900],
|
|
25
26
|
},
|
|
26
|
-
}
|
|
27
|
+
};
|
|
27
28
|
});
|
|
28
29
|
exports.Popover = defineMultiStyleConfig({
|
|
29
30
|
baseStyle,
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Switch = void 0;
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
5
|
const anatomy_1 = require("@chakra-ui/anatomy");
|
|
6
|
+
const paletteFromTheme_1 = require("./paletteFromTheme");
|
|
6
7
|
const { defineMultiStyleConfig, definePartsStyle } = (0, react_1.createMultiStyleConfigHelpers)(anatomy_1.switchAnatomy.keys);
|
|
7
8
|
const $thumbBg = (0, react_1.cssVar)("switch-thumb-bg");
|
|
8
9
|
/**
|
|
@@ -10,15 +11,12 @@ const $thumbBg = (0, react_1.cssVar)("switch-thumb-bg");
|
|
|
10
11
|
* `_dark` gate at all, so every bare `<Switch>` renders a literal white knob on the dark canvas
|
|
11
12
|
* regardless of mode.
|
|
12
13
|
*/
|
|
13
|
-
const baseStyle = definePartsStyle(({ theme }) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
});
|
|
14
|
+
const baseStyle = definePartsStyle(({ theme }) => ({
|
|
15
|
+
thumb: {
|
|
16
|
+
[$thumbBg.variable]: (0, paletteFromTheme_1.paletteOf)(theme).backgroundColor.light,
|
|
17
|
+
bg: $thumbBg.reference,
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
22
20
|
exports.Switch = defineMultiStyleConfig({
|
|
23
21
|
baseStyle,
|
|
24
22
|
});
|
|
@@ -70,26 +70,26 @@ export declare const componentStyles: {
|
|
|
70
70
|
Menu: {
|
|
71
71
|
baseStyle?: (({ theme }: StyleFunctionProps) => {
|
|
72
72
|
list: {
|
|
73
|
-
[x: string]:
|
|
73
|
+
[x: string]: string;
|
|
74
74
|
bg: string;
|
|
75
|
-
color:
|
|
75
|
+
color: string;
|
|
76
76
|
};
|
|
77
77
|
item: {
|
|
78
78
|
bg: string;
|
|
79
79
|
_focus: {
|
|
80
|
-
[x: string]:
|
|
80
|
+
[x: string]: string;
|
|
81
81
|
bg: string;
|
|
82
82
|
};
|
|
83
83
|
_hover: {
|
|
84
|
-
[x: string]:
|
|
84
|
+
[x: string]: string;
|
|
85
85
|
bg: string;
|
|
86
86
|
};
|
|
87
87
|
_active: {
|
|
88
|
-
[x: string]:
|
|
88
|
+
[x: string]: string;
|
|
89
89
|
bg: string;
|
|
90
90
|
};
|
|
91
91
|
_expanded: {
|
|
92
|
-
[x: string]:
|
|
92
|
+
[x: string]: string;
|
|
93
93
|
bg: string;
|
|
94
94
|
};
|
|
95
95
|
};
|
|
@@ -139,9 +139,9 @@ export declare const componentStyles: {
|
|
|
139
139
|
Popover: {
|
|
140
140
|
baseStyle?: (({ theme }: StyleFunctionProps) => {
|
|
141
141
|
content: {
|
|
142
|
-
[x: string]:
|
|
142
|
+
[x: string]: string;
|
|
143
143
|
bg: string;
|
|
144
|
-
color:
|
|
144
|
+
color: string;
|
|
145
145
|
};
|
|
146
146
|
}) | undefined;
|
|
147
147
|
sizes?: {
|
|
@@ -188,7 +188,7 @@ export declare const componentStyles: {
|
|
|
188
188
|
Switch: {
|
|
189
189
|
baseStyle?: (({ theme }: StyleFunctionProps) => {
|
|
190
190
|
thumb: {
|
|
191
|
-
[x: string]:
|
|
191
|
+
[x: string]: string;
|
|
192
192
|
bg: string;
|
|
193
193
|
};
|
|
194
194
|
}) | undefined;
|
|
@@ -165,42 +165,40 @@ const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, onB
|
|
|
165
165
|
* `data-mode` for consumers that want to hook their own dark CSS.
|
|
166
166
|
*/
|
|
167
167
|
(0, react_1.useLayoutEffect)(() => {
|
|
168
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
169
168
|
const root = document.documentElement;
|
|
170
169
|
root.dataset.mode = resolvedMode;
|
|
171
|
-
const colors = resolvedTheme
|
|
172
|
-
const
|
|
173
|
-
const gray = colors.gray;
|
|
170
|
+
const { colors } = resolvedTheme;
|
|
171
|
+
const { gray, semantic } = colors;
|
|
174
172
|
const HUE_SCALES = [
|
|
175
173
|
"primary", "gray", "red", "orange", "yellow",
|
|
176
174
|
"green", "teal", "blue", "cyan", "purple", "pink",
|
|
177
175
|
];
|
|
178
|
-
const SEMANTIC_SCALES = ["success", "error", "warning", "info"];
|
|
176
|
+
const SEMANTIC_SCALES = ["success", "error", "warning", "info"];
|
|
179
177
|
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
180
|
-
//
|
|
181
|
-
//
|
|
178
|
+
// The dark gray ramp runs dark(50) → light(900), so low rungs read as surfaces
|
|
179
|
+
// and high rungs as text — correct in dark, cleared in light.
|
|
182
180
|
const SEMANTIC_VARS = {
|
|
183
|
-
"text-heading": gray
|
|
184
|
-
"text-subtle": gray
|
|
185
|
-
"bg-main": gray
|
|
186
|
-
"bg-quaternary": gray
|
|
187
|
-
"bg-accent": gray
|
|
188
|
-
"bg-neutral": gray
|
|
189
|
-
"border-default": gray
|
|
190
|
-
"border-dark": gray
|
|
191
|
-
"border-error":
|
|
192
|
-
"border-warning":
|
|
181
|
+
"text-heading": gray[900], "text-body": gray[700],
|
|
182
|
+
"text-subtle": gray[500], "text-input": gray[500],
|
|
183
|
+
"bg-main": gray[50], "bg-secondary": gray[100], "bg-tertiary": gray[100],
|
|
184
|
+
"bg-quaternary": gray[200], "bg-light": gray[50], "bg-medium": gray[100],
|
|
185
|
+
"bg-accent": gray[200], "bg-subtle": gray[100], "bg-muted": gray[200],
|
|
186
|
+
"bg-neutral": gray[100], "bg-base": gray[50], "bg-table-header": gray[100],
|
|
187
|
+
"border-default": gray[200], "border-light": gray[100],
|
|
188
|
+
"border-dark": gray[300], "border-input": gray[300],
|
|
189
|
+
"border-error": semantic.error[500], "border-success": semantic.success[500],
|
|
190
|
+
"border-warning": semantic.warning[500], "border-info": semantic.info[500],
|
|
193
191
|
};
|
|
194
|
-
const set = (name, val) =>
|
|
192
|
+
const set = (name, val) => root.style.setProperty(`--color-${name}`, val);
|
|
195
193
|
const clear = (name) => root.style.removeProperty(`--color-${name}`);
|
|
196
194
|
const allRampNames = [...HUE_SCALES, ...SEMANTIC_SCALES].flatMap((s) => RUNGS.map((r) => `${s}-${r}`));
|
|
197
195
|
if (resolvedMode === "dark") {
|
|
198
196
|
for (const s of HUE_SCALES)
|
|
199
197
|
for (const r of RUNGS)
|
|
200
|
-
set(`${s}-${r}`,
|
|
198
|
+
set(`${s}-${r}`, colors[s][r]);
|
|
201
199
|
for (const s of SEMANTIC_SCALES)
|
|
202
200
|
for (const r of RUNGS)
|
|
203
|
-
set(`${s}-${r}`,
|
|
201
|
+
set(`${s}-${r}`, semantic[s][r]);
|
|
204
202
|
for (const [name, val] of Object.entries(SEMANTIC_VARS))
|
|
205
203
|
set(name, val);
|
|
206
204
|
}
|
|
@@ -25,33 +25,23 @@ const toBrandLabel = (brand) => brand.charAt(0).toUpperCase() + brand.slice(1);
|
|
|
25
25
|
* the dot always matches what selecting that brand actually looks like,
|
|
26
26
|
* regardless of which brand/mode is currently active.
|
|
27
27
|
*/
|
|
28
|
-
const brandSwatchColor = (brand) =>
|
|
29
|
-
var _a, _b, _c, _d, _e;
|
|
30
|
-
return (_e = (_d = (_c = (_b = (_a = index_1.brandThemes[brand]) === null || _a === void 0 ? void 0 : _a.light) === null || _b === void 0 ? void 0 : _b.colors) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d[500]) !== null && _e !== void 0 ? _e : "gray.400";
|
|
31
|
-
};
|
|
28
|
+
const brandSwatchColor = (brand) => index_1.brandThemes[brand].light.colors.primary[500];
|
|
32
29
|
const BrandSwatch = ({ brand }) => ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-block", w: "0.625rem", h: "0.625rem", borderRadius: "full", bg: brandSwatchColor(brand), border: "1px solid", borderColor: "whiteAlpha.300", flexShrink: 0 }));
|
|
33
30
|
/**
|
|
34
31
|
* Palette values already differ per color mode (`brandThemes[brand].light|dark`), so tokens
|
|
35
32
|
* are read straight from the active theme — no `useColorModeValue` pairing needed here.
|
|
36
|
-
* Fallbacks are Chakra token names, never literal colors, for themes without a brand palette.
|
|
37
33
|
*/
|
|
38
34
|
const useSwitcherColors = () => {
|
|
39
|
-
|
|
40
|
-
const colors = (0, useCustomTheme_1.useCustomTheme)().colors;
|
|
35
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
41
36
|
return {
|
|
42
|
-
trackBg:
|
|
43
|
-
activeBg:
|
|
44
|
-
activeColor:
|
|
45
|
-
mutedColor:
|
|
46
|
-
hoverBg:
|
|
47
|
-
borderColor:
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
// Re-deriving it here too and pushing it back via `sx` on every render caused a redundant
|
|
51
|
-
// Emotion style recompute per render, which showed up as flicker while hovering/scrolling
|
|
52
|
-
// this list. Keep menuColor (Menu.styles.ts doesn't set list `color` per this component's
|
|
53
|
-
// needs) but stop duplicating menuBg.
|
|
54
|
-
menuColor: (_0 = (_y = (_x = colors === null || colors === void 0 ? void 0 : colors.text) === null || _x === void 0 ? void 0 : _x[900]) !== null && _y !== void 0 ? _y : (_z = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _z === void 0 ? void 0 : _z[900]) !== null && _0 !== void 0 ? _0 : "gray.900",
|
|
37
|
+
trackBg: colors.backgroundColor.secondary,
|
|
38
|
+
activeBg: colors.backgroundColor.main,
|
|
39
|
+
activeColor: colors.primary[500],
|
|
40
|
+
mutedColor: colors.text[600],
|
|
41
|
+
hoverBg: colors.gray[100],
|
|
42
|
+
borderColor: colors.border[200],
|
|
43
|
+
// NOTE: menuBg lives in Menu.styles.ts — re-pushing it via `sx` flickers on every render.
|
|
44
|
+
menuColor: colors.text[900],
|
|
55
45
|
};
|
|
56
46
|
};
|
|
57
47
|
const BrandMenu = ({ size }) => {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
3
|
+
const neutrals_1 = require("../neutrals");
|
|
7
4
|
const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
|
|
5
|
+
const brandInk_1 = require("../../builders/brandInk");
|
|
8
6
|
const PRIMARY_500 = "#0f9d8a"; // teal-emerald core (balanced, not too green/blue)
|
|
9
7
|
const primary = {
|
|
10
8
|
50: "#e6f7f5",
|
|
@@ -20,7 +18,8 @@ const primary = {
|
|
|
20
18
|
opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
|
|
21
19
|
};
|
|
22
20
|
const palette = {
|
|
23
|
-
...
|
|
21
|
+
...neutrals_1.neutralTokens,
|
|
22
|
+
...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
|
|
24
23
|
// Stops retuned so white gradient-button text (onGradient, accentText.ts) clears AA at both
|
|
25
24
|
// ends — the original pair let white drop to 3.38/2.43 against from/to. Same hue, darker.
|
|
26
25
|
// Both nudged one step further (4.537/4.515 -> 4.618/4.616): the first pass cleared AA by
|
|
@@ -128,8 +127,7 @@ const palette = {
|
|
|
128
127
|
},
|
|
129
128
|
boxShadow: {
|
|
130
129
|
primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
|
|
131
|
-
|
|
132
|
-
default: palette_light_1.default.boxShadow.default,
|
|
130
|
+
...neutrals_1.sharedBoxShadow,
|
|
133
131
|
},
|
|
134
132
|
};
|
|
135
133
|
exports.default = palette;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
|
|
4
|
+
const neutrals_1 = require("../neutrals");
|
|
4
5
|
const PRIMARY_500 = "#8B3FC8";
|
|
5
6
|
const SECONDARY_ANCHOR = "#1e0f30";
|
|
6
7
|
const primary = {
|
|
@@ -30,56 +31,6 @@ const secondary = {
|
|
|
30
31
|
opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(SECONDARY_ANCHOR),
|
|
31
32
|
};
|
|
32
33
|
const tertiary = { ...secondary };
|
|
33
|
-
const semantic = {
|
|
34
|
-
success: {
|
|
35
|
-
50: "#e9f8ef",
|
|
36
|
-
100: "#bbe9cc",
|
|
37
|
-
200: "#9adeb4",
|
|
38
|
-
300: "#6ccf92",
|
|
39
|
-
400: "#4fc67d",
|
|
40
|
-
500: "#23b85c",
|
|
41
|
-
600: "#20a754",
|
|
42
|
-
700: "#198341",
|
|
43
|
-
800: "#136533",
|
|
44
|
-
900: "#0f4d27",
|
|
45
|
-
},
|
|
46
|
-
error: {
|
|
47
|
-
50: "#feedeb",
|
|
48
|
-
100: "#fbc6c2",
|
|
49
|
-
200: "#f9aaa4",
|
|
50
|
-
300: "#f6837b",
|
|
51
|
-
400: "#f56b61",
|
|
52
|
-
500: "#f2463a",
|
|
53
|
-
600: "#dc4035",
|
|
54
|
-
700: "#ac3229",
|
|
55
|
-
800: "#852720",
|
|
56
|
-
900: "#661d18",
|
|
57
|
-
},
|
|
58
|
-
warning: {
|
|
59
|
-
50: "#fff4ef",
|
|
60
|
-
100: "#ffddce",
|
|
61
|
-
200: "#ffccb7",
|
|
62
|
-
300: "#ffb596",
|
|
63
|
-
400: "#ffa781",
|
|
64
|
-
500: "#ff9162",
|
|
65
|
-
600: "#e88459",
|
|
66
|
-
700: "#b56746",
|
|
67
|
-
800: "#8c5036",
|
|
68
|
-
900: "#6b3d29",
|
|
69
|
-
},
|
|
70
|
-
info: {
|
|
71
|
-
50: "#eff9fc",
|
|
72
|
-
100: "#cdedf5",
|
|
73
|
-
200: "#b5e4f0",
|
|
74
|
-
300: "#94d7e9",
|
|
75
|
-
400: "#7fd0e5",
|
|
76
|
-
500: "#5fc4de",
|
|
77
|
-
600: "#56b2ea",
|
|
78
|
-
700: "#438b9e",
|
|
79
|
-
800: "#346c78",
|
|
80
|
-
900: "#28525d",
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
34
|
const gray = {
|
|
84
35
|
50: "#f9f7fb",
|
|
85
36
|
100: "#f0eaf6",
|
|
@@ -100,51 +51,6 @@ const gray = {
|
|
|
100
51
|
};
|
|
101
52
|
// These global color scales stay unchanged — they are
|
|
102
53
|
// utility palettes, not theme-specific
|
|
103
|
-
const red = {
|
|
104
|
-
50: "#feedeb", 100: "#fbc6c2", 200: "#f9aaa4", 300: "#f6837b",
|
|
105
|
-
400: "#f56b61", 500: "#f2463a", 600: "#dc4035", 700: "#ac3229",
|
|
106
|
-
800: "#852720", 900: "#661d18",
|
|
107
|
-
};
|
|
108
|
-
const orange = {
|
|
109
|
-
50: "#fff4ef", 100: "#ffddce", 200: "#ffccb7", 300: "#ffb596",
|
|
110
|
-
400: "#ffa781", 500: "#ff9162", 600: "#e88459", 700: "#b56746",
|
|
111
|
-
800: "#8c5036", 900: "#6b3d29",
|
|
112
|
-
};
|
|
113
|
-
const yellow = {
|
|
114
|
-
50: "#fefbec", 100: "#fdf1c5", 200: "#fbeba9", 300: "#fae281",
|
|
115
|
-
400: "#f9dc69", 500: "#f7d343", 600: "#e1c03d", 700: "#af9630",
|
|
116
|
-
800: "#887425", 900: "#68591c",
|
|
117
|
-
};
|
|
118
|
-
const green = {
|
|
119
|
-
50: "#e9f8ef", 100: "#bbe9cc", 200: "#9adeb4", 300: "#6ccf92",
|
|
120
|
-
400: "#4fc67d", 500: "#23b85c", 600: "#20a754", 700: "#198341",
|
|
121
|
-
800: "#136533", 900: "#0f4d27",
|
|
122
|
-
};
|
|
123
|
-
const teal = {
|
|
124
|
-
50: "#eff9fc", 100: "#cdedf5", 200: "#b5e4f0", 300: "#94d7e9",
|
|
125
|
-
400: "#7fd0e5", 500: "#5fc4de", 600: "#56b2ea", 700: "#438b9e",
|
|
126
|
-
800: "#346c78", 900: "#28525d",
|
|
127
|
-
};
|
|
128
|
-
const blue = {
|
|
129
|
-
50: "#ebf8ff", 100: "#bee3f8", 200: "#90cdf4", 300: "#63b3ed",
|
|
130
|
-
400: "#4299e1", 500: "#3182ce", 600: "#2b6cb0", 700: "#2c5282",
|
|
131
|
-
800: "#2a4365", 900: "#1a365d",
|
|
132
|
-
};
|
|
133
|
-
const cyan = {
|
|
134
|
-
50: "#edfdfd", 100: "#c4f1f9", 200: "#9decf9", 300: "#76e4f7",
|
|
135
|
-
400: "#0bc5ea", 500: "#00b5d8", 600: "#00a3c4", 700: "#0987a0",
|
|
136
|
-
800: "#086f83", 900: "#065666",
|
|
137
|
-
};
|
|
138
|
-
const purple = {
|
|
139
|
-
50: "#faf5ff", 100: "#e9d8fd", 200: "#d6bcfa", 300: "#b794f4",
|
|
140
|
-
400: "#9f7aea", 500: "#805ad5", 600: "#6b46c1", 700: "#553c9a",
|
|
141
|
-
800: "#44337a", 900: "#322659",
|
|
142
|
-
};
|
|
143
|
-
const pink = {
|
|
144
|
-
50: "#fff5f7", 100: "#fed7e2", 200: "#fbb6ce", 300: "#f687b3",
|
|
145
|
-
400: "#ed64a6", 500: "#d53f8c", 600: "#b83280", 700: "#97266d",
|
|
146
|
-
800: "#702459", 900: "#521b41",
|
|
147
|
-
};
|
|
148
54
|
const backgroundColor = {
|
|
149
55
|
main: "#f9f7fc",
|
|
150
56
|
secondary: "#f2edf8",
|
|
@@ -210,8 +116,7 @@ const placeholder = {
|
|
|
210
116
|
};
|
|
211
117
|
const boxShadow = {
|
|
212
118
|
primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
|
|
213
|
-
|
|
214
|
-
default: "#00000033",
|
|
119
|
+
...neutrals_1.sharedBoxShadow,
|
|
215
120
|
};
|
|
216
121
|
const sidebar = {
|
|
217
122
|
background: {
|
|
@@ -283,31 +188,15 @@ const disabled = {
|
|
|
283
188
|
800: "#625d75",
|
|
284
189
|
900: "#4b4759",
|
|
285
190
|
};
|
|
286
|
-
//
|
|
287
|
-
|
|
288
|
-
// original let white drop to 3.53 there (`from` already passed at 5.76, unchanged).
|
|
289
|
-
// Nudged one step further (4.511 -> 4.609): the first pass cleared AA by <0.02, too thin a
|
|
290
|
-
// margin to trust against rounding/rendering variance.
|
|
291
|
-
const gradient = { from: "#8B3FC8", to: "#df187a" };
|
|
191
|
+
// Single-hue gradient: white clears AA by margin, not by hundredths. See gradientTone.test.ts.
|
|
192
|
+
const gradient = { from: "#8b3fc8", to: "#762d9d" };
|
|
292
193
|
const palette = {
|
|
293
194
|
gradient,
|
|
294
195
|
primary,
|
|
295
196
|
secondary,
|
|
296
197
|
tertiary,
|
|
297
|
-
|
|
298
|
-
black: "#000",
|
|
299
|
-
white: "#fff",
|
|
300
|
-
semantic,
|
|
198
|
+
...neutrals_1.neutralTokens,
|
|
301
199
|
gray,
|
|
302
|
-
red,
|
|
303
|
-
orange,
|
|
304
|
-
yellow,
|
|
305
|
-
green,
|
|
306
|
-
teal,
|
|
307
|
-
blue,
|
|
308
|
-
cyan,
|
|
309
|
-
purple,
|
|
310
|
-
pink,
|
|
311
200
|
backgroundColor,
|
|
312
201
|
background,
|
|
313
202
|
text,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
3
|
+
const neutrals_1 = require("../neutrals");
|
|
7
4
|
const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
|
|
5
|
+
const brandInk_1 = require("../../builders/brandInk");
|
|
8
6
|
const PRIMARY_500 = "#2d6a4f"; // was #2caa3d — deeper, forest-toned
|
|
9
7
|
const primary = {
|
|
10
8
|
50: "#edf7f2",
|
|
@@ -20,7 +18,8 @@ const primary = {
|
|
|
20
18
|
opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
|
|
21
19
|
};
|
|
22
20
|
const palette = {
|
|
23
|
-
...
|
|
21
|
+
...neutrals_1.neutralTokens,
|
|
22
|
+
...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
|
|
24
23
|
// `to` stop retuned so white gradient-button text (onGradient, accentText.ts) clears AA — the
|
|
25
24
|
// original let white drop to 2.49 there (`from` already passed at 6.39, unchanged).
|
|
26
25
|
// Nudged one step further (4.519 -> 4.627): the first pass cleared AA by <0.02, too thin a
|
|
@@ -126,8 +125,7 @@ const palette = {
|
|
|
126
125
|
},
|
|
127
126
|
boxShadow: {
|
|
128
127
|
primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
|
|
129
|
-
|
|
130
|
-
default: palette_light_1.default.boxShadow.default,
|
|
128
|
+
...neutrals_1.sharedBoxShadow,
|
|
131
129
|
},
|
|
132
130
|
};
|
|
133
131
|
exports.default = palette;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NeutralPaletteTokens } from "../types";
|
|
2
|
+
/** Non-brand shadow tints. Only `primary` is brand-derived. */
|
|
3
|
+
export declare const sharedBoxShadow: {
|
|
4
|
+
error: string;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
/** Utility scales shared by every brand — never theme-specific. */
|
|
8
|
+
export declare const neutralTokens: NeutralPaletteTokens;
|