@skyscanner/backpack-web 38.14.0 → 38.15.0
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/bpk-component-star-rating/src/BpkStar.js +3 -3
- package/bpk-component-textarea/index.d.ts +4 -0
- package/bpk-component-textarea/index.js +3 -1
- package/bpk-component-textarea/src/BpkTextarea.d.ts +11 -0
- package/bpk-component-textarea/src/BpkTextarea.js +9 -20
- package/bpk-component-textarea/src/themeAttributes.d.ts +2 -0
- package/bpk-component-textarea/src/themeAttributes.js +4 -1
- package/package.json +1 -1
|
@@ -48,16 +48,16 @@ const BpkStar = ({
|
|
|
48
48
|
const halfIconClassNames = getClassName('bpk-star', 'bpk-star--half', 'bpk-star--filled');
|
|
49
49
|
let Icon = SmallIcon;
|
|
50
50
|
let OutlineIcon = OutlineSmallIcon;
|
|
51
|
-
let HalfIcon = HalfSmallIcon;
|
|
51
|
+
let HalfIcon = withRtlSupport(HalfSmallIcon);
|
|
52
52
|
if (large) {
|
|
53
53
|
Icon = LargeIcon;
|
|
54
54
|
OutlineIcon = OutlineLargeIcon;
|
|
55
|
-
HalfIcon = HalfLargeIcon;
|
|
55
|
+
HalfIcon = withRtlSupport(HalfLargeIcon);
|
|
56
56
|
}
|
|
57
57
|
if (extraLarge) {
|
|
58
58
|
Icon = ExtraLargeIcon;
|
|
59
59
|
OutlineIcon = OutlineExtraLargeIcon;
|
|
60
|
-
HalfIcon = HalfExtraLargeIcon;
|
|
60
|
+
HalfIcon = withRtlSupport(HalfExtraLargeIcon);
|
|
61
61
|
}
|
|
62
62
|
if (type === STAR_TYPES.HALF) {
|
|
63
63
|
return (
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import BpkTextarea from "./src/BpkTextarea";
|
|
18
20
|
import themeAttributes from "./src/themeAttributes";
|
|
19
21
|
export default BpkTextarea;
|
|
20
22
|
export { themeAttributes };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
interface BpkTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
valid?: boolean;
|
|
8
|
+
large?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const BpkTextarea: FC<BpkTextareaProps>;
|
|
11
|
+
export default BpkTextarea;
|
|
@@ -14,36 +14,25 @@
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/
|
|
17
|
+
*/
|
|
18
|
+
|
|
18
19
|
import { cssModules } from "../../bpk-react-utils";
|
|
19
20
|
import STYLES from "./BpkTextarea.module.css";
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
const getClassName = cssModules(STYLES);
|
|
22
23
|
const BpkTextarea = ({
|
|
23
|
-
className
|
|
24
|
+
className,
|
|
24
25
|
large = false,
|
|
25
|
-
valid
|
|
26
|
+
valid,
|
|
26
27
|
...rest
|
|
27
28
|
}) => {
|
|
28
29
|
// Explicit check for false primitive value as undefined is
|
|
29
30
|
// treated as neither valid nor invalid
|
|
30
31
|
const isInvalid = valid === false;
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"aria-invalid": isInvalid,
|
|
37
|
-
...rest
|
|
38
|
-
})
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
BpkTextarea.propTypes = {
|
|
42
|
-
id: PropTypes.string.isRequired,
|
|
43
|
-
name: PropTypes.string.isRequired,
|
|
44
|
-
value: PropTypes.string.isRequired,
|
|
45
|
-
className: PropTypes.string,
|
|
46
|
-
valid: PropTypes.bool,
|
|
47
|
-
large: PropTypes.bool
|
|
32
|
+
return /*#__PURE__*/_jsx("textarea", {
|
|
33
|
+
className: getClassName('bpk-textarea', isInvalid && 'bpk-textarea--invalid', large && 'bpk-textarea--large', className),
|
|
34
|
+
"aria-invalid": isInvalid,
|
|
35
|
+
...rest
|
|
36
|
+
});
|
|
48
37
|
};
|
|
49
38
|
export default BpkTextarea;
|
|
@@ -14,4 +14,7 @@
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const themeAttributes = ['textareaInvalidBorderColor'];
|
|
20
|
+
export default themeAttributes;
|