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
|
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const neutrals_1 = require("../neutrals");
|
|
4
4
|
const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
|
|
5
5
|
const brandInk_1 = require("../../builders/brandInk");
|
|
6
|
-
const PRIMARY_500 = "#
|
|
6
|
+
const PRIMARY_500 = "#cb6b94";
|
|
7
7
|
const primary = {
|
|
8
|
-
50: "#
|
|
9
|
-
100: "#
|
|
10
|
-
200: "#
|
|
11
|
-
300: "#
|
|
12
|
-
400: "#
|
|
8
|
+
50: "#fcf2f7",
|
|
9
|
+
100: "#f6d6e5",
|
|
10
|
+
200: "#edabc9",
|
|
11
|
+
300: "#e480ad",
|
|
12
|
+
400: "#d76398",
|
|
13
13
|
500: PRIMARY_500,
|
|
14
|
-
600: "#
|
|
15
|
-
700: "#
|
|
16
|
-
800: "#
|
|
17
|
-
900: "#
|
|
14
|
+
600: "#b35681",
|
|
15
|
+
700: "#93466a",
|
|
16
|
+
800: "#723754",
|
|
17
|
+
900: "#52273e",
|
|
18
18
|
opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
|
|
19
19
|
};
|
|
20
20
|
const palette = {
|
|
@@ -66,18 +66,6 @@ declare const palette: {
|
|
|
66
66
|
800: string;
|
|
67
67
|
900: string;
|
|
68
68
|
};
|
|
69
|
-
background: {
|
|
70
|
-
50: string;
|
|
71
|
-
100: string;
|
|
72
|
-
200: string;
|
|
73
|
-
300: string;
|
|
74
|
-
400: string;
|
|
75
|
-
500: string;
|
|
76
|
-
600: string;
|
|
77
|
-
700: string;
|
|
78
|
-
800: string;
|
|
79
|
-
900: string;
|
|
80
|
-
};
|
|
81
69
|
text: {
|
|
82
70
|
50: string;
|
|
83
71
|
100: string;
|
|
@@ -103,9 +91,6 @@ declare const palette: {
|
|
|
103
91
|
900: string;
|
|
104
92
|
};
|
|
105
93
|
gray: {
|
|
106
|
-
50: string;
|
|
107
|
-
100: string;
|
|
108
|
-
200: string;
|
|
109
94
|
300: string;
|
|
110
95
|
400: string;
|
|
111
96
|
500: string;
|
|
@@ -113,6 +98,9 @@ declare const palette: {
|
|
|
113
98
|
700: string;
|
|
114
99
|
800: string;
|
|
115
100
|
900: string;
|
|
101
|
+
50: string;
|
|
102
|
+
100: string;
|
|
103
|
+
200: string;
|
|
116
104
|
};
|
|
117
105
|
border: {
|
|
118
106
|
50: string;
|
|
@@ -162,20 +150,6 @@ declare const palette: {
|
|
|
162
150
|
800: string;
|
|
163
151
|
900: string;
|
|
164
152
|
};
|
|
165
|
-
table: {
|
|
166
|
-
hover: {
|
|
167
|
-
50: string;
|
|
168
|
-
100: string;
|
|
169
|
-
200: string;
|
|
170
|
-
300: string;
|
|
171
|
-
400: string;
|
|
172
|
-
500: string;
|
|
173
|
-
600: string;
|
|
174
|
-
700: string;
|
|
175
|
-
800: string;
|
|
176
|
-
900: string;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
153
|
accentText: string;
|
|
180
154
|
onPrimary: string;
|
|
181
155
|
boxShadow: {
|
|
@@ -197,8 +171,12 @@ declare const palette: {
|
|
|
197
171
|
purple: import("../..").ColorScale;
|
|
198
172
|
pink: import("../..").ColorScale;
|
|
199
173
|
backgroundColor: import("../..").NamedSurfaces;
|
|
174
|
+
background: import("../..").ColorScale;
|
|
200
175
|
focusRing: import("../..").FocusRingTokens;
|
|
201
176
|
sidebar: import("../..").SidebarTokens;
|
|
177
|
+
table: {
|
|
178
|
+
hover: import("../..").ColorScale;
|
|
179
|
+
};
|
|
202
180
|
semanticText: import("../..").SemanticTextTokens;
|
|
203
181
|
textMuted: string;
|
|
204
182
|
onSemantic: import("../..").SemanticTextTokens;
|
|
@@ -38,19 +38,6 @@ const secondary = {
|
|
|
38
38
|
900: "#fafafa",
|
|
39
39
|
opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(SECONDARY_500),
|
|
40
40
|
};
|
|
41
|
-
// background[50] = the elevated surface (#0e0e11), resolved through a token, not a literal.
|
|
42
|
-
const background = {
|
|
43
|
-
50: "#0e0e11",
|
|
44
|
-
100: "#131316",
|
|
45
|
-
200: "#18181b",
|
|
46
|
-
300: "#212124",
|
|
47
|
-
400: "#27272a",
|
|
48
|
-
500: "#3f3f46",
|
|
49
|
-
600: "#52525b",
|
|
50
|
-
700: "#71717a",
|
|
51
|
-
800: "#a1a1aa",
|
|
52
|
-
900: "#d4d4d8",
|
|
53
|
-
};
|
|
54
41
|
const text = {
|
|
55
42
|
50: "#71717a",
|
|
56
43
|
100: "#8a8a93",
|
|
@@ -76,10 +63,7 @@ const header = {
|
|
|
76
63
|
900: "#ffffff",
|
|
77
64
|
};
|
|
78
65
|
// 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).
|
|
79
|
-
const
|
|
80
|
-
50: "#18181b",
|
|
81
|
-
100: "#27272a",
|
|
82
|
-
200: "#3f3f46",
|
|
66
|
+
const grayInk = {
|
|
83
67
|
300: "#52525b",
|
|
84
68
|
400: "#7a7a83",
|
|
85
69
|
500: "#a1a1aa",
|
|
@@ -137,20 +121,6 @@ const disabled = {
|
|
|
137
121
|
800: "#a1a1aa",
|
|
138
122
|
900: "#d4d4d8",
|
|
139
123
|
};
|
|
140
|
-
const table = {
|
|
141
|
-
hover: {
|
|
142
|
-
50: "#0e0e11",
|
|
143
|
-
100: "#131316",
|
|
144
|
-
200: "#18181b",
|
|
145
|
-
300: "#1f1f22",
|
|
146
|
-
400: "#27272a",
|
|
147
|
-
500: "#2f2f33",
|
|
148
|
-
600: "#3f3f46",
|
|
149
|
-
700: "#52525b",
|
|
150
|
-
800: "#71717a",
|
|
151
|
-
900: "#a1a1aa",
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
124
|
const buildPalette = () => {
|
|
155
125
|
const derived = (0, buildDarkPalette_1.buildDarkPalette)(palette_light_1.default);
|
|
156
126
|
return {
|
|
@@ -159,16 +129,14 @@ const buildPalette = () => {
|
|
|
159
129
|
primary,
|
|
160
130
|
secondary,
|
|
161
131
|
tertiary: { ...(0, brandInk_1.rotateScaleHue)(secondary), opacity: secondary.opacity },
|
|
162
|
-
// NOTE: backgroundColor
|
|
163
|
-
background,
|
|
132
|
+
// NOTE: the planes (backgroundColor, background, table, gray fills) stay derived — they rise with the card.
|
|
164
133
|
text,
|
|
165
134
|
header,
|
|
166
|
-
gray,
|
|
135
|
+
gray: { ...derived.gray, ...grayInk },
|
|
167
136
|
border,
|
|
168
137
|
boxborder,
|
|
169
138
|
placeholder,
|
|
170
139
|
disabled,
|
|
171
|
-
table,
|
|
172
140
|
accentText: (0, accentText_1.pickAccentText)(primary, derived.backgroundColor.main),
|
|
173
141
|
onPrimary: (0, accentText_1.onFilled)(PRIMARY_500, derived.white, derived.black),
|
|
174
142
|
boxShadow: {
|
|
@@ -12,6 +12,8 @@ declare const DARK_CANVAS_LUMINANCE = 0.2;
|
|
|
12
12
|
/** True when `canvas` is a dark surface. Lets style configs branch without threading color mode. */
|
|
13
13
|
export declare const isDarkCanvas: (canvas: string) => boolean;
|
|
14
14
|
export declare const accentTextOnCanvas: (scale: ColorScale, canvas: string) => string;
|
|
15
|
+
/** Accent ink for chrome that can land on any plane (canvas, card, overlay): the first rung clearing AA on all. */
|
|
16
|
+
export declare const accentTextOnPlanes: (scale: ColorScale, planes: readonly string[]) => string;
|
|
15
17
|
export declare const onFilled: (fill: string, white: string, black: string) => string;
|
|
16
18
|
export declare const onGradient: (from: string, to: string, white: string, black: string) => string;
|
|
17
19
|
export { AA_NORMAL_TEXT, DARK_CANVAS_LUMINANCE };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DARK_CANVAS_LUMINANCE = exports.AA_NORMAL_TEXT = exports.onGradient = exports.onFilled = exports.accentTextOnCanvas = exports.isDarkCanvas = exports.DEFAULT_BLACK = exports.DEFAULT_WHITE = exports.DEFAULT_CANVAS = exports.pickAccentText = void 0;
|
|
3
|
+
exports.DARK_CANVAS_LUMINANCE = exports.AA_NORMAL_TEXT = exports.onGradient = exports.onFilled = exports.accentTextOnPlanes = exports.accentTextOnCanvas = exports.isDarkCanvas = exports.DEFAULT_BLACK = exports.DEFAULT_WHITE = exports.DEFAULT_CANVAS = exports.pickAccentText = void 0;
|
|
4
4
|
const color_1 = require("./color");
|
|
5
5
|
/** WCAG AA for normal-size text. Accent-as-text must clear this against the canvas. */
|
|
6
6
|
const AA_NORMAL_TEXT = 4.5;
|
|
@@ -27,6 +27,12 @@ exports.isDarkCanvas = isDarkCanvas;
|
|
|
27
27
|
// NOTE: held to AA in both modes now — some brands' light [500] no longer passes through untouched.
|
|
28
28
|
const accentTextOnCanvas = (scale, canvas) => (0, exports.pickAccentText)(scale, canvas);
|
|
29
29
|
exports.accentTextOnCanvas = accentTextOnCanvas;
|
|
30
|
+
/** Accent ink for chrome that can land on any plane (canvas, card, overlay): the first rung clearing AA on all. */
|
|
31
|
+
const accentTextOnPlanes = (scale, planes) => {
|
|
32
|
+
const found = SEARCH_ORDER.find((rung) => planes.every((plane) => (0, color_1.contrastRatio)(scale[rung], plane) >= AA_NORMAL_TEXT));
|
|
33
|
+
return scale[found !== null && found !== void 0 ? found : SEARCH_ORDER[SEARCH_ORDER.length - 1]];
|
|
34
|
+
};
|
|
35
|
+
exports.accentTextOnPlanes = accentTextOnPlanes;
|
|
30
36
|
// NOTE: white/black must be the mode-stable absolutes, not an adaptive token — always clears AA.
|
|
31
37
|
const onFilled = (fill, white, black) => (0, color_1.contrastRatio)(white, fill) >= AA_NORMAL_TEXT ? white : black;
|
|
32
38
|
exports.onFilled = onFilled;
|
|
@@ -6,5 +6,10 @@ export declare const shiftLighter: (scale: ColorScale) => ColorScale;
|
|
|
6
6
|
export declare const accentLightnessDelta: (accent500: string, white: string) => number;
|
|
7
7
|
/** Raises every rung by the same lightness delta, preserving the ramp's shape and hue. */
|
|
8
8
|
export declare const liftScale: (scale: ColorScale, delta: number) => ColorScale;
|
|
9
|
-
|
|
9
|
+
/** `lifted`: brand-tinted canvas, card a CARD_LIFT step above it. `flat`: the hue-neutral canvas the card shares. */
|
|
10
|
+
export type DarkPlanes = "lifted" | "flat";
|
|
11
|
+
export interface DarkPaletteOptions {
|
|
12
|
+
planes?: DarkPlanes;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildDarkPalette(light: BrandPaletteSource, { planes }?: DarkPaletteOptions): PaletteProps;
|
|
10
15
|
export default buildDarkPalette;
|
|
@@ -11,6 +11,7 @@ const semanticText_1 = require("./semanticText");
|
|
|
11
11
|
const focusRing_1 = require("./focusRing");
|
|
12
12
|
const surfaceRaised_1 = require("./surfaceRaised");
|
|
13
13
|
const star_1 = require("./star");
|
|
14
|
+
const planes_1 = require("./planes");
|
|
14
15
|
// Structural ramps are rebuilt at explicit targets (not reversed — light ramps bottom near 35%);
|
|
15
16
|
// utility hues are reversed so index roles survive; brand/semantic ramps shift one step lighter.
|
|
16
17
|
const SCALE_KEYS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
@@ -150,23 +151,49 @@ const NAMED_SURFACE_L = {
|
|
|
150
151
|
accent: 17,
|
|
151
152
|
muted: 18,
|
|
152
153
|
};
|
|
153
|
-
|
|
154
|
-
const SURFACE_SAT = 0;
|
|
154
|
+
const SURFACE_SAT = { lifted: 14, flat: 0 };
|
|
155
155
|
const TEXT_SAT = 12;
|
|
156
156
|
const PLACEHOLDER_SAT = 10;
|
|
157
157
|
const BORDER_SAT = 12;
|
|
158
158
|
const DISABLED_SAT = 8;
|
|
159
159
|
const GRAY_SAT = 0;
|
|
160
|
-
|
|
160
|
+
// Fill rungs drawn ON a card keep their step above it, so they rise with the card; ink and chrome rungs stay.
|
|
161
|
+
const BACKGROUND_FILLS = [100, 200, 300, 400, 500];
|
|
162
|
+
// 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.
|
|
163
|
+
const TABLE_HOVER_ABOVE_CARD = {
|
|
164
|
+
50: 1, 100: 3, 200: 5, 300: 6, 400: 6.5, 500: 7,
|
|
165
|
+
};
|
|
166
|
+
const GRAY_FILLS = [50, 100, 200];
|
|
167
|
+
const raise = (targets, rungs, by) => ({
|
|
168
|
+
...targets,
|
|
169
|
+
...Object.fromEntries(rungs.map((k) => [k, targets[k] + by])),
|
|
170
|
+
});
|
|
171
|
+
const cardPlane = (canvas, white, planes) => {
|
|
172
|
+
if (planes === "flat")
|
|
173
|
+
return { card: canvas, rise: 0, tableHover: TABLE_HOVER_TARGETS };
|
|
174
|
+
const card = (0, planes_1.lift)(white, canvas, planes_1.CARD_LIFT);
|
|
175
|
+
const cardL = (0, color_1.hexToHsl)(card).l;
|
|
176
|
+
const tableHover = {
|
|
177
|
+
...TABLE_HOVER_TARGETS,
|
|
178
|
+
...Object.fromEntries(Object.entries(TABLE_HOVER_ABOVE_CARD).map(([k, step]) => [k, cardL + step])),
|
|
179
|
+
};
|
|
180
|
+
return { card, rise: cardL - (0, color_1.hexToHsl)(canvas).l, tableHover };
|
|
181
|
+
};
|
|
182
|
+
function buildDarkPalette(light, { planes = "lifted" } = {}) {
|
|
161
183
|
const hueSource = light.primary[500];
|
|
162
184
|
const { h } = (0, color_1.hexToHsl)(hueSource);
|
|
185
|
+
const surfaceSat = SURFACE_SAT[planes];
|
|
163
186
|
const namedSurfaces = Object.fromEntries(Object.entries(NAMED_SURFACE_L).map(([key, l]) => [
|
|
164
187
|
key,
|
|
165
|
-
(0, color_1.hslToHex)({ h, s:
|
|
188
|
+
(0, color_1.hslToHex)({ h, s: surfaceSat, l }),
|
|
166
189
|
]));
|
|
167
190
|
const white = light.white;
|
|
191
|
+
const { card, rise, tableHover } = cardPlane(namedSurfaces.main, white, planes);
|
|
168
192
|
const primary = liftBrand(light.primary, white);
|
|
169
|
-
const background =
|
|
193
|
+
const background = {
|
|
194
|
+
...fromTargets(hueSource, raise(SURFACE_TARGETS, BACKGROUND_FILLS, rise), surfaceSat),
|
|
195
|
+
50: card,
|
|
196
|
+
};
|
|
170
197
|
const semantic = {
|
|
171
198
|
success: liftAccent(light.semantic.success, white),
|
|
172
199
|
error: liftAccent(light.semantic.error, white),
|
|
@@ -186,7 +213,7 @@ function buildDarkPalette(light) {
|
|
|
186
213
|
transparent: light.transparent,
|
|
187
214
|
black: light.black,
|
|
188
215
|
white: light.white,
|
|
189
|
-
gray: fromTargets(hueSource, GRAY_TARGETS, GRAY_SAT),
|
|
216
|
+
gray: fromTargets(hueSource, raise(GRAY_TARGETS, GRAY_FILLS, rise), GRAY_SAT),
|
|
190
217
|
red: (0, exports.reverseScale)(light.red),
|
|
191
218
|
orange: (0, exports.reverseScale)(light.orange),
|
|
192
219
|
yellow: (0, exports.reverseScale)(light.yellow),
|
|
@@ -203,7 +230,9 @@ function buildDarkPalette(light) {
|
|
|
203
230
|
placeholder: fromTargets(hueSource, PLACEHOLDER_TARGETS, PLACEHOLDER_SAT),
|
|
204
231
|
border: dividerRamp,
|
|
205
232
|
boxborder: dividerRamp,
|
|
206
|
-
table: {
|
|
233
|
+
table: {
|
|
234
|
+
hover: fromTargets(hueSource, tableHover, surfaceSat),
|
|
235
|
+
},
|
|
207
236
|
disabled: fromTargets(hueSource, DISABLED_TARGETS, DISABLED_SAT),
|
|
208
237
|
accentText: (0, accentText_1.pickAccentText)(primary, namedSurfaces.main),
|
|
209
238
|
textMuted: (0, mutedText_1.buildMutedText)(fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT), namedSurfaces.main),
|
|
@@ -211,7 +240,7 @@ function buildDarkPalette(light) {
|
|
|
211
240
|
onPrimary: (0, accentText_1.onFilled)(primary[500], light.white, light.black),
|
|
212
241
|
onSemantic: (0, semanticText_1.buildOnSemantic)(semantic, light.white, light.black),
|
|
213
242
|
focusRing: (0, focusRing_1.buildFocusRing)({ primary, background, backgroundColor: namedSurfaces }),
|
|
214
|
-
surfaceRaised: (0, surfaceRaised_1.buildSurfaceRaised)({ backgroundColor: namedSurfaces, background, white }),
|
|
243
|
+
surfaceRaised: (0, surfaceRaised_1.buildSurfaceRaised)({ backgroundColor: namedSurfaces, background, white }, (0, surfaceRaised_1.filledMarks)({ primary, semantic })),
|
|
215
244
|
star: (0, star_1.buildStar)(namedSurfaces.main),
|
|
216
245
|
sidebar: (0, sidebarAccent_1.withSidebarTokens)(light),
|
|
217
246
|
boxShadow: {
|
|
@@ -12,7 +12,11 @@ export type FilledSurface = {
|
|
|
12
12
|
activeColor: string;
|
|
13
13
|
};
|
|
14
14
|
export declare const solidFillRung: (scale: ColorScale, white: string, canvas?: string) => keyof ColorScale;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Hover (step 0) or active (step 1) fill rung, one step darker than `solidFillRung`. A step may not
|
|
17
|
+
* flip the label's side of AA (zinc dark: near-white fill, black ink) or fall below `CHROME_BORDER`
|
|
18
|
+
* against the canvas (a pressed warning solid used to reach 1.00:1 on the card).
|
|
19
|
+
*/
|
|
16
20
|
export declare const darkerFillRung: (scale: ColorScale, canvas: string, white: string, step: 0 | 1) => keyof ColorScale;
|
|
17
21
|
/** Label ink for a specific fill swatch — always `onFilled`, exported for style configs. */
|
|
18
22
|
export declare const labelOnFill: (fill: string, white: string, black: string) => string;
|
|
@@ -44,15 +44,28 @@ const steppedRung = (base, canvas, step) => {
|
|
|
44
44
|
const dir = (0, accentText_1.isDarkCanvas)(canvas) ? -100 : 100;
|
|
45
45
|
return Math.min(900, Math.max(50, base + dir * step));
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
const steppedTowardBase = (from, base) => RUNGS[RUNGS.indexOf(from) + (from > base ? -1 : 1)];
|
|
48
|
+
/**
|
|
49
|
+
* Hover (step 0) or active (step 1) fill rung, one step darker than `solidFillRung`. A step may not
|
|
50
|
+
* flip the label's side of AA (zinc dark: near-white fill, black ink) or fall below `CHROME_BORDER`
|
|
51
|
+
* against the canvas (a pressed warning solid used to reach 1.00:1 on the card).
|
|
52
|
+
*/
|
|
48
53
|
const darkerFillRung = (scale, canvas, white, step) => {
|
|
49
54
|
const base = (0, exports.solidFillRung)(scale, white, canvas);
|
|
55
|
+
const wantsWhite = (0, color_1.contrastRatio)(white, scale[base]) >= accentText_1.AA_NORMAL_TEXT;
|
|
56
|
+
const holds = (rung) => (0, color_1.contrastRatio)(scale[rung], canvas) >= outlineRung_1.CHROME_BORDER &&
|
|
57
|
+
((0, color_1.contrastRatio)(white, scale[rung]) >= accentText_1.AA_NORMAL_TEXT) === wantsWhite;
|
|
58
|
+
let rung;
|
|
50
59
|
if (base === 500) {
|
|
51
60
|
const mode = (0, accentText_1.isDarkCanvas)(canvas) ? "dark" : "light";
|
|
52
|
-
|
|
61
|
+
rung = FILL_STEP_RUNGS[mode][step];
|
|
53
62
|
}
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
else {
|
|
64
|
+
rung = steppedRung(base, canvas, step === 0 ? 1 : 2);
|
|
65
|
+
}
|
|
66
|
+
while (rung !== base && !holds(rung))
|
|
67
|
+
rung = steppedTowardBase(rung, base);
|
|
68
|
+
return rung;
|
|
56
69
|
};
|
|
57
70
|
exports.darkerFillRung = darkerFillRung;
|
|
58
71
|
/** Label ink for a specific fill swatch — always `onFilled`, exported for style configs. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColorScale } from "../types";
|
|
2
2
|
/** WCAG 1.4.3 — muted is still body text. */
|
|
3
3
|
export declare const AA_NORMAL_TEXT = 4.5;
|
|
4
|
-
|
|
4
|
+
export declare const MUTED_TEXT_CEILING = 8;
|
|
5
5
|
export declare const buildMutedText: (text: ColorScale, canvas: string) => string;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildMutedText = exports.AA_NORMAL_TEXT = void 0;
|
|
3
|
+
exports.buildMutedText = exports.MUTED_TEXT_CEILING = exports.AA_NORMAL_TEXT = void 0;
|
|
4
|
+
const color_1 = require("./color");
|
|
4
5
|
const outlineRung_1 = require("./outlineRung");
|
|
5
6
|
/** WCAG 1.4.3 — muted is still body text. */
|
|
6
7
|
exports.AA_NORMAL_TEXT = 4.5;
|
|
7
|
-
|
|
8
|
-
const
|
|
8
|
+
exports.MUTED_TEXT_CEILING = 8;
|
|
9
|
+
const settleUnder = (hex, canvas, ceiling) => {
|
|
10
|
+
const { s, l } = (0, color_1.hexToHsl)(hex);
|
|
11
|
+
const toward = (0, color_1.relativeLuminance)(canvas) < 0.5 ? -1 : 1;
|
|
12
|
+
let settled = hex;
|
|
13
|
+
for (let next = l; (0, color_1.contrastRatio)(settled, canvas) > ceiling; next += toward) {
|
|
14
|
+
settled = (0, color_1.withLightness)(hex, next, s);
|
|
15
|
+
}
|
|
16
|
+
return settled;
|
|
17
|
+
};
|
|
18
|
+
const buildMutedText = (text, canvas) => (0, outlineRung_1.liftToContrast)(settleUnder(text[400], canvas, exports.MUTED_TEXT_CEILING), canvas, exports.AA_NORMAL_TEXT);
|
|
9
19
|
exports.buildMutedText = buildMutedText;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
export declare const bandOn: (fill: string, plane: string) => string;
|
|
3
|
+
export declare const recessOn: (fill: string, plane: string) => string;
|
|
4
|
+
export declare const ruleOn: (colors: Pick<PaletteProps, "boxborder">, plane: string) => string;
|
|
5
|
+
export declare const cardRule: (colors: Pick<PaletteProps, "boxborder" | "background">) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cardRule = exports.ruleOn = exports.recessOn = exports.bandOn = void 0;
|
|
4
|
+
const accentText_1 = require("./accentText");
|
|
5
|
+
const color_1 = require("./color");
|
|
6
|
+
const outlineRung_1 = require("./outlineRung");
|
|
7
|
+
const planes_1 = require("./planes");
|
|
8
|
+
const holds = (fill, plane, target) => !(0, accentText_1.isDarkCanvas)(plane) || (0, color_1.contrastRatio)(fill, plane) >= target;
|
|
9
|
+
const bandOn = (fill, plane) => holds(fill, plane, outlineRung_1.MIN_PERCEPTIBLE_STEP) ? fill : (0, outlineRung_1.tintStep)(fill, plane, outlineRung_1.MIN_PERCEPTIBLE_STEP);
|
|
10
|
+
exports.bandOn = bandOn;
|
|
11
|
+
const recessOn = (fill, plane) => holds(fill, plane, outlineRung_1.MIN_PERCEPTIBLE_STEP)
|
|
12
|
+
? fill
|
|
13
|
+
: (0, planes_1.lift)(accentText_1.DEFAULT_BLACK, plane, outlineRung_1.MIN_PERCEPTIBLE_STEP);
|
|
14
|
+
exports.recessOn = recessOn;
|
|
15
|
+
const ruleOn = (colors, plane) => {
|
|
16
|
+
const rule = colors.boxborder[200];
|
|
17
|
+
return holds(rule, plane, outlineRung_1.CHROME_RULE) ? rule : (0, outlineRung_1.liftToContrast)(rule, plane, outlineRung_1.CHROME_RULE);
|
|
18
|
+
};
|
|
19
|
+
exports.ruleOn = ruleOn;
|
|
20
|
+
const cardRule = (colors) => (0, exports.ruleOn)(colors, colors.background[50]);
|
|
21
|
+
exports.cardRule = cardRule;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const CARD_LIFT = 1.16;
|
|
2
|
+
export declare const RAISED_LIFT = 1.15;
|
|
3
|
+
export declare function lift(ink: string, base: string, target: number): string;
|
|
4
|
+
export declare function liftUnder(ink: string, base: string, target: number, marks: readonly string[]): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RAISED_LIFT = exports.CARD_LIFT = void 0;
|
|
4
|
+
exports.lift = lift;
|
|
5
|
+
exports.liftUnder = liftUnder;
|
|
6
|
+
const color_1 = require("./color");
|
|
7
|
+
const outlineRung_1 = require("./outlineRung");
|
|
8
|
+
exports.CARD_LIFT = 1.16;
|
|
9
|
+
exports.RAISED_LIFT = 1.15;
|
|
10
|
+
const STEP = 0.005;
|
|
11
|
+
const MAX_WEIGHT = 0.4;
|
|
12
|
+
function lift(ink, base, target) {
|
|
13
|
+
for (let t = STEP * 4; t < MAX_WEIGHT; t += STEP) {
|
|
14
|
+
const next = (0, color_1.mix)(base, ink, t);
|
|
15
|
+
if ((0, color_1.contrastRatio)(next, base) >= target)
|
|
16
|
+
return next;
|
|
17
|
+
}
|
|
18
|
+
return (0, color_1.mix)(base, ink, MAX_WEIGHT);
|
|
19
|
+
}
|
|
20
|
+
const clearsMarks = (surface, marks) => marks.every((mark) => (0, color_1.contrastRatio)(mark, surface) >= outlineRung_1.AA_NON_TEXT);
|
|
21
|
+
// NOTE: stops one step early rather than drop a filled mark under 3:1 on the lifted plane.
|
|
22
|
+
function liftUnder(ink, base, target, marks) {
|
|
23
|
+
let settled = base;
|
|
24
|
+
for (let t = STEP * 4; t < MAX_WEIGHT; t += STEP) {
|
|
25
|
+
const next = (0, color_1.mix)(base, ink, t);
|
|
26
|
+
if (!clearsMarks(next, marks))
|
|
27
|
+
return settled;
|
|
28
|
+
if ((0, color_1.contrastRatio)(next, base) >= target)
|
|
29
|
+
return next;
|
|
30
|
+
settled = next;
|
|
31
|
+
}
|
|
32
|
+
return settled;
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
/** Same pulse depth as the mobile library's `SKELETON_SHIMMER_CONTRAST`. */
|
|
3
|
+
export declare const SKELETON_SHIMMER_CONTRAST = 1.35;
|
|
4
|
+
export interface SkeletonShimmer {
|
|
5
|
+
start: string;
|
|
6
|
+
end: string;
|
|
7
|
+
}
|
|
8
|
+
/** The two colours a Skeleton pulses between: `gray[100]`, and `gray[300]`'s tint settled to the amplitude. */
|
|
9
|
+
export declare const skeletonShimmer: (palette: PaletteProps) => SkeletonShimmer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.skeletonShimmer = exports.SKELETON_SHIMMER_CONTRAST = void 0;
|
|
4
|
+
const color_1 = require("./color");
|
|
5
|
+
/** Same pulse depth as the mobile library's `SKELETON_SHIMMER_CONTRAST`. */
|
|
6
|
+
exports.SKELETON_SHIMMER_CONTRAST = 1.35;
|
|
7
|
+
const settleAway = (seed, base, target) => {
|
|
8
|
+
const { s } = (0, color_1.hexToHsl)(seed);
|
|
9
|
+
let near = (0, color_1.hexToHsl)(base).l;
|
|
10
|
+
let far = (0, color_1.relativeLuminance)(base) < 0.5 ? 100 : 0;
|
|
11
|
+
for (let i = 0; i < 20; i += 1) {
|
|
12
|
+
const mid = (near + far) / 2;
|
|
13
|
+
if ((0, color_1.contrastRatio)((0, color_1.withLightness)(seed, mid, s), base) < target)
|
|
14
|
+
near = mid;
|
|
15
|
+
else
|
|
16
|
+
far = mid;
|
|
17
|
+
}
|
|
18
|
+
return (0, color_1.withLightness)(seed, far, s);
|
|
19
|
+
};
|
|
20
|
+
/** The two colours a Skeleton pulses between: `gray[100]`, and `gray[300]`'s tint settled to the amplitude. */
|
|
21
|
+
const skeletonShimmer = (palette) => ({
|
|
22
|
+
start: palette.gray[100],
|
|
23
|
+
end: settleAway(palette.gray[300], palette.gray[100], exports.SKELETON_SHIMMER_CONTRAST),
|
|
24
|
+
});
|
|
25
|
+
exports.skeletonShimmer = skeletonShimmer;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PaletteProps } from "../types";
|
|
2
2
|
export declare const RAISED_OVERLAY = 0.07;
|
|
3
3
|
export type SurfaceRaisedSource = Pick<PaletteProps, "backgroundColor" | "background" | "white">;
|
|
4
|
-
|
|
4
|
+
/** The filled fills a raised plane must keep at 3:1, or a button on a menu stops reading. */
|
|
5
|
+
export declare const filledMarks: (colors: Pick<PaletteProps, "primary" | "semantic">) => string[];
|
|
6
|
+
export declare const buildSurfaceRaised: (source: SurfaceRaisedSource, marks?: readonly string[]) => string;
|
|
5
7
|
export declare const withSurfaceRaised: (palette: PaletteProps) => PaletteProps;
|
|
6
8
|
export declare const raisedRule: (colors: Pick<PaletteProps, "boxborder" | "background" | "surfaceRaised">) => string;
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.raisedRule = exports.withSurfaceRaised = exports.buildSurfaceRaised = exports.RAISED_OVERLAY = void 0;
|
|
3
|
+
exports.raisedRule = exports.withSurfaceRaised = exports.buildSurfaceRaised = exports.filledMarks = exports.RAISED_OVERLAY = void 0;
|
|
4
4
|
const color_1 = require("./color");
|
|
5
5
|
const outlineRung_1 = require("./outlineRung");
|
|
6
|
+
const planes_1 = require("./planes");
|
|
7
|
+
const planeStep_1 = require("./planeStep");
|
|
8
|
+
const semanticText_1 = require("./semanticText");
|
|
6
9
|
exports.RAISED_OVERLAY = 0.07;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
+
/** The filled fills a raised plane must keep at 3:1, or a button on a menu stops reading. */
|
|
11
|
+
const filledMarks = (colors) => [
|
|
12
|
+
colors.primary[500],
|
|
13
|
+
...semanticText_1.SEMANTIC_TONES.map((tone) => colors.semantic[tone][500]),
|
|
14
|
+
];
|
|
15
|
+
exports.filledMarks = filledMarks;
|
|
16
|
+
// Never below the card: the lighter of one white-overlay step off the canvas and a RAISED_LIFT step off the card.
|
|
17
|
+
const buildSurfaceRaised = (source, marks = []) => {
|
|
10
18
|
const card = source.background[50];
|
|
11
|
-
|
|
19
|
+
const overlay = (0, color_1.mix)(source.backgroundColor.main, source.white, exports.RAISED_OVERLAY);
|
|
20
|
+
const stepped = (0, planes_1.liftUnder)(source.white, card, planes_1.RAISED_LIFT, marks);
|
|
21
|
+
return [overlay, stepped].reduce((top, c) => ((0, color_1.relativeLuminance)(c) > (0, color_1.relativeLuminance)(top) ? c : top), card);
|
|
12
22
|
};
|
|
13
23
|
exports.buildSurfaceRaised = buildSurfaceRaised;
|
|
14
24
|
const withSurfaceRaised = (palette) => ({
|
|
15
25
|
...palette,
|
|
16
|
-
surfaceRaised: (0, exports.buildSurfaceRaised)(palette),
|
|
26
|
+
surfaceRaised: (0, exports.buildSurfaceRaised)(palette, (0, exports.filledMarks)(palette)),
|
|
17
27
|
});
|
|
18
28
|
exports.withSurfaceRaised = withSurfaceRaised;
|
|
19
|
-
// A divider inside an overlay, at the weight
|
|
20
|
-
const raisedRule = (colors) => (0, outlineRung_1.liftToContrast)(colors.boxborder[200], colors.surfaceRaised, (0, color_1.contrastRatio)(colors
|
|
29
|
+
// A divider inside an overlay, at the weight a rule has inside a card.
|
|
30
|
+
const raisedRule = (colors) => (0, outlineRung_1.liftToContrast)(colors.boxborder[200], colors.surfaceRaised, (0, color_1.contrastRatio)((0, planeStep_1.cardRule)(colors), colors.background[50]));
|
|
21
31
|
exports.raisedRule = raisedRule;
|
|
@@ -6,6 +6,7 @@ const color_1 = require("./color");
|
|
|
6
6
|
const outlineRung_1 = require("./outlineRung");
|
|
7
7
|
const accentText_1 = require("./accentText");
|
|
8
8
|
const semanticText_1 = require("./semanticText");
|
|
9
|
+
const rowStates_1 = require("./rowStates");
|
|
9
10
|
// 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.
|
|
10
11
|
exports.PLACEHOLDER_TEXT = outlineRung_1.AA_NON_TEXT;
|
|
11
12
|
const namedSurfaces = (palette) => [
|
|
@@ -21,6 +22,7 @@ exports.hardestSurface = hardestSurface;
|
|
|
21
22
|
// Runs last: `table.hover` is one of the surfaces, and it settles in its own rung.
|
|
22
23
|
function withSurfaceRungs(palette) {
|
|
23
24
|
const surfaces = (0, exports.namedSurfaces)(palette);
|
|
25
|
+
const accentSurfaces = [...surfaces, ...Object.values((0, rowStates_1.listRowBackgrounds)(palette))];
|
|
24
26
|
const lift = (ink, target) => (0, outlineRung_1.liftToContrast)(ink, (0, exports.hardestSurface)(ink, surfaces), target);
|
|
25
27
|
const settle = (ink, target) => (0, outlineRung_1.settleAcross)(ink, surfaces, target);
|
|
26
28
|
const rule = (ink) => (0, outlineRung_1.ruleInk)(ink, [palette.backgroundColor.main, palette.background[50]], outlineRung_1.CHROME_RULE);
|
|
@@ -31,7 +33,7 @@ function withSurfaceRungs(palette) {
|
|
|
31
33
|
return {
|
|
32
34
|
...palette,
|
|
33
35
|
textMuted: lift(palette.textMuted, accentText_1.AA_NORMAL_TEXT),
|
|
34
|
-
accentText: (0, accentText_1.pickAccentText)(palette.primary, (0, exports.hardestSurface)(palette.accentText,
|
|
36
|
+
accentText: (0, accentText_1.pickAccentText)(palette.primary, (0, exports.hardestSurface)(palette.accentText, accentSurfaces)),
|
|
35
37
|
semanticText,
|
|
36
38
|
text: { ...palette.text, 500: lift(palette.text[500], accentText_1.AA_NORMAL_TEXT) },
|
|
37
39
|
header: { ...palette.header, 500: lift(palette.header[500], accentText_1.AA_NORMAL_TEXT) },
|
|
@@ -4,8 +4,8 @@ export { default as radii, RADIUS_ROLE } from "./radii";
|
|
|
4
4
|
export type { RadiusToken, RadiusRole } from "./radii";
|
|
5
5
|
export * from "./borderWidths";
|
|
6
6
|
export * from "./states";
|
|
7
|
-
export { default as shadows, shadowsDark, shadowsFor } from "./shadows";
|
|
8
|
-
export type { ShadowRamp } from "./shadows";
|
|
7
|
+
export { default as shadows, shadowsDark, shadowsFor, shadowCss, ELEVATION_LAYERS, SHADOW_INK } from "./shadows";
|
|
8
|
+
export type { ShadowLayer, ElevationRole, ShadowRamp } from "./shadows";
|
|
9
9
|
export { default as zIndices } from "./zIndices";
|
|
10
10
|
export { default as breakpoints } from "./breakpoints";
|
|
11
11
|
export { default as lineHeights } from "./lineHeights";
|
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.TEXT_STYLES = exports.NUMERIC_TEXT = exports.fontWeights = exports.fontSizes = exports.fonts = exports.typography = exports.letterSpacings = exports.lineHeights = exports.breakpoints = exports.zIndices = exports.shadowsFor = exports.shadowsDark = exports.shadows = exports.RADIUS_ROLE = exports.radii = exports.sizes = exports.space = void 0;
|
|
20
|
+
exports.TEXT_STYLES = exports.NUMERIC_TEXT = exports.fontWeights = exports.fontSizes = exports.fonts = exports.typography = exports.letterSpacings = exports.lineHeights = exports.breakpoints = exports.zIndices = exports.SHADOW_INK = exports.ELEVATION_LAYERS = exports.shadowCss = exports.shadowsFor = exports.shadowsDark = exports.shadows = exports.RADIUS_ROLE = exports.radii = exports.sizes = exports.space = void 0;
|
|
21
21
|
var space_1 = require("./space");
|
|
22
22
|
Object.defineProperty(exports, "space", { enumerable: true, get: function () { return __importDefault(space_1).default; } });
|
|
23
23
|
var sizes_1 = require("./sizes");
|
|
@@ -31,6 +31,9 @@ var shadows_1 = require("./shadows");
|
|
|
31
31
|
Object.defineProperty(exports, "shadows", { enumerable: true, get: function () { return __importDefault(shadows_1).default; } });
|
|
32
32
|
Object.defineProperty(exports, "shadowsDark", { enumerable: true, get: function () { return shadows_1.shadowsDark; } });
|
|
33
33
|
Object.defineProperty(exports, "shadowsFor", { enumerable: true, get: function () { return shadows_1.shadowsFor; } });
|
|
34
|
+
Object.defineProperty(exports, "shadowCss", { enumerable: true, get: function () { return shadows_1.shadowCss; } });
|
|
35
|
+
Object.defineProperty(exports, "ELEVATION_LAYERS", { enumerable: true, get: function () { return shadows_1.ELEVATION_LAYERS; } });
|
|
36
|
+
Object.defineProperty(exports, "SHADOW_INK", { enumerable: true, get: function () { return shadows_1.SHADOW_INK; } });
|
|
34
37
|
var zIndices_1 = require("./zIndices");
|
|
35
38
|
Object.defineProperty(exports, "zIndices", { enumerable: true, get: function () { return __importDefault(zIndices_1).default; } });
|
|
36
39
|
var breakpoints_1 = require("./breakpoints");
|
|
@@ -23,6 +23,7 @@ export declare const MOTION_LOOP_MS: {
|
|
|
23
23
|
readonly spin: 800;
|
|
24
24
|
readonly sweep: 1200;
|
|
25
25
|
};
|
|
26
|
+
export declare const MOTION_PRESS_SCALE = 0.98;
|
|
26
27
|
/** A `transition` value for named properties only — `all` also animates layout and colour flips. */
|
|
27
28
|
export declare const transitionFor: (properties: readonly string[], speed?: MotionSpeed, curve?: MotionCurve) => string;
|
|
28
29
|
export declare const motionTransition: (speed?: MotionSpeed, curve?: MotionCurve) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.motionTransition = exports.transitionFor = exports.MOTION_LOOP_MS = exports.MOTION_EASE_IN = exports.MOTION_EASE_OUT = exports.MOTION_EASE = exports.cubicBezierCss = exports.MOTION_BEZIER = exports.MOTION_MS = void 0;
|
|
3
|
+
exports.motionTransition = exports.transitionFor = exports.MOTION_PRESS_SCALE = exports.MOTION_LOOP_MS = exports.MOTION_EASE_IN = exports.MOTION_EASE_OUT = exports.MOTION_EASE = exports.cubicBezierCss = exports.MOTION_BEZIER = exports.MOTION_MS = void 0;
|
|
4
4
|
exports.MOTION_MS = { fast: 150, base: 200, enter: 200, exit: 200 };
|
|
5
5
|
/** Pebble easing curves (mobile `pebble-spec.json` motion.easing); `in` is Pebble's `accelerate`. */
|
|
6
6
|
exports.MOTION_BEZIER = {
|
|
@@ -15,6 +15,7 @@ exports.MOTION_EASE_OUT = (0, exports.cubicBezierCss)(exports.MOTION_BEZIER.out)
|
|
|
15
15
|
exports.MOTION_EASE_IN = (0, exports.cubicBezierCss)(exports.MOTION_BEZIER.in);
|
|
16
16
|
/** Periods for loops that are feedback, not transitions: skeleton pulse, spinner turn, progress sweep. */
|
|
17
17
|
exports.MOTION_LOOP_MS = { pulse: 700, spin: 800, sweep: 1200 };
|
|
18
|
+
exports.MOTION_PRESS_SCALE = 0.98;
|
|
18
19
|
/** A `transition` value for named properties only — `all` also animates layout and colour flips. */
|
|
19
20
|
const transitionFor = (properties, speed = "fast", curve = "standard") => {
|
|
20
21
|
if (properties.includes("all"))
|