@primer/components 0.0.0-202110343939 → 0.0.0-20211040245

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 (100) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/dist/browser.esm.js +52 -48
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +37 -33
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/ActionList/Header.js +1 -1
  7. package/lib/ActionList/Item.d.ts +6 -0
  8. package/lib/ActionList/Item.js +5 -1
  9. package/lib/AnchoredOverlay/AnchoredOverlay.js +8 -6
  10. package/lib/Autocomplete/Autocomplete.d.ts +4 -4
  11. package/lib/Autocomplete/AutocompleteInput.d.ts +4 -4
  12. package/lib/Button/Button.d.ts +5 -5
  13. package/lib/Button/ButtonBase.d.ts +1 -1
  14. package/lib/Button/ButtonClose.d.ts +3 -3
  15. package/lib/Button/ButtonDanger.d.ts +5 -5
  16. package/lib/Button/ButtonInvisible.d.ts +5 -5
  17. package/lib/Button/ButtonOutline.d.ts +5 -5
  18. package/lib/Button/ButtonPrimary.d.ts +5 -5
  19. package/lib/CircleBadge.d.ts +2 -2
  20. package/lib/CircleOcticon.d.ts +4 -4
  21. package/lib/DatePicker/DatePicker.d.ts +5 -1
  22. package/lib/DatePicker/DatePicker.js +1 -1
  23. package/lib/DatePicker/DatePickerOverlay.js +5 -3
  24. package/lib/DatePicker/DatePickerPanel.js +134 -3
  25. package/lib/DatePicker/Day.js +17 -8
  26. package/lib/DatePicker/useDatePicker.js +24 -151
  27. package/lib/Dialog.d.ts +4 -4
  28. package/lib/Dropdown.d.ts +16 -16
  29. package/lib/DropdownMenu/DropdownButton.d.ts +6 -6
  30. package/lib/FilterList.d.ts +3 -3
  31. package/lib/Flash.d.ts +1 -1
  32. package/lib/Label.d.ts +1 -1
  33. package/lib/Position.d.ts +4 -4
  34. package/lib/ProgressBar.d.ts +1 -1
  35. package/lib/SelectMenu/SelectMenu.d.ts +24 -24
  36. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  37. package/lib/TextInputWithTokens.d.ts +8 -4
  38. package/lib/TextInputWithTokens.js +102 -29
  39. package/lib/Timeline.d.ts +4 -4
  40. package/lib/Token/AvatarToken.d.ts +1 -1
  41. package/lib/Token/IssueLabelToken.d.ts +1 -1
  42. package/lib/Token/Token.d.ts +1 -1
  43. package/lib/Token/Token.js +13 -2
  44. package/lib/Token/TokenBase.js +0 -4
  45. package/lib/Token/_RemoveTokenButton.js +15 -2
  46. package/lib/_TextInputWrapper.d.ts +1 -1
  47. package/lib/_TextInputWrapper.js +1 -1
  48. package/lib/sx.d.ts +8 -2
  49. package/lib/theme.d.ts +78 -0
  50. package/lib/theme.js +3 -1
  51. package/lib/utils/types/KeyPaths.d.ts +3 -0
  52. package/lib/utils/types/KeyPaths.js +1 -0
  53. package/lib-esm/ActionList/Header.js +1 -1
  54. package/lib-esm/ActionList/Item.d.ts +6 -0
  55. package/lib-esm/ActionList/Item.js +5 -1
  56. package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +7 -6
  57. package/lib-esm/Autocomplete/Autocomplete.d.ts +4 -4
  58. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +4 -4
  59. package/lib-esm/Button/Button.d.ts +5 -5
  60. package/lib-esm/Button/ButtonBase.d.ts +1 -1
  61. package/lib-esm/Button/ButtonClose.d.ts +3 -3
  62. package/lib-esm/Button/ButtonDanger.d.ts +5 -5
  63. package/lib-esm/Button/ButtonInvisible.d.ts +5 -5
  64. package/lib-esm/Button/ButtonOutline.d.ts +5 -5
  65. package/lib-esm/Button/ButtonPrimary.d.ts +5 -5
  66. package/lib-esm/CircleBadge.d.ts +2 -2
  67. package/lib-esm/CircleOcticon.d.ts +4 -4
  68. package/lib-esm/DatePicker/DatePicker.d.ts +5 -1
  69. package/lib-esm/DatePicker/DatePicker.js +1 -1
  70. package/lib-esm/DatePicker/DatePickerOverlay.js +5 -3
  71. package/lib-esm/DatePicker/DatePickerPanel.js +135 -4
  72. package/lib-esm/DatePicker/Day.js +17 -9
  73. package/lib-esm/DatePicker/useDatePicker.js +25 -152
  74. package/lib-esm/Dialog.d.ts +4 -4
  75. package/lib-esm/Dropdown.d.ts +16 -16
  76. package/lib-esm/DropdownMenu/DropdownButton.d.ts +6 -6
  77. package/lib-esm/FilterList.d.ts +3 -3
  78. package/lib-esm/Flash.d.ts +1 -1
  79. package/lib-esm/Label.d.ts +1 -1
  80. package/lib-esm/Position.d.ts +4 -4
  81. package/lib-esm/ProgressBar.d.ts +1 -1
  82. package/lib-esm/SelectMenu/SelectMenu.d.ts +24 -24
  83. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  84. package/lib-esm/TextInputWithTokens.d.ts +8 -4
  85. package/lib-esm/TextInputWithTokens.js +101 -30
  86. package/lib-esm/Timeline.d.ts +4 -4
  87. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  88. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  89. package/lib-esm/Token/Token.d.ts +1 -1
  90. package/lib-esm/Token/Token.js +13 -2
  91. package/lib-esm/Token/TokenBase.js +0 -4
  92. package/lib-esm/Token/_RemoveTokenButton.js +11 -2
  93. package/lib-esm/_TextInputWrapper.d.ts +1 -1
  94. package/lib-esm/_TextInputWrapper.js +1 -1
  95. package/lib-esm/sx.d.ts +8 -2
  96. package/lib-esm/theme.d.ts +78 -0
  97. package/lib-esm/theme.js +2 -1
  98. package/lib-esm/utils/types/KeyPaths.d.ts +3 -0
  99. package/lib-esm/utils/types/KeyPaths.js +1 -0
  100. package/package.json +8 -6
