@availity/mui-datepicker 0.2.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -2,12 +2,25 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-datepicker@0.1.0...@availity/mui-datepicker@0.2.0) (2023-11-28)
5
+ ## [0.3.1](https://github.com/Availity/element/compare/@availity/mui-datepicker@0.3.0...@availity/mui-datepicker@0.3.1) (2024-01-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * update datepicker styles ([43eae9a](https://github.com/Availity/element/commit/43eae9a4ab1b70d6a3a295bf8e54a3423ef6638a))
11
+
12
+ ## [0.3.0](https://github.com/Availity/element/compare/@availity/mui-datepicker@0.2.0...@availity/mui-datepicker@0.3.0) (2023-12-14)
6
13
 
7
14
 
8
15
  ### Features
9
16
 
10
- * **mui-datepicker:** make props match autocomplete pattern ([93696f3](https://github.com/Availity/element/commit/93696f3a24828ed2ea3a313a3531b8c7bf195599))
17
+ * add form story ([11d1f6c](https://github.com/Availity/element/commit/11d1f6c6191540bf02ff42d4056ac553eecc8c73))
18
+
19
+ ## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-datepicker@0.1.0...@availity/mui-datepicker@0.2.0) (2023-11-28)
20
+
21
+ ### Features
22
+
23
+ - **mui-datepicker:** make props match autocomplete pattern ([93696f3](https://github.com/Availity/element/commit/93696f3a24828ed2ea3a313a3531b8c7bf195599))
11
24
 
12
25
  ## 0.1.0 (2023-11-08)
13
26
 
package/dist/index.d.ts CHANGED
@@ -3,9 +3,14 @@ import { DatePickerProps } from '@mui/x-date-pickers/DatePicker';
3
3
  import { Dayjs } from 'dayjs';
4
4
 
5
5
  type DatepickerProps = {
6
+ value: Dayjs | string | null;
6
7
  /** Props applied to the `TextField` component */
7
8
  FieldProps?: TextFieldProps;
8
- } & Omit<DatePickerProps<Dayjs, Dayjs>, 'components' | 'componentsProps' | 'desktopModeMediaQuery' | 'DialogProps' | 'OpenPickerButtonProps' | 'openTo' | 'orientation' | 'PaperProps' | 'PopperProps' | 'reduceAnimations' | 'renderInput' | 'rifmFormatter' | 'showToolbar' | 'ToolbarComponent' | 'toolbarFormat' | 'toolbarPlaceholder' | 'toolbarTitle' | 'TransitionComponent'>;
9
- declare const Datepicker: ({ FieldProps, ...props }: DatepickerProps) => JSX.Element;
9
+ /** Determines where the Calendar will be placed when opened.
10
+ * @default bottom-start
11
+ */
12
+ placement?: 'bottom-start' | 'bottom' | 'bottom-end';
13
+ } & Omit<DatePickerProps<Dayjs, Dayjs>, 'components' | 'componentsProps' | 'desktopModeMediaQuery' | 'DialogProps' | 'OpenPickerButtonProps' | 'openTo' | 'orientation' | 'PaperProps' | 'PopperProps' | 'reduceAnimations' | 'renderInput' | 'rifmFormatter' | 'showToolbar' | 'ToolbarComponent' | 'toolbarFormat' | 'toolbarPlaceholder' | 'toolbarTitle' | 'TransitionComponent' | 'value'>;
14
+ declare const Datepicker: ({ FieldProps, placement, ...props }: DatepickerProps) => JSX.Element;
10
15
 
11
16
  export { Datepicker, DatepickerProps };
package/dist/index.js CHANGED
@@ -28,9 +28,12 @@ module.exports = __toCommonJS(src_exports);
28
28
  var import_mui_textfield = require("@availity/mui-textfield");
29
29
  var import_DatePicker = require("@mui/x-date-pickers/DatePicker");
30
30
  var import_jsx_runtime = require("react/jsx-runtime");
31
- var Datepicker = ({ FieldProps, ...props }) => {
31
+ var paperProps = { elevation: 8, variant: "elevation", sx: { marginTop: "4px" } };
32
+ var Datepicker = ({ FieldProps, placement = "bottom-start", ...props }) => {
32
33
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DatePicker.DatePicker, {
33
34
  ...props,
35
+ PaperProps: paperProps,
36
+ PopperProps: { placement },
34
37
  renderInput: (params) => {
35
38
  if (params.inputProps) {
36
39
  params.inputProps.placeholder = "MM/DD/YYYY";
package/dist/index.mjs CHANGED
@@ -2,9 +2,12 @@
2
2
  import { TextField } from "@availity/mui-textfield";
3
3
  import { DatePicker as MuiDatePicker } from "@mui/x-date-pickers/DatePicker";
4
4
  import { jsx } from "react/jsx-runtime";
5
- var Datepicker = ({ FieldProps, ...props }) => {
5
+ var paperProps = { elevation: 8, variant: "elevation", sx: { marginTop: "4px" } };
6
+ var Datepicker = ({ FieldProps, placement = "bottom-start", ...props }) => {
6
7
  return /* @__PURE__ */ jsx(MuiDatePicker, {
7
8
  ...props,
9
+ PaperProps: paperProps,
10
+ PopperProps: { placement },
8
11
  renderInput: (params) => {
9
12
  if (params.inputProps) {
10
13
  params.inputProps.placeholder = "MM/DD/YYYY";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-datepicker",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Availity MUI Datepicker Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -32,7 +32,7 @@
32
32
  "publish:canary": "yarn npm publish --access public --tag canary"
33
33
  },
34
34
  "dependencies": {
35
- "@availity/mui-textfield": "0.4.2",
35
+ "@availity/mui-textfield": "0.5.7",
36
36
  "@mui/x-date-pickers": "^5.0.15",
37
37
  "dayjs": "^1.11.9"
38
38
  },
@@ -3,8 +3,13 @@ import { DatePicker as MuiDatePicker, DatePickerProps as MuiDatePickerProps } fr
3
3
  import type { Dayjs } from 'dayjs';
4
4
 
5
5
  export type DatepickerProps = {
6
+ value: Dayjs | string | null;
6
7
  /** Props applied to the `TextField` component */
7
8
  FieldProps?: TextFieldProps;
9
+ /** Determines where the Calendar will be placed when opened.
10
+ * @default bottom-start
11
+ */
12
+ placement?: 'bottom-start' | 'bottom' | 'bottom-end';
8
13
  } & Omit<
9
14
  MuiDatePickerProps<Dayjs, Dayjs>,
10
15
  | 'components'
@@ -25,12 +30,17 @@ export type DatepickerProps = {
25
30
  | 'toolbarPlaceholder'
26
31
  | 'toolbarTitle'
27
32
  | 'TransitionComponent'
33
+ | 'value'
28
34
  >;
29
35
 
30
- export const Datepicker = ({ FieldProps, ...props }: DatepickerProps): JSX.Element => {
36
+ const paperProps = { elevation: 8, variant: 'elevation', sx: { marginTop: '4px' } } as const;
37
+
38
+ export const Datepicker = ({ FieldProps, placement = 'bottom-start', ...props }: DatepickerProps): JSX.Element => {
31
39
  return (
32
40
  <MuiDatePicker
33
41
  {...props}
42
+ PaperProps={paperProps}
43
+ PopperProps={{ placement }}
34
44
  renderInput={(params) => {
35
45
  if (params.inputProps) {
36
46
  params.inputProps.placeholder = 'MM/DD/YYYY';