mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-01 18:20:28 +00:00
Update box component
This commit is contained in:
@@ -5,6 +5,9 @@ export type BoxProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
children?: React.ReactNode | JSX.Element | string;
|
children?: React.ReactNode | JSX.Element | string;
|
||||||
|
|
||||||
|
onClick?: () => void;
|
||||||
|
cursor?: 'pointer' | 'default';
|
||||||
|
|
||||||
position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
||||||
zIndex?: string;
|
zIndex?: string;
|
||||||
top?: string;
|
top?: string;
|
||||||
@@ -40,6 +43,8 @@ export type BoxProps = {
|
|||||||
| 'flex-end'
|
| 'flex-end'
|
||||||
| 'space-between'
|
| 'space-between'
|
||||||
| 'space-around';
|
| 'space-around';
|
||||||
|
alignSelf?: 'center' | 'flex-start' | 'flex-end';
|
||||||
|
justifySelf?: 'center' | 'flex-start' | 'flex-end';
|
||||||
|
|
||||||
boxSizing?: 'content-box' | 'border-box';
|
boxSizing?: 'content-box' | 'border-box';
|
||||||
width?: string;
|
width?: string;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import styled from 'styled-components';
|
|||||||
import { BoxProps } from '.';
|
import { BoxProps } from '.';
|
||||||
|
|
||||||
export const Wrapper = styled.div<BoxProps>`
|
export const Wrapper = styled.div<BoxProps>`
|
||||||
|
${({ cursor }) => cursor && `cursor: ${cursor}`}
|
||||||
|
|
||||||
${({ position }) => position && `position: ${position}`};
|
${({ position }) => position && `position: ${position}`};
|
||||||
${({ zIndex }) => zIndex && `z-index: ${zIndex}`};
|
${({ zIndex }) => zIndex && `z-index: ${zIndex}`};
|
||||||
${({ top }) => top && `top: ${top}`};
|
${({ top }) => top && `top: ${top}`};
|
||||||
@@ -36,6 +38,8 @@ export const Wrapper = styled.div<BoxProps>`
|
|||||||
${({ alignItems }) => alignItems && `align-items: ${alignItems}`};
|
${({ alignItems }) => alignItems && `align-items: ${alignItems}`};
|
||||||
${({ justifyContent }) =>
|
${({ justifyContent }) =>
|
||||||
justifyContent && `justify-content: ${justifyContent}`};
|
justifyContent && `justify-content: ${justifyContent}`};
|
||||||
|
${({ alignSelf }) => alignSelf && `align-self: ${alignSelf}`};
|
||||||
|
${({ justifySelf }) => justifySelf && `justify-self: ${justifySelf}`};
|
||||||
|
|
||||||
${({ boxSizing }) => boxSizing && `box-sizing: ${boxSizing}`};
|
${({ boxSizing }) => boxSizing && `box-sizing: ${boxSizing}`};
|
||||||
${({ width }) => width && `width: ${width}`};
|
${({ width }) => width && `width: ${width}`};
|
||||||
|
|||||||
Reference in New Issue
Block a user