@thecb/components 6.0.0 → 6.0.1
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/index.cjs.js +6 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +10 -6
- package/src/util/general.js +21 -0
- package/src/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, Fragment, useState, useRef, createRef } from "react";
|
|
2
2
|
import { Box, Stack } from "../layouts";
|
|
3
3
|
import Text from "../text";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
noop,
|
|
6
|
+
inputDisabledStyle,
|
|
7
|
+
inputPlaceholderTextStyle
|
|
8
|
+
} from "../../../util/general";
|
|
5
9
|
import DropdownIcon from "./DropdownIcon";
|
|
6
10
|
import styled from "styled-components";
|
|
7
11
|
// support for Array.prototype.at() in older browsers
|
|
@@ -12,7 +16,8 @@ import {
|
|
|
12
16
|
GREY_CHATEAU,
|
|
13
17
|
STORM_GREY,
|
|
14
18
|
MINESHAFT_GREY,
|
|
15
|
-
ERROR_COLOR
|
|
19
|
+
ERROR_COLOR,
|
|
20
|
+
CHARADE_GREY
|
|
16
21
|
} from "../../../constants/colors";
|
|
17
22
|
import { fallbackValues } from "./Dropdown.theme";
|
|
18
23
|
import { themeComponent } from "../../../util/themeUtils";
|
|
@@ -300,10 +305,9 @@ const Dropdown = ({
|
|
|
300
305
|
: GREY_CHATEAU
|
|
301
306
|
}
|
|
302
307
|
extraStyles={
|
|
303
|
-
disabled
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
pointer-events: none;`
|
|
308
|
+
disabled
|
|
309
|
+
? `${inputPlaceholderTextStyle}${inputDisabledStyle}`
|
|
310
|
+
: inputPlaceholderTextStyle
|
|
307
311
|
}
|
|
308
312
|
hoverStyles={`background-color: ${themeValues.hoverColor};`}
|
|
309
313
|
isOpen={isOpen}
|
package/src/util/general.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Fragment } from "react";
|
|
2
2
|
import numeral from "numeral";
|
|
3
|
+
import { CHARADE_GREY } from "../constants/colors";
|
|
3
4
|
|
|
4
5
|
export const noop = () => {};
|
|
5
6
|
|
|
@@ -96,3 +97,23 @@ export const screenReaderOnlyStyle = `
|
|
|
96
97
|
height: 1px;
|
|
97
98
|
overflow: hidden;
|
|
98
99
|
`;
|
|
100
|
+
|
|
101
|
+
export const inputPlaceholderTextStyle = `
|
|
102
|
+
::-webkit-input-placeholder {
|
|
103
|
+
color: ${CHARADE_GREY};
|
|
104
|
+
}
|
|
105
|
+
::-moz-placeholder {
|
|
106
|
+
color: ${CHARADE_GREY};
|
|
107
|
+
}
|
|
108
|
+
::-ms-placeholder {
|
|
109
|
+
color: ${CHARADE_GREY};
|
|
110
|
+
}
|
|
111
|
+
::placeholder {
|
|
112
|
+
color: ${CHARADE_GREY};
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
export const inputDisabledStyle = `
|
|
116
|
+
color: #6e727e;
|
|
117
|
+
background-color: #f7f7f7;
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
`;
|
package/src/.DS_Store
DELETED
|
Binary file
|