Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore) Upgrade carbon #36

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dist/

# Intellij integration
*.iml
.idea

# ignores for Yarn v3 w/o PNP
.pnp.*
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = {
transformIgnorePatterns: ['/node_modules/(?!@openmrs)'],
moduleNameMapper: {
'@openmrs/esm-framework': '@openmrs/esm-framework/mock',
'@openmrs/esm-utils': '@openmrs/esm-framework/mock',
'\\.(s?css)$': 'identity-obj-proxy',
'^lodash-es/(.*)$': 'lodash/$1',
'lodash-es': 'lodash',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"url": "https://github.com/openmrs/openmrs-esm-template-app/issues"
},
"dependencies": {
"@carbon/react": "^1.33.1",
"@carbon/react": "^1.68.0",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
Expand Down Expand Up @@ -74,6 +74,7 @@
"dotenv": "^16.0.3",
"eslint": "^8.50.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"husky": "^8.0.3",
Expand Down
10 changes: 5 additions & 5 deletions src/boxes/extensions/box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* necessary. Here, the extensions set only their colors.
* Their sizes and other general features of their display
* is controlled by the slot. */
@import "~@openmrs/esm-styleguide/src/vars";
@use "@carbon/layout";
@use '@openmrs/esm-styleguide/src/vars' as *;

.blue {
background-color: darkblue;
}
Expand All @@ -19,5 +19,5 @@
.brand {
@include brand-01(background-color);
color: white;
padding: 8px;
}
padding: layout.$spacing-03;
}
14 changes: 7 additions & 7 deletions src/boxes/slot/boxes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
* `> * > *` is used to target the outermost DOM node of
* the extension.
*/
@use '@carbon/styles/scss/spacing';
@use '@carbon/layout';

.box > * > * {
height: spacing.$spacing-10;
width: spacing.$spacing-10;
height: layout.$spacing-10;
width: layout.$spacing-10;
}

.boxes {
margin: spacing.$spacing-07 0;
margin: layout.$spacing-07 0;
display: flex;
gap: spacing.$spacing-05;
gap: layout.$spacing-05;
}

.container {
max-width: 50rem;
margin-top: spacing.$spacing-09;
margin-top: layout.$spacing-09;

> * + * {
margin-top: spacing.$spacing-06;
margin-top: layout.$spacing-06;
}
}
1 change: 0 additions & 1 deletion src/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
declare module '@carbon/react';
declare module '*.css';
declare module '*.scss';
declare module '*.png';
Expand Down
6 changes: 3 additions & 3 deletions src/greeter/greeter.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@use '@carbon/styles/scss/spacing';
@use '@carbon/styles/scss/type';
@use '@carbon/layout';
@use '@carbon/type';

.container {
max-width: 50rem;

> * + * {
margin-top: spacing.$spacing-05;
margin-top: layout.$spacing-05;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/greeter/greeter.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useConfig } from '@openmrs/esm-framework';
import { Config } from '../config-schema';
import Greeter from './greeter.component';

const mockUseConfig = useConfig as jest.Mock;
const mockUseConfig = jest.mocked(useConfig<Config>);

it('displays the expected default text', () => {
const config: Config = { casualGreeting: false, whoToGreet: ['World'] };
Expand Down
8 changes: 4 additions & 4 deletions src/patient-getter/patient-getter.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@use '@carbon/styles/scss/spacing';
@use '@carbon/styles/scss/type';
@use '@carbon/layout';
@use '@carbon/type';

.container {
margin-top: spacing.$spacing-09;
margin-top: layout.$spacing-09;

> * + * {
margin-top: spacing.$spacing-06;
margin-top: layout.$spacing-06;
}
}

Expand Down
26 changes: 13 additions & 13 deletions src/resources/resources.scss
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
@use '@carbon/styles/scss/spacing';
@use '@carbon/styles/scss/type';
@use '@carbon/layout';
@use '@carbon/type';

.container {
padding: spacing.$spacing-07;
padding: layout.$spacing-07;
}

.heading {
@include type.type-style('heading-04');
margin: spacing.$spacing-05 0;
margin: layout.$spacing-05 0;
}

.explainer {
display: block;
}

.resources {
margin-top: spacing.$spacing-10;
margin-bottom: spacing.$spacing-09;
margin-top: layout.$spacing-10;
margin-bottom: layout.$spacing-09;

> * + * {
margin-right: spacing.$spacing-05;
margin-right: layout.$spacing-05;
}
}

.cardsContainer {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
column-gap: spacing.$spacing-06;
margin-top: spacing.$spacing-07;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
column-gap: layout.$spacing-06;
margin-top: layout.$spacing-07;
max-width: 75%;
}

.card {
margin: spacing.$spacing-03 0;
margin: layout.$spacing-03 0;
display: flex;
align-items: center;

Expand All @@ -41,7 +41,7 @@
}

svg {
margin-left: spacing.$spacing-02;
margin-left: layout.$spacing-02;
}
}

Expand All @@ -53,7 +53,7 @@
.title {
display: flex;
align-items: center;
margin-bottom: spacing.$spacing-05;
margin-bottom: layout.$spacing-05;

h4 {
@include type.type-style('heading-02');
Expand Down
10 changes: 5 additions & 5 deletions src/root.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@use '@carbon/styles/scss/spacing';
@use '@carbon/styles/scss/type';
@use '@carbon/layout';
@use '@carbon/type';

.container {
padding: spacing.$spacing-07;
padding: layout.$spacing-07;
}

.welcome {
@include type.type-style('heading-04');
margin: spacing.$spacing-05 0;
margin: layout.$spacing-05 0;
}

.explainer {
margin-bottom: 2rem;
margin-bottom: layout.$spacing-07;
}
2 changes: 1 addition & 1 deletion src/root.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import Root from './root.component';
* mock file. This line just tells TypeScript that the object is, in
* fact, a mock, and so will have methods like `mockReturnValue`.
*/
const mockUseConfig = useConfig as jest.Mock;
const mockUseConfig = jest.mocked(useConfig<Config>);

it('renders a landing page for the Template app', () => {
const config: Config = { casualGreeting: false, whoToGreet: ['World'] };
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"es2015.promise",
"es2016.array.include",
"es2018",
"es2020"
"es2020",
"es2022",
],
"resolveJsonModule": true,
"noEmit": true,
Expand Down
Loading
Loading