@pushwoosh/dumb-components 1.0.34 → 1.0.36

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/Badge/styles.js CHANGED
@@ -4,7 +4,7 @@ import { BadgeColorToColorMap, BadgeColorToLightColorMap } from './maps';
4
4
  export const BadgeBox = styled.div.withConfig({
5
5
  displayName: "BadgeBox",
6
6
  componentId: "sc-6ptm8-0"
7
- })(["display:inline-block;width:fit-content;padding:", " ", ";border-radius:", ";color:", ";background-color:", ";font-size:", ";font-family:", ";font-weight:", ";line-height:", ";text-transform:uppercase;user-select:none;"], Spacing.S0, Spacing.S2, ShapeRadius.SECTION, ({
7
+ })(["display:inline-block;width:fit-content;padding:", " ", ";border-radius:", ";color:", ";background-color:", ";font-size:", ";font-family:", ";font-weight:", ";line-height:", ";text-transform:uppercase;user-select:none;"], Spacing.S0, Spacing.S2, ShapeRadius.CONTROL, ({
8
8
  $isSaturated,
9
9
  $color
10
10
  }) => $isSaturated ? Color.CLEAR : BadgeColorToColorMap[$color], ({
@@ -1,5 +1,4 @@
1
1
  import React, { useMemo } from 'react';
2
- import { Spacing } from '@pushwoosh/kit-constants';
3
2
  import { Columns } from '@pushwoosh/kit-helpers';
4
3
  import { format, firstDayOfWeek, parseStringToDate, differenceInDays, isSamePeriod, isInRange } from '../../helpers';
5
4
  import { CellBox, DayHeader } from '../../styles';
@@ -26,11 +25,11 @@ export function Month(props) {
26
25
  }, [month]);
27
26
  return React.createElement(Columns, {
28
27
  "$sizes": 7,
29
- "$gap": Spacing.S1
28
+ "$gap": 4
30
29
  }, React.createElement(DayHeader, null, "Sun"), React.createElement(DayHeader, null, "Mon"), React.createElement(DayHeader, null, "Tue"), React.createElement(DayHeader, null, "Wed"), React.createElement(DayHeader, null, "Thu"), React.createElement(DayHeader, null, "Fri"), React.createElement(DayHeader, null, "Sat"), Array.from({
31
30
  length: days
32
31
  }).map((_, i) => {
33
- const curDay = new Date(firstDayDate.getUTCFullYear(), firstDayDate.getUTCMonth(), firstDayDate.getUTCDate() + i);
32
+ const curDay = new Date(Date.UTC(firstDayDate.getUTCFullYear(), firstDayDate.getUTCMonth(), firstDayDate.getUTCDate() + i));
34
33
  const isDisabled = isInRange({
35
34
  value: curDay,
36
35
  minDate: minDate || undefined,
@@ -52,8 +52,9 @@ export const isSamePeriod = (d1, d2, period) => {
52
52
  export const firstDayOfWeek = date => {
53
53
  const d = new Date(date);
54
54
  const day = d.getUTCDay();
55
- const diff = d.getUTCDate() - day + (day === 0 ? -6 : 1);
56
- d.setUTCDate(diff);
55
+ if (day > 0) {
56
+ d.setUTCDate(d.getUTCDate() - day);
57
+ }
57
58
  return d;
58
59
  };
59
60
  export const startOfYear = date => new Date(date.getFullYear(), 0, 1, 0, 0, 0, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",