Skip to content

Commit

Permalink
chore: DecoratorsTypeの設置場所を移動
Browse files Browse the repository at this point in the history
  • Loading branch information
AtsushiM committed Jan 23, 2025
1 parent 3bb40d3 commit 5ef9eda
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 37 deletions.
2 changes: 1 addition & 1 deletion packages/smarthr-ui/src/components/Browser/Browser.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, KeyboardEventHandler, useCallback, useMemo } from 'react'
import { tv } from 'tailwind-variants'

import { DecoratorsType } from '../../types'
import { type DecoratorsType } from '../../libs/decorator'
import { Text } from '../Text'

import { BrowserColumn } from './BrowserColumn'
Expand Down
2 changes: 1 addition & 1 deletion packages/smarthr-ui/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { ButtonHTMLAttributes, forwardRef, useMemo } from 'react'
import { tv } from 'tailwind-variants'

import { usePortal } from '../../hooks/usePortal'
import { DecoratorsType } from '../../types'
import { type DecoratorsType } from '../../libs/decorator'
import { Loader } from '../Loader'
import { VisuallyHiddenText } from '../VisuallyHiddenText'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useId } from 'react'
import innerText from 'react-innertext'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../../libs/decorator'
import { useOuterClick } from '../../../hooks/useOuterClick'
import { genericsForwardRef } from '../../../libs/util'
import { textColor } from '../../../themes'
Expand All @@ -26,7 +27,6 @@ import { useOptions } from '../useOptions'
import { MultiSelectedItem } from './MultiSelectedItem'
import { hasParentElementByClassName } from './multiComboBoxHelper'

import type { DecoratorsType } from '../../../types'
import type { BaseProps, ComboBoxItem } from '../types'

