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
31 changes: 12 additions & 19 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,18 @@
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5",
"importOrder": [
".*styles.css$",
"",
"dayjs",
"^react$",
"^next$",
"^next/.*$",
"<BUILTIN_MODULES>",
"<THIRD_PARTY_MODULES>",
"^@mantine/(.*)$",
"^@mantinex/(.*)$",
"^@mantine-tests/(.*)$",
"^@docs/(.*)$",
"^@/.*$",
"^../(?!.*\\.css$).*$",
"^./(?!.*\\.css$).*$",
"\\.module\\.css$",
"(?<!\\.module)\\.css$"
],
"sortImports": {
"groups": [
"side_effect_style",
"external",
"internal",
["parent", "sibling", "index"],
"style",
"unknown"
],
"newlinesBetween": false,
"order": "asc"
},
"sortPackageJson": false,
"ignorePatterns": [
"*.d.ts",
Expand Down
1 change: 0 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '@mantine/core/styles.css';

import { MantineProvider } from '@mantine/core';

export const parameters = {
Expand Down
6 changes: 3 additions & 3 deletions docs/components/DocsTabs/DocsTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import { useRouter } from 'next/router';
import { IconAdjustments, IconArrowBarUp, IconCode, IconFileText } from '@tabler/icons-react';
import { Container, Tabs } from '@mantine/core';
import { IconAdjustments, IconArrowBarUp, IconCode, IconFileText } from '@tabler/icons-react';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import { PropsTablesList } from '../PropsTable';
import { StylesApiTablesList } from '../StylesApiTable';
import { TableOfContents } from '../TableOfContents';
Expand Down
12 changes: 6 additions & 6 deletions docs/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import {
IconBrandGithubFilled,
IconBrandMantine,
IconBrandX,
IconMailHeart,
} from '@tabler/icons-react';
import {
ActionIcon,
Anchor,
Expand All @@ -16,6 +10,12 @@ import {
ThemeIcon,
Title,
} from '@mantine/core';
import {
IconBrandGithubFilled,
IconBrandMantine,
IconBrandX,
IconMailHeart,
} from '@tabler/icons-react';
import packageJson from '../../../package/package.json';
import { Logo } from '../Shell';
import { AnimateBadge } from './AnimateBadge';
Expand Down
6 changes: 3 additions & 3 deletions docs/components/MdxElements/MdxElements.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import cx from 'clsx';
import type { MDXComponents } from 'mdx/types';
import { CodeHighlight } from '@mantine/code-highlight';
import { Anchor, Code, Image, Title } from '@mantine/core';
import { Demo } from '@mantinex/demo';
import cx from 'clsx';
import type { MDXComponents } from 'mdx/types';
import React from 'react';
import { MdxInfo } from '../MdxInfo/MdxInfo';
import classes from './MdxElements.module.css';

Expand Down
2 changes: 1 addition & 1 deletion docs/components/MdxInfo/MdxInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Blockquote, BlockquoteProps, rgba, useMantineTheme } from '@mantine/core';
import { IconInfoCircle } from '@tabler/icons-react';
import cx from 'clsx';
import { Blockquote, BlockquoteProps, rgba, useMantineTheme } from '@mantine/core';
import classes from './MdxInfo.module.css';

export function MdxInfo({ className, ...others }: BlockquoteProps) {
Expand Down
4 changes: 2 additions & 2 deletions docs/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Badge, Container, Text, Title } from '@mantine/core';
import { GithubIcon, NpmIcon } from '@mantinex/dev-icons';
import {
IconEdit,
IconHeartFilled,
Expand All @@ -6,8 +8,6 @@ import {
IconUserCode,
IconVersions,
} from '@tabler/icons-react';
import { Badge, Container, Text, Title } from '@mantine/core';
import { GithubIcon, NpmIcon } from '@mantinex/dev-icons';
import pack from '../../../package/package.json';
import type { PackageData } from '../../data';
import { PageHeaderLink } from './PageHeaderLink/PageHeaderLink';
Expand Down
2 changes: 1 addition & 1 deletion docs/components/PropsTable/PropsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Highlight, Table, Text } from '@mantine/core';
import React from 'react';
import { TableError } from '../TableError';
import { TableInlineCode } from '../TableInlineCode';

Expand Down
4 changes: 2 additions & 2 deletions docs/components/PropsTable/PropsTablesList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { IconSearch } from '@tabler/icons-react';
import { TextInput, Title } from '@mantine/core';
import { IconSearch } from '@tabler/icons-react';
import React, { useState } from 'react';
import { getComponentName } from './getComponentName';
import { PropsTable } from './PropsTable';
import classes from './PropsTablesList.module.css';
Expand Down
4 changes: 2 additions & 2 deletions docs/components/Shell/Shell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';
import cx from 'clsx';
import {
ActionIcon,
AppShell,
Expand All @@ -13,6 +11,8 @@ import { useHotkeys } from '@mantine/hooks';
import { ColorSchemeControl, HeaderControls } from '@mantinex/mantine-header';
import { MantineLogo } from '@mantinex/mantine-logo';
import { meta } from '@mantinex/mantine-meta';
import cx from 'clsx';
import React from 'react';
import { PACKAGE_DATA } from '../../data';
import { Logo } from './Logo';
import classes from './Shell.module.css';
Expand Down
2 changes: 1 addition & 1 deletion docs/components/StylesApiTable/ModifiersTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Table, TableProps, Text } from '@mantine/core';
import React from 'react';
import { TableInlineCode } from '../TableInlineCode';
import type { StylesApiData } from './StylesApiTable';

Expand Down
2 changes: 1 addition & 1 deletion docs/components/StylesApiTable/SelectorsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Table, TableProps, Text } from '@mantine/core';
import React from 'react';
import { TableInlineCode } from '../TableInlineCode';
import type { StylesApiData } from './StylesApiTable';

Expand Down
2 changes: 1 addition & 1 deletion docs/components/StylesApiTable/StylesApiTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Title } from '@mantine/core';
import React from 'react';
import { getComponentName } from '../PropsTable';
import { TableError } from '../TableError';
import { ModifiersTable } from './ModifiersTable';
Expand Down
2 changes: 1 addition & 1 deletion docs/components/StylesApiTable/StylesApiTablesList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Code } from '@mantine/core';
import React from 'react';
import { MdxLink, MdxParagraph, MdxTitle } from '../MdxElements/MdxElements';
import { StylesApiTable } from './StylesApiTable';
import classes from './StylesApiTable.module.css';
Expand Down
2 changes: 1 addition & 1 deletion docs/components/StylesApiTable/VariablesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Table, TableProps, Text } from '@mantine/core';
import React from 'react';
import { TableInlineCode } from '../TableInlineCode';
import type { StylesApiData } from './StylesApiTable';

