Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7ca1d72
ci(release): migrate npm publishing to OIDC Trusted Publishing
cheton Apr 18, 2026
5b06565
chore(deps-dev): upgrade eslint-config-trendmicro to ^4.1.0 and align…
cheton Apr 18, 2026
4044b7b
docs(babel): document @babel/preset-react runtime and importSource op…
cheton Apr 18, 2026
df6756b
chore(eslint): fix __fixtures__ ignore pattern to match nested paths
cheton Apr 18, 2026
62fcbab
fix(mcp): attach caught error as cause and remove stale eslint-disabl…
cheton Apr 18, 2026
a9cf6a8
chore(react): remove unused React imports and fix lint errors
cheton Apr 18, 2026
e5e7dac
chore(react-base): remove unused React import from Box.test.js
cheton Apr 18, 2026
59d3532
chore(react-hooks): remove unused React imports and fix lint errors
cheton Apr 18, 2026
32188e3
fix(react-hooks): replace placeholder with aria-label in useEventCall…
cheton Apr 18, 2026
55d1953
chore(react-icons): remove unused React imports from icon files
cheton Apr 18, 2026
16ad43a
chore(utils): remove stale eslint-disable comments
cheton Apr 18, 2026
839c622
chore(react-docs): adopt eslint-config-trendmicro and dedupe import p…
cheton Apr 19, 2026
5967467
chore(scripts): clean up build scripts and config
cheton Apr 19, 2026
5a05684
chore(deps): bump eslint-config-trendmicro to ^4.1.1
cheton Apr 19, 2026
0f2b623
chore(deps): bump eslint-config-trendmicro to ^4.1.2
cheton Apr 19, 2026
9e912cc
chore(deps): bump eslint-config-trendmicro to ^4.1.3
cheton Apr 19, 2026
63f8857
chore(react-docs): fix eslint errors across docs pages and components
cheton Apr 19, 2026
231b690
chore(react): fix lint warnings and bump eslint-config-trendmicro to …
cheton Apr 19, 2026
9d9653e
test(react): add tests to improve coverage for CSSBaseline, Descendan…
cheton Apr 19, 2026
c5832eb
fix(react): remove spurious async from Menu test to satisfy require-a…
cheton Apr 19, 2026
3ecb923
chore(react-docs): remove unused React imports and bump eslint-config…
cheton Apr 19, 2026
b1d1199
chore: fix eslint errors in mcp and utils packages
cheton Apr 20, 2026
7b5e2ae
chore(react-docs): fix eslint errors across docs pages and components
cheton Apr 21, 2026
db3ff67
chore(react-docs): refine eslint config rules and add trendmicro preset
cheton Apr 21, 2026
618088a
chore(react): clean up lint-related code in LinkButton test and resiz…
cheton Apr 21, 2026
3b3ab44
chore(deps): bump eslint-config-trendmicro to ^4.3.0
cheton Apr 22, 2026
989fe58
chore(eslint): bump eslint-config-trendmicro to ^4.4.1 and fix result…
cheton Apr 22, 2026
1d7e434
chore(codecov): make patch informational and tighten project gate
cheton Apr 22, 2026
a27f991
fix(react): use index as key in FormErrorMessage list to avoid React …
cheton Apr 25, 2026
74b0a56
chore(react-docs): add missing semicolon in CodeBlock import
cheton Apr 25, 2026
0df5618
refactor(react): rename map parameter to `error` in FormErrorMessage …
cheton Apr 25, 2026
2d17d63
refactor(react): memoize getIsPassiveListenerSupported via IIFE
cheton Apr 25, 2026
3bdd8b7
chore: remove unused React import
cheton Apr 25, 2026
4d0457d
chore: migrate react-docs Highlight usage and modernize utils test is…
cheton Apr 25, 2026
b4d10d9
refactor(react-docs): extract dropdown menu list style and tidy Dropd…
cheton Apr 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

permissions: {}

Expand All @@ -24,6 +23,7 @@ jobs:
contents: write # to create release (changesets/action)
issues: write # to post issue comments (changesets/action)
pull-requests: write # to create pull request (changesets/action)
id-token: write # to request OIDC token for npm Trusted Publishing
name: Release
runs-on: ubuntu-latest
steps:
Expand All @@ -38,6 +38,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
id: install-dependencies
run: yarn install
Expand All @@ -57,4 +58,4 @@ jobs:
publish: yarn ci-publish
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
NPM_TOKEN: ${{ env.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
12 changes: 8 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ coverage:
status:
project:
default:
target: auto
threshold: 2%
target: auto
threshold: 1%
removed_code_behavior: adjust_base
if_ci_failed: error
if_not_found: success
patch:
default:
target: auto
threshold: 2%
target: auto
threshold: 5%
informational: true
16 changes: 8 additions & 8 deletions examples/react-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"react-dom": "^18.0.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^15.0.0",
"del-cli": "^5.0.0",
"eslint": "^8.25.0",
"eslint-config-trendmicro": "^3.0.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jsx-a11y": "latest",
"eslint-plugin-react": "latest",
"eslint-plugin-react-hooks": "latest",
"eslint": "^9.26.0",
"eslint-config-trendmicro": "^4.1.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"jest-watch-typeahead": "^2.2.1",
"react-scripts": "^5.0.1",
"web-vitals": "^2.1.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/changelog-github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"cross-env": "^7.0.3",
"del-cli": "^5.0.0",
"eslint": "^9.26.0",
"eslint-config-trendmicro": "^4.0.0",
"eslint-config-trendmicro": "^4.4.1",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/codemod/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default defineConfig([
'build',
'dist',
'node_modules',
'__fixtures__',
'**/__fixtures__/**',
],
},
]);
2 changes: 1 addition & 1 deletion packages/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@trendmicro/babel-config": "^1.0.2",
"del-cli": "^5.0.0",
"eslint": "^9.26.0",
"eslint-config-trendmicro": "^4.0.0",
"eslint-config-trendmicro": "^4.4.1",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"cross-env": "^7.0.3",
"del-cli": "^5.0.0",
"eslint": "^9.26.0",
"eslint-config-trendmicro": "^4.0.0",
"eslint-config-trendmicro": "^4.4.1",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-import": "^2.32.0",
"globals": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/src/__tests__/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('createMcpServer', () => {
The description of the tool contains the available packages, as listed below:
- @tonic-ui/react@2.0.0

1. Pick the most suitable package from the above list, and use that as the \"packages\" argument for this tool's execution, to get the docs content. If it's just one, let it be an array with one package.
1. Pick the most suitable package from the above list, and use that as the "packages" argument for this tool's execution, to get the docs content. If it's just one, let it be an array with one package.
2. Analyze the URLs listed in the content.
3. Then use "fetch-pages" tool to fetch specific documentation pages relevant to the user's question with the subsequent tool call.`);

Expand Down
7 changes: 2 additions & 5 deletions packages/mcp/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function fetchFromUrl(urlString: string): Promise<string> {
return content;
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
throw new Error(`Failed to fetch ${urlString}: ${errorMessage}`);
throw new Error(`Failed to fetch ${urlString}: ${errorMessage}`, { cause: error });
}
}

Expand Down Expand Up @@ -89,9 +89,7 @@ async function loadFromFilePath(
}
for (const ext of extensions) {
const candidate = filePath + ext;
// eslint-disable-next-line no-await-in-loop
if (await exists(candidate)) {
// eslint-disable-next-line no-await-in-loop
return await fs.readFile(candidate, 'utf-8');
}
}
Expand All @@ -110,7 +108,7 @@ export function trimTrailingSlashAndWhitespace(url: string | undefined): string
if (typeof url !== 'string') {
return '';
}
return url.replace(/[\/\s]+$/, '');
return url.replace(/[\/\s]+$/, ''); // eslint-disable-line no-useless-escape
}

