UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

1 lines • 8.7 kB
{"version":3,"file":"native-table.style.cjs","names":["defineComponentSlotStyle"],"sources":["../../../../src/components/native-table/native-table.style.ts"],"sourcesContent":["import { defineComponentSlotStyle } from \"../../core\"\n\nexport const nativeTableStyle = defineComponentSlotStyle({\n base: {\n caption: {\n \"&[data-placement='end']\": {\n mt: \"sm\",\n },\n \"&[data-placement='start']\": {\n mb: \"sm\",\n },\n color: \"fg.muted\",\n fontSize: \"xs\",\n fontWeight: \"medium\",\n textAlign: \"center\",\n },\n col: {},\n colgroup: {},\n root: {\n borderCollapse: \"collapse\",\n fontVariantNumeric: \"lining-nums tabular-nums\",\n h: \"full\",\n w: \"full\",\n },\n scrollArea: {\n display: \"block\",\n maxW: \"full\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n whiteSpace: \"nowrap\",\n },\n tbody: {},\n td: {\n px: \"{space-x}\",\n py: \"{space-y}\",\n verticalAlign: \"top\",\n _numeric: {\n textAlign: \"end\",\n },\n },\n tfoot: {\n \"& td\": {\n fontWeight: \"medium\",\n textAlign: \"start\",\n verticalAlign: \"middle\",\n },\n },\n th: {\n fontWeight: \"medium\",\n px: \"{space-x}\",\n py: \"{space-y}\",\n textAlign: \"start\",\n verticalAlign: \"middle\",\n _numeric: {\n textAlign: \"end\",\n },\n },\n thead: {},\n tr: {\n _disabled: {\n layerStyle: \"disabled\",\n },\n },\n },\n\n props: {\n /**\n * If `true`, highlight the row when the table row is hovered.\n *\n * @default false\n */\n highlightOnHover: {\n true: {\n tbody: {\n \"& tr\": {\n transitionDuration: \"moderate\",\n transitionProperty: \"common\",\n _hover: {\n bg: \"colorScheme.bg\",\n },\n },\n },\n },\n },\n /**\n * If `true`, highlight the row when the table row is selected.\n *\n * @default false\n */\n highlightOnSelected: {\n true: {\n tbody: {\n \"& tr\": {\n transitionDuration: \"moderate\",\n transitionProperty: \"common\",\n _selected: {\n bg: \"colorScheme.bg\",\n },\n },\n },\n },\n },\n /**\n * If `true`, display the sticky footer.\n *\n * @default false\n */\n stickyFooter: {\n true: {\n tfoot: {\n \"& tr\": {\n bottom: \"0\",\n position: \"sticky\",\n zIndex: \"yamcha\",\n },\n },\n },\n },\n /**\n * If `true`, display the sticky header.\n *\n * @default false\n */\n stickyHeader: {\n true: {\n thead: {\n \"& tr\": {\n position: \"sticky\",\n top: \"0\",\n zIndex: \"yamcha\",\n },\n },\n },\n },\n /**\n * If `true`, display striped rows.\n *\n * @default false\n */\n striped: {\n true: {},\n },\n /**\n * If `true`, display the outer border of the table.\n *\n * @default false\n */\n withBorder: {\n true: {\n root: { borderWidth: \"1px\" },\n },\n },\n /**\n * If `true`, display line on the columns of the table.\n *\n * @default false\n */\n withColumnBorders: {\n true: {\n tr: { \"& th, td\": { borderRightWidth: \"1px\" } },\n },\n },\n },\n\n variants: {\n line: {\n tbody: {\n \"& tr:not(:first-of-type)\": { \"& th, td\": { borderTopWidth: \"1px\" } },\n \"& tr:only-child\": { \"& th, td\": { borderTopWidth: \"1px\" } },\n },\n tfoot: {\n \"& tr\": { \"& th, td\": { borderTopWidth: \"1px\" } },\n },\n thead: {\n \"& tr\": { \"& th, td\": { borderBottomWidth: \"1px\" } },\n },\n },\n outline: {\n root: {\n borderWidth: \"1px\",\n },\n scrollArea: {\n borderWidth: \"1px\",\n },\n tbody: {\n \"& tr:not(:first-of-type)\": { \"& th, td\": { borderTopWidth: \"1px\" } },\n \"& tr:only-child\": { \"& th, td\": { borderTopWidth: \"1px\" } },\n },\n tfoot: {\n \"& tr\": {\n \"&:first-of-type\": { \"& th, td\": { borderTopWidth: \"1px\" } },\n bg: \"colorScheme.bg\",\n },\n },\n thead: {\n \"& tr\": {\n \"&:last-of-type\": { \"& th, td\": { borderBottomWidth: \"1px\" } },\n bg: \"colorScheme.bg\",\n },\n },\n },\n },\n\n sizes: {\n sm: {\n root: { fontSize: \"xs\" },\n td: { \"--space-x\": \"spaces.2\", \"--space-y\": \"spaces.1\" },\n th: { \"--space-x\": \"spaces.2\", \"--space-y\": \"spaces.1\" },\n },\n md: {\n root: { fontSize: \"sm\" },\n td: { \"--space-x\": \"spaces.3\", \"--space-y\": \"spaces.2\" },\n th: { \"--space-x\": \"spaces.3\", \"--space-y\": \"spaces.2\" },\n },\n lg: {\n root: { fontSize: \"md\" },\n td: { \"--space-x\": \"spaces.4\", \"--space-y\": \"spaces.3\" },\n th: { \"--space-x\": \"spaces.4\", \"--space-y\": \"spaces.3\" },\n },\n },\n\n compounds: [\n {\n css: {\n tbody: {\n \"& tr\": {\n _odd: {\n bg: \"colorScheme.bg\",\n },\n },\n },\n },\n variant: \"line\",\n layer: \"props\",\n striped: true,\n },\n {\n css: {\n tbody: {\n \"& tr\": {\n _even: {\n bg: \"colorScheme.bg\",\n },\n },\n },\n },\n variant: \"outline\",\n layer: \"props\",\n striped: true,\n },\n {\n css: {\n root: {\n borderWidth: \"0\",\n },\n },\n variant: \"outline\",\n withScrollArea: true,\n },\n ],\n\n defaultProps: {\n size: \"md\",\n variant: \"line\",\n },\n})\n\nexport type NativeTableStyle = typeof nativeTableStyle\n"],"mappings":";;;AAEA,MAAa,mBAAmBA,wCAAyB;CACvD,MAAM;EACJ,SAAS;GACP,2BAA2B,EACzB,IAAI,MACL;GACD,6BAA6B,EAC3B,IAAI,MACL;GACD,OAAO;GACP,UAAU;GACV,YAAY;GACZ,WAAW;GACZ;EACD,KAAK,EAAE;EACP,UAAU,EAAE;EACZ,MAAM;GACJ,gBAAgB;GAChB,oBAAoB;GACpB,GAAG;GACH,GAAG;GACJ;EACD,YAAY;GACV,SAAS;GACT,MAAM;GACN,UAAU;GACV,yBAAyB;GACzB,YAAY;GACb;EACD,OAAO,EAAE;EACT,IAAI;GACF,IAAI;GACJ,IAAI;GACJ,eAAe;GACf,UAAU,EACR,WAAW,OACZ;GACF;EACD,OAAO,EACL,QAAQ;GACN,YAAY;GACZ,WAAW;GACX,eAAe;GAChB,EACF;EAC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