@atlaskit/datetime-picker 16.2.3 → 17.0.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/components/date-picker-class.compiled.css +16 -0
  3. package/dist/cjs/components/date-picker-class.js +122 -146
  4. package/dist/cjs/components/date-picker-fc.compiled.css +16 -0
  5. package/dist/cjs/components/date-picker-fc.js +117 -144
  6. package/dist/cjs/components/date-time-picker-class.compiled.css +19 -0
  7. package/dist/cjs/components/date-time-picker-class.js +22 -47
  8. package/dist/cjs/components/date-time-picker-fc.compiled.css +6 -0
  9. package/dist/cjs/components/date-time-picker-fc.js +22 -27
  10. package/dist/cjs/components/time-picker.js +1 -1
  11. package/dist/cjs/internal/date-time-picker-container.compiled.css +21 -0
  12. package/dist/cjs/internal/date-time-picker-container.js +26 -71
  13. package/dist/cjs/internal/ff-component.js +0 -2
  14. package/dist/cjs/internal/fixed-layer-menu.js +8 -8
  15. package/dist/cjs/internal/fixed-layer.compiled.css +4 -0
  16. package/dist/cjs/internal/fixed-layer.js +14 -13
  17. package/dist/cjs/internal/indicators-container.compiled.css +2 -0
  18. package/dist/cjs/internal/indicators-container.js +14 -15
  19. package/dist/cjs/internal/menu.compiled.css +6 -0
  20. package/dist/cjs/internal/menu.js +15 -32
  21. package/dist/es2019/components/date-picker-class.compiled.css +16 -0
  22. package/dist/es2019/components/date-picker-class.js +117 -143
  23. package/dist/es2019/components/date-picker-fc.compiled.css +16 -0
  24. package/dist/es2019/components/date-picker-fc.js +114 -141
  25. package/dist/es2019/components/date-time-picker-class.compiled.css +19 -0
  26. package/dist/es2019/components/date-time-picker-class.js +21 -49
  27. package/dist/es2019/components/date-time-picker-fc.compiled.css +6 -0
  28. package/dist/es2019/components/date-time-picker-fc.js +19 -24
  29. package/dist/es2019/components/time-picker.js +1 -1
  30. package/dist/es2019/internal/date-time-picker-container.compiled.css +21 -0
  31. package/dist/es2019/internal/date-time-picker-container.js +18 -69
  32. package/dist/es2019/internal/ff-component.js +0 -2
  33. package/dist/es2019/internal/fixed-layer-menu.js +5 -8
  34. package/dist/es2019/internal/fixed-layer.compiled.css +4 -0
  35. package/dist/es2019/internal/fixed-layer.js +13 -12
  36. package/dist/es2019/internal/indicators-container.compiled.css +2 -0
  37. package/dist/es2019/internal/indicators-container.js +11 -16
  38. package/dist/es2019/internal/menu.compiled.css +6 -0
  39. package/dist/es2019/internal/menu.js +11 -30
  40. package/dist/esm/components/date-picker-class.compiled.css +16 -0
  41. package/dist/esm/components/date-picker-class.js +120 -147
  42. package/dist/esm/components/date-picker-fc.compiled.css +16 -0
  43. package/dist/esm/components/date-picker-fc.js +116 -144
  44. package/dist/esm/components/date-time-picker-class.compiled.css +19 -0
  45. package/dist/esm/components/date-time-picker-class.js +21 -49
  46. package/dist/esm/components/date-time-picker-fc.compiled.css +6 -0
  47. package/dist/esm/components/date-time-picker-fc.js +19 -24
  48. package/dist/esm/components/time-picker.js +1 -1
  49. package/dist/esm/internal/date-time-picker-container.compiled.css +21 -0
  50. package/dist/esm/internal/date-time-picker-container.js +22 -69
  51. package/dist/esm/internal/ff-component.js +0 -2
  52. package/dist/esm/internal/fixed-layer-menu.js +5 -8
  53. package/dist/esm/internal/fixed-layer.compiled.css +4 -0
  54. package/dist/esm/internal/fixed-layer.js +13 -13
  55. package/dist/esm/internal/indicators-container.compiled.css +2 -0
  56. package/dist/esm/internal/indicators-container.js +11 -16
  57. package/dist/esm/internal/menu.compiled.css +6 -0
  58. package/dist/esm/internal/menu.js +11 -30
  59. package/dist/types/components/date-picker-class.d.ts +2 -3
  60. package/dist/types/components/date-picker.d.ts +1 -1
  61. package/dist/types/components/date-time-picker-class.d.ts +4 -5
  62. package/dist/types/components/date-time-picker.d.ts +3 -3
  63. package/dist/types/internal/date-time-picker-container.d.ts +4 -0
  64. package/dist/types/internal/fixed-layer-menu.d.ts +2 -6
  65. package/dist/types/internal/fixed-layer.d.ts +5 -1
  66. package/dist/types/internal/indicators-container.d.ts +2 -2
  67. package/dist/types/internal/menu.d.ts +6 -2
  68. package/dist/types-ts4.5/components/date-picker-class.d.ts +2 -3
  69. package/dist/types-ts4.5/components/date-picker.d.ts +1 -1
  70. package/dist/types-ts4.5/components/date-time-picker-class.d.ts +4 -5
  71. package/dist/types-ts4.5/components/date-time-picker.d.ts +3 -3
  72. package/dist/types-ts4.5/internal/date-time-picker-container.d.ts +4 -0
  73. package/dist/types-ts4.5/internal/fixed-layer-menu.d.ts +2 -6
  74. package/dist/types-ts4.5/internal/fixed-layer.d.ts +5 -1
  75. package/dist/types-ts4.5/internal/indicators-container.d.ts +2 -2
  76. package/dist/types-ts4.5/internal/menu.d.ts +6 -2
  77. package/package.json +12 -12
