Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
2nikhiltom committed Jul 1, 2024
2 parents ee20e94 + a06f763 commit 216186e
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: Add issue with enhancement label to the Proposals project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
with:
labeled: ${{ env.LABEL_ENHANCEMENT }}
project-url: ${{ env.PROPOSALS_PROJECT_URL }}
Expand All @@ -31,7 +31,7 @@ jobs:
name: Add issue with typescript label to the TypeScript Adoption project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
with:
labeled: ${{ env.LABEL_TYPESCRIPT }}
project-url: ${{ env.TYPESCRIPT_PROJECT_URL }}
Expand All @@ -41,7 +41,7 @@ jobs:
name: Add issue with AI4UX label to the AI4UX project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
with:
labeled: ${{ env.LABEL_AI4UX }}
project-url: ${{ env.AI4UX_PROJECT_URL }}
Expand All @@ -51,7 +51,7 @@ jobs:
name: Add issue to the Design System project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
with:
labeled: ${{ env.LABEL_ENHANCEMENT }}, ${{ env.LABEL_TYPESCRIPT }}
label-operator: NOT
Expand Down
4 changes: 2 additions & 2 deletions examples/class-prefix/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "class-prefix",
"private": true,
"version": "0.58.0-rc.0",
"version": "0.58.0-rc.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/custom-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "custom-theme",
"private": true,
"version": "0.59.0-rc.0",
"version": "0.59.0-rc.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/id-prefix/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "id-prefix",
"private": true,
"version": "0.58.0-rc.0",
"version": "0.58.0-rc.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/light-dark-mode/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "examples-light-dark",
"private": true,
"version": "0.59.0-rc.0",
"version": "0.59.0-rc.1",
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"next": "14.1.1",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "examples-nextjs",
"private": true,
"version": "0.61.0-rc.0",
"version": "0.61.0-rc.1",
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"next": "14.1.1",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/v10-token-compat-in-v11/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "v10-token-compat-in-v11",
"private": true,
"version": "0.59.0-rc.0",
"version": "0.59.0-rc.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "vite",
"private": true,
"version": "0.59.0-rc.0",
"version": "0.59.0-rc.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/carbon-components-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "carbon-components-react",
"description": "The Carbon Design System is IBM’s open-source design system for products and experiences.",
"version": "8.61.0-rc.0",
"version": "8.61.0-rc.1",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -42,7 +42,7 @@
"sass": "^1.33.0"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"@carbon/styles": "^1.61.0-rc.0",
"@ibm/telemetry-js": "^1.5.0",
"chalk": "1.1.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/react",
"description": "React components for the Carbon Design System",
"version": "1.61.0-rc.0",
"version": "1.61.0-rc.1",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
13 changes: 13 additions & 0 deletions packages/react/src/components/Pagination/Pagination-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,18 @@ describe('Pagination', () => {
document.querySelector('.cds--select__page-number')
).not.toBeInTheDocument();
});

it('should handle zero total items', () => {
render(
<Pagination
totalItems={0}
pageSizes={[10, 20]}
pageSize={10}
page={1}
/>
);

expect(screen.getByText('0–0 of 0 items')).toBeInTheDocument();
});
});
});
6 changes: 4 additions & 2 deletions packages/react/src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const Pagination = React.forwardRef(function Pagination(
});
const totalPages = totalItems
? Math.max(Math.ceil(totalItems / pageSize), 1)
: NaN;
: 1;
const backButtonDisabled = disabled || page === 1;
const backButtonClasses = cx({
[`${prefix}--pagination__button`]: true,
Expand Down Expand Up @@ -366,7 +366,9 @@ const Pagination = React.forwardRef(function Pagination(
<span
className={`${prefix}--pagination__text ${prefix}--pagination__items-count`}>
{pagesUnknown || !totalItems
? itemText(pageSize * (page - 1) + 1, page * pageSize)
? totalItems === 0
? itemRangeText(0, 0, 0)
: itemText(pageSize * (page - 1) + 1, page * pageSize)
: itemRangeText(
Math.min(pageSize * (page - 1) + 1, totalItems),
Math.min(page * pageSize, totalItems),
Expand Down
4 changes: 2 additions & 2 deletions www/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "www",
"private": true,
"version": "0.70.0-rc.0",
"version": "0.70.0-rc.1",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand All @@ -22,7 +22,7 @@
"start": "next start"
},
"dependencies": {
"@carbon/react": "^1.61.0-rc.0",
"@carbon/react": "^1.61.0-rc.1",
"@octokit/core": "^4.0.0",
"@octokit/plugin-retry": "^3.0.9",
"@octokit/plugin-throttling": "^4.0.0",
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ __metadata:
languageName: unknown
linkType: soft

"@carbon/react@npm:^1.61.0-rc.0, @carbon/react@workspace:packages/react":
"@carbon/react@npm:^1.61.0-rc.1, @carbon/react@workspace:packages/react":
version: 0.0.0-use.local
resolution: "@carbon/react@workspace:packages/react"
dependencies:
Expand Down Expand Up @@ -9907,7 +9907,7 @@ __metadata:
"@babel/plugin-transform-react-constant-elements": "npm:^7.17.12"
"@babel/preset-env": "npm:^7.18.2"
"@babel/preset-react": "npm:^7.17.12"
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
"@carbon/styles": "npm:^1.61.0-rc.0"
"@carbon/test-utils": "npm:^10.30.0"
"@ibm/telemetry-js": "npm:^1.5.0"
Expand Down Expand Up @@ -10279,7 +10279,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "class-prefix@workspace:examples/class-prefix"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
"@vitejs/plugin-react": "npm:4.0.0"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
Expand Down Expand Up @@ -11652,7 +11652,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "custom-theme@workspace:examples/custom-theme"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
"@vitejs/plugin-react": "npm:4.0.0"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
Expand Down Expand Up @@ -13826,7 +13826,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "examples-light-dark@workspace:examples/light-dark-mode"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
eslint: "npm:8.40.0"
next: "npm:14.1.1"
react: "npm:18.2.0"
Expand All @@ -13839,7 +13839,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "examples-nextjs@workspace:examples/nextjs"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
eslint: "npm:8.40.0"
eslint-config-next: "npm:13.4.7"
next: "npm:14.1.1"
Expand Down Expand Up @@ -16026,7 +16026,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "id-prefix@workspace:examples/id-prefix"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
"@vitejs/plugin-react": "npm:4.0.0"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
Expand Down Expand Up @@ -27752,7 +27752,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "v10-token-compat-in-v11@workspace:examples/v10-token-compat-in-v11"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
"@vitejs/plugin-react": "npm:4.0.0"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
Expand Down Expand Up @@ -28038,7 +28038,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "vite@workspace:examples/vite"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
"@vitejs/plugin-react": "npm:4.0.0"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
Expand Down Expand Up @@ -28599,7 +28599,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "www@workspace:www"
dependencies:
"@carbon/react": "npm:^1.61.0-rc.0"
"@carbon/react": "npm:^1.61.0-rc.1"
"@octokit/core": "npm:^4.0.0"
"@octokit/plugin-retry": "npm:^3.0.9"
"@octokit/plugin-throttling": "npm:^4.0.0"
Expand Down

0 comments on commit 216186e

Please sign in to comment.