@loadsmart/loadsmart-ui 5.1.0 → 5.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loadsmart/loadsmart-ui",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Miranda UI, a React UI library",
5
5
  "main": "dist",
6
6
  "files": [
@@ -15,6 +15,9 @@ export const WEEKDAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
15
15
  export const formatter = DateFormatHelper('MM/DD/YYYY')
16
16
 
17
17
  function getStatus(calendar: useCalendarReturn, date: CalendarDate) {
18
+ const isPastYearDay =
19
+ date.getYear() < calendar.months[0].year && date.getMonth() > calendar.months[0].month
20
+
18
21
  if (calendar.selected[0] == date.getTime()) {
19
22
  return 'selection-start'
20
23
  } else if (calendar.selected[1] == date.getTime()) {
@@ -26,8 +29,13 @@ function getStatus(calendar: useCalendarReturn, date: CalendarDate) {
26
29
  date.getTime() < calendar.selected[1]
27
30
  ) {
28
31
  return 'selection'
29
- } else if (calendar.mode === 'single' && date.getMonth() !== calendar.months[0].month) {
32
+ } else if (
33
+ calendar.mode === 'single' &&
34
+ (isPastYearDay || date.getMonth() < calendar.months[0].month)
35
+ ) {
30
36
  return 'faded'
37
+ } else if (calendar.mode === 'single' && date.getMonth() > calendar.months[0].month) {
38
+ return 'next-month-day'
31
39
  } else if (date.getTime() == TODAY.getTime()) {
32
40
  return 'current-day'
33
41
  }
@@ -10,7 +10,14 @@ import hoverable from 'styles/hoverable'
10
10
  import typography from 'styles/typography'
11
11
 
12
12
  const PickerButton = styled(BaseButton)<{
13
- $status: 'default' | 'current-day' | 'faded' | 'selection-start' | 'selection-end' | 'selection'
13
+ $status:
14
+ | 'default'
15
+ | 'current-day'
16
+ | 'faded'
17
+ | 'selection-start'
18
+ | 'selection-end'
19
+ | 'selection'
20
+ | 'next-month-day'
14
21
  }>`
15
22
  ${typography(
16
23
  conditional({
@@ -32,25 +39,26 @@ const PickerButton = styled(BaseButton)<{
32
39
  $status: ['selection-start', 'selection', 'selection-end'],
33
40
  }),
34
41
  'color-neutral-darker': whenProps({ $status: ['default', 'faded'] }),
42
+ 'color-neutral-dark': whenProps({ $status: 'next-month-day' }),
35
43
  'color-accent': whenProps({ $status: 'current-day' }),
36
44
  })};
37
45
 
38
46
  background: ${conditional({
39
- 'color-transparent': whenProps({ $status: ['default', 'faded'] }),
47
+ 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),
40
48
  'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),
41
49
  'color-neutral': whenProps({ $status: 'selection' }),
42
50
  'color-neutral-lightest': whenProps({ $status: 'current-day' }),
43
51
  })};
44
52
 
45
53
  border-color: ${conditional({
46
- 'color-transparent': whenProps({ $status: ['default', 'faded'] }),
54
+ 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),
47
55
  'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),
48
56
  'color-neutral': whenProps({ $status: 'selection' }),
49
57
  'color-neutral-light': whenProps({ $status: 'current-day' }),
50
58
  })};
51
59
 
52
60
  ${conditional({
53
- 'opacity: 0.6;': whenProps({ $status: 'faded' }),
61
+ 'opacity: 0.4;': whenProps({ $status: 'faded' }),
54
62
  'opacity: 1;': whenProps({ $status: (status) => status !== 'faded' }),
55
63
  })}
56
64
 
@@ -59,7 +67,7 @@ const PickerButton = styled(BaseButton)<{
59
67
  ${hoverable`
60
68
  border-color: ${token('color-neutral')};
61
69
  background-color: ${conditional({
62
- 'color-transparent': whenProps({ $status: ['default', 'faded'] }),
70
+ 'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),
63
71
  'color-neutral-dark': whenProps({
64
72
  $status: ['selection-start', 'selection', 'selection-end'],
65
73
  }),
@@ -99,7 +107,7 @@ const PickerButton = styled(BaseButton)<{
99
107
  'color-transparent': whenProps({ 'aria-checked': false }),
100
108
  })};
101
109
 
102
- color: ${token('color-neutral-darkest')};
110
+ color: ${token('color-neutral-darker')};
103
111
  `}
104
112
 
105
113
  visibility: ${conditional({