@@ -1,70 +1,20 @@
1
+ /* date-time-picker-container.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
+ import "./date-time-picker-container.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
7
6
  import { forwardRef } from 'react';
8
- import { css, jsx } from '@emotion/react';
9
- import { B100, N0, N100, N20, N30, R400 } from '@atlaskit/theme/colors';
10
- const isInvalidBorderStyles = css({
11
- borderColor: `var(--ds-border-danger, ${R400})`
12
- });
13
- const isFocusedBorderStyles = css({
14
- borderColor: `var(--ds-border-focused, ${B100})`,
15
- boxShadow: `inset 0 0 0 ${"var(--ds-border-width, 1px)"} ${`var(--ds-border-focused, ${B100})`}`
16
- });
17
- const isFocusedStyles = css({
18
- backgroundColor: `var(--ds-background-input-pressed, ${N0})`
19
- });
20
- const subtleBgStyles = css({
21
- backgroundColor: 'transparent',
22
- borderColor: 'transparent'
23
- });
24
- const subtleFocusedBgStyles = css({
25
- backgroundColor: "var(--ds-background-input-pressed, transparent)",
26
- borderColor: 'transparent'
27
- });
28
- const noBgStyles = css({
29
- backgroundColor: 'transparent',
30
- borderColor: 'transparent',
31
- '&:hover': {
32
- backgroundColor: 'transparent',
33
- borderColor: 'transparent'
34
- }
35
- });
36
- const hoverStyles = css({
37
- '&:hover': {
38
- backgroundColor: `var(--ds-background-input-hovered, ${N30})`,
39
- borderColor: `var(--ds-border-input, ${N100})`
40
- }
41
- });
42
- const isInvalidHoverStyles = css({
43
- '&:hover': {
44
- backgroundColor: `var(--ds-background-input-hovered, ${N0})`,
45
- borderColor: `var(--ds-border-danger, ${R400})`
46
- }
47
- });
48
- const isDisabledStyles = css({
49
- backgroundColor: "var(--ds-background-disabled, #091E4208)",
50
- borderColor: "var(--ds-border-disabled, #091E420F)",
51
- '&:hover': {
52
- cursor: 'default'
53
- }
54
- });
55
- const newBorderStyles = css({
56
- border: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border-input, ${N100})`}`
57
- });
58
- const baseContainerStyles = css({
59
- display: 'flex',
60
- backgroundColor: `var(--ds-background-input, ${N20})`,
61
- border: `2px solid ${`var(--ds-border-input, ${N20})`}`,
62
- borderRadius: "var(--ds-border-radius, 3px)",
63
- transition: 'background-color 200ms ease-in-out, border-color 200ms ease-in-out',
64
- '&:hover': {
65
- cursor: 'pointer'
66
- }
67
- });
7
+ const isInvalidBorderStyles = null;
8
+ const isFocusedBorderStyles = null;
9
+ const isFocusedStyles = null;
10
+ const subtleBgStyles = null;
11
+ const subtleFocusedBgStyles = null;
12
+ const noBgStyles = null;
13
+ const hoverStyles = null;
14
+ const isInvalidHoverStyles = null;
15
+ const isDisabledStyles = null;
16
+ const newBorderStyles = null;
17
+ const baseContainerStyles = null;
68
18
  /**
69
19
  * This is the container for the datetime picker component.
70
20
  */
