@spothero/ui 22.2.0 → 22.3.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.
@@ -15,7 +15,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
15
15
  /**
16
16
  * A component used in the homepage/midfunnel refresh of 2024
17
17
  * Initially built as purpose built as possible with hopes of extending it to other systems
18
- * using `<RefreshedButton/>` will bring in the core of this.
18
+ * using `<RefreshedButton/>` will bring in the core of this.
19
19
  * The "value" will be the child of the button but must be passed through props like: `<RefreshedButton buttonValue="123"/>`. This aids in the styling.
20
20
  * Recommended to pass a title prop as that will aid in screen readers understanding this due to text not always being in the button
21
21
  */
@@ -54,9 +54,15 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)(({
54
54
  ref: ref,
55
55
  className: classes,
56
56
  variant: "refreshed",
57
- "data-value": buttonValue
57
+ "data-value": buttonValue,
58
+ paddingBottom: "2"
58
59
  }, props, {
59
- isDisabled: isDisabled
60
+ isDisabled: isDisabled,
61
+ sx: {
62
+ '&.FormElement-contains-error': {
63
+ paddingTop: 2
64
+ }
65
+ }
60
66
  }), buttonValue));
61
67
  });
62
68
  var _default = exports.default = Button;
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- Object.defineProperty(exports, "Button", {
7
+ Object.defineProperty(exports, "default", {
8
8
  enumerable: true,
9
9
  get: function () {
10
10
  return _Button.default;
@@ -15,13 +15,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
15
15
  const labelStyle = {
16
16
  color: 'gray.600',
17
17
  fontWeight: 'normal',
18
- top: 3,
18
+ top: 2,
19
19
  left: 0,
20
20
  position: 'absolute',
21
21
  pointerEvents: 'none',
22
22
  padding: 'inherit',
23
- marginX: 3,
24
- paddingX: 1,
23
+ paddingLeft: 3,
25
24
  marginY: 2,
26
25
  transformOrigin: 'left top',
27
26
  // below is from chakra v2 that I'm pulling in
@@ -29,9 +28,8 @@ const labelStyle = {
29
28
  transitionDuration: '200ms'
30
29
  };
31
30
  const activeLabelStyles = {
32
- transform: 'scale(0.85) translateY(-16px)',
31
+ transform: 'scale(0.85) translateY(-.75rem) translateX(.2rem)',
33
32
  _invalid: {
34
- transform: 'scale(1) translateY(0)',
35
33
  '& .chakra-form__required-indicator': {
36
34
  display: 'none'
37
35
  }
@@ -50,9 +48,23 @@ const controlStyles = {
50
48
  opacity: 0
51
49
  },
52
50
  _invalid: {
51
+ '&:focus': {
52
+ borderBottomRadius: 0,
53
+ borderColor: 'primary.default'
54
+ },
55
+ '&:focus + label': {
56
+ color: 'gray.600'
57
+ },
58
+ '& + label': {
59
+ color: 'error',
60
+ transform: 'scale(0.85) translateY(-16px)'
61
+ },
53
62
  '& + label .chakra-form__required-indicator': {
54
63
  //Styling for asterisk always to be red if invalid
55
64
  color: 'error'
65
+ },
66
+ '&::placeholder': {
67
+ opacity: 1
56
68
  }
57
69
  }
58
70
  },
@@ -66,7 +78,7 @@ const controlStyles = {
66
78
  paddingRight: 8 //This should be only when there is a right element - DOM order made this a headache
67
79
  },
68
80
  '.chakra-input__group > .chakra-input__left-element ~ span select': {
69
- paddingLeft: 9,
81
+ paddingLeft: 10,
70
82
  paddingRight: 8 //This should be only when there is a right element - DOM order made this a headache
71
83
  },
72
84
  '.chakra-input__group > .chakra-input__left-element ~ span button': {
@@ -74,18 +86,26 @@ const controlStyles = {
74
86
  paddingRight: 8 //This should be only when there is a right element - DOM order made this a headache
75
87
  },
76
88
  '.chakra-input__group > .chakra-input__left-element ~ span label': {
77
- paddingLeft: 8
89
+ // transform: 'scale(0.85) translateY(-1rem) translateX(.5rem)',
90
+ paddingLeft: '2.75rem'
78
91
  },
79
92
  // Styling for select
80
93
  '.chakra-select__wrapper + label': {
81
94
  ...activeLabelStyles,
82
- transform: 'scale(0.85) translateY(-16px) translateX(-2px)' //X added to help align
95
+ transform: 'scale(0.85) translateY(-.75rem) translateX(.25rem)'
83
96
  },
84
97
  'button[data-value] + label': {
85
98
  ...activeLabelStyles
86
99
  },
87
100
  '.FormElement-contains-error': {
88
101
  borderColor: 'error'
102
+ },
103
+ '.chakra-button + label': {
104
+ display: 'flex',
105
+ alignItems: 'center',
106
+ height: '100%',
107
+ top: 0,
108
+ margin: 0
89
109
  }
90
110
  },
91
111
  _focusWithin: {
@@ -122,7 +142,7 @@ const FormControl = /*#__PURE__*/(0, _react.forwardRef)(({
122
142
  }, controlStyles), /*#__PURE__*/_react.default.createElement(_react2.InputGroup, null, leftElement && /*#__PURE__*/_react.default.createElement(_react2.InputLeftElement, (0, _extends2.default)({
123
143
  pointerEvents: "none",
124
144
  top: "52%",
125
- left: "1.5rem",
145
+ left: "1.3rem",
126
146
  transform: "translate(-50%,-50%)"
127
147
  }, leftElementStyles), leftElement), /*#__PURE__*/_react.default.createElement(_react2.Box, {
128
148
  as: "span",
@@ -15,7 +15,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
15
15
  /**
16
16
  * A component used in the homepage/midfunnel refresh of 2024
17
17
  * Initially built as purpose built as possible with hopes of extending it to other systems
18
- * using `<RefreshedInput/>` will bring in the core of this.
18
+ * using `<RefreshedInput/>` will bring in the core of this.
19
19
  */
20
20
  const Input = /*#__PURE__*/(0, _react.forwardRef)(({
21
21
  label,
@@ -28,6 +28,7 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
28
28
  leftElement,
29
29
  rightElementStyles,
30
30
  leftElementStyles,
31
+ placeholder = '',
31
32
  ...props
32
33
  }, ref) => {
33
34
  const classes = (0, _classnames.default)({
@@ -48,8 +49,12 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)(({
48
49
  leftElementStyles: leftElementStyles,
49
50
  variant: "refreshed"
50
51
  }, /*#__PURE__*/_react.default.createElement(_react2.Input, (0, _extends2.default)({
52
+ placeholder: placeholder,
51
53
  ref: ref,
52
54
  className: classes,
55
+ paddingTop: 'var(--chakra-sizes-5-5)' // Design requires 5.5
56
+ ,
57
+ paddingBottom: "2",
53
58
  variant: "refreshed"
54
59
  }, props)));
55
60
  });
@@ -7,13 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _merge = _interopRequireDefault(require("lodash/merge"));
9
9
  var _styles = _interopRequireDefault(require("../../../Input/styles"));
10
+ //Below isn't being used in build for some reason
10
11
  const variants = {
11
12
  refreshed: {
12
13
  field: {
13
14
  ..._styles.default.variants.outline.field,
14
15
  height: 'auto',
15
- paddingTop: 6,
16
- paddingBottom: 3
16
+ paddingTop: 8,
17
+ paddingBottom: 2
17
18
  }
18
19
  }
19
20
  };
@@ -96,6 +96,7 @@ var _exportNames = {
96
96
  useControllableProp: true,
97
97
  BasicInput: true,
98
98
  useControllableState: true,
99
+ usePopper: true,
99
100
  usePrefersReducedMotion: true,
100
101
  keyframes: true,
101
102
  BoxProps: true,
@@ -641,6 +642,12 @@ Object.defineProperty(exports, "useMediaQuery", {
641
642
  return _react.useMediaQuery;
642
643
  }
643
644
  });
645
+ Object.defineProperty(exports, "usePopper", {
646
+ enumerable: true,
647
+ get: function () {
648
+ return _react.usePopper;
649
+ }
650
+ });
644
651
  Object.defineProperty(exports, "usePrefersReducedMotion", {
645
652
  enumerable: true,
646
653
  get: function () {
@@ -32,6 +32,8 @@ const sizes = {
32
32
  // 16px
33
33
  5: '1.25rem',
34
34
  // 20px
35
+ 5.5: '1.375rem',
36
+ // 22px
35
37
  6: '1.5rem',
36
38
  // 24px
37
39
  7: '1.75rem',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "22.2.0",
3
+ "version": "22.3.0",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "./dist/components/index.js",
6
6
  "exports": "./dist/components/index.js",
@@ -94,11 +94,11 @@
94
94
  "webpack-merge": "5.1.4",
95
95
  "css-loader": "5.1.3",
96
96
  "sass-loader": "10.2.1",
97
+ "@spothero/browserslist-config": "4.0.0",
97
98
  "@spothero/babel-preset-spothero": "5.1.0",
98
99
  "@spothero/core": "7.0.1",
99
100
  "@spothero/eslint-config": "6.1.0",
100
101
  "@spothero/icons": "9.0.1",
101
- "@spothero/browserslist-config": "4.0.0",
102
102
  "@spothero/npm-publisher": "7.0.0",
103
103
  "@spothero/stylelint-config": "6.0.0",
104
104
  "@spothero/prettier-config": "4.0.0"