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 {
1212 tasty ,
1313} from '../tasty' ;
1414
15- const IconContainerElement = tasty ( {
15+ const IconElement = tasty ( {
1616 as : 'span' ,
1717 styles : {
1818 display : 'inline-grid' ,
@@ -21,6 +21,10 @@ const IconContainerElement = tasty({
2121 width : '1em 1em' ,
2222 height : 'min 1em' ,
2323 fontSize : 'var(--icon-size, var(--font-size))' ,
24+ textAlign : 'center' ,
25+ textTransform : 'none' ,
26+ textRendering : 'optimizeLegibility' ,
27+ '-webkit-font-smoothing' : 'antialiased' ,
2428
2529 '& svg' : {
2630 width : '1em 1em' ,
@@ -38,11 +42,11 @@ export interface CubeIconProps
3842 size ?: Styles [ 'fontSize' ] ;
3943}
4044
41- export const IconContainer = memo ( function IconContainer ( props : CubeIconProps ) {
45+ export const Icon = memo ( function Icon ( props : CubeIconProps ) {
4246 const { size, ...rest } = props ;
4347
4448 return (
45- < IconContainerElement
49+ < IconElement
4650 qa = "Icon"
4751 { ...rest }
4852 styles = {
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ import { Space } from '../components/layout/Space';
66import { Title } from '../components/content/Title' ;
77import { Flow } from '../components/layout/Flow' ;
88
9- import { CubeIconProps , IconContainer } from './IconContainer ' ;
9+ import { CubeIconProps , Icon } from './Icon ' ;
1010
1111import * as Icons from './index' ;
1212
1313export default {
1414 title : 'Content/Icons' ,
15- component : IconContainer ,
15+ component : Icon ,
1616 parameters : {
1717 controls : {
1818 exclude : baseProps ,
@@ -26,8 +26,7 @@ const Template: StoryFn<CubeIconProps> = (name) => {
2626 < Title > 16px</ Title >
2727 < Grid columns = "repeat(auto-fit, 200px)" flow = "row" gap = "16px" >
2828 { Object . keys ( Icons ) . map ( ( iconName ) => {
29- if ( iconName === 'IconContainer' || iconName === 'wrapIcon' )
30- return null ;
29+ if ( iconName === 'Icon' || iconName === 'wrapIcon' ) return null ;
3130
3231 const Icon = Icons [ iconName ] ;
3332
@@ -42,8 +41,7 @@ const Template: StoryFn<CubeIconProps> = (name) => {
4241 < Title > 32px</ Title >
4342 < Grid columns = "repeat(auto-fit, 200px)" flow = "row" gap = "16px" >
4443 { Object . keys ( Icons ) . map ( ( iconName ) => {
45- if ( iconName === 'IconContainer' || iconName === 'wrapIcon' )
46- return null ;
44+ if ( iconName === 'Icon' || iconName === 'wrapIcon' ) return null ;
4745
4846 const Icon = Icons [ iconName ] ;
4947
Original file line number Diff line number Diff line change @@ -79,5 +79,5 @@ export { WarningFilledIcon } from './WarningFilledIcon';
7979export { WarningIcon } from './WarningIcon' ;
8080export { wrapIcon } from './wrap-icon' ;
8181
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 11import { ReactNode } from 'react' ;
22
3- import { CubeIconProps , IconContainer } from './IconContainer ' ;
3+ import { CubeIconProps , Icon } from './Icon ' ;
44
55export function wrapIcon ( name : string , icon : ReactNode ) {
6- function Icon ( props : CubeIconProps ) {
6+ function IconWrapper ( props : CubeIconProps ) {
77 return (
8- < IconContainer qa = { name } aria-hidden = "true" { ...props } >
8+ < Icon qa = { name } aria-hidden = "true" { ...props } >
99 { icon }
10- </ IconContainer >
10+ </ Icon >
1111 ) ;
1212 }
1313
14- Icon . displayName = name ;
14+ IconWrapper . displayName = name ;
1515
16- return Icon ;
16+ return IconWrapper ;
1717}
You can’t perform that action at this time.
0 commit comments