Skip to content

Commit

Permalink
Merge branch 'main' into slot-picker-start-of-day
Browse files Browse the repository at this point in the history
  • Loading branch information
joeauyeung committed Mar 20, 2023
2 parents 8112d2d + a145de5 commit bcb0a8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ const InputOption: React.FC<OptionProps<any, boolean, GroupBase<any>>> = ({

return (
<components.Option
className={classNames(
className,
"dark:bg-darkgray-100 !flex !cursor-pointer !py-3 text-[inherit]",
isFocused && "dark:!bg-darkgray-200 !bg-gray-100",
isSelected && "dark:!bg-darkgray-300 !bg-neutral-900"
)}
{...rest}
isDisabled={isDisabled}
isFocused={isFocused}
Expand Down Expand Up @@ -81,6 +75,7 @@ export default function MultiSelectCheckboxes({
setSelected(s);
setValue(s);
}}
variant="checkbox"
options={options}
isMulti
className={classNames(className ? className : "w-64 text-sm")}
Expand Down
16 changes: 13 additions & 3 deletions packages/ui/components/form/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type SelectProps<
Option,
IsMulti extends boolean = false,
Group extends GroupBase<Option> = GroupBase<Option>
> = Props<Option, IsMulti, Group>;
> = Props<Option, IsMulti, Group> & { variant?: "default" | "checkbox" };

export const Select = <
Option,
Expand All @@ -22,6 +22,7 @@ export const Select = <
>({
components,
menuPlacement,
variant = "default",
...props
}: SelectProps<Option, IsMulti, Group>) => {
const reactSelectProps = React.useMemo(() => {
Expand All @@ -46,12 +47,21 @@ export const Select = <
props.classNames?.option
),
placeholder: (state) =>
classNames("text-gray-400 text-sm dark:text-darkgray-400", state.isFocused && "hidden"),
classNames(
"text-gray-400 text-sm dark:text-darkgray-400",
state.isFocused && variant !== "checkbox" && "hidden"
),
dropdownIndicator: () => "text-gray-600 dark:text-darkgray-400",
control: (state) =>
classNames(
"dark:bg-darkgray-100 dark:border-darkgray-300 !min-h-9 border-gray-300 bg-white text-sm leading-4 placeholder:text-sm placeholder:font-normal focus-within:ring-2 focus-within:ring-gray-800 hover:border-gray-400 dark:focus-within:ring-darkgray-900 rounded-md border ",
state.isMulti ? (state.hasValue ? "p-1" : "px-3 py-2") : "py-2 px-3",
state.isMulti
? variant === "checkbox"
? "px-3 py-2"
: state.hasValue
? "p-1"
: "px-3 py-2"
: "py-2 px-3",
props.classNames?.control
),
singleValue: () =>
Expand Down

0 comments on commit bcb0a8c

Please sign in to comment.