diff --git a/frontend/packages/ui/constants.ts b/frontend/packages/ui/constants.ts index 18bfeec..5d7c26b 100644 --- a/frontend/packages/ui/constants.ts +++ b/frontend/packages/ui/constants.ts @@ -1,11 +1,11 @@ import { MantineRadius, MantineSpacing } from '@mantine/core'; -export const APP_SHELL_HEADER_HEIGHT = 0; +export const APP_SHELL_HEADER_HEIGHT = 54; export const PAGE_SHELL_TAB_BAR_HEIGHT = 46; -export const PROJECT_APP_SHELL_NAVBAR_WIDTH = 64; +export const PROJECT_APP_SHELL_NAVBAR_WIDTH = 60; export const HASURA_BLUE = '#3970FD'; export const APP_SHELL_ID = 'hasura-app-shell'; -export const FONT_SIZE = 14; + export const MAX_CONTENT_WIDTH = 1280; export const CONTENT_PADDING: MantineSpacing = 'md'; export const CONTENT_MARGIN: MantineSpacing = 'md'; diff --git a/frontend/packages/ui/core/acceptable-list/AcceptableList.stories.tsx b/frontend/packages/ui/core/acceptable-list/AcceptableList.stories.tsx index ca7096a..3ddc7b5 100644 --- a/frontend/packages/ui/core/acceptable-list/AcceptableList.stories.tsx +++ b/frontend/packages/ui/core/acceptable-list/AcceptableList.stories.tsx @@ -38,9 +38,7 @@ const args: StoryObj>['args'] = { decliningIds: [], // @ts-ignore getItemId: item => item.id, - acceptAllButton: { - onClick: action('acceptAll'), - }, + onAcceptAll: action('onAcceptAll'), // @ts-ignore renderItemDetail: item => { return
{item.label}
; diff --git a/frontend/packages/ui/core/acceptable-list/AcceptableList.tsx b/frontend/packages/ui/core/acceptable-list/AcceptableList.tsx index 7f5df36..2acdd86 100644 --- a/frontend/packages/ui/core/acceptable-list/AcceptableList.tsx +++ b/frontend/packages/ui/core/acceptable-list/AcceptableList.tsx @@ -19,6 +19,7 @@ export function AcceptableList({ items, onAccept, onDecline, + onAcceptAll, acceptingAll, acceptAllButton, acceptingIds, @@ -30,20 +31,21 @@ export function AcceptableList({ }: AcceptableListProps) { return ( - {acceptAllButton && ( + {onAcceptAll && ( <> diff --git a/frontend/packages/ui/core/acceptable-list/types.ts b/frontend/packages/ui/core/acceptable-list/types.ts index 36871c8..9c02f13 100644 --- a/frontend/packages/ui/core/acceptable-list/types.ts +++ b/frontend/packages/ui/core/acceptable-list/types.ts @@ -19,9 +19,9 @@ export type AcceptableListProps = { acceptingAll: boolean; // do not allow loader customization, but otherwise allow customization acceptAllButton?: Omit & { - onClick: () => void; label?: string; }; + onAcceptAll: () => void; acceptingIds: string[]; decliningIds: string[]; getItemId: (item: ItemType) => string; diff --git a/frontend/packages/ui/core/animated-border-box/AnimatedBorderBox.tsx b/frontend/packages/ui/core/animated-border-box/AnimatedBorderBox.tsx new file mode 100644 index 0000000..034301e --- /dev/null +++ b/frontend/packages/ui/core/animated-border-box/AnimatedBorderBox.tsx @@ -0,0 +1,92 @@ +/* eslint-disable react/no-danger */ +import React from 'react'; +import { Paper, PaperProps } from '@mantine/core'; + +import { ExtendedCustomColors } from '@/types'; + +export type AnimatedBorderProps = { + primaryColor?: ExtendedCustomColors; + secondaryColor?: ExtendedCustomColors; + shade?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; +}; + +const css = (props?: AnimatedBorderProps): TrustedHTML => { + const { + primaryColor = 'indigo', + secondaryColor = 'pink', + shade = 3, + } = props ?? {}; + + const css = ` + /*test */ +.animated-border-box { + --border-angle: 0turn; + --main-bg: conic-gradient( + from var(--border-angle), + var(--mantine-color-background-1), + var(--mantine-color-background-1) 5%, + var(--mantine-color-background-2) 60%, + var(--mantine-color-background-3) 95% + ); + + --gradient-border: conic-gradient( + from var(--border-angle), + transparent 25%, + light-dark(var(--mantine-color-${primaryColor}-${shade}), var(--mantine-color-${primaryColor}-${shade})), + light-dark(var(--mantine-color-${secondaryColor}-${shade - 1}), var(--mantine-color-${secondaryColor}-${shade - 1})) 99%, + transparent + ); + + background: + var(--main-bg) padding-box, + var(--gradient-border) border-box, + var(--main-bg) border-box; + + background-position: center center; + + animation: bg-spin 4s linear infinite; +} + +@keyframes bg-spin { + to { + --border-angle: 1turn; + } +} + +.animated-border-box:hover { + animation-play-state: paused; +} + +@property --border-angle { + syntax: ''; + inherits: true; + initial-value: 0turn; +} +`; + + return css; +}; + +export const AnimatedBorderBox = ({ + children, + animationProps, + ...props +}: { + children: React.ReactNode; + animationProps?: AnimatedBorderProps; +} & PaperProps) => { + return ( + <> +