Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export { AlertProps };

const Alert = React.forwardRef(
({ type = 'info', visible = true, ...props }: AlertProps, ref: React.Ref<AlertProps.Ref>) => {
const baseComponentProps = useBaseComponent<HTMLDivElement>('Alert');
const baseComponentProps = useBaseComponent<HTMLDivElement>('Alert', {
props: { type, visible, dismissible: props.dismissible },
});

const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();
const { stepNumber, stepNameSelector } = useFunnelStep();
Expand Down
11 changes: 10 additions & 1 deletion src/area-chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ function AreaChart<T extends AreaChartProps.DataTypes>({
i18nStrings = {},
...props
}: AreaChartProps<T>) {
const baseComponentProps = useBaseComponent('AreaChart');
const baseComponentProps = useBaseComponent('AreaChart', {
props: {
detailPopoverSize,
hideLegend: props.hideLegend,
hideFilter: props.hideFilter,
fitHeight: props.fitHeight,
xScaleType,
yScaleType,
},
});
return (
<InternalAreaChart
height={height}
Expand Down
11 changes: 10 additions & 1 deletion src/autosuggest/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ const Autosuggest = React.forwardRef(
{ filteringType = 'auto', statusType = 'finished', disableBrowserAutocorrect = false, ...props }: AutosuggestProps,
ref: React.Ref<AutosuggestProps.Ref>
) => {
const baseComponentProps = useBaseComponent('Autosuggest');
const baseComponentProps = useBaseComponent('Autosuggest', {
props: {
autoFocus: props.autoFocus,
disableBrowserAutocorrect,
expandToViewport: props.expandToViewport,
filteringType,
readOnly: props.readOnly,
virtualScroll: props.virtualScroll,
},
});
const externalProps = getExternalProps(props);
return (
<InternalAutosuggest
Expand Down
2 changes: 1 addition & 1 deletion src/badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BadgeProps } from './interfaces';
export { BadgeProps };

export default function Badge({ color = 'grey', children, ...rest }: BadgeProps) {
const { __internalRootRef } = useBaseComponent('Badge');
const { __internalRootRef } = useBaseComponent('Badge', { props: { color } });
const baseProps = getBaseProps(rest);

const className = clsx(baseProps.className, styles.badge, styles[`badge-color-${color}`]);
Expand Down
14 changes: 13 additions & 1 deletion src/bar-chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ function BarChart<T extends number | string | Date>({
detailPopoverSeriesContent,
...props
}: BarChartProps<T>) {
const baseComponentProps = useBaseComponent('BarChart');
const baseComponentProps = useBaseComponent('BarChart', {
props: {
detailPopoverSize,
emphasizeBaselineAxis,
fitHeight: props.fitHeight,
hideFilter: props.hideFilter,
hideLegend: props.hideLegend,
horizontalBars,
stackedBars,
xScaleType,
yScaleType,
},
});
const baseProps = getBaseProps(props);
const className = clsx(baseProps.className, styles.root);

Expand Down
12 changes: 11 additions & 1 deletion src/box/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ import useBaseComponent from '../internal/hooks/use-base-component';
export { BoxProps };

export default function Box({ variant = 'div', margin = {}, padding = {}, ...props }: BoxProps) {
const baseComponentProps = useBaseComponent('Box');
const baseComponentProps = useBaseComponent('Box', {
props: {
color: props.color,
display: props.display,
float: props.float,
fontSize: props.fontSize,
fontWeight: props.fontWeight,
textAlign: props.textAlign,
variant,
},
});
return <InternalBox variant={variant} margin={margin} padding={padding} {...props} {...baseComponentProps} />;
}
applyDisplayName(Box, 'Box');
4 changes: 3 additions & 1 deletion src/button-dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const ButtonDropdown = React.forwardRef(
}: ButtonDropdownProps,
ref: React.Ref<ButtonDropdownProps.Ref>
) => {
const baseComponentProps = useBaseComponent('ButtonDropdown');
const baseComponentProps = useBaseComponent('ButtonDropdown', {
props: { expandToViewport, expandableGroups, variant },
});
const baseProps = getBaseProps(props);
return (
<InternalButtonDropdown
Expand Down
4 changes: 3 additions & 1 deletion src/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const Button = React.forwardRef(
}: ButtonProps,
ref: React.Ref<ButtonProps.Ref>
) => {
const baseComponentProps = useBaseComponent('Button');
const baseComponentProps = useBaseComponent('Button', {
props: { formAction, fullWidth, iconAlign, iconName, rel, target, variant, wrapText },
});
const baseProps = getBaseProps(props);
return (
<InternalButton
Expand Down
4 changes: 3 additions & 1 deletion src/cards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ const Cards = React.forwardRef(function <T = any>(
}: CardsProps<T>,
ref: React.Ref<CardsProps.Ref>
) {
const { __internalRootRef } = useBaseComponent('Cards');
const { __internalRootRef } = useBaseComponent('Cards', {
props: { entireCardClickable, selectionType, stickyHeader, variant },
});
const baseProps = getBaseProps(rest);
const isRefresh = useVisualRefresh();
const isMobile = useMobile();
Expand Down
4 changes: 2 additions & 2 deletions src/code-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ import {
export { CodeEditorProps };

const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref<CodeEditorProps.Ref>) => {
const { __internalRootRef } = useBaseComponent('CodeEditor');
const { controlId, ariaLabelledby, ariaDescribedby } = useFormFieldContext(props);
const {
ace,
value,
Expand All @@ -61,6 +59,8 @@ const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref<CodeEditor
themes,
...rest
} = props;
const { __internalRootRef } = useBaseComponent('CodeEditor', { props: { language } });
const { controlId, ariaLabelledby, ariaDescribedby } = useFormFieldContext(props);
const [editorHeight = 480, setEditorHeight] = useControllable(editorContentHeight, onEditorContentResize, 480, {
componentName: 'code-editor',
changeHandler: 'onEditorContentResize',
Expand Down
4 changes: 3 additions & 1 deletion src/column-layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default function ColumnLayout({
disableGutters = false,
...props
}: ColumnLayoutProps) {
const baseComponentProps = useBaseComponent('ColumnLayout');
const baseComponentProps = useBaseComponent('ColumnLayout', {
props: { borders, columns, disableGutters, minColumnWidth: props.minColumnWidth, variant },
});
const externalProps = getExternalProps(props);
return (
<InternalColumnLayout
Expand Down
4 changes: 3 additions & 1 deletion src/content-layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import useBaseComponent from '../internal/hooks/use-base-component';
export { ContentLayoutProps };

export default function ContentLayout(props: ContentLayoutProps) {
const baseComponentProps = useBaseComponent('ContentLayout');
const baseComponentProps = useBaseComponent('ContentLayout', {
props: { disableOverlap: props.disableOverlap },
});
return <InternalContentLayout {...props} {...baseComponentProps} />;
}

Expand Down
4 changes: 3 additions & 1 deletion src/copy-to-clipboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default function CopyToClipboard({
textToCopy,
...restProps
}: CopyToClipboardProps) {
const { __internalRootRef } = useBaseComponent('CopyToClipboard');
const { __internalRootRef } = useBaseComponent('CopyToClipboard', {
props: { variant },
});
const baseProps = getBaseProps(restProps);

const copyButtonProps =
Expand Down