@expo/styleguide 4.0.1 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{src/components → components}/BlockingSetInitialColorMode.d.ts +1 -0
- package/dist/{src/components → components}/BlockingSetInitialColorMode.js +25 -5
- package/dist/{src/components → components}/ThemeProvider.d.ts +0 -0
- package/dist/{src/components → components}/ThemeProvider.js +28 -15
- package/dist/{src/icons → icons}/ActivityIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ActivityIcon.js +0 -0
- package/dist/{src/icons → icons}/AddPhotoIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/AddPhotoIcon.js +0 -0
- package/dist/{src/icons → icons}/AndroidIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/AndroidIcon.js +0 -0
- package/dist/{src/icons → icons}/AppleAppStoreIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/AppleAppStoreIcon.js +0 -0
- package/dist/{src/icons → icons}/AppleIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/AppleIcon.js +0 -0
- package/dist/{src/icons → icons}/AppleSimulatorIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/AppleSimulatorIcon.js +0 -0
- package/dist/{src/icons → icons}/ArrowLeftIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ArrowLeftIcon.js +0 -0
- package/dist/{src/icons → icons}/ArrowRightIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ArrowRightIcon.js +0 -0
- package/dist/{src/icons → icons}/AtSignIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/AtSignIcon.js +0 -0
- package/dist/{src/icons → icons}/BadgeIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/BadgeIcon.js +0 -0
- package/dist/{src/icons → icons}/BellIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/BellIcon.js +0 -0
- package/dist/{src/icons → icons}/BranchIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/BranchIcon.js +0 -0
- package/dist/{src/icons → icons}/BuildIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/BuildIcon.js +0 -0
- package/dist/{src/icons → icons}/BuildNumberIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/BuildNumberIcon.js +0 -0
- package/dist/{src/icons → icons}/BuildProfileIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/BuildProfileIcon.js +0 -0
- package/dist/{src/icons → icons}/ChannelIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ChannelIcon.js +0 -0
- package/dist/{src/icons → icons}/CheckIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/CheckIcon.js +0 -0
- package/dist/{src/icons → icons}/ChevronDownIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ChevronDownIcon.js +0 -0
- package/dist/{src/icons → icons}/CloudSlashIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/CloudSlashIcon.js +0 -0
- package/dist/{src/icons → icons}/CommitIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/CommitIcon.js +0 -0
- package/dist/{src/icons → icons}/CredentialIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/CredentialIcon.js +0 -0
- package/dist/{src/icons → icons}/DebugIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/DebugIcon.js +0 -0
- package/dist/{src/icons → icons}/DeploymentIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/DeploymentIcon.js +0 -0
- package/dist/{src/icons → icons}/DeploymentsIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/DeploymentsIcon.js +0 -0
- package/dist/{src/icons → icons}/DiscordIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/DiscordIcon.js +0 -0
- package/dist/{src/icons → icons}/DiscourseIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/DiscourseIcon.js +0 -0
- package/dist/{src/icons → icons}/DownloadIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/DownloadIcon.js +0 -0
- package/dist/{src/icons → icons}/ErrorIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ErrorIcon.js +0 -0
- package/dist/{src/icons → icons}/FacebookIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/FacebookIcon.js +0 -0
- package/dist/{src/icons → icons}/GeneralIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/GeneralIcon.js +0 -0
- package/dist/{src/icons → icons}/GithubIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/GithubIcon.js +0 -0
- package/dist/{src/icons → icons}/GoogleAppStoreIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/GoogleAppStoreIcon.js +0 -0
- package/dist/{src/icons → icons}/HomeFilledIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/HomeFilledIcon.js +0 -0
- package/dist/{src/icons → icons}/HomeIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/HomeIcon.js +0 -0
- package/dist/{src/icons → icons}/InfoIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/InfoIcon.js +0 -0
- package/dist/{src/icons → icons}/InspectElementIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/InspectElementIcon.js +0 -0
- package/dist/{src/icons → icons}/InstagramIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/InstagramIcon.js +0 -0
- package/dist/{src/icons → icons}/InvoicesIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/InvoicesIcon.js +0 -0
- package/dist/{src/icons → icons}/LifebuoyIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/LifebuoyIcon.js +0 -0
- package/dist/{src/icons → icons}/LockIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/LockIcon.js +0 -0
- package/dist/{src/icons → icons}/LogoutMobileIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/LogoutMobileIcon.js +0 -0
- package/dist/{src/icons → icons}/LogsIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/LogsIcon.js +0 -0
- package/dist/{src/icons → icons}/MailIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/MailIcon.js +0 -0
- package/dist/{src/icons → icons}/MegaphoneIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/MegaphoneIcon.js +0 -0
- package/dist/{src/icons → icons}/MessageIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/MessageIcon.js +0 -0
- package/dist/{src/icons → icons}/OneTimePasswordIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/OneTimePasswordIcon.js +0 -0
- package/dist/{src/icons → icons}/OpenInternalIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/OpenInternalIcon.js +0 -0
- package/dist/{src/icons → icons}/OverviewIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/OverviewIcon.js +0 -0
- package/dist/{src/icons → icons}/PerformanceIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/PerformanceIcon.js +0 -0
- package/dist/{src/icons → icons}/PinIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/PinIcon.js +0 -0
- package/dist/{src/icons → icons}/PlanEnterpriseIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/PlanEnterpriseIcon.js +0 -0
- package/dist/{src/icons → icons}/PlanFreeIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/PlanFreeIcon.js +0 -0
- package/dist/{src/icons → icons}/PlanProductionIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/PlanProductionIcon.js +0 -0
- package/dist/{src/icons → icons}/PlansIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/PlansIcon.js +0 -0
- package/dist/{src/icons → icons}/ProjectTransferIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ProjectTransferIcon.js +0 -0
- package/dist/{src/icons → icons}/PushToDeviceIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/PushToDeviceIcon.js +0 -0
- package/dist/{src/icons → icons}/QrCodeIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/QrCodeIcon.js +0 -0
- package/dist/{src/icons → icons}/QuestionIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/QuestionIcon.js +0 -0
- package/dist/{src/icons → icons}/QuestionMarkIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/QuestionMarkIcon.js +0 -0
- package/dist/{src/icons → icons}/RefreshIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/RefreshIcon.js +0 -0
- package/dist/{src/icons → icons}/RolloutIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/RolloutIcon.js +0 -0
- package/dist/{src/icons → icons}/RunIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/RunIcon.js +0 -0
- package/dist/{src/icons → icons}/RuntimeVersionIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/RuntimeVersionIcon.js +0 -0
- package/dist/{src/icons → icons}/ScanIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ScanIcon.js +0 -0
- package/dist/{src/icons → icons}/SearchIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/SearchIcon.js +0 -0
- package/dist/{src/icons → icons}/SecretsIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/SecretsIcon.js +0 -0
- package/dist/{src/icons → icons}/SettingsFilledIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/SettingsFilledIcon.js +0 -0
- package/dist/{src/icons → icons}/SettingsIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/SettingsIcon.js +0 -0
- package/dist/{src/icons → icons}/SparklesIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/SparklesIcon.js +0 -0
- package/dist/{src/icons → icons}/StoreIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/StoreIcon.js +0 -0
- package/dist/{src/icons → icons}/ThemeAutoIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ThemeAutoIcon.js +0 -0
- package/dist/{src/icons → icons}/ThemeDarkIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ThemeDarkIcon.js +0 -0
- package/dist/{src/icons → icons}/ThemeLightIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/ThemeLightIcon.js +0 -0
- package/dist/{src/icons → icons}/TokensIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/TokensIcon.js +0 -0
- package/dist/{src/icons → icons}/TrashIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/TrashIcon.js +0 -0
- package/dist/{src/icons → icons}/TriangleDownIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/TriangleDownIcon.js +0 -0
- package/dist/{src/icons → icons}/TriangleRightIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/TriangleRightIcon.js +0 -0
- package/dist/{src/icons → icons}/TwitchIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/TwitchIcon.js +0 -0
- package/dist/{src/icons → icons}/TwitterIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/TwitterIcon.js +0 -0
- package/dist/{src/icons → icons}/UndoIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/UndoIcon.js +0 -0
- package/dist/{src/icons → icons}/UpdateIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/UpdateIcon.js +0 -0
- package/dist/{src/icons → icons}/UploadIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/UploadIcon.js +0 -0
- package/dist/{src/icons → icons}/UserFilledIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/UserFilledIcon.js +0 -0
- package/dist/{src/icons → icons}/UserIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/UserIcon.js +0 -0
- package/dist/{src/icons → icons}/UsersFilledIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/UsersFilledIcon.js +0 -0
- package/dist/{src/icons → icons}/UsersIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/UsersIcon.js +0 -0
- package/dist/{src/icons → icons}/VersionIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/VersionIcon.js +0 -0
- package/dist/{src/icons → icons}/WarningIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/WarningIcon.js +0 -0
- package/dist/{src/icons → icons}/XIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/XIcon.js +0 -0
- package/dist/{src/icons → icons}/YoutubeIcon.d.ts +1 -1
- package/dist/{src/icons → icons}/YoutubeIcon.js +0 -0
- package/dist/{src/icons → icons}/index.d.ts +0 -0
- package/dist/{src/icons → icons}/index.js +0 -0
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/{src/styles → styles}/breakpoints.d.ts +0 -0
- package/dist/{src/styles → styles}/breakpoints.js +0 -0
- package/dist/{src/styles → styles}/legacy-colors.d.ts +0 -0
- package/dist/{src/styles → styles}/legacy-colors.js +0 -0
- package/dist/{src/styles → styles}/palette.d.ts +0 -0
- package/dist/{src/styles → styles}/palette.js +0 -0
- package/dist/{src/styles → styles}/shadows.d.ts +0 -0
- package/dist/{src/styles → styles}/shadows.js +0 -0
- package/dist/{src/styles → styles}/sizing.d.ts +0 -0
- package/dist/{src/styles → styles}/sizing.js +0 -0
- package/dist/{src/styles → styles}/spacing.d.ts +0 -0
- package/dist/{src/styles → styles}/spacing.js +0 -0
- package/dist/{src/styles → styles}/themes.d.ts +0 -0
- package/dist/{src/styles → styles}/themes.js +0 -0
- package/dist/{src/styles → styles}/typography.d.ts +0 -0
- package/dist/{src/styles → styles}/typography.js +0 -0
- package/package.json +7 -5
|
@@ -3,13 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BlockingSetInitialColorMode = exports.getInitialColorMode = void 0;
|
|
6
|
+
exports.BlockingSetInitialColorMode = exports.getInitialColorMode = exports.isLocalStorageAvailable = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function isLocalStorageAvailable() {
|
|
9
|
+
try {
|
|
10
|
+
if (!window.localStorage || typeof window.localStorage === 'undefined') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
window.localStorage.setItem('localStorage:test', 'value');
|
|
14
|
+
if (window.localStorage.getItem('localStorage:test') !== 'value') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
window.localStorage.removeItem('localStorage:test');
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.isLocalStorageAvailable = isLocalStorageAvailable;
|
|
8
25
|
function getInitialColorMode() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
26
|
+
if (isLocalStorageAvailable()) {
|
|
27
|
+
const preference = window.localStorage.getItem('data-expo-theme');
|
|
28
|
+
let hasPreference = typeof preference === 'string';
|
|
29
|
+
if (hasPreference) {
|
|
30
|
+
return preference;
|
|
31
|
+
}
|
|
13
32
|
}
|
|
14
33
|
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
15
34
|
const systemPreference = typeof mql.matches === 'boolean';
|
|
@@ -31,6 +50,7 @@ function setInitialColorMode() {
|
|
|
31
50
|
}
|
|
32
51
|
// our function needs to be a string so that we can call it
|
|
33
52
|
const blockingSetInitialColorMode = `(function() {
|
|
53
|
+
${isLocalStorageAvailable.toString()}
|
|
34
54
|
${getInitialColorMode.toString()}
|
|
35
55
|
${setInitialColorMode.toString()}
|
|
36
56
|
setInitialColorMode();
|
|
File without changes
|
|
@@ -48,12 +48,17 @@ function ThemeProvider(props) {
|
|
|
48
48
|
mediaQuery.addEventListener('change', onThemeChange);
|
|
49
49
|
}
|
|
50
50
|
catch {
|
|
51
|
-
// Fallback to old-style
|
|
51
|
+
// Fallback to old-style listening for changes, for Safari and IE
|
|
52
52
|
mediaQuery.addListener(onThemeChange);
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if (BlockingSetInitialColorMode_1.isLocalStorageAvailable()) {
|
|
55
|
+
const themePreference = window.localStorage.getItem('data-expo-theme');
|
|
56
|
+
if (themePreference === Themes.LIGHT || themePreference === Themes.DARK) {
|
|
57
|
+
setThemeName(themePreference);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
setThemeName(Themes.AUTO);
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
63
|
else {
|
|
59
64
|
setThemeName(Themes.AUTO);
|
|
@@ -63,7 +68,7 @@ function ThemeProvider(props) {
|
|
|
63
68
|
mediaQuery.removeEventListener('change', onThemeChange);
|
|
64
69
|
}
|
|
65
70
|
catch {
|
|
66
|
-
// Fallback to old-style
|
|
71
|
+
// Fallback to old-style listening for changes, for Safari and IE
|
|
67
72
|
mediaQuery.removeListener(onThemeChange);
|
|
68
73
|
}
|
|
69
74
|
};
|
|
@@ -79,31 +84,39 @@ function ThemeProvider(props) {
|
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
function onThemeChange(event) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
if (BlockingSetInitialColorMode_1.isLocalStorageAvailable()) {
|
|
88
|
+
const themePreference = window.localStorage.getItem('data-expo-theme');
|
|
89
|
+
if (!themePreference) {
|
|
90
|
+
if (event.matches) {
|
|
91
|
+
setDocumentTheme(Themes.DARK);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
setDocumentTheme(Themes.LIGHT);
|
|
95
|
+
}
|
|
89
96
|
}
|
|
90
97
|
}
|
|
98
|
+
else {
|
|
99
|
+
setDocumentTheme(Themes.AUTO);
|
|
100
|
+
}
|
|
91
101
|
}
|
|
92
102
|
function setDarkMode() {
|
|
93
|
-
|
|
103
|
+
if (BlockingSetInitialColorMode_1.isLocalStorageAvailable()) {
|
|
94
104
|
window.localStorage.setItem('data-expo-theme', Themes.DARK);
|
|
105
|
+
}
|
|
95
106
|
setDocumentTheme(Themes.DARK);
|
|
96
107
|
setThemeName(Themes.DARK);
|
|
97
108
|
}
|
|
98
109
|
function setLightMode() {
|
|
99
|
-
|
|
110
|
+
if (BlockingSetInitialColorMode_1.isLocalStorageAvailable()) {
|
|
100
111
|
window.localStorage.setItem('data-expo-theme', Themes.LIGHT);
|
|
112
|
+
}
|
|
101
113
|
setDocumentTheme(Themes.LIGHT);
|
|
102
114
|
setThemeName(Themes.LIGHT);
|
|
103
115
|
}
|
|
104
116
|
function setAutoMode() {
|
|
105
|
-
|
|
117
|
+
if (BlockingSetInitialColorMode_1.isLocalStorageAvailable()) {
|
|
106
118
|
window.localStorage.removeItem('data-expo-theme');
|
|
119
|
+
}
|
|
107
120
|
const themeName = BlockingSetInitialColorMode_1.getInitialColorMode();
|
|
108
121
|
setDocumentTheme(themeName);
|
|
109
122
|
setThemeName(Themes.AUTO);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|