@symbo.ls/icon 2.11.36 → 2.11.76
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 +41 -0
- package/index.js +9 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# IconText Component
|
|
2
|
+
A simple and flexible IconText component that displays an icon alongside some text. The component extends the Flex component and allows for easy customization.
|
|
3
|
+
|
|
4
|
+
## Props
|
|
5
|
+
|
|
6
|
+
- `align`: (string) Alignment of the icon and text. Default value is `'center center'`.
|
|
7
|
+
- `lineHeight`: (number) Line height of the text. Default value is `1`.
|
|
8
|
+
- `icon`: (string) The name of the icon to be displayed. This prop will be removed in the future.
|
|
9
|
+
- `name`: (string) The name of the icon to be displayed.
|
|
10
|
+
- `text`: (string) The text to be displayed alongside the icon.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
import { IconText } from 'smbls';
|
|
16
|
+
|
|
17
|
+
const MyComponent = {
|
|
18
|
+
IconText: {
|
|
19
|
+
icon: 'star',
|
|
20
|
+
text: 'Hello, World!'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Customization
|
|
26
|
+
|
|
27
|
+
You can easily customize the appearance of the IconText component by passing additional props to the `Icon` or `text` components.
|
|
28
|
+
|
|
29
|
+
For example, you can change the color and size of the icon:
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
const MyComponent = {
|
|
33
|
+
IconText: {
|
|
34
|
+
icon: {
|
|
35
|
+
name: 'star',
|
|
36
|
+
color: 'blue'
|
|
37
|
+
},
|
|
38
|
+
text: 'Hello, World!'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
package/index.js
CHANGED
|
@@ -69,5 +69,13 @@ export const IconText = {
|
|
|
69
69
|
if: ({ props }) => props.name || props.icon
|
|
70
70
|
},
|
|
71
71
|
|
|
72
|
-
text: ({ props }) => props.text
|
|
72
|
+
text: ({ props }) => props.text,
|
|
73
|
+
|
|
74
|
+
'.reversed': {
|
|
75
|
+
props: { flow: 'row-reverse' }
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
'.vertical': {
|
|
79
|
+
props: { flow: 'column' }
|
|
80
|
+
}
|
|
73
81
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/icon",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.76",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "08b91598dfbcc46a59273441a121ff3798cc0ce8",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@symbo.ls/atoms": "latest",
|
|
9
9
|
"@symbo.ls/utils": "latest"
|