@smart-react-components/ui 2.0.0-alpha-82 → 2.0.0-alpha-83

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.
@@ -7,7 +7,9 @@ const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"
7
7
  const element_props_1 = __importDefault(require("@smart-react-components/core/element-props"));
8
8
  const change_events_1 = __importDefault(require("@smart-react-components/core/element-props/change-events"));
9
9
  const focus_events_1 = __importDefault(require("@smart-react-components/core/element-props/focus-events"));
10
- const intrinsic_styled_core_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-core-props"));
10
+ const intrinsic_styled_flex_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-flex-props"));
11
+ const intrinsic_styled_margin_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-margin-props"));
12
+ const intrinsic_styled_size_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-size-props"));
11
13
  const keyboard_events_1 = __importDefault(require("@smart-react-components/core/element-props/keyboard-events"));
12
14
  const react_1 = __importDefault(require("react"));
13
15
  const FormBlockLabel_1 = __importDefault(require("../components/Form/FormBlockLabel"));
@@ -65,13 +67,13 @@ const InputNumber = react_1.default.forwardRef((props, forwardRef) => {
65
67
  sizeXl: props.sizeXl,
66
68
  },
67
69
  });
68
- return (react_1.default.createElement(FormBlockLabel_1.default, Object.assign({}, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default]), { formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled }),
70
+ return (react_1.default.createElement(FormBlockLabel_1.default, Object.assign({}, (0, element_props_1.default)(props, [intrinsic_styled_flex_props_1.default, intrinsic_styled_margin_props_1.default]), { formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled }),
69
71
  props.label && react_1.default.createElement("span", null, props.label),
70
72
  react_1.default.createElement(Div_1.default, { display: "flex", flex: "1 1 auto" },
71
73
  ((_a = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _a === void 0 ? void 0 : _a.isExcluded) && leftAddon,
72
74
  react_1.default.createElement(InputWrapper_1.default, { hasBorder: props.hasBorder, hasExcludedLeftAddon: (_b = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _b === void 0 ? void 0 : _b.isExcluded, hasExcludedRightAddon: (_c = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _c === void 0 ? void 0 : _c.isExcluded, isDisabled: props.isDisabled, isFocused: isFocused, isOutline: props.isOutline, isSoft: props.isSoft, palette: props.palette, shape: props.shape },
73
75
  (leftAddon && !((_d = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _d === void 0 ? void 0 : _d.isExcluded)) && leftAddon,
74
- react_1.default.cloneElement(props.template, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, element_props_1.default)(props, [change_events_1.default, focus_events_1.default, keyboard_events_1.default])), (typeof props.defaultValue !== 'undefined' && { defaultValue: ((_e = props.defaultValue) !== null && _e !== void 0 ? _e : '') })), (props.isDisabled && { disabled: true })), (props.isReadOnly && { readOnly: true })), (props.isRequired && { required: true })), (typeof props.max !== 'undefined' && { max: props.max })), (typeof props.min !== 'undefined' && { min: props.min })), (typeof props.step !== 'undefined' && { step: props.step })), (typeof props.value !== 'undefined' && { value: ((_f = props.value) !== null && _f !== void 0 ? _f : '') })), { hasBorder: props.hasBorder, hasLeftAddon: !!leftAddon, hasRightAddon: !!rightAddon, inputSize: props.size, inputSizeSm: props.sizeSm, inputSizeMd: props.sizeMd, inputSizeLg: props.sizeLg, inputSizeXl: props.sizeXl, isDisabled: props.isDisabled, isFocused, isOutline: props.isOutline, isSoft: props.isSoft, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, palette: props.palette, ref: forwardRef, shape: props.shape })),
76
+ react_1.default.cloneElement(props.template, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, element_props_1.default)(props, [change_events_1.default, focus_events_1.default, keyboard_events_1.default, intrinsic_styled_size_props_1.default])), (typeof props.defaultValue !== 'undefined' && { defaultValue: ((_e = props.defaultValue) !== null && _e !== void 0 ? _e : '') })), (props.isDisabled && { disabled: true })), (props.isReadOnly && { readOnly: true })), (props.isRequired && { required: true })), (typeof props.max !== 'undefined' && { max: props.max })), (typeof props.min !== 'undefined' && { min: props.min })), (typeof props.step !== 'undefined' && { step: props.step })), (typeof props.value !== 'undefined' && { value: ((_f = props.value) !== null && _f !== void 0 ? _f : '') })), { hasBorder: props.hasBorder, hasLeftAddon: !!leftAddon, hasRightAddon: !!rightAddon, inputSize: props.size, inputSizeSm: props.sizeSm, inputSizeMd: props.sizeMd, inputSizeLg: props.sizeLg, inputSizeXl: props.sizeXl, isDisabled: props.isDisabled, isFocused, isOutline: props.isOutline, isSoft: props.isSoft, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, palette: props.palette, ref: forwardRef, shape: props.shape })),
75
77
  (rightAddon && !((_g = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _g === void 0 ? void 0 : _g.isExcluded)) && rightAddon),
