diff --git a/packages/core/.storybook/manager.jsx b/packages/core/.storybook/manager.jsx index 18d90f52a1..1d2cbde815 100644 --- a/packages/core/.storybook/manager.jsx +++ b/packages/core/.storybook/manager.jsx @@ -1,8 +1,9 @@ -import { addons } from "@storybook/manager-api"; import React from "react"; +import { addons } from "@storybook/manager-api"; import { SidebarItem } from "vibe-storybook-components"; import "vibe-storybook-components/index.css"; import theme from "./theme"; +import isChromatic from "chromatic/isChromatic"; window.STORYBOOK_GA_ID = "UA-308574295"; window.STORYBOOK_REACT_GA_OPTIONS = {}; @@ -24,6 +25,15 @@ addons.setConfig({ } return {name.replace(storyStatus, "").trim()}; + }, + filters: { + patterns: filterStory } } }); + +function filterStory(item) { + const isDev = isChromatic() || process.env.NODE_ENV === "development"; + const isInternal = !item.tags?.includes?.("internal") && !item.title?.startsWith?.("Internal"); + return isDev || isInternal; +} diff --git a/packages/core/.storybook/preview.tsx b/packages/core/.storybook/preview.tsx index 5323cb1a33..51f0a67a7d 100644 --- a/packages/core/.storybook/preview.tsx +++ b/packages/core/.storybook/preview.tsx @@ -97,6 +97,7 @@ const preview: Preview = { "Catalog", "Change Log", "Typography Migration Guide", + "Internal", "Foundations", "Buttons", "Inputs", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 71c3ca3a26..fafa334f24 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,33 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.102.0](https://github.com/mondaycom/monday-ui-react-core/compare/monday-ui-react-core@2.101.0...monday-ui-react-core@2.102.0) (2024-04-11) + + +### Features + +* add autoFocus to CheckBox ([#2059](https://github.com/mondaycom/monday-ui-react-core/issues/2059)) ([cd26e7c](https://github.com/mondaycom/monday-ui-react-core/commit/cd26e7cf7b666da211efc7dd7af4f58a25a1b7a0)) + + + + + +# [2.101.0](https://github.com/mondaycom/monday-ui-react-core/compare/monday-ui-react-core@2.100.1...monday-ui-react-core@2.101.0) (2024-04-10) + + +### Bug Fixes + +* **DatePicker:** added min width to buttons inside year picker ([#2050](https://github.com/mondaycom/monday-ui-react-core/issues/2050)) ([7c35041](https://github.com/mondaycom/monday-ui-react-core/commit/7c35041363e880667899df8f033b117058be3a25)) + + +### Features + +* add autoFocus to RadioButton ([#2057](https://github.com/mondaycom/monday-ui-react-core/issues/2057)) ([d40b49e](https://github.com/mondaycom/monday-ui-react-core/commit/d40b49efc63fe943a71bf9ba643b513cf5f66d97)) + + + + + ## [2.100.1](https://github.com/mondaycom/monday-ui-react-core/compare/monday-ui-react-core@2.100.0...monday-ui-react-core@2.100.1) (2024-04-07) diff --git a/packages/core/CONTRIBUTING.md b/packages/core/CONTRIBUTING.md index 546aa8ec9b..bf75570de0 100644 --- a/packages/core/CONTRIBUTING.md +++ b/packages/core/CONTRIBUTING.md @@ -8,11 +8,11 @@ This library is open-sourced, and we encourage everyone to use and contribute in 1. Create a fork of this repository 2. Please use the correct node version it is listed in the `.nvmrc` file (you can use `nvm use` in order to switch to the right node version). -3. Install dependencies with `npm install` command +3. Install dependencies with `yarn install` command 4. Sync from upstream if needed -5. Run Storybook environment locally with `npm run storybook` command. -6. Make sure all components behave as expected by running all Jest tests locally with 'npm run test'. -7. If there are changes in some of the library snapshot tests, make sure all changes are intentional. If they are, update them with 'npm run test:update'. +5. Run Storybook environment locally with `yarn storybook` command. +6. Make sure all components behave as expected by running all Jest tests locally with 'yarn test'. +7. If there are changes in some of the library snapshot tests, make sure all changes are intentional. If they are, update them with 'yarn test:update'. 8. Commit to your local fork using [Semantic Commit Messages](https://seesparkbox.com/foundry/semantic_commit_messages) 9. Create a PR with title based using [Semantic Commit Messages](https://seesparkbox.com/foundry/semantic_commit_messages) For example: `feat: add new TextArea component` @@ -24,7 +24,7 @@ This library is open-sourced, and we encourage everyone to use and contribute in ### Creating new files in the library -Our code generator, Plop, is designed to simplify the creation of frequently used boilerplate code. To utilize it, execute the command `npm run plop`. If you want to learn more about Plop, you can find additional information [here](https://plopjs.com/). +Our code generator, Plop, is designed to simplify the creation of frequently used boilerplate code. To utilize it, execute the command `yarn plop`. If you want to learn more about Plop, you can find additional information [here](https://plopjs.com/). Currently, our Plop code generator supports the creation of the following: 1. Tests diff --git a/packages/core/README.md b/packages/core/README.md index 559a6997a4..f5de9dfa99 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -48,7 +48,7 @@ We are using storybook in order to develop the components independently of any c run this to build & run the storybook locally: ```bash -npm run storybook +yarn storybook ``` the storybook will be served on `http://localhost:7007` diff --git a/packages/core/TESTING_README.md b/packages/core/TESTING_README.md index 4a3d54fdc4..7a266a3705 100644 --- a/packages/core/TESTING_README.md +++ b/packages/core/TESTING_README.md @@ -62,7 +62,7 @@ describe("Tipseen tests", () => { ### Running Vibe tests **Snapshot and Behavior Tests:** -To run all snapshot and behavior tests locally, use the command: `npm run test`. +To run all snapshot and behavior tests locally, use the command: `yarn test`. **Local Storybook Interaction Tests:** To check interaction tests for a specific story in Storybook: diff --git a/packages/core/package.json b/packages/core/package.json index 26ff71d84c..c51ccbfa14 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "monday-ui-react-core", - "version": "2.100.1", + "version": "2.102.0", "description": "Official monday.com UI resources for application development in React.js", "main": "./dist/main.js", "types": "./dist/types.d.ts", @@ -109,7 +109,7 @@ "classnames": "^2.3.2", "framer-motion": "^6.5.1", "lodash-es": "^4.17.21", - "monday-ui-style": "0.4.0", + "monday-ui-style": "0.4.1", "prop-types": "^15.8.1", "react-dates": "21.8.0", "react-inlinesvg": "^3.0.1", @@ -121,7 +121,7 @@ "react-window": "^1.8.7", "react-windowed-select": "^2.0.4", "style-inject": "^0.3.0", - "vibe-storybook-components": "0.18.0" + "vibe-storybook-components": "0.18.1" }, "devDependencies": { "@babel/core": "^7.23.2", diff --git a/packages/core/src/components/Checkbox/Checkbox.tsx b/packages/core/src/components/Checkbox/Checkbox.tsx index b1954d63ac..9836f9bc6e 100644 --- a/packages/core/src/components/Checkbox/Checkbox.tsx +++ b/packages/core/src/components/Checkbox/Checkbox.tsx @@ -36,6 +36,8 @@ export interface CheckBoxProps extends VibeComponentProps { checked?: boolean; /** An in between state to display a non selected */ indeterminate?: boolean; + /** is autoFocus */ + autoFocus?: boolean; /** Set the option to be disabled */ disabled?: boolean; /** the default value which the checkbox will start from */ @@ -63,6 +65,7 @@ const Checkbox: VibeComponent = forwardRef( ariaLabelledBy, onChange = NOOP, checked, + autoFocus, indeterminate = false, disabled = false, defaultChecked, @@ -127,6 +130,7 @@ const Checkbox: VibeComponent = forwardRef( value={value} name={name} type="checkbox" + autoFocus={autoFocus} onChange={onChange} defaultChecked={overrideDefaultChecked} disabled={disabled} diff --git a/packages/core/src/components/Checkbox/__tests__/__snapshots__/checkbox-snapshot-tests.jest.tsx.snap b/packages/core/src/components/Checkbox/__tests__/__snapshots__/checkbox-snapshot-tests.jest.tsx.snap index c3d6b4bd7f..49a900db2a 100644 --- a/packages/core/src/components/Checkbox/__tests__/__snapshots__/checkbox-snapshot-tests.jest.tsx.snap +++ b/packages/core/src/components/Checkbox/__tests__/__snapshots__/checkbox-snapshot-tests.jest.tsx.snap @@ -1,5 +1,52 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Checkbox renders correctly when autoFocus 1`] = ` + +`; + exports[`Checkbox renders correctly when checked 1`] = `