Skip to content

Commit

Permalink
chore: misc tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Jan 4, 2025
1 parent 3193476 commit 11e8a1b
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/ui-core/src/base/ButtonRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only

import classNames from 'classnames'
import type { RowProps } from '../../types'
import type { RowProps } from '../types'
import classes from './index.module.scss'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/base/PageRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only

import classNames from 'classnames'
import type { RowProps } from '../../types'
import type { RowProps } from '../types'
import classes from './index.module.scss'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/base/PageTitle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classNames from 'classnames'
import { useEffect, useRef, useState } from 'react'
import { ButtonSecondary } from 'ui-buttons'
import { PageTitleTabs } from 'ui-core/base'
import type { PageTitleProps } from '../../types'
import type { PageTitleProps } from '../types'
import classes from './index.module.scss'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/base/PageTitleTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import classNames from 'classnames'
import { ButtonTab } from 'ui-buttons'
import type { PageTitleProps, PageTitleTabProps } from '../../types'
import type { PageTitleProps, PageTitleTabProps } from '../types'
import classes from './index.module.scss'

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import type { ComponentBase } from '@w3ux/types'

export type RowProps = ComponentBase & {
// whether there is margin space vertically.
yMargin?: boolean
}

Expand All @@ -20,23 +19,15 @@ export type PageTitleProps = PageTitleTabsProps & {
}

export interface PageTitleTabsProps {
// whether the title stick on the same position.
sticky?: boolean
// an array of tab pages.
tabs?: PageTitleTabProps[]
}

export interface PageTitleTabProps {
// whether the title stick on the same position.
sticky?: boolean
// title of the tab button.
title: string
// whether it is clicked.
active: boolean
// it leads to the corresponding tab page.
onClick: () => void
// a badge that can have a glance at before visting the tab page.
badge?: string | number
// whether the tab button is disabled.
disabled?: boolean
}
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/Backdrop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import classNames from 'classnames'
import { motion } from 'framer-motion'
import type { ModalOverlayProps } from '../../../../ui-overlay/src/types'
import commonClasses from '../common.module.scss'
import type { ModalOverlayProps } from '../types'
import classes from './index.module.scss'

export const Backdrop = ({ children, blur, ...rest }: ModalOverlayProps) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/CanvasContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import classNames from 'classnames'
import { motion } from 'framer-motion'
import type { ModalAnimationProps } from '../../../../ui-overlay/src/types'
import commonClasses from '../common.module.scss'
import type { ModalAnimationProps } from '../types'
import classes from './index.module.scss'

export const CanvasContainer = ({ children, ...rest }: ModalAnimationProps) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/CanvasScroll/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only

import { motion } from 'framer-motion'
import type { CanvasScrollProps } from '../../../../ui-overlay/src/types'
import type { CanvasScrollProps } from '../types'
import classes from './index.module.scss'

export const CanvasScroll = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import classNames from 'classnames'
import type { ForwardedRef } from 'react'
import { forwardRef } from 'react'
import type { ModalCardProps } from '../../../../ui-overlay/src/types'
import type { ModalCardProps } from '../types'
import classes from './index.module.scss'

export const ModalCard = forwardRef(
Expand Down
14 changes: 7 additions & 7 deletions packages/ui-core/src/overlay/ModalContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

import classNames from 'classnames'
import { motion } from 'framer-motion'
import { useOverlay } from '../../../../ui-overlay/src/Provider'
import type { ModalAnimationProps } from '../../../../ui-overlay/src/types'
import commonClasses from '../common.module.scss'
import type { ModalContainerProps } from '../types'
import classes from './index.module.scss'

export const ModalContainer = ({ children, ...rest }: ModalAnimationProps) => {
const {
modal: { setModalStatus },
} = useOverlay()
export const ModalContainer = ({
children,
onClose,
...rest
}: ModalContainerProps) => {
const allClasses = classNames(
commonClasses.fixedPosition,
classes.modalContainer
Expand All @@ -23,7 +23,7 @@ export const ModalContainer = ({ children, ...rest }: ModalAnimationProps) => {
<button
type="button"
className={classes.close}
onClick={() => setModalStatus('closing')}
onClick={() => onClose()}
>
&nbsp;
</button>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import classNames from 'classnames'
import { motion } from 'framer-motion'
import type { ModalContentProps } from '../../../../ui-overlay/src/types'
import type { ModalContentProps } from '../types'
import classes from './index.module.scss'

export const ModalContent = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalFixedTitle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import classNames from 'classnames'
import type { ForwardedRef } from 'react'
import { forwardRef } from 'react'
import type { ModalFixedTitleProps } from '../../../../ui-overlay/src/types'
import type { ModalFixedTitleProps } from '../types'
import classes from './index.module.scss'

export const ModalFixedTitle = forwardRef(
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalMultiThree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import classNames from 'classnames'
import { motion } from 'framer-motion'
import type { ModalAnimationProps } from '../../../../ui-overlay/src/types'
import commonClasses from '../common.module.scss'
import type { ModalAnimationProps } from '../types'
import classes from './index.module.scss'

export const ModalMultiThree = ({ children, ...rest }: ModalAnimationProps) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalMultiTwo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import classNames from 'classnames'
import { motion } from 'framer-motion'
import type { ModalAnimationProps } from '../../../../ui-overlay/src/types'
import commonClasses from '../common.module.scss'
import type { ModalAnimationProps } from '../types'
import classes from './index.module.scss'

export const ModalMultiTwo = ({ children, ...rest }: ModalAnimationProps) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalNotes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only

import classNames from 'classnames'
import type { ModalNotesProps } from '../../../../ui-overlay/src/types'
import type { ModalNotesProps } from '../types'
import classes from './index.module.scss'

export const ModalNotes = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalPadding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import classNames from 'classnames'
import type { ForwardedRef } from 'react'
import { forwardRef } from 'react'
import type { ModalPaddingProps } from '../../../../ui-overlay/src/types'
import type { ModalPaddingProps } from '../types'
import classes from './index.module.scss'

export const ModalPadding = forwardRef(
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalScroll/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import classNames from 'classnames'
import type { ForwardedRef } from 'react'
import { forwardRef } from 'react'
import type { ModalScrollProps } from '../../../../ui-overlay/src/types'
import commonClasses from '../common.module.scss'
import type { ModalScrollProps } from '../types'
import classes from './index.module.scss'

export const ModalScroll = forwardRef(
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/src/overlay/ModalSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only

import classNames from 'classnames'
import type { ModalSectionProps } from '../../../../ui-overlay/src/types'
import type { ModalSectionProps } from '../types'
import classes from './index.module.scss'

export const ModalSection = ({ children, style, type }: ModalSectionProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ export type ModalScrollProps = ComponentBase & {
export type ModalSectionProps = ComponentBase & {
type: 'tab' | 'carousel'
}

export type ModalContainerProps = ModalAnimationProps & {
onClose: () => void
}
1 change: 1 addition & 0 deletions packages/ui-overlay/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export const Modal = ({
},
}}
style={{ opacity: status === 'opening' ? 0 : 1 }}
onClose={() => setModalStatus('closing')}
>
<ModalScroll
ref={heightRef}
Expand Down

0 comments on commit 11e8a1b

Please sign in to comment.