Files
web/packages/design-system/lib/components/Button/button.module.css
Matilda Haneling 6a008ba342 Merged in fix/book-149-incorrect-onfocus-behaviour-booking-widget (pull request #3320)
Fix/book 149 incorrect onfocus behaviour booking widget

* fix(BOOK-149): fixed labels shifting

* fix(BOOK-149): reintroduced sticky position

* fix(BOOK-149): added missing border to "where" text field

* added overflow to datepicker

* comment fixes

* removed separate typography declaration

* changed to onPress

* fix(BOOK-149): moved components to separate files

* fix(BOOK-149): removed desktop & mobile specific css classes

* fix(BOOK-149): new implementation of date and room modals

* dependencies update

* fix(BOOK-149): fixed child age dropdown issue, related error message, and Rooms & Guests container height

* updated info button to new variant

* fix(BOOK-149): prevent scrolling of background when modals are open in Tablet mode

* fixed overlay issue and added focus indicator on mobile

* fixed missing space in css

* rebase and fixed icon buttons after update

* simplified to use explicit boolean

* PR comments fixes

* more PR comment fixes

* PR comment fixes

* fixed setIsOpen((prev) => !prev)

* fixed issues with room error not showing properly on mobile

* fixing pr comments

* fixed flickering on GuestRoomModal


Approved-by: Erik Tiekstra
2026-01-12 14:18:51 +00:00

282 lines
7.2 KiB
CSS

.button {
position: relative;
border-radius: var(--Corner-radius-rounded);
border-width: 2px;
border-style: solid;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--Space-x05);
&.full-width {
width: 100%;
}
&[data-disabled] {
cursor: not-allowed;
}
&[data-pending] {
cursor: progress;
gap: var(--Space-x1);
}
&:focus-visible {
outline: 2px solid var(--Border-Interactive-Focus);
outline-offset: 2px;
&::before {
content: "";
position: absolute;
inset: -4px;
border: 2px solid var(--Border-Inverted);
border-radius: inherit;
pointer-events: none;
}
}
}
.size-lg {
padding: calc(var(--Space-x2) - 2px) var(--Space-x3); /* Adjust for 2px border */
}
.size-md {
padding: calc(var(--Space-x15) - 2px) var(--Space-x2); /* Adjust for 2px border */
}
.size-sm {
padding: var(--Space-x1) var(--Space-x2); /* Adjust for 2px border */
}
.variant-primary {
background-color: var(--Component-Button-Brand-Primary-Fill-Default);
border-color: var(--Component-Button-Brand-Primary-Border-Default);
color: var(--Component-Button-Brand-Primary-On-fill-Default);
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
background:
linear-gradient(
0deg,
var(--Component-Button-Brand-Primary-Fill-Hover) 0%,
var(--Component-Button-Brand-Primary-Fill-Hover) 100%
),
var(--Component-Button-Brand-Primary-Fill-Default);
}
}
}
&[data-disabled] {
background-color: var(--Component-Button-Brand-Primary-Fill-Disabled);
border-color: var(--Component-Button-Brand-Primary-Border-Disabled);
color: var(--Component-Button-Brand-Primary-On-fill-Disabled);
}
}
.variant-primary.color-inverted {
background-color: var(--Component-Button-Inverted-Fill-Default);
border-color: var(--Component-Button-Inverted-Border-Default);
color: var(--Component-Button-Inverted-On-fill-Default);
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
background:
linear-gradient(
0deg,
var(--Component-Button-Inverted-Fill-Hover) 0%,
var(--Component-Button-Inverted-Fill-Hover) 100%
),
var(--Component-Button-Inverted-Fill-Default);
}
}
}
&[data-disabled] {
background-color: var(--Component-Button-Inverted-Fill-Disabled);
border-color: var(--Component-Button-Inverted-Border-Disabled);
color: var(--Component-Button-Inverted-On-fill-Disabled);
}
&:focus-visible {
outline-color: var(--Border-Inverted);
&::before {
border-color: var(--Border-Interactive-Focus);
}
}
}
.variant-secondary {
background-color: var(--Component-Button-Brand-Secondary-Fill-Default);
border-color: var(--Component-Button-Brand-Secondary-Border-Default);
color: var(--Component-Button-Brand-Secondary-On-fill-Default);
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
background-color: var(--Component-Button-Brand-Secondary-Fill-Hover);
border-color: var(--Component-Button-Brand-Secondary-Border-Hover);
color: var(--Component-Button-Brand-Secondary-On-fill-Hover);
}
}
}
&[data-disabled] {
border-color: var(--Component-Button-Brand-Secondary-Border-Disabled);
color: var(--Component-Button-Brand-Secondary-On-fill-Disabled);
}
}
.variant-secondary.color-inverted {
background-color: var(--Component-Button-Brand-Secondary-Fill-Default);
border-color: var(--Component-Button-Brand-Secondary-Border-Inverted);
color: var(--Component-Button-Brand-Secondary-On-fill-Inverted);
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
background-color: var(--Component-Button-Brand-Secondary-Fill-Hover);
border-color: var(
--Component-Button-Brand-Secondary-Border-Hover-inverted
);
color: var(--Component-Button-Brand-Secondary-On-fill-Hover-inverted);
}
}
}
&[data-disabled] {
background-color: var(--Component-Button-Brand-Secondary-Fill-Disabled);
border-color: var(--Component-Button-Brand-Secondary-Border-Disabled);
color: var(--Component-Button-Brand-Secondary-On-fill-Disabled);
}
&:focus-visible {
outline-color: var(--Border-Inverted);
&::before {
border-color: var(--Border-Interactive-Focus);
}
}
}
.variant-tertiary {
background-color: var(--Component-Button-Brand-Tertiary-Fill-Default);
border-color: var(--Component-Button-Brand-Tertiary-Border-Default);
color: var(--Component-Button-Brand-Tertiary-On-fill-Default);
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
background:
linear-gradient(
0deg,
rgba(255, 255, 255, 0.1) 0%,
rgba(255, 255, 255, 0.1) 100%
),
var(--Component-Button-Brand-Tertiary-Fill-Default);
border-color: var(--Component-Button-Brand-Tertiary-Border-Hover);
color: var(--Component-Button-Brand-Tertiary-On-fill-Hover);
}
}
}
&[data-disabled] {
background-color: var(--Component-Button-Brand-Tertiary-Fill-Disabled);
border-color: var(--Component-Button-Brand-Tertiary-Border-Disabled);
color: var(--Component-Button-Brand-Tertiary-On-fill-Disabled);
}
}
.variant-inverted {
background-color: var(--Component-Button-Inverted-Default);
border-color: transparent;
color: var(--Component-Button-Inverted-On-fill-Default);
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
background-color: var(--Component-Button-Inverted-Hover);
border-color: transparent;
color: var(--Component-Button-Inverted-On-fill-Hover);
}
}
}
&[data-disabled] {
background-color: var(--Component-Button-Inverted-Disabled);
border-color: transparent;
color: var(--Component-Button-Inverted-On-fill-Disabled);
}
}
.variant-text {
background-color: transparent;
border-color: transparent;
color: var(--Component-Button-Brand-Secondary-On-fill-Default);
padding-left: 0;
padding-right: 0;
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
color: var(--Component-Button-Brand-Secondary-On-fill-Hover);
text-decoration: underline;
}
}
}
&[data-disabled] {
color: var(--Component-Button-Brand-Secondary-On-fill-Disabled);
text-decoration: none;
}
}
.variant-text.no-wrapping {
padding: var(--Space-x025) 0;
border-width: 0;
&:focus-visible {
outline-offset: 4px;
}
}
.variant-text.color-inverted {
color: var(--Component-Button-Brand-Secondary-On-fill-Inverted);
@media (hover: hover) {
&:not([data-disabled]) {
&:hover,
&.hovered {
color: var(--Component-Button-Brand-Secondary-On-fill-Hover-inverted);
}
}
}
&[data-disabled] {
color: var(--Component-Button-Brand-Secondary-On-fill-Disabled);
}
&:focus-visible {
outline-color: var(--Border-Inverted);
&::before {
border-color: var(--Border-Interactive-Focus);
}
}
}
.spinnerWrapper {
display: flex;
align-items: center;
margin-left: var(--Space-x1);
}