@toptal/picasso-calendar 2.0.1 → 3.0.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 (69) hide show
  1. package/dist-package/src/Calendar/Calendar.d.ts.map +1 -1
  2. package/dist-package/src/Calendar/Calendar.js +9 -13
  3. package/dist-package/src/Calendar/Calendar.js.map +1 -1
  4. package/dist-package/src/CalendarContainer/CalendarContainer.d.ts.map +1 -1
  5. package/dist-package/src/CalendarContainer/CalendarContainer.js +2 -11
  6. package/dist-package/src/CalendarContainer/CalendarContainer.js.map +1 -1
  7. package/dist-package/src/CalendarDateSelector/CalendarDateSelector.d.ts.map +1 -1
  8. package/dist-package/src/CalendarDateSelector/CalendarDateSelector.js +4 -8
  9. package/dist-package/src/CalendarDateSelector/CalendarDateSelector.js.map +1 -1
  10. package/dist-package/src/CalendarDay/CalendarDay.d.ts.map +1 -1
  11. package/dist-package/src/CalendarDay/CalendarDay.js +31 -15
  12. package/dist-package/src/CalendarDay/CalendarDay.js.map +1 -1
  13. package/dist-package/src/CalendarDay/types.d.ts +11 -0
  14. package/dist-package/src/CalendarDay/types.d.ts.map +1 -0
  15. package/dist-package/src/CalendarDay/types.js +2 -0
  16. package/dist-package/src/CalendarDay/types.js.map +1 -0
  17. package/dist-package/src/CalendarDay/utils/get-background-color-class.d.ts +3 -0
  18. package/dist-package/src/CalendarDay/utils/get-background-color-class.d.ts.map +1 -0
  19. package/dist-package/src/CalendarDay/utils/get-background-color-class.js +14 -0
  20. package/dist-package/src/CalendarDay/utils/get-background-color-class.js.map +1 -0
  21. package/dist-package/src/CalendarDay/utils/get-border-classes.d.ts +3 -0
  22. package/dist-package/src/CalendarDay/utils/get-border-classes.d.ts.map +1 -0
  23. package/dist-package/src/CalendarDay/utils/get-border-classes.js +14 -0
  24. package/dist-package/src/CalendarDay/utils/get-border-classes.js.map +1 -0
  25. package/dist-package/src/CalendarDay/utils/get-hover-and-focus-effects-classes.d.ts +3 -0
  26. package/dist-package/src/CalendarDay/utils/get-hover-and-focus-effects-classes.d.ts.map +1 -0
  27. package/dist-package/src/CalendarDay/utils/get-hover-and-focus-effects-classes.js +29 -0
  28. package/dist-package/src/CalendarDay/utils/get-hover-and-focus-effects-classes.js.map +1 -0
  29. package/dist-package/src/CalendarDay/utils/get-text-color-class.d.ts +3 -0
  30. package/dist-package/src/CalendarDay/utils/get-text-color-class.d.ts.map +1 -0
  31. package/dist-package/src/CalendarDay/utils/get-text-color-class.js +17 -0
  32. package/dist-package/src/CalendarDay/utils/get-text-color-class.js.map +1 -0
  33. package/dist-package/src/CalendarIndicators/CalendarIndicators.d.ts.map +1 -1
  34. package/dist-package/src/CalendarIndicators/CalendarIndicators.js +4 -12
  35. package/dist-package/src/CalendarIndicators/CalendarIndicators.js.map +1 -1
  36. package/package.json +2 -3
  37. package/src/Calendar/Calendar.tsx +10 -15
  38. package/src/Calendar/__snapshots__/test.tsx.snap +101 -101
  39. package/src/CalendarContainer/CalendarContainer.tsx +6 -13
  40. package/src/CalendarDateSelector/CalendarDateSelector.tsx +4 -11
  41. package/src/CalendarDay/CalendarDay.tsx +46 -17
  42. package/src/CalendarDay/types.ts +10 -0
  43. package/src/CalendarDay/utils/get-background-color-class.ts +26 -0
  44. package/src/CalendarDay/utils/get-border-classes.test.ts +54 -0
  45. package/src/CalendarDay/utils/get-border-classes.ts +20 -0
  46. package/src/CalendarDay/utils/get-hover-and-focus-effects-classes.test.ts +72 -0
  47. package/src/CalendarDay/utils/get-hover-and-focus-effects-classes.ts +44 -0
  48. package/src/CalendarDay/utils/get-text-color-class.ts +30 -0
  49. package/src/CalendarIndicators/CalendarIndicators.tsx +9 -16
  50. package/dist-package/src/Calendar/styles.d.ts +0 -4
  51. package/dist-package/src/Calendar/styles.d.ts.map +0 -1
  52. package/dist-package/src/Calendar/styles.js +0 -64
  53. package/dist-package/src/Calendar/styles.js.map +0 -1
  54. package/dist-package/src/CalendarContainer/styles.d.ts +0 -4
  55. package/dist-package/src/CalendarContainer/styles.d.ts.map +0 -1
  56. package/dist-package/src/CalendarContainer/styles.js +0 -22
  57. package/dist-package/src/CalendarContainer/styles.js.map +0 -1
  58. package/dist-package/src/CalendarDay/styles.d.ts +0 -4
  59. package/dist-package/src/CalendarDay/styles.d.ts.map +0 -1
  60. package/dist-package/src/CalendarDay/styles.js +0 -94
  61. package/dist-package/src/CalendarDay/styles.js.map +0 -1
  62. package/dist-package/src/CalendarIndicators/styles.d.ts +0 -4
  63. package/dist-package/src/CalendarIndicators/styles.d.ts.map +0 -1
  64. package/dist-package/src/CalendarIndicators/styles.js +0 -28
  65. package/dist-package/src/CalendarIndicators/styles.js.map +0 -1
  66. package/src/Calendar/styles.ts +0 -66
  67. package/src/CalendarContainer/styles.ts +0 -24
  68. package/src/CalendarDay/styles.ts +0 -100
  69. package/src/CalendarIndicators/styles.ts +0 -30
