@bikdotai/bik-component-library 0.0.836 → 0.0.837-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  2. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  3. package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
  4. package/dist/cjs/components/dropdown/ChipInput.js +1 -1
  5. package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
  6. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  7. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  8. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  9. package/dist/cjs/components/input/Input.js +1 -1
  10. package/dist/cjs/components/input/Input.js.map +1 -1
  11. package/dist/cjs/components/input/Input.styled.js +25 -12
  12. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  13. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  14. package/dist/cjs/components/product-picker-v2/collectionScreen.js.map +1 -1
  15. package/dist/cjs/components/product-picker-v2/product.js +1 -1
  16. package/dist/cjs/components/product-picker-v2/product.js.map +1 -1
  17. package/dist/cjs/components/tabs/Tabs.js +1 -1
  18. package/dist/cjs/components/tabs/Tabs.js.map +1 -1
  19. package/dist/cjs/components/tabs/Tabs.styles.js +22 -8
  20. package/dist/cjs/components/tabs/Tabs.styles.js.map +1 -1
  21. package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  22. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  23. package/dist/esm/components/checkBox/CheckBox.d.ts +2 -0
  24. package/dist/esm/components/checkBox/CheckBox.js +61 -51
  25. package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
  26. package/dist/esm/components/dropdown/ChipInput.d.ts +1 -0
  27. package/dist/esm/components/dropdown/ChipInput.js +37 -30
  28. package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
  29. package/dist/esm/components/dropdown/Dropdown.d.ts +2 -0
  30. package/dist/esm/components/dropdown/Dropdown.js +95 -88
  31. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  32. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  33. package/dist/esm/components/input/Input.js +104 -101
  34. package/dist/esm/components/input/Input.js.map +1 -1
  35. package/dist/esm/components/input/Input.model.d.ts +2 -0
  36. package/dist/esm/components/input/Input.styled.d.ts +2 -0
  37. package/dist/esm/components/input/Input.styled.js +38 -25
  38. package/dist/esm/components/input/Input.styled.js.map +1 -1
  39. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -0
  40. package/dist/esm/components/product-picker-v2/collectionScreen.js.map +1 -1
  41. package/dist/esm/components/product-picker-v2/product.js +47 -46
  42. package/dist/esm/components/product-picker-v2/product.js.map +1 -1
  43. package/dist/esm/components/tabs/Tabs.js +93 -73
  44. package/dist/esm/components/tabs/Tabs.js.map +1 -1
  45. package/dist/esm/components/tabs/Tabs.model.d.ts +7 -0
  46. package/dist/esm/components/tabs/Tabs.styles.d.ts +2 -0
  47. package/dist/esm/components/tabs/Tabs.styles.js +23 -9
  48. package/dist/esm/components/tabs/Tabs.styles.js.map +1 -1
  49. package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  50. package/dist/esm/icons/index.d.ts +25 -25
  51. package/package.json +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"product.js","sources":["../../../../src/components/product-picker-v2/product.tsx"],"sourcesContent":["import { COLORS } from '@src/constants/Theme';\nimport InfoIcon from '../../assets/icons/info.svg';\nimport { CheckBox } from '../checkBox';\nimport { IconButton } from '../icon-button';\nimport { ShimmerImage } from '../shimmer-image';\nimport { Tooltip } from '../tooltips';\nimport { BodyCaption, TitleSmall } from '../TypographyStyle';\nimport { CurrencySymbols } from './constants';\nimport { ProductHelper } from './helpers/ProductHelper';\nimport { ProductPickerTag } from './ProductPickerTag';\nimport type { SelectedCollectionsActions } from './reducers';\nimport {\n\tEllipsedBodyTiny,\n\tProductCardStyle,\n\tProductInfo,\n\tProductSubTitle,\n\tSKUIDBadge,\n} from './style';\nimport {\n\tOUT_OF_STOCK_ACTION,\n\ttype Product,\n\ttype ProductVariant,\n\ttype SelectedItems,\n} from './type';\nimport { getSkuId, shouldShowVariant } from './utility';\n\ninterface ProductGroupInterface {\n\tcollectionId: string;\n\tproductId: string;\n\tdata: Product;\n\tselectedData: SelectedItems;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tviewOnly: boolean;\n\tisProductPartiallyChecked?: boolean;\n\tupliftAdditions: any;\n\thideProductCheckbox?: boolean;\n\toutOfStockAction?: OUT_OF_STOCK_ACTION;\n\thideVariantCheckbox?: boolean;\n\thideProductVariants?: boolean;\n\tshowProductDetailInfoIcon?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tonProductDetailClick?: (productData: Product | ProductVariant) => void;\n}\n\nexport const ProductGroup = (props: ProductGroupInterface) => {\n\tconst {\n\t\tcollectionId,\n\t\tproductId,\n\t\tdata,\n\t\tselectedData,\n\t\tselectedCollectionsDispatch,\n\t\tviewOnly,\n\t\tupliftAdditions,\n\t\tisProductPartiallyChecked,\n\t\thideProductCheckbox,\n\t\toutOfStockAction,\n\t\thideVariantCheckbox,\n\t\thideProductVariants,\n\t\tpickerType,\n\t\tonProductDetailClick,\n\t\tshowProductDetailInfoIcon,\n\t} = props;\n\n\tconst containsProduct = () => {\n\t\tconst product = selectedData?.[collectionId]?.['products']?.[productId];\n\t\treturn product ? true : false;\n\t};\n\n\tconst containsVariant = (variantId: string) => {\n\t\tconst product = selectedData?.[collectionId]?.['products']?.[productId];\n\t\tif (!product) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst variant =\n\t\t\tselectedData?.[collectionId]?.['products']?.[productId]?.['variants']?.[\n\t\t\t\tvariantId\n\t\t\t];\n\n\t\treturn variant ? true : false;\n\t};\n\n\tconst currencyAndPriceForProduct = !(\n\t\t!hideProductVariants && shouldShowVariant(data)\n\t)\n\t\t? `${data.currency ? CurrencySymbols[data.currency] ?? '' : ''}${\n\t\t\t\tObject.values(data['variants'] ?? {})?.[0]?.price ??\n\t\t\t\tObject.values(data['variants'] ?? {})?.[0]?.actualPrice ??\n\t\t\t\t''\n\t\t }`\n\t\t: '';\n\n\treturn (\n\t\t<div>\n\t\t\t<ProductCard\n\t\t\t\tisVariant={false}\n\t\t\t\tdata={data}\n\t\t\t\tproductId={productId}\n\t\t\t\tcollectionId={collectionId}\n\t\t\t\tisSelected={containsProduct()}\n\t\t\t\tisPartiallyChecked={isProductPartiallyChecked}\n\t\t\t\tselectedCollectionsDispatch={selectedCollectionsDispatch}\n\t\t\t\tkey={productId}\n\t\t\t\tupliftAdditions={upliftAdditions}\n\t\t\t\tviewOnly={viewOnly}\n\t\t\t\thideProductCheckbox={hideProductCheckbox}\n\t\t\t\thideVariantCheckbox={hideVariantCheckbox}\n\t\t\t\thideProductVariants={hideProductVariants}\n\t\t\t\tpickerType={pickerType}\n\t\t\t\toutOfStockAction={outOfStockAction}\n\t\t\t\tonProductDetailClick={onProductDetailClick}\n\t\t\t\tshowProductDetailInfoIcon={showProductDetailInfoIcon}\n\t\t\t\tcurrencyAndPrice={currencyAndPriceForProduct}\n\t\t\t/>\n\n\t\t\t{hideProductVariants\n\t\t\t\t? null\n\t\t\t\t: shouldShowVariant(data) &&\n\t\t\t\t Object.keys(data['variants'] || []).map((variantId: any) => {\n\t\t\t\t\t\tconst currencyAndPriceForVariant = `${\n\t\t\t\t\t\t\tdata.currency ? CurrencySymbols[data.currency] ?? '' : ''\n\t\t\t\t\t\t}${\n\t\t\t\t\t\t\tdata['variants']?.[variantId]?.price ??\n\t\t\t\t\t\t\tdata['variants']?.[variantId]?.actualPrice ??\n\t\t\t\t\t\t\t''\n\t\t\t\t\t\t}`;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ProductCard\n\t\t\t\t\t\t\t\tisVariant={true}\n\t\t\t\t\t\t\t\tkey={variantId}\n\t\t\t\t\t\t\t\thideVariantCheckbox={hideVariantCheckbox}\n\t\t\t\t\t\t\t\tdata={{\n\t\t\t\t\t\t\t\t\t...(data['variants'] as { [key: string]: ProductVariant })[\n\t\t\t\t\t\t\t\t\t\tvariantId\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tcurrency: data.currency,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvariantId={variantId}\n\t\t\t\t\t\t\t\tproductId={productId}\n\t\t\t\t\t\t\t\tviewOnly={viewOnly}\n\t\t\t\t\t\t\t\tupliftAdditions={upliftAdditions}\n\t\t\t\t\t\t\t\tcollectionId={collectionId}\n\t\t\t\t\t\t\t\tisSelected={containsVariant(variantId)}\n\t\t\t\t\t\t\t\tselectedCollectionsDispatch={selectedCollectionsDispatch}\n\t\t\t\t\t\t\t\toutOfStockAction={outOfStockAction}\n\t\t\t\t\t\t\t\tonProductDetailClick={onProductDetailClick}\n\t\t\t\t\t\t\t\tshowProductDetailInfoIcon={showProductDetailInfoIcon}\n\t\t\t\t\t\t\t\tcurrencyAndPrice={currencyAndPriceForVariant}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t })}\n\t\t</div>\n\t);\n};\n\ninterface ProductCardInterface {\n\tisVariant: boolean;\n\tdata: Product | ProductVariant;\n\tproductId: string;\n\tcollectionId: string;\n\tvariantId?: string;\n\tisSelected: boolean;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tviewOnly: boolean;\n\tisPartiallyChecked?: boolean;\n\tupliftAdditions: any;\n\thideProductCheckbox?: boolean;\n\toutOfStockAction?: OUT_OF_STOCK_ACTION;\n\thideVariantCheckbox?: boolean;\n\thideProductVariants?: boolean;\n\tshowProductDetailInfoIcon?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tonProductDetailClick?: (productData: Product | ProductVariant) => void;\n\tcurrencyAndPrice?: string;\n}\n\nexport const ProductCard = (props: ProductCardInterface) => {\n\tconst {\n\t\tisVariant,\n\t\tdata,\n\t\tproductId,\n\t\tcollectionId,\n\t\tvariantId,\n\t\tisSelected,\n\t\tselectedCollectionsDispatch,\n\t\tviewOnly,\n\t\tupliftAdditions,\n\t\tisPartiallyChecked,\n\t\thideProductCheckbox,\n\t\toutOfStockAction,\n\t\thideVariantCheckbox,\n\t\thideProductVariants,\n\t\tpickerType = 'PRODUCT',\n\t\tonProductDetailClick,\n\t\tshowProductDetailInfoIcon,\n\t\tcurrencyAndPrice,\n\t} = props;\n\tconst {\n\t\tisVariantForProductPickerTag,\n\t\tdataForProductPickerTag,\n\t\ttagText,\n\t\ttagType,\n\t} = ProductHelper.getDataForProductPickerTag(\n\t\tdata,\n\t\tisVariant,\n\t\toutOfStockAction,\n\t);\n\n\t//show skuid for every variant\n\t//show skuid for product if there is only one variant (as the product itself is the variant)\n\tconst skuId = getSkuId(data, isVariant);\n\n\tconst onProductCardClick = (event) => {\n\t\tevent.stopPropagation();\n\n\t\tif (\n\t\t\tpickerType === 'PRODUCT' &&\n\t\t\t(hideProductCheckbox || hideVariantCheckbox)\n\t\t) {\n\t\t\tconst keys = Object.keys(data['variants']);\n\t\t\tif (hideProductVariants) {\n\t\t\t\tif (!isSelected) {\n\t\t\t\t\tupliftAdditions('productSelected', {\n\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\tproduct: data,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\ttype: 'productUnselected',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isSelected) {\n\t\t\t\t\tupliftAdditions('variantSelected', {\n\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\tvariantId: variantId || keys[0],\n\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\tvariant: data,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\ttype: 'variantUnselected',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<ProductCardStyle\n\t\t\tisVariant={isVariant}\n\t\t\tonClick={onProductCardClick}\n\t\t\tisActive={isSelected}\n\t\t>\n\t\t\t{(isVariant && !(viewOnly || hideVariantCheckbox)) ||\n\t\t\t(!isVariant && !(viewOnly || hideProductCheckbox)) ? (\n\t\t\t\t<CheckBox\n\t\t\t\t\tisChecked={isSelected}\n\t\t\t\t\tisPartiallyChecked={isPartiallyChecked || false}\n\t\t\t\t\tonValueChange={function (checked: boolean, _val, event): void {\n\t\t\t\t\t\tevent?.stopPropagation();\n\n\t\t\t\t\t\tif (!isVariant) {\n\t\t\t\t\t\t\tif (!checked) {\n\t\t\t\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\ttype: 'productUnselected',\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupliftAdditions('productSelected', {\n\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\tproduct: data,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!checked) {\n\t\t\t\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\ttype: hideProductVariants\n\t\t\t\t\t\t\t\t\t\t? 'productUnselected'\n\t\t\t\t\t\t\t\t\t\t: 'variantUnselected',\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupliftAdditions(\n\t\t\t\t\t\t\t\t\thideProductVariants ? 'productSelected' : 'variantSelected',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\t\tvariant: data,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<></>\n\t\t\t)}\n\t\t\t<div>\n\t\t\t\t<ShimmerImage\n\t\t\t\t\twidth={40}\n\t\t\t\t\theight={40}\n\t\t\t\t\timageUrl={data.image}\n\t\t\t\t\talt=\"Item\"\n\t\t\t\t\tborderRadius={4}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tflex: 1,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\t\tgap: 16,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tvariant={'light'}\n\t\t\t\t\t\tbody={data.name}\n\t\t\t\t\t\tplacement={'bottom'}\n\t\t\t\t\t\tdelay={400}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TitleSmall\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tnumberOfLines={1}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{data.name}\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t</Tooltip>\n\n\t\t\t\t\t<ProductInfo>\n\t\t\t\t\t\t<ProductPickerTag\n\t\t\t\t\t\t\tisVariant={isVariantForProductPickerTag}\n\t\t\t\t\t\t\tdata={dataForProductPickerTag}\n\t\t\t\t\t\t\ttagText={tagText}\n\t\t\t\t\t\t\ttagType={tagType}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{showProductDetailInfoIcon && (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tonProductDetailClick?.(data);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tIcon={() => (\n\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.placeholder}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ProductInfo>\n\t\t\t\t</div>\n\t\t\t\t<ProductSubTitle>\n\t\t\t\t\t{/* in the cases where we show tags, do not show the currency and price and sku id */}\n\t\t\t\t\t{(!(dataForProductPickerTag as ProductVariant)?.fbStatus &&\n\t\t\t\t\t\tisVariantForProductPickerTag) ||\n\t\t\t\t\ttagText ? null : (\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t{currencyAndPrice}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t)}\n\t\t\t\t\t{skuId && (\n\t\t\t\t\t\t<Tooltip body={skuId} placement=\"top\">\n\t\t\t\t\t\t\t<SKUIDBadge>\n\t\t\t\t\t\t\t\t<EllipsedBodyTiny>{`SKU ID: ${skuId}`}</EllipsedBodyTiny>\n\t\t\t\t\t\t\t</SKUIDBadge>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t)}\n\t\t\t\t</ProductSubTitle>\n\t\t\t</div>\n\t\t</ProductCardStyle>\n\t);\n};\n"],"names":["ProductGroup","props","collectionId","productId","data","selectedData","selectedCollectionsDispatch","viewOnly","upliftAdditions","isProductPartiallyChecked","hideProductCheckbox","outOfStockAction","hideVariantCheckbox","hideProductVariants","pickerType","onProductDetailClick","showProductDetailInfoIcon","containsProduct","containsVariant","variantId","currencyAndPriceForProduct","shouldShowVariant","CurrencySymbols","jsx","ProductCard","currencyAndPriceForVariant","isVariant","isSelected","isPartiallyChecked","currencyAndPrice","isVariantForProductPickerTag","dataForProductPickerTag","tagText","tagType","ProductHelper","skuId","getSkuId","jsxs","ProductCardStyle","event","keys","CheckBox","checked","_val","Fragment","ShimmerImage","Tooltip","TitleSmall","ProductInfo","ProductPickerTag","IconButton","InfoIcon","COLORS","ProductSubTitle","BodyCaption","SKUIDBadge","EllipsedBodyTiny"],"mappings":";;;;;;;;;;;;;AA4CO,MAAMA,KAAe,CAACC,MAAiC;AAC7D,QAAM;AAAA,IACL,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,UAAAC;AAAA,IACA,i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4C,GAAA,EACA,UAAA;AAAA,sBAAA,gBAAAzB;AAAA,wBAAC0B;AAAA,wBAAA;AAAA,0BACA,WAAWnB;AAAA,0BACX,MAAMC;AAAA,0BACN,SAAAC;AAAA,0BACA,SAAAC;AAAA,wBAAA;AAAA,sBAAA;AAAA,sBAEAjB,KACA,gBAAAO;AAAA,wBAAC2B;AAAA,wBAAA;AAAA,0BACA,SAAS,MAAM;AACd,4BAAAnC,IAAuBX,CAAI;AAAA,0BAC5B;AAAA,0BACA,MAAM,MACL,gBAAAmB;AAAA,4BAAC4B;AAAAA,4BAAA;AAAA,8BACA,OAAO;AAAA,8BACP,QAAQ;AAAA,8BACR,OAAOC,EAAO,QAAQ;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACvB;AAAA,sBAAA;AAAA,oBAEF,EAAA,CAEF;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,gCAEAC,GAAA,EAEE,UAAA;AAAA,gBAAA,CAAEtB,GAA4C,YAC/CD,KACDE,IAAU,OACT,gBAAAT,EAAC+B,GAAA,EAAY,OAAOF,EAAO,QAAQ,WACjC,UAAAvB,EAAA,CACF;AAAA,gBAEAM,KACA,gBAAAZ,EAACuB,GAAA,EAAQ,MAAMX,GAAO,WAAU,OAC/B,UAAA,gBAAAZ,EAACgC,GAAA,EACA,4BAACC,GAAA,EAAkB,UAAA,WAAWrB,CAAK,IAAG,GACvC,EAAA,CACD;AAAA,cAAA,EAAA,CAEF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAGH;"}
