Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
},
"plugins": [
"import",
"n",
"eslint",
"node",
"react-perf",
"react",
"security",
"tree_shaking",
"typescript",
"unicorn"
],
Expand Down Expand Up @@ -83,6 +81,7 @@
"import/unambiguous": "off",
"import/exports-last": "off",
"import/no-anonymous-default-export": "off",
"import/group-exports": "off",
"react-perf/jsx-no-jsx-as-prop": "off",
"react-perf/jsx-no-new-array-as-prop": "off",
"react-perf/jsx-no-new-function-as-prop": "off",
Expand Down Expand Up @@ -122,11 +121,13 @@
"unicorn/prefer-code-point": "off",
"unicorn/prefer-dom-node-append": "off",
"unicorn/prefer-dom-node-remove": "off",
"unicorn/prefer-object-from-entries": "off",
"unicorn/prefer-logical-operator-over-ternary": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-string-replace-all": "off",
"unicorn/prefer-string-slice": "off"
"unicorn/prefer-string-slice": "off",
"unicorn/prefer-global-this": "off"
},
"settings": {
"jsx-a11y": {
Expand Down
1 change: 1 addition & 0 deletions e2e/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Global, ThemeProvider } from '@emotion/react'
// oxlint-disable-next-line import/no-unassigned-import
import '@ultraviolet/fonts/fonts.css'
import { consoleLightTheme } from '@ultraviolet/themes'
import { Text, normalize } from '@ultraviolet/ui'
Expand Down
1 change: 1 addition & 0 deletions examples/next-app-router/app/GlobalStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { Global, css } from '@emotion/react'
import { normalize } from '@ultraviolet/ui'
// oxlint-disable-next-line import/no-unassigned-import
import '@ultraviolet/fonts/fonts.css'

const styles = css`
Expand Down
3 changes: 2 additions & 1 deletion examples/next-app-router/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Metadata } from 'next'
// oxlint-disable-next-line import/no-unassigned-import
import './globals.css'
import { consoleLightTheme } from '@ultraviolet/themes'
import { ThemeRegistry } from '@ultraviolet/ui'
import { ReactNode } from 'react'
import type { ReactNode } from 'react'
import { GlobalStyles } from './GlobalStyles'

export const metadata: Metadata = {
Expand Down
2 changes: 1 addition & 1 deletion examples/next-app-router/emotion.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@emotion/react'
import { consoleLightTheme } from '@ultraviolet/themes'
import type { consoleLightTheme } from '@ultraviolet/themes'

type CustomTheme = typeof consoleLightTheme

Expand Down
2 changes: 1 addition & 1 deletion examples/next/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormErrors } from '@ultraviolet/form'
import type { FormErrors } from '@ultraviolet/form'
export const APP_MAX_WIDTH = 1140

export const EMAIL_REGEX = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i
Expand Down
1 change: 1 addition & 0 deletions examples/next/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Footer from '../components/Footer'
import GlobalStyle from '../components/GlobalStyle'
import Head from '../components/Head'
import Header from '../components/Header'
// oxlint-disable-next-line import/no-unassigned-import
import '@ultraviolet/fonts/fonts.css'

type Themes = 'light' | 'dark'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"identity-obj-proxy": "3.0.0",
"jest-axe": "10.0.0",
"lint-staged": "16.1.2",
"oxlint": "0.16.5",
"oxlint": "0.18.1",
"postcss": "8.5.6",
"publint": "0.3.12",
"react": "19.1.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/form/src/components/RadioField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import { Radio } from '@ultraviolet/ui'
import { type ComponentProps, useMemo } from 'react'
import type { ComponentProps } from 'react'
import { useMemo } from 'react'
import type { FieldPath, FieldValues } from 'react-hook-form'
import { useController } from 'react-hook-form'
import { useErrors } from '../../providers'
Expand Down
3 changes: 2 additions & 1 deletion packages/form/src/components/SelectInputFieldV2/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import { SelectInputV2 } from '@ultraviolet/ui'
import { type ComponentProps, useCallback } from 'react'
import type { ComponentProps } from 'react'
import { useCallback } from 'react'
import type { FieldPath, FieldValues, PathValue } from 'react-hook-form'
import { useController } from 'react-hook-form'
import { useErrors } from '../../providers'
Expand Down
8 changes: 2 additions & 6 deletions packages/form/src/components/SliderField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
'use client'

import { Slider } from '@ultraviolet/ui'
import {
type ComponentProps,
type FocusEvent,
type ReactNode,
useMemo,
} from 'react'
import type { ComponentProps, FocusEvent, ReactNode } from 'react'
import { useMemo } from 'react'
import { useController } from 'react-hook-form'
import type { FieldPath, FieldValues, Path, PathValue } from 'react-hook-form'
import { useErrors } from '../../providers'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import styled from '@emotion/styled'
import { type ComponentProps, type ReactNode, memo } from 'react'
import type { ComponentProps, ReactNode } from 'react'
import { memo } from 'react'
import { useEstimateCost } from '../EstimateCostProvider'
import type { BareEstimateProduct, EstimateProduct, Iteration } from '../types'
import { Item } from './Item'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import { css } from '@emotion/react'
import styled from '@emotion/styled'
import { type ReactNode, memo } from 'react'
import type { ReactNode } from 'react'
import { memo } from 'react'
import { useOverlay } from '../OverlayContext'

type RegularProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import styled from '@emotion/styled'
import { type ReactNode, memo } from 'react'
import type { ReactNode } from 'react'
import { memo } from 'react'
import { Regular } from './Regular'

type StrongProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,12 @@ export const NavigationContent = ({
document.addEventListener('mousemove', mouseMove)
window.addEventListener('mouseup', mouseup)
}
const sliderRefCurrent = sliderRef.current

sliderRef.current?.addEventListener('mousedown', mousedown)
sliderRefCurrent?.addEventListener('mousedown', mousedown)

return () => {
sliderRef.current?.removeEventListener('mousedown', mousedown)
sliderRefCurrent?.removeEventListener('mousedown', mousedown)
}
}, [
expanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
UseCaseCategoryIcon,
} from '@ultraviolet/icons/category'
import { Stack, fadeIn, fadeOut } from '@ultraviolet/ui'
import { type ComponentProps, useCallback, useEffect, useState } from 'react'
import type { ComponentProps } from 'react'
import { useCallback, useEffect, useState } from 'react'
import { Navigation, NavigationProvider, useNavigation } from '..'
import logoSmall from './assets/logo-small.svg'
import logo from './assets/logo.svg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ export const Item = memo(
if (type !== 'pinnedGroup' && pinnedFeature) {
registerItem({ [id]: { label, active, onToggle, onClickPinUnpin } })
}
// oxlint-disable-next-line react/exhaustive-deps
}, [active, id, label, registerItem])

const [internalExpanded, onToggleExpand] = useReducer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import styled from '@emotion/styled'
import type { StoryFn } from '@storybook/react'
import { blockStorageWire } from '@ultraviolet/illustrations/products/blockStorage'
import { Button, Expandable, Stack, Text } from '@ultraviolet/ui'
import { type ComponentProps, useState } from 'react'
import type { ComponentProps } from 'react'
import { useState } from 'react'
import { SteppedListCard } from '../SteppedListCard'

const StyledImage = styled.img`
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/AvatarV2/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import { type Theme, css } from '@emotion/react'
import type { Theme } from '@emotion/react'
import { css } from '@emotion/react'
import styled from '@emotion/styled'
import { UploadIcon } from '@ultraviolet/icons'
import { Icon } from '@ultraviolet/icons/legacy'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import type { StoryFn } from '@storybook/react'
import {
type ComponentProps,
type MouseEvent,
useCallback,
useState,
} from 'react'
import type { ComponentProps, MouseEvent } from 'react'
import { useCallback, useState } from 'react'
import { Breadcrumbs } from '..'
import { Button } from '../../Button'
import { Separator } from '../../Separator'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { StoryFn } from '@storybook/react'
import { type ComponentProps, useCallback, useState } from 'react'
import type { ComponentProps } from 'react'
import { useCallback, useState } from 'react'
import { Breadcrumbs } from '..'
import { Button } from '../../Button'
import { Separator } from '../../Separator'
Expand Down
10 changes: 2 additions & 8 deletions packages/ui/src/components/CheckboxGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@

import styled from '@emotion/styled'
import { AsteriskIcon } from '@ultraviolet/icons'
import {
type ComponentProps,
type InputHTMLAttributes,
type ReactNode,
createContext,
useContext,
useMemo,
} from 'react'
import type { ComponentProps, InputHTMLAttributes, ReactNode } from 'react'
import { createContext, useContext, useMemo } from 'react'
import { Checkbox } from '../Checkbox'
import { Stack } from '../Stack'
import { Text } from '../Text'
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/Chip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import styled from '@emotion/styled'
import { type ReactNode, useEffect, useMemo, useRef, useState } from 'react'
import type { ReactNode } from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import { Stack } from '../Stack'
import { Text } from '../Text'
import { ChipContext } from './ChipContext'
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/components/DateInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { Card } from '../Card'
import { Stack } from '../Stack'
import { Text } from '../Text'
import { TextInputV2 } from '../TextInputV2'
import { type ContextProps, DateInputContext } from './Context'
import type { ContextProps } from './Context'
import { DateInputContext } from './Context'
import { CalendarContent } from './components/CalendarContent'
import { CalendarPopup } from './components/Popup'
import { formatValue, styleCalendarContainer } from './helpers'
Expand Down Expand Up @@ -220,6 +221,7 @@ export const DateInput = <IsRange extends undefined | boolean>({
end: endDate ?? computedRange.end,
})
}
// oxlint-disable-next-line react/exhaustive-deps
}, [endDate, startDate, value])