@@ -1,16 +1,9 @@
1
1
  import type { ReactNode } from 'react'
2
2
  import React from 'react'
3
- import type { Theme } from '@material-ui/core/styles'
4
- import { makeStyles } from '@material-ui/core/styles'
5
- import cx from 'classnames'
3
+ import { twJoin } from '@toptal/picasso-tailwind-merge'
6
4
 
7
- import styles from './styles'
8
5
  import { useCalendar } from '../CalendarContext'
9
6
 
10
- const useStyles = makeStyles<Theme>(styles, {
11
- name: 'PicassoCalendarContainer',
12
- })
13
-
14
7
  export type CalendarContainerProps = {
15
8
  children?: ReactNode
16
9
  hasFooter?: boolean
@@ -24,17 +17,17 @@ const CalendarContainer = ({
24
17
  hasFooter,
25
18
  isFlexible,
26
19
  }: CalendarContainerProps) => {
27
- const classes = useStyles()
28
20
  const { renderRoot } = useCalendar()
29
21
 
30
22
  return renderRoot ? (
31
23
  <>{renderRoot({ hasFooter, children })}</>
32
24
  ) : (
33
25
  <div
34
- className={cx(classes.root, {
35
- [classes.hasFooter]: hasFooter,
36
- [classes.flexible]: isFlexible,
37
- })}
26
+ className={twJoin(
27
+ 'p-6 text-graphite-800 flex flex-col basis-[20.5rem] shadow-5 bg-white',
28
+ hasFooter ? 'rounded-t-sm rounded-b-none' : 'rounded-sm',
29
+ !isFlexible && 'max-w-[20.5rem]'
30
+ )}
38
31
  >
39
32
  {children}
40
33
  </div>
@@ -3,11 +3,6 @@ import type { DropdownProps } from 'react-day-picker'
3
3
  import { Typography } from '@toptal/picasso-typography'
4
4
  import { Container } from '@toptal/picasso-container'
5
5
  import { ArrowDropDown16 } from '@toptal/picasso-icons'
6
- import { makeStyles, type Theme } from '@material-ui/core/styles'
7
-
8
- import styles from '../Calendar/styles'
9
-
10
- const useStyles = makeStyles<Theme>(styles, { name: 'PicassoCalendar' })
11
6
 
12
7
  const CalendarDateSelector = ({
13
8
  children,
@@ -16,13 +11,11 @@ const CalendarDateSelector = ({
16
11
  value,
17
12
  'aria-label': ariaLabel,
18
13
  }: DropdownProps) => {
19
- const classes = useStyles()
20
-
21
14
  return (
22
15
  <label
23
16
  aria-label={ariaLabel}
24
17
  htmlFor={`month${caption}`}
25
- className={classes.dropdown_label}
18
+ className='flex relative items-center'
26
19
  >
27
20
  <Typography
28
21
  variant='heading'
@@ -33,16 +26,16 @@ const CalendarDateSelector = ({
33
26
  {caption}
34
27
  </Typography>
35
28
  <Container
36
- className={classes.icon_wrapper}
29
+ className='w-6 h-6'
37
30
  flex
38
31
  justifyContent='center'
39
32
  alignItems='center'
40
33
  >
41
- <ArrowDropDown16 className={classes.pointer_events} color='darkGrey' />
34
+ <ArrowDropDown16 className='pointer-events-none' color='darkGrey' />
42
35
  </Container>
43
36
  <select
44
37
  name={`month${caption}`}
45
- className={classes.select}
38
+ className='absolute opacity-0 text-md font-normal cursor-pointer'
46
39
  value={value}
47
40
  onChange={onChange}
48
41
  >
@@ -1,10 +1,8 @@
1
1
  import type { ReactNode } from 'react'
2
- import React, { useRef } from 'react'
2
+ import React, { useMemo, useRef } from 'react'
3
3
  import type { DayProps } from 'react-day-picker'
4
4
  import { useDayRender } from 'react-day-picker'
5
- import cx from 'classnames'
6
- import type { Theme } from '@material-ui/core/styles'
7
- import { makeStyles } from '@material-ui/core/styles'
5
+ import { twJoin } from '@toptal/picasso-tailwind-merge'
8
6
  import {
9
7
  isToday as isTodayDateFns,
10
8
  endOfMonth,
@@ -14,10 +12,13 @@ import {
14
12
  startOfMonth,
15
13
  } from 'date-fns'
16
14
 
17
- import styles from './styles'
18
15
  import { CalendarIndicators } from '../CalendarIndicators'
19
16
  import { useCalendar } from '../CalendarContext'
20
17
  import type { DayProps as RenderDayProps } from '../Calendar'
18
+ import { getTextColorClass } from './utils/get-text-color-class'
19
+ import { getBackgroundColorClass } from './utils/get-background-color-class'
20
+ import { getBorderClasses } from './utils/get-border-classes'
21
+ import { getHoverAndFocusEffectsClasses } from './utils/get-hover-and-focus-effects-classes'
21
22
 
22
23
  export type RenderDay = (args: RenderDayProps) => ReactNode
23
24
 
@@ -31,8 +32,6 @@ const checkIfBelongsToPreviousMonth = (date: Date, currentMonth: Date) =>
31
32
  const checkIfBelongsToNextMonth = (date: Date, currentMonth: Date) =>
32
33
  isAfter(date, endOfMonth(currentMonth))
33
34
 
34
- const useStyles = makeStyles<Theme>(styles, { name: 'PicassoCalendar' })
35
-
36
35
  /**
37
36
  * The content of a day cell
38
37
  */
@@ -63,7 +62,37 @@ const CalendarDay = (dayProps: DayProps): JSX.Element => {
63
62
  const isToday = isTodayDateFns(date)
64
63
  const isoDate = getISODate(date)
65
64
 
66
- const classes = useStyles()
65
+ const stateDependentClasses = useMemo(() => {
66
+ const currentComponentState = {
67
+ isSelected,
68
+ isDisabled,
69
+ isWeekend,
70
+ isToday,
71
+ isOutside,
72
+ isRangeStart,
73
+ isRangeMiddle: isRangeMiddle || isTemporaryRangeMiddle,
74
+ isRangeEnd: isRangeEnd || isTemporaryRangeEnd,
75
+ }
76
+
77
+ return twJoin(
78
+ getTextColorClass(currentComponentState),
79
+ getBackgroundColorClass(currentComponentState),
80
+ getBorderClasses(currentComponentState),
81
+ getHoverAndFocusEffectsClasses(currentComponentState),
82
+ isDisabled ? 'cursor-default' : 'cursor-pointer'
83
+ )
84
+ }, [
85
+ isSelected,
86
+ isDisabled,
87
+ isWeekend,
88
+ isToday,
89
+ isOutside,
90
+ isRangeStart,
91
+ isRangeMiddle,
92
+ isRangeEnd,
93
+ isTemporaryRangeMiddle,
94
+ isTemporaryRangeEnd,
95
+ ])
67
96
 
68
97
  const defaultComponent = (
69
98
  <button
@@ -74,15 +103,15 @@ const CalendarDay = (dayProps: DayProps): JSX.Element => {
74
103
  }`}
75
104
  data-calendar-day={isoDate}
76
105
  tabIndex={isDisabled ? -1 : undefined}
77
- className={cx(classes.day, {
78
- [classes.selected]: isSelected,
79
- [classes.weekend]: isWeekend,
80
- [classes.grayed]: isOutside && !isDisabled,
81
- [classes.disabled]: isDisabled,
82
- [classes.startSelection]: isRangeStart,
83
- [classes.withinSelection]: isRangeMiddle || isTemporaryRangeMiddle,
84
- [classes.endSelection]: isRangeEnd || isTemporaryRangeEnd,
85
- })}
106
+ className={twJoin(
107
+ 'h-10 w-10 min-w-10',
108
+ 'm-0 p-0',
109
+ 'text-[0.75rem]',
110
+ 'flex items-center justify-center vertical-align-middle relative',
111
+ 'user-select-none',
112
+ 'outline-none',
113
+ stateDependentClasses
114
+ )}
86
115
  onClick={isDisabled ? undefined : event => buttonProps?.onClick?.(event)}
87
116
  onMouseEnter={event => {
88
117
  onDayMouseEnter?.(date)
@@ -0,0 +1,10 @@
1
+ export type DayState = {
2
+ isSelected: boolean
3
+ isDisabled: boolean
4
+ isWeekend: boolean
5
+ isToday: boolean
6
+ isOutside: boolean
7
+ isRangeStart: boolean
8
+ isRangeMiddle: boolean
9
+ isRangeEnd: boolean
10
+ }
@@ -0,0 +1,26 @@
1
+ import type { DayState } from '../types'
2
+
3
+ export const getBackgroundColorClass = (state: DayState) => {
4
+ const {
5
+ isSelected,
6
+ isRangeEnd,
7
+ isDisabled,
8
+ isWeekend,
9
+ isRangeMiddle,
10
+ isRangeStart,
11
+ } = state
12
+
13
+ if (isRangeMiddle) {
14
+ return 'bg-blue-100'
15
+ }
16
+
17
+ if (isSelected || isRangeStart || isRangeEnd) {
18
+ return 'bg-blue-500'
19
+ }
20
+
21
+ if ((isDisabled && isWeekend) || isWeekend) {
22
+ return 'bg-gray-100'
23
+ }
24
+
25
+ return 'bg-white'
26
+ }
@@ -0,0 +1,54 @@
1
+ import { getBorderClasses } from './get-border-classes'
2
+ import type { DayState } from '../types'
3
+
4
+ describe('getBorderClasses', () => {
5
+ describe('when day is selected', () => {
6
+ it('returns border-none and rounded-sm for selected day', () => {
7
+ const state = { isSelected: true } as DayState
8
+
9
+ expect(getBorderClasses(state)).toBe('border-none rounded-sm')
10
+ })
11
+ })
12
+
13
+ describe('when day is a weekend', () => {
14
+ it('returns solid border with specific width and rounded-md', () => {
15
+ const state = { isWeekend: true } as DayState
16
+
17
+ expect(getBorderClasses(state)).toBe(
18
+ 'border-solid border-[0.25rem] border-white rounded-md'
19
+ )
20
+ })
21
+ })
22
+
23
+ describe('when day is not a weekend', () => {
24
+ it('returns border-none and rounded-none', () => {
25
+ const state = {} as DayState
26
+
27
+ expect(getBorderClasses(state)).toBe('border-none rounded-none')
28
+ })
29
+ })
30
+
31
+ describe('when day is part of range', () => {
32
+ describe('when day is in range middle', () => {
33
+ it('returns border-none and rounded-none', () => {
34
+ const state = { isRangeMiddle: true } as DayState
35
+
36
+ expect(getBorderClasses(state)).toBe('border-none rounded-none')
37
+ })
38
+ })
39
+
40
+ describe('when day is range end', () => {
41
+ it('returns border-none and rounded-sm', () => {
42
+ const state = { isRangeEnd: true } as DayState
43
+
44
+ expect(getBorderClasses(state)).toBe('border-none rounded-sm')
45
+ })
46
+ })
47
+
48
+ it('returns border-none and rounded-sm for range start', () => {
49
+ const state = { isRangeStart: true } as DayState
50
+
51
+ expect(getBorderClasses(state)).toBe('border-none rounded-sm')
52
+ })
53
+ })
54
+ })
@@ -0,0 +1,20 @@
1
+ import type { DayState } from '../types'
2
+
3
+ export const getBorderClasses = (state: DayState) => {
4
+ const { isSelected, isWeekend, isRangeStart, isRangeEnd, isRangeMiddle } =
5
+ state
6
+
7
+ if (isRangeMiddle) {
8
+ return 'border-none rounded-none'
9
+ }
10
+
11
+ if (isRangeEnd || isRangeStart || isSelected) {
12
+ return 'border-none rounded-sm'
13
+ }
14
+
15
+ if (isWeekend) {
16
+ return 'border-solid border-[0.25rem] border-white rounded-md'
17
+ }
18
+
19
+ return 'border-none rounded-none'
20
+ }
@@ -0,0 +1,72 @@
1
+ import { getHoverAndFocusEffectsClasses } from './get-hover-and-focus-effects-classes'
2
+ import type { DayState } from '../types'
3
+
4
+ describe('getHoverAndFocusEffectsClasses', () => {
5
+ describe('when day is not a weekend', () => {
6
+ it('returns default classes', () => {
7
+ const state = {} as DayState
8
+
9
+ expect(getHoverAndFocusEffectsClasses(state).toString()).toBe(
10
+ '[&]:hover:text-black [&]:focus:text-black,[&]:hover:bg-blue-500/25 [&]:focus:bg-blue-500/25,[&]:hover:rounded-sm [&]:focus:rounded-sm'
11
+ )
12
+ })
13
+ })
14
+
15
+ describe('when day is outside of displayed month', () => {
16
+ it('returns gray text for hover and focus classes', () => {
17
+ const state = { isOutside: true } as DayState
18
+
19
+ expect(getHoverAndFocusEffectsClasses(state).toString()).toBe(
20
+ '[&]:hover:text-gray-600 [&]:focus:text-gray-600,[&]:hover:bg-blue-500/25 [&]:focus:bg-blue-500/25,[&]:hover:rounded-sm [&]:focus:rounded-sm'
21
+ )
22
+ })
23
+ })
24
+
25
+ describe('when day is selected', () => {
26
+ it('returns no classes', () => {
27
+ const state = { isSelected: true } as DayState
28
+
29
+ expect(getHoverAndFocusEffectsClasses(state)).toBe('')
30
+ })
31
+ })
32
+
33
+ describe('when day is disabled', () => {
34
+ it('returns no classes', () => {
35
+ const state = { isDisabled: true } as DayState
36
+
37
+ expect(getHoverAndFocusEffectsClasses(state)).toBe('')
38
+ })
39
+ })
40
+
41
+ describe('when day is a weekend', () => {
42
+ it('returns black text and pale blue background for hover and focus classes', () => {
43
+ const state = { isWeekend: true } as DayState
44
+
45
+ expect(getHoverAndFocusEffectsClasses(state).toString()).toBe(
46
+ '[&]:hover:border-none [&]:focus:border-none,[&]:hover:border-white [&]:focus:border-white,[&]:hover:text-black [&]:focus:text-black,[&]:hover:bg-blue-500/25 [&]:focus:bg-blue-500/25,[&]:hover:rounded-sm [&]:focus:rounded-sm'
47
+ )
48
+ })
49
+ })
50
+
51
+ describe('when selection is made in the calendar', () => {
52
+ describe('when day is a weekend and is inside of selection', () => {
53
+ it('returns default selection classes', () => {
54
+ const state = { isWeekend: true, isRangeMiddle: true } as DayState
55
+
56
+ expect(getHoverAndFocusEffectsClasses(state).toString()).toBe(
57
+ '[&]:hover:text-black [&]:focus:text-black,[&]:hover:bg-blue-500/25 [&]:focus:bg-blue-500/25,[&]:hover:rounded-sm [&]:focus:rounded-sm'
58
+ )
59
+ })
60
+ })
61
+
62
+ describe('when day is an end of selection', () => {
63
+ it('returns white text and blue background', () => {
64
+ const state = { isRangeEnd: true } as DayState
65
+
66
+ expect(getHoverAndFocusEffectsClasses(state).toString()).toBe(
67
+ '[&]:hover:text-white [&]:focus:text-white,[&]:hover:bg-blue-500 [&]:focus:bg-blue-500'
68
+ )
69
+ })
70
+ })
71
+ })
72
+ })
@@ -0,0 +1,44 @@
1
+ import type { DayState } from '../types'
2
+
3
+ export const getHoverAndFocusEffectsClasses = (state: DayState) => {
4
+ const {
5
+ isSelected,
6
+ isWeekend,
7
+ isDisabled,
8
+ isOutside,
9
+ isRangeEnd,
10
+ isRangeMiddle,
11
+ } = state
12
+
13
+ if (isDisabled || isSelected) {
14
+ return ''
15
+ }
16
+
17
+ if (isRangeEnd) {
18
+ return [
19
+ '[&]:hover:text-white [&]:focus:text-white',
20
+ '[&]:hover:bg-blue-500 [&]:focus:bg-blue-500',
21
+ ]
22
+ }
23
+
24
+ const defaultTextColor = isOutside
25
+ ? '[&]:hover:text-gray-600 [&]:focus:text-gray-600'
26
+ : '[&]:hover:text-black [&]:focus:text-black'
27
+
28
+ const defaultBackgroundAndBorderStyle = [
29
+ '[&]:hover:bg-blue-500/25 [&]:focus:bg-blue-500/25',
30
+ '[&]:hover:rounded-sm [&]:focus:rounded-sm',
31
+ ]
32
+
33
+ const defaultStyles = [defaultTextColor, ...defaultBackgroundAndBorderStyle]
34
+
35
+ if (isWeekend && !isSelected && !isRangeMiddle) {
36
+ return [
37
+ '[&]:hover:border-none [&]:focus:border-none',
38
+ '[&]:hover:border-white [&]:focus:border-white',
39
+ ...defaultStyles,
40
+ ]
41
+ }
42
+
43
+ return defaultStyles
44
+ }
@@ -0,0 +1,30 @@
1
+ import type { DayState } from '../types'
2
+
3
+ export const getTextColorClass = (state: DayState) => {
4
+ const {
5
+ isSelected,
6
+ isOutside,
7
+ isRangeEnd,
8
+ isDisabled,
9
+ isRangeMiddle,
10
+ isRangeStart,
11
+ } = state
12
+
13
+ if (isDisabled) {
14
+ return 'text-gray-500'
15
+ }
16
+
17
+ if (isOutside) {
18
+ return 'text-gray-600'
19
+ }
20
+
21
+ if (isRangeMiddle) {
22
+ return 'text-black'
23
+ }
24
+
25
+ if (isSelected || isRangeStart || isRangeEnd) {
26
+ return 'text-white'
27
+ }
28
+
29
+ return 'text-black'
30
+ }
@@ -1,9 +1,5 @@
1
1
  import React from 'react'
2
- import type { Theme } from '@material-ui/core/styles'
3
- import { makeStyles } from '@material-ui/core/styles'
4
- import cx from 'classnames'
5
-
6
- import styles from './styles'
2
+ import { twJoin } from '@toptal/picasso-tailwind-merge'
7
3
 
8
4
  export interface Props {
9
5
  isSelected: boolean
@@ -11,28 +7,25 @@ export interface Props {
11
7
  isIndicated: boolean
12
8
  }
13
9
 
14
- const useStyles = makeStyles<Theme>(styles, {
15
- name: 'PicassoCalendarIndicators',
16
- })
17
-
18
10
  export const CalendarIndicators = ({
19
11
  isIndicated,
20
12
  isSelected,
21
13
  isToday,
22
14
  }: Props) => {
23
- const classes = useStyles()
24
-
25
15
  if (isToday || isIndicated) {
26
16
  return (
27
- <div className={classes.indicators}>
17
+ <div className='flex flex-row justify-around w-[1.3em] absolute bottom-[0.375rem]'>
28
18
  {isToday && (
29
19
  <div
30
- className={cx(classes.today, {
31
- [classes.selected]: isSelected,
32
- })}
20
+ className={twJoin(
21
+ 'h-1 w-1 rounded-[50%] bg-blue-500',
22
+ isSelected && 'bg-white'
23
+ )}
33
24
  />
34
25
  )}
35
- {isIndicated && <div className={classes.indicated} />}
26
+ {isIndicated && (
27
+ <div className='content-[""] h-1 w-1 rounded-[50%] bg-yellow-500' />
28
+ )}
36
29
  </div>
37
30
  )
38
31
  }
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ palette }: Theme) => import("@material-ui/styles").StyleRules<{}, "head" | "cell" | "table" | "row" | "caption_dropdowns" | "pointer_events" | "icon_wrapper" | "select" | "dropdown_label" | "head_row" | "head_cell" | "vhidden" | "months">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Calendar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;sCAIxB,KAAK;AAAlC,wBA6DI"}
@@ -1,64 +0,0 @@
1
- import { createStyles } from '@material-ui/core/styles';
2
- import { rem } from '@toptal/picasso-shared';
3
- export default ({ palette }) => createStyles({
4
- head: {
5
- display: 'block',
6
- },
7
- caption_dropdowns: {
8
- display: 'flex',
9
- gap: '1rem',
10
- paddingBottom: '1rem',
11
- },
12
- pointer_events: {
13
- pointerEvents: 'none',
14
- },
15
- icon_wrapper: { width: '24px', height: '24px' },
16
- select: {
17
- opacity: '0',
18
- position: 'absolute',
19
- fontSize: '0.875rem',
20
- fontWeight: 400,
21
- cursor: 'pointer',
22
- },
23
- dropdown_label: {
24
- display: 'flex',
25
- position: 'relative',
26
- alignItems: 'center',
27
- },
28
- head_row: {
29
- display: 'flex',
30
- textAlign: 'center',
31
- fontSize: rem('12px'),
32
- lineHeight: rem('18px'),
33
- textTransform: 'uppercase',
34
- color: palette.grey.main2,
35
- paddingTop: rem('3px'),
36
- paddingBottom: rem('11px'),
37
- },
38
- head_cell: {
39
- padding: 0,
40
- flexBasis: '15%',
41
- width: '40px',
42
- fontWeight: 400,
43
- },
44
- table: {
45
- borderSpacing: '0px',
46
- display: 'flex',
47
- flexDirection: 'column',
48
- },
49
- row: {
50
- display: 'flex',
51
- },
52
- cell: {
53
- padding: 0,
54
- flexBasis: '15%',
55
- },
56
- vhidden: {
57
- display: 'none',
58
- },
59
- months: {
60
- display: 'flex',
61
- gap: rem('24px'),
62
- },
63
- });
64
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/Calendar/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAE5C,eAAe,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE,CACpC,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO;KACjB;IACD,iBAAiB,EAAE;QACjB,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,MAAM;QACX,aAAa,EAAE,MAAM;KACtB;IACD,cAAc,EAAE;QACd,aAAa,EAAE,MAAM;KACtB;IACD,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;IAC/C,MAAM,EAAE;QACN,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,UAAU,EAAE,GAAG;QACf,MAAM,EAAE,SAAS;KAClB;IACD,cAAc,EAAE;QACd,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,UAAU;QACpB,UAAU,EAAE,QAAQ;KACrB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC;QACrB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC;QACvB,aAAa,EAAE,WAAW;QAC1B,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;QACzB,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC;QACtB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC;KAC3B;IACD,SAAS,EAAE;QACT,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,GAAG;KAChB;IACD,KAAK,EAAE;QACL,aAAa,EAAE,KAAK;QACpB,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;KACxB;IACD,GAAG,EAAE;QACH,OAAO,EAAE,MAAM;KAChB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,KAAK;KACjB;IACD,OAAO,EAAE;QACP,OAAO,EAAE,MAAM;KAChB;IACD,MAAM,EAAE;QACN,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;KACjB;CACF,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ palette, shadows, sizes }: Theme) => import("@material-ui/styles").StyleRules<{}, "root" | "hasFooter" | "flexible">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/CalendarContainer/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;sDAGR,KAAK;AAAlD,wBAmBI"}
@@ -1,22 +0,0 @@
1
- import { rem } from '@toptal/picasso-shared';
2
- import { createStyles } from '@material-ui/core/styles';
3
- export default ({ palette, shadows, sizes }) => createStyles({
4
- root: {
5
- padding: rem('24px'),
6
- color: palette.grey.darker,
7
- display: 'flex',
8
- flexDirection: 'column',
9
- flexBasis: '20.5rem',
10
- maxWidth: '20.5rem',
11
- boxShadow: shadows[5],
12
- borderRadius: sizes.borderRadius.small,
13
- backgroundColor: palette.common.white,
14
- },
15
- hasFooter: {
16
- borderRadius: `${sizes.borderRadius.small} ${sizes.borderRadius.small} 0 0`,
17
- },
18
- flexible: {
19
- maxWidth: 'unset',
20
- },
21
- });
22
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/CalendarContainer/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAS,EAAE,EAAE,CACpD,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;QAC1B,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,SAAS;QACpB,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QACrB,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK;QACtC,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;KACtC;IACD,SAAS,EAAE;QACT,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,MAAM;KAC5E;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,OAAO;KAClB;CACF,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ palette, sizes }: Theme) => import("@material-ui/styles").StyleRules<{}, "disabled" | "day" | "weekend" | "selected" | "isInsideIndicatedRange" | "startSelection" | "withinSelection" | "endSelection" | "today" | "grayed">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/CalendarDay/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;6CAIjB,KAAK;AAAzC,wBA+FI"}