diff --git a/packages/site-home/lib/main.css b/packages/site-home/lib/main.css index 35fb20478..18ae1a663 100644 --- a/packages/site-home/lib/main.css +++ b/packages/site-home/lib/main.css @@ -6,15 +6,24 @@ flex-direction: column; overflow: hidden; padding-bottom: 140px; - padding-top: var(--base-size-112); + padding-top: var(--base-size-64); + + @media (--size-viewport-width-large) { + padding-top: var(--base-size-112); + } } .home__hero { margin-left: auto; margin-right: auto; max-width: var(--temp-home-breakpoint-xlarge); + padding-inline: var(--base-size-24); text-align: center; width: 100%; + + @media (--size-viewport-width-medium) { + padding-inline: var(--base-size-32); + } } .home__hero h1 { @@ -27,7 +36,9 @@ } .home__hero + .home__part { - margin-top: 100px; + @media (--size-viewport-width-large) { + margin-top: 100px; + } } .home__part { @@ -37,7 +48,7 @@ justify-content: space-between; margin-left: auto; margin-right: auto; - margin-top: 32px; + margin-top: var(--base-size-32); max-width: var(--temp-home-breakpoint-xlarge); width: 100%; @@ -53,10 +64,13 @@ } .home__part::after { - content: ""; display: block; grid-column: 1; grid-row: 3; + + @media (--size-viewport-width-large) { + content: ""; + } } .home__part_reverse { @@ -288,14 +302,37 @@ /* Integration with @onlyoffice/site-search */ -.home__hero search-container { - display: block; +.home__hero .search { margin-left: auto; margin-right: auto; margin-top: var(--base-size-48); } -.home__hero .search { +.home__hero .search .text-input { + --text-input-size-is-default: var(--false); + --text-input-size-is-small: var(--false); + --text-input-size-is-medium: var(--false); + --text-input-size-is-large: var(--true); + --text-input-size-is-xlarge: var(--false); + + font-size: var(--text-body-font-size-medium); + line-height: var(--text-body-line-height-medium); max-width: 736px; width: 100%; + + @media (--size-viewport-width-large) { + --text-input-size-is-default: var(--false); + --text-input-size-is-small: var(--false); + --text-input-size-is-medium: var(--false); + --text-input-size-is-large: var(--false); + --text-input-size-is-xlarge: var(--true); + + font-size: var(--text-body-font-size-large); + line-height: var(--text-body-line-height-large); + } +} + +.home__hero .search .text-input svg { + width: 1.25em; + height: 1.25em; } diff --git a/packages/site-home/lib/main.story.tsx b/packages/site-home/lib/main.story.tsx index f0275b82e..0788d80b9 100644 --- a/packages/site-home/lib/main.story.tsx +++ b/packages/site-home/lib/main.story.tsx @@ -13,7 +13,7 @@ export function Default(): JSX.Element { return

Welcome to ONLYOFFICE API

- +
diff --git a/packages/site-page/lib/main.css b/packages/site-page/lib/main.css index 64ff55f33..0423f47ef 100644 --- a/packages/site-page/lib/main.css +++ b/packages/site-page/lib/main.css @@ -17,11 +17,14 @@ grid-template-rows: min-content 1fr min-content; min-height: 100vh; - @media (--size-viewport-width-large) { - --temp-page-header-height: 72px; + @media (--size-viewport-width-medium) { --page-header-logo-padding-inline: var(--base-size-32); --page-header-menu-padding-inline: var(--base-size-40); } + + @media (--size-viewport-width-large) { + --temp-page-header-height: 72px; + } } .page__header { @@ -29,7 +32,6 @@ border-bottom-color: var(--color-page-header-default-border); border-bottom-style: solid; border-bottom-width: var(--page-header-border-width); - color: var(--color-page-header-default-foreground); position: sticky; top: 0; z-index: 2; diff --git a/packages/site-search/lib/main.css b/packages/site-search/lib/main.css index 05e4c93e3..83bc8597f 100644 --- a/packages/site-search/lib/main.css +++ b/packages/site-search/lib/main.css @@ -1,56 +1,23 @@ .search { - align-items: center; - background-color: var(--color-background-default); - border-color: var(--color-control-default-border-rest); - border-radius: var(--size-border-radius-small); - border-style: solid; - border-width: var(--size-border-width-thin); - column-gap: var(--size-control-gap-medium); - display: inline-grid; - font-size: var(--text-body-font-size-small); - grid-template-columns: min-content 1fr; - line-height: var(--text-body-line-height-small); - min-width: 264px; - padding-block: var(--size-control-padding-block-medium); - padding-inline: var(--size-control-padding-inline-medium); - text-align: start; + display: block; } -.search_large { +/* .search_large { font-size: 16px; padding: 20px 22px; -} +} */ -search-container[filled] .search { - grid-template-columns: min-content 1fr min-content; -} - -search-container[focused] .search { - border-color: transparent; - outline-color: var(--color-focus-default-outline); - outline-offset: calc(var(--size-border-width-thin) * -1); - outline-style: solid; - outline-width: var(--side-outline-width-default); +.search .text-input { + background-color: var(--color-background-default); + /* font-size: var(--text-body-font-size-small); */ + /* line-height: var(--text-body-line-height-small); */ } -.search__glass { +/* .search .text-input__leading { color: var(--color-foreground-muted); - display: block; - grid-column: 1; - grid-row: 1; -} - -.search__placeholder { - grid-column: 2; - grid-row: 1; -} +} */ -search-container[filled] .search__placeholder, -search-container[focused] .search__placeholder { - display: none; -} - -.search__placeholder kbd { +.search .text-input__placeholder kbd { border-color: var(--color-control-default-border-rest); border-radius: var(--size-border-radius-small); border-style: solid; @@ -59,40 +26,11 @@ search-container[focused] .search__placeholder { padding: 0.2em; } -.search input[name="q"] { - appearance: textfield; - background-color: transparent; - border: none; - grid-column: 2; - grid-row: 1; - min-width: 0; - padding: 0; -} - -.search input[name="q"]:focus { - outline: none; -} - -.search input[name="q"]::-webkit-search-cancel-button { - -webkit-appearance: none; -} - -.search__clear { - background-color: transparent; - border: none; - color: var(--color-foreground-muted); - cursor: pointer; +.search .text-input__trailing button { display: none; - grid-column: 3; - grid-row: 1; - padding: 0; -} - -search-container[filled] .search__clear { - display: block; } -.search__clear svg { +.search .text-input[state-filled] .text-input__trailing button, +.search .text-input:state(filled) .text-input__trailing button { display: block; - pointer-events: none; } diff --git a/packages/site-search/lib/main.tsx b/packages/site-search/lib/main.tsx index a36ec9ada..e3e4c124d 100644 --- a/packages/site-search/lib/main.tsx +++ b/packages/site-search/lib/main.tsx @@ -2,12 +2,19 @@ import {type PagefindSearchOptions} from "@onlyoffice/pagefind-types" import {type ChildrenIncludable} from "@onlyoffice/preact-types" import {useSlots} from "@onlyoffice/preact-slots" import {CancelIcon, MagnifyingGlassIcon} from "@onlyoffice/ui-icons/poor/24.tsx" -import {Template} from "@onlyoffice/ui-kit" +import { + Template, + TextInput, + TextInputAction, + TextInputControl, + TextInputLeading, + TextInputPlaceholder, + TextInputTrailing, +} from "@onlyoffice/ui-kit" import {type JSX, h} from "preact" export interface SearchContainerProperties extends ChildrenIncludable { "search-options"?: PagefindSearchOptions - "size"?: "default" | "large" } export function SearchContainer(p: SearchContainerProperties): JSX.Element { @@ -15,7 +22,7 @@ export function SearchContainer(p: SearchContainerProperties): JSX.Element { placeholder: SearchPlaceholder, field: SearchField, clear: SearchClear, - template: SearchTemplate + template: SearchTemplate, }) const o: Record = {} @@ -23,28 +30,30 @@ export function SearchContainer(p: SearchContainerProperties): JSX.Element { o["search-options"] = JSON.stringify(p["search-options"]) } - return -