@brightlayer-ui/react-native-themes 5.2.0-beta.0
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 +49 -0
- package/LICENSE +29 -0
- package/README.md +195 -0
- package/dist/blueDarkAltTheme.d.ts +33 -0
- package/dist/blueDarkAltTheme.js +28 -0
- package/dist/blueDarkTheme.d.ts +8 -0
- package/dist/blueDarkTheme.js +32 -0
- package/dist/blueTheme.d.ts +8 -0
- package/dist/blueTheme.js +28 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +15 -0
- package/dist/shared.d.ts +58 -0
- package/dist/shared.js +26 -0
- package/package.json +57 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v5.2.0 (December 13, 2021)
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Changed package namespace from `@pxblue` to `@brightlayer-ui`.
|
|
8
|
+
|
|
9
|
+
## Package Migration Notice
|
|
10
|
+
|
|
11
|
+
Previous versions listed after this indicator refer to our deprecated `@pxblue` packages.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## v5.2.0 (October 1, 2021)
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- blueDarkAlt theme deprecation notice.
|
|
20
|
+
|
|
21
|
+
## v5.1.0 (March 30, 2021)
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Initial Dark themes (regular and alternate)
|
|
26
|
+
|
|
27
|
+
## v5.0.1 (November 19, 2020)
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- Updated peerDependencies to allow for use with react-native-paper version 4.
|
|
32
|
+
|
|
33
|
+
## v5.0.0 (June 30, 2020)
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- Updated theme to comply with the [react-native-paper](https://callstack.github.io/react-native-paper/theming.html) specification.
|
|
38
|
+
|
|
39
|
+
** Breaking Changes **
|
|
40
|
+
|
|
41
|
+
- Font weights available in the theme have changed. We now have `thin`, `light`, `regular`, and `medium` (previously `semiBold`). `Bold` and `ExtraBold` have been removed.
|
|
42
|
+
- `onPrimary` color is no longer available.
|
|
43
|
+
- `sizes` property of the theme has been removed. If you need these size values, they are now exported from @pxblue/react-native-components.
|
|
44
|
+
|
|
45
|
+
## v4.0.0 (February 24, 2020)
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- Themes have been broken out into their own packages. This package was originally part of @pxblue/themes. If you are switching to this package, you'll need to update some import statements (refer to the usage instructions in the README).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 - present, Eaton
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Brightlayer UI themes for React Native applications
|
|
2
|
+
|
|
3
|
+
[](https://circleci.com/gh/brightlayer-ui/react-native-themes/tree/master)
|
|
4
|
+
[](https://www.npmjs.com/package/@brightlayer-ui/react-native-themes)
|
|
5
|
+
|
|
6
|
+
This package provides theming support for Eaton applications using the Brightlayer UI design system. It includes resources for developers using React Native with [react-native-paper](https://www.npmjs.com/package/react-native-paper). This package comes with two theme options: a Blue theme (standard) and a Dark theme.
|
|
7
|
+
|
|
8
|
+
For other frameworks, check out our related packages:
|
|
9
|
+
|
|
10
|
+
- [@brightlayer-ui/angular-themes](https://www.npmjs.com/package/@brightlayer-ui/angular-themes)
|
|
11
|
+
- [@brightlayer-ui/react-themes](https://www.npmjs.com/package/@brightlayer-ui/react-themes)
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Install with npm
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
npm install --save @brightlayer-ui/react-native-themes
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
or yarn
|
|
22
|
+
|
|
23
|
+
```shell
|
|
24
|
+
yarn add @brightlayer-ui/react-native-themes
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
# Usage
|
|
28
|
+
|
|
29
|
+
> **NOTE:** Using the Brightlayer UI React Native theme requires that you add the Open Sans font to your application. You can learn how to do this by reading the instructions for [Vanilla React Native](https://medium.com/react-native-training/react-native-custom-fonts-ccc9aacf9e5e) or [Expo](https://docs.expo.io/versions/latest/guides/using-custom-fonts/). This will be added automatically if you start your project with the [@brightlayer-ui/cli](https://www.npmjs.com/package/@brightlayer-ui/cli).
|
|
30
|
+
|
|
31
|
+
> When using Expo, you will need to specify the name for each font weight you load using the format `OpenSans-<Weight>`, e.g., OpenSans-SemiBold. Refer to one of our React Native demos for reference.
|
|
32
|
+
|
|
33
|
+
### Light Theme
|
|
34
|
+
|
|
35
|
+
To use the light theme in your application, simply wrap the app in a `Provider` and pass in your desired theme (`blue`).
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { Provider as ThemeProvider} from 'react-native-paper';
|
|
39
|
+
import * as BLUIThemes from '@brightlayer-ui/react-native-themes';
|
|
40
|
+
...
|
|
41
|
+
// Default Theme
|
|
42
|
+
<ThemeProvider theme={BLUIThemes.blue}>
|
|
43
|
+
<App />
|
|
44
|
+
</ThemeProvider>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Dark Theme
|
|
48
|
+
|
|
49
|
+
The theming mechanism for React Native Paper is a bit limited in the amount of customization available for components. Because of this, there are two dark themes available from Brightlayer UI that should be applied to different components.
|
|
50
|
+
|
|
51
|
+
The main theme should be applied using a `Provider` that wraps your application and passing in the theme (`blueDark`). This will be applied to the majority of the component in the RNP library.
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { Provider as ThemeProvider} from 'react-native-paper';
|
|
55
|
+
import * as BLUIThemes from '@brightlayer-ui/react-native-themes';
|
|
56
|
+
...
|
|
57
|
+
<ThemeProvider theme={BLUIThemes.blueDark}>
|
|
58
|
+
<App />
|
|
59
|
+
</ThemeProvider>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### Alternate Dark Theme
|
|
63
|
+
|
|
64
|
+
The alternate dark theme (`blueDarkAlt`) should be applied to select components to give them the desired Brightlayer UI styling. The following components should use the alternate dark theme:
|
|
65
|
+
|
|
66
|
+
- Activity Indicator
|
|
67
|
+
- Appbar
|
|
68
|
+
- Avatar
|
|
69
|
+
- Badge
|
|
70
|
+
- Bottom Navigation
|
|
71
|
+
- Button (`contained` mode variant)
|
|
72
|
+
- FAB
|
|
73
|
+
- ProgressBar
|
|
74
|
+
- Snackbar
|
|
75
|
+
- TextInput
|
|
76
|
+
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
1. For these components, make sure you are using the darkThemeAlt.
|
|
80
|
+
2. Do not use the darkTheme or these components will render using the incorrect color scheme.
|
|
81
|
+
|
|
82
|
+
##### One-Off Usage
|
|
83
|
+
|
|
84
|
+
If you are only using a component from this list once or twice in your application, you can pass the alternate theme directly to the component through the `theme` prop.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { useTheme } from 'react-native-paper';
|
|
88
|
+
import { blueDarkAlt } from '@brightlayer-ui/react-native-themes';
|
|
89
|
+
const theme = useTheme();
|
|
90
|
+
...
|
|
91
|
+
<Badge size={24} visible theme={theme.dark ? blueDarkAlt : {}}></Badge>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
##### Component-Based Usage
|
|
95
|
+
|
|
96
|
+
If you are using components frequently, it's best to create a wrapper component that will handle the alternate theme logic. This will allow you to keep your code more readable and avoid errors with inconsistent theme application.
|
|
97
|
+
|
|
98
|
+
To do this, you define a wrapper component that acts as a pass-through for all of the default props and adds the theme logic.
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import React from 'react';
|
|
102
|
+
import { blueDarkAlt } from '@brightlayer-ui/react-native-themes';
|
|
103
|
+
import { SomeComponent as PaperComponent, useTheme } from 'react-native-paper';
|
|
104
|
+
...
|
|
105
|
+
export const SomeComponent: typeof PaperComponent = (props) => {
|
|
106
|
+
const theme = useTheme(props.theme);
|
|
107
|
+
return (
|
|
108
|
+
<PaperComponent
|
|
109
|
+
{...props}
|
|
110
|
+
theme={
|
|
111
|
+
theme.dark
|
|
112
|
+
? Object.assign({}, blueDarkAlt, props.theme)
|
|
113
|
+
: {}
|
|
114
|
+
}
|
|
115
|
+
/>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
You would then use your custom wrapper component throughout your application instead of using the component directly from React Native Paper:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import { SomeComponent } from './path/to/SomeComponent';
|
|
124
|
+
...
|
|
125
|
+
<SomeComponent {...samePropsAsThePaperComponent} />
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The `Button` component is a special case that requires the alternate theme only if you are using the contained mode. The wrapper component for the `Button` should look like:
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import React from 'react';
|
|
132
|
+
import { blueDarkAlt } from '@brightlayer-ui/react-native-themes';
|
|
133
|
+
import { Button, useTheme } from 'react-native-paper';
|
|
134
|
+
...
|
|
135
|
+
export const MyCustomButton: typeof Button = (props) => {
|
|
136
|
+
const theme = useTheme(props.theme);
|
|
137
|
+
return (
|
|
138
|
+
<Button
|
|
139
|
+
{...props}
|
|
140
|
+
theme={
|
|
141
|
+
props.mode === 'contained' && theme.dark
|
|
142
|
+
? Object.assign({}, blueDarkAlt, props.theme)
|
|
143
|
+
: {}
|
|
144
|
+
}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The `TextInput` component is a special case that requires usage of both `blueDark` and `blueDarkAlt` themes. The wrapper component for the `TextInput` should look like:
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { blueDark, blueDarkAlt } from "@brightlayer-ui/react-native-themes";
|
|
154
|
+
import { TextInput, useTheme } from "react-native-paper";
|
|
155
|
+
import _clonedeep from "lodash.clonedeep";
|
|
156
|
+
|
|
157
|
+
export const MyCustomTextInput: typeof TextInput = (props) => {
|
|
158
|
+
const theme = useTheme(props.theme);
|
|
159
|
+
const darkTheme = _clonedeep(blueDarkAlt);
|
|
160
|
+
darkTheme.colors.primary = blueDark.colors.primary;
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<TextInput
|
|
164
|
+
{...props}
|
|
165
|
+
theme={theme.dark ? Object.assign({}, darkTheme, props.theme) : {}}
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
> **Sample Wrappers:** Brightlayer UI has sample wrapper code for all of these components that you can copy for use in your application. These can be found in our [Showcase Demo](https://github.com/brightlayer-ui/react-native-showcase-demo/tree/master/components/wrappers).
|
|
172
|
+
|
|
173
|
+
### TypeScript
|
|
174
|
+
|
|
175
|
+
Our Brightlayer UI themes extend the themes provided by React Native Paper. If you are using these themes in a TypeScript project and want to access any of the properties that were added to the defaults, you need to add the following [global augmentation](https://callstack.github.io/react-native-paper/theming.html#typescript) in your project's index.tsx file:
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
declare global {
|
|
179
|
+
namespace ReactNativePaper {
|
|
180
|
+
interface ThemeColors {
|
|
181
|
+
primaryBase: string;
|
|
182
|
+
textSecondary: string;
|
|
183
|
+
}
|
|
184
|
+
interface ThemeFonts {
|
|
185
|
+
bold: ThemeFont;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
<!--
|
|
192
|
+
## Demo
|
|
193
|
+
|
|
194
|
+
[Check it out](https://github.com/brightlayer-ui/react-native-showcase-demo/tree/master)
|
|
195
|
+
-->
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Copyright (c) 2020-present, Eaton
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
7
|
+
**/
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated in v6.0.0 use blueDark theme
|
|
10
|
+
*/
|
|
11
|
+
export declare const blueDarkAltTheme: {
|
|
12
|
+
colors: {
|
|
13
|
+
primary: string;
|
|
14
|
+
accent: string;
|
|
15
|
+
background: string;
|
|
16
|
+
notification: string;
|
|
17
|
+
surface: string;
|
|
18
|
+
error: string;
|
|
19
|
+
text: string;
|
|
20
|
+
onSurface: string;
|
|
21
|
+
onBackground: string;
|
|
22
|
+
disabled: string;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
backdrop: string;
|
|
25
|
+
primaryBase: string;
|
|
26
|
+
textSecondary: string;
|
|
27
|
+
};
|
|
28
|
+
dark: boolean;
|
|
29
|
+
mode?: "adaptive" | "exact" | undefined;
|
|
30
|
+
roundness: number;
|
|
31
|
+
fonts: ReactNativePaper.ThemeFonts;
|
|
32
|
+
animation: ReactNativePaper.ThemeAnimation;
|
|
33
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
Copyright (c) 2020-present, Eaton
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
8
|
+
**/
|
|
9
|
+
var __assign = (this && this.__assign) || function () {
|
|
10
|
+
__assign = Object.assign || function(t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
return __assign.apply(this, arguments);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.blueDarkAltTheme = void 0;
|
|
22
|
+
var colors_1 = require("@brightlayer-ui/colors");
|
|
23
|
+
var blueDarkTheme_1 = require("./blueDarkTheme");
|
|
24
|
+
console.warn("blueDarkAlt theme will be deprecated in v6.0.0, use blueDark theme");
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated in v6.0.0 use blueDark theme
|
|
27
|
+
*/
|
|
28
|
+
exports.blueDarkAltTheme = __assign(__assign({}, blueDarkTheme_1.blueDarkTheme), { colors: __assign(__assign({}, blueDarkTheme_1.blueDarkTheme.colors), { primary: colors_1.blue[500], accent: colors_1.lightBlue[500], background: colors_1.black[900], notification: colors_1.lightBlue[500] }) });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Copyright (c) 2020-present, Eaton
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
7
|
+
**/
|
|
8
|
+
export declare const blueDarkTheme: ReactNativePaper.Theme;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
Copyright (c) 2020-present, Eaton
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
8
|
+
**/
|
|
9
|
+
var __assign = (this && this.__assign) || function () {
|
|
10
|
+
__assign = Object.assign || function(t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
return __assign.apply(this, arguments);
|
|
19
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.blueDarkTheme = void 0;
|
|
25
|
+
var react_native_paper_1 = require("react-native-paper");
|
|
26
|
+
var colors_1 = require("@brightlayer-ui/colors");
|
|
27
|
+
var shared_1 = require("./shared");
|
|
28
|
+
var color_1 = __importDefault(require("color"));
|
|
29
|
+
exports.blueDarkTheme = __assign(__assign({}, react_native_paper_1.DefaultTheme), { dark: true, roundness: 4, fonts: __assign(__assign({}, react_native_paper_1.configureFonts(shared_1.fontConfig)), { bold: {
|
|
30
|
+
fontFamily: "OpenSans-Bold",
|
|
31
|
+
fontWeight: "700",
|
|
32
|
+
} }), colors: __assign(__assign({}, react_native_paper_1.DefaultTheme.colors), { primary: colors_1.blue[200], primaryBase: colors_1.blue[500], accent: colors_1.lightBlue[200], background: colors_1.darkBlack[800], surface: colors_1.black[900], error: colors_1.red[200], text: colors_1.black[50], textSecondary: colors_1.black[200], placeholder: colors_1.black[200], onBackground: colors_1.black[50], onSurface: colors_1.black[50], notification: colors_1.lightBlue[200], disabled: color_1.default(colors_1.black[300]).alpha(0.36).rgb().string() }) });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Copyright (c) 2020-present, Eaton
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
7
|
+
**/
|
|
8
|
+
export declare const blueTheme: ReactNativePaper.Theme;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
Copyright (c) 2020-present, Eaton
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
8
|
+
**/
|
|
9
|
+
var __assign = (this && this.__assign) || function () {
|
|
10
|
+
__assign = Object.assign || function(t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
return __assign.apply(this, arguments);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.blueTheme = void 0;
|
|
22
|
+
var react_native_paper_1 = require("react-native-paper");
|
|
23
|
+
var colors_1 = require("@brightlayer-ui/colors");
|
|
24
|
+
var shared_1 = require("./shared");
|
|
25
|
+
exports.blueTheme = __assign(__assign({}, react_native_paper_1.DefaultTheme), { dark: false, roundness: 4, fonts: __assign(__assign({}, react_native_paper_1.configureFonts(shared_1.fontConfig)), { bold: {
|
|
26
|
+
fontFamily: "OpenSans-Bold",
|
|
27
|
+
fontWeight: "700",
|
|
28
|
+
} }), colors: __assign(__assign({}, react_native_paper_1.DefaultTheme.colors), { primary: colors_1.blue[500], primaryBase: colors_1.blue[500], accent: colors_1.lightBlue[500], background: colors_1.white[200], surface: colors_1.white[50], error: colors_1.red[500], text: colors_1.black[500], textSecondary: colors_1.black[300], onBackground: colors_1.black[500], onSurface: colors_1.black[500], notification: colors_1.lightBlue[500] }) });
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Copyright (c) 2021-present, Eaton
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
7
|
+
**/
|
|
8
|
+
export { blueTheme as blue } from './blueTheme';
|
|
9
|
+
export { blueDarkTheme as blueDark } from './blueDarkTheme';
|
|
10
|
+
export { blueDarkAltTheme as blueDarkAlt } from './blueDarkAltTheme';
|
|
11
|
+
declare global {
|
|
12
|
+
namespace ReactNativePaper {
|
|
13
|
+
interface ThemeColors {
|
|
14
|
+
primaryBase: string;
|
|
15
|
+
textSecondary: string;
|
|
16
|
+
}
|
|
17
|
+
interface ThemeFonts {
|
|
18
|
+
bold: ThemeFont;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
Copyright (c) 2021-present, Eaton
|
|
5
|
+
|
|
6
|
+
All rights reserved.
|
|
7
|
+
|
|
8
|
+
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
9
|
+
**/
|
|
10
|
+
var blueTheme_1 = require("./blueTheme");
|
|
11
|
+
Object.defineProperty(exports, "blue", { enumerable: true, get: function () { return blueTheme_1.blueTheme; } });
|
|
12
|
+
var blueDarkTheme_1 = require("./blueDarkTheme");
|
|
13
|
+
Object.defineProperty(exports, "blueDark", { enumerable: true, get: function () { return blueDarkTheme_1.blueDarkTheme; } });
|
|
14
|
+
var blueDarkAltTheme_1 = require("./blueDarkAltTheme");
|
|
15
|
+
Object.defineProperty(exports, "blueDarkAlt", { enumerable: true, get: function () { return blueDarkAltTheme_1.blueDarkAltTheme; } });
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
declare type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
2
|
+
export declare const fontConfig: {
|
|
3
|
+
default: {
|
|
4
|
+
regular: {
|
|
5
|
+
fontFamily: string;
|
|
6
|
+
fontWeight: FontWeight;
|
|
7
|
+
};
|
|
8
|
+
medium: {
|
|
9
|
+
fontFamily: string;
|
|
10
|
+
fontWeight: FontWeight;
|
|
11
|
+
};
|
|
12
|
+
light: {
|
|
13
|
+
fontFamily: string;
|
|
14
|
+
fontWeight: FontWeight;
|
|
15
|
+
};
|
|
16
|
+
thin: {
|
|
17
|
+
fontFamily: string;
|
|
18
|
+
fontWeight: FontWeight;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
ios: {
|
|
22
|
+
regular: {
|
|
23
|
+
fontFamily: string;
|
|
24
|
+
fontWeight: FontWeight;
|
|
25
|
+
};
|
|
26
|
+
medium: {
|
|
27
|
+
fontFamily: string;
|
|
28
|
+
fontWeight: FontWeight;
|
|
29
|
+
};
|
|
30
|
+
light: {
|
|
31
|
+
fontFamily: string;
|
|
32
|
+
fontWeight: FontWeight;
|
|
33
|
+
};
|
|
34
|
+
thin: {
|
|
35
|
+
fontFamily: string;
|
|
36
|
+
fontWeight: FontWeight;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
android: {
|
|
40
|
+
regular: {
|
|
41
|
+
fontFamily: string;
|
|
42
|
+
fontWeight: FontWeight;
|
|
43
|
+
};
|
|
44
|
+
medium: {
|
|
45
|
+
fontFamily: string;
|
|
46
|
+
fontWeight: FontWeight;
|
|
47
|
+
};
|
|
48
|
+
light: {
|
|
49
|
+
fontFamily: string;
|
|
50
|
+
fontWeight: FontWeight;
|
|
51
|
+
};
|
|
52
|
+
thin: {
|
|
53
|
+
fontFamily: string;
|
|
54
|
+
fontWeight: FontWeight;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export {};
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fontConfig = void 0;
|
|
4
|
+
var defaultFontConfig = {
|
|
5
|
+
regular: {
|
|
6
|
+
fontFamily: 'OpenSans-Regular',
|
|
7
|
+
fontWeight: '400',
|
|
8
|
+
},
|
|
9
|
+
medium: {
|
|
10
|
+
fontFamily: 'OpenSans-SemiBold',
|
|
11
|
+
fontWeight: '600',
|
|
12
|
+
},
|
|
13
|
+
light: {
|
|
14
|
+
fontFamily: 'OpenSans-Light',
|
|
15
|
+
fontWeight: '300',
|
|
16
|
+
},
|
|
17
|
+
thin: {
|
|
18
|
+
fontFamily: 'OpenSans-Light',
|
|
19
|
+
fontWeight: '100',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
exports.fontConfig = {
|
|
23
|
+
default: defaultFontConfig,
|
|
24
|
+
ios: defaultFontConfig,
|
|
25
|
+
android: defaultFontConfig,
|
|
26
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@brightlayer-ui/react-native-themes",
|
|
3
|
+
"author": "Brightlayer UI <brightlayer-ui@eaton.com>",
|
|
4
|
+
"license": "BSD-3-Clause",
|
|
5
|
+
"version": "5.2.0-beta.0",
|
|
6
|
+
"description": "React Native themes for Brightlayer UI applications",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"initialize": "bash scripts/initializeSubmodule.sh",
|
|
10
|
+
"install:showcase-ios": "cd demos/showcase && yarn && cd ios && pod install && cd ../../.. && yarn link:themes",
|
|
11
|
+
"install:showcase-android": "cd demos/showcase && yarn && cd ../.. && yarn link:themes",
|
|
12
|
+
"start": "yarn start:showcase",
|
|
13
|
+
"start:showcase": "yarn initialize && yarn start:showcase-ios",
|
|
14
|
+
"start:showcase-ios": "yarn initialize && yarn install:showcase-ios && cd demos/showcase && yarn ios",
|
|
15
|
+
"start:showcase-android": "yarn initialize && yarn install:showcase-android && cd demos/showcase && yarn android",
|
|
16
|
+
"build": "yarn && tsc",
|
|
17
|
+
"link:themes": "bash ./scripts/linkThemes.sh",
|
|
18
|
+
"test": "bash ./scripts/buildTest.sh",
|
|
19
|
+
"publish:package": "set npm_config_yes=true && npx -p @brightlayer-ui/publish blui-publish",
|
|
20
|
+
"tag:package": "npx -p @brightlayer-ui/tag blui-tag",
|
|
21
|
+
"update:submodule": "git submodule update --remote"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/brightlayer-ui/react-native-themes.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/brightlayer-ui/react-native-themes/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/brightlayer-ui/react-native-themes/tree/master",
|
|
31
|
+
"keywords": [
|
|
32
|
+
"Brightlayer",
|
|
33
|
+
"BrightlayerUI",
|
|
34
|
+
"themes",
|
|
35
|
+
"Eaton",
|
|
36
|
+
"React Native"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@brightlayer-ui/colors": "^3.0.0",
|
|
40
|
+
"color": "^3.1.3"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react-native-paper": "^3.0.0 || ^4.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/color": "^3.0.1",
|
|
47
|
+
"react-native-paper": "^4.0.0",
|
|
48
|
+
"typescript": "^3.7.2"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"package.json",
|
|
52
|
+
"README.md",
|
|
53
|
+
"LICENSE",
|
|
54
|
+
"CHANGELOG.md",
|
|
55
|
+
"/dist"
|
|
56
|
+
]
|
|
57
|
+
}
|