Minor fixes

Close #2264
Close #2275
This commit is contained in:
Nicolas Gallagher
2022-06-10 10:13:14 -07:00
committed by Nicolas Gallagher
parent 3326aab292
commit 8034a57aae
8 changed files with 31 additions and 48 deletions
+7 -10
View File
@@ -15,16 +15,13 @@ const styles = StyleSheet.create({
const createIcon = (children) => {
const Icon = (props) =>
createElement(
'svg',
{
style: StyleSheet.compose(styles.root, props.style),
width: 24,
height: 24,
viewBox: '0 0 24 24'
},
children
);
createElement('svg', {
children,
style: StyleSheet.compose(styles.root, props.style),
width: 24,
height: 24,
viewBox: '0 0 24 24'
});
return Icon;
};
@@ -243,7 +243,7 @@ The `focusable` prop determines whether a component is user-focusable and appear
```
:::callout
**Did you know?** Any element (including elements not in the keybaord tab flow) can be programmatically focused via `UIManager.focus(viewRef.current)`.
**Did you know?** Any element (including elements not in the keyboard tab flow) can be programmatically focused via `UIManager.focus(viewRef.current)`.
:::
### Accessible HTML
+1 -1
View File
@@ -22,7 +22,7 @@
"normalize-css-color": "^1.0.2",
"postcss-value-parser": "^4.2.0",
"prop-types": "^15.6.0",
"styleq": "0.0.0-afc6b2c59"
"styleq": "0.1.0"
},
"peerDependencies": {
"react": ">=17.0.2",
+5 -4
View File
@@ -9,7 +9,7 @@
import { atomic, classic, inline } from './compiler';
import { createSheet } from './dom';
import { localizeStyle } from 'styleq/dist/transform-localize-style';
import { localizeStyle } from 'styleq/transform-localize-style';
import { preprocess } from './preprocess';
import { styleq } from 'styleq';
import { validate } from './validate';
@@ -22,8 +22,8 @@ const sheet = createSheet();
function customStyleq(styles, isRTL) {
return styleq.factory({
transform(style) {
if (staticStyleMap.has(style)) {
const compiledStyle = staticStyleMap.get(style);
const compiledStyle = staticStyleMap.get(style);
if (compiledStyle != null) {
return localizeStyle(compiledStyle, isRTL);
}
return style;
@@ -71,7 +71,8 @@ const absoluteFill = create({ x: { ...absoluteFillObject } }).x;
function create(styles: Object): {| [key: string]: { [key: string]: any } |} {
Object.keys(styles).forEach((key) => {
const styleObj = styles[key];
if (styleObj != null) {
// Only compile at runtime if the style is not already compiled
if (styleObj != null && styleObj.$$css !== true) {
let compiledStyles;
if (key.indexOf('$raw') > -1) {
compiledStyles = compileAndInsertReset(styleObj, key.split('$raw')[0]);