You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+24
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,30 @@
2
2
3
3
The following is a curated list of changes in the Enact project, newest changes on the top.
4
4
5
+
## [2.4.0] - 2019-03-04
6
+
7
+
-`moonstone``line-height` rule to base text CSS for both latin and non-latin locales
8
+
-`moonstone` support for high contrast colors in dark and light skin
9
+
-`moonstone/BodyText` prop `noWrap` which automatically adds `moonstone/Marquee` support as well as limits the content to only display one line of text
10
+
-`ui/BodyText` prop `component` to allow customization of the tag/component used to render its base element
11
+
-`ui/Repeater` prop `component` to allow customization of its base element
12
+
-`ui/Spinner` prop `paused` to halt the animation. Previously this was hard-coded "on", but now it can be toggled.
13
+
14
+
### Changed
15
+
16
+
-`moonstone/Spinner` visuals from 3 spinning balls to an energetic flexing line
17
+
-`ui/Changeable` and `ui/Toggleable` to warn when both `[defaultProp]` and `[prop]` are provided
18
+
19
+
### Fixed
20
+
21
+
-`moonstone/Panels` to set child's `autoFocus` prop to `default-element` when `index` increases
22
+
-`moonstone/Slider` to prevent gaining focus when clicked when disabled
23
+
-`moonstone/Slider` to prevent default browser scroll behavior when 5-way directional key is pressed on an active knob
24
+
-`moonstone/DatePicker` and `moonstone/TimePicker` to close with back/ESC
25
+
-`moonstone/DatePicker` and `moonstone/TimePicker` value handling when open on mount
26
+
-`moonstone/ContextualPopupDecorator` to correctly focus on popup content when opened
27
+
-`spotlight/Spottable` to prevent unnecessary updates due to focus changes
Copy file name to clipboardExpand all lines: docs/interoperability.md
+103-3
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,11 @@ Enact is a fantastic way to build apps. However, you're not limited to developin
8
8
only Enact components, nor are you prevented from using pieces of Enact in other React apps. You
9
9
can mix and match third-party libraries with Enact easily.
10
10
11
-
## Using Third-Party Components inside of Enact
11
+
## Using Third-Party Components Inside of Enact
12
+
12
13
When creating an app using `enact create`, it creates app boilerplate that is set up for a
13
14
`Moonstone` styled app. However, if you want to use another UI library like
14
-
[`material-ui`](https://material-ui.com/), [`reactstrap`](https://reactstrap.github.io/), or [`react-router`](https://reacttraining.com/react-router/), just use `npm install`.
15
+
[`material-ui`](https://material-ui.com/) (see: [Moonstone + material-ui example](https://codesandbox.io/s/l5my52r299)), [`reactstrap`](https://reactstrap.github.io/), or [`react-router`](https://reacttraining.com/react-router/), just use `npm install`.
15
16
16
17
You can include components just like you normally would by using `import`.
17
18
@@ -37,7 +38,10 @@ For libraries like bootstrap, you can also import the css in your `App.less` fil
37
38
38
39
The advantage of this is you get to use Enact's `cli` to develop, test, and build applications.
39
40
40
-
## Using Enact outside of Enact
41
+
There is also a [Moonstone starter template](https://codesandbox.io/s/z2wnj3jznx) on CodeSandbox that can be used to quickly test
42
+
how third-party libraries and components can be used with Enact.
43
+
44
+
## Using Enact Outside of Enact
41
45
If you're using something like `create-react-app`, it's pretty easy to use Enact as a module.
42
46
43
47
You can create a new application, as follows:
@@ -64,6 +68,102 @@ const App = kind({
64
68
});
65
69
```
66
70
71
+
You can even use `Moonstone` themed components after installing `@enact/moonstone`.
Behind the scenes, Enact supports using CSS modules and most Enact components provide public class
98
+
names that can be overridden to easily change their style.
99
+
100
+
#### CRA Example
101
+
102
+
If you are using `react-scripts` version `2.0.0` or later, you can import style overrides by using
103
+
the `[component].module.css` filename convention. For earlier versions, you will need to eject
104
+
the CRA app and modify the webpack configuration to enable CSS modules. This [article](https://medium.com/nulogy/how-to-use-css-modules-with-create-react-app-9e44bec2b5c2)
105
+
is a good reference for enabling CSS modules prior to `2.0.0`.
In order to use the [`@enact/i18n`](../../developer-guide/i18n) library for internationalization, you can [eject](https://facebook.github.io/create-react-app/docs/available-scripts#npm-run-eject)
139
+
your CRA app, install your required Enact libraries (plus, `@enact/dev-utils`), and update the webpack configuration.
Copy file name to clipboardExpand all lines: docs/theming.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,10 @@ Components built with the `kind` feature can use the `publicClassNames` key in t
14
14
15
15
Sometimes, behavior is built into a component, but no visual qualities are assigned to that behavior. For example, Enact handles the `selected` state of a `Button`, and it's implemented in our `ui` package, so it's universally available to all themes. `ui` has no opinion on how this state is visually represented, so it simply exports a blank class that the consuming theme can style to its liking.
16
16
17
-
Here's a simplified example of `ui/Button/Button.less`:
17
+
Here's a simplified example of `ui/Button/Button.module.less`:
18
18
19
19
```css
20
-
// Button.less
20
+
// Button.module.less
21
21
//
22
22
@import"../styles/mixins.less";
23
23
@@ -52,7 +52,7 @@ import React from 'react';
52
52
importkindfrom'@enact/core/kind';
53
53
importUiButtonfrom'@enact/ui/Button';
54
54
55
-
importcomponentCssfrom'./Button.less';
55
+
importcomponentCssfrom'./Button.module.less';
56
56
57
57
constButton=kind({
58
58
name:'CustomizedButton',
@@ -110,7 +110,7 @@ When creating customizable components it may be helpful to understand how the th
110
110
When a LESS or CSS file is imported, the classes are inventoried and a hash map is generated of original class names to obfuscated modularized class names: `{original: obfuscated}`. Your module now has a map of all of the class names you referenced. Normally, when using `kind()` you simply pass this into the `styles` block, and indicate which one is your base class, with the `className` key.
111
111
112
112
```javascript
113
-
importcssfrom'./Button.less';
113
+
importcssfrom'./Button.module.less';
114
114
...
115
115
{
116
116
css, // Via ES6, the `css` variable is converted to {'css': css}
0 commit comments