+
+
diff --git a/components/common/CharLimitedFieldset/index.tsx b/components/common/CharLimitedFieldset/index.tsx
index 16cbef3e..d3aa498c 100644
--- a/components/common/CharLimitedFieldset/index.tsx
+++ b/components/common/CharLimitedFieldset/index.tsx
@@ -1,7 +1,14 @@
-import React, { useEffect, useState } from 'react'
+import React, {
+ ForwardRefRenderFunction,
+ forwardRef,
+ useEffect,
+ useState,
+} from 'react'
+
+import classNames from 'classnames'
import './index.scss'
-interface Props {
+interface Props extends React.HTMLProps
{
fieldName: string
placeholder: string
value?: string
@@ -11,47 +18,61 @@ interface Props {
onChange?: (event: React.ChangeEvent) => void
}
-const CharLimitedFieldset = React.forwardRef(
- function useFieldSet(props, ref) {
- const fieldType = ['password', 'confirm_password'].includes(props.fieldName)
- ? 'password'
- : 'text'
+const CharLimitedFieldset: ForwardRefRenderFunction = (
+ {
+ fieldName,
+ placeholder,
+ value,
+ limit,
+ error,
+ onBlur,
+ onChange: onInputChange,
+ ...props
+ },
+ ref
+) => {
+ // States
+ const [currentCount, setCurrentCount] = useState(
+ () => limit - (value || '').length
+ )
- const [currentCount, setCurrentCount] = useState(0)
+ // Hooks
+ useEffect(() => {
+ setCurrentCount(limit - (value || '').length)
+ }, [limit, value])
- useEffect(() => {
- setCurrentCount(
- props.value ? props.limit - props.value.length : props.limit
- )
- }, [props.limit, props.value])
-
- function onChange(event: React.ChangeEvent) {
- setCurrentCount(props.limit - event.currentTarget.value.length)
- if (props.onChange) props.onChange(event)
+ // Event handlers
+ const handleInputChange = (event: React.ChangeEvent) => {
+ const { value: inputValue } = event.currentTarget
+ setCurrentCount(limit - inputValue.length)
+ if (onInputChange) {
+ onInputChange(event)
}
-
- return (
-
- )
}
-)
-export default CharLimitedFieldset
+ // Rendering methods
+ return (
+
+ )
+}
+
+export default forwardRef(CharLimitedFieldset)
diff --git a/components/common/DialogContent/index.scss b/components/common/DialogContent/index.scss
index 648441a0..7d1a311c 100644
--- a/components/common/DialogContent/index.scss
+++ b/components/common/DialogContent/index.scss
@@ -11,7 +11,7 @@
min-width: 100vw;
overflow-y: auto;
color: inherit;
- z-index: 40;
+ z-index: 10;
.DialogContent {
$multiplier: 4;
@@ -160,7 +160,8 @@
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.16);
border-top: 1px solid rgba(0, 0, 0, 0.24);
display: flex;
- flex-direction: column;
+ flex-direction: row;
+ justify-content: space-between;
padding: ($unit * 1.5) ($unit * $multiplier) $unit-3x;
position: sticky;
@@ -178,7 +179,6 @@
&.Spaced {
justify-content: space-between;
- width: 100%;
}
}
}
diff --git a/components/common/DurationInput/index.tsx b/components/common/DurationInput/index.tsx
index 91513838..42f11c1b 100644
--- a/components/common/DurationInput/index.tsx
+++ b/components/common/DurationInput/index.tsx
@@ -14,7 +14,10 @@ interface Props
}
const DurationInput = React.forwardRef(
- function DurationInput({ className, value, onValueChange }, forwardedRef) {
+ function DurationInput(
+ { className, value, onValueChange, ...props },
+ forwardedRef
+ ) {
// State
const [duration, setDuration] = useState('')
const [minutesSelected, setMinutesSelected] = useState(false)
@@ -202,7 +205,7 @@ const DurationInput = React.forwardRef(
},
className
)}
- value={`${getSeconds()}`.padStart(2, '0')}
+ value={getSeconds() > 0 ? `${getSeconds()}`.padStart(2, '0') : ''}
onChange={handleSecondsChange}
onKeyUp={handleKeyUp}
onKeyDown={handleKeyDown}
diff --git a/components/common/Input/index.scss b/components/common/Input/index.scss
index 897a2779..75a864fd 100644
--- a/components/common/Input/index.scss
+++ b/components/common/Input/index.scss
@@ -23,6 +23,11 @@
&:hover {
background-color: var(--input-bound-bg-hover);
}
+
+ &::placeholder {
+ /* Chrome, Firefox, Opera, Safari 10.1+ */
+ color: var(--text-tertiary) !important;
+ }
}
&.AlignRight {
@@ -43,7 +48,7 @@
width: 0;
}
-::placeholder {
+.Input::placeholder {
/* Chrome, Firefox, Opera, Safari 10.1+ */
color: var(--text-secondary) !important;
opacity: 1; /* Firefox */
diff --git a/components/common/InputTableField/index.scss b/components/common/InputTableField/index.scss
index 94544da9..e232dbfb 100644
--- a/components/common/InputTableField/index.scss
+++ b/components/common/InputTableField/index.scss
@@ -1,4 +1,3 @@
-.InputField.TableField .Input {
+.InputField.TableField .Input[type='number'] {
text-align: right;
- width: $unit-8x;
}
diff --git a/components/common/InputTableField/index.tsx b/components/common/InputTableField/index.tsx
index 26fdac25..a043d7ed 100644
--- a/components/common/InputTableField/index.tsx
+++ b/components/common/InputTableField/index.tsx
@@ -3,50 +3,60 @@ import Input from '~components/common/Input'
import TableField from '~components/common/TableField'
import './index.scss'
+import classNames from 'classnames'
-interface Props {
- name: string
+interface Props
+ extends React.DetailedHTMLProps<
+ React.InputHTMLAttributes,
+ HTMLInputElement
+ > {
label: string
description?: string
- placeholder?: string
- value?: number
- className?: string
imageAlt?: string
imageClass?: string
imageSrc?: string[]
- onValueChange: (value: number) => void
+ onValueChange: (value?: string) => void
}
-const InputTableField = (props: Props) => {
- const [value, setValue] = useState(0)
+const InputTableField = ({
+ label,
+ description,
+ imageAlt,
+ imageClass,
+ imageSrc,
+ ...props
+}: Props) => {
+ const [inputValue, setInputValue] = useState('')
useEffect(() => {
- if (props.value) setValue(props.value)
+ if (props.value) setInputValue(`${props.value}`)
}, [props.value])
useEffect(() => {
- props.onValueChange(value)
- }, [value])
+ props.onValueChange(inputValue)
+ }, [inputValue])
function onInputChange(event: React.ChangeEvent) {
- setValue(parseInt(event.currentTarget?.value))
+ setInputValue(`${parseInt(event.currentTarget?.value)}`)
}
return (
diff --git a/components/common/Overlay/index.scss b/components/common/Overlay/index.scss
index 34d953a6..850f5d8f 100644
--- a/components/common/Overlay/index.scss
+++ b/components/common/Overlay/index.scss
@@ -1,7 +1,7 @@
.Overlay {
isolation: isolate;
position: fixed;
- z-index: 30;
+ z-index: 9;
top: 0;
right: 0;
bottom: 0;
diff --git a/components/common/Popover/index.tsx b/components/common/Popover/index.tsx
index f334b6a7..83265154 100644
--- a/components/common/Popover/index.tsx
+++ b/components/common/Popover/index.tsx
@@ -23,6 +23,7 @@ interface Props extends ComponentProps<'div'> {
className?: string
placeholder?: string
}
+ triggerTabIndex?: number
value?: {
element: ReactNode
rawValue: string
@@ -83,6 +84,7 @@ const Popover = React.forwardRef(function Popover(
{icon}
{value}
diff --git a/components/common/Select/index.scss b/components/common/Select/index.scss
index 170dba71..ddf1fade 100644
--- a/components/common/Select/index.scss
+++ b/components/common/Select/index.scss
@@ -75,8 +75,8 @@
.Select {
background: var(--dialog-bg);
border-radius: $card-corner;
- border: $hover-stroke;
- box-shadow: $hover-shadow;
+ border: 1px solid rgba(0, 0, 0, 0.24);
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
padding: 0 $unit;
z-index: 40;
min-width: var(--radix-select-trigger-width);
diff --git a/components/common/SelectTableField/index.scss b/components/common/SelectTableField/index.scss
index e69de29b..57f5640d 100644
--- a/components/common/SelectTableField/index.scss
+++ b/components/common/SelectTableField/index.scss
@@ -0,0 +1,3 @@
+.SelectField.TableField .Right {
+ justify-content: flex-end;
+}
diff --git a/components/common/SelectTableField/index.tsx b/components/common/SelectTableField/index.tsx
index 2eded956..83e88b0e 100644
--- a/components/common/SelectTableField/index.tsx
+++ b/components/common/SelectTableField/index.tsx
@@ -31,6 +31,7 @@ const SelectTableField = (props: Props) => {
return (
{
disabled={disabled}
required={required}
value={value}
+ tabIndex={props.tabIndex}
onCheckedChange={onCheckedChange}
>
diff --git a/components/common/SwitchTableField/index.scss b/components/common/SwitchTableField/index.scss
index e69de29b..d7b95b2b 100644
--- a/components/common/SwitchTableField/index.scss
+++ b/components/common/SwitchTableField/index.scss
@@ -0,0 +1,9 @@
+.TableField.SwitchTableField {
+ &.Extra .Switch[data-state='checked'] {
+ background: var(--extra-purple-secondary);
+ }
+
+ .Right {
+ justify-content: end;
+ }
+}
diff --git a/components/common/SwitchTableField/index.tsx b/components/common/SwitchTableField/index.tsx
index db9c5352..2344572d 100644
--- a/components/common/SwitchTableField/index.tsx
+++ b/components/common/SwitchTableField/index.tsx
@@ -1,15 +1,18 @@
import { useEffect, useState } from 'react'
+import classNames from 'classnames'
import Switch from '~components/common/Switch'
import TableField from '~components/common/TableField'
import './index.scss'
-interface Props {
+interface Props extends React.HTMLAttributes {
name: string
label: string
description?: string
+ disabled?: boolean
value?: boolean
className?: string
+ tabIndex?: number
imageAlt?: string
imageClass?: string
imageSrc?: string[]
@@ -31,10 +34,19 @@ const SwitchTableField = (props: Props) => {
setValue(value)
}
+ const classes = classNames(
+ {
+ SwitchTableField: true,
+ Disabled: props.disabled,
+ },
+ props.className
+ )
+
return (
{
diff --git a/components/common/TableField/index.scss b/components/common/TableField/index.scss
index ede6eed9..100f9016 100644
--- a/components/common/TableField/index.scss
+++ b/components/common/TableField/index.scss
@@ -3,6 +3,7 @@
display: grid;
gap: $unit-2x;
grid-template-columns: 1fr auto;
+ min-height: $unit-6x;
justify-content: space-between;
padding: $unit-half 0;
width: 100%;
@@ -17,7 +18,30 @@
color: var(--accent-blue);
}
+ &.Numeric .Right > .Input,
+ &.Numeric .Right > .Duration {
+ text-align: right;
+ max-width: $unit-12x;
+ width: $unit-12x;
+ }
+
+ &.Numeric .Right > .Duration {
+ justify-content: flex-end;
+ box-sizing: border-box;
+ }
+
+ &.Disabled {
+ &:hover .Left .Info h3 {
+ color: var(--text-tertiary);
+ }
+
+ .Left .Info h3 {
+ color: var(--text-tertiary);
+ }
+ }
+
.Left {
+ align-items: center;
display: flex;
flex-direction: row;
gap: $unit;
@@ -59,7 +83,6 @@
color: var(--text-secondary);
font-size: $font-small;
line-height: 1.1;
- max-width: 300px;
&.jp {
max-width: 270px;
@@ -71,6 +94,7 @@
align-items: center;
display: flex;
flex-direction: row;
+ justify-content: flex-end;
gap: $unit-2x;
width: 100%;
diff --git a/components/common/TableField/index.tsx b/components/common/TableField/index.tsx
index 3b53aac9..b0d6bb1c 100644
--- a/components/common/TableField/index.tsx
+++ b/components/common/TableField/index.tsx
@@ -32,7 +32,7 @@ const TableField = (props: Props) => {
{props.label}
-
{props.description}
+ {props.description &&
{props.description}
}
{image()}
diff --git a/components/extra/ExtraWeaponsGrid/index.tsx b/components/extra/ExtraWeaponsGrid/index.tsx
index 6dc39c6d..c42cc618 100644
--- a/components/extra/ExtraWeaponsGrid/index.tsx
+++ b/components/extra/ExtraWeaponsGrid/index.tsx
@@ -11,12 +11,10 @@ import classNames from 'classnames'
// Props
interface Props {
grid: GridArray
- enabled: boolean
editable: boolean
found?: boolean
offset: number
removeWeapon: (id: string) => void
- updateExtra: (enabled: boolean) => void
updateObject: (object: SearchableObject, position: number) => void
updateUncap: (id: string, position: number, uncap: number) => void
}
@@ -26,12 +24,9 @@ const EXTRA_WEAPONS_COUNT = 3
const ExtraWeaponsGrid = ({
grid,
- enabled,
editable,
- found,
offset,
removeWeapon,
- updateExtra,
updateObject,
updateUncap,
}: Props) => {
@@ -40,16 +35,9 @@ const ExtraWeaponsGrid = ({
const classes = classNames({
ExtraWeapons: true,
ContainerItem: true,
- Disabled: !enabled,
})
- function onCheckedChange(checked: boolean) {
- updateExtra(checked)
- }
-
- const disabledElement = <>>
-
- const enabledElement = (
+ const extraWeapons = (