pixelize-design-library 2.4.2-beta.2 → 2.4.2-beta.4
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/Accordion/Accordion.js +2 -2
- package/dist/Components/Button/Button.styles.js +4 -3
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +5 -5
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/CopyButton/CopyButton.js +1 -1
- package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/Components/DatePicker/CalendarPanel.js +1 -1
- package/dist/Components/DatePicker/RangeDatePicker.js +1 -1
- package/dist/Components/DatePicker/SingleDatePicker.js +1 -1
- package/dist/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/Components/Dropdown/DropDown.js +3 -13
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/Components/FilePreview/FilePreview.js +1 -1
- package/dist/Components/FilterSidebar/FilterSidebar.js +2 -2
- package/dist/Components/Input/TextInput.styles.js +5 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +5 -45
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +4 -5
- package/dist/Components/MultiSelect/MultiSelect.js +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- package/dist/Components/PinInput/PinInput.js +1 -1
- package/dist/Components/PlanPill/PlanPill.js +5 -5
- package/dist/Components/PlanPill/planPillGradient.d.ts +2 -14
- package/dist/Components/PlanPill/planPillGradient.js +3 -15
- package/dist/Components/ProductCard/ProductPrice.js +1 -1
- package/dist/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/Components/Reorder/Reorder.js +1 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +13 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +11 -0
- package/dist/Components/SearchSelect/SearchSelect.js +3 -3
- package/dist/Components/Select/Select.styles.js +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/Components/SelectV2/SelectV2.js +3 -10
- package/dist/Components/StageProgress/StageProgress.js +2 -9
- package/dist/Components/Table/Table.js +7 -20
- package/dist/Components/Table/components/TableBody.js +1 -1
- package/dist/Components/Table/components/TableHeader.js +1 -1
- package/dist/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/Components/Table/settings/ManageColumns.js +2 -16
- package/dist/Components/Table/settings/TableSettings.js +4 -10
- package/dist/Components/Timeline/Timeline.js +2 -2
- package/dist/Components/Toaster/Toaster.js +1 -1
- package/dist/Components/UpgradeButton/UpgradeButton.js +3 -3
- package/dist/Constants/Sidebar.js +3 -2
- package/dist/Theme/chakra/Menu.styles.d.ts +7 -6
- package/dist/Theme/chakra/Menu.styles.js +9 -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 +10 -9
- package/dist/Theme/chakra/createBrandTheme.js +3 -16
- package/dist/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/Theme/provider/ThemeSwitcher.js +10 -20
- package/dist/Theme/tokens/brands/lavender/palette.light.js +2 -6
- package/dist/Theme/tokens/brands/slate/palette.light.js +1 -5
- package/dist/Theme/tokens/builders/gradientInk.d.ts +22 -0
- package/dist/Theme/tokens/builders/gradientInk.js +28 -0
- package/dist/Theme/tokens/builders/index.d.ts +2 -0
- package/dist/Theme/tokens/builders/index.js +2 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +5 -0
- package/dist/Theme/tokens/builders/outlineRung.js +19 -0
- package/dist/Theme/tokens/builders/scrollbar.d.ts +12 -0
- package/dist/Theme/tokens/builders/scrollbar.js +57 -0
- package/dist/Theme/tokens/builders/surfaceRungs.d.ts +2 -0
- package/dist/Theme/tokens/builders/surfaceRungs.js +7 -2
- package/dist/esm/Components/Accordion/Accordion.js +2 -2
- package/dist/esm/Components/Button/Button.styles.js +5 -4
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +5 -5
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/CopyButton/CopyButton.js +1 -1
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +1 -1
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +1 -1
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +1 -1
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/esm/Components/Dropdown/DropDown.js +3 -13
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/esm/Components/FilePreview/FilePreview.js +1 -1
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +2 -2
- package/dist/esm/Components/Input/TextInput.styles.js +5 -1
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +5 -45
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -5
- package/dist/esm/Components/MultiSelect/MultiSelect.js +1 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- package/dist/esm/Components/PinInput/PinInput.js +1 -1
- package/dist/esm/Components/PlanPill/PlanPill.js +6 -6
- package/dist/esm/Components/PlanPill/planPillGradient.js +3 -15
- package/dist/esm/Components/ProductCard/ProductPrice.js +1 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/esm/Components/Reorder/Reorder.js +1 -1
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +3 -3
- package/dist/esm/Components/Select/Select.styles.js +1 -1
- package/dist/esm/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/esm/Components/SelectV2/SelectV2.js +3 -10
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -9
- package/dist/esm/Components/Table/Table.js +7 -20
- package/dist/esm/Components/Table/components/TableBody.js +1 -1
- package/dist/esm/Components/Table/components/TableHeader.js +1 -1
- package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/esm/Components/Table/settings/ManageColumns.js +2 -16
- package/dist/esm/Components/Table/settings/TableSettings.js +4 -10
- package/dist/esm/Components/Timeline/Timeline.js +2 -2
- package/dist/esm/Components/Toaster/Toaster.js +1 -1
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -3
- package/dist/esm/Constants/Sidebar.js +3 -2
- package/dist/esm/Theme/chakra/Menu.styles.js +9 -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/chakra/createBrandTheme.js +3 -16
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/esm/Theme/provider/ThemeSwitcher.js +10 -20
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +2 -6
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +1 -5
- package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
- package/dist/esm/Theme/tokens/builders/index.js +2 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +18 -0
- package/dist/esm/Theme/tokens/builders/scrollbar.js +52 -0
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +7 -2
- package/dist/esm/index.js +3 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -3
- package/package.json +1 -1
|
@@ -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,27 @@ 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
|
+
borderColor: string;
|
|
76
77
|
};
|
|
77
78
|
item: {
|
|
78
79
|
bg: string;
|
|
79
80
|
_focus: {
|
|
80
|
-
[x: string]:
|
|
81
|
+
[x: string]: string;
|
|
81
82
|
bg: string;
|
|
82
83
|
};
|
|
83
84
|
_hover: {
|
|
84
|
-
[x: string]:
|
|
85
|
+
[x: string]: string;
|
|
85
86
|
bg: string;
|
|
86
87
|
};
|
|
87
88
|
_active: {
|
|
88
|
-
[x: string]:
|
|
89
|
+
[x: string]: string;
|
|
89
90
|
bg: string;
|
|
90
91
|
};
|
|
91
92
|
_expanded: {
|
|
92
|
-
[x: string]:
|
|
93
|
+
[x: string]: string;
|
|
93
94
|
bg: string;
|
|
94
95
|
};
|
|
95
96
|
};
|
|
@@ -139,9 +140,9 @@ export declare const componentStyles: {
|
|
|
139
140
|
Popover: {
|
|
140
141
|
baseStyle?: (({ theme }: StyleFunctionProps) => {
|
|
141
142
|
content: {
|
|
142
|
-
[x: string]:
|
|
143
|
+
[x: string]: string;
|
|
143
144
|
bg: string;
|
|
144
|
-
color:
|
|
145
|
+
color: string;
|
|
145
146
|
};
|
|
146
147
|
}) | undefined;
|
|
147
148
|
sizes?: {
|
|
@@ -188,7 +189,7 @@ export declare const componentStyles: {
|
|
|
188
189
|
Switch: {
|
|
189
190
|
baseStyle?: (({ theme }: StyleFunctionProps) => {
|
|
190
191
|
thumb: {
|
|
191
|
-
[x: string]:
|
|
192
|
+
[x: string]: string;
|
|
192
193
|
bg: string;
|
|
193
194
|
};
|
|
194
195
|
}) | undefined;
|
|
@@ -9,6 +9,7 @@ const common_web_1 = __importDefault(require("./common.web"));
|
|
|
9
9
|
const fonts_web_1 = __importDefault(require("./fonts.web"));
|
|
10
10
|
const componentStyles_1 = require("./componentStyles");
|
|
11
11
|
const accentText_1 = require("../tokens/builders/accentText");
|
|
12
|
+
const scrollbar_1 = require("../tokens/builders/scrollbar");
|
|
12
13
|
/**
|
|
13
14
|
* Builds a Chakra theme from a pure brand palette.
|
|
14
15
|
*
|
|
@@ -89,22 +90,8 @@ const createBrandTheme = (palette, options = {}) => {
|
|
|
89
90
|
color: (0, accentText_1.onFilled)(palette.primary[500], palette.white, palette.black),
|
|
90
91
|
},
|
|
91
92
|
// `color-scheme: dark` gives WebKit/Blink a dark scrollbar by default, but it's the
|
|
92
|
-
// OS's generic dark gray, not brand-aware
|
|
93
|
-
|
|
94
|
-
"::-webkit-scrollbar": {
|
|
95
|
-
width: "10px",
|
|
96
|
-
height: "10px",
|
|
97
|
-
},
|
|
98
|
-
"::-webkit-scrollbar-track": {
|
|
99
|
-
background: palette.backgroundColor.main,
|
|
100
|
-
},
|
|
101
|
-
"::-webkit-scrollbar-thumb": {
|
|
102
|
-
background: palette.gray[600],
|
|
103
|
-
borderRadius: "6px",
|
|
104
|
-
},
|
|
105
|
-
"::-webkit-scrollbar-thumb:hover": {
|
|
106
|
-
background: palette.gray[500],
|
|
107
|
-
},
|
|
93
|
+
// OS's generic dark gray, not brand-aware.
|
|
94
|
+
...(0, scrollbar_1.globalScrollbarStyles)(palette),
|
|
108
95
|
// Chrome/Edge autofill paints its own opaque yellow/white fill behind the input
|
|
109
96
|
// text via `-webkit-box-shadow` (not `background`), so a plain `bg` override never
|
|
110
97
|
// reaches it — a bright light box survives on every dark autofilled field unless
|
|
@@ -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 }) => {
|
|
@@ -188,12 +188,8 @@ const disabled = {
|
|
|
188
188
|
800: "#625d75",
|
|
189
189
|
900: "#4b4759",
|
|
190
190
|
};
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
// original let white drop to 3.53 there (`from` already passed at 5.76, unchanged).
|
|
194
|
-
// Nudged one step further (4.511 -> 4.609): the first pass cleared AA by <0.02, too thin a
|
|
195
|
-
// margin to trust against rounding/rendering variance.
|
|
196
|
-
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" };
|
|
197
193
|
const palette = {
|
|
198
194
|
gradient,
|
|
199
195
|
primary,
|
|
@@ -20,11 +20,7 @@ const primary = {
|
|
|
20
20
|
const palette = {
|
|
21
21
|
...neutrals_1.neutralTokens,
|
|
22
22
|
...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
|
|
23
|
-
|
|
24
|
-
// original let white drop to 2.98 there (`from` already passed at 4.83, unchanged).
|
|
25
|
-
// Nudged one step further (4.520 -> 4.608): the first pass cleared AA by <0.02, too thin a
|
|
26
|
-
// margin to trust against rounding/rendering variance.
|
|
27
|
-
gradient: { from: "#6b7280", to: "#5664f6" }, // slate gray → indigo
|
|
23
|
+
gradient: { from: "#666d7a", to: "#4a4e59" },
|
|
28
24
|
primary,
|
|
29
25
|
tertiary: { ...primary },
|
|
30
26
|
gray: {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Gradient = {
|
|
2
|
+
from: string;
|
|
3
|
+
to: string;
|
|
4
|
+
};
|
|
5
|
+
/** A gradient already safe to paint, plus the ink that is guaranteed legible on it. */
|
|
6
|
+
export type ResolvedGradient = Gradient & {
|
|
7
|
+
ink: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Sinks both stops until WHITE ink clears AA, keeping each stop's hue. Any mid-tone gradient
|
|
11
|
+
* otherwise flips `onGradient` to black ink, so the same element reads white-on-colour in one
|
|
12
|
+
* brand and black-on-pastel in the next.
|
|
13
|
+
*/
|
|
14
|
+
export declare const inkSafeGradient: (gradient: Gradient) => Gradient;
|
|
15
|
+
/**
|
|
16
|
+
* The only correct way to paint text on a gradient: returns the stops to draw AND the ink for
|
|
17
|
+
* them. Calling `onGradient` on raw stops is the black-text bug — it picks ink for a backdrop
|
|
18
|
+
* that is then painted differently.
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveGradient: (gradient: Gradient, white: string, black: string) => ResolvedGradient;
|
|
21
|
+
/** `linear-gradient(...)` for a resolved pair — one spelling of the CSS everywhere. */
|
|
22
|
+
export declare const gradientCss: (g: Gradient, angle?: string) => string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gradientCss = exports.resolveGradient = exports.inkSafeGradient = void 0;
|
|
4
|
+
const accentText_1 = require("./accentText");
|
|
5
|
+
const statusTone_1 = require("./statusTone");
|
|
6
|
+
/**
|
|
7
|
+
* Sinks both stops until WHITE ink clears AA, keeping each stop's hue. Any mid-tone gradient
|
|
8
|
+
* otherwise flips `onGradient` to black ink, so the same element reads white-on-colour in one
|
|
9
|
+
* brand and black-on-pastel in the next.
|
|
10
|
+
*/
|
|
11
|
+
const inkSafeGradient = (gradient) => ({
|
|
12
|
+
from: (0, statusTone_1.resolveAvatarFill)(gradient.from),
|
|
13
|
+
to: (0, statusTone_1.resolveAvatarFill)(gradient.to),
|
|
14
|
+
});
|
|
15
|
+
exports.inkSafeGradient = inkSafeGradient;
|
|
16
|
+
/**
|
|
17
|
+
* The only correct way to paint text on a gradient: returns the stops to draw AND the ink for
|
|
18
|
+
* them. Calling `onGradient` on raw stops is the black-text bug — it picks ink for a backdrop
|
|
19
|
+
* that is then painted differently.
|
|
20
|
+
*/
|
|
21
|
+
const resolveGradient = (gradient, white, black) => {
|
|
22
|
+
const { from, to } = (0, exports.inkSafeGradient)(gradient);
|
|
23
|
+
return { from, to, ink: (0, accentText_1.onGradient)(from, to, white, black) };
|
|
24
|
+
};
|
|
25
|
+
exports.resolveGradient = resolveGradient;
|
|
26
|
+
/** `linear-gradient(...)` for a resolved pair — one spelling of the CSS everywhere. */
|
|
27
|
+
const gradientCss = (g, angle = "135deg") => `linear-gradient(${angle}, ${g.from} 0%, ${g.to} 100%)`;
|
|
28
|
+
exports.gradientCss = gradientCss;
|
|
@@ -19,3 +19,5 @@ __exportStar(require("./buildBrandTokens"), exports);
|
|
|
19
19
|
__exportStar(require("./buildDarkPalette"), exports);
|
|
20
20
|
__exportStar(require("./chartColorsFromTheme"), exports);
|
|
21
21
|
__exportStar(require("./color"), exports);
|
|
22
|
+
__exportStar(require("./scrollbar"), exports);
|
|
23
|
+
__exportStar(require("./gradientInk"), exports);
|
|
@@ -14,6 +14,11 @@ export declare const AA_NON_TEXT = 3;
|
|
|
14
14
|
* Tries the far side first, falls back to the near side, and stops at the first passing step.
|
|
15
15
|
*/
|
|
16
16
|
export declare function liftToContrast(hex: string, backdrop: string, target?: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* Mirror of `liftToContrast`: walks ink TOWARD the backdrop, stopping at the last step that
|
|
19
|
+
* still clears `target`. For ink that must stay legible without reading as body copy.
|
|
20
|
+
*/
|
|
21
|
+
export declare function softenToContrast(hex: string, backdrop: string, target: number): string;
|
|
17
22
|
/**
|
|
18
23
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
19
24
|
* pickers, the editor's inputs). It was authored as a decorative value — measured 1.30-2.56:1
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AA_NON_TEXT = exports.MIN_PERCEPTIBLE_STEP = void 0;
|
|
4
4
|
exports.liftToContrast = liftToContrast;
|
|
5
|
+
exports.softenToContrast = softenToContrast;
|
|
5
6
|
exports.withOutlineRung = withOutlineRung;
|
|
6
7
|
exports.resolveHoverTint = resolveHoverTint;
|
|
7
8
|
const color_1 = require("./color");
|
|
@@ -36,6 +37,24 @@ function liftToContrast(hex, backdrop, target = exports.AA_NON_TEXT) {
|
|
|
36
37
|
const ends = [(0, color_1.withLightness)(hex, 100, s), (0, color_1.withLightness)(hex, 0, s)];
|
|
37
38
|
return (0, color_1.contrastRatio)(ends[0], backdrop) >= (0, color_1.contrastRatio)(ends[1], backdrop) ? ends[0] : ends[1];
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Mirror of `liftToContrast`: walks ink TOWARD the backdrop, stopping at the last step that
|
|
42
|
+
* still clears `target`. For ink that must stay legible without reading as body copy.
|
|
43
|
+
*/
|
|
44
|
+
function softenToContrast(hex, backdrop, target) {
|
|
45
|
+
if ((0, color_1.contrastRatio)(hex, backdrop) <= target)
|
|
46
|
+
return hex;
|
|
47
|
+
const { s, l: start } = (0, color_1.hexToHsl)(hex);
|
|
48
|
+
const toward = (0, color_1.relativeLuminance)(backdrop) < 0.5 ? -1 : 1;
|
|
49
|
+
let softest = hex;
|
|
50
|
+
for (let l = start; l > 0 && l < 100; l += toward) {
|
|
51
|
+
const next = (0, color_1.withLightness)(hex, l, s);
|
|
52
|
+
if ((0, color_1.contrastRatio)(next, backdrop) < target)
|
|
53
|
+
break;
|
|
54
|
+
softest = next;
|
|
55
|
+
}
|
|
56
|
+
return softest;
|
|
57
|
+
}
|
|
39
58
|
/**
|
|
40
59
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
41
60
|
* pickers, the editor's inputs). It was authored as a decorative value — measured 1.30-2.56:1
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
export type ScrollbarStyle = Record<string, unknown>;
|
|
3
|
+
/** One width everywhere. The 3px, 4px, 5px and 10px bars in use were all accidents. */
|
|
4
|
+
export declare const SCROLLBAR_WIDTH = "6px";
|
|
5
|
+
export type ScrollbarVariant = "default" | "overlay" | "hover";
|
|
6
|
+
/**
|
|
7
|
+
* The single source of scrollbar chrome. `overlay` drops the track for bars that float over a
|
|
8
|
+
* card; `hover` keeps the thumb invisible until the region is hovered.
|
|
9
|
+
*/
|
|
10
|
+
export declare function scrollbarStyles(palette: PaletteProps, variant?: ScrollbarVariant): ScrollbarStyle;
|
|
11
|
+
/** The same chrome for the document itself, where `&` selectors do not apply. */
|
|
12
|
+
export declare function globalScrollbarStyles(palette: PaletteProps): ScrollbarStyle;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SCROLLBAR_WIDTH = void 0;
|
|
4
|
+
exports.scrollbarStyles = scrollbarStyles;
|
|
5
|
+
exports.globalScrollbarStyles = globalScrollbarStyles;
|
|
6
|
+
/** One width everywhere. The 3px, 4px, 5px and 10px bars in use were all accidents. */
|
|
7
|
+
exports.SCROLLBAR_WIDTH = "6px";
|
|
8
|
+
const RADIUS = "6px";
|
|
9
|
+
/**
|
|
10
|
+
* The single source of scrollbar chrome. `overlay` drops the track for bars that float over a
|
|
11
|
+
* card; `hover` keeps the thumb invisible until the region is hovered.
|
|
12
|
+
*/
|
|
13
|
+
function scrollbarStyles(palette, variant = "default") {
|
|
14
|
+
const { gray } = palette;
|
|
15
|
+
const track = variant === "default" ? gray[100] : "transparent";
|
|
16
|
+
const thumb = variant === "hover" ? "transparent" : gray[400];
|
|
17
|
+
return {
|
|
18
|
+
scrollbarWidth: "thin",
|
|
19
|
+
scrollbarColor: `${thumb} ${track}`,
|
|
20
|
+
"&::-webkit-scrollbar": {
|
|
21
|
+
width: exports.SCROLLBAR_WIDTH,
|
|
22
|
+
height: exports.SCROLLBAR_WIDTH,
|
|
23
|
+
},
|
|
24
|
+
"&::-webkit-scrollbar-track": {
|
|
25
|
+
background: track,
|
|
26
|
+
borderRadius: RADIUS,
|
|
27
|
+
},
|
|
28
|
+
"&::-webkit-scrollbar-thumb": {
|
|
29
|
+
background: thumb,
|
|
30
|
+
borderRadius: RADIUS,
|
|
31
|
+
transition: "background 0.2s ease",
|
|
32
|
+
},
|
|
33
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
34
|
+
background: gray[500],
|
|
35
|
+
},
|
|
36
|
+
"&::-webkit-scrollbar-corner": {
|
|
37
|
+
background: track,
|
|
38
|
+
},
|
|
39
|
+
...(variant === "hover"
|
|
40
|
+
? {
|
|
41
|
+
"&:hover": { scrollbarColor: `${gray[400]} ${track}` },
|
|
42
|
+
"&:hover::-webkit-scrollbar-thumb": { background: gray[400] },
|
|
43
|
+
}
|
|
44
|
+
: {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** The same chrome for the document itself, where `&` selectors do not apply. */
|
|
48
|
+
function globalScrollbarStyles(palette) {
|
|
49
|
+
const { gray } = palette;
|
|
50
|
+
return {
|
|
51
|
+
"::-webkit-scrollbar": { width: exports.SCROLLBAR_WIDTH, height: exports.SCROLLBAR_WIDTH },
|
|
52
|
+
"::-webkit-scrollbar-track": { background: gray[100] },
|
|
53
|
+
"::-webkit-scrollbar-thumb": { background: gray[400], borderRadius: RADIUS },
|
|
54
|
+
"::-webkit-scrollbar-thumb:hover": { background: gray[500] },
|
|
55
|
+
"::-webkit-scrollbar-corner": { background: gray[100] },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { PaletteProps } from "../types";
|
|
2
|
+
/** Clear of the 4.5 gate, but well under body text so a hint never reads as a value. */
|
|
3
|
+
export declare const PLACEHOLDER_TEXT = 5;
|
|
2
4
|
export declare const namedSurfaces: (palette: PaletteProps) => string[];
|
|
3
5
|
/** The surface an ink is closest to — clearing it clears every other one. */
|
|
4
6
|
export declare const hardestSurface: (ink: string, surfaces: string[]) => string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hardestSurface = exports.namedSurfaces = void 0;
|
|
3
|
+
exports.hardestSurface = exports.namedSurfaces = exports.PLACEHOLDER_TEXT = void 0;
|
|
4
4
|
exports.withSurfaceRungs = withSurfaceRungs;
|
|
5
5
|
const color_1 = require("./color");
|
|
6
6
|
const outlineRung_1 = require("./outlineRung");
|
|
7
7
|
const accentText_1 = require("./accentText");
|
|
8
8
|
const semanticText_1 = require("./semanticText");
|
|
9
|
+
/** Clear of the 4.5 gate, but well under body text so a hint never reads as a value. */
|
|
10
|
+
exports.PLACEHOLDER_TEXT = 5;
|
|
9
11
|
const namedSurfaces = (palette) => [
|
|
10
12
|
...Object.values(palette.backgroundColor),
|
|
11
13
|
palette.background[50],
|
|
@@ -19,6 +21,7 @@ exports.hardestSurface = hardestSurface;
|
|
|
19
21
|
function withSurfaceRungs(palette) {
|
|
20
22
|
const surfaces = (0, exports.namedSurfaces)(palette);
|
|
21
23
|
const lift = (ink, target) => (0, outlineRung_1.liftToContrast)(ink, (0, exports.hardestSurface)(ink, surfaces), target);
|
|
24
|
+
const soften = (ink, target) => (0, outlineRung_1.softenToContrast)(ink, (0, exports.hardestSurface)(ink, surfaces), target);
|
|
22
25
|
const semanticText = semanticText_1.SEMANTIC_TONES.reduce((acc, tone) => {
|
|
23
26
|
acc[tone] = lift(palette.semanticText[tone], accentText_1.AA_NORMAL_TEXT);
|
|
24
27
|
return acc;
|
|
@@ -30,9 +33,11 @@ function withSurfaceRungs(palette) {
|
|
|
30
33
|
semanticText,
|
|
31
34
|
text: { ...palette.text, 500: lift(palette.text[500], accentText_1.AA_NORMAL_TEXT) },
|
|
32
35
|
header: { ...palette.header, 500: lift(palette.header[500], accentText_1.AA_NORMAL_TEXT) },
|
|
36
|
+
// Placeholder must stay legible without reading as a filled value: the ramp delivered
|
|
37
|
+
// 6.85:1, level with `textMuted`, so it is settled back down to just clear of AA.
|
|
33
38
|
placeholder: {
|
|
34
39
|
...palette.placeholder,
|
|
35
|
-
500: lift(palette.placeholder[500], accentText_1.AA_NORMAL_TEXT),
|
|
40
|
+
500: soften(lift(palette.placeholder[500], accentText_1.AA_NORMAL_TEXT), exports.PLACEHOLDER_TEXT),
|
|
36
41
|
},
|
|
37
42
|
boxborder: { ...palette.boxborder, 500: lift(palette.boxborder[500], outlineRung_1.AA_NON_TEXT) },
|
|
38
43
|
};
|
|
@@ -8,13 +8,13 @@ import { getAccordionHoverColors } from "./accordionColors.js";
|
|
|
8
8
|
const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion, items, ...rest }) => {
|
|
9
9
|
const { colors } = useCustomTheme();
|
|
10
10
|
const isDark = isDarkCanvas(colors.backgroundColor.main);
|
|
11
|
-
const border = colors.boxborder[
|
|
11
|
+
const border = colors.boxborder[200];
|
|
12
12
|
const headingColor = colors.text[800];
|
|
13
13
|
const bodyColor = colors.text[600];
|
|
14
14
|
const { expandedBg, softHover } = useMemo(() => getAccordionHoverColors(colors, isDark), [colors, isDark]);
|
|
15
15
|
return (_jsx(ChakraAccordian, { allowMultiple: allowMultiple, allowToggle: allowToggle, index: index, onChange: onChange, reduceMotion: reduceMotion, ...rest, children: items.map((item, idx) => {
|
|
16
16
|
var _a;
|
|
17
|
-
return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[
|
|
17
|
+
return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[200] }, ...item.itemProps, sx: (_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.itemStyle, children: ({ isExpanded }) => {
|
|
18
18
|
var _a, _b, _c;
|
|
19
19
|
return (_jsxs(_Fragment, { children: [_jsx("h2", { children: _jsxs(AccordionButton, { px: 4, py: 3, gap: 3, fontSize: "0.875rem", fontWeight: 600, color: headingColor, bg: isExpanded ? expandedBg : "transparent", transition: "background 0.15s ease", _hover: { bg: isExpanded ? expandedBg : softHover }, _focusVisible: {
|
|
20
20
|
boxShadow: "none",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { accentTextOnCanvas, isDarkCanvas, onFilled
|
|
1
|
+
import { accentTextOnCanvas, isDarkCanvas, onFilled } from "../../Theme/tokens/builders/accentText.js";
|
|
2
|
+
import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
|
|
2
3
|
/**
|
|
3
4
|
* Outline/ghost/link text sits ON the canvas, so it needs a rung that stays readable there —
|
|
4
5
|
* `[500]` is pinned dark enough to carry a white label on the solid variant and measures only
|
|
@@ -138,11 +139,11 @@ export const Button = {
|
|
|
138
139
|
// Theme-based two-tone gradient: each theme defines its own `gradient` {from,to} pair.
|
|
139
140
|
// Ignores colorScheme; hover/active shift brightness so it works for any pair.
|
|
140
141
|
gradient: ({ theme }) => {
|
|
141
|
-
const g = theme.colors.gradient;
|
|
142
|
-
const bg =
|
|
142
|
+
const g = resolveGradient(theme.colors.gradient, theme.colors.white, theme.colors.black);
|
|
143
|
+
const bg = gradientCss(g);
|
|
143
144
|
return {
|
|
144
145
|
bgImage: bg,
|
|
145
|
-
color:
|
|
146
|
+
color: g.ink,
|
|
146
147
|
border: "none",
|
|
147
148
|
_hover: {
|
|
148
149
|
bgImage: bg,
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef, useEffect } from "react";
|
|
3
3
|
import { Box, Button, ButtonGroup, IconButton, Menu, MenuButton, MenuItem, MenuList, Tooltip, } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
-
import {
|
|
5
|
+
import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
|
|
6
6
|
import { hexToRgb } from "../../Theme/tokens/builders/color.js";
|
|
7
7
|
import { rafThrottle } from "../../Utils/rafThrottle.js";
|
|
8
8
|
export default function ButtonGroupIcon({ leftIcon, rightIcon, onLeftIconClick, onRightIconClick, buttonText, onButtonClick, onButtongroupClick, size, variant, color, buttonGroupStyle, buttonGroupLeftIconStyle, buttonGroupRightIconStyle, buttonStyle, onBlurLeftIcon, onBlurRightIcon, dropdownOptions, // New prop for dropdown options
|
|
@@ -46,9 +46,9 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
46
46
|
// keep the segments transparent (so it doesn't restart per button/icon), with a
|
|
47
47
|
// translucent-white hover overlay for per-segment feedback.
|
|
48
48
|
const isGradient = variant === "gradient";
|
|
49
|
-
const gradientStops = theme.colors.gradient;
|
|
50
|
-
const gradientBg =
|
|
51
|
-
const gradientInk =
|
|
49
|
+
const gradientStops = resolveGradient(theme.colors.gradient, theme.colors.white, theme.colors.black);
|
|
50
|
+
const gradientBg = gradientCss(gradientStops);
|
|
51
|
+
const gradientInk = gradientStops.ink;
|
|
52
52
|
const whiteRgb = hexToRgb(theme.colors.white);
|
|
53
53
|
const whiteOverlay = (alpha) => `rgba(${whiteRgb.r}, ${whiteRgb.g}, ${whiteRgb.b}, ${alpha})`;
|
|
54
54
|
const gradientItemSx = isGradient
|
|
@@ -87,7 +87,7 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
87
87
|
mx: 0,
|
|
88
88
|
borderRadius: "none",
|
|
89
89
|
borderBottom: "1px solid",
|
|
90
|
-
borderColor: theme.colors.boxborder[
|
|
90
|
+
borderColor: theme.colors.boxborder[200],
|
|
91
91
|
}
|
|
92
92
|
: {}),
|
|
93
93
|
_hover: { bg: theme.colors.primary[50], color: theme.colors.primary[700] },
|
|
@@ -11,7 +11,7 @@ export const FIELD_TRANSITION = "border-color 0.2s, box-shadow 0.2s";
|
|
|
11
11
|
export const getFieldStateStyles = (theme, { error = false, focused = false } = {}) => {
|
|
12
12
|
// [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named surface
|
|
13
13
|
// up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
14
|
-
const idleBorder = theme.colors.boxborder[
|
|
14
|
+
const idleBorder = theme.colors.boxborder[500];
|
|
15
15
|
const primary = theme.colors.primary[500];
|
|
16
16
|
const errorColor = theme.colors.semanticText.error;
|
|
17
17
|
const ringPrimary = theme.colors.boxShadow.primary;
|
|
@@ -34,7 +34,7 @@ const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Co
|
|
|
34
34
|
if (variant === "button") {
|
|
35
35
|
return (_jsxs(Flex, { as: "button", align: "center", gap: "6px", px: "12px", py: "6px", borderRadius: "lg", border: "1px solid",
|
|
36
36
|
// [800], not [500]: a real control boundary needs >=3:1 on every surface up to `muted`.
|
|
37
|
-
borderColor: copied ? success : theme.colors.boxborder[
|
|
37
|
+
borderColor: copied ? success : theme.colors.boxborder[500], bg: "transparent", color: copied ? success : theme.colors.gray[700], fontSize: "14px", fontWeight: 500, transition: "all 0.15s ease", _hover: { borderColor: accent, color: accent }, onClick: handleCopy, children: [copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }), _jsx(Text, { children: copied ? copiedLabel : label })] }));
|
|
38
38
|
}
|
|
39
39
|
return (_jsx(ToolTip, { label: copied ? copiedLabel : tooltip, placement: "top", children: _jsx(IconButton, { "aria-label": tooltip, size: size, variant: "ghost", onClick: handleCopy, color: copied ? success : theme.colors.gray[500], _hover: { color: accent, bg: theme.colors.primary[50] }, icon: copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }) }) }));
|
|
40
40
|
};
|
|
@@ -14,6 +14,6 @@ const EditModuleModal = ({ isOpen, onClose, initialName, isLoading, onSubmit, la
|
|
|
14
14
|
// [200] is the decorative divider rung (~1.2:1, correct for the ModalHeader border
|
|
15
15
|
// above) — a real control's resting outline needs 1.4.11's 3:1, which is what every
|
|
16
16
|
// other input in this library (TextInput, NumberInput, DatePicker) reads from [800].
|
|
17
|
-
borderColor: colors.boxborder[
|
|
17
|
+
borderColor: colors.boxborder[500], mb: 5 }), _jsxs(HStack, { justifyContent: "flex-end", spacing: 3, children: [_jsx(Button, { label: labels.cancel, onClick: onClose, variant: "outline", colorScheme: "gray", size: "sm" }), _jsx(Button, { label: labels.update, onClick: () => onSubmit(name.trim()), colorScheme: "primary", size: "sm", isLoading: isLoading, isDisabled: !name.trim() })] })] })] })] }));
|
|
18
18
|
};
|
|
19
19
|
export default EditModuleModal;
|
|
@@ -20,7 +20,7 @@ export const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, t
|
|
|
20
20
|
const hasRange = !!(rangeStart && rangeEnd && !isSameDay(rangeStart, rangeEnd));
|
|
21
21
|
const selectStyles = {
|
|
22
22
|
border: "1px solid",
|
|
23
|
-
// boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[
|
|
23
|
+
// boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[200]
|
|
24
24
|
// is decorative and measured 1.85:1 on the dark canvas — the select read as borderless.
|
|
25
25
|
borderColor: theme.colors.boxborder[500],
|
|
26
26
|
borderRadius: "md",
|
|
@@ -201,6 +201,6 @@ export const RangeDatePicker = (props) => {
|
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
setTempRangeEnd(setTimeFrom(endTimeBaseDate, t));
|
|
204
|
-
}, dateFormat: timePickerFormat, disabled: disabled || !tempRangeEnd, size: sizeKey }))] })] })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[
|
|
204
|
+
}, dateFormat: timePickerFormat, disabled: disabled || !tempRangeEnd, size: sizeKey }))] })] })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleClear, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: requestClose, children: "Apply" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
205
205
|
};
|
|
206
206
|
export default RangeDatePicker;
|