Skip to content
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
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ Sass files for DataCite services, built on top of [Bootstrap](https://getbootstr

## Importing
Import into a JavaScript project using yarn to add directly from the GitHub repo. Specify the version in the command.<br>
example: `yarn add https://github.com/datacite/maltipoo#0.0.1`<br>
example: `yarn add https://github.com/datacite/maltipoo#2.2.0`<br>

Then import into a `css` file<br>
`@import 'maltipoo/dist/stylesheets/doi.min.css';`<br>
Import TypeScript/JavaScript constants from the package root:<br>
`import { RESOURCE_TYPE } from 'maltipoo';`<br>

Import the stylesheet into a `css` file<br>
`@import 'maltipoo/stylesheets/doi.min.css';`<br>

or a JavaScript file<br>
`import 'maltipoo/stylesheets/doi.min.css';`<br>

The legacy explicit dist path remains available if needed:<br>
`import 'maltipoo/dist/stylesheets/doi.min.css';`<br>

## Local development
Expand All @@ -29,7 +35,7 @@ Note: Node 22+ required (pinned in [`.tool-versions`](.tool-versions))
4. `yarn install`
5. `yarn build`

The generated `css` files are placed in `dist/stylesheets`
The generated JavaScript and TypeScript declaration files are placed in `dist`, and the generated `css` files are placed in `dist/stylesheets`

## Issues

Expand Down
56 changes: 56 additions & 0 deletions dist/colorPalettes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
export declare const OTHER: {
readonly Other: "gray";
readonly Missing: "#555";
readonly Unknown: "#555";
};
export declare const OTHER_DOMAIN: string[];
export declare const OTHER_RANGE: ("gray" | "#555")[];
export declare const RESOURCE_TYPE: {
Audiovisual: string;
Award: string;
Book: string;
"Book Chapter": string;
Collection: string;
"Computational Notebook": string;
"Conference Paper": string;
"Conference Proceeding": string;
"Data Paper": string;
Dataset: string;
Dissertation: string;
Event: string;
Image: string;
Instrument: string;
"Interactive Resource": string;
Journal: string;
"Journal Article": string;
Model: string;
"Output Management Plan": string;
"Peer Review": string;
"Physical Object": string;
Preprint: string;
Project: string;
Report: string;
Service: string;
Software: string;
Sound: string;
Standard: string;
"Study Registration": string;
Text: string;
Workflow: string;
Other: string;
Missing: "#555";
Unknown: "#555";
};
export declare const RESOURCE_TYPE_DOMAIN: string[];
export declare const RESOURCE_TYPE_RANGE: string[];
export declare const LICENSE_RANGE: string[];
export declare const IDENTIFIER_DOMAIN: string[];
export declare const IDENTIFIER_RANGE: string[];
export declare const CONTRIBUTOR_DOMAIN: string[];
export declare const CONTRIBUTOR_RANGE: string[];
export declare const AFFILIATION_DOMAIN: string[];
export declare const AFFILIATION_RANGE: string[];
export declare const FIELD_OF_SCIENCE_DOMAIN: string[];
export declare const FIELD_OF_SCIENCE_RANGE: string[];
export declare const REGISTRATION_AGENCY_DOMAIN: string[];
export declare const REGISTRATION_AGENCY_RANGE: string[];
219 changes: 219 additions & 0 deletions dist/colorPalettes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
export const OTHER = {
Other: "gray",
Missing: "#555",
Unknown: "#555",
};
export const OTHER_DOMAIN = Object.keys(OTHER);
export const OTHER_RANGE = Object.values(OTHER);
export const RESOURCE_TYPE = {
...OTHER,
Audiovisual: "#A6C4FF",
Award: "#D5AC2B",
Book: "#6D702B",
"Book Chapter": "#FFDBA0",
Collection: "#007A5B",
"Computational Notebook": "#FFAEAE",
"Conference Paper": "#8E5BAE",
"Conference Proceeding": "#AC90BA",
"Data Paper": "#7C4E47",
Dataset: "#00B1E2",
Dissertation: "#B79D99",
Event: "#E377C2",
Image: "#FFCCF0",
Instrument: "#2C3A44",
"Interactive Resource": "#65716A",
Journal: "#B1CBB3",
"Journal Article": "#B5C11F",
Model: "#6AFFC7",
"Output Management Plan": "#00B0B9",
"Peer Review": "#4190DE",
"Physical Object": "#0B5E8E",
Preprint: "#89F4F6",
Project: "#B19BFE",
Report: "#83A8B9",
Service: "#D0ECFF",
Software: "#E25003",
Sound: "#FE8256",
Standard: "#EBA45D",
"Study Registration": "#6DBB5E",
Text: "#FFE2D7",
Workflow: "#9F3F34",
Other: "#C07E62",
};
export const RESOURCE_TYPE_DOMAIN = Object.keys(RESOURCE_TYPE);
export const RESOURCE_TYPE_RANGE = Object.values(RESOURCE_TYPE);
// Source: https://r-charts.com/color-palettes/#discrete
// paletteer_d("ggthemes::Tableau_20")
export const LICENSE_RANGE = [
'#4E79A7',
'#A0CBE8',
'#F28E2B',
'#FFBE7D',
'#59A14F',
'#8CD17D',
'#B6992D',
'#F1CE63',
'#499894',
'#86BCB6',
'#E15759',
'#FF9D9A',
'#79706E',
'#BAB0AC',
'#D37295',
'#FABFD2',
'#B07AA1',
'#D4A6C8',
'#9D7660',
'#D7B5A6',
];
export const IDENTIFIER_DOMAIN = [
'DOI',
...OTHER_DOMAIN
];
// Source: https://r-charts.com/color-palettes/#discrete
// paletteer_d("ggthemes::Classic_Green_Orange_6")
export const IDENTIFIER_RANGE = [
'#7B66D2FF',
// '#DC5FBDFF',
// '#94917BFF',
// '#995688FF',
// '#D098EEFF',
// '#D7D5C5FF',
...OTHER_RANGE
];
// ORCID: #2CA02C
export const CONTRIBUTOR_DOMAIN = [
'Creator',
'Data Curator',
'Project Leader'
];
export const CONTRIBUTOR_RANGE = [
'red',
'green',
'blue'
];
export const AFFILIATION_DOMAIN = [
'Affiliation 1',
'Affiliation 2',
'Affiliation 3'
];
export const AFFILIATION_RANGE = [
'red',
'green',
'blue'
];
export const FIELD_OF_SCIENCE_DOMAIN = [
'No Field of Science',
'Natural sciences',
'Mathematics',
'Computer and information sciences',
'Physical sciences',
'Chemical sciences',
'Earth and related environmental sciences',
'Biological sciences',
'Other natural sciences',
'Engineering and technology',
'Civil engineering',
'Electrical engineering, electronic engineering, information engineering',
'Mechanical engineering',
'Chemical engineering',
'Materials engineering',
'Medical engineering',
'Environmental engineering',
'Environmental biotechnology',
'Industrial biotechnology',
'Nano-technology',
'Other engineering and technologies',
'Medical and health sciences',
'Basic medicine',
'Clinical medicine',
'Health sciences',
'Medical biotechnology',
'Other medical sciences',
'Agricultural sciences',
'Agriculture, forestry, and fisheries',
'Animal and dairy science',
'Veterinary science',
'Agricultural biotechnology',
'Other agricultural sciences',
'Social sciences',
'Psychology',
'Economics and business',
'Educational sciences',
'Sociology',
'Law',
'Political science',
'Social and economic geography',
'Media and communications',
'Other social sciences',
'Humanities',
'History and archaeology',
'Languages and literature',
'Philosophy, ethics and religion',
'Arts (arts, history of arts, performing arts, music)',
'Other humanities'
];
export const FIELD_OF_SCIENCE_RANGE = [
'#d9d9d9',
'#ffffb3',
'#ccebc5',
'#8dd3c7',
'#8dd3c7',
'#8dd3c7',
'#8dd3c7',
'#8dd3c7',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#8dd3c7',
'#80b1d3',
'#b3de69',
'#fdb462',
'#fccde5',
'#ccebc5',
'#ccebc5',
'#ffed6f'
];
export const REGISTRATION_AGENCY_DOMAIN = [
'No Registration Agency',
'Airiti',
'CNKI',
'Crossref',
'DataCite',
'ISTIC',
'JaLC',
'KISTI',
'mEDRA',
'OP'
];
export const REGISTRATION_AGENCY_RANGE = [
'#d9d9d9',
'#ffffb3',
'#ccebc5',
'#E81A31',
'#159DEA',
'#8dd3c7',
'#8dd3c7',
'#8dd3c7',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#80b1d3',
'#8dd3c7',
'#80b1d3',
'#b3de69',
'#fdb462',
'#fccde5',
'#ccebc5',
'#ccebc5',
'#ffed6f'
];
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { RESOURCE_TYPE, RESOURCE_TYPE_DOMAIN, RESOURCE_TYPE_RANGE, LICENSE_RANGE, IDENTIFIER_DOMAIN, IDENTIFIER_RANGE, CONTRIBUTOR_DOMAIN, CONTRIBUTOR_RANGE, AFFILIATION_DOMAIN, AFFILIATION_RANGE, FIELD_OF_SCIENCE_DOMAIN, FIELD_OF_SCIENCE_RANGE, REGISTRATION_AGENCY_DOMAIN, REGISTRATION_AGENCY_RANGE, OTHER, OTHER_DOMAIN, OTHER_RANGE, } from "./colorPalettes";
1 change: 1 addition & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@
"name": "maltipoo",
"version": "2.1.2",
"description": "Base stylesheet for DataCite",
"type": "module",
"scripts": {
"clean": "rimraf dist",
"build": "yarn clean && yarn sass src/stylesheets/doi.scss dist/stylesheets/doi.css && postcss dist/stylesheets/doi.css -o dist/stylesheets/doi.min.css"
"build": "yarn clean && yarn build:ts && yarn build:css",
"build:css": "yarn sass src/stylesheets/doi.scss dist/stylesheets/doi.css && postcss dist/stylesheets/doi.css -o dist/stylesheets/doi.min.css",
"build:ts": "tsc -p tsconfig.json"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
Comment thread
bklaing2 marked this conversation as resolved.
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"./stylesheets/doi.css": "./dist/stylesheets/doi.css",
"./stylesheets/doi.min.css": "./dist/stylesheets/doi.min.css",
"./dist/stylesheets/doi.css": "./dist/stylesheets/doi.css",
"./dist/stylesheets/doi.min.css": "./dist/stylesheets/doi.min.css"
},
"main": "dist/stylesheets/doi.min.css",
"repository": "https://github.com/datacite/maltipoo",
"license": "MIT",
"devDependencies": {
Expand All @@ -16,7 +31,8 @@
"postcss": "^8.5.15",
"postcss-cli": "^11.0.1",
"rimraf": "^6.1.3",
"sass": "^1.100.0"
"sass": "^1.100.0",
"typescript": "^5.9.3"
},
"packageManager": "yarn@4.16.0+sha512.5374c94eb4ef6aa8188fb112f20c1aa6569f248d676c5e576e1fd2a1a4d8d87a96df65d9dfe1c2a0252cbe38bda46cf18d955005b81b43cc7607a5c9d56fd2b6"
}
File renamed without changes.
Loading