File tree Expand file tree Collapse file tree 5 files changed +24
-17
lines changed Expand file tree Collapse file tree 5 files changed +24
-17
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @cube-dev/ui-kit ' : minor
3
+ ---
4
+
5
+ Rename IconContainer -> Icon.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
12
12
tasty ,
13
13
} from '../tasty' ;
14
14
15
- const IconContainerElement = tasty ( {
15
+ const IconElement = tasty ( {
16
16
as : 'span' ,
17
17
styles : {
18
18
display : 'inline-grid' ,
@@ -21,6 +21,10 @@ const IconContainerElement = tasty({
21
21
width : '1em 1em' ,
22
22
height : 'min 1em' ,
23
23
fontSize : 'var(--icon-size, var(--font-size))' ,
24
+ textAlign : 'center' ,
25
+ textTransform : 'none' ,
26
+ textRendering : 'optimizeLegibility' ,
27
+ '-webkit-font-smoothing' : 'antialiased' ,
24
28
25
29
'& svg' : {
26
30
width : '1em 1em' ,
@@ -38,11 +42,11 @@ export interface CubeIconProps
38
42
size ?: Styles [ 'fontSize' ] ;
39
43
}
40
44
41
- export const IconContainer = memo ( function IconContainer ( props : CubeIconProps ) {
45
+ export const Icon = memo ( function Icon ( props : CubeIconProps ) {
42
46
const { size, ...rest } = props ;
43
47
44
48
return (
45
- < IconContainerElement
49
+ < IconElement
46
50
qa = "Icon"
47
51
{ ...rest }
48
52
styles = {
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ import { Space } from '../components/layout/Space';
6
6
import { Title } from '../components/content/Title' ;
7
7
import { Flow } from '../components/layout/Flow' ;
8
8
9
- import { CubeIconProps , IconContainer } from './IconContainer ' ;
9
+ import { CubeIconProps , Icon } from './Icon ' ;
10
10
11
11
import * as Icons from './index' ;
12
12
13
13
export default {
14
14
title : 'Content/Icons' ,
15
- component : IconContainer ,
15
+ component : Icon ,
16
16
parameters : {
17
17
controls : {
18
18
exclude : baseProps ,
@@ -26,8 +26,7 @@ const Template: StoryFn<CubeIconProps> = (name) => {
26
26
< Title > 16px</ Title >
27
27
< Grid columns = "repeat(auto-fit, 200px)" flow = "row" gap = "16px" >
28
28
{ Object . keys ( Icons ) . map ( ( iconName ) => {
29
- if ( iconName === 'IconContainer' || iconName === 'wrapIcon' )
30
- return null ;
29
+ if ( iconName === 'Icon' || iconName === 'wrapIcon' ) return null ;
31
30
32
31
const Icon = Icons [ iconName ] ;
33
32
@@ -42,8 +41,7 @@ const Template: StoryFn<CubeIconProps> = (name) => {
42
41
< Title > 32px</ Title >
43
42
< Grid columns = "repeat(auto-fit, 200px)" flow = "row" gap = "16px" >
44
43
{ Object . keys ( Icons ) . map ( ( iconName ) => {
45
- if ( iconName === 'IconContainer' || iconName === 'wrapIcon' )
46
- return null ;
44
+ if ( iconName === 'Icon' || iconName === 'wrapIcon' ) return null ;
47
45
48
46
const Icon = Icons [ iconName ] ;
49
47
Original file line number Diff line number Diff line change @@ -79,5 +79,5 @@ export { WarningFilledIcon } from './WarningFilledIcon';
79
79
export { WarningIcon } from './WarningIcon' ;
80
80
export { wrapIcon } from './wrap-icon' ;
81
81
82
- export { IconContainer } from './IconContainer ' ;
83
- export type { CubeIconProps } from './IconContainer ' ;
82
+ export { Icon } from './Icon ' ;
83
+ export type { CubeIconProps } from './Icon ' ;
Original file line number Diff line number Diff line change 1
1
import { ReactNode } from 'react' ;
2
2
3
- import { CubeIconProps , IconContainer } from './IconContainer ' ;
3
+ import { CubeIconProps , Icon } from './Icon ' ;
4
4
5
5
export function wrapIcon ( name : string , icon : ReactNode ) {
6
- function Icon ( props : CubeIconProps ) {
6
+ function IconWrapper ( props : CubeIconProps ) {
7
7
return (
8
- < IconContainer qa = { name } aria-hidden = "true" { ...props } >
8
+ < Icon qa = { name } aria-hidden = "true" { ...props } >
9
9
{ icon }
10
- </ IconContainer >
10
+ </ Icon >
11
11
) ;
12
12
}
13
13
14
- Icon . displayName = name ;
14
+ IconWrapper . displayName = name ;
15
15
16
- return Icon ;
16
+ return IconWrapper ;
17
17
}
You can’t perform that action at this time.
0 commit comments