@@ -80,10 +30,9 @@ export const DateTimePickerContainer = /*#__PURE__*/forwardRef(({
80
30
  const notFocusedOrIsDisabled = !(isFocused || isDisabled);
81
31
 
82
32
  // we cannot use Box or Flex primitives because these do not allow ...innerProps to be passed
83
- return jsx("div", _extends({
84
- css: [baseContainerStyles, newBorderStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (isInvalid ? isInvalidHoverStyles : hoverStyles), appearance === 'none' && noBgStyles]
85
- }, innerProps, {
33
+ return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
86
34
  "data-testid": testId,
87
- ref: ref
35
+ ref: ref,
36
+ className: ax(["_2rkoglpi _v564r5cv _1e0c1txw _bfhk1j9a _d0altlke", "_19it1k9g", isDisabled && "_1h6d13gt _bfhksyzs _d0al73ad", isFocused && "_bfhkr01l", appearance === 'subtle' && isFocused && "_1h6d1j28 _bfhk1y3p", appearance === 'subtle' && !isFocused && "_1h6d1j28 _bfhk1j28", isFocused && "_1h6d1p6i _16qsq049", isInvalid && "_1h6d1bqt", notFocusedOrIsDisabled && isInvalid && "_4cvx1bqt _irr31d5g", notFocusedOrIsDisabled && !isInvalid && "_4cvx1elr _irr31d5g", appearance === 'none' && "_1h6d1j28 _bfhk1j28 _4cvx1j28 _irr31j28"])
88
37
  }), children);
89
38
  });
@@ -41,7 +41,5 @@ export function componentWithCondition(condition, ComponentTrue, ComponentFalse)
41
41
  if (ComponentTrue.name !== '') {
42
42
  ComponentWithCondition.displayName = `ComponentWithCondition[${condition.name}]`;
43
43
  }
44
-
45
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
46
44
  return ComponentWithCondition;
47
45
  }
