@lax-wp/design-system 0.13.33 → 0.13.34

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 (157) hide show
  1. package/dist/components/button/Button.cjs.js +5 -5
  2. package/dist/components/button/Button.cjs.js.map +1 -1
  3. package/dist/components/button/Button.es.js +18 -18
  4. package/dist/components/button/Button.es.js.map +1 -1
  5. package/dist/components/button/IconButton.cjs.js +1 -1
  6. package/dist/components/button/IconButton.cjs.js.map +1 -1
  7. package/dist/components/button/IconButton.es.js +8 -8
  8. package/dist/components/button/IconButton.es.js.map +1 -1
  9. package/dist/components/buttons/option-button/OptionButton.cjs.js +1 -1
  10. package/dist/components/buttons/option-button/OptionButton.cjs.js.map +1 -1
  11. package/dist/components/buttons/option-button/OptionButton.es.js +1 -1
  12. package/dist/components/buttons/option-button/OptionButton.es.js.map +1 -1
  13. package/dist/components/data-display/comparison/components/Header.cjs.js +1 -1
  14. package/dist/components/data-display/comparison/components/Header.cjs.js.map +1 -1
  15. package/dist/components/data-display/comparison/components/Header.es.js +13 -13
  16. package/dist/components/data-display/comparison/components/Header.es.js.map +1 -1
  17. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js +1 -1
  18. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js.map +1 -1
  19. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js +1 -1
  20. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
  21. package/dist/components/data-display/infinite-table/body/rows/index.cjs.js +1 -1
  22. package/dist/components/data-display/infinite-table/body/rows/index.cjs.js.map +1 -1
  23. package/dist/components/data-display/infinite-table/body/rows/index.es.js +104 -101
  24. package/dist/components/data-display/infinite-table/body/rows/index.es.js.map +1 -1
  25. package/dist/components/data-display/infinite-table/constants.cjs.js +1 -1
  26. package/dist/components/data-display/infinite-table/constants.cjs.js.map +1 -1
  27. package/dist/components/data-display/infinite-table/constants.d.ts +6 -0
  28. package/dist/components/data-display/infinite-table/constants.es.js +17 -16
  29. package/dist/components/data-display/infinite-table/constants.es.js.map +1 -1
  30. package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
  31. package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
  32. package/dist/components/data-display/infinite-table/index.es.js +188 -187
  33. package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
  34. package/dist/components/data-display/infinite-table/useRowHeight.cjs.js +2 -0
  35. package/dist/components/data-display/infinite-table/useRowHeight.cjs.js.map +1 -0
  36. package/dist/components/data-display/infinite-table/useRowHeight.d.ts +15 -0
  37. package/dist/components/data-display/infinite-table/useRowHeight.es.js +24 -0
  38. package/dist/components/data-display/infinite-table/useRowHeight.es.js.map +1 -0
  39. package/dist/components/data-display/tag/Tag.cjs.js +1 -1
  40. package/dist/components/data-display/tag/Tag.cjs.js.map +1 -1
  41. package/dist/components/data-display/tag/Tag.es.js +11 -9
  42. package/dist/components/data-display/tag/Tag.es.js.map +1 -1
  43. package/dist/components/floating-bar/FloatingBar.cjs.js +1 -1
  44. package/dist/components/floating-bar/FloatingBar.cjs.js.map +1 -1
  45. package/dist/components/floating-bar/FloatingBar.es.js +9 -9
  46. package/dist/components/floating-bar/FloatingBar.es.js.map +1 -1
  47. package/dist/components/forms/base-input-field/BaseInputField.cjs.js +2 -2
  48. package/dist/components/forms/base-input-field/BaseInputField.cjs.js.map +1 -1
  49. package/dist/components/forms/base-input-field/BaseInputField.es.js +40 -42
  50. package/dist/components/forms/base-input-field/BaseInputField.es.js.map +1 -1
  51. package/dist/components/forms/creatable-select/CreatableSelect.cjs.js +1 -1
  52. package/dist/components/forms/creatable-select/CreatableSelect.cjs.js.map +1 -1
  53. package/dist/components/forms/creatable-select/CreatableSelect.es.js +14 -15
  54. package/dist/components/forms/creatable-select/CreatableSelect.es.js.map +1 -1
  55. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
  56. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
  57. package/dist/components/forms/currency-input/CurrencyInputField.es.js +57 -65
  58. package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
  59. package/dist/components/forms/date-time-field/DateTimeField.cjs.js +1 -1
  60. package/dist/components/forms/date-time-field/DateTimeField.cjs.js.map +1 -1
  61. package/dist/components/forms/date-time-field/DateTimeField.es.js +33 -33
  62. package/dist/components/forms/date-time-field/DateTimeField.es.js.map +1 -1
  63. package/dist/components/forms/debounce-input/DebounceInputField.cjs.js +1 -1
  64. package/dist/components/forms/debounce-input/DebounceInputField.cjs.js.map +1 -1
  65. package/dist/components/forms/debounce-input/DebounceInputField.es.js +2 -2
  66. package/dist/components/forms/debounce-input/DebounceInputField.es.js.map +1 -1
  67. package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js +1 -1
  68. package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js.map +1 -1
  69. package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js +7 -7
  70. package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js.map +1 -1
  71. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js +1 -1
  72. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js.map +1 -1
  73. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js +17 -19
  74. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js.map +1 -1
  75. package/dist/components/forms/field-options/Item.cjs.js +1 -1
  76. package/dist/components/forms/field-options/Item.cjs.js.map +1 -1
  77. package/dist/components/forms/field-options/Item.es.js +5 -5
  78. package/dist/components/forms/field-options/Item.es.js.map +1 -1
  79. package/dist/components/forms/formula-input/FormulaInput.cjs.js +1 -1
  80. package/dist/components/forms/formula-input/FormulaInput.cjs.js.map +1 -1
  81. package/dist/components/forms/formula-input/FormulaInput.es.js +10 -10
  82. package/dist/components/forms/formula-input/FormulaInput.es.js.map +1 -1
  83. package/dist/components/forms/icon-picker/IconPicker.cjs.js +1 -1
  84. package/dist/components/forms/icon-picker/IconPicker.cjs.js.map +1 -1
  85. package/dist/components/forms/icon-picker/IconPicker.es.js +42 -57
  86. package/dist/components/forms/icon-picker/IconPicker.es.js.map +1 -1
  87. package/dist/components/forms/input-field/InputField.cjs.js.map +1 -1
  88. package/dist/components/forms/input-field/InputField.es.js.map +1 -1
  89. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js +1 -1
  90. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js.map +1 -1
  91. package/dist/components/forms/master-data-input/MasterDataInputField.es.js +54 -60
  92. package/dist/components/forms/master-data-input/MasterDataInputField.es.js.map +1 -1
  93. package/dist/components/forms/md-input/RichMarkdownInput.cjs.js +3 -3
  94. package/dist/components/forms/md-input/RichMarkdownInput.cjs.js.map +1 -1
  95. package/dist/components/forms/md-input/RichMarkdownInput.es.js +63 -63
  96. package/dist/components/forms/md-input/RichMarkdownInput.es.js.map +1 -1
  97. package/dist/components/forms/number-input-field/NumberInputField.cjs.js +1 -1
  98. package/dist/components/forms/number-input-field/NumberInputField.cjs.js.map +1 -1
  99. package/dist/components/forms/number-input-field/NumberInputField.es.js +5 -5
  100. package/dist/components/forms/number-input-field/NumberInputField.es.js.map +1 -1
  101. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js +2 -2
  102. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js.map +1 -1
  103. package/dist/components/forms/percentage-input/PercentageInputField.es.js +20 -20
  104. package/dist/components/forms/percentage-input/PercentageInputField.es.js.map +1 -1
  105. package/dist/components/forms/search-bar/SearchBar.cjs.js +1 -1
  106. package/dist/components/forms/search-bar/SearchBar.cjs.js.map +1 -1
  107. package/dist/components/forms/search-bar/SearchBar.es.js +16 -16
  108. package/dist/components/forms/search-bar/SearchBar.es.js.map +1 -1
  109. package/dist/components/forms/select-field/SelectField.cjs.js +2 -2
  110. package/dist/components/forms/select-field/SelectField.cjs.js.map +1 -1
  111. package/dist/components/forms/select-field/SelectField.d.ts +4 -0
  112. package/dist/components/forms/select-field/SelectField.es.js +202 -203
  113. package/dist/components/forms/select-field/SelectField.es.js.map +1 -1
  114. package/dist/components/forms/text-area-field/TextAreaField.cjs.js +1 -1
  115. package/dist/components/forms/text-area-field/TextAreaField.cjs.js.map +1 -1
  116. package/dist/components/forms/text-area-field/TextAreaField.es.js +14 -14
  117. package/dist/components/forms/text-area-field/TextAreaField.es.js.map +1 -1
  118. package/dist/components/forms/toggle/Toggle.cjs.js +1 -1
  119. package/dist/components/forms/toggle/Toggle.cjs.js.map +1 -1
  120. package/dist/components/forms/toggle/Toggle.es.js +65 -59
  121. package/dist/components/forms/toggle/Toggle.es.js.map +1 -1
  122. package/dist/components/navigation/accordion/Accordion.cjs.js +1 -1
  123. package/dist/components/navigation/accordion/Accordion.cjs.js.map +1 -1
  124. package/dist/components/navigation/accordion/Accordion.es.js +5 -5
  125. package/dist/components/navigation/accordion/Accordion.es.js.map +1 -1
  126. package/dist/components/navigation/stepper/Stepper.cjs.js +1 -1
  127. package/dist/components/navigation/stepper/Stepper.cjs.js.map +1 -1
  128. package/dist/components/navigation/stepper/Stepper.es.js +1 -1
  129. package/dist/components/navigation/stepper/Stepper.es.js.map +1 -1
  130. package/dist/components/navigation/tabs/TabOptions.cjs.js +1 -1
  131. package/dist/components/navigation/tabs/TabOptions.cjs.js.map +1 -1
  132. package/dist/components/navigation/tabs/TabOptions.es.js +15 -15
  133. package/dist/components/navigation/tabs/TabOptions.es.js.map +1 -1
  134. package/dist/components/navigation/tabs/TabSwitch.cjs.js +1 -1
  135. package/dist/components/navigation/tabs/TabSwitch.cjs.js.map +1 -1
  136. package/dist/components/navigation/tabs/TabSwitch.es.js +7 -7
  137. package/dist/components/navigation/tabs/TabSwitch.es.js.map +1 -1
  138. package/dist/components/navigation/tabs/Tabs.cjs.js +1 -1
  139. package/dist/components/navigation/tabs/Tabs.cjs.js.map +1 -1
  140. package/dist/components/navigation/tabs/Tabs.es.js +1 -1
  141. package/dist/components/navigation/tabs/Tabs.es.js.map +1 -1
  142. package/dist/components/tooltip/Tooltip.cjs.js +1 -1
  143. package/dist/components/tooltip/Tooltip.cjs.js.map +1 -1
  144. package/dist/components/tooltip/Tooltip.es.js +19 -19
  145. package/dist/components/tooltip/Tooltip.es.js.map +1 -1
  146. package/dist/components/user-avatar/UserAvatar.cjs.js +1 -1
  147. package/dist/components/user-avatar/UserAvatar.cjs.js.map +1 -1
  148. package/dist/components/user-avatar/UserAvatar.d.ts +1 -1
  149. package/dist/components/user-avatar/UserAvatar.es.js +40 -38
  150. package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
  151. package/dist/components/user-avatar/constants.cjs.js +1 -1
  152. package/dist/components/user-avatar/constants.cjs.js.map +1 -1
  153. package/dist/components/user-avatar/constants.d.ts +1 -0
  154. package/dist/components/user-avatar/constants.es.js +10 -9
  155. package/dist/components/user-avatar/constants.es.js.map +1 -1
  156. package/dist/design-system.css +1 -1
  157. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.cjs.js","sources":["../../../../src/components/forms/search-bar/SearchBar.tsx"],"sourcesContent":["import {type FC, type HTMLAttributes, useRef, useState } from 'react';\nimport { DebounceInput } from 'react-debounce-input';\nimport { useTranslation } from 'react-i18next';\nimport { Tooltip } from 'antd';\nimport cn from 'classnames';\nimport { Typography } from '../../data-display/typography/Typography';\nimport { CloseRounded } from '../../icons/CloseRounded';\nimport { SearchIcon } from '../../icons/SearchIcon';\n\nexport type TSearchConfig = {\n searchCount?: number;\n searchPointer?: number;\n setSearchPointer?: React.Dispatch<React.SetStateAction<number | undefined>>;\n};\n\nexport type TSearchBarProps = Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> & {\n value?: string;\n onChange?(value: string): void;\n debounceTimeout?: number;\n classValues?: string;\n handleKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n isClearable?: boolean;\n id: string;\n onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\n onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;\n isAnimated?: boolean;\n onFocusText?: string;\n autoComplete?: string;\n searchRef?: React.RefObject<HTMLInputElement>;\n placeholder?: string;\n autoFocus?: boolean;\n hasNavigation?: boolean;\n searchConfig?: TSearchConfig;\n hideSearchIcon?: boolean;\n allowAStarSearch?: boolean;\n};\n\nexport const SearchBar: FC<TSearchBarProps> = (props) => {\n const {\n value,\n placeholder,\n onChange,\n id,\n debounceTimeout = 0,\n classValues,\n handleKeyDown,\n isClearable,\n onFocusText,\n autoComplete = 'false',\n searchRef,\n hasNavigation = false,\n autoFocus = false,\n searchConfig,\n hideSearchIcon,\n allowAStarSearch = false,\n ...inputProps\n } = props;\n\n const { t } = useTranslation();\n const [isFocused, setIsFocused] = useState(false);\n const [focusedPlaceHolder, setFocusedPlaceHolder] = useState('search');\n const inputRef = useRef<HTMLInputElement>(null);\n const { searchCount, searchPointer, setSearchPointer } = searchConfig || {};\n\n const getRightPadding = () => {\n const hasClearButton = isClearable && !!value;\n const hasNav = hasNavigation && !!value;\n if (hasClearButton && hasNav) return 'pr-28';\n if (hasNav) return 'pr-12';\n if (hasClearButton) return 'pr-8';\n return 'pr-7';\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n setFocusedPlaceHolder(onFocusText || placeholder || t('Search'));\n const ref = searchRef || inputRef;\n if (ref.current) {\n ref.current.focus();\n }\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n setFocusedPlaceHolder('');\n };\n\n return (\n <label\n className={cn(\n `relative flex items-center justify-start px-4 py-[9px] w-full dark:bg-neutral-900 bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8`,\n classValues,\n )}\n >\n {!hideSearchIcon && (\n <div className='flex items-center h-6 w-6 pointer-events-none'>\n <SearchIcon width=\"16\" height=\"16\" />\n </div>\n )}\n\n <DebounceInput\n {...inputProps}\n spellCheck='false'\n debounceTimeout={debounceTimeout}\n id={id}\n inputRef={searchRef || inputRef}\n type='text'\n className={cn(\n `absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${hideSearchIcon ? 'pl-2' : 'pl-10'} pl-10 ${getRightPadding()} w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,\n 'border border-solid',\n 'dark:border-neutral-800 border-neutral-200',\n 'dark:caret-white',\n classValues,\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n handleKeyDown && handleKeyDown(e);\n }}\n value={value || ''}\n placeholder={isFocused ? focusedPlaceHolder : allowAStarSearch ? '' : `${t('Search')}`}\n onChange={(e) => onChange?.(e.target.value)}\n autoComplete={autoComplete}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n handleFocus();\n if (props.onFocus) props.onFocus(e);\n }}\n onBlur={(e) => {\n setIsFocused(false);\n handleBlur();\n if (props.onBlur) props.onBlur(e);\n }}\n autoFocus={autoFocus}\n />\n\n {hasNavigation && value && (\n <div className={cn('absolute mr-2 focus:outline-none flex gap-1', isClearable ? 'right-6' : 'right-0')}>\n {Boolean(searchCount) && (searchCount || 0) > 0 && (\n <span className='text-xs border-r pr-2 border-gray-200'>\n {(searchPointer || 0) + 1}/{searchCount}\n </span>\n )}\n <div className='flex gap-1 items-center'>\n <button\n id={`btn-search-bar-set-search-pointer-forward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) - 1);\n }}\n disabled={searchPointer === 0}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M15 18l-6-6 6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n <button\n id={`btn-search-bar-set-search-pointer-backward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) + 1);\n }}\n disabled={searchPointer === (searchCount || 0) - 1}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M9 18l6-6-6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n </div>\n </div>\n )}\n\n {allowAStarSearch && !(isClearable && value) && !isFocused && !value ? (\n <div className='absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none'>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>{t('Search')} (use</Typography>\n\n <button className=' bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5'>\n <Tooltip\n placement='bottomRight'\n color='#141414'\n classNames={{\n root: 'custom-tooltip dark:!bg-black-800',\n }}\n title={\n <div className='flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800'>\n <Typography variant='semibold' size='extra-small' className='text-white'>{t('Normal Search')}</Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n {t('Examples')}\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>data</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"data\", \"Data\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>text</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"text\", \"context\", \"plaintext\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>base</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"database\", \"baseball\", \"basename\".\n </Typography>\n </div>\n </div>\n <div className='h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2'></div>\n <Typography variant='semibold' size='extra-small' className='text-white'>Wildcard Search</Typography>\n <Typography variant='medium' size='extra-small' className='text-white dark:text-black-200' appearance='custom'>\n Use * as a wildcard to refine your search.\n </Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n Examples:\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ' appearance='custom'>\n contract*\n </Typography>\n </div>\n\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → \"contracts\", \"contractor\", \"CONTRACTOR\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ' appearance='custom'>\n *agreement\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"service agreement\", \"legal agreement\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n *clause*\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"clause\", \"subclause\", \"clauses\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>*l*s*</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"clause\", \"clauses\".\n </Typography>\n </div>\n </div>\n </div>\n }\n >\n <div className='text-[#475467] dark:text-black-300 dark:bg-black-600'>*</div>\n </Tooltip>\n </button>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>as a wildcard)</Typography>\n </div>\n ) : (\n isClearable &&\n value && (\n <button id={`btn-search-bar-close`} className='absolute right-0 mr-2 focus:outline-none' onClick={() => onChange?.('')}>\n <CloseRounded classValue='text-neutral-200 dark:text-black-500' size={16} />\n </button>\n )\n )}\n </label>\n );\n};\n\n"],"names":["SearchBar","props","value","placeholder","onChange","id","debounceTimeout","classValues","handleKeyDown","isClearable","onFocusText","autoComplete","searchRef","hasNavigation","autoFocus","searchConfig","hideSearchIcon","allowAStarSearch","inputProps","t","useTranslation","isFocused","setIsFocused","useState","focusedPlaceHolder","setFocusedPlaceHolder","inputRef","useRef","searchCount","searchPointer","setSearchPointer","getRightPadding","hasClearButton","hasNav","handleFocus","ref","handleBlur","jsxs","cn","jsx","SearchIcon","DebounceInput","e","state","Typography","Tooltip","CloseRounded"],"mappings":"wZAqCaA,EAAkCC,GAAU,CACv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AW,UAAU,sFAAsF,WAAW,SAAS,SAAA,OAAA,CAAK,EACvI,QACCA,EAAAA,WAAA,CAAW,UAAU,+EAA+E,WAAW,SAAS,SAAA,8BAAA,CAEzH,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EACF,EAGF,SAAAL,EAAAA,IAAC,MAAA,CAAI,UAAU,uDAAuD,SAAA,GAAA,CAAC,CAAA,CAAA,EAE3E,EACAA,EAAAA,IAACK,EAAAA,WAAA,CAAW,UAAU,8EAA8E,SAAA,gBAAA,CAAc,CAAA,CAAA,CACpH,EAEAnC,GACAP,GACEqC,MAAC,UAAO,GAAI,uBAAwB,UAAU,2CAA2C,QAAS,IAAMnC,IAAW,EAAE,EACnH,SAAAmC,MAACO,EAAAA,aAAA,CAAa,WAAW,uCAAuC,KAAM,GAAI,CAAA,CAC5E,CAAA,CAAA,CAAA,CAKV"}
1
+ {"version":3,"file":"SearchBar.cjs.js","sources":["../../../../src/components/forms/search-bar/SearchBar.tsx"],"sourcesContent":["import {type FC, type HTMLAttributes, useRef, useState } from 'react';\nimport { DebounceInput } from 'react-debounce-input';\nimport { useTranslation } from 'react-i18next';\nimport { Tooltip } from 'antd';\nimport cn from 'classnames';\nimport { Typography } from '../../data-display/typography/Typography';\nimport { CloseRounded } from '../../icons/CloseRounded';\nimport { SearchIcon } from '../../icons/SearchIcon';\n\nexport type TSearchConfig = {\n searchCount?: number;\n searchPointer?: number;\n setSearchPointer?: React.Dispatch<React.SetStateAction<number | undefined>>;\n};\n\nexport type TSearchBarProps = Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> & {\n value?: string;\n onChange?(value: string): void;\n debounceTimeout?: number;\n classValues?: string;\n handleKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n isClearable?: boolean;\n id: string;\n onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\n onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;\n isAnimated?: boolean;\n onFocusText?: string;\n autoComplete?: string;\n searchRef?: React.RefObject<HTMLInputElement>;\n placeholder?: string;\n autoFocus?: boolean;\n hasNavigation?: boolean;\n searchConfig?: TSearchConfig;\n hideSearchIcon?: boolean;\n allowAStarSearch?: boolean;\n};\n\nexport const SearchBar: FC<TSearchBarProps> = (props) => {\n const {\n value,\n placeholder,\n onChange,\n id,\n debounceTimeout = 0,\n classValues,\n handleKeyDown,\n isClearable,\n onFocusText,\n autoComplete = 'false',\n searchRef,\n hasNavigation = false,\n autoFocus = false,\n searchConfig,\n hideSearchIcon,\n allowAStarSearch = false,\n ...inputProps\n } = props;\n\n const { t } = useTranslation();\n const [isFocused, setIsFocused] = useState(false);\n const [focusedPlaceHolder, setFocusedPlaceHolder] = useState('search');\n const inputRef = useRef<HTMLInputElement>(null);\n const { searchCount, searchPointer, setSearchPointer } = searchConfig || {};\n\n const getRightPadding = () => {\n const hasClearButton = isClearable && !!value;\n const hasNav = hasNavigation && !!value;\n if (hasClearButton && hasNav) return 'pr-28';\n if (hasNav) return 'pr-12';\n if (hasClearButton) return 'pr-8';\n return 'pr-7';\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n setFocusedPlaceHolder(onFocusText || placeholder || t('Search'));\n const ref = searchRef || inputRef;\n if (ref.current) {\n ref.current.focus();\n }\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n setFocusedPlaceHolder('');\n };\n\n return (\n <label\n className={cn(\n `relative flex items-center justify-start px-4 py-[9px] w-full bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8`,\n classValues,\n )}\n >\n {!hideSearchIcon && (\n <div className='flex items-center h-6 w-6 pointer-events-none'>\n <SearchIcon width=\"16\" height=\"16\" />\n </div>\n )}\n\n <DebounceInput\n {...inputProps}\n spellCheck='false'\n debounceTimeout={debounceTimeout}\n id={id}\n inputRef={searchRef || inputRef}\n type='text'\n className={cn(\n `absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${hideSearchIcon ? 'pl-2' : 'pl-10'} pl-10 ${getRightPadding()} w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,\n 'border border-solid',\n 'dark:border-neutral-800 border-neutral-200',\n 'dark:caret-white',\n classValues,\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n handleKeyDown && handleKeyDown(e);\n }}\n value={value || ''}\n placeholder={isFocused ? focusedPlaceHolder : allowAStarSearch ? '' : `${t('Search')}`}\n onChange={(e) => onChange?.(e.target.value)}\n autoComplete={autoComplete}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n handleFocus();\n if (props.onFocus) props.onFocus(e);\n }}\n onBlur={(e) => {\n setIsFocused(false);\n handleBlur();\n if (props.onBlur) props.onBlur(e);\n }}\n autoFocus={autoFocus}\n />\n\n {hasNavigation && value && (\n <div className={cn('absolute mr-2 focus:outline-none flex gap-1', isClearable ? 'right-6' : 'right-0')}>\n {Boolean(searchCount) && (searchCount || 0) > 0 && (\n <span className='text-xs border-r pr-2 border-gray-200'>\n {(searchPointer || 0) + 1}/{searchCount}\n </span>\n )}\n <div className='flex gap-1 items-center'>\n <button\n id={`btn-search-bar-set-search-pointer-forward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) - 1);\n }}\n disabled={searchPointer === 0}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M15 18l-6-6 6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n <button\n id={`btn-search-bar-set-search-pointer-backward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) + 1);\n }}\n disabled={searchPointer === (searchCount || 0) - 1}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M9 18l6-6-6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n </div>\n </div>\n )}\n\n {allowAStarSearch && !(isClearable && value) && !isFocused && !value ? (\n <div className='absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none'>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>{t('Search')} (use</Typography>\n\n <button className=' bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5'>\n <Tooltip\n placement='bottomRight'\n color='#141414'\n classNames={{\n root: 'custom-tooltip dark:!bg-black-800',\n }}\n title={\n <div className='flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800 min-w-80 min-h-fit'>\n <Typography variant='semibold' size='extra-small' className='text-white'>{t('Normal Search')}</Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n {t('Examples')}\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>data</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"data\", \"Data\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>text</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"text\", \"context\", \"plaintext\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>base</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"database\", \"baseball\", \"basename\".\n </Typography>\n </div>\n </div>\n <div className='h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2'></div>\n <Typography variant='semibold' size='extra-small' className='text-white'>Wildcard Search</Typography>\n <Typography variant='medium' size='extra-small' className='text-white dark:text-black-200' appearance='custom'>\n Use * as a wildcard to refine your search.\n </Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n Examples:\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ' appearance='custom'>\n contract*\n </Typography>\n </div>\n\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → \"contracts\", \"contractor\", \"CONTRACTOR\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ' appearance='custom'>\n *agreement\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"service agreement\", \"legal agreement\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>\n *clause*\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"clause\", \"subclause\", \"clauses\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>*l*s*</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"clause\", \"clauses\".\n </Typography>\n </div>\n </div>\n </div>\n }\n >\n <div className='text-[#475467] dark:text-black-300 dark:bg-black-600'>*</div>\n </Tooltip>\n </button>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>as a wildcard)</Typography>\n </div>\n ) : (\n isClearable &&\n value && (\n <button id={`btn-search-bar-close`} className='absolute right-0 mr-2 focus:outline-none' onClick={() => onChange?.('')}>\n <CloseRounded classValue='text-neutral-200 dark:text-black-500' size={16} />\n </button>\n )\n )}\n </label>\n );\n};\n\n"],"names":["SearchBar","props","value","placeholder","onChange","id","debounceTimeout","classValues","handleKeyDown","isClearable","onFocusText","autoComplete","searchRef","hasNavigation","autoFocus","searchConfig","hideSearchIcon","allowAStarSearch","inputProps","t","useTranslation","isFocused","setIsFocused","useState","focusedPlaceHolder","setFocusedPlaceHolder","inputRef","useRef","searchCount","searchPointer","setSearchPointer","getRightPadding","hasClearButton","hasNav","handleFocus","ref","handleBlur","jsxs","cn","jsx","SearchIcon","DebounceInput","e","state","Typography","Tooltip","CloseRounded"],"mappings":"wZAqCaA,EAAkCC,GAAU,CACvD,KAAM,CACJ,MAAAC,EACA,YAAAC,EACA,SAAAC,EACA,GAAAC,EACA,gBAAAC,EAAkB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W,UAAU,0EAA0E,WAAW,SAAS,SAAA,8BAAA,CAEpH,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EACF,EAGF,SAAAL,EAAAA,IAAC,MAAA,CAAI,UAAU,uDAAuD,SAAA,GAAA,CAAC,CAAA,CAAA,EAE3E,EACAA,EAAAA,IAACK,EAAAA,WAAA,CAAW,UAAU,8EAA8E,SAAA,gBAAA,CAAc,CAAA,CAAA,CACpH,EAEAnC,GACAP,GACEqC,MAAC,UAAO,GAAI,uBAAwB,UAAU,2CAA2C,QAAS,IAAMnC,IAAW,EAAE,EACnH,SAAAmC,MAACO,EAAAA,aAAA,CAAa,WAAW,uCAAuC,KAAM,GAAI,CAAA,CAC5E,CAAA,CAAA,CAAA,CAKV"}
@@ -40,7 +40,7 @@ const Z = (n) => {
40
40
  "label",
41
41
  {
42
42
  className: u(
43
- "relative flex items-center justify-start px-4 py-[9px] w-full dark:bg-neutral-900 bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",
43
+ "relative flex items-center justify-start px-4 py-[9px] w-full bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",
44
44
  f
45
45
  ),
46
46
  children: [
@@ -121,24 +121,24 @@ const Z = (n) => {
121
121
  classNames: {
122
122
  root: "custom-tooltip dark:!bg-black-800"
123
123
  },
124
- title: /* @__PURE__ */ r("div", { className: "flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800", children: [
124
+ title: /* @__PURE__ */ r("div", { className: "flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800 min-w-80 min-h-fit", children: [
125
125
  /* @__PURE__ */ e(t, { variant: "semibold", size: "extra-small", className: "text-white", children: l("Normal Search") }),
126
126
  /* @__PURE__ */ e(t, { variant: "medium", size: "extra-small", className: "text-primary-400 dark:text-primary-400", appearance: "custom", children: l("Examples") }),
127
127
  /* @__PURE__ */ r("div", { className: "flex flex-col items-start justify-center ", children: [
128
128
  /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-1", children: [
129
129
  /* @__PURE__ */ e(t, { className: "flex-shrink-0", appearance: "custom", children: "•" }),
130
- /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: "data" }) }),
131
- /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: '→ finds "data", "Data".' })
130
+ /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter", appearance: "custom", children: "data" }) }),
131
+ /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-4 font-inter", appearance: "custom", children: '→ finds "data", "Data".' })
132
132
  ] }),
133
133
  /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-1", children: [
134
134
  /* @__PURE__ */ e(t, { className: "flex-shrink-0", appearance: "custom", children: "•" }),
135
- /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: "text" }) }),
136
- /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: '→ finds "text", "context", "plaintext".' })
135
+ /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter", appearance: "custom", children: "text" }) }),
136
+ /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-4 font-inter", appearance: "custom", children: '→ finds "text", "context", "plaintext".' })
137
137
  ] }),
