@elliemae/ds-form-date-range-picker 3.0.0-next.69 → 3.0.0-next.72

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 (30) hide show
  1. package/dist/cjs/ControlledDateRangePicker.js +0 -1
  2. package/dist/cjs/ControlledDateRangePicker.js.map +2 -2
  3. package/dist/cjs/ControlledDateRangePickerCTX.js +3 -1
  4. package/dist/cjs/ControlledDateRangePickerCTX.js.map +2 -2
  5. package/dist/cjs/config/useControlledDateRangePicker.js +16 -6
  6. package/dist/cjs/config/useControlledDateRangePicker.js.map +2 -2
  7. package/dist/cjs/exported-related/theming.js +32 -0
  8. package/dist/cjs/exported-related/theming.js.map +7 -0
  9. package/dist/cjs/index.d.js.map +1 -1
  10. package/dist/cjs/index.js +1 -0
  11. package/dist/cjs/index.js.map +2 -2
  12. package/dist/cjs/parts/ControlledDateRangeContent.js +12 -6
  13. package/dist/cjs/parts/ControlledDateRangeContent.js.map +2 -2
  14. package/dist/cjs/propTypes.js +21 -4
  15. package/dist/cjs/propTypes.js.map +2 -2
  16. package/dist/esm/ControlledDateRangePicker.js +0 -1
  17. package/dist/esm/ControlledDateRangePicker.js.map +2 -2
  18. package/dist/esm/ControlledDateRangePickerCTX.js +3 -1
  19. package/dist/esm/ControlledDateRangePickerCTX.js.map +2 -2
  20. package/dist/esm/config/useControlledDateRangePicker.js +17 -7
  21. package/dist/esm/config/useControlledDateRangePicker.js.map +2 -2
  22. package/dist/esm/exported-related/theming.js +10 -0
  23. package/dist/esm/exported-related/theming.js.map +7 -0
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/index.js.map +2 -2
  26. package/dist/esm/parts/ControlledDateRangeContent.js +12 -6
  27. package/dist/esm/parts/ControlledDateRangeContent.js.map +2 -2
  28. package/dist/esm/propTypes.js +22 -3
  29. package/dist/esm/propTypes.js.map +2 -2
  30. package/package.json +1 -1
@@ -37,7 +37,6 @@ const DSControlledDateRangePicker = (props) => {
37
37
  value: ctx
38
38
  }, /* @__PURE__ */ import_react.default.createElement(import_ControlledDateRangeContent.ControlledDateRangeContent, null));
39
39
  };
40
- DSControlledDateRangePicker.propTypes = import_propTypes.propTypes;
41
40
  DSControlledDateRangePicker.displayName = "DSControlledDateRangePicker";
42
41
  const DSControlledDateRangePickerWithSchema = (0, import_react_desc.describe)(DSControlledDateRangePicker);
43
42
  DSControlledDateRangePickerWithSchema.propTypes = import_propTypes.propTypes;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ControlledDateRangePicker.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent';\nimport { propTypes } from './propTypes';\nimport { ControlledDateRangePickerContext } from './ControlledDateRangePickerCTX';\nimport type { DateRangePickerPropsT } from './index.d';\n\nconst DSControlledDateRangePicker = (props: DateRangePickerPropsT): JSX.Element => {\n const ctx = useControlledDateRangePicker(props);\n return (\n <ControlledDateRangePickerContext.Provider value={ctx}>\n <ControlledDateRangeContent />\n </ControlledDateRangePickerContext.Provider>\n );\n};\nDSControlledDateRangePicker.propTypes = propTypes;\nDSControlledDateRangePicker.displayName = 'DSControlledDateRangePicker';\nconst DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);\nDSControlledDateRangePickerWithSchema.propTypes = propTypes;\n\nexport { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAyB;AACzB,0CAA6C;AAC7C,wCAA2C;AAC3C,uBAA0B;AAC1B,0CAAiD;AAGjD,MAAM,8BAA8B,CAAC,UAA8C;AACjF,QAAM,MAAM,sEAA6B,KAAK;AAC9C,SACE,mDAAC,qEAAiC,UAAjC;AAAA,IAA0C,OAAO;AAAA,KAChD,mDAAC,kEAA2B,CAC9B;AAEJ;AACA,4BAA4B,YAAY;AACxC,4BAA4B,cAAc;AAC1C,MAAM,wCAAwC,gCAAS,2BAA2B;AAClF,sCAAsC,YAAY;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent';\nimport { propTypes } from './propTypes';\nimport { ControlledDateRangePickerContext } from './ControlledDateRangePickerCTX';\nimport type { DateRangePickerPropsT } from './index.d';\n\nconst DSControlledDateRangePicker = (props: DateRangePickerPropsT): JSX.Element => {\n const ctx = useControlledDateRangePicker(props);\n return (\n <ControlledDateRangePickerContext.Provider value={ctx}>\n <ControlledDateRangeContent />\n </ControlledDateRangePickerContext.Provider>\n );\n};\n\nDSControlledDateRangePicker.displayName = 'DSControlledDateRangePicker';\nconst DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);\nDSControlledDateRangePickerWithSchema.propTypes = propTypes;\n\nexport { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAyB;AACzB,0CAA6C;AAC7C,wCAA2C;AAC3C,uBAA0B;AAC1B,0CAAiD;AAGjD,MAAM,8BAA8B,CAAC,UAA8C;AACjF,QAAM,MAAM,sEAA6B,KAAK;AAC9C,SACE,mDAAC,qEAAiC,UAAjC;AAAA,IAA0C,OAAO;AAAA,KAChD,mDAAC,kEAA2B,CAC9B;AAEJ;AAEA,4BAA4B,cAAc;AAC1C,MAAM,wCAAwC,gCAAS,2BAA2B;AAClF,sCAAsC,YAAY;",
6
6
  "names": []
7
7
  }
@@ -71,7 +71,9 @@ const defaultContext = {
71
71
  withInputs: false,
72
72
  withIcon: false,
73
73
  isControllerOnly: false,
74
- isPickerOnly: false
74
+ isPickerOnly: false,
75
+ xstyledAttrs: {},
76
+ globalAttrs: {}
75
77
  };
76
78
  const ControlledDateRangePickerContext = (0, import_react.createContext)(defaultContext);
77
79
  var ControlledDateRangePickerCTX_default = ControlledDateRangePickerContext;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ControlledDateRangePickerCTX.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { createContext } from 'react';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from './index.d';\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\nexport const defaultProps: DateRangePickerPropsT = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n hasError: false,\n pickerFooterMsg: '',\n\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n\n emptyPickerStartingMonth: undefined,\n onCalendarOpenFocusedDay: undefined,\n isClearable: false,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n autoFocus: false,\n};\nconst defaultContext = {\n props: defaultProps,\n rangePickerLogic: {\n latestChangedDate: '',\n onCalendarOpen: noop,\n onCalendarClose: noop,\n handleFromDateChange: noop,\n handleToDateChange: noop,\n handlePickerDateChange: noop,\n handlePickerMonthDateChange: noop,\n handlePickerDayDateChange: noop,\n handlePickerYearDateChange: noop,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n },\n instanceUID: '',\n withInputs: false,\n withIcon: false,\n isControllerOnly: false,\n isPickerOnly: false,\n};\n/** Context for cross component communication */\nexport const ControlledDateRangePickerContext = createContext<ControlledDateRangePickerContextT>(defaultContext);\n\nexport default ControlledDateRangePickerContext;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AACnC,MAAM,eAAsC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,iBAAiB;AAAA,EAEjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAEhB,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,WAAW;AACb;AACA,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,kBAAkB;AAAA,IAChB,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IACxB,6BAA6B;AAAA,IAC7B,2BAA2B;AAAA,IAC3B,4BAA4B;AAAA,IAC5B,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,EACpB;AAAA,EACA,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,cAAc;AAChB;AAEO,MAAM,mCAAmC,gCAAiD,cAAc;AAE/G,IAAO,uCAAQ;",
4
+ "sourcesContent": ["import { createContext } from 'react';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from './index.d';\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\n\nexport const defaultProps: DateRangePickerPropsT = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n hasError: false,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n emptyPickerStartingMonth: undefined,\n onCalendarOpenFocusedDay: undefined,\n isClearable: false,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n autoFocus: false,\n};\n\nconst defaultContext = {\n props: defaultProps,\n rangePickerLogic: {\n latestChangedDate: '',\n onCalendarOpen: noop,\n onCalendarClose: noop,\n handleFromDateChange: noop,\n handleToDateChange: noop,\n handlePickerDateChange: noop,\n handlePickerMonthDateChange: noop,\n handlePickerDayDateChange: noop,\n handlePickerYearDateChange: noop,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n },\n instanceUID: '',\n withInputs: false,\n withIcon: false,\n isControllerOnly: false,\n isPickerOnly: false,\n xstyledAttrs: {},\n globalAttrs: {},\n};\n/** Context for cross component communication */\nexport const ControlledDateRangePickerContext = createContext<ControlledDateRangePickerContextT>(defaultContext);\n\nexport default ControlledDateRangePickerContext;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AAEnC,MAAM,eAAsC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,WAAW;AACb;AAEA,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,kBAAkB;AAAA,IAChB,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IACxB,6BAA6B;AAAA,IAC7B,2BAA2B;AAAA,IAC3B,4BAA4B;AAAA,IAC5B,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,EACpB;AAAA,EACA,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,cAAc,CAAC;AAAA,EACf,aAAa,CAAC;AAChB;AAEO,MAAM,mCAAmC,gCAAiD,cAAc;AAE/G,IAAO,uCAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,6 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
6
  var __getProtoOf = Object.getPrototypeOf;
@@ -20,7 +18,6 @@ var __spreadValues = (a, b) => {
20
18
  }
21
19
  return a;
22
20
  };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
21
  var __export = (target, all) => {
25
22
  for (var name in all)
26
23
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -52,7 +49,8 @@ const useControlledDateRangePicker = (props) => {
52
49
  (0, import_useValidateProps.useValidateProps)(props);
53
50
  const instanceUID = (0, import_react.useMemo)(() => (0, import_uid.uid)(6), []);
54
51
  const propsWithDefaults = (0, import_useGetPropsWithDefault.useGetDateRangePickerWithDefaultsProps)(props);
55
- const dataAttrs = (0, import_ds_utilities.getDataProps)(props);
52
+ const xstyledAttrs = (0, import_ds_utilities.useGetXstyledProps)(propsWithDefaults);
53
+ const globalAttrs = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefaults);
56
54
  const { type } = propsWithDefaults;
57
55
  const withInputs = type === import_ControlledDateRangePickerTypes.CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === import_ControlledDateRangePickerTypes.CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;
58
56
  const withIcon = type === import_ControlledDateRangePickerTypes.CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === import_ControlledDateRangePickerTypes.CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;
@@ -60,14 +58,26 @@ const useControlledDateRangePicker = (props) => {
60
58
  const isPickerOnly = type === import_ControlledDateRangePickerTypes.CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;
61
59
  const rangePickerLogic = (0, import_useRangePickerLogic.useRangePickerLogic)(propsWithDefaults);
62
60
  const ctx = (0, import_react.useMemo)(() => ({
63
- props: __spreadProps(__spreadValues({}, propsWithDefaults), { dataAttrs }),
61
+ props: __spreadValues({}, propsWithDefaults),
62
+ xstyledAttrs,
63
+ globalAttrs,
64
64
  instanceUID,
65
65
  rangePickerLogic,
66
66
  withInputs,
67
67
  withIcon,
68
68
  isControllerOnly,
69
69
  isPickerOnly
70
- }), [instanceUID, isControllerOnly, dataAttrs, propsWithDefaults, rangePickerLogic, withIcon, withInputs]);
70
+ }), [
71
+ propsWithDefaults,
72
+ xstyledAttrs,
73
+ globalAttrs,
74
+ instanceUID,
75
+ rangePickerLogic,
76
+ withInputs,
77
+ withIcon,
78
+ isControllerOnly,
79
+ isPickerOnly
80
+ ]);
71
81
  return ctx;
72
82
  };
73
83
  //# sourceMappingURL=useControlledDateRangePicker.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useControlledDateRangePicker.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { getDataProps } from '@elliemae/ds-utilities';\n\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault';\nimport { useValidateProps } from './useValidateProps';\nimport { useRangePickerLogic } from './useRangePickerLogic';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from '../index.d';\n\nexport const useControlledDateRangePicker = (\n props: Partial<DateRangePickerPropsT>,\n): ControlledDateRangePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n const instanceUID = useMemo(() => uid(6), []);\n const propsWithDefaults = useGetDateRangePickerWithDefaultsProps(props);\n const dataAttrs = getDataProps(props);\n const { type } = propsWithDefaults;\n\n const withInputs =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;\n const withIcon =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n const isControllerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.CONTROLLER_ONLY;\n const isPickerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n\n const rangePickerLogic = useRangePickerLogic(propsWithDefaults);\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults, dataAttrs },\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n }),\n [instanceUID, isControllerOnly, dataAttrs, propsWithDefaults, rangePickerLogic, withIcon, withInputs],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAAwB;AACxB,iBAAoB;AACpB,0BAA6B;AAE7B,oCAAuD;AACvD,8BAAiC;AACjC,iCAAoC;AACpC,4CAAmD;AAG5C,MAAM,+BAA+B,CAC1C,UACsC;AAEtC,gDAAiB,KAAK;AACtB,QAAM,cAAc,0BAAQ,MAAM,oBAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAM,oBAAoB,0EAAuC,KAAK;AACtE,QAAM,YAAY,sCAAa,KAAK;AACpC,QAAM,EAAE,SAAS;AAEjB,QAAM,aACJ,SAAS,yEAAmC,QAAQ,SAAS,yEAAmC;AAClG,QAAM,WACJ,SAAS,yEAAmC,QAAQ,SAAS,yEAAmC;AAClG,QAAM,mBAAmB,SAAS,yEAAmC;AACrE,QAAM,eAAe,SAAS,yEAAmC;AAEjE,QAAM,mBAAmB,oDAAoB,iBAAiB;AAE9D,QAAM,MAAM,0BACV,MAAO;AAAA,IACL,OAAO,iCAAK,oBAAL,EAAwB,UAAU;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA,CAAC,aAAa,kBAAkB,WAAW,mBAAmB,kBAAkB,UAAU,UAAU,CACtG;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-utilities';\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault';\nimport { useValidateProps } from './useValidateProps';\nimport { useRangePickerLogic } from './useRangePickerLogic';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from '../index.d';\n\nexport const useControlledDateRangePicker = (\n props: Partial<DateRangePickerPropsT>,\n): ControlledDateRangePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n const instanceUID = useMemo(() => uid(6), []);\n const propsWithDefaults = useGetDateRangePickerWithDefaultsProps(props);\n\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults) as Record<string, unknown>;\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults) as Record<string, unknown>;\n\n const { type } = propsWithDefaults;\n\n const withInputs =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;\n const withIcon =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n const isControllerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.CONTROLLER_ONLY;\n const isPickerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n\n const rangePickerLogic = useRangePickerLogic(propsWithDefaults);\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n }),\n [\n propsWithDefaults,\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n ],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAAwB;AACxB,iBAAoB;AACpB,0BAA2D;AAC3D,oCAAuD;AACvD,8BAAiC;AACjC,iCAAoC;AACpC,4CAAmD;AAG5C,MAAM,+BAA+B,CAC1C,UACsC;AAEtC,gDAAiB,KAAK;AACtB,QAAM,cAAc,0BAAQ,MAAM,oBAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAM,oBAAoB,0EAAuC,KAAK;AAEtE,QAAM,eAAe,4CAAmB,iBAAiB;AAEzD,QAAM,cAAc,gDAAuB,iBAAiB;AAE5D,QAAM,EAAE,SAAS;AAEjB,QAAM,aACJ,SAAS,yEAAmC,QAAQ,SAAS,yEAAmC;AAClG,QAAM,WACJ,SAAS,yEAAmC,QAAQ,SAAS,yEAAmC;AAClG,QAAM,mBAAmB,SAAS,yEAAmC;AACrE,QAAM,eAAe,SAAS,yEAAmC;AAEjE,QAAM,mBAAmB,oDAAoB,iBAAiB;AAE9D,QAAM,MAAM,0BACV,MAAO;AAAA,IACL,OAAO,mBAAK;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CACF;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,32 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var theming_exports = {};
