Skip to content

Commit

Permalink
chore: this is the commit
Browse files Browse the repository at this point in the history
  • Loading branch information
makafsal committed Sep 24, 2024
1 parent 9e7d0c9 commit ff42326
Show file tree
Hide file tree
Showing 359 changed files with 4,718 additions and 278 deletions.
9 changes: 9 additions & 0 deletions examples/carbon-for-ibm-products/APIKeyModal/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!--
@license
Copyright IBM Corp. 2020, 2024
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion examples/carbon-for-ibm-products/APIKeyModal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@carbon/ibm-products": "^2.21.0",
"@carbon/react": "^1.51.1",
"@carbon/react": "^1.60.3",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import React, { createContext, useReducer } from 'react';

export const themeData = [
{
text: 'System W/90',
value: 'carbon-theme--user-preference-white-90',
},
{
text: 'System 10/100',
value: 'carbon-theme--user-preference-10-100',
},
{
text: 'White',
value: 'carbon-theme--white',
Expand All @@ -22,17 +30,16 @@ export const themeData = [
export const ThemeContext = createContext();

const initialState = {
currentTheme: themeData[0],
currentTheme: themeData[1],
};

const themeReducer = (state, action) => {
switch (action.type.value) {
case 'carbon-theme--user-preference-white-90':
case 'carbon-theme--user-preference-10-100':
case 'carbon-theme--white':
return { currentTheme: action.type };
case 'carbon-theme--g10':
return { currentTheme: action.type };
case 'carbon-theme--g90':
return { currentTheme: action.type };
case 'carbon-theme--g100':
return { currentTheme: action.type };
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/themes';
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/config';

// Best to stick with user preference - DARK
@media (prefers-color-scheme: dark) {
:root {
@include theme(themes.$g100, true); // dark default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g100, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$g90, true);
}
}

// Best to stick with user preference - LIGHT
@media (prefers-color-scheme: light) {
:root {
@include theme(themes.$white, true); // light default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g10, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$white, true);
}
}

.carbon-theme--white {
@include theme(themes.$white, true);
}
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/APIKeyModal/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/react' with (
$font-path: '@ibm/plex'
);
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/APIKeyModal/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

Expand Down
9 changes: 9 additions & 0 deletions examples/carbon-for-ibm-products/AboutModal/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!--
@license
Copyright IBM Corp. 2020, 2024
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion examples/carbon-for-ibm-products/AboutModal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@carbon/ibm-products": "^2.21.0",
"@carbon/react": "^1.51.1",
"@carbon/react": "^1.60.3",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import React, { createContext, useReducer } from 'react';

export const themeData = [
{
text: 'System W/90',
value: 'carbon-theme--user-preference-white-90',
},
{
text: 'System 10/100',
value: 'carbon-theme--user-preference-10-100',
},
{
text: 'White',
value: 'carbon-theme--white',
Expand All @@ -22,17 +30,16 @@ export const themeData = [
export const ThemeContext = createContext();

const initialState = {
currentTheme: themeData[0],
currentTheme: themeData[1],
};

const themeReducer = (state, action) => {
switch (action.type.value) {
case 'carbon-theme--user-preference-white-90':
case 'carbon-theme--user-preference-10-100':
case 'carbon-theme--white':
return { currentTheme: action.type };
case 'carbon-theme--g10':
return { currentTheme: action.type };
case 'carbon-theme--g90':
return { currentTheme: action.type };
case 'carbon-theme--g100':
return { currentTheme: action.type };
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/themes';
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/config';

// Best to stick with user preference - DARK
@media (prefers-color-scheme: dark) {
:root {
@include theme(themes.$g100, true); // dark default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g100, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$g90, true);
}
}

// Best to stick with user preference - LIGHT
@media (prefers-color-scheme: light) {
:root {
@include theme(themes.$white, true); // light default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g10, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$white, true);
}
}

.carbon-theme--white {
@include theme(themes.$white, true);
}
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/AboutModal/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/react' with (
$font-path: '@ibm/plex'
);
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/AboutModal/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

Expand Down
9 changes: 9 additions & 0 deletions examples/carbon-for-ibm-products/BigNumbers/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!--
@license
Copyright IBM Corp. 2020, 2024
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion examples/carbon-for-ibm-products/BigNumbers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@carbon/ibm-products": "^2.21.0",
"@carbon/react": "^1.51.1",
"@carbon/react": "^1.60.3",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import React, { createContext, useReducer } from 'react';

export const themeData = [
{
text: 'System W/90',
value: 'carbon-theme--user-preference-white-90',
},
{
text: 'System 10/100',
value: 'carbon-theme--user-preference-10-100',
},
{
text: 'White',
value: 'carbon-theme--white',
Expand All @@ -22,17 +30,16 @@ export const themeData = [
export const ThemeContext = createContext();

const initialState = {
currentTheme: themeData[0],
currentTheme: themeData[1],
};

const themeReducer = (state, action) => {
switch (action.type.value) {
case 'carbon-theme--user-preference-white-90':
case 'carbon-theme--user-preference-10-100':
case 'carbon-theme--white':
return { currentTheme: action.type };
case 'carbon-theme--g10':
return { currentTheme: action.type };
case 'carbon-theme--g90':
return { currentTheme: action.type };
case 'carbon-theme--g100':
return { currentTheme: action.type };
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/themes';
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/config';

// Best to stick with user preference - DARK
@media (prefers-color-scheme: dark) {
:root {
@include theme(themes.$g100, true); // dark default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g100, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$g90, true);
}
}

// Best to stick with user preference - LIGHT
@media (prefers-color-scheme: light) {
:root {
@include theme(themes.$white, true); // light default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g10, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$white, true);
}
}

.carbon-theme--white {
@include theme(themes.$white, true);
}
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/BigNumbers/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/react' with (
$font-path: '@ibm/plex'
);
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/BigNumbers/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

Expand Down
9 changes: 9 additions & 0 deletions examples/carbon-for-ibm-products/Cascade/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!--
@license
Copyright IBM Corp. 2020, 2024
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion examples/carbon-for-ibm-products/Cascade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@carbon/ibm-products": "^2.21.0",
"@carbon/react": "^1.51.1",
"@carbon/react": "^1.60.3",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Loading

0 comments on commit ff42326

Please sign in to comment.