138
138
  /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-1", children: [
139
139
  /* @__PURE__ */ e(t, { className: "flex-shrink-0", appearance: "custom", children: "•" }),
140
- /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: "base" }) }),
141
- /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: '→ finds "database", "baseball", "basename".' })
140
+ /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter", appearance: "custom", children: "base" }) }),
141
+ /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-4 font-inter", appearance: "custom", children: '→ finds "database", "baseball", "basename".' })
142
142
  ] })
143
143
  ] }),
144
144
  /* @__PURE__ */ e("div", { className: "h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2" }),
@@ -148,23 +148,23 @@ const Z = (n) => {
148
148
  /* @__PURE__ */ r("div", { className: "flex flex-col items-start justify-center ", children: [
149
149
  /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-1", children: [
150
150
  /* @__PURE__ */ e(t, { className: "flex-shrink-0", appearance: "custom", children: "•" }),
151
- /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ", appearance: "custom", children: "contract*" }) }),
152
- /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: '→ "contracts", "contractor", "CONTRACTOR".' })
151
+ /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ", appearance: "custom", children: "contract*" }) }),
152
+ /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-4 font-inter", appearance: "custom", children: '→ "contracts", "contractor", "CONTRACTOR".' })
153
153
  ] }),
154
154
  /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-1", children: [
