pixelize-design-library 2.4.2-beta.62 → 2.4.2-beta.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -2
- package/COMPONENT-GOTCHAS.md +51 -9
- package/DESIGN-GUIDE.md +13 -5
- package/dist/Components/Button/Button.styles.js +58 -23
- package/dist/Components/Card/CardProps.d.ts +2 -2
- package/dist/Components/ConfirmDialog/ConfirmDialog.js +2 -1
- package/dist/Components/CustomModulesTable/CustomModulesTable.js +6 -4
- package/dist/Components/CustomModulesTable/EditModuleModal.js +2 -1
- package/dist/Components/DatePicker/RangeDatePicker.js +2 -1
- package/dist/Components/DatePicker/SingleDatePicker.js +2 -1
- package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -1
- package/dist/Components/DatePicker/dayStates.js +2 -1
- package/dist/Components/Drawer/Drawer.js +2 -1
- package/dist/Components/Dropdown/DropDown.js +4 -10
- package/dist/Components/FilePreview/FilePreview.js +2 -1
- package/dist/Components/FileUpload/FileUpload.js +9 -2
- package/dist/Components/FileUploader/FileUploader.js +4 -0
- package/dist/Components/FileUploader/FileUploaderProps.d.ts +1 -1
- package/dist/Components/FilterSidebar/FilterSidebar.js +7 -4
- package/dist/Components/Input/TextInput.styles.js +10 -6
- package/dist/Components/KanbanBoard/AccountCard.js +4 -2
- package/dist/Components/KanbanBoard/KanbanBoard.js +6 -5
- package/dist/Components/NavigationBar/NavigationBar.js +5 -3
- package/dist/Components/Notification/Notification.js +4 -3
- package/dist/Components/NotificationBell/NotificationPanel.js +4 -3
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -4
- package/dist/Components/OrganizationDetails/CreateOrgModal.js +2 -1
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +5 -3
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +12 -7
- package/dist/Components/ScrollToTop/ScrollToTop.js +4 -3
- package/dist/Components/SearchSelect/SearchSelect.js +44 -35
- package/dist/Components/SearchSelect/searchSelectNav.d.ts +13 -0
- package/dist/Components/SearchSelect/searchSelectNav.js +40 -0
- package/dist/Components/Select/SelectPopup.js +3 -4
- package/dist/Components/Select/optionRowInk.d.ts +12 -0
- package/dist/Components/Select/optionRowInk.js +10 -1
- package/dist/Components/SelectSearch/SelectSearch.js +3 -11
- package/dist/Components/SettingRow/SettingRow.js +2 -1
- package/dist/Components/SettingRow/SettingsSection.js +2 -1
- package/dist/Components/SideBar/SecondaryBar.js +4 -3
- package/dist/Components/SideBar/SideBar.js +16 -13
- package/dist/Components/SideBar/SideBarProps.d.ts +1 -1
- package/dist/Components/SideBar/components/MenuItemBox.js +7 -4
- package/dist/Components/SideBar/components/MenuPopoverContent.js +2 -1
- package/dist/Components/SideBar/components/OtherApps.js +2 -1
- package/dist/Components/SideBar/components/PinnedSection.js +7 -4
- package/dist/Components/SideBar/sidebarMotion.d.ts +2 -0
- package/dist/Components/SideBar/sidebarMotion.js +6 -0
- package/dist/Components/SignInActivityTable/SignInActivityTable.js +6 -4
- package/dist/Components/StageProgress/StageItem.js +5 -2
- package/dist/Components/StageProgress/StepperStage.js +2 -2
- package/dist/Components/StatCard/StatCard.js +2 -1
- package/dist/Components/Table/Table.js +9 -4
- package/dist/Components/Table/TableProps.d.ts +1 -1
- package/dist/Components/Table/components/TableActions.js +3 -2
- package/dist/Components/Table/components/TableBody.js +9 -1
- package/dist/Components/Table/components/TableHeader.js +7 -2
- package/dist/Components/Table/components/TableLoading.d.ts +4 -1
- package/dist/Components/Table/components/TableLoading.js +6 -5
- package/dist/Components/Table/filters/CompactSelect.js +3 -11
- package/dist/Components/Table/settings/TableSettings.js +7 -2
- package/dist/Components/Table/variants/TableVariantContext.d.ts +1 -1
- package/dist/Components/Table/variants/TableVariantContext.js +3 -3
- package/dist/Components/Table/variants/classic.js +3 -2
- package/dist/Components/Timeline/Timeline.js +11 -4
- package/dist/Components/Toaster/Toaster.js +19 -8
- package/dist/Components/Toggle/TableToggle.js +5 -2
- package/dist/Components/UserDetails/AddUserModal.js +2 -1
- package/dist/Components/UserDetails/ChangeRoleModal.js +2 -1
- package/dist/Components/UserDetails/UserDetails.js +3 -1
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +4 -0
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.d.ts +2 -2
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +25 -18
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +38 -2
- package/dist/Theme/chakra/Card.styles.d.ts +7 -1
- package/dist/Theme/chakra/Card.styles.js +4 -1
- package/dist/Theme/chakra/Menu.styles.d.ts +11 -5
- package/dist/Theme/chakra/Menu.styles.js +10 -0
- package/dist/Theme/chakra/Popover.styles.d.ts +2 -11
- package/dist/Theme/chakra/Popover.styles.js +2 -0
- package/dist/Theme/chakra/common.web.d.ts +4 -0
- package/dist/Theme/chakra/componentStyles.d.ts +19 -3
- package/dist/Theme/chakra/componentStyles.js +12 -8
- package/dist/Theme/chakra/motion.d.ts +1 -0
- package/dist/Theme/chakra/motion.js +2 -1
- package/dist/Theme/chakra/overlay.styles.d.ts +5 -0
- package/dist/Theme/chakra/overlay.styles.js +4 -1
- package/dist/Theme/themeProps.d.ts +4 -0
- package/dist/Theme/tokens/brands/index.d.ts +1 -0
- package/dist/Theme/tokens/brands/index.js +17 -1
- package/dist/Theme/tokens/brands/radiant/palette.light.js +15 -0
- package/dist/Theme/tokens/brands/rosewood/palette.light.js +10 -10
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +7 -29
- package/dist/Theme/tokens/brands/zinc/palette.dark.js +3 -35
- package/dist/Theme/tokens/builders/accentText.d.ts +2 -0
- package/dist/Theme/tokens/builders/accentText.js +7 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +6 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.js +37 -8
- package/dist/Theme/tokens/builders/filledSurface.d.ts +5 -1
- package/dist/Theme/tokens/builders/filledSurface.js +17 -4
- package/dist/Theme/tokens/builders/mutedText.d.ts +1 -1
- package/dist/Theme/tokens/builders/mutedText.js +13 -3
- package/dist/Theme/tokens/builders/planeStep.d.ts +5 -0
- package/dist/Theme/tokens/builders/planeStep.js +21 -0
- package/dist/Theme/tokens/builders/planes.d.ts +4 -0
- package/dist/Theme/tokens/builders/planes.js +33 -0
- package/dist/Theme/tokens/builders/skeletonShimmer.d.ts +9 -0
- package/dist/Theme/tokens/builders/skeletonShimmer.js +25 -0
- package/dist/Theme/tokens/builders/surfaceRaised.d.ts +3 -1
- package/dist/Theme/tokens/builders/surfaceRaised.js +18 -8
- package/dist/Theme/tokens/builders/surfaceRungs.js +3 -1
- package/dist/Theme/tokens/primitives/index.d.ts +2 -2
- package/dist/Theme/tokens/primitives/index.js +4 -1
- package/dist/Theme/tokens/primitives/motion.d.ts +1 -0
- package/dist/Theme/tokens/primitives/motion.js +2 -1
- package/dist/Theme/tokens/primitives/shadows.d.ts +16 -0
- package/dist/Theme/tokens/primitives/shadows.js +56 -6
- package/dist/Theme/tokens/primitives/typography.js +1 -1
- package/dist/Utils/table.js +2 -2
- package/dist/esm/Components/Button/Button.styles.js +62 -27
- package/dist/esm/Components/ConfirmDialog/ConfirmDialog.js +2 -1
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +6 -4
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +2 -1
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +2 -1
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +2 -1
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -1
- package/dist/esm/Components/DatePicker/dayStates.js +2 -1
- package/dist/esm/Components/Drawer/Drawer.js +2 -1
- package/dist/esm/Components/Dropdown/DropDown.js +4 -10
- package/dist/esm/Components/FilePreview/FilePreview.js +3 -2
- package/dist/esm/Components/FileUpload/FileUpload.js +10 -3
- package/dist/esm/Components/FileUploader/FileUploader.js +4 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +7 -4
- package/dist/esm/Components/Input/TextInput.styles.js +10 -6
- package/dist/esm/Components/KanbanBoard/AccountCard.js +4 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +6 -5
- package/dist/esm/Components/NavigationBar/NavigationBar.js +5 -3
- package/dist/esm/Components/Notification/Notification.js +4 -3
- package/dist/esm/Components/NotificationBell/NotificationPanel.js +4 -3
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -4
- package/dist/esm/Components/OrganizationDetails/CreateOrgModal.js +2 -1
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +5 -3
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +13 -8
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +5 -4
- package/dist/esm/Components/SearchSelect/SearchSelect.js +46 -37
- package/dist/esm/Components/SearchSelect/searchSelectNav.js +32 -0
- package/dist/esm/Components/Select/SelectPopup.js +4 -5
- package/dist/esm/Components/Select/optionRowInk.js +7 -0
- package/dist/esm/Components/SelectSearch/SelectSearch.js +4 -12
- package/dist/esm/Components/SettingRow/SettingRow.js +2 -1
- package/dist/esm/Components/SettingRow/SettingsSection.js +2 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +4 -3
- package/dist/esm/Components/SideBar/SideBar.js +17 -14
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +7 -4
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +2 -1
- package/dist/esm/Components/SideBar/components/OtherApps.js +2 -1
- package/dist/esm/Components/SideBar/components/PinnedSection.js +7 -4
- package/dist/esm/Components/SideBar/sidebarMotion.js +3 -0
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +6 -4
- package/dist/esm/Components/StageProgress/StageItem.js +5 -2
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -2
- package/dist/esm/Components/StatCard/StatCard.js +2 -1
- package/dist/esm/Components/Table/Table.js +12 -7
- package/dist/esm/Components/Table/components/TableActions.js +3 -2
- package/dist/esm/Components/Table/components/TableBody.js +10 -2
- package/dist/esm/Components/Table/components/TableHeader.js +9 -4
- package/dist/esm/Components/Table/components/TableLoading.js +5 -4
- package/dist/esm/Components/Table/filters/CompactSelect.js +4 -12
- package/dist/esm/Components/Table/settings/TableSettings.js +8 -3
- package/dist/esm/Components/Table/variants/TableVariantContext.js +3 -3
- package/dist/esm/Components/Table/variants/classic.js +3 -2
- package/dist/esm/Components/Timeline/Timeline.js +11 -4
- package/dist/esm/Components/Toaster/Toaster.js +20 -9
- package/dist/esm/Components/Toggle/TableToggle.js +5 -2
- package/dist/esm/Components/UserDetails/AddUserModal.js +2 -1
- package/dist/esm/Components/UserDetails/ChangeRoleModal.js +2 -1
- package/dist/esm/Components/UserDetails/UserDetails.js +3 -1
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +4 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +26 -19
- package/dist/esm/Theme/chakra/Card.styles.js +4 -1
- package/dist/esm/Theme/chakra/Menu.styles.js +10 -0
- package/dist/esm/Theme/chakra/Popover.styles.js +2 -0
- package/dist/esm/Theme/chakra/componentStyles.js +12 -8
- package/dist/esm/Theme/chakra/motion.js +1 -0
- package/dist/esm/Theme/chakra/overlay.styles.js +3 -0
- package/dist/esm/Theme/tokens/brands/index.js +16 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +15 -0
- package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +10 -10
- package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +3 -35
- package/dist/esm/Theme/tokens/builders/accentText.js +5 -0
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +38 -9
- package/dist/esm/Theme/tokens/builders/filledSurface.js +18 -5
- package/dist/esm/Theme/tokens/builders/mutedText.js +12 -2
- package/dist/esm/Theme/tokens/builders/planeStep.js +14 -0
- package/dist/esm/Theme/tokens/builders/planes.js +28 -0
- package/dist/esm/Theme/tokens/builders/skeletonShimmer.js +21 -0
- package/dist/esm/Theme/tokens/builders/surfaceRaised.js +16 -7
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +3 -1
- package/dist/esm/Theme/tokens/primitives/index.js +1 -1
- package/dist/esm/Theme/tokens/primitives/motion.js +1 -0
- package/dist/esm/Theme/tokens/primitives/shadows.js +54 -5
- package/dist/esm/Theme/tokens/primitives/typography.js +1 -1
- package/dist/esm/Utils/table.js +2 -2
- package/dist/esm/index.js +4 -3
- package/dist/index.d.ts +5 -4
- package/dist/index.js +15 -6
- package/package.json +1 -1
|
@@ -15,8 +15,22 @@ const primary = {
|
|
|
15
15
|
900: "#531a14",
|
|
16
16
|
opacity: buildPrimaryOpacity(PRIMARY_500),
|
|
17
17
|
};
|
|
18
|
+
const danger = {
|
|
19
|
+
50: "#fcedf3",
|
|
20
|
+
100: "#f5c5db",
|
|
21
|
+
200: "#f1a9ca",
|
|
22
|
+
300: "#ec82b4",
|
|
23
|
+
400: "#ea69a7",
|
|
24
|
+
500: "#e74494",
|
|
25
|
+
600: "#d23e87",
|
|
26
|
+
700: "#a43069",
|
|
27
|
+
800: "#7f2651",
|
|
28
|
+
900: "#611c3e",
|
|
29
|
+
};
|
|
18
30
|
const palette = {
|
|
19
31
|
...neutralTokens,
|
|
32
|
+
red: danger,
|
|
33
|
+
semantic: { ...neutralTokens.semantic, error: danger },
|
|
20
34
|
...buildBrandInk(PRIMARY_500),
|
|
21
35
|
// NOTE: stops retuned so white gradient-button text clears AA at both ends — original let it drop to 4.37/2.15.
|
|
22
36
|
gradient: { from: "#cd4733", to: "#a36807" }, // terracotta red → amber
|
|
@@ -118,6 +132,7 @@ const palette = {
|
|
|
118
132
|
boxShadow: {
|
|
119
133
|
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
120
134
|
...sharedBoxShadow,
|
|
135
|
+
error: `${danger[500]}47`,
|
|
121
136
|
},
|
|
122
137
|
};
|
|
123
138
|
export default palette;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { neutralTokens, sharedBoxShadow } from "../neutrals.js";
|
|
2
2
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
3
3
|
import { buildBrandInk } from "../../builders/brandInk.js";
|
|
4
|
-
const PRIMARY_500 = "#
|
|
4
|
+
const PRIMARY_500 = "#cb6b94";
|
|
5
5
|
const primary = {
|
|
6
|
-
50: "#
|
|
7
|
-
100: "#
|
|
8
|
-
200: "#
|
|
9
|
-
300: "#
|
|
10
|
-
400: "#
|
|
6
|
+
50: "#fcf2f7",
|
|
7
|
+
100: "#f6d6e5",
|
|
8
|
+
200: "#edabc9",
|
|
9
|
+
300: "#e480ad",
|
|
10
|
+
400: "#d76398",
|
|
11
11
|
500: PRIMARY_500,
|
|
12
|
-
600: "#
|
|
13
|
-
700: "#
|
|
14
|
-
800: "#
|
|
15
|
-
900: "#
|
|
12
|
+
600: "#b35681",
|
|
13
|
+
700: "#93466a",
|
|
14
|
+
800: "#723754",
|
|
15
|
+
900: "#52273e",
|
|
16
16
|
opacity: buildPrimaryOpacity(PRIMARY_500),
|
|
17
17
|
};
|
|
18
18
|
const palette = {
|
|
@@ -33,19 +33,6 @@ const secondary = {
|
|
|
33
33
|
900: "#fafafa",
|
|
34
34
|
opacity: buildPrimaryOpacity(SECONDARY_500),
|
|
35
35
|
};
|
|
36
|
-
// background[50] = the elevated surface (#0e0e11), resolved through a token, not a literal.
|
|
37
|
-
const background = {
|
|
38
|
-
50: "#0e0e11",
|
|
39
|
-
100: "#131316",
|
|
40
|
-
200: "#18181b",
|
|
41
|
-
300: "#212124",
|
|
42
|
-
400: "#27272a",
|
|
43
|
-
500: "#3f3f46",
|
|
44
|
-
600: "#52525b",
|
|
45
|
-
700: "#71717a",
|
|
46
|
-
800: "#a1a1aa",
|
|
47
|
-
900: "#d4d4d8",
|
|
48
|
-
};
|
|
49
36
|
const text = {
|
|
50
37
|
50: "#71717a",
|
|
51
38
|
100: "#8a8a93",
|
|
@@ -71,10 +58,7 @@ const header = {
|
|
|
71
58
|
900: "#ffffff",
|
|
72
59
|
};
|
|
73
60
|
// NOTE: gray[400] is the one value here NOT ported verbatim — pinned to clear the 3:1 non-text bar (shadcn's own measures 2.81).
|
|
74
|
-
const
|
|
75
|
-
50: "#18181b",
|
|
76
|
-
100: "#27272a",
|
|
77
|
-
200: "#3f3f46",
|
|
61
|
+
const grayInk = {
|
|
78
62
|
300: "#52525b",
|
|
79
63
|
400: "#7a7a83",
|
|
80
64
|
500: "#a1a1aa",
|
|
@@ -132,20 +116,6 @@ const disabled = {
|
|
|
132
116
|
800: "#a1a1aa",
|
|
133
117
|
900: "#d4d4d8",
|
|
134
118
|
};
|
|
135
|
-
const table = {
|
|
136
|
-
hover: {
|
|
137
|
-
50: "#0e0e11",
|
|
138
|
-
100: "#131316",
|
|
139
|
-
200: "#18181b",
|
|
140
|
-
300: "#1f1f22",
|
|
141
|
-
400: "#27272a",
|
|
142
|
-
500: "#2f2f33",
|
|
143
|
-
600: "#3f3f46",
|
|
144
|
-
700: "#52525b",
|
|
145
|
-
800: "#71717a",
|
|
146
|
-
900: "#a1a1aa",
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
119
|
const buildPalette = () => {
|
|
150
120
|
const derived = buildDarkPalette(light);
|
|
151
121
|
return {
|
|
@@ -154,16 +124,14 @@ const buildPalette = () => {
|
|
|
154
124
|
primary,
|
|
155
125
|
secondary,
|
|
156
126
|
tertiary: { ...rotateScaleHue(secondary), opacity: secondary.opacity },
|
|
157
|
-
// NOTE: backgroundColor
|
|
158
|
-
background,
|
|
127
|
+
// NOTE: the planes (backgroundColor, background, table, gray fills) stay derived — they rise with the card.
|
|
159
128
|
text,
|
|
160
129
|
header,
|
|
161
|
-
gray,
|
|
130
|
+
gray: { ...derived.gray, ...grayInk },
|
|
162
131
|
border,
|
|
163
132
|
boxborder,
|
|
164
133
|
placeholder,
|
|
165
134
|
disabled,
|
|
166
|
-
table,
|
|
167
135
|
accentText: pickAccentText(primary, derived.backgroundColor.main),
|
|
168
136
|
onPrimary: onFilled(PRIMARY_500, derived.white, derived.black),
|
|
169
137
|
boxShadow: {
|
|
@@ -19,6 +19,11 @@ const DARK_CANVAS_LUMINANCE = 0.2;
|
|
|
19
19
|
export const isDarkCanvas = (canvas) => relativeLuminance(canvas) < DARK_CANVAS_LUMINANCE;
|
|
20
20
|
// NOTE: held to AA in both modes now — some brands' light [500] no longer passes through untouched.
|
|
21
21
|
export const accentTextOnCanvas = (scale, canvas) => pickAccentText(scale, canvas);
|
|
22
|
+
/** Accent ink for chrome that can land on any plane (canvas, card, overlay): the first rung clearing AA on all. */
|
|
23
|
+
export const accentTextOnPlanes = (scale, planes) => {
|
|
24
|
+
const found = SEARCH_ORDER.find((rung) => planes.every((plane) => contrastRatio(scale[rung], plane) >= AA_NORMAL_TEXT));
|
|
25
|
+
return scale[found !== null && found !== void 0 ? found : SEARCH_ORDER[SEARCH_ORDER.length - 1]];
|
|
26
|
+
};
|
|
22
27
|
// NOTE: white/black must be the mode-stable absolutes, not an adaptive token — always clears AA.
|
|
23
28
|
export const onFilled = (fill, white, black) => contrastRatio(white, fill) >= AA_NORMAL_TEXT ? white : black;
|
|
24
29
|
// NOTE: resolves against whichever gradient stop is lighter — the harder case for ink to clear.
|
|
@@ -5,8 +5,9 @@ import { withSidebarTokens } from "./sidebarAccent.js";
|
|
|
5
5
|
import { buildMutedText } from "./mutedText.js";
|
|
6
6
|
import { buildSemanticText, buildOnSemantic } from "./semanticText.js";
|
|
7
7
|
import { buildFocusRing } from "./focusRing.js";
|
|
8
|
-
import { buildSurfaceRaised } from "./surfaceRaised.js";
|
|
8
|
+
import { buildSurfaceRaised, filledMarks } from "./surfaceRaised.js";
|
|
9
9
|
import { buildStar } from "./star.js";
|
|
10
|
+
import { CARD_LIFT, lift } from "./planes.js";
|
|
10
11
|
// Structural ramps are rebuilt at explicit targets (not reversed — light ramps bottom near 35%);
|
|
11
12
|
// utility hues are reversed so index roles survive; brand/semantic ramps shift one step lighter.
|
|
12
13
|
const SCALE_KEYS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
@@ -142,23 +143,49 @@ const NAMED_SURFACE_L = {
|
|
|
142
143
|
accent: 17,
|
|
143
144
|
muted: 18,
|
|
144
145
|
};
|
|
145
|
-
|
|
146
|
-
const SURFACE_SAT = 0;
|
|
146
|
+
const SURFACE_SAT = { lifted: 14, flat: 0 };
|
|
147
147
|
const TEXT_SAT = 12;
|
|
148
148
|
const PLACEHOLDER_SAT = 10;
|
|
149
149
|
const BORDER_SAT = 12;
|
|
150
150
|
const DISABLED_SAT = 8;
|
|
151
151
|
const GRAY_SAT = 0;
|
|
152
|
-
|
|
152
|
+
// Fill rungs drawn ON a card keep their step above it, so they rise with the card; ink and chrome rungs stay.
|
|
153
|
+
const BACKGROUND_FILLS = [100, 200, 300, 400, 500];
|
|
154
|
+
// NOTE: table.hover[500] gates every ink (it is a named surface), so it climbs one rung per step, not the card's full rise.
|
|
155
|
+
const TABLE_HOVER_ABOVE_CARD = {
|
|
156
|
+
50: 1, 100: 3, 200: 5, 300: 6, 400: 6.5, 500: 7,
|
|
157
|
+
};
|
|
158
|
+
const GRAY_FILLS = [50, 100, 200];
|
|
159
|
+
const raise = (targets, rungs, by) => ({
|
|
160
|
+
...targets,
|
|
161
|
+
...Object.fromEntries(rungs.map((k) => [k, targets[k] + by])),
|
|
162
|
+
});
|
|
163
|
+
const cardPlane = (canvas, white, planes) => {
|
|
164
|
+
if (planes === "flat")
|
|
165
|
+
return { card: canvas, rise: 0, tableHover: TABLE_HOVER_TARGETS };
|
|
166
|
+
const card = lift(white, canvas, CARD_LIFT);
|
|
167
|
+
const cardL = hexToHsl(card).l;
|
|
168
|
+
const tableHover = {
|
|
169
|
+
...TABLE_HOVER_TARGETS,
|
|
170
|
+
...Object.fromEntries(Object.entries(TABLE_HOVER_ABOVE_CARD).map(([k, step]) => [k, cardL + step])),
|
|
171
|
+
};
|
|
172
|
+
return { card, rise: cardL - hexToHsl(canvas).l, tableHover };
|
|
173
|
+
};
|
|
174
|
+
export function buildDarkPalette(light, { planes = "lifted" } = {}) {
|
|
153
175
|
const hueSource = light.primary[500];
|
|
154
176
|
const { h } = hexToHsl(hueSource);
|
|
177
|
+
const surfaceSat = SURFACE_SAT[planes];
|
|
155
178
|
const namedSurfaces = Object.fromEntries(Object.entries(NAMED_SURFACE_L).map(([key, l]) => [
|
|
156
179
|
key,
|
|
157
|
-
hslToHex({ h, s:
|
|
180
|
+
hslToHex({ h, s: surfaceSat, l }),
|
|
158
181
|
]));
|
|
159
182
|
const white = light.white;
|
|
183
|
+
const { card, rise, tableHover } = cardPlane(namedSurfaces.main, white, planes);
|
|
160
184
|
const primary = liftBrand(light.primary, white);
|
|
161
|
-
const background =
|
|
185
|
+
const background = {
|
|
186
|
+
...fromTargets(hueSource, raise(SURFACE_TARGETS, BACKGROUND_FILLS, rise), surfaceSat),
|
|
187
|
+
50: card,
|
|
188
|
+
};
|
|
162
189
|
const semantic = {
|
|
163
190
|
success: liftAccent(light.semantic.success, white),
|
|
164
191
|
error: liftAccent(light.semantic.error, white),
|
|
@@ -178,7 +205,7 @@ export function buildDarkPalette(light) {
|
|
|
178
205
|
transparent: light.transparent,
|
|
179
206
|
black: light.black,
|
|
180
207
|
white: light.white,
|
|
181
|
-
gray: fromTargets(hueSource, GRAY_TARGETS, GRAY_SAT),
|
|
208
|
+
gray: fromTargets(hueSource, raise(GRAY_TARGETS, GRAY_FILLS, rise), GRAY_SAT),
|
|
182
209
|
red: reverseScale(light.red),
|
|
183
210
|
orange: reverseScale(light.orange),
|
|
184
211
|
yellow: reverseScale(light.yellow),
|
|
@@ -195,7 +222,9 @@ export function buildDarkPalette(light) {
|
|
|
195
222
|
placeholder: fromTargets(hueSource, PLACEHOLDER_TARGETS, PLACEHOLDER_SAT),
|
|
196
223
|
border: dividerRamp,
|
|
197
224
|
boxborder: dividerRamp,
|
|
198
|
-
table: {
|
|
225
|
+
table: {
|
|
226
|
+
hover: fromTargets(hueSource, tableHover, surfaceSat),
|
|
227
|
+
},
|
|
199
228
|
disabled: fromTargets(hueSource, DISABLED_TARGETS, DISABLED_SAT),
|
|
200
229
|
accentText: pickAccentText(primary, namedSurfaces.main),
|
|
201
230
|
textMuted: buildMutedText(fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT), namedSurfaces.main),
|
|
@@ -203,7 +232,7 @@ export function buildDarkPalette(light) {
|
|
|
203
232
|
onPrimary: onFilled(primary[500], light.white, light.black),
|
|
204
233
|
onSemantic: buildOnSemantic(semantic, light.white, light.black),
|
|
205
234
|
focusRing: buildFocusRing({ primary, background, backgroundColor: namedSurfaces }),
|
|
206
|
-
surfaceRaised: buildSurfaceRaised({ backgroundColor: namedSurfaces, background, white }),
|
|
235
|
+
surfaceRaised: buildSurfaceRaised({ backgroundColor: namedSurfaces, background, white }, filledMarks({ primary, semantic })),
|
|
207
236
|
star: buildStar(namedSurfaces.main),
|
|
208
237
|
sidebar: withSidebarTokens(light),
|
|
209
238
|
boxShadow: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { contrastRatio } from "./color.js";
|
|
2
2
|
import { AA_NORMAL_TEXT, isDarkCanvas, onFilled } from "./accentText.js";
|
|
3
|
-
import { AA_NON_TEXT } from "./outlineRung.js";
|
|
3
|
+
import { AA_NON_TEXT, CHROME_BORDER } from "./outlineRung.js";
|
|
4
4
|
import { memoize, scaleKey } from "./memo.js";
|
|
5
5
|
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
6
6
|
// NOTE: "darker than [500]" is [600]/[700] in light but [400]/[300] in dark, since dark ramps run dark -> light.
|
|
@@ -40,15 +40,28 @@ const steppedRung = (base, canvas, step) => {
|
|
|
40
40
|
const dir = isDarkCanvas(canvas) ? -100 : 100;
|
|
41
41
|
return Math.min(900, Math.max(50, base + dir * step));
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
const steppedTowardBase = (from, base) => RUNGS[RUNGS.indexOf(from) + (from > base ? -1 : 1)];
|
|
44
|
+
/**
|
|
45
|
+
* Hover (step 0) or active (step 1) fill rung, one step darker than `solidFillRung`. A step may not
|
|
46
|
+
* flip the label's side of AA (zinc dark: near-white fill, black ink) or fall below `CHROME_BORDER`
|
|
47
|
+
* against the canvas (a pressed warning solid used to reach 1.00:1 on the card).
|
|
48
|
+
*/
|
|
44
49
|
export const darkerFillRung = (scale, canvas, white, step) => {
|
|
45
50
|
const base = solidFillRung(scale, white, canvas);
|
|
51
|
+
const wantsWhite = contrastRatio(white, scale[base]) >= AA_NORMAL_TEXT;
|
|
52
|
+
const holds = (rung) => contrastRatio(scale[rung], canvas) >= CHROME_BORDER &&
|
|
53
|
+
(contrastRatio(white, scale[rung]) >= AA_NORMAL_TEXT) === wantsWhite;
|
|
54
|
+
let rung;
|
|
46
55
|
if (base === 500) {
|
|
47
56
|
const mode = isDarkCanvas(canvas) ? "dark" : "light";
|
|
48
|
-
|
|
57
|
+
rung = FILL_STEP_RUNGS[mode][step];
|
|
49
58
|
}
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
else {
|
|
60
|
+
rung = steppedRung(base, canvas, step === 0 ? 1 : 2);
|
|
61
|
+
}
|
|
62
|
+
while (rung !== base && !holds(rung))
|
|
63
|
+
rung = steppedTowardBase(rung, base);
|
|
64
|
+
return rung;
|
|
52
65
|
};
|
|
53
66
|
/** Label ink for a specific fill swatch — always `onFilled`, exported for style configs. */
|
|
54
67
|
export const labelOnFill = (fill, white, black) => onFilled(fill, white, black);
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { contrastRatio, hexToHsl, relativeLuminance, withLightness } from "./color.js";
|
|
1
2
|
import { liftToContrast } from "./outlineRung.js";
|
|
2
3
|
/** WCAG 1.4.3 — muted is still body text. */
|
|
3
4
|
export const AA_NORMAL_TEXT = 4.5;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
export const MUTED_TEXT_CEILING = 8;
|
|
6
|
+
const settleUnder = (hex, canvas, ceiling) => {
|
|
7
|
+
const { s, l } = hexToHsl(hex);
|
|
8
|
+
const toward = relativeLuminance(canvas) < 0.5 ? -1 : 1;
|
|
9
|
+
let settled = hex;
|
|
10
|
+
for (let next = l; contrastRatio(settled, canvas) > ceiling; next += toward) {
|
|
11
|
+
settled = withLightness(hex, next, s);
|
|
12
|
+
}
|
|
13
|
+
return settled;
|
|
14
|
+
};
|
|
15
|
+
export const buildMutedText = (text, canvas) => liftToContrast(settleUnder(text[400], canvas, MUTED_TEXT_CEILING), canvas, AA_NORMAL_TEXT);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DEFAULT_BLACK, isDarkCanvas } from "./accentText.js";
|
|
2
|
+
import { contrastRatio } from "./color.js";
|
|
3
|
+
import { CHROME_RULE, MIN_PERCEPTIBLE_STEP, liftToContrast, tintStep } from "./outlineRung.js";
|
|
4
|
+
import { lift } from "./planes.js";
|
|
5
|
+
const holds = (fill, plane, target) => !isDarkCanvas(plane) || contrastRatio(fill, plane) >= target;
|
|
6
|
+
export const bandOn = (fill, plane) => holds(fill, plane, MIN_PERCEPTIBLE_STEP) ? fill : tintStep(fill, plane, MIN_PERCEPTIBLE_STEP);
|
|
7
|
+
export const recessOn = (fill, plane) => holds(fill, plane, MIN_PERCEPTIBLE_STEP)
|
|
8
|
+
? fill
|
|
9
|
+
: lift(DEFAULT_BLACK, plane, MIN_PERCEPTIBLE_STEP);
|
|
10
|
+
export const ruleOn = (colors, plane) => {
|
|
11
|
+
const rule = colors.boxborder[200];
|
|
12
|
+
return holds(rule, plane, CHROME_RULE) ? rule : liftToContrast(rule, plane, CHROME_RULE);
|
|
13
|
+
};
|
|
14
|
+
export const cardRule = (colors) => ruleOn(colors, colors.background[50]);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { contrastRatio, mix } from "./color.js";
|
|
2
|
+
import { AA_NON_TEXT } from "./outlineRung.js";
|
|
3
|
+
export const CARD_LIFT = 1.16;
|
|
4
|
+
export const RAISED_LIFT = 1.15;
|
|
5
|
+
const STEP = 0.005;
|
|
6
|
+
const MAX_WEIGHT = 0.4;
|
|
7
|
+
export function lift(ink, base, target) {
|
|
8
|
+
for (let t = STEP * 4; t < MAX_WEIGHT; t += STEP) {
|
|
9
|
+
const next = mix(base, ink, t);
|
|
10
|
+
if (contrastRatio(next, base) >= target)
|
|
11
|
+
return next;
|
|
12
|
+
}
|
|
13
|
+
return mix(base, ink, MAX_WEIGHT);
|
|
14
|
+
}
|
|
15
|
+
const clearsMarks = (surface, marks) => marks.every((mark) => contrastRatio(mark, surface) >= AA_NON_TEXT);
|
|
16
|
+
// NOTE: stops one step early rather than drop a filled mark under 3:1 on the lifted plane.
|
|
17
|
+
export function liftUnder(ink, base, target, marks) {
|
|
18
|
+
let settled = base;
|
|
19
|
+
for (let t = STEP * 4; t < MAX_WEIGHT; t += STEP) {
|
|
20
|
+
const next = mix(base, ink, t);
|
|
21
|
+
if (!clearsMarks(next, marks))
|
|
22
|
+
return settled;
|
|
23
|
+
if (contrastRatio(next, base) >= target)
|
|
24
|
+
return next;
|
|
25
|
+
settled = next;
|
|
26
|
+
}
|
|
27
|
+
return settled;
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { contrastRatio, hexToHsl, relativeLuminance, withLightness } from "./color.js";
|
|
2
|
+
/** Same pulse depth as the mobile library's `SKELETON_SHIMMER_CONTRAST`. */
|
|
3
|
+
export const SKELETON_SHIMMER_CONTRAST = 1.35;
|
|
4
|
+
const settleAway = (seed, base, target) => {
|
|
5
|
+
const { s } = hexToHsl(seed);
|
|
6
|
+
let near = hexToHsl(base).l;
|
|
7
|
+
let far = relativeLuminance(base) < 0.5 ? 100 : 0;
|
|
8
|
+
for (let i = 0; i < 20; i += 1) {
|
|
9
|
+
const mid = (near + far) / 2;
|
|
10
|
+
if (contrastRatio(withLightness(seed, mid, s), base) < target)
|
|
11
|
+
near = mid;
|
|
12
|
+
else
|
|
13
|
+
far = mid;
|
|
14
|
+
}
|
|
15
|
+
return withLightness(seed, far, s);
|
|
16
|
+
};
|
|
17
|
+
/** The two colours a Skeleton pulses between: `gray[100]`, and `gray[300]`'s tint settled to the amplitude. */
|
|
18
|
+
export const skeletonShimmer = (palette) => ({
|
|
19
|
+
start: palette.gray[100],
|
|
20
|
+
end: settleAway(palette.gray[300], palette.gray[100], SKELETON_SHIMMER_CONTRAST),
|
|
21
|
+
});
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { contrastRatio, mix, relativeLuminance } from "./color.js";
|
|
2
2
|
import { liftToContrast } from "./outlineRung.js";
|
|
3
|
+
import { RAISED_LIFT, liftUnder } from "./planes.js";
|
|
4
|
+
import { cardRule } from "./planeStep.js";
|
|
5
|
+
import { SEMANTIC_TONES } from "./semanticText.js";
|
|
3
6
|
export const RAISED_OVERLAY = 0.07;
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
+
/** The filled fills a raised plane must keep at 3:1, or a button on a menu stops reading. */
|
|
8
|
+
export const filledMarks = (colors) => [
|
|
9
|
+
colors.primary[500],
|
|
10
|
+
...SEMANTIC_TONES.map((tone) => colors.semantic[tone][500]),
|
|
11
|
+
];
|
|
12
|
+
// Never below the card: the lighter of one white-overlay step off the canvas and a RAISED_LIFT step off the card.
|
|
13
|
+
export const buildSurfaceRaised = (source, marks = []) => {
|
|
7
14
|
const card = source.background[50];
|
|
8
|
-
|
|
15
|
+
const overlay = mix(source.backgroundColor.main, source.white, RAISED_OVERLAY);
|
|
16
|
+
const stepped = liftUnder(source.white, card, RAISED_LIFT, marks);
|
|
17
|
+
return [overlay, stepped].reduce((top, c) => (relativeLuminance(c) > relativeLuminance(top) ? c : top), card);
|
|
9
18
|
};
|
|
10
19
|
export const withSurfaceRaised = (palette) => ({
|
|
11
20
|
...palette,
|
|
12
|
-
surfaceRaised: buildSurfaceRaised(palette),
|
|
21
|
+
surfaceRaised: buildSurfaceRaised(palette, filledMarks(palette)),
|
|
13
22
|
});
|
|
14
|
-
// A divider inside an overlay, at the weight
|
|
15
|
-
export const raisedRule = (colors) => liftToContrast(colors.boxborder[200], colors.surfaceRaised, contrastRatio(colors
|
|
23
|
+
// A divider inside an overlay, at the weight a rule has inside a card.
|
|
24
|
+
export const raisedRule = (colors) => liftToContrast(colors.boxborder[200], colors.surfaceRaised, contrastRatio(cardRule(colors), colors.background[50]));
|
|
@@ -2,6 +2,7 @@ import { contrastRatio } from "./color.js";
|
|
|
2
2
|
import { liftToContrast, settleAcross, ruleInk, AA_NON_TEXT, CHROME_BORDER, CHROME_RULE } from "./outlineRung.js";
|
|
3
3
|
import { AA_NORMAL_TEXT, pickAccentText } from "./accentText.js";
|
|
4
4
|
import { SEMANTIC_TONES } from "./semanticText.js";
|
|
5
|
+
import { listRowBackgrounds } from "./rowStates.js";
|
|
5
6
|
// NOTE: hint held to the non-text floor, not body-text — at 4.5 an empty field reads as typed-into. See CHROME-CONSISTENCY.md.
|
|
6
7
|
export const PLACEHOLDER_TEXT = AA_NON_TEXT;
|
|
7
8
|
export const namedSurfaces = (palette) => [
|
|
@@ -15,6 +16,7 @@ export const hardestSurface = (ink, surfaces) => surfaces.reduce((worst, s) => c
|
|
|
15
16
|
// Runs last: `table.hover` is one of the surfaces, and it settles in its own rung.
|
|
16
17
|
export function withSurfaceRungs(palette) {
|
|
17
18
|
const surfaces = namedSurfaces(palette);
|
|
19
|
+
const accentSurfaces = [...surfaces, ...Object.values(listRowBackgrounds(palette))];
|
|
18
20
|
const lift = (ink, target) => liftToContrast(ink, hardestSurface(ink, surfaces), target);
|
|
19
21
|
const settle = (ink, target) => settleAcross(ink, surfaces, target);
|
|
20
22
|
const rule = (ink) => ruleInk(ink, [palette.backgroundColor.main, palette.background[50]], CHROME_RULE);
|
|
@@ -25,7 +27,7 @@ export function withSurfaceRungs(palette) {
|
|
|
25
27
|
return {
|
|
26
28
|
...palette,
|
|
27
29
|
textMuted: lift(palette.textMuted, AA_NORMAL_TEXT),
|
|
28
|
-
accentText: pickAccentText(palette.primary, hardestSurface(palette.accentText,
|
|
30
|
+
accentText: pickAccentText(palette.primary, hardestSurface(palette.accentText, accentSurfaces)),
|
|
29
31
|
semanticText,
|
|
30
32
|
text: { ...palette.text, 500: lift(palette.text[500], AA_NORMAL_TEXT) },
|
|
31
33
|
header: { ...palette.header, 500: lift(palette.header[500], AA_NORMAL_TEXT) },
|
|
@@ -3,7 +3,7 @@ export { default as sizes } from "./sizes.js";
|
|
|
3
3
|
export { default as radii, RADIUS_ROLE } from "./radii.js";
|
|
4
4
|
export * from "./borderWidths.js";
|
|
5
5
|
export * from "./states.js";
|
|
6
|
-
export { default as shadows, shadowsDark, shadowsFor } from "./shadows.js";
|
|
6
|
+
export { default as shadows, shadowsDark, shadowsFor, shadowCss, ELEVATION_LAYERS, SHADOW_INK } from "./shadows.js";
|
|
7
7
|
export { default as zIndices } from "./zIndices.js";
|
|
8
8
|
export { default as breakpoints } from "./breakpoints.js";
|
|
9
9
|
export { default as lineHeights } from "./lineHeights.js";
|
|
@@ -11,6 +11,7 @@ export const MOTION_EASE_OUT = cubicBezierCss(MOTION_BEZIER.out);
|
|
|
11
11
|
export const MOTION_EASE_IN = cubicBezierCss(MOTION_BEZIER.in);
|
|
12
12
|
/** Periods for loops that are feedback, not transitions: skeleton pulse, spinner turn, progress sweep. */
|
|
13
13
|
export const MOTION_LOOP_MS = { pulse: 700, spin: 800, sweep: 1200 };
|
|
14
|
+
export const MOTION_PRESS_SCALE = 0.98;
|
|
14
15
|
/** A `transition` value for named properties only — `all` also animates layout and colour flips. */
|
|
15
16
|
export const transitionFor = (properties, speed = "fast", curve = "standard") => {
|
|
16
17
|
if (properties.includes("all"))
|
|
@@ -1,17 +1,66 @@
|
|
|
1
|
+
const layer = (x, y, blur, spread, alphaHex) => ({
|
|
2
|
+
x,
|
|
3
|
+
y,
|
|
4
|
+
blur,
|
|
5
|
+
spread,
|
|
6
|
+
alphaHex,
|
|
7
|
+
});
|
|
8
|
+
export const SHADOW_INK = { light: "#141828", dark: "#000000" };
|
|
9
|
+
/** Pebble elevation stacks (mobile `pebble/elevation.ts`), per mode and role. */
|
|
10
|
+
export const ELEVATION_LAYERS = {
|
|
11
|
+
light: {
|
|
12
|
+
cardPress: [layer(0, 1, 2, 0, "0d"), layer(0, 2, 6, -2, "0d")],
|
|
13
|
+
card: [layer(0, 1, 2, 0, "0a"), layer(0, 3, 10, -2, "0d"), layer(0, 14, 32, -14, "1f")],
|
|
14
|
+
float: [layer(0, 2, 6, 0, "0f"), layer(0, 16, 40, -10, "38")],
|
|
15
|
+
dialog: [layer(0, 4, 12, 0, "0f"), layer(0, 28, 64, -16, "4d")],
|
|
16
|
+
sheet: [layer(0, -2, 8, 0, "0a"), layer(0, -18, 48, -14, "33")],
|
|
17
|
+
},
|
|
18
|
+
dark: {
|
|
19
|
+
cardPress: [layer(0, 1, 1, 0, "3d")],
|
|
20
|
+
card: [layer(0, 1, 2, 0, "47")],
|
|
21
|
+
float: [layer(0, 2, 8, 0, "52"), layer(0, 18, 44, -10, "9e")],
|
|
22
|
+
dialog: [layer(0, 4, 14, 0, "59"), layer(0, 28, 64, -16, "b3")],
|
|
23
|
+
sheet: [layer(0, -2, 10, 0, "4d"), layer(0, -18, 48, -14, "99")],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const length = (n) => (n === 0 ? "0" : `${n}px`);
|
|
27
|
+
const rgbChannels = (hex) => [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16)).join(", ");
|
|
28
|
+
const alphaOf = (alphaHex) => Math.round((parseInt(alphaHex, 16) / 255) * 100) / 100;
|
|
29
|
+
export const shadowCss = (layers, ink) => layers
|
|
30
|
+
.map((l) => `${length(l.x)} ${length(l.y)} ${length(l.blur)} ${length(l.spread)} rgba(${rgbChannels(ink)}, ${alphaOf(l.alphaHex)})`)
|
|
31
|
+
.join(", ");
|
|
32
|
+
const elevationRamp = (mode) => {
|
|
33
|
+
const css = (role) => shadowCss(ELEVATION_LAYERS[mode][role], SHADOW_INK[mode]);
|
|
34
|
+
return {
|
|
35
|
+
sm: css("cardPress"),
|
|
36
|
+
base: css("card"),
|
|
37
|
+
md: css("float"),
|
|
38
|
+
lg: css("dialog"),
|
|
39
|
+
card: css("card"),
|
|
40
|
+
float: css("float"),
|
|
41
|
+
dialog: css("dialog"),
|
|
42
|
+
sheet: css("sheet"),
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const lightElevation = elevationRamp("light");
|
|
1
46
|
/** Light-mode ramp. A theme should carry `shadowsFor(mode)`, never this one in dark. */
|
|
2
47
|
const shadows = {
|
|
3
48
|
xs: "0 0 0 1px rgba(0, 0, 0, 0.05)",
|
|
4
|
-
sm:
|
|
5
|
-
base:
|
|
6
|
-
md:
|
|
7
|
-
lg:
|
|
49
|
+
sm: lightElevation.sm,
|
|
50
|
+
base: lightElevation.base,
|
|
51
|
+
md: lightElevation.md,
|
|
52
|
+
lg: lightElevation.lg,
|
|
8
53
|
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
|
|
9
54
|
"2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
10
55
|
outline: "0 0 0 3px rgba(66, 153, 225, 0.6)",
|
|
11
56
|
inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)",
|
|
12
57
|
none: "none",
|
|
13
58
|
darkLg: "0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.5)",
|
|
59
|
+
card: lightElevation.card,
|
|
60
|
+
float: lightElevation.float,
|
|
61
|
+
dialog: lightElevation.dialog,
|
|
62
|
+
sheet: lightElevation.sheet,
|
|
14
63
|
};
|
|
15
|
-
export const shadowsDark = { ...shadows };
|
|
64
|
+
export const shadowsDark = { ...shadows, ...elevationRamp("dark") };
|
|
16
65
|
export const shadowsFor = (mode) => mode === "dark" ? shadowsDark : shadows;
|
|
17
66
|
export default shadows;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export const fonts = {
|
|
3
3
|
body: "Inter Variable, sans-serif",
|
|
4
4
|
heading: "Inter Variable, sans-serif",
|
|
5
|
-
mono: "
|
|
5
|
+
mono: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
|
|
6
6
|
};
|
|
7
7
|
export const fontSizes = {
|
|
8
8
|
"xs-minus": "0.6875rem",
|
package/dist/esm/Utils/table.js
CHANGED
|
@@ -66,7 +66,7 @@ export function buildSemanticStatusPalette(toneByValue, theme) {
|
|
|
66
66
|
return Object.fromEntries(Object.entries(toneByValue).map(([value, key]) => {
|
|
67
67
|
const scale = scales[key];
|
|
68
68
|
const tone = resolveSoftTone(c, scale);
|
|
69
|
-
const solidRung = solidFillRung(scale, c.white);
|
|
69
|
+
const solidRung = solidFillRung(scale, c.white, c.backgroundColor.main);
|
|
70
70
|
const solid = scale[solidRung];
|
|
71
71
|
return [
|
|
72
72
|
value,
|
|
@@ -108,7 +108,7 @@ export function buildTablePalette(theme) {
|
|
|
108
108
|
];
|
|
109
109
|
return scales.map((scale) => {
|
|
110
110
|
const tone = resolveSoftTone(c, scale);
|
|
111
|
-
const solidRung = solidFillRung(scale, c.white);
|
|
111
|
+
const solidRung = solidFillRung(scale, c.white, c.backgroundColor.main);
|
|
112
112
|
const solid = scale[solidRung];
|
|
113
113
|
return {
|
|
114
114
|
solid,
|
package/dist/esm/index.js
CHANGED
|
@@ -149,12 +149,12 @@ export { useChartTheme } from "./Theme/useChartTheme.js";
|
|
|
149
149
|
// custom components against `ColorScale`/`PaletteProps` tokens can reuse the same logic instead
|
|
150
150
|
// of re-deriving contrast math themselves.
|
|
151
151
|
export { statusGradient, inkSafeGradient, chipFill, chipBorder, ACCENT_GRADIENT, STATUS_INK, } from "./Components/PlanPill/planPillGradient.js";
|
|
152
|
-
export { isDarkCanvas, onFilled, onGradient, accentTextOnCanvas, pickAccentText, AA_NORMAL_TEXT, DARK_CANVAS_LUMINANCE, } from "./Theme/tokens/builders/accentText.js";
|
|
152
|
+
export { isDarkCanvas, onFilled, onGradient, accentTextOnCanvas, accentTextOnPlanes, pickAccentText, AA_NORMAL_TEXT, DARK_CANVAS_LUMINANCE, } from "./Theme/tokens/builders/accentText.js";
|
|
153
153
|
// Filled-surface helpers — use whenever you paint a `bg` from a ColorScale (buttons, badges,
|
|
154
154
|
// chips, alerts). Never pair `scale[500]` with `onFilled` or `colors.white` by hand.
|
|
155
155
|
export { solidFillRung, darkerFillRung, labelOnFill, resolveFilledSurface, } from "./Theme/tokens/builders/filledSurface.js";
|
|
156
156
|
// Ink for a custom option row (a `SearchSelect` `option.view` or `Select` `renderOption` node).
|
|
157
|
-
export { optionRowInk, optionRowWeight, optionRowDescriptionInk, } from "./Components/Select/optionRowInk.js";
|
|
157
|
+
export { optionRowInk, optionRowWeight, optionRowDescriptionInk, optionRowFill, optionRowCursorSx, } from "./Components/Select/optionRowInk.js";
|
|
158
158
|
// Pure color math backing the helpers above (and `buildDarkPalette`) — no Chakra/React/DOM
|
|
159
159
|
// dependency, safe for the mobile port. `relativeLuminance`/`contrastRatio` are the WCAG 2.1
|
|
160
160
|
// primitives; `compositeOver` flattens a translucent color onto a backdrop first (an alpha
|
|
@@ -170,7 +170,7 @@ export { scrollbarStyles, globalScrollbarStyles, SCROLLBAR_WIDTH, } from "./Them
|
|
|
170
170
|
export { placeholderInk, placeholderInkOn, fieldSurfaces } from "./Theme/tokens/builders/placeholderInk.js";
|
|
171
171
|
export { resolveGradient, gradientCss, inkSafeGradient as inkSafeGradientToken, } from "./Theme/tokens/builders/gradientInk.js";
|
|
172
172
|
export { CONTROL_SIZES, CONTROL_SIZE_NAMES, DEFAULT_CONTROL_SIZE, isControlSize, } from "./Theme/tokens/primitives/controlSizes.js";
|
|
173
|
-
export { MOTION_MS, MOTION_EASE, MOTION_EASE_OUT, MOTION_EASE_IN, MOTION_BEZIER, MOTION_LOOP_MS, transitionFor, motionTransition, } from "./Theme/tokens/primitives/motion.js";
|
|
173
|
+
export { MOTION_MS, MOTION_EASE, MOTION_EASE_OUT, MOTION_EASE_IN, MOTION_BEZIER, MOTION_LOOP_MS, MOTION_PRESS_SCALE, transitionFor, motionTransition, } from "./Theme/tokens/primitives/motion.js";
|
|
174
174
|
export { RADIUS_ROLE } from "./Theme/tokens/primitives/radii.js";
|
|
175
175
|
export { BORDER_WIDTHS } from "./Theme/tokens/primitives/borderWidths.js";
|
|
176
176
|
export { DISABLED_OPACITY } from "./Theme/tokens/primitives/states.js";
|
|
@@ -180,6 +180,7 @@ export { TONES, isTone, toneToColorScheme, toneToSemantic, toneScale, toneInk, r
|
|
|
180
180
|
export { overlayScrim, SCRIM_OPACITY } from "./Theme/tokens/builders/scrim.js";
|
|
181
181
|
export { tooltipSurface } from "./Theme/tokens/builders/tooltipSurface.js";
|
|
182
182
|
export { buildSurfaceRaised, raisedRule, RAISED_OVERLAY } from "./Theme/tokens/builders/surfaceRaised.js";
|
|
183
|
+
export { bandOn, recessOn, cardRule, ruleOn } from "./Theme/tokens/builders/planeStep.js";
|
|
183
184
|
export { overlayScrimStyles, OVERLAY_BLUR } from "./Theme/chakra/overlay.styles.js";
|
|
184
185
|
export { usePrefersReducedMotion, reducedMotionSx, REDUCED_MOTION_QUERY, MOTION_KEEP_CLASS, } from "./Theme/chakra/motion.js";
|
|
185
186
|
export { useFieldIds } from "./Components/Common/useFieldIds.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ import OrganizationDetails from "./Components/OrganizationDetails/OrganizationDe
|
|
|
99
99
|
export { Accordion, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, ApexAreaChart, ApexRadialChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, WorkspaceWindow, WorkspaceTray, WorkspaceTrayPreview, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, AppSwitcher, LimitReachedModal, UpgradeButton, PlanPill, PlanBadge, formatPlanElapsed, formatPlanExpiry, formatPlanRemaining, resolvePlanBadge, splitMonthsAndDays, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, KanbanActions, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SelectV2, SearchSelect, SelectSearch, SideBar, Slider, ScrollbarBox, Skeletons, Switch, ToggleSwitch, SegmentedControl, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp, useSidebarPrefs, useIsTruncated, useCustomTheme, ThemesList, debounce, isAllowedReturnUrl, resolveReturnUrl, createAccountHandoff, };
|
|
100
100
|
export default withTheme;
|
|
101
101
|
export type { UserDetailsProps, UserDetailsLabels, UserListItem, SelectedUserDetail, UserDetailRow, RoleOption, AddUserFormValues, ChangeRoleSubmitPayload, } from "./Components/UserDetails/UserDetailsProps";
|
|
102
|
-
export type { WorkspaceWindowProps, WorkspaceWindowState, WorkspaceTrayProps, WorkspaceTrayItem, WorkspaceTrayPreviewProps, } from "./Components/WorkspaceWindow/WorkspaceWindowProps";
|
|
102
|
+
export type { WorkspaceWindowProps, WorkspaceWindowLabels, WorkspaceWindowState, WorkspaceTrayProps, WorkspaceTrayItem, WorkspaceTrayPreviewProps, } from "./Components/WorkspaceWindow/WorkspaceWindowProps";
|
|
103
103
|
export type { RolesPermissionProps, RolesPermissionLabels, RolesPermissionView, RolesPermissionMode, Permission, PermissionKey, RoleData, } from "./Components/RolesPermission/RolesPermissionProps";
|
|
104
104
|
export type { CustomModulesTableProps, CustomModulesTableLabels, ModuleItem, UpdateModulePayload, } from "./Components/CustomModulesTable/CustomModulesTableProps";
|
|
105
105
|
export type { SignInActivityTableProps, SignInActivityLabels, SignInDevice, } from "./Components/SignInActivityTable/SignInActivityTableProps";
|
|
@@ -131,10 +131,10 @@ export { useChartTheme } from "./Theme/useChartTheme";
|
|
|
131
131
|
export type { RechartsAxisTheme, RechartsChartTheme, RechartsGridTheme, RechartsLegendTheme, RechartsTooltipTheme, } from "./Theme/useChartTheme";
|
|
132
132
|
export type { ColorMode, ResolvedColorMode, ThemeName, PaletteProps, ColorScale, BrandScale, SemanticColors, NamedSurfaces, FocusRingTokens, } from "./Theme/tokens/types";
|
|
133
133
|
export { statusGradient, inkSafeGradient, chipFill, chipBorder, ACCENT_GRADIENT, STATUS_INK, } from "./Components/PlanPill/planPillGradient";
|
|
134
|
-
export { isDarkCanvas, onFilled, onGradient, accentTextOnCanvas, pickAccentText, AA_NORMAL_TEXT, DARK_CANVAS_LUMINANCE, } from "./Theme/tokens/builders/accentText";
|
|
134
|
+
export { isDarkCanvas, onFilled, onGradient, accentTextOnCanvas, accentTextOnPlanes, pickAccentText, AA_NORMAL_TEXT, DARK_CANVAS_LUMINANCE, } from "./Theme/tokens/builders/accentText";
|
|
135
135
|
export { solidFillRung, darkerFillRung, labelOnFill, resolveFilledSurface, } from "./Theme/tokens/builders/filledSurface";
|
|
136
136
|
export type { FilledSurface } from "./Theme/tokens/builders/filledSurface";
|
|
137
|
-
export { optionRowInk, optionRowWeight, optionRowDescriptionInk, } from "./Components/Select/optionRowInk";
|
|
137
|
+
export { optionRowInk, optionRowWeight, optionRowDescriptionInk, optionRowFill, optionRowCursorSx, } from "./Components/Select/optionRowInk";
|
|
138
138
|
export { hexToRgb, hexToRgba, compositeOver, rgbToHex, rgbToHsl, hslToRgb, hexToHsl, hslToHex, withLightness, mix, relativeLuminance, contrastRatio, } from "./Theme/tokens/builders/color";
|
|
139
139
|
export type { Rgb, Hsl } from "./Theme/tokens/builders/color";
|
|
140
140
|
export type { SelectV2Props, SelectV2Size, OptionProp as SelectV2Option } from "./Components/SelectV2/SelectV2Props";
|
|
@@ -194,7 +194,7 @@ export { resolveGradient, gradientCss, inkSafeGradient as inkSafeGradientToken,
|
|
|
194
194
|
export type { Gradient, ResolvedGradient, } from "./Theme/tokens/builders/gradientInk";
|
|
195
195
|
export { CONTROL_SIZES, CONTROL_SIZE_NAMES, DEFAULT_CONTROL_SIZE, isControlSize, } from "./Theme/tokens/primitives/controlSizes";
|
|
196
196
|
export type { ControlSize, ControlSizeSpec } from "./Theme/tokens/primitives/controlSizes";
|
|
197
|
-
export { MOTION_MS, MOTION_EASE, MOTION_EASE_OUT, MOTION_EASE_IN, MOTION_BEZIER, MOTION_LOOP_MS, transitionFor, motionTransition, } from "./Theme/tokens/primitives/motion";
|
|
197
|
+
export { MOTION_MS, MOTION_EASE, MOTION_EASE_OUT, MOTION_EASE_IN, MOTION_BEZIER, MOTION_LOOP_MS, MOTION_PRESS_SCALE, transitionFor, motionTransition, } from "./Theme/tokens/primitives/motion";
|
|
198
198
|
export type { MotionSpeed, MotionCurve } from "./Theme/tokens/primitives/motion";
|
|
199
199
|
export { RADIUS_ROLE } from "./Theme/tokens/primitives/radii";
|
|
200
200
|
export type { RadiusRole } from "./Theme/tokens/primitives/radii";
|
|
@@ -208,6 +208,7 @@ export type { Tone, ToneColorScheme } from "./Theme/tokens/builders/tone";
|
|
|
208
208
|
export { overlayScrim, SCRIM_OPACITY } from "./Theme/tokens/builders/scrim";
|
|
209
209
|
export { tooltipSurface } from "./Theme/tokens/builders/tooltipSurface";
|
|
210
210
|
export { buildSurfaceRaised, raisedRule, RAISED_OVERLAY } from "./Theme/tokens/builders/surfaceRaised";
|
|
211
|
+
export { bandOn, recessOn, cardRule, ruleOn } from "./Theme/tokens/builders/planeStep";
|
|
211
212
|
export { overlayScrimStyles, OVERLAY_BLUR } from "./Theme/chakra/overlay.styles";
|
|
212
213
|
export { usePrefersReducedMotion, reducedMotionSx, REDUCED_MOTION_QUERY, MOTION_KEEP_CLASS, } from "./Theme/chakra/motion";
|
|
213
214
|
export type { ReducedMotionScope } from "./Theme/chakra/motion";
|