UNPKG

@yamada-ui/react

Version:

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

1 lines 4.59 kB
{"version":3,"file":"segmented-control.style.cjs","names":["defineComponentSlotStyle","focusRingStyle"],"sources":["../../../../src/components/segmented-control/segmented-control.style.ts"],"sourcesContent":["import { defineComponentSlotStyle, focusRingStyle } from \"../../core\"\n\nexport const segmentedControlStyle = defineComponentSlotStyle({\n base: {\n indicator: {\n bg: \"bg\",\n boxShadow: \"xs\",\n boxSize: \"full\",\n pointerEvents: \"none\",\n position: \"absolute\",\n rounded: \"md\",\n top: \"0\",\n userSelect: \"none\",\n },\n item: {\n \"&:has(input:focus-visible)\": focusRingStyle.outline,\n \"& > span\": { zIndex: \"1\" },\n color: \"fg\",\n cursor: \"pointer\",\n display: \"inline-center\",\n flex: \"1 1 0%\",\n fontWeight: \"medium\",\n position: \"relative\",\n whiteSpace: \"nowrap\",\n _readOnly: { layerStyle: \"readOnly\", pointerEvents: \"none\" },\n _disabled: {\n layerStyle: \"disabled\",\n \"&[data-root-disabled]\": { opacity: 1 },\n },\n },\n root: {\n alignItems: \"center\",\n bg: \"bg.subtle\",\n display: \"inline-flex\",\n p: \"1\",\n rounded: \"lg\",\n _readOnly: { layerStyle: \"readOnly\" },\n _disabled: { layerStyle: \"disabled\" },\n },\n },\n\n props: {\n /**\n * If `true`, the segmented control will be full rounded.\n *\n * @default false\n */\n fullRounded: {\n true: {\n indicator: {\n rounded: \"full\",\n },\n item: {\n rounded: \"full\",\n },\n root: {\n rounded: \"full\",\n _before: {\n rounded: \"full\",\n },\n },\n },\n },\n /**\n * The orientation of the segmented control.\n *\n * @default 'horizontal'\n */\n orientation: {\n horizontal: {\n item: {\n h: \"full\",\n },\n root: {\n flexDirection: \"row\",\n _before: {\n transitionProperty: \"left, width\",\n },\n },\n },\n vertical: {\n item: {\n w: \"full\",\n },\n root: {\n flexDirection: \"column\",\n _before: {\n transitionProperty: \"top, height\",\n },\n },\n },\n },\n },\n\n sizes: {\n sm: {\n item: { fontSize: \"sm\", px: \"3\", _vertical: { minH: \"7\" } },\n root: { _horizontal: { h: \"9\", minW: \"64\" } },\n },\n md: {\n item: { fontSize: \"md\", px: \"3\", _vertical: { minH: \"8\" } },\n root: { _horizontal: { h: \"10\", minW: \"80\" } },\n },\n lg: {\n item: { fontSize: \"lg\", px: \"4\", _vertical: { minH: \"9\" } },\n root: { _horizontal: { h: \"11\", minW: \"96\" } },\n },\n xl: {\n item: { fontSize: \"xl\", px: \"5\", _vertical: { minH: \"10\" } },\n root: { _horizontal: { h: \"12\", minW: \"96\" } },\n },\n },\n\n defaultProps: {\n size: \"md\",\n orientation: \"horizontal\",\n },\n})\n\nexport type SegmentedControlStyle = typeof segmentedControlStyle\n"],"mappings":";;;;AAEA,MAAa,wBAAwBA,wCAAyB;CAC5D,MAAM;EACJ,WAAW;GACT,IAAI;GACJ,WAAW;GACX,SAAS;GACT,eAAe;GACf,UAAU;GACV,SAAS;GACT,KAAK;GACL,YAAY;GACb;EACD,MAAM;GACJ,8BAA8BC,kCAAe;GAC7C,YAAY,EAAE,QAAQ,KAAK;GAC3B,OAAO;GACP,QAAQ;GACR,SAAS;GACT,MAAM;GACN,YAAY;GACZ,UAAU;GACV,YAAY;GACZ,WAAW;IAAE,YAAY;IAAY,eAAe;IAAQ;GAC5D,WAAW;IACT,YAAY;IACZ,yBAAyB,EAAE,SAAS,GAAG;IACxC;GACF;EACD,MAAM;GACJ,YAAY;GACZ,IAAI;GACJ,SAAS;GACT,GAAG;GACH,SAAS;GACT,WAAW,EAAE,YAAY,YAAY;GACrC,WAAW,EAAE,YAAY,YAAY;GACtC;EACF;CAED,OAAO;EAML,aAAa,EACX,MAAM;GACJ,WAAW,EACT,SAAS,QACV;GACD,MAAM,EACJ,SAAS,QACV;GACD,MAAM;IACJ,SAAS;IACT,SAAS,EACP,SAAS,QACV;IACF;GACF,EACF;EAMD,aAAa;GACX,YAAY;IACV,MAAM,EACJ,GAAG,QACJ;IACD,MAAM;KACJ,e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