Skip to content

Commit 58f4944

Browse files
committed
Sizing & bold theme
1 parent d943ddc commit 58f4944

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

packages/gitbook/src/components/AIChat/AIChatInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function AIChatInput(props: {
5353
name="ai-chat-input"
5454
multiline
5555
resize
56+
sizing="large"
5657
label="Assistant chat input"
5758
placeholder={tString(language, 'ai_chat_input_placeholder')}
5859
onChange={(event) => onChange(event.target.value)}

packages/gitbook/src/components/PageFeedback/PageFeedbackForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function PageFeedbackForm(props: {
8686
</div>
8787
{rating ? (
8888
<Input
89+
ref={inputRef}
8990
label={tString(languages, 'was_this_helpful_comment')}
9091
multiline
9192
submitButton

packages/gitbook/src/components/Search/SearchInput.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export const SearchInput = React.forwardRef<HTMLDivElement, SearchInputProps>(
5656
name="search-input"
5757
ref={inputRef}
5858
containerRef={containerRef as React.RefObject<HTMLDivElement | null>}
59-
sizing="small"
59+
sizing="medium"
6060
label={tString(language, withAI ? 'search_or_ask' : 'search')}
61-
className="@max-2xl:absolute inset-y-0 right-0 z-30 @max-2xl:max-w-10 grow @max-2xl:focus-within:w-56 @max-2xl:focus-within:max-w-[calc(100vw-5rem)] @max-2xl:has-[input[aria-expanded=true]]:w-56 @max-2xl:has-[input[aria-expanded=true]]:max-w-[calc(100vw-5rem)] @max-2xl:[&_input]:opacity-0 @max-2xl:focus-within:[&_input]:opacity-11 @max-2xl:has-[input[aria-expanded=true]]:[&_input]:opacity-11"
61+
className="@max-2xl:absolute inset-y-0 right-0 z-30 @max-2xl:max-w-10 grow theme-bold:border-header-link/4 theme-bold:bg-header-background theme-bold:text-header-link theme-bold:shadow-none! @max-2xl:focus-within:w-56 @max-2xl:focus-within:max-w-[calc(100vw-5rem)] theme-bold:focus-within:border-header-link/6 theme-bold:focus-within:bg-header-link/1 theme-bold:focus-within:ring-header-link/5 theme-bold:hover:border-header-link/5 theme-bold:hover:bg-header-link/1 @max-2xl:has-[input[aria-expanded=true]]:w-56 @max-2xl:has-[input[aria-expanded=true]]:max-w-[calc(100vw-5rem)] @max-2xl:[&_input]:opacity-0 theme-bold:[&_input]:placeholder:text-header-link/8 @max-2xl:focus-within:[&_input]:opacity-11 @max-2xl:has-[input[aria-expanded=true]]:[&_input]:opacity-11 theme-bold:[&_svg]:text-header-link/8"
6262
placeholder={`${tString(language, withAI ? 'search_or_ask' : 'search')}…`}
6363
onFocus={onFocus}
6464
onKeyDown={onKeyDown}
@@ -73,7 +73,12 @@ export const SearchInput = React.forwardRef<HTMLDivElement, SearchInputProps>(
7373
aria-haspopup="listbox"
7474
aria-expanded={value && isOpen ? 'true' : 'false'}
7575
clearButton
76-
keyboardShortcut={<KeyboardShortcut keys={isOpen ? ['esc'] : ['mod', 'k']} />}
76+
keyboardShortcut={
77+
<KeyboardShortcut
78+
className="theme-bold:border-header-link/4 theme-bold:bg-header-background theme-bold:text-header-link"
79+
keys={isOpen ? ['esc'] : ['mod', 'k']}
80+
/>
81+
}
7782
{...rest}
7883
type="text"
7984
/>

packages/gitbook/src/components/primitives/Input.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type InputProps = {
1111
label: string;
1212
leading?: IconName | React.ReactNode;
1313
trailing?: React.ReactNode;
14-
sizing?: 'small' | 'medium'; // The `size` prop is already taken by the HTML input element.
14+
sizing?: 'medium' | 'large'; // The `size` prop is already taken by the HTML input element.
1515
containerRef?: React.RefObject<HTMLDivElement | null>;
1616
/**
1717
* A submit button, shown to the right of the input.
@@ -40,11 +40,11 @@ export type InputProps = {
4040
type HybridInputElement = HTMLInputElement & HTMLTextAreaElement;
4141

4242
const SIZE_CLASSES = {
43-
small: {
43+
medium: {
4444
container: 'p-2 circular-corners:rounded-3xl rounded-corners:rounded-lg',
4545
input: '-m-2 p-2',
4646
},
47-
medium: {
47+
large: {
4848
container: 'p-2 circular-corners:rounded-3xl rounded-corners:rounded-xl',
4949
input: '-m-2 p-3',
5050
},
@@ -160,7 +160,7 @@ export const Input = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, In
160160
<div
161161
className={tcls(
162162
'group/input relative flex min-h-min gap-2 overflow-hidden border border-tint bg-tint-base shadow-tint/6 ring-primary-hover transition-all dark:shadow-tint-1',
163-
'depth-subtle:focus-within:-translate-y-px depth-subtle:shadow-sm depth-subtle:focus-within:shadow-lg',
163+
'depth-subtle:focus-within:-translate-y-px depth-subtle:hover:-translate-y-px depth-subtle:shadow-sm depth-subtle:focus-within:shadow-lg',
164164
disabled
165165
? 'cursor-not-allowed border-tint-subtle bg-tint-subtle'
166166
: 'focus-within:border-primary-hover focus-within:shadow-primary-subtle focus-within:ring-2 hover:cursor-text hover:border-tint-hover focus-within:hover:border-primary-hover',

0 commit comments

Comments
 (0)