@smart-react-components/ui 2.0.0-alpha-119 → 2.0.0-alpha-121
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/components/Checkbox/CheckboxElement.js +21 -16
- package/components/ColorPicker/ColorPickerElement.js +1 -1
- package/components/ColorPicker/PaletteSection/PaletteItemElement.js +2 -2
- package/components/ColorPicker/PaletteSection/PaletteList.js +3 -1
- package/components/ColorPicker/PaletteSection/index.js +3 -1
- package/components/Form/FormInlineLabel.js +1 -1
- package/package.json +7 -7
|
@@ -36,7 +36,7 @@ const Svg = styled_components_1.default.svg.attrs({
|
|
|
36
36
|
|
|
37
37
|
> path {
|
|
38
38
|
fill: transparent;
|
|
39
|
-
stroke: ${theme.$.color.
|
|
39
|
+
stroke: ${theme.$.color.white};
|
|
40
40
|
stroke-width: 4px;
|
|
41
41
|
stroke-dasharray: 36px;
|
|
42
42
|
stroke-dashoffset: 36px;
|
|
@@ -46,7 +46,7 @@ const Svg = styled_components_1.default.svg.attrs({
|
|
|
46
46
|
const IndeterminateMark = styled_components_1.default.div.attrs({
|
|
47
47
|
className: 'src-checkbox-indeterminate-mark',
|
|
48
48
|
})(({ theme }) => `
|
|
49
|
-
background: ${theme.$.color.
|
|
49
|
+
background: ${theme.$.color.white};
|
|
50
50
|
height: 2px;
|
|
51
51
|
margin-top: -1px;
|
|
52
52
|
opacity: 0;
|
|
@@ -74,7 +74,8 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
74
74
|
|
|
75
75
|
.src-checkbox-container {
|
|
76
76
|
border-radius: ${theme.$.radius.checkbox[shape]};
|
|
77
|
-
|
|
77
|
+
transition: border-color 200ms 0s ease-in-out;
|
|
78
|
+
|
|
78
79
|
${!isOutline
|
|
79
80
|
? `
|
|
80
81
|
background: ${theme.$.color.dynamic.accent};
|
|
@@ -88,22 +89,26 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
88
89
|
|
|
89
90
|
${isChecked
|
|
90
91
|
? `
|
|
91
|
-
.src-checkbox-
|
|
92
|
-
|
|
93
|
-
}
|
|
92
|
+
.src-checkbox-container {
|
|
93
|
+
border-color: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
.src-checkbox-rectangle {
|
|
96
|
+
background: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
${!isIndeterminate
|
|
96
100
|
? `
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
.src-checkbox-svg > path {
|
|
102
|
+
stroke-dashoffset: 0;
|
|
103
|
+
}
|
|
104
|
+
`
|
|
101
105
|
: `
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
.src-checkbox-indeterminate-mark {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: scaleX(1);
|
|
109
|
+
}
|
|
110
|
+
`}
|
|
111
|
+
}
|
|
107
112
|
`
|
|
108
113
|
: ''}
|
|
109
114
|
`);
|
|
@@ -11,7 +11,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
|
|
|
11
11
|
width: ${t.$.size.colorPicker[v].width};
|
|
12
12
|
|
|
13
13
|
> *:not(:first-child) {
|
|
14
|
-
|
|
14
|
+
margin-top: ${t.$.size.colorPicker[v].space};
|
|
15
15
|
}
|
|
16
16
|
`,
|
|
17
17
|
})(({ theme, isOutline }) => `
|
|
@@ -20,7 +20,7 @@ exports.default = (0, styled_components_1.default)(Li_1.default).attrs(({
|
|
|
20
20
|
`,
|
|
21
21
|
}))(({ theme, isDisabled }) => `
|
|
22
22
|
align-items: center;
|
|
23
|
-
border-color: ${theme.$.color.gray400};
|
|
23
|
+
border-color: ${theme.$.vars.isDarkMode ? theme.$.color.gray700 : theme.$.color.gray400};
|
|
24
24
|
border-radius: ${theme.$.radius.colorPicker};
|
|
25
25
|
display: flex;
|
|
26
26
|
justify-content: center;
|
|
@@ -32,7 +32,7 @@ exports.default = (0, styled_components_1.default)(Li_1.default).attrs(({
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
${Svg_1.default} {
|
|
35
|
-
fill: ${theme.$.color.gray500};
|
|
35
|
+
fill: ${theme.$.vars.isDarkMode ? theme.$.color.gray600 : theme.$.color.gray500};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
${isDisabled
|
|
@@ -7,6 +7,7 @@ const Hr_1 = __importDefault(require("@smart-react-components/core/Element/Hr"))
|
|
|
7
7
|
const Ul_1 = __importDefault(require("@smart-react-components/core/Element/Ul"));
|
|
8
8
|
const color_1 = require("@smart-react-components/core/util/color");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const styled_components_1 = require("styled-components");
|
|
10
11
|
const ColorPickerProps_1 = __importDefault(require("../../../context/ColorPickerProps"));
|
|
11
12
|
const Add_1 = __importDefault(require("../../../icons/Add"));
|
|
12
13
|
const color_picker_1 = require("../../../util/color-picker");
|
|
@@ -14,6 +15,7 @@ const props_1 = require("../../../util/props");
|
|
|
14
15
|
const PaletteItemElement_1 = __importDefault(require("./PaletteItemElement"));
|
|
15
16
|
const PaletteListContainerElement_1 = __importDefault(require("./PaletteListContainerElement"));
|
|
16
17
|
const PaletteList = ({ canAddColorToPalette, format, paletteColors, setPaletteColors }) => {
|
|
18
|
+
const theme = (0, styled_components_1.useTheme)();
|
|
17
19
|
const { colorPickerSize, colorPickerSizeSm, colorPickerSizeMd, colorPickerSizeLg, colorPickerSizeXl, isDisabled, updateValue, value } = react_1.default.useContext(ColorPickerProps_1.default);
|
|
18
20
|
const handleAddItemClick = () => {
|
|
19
21
|
if (value && !paletteColors.find(item => (0, color_picker_1.isEqual)((0, color_1.getColor)(item), value))) {
|
|
@@ -24,7 +26,7 @@ const PaletteList = ({ canAddColorToPalette, format, paletteColors, setPaletteCo
|
|
|
24
26
|
react_1.default.createElement(Hr_1.default, Object.assign({}, (0, props_1.applyResponsiveStyledProps)({ colorPickerSize, colorPickerSizeSm, colorPickerSizeMd, colorPickerSizeLg, colorPickerSizeXl }, 'colorPickerSize', {
|
|
25
27
|
marginLeft: v => `-$size.colorPicker.${v}.space`,
|
|
26
28
|
width: v => `calc(100% + calc({size.colorPicker.${v}.space} * 2))`,
|
|
27
|
-
}), { background:
|
|
29
|
+
}), { background: theme.$.vars.isDarkMode ? '$color.gray800' : '$color.gray400', backgroundClip: "content-box", border: "none", boxSizing: "content-box", height: 2 })),
|
|
28
30
|
react_1.default.createElement(Ul_1.default, Object.assign({}, (0, props_1.applyResponsiveStyledProps)({ colorPickerSize, colorPickerSizeSm, colorPickerSizeMd, colorPickerSizeLg, colorPickerSizeXl }, 'colorPickerSize', {
|
|
29
31
|
marginLeft: v => `-$size.colorPicker.${v}.space`,
|
|
30
32
|
marginTop: v => `-$size.colorPicker.${v}.space`,
|
|
@@ -6,18 +6,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const Section_1 = __importDefault(require("@smart-react-components/core/Element/Section"));
|
|
7
7
|
const CSSTransition_1 = __importDefault(require("@smart-react-components/transition/CSSTransition"));
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const styled_components_1 = require("styled-components");
|
|
9
10
|
const color_picker_1 = require("../../../constants/color-picker");
|
|
10
11
|
const ColorPickerProps_1 = __importDefault(require("../../../context/ColorPickerProps"));
|
|
11
12
|
const ArrowMultipleDown_1 = __importDefault(require("../../../icons/ArrowMultipleDown"));
|
|
12
13
|
const props_1 = require("../../../util/props");
|
|
13
14
|
const PaletteList_1 = __importDefault(require("./PaletteList"));
|
|
14
15
|
const PaletteSection = ({ canAddColorToPalette, format, paletteColors, setPaletteColors }) => {
|
|
16
|
+
const theme = (0, styled_components_1.useTheme)();
|
|
15
17
|
const { colorPickerSize, colorPickerSizeSm, colorPickerSizeMd, colorPickerSizeLg, colorPickerSizeXl, isDisabled } = react_1.default.useContext(ColorPickerProps_1.default);
|
|
16
18
|
const [localPaletteColors, setLocalPaletteColors] = react_1.default.useState(() => color_picker_1.defaultPaletteColors);
|
|
17
19
|
const [status, setStatus] = react_1.default.useState(() => false);
|
|
18
20
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
19
21
|
react_1.default.createElement(Section_1.default, null,
|
|
20
|
-
react_1.default.createElement(ArrowMultipleDown_1.default, Object.assign({}, (0, props_1.applyResponsiveStyledProp)({ colorPickerSize, colorPickerSizeSm, colorPickerSizeMd, colorPickerSizeLg, colorPickerSizeXl }, 'colorPickerSize', 'iconSize', v => `$size.icon.${v}`), { display: "block", fill:
|
|
22
|
+
react_1.default.createElement(ArrowMultipleDown_1.default, Object.assign({}, (0, props_1.applyResponsiveStyledProp)({ colorPickerSize, colorPickerSizeSm, colorPickerSizeMd, colorPickerSizeLg, colorPickerSizeXl }, 'colorPickerSize', 'iconSize', v => `$size.icon.${v}`), { display: "block", fill: theme.$.vars.isDarkMode ? '$color.gray600' : '$color.gray500', margin: "auto" }, (!isDisabled && { onClick: () => setStatus(!status) })))),
|
|
21
23
|
react_1.default.createElement(CSSTransition_1.default, { className: "src-fade", duration: 150, status: status },
|
|
22
24
|
react_1.default.createElement(PaletteList_1.default, { canAddColorToPalette: canAddColorToPalette, format: format, paletteColors: paletteColors !== null && paletteColors !== void 0 ? paletteColors : localPaletteColors, setPaletteColors: setPaletteColors !== null && setPaletteColors !== void 0 ? setPaletteColors : setLocalPaletteColors }))));
|
|
23
25
|
};
|
|
@@ -36,7 +36,7 @@ exports.default = (0, styled_components_1.default)(Label_1.default).attrs(({ isB
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
> span {
|
|
39
|
-
color: ${theme.$.color.dynamic.
|
|
39
|
+
color: ${theme.$.color.dynamic.bodyFont};
|
|
40
40
|
display: inline-flex;
|
|
41
41
|
flex: 1 1 auto;
|
|
42
42
|
font-family: ${theme.$.fontFamily.form};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-react-components/ui",
|
|
3
|
-
"version": "2.0.0-alpha-
|
|
3
|
+
"version": "2.0.0-alpha-121",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"description": "SRC UI includes React and Styled components.",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"test": "jest"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@smart-react-components/core": "2.0.0-alpha-
|
|
68
|
-
"@smart-react-components/router": "2.0.0-alpha-
|
|
69
|
-
"@smart-react-components/transition": "2.0.0-alpha-
|
|
67
|
+
"@smart-react-components/core": "2.0.0-alpha-46",
|
|
68
|
+
"@smart-react-components/router": "2.0.0-alpha-43",
|
|
69
|
+
"@smart-react-components/transition": "2.0.0-alpha-40",
|
|
70
70
|
"@testing-library/react": "13.4.0",
|
|
71
71
|
"@types/jest": "29.0.1",
|
|
72
72
|
"@types/react": "18.0.19",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"typescript": "4.8.3"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@smart-react-components/core": "^2.0.0-alpha-
|
|
87
|
-
"@smart-react-components/router": "^2.0.0-alpha-
|
|
88
|
-
"@smart-react-components/transition": "^2.0.0-alpha-
|
|
86
|
+
"@smart-react-components/core": "^2.0.0-alpha-46",
|
|
87
|
+
"@smart-react-components/router": "^2.0.0-alpha-43",
|
|
88
|
+
"@smart-react-components/transition": "^2.0.0-alpha-40",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|
|
91
91
|
"styled-components": "^5.3.5"
|