76
78
  ((_h = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _h === void 0 ? void 0 : _h.isExcluded) && rightAddon)));
77
79
  });
package/Input/index.js CHANGED
@@ -7,7 +7,9 @@ const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"
7
7
  const element_props_1 = __importDefault(require("@smart-react-components/core/element-props"));
8
8
  const change_events_1 = __importDefault(require("@smart-react-components/core/element-props/change-events"));
9
9
  const focus_events_1 = __importDefault(require("@smart-react-components/core/element-props/focus-events"));
10
- const intrinsic_styled_core_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-core-props"));
10
+ const intrinsic_styled_flex_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-flex-props"));
11
+ const intrinsic_styled_margin_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-margin-props"));
12
+ const intrinsic_styled_size_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-size-props"));
11
13
  const keyboard_events_1 = __importDefault(require("@smart-react-components/core/element-props/keyboard-events"));
12
14
  const react_1 = __importDefault(require("react"));
13
15
  const FormBlockLabel_1 = __importDefault(require("../components/Form/FormBlockLabel"));
@@ -46,13 +48,13 @@ const Input = react_1.default.forwardRef((props, forwardRef) => {
46
48
  sizeXl: props.sizeXl,
47
49
  },
48
50
  });
49
- return (react_1.default.createElement(FormBlockLabel_1.default, Object.assign({}, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default]), { formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled }),
51
+ return (react_1.default.createElement(FormBlockLabel_1.default, Object.assign({}, (0, element_props_1.default)(props, [intrinsic_styled_flex_props_1.default, intrinsic_styled_margin_props_1.default]), { formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled }),
50
52
  props.label && react_1.default.createElement("span", null, props.label),
51
53
  react_1.default.createElement(Div_1.default, { display: "flex", flex: "1 1 auto" },
52
54
  ((_a = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _a === void 0 ? void 0 : _a.isExcluded) && leftAddon,
53
55
  react_1.default.createElement(InputWrapper_1.default, { hasBorder: props.hasBorder, hasExcludedLeftAddon: (_b = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _b === void 0 ? void 0 : _b.isExcluded, hasExcludedRightAddon: (_c = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _c === void 0 ? void 0 : _c.isExcluded, isDisabled: props.isDisabled, isFocused: isFocused, isOutline: props.isOutline, isSoft: props.isSoft, palette: props.palette, shape: props.shape },
54
56
  (leftAddon && !((_d = leftAddon === null || leftAddon === void 0 ? void 0 : leftAddon.props) === null || _d === void 0 ? void 0 : _d.isExcluded)) && leftAddon,
55
- react_1.default.cloneElement(props.template, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, element_props_1.default)(props, [change_events_1.default, focus_events_1.default, keyboard_events_1.default])), (typeof props.defaultValue !== 'undefined' && { defaultValue: props.defaultValue })), (typeof props.hasSpellCheck !== 'undefined' && { spellCheck: props.hasSpellCheck })), (props.isDisabled && { disabled: true })), (props.isReadOnly && { readOnly: true })), (props.isRequired && { required: true })), (typeof props.placeholder !== 'undefined' && { placeholder: props.placeholder })), (typeof props.value !== 'undefined' && { value: props.value })), props.inputProps), { hasBorder: props.hasBorder, hasLeftAddon: !!leftAddon, hasRightAddon: !!rightAddon, inputSize: props.size, inputSizeSm: props.sizeSm, inputSizeMd: props.sizeMd, inputSizeLg: props.sizeLg, inputSizeXl: props.sizeXl, isDisabled: props.isDisabled, isFocused, isOutline: props.isOutline, isSoft: props.isSoft, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, palette: props.palette, ref: forwardRef, shape: props.shape, type: props.type })),
57
+ react_1.default.cloneElement(props.template, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, element_props_1.default)(props, [change_events_1.default, focus_events_1.default, keyboard_events_1.default, intrinsic_styled_size_props_1.default])), (typeof props.defaultValue !== 'undefined' && { defaultValue: props.defaultValue })), (typeof props.hasSpellCheck !== 'undefined' && { spellCheck: props.hasSpellCheck })), (props.isDisabled && { disabled: true })), (props.isReadOnly && { readOnly: true })), (props.isRequired && { required: true })), (typeof props.placeholder !== 'undefined' && { placeholder: props.placeholder })), (typeof props.value !== 'undefined' && { value: props.value })), props.inputProps), { hasBorder: props.hasBorder, hasLeftAddon: !!leftAddon, hasRightAddon: !!rightAddon, inputSize: props.size, inputSizeSm: props.sizeSm, inputSizeMd: props.sizeMd, inputSizeLg: props.sizeLg, inputSizeXl: props.sizeXl, isDisabled: props.isDisabled, isFocused, isOutline: props.isOutline, isSoft: props.isSoft, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, palette: props.palette, ref: forwardRef, shape: props.shape, type: props.type })),
56
58
  (rightAddon && !((_e = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _e === void 0 ? void 0 : _e.isExcluded)) && rightAddon),
