diff --git a/packages/components/src/icons/mapMarked/mod.tsx b/packages/components/src/icons/mapMarked/mod.tsx index 38fcbae..bf2f1c7 100644 --- a/packages/components/src/icons/mapMarked/mod.tsx +++ b/packages/components/src/icons/mapMarked/mod.tsx @@ -8,6 +8,7 @@ import type { IconProps } from '../common.js' const MapMarked: FC = ({ onClick, className, + cursor, size = 'medium', color = 'black', tabIndex = 0 @@ -29,6 +30,7 @@ const MapMarked: FC = ({ return ( = ({ + onClick, + className, + cursor, + size = 'medium', + color = 'black', + tabIndex = 0 +}) => { + const handleOnClick = useCallback(() => { + if (typeof onClick === 'function') { + onClick() + } + }, [onClick]) + const onKeyDown = useCallback( + (evt: KeyboardEvent) => { + if (evt.code === 'Enter') { + handleOnClick() + } + }, + [handleOnClick] + ) + + return ( + + + + + + ) +} + +export { SignIn } +export type { IconProps } diff --git a/packages/components/src/icons/signIn/story.tsx b/packages/components/src/icons/signIn/story.tsx new file mode 100644 index 0000000..4019ec6 --- /dev/null +++ b/packages/components/src/icons/signIn/story.tsx @@ -0,0 +1,31 @@ +import { SignIn } from './mod.js' + +import type { StoryFn } from '@storybook/react' + +const Primary: StoryFn = args => { + return +} + +export default { + title: 'Icons/SignIn', + component: SignIn, + args: { + outlined: false, + size: 'medium', + color: '#c1c1c1', + tabIndex: 0 + }, + argTypes: { + size: { + control: 'select', + options: ['small', 'medium', 'large'] + }, + color: { + control: 'color' + }, + onClick: { + action: 'onClick' + } + } +} +export { Primary } diff --git a/packages/components/src/icons/signOut/mod.tsx b/packages/components/src/icons/signOut/mod.tsx new file mode 100644 index 0000000..7e08ac5 --- /dev/null +++ b/packages/components/src/icons/signOut/mod.tsx @@ -0,0 +1,47 @@ +import { useCallback } from 'react' + +import { Icon } from '../common.js' + +import type { FC, KeyboardEvent } from 'react' +import type { IconProps } from '../common.js' + +const SignOut: FC = ({ + onClick, + className, + cursor, + size = 'medium', + color = 'black', + tabIndex = 0 +}) => { + const handleOnClick = useCallback(() => { + if (typeof onClick === 'function') { + onClick() + } + }, [onClick]) + const onKeyDown = useCallback( + (evt: KeyboardEvent) => { + if (evt.code === 'Enter') { + handleOnClick() + } + }, + [handleOnClick] + ) + + return ( + + + + + + ) +} + +export { SignOut } +export type { IconProps } diff --git a/packages/components/src/icons/signOut/story.tsx b/packages/components/src/icons/signOut/story.tsx new file mode 100644 index 0000000..3f8afbd --- /dev/null +++ b/packages/components/src/icons/signOut/story.tsx @@ -0,0 +1,31 @@ +import { SignOut } from './mod.js' + +import type { StoryFn } from '@storybook/react' + +const Primary: StoryFn = args => { + return +} + +export default { + title: 'Icons/SignOut', + component: SignOut, + args: { + outlined: false, + size: 'medium', + color: '#c1c1c1', + tabIndex: 0 + }, + argTypes: { + size: { + control: 'select', + options: ['small', 'medium', 'large'] + }, + color: { + control: 'color' + }, + onClick: { + action: 'onClick' + } + } +} +export { Primary } diff --git a/packages/ui/index.html b/packages/ui/index.html index a2b1bf8..de3623c 100644 --- a/packages/ui/index.html +++ b/packages/ui/index.html @@ -2,7 +2,7 @@ - BusMap + Busmap @@ -28,6 +28,7 @@ referrerpolicy="no-referrer" /> +
diff --git a/packages/ui/src/components/authnCallback.tsx b/packages/ui/src/components/authnCallback.tsx new file mode 100644 index 0000000..e3f72b4 --- /dev/null +++ b/packages/ui/src/components/authnCallback.tsx @@ -0,0 +1,7 @@ +import type { FC } from 'react' + +const AuthnCallback: FC = () => { + return null +} + +export { AuthnCallback } diff --git a/packages/ui/src/components/navigation.tsx b/packages/ui/src/components/navigation.tsx index 4e0fd46..236b773 100644 --- a/packages/ui/src/components/navigation.tsx +++ b/packages/ui/src/components/navigation.tsx @@ -6,9 +6,11 @@ import { Bus } from '@busmap/components/icons/bus' import { Cog } from '@busmap/components/icons/cog' import { InfoCircle } from '@busmap/components/icons/infoCircle' import { Exchange } from '@busmap/components/icons/exchange' +import { SignIn } from '@busmap/components/icons/signIn' import { SO, SDB, + PB10T, PB70T, PB80T, PB30T, @@ -35,11 +37,11 @@ const Nav = styled.nav<{ mode: Mode }>` ul { margin: 0; - padding: 12px 0 0; + padding: 6px 0 0; list-style: none; display: flex; flex-direction: column; - gap: 8px; + gap: 4px; width: 48px; height: 100%; } @@ -65,19 +67,19 @@ const Nav = styled.nav<{ mode: Mode }>` } &.active { - color: ${({ mode }) => (mode === 'light' ? PB30T : `${PB90T}`)}; + color: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; svg { - color: ${({ mode }) => (mode === 'light' ? PB30T : `${PB90T}`)}; + color: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; } } &:hover { cursor: pointer; - color: ${({ mode }) => (mode === 'light' ? PB30T : `${PB90T}`)}; + color: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; svg { - color: ${({ mode }) => (mode === 'light' ? PB30T : `${PB90T}`)}; + color: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; } } @@ -86,7 +88,7 @@ const Nav = styled.nav<{ mode: Mode }>` height: 16px; } - span:last-child { + span:nth-of-type(2) { display: none; } } @@ -108,18 +110,56 @@ const Nav = styled.nav<{ mode: Mode }>` } } - li:last-child { - margin-top: auto; + li:nth-child(2) { + margin: 6px 0; + border: 1px solid ${({ mode }) => (mode === 'light' ? PB80T : PB50T)}; + border-right: none; + border-left: none; + background: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; button { - color: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; + padding: 3px 5px; + white-space: nowrap; + flex-direction: row; + justify-content: center; + color: ${({ mode }) => (mode === 'light' ? PB70T : PB40T)}; - svg { + span { + width: auto; + height: auto; + font-weight: bold; + + &:last-child { + width: 10px; + height: 10px; + } + } + + &:hover { + svg { + color: ${({ mode }) => (mode === 'light' ? PB70T : PB40T)}; + } + } + } + + &.active { + width: calc(100% + 1px); + background: ${({ mode }) => (mode === 'light' ? '#fffc' : `${PB10T}cc`)}; + + button { color: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; + + svg { + color: ${({ mode }) => (mode === 'light' ? PB30T : PB90T)}; + } } } } + li:last-child { + margin-top: auto; + } + @media (width >= 431px) and (height >= 536px) { ul { width: 78px; @@ -131,7 +171,7 @@ const Nav = styled.nav<{ mode: Mode }>` height: 24px; } - span:last-child { + span:nth-of-type(2) { display: block; } } @@ -161,25 +201,31 @@ const Navigation: FC = () => { return (