Skip to content
Open
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
125 changes: 125 additions & 0 deletions packages/unity-bootstrap-theme/src/scss/extends/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,131 @@
}
}

// Button sizes
.btn-small {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
}
.btn-medium {
font-size: 0.875rem;
padding: 0.5rem 1rem;
}
.btn-large {
font-size: 1rem;
padding: 0.75rem 1.5rem;
}

// Button color variants map
$button-colors: (
'gray': ($asu-gray-4, $asu-gray-1),
'gold': ($gold, $dark),
'dark': ($dark, $white),
'maroon': ($maroon, $white)
);

// Mixin for borderless button variants
@mixin button-borderless-variant($color, $hover-color) {
color: $color;
background: transparent;
border: 2px solid transparent;

&:hover,
&:active,
&.active {
background-color: $color;
color: $hover-color;
}

&:focus,
&:focus-visible {
color: $color;
background: transparent;

&:hover {
background-color: $color;
color: $hover-color;
}

&:active {
background-color: $color;
color: $hover-color;
}
}

&:disabled,
&.disabled {
color: $asu-gray-4;
background: transparent;
opacity: 0.5;

&:hover,
&:focus,
&:active,
&.active {
background: transparent;
color: $asu-gray-4;
}
}
}

// Generate borderless button variants
@each $name, $colors in $button-colors {
.btn-borderless-#{$name} {
@include button-borderless-variant(nth($colors, 1), nth($colors, 2));
}
}

// Generate outlined button variants using Bootstrap's outline mixin
@each $name, $colors in $button-colors {
.btn-outline-#{$name} {
@include button-outline-variant(nth($colors, 1), nth($colors, 2));
border-width: 2px;

&:active,
&.active {
background-color: nth($colors, 1);
border-color: nth($colors, 1);
color: nth($colors, 2);
}

&:focus,
&:focus-visible {
color: nth($colors, 1);
background: transparent;
border-color: transparent;

&:hover {
background-color: nth($colors, 1);
border-color: nth($colors, 1);
color: nth($colors, 2);
}

&:active {
background-color: nth($colors, 1);
border-color: nth($colors, 1);
color: nth($colors, 2);
}
}
}
}

// Generate filled button variants using Bootstrap's button mixin
@each $name, $colors in $button-colors {
.btn-filled-#{$name} {
@include button-variant(nth($colors, 1), nth($colors, 1));
border-width: 2px;

&:focus,
&:focus-visible {
color: nth($colors, 2);

&:active {
color: nth($colors, 2);
}
}
}
}



a {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@ import React from "react";
export default {
title: "Atoms/Buttons/Examples",
parameters: { controls: { disable: true } },
decorators: [
(Story, { parameters }) => {
if (parameters?.disableDeprecatedNotice) {
return <Story />;
}
return (
<div>
<div
style={{
padding: "1rem",
background: "#f5f5f5",
marginBottom: "2rem",
}}
>
<h2>Deprecated</h2>
<p>
Please see new button styles in unity-react-core{" "}
<a href="https://asu.github.io/asu-unity-stack/@asu/unity-react-core/index.html?path=/docs/components-udsbutton--docs">
UDSButton
</a>{" "}
storybook instead.
</p>
</div>
<Story />
</div>
);
},
],
};

export const ButtonColorsComponent = () => (
Expand Down Expand Up @@ -210,6 +238,10 @@ export const ButtonTagsComponent = () => (
</div>
);

ButtonTagsComponent.parameters = {
disableDeprecatedNotice: true,
};

export const IconOnlyButtonsColorAndSizesComponent = () => (
<div className="container-fluid">
<div className="row">
Expand Down Expand Up @@ -257,6 +289,11 @@ export const IconOnlyButtonsColorAndSizesComponent = () => (
</div>
</div>
);

IconOnlyButtonsColorAndSizesComponent.parameters = {
disableDeprecatedNotice: true,
};

export const IconOnlyButtonsColorCombinationsComponent = () => (
<div className="container-fluid">
<div className="row">
Expand Down Expand Up @@ -343,6 +380,9 @@ export const IconOnlyButtonsColorCombinationsComponent = () => (
</div>
</div>
);
IconOnlyButtonsColorCombinationsComponent.parameters = {
disableDeprecatedNotice: true,
};

export const PrevAndNextButtonsComponent = () => (
<div className="container-fluid">
Expand Down Expand Up @@ -398,59 +438,6 @@ export const PrevAndNextButtonsComponent = () => (
</div>
</div>
);

const demoButtonStyle = {
display: "flex",
justifyContent: "center",
paddingTop: "10px",
PrevAndNextButtonsComponent.parameters = {
disableDeprecatedNotice: true,
};

const TestButtons = () => (
<div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-gold">
Gold
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-maroon">
Maroon
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-link">
Link
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-light">
Light
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-dark">
Dark
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-success">
Alert: Success
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-danger">
Alert: Danger
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-warning">
Alert: Warning
</button>
</div>
<div style={demoButtonStyle}>
<button type="button" className="btn btn-info">
Alert: Info
</button>
</div>
</div>
);
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,35 @@ import { defaultDecorator } from "@asu/shared";

export default {
title: "Atoms/Buttons/Templates",
decorators: [defaultDecorator],
decorators: [
defaultDecorator,
(Story, { parameters }) => {
if (parameters?.disableDeprecatedNotice) {
return <Story />;
}
return (
<div>
<div
style={{
padding: "1rem",
background: "#f5f5f5",
marginBottom: "2rem",
}}
>
<h2>Deprecated</h2>
<p>
Please see new button styles in unity-react-core{" "}
<a href="https://asu.github.io/asu-unity-stack/@asu/unity-react-core/index.html?path=/docs/components-udsbutton--docs">
UDSButton
</a>{" "}
storybook instead.
</p>
</div>
<Story />
</div>
);
},
],
args: {
color: "btn-gold",
size: "Large",
Expand Down Expand Up @@ -113,4 +141,7 @@ ButtonTag.argTypes = {
size: { table: { disable: true } },
disabled: { table: { disable: true } },
};
ButtonTag.parameters = { controls: { disable: true } };
ButtonTag.parameters = {
controls: { disable: true },
disableDeprecatedNotice: true,
};

This file was deleted.

Loading