diff --git a/components/Dialog/index.scss b/components/Dialog/index.scss new file mode 100644 index 00000000..831b6391 --- /dev/null +++ b/components/Dialog/index.scss @@ -0,0 +1,87 @@ +.Dialog { + $multiplier: 4; + + animation: 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0s 1 normal none running + openModal; + background: var(--dialog-bg); + border-radius: $card-corner; + display: flex; + flex-direction: column; + gap: $unit * $multiplier; + height: auto; + min-width: $unit * 48; + min-height: $unit * 12; + padding: $unit * $multiplier; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 21; + + .DialogHeader { + display: flex; + align-items: center; + gap: $unit; + + .left { + display: flex; + flex-direction: column; + flex-grow: 1; + gap: $unit; + + p { + font-size: $font-small; + line-height: 1.25; + } + } + } + + .DialogClose { + background: transparent; + + &:hover { + cursor: pointer; + + svg { + fill: $error; + } + } + + svg { + fill: $grey-50; + float: right; + height: 24px; + width: 24px; + } + } + + .DialogTitle { + color: var(--text-secondary); + font-size: $font-xlarge; + flex-grow: 1; + } + + .DialogTop { + display: flex; + flex-direction: column; + flex-grow: 1; + gap: calc($unit / 2); + + .SubTitle { + color: var(--text-secondary); + font-size: $font-small; + font-weight: $medium; + } + } + + .DialogDescription { + color: var(--text-secondary); + flex-grow: 1; + } + + .actions { + display: flex; + justify-content: flex-end; + width: 100%; + } +} diff --git a/components/Dialog/index.tsx b/components/Dialog/index.tsx new file mode 100644 index 00000000..9683da38 --- /dev/null +++ b/components/Dialog/index.tsx @@ -0,0 +1,39 @@ +import React from 'react' +import * as DialogPrimitive from '@radix-ui/react-dialog' +import classNames from 'classnames' + +import './index.scss' + +interface Props + extends React.DetailedHTMLProps< + React.DialogHTMLAttributes, + HTMLDivElement + > {} + +export const DialogContent = React.forwardRef( + ({ children, ...props }, forwardedRef) => { + const classes = classNames( + { + Dialog: true, + }, + props.className + ) + + return ( + + + + {children} + + + ) + } +) + +export const Dialog = DialogPrimitive.Root +export const DialogTrigger = DialogPrimitive.Trigger +export const DialogClose = DialogPrimitive.Close diff --git a/components/Fieldset/index.scss b/components/Fieldset/index.scss deleted file mode 100644 index 4caca1f9..00000000 --- a/components/Fieldset/index.scss +++ /dev/null @@ -1,31 +0,0 @@ -.Fieldset { - border: none; - display: inline-flex; - flex-direction: column; - padding: 0; - margin: 0; - - input { - -webkit-font-smoothing: antialiased; - background-color: var(--input-bg); - border: none; - border-radius: 6px; - box-sizing: border-box; - display: block; - padding: ($unit * 1.5) $unit-2x; - width: 100%; - } - - .InputError { - color: $error; - font-size: $font-tiny; - margin: $unit 0; - padding: calc($unit / 2) ($unit * 2); - } -} - -::placeholder { - /* Chrome, Firefox, Opera, Safari 10.1+ */ - color: var(--text-tertiary) !important; - opacity: 1; /* Firefox */ -} diff --git a/components/Fieldset/index.tsx b/components/Fieldset/index.tsx deleted file mode 100644 index 7ba41adc..00000000 --- a/components/Fieldset/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react' -import './index.scss' - -interface Props { - fieldName: string - placeholder: string - value?: string - error: string - onBlur?: (event: React.ChangeEvent) => void - onChange?: (event: React.ChangeEvent) => void -} - -const Fieldset = React.forwardRef(function fieldSet( - props, - ref -) { - const fieldType = ['password', 'confirm_password'].includes(props.fieldName) - ? 'password' - : 'text' - - return ( -
- - {props.error.length > 0 &&

{props.error}

} -
- ) -}) - -export default Fieldset diff --git a/components/GridRep/index.scss b/components/GridRep/index.scss index c7d4d60b..a47aa2fa 100644 --- a/components/GridRep/index.scss +++ b/components/GridRep/index.scss @@ -73,7 +73,7 @@ max-width: 258px; // Can we not do this? &.empty { - color: var(--text-secondary); + color: var(--text-tertiary); } } diff --git a/components/HeaderMenu/index.scss b/components/HeaderMenu/index.scss index ad4f95e1..212fa3c2 100644 --- a/components/HeaderMenu/index.scss +++ b/components/HeaderMenu/index.scss @@ -10,7 +10,7 @@ } .MenuItem { - color: var(--text-secondary); + color: var(--text-tertiary); font-weight: $normal; &:hover:not(.disabled) { diff --git a/components/Input/index.scss b/components/Input/index.scss new file mode 100644 index 00000000..eb73f6eb --- /dev/null +++ b/components/Input/index.scss @@ -0,0 +1,23 @@ +.Input { + -webkit-font-smoothing: antialiased; + background-color: var(--input-bg); + border: none; + border-radius: 6px; + box-sizing: border-box; + display: block; + padding: ($unit * 1.5) $unit-2x; + width: 100%; +} + +.InputError { + color: $error; + font-size: $font-tiny; + margin: $unit 0; + padding: calc($unit / 2) ($unit * 2); +} + +::placeholder { + /* Chrome, Firefox, Opera, Safari 10.1+ */ + color: var(--text-secondary) !important; + opacity: 1; /* Firefox */ +} diff --git a/components/Input/index.tsx b/components/Input/index.tsx new file mode 100644 index 00000000..f96b990b --- /dev/null +++ b/components/Input/index.tsx @@ -0,0 +1,37 @@ +import classNames from 'classnames' +import React from 'react' +import './index.scss' + +interface Props + extends React.DetailedHTMLProps< + React.InputHTMLAttributes, + HTMLInputElement + > { + error?: string + label?: string +} + +const Input = React.forwardRef( + (props: Props, forwardedRef) => { + const classes = classNames({ Input: true }, props.className) + + return ( + + ) + } +) + +export default Input diff --git a/components/JobSkillItem/index.scss b/components/JobSkillItem/index.scss index 0203afe3..db4d8edb 100644 --- a/components/JobSkillItem/index.scss +++ b/components/JobSkillItem/index.scss @@ -15,11 +15,11 @@ } & p.placeholder { - color: var(--text-secondary-hover); + color: var(--text-tertiary-hover); } & svg { - fill: var(--icon-secondary-hover); + fill: var(--icon-tertiary-hover); } } @@ -48,7 +48,7 @@ color: var(--text-primary); &.placeholder { - color: var(--text-secondary); + color: var(--text-tertiary); } } } diff --git a/components/LoginModal/index.tsx b/components/LoginModal/index.tsx index c54d04a9..2851d6db 100644 --- a/components/LoginModal/index.tsx +++ b/components/LoginModal/index.tsx @@ -10,7 +10,7 @@ import api from '~utils/api' import { accountState } from '~utils/accountState' import Button from '~components/Button' -import Fieldset from '~components/Fieldset' +import Fieldset from '~components/Input' import CrossIcon from '~public/icons/Cross.svg' import './index.scss' diff --git a/components/PartyDetails/index.scss b/components/PartyDetails/index.scss index 77c33156..f5297a37 100644 --- a/components/PartyDetails/index.scss +++ b/components/PartyDetails/index.scss @@ -90,7 +90,7 @@ color: var(--text-primary); &.empty { - color: var(--text-tertiary); + color: var(--text-secondary); } } } diff --git a/components/SearchFilter/index.scss b/components/SearchFilter/index.scss index b625bb65..030c35ec 100644 --- a/components/SearchFilter/index.scss +++ b/components/SearchFilter/index.scss @@ -1,33 +1,31 @@ .DropdownLabel { align-items: center; - background: $grey-90; + background: var(--button-contained-bg); border: none; - border-radius: $unit * 2; - color: $grey-50; + border-radius: $unit-2x; + color: var(--text-secondary); display: flex; - gap: calc($unit / 2); + gap: $unit-half; flex-direction: row; - padding: ($unit) ($unit * 2); + padding: $unit ($unit * 1.5) $unit $unit-2x; &:hover { - background: $grey-80; - color: $grey-15; + background: var(--button-contained-bg-hover); + color: var(--text-primary); cursor: pointer; } .count { - color: $grey-60; + color: var(--text-tertiary); font-weight: $medium; } & > .icon { - $diameter: 12px; + $diameter: 16px; height: $diameter; width: $diameter; svg { - transform: scale(0.85); - path { fill: $grey-60; } @@ -36,12 +34,11 @@ } .Dropdown { - background: $grey-100; + background: var(--button-contained-bg); border-radius: $unit; box-shadow: 0 0 2px rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; - gap: calc($unit / 2); padding: $unit; min-width: 120px; @@ -49,7 +46,7 @@ overflow: hidden; svg { - fill: $grey-100; + fill: var(--button-contained-bg); filter: drop-shadow(0px 0px 1px rgb(0 0 0 / 0.18)); } } @@ -66,9 +63,9 @@ } .Label { - color: $grey-60; + color: var(--text-tertiary); font-size: $font-small; - margin-bottom: calc($unit / 2); - padding-left: calc($unit / 2); + margin-bottom: $unit-half; + padding: $unit-half 0 $unit $unit-half; } } diff --git a/components/SearchFilterCheckboxItem/index.scss b/components/SearchFilterCheckboxItem/index.scss index 90e8a8e2..13488857 100644 --- a/components/SearchFilterCheckboxItem/index.scss +++ b/components/SearchFilterCheckboxItem/index.scss @@ -1,29 +1,30 @@ .Item { align-items: center; border-radius: calc($unit / 2); - color: $grey-50; + color: var(--text-secondary); font-size: $font-regular; line-height: 1.2; min-width: 100px; position: relative; padding: $unit; - padding-left: $unit * 3; + padding-left: $unit * 3.5; &:hover { - background: $grey-90; + background: var(--button-contained-bg-hover); + color: var(--text-primary); cursor: pointer; } &[data-state='checked'] { - background: $grey-90; + background: var(--button-contained-bg-hover); svg { - fill: $grey-55; + fill: var(--text-secondary); } } .Indicator { - $diameter: 18px; + $diameter: 20px; display: flex; align-items: center; diff --git a/components/SearchModal/index.scss b/components/SearchModal/index.scss index 05d88831..8d92df76 100644 --- a/components/SearchModal/index.scss +++ b/components/SearchModal/index.scss @@ -39,16 +39,16 @@ label { width: 100%; - .Input { - background: $grey-90; - border: none; - border-radius: calc($unit / 2); - box-sizing: border-box; - font-size: $font-regular; - padding: $unit * 1.5; - text-align: left; - width: 100%; - } + // .Input { + // background: $grey-90; + // border: none; + // border-radius: calc($unit / 2); + // box-sizing: border-box; + // font-size: $font-regular; + // padding: $unit * 1.5; + // text-align: left; + // width: 100%; + // } } } } @@ -62,17 +62,17 @@ h5.total { font-size: $font-regular; font-weight: $normal; - color: $grey-50; - padding: calc($unit / 2) ($unit * 1.5); + color: var(--text-tertiary); + padding: $unit-half ($unit * 1.5); } .footer { align-items: center; display: flex; - color: $grey-60; + color: var(--text-tertiary); font-size: $font-regular; font-weight: $normal; - height: $unit * 10; + height: $unit-10x; justify-content: center; } @@ -91,8 +91,8 @@ } .Search.Dialog #NoResults h2 { - color: #ccc; + color: var(--text-secondary); font-size: $font-large; font-weight: 500; - margin-top: -32px; + margin-top: $unit-4x * -1; } diff --git a/components/SearchModal/index.tsx b/components/SearchModal/index.tsx index 8fee34e8..61b0e24a 100644 --- a/components/SearchModal/index.tsx +++ b/components/SearchModal/index.tsx @@ -6,8 +6,14 @@ import InfiniteScroll from 'react-infinite-scroll-component' import api from '~utils/api' -import * as Dialog from '@radix-ui/react-dialog' +import { + Dialog, + DialogTrigger, + DialogContent, + DialogClose, +} from '~components/Dialog' +import Input from '~components/Input' import CharacterSearchFilterBar from '~components/CharacterSearchFilterBar' import WeaponSearchFilterBar from '~components/WeaponSearchFilterBar' import SummonSearchFilterBar from '~components/SummonSearchFilterBar' @@ -317,61 +323,54 @@ const SearchModal = (props: Props) => { } return ( - - {props.children} - - -