@tecsinapse/react-web-kit 3.3.8 → 3.3.9
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/dist/cjs/components/molecules/Select/Select.js +13 -1
- package/dist/cjs/components/molecules/Select/styled.js +6 -11
- package/dist/esm/components/molecules/Select/Select.js +14 -2
- package/dist/esm/components/molecules/Select/styled.js +6 -11
- package/dist/types/components/molecules/Select/styled.d.ts +11 -6
- package/package.json +3 -3
|
@@ -104,13 +104,25 @@ const Select = ({
|
|
|
104
104
|
() => setDropDownVisible((prev) => !prev),
|
|
105
105
|
[setDropDownVisible]
|
|
106
106
|
);
|
|
107
|
+
const RightComponent = React.useMemo(
|
|
108
|
+
() => /* @__PURE__ */ React.createElement(
|
|
109
|
+
styled.StyledIconComponent,
|
|
110
|
+
{
|
|
111
|
+
name: "chevron-down",
|
|
112
|
+
type: "material-community",
|
|
113
|
+
size: "centi",
|
|
114
|
+
disabled
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
[disabled]
|
|
118
|
+
);
|
|
107
119
|
return /* @__PURE__ */ React.createElement(styled.StyledContainer, { ref: refDropDown, ...rest }, /* @__PURE__ */ React.createElement(styled.StyledInputContainer, { onFocus: handlePressInput }, /* @__PURE__ */ React.createElement(
|
|
108
120
|
reactCore.PressableInputContainer,
|
|
109
121
|
{
|
|
110
122
|
label: _label,
|
|
111
123
|
onPress,
|
|
112
124
|
disabled,
|
|
113
|
-
rightComponent:
|
|
125
|
+
rightComponent: RightComponent
|
|
114
126
|
},
|
|
115
127
|
/* @__PURE__ */ React.createElement(
|
|
116
128
|
reactCore.Text,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var styled = require('@emotion/styled');
|
|
4
4
|
var reactCore = require('@tecsinapse/react-core');
|
|
5
|
-
var
|
|
5
|
+
var styled$1 = require('@emotion/native');
|
|
6
6
|
|
|
7
7
|
const StyledContainer = styled("div")`
|
|
8
8
|
display: flex;
|
|
@@ -15,16 +15,11 @@ const StyledContainer = styled("div")`
|
|
|
15
15
|
const StyledInputContainer = styled("div")`
|
|
16
16
|
width: 100%;
|
|
17
17
|
`;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
type: "material-community",
|
|
23
|
-
size: "centi",
|
|
24
|
-
style: { marginRight: 12 }
|
|
25
|
-
}
|
|
26
|
-
);
|
|
18
|
+
const StyledIconComponent = styled$1(reactCore.Icon)`
|
|
19
|
+
margin-right: 12px;
|
|
20
|
+
color: ${({ disabled, theme }) => disabled ? theme.color.secondary.light : "inherit"};
|
|
21
|
+
`;
|
|
27
22
|
|
|
28
|
-
exports.RightComponent = RightComponent;
|
|
29
23
|
exports.StyledContainer = StyledContainer;
|
|
24
|
+
exports.StyledIconComponent = StyledIconComponent;
|
|
30
25
|
exports.StyledInputContainer = StyledInputContainer;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PressableInputContainer, Text } from '@tecsinapse/react-core';
|
|
2
|
-
import React__default, { useState, useId, useEffect } from 'react';
|
|
2
|
+
import React__default, { useState, useId, useEffect, useMemo } from 'react';
|
|
3
3
|
import { Transition } from 'react-transition-group';
|
|
4
4
|
import { useClickAwayListener } from '../../../hooks/useClickAwayListener.js';
|
|
5
5
|
import { defaultStyles, transition } from './animations.js';
|
|
6
6
|
import Dropdown from './Dropdown/Dropdown.js';
|
|
7
7
|
import { getDisplayValue } from './functions.js';
|
|
8
|
-
import { StyledContainer, StyledInputContainer
|
|
8
|
+
import { StyledIconComponent, StyledContainer, StyledInputContainer } from './styled.js';
|
|
9
9
|
|
|
10
10
|
const Select = ({
|
|
11
11
|
value,
|
|
@@ -102,6 +102,18 @@ const Select = ({
|
|
|
102
102
|
() => setDropDownVisible((prev) => !prev),
|
|
103
103
|
[setDropDownVisible]
|
|
104
104
|
);
|
|
105
|
+
const RightComponent = useMemo(
|
|
106
|
+
() => /* @__PURE__ */ React__default.createElement(
|
|
107
|
+
StyledIconComponent,
|
|
108
|
+
{
|
|
109
|
+
name: "chevron-down",
|
|
110
|
+
type: "material-community",
|
|
111
|
+
size: "centi",
|
|
112
|
+
disabled
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
[disabled]
|
|
116
|
+
);
|
|
105
117
|
return /* @__PURE__ */ React__default.createElement(StyledContainer, { ref: refDropDown, ...rest }, /* @__PURE__ */ React__default.createElement(StyledInputContainer, { onFocus: handlePressInput }, /* @__PURE__ */ React__default.createElement(
|
|
106
118
|
PressableInputContainer,
|
|
107
119
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { Icon } from '@tecsinapse/react-core';
|
|
3
|
-
import
|
|
3
|
+
import styled$1 from '@emotion/native';
|
|
4
4
|
|
|
5
5
|
const StyledContainer = styled("div")`
|
|
6
6
|
display: flex;
|
|
@@ -13,14 +13,9 @@ const StyledContainer = styled("div")`
|
|
|
13
13
|
const StyledInputContainer = styled("div")`
|
|
14
14
|
width: 100%;
|
|
15
15
|
`;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
type: "material-community",
|
|
21
|
-
size: "centi",
|
|
22
|
-
style: { marginRight: 12 }
|
|
23
|
-
}
|
|
24
|
-
);
|
|
16
|
+
const StyledIconComponent = styled$1(Icon)`
|
|
17
|
+
margin-right: 12px;
|
|
18
|
+
color: ${({ disabled, theme }) => disabled ? theme.color.secondary.light : "inherit"};
|
|
19
|
+
`;
|
|
25
20
|
|
|
26
|
-
export {
|
|
21
|
+
export { StyledContainer, StyledIconComponent, StyledInputContainer };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export declare const StyledContainer: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?:
|
|
5
|
-
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>,
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
6
|
export declare const StyledInputContainer: import("@emotion/styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?:
|
|
9
|
-
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>,
|
|
10
|
-
export declare const
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const StyledIconComponent: import("@emotion/native").StyledComponent<import("@tecsinapse/react-core").IconProps & {
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
} & Partial<import("@tecsinapse/react-core").ThemeProviderProps & {
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
}>, {}, {}>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/react-web-kit",
|
|
3
3
|
"description": "TecSinapse React components",
|
|
4
|
-
"version": "3.3.
|
|
4
|
+
"version": "3.3.9",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@emotion/native": "~11.11.0",
|
|
22
22
|
"@emotion/react": "~11.11.0",
|
|
23
23
|
"@emotion/styled": "~11.11.0",
|
|
24
|
-
"@tecsinapse/react-core": "3.3.
|
|
24
|
+
"@tecsinapse/react-core": "3.3.6",
|
|
25
25
|
"date-fns": "~2.30.0",
|
|
26
26
|
"react-native-vector-icons": "^9.2.0",
|
|
27
27
|
"react-transition-group": "~4.4.5"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"react-dom": "^18.0.0",
|
|
41
41
|
"react-native-web": ">=0.18.0 <1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a1489e62337d020ca4e197c864e64f464a20d1a1"
|
|
44
44
|
}
|