@spothero/ui 17.1.0-beta.3 → 17.1.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.
Files changed (38) hide show
  1. package/dist/components/Alert/Alert.js +29 -18
  2. package/dist/components/Alert/Alert.stories.js +56 -39
  3. package/dist/components/FormControl/FormControl.js +3 -2
  4. package/dist/components/Modal/Modal.js +11 -2
  5. package/dist/components/Toast/Toast.stories.js +102 -0
  6. package/dist/components/index.js +7 -16
  7. package/dist/components/styles.js +12 -20
  8. package/dist/theme/base/index.js +21 -1
  9. package/dist/{components/Alert/styles/index.js → theme/base/notifications.js} +79 -65
  10. package/package.json +6 -6
  11. package/dist/components/Datepicker/Range/DatepickerRange.js +0 -67
  12. package/dist/components/Datepicker/Range/DatepickerRange.stories.js +0 -427
  13. package/dist/components/Datepicker/Range/DatepickerRangeContext.js +0 -80
  14. package/dist/components/Datepicker/Range/components/DateRow.js +0 -261
  15. package/dist/components/Datepicker/Range/components/DatepickerRangeContainer.js +0 -227
  16. package/dist/components/Datepicker/Range/components/DatepickerRangeControls.js +0 -80
  17. package/dist/components/Datepicker/Range/components/index.js +0 -31
  18. package/dist/components/Datepicker/Range/utils/propTypes.js +0 -158
  19. package/dist/components/Datepicker/Single/Datepicker.stories.js +0 -314
  20. package/dist/components/Datepicker/Single/DatepickerContext.js +0 -65
  21. package/dist/components/Datepicker/Single/DatepickerSingle.js +0 -54
  22. package/dist/components/Datepicker/Single/components/DateRow.js +0 -146
  23. package/dist/components/Datepicker/Single/components/DatepickerContainer.js +0 -167
  24. package/dist/components/Datepicker/Single/components/DatepickerControl.js +0 -51
  25. package/dist/components/Datepicker/Single/components/index.js +0 -31
  26. package/dist/components/Datepicker/Single/utils/propTypes.js +0 -88
  27. package/dist/components/Datepicker/common/components/DatepickerDays.js +0 -111
  28. package/dist/components/Datepicker/common/components/DatepickerHeader.js +0 -118
  29. package/dist/components/Datepicker/common/components/DatepickerInput.js +0 -127
  30. package/dist/components/Datepicker/common/components/WithPopoverAnchor.js +0 -23
  31. package/dist/components/Datepicker/common/components/WithPortal.js +0 -26
  32. package/dist/components/Datepicker/common/components/index.js +0 -39
  33. package/dist/components/Datepicker/common/utils/constants.js +0 -43
  34. package/dist/components/Datepicker/common/utils/dateRowCalculations.js +0 -92
  35. package/dist/components/Datepicker/common/utils/generalCalculations.js +0 -71
  36. package/dist/components/Datepicker/common/utils/getWeeksOfMonth.js +0 -51
  37. package/dist/components/Datepicker/common/utils/sharedPropTypes.js +0 -147
  38. package/dist/components/Datepicker/index.js +0 -23
@@ -1,40 +1,22 @@
1
1
  "use strict";
2
2
 
3
- var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4
-
5
- var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
6
-
7
- var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
8
-
9
- var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
10
-
11
- var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
12
-
13
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
14
-
15
3
  Object.defineProperty(exports, "__esModule", {
16
4
  value: true
17
5
  });