type Props<T> = BaseProps<T> & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import React, {
import innerText from 'react-innertext'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../../libs/decorator'
import { useClick } from '../../../hooks/useClick'
import { genericsForwardRef } from '../../../libs/util'
import { textColor } from '../../../themes'
Expand All @@ -25,7 +26,6 @@ import { Input } from '../../Input'
import { useListBox } from '../useListBox'
import { useOptions } from '../useOptions'

import type { DecoratorsType } from '../../../types'
import type { BaseProps, ComboBoxItem } from '../types'

type Props<T> = BaseProps<T> & {
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/ComboBox/useListBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import React, {
} from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../libs/decorator'
import { useEnhancedEffect } from '../../hooks/useEnhancedEffect'
import { usePortal } from '../../hooks/usePortal'
import { spacing } from '../../themes'
Expand All @@ -23,8 +24,6 @@ import { ComboBoxItem, ComboBoxOption } from './types'
import { useActiveOption } from './useActiveOption'
import { usePartialRendering } from './usePartialRendering'

import type { DecoratorsType } from '../../types'

type Props<T> = {
options: Array<ComboBoxOption<T>>
dropdownHelpMessage?: ReactNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import React, { type FC, type PropsWithChildren, type ReactNode, useCallback } from 'react'

import { type DecoratorsType } from '../../../libs/decorator'
import { Button } from '../../Button'
import { Cluster, Stack } from '../../Layout'
import { ResponseMessage } from '../../ResponseMessage'
import { DialogBody, type Props as DialogBodyProps } from '../DialogBody'
import { DialogHeader, type Props as DialogHeaderProps } from '../DialogHeader'
import { dialogContentInner } from '../dialogInnerStyle'

import type { DecoratorsType, ResponseMessageType } from '../../../types'
import type { ResponseMessageType } from '../../../types'

export type BaseProps = PropsWithChildren<
DialogHeaderProps &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React, {
} from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../../libs/decorator'
import { Button } from '../../Button'
import { Cluster, Stack } from '../../Layout'
import { ResponseMessage } from '../../ResponseMessage'
Expand All @@ -15,7 +16,7 @@ import { DialogBody, Props as DialogBodyProps } from '../DialogBody'
import { DialogHeader, type Props as DialogHeaderProps } from '../DialogHeader'
import { dialogContentInner } from '../dialogInnerStyle'

import type { DecoratorsType, ResponseMessageType } from '../../../types'
import type { ResponseMessageType } from '../../../types'

export type BaseProps = PropsWithChildren<
DialogHeaderProps &
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, { type FC } from 'react'

import { type DecoratorsType } from '../../../libs/decorator'
import { Button } from '../../Button'
import { Cluster, Stack } from '../../Layout'
import { DialogBody, Props as DialogBodyProps } from '../DialogBody'
import { DialogHeader, Props as DialogHeaderProps } from '../DialogHeader'
import { dialogContentInner } from '../dialogInnerStyle'

import type { DecoratorsType } from '../../../types'

export type BaseProps = DialogHeaderProps &
DialogBodyProps & {
/** ダイアログの説明 */
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/Dialog/ModelessDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import React, {
import Draggable from 'react-draggable'
import { VariantProps, tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../libs/decorator'
import { useHandleEscape } from '../../hooks/useHandleEscape'
import { spacing } from '../../themes'
import { Base, BaseElementProps } from '../Base'
Expand All @@ -27,8 +28,6 @@ import { DialogBody, type Props as DialogBodyProps } from './DialogBody'
import { DialogOverlap } from './DialogOverlap'
import { useDialogPortal } from './useDialogPortal'

import type { DecoratorsType } from '../../types'

type Props = PropsWithChildren<{
/**
* ダイアログのヘッダ部分の内容
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/DropZone/DropZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import React, {
} from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../libs/decorator'
import { Button } from '../Button'
import { FaFolderOpenIcon } from '../Icon'

import type { DecoratorsType } from '../../types'

const dropZone = tv({
slots: {
wrapper: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { ComponentProps, FC, ReactNode, useMemo } from 'react'
import innerText from 'react-innertext'
import { tv } from 'tailwind-variants'

import { type DecoratorType, type DecoratorsType } from '../../../libs/decorator'
import { Button, BaseProps as ButtonProps } from '../../Button'
import { FaCircleCheckIcon, FaFilterIcon, FaRotateLeftIcon } from '../../Icon'
import { Cluster, Stack } from '../../Layout'
Expand All @@ -13,7 +14,7 @@ import { DropdownCloser } from '../DropdownCloser'
import { DropdownContent } from '../DropdownContent'
import { DropdownTrigger } from '../DropdownTrigger'

import type { DecoratorType, DecoratorsType, ResponseMessageType } from '../../../types'
import type { ResponseMessageType } from '../../../types'

type Props = {
isFiltered?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React, { ComponentPropsWithRef } from 'react'
import { type FC, type MouseEventHandler } from 'react'

import { type DecoratorsType } from '../../../libs/decorator'
import { Button } from '../../Button'
import { Fieldset } from '../../Fieldset'
import { FormControl } from '../../FormControl'
Expand All @@ -16,8 +17,6 @@ import { DropdownTrigger } from '../DropdownTrigger'

import { useSortDropdown } from './useSortDropdown'

import type { DecoratorsType } from '../../../types'

type SortFieldType = {
value: string
} & Omit<React.OptionHTMLAttributes<HTMLOptionElement>, 'value'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { HTMLAttributes, ReactNode, useMemo } from 'react'
import { VariantProps, tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../../libs/decorator'
import { Button } from '../../Button'
import { Dropdown, DropdownContent, DropdownTrigger } from '../../Dropdown'
import { Heading } from '../../Heading'
Expand All @@ -9,8 +10,6 @@ import { Cluster, Stack } from '../../Layout'
import { Section } from '../../SectioningContent'
import { TextLink } from '../../TextLink'

import type { DecoratorsType } from '../../../types'

type Category = {
type?: string
heading: ReactNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import React, { HTMLAttributes, useMemo } from 'react'
import { VariantProps, tv } from 'tailwind-variants'

import { tabbable } from '../../../libs/tabbable'
import { type DecoratorsType } from '../../../libs/decorator'
import { Button } from '../../Button'
import { Dropdown, DropdownContent, DropdownTrigger } from '../../Dropdown'
import { FaCaretDownIcon, FaCheckIcon, FaGlobeIcon, LanguageIcon } from '../../Icon'

import type { DecoratorsType, LocaleMap } from '../../../types'
import type { LocaleMap } from '../../../types'

export type Props = {
narrow?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import React, {
} from 'react'
import { VariantProps, tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../libs/decorator'
import { Base, BaseElementProps } from '../Base'
import { Button } from '../Button'
import { Heading, HeadingTagTypes } from '../Heading'
import { FaCaretDownIcon, FaCaretUpIcon } from '../Icon'
import { Cluster } from '../Layout'
import { ResponseMessage } from '../ResponseMessage'

import type { DecoratorsType } from '../../types'

type AbstractProps = PropsWithChildren<{
/** パネルのタイトル */
title: React.ReactNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { ComponentProps, forwardRef, useMemo } from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../../libs/decorator'
import { FaMagnifyingGlassIcon } from '../../Icon'
import { InputWithTooltip } from '../InputWithTooltip'

import type { DecoratorsType } from '../../../types'

type Props = Omit<ComponentProps<typeof InputWithTooltip>, 'tooltipMessage' | 'prefix'> & {
/** 入力欄の説明を紐付けるツールチップに表示するメッセージ */
tooltipMessage: React.ReactNode
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/InputFile/InputFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import React, {
} from 'react'
import { VariantProps, tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../libs/decorator'
import { BaseColumn } from '../Base'
import { Button } from '../Button'
import { FaFolderOpenIcon, FaTrashCanIcon } from '../Icon'
import { Stack } from '../Layout'

import type { DecoratorsType } from '../../types'

const inputFile = tv({
slots: {
wrapper: 'smarthr-ui-InputFile shr-block',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { ComponentPropsWithoutRef, useMemo } from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorType, type DecoratorsType } from '../../libs/decorator'
import { Cluster } from '../Layout'
import { RangeSeparator, Text } from '../Text'

import type { DecoratorType, DecoratorsType } from '../../types'

type Props = {
start: number
end: number
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import React, {
} from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorType, type DecoratorsType } from '../../libs/decorator'
import { isIOS, isMobileSafari } from '../../libs/ua'
import { genericsForwardRef } from '../../libs/util'
import { FaSortIcon } from '../Icon'

import type { DecoratorType, DecoratorsType } from '../../types'

type Option<T extends string> = {
value: T
} & Omit<React.OptionHTMLAttributes<HTMLOptionElement>, 'value'>
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/Table/ThCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, { ComponentProps, forwardRef, useMemo } from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../libs/decorator'
import { Balloon } from '../Balloon'
import { CheckBox, Props as CheckBoxProps } from '../CheckBox'

import { Th } from './Th'

import type { DecoratorsType } from '../../types'

type Props = {
decorators?: DecoratorsType<'checkAllInvisibleLabel'> & {
checkColumnName?: (text: string) => string
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/Text/RangeSeparator.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useMemo } from 'react'

import { type DecoratorType, type DecoratorsType } from '../../libs/decorator'
import { VisuallyHiddenText } from '../VisuallyHiddenText'

import type { DecoratorType, DecoratorsType } from '../../types'

type Props = {
decorators?: DecoratorsType<'text' | 'visuallyHiddenText'>
}
Expand Down
3 changes: 1 addition & 2 deletions packages/smarthr-ui/src/components/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ import React, {
} from 'react'
import { tv } from 'tailwind-variants'

import { type DecoratorsType } from '../../libs/decorator'
import { debounce } from '../../libs/debounce'
import { lineHeight } from '../../themes'
import { defaultHtmlFontSize } from '../../themes/createFontSize'
import { VisuallyHiddenText } from '../VisuallyHiddenText'

import type { DecoratorsType } from '../../types'

type Props = {
/** 入力値にエラーがあるかどうか */
error?: boolean
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion packages/smarthr-ui/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export type { Gap, SeparateGap } from './Gap'
export type { DecoratorsType, DecoratorType } from './Decorator'
export type { ResponseMessageType } from './ResponseMessage'
export type { LocaleMap } from './Locale'
export type { ElementRef, ElementRefProps } from './ComponentTypes'

0 comments on commit 5ef9eda

Please sign in to comment.