{"version":3,"sources":["../../../src/styled/themed/divider.ts"],"sourcesContent":["import type { DividerThemedDefaultProps } from '../components.types';\r\nimport type { SystemThemeParams, SystemThemeReturnType } from '../index.types';\r\nimport { styleModeHandler } from './base';\r\n\r\nimport { isPackageNative } from '@/helpers/base';\r\n\r\n// @defaults\r\nexport const dividerDefaults = {\r\n  size: 'xs',\r\n};\r\n\r\n// @themes\r\ntype DividerSystemThemeParams = SystemThemeParams & DividerThemedDefaultProps;\r\n\r\nexport const dividerDefaultStyle = (options: DividerSystemThemeParams) => {\r\n  const {\r\n    theme,\r\n    type = 'web',\r\n    size = dividerDefaults.size,\r\n    orientation,\r\n  } = options;\r\n\r\n  const isNative = isPackageNative(type);\r\n\r\n  const borderColor = styleModeHandler({\r\n    theme,\r\n    light: isNative ? 'blackAlpha.50' : 'blackAlpha.100',\r\n    dark: isNative ? 'whiteAlpha.50' : 'whiteAlpha.100',\r\n  });\r\n\r\n  const { vertical } = getDividerOrientation(orientation);\r\n\r\n  const { borderWidths } = theme.components.divider;\r\n\r\n  const themeBorderWidth = borderWidths[size as keyof typeof borderWidths];\r\n\r\n  const activeBorderWidth = themeBorderWidth || size;\r\n\r\n  const borderWidth = vertical\r\n    ? `\r\n      border-top-width: 0px; \r\n      border-right-width: 0px;\r\n      border-bottom-width: 0px;\r\n      border-left-width: ${activeBorderWidth};\r\n    `\r\n    : `\r\n      border-top-width: 0px; \r\n      border-right-width: 0px;\r\n      border-bottom-width: ${activeBorderWidth};\r\n      border-left-width: 0px;\r\n    `;\r\n\r\n  const baseStyle = `\r\n    ${borderWidth}\r\n    border-color: ${borderColor};\r\n    border-style: solid;\r\n    ${vertical ? 'height: 100%;' : 'width: 100%;'}\r\n  `;\r\n\r\n  const native = `\r\n    ${baseStyle}\r\n  `;\r\n\r\n  const web = `\r\n    ${baseStyle}\r\n  `;\r\n\r\n  const res: SystemThemeReturnType = {\r\n    native,\r\n    web,\r\n  };\r\n\r\n  return res[type];\r\n};\r\n\r\n// @utilities\r\nexport const getDividerOrientation = (\r\n  orientation: DividerSystemThemeParams['orientation']\r\n) => {\r\n  return {\r\n    vertical: orientation === 'vertical',\r\n    horizontal: orientation === 'horizontal',\r\n  };\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,kBAAkB;AAAA,EAC7B,MAAM;AACR;AAKO,IAAM,sBAAsB,CAAC,YAAsC;AACxE,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP,OAAO,gBAAgB;AAAA,IACvB;AAAA,EACF,IAAI;AAEJ,QAAM,WAAW,gBAAgB,IAAI;AAErC,QAAM,cAAc,iBAAiB;AAAA,IACnC;AAAA,IACA,OAAO,WAAW,kBAAkB;AAAA,IACpC,MAAM,WAAW,kBAAkB;AAAA,EACrC,CAAC;AAED,QAAM,EAAE,SAAS,IAAI,sBAAsB,WAAW;AAEtD,QAAM,EAAE,aAAa,IAAI,MAAM,WAAW;AAE1C,QAAM,mBAAmB,aAAa,IAAiC;AAEvE,QAAM,oBAAoB,oBAAoB;AAE9C,QAAM,cAAc,WAChB;AAAA;AAAA;AAAA;AAAA,2BAIqB,iBAAiB;AAAA,QAEtC;AAAA;AAAA;AAAA,6BAGuB,iBAAiB;AAAA;AAAA;AAI5C,QAAM,YAAY;AAAA,MACd,WAAW;AAAA,oBACG,WAAW;AAAA;AAAA,MAEzB,WAAW,kBAAkB,cAAc;AAAA;AAG/C,QAAM,SAAS;AAAA,MACX,SAAS;AAAA;AAGb,QAAM,MAAM;AAAA,MACR,SAAS;AAAA;AAGb,QAAM,MAA6B;AAAA,IACjC;AAAA,IACA;AAAA,EACF;AAEA,SAAO,IAAI,IAAI;AACjB;AAGO,IAAM,wBAAwB,CACnC,gBACG;AACH,SAAO;AAAA,IACL,UAAU,gBAAgB;AAAA,IAC1B,YAAY,gBAAgB;AAAA,EAC9B;AACF;","names":[]}