From 67e3a00b266709b32a3f027d2d40cc32048326a8 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 15 Nov 2022 15:54:03 -0800 Subject: [PATCH] Base component fixes --- src/renderer/components/date-picker/index.tsx | 27 +++++++++- .../components/dropdown-menu/index.tsx | 11 +++- src/renderer/components/input/index.tsx | 29 +++++----- src/renderer/components/popover/index.tsx | 15 ++++-- src/renderer/components/select/index.tsx | 1 + .../grid-card/grid-card-controls.tsx | 53 +++++++++++++++---- 6 files changed, 107 insertions(+), 29 deletions(-) diff --git a/src/renderer/components/date-picker/index.tsx b/src/renderer/components/date-picker/index.tsx index c3975a847..88e4893a0 100644 --- a/src/renderer/components/date-picker/index.tsx +++ b/src/renderer/components/date-picker/index.tsx @@ -9,7 +9,32 @@ interface DatePickerProps extends MantineDatePickerProps { width?: number | string; } -const StyledDatePicker = styled(MantineDatePicker)``; +const StyledDatePicker = styled(MantineDatePicker)` + & .mantine-DatePicker-input { + color: var(--input-fg); + background: var(--input-bg); + + &::placeholder { + color: var(--input-placeholder-fg); + } + } + + & .mantine-DatePicker-icon { + color: var(--input-placeholder-fg); + } + + & .mantine-DatePicker-required { + color: var(--secondary-color); + } + + & .mantine-DatePicker-label { + font-family: var(--label-font-faimly); + } + + & .mantine-DateRangePicker-disabled { + opacity: 0.6; + } +`; export const DatePicker = ({ width, maxWidth, ...props }: DatePickerProps) => { return ; diff --git a/src/renderer/components/dropdown-menu/index.tsx b/src/renderer/components/dropdown-menu/index.tsx index 1ce9650ea..9b74bac3e 100644 --- a/src/renderer/components/dropdown-menu/index.tsx +++ b/src/renderer/components/dropdown-menu/index.tsx @@ -61,6 +61,7 @@ const StyledMenuDropdown = styled(MantineMenu.Dropdown)` background: var(--dropdown-menu-bg); border: var(--dropdown-menu-border); border-radius: var(--dropdown-menu-border-radius); + filter: drop-shadow(0 0 5px rgb(0, 0, 0, 50%)); `; const StyledMenuDivider = styled(MantineMenu.Divider)` @@ -69,7 +70,15 @@ const StyledMenuDivider = styled(MantineMenu.Divider)` export const DropdownMenu = ({ children, ...props }: MenuProps) => { return ( - + {children} ); diff --git a/src/renderer/components/input/index.tsx b/src/renderer/components/input/index.tsx index 1f46ba79b..6051951d8 100644 --- a/src/renderer/components/input/index.tsx +++ b/src/renderer/components/input/index.tsx @@ -80,6 +80,18 @@ const StyledNumberInput = styled(MantineNumberInput)` } } + /* & .mantine-NumberInput-rightSection { + color: var(--input-placeholder-fg); + background: var(--input-bg); + } */ + + & .mantine-NumberInput-controlUp { + svg { + color: white; + fill: white; + } + } + & .mantine-Input-icon { color: var(--input-placeholder-fg); } @@ -146,7 +158,7 @@ const StyledFileInput = styled(MantineFileInput)` font-family: var(--label-font-faimly); } - & .mantine-PasswordInput-disabled { + & .mantine-FileInput-disabled { opacity: 0.6; } `; @@ -171,6 +183,7 @@ export const NumberInput = forwardRef( return ( ( export const PasswordInput = forwardRef( ({ children, width, maxWidth, ...props }: PasswordInputProps, ref) => { return ( - + {children} ); @@ -199,12 +207,7 @@ export const PasswordInput = forwardRef( export const FileInput = forwardRef( ({ children, width, maxWidth, ...props }: FileInputProps, ref) => { return ( - + {children} ); diff --git a/src/renderer/components/popover/index.tsx b/src/renderer/components/popover/index.tsx index a5e41af4b..7d8cf819a 100644 --- a/src/renderer/components/popover/index.tsx +++ b/src/renderer/components/popover/index.tsx @@ -15,15 +15,20 @@ const StyledDropdown = styled(MantinePopover.Dropdown)` font-size: 0.9em; font-family: var(--content-font-family); background-color: var(--dropdown-menu-bg); - - & .mantine-Menu-itemIcon { - margin-right: 0.5rem; - } `; export const Popover = ({ children, ...props }: PopoverProps) => { return ( - + {children} ); diff --git a/src/renderer/components/select/index.tsx b/src/renderer/components/select/index.tsx index 4de7fc1e7..907ef52fe 100644 --- a/src/renderer/components/select/index.tsx +++ b/src/renderer/components/select/index.tsx @@ -33,6 +33,7 @@ export const Select = ({ width, maxWidth, ...props }: SelectProps) => { styles={{ dropdown: { background: 'var(--dropdown-menu-bg)', + filter: 'drop-shadow(0 0 5px rgb(0, 0, 0, 20%))', }, input: { background: 'var(--input-bg)', diff --git a/src/renderer/components/virtual-grid/grid-card/grid-card-controls.tsx b/src/renderer/components/virtual-grid/grid-card/grid-card-controls.tsx index f383a67ae..6f3a07f4b 100644 --- a/src/renderer/components/virtual-grid/grid-card/grid-card-controls.tsx +++ b/src/renderer/components/virtual-grid/grid-card/grid-card-controls.tsx @@ -1,6 +1,6 @@ import React, { MouseEvent } from 'react'; import { Group, UnstyledButtonProps } from '@mantine/core'; -import { motion } from 'framer-motion'; +import { motion, Variants } from 'framer-motion'; import { RiPlayFill, RiMore2Fill, @@ -8,7 +8,7 @@ import { RiHeartLine, } from 'react-icons/ri'; import styled from 'styled-components'; -import { Button } from '@/renderer/components/button'; +import { _Button } from '@/renderer/components/button'; import { DropdownMenu } from '@/renderer/components/dropdown-menu'; import { LibraryItem, Play, PlayQueueAddOptions } from '@/renderer/types'; @@ -33,6 +33,13 @@ const PlayButton = styled(motion.button)` } `; +const SecondaryButton = styled(motion(_Button))` + fill: white !important; + svg: { + fill: white !important; + } +`; + const GridCardControlsContainer = styled.div` display: flex; flex-direction: column; @@ -100,15 +107,30 @@ export const GridCardControls = ({ itemType: LibraryItem; playButtonBehavior: Play; }) => { + const buttonVariants: Variants = { + hover: { + opacity: 1, + scale: 1.1, + }, + initial: { + opacity: 0.6, + scale: 1, + }, + pressed: { + scale: 1, + }, + }; + return ( { e.preventDefault(); e.stopPropagation(); @@ -124,7 +146,15 @@ export const GridCardControls = ({ - + - + {PLAY_TYPES.filter(