diff --git a/.changeset/tonic-ui-945.md b/.changeset/tonic-ui-945.md new file mode 100644 index 0000000000..690a3d6553 --- /dev/null +++ b/.changeset/tonic-ui-945.md @@ -0,0 +1,6 @@ +--- +"@tonic-ui/react": patch +"@tonic-ui/theme": minor +--- + +feat(react): add `createTheme` for theme customization diff --git a/packages/changelog-github/README.md b/packages/changelog-github/README.md new file mode 100644 index 0000000000..360a5409a8 --- /dev/null +++ b/packages/changelog-github/README.md @@ -0,0 +1,3 @@ +# @tonic-ui/changelog-github + +A tool for generating changelogs with links to GitHub commits, PRs, and users. diff --git a/packages/changelog-github/package.json b/packages/changelog-github/package.json index 7fb64bedca..3cd816436d 100644 --- a/packages/changelog-github/package.json +++ b/packages/changelog-github/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@tonic-ui/changelog-github", - "description": "A changelog entry generator for GitHub that links to commits, PRs and users", + "description": "A tool for generating changelogs with links to GitHub commits, PRs, and users.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "files": [ diff --git a/packages/codemod/README.md b/packages/codemod/README.md index b5dc821808..93a53754b2 100644 --- a/packages/codemod/README.md +++ b/packages/codemod/README.md @@ -1,6 +1,6 @@ # @tonic-ui/codemod -This repository contains a collection of codemod scripts based for use with [jscodeshift](https://github.com/facebook/jscodeshift) that help update the APIs. +A set of codemod scripts designed to simplify the migration and updating of Tonic UI applications. ## Usage diff --git a/packages/codemod/package.json b/packages/codemod/package.json index 93cfc2f37b..c3e6aea72d 100644 --- a/packages/codemod/package.json +++ b/packages/codemod/package.json @@ -1,7 +1,7 @@ { "name": "@tonic-ui/codemod", "version": "2.1.0", - "description": "Codemod scripts for Tonic UI", + "description": "A set of codemod scripts designed to simplify the migration and updating of Tonic UI applications.", "bin": "./codemod-cli.js", "files": [ "codemod-cli.js", diff --git a/packages/react-base/README.md b/packages/react-base/README.md index 5d4a651a77..2661b56987 100644 --- a/packages/react-base/README.md +++ b/packages/react-base/README.md @@ -1,6 +1,6 @@ # @tonic-ui/react-base -A library of headless React UI components. +Headless React components intended for creating custom UI elements. ## Installation diff --git a/packages/react-base/package.json b/packages/react-base/package.json index 19cad70d26..c3dcde8f4a 100644 --- a/packages/react-base/package.json +++ b/packages/react-base/package.json @@ -1,7 +1,7 @@ { "name": "@tonic-ui/react-base", "version": "2.0.1", - "description": "A library of headless React UI components.", + "description": "Headless React components intended for creating custom UI elements.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "files": [ diff --git a/packages/react-docs/components/Demo.js b/packages/react-docs/components/Demo.js index 19e49ff556..59762e0f43 100644 --- a/packages/react-docs/components/Demo.js +++ b/packages/react-docs/components/Demo.js @@ -113,8 +113,8 @@ const Demo = ({ > @@ -123,7 +123,7 @@ const Demo = ({ @@ -131,7 +131,7 @@ const Demo = ({ @@ -139,7 +139,7 @@ const Demo = ({ diff --git a/packages/react-docs/components/CodeBlock.js b/packages/react-docs/components/PreformattedText.js similarity index 79% rename from packages/react-docs/components/CodeBlock.js rename to packages/react-docs/components/PreformattedText.js index c39bcc1893..f5e0753730 100644 --- a/packages/react-docs/components/CodeBlock.js +++ b/packages/react-docs/components/PreformattedText.js @@ -1,14 +1,14 @@ import { - Box, + Text, useColorStyle, } from '@tonic-ui/react'; import React from 'react'; -const CodeBlock = (props) => { +const PreformattedText = (props) => { const [colorStyle] = useColorStyle(); return ( - { ); }; -export default CodeBlock; +export default PreformattedText; diff --git a/packages/react-docs/components/ThemeParser.js b/packages/react-docs/components/ThemeParser.js index b8d199b275..6a4dd82f35 100644 --- a/packages/react-docs/components/ThemeParser.js +++ b/packages/react-docs/components/ThemeParser.js @@ -5,7 +5,7 @@ import { useTheme, } from '@tonic-ui/react'; import React from 'react'; -import CodeBlock from './CodeBlock'; +import PreformattedText from './PreformattedText'; import jsonPrettify from '../utils/json-prettify'; const ThemeParser = ({ @@ -33,9 +33,9 @@ const ThemeParser = ({ return ( - + {`const ${themeKey} = ${jsonPrettify(token, indent)}`} - + ); }; diff --git a/packages/react-docs/pages/_app.page.js b/packages/react-docs/pages/_app.page.js index 20a615e877..c9909bb8b9 100644 --- a/packages/react-docs/pages/_app.page.js +++ b/packages/react-docs/pages/_app.page.js @@ -7,7 +7,7 @@ import { ToastManager, TonicProvider, colorStyle as defaultColorStyle, - theme, + createTheme, // For theme customization (introduced in v2.5.0) useTheme, } from '@tonic-ui/react'; import { @@ -50,28 +50,21 @@ const EmotionCacheProvider = ({ }; const App = (props) => { - const customTheme = useConst(() => { - return { - ...theme, - components: { - // Set default props for components here. - // - // Example: - // ``` - // 'AccordionToggle': { - // defaultProps: { - // disabled: true, - // }, - // } - // ``` - }, - config: { - ...theme?.config, - // Enable CSS variables replacement - useCSSVariables: true, - }, - }; - }); + const customTheme = useConst(() => createTheme({ + cssVariables: true, // Enable CSS variables replacement + components: { + // Set default props for specific components + // + // Example: + // ``` + // 'ToastCloseButton': { + // defaultProps: { + // 'aria-label': 'Close toast', + // }, + // }, + // ``` + }, + })); const [initialColorMode, setColorMode] = useState(null); const router = useRouter(); diff --git a/packages/react-docs/pages/components/alert/index.page.mdx b/packages/react-docs/pages/components/alert/index.page.mdx index 4f96319ddb..5765451185 100644 --- a/packages/react-docs/pages/components/alert/index.page.mdx +++ b/packages/react-docs/pages/components/alert/index.page.mdx @@ -52,7 +52,7 @@ If not specified, the default icon will be used based on the `severity` prop. The `isClosable` prop is used to make an alert closable by adding a close button to it. By default, the value of `isClosable` is false. To make an alert closable, set `isClosable` to true. -```jsx disabled +```jsx This is a success alert. @@ -66,7 +66,7 @@ The `AlertCloseButton` component provides an easy way to add a close button to a Besides the default functionality of the `AlertCloseButton`, you can also pass additional props, such as `data-test` or `data-tracking` attributes, to the `AlertCloseButton` component as needed. -```jsx disabled +```jsx This is a success alert. diff --git a/packages/react-docs/pages/components/button/index.page.mdx b/packages/react-docs/pages/components/button/index.page.mdx index f2988f9004..fc703d74ba 100644 --- a/packages/react-docs/pages/components/button/index.page.mdx +++ b/packages/react-docs/pages/components/button/index.page.mdx @@ -34,7 +34,7 @@ You can make buttons look inactive or active by adding the `disabled` or `select If the `disabled` prop is set (or set to `true`), the button will have a `disabled` attribute and not respond to user interactions. -```jsx disabled +```jsx ``` @@ -46,7 +46,7 @@ To customize the visual appearance of the disabled state, pass the `_disabled` s If the `selected` prop is set (or set to `true`), the button will have both `pointer-events: none` style and `tabindex="-1"` attribute. This will prevent the button from receiving pointer events and will not be reachable via sequential keyboard navigation. -```jsx disabled +```jsx ``` diff --git a/packages/react-docs/pages/components/checkbox/index.page.mdx b/packages/react-docs/pages/components/checkbox/index.page.mdx index a1c0ae4be9..220e6c9c6b 100644 --- a/packages/react-docs/pages/components/checkbox/index.page.mdx +++ b/packages/react-docs/pages/components/checkbox/index.page.mdx @@ -45,7 +45,7 @@ WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/ * All form controls should have labels, and this includes radio buttons, checkboxes, and switches. In most cases, this is done by using the `