UNPKG

@react-spectrum/s2

Version:
1 lines 2.16 kB
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAeD,MAAM;AAKC,SAAS,0CAAe,KAA0B;IACvD,qBACE,gCAAC;QACC,MAAM,MAAM,IAAI;QAChB,OAAO,MAAM,KAAK;QAClB,WAAW,CAAA,GAAA,qCAAU,EAAE,8BAAQ,MAAM,MAAM,IAAI,MAAM;kBACpD,MAAM,QAAQ;;AAGrB;AAEO,MAAM;AAEN,SAAS,0CAAe,QAA+C,CAAC,CAAC;IAC9E,OAAO,CAAC,qBAAoB,gCAAC;YAAgB,GAAG,KAAK;sBAAG;;AAC1D","sources":["packages/@react-spectrum/s2/src/CenterBaseline.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CSSProperties, ReactNode} from 'react';\nimport {mergeStyles} from '../style/runtime';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\n\ninterface CenterBaselineProps {\n style?: CSSProperties,\n styles?: StyleString,\n children: ReactNode,\n slot?: string\n}\n\nconst styles = style({\n display: 'flex',\n alignItems: 'center'\n});\n\nexport function CenterBaseline(props: CenterBaselineProps): ReactNode {\n return (\n <div\n slot={props.slot}\n style={props.style}\n className={mergeStyles(styles, props.styles) + ' ' + centerBaselineBefore}>\n {props.children}\n </div>\n );\n}\n\nexport const centerBaselineBefore = raw('&::before { content: \"\\u00a0\"; width: 0; visibility: hidden }');\n\nexport function centerBaseline(props: Omit<CenterBaselineProps, 'children'> = {}): (icon: ReactNode) => ReactNode {\n return (icon: ReactNode) => <CenterBaseline {...props}>{icon}</CenterBaseline>;\n}\n"],"names":[],"version":3,"file":"CenterBaseline.cjs.map"}