Commit 1c48e39e authored by Stefan Probst's avatar Stefan Probst
Browse files

chore: fix minor styling and type issues

parent 27e36761
......@@ -10,6 +10,8 @@ import { CheckBoxBase } from '@/elements/CheckBoxBase/CheckBoxBase'
export interface CheckBoxProps extends AriaCheckboxProps {
validationMessage?: ReactNode
necessityIndicator?: NecessityIndicator
/** @default "default" */
variant?: 'default' | 'form' | 'facet'
}
/**
......
......@@ -60,7 +60,10 @@ export function CheckBoxBase(props: CheckBoxBaseProps): JSX.Element {
isDisabled ? 'text-gray-350' : 'text-gray-800',
variant === 'facet' && 'flex-1',
),
text: 'flex-1 inline-flex justify-between space-x-1',
icon: 'h-full',
text: cx(
variant === 'facet' && 'flex-1 inline-flex justify-between space-x-1',
),
}
return (
......@@ -75,9 +78,9 @@ export function CheckBoxBase(props: CheckBoxBaseProps): JSX.Element {
<label className={styles.wrapper}>
<span className={styles.checkBox}>
{isIndeterminate ? (
<Icon icon={DashIcon} />
<Icon icon={DashIcon} className="icon" />
) : isSelected ? (
<Icon icon={CheckMarkIcon} />
<Icon icon={CheckMarkIcon} className="icon" />
) : null}
</span>
{props.children !== undefined ? (
......
......@@ -37,6 +37,7 @@ export interface ComboBoxProps<T>
necessityIndicator?: NecessityIndicator
// loadingState?: 'loading'
shouldFocusWrap?: boolean
allowsEmptyCollection?: boolean
hideSelectionIcon?: boolean
hideButton?: boolean
/** @default "text" */
......@@ -82,9 +83,9 @@ export function ComboBox<T extends object>(
/**
* When `items` are populated async, `useComboBoxState` does not correctly update
* the `inputValue`, because it only tracks changes to `selectedKey` (which is available
* initially with `defaultSelectedKey`), but not changes to `selectedItem`, which
* will be `null` initially, and changes once the `items` have been loaded.
* the `inputValue`, because it only tracks changes to `selectedKey`, but not
* changes to `selectedItem`, which will be `null` initially, and changes once
* the `items` have been loaded.
*
* @see https://github.com/adobe/react-spectrum/issues/1645
*/
......
......@@ -139,6 +139,7 @@ export function ItemSearchComboBox(
onSelectionChange={onSelectionChange}
variant="search"
type="search"
allowsEmptyCollection
hideSelectionIcon
hideButton
style={
......
......@@ -153,7 +153,7 @@ function SignUpForm(): JSX.Element {
<FormTextField name="displayName" label="Name" />
<FormTextField type="email" name="email" label="Email" />
<FormCheckBox name="acceptedRegulations">
<span>I have read and understood the</span>
<span>I have read and understood the </span>
<Anchor
href={new URL(
'/privacy-policy',
......@@ -163,7 +163,7 @@ function SignUpForm(): JSX.Element {
>
Privacy policy
</Anchor>
<span>and I accept it.</span>
<span> and I accept it.</span>
</FormCheckBox>
<div className="self-end py-2">
<Button
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment