diff --git a/docs/src/app/(private)/experiments/toolbar.module.css b/docs/src/app/(private)/experiments/toolbar.module.css index 52db902c6a..329059eb31 100644 --- a/docs/src/app/(private)/experiments/toolbar.module.css +++ b/docs/src/app/(private)/experiments/toolbar.module.css @@ -16,13 +16,21 @@ cursor: not-allowed !important; } -.Separator { +.Separator[data-orientation='vertical'] { width: 1px; align-self: stretch; margin-block: 2px; background-color: var(--color-gray-300); } +.Separator[data-orientation='horizontal'] { + height: 1px; + align-self: stretch; + /* margin-block: 2px;*/ + background-color: var(--color-gray-300); + margin-block: 24px; +} + .Link { font-size: 0.875rem; line-height: 1.25rem; @@ -45,6 +53,41 @@ } } +.Button { + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + height: 2.5rem; + padding-inline: 0.875rem; + margin: 0; + outline: 0; + border: 1px solid var(--color-gray-200); + border-radius: 0.375rem; + font-family: inherit; + font-size: 1rem; + line-height: 1.5rem; + background-color: transparent; + color: var(--color-gray-900); + user-select: none; + + &:focus-visible { + background-color: transparent; + outline: 2px solid var(--color-blue); + outline-offset: -1px; + } + + @media (hover: hover) { + &:hover { + background-color: var(--color-gray-100); + } + } + + &:active { + background-color: var(--color-gray-200); + } +} + /* ToggleGroup */ .ToggleGroup { display: flex; diff --git a/docs/src/app/(private)/experiments/toolbar.tsx b/docs/src/app/(private)/experiments/toolbar.tsx index a22c3a53e9..8c95623dda 100644 --- a/docs/src/app/(private)/experiments/toolbar.tsx +++ b/docs/src/app/(private)/experiments/toolbar.tsx @@ -1,5 +1,6 @@ 'use client'; import * as React from 'react'; +import { Separator } from '@base-ui-components/react/separator'; import { Toolbar } from '@base-ui-components/react/toolbar'; import { Toggle } from '@base-ui-components/react/toggle'; import { ToggleGroup } from '@base-ui-components/react/toggle-group'; @@ -14,170 +15,186 @@ const DISABLED = false; export default function App() { return ( - - + + toolbar pattern + } - className={selectClasses.Select} + className={s.Button} + onClick={() => console.log('clicked a regular toolbar button')} > - - - - + A regular button - - - - - - - - - - - - Sans-serif - - - - - - - - Serif - - - - - - - - Monospace - - - - - - - - Cursive - - - - - - + + } + className={selectClasses.Select} + > + + + + + + + + + + + + + + + + + Sans-serif + + + + + + + + Serif + + + + + + + + Monospace + + + + + + + + Cursive + + + + + + - + - } - defaultValue={[]} - className={s.ToggleGroup} - > - } - aria-label="Bold" - value="bold" - className={s.Toggle} - disabled={DISABLED} - > - - - } - aria-label="Italics" - value="italics" - className={s.Toggle} - disabled={DISABLED} + } + defaultValue={[]} + className={s.ToggleGroup} > - - - } - aria-label="Underline" - value="underline" - className={s.Toggle} - disabled={DISABLED} - > - - - + } + aria-label="Bold" + value="bold" + className={s.Toggle} + disabled={DISABLED} + > + + + } + aria-label="Italics" + value="italics" + className={s.Toggle} + disabled={DISABLED} + > + + + } + aria-label="Underline" + value="underline" + className={s.Toggle} + disabled={DISABLED} + > + + + - + - } - defaultValue={['left']} - className={s.ToggleGroup} - disabled={DISABLED} - > - } - aria-label="Align left" - value="left" - className={s.Toggle} - > - - - } - aria-label="Align center" - value="center" - className={s.Toggle} - > - - - } - aria-label="Align right" - value="right" - className={s.Toggle} + } + defaultValue={['left']} + className={s.ToggleGroup} + disabled={DISABLED} > - - - + } + aria-label="Align left" + value="left" + className={s.Toggle} + > + + + } + aria-label="Align center" + value="center" + className={s.Toggle} + > + + + } + aria-label="Align right" + value="right" + className={s.Toggle} + > + + + - + - - } - className={s.More} - > - - - - - - + } + className={s.More} + > + + + + + - - - Zoom in - Zoom out - Reset zoom - - Minimize - Maximize - - - - - + + + + Zoom in + Zoom out + Reset zoom + + Minimize + Maximize + + + + + +