@cloudscape-design/components 3.0.1318 → 3.0.1319
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/app-layout/drawer/overflow-menu.d.ts +2 -1
- package/app-layout/drawer/overflow-menu.d.ts.map +1 -1
- package/app-layout/drawer/overflow-menu.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -25
- package/attribute-editor/styles.selectors.js +15 -15
- package/breadcrumb-group/implementation.d.ts +2 -1
- package/breadcrumb-group/implementation.d.ts.map +1 -1
- package/breadcrumb-group/implementation.js.map +1 -1
- package/breadcrumb-group/interfaces.d.ts +0 -4
- package/breadcrumb-group/interfaces.d.ts.map +1 -1
- package/breadcrumb-group/interfaces.js.map +1 -1
- package/breadcrumb-group/internal-interfaces.d.ts +5 -0
- package/breadcrumb-group/internal-interfaces.d.ts.map +1 -0
- package/breadcrumb-group/internal-interfaces.js +2 -0
- package/breadcrumb-group/internal-interfaces.js.map +1 -0
- package/breadcrumb-group/skeleton.js.map +1 -1
- package/button-dropdown/category-elements/category-element.d.ts +1 -1
- package/button-dropdown/category-elements/category-element.d.ts.map +1 -1
- package/button-dropdown/category-elements/category-element.js.map +1 -1
- package/button-dropdown/category-elements/expandable-category-element.d.ts +1 -1
- package/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
- package/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
- package/button-dropdown/category-elements/mobile-expandable-category-element.d.ts +1 -1
- package/button-dropdown/category-elements/mobile-expandable-category-element.d.ts.map +1 -1
- package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
- package/button-dropdown/interfaces.d.ts +1 -102
- package/button-dropdown/interfaces.d.ts.map +1 -1
- package/button-dropdown/interfaces.js.map +1 -1
- package/button-dropdown/internal-interfaces.d.ts +103 -0
- package/button-dropdown/internal-interfaces.d.ts.map +1 -0
- package/button-dropdown/internal-interfaces.js +2 -0
- package/button-dropdown/internal-interfaces.js.map +1 -0
- package/button-dropdown/internal.d.ts +2 -1
- package/button-dropdown/internal.d.ts.map +1 -1
- package/button-dropdown/internal.js.map +1 -1
- package/button-dropdown/item-element/index.d.ts +1 -1
- package/button-dropdown/item-element/index.d.ts.map +1 -1
- package/button-dropdown/item-element/index.js.map +1 -1
- package/button-dropdown/items-list.d.ts +1 -1
- package/button-dropdown/items-list.d.ts.map +1 -1
- package/button-dropdown/items-list.js.map +1 -1
- package/button-group/icon-button-item.d.ts +2 -1
- package/button-group/icon-button-item.d.ts.map +1 -1
- package/button-group/icon-button-item.js.map +1 -1
- package/button-group/icon-toggle-button-item.d.ts +2 -1
- package/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/button-group/icon-toggle-button-item.js.map +1 -1
- package/button-group/interfaces.d.ts +0 -14
- package/button-group/interfaces.d.ts.map +1 -1
- package/button-group/interfaces.js.map +1 -1
- package/button-group/internal-interfaces.d.ts +15 -0
- package/button-group/internal-interfaces.d.ts.map +1 -0
- package/button-group/internal-interfaces.js +2 -0
- package/button-group/internal-interfaces.js.map +1 -0
- package/button-group/internal.d.ts +2 -1
- package/button-group/internal.d.ts.map +1 -1
- package/button-group/internal.js.map +1 -1
- package/column-layout/flexible-column-layout/index.d.ts +1 -1
- package/column-layout/flexible-column-layout/index.d.ts.map +1 -1
- package/column-layout/flexible-column-layout/index.js.map +1 -1
- package/column-layout/grid-column-layout.d.ts +1 -1
- package/column-layout/grid-column-layout.d.ts.map +1 -1
- package/column-layout/grid-column-layout.js.map +1 -1
- package/column-layout/interfaces.d.ts +0 -9
- package/column-layout/interfaces.d.ts.map +1 -1
- package/column-layout/interfaces.js.map +1 -1
- package/column-layout/internal-interfaces.d.ts +10 -0
- package/column-layout/internal-interfaces.d.ts.map +1 -0
- package/column-layout/internal-interfaces.js +2 -0
- package/column-layout/internal-interfaces.js.map +1 -0
- package/column-layout/internal.d.ts +1 -1
- package/column-layout/internal.d.ts.map +1 -1
- package/column-layout/internal.js.map +1 -1
- package/expandable-section/expandable-section-container.d.ts +1 -1
- package/expandable-section/expandable-section-container.d.ts.map +1 -1
- package/expandable-section/expandable-section-container.js.map +1 -1
- package/expandable-section/expandable-section-header.d.ts +2 -1
- package/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/expandable-section/interfaces.d.ts +0 -1
- package/expandable-section/interfaces.d.ts.map +1 -1
- package/expandable-section/interfaces.js.map +1 -1
- package/expandable-section/internal-interfaces.d.ts +2 -0
- package/expandable-section/internal-interfaces.d.ts.map +1 -0
- package/expandable-section/internal-interfaces.js +2 -0
- package/expandable-section/internal-interfaces.js.map +1 -0
- package/expandable-section/internal.d.ts +2 -1
- package/expandable-section/internal.d.ts.map +1 -1
- package/expandable-section/internal.js.map +1 -1
- package/expandable-section/styles.css.js +35 -35
- package/expandable-section/styles.scoped.css +71 -74
- package/expandable-section/styles.selectors.js +35 -35
- package/expandable-section/utils.d.ts +1 -1
- package/expandable-section/utils.d.ts.map +1 -1
- package/expandable-section/utils.js.map +1 -1
- package/flashbar/collapsible-flashbar.d.ts +1 -1
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/common.d.ts +2 -1
- package/flashbar/common.d.ts.map +1 -1
- package/flashbar/common.js.map +1 -1
- package/flashbar/implementation.d.ts +1 -1
- package/flashbar/implementation.d.ts.map +1 -1
- package/flashbar/implementation.js.map +1 -1
- package/flashbar/interfaces.d.ts +1 -3
- package/flashbar/interfaces.d.ts.map +1 -1
- package/flashbar/interfaces.js.map +1 -1
- package/flashbar/internal-interfaces.d.ts +3 -0
- package/flashbar/internal-interfaces.d.ts.map +1 -0
- package/flashbar/internal-interfaces.js +2 -0
- package/flashbar/internal-interfaces.js.map +1 -0
- package/flashbar/non-collapsible-flashbar.d.ts +1 -1
- package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/form-field/interfaces.d.ts +2 -15
- package/form-field/interfaces.d.ts.map +1 -1
- package/form-field/interfaces.js.map +1 -1
- package/form-field/internal-interfaces.d.ts +16 -0
- package/form-field/internal-interfaces.d.ts.map +1 -0
- package/form-field/internal-interfaces.js +2 -0
- package/form-field/internal-interfaces.js.map +1 -0
- package/form-field/internal.d.ts +1 -1
- package/form-field/internal.d.ts.map +1 -1
- package/form-field/internal.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/menu-dropdown/interfaces.d.ts +1 -1
- package/internal/components/menu-dropdown/interfaces.d.ts.map +1 -1
- package/internal/components/menu-dropdown/interfaces.js.map +1 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/item-card/interfaces.d.ts +0 -19
- package/item-card/interfaces.d.ts.map +1 -1
- package/item-card/interfaces.js.map +1 -1
- package/item-card/internal-interfaces.d.ts +21 -0
- package/item-card/internal-interfaces.d.ts.map +1 -0
- package/item-card/internal-interfaces.js +2 -0
- package/item-card/internal-interfaces.js.map +1 -0
- package/item-card/internal.d.ts +1 -1
- package/item-card/internal.d.ts.map +1 -1
- package/item-card/internal.js.map +1 -1
- package/manifest.json +2 -2
- package/mixed-line-bar-chart/chart-container.d.ts +2 -1
- package/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/mixed-line-bar-chart/chart-legend.d.ts +2 -1
- package/mixed-line-bar-chart/chart-legend.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-legend.js.map +1 -1
- package/mixed-line-bar-chart/data-series.d.ts +2 -1
- package/mixed-line-bar-chart/data-series.d.ts.map +1 -1
- package/mixed-line-bar-chart/data-series.js.map +1 -1
- package/mixed-line-bar-chart/domain.d.ts +2 -1
- package/mixed-line-bar-chart/domain.d.ts.map +1 -1
- package/mixed-line-bar-chart/domain.js.map +1 -1
- package/mixed-line-bar-chart/format-highlighted.d.ts +2 -1
- package/mixed-line-bar-chart/format-highlighted.d.ts.map +1 -1
- package/mixed-line-bar-chart/format-highlighted.js.map +1 -1
- package/mixed-line-bar-chart/interfaces.d.ts +0 -5
- package/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
- package/mixed-line-bar-chart/interfaces.js.map +1 -1
- package/mixed-line-bar-chart/internal-interfaces.d.ts +6 -0
- package/mixed-line-bar-chart/internal-interfaces.d.ts.map +1 -0
- package/mixed-line-bar-chart/internal-interfaces.js +2 -0
- package/mixed-line-bar-chart/internal-interfaces.js.map +1 -0
- package/mixed-line-bar-chart/make-scaled-bar-groups.d.ts +2 -1
- package/mixed-line-bar-chart/make-scaled-bar-groups.d.ts.map +1 -1
- package/mixed-line-bar-chart/make-scaled-bar-groups.js.map +1 -1
- package/mixed-line-bar-chart/make-scaled-series.d.ts +2 -1
- package/mixed-line-bar-chart/make-scaled-series.d.ts.map +1 -1
- package/mixed-line-bar-chart/make-scaled-series.js.map +1 -1
- package/mixed-line-bar-chart/utils.d.ts +2 -1
- package/mixed-line-bar-chart/utils.d.ts.map +1 -1
- package/mixed-line-bar-chart/utils.js.map +1 -1
- package/navigable-group/interfaces.d.ts +0 -2
- package/navigable-group/interfaces.d.ts.map +1 -1
- package/navigable-group/interfaces.js.map +1 -1
- package/navigable-group/internal-interfaces.d.ts +3 -0
- package/navigable-group/internal-interfaces.d.ts.map +1 -0
- package/navigable-group/internal-interfaces.js +4 -0
- package/navigable-group/internal-interfaces.js.map +1 -0
- package/navigable-group/internal.d.ts +2 -1
- package/navigable-group/internal.d.ts.map +1 -1
- package/navigable-group/internal.js.map +1 -1
- package/package.json +1 -1
- package/popover/arrow.d.ts +1 -1
- package/popover/arrow.d.ts.map +1 -1
- package/popover/arrow.js.map +1 -1
- package/popover/container.d.ts +2 -1
- package/popover/container.d.ts.map +1 -1
- package/popover/container.js.map +1 -1
- package/popover/interfaces.d.ts +0 -4
- package/popover/interfaces.d.ts.map +1 -1
- package/popover/interfaces.js.map +1 -1
- package/popover/internal-interfaces.d.ts +4 -0
- package/popover/internal-interfaces.d.ts.map +1 -0
- package/popover/internal-interfaces.js +4 -0
- package/popover/internal-interfaces.js.map +1 -0
- package/popover/use-popover-position.d.ts +2 -1
- package/popover/use-popover-position.d.ts.map +1 -1
- package/popover/use-popover-position.js.map +1 -1
- package/popover/utils/positions.d.ts +2 -1
- package/popover/utils/positions.d.ts.map +1 -1
- package/popover/utils/positions.js.map +1 -1
- package/property-filter/controller.d.ts +2 -1
- package/property-filter/controller.d.ts.map +1 -1
- package/property-filter/controller.js.map +1 -1
- package/property-filter/i18n-utils.d.ts +2 -1
- package/property-filter/i18n-utils.d.ts.map +1 -1
- package/property-filter/i18n-utils.js.map +1 -1
- package/property-filter/interfaces.d.ts +2 -51
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/property-filter/internal-interfaces.d.ts +51 -0
- package/property-filter/internal-interfaces.d.ts.map +1 -0
- package/property-filter/internal-interfaces.js +4 -0
- package/property-filter/internal-interfaces.js.map +1 -0
- package/property-filter/internal.d.ts.map +1 -1
- package/property-filter/internal.js.map +1 -1
- package/property-filter/property-editor.d.ts +2 -1
- package/property-filter/property-editor.d.ts.map +1 -1
- package/property-filter/property-editor.js.map +1 -1
- package/property-filter/token-editor-inputs.d.ts +2 -1
- package/property-filter/token-editor-inputs.d.ts.map +1 -1
- package/property-filter/token-editor-inputs.js.map +1 -1
- package/property-filter/token-editor.d.ts +2 -1
- package/property-filter/token-editor.d.ts.map +1 -1
- package/property-filter/token-editor.js.map +1 -1
- package/property-filter/token.d.ts +2 -1
- package/property-filter/token.d.ts.map +1 -1
- package/property-filter/token.js.map +1 -1
- package/property-filter/utils.d.ts +2 -1
- package/property-filter/utils.d.ts.map +1 -1
- package/property-filter/utils.js.map +1 -1
- package/table/interfaces.d.ts +0 -1
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/internal-interfaces.d.ts +2 -0
- package/table/internal-interfaces.d.ts.map +1 -0
- package/table/internal-interfaces.js +2 -0
- package/table/internal-interfaces.js.map +1 -0
- package/table/selection/use-group-selection.d.ts +2 -1
- package/table/selection/use-group-selection.d.ts.map +1 -1
- package/table/selection/use-group-selection.js.map +1 -1
- package/table/selection/use-selection-focus-move.d.ts +1 -1
- package/table/selection/use-selection-focus-move.d.ts.map +1 -1
- package/table/selection/use-selection-focus-move.js.map +1 -1
- package/table/selection/use-selection.d.ts +2 -1
- package/table/selection/use-selection.d.ts.map +1 -1
- package/table/selection/use-selection.js.map +1 -1
- package/table/thead.d.ts +2 -1
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js.map +1 -1
- package/table/use-table-focus-navigation.d.ts +2 -1
- package/table/use-table-focus-navigation.d.ts.map +1 -1
- package/table/use-table-focus-navigation.js.map +1 -1
- package/tooltip/interfaces.d.ts +0 -10
- package/tooltip/interfaces.d.ts.map +1 -1
- package/tooltip/interfaces.js.map +1 -1
- package/tooltip/internal-interfaces.d.ts +11 -0
- package/tooltip/internal-interfaces.d.ts.map +1 -0
- package/tooltip/internal-interfaces.js +2 -0
- package/tooltip/internal-interfaces.js.map +1 -0
- package/tooltip/internal.d.ts +1 -1
- package/tooltip/internal.d.ts.map +1 -1
- package/tooltip/internal.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/form-field/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/form-field/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAA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oot":"","sources":["../../../src/form-field/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/form-field/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ErrorContext } from '../types/analytics';\nimport { BaseComponentProps } from '../types/base-component';\n\nexport interface FormFieldProps extends BaseComponentProps {\n /**\n * The ID of the primary form control. You can use this to set the\n * `for` attribute of a label for accessibility.\n *\n * If you don't set this property, the control group automatically sets\n * the label to the ID of an inner form control (for example, an [input](/components/input) component).\n * This only works well if you're using a single control in the form field.\n */\n controlId?: string;\n\n /**\n * Determines whether the primary control should expand to 12 columns.\n *\n * By default (or when this property is set to `false`), the primary control\n * occupies 9 columns. The secondary control uses the remaining 3 columns.\n * On smaller viewports, both components occupy 12 columns and stack on top of each other.\n *\n * If this property is set to `true`, the primary control uses the full\n * 12 columns. The secondary control (if present) also uses 12 columns, and the two\n * controls stack on top of each other.\n */\n stretch?: boolean;\n\n /**\n * The main label for the form field.\n */\n label?: React.ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: FormFieldProps.I18nStrings;\n\n /**\n * Use to display an 'Info' link next to the label.\n */\n info?: React.ReactNode;\n\n /**\n * The primary form control (for example, input, textarea, etc.).\n * @displayname control\n */\n children?: React.ReactNode;\n\n /**\n * A secondary control. You can use this for custom actions and content.\n */\n secondaryControl?: React.ReactNode;\n\n /**\n * Detailed information about the form field that's displayed below the label.\n */\n description?: React.ReactNode;\n\n /**\n * Constraint text that's displayed below the control. Use this to provide\n * additional information about valid formats, etc.\n */\n constraintText?: React.ReactNode;\n\n /**\n * Character count constraint displayed adjacent to the constraintText. Use\n * this to provide an updated character count on each keypress that is debounced\n * for screen reader users.\n */\n characterCountText?: string;\n\n /**\n * Text that displays as a validation error message. If this is set to a\n * non-empty string, it will render the form field as invalid.\n */\n errorText?: React.ReactNode;\n\n /**\n * Text that displays as a validation warning message. If this is set to a\n * non-empty string, it will render the form field in a warning state.\n */\n warningText?: React.ReactNode;\n\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `errorContext` - Identifies the error category and sub-category.\n * @analytics\n */\n analyticsMetadata?: FormFieldProps.AnalyticsMetadata;\n}\n\nexport namespace FormFieldProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n errorContext?: ErrorContext;\n }\n\n export interface I18nStrings {\n /**\n * Provides a text alternative for the error icon in the error message.\n */\n errorIconAriaLabel?: string;\n\n /**\n * Provides a text alternative for the warning icon in the warning message.\n */\n warningIconAriaLabel?: string;\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
3
|
+
import { AnalyticsMetadata } from '../types/analytics';
|
|
4
|
+
import { FormFieldProps } from './interfaces';
|
|
5
|
+
export interface InternalFormFieldProps extends FormFieldProps, InternalBaseComponentProps {
|
|
6
|
+
/**
|
|
7
|
+
* Visually hide the label.
|
|
8
|
+
*/
|
|
9
|
+
__hideLabel?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Disable the gutter applied by default.
|
|
12
|
+
*/
|
|
13
|
+
__disableGutters?: boolean;
|
|
14
|
+
__analyticsMetadata?: AnalyticsMetadata;
|
|
15
|
+
__style?: CSSProperties;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-interfaces.d.ts","sourceRoot":"","sources":["../../../src/form-field/internal-interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,sBAAuB,SAAQ,cAAc,EAAE,0BAA0B;IACxF;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/form-field/internal-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CSSProperties } from 'react';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { AnalyticsMetadata } from '../types/analytics';\nimport { FormFieldProps } from './interfaces';\n\nexport interface InternalFormFieldProps extends FormFieldProps, InternalBaseComponentProps {\n /**\n * Visually hide the label.\n */\n __hideLabel?: boolean;\n\n /**\n * Disable the gutter applied by default.\n */\n __disableGutters?: boolean;\n __analyticsMetadata?: AnalyticsMetadata;\n __style?: CSSProperties;\n}\n"]}
|
package/form-field/internal.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/form-field/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAyB3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/form-field/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAyB3D,OAAO,EAAE,sBAA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O,CAAC,OAAO,EAAE,oBAAoB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,oBAAoB,IAC3F,WAAW,CACK,CACpB;YACA,CAAC,cAAc,IAAI,kBAAkB,CAAC,IAAI,CACzC,oBAAC,oBAAoB,IAAC,iBAAiB,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,WAAW;gBAClE,cAAc,IAAI,CACjB,8BAAM,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,UAAU,IAC3D,cAAc,CACV,CACR;gBACA,kBAAkB,IAAI,CACrB;oBACG,CAAC,CAAC,cAAc,IAAI,GAAG;oBACxB,8BAAM,SAAS,EAAE,UAAU,CAAC,iBAAiB,CAAC,iBAAe,IAAI,IAC9D,kBAAkB,CACd;oBACP,oBAAC,gBAAgB,IAAC,EAAE,EAAE,OAAO,CAAC,cAAc,IAAG,2BAA2B,CAAoB,CAC7F,CACJ,CACoB,CACxB,CACG,CACP,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalGrid from '../grid/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FIELD_ERROR,\n DATA_ATTR_FIELD_LABEL,\n getFieldSlotSeletor,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { getBaseProps } from '../internal/base-component';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { FormFieldContext, useFormFieldContext } from '../internal/context/form-field-context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalLiveRegion from '../live-region/internal';\nimport { InternalFormFieldProps } from './interfaces';\nimport { getAriaDescribedBy, getGridDefinition, getSlotIds } from './util';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\ninterface FormFieldErrorProps {\n id?: string;\n children?: React.ReactNode;\n errorIconAriaLabel?: string;\n}\n\ninterface FormFieldWarningProps {\n id?: string;\n children?: React.ReactNode;\n warningIconAriaLabel?: string;\n}\n\nconst CHARACTER_COUNT_DEBOUNCE_MS = 1000;\n\nexport function FormFieldError({ id, children, errorIconAriaLabel }: FormFieldErrorProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nErrorIconAriaLabel = i18n('i18nStrings.errorIconAriaLabel', errorIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.error}>\n <div className={styles['error-icon-shake-wrapper']}>\n <div className={styles['error-icon-scale-wrapper']}>\n <InternalIcon name=\"status-negative\" size=\"small\" ariaLabel={i18nErrorIconAriaLabel} />\n </div>\n </div>\n <span className={styles.error__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nErrorIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function FormFieldWarning({ id, children, warningIconAriaLabel }: FormFieldWarningProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nWarningIconAriaLabel = i18n('i18nStrings.warningIconAriaLabel', warningIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.warning}>\n <div className={styles['warning-icon-shake-wrapper']}>\n <div className={styles['warning-icon-scale-wrapper']}>\n <InternalIcon name=\"status-warning\" size=\"small\" ariaLabel={i18nWarningIconAriaLabel} />\n </div>\n </div>\n <span className={styles.warning__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nWarningIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function ConstraintTextRegion({\n id,\n hasValidationText,\n children,\n}: {\n id?: string;\n hasValidationText: boolean;\n children: React.ReactNode;\n}) {\n return (\n <div id={id} className={clsx(styles.constraint, hasValidationText && styles['constraint-has-validation-text'])}>\n {children}\n </div>\n );\n}\n\nexport default function InternalFormField({\n controlId,\n stretch = false,\n label,\n info,\n i18nStrings,\n children,\n secondaryControl,\n description,\n constraintText,\n characterCountText,\n errorText,\n warningText,\n __hideLabel,\n __internalRootRef,\n __disableGutters = false,\n __analyticsMetadata = undefined,\n __style = {},\n ...rest\n}: InternalFormFieldProps) {\n const rootRef = useRef<HTMLElement>();\n const ref = useMergeRefs(rootRef, __internalRootRef);\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n\n const instanceUniqueId = useUniqueId('formField');\n const generatedControlId = controlId || instanceUniqueId;\n const formFieldId = controlId || generatedControlId;\n\n const { funnelIdentifier, funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepIdentifier, stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepIdentifier, subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const showWarning = warningText && !errorText;\n\n if (warningText && errorText) {\n warnOnce('FileUpload', 'Both `errorText` and `warningText` exist. `warningText` will not be shown.');\n }\n\n const slotIds = getSlotIds(\n formFieldId,\n label,\n description,\n constraintText,\n characterCountText,\n errorText,\n showWarning ? warningText : undefined\n );\n\n const ariaDescribedBy = getAriaDescribedBy(slotIds);\n\n const gridDefinition = getGridDefinition(stretch, !!secondaryControl, isRefresh);\n\n const {\n ariaLabelledby: parentAriaLabelledby,\n ariaDescribedby: parentAriaDescribedby,\n invalid: parentInvalid,\n warning: parentWarning,\n } = useFormFieldContext({});\n\n const contextValuesWithoutControlId = {\n ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || undefined,\n ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || undefined,\n invalid: !!errorText || !!parentInvalid,\n warning: (!!warningText && !errorText) || (!!parentWarning && !parentInvalid),\n };\n\n const analyticsAttributes = {\n [DATA_ATTR_FIELD_LABEL]: slotIds.label ? getFieldSlotSeletor(slotIds.label) : undefined,\n [DATA_ATTR_FIELD_ERROR]: slotIds.error ? getFieldSlotSeletor(slotIds.error) : undefined,\n };\n\n const debounceTimeoutRef = useRef<number | undefined>();\n const [debouncedCharacterCountText, setDebouncedCharacterCountText] = useState(characterCountText);\n\n useEffect(() => {\n debounceTimeoutRef.current = setTimeout(() => {\n setDebouncedCharacterCountText(characterCountText);\n }, CHARACTER_COUNT_DEBOUNCE_MS);\n return () => clearTimeout(debounceTimeoutRef.current);\n }, [characterCountText]);\n\n useEffect(() => {\n if (funnelInteractionId && errorText && funnelState.current !== 'complete') {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (rootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n funnelIdentifier,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n subStepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n stepIdentifier,\n fieldErrorSelector: `${getFieldSlotSeletor(slotIds.error)} .${styles.error__message}`,\n fieldLabelSelector: getFieldSlotSeletor(slotIds.label),\n subStepAllSelector: getSubStepAllSelector(),\n fieldIdentifier: __analyticsMetadata?.instanceIdentifier,\n errorContext: __analyticsMetadata?.errorContext,\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, errorText, submissionAttempt, errorCount]);\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n style={__style}\n ref={ref}\n {...analyticsAttributes}\n {...copyAnalyticsMetadataAttribute(rest)}\n >\n <div className={clsx(styles['label-wrapper'], __hideLabel && styles['visually-hidden'])}>\n {label && (\n <label\n className={clsx(styles.label, analyticsSelectors.label)}\n id={slotIds.label}\n htmlFor={generatedControlId}\n >\n {label}\n </label>\n )}\n <InfoLinkLabelContext.Provider value={slotIds.label}>\n {!__hideLabel && info && <span className={styles.info}>{info}</span>}\n </InfoLinkLabelContext.Provider>\n </div>\n\n {description && (\n <div className={styles.description} id={slotIds.description}>\n {description}\n </div>\n )}\n\n <div className={clsx(styles.controls, __hideLabel && styles['label-hidden'])}>\n <InternalGrid gridDefinition={gridDefinition} disableGutters={__disableGutters}>\n <FormFieldContext.Provider\n value={{\n controlId: generatedControlId,\n ...contextValuesWithoutControlId,\n }}\n >\n {children && <div className={styles.control}>{children}</div>}\n </FormFieldContext.Provider>\n\n {secondaryControl && (\n <FormFieldContext.Provider value={contextValuesWithoutControlId}>\n <div className={styles['secondary-control']}>{secondaryControl}</div>\n </FormFieldContext.Provider>\n )}\n </InternalGrid>\n </div>\n\n {(constraintText || characterCountText || errorText || warningText) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={slotIds.error} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={slotIds.warning} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {(constraintText || characterCountText) && (\n <ConstraintTextRegion hasValidationText={!!errorText || !!warningText}>\n {constraintText && (\n <span id={slotIds.constraint} className={testStyles.constraint}>\n {constraintText}\n </span>\n )}\n {characterCountText && (\n <>\n {!!constraintText && ' '}\n <span className={testStyles['character-count']} aria-hidden={true}>\n {characterCountText}\n </span>\n <ScreenreaderOnly id={slotIds.characterCount}>{debouncedCharacterCountText}</ScreenreaderOnly>\n </>\n )}\n </ConstraintTextRegion>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/form-field/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AA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AAC,cAAc,IAAI,kBAAkB,IAAI,SAAS,IAAI,WAAW,CAAC,IAAI,CACrE,6BAAK,SAAS,EAAE,MAAM,CAAC,KAAK;YACzB,SAAS,IAAI,CACZ,oBAAC,cAAc,IAAC,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,kBAAkB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,kBAAkB,IACnF,SAAS,CACK,CAClB;YACA,WAAW,IAAI,CACd,oBAAC,gBAAgB,IAAC,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE,oBAAoB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,oBAAoB,IAC3F,WAAW,CACK,CACpB;YACA,CAAC,cAAc,IAAI,kBAAkB,CAAC,IAAI,CACzC,oBAAC,oBAAoB,IAAC,iBAAiB,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,WAAW;gBAClE,cAAc,IAAI,CACjB,8BAAM,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,UAAU,IAC3D,cAAc,CACV,CACR;gBACA,kBAAkB,IAAI,CACrB;oBACG,CAAC,CAAC,cAAc,IAAI,GAAG;oBACxB,8BAAM,SAAS,EAAE,UAAU,CAAC,iBAAiB,CAAC,iBAAe,IAAI,IAC9D,kBAAkB,CACd;oBACP,oBAAC,gBAAgB,IAAC,EAAE,EAAE,OAAO,CAAC,cAAc,IAAG,2BAA2B,CAAoB,CAC7F,CACJ,CACoB,CACxB,CACG,CACP,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalGrid from '../grid/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FIELD_ERROR,\n DATA_ATTR_FIELD_LABEL,\n getFieldSlotSeletor,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { getBaseProps } from '../internal/base-component';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { FormFieldContext, useFormFieldContext } from '../internal/context/form-field-context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalLiveRegion from '../live-region/internal';\nimport { InternalFormFieldProps } from './internal-interfaces';\nimport { getAriaDescribedBy, getGridDefinition, getSlotIds } from './util';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\ninterface FormFieldErrorProps {\n id?: string;\n children?: React.ReactNode;\n errorIconAriaLabel?: string;\n}\n\ninterface FormFieldWarningProps {\n id?: string;\n children?: React.ReactNode;\n warningIconAriaLabel?: string;\n}\n\nconst CHARACTER_COUNT_DEBOUNCE_MS = 1000;\n\nexport function FormFieldError({ id, children, errorIconAriaLabel }: FormFieldErrorProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nErrorIconAriaLabel = i18n('i18nStrings.errorIconAriaLabel', errorIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.error}>\n <div className={styles['error-icon-shake-wrapper']}>\n <div className={styles['error-icon-scale-wrapper']}>\n <InternalIcon name=\"status-negative\" size=\"small\" ariaLabel={i18nErrorIconAriaLabel} />\n </div>\n </div>\n <span className={styles.error__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nErrorIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function FormFieldWarning({ id, children, warningIconAriaLabel }: FormFieldWarningProps) {\n const i18n = useInternalI18n('form-field');\n const contentRef = useRef<HTMLDivElement | null>(null);\n const i18nWarningIconAriaLabel = i18n('i18nStrings.warningIconAriaLabel', warningIconAriaLabel);\n\n return (\n <>\n <div id={id} className={styles.warning}>\n <div className={styles['warning-icon-shake-wrapper']}>\n <div className={styles['warning-icon-scale-wrapper']}>\n <InternalIcon name=\"status-warning\" size=\"small\" ariaLabel={i18nWarningIconAriaLabel} />\n </div>\n </div>\n <span className={styles.warning__message} ref={contentRef}>\n {children}\n </span>\n </div>\n\n <InternalLiveRegion assertive={true} tagName=\"span\" sources={[i18nWarningIconAriaLabel, contentRef]} />\n </>\n );\n}\n\nexport function ConstraintTextRegion({\n id,\n hasValidationText,\n children,\n}: {\n id?: string;\n hasValidationText: boolean;\n children: React.ReactNode;\n}) {\n return (\n <div id={id} className={clsx(styles.constraint, hasValidationText && styles['constraint-has-validation-text'])}>\n {children}\n </div>\n );\n}\n\nexport default function InternalFormField({\n controlId,\n stretch = false,\n label,\n info,\n i18nStrings,\n children,\n secondaryControl,\n description,\n constraintText,\n characterCountText,\n errorText,\n warningText,\n __hideLabel,\n __internalRootRef,\n __disableGutters = false,\n __analyticsMetadata = undefined,\n __style = {},\n ...rest\n}: InternalFormFieldProps) {\n const rootRef = useRef<HTMLElement>();\n const ref = useMergeRefs(rootRef, __internalRootRef);\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n\n const instanceUniqueId = useUniqueId('formField');\n const generatedControlId = controlId || instanceUniqueId;\n const formFieldId = controlId || generatedControlId;\n\n const { funnelIdentifier, funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepIdentifier, stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepIdentifier, subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const showWarning = warningText && !errorText;\n\n if (warningText && errorText) {\n warnOnce('FileUpload', 'Both `errorText` and `warningText` exist. `warningText` will not be shown.');\n }\n\n const slotIds = getSlotIds(\n formFieldId,\n label,\n description,\n constraintText,\n characterCountText,\n errorText,\n showWarning ? warningText : undefined\n );\n\n const ariaDescribedBy = getAriaDescribedBy(slotIds);\n\n const gridDefinition = getGridDefinition(stretch, !!secondaryControl, isRefresh);\n\n const {\n ariaLabelledby: parentAriaLabelledby,\n ariaDescribedby: parentAriaDescribedby,\n invalid: parentInvalid,\n warning: parentWarning,\n } = useFormFieldContext({});\n\n const contextValuesWithoutControlId = {\n ariaLabelledby: joinStrings(parentAriaLabelledby, slotIds.label) || undefined,\n ariaDescribedby: joinStrings(parentAriaDescribedby, ariaDescribedBy) || undefined,\n invalid: !!errorText || !!parentInvalid,\n warning: (!!warningText && !errorText) || (!!parentWarning && !parentInvalid),\n };\n\n const analyticsAttributes = {\n [DATA_ATTR_FIELD_LABEL]: slotIds.label ? getFieldSlotSeletor(slotIds.label) : undefined,\n [DATA_ATTR_FIELD_ERROR]: slotIds.error ? getFieldSlotSeletor(slotIds.error) : undefined,\n };\n\n const debounceTimeoutRef = useRef<number | undefined>();\n const [debouncedCharacterCountText, setDebouncedCharacterCountText] = useState(characterCountText);\n\n useEffect(() => {\n debounceTimeoutRef.current = setTimeout(() => {\n setDebouncedCharacterCountText(characterCountText);\n }, CHARACTER_COUNT_DEBOUNCE_MS);\n return () => clearTimeout(debounceTimeoutRef.current);\n }, [characterCountText]);\n\n useEffect(() => {\n if (funnelInteractionId && errorText && funnelState.current !== 'complete') {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (rootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n funnelIdentifier,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n subStepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n stepIdentifier,\n fieldErrorSelector: `${getFieldSlotSeletor(slotIds.error)} .${styles.error__message}`,\n fieldLabelSelector: getFieldSlotSeletor(slotIds.label),\n subStepAllSelector: getSubStepAllSelector(),\n fieldIdentifier: __analyticsMetadata?.instanceIdentifier,\n errorContext: __analyticsMetadata?.errorContext,\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, errorText, submissionAttempt, errorCount]);\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n style={__style}\n ref={ref}\n {...analyticsAttributes}\n {...copyAnalyticsMetadataAttribute(rest)}\n >\n <div className={clsx(styles['label-wrapper'], __hideLabel && styles['visually-hidden'])}>\n {label && (\n <label\n className={clsx(styles.label, analyticsSelectors.label)}\n id={slotIds.label}\n htmlFor={generatedControlId}\n >\n {label}\n </label>\n )}\n <InfoLinkLabelContext.Provider value={slotIds.label}>\n {!__hideLabel && info && <span className={styles.info}>{info}</span>}\n </InfoLinkLabelContext.Provider>\n </div>\n\n {description && (\n <div className={styles.description} id={slotIds.description}>\n {description}\n </div>\n )}\n\n <div className={clsx(styles.controls, __hideLabel && styles['label-hidden'])}>\n <InternalGrid gridDefinition={gridDefinition} disableGutters={__disableGutters}>\n <FormFieldContext.Provider\n value={{\n controlId: generatedControlId,\n ...contextValuesWithoutControlId,\n }}\n >\n {children && <div className={styles.control}>{children}</div>}\n </FormFieldContext.Provider>\n\n {secondaryControl && (\n <FormFieldContext.Provider value={contextValuesWithoutControlId}>\n <div className={styles['secondary-control']}>{secondaryControl}</div>\n </FormFieldContext.Provider>\n )}\n </InternalGrid>\n </div>\n\n {(constraintText || characterCountText || errorText || warningText) && (\n <div className={styles.hints}>\n {errorText && (\n <FormFieldError id={slotIds.error} errorIconAriaLabel={i18nStrings?.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={slotIds.warning} warningIconAriaLabel={i18nStrings?.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {(constraintText || characterCountText) && (\n <ConstraintTextRegion hasValidationText={!!errorText || !!warningText}>\n {constraintText && (\n <span id={slotIds.constraint} className={testStyles.constraint}>\n {constraintText}\n </span>\n )}\n {characterCountText && (\n <>\n {!!constraintText && ' '}\n <span className={testStyles['character-count']} aria-hidden={true}>\n {characterCountText}\n </span>\n <ScreenreaderOnly id={slotIds.characterCount}>{debouncedCharacterCountText}</ScreenreaderOnly>\n </>\n )}\n </ConstraintTextRegion>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InternalButtonDropdownProps } from '../../../button-dropdown/interfaces';
|
|
1
|
+
import { InternalButtonDropdownProps } from '../../../button-dropdown/internal-interfaces';
|
|
2
2
|
import { IconProps } from '../../../icon/interfaces';
|
|
3
3
|
export interface ButtonTriggerProps {
|
|
4
4
|
testUtilsClass?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/menu-dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/menu-dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAkB,SAAQ,2BAA2B;IACpE,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/menu-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { InternalButtonDropdownProps } from '../../../button-dropdown/interfaces';\nimport { IconProps } from '../../../icon/interfaces';\n\nexport interface ButtonTriggerProps {\n testUtilsClass?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n ariaLabel?: string;\n disabled?: boolean;\n children?: React.ReactNode;\n onClick?: () => void;\n\n badge?: boolean;\n offsetRight?: 'none' | 'l' | 'xxl';\n expanded?: boolean;\n}\n\nexport interface MenuDropdownProps extends InternalButtonDropdownProps {\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n badge?: boolean;\n description?: string;\n offsetRight?: 'l' | 'xxl';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/menu-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { InternalButtonDropdownProps } from '../../../button-dropdown/internal-interfaces';\nimport { IconProps } from '../../../icon/interfaces';\n\nexport interface ButtonTriggerProps {\n testUtilsClass?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n ariaLabel?: string;\n disabled?: boolean;\n children?: React.ReactNode;\n onClick?: () => void;\n\n badge?: boolean;\n offsetRight?: 'none' | 'l' | 'xxl';\n expanded?: boolean;\n}\n\nexport interface MenuDropdownProps extends InternalButtonDropdownProps {\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n badge?: boolean;\n description?: string;\n offsetRight?: 'l' | 'xxl';\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (c6ed7496)";
|
|
3
|
+
export var GIT_SHA = "c6ed7496";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
package/internal/manifest.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
3
2
|
import { BaseComponentProps } from '../types/base-component';
|
|
4
3
|
/**
|
|
5
4
|
* @awsuiSystem core
|
|
@@ -101,22 +100,4 @@ export declare namespace ItemCardProps {
|
|
|
101
100
|
};
|
|
102
101
|
};
|
|
103
102
|
}
|
|
104
|
-
}
|
|
105
|
-
export interface InternalItemCardProps extends ItemCardProps, InternalBaseComponentProps {
|
|
106
|
-
/**
|
|
107
|
-
* Called when the user clicks on the item card.
|
|
108
|
-
*/
|
|
109
|
-
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
110
|
-
/**
|
|
111
|
-
* Specifies whether the item card is in highlighted state.
|
|
112
|
-
*/
|
|
113
|
-
highlighted?: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Makes the item card stretch to fill the full height of its container.
|
|
116
|
-
*/
|
|
117
|
-
fullHeight?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Specifies metadata for analytics in cards
|
|
120
|
-
*/
|
|
121
|
-
metadataAttributes?: Record<string, string | undefined>;
|
|
122
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/item-card/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/item-card/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CA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AAE,MAAM,CAAC;aACxB,CAAC;YACF,OAAO,CAAC,EAAE;gBACR,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/item-card/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/item-card/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ItemCardProps extends BaseComponentProps {\n /**\n * Heading element of the item card. Use this to add a title or header text.\n */\n header?: React.ReactNode;\n\n /**\n * A description or subtitle displayed below the header.\n */\n description?: React.ReactNode;\n\n /**\n * Footer content displayed at the bottom of the item card.\n */\n footer?: React.ReactNode;\n\n /**\n * Actions to display in the item card header area, typically buttons or links.\n */\n actions?: React.ReactNode;\n\n /**\n * Main content of the item card.\n */\n children?: React.ReactNode;\n\n /**\n * Icon content displayed next to the header.\n */\n icon?: React.ReactNode;\n\n /**\n * Removes the default padding from the header area.\n * @default false\n */\n disableHeaderPaddings?: boolean;\n\n /**\n * Removes the default padding from the content area.\n * @default false\n */\n disableContentPaddings?: boolean;\n\n /**\n * Removes the default padding from the footer area.\n * @default false\n */\n disableFooterPaddings?: boolean;\n\n /**\n * Specifies the visual variant of the item card, which controls the border radius and padding.\n *\n * - `default` - Uses container-level border radius and padding (larger).\n * - `embedded` - Uses compact border radius and padding (smaller).\n *\n * @default 'default'\n */\n variant?: ItemCardProps.Variant;\n\n /**\n * An object containing CSS properties to customize the item card's visual appearance.\n * Refer to the [style](/components/item-card/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ItemCardProps.Style;\n\n /**\n * Attributes to add to the native root element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLDivElement>>;\n}\n\nexport namespace ItemCardProps {\n export type Variant = 'embedded' | 'default';\n\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: string;\n };\n content?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n header?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n footer?: {\n root?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n divider?: {\n borderColor?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
3
|
+
import { ItemCardProps } from './interfaces';
|
|
4
|
+
export interface InternalItemCardProps extends ItemCardProps, InternalBaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Called when the user clicks on the item card.
|
|
7
|
+
*/
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
9
|
+
/**
|
|
10
|
+
* Specifies whether the item card is in highlighted state.
|
|
11
|
+
*/
|
|
12
|
+
highlighted?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Makes the item card stretch to fill the full height of its container.
|
|
15
|
+
*/
|
|
16
|
+
fullHeight?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Specifies metadata for analytics in cards
|
|
19
|
+
*/
|
|
20
|
+
metadataAttributes?: Record<string, string | undefined>;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-interfaces.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal-interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,qBAAsB,SAAQ,aAAa,EAAE,0BAA0B;IACtF;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAE/C;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/item-card/internal-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ItemCardProps } from './interfaces';\n\nexport interface InternalItemCardProps extends ItemCardProps, InternalBaseComponentProps {\n /**\n * Called when the user clicks on the item card.\n */\n onClick?: React.MouseEventHandler<HTMLElement>;\n\n /**\n * Specifies whether the item card is in highlighted state.\n */\n highlighted?: boolean;\n\n /**\n * Makes the item card stretch to fill the full height of its container.\n */\n fullHeight?: boolean;\n\n /**\n * Specifies metadata for analytics in cards\n */\n metadataAttributes?: Record<string, string | undefined>;\n}\n"]}
|
package/item-card/internal.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,EACV,OAAmB,EACnB,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,qBAAqB,eAmEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,8BAA8B,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK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gBAAgB,EACd,WAAW,IAAI,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,IAAG,WAAW,CAAO,EAEtG,IAAI,EAAE,IAAI,IAAI,6BAAK,SAAS,EAAE,UAAU,CAAC,IAAI,IAAG,IAAI,CAAO,EAC3D,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,qBAAqB,EACtC,WAAW,EAAE,KAAK,GAClB,CACE,CACP;YACA,QAAQ,IAAI,CACX,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,sBAAsB,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,EAC7F,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAE7B,QAAQ,CACL,CACP;YACA,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,qBAAqB,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,EAChG,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,IAE5B,MAAM,CACH,CACP,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport InternalStructuredItem from '../internal/components/structured-item';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { processAttributes } from '../internal/utils/with-native-attributes';\nimport { InternalItemCardProps } from './interfaces';\nimport { getContentStyles, getFooterStyles, getHeaderStyles, getRootStyles } from './style';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nexport default function InternalItemCard({\n actions,\n highlighted,\n children,\n className,\n header,\n description,\n footer,\n icon,\n style,\n metadataAttributes,\n nativeAttributes,\n onClick,\n disableHeaderPaddings,\n disableContentPaddings,\n disableFooterPaddings,\n fullHeight,\n variant = 'default',\n __internalRootRef,\n ...restProps\n}: InternalItemCardProps) {\n const baseProps = getBaseProps(restProps);\n const isRefresh = useVisualRefresh();\n\n const headerRowEmpty = !header && !description && !icon && !actions;\n\n const rootAttributes = processAttributes<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n {\n className: clsx(\n className,\n styles.root,\n highlighted && styles.highlighted,\n fullHeight && styles['full-height'],\n isRefresh && styles.refresh,\n styles[`variant-${variant}`]\n ),\n ...metadataAttributes,\n onClick,\n style: getRootStyles(style),\n },\n nativeAttributes,\n 'Card'\n );\n\n return (\n <div ref={__internalRootRef} {...baseProps} {...rootAttributes}>\n <div className={styles['inner-card']}>\n {!headerRowEmpty && (\n <div\n className={clsx(\n styles.header,\n disableHeaderPaddings && styles['no-padding'],\n !!actions && styles['with-actions']\n )}\n style={getHeaderStyles(style)}\n >\n <InternalStructuredItem\n content={header && <div className={clsx(styles['header-inner'], testStyles.header)}>{header}</div>}\n secondaryContent={\n description && <div className={clsx(styles.description, testStyles.description)}>{description}</div>\n }\n icon={icon && <div className={testStyles.icon}>{icon}</div>}\n actions={actions}\n disablePaddings={disableHeaderPaddings}\n wrapActions={false}\n />\n </div>\n )}\n {children && (\n <div\n className={clsx(styles.body, testStyles.body, disableContentPaddings && styles['no-padding'])}\n style={getContentStyles(style)}\n >\n {children}\n </div>\n )}\n {footer && (\n <div\n className={clsx(styles.footer, testStyles.footer, disableFooterPaddings && styles['no-padding'])}\n style={getFooterStyles(style)}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,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":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport InternalStructuredItem from '../internal/components/structured-item';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { processAttributes } from '../internal/utils/with-native-attributes';\nimport { InternalItemCardProps } from './internal-interfaces';\nimport { getContentStyles, getFooterStyles, getHeaderStyles, getRootStyles } from './style';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nexport default function InternalItemCard({\n actions,\n highlighted,\n children,\n className,\n header,\n description,\n footer,\n icon,\n style,\n metadataAttributes,\n nativeAttributes,\n onClick,\n disableHeaderPaddings,\n disableContentPaddings,\n disableFooterPaddings,\n fullHeight,\n variant = 'default',\n __internalRootRef,\n ...restProps\n}: InternalItemCardProps) {\n const baseProps = getBaseProps(restProps);\n const isRefresh = useVisualRefresh();\n\n const headerRowEmpty = !header && !description && !icon && !actions;\n\n const rootAttributes = processAttributes<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n {\n className: clsx(\n className,\n styles.root,\n highlighted && styles.highlighted,\n fullHeight && styles['full-height'],\n isRefresh && styles.refresh,\n styles[`variant-${variant}`]\n ),\n ...metadataAttributes,\n onClick,\n style: getRootStyles(style),\n },\n nativeAttributes,\n 'Card'\n );\n\n return (\n <div ref={__internalRootRef} {...baseProps} {...rootAttributes}>\n <div className={styles['inner-card']}>\n {!headerRowEmpty && (\n <div\n className={clsx(\n styles.header,\n disableHeaderPaddings && styles['no-padding'],\n !!actions && styles['with-actions']\n )}\n style={getHeaderStyles(style)}\n >\n <InternalStructuredItem\n content={header && <div className={clsx(styles['header-inner'], testStyles.header)}>{header}</div>}\n secondaryContent={\n description && <div className={clsx(styles.description, testStyles.description)}>{description}</div>\n }\n icon={icon && <div className={testStyles.icon}>{icon}</div>}\n actions={actions}\n disablePaddings={disableHeaderPaddings}\n wrapActions={false}\n />\n </div>\n )}\n {children && (\n <div\n className={clsx(styles.body, testStyles.body, disableContentPaddings && styles['no-padding'])}\n style={getContentStyles(style)}\n >\n {children}\n </div>\n )}\n {footer && (\n <div\n className={clsx(styles.footer, testStyles.footer, disableFooterPaddings && styles['no-padding'])}\n style={getFooterStyles(style)}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
package/manifest.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CartesianChartProps } from '../types/cartesian-chart';
|
|
2
|
-
import { ChartDataTypes,
|
|
2
|
+
import { ChartDataTypes, MixedLineBarChartProps, ScaleType } from './interfaces';
|
|
3
|
+
import { InternalChartSeries } from './internal-interfaces';
|
|
3
4
|
import { ScaledPoint } from './make-scaled-series';
|
|
4
5
|
export interface ChartContainerProps<T extends ChartDataTypes> {
|
|
5
6
|
series: ReadonlyArray<InternalChartSeries<T>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-container.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-container.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAS/D,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"chart-container.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-container.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAS/D,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,SAAS,EAAmB,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAyB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAQrE,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,cAAc;IAC3D,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CA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