@cloudscape-design/components-themeable 3.0.1316 → 3.0.1318
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/template/action-card/interfaces.d.ts +3 -3
- package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
- package/lib/internal/template/action-card/interfaces.js.map +1 -1
- package/lib/internal/template/alert/interfaces.d.ts +3 -3
- package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
- package/lib/internal/template/alert/interfaces.js.map +1 -1
- package/lib/internal/template/anchor-navigation/interfaces.d.ts +2 -2
- package/lib/internal/template/anchor-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/anchor-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/annotation-context/interfaces.d.ts +1 -1
- package/lib/internal/template/annotation-context/interfaces.d.ts.map +1 -1
- package/lib/internal/template/annotation-context/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/classic.d.ts +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.js.map +1 -1
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/interfaces.d.ts +3 -3
- package/lib/internal/template/app-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/internal.d.ts +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.d.ts +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/index.d.ts +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.d.ts +4 -4
- package/lib/internal/template/app-layout-toolbar/index.js.map +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts.map +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.js.map +1 -1
- package/lib/internal/template/area-chart/interfaces.d.ts +1 -1
- package/lib/internal/template/area-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/area-chart/interfaces.js.map +1 -1
- package/lib/internal/template/area-chart/model/compute-chart-props.d.ts +2 -2
- package/lib/internal/template/area-chart/model/compute-chart-props.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/compute-chart-props.js +2 -0
- package/lib/internal/template/area-chart/model/compute-chart-props.js.map +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/index.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-filter-props.d.ts +1 -1
- package/lib/internal/template/area-chart/model/use-filter-props.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-filter-props.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-highlight-props.d.ts +1 -1
- package/lib/internal/template/area-chart/model/use-highlight-props.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-highlight-props.js.map +1 -1
- package/lib/internal/template/area-chart/model/utils.d.ts +1 -1
- package/lib/internal/template/area-chart/model/utils.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/utils.js.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.d.ts +3 -3
- package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
- package/lib/internal/template/attribute-editor/row.d.ts +2 -2
- package/lib/internal/template/attribute-editor/row.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/row.js.map +1 -1
- package/lib/internal/template/autosuggest/autosuggest-option.d.ts +1 -1
- package/lib/internal/template/autosuggest/autosuggest-option.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/autosuggest-option.js.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.d.ts +5 -5
- package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +1 -1
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.d.ts +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.js.map +1 -1
- package/lib/internal/template/badge/interfaces.d.ts +2 -2
- package/lib/internal/template/badge/interfaces.d.ts.map +1 -1
- package/lib/internal/template/badge/interfaces.js.map +1 -1
- package/lib/internal/template/bar-chart/interfaces.d.ts +1 -1
- package/lib/internal/template/bar-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/bar-chart/interfaces.js.map +1 -1
- package/lib/internal/template/box/interfaces.d.ts +2 -2
- package/lib/internal/template/box/interfaces.d.ts.map +1 -1
- package/lib/internal/template/box/interfaces.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts +1 -1
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/interfaces.d.ts +2 -2
- package/lib/internal/template/breadcrumb-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/interfaces.js.map +1 -1
- package/lib/internal/template/button/interfaces.d.ts +3 -3
- package/lib/internal/template/button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.d.ts +3 -3
- package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js.map +1 -1
- package/lib/internal/template/button-group/file-input-item.d.ts +1 -1
- package/lib/internal/template/button-group/file-input-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/file-input-item.js.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.d.ts +1 -1
- package/lib/internal/template/button-group/icon-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.js +1 -1
- package/lib/internal/template/button-group/icon-button-item.js.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -1
- package/lib/internal/template/button-group/interfaces.d.ts +10 -2
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/button-group/item-element.d.ts +1 -1
- package/lib/internal/template/button-group/item-element.d.ts.map +1 -1
- package/lib/internal/template/button-group/item-element.js.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.d.ts +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.js.map +1 -1
- package/lib/internal/template/calendar/interfaces.d.ts +3 -3
- package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/calendar/interfaces.js.map +1 -1
- package/lib/internal/template/cards/interfaces.d.ts +2 -2
- package/lib/internal/template/cards/interfaces.d.ts.map +1 -1
- package/lib/internal/template/cards/interfaces.js.map +1 -1
- package/lib/internal/template/checkbox/base-checkbox.d.ts +3 -3
- package/lib/internal/template/checkbox/base-checkbox.d.ts.map +1 -1
- package/lib/internal/template/checkbox/base-checkbox.js.map +1 -1
- package/lib/internal/template/checkbox/interfaces.d.ts +2 -2
- package/lib/internal/template/checkbox/interfaces.d.ts.map +1 -1
- package/lib/internal/template/checkbox/interfaces.js.map +1 -1
- package/lib/internal/template/code-editor/error-screen.d.ts +1 -1
- package/lib/internal/template/code-editor/error-screen.d.ts.map +1 -1
- package/lib/internal/template/code-editor/error-screen.js.map +1 -1
- package/lib/internal/template/code-editor/interfaces.d.ts +3 -3
- package/lib/internal/template/code-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/code-editor/interfaces.js.map +1 -1
- package/lib/internal/template/code-editor/listeners.d.ts +1 -1
- package/lib/internal/template/code-editor/listeners.d.ts.map +1 -1
- package/lib/internal/template/code-editor/listeners.js.map +1 -1
- package/lib/internal/template/code-editor/preferences-modal.js.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.d.ts +4 -4
- package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
- package/lib/internal/template/column-layout/interfaces.d.ts +1 -1
- package/lib/internal/template/column-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/column-layout/interfaces.js.map +1 -1
- package/lib/internal/template/container/interfaces.d.ts +1 -1
- package/lib/internal/template/container/interfaces.d.ts.map +1 -1
- package/lib/internal/template/container/interfaces.js.map +1 -1
- package/lib/internal/template/content-layout/interfaces.d.ts +1 -1
- package/lib/internal/template/content-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/content-layout/interfaces.js.map +1 -1
- package/lib/internal/template/contexts/form-field.d.ts +2 -1
- package/lib/internal/template/contexts/form-field.d.ts.map +1 -1
- package/lib/internal/template/contexts/form-field.js +1 -1
- package/lib/internal/template/contexts/form-field.js.map +1 -1
- package/lib/internal/template/copy-to-clipboard/interfaces.d.ts +2 -2
- package/lib/internal/template/copy-to-clipboard/interfaces.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/interfaces.js.map +1 -1
- package/lib/internal/template/date-input/interfaces.d.ts +3 -3
- package/lib/internal/template/date-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-input/interfaces.js.map +1 -1
- package/lib/internal/template/date-input/internal.d.ts.map +1 -1
- package/lib/internal/template/date-input/internal.js.map +1 -1
- package/lib/internal/template/date-picker/interfaces.d.ts +4 -4
- package/lib/internal/template/date-picker/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-picker/interfaces.js.map +1 -1
- package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts +1 -1
- package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/calendar/interfaces.js.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.d.ts +4 -4
- package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
- package/lib/internal/template/divider/interfaces.d.ts +2 -2
- package/lib/internal/template/divider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/divider/interfaces.js.map +1 -1
- package/lib/internal/template/drawer/interfaces.d.ts +2 -2
- package/lib/internal/template/drawer/interfaces.d.ts.map +1 -1
- package/lib/internal/template/drawer/interfaces.js.map +1 -1
- package/lib/internal/template/dropdown/interfaces.d.ts +1 -1
- package/lib/internal/template/dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/dropdown/internal.d.ts +1 -1
- package/lib/internal/template/dropdown/internal.d.ts.map +1 -1
- package/lib/internal/template/dropdown/internal.js.map +1 -1
- package/lib/internal/template/error-boundary/interfaces.d.ts +1 -1
- package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -1
- package/lib/internal/template/error-boundary/interfaces.js.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.d.ts +2 -2
- package/lib/internal/template/expandable-section/interfaces.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
- package/lib/internal/template/file-dropzone/interfaces.d.ts +2 -2
- package/lib/internal/template/file-dropzone/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-dropzone/interfaces.js.map +1 -1
- package/lib/internal/template/file-input/interfaces.d.ts +3 -3
- package/lib/internal/template/file-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-input/interfaces.js.map +1 -1
- package/lib/internal/template/file-token-group/file-token.d.ts +1 -1
- package/lib/internal/template/file-token-group/file-token.d.ts.map +1 -1
- package/lib/internal/template/file-token-group/file-token.js.map +1 -1
- package/lib/internal/template/file-token-group/interfaces.d.ts +2 -2
- package/lib/internal/template/file-token-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-token-group/interfaces.js.map +1 -1
- package/lib/internal/template/file-upload/interfaces.d.ts +3 -3
- package/lib/internal/template/file-upload/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-upload/interfaces.js.map +1 -1
- package/lib/internal/template/flashbar/common.d.ts +1 -1
- package/lib/internal/template/flashbar/interfaces.d.ts +2 -2
- package/lib/internal/template/flashbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/flashbar/interfaces.js.map +1 -1
- package/lib/internal/template/form/interfaces.d.ts +2 -2
- package/lib/internal/template/form/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/interfaces.d.ts +2 -2
- package/lib/internal/template/form-field/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form-field/interfaces.js.map +1 -1
- package/lib/internal/template/grid/interfaces.d.ts +2 -2
- package/lib/internal/template/grid/interfaces.d.ts.map +1 -1
- package/lib/internal/template/grid/interfaces.js.map +1 -1
- package/lib/internal/template/grid/internal.d.ts +1 -1
- package/lib/internal/template/grid/internal.d.ts.map +1 -1
- package/lib/internal/template/grid/internal.js.map +1 -1
- package/lib/internal/template/header/interfaces.d.ts +1 -1
- package/lib/internal/template/header/interfaces.d.ts.map +1 -1
- package/lib/internal/template/header/interfaces.js.map +1 -1
- package/lib/internal/template/help-panel/interfaces.d.ts +1 -1
- package/lib/internal/template/help-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/help-panel/interfaces.js.map +1 -1
- package/lib/internal/template/hotspot/interfaces.d.ts +1 -1
- package/lib/internal/template/hotspot/interfaces.d.ts.map +1 -1
- package/lib/internal/template/hotspot/interfaces.js.map +1 -1
- package/lib/internal/template/icon/interfaces.d.ts +2 -2
- package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon/interfaces.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/input/interfaces.d.ts +4 -4
- package/lib/internal/template/input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/input/interfaces.js.map +1 -1
- package/lib/internal/template/input/internal.d.ts +3 -3
- package/lib/internal/template/input/internal.d.ts.map +1 -1
- package/lib/internal/template/input/internal.js.map +1 -1
- package/lib/internal/template/interfaces.d.ts +1 -1
- package/lib/internal/template/interfaces.d.ts.map +1 -1
- package/lib/internal/template/interfaces.js.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +2 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts +2 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.js.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +2 -15
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/base-component/index.d.ts +3 -15
- package/lib/internal/template/internal/base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/base-component/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +23 -17
- package/lib/internal/template/internal/breakpoints.d.ts +2 -1
- package/lib/internal/template/internal/breakpoints.d.ts.map +1 -1
- package/lib/internal/template/internal/breakpoints.js.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts +3 -3
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/index.d.ts +2 -2
- package/lib/internal/template/internal/components/button-trigger/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/index.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts +1 -209
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.js +2 -0
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/label-utils.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/label-utils.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/label-utils.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/scales.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/scales.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/scales.js +0 -2
- package/lib/internal/template/internal/components/cartesian-chart/scales.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/ticks.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/ticks.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/ticks.js.map +1 -1
- package/lib/internal/template/internal/components/chart-filter/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-filter/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-filter/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-series-details/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-series-details/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-series-details/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-series-marker/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-series-marker/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-series-marker/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-status-container/index.d.ts +2 -2
- package/lib/internal/template/internal/components/chart-status-container/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-status-container/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.js.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.d.ts +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown-status/index.d.ts +3 -3
- package/lib/internal/template/internal/components/dropdown-status/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown-status/index.js.map +1 -1
- package/lib/internal/template/internal/components/masked-input/interfaces.d.ts +2 -2
- package/lib/internal/template/internal/components/masked-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/masked-input/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/masked-input/use-mask.d.ts +1 -1
- package/lib/internal/template/internal/components/masked-input/use-mask.d.ts.map +1 -1
- package/lib/internal/template/internal/components/masked-input/use-mask.js.map +1 -1
- package/lib/internal/template/internal/components/option/interfaces.d.ts +3 -26
- package/lib/internal/template/internal/components/option/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/option/option-announcer.d.ts +1 -1
- package/lib/internal/template/internal/components/option/option-announcer.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/option-announcer.js.map +1 -1
- package/lib/internal/template/internal/components/option/utils/filter-options.d.ts +2 -1
- package/lib/internal/template/internal/components/option/utils/filter-options.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/utils/filter-options.js.map +1 -1
- package/lib/internal/template/internal/components/option/utils/flatten-options.d.ts +2 -1
- package/lib/internal/template/internal/components/option/utils/flatten-options.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/utils/flatten-options.js.map +1 -1
- package/lib/internal/template/internal/components/options-list/index.d.ts +3 -3
- package/lib/internal/template/internal/components/options-list/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/options-list/index.js +1 -1
- package/lib/internal/template/internal/components/options-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js.map +1 -1
- package/lib/internal/template/internal/components/radio-button/index.d.ts +1 -1
- package/lib/internal/template/internal/components/radio-button/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/radio-button/index.js.map +1 -1
- package/lib/internal/template/internal/components/radio-button/interfaces.d.ts +1 -128
- package/lib/internal/template/internal/components/radio-button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/radio-button/interfaces.js +2 -0
- package/lib/internal/template/internal/components/radio-button/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/components/selectable-item/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts +3 -9
- package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.js.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.d.ts +2 -54
- package/lib/internal/template/internal/context/form-field-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.js.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.js.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.d.ts +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.d.ts.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/events/index.d.ts +2 -24
- package/lib/internal/template/internal/events/index.d.ts.map +1 -1
- package/lib/internal/template/internal/events/index.js.map +1 -1
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +1 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +60 -21
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +36 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +36 -0
- package/lib/internal/template/internal/generated/theming/index.js +60 -21
- package/lib/internal/template/internal/hooks/check-controlled/index.d.ts +1 -1
- package/lib/internal/template/internal/hooks/check-controlled/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/check-controlled/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.d.ts +1 -1
- package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-focus-tracker.d.ts +1 -1
- package/lib/internal/template/internal/hooks/use-focus-tracker.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-focus-tracker.js.map +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -1
- package/lib/internal/template/internal/utils/date-time/interfaces.d.ts +1 -16
- package/lib/internal/template/internal/utils/date-time/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/date-time/interfaces.js.map +1 -1
- package/lib/internal/template/internal/utils/with-native-attributes.d.ts +2 -1
- package/lib/internal/template/internal/utils/with-native-attributes.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/with-native-attributes.js.map +1 -1
- package/lib/internal/template/item-card/interfaces.d.ts +2 -2
- package/lib/internal/template/item-card/interfaces.d.ts.map +1 -1
- package/lib/internal/template/item-card/interfaces.js.map +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.d.ts +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.d.ts.map +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.js.map +1 -1
- package/lib/internal/template/link/interfaces.d.ts +3 -3
- package/lib/internal/template/link/interfaces.d.ts.map +1 -1
- package/lib/internal/template/link/interfaces.js.map +1 -1
- package/lib/internal/template/list/interfaces.d.ts +3 -3
- package/lib/internal/template/list/interfaces.d.ts.map +1 -1
- package/lib/internal/template/list/interfaces.js.map +1 -1
- package/lib/internal/template/live-region/interfaces.d.ts +1 -1
- package/lib/internal/template/live-region/interfaces.d.ts.map +1 -1
- package/lib/internal/template/live-region/interfaces.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.js.map +1 -1
- package/lib/internal/template/modal/interfaces.d.ts +3 -3
- package/lib/internal/template/modal/interfaces.d.ts.map +1 -1
- package/lib/internal/template/modal/interfaces.js.map +1 -1
- package/lib/internal/template/multiselect/embedded.d.ts +2 -2
- package/lib/internal/template/multiselect/interfaces.d.ts +2 -2
- package/lib/internal/template/multiselect/interfaces.d.ts.map +1 -1
- package/lib/internal/template/multiselect/interfaces.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts +1 -1
- package/lib/internal/template/multiselect/use-multiselect.d.ts +8 -8
- package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
- package/lib/internal/template/navigable-group/interfaces.d.ts +1 -1
- package/lib/internal/template/navigable-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/navigable-group/interfaces.js.map +1 -1
- package/lib/internal/template/pagination/interfaces.d.ts +1 -1
- package/lib/internal/template/pagination/interfaces.d.ts.map +1 -1
- package/lib/internal/template/pagination/interfaces.js.map +1 -1
- package/lib/internal/template/pagination/internal.d.ts.map +1 -1
- package/lib/internal/template/pagination/internal.js.map +1 -1
- package/lib/internal/template/panel-layout/interfaces.d.ts +2 -2
- package/lib/internal/template/panel-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/panel-layout/interfaces.js.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.d.ts +2 -2
- package/lib/internal/template/pie-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.js.map +1 -1
- package/lib/internal/template/popover/interfaces.d.ts +1 -1
- package/lib/internal/template/popover/interfaces.d.ts.map +1 -1
- package/lib/internal/template/popover/interfaces.js.map +1 -1
- package/lib/internal/template/popover/internal.d.ts +1 -1
- package/lib/internal/template/popover/internal.d.ts.map +1 -1
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/progress-bar/interfaces.d.ts +2 -2
- package/lib/internal/template/progress-bar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/progress-bar/interfaces.js.map +1 -1
- package/lib/internal/template/prompt-input/core/menu-state.d.ts +2 -2
- package/lib/internal/template/prompt-input/core/menu-state.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/core/menu-state.js.map +1 -1
- package/lib/internal/template/prompt-input/interfaces.d.ts +6 -6
- package/lib/internal/template/prompt-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/interfaces.js.map +1 -1
- package/lib/internal/template/property-filter/controller.d.ts +2 -2
- package/lib/internal/template/property-filter/controller.d.ts.map +1 -1
- package/lib/internal/template/property-filter/controller.js.map +1 -1
- package/lib/internal/template/property-filter/filter-options.js.map +1 -1
- package/lib/internal/template/property-filter/interfaces.d.ts +4 -4
- package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/property-filter/interfaces.js.map +1 -1
- package/lib/internal/template/property-filter/property-editor.d.ts +2 -2
- package/lib/internal/template/property-filter/property-editor.d.ts.map +1 -1
- package/lib/internal/template/property-filter/property-editor.js.map +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.d.ts +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.d.ts.map +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.js +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.js.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.d.ts +2 -2
- package/lib/internal/template/property-filter/token-editor-inputs.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.js.map +1 -1
- package/lib/internal/template/property-filter/token-editor.d.ts +2 -2
- package/lib/internal/template/property-filter/token-editor.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor.js.map +1 -1
- package/lib/internal/template/property-filter/token.d.ts +2 -2
- package/lib/internal/template/property-filter/token.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token.js.map +1 -1
- package/lib/internal/template/property-filter/use-load-items.d.ts +1 -1
- package/lib/internal/template/property-filter/use-load-items.d.ts.map +1 -1
- package/lib/internal/template/property-filter/use-load-items.js.map +1 -1
- package/lib/internal/template/radio-button/interfaces.d.ts +128 -2
- package/lib/internal/template/radio-button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/radio-button/interfaces.js.map +1 -1
- package/lib/internal/template/radio-group/interfaces.d.ts +4 -4
- package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/radio-group/interfaces.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/interfaces.d.ts +2 -2
- package/lib/internal/template/s3-resource-selector/interfaces.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/interfaces.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/use-versions-fetch.d.ts +1 -1
- package/lib/internal/template/segmented-control/interfaces.d.ts +2 -2
- package/lib/internal/template/segmented-control/interfaces.d.ts.map +1 -1
- package/lib/internal/template/segmented-control/interfaces.js.map +1 -1
- package/lib/internal/template/select/interfaces.d.ts +5 -5
- package/lib/internal/template/select/interfaces.d.ts.map +1 -1
- package/lib/internal/template/select/interfaces.js.map +1 -1
- package/lib/internal/template/select/internal.d.ts.map +1 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/parts/item.d.ts.map +1 -1
- package/lib/internal/template/select/parts/item.js.map +1 -1
- package/lib/internal/template/select/parts/multiselect-item.d.ts.map +1 -1
- package/lib/internal/template/select/parts/multiselect-item.js.map +1 -1
- package/lib/internal/template/select/parts/trigger.d.ts +2 -2
- package/lib/internal/template/select/parts/trigger.d.ts.map +1 -1
- package/lib/internal/template/select/parts/trigger.js.map +1 -1
- package/lib/internal/template/select/utils/connect-options.d.ts +2 -1
- package/lib/internal/template/select/utils/connect-options.d.ts.map +1 -1
- package/lib/internal/template/select/utils/connect-options.js.map +1 -1
- package/lib/internal/template/select/utils/use-announcement.d.ts +1 -1
- package/lib/internal/template/select/utils/use-announcement.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-announcement.js.map +1 -1
- package/lib/internal/template/select/utils/use-load-items.d.ts +2 -2
- package/lib/internal/template/select/utils/use-load-items.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-load-items.js.map +1 -1
- package/lib/internal/template/select/utils/use-native-search.d.ts +2 -1
- package/lib/internal/template/select/utils/use-native-search.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-native-search.js.map +1 -1
- package/lib/internal/template/select/utils/use-select.d.ts +4 -3
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.d.ts +2 -2
- package/lib/internal/template/side-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/parts.js.map +1 -1
- package/lib/internal/template/skeleton/interfaces.d.ts +1 -1
- package/lib/internal/template/skeleton/interfaces.d.ts.map +1 -1
- package/lib/internal/template/skeleton/interfaces.js.map +1 -1
- package/lib/internal/template/slider/interfaces.d.ts +3 -3
- package/lib/internal/template/slider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/slider/interfaces.js.map +1 -1
- package/lib/internal/template/space-between/interfaces.d.ts +2 -2
- package/lib/internal/template/space-between/interfaces.d.ts.map +1 -1
- package/lib/internal/template/space-between/interfaces.js.map +1 -1
- package/lib/internal/template/spinner/interfaces.d.ts +2 -2
- package/lib/internal/template/spinner/interfaces.d.ts.map +1 -1
- package/lib/internal/template/spinner/interfaces.js.map +1 -1
- package/lib/internal/template/split-panel/interfaces.d.ts +1 -1
- package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/split-panel/interfaces.js.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.d.ts +2 -2
- package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
- package/lib/internal/template/steps/interfaces.d.ts +1 -1
- package/lib/internal/template/steps/interfaces.d.ts.map +1 -1
- package/lib/internal/template/steps/interfaces.js.map +1 -1
- package/lib/internal/template/table/interfaces.d.ts +2 -2
- package/lib/internal/template/table/interfaces.d.ts.map +1 -1
- package/lib/internal/template/table/interfaces.js.map +1 -1
- package/lib/internal/template/table/thead.d.ts +1 -1
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/table/use-cell-editing.d.ts +1 -1
- package/lib/internal/template/table/use-cell-editing.d.ts.map +1 -1
- package/lib/internal/template/table/use-cell-editing.js.map +1 -1
- package/lib/internal/template/tabs/interfaces.d.ts +2 -2
- package/lib/internal/template/tabs/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tabs/interfaces.js.map +1 -1
- package/lib/internal/template/tag-editor/index.d.ts.map +1 -1
- package/lib/internal/template/tag-editor/index.js.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.d.ts +2 -2
- package/lib/internal/template/tag-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.js.map +1 -1
- package/lib/internal/template/tag-editor/internal.js.map +1 -1
- package/lib/internal/template/text-content/interfaces.d.ts +1 -1
- package/lib/internal/template/text-content/interfaces.d.ts.map +1 -1
- package/lib/internal/template/text-content/interfaces.js.map +1 -1
- package/lib/internal/template/text-filter/interfaces.d.ts +3 -3
- package/lib/internal/template/text-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/text-filter/interfaces.js.map +1 -1
- package/lib/internal/template/textarea/interfaces.d.ts +4 -4
- package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
- package/lib/internal/template/textarea/interfaces.js.map +1 -1
- package/lib/internal/template/tiles/interfaces.d.ts +4 -4
- package/lib/internal/template/tiles/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tiles/interfaces.js.map +1 -1
- package/lib/internal/template/time-input/interfaces.d.ts +2 -2
- package/lib/internal/template/time-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/time-input/interfaces.js.map +1 -1
- package/lib/internal/template/toggle/interfaces.d.ts +2 -2
- package/lib/internal/template/toggle/interfaces.d.ts.map +1 -1
- package/lib/internal/template/toggle/interfaces.js.map +1 -1
- package/lib/internal/template/toggle-button/interfaces.d.ts +2 -2
- package/lib/internal/template/toggle-button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/toggle-button/interfaces.js.map +1 -1
- package/lib/internal/template/token/dismiss-button.d.ts +1 -1
- package/lib/internal/template/token/dismiss-button.d.ts.map +1 -1
- package/lib/internal/template/token/dismiss-button.js.map +1 -1
- package/lib/internal/template/token/interfaces.d.ts +2 -2
- package/lib/internal/template/token/interfaces.d.ts.map +1 -1
- package/lib/internal/template/token/interfaces.js.map +1 -1
- package/lib/internal/template/token-group/interfaces.d.ts +2 -2
- package/lib/internal/template/token-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/token-group/interfaces.js.map +1 -1
- package/lib/internal/template/tooltip/interfaces.d.ts +1 -1
- package/lib/internal/template/tooltip/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tooltip/interfaces.js.map +1 -1
- package/lib/internal/template/top-navigation/interfaces.d.ts +2 -2
- package/lib/internal/template/top-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/top-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/tree-view/interfaces.d.ts +2 -2
- package/lib/internal/template/tree-view/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tree-view/interfaces.js.map +1 -1
- package/lib/internal/template/truncated-text/interfaces.d.ts +1 -1
- package/lib/internal/template/truncated-text/interfaces.d.ts.map +1 -1
- package/lib/internal/template/truncated-text/interfaces.js.map +1 -1
- package/lib/internal/template/tutorial-panel/index.js.map +1 -1
- package/lib/internal/template/tutorial-panel/interfaces.d.ts +2 -2
- package/lib/internal/template/tutorial-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tutorial-panel/interfaces.js.map +1 -1
- package/lib/internal/template/types/analytics.d.ts +16 -0
- package/lib/internal/template/types/analytics.d.ts.map +1 -0
- package/lib/internal/template/types/analytics.js +4 -0
- package/lib/internal/template/types/analytics.js.map +1 -0
- package/lib/internal/template/types/base-component.d.ts +15 -0
- package/lib/internal/template/types/base-component.d.ts.map +1 -0
- package/lib/internal/template/types/base-component.js +4 -0
- package/lib/internal/template/types/base-component.js.map +1 -0
- package/lib/internal/template/types/breakpoint.d.ts +2 -0
- package/lib/internal/template/types/breakpoint.d.ts.map +1 -0
- package/lib/internal/template/types/breakpoint.js +2 -0
- package/lib/internal/template/types/breakpoint.js.map +1 -0
- package/lib/internal/template/types/cartesian-chart.d.ts +210 -0
- package/lib/internal/template/types/cartesian-chart.d.ts.map +1 -0
- package/lib/internal/template/types/cartesian-chart.js +2 -0
- package/lib/internal/template/types/cartesian-chart.js.map +1 -0
- package/lib/internal/template/types/date-time.d.ts +17 -0
- package/lib/internal/template/types/date-time.d.ts.map +1 -0
- package/lib/internal/template/types/date-time.js +4 -0
- package/lib/internal/template/types/date-time.js.map +1 -0
- package/lib/internal/template/{internal/components/dropdown-status/interfaces.d.ts → types/dropdown-status.d.ts} +1 -1
- package/lib/internal/template/types/dropdown-status.d.ts.map +1 -0
- package/lib/internal/template/types/dropdown-status.js +2 -0
- package/lib/internal/template/types/dropdown-status.js.map +1 -0
- package/lib/internal/template/types/events.d.ts +25 -0
- package/lib/internal/template/types/events.d.ts.map +1 -0
- package/lib/internal/template/types/events.js +4 -0
- package/lib/internal/template/types/events.js.map +1 -0
- package/lib/internal/template/types/form-field.d.ts +55 -0
- package/lib/internal/template/types/form-field.d.ts.map +1 -0
- package/lib/internal/template/types/form-field.js +4 -0
- package/lib/internal/template/types/form-field.js.map +1 -0
- package/lib/internal/template/types/native-attributes.d.ts +3 -0
- package/lib/internal/template/types/native-attributes.d.ts.map +1 -0
- package/lib/internal/template/types/native-attributes.js +2 -0
- package/lib/internal/template/types/native-attributes.js.map +1 -0
- package/lib/internal/template/types/option.d.ts +27 -0
- package/lib/internal/template/types/option.d.ts.map +1 -0
- package/lib/internal/template/types/option.js +2 -0
- package/lib/internal/template/types/option.js.map +1 -0
- package/lib/internal/template/types/sortable-area.d.ts +9 -0
- package/lib/internal/template/types/sortable-area.d.ts.map +1 -0
- package/lib/internal/template/types/sortable-area.js +4 -0
- package/lib/internal/template/types/sortable-area.js.map +1 -0
- package/lib/internal/template/wizard/interfaces.d.ts +3 -3
- package/lib/internal/template/wizard/interfaces.d.ts.map +1 -1
- package/lib/internal/template/wizard/interfaces.js.map +1 -1
- package/package.json +1 -1
- package/lib/internal/template/internal/components/dropdown-status/interfaces.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dropdown-status/interfaces.js +0 -2
- package/lib/internal/template/internal/components/dropdown-status/interfaces.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/pie-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { PopoverProps } from '../popover/interfaces';\n\nexport interface SeriesInfo {\n label: string;\n color: string;\n index: number;\n markerType: 'line' | 'rectangle';\n}\n\ninterface ChartDetailPair {\n key: ReactNode;\n value: ReactNode;\n}\n\nexport interface PieChartProps<T extends PieChartProps.Datum = PieChartProps.Datum> extends BaseComponentProps {\n /**\n * An array that represents the source of data for the displayed segments.\n * Each element can have the following properties:\n *\n * * `title` (string) - A human-readable title for this data point.\n * * `value` (number) - Numeric value that determines the segment size.\n * A segment with a value of zero (0) or lower (negative number) won't have a segment.\n * * `color`: (string) - (Optional) Color value for this segment that takes priority over the automatically assigned color.\n * Can be any valid CSS color identifier.\n *\n * As long as your data object implements the properties above, you can also define additional properties\n * that are relevant to your data visualization.\n * The full data object will be passed down to events and properties like `detailPopoverContent`.\n */\n data: ReadonlyArray<T>;\n\n /**\n * Specifies the size of the pie or donut chart.\n * When used with `fitHeight`, this property defines the minimum size of the chart area.\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Visual variant of the pie chart. Currently supports the default `pie` variant and the `donut` variant.\n * The donut variant provides a slot in the center of the chart that can contain additional information.\n * For more information, see `innerContent`.\n */\n variant?: 'pie' | 'donut';\n\n /**\n * A function that determines the details that are displayed in the popover when hovering over a segment.\n * The function is called with the data of the target segment and is expected to return an array of detail pairs.\n * By default, each segment displays two detail pairs: count and percentage.\n *\n * Each pair has the following properties:\n * * `key` (ReactNode) - Name of the detail or metric.\n * * `value` (ReactNode) - The value of this detail for the target segment.\n */\n detailPopoverContent?: PieChartProps.DetailPopoverContentFunction<T>;\n\n /**\n * Additional content that is displayed at the bottom of the detail popover.\n */\n detailPopoverFooter?: PieChartProps.DetailPopoverFooter<T>;\n\n /**\n * A function that determines the description of a segment that is displayed on the chart, unless `hideDescriptions` is set to `true`.\n * This is an optional description that explains the segment and is displayed underneath the label.\n * The function is called with the data object of each segment and is expected to return the description as a string.\n */\n segmentDescription?: PieChartProps.SegmentDescriptionFunction<T>;\n\n /**\n * Determines the maximum width of the popover.\n */\n detailPopoverSize?: PopoverProps.Size;\n\n /**\n * Hides legend beneath the chart when set to `true`.\n * We highly recommend that you leave this unspecified or set to `false`.\n */\n hideLegend?: boolean;\n\n /**\n * Hides label titles next to the chart segments when set to `true`.\n * We highly recommend that you leave this unspecified or set to `false`.\n */\n hideTitles?: boolean;\n\n /**\n * Hides the label descriptions next to the chart segments when set to `true`.\n */\n hideDescriptions?: boolean;\n\n /**\n * Hides the default filtering dropdown when set to `true`.\n * You can still display additional filters with the `additionalFilters` slot.\n */\n hideFilter?: boolean;\n\n /**\n * Additional metric number that's displayed in the center of the chart if `variant` is set to `donut`.\n */\n innerMetricValue?: string;\n\n /**\n * Additional description that's displayed in the center of the chart below `innerMetricValue` if `variant` is set to `donut`.\n * This is usually the unit of the `innerMetricValue`.\n */\n innerMetricDescription?: string;\n\n /**\n * Title for the legend.\n */\n legendTitle?: string;\n\n /**\n * Additional filters that you can add above the chart component.\n * Make sure you update the `data` property when any of your custom filters change the data that's displayed.\n */\n additionalFilters?: React.ReactNode;\n\n /**\n * Specifies the currently highlighted data segment. Highlighting is typically the result of\n * a user hovering over or selecting a segment in the chart or the legend.\n * A value of `null` means no segment is being highlighted.\n *\n * - If you don't set this property, segments are highlighted automatically when a user hovers over or selects one of the triggers (that is, uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onHighlightChange` listener to update this property when a segment should be highlighted (that is, controlled behavior).\n */\n highlightedSegment?: T | null;\n\n /**\n * An array of data segment objects that determines which data segments are currently visible (that is, not filtered out).\n *\n * - If you don't set this property, segments are filtered automatically when using the default filtering of the component (that is, uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onFilterChange` listener to update this property when the list of filtered segments changes (that is, controlled behavior).\n */\n visibleSegments?: ReadonlyArray<T>;\n\n /**\n * Specifies the current status of loading data.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that data has loaded successfully.\n * * `error` - Indicates that an error occurred during fetch. You should provide an option to enable the user to recover.\n **/\n statusType?: 'loading' | 'finished' | 'error';\n\n /**\n * Content that's displayed when the data passed to the component is empty.\n */\n empty?: React.ReactNode;\n\n /**\n * Content that's displayed when there is no data to display because it doesn't match the specified filter.\n */\n noMatch?: React.ReactNode;\n\n /**\n * Text that's displayed when the chart is loading (that is, when `statusType` is set to `loading`).\n * @i18n\n */\n loadingText?: string;\n\n /**\n * Text that's displayed when the chart is in error state (that is, when `statusType` is set to `error`).\n * @i18n\n */\n errorText?: string;\n\n /**\n * Text for the recovery button that's displayed next to the error text.\n * @i18n\n **/\n recoveryText?: string;\n\n /**\n * Called when the user clicks the recovery button that appears when there is an error state.\n * Use this to enable the user to retry a failed request or provide another option for the user\n * to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler;\n\n /**\n * Called when the highlighted segmented changes because of a user interaction.\n */\n onHighlightChange?: NonCancelableEventHandler<PieChartProps.HighlightChangeDetail<T>>;\n\n /**\n * Called when the values of the internal filter component changes.\n * This isn't called for any custom filter components you've defined in `additionalFilters`.\n */\n onFilterChange?: NonCancelableEventHandler<PieChartProps.FilterChangeDetail<T>>;\n\n /**\n * ARIA label that's assigned to the chart. It should match the visible label on the page\n * (for example, in the container header). Use either `ariaLabel` or `ariaLabelledby` (you can't use both).\n */\n ariaLabel?: string;\n\n /**\n * Sets `aria-labelledby` on the chart. If there is a visible label for the chart on the page\n * (for example, in the container header), set this property to the ID of that header element.\n * Use either `ariaLabel` or `ariaLabelledby` (you can't use both).\n */\n ariaLabelledby?: string;\n\n /**\n * A description of the chart that assistive technologies can use (through `aria-describedby` and `<title>`).\n * Provide a concise summary of the data visualized in the chart.\n */\n ariaDescription?: string;\n\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n */\n i18nStrings?: PieChartProps.I18nStrings;\n\n /**\n * Enable this property to make the chart fit into the available height of the parent container.\n */\n fitHeight?: boolean;\n}\n\nexport namespace PieChartProps {\n export interface Datum {\n title: string;\n value: number;\n color?: string;\n }\n\n export type PieChartData = ReadonlyArray<Datum>;\n\n export interface DetailPopoverContentFunction<T = Datum> {\n (segment: T, visibleDataSum: number): ReadonlyArray<ChartDetailPair>;\n }\n\n export interface DetailPopoverFooter<T> {\n (segment: T): React.ReactNode;\n }\n\n export interface SegmentDescriptionFunction<T = Datum> {\n (segment: T, visibleDataSum: number): string;\n }\n\n export interface HighlightChangeDetail<T> {\n highlightedSegment: T | null;\n }\n\n export interface FilterChangeDetail<T> {\n visibleSegments: ReadonlyArray<T>;\n }\n\n export interface I18nStrings {\n /** Name of the \"Value\" key that is displayed in the details popover by default */\n detailsValue?: string;\n\n /** Name of the \"Percentage\" key that is displayed in the details popover by default */\n detailsPercentage?: string;\n\n /** Visible label of the default filter */\n filterLabel?: string;\n\n /** Placeholder text of the default filter */\n filterPlaceholder?: string;\n\n /** ARIA label for the default filter which is appended to any option that is selected */\n filterSelectedAriaLabel?: string;\n\n /** ARIA label that is associated with the legend in case there is no visible `legendTitle` defined */\n legendAriaLabel?: string;\n\n /** ARIA label for details popover dismiss button */\n detailPopoverDismissAriaLabel?: string;\n\n /** Name of the ARIA role description of the chart, e.g. \"pie chart\" */\n chartAriaRoleDescription?: string;\n\n /** Name of the ARIA role description of each segment, e.g. \"segment\" */\n segmentAriaRoleDescription?: string;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/pie-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { PopoverProps } from '../popover/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface SeriesInfo {\n label: string;\n color: string;\n index: number;\n markerType: 'line' | 'rectangle';\n}\n\ninterface ChartDetailPair {\n key: ReactNode;\n value: ReactNode;\n}\n\nexport interface PieChartProps<T extends PieChartProps.Datum = PieChartProps.Datum> extends BaseComponentProps {\n /**\n * An array that represents the source of data for the displayed segments.\n * Each element can have the following properties:\n *\n * * `title` (string) - A human-readable title for this data point.\n * * `value` (number) - Numeric value that determines the segment size.\n * A segment with a value of zero (0) or lower (negative number) won't have a segment.\n * * `color`: (string) - (Optional) Color value for this segment that takes priority over the automatically assigned color.\n * Can be any valid CSS color identifier.\n *\n * As long as your data object implements the properties above, you can also define additional properties\n * that are relevant to your data visualization.\n * The full data object will be passed down to events and properties like `detailPopoverContent`.\n */\n data: ReadonlyArray<T>;\n\n /**\n * Specifies the size of the pie or donut chart.\n * When used with `fitHeight`, this property defines the minimum size of the chart area.\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Visual variant of the pie chart. Currently supports the default `pie` variant and the `donut` variant.\n * The donut variant provides a slot in the center of the chart that can contain additional information.\n * For more information, see `innerContent`.\n */\n variant?: 'pie' | 'donut';\n\n /**\n * A function that determines the details that are displayed in the popover when hovering over a segment.\n * The function is called with the data of the target segment and is expected to return an array of detail pairs.\n * By default, each segment displays two detail pairs: count and percentage.\n *\n * Each pair has the following properties:\n * * `key` (ReactNode) - Name of the detail or metric.\n * * `value` (ReactNode) - The value of this detail for the target segment.\n */\n detailPopoverContent?: PieChartProps.DetailPopoverContentFunction<T>;\n\n /**\n * Additional content that is displayed at the bottom of the detail popover.\n */\n detailPopoverFooter?: PieChartProps.DetailPopoverFooter<T>;\n\n /**\n * A function that determines the description of a segment that is displayed on the chart, unless `hideDescriptions` is set to `true`.\n * This is an optional description that explains the segment and is displayed underneath the label.\n * The function is called with the data object of each segment and is expected to return the description as a string.\n */\n segmentDescription?: PieChartProps.SegmentDescriptionFunction<T>;\n\n /**\n * Determines the maximum width of the popover.\n */\n detailPopoverSize?: PopoverProps.Size;\n\n /**\n * Hides legend beneath the chart when set to `true`.\n * We highly recommend that you leave this unspecified or set to `false`.\n */\n hideLegend?: boolean;\n\n /**\n * Hides label titles next to the chart segments when set to `true`.\n * We highly recommend that you leave this unspecified or set to `false`.\n */\n hideTitles?: boolean;\n\n /**\n * Hides the label descriptions next to the chart segments when set to `true`.\n */\n hideDescriptions?: boolean;\n\n /**\n * Hides the default filtering dropdown when set to `true`.\n * You can still display additional filters with the `additionalFilters` slot.\n */\n hideFilter?: boolean;\n\n /**\n * Additional metric number that's displayed in the center of the chart if `variant` is set to `donut`.\n */\n innerMetricValue?: string;\n\n /**\n * Additional description that's displayed in the center of the chart below `innerMetricValue` if `variant` is set to `donut`.\n * This is usually the unit of the `innerMetricValue`.\n */\n innerMetricDescription?: string;\n\n /**\n * Title for the legend.\n */\n legendTitle?: string;\n\n /**\n * Additional filters that you can add above the chart component.\n * Make sure you update the `data` property when any of your custom filters change the data that's displayed.\n */\n additionalFilters?: React.ReactNode;\n\n /**\n * Specifies the currently highlighted data segment. Highlighting is typically the result of\n * a user hovering over or selecting a segment in the chart or the legend.\n * A value of `null` means no segment is being highlighted.\n *\n * - If you don't set this property, segments are highlighted automatically when a user hovers over or selects one of the triggers (that is, uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onHighlightChange` listener to update this property when a segment should be highlighted (that is, controlled behavior).\n */\n highlightedSegment?: T | null;\n\n /**\n * An array of data segment objects that determines which data segments are currently visible (that is, not filtered out).\n *\n * - If you don't set this property, segments are filtered automatically when using the default filtering of the component (that is, uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onFilterChange` listener to update this property when the list of filtered segments changes (that is, controlled behavior).\n */\n visibleSegments?: ReadonlyArray<T>;\n\n /**\n * Specifies the current status of loading data.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that data has loaded successfully.\n * * `error` - Indicates that an error occurred during fetch. You should provide an option to enable the user to recover.\n **/\n statusType?: 'loading' | 'finished' | 'error';\n\n /**\n * Content that's displayed when the data passed to the component is empty.\n */\n empty?: React.ReactNode;\n\n /**\n * Content that's displayed when there is no data to display because it doesn't match the specified filter.\n */\n noMatch?: React.ReactNode;\n\n /**\n * Text that's displayed when the chart is loading (that is, when `statusType` is set to `loading`).\n * @i18n\n */\n loadingText?: string;\n\n /**\n * Text that's displayed when the chart is in error state (that is, when `statusType` is set to `error`).\n * @i18n\n */\n errorText?: string;\n\n /**\n * Text for the recovery button that's displayed next to the error text.\n * @i18n\n **/\n recoveryText?: string;\n\n /**\n * Called when the user clicks the recovery button that appears when there is an error state.\n * Use this to enable the user to retry a failed request or provide another option for the user\n * to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler;\n\n /**\n * Called when the highlighted segmented changes because of a user interaction.\n */\n onHighlightChange?: NonCancelableEventHandler<PieChartProps.HighlightChangeDetail<T>>;\n\n /**\n * Called when the values of the internal filter component changes.\n * This isn't called for any custom filter components you've defined in `additionalFilters`.\n */\n onFilterChange?: NonCancelableEventHandler<PieChartProps.FilterChangeDetail<T>>;\n\n /**\n * ARIA label that's assigned to the chart. It should match the visible label on the page\n * (for example, in the container header). Use either `ariaLabel` or `ariaLabelledby` (you can't use both).\n */\n ariaLabel?: string;\n\n /**\n * Sets `aria-labelledby` on the chart. If there is a visible label for the chart on the page\n * (for example, in the container header), set this property to the ID of that header element.\n * Use either `ariaLabel` or `ariaLabelledby` (you can't use both).\n */\n ariaLabelledby?: string;\n\n /**\n * A description of the chart that assistive technologies can use (through `aria-describedby` and `<title>`).\n * Provide a concise summary of the data visualized in the chart.\n */\n ariaDescription?: string;\n\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n */\n i18nStrings?: PieChartProps.I18nStrings;\n\n /**\n * Enable this property to make the chart fit into the available height of the parent container.\n */\n fitHeight?: boolean;\n}\n\nexport namespace PieChartProps {\n export interface Datum {\n title: string;\n value: number;\n color?: string;\n }\n\n export type PieChartData = ReadonlyArray<Datum>;\n\n export interface DetailPopoverContentFunction<T = Datum> {\n (segment: T, visibleDataSum: number): ReadonlyArray<ChartDetailPair>;\n }\n\n export interface DetailPopoverFooter<T> {\n (segment: T): React.ReactNode;\n }\n\n export interface SegmentDescriptionFunction<T = Datum> {\n (segment: T, visibleDataSum: number): string;\n }\n\n export interface HighlightChangeDetail<T> {\n highlightedSegment: T | null;\n }\n\n export interface FilterChangeDetail<T> {\n visibleSegments: ReadonlyArray<T>;\n }\n\n export interface I18nStrings {\n /** Name of the \"Value\" key that is displayed in the details popover by default */\n detailsValue?: string;\n\n /** Name of the \"Percentage\" key that is displayed in the details popover by default */\n detailsPercentage?: string;\n\n /** Visible label of the default filter */\n filterLabel?: string;\n\n /** Placeholder text of the default filter */\n filterPlaceholder?: string;\n\n /** ARIA label for the default filter which is appended to any option that is selected */\n filterSelectedAriaLabel?: string;\n\n /** ARIA label that is associated with the legend in case there is no visible `legendTitle` defined */\n legendAriaLabel?: string;\n\n /** ARIA label for details popover dismiss button */\n detailPopoverDismissAriaLabel?: string;\n\n /** Name of the ARIA role description of the chart, e.g. \"pie chart\" */\n chartAriaRoleDescription?: string;\n\n /** Name of the ARIA role description of each segment, e.g. \"segment\" */\n segmentAriaRoleDescription?: string;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponentProps } from '../
|
|
1
|
+
import { BaseComponentProps } from '../types/base-component';
|
|
2
2
|
export interface PopoverProps extends BaseComponentProps {
|
|
3
3
|
/**
|
|
4
4
|
* Determines where the popover is displayed when opened, relative to the trigger.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/popover/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/popover/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC;IAEjC;;OAEG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC;IAEvC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,cAAc,GACd,UAAU,GACV,aAAa,GACb,YAAY,GACZ,WAAW,GACX,UAAU,GACV,eAAe,GACf,cAAc,GACd,aAAa,CAAC;AAElB,MAAM,WAAW,MAAM;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAE9C,MAAM,MAAM,IAAI,GAAG,WAAW,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,yBAAiB,YAAY,CAAC;IAC5B,KAAY,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3D,KAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAChD,KAAY,WAAW,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC;IAE5D,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;QAEd;;WAEG;QACH,OAAO,IAAI,IAAI,CAAC;KACjB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/popover/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/popover/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../types/base-component';\n\nexport interface PopoverProps extends BaseComponentProps {\n /**\n * Determines where the popover is displayed when opened, relative to the trigger.\n * If the popover doesn't have enough space to open in this direction, it\n * automatically chooses a better direction based on available space.\n */\n position?: PopoverProps.Position;\n\n /**\n * Determines the maximum width for the popover.\n */\n size?: PopoverProps.Size;\n\n /**\n * Expands the popover body to its maximum width regardless of content.\n * For example, use it when you need to place a column layout in the popover content.\n */\n fixedWidth?: boolean;\n\n /**\n * Specifies the type of content inside the trigger region. The following types are available:\n * - `text` - Use for triggers containing inline components, like status indicator.\n * - `text-inline` - Use for triggers containing plain text only.\n * - `custom` - Use for the [button](/components/button/) component.\n */\n triggerType?: PopoverProps.TriggerType;\n\n /**\n * Adds `aria-label` to the text trigger button. Use this to provide an accessible name for triggers\n * that don't have visible text, and to distinguish between multiple triggers with identical visible text.\n */\n triggerAriaLabel?: string;\n\n /**\n * Specifies if the text trigger content should wrap. If you set it to false, it prevents the text from\n * wrapping and truncates it with an ellipsis.\n */\n wrapTriggerText?: boolean;\n\n /**\n * Element that triggers the popover when selected by the user.\n * @displayname trigger\n */\n children?: React.ReactNode;\n\n /**\n * Specifies optional header text for the popover.\n */\n header?: string;\n\n /**\n * Content of the popover.\n */\n content?: React.ReactNode;\n\n /**\n * Determines whether the dismiss button is shown in the popover body.\n */\n dismissButton?: boolean;\n\n /**\n * Adds an `aria-label` to the dismiss button for accessibility.\n * @i18n\n */\n dismissAriaLabel?: string;\n\n /**\n * By default, the popover is constrained to fit inside its parent\n * [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context).\n * Enabling this property will allow the popover to be rendered in the root stack context using\n * [React Portals](https://reactjs.org/docs/portals.html).\n * Enable this setting if you need the popover to ignore its parent stacking context, such as in side navigation.\n *\n * Note: Using popover rendered with portal within a Modal is not supported.\n */\n renderWithPortal?: boolean;\n}\n\n/**\n * The position the popover is actually in, given space constraints.\n */\nexport type InternalPosition =\n | 'right-top'\n | 'right-bottom'\n | 'left-top'\n | 'left-bottom'\n | 'top-center'\n | 'top-right'\n | 'top-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'bottom-left';\n\nexport interface Offset {\n insetInlineStart: number;\n insetBlockStart: number;\n}\n\nexport interface Dimensions {\n inlineSize: number;\n blockSize: number;\n}\n\nexport type BoundingBox = Dimensions & Offset;\n\nexport type Rect = BoundingBox & {\n insetBlockEnd: number;\n insetInlineEnd: number;\n};\n\nexport namespace PopoverProps {\n export type Position = 'top' | 'right' | 'bottom' | 'left';\n export type Size = 'small' | 'medium' | 'large';\n export type TriggerType = 'text' | 'text-inline' | 'custom';\n\n export interface Ref {\n /**\n * Sets focus on the popover's trigger and dismisses the popover if open.\n */\n focus(): void;\n\n /**\n * Dismisses the popover without focusing the trigger. Use only if an element other than the trigger needs to be focused after dismissing the popover.\n */\n dismiss(): void;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { NonCancelableEventHandler } from '../internal/events/index';
|
|
3
2
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
3
|
+
import { NonCancelableEventHandler } from '../types/events';
|
|
4
4
|
import { PopoverProps } from './interfaces';
|
|
5
5
|
export interface InternalPopoverProps extends Omit<PopoverProps, 'triggerType' | 'size'>, InternalBaseComponentProps {
|
|
6
6
|
__onOpen?: NonCancelableEventHandler<null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/popover/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/popover/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAa7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAK5D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,MAAM,CAAC,EAAE,0BAA0B;IAClH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;I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AS,GAAG,YAAY,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAE9D,OAAO,CACL,iCACM,SAAS,EACb,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,IAAI,EACX,SAAS,CAAC,SAAS,EACnB,WAAW,KAAK,iBAAiB,IAAI,MAAM,CAAC,sBAAsB,CAAC,EACnE,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,CAC9B,EACD,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,GAAG,EAAE;YAChB,gFAAgF;YAChF,YAAY,CAAC,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBAChD,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;YAC9B,CAAC,CAAC,CAAC;QACL,CAAC;QAEA,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAC/C,mCACM,YAAY,EAChB,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,eAAe,KAAK,KAAK,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC,EACjG,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAC,QAAQ,mBACC,QAAQ,EACtB,EAAE,EAAE,UAAU,gBACF,gBAAgB,IAE3B,QAAQ,CACF,CACV,CAAC,CAAC,CAAC,CACF,iCAAU,YAAY,EAAE,EAAE,EAAE,UAAU,IACnC,QAAQ,CACJ,CACR;QACA,OAAO,IAAI,CACV,oBAAC,qBAAqB,QACnB,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAChD,CACzB,CACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { Portal, useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { useSingleTabStopNavigation } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { useTokenInlineContext } from '../internal/context/token-inline-context';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { KeyCode } from '../internal/keycode';\nimport Arrow from './arrow';\nimport PopoverBody from './body';\nimport ConditionalLiveRegion from './conditional-live-region';\nimport PopoverContainer from './container';\nimport { PopoverProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalPopoverProps extends Omit<PopoverProps, 'triggerType' | 'size'>, InternalBaseComponentProps {\n __onOpen?: NonCancelableEventHandler<null>;\n triggerType?: PopoverProps.TriggerType | 'filtering-token';\n size: PopoverProps.Size | 'content';\n __closeAnalyticsAction?: string;\n isInline?: boolean;\n __visible?: boolean;\n __onVisibleChange?: NonCancelableEventHandler<{ visible: boolean }>;\n}\n\nexport default React.forwardRef(InternalPopover);\n\nfunction InternalPopover(\n {\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n\n children,\n header,\n content,\n triggerAriaLabel,\n\n wrapTriggerText = true,\n isInline = false,\n renderWithPortal = false,\n\n __onOpen,\n __internalRootRef,\n __closeAnalyticsAction,\n __visible: controlledVisible,\n __onVisibleChange: onVisibleChange,\n\n ...restProps\n }: InternalPopoverProps,\n ref: React.Ref<PopoverProps.Ref>\n) {\n const baseProps = getBaseProps(restProps);\n const triggerRef = useRef<HTMLElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n\n const i18n = useInternalI18n('popover');\n const dismissAriaLabel = i18n('dismissAriaLabel', restProps.dismissAriaLabel);\n\n const [internalVisible, setInternalVisible] = useState(false);\n const isControlled = controlledVisible !== undefined;\n const visible = isControlled ? controlledVisible : internalVisible;\n\n const updateVisible = useCallback(\n (newVisible: boolean) => {\n if (isControlled) {\n fireNonCancelableEvent(onVisibleChange, { visible: newVisible });\n } else {\n setInternalVisible(newVisible);\n }\n },\n [isControlled, onVisibleChange]\n );\n\n const focusTrigger = useCallback(() => {\n if (['text', 'text-inline'].includes(triggerType)) {\n triggerRef.current?.focus();\n } else if (triggerRef.current) {\n getFirstFocusable(triggerRef.current)?.focus();\n }\n }, [triggerType]);\n\n const onTriggerClick = useCallback(() => {\n fireNonCancelableEvent(__onOpen);\n updateVisible(true);\n }, [__onOpen, updateVisible]);\n\n const onDismiss = useCallback(() => {\n updateVisible(false);\n focusTrigger();\n }, [focusTrigger, updateVisible]);\n\n const onTriggerKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const isEscapeKey = event.keyCode === KeyCode.escape;\n const isTabKey = event.keyCode === KeyCode.tab;\n if (isEscapeKey && visible) {\n event.stopPropagation();\n }\n if (isTabKey || isEscapeKey) {\n updateVisible(false);\n }\n },\n [visible, updateVisible]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n dismiss: () => {\n updateVisible(false);\n },\n focus: () => {\n updateVisible(false);\n focusTrigger();\n },\n }),\n [updateVisible, focusTrigger]\n );\n\n const clickFrameId = useRef<number | null>(null);\n useEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n const document = triggerRef.current.ownerDocument;\n\n const onDocumentClick = () => {\n // Dismiss popover unless there was a click inside within the last animation frame.\n if (clickFrameId.current === null) {\n updateVisible(false);\n }\n };\n\n document.addEventListener('mousedown', onDocumentClick);\n\n return () => {\n document.removeEventListener('mousedown', onDocumentClick);\n };\n }, [updateVisible]);\n\n const popoverClasses = usePortalModeClasses(triggerRef, { resetVisualContext: true });\n const { isInlineToken } = useTokenInlineContext();\n\n const triggerProps = {\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: triggerRef as any,\n onClick: onTriggerClick,\n onKeyDown: onTriggerKeyDown,\n className: clsx(styles.trigger, styles[`trigger-type-${triggerType}`], isInlineToken && styles['in-inline-token']),\n };\n const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);\n\n const referrerId = useUniqueId();\n\n const popoverContent = (\n <div\n className={clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content'])}\n data-awsui-referrer-id={referrerId}\n >\n <PopoverContainer\n size={size}\n fixedWidth={fixedWidth}\n position={position}\n trackRef={triggerRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={renderWithPortal}\n zIndex={renderWithPortal ? 7000 : undefined}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n closeAnalyticsAction={__closeAnalyticsAction}\n >\n <ConditionalLiveRegion condition={!dismissButton}>{content}</ConditionalLiveRegion>\n </PopoverBody>\n </LinkDefaultVariantContext.Provider>\n </PopoverContainer>\n </div>\n );\n\n const mergedRef = useMergeRefs(popoverRef, __internalRootRef);\n\n return (\n <span\n {...baseProps}\n className={clsx(\n styles.root,\n baseProps.className,\n triggerType === 'filtering-token' && styles['root-filtering-token'],\n isInline && styles['no-wrap']\n )}\n ref={mergedRef}\n onMouseDown={() => {\n // Indicate there was a click inside popover recently, including nested portals.\n clickFrameId.current = requestAnimationFrame(() => {\n clickFrameId.current = null;\n });\n }}\n >\n {['text', 'text-inline'].includes(triggerType) ? (\n <button\n {...triggerProps}\n className={clsx(triggerProps.className, wrapTriggerText === false && styles['overflow-ellipsis'])}\n tabIndex={triggerTabIndex}\n type=\"button\"\n aria-haspopup=\"dialog\"\n id={referrerId}\n aria-label={triggerAriaLabel}\n >\n {children}\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n {visible && (\n <ResetContextsForModal>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </ResetContextsForModal>\n )}\n </span>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/popover/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,qBAAqB,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAC9D,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAG3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAYrC,eAAe,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEjD,SAAS,eAAe,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AAC,CAC9B,EACD,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,GAAG,EAAE;YAChB,gFAAgF;YAChF,YAAY,CAAC,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBAChD,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;YAC9B,CAAC,CAAC,CAAC;QACL,CAAC;QAEA,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAC/C,mCACM,YAAY,EAChB,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,eAAe,KAAK,KAAK,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC,EACjG,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAC,QAAQ,mBACC,QAAQ,EACtB,EAAE,EAAE,UAAU,gBACF,gBAAgB,IAE3B,QAAQ,CACF,CACV,CAAC,CAAC,CAAC,CACF,iCAAU,YAAY,EAAE,EAAE,EAAE,UAAU,IACnC,QAAQ,CACJ,CACR;QACA,OAAO,IAAI,CACV,oBAAC,qBAAqB,QACnB,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAChD,CACzB,CACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { Portal, useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { useSingleTabStopNavigation } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { useTokenInlineContext } from '../internal/context/token-inline-context';\nimport { fireNonCancelableEvent } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { KeyCode } from '../internal/keycode';\nimport { NonCancelableEventHandler } from '../types/events';\nimport Arrow from './arrow';\nimport PopoverBody from './body';\nimport ConditionalLiveRegion from './conditional-live-region';\nimport PopoverContainer from './container';\nimport { PopoverProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalPopoverProps extends Omit<PopoverProps, 'triggerType' | 'size'>, InternalBaseComponentProps {\n __onOpen?: NonCancelableEventHandler<null>;\n triggerType?: PopoverProps.TriggerType | 'filtering-token';\n size: PopoverProps.Size | 'content';\n __closeAnalyticsAction?: string;\n isInline?: boolean;\n __visible?: boolean;\n __onVisibleChange?: NonCancelableEventHandler<{ visible: boolean }>;\n}\n\nexport default React.forwardRef(InternalPopover);\n\nfunction InternalPopover(\n {\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n\n children,\n header,\n content,\n triggerAriaLabel,\n\n wrapTriggerText = true,\n isInline = false,\n renderWithPortal = false,\n\n __onOpen,\n __internalRootRef,\n __closeAnalyticsAction,\n __visible: controlledVisible,\n __onVisibleChange: onVisibleChange,\n\n ...restProps\n }: InternalPopoverProps,\n ref: React.Ref<PopoverProps.Ref>\n) {\n const baseProps = getBaseProps(restProps);\n const triggerRef = useRef<HTMLElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n\n const i18n = useInternalI18n('popover');\n const dismissAriaLabel = i18n('dismissAriaLabel', restProps.dismissAriaLabel);\n\n const [internalVisible, setInternalVisible] = useState(false);\n const isControlled = controlledVisible !== undefined;\n const visible = isControlled ? controlledVisible : internalVisible;\n\n const updateVisible = useCallback(\n (newVisible: boolean) => {\n if (isControlled) {\n fireNonCancelableEvent(onVisibleChange, { visible: newVisible });\n } else {\n setInternalVisible(newVisible);\n }\n },\n [isControlled, onVisibleChange]\n );\n\n const focusTrigger = useCallback(() => {\n if (['text', 'text-inline'].includes(triggerType)) {\n triggerRef.current?.focus();\n } else if (triggerRef.current) {\n getFirstFocusable(triggerRef.current)?.focus();\n }\n }, [triggerType]);\n\n const onTriggerClick = useCallback(() => {\n fireNonCancelableEvent(__onOpen);\n updateVisible(true);\n }, [__onOpen, updateVisible]);\n\n const onDismiss = useCallback(() => {\n updateVisible(false);\n focusTrigger();\n }, [focusTrigger, updateVisible]);\n\n const onTriggerKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const isEscapeKey = event.keyCode === KeyCode.escape;\n const isTabKey = event.keyCode === KeyCode.tab;\n if (isEscapeKey && visible) {\n event.stopPropagation();\n }\n if (isTabKey || isEscapeKey) {\n updateVisible(false);\n }\n },\n [visible, updateVisible]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n dismiss: () => {\n updateVisible(false);\n },\n focus: () => {\n updateVisible(false);\n focusTrigger();\n },\n }),\n [updateVisible, focusTrigger]\n );\n\n const clickFrameId = useRef<number | null>(null);\n useEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n const document = triggerRef.current.ownerDocument;\n\n const onDocumentClick = () => {\n // Dismiss popover unless there was a click inside within the last animation frame.\n if (clickFrameId.current === null) {\n updateVisible(false);\n }\n };\n\n document.addEventListener('mousedown', onDocumentClick);\n\n return () => {\n document.removeEventListener('mousedown', onDocumentClick);\n };\n }, [updateVisible]);\n\n const popoverClasses = usePortalModeClasses(triggerRef, { resetVisualContext: true });\n const { isInlineToken } = useTokenInlineContext();\n\n const triggerProps = {\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: triggerRef as any,\n onClick: onTriggerClick,\n onKeyDown: onTriggerKeyDown,\n className: clsx(styles.trigger, styles[`trigger-type-${triggerType}`], isInlineToken && styles['in-inline-token']),\n };\n const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);\n\n const referrerId = useUniqueId();\n\n const popoverContent = (\n <div\n className={clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content'])}\n data-awsui-referrer-id={referrerId}\n >\n <PopoverContainer\n size={size}\n fixedWidth={fixedWidth}\n position={position}\n trackRef={triggerRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={renderWithPortal}\n zIndex={renderWithPortal ? 7000 : undefined}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n closeAnalyticsAction={__closeAnalyticsAction}\n >\n <ConditionalLiveRegion condition={!dismissButton}>{content}</ConditionalLiveRegion>\n </PopoverBody>\n </LinkDefaultVariantContext.Provider>\n </PopoverContainer>\n </div>\n );\n\n const mergedRef = useMergeRefs(popoverRef, __internalRootRef);\n\n return (\n <span\n {...baseProps}\n className={clsx(\n styles.root,\n baseProps.className,\n triggerType === 'filtering-token' && styles['root-filtering-token'],\n isInline && styles['no-wrap']\n )}\n ref={mergedRef}\n onMouseDown={() => {\n // Indicate there was a click inside popover recently, including nested portals.\n clickFrameId.current = requestAnimationFrame(() => {\n clickFrameId.current = null;\n });\n }}\n >\n {['text', 'text-inline'].includes(triggerType) ? (\n <button\n {...triggerProps}\n className={clsx(triggerProps.className, wrapTriggerText === false && styles['overflow-ellipsis'])}\n tabIndex={triggerTabIndex}\n type=\"button\"\n aria-haspopup=\"dialog\"\n id={referrerId}\n aria-label={triggerAriaLabel}\n >\n {children}\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n {visible && (\n <ResetContextsForModal>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </ResetContextsForModal>\n )}\n </span>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseComponentProps } from '../
|
|
2
|
-
import { NonCancelableEventHandler } from '../
|
|
1
|
+
import { BaseComponentProps } from '../types/base-component';
|
|
2
|
+
import { NonCancelableEventHandler } from '../types/events';
|
|
3
3
|
export interface ProgressBarProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
5
|
* Indicates the current progress as a percentage. The value must be between 0 and 100. Decimals are rounded.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/progress-bar/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/progress-bar/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAEjC;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAEnC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE7B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC;IAEhD;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC;CAChC;AAED,yBAAiB,gBAAgB,CAAC;IAChC,KAAY,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;IACzD,KAAY,OAAO,GAAG,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;IAE3D,UAAiB,KAAK;QACpB,WAAW,CAAC,EAAE;YACZ,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,aAAa,CAAC,EAAE;YACd,eAAe,CAAC,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF,kBAAkB,CAAC,EAAE;YACnB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/progress-bar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/progress-bar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface ProgressBarProps extends BaseComponentProps {\n /**\n * Indicates the current progress as a percentage. The value must be between 0 and 100. Decimals are rounded.\n */\n value?: number;\n\n /**\n * Specifies the status of the progress bar. You can set it to one of the following:\n *\n * - `\"in-progress\"` - Displays a progress bar.\n * - `\"success\"` or `\"error\"` - Displays a result state and replaces the progress element with a status indicator,\n * `resultText`, and a result button.\n */\n status?: ProgressBarProps.Status;\n\n /**\n * Enables the correct styling of the progress bar in different contexts. You can set it to one of the following:\n *\n * - `\"flash\"` - Use this variant when using the progress bar within a flash component.\n * Note that the result button isn't displayed when using this variant.\n * Use the `buttonText` property and the `onButtonClick` event listener of the flashbar item instead of the result button provided by the progress bar.\n * - `\"key-value\"` - Use this variant when using the progress bar within the key-value pairs pattern.\n * - `\"standalone\"` Use in all other cases. This is the default value.\n */\n variant?: ProgressBarProps.Variant;\n\n /**\n * Specifies the text for the button that's displayed when the `status` is set to `error` or `success`.\n * If `resultButtonText` is empty, the result button isn't displayed.\n *\n * Note: If you use the `flash` variant, the result button isn't displayed.\n * Add a button using the `action` property of the flashbar item instead.\n */\n resultButtonText?: string;\n\n /**\n * Adds an `aria-label` to the progress bar.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the progress bar.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the progress bar.\n */\n ariaDescribedby?: string;\n\n /**\n * Short description of the operation that appears at the top of the component.\n *\n * Make sure that you always provide a label for accessibility.\n */\n label?: React.ReactNode;\n\n /**\n * More detailed information about the operation that appears below the label.\n */\n description?: React.ReactNode;\n\n /**\n * Information that's displayed below the progress bar or status text.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Content that's displayed when `status` is set to `error` or `success`.\n */\n resultText?: React.ReactNode;\n\n /**\n * Called when the user clicks the result state button.\n *\n * Note: If you are using the `flash` variant, the result button isn't displayed.\n * Use the `buttonText` property and the `onButtonClick` event listener of the flashbar item instead.\n */\n onResultButtonClick?: NonCancelableEventHandler;\n\n /**\n * An object containing CSS properties to customize the progress bar's visual appearance.\n * Refer to the [style](/components/progress-bar/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ProgressBarProps.Style;\n}\n\nexport namespace ProgressBarProps {\n export type Status = 'in-progress' | 'success' | 'error';\n export type Variant = 'standalone' | 'flash' | 'key-value';\n\n export interface Style {\n progressBar?: {\n backgroundColor?: string;\n borderRadius?: string;\n height?: string;\n };\n progressValue?: {\n backgroundColor?: string;\n };\n progressPercentage?: {\n color?: string;\n fontSize?: string;\n fontWeight?: string;\n };\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DropdownStatusProps } from '../../internal/components/dropdown-status/interfaces';
|
|
2
|
-
import { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';
|
|
3
1
|
import { HighlightedOptionHandlers, HighlightedOptionState } from '../../internal/components/options-list/utils/use-highlight-option';
|
|
2
|
+
import { DropdownStatusProps } from '../../types/dropdown-status';
|
|
3
|
+
import { OptionDefinition, OptionGroup } from '../../types/option';
|
|
4
4
|
import { PromptInputProps } from '../interfaces';
|
|
5
5
|
export type MenuItem = (OptionDefinition | OptionGroup) & {
|
|
6
6
|
type?: 'parent' | 'child' | 'use-entered';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-state.d.ts","sourceRoot":"","sources":["../../../../src/prompt-input/core/menu-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu-state.d.ts","sourceRoot":"","sources":["../../../../src/prompt-input/core/menu-state.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EAEvB,MAAM,mEAAmE,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKjD,MAAM,MAAM,QAAQ,GAAG,CAAC,gBAAgB,GAAG,WAAW,CAAC,GAAG;IACxD,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IAC1C,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACxC,CAAC;AAEF,uCAAuC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jB,EAAE,EAAE,eAAe,EAAE;QACrB,KAAK,EAAE,cAAc,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,IAAI,EAAE;QACzD,KAAK,EAAE,cAAc,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM;KACP,CAAC;IAEF,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,cAAc,CAAC,EAAE,CAAC,CAAC;IAClG,MAAM,QAAQ,GAAG,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAClE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AACvF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useMemo, useRef } from 'react';\n\nimport { filterOptions } from '../../autosuggest/utils/utils';\nimport { DropdownStatusProps } from '../../internal/components/dropdown-status/interfaces';\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { generateTestIndexes } from '../../internal/components/options-list/utils/test-indexes';\nimport {\n HighlightedOptionHandlers,\n HighlightedOptionState,\n useHighlightedOption,\n} from '../../internal/components/options-list/utils/use-highlight-option';\nimport { PromptInputProps } from '../interfaces';\nimport { calculateTokenPosition } from './caret-controller';\nimport { generateTokenId } from './dom-utils';\nimport { isPinnedReferenceToken, isReferenceToken, isTriggerToken } from './type-guards';\n\nexport type MenuItem = (OptionDefinition | OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n\n/** Props for the useMenuItems hook. */\nexport interface UseMenuItemsProps {\n menu: PromptInputProps.MenuDefinition;\n filterText: string;\n onSelectItem: (option: MenuItem) => void;\n}\n\n/** Current state of the menu items list, including highlight tracking. */\nexport interface MenuItemsState extends HighlightedOptionState<MenuItem> {\n items: readonly MenuItem[];\n showAll: boolean;\n getItemGroup: (item: MenuItem) => undefined | OptionGroup;\n}\n\n/** Handlers for navigating and selecting menu items via keyboard and mouse. */\nexport interface MenuItemsHandlers extends HighlightedOptionHandlers<MenuItem> {\n selectHighlightedOptionWithKeyboard(): boolean;\n highlightVisibleOptionWithMouse(index: number): void;\n selectVisibleOptionWithMouse(index: number): void;\n}\n\ninterface UseMenuLoadMoreProps {\n menu: PromptInputProps.MenuDefinition;\n statusType: DropdownStatusProps.StatusType;\n onLoadItems: (detail: PromptInputProps.MenuLoadItemsDetail) => void;\n onLoadMoreItems?: () => void;\n}\n\ninterface MenuLoadMoreHandlers {\n fireLoadMoreOnScroll(): void;\n fireLoadMoreOnRecoveryClick(): void;\n fireLoadMoreOnMenuOpen(): void;\n fireLoadMoreOnInputChange(filteringText: string): void;\n}\n\nfunction isMenuItemHighlightable(option?: MenuItem): boolean {\n return !!option && option.type !== 'parent';\n}\n\nfunction isMenuItemInteractive(option?: MenuItem): boolean {\n return !!option && !option.disabled && option.type !== 'parent';\n}\n\n/** Manages menu item filtering, highlighting, and selection for a trigger menu. */\nexport const useMenuItems = ({\n menu,\n filterText,\n onSelectItem,\n}: UseMenuItemsProps): [MenuItemsState, MenuItemsHandlers] => {\n const { items, getItemGroup, getItemParent } = useMemo(() => createItems(menu.options), [menu.options]);\n\n const filteredItems = useMemo(() => {\n const filteringType = menu.filteringType ?? 'auto';\n const filtered: MenuItem[] =\n filteringType === 'auto' ? (filterOptions(items, filterText) as MenuItem[]) : [...items];\n generateTestIndexes(filtered, getItemParent);\n return filtered;\n }, [menu.filteringType, items, filterText, getItemParent]);\n\n const [highlightedOptionState, highlightedOptionHandlers] = useHighlightedOption({\n options: filteredItems,\n isHighlightable: isMenuItemHighlightable,\n });\n\n const selectHighlightedOptionWithKeyboard = () => {\n const { highlightedOption } = highlightedOptionState;\n if (!highlightedOption || !isMenuItemInteractive(highlightedOption)) {\n return false;\n }\n onSelectItem(highlightedOption);\n return true;\n };\n\n const highlightVisibleOptionWithMouse = (index: number) => {\n const item = filteredItems[index];\n if (item && isMenuItemHighlightable(item)) {\n highlightedOptionHandlers.setHighlightedIndexWithMouse(index);\n }\n };\n\n const selectVisibleOptionWithMouse = (index: number) => {\n const item = filteredItems[index];\n if (item && isMenuItemInteractive(item)) {\n onSelectItem(item);\n }\n };\n\n return [\n { ...highlightedOptionState, items: filteredItems, showAll: false, getItemGroup },\n {\n ...highlightedOptionHandlers,\n selectHighlightedOptionWithKeyboard,\n highlightVisibleOptionWithMouse,\n selectVisibleOptionWithMouse,\n },\n ];\n};\n\nfunction createItems(options: readonly OptionDefinition[]) {\n const items: MenuItem[] = [];\n const itemToGroup = new WeakMap<MenuItem, MenuItem>();\n const getItemParent = (item: MenuItem) => itemToGroup.get(item);\n const getItemGroup = (item: MenuItem) => getItemParent(item)?.option as OptionGroup;\n\n for (const option of options) {\n if (isGroup(option)) {\n for (const item of flattenGroup(option)) {\n items.push(item);\n }\n } else {\n items.push({ ...option, option });\n }\n }\n\n function flattenGroup(group: OptionGroup) {\n const { options, ...rest } = group;\n\n let hasOnlyDisabledChildren = true;\n\n const groupItem: MenuItem = { ...rest, type: 'parent', option: group };\n\n const items: MenuItem[] = [groupItem];\n\n for (const option of options) {\n if (!option.disabled) {\n hasOnlyDisabledChildren = false;\n }\n\n const childOption: MenuItem = {\n ...option,\n type: 'child',\n disabled: option.disabled || rest.disabled,\n option,\n };\n\n items.push(childOption);\n\n itemToGroup.set(childOption, groupItem);\n }\n\n items[0].disabled = items[0].disabled || hasOnlyDisabledChildren;\n\n return items;\n }\n\n return { items, getItemGroup, getItemParent };\n}\n\nfunction isGroup(optionOrGroup: OptionDefinition): optionOrGroup is OptionGroup {\n const key: keyof OptionGroup = 'options';\n return key in optionOrGroup;\n}\n\n/** Manages pagination and load-more behavior for menu items. */\nexport const useMenuLoadMore = ({\n menu,\n statusType,\n onLoadItems,\n onLoadMoreItems,\n}: UseMenuLoadMoreProps): MenuLoadMoreHandlers => {\n const lastFilteringText = useRef<string | null>(null);\n\n const fireLoadMore = (firstPage: boolean, samePage: boolean, filteringText?: string) => {\n if (filteringText !== undefined && filteringText !== lastFilteringText.current) {\n lastFilteringText.current = filteringText;\n }\n\n if (filteringText === undefined || lastFilteringText.current !== filteringText) {\n onLoadItems({\n menuId: menu.id,\n filteringText: lastFilteringText.current ?? '',\n firstPage,\n samePage,\n });\n }\n };\n\n const fireLoadMoreOnScroll = () => {\n if (menu.options.length > 0 && statusType === 'pending') {\n if (onLoadMoreItems) {\n onLoadMoreItems();\n } else {\n fireLoadMore(false, false);\n }\n }\n };\n\n const fireLoadMoreOnRecoveryClick = () => fireLoadMore(false, true);\n\n const fireLoadMoreOnMenuOpen = () => fireLoadMore(true, false, lastFilteringText.current ?? '');\n\n const fireLoadMoreOnInputChange = (filteringText: string) => fireLoadMore(true, false, filteringText);\n\n return { fireLoadMoreOnScroll, fireLoadMoreOnRecoveryClick, fireLoadMoreOnMenuOpen, fireLoadMoreOnInputChange };\n};\n\nexport interface MenuSelectionResult {\n tokens: PromptInputProps.InputToken[];\n caretPosition: number;\n insertedToken: PromptInputProps.ReferenceToken;\n}\n\n/** Replaces a trigger token with a reference token (or pinned token) after menu selection. */\nexport function handleMenuSelection(\n tokens: readonly PromptInputProps.InputToken[],\n selectedOption: { value: string; label?: string },\n menuId: string,\n isPinned: boolean,\n activeTrigger: PromptInputProps.TriggerToken\n): MenuSelectionResult {\n const newTokens = [...tokens];\n const triggerIndex = newTokens.findIndex(t => isTriggerToken(t) && t.id === activeTrigger.id);\n\n if (isPinned) {\n const pinnedToken: PromptInputProps.ReferenceToken = {\n type: 'reference',\n id: generateTokenId(),\n label: selectedOption.label || selectedOption.value || '',\n value: selectedOption.value || '',\n menuId,\n pinned: true,\n };\n\n newTokens.splice(triggerIndex, 1);\n\n let insertIndex = 0;\n while (insertIndex < newTokens.length && isPinnedReferenceToken(newTokens[insertIndex])) {\n insertIndex++;\n }\n\n newTokens.splice(insertIndex, 0, pinnedToken);\n const caretPos = calculateTokenPosition(newTokens, insertIndex);\n return { tokens: newTokens, caretPosition: caretPos, insertedToken: pinnedToken };\n }\n\n const referenceToken: PromptInputProps.ReferenceToken = {\n type: 'reference',\n id: generateTokenId(),\n label: selectedOption.label || selectedOption.value || '',\n value: selectedOption.value || '',\n menuId,\n };\n\n newTokens.splice(triggerIndex, 1, referenceToken);\n const insertedIndex = newTokens.findIndex(t => isReferenceToken(t) && t.id === referenceToken.id);\n const caretPos = calculateTokenPosition(newTokens, insertedIndex);\n return { tokens: newTokens, caretPosition: caretPos, insertedToken: referenceToken };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"menu-state.js","sourceRoot":"","sources":["../../../../src/prompt-input/core/menu-state.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAChG,OAAO,EAGL,oBAAoB,GACrB,MAAM,mEAAmE,CAAC;AAI3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA0CzF,SAAS,uBAAuB,CAAC,MAAiB;IAChD,OAAO,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC9C,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAiB;IAC9C,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAA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E,EAAE,eAAe,EAAE;QACrB,KAAK,EAAE,cAAc,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,IAAI,EAAE;QACzD,KAAK,EAAE,cAAc,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM;KACP,CAAC;IAEF,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,cAAc,CAAC,EAAE,CAAC,CAAC;IAClG,MAAM,QAAQ,GAAG,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAClE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AACvF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useMemo, useRef } from 'react';\n\nimport { filterOptions } from '../../autosuggest/utils/utils';\nimport { generateTestIndexes } from '../../internal/components/options-list/utils/test-indexes';\nimport {\n HighlightedOptionHandlers,\n HighlightedOptionState,\n useHighlightedOption,\n} from '../../internal/components/options-list/utils/use-highlight-option';\nimport { DropdownStatusProps } from '../../types/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../../types/option';\nimport { PromptInputProps } from '../interfaces';\nimport { calculateTokenPosition } from './caret-controller';\nimport { generateTokenId } from './dom-utils';\nimport { isPinnedReferenceToken, isReferenceToken, isTriggerToken } from './type-guards';\n\nexport type MenuItem = (OptionDefinition | OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n\n/** Props for the useMenuItems hook. */\nexport interface UseMenuItemsProps {\n menu: PromptInputProps.MenuDefinition;\n filterText: string;\n onSelectItem: (option: MenuItem) => void;\n}\n\n/** Current state of the menu items list, including highlight tracking. */\nexport interface MenuItemsState extends HighlightedOptionState<MenuItem> {\n items: readonly MenuItem[];\n showAll: boolean;\n getItemGroup: (item: MenuItem) => undefined | OptionGroup;\n}\n\n/** Handlers for navigating and selecting menu items via keyboard and mouse. */\nexport interface MenuItemsHandlers extends HighlightedOptionHandlers<MenuItem> {\n selectHighlightedOptionWithKeyboard(): boolean;\n highlightVisibleOptionWithMouse(index: number): void;\n selectVisibleOptionWithMouse(index: number): void;\n}\n\ninterface UseMenuLoadMoreProps {\n menu: PromptInputProps.MenuDefinition;\n statusType: DropdownStatusProps.StatusType;\n onLoadItems: (detail: PromptInputProps.MenuLoadItemsDetail) => void;\n onLoadMoreItems?: () => void;\n}\n\ninterface MenuLoadMoreHandlers {\n fireLoadMoreOnScroll(): void;\n fireLoadMoreOnRecoveryClick(): void;\n fireLoadMoreOnMenuOpen(): void;\n fireLoadMoreOnInputChange(filteringText: string): void;\n}\n\nfunction isMenuItemHighlightable(option?: MenuItem): boolean {\n return !!option && option.type !== 'parent';\n}\n\nfunction isMenuItemInteractive(option?: MenuItem): boolean {\n return !!option && !option.disabled && option.type !== 'parent';\n}\n\n/** Manages menu item filtering, highlighting, and selection for a trigger menu. */\nexport const useMenuItems = ({\n menu,\n filterText,\n onSelectItem,\n}: UseMenuItemsProps): [MenuItemsState, MenuItemsHandlers] => {\n const { items, getItemGroup, getItemParent } = useMemo(() => createItems(menu.options), [menu.options]);\n\n const filteredItems = useMemo(() => {\n const filteringType = menu.filteringType ?? 'auto';\n const filtered: MenuItem[] =\n filteringType === 'auto' ? (filterOptions(items, filterText) as MenuItem[]) : [...items];\n generateTestIndexes(filtered, getItemParent);\n return filtered;\n }, [menu.filteringType, items, filterText, getItemParent]);\n\n const [highlightedOptionState, highlightedOptionHandlers] = useHighlightedOption({\n options: filteredItems,\n isHighlightable: isMenuItemHighlightable,\n });\n\n const selectHighlightedOptionWithKeyboard = () => {\n const { highlightedOption } = highlightedOptionState;\n if (!highlightedOption || !isMenuItemInteractive(highlightedOption)) {\n return false;\n }\n onSelectItem(highlightedOption);\n return true;\n };\n\n const highlightVisibleOptionWithMouse = (index: number) => {\n const item = filteredItems[index];\n if (item && isMenuItemHighlightable(item)) {\n highlightedOptionHandlers.setHighlightedIndexWithMouse(index);\n }\n };\n\n const selectVisibleOptionWithMouse = (index: number) => {\n const item = filteredItems[index];\n if (item && isMenuItemInteractive(item)) {\n onSelectItem(item);\n }\n };\n\n return [\n { ...highlightedOptionState, items: filteredItems, showAll: false, getItemGroup },\n {\n ...highlightedOptionHandlers,\n selectHighlightedOptionWithKeyboard,\n highlightVisibleOptionWithMouse,\n selectVisibleOptionWithMouse,\n },\n ];\n};\n\nfunction createItems(options: readonly OptionDefinition[]) {\n const items: MenuItem[] = [];\n const itemToGroup = new WeakMap<MenuItem, MenuItem>();\n const getItemParent = (item: MenuItem) => itemToGroup.get(item);\n const getItemGroup = (item: MenuItem) => getItemParent(item)?.option as OptionGroup;\n\n for (const option of options) {\n if (isGroup(option)) {\n for (const item of flattenGroup(option)) {\n items.push(item);\n }\n } else {\n items.push({ ...option, option });\n }\n }\n\n function flattenGroup(group: OptionGroup) {\n const { options, ...rest } = group;\n\n let hasOnlyDisabledChildren = true;\n\n const groupItem: MenuItem = { ...rest, type: 'parent', option: group };\n\n const items: MenuItem[] = [groupItem];\n\n for (const option of options) {\n if (!option.disabled) {\n hasOnlyDisabledChildren = false;\n }\n\n const childOption: MenuItem = {\n ...option,\n type: 'child',\n disabled: option.disabled || rest.disabled,\n option,\n };\n\n items.push(childOption);\n\n itemToGroup.set(childOption, groupItem);\n }\n\n items[0].disabled = items[0].disabled || hasOnlyDisabledChildren;\n\n return items;\n }\n\n return { items, getItemGroup, getItemParent };\n}\n\nfunction isGroup(optionOrGroup: OptionDefinition): optionOrGroup is OptionGroup {\n const key: keyof OptionGroup = 'options';\n return key in optionOrGroup;\n}\n\n/** Manages pagination and load-more behavior for menu items. */\nexport const useMenuLoadMore = ({\n menu,\n statusType,\n onLoadItems,\n onLoadMoreItems,\n}: UseMenuLoadMoreProps): MenuLoadMoreHandlers => {\n const lastFilteringText = useRef<string | null>(null);\n\n const fireLoadMore = (firstPage: boolean, samePage: boolean, filteringText?: string) => {\n if (filteringText !== undefined && filteringText !== lastFilteringText.current) {\n lastFilteringText.current = filteringText;\n }\n\n if (filteringText === undefined || lastFilteringText.current !== filteringText) {\n onLoadItems({\n menuId: menu.id,\n filteringText: lastFilteringText.current ?? '',\n firstPage,\n samePage,\n });\n }\n };\n\n const fireLoadMoreOnScroll = () => {\n if (menu.options.length > 0 && statusType === 'pending') {\n if (onLoadMoreItems) {\n onLoadMoreItems();\n } else {\n fireLoadMore(false, false);\n }\n }\n };\n\n const fireLoadMoreOnRecoveryClick = () => fireLoadMore(false, true);\n\n const fireLoadMoreOnMenuOpen = () => fireLoadMore(true, false, lastFilteringText.current ?? '');\n\n const fireLoadMoreOnInputChange = (filteringText: string) => fireLoadMore(true, false, filteringText);\n\n return { fireLoadMoreOnScroll, fireLoadMoreOnRecoveryClick, fireLoadMoreOnMenuOpen, fireLoadMoreOnInputChange };\n};\n\nexport interface MenuSelectionResult {\n tokens: PromptInputProps.InputToken[];\n caretPosition: number;\n insertedToken: PromptInputProps.ReferenceToken;\n}\n\n/** Replaces a trigger token with a reference token (or pinned token) after menu selection. */\nexport function handleMenuSelection(\n tokens: readonly PromptInputProps.InputToken[],\n selectedOption: { value: string; label?: string },\n menuId: string,\n isPinned: boolean,\n activeTrigger: PromptInputProps.TriggerToken\n): MenuSelectionResult {\n const newTokens = [...tokens];\n const triggerIndex = newTokens.findIndex(t => isTriggerToken(t) && t.id === activeTrigger.id);\n\n if (isPinned) {\n const pinnedToken: PromptInputProps.ReferenceToken = {\n type: 'reference',\n id: generateTokenId(),\n label: selectedOption.label || selectedOption.value || '',\n value: selectedOption.value || '',\n menuId,\n pinned: true,\n };\n\n newTokens.splice(triggerIndex, 1);\n\n let insertIndex = 0;\n while (insertIndex < newTokens.length && isPinnedReferenceToken(newTokens[insertIndex])) {\n insertIndex++;\n }\n\n newTokens.splice(insertIndex, 0, pinnedToken);\n const caretPos = calculateTokenPosition(newTokens, insertIndex);\n return { tokens: newTokens, caretPosition: caretPos, insertedToken: pinnedToken };\n }\n\n const referenceToken: PromptInputProps.ReferenceToken = {\n type: 'reference',\n id: generateTokenId(),\n label: selectedOption.label || selectedOption.value || '',\n value: selectedOption.value || '',\n menuId,\n };\n\n newTokens.splice(triggerIndex, 1, referenceToken);\n const insertedIndex = newTokens.findIndex(t => isReferenceToken(t) && t.id === referenceToken.id);\n const caretPos = calculateTokenPosition(newTokens, insertedIndex);\n return { tokens: newTokens, caretPosition: caretPos, insertedToken: referenceToken };\n}\n"]}
|
|
@@ -2,15 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { BaseDropdownHostProps, OptionsFilteringType } from '../dropdown/interfaces';
|
|
3
3
|
import { IconProps } from '../icon/interfaces';
|
|
4
4
|
import { BaseInputProps, InputAutoCorrect, InputKeyEvents, InputSpellcheck } from '../input/interfaces';
|
|
5
|
-
import { BaseComponentProps } from '../
|
|
6
|
-
import { DropdownStatusProps } from '../
|
|
7
|
-
import {
|
|
8
|
-
import { FormFieldValidationControlProps } from '../
|
|
9
|
-
import { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';
|
|
5
|
+
import { BaseComponentProps } from '../types/base-component';
|
|
6
|
+
import { DropdownStatusProps } from '../types/dropdown-status';
|
|
7
|
+
import { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../types/events';
|
|
8
|
+
import { FormFieldValidationControlProps } from '../types/form-field';
|
|
10
9
|
/**
|
|
11
10
|
* @awsuiSystem core
|
|
12
11
|
*/
|
|
13
|
-
import { NativeAttributes } from '../
|
|
12
|
+
import { NativeAttributes } from '../types/native-attributes';
|
|
13
|
+
import { OptionDefinition, OptionGroup } from '../types/option';
|
|
14
14
|
export interface PromptInputProps extends Omit<BaseInputProps, 'nativeInputAttributes' | 'name' | 'value' | 'onChange'>, InputKeyEvents, InputAutoCorrect, InputSpellcheck, BaseComponentProps, FormFieldValidationControlProps {
|
|
15
15
|
/**
|
|
16
16
|
* Specifies the name of the prompt input for form submissions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAA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AM,CAAC;aACnB,CAAC;YACF,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/prompt-input/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 { BaseDropdownHostProps, OptionsFilteringType } from '../dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseInputProps, InputAutoCorrect, InputKeyEvents, InputSpellcheck } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface PromptInputProps\n extends Omit<BaseInputProps, 'nativeInputAttributes' | 'name' | 'value' | 'onChange'>,\n InputKeyEvents,\n InputAutoCorrect,\n InputSpellcheck,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Specifies the name of the prompt input for form submissions.\n */\n name?: string;\n\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for example, for security-sensitive fields).\n * To use it correctly, set the `name` property.\n *\n * You can either provide a boolean value to set the property to \"on\" or \"off\", or specify a string value\n * for the [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute.\n *\n * Note: When `tokens` is defined, autocomplete will not function.\n */\n autoComplete?: boolean | string;\n\n /**\n * Specifies the content of the prompt input.\n *\n * When `tokens` is not defined:\n * - This property is required\n * - Represents the current text content of the textarea\n *\n * When `tokens` is defined:\n * - This property is optional and defaults to empty string\n * - The actual content is managed via the `tokens` array\n */\n value?: string;\n\n /**\n * Specifies the content of the prompt input when using token mode.\n *\n * Available types and their properties:\n * - Text tokens:\n * - `value` contains the text content.\n * - Reference tokens:\n * - `id` as the unique identifier, this is auto-generated however when setting `tokens` it is required to provide an ID.\n * - `value` contains the reference value.\n * - `label` for display (e.g., 'file.txt').\n * - `menuId` for the associated menu (optional).\n * - `pinned` to render at the start of the input.\n * - Trigger tokens:\n * - `id` as the unique identifier, this is auto-generated however when setting `tokens` it is required to provide an ID.\n * - `value` contains the filter text.\n * - `triggerChar` for the trigger character.\n *\n * When `menus` is defined, you should use `tokens` to control the content instead of `value`.\n *\n * Requires React 18.\n */\n tokens?: readonly PromptInputProps.InputToken[];\n\n /**\n * Custom function to transform tokens into plain text for the `value` field in `onChange` and `onAction` events\n * and for the hidden input when `name` is specified.\n *\n * If not provided, falls back to a default simple implementation.\n *\n * Use this to customize serialization, for example:\n * - Using `label` instead of `value` for reference tokens\n * - Adding custom formatting or separators between tokens\n *\n * Requires React 18.\n */\n tokensToText?: (tokens: readonly PromptInputProps.InputToken[]) => string;\n\n /**\n * Called whenever a user changes the input value (by typing or pasting).\n * The event `detail` contains the current value as a string and an array of tokens.\n *\n * When `tokens` is defined, the `value` is derived from `tokensToText(tokens)` if provided, otherwise from a default simple implementation.\n */\n onChange?: NonCancelableEventHandler<PromptInputProps.ChangeDetail>;\n\n /**\n * Called whenever a user clicks the action button or presses the \"Enter\" key.\n * The event `detail` contains the current value as a string and an array of tokens.\n *\n * When `tokens` is defined, the `value` is derived from `tokensToText(tokens)` if provided, otherwise from a default simple implementation.\n */\n onAction?: NonCancelableEventHandler<PromptInputProps.ActionDetail>;\n\n /**\n * Determines what icon to display in the action button.\n */\n actionButtonIconName?: IconProps.Name;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `actionButtonIconSvg` will take precedence.\n */\n actionButtonIconUrl?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n actionButtonIconSvg?: React.ReactNode;\n\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n actionButtonIconAlt?: string;\n\n /**\n * Adds an aria-label to the action button.\n * @i18n\n * @deprecated Use `i18nStrings.actionButtonAriaLabel` instead.\n */\n actionButtonAriaLabel?: string;\n\n /**\n * Specifies whether to disable the action button.\n */\n disableActionButton?: boolean;\n\n /**\n * Specifies the minimum number of lines of text to set the height to.\n */\n minRows?: number;\n\n /**\n * Specifies the maximum number of lines of text the textarea will expand to.\n * Defaults to 3. Use -1 for infinite rows.\n */\n maxRows?: number;\n\n /**\n * Use this to replace the primary action.\n * If this is provided then any other `actionButton*` properties will be ignored.\n * Note that you should still provide an `onAction` function in order to handle keyboard submission.\n */\n customPrimaryAction?: React.ReactNode;\n\n /**\n * Use this slot to add secondary actions to the prompt input.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Use this slot to add secondary content, such as file attachments, to the prompt input.\n */\n secondaryContent?: React.ReactNode;\n\n /**\n * Determines whether the secondary actions area of the input has padding. If true, removes the default padding from the secondary actions area.\n */\n disableSecondaryActionsPaddings?: boolean;\n\n /**\n * Determines whether the secondary content area of the input has padding. If true, removes the default padding from the secondary content area.\n */\n disableSecondaryContentPaddings?: boolean;\n\n /**\n * Defines trigger-based menus that appear when the user types a specific character (e.g., `@` or `/`).\n * Each menu definition maps a trigger character to a list of selectable options.\n *\n * Requires React 18.\n *\n * #### MenuDefinition\n * - `id` (string) - Unique identifier for this menu. Used in event callbacks to identify the menu.\n * - `trigger` (string) - The character that activates this menu (e.g., `@`, `/`, `#`).\n * - `options` (Option[] | OptionGroup[]) - The selectable items shown in the dropdown.\n * - `useAtStart` (boolean) - (Optional) When true, the trigger is only detected at the start of the input and after any pinned tokens. Selected options become pinned reference tokens. Defaults to false.\n * - `filteringType` (`'auto'` | `'manual'`) - (Optional) How filtering is applied. `auto` filters options client-side based on typed text. `manual` disables built-in filtering — use `onMenuFilter` to provide filtered options. Defaults to `auto`.\n * - `statusType` (`'pending'` | `'loading'` | `'finished'` | `'error'`) - (Optional) The loading status of the menu options. Use with `onMenuLoadItems` for async loading.\n * - `empty` (string) - (Optional) Text shown when no options match the filter.\n * - `virtualScroll` (boolean) - (Optional) Enables virtual scrolling for large option lists.\n */\n menus?: PromptInputProps.MenuDefinition[];\n\n /**\n * Maximum height of the menu dropdown in pixels.\n * When not specified, the menu will grow to fit its content.\n *\n * Requires React 18.\n */\n maxMenuHeight?: number;\n\n /**\n * Called whenever a user selects an option in a menu.\n *\n * Requires React 18.\n */\n onMenuItemSelect?: NonCancelableEventHandler<PromptInputProps.MenuItemSelectDetail>;\n\n /**\n * Use this event to implement the asynchronous behavior for menus.\n *\n * The event is called in the following situations:\n * - The user scrolls to the end of the list of options, if `statusType` is set to `pending` (pagination).\n * - The user clicks on the recovery button in the error state.\n * - The user types after the trigger character.\n * - The menu is opened.\n *\n * The detail object contains the following properties:\n * - `menuId` - The ID of the menu that triggered the event.\n * - `filteringText` - The value to use to fetch options (undefined for pagination).\n * - `firstPage` - Indicates that you should fetch the first page of options.\n * - `samePage` - Indicates that you should fetch the same page (for example, when clicking recovery button).\n *\n * Requires React 18.\n */\n onMenuLoadItems?: NonCancelableEventHandler<PromptInputProps.MenuLoadItemsDetail>;\n\n /**\n * Called when the user types to filter options in manual filtering mode for a menu.\n * Use this to filter the options based on the filtering text.\n *\n * The detail object contains:\n * - `menuId` - The ID of the menu that triggered the event.\n * - `filteringText` - The text to use for filtering options.\n *\n * Requires React 18.\n */\n onMenuFilter?: NonCancelableEventHandler<PromptInputProps.MenuFilterDetail>;\n\n /**\n * Called when a trigger character is detected and about to be converted to a trigger token.\n * This event is cancellable - return `preventDefault()` to prevent the trigger from being created.\n *\n * The detail object contains:\n * - `menuId` - The ID of the menu associated with the trigger.\n * - `triggerChar` - The trigger character that was detected.\n * - `position` - The position in the text where the trigger was detected.\n *\n * Use this to implement custom validation logic for triggers, such as preventing\n * triggers that don't meet certain conditions (for example, limiting the amount of references in a prompt).\n *\n * Requires React 18.\n */\n onTriggerDetected?: CancelableEventHandler<PromptInputProps.TriggerDetectedDetail>;\n\n /**\n * An object containing all the localized strings required by the component.\n *\n * - `ariaLabel` (string) - Adds an aria-label to the input element.\n * - `actionButtonAriaLabel` (string) - Adds an aria-label to the action button.\n * - `menuErrorIconAriaLabel` (string) - Provides a text alternative for the error icon in the error message in menus.\n * - `menuRecoveryText` (string) - Specifies the text for the recovery button in menus. The text is displayed next to the error text.\n * - `menuLoadingText` (string) - Specifies the text to display when menus are in a loading state.\n * - `menuFinishedText` (string) - Specifies the text to display when menus have finished loading all items.\n * - `menuErrorText` (string) - Specifies the text to display when menus encounter an error while loading.\n * - `selectedMenuItemAriaLabel` (string) - Specifies the string that describes an option as being selected.\n * - `tokenInsertedAriaLabel` ((token: { label?: string; value: string }) => string) - Aria label announced when a reference token is inserted from a menu. Receives the token object with label and value properties.\n * - `tokenPinnedAriaLabel` ((token: { label?: string; value: string }) => string) - Aria label announced when a reference token is pinned (inserted at the start). Receives the token object with label and value properties.\n * - `tokenRemovedAriaLabel` ((token: { label?: string; value: string }) => string) - Aria label announced when a reference token is removed. Receives the token object with label and value properties.\n * @i18n\n */\n i18nStrings?: PromptInputProps.I18nStrings;\n\n /**\n * Attributes to add to the native `textarea` 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 * When `tokens` is defined, nativeTextareaAttributes will be ignored.\n *\n * @awsuiSystem core\n */\n nativeTextareaAttributes?: NativeAttributes<React.TextareaHTMLAttributes<HTMLTextAreaElement>>;\n\n /**\n * @awsuiSystem core\n */\n style?: PromptInputProps.Style;\n}\n\nexport namespace PromptInputProps {\n export type KeyDetail = BaseKeyDetail;\n\n export interface I18nStrings {\n actionButtonAriaLabel?: string;\n menuErrorIconAriaLabel?: string;\n menuRecoveryText?: string;\n menuLoadingText?: string;\n menuFinishedText?: string;\n menuErrorText?: string;\n /**\n * Aria label announced when a reference token is inserted from a menu.\n * Receives the token object with label and value properties.\n * @param token The inserted token\n * @returns The announcement string\n * @default `${token.label || token.value} inserted`\n */\n tokenInsertedAriaLabel?: (token: { label?: string; value: string }) => string;\n /**\n * Aria label announced when a reference token is pinned (inserted at the start).\n * Receives the token object with label and value properties.\n * @param token The pinned token\n * @returns The announcement string\n * @default `${token.label || token.value} pinned`\n */\n tokenPinnedAriaLabel?: (token: { label?: string; value: string }) => string;\n /**\n * Aria label announced when a reference token is removed.\n * Receives the token object with label and value properties.\n * @param token The removed token\n * @returns The announcement string\n * @default `${token.label || token.value} removed`\n */\n tokenRemovedAriaLabel?: (token: { label?: string; value: string }) => string;\n }\n\n export interface TextToken {\n type: 'text' | 'break';\n value: string;\n }\n\n export interface ReferenceToken {\n type: 'reference';\n id: string;\n label: string;\n value: string;\n /**\n * The ID of the menu this reference was selected from.\n * Optional — references can exist without being bound to a menu\n * (e.g., preloaded references from external sources).\n */\n menuId?: string;\n /**\n * When true, prevents user entered text from being placed before this token.\n * Typically set for reference tokens from useAtStart menus.\n */\n pinned?: boolean;\n }\n\n /**\n * Token type for menu triggers with filter text.\n * Represents a trigger character (e.g., \"@\" or \"/\") followed by filtering text.\n * This token type is automatically managed by the component when menus are active.\n *\n * - `value`: The filtering text (without the trigger character)\n * - `triggerChar`: The trigger character that opened the menu\n */\n export interface TriggerToken {\n type: 'trigger';\n value: string;\n triggerChar: string;\n id: string;\n }\n\n export type InputToken = TextToken | ReferenceToken | TriggerToken;\n\n export interface ChangeDetail {\n value: string;\n tokens?: readonly InputToken[];\n }\n\n export interface ActionDetail {\n value: string;\n tokens?: readonly InputToken[];\n }\n\n export interface MenuItemSelectDetail {\n menuId: string;\n option: OptionDefinition;\n }\n\n export interface MenuLoadItemsDetail {\n menuId: string;\n filteringText?: string;\n firstPage: boolean;\n samePage: boolean;\n }\n\n export interface MenuFilterDetail {\n menuId: string;\n filteringText: string;\n }\n\n export interface TriggerDetectedDetail {\n menuId: string;\n triggerChar: string;\n position: number;\n }\n\n export interface MenuDefinition\n extends Pick<DropdownStatusProps, 'empty' | 'statusType'>,\n Pick<BaseDropdownHostProps, 'virtualScroll'> {\n /**\n * The unique identifier for this menu.\n */\n id: string;\n\n /**\n * The unique trigger symbol for showing this menu.\n */\n trigger: string;\n\n /**\n * Set `useAtStart=true` for menus where a trigger should only be detected at the start of input.\n * Set this for menus designated to modes or actions.\n *\n * Menus with `useAtStart=true` create pinned reference tokens.\n */\n useAtStart?: boolean;\n\n /**\n * Specifies an array of options that are displayed to the user as a list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n */\n options: (OptionDefinition | OptionGroup)[];\n\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * - `auto` - The component will automatically filter options based on user input.\n * - `manual` - You will set up `onMenuFilter` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the menu. In that case make sure that you use the `onMenuFilter` event in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: Exclude<OptionsFilteringType, 'none'>;\n }\n\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n\n /**\n * Selects all text in the textarea control.\n */\n select(): void;\n\n /**\n * Selects a range of text in the textarea control.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/setSelectionRange\n * for more details on this method. Be aware that using this method in React has some\n * common pitfalls: https://stackoverflow.com/questions/60129605/is-javascripts-setselectionrange-incompatible-with-react-hooks\n */\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none'): void;\n\n /**\n * Inserts text at a specified position. Only supported when `tokens` is defined.\n * Triggers input events and menu detection.\n *\n * When pinned reference tokens are present, `caretStart` and `caretEnd` are automatically\n * shifted to account for their positions.\n *\n * @param text The text to insert.\n * @param caretStart Position to insert at. Defaults to current caret position or 0.\n * @param caretEnd Caret position after insertion. Defaults to end of inserted text.\n */\n insertText(text: string, caretStart?: number, caretEnd?: number): void;\n }\n\n export interface Style {\n root?: {\n backgroundColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n color?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n fontSize?: string;\n fontWeight?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n placeholder?: {\n color?: string;\n fontSize?: string;\n fontStyle?: string;\n fontWeight?: string;\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/prompt-input/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 { BaseDropdownHostProps, OptionsFilteringType } from '../dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseInputProps, InputAutoCorrect, InputKeyEvents, InputSpellcheck } from '../input/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { DropdownStatusProps } from '../types/dropdown-status';\nimport { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../types/events';\nimport { FormFieldValidationControlProps } from '../types/form-field';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\nimport { OptionDefinition, OptionGroup } from '../types/option';\n\nexport interface PromptInputProps\n extends Omit<BaseInputProps, 'nativeInputAttributes' | 'name' | 'value' | 'onChange'>,\n InputKeyEvents,\n InputAutoCorrect,\n InputSpellcheck,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Specifies the name of the prompt input for form submissions.\n */\n name?: string;\n\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for example, for security-sensitive fields).\n * To use it correctly, set the `name` property.\n *\n * You can either provide a boolean value to set the property to \"on\" or \"off\", or specify a string value\n * for the [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute.\n *\n * Note: When `tokens` is defined, autocomplete will not function.\n */\n autoComplete?: boolean | string;\n\n /**\n * Specifies the content of the prompt input.\n *\n * When `tokens` is not defined:\n * - This property is required\n * - Represents the current text content of the textarea\n *\n * When `tokens` is defined:\n * - This property is optional and defaults to empty string\n * - The actual content is managed via the `tokens` array\n */\n value?: string;\n\n /**\n * Specifies the content of the prompt input when using token mode.\n *\n * Available types and their properties:\n * - Text tokens:\n * - `value` contains the text content.\n * - Reference tokens:\n * - `id` as the unique identifier, this is auto-generated however when setting `tokens` it is required to provide an ID.\n * - `value` contains the reference value.\n * - `label` for display (e.g., 'file.txt').\n * - `menuId` for the associated menu (optional).\n * - `pinned` to render at the start of the input.\n * - Trigger tokens:\n * - `id` as the unique identifier, this is auto-generated however when setting `tokens` it is required to provide an ID.\n * - `value` contains the filter text.\n * - `triggerChar` for the trigger character.\n *\n * When `menus` is defined, you should use `tokens` to control the content instead of `value`.\n *\n * Requires React 18.\n */\n tokens?: readonly PromptInputProps.InputToken[];\n\n /**\n * Custom function to transform tokens into plain text for the `value` field in `onChange` and `onAction` events\n * and for the hidden input when `name` is specified.\n *\n * If not provided, falls back to a default simple implementation.\n *\n * Use this to customize serialization, for example:\n * - Using `label` instead of `value` for reference tokens\n * - Adding custom formatting or separators between tokens\n *\n * Requires React 18.\n */\n tokensToText?: (tokens: readonly PromptInputProps.InputToken[]) => string;\n\n /**\n * Called whenever a user changes the input value (by typing or pasting).\n * The event `detail` contains the current value as a string and an array of tokens.\n *\n * When `tokens` is defined, the `value` is derived from `tokensToText(tokens)` if provided, otherwise from a default simple implementation.\n */\n onChange?: NonCancelableEventHandler<PromptInputProps.ChangeDetail>;\n\n /**\n * Called whenever a user clicks the action button or presses the \"Enter\" key.\n * The event `detail` contains the current value as a string and an array of tokens.\n *\n * When `tokens` is defined, the `value` is derived from `tokensToText(tokens)` if provided, otherwise from a default simple implementation.\n */\n onAction?: NonCancelableEventHandler<PromptInputProps.ActionDetail>;\n\n /**\n * Determines what icon to display in the action button.\n */\n actionButtonIconName?: IconProps.Name;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `actionButtonIconSvg` will take precedence.\n */\n actionButtonIconUrl?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n actionButtonIconSvg?: React.ReactNode;\n\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n actionButtonIconAlt?: string;\n\n /**\n * Adds an aria-label to the action button.\n * @i18n\n * @deprecated Use `i18nStrings.actionButtonAriaLabel` instead.\n */\n actionButtonAriaLabel?: string;\n\n /**\n * Specifies whether to disable the action button.\n */\n disableActionButton?: boolean;\n\n /**\n * Specifies the minimum number of lines of text to set the height to.\n */\n minRows?: number;\n\n /**\n * Specifies the maximum number of lines of text the textarea will expand to.\n * Defaults to 3. Use -1 for infinite rows.\n */\n maxRows?: number;\n\n /**\n * Use this to replace the primary action.\n * If this is provided then any other `actionButton*` properties will be ignored.\n * Note that you should still provide an `onAction` function in order to handle keyboard submission.\n */\n customPrimaryAction?: React.ReactNode;\n\n /**\n * Use this slot to add secondary actions to the prompt input.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Use this slot to add secondary content, such as file attachments, to the prompt input.\n */\n secondaryContent?: React.ReactNode;\n\n /**\n * Determines whether the secondary actions area of the input has padding. If true, removes the default padding from the secondary actions area.\n */\n disableSecondaryActionsPaddings?: boolean;\n\n /**\n * Determines whether the secondary content area of the input has padding. If true, removes the default padding from the secondary content area.\n */\n disableSecondaryContentPaddings?: boolean;\n\n /**\n * Defines trigger-based menus that appear when the user types a specific character (e.g., `@` or `/`).\n * Each menu definition maps a trigger character to a list of selectable options.\n *\n * Requires React 18.\n *\n * #### MenuDefinition\n * - `id` (string) - Unique identifier for this menu. Used in event callbacks to identify the menu.\n * - `trigger` (string) - The character that activates this menu (e.g., `@`, `/`, `#`).\n * - `options` (Option[] | OptionGroup[]) - The selectable items shown in the dropdown.\n * - `useAtStart` (boolean) - (Optional) When true, the trigger is only detected at the start of the input and after any pinned tokens. Selected options become pinned reference tokens. Defaults to false.\n * - `filteringType` (`'auto'` | `'manual'`) - (Optional) How filtering is applied. `auto` filters options client-side based on typed text. `manual` disables built-in filtering — use `onMenuFilter` to provide filtered options. Defaults to `auto`.\n * - `statusType` (`'pending'` | `'loading'` | `'finished'` | `'error'`) - (Optional) The loading status of the menu options. Use with `onMenuLoadItems` for async loading.\n * - `empty` (string) - (Optional) Text shown when no options match the filter.\n * - `virtualScroll` (boolean) - (Optional) Enables virtual scrolling for large option lists.\n */\n menus?: PromptInputProps.MenuDefinition[];\n\n /**\n * Maximum height of the menu dropdown in pixels.\n * When not specified, the menu will grow to fit its content.\n *\n * Requires React 18.\n */\n maxMenuHeight?: number;\n\n /**\n * Called whenever a user selects an option in a menu.\n *\n * Requires React 18.\n */\n onMenuItemSelect?: NonCancelableEventHandler<PromptInputProps.MenuItemSelectDetail>;\n\n /**\n * Use this event to implement the asynchronous behavior for menus.\n *\n * The event is called in the following situations:\n * - The user scrolls to the end of the list of options, if `statusType` is set to `pending` (pagination).\n * - The user clicks on the recovery button in the error state.\n * - The user types after the trigger character.\n * - The menu is opened.\n *\n * The detail object contains the following properties:\n * - `menuId` - The ID of the menu that triggered the event.\n * - `filteringText` - The value to use to fetch options (undefined for pagination).\n * - `firstPage` - Indicates that you should fetch the first page of options.\n * - `samePage` - Indicates that you should fetch the same page (for example, when clicking recovery button).\n *\n * Requires React 18.\n */\n onMenuLoadItems?: NonCancelableEventHandler<PromptInputProps.MenuLoadItemsDetail>;\n\n /**\n * Called when the user types to filter options in manual filtering mode for a menu.\n * Use this to filter the options based on the filtering text.\n *\n * The detail object contains:\n * - `menuId` - The ID of the menu that triggered the event.\n * - `filteringText` - The text to use for filtering options.\n *\n * Requires React 18.\n */\n onMenuFilter?: NonCancelableEventHandler<PromptInputProps.MenuFilterDetail>;\n\n /**\n * Called when a trigger character is detected and about to be converted to a trigger token.\n * This event is cancellable - return `preventDefault()` to prevent the trigger from being created.\n *\n * The detail object contains:\n * - `menuId` - The ID of the menu associated with the trigger.\n * - `triggerChar` - The trigger character that was detected.\n * - `position` - The position in the text where the trigger was detected.\n *\n * Use this to implement custom validation logic for triggers, such as preventing\n * triggers that don't meet certain conditions (for example, limiting the amount of references in a prompt).\n *\n * Requires React 18.\n */\n onTriggerDetected?: CancelableEventHandler<PromptInputProps.TriggerDetectedDetail>;\n\n /**\n * An object containing all the localized strings required by the component.\n *\n * - `ariaLabel` (string) - Adds an aria-label to the input element.\n * - `actionButtonAriaLabel` (string) - Adds an aria-label to the action button.\n * - `menuErrorIconAriaLabel` (string) - Provides a text alternative for the error icon in the error message in menus.\n * - `menuRecoveryText` (string) - Specifies the text for the recovery button in menus. The text is displayed next to the error text.\n * - `menuLoadingText` (string) - Specifies the text to display when menus are in a loading state.\n * - `menuFinishedText` (string) - Specifies the text to display when menus have finished loading all items.\n * - `menuErrorText` (string) - Specifies the text to display when menus encounter an error while loading.\n * - `selectedMenuItemAriaLabel` (string) - Specifies the string that describes an option as being selected.\n * - `tokenInsertedAriaLabel` ((token: { label?: string; value: string }) => string) - Aria label announced when a reference token is inserted from a menu. Receives the token object with label and value properties.\n * - `tokenPinnedAriaLabel` ((token: { label?: string; value: string }) => string) - Aria label announced when a reference token is pinned (inserted at the start). Receives the token object with label and value properties.\n * - `tokenRemovedAriaLabel` ((token: { label?: string; value: string }) => string) - Aria label announced when a reference token is removed. Receives the token object with label and value properties.\n * @i18n\n */\n i18nStrings?: PromptInputProps.I18nStrings;\n\n /**\n * Attributes to add to the native `textarea` 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 * When `tokens` is defined, nativeTextareaAttributes will be ignored.\n *\n * @awsuiSystem core\n */\n nativeTextareaAttributes?: NativeAttributes<React.TextareaHTMLAttributes<HTMLTextAreaElement>>;\n\n /**\n * @awsuiSystem core\n */\n style?: PromptInputProps.Style;\n}\n\nexport namespace PromptInputProps {\n export type KeyDetail = BaseKeyDetail;\n\n export interface I18nStrings {\n actionButtonAriaLabel?: string;\n menuErrorIconAriaLabel?: string;\n menuRecoveryText?: string;\n menuLoadingText?: string;\n menuFinishedText?: string;\n menuErrorText?: string;\n /**\n * Aria label announced when a reference token is inserted from a menu.\n * Receives the token object with label and value properties.\n * @param token The inserted token\n * @returns The announcement string\n * @default `${token.label || token.value} inserted`\n */\n tokenInsertedAriaLabel?: (token: { label?: string; value: string }) => string;\n /**\n * Aria label announced when a reference token is pinned (inserted at the start).\n * Receives the token object with label and value properties.\n * @param token The pinned token\n * @returns The announcement string\n * @default `${token.label || token.value} pinned`\n */\n tokenPinnedAriaLabel?: (token: { label?: string; value: string }) => string;\n /**\n * Aria label announced when a reference token is removed.\n * Receives the token object with label and value properties.\n * @param token The removed token\n * @returns The announcement string\n * @default `${token.label || token.value} removed`\n */\n tokenRemovedAriaLabel?: (token: { label?: string; value: string }) => string;\n }\n\n export interface TextToken {\n type: 'text' | 'break';\n value: string;\n }\n\n export interface ReferenceToken {\n type: 'reference';\n id: string;\n label: string;\n value: string;\n /**\n * The ID of the menu this reference was selected from.\n * Optional — references can exist without being bound to a menu\n * (e.g., preloaded references from external sources).\n */\n menuId?: string;\n /**\n * When true, prevents user entered text from being placed before this token.\n * Typically set for reference tokens from useAtStart menus.\n */\n pinned?: boolean;\n }\n\n /**\n * Token type for menu triggers with filter text.\n * Represents a trigger character (e.g., \"@\" or \"/\") followed by filtering text.\n * This token type is automatically managed by the component when menus are active.\n *\n * - `value`: The filtering text (without the trigger character)\n * - `triggerChar`: The trigger character that opened the menu\n */\n export interface TriggerToken {\n type: 'trigger';\n value: string;\n triggerChar: string;\n id: string;\n }\n\n export type InputToken = TextToken | ReferenceToken | TriggerToken;\n\n export interface ChangeDetail {\n value: string;\n tokens?: readonly InputToken[];\n }\n\n export interface ActionDetail {\n value: string;\n tokens?: readonly InputToken[];\n }\n\n export interface MenuItemSelectDetail {\n menuId: string;\n option: OptionDefinition;\n }\n\n export interface MenuLoadItemsDetail {\n menuId: string;\n filteringText?: string;\n firstPage: boolean;\n samePage: boolean;\n }\n\n export interface MenuFilterDetail {\n menuId: string;\n filteringText: string;\n }\n\n export interface TriggerDetectedDetail {\n menuId: string;\n triggerChar: string;\n position: number;\n }\n\n export interface MenuDefinition\n extends Pick<DropdownStatusProps, 'empty' | 'statusType'>,\n Pick<BaseDropdownHostProps, 'virtualScroll'> {\n /**\n * The unique identifier for this menu.\n */\n id: string;\n\n /**\n * The unique trigger symbol for showing this menu.\n */\n trigger: string;\n\n /**\n * Set `useAtStart=true` for menus where a trigger should only be detected at the start of input.\n * Set this for menus designated to modes or actions.\n *\n * Menus with `useAtStart=true` create pinned reference tokens.\n */\n useAtStart?: boolean;\n\n /**\n * Specifies an array of options that are displayed to the user as a list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n */\n options: (OptionDefinition | OptionGroup)[];\n\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * - `auto` - The component will automatically filter options based on user input.\n * - `manual` - You will set up `onMenuFilter` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the menu. In that case make sure that you use the `onMenuFilter` event in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: Exclude<OptionsFilteringType, 'none'>;\n }\n\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n\n /**\n * Selects all text in the textarea control.\n */\n select(): void;\n\n /**\n * Selects a range of text in the textarea control.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/setSelectionRange\n * for more details on this method. Be aware that using this method in React has some\n * common pitfalls: https://stackoverflow.com/questions/60129605/is-javascripts-setselectionrange-incompatible-with-react-hooks\n */\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none'): void;\n\n /**\n * Inserts text at a specified position. Only supported when `tokens` is defined.\n * Triggers input events and menu detection.\n *\n * When pinned reference tokens are present, `caretStart` and `caretEnd` are automatically\n * shifted to account for their positions.\n *\n * @param text The text to insert.\n * @param caretStart Position to insert at. Defaults to current caret position or 0.\n * @param caretEnd Caret position after insertion. Defaults to end of inserted text.\n */\n insertText(text: string, caretStart?: number, caretEnd?: number): void;\n }\n\n export interface Style {\n root?: {\n backgroundColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n color?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n fontSize?: string;\n fontWeight?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n placeholder?: {\n color?: string;\n fontSize?: string;\n fontStyle?: string;\n fontWeight?: string;\n };\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NonCancelableEventHandler } from '../
|
|
1
|
+
import { NonCancelableEventHandler } from '../types/events';
|
|
2
2
|
import { I18nStringsOperators } from './i18n-utils';
|
|
3
3
|
import { ComparisonOperator, GroupText, I18nStrings, InternalFilteringOption, InternalFilteringProperty, InternalFreeTextFiltering, InternalQuery, InternalToken, InternalTokenGroup, JoinOperation, ParsedText, Query } from './interfaces';
|
|
4
4
|
type I18nStringsController = I18nStringsOperators & Pick<I18nStrings, 'operatorsText' | 'groupPropertiesText' | 'groupValuesText'>;
|
|
@@ -51,7 +51,7 @@ export declare const getAutosuggestOptions: (parsedText: ParsedText, filteringPr
|
|
|
51
51
|
})[];
|
|
52
52
|
} | {
|
|
53
53
|
filterText: string;
|
|
54
|
-
options: (OptionGroup<import("../
|
|
54
|
+
options: (OptionGroup<import("../types/option").OptionDefinition> | OptionGroup<{
|
|
55
55
|
value: string;
|
|
56
56
|
label: string;
|
|
57
57
|
keepOpenOnSelect: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/property-filter/controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/property-filter/controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAyB,MAAM,cAAc,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,KAAK,EAGN,MAAM,cAAc,CAAC;AAYtB,KAAK,qBAAqB,GAAG,oBAAoB,GAC/C,IAAI,CAAC,WAAW,EAAE,eAAe,GAAG,qBAAqB,GAAG,iBAAiB,CAAC,CAAC;AAEjF,eAAO,MAAM,eAAe,GAAI,2DAK7B;IACD,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,yBAAyB,CAAC,KAAK,CAAC,CAAC;IAC3C,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,iBAAiB,EAAE,OAAO,CAAC;CAC5B;sBAiB0B,aAAa;+BAKvB,MAAM,gBACL,aAAa,GAAG,kBAAkB,kBAChC,aAAa,EAAE;iCAmBG,aAAa;+BARf,MAAM;;CAazC,CAAC;AAIF,eAAO,MAAM,mBAAmB,GAAI,UAAU,yBAAyB,KAAG,kBAAkB,EAI3F,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,UAAU,yBAAyB,KAAG,kBAAkB,EAGnG,CAAC;AAQF,eAAO,MAAM,SAAS,GACpB,eAAe,MAAM,EACrB,qBAAqB,SAAS,yBAAyB,EAAE,EACzD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