firebird-icon-lib 1.0.11 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -15
- package/dist/Icon.d.ts +56 -1
- package/dist/Icon.d.ts.map +1 -1
- package/dist/firebird-icon-lib.js.js +22 -31
- package/dist/fonts/Untitled.otf +0 -0
- package/dist/fonts/Untitled.ttf +0 -0
- package/dist/fonts/Untitled.woff +0 -0
- package/dist/fonts/Untitled.woff2 +0 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +547 -15
- package/package.json +1 -1
- package/dist/iconFontMap.d.ts +0 -28
- package/dist/iconFontMap.d.ts.map +0 -1
- package/dist/iconOrder.d.ts +0 -2
- package/dist/iconOrder.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -181,15 +181,15 @@ Use TypeScript autocomplete to see all available icon names, or check the `IconN
|
|
|
181
181
|
|
|
182
182
|
### Icon Component Props
|
|
183
183
|
|
|
184
|
-
| Prop | Type | Default | Description
|
|
185
|
-
| --------------- | --------------------- | --------------- |
|
|
186
|
-
| `name` | `IconName` | **required** | The name of the icon to display |
|
|
187
|
-
| `size` | `number` | `12` | Font size of the icon
|
|
188
|
-
| `color` | `string` | - | Color of the icon
|
|
189
|
-
| `className` | `string`
|
|
190
|
-
| `iconClassName` | `string` | `'icon'` | CSS class for the icon span element
|
|
191
|
-
| `showLabel` | `boolean` | `false` |
|
|
192
|
-
| `style` | `React.CSSProperties` | - | Inline styles to apply
|
|
184
|
+
| Prop | Type | Default | Description |
|
|
185
|
+
| --------------- | --------------------- | --------------- | ------------------------------------------------------------------------------------------------------ |
|
|
186
|
+
| `name` | `IconName` | **required** | The name of the icon to display. Must be a valid icon name from the icon map. |
|
|
187
|
+
| `size` | `number` | `12` | Font size of the icon in pixels. |
|
|
188
|
+
| `color` | `string` | - | Color of the icon. Uses `currentColor` by default if not specified. |
|
|
189
|
+
| `className` | `string \| undefined` | `'_demo_glyph'` | CSS class for the wrapper div. Use `''` (empty string) to render only the icon span without a wrapper. |
|
|
190
|
+
| `iconClassName` | `string` | `'icon'` | CSS class for the icon span element. This is added alongside the `icon-{name}` class. |
|
|
191
|
+
| `showLabel` | `boolean` | `false` | Whether to display the icon name as a label below the icon. |
|
|
192
|
+
| `style` | `React.CSSProperties` | - | Inline styles to apply to the wrapper element (or icon span if `className` is empty string). |
|
|
193
193
|
|
|
194
194
|
### TypeScript Types
|
|
195
195
|
|
|
@@ -218,19 +218,22 @@ const html = generateIconFontHTML('spam_management');
|
|
|
218
218
|
|
|
219
219
|
## HTML/CSS Usage
|
|
220
220
|
|
|
221
|
-
You can also use icons directly in HTML. **Make sure to include the CSS file first:**
|
|
221
|
+
You can also use icons directly in HTML without React. **Make sure to include the CSS file first:**
|
|
222
222
|
|
|
223
223
|
```html
|
|
224
224
|
<!-- Required: Import the CSS file -->
|
|
225
225
|
<link rel="stylesheet" href="node_modules/firebird-icon-lib/dist/style.css" />
|
|
226
226
|
|
|
227
|
-
<!-- Then use icons in your HTML -->
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
<!-- Then use icons in your HTML with the icon-{name} class format -->
|
|
228
|
+
<span class="icon-cash"></span>
|
|
229
|
+
<span class="icon-search"></span>
|
|
230
|
+
<span class="icon-spam_management"></span>
|
|
231
|
+
|
|
232
|
+
<!-- Or with the wrapper div for demo purposes -->
|
|
233
|
+
<div class="_demo_glyph"><span class="icon-cash"></span> icon-cash</div>
|
|
231
234
|
```
|
|
232
235
|
|
|
233
|
-
The CSS file is required as it contains the `@font-face` declaration and icon styles needed for the fonts to work.
|
|
236
|
+
The CSS file is required as it contains the `@font-face` declaration and icon styles (using `:before` pseudo-elements) needed for the fonts to work. Each icon uses the class format `icon-{iconName}` where `{iconName}` matches the icon name from the icon map.
|
|
234
237
|
|
|
235
238
|
## Development
|
|
236
239
|
|
package/dist/Icon.d.ts
CHANGED
|
@@ -1,22 +1,77 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IconName } from './iconMap';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Icon component
|
|
5
|
+
*
|
|
6
|
+
* @interface IconProps
|
|
7
|
+
*/
|
|
3
8
|
export interface IconProps {
|
|
9
|
+
/** The name of the icon to display. Must be a valid icon name from the icon map. */
|
|
4
10
|
name: IconName;
|
|
11
|
+
/**
|
|
12
|
+
* CSS class name for the wrapper div element.
|
|
13
|
+
* - If `undefined`: defaults to `'_demo_glyph'`
|
|
14
|
+
* - If `''` (empty string): renders only the icon span without a wrapper div
|
|
15
|
+
* - If a string value: uses that as the wrapper class name
|
|
16
|
+
*/
|
|
5
17
|
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* CSS class name for the icon span element.
|
|
20
|
+
* @default 'icon'
|
|
21
|
+
*/
|
|
6
22
|
iconClassName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to display the icon name as a label below the icon.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
7
27
|
showLabel?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Inline styles to apply to the wrapper element (or icon span if className is empty).
|
|
30
|
+
*/
|
|
8
31
|
style?: React.CSSProperties;
|
|
32
|
+
/**
|
|
33
|
+
* Color of the icon. Uses `currentColor` by default if not specified.
|
|
34
|
+
*/
|
|
9
35
|
color?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Font size of the icon in pixels.
|
|
38
|
+
* @default 12
|
|
39
|
+
*/
|
|
10
40
|
size?: number;
|
|
11
41
|
}
|
|
12
42
|
/**
|
|
13
|
-
* Icon component
|
|
43
|
+
* Icon component that renders icons using icon font (CSS-based icon font).
|
|
14
44
|
*
|
|
45
|
+
* This component uses CSS classes and the `:before` pseudo-element to display icons
|
|
46
|
+
* from the icon font. The icon font must be loaded via the `style.css` file.
|
|
47
|
+
*
|
|
48
|
+
* @component
|
|
15
49
|
* @example
|
|
16
50
|
* ```tsx
|
|
51
|
+
* // Basic usage
|
|
17
52
|
* <Icon name="spam_management" />
|
|
53
|
+
*
|
|
54
|
+
* // With custom size and color
|
|
55
|
+
* <Icon name="search" size={24} color="#ff0000" />
|
|
56
|
+
*
|
|
57
|
+
* // Inline icon (no wrapper div)
|
|
58
|
+
* <Icon name="search" size={20} className="" />
|
|
59
|
+
*
|
|
60
|
+
* // With label
|
|
18
61
|
* <Icon name="add" showLabel={true} />
|
|
62
|
+
*
|
|
63
|
+
* // With custom styling
|
|
64
|
+
* <Icon
|
|
65
|
+
* name="settings"
|
|
66
|
+
* size={32}
|
|
67
|
+
* color="#646cff"
|
|
68
|
+
* className="my-icon-wrapper"
|
|
69
|
+
* style={{ margin: '10px' }}
|
|
70
|
+
* />
|
|
19
71
|
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param {IconProps} props - The component props
|
|
74
|
+
* @returns {JSX.Element | null} The rendered icon component or null if icon not found
|
|
20
75
|
*/
|
|
21
76
|
export declare const Icon: React.FC<IconProps>;
|
|
22
77
|
export default Icon;
|
package/dist/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG1C;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,oFAAoF;IACpF,IAAI,EAAE,QAAQ,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAyDpC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|