@@ -3,7 +3,7 @@ import { SxProp } from '../sx';
3
3
  import { ComponentProps } from '../utils/types';
4
4
  declare const Button: import("styled-components").StyledComponent<"button", any, {
5
5
  as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
6
- variant?: "large" | "medium" | "small" | undefined;
6
+ variant?: "small" | "medium" | "large" | undefined;
7
7
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
8
8
  color?: string | undefined;
9
9
  fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -55,7 +55,7 @@ declare const Button: import("styled-components").StyledComponent<"button", any,
55
55
  results?: number | undefined;
56
56
  security?: string | undefined;
57
57
  unselectable?: "on" | "off" | undefined;
58
- inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
58
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
59
59
  is?: string | undefined;
60
60
  'aria-activedescendant'?: string | undefined;
61
61
  'aria-atomic'?: boolean | "true" | "false" | undefined;
@@ -70,7 +70,7 @@ declare const Button: import("styled-components").StyledComponent<"button", any,
70
70
  'aria-describedby'?: string | undefined;
71
71
  'aria-details'?: string | undefined;
72
72
  'aria-disabled'?: boolean | "true" | "false" | undefined;
73
- 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
73
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
74
74
  'aria-errormessage'?: string | undefined;
75
75
  'aria-expanded'?: boolean | "true" | "false" | undefined;
76
76
  'aria-flowto'?: string | undefined;
@@ -268,6 +268,7 @@ declare const Button: import("styled-components").StyledComponent<"button", any,
268
268
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
269
269
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
270
270
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
271
+ as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
271
272
  autoFocus?: boolean | undefined;
272
273
  disabled?: boolean | undefined;
273
274
  formAction?: string | undefined;
@@ -275,8 +276,7 @@ declare const Button: import("styled-components").StyledComponent<"button", any,
275
276
  formMethod?: string | undefined;
276
277
  formNoValidate?: boolean | undefined;
277
278
  formTarget?: string | undefined;
278
- as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
279
- variant?: "large" | "medium" | "small" | undefined;
279
+ variant?: "small" | "medium" | "large" | undefined;
280
280
  } & {
281
281
  theme?: any;
282
282
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
@@ -6,7 +6,7 @@ export declare const buttonSystemProps: import("styled-system").styleFn;
6
6
  export declare type ButtonSystemProps = FontSizeProps & SystemCommonProps & SystemLayoutProps;
7
7
  declare const ButtonBase: import("styled-components").StyledComponent<"button", any, {
8
8
  as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
9
- variant?: "large" | "medium" | "small" | undefined;
9
+ variant?: "small" | "medium" | "large" | undefined;
10
10
  } & FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, never>;
11
11
  export declare type ButtonBaseProps = ComponentProps<typeof ButtonBase>;
12
12
  export default ButtonBase;
@@ -74,7 +74,7 @@ declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
74
74
  results?: number | undefined;
75
75
  security?: string | undefined;
76
76
  unselectable?: "on" | "off" | undefined;
77
- inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
77
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
78
78
  is?: string | undefined;
79
79
  'aria-activedescendant'?: string | undefined;
80
80
  'aria-atomic'?: boolean | "true" | "false" | undefined;
@@ -89,7 +89,7 @@ declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
89
89
  'aria-describedby'?: string | undefined;
90
90
  'aria-details'?: string | undefined;
91
91
  'aria-disabled'?: boolean | "true" | "false" | undefined;
92
- 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
92
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
93
93
  'aria-errormessage'?: string | undefined;
94
94
  'aria-expanded'?: boolean | "true" | "false" | undefined;
95
95
  'aria-flowto'?: string | undefined;
@@ -306,7 +306,7 @@ declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
306
306
  py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
307
307
  paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
308
308
  size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
309
- sx?: import("@styled-system/css").SystemStyleObject | undefined;
309
+ sx?: import("../sx").BetterSystemStyleObject | undefined;
310
310
  autoFocus?: boolean | undefined;
311
311
  disabled?: boolean | undefined;
312
312
  formAction?: string | undefined;
@@ -3,7 +3,7 @@ import { SxProp } from '../sx';
3
3
  import { ComponentProps } from '../utils/types';
4
4
  declare const ButtonDanger: import("styled-components").StyledComponent<"button", any, {
5
5
  as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
6
- variant?: "large" | "medium" | "small" | undefined;
6
+ variant?: "small" | "medium" | "large" | undefined;
7
7
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
8
8
  color?: string | undefined;
9
9
  fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -55,7 +55,7 @@ declare const ButtonDanger: import("styled-components").StyledComponent<"button"
55
55
  results?: number | undefined;
56
56
  security?: string | undefined;
57
57
  unselectable?: "on" | "off" | undefined;
58
- inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
58
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
59
59
  is?: string | undefined;
60
60
  'aria-activedescendant'?: string | undefined;
61
61
  'aria-atomic'?: boolean | "true" | "false" | undefined;
@@ -70,7 +70,7 @@ declare const ButtonDanger: import("styled-components").StyledComponent<"button"
70
70
  'aria-describedby'?: string | undefined;
71
71
  'aria-details'?: string | undefined;
72
72
  'aria-disabled'?: boolean | "true" | "false" | undefined;
73
- 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
73
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
74
74
  'aria-errormessage'?: string | undefined;
75
75
  'aria-expanded'?: boolean | "true" | "false" | undefined;
76
76
  'aria-flowto'?: string | undefined;
@@ -268,6 +268,7 @@ declare const ButtonDanger: import("styled-components").StyledComponent<"button"
268
268
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
269
269
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
270
270
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
271
+ as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
271
272
  autoFocus?: boolean | undefined;
272
273
  disabled?: boolean | undefined;
273
274
  formAction?: string | undefined;
@@ -275,8 +276,7 @@ declare const ButtonDanger: import("styled-components").StyledComponent<"button"
275
276
  formMethod?: string | undefined;
276
277
  formNoValidate?: boolean | undefined;
277
278
  formTarget?: string | undefined;
278
- as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
279
- variant?: "large" | "medium" | "small" | undefined;
279
+ variant?: "small" | "medium" | "large" | undefined;
280
280
  } & {
281
281
  theme?: any;
282
282
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
@@ -3,7 +3,7 @@ import { SxProp } from '../sx';
3
3
  import { ComponentProps } from '../utils/types';
4
4
  declare const ButtonInvisible: import("styled-components").StyledComponent<"button", any, {
5
5
  as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
6
- variant?: "large" | "medium" | "small" | undefined;
6
+ variant?: "small" | "medium" | "large" | undefined;
7
7
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
8
8
  color?: string | undefined;
9
9
  fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -55,7 +55,7 @@ declare const ButtonInvisible: import("styled-components").StyledComponent<"butt
55
55
  results?: number | undefined;
56
56
  security?: string | undefined;
57
57
  unselectable?: "on" | "off" | undefined;
58
- inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
58
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
59
59
  is?: string | undefined;
60
60
  'aria-activedescendant'?: string | undefined;
61
61
  'aria-atomic'?: boolean | "true" | "false" | undefined;
@@ -70,7 +70,7 @@ declare const ButtonInvisible: import("styled-components").StyledComponent<"butt
70
70
  'aria-describedby'?: string | undefined;
71
71
  'aria-details'?: string | undefined;
72
72
  'aria-disabled'?: boolean | "true" | "false" | undefined;
73
- 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
73
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
74
74
  'aria-errormessage'?: string | undefined;
75
75
  'aria-expanded'?: boolean | "true" | "false" | undefined;
76
76
  'aria-flowto'?: string | undefined;
@@ -268,6 +268,7 @@ declare const ButtonInvisible: import("styled-components").StyledComponent<"butt
268
268
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
269
269
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
270
270
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
271
+ as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
271
272
  autoFocus?: boolean | undefined;
272
273
  disabled?: boolean | undefined;
273
274
  formAction?: string | undefined;
@@ -275,8 +276,7 @@ declare const ButtonInvisible: import("styled-components").StyledComponent<"butt
275
276
  formMethod?: string | undefined;
276
277
  formNoValidate?: boolean | undefined;
277
278
  formTarget?: string | undefined;
278
- as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
279
- variant?: "large" | "medium" | "small" | undefined;
279
+ variant?: "small" | "medium" | "large" | undefined;
280
280
  } & {
281
281
  theme?: any;
282
282
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
@@ -3,7 +3,7 @@ import { SxProp } from '../sx';
3
3
  import { ComponentProps } from '../utils/types';
4
4
  declare const ButtonOutline: import("styled-components").StyledComponent<"button", any, {
5
5
  as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
6
- variant?: "large" | "medium" | "small" | undefined;
6
+ variant?: "small" | "medium" | "large" | undefined;
7
7
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
8
8
  color?: string | undefined;
9
9
  fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -55,7 +55,7 @@ declare const ButtonOutline: import("styled-components").StyledComponent<"button
55
55
  results?: number | undefined;
56
56
  security?: string | undefined;
57
57
  unselectable?: "on" | "off" | undefined;
58
- inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
58
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
59
59
  is?: string | undefined;
60
60
  'aria-activedescendant'?: string | undefined;
61
61
  'aria-atomic'?: boolean | "true" | "false" | undefined;
@@ -70,7 +70,7 @@ declare const ButtonOutline: import("styled-components").StyledComponent<"button
70
70
  'aria-describedby'?: string | undefined;
71
71
  'aria-details'?: string | undefined;
72
72
  'aria-disabled'?: boolean | "true" | "false" | undefined;
73
- 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
73
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
74
74
  'aria-errormessage'?: string | undefined;
75
75
  'aria-expanded'?: boolean | "true" | "false" | undefined;
76
76
  'aria-flowto'?: string | undefined;
@@ -268,6 +268,7 @@ declare const ButtonOutline: import("styled-components").StyledComponent<"button
268
268
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
269
269
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
270
270
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
271
+ as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
271
272
  autoFocus?: boolean | undefined;
272
273
  disabled?: boolean | undefined;
273
274
  formAction?: string | undefined;
@@ -275,8 +276,7 @@ declare const ButtonOutline: import("styled-components").StyledComponent<"button
275
276
  formMethod?: string | undefined;
276
277
  formNoValidate?: boolean | undefined;
277
278
  formTarget?: string | undefined;
278
- as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
279
- variant?: "large" | "medium" | "small" | undefined;
279
+ variant?: "small" | "medium" | "large" | undefined;
280
280
  } & {
281
281
  theme?: any;
282
282
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
@@ -3,7 +3,7 @@ import { SxProp } from '../sx';
3
3
  import { ComponentProps } from '../utils/types';
4
4
  export declare const ButtonPrimary: import("styled-components").StyledComponent<"button", any, {
5
5
  as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
6
- variant?: "large" | "medium" | "small" | undefined;
6
+ variant?: "small" | "medium" | "large" | undefined;
7
7
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
8
8
  color?: string | undefined;
9
9
  fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -55,7 +55,7 @@ export declare const ButtonPrimary: import("styled-components").StyledComponent<
55
55
  results?: number | undefined;
56
56
  security?: string | undefined;
57
57
  unselectable?: "on" | "off" | undefined;
58
- inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
58
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
59
59
  is?: string | undefined;
60
60
  'aria-activedescendant'?: string | undefined;
61
61
  'aria-atomic'?: boolean | "true" | "false" | undefined;
@@ -70,7 +70,7 @@ export declare const ButtonPrimary: import("styled-components").StyledComponent<
70
70
  'aria-describedby'?: string | undefined;
71
71
  'aria-details'?: string | undefined;
72
72
  'aria-disabled'?: boolean | "true" | "false" | undefined;
73
- 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
73
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
74
74
  'aria-errormessage'?: string | undefined;
75
75
  'aria-expanded'?: boolean | "true" | "false" | undefined;
76
76
  'aria-flowto'?: string | undefined;
@@ -268,6 +268,7 @@ export declare const ButtonPrimary: import("styled-components").StyledComponent<
268
268
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
269
269
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
270
270
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
271
+ as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
271
272
  autoFocus?: boolean | undefined;
272
273
  disabled?: boolean | undefined;
273
274
  formAction?: string | undefined;
@@ -275,8 +276,7 @@ export declare const ButtonPrimary: import("styled-components").StyledComponent<
275
276
  formMethod?: string | undefined;
276
277
  formNoValidate?: boolean | undefined;
277
278
  formTarget?: string | undefined;
278
- as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
279
- variant?: "large" | "medium" | "small" | undefined;
279
+ variant?: "small" | "medium" | "large" | undefined;
280
280
  } & {
281
281
  theme?: any;
282
282
  } & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
@@ -5,7 +5,7 @@ import { SxProp } from './sx';
5
5
  import { ComponentProps } from './utils/types';
6
6
  declare const CircleBadge: import("styled-components").StyledComponent<"div", any, {
7
7
  inline?: boolean | undefined;
8
- variant?: "large" | "medium" | "small" | undefined;
8
+ variant?: "small" | "medium" | "large" | undefined;
9
9
  size?: number | undefined;
10
10
  } & SystemCommonProps & SxProp, never>;
11
11
  declare const CircleBadgeIcon: import("styled-components").StyledComponent<({ icon: IconComponent, ...rest }: {
@@ -15,7 +15,7 @@ export declare type CircleBadgeProps = ComponentProps<typeof CircleBadge>;
15
15
  export declare type CircleBadgeIconProps = ComponentProps<typeof CircleBadgeIcon>;
16
16
  declare const _default: string & import("styled-components").StyledComponentBase<"div", any, {
17
17
  inline?: boolean | undefined;
18
- variant?: "large" | "medium" | "small" | undefined;
18
+ variant?: "small" | "medium" | "large" | undefined;
19
19
  size?: number | undefined;
20
20
  } & SystemCommonProps & SxProp, never> & import("hoist-non-react-statics").NonReactStatics<never, {}> & {
21
21
  Icon: import("styled-components").StyledComponent<({ icon: IconComponent, ...rest }: {
@@ -13,6 +13,7 @@ declare namespace CircleOcticon {
13
13
  var defaultProps: {
14
14
  size: number;
15
15
  lineHeight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
16
+ border?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
16
17
  alignContent?: import("styled-system").ResponsiveValue<import("csstype").Property.AlignContent, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
17
18
  alignItems?: import("styled-system").ResponsiveValue<import("csstype").Property.AlignItems, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
18
19
  alignSelf?: import("styled-system").ResponsiveValue<import("csstype").Property.AlignSelf, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -88,7 +89,6 @@ declare namespace CircleOcticon {
88
89
  zIndex?: import("styled-system").ResponsiveValue<import("csstype").Property.ZIndex, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
89
90
  background?: import("styled-system").ResponsiveValue<import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
90
91
  backgroundPosition?: import("styled-system").ResponsiveValue<import("csstype").Property.BackgroundPosition<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
91
- border?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
92
92
  borderBottom?: import("styled-system").ResponsiveValue<import("csstype").Property.BorderBottom<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
93
93
  borderColor?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
94
94
  borderLeft?: import("styled-system").ResponsiveValue<import("csstype").Property.BorderLeft<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -151,7 +151,7 @@ declare namespace CircleOcticon {
151
151
  results?: number | undefined;
152
152
  security?: string | undefined;
153
153
  unselectable?: "on" | "off" | undefined;
154
- inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
154
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
155
155
  is?: string | undefined;
156
156
  'aria-activedescendant'?: string | undefined;
157
157
  'aria-atomic'?: boolean | "true" | "false" | undefined;
@@ -166,7 +166,7 @@ declare namespace CircleOcticon {
166
166
  'aria-describedby'?: string | undefined;
167
167
  'aria-details'?: string | undefined;
168
168
  'aria-disabled'?: boolean | "true" | "false" | undefined;
169
- 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
169
+ 'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
170
170
  'aria-errormessage'?: string | undefined;
171
171
  'aria-expanded'?: boolean | "true" | "false" | undefined;
172
172
  'aria-flowto'?: string | undefined;
@@ -384,7 +384,7 @@ declare namespace CircleOcticon {
384
384
  paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
385
385
  borderX?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
386
386
  borderY?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
387
- sx?: import("@styled-system/css").SystemStyleObject | undefined;
387
+ sx?: import("./sx").BetterSystemStyleObject | undefined;
388
388
  theme?: any;
389
389
  };
390
390
  }
@@ -41,8 +41,12 @@ export interface DatePickerProps extends DatePickerConfiguration {
41
41
  * A custom function component used to render the anchor element.
42
42
  * Will receive the selected text as `children` prop when an item is activated.
43
43
  */
44
- renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element;
44
+ renderAnchor?: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element;
45
45
  value?: Selection;
46
+ /**
47
+ * Minimum date to select
48
+ */
49
+ minDate?: Date | null;
46
50
  }
47
51
  export declare const DatePicker: React.FC<DatePickerProps>;
48
52
  export {};
@@ -22,7 +22,7 @@ export const DatePicker = ({
22
22
  open,
23
23
  overlayProps,
24
24
  placeholder,
25
- renderAnchor,
25
+ renderAnchor = null,
26
26
  showInputPrompt,
27
27
  value,
28
28
  variant,
@@ -24,12 +24,14 @@ export const DatePickerOverlay = ({
24
24
  }
25
25
  };
26
26
 
27
- return /*#__PURE__*/React.createElement(AnchoredOverlay, _extends({
27
+ return /*#__PURE__*/React.createElement(AnchoredOverlay, _extends({}, rest, {
28
28
  onClose: onOverlayClose,
29
+ focusTrapSettings: {
30
+ restoreFocusOnCleanUp: true
31
+ },
29
32
  focusZoneSettings: {
30
33
  disabled: true
31
- }
32
- }, rest, {
34
+ },
33
35
  "aria-modal": "true",
34
36
  "aria-labelledby": `${currentViewingDate.getMonth()} ${currentViewingDate.getFullYear()}`,
35
37
  "aria-live": "polite"
@@ -1,10 +1,10 @@
1
- import { addMonths, subMonths } from 'date-fns';
1
+ import { isAfter, isBefore, addMonths, subMonths, isWeekend, addDays, subDays, addWeeks, subWeeks, isSaturday, isSunday, nextSaturday, previousFriday, previousSunday, subYears, addYears, nextMonday, isMonday, previousMonday, isFriday, nextFriday, format } from 'date-fns';
2
2
  import React, { useCallback, useMemo, useRef } from 'react';
3
3
  import Box from '../Box';
4
4
  import { Month } from './Month';
5
5
  import styled from 'styled-components';
6
6
  import { COMMON, get, TYPOGRAPHY } from '../constants';
7
- import useDatePicker from './useDatePicker';
7
+ import useDatePicker, { normalizeDate } from './useDatePicker';
8
8
  import { ChevronLeftIcon, ChevronRightIcon } from '@primer/octicons-react';
9
9
  import StyledOcticon from '../StyledOcticon';
10
10
  import Button, { ButtonPrimary } from '../Button';
@@ -48,6 +48,8 @@ export const DatePickerPanel = () => {
48
48
  goToMonth,
49
49
  nextMonth,
50
50
  previousMonth,
51
+ onDayFocus,
52
+ setFocusDate,
51
53
  viewMode
52
54
  } = useDatePicker();
53
55
  const panelRef = useRef(null);
@@ -59,6 +61,136 @@ export const DatePickerPanel = () => {
59
61
  bindKeys: FocusKeys.Tab,
60
62
  focusInStrategy: 'closest'
61
63
  });
64
+ const getNextFocusable = useCallback((direction, from, event) => {
65
+ var _datePanelRef$current, _datePanelRef$current2;
66
+
67
+ const key = event.key;
68
+ const {
69
+ disableWeekends,
70
+ minDate,
71
+ maxDate
72
+ } = configuration;
73
+ const fromDate = from === null || from === void 0 ? void 0 : from.getAttribute('data-date');
74
+ const focusDate = fromDate ? new Date(fromDate) : new Date();
75
+ let newDate = normalizeDate(focusDate);
76
+
77
+ switch (key) {
78
+ case 'ArrowRight':
79
+ {
80
+ // Increase selection by 1 day
81
+ newDate = normalizeDate(addDays(focusDate, 1));
82
+ if (maxDate && isAfter(newDate, maxDate)) newDate = maxDate;
83
+
84
+ if (disableWeekends && isWeekend(newDate)) {
85
+ const monday = nextMonday(newDate);
86
+ newDate = maxDate && isAfter(monday, maxDate) ? maxDate : monday;
87
+ }
88
+
89
+ setFocusDate(newDate);
90
+ onDayFocus(newDate);
91
+ break;
92
+ }
93
+
94
+ case 'ArrowLeft':
95
+ {
96
+ // Decrease selection by 1 day
97
+ newDate = normalizeDate(subDays(focusDate, 1));
98
+ if (minDate && isBefore(newDate, minDate)) newDate = minDate;
99
+
100
+ if (disableWeekends && isWeekend(newDate)) {
101
+ const friday = previousFriday(newDate);
102
+ newDate = minDate && isBefore(friday, minDate) ? minDate : friday;
103
+ }
104
+
105
+ setFocusDate(newDate);
106
+ onDayFocus(newDate);
107
+ break;
108
+ }
109
+
110
+ case 'ArrowUp':
111
+ {
112
+ // Decrease selection by 1 week
113
+ newDate = normalizeDate(subWeeks(focusDate, 1));
114
+ if (minDate && isBefore(newDate, minDate)) newDate = minDate;
115
+ setFocusDate(newDate);
116
+ onDayFocus(newDate);
117
+ break;
118
+ }
119
+
120
+ case 'ArrowDown':
121
+ {
122
+ // Increase selection by 1 week
123
+ newDate = normalizeDate(addWeeks(focusDate, 1));
124
+ if (maxDate && isAfter(newDate, maxDate)) newDate = maxDate;
125
+ setFocusDate(newDate);
126
+ onDayFocus(newDate);
127
+ break;
128
+ }
129
+
130
+ case 'Home':
131
+ {
132
+ newDate = focusDate;
133
+
134
+ if (disableWeekends) {
135
+ newDate = normalizeDate(isMonday(focusDate) ? focusDate : previousMonday(focusDate));
136
+ } else {
137
+ newDate = normalizeDate(isSunday(focusDate) ? focusDate : previousSunday(focusDate));
138
+ }
139
+
140
+ if (minDate && isBefore(newDate, minDate)) newDate = minDate;
141
+ setFocusDate(newDate);
142
+ onDayFocus(newDate);
143
+ break;
144
+ }
145
+
146
+ case 'End':
147
+ {
148
+ newDate = focusDate;
149
+
150
+ if (disableWeekends) {
151
+ newDate = normalizeDate(isFriday(focusDate) ? focusDate : nextFriday(focusDate));
152
+ } else {
153
+ newDate = normalizeDate(isSaturday(focusDate) ? focusDate : nextSaturday(focusDate));
154
+ }
155
+
156
+ if (maxDate && isAfter(newDate, maxDate)) newDate = maxDate;
157
+ setFocusDate(newDate);
158
+ onDayFocus(newDate);
159
+ break;
160
+ }
161
+
162
+ case 'PageUp':
163
+ {
164
+ newDate = normalizeDate(event.shiftKey ? subYears(focusDate, 1) : subMonths(focusDate, 1));
165
+ if (minDate && isBefore(newDate, minDate)) newDate = minDate;
166
+ setFocusDate(newDate);
167
+ onDayFocus(newDate);
168
+ break;
169
+ }
170
+
171
+ case 'PageDown':
172
+ {
173
+ newDate = normalizeDate(event.shiftKey ? addYears(focusDate, 1) : addMonths(focusDate, 1));
174
+ if (maxDate && isAfter(newDate, maxDate)) newDate = maxDate;
175
+ setFocusDate(newDate);
176
+ onDayFocus(newDate);
177
+ break;
178
+ }
179
+
180
+ default:
181
+ {
182
+ break;
183
+ }
184
+ }
185
+
186
+ return (_datePanelRef$current = (_datePanelRef$current2 = datePanelRef.current) === null || _datePanelRef$current2 === void 0 ? void 0 : _datePanelRef$current2.querySelector(`[data-date="${format(newDate, 'MM/dd/yyyy')}"]`)) !== null && _datePanelRef$current !== void 0 ? _datePanelRef$current : undefined;
187
+ }, [configuration, onDayFocus, setFocusDate]);
188
+ useFocusZone({
189
+ containerRef: datePanelRef,
190
+ bindKeys: FocusKeys.ArrowAll | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
191
+ focusInStrategy: 'previous',
192
+ getNextFocusable
193
+ }, [getNextFocusable]);
62
194
  useFocusZone({
63
195
  containerRef: footerRef,
64
196
  bindKeys: FocusKeys.Tab,
@@ -170,8 +302,7 @@ export const DatePickerPanel = () => {
170
302
  icon: ChevronRightIcon,
171
303
  color: "fg.muted"
172
304
  }))), /*#__PURE__*/React.createElement(DatePickerPanelMonths, {
173
- ref: datePanelRef,
174
- tabIndex: 0
305
+ ref: datePanelRef
175
306
  }, /*#__PURE__*/React.createElement(Month, {
176
307
  date: currentViewingDate
177
308
  }), viewMode === '2-month' && /*#__PURE__*/React.createElement(Month, {
@@ -1,9 +1,10 @@
1
- import React, { useCallback, useMemo } from 'react';
1
+ import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import Box from '../Box';
4
4
  import Text from '../Text';
5
5
  import { get } from '../constants';
6
6
  import useDatePicker from './useDatePicker';
7
+ import { format } from 'date-fns';
7
8
  const DayBaseComponent = styled(Box).withConfig({
8
9
  displayName: "Day__DayBaseComponent",
9
10
  componentId: "sc-1japneh-0"
@@ -71,7 +72,6 @@ const getStateStyles = (props, prop, state) => {
71
72
  const {
72
73
  blocked,
73
74
  disabled,
74
- focused,
75
75
  selected,
76
76
  today
77
77
  } = props;
@@ -94,8 +94,6 @@ const getStateStyles = (props, prop, state) => {
94
94
  return states.blocked[prop];
95
95
  } else if (disabled) {
96
96
  return states.disabled[prop];
97
- } else if (focused) {
98
- return states.default.hover[prop];
99
97
  } else {
100
98
  return today && prop === 'color' ? states.default[state]['todayColor'] : states.default[state][prop];
101
99
  }
@@ -112,7 +110,7 @@ const DayComponent = styled(DayBaseComponent).attrs(props => ({
112
110
  })).withConfig({
113
111
  displayName: "Day__DayComponent",
114
112
  componentId: "sc-1japneh-1"
115
- })(["background-color:", ";border-radius:", ";opacity:", ";transition:0.1s background-color ease;& ", "{align-self:center;color:", ";display:flex;font-family:", ";font-size:", ";justify-content:center;justify-self:center;user-select:none;transition:0.1s color ease;width:30px;}&:hover{background-color:", ";cursor:pointer;transition:0.05s background-color ease;& ", "{color:", ";transition:0.1s color ease;}}&:active{background-color:", ";box-shadow:inset ", ";transition:0.1s background-color ease,0.1s box-shadow ease,0.1s color ease;& ", "{color:", ";transition:0.1s color ease;}}"], props => props.background, props => props.borderRadius, props => props.disabled ? 0.5 : 1, Text, props => props.textColor, get('fonts.mono'), get('fontSizes.0'), props => props.backgroundHover, Text, props => props.textColorHover, props => props.backgroundPressed, get('shadows.shadow.medium'), Text, props => props.textColorPressed);
113
+ })(["background-color:", ";border-radius:", ";opacity:", ";transition:0.1s background-color ease;& ", "{align-self:center;color:", ";display:flex;font-family:", ";font-size:", ";justify-content:center;justify-self:center;padding:4px 0;position:relative;transition:0.1s color ease;user-select:none;width:16px;&:after{content:'';display:", ";position:absolute;bottom:0;background:", ";width:100%;height:2px;border-radius:1px;}}&:hover,&:focus{background-color:", ";cursor:pointer;transition:0.05s background-color ease;& ", "{color:", ";transition:0.1s color ease;}}&:active{background-color:", ";box-shadow:inset ", ";transition:0.1s background-color ease,0.1s box-shadow ease,0.1s color ease;& ", "{color:", ";transition:0.1s color ease;}}"], props => props.background, props => props.borderRadius, props => props.disabled ? 0.5 : 1, Text, props => props.textColor, get('fonts.mono'), get('fontSizes.0'), props => props.today ? 'block' : 'none', props => props.selected && props.selected !== 'middle' ? get('colors.fg.onEmphasis')(props) : get('colors.accent.emphasis')(props), props => props.backgroundHover, Text, props => props.textColorHover, props => props.backgroundPressed, get('shadows.shadow.medium'), Text, props => props.textColorPressed);
116
114
  export const Day = ({
117
115
  date,
118
116
  onAction
@@ -126,6 +124,16 @@ export const Day = ({
126
124
  selected,
127
125
  today
128
126
  } = useDatePicker(date);
127
+ const dayRef = useRef(null);
128
+ useEffect(() => {
129
+ if (focused) {
130
+ setTimeout(() => {
131
+ var _dayRef$current;
132
+
133
+ return (_dayRef$current = dayRef.current) === null || _dayRef$current === void 0 ? void 0 : _dayRef$current.focus();
134
+ }, 0);
135
+ }
136
+ }, [focused]);
129
137
  const keyPressHandler = useCallback(event => {
130
138
  if (disabled) {
131
139
  return;
@@ -145,12 +153,10 @@ export const Day = ({
145
153
  onAction === null || onAction === void 0 ? void 0 : onAction(date, event);
146
154
  }, [disabled, onSelection, date, onAction]);
147
155
  const todayStyles = useMemo(() => today ? {
148
- border: '2px solid',
149
- padding: '4px 6px',
150
- borderRadius: '16px',
151
156
  fontWeight: 'bold'
152
157
  } : {}, [today]);
153
158
  return /*#__PURE__*/React.createElement(DayComponent, {
159
+ ref: dayRef,
154
160
  role: "gridcell",
155
161
  "aria-disabled": disabled,
156
162
  "aria-selected": selected !== false,
@@ -162,7 +168,9 @@ export const Day = ({
162
168
  onClick: clickHandler,
163
169
  onMouseEnter: () => onDayFocus(date),
164
170
  onFocus: () => onDayFocus(date),
165
- onKeyPress: keyPressHandler
171
+ onKeyPress: keyPressHandler,
172
+ tabIndex: -1,
173
+ "data-date": format(date, 'MM/dd/yyyy')
166
174
  }, /*#__PURE__*/React.createElement(Text, {
167
175
  sx: todayStyles
168
176
  }, date.getDate()));