155
155
  /* @__PURE__ */ e(t, { className: "flex-shrink-0", appearance: "custom", children: "•" }),
156
- /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ", appearance: "custom", children: "*agreement" }) }),
157
- /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: '→ finds "service agreement", "legal agreement".' })
156
+ /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ", appearance: "custom", children: "*agreement" }) }),
157
+ /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-4 font-inter", appearance: "custom", children: '→ finds "service agreement", "legal agreement".' })
158
158
  ] }),
159
159
  /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-1", children: [
160
160
  /* @__PURE__ */ e(t, { className: "flex-shrink-0", appearance: "custom", children: "•" }),
161
- /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: "*clause*" }) }),
162
- /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: '→ finds "clause", "subclause", "clauses".' })
161
+ /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter", appearance: "custom", children: "*clause*" }) }),
162
+ /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-4 font-inter", appearance: "custom", children: '→ finds "clause", "subclause", "clauses".' })
163
163
  ] }),
164
164
  /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-1", children: [
165
165
  /* @__PURE__ */ e(t, { className: "flex-shrink-0", appearance: "custom", children: "•" }),
166
- /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: "*l*s*" }) }),
167
- /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter", appearance: "custom", children: '→ finds "clause", "clauses".' })
166
+ /* @__PURE__ */ e("div", { className: "flex px-1 items-center justify-center bg-neutral-700 rounded-sm", children: /* @__PURE__ */ e(t, { className: "text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter", appearance: "custom", children: "*l*s*" }) }),
167
+ /* @__PURE__ */ e(t, { className: "text-white dark:text-black-100 text-xs font-medium leading-4 font-inter", appearance: "custom", children: '→ finds "clause", "clauses".' })
168
168
  ] })