Expand Down
2 changes: 1 addition & 1 deletion docs/components/TableError/TableError.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Anchor, Text } from '@mantine/core';
import React from 'react';

interface TableErrorProps {
errorOf: string;
Expand Down
4 changes: 2 additions & 2 deletions docs/components/TableInlineCode/TableInlineCode.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import cx from 'clsx';
import { ElementProps, Text, TextProps } from '@mantine/core';
import cx from 'clsx';
import React from 'react';
import classes from './TableInlineCode.module.css';

interface TableInlineCodeProps extends TextProps, ElementProps<'span', 'color'> {}
Expand Down
2 changes: 1 addition & 1 deletion docs/components/TableOfContents/TableOfContents.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRouter } from 'next/router';
import { Box, ScrollArea, Space, Text } from '@mantine/core';
import { useScrollSpy } from '@mantine/hooks';
import { useRouter } from 'next/router';
import classes from './TableOfContents.module.css';

interface TableOfContentsProps {
Expand Down
2 changes: 1 addition & 1 deletion docs/components/styles-api.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EmptyObject } from 'type-fest';
import type { FactoryPayload, TransformVars } from '@mantine/core';
import type { EmptyObject } from 'type-fest';

export interface Modifier<StylesNames extends string> {
modifier: string;
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/Window.demo.controlledPosition.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { Window } from '@gfazioli/mantine-window';
import { Box, Slider, Stack, Text, Title } from '@mantine/core';
import { MantineDemo } from '@mantinex/demo';
import { useState } from 'react';

const code = `import { useState } from 'react';
import { Window } from '@gfazioli/mantine-window';
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/Window.demo.dynamicWindows.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { Window } from '@gfazioli/mantine-window';
import { Button, Group, Title } from '@mantine/core';
import { MantineDemo } from '@mantinex/demo';
import { useState } from 'react';

const code = `import { useState } from 'react';
import { Window } from '@gfazioli/mantine-window';
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/Window.demo.groupLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { Window, type WindowLayout } from '@gfazioli/mantine-window';
import { Badge, Group, Stack, Text, Title } from '@mantine/core';
import { MantineDemo } from '@mantinex/demo';
import { useState } from 'react';

const code = `import { useState } from 'react';
import { Window, type WindowLayout } from '@gfazioli/mantine-window';
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/Window.demo.layoutPresets.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRef, useState } from 'react';
import { Window, type WindowGroupContextValue, type WindowLayout } from '@gfazioli/mantine-window';
import { Select, Stack, Title } from '@mantine/core';
import { MantineDemo } from '@mantinex/demo';
import { useRef, useState } from 'react';

const code = `import { useRef, useState } from 'react';
import { Window, type WindowGroupContextValue, type WindowLayout } from '@gfazioli/mantine-window';
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/Window.demo.zIndexStrategy.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { Window } from '@gfazioli/mantine-window';
import { SegmentedControl, Stack, Text, Title } from '@mantine/core';
import { MantineDemo } from '@mantinex/demo';
import { useState } from 'react';

const code = `import { useState } from 'react';
import { Window } from '@gfazioli/mantine-window';
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
"dependencies": {
"@gfazioli/mantine-window": "workspace:*",
"@mantine/code-highlight": "9.2.0",
"@mantine/core": "9.2.0",
"@mantine/hooks": "9.2.0",
"@mantine/code-highlight": "9.2.1",
"@mantine/core": "9.2.1",
"@mantine/hooks": "9.2.1",
"@mantinex/demo": "^2.0.0",
"@mantinex/dev-icons": "^2.0.0",
"@mantinex/mantine-header": "^2.0.0",
Expand Down
5 changes: 2 additions & 3 deletions docs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import '@mantinex/mantine-header/styles.css';
import '@mantinex/mantine-logo/styles.css';
// Window styles
import '@gfazioli/mantine-window/styles.css';

import { AppProps } from 'next/app';
import Head from 'next/head';
import { CodeHighlightAdapterProvider, createShikiAdapter } from '@mantine/code-highlight';
import { MantineProvider } from '@mantine/core';
import { AppProps } from 'next/app';
import Head from 'next/head';
import favicon from '../assets/favicon.svg';
import { Footer } from '../components/Footer';
import { theme } from '../theme';
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Head, Html, Main, NextScript } from 'next/document';
import { ColorSchemeScript } from '@mantine/core';
import { Head, Html, Main, NextScript } from 'next/document';
import React from 'react';

export default function Document() {
return (
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
},
"devDependencies": {
"@mantine-tests/core": "^2.1.0",
"@mantine/core": "9.2.0",
"@mantine/hooks": "9.2.0",
"@mantine/core": "9.2.1",
"@mantine/hooks": "9.2.1",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.3",
"@storybook/addon-themes": "^10.3.6",
"@storybook/react": "^10.3.6",
"@storybook/react-vite": "^10.3.6",
"@storybook/addon-themes": "^10.4.0",
"@storybook/react": "^10.4.0",
"@storybook/react-vite": "^10.4.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
Expand All @@ -62,25 +62,25 @@
"jest-axe": "^9.0.0",
"jest-environment-jsdom": "^29.7.0",
"mantine-docgen-script": "^1.6.0",
"oxfmt": "^0.49.0",
"oxlint": "^1.64.0",
"oxfmt": "^0.50.0",
"oxlint": "^1.65.0",
"postcss": "^8.5.14",
"postcss-preset-mantine": "1.18.0",
"react": "19.2.6",
"react-dom": "19.2.6",
"rimraf": "^6.1.3",
"rollup": "^4.60.3",
"rollup": "^4.60.4",
"rollup-plugin-banner2": "^1.3.1",
"rollup-plugin-esbuild": "^6.2.1",
"rollup-plugin-node-externals": "^8.1.2",
"rollup-plugin-postcss": "^4.0.2",
"signale": "^1.4.0",
"simple-git": "^3.36.0",
"storybook": "^10.3.6",
"storybook": "^10.4.0",
"stylelint": "^16.26.1",
"stylelint-config-standard-scss": "^14.0.0",
"syncpack": "^13.0.4",
"tsx": "^4.21.0",
"tsx": "^4.22.1",
"typescript": "6.0.3",
"version-next": "^1.0.2",
"vite": "^6.4.2",
Expand Down
2 changes: 1 addition & 1 deletion package/src/Window.story.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Button, Stack, Text, Title } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import React from 'react';
import { Window } from './Window';

export default {
Expand Down
6 changes: 3 additions & 3 deletions package/src/Window.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { createRef, useRef, useState } from 'react';
import { act, fireEvent, render, screen } from '@testing-library/react';
import { MantineProvider } from '@mantine/core';
import { act, fireEvent, render, screen } from '@testing-library/react';
import React, { createRef, useRef, useState } from 'react';
import { __resetStandaloneZIndexCounters } from './hooks/use-window-state';
import { Window } from './Window';
import type { WindowGroupContextValue } from './WindowGroup.context';
import { __resetStandaloneZIndexCounters } from './hooks/use-window-state';

// Helper to render with MantineProvider
function renderWithMantine(ui: React.ReactElement) {
Expand Down
4 changes: 2 additions & 2 deletions package/src/Window.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';
import { IconMinus, IconPlus, IconX } from '@tabler/icons-react';
import {
ActionIcon,
Box,
Expand All @@ -20,6 +18,8 @@
type MantineRadius,
type MantineShadow,
} from '@mantine/core';
import { IconMinus, IconPlus, IconX } from '@tabler/icons-react';
import React from 'react';
import { useMantineWindow } from './hooks/use-mantine-window';
import { useResponsiveValue, type ResponsiveValue } from './hooks/use-responsive-value';
import {
Expand Down Expand Up @@ -405,7 +405,7 @@
mod={[{ 'data-with-border': withBorder, 'data-window-draggable': draggableWindow }, mod]}
onMouseDown={draggableWindow ? handleMouseDownDrag : undefined}
onTouchStart={draggableWindow ? handleTouchStartDrag : undefined}
role="dialog"

Check warning on line 408 in package/src/Window.tsx

View workflow job for this annotation

GitHub Actions / test_pull_request

jsx-a11y(prefer-tag-over-role)

Prefer `dialog` over `role` attribute `dialog`.
aria-label={title || props.id || 'Window'}
data-mantine-window
{...others}
Expand Down
4 changes: 2 additions & 2 deletions package/src/WindowGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Box, factory, Factory, useProps, type BoxProps } from '@mantine/core';
import { useResizeObserver } from '@mantine/hooks';
import React, {
useCallback,
useEffect,
Expand All @@ -7,8 +9,6 @@ import React, {
useRef,
useState,
} from 'react';
import { Box, factory, Factory, useProps, type BoxProps } from '@mantine/core';
import { useResizeObserver } from '@mantine/hooks';
import {
WindowGroupProvider,
type WindowCallbacks,
Expand Down
2 changes: 1 addition & 1 deletion package/src/hooks/use-mantine-window.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef } from 'react';
import { useMergedRef } from '@mantine/hooks';
import { useCallback, useEffect, useRef } from 'react';
import type { WindowBaseProps, WindowBounds } from '../Window';
import { useWindowGroupContext } from '../WindowGroup.context';
import { useResponsiveValue } from './use-responsive-value';
Expand Down
Loading
Loading