Skip to content

Commit

Permalink
Release v4.1.1 (#1112)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-bot <[email protected]>
Co-authored-by: Jerrod Heiser <[email protected]>
  • Loading branch information
4 people authored Jul 13, 2023
1 parent 1da7612 commit 0d718be
Show file tree
Hide file tree
Showing 38 changed files with 270 additions and 47 deletions.
5 changes: 5 additions & 0 deletions .changeset/docs-typos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-magma-docs': patch
---

Update typos
5 changes: 5 additions & 0 deletions .changeset/fix-inputBase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-magma-dom': patch
---

fix(Input Base): Fixed case where default value of `0` did not render the default value in the input field.
5 changes: 5 additions & 0 deletions .changeset/maxLength-warnings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-magma-dom': patch
---

fix(Input/Textarea): Fix `maxLength` console warning regarding passing a boolean attribute
19 changes: 19 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@react-magma/charts": "4.0.1",
"@react-magma/dropzone": "4.0.0",
"react-magma-dom": "4.1.0",
"@react-magma/schema-renderer": "4.0.0",
"@cengage-patterns/header": "6.0.0",
"react-magma-docs": "5.0.2",
"react-magma-landing": "1.1.2"
},
"changesets": [
"docs-typos",
"fix-inputBase",
"maxLength-warnings",
"tabprops"
]
}
5 changes: 5 additions & 0 deletions .changeset/tabprops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-magma-dom': patch
---

docs(tabs): Update TabProps to remove `isActive`-- this component does not use it. use `activeIndex` on the `TabsContainer` to indicate the active tab.
4 changes: 2 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: preview
name: Preview (within a pull request)
on:
pull_request:
branches:
- dev
- main
- v3
- 'dev-patch'
- 'patch-*'
types: [opened, edited, synchronize, reopened]
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Latest
name: Publish Latest (main)
on:
push:
branches:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/publish-next-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Publish Next Patch (dev-patch)
on:
push:
branches:
- dev-patch
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-node@v2
with:
node-version: '14'
check-latest: true
- name: Check Node version
run: node -v
- name: Update NPM version
run: npm install -g "npm@^7.6.3"
- name: Install
run: npm ci
- name: Test
run: npm test
- name: Coverage
uses: codecov/codecov-action@v1
- name: Configure NPM
run: |
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc
- name: Check if Prerelease
id: check_files
uses: andstor/file-existence-action@v1
with:
files: ".changeset/pre.json"
- name: Enter Prerelease Mode
if: steps.check_files.outputs.files_exists == 'false'
run: |
npm run version:prerelease
git add .changeset/pre.json
- name: Publish
run: |
npm run version:pkgs
git commit -am "chore: enter prerelease mode"
npm run release
git push --follow-tags
- name: Get Alias
id: info
run: |
echo "::set-output name=alias::$(npm run --silent getAlias)"
echo "::set-output name=version::$(npm run --silent getVersion)"
- name: Build Docs
run: npm run build:docs
- name: Build Storybook
run: npm run build:storybook
- name: Deploy Docs to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './website/react-magma-docs/public'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
alias: next-patch
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Deploy Dev Storybook to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './storybook-static'
production-branch: patch-3.x.x
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: false
alias: storybook-preview-dev-patch
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Next
name: Publish Next (dev)
on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-patch.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Patch
name: Publish Patch (patch-*)
on:
push:
branches:
Expand Down
7 changes: 7 additions & 0 deletions packages/charts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @react-magma/charts

## 4.0.2-next.0

### Patch Changes

- Updated dependencies [871820e8d]
- [email protected]

## 4.0.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/charts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-magma/charts",
"version": "4.0.1",
"version": "4.0.2-next.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -30,7 +30,7 @@
"@emotion/styled": "^10.0.27",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-magma-dom": "^4.1.0-next.2",
"react-magma-dom": "^4.1.1-next.0",
"react-magma-icons": "^3.0.0"
},
"dependencies": {
Expand All @@ -41,7 +41,7 @@
"@emotion/styled": "^10.0.27",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-magma-dom": "^4.1.0",
"react-magma-dom": "^4.1.1-next.0",
"react-magma-icons": "^3.0.0"
}
}
7 changes: 7 additions & 0 deletions packages/dropzone/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 4.0.1-next.0

### Patch Changes

- Updated dependencies [871820e8d]
- [email protected]

## 4.0.0

## 4.0.0-next.1
Expand Down
6 changes: 3 additions & 3 deletions packages/dropzone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-magma/dropzone",
"version": "4.0.0",
"version": "4.0.1-next.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -30,7 +30,7 @@
"@emotion/styled": "^10.0.27",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-magma-dom": "^4.1.0-next.2",
"react-magma-dom": "^4.1.1-next.0",
"react-magma-icons": "^3.0.0"
},
"dependencies": {
Expand All @@ -42,7 +42,7 @@
"@emotion/styled": "^10.0.27",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-magma-dom": "^4.1.0",
"react-magma-dom": "^4.1.1-next.0",
"react-magma-icons": "^3.0.0"
}
}
3 changes: 3 additions & 0 deletions packages/react-magma-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


## 4.1.0

### Minor Changes
Expand All @@ -16,6 +18,7 @@

Please note that in the meantime, `maxLength` is still supported but will need to be changed to `maxCount` as future releases will remove `maxLength` and `hasCharacterCounter`.

