Skip to content

Commit

Permalink
feat: new package "@blueprintjs/colors" (#4858)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Szmucer <pszmucer@palantir.com>
Co-authored-by: Adi Dahiya <adahiya@palantir.com>
  • Loading branch information
3 people authored Aug 17, 2021
1 parent d4c7729 commit 22cb3fb
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dev:select": "lerna run dev --parallel --scope \"@blueprintjs/{core,select,docs-app}\"",
"dev:table": "lerna run dev --parallel --scope \"@blueprintjs/table-dev-app\"",
"dist": "run-s dist:libs dist:apps",
"dist:libs": "lerna run dist --parallel --scope \"@blueprintjs/{core,datetime,docs-theme,icons,popover2,select,table,timezone}\"",
"dist:libs": "lerna run dist --parallel --scope \"@blueprintjs/{colors,core,datetime,docs-theme,icons,popover2,select,table,timezone}\"",
"dist:apps": "lerna run dist --parallel --scope \"@blueprintjs/{docs-app,landing-app,table-dev-app}\"",
"docs-data": "lerna run compile --scope \"@blueprintjs/docs-data\"",
"format": "prettier --write \"./**/*.{ts,tsx,json}\"",
Expand Down
6 changes: 6 additions & 0 deletions packages/colors/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"root": true,
"extends": ["../../.eslintrc.js"],
"rules": {},
"ignorePatterns": ["node_modules", "dist", "lib", "fixtures", "coverage", "__snapshots__", "generated"]
}
28 changes: 28 additions & 0 deletions packages/colors/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "@blueprintjs/colors",
"version": "0.0.0",
"description": "Blueprint color definitions and utilities",
"main": "lib/index.js",
"scripts": {
"clean": "rm -rf lib/*",
"compile": "tsc -p src/",
"lint": "run-p lint:scss lint:es",
"lint:es": "es-lint",
"lint:scss": "sass-lint",
"lint-fix": "es-lint --fix && sass-lint --fix",
"test": "mocha test/index.js"
},
"dependencies": {},
"devDependencies": {
"@blueprintjs/node-build-scripts": "^1.5.1",
"mocha": "^8.2.1",
"typescript": "^4.1.2"
},
"repository": {
"type": "git",
"url": "git@github.com:palantir/blueprint.git",
"directory": "packages/colors"
},
"author": "Palantir Technologies",
"license": "Apache-2.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,3 @@ $sepia2: #7d5125 !default;
$sepia3: #96622d !default;
$sepia4: #b07b46 !default;
$sepia5: #c99765 !default;

@import "color-aliases";
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Copyright 2021 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
17 changes: 17 additions & 0 deletions packages/colors/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2021 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export { Colors } from "./colors";
9 changes: 9 additions & 0 deletions packages/colors/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../config/tsconfig.base",
"compilerOptions": {
"lib": ["es6", "dom"],
"module": "commonjs",
"outDir": "../lib",
"target": "ES2015"
}
}
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dist": "run-s \"dist:*\"",
"dist:bundle": "cross-env NODE_ENV=production webpack",
"dist:css": "css-dist lib/css/*.css",
"dist:variables": "generate-css-variables common/_colors.scss common/_color-aliases.scss common/_variables.scss",
"dist:variables": "generate-css-variables ../../colors/src/colors.scss common/_color-aliases.scss common/_variables.scss",
"dist:verify": "assert-package-layout",
"lint": "run-p lint:scss lint:es",
"lint:scss": "sass-lint",
Expand All @@ -46,6 +46,7 @@
"verify": "npm-run-all compile -p dist test lint"
},
"dependencies": {
"@blueprintjs/colors": "^0.0.0",
"@blueprintjs/icons": "^3.27.0",
"@types/dom4": "^2.0.1",
"classnames": "^2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/blueprint-hi-contrast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $pt-intent-danger: #c23030 !default; // $red2;

// Import files in the same order that they are documented in the docs
@import "common/variables";
@import "common/colors";
@import "~@blueprintjs/colors/src/colors";

@import "reset";
@import "typography";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/blueprint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Licensed under the Apache License, Version 2.0.

// Import files in the same order that they are documented in the docs
@import "common/variables";
@import "common/colors";
@import "~@blueprintjs/colors/src/colors";

@import "reset";
@import "typography";
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/common/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@import "colors";
@import "~@blueprintjs/colors/src/colors";
@import "color-aliases";
@import "flex";

$pt-intent-colors: (
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/common/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@import "colors";
@import "~@blueprintjs/colors/src/colors";
@import "color-aliases";
@import "mixins";

// Namespace appended to the beginning of each CSS class: `.#{$ns}-button`.
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ export * from "./abstractPureComponent";
export * from "./abstractPureComponent2";
export * from "./alignment";
export * from "./boundary";
export * from "./colors";
export * from "./constructor";
export * from "./elevation";
export * from "./intent";
export * from "./position";
export * from "./props";
export * from "./refs";

import { Colors } from "@blueprintjs/colors";

import * as Classes from "./classes";
import * as Keys from "./keys";
import * as Utils from "./utils";

export { Classes, Keys, Utils };
export { Classes, Keys, Utils, Colors };
// NOTE: Errors is not exported in public API
2 changes: 1 addition & 1 deletion packages/stylelint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "mocha test/index.js"
},
"dependencies": {
"@blueprintjs/core": "^3.47.0",
"@blueprintjs/colors": "^0.0.0",
"postcss": "^7.0.35",
"postcss-selector-parser": "^6.0.5",
"postcss-value-parser": "^4.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-plugin/src/rules/no-color-literal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import valueParser from "postcss-value-parser";
import stylelint, { RuleTesterContext } from "stylelint";
import type { Plugin } from "stylelint";

import { Colors } from "@blueprintjs/core";
import { Colors } from "@blueprintjs/colors";

import { checkImportExists } from "../utils/checkImportExists";
import {
Expand Down

0 comments on commit 22cb3fb

Please sign in to comment.