@atlaskit/datetime-picker 16.2.2 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/components/date-picker-class.compiled.css +16 -0
- package/dist/cjs/components/date-picker-class.js +118 -144
- package/dist/cjs/components/date-picker-fc.compiled.css +16 -0
- package/dist/cjs/components/date-picker-fc.js +115 -142
- package/dist/cjs/components/date-time-picker-class.compiled.css +19 -0
- package/dist/cjs/components/date-time-picker-class.js +24 -47
- package/dist/cjs/components/date-time-picker-fc.compiled.css +6 -0
- package/dist/cjs/components/date-time-picker-fc.js +22 -27
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/cjs/internal/date-time-picker-container.compiled.css +21 -0
- package/dist/cjs/internal/date-time-picker-container.js +26 -71
- package/dist/cjs/internal/fixed-layer-menu.js +8 -8
- package/dist/cjs/internal/fixed-layer.compiled.css +4 -0
- package/dist/cjs/internal/fixed-layer.js +15 -13
- package/dist/cjs/internal/indicators-container.compiled.css +2 -0
- package/dist/cjs/internal/indicators-container.js +14 -15
- package/dist/cjs/internal/menu.compiled.css +6 -0
- package/dist/cjs/internal/menu.js +15 -32
- package/dist/es2019/components/date-picker-class.compiled.css +16 -0
- package/dist/es2019/components/date-picker-class.js +113 -142
- package/dist/es2019/components/date-picker-fc.compiled.css +16 -0
- package/dist/es2019/components/date-picker-fc.js +112 -140
- package/dist/es2019/components/date-time-picker-class.compiled.css +19 -0
- package/dist/es2019/components/date-time-picker-class.js +23 -49
- package/dist/es2019/components/date-time-picker-fc.compiled.css +6 -0
- package/dist/es2019/components/date-time-picker-fc.js +19 -24
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/es2019/internal/date-time-picker-container.compiled.css +21 -0
- package/dist/es2019/internal/date-time-picker-container.js +18 -69
- package/dist/es2019/internal/fixed-layer-menu.js +5 -8
- package/dist/es2019/internal/fixed-layer.compiled.css +4 -0
- package/dist/es2019/internal/fixed-layer.js +14 -12
- package/dist/es2019/internal/indicators-container.compiled.css +2 -0
- package/dist/es2019/internal/indicators-container.js +11 -16
- package/dist/es2019/internal/menu.compiled.css +6 -0
- package/dist/es2019/internal/menu.js +11 -30
- package/dist/esm/components/date-picker-class.compiled.css +16 -0
- package/dist/esm/components/date-picker-class.js +116 -145
- package/dist/esm/components/date-picker-fc.compiled.css +16 -0
- package/dist/esm/components/date-picker-fc.js +114 -142
- package/dist/esm/components/date-time-picker-class.compiled.css +19 -0
- package/dist/esm/components/date-time-picker-class.js +23 -49
- package/dist/esm/components/date-time-picker-fc.compiled.css +6 -0
- package/dist/esm/components/date-time-picker-fc.js +19 -24
- package/dist/esm/components/time-picker.js +1 -1
- package/dist/esm/internal/date-time-picker-container.compiled.css +21 -0
- package/dist/esm/internal/date-time-picker-container.js +22 -69
- package/dist/esm/internal/fixed-layer-menu.js +5 -8
- package/dist/esm/internal/fixed-layer.compiled.css +4 -0
- package/dist/esm/internal/fixed-layer.js +14 -13
- package/dist/esm/internal/indicators-container.compiled.css +2 -0
- package/dist/esm/internal/indicators-container.js +11 -16
- package/dist/esm/internal/menu.compiled.css +6 -0
- package/dist/esm/internal/menu.js +11 -30
- package/dist/types/components/date-picker-class.d.ts +2 -3
- package/dist/types/components/date-picker.d.ts +1 -1
- package/dist/types/components/date-time-picker-class.d.ts +4 -5
- package/dist/types/components/date-time-picker.d.ts +3 -3
- package/dist/types/internal/date-time-picker-container.d.ts +4 -0
- package/dist/types/internal/fixed-layer-menu.d.ts +2 -6
- package/dist/types/internal/fixed-layer.d.ts +5 -1
- package/dist/types/internal/indicators-container.d.ts +2 -2
- package/dist/types/internal/menu.d.ts +6 -2
- package/dist/types-ts4.5/components/date-picker-class.d.ts +2 -3
- package/dist/types-ts4.5/components/date-picker.d.ts +1 -1
- package/dist/types-ts4.5/components/date-time-picker-class.d.ts +4 -5
- package/dist/types-ts4.5/components/date-time-picker.d.ts +3 -3
- package/dist/types-ts4.5/internal/date-time-picker-container.d.ts +4 -0
- package/dist/types-ts4.5/internal/fixed-layer-menu.d.ts +2 -6
- package/dist/types-ts4.5/internal/fixed-layer.d.ts +5 -1
- package/dist/types-ts4.5/internal/indicators-container.d.ts +2 -2
- package/dist/types-ts4.5/internal/menu.d.ts +6 -2
- package/package.json +20 -14
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
._19itglyw{border:none}
|
|
3
|
+
._v564vrg3{transition:color .15s}._12l2e4h9{margin-inline-end:var(--ds-border-width,1px)}
|
|
4
|
+
._16jlkb7n{flex-grow:1}
|
|
5
|
+
._1e0c1txw{display:flex}
|
|
6
|
+
._1o9zidpf{flex-shrink:0}
|
|
7
|
+
._1pfhe4h9{margin-block-start:var(--ds-border-width,1px)}
|
|
8
|
+
._1q5112x7{padding-block-start:var(--ds-space-075,6px)}
|
|
9
|
+
._4cvr1h6o{align-items:center}
|
|
10
|
+
._6rthe4h9{margin-block-end:var(--ds-border-width,1px)}
|
|
11
|
+
._85i512x7{padding-block-end:var(--ds-space-075,6px)}
|
|
12
|
+
._ahbqe4h9{margin-inline-start:var(--ds-border-width,1px)}
|
|
13
|
+
._bfhk1kw7{background-color:inherit}
|
|
14
|
+
._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
|
|
15
|
+
._i0dl1kw7{flex-basis:inherit}
|
|
16
|
+
._i0dl1ssb{flex-basis:50%}
|
|
17
|
+
._syaz131l{color:var(--ds-text-subtlest,#626f86)}
|
|
18
|
+
._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
|
|
19
|
+
._30l31gjq:hover{color:var(--ds-text-subtle,#44546f)}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
+
/* date-time-picker-class.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
3
|
+
import "./date-time-picker-class.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import React from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
6
|
import { format, isValid, parseISO } from 'date-fns';
|
|
11
7
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
8
|
import SelectClearIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
|
|
13
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
10
|
import { mergeStyles } from '@atlaskit/select';
|
|
15
|
-
import { N500, N70 } from '@atlaskit/theme/colors';
|
|
16
11
|
import { formatDateTimeZoneIntoIso } from '../internal';
|
|
17
12
|
import { DateTimePickerContainer } from '../internal/date-time-picker-container';
|
|
18
13
|
import { componentWithCondition } from '../internal/ff-component';
|
|
@@ -22,35 +17,12 @@ import DatePickerNew from './date-picker-fc';
|
|
|
22
17
|
import TimePicker from './time-picker';
|
|
23
18
|
const DatePicker = componentWithCondition(() => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
|
|
24
19
|
const packageName = "@atlaskit/datetime-picker";
|
|
25
|
-
const packageVersion = "
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
flexShrink: 0
|
|
32
|
-
});
|
|
33
|
-
const timePickerContainerStyles = css({
|
|
34
|
-
flexBasis: '50%',
|
|
35
|
-
flexGrow: 1
|
|
36
|
-
});
|
|
37
|
-
const iconContainerStyles = css({
|
|
38
|
-
display: 'flex',
|
|
39
|
-
margin: "var(--ds-border-width, 1px)",
|
|
40
|
-
alignItems: 'center',
|
|
41
|
-
flexBasis: 'inherit',
|
|
42
|
-
backgroundColor: 'inherit',
|
|
43
|
-
border: 'none',
|
|
44
|
-
color: `var(--ds-text-subtlest, ${N70})`,
|
|
45
|
-
paddingBlockEnd: "var(--ds-space-075, 6px)",
|
|
46
|
-
paddingBlockStart: "var(--ds-space-075, 6px)",
|
|
47
|
-
paddingInlineEnd: "var(--ds-space-100, 8px)",
|
|
48
|
-
paddingInlineStart: "var(--ds-space-050, 4px)",
|
|
49
|
-
transition: `color 150ms`,
|
|
50
|
-
'&:hover': {
|
|
51
|
-
color: `var(--ds-text-subtle, ${N500})`
|
|
52
|
-
}
|
|
53
|
-
});
|
|
20
|
+
const packageVersion = "17.0.0";
|
|
21
|
+
const compiledStyles = {
|
|
22
|
+
datePickerContainerStyles: "_i0dl1ssb _16jlkb7n _1o9zidpf",
|
|
23
|
+
timePickerContainerStyles: "_i0dl1ssb _16jlkb7n",
|
|
24
|
+
iconContainerStyles: "_19itglyw _v564vrg3 _1e0c1txw _4cvr1h6o _i0dl1kw7 _bfhk1kw7 _syaz131l _6rthe4h9 _1pfhe4h9 _12l2e4h9 _ahbqe4h9 _85i512x7 _1q5112x7 _y4tiu2gc _bozg1b66 _30l31gjq"
|
|
25
|
+
};
|
|
54
26
|
|
|
55
27
|
// react-select overrides (via @atlaskit/select).
|
|
56
28
|
const styles = {
|
|
@@ -79,6 +51,8 @@ const dateTimePickerDefaultProps = {
|
|
|
79
51
|
};
|
|
80
52
|
export const datePickerDefaultAriaLabel = 'Date';
|
|
81
53
|
export const timePickerDefaultAriaLabel = 'Time';
|
|
54
|
+
|
|
55
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
82
56
|
class DateTimePickerComponent extends React.Component {
|
|
83
57
|
constructor(...args) {
|
|
84
58
|
var _this$props$datePicke, _this$props$timePicke;
|
|
@@ -276,21 +250,21 @@ class DateTimePickerComponent extends React.Component {
|
|
|
276
250
|
// Render DateTimePicker's IconContainer when a value has been filled
|
|
277
251
|
// Don't use Date or TimePicker's because they can't be customised
|
|
278
252
|
const isClearable = Boolean(dateValue || timeValue);
|
|
279
|
-
return
|
|
253
|
+
return /*#__PURE__*/React.createElement(DateTimePickerContainer, {
|
|
280
254
|
appearance: appearance,
|
|
281
255
|
isDisabled: isDisabled,
|
|
282
256
|
isFocused: isFocused,
|
|
283
257
|
isInvalid: isInvalid,
|
|
284
258
|
testId: testId,
|
|
285
259
|
innerProps: innerProps
|
|
286
|
-
},
|
|
260
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
287
261
|
name: name,
|
|
288
262
|
type: "hidden",
|
|
289
263
|
value: value,
|
|
290
264
|
"data-testid": testId && `${testId}--input`
|
|
291
|
-
}),
|
|
292
|
-
|
|
293
|
-
},
|
|
265
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
266
|
+
className: ax([compiledStyles.datePickerContainerStyles])
|
|
267
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
294
268
|
appearance: appearance,
|
|
295
269
|
"aria-describedby": datePickerAriaDescribedBy,
|
|
296
270
|
autoFocus: datePickerProps.autoFocus || autoFocus,
|
|
@@ -326,9 +300,9 @@ class DateTimePickerComponent extends React.Component {
|
|
|
326
300
|
testId: testId && `${testId}--datepicker` || datePickerProps.testId,
|
|
327
301
|
value: dateValue,
|
|
328
302
|
weekStartDay: datePickerProps.weekStartDay
|
|
329
|
-
})),
|
|
330
|
-
|
|
331
|
-
},
|
|
303
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
304
|
+
className: ax([compiledStyles.timePickerContainerStyles])
|
|
305
|
+
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
332
306
|
appearance: timePickerProps.appearance || appearance,
|
|
333
307
|
"aria-describedby": timePickerAriaDescribedBy,
|
|
334
308
|
autoFocus: timePickerProps.autoFocus,
|
|
@@ -357,13 +331,13 @@ class DateTimePickerComponent extends React.Component {
|
|
|
357
331
|
timeIsEditable: timePickerProps.timeIsEditable,
|
|
358
332
|
times: timePickerProps.times,
|
|
359
333
|
value: timeValue
|
|
360
|
-
})), isClearable && !isDisabled ?
|
|
361
|
-
css: iconContainerStyles,
|
|
334
|
+
})), isClearable && !isDisabled ? /*#__PURE__*/React.createElement("button", {
|
|
362
335
|
onClick: this.onClear,
|
|
363
336
|
"data-testid": testId && `${testId}--icon--container`,
|
|
364
337
|
tabIndex: -1,
|
|
365
|
-
type: "button"
|
|
366
|
-
|
|
338
|
+
type: "button",
|
|
339
|
+
className: ax([compiledStyles.iconContainerStyles])
|
|
340
|
+
}, /*#__PURE__*/React.createElement(SelectClearIcon, {
|
|
367
341
|
LEGACY_size: "small",
|
|
368
342
|
color: "currentColor",
|
|
369
343
|
label: clearControlLabel
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
/* date-time-picker-fc.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./date-time-picker-fc.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
2
5
|
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
3
6
|
import { format, isValid, parseISO } from 'date-fns';
|
|
4
7
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
5
8
|
import { IconButton } from '@atlaskit/button/new';
|
|
6
9
|
import SelectClearIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
|
|
7
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { Box, Inline
|
|
11
|
+
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
9
12
|
import { mergeStyles } from '@atlaskit/select';
|
|
10
13
|
import { formatDateTimeZoneIntoIso } from '../internal';
|
|
11
14
|
import { DateTimePickerContainer } from '../internal/date-time-picker-container';
|
|
@@ -18,29 +21,17 @@ const DatePicker = componentWithCondition(
|
|
|
18
21
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
19
22
|
() => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
|
|
20
23
|
const packageName = "@atlaskit/datetime-picker";
|
|
21
|
-
const packageVersion = "
|
|
24
|
+
const packageVersion = "17.0.0";
|
|
22
25
|
const analyticsAttributes = {
|
|
23
26
|
componentName: 'dateTimePicker',
|
|
24
27
|
packageName,
|
|
25
28
|
packageVersion
|
|
26
29
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
flexGrow: 1,
|
|
33
|
-
flexShrink: 0
|
|
34
|
-
});
|
|
35
|
-
const timePickerContainerStyles = xcss({
|
|
36
|
-
flexBasis: '50%',
|
|
37
|
-
flexGrow: 1
|
|
38
|
-
});
|
|
39
|
-
const iconContainerStyles = xcss({
|
|
40
|
-
display: 'flex',
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
flexBasis: 'inherit'
|
|
43
|
-
});
|
|
30
|
+
const compiledStyles = {
|
|
31
|
+
datePickerContainerStyles: "_i0dl1ssb _16jlkb7n _1o9zidpf",
|
|
32
|
+
timePickerContainerStyles: "_i0dl1ssb _16jlkb7n",
|
|
33
|
+
iconContainerStyles: "_1e0c1txw _4cvr1h6o _i0dl1kw7"
|
|
34
|
+
};
|
|
44
35
|
|
|
45
36
|
// react-select overrides (via @atlaskit/select).
|
|
46
37
|
const styles = {
|
|
@@ -266,10 +257,12 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
266
257
|
value: value,
|
|
267
258
|
"data-testid": testId && `${testId}--input`
|
|
268
259
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
269
|
-
xcss: datePickerContainerStyles
|
|
260
|
+
xcss: compiledStyles.datePickerContainerStyles
|
|
270
261
|
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
271
262
|
appearance: appearance,
|
|
272
|
-
"aria-describedby": datePickerAriaDescribedBy
|
|
263
|
+
"aria-describedby": datePickerAriaDescribedBy
|
|
264
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
265
|
+
,
|
|
273
266
|
autoFocus: datePickerProps.autoFocus || autoFocus,
|
|
274
267
|
dateFormat: datePickerProps.dateFormat,
|
|
275
268
|
defaultIsOpen: datePickerProps.defaultIsOpen,
|
|
@@ -307,10 +300,12 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
307
300
|
value: dateValue,
|
|
308
301
|
weekStartDay: datePickerProps.weekStartDay
|
|
309
302
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
310
|
-
xcss: timePickerContainerStyles
|
|
303
|
+
xcss: compiledStyles.timePickerContainerStyles
|
|
311
304
|
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
312
305
|
appearance: timePickerProps.appearance || appearance,
|
|
313
|
-
"aria-describedby": timePickerAriaDescribedBy
|
|
306
|
+
"aria-describedby": timePickerAriaDescribedBy
|
|
307
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
308
|
+
,
|
|
314
309
|
autoFocus: timePickerProps.autoFocus,
|
|
315
310
|
defaultIsOpen: timePickerProps.defaultIsOpen,
|
|
316
311
|
defaultValue: timePickerProps.defaultValue,
|
|
@@ -338,7 +333,7 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
338
333
|
times: timePickerProps.times,
|
|
339
334
|
value: timeValue
|
|
340
335
|
})), isClearable && !isDisabled ? /*#__PURE__*/React.createElement(Inline, {
|
|
341
|
-
xcss: iconContainerStyles
|
|
336
|
+
xcss: compiledStyles.iconContainerStyles
|
|
342
337
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
343
338
|
appearance: "subtle",
|
|
344
339
|
label: clearControlLabel,
|
|
@@ -11,7 +11,7 @@ import parseTime from '../internal/parse-time';
|
|
|
11
11
|
import { convertTokens } from '../internal/parse-tokens';
|
|
12
12
|
import { makeSingleValue } from '../internal/single-value';
|
|
13
13
|
const packageName = "@atlaskit/datetime-picker";
|
|
14
|
-
const packageVersion = "
|
|
14
|
+
const packageVersion = "17.0.0";
|
|
15
15
|
const menuStyles = {
|
|
16
16
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
17
17
|
position: 'static',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
._19it1k9g{border:var(--ds-border-width,1px) solid var(--ds-border-input,#8590a2)}
|
|
3
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
4
|
+
._v564r5cv{transition:background-color .2s ease-in-out,border-color .2s ease-in-out}
|
|
5
|
+
._1h6d13gt{border-color:var(--ds-border-disabled,#091e420f)}
|
|
6
|
+
._1h6d1bqt{border-color:var(--ds-border-danger,#e2483d)}
|
|
7
|
+
._1h6d1j28{border-color:transparent}
|
|
8
|
+
._1h6d1p6i{border-color:var(--ds-border-focused,#388bff)}._16qsq049{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#388bff)}
|
|
9
|
+
._1e0c1txw{display:flex}
|
|
10
|
+
._bfhk1j28{background-color:transparent}
|
|
11
|
+
._bfhk1j9a{background-color:var(--ds-background-input,#fff)}
|
|
12
|
+
._bfhk1y3p{background-color:var(--ds-background-input-pressed,transparent)}
|
|
13
|
+
._bfhkr01l{background-color:var(--ds-background-input-pressed,#fff)}
|
|
14
|
+
._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
|
|
15
|
+
._4cvx1bqt:hover{border-color:var(--ds-border-danger,#e2483d)}
|
|
16
|
+
._4cvx1elr:hover{border-color:var(--ds-border-input,#8590a2)}
|
|
17
|
+
._4cvx1j28:hover{border-color:transparent}
|
|
18
|
+
._d0al73ad:hover{cursor:default}
|
|
19
|
+
._d0altlke:hover{cursor:pointer}
|
|
20
|
+
._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
|
|
21
|
+
._irr31j28:hover{background-color:transparent}
|
|
@@ -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
|
-
*
|
|
4
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
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
|
|
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
|
});
|
|
@@ -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
|
-
|
|
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
|
-
}) =>
|
|
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:
|
|
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,
|
|
@@ -1,15 +1,21 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
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
|
|
11
16
|
* container ref.
|
|
12
17
|
*/
|
|
18
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
13
19
|
export default class FixedLayer extends React.Component {
|
|
14
20
|
constructor(...args) {
|
|
15
21
|
super(...args);
|
|
@@ -32,12 +38,9 @@ export default class FixedLayer extends React.Component {
|
|
|
32
38
|
return /*#__PURE__*/React.createElement("div", null);
|
|
33
39
|
}
|
|
34
40
|
const divStyles = {
|
|
35
|
-
background: 'transparent',
|
|
36
|
-
position: 'absolute',
|
|
37
|
-
top: 0,
|
|
38
41
|
height: containerRef.getBoundingClientRect().height,
|
|
39
42
|
// Don't block the clear button
|
|
40
|
-
width: containerRef.getBoundingClientRect().width - parseInt(sizes.small.slice(0, -2)) -
|
|
43
|
+
width: containerRef.getBoundingClientRect().width - parseInt(sizes.small.slice(0, -2)) - 8
|
|
41
44
|
};
|
|
42
45
|
return (
|
|
43
46
|
/*#__PURE__*/
|
|
@@ -49,7 +52,8 @@ export default class FixedLayer extends React.Component {
|
|
|
49
52
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
50
53
|
ref: ref,
|
|
51
54
|
"data-layer-child": true,
|
|
52
|
-
style: divStyles
|
|
55
|
+
style: divStyles,
|
|
56
|
+
className: ax([styles.root])
|
|
53
57
|
})), /*#__PURE__*/React.createElement(Popper, null, ({
|
|
54
58
|
ref,
|
|
55
59
|
style,
|
|
@@ -60,11 +64,9 @@ export default class FixedLayer extends React.Component {
|
|
|
60
64
|
ref: ref
|
|
61
65
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
62
66
|
,
|
|
63
|
-
style:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
"data-testid": testId && `${testId}--popper--container`
|
|
67
|
+
style: style,
|
|
68
|
+
"data-testid": testId && `${testId}--popper--container`,
|
|
69
|
+
className: ax([styles.popperStyles])
|
|
68
70
|
}, content);
|
|
69
71
|
}))
|
|
70
72
|
);
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
}) =>
|
|
21
|
-
|
|
22
|
-
},
|
|
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
|
-
*
|
|
4
|
-
|
|
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 =
|
|
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
|
|
53
|
+
return /*#__PURE__*/React.createElement(Layering, {
|
|
64
54
|
isDisabled: false
|
|
65
|
-
},
|
|
55
|
+
}, /*#__PURE__*/React.createElement(FixedLayer, {
|
|
66
56
|
inputValue: selectProps.inputValue,
|
|
67
57
|
containerRef: selectProps.calendarContainerRef,
|
|
68
|
-
content:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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)}
|