- caee2a755: fix(CharCounter): Update calculation for character length on rerender.
- d0c69155a: fix(inputbase): Update icon/button position for inputs with two icons.
- 6f53d1891: fix(Modal): Added support for closing individual nested modals with escape key.
- 395aea21c: fix(Pagination): Spacing, Tooltip inverse state, and VoiceOver support fixes.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-magma-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-magma-dom",
"version": "4.1.0",
"version": "4.1.1-next.2",
"description": "",
"main": "dist/index.js",
"module": "dist/esm/index.js",
Expand Down
20 changes: 20 additions & 0 deletions packages/react-magma-dom/src/components/Input/Input.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,26 @@ describe('Input', () => {
expect(getByLabelText(iconAriaLabel)).toBeDisabled();
});

it('should initially render with value of `defaultValue` if no `value` provided', () => {
const labelText = 'test label';
const defaultValue = 'defaultValue';
const { getByLabelText } = render(
<Input labelText={labelText} defaultValue={defaultValue} />
);

expect(getByLabelText(labelText)).toHaveAttribute('value', defaultValue);
});

it('should render with value "0" when `defaultValue` is 0', () => {
const labelText = 'test label';
const defaultValue = 0;
const { getByLabelText } = render(
<Input labelText={labelText} defaultValue={defaultValue} />
);

expect(getByLabelText(labelText)).toHaveAttribute('value', '0');
});

it('should render an input with a value passed through', () => {
const labelText = 'test label';
const value = 'Test Value';
Expand Down
4 changes: 3 additions & 1 deletion packages/react-magma-dom/src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(

const maxCharacters = typeof maxCount === 'number' ? maxCount : maxLength;

const maxLengthNum = !hasCharacterCounter && maxLength ? maxLength : undefined;

const isInverse = useIsInverse(props.isInverse);

const [characterLength, setCharacterLength] = useState(
Expand Down Expand Up @@ -103,7 +105,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
inputSize={inputSize}
inputLength={characterLength}
isInverse={isInverse}
maxLength={!hasCharacterCounter && maxLength}
maxLength={maxLengthNum}
onChange={handleChange}
onClear={handleClear}
ref={ref}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export const Default = args => {
labelText="Input"
isClearable
/>
<Input
defaultValue={0}
labelText="Default value `0`"
isClearable
/>
<PasswordInput
errorMessage="danger will robinson."
labelText="PasswordInput"
Expand Down Expand Up @@ -141,6 +146,12 @@ export const Inverse = args => {
isClearable
isInverse
/>
<Input
defaultValue={0}
labelText="Default value `0`"
isClearable
isInverse
/>
<PasswordInput
errorMessage="danger will robinson."
labelText="PasswordInput"
Expand Down
13 changes: 10 additions & 3 deletions packages/react-magma-dom/src/components/InputBase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,14 @@ export const InputBase = React.forwardRef<HTMLInputElement, InputBaseProps>(

const [value, setValue] = React.useState<
string | ReadonlyArray<string> | number
>(props.defaultValue || props.value || '');
>(
props.defaultValue !== undefined &&
props.defaultValue !== null
? props.defaultValue
: props.value || ''
);

const maxLengthNum = !hasCharacterCounter && maxLength ? maxLength : undefined;

React.useEffect(() => {
if (props.value !== undefined && props.value !== null) {
Expand Down Expand Up @@ -623,7 +630,7 @@ export const InputBase = React.forwardRef<HTMLInputElement, InputBaseProps>(
isPredictive={isPredictive}
hasError={hasError}
ref={ref}
maxLength={!hasCharacterCounter && maxLength}
maxLength={maxLengthNum}
onChange={handleChange}
style={inputStyle}
theme={theme}
Expand Down Expand Up @@ -652,7 +659,7 @@ export const InputBase = React.forwardRef<HTMLInputElement, InputBaseProps>(
</IconWrapper>
)}
</InputWrapper>
{isClearable && value && (
{isClearable && value !== '' && (
<IsClearableContainer
theme={theme}
iconPosition={iconPosition}
Expand Down
5 changes: 0 additions & 5 deletions packages/react-magma-dom/src/components/Tabs/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export interface TabProps
* Icon to display within the component
*/
icon?: React.ReactElement<any> | React.ReactElement<any>[];
/**
* If true, the component will display with the active/selected state
* @default false
*/
isActive?: boolean;
isInverse?: boolean;
/**
* @internal
Expand Down
4 changes: 3 additions & 1 deletion packages/react-magma-dom/src/components/Textarea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
const descriptionId = errorMessage || helperMessage ? `${id}__desc` : null;
const maxCharacters = typeof maxCount === 'number' ? maxCount : maxLength;

const maxLengthNum = !hasCharacterCounter && maxLength ? maxLength : undefined;

const [value, setValue] = React.useState<
string | ReadonlyArray<string> | number
>(props.defaultValue || props.value || '');
Expand Down Expand Up @@ -130,7 +132,7 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
(hasCharacterCounter && characterLength > maxCharacters)
}
id={id}
maxLength={!hasCharacterCounter && maxLength}
maxLength={maxLengthNum}
isInverse={isInverse}
onChange={handleChange}
ref={ref}
Expand Down
Loading

2 comments on commit 0d718be

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.