1
+ {"version":3,"file":"product.js","sources":["../../../../src/components/product-picker-v2/product.tsx"],"sourcesContent":["import { COLORS } from '@src/constants/Theme';\nimport InfoIcon from '../../assets/icons/info.svg';\nimport { CheckBox } from '../checkBox';\nimport { IconButton } from '../icon-button';\nimport { ShimmerImage } from '../shimmer-image';\nimport { Tooltip } from '../tooltips';\nimport { BodyCaption, TitleSmall } from '../TypographyStyle';\nimport { CurrencySymbols } from './constants';\nimport { ProductHelper } from './helpers/ProductHelper';\nimport { ProductPickerTag } from './ProductPickerTag';\nimport type { SelectedCollectionsActions } from './reducers';\nimport {\n\tEllipsedBodyTiny,\n\tProductCardStyle,\n\tProductInfo,\n\tProductSubTitle,\n\tSKUIDBadge,\n} from './style';\nimport {\n\tOUT_OF_STOCK_ACTION,\n\ttype Product,\n\ttype ProductVariant,\n\ttype SelectedItems,\n} from './type';\nimport { getSkuId, shouldShowVariant } from './utility';\n\ninterface ProductGroupInterface {\n\tcollectionId: string;\n\tproductId: string;\n\tdata: Product;\n\tselectedData: SelectedItems;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tviewOnly: boolean;\n\tisProductPartiallyChecked?: boolean;\n\tupliftAdditions: any;\n\thideProductCheckbox?: boolean;\n\toutOfStockAction?: OUT_OF_STOCK_ACTION;\n\thideVariantCheckbox?: boolean;\n\thideProductVariants?: boolean;\n\tshowProductDetailInfoIcon?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tonProductDetailClick?: (productData: Product | ProductVariant) => void;\n}\n\nexport const ProductGroup = (props: ProductGroupInterface) => {\n\tconst {\n\t\tcollectionId,\n\t\tproductId,\n\t\tdata,\n\t\tselectedData,\n\t\tselectedCollectionsDispatch,\n\t\tviewOnly,\n\t\tupliftAdditions,\n\t\tisProductPartiallyChecked,\n\t\thideProductCheckbox,\n\t\toutOfStockAction,\n\t\thideVariantCheckbox,\n\t\thideProductVariants,\n\t\tpickerType,\n\t\tonProductDetailClick,\n\t\tshowProductDetailInfoIcon,\n\t} = props;\n\n\tconst containsProduct = () => {\n\t\tconst product = selectedData?.[collectionId]?.['products']?.[productId];\n\t\treturn product ? true : false;\n\t};\n\n\tconst containsVariant = (variantId: string) => {\n\t\tconst product = selectedData?.[collectionId]?.['products']?.[productId];\n\t\tif (!product) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst variant =\n\t\t\tselectedData?.[collectionId]?.['products']?.[productId]?.['variants']?.[\n\t\t\t\tvariantId\n\t\t\t];\n\n\t\treturn variant ? true : false;\n\t};\n\n\tconst currencyAndPriceForProduct = !(\n\t\t!hideProductVariants && shouldShowVariant(data)\n\t)\n\t\t? `${data.currency ? CurrencySymbols[data.currency] ?? '' : ''}${\n\t\t\t\tObject.values(data['variants'] ?? {})?.[0]?.price ??\n\t\t\t\tObject.values(data['variants'] ?? {})?.[0]?.actualPrice ??\n\t\t\t\t''\n\t\t }`\n\t\t: '';\n\n\treturn (\n\t\t<div>\n\t\t\t<ProductCard\n\t\t\t\tisVariant={false}\n\t\t\t\tdata={data}\n\t\t\t\tproductId={productId}\n\t\t\t\tcollectionId={collectionId}\n\t\t\t\tisSelected={containsProduct()}\n\t\t\t\tisPartiallyChecked={isProductPartiallyChecked}\n\t\t\t\tselectedCollectionsDispatch={selectedCollectionsDispatch}\n\t\t\t\tkey={productId}\n\t\t\t\tupliftAdditions={upliftAdditions}\n\t\t\t\tviewOnly={viewOnly}\n\t\t\t\thideProductCheckbox={hideProductCheckbox}\n\t\t\t\thideVariantCheckbox={hideVariantCheckbox}\n\t\t\t\thideProductVariants={hideProductVariants}\n\t\t\t\tpickerType={pickerType}\n\t\t\t\toutOfStockAction={outOfStockAction}\n\t\t\t\tonProductDetailClick={onProductDetailClick}\n\t\t\t\tshowProductDetailInfoIcon={showProductDetailInfoIcon}\n\t\t\t\tcurrencyAndPrice={currencyAndPriceForProduct}\n\t\t\t/>\n\n\t\t\t{hideProductVariants\n\t\t\t\t? null\n\t\t\t\t: shouldShowVariant(data) &&\n\t\t\t\t Object.keys(data['variants'] || []).map((variantId: any) => {\n\t\t\t\t\t\tconst currencyAndPriceForVariant = `${\n\t\t\t\t\t\t\tdata.currency ? CurrencySymbols[data.currency] ?? '' : ''\n\t\t\t\t\t\t}${\n\t\t\t\t\t\t\tdata['variants']?.[variantId]?.price ??\n\t\t\t\t\t\t\tdata['variants']?.[variantId]?.actualPrice ??\n\t\t\t\t\t\t\t''\n\t\t\t\t\t\t}`;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ProductCard\n\t\t\t\t\t\t\t\tisVariant={true}\n\t\t\t\t\t\t\t\tkey={variantId}\n\t\t\t\t\t\t\t\thideVariantCheckbox={hideVariantCheckbox}\n\t\t\t\t\t\t\t\tdata={{\n\t\t\t\t\t\t\t\t\t...(data['variants'] as { [key: string]: ProductVariant })[\n\t\t\t\t\t\t\t\t\t\tvariantId\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\tcurrency: data.currency,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvariantId={variantId}\n\t\t\t\t\t\t\t\tproductId={productId}\n\t\t\t\t\t\t\t\tviewOnly={viewOnly}\n\t\t\t\t\t\t\t\tupliftAdditions={upliftAdditions}\n\t\t\t\t\t\t\t\tcollectionId={collectionId}\n\t\t\t\t\t\t\t\tisSelected={containsVariant(variantId)}\n\t\t\t\t\t\t\t\tselectedCollectionsDispatch={selectedCollectionsDispatch}\n\t\t\t\t\t\t\t\toutOfStockAction={outOfStockAction}\n\t\t\t\t\t\t\t\tonProductDetailClick={onProductDetailClick}\n\t\t\t\t\t\t\t\tshowProductDetailInfoIcon={showProductDetailInfoIcon}\n\t\t\t\t\t\t\t\tcurrencyAndPrice={currencyAndPriceForVariant}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t })}\n\t\t</div>\n\t);\n};\n\ninterface ProductCardInterface {\n\tisVariant: boolean;\n\tdata: Product | ProductVariant;\n\tproductId: string;\n\tcollectionId: string;\n\tvariantId?: string;\n\tisSelected: boolean;\n\tselectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;\n\tviewOnly: boolean;\n\tisPartiallyChecked?: boolean;\n\tupliftAdditions: any;\n\thideProductCheckbox?: boolean;\n\toutOfStockAction?: OUT_OF_STOCK_ACTION;\n\thideVariantCheckbox?: boolean;\n\thideProductVariants?: boolean;\n\tshowProductDetailInfoIcon?: boolean;\n\tpickerType?: 'COLLECTION' | 'PRODUCT';\n\tonProductDetailClick?: (productData: Product | ProductVariant) => void;\n\tcurrencyAndPrice?: string;\n}\n\nexport const ProductCard = (props: ProductCardInterface) => {\n\tconst {\n\t\tisVariant,\n\t\tdata,\n\t\tproductId,\n\t\tcollectionId,\n\t\tvariantId,\n\t\tisSelected,\n\t\tselectedCollectionsDispatch,\n\t\tviewOnly,\n\t\tupliftAdditions,\n\t\tisPartiallyChecked,\n\t\thideProductCheckbox,\n\t\toutOfStockAction,\n\t\thideVariantCheckbox,\n\t\thideProductVariants,\n\t\tpickerType = 'PRODUCT',\n\t\tonProductDetailClick,\n\t\tshowProductDetailInfoIcon,\n\t\tcurrencyAndPrice,\n\t} = props;\n\tconst {\n\t\tisVariantForProductPickerTag,\n\t\tdataForProductPickerTag,\n\t\ttagText,\n\t\ttagType,\n\t} = ProductHelper.getDataForProductPickerTag(\n\t\tdata,\n\t\tisVariant,\n\t\toutOfStockAction,\n\t);\n\n\t//show skuid for every variant\n\t//show skuid for product if there is only one variant (as the product itself is the variant)\n\tconst skuId = getSkuId(data, isVariant);\n\n\tconst onProductCardClick = (event) => {\n\t\tevent.stopPropagation();\n\n\t\tif (\n\t\t\tpickerType === 'PRODUCT' &&\n\t\t\t(hideProductCheckbox || hideVariantCheckbox)\n\t\t) {\n\t\t\tconst keys = Object.keys(data['variants']);\n\t\t\tif (hideProductVariants) {\n\t\t\t\tif (!isSelected) {\n\t\t\t\t\tupliftAdditions('productSelected', {\n\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\tproduct: data,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\ttype: 'productUnselected',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isSelected) {\n\t\t\t\t\tupliftAdditions('variantSelected', {\n\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\tvariantId: variantId || keys[0],\n\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\tvariant: data,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\ttype: 'variantUnselected',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<ProductCardStyle\n\t\t\tisVariant={isVariant}\n\t\t\tonClick={onProductCardClick}\n\t\t\tisActive={isSelected}\n\t\t>\n\t\t\t{(isVariant && !(viewOnly || hideVariantCheckbox)) ||\n\t\t\t(!isVariant && !(viewOnly || hideProductCheckbox)) ? (\n\t\t\t\t<CheckBox\n\t\t\t\t\tisChecked={isSelected}\n\t\t\t\t\tisPartiallyChecked={isPartiallyChecked || false}\n\t\t\t\t\tariaLabel={data.name}\n\t\t\t\t\tonValueChange={function (checked: boolean, _val, event): void {\n\t\t\t\t\t\tevent?.stopPropagation();\n\n\t\t\t\t\t\tif (!isVariant) {\n\t\t\t\t\t\t\tif (!checked) {\n\t\t\t\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\ttype: 'productUnselected',\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupliftAdditions('productSelected', {\n\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\tproduct: data,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!checked) {\n\t\t\t\t\t\t\t\tselectedCollectionsDispatch({\n\t\t\t\t\t\t\t\t\ttype: hideProductVariants\n\t\t\t\t\t\t\t\t\t\t? 'productUnselected'\n\t\t\t\t\t\t\t\t\t\t: 'variantUnselected',\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tupliftAdditions(\n\t\t\t\t\t\t\t\t\thideProductVariants ? 'productSelected' : 'variantSelected',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tproductId: productId,\n\t\t\t\t\t\t\t\t\t\tvariantId: variantId,\n\t\t\t\t\t\t\t\t\t\tcollectionId: collectionId,\n\t\t\t\t\t\t\t\t\t\tvariant: data,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<></>\n\t\t\t)}\n\t\t\t<div>\n\t\t\t\t<ShimmerImage\n\t\t\t\t\twidth={40}\n\t\t\t\t\theight={40}\n\t\t\t\t\timageUrl={data.image}\n\t\t\t\t\talt=\"Item\"\n\t\t\t\t\tborderRadius={4}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tflex: 1,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\t\tgap: 16,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tvariant={'light'}\n\t\t\t\t\t\tbody={data.name}\n\t\t\t\t\t\tplacement={'bottom'}\n\t\t\t\t\t\tdelay={400}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TitleSmall\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tnumberOfLines={1}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{data.name}\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t</Tooltip>\n\n\t\t\t\t\t<ProductInfo>\n\t\t\t\t\t\t<ProductPickerTag\n\t\t\t\t\t\t\tisVariant={isVariantForProductPickerTag}\n\t\t\t\t\t\t\tdata={dataForProductPickerTag}\n\t\t\t\t\t\t\ttagText={tagText}\n\t\t\t\t\t\t\ttagType={tagType}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{showProductDetailInfoIcon && (\n\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tonProductDetailClick?.(data);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tIcon={() => (\n\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.placeholder}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ProductInfo>\n\t\t\t\t</div>\n\t\t\t\t<ProductSubTitle>\n\t\t\t\t\t{/* in the cases where we show tags, do not show the currency and price and sku id */}\n\t\t\t\t\t{(!(dataForProductPickerTag as ProductVariant)?.fbStatus &&\n\t\t\t\t\t\tisVariantForProductPickerTag) ||\n\t\t\t\t\ttagText ? null : (\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t{currencyAndPrice}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t)}\n\t\t\t\t\t{skuId && (\n\t\t\t\t\t\t<Tooltip body={skuId} placement=\"top\">\n\t\t\t\t\t\t\t<SKUIDBadge>\n\t\t\t\t\t\t\t\t<EllipsedBodyTiny>{`SKU ID: ${skuId}`}</EllipsedBodyTiny>\n\t\t\t\t\t\t\t</SKUIDBadge>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t)}\n\t\t\t\t</ProductSubTitle>\n\t\t\t</div>\n\t\t</ProductCardStyle>\n\t);\n};\n"],"names":["ProductGroup","props","collectionId","productId","data","selectedData","selectedCollectionsDispatch","viewOnly","upliftAdditions","isProductPartiallyChecked","hideProductCheckbox","outOfStockAction","hideVariantCheckbox","hideProductVariants","pickerType","onProductDetailClick","showProductDetailInfoIcon","containsProduct","containsVariant","variantId","currencyAndPriceForProduct","shouldShowVariant","CurrencySymbols","jsx","ProductCard","currencyAndPriceForVariant","isVariant","isSelected","isPartiallyChecked","currencyAndPrice","isVariantForProductPickerTag","dataForProductPickerTag","tagText","tagType","ProductHelper","skuId","getSkuId","jsxs","ProductCardStyle","event","keys","CheckBox","checked","_val","Fragment","ShimmerImage","Tooltip","TitleSmall","ProductInfo","ProductPickerTag","IconButton","InfoIcon","COLORS","ProductSubTitle","BodyCaption","SKUIDBadge","EllipsedBodyTiny"],"mappings":";;;;;;;;;;;;;AA4CO,MAAMA,KAAe,CAACC,MAAiC;AAC7D,QAAM;AAAA,IACL,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAA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,eAAe;AAAA,4BAEd,UAAA3C,EAAK;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBACP;AAAA,oBAAA;AAAA,sCAGA4C,GAAA,EACA,UAAA;AAAA,sBAAA,gBAAAzB;AAAA,wBAAC0B;AAAA,wBAAA;AAAA,0BACA,WAAWnB;AAAA,0BACX,MAAMC;AAAA,0BACN,SAAAC;AAAA,0BACA,SAAAC;AAAA,wBAAA;AAAA,sBAAA;AAAA,sBAEAjB,KACA,gBAAAO;AAAA,wBAAC2B;AAAA,wBAAA;AAAA,0BACA,SAAS,MAAM;AACd,4BAAAnC,IAAuBX,CAAI;AAAA,0BAC5B;AAAA,0BACA,MAAM,MACL,gBAAAmB;AAAA,4BAAC4B;AAAAA,4BAAA;AAAA,8BACA,OAAO;AAAA,8BACP,QAAQ;AAAA,8BACR,OAAOC,EAAO,QAAQ;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACvB;AAAA,sBAAA;AAAA,oBAEF,EAAA,CAEF;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,gCAEAC,GAAA,EAEE,UAAA;AAAA,gBAAA,CAAEtB,GAA4C,YAC/CD,KACDE,IAAU,OACT,gBAAAT,EAAC+B,GAAA,EAAY,OAAOF,EAAO,QAAQ,WACjC,UAAAvB,EAAA,CACF;AAAA,gBAEAM,KACA,gBAAAZ,EAACuB,GAAA,EAAQ,MAAMX,GAAO,WAAU,OAC/B,UAAA,gBAAAZ,EAACgC,GAAA,EACA,4BAACC,GAAA,EAAkB,UAAA,WAAWrB,CAAK,IAAG,GACvC,EAAA,CACD;AAAA,cAAA,EAAA,CAEF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAGH;"}
@@ -1,135 +1,155 @@
1
- import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
- import { useCallback as N, useState as q, useEffect as v } from "react";
3
- import { DEFAULT_THEME as S } from "../../constants/Theme.js";
4
- import { TabItem as P, TrailingNumberContainer as y, TabItemText as z, TabHeader as F, EmptyTab as L, RightComponent as j } from "./Tabs.styles.js";
5
- import { Tag as f } from "../tag/Tag.js";
6
- const H = (e) => {
1
+ import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
+ import { useCallback as q, useState as v, useEffect as P } from "react";
3
+ import { DEFAULT_THEME as N } from "../../constants/Theme.js";
4
+ import { TabItem as z, TrailingNumberContainer as k, TabItemText as F, TabHeader as L, EmptyTab as j, RightComponent as H } from "./Tabs.styles.js";
5
+ import { Tag as h } from "../tag/Tag.js";
6
+ const R = (e) => {
7
7
  const {
8
8
  tabs: t,
9
9
  initialTab: d,
10
- onTabSelected: l,
10
+ onTabSelected: c,
11
11
  TabItemStyledProps: m,
12
- selectedTab: a,
12
+ selectedTab: o,
13
13
  extendedBorder: i,
14
- rightComponent: b,
15
- size: u = "default",
14
+ rightComponent: u,
15
+ size: b = "default",
16
16
  isSquared: T = !1,
17
- containerStyles: g
18
- } = e, [n, r] = q(d || t[0].key), { colorsV2: c } = S;
19
- v(() => {
20
- a && a !== n && r(a);
21
- }, [a, n]);
22
- const p = e.backgroundColor, E = e.selectedTextColor ?? c.background.brand, I = e.textColor ?? c.content.secondary;
23
- return /* @__PURE__ */ h(
24
- F,
17
+ containerStyles: g,
18
+ gap: r,
19
+ selectedNumberBackground: a
20
+ } = e, [l, C] = v(d || t[0].key), { colorsV2: x } = N;
21
+ P(() => {
22
+ o && o !== l && C(o);
23
+ }, [o, l]);
24
+ const I = e.backgroundColor, B = e.selectedTextColor ?? x.background.brand, p = e.textColor ?? x.content.secondary;
25
+ return /* @__PURE__ */ S(
26
+ L,
25
27
  {
26
28
  style: g ?? {},
27
- bgColor: p,
29
+ bgColor: I,
30
+ tabGap: r,
28
31
  "data-test": e["data-test"],
29
32
  children: [
30
- t.map((s, C) => /* @__PURE__ */ o(
31
- k,
33
+ t.map((s, y) => /* @__PURE__ */ n(
34
+ E,
32
35
  {
33
36
  hasEqualSpacing: e.hasEqualSpacing,
34
- selectedTextColor: E,
35
- textColor: I,
37
+ uniformBorder: !!r,
38
+ selectedTextColor: B,
39
+ textColor: p,
36
40
  tab: s,
37
- currentTab: n,
41
+ currentTab: l,
38
42
  TabItemStyledProps: m,
39
43
  IconComponent: s.icon,
40
- size: u,
41
- setCurrentTab: (x) => {
42
- r(x), l && l(x);
44
+ size: b,
45
+ selectedNumberBackground: a,
46
+ setCurrentTab: (f) => {
47
+ C(f), c && c(f);
43
48
  },
44
49
  isSquared: T,
45
- isFirstlement: C == 0,
46
- isLastElement: C == t.length - 1,
50
+ isFirstlement: y == 0,
51
+ isLastElement: y == t.length - 1,
47
52
  iconPosition: s.iconPosition ?? "left"
48
53
  },
49
54
  s.key
50
55
  )),
51
- i && /* @__PURE__ */ o(L, {}),
52
- /* @__PURE__ */ o(j, { children: b })
56
+ i && /* @__PURE__ */ n(j, {}),
57
+ /* @__PURE__ */ n(H, { children: u })
53
58
  ]
54
59
  }
55
60
  );
56
- }, k = (e) => {
61
+ }, E = (e) => {
57
62
  const {
58
63
  tab: t,
59
64
  currentTab: d,
60
- setCurrentTab: l,
65
+ setCurrentTab: c,
61
66
  TabItemStyledProps: m,
62
- IconComponent: a,
67
+ IconComponent: o,
63
68
  iconPosition: i = "left",
64
- size: b = "default",
65
- isSquared: u = !1,
69
+ size: u = "default",
70
+ isSquared: b = !1,
66
71
  isFirstlement: T,
67
72
  isLastElement: g
68
- } = e, n = t.key === d, { colorsV2: r } = S, c = N(() => ({
73
+ } = e, r = t.key === d, { colorsV2: a } = N, l = q(() => ({
69
74
  ...m,
70
75
  borderRadius: e.isSquared ? T ? "4px 0px 0px 4px" : g ? "0px 4px 4px 0px" : "" : ""
71
76
  }), []);
72
- return /* @__PURE__ */ h(
73
- P,
77
+ return /* @__PURE__ */ S(
78
+ z,
74
79
  {
75
- style: c(),
76
- selected: n,
80
+ style: l(),
81
+ selected: r,
82
+ uniformBorder: e.uniformBorder,
77
83
  hasEqualSpacing: e.hasEqualSpacing,
78
- onClick: () => l(e.tab.key),
84
+ onClick: () => c(e.tab.key),
79
85
  selectedTextColor: e.selectedTextColor,
80
- isSquared: u,
86
+ isSquared: b,
81
87
  "data-test": e["data-test"],
82
88
  children: [
83
- a && i === "left" && /* @__PURE__ */ o(
84
- a,
89
+ o && i === "left" && /* @__PURE__ */ n(
90
+ o,
85
91
  {
86
- selected: n ? r.background.brand : r.content.secondary
92
+ selected: r ? a.background.brand : a.content.secondary
87
93
  }
88
94
  ),
89
- t.leadingNumber !== void 0 && t.leadingNumber !== null && /* @__PURE__ */ o(y, { selected: n, children: /* @__PURE__ */ o(
90
- f,
95
+ t.leadingNumber !== void 0 && t.leadingNumber !== null && /* @__PURE__ */ n(
96
+ k,
91
97
  {
92
- tagText: t?.leadingNumber ?? 0,
93
- theme: "dark",
94
- type: t.numberTagType,
95
- variant: "circle",
96
- color: r.content.primaryInverse
98
+ selected: r,
99
+ selectedBackground: e.selectedNumberBackground,
100
+ children: /* @__PURE__ */ n(
101
+ h,
102
+ {
103
+ tagText: t?.leadingNumber ?? 0,
104
+ theme: "dark",
105
+ type: t.numberTagType,
106
+ variant: "circle",
107
+ color: a.content.primaryInverse
108
+ }
109
+ )
97
110
  }
98
- ) }),
99
- /* @__PURE__ */ o(
100
- z,
111
+ ),
112
+ /* @__PURE__ */ n(
113
+ F,
101
114
  {
102
- style: b === "small" ? { fontSize: 14, fontStyle: "normal", fontWeight: 600 } : void 0,
115
+ style: u === "small" ? { fontSize: 14, fontStyle: "normal", fontWeight: 600 } : void 0,
103
116
  textColor: e.textColor,
104
117
  selectedTextColor: e.selectedTextColor,
105
- selected: n,
118
+ selected: r,
106
119
  children: t.title
107
120
  }
108
121
  ),
109
- t.trailingNumber !== void 0 && t.trailingNumber !== null && /* @__PURE__ */ o(y, { selected: n, children: /* @__PURE__ */ o(
110
- f,
122
+ t.trailingNumber !== void 0 && t.trailingNumber !== null && /* @__PURE__ */ n(
123
+ k,
111
124
  {
112
- tagText: t?.trailingNumber ?? 0,
113
- theme: "dark",
114
- type: t.numberTagType,
115
- variant: "circle",
116
- color: r.content.primaryInverse
125
+ selected: r,
126
+ selectedBackground: e.selectedNumberBackground,
127
+ children: /* @__PURE__ */ n(
128
+ h,
129
+ {
130
+ tagText: t?.trailingNumber ?? 0,
131
+ theme: "dark",
132
+ type: t.numberTagType,
133
+ variant: "circle",
134
+ color: a.content.primaryInverse
135
+ }
136
+ )
117
137
  }
118
- ) }),
119
- a && i === "right" && /* @__PURE__ */ o(
120
- a,
138
+ ),
139
+ o && i === "right" && /* @__PURE__ */ n(
140
+ o,
121
141
  {
122
- selected: n ? r.background.brand : r.content.secondary
142
+ selected: r ? a.background.brand : a.content.secondary
123
143
  }
124
144
  )
125
145
  ]
126
146
  }
127
147
  );
128
148
  };
129
- H.displayName = "Tabs";
130
- k.displayName = "TabItemComponent";
149
+ R.displayName = "Tabs";
150
+ E.displayName = "TabItemComponent";
131
151
  export {
132
- k as TabItemComponent,
133
- H as Tabs
152
+ E as TabItemComponent,
153
+ R as Tabs
134
154
  };
135
155
  //# sourceMappingURL=Tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","sources":["../../../../src/components/tabs/Tabs.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { Tag } from '../tag';\nimport { TabItemComponentProps, TabViewHeaderProps } from './Tabs.model';\nimport {\n\tEmptyTab,\n\tRightComponent,\n\tTabHeader,\n\tTabItem,\n\tTabItemText,\n\tTrailingNumberContainer,\n} from './Tabs.styles';\n\nexport const Tabs: React.FC<TabViewHeaderProps> = (props) => {\n\tconst {\n\t\ttabs,\n\t\tinitialTab,\n\t\tonTabSelected,\n\t\tTabItemStyledProps,\n\t\tselectedTab,\n\t\textendedBorder,\n\t\trightComponent,\n\t\tsize = 'default',\n\t\tisSquared = false,\n\t\tcontainerStyles,\n\t} = props;\n\tconst [currentTab, setCurrentTab] = useState(initialTab || tabs[0].key);\n\tconst { colorsV2 } = DEFAULT_THEME;\n\n\tuseEffect(() => {\n\t\tif (selectedTab && selectedTab !== currentTab) {\n\t\t\tsetCurrentTab(selectedTab);\n\t\t}\n\t}, [selectedTab, currentTab]);\n\n\tconst backgroundColor = props.backgroundColor;\n\tconst selectedTextColor =\n\t\tprops.selectedTextColor ?? colorsV2.background.brand;\n\tconst textColor = props.textColor ?? colorsV2.content.secondary;\n\n\treturn (\n\t\t<TabHeader\n\t\t\tstyle={containerStyles ?? {}}\n\t\t\tbgColor={backgroundColor}\n\t\t\tdata-test={props['data-test']}\n\t\t>\n\t\t\t{tabs.map((tab, index) => (\n\t\t\t\t<TabItemComponent\n\t\t\t\t\thasEqualSpacing={props.hasEqualSpacing}\n\t\t\t\t\tselectedTextColor={selectedTextColor}\n\t\t\t\t\ttextColor={textColor}\n\t\t\t\t\tkey={tab.key}\n\t\t\t\t\ttab={tab}\n\t\t\t\t\tcurrentTab={currentTab}\n\t\t\t\t\tTabItemStyledProps={TabItemStyledProps}\n\t\t\t\t\tIconComponent={tab.icon}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tsetCurrentTab={(tabKey) => {\n\t\t\t\t\t\tsetCurrentTab(tabKey);\n\t\t\t\t\t\tif (onTabSelected) {\n\t\t\t\t\t\t\tonTabSelected(tabKey as string);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tisSquared={isSquared}\n\t\t\t\t\tisFirstlement={index == 0}\n\t\t\t\t\tisLastElement={index == tabs.length - 1}\n\t\t\t\t\ticonPosition={tab.iconPosition ?? 'left'}\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{extendedBorder && <EmptyTab />}\n\t\t\t<RightComponent>{rightComponent}</RightComponent>\n\t\t</TabHeader>\n\t);\n};\n\nexport const TabItemComponent: React.FC<TabItemComponentProps> = (props) => {\n\tconst {\n\t\ttab,\n\t\tcurrentTab,\n\t\tsetCurrentTab,\n\t\tTabItemStyledProps,\n\t\tIconComponent,\n\t\ticonPosition = 'left',\n\t\tsize = 'default',\n\t\tisSquared = false,\n\t\tisFirstlement,\n\t\tisLastElement,\n\t} = props;\n\tconst selected = tab.key === currentTab;\n\tconst { colorsV2 } = DEFAULT_THEME;\n\n\tconst tabStyles = useCallback(() => {\n\t\treturn {\n\t\t\t...TabItemStyledProps,\n\t\t\tborderRadius: props.isSquared\n\t\t\t\t? isFirstlement\n\t\t\t\t\t? '4px 0px 0px 4px'\n\t\t\t\t\t: isLastElement\n\t\t\t\t\t? '0px 4px 4px 0px'\n\t\t\t\t\t: ''\n\t\t\t\t: '',\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\treturn (\n\t\t<TabItem\n\t\t\tstyle={tabStyles()}\n\t\t\tselected={selected}\n\t\t\thasEqualSpacing={props.hasEqualSpacing}\n\t\t\tonClick={() => setCurrentTab(props.tab.key)}\n\t\t\tselectedTextColor={props.selectedTextColor}\n\t\t\tisSquared={isSquared}\n\t\t\tdata-test={props['data-test']}\n\t\t>\n\t\t\t{IconComponent && iconPosition === 'left' && (\n\t\t\t\t<IconComponent\n\t\t\t\t\tselected={\n\t\t\t\t\t\tselected ? colorsV2.background.brand : colorsV2.content.secondary\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{tab.leadingNumber !== undefined && tab.leadingNumber !== null && (\n\t\t\t\t<TrailingNumberContainer selected={selected}>\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttagText={tab?.leadingNumber ?? 0}\n\t\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\t\ttype={tab.numberTagType}\n\t\t\t\t\t\tvariant=\"circle\"\n\t\t\t\t\t\tcolor={colorsV2.content.primaryInverse}\n\t\t\t\t\t/>\n\t\t\t\t</TrailingNumberContainer>\n\t\t\t)}\n\t\t\t<TabItemText\n\t\t\t\tstyle={\n\t\t\t\t\tsize === 'small'\n\t\t\t\t\t\t? { fontSize: 14, fontStyle: 'normal', fontWeight: 600 }\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\ttextColor={props.textColor}\n\t\t\t\tselectedTextColor={props.selectedTextColor}\n\t\t\t\tselected={selected}\n\t\t\t>\n\t\t\t\t{tab.title}\n\t\t\t</TabItemText>\n\t\t\t{tab.trailingNumber !== undefined && tab.trailingNumber !== null && (\n\t\t\t\t<TrailingNumberContainer selected={selected}>\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttagText={tab?.trailingNumber ?? 0}\n\t\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\t\ttype={tab.numberTagType}\n\t\t\t\t\t\tvariant=\"circle\"\n\t\t\t\t\t\tcolor={colorsV2.content.primaryInverse}\n\t\t\t\t\t/>\n\t\t\t\t</TrailingNumberContainer>\n\t\t\t)}\n\t\t\t{IconComponent && iconPosition === 'right' && (\n\t\t\t\t<IconComponent\n\t\t\t\t\tselected={\n\t\t\t\t\t\tselected ? colorsV2.background.brand : colorsV2.content.secondary\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</TabItem>\n\t);\n};\n\nTabs.displayName = 'Tabs';\n\nTabItemComponent.displayName = 'TabItemComponent';\n"],"names":["Tabs","props","tabs","initialTab","onTabSelected","TabItemStyledProps","selectedTab","extendedBorder","rightComponent","size","isSquared","containerStyles","currentTab","setCurrentTab","useState","colorsV2","DEFAULT_THEME","useEffect","backgroundColor","selectedTextColor","textColor","jsxs","TabHeader","tab","index","jsx","TabItemComponent","tabKey","EmptyTab","RightComponent","IconComponent","iconPosition","isFirstlement","isLastElement","selected","tabStyles","useCallback","TabItem","TrailingNumberContainer","Tag","TabItemText"],"mappings":";;;;;AAaO,MAAMA,IAAqC,CAACC,MAAU;AAC5D,QAAM;AAAA,IACL,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAA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,WAAWR,EAAM;AAAA,YACjB,mBAAmBA,EAAM;AAAA,YACzB,UAAAiC;AAAA,YAEC,UAAAX,EAAI;AAAA,UAAA;AAAA,QAAA;AAAA,QAELA,EAAI,mBAAmB,UAAaA,EAAI,mBAAmB,QAC3D,gBAAAE,EAACa,KAAwB,UAAAJ,GACxB,UAAA,gBAAAT;AAAA,UAACc;AAAA,UAAA;AAAA,YACA,SAAShB,GAAK,kBAAkB;AAAA,YAChC,OAAM;AAAA,YACN,MAAMA,EAAI;AAAA,YACV,SAAQ;AAAA,YACR,OAAOR,EAAS,QAAQ;AAAA,UAAA;AAAA,QAAA,GAE1B;AAAA,QAEAe,KAAiBC,MAAiB,WAClC,gBAAAN;AAAA,UAACK;AAAA,UAAA;AAAA,YACA,UACCI,IAAWnB,EAAS,WAAW,QAAQA,EAAS,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MAE1D;AAAA,IAAA;AAAA,EAAA;AAIJ;AAEAf,EAAK,cAAc;AAEnB0B,EAAiB,cAAc;"}
1
+ {"version":3,"file":"Tabs.js","sources":["../../../../src/components/tabs/Tabs.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { Tag } from '../tag';\nimport { TabItemComponentProps, TabViewHeaderProps } from './Tabs.model';\nimport {\n\tEmptyTab,\n\tRightComponent,\n\tTabHeader,\n\tTabItem,\n\tTabItemText,\n\tTrailingNumberContainer,\n} from './Tabs.styles';\n\nexport const Tabs: React.FC<TabViewHeaderProps> = (props) => {\n\tconst {\n\t\ttabs,\n\t\tinitialTab,\n\t\tonTabSelected,\n\t\tTabItemStyledProps,\n\t\tselectedTab,\n\t\textendedBorder,\n\t\trightComponent,\n\t\tsize = 'default',\n\t\tisSquared = false,\n\t\tcontainerStyles,\n\t\tgap,\n\t\tselectedNumberBackground,\n\t} = props;\n\tconst [currentTab, setCurrentTab] = useState(initialTab || tabs[0].key);\n\tconst { colorsV2 } = DEFAULT_THEME;\n\n\tuseEffect(() => {\n\t\tif (selectedTab && selectedTab !== currentTab) {\n\t\t\tsetCurrentTab(selectedTab);\n\t\t}\n\t}, [selectedTab, currentTab]);\n\n\tconst backgroundColor = props.backgroundColor;\n\tconst selectedTextColor =\n\t\tprops.selectedTextColor ?? colorsV2.background.brand;\n\tconst textColor = props.textColor ?? colorsV2.content.secondary;\n\n\treturn (\n\t\t<TabHeader\n\t\t\tstyle={containerStyles ?? {}}\n\t\t\tbgColor={backgroundColor}\n\t\t\ttabGap={gap}\n\t\t\tdata-test={props['data-test']}\n\t\t>\n\t\t\t{tabs.map((tab, index) => (\n\t\t\t\t<TabItemComponent\n\t\t\t\t\thasEqualSpacing={props.hasEqualSpacing}\n\t\t\t\t\tuniformBorder={!!gap}\n\t\t\t\t\tselectedTextColor={selectedTextColor}\n\t\t\t\t\ttextColor={textColor}\n\t\t\t\t\tkey={tab.key}\n\t\t\t\t\ttab={tab}\n\t\t\t\t\tcurrentTab={currentTab}\n\t\t\t\t\tTabItemStyledProps={TabItemStyledProps}\n\t\t\t\t\tIconComponent={tab.icon}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tselectedNumberBackground={selectedNumberBackground}\n\t\t\t\t\tsetCurrentTab={(tabKey) => {\n\t\t\t\t\t\tsetCurrentTab(tabKey);\n\t\t\t\t\t\tif (onTabSelected) {\n\t\t\t\t\t\t\tonTabSelected(tabKey as string);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tisSquared={isSquared}\n\t\t\t\t\tisFirstlement={index == 0}\n\t\t\t\t\tisLastElement={index == tabs.length - 1}\n\t\t\t\t\ticonPosition={tab.iconPosition ?? 'left'}\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{extendedBorder && <EmptyTab />}\n\t\t\t<RightComponent>{rightComponent}</RightComponent>\n\t\t</TabHeader>\n\t);\n};\n\nexport const TabItemComponent: React.FC<TabItemComponentProps> = (props) => {\n\tconst {\n\t\ttab,\n\t\tcurrentTab,\n\t\tsetCurrentTab,\n\t\tTabItemStyledProps,\n\t\tIconComponent,\n\t\ticonPosition = 'left',\n\t\tsize = 'default',\n\t\tisSquared = false,\n\t\tisFirstlement,\n\t\tisLastElement,\n\t} = props;\n\tconst selected = tab.key === currentTab;\n\tconst { colorsV2 } = DEFAULT_THEME;\n\n\tconst tabStyles = useCallback(() => {\n\t\treturn {\n\t\t\t...TabItemStyledProps,\n\t\t\tborderRadius: props.isSquared\n\t\t\t\t? isFirstlement\n\t\t\t\t\t? '4px 0px 0px 4px'\n\t\t\t\t\t: isLastElement\n\t\t\t\t\t? '0px 4px 4px 0px'\n\t\t\t\t\t: ''\n\t\t\t\t: '',\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\treturn (\n\t\t<TabItem\n\t\t\tstyle={tabStyles()}\n\t\t\tselected={selected}\n\t\t\tuniformBorder={props.uniformBorder}\n\t\t\thasEqualSpacing={props.hasEqualSpacing}\n\t\t\tonClick={() => setCurrentTab(props.tab.key)}\n\t\t\tselectedTextColor={props.selectedTextColor}\n\t\t\tisSquared={isSquared}\n\t\t\tdata-test={props['data-test']}\n\t\t>\n\t\t\t{IconComponent && iconPosition === 'left' && (\n\t\t\t\t<IconComponent\n\t\t\t\t\tselected={\n\t\t\t\t\t\tselected ? colorsV2.background.brand : colorsV2.content.secondary\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{tab.leadingNumber !== undefined && tab.leadingNumber !== null && (\n\t\t\t\t<TrailingNumberContainer\n\t\t\t\t\tselected={selected}\n\t\t\t\t\tselectedBackground={props.selectedNumberBackground}\n\t\t\t\t>\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttagText={tab?.leadingNumber ?? 0}\n\t\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\t\ttype={tab.numberTagType}\n\t\t\t\t\t\tvariant=\"circle\"\n\t\t\t\t\t\tcolor={colorsV2.content.primaryInverse}\n\t\t\t\t\t/>\n\t\t\t\t</TrailingNumberContainer>\n\t\t\t)}\n\t\t\t<TabItemText\n\t\t\t\tstyle={\n\t\t\t\t\tsize === 'small'\n\t\t\t\t\t\t? { fontSize: 14, fontStyle: 'normal', fontWeight: 600 }\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\ttextColor={props.textColor}\n\t\t\t\tselectedTextColor={props.selectedTextColor}\n\t\t\t\tselected={selected}\n\t\t\t>\n\t\t\t\t{tab.title}\n\t\t\t</TabItemText>\n\t\t\t{tab.trailingNumber !== undefined && tab.trailingNumber !== null && (\n\t\t\t\t<TrailingNumberContainer\n\t\t\t\t\tselected={selected}\n\t\t\t\t\tselectedBackground={props.selectedNumberBackground}\n\t\t\t\t>\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttagText={tab?.trailingNumber ?? 0}\n\t\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\t\ttype={tab.numberTagType}\n\t\t\t\t\t\tvariant=\"circle\"\n\t\t\t\t\t\tcolor={colorsV2.content.primaryInverse}\n\t\t\t\t\t/>\n\t\t\t\t</TrailingNumberContainer>\n\t\t\t)}\n\t\t\t{IconComponent && iconPosition === 'right' && (\n\t\t\t\t<IconComponent\n\t\t\t\t\tselected={\n\t\t\t\t\t\tselected ? colorsV2.background.brand : colorsV2.content.secondary\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</TabItem>\n\t);\n};\n\nTabs.displayName = 'Tabs';\n\nTabItemComponent.displayName = 'TabItemComponent';\n"],"names":["Tabs","props","tabs","initialTab","onTabSelected","TabItemStyledProps","selectedTab","extendedBorder","rightComponent","size","isSquared","containerStyles","gap","selectedNumberBackground","currentTab","setCurrentTab","useState","colorsV2","DEFAULT_THEME","useEffect","backgroundColor","selectedTextColor","textColor","jsxs","TabHeader","tab","index","jsx","TabItemComponent","tabKey","EmptyTab","RightComponent","IconComponent","iconPosition","isFirstlement","isLastElement","selected","tabStyles","useCallback","TabItem","TrailingNumberContainer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
  selectedTextColor: string;
7
7
  isSquared?: boolean;
8
+ uniformBorder?: boolean;
8
9
  }
9
10
  export interface TabItemTextProps {
10
11
  selected: boolean;
@@ -41,10 +42,14 @@ export interface TabViewHeaderProps {
41
42
  size?: 'small' | 'default';
42
43
  isSquared?: boolean;
43
44
  containerStyles?: React.CSSProperties;
45
+ gap?: number;
46
+ /** Overrides the background of the leading/trailing number badge on the selected tab. */
47
+ selectedNumberBackground?: string;
44
48
  'data-test'?: string;
45
49
  }
46
50
  export interface TabItemComponentProps {
47
51
  hasEqualSpacing?: boolean;
52
+ uniformBorder?: boolean;
48
53
  tab: TabInterface;
49
54
  currentTab: string;
50
55
  setCurrentTab: (tabKey: string) => void;
@@ -60,4 +65,6 @@ export interface TabItemComponentProps {
60
65
  isLastElement?: boolean;
61
66
  'data-test'?: string;
62
67
  iconPosition?: 'left' | 'right';
68
+ /** Overrides the background of the leading/trailing number badge on the selected tab. */
69
+ selectedNumberBackground?: string;
63
70
  }
@@ -1,10 +1,12 @@
1
1
  import { TabItemProps, TabItemTextProps } from './Tabs.model';
2
2
  export declare const TabHeader: import('styled-components').StyledComponent<"div", any, {
3
3
  bgColor?: string | undefined;
4
+ tabGap?: number | undefined;
4
5
  }, never>;
5
6
  export declare const TabItem: import('styled-components').StyledComponent<"div", any, TabItemProps, never>;
6
7
  export declare const TrailingNumberContainer: import('styled-components').StyledComponent<"div", any, {
7
8
  selected: boolean;
9
+ selectedBackground?: string | undefined;
8
10
  }, never>;
9
11
  export declare const TabItemText: import('styled-components').StyledComponent<"div", any, {
10
12
  numberOfLines?: number | undefined;
@@ -1,11 +1,25 @@
1
1
  import t from "styled-components";
2
2
  import { DEFAULT_THEME as o } from "../../constants/Theme.js";
3
3
  import { ButtonLarge as r } from "../TypographyStyle.js";
4
- const n = t.div`
4
+ const c = t.div`
5
5
  display: flex;
6
6
  flex-direction: row;
7
7
  background-color: ${(e) => e.bgColor};
8
- `, l = t.div`
8
+ ${(e) => e.tabGap ? `
9
+ gap: ${e.tabGap}px;
10
+ position: relative;
11
+ &::after {
12
+ content: '';
13
+ position: absolute;
14
+ bottom: 0;
15
+ left: 0;
16
+ right: 0;
17
+ height: 1px;
18
+ background: ${o.colorsV2.background.inactive};
19
+ z-index: -1;
20
+ }
21
+ ` : ""}
22
+ `, a = t.div`
9
23
  display: flex;
10
24
  flex-direction: row;
11
25
  column-gap: 8px;
@@ -14,8 +28,8 @@ const n = t.div`
14
28
  align-items: center;
15
29
  justify-content: center;
16
30
  width: ${(e) => e.hasEqualSpacing ? "50%" : "auto"};
17
- border-bottom-color: ${(e) => e.isSquared ? "" : e.selected ? e.selectedTextColor : o.colorsV2.background.inactive};
18
- border-bottom-width: ${(e) => e.isSquared ? "" : e.selected ? "2px" : "1px"};
31
+ border-bottom-color: ${(e) => e.isSquared ? "" : e.selected ? e.selectedTextColor : e.uniformBorder ? "transparent" : o.colorsV2.background.inactive};
32
+ border-bottom-width: ${(e) => e.isSquared ? "" : e.selected || e.uniformBorder ? "2px" : "1px"};
19
33
  border-bottom-style: ${(e) => e.isSquared ? "" : "solid"};
20
34
  border: ${(e) => e.isSquared ? e.selected ? `1px solid ${e.selectedTextColor}` : `1px solid ${o.colorsV2.background.inactive}` : ""};
21
35
  flex-direction: row;
@@ -25,7 +39,7 @@ const n = t.div`
25
39
  background-color: rgba(0, 0, 0, 0.03);
26
40
  }
27
41
  background-color: ${(e) => e.isSquared && e.selected ? `${o.colorsV2.background.brandLight}` : ""};
28
- `, a = t.div`
42
+ `, l = t.div`
29
43
  display: flex;
30
44
  flex-direction: row;
31
45
  align-items: center;
@@ -33,7 +47,7 @@ const n = t.div`
33
47
  justify-content: center;
34
48
  min-width: 20px;
35
49
  height: 20px;
36
- background: ${(e) => e.selected ? o.colorsV2.background.inverseLight : o.colorsV2.content.secondary};
50
+ background: ${(e) => e.selected ? e.selectedBackground ?? o.colorsV2.background.inverseLight : o.colorsV2.content.secondary};
37
51
  color: ${o.colorsV2.content.primaryInverse};
38
52
  border-radius: 10px;
39
53
  `, s = t(r)`
@@ -49,9 +63,9 @@ const n = t.div`
49
63
  export {
50
64
  x as EmptyTab,
51
65
  b as RightComponent,
52
- n as TabHeader,
53
- l as TabItem,
66
+ c as TabHeader,
67
+ a as TabItem,
54
68
  s as TabItemText,
55
- a as TrailingNumberContainer
69
+ l as TrailingNumberContainer
56
70
  };
57
71
  //# sourceMappingURL=Tabs.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.styles.js","sources":["../../../../src/components/tabs/Tabs.styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { ButtonLarge } from '../TypographyStyle';\nimport { TabItemProps, TabItemTextProps } from './Tabs.model';\n\nexport const TabHeader = styled.div<{ bgColor?: string }>`\n\tdisplay: flex;\n\tflex-direction: row;\n\tbackground-color: ${(props) => props.bgColor};\n`;\n\nexport const TabItem = styled.div<TabItemProps>`\n\tdisplay: flex;\n\tflex-direction: row;\n\tcolumn-gap: 8px;\n\tpadding: ${(props) => (props.isSquared ? '8px 24px' : '14px 24px 12px 24px')};\n\tpadding-bottom: ${(props) =>\n\t\tprops.isSquared ? '' : props.selected ? '12px' : '13px'};\n\talign-items: center;\n\tjustify-content: center;\n\twidth: ${(props) => (props.hasEqualSpacing ? '50%' : 'auto')};\n\tborder-bottom-color: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? ''\n\t\t\t: props.selected\n\t\t\t? props.selectedTextColor\n\t\t\t: DEFAULT_THEME.colorsV2.background.inactive};\n\tborder-bottom-width: ${(props) =>\n\t\tprops.isSquared ? '' : props.selected ? '2px' : '1px'};\n\tborder-bottom-style: ${(props) => (props.isSquared ? '' : 'solid')};\n\tborder: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? props.selected\n\t\t\t\t? `1px solid ${props.selectedTextColor}`\n\t\t\t\t: `1px solid ${DEFAULT_THEME.colorsV2.background.inactive}`\n\t\t\t: ''};\n\tflex-direction: row;\n\tcursor: pointer;\n\tmin-width: ${(props) => (props.isSquared ? '120px' : '')};\n\t&:hover {\n\t\tbackground-color: rgba(0, 0, 0, 0.03);\n\t}\n\tbackground-color: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? props.selected\n\t\t\t\t? `${DEFAULT_THEME.colorsV2.background.brandLight}`\n\t\t\t\t: ''\n\t\t\t: ''};\n`;\n\nexport const TrailingNumberContainer = styled.div<{\n\tselected: boolean;\n}>`\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 6px;\n\tjustify-content: center;\n\tmin-width: 20px;\n\theight: 20px;\n\tbackground: ${(props) =>\n\t\tprops.selected\n\t\t\t? DEFAULT_THEME.colorsV2.background.inverseLight\n\t\t\t: DEFAULT_THEME.colorsV2.content.secondary};\n\tcolor: ${DEFAULT_THEME.colorsV2.content.primaryInverse};\n\tborder-radius: 10px;\n`;\n\nexport const TabItemText = styled(ButtonLarge)<TabItemTextProps>`\n\tcolor: ${(props) =>\n\t\tprops.selected ? props.selectedTextColor : props.textColor};\n`;\n\nexport const EmptyTab = styled.div`\n\tflex-grow: 1;\n\tborder-bottom: 1px solid ${DEFAULT_THEME.colorsV2.background.inactive};\n`;\n\nexport const RightComponent = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tborder-bottom: 1px solid ${DEFAULT_THEME.colorsV2.background.inactive};\n`;\n"],"names":["TabHeader","styled","props","TabItem","DEFAULT_THEME","TrailingNumberContainer","TabItemText","ButtonLarge","EmptyTab","RightComponent"],"mappings":";;;AAKO,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA,qBAGX,CAACC,MAAUA,EAAM,OAAO;AAAA,GAGhCC,IAAUF,EAAO;AAAA;AAAA;AAAA;AAAA,YAIlB,CAACC,MAAWA,EAAM,YAAY,aAAa,qBAAsB;AAAA,mBAC1D,CAACA,MAClBA,EAAM,YAAY,KAAKA,EAAM,WAAW,SAAS,MAAM;AAAA;AAAA;AAAA,UAG/C,CAACA,MAAWA,EAAM,kBAAkB,QAAQ,MAAO;AAAA,wBACrC,CAACA,MACvBA,EAAM,YACH,KACAA,EAAM,WACNA,EAAM,oBACNE,EAAc,SAAS,WAAW,QAAQ;AAAA,wBACvB,CAACF,MACvBA,EAAM,YAAY,KAAKA,EAAM,WAAW,QAAQ,KAAK;AAAA,wBAC/B,CAACA,MAAWA,EAAM,YAAY,KAAK,OAAQ;AAAA,WACxD,CAACA,MACVA,EAAM,YACHA,EAAM,WACL,aAAaA,EAAM,iBAAiB,KACpC,aAAaE,EAAc,SAAS,WAAW,QAAQ,KACxD,EAAE;AAAA;AAAA;AAAA,cAGO,CAACF,MAAWA,EAAM,YAAY,UAAU,EAAG;AAAA;AAAA;AAAA;AAAA,qBAIpC,CAACA,MACpBA,EAAM,aACHA,EAAM,WACL,GAAGE,EAAc,SAAS,WAAW,UAAU,KAEhD,EAAE;AAAA,GAGMC,IAA0BJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAU/B,CAACC,MACdA,EAAM,WACHE,EAAc,SAAS,WAAW,eAClCA,EAAc,SAAS,QAAQ,SAAS;AAAA,UACnCA,EAAc,SAAS,QAAQ,cAAc;AAAA;AAAA,GAI1CE,IAAcL,EAAOM,CAAW;AAAA,UACnC,CAACL,MACTA,EAAM,WAAWA,EAAM,oBAAoBA,EAAM,SAAS;AAAA,GAG/CM,IAAWP,EAAO;AAAA;AAAA,4BAEHG,EAAc,SAAS,WAAW,QAAQ;AAAA,GAGzDK,IAAiBR,EAAO;AAAA;AAAA;AAAA,4BAGTG,EAAc,SAAS,WAAW,QAAQ;AAAA;"}
1
+ {"version":3,"file":"Tabs.styles.js","sources":["../../../../src/components/tabs/Tabs.styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { DEFAULT_THEME } from '@src/constants/Theme';\nimport { ButtonLarge } from '../TypographyStyle';\nimport { TabItemProps, TabItemTextProps } from './Tabs.model';\n\nexport const TabHeader = styled.div<{ bgColor?: string; tabGap?: number }>`\n\tdisplay: flex;\n\tflex-direction: row;\n\tbackground-color: ${(props) => props.bgColor};\n\t${(props) =>\n\t\tprops.tabGap\n\t\t\t? `\n\t\tgap: ${props.tabGap}px;\n\t\tposition: relative;\n\t\t&::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tbottom: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\theight: 1px;\n\t\t\tbackground: ${DEFAULT_THEME.colorsV2.background.inactive};\n\t\t\tz-index: -1;\n\t\t}\n\t`\n\t\t\t: ''}\n`;\n\nexport const TabItem = styled.div<TabItemProps>`\n\tdisplay: flex;\n\tflex-direction: row;\n\tcolumn-gap: 8px;\n\tpadding: ${(props) => (props.isSquared ? '8px 24px' : '14px 24px 12px 24px')};\n\tpadding-bottom: ${(props) =>\n\t\tprops.isSquared ? '' : props.selected ? '12px' : '13px'};\n\talign-items: center;\n\tjustify-content: center;\n\twidth: ${(props) => (props.hasEqualSpacing ? '50%' : 'auto')};\n\tborder-bottom-color: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? ''\n\t\t\t: props.selected\n\t\t\t? props.selectedTextColor\n\t\t\t: props.uniformBorder\n\t\t\t? 'transparent'\n\t\t\t: DEFAULT_THEME.colorsV2.background.inactive};\n\tborder-bottom-width: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? ''\n\t\t\t: props.selected || props.uniformBorder\n\t\t\t? '2px'\n\t\t\t: '1px'};\n\tborder-bottom-style: ${(props) => (props.isSquared ? '' : 'solid')};\n\tborder: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? props.selected\n\t\t\t\t? `1px solid ${props.selectedTextColor}`\n\t\t\t\t: `1px solid ${DEFAULT_THEME.colorsV2.background.inactive}`\n\t\t\t: ''};\n\tflex-direction: row;\n\tcursor: pointer;\n\tmin-width: ${(props) => (props.isSquared ? '120px' : '')};\n\t&:hover {\n\t\tbackground-color: rgba(0, 0, 0, 0.03);\n\t}\n\tbackground-color: ${(props) =>\n\t\tprops.isSquared\n\t\t\t? props.selected\n\t\t\t\t? `${DEFAULT_THEME.colorsV2.background.brandLight}`\n\t\t\t\t: ''\n\t\t\t: ''};\n`;\n\nexport const TrailingNumberContainer = styled.div<{\n\tselected: boolean;\n\tselectedBackground?: string;\n}>`\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 6px;\n\tjustify-content: center;\n\tmin-width: 20px;\n\theight: 20px;\n\tbackground: ${(props) =>\n\t\tprops.selected\n\t\t\t? props.selectedBackground ??\n\t\t\t DEFAULT_THEME.colorsV2.background.inverseLight\n\t\t\t: DEFAULT_THEME.colorsV2.content.secondary};\n\tcolor: ${DEFAULT_THEME.colorsV2.content.primaryInverse};\n\tborder-radius: 10px;\n`;\n\nexport const TabItemText = styled(ButtonLarge)<TabItemTextProps>`\n\tcolor: ${(props) =>\n\t\tprops.selected ? props.selectedTextColor : props.textColor};\n`;\n\nexport const EmptyTab = styled.div`\n\tflex-grow: 1;\n\tborder-bottom: 1px solid ${DEFAULT_THEME.colorsV2.background.inactive};\n`;\n\nexport const RightComponent = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tborder-bottom: 1px solid ${DEFAULT_THEME.colorsV2.background.inactive};\n`;\n"],"names":["TabHeader","styled","props","DEFAULT_THEME","TabItem","TrailingNumberContainer","TabItemText","ButtonLarge","EmptyTab","RightComponent"],"mappings":";;;AAKO,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA,qBAGX,CAACC,MAAUA,EAAM,OAAO;AAAA,GAC1C,CAACA,MACFA,EAAM,SACH;AAAA,SACIA,EAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBASJC,EAAc,SAAS,WAAW,QAAQ;AAAA;AAAA;AAAA,KAItD,EAAE;AAAA,GAGMC,IAAUH,EAAO;AAAA;AAAA;AAAA;AAAA,YAIlB,CAACC,MAAWA,EAAM,YAAY,aAAa,qBAAsB;AAAA,mBAC1D,CAACA,MAClBA,EAAM,YAAY,KAAKA,EAAM,WAAW,SAAS,MAAM;AAAA;AAAA;AAAA,UAG/C,CAACA,MAAWA,EAAM,kBAAkB,QAAQ,MAAO;AAAA,wBACrC,CAACA,MACvBA,EAAM,YACH,KACAA,EAAM,WACNA,EAAM,oBACNA,EAAM,gBACN,gBACAC,EAAc,SAAS,WAAW,QAAQ;AAAA,wBACvB,CAACD,MACvBA,EAAM,YACH,KACAA,EAAM,YAAYA,EAAM,gBACxB,QACA,KAAK;AAAA,wBACc,CAACA,MAAWA,EAAM,YAAY,KAAK,OAAQ;AAAA,WACxD,CAACA,MACVA,EAAM,YACHA,EAAM,WACL,aAAaA,EAAM,iBAAiB,KACpC,aAAaC,EAAc,SAAS,WAAW,QAAQ,KACxD,EAAE;AAAA;AAAA;AAAA,cAGO,CAACD,MAAWA,EAAM,YAAY,UAAU,EAAG;AAAA;AAAA;AAAA;AAAA,qBAIpC,CAACA,MACpBA,EAAM,aACHA,EAAM,WACL,GAAGC,EAAc,SAAS,WAAW,UAAU,KAEhD,EAAE;AAAA,GAGME,IAA0BJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAW/B,CAACC,MACdA,EAAM,WACHA,EAAM,sBACNC,EAAc,SAAS,WAAW,eAClCA,EAAc,SAAS,QAAQ,SAAS;AAAA,UACnCA,EAAc,SAAS,QAAQ,cAAc;AAAA;AAAA,GAI1CG,IAAcL,EAAOM,CAAW;AAAA,UACnC,CAACL,MACTA,EAAM,WAAWA,EAAM,oBAAoBA,EAAM,SAAS;AAAA,GAG/CM,IAAWP,EAAO;AAAA;AAAA,4BAEHE,EAAc,SAAS,WAAW,QAAQ;AAAA,GAGzDM,IAAiBR,EAAO;AAAA;AAAA;AAAA,4BAGTE,EAAc,SAAS,WAAW,QAAQ;AAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CharacterLimitExtension.js","sources":["../../../../../src/editor/extensions/characterLimit/CharacterLimitExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { Decoration, DecorationSet } from '@tiptap/pm/view';\nimport type { Node as PMNode } from '@tiptap/pm/model';\n\nexport interface CharacterLimitOptions {\n\t/** Soft character limit. 0 / undefined disables the extension entirely. */\n\tlimit: number;\n}\n\n/**\n * Soft character limit with two behaviours (see CRM design):\n *\n * 1. Typing is BLOCKED once the content is at/over the limit — `handleTextInput`\n * rejects the insertion. This never fires for paste (paste flows through the\n * clipboard pipeline), so paste is free to push the content over the limit.\n * 2. Every character BEYOND the limit is decorated with `bik-editor-overflow`\n * (rendered grey) so pasted overflow is visible but clearly marked.\n *\n * Counting mirrors `extractContent` exactly — `doc.textBetween(0, size, '\\n\\n',\n * '\\n')` — so the grey boundary lines up with the `characterCount` the consumer\n * shows in its error message (paragraph break = 2 chars, soft break = 1 char).\n */\nexport const CharacterLimitExtension = Extension.create<CharacterLimitOptions>({\n\tname: 'characterLimitOverflow',\n\n\taddOptions() {\n\t\treturn { limit: 0 };\n\t},\n\n\taddProseMirrorPlugins() {\n\t\tconst limit = this.options.limit;\n\t\tif (!limit || limit <= 0) return [];\n\n\t\t// Same metric as BikEditor.utils.extractContent → keeps the grey boundary\n\t\t// and the consumer's characterCount in sync.\n\t\tconst countChars = (doc: PMNode) =>\n\t\t\tdoc.textBetween(0, doc.content.size, '\\n\\n', '\\n').length;\n\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tkey: new PluginKey('characterLimitOverflow'),\n\t\t\t\tprops: {\n\t\t\t\t\t// Block typed/composed input that would exceed the limit. Replacing\n\t\t\t\t\t// a selection is allowed as long as the result still fits.\n\t\t\t\t\thandleTextInput(view, from, to, text) {\n\t\t\t\t\t\tconst doc = view.state.doc;\n\t\t\t\t\t\tconst current = countChars(doc);\n\t\t\t\t\t\tconst removed = doc.textBetween(from, to, '\\n\\n', '\\n').length;\n\t\t\t\t\t\treturn current - removed + text.length > limit;\n\t\t\t\t\t},\n\t\t\t\t\tdecorations(state) {\n\t\t\t\t\t\tconst decorations: Decoration[] = [];\n\t\t\t\t\t\tlet count = 0;\n\t\t\t\t\t\tlet overflowing = false;\n\n\t\t\t\t\t\tstate.doc.descendants((node, pos, parent, index) => {\n\t\t\t\t\t\t\t// Account for the \"\\n\\n\" separator inserted between top-level\n\t\t\t\t\t\t\t// blocks so the boundary matches textBetween's counting.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!overflowing &&\n\t\t\t\t\t\t\t\tparent &&\n\t\t\t\t\t\t\t\tparent.type.name === 'doc' &&\n\t\t\t\t\t\t\t\tindex > 0\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcount += 2;\n\t\t\t\t\t\t\t\tif (count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (node.isText && node.text) {\n\t\t\t\t\t\t\t\tconst len = node.text.length;\n\t\t\t\t\t\t\t\tif (overflowing) {\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else if (count + len > limit) {\n\t\t\t\t\t\t\t\t\tconst startOffset = Math.max(0, limit - count);\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos + startOffset, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\toverflowing = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcount += len;\n\t\t\t\t\t\t\t} else if (node.type.name === 'hardBreak') {\n\t\t\t\t\t\t\t\t// Soft line break → \"\\n\" (1 char) in textBetween.\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\tif (!overflowing && count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn DecorationSet.create(state.doc, decorations);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["CharacterLimitExtension","Extension","limit","countChars","doc","Plugin","PluginKey","view","from","to","text","current","removed","state","decorations","count","overflowing","node","pos","parent","index","len","Decoration","startOffset","DecorationSet"],"mappings":";;;AAuBO,MAAMA,IAA0BC,EAAU,OAA8B;AAAA,EAC9E,MAAM;AAAA,EAEN,aAAa;AACZ,WAAO,EAAE,OAAO,EAAA;AAAA,EACjB;AAAA,EAEA,wBAAwB;AACvB,UAAMC,IAAQ,KAAK,QAAQ;AAC3B,QAAI,CAACA,KAASA,KAAS,UAAU,CAAA;AAIjC,UAAMC,IAAa,CAACC,MACnBA,EAAI,YAAY,GAAGA,EAAI,QAAQ,MAAM;AAAA;AAAA,GAAQ;AAAA,CAAI,EAAE;AAEpD,WAAO;AAAA,MACN,IAAIC,EAAO;AAAA,QACV,KAAK,IAAIC,EAAU,wBAAwB;AAAA,QAC3C,OAAO;AAAA;AAAA;AAAA,UAGN,gBAAgBC,GAAMC,GAAMC,GAAIC,GAAM;AACrC,kBAAMN,IAAMG,EAAK,MAAM,KACjBI,IAAUR,EAAWC,CAAG,GACxBQ,IAAUR,EAAI,YAAYI,GAAMC,GAAI;AAAA;AAAA,GAAQ;AAAA,CAAI,EAAE;AACxD,mBAAOE,IAAUC,IAAUF,EAAK,SAASR;AAAA,UAC1C;AAAA,UACA,YAAYW,GAAO;AAClB,kBAAMC,IAA4B,CAAA;AAClC,gBAAIC,IAAQ,GACRC,IAAc;AAElB,mBAAAH,EAAM,IAAI,YAAY,CAACI,GAAMC,GAAKC,GAAQC,MAAU;AAanD,kBATC,CAACJ,KACDG,KACAA,EAAO,KAAK,SAAS,SACrBC,IAAQ,MAERL,KAAS,GACLA,IAAQb,MAAOc,IAAc,MAG9BC,EAAK,UAAUA,EAAK,MAAM;AAC7B,sBAAMI,IAAMJ,EAAK,KAAK;AACtB,oBAAID;AACH,kBAAAF,EAAY;AAAA,oBACXQ,EAAW,OAAOJ,GAAKA,IAAMG,GAAK;AAAA,sBACjC,OAAO;AAAA,oBAAA,CACP;AAAA,kBAAA;AAAA,yBAEQN,IAAQM,IAAMnB,GAAO;AAC/B,wBAAMqB,IAAc,KAAK,IAAI,GAAGrB,IAAQa,CAAK;AAC7C,kBAAAD,EAAY;AAAA,oBACXQ,EAAW,OAAOJ,IAAMK,GAAaL,IAAMG,GAAK;AAAA,sBAC/C,OAAO;AAAA,oBAAA,CACP;AAAA,kBAAA,GAEFL,IAAc;AAAA,gBACf;AACA,gBAAAD,KAASM;AAAA,cACV,MAAA,CAAWJ,EAAK,KAAK,SAAS,gBAE7BF,KAAS,GACL,CAACC,KAAeD,IAAQb,MAAOc,IAAc;AAElD,qBAAO;AAAA,YACR,CAAC,GAEMQ,EAAc,OAAOX,EAAM,KAAKC,CAAW;AAAA,UACnD;AAAA,QAAA;AAAA,MACD,CACA;AAAA,IAAA;AAAA,EAEH;AACD,CAAC;"}
1
+ {"version":3,"file":"CharacterLimitExtension.js","sources":["../../../../../src/editor/extensions/characterLimit/CharacterLimitExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport type { Node as PMNode } from '@tiptap/pm/model';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { Decoration, DecorationSet } from '@tiptap/pm/view';\n\nexport interface CharacterLimitOptions {\n\t/** Soft character limit. 0 / undefined disables the extension entirely. */\n\tlimit: number;\n}\n\n/**\n * Soft character limit with two behaviours (see CRM design):\n *\n * 1. Typing is BLOCKED once the content is at/over the limit — `handleTextInput`\n * rejects the insertion. This never fires for paste (paste flows through the\n * clipboard pipeline), so paste is free to push the content over the limit.\n * 2. Every character BEYOND the limit is decorated with `bik-editor-overflow`\n * (rendered grey) so pasted overflow is visible but clearly marked.\n *\n * Counting mirrors `extractContent` exactly — `doc.textBetween(0, size, '\\n\\n',\n * '\\n')` — so the grey boundary lines up with the `characterCount` the consumer\n * shows in its error message (paragraph break = 2 chars, soft break = 1 char).\n */\nexport const CharacterLimitExtension = Extension.create<CharacterLimitOptions>({\n\tname: 'characterLimitOverflow',\n\n\taddOptions() {\n\t\treturn { limit: 0 };\n\t},\n\n\taddProseMirrorPlugins() {\n\t\tconst limit = this.options.limit;\n\t\tif (!limit || limit <= 0) return [];\n\n\t\t// Same metric as BikEditor.utils.extractContent → keeps the grey boundary\n\t\t// and the consumer's characterCount in sync.\n\t\tconst countChars = (doc: PMNode) =>\n\t\t\tdoc.textBetween(0, doc.content.size, '\\n\\n', '\\n').length;\n\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tkey: new PluginKey('characterLimitOverflow'),\n\t\t\t\tprops: {\n\t\t\t\t\t// Block typed/composed input that would exceed the limit. Replacing\n\t\t\t\t\t// a selection is allowed as long as the result still fits.\n\t\t\t\t\thandleTextInput(view, from, to, text) {\n\t\t\t\t\t\tconst doc = view.state.doc;\n\t\t\t\t\t\tconst current = countChars(doc);\n\t\t\t\t\t\tconst removed = doc.textBetween(from, to, '\\n\\n', '\\n').length;\n\t\t\t\t\t\treturn current - removed + text.length > limit;\n\t\t\t\t\t},\n\t\t\t\t\tdecorations(state) {\n\t\t\t\t\t\tconst decorations: Decoration[] = [];\n\t\t\t\t\t\tlet count = 0;\n\t\t\t\t\t\tlet overflowing = false;\n\n\t\t\t\t\t\tstate.doc.descendants((node, pos, parent, index) => {\n\t\t\t\t\t\t\t// Account for the \"\\n\\n\" separator inserted between top-level\n\t\t\t\t\t\t\t// blocks so the boundary matches textBetween's counting.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!overflowing &&\n\t\t\t\t\t\t\t\tparent &&\n\t\t\t\t\t\t\t\tparent.type.name === 'doc' &&\n\t\t\t\t\t\t\t\tindex > 0\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcount += 2;\n\t\t\t\t\t\t\t\tif (count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (node.isText && node.text) {\n\t\t\t\t\t\t\t\tconst len = node.text.length;\n\t\t\t\t\t\t\t\tif (overflowing) {\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else if (count + len > limit) {\n\t\t\t\t\t\t\t\t\tconst startOffset = Math.max(0, limit - count);\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos + startOffset, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\toverflowing = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcount += len;\n\t\t\t\t\t\t\t} else if (node.type.name === 'hardBreak') {\n\t\t\t\t\t\t\t\t// Soft line break → \"\\n\" (1 char) in textBetween.\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\tif (!overflowing && count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn DecorationSet.create(state.doc, decorations);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["CharacterLimitExtension","Extension","limit","countChars","doc","Plugin","PluginKey","view","from","to","text","current","removed","state","decorations","count","overflowing","node","pos","parent","index","len","Decoration","startOffset","DecorationSet"],"mappings":";;;AAuBO,MAAMA,IA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