Skip to content

Commit

Permalink
Merge branch 'canary' into pr/2845
Browse files Browse the repository at this point in the history
  • Loading branch information
wingkwong committed May 16, 2024
2 parents c6a40b5 + 8988981 commit c67c283
Show file tree
Hide file tree
Showing 284 changed files with 2,903 additions and 1,368 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"baseBranch": "canary",
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
Expand Down
9 changes: 9 additions & 0 deletions .changeset/dull-experts-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@nextui-org/autocomplete": patch
"@nextui-org/calendar": patch
"@nextui-org/date-input": patch
"@nextui-org/date-picker": patch
"@nextui-org/use-intersection-observer": patch
---

Update React Aria packages
5 changes: 5 additions & 0 deletions .changeset/eighty-kids-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

Revise slider styles (#2880)
7 changes: 7 additions & 0 deletions .changeset/few-oranges-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@nextui-org/system": patch
"@nextui-org/system-rsc": patch
"@nextui-org/theme": patch
---

The `cn` utility was moved the `theme` package and updated to support NextUI custom classes.
5 changes: 5 additions & 0 deletions .changeset/heavy-hairs-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/accordion": patch
---

Make the accordion item heading tag customizable to satisfy a11y needs. Headings on web pages need to be consistent and semantic; this will help all users better find the content they are looking for. (#2950)
5 changes: 5 additions & 0 deletions .changeset/honest-pianos-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

remove unnecessary origin-bottom in button
6 changes: 6 additions & 0 deletions .changeset/mean-parrots-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/tabs": patch
"@nextui-org/theme": patch
---

Add `destroyInactiveTabPanel` prop for Tabs component (#1562)
6 changes: 6 additions & 0 deletions .changeset/nasty-pillows-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/calendar": patch
"@nextui-org/theme": patch
---

Fixed hiding of unavailable dates in RangeCalendar (#2890)
5 changes: 5 additions & 0 deletions .changeset/rotten-zoos-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/switch": patch
---

Fixed react-hook-form uncontrolled switch component
40 changes: 40 additions & 0 deletions .changeset/seven-bears-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
"@nextui-org/accordion": patch
"@nextui-org/autocomplete": patch
"@nextui-org/avatar": patch
"@nextui-org/badge": patch
"@nextui-org/breadcrumbs": patch
"@nextui-org/button": patch
"@nextui-org/calendar": patch
"@nextui-org/card": patch
"@nextui-org/checkbox": patch
"@nextui-org/date-input": patch
"@nextui-org/date-picker": patch
"@nextui-org/dropdown": patch
"@nextui-org/image": patch
"@nextui-org/input": patch
"@nextui-org/link": patch
"@nextui-org/listbox": patch
"@nextui-org/menu": patch
"@nextui-org/modal": patch
"@nextui-org/navbar": patch
"@nextui-org/pagination": patch
"@nextui-org/popover": patch
"@nextui-org/progress": patch
"@nextui-org/radio": patch
"@nextui-org/ripple": patch
"@nextui-org/select": patch
"@nextui-org/skeleton": patch
"@nextui-org/slider": patch
"@nextui-org/snippet": patch
"@nextui-org/switch": patch
"@nextui-org/table": patch
"@nextui-org/tabs": patch
"@nextui-org/tooltip": patch
"@nextui-org/react": patch
"@nextui-org/system": patch
"@nextui-org/theme": patch
"@nextui-org/framer-utils": patch
---

Add support for disabling the animations globally.
5 changes: 5 additions & 0 deletions .changeset/slow-mice-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

add pointer-events-none to skeleton base (#1714)
5 changes: 5 additions & 0 deletions .changeset/swift-trains-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/date-picker": patch
---

keep date picker style consistent for different variants (#2901)
5 changes: 5 additions & 0 deletions .changeset/thick-plants-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/table": patch
---

Add missing export of `TableRowProps` type (#2584)
5 changes: 5 additions & 0 deletions .changeset/wicked-planets-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

set overflow visible after skeleton loaded (#2125)
5 changes: 5 additions & 0 deletions .changeset/witty-birds-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

Fixed incorrect margin on labels for RTL required inputs. (#2780)
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ reviews:
drafts: false
base_branches:
- "main"
- "develop"
- "canary"
- "fix/.*"
- "chore/.*"
- "feat/.*"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/QA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: QA
on:
pull_request:
branches:
- main
- canary

jobs:
build:
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- ".changeset/**"
- "packages/**"
branches:
- main
- canary

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -41,12 +41,21 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create @dev release
- name: Sync files from canary to main branch if a publish happens
if: steps.changesets.outputs.published == 'true'
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/owner/repo/dispatches \
-d '{"event_type":"sync-canary-to-main"}'
- name: Create canary release
if: steps.changesets.outputs.published != 'true'
run: |
git checkout main
pnpm version:dev
pnpm release:dev
git checkout canary
pnpm version:canary
pnpm release:canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/sync-canary-to-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Sync Canary to Main

on:
# triggered manually in Github
workflow_dispatch:
# triggered by the type "sync-canary-to-main" (e.g. from release action after publishing)
repository_dispatch:
types: [sync-canary-to-main]

jobs:
create_pull_request:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure all history is fetched

- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: "canary"
destination_branch: "main"
pr_title: "Auto-sync Canary to Main"
pr_body: |
## Automated: Sync from Canary to Main
This Pull Request is automatically generated to sync the changes from the Canary branch to the Main branch. Below are the included updates:
### Triggered by a Direct Push to Canary:
- Please check the recent commits on the Canary branch directly as this sync may include multiple changes.
### Triggered by a Pull Request Merge:
- Merged Pull Request: [PR#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) - ${{ github.event.pull_request.title }}
- PR Description: ${{ github.event.pull_request.body }}
- Merged by: ${{ github.event.pull_request.merged_by.login }}
### Action Required:
- Please review the changes carefully.
- Approve and merge the Pull Request if everything is in order.
Thank you for maintaining the Main branch updated and clean.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ https://www.conventionalcommits.org/ or check out the

## Pull Request Guidelines

- The `main` branch is basically a snapshot of the latest stable version. All development must be done in dedicated branches.
- The `main` branch is basically a snapshot of the latest production version. All development must be done in dedicated branches and will be merged to `canary` branch.
- Make sure that Github Actions are green
- It is good to have multiple small commits while working on the PR. We'll let GitHub squash it automatically before the merge.
- If you add a new feature:
Expand All @@ -73,14 +73,14 @@ https://www.conventionalcommits.org/ or check out the

1. Fork of the nextui repository and clone your fork

2. Create a new branch out of the `main` branch. We follow the convention
2. Create a new branch out of the `canary` branch. We follow the convention
`[type/scope]`. For example `fix/dropdown-hook` or `docs/menu-typo`. `type`
can be either `docs`, `fix`, `feat`, `build`, or any other conventional
commit type. `scope` is just a short id that describes the scope of work.

3. Make and commit your changes following the
[commit convention](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md#commit-convention).
As you develop, you can run `pnpm build --filter=<module>` and
As you canary, you can run `pnpm build --filter=<module>` and
`pnpm test packages/<module>/<pkg>` e.g. `pnpm build --filter=avatar & pnpm test packages/components/avatar` to make sure everything works as expected.

> To know more about the `--filter` option, please check the turborepo [docs](https://turborepo.org/docs/core-concepts/filtering).
Expand Down Expand Up @@ -200,9 +200,9 @@ npm run build
6. Send your pull request:

- Send your pull request to the `main` branch
- Send your pull request to the `canary` branch
- Your pull request will be reviewed by the maintainers and the maintainers will decide if it is accepted or not
- Once the pull request is accepted, the maintainers will merge it to the `main` branch
- Once the pull request is accepted, the maintainers will merge it to the `canary` branch

## Visual Changes

Expand Down
20 changes: 20 additions & 0 deletions apps/docs/components/cmdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ export const Cmdk: FC<{}> = () => {
}
};

const prioritizeFirstLevelItems = (a: SearchResultItem, b: SearchResultItem) => {
if (a.type === "lvl1") {
return -1;
} else if (b.type === "lvl1") {
return 1;
}

return 0;
};

const results = useMemo<SearchResultItem[]>(
function getResults() {
if (query.length < 2) return [];
Expand All @@ -165,12 +175,22 @@ export const Cmdk: FC<{}> = () => {
if (words.length === 1) {
return matchSorter(data, query, {
keys: MATCH_KEYS,
sorter: (matches) => {
matches.sort((a, b) => prioritizeFirstLevelItems(a.item, b.item));

return matches;
},
}).slice(0, MAX_RESULTS);
}

const matchesForEachWord = words.map((word) =>
matchSorter(data, word, {
keys: MATCH_KEYS,
sorter: (matches) => {
matches.sort((a, b) => prioritizeFirstLevelItems(a.item, b.item));

return matches;
},
}),
);

Expand Down
4 changes: 3 additions & 1 deletion apps/docs/components/docs/components/codeblock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,11 @@ const Codeblock = forwardRef<HTMLPreElement, CodeblockProps>(
style={{
...props.style,
...(highlightStyleToken.some((t) => {
const content = token.content.trim();

const regex = t instanceof RegExp ? t : new RegExp(t);

return regex.test(token.content.trim());
return regex.test(content);
})
? {color: "rgb(var(--code-function))"}
: {}),
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/components/docs/components/import-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ type PackageManager = {
};

const importTabs: PackageManager[] = [
{
key: "main",
name: "Main",
},
{
key: "individual",
name: "Individual",
},
{
key: "main",
name: "Global",
},
];

export interface ImportTabsProps {
Expand Down

0 comments on commit c67c283

Please sign in to comment.