// Auto-generated by: pnpm test:stylesheets:update import { join } from 'node:path'; import { compileLessWithTokens } from '../../../scripts/testStylesheets/compileLessWithTokens'; import { DEFAULT_LESS_PRELUDES, DEFAULT_TOKEN_CSS_FILES } from '../../../scripts/testStylesheets/config'; describe('components/DropdownButton/DropdownButton.less stylesheet snapshot', () => { it('compiled CSS with tokens inlined', async () => { const css = await compileLessWithTokens(join(__dirname, 'DropdownButton.less'), DEFAULT_TOKEN_CSS_FILES, { lessPreludes: DEFAULT_LESS_PRELUDES, }); expect(css).toMatchTokensInlineSnapshot(` .dropdownButton__trigger:focus-visible { outline: none; } .dropdownButton__trigger[data-focus-visible="true"] { outline: revert; } .dropdownButton__modalMenuOverlay { position: fixed; z-index: 999; inset: 0; background-color: oklch(0 0 none / 0.6); backdrop-filter: blur(2px); } .dropdownButton__modalMenuOverlay--fadeIn { animation: dropdownUnderlayFadeIn 0.3s; } @keyframes dropdownUnderlayFadeIn { from { opacity: 0; } to { opacity: 1; } } .dropdownButton__modalMenuOverlay--fadeOut { animation: dropdownUnderlayFadeOut 0.3s; } @keyframes dropdownUnderlayFadeOut { from { opacity: 1; } to { opacity: 0; } } .dropdownButton__modalMenu { pointer-events: none; position: fixed; z-index: 1003; right: 0; bottom: 0; left: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; } .dropdownButton__modalMenu--fadeIn { animation: dropdownListContainerFadeIn 0.3s; } @keyframes dropdownListContainerFadeIn { from { max-height: 0; } to { max-height: 65vh; } } .dropdownButton__modalSubmenu { pointer-events: all; display: flex; flex-direction: column; max-height: 65vh; padding: 0 1rem; background-color: oklch(1 0 none); } .dropdownButton__modalSubmenu:has( ~ .dropdownButton__modalSubmenu), .dropdownButton__modalSubmenu:has( ~ * .dropdownButton__modalSubmenu) { position: absolute; transform: translate(-150vw, 0); } .dropdownButton__modalSubmenu--popover { position: relative !important; top: unset !important; right: 0 !important; bottom: 0 !important; left: 0 !important; width: 100% !important; } .dropdownButton__modalSubmenu--fadeOut { animation: dropdownListContainerFadeOut 0.3s; } @keyframes dropdownListContainerFadeOut { from { max-height: 65vh; } to { max-height: 0; } } .dropdownButton__modalSubmenuInner { overflow: hidden; display: flex; flex-direction: column; padding: 1rem 0; border-bottom: 1px solid oklch(0.8761 0 none); } .dropdownButton__modalSubmenuHeader { cursor: pointer; display: flex; align-items: center; width: 100%; margin-bottom: 16px; padding: 4px 8px; background: transparent; border: none; } .dropdownButton__modalSubmenuHeader:hover, .dropdownButton__modalSubmenuHeader:focus-visible { outline: none; } .dropdownButton__modalSubmenuHeader > span:last-child { width: 100%; margin: 0; } .dropdownButton__list { overflow-y: auto; display: flex; flex-direction: column; max-height: calc(100vh - 32px); background-color: oklch(1 0 none); border: 1px solid oklch(0.8761 0 none); box-shadow: 0px 3px 7px 0px oklch(0 0 none / 0.1); } .dropdownButton__list:hover, .dropdownButton__list:focus-visible { outline: none; } .dropdownButton__list--mobileView { gap: 8px; background: oklch(1 0 none); border: none; box-shadow: 0px 3px 7px 0px oklch(0 0 none / 0.1); } .dropdownButton__listItem { cursor: pointer; position: relative; display: inline-flex; gap: 4px; align-items: center; min-width: 70px; color: oklch(0.5999 0 none); white-space: nowrap; background: oklch(1 0 none); } .dropdownButton__listItem:not(:last-child) { border-bottom: 1px solid oklch(0.8761 0 none); } .dropdownButton__listItem:hover { color: oklch(0.5999 0 none); text-decoration: none; } .dropdownButton__listItem:focus, .dropdownButton__listItem:focus-visible { outline: none; } .dropdownButton__listItem[data-hovered="true"], .dropdownButton__listItem[data-focused="true"] { text-decoration: none; background: oklch(0.8761 0 none); outline: none; } .dropdownButton__listItem[data-focus-visible="true"] { outline: revert; } .dropdownButton__listItem--mobileView { padding: 3px 8px; border: 1px solid oklch(0.8761 0 none); } .dropdownButton__listItem--action { background-color: oklch(0.7257 0.1702 129.1931); } .dropdownButton__listItemLabel { display: inline-flex; gap: 4px; align-items: center; margin-right: auto; padding: 4px; } .dropdownButton__listItemLabel > .typography { margin: 0; } .dropdownButton__listItemLabel > .typography + .typography { color: oklch(0.5999 0 none); } .dropdownButton__listItemLabel--action > .typography { color: oklch(1 0 none); } .dropdownButton__listItemLabel--action > .typography + .typography { color: oklch(1 0 none); } .dropdownButton__listItemLabel--mobileView { margin-left: auto; } .dropdownButton__listItemSubmenuIndicator { display: flex; } .dropdownButton__listItemSubmenuIndicator--mobileView { position: absolute; right: 6px; } `); }); });