@niibase/uniwind 1.6.1 → 1.6.2
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 +24 -0
- package/dist/common/common/utils.js +8 -0
- package/dist/common/components/native/ActivityIndicator.js +2 -1
- package/dist/common/components/native/Button.js +2 -2
- package/dist/common/components/native/FlatList.js +2 -1
- package/dist/common/components/native/Image.js +2 -1
- package/dist/common/components/native/ImageBackground.js +2 -1
- package/dist/common/components/native/InputAccessoryView.js +2 -1
- package/dist/common/components/native/Modal.js +2 -1
- package/dist/common/components/native/RefreshControl.js +5 -4
- package/dist/common/components/native/ScrollView.js +2 -1
- package/dist/common/components/native/SectionList.js +2 -1
- package/dist/common/components/native/Switch.js +5 -4
- package/dist/common/components/native/Text.js +2 -1
- package/dist/common/components/native/TextInput.js +6 -5
- package/dist/common/components/native/TouchableHighlight.js +2 -1
- package/dist/common/components/native/VirtualizedList.js +2 -1
- package/dist/common/components/native/useAccentColor.js +19 -0
- package/dist/common/components/react-native-gesture-handler/native/FlatList.js +2 -1
- package/dist/common/components/react-native-gesture-handler/native/RefreshControl.js +5 -4
- package/dist/common/components/react-native-gesture-handler/native/Text.js +2 -1
- package/dist/common/components/react-native-gesture-handler/native/TextInput.js +5 -4
- package/dist/common/components/web/ActivityIndicator.js +2 -2
- package/dist/common/components/web/Button.js +2 -2
- package/dist/common/components/web/Image.js +2 -1
- package/dist/common/components/web/ImageBackground.js +2 -2
- package/dist/common/components/web/Switch.js +4 -4
- package/dist/common/components/web/TextInput.js +2 -2
- package/dist/common/components/web/TouchableHighlight.js +2 -2
- package/dist/common/components/web/useUniwindAccent.js +20 -0
- package/dist/common/hoc/withUniwind.js +7 -0
- package/dist/common/hoc/withUniwind.native.js +7 -0
- package/dist/common/hooks/index.js +0 -11
- package/dist/metro/index.cjs +1 -1
- package/dist/metro/index.mjs +1 -1
- package/dist/metro/metro-transformer.cjs +12 -10
- package/dist/metro/metro-transformer.mjs +6 -4
- package/dist/module/common/utils.d.ts +1 -0
- package/dist/module/common/utils.js +1 -0
- package/dist/module/components/native/ActivityIndicator.js +2 -1
- package/dist/module/components/native/Button.js +2 -2
- package/dist/module/components/native/FlatList.js +2 -1
- package/dist/module/components/native/Image.js +2 -1
- package/dist/module/components/native/ImageBackground.js +2 -1
- package/dist/module/components/native/InputAccessoryView.js +2 -1
- package/dist/module/components/native/Modal.js +2 -1
- package/dist/module/components/native/RefreshControl.js +5 -4
- package/dist/module/components/native/ScrollView.js +2 -1
- package/dist/module/components/native/SectionList.js +2 -1
- package/dist/module/components/native/Switch.js +5 -4
- package/dist/module/components/native/Text.js +2 -1
- package/dist/module/components/native/TextInput.js +6 -5
- package/dist/module/components/native/TouchableHighlight.js +2 -1
- package/dist/module/components/native/VirtualizedList.js +2 -1
- package/dist/module/components/native/useAccentColor.d.ts +2 -0
- package/dist/module/components/native/useAccentColor.js +14 -0
- package/dist/module/components/react-native-gesture-handler/native/FlatList.js +2 -1
- package/dist/module/components/react-native-gesture-handler/native/RefreshControl.js +5 -4
- package/dist/module/components/react-native-gesture-handler/native/Text.js +2 -1
- package/dist/module/components/react-native-gesture-handler/native/TextInput.js +5 -4
- package/dist/module/components/web/ActivityIndicator.js +1 -1
- package/dist/module/components/web/Button.js +1 -1
- package/dist/module/components/web/Image.js +2 -1
- package/dist/module/components/web/ImageBackground.js +1 -1
- package/dist/module/components/web/Switch.js +1 -1
- package/dist/module/components/web/TextInput.js +1 -1
- package/dist/module/components/web/TouchableHighlight.js +1 -1
- package/dist/module/components/web/useUniwindAccent.js +15 -0
- package/dist/module/hoc/withUniwind.js +9 -0
- package/dist/module/hoc/withUniwind.native.js +9 -0
- package/dist/module/hooks/index.d.ts +0 -1
- package/dist/module/hooks/index.js +0 -1
- package/dist/shared/{uniwind.C-rHhHOg.mjs → uniwind.BGiqYvxb.mjs} +1 -1
- package/dist/shared/{uniwind.nl8746mK.cjs → uniwind.Cv73KtI-.cjs} +0 -2
- package/dist/shared/{uniwind.F-0-Rr--.mjs → uniwind.PtWWxxnh.mjs} +1 -2
- package/dist/shared/{uniwind.BZyFsest.cjs → uniwind.r2i22V6d.cjs} +1 -1
- package/dist/vite/index.cjs +2 -2
- package/dist/vite/index.mjs +2 -2
- package/package.json +1 -1
- package/src/common/utils.ts +1 -0
- package/src/components/native/ActivityIndicator.tsx +2 -1
- package/src/components/native/Button.tsx +2 -2
- package/src/components/native/FlatList.tsx +2 -1
- package/src/components/native/Image.tsx +2 -1
- package/src/components/native/ImageBackground.tsx +2 -1
- package/src/components/native/InputAccessoryView.tsx +2 -1
- package/src/components/native/Modal.tsx +2 -1
- package/src/components/native/RefreshControl.tsx +5 -4
- package/src/components/native/ScrollView.tsx +2 -1
- package/src/components/native/SectionList.tsx +2 -1
- package/src/components/native/Switch.tsx +5 -4
- package/src/components/native/Text.tsx +2 -1
- package/src/components/native/TextInput.tsx +6 -5
- package/src/components/native/TouchableHighlight.tsx +2 -1
- package/src/components/native/VirtualizedList.tsx +2 -1
- package/src/components/native/useAccentColor.ts +19 -0
- package/src/components/react-native-gesture-handler/native/FlatList.tsx +2 -1
- package/src/components/react-native-gesture-handler/native/RefreshControl.tsx +5 -4
- package/src/components/react-native-gesture-handler/native/Text.tsx +2 -1
- package/src/components/react-native-gesture-handler/native/TextInput.tsx +5 -4
- package/src/components/web/ActivityIndicator.tsx +1 -1
- package/src/components/web/Button.tsx +1 -1
- package/src/components/web/Image.tsx +2 -1
- package/src/components/web/ImageBackground.tsx +1 -1
- package/src/components/web/Switch.tsx +1 -1
- package/src/components/web/TextInput.tsx +1 -1
- package/src/components/web/TouchableHighlight.tsx +1 -1
- package/src/components/web/useUniwindAccent.ts +21 -0
- package/src/hoc/withUniwind.native.tsx +11 -0
- package/src/hoc/withUniwind.tsx +11 -0
- package/src/hooks/index.ts +0 -1
- package/src/metro/addMetaToStylesTemplate.ts +2 -1
- package/src/metro/metro-transformer.ts +2 -2
- package/src/metro/processor/css.ts +3 -1
- package/src/metro/processor/rn.ts +2 -1
- package/src/metro/utils/common.ts +0 -2
- package/dist/common/components/native/TextInput.android.js +0 -52
- package/dist/common/hooks/useUniwindAccent.js +0 -13
- package/dist/module/components/native/TextInput.android.d.ts +0 -3
- package/dist/module/components/native/TextInput.android.js +0 -49
- package/dist/module/hooks/useUniwindAccent.js +0 -6
- package/src/components/native/TextInput.android.tsx +0 -51
- package/src/hooks/useUniwindAccent.ts +0 -10
- /package/dist/module/{hooks → components/web}/useUniwindAccent.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## What's Changed in 1.6.2
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### 🐛 Bug Fixes
|
|
6
|
+
|
|
7
|
+
* remove android specific component file for text input by @divineniiquaye
|
|
8
|
+
* resolve accent colors via useAccentColor (rngh) by @divineniiquaye
|
|
9
|
+
* read absolute cssPath instead of relative one in metro-transformer (#485) by @Brentlok
|
|
10
|
+
* css file transforming for special setups (#483) by @Brentlok
|
|
11
|
+
|
|
12
|
+
### 🏠 Chores
|
|
13
|
+
|
|
14
|
+
* add missing accent-* warning in dev (#479) by @Brentlok
|
|
15
|
+
|
|
16
|
+
### 📦 Other
|
|
17
|
+
|
|
18
|
+
* Merge branch 'orig' by @divineniiquaye
|
|
19
|
+
* fix generating changelog was missing new lines in groups (#478) by @Brentlok
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
**Full Changelog**: https://github.com/divineniiquaye/uniwind/compare/v1.6.1...v1.6.2
|
|
23
|
+
|
|
24
|
+
|
|
1
25
|
## What's Changed in 1.6.1
|
|
2
26
|
|
|
3
27
|
|
|
@@ -7,6 +7,7 @@ module.exports = exports.ActivityIndicator = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const ActivityIndicator = exports.ActivityIndicator = (0, _utils.copyComponentProperties)(_reactNative.ActivityIndicator, props => {
|
|
12
13
|
const {
|
|
@@ -15,7 +16,7 @@ const ActivityIndicator = exports.ActivityIndicator = (0, _utils.copyComponentPr
|
|
|
15
16
|
} = (0, _useStyle.useStyle)(_reactNative.ActivityIndicator, props.className, props, {
|
|
16
17
|
isPressed: Boolean(props.animating)
|
|
17
18
|
});
|
|
18
|
-
const color = (0,
|
|
19
|
+
const color = (0, _useAccentColor.useAccentColor)(props.colorClassName, props);
|
|
19
20
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
20
21
|
...props,
|
|
21
22
|
style: [style, props.style],
|
|
@@ -7,9 +7,9 @@ module.exports = exports.Button = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
-
var
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
11
11
|
const Button = exports.Button = (0, _utils.copyComponentProperties)(_reactNative.Button, props => {
|
|
12
|
-
const color = (0,
|
|
12
|
+
const color = (0, _useAccentColor.useAccentColor)(props.colorClassName, props);
|
|
13
13
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNative.Button, {
|
|
14
14
|
...props,
|
|
15
15
|
color: props.color ?? color
|
|
@@ -7,6 +7,7 @@ module.exports = exports.FlatList = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const FlatList = exports.FlatList = (0, _utils.copyComponentProperties)(_reactNative.FlatList, props => {
|
|
12
13
|
const {
|
|
@@ -17,7 +18,7 @@ const FlatList = exports.FlatList = (0, _utils.copyComponentProperties)(_reactNa
|
|
|
17
18
|
const styleContentContainer = (0, _useStyle.useStyle)(props.contentContainerClassName, props);
|
|
18
19
|
const styleListFooterComponent = (0, _useStyle.useStyle)(props.ListFooterComponentClassName, props);
|
|
19
20
|
const styleListHeaderComponent = (0, _useStyle.useStyle)(props.ListHeaderComponentClassName, props);
|
|
20
|
-
const endFillColor = (0,
|
|
21
|
+
const endFillColor = (0, _useAccentColor.useAccentColor)(props.endFillColorClassName, props);
|
|
21
22
|
const hasSingleColumn = !("numColumns" in props) || props.numColumns === 1;
|
|
22
23
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
23
24
|
...props,
|
|
@@ -7,13 +7,14 @@ module.exports = exports.Image = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const Image = exports.Image = (0, _utils.copyComponentProperties)(_reactNative.Image, props => {
|
|
12
13
|
const {
|
|
13
14
|
Component,
|
|
14
15
|
style
|
|
15
16
|
} = (0, _useStyle.useStyle)(_reactNative.Image, props.className, props);
|
|
16
|
-
const tintColor = (0,
|
|
17
|
+
const tintColor = (0, _useAccentColor.useAccentColor)(props.tintColorClassName, props);
|
|
17
18
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
18
19
|
...props,
|
|
19
20
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.ImageBackground = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const ImageBackground = exports.ImageBackground = (0, _utils.copyComponentProperties)(_reactNative.ImageBackground, props => {
|
|
12
13
|
const {
|
|
@@ -14,7 +15,7 @@ const ImageBackground = exports.ImageBackground = (0, _utils.copyComponentProper
|
|
|
14
15
|
style
|
|
15
16
|
} = (0, _useStyle.useStyle)(_reactNative.ImageBackground, props.className, props);
|
|
16
17
|
const imageStyle = (0, _useStyle.useStyle)(props.imageClassName, props);
|
|
17
|
-
const tintColor = (0,
|
|
18
|
+
const tintColor = (0, _useAccentColor.useAccentColor)(props.tintColorClassName, props);
|
|
18
19
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
19
20
|
...props,
|
|
20
21
|
style: [style, props.style],
|
|
@@ -7,13 +7,14 @@ module.exports = exports.InputAccessoryView = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const InputAccessoryView = exports.InputAccessoryView = (0, _utils.copyComponentProperties)(_reactNative.InputAccessoryView, props => {
|
|
12
13
|
const {
|
|
13
14
|
Component,
|
|
14
15
|
style
|
|
15
16
|
} = (0, _useStyle.useStyle)(_reactNative.InputAccessoryView, props.className, props);
|
|
16
|
-
const backgroundColor = (0,
|
|
17
|
+
const backgroundColor = (0, _useAccentColor.useAccentColor)(props.backgroundColorClassName, props);
|
|
17
18
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
18
19
|
...props,
|
|
19
20
|
backgroundColor: props.backgroundColor ?? backgroundColor,
|
|
@@ -7,13 +7,14 @@ module.exports = exports.Modal = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const Modal = exports.Modal = (0, _utils.copyComponentProperties)(_reactNative.Modal, props => {
|
|
12
13
|
const {
|
|
13
14
|
Component,
|
|
14
15
|
style
|
|
15
16
|
} = (0, _useStyle.useStyle)(_reactNative.Modal, props.className, props);
|
|
16
|
-
const backdropColor = (0,
|
|
17
|
+
const backdropColor = (0, _useAccentColor.useAccentColor)(props.backdropColorClassName, props);
|
|
17
18
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
18
19
|
...props,
|
|
19
20
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.RefreshControl = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const RefreshControl = exports.RefreshControl = (0, _utils.copyComponentProperties)(_reactNative.RefreshControl, props => {
|
|
12
13
|
const {
|
|
@@ -15,10 +16,10 @@ const RefreshControl = exports.RefreshControl = (0, _utils.copyComponentProperti
|
|
|
15
16
|
} = (0, _useStyle.useStyle)(_reactNative.RefreshControl, props.className, props, {
|
|
16
17
|
isPressed: Boolean(props.refreshing)
|
|
17
18
|
});
|
|
18
|
-
const color = (0,
|
|
19
|
-
const tintColor = (0,
|
|
20
|
-
const titleColor = (0,
|
|
21
|
-
const progressBackgroundColor = (0,
|
|
19
|
+
const color = (0, _useAccentColor.useAccentColor)(props.colorsClassName, props);
|
|
20
|
+
const tintColor = (0, _useAccentColor.useAccentColor)(props.tintColorClassName, props);
|
|
21
|
+
const titleColor = (0, _useAccentColor.useAccentColor)(props.titleColorClassName, props);
|
|
22
|
+
const progressBackgroundColor = (0, _useAccentColor.useAccentColor)(props.progressBackgroundColorClassName, props);
|
|
22
23
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
23
24
|
...props,
|
|
24
25
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.ScrollView = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const ScrollView = exports.ScrollView = (0, _utils.copyComponentProperties)(_reactNative.ScrollView, props => {
|
|
12
13
|
const {
|
|
@@ -14,7 +15,7 @@ const ScrollView = exports.ScrollView = (0, _utils.copyComponentProperties)(_rea
|
|
|
14
15
|
style
|
|
15
16
|
} = (0, _useStyle.useStyle)(_reactNative.ScrollView, props.className, props);
|
|
16
17
|
const contentContainerStyle = (0, _useStyle.useStyle)(props.contentContainerClassName, props);
|
|
17
|
-
const endFillColor = (0,
|
|
18
|
+
const endFillColor = (0, _useAccentColor.useAccentColor)(props.endFillColorClassName, props);
|
|
18
19
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
19
20
|
...props,
|
|
20
21
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.SectionList = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const SectionList = exports.SectionList = (0, _utils.copyComponentProperties)(_reactNative.SectionList, props => {
|
|
12
13
|
const {
|
|
@@ -16,7 +17,7 @@ const SectionList = exports.SectionList = (0, _utils.copyComponentProperties)(_r
|
|
|
16
17
|
const contentContainerStyle = (0, _useStyle.useStyle)(props.contentContainerClassName, props);
|
|
17
18
|
const listFooterComponentStyle = (0, _useStyle.useStyle)(props.ListFooterComponentClassName, props);
|
|
18
19
|
const listHeaderComponentStyle = (0, _useStyle.useStyle)(props.ListHeaderComponentClassName, props);
|
|
19
|
-
const endFillColor = (0,
|
|
20
|
+
const endFillColor = (0, _useAccentColor.useAccentColor)(props.endFillColorClassName, props);
|
|
20
21
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
21
22
|
...props,
|
|
22
23
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.Switch = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const Switch = exports.Switch = (0, _utils.copyComponentProperties)(_reactNative.Switch, props => {
|
|
12
13
|
const state = {
|
|
@@ -17,10 +18,10 @@ const Switch = exports.Switch = (0, _utils.copyComponentProperties)(_reactNative
|
|
|
17
18
|
Component,
|
|
18
19
|
style
|
|
19
20
|
} = (0, _useStyle.useStyle)(_reactNative.Switch, props.className, props, state);
|
|
20
|
-
const trackColorOn = (0,
|
|
21
|
-
const trackColorOff = (0,
|
|
22
|
-
const thumbColor = (0,
|
|
23
|
-
const ios_backgroundColor = (0,
|
|
21
|
+
const trackColorOn = (0, _useAccentColor.useAccentColor)(props.trackColorOnClassName, props, state);
|
|
22
|
+
const trackColorOff = (0, _useAccentColor.useAccentColor)(props.trackColorOffClassName, props, state);
|
|
23
|
+
const thumbColor = (0, _useAccentColor.useAccentColor)(props.thumbColorClassName, props, state);
|
|
24
|
+
const ios_backgroundColor = (0, _useAccentColor.useAccentColor)(props.ios_backgroundColorClassName, props, state);
|
|
24
25
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
25
26
|
...props,
|
|
26
27
|
style: [style, props.style],
|
|
@@ -8,6 +8,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _utils = require("../utils");
|
|
11
|
+
var _useAccentColor = require("./useAccentColor");
|
|
11
12
|
var _useStyle = require("./useStyle");
|
|
12
13
|
const Text = exports.Text = (0, _utils.copyComponentProperties)(_reactNative.Text, props => {
|
|
13
14
|
const [isPressed, setIsPressed] = (0, _react.useState)(false);
|
|
@@ -19,7 +20,7 @@ const Text = exports.Text = (0, _utils.copyComponentProperties)(_reactNative.Tex
|
|
|
19
20
|
Component,
|
|
20
21
|
style
|
|
21
22
|
} = (0, _useStyle.useStyle)(_reactNative.Text, props.className, props, state);
|
|
22
|
-
const selectionColor = (0,
|
|
23
|
+
const selectionColor = (0, _useAccentColor.useAccentColor)(props.selectionColorClassName, props, state);
|
|
23
24
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
24
25
|
...props,
|
|
25
26
|
style: [style, props.style],
|
|
@@ -8,6 +8,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _utils = require("../utils");
|
|
11
|
+
var _useAccentColor = require("./useAccentColor");
|
|
11
12
|
var _useStyle = require("./useStyle");
|
|
12
13
|
const TextInput = exports.TextInput = (0, _utils.copyComponentProperties)(_reactNative.TextInput, props => {
|
|
13
14
|
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
@@ -21,11 +22,11 @@ const TextInput = exports.TextInput = (0, _utils.copyComponentProperties)(_react
|
|
|
21
22
|
Component,
|
|
22
23
|
style
|
|
23
24
|
} = (0, _useStyle.useStyle)(_reactNative.TextInput, props.className, props, state);
|
|
24
|
-
const cursorColor = (0,
|
|
25
|
-
const selectionColor = (0,
|
|
26
|
-
const placeholderTextColor = (0,
|
|
27
|
-
const selectionHandleColor = (0,
|
|
28
|
-
const underlineColorAndroid = (0,
|
|
25
|
+
const cursorColor = (0, _useAccentColor.useAccentColor)(props.cursorColorClassName, props, state);
|
|
26
|
+
const selectionColor = (0, _useAccentColor.useAccentColor)(props.selectionColorClassName, props, state);
|
|
27
|
+
const placeholderTextColor = (0, _useAccentColor.useAccentColor)(props.placeholderTextColorClassName, props, state);
|
|
28
|
+
const selectionHandleColor = (0, _useAccentColor.useAccentColor)(props.selectionHandleColorClassName, props, state);
|
|
29
|
+
const underlineColorAndroid = (0, _useAccentColor.useAccentColor)(props.underlineColorAndroidClassName, props, state);
|
|
29
30
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
30
31
|
...props,
|
|
31
32
|
style: [style, props.style],
|
|
@@ -8,6 +8,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _utils = require("../utils");
|
|
11
|
+
var _useAccentColor = require("./useAccentColor");
|
|
11
12
|
var _useStyle = require("./useStyle");
|
|
12
13
|
const TouchableHighlight = exports.TouchableHighlight = (0, _utils.copyComponentProperties)(_reactNative.TouchableHighlight, props => {
|
|
13
14
|
const [isPressed, setIsPressed] = (0, _react.useState)(false);
|
|
@@ -21,7 +22,7 @@ const TouchableHighlight = exports.TouchableHighlight = (0, _utils.copyComponent
|
|
|
21
22
|
Component,
|
|
22
23
|
style
|
|
23
24
|
} = (0, _useStyle.useStyle)(_reactNative.TouchableHighlight, props.className, props, state);
|
|
24
|
-
const underlayColor = (0,
|
|
25
|
+
const underlayColor = (0, _useAccentColor.useAccentColor)(props.underlayColorClassName, props, state);
|
|
25
26
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
26
27
|
...props,
|
|
27
28
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.VirtualizedList = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
+
var _useAccentColor = require("./useAccentColor");
|
|
10
11
|
var _useStyle = require("./useStyle");
|
|
11
12
|
const VirtualizedList = exports.VirtualizedList = (0, _utils.copyComponentProperties)(_reactNative.VirtualizedList, props => {
|
|
12
13
|
const {
|
|
@@ -16,7 +17,7 @@ const VirtualizedList = exports.VirtualizedList = (0, _utils.copyComponentProper
|
|
|
16
17
|
const contentContainerStyle = (0, _useStyle.useStyle)(props.contentContainerClassName, props);
|
|
17
18
|
const listFooterComponentStyle = (0, _useStyle.useStyle)(props.ListFooterComponentClassName, props);
|
|
18
19
|
const listHeaderComponentStyle = (0, _useStyle.useStyle)(props.ListHeaderComponentClassName, props);
|
|
19
|
-
const endFillColor = (0,
|
|
20
|
+
const endFillColor = (0, _useAccentColor.useAccentColor)(props.endFillColorClassName, props);
|
|
20
21
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Component, {
|
|
21
22
|
...props,
|
|
22
23
|
style: [style, props.style],
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAccentColor = void 0;
|
|
7
|
+
var _utils = require("../../common/utils");
|
|
8
|
+
var _logger = require("../../core/logger");
|
|
9
|
+
var _useStyle = require("./useStyle");
|
|
10
|
+
let warnedOnce = false;
|
|
11
|
+
const useAccentColor = (className, componentProps, state) => {
|
|
12
|
+
const styles = (0, _useStyle.useStyle)(className, componentProps, state);
|
|
13
|
+
if (__DEV__ && !warnedOnce && (0, _utils.isDefined)(className) && className.trim() !== "" && styles.accentColor === void 0) {
|
|
14
|
+
warnedOnce = true;
|
|
15
|
+
_logger.Logger.warn(`className '${className}' was provided to extract accentColor but no color was found. Make sure the className includes a color utility (e.g., 'accent-red-500', 'accent-blue-600'). See https://docs.uniwind.dev/class-names#the-accent-prefix`);
|
|
16
|
+
}
|
|
17
|
+
return styles.accentColor;
|
|
18
|
+
};
|
|
19
|
+
exports.useAccentColor = useAccentColor;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.FlatList = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
9
|
+
var _useAccentColor = require("../../native/useAccentColor");
|
|
9
10
|
var _useStyle = require("../../native/useStyle");
|
|
10
11
|
var _utils = require("../../utils");
|
|
11
12
|
const FlatList = exports.FlatList = (0, _utils.copyComponentProperties)(_reactNativeGestureHandler.FlatList, props => {
|
|
@@ -14,7 +15,7 @@ const FlatList = exports.FlatList = (0, _utils.copyComponentProperties)(_reactNa
|
|
|
14
15
|
const styleContentContainer = (0, _useStyle.useStyle)(props.contentContainerClassName, props);
|
|
15
16
|
const styleListFooterComponent = (0, _useStyle.useStyle)(props.ListFooterComponentClassName, props);
|
|
16
17
|
const styleListHeaderComponent = (0, _useStyle.useStyle)(props.ListHeaderComponentClassName, props);
|
|
17
|
-
const endFillColor = (0,
|
|
18
|
+
const endFillColor = (0, _useAccentColor.useAccentColor)(props.endFillColorClassName, props);
|
|
18
19
|
const hasSingleColumn = !("numColumns" in props) || props.numColumns === 1;
|
|
19
20
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.FlatList, {
|
|
20
21
|
...props,
|
|
@@ -6,14 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.RefreshControl = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
9
|
+
var _useAccentColor = require("../../native/useAccentColor");
|
|
9
10
|
var _useStyle = require("../../native/useStyle");
|
|
10
11
|
var _utils = require("../../utils");
|
|
11
12
|
const RefreshControl = exports.RefreshControl = (0, _utils.copyComponentProperties)(_reactNativeGestureHandler.RefreshControl, props => {
|
|
12
13
|
const style = (0, _useStyle.useStyle)(props.className, props);
|
|
13
|
-
const color = (0,
|
|
14
|
-
const tintColor = (0,
|
|
15
|
-
const titleColor = (0,
|
|
16
|
-
const progressBackgroundColor = (0,
|
|
14
|
+
const color = (0, _useAccentColor.useAccentColor)(props.colorsClassName, props);
|
|
15
|
+
const tintColor = (0, _useAccentColor.useAccentColor)(props.tintColorClassName, props);
|
|
16
|
+
const titleColor = (0, _useAccentColor.useAccentColor)(props.titleColorClassName, props);
|
|
17
|
+
const progressBackgroundColor = (0, _useAccentColor.useAccentColor)(props.progressBackgroundColorClassName, props);
|
|
17
18
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.RefreshControl, {
|
|
18
19
|
...props,
|
|
19
20
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.Text = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
10
|
+
var _useAccentColor = require("../../native/useAccentColor");
|
|
10
11
|
var _useStyle = require("../../native/useStyle");
|
|
11
12
|
var _utils = require("../../utils");
|
|
12
13
|
const Text = exports.Text = (0, _utils.copyComponentProperties)(_reactNativeGestureHandler.Text, props => {
|
|
@@ -16,7 +17,7 @@ const Text = exports.Text = (0, _utils.copyComponentProperties)(_reactNativeGest
|
|
|
16
17
|
isDisabled: Boolean(props.disabled)
|
|
17
18
|
};
|
|
18
19
|
const style = (0, _useStyle.useStyle)(props.className, props, state);
|
|
19
|
-
const selectionColor = (0,
|
|
20
|
+
const selectionColor = (0, _useAccentColor.useAccentColor)(props.selectionColorClassName, props, state);
|
|
20
21
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.Text, {
|
|
21
22
|
...props,
|
|
22
23
|
style: [style, props.style],
|
|
@@ -7,6 +7,7 @@ module.exports = exports.TextInput = void 0;
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
10
|
+
var _useAccentColor = require("../../native/useAccentColor");
|
|
10
11
|
var _useStyle = require("../../native/useStyle");
|
|
11
12
|
var _utils = require("../../utils");
|
|
12
13
|
const TextInput = exports.TextInput = (0, _utils.copyComponentProperties)(_reactNativeGestureHandler.TextInput, props => {
|
|
@@ -19,10 +20,10 @@ const TextInput = exports.TextInput = (0, _utils.copyComponentProperties)(_react
|
|
|
19
20
|
};
|
|
20
21
|
const style = (0, _useStyle.useStyle)(props.className, props, state);
|
|
21
22
|
const cursorColor = (0, _useStyle.useStyle)(props.cursorColorClassName, props, state).accentColor;
|
|
22
|
-
const selectionColor = (0,
|
|
23
|
-
const placeholderTextColor = (0,
|
|
24
|
-
const selectionHandleColor = (0,
|
|
25
|
-
const underlineColorAndroid = (0,
|
|
23
|
+
const selectionColor = (0, _useAccentColor.useAccentColor)(props.selectionColorClassName, props, state);
|
|
24
|
+
const placeholderTextColor = (0, _useAccentColor.useAccentColor)(props.placeholderTextColorClassName, props, state);
|
|
25
|
+
const selectionHandleColor = (0, _useAccentColor.useAccentColor)(props.selectionHandleColorClassName, props, state);
|
|
26
|
+
const underlineColorAndroid = (0, _useAccentColor.useAccentColor)(props.underlineColorAndroidClassName, props, state);
|
|
26
27
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.TextInput, {
|
|
27
28
|
...props,
|
|
28
29
|
style: [style, props.style],
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.ActivityIndicator = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _hooks = require("../../hooks");
|
|
10
9
|
var _utils = require("../utils");
|
|
11
10
|
var _generateDataSet = require("./generateDataSet");
|
|
12
11
|
var _rnw = require("./rnw");
|
|
12
|
+
var _useUniwindAccent = require("./useUniwindAccent");
|
|
13
13
|
const ActivityIndicator = exports.ActivityIndicator = (0, _utils.copyComponentProperties)(_reactNative.ActivityIndicator, props => {
|
|
14
|
-
const color = (0,
|
|
14
|
+
const color = (0, _useUniwindAccent.useUniwindAccent)(props.colorClassName);
|
|
15
15
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
16
16
|
...props,
|
|
17
17
|
style: [(0, _rnw.toRNWClassName)(props.className), props.style],
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.Button = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _hooks = require("../../hooks");
|
|
10
9
|
var _utils = require("../utils");
|
|
11
10
|
var _generateDataSet = require("./generateDataSet");
|
|
11
|
+
var _useUniwindAccent = require("./useUniwindAccent");
|
|
12
12
|
const Button = exports.Button = (0, _utils.copyComponentProperties)(_reactNative.Button, props => {
|
|
13
|
-
const color = (0,
|
|
13
|
+
const color = (0, _useUniwindAccent.useUniwindAccent)(props.colorClassName);
|
|
14
14
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNative.Button, {
|
|
15
15
|
...props,
|
|
16
16
|
color: props.color ?? color,
|
|
@@ -10,8 +10,9 @@ var _hooks = require("../../hooks");
|
|
|
10
10
|
var _utils = require("../utils");
|
|
11
11
|
var _generateDataSet = require("./generateDataSet");
|
|
12
12
|
var _rnw = require("./rnw");
|
|
13
|
+
var _useUniwindAccent = require("./useUniwindAccent");
|
|
13
14
|
const Image = exports.Image = (0, _utils.copyComponentProperties)(_reactNative.Image, props => {
|
|
14
|
-
const tintColor = (0,
|
|
15
|
+
const tintColor = (0, _useUniwindAccent.useUniwindAccent)(props.tintColorClassName);
|
|
15
16
|
const styles = (0, _hooks.useResolveClassNames)(props.className ?? "");
|
|
16
17
|
const isUsingWidth = styles.width !== void 0;
|
|
17
18
|
const isUsingHeight = styles.height !== void 0;
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.ImageBackground = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _hooks = require("../../hooks");
|
|
10
9
|
var _utils = require("../utils");
|
|
11
10
|
var _generateDataSet = require("./generateDataSet");
|
|
12
11
|
var _rnw = require("./rnw");
|
|
12
|
+
var _useUniwindAccent = require("./useUniwindAccent");
|
|
13
13
|
const ImageBackground = exports.ImageBackground = (0, _utils.copyComponentProperties)(_reactNative.ImageBackground, props => {
|
|
14
|
-
const tintColor = (0,
|
|
14
|
+
const tintColor = (0, _useUniwindAccent.useUniwindAccent)(props.tintColorClassName);
|
|
15
15
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNative.ImageBackground, {
|
|
16
16
|
...props,
|
|
17
17
|
style: [(0, _rnw.toRNWClassName)(props.className), props.style],
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.Switch = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _hooks = require("../../hooks");
|
|
10
9
|
var _utils = require("../utils");
|
|
11
10
|
var _generateDataSet = require("./generateDataSet");
|
|
12
11
|
var _rnw = require("./rnw");
|
|
12
|
+
var _useUniwindAccent = require("./useUniwindAccent");
|
|
13
13
|
const Switch = exports.Switch = (0, _utils.copyComponentProperties)(_reactNative.Switch, props => {
|
|
14
|
-
const trackColorOn = (0,
|
|
15
|
-
const trackColorOff = (0,
|
|
16
|
-
const thumbColor = (0,
|
|
14
|
+
const trackColorOn = (0, _useUniwindAccent.useUniwindAccent)(props.trackColorOnClassName);
|
|
15
|
+
const trackColorOff = (0, _useUniwindAccent.useUniwindAccent)(props.trackColorOffClassName);
|
|
16
|
+
const thumbColor = (0, _useUniwindAccent.useUniwindAccent)(props.thumbColorClassName);
|
|
17
17
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNative.Switch, {
|
|
18
18
|
...props,
|
|
19
19
|
style: [(0, _rnw.toRNWClassName)(props.className), props.style],
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.TextInput = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _hooks = require("../../hooks");
|
|
10
9
|
var _utils = require("../utils");
|
|
11
10
|
var _generateDataSet = require("./generateDataSet");
|
|
12
11
|
var _rnw = require("./rnw");
|
|
12
|
+
var _useUniwindAccent = require("./useUniwindAccent");
|
|
13
13
|
const TextInput = exports.TextInput = (0, _utils.copyComponentProperties)(_reactNative.TextInput, props => {
|
|
14
|
-
const placeholderTextColor = (0,
|
|
14
|
+
const placeholderTextColor = (0, _useUniwindAccent.useUniwindAccent)(props.placeholderTextColorClassName);
|
|
15
15
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
16
16
|
...props,
|
|
17
17
|
style: [(0, _rnw.toRNWClassName)(props.className), props.style],
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.TouchableHighlight = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _hooks = require("../../hooks");
|
|
10
9
|
var _utils = require("../utils");
|
|
11
10
|
var _generateDataSet = require("./generateDataSet");
|
|
12
11
|
var _rnw = require("./rnw");
|
|
12
|
+
var _useUniwindAccent = require("./useUniwindAccent");
|
|
13
13
|
const TouchableHighlight = exports.TouchableHighlight = (0, _utils.copyComponentProperties)(_reactNative.TouchableHighlight, props => {
|
|
14
|
-
const underlayColor = (0,
|
|
14
|
+
const underlayColor = (0, _useUniwindAccent.useUniwindAccent)(props.underlayColorClassName);
|
|
15
15
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactNative.TouchableHighlight, {
|
|
16
16
|
...props,
|
|
17
17
|
style: [(0, _rnw.toRNWClassName)(props.className), props.style],
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useUniwindAccent = void 0;
|
|
7
|
+
var _utils = require("../../common/utils");
|
|
8
|
+
var _logger = require("../../core/logger");
|
|
9
|
+
var _formatColor = require("../../core/web/formatColor");
|
|
10
|
+
var _useResolveClassNames = require("../../hooks/useResolveClassNames");
|
|
11
|
+
let warnedOnce = false;
|
|
12
|
+
const useUniwindAccent = className => {
|
|
13
|
+
const styles = (0, _useResolveClassNames.useResolveClassNames)(className ?? "");
|
|
14
|
+
if (__DEV__ && !warnedOnce && (0, _utils.isDefined)(className) && className.trim() !== "" && styles.accentColor === void 0) {
|
|
15
|
+
warnedOnce = true;
|
|
16
|
+
_logger.Logger.warn(`className '${className}' was provided to extract accentColor but no color was found. Make sure the className includes a color utility (e.g., 'accent-red-500', 'accent-blue-600'). See https://docs.uniwind.dev/class-names#the-accent-prefix`);
|
|
17
|
+
}
|
|
18
|
+
return styles.accentColor !== void 0 ? (0, _formatColor.formatColor)(styles.accentColor) : void 0;
|
|
19
|
+
};
|
|
20
|
+
exports.useUniwindAccent = useUniwindAccent;
|
|
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.withUniwind = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _react = require("react");
|
|
9
|
+
var _utils = require("../common/utils");
|
|
9
10
|
var _generateDataSet = require("../components/web/generateDataSet");
|
|
10
11
|
var _context = require("../core/context");
|
|
12
|
+
var _logger = require("../core/logger");
|
|
11
13
|
var _web = require("../core/web");
|
|
12
14
|
var _withUniwindUtils = require("./withUniwindUtils");
|
|
15
|
+
let warnedOnce = false;
|
|
13
16
|
const withUniwind = (Component2, options) => options ? withManualUniwind(Component2, options) : withAutoUniwind(Component2);
|
|
14
17
|
exports.withUniwind = withUniwind;
|
|
15
18
|
const withAutoUniwind = Component2 => props => {
|
|
@@ -25,6 +28,10 @@ const withAutoUniwind = Component2 => props => {
|
|
|
25
28
|
}
|
|
26
29
|
const className = propValue;
|
|
27
30
|
const color = (0, _web.getWebStyles)(className, props, uniwindContext).accentColor;
|
|
31
|
+
if (__DEV__ && !warnedOnce && (0, _utils.isDefined)(className) && className.trim() !== "" && color === void 0) {
|
|
32
|
+
warnedOnce = true;
|
|
33
|
+
_logger.Logger.warn(`className '${className}' was provided to extract accentColor but no color was found. Make sure the className includes a color utility (e.g., 'accent-red-500', 'accent-blue-600'). See https://docs.uniwind.dev/class-names#the-accent-prefix`);
|
|
34
|
+
}
|
|
28
35
|
acc.generatedProps[colorProp] = color !== void 0 ? (0, _web.formatColor)(color) : void 0;
|
|
29
36
|
acc.classNames += `${className} `;
|
|
30
37
|
return acc;
|
|
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.withUniwind = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _react = require("react");
|
|
9
|
+
var _utils = require("../common/utils");
|
|
9
10
|
var _context = require("../core/context");
|
|
10
11
|
var _listener = require("../core/listener");
|
|
12
|
+
var _logger = require("../core/logger");
|
|
11
13
|
var _native = require("../core/native");
|
|
12
14
|
var _withUniwindUtils = require("./withUniwindUtils");
|
|
15
|
+
let warnedOnce = false;
|
|
13
16
|
const withUniwind = (Component2, options) => options ? withManualUniwind(Component2, options) : withAutoUniwind(Component2);
|
|
14
17
|
exports.withUniwind = withUniwind;
|
|
15
18
|
const withAutoUniwind = Component2 => props => {
|
|
@@ -27,6 +30,10 @@ const withAutoUniwind = Component2 => props => {
|
|
|
27
30
|
styles,
|
|
28
31
|
dependencies: dependencies2
|
|
29
32
|
} = _native.UniwindStore.getStyles(propValue, props, void 0, uniwindContext);
|
|
33
|
+
if (__DEV__ && !warnedOnce && (0, _utils.isDefined)(propValue) && propValue.trim() !== "" && styles.accentColor === void 0) {
|
|
34
|
+
warnedOnce = true;
|
|
35
|
+
_logger.Logger.warn(`className '${propValue}' was provided to extract accentColor but no color was found. Make sure the className includes a color utility (e.g., 'accent-red-500', 'accent-blue-600'). See https://docs.uniwind.dev/class-names#the-accent-prefix`);
|
|
36
|
+
}
|
|
30
37
|
acc.dependencies.push(...dependencies2);
|
|
31
38
|
acc.generatedProps[colorProp] = styles.accentColor;
|
|
32
39
|
return acc;
|