22
+ __export(theming_exports, {
23
+ COMPONENT_NAME: () => COMPONENT_NAME,
24
+ slots: () => slots
25
+ });
26
+ module.exports = __toCommonJS(theming_exports);
27
+ var React = __toESM(require("react"));
28
+ const COMPONENT_NAME = "DS-controlled-date-range-picker";
29
+ const slots = {
30
+ CONTAINER: "root"
31
+ };
32
+ //# sourceMappingURL=theming.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/exported-related/theming.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const COMPONENT_NAME = 'DS-controlled-date-range-picker';\n\nexport const slots = {\n CONTAINER: 'root',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,iBAAiB;AAEvB,MAAM,QAAQ;AAAA,EACnB,WAAW;AACb;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.d.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { DSFormLayoutBlockItemPropsT } from '@elliemae/ds-form-layout-blocks';\nimport type { onDateChangeT, onInternalInputsChangeT, internalInputsChangeMetaInfo } from '../date-time-picker/index.d';\n\nexport interface RangePickerMetaInfoT extends internalInputsChangeMetaInfo {\n rangeDateChangeType?: 'from' | 'to';\n automaticSwitchedDates?: boolean;\n isIncorrectOrder?: boolean;\n}\nexport type rangeOnDateChangeT = (val: string, metaInfo: RangePickerMetaInfoT) => void;\nexport type ControlledDateRangeTypeT =\n | 'full-date-range'\n | 'date-range-picker-controller-only'\n | 'date-range-picker'\n | 'date-range-inputs';\n\nexport interface DateRangePickerPropsT {\n type: ControlledDateRangeTypeT;\n fromDate: string;\n onFromDateChange: rangeOnDateChangeT;\n onMonthFromChange: onInternalInputsChangeT;\n onDayFromChange: onInternalInputsChangeT;\n onYearFromChange: onInternalInputsChangeT;\n hasError: boolean;\n pickerFooterMsg: string;\n\n toDate: string;\n onToDateChange: rangeOnDateChangeT;\n onMonthToChange: onInternalInputsChangeT;\n onDayToChange: onInternalInputsChangeT;\n onYearToChange: onInternalInputsChangeT;\n\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n isClearable?: boolean;\n getIsDisabledDay?: (day: string) => boolean;\n getIsOutOfRangeDay?: (day: string) => boolean;\n autoFocus?: boolean;\n dataAttrs?: Record<string, unknown>;\n}\n\nexport interface RangePickerLogicT {\n latestChangedDate: string;\n\n onCalendarOpen: () => void;\n onCalendarClose: () => void;\n\n handleFromDateChange: rangeOnDateChangeT;\n handleToDateChange: rangeOnDateChangeT;\n\n handlePickerDateChange: rangeOnDateChangeT;\n handlePickerMonthDateChange: onInternalInputsChangeT;\n handlePickerDayDateChange: onInternalInputsChangeT;\n handlePickerYearDateChange: onInternalInputsChangeT;\n\n getIsStartRangeDay: (day: string) => boolean;\n getIsDayInRange: (day: string) => boolean;\n getIsEndRangeDay: (day: string) => boolean;\n}\nexport interface ControlledDateRangePickerContextT {\n props: DateRangePickerPropsT;\n instanceUID: string;\n rangePickerLogic: RangePickerLogicT;\n withInputs: boolean;\n withIcon: boolean;\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n isPickerOnly: boolean;\n}\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import type { DSFormLayoutBlockItemPropsT } from '@elliemae/ds-form-layout-blocks';\nimport type { onDateChangeT, onInternalInputsChangeT, internalInputsChangeMetaInfo } from '../date-time-picker/index.d';\n\nexport interface RangePickerMetaInfoT extends internalInputsChangeMetaInfo {\n rangeDateChangeType?: 'from' | 'to';\n automaticSwitchedDates?: boolean;\n isIncorrectOrder?: boolean;\n}\nexport type rangeOnDateChangeT = (val: string, metaInfo: RangePickerMetaInfoT) => void;\nexport type ControlledDateRangeTypeT =\n | 'full-date-range'\n | 'date-range-picker-controller-only'\n | 'date-range-picker'\n | 'date-range-inputs';\n\nexport interface DateRangePickerPropsT {\n type: ControlledDateRangeTypeT;\n fromDate: string;\n onFromDateChange: rangeOnDateChangeT;\n onMonthFromChange: onInternalInputsChangeT;\n onDayFromChange: onInternalInputsChangeT;\n onYearFromChange: onInternalInputsChangeT;\n hasError: boolean;\n pickerFooterMsg: string;\n\n toDate: string;\n onToDateChange: rangeOnDateChangeT;\n onMonthToChange: onInternalInputsChangeT;\n onDayToChange: onInternalInputsChangeT;\n onYearToChange: onInternalInputsChangeT;\n\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n isClearable?: boolean;\n getIsDisabledDay?: (day: string) => boolean;\n getIsOutOfRangeDay?: (day: string) => boolean;\n autoFocus?: boolean;\n}\n\nexport interface RangePickerLogicT {\n latestChangedDate: string;\n\n onCalendarOpen: () => void;\n onCalendarClose: () => void;\n\n handleFromDateChange: rangeOnDateChangeT;\n handleToDateChange: rangeOnDateChangeT;\n\n handlePickerDateChange: rangeOnDateChangeT;\n handlePickerMonthDateChange: onInternalInputsChangeT;\n handlePickerDayDateChange: onInternalInputsChangeT;\n handlePickerYearDateChange: onInternalInputsChangeT;\n\n getIsStartRangeDay: (day: string) => boolean;\n getIsDayInRange: (day: string) => boolean;\n getIsEndRangeDay: (day: string) => boolean;\n}\nexport interface ControlledDateRangePickerContextT {\n props: DateRangePickerPropsT;\n instanceUID: string;\n rangePickerLogic: RangePickerLogicT;\n withInputs: boolean;\n withIcon: boolean;\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n isPickerOnly: boolean;\n xstyledAttrs: Record<string, unknown>;\n globalAttrs: Record<string, unknown>;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -27,6 +27,7 @@ __export(src_exports, {
27
27
  module.exports = __toCommonJS(src_exports);
