Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@instructure/ui-themes

Package Overview
Dependencies
Maintainers
0
Versions
2026
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instructure/ui-themes - npm Package Compare versions

Comparing version 10.6.1-snapshot-1 to 10.6.1-snapshot-11

2

CHANGELOG.md

@@ -6,3 +6,3 @@ # Change Log

## [10.6.1-snapshot-1](https://github.com/instructure/instructure-ui/compare/v10.6.0...v10.6.1-snapshot-1) (2024-11-19)
## [10.6.1-snapshot-11](https://github.com/instructure/instructure-ui/compare/v10.6.0...v10.6.1-snapshot-11) (2024-11-22)

@@ -9,0 +9,0 @@ **Note:** Version bump only for package @instructure/ui-themes

@@ -24,6 +24,21 @@ /*

*/
import { canvas, canvasHighContrast } from '..';
import { canvas, canvasHighContrast, canvasThemeLocal } from '..';
import '@testing-library/jest-dom';
import { ThemeRegistry } from '@instructure/theme-registry';
const themes = [canvas, canvasHighContrast];
describe('themes are backwards compatible', () => {
it('Local themes are not affected by ".use()"', async () => {
var _ThemeRegistry$getCur, _ThemeRegistry$getCur2, _ThemeRegistry$getCur3, _canvasThemeLocal$col, _canvasThemeLocal$col2;
canvas.use({
overrides: {
colors: {
primitives: {
white: 'blue'
}
}
}
});
expect((_ThemeRegistry$getCur = ThemeRegistry.getCurrentTheme()) === null || _ThemeRegistry$getCur === void 0 ? void 0 : (_ThemeRegistry$getCur2 = _ThemeRegistry$getCur.colors) === null || _ThemeRegistry$getCur2 === void 0 ? void 0 : (_ThemeRegistry$getCur3 = _ThemeRegistry$getCur2.primitives) === null || _ThemeRegistry$getCur3 === void 0 ? void 0 : _ThemeRegistry$getCur3.white).toEqual('blue');
expect(canvasThemeLocal === null || canvasThemeLocal === void 0 ? void 0 : (_canvasThemeLocal$col = canvasThemeLocal.colors) === null || _canvasThemeLocal$col === void 0 ? void 0 : (_canvasThemeLocal$col2 = _canvasThemeLocal$col.primitives) === null || _canvasThemeLocal$col2 === void 0 ? void 0 : _canvasThemeLocal$col2.white).toEqual('#FFFFFF');
});
describe("should be able to access theme variables with 'theme.variables.x'", () => {

@@ -30,0 +45,0 @@ for (const theme of themes) {

@@ -25,7 +25,7 @@ /*

import canvasHighContrast from './themes/canvasHighContrast';
import canvas from './themes/canvas';
import canvasHighContrast, { canvasHighContrastThemeLocal } from './themes/canvasHighContrast';
import canvas, { canvasThemeLocal } from './themes/canvas';
import { primitives, additionalPrimitives } from './sharedThemeTokens/colors/primitives';
import dataVisualization from './sharedThemeTokens/colors/dataVisualization';
export { canvas, canvasHighContrast, primitives, additionalPrimitives, dataVisualization };
export { canvas, canvasThemeLocal, canvasHighContrast, canvasHighContrastThemeLocal, primitives, additionalPrimitives, dataVisualization };
export default canvas;

@@ -54,2 +54,7 @@ var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4, _colors$contrasts5, _colors$contrasts6, _colors$contrasts7, _colors$contrasts8, _colors$contrasts9, _colors$contrasts10, _colors$contrasts11, _colors$contrasts12, _colors$contrasts13;

};
/**
* Canvas theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
* Will be default in the next major version of InstUI
*/
const __theme = {

@@ -62,2 +67,3 @@ key,

const theme = ThemeRegistry.registerTheme(__theme);
export default theme;
export default theme;
export { __theme as canvasThemeLocal };

@@ -29,2 +29,8 @@ /*

const key = 'canvas-high-contrast';
/**
* Canvas high contrast theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
*
* Will be default in the next major version of InstUI
*/
const __theme = {

@@ -37,2 +43,4 @@ key,

const theme = ThemeRegistry.registerTheme(__theme);
export default theme;
export default theme;
// theme without the use() function and `variables` prop
export { __theme as canvasHighContrastThemeLocal };

@@ -5,2 +5,3 @@ "use strict";

require("@testing-library/jest-dom");
var _themeRegistry = require("@instructure/theme-registry");
/*

@@ -32,2 +33,16 @@ * The MIT License (MIT)

describe('themes are backwards compatible', () => {
it('Local themes are not affected by ".use()"', async () => {
var _ThemeRegistry$getCur, _ThemeRegistry$getCur2, _ThemeRegistry$getCur3, _canvasThemeLocal$col, _canvasThemeLocal$col2;
_.canvas.use({
overrides: {
colors: {
primitives: {
white: 'blue'
}
}
}
});
expect((_ThemeRegistry$getCur = _themeRegistry.ThemeRegistry.getCurrentTheme()) === null || _ThemeRegistry$getCur === void 0 ? void 0 : (_ThemeRegistry$getCur2 = _ThemeRegistry$getCur.colors) === null || _ThemeRegistry$getCur2 === void 0 ? void 0 : (_ThemeRegistry$getCur3 = _ThemeRegistry$getCur2.primitives) === null || _ThemeRegistry$getCur3 === void 0 ? void 0 : _ThemeRegistry$getCur3.white).toEqual('blue');
expect(_.canvasThemeLocal === null || _.canvasThemeLocal === void 0 ? void 0 : (_canvasThemeLocal$col = _.canvasThemeLocal.colors) === null || _canvasThemeLocal$col === void 0 ? void 0 : (_canvasThemeLocal$col2 = _canvasThemeLocal$col.primitives) === null || _canvasThemeLocal$col2 === void 0 ? void 0 : _canvasThemeLocal$col2.white).toEqual('#FFFFFF');
});
describe("should be able to access theme variables with 'theme.variables.x'", () => {

@@ -34,0 +49,0 @@ for (const theme of themes) {

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {

@@ -25,2 +26,14 @@ value: true

});
Object.defineProperty(exports, "canvasHighContrastThemeLocal", {
enumerable: true,
get: function () {
return _canvasHighContrast.canvasHighContrastThemeLocal;
}
});
Object.defineProperty(exports, "canvasThemeLocal", {
enumerable: true,
get: function () {
return _canvas.canvasThemeLocal;
}
});
Object.defineProperty(exports, "dataVisualization", {

@@ -39,4 +52,4 @@ enumerable: true,

});
var _canvasHighContrast = _interopRequireDefault(require("./themes/canvasHighContrast"));
var _canvas = _interopRequireDefault(require("./themes/canvas"));
var _canvasHighContrast = _interopRequireWildcard(require("./themes/canvasHighContrast"));
var _canvas = _interopRequireWildcard(require("./themes/canvas"));
var _primitives = require("./sharedThemeTokens/colors/primitives");

@@ -43,0 +56,0 @@ var _dataVisualization = _interopRequireDefault(require("./sharedThemeTokens/colors/dataVisualization"));

@@ -7,3 +7,3 @@ "use strict";

});
exports.default = void 0;
exports.default = exports.canvasThemeLocal = void 0;
var _sharedThemeTokens = _interopRequireDefault(require("../../sharedThemeTokens"));

@@ -61,3 +61,8 @@ var _themeRegistry = require("@instructure/theme-registry");

};
const __theme = {
/**
* Canvas theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
* Will be default in the next major version of InstUI
*/
const __theme = exports.canvasThemeLocal = {
key,

@@ -64,0 +69,0 @@ ..._sharedThemeTokens.default,

@@ -7,3 +7,3 @@ "use strict";

});
exports.default = void 0;
exports.default = exports.canvasHighContrastThemeLocal = void 0;
var _sharedThemeTokens = _interopRequireDefault(require("../../sharedThemeTokens"));

@@ -37,3 +37,9 @@ var _themeRegistry = require("@instructure/theme-registry");

const key = 'canvas-high-contrast';
const __theme = {
/**
* Canvas high contrast theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
*
* Will be default in the next major version of InstUI
*/
const __theme = exports.canvasHighContrastThemeLocal = {
key,

@@ -45,2 +51,2 @@ description: 'This theme meets WCAG 2.0 AA rules for color contrast.',

const theme = _themeRegistry.ThemeRegistry.registerTheme(__theme);
var _default = exports.default = theme;
var _default = exports.default = theme; // theme without the use() function and `variables` prop
{
"name": "@instructure/ui-themes",
"version": "10.6.1-snapshot-1",
"version": "10.6.1-snapshot-11",
"description": "A library of instructure themes",

@@ -25,3 +25,3 @@ "author": "Instructure, Inc. Engineering and Product Design",

"devDependencies": {
"@instructure/ui-babel-preset": "10.6.1-snapshot-1",
"@instructure/ui-babel-preset": "10.6.1-snapshot-11",
"@testing-library/jest-dom": "^6.4.6",

@@ -32,4 +32,4 @@ "@testing-library/react": "^16.0.1",

"dependencies": {
"@instructure/shared-types": "10.6.1-snapshot-1",
"@instructure/theme-registry": "10.6.1-snapshot-1"
"@instructure/shared-types": "10.6.1-snapshot-11",
"@instructure/theme-registry": "10.6.1-snapshot-11"
},

@@ -36,0 +36,0 @@ "publishConfig": {

@@ -21,10 +21,2 @@ ---

- global theming:
```js
import canvas from '@instructure/ui-themes'
canvas.use()
```
- application level theming:

@@ -43,5 +35,13 @@

- (DEPRECATED) global theming:
```js
import canvas from '@instructure/ui-themes'
canvas.use()
```
##### To override the theme variables:
- globally:
- (DEPRECATED) globally:

@@ -48,0 +48,0 @@ ```js

@@ -35,4 +35,6 @@ /*

import canvasHighContrast from './themes/canvasHighContrast'
import canvas from './themes/canvas'
import canvasHighContrast, {
canvasHighContrastThemeLocal
} from './themes/canvasHighContrast'
import canvas, { canvasThemeLocal } from './themes/canvas'

@@ -65,3 +67,5 @@ import {

canvas,
canvasThemeLocal,
canvasHighContrast,
canvasHighContrastThemeLocal,
primitives,

@@ -68,0 +72,0 @@ additionalPrimitives,

@@ -62,2 +62,7 @@ /*

/**
* Canvas theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
* Will be default in the next major version of InstUI
*/
const __theme: CanvasTheme = {

@@ -73,1 +78,2 @@ key,

export default theme
export { __theme as canvasThemeLocal }

@@ -36,2 +36,8 @@ /*

/**
* Canvas high contrast theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
*
* Will be default in the next major version of InstUI
*/
const __theme: CanvasHighContrastTheme = {

@@ -43,4 +49,6 @@ key,

}
const theme = ThemeRegistry.registerTheme(__theme)
export default theme
// theme without the use() function and `variables` prop
export { __theme as canvasHighContrastThemeLocal }
import type { CanvasHighContrastTheme } from './themes/canvasHighContrast';
import type { CanvasTheme, CanvasBrandVariables } from './themes/canvas';
import type { BaseTheme, Primitives, AdditionalPrimitives, DataVisualization, UI } from '@instructure/shared-types';
import canvasHighContrast from './themes/canvasHighContrast';
import canvas from './themes/canvas';
import canvasHighContrast, { canvasHighContrastThemeLocal } from './themes/canvasHighContrast';
import canvas, { canvasThemeLocal } from './themes/canvas';
import { primitives, additionalPrimitives } from './sharedThemeTokens/colors/primitives';

@@ -20,5 +20,5 @@ import dataVisualization from './sharedThemeTokens/colors/dataVisualization';

};
export { canvas, canvasHighContrast, primitives, additionalPrimitives, dataVisualization };
export { canvas, canvasThemeLocal, canvasHighContrast, canvasHighContrastThemeLocal, primitives, additionalPrimitives, dataVisualization };
export default canvas;
export type { ThemeMap, BaseTheme, Theme, ThemeKeys, ThemeSpecificStyle, CanvasTheme, CanvasBrandVariables, CanvasHighContrastTheme, Primitives, AdditionalPrimitives, DataVisualization, UI };
//# sourceMappingURL=index.d.ts.map

@@ -25,4 +25,11 @@ import sharedThemeTokens from '../../sharedThemeTokens';

} & CanvasBrandVariables;
/**
* Canvas theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
* Will be default in the next major version of InstUI
*/
declare const __theme: CanvasTheme;
declare const theme: import("@instructure/theme-registry").Theme<CanvasTheme>;
export default theme;
export { __theme as canvasThemeLocal };
//# sourceMappingURL=index.d.ts.map

@@ -8,4 +8,12 @@ import sharedThemeTokens from '../../sharedThemeTokens';

};
/**
* Canvas high contrast theme without the `use` function and `variables` prop.
* Not affected by global theme overrides (`.use()` function).
*
* Will be default in the next major version of InstUI
*/
declare const __theme: CanvasHighContrastTheme;
declare const theme: import("@instructure/theme-registry").Theme<CanvasHighContrastTheme>;
export default theme;
export { __theme as canvasHighContrastThemeLocal };
//# sourceMappingURL=index.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc