@cloudscape-design/components-themeable 3.0.1068 → 3.0.1070

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  3. package/lib/internal/scss/split-panel/styles.scss +4 -2
  4. package/lib/internal/template/calendar/interfaces.d.ts +2 -1
  5. package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
  6. package/lib/internal/template/calendar/interfaces.js.map +1 -1
  7. package/lib/internal/template/date-picker/index.d.ts.map +1 -1
  8. package/lib/internal/template/date-picker/index.js +2 -2
  9. package/lib/internal/template/date-picker/index.js.map +1 -1
  10. package/lib/internal/template/date-picker/interfaces.d.ts +23 -0
  11. package/lib/internal/template/date-picker/interfaces.d.ts.map +1 -1
  12. package/lib/internal/template/date-picker/interfaces.js +2 -0
  13. package/lib/internal/template/date-picker/interfaces.js.map +1 -1
  14. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  15. package/lib/internal/template/internal/components/masked-input/index.d.ts.map +1 -1
  16. package/lib/internal/template/internal/components/masked-input/index.js +1 -0
  17. package/lib/internal/template/internal/components/masked-input/index.js.map +1 -1
  18. package/lib/internal/template/internal/components/masked-input/use-mask.d.ts +2 -1
  19. package/lib/internal/template/internal/components/masked-input/use-mask.d.ts.map +1 -1
  20. package/lib/internal/template/internal/components/masked-input/use-mask.js +2 -2
  21. package/lib/internal/template/internal/components/masked-input/use-mask.js.map +1 -1
  22. package/lib/internal/template/internal/environment.js +2 -2
  23. package/lib/internal/template/internal/environment.json +2 -2
  24. package/lib/internal/template/split-panel/styles.css.js +27 -27
  25. package/lib/internal/template/split-panel/styles.scoped.css +46 -44
  26. package/lib/internal/template/split-panel/styles.selectors.js +27 -27
  27. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "e965603a19c0c71a77fc192362805aee011a86e3"
2
+ "commit": "1b71d6c12d9cb72bd92e1610f2cbad1221ec443c"
3
3
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "e965603a";
3
+ $awsui-commit-hash: "1b71d6c1";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-kcc2gu;
6
6
  $minContentWidth: --awsui-min-content-width-kcc2gu;
@@ -21,9 +21,11 @@ $app-layout-drawer-width: calc(#{awsui.$space-layout-toggle-diameter} + 2 * #{aw
21
21
  background-color: awsui.$color-background-layout-panel-content;
22
22
  // should be above tools and navigation panels to avoid their shadows
23
23
  z-index: 840;
24
- &-closed:not(.refresh) {
24
+ &-closed {
25
25
  cursor: pointer;
26
- min-inline-size: constants.$sidebar-size-closed;
26
+ &:not(.refresh) {
27
+ min-inline-size: constants.$sidebar-size-closed;
28
+ }
27
29
  }
28
30
  }
29
31
 
@@ -1,5 +1,6 @@
1
1
  import { BaseComponentProps } from '../internal/base-component';
2
2
  import { NonCancelableEventHandler } from '../internal/events';
3
+ import { DateGranularity } from '../internal/utils/date-time/interfaces';
3
4
  export interface CalendarProps extends BaseComponentProps {
4
5
  /**
5
6
  * The current input value, in YYYY-MM-DD format.
@@ -88,7 +89,7 @@ export declare namespace CalendarProps {
88
89
  interface DateDisabledReasonFunction {
89
90
  (date: Date): string;
90
91
  }
91
- type Granularity = 'day' | 'month';
92
+ type Granularity = DateGranularity;
92
93
  interface I18nStrings {
93
94
  /**
94
95
  * Used as part of the `aria-label` for today's date in the calendar.
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/calendar/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAE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AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,YAAY;QAC3B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,qBAAqB;QACpC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;KACvB;IAED,UAAiB,0BAA0B;QACzC,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;KACtB;IAED,KAAY,WAAW,GAAG,eAAe,CAAC;IAE1C,UAAiB,WAAW;QAC1B;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAEhC;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAE/B;;;WAGG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/calendar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CalendarProps extends BaseComponentProps {\n /**\n * The current input value, in YYYY-MM-DD format.\n */\n value: string;\n\n /**\n * Defines whether a particular date is enabled in the calendar or not.\n * If you disable a date in the calendar, users can still enter this date using a keyboard.\n * We recommend that you also validate these constraints on the client-side and server-side\n * as you would for other form elements.\n * @param date\n */\n isDateEnabled?: CalendarProps.IsDateEnabledFunction;\n\n /**\n * Provides a reason why a particular date in the calendar is not enabled (only when `isDateEnabled` returns `false`).\n * If provided, the date becomes focusable.\n * @param date\n */\n dateDisabledReason?: CalendarProps.DateDisabledReasonFunction;\n\n /**\n * Specifies the locale to use to render month names and determine the starting day of the week.\n * If you don't provide this, the locale is determined by the page and browser locales.\n * Supported values and formats are listed in the\n * [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\n */\n locale?: string;\n\n /**\n * Determines the starting day of the week. The values 0-6 map to Sunday-Saturday.\n * By default the starting day of the week is defined by the locale, but you can use this property to override it.\n */\n startOfWeek?: number;\n\n /**\n * Adds an `aria-label` to the calendar.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the calendar.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the calendar.\n */\n ariaDescribedby?: string;\n\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n * @deprecated Use `i18nString.todayAriaLabel` instead.\n */\n todayAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n * @deprecated Use `i18nStrings.nextMonthAriaLabel` instead.\n */\n nextMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n * @deprecated Use `i18nStrings.previousMonthAriaLabel` instead.\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Called whenever a user changes the input value (by typing, pasting, or selecting a value).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<CalendarProps.ChangeDetail>;\n\n /**\n * An object containing all the necessary localized strings required by\n * the component.\n * @i18n\n */\n i18nStrings?: CalendarProps.I18nStrings;\n\n /**\n * Specifies the granularity at which users will be able to select a date.\n * Defaults to `day`.\n **/\n granularity?: CalendarProps.Granularity;\n}\n\nexport namespace CalendarProps {\n export interface ChangeDetail {\n /**\n * The new value of this component.\n */\n value: string;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface DateDisabledReasonFunction {\n (date: Date): string;\n }\n\n export type Granularity = 'day' | 'month';\n\n export interface I18nStrings {\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n */\n todayAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n */\n nextMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Used as part of the `aria-label` for the current month in the calendar.\n * @i18n\n */\n currentMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next year' button.\n * @i18n\n */\n nextYearAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous year' button.\n * @i18n\n */\n previousYearAriaLabel?: string;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/calendar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DateGranularity } from '../internal/utils/date-time/interfaces';\n\nexport interface CalendarProps extends BaseComponentProps {\n /**\n * The current input value, in YYYY-MM-DD format.\n */\n value: string;\n\n /**\n * Defines whether a particular date is enabled in the calendar or not.\n * If you disable a date in the calendar, users can still enter this date using a keyboard.\n * We recommend that you also validate these constraints on the client-side and server-side\n * as you would for other form elements.\n * @param date\n */\n isDateEnabled?: CalendarProps.IsDateEnabledFunction;\n\n /**\n * Provides a reason why a particular date in the calendar is not enabled (only when `isDateEnabled` returns `false`).\n * If provided, the date becomes focusable.\n * @param date\n */\n dateDisabledReason?: CalendarProps.DateDisabledReasonFunction;\n\n /**\n * Specifies the locale to use to render month names and determine the starting day of the week.\n * If you don't provide this, the locale is determined by the page and browser locales.\n * Supported values and formats are listed in the\n * [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\n */\n locale?: string;\n\n /**\n * Determines the starting day of the week. The values 0-6 map to Sunday-Saturday.\n * By default the starting day of the week is defined by the locale, but you can use this property to override it.\n */\n startOfWeek?: number;\n\n /**\n * Adds an `aria-label` to the calendar.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the calendar.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the calendar.\n */\n ariaDescribedby?: string;\n\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n * @deprecated Use `i18nString.todayAriaLabel` instead.\n */\n todayAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n * @deprecated Use `i18nStrings.nextMonthAriaLabel` instead.\n */\n nextMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n * @deprecated Use `i18nStrings.previousMonthAriaLabel` instead.\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Called whenever a user changes the input value (by typing, pasting, or selecting a value).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<CalendarProps.ChangeDetail>;\n\n /**\n * An object containing all the necessary localized strings required by\n * the component.\n * @i18n\n */\n i18nStrings?: CalendarProps.I18nStrings;\n\n /**\n * Specifies the granularity at which users will be able to select a date.\n * Defaults to `day`.\n **/\n granularity?: CalendarProps.Granularity;\n}\n\nexport namespace CalendarProps {\n export interface ChangeDetail {\n /**\n * The new value of this component.\n */\n value: string;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface DateDisabledReasonFunction {\n (date: Date): string;\n }\n\n export type Granularity = DateGranularity;\n\n export interface I18nStrings {\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n */\n todayAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n */\n nextMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Used as part of the `aria-label` for the current month in the calendar.\n * @i18n\n */\n currentMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next year' button.\n * @i18n\n */\n nextYearAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous year' button.\n * @i18n\n */\n previousYearAriaLabel?: string;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAyBlE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA2Lf,CAAC;AAGF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAyBlE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FAgMf,CAAC;AAGF,eAAe,UAAU,CAAC"}
@@ -27,7 +27,7 @@ import { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils
27
27
  import styles from './styles.css.js';
28
28
  const DatePicker = React.forwardRef((_a, ref) => {
29
29
  var _b, _c, _d;
30
- var { locale = '', startOfWeek, isDateEnabled, dateDisabledReason, nextMonthAriaLabel, previousMonthAriaLabel, todayAriaLabel, i18nStrings, placeholder = '', value = '', readOnly = false, disabled = false, onBlur, autoFocus = false, onChange, onFocus, name, ariaLabel, ariaRequired, controlId, invalid, warning, openCalendarAriaLabel, expandToViewport, granularity = 'day' } = _a, restProps = __rest(_a, ["locale", "startOfWeek", "isDateEnabled", "dateDisabledReason", "nextMonthAriaLabel", "previousMonthAriaLabel", "todayAriaLabel", "i18nStrings", "placeholder", "value", "readOnly", "disabled", "onBlur", "autoFocus", "onChange", "onFocus", "name", "ariaLabel", "ariaRequired", "controlId", "invalid", "warning", "openCalendarAriaLabel", "expandToViewport", "granularity"]);
30
+ var { locale, startOfWeek, isDateEnabled, dateDisabledReason, nextMonthAriaLabel, previousMonthAriaLabel, todayAriaLabel, i18nStrings, placeholder = '', value = '', readOnly = false, disabled = false, onBlur, autoFocus = false, onChange, onFocus, name, ariaLabel, ariaRequired, controlId, invalid, warning, openCalendarAriaLabel, expandToViewport, granularity = 'day', format = 'slashed', inputFormat = 'slashed' } = _a, restProps = __rest(_a, ["locale", "startOfWeek", "isDateEnabled", "dateDisabledReason", "nextMonthAriaLabel", "previousMonthAriaLabel", "todayAriaLabel", "i18nStrings", "placeholder", "value", "readOnly", "disabled", "onBlur", "autoFocus", "onChange", "onFocus", "name", "ariaLabel", "ariaRequired", "controlId", "invalid", "warning", "openCalendarAriaLabel", "expandToViewport", "granularity", "format", "inputFormat"]);
31
31
  const { __internalRootRef } = useBaseComponent('DatePicker', {
32
32
  props: { autoFocus, expandToViewport, granularity, readOnly },
33
33
  metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },
@@ -78,7 +78,7 @@ const DatePicker = React.forwardRef((_a, ref) => {
78
78
  : null);
79
79
  const trigger = (React.createElement("div", { className: styles['date-picker-trigger'] },
80
80
  React.createElement("div", { className: styles['date-picker-input'] },
81
- React.createElement(InternalDateInput, { name: name, invalid: invalid, warning: warning, controlId: controlId, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, ariaLabel: ariaLabel, ariaRequired: ariaRequired, value: value, disabled: disabled, readOnly: readOnly, onChange: onInputChangeHandler, onBlur: onInputBlurHandler, placeholder: placeholder, ref: internalInputRef, autoFocus: autoFocus, onFocus: onDropdownCloseHandler, granularity: granularity })),
81
+ React.createElement(InternalDateInput, { name: name, invalid: invalid, warning: warning, controlId: controlId, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, ariaLabel: ariaLabel, ariaRequired: ariaRequired, value: value, disabled: disabled, readOnly: readOnly, onChange: onInputChangeHandler, onBlur: onInputBlurHandler, placeholder: placeholder, ref: internalInputRef, autoFocus: autoFocus, onFocus: onDropdownCloseHandler, granularity: granularity, locale: locale, format: format, inputFormat: inputFormat })),
82
82
  React.createElement("div", null,
83
83
  React.createElement(InternalButton, { iconName: "calendar", className: styles['open-calendar-button'], onClick: onButtonClickHandler, ref: buttonRef, ariaLabel: buttonAriaLabel, disabled: disabled || readOnly, formAction: "none" }))));
84
84
  baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG1F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,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n'use client';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalCalendar from '../calendar/internal';\nimport { useFormFieldContext } from '../contexts/form-field.js';\nimport InternalDateInput from '../date-input/internal';\nimport { useLocale } from '../i18n/context.js';\nimport { InputProps } from '../input/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport FocusLock from '../internal/components/focus-lock';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport { parseDate } from '../internal/utils/date-time';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport InternalLiveRegion from '../live-region/internal';\nimport { DatePickerProps } from './interfaces';\nimport { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n dateDisabledReason,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n i18nStrings,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n controlId,\n invalid,\n warning,\n openCalendarAriaLabel,\n expandToViewport,\n granularity = 'day',\n ...restProps\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker', {\n props: { autoFocus, expandToViewport, granularity, readOnly },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const contextLocale = useLocale();\n const normalizedLocale = normalizeLocale('DatePicker', locale || contextLocale);\n\n const baseProps = getBaseProps(restProps);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps);\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n event.stopPropagation();\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const baseDate = parsedValue || new Date();\n\n const hasFullValue = isValidFullDate({ date: value, granularity });\n\n const buttonAriaLabel =\n openCalendarAriaLabel &&\n openCalendarAriaLabel(\n hasFullValue && parsedValue\n ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale })\n : null\n );\n\n const trigger = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n warning={warning}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n onFocus={onDropdownCloseHandler}\n granularity={granularity}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={buttonAriaLabel}\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={!disabled && !readOnly ? onWrapperKeyDownHandler : undefined}>\n {disabled || readOnly ? (\n trigger\n ) : (\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n trigger={trigger}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock className={styles['focus-lock']} autoFocus={true}>\n <div tabIndex={0} className={styles.calendar} role=\"dialog\">\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n ariaDescribedby={calendarDescriptionId}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n granularity={granularity}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={{\n ...i18nStrings,\n todayAriaLabel: i18nStrings?.todayAriaLabel ?? todayAriaLabel,\n nextMonthAriaLabel: i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel,\n previousMonthAriaLabel: i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel,\n }}\n />\n <InternalLiveRegion id={calendarDescriptionId} hidden={true} tagName=\"span\">\n {getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })}\n </InternalLiveRegion>\n </div>\n </FocusLock>\n )}\n </Dropdown>\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG1F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MA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,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalCalendar from '../calendar/internal';\nimport { useFormFieldContext } from '../contexts/form-field.js';\nimport InternalDateInput from '../date-input/internal';\nimport { useLocale } from '../i18n/context.js';\nimport { InputProps } from '../input/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport FocusLock from '../internal/components/focus-lock';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport { parseDate } from '../internal/utils/date-time';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport InternalLiveRegion from '../live-region/internal';\nimport { DatePickerProps } from './interfaces';\nimport { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale,\n startOfWeek,\n isDateEnabled,\n dateDisabledReason,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n i18nStrings,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n controlId,\n invalid,\n warning,\n openCalendarAriaLabel,\n expandToViewport,\n granularity = 'day',\n format = 'slashed',\n inputFormat = 'slashed',\n ...restProps\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker', {\n props: { autoFocus, expandToViewport, granularity, readOnly },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const contextLocale = useLocale();\n const normalizedLocale = normalizeLocale('DatePicker', locale || contextLocale);\n\n const baseProps = getBaseProps(restProps);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps);\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n event.stopPropagation();\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const baseDate = parsedValue || new Date();\n\n const hasFullValue = isValidFullDate({ date: value, granularity });\n\n const buttonAriaLabel =\n openCalendarAriaLabel &&\n openCalendarAriaLabel(\n hasFullValue && parsedValue\n ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale })\n : null\n );\n\n const trigger = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n warning={warning}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n onFocus={onDropdownCloseHandler}\n granularity={granularity}\n locale={locale}\n format={format}\n inputFormat={inputFormat}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={buttonAriaLabel}\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={!disabled && !readOnly ? onWrapperKeyDownHandler : undefined}>\n {disabled || readOnly ? (\n trigger\n ) : (\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n trigger={trigger}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock className={styles['focus-lock']} autoFocus={true}>\n <div tabIndex={0} className={styles.calendar} role=\"dialog\">\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n ariaDescribedby={calendarDescriptionId}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n granularity={granularity}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={{\n ...i18nStrings,\n todayAriaLabel: i18nStrings?.todayAriaLabel ?? todayAriaLabel,\n nextMonthAriaLabel: i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel,\n previousMonthAriaLabel: i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel,\n }}\n />\n <InternalLiveRegion id={calendarDescriptionId} hidden={true} tagName=\"span\">\n {getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })}\n </InternalLiveRegion>\n </div>\n </FocusLock>\n )}\n </Dropdown>\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
@@ -3,6 +3,7 @@ import { BaseComponentProps } from '../internal/base-component';
3
3
  import { ExpandToViewport } from '../internal/components/dropdown/interfaces';
4
4
  import { FormFieldValidationControlProps } from '../internal/context/form-field-context';
5
5
  import { NonCancelableEventHandler } from '../internal/events';
6
+ import { DateFormat, DateGranularity, EditableDateFormat } from '../internal/utils/date-time/interfaces';
6
7
  export interface DatePickerProps extends BaseComponentProps, FormFieldValidationControlProps, ExpandToViewport, CalendarProps {
7
8
  /**
8
9
  * Specifies the placeholder text rendered when the value is an empty string.
@@ -51,6 +52,25 @@ export interface DatePickerProps extends BaseComponentProps, FormFieldValidation
51
52
  * Specifies whether to add `aria-required` to the native control.
52
53
  */
53
54
  ariaRequired?: boolean;
55
+ /**
56
+ * The format as it is displayed. It can take the following values:
57
+ * * `iso`: ISO 8601 format without time, e.g.: 2024-01-30 (or 2024-01)
58
+ * * `long-localized`: a more human-readable, localized format, e.g.: January 30, 2024 (or January, 2024)
59
+ * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)
60
+ *
61
+ * @default 'slashed'
62
+ */
63
+ format?: DatePickerProps.Format;
64
+ /**
65
+ * Specifies the date format to use when the format is 'long-localized' and the user needs to edit the date.
66
+ *
67
+ * The format of the input as it is being interacted with. It can take the following values:
68
+ * * `iso`: ISO 8601 format without time, e.g.: 2024-01-30 (or 2024-01)
69
+ * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)
70
+ *
71
+ * @default 'slashed'.
72
+ */
73
+ inputFormat?: DatePickerProps.InputFormat;
54
74
  /**
55
75
  * Called when input focus is moved to the UI control.
56
76
  */
@@ -86,5 +106,8 @@ export declare namespace DatePickerProps {
86
106
  focus(): void;
87
107
  }
88
108
  type I18nStrings = CalendarProps.I18nStrings;
109
+ type Granularity = DateGranularity;
110
+ type Format = DateFormat;
111
+ type InputFormat = EditableDateFormat;
89
112
  }
90
113
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/date-picker/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,eACf,SAAQ,kBAAkB,EACxB,+BAA+B,EAC/B,gBAAgB,EAChB,aAAa;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC;IAE9D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH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Identifier: Apache-2.0
1
3
  export {};
2
4
  //# sourceMappingURL=interfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/date-picker/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CalendarProps } from '../calendar/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface DatePickerProps\n extends BaseComponentProps,\n FormFieldValidationControlProps,\n ExpandToViewport,\n CalendarProps {\n /**\n * Specifies the placeholder text rendered when the value is an empty string.\n */\n placeholder?: string;\n\n /**\n * Specifies a function that generates the `aria-label` for the 'open calendar' button. The `selectedDate` parameter is\n * a human-readable localised string representing the current value of the input.\n * (for example, ``selectedDate => 'Choose Date' + (selectedDate ? `, selected date is ${selectedDate}` : '')``)\n */\n openCalendarAriaLabel?: DatePickerProps.OpenCalendarAriaLabel;\n\n /**\n * Specifies the name of the control used in HTML forms.\n */\n name?: string;\n\n /**\n * Specifies if the control is disabled, which prevents the\n * user from modifying the value and prevents the value from\n * being included in a form submission. A disabled control can't\n * receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read-only, which prevents the\n * user from modifying the value but includes it in a form\n * submission. A read-only control can receive focus.\n *\n * Do not use read-only inputs outside of a form.\n */\n readOnly?: boolean;\n\n /**\n * Indicates whether the control should be focused as\n * soon as the page loads, which enables the user to\n * start typing without having to manually focus the control. Don't\n * use this option on pages where the control may be\n * scrolled out of the viewport.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an `aria-label` to the native control.\n *\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * Called when input focus is moved to the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * An object containing all the necessary localized strings required by\n * the component.\n * @i18n\n */\n i18nStrings?: DatePickerProps.I18nStrings;\n}\n\nexport namespace DatePickerProps {\n export interface ChangeDetail {\n /**\n * The new value of this date-picker.\n */\n value: string;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface OpenCalendarAriaLabel {\n (selectedDate: string | null): string;\n }\n\n export interface Ref {\n /**\n * Sets the browser focus on the UI control\n */\n focus(): void;\n }\n\n export type I18nStrings = CalendarProps.I18nStrings;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/date-picker/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { CalendarProps } from '../calendar/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DateFormat, DateGranularity, EditableDateFormat } from '../internal/utils/date-time/interfaces';\n\nexport interface DatePickerProps\n extends BaseComponentProps,\n FormFieldValidationControlProps,\n ExpandToViewport,\n CalendarProps {\n /**\n * Specifies the placeholder text rendered when the value is an empty string.\n */\n placeholder?: string;\n\n /**\n * Specifies a function that generates the `aria-label` for the 'open calendar' button. The `selectedDate` parameter is\n * a human-readable localised string representing the current value of the input.\n * (for example, ``selectedDate => 'Choose Date' + (selectedDate ? `, selected date is ${selectedDate}` : '')``)\n */\n openCalendarAriaLabel?: DatePickerProps.OpenCalendarAriaLabel;\n\n /**\n * Specifies the name of the control used in HTML forms.\n */\n name?: string;\n\n /**\n * Specifies if the control is disabled, which prevents the\n * user from modifying the value and prevents the value from\n * being included in a form submission. A disabled control can't\n * receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read-only, which prevents the\n * user from modifying the value but includes it in a form\n * submission. A read-only control can receive focus.\n *\n * Do not use read-only inputs outside of a form.\n */\n readOnly?: boolean;\n\n /**\n * Indicates whether the control should be focused as\n * soon as the page loads, which enables the user to\n * start typing without having to manually focus the control. Don't\n * use this option on pages where the control may be\n * scrolled out of the viewport.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an `aria-label` to the native control.\n *\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * The format as it is displayed. It can take the following values:\n * * `iso`: ISO 8601 format without time, e.g.: 2024-01-30 (or 2024-01)\n * * `long-localized`: a more human-readable, localized format, e.g.: January 30, 2024 (or January, 2024)\n * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)\n *\n * @default 'slashed'\n */\n format?: DatePickerProps.Format;\n\n /**\n * Specifies the date format to use when the format is 'long-localized' and the user needs to edit the date.\n *\n * The format of the input as it is being interacted with. It can take the following values:\n * * `iso`: ISO 8601 format without time, e.g.: 2024-01-30 (or 2024-01)\n * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)\n *\n * @default 'slashed'.\n */\n inputFormat?: DatePickerProps.InputFormat;\n\n /**\n * Called when input focus is moved to the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * An object containing all the necessary localized strings required by\n * the component.\n * @i18n\n */\n i18nStrings?: DatePickerProps.I18nStrings;\n}\n\nexport namespace DatePickerProps {\n export interface ChangeDetail {\n /**\n * The new value of this date-picker.\n */\n value: string;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface OpenCalendarAriaLabel {\n (selectedDate: string | null): string;\n }\n\n export interface Ref {\n /**\n * Sets the browser focus on the UI control\n */\n focus(): void;\n }\n\n export type I18nStrings = CalendarProps.I18nStrings;\n\n export type Granularity = DateGranularity;\n\n export type Format = DateFormat;\n\n export type InputFormat = EditableDateFormat;\n}\n"]}
@@ -3892,5 +3892,5 @@
3892
3892
  }
3893
3893
  }
3894
3894
  :root {
3895
- --awsui-version-info-e965603a: true;
3895
+ --awsui-version-info-1b71d6c1: true;
3896
3896
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAQ9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,QAAA,MAAM,WAAW,+FA0DhB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAQ9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,QAAA,MAAM,WAAW,+FA2DhB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,eAAe,WAAW,CAAC"}
@@ -31,6 +31,7 @@ const MaskedInput = React.forwardRef((_a, ref) => {
31
31
  onKeyDown: (event) => !rest.readOnly && onKeyDown && fireCancelableEvent(onKeyDown, event.detail, event),
32
32
  onBlur: () => fireNonCancelableEvent(onBlur),
33
33
  setPosition: setCursorPosition,
34
+ showUnmaskedValue,
34
35
  }), { onPaste } = _b, maskProps = __rest(_b, ["onPaste"]);
35
36
  const inputProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, rest), baseProps), formFieldContext), maskProps), { value: showUnmaskedValue ? value : maskProps.value });
36
37
  const mergedRef = useMergeRefs(ref, inputRef);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAE7C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EAUmB,EACnB,GAA8B,EAC9B,EAAE;QAZF,EACE,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,OAAO,GAAG,KAAK,EACf,yBAAyB,GAAG,KAAK,EACjC,iBAAiB,GAAG,KAAK,OAER,EADd,IAAI,cATT,iHAUC,CADQ;IAIT,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAC;IACtD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAE1E,eAAe,CAAC,GAAG,EAAE;;QACnB,IAAI,cAAc,KAAK,IAAI,EAAE;YAC3B,MAAA,QAAQ,CAAC,OAAO,0CAAE,iBAAiB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;SACrE;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE/B,MAAM,KAA4B,OAAO,CAAC;QACxC,MAAM,EAAE,IAAI,UAAU,CAAC,IAAI,CAAC;QAC5B,KAAK;QACL,QAAQ;QACR,OAAO;QACP,yBAAyB;QACzB,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,sBAAsB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC;QAC1F,SAAS,EAAE,CAAC,KAAkB,EAAE,EAAE,CAChC,CAAC,IAAI,CAAC,QAAQ,IAAI,SAAS,IAAI,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC;QACpF,MAAM,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,MAAM,CAAC;QAC5C,WAAW,EAAE,iBAAiB;KAC/B,CAAC,EAXI,EAAE,OAAO,OAWb,EAXkB,SAAS,cAAvB,WAAyB,CAW7B,CAAC;IAEH,MAAM,UAAU,6EACX,IAAI,GACJ,SAAS,GACT,gBAAgB,GAChB,SAAS,KACZ,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,GACnD,CAAC;IAEF,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC9C,OAAO,CACL,oBAAC,aAAa,oBACR,UAAU,IACd,GAAG,EAAE,SAAS,EACd,kBAAkB,EAAE;YAClB,OAAO;SACR,IACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAGF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useLayoutEffect, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalInput from '../../../input/internal';\nimport { getBaseProps } from '../../base-component';\nimport { useFormFieldContext } from '../../context/form-field-context';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../../events';\nimport { MaskedInputProps } from './interfaces';\nimport useMask from './use-mask';\nimport MaskFormat from './utils/mask-format';\n\nconst MaskedInput = React.forwardRef(\n (\n {\n value,\n onBlur,\n onChange,\n onKeyDown,\n mask,\n autofix = false,\n disableAutocompleteOnBlur = false,\n showUnmaskedValue = false,\n ...rest\n }: MaskedInputProps,\n ref: Ref<MaskedInputProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const formFieldContext = useFormFieldContext(rest);\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [cursorPosition, setCursorPosition] = useState<number | null>(null);\n\n useLayoutEffect(() => {\n if (cursorPosition !== null) {\n inputRef.current?.setSelectionRange(cursorPosition, cursorPosition);\n }\n }, [cursorPosition, inputRef]);\n\n const { onPaste, ...maskProps } = useMask({\n format: new MaskFormat(mask),\n value,\n inputRef,\n autofix,\n disableAutocompleteOnBlur,\n onChange: (value: string) => !rest.readOnly && fireNonCancelableEvent(onChange, { value }),\n onKeyDown: (event: CustomEvent) =>\n !rest.readOnly && onKeyDown && fireCancelableEvent(onKeyDown, event.detail, event),\n onBlur: () => fireNonCancelableEvent(onBlur),\n setPosition: setCursorPosition,\n });\n\n const inputProps = {\n ...rest,\n ...baseProps,\n ...formFieldContext,\n ...maskProps,\n value: showUnmaskedValue ? value : maskProps.value,\n };\n\n const mergedRef = useMergeRefs(ref, inputRef);\n return (\n <InternalInput\n {...inputProps}\n ref={mergedRef}\n __nativeAttributes={{\n onPaste,\n }}\n />\n );\n }\n);\n\nexport { MaskedInputProps };\nexport default MaskedInput;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,eAAe,E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ACP,yBAAyB;QACzB,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,sBAAsB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC;QAC1F,SAAS,EAAE,CAAC,KAAkB,EAAE,EAAE,CAChC,CAAC,IAAI,CAAC,QAAQ,IAAI,SAAS,IAAI,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC;QACpF,MAAM,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,MAAM,CAAC;QAC5C,WAAW,EAAE,iBAAiB;QAC9B,iBAAiB;KAClB,CAAC,EAZI,EAAE,OAAO,OAYb,EAZkB,SAAS,cAAvB,WAAyB,CAY7B,CAAC;IAEH,MAAM,UAAU,6EACX,IAAI,GACJ,SAAS,GACT,gBAAgB,GAChB,SAAS,KACZ,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,GACnD,CAAC;IAEF,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC9C,OAAO,CACL,oBAAC,aAAa,oBACR,UAAU,IACd,GAAG,EAAE,SAAS,EACd,kBAAkB,EAAE;YAClB,OAAO;SACR,IACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAGF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useLayoutEffect, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalInput from '../../../input/internal';\nimport { getBaseProps } from '../../base-component';\nimport { useFormFieldContext } from '../../context/form-field-context';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../../events';\nimport { MaskedInputProps } from './interfaces';\nimport useMask from './use-mask';\nimport MaskFormat from './utils/mask-format';\n\nconst MaskedInput = React.forwardRef(\n (\n {\n value,\n onBlur,\n onChange,\n onKeyDown,\n mask,\n autofix = false,\n disableAutocompleteOnBlur = false,\n showUnmaskedValue = false,\n ...rest\n }: MaskedInputProps,\n ref: Ref<MaskedInputProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const formFieldContext = useFormFieldContext(rest);\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [cursorPosition, setCursorPosition] = useState<number | null>(null);\n\n useLayoutEffect(() => {\n if (cursorPosition !== null) {\n inputRef.current?.setSelectionRange(cursorPosition, cursorPosition);\n }\n }, [cursorPosition, inputRef]);\n\n const { onPaste, ...maskProps } = useMask({\n format: new MaskFormat(mask),\n value,\n inputRef,\n autofix,\n disableAutocompleteOnBlur,\n onChange: (value: string) => !rest.readOnly && fireNonCancelableEvent(onChange, { value }),\n onKeyDown: (event: CustomEvent) =>\n !rest.readOnly && onKeyDown && fireCancelableEvent(onKeyDown, event.detail, event),\n onBlur: () => fireNonCancelableEvent(onBlur),\n setPosition: setCursorPosition,\n showUnmaskedValue,\n });\n\n const inputProps = {\n ...rest,\n ...baseProps,\n ...formFieldContext,\n ...maskProps,\n value: showUnmaskedValue ? value : maskProps.value,\n };\n\n const mergedRef = useMergeRefs(ref, inputRef);\n return (\n <InternalInput\n {...inputProps}\n ref={mergedRef}\n __nativeAttributes={{\n onPaste,\n }}\n />\n );\n }\n);\n\nexport { MaskedInputProps };\nexport default MaskedInput;\n"]}
@@ -19,7 +19,8 @@ export interface UseMaskProps {
19
19
  inputRef: RefObject<HTMLInputElement>;
20
20
  disableAutocompleteOnBlur?: boolean;
21
21
  setPosition: (position: number | null) => void;
22
+ showUnmaskedValue?: boolean;
22
23
  }
23
- declare const useMask: ({ value, onBlur, onChange, onKeyDown, format, inputRef, autofix, disableAutocompleteOnBlur, setPosition, }: UseMaskProps) => UseMaskHook;
24
+ declare const useMask: ({ value, onBlur, onChange, onKeyDown, format, inputRef, autofix, disableAutocompleteOnBlur, setPosition, showUnmaskedValue, }: UseMaskProps) => UseMaskHook;
24
25
  export default useMask;
25
26
  //# sourceMappingURL=use-mask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-mask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/use-mask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAIjF,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAE7C,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,yBAAyB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7D,SAAS,EAAE,sBAAsB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACxD,MAAM,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACtC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAgBD,QAAA,MAAM,OAAO,+GAUV,YAAY,KAAG,WAmEjB,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"use-mask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/use-mask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAIjF,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAE7C,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,yBAAyB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7D,SAAS,EAAE,sBAAsB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACxD,MAAM,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACtC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAgBD,QAAA,MAAM,OAAO,kIAWV,YAAY,KAAG,WAmEjB,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -13,8 +13,8 @@ const onAutoComplete = (value, onChange, maskFormat) => {
13
13
  }
14
14
  };
15
15
  const preventDefault = (event, result) => result && event.preventDefault();
16
- const useMask = ({ value = '', onBlur, onChange, onKeyDown, format, inputRef, autofix = false, disableAutocompleteOnBlur = false, setPosition, }) => {
17
- if (!format.isValid(value)) {
16
+ const useMask = ({ value = '', onBlur, onChange, onKeyDown, format, inputRef, autofix = false, disableAutocompleteOnBlur = false, setPosition, showUnmaskedValue = false, }) => {
17
+ if (!format.isValid(value) && !showUnmaskedValue) {
18
18
  warnOnce('useMask', `Invalid string "${value}" provided`);
19
19
  }
20
20
  const onMaskChange = (updatedValue) => {
@@ -1 +1 @@
1
- {"version":3,"file":"use-mask.js","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/use-mask.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAIzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAiB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuBlD,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,QAAkC,EAAE,UAAsB,EAAE,EAAE;IACnG,wCAAwC;IACxC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO;KACR;IAED,MAAM,kBAAkB,GAAG,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1D,IAAI,kBAAkB,KAAK,KAAK,EAAE;QAChC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAkB,EAAE,MAA6B,EAAE,EAAE,CAAC,MAAM,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;AAE/G,MAAM,OAAO,GAAG,CAAC,EACf,KAAK,GAAG,EAAE,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ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AAC,CAAC;gBAEjD,MAAM,cAAc,GAAG,CAAA,MAAA,QAAQ,CAAC,OAAO,0CAAE,cAAc,KAAI,CAAC,CAAC;gBAC7D,MAAM,YAAY,GAAG,CAAA,MAAA,QAAQ,CAAC,OAAO,0CAAE,YAAY,KAAI,CAAC,CAAC;gBAEzD,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;gBAC/F,YAAY,CAAC,aAAa,CAAC,CAAC;aAC7B;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InputProps } from '../../../input/interfaces';\nimport { CancelableEventHandler, NonCancelableEventHandler } from '../../events';\nimport { KeyCode } from '../../keycode';\nimport { backspaceHandler, enterHandler, HandlerResult, keyHandler } from './keyboard-handler';\nimport { isCommand, isDigit } from './utils/keys';\nimport MaskFormat from './utils/mask-format';\n\ninterface UseMaskHook {\n value: string;\n onChange: NonCancelableEventHandler<InputProps.ChangeDetail>;\n onKeyDown: CancelableEventHandler<InputProps.KeyDetail>;\n onBlur: NonCancelableEventHandler<null>;\n onPaste: (event: React.ClipboardEvent) => void;\n}\n\nexport interface UseMaskProps {\n value: string;\n onChange: (value: string) => void;\n onKeyDown?: (event: CustomEvent) => void;\n onBlur?: () => void;\n format: MaskFormat;\n autofix?: boolean;\n inputRef: RefObject<HTMLInputElement>;\n disableAutocompleteOnBlur?: boolean;\n setPosition: (position: number | null) => void;\n}\n\nconst onAutoComplete = (value: string, onChange: UseMaskProps['onChange'], maskFormat: MaskFormat) => {\n // Do not autocomplete if input is empty\n if (!value) {\n return;\n }\n\n const autoCompletedValue = maskFormat.autoComplete(value);\n if (autoCompletedValue !== value) {\n onChange(autoCompletedValue);\n }\n};\n\nconst preventDefault = (event: CustomEvent, result?: HandlerResult | null) => result && event.preventDefault();\n\nconst useMask = ({\n value = '',\n onBlur,\n onChange,\n onKeyDown,\n format,\n inputRef,\n autofix = false,\n disableAutocompleteOnBlur = false,\n setPosition,\n}: UseMaskProps): UseMaskHook => {\n if (!format.isValid(value)) {\n warnOnce('useMask', `Invalid string \"${value}\" provided`);\n }\n\n const onMaskChange = (updatedValue: string) => {\n const autofixedUpdatedValue = autofix ? format.correctMinMaxValues(updatedValue) : updatedValue;\n if (autofixedUpdatedValue === value || !format.isValid(autofixedUpdatedValue)) {\n return;\n }\n\n onChange(autofixedUpdatedValue);\n };\n\n const initialValue = autofix ? format.correctMinMaxValues(value) : value;\n const maskedValue = format.getValidValue(initialValue);\n\n return {\n value: maskedValue,\n onKeyDown: (event: CustomEvent) => {\n const selectionStart = inputRef.current?.selectionStart || 0;\n const selectionEnd = inputRef.current?.selectionEnd || 0;\n\n let result: HandlerResult | undefined;\n const { keyCode, key, ctrlKey, metaKey } = event.detail;\n if (isDigit(key) || format.isSeparator(key)) {\n result = keyHandler(maskedValue, key, format, selectionStart, selectionEnd);\n preventDefault(event, result);\n } else if (keyCode === KeyCode.backspace) {\n result = backspaceHandler(maskedValue, format, selectionStart, selectionEnd);\n preventDefault(event, result);\n } else if (keyCode === KeyCode.enter) {\n result = enterHandler(maskedValue, format);\n } else if (!isCommand(keyCode, ctrlKey, metaKey)) {\n event.preventDefault();\n }\n\n if (result) {\n const { value, position } = result;\n\n onMaskChange(value);\n setPosition(position);\n }\n\n // Proxy original event\n onKeyDown?.(event);\n },\n onChange: ({ detail }) => onMaskChange(detail.value),\n onBlur: () => {\n if (!disableAutocompleteOnBlur) {\n onAutoComplete(maskedValue, onChange, format);\n }\n\n onBlur?.();\n },\n onPaste: (event: React.ClipboardEvent) => {\n if (event.clipboardData) {\n const text = event.clipboardData.getData('text');\n\n const selectionStart = inputRef.current?.selectionStart || 0;\n const selectionEnd = inputRef.current?.selectionEnd || 0;\n\n const formattedText = format.formatPastedText(text, maskedValue, selectionStart, selectionEnd);\n onMaskChange(formattedText);\n }\n },\n };\n};\n\nexport default useMask;\n"]}
1
+ {"version":3,"file":"use-mask.js","sourceRoot":"","sources":["../../../../../src/internal/components/masked-input/use-mask.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAIzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAiB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAwBlD,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,QAAkC,EAAE,UAAsB,EAAE,EAAE;IACnG,wCAAwC;IACxC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO;KACR;IAED,MAAM,kBAAkB,GAAG,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1D,IAAI,kBAAkB,KAAK,KAAK,EAAE;QAChC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAkB,EAAE,MAA6B,EAAE,EAAE,CAAC,MAAM,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;AAE/G,MAAM,OAAO,GAAG,CAAC,EACf,KAAK,GAAG,EAAE,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,yBAAyB,GAAG,KAAK,EACjC,WAAW,EACX,iBAAiB,GAAG,KAAK,GACZ,EAAe,EAAE;IAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,EAAE;QAChD,QAAQ,CAAC,SAAS,EAAE,mBAAmB,KAAK,YAAY,CAAC,CAAC;KA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a,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;gBAC/F,YAAY,CAAC,aAAa,CAAC,CAAC;aAC7B;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InputProps } from '../../../input/interfaces';\nimport { CancelableEventHandler, NonCancelableEventHandler } from '../../events';\nimport { KeyCode } from '../../keycode';\nimport { backspaceHandler, enterHandler, HandlerResult, keyHandler } from './keyboard-handler';\nimport { isCommand, isDigit } from './utils/keys';\nimport MaskFormat from './utils/mask-format';\n\ninterface UseMaskHook {\n value: string;\n onChange: NonCancelableEventHandler<InputProps.ChangeDetail>;\n onKeyDown: CancelableEventHandler<InputProps.KeyDetail>;\n onBlur: NonCancelableEventHandler<null>;\n onPaste: (event: React.ClipboardEvent) => void;\n}\n\nexport interface UseMaskProps {\n value: string;\n onChange: (value: string) => void;\n onKeyDown?: (event: CustomEvent) => void;\n onBlur?: () => void;\n format: MaskFormat;\n autofix?: boolean;\n inputRef: RefObject<HTMLInputElement>;\n disableAutocompleteOnBlur?: boolean;\n setPosition: (position: number | null) => void;\n showUnmaskedValue?: boolean;\n}\n\nconst onAutoComplete = (value: string, onChange: UseMaskProps['onChange'], maskFormat: MaskFormat) => {\n // Do not autocomplete if input is empty\n if (!value) {\n return;\n }\n\n const autoCompletedValue = maskFormat.autoComplete(value);\n if (autoCompletedValue !== value) {\n onChange(autoCompletedValue);\n }\n};\n\nconst preventDefault = (event: CustomEvent, result?: HandlerResult | null) => result && event.preventDefault();\n\nconst useMask = ({\n value = '',\n onBlur,\n onChange,\n onKeyDown,\n format,\n inputRef,\n autofix = false,\n disableAutocompleteOnBlur = false,\n setPosition,\n showUnmaskedValue = false,\n}: UseMaskProps): UseMaskHook => {\n if (!format.isValid(value) && !showUnmaskedValue) {\n warnOnce('useMask', `Invalid string \"${value}\" provided`);\n }\n\n const onMaskChange = (updatedValue: string) => {\n const autofixedUpdatedValue = autofix ? format.correctMinMaxValues(updatedValue) : updatedValue;\n if (autofixedUpdatedValue === value || !format.isValid(autofixedUpdatedValue)) {\n return;\n }\n\n onChange(autofixedUpdatedValue);\n };\n\n const initialValue = autofix ? format.correctMinMaxValues(value) : value;\n const maskedValue = format.getValidValue(initialValue);\n\n return {\n value: maskedValue,\n onKeyDown: (event: CustomEvent) => {\n const selectionStart = inputRef.current?.selectionStart || 0;\n const selectionEnd = inputRef.current?.selectionEnd || 0;\n\n let result: HandlerResult | undefined;\n const { keyCode, key, ctrlKey, metaKey } = event.detail;\n if (isDigit(key) || format.isSeparator(key)) {\n result = keyHandler(maskedValue, key, format, selectionStart, selectionEnd);\n preventDefault(event, result);\n } else if (keyCode === KeyCode.backspace) {\n result = backspaceHandler(maskedValue, format, selectionStart, selectionEnd);\n preventDefault(event, result);\n } else if (keyCode === KeyCode.enter) {\n result = enterHandler(maskedValue, format);\n } else if (!isCommand(keyCode, ctrlKey, metaKey)) {\n event.preventDefault();\n }\n\n if (result) {\n const { value, position } = result;\n\n onMaskChange(value);\n setPosition(position);\n }\n\n // Proxy original event\n onKeyDown?.(event);\n },\n onChange: ({ detail }) => onMaskChange(detail.value),\n onBlur: () => {\n if (!disableAutocompleteOnBlur) {\n onAutoComplete(maskedValue, onChange, format);\n }\n\n onBlur?.();\n },\n onPaste: (event: React.ClipboardEvent) => {\n if (event.clipboardData) {\n const text = event.clipboardData.getData('text');\n\n const selectionStart = inputRef.current?.selectionStart || 0;\n const selectionEnd = inputRef.current?.selectionEnd || 0;\n\n const formattedText = format.formatPastedText(text, maskedValue, selectionStart, selectionEnd);\n onMaskChange(formattedText);\n }\n },\n };\n};\n\nexport default useMask;\n"]}
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (e965603a)";
3
- export var GIT_SHA = "e965603a";
2
+ export var PACKAGE_VERSION = "3.0.0 (1b71d6c1)";
3
+ export var GIT_SHA = "1b71d6c1";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "console";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (e965603a)",
4
- "GIT_SHA": "e965603a",
3
+ "PACKAGE_VERSION": "3.0.0 (1b71d6c1)",
4
+ "GIT_SHA": "1b71d6c1",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
@@ -1,32 +1,32 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "drawer": "awsui_drawer_1r9lg_100o3_153",
5
- "drawer-closed": "awsui_drawer-closed_1r9lg_100o3_190",
6
- "refresh": "awsui_refresh_1r9lg_100o3_190",
7
- "drawer-content-side": "awsui_drawer-content-side_1r9lg_100o3_195",
8
- "drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_100o3_211",
9
- "position-bottom": "awsui_position-bottom_1r9lg_100o3_218",
10
- "hidden": "awsui_hidden_1r9lg_100o3_226",
11
- "position-side": "awsui_position-side_1r9lg_100o3_247",
12
- "with-toolbar": "awsui_with-toolbar_1r9lg_100o3_252",
13
- "slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_100o3_256",
14
- "slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_100o3_267",
15
- "open-button-side": "awsui_open-button-side_1r9lg_100o3_281",
16
- "pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_100o3_290",
17
- "drawer-mobile": "awsui_drawer-mobile_1r9lg_100o3_300",
18
- "drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_100o3_304",
19
- "content-bottom": "awsui_content-bottom_1r9lg_100o3_316",
20
- "pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_100o3_335",
21
- "pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_100o3_340",
22
- "pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_100o3_344",
23
- "content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_100o3_348",
24
- "content-side": "awsui_content-side_1r9lg_100o3_353",
25
- "pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_100o3_365",
26
- "pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_100o3_374",
27
- "header": "awsui_header_1r9lg_100o3_385",
28
- "header-text": "awsui_header-text_1r9lg_100o3_398",
29
- "header-actions": "awsui_header-actions_1r9lg_100o3_412",
30
- "divider": "awsui_divider_1r9lg_100o3_420"
4
+ "drawer": "awsui_drawer_1r9lg_7nc4m_153",
5
+ "drawer-closed": "awsui_drawer-closed_1r9lg_7nc4m_190",
6
+ "refresh": "awsui_refresh_1r9lg_7nc4m_193",
7
+ "drawer-content-side": "awsui_drawer-content-side_1r9lg_7nc4m_197",
8
+ "drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_7nc4m_213",
9
+ "position-bottom": "awsui_position-bottom_1r9lg_7nc4m_220",
10
+ "hidden": "awsui_hidden_1r9lg_7nc4m_228",
11
+ "position-side": "awsui_position-side_1r9lg_7nc4m_249",
12
+ "with-toolbar": "awsui_with-toolbar_1r9lg_7nc4m_254",
13
+ "slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_7nc4m_258",
14
+ "slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_7nc4m_269",
15
+ "open-button-side": "awsui_open-button-side_1r9lg_7nc4m_283",
16
+ "pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_7nc4m_292",
17
+ "drawer-mobile": "awsui_drawer-mobile_1r9lg_7nc4m_302",
18
+ "drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_7nc4m_306",
19
+ "content-bottom": "awsui_content-bottom_1r9lg_7nc4m_318",
20
+ "pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_7nc4m_337",
21
+ "pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_7nc4m_342",
22
+ "pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_7nc4m_346",
23
+ "content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_7nc4m_350",
24
+ "content-side": "awsui_content-side_1r9lg_7nc4m_355",
25
+ "pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_7nc4m_367",
26
+ "pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_7nc4m_376",
27
+ "header": "awsui_header_1r9lg_7nc4m_387",
28
+ "header-text": "awsui_header-text_1r9lg_7nc4m_400",
29
+ "header-actions": "awsui_header-actions_1r9lg_7nc4m_414",
30
+ "divider": "awsui_divider_1r9lg_7nc4m_422"
31
31
  };
32
32
 
@@ -150,7 +150,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
150
150
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
151
151
  SPDX-License-Identifier: Apache-2.0
152
152
  */
153
- .awsui_drawer_1r9lg_100o3_153:not(#\9) {
153
+ .awsui_drawer_1r9lg_7nc4m_153:not(#\9) {
154
154
  border-collapse: separate;
155
155
  border-spacing: 0;
156
156
  box-sizing: border-box;
@@ -187,35 +187,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
187
187
  background-color: var(--color-background-layout-panel-content-9tbx75, #ffffff);
188
188
  z-index: 840;
189
189
  }
190
- .awsui_drawer-closed_1r9lg_100o3_190:not(#\9):not(.awsui_refresh_1r9lg_100o3_190) {
190
+ .awsui_drawer-closed_1r9lg_7nc4m_190:not(#\9) {
191
191
  cursor: pointer;
192
+ }
193
+ .awsui_drawer-closed_1r9lg_7nc4m_190:not(#\9):not(.awsui_refresh_1r9lg_7nc4m_193) {
192
194
  min-inline-size: 40px;
193
195
  }
194
196
 
195
- .awsui_drawer-content-side_1r9lg_100o3_195:not(#\9) {
197
+ .awsui_drawer-content-side_1r9lg_7nc4m_197:not(#\9) {
196
198
  display: flex;
197
199
  align-items: center;
198
200
  block-size: 100%;
199
201
  overflow: auto;
200
202
  }
201
- .awsui_drawer-content-side_1r9lg_100o3_195 > [aria-hidden=true]:not(#\9), .awsui_drawer-closed_1r9lg_100o3_190.awsui_refresh_1r9lg_100o3_190 > .awsui_drawer-content-side_1r9lg_100o3_195:not(#\9) {
203
+ .awsui_drawer-content-side_1r9lg_7nc4m_197 > [aria-hidden=true]:not(#\9), .awsui_drawer-closed_1r9lg_7nc4m_190.awsui_refresh_1r9lg_7nc4m_193 > .awsui_drawer-content-side_1r9lg_7nc4m_197:not(#\9) {
202
204
  display: none;
203
205
  }
204
- .awsui_drawer-closed_1r9lg_100o3_190:not(#\9):not(.awsui_refresh_1r9lg_100o3_190) > .awsui_drawer-content-side_1r9lg_100o3_195 {
206
+ .awsui_drawer-closed_1r9lg_7nc4m_190:not(#\9):not(.awsui_refresh_1r9lg_7nc4m_193) > .awsui_drawer-content-side_1r9lg_7nc4m_197 {
205
207
  inline-size: 40px;
206
208
  }
207
- .awsui_drawer-closed_1r9lg_100o3_190:not(#\9):not(.awsui_refresh_1r9lg_100o3_190) > .awsui_drawer-content-side_1r9lg_100o3_195:hover {
209
+ .awsui_drawer-closed_1r9lg_7nc4m_190:not(#\9):not(.awsui_refresh_1r9lg_7nc4m_193) > .awsui_drawer-content-side_1r9lg_7nc4m_197:hover {
208
210
  background: var(--color-background-layout-panel-hover-5jdzo1, #eaeded);
209
211
  }
210
212
 
211
- :not(#\9):not(.awsui_drawer-closed_1r9lg_100o3_190) > .awsui_drawer-content-bottom_1r9lg_100o3_211 {
213
+ :not(#\9):not(.awsui_drawer-closed_1r9lg_7nc4m_190) > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 {
212
214
  overflow-y: auto;
213
215
  position: absolute;
214
216
  inset: 0;
215
217
  clip-path: border-box;
216
218
  }
217
219
 
218
- .awsui_position-bottom_1r9lg_100o3_218:not(#\9) {
220
+ .awsui_position-bottom_1r9lg_7nc4m_220:not(#\9) {
219
221
  position: fixed;
220
222
  overflow-y: auto;
221
223
  /*
@@ -223,37 +225,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
223
225
  SplitPanel is no longer in fixed position in the DOM.
224
226
  */
225
227
  }
226
- .awsui_position-bottom_1r9lg_100o3_218:not(#\9):not(.awsui_hidden_1r9lg_100o3_226) {
228
+ .awsui_position-bottom_1r9lg_7nc4m_220:not(#\9):not(.awsui_hidden_1r9lg_7nc4m_228) {
227
229
  border-block-start: var(--border-panel-top-width-a8j764, 0px) solid var(--color-border-divider-panel-bottom-x9b7bd, rgba(0, 28, 36, 0.15));
228
230
  }
229
- .awsui_position-bottom_1r9lg_100o3_218:not(#\9):not(.awsui_refresh_1r9lg_100o3_190) {
231
+ .awsui_position-bottom_1r9lg_7nc4m_220:not(#\9):not(.awsui_refresh_1r9lg_7nc4m_193) {
230
232
  box-shadow: var(--shadow-split-bottom-0ncj9i, 0 -2px 1px -1px rgba(0, 28, 36, 0.15), 0 -1px 1px -1px rgba(0, 28, 36, 0.3));
231
233
  border-inline-start: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-divider-panel-bottom-x9b7bd, rgba(0, 28, 36, 0.15));
232
234
  border-inline-end: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-divider-panel-bottom-x9b7bd, rgba(0, 28, 36, 0.15));
233
235
  }
234
- .awsui_position-bottom_1r9lg_100o3_218.awsui_drawer-closed_1r9lg_100o3_190:not(#\9) {
236
+ .awsui_position-bottom_1r9lg_7nc4m_220.awsui_drawer-closed_1r9lg_7nc4m_190:not(#\9) {
235
237
  overflow: hidden;
236
238
  }
237
- .awsui_position-bottom_1r9lg_100o3_218.awsui_drawer-closed_1r9lg_100o3_190:not(#\9):hover {
239
+ .awsui_position-bottom_1r9lg_7nc4m_220.awsui_drawer-closed_1r9lg_7nc4m_190:not(#\9):hover {
238
240
  background: var(--color-background-layout-panel-hover-5jdzo1, #eaeded);
239
241
  }
240
- .awsui_position-bottom_1r9lg_100o3_218 > .awsui_drawer-content-bottom_1r9lg_100o3_211 > [aria-hidden=true]:not(#\9) {
242
+ .awsui_position-bottom_1r9lg_7nc4m_220 > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > [aria-hidden=true]:not(#\9) {
241
243
  display: none;
242
244
  }
243
- .awsui_position-bottom_1r9lg_100o3_218.awsui_refresh_1r9lg_100o3_190:not(#\9) {
245
+ .awsui_position-bottom_1r9lg_7nc4m_220.awsui_refresh_1r9lg_7nc4m_193:not(#\9) {
244
246
  position: relative;
245
247
  }
246
248
 
247
- .awsui_position-side_1r9lg_100o3_247:not(#\9) {
249
+ .awsui_position-side_1r9lg_7nc4m_249:not(#\9) {
248
250
  border-block-start: none;
249
251
  box-shadow: var(--shadow-split-side-wm3dcf, 0 1px 1px 0 rgba(0, 28, 36, 0.3), 1px 1px 1px 0 rgba(0, 28, 36, 0.15), -1px 1px 1px 0 rgba(0, 28, 36, 0.15));
250
252
  block-size: 100%;
251
253
  }
252
- .awsui_position-side_1r9lg_100o3_247.awsui_with-toolbar_1r9lg_100o3_252:not(#\9) {
254
+ .awsui_position-side_1r9lg_7nc4m_249.awsui_with-toolbar_1r9lg_7nc4m_254:not(#\9) {
253
255
  box-shadow: none;
254
256
  }
255
257
 
256
- .awsui_slider-wrapper-bottom_1r9lg_100o3_256:not(#\9) {
258
+ .awsui_slider-wrapper-bottom_1r9lg_7nc4m_258:not(#\9) {
257
259
  position: absolute;
258
260
  inset-block-start: 0;
259
261
  inset-inline-start: 0;
@@ -264,7 +266,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
264
266
  z-index: 2;
265
267
  }
266
268
 
267
- .awsui_slider-wrapper-side_1r9lg_100o3_267:not(#\9) {
269
+ .awsui_slider-wrapper-side_1r9lg_7nc4m_269:not(#\9) {
268
270
  position: absolute;
269
271
  inset-inline-start: 0;
270
272
  inset-block-start: 0;
@@ -274,11 +276,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
274
276
  align-items: center;
275
277
  z-index: 1;
276
278
  }
277
- .awsui_slider-wrapper-side_1r9lg_100o3_267.awsui_with-toolbar_1r9lg_100o3_252:not(#\9) {
279
+ .awsui_slider-wrapper-side_1r9lg_7nc4m_269.awsui_with-toolbar_1r9lg_7nc4m_254:not(#\9) {
278
280
  position: unset;
279
281
  }
280
282
 
281
- .awsui_open-button-side_1r9lg_100o3_281:not(#\9) {
283
+ .awsui_open-button-side_1r9lg_7nc4m_283:not(#\9) {
282
284
  flex: 0 0 auto;
283
285
  align-self: flex-start;
284
286
  box-sizing: border-box;
@@ -287,7 +289,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
287
289
  margin-inline: auto;
288
290
  }
289
291
 
290
- .awsui_pane-header-wrapper-bottom_1r9lg_100o3_290:not(#\9) {
292
+ .awsui_pane-header-wrapper-bottom_1r9lg_7nc4m_292:not(#\9) {
291
293
  position: sticky;
292
294
  inset-block-start: 0;
293
295
  display: flex;
@@ -297,60 +299,60 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
297
299
  padding-block: 0;
298
300
  padding-inline: var(--space-layout-content-horizontal-q3zhej, 40px);
299
301
  }
300
- .awsui_drawer-mobile_1r9lg_100o3_300 > .awsui_drawer-content-bottom_1r9lg_100o3_211 > .awsui_pane-header-wrapper-bottom_1r9lg_100o3_290:not(#\9) {
302
+ .awsui_drawer-mobile_1r9lg_7nc4m_302 > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > .awsui_pane-header-wrapper-bottom_1r9lg_7nc4m_292:not(#\9) {
301
303
  padding-block: 0;
302
304
  padding-inline: var(--space-l-3cws6j, 20px);
303
305
  }
304
- .awsui_drawer-disable-content-paddings_1r9lg_100o3_304 > .awsui_drawer-content-bottom_1r9lg_100o3_211 > .awsui_pane-header-wrapper-bottom_1r9lg_100o3_290:not(#\9) {
306
+ .awsui_drawer-disable-content-paddings_1r9lg_7nc4m_306 > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > .awsui_pane-header-wrapper-bottom_1r9lg_7nc4m_292:not(#\9) {
305
307
  padding-block: 0;
306
308
  padding-inline: var(--space-l-3cws6j, 20px);
307
309
  }
308
- :not(#\9):not(.awsui_drawer-closed_1r9lg_100o3_190) > .awsui_drawer-content-bottom_1r9lg_100o3_211 > .awsui_pane-header-wrapper-bottom_1r9lg_100o3_290 {
310
+ :not(#\9):not(.awsui_drawer-closed_1r9lg_7nc4m_190) > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > .awsui_pane-header-wrapper-bottom_1r9lg_7nc4m_292 {
309
311
  background-color: var(--color-background-layout-panel-content-9tbx75, #ffffff);
310
312
  border-block-end: var(--border-panel-header-width-r62i4a, 0px) solid var(--color-border-panel-header-iffljr, #eaeded);
311
313
  }
312
- .awsui_with-toolbar_1r9lg_100o3_252:not(#\9):not(.awsui_drawer-closed_1r9lg_100o3_190) > .awsui_drawer-content-bottom_1r9lg_100o3_211 > .awsui_pane-header-wrapper-bottom_1r9lg_100o3_290 {
314
+ .awsui_with-toolbar_1r9lg_7nc4m_254:not(#\9):not(.awsui_drawer-closed_1r9lg_7nc4m_190) > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > .awsui_pane-header-wrapper-bottom_1r9lg_7nc4m_292 {
313
315
  border-color: transparent;
314
316
  }
315
317
 
316
- .awsui_content-bottom_1r9lg_100o3_316:not(#\9) {
318
+ .awsui_content-bottom_1r9lg_7nc4m_318:not(#\9) {
317
319
  padding-block: 0;
318
320
  padding-inline: var(--space-layout-content-horizontal-q3zhej, 40px);
319
321
  margin-block-start: var(--space-panel-split-top-q9gv78, 0px);
320
322
  position: relative;
321
323
  z-index: 0;
322
324
  }
323
- .awsui_with-toolbar_1r9lg_100o3_252 > .awsui_drawer-content-bottom_1r9lg_100o3_211 > .awsui_content-bottom_1r9lg_100o3_316:not(#\9) {
325
+ .awsui_with-toolbar_1r9lg_7nc4m_254 > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > .awsui_content-bottom_1r9lg_7nc4m_318:not(#\9) {
324
326
  margin-block-start: 0px;
325
327
  }
326
- .awsui_drawer-mobile_1r9lg_100o3_300 > .awsui_drawer-content-bottom_1r9lg_100o3_211 > .awsui_content-bottom_1r9lg_100o3_316:not(#\9) {
328
+ .awsui_drawer-mobile_1r9lg_7nc4m_302 > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > .awsui_content-bottom_1r9lg_7nc4m_318:not(#\9) {
327
329
  padding-block: 0;
328
330
  padding-inline: var(--space-l-3cws6j, 20px);
329
331
  }
330
- .awsui_drawer-disable-content-paddings_1r9lg_100o3_304 > .awsui_drawer-content-bottom_1r9lg_100o3_211 > .awsui_content-bottom_1r9lg_100o3_316:not(#\9) {
332
+ .awsui_drawer-disable-content-paddings_1r9lg_7nc4m_306 > .awsui_drawer-content-bottom_1r9lg_7nc4m_213 > .awsui_content-bottom_1r9lg_7nc4m_318:not(#\9) {
331
333
  padding-block: 0;
332
334
  padding-inline: 0;
333
335
  }
334
336
 
335
- .awsui_pane-bottom-center-align_1r9lg_100o3_335:not(#\9) {
337
+ .awsui_pane-bottom-center-align_1r9lg_7nc4m_337:not(#\9) {
336
338
  display: flex;
337
339
  justify-content: center;
338
340
  }
339
341
 
340
- .awsui_pane-bottom-content-nav-padding_1r9lg_100o3_340:not(#\9) {
342
+ .awsui_pane-bottom-content-nav-padding_1r9lg_7nc4m_342:not(#\9) {
341
343
  padding-inline-start: calc(var(--space-layout-toggle-diameter-vount6, 36px) + 2 * var(--space-layout-toggle-padding-quc8b2, 12px));
342
344
  }
343
345
 
344
- .awsui_pane-bottom-content-tools-padding_1r9lg_100o3_344:not(#\9) {
346
+ .awsui_pane-bottom-content-tools-padding_1r9lg_7nc4m_346:not(#\9) {
345
347
  padding-inline-end: calc(var(--space-layout-toggle-diameter-vount6, 36px) + 2 * var(--space-layout-toggle-padding-quc8b2, 12px));
346
348
  }
347
349
 
348
- .awsui_content-bottom-max-width_1r9lg_100o3_348:not(#\9) {
350
+ .awsui_content-bottom-max-width_1r9lg_7nc4m_350:not(#\9) {
349
351
  flex-grow: 1;
350
352
  max-inline-size: 100%;
351
353
  }
352
354
 
353
- .awsui_content-side_1r9lg_100o3_353:not(#\9) {
355
+ .awsui_content-side_1r9lg_7nc4m_355:not(#\9) {
354
356
  flex: auto;
355
357
  align-self: flex-start;
356
358
  box-sizing: border-box;
@@ -359,30 +361,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
359
361
  inset-inline: 0;
360
362
  block-size: 100%;
361
363
  }
362
- .awsui_content-side_1r9lg_100o3_353.awsui_with-toolbar_1r9lg_100o3_252:not(#\9) {
364
+ .awsui_content-side_1r9lg_7nc4m_355.awsui_with-toolbar_1r9lg_7nc4m_254:not(#\9) {
363
365
  position: absolute;
364
366
  }
365
- .awsui_content-side_1r9lg_100o3_353 > .awsui_pane-header-wrapper-side_1r9lg_100o3_365:not(#\9) {
367
+ .awsui_content-side_1r9lg_7nc4m_355 > .awsui_pane-header-wrapper-side_1r9lg_7nc4m_367:not(#\9) {
366
368
  padding-block: 0;
367
369
  padding-inline-end: var(--space-m-n2lypl, 16px);
368
370
  padding-inline-start: var(--space-panel-side-left-07kpj4, 32px);
369
371
  border-block-end: var(--border-panel-header-width-r62i4a, 0px) solid var(--color-border-panel-header-iffljr, #eaeded);
370
372
  }
371
- .awsui_content-side_1r9lg_100o3_353.awsui_with-toolbar_1r9lg_100o3_252 > .awsui_pane-header-wrapper-side_1r9lg_100o3_365:not(#\9) {
373
+ .awsui_content-side_1r9lg_7nc4m_355.awsui_with-toolbar_1r9lg_7nc4m_254 > .awsui_pane-header-wrapper-side_1r9lg_7nc4m_367:not(#\9) {
372
374
  border-color: transparent;
373
375
  }
374
- .awsui_content-side_1r9lg_100o3_353 > .awsui_pane-content-wrapper-side_1r9lg_100o3_374:not(#\9) {
376
+ .awsui_content-side_1r9lg_7nc4m_355 > .awsui_pane-content-wrapper-side_1r9lg_7nc4m_376:not(#\9) {
375
377
  padding-block: 0;
376
378
  padding-inline-start: var(--space-panel-side-left-07kpj4, 32px);
377
379
  padding-inline-end: var(--space-panel-side-right-b77xx0, 32px);
378
380
  margin-block-start: var(--space-panel-split-top-q9gv78, 0px);
379
381
  margin-block-end: var(--space-panel-split-bottom-wmd8np, 20px);
380
382
  }
381
- .awsui_content-side_1r9lg_100o3_353.awsui_with-toolbar_1r9lg_100o3_252 > .awsui_pane-content-wrapper-side_1r9lg_100o3_374:not(#\9) {
383
+ .awsui_content-side_1r9lg_7nc4m_355.awsui_with-toolbar_1r9lg_7nc4m_254 > .awsui_pane-content-wrapper-side_1r9lg_7nc4m_376:not(#\9) {
382
384
  margin-block-start: 0px;
383
385
  }
384
386
 
385
- .awsui_header_1r9lg_100o3_385:not(#\9) {
387
+ .awsui_header_1r9lg_7nc4m_387:not(#\9) {
386
388
  display: flex;
387
389
  flex: auto;
388
390
  flex-direction: row;
@@ -392,10 +394,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
392
394
  margin-block: var(--size-vertical-panel-icon-offset-1tiizm, 15px);
393
395
  margin-inline: 0;
394
396
  }
395
- .awsui_header_1r9lg_100o3_385.awsui_with-toolbar_1r9lg_100o3_252:not(#\9) {
397
+ .awsui_header_1r9lg_7nc4m_387.awsui_with-toolbar_1r9lg_7nc4m_254:not(#\9) {
396
398
  margin-block: 14px;
397
399
  }
398
- .awsui_header-text_1r9lg_100o3_398:not(#\9) {
400
+ .awsui_header-text_1r9lg_7nc4m_400:not(#\9) {
399
401
  font-size: var(--font-panel-header-size-i1j838, 18px);
400
402
  letter-spacing: var(--letter-spacing-heading-m-93y02s, normal);
401
403
  line-height: var(--font-panel-header-line-height-z3wpa5, 22px);
@@ -409,7 +411,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
409
411
  margin-block-start: calc(var(--space-scaled-xxs-jatbiv, 4px) + 1px);
410
412
  }
411
413
 
412
- .awsui_header-actions_1r9lg_100o3_412:not(#\9) {
414
+ .awsui_header-actions_1r9lg_7nc4m_414:not(#\9) {
413
415
  display: flex;
414
416
  flex-direction: row;
415
417
  justify-content: space-between;
@@ -417,7 +419,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
417
419
  margin-inline-start: var(--space-xs-kw7k3v, 8px);
418
420
  }
419
421
 
420
- .awsui_divider_1r9lg_100o3_420:not(#\9) {
422
+ .awsui_divider_1r9lg_7nc4m_422:not(#\9) {
421
423
  border-inline-end: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-divider-default-ipvpev, #eaeded);
422
424
  margin-block: var(--space-scaled-xxs-jatbiv, 4px);
423
425
  margin-inline: var(--space-scaled-xs-sppte9, 8px);
@@ -2,32 +2,32 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "drawer": "awsui_drawer_1r9lg_100o3_153",
6
- "drawer-closed": "awsui_drawer-closed_1r9lg_100o3_190",
7
- "refresh": "awsui_refresh_1r9lg_100o3_190",
8
- "drawer-content-side": "awsui_drawer-content-side_1r9lg_100o3_195",
9
- "drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_100o3_211",
10
- "position-bottom": "awsui_position-bottom_1r9lg_100o3_218",
11
- "hidden": "awsui_hidden_1r9lg_100o3_226",
12
- "position-side": "awsui_position-side_1r9lg_100o3_247",
13
- "with-toolbar": "awsui_with-toolbar_1r9lg_100o3_252",
14
- "slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_100o3_256",
15
- "slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_100o3_267",
16
- "open-button-side": "awsui_open-button-side_1r9lg_100o3_281",
17
- "pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_100o3_290",
18
- "drawer-mobile": "awsui_drawer-mobile_1r9lg_100o3_300",
19
- "drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_100o3_304",
20
- "content-bottom": "awsui_content-bottom_1r9lg_100o3_316",
21
- "pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_100o3_335",
22
- "pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_100o3_340",
23
- "pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_100o3_344",
24
- "content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_100o3_348",
25
- "content-side": "awsui_content-side_1r9lg_100o3_353",
26
- "pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_100o3_365",
27
- "pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_100o3_374",
28
- "header": "awsui_header_1r9lg_100o3_385",
29
- "header-text": "awsui_header-text_1r9lg_100o3_398",
30
- "header-actions": "awsui_header-actions_1r9lg_100o3_412",
31
- "divider": "awsui_divider_1r9lg_100o3_420"
5
+ "drawer": "awsui_drawer_1r9lg_7nc4m_153",
6
+ "drawer-closed": "awsui_drawer-closed_1r9lg_7nc4m_190",
7
+ "refresh": "awsui_refresh_1r9lg_7nc4m_193",
8
+ "drawer-content-side": "awsui_drawer-content-side_1r9lg_7nc4m_197",
9
+ "drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_7nc4m_213",
10
+ "position-bottom": "awsui_position-bottom_1r9lg_7nc4m_220",
11
+ "hidden": "awsui_hidden_1r9lg_7nc4m_228",
12
+ "position-side": "awsui_position-side_1r9lg_7nc4m_249",
13
+ "with-toolbar": "awsui_with-toolbar_1r9lg_7nc4m_254",
14
+ "slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_7nc4m_258",
15
+ "slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_7nc4m_269",
16
+ "open-button-side": "awsui_open-button-side_1r9lg_7nc4m_283",
17
+ "pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_7nc4m_292",
18
+ "drawer-mobile": "awsui_drawer-mobile_1r9lg_7nc4m_302",
19
+ "drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_7nc4m_306",
20
+ "content-bottom": "awsui_content-bottom_1r9lg_7nc4m_318",
21
+ "pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_7nc4m_337",
22
+ "pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_7nc4m_342",
23
+ "pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_7nc4m_346",
24
+ "content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_7nc4m_350",
25
+ "content-side": "awsui_content-side_1r9lg_7nc4m_355",
26
+ "pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_7nc4m_367",
27
+ "pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_7nc4m_376",
28
+ "header": "awsui_header_1r9lg_7nc4m_387",
29
+ "header-text": "awsui_header-text_1r9lg_7nc4m_400",
30
+ "header-actions": "awsui_header-actions_1r9lg_7nc4m_414",
31
+ "divider": "awsui_divider_1r9lg_7nc4m_422"
32
32
  };
33
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.1068",
3
+ "version": "3.0.1070",
4
4
  "files": [
5
5
  "lib"
6
6
  ],