diff --git a/client/package.json b/client/package.json index 115566c0b..5faa02bd9 100644 --- a/client/package.json +++ b/client/package.json @@ -3,12 +3,12 @@ "version": "1.9.6", "private": true, "dependencies": { - "@chakra-ui/react": "2.3.4", + "@chakra-ui/react": "^2.4.1", "@dnd-kit/core": "^6.0.5", "@dnd-kit/sortable": "^7.0.1", "@dnd-kit/utilities": "^3.2.0", - "@emotion/react": "^11.10.4", - "@emotion/styled": "^11.10.4", + "@emotion/react": "^11.10.5", + "@emotion/styled": "^11.10.5", "@react-icons/all-files": "^4.1.0", "@tanstack/react-query": "^4.10.3", "@tanstack/react-query-devtools": "^4.11.0", @@ -61,7 +61,7 @@ "@types/react-dom": "^18.0.6", "@typescript-eslint/eslint-plugin": "^5.37.0", "@typescript-eslint/parser": "^5.37.0", - "@vitejs/plugin-react": "^2.1.0", + "@vitejs/plugin-react": "^2.2.0", "eslint": "^8.25.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-jest": "^27.0.4", @@ -77,10 +77,10 @@ "stylelint-config-prettier": "^9.0.3", "stylelint-config-standard-scss": "^4.0.0", "typescript": "^4.8.3", - "vite": "^3.1.6", - "vite-plugin-svgr": "^2.2.1", - "vite-tsconfig-paths": "^3.5.0", - "vitest": "^0.23.2" + "vite": "^3.2.4", + "vite-plugin-svgr": "^2.2.2", + "vite-tsconfig-paths": "^3.6.0", + "vitest": "^0.25.3" }, "resolutions": { "**/@types/react": "18.0.21" diff --git a/client/src/common/components/buttons/ActionButtons.tsx b/client/src/common/components/buttons/ActionButtons.tsx deleted file mode 100644 index 62344a52c..000000000 --- a/client/src/common/components/buttons/ActionButtons.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { IconButton, Menu, MenuButton, MenuItem, MenuList, Tooltip } from '@chakra-ui/react'; -import { FiClock } from '@react-icons/all-files/fi/FiClock'; -import { FiMinusCircle } from '@react-icons/all-files/fi/FiMinusCircle'; -import { FiPlus } from '@react-icons/all-files/fi/FiPlus'; - -interface ActionButtonProps { - showAdd?: boolean; - showDelay?: boolean; - showBlock?: boolean; - actionHandler: (action: string) => void; -} - -export default function ActionButtons(props: ActionButtonProps) { - const { showAdd, showDelay, showBlock, actionHandler } = props; - - const menuStyle = { - color: '#000000', - backgroundColor: 'rgba(255,255,255,1)', - }; - - return ( - - - } - colorScheme='white' - variant='outline' - /> - - - } onClick={() => actionHandler('event')} isDisabled={!showAdd}> - Add Event after - - - } onClick={() => actionHandler('delay')} isDisabled={!showDelay}> - Add Delay after - - } - onClick={() => actionHandler('block')} - isDisabled={!showBlock} - > - Add Block after - - - - ); -} diff --git a/client/src/common/components/buttons/QuitIconBtn.tsx b/client/src/common/components/buttons/QuitIconBtn.tsx index 5c35b1f37..1c16afc50 100644 --- a/client/src/common/components/buttons/QuitIconBtn.tsx +++ b/client/src/common/components/buttons/QuitIconBtn.tsx @@ -19,6 +19,23 @@ interface QuitIconBtnProps { clickHandler: () => void; size?: Size; } + +const quitBtnStyle = { + color: '#D20300', // $red-700 + borderColor: '#D20300', // $red-700 + _focus: { boxShadow: 'none' }, + _hover: { + background: '#D20300', // $red-700 + color: 'white', + }, + _active: { + background: '#9A0000', // $red-1000 + color: 'white', + }, + variant: 'outline', + isRound: true, +}; + export default function QuitIconBtn(props: QuitIconBtnProps) { const { clickHandler, size = 'lg', ...rest } = props; const [isOpen, setIsOpen] = useState(false); @@ -47,11 +64,8 @@ export default function QuitIconBtn(props: QuitIconBtnProps) { aria-label='Quit Application' size={size} icon={} - colorScheme='red' - variant='outline' - isRound onClick={() => setIsOpen(true)} - _focus={{ boxShadow: 'none' }} + {...quitBtnStyle} {...rest} /> @@ -59,7 +73,7 @@ export default function QuitIconBtn(props: QuitIconBtnProps) { - Server Shutdown + Ontime Shutdown This will shutdown the program and all running servers. Are you sure? diff --git a/client/src/common/components/collapseBar/CollapseBar.jsx b/client/src/common/components/collapseBar/CollapseBar.jsx deleted file mode 100644 index c2fcf2e60..000000000 --- a/client/src/common/components/collapseBar/CollapseBar.jsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Icon } from '@chakra-ui/react'; -import { FiChevronUp } from '@react-icons/all-files/fi/FiChevronUp'; -import PropTypes from 'prop-types'; - -import style from './CollapseBar.module.scss'; - -export default function CollapseBar(props) { - const { title = 'Collapse bar', isCollapsed, onClick } = props; - - return ( -
- {title} - -
- ); -} -CollapseBar.propTypes = { - title: PropTypes.string, - isCollapsed: PropTypes.bool, - onClick: PropTypes.func, -}; diff --git a/client/src/common/components/collapseBar/CollapseBar.module.scss b/client/src/common/components/collapseBar/CollapseBar.module.scss index cda8e11e4..290a15e70 100644 --- a/client/src/common/components/collapseBar/CollapseBar.module.scss +++ b/client/src/common/components/collapseBar/CollapseBar.module.scss @@ -1,27 +1,23 @@ -@use '../../../theme/main' as *; +@use '../../../theme/v2Styles' as *; .header { - padding: 0; - margin: 0; - font-size: 0.9em; + font-size: $inner-section-text-size; + font-weight: 600; display: flex; justify-content: space-between; - color: $header-gray; -} - - -.moreExpanded, -.moreCollapsed { + color: $section-white; + border-bottom: 1px solid $border-color-ondark; + padding-bottom: $element-inner-spacing; + margin-bottom: $element-spacing; cursor: pointer; - color: $text-white; } .moreExpanded { transform: scaleY(-1); - transition: transform 0.3s; + transition: transform $transition-time-feedback; } .moreCollapsed { transform: scaleY(1); - transition: transform 0.3s; + transition: transform $transition-time-feedback; } diff --git a/client/src/common/components/collapseBar/CollapseBar.tsx b/client/src/common/components/collapseBar/CollapseBar.tsx new file mode 100644 index 000000000..820462662 --- /dev/null +++ b/client/src/common/components/collapseBar/CollapseBar.tsx @@ -0,0 +1,20 @@ +import { FiChevronUp } from '@react-icons/all-files/fi/FiChevronUp'; + +import style from './CollapseBar.module.scss'; + +interface CollapseBarProps { + title: string; + isCollapsed: boolean; + onClick: () => void; +} + +export default function CollapseBar(props: CollapseBarProps) { + const { title = 'Collapse bar', isCollapsed, onClick } = props; + + return ( +
+ {title} + +
+ ); +} diff --git a/client/src/common/components/copy-tag/CopyTag.tsx b/client/src/common/components/copy-tag/CopyTag.tsx new file mode 100644 index 000000000..aa3e8c328 --- /dev/null +++ b/client/src/common/components/copy-tag/CopyTag.tsx @@ -0,0 +1,35 @@ +import { PropsWithChildren } from 'react'; +import { Button, ButtonGroup, IconButton, Tooltip } from '@chakra-ui/react'; +import { IoCopy } from '@react-icons/all-files/io5/IoCopy'; + +import { tooltipDelayFast } from '../../../ontimeConfig'; +import { Size } from '../../models/UtilTypes'; + +interface CopyTagProps { + label: string; + className?: string; + size?: Size; +} + +export default function CopyTag(props: PropsWithChildren) { + const { label, className, size = 'xs', children } = props; + + return ( + + + + } + variant='ontime-filled' + tabIndex={-1} + onClick={() => navigator.clipboard.writeText(children as string)} + /> + + + ); +} diff --git a/client/src/common/components/countdown/TimerDisplay.scss b/client/src/common/components/countdown/TimerDisplay.scss index bc0db663a..fd3739c02 100644 --- a/client/src/common/components/countdown/TimerDisplay.scss +++ b/client/src/common/components/countdown/TimerDisplay.scss @@ -1,7 +1,7 @@ @use '../../../theme/viewerDefs' as *; .timer { - font-family: 'Open Sans', sans-serif; + font-family: var(--font-family-override, $ontime-font-family); color: var(--timer-color-override, $viewer-color); font-size: 21vw; line-height: 21vw; @@ -9,7 +9,7 @@ letter-spacing: 1vw; &--small { - font-size: 4em; + font-size: 3.75em; line-height: 0.9; text-align: center; letter-spacing: 0.1em; diff --git a/client/src/common/components/input/AutoTextArea.jsx b/client/src/common/components/input/AutoTextArea.jsx deleted file mode 100644 index 0dbeb8626..000000000 --- a/client/src/common/components/input/AutoTextArea.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import { useEffect, useRef } from 'react'; -import { Textarea } from '@chakra-ui/react'; -import autosize from 'autosize/dist/autosize'; - -export const AutoTextArea = (props) => { - const ref = useRef(); - - useEffect(() => { - const node = ref.current; - autosize(ref.current); - return () => { - autosize.destroy(node); - }; - }, []); - - - return ( -