const manageOnChange = (event: ChangeEvent<HTMLInputElement>) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import styled from '@emotion/styled'
import { type ComponentProps, useMemo } from 'react'
import type { ComponentProps } from 'react'
import { useMemo } from 'react'
import { Bullet } from '../Bullet'
import { Modal } from '../Modal'
import { Text } from '../Text'
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/components/Drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import { css, keyframes } from '@emotion/react'
import styled from '@emotion/styled'
import type { ComponentProps } from 'react'
import { Modal, type ModalProps } from '../Modal'
import type { ModalProps } from '../Modal'
import { Modal } from '../Modal'
import type { ModalState } from '../Modal/types'
import { Separator } from '../Separator'
import { Stack } from '../Stack'
import { Text } from '../Text'
// oxlint-disable-next-line import/no-unassigned-import
import './style.css'

export const SIZES = {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/List/ListContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export const ListProvider = ({
return () => {
handlers.forEach(cleanup => cleanup())
}
// oxlint-disable-next-line react/exhaustive-deps
}, [lastCheckedCheckbox, selectRows])

useEffect(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const TableContainer = ({ children }: { children: ReactNode }) => {
setRefList([])
setChildrenMemory(Children.toArray(children))
}
// oxlint-disable-next-line react/exhaustive-deps
}, [children, setRefList])