28
28
  var React = __toESM(require("react"));
29
29
  __reExport(src_exports, require("./ControlledDateRangePicker"), module.exports);
30
+ __reExport(src_exports, require("./exported-related/theming"), module.exports);
30
31
  var import_ControlledDateRangePickerDatatestid = require("./ControlledDateRangePickerDatatestid");
31
32
  var import_ControlledDateRangePickerTypes = require("./ControlledDateRangePickerTypes");
32
33
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './ControlledDateRangePicker';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,wCAAd;AACA,iDAAoD;AACpD,4CAAmD;",
4
+ "sourcesContent": ["export * from './ControlledDateRangePicker';\nexport * from './exported-related/theming';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,wCAAd;AACA,wBAAc,uCADd;AAEA,iDAAoD;AACpD,4CAAmD;",
6
6
  "names": []
7
7
  }
@@ -39,14 +39,15 @@ __export(ControlledDateRangeContent_exports, {
39
39
  module.exports = __toCommonJS(ControlledDateRangeContent_exports);
40
40
  var React = __toESM(require("react"));
41
41
  var import_react = __toESM(require("react"));
42
- var import_styled_components = __toESM(require("styled-components"));
42
+ var import_ds_system = require("@elliemae/ds-system");
43
43
  var import_ControlledDateRangePickerCTX = require("../ControlledDateRangePickerCTX");
44
44
  var import_ControlledDateRangeFromDate = require("./ControlledDateRangeFromDate");
45
45
  var import_ControlledDateRangeToDate = require("./ControlledDateRangeToDate");
46
46
  var import_ControlledDateRangeCalendar = require("./ControlledDateRangeCalendar");
47
47
  var import_ControlledDateRangePickerDatatestid = require("../ControlledDateRangePickerDatatestid");
48
48
  var import_utils = require("../utils/utils");
49
- const StyledWrapper = import_styled_components.default.div`
49
+ var import_theming = require("../exported-related/theming");
50
+ const StyledWrapper = (0, import_ds_system.styled)("div", { name: import_theming.COMPONENT_NAME, slot: import_theming.slots.CONTAINER })`
50
51
  display: grid;
51
52
  grid-template-columns: ${({ type }) => import_utils.gridMap[type]};
52
53
  grid-template-rows: auto;
@@ -55,20 +56,25 @@ const StyledWrapper = import_styled_components.default.div`
55
56
  grid-template-areas: '. .';
56
57
  justify-content: center;
57
58
  align-items: center;
59
+ ${import_ds_system.sizing}
60
+ ${import_ds_system.space}
61
+ ${import_ds_system.layout}
58
62
  `;
59
63
  const ControlledDateRangeContent = () => {
60
64
  const {
61
- props: { dataAttrs, type },
65
+ props: { type },
62
66
  withIcon,
63
67
  withInputs,
64
68
  isControllerOnly,
65
- isPickerOnly
69
+ isPickerOnly,
70
+ xstyledAttrs,
71
+ globalAttrs
66
72
  } = (0, import_react.useContext)(import_ControlledDateRangePickerCTX.ControlledDateRangePickerContext);
67
- return /* @__PURE__ */ import_react.default.createElement(StyledWrapper, __spreadValues({
73
+ return /* @__PURE__ */ import_react.default.createElement(StyledWrapper, __spreadValues(__spreadValues({
68
74
  isControllerOnly,
69
75
  isPickerOnly,
70
76
  "data-testid": import_ControlledDateRangePickerDatatestid.ControlledDateRangePickerDatatestid.WRAPPER,
71
77
  type
72
- }, dataAttrs), withInputs ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_ControlledDateRangeFromDate.ControlledDateRangeFromDate, null), /* @__PURE__ */ import_react.default.createElement(import_ControlledDateRangeToDate.ControlledDateRangeToDate, null)) : null, withIcon || isControllerOnly ? /* @__PURE__ */ import_react.default.createElement(import_ControlledDateRangeCalendar.ControlledDateRangeCalendar, null) : null);
78
+ }, globalAttrs), xstyledAttrs), withInputs ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_ControlledDateRangeFromDate.ControlledDateRangeFromDate, null), /* @__PURE__ */ import_react.default.createElement(import_ControlledDateRangeToDate.ControlledDateRangeToDate, null)) : null, withIcon || isControllerOnly ? /* @__PURE__ */ import_react.default.createElement(import_ControlledDateRangeCalendar.ControlledDateRangeCalendar, null) : null);
73
79
  };
74
80
  //# sourceMappingURL=ControlledDateRangeContent.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/ControlledDateRangeContent.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useContext } from 'react';\nimport styled from 'styled-components';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid';\nimport { gridMap } from '../utils/utils';\nimport type { ControlledDateRangeTypeT } from '../index.d';\n\ninterface StyledWrapperT {\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n type: ControlledDateRangeTypeT;\n}\n\nconst StyledWrapper = styled.div<StyledWrapperT>`\n display: grid;\n grid-template-columns: ${({ type }) => gridMap[type]};\n grid-template-rows: auto;\n ${({ isControllerOnly, isPickerOnly }) => (isControllerOnly || isPickerOnly ? '' : 'gap: 0px 8px;')}\n grid-auto-flow: row;\n grid-template-areas: '. .';\n justify-content: center;\n align-items: center;\n`;\n\nexport const ControlledDateRangeContent = (): JSX.Element => {\n const {\n props: { dataAttrs, type },\n withIcon,\n withInputs,\n isControllerOnly,\n isPickerOnly,\n } = useContext(ControlledDateRangePickerContext);\n\n return (\n <StyledWrapper\n isControllerOnly={isControllerOnly}\n isPickerOnly={isPickerOnly}\n data-testid={ControlledDateRangePickerDatatestid.WRAPPER}\n type={type}\n {...dataAttrs}\n >\n {withInputs ? (\n <>\n <ControlledDateRangeFromDate />\n <ControlledDateRangeToDate />\n </>\n ) : null}\n {withIcon || isControllerOnly ? <ControlledDateRangeCalendar /> : null}\n </StyledWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAClC,+BAAmB;AACnB,0CAAiD;AACjD,yCAA4C;AAC5C,uCAA0C;AAC1C,yCAA4C;AAC5C,iDAAoD;AACpD,mBAAwB;AASxB,MAAM,gBAAgB,iCAAO;AAAA;AAAA,2BAEF,CAAC,EAAE,WAAW,qBAAQ;AAAA;AAAA,IAE7C,CAAC,EAAE,kBAAkB,mBAAoB,oBAAoB,eAAe,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9E,MAAM,6BAA6B,MAAmB;AAC3D,QAAM;AAAA,IACJ,OAAO,EAAE,WAAW;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,6BAAW,oEAAgC;AAE/C,SACE,mDAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA,eAAa,+EAAoC;AAAA,IACjD;AAAA,KACI,YAEH,aACC,wFACE,mDAAC,oEAA4B,GAC7B,mDAAC,gEAA0B,CAC7B,IACE,MACH,YAAY,mBAAmB,mDAAC,oEAA4B,IAAK,IACpE;AAEJ;",
