@purple/phoenix-components 4.25.0 → 4.27.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 +18 -0
- package/README.md +25 -6
- package/dist/bundle.cjs.js +1 -1
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.esm.js +2 -2
- package/dist/bundle.esm.js.map +1 -1
- package/dist/bundle.umd.js +1 -1
- package/dist/bundle.umd.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [4.27.0](https://github.com/purple-technology/phoenix-components/compare/v4.26.0...v4.27.0) (2022-05-31)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **Box:** add border props ([40bd27b](https://github.com/purple-technology/phoenix-components/commit/40bd27b63c63fe66a8e8ec628c0e10813671c14e))
|
|
11
|
+
* **FileUpload:** button text on touch devices ([93cdacf](https://github.com/purple-technology/phoenix-components/commit/93cdacfa232598d3ea1c5b03d7482500372e4cdb))
|
|
12
|
+
* **FileUpload:** label for touch devices ([7eaf82e](https://github.com/purple-technology/phoenix-components/commit/7eaf82e283c1dc482a22df40b7ffde802e9993af))
|
|
13
|
+
* **Label:** add padding and margin props ([c3770f4](https://github.com/purple-technology/phoenix-components/commit/c3770f4f74a8c2c46a44e5671cf1ee4bbaf74a6e))
|
|
14
|
+
* **List:** better suport for RTL languages ([eda6704](https://github.com/purple-technology/phoenix-components/commit/eda6704f9414f39a4a70da3a9d6efcfeba69d079))
|
|
15
|
+
|
|
16
|
+
## [4.26.0](https://github.com/purple-technology/phoenix-components/compare/v4.25.0...v4.26.0) (2022-05-03)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* disabled button ([e8fdd77](https://github.com/purple-technology/phoenix-components/commit/e8fdd77ccdd5fd7a767b6cd359ced746fe1728df))
|
|
22
|
+
|
|
5
23
|
## [4.25.0](https://github.com/purple-technology/phoenix-components/compare/v4.24.2...v4.25.0) (2022-05-03)
|
|
6
24
|
|
|
7
25
|
|
package/README.md
CHANGED
|
@@ -30,25 +30,27 @@ Phoenix Components takes advantage of some 3rd party libraries to create consist
|
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
|
33
|
-
1.
|
|
33
|
+
1. Phoenix components use by default Roboto font with weights 400 and 500. If you want to use this default font, please add it to your project, using for example Google Fonts. (If you want to use different font family and/or different font weights, please refer to the section Customization.)
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
36
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
37
37
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
2. Import `Theme` from Phoenix Components and wrap the app in `<ThemeProvider>` from `styled-components` providing the `Theme` object. If your repository already contains custom `styled-components` theme, merge both themes together.
|
|
40
|
+
2. Import `Theme` from Phoenix Components and wrap the app in `<ThemeProvider>` from `styled-components` providing the `Theme` object. If your repository already contains custom `styled-components` theme, merge both themes together. If you're going to use overrides inside `$pc` key (see the Customization section), you need to use deep merge (e.g. `merge` from `lodash`).
|
|
41
41
|
|
|
42
42
|
Also, import `<GlobalStyles>` component which provides styles such as default font and sizes, and include it once in your project.
|
|
43
43
|
|
|
44
44
|
```typescript
|
|
45
|
+
import merge from 'lodash/merge'
|
|
45
46
|
import { ThemeProvider } from 'styled-components'
|
|
46
|
-
import { GlobalStyles, Theme } from '@purple/phoenix-components'
|
|
47
|
+
import { GlobalStyles, Theme as PhoenixTheme } from '@purple/phoenix-components'
|
|
48
|
+
import { Theme } from './CustomAppTheme'
|
|
47
49
|
...
|
|
48
50
|
|
|
49
51
|
function App() {
|
|
50
52
|
return (
|
|
51
|
-
<ThemeProvider theme={Theme}>
|
|
53
|
+
<ThemeProvider theme={merge(PhoenixTheme, Theme)}>
|
|
52
54
|
<GlobalStyles />
|
|
53
55
|
{ ... your app ... }
|
|
54
56
|
</ThemeProvider>
|
|
@@ -60,7 +62,7 @@ You can optionally include `dir` key in the theme with values either `'ltr'` or
|
|
|
60
62
|
|
|
61
63
|
```typescript
|
|
62
64
|
...
|
|
63
|
-
<ThemeProvider theme={{ dir: 'rtl',
|
|
65
|
+
<ThemeProvider theme={merge({ dir: 'rtl' }, Theme)}>
|
|
64
66
|
...
|
|
65
67
|
```
|
|
66
68
|
|
|
@@ -84,7 +86,24 @@ const StyledInput = styled(TextInput)`
|
|
|
84
86
|
`
|
|
85
87
|
```
|
|
86
88
|
|
|
87
|
-
Or you can
|
|
89
|
+
Or you can override the default properties inside the `$pc` object. In your own theme file, define the overrides as shown below, deep merge your theme file with the Phoenix theme file, and provide it to `ThemeProvider`.
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
export const Theme = {
|
|
93
|
+
...
|
|
94
|
+
|
|
95
|
+
// overriding phoenix components defaults
|
|
96
|
+
$pc: {
|
|
97
|
+
fontFamily: 'Mulish, sans-serif',
|
|
98
|
+
fontWeight: {
|
|
99
|
+
regular: 400,
|
|
100
|
+
bold: 600
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
For more information about what's possible to customize please refer directly to the file `src/theme.tsx`.
|
|
88
107
|
|
|
89
108
|
|
|
90
109
|
## 🔼 Migration guide from v3 to v4
|