return <TableContainerStyle>{children}</TableContainerStyle>
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/MenuV2/components/Group.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import styled from '@emotion/styled'
import { Children, type ReactNode } from 'react'
import type { ReactNode } from 'react'
import { Children } from 'react'
import { Stack } from '../../Stack'
import { Text } from '../../Text'

Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/MenuV2/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Children, type ReactNode, cloneElement, isValidElement } from 'react'
import type { ReactNode } from 'react'
import { Children, cloneElement, isValidElement } from 'react'

/**
* Search inside a children (React Element) recursively until a result is found
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/Popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export const Popup = forwardRef(
}

return null
// oxlint-disable-next-line react/exhaustive-deps
}, [portalTarget, role, childrenRef.current])

// There are some issue when mixing animation and maxHeight on some browsers, so we disable animation if maxHeight is set.
Expand Down Expand Up @@ -433,6 +434,7 @@ export const Popup = forwardRef(
if (visibleInDom && innerPopupRef.current) {
innerPopupRef.current.style.opacity = '1'
}
// oxlint-disable-next-line react/exhaustive-deps
}, [positions])

/**
Expand Down
10 changes: 2 additions & 8 deletions packages/ui/src/components/RadioGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@

import styled from '@emotion/styled'
import { AsteriskIcon } from '@ultraviolet/icons'
import {
type ComponentProps,
type InputHTMLAttributes,
type ReactNode,
createContext,
useContext,
useMemo,
} from 'react'
import type { ComponentProps, InputHTMLAttributes, ReactNode } from 'react'
import { createContext, useContext, useMemo } from 'react'
import { Radio } from '../Radio'
import { Stack } from '../Stack'
import { Text } from '../Text'
Expand Down
8 changes: 5 additions & 3 deletions packages/ui/src/components/SelectInputV2/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import { DisplayOption } from './DropdownOption'
import { SearchBarDropdown } from './SearchBarDropdown'
import { useSelectInput } from './SelectInputProvider'
import { type DataType, INPUT_SIZE_HEIGHT, type OptionType } from './types'
import type { DataType, OptionType } from './types'
import { INPUT_SIZE_HEIGHT } from './types'

const DROPDOWN_MAX_HEIGHT = 256

Expand Down Expand Up @@ -262,11 +263,11 @@
setDefaultSearch(null)
}
} else {
const closestOption = [...options].filter(option =>
const closestOption = [...options].find(option =>

Check warning on line 266 in packages/ui/src/components/SelectInputV2/Dropdown.tsx

View check run for this annotation

Codecov / codecov/patch

packages/ui/src/components/SelectInputV2/Dropdown.tsx#L266

Added line #L266 was not covered by tests
option.searchText
? option.searchText.toLocaleLowerCase().startsWith(currentSearch)
: option.value.toLocaleLowerCase().startsWith(currentSearch),
)[0]
)
if (closestOption) {
setDefaultSearch(closestOption.searchText ?? closestOption.value)
} else {
Expand Down Expand Up @@ -721,6 +722,7 @@
} else window.scrollBy({ top: overflow, behavior: 'smooth' })
}
}
// oxlint-disable-next-line react/exhaustive-deps
}, [isDropdownVisible, refSelect, size, ref.current])

const resizeDropdown = useCallback(() => {
Expand Down
Loading
Loading