4
+ "sourcesContent": ["import React, { useContext } from 'react';\nimport { styled, sizing, space, layout } from '@elliemae/ds-system';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid';\nimport { gridMap } from '../utils/utils';\nimport type { ControlledDateRangeTypeT } from '../index.d';\nimport { COMPONENT_NAME, slots } from '../exported-related/theming';\n\ninterface StyledWrapperT {\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n type: ControlledDateRangeTypeT;\n}\n\nconst StyledWrapper = styled('div', { name: COMPONENT_NAME, slot: slots.CONTAINER })<StyledWrapperT>`\n display: grid;\n grid-template-columns: ${({ type }) => gridMap[type]};\n grid-template-rows: auto;\n ${({ isControllerOnly, isPickerOnly }) => (isControllerOnly || isPickerOnly ? '' : 'gap: 0px 8px;')}\n grid-auto-flow: row;\n grid-template-areas: '. .';\n justify-content: center;\n align-items: center;\n ${sizing}\n ${space}\n ${layout}\n`;\n\nexport const ControlledDateRangeContent = (): JSX.Element => {\n const {\n props: { type },\n withIcon,\n withInputs,\n isControllerOnly,\n isPickerOnly,\n xstyledAttrs,\n globalAttrs,\n } = useContext(ControlledDateRangePickerContext);\n\n return (\n <StyledWrapper\n isControllerOnly={isControllerOnly}\n isPickerOnly={isPickerOnly}\n data-testid={ControlledDateRangePickerDatatestid.WRAPPER}\n type={type}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {withInputs ? (\n <>\n <ControlledDateRangeFromDate />\n <ControlledDateRangeToDate />\n </>\n ) : null}\n {withIcon || isControllerOnly ? <ControlledDateRangeCalendar /> : null}\n </StyledWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAClC,uBAA8C;AAC9C,0CAAiD;AACjD,yCAA4C;AAC5C,uCAA0C;AAC1C,yCAA4C;AAC5C,iDAAoD;AACpD,mBAAwB;AAExB,qBAAsC;AAQtC,MAAM,gBAAgB,6BAAO,OAAO,EAAE,MAAM,+BAAgB,MAAM,qBAAM,UAAU,CAAC;AAAA;AAAA,2BAExD,CAAC,EAAE,WAAW,qBAAQ;AAAA;AAAA,IAE7C,CAAC,EAAE,kBAAkB,mBAAoB,oBAAoB,eAAe,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjF;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,6BAA6B,MAAmB;AAC3D,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,6BAAW,oEAAgC;AAE/C,SACE,mDAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA,eAAa,+EAAoC;AAAA,IACjD;AAAA,KACI,cACA,eAEH,aACC,wFACE,mDAAC,oEAA4B,GAC7B,mDAAC,gEAA0B,CAC7B,IACE,MACH,YAAY,mBAAmB,mDAAC,oEAA4B,IAAK,IACpE;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,26 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
8
  var __getProtoOf = Object.getPrototypeOf;
6
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7
24
  var __export = (target, all) => {
8
25
  for (var name in all)
9
26
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -24,13 +41,13 @@ __export(propTypes_exports, {
24
41
  });
25
42
  module.exports = __toCommonJS(propTypes_exports);
26
43
  var React = __toESM(require("react"));
27
- var import_react_desc = require("react-desc");
28
- const propTypes = {
29
- type: import_react_desc.PropTypes.oneOf([
44
+ var import_ds_utilities = require("@elliemae/ds-utilities");
45
+ const propTypes = __spreadProps(__spreadValues(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), import_ds_utilities.xstyledPropTypes), {
46
+ type: import_ds_utilities.PropTypes.oneOf([
30
47
  "full-date-range",
31
48
  "date-range-picker-controller-only",
32
49
  "date-range-picker",
33
50
  "date-range-inputs"
34
51
  ]).description("Type of date range form control to use")
35
- };
52
+ });
36
53
  //# sourceMappingURL=propTypes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ]).description('Type of date range form control to use'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,YAAY;AAAA,EACvB,MAAM,4BAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EAAE,YAAY,wCAAwC;AACzD;",
4
+ "sourcesContent": ["import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ]).description('Type of date range form control to use'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAAuE;AAEhE,MAAM,YAAY,gDACpB,gDACA,uCAFoB;AAAA,EAGvB,MAAM,8BAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EAAE,YAAY,wCAAwC;AACzD;",
6
6
  "names": []
7
7
  }
@@ -11,7 +11,6 @@ const DSControlledDateRangePicker = (props) => {
11
11
  value: ctx
12
12
  }, /* @__PURE__ */ React2.createElement(ControlledDateRangeContent, null));
13
13
  };
14
- DSControlledDateRangePicker.propTypes = propTypes;
15
14
  DSControlledDateRangePicker.displayName = "DSControlledDateRangePicker";
16
15
  const DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);
17
16
  DSControlledDateRangePickerWithSchema.propTypes = propTypes;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ControlledDateRangePicker.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent';\nimport { propTypes } from './propTypes';\nimport { ControlledDateRangePickerContext } from './ControlledDateRangePickerCTX';\nimport type { DateRangePickerPropsT } from './index.d';\n\nconst DSControlledDateRangePicker = (props: DateRangePickerPropsT): JSX.Element => {\n const ctx = useControlledDateRangePicker(props);\n return (\n <ControlledDateRangePickerContext.Provider value={ctx}>\n <ControlledDateRangeContent />\n </ControlledDateRangePickerContext.Provider>\n );\n};\nDSControlledDateRangePicker.propTypes = propTypes;\nDSControlledDateRangePicker.displayName = 'DSControlledDateRangePicker';\nconst DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);\nDSControlledDateRangePickerWithSchema.propTypes = propTypes;\n\nexport { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker };\n"],