169
169
  ] })
170
170
  ] }),
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.es.js","sources":["../../../../src/components/forms/search-bar/SearchBar.tsx"],"sourcesContent":["import {type FC, type HTMLAttributes, useRef, useState } from 'react';\nimport { DebounceInput } from 'react-debounce-input';\nimport { useTranslation } from 'react-i18next';\nimport { Tooltip } from 'antd';\nimport cn from 'classnames';\nimport { Typography } from '../../data-display/typography/Typography';\nimport { CloseRounded } from '../../icons/CloseRounded';\nimport { SearchIcon } from '../../icons/SearchIcon';\n\nexport type TSearchConfig = {\n searchCount?: number;\n searchPointer?: number;\n setSearchPointer?: React.Dispatch<React.SetStateAction<number | undefined>>;\n};\n\nexport type TSearchBarProps = Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> & {\n value?: string;\n onChange?(value: string): void;\n debounceTimeout?: number;\n classValues?: string;\n handleKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n isClearable?: boolean;\n id: string;\n onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\n onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;\n isAnimated?: boolean;\n onFocusText?: string;\n autoComplete?: string;\n searchRef?: React.RefObject<HTMLInputElement>;\n placeholder?: string;\n autoFocus?: boolean;\n hasNavigation?: boolean;\n searchConfig?: TSearchConfig;\n hideSearchIcon?: boolean;\n allowAStarSearch?: boolean;\n};\n\nexport const SearchBar: FC<TSearchBarProps> = (props) => {\n const {\n value,\n placeholder,\n onChange,\n id,\n debounceTimeout = 0,\n classValues,\n handleKeyDown,\n isClearable,\n onFocusText,\n autoComplete = 'false',\n searchRef,\n hasNavigation = false,\n autoFocus = false,\n searchConfig,\n hideSearchIcon,\n allowAStarSearch = false,\n ...inputProps\n } = props;\n\n const { t } = useTranslation();\n const [isFocused, setIsFocused] = useState(false);\n const [focusedPlaceHolder, setFocusedPlaceHolder] = useState('search');\n const inputRef = useRef<HTMLInputElement>(null);\n const { searchCount, searchPointer, setSearchPointer } = searchConfig || {};\n\n const getRightPadding = () => {\n const hasClearButton = isClearable && !!value;\n const hasNav = hasNavigation && !!value;\n if (hasClearButton && hasNav) return 'pr-28';\n if (hasNav) return 'pr-12';\n if (hasClearButton) return 'pr-8';\n return 'pr-7';\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n setFocusedPlaceHolder(onFocusText || placeholder || t('Search'));\n const ref = searchRef || inputRef;\n if (ref.current) {\n ref.current.focus();\n }\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n setFocusedPlaceHolder('');\n };\n\n return (\n <label\n className={cn(\n `relative flex items-center justify-start px-4 py-[9px] w-full dark:bg-neutral-900 bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8`,\n classValues,\n )}\n >\n {!hideSearchIcon && (\n <div className='flex items-center h-6 w-6 pointer-events-none'>\n <SearchIcon width=\"16\" height=\"16\" />\n </div>\n )}\n\n <DebounceInput\n {...inputProps}\n spellCheck='false'\n debounceTimeout={debounceTimeout}\n id={id}\n inputRef={searchRef || inputRef}\n type='text'\n className={cn(\n `absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${hideSearchIcon ? 'pl-2' : 'pl-10'} pl-10 ${getRightPadding()} w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,\n 'border border-solid',\n 'dark:border-neutral-800 border-neutral-200',\n 'dark:caret-white',\n classValues,\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n handleKeyDown && handleKeyDown(e);\n }}\n value={value || ''}\n placeholder={isFocused ? focusedPlaceHolder : allowAStarSearch ? '' : `${t('Search')}`}\n onChange={(e) => onChange?.(e.target.value)}\n autoComplete={autoComplete}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n handleFocus();\n if (props.onFocus) props.onFocus(e);\n }}\n onBlur={(e) => {\n setIsFocused(false);\n handleBlur();\n if (props.onBlur) props.onBlur(e);\n }}\n autoFocus={autoFocus}\n />\n\n {hasNavigation && value && (\n <div className={cn('absolute mr-2 focus:outline-none flex gap-1', isClearable ? 'right-6' : 'right-0')}>\n {Boolean(searchCount) && (searchCount || 0) > 0 && (\n <span className='text-xs border-r pr-2 border-gray-200'>\n {(searchPointer || 0) + 1}/{searchCount}\n </span>\n )}\n <div className='flex gap-1 items-center'>\n <button\n id={`btn-search-bar-set-search-pointer-forward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) - 1);\n }}\n disabled={searchPointer === 0}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M15 18l-6-6 6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n <button\n id={`btn-search-bar-set-search-pointer-backward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) + 1);\n }}\n disabled={searchPointer === (searchCount || 0) - 1}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M9 18l6-6-6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n </div>\n </div>\n )}\n\n {allowAStarSearch && !(isClearable && value) && !isFocused && !value ? (\n <div className='absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none'>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>{t('Search')} (use</Typography>\n\n <button className=' bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5'>\n <Tooltip\n placement='bottomRight'\n color='#141414'\n classNames={{\n root: 'custom-tooltip dark:!bg-black-800',\n }}\n title={\n <div className='flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800'>\n <Typography variant='semibold' size='extra-small' className='text-white'>{t('Normal Search')}</Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n {t('Examples')}\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>data</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"data\", \"Data\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>text</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"text\", \"context\", \"plaintext\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>base</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"database\", \"baseball\", \"basename\".\n </Typography>\n </div>\n </div>\n <div className='h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2'></div>\n <Typography variant='semibold' size='extra-small' className='text-white'>Wildcard Search</Typography>\n <Typography variant='medium' size='extra-small' className='text-white dark:text-black-200' appearance='custom'>\n Use * as a wildcard to refine your search.\n </Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n Examples:\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ' appearance='custom'>\n contract*\n </Typography>\n </div>\n\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → \"contracts\", \"contractor\", \"CONTRACTOR\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ' appearance='custom'>\n *agreement\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"service agreement\", \"legal agreement\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n *clause*\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"clause\", \"subclause\", \"clauses\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter' appearance='custom'>*l*s*</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter' appearance='custom'>\n → finds \"clause\", \"clauses\".\n </Typography>\n </div>\n </div>\n </div>\n }\n >\n <div className='text-[#475467] dark:text-black-300 dark:bg-black-600'>*</div>\n </Tooltip>\n </button>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>as a wildcard)</Typography>\n </div>\n ) : (\n isClearable &&\n value && (\n <button id={`btn-search-bar-close`} className='absolute right-0 mr-2 focus:outline-none' onClick={() => onChange?.('')}>\n <CloseRounded classValue='text-neutral-200 dark:text-black-500' size={16} />\n </button>\n )\n )}\n </label>\n );\n};\n\n"],"names":["SearchBar","props","value","placeholder","onChange","id","debounceTimeout","classValues","handleKeyDown","isClearable","onFocusText","autoComplete","searchRef","hasNavigation","autoFocus","searchConfig","hideSearchIcon","allowAStarSearch","inputProps","t","useTranslation","isFocused","setIsFocused","useState","focusedPlaceHolder","setFocusedPlaceHolder","inputRef","useRef","searchCount","searchPointer","setSearchPointer","getRightPadding","hasClearButton","hasNav","handleFocus","ref","handleBlur","jsxs","cn","jsx","SearchIcon","DebounceInput","e","state","Typography","Tooltip","CloseRounded"],"mappings":";;;;;;;;;AAqCO,MAAMA,IAAiC,CAACC,MAAU;AACvD,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,IAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,WAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,WAAAC,IAAY;AAAA,IACZ,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,GAAGC;AAAA,EAAA,IACDjB,GAEE,EAAE,GAAAkB,EAAA,IAAMC,EAAA,GACR,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAoBC,CAAqB,IAAIF,EAAS,QAAQ,GAC/DG,IAAWC,EAAyB,IAAI,GACxC,EAAE,aAAAC,GAAa,eAAAC,GAAe,kBAAAC,EAAA,IAAqBf,KAAgB,CAAA,GAEnEgB,IAAkB,MAAM;AAC5B,UAAMC,IAAiBvB,KAAe,CAAC,CAACP,GAClC+B,IAASpB,KAAiB,CAAC,CAACX;AAClC,WAAI8B,KAAkBC,IAAe,UACjCA,IAAe,UACfD,IAAuB,SACpB;AAAA,EACT,GAEME,IAAc,MAAM;AACxB,IAAAZ,EAAa,EAAI,GACjBG,EAAsBf,KAAeP,KAAegB,EAAE,QAAQ,CAAC;AAC/D,UAAMgB,IAAMvB,KAAac;AACzB,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FAA+E,YAAW,UAAS,UAAA,+BAAA,CAEzH;AAAA,kBAAA,EAAA,CACF;AAAA,gBAAA,EAAA,CACF;AAAA,cAAA,GACF;AAAA,cAGF,UAAA,gBAAAL,EAAC,OAAA,EAAI,WAAU,wDAAuD,UAAA,IAAA,CAAC;AAAA,YAAA;AAAA,UAAA,GAE3E;AAAA,UACA,gBAAAA,EAACK,GAAA,EAAW,WAAU,+EAA8E,UAAA,iBAAA,CAAc;AAAA,QAAA,EAAA,CACpH,IAEAnC,KACAP,KACE,gBAAAqC,EAAC,YAAO,IAAI,wBAAwB,WAAU,4CAA2C,SAAS,MAAMnC,IAAW,EAAE,GACnH,UAAA,gBAAAmC,EAACO,GAAA,EAAa,YAAW,wCAAuC,MAAM,IAAI,EAAA,CAC5E;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAKV;"}
1
+ {"version":3,"file":"SearchBar.es.js","sources":["../../../../src/components/forms/search-bar/SearchBar.tsx"],"sourcesContent":["import {type FC, type HTMLAttributes, useRef, useState } from 'react';\nimport { DebounceInput } from 'react-debounce-input';\nimport { useTranslation } from 'react-i18next';\nimport { Tooltip } from 'antd';\nimport cn from 'classnames';\nimport { Typography } from '../../data-display/typography/Typography';\nimport { CloseRounded } from '../../icons/CloseRounded';\nimport { SearchIcon } from '../../icons/SearchIcon';\n\nexport type TSearchConfig = {\n searchCount?: number;\n searchPointer?: number;\n setSearchPointer?: React.Dispatch<React.SetStateAction<number | undefined>>;\n};\n\nexport type TSearchBarProps = Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> & {\n value?: string;\n onChange?(value: string): void;\n debounceTimeout?: number;\n classValues?: string;\n handleKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n isClearable?: boolean;\n id: string;\n onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\n onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;\n isAnimated?: boolean;\n onFocusText?: string;\n autoComplete?: string;\n searchRef?: React.RefObject<HTMLInputElement>;\n placeholder?: string;\n autoFocus?: boolean;\n hasNavigation?: boolean;\n searchConfig?: TSearchConfig;\n hideSearchIcon?: boolean;\n allowAStarSearch?: boolean;\n};\n\nexport const SearchBar: FC<TSearchBarProps> = (props) => {\n const {\n value,\n placeholder,\n onChange,\n id,\n debounceTimeout = 0,\n classValues,\n handleKeyDown,\n isClearable,\n onFocusText,\n autoComplete = 'false',\n searchRef,\n hasNavigation = false,\n autoFocus = false,\n searchConfig,\n hideSearchIcon,\n allowAStarSearch = false,\n ...inputProps\n } = props;\n\n const { t } = useTranslation();\n const [isFocused, setIsFocused] = useState(false);\n const [focusedPlaceHolder, setFocusedPlaceHolder] = useState('search');\n const inputRef = useRef<HTMLInputElement>(null);\n const { searchCount, searchPointer, setSearchPointer } = searchConfig || {};\n\n const getRightPadding = () => {\n const hasClearButton = isClearable && !!value;\n const hasNav = hasNavigation && !!value;\n if (hasClearButton && hasNav) return 'pr-28';\n if (hasNav) return 'pr-12';\n if (hasClearButton) return 'pr-8';\n return 'pr-7';\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n setFocusedPlaceHolder(onFocusText || placeholder || t('Search'));\n const ref = searchRef || inputRef;\n if (ref.current) {\n ref.current.focus();\n }\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n setFocusedPlaceHolder('');\n };\n\n return (\n <label\n className={cn(\n `relative flex items-center justify-start px-4 py-[9px] w-full bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8`,\n classValues,\n )}\n >\n {!hideSearchIcon && (\n <div className='flex items-center h-6 w-6 pointer-events-none'>\n <SearchIcon width=\"16\" height=\"16\" />\n </div>\n )}\n\n <DebounceInput\n {...inputProps}\n spellCheck='false'\n debounceTimeout={debounceTimeout}\n id={id}\n inputRef={searchRef || inputRef}\n type='text'\n className={cn(\n `absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${hideSearchIcon ? 'pl-2' : 'pl-10'} pl-10 ${getRightPadding()} w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,\n 'border border-solid',\n 'dark:border-neutral-800 border-neutral-200',\n 'dark:caret-white',\n classValues,\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n handleKeyDown && handleKeyDown(e);\n }}\n value={value || ''}\n placeholder={isFocused ? focusedPlaceHolder : allowAStarSearch ? '' : `${t('Search')}`}\n onChange={(e) => onChange?.(e.target.value)}\n autoComplete={autoComplete}\n onFocus={(e: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n handleFocus();\n if (props.onFocus) props.onFocus(e);\n }}\n onBlur={(e) => {\n setIsFocused(false);\n handleBlur();\n if (props.onBlur) props.onBlur(e);\n }}\n autoFocus={autoFocus}\n />\n\n {hasNavigation && value && (\n <div className={cn('absolute mr-2 focus:outline-none flex gap-1', isClearable ? 'right-6' : 'right-0')}>\n {Boolean(searchCount) && (searchCount || 0) > 0 && (\n <span className='text-xs border-r pr-2 border-gray-200'>\n {(searchPointer || 0) + 1}/{searchCount}\n </span>\n )}\n <div className='flex gap-1 items-center'>\n <button\n id={`btn-search-bar-set-search-pointer-forward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) - 1);\n }}\n disabled={searchPointer === 0}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M15 18l-6-6 6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n <button\n id={`btn-search-bar-set-search-pointer-backward`}\n onClick={() => {\n if (setSearchPointer) setSearchPointer((state) => (state || 0) + 1);\n }}\n disabled={searchPointer === (searchCount || 0) - 1}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M9 18l6-6-6-6\" stroke=\"#98A2B3\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n </button>\n </div>\n </div>\n )}\n\n {allowAStarSearch && !(isClearable && value) && !isFocused && !value ? (\n <div className='absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none'>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>{t('Search')} (use</Typography>\n\n <button className=' bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5'>\n <Tooltip\n placement='bottomRight'\n color='#141414'\n classNames={{\n root: 'custom-tooltip dark:!bg-black-800',\n }}\n title={\n <div className='flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800 min-w-80 min-h-fit'>\n <Typography variant='semibold' size='extra-small' className='text-white'>{t('Normal Search')}</Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n {t('Examples')}\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>data</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"data\", \"Data\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>text</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"text\", \"context\", \"plaintext\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>base</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"database\", \"baseball\", \"basename\".\n </Typography>\n </div>\n </div>\n <div className='h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2'></div>\n <Typography variant='semibold' size='extra-small' className='text-white'>Wildcard Search</Typography>\n <Typography variant='medium' size='extra-small' className='text-white dark:text-black-200' appearance='custom'>\n Use * as a wildcard to refine your search.\n </Typography>\n <Typography variant='medium' size='extra-small' className='text-primary-400 dark:text-primary-400' appearance='custom'>\n Examples:\n </Typography>\n <div className='flex flex-col items-start justify-center '>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ' appearance='custom'>\n contract*\n </Typography>\n </div>\n\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → \"contracts\", \"contractor\", \"CONTRACTOR\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ' appearance='custom'>\n *agreement\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"service agreement\", \"legal agreement\".\n </Typography>\n </div>\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>\n *clause*\n </Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"clause\", \"subclause\", \"clauses\".\n </Typography>\n </div>\n\n <div className='flex items-center justify-center gap-1'>\n <Typography className='flex-shrink-0' appearance='custom'>\n •\n </Typography>\n <div className='flex px-1 items-center justify-center bg-neutral-700 rounded-sm'>\n <Typography className='text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter' appearance='custom'>*l*s*</Typography>\n </div>\n <Typography className='text-white dark:text-black-100 text-xs font-medium leading-4 font-inter' appearance='custom'>\n → finds \"clause\", \"clauses\".\n </Typography>\n </div>\n </div>\n </div>\n }\n >\n <div className='text-[#475467] dark:text-black-300 dark:bg-black-600'>*</div>\n </Tooltip>\n </button>\n <Typography className='text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5'>as a wildcard)</Typography>\n </div>\n ) : (\n isClearable &&\n value && (\n <button id={`btn-search-bar-close`} className='absolute right-0 mr-2 focus:outline-none' onClick={() => onChange?.('')}>\n <CloseRounded classValue='text-neutral-200 dark:text-black-500' size={16} />\n </button>\n )\n )}\n </label>\n );\n};\n\n"],"names":["SearchBar","props","value","placeholder","onChange","id","debounceTimeout","classValues","handleKeyDown","isClearable","onFocusText","autoComplete","searchRef","hasNavigation","autoFocus","searchConfig","hideSearchIcon","allowAStarSearch","inputProps","t","useTranslation","isFocused","setIsFocused","useState","focusedPlaceHolder","setFocusedPlaceHolder","inputRef","useRef","searchCount","searchPointer","setSearchPointer","getRightPadding","hasClearButton","hasNav","handleFocus","ref","handleBlur","jsxs","cn","jsx","SearchIcon","DebounceInput","e","state","Typography","Tooltip","CloseRounded"],"mappings":";;;;;;;;;AAqCO,MAAMA,IAAiC,CAACC,MAAU;AACvD,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,IA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AAW,EAAE,GACnH,UAAA,gBAAAmC,EAACO,GAAA,EAAa,YAAW,wCAAuC,MAAM,IAAI,EAAA,CAC5E;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAKV;"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),O=require("antd");;/* empty css */const k=require("../../../_virtual/index.cjs.js"),Ee=require("lodash/debounce"),u=require("react"),Ae=require("react-i18next"),Y=require("../../data-display/typography/Typography.cjs.js"),Pe=require("../../icons/HelpIcon.cjs.js"),Be=require("../../data-display/label/Label.cjs.js"),De=require("../../data-display/tag/Tag.cjs.js"),X=require("@mui/icons-material"),Le=require("../../icons/AIExtractedIndicator.cjs.js"),ze=require("../../icons/AIStarIcon.cjs.js"),Fe=require("../shared/InputLabel.cjs.js"),I=require("../../tooltip/Tooltip.cjs.js"),h=require("../../../utils/confidenceScoreUtils.cjs.js"),Te=c=>Array.isArray(c)?c.map(n=>typeof n=="string"||typeof n=="number"?n:n.value):c||null,Me=c=>c.filter((n,r,o)=>o.findIndex(b=>b.value===n.value&&b.label===n.label)===r),Oe=({options:c,value:n,defaultValue:r})=>c?.length?Me(c.map(o=>({...o,color:o.color}))):Array.isArray(n)&&n.length&&typeof n[0]=="object"&&"label"in n[0]?n.map(o=>({label:String(o?.label||""),value:String(o?.value||""),color:o?.color})):n&&typeof n=="object"&&"label"in n?[{label:String(n.label||""),value:String(n.value||""),color:n?.color}]:Array.isArray(r)&&r.length&&typeof r[0]=="object"&&"label"in r[0]?r.map(o=>({label:String(o?.label||""),value:String(o?.value||""),color:o?.color})):r&&typeof r=="object"&&"label"in r?[{label:String(r.label||""),value:String(r.value||""),color:r?.color}]:[],$e=({hasExistingData:c})=>t.jsx("div",{className:"!w-full px-3 py-1.5",children:c?t.jsx(O.Skeleton,{paragraph:{rows:1,width:"100%"}}):t.jsx(O.Skeleton,{})}),He=({showSelectAll:c,mode:n,options:r,searchValue:o,handleSelectAll:b,isAllSelected:y,menu:q,isLoading:E,hasExistingData:j,t:v})=>t.jsxs(t.Fragment,{children:[c&&n==="multiple"&&r.length>0&&o.trim().length===0&&t.jsx("div",{role:"button",tabIndex:0,className:"px-3 py-2 border-b border-gray-200 dark:border-gray-600 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700",onClick:f=>{f.stopPropagation(),b()},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),b())},children:t.jsx(Y.Typography,{size:"small",variant:"semibold",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:v(y?"Deselect all":"Select all")})}),q,E&&t.jsx($e,{hasExistingData:j})]}),Z=u.forwardRef(({label:c,value:n,mode:r,errorMessage:o,selectOptions:b=[],required:y=!1,tags:q,className:E,onInputChange:j,tooltip:v,originalCase:f=!1,isAiExtracted:G=!1,confidenceScore:A,confidenceType:S="high",confidenceTooltip:P,sourceMeta:V=[],onConfidenceScoreClick:ee,isGTN:B=!1,gtnName:te=null,onChange:g,onSearch:C,debounceTimeout:$=500,filterOption:le=!0,onScroll:re,isLoading:ae=!1,allowClear:ne=!0,autoClearSearchValue:oe=!0,fullOpacityLabel:Ke=!1,showAllTags:se=!1,customTagRender:ie,inputStyles:Re,disabled:D=!1,showSelectAll:ce=!1,labelClassName:ue,riskDetails:d,isRiskAnalysisOpen:m=!1,RiskDetailsCard:H,AddToDocumentIcon:_e,primaryColorShades:Je,UserAvatar:K,onAddGTNToDocument:R,isRequiredConditional:de,isLiveField:pe=!1,labelExtra:be,inputEmphasis:L="default",...x},fe)=>{const{t:_}=Ae.useTranslation(),[w,z]=u.useState(!1),me=L==="modified"&&!o&&!(m&&d?.color),ge=L==="deleted"&&!o&&!(m&&d?.color),xe=L==="success"&&!o&&!(m&&d?.color),he=u.useRef(null),[J,ye]=u.useState(!1),[ve,Se]=u.useState("");u.useEffect(()=>{const e="select-field-scrollbar-styles";if(document.getElementById(e))return;const l=document.createElement("style");l.id=e,l.textContent=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),M=require("antd");;/* empty css */const j=require("../../../_virtual/index.cjs.js"),Ae=require("lodash/debounce"),u=require("react"),Pe=require("react-i18next"),X=require("../../data-display/typography/Typography.cjs.js"),Be=require("../../icons/HelpIcon.cjs.js"),De=require("../../data-display/label/Label.cjs.js"),Le=require("../../data-display/tag/Tag.cjs.js"),W=require("@mui/icons-material"),_e=require("../../icons/AIExtractedIndicator.cjs.js"),ze=require("../../icons/AIStarIcon.cjs.js"),Te=require("../shared/InputLabel.cjs.js"),k=require("../../tooltip/Tooltip.cjs.js"),h=require("../../../utils/confidenceScoreUtils.cjs.js"),Fe={sm:"[&_.ant-select-selector]:!min-h-6",md:"[&_.ant-select-selector]:!min-h-8",lg:"[&_.ant-select-selector]:!min-h-10"},Me=i=>Array.isArray(i)?i.map(n=>typeof n=="string"||typeof n=="number"?n:n.value):i||null,Oe=i=>i.filter((n,r,s)=>s.findIndex(m=>m.value===n.value&&m.label===n.label)===r),He=({options:i,value:n,defaultValue:r})=>i?.length?Oe(i.map(s=>({...s,color:s.color}))):Array.isArray(n)&&n.length&&typeof n[0]=="object"&&"label"in n[0]?n.map(s=>({label:String(s?.label||""),value:String(s?.value||""),color:s?.color})):n&&typeof n=="object"&&"label"in n?[{label:String(n.label||""),value:String(n.value||""),color:n?.color}]:Array.isArray(r)&&r.length&&typeof r[0]=="object"&&"label"in r[0]?r.map(s=>({label:String(s?.label||""),value:String(s?.value||""),color:s?.color})):r&&typeof r=="object"&&"label"in r?[{label:String(r.label||""),value:String(r.value||""),color:r?.color}]:[],Ke=({hasExistingData:i})=>t.jsx("div",{className:"!w-full px-3 py-1.5",children:i?t.jsx(M.Skeleton,{paragraph:{rows:1,width:"100%"}}):t.jsx(M.Skeleton,{})}),Re=({showSelectAll:i,mode:n,options:r,searchValue:s,handleSelectAll:m,isAllSelected:y,menu:q,isLoading:E,hasExistingData:C,t:v})=>t.jsxs(t.Fragment,{children:[i&&n==="multiple"&&r.length>0&&s.trim().length===0&&t.jsx("div",{role:"button",tabIndex:0,className:"px-3 py-2 border-b border-gray-200 dark:border-gray-600 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700",onClick:b=>{b.stopPropagation(),m()},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),m())},children:t.jsx(X.Typography,{size:"small",variant:"semibold",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:v(y?"Deselect all":"Select all")})}),q,E&&t.jsx(Ke,{hasExistingData:C})]}),Y=u.forwardRef(({label:i,value:n,mode:r,errorMessage:s,selectOptions:m=[],required:y=!1,tags:q,className:E,onInputChange:C,tooltip:v,originalCase:b=!1,isAiExtracted:G=!1,confidenceScore:A,confidenceType:S="high",confidenceTooltip:P,sourceMeta:V=[],onConfidenceScoreClick:ee,isGTN:B=!1,gtnName:te=null,onChange:g,onSearch:w,debounceTimeout:O=500,filterOption:le=!0,onScroll:re,isLoading:ae=!1,allowClear:ne=!0,autoClearSearchValue:se=!0,fullOpacityLabel:$e=!1,showAllTags:oe=!1,customTagRender:ce,inputStyles:Je,disabled:D=!1,showSelectAll:ie=!1,labelClassName:ue,riskDetails:d,isRiskAnalysisOpen:f=!1,RiskDetailsCard:H,AddToDocumentIcon:Ue,primaryColorShades:Ze,UserAvatar:K,onAddGTNToDocument:R,isRequiredConditional:de,isLiveField:pe=!1,labelExtra:me,inputEmphasis:L="default",inputSize:be="md",...x},fe)=>{const{t:$}=Pe.useTranslation(),[N,_]=u.useState(!1),ge=L==="modified"&&!s&&!(f&&d?.color),xe=L==="deleted"&&!s&&!(f&&d?.color),he=L==="success"&&!s&&!(f&&d?.color),ye=u.useRef(null),[J,ve]=u.useState(!1),[Se,je]=u.useState("");u.useEffect(()=>{const e="select-field-scrollbar-styles";if(document.getElementById(e))return;const l=document.createElement("style");l.id=e,l.textContent=`
2
2
  [class*="virtual-list-scrollbar"]:not([class*="thumb"]) {
3
3
  width: 8px !important;
4
4
  background: transparent !important;
@@ -10,5 +10,5 @@
10
10
  .dark [class*="virtual-list-scrollbar-thumb"] {
11
11
  background: #454545 !important;
12
12
  }
13
- `,document.head.appendChild(l)},[]);const je=()=>{if(R){let e="";s==null?e="":typeof s=="string"||typeof s=="number"?e=String(s):Array.isArray(s)?e=s.map(a=>typeof a=="object"&&a!==null&&"value"in a?a.value:a).join(", "):typeof s=="object"&&"value"in s&&(e=String(s.value)),R({key:te,value:e})}},s=Te(n),Q=u.useMemo(()=>C?Ee(C,$):null,[C,$]),Ce=(e,l)=>{if(he.current&&x.id){const a=document.getElementById(x.id);if(a){const i=Array.isArray(l)?l.map(M=>M.value):l?.value;a.dataset.selectedValue=JSON.stringify(i);const F=new Event("change",{bubbles:!0});Object.defineProperty(F,"target",{writable:!1,value:a}),a.dispatchEvent(F);const T=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${x.id}`,value:i,type:"change"}});a.dispatchEvent(T)}}if(r==="tags"){const a=Array.isArray(e)?e:[e];g?.(a?.map(i=>({label:i,value:i})))}else g?.(l)},p=Oe({options:b,value:n,defaultValue:x?.defaultValue}),we=u.useMemo(()=>p.length>0||s!=null,[p,s]),U=u.useMemo(()=>{if(!r||r!=="multiple"||p.length===0)return!1;const e=Array.isArray(s)?s:[];return p.map(a=>a.value).every(a=>e.some(i=>typeof i=="object"&&i!==null&&"value"in i?String(i.value)===String(a):String(i)===String(a)))},[s,p,r]),Ne=()=>{!r||r!=="multiple"||!g||g(U?[]:p)},W=u.useCallback(e=>{if(!e)return;const l=new Event("submit",{bubbles:!0,cancelable:!0});e.dispatchEvent(l);const a=e.querySelector('button[type="submit"]');a&&a.click()},[]),ke=u.useCallback(e=>{if(e.key==="Enter"&&!J&&(e.preventDefault(),e.stopPropagation(),s)){const l=e.currentTarget.closest("form");W(l)}},[J,s,W]),Ie=u.useCallback(e=>{const{label:l,value:a,onClose:i}=e,T=p.find(N=>String(N.value)===String(a))?.color||"primary",M=N=>{N.preventDefault(),N.stopPropagation()};return t.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:t.jsx(De.Tag,{label:l,color:T,className:"!px-0.5 !py-0 !rounded",size:"md",onMouseDown:M,onClick:D?void 0:i,isHashColor:!0,removable:!0,onRemove:i})})},[p,D]),qe=u.useCallback(e=>{Se(e),(j||Q)?.(e)},[j,Q]);return t.jsxs("div",{ref:fe,className:k("flex gap-0.5 w-full relative",w&&B?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),id:x.id,children:[B&&!w?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:k("w-full flex flex-col gap-1 risk-analysis-select-field",E),onMouseDown:e=>e.stopPropagation(),onKeyDownCapture:ke,role:"group","aria-labelledby":c?"select-field-label":void 0,children:[c?t.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${f?"":"capitalize"} ${ue||""}`,children:t.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[t.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[t.jsx(Fe.InputLabel,{label:c||"",required:y||!1,isRequiredConditional:de||!1}),pe&&t.jsx(X.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),G&&!h.shouldShowConfidenceScore(A)&&t.jsx(Le.AIExtractedIndicator,{}),t.jsx(Be.Label,{labels:q}),v&&t.jsx(I,{placement:"top",title:v,children:t.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:t.jsx(Pe.HelpIcon,{})})}),be]}),t.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[h.shouldShowConfidenceScore(A)&&S?t.jsx(I,{placement:"top-end",title:P??"",hideTooltip:P==null,className:"cursor-pointer",children:t.jsxs("div",{className:k("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",h.getConfidenceScoreBadgeClass(S)),onClick:()=>ee?.(V),children:[t.jsx(ze.AIStarIcon,{size:12,fill:h.getConfidenceScoreBadgeColor(S),fillSecondary:h.getConfidenceScoreBadgeFill(S)}),t.jsxs("span",{className:k("text-xs font-medium leading-4",h.getConfidenceScoreBadgeTextColor(S)),children:[A,"%"]})]})}):null,B&&w?t.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:je,type:"button",children:t.jsx(I,{placement:"top",title:_("Add to document"),children:t.jsx(X.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}):null,t.jsx(O.Select,{onOpenChange:ye,disabled:D,className:`w-full text-black-900 dark:text-black-200 ${o&&y?"ant-select-status-error":"#e2e8f0"} ${m&&d?.color?"risk-select-field":""} ${me?"select-field-emphasis-modified":ge?"select-field-emphasis-deleted":xe?"select-field-emphasis-success":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":m&&d?.hexBgColor?d?.hexBgColor:"","--risk-border-color":m&&d?.hexBorderColor?d?.hexBorderColor:""},"aria-required":y,mode:r,value:s,onChange:Ce,filterOption:C?le:(e,l)=>(l?.label||"")?.toLowerCase()?.includes(e?.toLowerCase()),showSearch:!0,onSearch:qe||void 0,onPopupScroll:re,popupClassName:"select-field-dropdown-popup",popupRender:e=>t.jsx(He,{showSelectAll:ce,mode:r,options:p,searchValue:ve,handleSelectAll:Ne,isAllSelected:U,menu:e,isLoading:ae,hasExistingData:we,t:_}),options:p.map(({label:e,value:l,color:a,...i})=>({label:String(e),value:String(l),key:String(l),id:String(l),color:a,...i})),optionRender:e=>{const l=e?.data?.fullname;if(l&&K){const[a,i]=l.split(" ");return t.jsxs("div",{className:"flex items-center justify-start gap-1",children:[t.jsx(K,{firstName:a,lastName:i,profilePic:e?.data?.url||"",size:"xs",enablePopper:!0,userId:e?.data?.value}),t.jsx("span",{className:"ml-2",children:e.label})]})}return t.jsx("span",{children:e.label})},autoClearSearchValue:oe,onClear:()=>g&&g(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&se?void 0:"responsive",maxTagPlaceholder:e=>t.jsx(I,{placement:"top",title:e.length>3?e.slice(0,3).map(({label:l})=>l).join(", ")+"...":e.map(({label:l})=>l).join(", "),children:t.jsxs("span",{children:["+",e.length," more"]})}),tagRender:ie||Ie,allowClear:ne,...x}),o&&t.jsx(Y.Typography,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:o})]}),w&&d&&m&&H&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.preventDefault(),onKeyDown:e=>{e.key==="Escape"&&z(!1)},children:t.jsx(H,{riskDetails:d})})]})});Z.displayName="SelectField";exports.SelectField=Z;
13
+ `,document.head.appendChild(l)},[]);const Ce=()=>{if(R){let e="";o==null?e="":typeof o=="string"||typeof o=="number"?e=String(o):Array.isArray(o)?e=o.map(a=>typeof a=="object"&&a!==null&&"value"in a?a.value:a).join(", "):typeof o=="object"&&"value"in o&&(e=String(o.value)),R({key:te,value:e})}},o=Me(n),U=u.useMemo(()=>w?Ae(w,O):null,[w,O]),we=(e,l)=>{if(ye.current&&x.id){const a=document.getElementById(x.id);if(a){const c=Array.isArray(l)?l.map(F=>F.value):l?.value;a.dataset.selectedValue=JSON.stringify(c);const z=new Event("change",{bubbles:!0});Object.defineProperty(z,"target",{writable:!1,value:a}),a.dispatchEvent(z);const T=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${x.id}`,value:c,type:"change"}});a.dispatchEvent(T)}}if(r==="tags"){const a=Array.isArray(e)?e:[e];g?.(a?.map(c=>({label:c,value:c})))}else g?.(l)},p=He({options:m,value:n,defaultValue:x?.defaultValue}),Ne=u.useMemo(()=>p.length>0||o!=null,[p,o]),Z=u.useMemo(()=>{if(!r||r!=="multiple"||p.length===0)return!1;const e=Array.isArray(o)?o:[];return p.map(a=>a.value).every(a=>e.some(c=>typeof c=="object"&&c!==null&&"value"in c?String(c.value)===String(a):String(c)===String(a)))},[o,p,r]),Ie=()=>{!r||r!=="multiple"||!g||g(Z?[]:p)},Q=u.useCallback(e=>{if(!e)return;const l=new Event("submit",{bubbles:!0,cancelable:!0});e.dispatchEvent(l);const a=e.querySelector('button[type="submit"]');a&&a.click()},[]),ke=u.useCallback(e=>{if(e.key==="Enter"&&!J&&(e.preventDefault(),e.stopPropagation(),o)){const l=e.currentTarget.closest("form");Q(l)}},[J,o,Q]),qe=u.useCallback(e=>{const{label:l,value:a,onClose:c}=e,T=p.find(I=>String(I.value)===String(a))?.color||"primary",F=I=>{I.preventDefault(),I.stopPropagation()};return t.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:t.jsx(Le.Tag,{label:l,color:T,className:"!px-0.5 !py-0 !rounded",size:"md",onMouseDown:F,onClick:D?void 0:c,isHashColor:!0,removable:!0,onRemove:c})})},[p,D]),Ee=u.useCallback(e=>{je(e),(C||U)?.(e)},[C,U]);return t.jsxs("div",{ref:fe,className:j("flex gap-0.5 w-full relative",N&&B?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),id:x.id,children:[B&&!N?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:j("w-full flex flex-col gap-1 risk-analysis-select-field",E),onMouseDown:e=>e.stopPropagation(),onKeyDownCapture:ke,role:"group","aria-labelledby":i?"select-field-label":void 0,children:[i?t.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${b?"":"capitalize"} ${ue||""}`,children:t.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[t.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[t.jsx(Te.InputLabel,{label:i||"",required:y||!1,isRequiredConditional:de||!1}),pe&&t.jsx(W.BoltOutlined,{className:"!text-base text-primary-600 rotate-[15deg]"}),G&&!h.shouldShowConfidenceScore(A)&&t.jsx(_e.AIExtractedIndicator,{}),t.jsx(De.Label,{labels:q}),v&&t.jsx(k,{placement:"top",title:v,children:t.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:t.jsx(Be.HelpIcon,{className:"w-icon-sm h-icon-sm"})})}),me]}),t.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[h.shouldShowConfidenceScore(A)&&S?t.jsx(k,{placement:"top-end",title:P??"",hideTooltip:P==null,className:"cursor-pointer",children:t.jsxs("div",{className:j("inline-flex min-w-12 items-center gap-1 rounded-md px-1 py-0.5",h.getConfidenceScoreBadgeClass(S)),onClick:()=>ee?.(V),children:[t.jsx(ze.AIStarIcon,{size:12,fill:h.getConfidenceScoreBadgeColor(S),fillSecondary:h.getConfidenceScoreBadgeFill(S)}),t.jsxs("span",{className:j("text-xs font-medium leading-4",h.getConfidenceScoreBadgeTextColor(S)),children:[A,"%"]})]})}):null,B&&N?t.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:Ce,type:"button",children:t.jsx(k,{placement:"top",title:$("Add to document"),children:t.jsx(W.NoteAddOutlined,{className:"!text-base text-primary-600"})})}):null]})]})}):null,t.jsx(M.Select,{onOpenChange:ve,disabled:D,className:j("w-full h-8 flex items-center justify-center text-black-900 dark:text-black-200 text-sm",Fe[be],s&&y?"ant-select-status-error":"",f&&d?.color?"risk-select-field":"",ge?"select-field-emphasis-modified":xe?"select-field-emphasis-deleted":he?"select-field-emphasis-success":""),classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":f&&d?.hexBgColor?d?.hexBgColor:"","--risk-border-color":f&&d?.hexBorderColor?d?.hexBorderColor:""},"aria-required":y,mode:r,value:o,onChange:we,filterOption:w?le:(e,l)=>(l?.label||"")?.toLowerCase()?.includes(e?.toLowerCase()),showSearch:!0,onSearch:Ee||void 0,onPopupScroll:re,popupClassName:"select-field-dropdown-popup",popupRender:e=>t.jsx(Re,{showSelectAll:ie,mode:r,options:p,searchValue:Se,handleSelectAll:Ie,isAllSelected:Z,menu:e,isLoading:ae,hasExistingData:Ne,t:$}),options:p.map(({label:e,value:l,color:a,...c})=>({label:String(e),value:String(l),key:String(l),id:String(l),color:a,...c})),optionRender:e=>{const l=e?.data?.fullname;if(l&&K){const[a,c]=l.split(" ");return t.jsxs("div",{className:"flex items-center justify-start gap-1",children:[t.jsx(K,{firstName:a,lastName:c,profilePic:e?.data?.url||"",size:"xs",enablePopper:!0,userId:e?.data?.value}),t.jsx("span",{className:"ml-2",children:e.label})]})}return t.jsx("span",{children:e.label})},autoClearSearchValue:se,onClear:()=>g&&g(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&oe?void 0:"responsive",maxTagPlaceholder:e=>t.jsx(k,{placement:"top",title:e.length>3?e.slice(0,3).map(({label:l})=>l).join(", ")+"...":e.map(({label:l})=>l).join(", "),children:t.jsxs("span",{children:["+",e.length," more"]})}),tagRender:ce||qe,allowClear:ne,...x}),s&&t.jsx(X.Typography,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:s})]}),N&&d&&f&&H&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.preventDefault(),onKeyDown:e=>{e.key==="Escape"&&_(!1)},children:t.jsx(H,{riskDetails:d})})]})});Y.displayName="SelectField";exports.SelectField=Y;
14
14
  //# sourceMappingURL=SelectField.cjs.js.map