/**
Expand Down Expand Up @@ -176,7 +174,6 @@ export async function processUrls(
let error;

try {
// eslint-disable-next-line no-await-in-loop
content = await _processUrl(url);
} catch (err) {
error = err;
Expand Down
17 changes: 17 additions & 0 deletions packages/react-base/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ module.exports = {
],
presets: [
'@babel/preset-env',
/**
* @babel/preset-react
*
* - `runtime: 'automatic'`
* Babel auto-injects the JSX runtime import, so JSX files no longer need
* `import React from 'react'`. Named imports are still required for React APIs:
* - `import { useState, useRef, forwardRef, memo } from 'react'` ✅ still needed
* - `import React from 'react'` ❌ not needed
*
* - `importSource: '@emotion/react'`
* Selects which JSX runtime to use:
* - `@emotion/react/jsx-runtime` (with importSource) — enables Emotion's `css` prop
* - `react/jsx-runtime` (default)
*
* These two options are independent. `runtime` removes the need for `import React`;
* `importSource` controls which runtime handles the JSX transform.
*/
['@babel/preset-react', {
'runtime': 'automatic',
'importSource': '@emotion/react',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"cross-env": "^7.0.3",
"del-cli": "^5.0.0",
"eslint": "^9.26.0",
"eslint-config-trendmicro": "^4.0.0",
"eslint-config-trendmicro": "^4.4.1",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
Expand Down
1 change: 0 additions & 1 deletion packages/react-base/src/box/__tests__/Box.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { testA11y } from '@tonic-ui/react-base/test-utils/accessibility';
import { render } from '@tonic-ui/react-base/test-utils/render';
import { Box } from '@tonic-ui/react-base/src';
import React from 'react';

describe('Box', () => {
it('should render correctly', async () => {
Expand Down
17 changes: 17 additions & 0 deletions packages/react-docs/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ module.exports = {
],
presets: [
'@babel/preset-env',
/**
* @babel/preset-react
*
* - `runtime: 'automatic'`
* Babel auto-injects the JSX runtime import, so JSX files no longer need
* `import React from 'react'`. Named imports are still required for React APIs:
* - `import { useState, useRef, forwardRef, memo } from 'react'` ✅ still needed
* - `import React from 'react'` ❌ not needed
*
* - `importSource: '@emotion/react'`
* Selects which JSX runtime to use:
* - `@emotion/react/jsx-runtime` (with importSource) — enables Emotion's `css` prop
* - `react/jsx-runtime` (default)
*
* These two options are independent. `runtime` removes the need for `import React`;
* `importSource` controls which runtime handles the JSX transform.
*/
['@babel/preset-react', {
'runtime': 'automatic',
'importSource': '@emotion/react',
Expand Down
6 changes: 2 additions & 4 deletions packages/react-docs/components/BaseTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
useTheme,
} from '@tonic-ui/react';
import { dataAttr } from '@tonic-ui/utils';
import React, { Fragment, forwardRef, useEffect, useState } from 'react';
import { Fragment, forwardRef, useEffect, useState } from 'react';
import AutoSizer from 'react-virtualized-auto-sizer';

/**
Expand Down Expand Up @@ -148,7 +148,6 @@ const BaseTable = forwardRef((
);
};

// eslint-disable-next-line react-hooks/incompatible-library
const table = useReactTable({
data,
columns,
Expand Down Expand Up @@ -317,8 +316,7 @@ const BaseTable = forwardRef((
>
{header.isPlaceholder
? null
: flexRender(header.column.columnDef.header, header.getContext())
}
: flexRender(header.column.columnDef.header, header.getContext())}
</TableCell>
);
})}
Expand Down
1 change: 0 additions & 1 deletion packages/react-docs/components/BorderedBox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Box, useColorMode } from '@tonic-ui/react';

const BorderedBox = (props) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/react-docs/components/CodeBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import {
} from '@tonic-ui/utils';
import useClipboard from '../hooks/useClipboard';
import { ensureString } from 'ensure-type';
import React from 'react';
import { LiveProvider, LiveEditor } from 'react-live';
import { themes } from "prism-react-renderer"
import { themes } from 'prism-react-renderer';

const CodeBlock = ({ code: codeProp, language, ...rest }) => {
const theme = useTheme();
Expand Down
1 change: 0 additions & 1 deletion packages/react-docs/components/ColorPalette.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Box, Flex, Stack, useTheme } from '@tonic-ui/react';
import {
ensureString,
} from 'ensure-type';
import React from 'react';

const ColorPalette = ({ hue }) => {
const theme = useTheme();
Expand Down
5 changes: 2 additions & 3 deletions packages/react-docs/components/ColorStyleBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
useColorMode,
useColorStyle,
} from '@tonic-ui/react';
import React from 'react';

const baseWidth = 120;
const baseHeight = 120;
Expand Down Expand Up @@ -69,7 +68,7 @@ const ColorStyleBlock = ({
<Box
mb="3x"
>
{colorLabel && (
{colorLabel ? (
<Text
color={primaryTextColor}
fontSize="md"
Expand All @@ -78,7 +77,7 @@ const ColorStyleBlock = ({
>
{colorLabel}
</Text>
)}
) : null}
</Box>
{colorTokens.length > 0 && (
<>
Expand Down
1 change: 0 additions & 1 deletion packages/react-docs/components/ColorStyleBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from 'ensure-type';
import _get from 'lodash/get';
import _has from 'lodash/has';
import React from 'react';
import ColorStyleBlock from './ColorStyleBlock';

const baseWidth = 180;
Expand Down
1 change: 0 additions & 1 deletion packages/react-docs/components/ColorStyleContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Box,
useColorMode,
} from '@tonic-ui/react';
import React from 'react';

const ColorStyleContent = (props) => {
const [colorMode] = useColorMode();
Expand Down
1 change: 0 additions & 1 deletion packages/react-docs/components/ColorStyleHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
useColorMode,
useColorStyle,
} from '@tonic-ui/react';
import React from 'react';

const ColorStyleHeader = (props) => {
const [colorMode] = useColorMode();
Expand Down
7 changes: 3 additions & 4 deletions packages/react-docs/components/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
merge,
} from '@tonic-ui/utils';
import { useRouter } from 'next/router';
import { themes } from "prism-react-renderer"
import React, { Fragment, useEffect, useCallback, useReducer } from 'react';
import { themes } from 'prism-react-renderer'
import { Fragment, useEffect, useCallback, useReducer } from 'react';
import { LiveProvider, LiveEditor } from 'react-live';
import useClipboard from '../hooks/useClipboard';
import CodeSandboxIcon from '../icons/CodeSandboxIcon';
Expand Down Expand Up @@ -125,8 +125,7 @@ const Demo = ({
<IconButton
data-track={showSourceCode
? `Code|hide_source|${x({ path: router.pathname })}`
: `Code|show_source|${x({ path: router.pathname })}`
}
: `Code|show_source|${x({ path: router.pathname })}`}
onClick={toggleShowSourceCode}
>
<Tooltip label={showSourceCode ? 'Hide the source' : 'Show the source'}>
Expand Down
1 change: 0 additions & 1 deletion packages/react-docs/components/FormGroup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Box } from '@tonic-ui/react';
import React from 'react';

const FormGroup = (props) => (
<Box mb="4x" {...props} />
Expand Down
1 change: 0 additions & 1 deletion packages/react-docs/components/GlobalStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
useColorStyle,
useTheme,
} from '@tonic-ui/react';
import React from 'react';

const GlobalStyles = () => {
const [colorMode] = useColorMode();
Expand Down
9 changes: 4 additions & 5 deletions packages/react-docs/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
} from '@tonic-ui/react-icons';
import { ensureString } from 'ensure-type';
import NextLink from 'next/link';
import React, { forwardRef, useCallback, useEffect } from 'react';
import { forwardRef, useCallback, useEffect } from 'react';
import useTrack from '../hooks/useTrack';
import CodeSandboxIcon from '../icons/CodeSandboxIcon';
import GitHubIcon from '../icons/GitHubIcon';
Expand Down Expand Up @@ -158,7 +158,7 @@ const Header = forwardRef((
lg: 'block',
}}
>
<NextLink href={`/`} legacyBehavior passHref>
<NextLink href="/" legacyBehavior passHref>
<Link
data-track="Header|click_landing_page"
color={colorStyle.color.primary}
Expand Down Expand Up @@ -234,8 +234,7 @@ const Header = forwardRef((
>
{(key === version)
? <>{value?.label}<Space width="2x" />✓</>
: value?.label
}
: value?.label}
</MenuItem>
))}
<MenuDivider />
Expand All @@ -251,7 +250,7 @@ const Header = forwardRef((
</Menu>
</Box>
<ButtonBase
data-track={`Header|click_codesandbox`}
data-track="Header|click_codesandbox"
onClick={() => handleClickOpenInCodeSandbox()}
title="Open in CodeSandbox"
sx={{
Expand Down
2 changes: 1 addition & 1 deletion packages/react-docs/components/IconButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ButtonBase,
useColorMode,
} from '@tonic-ui/react';
import React, { forwardRef } from 'react';
import { forwardRef } from 'react';

const IconButton = forwardRef((props, ref) => {
const [colorMode] = useColorMode();
Expand Down
Loading
Loading