5
- "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,8BAA8B,CAAC,UAA8C;AACjF,QAAM,MAAM,6BAA6B,KAAK;AAC9C,SACE,qCAAC,iCAAiC,UAAjC;AAAA,IAA0C,OAAO;AAAA,KAChD,qCAAC,gCAA2B,CAC9B;AAEJ;AACA,4BAA4B,YAAY;AACxC,4BAA4B,cAAc;AAC1C,MAAM,wCAAwC,SAAS,2BAA2B;AAClF,sCAAsC,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent';\nimport { propTypes } from './propTypes';\nimport { ControlledDateRangePickerContext } from './ControlledDateRangePickerCTX';\nimport type { DateRangePickerPropsT } from './index.d';\n\nconst DSControlledDateRangePicker = (props: DateRangePickerPropsT): JSX.Element => {\n const ctx = useControlledDateRangePicker(props);\n return (\n <ControlledDateRangePickerContext.Provider value={ctx}>\n <ControlledDateRangeContent />\n </ControlledDateRangePickerContext.Provider>\n );\n};\n\nDSControlledDateRangePicker.displayName = 'DSControlledDateRangePicker';\nconst DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);\nDSControlledDateRangePickerWithSchema.propTypes = propTypes;\n\nexport { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker };\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,8BAA8B,CAAC,UAA8C;AACjF,QAAM,MAAM,6BAA6B,KAAK;AAC9C,SACE,qCAAC,iCAAiC,UAAjC;AAAA,IAA0C,OAAO;AAAA,KAChD,qCAAC,gCAA2B,CAC9B;AAEJ;AAEA,4BAA4B,cAAc;AAC1C,MAAM,wCAAwC,SAAS,2BAA2B;AAClF,sCAAsC,YAAY;",
6
6
  "names": []
7
7
  }
@@ -44,7 +44,9 @@ const defaultContext = {
44
44
  withInputs: false,
45
45
  withIcon: false,
46
46
  isControllerOnly: false,
47
- isPickerOnly: false
47
+ isPickerOnly: false,
48
+ xstyledAttrs: {},
49
+ globalAttrs: {}
48
50
  };
49
51
  const ControlledDateRangePickerContext = createContext(defaultContext);
50
52
  var ControlledDateRangePickerCTX_default = ControlledDateRangePickerContext;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ControlledDateRangePickerCTX.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from './index.d';\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\nexport const defaultProps: DateRangePickerPropsT = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n hasError: false,\n pickerFooterMsg: '',\n\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n\n emptyPickerStartingMonth: undefined,\n onCalendarOpenFocusedDay: undefined,\n isClearable: false,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n autoFocus: false,\n};\nconst defaultContext = {\n props: defaultProps,\n rangePickerLogic: {\n latestChangedDate: '',\n onCalendarOpen: noop,\n onCalendarClose: noop,\n handleFromDateChange: noop,\n handleToDateChange: noop,\n handlePickerDateChange: noop,\n handlePickerMonthDateChange: noop,\n handlePickerDayDateChange: noop,\n handlePickerYearDateChange: noop,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n },\n instanceUID: '',\n withInputs: false,\n withIcon: false,\n isControllerOnly: false,\n isPickerOnly: false,\n};\n/** Context for cross component communication */\nexport const ControlledDateRangePickerContext = createContext<ControlledDateRangePickerContextT>(defaultContext);\n\nexport default ControlledDateRangePickerContext;\n"],
5
- "mappings": "AAAA;ACAA;AAGA,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AACnC,MAAM,eAAsC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,iBAAiB;AAAA,EAEjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAEhB,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,WAAW;AACb;AACA,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,kBAAkB;AAAA,IAChB,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IACxB,6BAA6B;AAAA,IAC7B,2BAA2B;AAAA,IAC3B,4BAA4B;AAAA,IAC5B,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,EACpB;AAAA,EACA,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,cAAc;AAChB;AAEO,MAAM,mCAAmC,cAAiD,cAAc;AAE/G,IAAO,uCAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from './index.d';\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\n\nexport const defaultProps: DateRangePickerPropsT = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n hasError: false,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n emptyPickerStartingMonth: undefined,\n onCalendarOpenFocusedDay: undefined,\n isClearable: false,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n autoFocus: false,\n};\n\nconst defaultContext = {\n props: defaultProps,\n rangePickerLogic: {\n latestChangedDate: '',\n onCalendarOpen: noop,\n onCalendarClose: noop,\n handleFromDateChange: noop,\n handleToDateChange: noop,\n handlePickerDateChange: noop,\n handlePickerMonthDateChange: noop,\n handlePickerDayDateChange: noop,\n handlePickerYearDateChange: noop,\n getIsStartRangeDay: defaultReturnFalse,\n getIsDayInRange: defaultReturnFalse,\n getIsEndRangeDay: defaultReturnFalse,\n },\n instanceUID: '',\n withInputs: false,\n withIcon: false,\n isControllerOnly: false,\n isPickerOnly: false,\n xstyledAttrs: {},\n globalAttrs: {},\n};\n/** Context for cross component communication */\nexport const ControlledDateRangePickerContext = createContext<ControlledDateRangePickerContextT>(defaultContext);\n\nexport default ControlledDateRangePickerContext;\n"],
5
+ "mappings": "AAAA;ACAA;AAGA,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AAEnC,MAAM,eAAsC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,WAAW;AACb;AAEA,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,kBAAkB;AAAA,IAChB,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,IACxB,6BAA6B;AAAA,IAC7B,2BAA2B;AAAA,IAC3B,4BAA4B;AAAA,IAC5B,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,EACpB;AAAA,EACA,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,cAAc,CAAC;AAAA,EACf,aAAa,CAAC;AAChB;AAEO,MAAM,mCAAmC,cAAiD,cAAc;AAE/G,IAAO,uCAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,4 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -16,11 +14,10 @@ var __spreadValues = (a, b) => {
16
14
  }
17
15
  return a;
18
16
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
17
  import * as React from "react";
21
18
  import { useMemo } from "react";
22
19
  import { uid } from "uid";
23
- import { getDataProps } from "@elliemae/ds-utilities";
20
+ import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-utilities";
24
21
  import { useGetDateRangePickerWithDefaultsProps } from "./useGetPropsWithDefault";
25
22
  import { useValidateProps } from "./useValidateProps";
26
23
  import { useRangePickerLogic } from "./useRangePickerLogic";
@@ -29,7 +26,8 @@ const useControlledDateRangePicker = (props) => {
29
26
  useValidateProps(props);
30
27
  const instanceUID = useMemo(() => uid(6), []);
31
28
  const propsWithDefaults = useGetDateRangePickerWithDefaultsProps(props);
32
- const dataAttrs = getDataProps(props);
29
+ const xstyledAttrs = useGetXstyledProps(propsWithDefaults);
30
+ const globalAttrs = useGetGlobalAttributes(propsWithDefaults);
33
31
  const { type } = propsWithDefaults;
34
32
  const withInputs = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;
35
33
  const withIcon = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;
@@ -37,14 +35,26 @@ const useControlledDateRangePicker = (props) => {
37
35
  const isPickerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;
38
36
  const rangePickerLogic = useRangePickerLogic(propsWithDefaults);
39
37
  const ctx = useMemo(() => ({
40
- props: __spreadProps(__spreadValues({}, propsWithDefaults), { dataAttrs }),
38
+ props: __spreadValues({}, propsWithDefaults),
39
+ xstyledAttrs,
40
+ globalAttrs,
41
41
  instanceUID,
42
42
  rangePickerLogic,
43
43
  withInputs,
44
44
  withIcon,
45
45
  isControllerOnly,
46
46
  isPickerOnly
47
- }), [instanceUID, isControllerOnly, dataAttrs, propsWithDefaults, rangePickerLogic, withIcon, withInputs]);
47
+ }), [
48
+ propsWithDefaults,
49
+ xstyledAttrs,
50
+ globalAttrs,
51
+ instanceUID,
52
+ rangePickerLogic,
53
+ withInputs,
54
+ withIcon,
55
+ isControllerOnly,
56
+ isPickerOnly
57
+ ]);
48
58
  return ctx;