57
59
  ((_f = rightAddon === null || rightAddon === void 0 ? void 0 : rightAddon.props) === null || _f === void 0 ? void 0 : _f.isExcluded) && rightAddon)));
58
60
  });
@@ -22,6 +22,14 @@ exports.default = (0, styled_components_1.default)(ButtonListElement_1.default)(
22
22
  border-radius: 0;
23
23
  }
24
24
 
25
+ &:not(:last-child) {
26
+ ${ButtonElement_1.default},
27
+ ${ButtonAddonElement_1.default},
28
+ ${ButtonContent_1.default} {
29
+ border-right: 0;
30
+ }
31
+ }
32
+
25
33
  &:focus {
26
34
  box-shadow: none;
27
35
  }
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const PickerElement_1 = __importDefault(require("./PickerElement"));
10
10
  exports.default = (0, styled_components_1.default)(PickerElement_1.default).attrs(({ bgElRef, children, value }) => ({
11
- children: (react_1.default.createElement("div", { ref: bgElRef },
11
+ children: (react_1.default.createElement("div", { className: "src-color-picker-major-picker-bg", ref: bgElRef },
12
12
  react_1.default.createElement(Div_1.default, { background: "linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0))" },
13
13
  react_1.default.createElement(Div_1.default, { background: "linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0))", boxShadow: "0 0 3px rgba(0,0,0,.3) inset" }, children)))),
14
14
  getColorPickerSize: (v, t) => `
@@ -17,6 +17,10 @@ exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, isDi
17
17
  border-radius: ${(0, css_1.toCSSValue)(theme.$.radius.colorPicker)(v => v * 2)};
18
18
  }
19
19
 
20
+ .src-color-picker-major-picker-bg {
21
+ border-radius: calc(${(0, css_1.toCSSValue)(theme.$.radius.colorPicker)(v => v * 2)} + 1px);
22
+ }
23
+
20
24
  div {
21
25
  height: 100%;
22
26
  }
@@ -12,7 +12,7 @@ exports.default = (0, styled_components_1.default)(Header_1.default).attrs({
12
12
  > div:first-child {
13
13
  cursor: default;
14
14
  font-weight: ${t.$.fontWeight.datePicker};
15
- padding-left: ${t.$.size.datePicker[v].headerSpace};
15
+ padding-left: ${t.$.size.datePicker[v].headerSpace.x};
16
16
  }
17
17
 
18
18
  > div:last-child {
@@ -9,7 +9,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const types_1 = require("../../types");
10
10
  const css_1 = require("../../util/css");
11
11
  const props_1 = require("../../util/props");
12
- exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ isSeparated }) => (Object.assign(Object.assign({}, (isSeparated && { as: 'label' })), { getInputSize: (v, t) => `
12
+ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ className = '', isSeparated }) => (Object.assign(Object.assign({}, (isSeparated && { as: 'label' })), { className: `src-input-addon ${className}`, getInputSize: (v, t) => `
13
13
  font-size: ${t.$.size.form.blockLabel[v].fontSize};
14
14
  padding: ${(0, css_1.toCSSValue)(t.$.size.input[v].padding.x)(v => v / 2)};
15
15
 
@@ -9,7 +9,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const css_1 = require("../../util/css");
10
10
  const dom_1 = require("../../util/dom");
11
11
  const InputPlaceholder_1 = __importDefault(require("./InputPlaceholder"));
12
- exports.default = (0, styled_components_1.default)(Input_1.default).attrs(({ hasLeftAddon, hasRightAddon, isInput = true }) => (Object.assign(Object.assign({}, (!isInput && { as: 'div' })), { getInputSize: (v, t) => `
12
+ exports.default = (0, styled_components_1.default)(Input_1.default).attrs(({ className = '', hasLeftAddon, hasRightAddon, isInput = true }) => (Object.assign(Object.assign({}, (!isInput && { as: 'div' })), { className: `src-input ${className}`, getInputSize: (v, t) => `
13
13
  font-size: ${t.$.size.input[v].fontSize};
14
14
  padding: ${t.$.size.input[v].padding.y} ${t.$.size.input[v].padding.x};
15
15
 
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"));
7
7
  const styled_components_1 = __importDefault(require("styled-components"));
8
8
  const css_1 = require("../../util/css");
9
- const InputAddonElement_1 = __importDefault(require("./InputAddonElement"));
10
- const InputElement_1 = __importDefault(require("./InputElement"));
11
9
  exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
12
10
  getInputSize: (v, t) => `
13
- ${InputAddonElement_1.default} {
11
+ .src-input-addon {
14
12
  padding: 0;
15
13
 
16
14
  > div {
@@ -22,7 +20,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
22
20
  display: flex;
23
21
  flex: 1 1 auto;
24
22
 
25
- ${InputElement_1.default} {
23
+ .src-input {
26
24
  -moz-appearance: textfield;
27
25
 
28
26
  &::-webkit-inner-spin-button,
@@ -32,7 +30,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
32
30
  }
33
31
  }
34
32
 
35
- ${InputAddonElement_1.default} {
33
+ .src-input-addon {
36
34
  flex-direction: column;
37
35
  user-select: none;
38
36
 
@@ -52,7 +50,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
52
50
  }
53
51
  }
54
52
 
55
- &:hover ${InputAddonElement_1.default} > div {
53
+ &:hover .src-input-addon > div {
56
54
  visibility: visible;
57
55
  }
58
56
  `;
@@ -26,7 +26,13 @@ exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasB
26
26
  `}
27
27
  `
28
28
  : `
29
- border-color: ${!isFocused ? theme.$.color.dynamic.accent : theme.$.palette[palette].main};
29
+ ${!isFocused
30
+ ? `
31
+ border-color: ${theme.$.color.dynamic.accent};
32
+ `
33
+ : `
34
+ border-color: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
35
+ `}
30
36
  `}
31
37
 
32
38
  ${isDisabled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart-react-components/ui",
3
- "version": "2.0.0-alpha-82",
3
+ "version": "2.0.0-alpha-83",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "description": "SRC UI includes React and Styled components.",