18
- exports.default = exports.STATUSES = void 0;
19
-
20
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
21
-
22
- var _merge = _interopRequireDefault(require("lodash/merge"));
23
-
24
- var _theme = _interopRequireDefault(require("@chakra-ui/theme"));
25
-
26
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
-
28
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
29
-
30
- var STATUSES = {
6
+ exports.notificationStatusStyles = exports.notificationSizeStyles = exports.notificationBaseStyle = exports.NOTIFICATION_STATUSES = void 0;
7
+ var NOTIFICATION_STATUSES = {
31
8
  NEUTRAL: 'neutral',
32
9
  ERROR: 'error',
33
10
  WARNING: 'warning',
34
11
  SUCCESS: 'success'
35
12
  };
36
- exports.STATUSES = STATUSES;
37
- var _baseStyle = {
13
+ exports.NOTIFICATION_STATUSES = NOTIFICATION_STATUSES;
14
+ var NOTIFICATION_SIZES = {
15
+ SM: 'sm',
16
+ MD: 'md',
17
+ LG: 'lg'
18
+ };
19
+ var notificationBaseStyle = {
38
20
  container: {
39
21
  paddingY: 2,
40
22
  borderRadius: 'base'
@@ -77,12 +59,40 @@ var _baseStyle = {
77
59
  },
78
60
  title: {
79
61
  lineHeight: 1.4
62
+ },
63
+ variants: {},
64
+ sizes: {
65
+ sm: {
66
+ title: {
67
+ fontSize: 'xs'
68
+ },
69
+ description: {
70
+ fontSize: 'xs'
71
+ }
72
+ },
73
+ md: {
74
+ title: {
75
+ fontSize: 'sm'
76
+ },
77
+ description: {
78
+ fontSize: 'sm'
79
+ }
80
+ },
81
+ lg: {
82
+ title: {
83
+ fontSize: 'base'
84
+ },
85
+ description: {
86
+ fontSize: 'base'
87
+ }
88
+ }
80
89
  }
81
90
  };
91
+ exports.notificationBaseStyle = notificationBaseStyle;
82
92
 
83
- var statusStyles = function statusStyles(status) {
93
+ var notificationStatusStyles = function notificationStatusStyles(status) {
84
94
  switch (status) {
85
- case STATUSES.NEUTRAL:
95
+ case NOTIFICATION_STATUSES.NEUTRAL:
86
96
  return {
87
97
  container: {
88
98
  background: 'gray.light'
@@ -100,7 +110,7 @@ var statusStyles = function statusStyles(status) {
100
110
  }
101
111
  };
102
112
 
103
- case STATUSES.WARNING:
113
+ case NOTIFICATION_STATUSES.WARNING:
104
114
  return {
105
115
  container: {
106
116
  background: 'yellow.100'
@@ -118,7 +128,7 @@ var statusStyles = function statusStyles(status) {
118
128
  }
119
129
  };
120
130
 
121
- case STATUSES.ERROR:
131
+ case NOTIFICATION_STATUSES.ERROR:
122
132
  return {
123
133
  container: {
124
134
  background: 'red.100'
@@ -136,7 +146,7 @@ var statusStyles = function statusStyles(status) {
136
146
  }
137
147
  };
138
148
 
139
- case STATUSES.SUCCESS:
149
+ case NOTIFICATION_STATUSES.SUCCESS:
140
150
  return {
141
151
  container: {
142
152
  background: 'green.100'
@@ -159,39 +169,43 @@ var statusStyles = function statusStyles(status) {
159
169
  }
160
170
  };
161
171
 
162
- var overrides = {
163
- baseStyle: function baseStyle(props) {
164
- return (0, _merge.default)(_objectSpread({}, _theme.default.components.Alert.baseStyle), _baseStyle, statusStyles(props['data-status']));
165
- },
166
- variants: {},
167
- sizes: {
168
- sm: {
169
- title: {
170
- fontSize: 'xs'
171
- },
172
- description: {
173
- fontSize: 'xs'
174
- }
175
- },
176
- md: {
177
- title: {
178
- fontSize: 'sm'
179
- },
180
- description: {
181
- fontSize: 'sm'
182
- }
183
- },
184
- lg: {
185
- title: {
186
- fontSize: 'base'
187
- },
188
- description: {
189
- fontSize: 'base'
190
- }
191
- }
172
+ exports.notificationStatusStyles = notificationStatusStyles;
173
+
174
+ var notificationSizeStyles = function notificationSizeStyles(size) {
175
+ switch (size) {
176
+ case NOTIFICATION_SIZES.SM:
177
+ return {
178
+ title: {
179
+ fontSize: 'xs'
180
+ },
181
+ description: {
182
+ fontSize: 'xs'
183
+ }
184
+ };
185
+
186
+ case NOTIFICATION_SIZES.MD:
187
+ return {
188
+ title: {
189
+ fontSize: 'sm'
190
+ },
191
+ description: {
192
+ fontSize: 'sm'
193
+ }
194
+ };
195
+
196
+ case NOTIFICATION_SIZES.LG:
197
+ return {
198
+ title: {
199
+ fontSize: 'base'
200
+ },
201
+ description: {
202
+ fontSize: 'base'
203
+ }
204
+ };
205
+
206
+ default:
207
+ return {};
192
208
  }
193
209
  };
194
210
 
195
- var _default = _objectSpread(_objectSpread({}, _theme.default.components.Alert), overrides);
196
-
197
- exports.default = _default;
211
+ exports.notificationSizeStyles = notificationSizeStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "17.1.0-beta.3",
3
+ "version": "17.1.0",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "./dist/components/index.js",
6
6
  "exports": "./dist/components/index.js",
@@ -85,10 +85,10 @@
85
85
  "@spothero/npm-publisher": "*",
86
86
  "@spothero/prettier-config": "*",
87
87
  "@spothero/stylelint-config": "*",
88
- "@storybook/addon-actions": "6.5.10",
89
- "@storybook/addon-essentials": "6.5.10",
90
- "@storybook/addon-links": "6.5.10",
91
- "@storybook/react": "6.5.10",
88
+ "@storybook/addon-actions": "6.5.16",
89
+ "@storybook/addon-essentials": "6.5.16",
90
+ "@storybook/addon-links": "6.5.16",
91
+ "@storybook/react": "6.5.16",
92
92
  "@testing-library/jest-dom": "5.11.9",
93
93
  "@testing-library/react": "11.2.5",
94
94
  "@testing-library/user-event": "12.8.1",
@@ -129,7 +129,7 @@
129
129
  "@emotion/react": "11.1.5",
130
130
  "@emotion/styled": "11.1.5",
131
131
  "@spothero/utils": "*",
132
- "@storybook/addon-a11y": "6.5.10",
132
+ "@storybook/addon-a11y": "6.5.16",
133
133
  "core-js": "3.6.5",
134
134
  "framer-motion": "4.1.17",
135
135
  "react-select": "5.4.0",
@@ -1,67 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _propTypes = _interopRequireDefault(require("./utils/propTypes"));
13
-
14
- var _DatepickerRangeContext = require("./DatepickerRangeContext");
15
-
16
- var _components = require("./components");
17
-
18
- var DatepickerRange = function DatepickerRange(_ref) {
19
- var initialStartDate = _ref.initialStartDate,
20
- initialEndDate = _ref.initialEndDate,
21
- disableBefore = _ref.disableBefore,
22
- disableAfter = _ref.disableAfter,
23
- onDateChange = _ref.onDateChange,
24
- usePortal = _ref.usePortal,
25
- useInputIcons = _ref.useInputIcons,
26
- isStartInvalid = _ref.isStartInvalid,
27
- startDateInputLabelText = _ref.startDateInputLabelText,
28
- startDateInputPlaceholderText = _ref.startDateInputPlaceholderText,
29
- startDateInputErrorText = _ref.startDateInputErrorText,
30
- isEndInvalid = _ref.isEndInvalid,
31
- endDateInputLabelText = _ref.endDateInputLabelText,
32
- endDateInputPlaceholderText = _ref.endDateInputPlaceholderText,
33
- endDateInputErrorText = _ref.endDateInputErrorText,
34
- datepickerRangeOverrides = _ref.datepickerRangeOverrides;
35
- return /*#__PURE__*/_react.default.createElement(_DatepickerRangeContext.DatepickerRangeProvider, {
36
- initialStartDate: initialStartDate,
37
- initialEndDate: initialEndDate,
38
- disableBefore: disableBefore,
39
- disableAfter: disableAfter,
40
- isStartInvalid: isStartInvalid,
41
- isEndInvalid: isEndInvalid
42
- }, /*#__PURE__*/_react.default.createElement(_components.DatepickerRangeContainer, {
43
- onDateChange: onDateChange,
44
- usePortal: usePortal,
45
- useInputIcons: useInputIcons,
46
- startDateInputLabelText: startDateInputLabelText,
47
- startDateInputPlaceholderText: startDateInputPlaceholderText,
48
- startDateInputErrorText: startDateInputErrorText,
49
- endDateInputLabelText: endDateInputLabelText,
50
- endDateInputPlaceholderText: endDateInputPlaceholderText,
51
- endDateInputErrorText: endDateInputErrorText,
52
- datepickerRangeOverrides: datepickerRangeOverrides
53
- }));
54
- };
55
-
56
- DatepickerRange.defaultProps = {
57
- usePortal: false,
58
- useInputIcons: true,
59
- isStartInvalid: false,
60
- startDateInputLabelText: 'Enter After',
61
- startDateInputPlaceholderText: 'Select Start Date',
62
- isEndInvalid: false,
63
- endDateInputLabelText: 'Exit Before',
64
- endDateInputPlaceholderText: 'Select End Date'
65
- };
66
- var _default = DatepickerRange;
67
- exports.default = _default;