@bikdotai/bik-component-library 0.0.836-beta.3 → 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 (170) hide show
  1. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  2. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  3. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  4. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +23 -41
  5. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  6. package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js +1 -1
  7. package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
  8. package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js +1 -1
  9. package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
  10. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
  11. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  12. package/dist/cjs/components/agent-builder/components/DiscardModal.js +1 -1
  13. package/dist/cjs/components/agent-builder/components/DiscardModal.js.map +1 -1
  14. package/dist/cjs/components/agent-builder/components/GoLiveModal.js +1 -1
  15. package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
  16. package/dist/cjs/components/agent-builder/components/MentionPicker.js +2 -2
  17. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  18. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +1 -1
  19. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  20. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +6 -6
  21. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  22. package/dist/cjs/components/agent-builder/components/StepSectionHeader.js +1 -1
  23. package/dist/cjs/components/agent-builder/components/StepSectionHeader.js.map +1 -1
  24. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  25. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  26. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +1 -3
  27. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  28. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  29. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  30. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
  31. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  32. package/dist/cjs/components/agent-listing/AgentListing.js +1 -1
  33. package/dist/cjs/components/agent-listing/AgentListing.js.map +1 -1
  34. package/dist/cjs/components/agent-listing/AgentTable.js +1 -1
  35. package/dist/cjs/components/agent-listing/AgentTable.js.map +1 -1
  36. package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
  37. package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
  38. package/dist/cjs/components/button/Button.styled.js +7 -3
  39. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  40. package/dist/cjs/components/button/themes.js +3 -3
  41. package/dist/cjs/components/button/themes.js.map +1 -1
  42. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  43. package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
  44. package/dist/cjs/components/checkBox/CheckBox.styled.js +7 -10
  45. package/dist/cjs/components/checkBox/CheckBox.styled.js.map +1 -1
  46. package/dist/cjs/components/dropdown/ChipInput.js +1 -1
  47. package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
  48. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  49. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  50. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  51. package/dist/cjs/components/input/Input.js +1 -1
  52. package/dist/cjs/components/input/Input.js.map +1 -1
  53. package/dist/cjs/components/input/Input.styled.js +25 -12
  54. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  55. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  56. package/dist/cjs/components/product-picker-v2/collectionScreen.js.map +1 -1
  57. package/dist/cjs/components/product-picker-v2/product.js +1 -1
  58. package/dist/cjs/components/product-picker-v2/product.js.map +1 -1
  59. package/dist/cjs/components/tabs/Tabs.js +1 -1
  60. package/dist/cjs/components/tabs/Tabs.js.map +1 -1
  61. package/dist/cjs/components/tabs/Tabs.styles.js +22 -8
  62. package/dist/cjs/components/tabs/Tabs.styles.js.map +1 -1
  63. package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
  64. package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
  65. package/dist/cjs/components/whats-new/WhatsNewButton.js +2 -2
  66. package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
  67. package/dist/cjs/editor/BikEditor.js +1 -1
  68. package/dist/cjs/editor/BikEditor.js.map +1 -1
  69. package/dist/cjs/editor/BikEditor.styles.js +42 -74
  70. package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
  71. package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  72. package/dist/cjs/utils/rgba.js +2 -0
  73. package/dist/cjs/utils/rgba.js.map +1 -0
  74. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  75. package/dist/esm/components/agent-builder/AgentBuilder.js +77 -80
  76. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  77. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +0 -3
  78. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +84 -106
  79. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  80. package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js +21 -29
  81. package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
  82. package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js +21 -21
  83. package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
  84. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +23 -24
  85. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  86. package/dist/esm/components/agent-builder/components/DiscardModal.js +8 -15
  87. package/dist/esm/components/agent-builder/components/DiscardModal.js.map +1 -1
  88. package/dist/esm/components/agent-builder/components/GoLiveModal.js +11 -11
  89. package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
  90. package/dist/esm/components/agent-builder/components/MentionPicker.js +40 -41
  91. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  92. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +21 -22
  93. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  94. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +4 -13
  95. package/dist/esm/components/agent-builder/components/SelectableListSection.js +144 -167
  96. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  97. package/dist/esm/components/agent-builder/components/StepSectionHeader.js +7 -7
  98. package/dist/esm/components/agent-builder/components/StepSectionHeader.js.map +1 -1
  99. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +103 -104
  100. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  101. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +82 -84
  102. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  103. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +19 -20
  104. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  105. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +79 -23
  106. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  107. package/dist/esm/components/agent-listing/AgentListing.js +65 -70
  108. package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
  109. package/dist/esm/components/agent-listing/AgentTable.d.ts +0 -2
  110. package/dist/esm/components/agent-listing/AgentTable.js +15 -16
  111. package/dist/esm/components/agent-listing/AgentTable.js.map +1 -1
  112. package/dist/esm/components/agent-listing/AgentTableRow.js +7 -7
  113. package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
  114. package/dist/esm/components/button/Button.styled.js +24 -25
  115. package/dist/esm/components/button/Button.styled.js.map +1 -1
  116. package/dist/esm/components/button/themes.d.ts +1 -1
  117. package/dist/esm/components/button/themes.js +1 -1
  118. package/dist/esm/components/button/themes.js.map +1 -1
  119. package/dist/esm/components/checkBox/CheckBox.d.ts +2 -0
  120. package/dist/esm/components/checkBox/CheckBox.js +66 -55
  121. package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
  122. package/dist/esm/components/checkBox/CheckBox.styled.d.ts +1 -0
  123. package/dist/esm/components/checkBox/CheckBox.styled.js +9 -11
  124. package/dist/esm/components/checkBox/CheckBox.styled.js.map +1 -1
  125. package/dist/esm/components/dropdown/ChipInput.d.ts +1 -0
  126. package/dist/esm/components/dropdown/ChipInput.js +37 -30
  127. package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
  128. package/dist/esm/components/dropdown/Dropdown.d.ts +2 -0
  129. package/dist/esm/components/dropdown/Dropdown.js +95 -93
  130. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  131. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  132. package/dist/esm/components/input/Input.js +104 -101
  133. package/dist/esm/components/input/Input.js.map +1 -1
  134. package/dist/esm/components/input/Input.model.d.ts +2 -0
  135. package/dist/esm/components/input/Input.styled.d.ts +2 -0
  136. package/dist/esm/components/input/Input.styled.js +38 -25
  137. package/dist/esm/components/input/Input.styled.js.map +1 -1
  138. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -0
  139. package/dist/esm/components/product-picker-v2/collectionScreen.js.map +1 -1
  140. package/dist/esm/components/product-picker-v2/product.js +47 -46
  141. package/dist/esm/components/product-picker-v2/product.js.map +1 -1
  142. package/dist/esm/components/tabs/Tabs.js +93 -73
  143. package/dist/esm/components/tabs/Tabs.js.map +1 -1
  144. package/dist/esm/components/tabs/Tabs.model.d.ts +7 -0
  145. package/dist/esm/components/tabs/Tabs.styles.d.ts +2 -0
  146. package/dist/esm/components/tabs/Tabs.styles.js +23 -9
  147. package/dist/esm/components/tabs/Tabs.styles.js.map +1 -1
  148. package/dist/esm/components/whats-new/WhatsNew.d.ts +1 -0
  149. package/dist/esm/components/whats-new/WhatsNew.js +19 -17
  150. package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
  151. package/dist/esm/components/whats-new/WhatsNew.types.d.ts +1 -0
  152. package/dist/esm/components/whats-new/WhatsNewButton.js +40 -32
  153. package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
  154. package/dist/esm/editor/BikEditor.js +160 -173
  155. package/dist/esm/editor/BikEditor.js.map +1 -1
  156. package/dist/esm/editor/BikEditor.styles.d.ts +3 -20
  157. package/dist/esm/editor/BikEditor.styles.js +44 -78
  158. package/dist/esm/editor/BikEditor.styles.js.map +1 -1
  159. package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -1
  160. package/dist/esm/icons/index.d.ts +25 -25
  161. package/dist/esm/utils/rgba.js +10 -0
  162. package/dist/esm/utils/rgba.js.map +1 -0
  163. package/package.json +4 -2
  164. package/dist/cjs/components/agent-listing/AgentTableShimmer.js +0 -2
  165. package/dist/cjs/components/agent-listing/AgentTableShimmer.js.map +0 -1
  166. package/dist/esm/components/agent-builder/__fixtures__/agentValue.d.ts +0 -11
  167. package/dist/esm/components/agent-listing/AgentTableShimmer.d.ts +0 -12
  168. package/dist/esm/components/agent-listing/AgentTableShimmer.js +0 -20
  169. package/dist/esm/components/agent-listing/AgentTableShimmer.js.map +0 -1
  170. package/dist/esm/components/agent-listing/__fixtures__/agents.d.ts +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"CheckBox.js","sources":["../../../../src/components/checkBox/CheckBox.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport {\n\tCheckboxContainer,\n\tCheckboxIcon,\n} from '@src/components/checkBox/CheckBox.styled';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n\tTitleRegular,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type CheckBoxProps = {\n\tisChecked: boolean;\n\tisPartiallyChecked?: boolean;\n\tisDisabled?: boolean;\n\tvalue?: string;\n\tonValueChange: (\n\t\tchecked: boolean,\n\t\tvalue?: string,\n\t\tevent?: React.MouseEvent,\n\t) => void;\n\tlabel?: string;\n\tsize?: 'DEFAULT' | 'SMALL' | 'XS';\n\tskipHoverState?: boolean;\n\tlabelSize?: 'DEFAULT' | 'SMALL';\n\trightComponent?: JSX.Element;\n\tcheckboxBorderColor?: string;\n\tboldOnChecked?: boolean;\n\tbold?: boolean;\n\tstyle?: React.CSSProperties;\n\tenableHover?: boolean;\n\tactiveColor?: string;\n\tlabelTypography?:\n\t\t| 'bodyCaption'\n\t\t| 'bodySecondary'\n\t\t| 'bodyPrimary'\n\t\t| 'titleSmall';\n};\n\nconst CheckMark: React.FC<{\n\tisPartial: boolean;\n\tisDisabled: boolean;\n\tsize?: 'DEFAULT' | 'SMALL' | 'XS';\n\tactiveColor?: string;\n}> = (props) => {\n\tconst fillColor = useMemo(\n\t\t() => props.activeColor || COLORS.background.positive.vibrant,\n\t\t[props.activeColor],\n\t);\n\n\t// Box (and inner check) dimensions per size — XS renders a 12x12 mark.\n\tconst dims =\n\t\tprops.size === 'XS'\n\t\t\t? {\n\t\t\t\t\tbox: 12,\n\t\t\t\t\tcheck: { w: 6, h: 5, x: 3, y: 3.5 },\n\t\t\t\t\tpartial: { x: 3, y: 5, w: 6 },\n\t\t\t }\n\t\t\t: props.size === 'SMALL'\n\t\t\t? {\n\t\t\t\t\tbox: 16,\n\t\t\t\t\tcheck: { w: 8, h: 7, x: 4, y: 4 },\n\t\t\t\t\tpartial: { x: 5, y: 7, w: 6 },\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tbox: 18,\n\t\t\t\t\tcheck: { w: 10, h: 9, x: 4, y: 4 },\n\t\t\t\t\tpartial: { x: 5, y: 8, w: 8 },\n\t\t\t };\n\n\treturn (\n\t\t<svg\n\t\t\twidth={dims.box}\n\t\t\theight={dims.box}\n\t\t\tviewBox={`0 0 ${dims.box} ${dims.box}`}\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<rect\n\t\t\t\tx=\"0\"\n\t\t\t\ty=\"0\"\n\t\t\t\twidth={dims.box}\n\t\t\t\theight={dims.box}\n\t\t\t\trx=\"4\"\n\t\t\t\tfill={props.isDisabled ? COLORS.content.inactive : fillColor}\n\t\t\t/>\n\t\t\t{!props.isPartial && (\n\t\t\t\t<svg\n\t\t\t\t\twidth={dims.check.w}\n\t\t\t\t\theight={dims.check.h}\n\t\t\t\t\tx={dims.check.x}\n\t\t\t\t\ty={dims.check.y}\n\t\t\t\t\tviewBox=\"0 0 10 9\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\t\t\td=\"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z\"\n\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t)}\n\t\t\t{props.isPartial && (\n\t\t\t\t<rect\n\t\t\t\t\tx={dims.partial.x}\n\t\t\t\t\ty={dims.partial.y}\n\t\t\t\t\twidth={dims.partial.w}\n\t\t\t\t\theight=\"2\"\n\t\t\t\t\trx=\"1\"\n\t\t\t\t\tfill={COLORS.surface.standard}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</svg>\n\t);\n};\n\nexport const CheckBox: React.FC<CheckBoxProps> = (props) => {\n\tconst [isChecked, setIsChecked] = useState(props.isChecked || false);\n\tconst [isPartiallyChecked, setIsPartiallyChecked] = useState(\n\t\tprops.isPartiallyChecked || false,\n\t);\n\tconst [isDisabled, setIsDisabled] = useState(props.isDisabled || false);\n\tconst [isHovered, setIsHovered] = useState(false);\n\tconst [isClicked, setIsClicked] = useState(false);\n\n\tconst handleCheck = (event: React.MouseEvent) => {\n\t\tif (!props.isDisabled) {\n\t\t\tconst newVal = !isChecked;\n\t\t\tif (isPartiallyChecked) {\n\t\t\t\tsetIsPartiallyChecked(!isPartiallyChecked);\n\t\t\t} else {\n\t\t\t\tsetIsChecked(newVal);\n\t\t\t}\n\t\t\tprops.onValueChange?.(newVal, props.value, event);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tsetIsChecked(props.isChecked);\n\t}, [props.isChecked]);\n\n\tuseEffect(() => {\n\t\tsetIsDisabled(props.isDisabled || false);\n\t}, [props.isDisabled]);\n\n\tuseEffect(() => {\n\t\tsetIsPartiallyChecked(props.isPartiallyChecked || false);\n\t}, [props.isPartiallyChecked]);\n\n\tconst renderLabel = () => {\n\t\tif (!props.label) {\n\t\t\treturn <></>;\n\t\t}\n\n\t\tif (props.labelTypography) {\n\t\t\tconst LabelTypography = {\n\t\t\t\tbodyCaption: BodyCaption,\n\t\t\t\tbodySecondary: BodySecondary,\n\t\t\t\tbodyPrimary: BodyPrimary,\n\t\t\t\ttitleSmall: TitleSmall,\n\t\t\t}[props.labelTypography];\n\t\t\treturn (\n\t\t\t\t<LabelTypography\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</LabelTypography>\n\t\t\t);\n\t\t}\n\n\t\tif (props.size === 'XS') {\n\t\t\treturn (\n\t\t\t\t<BodyCaption\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodyCaption>\n\t\t\t);\n\t\t}\n\n\t\tif ((props.boldOnChecked && isChecked) || props.bold) {\n\t\t\tif (props.labelSize === 'DEFAULT') {\n\t\t\t\treturn (\n\t\t\t\t\t<TitleRegular\n\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\tprops.isDisabled ? COLORS.text.disabled : COLORS.text.primary\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</TitleRegular>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<TitleSmall\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</TitleSmall>\n\t\t\t);\n\t\t}\n\n\t\tif (props.size === 'SMALL') {\n\t\t\treturn (\n\t\t\t\t<BodySecondary\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodySecondary>\n\t\t\t);\n\t\t}\n\n\t\tif (props.labelSize === 'SMALL') {\n\t\t\treturn (\n\t\t\t\t<BodySecondary\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodySecondary>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BodyPrimary\n\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t>\n\t\t\t\t{props.label}\n\t\t\t</BodyPrimary>\n\t\t);\n\t};\n\n\treturn (\n\t\t<CheckboxContainer\n\t\t\tonClick={handleCheck}\n\t\t\tonMouseEnter={() => setIsHovered(!props.skipHoverState)}\n\t\t\tonMouseLeave={() => setIsHovered(false)}\n\t\t\tonMouseDown={() => setIsClicked(!props.skipHoverState)}\n\t\t\tonMouseUp={() => setIsClicked(false)}\n\t\t\tisDisabled={isDisabled}\n\t\t\tenableHover={props.enableHover}\n\t\t\tstyle={props.style ?? {}}\n\t\t>\n\t\t\t<CheckboxIcon\n\t\t\t\tchecked={isChecked}\n\t\t\t\thovered={isHovered}\n\t\t\t\tclicked={isClicked}\n\t\t\t\tisDisabled={isDisabled}\n\t\t\t\tsize={props.size}\n\t\t\t\tborderColor={props.checkboxBorderColor}\n\t\t\t>\n\t\t\t\t{isChecked && (\n\t\t\t\t\t<CheckMark\n\t\t\t\t\t\tisPartial={isPartiallyChecked || false}\n\t\t\t\t\t\tisDisabled={isDisabled}\n\t\t\t\t\t\tsize={props.size}\n\t\t\t\t\t\tactiveColor={props?.activeColor}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</CheckboxIcon>\n\t\t\t{renderLabel()}\n\t\t\t{props.rightComponent}\n\t\t</CheckboxContainer>\n\t);\n};\n"],"names":["CheckMark","props","fillColor","useMemo","COLORS","dims","jsxs","jsx","CheckBox","isChecked","setIsChecked","useState","isPartiallyChecked","setIsPartiallyChecked","isDisabled","setIsDisabled","isHovered","setIsHovered","isClicked","setIsClicked","handleCheck","event","newVal","useEffect","renderLabel","Fragment","LabelTypography","BodyCaption","BodySecondary","BodyPrimary","TitleSmall","TitleRegular","CheckboxContainer","CheckboxIcon"],"mappings":";;;;;AA0CA,MAAMA,IAKD,CAACC,MAAU;AACf,QAAMC,IAAYC;AAAA,IACjB,MAAMF,EAAM,eAAeG,EAAO,WAAW,SAAS;AAAA,IACtD,CAACH,EAAM,WAAW;AAAA,EAAA,GAIbI,IAC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AA,MAAA;AAAA,QACA,OAAO3B,EAAM,aAAaG,EAAO,KAAK,WAAWA,EAAO,KAAK;AAAA,QAE5D,UAAAH,EAAM;AAAA,MAAA;AAAA,IAAA,IAMT,gBAAAM;AAAA,MAACsB;AAAA,MAAA;AAAA,QACA,OAAO5B,EAAM,aAAaG,EAAO,KAAK,WAAWA,EAAO,KAAK;AAAA,QAE5D,UAAAH,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AAEA,SACC,gBAAAK;AAAA,IAAC0B;AAAA,IAAA;AAAA,MACA,SAASZ;AAAA,MACT,cAAc,MAAMH,EAAa,CAAChB,EAAM,cAAc;AAAA,MACtD,cAAc,MAAMgB,EAAa,EAAK;AAAA,MACtC,aAAa,MAAME,EAAa,CAAClB,EAAM,cAAc;AAAA,MACrD,WAAW,MAAMkB,EAAa,EAAK;AAAA,MACnC,YAAAL;AAAA,MACA,aAAab,EAAM;AAAA,MACnB,OAAOA,EAAM,SAAS,CAAA;AAAA,MAEtB,UAAA;AAAA,QAAA,gBAAAM;AAAA,UAAC0B;AAAA,UAAA;AAAA,YACA,SAASxB;AAAA,YACT,SAASO;AAAA,YACT,SAASE;AAAA,YACT,YAAAJ;AAAA,YACA,MAAMb,EAAM;AAAA,YACZ,aAAaA,EAAM;AAAA,YAElB,UAAAQ,KACA,gBAAAF;AAAA,cAACP;AAAA,cAAA;AAAA,gBACA,WAAWY,KAAsB;AAAA,gBACjC,YAAAE;AAAA,gBACA,MAAMb,EAAM;AAAA,gBACZ,aAAaA,GAAO;AAAA,cAAA;AAAA,YAAA;AAAA,UACrB;AAAA,QAAA;AAAA,QAGDuB,EAAA;AAAA,QACAvB,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"CheckBox.js","sources":["../../../../src/components/checkBox/CheckBox.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport {\n\tCheckboxContainer,\n\tCheckboxIcon,\n} from '@src/components/checkBox/CheckBox.styled';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n\tTitleRegular,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type CheckBoxProps = {\n\tisChecked: boolean;\n\tisPartiallyChecked?: boolean;\n\tisDisabled?: boolean;\n\tvalue?: string;\n\tonValueChange: (\n\t\tchecked: boolean,\n\t\tvalue?: string,\n\t\tevent?: React.MouseEvent,\n\t) => void;\n\tlabel?: string;\n\tsize?: 'DEFAULT' | 'SMALL' | 'XS';\n\tskipHoverState?: boolean;\n\tlabelSize?: 'DEFAULT' | 'SMALL';\n\trightComponent?: JSX.Element;\n\tcheckboxBorderColor?: string;\n\tboldOnChecked?: boolean;\n\tbold?: boolean;\n\tstyle?: React.CSSProperties;\n\tenableHover?: boolean;\n\tactiveColor?: string;\n\t/** Accessible name when no visible label is rendered (e.g. product-picker rows). */\n\tariaLabel?: string;\n\tlabelTypography?:\n\t\t| 'bodyCaption'\n\t\t| 'bodySecondary'\n\t\t| 'bodyPrimary'\n\t\t| 'titleSmall';\n};\n\nconst CheckMark: React.FC<{\n\tisPartial: boolean;\n\tisDisabled: boolean;\n\tsize?: 'DEFAULT' | 'SMALL' | 'XS';\n\tactiveColor?: string;\n}> = (props) => {\n\tconst fillColor = useMemo(\n\t\t() => props.activeColor || COLORS.background.positive.vibrant,\n\t\t[props.activeColor],\n\t);\n\n\t// Box (and inner check) dimensions per size — XS renders a 12x12 mark.\n\tconst dims =\n\t\tprops.size === 'XS'\n\t\t\t? {\n\t\t\t\t\tbox: 12,\n\t\t\t\t\tcheck: { w: 6, h: 5, x: 3, y: 3.5 },\n\t\t\t\t\tpartial: { x: 3, y: 5, w: 6 },\n\t\t\t }\n\t\t\t: props.size === 'SMALL'\n\t\t\t? {\n\t\t\t\t\tbox: 16,\n\t\t\t\t\tcheck: { w: 8, h: 7, x: 4, y: 4 },\n\t\t\t\t\tpartial: { x: 5, y: 7, w: 6 },\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tbox: 18,\n\t\t\t\t\tcheck: { w: 10, h: 9, x: 4, y: 4 },\n\t\t\t\t\tpartial: { x: 5, y: 8, w: 8 },\n\t\t\t };\n\n\treturn (\n\t\t<svg\n\t\t\twidth={dims.box}\n\t\t\theight={dims.box}\n\t\t\tviewBox={`0 0 ${dims.box} ${dims.box}`}\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<rect\n\t\t\t\tx=\"0\"\n\t\t\t\ty=\"0\"\n\t\t\t\twidth={dims.box}\n\t\t\t\theight={dims.box}\n\t\t\t\trx=\"4\"\n\t\t\t\tfill={props.isDisabled ? COLORS.content.inactive : fillColor}\n\t\t\t/>\n\t\t\t{!props.isPartial && (\n\t\t\t\t<svg\n\t\t\t\t\twidth={dims.check.w}\n\t\t\t\t\theight={dims.check.h}\n\t\t\t\t\tx={dims.check.x}\n\t\t\t\t\ty={dims.check.y}\n\t\t\t\t\tviewBox=\"0 0 10 9\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\t\t\td=\"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z\"\n\t\t\t\t\t\tfill=\"white\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t)}\n\t\t\t{props.isPartial && (\n\t\t\t\t<rect\n\t\t\t\t\tx={dims.partial.x}\n\t\t\t\t\ty={dims.partial.y}\n\t\t\t\t\twidth={dims.partial.w}\n\t\t\t\t\theight=\"2\"\n\t\t\t\t\trx=\"1\"\n\t\t\t\t\tfill={COLORS.surface.standard}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</svg>\n\t);\n};\n\nexport const CheckBox: React.FC<CheckBoxProps> = (props) => {\n\tconst [isChecked, setIsChecked] = useState(props.isChecked || false);\n\tconst [isPartiallyChecked, setIsPartiallyChecked] = useState(\n\t\tprops.isPartiallyChecked || false,\n\t);\n\tconst [isDisabled, setIsDisabled] = useState(props.isDisabled || false);\n\tconst [isHovered, setIsHovered] = useState(false);\n\tconst [isClicked, setIsClicked] = useState(false);\n\n\tconst toggleCheck = (event?: React.SyntheticEvent) => {\n\t\tif (!props.isDisabled) {\n\t\t\tconst newVal = !isChecked;\n\t\t\tif (isPartiallyChecked) {\n\t\t\t\tsetIsPartiallyChecked(!isPartiallyChecked);\n\t\t\t} else {\n\t\t\t\tsetIsChecked(newVal);\n\t\t\t}\n\t\t\tprops.onValueChange?.(newVal, props.value, event as React.MouseEvent);\n\t\t}\n\t};\n\n\tconst handleCheck = (event: React.MouseEvent) => {\n\t\ttoggleCheck(event);\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.key === ' ' || event.key === 'Enter') {\n\t\t\tevent.preventDefault();\n\t\t\ttoggleCheck(event);\n\t\t}\n\t};\n\n\tconst ariaChecked = isPartiallyChecked\n\t\t? 'mixed'\n\t\t: isChecked\n\t\t? 'true'\n\t\t: 'false';\n\n\tuseEffect(() => {\n\t\tsetIsChecked(props.isChecked);\n\t}, [props.isChecked]);\n\n\tuseEffect(() => {\n\t\tsetIsDisabled(props.isDisabled || false);\n\t}, [props.isDisabled]);\n\n\tuseEffect(() => {\n\t\tsetIsPartiallyChecked(props.isPartiallyChecked || false);\n\t}, [props.isPartiallyChecked]);\n\n\tconst renderLabel = () => {\n\t\tif (!props.label) {\n\t\t\treturn <></>;\n\t\t}\n\n\t\tif (props.labelTypography) {\n\t\t\tconst LabelTypography = {\n\t\t\t\tbodyCaption: BodyCaption,\n\t\t\t\tbodySecondary: BodySecondary,\n\t\t\t\tbodyPrimary: BodyPrimary,\n\t\t\t\ttitleSmall: TitleSmall,\n\t\t\t}[props.labelTypography];\n\t\t\treturn (\n\t\t\t\t<LabelTypography\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</LabelTypography>\n\t\t\t);\n\t\t}\n\n\t\tif (props.size === 'XS') {\n\t\t\treturn (\n\t\t\t\t<BodyCaption\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodyCaption>\n\t\t\t);\n\t\t}\n\n\t\tif ((props.boldOnChecked && isChecked) || props.bold) {\n\t\t\tif (props.labelSize === 'DEFAULT') {\n\t\t\t\treturn (\n\t\t\t\t\t<TitleRegular\n\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\tprops.isDisabled ? COLORS.text.disabled : COLORS.text.primary\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.label}\n\t\t\t\t\t</TitleRegular>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<TitleSmall\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</TitleSmall>\n\t\t\t);\n\t\t}\n\n\t\tif (props.size === 'SMALL') {\n\t\t\treturn (\n\t\t\t\t<BodySecondary\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodySecondary>\n\t\t\t);\n\t\t}\n\n\t\tif (props.labelSize === 'SMALL') {\n\t\t\treturn (\n\t\t\t\t<BodySecondary\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodySecondary>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BodyPrimary\n\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t>\n\t\t\t\t{props.label}\n\t\t\t</BodyPrimary>\n\t\t);\n\t};\n\n\treturn (\n\t\t<CheckboxContainer\n\t\t\trole=\"checkbox\"\n\t\t\taria-checked={ariaChecked}\n\t\t\taria-disabled={isDisabled || undefined}\n\t\t\taria-label={props.label ? undefined : props.ariaLabel}\n\t\t\ttabIndex={isDisabled ? -1 : 0}\n\t\t\tonClick={handleCheck}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tonMouseEnter={() => setIsHovered(!props.skipHoverState)}\n\t\t\tonMouseLeave={() => setIsHovered(false)}\n\t\t\tonMouseDown={() => setIsClicked(!props.skipHoverState)}\n\t\t\tonMouseUp={() => setIsClicked(false)}\n\t\t\tisDisabled={isDisabled}\n\t\t\tenableHover={props.enableHover}\n\t\t\tstyle={props.style ?? {}}\n\t\t>\n\t\t\t<CheckboxIcon\n\t\t\t\tchecked={isChecked}\n\t\t\t\thovered={isHovered}\n\t\t\t\tclicked={isClicked}\n\t\t\t\tisDisabled={isDisabled}\n\t\t\t\tsize={props.size}\n\t\t\t\tborderColor={props.checkboxBorderColor}\n\t\t\t\tactiveColor={props.activeColor}\n\t\t\t>\n\t\t\t\t{isChecked && (\n\t\t\t\t\t<CheckMark\n\t\t\t\t\t\tisPartial={isPartiallyChecked || false}\n\t\t\t\t\t\tisDisabled={isDisabled}\n\t\t\t\t\t\tsize={props.size}\n\t\t\t\t\t\tactiveColor={props?.activeColor}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</CheckboxIcon>\n\t\t\t{renderLabel()}\n\t\t\t{props.rightComponent}\n\t\t</CheckboxContainer>\n\t);\n};\n"],"names":["CheckMark","props","fillColor","useMemo","COLORS","dims","jsxs","jsx","CheckBox","isChecked","setIsChecked","useState","isPartiallyChecked","setIsPartiallyChecked","isDisabled","setIsDisabled","isHovered","setIsHovered","isClicked","setIsClicked","toggleCheck","event","newVal","handleCheck","handleKeyDown","ariaChecked","useEffect","renderLabel","Fragment","LabelTypography","BodyCaption","BodySecondary","BodyPrimary","TitleSmall","TitleRegular","CheckboxContainer","CheckboxIcon"],"mappings":";;;;;AA4CA,MAAMA,IAKD,CAACC,MAAU;AACf,QAAMC,IAAYC;AAAA,IACjB,MAAMF,EAAM,eAAeG,EAAO,WAAW,SAAS;AAAA,IACtD,CAACH,EAAM,WAAW;AAAA,EAAA,GAIbI,IACLJ,EAAM,SAAS,OACZ;AAAA,IACA,KAAK;AAAA,IACL,OAAO,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAA;AAAA,IAC9B,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,EAAE,IAE5BA,EAAM,SAAS,UACf;AAAA,IACA,KAAK;AAAA,IACL,OAAO,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,IAC9B,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,EAAE,IAE5B;AAAA,IACA,KAAK;AAAA,IACL,OAAO,EAAE,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,IAC/B,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,EAAA;AAAA,EAAE;AAGhC,SACC,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,OAAOD,EAAK;AAAA,MACZ,QAAQA,EAAK;AAAA,MACb,SAAS,OAAOA,EAAK,GAAG,IAAIA,EAAK,GAAG;AAAA,MACpC,MAAK;AAAA,MACL,OAAM;AAAA,MAEN,UAAA;AAAA,QAAA,gBAAAE;AAAA,UAAC;AA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AChB,EAAM,cAAc;AAAA,MACtD,cAAc,MAAMgB,EAAa,EAAK;AAAA,MACtC,aAAa,MAAME,EAAa,CAAClB,EAAM,cAAc;AAAA,MACrD,WAAW,MAAMkB,EAAa,EAAK;AAAA,MACnC,YAAAL;AAAA,MACA,aAAab,EAAM;AAAA,MACnB,OAAOA,EAAM,SAAS,CAAA;AAAA,MAEtB,UAAA;AAAA,QAAA,gBAAAM;AAAA,UAAC6B;AAAA,UAAA;AAAA,YACA,SAAS3B;AAAA,YACT,SAASO;AAAA,YACT,SAASE;AAAA,YACT,YAAAJ;AAAA,YACA,MAAMb,EAAM;AAAA,YACZ,aAAaA,EAAM;AAAA,YACnB,aAAaA,EAAM;AAAA,YAElB,UAAAQ,KACA,gBAAAF;AAAA,cAACP;AAAA,cAAA;AAAA,gBACA,WAAWY,KAAsB;AAAA,gBACjC,YAAAE;AAAA,gBACA,MAAMb,EAAM;AAAA,gBACZ,aAAaA,GAAO;AAAA,cAAA;AAAA,YAAA;AAAA,UACrB;AAAA,QAAA;AAAA,QAGD0B,EAAA;AAAA,QACA1B,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -9,4 +9,5 @@ export declare const CheckboxIcon: import('styled-components').StyledComponent<"
9
9
  isDisabled: boolean;
10
10
  size?: "SMALL" | "DEFAULT" | "XS" | undefined;
11
11
  borderColor?: string | undefined;
12
+ activeColor?: string | undefined;
12
13
  }, never>;
