pixelize-design-library 2.4.2-beta.1 → 2.4.2-beta.10
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 +6 -6
- package/dist/Components/Checkbox/Checkbox.js +1 -1
- package/dist/Components/Checkbox/Checkbox.styles.js +2 -0
- 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 +2 -2
- package/dist/Components/DatePicker/SingleDatePicker.js +2 -2
- 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 +4 -4
- package/dist/Components/Form/FormWrapper.js +1 -1
- package/dist/Components/Header/HeaderActions.d.ts +3 -1
- package/dist/Components/Header/HeaderActions.js +7 -3
- package/dist/Components/Input/TextInput.styles.js +6 -4
- package/dist/Components/InputTextArea/InputTextArea.style.js +5 -4
- 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/NavigationBar/NavigationBar.js +3 -3
- package/dist/Components/NoteTextArea/NoteTextArea.js +5 -3
- package/dist/Components/NumberInput/NumberInput.styles.js +5 -4
- 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/RadioButton/RadioButton.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 +5 -4
- package/dist/Components/Select/Select.styles.js +3 -2
- package/dist/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/Components/SelectV2/SelectV2.js +5 -11
- package/dist/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/Components/StageProgress/StageProgress.js +2 -9
- package/dist/Components/Table/Table.js +11 -22
- package/dist/Components/Table/components/TableActions.js +2 -2
- package/dist/Components/Table/components/TableBody.js +2 -2
- package/dist/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/Components/Table/components/TableHeader.js +4 -4
- package/dist/Components/Table/components/TableSearch.js +1 -1
- package/dist/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/Components/Table/settings/ManageColumns.js +3 -17
- package/dist/Components/Table/settings/TableSettings.js +5 -11
- package/dist/Components/Timeline/Timeline.js +2 -2
- package/dist/Components/Toaster/Toaster.js +1 -1
- package/dist/Components/Trail/TrailWorks.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 +9 -6
- package/dist/Theme/chakra/Menu.styles.js +11 -5
- package/dist/Theme/chakra/Popover.styles.d.ts +6 -3
- package/dist/Theme/chakra/Popover.styles.js +11 -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 +15 -9
- package/dist/Theme/chakra/createBrandTheme.js +3 -16
- package/dist/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/Theme/provider/ThemeSwitcher.js +13 -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/builders/chartColorsFromTheme.js +1 -1
- 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 +3 -0
- package/dist/Theme/tokens/builders/index.js +3 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +32 -3
- package/dist/Theme/tokens/builders/outlineRung.js +74 -5
- package/dist/Theme/tokens/builders/placeholderInk.d.ts +19 -0
- package/dist/Theme/tokens/builders/placeholderInk.js +35 -0
- package/dist/Theme/tokens/builders/resolvedRungs.d.ts +5 -1
- package/dist/Theme/tokens/builders/resolvedRungs.js +7 -2
- 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 +5 -0
- package/dist/Theme/tokens/builders/surfaceRungs.js +20 -5
- package/dist/Theme/tokens/types.d.ts +5 -0
- 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 +6 -6
- package/dist/esm/Components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +2 -0
- 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 +2 -2
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +2 -2
- 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 +4 -4
- package/dist/esm/Components/Form/FormWrapper.js +1 -1
- package/dist/esm/Components/Header/HeaderActions.js +8 -4
- package/dist/esm/Components/Input/TextInput.styles.js +6 -4
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +5 -4
- 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/NavigationBar/NavigationBar.js +3 -3
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +5 -3
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +5 -4
- 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/RadioButton/RadioButton.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 +5 -4
- package/dist/esm/Components/Select/Select.styles.js +3 -2
- package/dist/esm/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/esm/Components/SelectV2/SelectV2.js +5 -11
- package/dist/esm/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -9
- package/dist/esm/Components/Table/Table.js +11 -22
- package/dist/esm/Components/Table/components/TableActions.js +2 -2
- package/dist/esm/Components/Table/components/TableBody.js +2 -2
- package/dist/esm/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/esm/Components/Table/components/TableHeader.js +4 -4
- package/dist/esm/Components/Table/components/TableSearch.js +1 -1
- package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/esm/Components/Table/settings/ManageColumns.js +3 -17
- package/dist/esm/Components/Table/settings/TableSettings.js +5 -11
- package/dist/esm/Components/Timeline/Timeline.js +2 -2
- package/dist/esm/Components/Toaster/Toaster.js +1 -1
- package/dist/esm/Components/Trail/TrailWorks.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 +11 -5
- package/dist/esm/Theme/chakra/Popover.styles.js +11 -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 +13 -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/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
- package/dist/esm/Theme/tokens/builders/index.js +3 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +70 -4
- package/dist/esm/Theme/tokens/builders/placeholderInk.js +29 -0
- package/dist/esm/Theme/tokens/builders/resolvedRungs.js +7 -2
- package/dist/esm/Theme/tokens/builders/scrollbar.js +52 -0
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +20 -5
- package/dist/esm/index.js +5 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +17 -3
- package/package.json +4 -2
|
@@ -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 = "#cf4e3a"; // warm red (terracotta leaning)
|
|
9
7
|
const primary = {
|
|
10
8
|
50: "#fdf1ee",
|
|
@@ -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 4.37/2.15 against from/to. Same hue, darker.
|
|
26
25
|
// Both nudged one step further (4.509/4.502 -> 4.601/4.617): 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,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 = "#d16a7e"; // muted warm rose (not neon pink)
|
|
9
7
|
const primary = {
|
|
10
8
|
50: "#fdf2f5",
|
|
@@ -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.46/2.69 against from/to. Same hue, darker.
|
|
26
25
|
// Both nudged one step further (4.520/4.505 -> 4.609/4.607): the first pass cleared AA by
|
|
@@ -132,8 +131,7 @@ const palette = {
|
|
|
132
131
|
},
|
|
133
132
|
boxShadow: {
|
|
134
133
|
primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
|
|
135
|
-
|
|
136
|
-
default: palette_light_1.default.boxShadow.default,
|
|
134
|
+
...neutrals_1.sharedBoxShadow,
|
|
137
135
|
},
|
|
138
136
|
};
|
|
139
137
|
exports.default = palette;
|
|
@@ -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 = "#1a3a6b"; // was #0088cc — deep navy
|
|
9
7
|
const primary = {
|
|
10
8
|
50: "#e8ecf4",
|
|
@@ -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.14 there (`from` already passed at 11.28, unchanged).
|
|
26
25
|
// Nudged one step further (4.515 -> 4.600): 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;
|
|
@@ -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 = "#6b7280"; // was #475569 — pure neutral gray, no blue cast
|
|
9
7
|
const primary = {
|
|
10
8
|
50: "#f9fafb",
|
|
@@ -20,12 +18,9 @@ const primary = {
|
|
|
20
18
|
opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
|
|
21
19
|
};
|
|
22
20
|
const palette = {
|
|
23
|
-
...
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// Nudged one step further (4.520 -> 4.608): the first pass cleared AA by <0.02, too thin a
|
|
27
|
-
// margin to trust against rounding/rendering variance.
|
|
28
|
-
gradient: { from: "#6b7280", to: "#5664f6" }, // slate gray → indigo
|
|
21
|
+
...neutrals_1.neutralTokens,
|
|
22
|
+
...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
|
|
23
|
+
gradient: { from: "#666d7a", to: "#4a4e59" },
|
|
29
24
|
primary,
|
|
30
25
|
tertiary: { ...primary },
|
|
31
26
|
gray: {
|
|
@@ -130,8 +125,7 @@ const palette = {
|
|
|
130
125
|
},
|
|
131
126
|
boxShadow: {
|
|
132
127
|
primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
|
|
133
|
-
|
|
134
|
-
default: palette_light_1.default.boxShadow.default,
|
|
128
|
+
...neutrals_1.sharedBoxShadow,
|
|
135
129
|
},
|
|
136
130
|
};
|
|
137
131
|
exports.default = palette;
|
|
@@ -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 = "#004f4b"; // deep spruce teal — storefront/retail brand anchor
|
|
9
7
|
const primary = {
|
|
10
8
|
50: "#eafaf9",
|
|
@@ -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
|
// Same hue as primary, darker stop for the "to" end — mirrors emerald's gradient pattern.
|
|
25
24
|
// White gradient-button text verified AA at both stops (4.98 / 6.96).
|
|
26
25
|
gradient: { from: "#0c7d77", to: "#095e90" }, // spruce teal → deep blue
|
|
@@ -120,8 +119,7 @@ const palette = {
|
|
|
120
119
|
},
|
|
121
120
|
boxShadow: {
|
|
122
121
|
primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
|
|
123
|
-
|
|
124
|
-
default: palette_light_1.default.boxShadow.default,
|
|
122
|
+
...neutrals_1.sharedBoxShadow,
|
|
125
123
|
},
|
|
126
124
|
};
|
|
127
125
|
exports.default = palette;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BrandScale, ColorScale } from "../types";
|
|
2
|
+
export type BrandInkRamps = {
|
|
3
|
+
secondary: BrandScale;
|
|
4
|
+
tertiary: BrandScale;
|
|
5
|
+
text: ColorScale;
|
|
6
|
+
header: ColorScale;
|
|
7
|
+
placeholder: ColorScale;
|
|
8
|
+
disabled: ColorScale;
|
|
9
|
+
};
|
|
10
|
+
/** Brand-hued ink ramps at lavender's verified luminances, so contrast carries over. */
|
|
11
|
+
export declare function buildBrandInk(primary500: string): BrandInkRamps;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBrandInk = buildBrandInk;
|
|
4
|
+
const buildBrandTokens_1 = require("./buildBrandTokens");
|
|
5
|
+
const color_1 = require("./color");
|
|
6
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
7
|
+
// Lavender's primary saturation. Each brand's ramps scale away from it.
|
|
8
|
+
const REFERENCE_SATURATION = 55.5;
|
|
9
|
+
const SECONDARY = {
|
|
10
|
+
50: [39.4, 0.8231],
|
|
11
|
+
100: [41.0, 0.61132],
|
|
12
|
+
200: [37.7, 0.39479],
|
|
13
|
+
300: [27.4, 0.18614],
|
|
14
|
+
400: [28.4, 0.10269],
|
|
15
|
+
500: [52.4, 0.00831],
|
|
16
|
+
600: [55.1, 0.00573],
|
|
17
|
+
700: [55.6, 0.00386],
|
|
18
|
+
800: [60.0, 0.00245],
|
|
19
|
+
900: [57.1, 0.00141],
|
|
20
|
+
};
|
|
21
|
+
const TEXT = {
|
|
22
|
+
50: [25.9, 0.86267],
|
|
23
|
+
100: [32.4, 0.63853],
|
|
24
|
+
200: [32.7, 0.48344],
|
|
25
|
+
300: [30.6, 0.30607],
|
|
26
|
+
400: [29.2, 0.21515],
|
|
27
|
+
500: [26.3, 0.10787],
|
|
28
|
+
600: [26.6, 0.08786],
|
|
29
|
+
700: [26.7, 0.05281],
|
|
30
|
+
800: [27.4, 0.03145],
|
|
31
|
+
900: [29.0, 0.01826],
|
|
32
|
+
};
|
|
33
|
+
const HEADER = {
|
|
34
|
+
50: [31.3, 0.83382],
|
|
35
|
+
100: [31.0, 0.59779],
|
|
36
|
+
200: [30.6, 0.44729],
|
|
37
|
+
300: [29.3, 0.27622],
|
|
38
|
+
400: [30.0, 0.19238],
|
|
39
|
+
500: [29.9, 0.10467],
|
|
40
|
+
600: [29.9, 0.08682],
|
|
41
|
+
700: [29.7, 0.05281],
|
|
42
|
+
800: [29.1, 0.0319],
|
|
43
|
+
900: [29.9, 0.01915],
|
|
44
|
+
};
|
|
45
|
+
const PLACEHOLDER = {
|
|
46
|
+
50: [30.4, 0.87913],
|
|
47
|
+
100: [35.4, 0.67128],
|
|
48
|
+
200: [36.1, 0.53513],
|
|
49
|
+
300: [34.7, 0.37333],
|
|
50
|
+
400: [31.4, 0.30462],
|
|
51
|
+
500: [28.2, 0.19307],
|
|
52
|
+
600: [22.8, 0.15818],
|
|
53
|
+
700: [22.0, 0.09196],
|
|
54
|
+
800: [21.5, 0.05448],
|
|
55
|
+
900: [22.3, 0.03206],
|
|
56
|
+
};
|
|
57
|
+
const DISABLED = {
|
|
58
|
+
50: [33.3, 0.90353],
|
|
59
|
+
100: [38.9, 0.80618],
|
|
60
|
+
200: [40.7, 0.71546],
|
|
61
|
+
300: [41.0, 0.60545],
|
|
62
|
+
400: [39.6, 0.53328],
|
|
63
|
+
500: [40.5, 0.43688],
|
|
64
|
+
600: [28.2, 0.35566],
|
|
65
|
+
700: [13.4, 0.20289],
|
|
66
|
+
800: [11.4, 0.1171],
|
|
67
|
+
900: [11.2, 0.06724],
|
|
68
|
+
};
|
|
69
|
+
// Lightness is monotonic in luminance for a fixed hue/saturation, so bisection converges.
|
|
70
|
+
const atLuminance = (anchor, saturation, target) => {
|
|
71
|
+
let low = 0;
|
|
72
|
+
let high = 100;
|
|
73
|
+
for (let i = 0; i < 30; i += 1) {
|
|
74
|
+
const mid = (low + high) / 2;
|
|
75
|
+
if ((0, color_1.relativeLuminance)((0, color_1.withLightness)(anchor, mid, saturation)) < target)
|
|
76
|
+
low = mid;
|
|
77
|
+
else
|
|
78
|
+
high = mid;
|
|
79
|
+
}
|
|
80
|
+
return (0, color_1.withLightness)(anchor, (low + high) / 2, saturation);
|
|
81
|
+
};
|
|
82
|
+
const ramp = (anchor, profile) => {
|
|
83
|
+
const ratio = (0, color_1.hexToHsl)(anchor).s / REFERENCE_SATURATION;
|
|
84
|
+
const scale = {};
|
|
85
|
+
for (const rung of RUNGS) {
|
|
86
|
+
const [saturation, luminance] = profile[rung];
|
|
87
|
+
scale[rung] = atLuminance(anchor, Math.min(100, saturation * ratio), luminance);
|
|
88
|
+
}
|
|
89
|
+
return scale;
|
|
90
|
+
};
|
|
91
|
+
const brandRamp = (anchor, profile) => {
|
|
92
|
+
const scale = ramp(anchor, profile);
|
|
93
|
+
return { ...scale, opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(scale[500]) };
|
|
94
|
+
};
|
|
95
|
+
/** Brand-hued ink ramps at lavender's verified luminances, so contrast carries over. */
|
|
96
|
+
function buildBrandInk(primary500) {
|
|
97
|
+
const secondary = brandRamp(primary500, SECONDARY);
|
|
98
|
+
return {
|
|
99
|
+
secondary,
|
|
100
|
+
tertiary: { ...secondary },
|
|
101
|
+
text: ramp(primary500, TEXT),
|
|
102
|
+
header: ramp(primary500, HEADER),
|
|
103
|
+
placeholder: ramp(primary500, PLACEHOLDER),
|
|
104
|
+
disabled: ramp(primary500, DISABLED),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -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,6 @@ __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);
|
|
24
|
+
__exportStar(require("./placeholderInk"), exports);
|
|
@@ -7,6 +7,22 @@ import type { PaletteProps } from "../types";
|
|
|
7
7
|
export declare const MIN_PERCEPTIBLE_STEP = 1.15;
|
|
8
8
|
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
9
9
|
export declare const AA_NON_TEXT = 3;
|
|
10
|
+
/**
|
|
11
|
+
* Resting chrome — card, popover and field outlines — settles here, not at `AA_NON_TEXT`.
|
|
12
|
+
* At 3:1 a container border is text-weight and the UI reads as a wireframe; every mainstream
|
|
13
|
+
* system draws this line far lighter (Tailwind gray-200 1.24, Chakra gray.200 1.30, Material
|
|
14
|
+
* outline-variant 1.61). 1.4.11 asks that a control be identifiable, not that its resting
|
|
15
|
+
* border carry the whole job: the fill, the label and the focus ring do that, and the focus
|
|
16
|
+
* ring is still held to `AA_NON_TEXT`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CHROME_BORDER = 1.5;
|
|
19
|
+
export declare const CHROME_RULE = 1.31;
|
|
20
|
+
/**
|
|
21
|
+
* A rule is decorative, so it has a ceiling and no floor: soften it until the surface it reads
|
|
22
|
+
* hardest against sits at `target`, and leave a already-fainter rung alone. Never `settleAcross`
|
|
23
|
+
* here — that clears a floor on EVERY surface, so one tinted surface drags the rule darker.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ruleInk(hex: string, surfaces: readonly string[], target: number): string;
|
|
10
26
|
/**
|
|
11
27
|
* Walks a hex toward `target` contrast against `backdrop`, keeping hue and saturation.
|
|
12
28
|
* Direction is DERIVED from the backdrop, never passed: a mode argument here was redundant
|
|
@@ -14,11 +30,17 @@ export declare const AA_NON_TEXT = 3;
|
|
|
14
30
|
* Tries the far side first, falls back to the near side, and stops at the first passing step.
|
|
15
31
|
*/
|
|
16
32
|
export declare function liftToContrast(hex: string, backdrop: string, target?: number): string;
|
|
33
|
+
/**
|
|
34
|
+
* Mirror of `liftToContrast`: walks ink TOWARD the backdrop, stopping at the last step that
|
|
35
|
+
* still clears `target`. For ink that must stay legible without reading as body copy.
|
|
36
|
+
*/
|
|
37
|
+
export declare function softenToContrast(hex: string, backdrop: string, target: number): string;
|
|
17
38
|
/**
|
|
18
39
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
19
|
-
* pickers, the editor's inputs).
|
|
20
|
-
*
|
|
21
|
-
*
|
|
40
|
+
* pickers, the editor's inputs). Settled onto `CHROME_BORDER` — lifted when a brand authored it
|
|
41
|
+
* invisibly pale, softened when it overshoots. It was previously lifted to `AA_NON_TEXT`, which
|
|
42
|
+
* shipped 3.85-4.95:1 outlines: a text-weight box around every card and popover.
|
|
43
|
+
* Resolved here rather than hand-pinned per brand: a copied hex goes stale the moment a canvas moves.
|
|
22
44
|
*
|
|
23
45
|
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
24
46
|
* and outside 1.4.11.
|
|
@@ -33,3 +55,10 @@ export declare function withOutlineRung(palette: PaletteProps): PaletteProps;
|
|
|
33
55
|
* its OWN list background, not necessarily the page canvas.
|
|
34
56
|
*/
|
|
35
57
|
export declare function resolveHoverTint(seed: string, restSurface: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Settles ink into `target` against EVERY surface at once. Softening one step can change which
|
|
60
|
+
* surface is hardest, so resolving against a single pre-computed "hardest" one lands under the
|
|
61
|
+
* floor on another — that is how radiant and rosewood ended up with an invisible outline on
|
|
62
|
+
* their muted surface.
|
|
63
|
+
*/
|
|
64
|
+
export declare function settleAcross(hex: string, surfaces: readonly string[], target: number): string;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AA_NON_TEXT = exports.MIN_PERCEPTIBLE_STEP = void 0;
|
|
3
|
+
exports.CHROME_RULE = exports.CHROME_BORDER = exports.AA_NON_TEXT = exports.MIN_PERCEPTIBLE_STEP = void 0;
|
|
4
|
+
exports.ruleInk = ruleInk;
|
|
4
5
|
exports.liftToContrast = liftToContrast;
|
|
6
|
+
exports.softenToContrast = softenToContrast;
|
|
5
7
|
exports.withOutlineRung = withOutlineRung;
|
|
6
8
|
exports.resolveHoverTint = resolveHoverTint;
|
|
9
|
+
exports.settleAcross = settleAcross;
|
|
7
10
|
const color_1 = require("./color");
|
|
8
11
|
/**
|
|
9
12
|
* The floor a hover/active state's step off its own resting surface must clear to be seen at
|
|
@@ -13,6 +16,29 @@ const color_1 = require("./color");
|
|
|
13
16
|
exports.MIN_PERCEPTIBLE_STEP = 1.15;
|
|
14
17
|
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
15
18
|
exports.AA_NON_TEXT = 3;
|
|
19
|
+
/**
|
|
20
|
+
* Resting chrome — card, popover and field outlines — settles here, not at `AA_NON_TEXT`.
|
|
21
|
+
* At 3:1 a container border is text-weight and the UI reads as a wireframe; every mainstream
|
|
22
|
+
* system draws this line far lighter (Tailwind gray-200 1.24, Chakra gray.200 1.30, Material
|
|
23
|
+
* outline-variant 1.61). 1.4.11 asks that a control be identifiable, not that its resting
|
|
24
|
+
* border carry the whole job: the fill, the label and the focus ring do that, and the focus
|
|
25
|
+
* ring is still held to `AA_NON_TEXT`.
|
|
26
|
+
*/
|
|
27
|
+
exports.CHROME_BORDER = 1.5;
|
|
28
|
+
// The resting rule between two surfaces — a card edge, a divider, a menu outline. Lighter than
|
|
29
|
+
// CHROME_BORDER, which outlines a control the user acts on.
|
|
30
|
+
exports.CHROME_RULE = 1.31;
|
|
31
|
+
/**
|
|
32
|
+
* A rule is decorative, so it has a ceiling and no floor: soften it until the surface it reads
|
|
33
|
+
* hardest against sits at `target`, and leave a already-fainter rung alone. Never `settleAcross`
|
|
34
|
+
* here — that clears a floor on EVERY surface, so one tinted surface drags the rule darker.
|
|
35
|
+
*/
|
|
36
|
+
function ruleInk(hex, surfaces, target) {
|
|
37
|
+
const loudest = surfaces.reduce((worst, s) => (0, color_1.contrastRatio)(hex, s) > (0, color_1.contrastRatio)(hex, worst) ? s : worst);
|
|
38
|
+
return (0, color_1.contrastRatio)(hex, loudest) > target
|
|
39
|
+
? softenToContrast(hex, loudest, target)
|
|
40
|
+
: hex;
|
|
41
|
+
}
|
|
16
42
|
/**
|
|
17
43
|
* Walks a hex toward `target` contrast against `backdrop`, keeping hue and saturation.
|
|
18
44
|
* Direction is DERIVED from the backdrop, never passed: a mode argument here was redundant
|
|
@@ -36,11 +62,30 @@ function liftToContrast(hex, backdrop, target = exports.AA_NON_TEXT) {
|
|
|
36
62
|
const ends = [(0, color_1.withLightness)(hex, 100, s), (0, color_1.withLightness)(hex, 0, s)];
|
|
37
63
|
return (0, color_1.contrastRatio)(ends[0], backdrop) >= (0, color_1.contrastRatio)(ends[1], backdrop) ? ends[0] : ends[1];
|
|
38
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Mirror of `liftToContrast`: walks ink TOWARD the backdrop, stopping at the last step that
|
|
67
|
+
* still clears `target`. For ink that must stay legible without reading as body copy.
|
|
68
|
+
*/
|
|
69
|
+
function softenToContrast(hex, backdrop, target) {
|
|
70
|
+
if ((0, color_1.contrastRatio)(hex, backdrop) <= target)
|
|
71
|
+
return hex;
|
|
72
|
+
const { s, l: start } = (0, color_1.hexToHsl)(hex);
|
|
73
|
+
const toward = (0, color_1.relativeLuminance)(backdrop) < 0.5 ? -1 : 1;
|
|
74
|
+
let softest = hex;
|
|
75
|
+
for (let l = start; l > 0 && l < 100; l += toward) {
|
|
76
|
+
const next = (0, color_1.withLightness)(hex, l, s);
|
|
77
|
+
if ((0, color_1.contrastRatio)(next, backdrop) < target)
|
|
78
|
+
break;
|
|
79
|
+
softest = next;
|
|
80
|
+
}
|
|
81
|
+
return softest;
|
|
82
|
+
}
|
|
39
83
|
/**
|
|
40
84
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
41
|
-
* pickers, the editor's inputs).
|
|
42
|
-
*
|
|
43
|
-
*
|
|
85
|
+
* pickers, the editor's inputs). Settled onto `CHROME_BORDER` — lifted when a brand authored it
|
|
86
|
+
* invisibly pale, softened when it overshoots. It was previously lifted to `AA_NON_TEXT`, which
|
|
87
|
+
* shipped 3.85-4.95:1 outlines: a text-weight box around every card and popover.
|
|
88
|
+
* Resolved here rather than hand-pinned per brand: a copied hex goes stale the moment a canvas moves.
|
|
44
89
|
*
|
|
45
90
|
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
46
91
|
* and outside 1.4.11.
|
|
@@ -53,7 +98,9 @@ function withOutlineRung(palette) {
|
|
|
53
98
|
(0, color_1.contrastRatio)(current, palette.background[50])
|
|
54
99
|
? palette.backgroundColor.main
|
|
55
100
|
: palette.background[50];
|
|
56
|
-
const resolved =
|
|
101
|
+
const resolved = (0, color_1.contrastRatio)(current, backdrop) > exports.CHROME_BORDER
|
|
102
|
+
? softenToContrast(current, backdrop, exports.CHROME_BORDER)
|
|
103
|
+
: liftToContrast(current, backdrop, exports.CHROME_BORDER);
|
|
57
104
|
if (resolved === current)
|
|
58
105
|
return palette;
|
|
59
106
|
return { ...palette, boxborder: { ...palette.boxborder, 500: resolved } };
|
|
@@ -69,3 +116,25 @@ function withOutlineRung(palette) {
|
|
|
69
116
|
function resolveHoverTint(seed, restSurface) {
|
|
70
117
|
return liftToContrast(seed, restSurface, exports.MIN_PERCEPTIBLE_STEP);
|
|
71
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Settles ink into `target` against EVERY surface at once. Softening one step can change which
|
|
121
|
+
* surface is hardest, so resolving against a single pre-computed "hardest" one lands under the
|
|
122
|
+
* floor on another — that is how radiant and rosewood ended up with an invisible outline on
|
|
123
|
+
* their muted surface.
|
|
124
|
+
*/
|
|
125
|
+
function settleAcross(hex, surfaces, target) {
|
|
126
|
+
const clearsAll = (c) => surfaces.every((s) => (0, color_1.contrastRatio)(c, s) >= target);
|
|
127
|
+
if (!clearsAll(hex)) {
|
|
128
|
+
return surfaces.reduce((ink, s) => liftToContrast(ink, s, target), hex);
|
|
129
|
+
}
|
|
130
|
+
const { s: sat, l: start } = (0, color_1.hexToHsl)(hex);
|
|
131
|
+
const toward = (0, color_1.relativeLuminance)(surfaces[0]) < 0.5 ? -1 : 1;
|
|
132
|
+
let settled = hex;
|
|
133
|
+
for (let l = start; l > 0 && l < 100; l += toward) {
|
|
134
|
+
const next = (0, color_1.withLightness)(hex, l, sat);
|
|
135
|
+
if (!clearsAll(next))
|
|
136
|
+
break;
|
|
137
|
+
settled = next;
|
|
138
|
+
}
|
|
139
|
+
return settled;
|
|
140
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
/** A field always renders on at least one surface — the first is the reference backdrop. */
|
|
3
|
+
export type FieldSurfaces = readonly [string, ...string[]];
|
|
4
|
+
/**
|
|
5
|
+
* The hint ink for a field: the brand's authored rung settled onto `PLACEHOLDER_TEXT` against the
|
|
6
|
+
* hardest surface a field can land on — lifted when it falls short, softened when it overshoots.
|
|
7
|
+
*
|
|
8
|
+
* Settled rather than floored because the authored rungs measured 3.96-7.73:1 across the brands,
|
|
9
|
+
* and anything much past the floor reads as a field already typed into. The floor is the look:
|
|
10
|
+
* one hint weight for every brand in both modes, instead of a per-brand accident.
|
|
11
|
+
*/
|
|
12
|
+
export declare const placeholderInkOn: (palette: PaletteProps, surfaces: FieldSurfaces) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Every surface an ENABLED field renders on. Disabled fields are deliberately absent — 1.4.3
|
|
15
|
+
* exempts them, and folding their dimmer fill in here would darken the hint on every other field.
|
|
16
|
+
*/
|
|
17
|
+
export declare const fieldSurfaces: (palette: PaletteProps) => FieldSurfaces;
|
|
18
|
+
/** The hint ink every field in this library reads. Takes no backdrop: see `fieldSurfaces`. */
|
|
19
|
+
export declare const placeholderInk: (palette: PaletteProps) => string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.placeholderInk = exports.fieldSurfaces = exports.placeholderInkOn = void 0;
|
|
4
|
+
const color_1 = require("./color");
|
|
5
|
+
const outlineRung_1 = require("./outlineRung");
|
|
6
|
+
const surfaceRungs_1 = require("./surfaceRungs");
|
|
7
|
+
/**
|
|
8
|
+
* The hint ink for a field: the brand's authored rung settled onto `PLACEHOLDER_TEXT` against the
|
|
9
|
+
* hardest surface a field can land on — lifted when it falls short, softened when it overshoots.
|
|
10
|
+
*
|
|
11
|
+
* Settled rather than floored because the authored rungs measured 3.96-7.73:1 across the brands,
|
|
12
|
+
* and anything much past the floor reads as a field already typed into. The floor is the look:
|
|
13
|
+
* one hint weight for every brand in both modes, instead of a per-brand accident.
|
|
14
|
+
*/
|
|
15
|
+
const placeholderInkOn = (palette, surfaces) => {
|
|
16
|
+
const rung = palette.placeholder[500];
|
|
17
|
+
const hardest = surfaces.reduce((worst, s) => (0, color_1.contrastRatio)(rung, s) < (0, color_1.contrastRatio)(rung, worst) ? s : worst);
|
|
18
|
+
return (0, color_1.contrastRatio)(rung, hardest) > surfaceRungs_1.PLACEHOLDER_TEXT
|
|
19
|
+
? (0, outlineRung_1.softenToContrast)(rung, hardest, surfaceRungs_1.PLACEHOLDER_TEXT)
|
|
20
|
+
: (0, outlineRung_1.liftToContrast)(rung, hardest, surfaceRungs_1.PLACEHOLDER_TEXT);
|
|
21
|
+
};
|
|
22
|
+
exports.placeholderInkOn = placeholderInkOn;
|
|
23
|
+
/**
|
|
24
|
+
* Every surface an ENABLED field renders on. Disabled fields are deliberately absent — 1.4.3
|
|
25
|
+
* exempts them, and folding their dimmer fill in here would darken the hint on every other field.
|
|
26
|
+
*/
|
|
27
|
+
const fieldSurfaces = (palette) => [
|
|
28
|
+
palette.gray[50],
|
|
29
|
+
palette.background[50],
|
|
30
|
+
palette.backgroundColor.main,
|
|
31
|
+
];
|
|
32
|
+
exports.fieldSurfaces = fieldSurfaces;
|
|
33
|
+
/** The hint ink every field in this library reads. Takes no backdrop: see `fieldSurfaces`. */
|
|
34
|
+
const placeholderInk = (palette) => (0, exports.placeholderInkOn)(palette, (0, exports.fieldSurfaces)(palette));
|
|
35
|
+
exports.placeholderInk = placeholderInk;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AA_NON_TEXT } from "./outlineRung";
|
|
2
2
|
import type { PaletteProps } from "../types";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A hint is floored at 3:1, not 4.5:1. Held to body-text contrast it stopped reading as a hint —
|
|
5
|
+
* an empty field looked like one already typed into — and the published library ships this rung
|
|
6
|
+
* as the brand authored it. See CHROME-CONSISTENCY.md.
|
|
7
|
+
*/
|
|
4
8
|
export declare function withPlaceholderRung(palette: PaletteProps): PaletteProps;
|
|
5
9
|
/** The hover row is a SURFACE, so it steps away from the ink rather than the ink moving. */
|
|
6
10
|
export declare function withTableHoverRung(palette: PaletteProps): PaletteProps;
|
|
@@ -6,9 +6,14 @@ exports.withTableHoverRung = withTableHoverRung;
|
|
|
6
6
|
const outlineRung_1 = require("./outlineRung");
|
|
7
7
|
Object.defineProperty(exports, "AA_NON_TEXT", { enumerable: true, get: function () { return outlineRung_1.AA_NON_TEXT; } });
|
|
8
8
|
const accentText_1 = require("./accentText");
|
|
9
|
-
|
|
9
|
+
const surfaceRungs_1 = require("./surfaceRungs");
|
|
10
|
+
/**
|
|
11
|
+
* A hint is floored at 3:1, not 4.5:1. Held to body-text contrast it stopped reading as a hint —
|
|
12
|
+
* an empty field looked like one already typed into — and the published library ships this rung
|
|
13
|
+
* as the brand authored it. See CHROME-CONSISTENCY.md.
|
|
14
|
+
*/
|
|
10
15
|
function withPlaceholderRung(palette) {
|
|
11
|
-
const resolved = (0, outlineRung_1.liftToContrast)(palette.placeholder[500], palette.background[50],
|
|
16
|
+
const resolved = (0, outlineRung_1.liftToContrast)(palette.placeholder[500], palette.background[50], surfaceRungs_1.PLACEHOLDER_TEXT);
|
|
12
17
|
if (resolved === palette.placeholder[500])
|
|
13
18
|
return palette;
|
|
14
19
|
return { ...palette, placeholder: { ...palette.placeholder, 500: resolved } };
|
|
@@ -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;
|