@redis-ui/components 47.5.5 → 47.5.6
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redis-ui/components",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "47.5.
|
|
4
|
+
"version": "47.5.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": "git@github.com:redislabsdev/redis-ui.git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@redis-ui/icons": "^8.0.0 || ^9.0.0",
|
|
33
|
-
"@redis-ui/styles": "^16.4.
|
|
33
|
+
"@redis-ui/styles": "^16.4.3",
|
|
34
34
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
35
35
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
36
36
|
"styled-components": "^5.0.0"
|
|
@@ -16,8 +16,9 @@ import { Button, Modal, Select } from '@redis-ui/components';
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Icons are imported separately. Monochrome icons accept a semantic `variant`; without it they
|
|
19
|
-
inherit color from CSS `currentColor`. Use `style.color` for a custom color
|
|
20
|
-
|
|
19
|
+
inherit color from CSS `currentColor`. Use `style.color` for a custom color. Prefer a standard
|
|
20
|
+
`size` from the design-system scale; reach for `customSize` (or `style.width`/`height`) only when
|
|
21
|
+
no `size` value fits, since it bypasses the theme scale. See the [Icons](./references/Icons.md) reference.
|
|
21
22
|
|
|
22
23
|
```tsx
|
|
23
24
|
import { EditIcon, DeleteIcon, iconVariants, type IconVariant } from '@redis-ui/icons';
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
| Prop | Type | Default | Description |
|
|
31
31
|
|------|------|---------|-------------|
|
|
32
32
|
| variant | `IconVariant` (`'primary' \| 'secondary' \| 'notice' \| 'success' \| 'attention' \| 'danger' \| 'upsell' \| 'informative'`) | - | Semantic color from the theme. When unset, the icon inherits color from CSS `currentColor`. |
|
|
33
|
-
| size | `IconSizeType` (`'XS' \| 'S' \| 'M' \| 'L' \| 'XL' \| 'XXL'`) | `'L'` | Standard size. Ignored if `customSize` is set. |
|
|
34
|
-
| customSize | `string` | - | Any valid CSS size (e.g. `'
|
|
33
|
+
| size | `IconSizeType` (`'XS' \| 'S' \| 'M' \| 'L' \| 'XL' \| 'XXL' \| 'for-text' \| 'by-font'`) | `'L'` | Standard size from `theme.core.icon.size`. Fixed values: `XS` (0.8rem), `S` (1.2rem), `M` (1.6rem), `L` (2rem), `XL` (2.4rem), `XXL` (3.2rem). Relative values: `for-text` (1.25em — scales to surrounding text), `by-font` (1em — matches surrounding font size). Ignored if `customSize` is set. |
|
|
34
|
+
| customSize | `string` | - | Any valid CSS size (e.g. `'32px'`). Overrides `size`. Prefer a standard `size` — use `customSize` only when no scale value fits. |
|
|
35
35
|
| title | `string` | icon name | Accessible label / native tooltip. |
|
|
36
36
|
| className | `string` | - | Forwarded to the underlying `<svg>`. |
|
|
37
37
|
| style | `CSSProperties` | - | Forwarded to the underlying `<svg>`. Use `style.color` to set a custom color, or `style.width` / `style.height` for custom sizing. |
|
|
@@ -60,8 +60,10 @@ import { RedisLogoDarkMinIcon } from '@redis-ui/icons/multicolor';
|
|
|
60
60
|
|
|
61
61
|
### Sizes and Variants
|
|
62
62
|
|
|
63
|
-
>
|
|
64
|
-
> `iconVariants` tuple from `@redis-ui/icons` to enumerate all variants.
|
|
63
|
+
> Renders the listed fixed sizes (`XL`, `L`, `M`, `S`, `XS`) against every supported variant. The
|
|
64
|
+
> story uses the `iconVariants` tuple from `@redis-ui/icons` to enumerate all variants.
|
|
65
|
+
> `XXL` and the relative sizes (`for-text`, `by-font`) are valid `size` values but are omitted from
|
|
66
|
+
> this gallery — see the Props table for the full list.
|
|
65
67
|
|
|
66
68
|
```tsx
|
|
67
69
|
import { Fragment } from 'react';
|
|
@@ -98,13 +100,13 @@ import { StarsIcon } from '@redis-ui/icons';
|
|
|
98
100
|
|
|
99
101
|
### Custom size
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
the
|
|
103
|
+
> Prefer a standard `size` value — use `customSize` (or `style` `width`/`height`) only when none of
|
|
104
|
+
the scale values fit, as it bypasses the design-system scale.
|
|
103
105
|
|
|
104
106
|
```tsx
|
|
105
107
|
import { StarsIcon } from '@redis-ui/icons';
|
|
106
108
|
|
|
107
|
-
<StarsIcon customSize="
|
|
109
|
+
<StarsIcon customSize="2.8rem" />
|
|
108
110
|
<StarsIcon style={{ width: '8rem', height: '8rem' }} />
|
|
109
111
|
```
|
|
110
112
|
|