@react-spectrum/datepicker 3.9.6 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateField.main.js +3 -1
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +4 -2
- package/dist/DateField.module.js +4 -2
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +6 -4
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +7 -5
- package/dist/DatePicker.module.js +7 -5
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/DatePickerField.main.js +3 -3
- package/dist/DatePickerField.main.js.map +1 -1
- package/dist/DatePickerField.mjs +3 -3
- package/dist/DatePickerField.module.js +3 -3
- package/dist/DatePickerField.module.js.map +1 -1
- package/dist/DatePickerSegment.main.js +5 -8
- package/dist/DatePickerSegment.main.js.map +1 -1
- package/dist/DatePickerSegment.mjs +5 -8
- package/dist/DatePickerSegment.module.js +5 -8
- package/dist/DatePickerSegment.module.js.map +1 -1
- package/dist/DateRangePicker.main.js +6 -3
- package/dist/DateRangePicker.main.js.map +1 -1
- package/dist/DateRangePicker.mjs +7 -4
- package/dist/DateRangePicker.module.js +7 -4
- package/dist/DateRangePicker.module.js.map +1 -1
- package/dist/Input.main.js +9 -3
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +9 -3
- package/dist/Input.module.js +9 -3
- package/dist/Input.module.js.map +1 -1
- package/dist/TimeField.main.js +3 -1
- package/dist/TimeField.main.js.map +1 -1
- package/dist/TimeField.mjs +4 -2
- package/dist/TimeField.module.js +4 -2
- package/dist/TimeField.module.js.map +1 -1
- package/dist/{styles.36ea4632.css → styles.b562cf4b.css} +9 -13
- package/dist/styles.b562cf4b.css.map +1 -0
- package/dist/styles_css.main.js +3 -0
- package/dist/styles_css.main.js.map +1 -1
- package/dist/styles_css.mjs +3 -0
- package/dist/styles_css.module.js +3 -0
- package/dist/styles_css.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js +16 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +17 -3
- package/dist/utils.module.js +17 -3
- package/dist/utils.module.js.map +1 -1
- package/dist/{vars.3692148b.css → vars.3d0e5be0.css} +2 -1
- package/dist/vars.3d0e5be0.css.map +1 -0
- package/package.json +23 -23
- package/src/DateField.tsx +4 -1
- package/src/DatePicker.tsx +6 -3
- package/src/DatePickerField.tsx +2 -2
- package/src/DatePickerSegment.tsx +4 -7
- package/src/DateRangePicker.tsx +7 -3
- package/src/Input.tsx +10 -2
- package/src/TimeField.tsx +4 -1
- package/src/styles.css +8 -12
- package/src/utils.ts +15 -2
- package/dist/styles.36ea4632.css.map +0 -1
- package/dist/vars.3692148b.css.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,yCAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB;QACjB,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,gCAAC,CAAA,GAAA,yCAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,gCAAC,CAAA,GAAA,yCAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,gCAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef(null);\n let inputRef = useRef(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,yCAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,IAAI,mBAAmB,CAAA,GAAA,yCAAoB,EAAE,SAAS;IAEtD,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB;QACjB,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,gCAAC,CAAA,GAAA,yCAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,gCAAC,CAAA,GAAA,yCAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,gCAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef(null);\n let inputRef = useRef(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n minWidth={approximateWidth}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.module.js.map"}
|
|
@@ -80,6 +80,12 @@
|
|
|
80
80
|
display: none;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
._2n04KW_react-spectrum-Datepicker-inputSized {
|
|
84
|
+
align-items: center;
|
|
85
|
+
height: 100%;
|
|
86
|
+
display: flex;
|
|
87
|
+
}
|
|
88
|
+
|
|
83
89
|
._2n04KW_react-spectrum-Datepicker-rangeDash:before {
|
|
84
90
|
content: "–";
|
|
85
91
|
}
|
|
@@ -112,23 +118,13 @@
|
|
|
112
118
|
background: none;
|
|
113
119
|
}
|
|
114
120
|
|
|
115
|
-
._2n04KW_react-spectrum-DatePicker-placeholder {
|
|
116
|
-
text-align: center;
|
|
117
|
-
visibility: hidden;
|
|
118
|
-
pointer-events: none;
|
|
119
|
-
width: 100%;
|
|
120
|
-
height: 0;
|
|
121
|
-
font-style: italic;
|
|
122
|
-
display: block;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
121
|
._2n04KW_react-spectrum-DatePicker-cell._2n04KW_is-placeholder {
|
|
126
122
|
color: var(--spectrum-gray-600);
|
|
127
123
|
}
|
|
128
124
|
|
|
129
125
|
._2n04KW_react-spectrum-DatePicker-cell._2n04KW_is-placeholder ._2n04KW_react-spectrum-DatePicker-placeholder {
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
text-align: center;
|
|
127
|
+
pointer-events: none;
|
|
132
128
|
}
|
|
133
129
|
|
|
134
130
|
._2n04KW_react-spectrum-DatePicker-cell._2n04KW_is-placeholder ~ ._2n04KW_react-spectrum-Datepicker-literal {
|
|
@@ -206,4 +202,4 @@
|
|
|
206
202
|
color: highlighttext;
|
|
207
203
|
}
|
|
208
204
|
}
|
|
209
|
-
/*# sourceMappingURL=styles.
|
|
205
|
+
/*# sourceMappingURL=styles.b562cf4b.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAYA;;;;;;AAMA;;;;;AAKA;;;;;;AAMA;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAMA;;;;AAIA;;;;AAMA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;AAMA;;;;;;;;;AAQE;;;;;;AAOF;;;;;;AAOE;;;;AAKF;;;;;AAKA;;;;;;;AAMA;;;;;;;;;;;;AAWE;;;;AAOF;;;;AAGE;;;;;AAMF;;;;AAIA;;;;AAIA;;;;;;;AAOA;;;;AAIA;;;;;AAIE;;;;AAQA;;;;;AAQF;EACE;;;;EAGE;;;;;;AAOJ;;;;;;;;AAQA;EACE;;;;;;EAKA;;;;EAEE;;;;EAIF;;;;EAEE","sources":["packages/@react-spectrum/datepicker/src/styles.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper {\n width: auto;\n min-width: var(--spectrum-global-dimension-size-2000);\n max-width: 100%;\n }\n\n.react-spectrum-Datepicker-startField {\n width: auto;\n padding-inline-end: var(--spectrum-global-dimension-size-100);\n}\n\n.react-spectrum-Datepicker-endField {\n width: auto;\n flex: 1;\n padding-inline-start: var(--spectrum-global-dimension-size-100);\n}\n\n.react-spectrum-Datepicker-field ~ .react-spectrum-Datepicker-endField > .react-spectrum-Datepicker-input {\n border-inline-start-width: 0;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.react-spectrum-Datepicker-field.react-spectrum-Datepicker-field {\n width: auto;\n}\n\n.react-spectrum-Datepicker-field .react-spectrum-DateField-Input {\n line-height: var(--spectrum-body-4-text-line-height);\n}\n\n/* specificity war with .spectrum-Field--positionSide etc. */\n.react-spectrum-DateField.react-spectrum-DateField.react-spectrum-DateField.react-spectrum-DateField {\n min-width: var(--spectrum-global-dimension-size-2000);\n}\n\n.react-spectrum-TimeField.react-spectrum-TimeField.react-spectrum-TimeField.react-spectrum-TimeField {\n min-width: var(--spectrum-global-dimension-size-1250);\n}\n\n.react-spectrum-TimeField-fieldWrapper.react-spectrum-TimeField-fieldWrapper.react-spectrum-TimeField-fieldWrapper {\n width: auto;\n min-width: var(--spectrum-global-dimension-size-1250);\n}\n\n.react-spectrum-Datepicker-input.react-spectrum-Datepicker-input.react-spectrum-Datepicker-input {\n /* always reserve space for the validation icon */\n padding-inline-end: calc(var(--spectrum-textfield-padding-x) + var(--spectrum-icon-alert-medium-width) + var(--spectrum-textfield-icon-margin-left));\n cursor: text;\n}\n\n.react-spectrum-Datepicker-inputContents {\n display: flex;\n align-items: center;\n height: 100%;\n overflow-x: auto;\n scrollbar-width: none; /* Firefox */\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n\n &::-webkit-scrollbar { /* WebKit */\n width: 0;\n height: 0;\n display: none;\n }\n}\n\n.react-spectrum-Datepicker-inputSized {\n display: flex;\n height: 100%;\n align-items: center;\n}\n\n.react-spectrum-Datepicker-rangeDash {\n &:before {\n content: '–';\n }\n}\n\n.react-spectrum-Datepicker-segments {\n display: flex;\n align-items: center;\n}\n\n.react-spectrum-Datepicker-literal {\n white-space: pre;\n user-select: none;\n color: var(--spectrum-textfield-text-color);\n}\n\n.react-spectrum-DatePicker-cell {\n border: none;\n background: none;\n padding: 0 2px;\n border-radius: var(--spectrum-alias-border-radius-small);\n font-variant-numeric: tabular-nums;\n text-align: end;\n box-sizing: content-box;\n white-space: nowrap;\n color: var(--spectrum-textfield-text-color);\n\n &::selection {\n /* hide the selection because there is no way to fully prevent it in Firefox */\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1742153 */\n background: transparent;\n }\n}\n\n.react-spectrum-DatePicker-cell.is-placeholder {\n color: var(--spectrum-gray-600);\n\n .react-spectrum-DatePicker-placeholder {\n text-align: center;\n pointer-events: none;\n }\n}\n\n.react-spectrum-DatePicker-cell.is-placeholder ~ .react-spectrum-Datepicker-literal {\n color: var(--spectrum-global-color-gray-600);\n}\n\n.react-spectrum-DatePicker-cell.is-read-only {\n color: var(--spectrum-global-color-gray-700);\n}\n\n.react-spectrum-DatePicker-cell:focus {\n background-color: var(--spectrum-accent-background-color-default);\n color: white;\n caret-color: transparent;\n outline: none;\n}\n\n.react-spectrum-Datepicker-dialog.react-spectrum-Datepicker-dialog {\n width: auto;\n}\n\n.react-spectrum-Datepicker-dialogContent {\n display: flex;\n flex-direction: column;\n\n .react-spectrum-Datepicker-calendar.is-invalid {\n /* Only apply display: contents when the calendar is invalid, which allows us to move the\n * error message below the time fields. Otherwise, don't do this because it breaks dragging\n * the selected range on Android. */\n display: contents;\n }\n\n /* Push the help text within the calendar down to the bottom of the dialog, below the time fields. */\n :global(.spectrum-Calendar-helpText) {\n order: 10;\n margin: var(--spectrum-global-dimension-size-200) var(--spectrum-calendar-day-padding) 0 var(--spectrum-calendar-day-padding);\n }\n}\n\n/* when displayed in a tray, reduce the padding of the dialog */\n@media (max-width: 700px) {\n .react-spectrum-Datepicker-dialog {\n --spectrum-dialog-padding-x: 8px;\n\n .react-spectrum-Datepicker-dialogContent {\n margin: 0 auto;\n max-width: calc((var(--spectrum-calendar-day-width) * 7) + (var(--spectrum-calendar-day-padding) * 12));\n }\n }\n}\n\n.react-spectrum-Datepicker-timeFields {\n width: 100%;\n min-width: calc(var(--spectrum-calendar-day-width) * 7);\n max-width: calc((var(--spectrum-calendar-day-width) * 7) + (var(--spectrum-calendar-day-padding) * 12));\n padding: 0 var(--spectrum-calendar-day-padding);\n box-sizing: border-box;\n}\n\n@media (forced-colors:active) {\n .react-spectrum-DatePicker-cell:focus {\n forced-color-adjust: none;\n background-color: Highlight;\n color: HighlightText;\n }\n .react-spectrum-DatePicker-cell.is-read-only {\n color: ButtonText;\n &:focus {\n color: HighlightText;\n }\n }\n .react-spectrum-DatePicker-cell.is-placeholder {\n color: ButtonText;\n &:focus {\n color: HighlightText;\n }\n }\n}\n"],"names":[],"version":3,"file":"styles.b562cf4b.css.map"}
|
package/dist/styles_css.main.js
CHANGED
|
@@ -18,6 +18,7 @@ $parcel$export(module.exports, "react-spectrum-Datepicker-field", () => $91c3db8
|
|
|
18
18
|
$parcel$export(module.exports, "react-spectrum-Datepicker-fieldWrapper", () => $91c3db8c6a21ca71$export$48501287c6ce4708, (v) => $91c3db8c6a21ca71$export$48501287c6ce4708 = v);
|
|
19
19
|
$parcel$export(module.exports, "react-spectrum-Datepicker-input", () => $91c3db8c6a21ca71$export$4cdb39b006dc840a, (v) => $91c3db8c6a21ca71$export$4cdb39b006dc840a = v);
|
|
20
20
|
$parcel$export(module.exports, "react-spectrum-Datepicker-inputContents", () => $91c3db8c6a21ca71$export$609545772ae0466a, (v) => $91c3db8c6a21ca71$export$609545772ae0466a = v);
|
|
21
|
+
$parcel$export(module.exports, "react-spectrum-Datepicker-inputSized", () => $91c3db8c6a21ca71$export$ebb52994026bc71c, (v) => $91c3db8c6a21ca71$export$ebb52994026bc71c = v);
|
|
21
22
|
$parcel$export(module.exports, "react-spectrum-Datepicker-literal", () => $91c3db8c6a21ca71$export$24a265734c16a355, (v) => $91c3db8c6a21ca71$export$24a265734c16a355 = v);
|
|
22
23
|
$parcel$export(module.exports, "react-spectrum-Datepicker-rangeDash", () => $91c3db8c6a21ca71$export$1ae39afd2cf49425, (v) => $91c3db8c6a21ca71$export$1ae39afd2cf49425 = v);
|
|
23
24
|
$parcel$export(module.exports, "react-spectrum-Datepicker-segments", () => $91c3db8c6a21ca71$export$b9c34f0306ac2ffc, (v) => $91c3db8c6a21ca71$export$b9c34f0306ac2ffc = v);
|
|
@@ -40,6 +41,7 @@ var $91c3db8c6a21ca71$export$8cbece9fb909350d;
|
|
|
40
41
|
var $91c3db8c6a21ca71$export$48501287c6ce4708;
|
|
41
42
|
var $91c3db8c6a21ca71$export$4cdb39b006dc840a;
|
|
42
43
|
var $91c3db8c6a21ca71$export$609545772ae0466a;
|
|
44
|
+
var $91c3db8c6a21ca71$export$ebb52994026bc71c;
|
|
43
45
|
var $91c3db8c6a21ca71$export$24a265734c16a355;
|
|
44
46
|
var $91c3db8c6a21ca71$export$1ae39afd2cf49425;
|
|
45
47
|
var $91c3db8c6a21ca71$export$b9c34f0306ac2ffc;
|
|
@@ -62,6 +64,7 @@ $91c3db8c6a21ca71$export$8cbece9fb909350d = `_2n04KW_react-spectrum-Datepicker-f
|
|
|
62
64
|
$91c3db8c6a21ca71$export$48501287c6ce4708 = `_2n04KW_react-spectrum-Datepicker-fieldWrapper`;
|
|
63
65
|
$91c3db8c6a21ca71$export$4cdb39b006dc840a = `_2n04KW_react-spectrum-Datepicker-input`;
|
|
64
66
|
$91c3db8c6a21ca71$export$609545772ae0466a = `_2n04KW_react-spectrum-Datepicker-inputContents`;
|
|
67
|
+
$91c3db8c6a21ca71$export$ebb52994026bc71c = `_2n04KW_react-spectrum-Datepicker-inputSized`;
|
|
65
68
|
$91c3db8c6a21ca71$export$24a265734c16a355 = `_2n04KW_react-spectrum-Datepicker-literal`;
|
|
66
69
|
$91c3db8c6a21ca71$export$1ae39afd2cf49425 = `_2n04KW_react-spectrum-Datepicker-rangeDash`;
|
|
67
70
|
$91c3db8c6a21ca71$export$b9c34f0306ac2ffc = `_2n04KW_react-spectrum-Datepicker-segments`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAtBA,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAAmC,CAAC,sBAAsB,CAAC;AAC3D,4CAAiC,CAAC,oBAAoB,CAAC;AACvD,4CAA6C,CAAC,gCAAgC,CAAC;AAC/E,4CAAmD,CAAC,sCAAsC,CAAC;AAC3F,4CAAmD,CAAC,sCAAsC,CAAC;AAC3F,4CAA0D,CAAC,6CAA6C,CAAC;AACzG,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAAqD,CAAC,wCAAwC,CAAC;AAC/F,4CAA4D,CAAC,+CAA+C,CAAC;AAC7G,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAAoD,CAAC,uCAAuC,CAAC;AAC7F,4CAA2D,CAAC,8CAA8C,CAAC;AAC3G,4CAAoD,CAAC,uCAAuC,CAAC;AAC7F,4CAA4D,CAAC,+CAA+C,CAAC;AAC7G,4CAAyD,CAAC,4CAA4C,CAAC;AACvG,4CAAsD,CAAC,yCAAyC,CAAC;AACjG,4CAAwD,CAAC,2CAA2C,CAAC;AACrG,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAAyD,CAAC,4CAA4C,CAAC;AACvG,4CAAyD,CAAC,4CAA4C,CAAC;AACvG,4CAA6C,CAAC,gCAAgC,CAAC;AAC/E,4CAA0D,CAAC,6CAA6C,CAAC","sources":["packages/@react-spectrum/datepicker/src/styles.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper {\n width: auto;\n min-width: var(--spectrum-global-dimension-size-2000);\n max-width: 100%;\n }\n\n.react-spectrum-Datepicker-startField {\n width: auto;\n padding-inline-end: var(--spectrum-global-dimension-size-100);\n}\n\n.react-spectrum-Datepicker-endField {\n width: auto;\n flex: 1;\n padding-inline-start: var(--spectrum-global-dimension-size-100);\n}\n\n.react-spectrum-Datepicker-field ~ .react-spectrum-Datepicker-endField > .react-spectrum-Datepicker-input {\n border-inline-start-width: 0;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.react-spectrum-Datepicker-field.react-spectrum-Datepicker-field {\n width: auto;\n}\n\n.react-spectrum-Datepicker-field .react-spectrum-DateField-Input {\n line-height: var(--spectrum-body-4-text-line-height);\n}\n\n/* specificity war with .spectrum-Field--positionSide etc. */\n.react-spectrum-DateField.react-spectrum-DateField.react-spectrum-DateField.react-spectrum-DateField {\n min-width: var(--spectrum-global-dimension-size-2000);\n}\n\n.react-spectrum-TimeField.react-spectrum-TimeField.react-spectrum-TimeField.react-spectrum-TimeField {\n min-width: var(--spectrum-global-dimension-size-1250);\n}\n\n.react-spectrum-TimeField-fieldWrapper.react-spectrum-TimeField-fieldWrapper.react-spectrum-TimeField-fieldWrapper {\n width: auto;\n min-width: var(--spectrum-global-dimension-size-1250);\n}\n\n.react-spectrum-Datepicker-input.react-spectrum-Datepicker-input.react-spectrum-Datepicker-input {\n /* always reserve space for the validation icon */\n padding-inline-end: calc(var(--spectrum-textfield-padding-x) + var(--spectrum-icon-alert-medium-width) + var(--spectrum-textfield-icon-margin-left));\n cursor: text;\n}\n\n.react-spectrum-Datepicker-inputContents {\n display: flex;\n align-items: center;\n height: 100%;\n overflow-x: auto;\n scrollbar-width: none; /* Firefox */\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n\n &::-webkit-scrollbar { /* WebKit */\n width: 0;\n height: 0;\n display: none;\n }\n}\n\n.react-spectrum-Datepicker-inputSized {\n display: flex;\n height: 100%;\n align-items: center;\n}\n\n.react-spectrum-Datepicker-rangeDash {\n &:before {\n content: '–';\n }\n}\n\n.react-spectrum-Datepicker-segments {\n display: flex;\n align-items: center;\n}\n\n.react-spectrum-Datepicker-literal {\n white-space: pre;\n user-select: none;\n color: var(--spectrum-textfield-text-color);\n}\n\n.react-spectrum-DatePicker-cell {\n border: none;\n background: none;\n padding: 0 2px;\n border-radius: var(--spectrum-alias-border-radius-small);\n font-variant-numeric: tabular-nums;\n text-align: end;\n box-sizing: content-box;\n white-space: nowrap;\n color: var(--spectrum-textfield-text-color);\n\n &::selection {\n /* hide the selection because there is no way to fully prevent it in Firefox */\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1742153 */\n background: transparent;\n }\n}\n\n.react-spectrum-DatePicker-cell.is-placeholder {\n color: var(--spectrum-gray-600);\n\n .react-spectrum-DatePicker-placeholder {\n text-align: center;\n pointer-events: none;\n }\n}\n\n.react-spectrum-DatePicker-cell.is-placeholder ~ .react-spectrum-Datepicker-literal {\n color: var(--spectrum-global-color-gray-600);\n}\n\n.react-spectrum-DatePicker-cell.is-read-only {\n color: var(--spectrum-global-color-gray-700);\n}\n\n.react-spectrum-DatePicker-cell:focus {\n background-color: var(--spectrum-accent-background-color-default);\n color: white;\n caret-color: transparent;\n outline: none;\n}\n\n.react-spectrum-Datepicker-dialog.react-spectrum-Datepicker-dialog {\n width: auto;\n}\n\n.react-spectrum-Datepicker-dialogContent {\n display: flex;\n flex-direction: column;\n\n .react-spectrum-Datepicker-calendar.is-invalid {\n /* Only apply display: contents when the calendar is invalid, which allows us to move the\n * error message below the time fields. Otherwise, don't do this because it breaks dragging\n * the selected range on Android. */\n display: contents;\n }\n\n /* Push the help text within the calendar down to the bottom of the dialog, below the time fields. */\n :global(.spectrum-Calendar-helpText) {\n order: 10;\n margin: var(--spectrum-global-dimension-size-200) var(--spectrum-calendar-day-padding) 0 var(--spectrum-calendar-day-padding);\n }\n}\n\n/* when displayed in a tray, reduce the padding of the dialog */\n@media (max-width: 700px) {\n .react-spectrum-Datepicker-dialog {\n --spectrum-dialog-padding-x: 8px;\n\n .react-spectrum-Datepicker-dialogContent {\n margin: 0 auto;\n max-width: calc((var(--spectrum-calendar-day-width) * 7) + (var(--spectrum-calendar-day-padding) * 12));\n }\n }\n}\n\n.react-spectrum-Datepicker-timeFields {\n width: 100%;\n min-width: calc(var(--spectrum-calendar-day-width) * 7);\n max-width: calc((var(--spectrum-calendar-day-width) * 7) + (var(--spectrum-calendar-day-padding) * 12));\n padding: 0 var(--spectrum-calendar-day-padding);\n box-sizing: border-box;\n}\n\n@media (forced-colors:active) {\n .react-spectrum-DatePicker-cell:focus {\n forced-color-adjust: none;\n background-color: Highlight;\n color: HighlightText;\n }\n .react-spectrum-DatePicker-cell.is-read-only {\n color: ButtonText;\n &:focus {\n color: HighlightText;\n }\n }\n .react-spectrum-DatePicker-cell.is-placeholder {\n color: ButtonText;\n &:focus {\n color: HighlightText;\n }\n }\n}\n"],"names":[],"version":3,"file":"styles_css.main.js.map"}
|
package/dist/styles_css.mjs
CHANGED
|
@@ -19,6 +19,7 @@ $parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-field", ()
|
|
|
19
19
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-fieldWrapper", () => $465eb3a688ef3440$export$48501287c6ce4708, (v) => $465eb3a688ef3440$export$48501287c6ce4708 = v);
|
|
20
20
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-input", () => $465eb3a688ef3440$export$4cdb39b006dc840a, (v) => $465eb3a688ef3440$export$4cdb39b006dc840a = v);
|
|
21
21
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-inputContents", () => $465eb3a688ef3440$export$609545772ae0466a, (v) => $465eb3a688ef3440$export$609545772ae0466a = v);
|
|
22
|
+
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-inputSized", () => $465eb3a688ef3440$export$ebb52994026bc71c, (v) => $465eb3a688ef3440$export$ebb52994026bc71c = v);
|
|
22
23
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-literal", () => $465eb3a688ef3440$export$24a265734c16a355, (v) => $465eb3a688ef3440$export$24a265734c16a355 = v);
|
|
23
24
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-rangeDash", () => $465eb3a688ef3440$export$1ae39afd2cf49425, (v) => $465eb3a688ef3440$export$1ae39afd2cf49425 = v);
|
|
24
25
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-segments", () => $465eb3a688ef3440$export$b9c34f0306ac2ffc, (v) => $465eb3a688ef3440$export$b9c34f0306ac2ffc = v);
|
|
@@ -41,6 +42,7 @@ var $465eb3a688ef3440$export$8cbece9fb909350d;
|
|
|
41
42
|
var $465eb3a688ef3440$export$48501287c6ce4708;
|
|
42
43
|
var $465eb3a688ef3440$export$4cdb39b006dc840a;
|
|
43
44
|
var $465eb3a688ef3440$export$609545772ae0466a;
|
|
45
|
+
var $465eb3a688ef3440$export$ebb52994026bc71c;
|
|
44
46
|
var $465eb3a688ef3440$export$24a265734c16a355;
|
|
45
47
|
var $465eb3a688ef3440$export$1ae39afd2cf49425;
|
|
46
48
|
var $465eb3a688ef3440$export$b9c34f0306ac2ffc;
|
|
@@ -63,6 +65,7 @@ $465eb3a688ef3440$export$8cbece9fb909350d = `_2n04KW_react-spectrum-Datepicker-f
|
|
|
63
65
|
$465eb3a688ef3440$export$48501287c6ce4708 = `_2n04KW_react-spectrum-Datepicker-fieldWrapper`;
|
|
64
66
|
$465eb3a688ef3440$export$4cdb39b006dc840a = `_2n04KW_react-spectrum-Datepicker-input`;
|
|
65
67
|
$465eb3a688ef3440$export$609545772ae0466a = `_2n04KW_react-spectrum-Datepicker-inputContents`;
|
|
68
|
+
$465eb3a688ef3440$export$ebb52994026bc71c = `_2n04KW_react-spectrum-Datepicker-inputSized`;
|
|
66
69
|
$465eb3a688ef3440$export$24a265734c16a355 = `_2n04KW_react-spectrum-Datepicker-literal`;
|
|
67
70
|
$465eb3a688ef3440$export$1ae39afd2cf49425 = `_2n04KW_react-spectrum-Datepicker-rangeDash`;
|
|
68
71
|
$465eb3a688ef3440$export$b9c34f0306ac2ffc = `_2n04KW_react-spectrum-Datepicker-segments`;
|
|
@@ -19,6 +19,7 @@ $parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-field", ()
|
|
|
19
19
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-fieldWrapper", () => $465eb3a688ef3440$export$48501287c6ce4708, (v) => $465eb3a688ef3440$export$48501287c6ce4708 = v);
|
|
20
20
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-input", () => $465eb3a688ef3440$export$4cdb39b006dc840a, (v) => $465eb3a688ef3440$export$4cdb39b006dc840a = v);
|
|
21
21
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-inputContents", () => $465eb3a688ef3440$export$609545772ae0466a, (v) => $465eb3a688ef3440$export$609545772ae0466a = v);
|
|
22
|
+
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-inputSized", () => $465eb3a688ef3440$export$ebb52994026bc71c, (v) => $465eb3a688ef3440$export$ebb52994026bc71c = v);
|
|
22
23
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-literal", () => $465eb3a688ef3440$export$24a265734c16a355, (v) => $465eb3a688ef3440$export$24a265734c16a355 = v);
|
|
23
24
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-rangeDash", () => $465eb3a688ef3440$export$1ae39afd2cf49425, (v) => $465eb3a688ef3440$export$1ae39afd2cf49425 = v);
|
|
24
25
|
$parcel$export($465eb3a688ef3440$exports, "react-spectrum-Datepicker-segments", () => $465eb3a688ef3440$export$b9c34f0306ac2ffc, (v) => $465eb3a688ef3440$export$b9c34f0306ac2ffc = v);
|
|
@@ -41,6 +42,7 @@ var $465eb3a688ef3440$export$8cbece9fb909350d;
|
|
|
41
42
|
var $465eb3a688ef3440$export$48501287c6ce4708;
|
|
42
43
|
var $465eb3a688ef3440$export$4cdb39b006dc840a;
|
|
43
44
|
var $465eb3a688ef3440$export$609545772ae0466a;
|
|
45
|
+
var $465eb3a688ef3440$export$ebb52994026bc71c;
|
|
44
46
|
var $465eb3a688ef3440$export$24a265734c16a355;
|
|
45
47
|
var $465eb3a688ef3440$export$1ae39afd2cf49425;
|
|
46
48
|
var $465eb3a688ef3440$export$b9c34f0306ac2ffc;
|
|
@@ -63,6 +65,7 @@ $465eb3a688ef3440$export$8cbece9fb909350d = `_2n04KW_react-spectrum-Datepicker-f
|
|
|
63
65
|
$465eb3a688ef3440$export$48501287c6ce4708 = `_2n04KW_react-spectrum-Datepicker-fieldWrapper`;
|
|
64
66
|
$465eb3a688ef3440$export$4cdb39b006dc840a = `_2n04KW_react-spectrum-Datepicker-input`;
|
|
65
67
|
$465eb3a688ef3440$export$609545772ae0466a = `_2n04KW_react-spectrum-Datepicker-inputContents`;
|
|
68
|
+
$465eb3a688ef3440$export$ebb52994026bc71c = `_2n04KW_react-spectrum-Datepicker-inputSized`;
|
|
66
69
|
$465eb3a688ef3440$export$24a265734c16a355 = `_2n04KW_react-spectrum-Datepicker-literal`;
|
|
67
70
|
$465eb3a688ef3440$export$1ae39afd2cf49425 = `_2n04KW_react-spectrum-Datepicker-rangeDash`;
|
|
68
71
|
$465eb3a688ef3440$export$b9c34f0306ac2ffc = `_2n04KW_react-spectrum-Datepicker-segments`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAtBA,4CAA+B,CAAC,kBAAkB,CAAC;AACnD,4CAAmC,CAAC,sBAAsB,CAAC;AAC3D,4CAAiC,CAAC,oBAAoB,CAAC;AACvD,4CAA6C,CAAC,gCAAgC,CAAC;AAC/E,4CAAmD,CAAC,sCAAsC,CAAC;AAC3F,4CAAmD,CAAC,sCAAsC,CAAC;AAC3F,4CAA0D,CAAC,6CAA6C,CAAC;AACzG,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAAqD,CAAC,wCAAwC,CAAC;AAC/F,4CAA4D,CAAC,+CAA+C,CAAC;AAC7G,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAAoD,CAAC,uCAAuC,CAAC;AAC7F,4CAA2D,CAAC,8CAA8C,CAAC;AAC3G,4CAAoD,CAAC,uCAAuC,CAAC;AAC7F,4CAA4D,CAAC,+CAA+C,CAAC;AAC7G,4CAAyD,CAAC,4CAA4C,CAAC;AACvG,4CAAsD,CAAC,yCAAyC,CAAC;AACjG,4CAAwD,CAAC,2CAA2C,CAAC;AACrG,4CAAuD,CAAC,0CAA0C,CAAC;AACnG,4CAAyD,CAAC,4CAA4C,CAAC;AACvG,4CAAyD,CAAC,4CAA4C,CAAC;AACvG,4CAA6C,CAAC,gCAAgC,CAAC;AAC/E,4CAA0D,CAAC,6CAA6C,CAAC","sources":["packages/@react-spectrum/datepicker/src/styles.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper.react-spectrum-Datepicker-fieldWrapper {\n width: auto;\n min-width: var(--spectrum-global-dimension-size-2000);\n max-width: 100%;\n }\n\n.react-spectrum-Datepicker-startField {\n width: auto;\n padding-inline-end: var(--spectrum-global-dimension-size-100);\n}\n\n.react-spectrum-Datepicker-endField {\n width: auto;\n flex: 1;\n padding-inline-start: var(--spectrum-global-dimension-size-100);\n}\n\n.react-spectrum-Datepicker-field ~ .react-spectrum-Datepicker-endField > .react-spectrum-Datepicker-input {\n border-inline-start-width: 0;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.react-spectrum-Datepicker-field.react-spectrum-Datepicker-field {\n width: auto;\n}\n\n.react-spectrum-Datepicker-field .react-spectrum-DateField-Input {\n line-height: var(--spectrum-body-4-text-line-height);\n}\n\n/* specificity war with .spectrum-Field--positionSide etc. */\n.react-spectrum-DateField.react-spectrum-DateField.react-spectrum-DateField.react-spectrum-DateField {\n min-width: var(--spectrum-global-dimension-size-2000);\n}\n\n.react-spectrum-TimeField.react-spectrum-TimeField.react-spectrum-TimeField.react-spectrum-TimeField {\n min-width: var(--spectrum-global-dimension-size-1250);\n}\n\n.react-spectrum-TimeField-fieldWrapper.react-spectrum-TimeField-fieldWrapper.react-spectrum-TimeField-fieldWrapper {\n width: auto;\n min-width: var(--spectrum-global-dimension-size-1250);\n}\n\n.react-spectrum-Datepicker-input.react-spectrum-Datepicker-input.react-spectrum-Datepicker-input {\n /* always reserve space for the validation icon */\n padding-inline-end: calc(var(--spectrum-textfield-padding-x) + var(--spectrum-icon-alert-medium-width) + var(--spectrum-textfield-icon-margin-left));\n cursor: text;\n}\n\n.react-spectrum-Datepicker-inputContents {\n display: flex;\n align-items: center;\n height: 100%;\n overflow-x: auto;\n scrollbar-width: none; /* Firefox */\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n\n &::-webkit-scrollbar { /* WebKit */\n width: 0;\n height: 0;\n display: none;\n }\n}\n\n.react-spectrum-Datepicker-inputSized {\n display: flex;\n height: 100%;\n align-items: center;\n}\n\n.react-spectrum-Datepicker-rangeDash {\n &:before {\n content: '–';\n }\n}\n\n.react-spectrum-Datepicker-segments {\n display: flex;\n align-items: center;\n}\n\n.react-spectrum-Datepicker-literal {\n white-space: pre;\n user-select: none;\n color: var(--spectrum-textfield-text-color);\n}\n\n.react-spectrum-DatePicker-cell {\n border: none;\n background: none;\n padding: 0 2px;\n border-radius: var(--spectrum-alias-border-radius-small);\n font-variant-numeric: tabular-nums;\n text-align: end;\n box-sizing: content-box;\n white-space: nowrap;\n color: var(--spectrum-textfield-text-color);\n\n &::selection {\n /* hide the selection because there is no way to fully prevent it in Firefox */\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1742153 */\n background: transparent;\n }\n}\n\n.react-spectrum-DatePicker-cell.is-placeholder {\n color: var(--spectrum-gray-600);\n\n .react-spectrum-DatePicker-placeholder {\n text-align: center;\n pointer-events: none;\n }\n}\n\n.react-spectrum-DatePicker-cell.is-placeholder ~ .react-spectrum-Datepicker-literal {\n color: var(--spectrum-global-color-gray-600);\n}\n\n.react-spectrum-DatePicker-cell.is-read-only {\n color: var(--spectrum-global-color-gray-700);\n}\n\n.react-spectrum-DatePicker-cell:focus {\n background-color: var(--spectrum-accent-background-color-default);\n color: white;\n caret-color: transparent;\n outline: none;\n}\n\n.react-spectrum-Datepicker-dialog.react-spectrum-Datepicker-dialog {\n width: auto;\n}\n\n.react-spectrum-Datepicker-dialogContent {\n display: flex;\n flex-direction: column;\n\n .react-spectrum-Datepicker-calendar.is-invalid {\n /* Only apply display: contents when the calendar is invalid, which allows us to move the\n * error message below the time fields. Otherwise, don't do this because it breaks dragging\n * the selected range on Android. */\n display: contents;\n }\n\n /* Push the help text within the calendar down to the bottom of the dialog, below the time fields. */\n :global(.spectrum-Calendar-helpText) {\n order: 10;\n margin: var(--spectrum-global-dimension-size-200) var(--spectrum-calendar-day-padding) 0 var(--spectrum-calendar-day-padding);\n }\n}\n\n/* when displayed in a tray, reduce the padding of the dialog */\n@media (max-width: 700px) {\n .react-spectrum-Datepicker-dialog {\n --spectrum-dialog-padding-x: 8px;\n\n .react-spectrum-Datepicker-dialogContent {\n margin: 0 auto;\n max-width: calc((var(--spectrum-calendar-day-width) * 7) + (var(--spectrum-calendar-day-padding) * 12));\n }\n }\n}\n\n.react-spectrum-Datepicker-timeFields {\n width: 100%;\n min-width: calc(var(--spectrum-calendar-day-width) * 7);\n max-width: calc((var(--spectrum-calendar-day-width) * 7) + (var(--spectrum-calendar-day-padding) * 12));\n padding: 0 var(--spectrum-calendar-day-padding);\n box-sizing: border-box;\n}\n\n@media (forced-colors:active) {\n .react-spectrum-DatePicker-cell:focus {\n forced-color-adjust: none;\n background-color: Highlight;\n color: HighlightText;\n }\n .react-spectrum-DatePicker-cell.is-read-only {\n color: ButtonText;\n &:focus {\n color: HighlightText;\n }\n }\n .react-spectrum-DatePicker-cell.is-placeholder {\n color: ButtonText;\n &:focus {\n color: HighlightText;\n }\n }\n}\n"],"names":[],"version":3,"file":"styles_css.module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;
|
|
1
|
+
{"mappings":";;;AI6FA;;;GAGG;AACH,OAAA,MAAM,WAA4C,CAAC,CAAmB,SAAT,SAAS,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,aAAa,WAAW,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;ACkG9J;;GAEG;AACH,OAAA,MAAM,YAA8C,CAAC,CAAmB,SAAT,SAAS,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,aAAa,WAAW,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;ACgCjK;;;GAGG;AACH,OAAA,MAAM,iBAAwD,CAAC,CAAmB,SAAT,SAAS,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,aAAa,WAAW,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;ACnIhL;;;GAGG;AACH,OAAA,MAAM,WAA4C,CAAC,CAAmB,SAAT,SAAS,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,aAAa,WAAW,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;ACzF9J,YAAY,EAAC,sBAAsB,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC","sources":["packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/DatePickerSegment.tsx","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/DatePickerField.tsx","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/Input.tsx","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/utils.ts","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/TimeField.tsx","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/DatePicker.tsx","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/DateRangePicker.tsx","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/DateField.tsx","packages/@react-spectrum/datepicker/src/packages/@react-spectrum/datepicker/src/index.ts","packages/@react-spectrum/datepicker/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {DatePicker} from './DatePicker';\nexport {DateRangePicker} from './DateRangePicker';\nexport {TimeField} from './TimeField';\nexport {DateField} from './DateField';\nexport type {SpectrumDateFieldProps, SpectrumDatePickerProps, SpectrumDateRangePickerProps, SpectrumTimeFieldProps} from '@react-types/datepicker';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/dist/utils.main.js
CHANGED
|
@@ -14,6 +14,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
14
14
|
$parcel$export(module.exports, "useFormatHelpText", () => $4d2e419f522adb48$export$322f4580ccd8dde6);
|
|
15
15
|
$parcel$export(module.exports, "useVisibleMonths", () => $4d2e419f522adb48$export$12ce2869ce471b1f);
|
|
16
16
|
$parcel$export(module.exports, "useFocusManagerRef", () => $4d2e419f522adb48$export$71a23a36270e4bf0);
|
|
17
|
+
$parcel$export(module.exports, "useFormattedDateWidth", () => $4d2e419f522adb48$export$31e22e3c931fc056);
|
|
17
18
|
/*
|
|
18
19
|
* Copyright 2020 Adobe. All rights reserved.
|
|
19
20
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -73,7 +74,7 @@ function $4d2e419f522adb48$var$getVisibleMonths(scale) {
|
|
|
73
74
|
return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
|
|
74
75
|
}
|
|
75
76
|
function $4d2e419f522adb48$export$71a23a36270e4bf0(ref) {
|
|
76
|
-
let domRef = (0, $61dVa$react.useRef)();
|
|
77
|
+
let domRef = (0, $61dVa$react.useRef)(undefined);
|
|
77
78
|
(0, $61dVa$react.useImperativeHandle)(ref, ()=>({
|
|
78
79
|
...(0, $61dVa$reactspectrumutils.createDOMRef)(domRef),
|
|
79
80
|
focus () {
|
|
@@ -84,6 +85,20 @@ function $4d2e419f522adb48$export$71a23a36270e4bf0(ref) {
|
|
|
84
85
|
}));
|
|
85
86
|
return domRef;
|
|
86
87
|
}
|
|
88
|
+
function $4d2e419f522adb48$export$31e22e3c931fc056(state) {
|
|
89
|
+
var _useLocale;
|
|
90
|
+
let locale = (_useLocale = (0, $61dVa$reactariai18n.useLocale)()) === null || _useLocale === void 0 ? void 0 : _useLocale.locale;
|
|
91
|
+
let currentDate = new Date();
|
|
92
|
+
let formatedDate = state.getDateFormatter(locale, {
|
|
93
|
+
shouldForceLeadingZeros: true
|
|
94
|
+
}).format(currentDate, locale);
|
|
95
|
+
let totalCharacters = formatedDate.length;
|
|
96
|
+
// The max of two is for times with only hours.
|
|
97
|
+
// As the length of a date grows we need to proportionally increase the width.
|
|
98
|
+
// We use the character count with 'ch' units and add extra padding to accomate for
|
|
99
|
+
// dates with months and time dashes, which are wider characters.
|
|
100
|
+
return totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2);
|
|
101
|
+
}
|
|
87
102
|
|
|
88
103
|
|
|
89
104
|
//# sourceMappingURL=utils.main.js.map
|
package/dist/utils.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAWM,SAAS,0CAAkB,KAA8E;IAC9G,IAAI,YAAY,CAAA,GAAA,qCAAe,EAAE;QAAC,WAAW;IAAO;IACpD,IAAI,eAAe,CAAA,GAAA,0CAAc;IACjC,OAAO,CAAA,GAAA,oBAAM,EAAE;QACb,IAAI,MAAM,WAAW,EACnB,OAAO,MAAM,WAAW;QAG1B,IAAI,MAAM,kBAAkB,EAC1B,OAAO,UAAU,aAAa,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;YAC7C,IAAI,EAAE,IAAI,KAAK,WACb,OAAO,EAAE,KAAK;YAGhB,OAAO,aAAa,EAAE,CAAC,EAAE,IAAI;QAC/B,GAAG,IAAI,CAAC;QAGV,OAAO;IACT,GAAG;QAAC,MAAM,WAAW;QAAE,MAAM,kBAAkB;QAAE;QAAW;KAAa;AAC3E;AAEO,SAAS,0CAAiB,gBAAwB;IACvD,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,wCAAU;IACxB,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,qBAAO,EAAE,uCAAiB;IAClE,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,WAAW,IAAM,iBAAiB,uCAAiB;QACvD;QAEA,OAAO,gBAAgB,CAAC,UAAU;QAClC,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU;QACvC;IACF,GAAG;QAAC;KAAM;IAEV,OAAO,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,eAAe,kBAAkB;AAC/D;AAEA,SAAS,uCAAiB,KAAK;IAC7B,IAAI,OAAO,WAAW,aACpB,OAAO;IAET,IAAI,aAAa,UAAU,UAAU,MAAM;IAC3C,IAAI,MAAM,UAAU,UAAU,KAAK;IACnC,IAAI,iBAAiB,UAAU,UAAU,KAAK;IAC9C,OAAO,KAAK,KAAK,CAAC,AAAC,CAAA,OAAO,UAAU,GAAG,iBAAiB,CAAA,IAAM,CAAA,aAAa,GAAE;AAC/E;AAEO,SAAS,0CAAmB,GAA8B;IAC/D,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAE;IACpB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAO,CAAA;YAC9B,GAAG,CAAA,GAAA,sCAAW,EAAE,OAAO;YACvB;gBACE,CAAA,GAAA,wCAAiB,EAAE,QAAQ,UAAU,CAAC;oBAAC,UAAU;gBAAI;YACvD;QACF,CAAA;IACA,OAAO;AACT;AAEO,SAAS,0CAAsB,KAAK;QAC5B;IAAb,IAAI,UAAS,aAAA,CAAA,GAAA,8BAAQ,iBAAR,iCAAA,WAAa,MAAM;IAChC,IAAI,cAAc,IAAI;IACtB,IAAI,eAAe,MAAM,gBAAgB,CAAC,QAAQ;QAAC,yBAAyB;IAAI,GAAG,MAAM,CAAC,aAAa;IACvG,IAAI,kBAAmB,aAAa,MAAM;IAE1C,+CAA+C;IAC/C,8EAA8E;IAC9E,mFAAmF;IACnF,iEAAiE;IACjE,OAAQ,kBAAkB,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,kBAAkB,IAAI;AACtE","sources":["packages/@react-spectrum/datepicker/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {createFocusManager} from '@react-aria/focus';\nimport {FocusableRef} from '@react-types/shared';\nimport {SpectrumDatePickerBase} from '@react-types/datepicker';\nimport {useDateFormatter, useLocale} from '@react-aria/i18n';\nimport {useDisplayNames} from '@react-aria/datepicker';\nimport {useImperativeHandle, useMemo, useRef, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport function useFormatHelpText(props: Pick<SpectrumDatePickerBase<any>, 'description' | 'showFormatHelpText'>) {\n let formatter = useDateFormatter({dateStyle: 'short'});\n let displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.description) {\n return props.description;\n }\n\n if (props.showFormatHelpText) {\n return formatter.formatToParts(new Date()).map(s => {\n if (s.type === 'literal') {\n return s.value;\n }\n\n return displayNames.of(s.type);\n }).join(' ');\n }\n\n return '';\n }, [props.description, props.showFormatHelpText, formatter, displayNames]);\n}\n\nexport function useVisibleMonths(maxVisibleMonths: number) {\n let {scale} = useProvider();\n let [visibleMonths, setVisibleMonths] = useState(getVisibleMonths(scale));\n useLayoutEffect(() => {\n let onResize = () => setVisibleMonths(getVisibleMonths(scale));\n onResize();\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [scale]);\n\n return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));\n}\n\nfunction getVisibleMonths(scale) {\n if (typeof window === 'undefined') {\n return 1;\n }\n let monthWidth = scale === 'large' ? 336 : 280;\n let gap = scale === 'large' ? 30 : 24;\n let popoverPadding = scale === 'large' ? 32 : 48;\n return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));\n}\n\nexport function useFocusManagerRef(ref: FocusableRef<HTMLElement>) {\n let domRef = useRef(undefined);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n createFocusManager(domRef).focusFirst({tabbable: true});\n }\n }));\n return domRef;\n}\n\nexport function useFormattedDateWidth(state) {\n let locale = useLocale()?.locale;\n let currentDate = new Date();\n let formatedDate = state.getDateFormatter(locale, {shouldForceLeadingZeros: true}).format(currentDate, locale);\n let totalCharacters = formatedDate.length;\n\n // The max of two is for times with only hours.\n // As the length of a date grows we need to proportionally increase the width.\n // We use the character count with 'ch' units and add extra padding to accomate for\n // dates with months and time dashes, which are wider characters.\n return (totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2));\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
|
package/dist/utils.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createDOMRef as $d7JPl$createDOMRef} from "@react-spectrum/utils";
|
|
2
2
|
import {createFocusManager as $d7JPl$createFocusManager} from "@react-aria/focus";
|
|
3
|
-
import {useDateFormatter as $d7JPl$useDateFormatter} from "@react-aria/i18n";
|
|
3
|
+
import {useDateFormatter as $d7JPl$useDateFormatter, useLocale as $d7JPl$useLocale} from "@react-aria/i18n";
|
|
4
4
|
import {useDisplayNames as $d7JPl$useDisplayNames} from "@react-aria/datepicker";
|
|
5
5
|
import {useMemo as $d7JPl$useMemo, useState as $d7JPl$useState, useRef as $d7JPl$useRef, useImperativeHandle as $d7JPl$useImperativeHandle} from "react";
|
|
6
6
|
import {useLayoutEffect as $d7JPl$useLayoutEffect} from "@react-aria/utils";
|
|
@@ -65,7 +65,7 @@ function $04e96200274b03de$var$getVisibleMonths(scale) {
|
|
|
65
65
|
return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
|
|
66
66
|
}
|
|
67
67
|
function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
68
|
-
let domRef = (0, $d7JPl$useRef)();
|
|
68
|
+
let domRef = (0, $d7JPl$useRef)(undefined);
|
|
69
69
|
(0, $d7JPl$useImperativeHandle)(ref, ()=>({
|
|
70
70
|
...(0, $d7JPl$createDOMRef)(domRef),
|
|
71
71
|
focus () {
|
|
@@ -76,7 +76,21 @@ function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
|
76
76
|
}));
|
|
77
77
|
return domRef;
|
|
78
78
|
}
|
|
79
|
+
function $04e96200274b03de$export$31e22e3c931fc056(state) {
|
|
80
|
+
var _useLocale;
|
|
81
|
+
let locale = (_useLocale = (0, $d7JPl$useLocale)()) === null || _useLocale === void 0 ? void 0 : _useLocale.locale;
|
|
82
|
+
let currentDate = new Date();
|
|
83
|
+
let formatedDate = state.getDateFormatter(locale, {
|
|
84
|
+
shouldForceLeadingZeros: true
|
|
85
|
+
}).format(currentDate, locale);
|
|
86
|
+
let totalCharacters = formatedDate.length;
|
|
87
|
+
// The max of two is for times with only hours.
|
|
88
|
+
// As the length of a date grows we need to proportionally increase the width.
|
|
89
|
+
// We use the character count with 'ch' units and add extra padding to accomate for
|
|
90
|
+
// dates with months and time dashes, which are wider characters.
|
|
91
|
+
return totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2);
|
|
92
|
+
}
|
|
79
93
|
|
|
80
94
|
|
|
81
|
-
export {$04e96200274b03de$export$322f4580ccd8dde6 as useFormatHelpText, $04e96200274b03de$export$12ce2869ce471b1f as useVisibleMonths, $04e96200274b03de$export$71a23a36270e4bf0 as useFocusManagerRef};
|
|
95
|
+
export {$04e96200274b03de$export$322f4580ccd8dde6 as useFormatHelpText, $04e96200274b03de$export$12ce2869ce471b1f as useVisibleMonths, $04e96200274b03de$export$71a23a36270e4bf0 as useFocusManagerRef, $04e96200274b03de$export$31e22e3c931fc056 as useFormattedDateWidth};
|
|
82
96
|
//# sourceMappingURL=utils.module.js.map
|
package/dist/utils.module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createDOMRef as $d7JPl$createDOMRef} from "@react-spectrum/utils";
|
|
2
2
|
import {createFocusManager as $d7JPl$createFocusManager} from "@react-aria/focus";
|
|
3
|
-
import {useDateFormatter as $d7JPl$useDateFormatter} from "@react-aria/i18n";
|
|
3
|
+
import {useDateFormatter as $d7JPl$useDateFormatter, useLocale as $d7JPl$useLocale} from "@react-aria/i18n";
|
|
4
4
|
import {useDisplayNames as $d7JPl$useDisplayNames} from "@react-aria/datepicker";
|
|
5
5
|
import {useMemo as $d7JPl$useMemo, useState as $d7JPl$useState, useRef as $d7JPl$useRef, useImperativeHandle as $d7JPl$useImperativeHandle} from "react";
|
|
6
6
|
import {useLayoutEffect as $d7JPl$useLayoutEffect} from "@react-aria/utils";
|
|
@@ -65,7 +65,7 @@ function $04e96200274b03de$var$getVisibleMonths(scale) {
|
|
|
65
65
|
return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
|
|
66
66
|
}
|
|
67
67
|
function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
68
|
-
let domRef = (0, $d7JPl$useRef)();
|
|
68
|
+
let domRef = (0, $d7JPl$useRef)(undefined);
|
|
69
69
|
(0, $d7JPl$useImperativeHandle)(ref, ()=>({
|
|
70
70
|
...(0, $d7JPl$createDOMRef)(domRef),
|
|
71
71
|
focus () {
|
|
@@ -76,7 +76,21 @@ function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
|
|
|
76
76
|
}));
|
|
77
77
|
return domRef;
|
|
78
78
|
}
|
|
79
|
+
function $04e96200274b03de$export$31e22e3c931fc056(state) {
|
|
80
|
+
var _useLocale;
|
|
81
|
+
let locale = (_useLocale = (0, $d7JPl$useLocale)()) === null || _useLocale === void 0 ? void 0 : _useLocale.locale;
|
|
82
|
+
let currentDate = new Date();
|
|
83
|
+
let formatedDate = state.getDateFormatter(locale, {
|
|
84
|
+
shouldForceLeadingZeros: true
|
|
85
|
+
}).format(currentDate, locale);
|
|
86
|
+
let totalCharacters = formatedDate.length;
|
|
87
|
+
// The max of two is for times with only hours.
|
|
88
|
+
// As the length of a date grows we need to proportionally increase the width.
|
|
89
|
+
// We use the character count with 'ch' units and add extra padding to accomate for
|
|
90
|
+
// dates with months and time dashes, which are wider characters.
|
|
91
|
+
return totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2);
|
|
92
|
+
}
|
|
79
93
|
|
|
80
94
|
|
|
81
|
-
export {$04e96200274b03de$export$322f4580ccd8dde6 as useFormatHelpText, $04e96200274b03de$export$12ce2869ce471b1f as useVisibleMonths, $04e96200274b03de$export$71a23a36270e4bf0 as useFocusManagerRef};
|
|
95
|
+
export {$04e96200274b03de$export$322f4580ccd8dde6 as useFormatHelpText, $04e96200274b03de$export$12ce2869ce471b1f as useVisibleMonths, $04e96200274b03de$export$71a23a36270e4bf0 as useFocusManagerRef, $04e96200274b03de$export$31e22e3c931fc056 as useFormattedDateWidth};
|
|
82
96
|
//# sourceMappingURL=utils.module.js.map
|
package/dist/utils.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAWM,SAAS,0CAAkB,KAA8E;IAC9G,IAAI,YAAY,CAAA,GAAA,uBAAe,EAAE;QAAC,WAAW;IAAO;IACpD,IAAI,eAAe,CAAA,GAAA,sBAAc;IACjC,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,IAAI,MAAM,WAAW,EACnB,OAAO,MAAM,WAAW;QAG1B,IAAI,MAAM,kBAAkB,EAC1B,OAAO,UAAU,aAAa,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;YAC7C,IAAI,EAAE,IAAI,KAAK,WACb,OAAO,EAAE,KAAK;YAGhB,OAAO,aAAa,EAAE,CAAC,EAAE,IAAI;QAC/B,GAAG,IAAI,CAAC;QAGV,OAAO;IACT,GAAG;QAAC,MAAM,WAAW;QAAE,MAAM,kBAAkB;QAAE;QAAW;KAAa;AAC3E;AAEO,SAAS,0CAAiB,gBAAwB;IACvD,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU;IACxB,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,eAAO,EAAE,uCAAiB;IAClE,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,WAAW,IAAM,iBAAiB,uCAAiB;QACvD;QAEA,OAAO,gBAAgB,CAAC,UAAU;QAClC,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU;QACvC;IACF,GAAG;QAAC;KAAM;IAEV,OAAO,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,eAAe,kBAAkB;AAC/D;AAEA,SAAS,uCAAiB,KAAK;IAC7B,IAAI,OAAO,WAAW,aACpB,OAAO;IAET,IAAI,aAAa,UAAU,UAAU,MAAM;IAC3C,IAAI,MAAM,UAAU,UAAU,KAAK;IACnC,IAAI,iBAAiB,UAAU,UAAU,KAAK;IAC9C,OAAO,KAAK,KAAK,CAAC,AAAC,CAAA,OAAO,UAAU,GAAG,iBAAiB,CAAA,IAAM,CAAA,aAAa,GAAE;AAC/E;AAEO,SAAS,0CAAmB,GAA8B;IAC/D,IAAI,SAAS,CAAA,GAAA,aAAK;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAWM,SAAS,0CAAkB,KAA8E;IAC9G,IAAI,YAAY,CAAA,GAAA,uBAAe,EAAE;QAAC,WAAW;IAAO;IACpD,IAAI,eAAe,CAAA,GAAA,sBAAc;IACjC,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,IAAI,MAAM,WAAW,EACnB,OAAO,MAAM,WAAW;QAG1B,IAAI,MAAM,kBAAkB,EAC1B,OAAO,UAAU,aAAa,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;YAC7C,IAAI,EAAE,IAAI,KAAK,WACb,OAAO,EAAE,KAAK;YAGhB,OAAO,aAAa,EAAE,CAAC,EAAE,IAAI;QAC/B,GAAG,IAAI,CAAC;QAGV,OAAO;IACT,GAAG;QAAC,MAAM,WAAW;QAAE,MAAM,kBAAkB;QAAE;QAAW;KAAa;AAC3E;AAEO,SAAS,0CAAiB,gBAAwB;IACvD,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU;IACxB,IAAI,CAAC,eAAe,iBAAiB,GAAG,CAAA,GAAA,eAAO,EAAE,uCAAiB;IAClE,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,WAAW,IAAM,iBAAiB,uCAAiB;QACvD;QAEA,OAAO,gBAAgB,CAAC,UAAU;QAClC,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU;QACvC;IACF,GAAG;QAAC;KAAM;IAEV,OAAO,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,eAAe,kBAAkB;AAC/D;AAEA,SAAS,uCAAiB,KAAK;IAC7B,IAAI,OAAO,WAAW,aACpB,OAAO;IAET,IAAI,aAAa,UAAU,UAAU,MAAM;IAC3C,IAAI,MAAM,UAAU,UAAU,KAAK;IACnC,IAAI,iBAAiB,UAAU,UAAU,KAAK;IAC9C,OAAO,KAAK,KAAK,CAAC,AAAC,CAAA,OAAO,UAAU,GAAG,iBAAiB,CAAA,IAAM,CAAA,aAAa,GAAE;AAC/E;AAEO,SAAS,0CAAmB,GAA8B;IAC/D,IAAI,SAAS,CAAA,GAAA,aAAK,EAAE;IACpB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAO,CAAA;YAC9B,GAAG,CAAA,GAAA,mBAAW,EAAE,OAAO;YACvB;gBACE,CAAA,GAAA,yBAAiB,EAAE,QAAQ,UAAU,CAAC;oBAAC,UAAU;gBAAI;YACvD;QACF,CAAA;IACA,OAAO;AACT;AAEO,SAAS,0CAAsB,KAAK;QAC5B;IAAb,IAAI,UAAS,aAAA,CAAA,GAAA,gBAAQ,iBAAR,iCAAA,WAAa,MAAM;IAChC,IAAI,cAAc,IAAI;IACtB,IAAI,eAAe,MAAM,gBAAgB,CAAC,QAAQ;QAAC,yBAAyB;IAAI,GAAG,MAAM,CAAC,aAAa;IACvG,IAAI,kBAAmB,aAAa,MAAM;IAE1C,+CAA+C;IAC/C,8EAA8E;IAC9E,mFAAmF;IACnF,iEAAiE;IACjE,OAAQ,kBAAkB,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,kBAAkB,IAAI;AACtE","sources":["packages/@react-spectrum/datepicker/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {createFocusManager} from '@react-aria/focus';\nimport {FocusableRef} from '@react-types/shared';\nimport {SpectrumDatePickerBase} from '@react-types/datepicker';\nimport {useDateFormatter, useLocale} from '@react-aria/i18n';\nimport {useDisplayNames} from '@react-aria/datepicker';\nimport {useImperativeHandle, useMemo, useRef, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport function useFormatHelpText(props: Pick<SpectrumDatePickerBase<any>, 'description' | 'showFormatHelpText'>) {\n let formatter = useDateFormatter({dateStyle: 'short'});\n let displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.description) {\n return props.description;\n }\n\n if (props.showFormatHelpText) {\n return formatter.formatToParts(new Date()).map(s => {\n if (s.type === 'literal') {\n return s.value;\n }\n\n return displayNames.of(s.type);\n }).join(' ');\n }\n\n return '';\n }, [props.description, props.showFormatHelpText, formatter, displayNames]);\n}\n\nexport function useVisibleMonths(maxVisibleMonths: number) {\n let {scale} = useProvider();\n let [visibleMonths, setVisibleMonths] = useState(getVisibleMonths(scale));\n useLayoutEffect(() => {\n let onResize = () => setVisibleMonths(getVisibleMonths(scale));\n onResize();\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [scale]);\n\n return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));\n}\n\nfunction getVisibleMonths(scale) {\n if (typeof window === 'undefined') {\n return 1;\n }\n let monthWidth = scale === 'large' ? 336 : 280;\n let gap = scale === 'large' ? 30 : 24;\n let popoverPadding = scale === 'large' ? 32 : 48;\n return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));\n}\n\nexport function useFocusManagerRef(ref: FocusableRef<HTMLElement>) {\n let domRef = useRef(undefined);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n createFocusManager(domRef).focusFirst({tabbable: true});\n }\n }));\n return domRef;\n}\n\nexport function useFormattedDateWidth(state) {\n let locale = useLocale()?.locale;\n let currentDate = new Date();\n let formatedDate = state.getDateFormatter(locale, {shouldForceLeadingZeros: true}).format(currentDate, locale);\n let totalCharacters = formatedDate.length;\n\n // The max of two is for times with only hours.\n // As the length of a date grows we need to proportionally increase the width.\n // We use the character count with 'ch' units and add extra padding to accomate for\n // dates with months and time dashes, which are wider characters.\n return (totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2));\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
|
|
@@ -244,6 +244,7 @@
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
.YO3Nla_spectrum-Textfield-validationIcon {
|
|
247
|
+
box-sizing: content-box;
|
|
247
248
|
pointer-events: all;
|
|
248
249
|
transition: color var(--spectrum-global-animation-duration-100, .13s) ease-in-out;
|
|
249
250
|
padding-inline-end: calc(var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) / 2);
|
|
@@ -546,4 +547,4 @@
|
|
|
546
547
|
border-color: var(--spectrum-textfield-quiet-border-color-key-focus, var(--spectrum-alias-border-color-focus));
|
|
547
548
|
}
|
|
548
549
|
}
|
|
549
|
-
/*# sourceMappingURL=vars.
|
|
550
|
+
/*# sourceMappingURL=vars.3d0e5be0.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;AAQE;;;;;;AAWF;;;;;;;;;;;;;;;;;;;;AA4CE;;;;;;;;AAYA;;;;;;;AAWE;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAMA;;;;AAKF;;;;;AAME;;;;AAQF;;;;;AAOA;;;;;AAAA;;;;;AAOA;;;;AAIA;;;;;;;;AAUA;;;;;;;AASA;;;;AAIA;;;;AASF;;;;AAIA;;;;;AAKE;;;;AAIA;;;;;AAME;;;;AAOJ;;;;;;;;AAUE;;;;AAKF;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOA;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASA;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAaA;;;;AASE;;;;AAIE;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKF;;;;;AAQF;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAME;;;;AAiBF;;;;;;AAKE;;;;AAKA;;;;;AAIE;;;;AAMF;;;;;;AAKE;;;;AAMF;;;;AAME;;;;;AAMF;;;;;;;AASE;;;;AAKA;;;;AAdF;;;;;;;AASE;;;;AAKA;;;;AAKF;;;;AAGE;;;;AAcE;;;;;AAOJ;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAME;;;;;AAMF;;;;;AAOF;;;;AAGE;;;;AAIA;;;;AAIA;;;;AAME;;;;;AASA;;;;AASJ;;;;AAIA;;;;AAKF;EACE;;;;;;;;;;;;EAUE;;;;;EAKE;;;;;;EAKE","sources":["packages/@adobe/spectrum-css-temp/components/textfield/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.3d0e5be0.css.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/datepicker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@internationalized/date": "^3.5.
|
|
40
|
-
"@react-aria/datepicker": "^3.
|
|
41
|
-
"@react-aria/focus": "^3.
|
|
42
|
-
"@react-aria/i18n": "^3.
|
|
43
|
-
"@react-aria/interactions": "^3.
|
|
44
|
-
"@react-aria/utils": "^3.
|
|
45
|
-
"@react-spectrum/button": "^3.16.
|
|
46
|
-
"@react-spectrum/calendar": "^3.4.
|
|
47
|
-
"@react-spectrum/dialog": "^3.8.
|
|
48
|
-
"@react-spectrum/form": "^3.7.
|
|
49
|
-
"@react-spectrum/label": "^3.16.
|
|
50
|
-
"@react-spectrum/layout": "^3.6.
|
|
51
|
-
"@react-spectrum/utils": "^3.11.
|
|
52
|
-
"@react-spectrum/view": "^3.6.
|
|
53
|
-
"@react-stately/datepicker": "^3.
|
|
54
|
-
"@react-types/datepicker": "^3.
|
|
55
|
-
"@react-types/shared": "^3.
|
|
56
|
-
"@spectrum-icons/ui": "^3.6.
|
|
57
|
-
"@spectrum-icons/workflow": "^4.2.
|
|
39
|
+
"@internationalized/date": "^3.5.5",
|
|
40
|
+
"@react-aria/datepicker": "^3.11.1",
|
|
41
|
+
"@react-aria/focus": "^3.18.1",
|
|
42
|
+
"@react-aria/i18n": "^3.12.1",
|
|
43
|
+
"@react-aria/interactions": "^3.22.1",
|
|
44
|
+
"@react-aria/utils": "^3.25.1",
|
|
45
|
+
"@react-spectrum/button": "^3.16.6",
|
|
46
|
+
"@react-spectrum/calendar": "^3.4.11",
|
|
47
|
+
"@react-spectrum/dialog": "^3.8.13",
|
|
48
|
+
"@react-spectrum/form": "^3.7.8",
|
|
49
|
+
"@react-spectrum/label": "^3.16.8",
|
|
50
|
+
"@react-spectrum/layout": "^3.6.7",
|
|
51
|
+
"@react-spectrum/utils": "^3.11.9",
|
|
52
|
+
"@react-spectrum/view": "^3.6.12",
|
|
53
|
+
"@react-stately/datepicker": "^3.10.1",
|
|
54
|
+
"@react-types/datepicker": "^3.8.1",
|
|
55
|
+
"@react-types/shared": "^3.24.1",
|
|
56
|
+
"@spectrum-icons/ui": "^3.6.9",
|
|
57
|
+
"@spectrum-icons/workflow": "^4.2.14",
|
|
58
58
|
"@swc/helpers": "^0.5.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@react-spectrum/provider": "^3.0.0",
|
|
66
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
67
|
-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
66
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
67
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f0aa6aacee60af265dc8994b9274ccf072a850aa"
|
|
73
73
|
}
|
package/src/DateField.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import {Input} from './Input';
|
|
|
21
21
|
import React, {ReactElement, useRef} from 'react';
|
|
22
22
|
import {useDateField} from '@react-aria/datepicker';
|
|
23
23
|
import {useDateFieldState} from '@react-stately/datepicker';
|
|
24
|
-
import {useFocusManagerRef, useFormatHelpText} from './utils';
|
|
24
|
+
import {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth} from './utils';
|
|
25
25
|
import {useFormProps} from '@react-spectrum/form';
|
|
26
26
|
import {useLocale} from '@react-aria/i18n';
|
|
27
27
|
import {useProviderProps} from '@react-spectrum/provider';
|
|
@@ -61,6 +61,8 @@ function DateField<T extends DateValue>(props: SpectrumDateFieldProps<T>, ref: F
|
|
|
61
61
|
|
|
62
62
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
63
63
|
|
|
64
|
+
let approximateWidth = useFormattedDateWidth(state) + 'ch';
|
|
65
|
+
|
|
64
66
|
return (
|
|
65
67
|
<Field
|
|
66
68
|
{...props}
|
|
@@ -82,6 +84,7 @@ function DateField<T extends DateValue>(props: SpectrumDateFieldProps<T>, ref: F
|
|
|
82
84
|
isQuiet={isQuiet}
|
|
83
85
|
autoFocus={autoFocus}
|
|
84
86
|
validationState={validationState}
|
|
87
|
+
minWidth={approximateWidth}
|
|
85
88
|
className={classNames(datepickerStyles, 'react-spectrum-DateField')}>
|
|
86
89
|
{state.segments.map((segment, i) =>
|
|
87
90
|
(<DatePickerSegment
|
package/src/DatePicker.tsx
CHANGED
|
@@ -31,7 +31,7 @@ import styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';
|
|
|
31
31
|
import {TimeField} from './TimeField';
|
|
32
32
|
import {useDatePicker} from '@react-aria/datepicker';
|
|
33
33
|
import {useDatePickerState} from '@react-stately/datepicker';
|
|
34
|
-
import {useFocusManagerRef, useFormatHelpText, useVisibleMonths} from './utils';
|
|
34
|
+
import {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';
|
|
35
35
|
import {useFocusRing} from '@react-aria/focus';
|
|
36
36
|
import {useFormProps} from '@react-spectrum/form';
|
|
37
37
|
import {useHover} from '@react-aria/interactions';
|
|
@@ -50,7 +50,7 @@ function DatePicker<T extends DateValue>(props: SpectrumDatePickerProps<T>, ref:
|
|
|
50
50
|
pageBehavior
|
|
51
51
|
} = props;
|
|
52
52
|
let {hoverProps, isHovered} = useHover({isDisabled});
|
|
53
|
-
let targetRef = useRef<HTMLDivElement>();
|
|
53
|
+
let targetRef = useRef<HTMLDivElement>(undefined);
|
|
54
54
|
let state = useDatePickerState({
|
|
55
55
|
...props,
|
|
56
56
|
shouldCloseOnSelect: () => !state.hasTime
|
|
@@ -112,6 +112,8 @@ function DatePicker<T extends DateValue>(props: SpectrumDatePickerProps<T>, ref:
|
|
|
112
112
|
let visibleMonths = useVisibleMonths(maxVisibleMonths);
|
|
113
113
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
114
114
|
|
|
115
|
+
let approximateWidth = useFormattedDateWidth(state) + 'ch';
|
|
116
|
+
|
|
115
117
|
return (
|
|
116
118
|
<Field
|
|
117
119
|
{...props}
|
|
@@ -136,7 +138,8 @@ function DatePicker<T extends DateValue>(props: SpectrumDatePickerProps<T>, ref:
|
|
|
136
138
|
validationState={validationState}
|
|
137
139
|
className={classNames(styles, 'spectrum-InputGroup-field')}
|
|
138
140
|
inputClassName={fieldClassName}
|
|
139
|
-
disableFocusRing
|
|
141
|
+
disableFocusRing
|
|
142
|
+
minWidth={approximateWidth}>
|
|
140
143
|
<DatePickerField
|
|
141
144
|
{...fieldProps}
|
|
142
145
|
data-testid="date-field"
|
package/src/DatePickerField.tsx
CHANGED
|
@@ -33,7 +33,7 @@ export function DatePickerField<T extends DateValue>(props: DatePickerFieldProps
|
|
|
33
33
|
isRequired,
|
|
34
34
|
inputClassName
|
|
35
35
|
} = props;
|
|
36
|
-
let ref = useRef();
|
|
36
|
+
let ref = useRef(undefined);
|
|
37
37
|
let {locale} = useLocale();
|
|
38
38
|
let state = useDateFieldState({
|
|
39
39
|
...props,
|
|
@@ -41,7 +41,7 @@ export function DatePickerField<T extends DateValue>(props: DatePickerFieldProps
|
|
|
41
41
|
createCalendar
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
let inputRef = useRef();
|
|
44
|
+
let inputRef = useRef(undefined);
|
|
45
45
|
let {fieldProps, inputProps} = useDateField({...props, inputRef}, state, ref);
|
|
46
46
|
|
|
47
47
|
return (
|