49
59
  };
50
60
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useControlledDateRangePicker.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { getDataProps } from '@elliemae/ds-utilities';\n\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault';\nimport { useValidateProps } from './useValidateProps';\nimport { useRangePickerLogic } from './useRangePickerLogic';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from '../index.d';\n\nexport const useControlledDateRangePicker = (\n props: Partial<DateRangePickerPropsT>,\n): ControlledDateRangePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n const instanceUID = useMemo(() => uid(6), []);\n const propsWithDefaults = useGetDateRangePickerWithDefaultsProps(props);\n const dataAttrs = getDataProps(props);\n const { type } = propsWithDefaults;\n\n const withInputs =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;\n const withIcon =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n const isControllerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.CONTROLLER_ONLY;\n const isPickerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n\n const rangePickerLogic = useRangePickerLogic(propsWithDefaults);\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults, dataAttrs },\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n }),\n [instanceUID, isControllerOnly, dataAttrs, propsWithDefaults, rangePickerLogic, withIcon, withInputs],\n );\n\n return ctx;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACIA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGO,MAAM,+BAA+B,CAC1C,UACsC;AAEtC,mBAAiB,KAAK;AACtB,QAAM,cAAc,QAAQ,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAM,oBAAoB,uCAAuC,KAAK;AACtE,QAAM,YAAY,aAAa,KAAK;AACpC,QAAM,EAAE,SAAS;AAEjB,QAAM,aACJ,SAAS,mCAAmC,QAAQ,SAAS,mCAAmC;AAClG,QAAM,WACJ,SAAS,mCAAmC,QAAQ,SAAS,mCAAmC;AAClG,QAAM,mBAAmB,SAAS,mCAAmC;AACrE,QAAM,eAAe,SAAS,mCAAmC;AAEjE,QAAM,mBAAmB,oBAAoB,iBAAiB;AAE9D,QAAM,MAAM,QACV,MAAO;AAAA,IACL,OAAO,iCAAK,oBAAL,EAAwB,UAAU;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA,CAAC,aAAa,kBAAkB,WAAW,mBAAmB,kBAAkB,UAAU,UAAU,CACtG;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-utilities';\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault';\nimport { useValidateProps } from './useValidateProps';\nimport { useRangePickerLogic } from './useRangePickerLogic';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes';\nimport type { DateRangePickerPropsT, ControlledDateRangePickerContextT } from '../index.d';\n\nexport const useControlledDateRangePicker = (\n props: Partial<DateRangePickerPropsT>,\n): ControlledDateRangePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n const instanceUID = useMemo(() => uid(6), []);\n const propsWithDefaults = useGetDateRangePickerWithDefaultsProps(props);\n\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults) as Record<string, unknown>;\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults) as Record<string, unknown>;\n\n const { type } = propsWithDefaults;\n\n const withInputs =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;\n const withIcon =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n const isControllerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.CONTROLLER_ONLY;\n const isPickerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n\n const rangePickerLogic = useRangePickerLogic(propsWithDefaults);\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n }),\n [\n propsWithDefaults,\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n ],\n );\n\n return ctx;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;ACIA;AACA;AACA;AACA;AACA;AACA;AACA;AAGO,MAAM,+BAA+B,CAC1C,UACsC;AAEtC,mBAAiB,KAAK;AACtB,QAAM,cAAc,QAAQ,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAM,oBAAoB,uCAAuC,KAAK;AAEtE,QAAM,eAAe,mBAAmB,iBAAiB;AAEzD,QAAM,cAAc,uBAAuB,iBAAiB;AAE5D,QAAM,EAAE,SAAS;AAEjB,QAAM,aACJ,SAAS,mCAAmC,QAAQ,SAAS,mCAAmC;AAClG,QAAM,WACJ,SAAS,mCAAmC,QAAQ,SAAS,mCAAmC;AAClG,QAAM,mBAAmB,SAAS,mCAAmC;AACrE,QAAM,eAAe,SAAS,mCAAmC;AAEjE,QAAM,mBAAmB,oBAAoB,iBAAiB;AAE9D,QAAM,MAAM,QACV,MAAO;AAAA,IACL,OAAO,mBAAK;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CACF;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ const COMPONENT_NAME = "DS-controlled-date-range-picker";
3
+ const slots = {
4
+ CONTAINER: "root"
5
+ };
6
+ export {
7
+ COMPONENT_NAME,
8
+ slots
9
+ };
10
+ //# sourceMappingURL=theming.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/theming.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const COMPONENT_NAME = 'DS-controlled-date-range-picker';\n\nexport const slots = {\n CONTAINER: 'root',\n};\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,iBAAiB;AAEvB,MAAM,QAAQ;AAAA,EACnB,WAAW;AACb;",
6
+ "names": []
7
+ }
package/dist/esm/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  export * from "./ControlledDateRangePicker";
3
+ export * from "./exported-related/theming";
3
4
  import { ControlledDateRangePickerDatatestid } from "./ControlledDateRangePickerDatatestid";
4
5
  import { CONTROLLED_DATE_RANGE_PICKER_TYPES } from "./ControlledDateRangePickerTypes";
5
6
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './ControlledDateRangePicker';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes';\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './ControlledDateRangePicker';\nexport * from './exported-related/theming';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -16,14 +16,15 @@ var __spreadValues = (a, b) => {
16
16
  };
17
17
  import * as React from "react";
18
18
  import React2, { useContext } from "react";
19
- import styled from "styled-components";
19
+ import { styled, sizing, space, layout } from "@elliemae/ds-system";
20
20
  import { ControlledDateRangePickerContext } from "../ControlledDateRangePickerCTX";
21
21
  import { ControlledDateRangeFromDate } from "./ControlledDateRangeFromDate";
22
22
  import { ControlledDateRangeToDate } from "./ControlledDateRangeToDate";
23
23
  import { ControlledDateRangeCalendar } from "./ControlledDateRangeCalendar";
24
24
  import { ControlledDateRangePickerDatatestid } from "../ControlledDateRangePickerDatatestid";
25
25
  import { gridMap } from "../utils/utils";
26
- const StyledWrapper = styled.div`
26
+ import { COMPONENT_NAME, slots } from "../exported-related/theming";
27
+ const StyledWrapper = styled("div", { name: COMPONENT_NAME, slot: slots.CONTAINER })`
27
28
  display: grid;
28
29
  grid-template-columns: ${({ type }) => gridMap[type]};
29
30
  grid-template-rows: auto;
@@ -32,21 +33,26 @@ const StyledWrapper = styled.div`
32
33
  grid-template-areas: '. .';
33
34
  justify-content: center;
34
35
  align-items: center;
36
+ ${sizing}
37
+ ${space}
38
+ ${layout}
35
39
  `;