@@ -1,10 +1,7 @@
1
+ /* fixed-layer-menu.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { jsx } from '@emotion/react';
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
8
5
  import { components } from '@atlaskit/select';
9
6
  import FixedLayer from '../internal/fixed-layer';
10
7
 
@@ -35,12 +32,12 @@ export const FixedLayerMenu = ({
35
32
  setValue,
36
33
  children,
37
34
  ...rest
38
- }) => jsx(FixedLayer, {
35
+ }) => /*#__PURE__*/React.createElement(FixedLayer, {
39
36
  inputValue: selectProps.inputValue
40
37
  //@ts-ignore react-select unsupported props
41
38
  ,
42
39
  containerRef: selectProps.fixedLayerRef,
43
- content: jsx(components.Menu, _extends({}, rest, {
40
+ content: /*#__PURE__*/React.createElement(components.Menu, _extends({}, rest, {
44
41
  // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides, @atlaskit/ui-styling-standard/no-classname-prop
45
42
  className: className,
46
43
  clearValue: clearValue,
@@ -0,0 +1,4 @@
1
+ ._154ize3t{top:var(--ds-space-0,0)}
2
+ ._1pbyowjs{z-index:300}
3
+ ._bfhk1j28{background-color:transparent}
4
+ ._kqswstnw{position:absolute}
@@ -1,10 +1,15 @@
1
+ /* fixed-layer.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import "./fixed-layer.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
2
5
  import React from 'react';
3
6
  import noop from '@atlaskit/ds-lib/noop';
4
7
  import { sizes } from '@atlaskit/icon';
5
8
  import { Manager, Popper, Reference } from '@atlaskit/popper';
6
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
7
- import { gridSize, layers } from '@atlaskit/theme/constants';
9
+ const styles = {
10
+ root: "_bfhk1j28 _kqswstnw _154ize3t",
11
+ popperStyles: "_1pbyowjs"
12
+ };
8
13
  /**
9
14
  * This component renders layered content with fixed positioning.
10
15
  * Scroll is locked outside the layer to prevent the layered content from detaching from the
@@ -33,12 +38,9 @@ export default class FixedLayer extends React.Component {
33
38
  return /*#__PURE__*/React.createElement("div", null);
34
39
  }
35
40
  const divStyles = {
36
- background: 'transparent',
37
- position: 'absolute',
38
- top: 0,
39
41
  height: containerRef.getBoundingClientRect().height,
40
42
  // Don't block the clear button
41
- width: containerRef.getBoundingClientRect().width - parseInt(sizes.small.slice(0, -2)) - gridSize()
43
+ width: containerRef.getBoundingClientRect().width - parseInt(sizes.small.slice(0, -2)) - 8
42
44
  };
43
45
  return (
44
46
  /*#__PURE__*/
@@ -50,7 +52,8 @@ export default class FixedLayer extends React.Component {
50
52
  }) => /*#__PURE__*/React.createElement("div", {
51
53
  ref: ref,
52
54
  "data-layer-child": true,
53
- style: divStyles
55
+ style: divStyles,
56
+ className: ax([styles.root])
54
57
  })), /*#__PURE__*/React.createElement(Popper, null, ({
55
58
  ref,
56
59
  style,
@@ -61,11 +64,9 @@ export default class FixedLayer extends React.Component {
61
64
  ref: ref
62
65
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
63
66
  ,
64
- style: {
65
- ...style,
66
- zIndex: layers.dialog()
67
- },
68
- "data-testid": testId && `${testId}--popper--container`
67
+ style: style,
68
+ "data-testid": testId && `${testId}--popper--container`,
69
+ className: ax([styles.popperStyles])
69
70
  }, content);
70
71
  }))
71
72
  );
@@ -0,0 +1,2 @@
1
+ ._ahbq1ejb{margin-inline-start:var(--ds-space-300,24px)}
2
+ ._ahbqxy5q{margin-inline-start:var(--ds-space-400,2pc)}
@@ -1,22 +1,17 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css, jsx } from '@emotion/react';
1
+ /* indicators-container.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./indicators-container.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
8
5
  import { components } from '@atlaskit/select';
9
- const calendarButtonInclusionStyles = css({
10
- marginInlineStart: "var(--ds-space-400, 32px)"
11
- });
12
- const calendarButtonOnlyInclusionStyles = css({
13
- marginInlineStart: "var(--ds-space-300, 24px)"
14
- });
6
+ const styles = {
7
+ calendarButtonInclusionStyles: "_ahbqxy5q",
8
+ calendarButtonOnlyInclusionStyles: "_ahbq1ejb"
9
+ };
15
10
 
16
11
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
17
12
  export const IndicatorsContainer = ({
18
13
  showClearIndicator,
19
14
  ...rest
20
- }) => jsx("div", {
21
- css: showClearIndicator ? calendarButtonInclusionStyles : calendarButtonOnlyInclusionStyles
22
- }, jsx(components.IndicatorsContainer, rest));
15
+ }) => /*#__PURE__*/React.createElement("div", {
16
+ className: ax([showClearIndicator ? styles.calendarButtonInclusionStyles : styles.calendarButtonOnlyInclusionStyles])
17
+ }, /*#__PURE__*/React.createElement(components.IndicatorsContainer, rest));
@@ -0,0 +1,6 @@
1
+
2
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
3
+ ._18m915vq{overflow-y:hidden}
4
+ ._1pbyowjs{z-index:300}
5
+ ._1reo15vq{overflow-x:hidden}
6
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
@@ -1,16 +1,12 @@
1
+ /* menu.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
+ import "./menu.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
7
6
  import { Fragment } from 'react';
8
- import { css, jsx } from '@emotion/react';
9
7
  import { isValid, parseISO } from 'date-fns';
10
8
  import Calendar from '@atlaskit/calendar';
11
9
  import { Layering } from '@atlaskit/layering';
12
- import { N0, N50A, N60A } from '@atlaskit/theme/colors';
13
- import { layers } from '@atlaskit/theme/constants';
14
10
  import FixedLayer from '../internal/fixed-layer';
15
11
 
16
12
  /**
@@ -27,13 +23,7 @@ function getValidDate(isos) {
27
23
  } : acc;
28
24
  }, {});
29
25
  }
30
- const menuStyles = css({
31
- zIndex: layers.dialog(),
32
- backgroundColor: `var(--ds-surface-overlay, ${N0})`,
33
- borderRadius: "var(--ds-border-radius, 3px)",
34
- boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`,
35
- overflow: 'hidden'
36
- });
26
+ const menuStyles = null;
37
27
 
38
28
  /**
39
29
  * This is the menu used in the select of the date picker.
@@ -60,24 +50,15 @@ export const Menu = ({
60
50
  event.preventDefault();
61
51
  };
62
52
  const Wrapper = typeof MenuInnerWrapper === 'function' ? MenuInnerWrapper : Fragment;
63
- return jsx(Layering, {
53
+ return /*#__PURE__*/React.createElement(Layering, {
64
54
  isDisabled: false
65
- }, jsx(FixedLayer, {
55
+ }, /*#__PURE__*/React.createElement(FixedLayer, {
66
56
  inputValue: selectProps.inputValue,
67
57
  containerRef: selectProps.calendarContainerRef,
68
- content:
69
- // The mousedown event is required for a date selection to work when
70
- // the menu is opened via the calendar button. The reason why is
71
- // because there is a mousedown event on the menu inside of
72
- // `react-select` that will stop the calendar select event from
73
- // firing. This is passed in via the `innerProps`. Therefore, we must
74
- // pass it in *after* the `innerProps` spread.
75
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
76
- jsx("div", _extends({
77
- css: menuStyles
78
- }, innerProps, {
79
- onMouseDown: onMenuMouseDown
80
- }), jsx(Wrapper, null, jsx(Calendar, {
58
+ content: /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
59
+ onMouseDown: onMenuMouseDown,
60
+ className: ax(["_2rkoglpi _1reo15vq _18m915vq _1pbyowjs _bfhk1bhr _16qs1cd0"])
61
+ }), /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Calendar, {
81
62
  day: day,
82
63
  month: month,
83
64
  year: year,
@@ -0,0 +1,16 @@
1
+
2
+ ._v564vrg3{transition:color .15s}._12l21b66{margin-inline-end:var(--ds-space-050,4px)}
3
+ ._12l2xy5q{margin-inline-end:var(--ds-space-400,2pc)}
4
+ ._152tze3t{inset-block-start:var(--ds-space-0,0)}
5
+ ._1bah1h6o{justify-content:center}
6
+ ._1e0c1txw{display:flex}
7
+ ._1tke1k8s{min-height:1.5rem}
8
+ ._1ul91k8s{min-width:1.5rem}
9
+ ._4cvr1h6o{align-items:center}
10
+ ._4t3i1osq{height:100%}
11
+ ._i0dl1kw7{flex-basis:inherit}
12
+ ._kqswh2mm{position:relative}
13
+ ._kqswstnw{position:absolute}
14
+ ._rjxpze3t{inset-inline-end:var(--ds-space-0,0)}
15
+ ._syaz131l{color:var(--ds-text-subtlest,#626f86)}
16
+ ._30l31gjq:hover{color:var(--ds-text-subtle,#44546f)}