Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-JIRA: Added submit to loading button props #3574

Merged
merged 5 commits into from
Aug 6, 2024
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
8 changes: 8 additions & 0 deletions examples/bpk-component-button/examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ const FullWidthExample = (props: any) => (
</BpkButtonV2>
);

const SubmitButtonExample = (props: any) => (
<BpkButtonV2 submit {...props}>
Submit Button
</BpkButtonV2>
);

const MixedExample = () => (
<>
<PrimaryExample />
Expand All @@ -188,6 +194,7 @@ const MixedExample = () => (
<LinkOnDarkExample />
<FeaturedExample />
<FullWidthExample />
<SubmitButtonExample />
</>
);

Expand Down Expand Up @@ -218,4 +225,5 @@ export {
MixedExample,
AnchorTagsExample,
FullWidthExample,
SubmitButtonExample,
};
3 changes: 2 additions & 1 deletion examples/bpk-component-button/stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
MixedExample,
AnchorTagsExample,
FullWidthExample,
SubmitButtonExample,
} from './examples';
import { MixedExample as MixedExampleV1 } from './examplesv1';

Expand Down Expand Up @@ -75,5 +76,5 @@ export const VisualTestV1WithZoom = {
zoomEnabled: true,
},
};

export const SubmitButton = () => <SubmitButtonExample />;
export const FullWidth = () => <FullWidthExample />;
4 changes: 4 additions & 0 deletions examples/bpk-component-loading-button/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ const VisualExample = () => (
</div>
</div>
);
const SubmitExample = () => (
<LoadingButtonStory submit wrapped={BpkLoadingButton} />
);

export {
DocsPrimaryExample,
Expand All @@ -411,4 +414,5 @@ export {
AnchorTagsExample,
CustomIconExample,
VisualExample,
SubmitExample,
};
2 changes: 2 additions & 0 deletions examples/bpk-component-loading-button/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
AnchorTagsExample,
CustomIconExample,
VisualExample,
SubmitExample,
} from './examples';

export default {
Expand Down Expand Up @@ -61,6 +62,7 @@ export const Mixture = MixtureExample;
export const AnchorTags = AnchorTagsExample;

export const CustomIcon = CustomIconExample;
export const Submit = SubmitExample;
export const VisualTest = VisualExample;
export const VisualTestWithZoom = VisualTest.bind({});
VisualTestWithZoom.args = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import ArrowIconSm from '../../bpk-component-icon/sm/long-arrow-right';
import { BpkSpinner, BpkLargeSpinner } from '../../bpk-component-spinner';
import { cssModules } from '../../bpk-react-utils';

import type { Props as ButtonProps } from '../../bpk-component-button/src/BpkButtonV2/common-types';

import STYLES from './BpkLoadingButton.module.scss';

const getClassName = cssModules(STYLES);
Expand Down Expand Up @@ -83,7 +85,7 @@ type LoadingProps = {
iconPosition: string,
iconDisabled?: ReactElement<any>,
iconLoading?: ReactElement<any>,
};
} & ButtonProps;

const BpkLoadingButton = (props: LoadingProps) => {
const {
Expand Down
Loading