36
40
  const ControlledDateRangeContent = () => {
37
41
  const {
38
- props: { dataAttrs, type },
42
+ props: { type },
39
43
  withIcon,
40
44
  withInputs,
41
45
  isControllerOnly,
42
- isPickerOnly
46
+ isPickerOnly,
47
+ xstyledAttrs,
48
+ globalAttrs
43
49
  } = useContext(ControlledDateRangePickerContext);
44
- return /* @__PURE__ */ React2.createElement(StyledWrapper, __spreadValues({
50
+ return /* @__PURE__ */ React2.createElement(StyledWrapper, __spreadValues(__spreadValues({
45
51
  isControllerOnly,
46
52
  isPickerOnly,
47
53
  "data-testid": ControlledDateRangePickerDatatestid.WRAPPER,
48
54
  type
49
- }, dataAttrs), withInputs ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(ControlledDateRangeFromDate, null), /* @__PURE__ */ React2.createElement(ControlledDateRangeToDate, null)) : null, withIcon || isControllerOnly ? /* @__PURE__ */ React2.createElement(ControlledDateRangeCalendar, null) : null);
55
+ }, globalAttrs), xstyledAttrs), withInputs ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(ControlledDateRangeFromDate, null), /* @__PURE__ */ React2.createElement(ControlledDateRangeToDate, null)) : null, withIcon || isControllerOnly ? /* @__PURE__ */ React2.createElement(ControlledDateRangeCalendar, null) : null);
50
56
  };
51
57
  export {
52
58
  ControlledDateRangeContent
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ControlledDateRangeContent.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport styled from 'styled-components';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid';\nimport { gridMap } from '../utils/utils';\nimport type { ControlledDateRangeTypeT } from '../index.d';\n\ninterface StyledWrapperT {\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n type: ControlledDateRangeTypeT;\n}\n\nconst StyledWrapper = styled.div<StyledWrapperT>`\n display: grid;\n grid-template-columns: ${({ type }) => gridMap[type]};\n grid-template-rows: auto;\n ${({ isControllerOnly, isPickerOnly }) => (isControllerOnly || isPickerOnly ? '' : 'gap: 0px 8px;')}\n grid-auto-flow: row;\n grid-template-areas: '. .';\n justify-content: center;\n align-items: center;\n`;\n\nexport const ControlledDateRangeContent = (): JSX.Element => {\n const {\n props: { dataAttrs, type },\n withIcon,\n withInputs,\n isControllerOnly,\n isPickerOnly,\n } = useContext(ControlledDateRangePickerContext);\n\n return (\n <StyledWrapper\n isControllerOnly={isControllerOnly}\n isPickerOnly={isPickerOnly}\n data-testid={ControlledDateRangePickerDatatestid.WRAPPER}\n type={type}\n {...dataAttrs}\n >\n {withInputs ? (\n <>\n <ControlledDateRangeFromDate />\n <ControlledDateRangeToDate />\n </>\n ) : null}\n {withIcon || isControllerOnly ? <ControlledDateRangeCalendar /> : null}\n </StyledWrapper>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA,MAAM,gBAAgB,OAAO;AAAA;AAAA,2BAEF,CAAC,EAAE,WAAW,QAAQ;AAAA;AAAA,IAE7C,CAAC,EAAE,kBAAkB,mBAAoB,oBAAoB,eAAe,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAO9E,MAAM,6BAA6B,MAAmB;AAC3D,QAAM;AAAA,IACJ,OAAO,EAAE,WAAW;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,WAAW,gCAAgC;AAE/C,SACE,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA,eAAa,oCAAoC;AAAA,IACjD;AAAA,KACI,YAEH,aACC,4DACE,qCAAC,iCAA4B,GAC7B,qCAAC,+BAA0B,CAC7B,IACE,MACH,YAAY,mBAAmB,qCAAC,iCAA4B,IAAK,IACpE;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { styled, sizing, space, layout } from '@elliemae/ds-system';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid';\nimport { gridMap } from '../utils/utils';\nimport type { ControlledDateRangeTypeT } from '../index.d';\nimport { COMPONENT_NAME, slots } from '../exported-related/theming';\n\ninterface StyledWrapperT {\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n type: ControlledDateRangeTypeT;\n}\n\nconst StyledWrapper = styled('div', { name: COMPONENT_NAME, slot: slots.CONTAINER })<StyledWrapperT>`\n display: grid;\n grid-template-columns: ${({ type }) => gridMap[type]};\n grid-template-rows: auto;\n ${({ isControllerOnly, isPickerOnly }) => (isControllerOnly || isPickerOnly ? '' : 'gap: 0px 8px;')}\n grid-auto-flow: row;\n grid-template-areas: '. .';\n justify-content: center;\n align-items: center;\n ${sizing}\n ${space}\n ${layout}\n`;\n\nexport const ControlledDateRangeContent = (): JSX.Element => {\n const {\n props: { type },\n withIcon,\n withInputs,\n isControllerOnly,\n isPickerOnly,\n xstyledAttrs,\n globalAttrs,\n } = useContext(ControlledDateRangePickerContext);\n\n return (\n <StyledWrapper\n isControllerOnly={isControllerOnly}\n isPickerOnly={isPickerOnly}\n data-testid={ControlledDateRangePickerDatatestid.WRAPPER}\n type={type}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {withInputs ? (\n <>\n <ControlledDateRangeFromDate />\n <ControlledDateRangeToDate />\n </>\n ) : null}\n {withIcon || isControllerOnly ? <ControlledDateRangeCalendar /> : null}\n </StyledWrapper>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA,MAAM,gBAAgB,OAAO,OAAO,EAAE,MAAM,gBAAgB,MAAM,MAAM,UAAU,CAAC;AAAA;AAAA,2BAExD,CAAC,EAAE,WAAW,QAAQ;AAAA;AAAA,IAE7C,CAAC,EAAE,kBAAkB,mBAAoB,oBAAoB,eAAe,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjF;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,6BAA6B,MAAmB;AAC3D,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,WAAW,gCAAgC;AAE/C,SACE,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA,eAAa,oCAAoC;AAAA,IACjD;AAAA,KACI,cACA,eAEH,aACC,4DACE,qCAAC,iCAA4B,GAC7B,qCAAC,+BAA0B,CAC7B,IACE,MACH,YAAY,mBAAmB,qCAAC,iCAA4B,IAAK,IACpE;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,13 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1
20
  import * as React from "react";
2
- import { PropTypes } from "react-desc";
3
- const propTypes = {
21
+ import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-utilities";
22
+ const propTypes = __spreadProps(__spreadValues(__spreadValues({}, globalAttributesPropTypes), xstyledPropTypes), {
4
23
  type: PropTypes.oneOf([
5
24
  "full-date-range",
6
25
  "date-range-picker-controller-only",
7
26
  "date-range-picker",
8
27
  "date-range-inputs"
9
28
  ]).description("Type of date range form control to use")
10
- };
29
+ });
11
30
  export {
12
31
  propTypes
13
32
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ]).description('Type of date range form control to use'),\n};\n"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EAAE,YAAY,wCAAwC;AACzD;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ]).description('Type of date range form control to use'),\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AAEO,MAAM,YAAY,gDACpB,4BACA,mBAFoB;AAAA,EAGvB,MAAM,UAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EAAE,YAAY,wCAAwC;AACzD;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-form-date-range-picker",
3
- "version": "3.0.0-next.69",
3
+ "version": "3.0.0-next.72",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Controlled Form Date Range Picker",
6
6
  "files": [