@@ -1,6 +1,7 @@
1
- import t, { css as i } from "styled-components";
1
+ import r, { css as i } from "styled-components";
2
+ import { rgba as t } from "../../utils/rgba.js";
2
3
  import { COLORS as o } from "../../constants/Theme.js";
3
- const s = t.div`
4
+ const c = r.div`
4
5
  display: inline-flex;
5
6
  gap: 8px;
6
7
  align-items: center;
@@ -10,16 +11,15 @@ const s = t.div`
10
11
  background: ${o.surface.subdued};
11
12
  }
12
13
  `}
13
- `, n = t.div`
14
- width: ${(e) => e.size === "DEFAULT" ? 14 : 12}px;
15
- height: ${(e) => e.size === "DEFAULT" ? 14 : 12}px;
14
+ `, n = r.div`
15
+ width: ${(e) => e.size === "XS" ? 12 : e.size === "SMALL" ? 16 : 18}px;
16
+ height: ${(e) => e.size === "XS" ? 12 : e.size === "SMALL" ? 16 : 18}px;
16
17
  border-radius: 4px;
17
18
  border: 2px solid black;
18
19
  display: flex;
19
20
  justify-content: center;
20
21
  align-items: center;
21
- /* XS is a true 12x12 box (border drawn inside); other sizes keep content-box. */
22
- box-sizing: ${(e) => e.size === "XS" ? "border-box" : "content-box"};
22
+ box-sizing: border-box;
23
23
  ${(e) => e.isDisabled ? i`
24
24
  border: ${e.size === "DEFAULT" ? 2 : 1.5}px solid
25
25
  ${o.content.inactive};
@@ -29,20 +29,18 @@ const s = t.div`
29
29
  `}
30
30
  ${(e) => e.checked && i`
31
31
  border: 0px;
32
- width: ${e.size === "XS" ? 12 : 18}px;
33
- height: ${e.size === "XS" ? 12 : 18}px;
34
32
  `}
35
33
  ${(e) => e.hovered && i`
36
34
  outline: 3px solid ${o.surface.hovered};
37
35
  `}
38
36
  ${(e) => e.clicked && !e.isDisabled && i`
39
37
  outline: 3px solid
40
- ${e.checked ? o.stroke.positive.lightAlt : o.surface.hovered};
38
+ ${e.checked ? e.activeColor ? t(e.activeColor, 0.24) : o.stroke.positive.lightAlt : o.surface.hovered};
41
39
  outline-offset: 2px;
42
40
  `}
43
41
  `;
44
42
  export {
45
- s as CheckboxContainer,
43
+ c as CheckboxContainer,
46
44
  n as CheckboxIcon
47
45
  };
48
46
  //# sourceMappingURL=CheckBox.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckBox.styled.js","sources":["../../../../src/components/checkBox/CheckBox.styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const CheckboxContainer = styled.div<{\n\tisDisabled?: boolean;\n\tenableHover?: boolean;\n}>`\n\tdisplay: inline-flex;\n\tgap: 8px;\n\talign-items: center;\n\tcursor: ${(props) => (props.isDisabled ? 'default' : 'pointer')};\n\t${(props) =>\n\t\tprops.enableHover &&\n\t\tcss`\n\t\t\t:hover {\n\t\t\t\tbackground: ${COLORS.surface.subdued};\n\t\t\t}\n\t\t`}\n`;\n\nexport const CheckboxIcon = styled.div<{\n\tchecked: boolean;\n\thovered: boolean;\n\tclicked: boolean;\n\tisDisabled: boolean;\n\tsize?: 'SMALL' | 'DEFAULT' | 'XS';\n\tborderColor?: string;\n}>`\n\twidth: ${(props) => (props.size === 'DEFAULT' ? 14 : 12)}px;\n\theight: ${(props) => (props.size === 'DEFAULT' ? 14 : 12)}px;\n\tborder-radius: 4px;\n\tborder: 2px solid black;\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\t/* XS is a true 12x12 box (border drawn inside); other sizes keep content-box. */\n\tbox-sizing: ${(props) => (props.size === 'XS' ? 'border-box' : 'content-box')};\n\t${(props) =>\n\t\tprops.isDisabled\n\t\t\t? css`\n\t\t\t\t\tborder: ${props.size === 'DEFAULT' ? 2 : 1.5}px solid\n\t\t\t\t\t\t${COLORS.content.inactive};\n\t\t\t `\n\t\t\t: css`\n\t\t\t\t\tborder: ${props.size === 'DEFAULT' ? 2 : 1.5}px solid\n\t\t\t\t\t\t${props.borderColor ?? 'black'};\n\t\t\t `}\n\t${(props) =>\n\t\tprops.checked &&\n\t\tcss`\n\t\t\tborder: 0px;\n\t\t\twidth: ${props.size === 'XS' ? 12 : 18}px;\n\t\t\theight: ${props.size === 'XS' ? 12 : 18}px;\n\t\t`}\n\t${(props) =>\n\t\tprops.hovered &&\n\t\tcss`\n\t\t\toutline: 3px solid ${COLORS.surface.hovered};\n\t\t`}\n\t${(props) =>\n\t\tprops.clicked &&\n\t\t!props.isDisabled &&\n\t\tcss`\n\t\t\toutline: 3px solid\n\t\t\t\t${props.checked\n\t\t\t\t\t? COLORS.stroke.positive.lightAlt\n\t\t\t\t\t: COLORS.surface.hovered};\n\t\t\toutline-offset: 2px;\n\t\t`}\n`;\n"],"names":["CheckboxContainer","styled","props","css","COLORS","CheckboxIcon"],"mappings":";;AAGO,MAAMA,IAAoBC,EAAO;AAAA;AAAA;AAAA;AAAA,WAO7B,CAACC,MAAWA,EAAM,aAAa,YAAY,SAAU;AAAA,GAC7D,CAACA,MACFA,EAAM,eACNC;AAAA;AAAA,kBAEgBC,EAAO,QAAQ,OAAO;AAAA;AAAA,GAErC;AAAA,GAGUC,IAAeJ,EAAO;AAAA,UAQzB,CAACC,MAAWA,EAAM,SAAS,YAAY,KAAK,EAAG;AAAA,WAC9C,CAACA,MAAWA,EAAM,SAAS,YAAY,KAAK,EAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAO3C,CAACA,MAAWA,EAAM,SAAS,OAAO,eAAe,aAAc;AAAA,GAC3E,CAACA,MACFA,EAAM,aACHC;AAAA,eACUD,EAAM,SAAS,YAAY,IAAI,GAAG;AAAA,QACzCE,EAAO,QAAQ,QAAQ;AAAA,SAE1BD;AAAA,eACUD,EAAM,SAAS,YAAY,IAAI,GAAG;AAAA,QACzCA,EAAM,eAAe,OAAO;AAAA,MAC9B;AAAA,GACH,CAACA,MACFA,EAAM,WACNC;AAAA;AAAA,YAEUD,EAAM,SAAS,OAAO,KAAK,EAAE;AAAA,aAC5BA,EAAM,SAAS,OAAO,KAAK,EAAE;AAAA,GACvC;AAAA,GACA,CAACA,MACFA,EAAM,WACNC;AAAA,wBACsBC,EAAO,QAAQ,OAAO;AAAA,GAC3C;AAAA,GACA,CAACF,MACFA,EAAM,WACN,CAACA,EAAM,cACPC;AAAA;AAAA,MAEID,EAAM,UACLE,EAAO,OAAO,SAAS,WACvBA,EAAO,QAAQ,OAAO;AAAA;AAAA,GAE1B;AAAA;"}
1
+ {"version":3,"file":"CheckBox.styled.js","sources":["../../../../src/components/checkBox/CheckBox.styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from '@src/utils/rgba';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const CheckboxContainer = styled.div<{\n\tisDisabled?: boolean;\n\tenableHover?: boolean;\n}>`\n\tdisplay: inline-flex;\n\tgap: 8px;\n\talign-items: center;\n\tcursor: ${(props) => (props.isDisabled ? 'default' : 'pointer')};\n\t${(props) =>\n\t\tprops.enableHover &&\n\t\tcss`\n\t\t\t:hover {\n\t\t\t\tbackground: ${COLORS.surface.subdued};\n\t\t\t}\n\t\t`}\n`;\n\nexport const CheckboxIcon = styled.div<{\n\tchecked: boolean;\n\thovered: boolean;\n\tclicked: boolean;\n\tisDisabled: boolean;\n\tsize?: 'SMALL' | 'DEFAULT' | 'XS';\n\tborderColor?: string;\n\tactiveColor?: string;\n}>`\n\twidth: ${(props) =>\n\t\tprops.size === 'XS' ? 12 : props.size === 'SMALL' ? 16 : 18}px;\n\theight: ${(props) =>\n\t\tprops.size === 'XS' ? 12 : props.size === 'SMALL' ? 16 : 18}px;\n\tborder-radius: 4px;\n\tborder: 2px solid black;\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\t${(props) =>\n\t\tprops.isDisabled\n\t\t\t? css`\n\t\t\t\t\tborder: ${props.size === 'DEFAULT' ? 2 : 1.5}px solid\n\t\t\t\t\t\t${COLORS.content.inactive};\n\t\t\t `\n\t\t\t: css`\n\t\t\t\t\tborder: ${props.size === 'DEFAULT' ? 2 : 1.5}px solid\n\t\t\t\t\t\t${props.borderColor ?? 'black'};\n\t\t\t `}\n\t${(props) =>\n\t\tprops.checked &&\n\t\tcss`\n\t\t\tborder: 0px;\n\t\t`}\n\t${(props) =>\n\t\tprops.hovered &&\n\t\tcss`\n\t\t\toutline: 3px solid ${COLORS.surface.hovered};\n\t\t`}\n\t${(props) =>\n\t\tprops.clicked &&\n\t\t!props.isDisabled &&\n\t\tcss`\n\t\t\toutline: 3px solid\n\t\t\t\t${props.checked\n\t\t\t\t\t? props.activeColor\n\t\t\t\t\t\t? rgba(props.activeColor, 0.24)\n\t\t\t\t\t\t: COLORS.stroke.positive.lightAlt\n\t\t\t\t\t: COLORS.surface.hovered};\n\t\t\toutline-offset: 2px;\n\t\t`}\n`;\n"],"names":["CheckboxContainer","styled","props","css","COLORS","CheckboxIcon","rgba"],"mappings":";;;AAIO,MAAMA,IAAoBC,EAAO;AAAA;AAAA;AAAA;AAAA,WAO7B,CAACC,MAAWA,EAAM,aAAa,YAAY,SAAU;AAAA,GAC7D,CAACA,MACFA,EAAM,eACNC;AAAA;AAAA,kBAEgBC,EAAO,QAAQ,OAAO;AAAA;AAAA,GAErC;AAAA,GAGUC,IAAeJ,EAAO;AAAA,UASzB,CAACC,MACTA,EAAM,SAAS,OAAO,KAAKA,EAAM,SAAS,UAAU,KAAK,EAAE;AAAA,WAClD,CAACA,MACVA,EAAM,SAAS,OAAO,KAAKA,EAAM,SAAS,UAAU,KAAK,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAO1D,CAACA,MACFA,EAAM,aACHC;AAAA,eACUD,EAAM,SAAS,YAAY,IAAI,GAAG;AAAA,QACzCE,EAAO,QAAQ,QAAQ;AAAA,SAE1BD;AAAA,eACUD,EAAM,SAAS,YAAY,IAAI,GAAG;AAAA,QACzCA,EAAM,eAAe,OAAO;AAAA,MAC9B;AAAA,GACH,CAACA,MACFA,EAAM,WACNC;AAAA;AAAA,GAEC;AAAA,GACA,CAACD,MACFA,EAAM,WACNC;AAAA,wBACsBC,EAAO,QAAQ,OAAO;AAAA,GAC3C;AAAA,GACA,CAACF,MACFA,EAAM,WACN,CAACA,EAAM,cACPC;AAAA;AAAA,MAEID,EAAM,UACLA,EAAM,cACLI,EAAKJ,EAAM,aAAa,IAAI,IAC5BE,EAAO,OAAO,SAAS,WACxBA,EAAO,QAAQ,OAAO;AAAA;AAAA,GAE1B;AAAA;"}
@@ -9,6 +9,7 @@ interface ChipInputProps {
9
9
  sizeToUse?: 'default' | 'small' | 'x-small';
10
10
  errorMessage?: string;
11
11
  showLabelsOnMoreHover?: boolean;
12
+ placeholderColor?: string;
12
13
  }
13
14
  declare const ChipInput: React.FC<ChipInputProps>;
14
15
  export default ChipInput;
@@ -1,16 +1,16 @@
1
- import { jsxs as m, Fragment as S, jsx as e } from "react/jsx-runtime";
2
- import { useState as s, useEffect as w } from "react";
3
- import L from "../../utils/StringUtils.js";
1
+ import { jsxs as m, Fragment as w, jsx as e } from "react/jsx-runtime";
2
+ import { useState as s, useEffect as L } from "react";
3
+ import R from "../../utils/StringUtils.js";
4
4
  import { COLORS as d } from "../../constants/Theme.js";
5
- import R from "../../assets/icons/chevronDown.svg.js";
6
- import E from "../../assets/icons/cross.svg.js";
7
- import j from "../../assets/icons/errorInfo.svg.js";
8
- import { InputFooter as A } from "../input/Input.styled.js";
5
+ import E from "../../assets/icons/chevronDown.svg.js";
6
+ import j from "../../assets/icons/cross.svg.js";
7
+ import A from "../../assets/icons/errorInfo.svg.js";
8
+ import { InputFooter as F } from "../input/Input.styled.js";
9
9
  import { BodyCaption as h } from "../TypographyStyle.js";
10
- import { ChipInputWrapper as F } from "./Common.styled.js";
11
- import { Tag as T } from "../tag/Tag.js";
12
- import { Tooltip as k } from "../tooltips/Tooltip.js";
13
- const B = (t) => t.length === 1 ? 100 : t.length === 2 ? 40 : 34, V = ({
10
+ import { ChipInputWrapper as T } from "./Common.styled.js";
11
+ import { Tag as k } from "../tag/Tag.js";
12
+ import { Tooltip as B } from "../tooltips/Tooltip.js";
13
+ const D = (t) => t.length === 1 ? 100 : t.length === 2 ? 40 : 34, Y = ({
14
14
  chips: t,
15
15
  onDeleteChip: g,
16
16
  containerStyle: f = {},
@@ -18,29 +18,30 @@ const B = (t) => t.length === 1 ? 100 : t.length === 2 ? 40 : 34, V = ({
18
18
  isDropdownOpened: u,
19
19
  placeholder: C = "Select..",
20
20
  errorMessage: a = "",
21
- showLabelsOnMoreHover: v = !1
21
+ showLabelsOnMoreHover: v = !1,
22
+ placeholderColor: b
22
23
  }) => {
23
- const [b, x] = s(), [p, y] = s(0), [c, I] = s([]);
24
- return w(() => {
24
+ const [x, y] = s(), [p, I] = s(0), [c, O] = s([]);
25
+ return L(() => {
25
26
  if (!t) return;
26
27
  let n = 0;
27
- const r = B(t);
28
+ const r = D(t);
28
29
  let o = t.filter((l) => (n += l.label.length, n <= r));
29
- o.length === 0 && t.length > 0 && (o = [t[0]]), x(o);
30
- const O = t.filter((l) => !o.includes(l)).map((l) => l.label);
31
- I(O), y(t.length - o.length);
32
- }, [t]), /* @__PURE__ */ m(S, { children: [
33
- /* @__PURE__ */ m(F, { style: { ...f }, error: !!a, children: [
30
+ o.length === 0 && t.length > 0 && (o = [t[0]]), y(o);
31
+ const S = t.filter((l) => !o.includes(l)).map((l) => l.label);
32
+ O(S), I(t.length - o.length);
33
+ }, [t]), /* @__PURE__ */ m(w, { children: [
34
+ /* @__PURE__ */ m(T, { style: { ...f }, error: !!a, children: [
34
35
  /* @__PURE__ */ m("div", { className: "chips-container", children: [
35
- b?.map((n, r) => /* @__PURE__ */ e("div", { style: { zIndex: 2 }, children: /* @__PURE__ */ e(
36
- T,
36
+ x?.map((n, r) => /* @__PURE__ */ e("div", { style: { zIndex: 2 }, children: /* @__PURE__ */ e(
37
+ k,
37
38
  {
38
- tagText: L.truncateText(
39
+ tagText: R.truncateText(
39
40
  n.selectedLabel || n.label,
40
41
  40
41
42
  ),
42
43
  TrailingIcon: () => /* @__PURE__ */ e(
43
- E,
44
+ j,
44
45
  {
45
46
  width: 12,
46
47
  height: 12,
@@ -62,7 +63,7 @@ const B = (t) => t.length === 1 ? 100 : t.length === 2 ? 40 : 34, V = ({
62
63
  pointerEvents: "auto"
63
64
  },
64
65
  children: /* @__PURE__ */ e(
65
- k,
66
+ B,
66
67
  {
67
68
  body: "",
68
69
  placement: "bottom",
@@ -79,10 +80,16 @@ const B = (t) => t.length === 1 ? 100 : t.length === 2 ? 40 : 34, V = ({
79
80
  )
80
81
  }
81
82
  ),
82
- t.length === 0 && /* @__PURE__ */ e("div", { style: { color: d.content.placeholder }, children: C })
83
+ t.length === 0 && /* @__PURE__ */ e(
84
+ "div",
85
+ {
86
+ style: { color: b ?? d.content.placeholder },
87
+ children: C
88
+ }
89
+ )
83
90
  ] }),
84
91
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
85
- R,
92
+ E,
86
93
  {
87
94
  style: {
88
95
  transform: u ? "rotate(180deg)" : "rotate(0deg)"
@@ -93,13 +100,13 @@ const B = (t) => t.length === 1 ? 100 : t.length === 2 ? 40 : 34, V = ({
93
100
  }
94
101
  ) })
95
102
  ] }),
96
- !!a && /* @__PURE__ */ m(A, { invalid: !0, children: [
97
- !!a && /* @__PURE__ */ e(j, { width: 16, height: 16 }),
103
+ !!a && /* @__PURE__ */ m(F, { invalid: !0, children: [
104
+ !!a && /* @__PURE__ */ e(A, { width: 16, height: 16 }),
98
105
  a
99
106
  ] })
100
107
  ] });
101
108
  };
102
109
  export {
103
- V as default
110
+ Y as default
104
111
  };
105
112
  //# sourceMappingURL=ChipInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipInput.js","sources":["../../../../src/components/dropdown/ChipInput.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport StringUtils from '@src/utils/StringUtils';\nimport { COLORS } from '@src/constants/Theme';\nimport DownIcon from '../../assets/icons/chevronDown.svg';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport ErrorIcon from '../../assets/icons/errorInfo.svg';\nimport { InputFooter } from '../input/Input.styled';\nimport { Tag } from '../tag';\nimport { Tooltip } from '../tooltips';\nimport { BodyCaption } from '../TypographyStyle';\nimport { ChipInputWrapper } from './Common.styled';\nimport { SingleOption } from './type';\n\ninterface ChipInputProps {\n\tplaceholder?: string;\n\tchips: SingleOption[];\n\tonDeleteChip: (chip: SingleOption) => void;\n\tcontainerStyle?: React.CSSProperties;\n\tisDropdownOpened?: boolean;\n\tsizeToUse?: 'default' | 'small' | 'x-small';\n\terrorMessage?: string;\n\tshowLabelsOnMoreHover?: boolean;\n}\n\nconst getMaxChipsCharCount = (chips: SingleOption[]) => {\n\tif (chips.length === 1) return 100;\n\tif (chips.length === 2) return 40;\n\treturn 34;\n};\n\nconst ChipInput: React.FC<ChipInputProps> = ({\n\tchips,\n\tonDeleteChip,\n\tcontainerStyle = {},\n\tsizeToUse = 'default',\n\tisDropdownOpened,\n\tplaceholder = 'Select..',\n\terrorMessage = '',\n\tshowLabelsOnMoreHover = false,\n}) => {\n\tconst [options, setOptions] = useState<SingleOption[]>();\n\tconst [remainingOptionsCnt, setRemainingOptionsCnt] = useState(0);\n\tconst [remainingOptionsLabels, setRemainingOptionsLabels] = useState<\n\t\tstring[]\n\t>([]);\n\n\tuseEffect(() => {\n\t\tif (!chips) return;\n\t\tlet combineCharCnt = 0;\n\t\tconst MAX_CHAR = getMaxChipsCharCount(chips);\n\t\tlet options = chips.filter((option) => {\n\t\t\tcombineCharCnt += option.label.length;\n\t\t\treturn combineCharCnt <= MAX_CHAR;\n\t\t});\n\t\tif (options.length === 0 && chips.length > 0) {\n\t\t\toptions = [chips[0]];\n\t\t}\n\t\tsetOptions(options);\n\t\tconst remainingChips = chips.filter((option) => !options.includes(option));\n\t\tconst labels = remainingChips.map((option) => option.label);\n\t\tsetRemainingOptionsLabels(labels);\n\t\tsetRemainingOptionsCnt(chips.length - options.length);\n\t}, [chips]);\n\n\treturn (\n\t\t<>\n\t\t\t<ChipInputWrapper style={{ ...containerStyle }} error={!!errorMessage}>\n\t\t\t\t<div className=\"chips-container\">\n\t\t\t\t\t{options?.map((chip, index) => (\n\t\t\t\t\t\t<div key={index} style={{ zIndex: 2 }}>\n\t\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\t\ttagText={StringUtils.truncateText(\n\t\t\t\t\t\t\t\t\tchip.selectedLabel || chip.label,\n\t\t\t\t\t\t\t\t\t40,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tTrailingIcon={() => (\n\t\t\t\t\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\t\t\t\t\twidth={12}\n\t\t\t\t\t\t\t\t\t\theight={12}\n\t\t\t\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\tonDeleteChip(chip);\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)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{chip.selectedLabel || chip.label}\n\t\t\t\t\t\t\t</Tag>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t\t{!!remainingOptionsCnt && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t\tzIndex: 2,\n\t\t\t\t\t\t\t\tpointerEvents: 'auto',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\t\tbody={''}\n\t\t\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\t\t\ttooltipContent={\n\t\t\t\t\t\t\t\t\tshowLabelsOnMoreHover && remainingOptionsLabels.length > 0 ? (\n\t\t\t\t\t\t\t\t\t\t<div style={{ padding: '4px' }}>\n\t\t\t\t\t\t\t\t\t\t\t{remainingOptionsLabels.map((label, index) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ color: COLORS.text.white }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.placeholder}>\n\t\t\t\t\t\t\t\t\t{`+${remainingOptionsCnt} more`}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{chips.length === 0 && (\n\t\t\t\t\t\t<div style={{ color: COLORS.content.placeholder }}>\n\t\t\t\t\t\t\t{placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div>\n\t\t\t\t\t<DownIcon\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\ttransform: isDropdownOpened ? 'rotate(180deg)' : 'rotate(0deg)',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsizeToUse === 'x-small' ? 16 : sizeToUse === 'small' ? 20 : 24\n\t\t\t\t\t\t}\n\t\t\t\t\t\theight={\n\t\t\t\t\t\t\tsizeToUse === 'x-small' ? 16 : sizeToUse === 'small' ? 20 : 24\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcolor={COLORS.content.primary}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</ChipInputWrapper>\n\t\t\t{!!errorMessage && (\n\t\t\t\t<InputFooter invalid={true}>\n\t\t\t\t\t{!!errorMessage && <ErrorIcon width={16} height={16} />}\n\t\t\t\t\t{errorMessage}\n\t\t\t\t</InputFooter>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nexport default ChipInput;\n"],"names":["getMaxChipsCharCount","chips","ChipInput","onDeleteChip","containerStyle","sizeToUse","isDropdownOpened","placeholder","errorMessage","showLabelsOnMoreHover","options","setOptions","useState","remainingOptionsCnt","setRemainingOptionsCnt","remainingOptionsLabels","setRemainingOptionsLabels","useEffect","combineCharCnt","MAX_CHAR","option","labels","jsxs","Fragment","ChipInputWrapper","chip","index","jsx","Tag","StringUtils","CrossIcon","Tooltip","label","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,gBAAA0B,EAAC,OAAA,EAAI,OAAO,EAAE,OAAOO,EAAO,QAAQ,YAAA,GAClC,UAAA3B,EAAA,CACF;AAAA,MAAA,GAEF;AAAA,wBAEC,OAAA,EACA,UAAA,gBAAAoB;AAAA,QAACQ;AAAAA,QAAA;AAAA,UACA,OAAO;AAAA,YACN,WAAW7B,IAAmB,mBAAmB;AAAA,UAAA;AAAA,UAElD,OACCD,MAAc,YAAY,KAAKA,MAAc,UAAU,KAAK;AAAA,UAE7D,QACCA,MAAc,YAAY,KAAKA,MAAc,UAAU,KAAK;AAAA,UAE7D,OAAO6B,EAAO,QAAQ;AAAA,QAAA;AAAA,MAAA,EACvB,CACD;AAAA,IAAA,GACD;AAAA,IACC,CAAC,CAAC1B,KACF,gBAAAc,EAACc,GAAA,EAAY,SAAS,IACpB,UAAA;AAAA,MAAA,CAAC,CAAC5B,KAAgB,gBAAAmB,EAACU,KAAU,OAAO,IAAI,QAAQ,IAAI;AAAA,MACpD7B;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEF;AAEF;"}
1
+ {"version":3,"file":"ChipInput.js","sources":["../../../../src/components/dropdown/ChipInput.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport StringUtils from '@src/utils/StringUtils';\nimport { COLORS } from '@src/constants/Theme';\nimport DownIcon from '../../assets/icons/chevronDown.svg';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport ErrorIcon from '../../assets/icons/errorInfo.svg';\nimport { InputFooter } from '../input/Input.styled';\nimport { Tag } from '../tag';\nimport { Tooltip } from '../tooltips';\nimport { BodyCaption } from '../TypographyStyle';\nimport { ChipInputWrapper } from './Common.styled';\nimport { SingleOption } from './type';\n\ninterface ChipInputProps {\n\tplaceholder?: string;\n\tchips: SingleOption[];\n\tonDeleteChip: (chip: SingleOption) => void;\n\tcontainerStyle?: React.CSSProperties;\n\tisDropdownOpened?: boolean;\n\tsizeToUse?: 'default' | 'small' | 'x-small';\n\terrorMessage?: string;\n\tshowLabelsOnMoreHover?: boolean;\n\tplaceholderColor?: string;\n}\n\nconst getMaxChipsCharCount = (chips: SingleOption[]) => {\n\tif (chips.length === 1) return 100;\n\tif (chips.length === 2) return 40;\n\treturn 34;\n};\n\nconst ChipInput: React.FC<ChipInputProps> = ({\n\tchips,\n\tonDeleteChip,\n\tcontainerStyle = {},\n\tsizeToUse = 'default',\n\tisDropdownOpened,\n\tplaceholder = 'Select..',\n\terrorMessage = '',\n\tshowLabelsOnMoreHover = false,\n\tplaceholderColor,\n}) => {\n\tconst [options, setOptions] = useState<SingleOption[]>();\n\tconst [remainingOptionsCnt, setRemainingOptionsCnt] = useState(0);\n\tconst [remainingOptionsLabels, setRemainingOptionsLabels] = useState<\n\t\tstring[]\n\t>([]);\n\n\tuseEffect(() => {\n\t\tif (!chips) return;\n\t\tlet combineCharCnt = 0;\n\t\tconst MAX_CHAR = getMaxChipsCharCount(chips);\n\t\tlet options = chips.filter((option) => {\n\t\t\tcombineCharCnt += option.label.length;\n\t\t\treturn combineCharCnt <= MAX_CHAR;\n\t\t});\n\t\tif (options.length === 0 && chips.length > 0) {\n\t\t\toptions = [chips[0]];\n\t\t}\n\t\tsetOptions(options);\n\t\tconst remainingChips = chips.filter((option) => !options.includes(option));\n\t\tconst labels = remainingChips.map((option) => option.label);\n\t\tsetRemainingOptionsLabels(labels);\n\t\tsetRemainingOptionsCnt(chips.length - options.length);\n\t}, [chips]);\n\n\treturn (\n\t\t<>\n\t\t\t<ChipInputWrapper style={{ ...containerStyle }} error={!!errorMessage}>\n\t\t\t\t<div className=\"chips-container\">\n\t\t\t\t\t{options?.map((chip, index) => (\n\t\t\t\t\t\t<div key={index} style={{ zIndex: 2 }}>\n\t\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\t\ttagText={StringUtils.truncateText(\n\t\t\t\t\t\t\t\t\tchip.selectedLabel || chip.label,\n\t\t\t\t\t\t\t\t\t40,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tTrailingIcon={() => (\n\t\t\t\t\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\t\t\t\t\twidth={12}\n\t\t\t\t\t\t\t\t\t\theight={12}\n\t\t\t\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\tonDeleteChip(chip);\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)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{chip.selectedLabel || chip.label}\n\t\t\t\t\t\t\t</Tag>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t\t{!!remainingOptionsCnt && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t\tzIndex: 2,\n\t\t\t\t\t\t\t\tpointerEvents: 'auto',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\t\tbody={''}\n\t\t\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\t\t\ttooltipContent={\n\t\t\t\t\t\t\t\t\tshowLabelsOnMoreHover && remainingOptionsLabels.length > 0 ? (\n\t\t\t\t\t\t\t\t\t\t<div style={{ padding: '4px' }}>\n\t\t\t\t\t\t\t\t\t\t\t{remainingOptionsLabels.map((label, index) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{ color: COLORS.text.white }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.placeholder}>\n\t\t\t\t\t\t\t\t\t{`+${remainingOptionsCnt} more`}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{chips.length === 0 && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{ color: placeholderColor ?? COLORS.content.placeholder }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div>\n\t\t\t\t\t<DownIcon\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\ttransform: isDropdownOpened ? 'rotate(180deg)' : 'rotate(0deg)',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsizeToUse === 'x-small' ? 16 : sizeToUse === 'small' ? 20 : 24\n\t\t\t\t\t\t}\n\t\t\t\t\t\theight={\n\t\t\t\t\t\t\tsizeToUse === 'x-small' ? 16 : sizeToUse === 'small' ? 20 : 24\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcolor={COLORS.content.primary}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</ChipInputWrapper>\n\t\t\t{!!errorMessage && (\n\t\t\t\t<InputFooter invalid={true}>\n\t\t\t\t\t{!!errorMessage && <ErrorIcon width={16} height={16} />}\n\t\t\t\t\t{errorMessage}\n\t\t\t\t</InputFooter>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nexport default ChipInput;\n"],"names":["getMaxChipsCharCount","chips","ChipInput","onDeleteChip","containerStyle","sizeToUse","isDropdownOpened","placeholder","errorMessage","showLabelsOnMoreHover","placeholderColor","options","setOptions","useState","remainingOptionsCnt","setRemainingOptionsCnt","remainingOptionsLabels","setRemainingOptionsLabels","useEffect","combineCharCnt","MAX_CHAR","option","labels","jsxs","Fragment","ChipInputWrapper","chip","index","jsx","Tag","StringUtils","CrossIcon","Tooltip","label","BodyCaption","COLORS","DownIcon","InputFooter","ErrorIcon"],"mappings":";;;;;;;;;;;;AAyBA,MAAMA,IAAuB,CAACC,MACzBA,EAAM,WAAW,IAAU,MAC3BA,EAAM,WAAW,IAAU,KACxB,IAGFC,IAAsC,CAAC;AAAA,EAC5C,OAAAD;AAAA,EACA,cAAAE;AAAA,EACA,gBAAAC,IAAiB,CAAA;AAAA,EACjB,WAAAC,IAAY;AAAA,EACZ,kBAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,cAAAC,IAAe;AAAA,EACf,uBAAAC,IAAwB;AAAA,EACxB,kBAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAA,GACxB,CAACC,GAAqBC,CAAsB,IAAIF,EAAS,CAAC,GAC1D,CAACG,GAAwBC,CAAyB,IAAIJ,EAE1D,CAAA,CAAE;AAEJ,SAAAK,EAAU,MAAM;AACf,QAAI,CAACjB,EAAO;AACZ,QAAIkB,IAAiB;AACrB,UAAMC,IAAWpB,EAAqBC,CAAK;AAC3C,QAAIU,IAAUV,EAAM,OAAO,CAACoB,OAC3BF,KAAkBE,EAAO,MAAM,QACxBF,KAAkBC,EACzB;AACD,IAAIT,EAAQ,WAAW,KAAKV,EAAM,SAAS,MAC1CU,IAAU,CAACV,EAAM,CAAC,CAAC,IAEpBW,EAAWD,CAAO;AAElB,UAAMW,IADiBrB,EAAM,OAAO,CAACoB,MAAW,CAACV,EAAQ,SAASU,CAAM,CAAC,EAC3C,IAAI,CAACA,MAAWA,EAAO,KAAK;AAC1D,IAAAJ,EAA0BK,CAAM,GAChCP,EAAuBd,EAAM,SAASU,EAAQ,MAAM;AAAA,EACrD,GAAG,CAACV,CAAK,CAAC,GAGT,gBAAAsB,EAAAC,GAAA,EAC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BAAAC,EAACM,KAAY,OAAOC,EAAO,QAAQ,aACjC,UAAA,IAAIrB,CAAmB,QAAA,CACzB;AAAA,cAAA;AAAA,YAAA;AAAA,UACD;AAAA,QAAA;AAAA,QAIDb,EAAM,WAAW,KACjB,gBAAA2B;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,OAAO,EAAE,OAAOlB,KAAoByB,EAAO,QAAQ,YAAA;AAAA,YAElD,UAAA5B;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,GAEF;AAAA,wBAEC,OAAA,EACA,UAAA,gBAAAqB;AAAA,QAACQ;AAAAA,QAAA;AAAA,UACA,OAAO;AAAA,YACN,WAAW9B,IAAmB,mBAAmB;AAAA,UAAA;AAAA,UAElD,OACCD,MAAc,YAAY,KAAKA,MAAc,UAAU,KAAK;AAAA,UAE7D,QACCA,MAAc,YAAY,KAAKA,MAAc,UAAU,KAAK;AAAA,UAE7D,OAAO8B,EAAO,QAAQ;AAAA,QAAA;AAAA,MAAA,EACvB,CACD;AAAA,IAAA,GACD;AAAA,IACC,CAAC,CAAC3B,KACF,gBAAAe,EAACc,GAAA,EAAY,SAAS,IACpB,UAAA;AAAA,MAAA,CAAC,CAAC7B,KAAgB,gBAAAoB,EAACU,KAAU,OAAO,IAAI,QAAQ,IAAI;AAAA,MACpD9B;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEF;AAEF;"}
@@ -4,6 +4,8 @@ export type DropdownProps = OpenDropdownProps & {
4
4
  placeHolder?: string;
5
5
  size?: 'default' | 'small' | 'x-small';
6
6
  disabled?: boolean;
7
+ /** When disabled, render a solid grey box (background.base) with secondary text and no opacity wash. */
8
+ solidDisabled?: boolean;
7
9
  noErrorHint?: boolean;
8
10
  buttonWidth?: string;
9
11
  placeHolderHeight?: string;
@@ -1,158 +1,160 @@
1
- import { jsx as n, Fragment as b, jsxs as W } from "react/jsx-runtime";
2
- import { useState as g, useRef as G, useEffect as p } from "react";
3
- import { COLORS as r, BASE_COLORS as J } from "../../constants/Theme.js";
4
- import K from "../../assets/icons/chevronDown.svg.js";
5
- import { InputStyleContext as Q } from "../input/context/InputStyleProvider.js";
6
- import X from "./ChipInput.js";
7
- import { DropdownPopover as Y } from "./DropdownPopover/index.js";
8
- import { getSelectedOptionsAsText as Z } from "./OpenedDropdown/utils/iterationOnOptions.js";
9
- import { Input as $ } from "../input/Input.js";
1
+ import { jsx as r, Fragment as W, jsxs as k } from "react/jsx-runtime";
2
+ import { useState as x, useRef as J, useEffect as E } from "react";
3
+ import { COLORS as i, BASE_COLORS as K } from "../../constants/Theme.js";
4
+ import Q from "../../assets/icons/chevronDown.svg.js";
5
+ import { InputStyleContext as X } from "../input/context/InputStyleProvider.js";
6
+ import Y from "./ChipInput.js";
7
+ import { DropdownPopover as Z } from "./DropdownPopover/index.js";
8
+ import { getSelectedOptionsAsText as $ } from "./OpenedDropdown/utils/iterationOnOptions.js";
9
+ import { Input as H } from "../input/Input.js";
10
10
  function O() {
11
11
  }
12
- const H = ({
13
- placeHolder: a,
14
- size: E,
12
+ const D = ({
13
+ placeHolder: s,
14
+ size: b,
15
15
  onSelect: M,
16
- defaultOptions: o,
17
- disabled: v,
18
- noErrorHint: k,
19
- placeHolderHeight: x,
20
- showPlaceholderWhenSelected: w = !1,
21
- inputStyle: A = {},
16
+ defaultOptions: l,
17
+ disabled: o,
18
+ solidDisabled: a,
19
+ noErrorHint: w,
20
+ placeHolderHeight: y,
21
+ showPlaceholderWhenSelected: A = !1,
22
+ inputStyle: R = {},
22
23
  inputType: S = "default",
23
- onDeleteChip: R,
24
- truncatedText: T,
25
- showLeadingIconInPlaceholder: L = !1,
26
- showTrailingIconPlaceholder: V = !1,
27
- showLabelsOnMoreHover: j = !1,
28
- value: l,
29
- showSelected: f = !1,
30
- onDropdownVisbilityChange: z,
24
+ onDeleteChip: T,
25
+ truncatedText: L,
26
+ showLeadingIconInPlaceholder: V = !1,
27
+ showTrailingIconPlaceholder: j = !1,
28
+ showLabelsOnMoreHover: z = !1,
29
+ value: d,
30
+ showSelected: m = !1,
31
+ onDropdownVisbilityChange: F,
31
32
  ...t
32
33
  }) => {
33
- const [c, F] = g(!1), [y, I] = g(!1), i = E ?? "default", B = G(), [s, d] = g(
34
- o ?? []
34
+ const [u, B] = x(!1), [C, I] = x(!1), n = b ?? "default", N = J(), [c, h] = x(
35
+ l ?? []
35
36
  );
36
- function N(e) {
37
- Array.isArray(e) ? d([...e]) : d([e]), M?.(e);
37
+ function U(e) {
38
+ Array.isArray(e) ? h([...e]) : h([e]), M?.(e);
38
39
  }
39
- p(() => {
40
+ E(() => {
40
41
  const e = [];
41
- t?.options?.forEach((h) => {
42
- h.options ? h.options.forEach((u) => {
43
- u.selected && e.push({
44
- ...u,
45
- label: u.label
42
+ t?.options?.forEach((f) => {
43
+ f.options ? f.options.forEach((v) => {
44
+ v.selected && e.push({
45
+ ...v,
46
+ label: v.label
46
47
  });
47
- }) : h.selected && e.push(h);
48
- }), d([...e]);
49
- }, [t.options]), p(() => {
50
- o && d([...o]);
51
- }, [o]);
52
- const U = Z(s), _ = w ? a : U ?? a ?? "Select an option", m = t.buttonWidth, C = m ?? t.width ?? "100%", q = t.dropdownWidth ?? C;
53
- return /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
54
- Q.Provider,
48
+ }) : f.selected && e.push(f);
49
+ }), h([...e]);
50
+ }, [t.options]), E(() => {
51
+ l && h([...l]);
52
+ }, [l]);
53
+ const _ = $(c), q = A ? s : _ ?? s ?? "Select an option", g = t.buttonWidth, p = g ?? t.width ?? "100%", G = t.dropdownWidth ?? p;
54
+ return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
55
+ X.Provider,
55
56
  {
56
57
  value: {
57
58
  InputWrapper: {
58
- height: x || (i === "x-small" ? 24 : i === "small" ? 32 : 48),
59
- width: C,
60
- ...m ? { maxWidth: m } : {},
59
+ height: y || (n === "x-small" ? 24 : n === "small" ? 32 : 48),
60
+ width: p,
61
+ ...g ? { maxWidth: g } : {},
61
62
  zIndex: 1,
62
63
  cursor: "pointer",
63
- padding: i === "x-small" ? "4px 8px" : "6px 8px",
64
- backgroundColor: t.version === "3.0" ? c || y ? r.surface.hovered : r.surface.standard : f && l !== void 0 ? J.positive[100] : (
65
- // The hover wrapper also contains the popover, so while the
66
- // dropdown is open, hovering an option would grey the input
67
- // — only show hover feedback while closed.
68
- y && !c ? r.background.inactive : r.surface.standard
69
- ),
64
+ padding: n === "x-small" ? "4px 8px" : "6px 8px",
65
+ backgroundColor: o && a ? i.background.base : t.version === "3.0" ? u || C ? i.surface.hovered : i.surface.standard : m && d !== void 0 ? K.positive[100] : C ? i.background.inactive : i.surface.standard,
70
66
  transition: "background-color 0.3s ease",
71
- ...A
67
+ ...R
72
68
  },
73
69
  input: {
74
70
  minHeight: "100%",
75
71
  maxWidth: "100%",
76
- color: f && l !== void 0 ? r.content.positive : "inherit"
72
+ color: o && a ? i.content.secondary : m && d !== void 0 ? i.content.positive : "inherit"
77
73
  }
78
74
  },
79
- children: /* @__PURE__ */ n(
75
+ children: /* @__PURE__ */ r(
80
76
  "div",
81
77
  {
82
78
  onMouseEnter: () => I(!0),
83
79
  onMouseLeave: () => I(!1),
84
80
  style: t.width ? { width: t.width } : void 0,
85
- children: /* @__PURE__ */ W(
86
- Y,
81
+ children: /* @__PURE__ */ k(
82
+ Z,
87
83
  {
88
84
  "data-test": t["data-test"],
89
- ref: B,
90
- onSelect: N,
91
- disabled: v,
85
+ ref: N,
86
+ onSelect: U,
87
+ disabled: o,
92
88
  ...t,
93
89
  onDropdownVisbilityChange: (e) => {
94
- F(e), z?.(e);
90
+ B(e), F?.(e);
95
91
  },
96
- width: q,
92
+ width: G,
97
93
  children: [
98
- S == "default" && /* @__PURE__ */ n(
99
- $,
94
+ S == "default" && /* @__PURE__ */ r(
95
+ H,
100
96
  {
101
97
  version: t.version,
102
- noErrorHint: k,
103
- state: v ? "disabled" : "none",
104
- value: l === void 0 ? _ : l,
98
+ noErrorHint: w,
99
+ state: o ? "disabled" : "none",
100
+ solidDisabled: a,
101
+ value: d === void 0 ? q : d,
105
102
  errorMessage: t.error,
106
- variant: i,
107
- placeholder: a ?? "Select an option",
103
+ variant: n,
104
+ placeholder: s ?? "Select an option",
108
105
  onChangeText: O,
109
- leftIcon: L && s[0]?.leadingIcon ? {
110
- icon: () => /* @__PURE__ */ n(b, { children: s[0]?.leadingIcon })
106
+ leftIcon: V && c[0]?.leadingIcon ? {
107
+ icon: () => /* @__PURE__ */ r(W, { children: c[0]?.leadingIcon })
111
108
  } : void 0,
112
109
  rightIcon: {
113
- icon: () => /* @__PURE__ */ W(
110
+ icon: () => /* @__PURE__ */ k(
114
111
  "div",
115
112
  {
116
113
  style: {
117
114
  display: "flex"
118
115
  },
119
116
  children: [
120
- V && s[0]?.trailingIcon,
121
- /* @__PURE__ */ n(
122
- K,
117
+ j && c[0]?.trailingIcon,
118
+ /* @__PURE__ */ r(
119
+ Q,
123
120
  {
124
121
  style: {
125
- transform: c ? "rotate(180deg)" : "rotate(0deg)"
122
+ transform: u ? "rotate(180deg)" : "rotate(0deg)"
126
123
  },
127
124
  onClick: O,
128
- width: i === "x-small" ? 16 : i === "small" ? 20 : 24,
129
- height: i === "x-small" ? 16 : i === "small" ? 20 : 24,
130
- color: f ? r.content.positive : r.content.primary
125
+ width: n === "x-small" ? 16 : n === "small" ? 20 : 24,
126
+ height: n === "x-small" ? 16 : n === "small" ? 20 : 24,
127
+ color: m ? i.content.positive : i.content.primary
131
128
  }
132
129
  )
133
130
  ]
134
131
  }
135
132
  )
136
133
  },
137
- truncateText: T ?? !0
134
+ truncateText: L ?? !0
138
135
  }
139
136
  ),
140
- S == "chip" && /* @__PURE__ */ n(
141
- X,
137
+ S == "chip" && /* @__PURE__ */ r(
138
+ Y,
142
139
  {
143
- placeholder: a ?? "Select options",
144
- chips: s,
140
+ placeholder: s ?? "Select options",
141
+ placeholderColor: o && a ? i.content.secondary : void 0,
142
+ chips: c,
145
143
  onDeleteChip: (e) => {
146
- R?.(e);
144
+ T?.(e);
147
145
  },
148
146
  errorMessage: t.error,
149
- isDropdownOpened: c,
150
- sizeToUse: i,
147
+ isDropdownOpened: u,
148
+ sizeToUse: n,
151
149
  containerStyle: {
152
150
  width: t.width ?? "100%",
153
- cursor: "pointer"
151
+ cursor: "pointer",
152
+ ...o && a ? {
153
+ backgroundColor: i.background.base,
154
+ pointerEvents: "none"
155
+ } : {}
154
156
  },
155
- showLabelsOnMoreHover: j
157
+ showLabelsOnMoreHover: z
156
158
  }
157
159
  )
158
160
  ]
@@ -163,8 +165,8 @@ const H = ({
163
165
  }
164
166
  ) });
165
167
  };
166
- H.displayName = "Dropdown";
168
+ D.displayName = "Dropdown";
167
169
  export {
168
- H as Dropdown
170
+ D as Dropdown
169
171
  };
170
172
  //# sourceMappingURL=Dropdown.js.map