Skip to content

Commit 41942a9

Browse files
authored
fixed readme not showing in npmjs (#45)
* fixed readme not showing in npmjs * fixed svg * updated generated files
1 parent 5e36e21 commit 41942a9

File tree

7 files changed

+133
-128
lines changed

7 files changed

+133
-128
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111
#### Breaking changes
1212

13+
## 1.7.1
14+
15+
### Fixed
16+
- Fixed the README.md files so they render properly on npmjs.com.
17+
- Fixed items--search--initial SVG
18+
1319
## 1.7.0
1420

1521
### Added

README.md

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -21,134 +21,8 @@ This repository contains the following packages:
2121
| **`@hcl-software/enchanted-icons`** | React (Material-UI) components. |
2222
| **`@hcl-software/enchanted-icons-web-component`** | Standard Web Components. |
2323

24-
## Installation
25-
26-
### React
27-
28-
```sh
29-
npm install @hcl-software/enchanted-icons
30-
```
31-
### Web Components
32-
```sh
33-
npm install @hcl-software/enchanted-icons-web-component
34-
```
35-
36-
## Usage
37-
38-
In most cases, the Enchanted Components use the correct icons to adhere to the Enchanted design language; however, there may be valid reasons to use
39-
icons directly from this library. **Always consult with your UX contact when using icons directly from this library.**
40-
41-
### Usage (React)
42-
The React icons are Material-UI `<SvgIcon>` components and support all of its props.
43-
44-
#### Icon size
45-
```jsx
46-
import CheckmarkIcon from '@hcl-software/enchanted-icons/dist/carbon/es/checkmark';
47-
...
48-
<CheckmarkIcon fontSize="small" />
49-
```
50-
or
51-
```jsx
52-
import CheckmarkIcon from '@hcl-software/enchanted-icons/dist/carbon/es/checkmark';
53-
...
54-
<CheckmarkIcon fontSize="16px" />
55-
```
56-
57-
#### Icon color
58-
```jsx
59-
import CheckmarkIcon from '@hcl-software/enchanted-icons/dist/carbon/es/checkmark';
60-
...
61-
<CheckmarkIcon color="success" />
62-
```
63-
Note: It is strongly recommended to use the thematic names of colors of the Enchanted theme, rather than explicit rgba values. For example, `"success"` or `"action"`. This ensures consistency of colors across the UI and over time.
64-
65-
#### Icon button
66-
A common pattern is to use an icon in conjunction with an Enchanted `<IconButton>`
67-
```jsx
68-
import IconButton from '@hcl-software/enchanted-react-components/dist/IconButton';
69-
import RocketIcon from '@hcl-software/enchanted-icons/dist/carbon/es/rocket';
70-
...
71-
<IconButton size="small" aria-label="launch"><RocketIcon /></IconButton>
72-
```
73-
Note: In this case the size of the icon is determined by the `size` prop of the `<IconButton>`. The icon color is controlled by the different button states (active, disabled, etc) and should not be overriden.
74-
75-
### Advanced
76-
Icons from this library can take any props supported by MUI's `<SvgIcon>` component. See https://v5.mui.com/material-ui/api/svg-icon/
77-
**Always consult with your UX contact before applying any advanced styling.**
78-
79-
### Usage (Web Components)
80-
Web Components can be used in any web framework or plain HTML.
81-
82-
**1. Import the icon definition**
83-
You must first import the icon's JavaScript file to define the custom element. This is typically done once in your application's main entry point.
84-
```javascript
85-
import '@hcl-software/enchanted-icons-web-component/dist/carbon/es/rocket';
86-
import '@hcl-software/enchanted-icons-web-component/dist/apps/es/app-switcher';
87-
```
88-
89-
**2. Use the HTML tag**
90-
Once defined, you can use the icon's custom HTML tag. The tag name is `icon-` followed by the icon's name (e.g., `icon-rocket`, `icon-app-switcher`).
91-
```html
92-
<icon-rocket></icon-rocket>
93-
```
94-
95-
Icons with double dash in their name like `chevron--up` will use single dash in their component name.
96-
```javascript
97-
import '@hcl-software/enchanted-icons-web-component/dist/carbon/es/chevron--up';
98-
99-
// Usage
100-
<icon-chevron-up></icon-chevron-up>
101-
```
102-
103-
**Styling (Size and Color)**
104-
You can style the icons by setting the `size` and `color` properties on the element.
105-
106-
**As HTML attributes:**
107-
```html
108-
<icon-rocket size="32"></icon-rocket>
109-
110-
<icon-app-switcher color="blue"></icon-app-switcher>
111-
```
112-
113-
**As JavaScript properties:**
114-
```javascript
115-
const myIcon = document.querySelector('icon-rocket');
116-
myIcon.size = 24;
117-
myIcon.color = 'var(--my-theme-color)';
118-
```
119-
120-
**With CSS Custom Properties (Advanced):**
121-
The icons are styled internally with CSS Custom Properties. You can override these variables globally to set a theme for all icons.
122-
```css
123-
/* Set a default theme size and color for all icons on the page */
124-
body {
125-
--icon-theme-size: 24px;
126-
--icon-theme-color: #3d3d3d;
127-
}
128-
```
12924

13025
## Development
131-
This is a monorepo. To install dependencies for development, run `npm install` from within each package's directory (e.g., `packages/react`, `packages/web-component`, `packages/icons-builder`).
132-
133-
Other development commands (like those listed in the tables below) must also be run from within their respective package directories.
134-
135-
### Common Scripts
136-
These scripts are available in both the React (@hcl-software/enchanted-icons) and Web Component (@hcl-software/enchanted-icons-web-component) packages.
137-
138-
| task | command | description |
139-
|--|--|--|
140-
| **Build** | `npm run build` | Compiles the package source code into a `dist` folder. |
141-
| **Lints** | `npm run lint` | Runs the linter to check for code style issues. |
142-
| **Lint (Fix)** | `npm run lint-fix` | Runs the linter and automatically fixes resolvable issues. |
143-
144-
This script is available in the internal `packages/icons-builder` package.
145-
146-
| task | command | description |
147-
|--|--|--|
148-
| **Generate** | `npm run generate` | Generates all React and Web Component icons from source SVG files. |
149-
150-
## Lerna Commands
151-
15226
This repository uses [Lerna](https://lerna.js.org/) for managing multiple packages. The most common commands are also wrapped in the root npm scripts:
15327

15428
| Command | Description |

packages/icons-builder/svg/items--search--initial/items--search--initial.svg

Lines changed: 1 addition & 1 deletion
Loading

packages/react/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# HCL Software Enchanted Icons package
2+
3+
Enchanted Icons is a collection of icons that are used in HCL Software products. This package exposes own creations as well as external icons from the [Carbon React Icons Package](https://github.com/carbon-design-system/carbon/tree/main/packages/icons) and exposes those as ready to use Material-UI components.
4+
5+
(C) 2024 HCL America Inc. Apache-2.0 license [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
6+
7+
8+
[![npm](https://nodei.co/npm/@hcl-software/enchanted-icons.png)](https://www.npmjs.com/package/@hcl-software/enchanted-icons)
9+
10+
## ⬇️ Installation
11+
12+
```sh
13+
npm install @hcl-software/enchanted-icons
14+
```
15+
## Usage
16+
17+
In most cases, the Enchanted Components use the correct icons to adhere to the Enchanted design language; however, there may be valid reasons to use
18+
icons directly from this library. **Always consult with your UX contact when using icons directly from this library.**
19+
20+
### Examples
21+
22+
#### Icon size
23+
```jsx
24+
import CheckmarkIcon from '@hcl-software/enchanted-icons/dist/carbon/es/checkmark';
25+
...
26+
<CheckmarkIcon fontSize="small" />
27+
```
28+
or
29+
```jsx
30+
import CheckmarkIcon from '@hcl-software/enchanted-icons/dist/carbon/es/checkmark';
31+
...
32+
<CheckmarkIcon fontSize="16px" />
33+
```
34+
35+
#### Icon color
36+
```jsx
37+
import CheckmarkIcon from '@hcl-software/enchanted-icons/dist/carbon/es/checkmark';
38+
...
39+
<CheckmarkIcon color="success" />
40+
```
41+
Note: It is strongly recommended to use the thematic names of colors of the Enchanted theme, rather than explicit rgba values. For example, `"success"` or `"action"`. This ensures consistency of colors across the UI and over time.
42+
43+
#### Icon button
44+
A common pattern is to use an icon in conjunction with an Enchanted `<IconButton>`
45+
```jsx
46+
import IconButton from '@hcl-software/enchanted-react-components/dist/IconButton';
47+
import RocketIcon from '@hcl-software/enchanted-icons/dist/carbon/es/rocket';
48+
...
49+
<IconButton size="small" aria-label="launch"><RocketIcon /></IconButton>
50+
```
51+
Note: In this case the size of the icon is determined by the `size` prop of the `<IconButton>`. The icon color is controlled by the different button states (active, disabled, etc) and should not be overriden.
52+
53+
### Advanced
54+
Icons from this library can take any props supported by MUI's `<SvgIcon>` component. See https://v5.mui.com/material-ui/api/svg-icon/
55+
**Always consult with your UX contact before applying any advanced styling.**

packages/react/src/apps/es/items--search--initial/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ const content: IIconContent[] = [
2828
elem: 'path',
2929
attrs: {
3030
d: 'M110 20C110 21.104 109.104 22 108 22C106.9 22 106 21.104 106 20C106 18.896 106.9 18 108 18C109.104 18 110 18.896 110 20ZM116 10C114.9 10 114 10.896 114 12C114 13.104 114.9 14 116 14C117.104 14 118 13.104 118 12C118 10.896 117.104 10 116 10ZM100 26C98.9 26 98 26.896 98 28C98 29.104 98.9 30 100 30C101.104 30 102 29.104 102 28C102 26.896 101.104 26 100 26ZM28 98C26.9 98 26 98.896 26 100C26 101.104 26.9 102 28 102C29.104 102 30 101.104 30 100C30 98.896 29.104 98 28 98ZM20 106C18.9 106 18 106.896 18 108C18 109.104 18.9 110 20 110C21.104 110 22 109.104 22 108C22 106.896 21.104 106 20 106ZM12 114C10.9 114 10 114.896 10 116C10 117.104 10.9 118 12 118C13.104 118 14 117.104 14 116C14 114.896 13.104 114 12 114ZM117.02 114.98L94.3 92.264C101.496 84.564 105.44 74.584 105.44 64C105.44 41.152 86.852 22.56 64 22.56C41.152 22.56 22.56 41.152 22.56 64C22.56 86.852 41.148 105.44 64 105.44C74.584 105.44 84.568 101.496 92.264 94.3L114.98 117.02L117.02 114.98ZM102.56 64C102.56 74.296 98.548 83.976 91.264 91.26C83.98 98.544 74.296 102.56 64 102.56C42.74 102.56 25.44 85.264 25.44 64C25.44 42.736 42.74 25.44 64 25.44C85.26 25.44 102.56 42.74 102.56 64ZM53.44 84V76C53.44 75.204 52.796 74.56 52 74.56H44C43.204 74.56 42.56 75.204 42.56 76V84C42.56 84.796 43.204 85.44 44 85.44H52C52.796 85.44 53.44 84.796 53.44 84ZM45.44 77.44H50.56V82.556H45.44V77.44ZM69.44 68V60C69.44 59.204 68.796 58.56 68 58.56H60C59.204 58.56 58.56 59.204 58.56 60V68C58.56 68.796 59.204 69.44 60 69.44H68C68.796 69.44 69.44 68.796 69.44 68ZM61.44 61.44H66.56V66.56H61.44V61.44V61.44ZM85.44 52V44C85.44 43.204 84.796 42.56 84 42.56H76C75.204 42.56 74.56 43.204 74.56 44V52C74.56 52.796 75.204 53.44 76 53.44H84C84.796 53.44 85.44 52.796 85.44 52ZM77.44 45.44H82.556V50.56H77.44V45.44Z',
31+
fill: 'currentColor',
32+
fillRule: 'evenodd',
33+
clipRule: 'evenodd',
3134
},
3235
},
3336
];

packages/web-component/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# HCL Software Enchanted Icons package for Web Components
2+
3+
Enchanted Icons is a collection of icons that are used in HCL Software products. This package exposes own creations as well as external icons from the [Carbon React Icons Package](https://github.com/carbon-design-system/carbon/tree/main/packages/icons) and exposes those as ready to use web components.
4+
5+
(C) 2024 HCL America Inc. Apache-2.0 license [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
6+
7+
8+
[![npm](https://nodei.co/npm/@hcl-software/enchanted-icons.png)](https://www.npmjs.com/package/@hcl-software/enchanted-icons)
9+
10+
## ⬇️ Installation
11+
12+
```sh
13+
npm install @hcl-software/enchanted-icons-web-component
14+
```
15+
### Usage
16+
Web Components can be used in any web framework or plain HTML.
17+
18+
**1. Import the icon definition**
19+
You must first import the icon's JavaScript file to define the custom element. This is typically done once in your application's main entry point.
20+
```javascript
21+
import '@hcl-software/enchanted-icons-web-component/dist/carbon/es/rocket';
22+
import '@hcl-software/enchanted-icons-web-component/dist/apps/es/app-switcher';
23+
```
24+
25+
**2. Use the HTML tag**
26+
Once defined, you can use the icon's custom HTML tag. The tag name is `icon-` followed by the icon's name (e.g., `icon-rocket`, `icon-app-switcher`).
27+
```html
28+
<icon-rocket></icon-rocket>
29+
```
30+
31+
Icons with double dash in their name like `chevron--up` will use single dash in their component name.
32+
```javascript
33+
import '@hcl-software/enchanted-icons-web-component/dist/carbon/es/chevron--up';
34+
35+
// Usage
36+
<icon-chevron-up></icon-chevron-up>
37+
```
38+
39+
**Styling (Size and Color)**
40+
You can style the icons by setting the `size` and `color` properties on the element.
41+
42+
**As HTML attributes:**
43+
```html
44+
<icon-rocket size="32"></icon-rocket>
45+
46+
<icon-app-switcher color="blue"></icon-app-switcher>
47+
```
48+
49+
**As JavaScript properties:**
50+
```javascript
51+
const myIcon = document.querySelector('icon-rocket');
52+
myIcon.size = 24;
53+
myIcon.color = 'var(--my-theme-color)';
54+
```
55+
56+
**With CSS Custom Properties (Advanced):**
57+
The icons are styled internally with CSS Custom Properties. You can override these variables globally to set a theme for all icons.
58+
```css
59+
/* Set a default theme size and color for all icons on the page */
60+
body {
61+
--icon-theme-size: 24px;
62+
--icon-theme-color: #3d3d3d;
63+
}
64+
```

packages/web-component/src/apps/es/items--search--initial/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ const content: IIconContent[] = [
2929
{
3030
elem: 'path',
3131
attrs: {
32-
d: 'M110 20C110 21.104 109.104 22 108 22C106.9 22 106 21.104 106 20C106 18.896 106.9 18 108 18C109.104 18 110 18.896 110 20ZM116 10C114.9 10 114 10.896 114 12C114 13.104 114.9 14 116 14C117.104 14 118 13.104 118 12C118 10.896 117.104 10 116 10ZM100 26C98.9 26 98 26.896 98 28C98 29.104 98.9 30 100 30C101.104 30 102 29.104 102 28C102 26.896 101.104 26 100 26ZM28 98C26.9 98 26 98.896 26 100C26 101.104 26.9 102 28 102C29.104 102 30 101.104 30 100C30 98.896 29.104 98 28 98ZM20 106C18.9 106 18 106.896 18 108C18 109.104 18.9 110 20 110C21.104 110 22 109.104 22 108C22 106.896 21.104 106 20 106ZM12 114C10.9 114 10 114.896 10 116C10 117.104 10.9 118 12 118C13.104 118 14 117.104 14 116C14 114.896 13.104 114 12 114ZM117.02 114.98L94.3 92.264C101.496 84.564 105.44 74.584 105.44 64C105.44 41.152 86.852 22.56 64 22.56C41.152 22.56 22.56 41.152 22.56 64C22.56 86.852 41.148 105.44 64 105.44C74.584 105.44 84.568 101.496 92.264 94.3L114.98 117.02L117.02 114.98ZM102.56 64C102.56 74.296 98.548 83.976 91.264 91.26C83.98 98.544 74.296 102.56 64 102.56C42.74 102.56 25.44 85.264 25.44 64C25.44 42.736 42.74 25.44 64 25.44C85.26 25.44 102.56 42.74 102.56 64ZM53.44 84V76C53.44 75.204 52.796 74.56 52 74.56H44C43.204 74.56 42.56 75.204 42.56 76V84C42.56 84.796 43.204 85.44 44 85.44H52C52.796 85.44 53.44 84.796 53.44 84ZM45.44 77.44H50.56V82.556H45.44V77.44ZM69.44 68V60C69.44 59.204 68.796 58.56 68 58.56H60C59.204 58.56 58.56 59.204 58.56 60V68C58.56 68.796 59.204 69.44 60 69.44H68C68.796 69.44 69.44 68.796 69.44 68ZM61.44 61.44H66.56V66.56H61.44V61.44V61.44ZM85.44 52V44C85.44 43.204 84.796 42.56 84 42.56H76C75.204 42.56 74.56 43.204 74.56 44V52C74.56 52.796 75.204 53.44 76 53.44H84C84.796 53.44 85.44 52.796 85.44 52ZM77.44 45.44H82.556V50.56H77.44V45.44Z'
32+
d: 'M110 20C110 21.104 109.104 22 108 22C106.9 22 106 21.104 106 20C106 18.896 106.9 18 108 18C109.104 18 110 18.896 110 20ZM116 10C114.9 10 114 10.896 114 12C114 13.104 114.9 14 116 14C117.104 14 118 13.104 118 12C118 10.896 117.104 10 116 10ZM100 26C98.9 26 98 26.896 98 28C98 29.104 98.9 30 100 30C101.104 30 102 29.104 102 28C102 26.896 101.104 26 100 26ZM28 98C26.9 98 26 98.896 26 100C26 101.104 26.9 102 28 102C29.104 102 30 101.104 30 100C30 98.896 29.104 98 28 98ZM20 106C18.9 106 18 106.896 18 108C18 109.104 18.9 110 20 110C21.104 110 22 109.104 22 108C22 106.896 21.104 106 20 106ZM12 114C10.9 114 10 114.896 10 116C10 117.104 10.9 118 12 118C13.104 118 14 117.104 14 116C14 114.896 13.104 114 12 114ZM117.02 114.98L94.3 92.264C101.496 84.564 105.44 74.584 105.44 64C105.44 41.152 86.852 22.56 64 22.56C41.152 22.56 22.56 41.152 22.56 64C22.56 86.852 41.148 105.44 64 105.44C74.584 105.44 84.568 101.496 92.264 94.3L114.98 117.02L117.02 114.98ZM102.56 64C102.56 74.296 98.548 83.976 91.264 91.26C83.98 98.544 74.296 102.56 64 102.56C42.74 102.56 25.44 85.264 25.44 64C25.44 42.736 42.74 25.44 64 25.44C85.26 25.44 102.56 42.74 102.56 64ZM53.44 84V76C53.44 75.204 52.796 74.56 52 74.56H44C43.204 74.56 42.56 75.204 42.56 76V84C42.56 84.796 43.204 85.44 44 85.44H52C52.796 85.44 53.44 84.796 53.44 84ZM45.44 77.44H50.56V82.556H45.44V77.44ZM69.44 68V60C69.44 59.204 68.796 58.56 68 58.56H60C59.204 58.56 58.56 59.204 58.56 60V68C58.56 68.796 59.204 69.44 60 69.44H68C68.796 69.44 69.44 68.796 69.44 68ZM61.44 61.44H66.56V66.56H61.44V61.44V61.44ZM85.44 52V44C85.44 43.204 84.796 42.56 84 42.56H76C75.204 42.56 74.56 43.204 74.56 44V52C74.56 52.796 75.204 53.44 76 53.44H84C84.796 53.44 85.44 52.796 85.44 52ZM77.44 45.44H82.556V50.56H77.44V45.44Z',
33+
fill: 'currentColor',
34+
fillRule: 'evenodd',
35+
clipRule: 'evenodd'
3336
}
3437
}
3538
];

0 commit comments

Comments
 (0)