From b70352578a2411b3e8b5eb6dd8f357c7a5236607 Mon Sep 17 00:00:00 2001 From: Boris Serdiuk Date: Tue, 12 Mar 2024 23:35:56 +0100 Subject: [PATCH] chore: Add props reporting for S-W components --- src/select/index.tsx | 10 +++++++++- src/space-between/index.tsx | 4 +++- src/spinner/index.tsx | 4 +++- src/split-panel/index.tsx | 4 +++- src/status-indicator/index.tsx | 4 +++- src/tabs/index.tsx | 4 +++- src/tag-editor/index.tsx | 4 +++- src/textarea/index.tsx | 4 +++- src/tiles/index.tsx | 4 +++- src/time-input/index.tsx | 10 +++++++++- src/token-group/index.tsx | 4 +++- src/wizard/index.tsx | 4 +++- 12 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/select/index.tsx b/src/select/index.tsx index ce87bf7240..77282d9325 100644 --- a/src/select/index.tsx +++ b/src/select/index.tsx @@ -20,7 +20,15 @@ const Select = React.forwardRef( }: SelectProps, ref: React.Ref ) => { - const baseComponentProps = useBaseComponent('Select'); + const baseComponentProps = useBaseComponent('Select', { + props: { + autoFocus: restProps.autoFocus, + expandToViewport: restProps.expandToViewport, + filteringType, + triggerVariant, + virtualScroll: restProps.virtualScroll, + }, + }); const externalProps = getExternalProps(restProps); return ( ; } diff --git a/src/spinner/index.tsx b/src/spinner/index.tsx index 718b708379..7c4ed082f1 100644 --- a/src/spinner/index.tsx +++ b/src/spinner/index.tsx @@ -9,7 +9,9 @@ import useBaseComponent from '../internal/hooks/use-base-component'; export { SpinnerProps }; export default function Spinner({ size = 'normal', variant = 'normal', ...props }: SpinnerProps) { - const baseComponentProps = useBaseComponent('Spinner'); + const baseComponentProps = useBaseComponent('Spinner', { + props: { size, variant }, + }); return ; } diff --git a/src/split-panel/index.tsx b/src/split-panel/index.tsx index 40fc59b8e1..0d8c304769 100644 --- a/src/split-panel/index.tsx +++ b/src/split-panel/index.tsx @@ -37,7 +37,9 @@ export default function SplitPanel({ ...restProps }: SplitPanelProps) { const isRefresh = useVisualRefresh(); - const { __internalRootRef } = useBaseComponent('SplitPanel'); + const { __internalRootRef } = useBaseComponent('SplitPanel', { + props: { closeBehavior, hidePreferencesButton }, + }); const { position, topOffset, diff --git a/src/status-indicator/index.tsx b/src/status-indicator/index.tsx index 360ca5dcc2..1ea3dfb945 100644 --- a/src/status-indicator/index.tsx +++ b/src/status-indicator/index.tsx @@ -8,7 +8,9 @@ import useBaseComponent from '../internal/hooks/use-base-component'; export { StatusIndicatorProps }; export default function StatusIndicator({ type = 'success', wrapText = true, ...props }: StatusIndicatorProps) { - const baseComponentProps = useBaseComponent('StatusIndicator'); + const baseComponentProps = useBaseComponent('StatusIndicator', { + props: { colorOverride: props.colorOverride, type, wrapText }, + }); return ; } diff --git a/src/tabs/index.tsx b/src/tabs/index.tsx index cd5387bb1b..59bb455267 100644 --- a/src/tabs/index.tsx +++ b/src/tabs/index.tsx @@ -39,7 +39,9 @@ export default function Tabs({ for (const tab of tabs) { checkSafeUrl('Tabs', tab.href); } - const { __internalRootRef } = useBaseComponent('Tabs'); + const { __internalRootRef } = useBaseComponent('Tabs', { + props: { disableContentPaddings, variant }, + }); const idNamespace = useUniqueId('awsui-tabs-'); const [activeTabId, setActiveTabId] = useControllable(controlledTabId, onChange, firstEnabledTab(tabs)?.id ?? '', { diff --git a/src/tag-editor/index.tsx b/src/tag-editor/index.tsx index a190e69844..d7f5dd4d3a 100644 --- a/src/tag-editor/index.tsx +++ b/src/tag-editor/index.tsx @@ -50,7 +50,9 @@ const TagEditor = React.forwardRef( }: TagEditorProps, ref: React.Ref ) => { - const baseComponentProps = useBaseComponent('TagEditor'); + const baseComponentProps = useBaseComponent('TagEditor', { + props: { tagLimit, allowedCharacterPattern }, + }); const i18n = useInternalI18n('tag-editor'); const remainingTags = tagLimit - tags.filter(tag => !tag.markedForRemoval).length; diff --git a/src/textarea/index.tsx b/src/textarea/index.tsx index 9e80706964..4a2ef99a63 100644 --- a/src/textarea/index.tsx +++ b/src/textarea/index.tsx @@ -39,7 +39,9 @@ const Textarea = React.forwardRef( }: TextareaProps, ref: Ref ) => { - const { __internalRootRef } = useBaseComponent('Textarea'); + const { __internalRootRef } = useBaseComponent('Textarea', { + props: { autoComplete, autoFocus, disableBrowserAutocorrect, disableBrowserSpellcheck, readOnly, spellcheck }, + }); const { ariaLabelledby, ariaDescribedby, controlId, invalid } = useFormFieldContext(rest); const baseProps = getBaseProps(rest); diff --git a/src/tiles/index.tsx b/src/tiles/index.tsx index 4628f1c2ce..0c6d162acd 100644 --- a/src/tiles/index.tsx +++ b/src/tiles/index.tsx @@ -9,7 +9,9 @@ import InternalTiles from './internal'; export { TilesProps }; const Tiles = React.forwardRef((props: TilesProps, ref: React.Ref) => { - const baseComponentProps = useBaseComponent('Tiles'); + const baseComponentProps = useBaseComponent('Tiles', { + props: { columns: props.columns }, + }); return ; }); diff --git a/src/time-input/index.tsx b/src/time-input/index.tsx index d278453c20..cc6eff60ea 100644 --- a/src/time-input/index.tsx +++ b/src/time-input/index.tsx @@ -14,7 +14,15 @@ const TimeInput = React.forwardRef( { format = 'hh:mm:ss', use24Hour = true, autoComplete = true, ...props }: TimeInputProps, ref: Ref ) => { - const baseComponentProps = useBaseComponent('TimeInput'); + const baseComponentProps = useBaseComponent('TimeInput', { + props: { + autoFocus: props.autoFocus, + disableBrowserAutocorrect: props.disableBrowserAutocorrect, + format, + readOnly: props.readOnly, + use24Hour, + }, + }); return ( ; } diff --git a/src/wizard/index.tsx b/src/wizard/index.tsx index b54e4bcd5f..69136105df 100644 --- a/src/wizard/index.tsx +++ b/src/wizard/index.tsx @@ -13,7 +13,9 @@ import { WizardProps } from './interfaces'; import { useFunnel } from '../internal/analytics/hooks/use-funnel'; function Wizard({ isLoadingNextStep = false, allowSkipTo = false, ...props }: WizardProps) { - const baseComponentProps = useBaseComponent('Wizard'); + const baseComponentProps = useBaseComponent('Wizard', { + props: { allowSkipTo }, + }); const { wizardCount } = useFunnel(); const externalProps = getExternalProps(props);