Skip to content

Commit f813fe6

Browse files
committed
Add mobile density tokens
1 parent 636c282 commit f813fe6

File tree

18 files changed

+135
-13
lines changed

18 files changed

+135
-13
lines changed

.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const preview: Preview = {
8383
// Storybook built in icons here - https://www.chromatic.com/component?appId=5a375b97f4b14f0020b0cda3&name=Basics%2FIcon&buildNumber=20654
8484
icon: "graphbar",
8585
// array of plain string values or MenuItem shape (see below)
86-
items: ["touch", "low", "medium", "high"],
86+
items: ["mobile", "touch", "low", "medium", "high"],
8787
},
8888
},
8989
responsive: {

cypress/support/commands.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { type PerformanceResult, PerformanceTester } from "./PerformanceTester";
1515

1616
const SupportedThemeModeValues = ["light", "dark"] as const;
1717
type SupportedThemeMode = (typeof SupportedThemeModeValues)[number];
18-
const SupportedDensityValues = ["touch", "low", "medium", "high"];
18+
const SupportedDensityValues = ["mobile", "touch", "low", "medium", "high"];
1919
type SupportedDensity = (typeof SupportedDensityValues)[number];
2020

2121
// Must be declared global to be detected by typescript (allows import/export)
@@ -132,7 +132,7 @@ Cypress.Commands.add(
132132
cy.state("announcement", announcement);
133133
};
134134

135-
const density: "touch" | "low" | "medium" | "high" | undefined =
135+
const density: "mobile" | "touch" | "low" | "medium" | "high" | undefined =
136136
Cypress.env("density");
137137
const mode: "light" | "dark" | undefined = Cypress.env("mode");
138138
const dateAdapter: SaltDateAdapter<DateFrameworkType> | undefined =

packages/ag-grid-theme/src/dependencies/useAgGridHelpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export function useAgGridHelpers({
5151
return [49, 48]; // 36 + 12 + [1 (border)]
5252
case "touch":
5353
return [61, 60]; // 44 + 16 + [1 (border)]
54+
case "mobile":
55+
return [61, 60]; // 44 + 16 + [1 (border)]
5456
default:
5557
return [25, 24];
5658
}

packages/core/src/salt-provider/SaltProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ interface SaltProviderBaseProps {
179179
*/
180180
applyClassesTo?: TargetElement;
181181
/**
182-
* Either "high", "medium", "low" or "touch".
182+
* Either "high", "medium", "low", "touch" or "mobile".
183183
* Determines the amount of content that can fit on a screen based on the size and spacing of components.
184184
* Refer to [density](https://www.saltdesignsystem.com/salt/foundations/density) doc for more detail.
185185
*

packages/core/src/spinner/svgSpinners/SpinnerSVG.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@ const sizeAndStrokeWidthMapping = {
1818
medium: { width: 12, strokeWidth: 2 },
1919
low: { width: 14, strokeWidth: 2 },
2020
touch: { width: 16, strokeWidth: 2 },
21+
mobile: { width: 16, strokeWidth: 2 },
2122
},
2223
medium: {
2324
high: { width: 20, strokeWidth: 2 },
2425
medium: { width: 28, strokeWidth: 4 },
2526
low: { width: 36, strokeWidth: 6 },
2627
touch: { width: 44, strokeWidth: 8 },
28+
mobile: { width: 44, strokeWidth: 8 },
2729
},
2830
large: {
2931
high: { width: 40, strokeWidth: 2 },
3032
medium: { width: 56, strokeWidth: 4 },
3133
low: { width: 72, strokeWidth: 6 },
3234
touch: { width: 88, strokeWidth: 8 },
35+
mobile: { width: 88, strokeWidth: 8 },
3336
},
3437
};
3538

@@ -64,8 +67,8 @@ export const SpinnerSVG = ({
6467
</linearGradient>
6568
</defs>
6669
<g fill="none">
67-
{/*
68-
This first path draws the top half of the circle without a gradient.
70+
{/*
71+
This first path draws the top half of the circle without a gradient.
6972
It starts from the right end, moves in a circular arc, and ends at the left end.
7073
*/}
7174
<path
@@ -76,8 +79,8 @@ export const SpinnerSVG = ({
7679
strokeWidth="var(--spinner-strokeWidth)"
7780
fill="none"
7881
/>
79-
{/*
80-
This second path draws the left half of the circle with a gradient that transitions
82+
{/*
83+
This second path draws the left half of the circle with a gradient that transitions
8184
from opaque on the left to transparent on the right.
8285
It starts from the top-center, moves in a circular arc, and ends at the bottom-center.
8386
*/}

packages/core/src/theme/Density.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
export const DensityValues = ["high", "medium", "low", "touch"] as const;
1+
export const DensityValues = [
2+
"high",
3+
"medium",
4+
"low",
5+
"touch",
6+
"mobile",
7+
] as const;
28

39
export type Density = (typeof DensityValues)[number];

packages/embla-carousel/src/CarouselAutoplayIndicator.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const sizeAndStrokeWidthMapping = {
3939
medium: { size: 12, strokeWidth: 2 },
4040
low: { size: 14, strokeWidth: 2 },
4141
touch: { size: 16, strokeWidth: 2 },
42+
mobile: { size: 16, strokeWidth: 2 },
4243
};
4344

4445
export const CarouselAutoplayIndicator = forwardRef<

packages/lab/src/tokenized-input/useTokenizedInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const BLUR_TIMEOUT = 200;
5050
*/
5151
const SINGLE_LINE_HEIGHT_MAP = {
5252
touch: 45,
53+
mobile: 45,
5354
low: 36,
5455
medium: 28,
5556
high: 23,

packages/lab/stories/list/list.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ export const VariableHeight: StoryFn<ListProps> = () => {
458458
medium: 32,
459459
low: 36,
460460
touch: 36,
461+
mobile: 36,
461462
}),
462463
[],
463464
);

packages/theme/css/foundations/animation.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.salt-density-touch,
22
.salt-density-low,
33
.salt-density-medium,
4-
.salt-density-high {
4+
.salt-density-high,
5+
.salt-density-mobile {
56
--salt-animation-opacity-start: 0;
67
--salt-animation-opacity-end: 1;
78
--salt-animation-scale-start: 0;

0 commit comments

Comments
 (0)