3.1.60 • Published 2 days ago

@thi.ng/hiccup-carbon-icons v3.1.60

Weekly downloads
29
License
Apache-2.0
Repository
github
Last release
2 days ago

hiccup-carbon-icons

npm version npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

This package provides the full set of IBM's Carbon icons in hiccup format (i.e. as Javascript encoded SVG), counting in at ~1100 and ready to be used within any @thi.ng/hiccup supporting scenario.

Each icon is defined in its own source file and can be imported individually. The converted icons are based on the 32x32 pixel versions, but have NO explicit size set (only viewBox attrib). Use the withSize() helper to inject a size, e.g. withSize(DOWNLOAD, "12px").

Contact sheet

All icons can be previewed here: contact sheet. (Source code)

Status

STABLE - used in production

Search or submit any issues for this package

Installation

yarn add @thi.ng/hiccup-carbon-icons

ES module import:

<script type="module" src="https://cdn.skypack.dev/@thi.ng/hiccup-carbon-icons"></script>

Skypack documentation

For Node.js REPL:

# with flag only for < v16
node --experimental-repl-await

> const hiccupCarbonIcons = await import("@thi.ng/hiccup-carbon-icons");

Package sizes (gzipped, pre-treeshake): ESM: 99.08 KB

Dependencies

None

Usage examples

Several demos in this repo's /examples directory are using this package.

A selection:

ScreenshotDescriptionLive demoSource
Canvas based Immediate Mode GUI componentsDemoSource
Parser grammar livecoding editor/playground & codegenDemoSource
rdom drag & drop exampleDemoSource

API

Generated API docs

import { renderOnce } from "@thi.ng/hdom";
import { CODE } from "@thi.ng/hiccup-carbon-icons";

// using tachyons css classes for brevity
const iconButton = (icon, onclick, label?) =>
    ["a", { onclick, href: "#" },
        ["span.dib.w1.h1.mr1", icon],
        label];

renderOnce(iconButton(CODE, () => alert("hi"), "show me the code"));

Icon conversion process

(For contributors only...)

The icon conversion is largely automated via the supplied bash script (currently with some additional minor manual cleanup needed) and requires svgo and a checkout of both the original carbon and the umbrella mono repos.

# install pre-requisites
yarn global add svgo

git clone https://github.com/thi-ng/umbrella.git

# build entire umbrella repo
cd umbrella
yarn build

# build xml to hiccup converter CLI tool
cd examples/xml-converter
yarn build-cli

# switch to package root
cd ../../hiccup-carbon-icons

# clone carbon repo into local temp dir
git clone https://github.com/carbon-design-system/carbon.git tmp

# convert original SVG icons and write results to package src folder
yarn build:convert src tmp/packages/icons/src/svg/32

# update contact sheet (will be written to package root)
yarn build:sheet

# open in browser
open contact-sheet.html

# fixup any conversion issues (rinse & repeat...)
# e.g. in the latest version (2020/08), several icons use paths w/ opacity=0 which need to be removed

# rebuild package
yarn build

Authors

Karsten Schmidt

If this project contributes to an academic publication, please cite it as:

@misc{thing-hiccup-carbon-icons,
  title = "@thi.ng/hiccup-carbon-icons",
  author = "Karsten Schmidt",
  note = "https://thi.ng/hiccup-carbon-icons",
  year = 2018
}

License

The copyright of the original icons is with IBM. The icons were published under the same license as this package.

© 2018 - 2021 Karsten Schmidt // Apache Software License 2.0

3.1.60

2 days ago

3.1.59

17 days ago

3.1.58

20 days ago

3.1.57

29 days ago

3.1.56

1 month ago

3.1.55

1 month ago

3.1.54

2 months ago

3.1.53

2 months ago

3.1.52

2 months ago

3.1.51

3 months ago

3.1.50

3 months ago

3.1.49

3 months ago

3.1.48

3 months ago

3.1.45

3 months ago

3.1.47

3 months ago

3.1.46

3 months ago

3.1.43

4 months ago

3.1.41

4 months ago

3.1.42

4 months ago

3.1.39

5 months ago

3.1.40

5 months ago

3.1.38

5 months ago

3.1.37

5 months ago

3.1.34

6 months ago

3.1.36

5 months ago

3.1.35

6 months ago

3.1.30

8 months ago

3.1.32

6 months ago

3.1.31

7 months ago

3.1.24

9 months ago

3.1.27

9 months ago

3.1.26

9 months ago

3.1.29

9 months ago

3.1.28

9 months ago

3.1.23

11 months ago

3.1.22

1 year ago

3.1.21

1 year ago

3.1.20

1 year ago

3.1.19

1 year ago

3.1.18

1 year ago

3.1.17

1 year ago

3.1.16

1 year ago

3.1.15

1 year ago

3.1.12

2 years ago

3.1.11

2 years ago

3.1.14

1 year ago

3.1.13

1 year ago

3.1.10

2 years ago

3.1.9

2 years ago

3.1.8

2 years ago

3.1.7

2 years ago

3.1.6

2 years ago

3.1.5

2 years ago

3.1.4

2 years ago

3.0.8

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.7

3 years ago

3.0.4

3 years ago

3.0.6

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.25

3 years ago

2.0.24

3 years ago

2.0.22

3 years ago

2.0.23

3 years ago

2.0.21

3 years ago

2.0.20

3 years ago

2.0.19

3 years ago

2.0.18

3 years ago

2.0.17

3 years ago

2.0.16

3 years ago

2.0.15

3 years ago

2.0.13

3 years ago

2.0.14

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.44

4 years ago

1.0.45

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago