@hero-design/rn 6.7.0 → 6.7.3
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/.eslintrc.json +10 -2
- package/es/index.js +112 -76
- package/lib/index.js +112 -75
- package/package.json +10 -4
- package/playground/components/ExampleComponent.tsx +8 -0
- package/playground/index.tsx +77 -17
- package/src/components/ExampleComponent/StyledView.tsx +16 -22
- package/src/components/ExampleComponent/__tests__/StyledView.spec.tsx +6 -3
- package/src/components/ExampleComponent/__tests__/__snapshots__/StyledView.spec.tsx.snap +4 -4
- package/src/components/ExampleComponent/index.tsx +5 -5
- package/src/index.ts +3 -3
- package/src/styled-components.ts +14 -0
- package/src/styled.d.ts +3 -4
- package/src/theme/components/exampleComponent.ts +19 -0
- package/src/theme/global/colors.ts +24 -1
- package/src/theme/global/index.ts +19 -0
- package/src/theme/global/typography.ts +26 -0
- package/src/theme/index.ts +15 -15
- package/tsconfig.json +2 -1
- package/types/components/ExampleComponent/StyledView.d.ts +4 -9
- package/types/components/ExampleComponent/index.d.ts +3 -3
- package/types/index.d.ts +3 -3
- package/types/styled-components.d.ts +6 -0
- package/types/theme/colors.d.ts +24 -0
- package/types/theme/components/exampleComponent.d.ts +14 -0
- package/types/theme/global/colors.d.ts +23 -1
- package/types/theme/global/index.d.ts +58 -0
- package/types/theme/global/typography.d.ts +21 -0
- package/types/theme/index.d.ts +8 -134
- package/types/theme/space.d.ts +12 -0
- package/types/theme/typography.d.ts +21 -0
- package/src/theme/components/demoStyle.ts +0 -16
package/.eslintrc.json
CHANGED
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
"es2021": true,
|
|
5
5
|
"jest": true
|
|
6
6
|
},
|
|
7
|
-
"extends": [
|
|
7
|
+
"extends": [
|
|
8
|
+
"plugin:prettier/recommended",
|
|
9
|
+
"plugin:react/recommended",
|
|
10
|
+
"airbnb",
|
|
11
|
+
"prettier"
|
|
12
|
+
],
|
|
8
13
|
"parser": "@typescript-eslint/parser",
|
|
9
14
|
"parserOptions": {
|
|
10
15
|
"ecmaFeatures": {
|
|
@@ -22,6 +27,8 @@
|
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
"rules": {
|
|
30
|
+
"react/jsx-props-no-spreading": 0,
|
|
31
|
+
"react/require-default-props": 0,
|
|
25
32
|
"react/function-component-definition": 0,
|
|
26
33
|
"react/jsx-filename-extension": [
|
|
27
34
|
1,
|
|
@@ -35,7 +42,8 @@
|
|
|
35
42
|
"files": ["*.ts", "*.tsx"],
|
|
36
43
|
"rules": {
|
|
37
44
|
"consistent-return": 0,
|
|
38
|
-
"default-case": 0
|
|
45
|
+
"default-case": 0,
|
|
46
|
+
"no-underscore-dangle": [2, { "allow": ["__hd__"] }]
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
49
|
]
|
package/es/index.js
CHANGED
|
@@ -9182,7 +9182,7 @@ var addTag = function addTag(arg) {
|
|
|
9182
9182
|
return arg;
|
|
9183
9183
|
};
|
|
9184
9184
|
|
|
9185
|
-
function css(styles) {
|
|
9185
|
+
function css$1(styles) {
|
|
9186
9186
|
var interpolations = [];
|
|
9187
9187
|
|
|
9188
9188
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -9225,7 +9225,7 @@ function constructWithOptions(componentConstructor, tag, options) {
|
|
|
9225
9225
|
interpolations[_i - 1] = arguments[_i];
|
|
9226
9226
|
}
|
|
9227
9227
|
|
|
9228
|
-
return componentConstructor(tag, options, css.apply(void 0, __spreadArray([initialStyles], __read(interpolations), false)));
|
|
9228
|
+
return componentConstructor(tag, options, css$1.apply(void 0, __spreadArray([initialStyles], __read(interpolations), false)));
|
|
9229
9229
|
};
|
|
9230
9230
|
/* Modify/inject new props at runtime */
|
|
9231
9231
|
|
|
@@ -9272,7 +9272,7 @@ function mergeTheme(theme, outerTheme) {
|
|
|
9272
9272
|
*/
|
|
9273
9273
|
|
|
9274
9274
|
|
|
9275
|
-
function ThemeProvider(props) {
|
|
9275
|
+
function ThemeProvider$1(props) {
|
|
9276
9276
|
var outerTheme = useContext(ThemeContext);
|
|
9277
9277
|
var themeContext = useMemo(function () {
|
|
9278
9278
|
return mergeTheme(props.theme, outerTheme);
|
|
@@ -9405,7 +9405,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, excludelist) {
|
|
|
9405
9405
|
return targetComponent;
|
|
9406
9406
|
}
|
|
9407
9407
|
|
|
9408
|
-
var useTheme = function useTheme() {
|
|
9408
|
+
var useTheme$1 = function useTheme() {
|
|
9409
9409
|
return useContext(ThemeContext);
|
|
9410
9410
|
};
|
|
9411
9411
|
|
|
@@ -9724,21 +9724,26 @@ var baseStyled = function baseStyled(tag) {
|
|
|
9724
9724
|
|
|
9725
9725
|
|
|
9726
9726
|
var aliases = ['ActivityIndicator', 'ActivityIndicatorIOS', 'ART', 'Button', 'DatePickerIOS', 'DrawerLayoutAndroid', 'FlatList', 'Image', 'ImageBackground', 'ImageEditor', 'ImageStore', 'KeyboardAvoidingView', 'ListView', 'MapView', 'Modal', 'NavigatorIOS', 'Picker', 'PickerIOS', 'Pressable', 'ProgressBarAndroid', 'ProgressViewIOS', 'RecyclerViewBackedScrollView', 'RefreshControl', 'SafeAreaView', 'ScrollView', 'SectionList', 'SegmentedControlIOS', 'Slider', 'SliderIOS', 'SnapshotViewIOS', 'StatusBar', 'SwipeableListView', 'Switch', 'SwitchAndroid', 'SwitchIOS', 'TabBarIOS', 'Text', 'TextInput', 'ToastAndroid', 'ToolbarAndroid', 'Touchable', 'TouchableHighlight', 'TouchableNativeFeedback', 'TouchableOpacity', 'TouchableWithoutFeedback', 'View', 'ViewPagerAndroid', 'VirtualizedList', 'WebView'];
|
|
9727
|
-
var styled = baseStyled;
|
|
9727
|
+
var styled$1 = baseStyled;
|
|
9728
9728
|
/* Define a getter for each alias which simply gets the reactNative component
|
|
9729
9729
|
* and passes it to styled */
|
|
9730
9730
|
|
|
9731
9731
|
aliases.forEach(function (alias) {
|
|
9732
|
-
return Object.defineProperty(styled, alias, {
|
|
9732
|
+
return Object.defineProperty(styled$1, alias, {
|
|
9733
9733
|
enumerable: true,
|
|
9734
9734
|
configurable: false,
|
|
9735
9735
|
get: function get() {
|
|
9736
9736
|
// @ts-expect-error supporting old imports in some cases
|
|
9737
|
-
return styled(reactNative[alias]);
|
|
9737
|
+
return styled$1(reactNative[alias]);
|
|
9738
9738
|
}
|
|
9739
9739
|
});
|
|
9740
9740
|
});
|
|
9741
9741
|
|
|
9742
|
+
var styled = styled$1,
|
|
9743
|
+
useTheme = useTheme$1,
|
|
9744
|
+
css = css$1,
|
|
9745
|
+
ThemeProvider = ThemeProvider$1;
|
|
9746
|
+
|
|
9742
9747
|
var palette = {
|
|
9743
9748
|
black: '#000000',
|
|
9744
9749
|
blue: '#1dbeee',
|
|
@@ -9750,6 +9755,7 @@ var palette = {
|
|
|
9750
9755
|
dodgerBlue: '#4568fb',
|
|
9751
9756
|
dodgerBlueDark30: '#3049b0',
|
|
9752
9757
|
dodgerBlueLight30: '#7d95fc',
|
|
9758
|
+
dodgerBlueLight75: '#d1d9fe',
|
|
9753
9759
|
dodgerBlueLight90: '#ecf0ff',
|
|
9754
9760
|
green: '#01b39c',
|
|
9755
9761
|
greenDark15: '#019885',
|
|
@@ -9758,6 +9764,7 @@ var palette = {
|
|
|
9758
9764
|
greenLight30: '#4dcaba',
|
|
9759
9765
|
greenLight90: '#e6f7f5',
|
|
9760
9766
|
grey: '#a3a6ac',
|
|
9767
|
+
greyDark15: '#8b8d92',
|
|
9761
9768
|
greyDark30: '#727478',
|
|
9762
9769
|
greyDark45: '#5a5b5f',
|
|
9763
9770
|
greyDark60: '#414245',
|
|
@@ -9767,6 +9774,7 @@ var palette = {
|
|
|
9767
9774
|
greyLight75: '#e8e9ea',
|
|
9768
9775
|
greyLight85: '#f1f2f3',
|
|
9769
9776
|
greyLight90: '#f6f6f7',
|
|
9777
|
+
greyLight95: '#fafbfb',
|
|
9770
9778
|
grotesqueGreen: '#6af293',
|
|
9771
9779
|
grotesqueGreenDark45: '#3a8551',
|
|
9772
9780
|
grotesqueGreenLight60: '#c3fad4',
|
|
@@ -9794,6 +9802,7 @@ var palette = {
|
|
|
9794
9802
|
redDark30: '#9b2508',
|
|
9795
9803
|
redDark75: '#380d03',
|
|
9796
9804
|
redLight30: '#e87254',
|
|
9805
|
+
redLight60: '#f2ae9d',
|
|
9797
9806
|
redLight75: '#f7cdc2',
|
|
9798
9807
|
redLight90: '#fcebe7',
|
|
9799
9808
|
smalt: '#003580',
|
|
@@ -9817,80 +9826,107 @@ var palette = {
|
|
|
9817
9826
|
yellowLight60: '#fdf1a1',
|
|
9818
9827
|
yellowLight90: '#fffbe8'
|
|
9819
9828
|
};
|
|
9829
|
+
|
|
9820
9830
|
var systemPalette = {
|
|
9821
9831
|
primary: palette.violet,
|
|
9822
|
-
|
|
9823
|
-
primaryLight: palette.violetLight30,
|
|
9824
|
-
primaryBackground: palette.violetLight90,
|
|
9825
|
-
platformBackground: palette.greyLight85,
|
|
9826
|
-
backgroundDark: palette.black,
|
|
9827
|
-
backgroundLight: palette.white,
|
|
9832
|
+
primaryLight: palette.violetLight60,
|
|
9828
9833
|
info: palette.dodgerBlue,
|
|
9829
|
-
|
|
9830
|
-
infoLight: palette.dodgerBlueLight30,
|
|
9834
|
+
infoLight: palette.dodgerBlueLight75,
|
|
9831
9835
|
infoBackground: palette.dodgerBlueLight90,
|
|
9832
9836
|
success: palette.green,
|
|
9833
9837
|
successDark: palette.greenDark30,
|
|
9834
|
-
successLight: palette.
|
|
9835
|
-
successBackground: palette.
|
|
9838
|
+
successLight: palette.greenDark75,
|
|
9839
|
+
successBackground: palette.grotesqueGreenLight90,
|
|
9836
9840
|
danger: palette.red,
|
|
9837
|
-
|
|
9838
|
-
dangerLight: palette.redLight30,
|
|
9841
|
+
dangerLight: palette.redLight60,
|
|
9839
9842
|
dangerBackground: palette.redLight90,
|
|
9840
9843
|
warning: palette.orange,
|
|
9841
|
-
warningDark: palette.
|
|
9842
|
-
warningLight: palette.orangeLight30,
|
|
9844
|
+
warningDark: palette.orangeDark15,
|
|
9843
9845
|
warningBackground: palette.orangeLight90,
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
text: palette.greyDark45,
|
|
9850
|
-
subduedText: palette.greyDark30,
|
|
9851
|
-
disabledText: palette.grey,
|
|
9852
|
-
outline: palette.greyLight60,
|
|
9853
|
-
disabledBackground: palette.greyLight60
|
|
9846
|
+
platformBackground: palette.greyLight95,
|
|
9847
|
+
backgroundDark: palette.greyDark75,
|
|
9848
|
+
text: palette.greyDark75,
|
|
9849
|
+
disabledText: palette.greyDark15,
|
|
9850
|
+
invertedText: palette.white
|
|
9854
9851
|
};
|
|
9855
9852
|
|
|
9856
|
-
var BASE = 8;
|
|
9853
|
+
var BASE$1 = 8;
|
|
9857
9854
|
var space = {
|
|
9858
|
-
xxsmall: BASE * 0.25,
|
|
9859
|
-
xsmall: BASE * 0.5,
|
|
9860
|
-
small: BASE,
|
|
9861
|
-
medium: BASE * 2,
|
|
9862
|
-
large: BASE * 3,
|
|
9863
|
-
xlarge: BASE * 4,
|
|
9864
|
-
xxlarge: BASE * 5,
|
|
9865
|
-
xxxlarge: BASE * 6,
|
|
9866
|
-
xxxxlarge: BASE * 7
|
|
9855
|
+
xxsmall: BASE$1 * 0.25,
|
|
9856
|
+
xsmall: BASE$1 * 0.5,
|
|
9857
|
+
small: BASE$1,
|
|
9858
|
+
medium: BASE$1 * 2,
|
|
9859
|
+
large: BASE$1 * 3,
|
|
9860
|
+
xlarge: BASE$1 * 4,
|
|
9861
|
+
xxlarge: BASE$1 * 5,
|
|
9862
|
+
xxxlarge: BASE$1 * 6,
|
|
9863
|
+
xxxxlarge: BASE$1 * 7
|
|
9867
9864
|
};
|
|
9868
9865
|
|
|
9869
|
-
var
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9866
|
+
var BASE = 16;
|
|
9867
|
+
var fontSizes = {
|
|
9868
|
+
xlarge: BASE * 1.125,
|
|
9869
|
+
large: BASE,
|
|
9870
|
+
medium: BASE * 0.875,
|
|
9871
|
+
small: BASE * 0.75,
|
|
9872
|
+
xsmall: BASE * 0.625 // 10
|
|
9873
|
+
|
|
9874
|
+
};
|
|
9875
|
+
var fontWeights = {
|
|
9876
|
+
light: 200,
|
|
9877
|
+
regular: 400,
|
|
9878
|
+
semiBold: 600,
|
|
9879
|
+
bold: 700
|
|
9873
9880
|
};
|
|
9874
|
-
var
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9881
|
+
var lineHeights = {
|
|
9882
|
+
xlarge: fontSizes.xlarge + 8,
|
|
9883
|
+
large: fontSizes.large + 8,
|
|
9884
|
+
medium: fontSizes.medium + 8,
|
|
9885
|
+
small: fontSizes.small + 8,
|
|
9886
|
+
xsmall: fontSizes.xsmall + 8
|
|
9878
9887
|
};
|
|
9879
9888
|
|
|
9880
|
-
var
|
|
9881
|
-
colors: _objectSpread2(
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
})
|
|
9889
|
+
var globalTheme = {
|
|
9890
|
+
colors: _objectSpread2({}, systemPalette),
|
|
9891
|
+
space: space,
|
|
9892
|
+
fontSizes: fontSizes,
|
|
9893
|
+
fontWeights: fontWeights,
|
|
9894
|
+
lineHeights: lineHeights
|
|
9887
9895
|
};
|
|
9888
9896
|
|
|
9897
|
+
var getExampleComponentTheme = function getExampleComponentTheme(theme) {
|
|
9898
|
+
var colors = {
|
|
9899
|
+
primaryBg: theme.colors.primaryLight,
|
|
9900
|
+
dangerBg: theme.colors.dangerBackground,
|
|
9901
|
+
warningBg: theme.colors.warningBackground
|
|
9902
|
+
};
|
|
9903
|
+
var space = {
|
|
9904
|
+
smallMargin: theme.space.xxsmall,
|
|
9905
|
+
mediumMargin: theme.space.medium,
|
|
9906
|
+
largeMargin: theme.space.xxxxlarge
|
|
9907
|
+
};
|
|
9908
|
+
return {
|
|
9909
|
+
colors: colors,
|
|
9910
|
+
space: space
|
|
9911
|
+
};
|
|
9912
|
+
};
|
|
9913
|
+
|
|
9914
|
+
var getTheme = function getTheme() {
|
|
9915
|
+
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalTheme;
|
|
9916
|
+
return _objectSpread2(_objectSpread2({}, theme), {}, {
|
|
9917
|
+
__hd__: {
|
|
9918
|
+
exampleComponent: getExampleComponentTheme(theme)
|
|
9919
|
+
}
|
|
9920
|
+
});
|
|
9921
|
+
};
|
|
9922
|
+
|
|
9923
|
+
var theme = getTheme();
|
|
9924
|
+
|
|
9889
9925
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
9890
9926
|
var Square = styled(View)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
9891
|
-
var
|
|
9927
|
+
var themeSize = _ref.themeSize;
|
|
9892
9928
|
|
|
9893
|
-
switch (
|
|
9929
|
+
switch (themeSize) {
|
|
9894
9930
|
case 'small':
|
|
9895
9931
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 50px;\n width: 200px;\n "])));
|
|
9896
9932
|
|
|
@@ -9901,45 +9937,45 @@ var Square = styled(View)(_templateObject || (_templateObject = _taggedTemplateL
|
|
|
9901
9937
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 150px;\n width: 300px;\n "])));
|
|
9902
9938
|
}
|
|
9903
9939
|
}, function (_ref2) {
|
|
9904
|
-
var
|
|
9940
|
+
var themeMargin = _ref2.themeMargin,
|
|
9905
9941
|
theme = _ref2.theme;
|
|
9906
9942
|
|
|
9907
|
-
switch (
|
|
9943
|
+
switch (themeMargin) {
|
|
9908
9944
|
case 'small':
|
|
9909
|
-
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.space.
|
|
9945
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.__hd__.exampleComponent.space.smallMargin);
|
|
9910
9946
|
|
|
9911
9947
|
case 'medium':
|
|
9912
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.space.
|
|
9948
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.__hd__.exampleComponent.space.mediumMargin);
|
|
9913
9949
|
|
|
9914
9950
|
case 'large':
|
|
9915
|
-
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.space.
|
|
9951
|
+
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.__hd__.exampleComponent.space.largeMargin);
|
|
9916
9952
|
}
|
|
9917
9953
|
}, function (_ref3) {
|
|
9918
|
-
var
|
|
9954
|
+
var themeBgColor = _ref3.themeBgColor,
|
|
9919
9955
|
theme = _ref3.theme;
|
|
9920
9956
|
|
|
9921
|
-
switch (
|
|
9957
|
+
switch (themeBgColor) {
|
|
9922
9958
|
case 'primary':
|
|
9923
|
-
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.colors.
|
|
9959
|
+
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.__hd__.exampleComponent.colors.primaryBg);
|
|
9924
9960
|
|
|
9925
9961
|
case 'danger':
|
|
9926
|
-
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.colors.
|
|
9962
|
+
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.__hd__.exampleComponent.colors.dangerBg);
|
|
9927
9963
|
|
|
9928
9964
|
case 'warning':
|
|
9929
|
-
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.colors.
|
|
9965
|
+
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.__hd__.exampleComponent.colors.warningBg);
|
|
9930
9966
|
}
|
|
9931
9967
|
});
|
|
9932
9968
|
|
|
9933
9969
|
var ExampleComponent = function ExampleComponent(_ref) {
|
|
9934
|
-
var _ref$
|
|
9935
|
-
|
|
9936
|
-
|
|
9970
|
+
var _ref$size = _ref.size,
|
|
9971
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
9972
|
+
margin = _ref.margin,
|
|
9937
9973
|
bgColor = _ref.bgColor;
|
|
9938
9974
|
return /*#__PURE__*/React.createElement(Square, {
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Square with ".concat(
|
|
9975
|
+
themeSize: size,
|
|
9976
|
+
themeMargin: margin,
|
|
9977
|
+
themeBgColor: bgColor
|
|
9978
|
+
}, /*#__PURE__*/React.createElement(Text, null, "Square with ".concat(size, " size, ").concat(margin, " margin and ").concat(bgColor, " background.")));
|
|
9943
9979
|
};
|
|
9944
9980
|
|
|
9945
|
-
export { ExampleComponent, ThemeProvider, theme, useTheme };
|
|
9981
|
+
export { ExampleComponent, ThemeProvider, getTheme, theme, useTheme };
|
package/lib/index.js
CHANGED
|
@@ -9190,7 +9190,7 @@ var addTag = function addTag(arg) {
|
|
|
9190
9190
|
return arg;
|
|
9191
9191
|
};
|
|
9192
9192
|
|
|
9193
|
-
function css(styles) {
|
|
9193
|
+
function css$1(styles) {
|
|
9194
9194
|
var interpolations = [];
|
|
9195
9195
|
|
|
9196
9196
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -9233,7 +9233,7 @@ function constructWithOptions(componentConstructor, tag, options) {
|
|
|
9233
9233
|
interpolations[_i - 1] = arguments[_i];
|
|
9234
9234
|
}
|
|
9235
9235
|
|
|
9236
|
-
return componentConstructor(tag, options, css.apply(void 0, __spreadArray([initialStyles], __read(interpolations), false)));
|
|
9236
|
+
return componentConstructor(tag, options, css$1.apply(void 0, __spreadArray([initialStyles], __read(interpolations), false)));
|
|
9237
9237
|
};
|
|
9238
9238
|
/* Modify/inject new props at runtime */
|
|
9239
9239
|
|
|
@@ -9280,7 +9280,7 @@ function mergeTheme(theme, outerTheme) {
|
|
|
9280
9280
|
*/
|
|
9281
9281
|
|
|
9282
9282
|
|
|
9283
|
-
function ThemeProvider(props) {
|
|
9283
|
+
function ThemeProvider$1(props) {
|
|
9284
9284
|
var outerTheme = React.useContext(ThemeContext);
|
|
9285
9285
|
var themeContext = React.useMemo(function () {
|
|
9286
9286
|
return mergeTheme(props.theme, outerTheme);
|
|
@@ -9413,7 +9413,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, excludelist) {
|
|
|
9413
9413
|
return targetComponent;
|
|
9414
9414
|
}
|
|
9415
9415
|
|
|
9416
|
-
var useTheme = function useTheme() {
|
|
9416
|
+
var useTheme$1 = function useTheme() {
|
|
9417
9417
|
return React.useContext(ThemeContext);
|
|
9418
9418
|
};
|
|
9419
9419
|
|
|
@@ -9732,21 +9732,26 @@ var baseStyled = function baseStyled(tag) {
|
|
|
9732
9732
|
|
|
9733
9733
|
|
|
9734
9734
|
var aliases = ['ActivityIndicator', 'ActivityIndicatorIOS', 'ART', 'Button', 'DatePickerIOS', 'DrawerLayoutAndroid', 'FlatList', 'Image', 'ImageBackground', 'ImageEditor', 'ImageStore', 'KeyboardAvoidingView', 'ListView', 'MapView', 'Modal', 'NavigatorIOS', 'Picker', 'PickerIOS', 'Pressable', 'ProgressBarAndroid', 'ProgressViewIOS', 'RecyclerViewBackedScrollView', 'RefreshControl', 'SafeAreaView', 'ScrollView', 'SectionList', 'SegmentedControlIOS', 'Slider', 'SliderIOS', 'SnapshotViewIOS', 'StatusBar', 'SwipeableListView', 'Switch', 'SwitchAndroid', 'SwitchIOS', 'TabBarIOS', 'Text', 'TextInput', 'ToastAndroid', 'ToolbarAndroid', 'Touchable', 'TouchableHighlight', 'TouchableNativeFeedback', 'TouchableOpacity', 'TouchableWithoutFeedback', 'View', 'ViewPagerAndroid', 'VirtualizedList', 'WebView'];
|
|
9735
|
-
var styled = baseStyled;
|
|
9735
|
+
var styled$1 = baseStyled;
|
|
9736
9736
|
/* Define a getter for each alias which simply gets the reactNative component
|
|
9737
9737
|
* and passes it to styled */
|
|
9738
9738
|
|
|
9739
9739
|
aliases.forEach(function (alias) {
|
|
9740
|
-
return Object.defineProperty(styled, alias, {
|
|
9740
|
+
return Object.defineProperty(styled$1, alias, {
|
|
9741
9741
|
enumerable: true,
|
|
9742
9742
|
configurable: false,
|
|
9743
9743
|
get: function get() {
|
|
9744
9744
|
// @ts-expect-error supporting old imports in some cases
|
|
9745
|
-
return styled(reactNative[alias]);
|
|
9745
|
+
return styled$1(reactNative[alias]);
|
|
9746
9746
|
}
|
|
9747
9747
|
});
|
|
9748
9748
|
});
|
|
9749
9749
|
|
|
9750
|
+
var styled = styled$1,
|
|
9751
|
+
useTheme = useTheme$1,
|
|
9752
|
+
css = css$1,
|
|
9753
|
+
ThemeProvider = ThemeProvider$1;
|
|
9754
|
+
|
|
9750
9755
|
var palette = {
|
|
9751
9756
|
black: '#000000',
|
|
9752
9757
|
blue: '#1dbeee',
|
|
@@ -9758,6 +9763,7 @@ var palette = {
|
|
|
9758
9763
|
dodgerBlue: '#4568fb',
|
|
9759
9764
|
dodgerBlueDark30: '#3049b0',
|
|
9760
9765
|
dodgerBlueLight30: '#7d95fc',
|
|
9766
|
+
dodgerBlueLight75: '#d1d9fe',
|
|
9761
9767
|
dodgerBlueLight90: '#ecf0ff',
|
|
9762
9768
|
green: '#01b39c',
|
|
9763
9769
|
greenDark15: '#019885',
|
|
@@ -9766,6 +9772,7 @@ var palette = {
|
|
|
9766
9772
|
greenLight30: '#4dcaba',
|
|
9767
9773
|
greenLight90: '#e6f7f5',
|
|
9768
9774
|
grey: '#a3a6ac',
|
|
9775
|
+
greyDark15: '#8b8d92',
|
|
9769
9776
|
greyDark30: '#727478',
|
|
9770
9777
|
greyDark45: '#5a5b5f',
|
|
9771
9778
|
greyDark60: '#414245',
|
|
@@ -9775,6 +9782,7 @@ var palette = {
|
|
|
9775
9782
|
greyLight75: '#e8e9ea',
|
|
9776
9783
|
greyLight85: '#f1f2f3',
|
|
9777
9784
|
greyLight90: '#f6f6f7',
|
|
9785
|
+
greyLight95: '#fafbfb',
|
|
9778
9786
|
grotesqueGreen: '#6af293',
|
|
9779
9787
|
grotesqueGreenDark45: '#3a8551',
|
|
9780
9788
|
grotesqueGreenLight60: '#c3fad4',
|
|
@@ -9802,6 +9810,7 @@ var palette = {
|
|
|
9802
9810
|
redDark30: '#9b2508',
|
|
9803
9811
|
redDark75: '#380d03',
|
|
9804
9812
|
redLight30: '#e87254',
|
|
9813
|
+
redLight60: '#f2ae9d',
|
|
9805
9814
|
redLight75: '#f7cdc2',
|
|
9806
9815
|
redLight90: '#fcebe7',
|
|
9807
9816
|
smalt: '#003580',
|
|
@@ -9825,80 +9834,107 @@ var palette = {
|
|
|
9825
9834
|
yellowLight60: '#fdf1a1',
|
|
9826
9835
|
yellowLight90: '#fffbe8'
|
|
9827
9836
|
};
|
|
9837
|
+
|
|
9828
9838
|
var systemPalette = {
|
|
9829
9839
|
primary: palette.violet,
|
|
9830
|
-
|
|
9831
|
-
primaryLight: palette.violetLight30,
|
|
9832
|
-
primaryBackground: palette.violetLight90,
|
|
9833
|
-
platformBackground: palette.greyLight85,
|
|
9834
|
-
backgroundDark: palette.black,
|
|
9835
|
-
backgroundLight: palette.white,
|
|
9840
|
+
primaryLight: palette.violetLight60,
|
|
9836
9841
|
info: palette.dodgerBlue,
|
|
9837
|
-
|
|
9838
|
-
infoLight: palette.dodgerBlueLight30,
|
|
9842
|
+
infoLight: palette.dodgerBlueLight75,
|
|
9839
9843
|
infoBackground: palette.dodgerBlueLight90,
|
|
9840
9844
|
success: palette.green,
|
|
9841
9845
|
successDark: palette.greenDark30,
|
|
9842
|
-
successLight: palette.
|
|
9843
|
-
successBackground: palette.
|
|
9846
|
+
successLight: palette.greenDark75,
|
|
9847
|
+
successBackground: palette.grotesqueGreenLight90,
|
|
9844
9848
|
danger: palette.red,
|
|
9845
|
-
|
|
9846
|
-
dangerLight: palette.redLight30,
|
|
9849
|
+
dangerLight: palette.redLight60,
|
|
9847
9850
|
dangerBackground: palette.redLight90,
|
|
9848
9851
|
warning: palette.orange,
|
|
9849
|
-
warningDark: palette.
|
|
9850
|
-
warningLight: palette.orangeLight30,
|
|
9852
|
+
warningDark: palette.orangeDark15,
|
|
9851
9853
|
warningBackground: palette.orangeLight90,
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
text: palette.greyDark45,
|
|
9858
|
-
subduedText: palette.greyDark30,
|
|
9859
|
-
disabledText: palette.grey,
|
|
9860
|
-
outline: palette.greyLight60,
|
|
9861
|
-
disabledBackground: palette.greyLight60
|
|
9854
|
+
platformBackground: palette.greyLight95,
|
|
9855
|
+
backgroundDark: palette.greyDark75,
|
|
9856
|
+
text: palette.greyDark75,
|
|
9857
|
+
disabledText: palette.greyDark15,
|
|
9858
|
+
invertedText: palette.white
|
|
9862
9859
|
};
|
|
9863
9860
|
|
|
9864
|
-
var BASE = 8;
|
|
9861
|
+
var BASE$1 = 8;
|
|
9865
9862
|
var space = {
|
|
9866
|
-
xxsmall: BASE * 0.25,
|
|
9867
|
-
xsmall: BASE * 0.5,
|
|
9868
|
-
small: BASE,
|
|
9869
|
-
medium: BASE * 2,
|
|
9870
|
-
large: BASE * 3,
|
|
9871
|
-
xlarge: BASE * 4,
|
|
9872
|
-
xxlarge: BASE * 5,
|
|
9873
|
-
xxxlarge: BASE * 6,
|
|
9874
|
-
xxxxlarge: BASE * 7
|
|
9863
|
+
xxsmall: BASE$1 * 0.25,
|
|
9864
|
+
xsmall: BASE$1 * 0.5,
|
|
9865
|
+
small: BASE$1,
|
|
9866
|
+
medium: BASE$1 * 2,
|
|
9867
|
+
large: BASE$1 * 3,
|
|
9868
|
+
xlarge: BASE$1 * 4,
|
|
9869
|
+
xxlarge: BASE$1 * 5,
|
|
9870
|
+
xxxlarge: BASE$1 * 6,
|
|
9871
|
+
xxxxlarge: BASE$1 * 7
|
|
9875
9872
|
};
|
|
9876
9873
|
|
|
9877
|
-
var
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9874
|
+
var BASE = 16;
|
|
9875
|
+
var fontSizes = {
|
|
9876
|
+
xlarge: BASE * 1.125,
|
|
9877
|
+
large: BASE,
|
|
9878
|
+
medium: BASE * 0.875,
|
|
9879
|
+
small: BASE * 0.75,
|
|
9880
|
+
xsmall: BASE * 0.625 // 10
|
|
9881
|
+
|
|
9882
|
+
};
|
|
9883
|
+
var fontWeights = {
|
|
9884
|
+
light: 200,
|
|
9885
|
+
regular: 400,
|
|
9886
|
+
semiBold: 600,
|
|
9887
|
+
bold: 700
|
|
9881
9888
|
};
|
|
9882
|
-
var
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9889
|
+
var lineHeights = {
|
|
9890
|
+
xlarge: fontSizes.xlarge + 8,
|
|
9891
|
+
large: fontSizes.large + 8,
|
|
9892
|
+
medium: fontSizes.medium + 8,
|
|
9893
|
+
small: fontSizes.small + 8,
|
|
9894
|
+
xsmall: fontSizes.xsmall + 8
|
|
9886
9895
|
};
|
|
9887
9896
|
|
|
9888
|
-
var
|
|
9889
|
-
colors: _objectSpread2(
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
})
|
|
9897
|
+
var globalTheme = {
|
|
9898
|
+
colors: _objectSpread2({}, systemPalette),
|
|
9899
|
+
space: space,
|
|
9900
|
+
fontSizes: fontSizes,
|
|
9901
|
+
fontWeights: fontWeights,
|
|
9902
|
+
lineHeights: lineHeights
|
|
9895
9903
|
};
|
|
9896
9904
|
|
|
9905
|
+
var getExampleComponentTheme = function getExampleComponentTheme(theme) {
|
|
9906
|
+
var colors = {
|
|
9907
|
+
primaryBg: theme.colors.primaryLight,
|
|
9908
|
+
dangerBg: theme.colors.dangerBackground,
|
|
9909
|
+
warningBg: theme.colors.warningBackground
|
|
9910
|
+
};
|
|
9911
|
+
var space = {
|
|
9912
|
+
smallMargin: theme.space.xxsmall,
|
|
9913
|
+
mediumMargin: theme.space.medium,
|
|
9914
|
+
largeMargin: theme.space.xxxxlarge
|
|
9915
|
+
};
|
|
9916
|
+
return {
|
|
9917
|
+
colors: colors,
|
|
9918
|
+
space: space
|
|
9919
|
+
};
|
|
9920
|
+
};
|
|
9921
|
+
|
|
9922
|
+
var getTheme = function getTheme() {
|
|
9923
|
+
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalTheme;
|
|
9924
|
+
return _objectSpread2(_objectSpread2({}, theme), {}, {
|
|
9925
|
+
__hd__: {
|
|
9926
|
+
exampleComponent: getExampleComponentTheme(theme)
|
|
9927
|
+
}
|
|
9928
|
+
});
|
|
9929
|
+
};
|
|
9930
|
+
|
|
9931
|
+
var theme = getTheme();
|
|
9932
|
+
|
|
9897
9933
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
9898
9934
|
var Square = styled(reactNative$1.View)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
|
|
9899
|
-
var
|
|
9935
|
+
var themeSize = _ref.themeSize;
|
|
9900
9936
|
|
|
9901
|
-
switch (
|
|
9937
|
+
switch (themeSize) {
|
|
9902
9938
|
case 'small':
|
|
9903
9939
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 50px;\n width: 200px;\n "])));
|
|
9904
9940
|
|
|
@@ -9909,48 +9945,49 @@ var Square = styled(reactNative$1.View)(_templateObject || (_templateObject = _t
|
|
|
9909
9945
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 150px;\n width: 300px;\n "])));
|
|
9910
9946
|
}
|
|
9911
9947
|
}, function (_ref2) {
|
|
9912
|
-
var
|
|
9948
|
+
var themeMargin = _ref2.themeMargin,
|
|
9913
9949
|
theme = _ref2.theme;
|
|
9914
9950
|
|
|
9915
|
-
switch (
|
|
9951
|
+
switch (themeMargin) {
|
|
9916
9952
|
case 'small':
|
|
9917
|
-
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.space.
|
|
9953
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.__hd__.exampleComponent.space.smallMargin);
|
|
9918
9954
|
|
|
9919
9955
|
case 'medium':
|
|
9920
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.space.
|
|
9956
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.__hd__.exampleComponent.space.mediumMargin);
|
|
9921
9957
|
|
|
9922
9958
|
case 'large':
|
|
9923
|
-
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.space.
|
|
9959
|
+
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: ", "px;\n "])), theme.__hd__.exampleComponent.space.largeMargin);
|
|
9924
9960
|
}
|
|
9925
9961
|
}, function (_ref3) {
|
|
9926
|
-
var
|
|
9962
|
+
var themeBgColor = _ref3.themeBgColor,
|
|
9927
9963
|
theme = _ref3.theme;
|
|
9928
9964
|
|
|
9929
|
-
switch (
|
|
9965
|
+
switch (themeBgColor) {
|
|
9930
9966
|
case 'primary':
|
|
9931
|
-
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.colors.
|
|
9967
|
+
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.__hd__.exampleComponent.colors.primaryBg);
|
|
9932
9968
|
|
|
9933
9969
|
case 'danger':
|
|
9934
|
-
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.colors.
|
|
9970
|
+
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.__hd__.exampleComponent.colors.dangerBg);
|
|
9935
9971
|
|
|
9936
9972
|
case 'warning':
|
|
9937
|
-
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.colors.
|
|
9973
|
+
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), theme.__hd__.exampleComponent.colors.warningBg);
|
|
9938
9974
|
}
|
|
9939
9975
|
});
|
|
9940
9976
|
|
|
9941
9977
|
var ExampleComponent = function ExampleComponent(_ref) {
|
|
9942
|
-
var _ref$
|
|
9943
|
-
|
|
9944
|
-
|
|
9978
|
+
var _ref$size = _ref.size,
|
|
9979
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
9980
|
+
margin = _ref.margin,
|
|
9945
9981
|
bgColor = _ref.bgColor;
|
|
9946
9982
|
return /*#__PURE__*/React__default["default"].createElement(Square, {
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
}, /*#__PURE__*/React__default["default"].createElement(reactNative$1.Text, null, "Square with ".concat(
|
|
9983
|
+
themeSize: size,
|
|
9984
|
+
themeMargin: margin,
|
|
9985
|
+
themeBgColor: bgColor
|
|
9986
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactNative$1.Text, null, "Square with ".concat(size, " size, ").concat(margin, " margin and ").concat(bgColor, " background.")));
|
|
9951
9987
|
};
|
|
9952
9988
|
|
|
9953
9989
|
exports.ExampleComponent = ExampleComponent;
|
|
9954
9990
|
exports.ThemeProvider = ThemeProvider;
|
|
9991
|
+
exports.getTheme = getTheme;
|
|
9955
9992
|
exports.theme = theme;
|
|
9956
9993
|
exports.useTheme = useTheme;
|