se-design 1.0.62-dev → 1.0.62

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 (291) hide show
  1. package/dist/assets/colors.css +9 -22
  2. package/dist/assets/icons/ai-off.svg +4 -4
  3. package/dist/assets/icons/command.svg +1 -1
  4. package/dist/assets/style.css +1 -1
  5. package/dist/components/BreadCrumbs/index.d.ts +0 -2
  6. package/dist/components/Button/index.d.ts +1 -5
  7. package/dist/components/InfoTooltip/index.d.ts +5 -1
  8. package/dist/index.js +21 -23
  9. package/dist/index.js.map +1 -1
  10. package/dist/index100.js +1 -1
  11. package/dist/index100.js.map +1 -1
  12. package/dist/index101.js +1 -1
  13. package/dist/index101.js.map +1 -1
  14. package/dist/index102.js +2 -2
  15. package/dist/index102.js.map +1 -1
  16. package/dist/index103.js +1 -1
  17. package/dist/index103.js.map +1 -1
  18. package/dist/index104.js +2 -2
  19. package/dist/index104.js.map +1 -1
  20. package/dist/index105.js +1 -1
  21. package/dist/index105.js.map +1 -1
  22. package/dist/index106.js +1 -1
  23. package/dist/index106.js.map +1 -1
  24. package/dist/index107.js +1 -1
  25. package/dist/index107.js.map +1 -1
  26. package/dist/index108.js +2 -2
  27. package/dist/index108.js.map +1 -1
  28. package/dist/index109.js +1 -1
  29. package/dist/index109.js.map +1 -1
  30. package/dist/index110.js +2 -2
  31. package/dist/index110.js.map +1 -1
  32. package/dist/index111.js +2 -2
  33. package/dist/index111.js.map +1 -1
  34. package/dist/index112.js +2 -2
  35. package/dist/index112.js.map +1 -1
  36. package/dist/index113.js +2 -2
  37. package/dist/index113.js.map +1 -1
  38. package/dist/index114.js +1 -1
  39. package/dist/index114.js.map +1 -1
  40. package/dist/index115.js +1 -1
  41. package/dist/index115.js.map +1 -1
  42. package/dist/index116.js +1 -1
  43. package/dist/index116.js.map +1 -1
  44. package/dist/index117.js +2 -2
  45. package/dist/index117.js.map +1 -1
  46. package/dist/index118.js +2 -2
  47. package/dist/index118.js.map +1 -1
  48. package/dist/index119.js +2 -2
  49. package/dist/index119.js.map +1 -1
  50. package/dist/index120.js +1 -1
  51. package/dist/index120.js.map +1 -1
  52. package/dist/index121.js +1 -1
  53. package/dist/index121.js.map +1 -1
  54. package/dist/index122.js +1 -1
  55. package/dist/index122.js.map +1 -1
  56. package/dist/index123.js +1 -1
  57. package/dist/index123.js.map +1 -1
  58. package/dist/index124.js +1 -1
  59. package/dist/index124.js.map +1 -1
  60. package/dist/index125.js +1 -1
  61. package/dist/index125.js.map +1 -1
  62. package/dist/index126.js +1 -1
  63. package/dist/index126.js.map +1 -1
  64. package/dist/index127.js +1 -1
  65. package/dist/index127.js.map +1 -1
  66. package/dist/index128.js +2 -2
  67. package/dist/index128.js.map +1 -1
  68. package/dist/index129.js +2 -2
  69. package/dist/index129.js.map +1 -1
  70. package/dist/index130.js +1 -1
  71. package/dist/index130.js.map +1 -1
  72. package/dist/index131.js +1 -1
  73. package/dist/index131.js.map +1 -1
  74. package/dist/index132.js +1 -1
  75. package/dist/index132.js.map +1 -1
  76. package/dist/index133.js +1 -1
  77. package/dist/index133.js.map +1 -1
  78. package/dist/index134.js +1 -1
  79. package/dist/index134.js.map +1 -1
  80. package/dist/index135.js +1 -1
  81. package/dist/index135.js.map +1 -1
  82. package/dist/index136.js +2 -2
  83. package/dist/index136.js.map +1 -1
  84. package/dist/index137.js +1 -1
  85. package/dist/index137.js.map +1 -1
  86. package/dist/index138.js +2 -2
  87. package/dist/index138.js.map +1 -1
  88. package/dist/index139.js +2 -2
  89. package/dist/index139.js.map +1 -1
  90. package/dist/index140.js +2 -2
  91. package/dist/index140.js.map +1 -1
  92. package/dist/index141.js +2 -2
  93. package/dist/index141.js.map +1 -1
  94. package/dist/index142.js +1 -1
  95. package/dist/index142.js.map +1 -1
  96. package/dist/index143.js +1 -1
  97. package/dist/index143.js.map +1 -1
  98. package/dist/index144.js +1 -1
  99. package/dist/index144.js.map +1 -1
  100. package/dist/index145.js +1 -1
  101. package/dist/index145.js.map +1 -1
  102. package/dist/index146.js +1 -1
  103. package/dist/index146.js.map +1 -1
  104. package/dist/index147.js +1 -1
  105. package/dist/index147.js.map +1 -1
  106. package/dist/index148.js +1 -1
  107. package/dist/index148.js.map +1 -1
  108. package/dist/index149.js +1 -1
  109. package/dist/index149.js.map +1 -1
  110. package/dist/index15.js +2 -2
  111. package/dist/index150.js +1 -1
  112. package/dist/index150.js.map +1 -1
  113. package/dist/index151.js +1 -1
  114. package/dist/index151.js.map +1 -1
  115. package/dist/index152.js +1 -1
  116. package/dist/index152.js.map +1 -1
  117. package/dist/index153.js +1 -1
  118. package/dist/index153.js.map +1 -1
  119. package/dist/index154.js +1 -1
  120. package/dist/index154.js.map +1 -1
  121. package/dist/index155.js +1 -1
  122. package/dist/index155.js.map +1 -1
  123. package/dist/index156.js +1 -1
  124. package/dist/index156.js.map +1 -1
  125. package/dist/index157.js +1 -1
  126. package/dist/index157.js.map +1 -1
  127. package/dist/index158.js +1 -1
  128. package/dist/index158.js.map +1 -1
  129. package/dist/index159.js +1 -1
  130. package/dist/index159.js.map +1 -1
  131. package/dist/index160.js +1 -1
  132. package/dist/index160.js.map +1 -1
  133. package/dist/index161.js +1 -1
  134. package/dist/index161.js.map +1 -1
  135. package/dist/index162.js +1 -1
  136. package/dist/index162.js.map +1 -1
  137. package/dist/index163.js +1 -1
  138. package/dist/index163.js.map +1 -1
  139. package/dist/index164.js +1 -1
  140. package/dist/index164.js.map +1 -1
  141. package/dist/index165.js +2 -2
  142. package/dist/index165.js.map +1 -1
  143. package/dist/index166.js +2 -2
  144. package/dist/index166.js.map +1 -1
  145. package/dist/index167.js +1 -1
  146. package/dist/index167.js.map +1 -1
  147. package/dist/index168.js +1 -1
  148. package/dist/index168.js.map +1 -1
  149. package/dist/index169.js +2 -2
  150. package/dist/index169.js.map +1 -1
  151. package/dist/index17.js +1 -1
  152. package/dist/index170.js +2 -2
  153. package/dist/index170.js.map +1 -1
  154. package/dist/index171.js +1 -1
  155. package/dist/index171.js.map +1 -1
  156. package/dist/index172.js +1 -1
  157. package/dist/index172.js.map +1 -1
  158. package/dist/index173.js +1 -1
  159. package/dist/index173.js.map +1 -1
  160. package/dist/index174.js +1 -1
  161. package/dist/index174.js.map +1 -1
  162. package/dist/index175.js +1 -1
  163. package/dist/index175.js.map +1 -1
  164. package/dist/index176.js +1 -1
  165. package/dist/index176.js.map +1 -1
  166. package/dist/index177.js +1 -1
  167. package/dist/index177.js.map +1 -1
  168. package/dist/index178.js +1 -1
  169. package/dist/index178.js.map +1 -1
  170. package/dist/index179.js +2 -2
  171. package/dist/index179.js.map +1 -1
  172. package/dist/index18.js +2 -2
  173. package/dist/index180.js +2 -2
  174. package/dist/index180.js.map +1 -1
  175. package/dist/index181.js +2 -2
  176. package/dist/index181.js.map +1 -1
  177. package/dist/index182.js +149 -2
  178. package/dist/index182.js.map +1 -1
  179. package/dist/index183.js +9 -149
  180. package/dist/index183.js.map +1 -1
  181. package/dist/index184.js +5 -8
  182. package/dist/index184.js.map +1 -1
  183. package/dist/index185.js +4 -5
  184. package/dist/index185.js.map +1 -1
  185. package/dist/index188.js +27 -0
  186. package/dist/index188.js.map +1 -0
  187. package/dist/index189.js +58 -20
  188. package/dist/index189.js.map +1 -1
  189. package/dist/index191.js +1 -1
  190. package/dist/index212.js +1 -1
  191. package/dist/index22.js +3 -3
  192. package/dist/index24.js +2 -2
  193. package/dist/index24.js.map +1 -1
  194. package/dist/index27.js +1 -1
  195. package/dist/index29.js +1 -1
  196. package/dist/index3.js +21 -23
  197. package/dist/index3.js.map +1 -1
  198. package/dist/index34.js +1 -1
  199. package/dist/index36.js +38 -35
  200. package/dist/index36.js.map +1 -1
  201. package/dist/index37.js +5 -4
  202. package/dist/index37.js.map +1 -1
  203. package/dist/index38.js +3 -3
  204. package/dist/index43.js +16 -16
  205. package/dist/index43.js.map +1 -1
  206. package/dist/index44.js +2 -2
  207. package/dist/index45.js +2 -2
  208. package/dist/index48.js +1 -1
  209. package/dist/index49.js +30 -48
  210. package/dist/index49.js.map +1 -1
  211. package/dist/index5.js +113 -113
  212. package/dist/index50.js +2 -2
  213. package/dist/index50.js.map +1 -1
  214. package/dist/index56.js +2 -2
  215. package/dist/index56.js.map +1 -1
  216. package/dist/index6.js +1 -1
  217. package/dist/index60.js +45 -39
  218. package/dist/index60.js.map +1 -1
  219. package/dist/index63.js +1 -1
  220. package/dist/index64.js +1 -1
  221. package/dist/index66.js +17 -19
  222. package/dist/index66.js.map +1 -1
  223. package/dist/index68.js +5 -55
  224. package/dist/index68.js.map +1 -1
  225. package/dist/index69.js +9 -5
  226. package/dist/index69.js.map +1 -1
  227. package/dist/index71.js +5 -0
  228. package/dist/index71.js.map +1 -0
  229. package/dist/index72.js +2 -2
  230. package/dist/index72.js.map +1 -1
  231. package/dist/index73.js +2 -2
  232. package/dist/index73.js.map +1 -1
  233. package/dist/index74.js +2 -2
  234. package/dist/index74.js.map +1 -1
  235. package/dist/index75.js +1 -1
  236. package/dist/index75.js.map +1 -1
  237. package/dist/index76.js +1 -1
  238. package/dist/index76.js.map +1 -1
  239. package/dist/index77.js +1 -1
  240. package/dist/index77.js.map +1 -1
  241. package/dist/index78.js +1 -1
  242. package/dist/index78.js.map +1 -1
  243. package/dist/index79.js +1 -1
  244. package/dist/index79.js.map +1 -1
  245. package/dist/index8.js +5 -5
  246. package/dist/index8.js.map +1 -1
  247. package/dist/index80.js +1 -1
  248. package/dist/index80.js.map +1 -1
  249. package/dist/index81.js +1 -1
  250. package/dist/index81.js.map +1 -1
  251. package/dist/index82.js +1 -1
  252. package/dist/index82.js.map +1 -1
  253. package/dist/index83.js +1 -1
  254. package/dist/index83.js.map +1 -1
  255. package/dist/index84.js +1 -1
  256. package/dist/index84.js.map +1 -1
  257. package/dist/index85.js +1 -1
  258. package/dist/index85.js.map +1 -1
  259. package/dist/index86.js +1 -1
  260. package/dist/index86.js.map +1 -1
  261. package/dist/index87.js +1 -1
  262. package/dist/index87.js.map +1 -1
  263. package/dist/index88.js +1 -1
  264. package/dist/index88.js.map +1 -1
  265. package/dist/index89.js +1 -1
  266. package/dist/index89.js.map +1 -1
  267. package/dist/index90.js +1 -1
  268. package/dist/index90.js.map +1 -1
  269. package/dist/index91.js +1 -1
  270. package/dist/index91.js.map +1 -1
  271. package/dist/index92.js +1 -1
  272. package/dist/index92.js.map +1 -1
  273. package/dist/index93.js +1 -1
  274. package/dist/index93.js.map +1 -1
  275. package/dist/index94.js +1 -1
  276. package/dist/index94.js.map +1 -1
  277. package/dist/index95.js +1 -1
  278. package/dist/index95.js.map +1 -1
  279. package/dist/index96.js +1 -1
  280. package/dist/index96.js.map +1 -1
  281. package/dist/index97.js +2 -2
  282. package/dist/index97.js.map +1 -1
  283. package/dist/index98.js +1 -1
  284. package/dist/index98.js.map +1 -1
  285. package/dist/index99.js +2 -2
  286. package/dist/index99.js.map +1 -1
  287. package/package.json +1 -1
  288. package/dist/index186.js +0 -8
  289. package/dist/index186.js.map +0 -1
  290. package/dist/index70.js +0 -12
  291. package/dist/index70.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index56.js","sources":["../src/components/OTPInput/index.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, KeyboardEvent, ChangeEvent, ClipboardEvent, FC } from 'react';\nimport { useStableId } from '../../utils/useStableId';\nimport './style.scss';\n\nexport interface OTPInputProps {\n length?: number;\n onChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n label?: string;\n disabled?: boolean;\n className?: string;\n autoFocus?: boolean;\n error?: boolean;\n errorMessage?: string;\n validateOnBlur?: boolean;\n onValidate?: (value: string) => boolean | string;\n id?: string;\n}\n\nexport const OTPInput: FC<OTPInputProps> = ({\n length = 6,\n onChange,\n onComplete,\n label,\n disabled = false,\n className = '',\n autoFocus = true,\n error = false,\n errorMessage,\n validateOnBlur = false,\n onValidate,\n id\n}) => {\n const [values, setValues] = useState<string[]>(Array(length).fill(''));\n const [internalError, setInternalError] = useState<string | null>(null);\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\n const isBackspacePressed = useRef<boolean>(false);\n \n // Generate stable IDs for ARIA attributes\n const baseId = useStableId(id, 'se-otp-input');\n const labelId = `${baseId}-label`;\n const errorId = `${baseId}-error`;\n\n // Helper: Check if a string is a single digit\n const isDigit = (char: string): boolean => /^\\d$/.test(char);\n\n // Helper: Check if OTP is complete\n const isComplete = (otpValue: string): boolean => {\n return otpValue.length === length && values.every((val) => val !== '');\n };\n\n // Helper: Update value at specific index\n const updateValue = (index: number, value: string, shouldFocusNext = false) => {\n const newValues = [...values];\n newValues[index] = value;\n setValues(newValues);\n\n if (shouldFocusNext && value && index < length - 1) {\n focusInput(index + 1);\n }\n };\n\n // Helper: Clear value at specific index\n const clearValue = (index: number) => {\n updateValue(index, '');\n };\n\n // Helper: Focus input at index\n const focusInput = (index: number) => {\n inputRefs.current[index]?.focus();\n };\n\n useEffect(() => {\n if (autoFocus && inputRefs.current[0] && !disabled) {\n focusInput(0);\n }\n }, [autoFocus, disabled]);\n\n // Internal validation\n const validateOTP = (otpValue: string): string | null => {\n // Empty validation\n if (otpValue.length === 0) {\n return errorMessage || 'Please enter the verification code';\n }\n\n // Incomplete validation\n if (otpValue.length < length || !isComplete(otpValue)) {\n return errorMessage || 'Please enter all digits';\n }\n\n // Custom validation\n if (onValidate) {\n const validationResult = onValidate(otpValue);\n if (validationResult === false) {\n return errorMessage || 'Invalid verification code';\n }\n if (typeof validationResult === 'string') {\n return validationResult;\n }\n }\n\n return null;\n };\n\n useEffect(() => {\n const otpValue = values.join('');\n onChange?.(otpValue);\n\n // Clear error when user starts typing\n if (internalError && otpValue.length > 0) {\n setInternalError(null);\n }\n\n if (isComplete(otpValue)) {\n // Validate on complete\n if (onValidate) {\n const validationResult = onValidate(otpValue);\n if (validationResult === false || typeof validationResult === 'string') {\n const errorMsg =\n typeof validationResult === 'string' ? validationResult : errorMessage || 'Invalid verification code';\n setInternalError(errorMsg);\n } else {\n setInternalError(null);\n }\n }\n onComplete?.(otpValue);\n }\n }, [values, length, onChange, onComplete, onValidate, errorMessage]);\n\n const handleChange = (index: number, value: string) => {\n // Only allow single digit or empty\n if (value && !isDigit(value)) {\n return;\n }\n\n updateValue(index, value, true);\n };\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n\n const currentValue = values[index];\n\n // Handle backspace\n if (e.key === 'Backspace') {\n isBackspacePressed.current = true;\n if (currentValue) {\n clearValue(index);\n } else if (index > 0) {\n clearValue(index - 1);\n focusInput(index - 1);\n }\n // Reset backspace flag after a short delay\n setTimeout(() => {\n isBackspacePressed.current = false;\n }, 100);\n e.preventDefault();\n return;\n }\n\n // Handle delete\n if (e.key === 'Delete') {\n isBackspacePressed.current = true;\n clearValue(index);\n // Reset backspace flag after a short delay\n setTimeout(() => {\n isBackspacePressed.current = false;\n }, 100);\n e.preventDefault();\n return;\n }\n\n // Handle navigation keys\n const navigationHandlers: Record<string, () => void> = {\n ArrowLeft: () => index > 0 && focusInput(index - 1),\n ArrowRight: () => index < length - 1 && focusInput(index + 1),\n Home: () => focusInput(0),\n End: () => focusInput(length - 1)\n };\n\n if (navigationHandlers[e.key]) {\n navigationHandlers[e.key]();\n e.preventDefault();\n return;\n }\n\n // Allow digits, but prevent if already filled\n if (isDigit(e.key)) {\n if (currentValue) {\n updateValue(index, e.key, true);\n }\n }\n };\n\n const handlePaste = (e: ClipboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n\n e.preventDefault();\n const pastedData = e.clipboardData.getData('text/plain').trim();\n\n // Extract only digits\n const digits = pastedData.replace(/\\D/g, '').slice(0, length);\n\n if (digits.length > 0) {\n const newValues = [...values];\n\n // Fill inputs starting from the current index\n const startIndex = inputRefs.current.findIndex((ref) => ref === document.activeElement);\n const actualStartIndex = startIndex >= 0 ? startIndex : 0;\n\n for (let i = 0; i < digits.length && actualStartIndex + i < length; i++) {\n newValues[actualStartIndex + i] = digits[i];\n }\n\n setValues(newValues);\n\n // Focus the next empty input or the last input\n const nextEmptyIndex = newValues.findIndex((val, idx) => idx >= actualStartIndex && val === '');\n const focusIndex = nextEmptyIndex >= 0 ? nextEmptyIndex : Math.min(actualStartIndex + digits.length, length - 1);\n focusInput(focusIndex);\n }\n };\n\n const handleFocus = (index: number) => {\n inputRefs.current[index]?.select();\n };\n\n const handleBlur = () => {\n // Don't validate on blur if backspace/delete was just pressed\n if (validateOnBlur && !isBackspacePressed.current) {\n const otpValue = values.join('');\n const validationError = validateOTP(otpValue);\n setInternalError(validationError);\n }\n };\n\n const hasError = error || !!internalError;\n // Priority: errorMessage prop > internalError\n const displayError = hasError && (errorMessage || internalError);\n \n const ariaDescribedByError = displayError ? errorId : undefined;\n\n return (\n <div className={`se-design-otp-input ${className || ''}`} data-automation-id=\"otp-input-container\">\n {label && <div id={labelId} className=\"se-design-otp-input-label\">{label}</div>}\n <div className=\"flex items-center gap-[12px]\" role=\"group\" aria-labelledby={label ? labelId : undefined}>\n {values.map((value, index) => (\n <input\n key={index}\n ref={(el) => {\n inputRefs.current[index] = el;\n }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={value}\n onChange={(e: ChangeEvent<HTMLInputElement>) => handleChange(index, e.target.value)}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => handleKeyDown(index, e)}\n onPaste={handlePaste}\n onFocus={() => handleFocus(index)}\n onBlur={handleBlur}\n disabled={disabled}\n className={`\n w-12 h-12 \n flex flex-col items-start \n text-center text-lg font-medium\n border rounded-md\n outline-none\n transition-colors\n disabled:bg-gray-50 disabled:cursor-not-allowed\n ${\n disabled\n ? 'border-[var(--color-gray-300)] text-gray-400'\n : hasError\n ? 'border-[var(--color-red-500)] text-gray-900 focus:border-[var(--color-red-500)] focus:ring-1 focus:ring-[var(--color-red-500)]'\n : 'border-[var(--color-gray-600)] text-gray-900 focus:border-[var(--color-blue-500)] focus:ring-1 focus:ring-[var(--color-blue-500)]'\n }\n `}\n style={{\n gap: 'var(--Spacer-6px, 6px)'\n }}\n aria-label={`OTP digit ${index + 1} of ${length}`}\n aria-invalid={hasError}\n aria-describedby={ariaDescribedByError}\n data-automation-id={`otp-input-${index}`}\n />\n ))}\n </div>\n {displayError && <div id={errorId} className=\"se-design-otp-input-error\" role=\"alert\">{displayError}</div>}\n </div>\n );\n};\n"],"names":["OTPInput","length","onChange","onComplete","label","disabled","className","autoFocus","error","errorMessage","validateOnBlur","onValidate","id","values","setValues","useState","Array","fill","internalError","setInternalError","inputRefs","useRef","isBackspacePressed","baseId","useStableId","labelId","errorId","isDigit","char","test","isComplete","otpValue","every","val","updateValue","index","value","shouldFocusNext","newValues","focusInput","clearValue","current","focus","useEffect","validateOTP","validationResult","join","handleChange","handleKeyDown","e","currentValue","key","setTimeout","preventDefault","navigationHandlers","ArrowLeft","ArrowRight","Home","End","handlePaste","digits","clipboardData","getData","trim","replace","slice","startIndex","findIndex","ref","document","activeElement","actualStartIndex","i","nextEmptyIndex","idx","focusIndex","Math","min","handleFocus","select","handleBlur","validationError","hasError","displayError","ariaDescribedByError","undefined","React","createElement","role","map","el","type","inputMode","maxLength","target","onKeyDown","onPaste","onFocus","onBlur","style","gap"],"mappings":";;;AAmBO,MAAMA,IAA8BA,CAAC;AAAA,EAC1CC,QAAAA,IAAS;AAAA,EACTC,UAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA,IAAY;AAAA,EACZC,WAAAA,IAAY;AAAA,EACZC,OAAAA,IAAQ;AAAA,EACRC,cAAAA;AAAAA,EACAC,gBAAAA,IAAiB;AAAA,EACjBC,YAAAA;AAAAA,EACAC,IAAAA;AACF,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAmBC,MAAMf,CAAM,EAAEgB,KAAK,EAAE,CAAC,GAC/D,CAACC,GAAeC,CAAgB,IAAIJ,EAAwB,IAAI,GAChEK,IAAYC,EAAoC,EAAE,GAClDC,IAAqBD,EAAgB,EAAK,GAG1CE,IAASC,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IACA,mIAAmI;AAAA;AAAA,IAG3IiB,OAAO;AAAA,MACLC,KAAK;AAAA,IAAA;AAAA,IAEP,cAAY,aAAajE,IAAQ,CAAC,OAAOlC,CAAM;AAAA,IAC/C,gBAAciF;AAAAA,IACd,oBAAkBE;AAAAA,IAClB,sBAAoB,aAAajD,CAAK;AAAA,EAAA,CACvC,CACF,CACE,GACJgD,KAAgBG,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAK3E,IAAIc;AAAAA,IAASpB,WAAU;AAAA,IAA4BkF,MAAK;AAAA,EAAA,GAASL,CAAkB,CACtG;AAET;"}
1
+ {"version":3,"file":"index56.js","sources":["../src/components/OTPInput/index.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, KeyboardEvent, ChangeEvent, ClipboardEvent, FC } from 'react';\nimport { useStableId } from '../../utils/useStableId';\nimport './style.scss';\n\nexport interface OTPInputProps {\n length?: number;\n onChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n label?: string;\n disabled?: boolean;\n className?: string;\n autoFocus?: boolean;\n error?: boolean;\n errorMessage?: string;\n validateOnBlur?: boolean;\n onValidate?: (value: string) => boolean | string;\n id?: string;\n}\n\nexport const OTPInput: FC<OTPInputProps> = ({\n length = 6,\n onChange,\n onComplete,\n label,\n disabled = false,\n className = '',\n autoFocus = true,\n error = false,\n errorMessage,\n validateOnBlur = false,\n onValidate,\n id\n}) => {\n const [values, setValues] = useState<string[]>(Array(length).fill(''));\n const [internalError, setInternalError] = useState<string | null>(null);\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\n const isBackspacePressed = useRef<boolean>(false);\n \n // Generate stable IDs for ARIA attributes\n const baseId = useStableId(id, 'se-otp-input');\n const labelId = `${baseId}-label`;\n const errorId = `${baseId}-error`;\n\n // Helper: Check if a string is a single digit\n const isDigit = (char: string): boolean => /^\\d$/.test(char);\n\n // Helper: Check if OTP is complete\n const isComplete = (otpValue: string): boolean => {\n return otpValue.length === length && values.every((val) => val !== '');\n };\n\n // Helper: Update value at specific index\n const updateValue = (index: number, value: string, shouldFocusNext = false) => {\n const newValues = [...values];\n newValues[index] = value;\n setValues(newValues);\n\n if (shouldFocusNext && value && index < length - 1) {\n focusInput(index + 1);\n }\n };\n\n // Helper: Clear value at specific index\n const clearValue = (index: number) => {\n updateValue(index, '');\n };\n\n // Helper: Focus input at index\n const focusInput = (index: number) => {\n inputRefs.current[index]?.focus();\n };\n\n useEffect(() => {\n if (autoFocus && inputRefs.current[0] && !disabled) {\n focusInput(0);\n }\n }, [autoFocus, disabled]);\n\n // Internal validation\n const validateOTP = (otpValue: string): string | null => {\n // Empty validation\n if (otpValue.length === 0) {\n return errorMessage || 'Please enter the verification code';\n }\n\n // Incomplete validation\n if (otpValue.length < length || !isComplete(otpValue)) {\n return errorMessage || 'Please enter all digits';\n }\n\n // Custom validation\n if (onValidate) {\n const validationResult = onValidate(otpValue);\n if (validationResult === false) {\n return errorMessage || 'Invalid verification code';\n }\n if (typeof validationResult === 'string') {\n return validationResult;\n }\n }\n\n return null;\n };\n\n useEffect(() => {\n const otpValue = values.join('');\n onChange?.(otpValue);\n\n // Clear error when user starts typing\n if (internalError && otpValue.length > 0) {\n setInternalError(null);\n }\n\n if (isComplete(otpValue)) {\n // Validate on complete\n if (onValidate) {\n const validationResult = onValidate(otpValue);\n if (validationResult === false || typeof validationResult === 'string') {\n const errorMsg =\n typeof validationResult === 'string' ? validationResult : errorMessage || 'Invalid verification code';\n setInternalError(errorMsg);\n } else {\n setInternalError(null);\n }\n }\n onComplete?.(otpValue);\n }\n }, [values, length, onChange, onComplete, onValidate, errorMessage]);\n\n const handleChange = (index: number, value: string) => {\n // Only allow single digit or empty\n if (value && !isDigit(value)) {\n return;\n }\n\n updateValue(index, value, true);\n };\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n\n const currentValue = values[index];\n\n // Handle backspace\n if (e.key === 'Backspace') {\n isBackspacePressed.current = true;\n if (currentValue) {\n clearValue(index);\n } else if (index > 0) {\n clearValue(index - 1);\n focusInput(index - 1);\n }\n // Reset backspace flag after a short delay\n setTimeout(() => {\n isBackspacePressed.current = false;\n }, 100);\n e.preventDefault();\n return;\n }\n\n // Handle delete\n if (e.key === 'Delete') {\n isBackspacePressed.current = true;\n clearValue(index);\n // Reset backspace flag after a short delay\n setTimeout(() => {\n isBackspacePressed.current = false;\n }, 100);\n e.preventDefault();\n return;\n }\n\n // Handle navigation keys\n const navigationHandlers: Record<string, () => void> = {\n ArrowLeft: () => index > 0 && focusInput(index - 1),\n ArrowRight: () => index < length - 1 && focusInput(index + 1),\n Home: () => focusInput(0),\n End: () => focusInput(length - 1)\n };\n\n if (navigationHandlers[e.key]) {\n navigationHandlers[e.key]();\n e.preventDefault();\n return;\n }\n\n // Allow digits, but prevent if already filled\n if (isDigit(e.key)) {\n if (currentValue) {\n updateValue(index, e.key, true);\n }\n }\n };\n\n const handlePaste = (e: ClipboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n\n e.preventDefault();\n const pastedData = e.clipboardData.getData('text/plain').trim();\n\n // Extract only digits\n const digits = pastedData.replace(/\\D/g, '').slice(0, length);\n\n if (digits.length > 0) {\n const newValues = [...values];\n\n // Fill inputs starting from the current index\n const startIndex = inputRefs.current.findIndex((ref) => ref === document.activeElement);\n const actualStartIndex = startIndex >= 0 ? startIndex : 0;\n\n for (let i = 0; i < digits.length && actualStartIndex + i < length; i++) {\n newValues[actualStartIndex + i] = digits[i];\n }\n\n setValues(newValues);\n\n // Focus the next empty input or the last input\n const nextEmptyIndex = newValues.findIndex((val, idx) => idx >= actualStartIndex && val === '');\n const focusIndex = nextEmptyIndex >= 0 ? nextEmptyIndex : Math.min(actualStartIndex + digits.length, length - 1);\n focusInput(focusIndex);\n }\n };\n\n const handleFocus = (index: number) => {\n inputRefs.current[index]?.select();\n };\n\n const handleBlur = () => {\n // Don't validate on blur if backspace/delete was just pressed\n if (validateOnBlur && !isBackspacePressed.current) {\n const otpValue = values.join('');\n const validationError = validateOTP(otpValue);\n setInternalError(validationError);\n }\n };\n\n const hasError = error || !!internalError;\n // Priority: errorMessage prop > internalError\n const displayError = hasError && (errorMessage || internalError);\n \n const ariaDescribedByError = displayError ? errorId : undefined;\n\n return (\n <div className={`se-design-otp-input ${className || ''}`} data-automation-id=\"otp-input-container\">\n {label && <div id={labelId} className=\"se-design-otp-input-label\">{label}</div>}\n <div className=\"flex items-center gap-[12px]\" role=\"group\" aria-labelledby={label ? labelId : undefined}>\n {values.map((value, index) => (\n <input\n key={index}\n ref={(el) => {\n inputRefs.current[index] = el;\n }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={value}\n onChange={(e: ChangeEvent<HTMLInputElement>) => handleChange(index, e.target.value)}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => handleKeyDown(index, e)}\n onPaste={handlePaste}\n onFocus={() => handleFocus(index)}\n onBlur={handleBlur}\n disabled={disabled}\n className={`\n w-12 h-12 \n flex flex-col items-start \n text-center text-lg font-medium\n border rounded-md\n outline-none\n transition-colors\n disabled:bg-gray-50 disabled:cursor-not-allowed\n ${\n disabled\n ? 'border-[var(--color-gray-300)] text-gray-400'\n : hasError\n ? 'border-[var(--color-red-400)] text-gray-900 focus:border-[var(--color-red-400)] focus:ring-1 focus:ring-[var(--color-red-400)]'\n : 'border-[var(--color-gray-300)] text-gray-900 focus:border-[var(--color-blue-500)] focus:ring-1 focus:ring-[var(--color-blue-500)]'\n }\n `}\n style={{\n gap: 'var(--Spacer-6px, 6px)'\n }}\n aria-label={`OTP digit ${index + 1} of ${length}`}\n aria-invalid={hasError}\n aria-describedby={ariaDescribedByError}\n data-automation-id={`otp-input-${index}`}\n />\n ))}\n </div>\n {displayError && <div id={errorId} className=\"se-design-otp-input-error\" role=\"alert\">{displayError}</div>}\n </div>\n );\n};\n"],"names":["OTPInput","length","onChange","onComplete","label","disabled","className","autoFocus","error","errorMessage","validateOnBlur","onValidate","id","values","setValues","useState","Array","fill","internalError","setInternalError","inputRefs","useRef","isBackspacePressed","baseId","useStableId","labelId","errorId","isDigit","char","test","isComplete","otpValue","every","val","updateValue","index","value","shouldFocusNext","newValues","focusInput","clearValue","current","focus","useEffect","validateOTP","validationResult","join","handleChange","handleKeyDown","e","currentValue","key","setTimeout","preventDefault","navigationHandlers","ArrowLeft","ArrowRight","Home","End","handlePaste","digits","clipboardData","getData","trim","replace","slice","startIndex","findIndex","ref","document","activeElement","actualStartIndex","i","nextEmptyIndex","idx","focusIndex","Math","min","handleFocus","select","handleBlur","validationError","hasError","displayError","ariaDescribedByError","undefined","React","createElement","role","map","el","type","inputMode","maxLength","target","onKeyDown","onPaste","onFocus","onBlur","style","gap"],"mappings":";;;AAmBO,MAAMA,IAA8BA,CAAC;AAAA,EAC1CC,QAAAA,IAAS;AAAA,EACTC,UAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA,IAAY;AAAA,EACZC,WAAAA,IAAY;AAAA,EACZC,OAAAA,IAAQ;AAAA,EACRC,cAAAA;AAAAA,EACAC,gBAAAA,IAAiB;AAAA,EACjBC,YAAAA;AAAAA,EACAC,IAAAA;AACF,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAmBC,MAAMf,CAAM,EAAEgB,KAAK,EAAE,CAAC,GAC/D,CAACC,GAAeC,CAAgB,IAAIJ,EAAwB,IAAI,GAChEK,IAAYC,EAAoC,EAAE,GAClDC,IAAqBD,EAAgB,EAAK,GAG1CE,IAASC,EAAYZ,GAAI,cAAc,GACvCa,IAAU,GAAGF,CAAM,UACnBG,IAAU,GAAGH,CAAM,UAGnBI,IAAUA,CAACC,MAA0B,OAAOC,KAAKD,CAAI,GAGrDE,IAAaA,CAACC,MACXA,EAAS9B,WAAWA,KAAUY,EAAOmB,MAAOC,CAAAA,MAAQA,MAAQ,EAAE,GAIjEC,IAAcA,CAACC,GAAeC,GAAeC,IAAkB,OAAU;AAC7E,U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AAA,IAAK3E,IAAIc;AAAAA,IAASpB,WAAU;AAAA,IAA4BkF,MAAK;AAAA,EAAA,GAASL,CAAkB,CACtG;AAET;"}
package/dist/index6.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import l, { useState as d, useCallback as o } from "react";
2
- import { isElementVisible as m } from "./index184.js";
2
+ import { isElementVisible as m } from "./index183.js";
3
3
  const g = ({
4
4
  skipLinks: n,
5
5
  className: s = ""
package/dist/index60.js CHANGED
@@ -1,54 +1,60 @@
1
- import i, { useState as p, useCallback as v, useEffect as E } from "react";
2
- import { Popover as y } from "./index18.js";
1
+ import l, { useState as p, useCallback as E, useEffect as y } from "react";
2
+ import { Popover as P } from "./index18.js";
3
3
  /* empty css */
4
- function d() {
5
- return d = Object.assign ? Object.assign.bind() : function(n) {
6
- for (var o = 1; o < arguments.length; o++) {
7
- var t = arguments[o];
8
- for (var e in t) ({}).hasOwnProperty.call(t, e) && (n[e] = t[e]);
4
+ function f() {
5
+ return f = Object.assign ? Object.assign.bind() : function(s) {
6
+ for (var t = 1; t < arguments.length; t++) {
7
+ var n = arguments[t];
8
+ for (var e in n) ({}).hasOwnProperty.call(n, e) && (s[e] = n[e]);
9
9
  }
10
- return n;
11
- }, d.apply(null, arguments);
10
+ return s;
11
+ }, f.apply(null, arguments);
12
12
  }
13
- const w = ({
14
- label: n,
15
- children: o,
16
- iconColor: t = "var(--color-blue-500)",
17
- isDisabled: e = !1,
13
+ const I = ({
14
+ label: s,
15
+ children: t,
16
+ iconColor: n = "",
17
+ hoverBackgroundColor: e,
18
+ isDisabled: r = !1,
18
19
  noPadding: u = !1
19
20
  }) => {
20
- const [f, r] = p(!1), [m, s] = p(!1), l = f || m, c = v((a) => {
21
- a.key === "Escape" && (r(!1), s(!1), a.stopImmediatePropagation());
21
+ const [m, a] = p(!1), [g, i] = p(!1), c = m || g, d = E((o) => {
22
+ o.key === "Escape" && (a(!1), i(!1), o.stopImmediatePropagation());
22
23
  }, []);
23
- E(() => {
24
- if (l)
25
- return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
26
- }, [l, c]);
27
- const g = {
28
- onMouseEnter: () => r(!0),
29
- onMouseLeave: () => r(!1),
30
- onFocus: () => s(!0),
31
- onBlur: () => s(!1)
24
+ y(() => {
25
+ if (c)
26
+ return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
27
+ }, [c, d]);
28
+ const v = {
29
+ onMouseEnter: () => a(!0),
30
+ onMouseLeave: () => a(!1),
31
+ onFocus: (o) => {
32
+ o.target.matches(":focus-visible") && i(!0);
33
+ },
34
+ onBlur: () => i(!1)
32
35
  };
33
- return /* @__PURE__ */ i.createElement("div", d({
34
- className: e ? "se-design-info-tooltip-wrapper-disabled" : ""
35
- }, e ? {} : g), /* @__PURE__ */ i.createElement(y, {
36
+ return /* @__PURE__ */ l.createElement("div", f({
37
+ className: r ? "se-design-info-tooltip-wrapper-disabled" : ""
38
+ }, r ? {} : v), /* @__PURE__ */ l.createElement(P, {
36
39
  position: "bottom-center",
37
- isPopoverOpen: l,
38
- onPopoverToggle: (a) => {
39
- a || (r(!1), s(!1));
40
+ isPopoverOpen: c,
41
+ onPopoverToggle: (o) => {
42
+ o || (a(!1), i(!1));
40
43
  },
41
- renderPopoverSrcElement: () => /* @__PURE__ */ i.createElement("div", {
42
- className: `se-design-info-tooltip-src ${u ? "no-padding" : ""} ${e ? "se-design-info-tooltip-disabled" : ""}`,
44
+ renderPopoverSrcElement: () => /* @__PURE__ */ l.createElement("div", {
45
+ className: `se-design-info-tooltip-src ${u ? "no-padding" : ""} ${r ? "se-design-info-tooltip-disabled" : ""}`,
43
46
  style: {
44
- "--info-tooltip-icon-color": t,
45
- cursor: e ? "not-allowed" : "pointer"
47
+ "--info-tooltip-icon-color": n,
48
+ ...e ? {
49
+ "--info-tooltip-hover-bg": e
50
+ } : {},
51
+ cursor: r ? "not-allowed" : "pointer"
46
52
  }
47
- }, o),
48
- renderPopoverContents: () => /* @__PURE__ */ i.createElement("div", {
53
+ }, t),
54
+ renderPopoverContents: () => /* @__PURE__ */ l.createElement("div", {
49
55
  className: "se-design-info-tooltip-content",
50
56
  "data-automation-id": "se-design-info-tooltip-content"
51
- }, n),
57
+ }, s),
52
58
  isWithPortal: !0,
53
59
  noBorder: !0,
54
60
  disableClickToggle: !0,
@@ -59,6 +65,6 @@ const w = ({
59
65
  }));
60
66
  };
61
67
  export {
62
- w as InfoTooltip
68
+ I as InfoTooltip
63
69
  };
64
70
  //# sourceMappingURL=index60.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index60.js","sources":["../src/components/InfoTooltip/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport { Popover } from '../Popover';\nimport './styles.scss';\n\nexport interface InfoTooltipProps {\n label: string;\n children: React.ReactNode;\n iconColor?: string;\n isDisabled?: boolean;\n /**\n * Remove padding from tooltip wrapper (useful for precise alignment)\n */\n noPadding?: boolean;\n}\n\nexport const InfoTooltip = ({\n label,\n children,\n iconColor = 'var(--color-blue-500)',\n isDisabled = false,\n noPadding = false\n}: InfoTooltipProps) => {\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n // Show tooltip on hover OR focus (for keyboard accessibility)\n const isOpen = isHovered || isFocused;\n\n // Global Escape key handler (W3C WAI-ARIA tooltip pattern requirement)\n const handleEscapeKey = useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsHovered(false);\n setIsFocused(false);\n // Prevent other handlers (e.g., modal) from also closing - \"innermost first\" pattern\n event.stopImmediatePropagation();\n }\n }, []);\n\n useEffect(() => {\n if (isOpen) {\n document.addEventListener('keydown', handleEscapeKey);\n return () => document.removeEventListener('keydown', handleEscapeKey);\n }\n }, [isOpen, handleEscapeKey]);\n\n const interactionHandlers = {\n onMouseEnter: () => setIsHovered(true),\n onMouseLeave: () => setIsHovered(false),\n onFocus: () => setIsFocused(true),\n onBlur: () => setIsFocused(false)\n };\n\n return (\n <div\n className={isDisabled ? 'se-design-info-tooltip-wrapper-disabled' : ''}\n {...(isDisabled ? {} : interactionHandlers)}\n >\n <Popover\n position={'bottom-center'}\n isPopoverOpen={isOpen}\n onPopoverToggle={(open) => {\n // Sync popover state changes (e.g., Escape key) back to component state\n if (!open) {\n setIsHovered(false);\n setIsFocused(false);\n }\n }}\n renderPopoverSrcElement={() => (\n <div\n className={`se-design-info-tooltip-src ${noPadding ? 'no-padding' : ''} ${isDisabled ? 'se-design-info-tooltip-disabled' : ''}`}\n style={\n {\n '--info-tooltip-icon-color': iconColor,\n cursor: isDisabled ? 'not-allowed' : 'pointer'\n } as React.CSSProperties\n }\n >\n {children}\n </div>\n )}\n renderPopoverContents={() => (\n <div className=\"se-design-info-tooltip-content\" data-automation-id=\"se-design-info-tooltip-content\">\n {label}\n </div>\n )}\n isWithPortal\n noBorder\n disableClickToggle\n popoverContentStyleProperty={{\n zIndex: 2000,\n backgroundColor: ''\n }}\n />\n </div>\n );\n};\n"],"names":["InfoTooltip","label","children","iconColor","isDisabled","noPadding","isHovered","setIsHovered","useState","isFocused","setIsFocused","isOpen","handleEscapeKey","useCallback","event","key","stopImmediatePropagation","useEffect","document","addEventListener","removeEventListener","interactionHandlers","onMouseEnter","onMouseLeave","onFocus","onBlur","React","createElement","_extends","className","Popover","position","isPopoverOpen","onPopoverToggle","open","renderPopoverSrcElement","style","cursor","renderPopoverContents","isWithPortal","noBorder","disableClickToggle","popoverContentStyleProperty","zIndex","backgroundColor"],"mappings":";;;;;;;;;;;;AAeO,MAAMA,IAAcA,CAAC;AAAA,EAC1BC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,YAAAA,IAAa;AAAA,EACbC,WAAAA,IAAY;AACI,MAAM;AACtB,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAG1CG,IAASL,KAAaG,GAGtBG,IAAkBC,EAAY,CAACC,MAAyB;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6BAA6B;AAAA,MAC3BC,QAAQ;AAAA,MACRC,iBAAiB;AAAA,IAAA;AAAA,EACnB,CACD,CACE;AAET;"}
1
+ {"version":3,"file":"index60.js","sources":["../src/components/InfoTooltip/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport { Popover } from '../Popover';\nimport './styles.scss';\n\nexport interface InfoTooltipProps {\n label: string;\n children: React.ReactNode;\n iconColor?: string;\n /**\n * Background color shown on hover. Defaults to var(--color-blue-200).\n */\n hoverBackgroundColor?: string;\n isDisabled?: boolean;\n /**\n * Remove padding from tooltip wrapper (useful for precise alignment)\n */\n noPadding?: boolean;\n}\n\nexport const InfoTooltip = ({\n label,\n children,\n iconColor = '',\n hoverBackgroundColor,\n isDisabled = false,\n noPadding = false\n}: InfoTooltipProps) => {\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n // Show tooltip on hover OR focus (for keyboard accessibility)\n const isOpen = isHovered || isFocused;\n\n // Global Escape key handler (W3C WAI-ARIA tooltip pattern requirement)\n const handleEscapeKey = useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsHovered(false);\n setIsFocused(false);\n // Prevent other handlers (e.g., modal) from also closing - \"innermost first\" pattern\n event.stopImmediatePropagation();\n }\n }, []);\n\n useEffect(() => {\n if (isOpen) {\n document.addEventListener('keydown', handleEscapeKey);\n return () => document.removeEventListener('keydown', handleEscapeKey);\n }\n }, [isOpen, handleEscapeKey]);\n\n const interactionHandlers = {\n onMouseEnter: () => setIsHovered(true),\n onMouseLeave: () => setIsHovered(false),\n onFocus: (event: React.FocusEvent<HTMLDivElement>) => {\n const focusTarget = event.target as HTMLElement;\n if (focusTarget.matches(':focus-visible')) {\n setIsFocused(true);\n }\n },\n onBlur: () => setIsFocused(false)\n };\n\n return (\n <div\n className={isDisabled ? 'se-design-info-tooltip-wrapper-disabled' : ''}\n {...(isDisabled ? {} : interactionHandlers)}\n >\n <Popover\n position={'bottom-center'}\n isPopoverOpen={isOpen}\n onPopoverToggle={(open) => {\n // Sync popover state changes (e.g., Escape key) back to component state\n if (!open) {\n setIsHovered(false);\n setIsFocused(false);\n }\n }}\n renderPopoverSrcElement={() => (\n <div\n className={`se-design-info-tooltip-src ${noPadding ? 'no-padding' : ''} ${\n isDisabled ? 'se-design-info-tooltip-disabled' : ''\n }`}\n style={\n {\n '--info-tooltip-icon-color': iconColor,\n ...(hoverBackgroundColor ? { '--info-tooltip-hover-bg': hoverBackgroundColor } : {}),\n cursor: isDisabled ? 'not-allowed' : 'pointer'\n } as React.CSSProperties\n }\n >\n {children}\n </div>\n )}\n renderPopoverContents={() => (\n <div className=\"se-design-info-tooltip-content\" data-automation-id=\"se-design-info-tooltip-content\">\n {label}\n </div>\n )}\n isWithPortal\n noBorder\n disableClickToggle\n popoverContentStyleProperty={{\n zIndex: 2000,\n backgroundColor: ''\n }}\n />\n </div>\n );\n};\n"],"names":["InfoTooltip","label","children","iconColor","hoverBackgroundColor","isDisabled","noPadding","isHovered","setIsHovered","useState","isFocused","setIsFocused","isOpen","handleEscapeKey","useCallback","event","key","stopImmediatePropagation","useEffect","document","addEventListener","removeEventListener","interactionHandlers","onMouseEnter","onMouseLeave","onFocus","target","matches","onBlur","React","createElement","_extends","className","Popover","position","isPopoverOpen","onPopoverToggle","open","renderPopoverSrcElement","style","cursor","renderPopoverContents","isWithPortal","noBorder","disableClickToggle","popoverContentStyleProperty","zIndex","backgroundColor"],"mappings":";;;;;;;;;;;;AAmBO,MAAMA,IAAcA,CAAC;AAAA,EAC1BC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,sBAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,WAAAA,IAAY;AACI,MAAM;AACtB,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAG1CG,IAASL,KAAaG,GAGtBG,IA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,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MAAKE,WAAU;AAAA,MAAiC,sBAAmB;AAAA,IAAA,GAChE/B,CACE;AAAA,IAEPyC,cAAY;AAAA,IACZC,UAAQ;AAAA,IACRC,oBAAkB;AAAA,IAClBC,6BAA6B;AAAA,MAC3BC,QAAQ;AAAA,MACRC,iBAAiB;AAAA,IAAA;AAAA,EACnB,CACD,CACE;AAET;"}
package/dist/index63.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import N, { forwardRef as _ } from "react";
2
- import { getA11yNameAttributes as k } from "./index70.js";
2
+ import { getA11yNameAttributes as k } from "./index69.js";
3
3
  /* empty css */
4
4
  function a() {
5
5
  return a = Object.assign ? Object.assign.bind() : function(r) {
package/dist/index64.js CHANGED
@@ -5,7 +5,7 @@ import { Icon as D } from "./index5.js";
5
5
  import { Link as G } from "./index63.js";
6
6
  import { CustomModal as H } from "./index12.js";
7
7
  import { useFocusTrap as J } from "./index224.js";
8
- import { useStableId as K } from "./index185.js";
8
+ import { useStableId as K } from "./index184.js";
9
9
  /* empty css */
10
10
  const O = {
11
11
  lg: {
package/dist/index66.js CHANGED
@@ -1,42 +1,40 @@
1
1
  import * as t from "react";
2
- import { isVirtualClick as w } from "./index69.js";
3
- function R({
2
+ import { isVirtualClick as C } from "./index68.js";
3
+ function h({
4
4
  disabled: p = !1,
5
5
  loading: i = !1,
6
6
  onClick: u,
7
- onKeyboardActivate: s,
7
+ onKeyboardActivate: n,
8
8
  isNative: l = !0,
9
9
  role: d = "button",
10
10
  tabIndex: D = 0,
11
11
  stopPropagation: c = !1,
12
- preventDefault: f = !1,
13
- pressed: P
12
+ preventDefault: f = !1
14
13
  } = {}) {
15
- const e = p || i, n = t.useRef(!1), o = t.useCallback(() => {
16
- n.current = !0;
17
- }, []), m = t.useCallback((r) => {
14
+ const e = p || i, s = t.useRef(!1), o = t.useCallback(() => {
15
+ s.current = !0;
16
+ }, []), P = t.useCallback((r) => {
18
17
  if (e) return;
19
18
  c && r.stopPropagation(), f && r.preventDefault();
20
- const y = w(r.nativeEvent), C = n.current;
21
- n.current = !1;
22
- const b = y ? "virtual" : C ? "pointer" : "keyboard";
23
- if ((b === "keyboard" || b === "virtual") && s) {
24
- s(r);
19
+ const v = C(r.nativeEvent), y = s.current;
20
+ s.current = !1;
21
+ const b = v ? "virtual" : y ? "pointer" : "keyboard";
22
+ if ((b === "keyboard" || b === "virtual") && n) {
23
+ n(r);
25
24
  return;
26
25
  }
27
26
  u?.(r);
28
- }, [e, u, s, c, f]), v = t.useCallback((r) => {
27
+ }, [e, u, n, c, f]), m = t.useCallback((r) => {
29
28
  e || (r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.currentTarget.click());
30
29
  }, [e]), k = {
31
30
  onPointerDown: o,
32
31
  onMouseDown: o,
33
32
  onTouchStart: o,
34
- onClick: m,
33
+ onClick: P,
35
34
  "aria-disabled": e ? "true" : void 0,
36
- "aria-busy": i ? "true" : void 0,
37
- "aria-pressed": P
35
+ "aria-busy": i ? "true" : void 0
38
36
  };
39
- l || (k.onKeyDown = v);
37
+ l || (k.onKeyDown = m);
40
38
  const a = {
41
39
  pressProps: k,
42
40
  isDisabled: e
@@ -44,6 +42,6 @@ function R({
44
42
  return l || (a.role = d, a.tabIndex = e ? -1 : D), a;
45
43
  }
46
44
  export {
47
- R as useAccessiblePress
45
+ h as useAccessiblePress
48
46
  };
49
47
  //# sourceMappingURL=index66.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index66.js","sources":["../src/utils/a11y/useAccessiblePress.ts"],"sourcesContent":["import * as React from 'react';\nimport { isVirtualClick } from '../virtualClick';\n\n/**\n * Hook for accessible press interactions (pointer vs keyboard vs virtual click).\n *\n * Handles:\n * - Pointer intent tracking (mouse/touch)\n * - Virtual click detection (NVDA browse mode, etc.)\n * - Routing to appropriate handler (onClick vs onKeyboardActivate)\n * - For non-native elements: Enter/Space → activation\n * - Optional stopPropagation and preventDefault\n *\n * @example\n * // Native button (isNative=true, the default)\n * const { pressProps } = useAccessiblePress({ onClick, disabled });\n * <button {...pressProps}>Click me</button>\n *\n * @example\n * // Non-native element (div acting as button)\n * const { pressProps, role, tabIndex } = useAccessiblePress({ onClick, isNative: false });\n * <div role={role} tabIndex={tabIndex} {...pressProps}>Click me</div>\n *\n * @example\n * // Element nested inside clickable parent (prevent event bubbling)\n * const { pressProps, tabIndex } = useAccessiblePress({ \n * onClick, \n * isNative: false, \n * stopPropagation: true \n * });\n * <div role=\"button\" tabIndex={tabIndex} {...pressProps}>Click me</div>\n */\n\ntype InputKind = 'pointer' | 'keyboard' | 'virtual';\n\nexport type UseAccessiblePressOptions = {\n /**\n * Whether the element is disabled\n */\n disabled?: boolean;\n\n /**\n * Whether the element is in a loading state (will also disable)\n */\n loading?: boolean;\n\n /**\n * Handler for pointer/touch activations (or all activations if onKeyboardActivate is not provided)\n */\n onClick?: (e: React.MouseEvent<HTMLElement>) => void;\n\n /**\n * Handler for keyboard + assistive tech virtual activation.\n * If omitted, onClick is used for all activations.\n */\n onKeyboardActivate?: (e: React.MouseEvent<HTMLElement>) => void;\n\n /**\n * If true, this is a native <button> (or other native pressable) and we MUST NOT add Enter/Space handling.\n * Default: true\n */\n isNative?: boolean;\n\n /**\n * Only for non-native elements (div/span). Defaults to 'button'.\n */\n role?: string;\n\n /**\n * Only for non-native elements. Defaults to 0.\n */\n tabIndex?: number;\n\n /**\n * If true, calls e.stopPropagation() before invoking onClick handler.\n * Useful when element is nested inside another clickable element.\n * Default: false\n */\n stopPropagation?: boolean;\n\n /**\n * If true, calls e.preventDefault() before invoking onClick handler.\n * Note: For non-native elements, preventDefault is already called on Space/Enter keys.\n * Default: false\n */\n preventDefault?: boolean;\n\n /**\n * Toggle/pressed state. When true or false, sets aria-pressed on the element (e.g. selected color swatch).\n * Omit for non-toggle buttons.\n */\n pressed?: boolean;\n};\n\nexport type UseAccessiblePressReturn = {\n /**\n * Props to spread onto the element. Includes event handlers and ARIA attributes.\n * Does NOT include role/tabIndex — apply those separately.\n */\n pressProps: React.HTMLAttributes<HTMLElement> & {\n 'aria-disabled'?: 'true';\n 'aria-busy'?: 'true';\n 'aria-pressed'?: boolean;\n };\n\n /**\n * Combined disabled state (disabled || loading)\n */\n isDisabled: boolean;\n\n /**\n * Role for non-native elements (e.g., 'button', 'menuitem').\n * Only returned when isNative=false.\n */\n role?: string;\n\n /**\n * TabIndex for non-native elements.\n * Returns -1 when disabled, otherwise the provided tabIndex (default 0).\n * Only returned when isNative=false.\n */\n tabIndex?: number;\n};\n\nexport function useAccessiblePress({\n disabled = false,\n loading = false,\n onClick,\n onKeyboardActivate,\n isNative = true,\n role = 'button',\n tabIndex = 0,\n stopPropagation = false,\n preventDefault = false,\n pressed\n}: UseAccessiblePressOptions = {}): UseAccessiblePressReturn {\n const isDisabled = disabled || loading;\n const lastWasPointerRef = React.useRef(false);\n\n const markPointer = React.useCallback(() => {\n lastWasPointerRef.current = true;\n }, []);\n\n const handleClick = React.useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n if (isDisabled) return;\n\n // Handle event control flags\n if (stopPropagation) e.stopPropagation();\n if (preventDefault) e.preventDefault();\n\n const virtual = isVirtualClick(e.nativeEvent as any);\n const isPointer = lastWasPointerRef.current;\n lastWasPointerRef.current = false;\n\n const input: InputKind = virtual ? 'virtual' : isPointer ? 'pointer' : 'keyboard';\n\n // If we have a keyboard handler, route keyboard + virtual clicks there.\n if ((input === 'keyboard' || input === 'virtual') && onKeyboardActivate) {\n onKeyboardActivate(e);\n return;\n }\n\n onClick?.(e);\n },\n [isDisabled, onClick, onKeyboardActivate, stopPropagation, preventDefault]\n );\n\n // Only used for non-native elements: Enter/Space should trigger click(), reusing the same click routing.\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (isDisabled) return;\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n // Trigger native click event so all routing goes through handleClick\n (e.currentTarget as HTMLElement).click();\n }\n },\n [isDisabled]\n );\n\n const pressProps: UseAccessiblePressReturn['pressProps'] = {\n onPointerDown: markPointer,\n onMouseDown: markPointer,\n onTouchStart: markPointer,\n onClick: handleClick,\n 'aria-disabled': isDisabled ? 'true' : undefined,\n 'aria-busy': loading ? 'true' : undefined,\n 'aria-pressed': pressed\n };\n\n // For non-native elements, add Enter/Space handling\n if (!isNative) {\n pressProps.onKeyDown = handleKeyDown;\n }\n\n // Return role/tabIndex separately (only for non-native elements)\n const result: UseAccessiblePressReturn = { pressProps, isDisabled };\n\n if (!isNative) {\n result.role = role;\n result.tabIndex = isDisabled ? -1 : tabIndex;\n }\n\n return result;\n}\n\n"],"names":["React","isVirtualClick","useAccessiblePress","disabled","loading","onClick","onKeyboardActivate","isNative","role","tabIndex","stopPropagation","preventDefault","pressed","isDisabled","lastWasPointerRef","useRef","markPointer","useCallback","current","handleClick","e","virtual","nativeEvent","isPointer","input","handleKeyDown","key","currentTarget","click","pressProps","onPointerDown","onMouseDown","onTouchStart","undefined","onKeyDown","result"],"mappings":"AA4HO,YAAAA,OAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,SAASC,EAAmB;AAAA,EACjCC,UAAAA,IAAW;AAAA,EACXC,SAAAA,IAAU;AAAA,EACVC,SAAAA;AAAAA,EACAC,oBAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,MAAAA,IAAO;AAAA,EACPC,UAAAA,IAAW;AAAA,EACXC,iBAAAA,IAAkB;AAAA,EAClBC,gBAAAA,IAAiB;AAAA,EACjBC,SAAAA;AACyB,IAAI,IAA8B;AAC3D,QAAMC,IAAaV,KAAYC,GACzBU,IAAoBd,EAAMe,OAAO,EAAK,GAEtCC,IAAchB,EAAMiB,YAAY,MAAM;AAC1CH,IAAAA,EAAkBI,UAAU;AAAA,EAC9B,GAAG,CAAA,CAAE,GAECC,IAAcnB,EAAMiB,YACxB,CAACG,MAAqC;AACpC,QAAIP,EAAY;AAGhB,IAAIH,OAAmBA,gBAAAA,GACnBC,OAAkBA,eAAAA;AAEtB,UAAMU,IAAUpB,EAAemB,EAAEE,WAAkB,GAC7CC,IAAYT,EAAkBI;AACpCJ,IAAAA,EAAkBI,UAAU;AAE5B,UAAMM,IAAmBH,IAAU,YAAYE,IAAY,YAAY;AAGvE,SAAKC,MAAU,cAAcA,MAAU,cAAclB,GAAoB;AACvEA,MAAAA,EAAmBc,CAAC;AACpB;AAAA,IACF;AAEAf,IAAAA,IAAUe,CAAC;AAAA,EACb,GACA,CAACP,GAAYR,GAASC,GAAoBI,GAAiBC,CAAc,CAC3E,GAGMc,IAAgBzB,EAAMiB,YAC1B,CAACG,MAAwC;AACvC,IAAIP,MAEAO,EAAEM,QAAQ,WAAWN,EAAEM,QAAQ,SACjCN,EAAET,eAAAA,GAEDS,EAAEO,cAA8BC,MAAAA;AAAAA,EAErC,GACA,CAACf,CAAU,CACb,GAEMgB,IAAqD;AAAA,IACzDC,eAAed;AAAAA,IACfe,aAAaf;AAAAA,IACbgB,cAAchB;AAAAA,IACdX,SAASc;AAAAA,IACT,iBAAiBN,IAAa,SAASoB;AAAAA,IACvC,aAAa7B,IAAU,SAAS6B;AAAAA,IAChC,gBAAgBrB;AAAAA,EAAAA;AAIlB,EAAKL,MACHsB,EAAWK,YAAYT;AAIzB,QAAMU,IAAmC;AAAA,IAAEN,YAAAA;AAAAA,IAAYhB,YAAAA;AAAAA,EAAAA;AAEvD,SAAKN,MACH4B,EAAO3B,OAAOA,GACd2B,EAAO1B,WAAWI,IAAa,KAAKJ,IAG/B0B;AACT;"}
1
+ {"version":3,"file":"index66.js","sources":["../src/utils/a11y/useAccessiblePress.ts"],"sourcesContent":["import * as React from 'react';\nimport { isVirtualClick } from '../virtualClick';\n\n/**\n * Hook for accessible press interactions (pointer vs keyboard vs virtual click).\n *\n * Handles:\n * - Pointer intent tracking (mouse/touch)\n * - Virtual click detection (NVDA browse mode, etc.)\n * - Routing to appropriate handler (onClick vs onKeyboardActivate)\n * - For non-native elements: Enter/Space → activation\n * - Optional stopPropagation and preventDefault\n *\n * @example\n * // Native button (isNative=true, the default)\n * const { pressProps } = useAccessiblePress({ onClick, disabled });\n * <button {...pressProps}>Click me</button>\n *\n * @example\n * // Non-native element (div acting as button)\n * const { pressProps, role, tabIndex } = useAccessiblePress({ onClick, isNative: false });\n * <div role={role} tabIndex={tabIndex} {...pressProps}>Click me</div>\n *\n * @example\n * // Element nested inside clickable parent (prevent event bubbling)\n * const { pressProps, tabIndex } = useAccessiblePress({ \n * onClick, \n * isNative: false, \n * stopPropagation: true \n * });\n * <div role=\"button\" tabIndex={tabIndex} {...pressProps}>Click me</div>\n */\n\ntype InputKind = 'pointer' | 'keyboard' | 'virtual';\n\nexport type UseAccessiblePressOptions = {\n /**\n * Whether the element is disabled\n */\n disabled?: boolean;\n\n /**\n * Whether the element is in a loading state (will also disable)\n */\n loading?: boolean;\n\n /**\n * Handler for pointer/touch activations (or all activations if onKeyboardActivate is not provided)\n */\n onClick?: (e: React.MouseEvent<HTMLElement>) => void;\n\n /**\n * Handler for keyboard + assistive tech virtual activation.\n * If omitted, onClick is used for all activations.\n */\n onKeyboardActivate?: (e: React.MouseEvent<HTMLElement>) => void;\n\n /**\n * If true, this is a native <button> (or other native pressable) and we MUST NOT add Enter/Space handling.\n * Default: true\n */\n isNative?: boolean;\n\n /**\n * Only for non-native elements (div/span). Defaults to 'button'.\n */\n role?: string;\n\n /**\n * Only for non-native elements. Defaults to 0.\n */\n tabIndex?: number;\n\n /**\n * If true, calls e.stopPropagation() before invoking onClick handler.\n * Useful when element is nested inside another clickable element.\n * Default: false\n */\n stopPropagation?: boolean;\n\n /**\n * If true, calls e.preventDefault() before invoking onClick handler.\n * Note: For non-native elements, preventDefault is already called on Space/Enter keys.\n * Default: false\n */\n preventDefault?: boolean;\n};\n\nexport type UseAccessiblePressReturn = {\n /**\n * Props to spread onto the element. Includes event handlers and ARIA attributes.\n * Does NOT include role/tabIndex — apply those separately.\n */\n pressProps: React.HTMLAttributes<HTMLElement> & {\n 'aria-disabled'?: 'true';\n 'aria-busy'?: 'true';\n };\n\n /**\n * Combined disabled state (disabled || loading)\n */\n isDisabled: boolean;\n\n /**\n * Role for non-native elements (e.g., 'button', 'menuitem').\n * Only returned when isNative=false.\n */\n role?: string;\n\n /**\n * TabIndex for non-native elements.\n * Returns -1 when disabled, otherwise the provided tabIndex (default 0).\n * Only returned when isNative=false.\n */\n tabIndex?: number;\n};\n\nexport function useAccessiblePress({\n disabled = false,\n loading = false,\n onClick,\n onKeyboardActivate,\n isNative = true,\n role = 'button',\n tabIndex = 0,\n stopPropagation = false,\n preventDefault = false\n}: UseAccessiblePressOptions = {}): UseAccessiblePressReturn {\n const isDisabled = disabled || loading;\n const lastWasPointerRef = React.useRef(false);\n\n const markPointer = React.useCallback(() => {\n lastWasPointerRef.current = true;\n }, []);\n\n const handleClick = React.useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n if (isDisabled) return;\n\n // Handle event control flags\n if (stopPropagation) e.stopPropagation();\n if (preventDefault) e.preventDefault();\n\n const virtual = isVirtualClick(e.nativeEvent as any);\n const isPointer = lastWasPointerRef.current;\n lastWasPointerRef.current = false;\n\n const input: InputKind = virtual ? 'virtual' : isPointer ? 'pointer' : 'keyboard';\n\n // If we have a keyboard handler, route keyboard + virtual clicks there.\n if ((input === 'keyboard' || input === 'virtual') && onKeyboardActivate) {\n onKeyboardActivate(e);\n return;\n }\n\n onClick?.(e);\n },\n [isDisabled, onClick, onKeyboardActivate, stopPropagation, preventDefault]\n );\n\n // Only used for non-native elements: Enter/Space should trigger click(), reusing the same click routing.\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (isDisabled) return;\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n // Trigger native click event so all routing goes through handleClick\n (e.currentTarget as HTMLElement).click();\n }\n },\n [isDisabled]\n );\n\n const pressProps: UseAccessiblePressReturn['pressProps'] = {\n onPointerDown: markPointer,\n onMouseDown: markPointer,\n onTouchStart: markPointer,\n onClick: handleClick,\n 'aria-disabled': isDisabled ? 'true' : undefined,\n 'aria-busy': loading ? 'true' : undefined\n };\n\n // For non-native elements, add Enter/Space handling\n if (!isNative) {\n pressProps.onKeyDown = handleKeyDown;\n }\n\n // Return role/tabIndex separately (only for non-native elements)\n const result: UseAccessiblePressReturn = { pressProps, isDisabled };\n\n if (!isNative) {\n result.role = role;\n result.tabIndex = isDisabled ? -1 : tabIndex;\n }\n\n return result;\n}\n\n"],"names":["React","isVirtualClick","useAccessiblePress","disabled","loading","onClick","onKeyboardActivate","isNative","role","tabIndex","stopPropagation","preventDefault","isDisabled","lastWasPointerRef","useRef","markPointer","useCallback","current","handleClick","e","virtual","nativeEvent","isPointer","input","handleKeyDown","key","currentTarget","click","pressProps","onPointerDown","onMouseDown","onTouchStart","undefined","onKeyDown","result"],"mappings":"AAqHO,YAAAA,OAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,SAASC,EAAmB;AAAA,EACjCC,UAAAA,IAAW;AAAA,EACXC,SAAAA,IAAU;AAAA,EACVC,SAAAA;AAAAA,EACAC,oBAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,MAAAA,IAAO;AAAA,EACPC,UAAAA,IAAW;AAAA,EACXC,iBAAAA,IAAkB;AAAA,EAClBC,gBAAAA,IAAiB;AACQ,IAAI,IAA8B;AAC3D,QAAMC,IAAaT,KAAYC,GACzBS,IAAoBb,EAAMc,OAAO,EAAK,GAEtCC,IAAcf,EAAMgB,YAAY,MAAM;AAC1CH,IAAAA,EAAkBI,UAAU;AAAA,EAC9B,GAAG,CAAA,CAAE,GAECC,IAAclB,EAAMgB,YACxB,CAACG,MAAqC;AACpC,QAAIP,EAAY;AAGhB,IAAIF,OAAmBA,gBAAAA,GACnBC,OAAkBA,eAAAA;AAEtB,UAAMS,IAAUnB,EAAekB,EAAEE,WAAkB,GAC7CC,IAAYT,EAAkBI;AACpCJ,IAAAA,EAAkBI,UAAU;AAE5B,UAAMM,IAAmBH,IAAU,YAAYE,IAAY,YAAY;AAGvE,SAAKC,MAAU,cAAcA,MAAU,cAAcjB,GAAoB;AACvEA,MAAAA,EAAmBa,CAAC;AACpB;AAAA,IACF;AAEAd,IAAAA,IAAUc,CAAC;AAAA,EACb,GACA,CAACP,GAAYP,GAASC,GAAoBI,GAAiBC,CAAc,CAC3E,GAGMa,IAAgBxB,EAAMgB,YAC1B,CAACG,MAAwC;AACvC,IAAIP,MAEAO,EAAEM,QAAQ,WAAWN,EAAEM,QAAQ,SACjCN,EAAER,eAAAA,GAEDQ,EAAEO,cAA8BC,MAAAA;AAAAA,EAErC,GACA,CAACf,CAAU,CACb,GAEMgB,IAAqD;AAAA,IACzDC,eAAed;AAAAA,IACfe,aAAaf;AAAAA,IACbgB,cAAchB;AAAAA,IACdV,SAASa;AAAAA,IACT,iBAAiBN,IAAa,SAASoB;AAAAA,IACvC,aAAa5B,IAAU,SAAS4B;AAAAA,EAAAA;AAIlC,EAAKzB,MACHqB,EAAWK,YAAYT;AAIzB,QAAMU,IAAmC;AAAA,IAAEN,YAAAA;AAAAA,IAAYhB,YAAAA;AAAAA,EAAAA;AAEvD,SAAKL,MACH2B,EAAO1B,OAAOA,GACd0B,EAAOzB,WAAWG,IAAa,KAAKH,IAG/ByB;AACT;"}
package/dist/index68.js CHANGED
@@ -1,58 +1,8 @@
1
- import * as a from "react";
2
- function R({
3
- itemIds: n,
4
- tabIndex: i = 0,
5
- defaultFocusedId: s,
6
- orientation: o = "horizontal",
7
- cols: u,
8
- loop: h = !0,
9
- onFocusChange: k
10
- }) {
11
- const [c, x] = a.useState(s || n[0] || ""), g = a.useRef({});
12
- a.useEffect(() => {
13
- if (n.length > 0 && !n.includes(c)) {
14
- const e = s || n[0] || "";
15
- x(e);
16
- }
17
- }, [n, c, s]);
18
- const w = a.useCallback((e) => {
19
- x(e), k?.(e);
20
- }, [k]), b = a.useCallback((e, t = 1) => {
21
- if (n.length === 0) return;
22
- const l = n.indexOf(c), f = Math.max(0, l);
23
- let r = f;
24
- switch (e) {
25
- case "first":
26
- r = 0;
27
- break;
28
- case "last":
29
- r = n.length - 1;
30
- break;
31
- case "prev":
32
- h ? r = (f - t + n.length) % n.length : r = Math.max(0, f - t);
33
- break;
34
- case "next":
35
- h ? r = (f + t) % n.length : r = Math.min(n.length - 1, f + t);
36
- break;
37
- }
38
- const v = n[r];
39
- v && g.current[v]?.focus();
40
- }, [n, c, h]), y = a.useCallback((e) => ({
41
- ref: (t) => {
42
- g.current[e] = t;
43
- },
44
- tabIndex: c === e ? i : -1
45
- }), [c, i]), p = a.useCallback((e) => {
46
- let t = null, l = 1;
47
- e.key === "Home" ? t = "first" : e.key === "End" ? t = "last" : (o !== "vertical" && (e.key === "ArrowLeft" ? t = "prev" : e.key === "ArrowRight" && (t = "next")), !t && o !== "horizontal" && (e.key === "ArrowUp" ? t = "prev" : e.key === "ArrowDown" && (t = "next"), t && u && (l = u))), t && (e.preventDefault(), e.stopPropagation(), b(t, l));
48
- }, [o, u, b]);
49
- return {
50
- setFocusedId: w,
51
- handleKeyDown: p,
52
- getRovingItemProps: y
53
- };
54
- }
1
+ const t = () => typeof navigator < "u" && /Android/i.test(navigator.userAgent), o = (i) => {
2
+ const r = "pointerType" in i ? i.pointerType : void 0;
3
+ return r === "" && i.isTrusted ? !0 : t() && r ? i.type === "click" && i.buttons === 1 : i.detail === 0 && !r;
4
+ };
55
5
  export {
56
- R as useRovingFocus
6
+ o as isVirtualClick
57
7
  };
58
8
  //# sourceMappingURL=index68.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index68.js","sources":["../src/utils/a11y/useRovingFocus.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type RovingDirection = 'prev' | 'next' | 'first' | 'last';\n\nexport interface UseRovingFocusOptions {\n /**\n * Array of item IDs in order\n */\n itemIds: string[];\n\n /**\n * The tabIndex to apply to the currently focused item in the roving group.\n * Defaults to 0 \n */\n tabIndex?: number;\n\n /**\n * Initial focused item ID. Defaults to first item.\n */\n defaultFocusedId?: string;\n\n /**\n * Orientation for arrow key mapping.\n * - horizontal: ArrowLeft/ArrowRight\n * - vertical: ArrowUp/ArrowDown\n * - grid: all four arrow keys (Left/Right move by 1, Up/Down move by `cols`)\n */\n orientation?: 'horizontal' | 'vertical' | 'grid';\n\n /**\n * Number of columns in the grid. Required when orientation is 'grid'.\n * ArrowUp/ArrowDown navigate by this many items in the flat itemIds array.\n */\n cols?: number;\n\n /**\n * Whether navigation wraps around at ends. Defaults to true.\n */\n loop?: boolean;\n\n /**\n * Callback when focus changes\n */\n onFocusChange?: (id: string) => void;\n}\n\nexport interface RovingItemProps {\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n}\n\nexport interface UseRovingFocusReturn {\n /**\n * Set focused item ID manually\n */\n setFocusedId: (id: string) => void;\n\n /**\n * Keyboard handler for arrow/Home/End navigation.\n * Attach to each item's onKeyDown.\n */\n handleKeyDown: (e: React.KeyboardEvent) => void;\n\n /**\n * Get props for an item in the roving focus group (ref + tabIndex)\n */\n getRovingItemProps: (id: string) => RovingItemProps;\n}\n\n/**\n * Hook for managing roving focus pattern (roving tabindex).\n * Reusable for composite widgets: tabs, toolbars, menus, listboxes, radio groups, grids.\n *\n * @example\n * // 1D (toolbar/tabs):\n * const { getRovingItemProps, handleKeyDown } = useRovingFocus({\n * itemIds: ['tab1', 'tab2', 'tab3'],\n * orientation: 'horizontal'\n * });\n *\n * // 2D (grid — flat itemIds, cols for row-jump math):\n * const { getRovingItemProps, handleKeyDown } = useRovingFocus({\n * itemIds: ['r0c0', 'r0c1', 'r0c2', 'r1c0', 'r1c1', 'r1c2'],\n * orientation: 'grid',\n * cols: 3\n * });\n *\n * // In render:\n * <button {...getRovingItemProps('tab1')} onKeyDown={handleKeyDown}>Tab 1</button>\n */\nexport function useRovingFocus({\n itemIds,\n tabIndex = 0,\n defaultFocusedId,\n orientation = 'horizontal',\n cols,\n loop = true,\n onFocusChange\n}: UseRovingFocusOptions): UseRovingFocusReturn {\n const [focusedId, setFocusedIdState] = React.useState<string>(\n defaultFocusedId || itemIds[0] || ''\n );\n\n const itemRefs = React.useRef<Record<string, HTMLElement | null>>({});\n\n // Sync focusedId if itemIds change and current focusedId is no longer valid\n React.useEffect(() => {\n if (itemIds.length > 0 && !itemIds.includes(focusedId)) {\n const newFocusedId = defaultFocusedId || itemIds[0] || '';\n setFocusedIdState(newFocusedId);\n }\n }, [itemIds, focusedId, defaultFocusedId]);\n\n const setFocusedId = React.useCallback(\n (id: string) => {\n setFocusedIdState(id);\n onFocusChange?.(id);\n },\n [onFocusChange]\n );\n\n const moveFocus = React.useCallback(\n (direction: RovingDirection, step: number = 1) => {\n if (itemIds.length === 0) return;\n\n const currentIdx = itemIds.indexOf(focusedId);\n const safeIdx = Math.max(0, currentIdx);\n let nextIdx = safeIdx;\n\n switch (direction) {\n case 'first':\n nextIdx = 0;\n break;\n case 'last':\n nextIdx = itemIds.length - 1;\n break;\n case 'prev':\n if (loop) {\n nextIdx = (safeIdx - step + itemIds.length) % itemIds.length;\n } else {\n nextIdx = Math.max(0, safeIdx - step);\n }\n break;\n case 'next':\n if (loop) {\n nextIdx = (safeIdx + step) % itemIds.length;\n } else {\n nextIdx = Math.min(itemIds.length - 1, safeIdx + step);\n }\n break;\n }\n\n const nextId = itemIds[nextIdx];\n if (!nextId) return;\n\n itemRefs.current[nextId]?.focus();\n },\n [itemIds, focusedId, loop]\n );\n\n const getRovingItemProps = React.useCallback(\n (id: string): RovingItemProps => ({\n ref: (el: HTMLElement | null) => {\n itemRefs.current[id] = el;\n },\n tabIndex: focusedId === id ? tabIndex : -1\n }),\n [focusedId, tabIndex]\n );\n\n // Keyboard handler for arrow/Home/End navigation\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n let direction: RovingDirection | null = null;\n let step = 1;\n\n if (e.key === 'Home') {\n direction = 'first';\n } else if (e.key === 'End') {\n direction = 'last';\n } else {\n // Horizontal axis (Left/Right) — active for 'horizontal' and 'grid'\n if (orientation !== 'vertical') {\n if (e.key === 'ArrowLeft') direction = 'prev';\n else if (e.key === 'ArrowRight') direction = 'next';\n }\n // Vertical axis (Up/Down) — active for 'vertical' and 'grid'\n if (!direction && orientation !== 'horizontal') {\n if (e.key === 'ArrowUp') direction = 'prev';\n else if (e.key === 'ArrowDown') direction = 'next';\n if (direction && cols) step = cols;\n }\n }\n\n if (direction) {\n e.preventDefault();\n e.stopPropagation();\n moveFocus(direction, step);\n }\n },\n [orientation, cols, moveFocus]\n );\n\n return {\n setFocusedId,\n handleKeyDown,\n getRovingItemProps\n };\n}\n"],"names":["React","useRovingFocus","itemIds","tabIndex","defaultFocusedId","orientation","cols","loop","onFocusChange","focusedId","setFocusedIdState","useState","itemRefs","useRef","useEffect","length","includes","newFocusedId","setFocusedId","useCallback","id","moveFocus","direction","step","currentIdx","indexOf","safeIdx","Math","max","nextIdx","min","nextId","current","focus","getRovingItemProps","ref","el","handleKeyDown","e","key","preventDefault","stopPropagation"],"mappings":"AA0FO,YAAAA,OAAA;AAAA,SAASC,EAAe;AAAA,EAC7BC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,kBAAAA;AAAAA,EACAC,aAAAA,IAAc;AAAA,EACdC,MAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,eAAAA;AACqB,GAAyB;AAC9C,QAAM,CAACC,GAAWC,CAAiB,IAAIV,EAAMW,SAC3CP,KAAoBF,EAAQ,CAAC,KAAK,EACpC,GAEMU,IAAWZ,EAAMa,OAA2C,EAAE;AAGpEb,EAAAA,EAAMc,UAAU,MAAM;AACpB,QAAIZ,EAAQa,SAAS,KAAK,CAACb,EAAQc,SAASP,CAAS,GAAG;AACtD,YAAMQ,IAAeb,KAAoBF,EAAQ,CAAC,KAAK;AACvDQ,MAAAA,EAAkBO,CAAY;AAAA,IAChC;AAAA,EACF,GAAG,CAACf,GAASO,GAAWL,CAAgB,CAAC;AAEzC,QAAMc,IAAelB,EAAMmB,YACzB,CAACC,MAAe;AACdV,IAAAA,EAAkBU,CAAE,G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AEC,QAAQ,cAAajB,IAAY,SAC9BgB,EAAEC,QAAQ,iBAAcjB,IAAY,UAG3C,CAACA,KAAajB,MAAgB,iBAC5BiC,EAAEC,QAAQ,YAAWjB,IAAY,SAC5BgB,EAAEC,QAAQ,gBAAajB,IAAY,SACxCA,KAAahB,MAAMiB,IAAOjB,MAI9BgB,MACFgB,EAAEE,eAAAA,GACFF,EAAEG,gBAAAA,GACFpB,EAAUC,GAAWC,CAAI;AAAA,EAE7B,GACA,CAAClB,GAAaC,GAAMe,CAAS,CAC/B;AAEA,SAAO;AAAA,IACLH,cAAAA;AAAAA,IACAmB,eAAAA;AAAAA,IACAH,oBAAAA;AAAAA,EAAAA;AAEJ;"}
1
+ {"version":3,"file":"index68.js","sources":["../src/utils/virtualClick.ts"],"sourcesContent":["/**\n * Input/virtual click detection helpers.\n */\n\nconst isAndroid = () =>\n typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\nexport const isVirtualClick = (event: MouseEvent | PointerEvent): boolean => {\n const pointerType = 'pointerType' in event ? event.pointerType : undefined;\n\n // JAWS/NVDA with Firefox.\n if (pointerType === '' && event.isTrusted) {\n return true;\n }\n\n // Android TalkBack's detail value varies depending on listener type.\n if (isAndroid() && pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n // Most browsers: virtual click has detail === 0 and no pointerType.\n return event.detail === 0 && !pointerType;\n};\n\n\n"],"names":["isAndroid","navigator","test","userAgent","isVirtualClick","event","pointerType","undefined","isTrusted","type","buttons","detail"],"mappings":"AAIA,MAAMA,IAAYA,MAChB,OAAOC,YAAc,OAAe,WAAWC,KAAKD,UAAUE,SAAS,GAE5DC,IAAiBA,CAACC,MAA8C;AAC3E,QAAMC,IAAc,iBAAiBD,IAAQA,EAAMC,cAAcC;AAGjE,SAAID,MAAgB,MAAMD,EAAMG,YACvB,KAILR,EAAAA,KAAeM,IACVD,EAAMI,SAAS,WAAWJ,EAAMK,YAAY,IAI9CL,EAAMM,WAAW,KAAK,CAACL;AAChC;"}
package/dist/index69.js CHANGED
@@ -1,8 +1,12 @@
1
- const t = () => typeof navigator < "u" && /Android/i.test(navigator.userAgent), o = (i) => {
2
- const r = "pointerType" in i ? i.pointerType : void 0;
3
- return r === "" && i.isTrusted ? !0 : t() && r ? i.type === "click" && i.buttons === 1 : i.detail === 0 && !r;
4
- };
1
+ function f({
2
+ ariaLabel: e,
3
+ ariaLabelledBy: i,
4
+ ariaDescribedBy: r
5
+ }) {
6
+ const t = {};
7
+ return i ? t["aria-labelledby"] = i : e && (t["aria-label"] = e), r && (t["aria-describedby"] = r), t;
8
+ }
5
9
  export {
6
- o as isVirtualClick
10
+ f as getA11yNameAttributes
7
11
  };
8
12
  //# sourceMappingURL=index69.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index69.js","sources":["../src/utils/virtualClick.ts"],"sourcesContent":["/**\n * Input/virtual click detection helpers.\n */\n\nconst isAndroid = () =>\n typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\nexport const isVirtualClick = (event: MouseEvent | PointerEvent): boolean => {\n const pointerType = 'pointerType' in event ? event.pointerType : undefined;\n\n // JAWS/NVDA with Firefox.\n if (pointerType === '' && event.isTrusted) {\n return true;\n }\n\n // Android TalkBack's detail value varies depending on listener type.\n if (isAndroid() && pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n // Most browsers: virtual click has detail === 0 and no pointerType.\n return event.detail === 0 && !pointerType;\n};\n\n\n"],"names":["isAndroid","navigator","test","userAgent","isVirtualClick","event","pointerType","undefined","isTrusted","type","buttons","detail"],"mappings":"AAIA,MAAMA,IAAYA,MAChB,OAAOC,YAAc,OAAe,WAAWC,KAAKD,UAAUE,SAAS,GAE5DC,IAAiBA,CAACC,MAA8C;AAC3E,QAAMC,IAAc,iBAAiBD,IAAQA,EAAMC,cAAcC;AAGjE,SAAID,MAAgB,MAAMD,EAAMG,YACvB,KAILR,EAAAA,KAAeM,IACVD,EAAMI,SAAS,WAAWJ,EAAMK,YAAY,IAI9CL,EAAMM,WAAW,KAAK,CAACL;AAChC;"}
1
+ {"version":3,"file":"index69.js","sources":["../src/utils/a11y/accessibleName.ts"],"sourcesContent":["/**\n * Accessible name/description utilities following WCAG precedence rules.\n * \n * **When to use:**\n * - `ariaLabelledBy`: visible label exists (preferred - keeps SR and visual text in sync)\n * - `ariaLabel`: no visible label (e.g., icon-only buttons)\n * - `ariaDescribedBy`: additional context needed (warnings, hints, constraints)\n * \n * **Precedence:** ariaLabelledBy > ariaLabel > visible text content\n * \n * @example Icon-only button\n * ```tsx\n * <Button iconProps={{ name: 'close' }} ariaLabel=\"Close dialog\" />\n * ```\n * \n * @example Disambiguate generic labels\n * ```tsx\n * <Button label=\"Edit\" ariaLabel=\"Edit name\" />\n * <Button label=\"Edit\" ariaLabel=\"Edit email\" />\n * ```\n */\n\nexport type AccessibleNameInput = {\n /** Accessible name when no visible label exists (icon-only buttons). */\n ariaLabel?: string;\n /** ID(s) of visible element(s) that label this control. Preferred over ariaLabel. */\n ariaLabelledBy?: string;\n /** ID(s) of element(s) providing additional description (additive). */\n ariaDescribedBy?: string;\n};\n\n/**\n * Returns ARIA attributes with correct precedence.\n * Prefer ariaLabelledBy > ariaLabel. ariaDescribedBy is always additive.\n */\nexport function getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy\n}: AccessibleNameInput): Record<string, string> {\n const props: Record<string, string> = {};\n\n if (ariaLabelledBy) props['aria-labelledby'] = ariaLabelledBy;\n else if (ariaLabel) props['aria-label'] = ariaLabel;\n\n if (ariaDescribedBy) props['aria-describedby'] = ariaDescribedBy;\n\n return props;\n}\n"],"names":["getA11yNameAttributes","ariaLabel","ariaLabelledBy","ariaDescribedBy","props"],"mappings":"AAmCO,SAASA,EAAsB;AAAA,EACpCC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AACmB,GAA2B;AAC9C,QAAMC,IAAgC,CAAA;AAEtC,SAAIF,IAAgBE,EAAM,iBAAiB,IAAIF,IACtCD,MAAWG,EAAM,YAAY,IAAIH,IAEtCE,MAAiBC,EAAM,kBAAkB,IAAID,IAE1CC;AACT;"}
@@ -0,0 +1,5 @@
1
+ const L = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M11.0179%2013.3597L12.27%2010.855L13.5222%2013.3597C13.9204%2014.1563%2014.5662%2014.8021%2015.3627%2015.2004L17.8682%2016.4531L15.3627%2017.7059C14.5662%2018.1041%2013.9204%2018.75%2013.5222%2019.5465L12.27%2022.0513L11.0179%2019.5465C10.6197%2018.75%209.97387%2018.1041%209.17738%2017.7059L6.67188%2016.4531L9.17738%2015.2004C9.97387%2014.8021%2010.6197%2014.1563%2011.0179%2013.3597Z'%20fill='%23415575'/%3e%3cpath%20d='M19.0159%207.18859L19.4685%206.2832L19.9211%207.18859C20.3193%207.98511%2020.9651%208.63098%2021.7616%209.02923L22.6674%209.48215L21.7616%209.93506C20.9651%2010.3333%2020.3193%2010.9792%2019.9211%2011.7757L19.4685%2012.6811L19.0159%2011.7757C18.6177%2010.9792%2017.9719%2010.3333%2017.1754%209.93506L16.2695%209.48215L17.1754%209.02923C17.9719%208.63098%2018.6177%207.98511%2019.0159%207.18859Z'%20fill='%23415575'/%3e%3cpath%20d='M19.0159%2021.3561L19.4685%2020.4507L19.9211%2021.3561C20.3193%2022.1526%2020.9651%2022.7985%2021.7616%2023.1967L22.6674%2023.6496L21.7616%2024.1025C20.9651%2024.5008%2020.3193%2025.1467%2019.9211%2025.9432L19.4685%2026.8486L19.0159%2025.9432C18.6177%2025.1467%2017.9719%2024.5008%2017.1754%2024.1025L16.2695%2023.6496L17.1754%2023.1967C17.9719%2022.7985%2018.6177%2022.1526%2019.0159%2021.3561Z'%20fill='%23415575'/%3e%3c/svg%3e";
2
+ export {
3
+ L as default
4
+ };
5
+ //# sourceMappingURL=index71.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index71.js","sources":["../src/assets/icons/ai-off.svg?url"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M11.0179%2013.3597L12.27%2010.855L13.5222%2013.3597C13.9204%2014.1563%2014.5662%2014.8021%2015.3627%2015.2004L17.8682%2016.4531L15.3627%2017.7059C14.5662%2018.1041%2013.9204%2018.75%2013.5222%2019.5465L12.27%2022.0513L11.0179%2019.5465C10.6197%2018.75%209.97387%2018.1041%209.17738%2017.7059L6.67188%2016.4531L9.17738%2015.2004C9.97387%2014.8021%2010.6197%2014.1563%2011.0179%2013.3597Z'%20fill='%23415575'/%3e%3cpath%20d='M19.0159%207.18859L19.4685%206.2832L19.9211%207.18859C20.3193%207.98511%2020.9651%208.63098%2021.7616%209.02923L22.6674%209.48215L21.7616%209.93506C20.9651%2010.3333%2020.3193%2010.9792%2019.9211%2011.7757L19.4685%2012.6811L19.0159%2011.7757C18.6177%2010.9792%2017.9719%2010.3333%2017.1754%209.93506L16.2695%209.48215L17.1754%209.02923C17.9719%208.63098%2018.6177%207.98511%2019.0159%207.18859Z'%20fill='%23415575'/%3e%3cpath%20d='M19.0159%2021.3561L19.4685%2020.4507L19.9211%2021.3561C20.3193%2022.1526%2020.9651%2022.7985%2021.7616%2023.1967L22.6674%2023.6496L21.7616%2024.1025C20.9651%2024.5008%2020.3193%2025.1467%2019.9211%2025.9432L19.4685%2026.8486L19.0159%2025.9432C18.6177%2025.1467%2017.9719%2024.5008%2017.1754%2024.1025L16.2695%2023.6496L17.1754%2023.1967C17.9719%2022.7985%2018.6177%2022.1526%2019.0159%2021.3561Z'%20fill='%23415575'/%3e%3c/svg%3e\""],"names":["__vite_glob_0_0"],"mappings":"AAAA,MAAAA,IAAe;"}
package/dist/index72.js CHANGED
@@ -1,5 +1,5 @@
1
- const L = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='%233A91DA'/%3e%3cpath%20d='M11.0179%2013.3597L12.27%2010.855L13.5222%2013.3597C13.9204%2014.1563%2014.5662%2014.8021%2015.3627%2015.2004L17.8682%2016.4531L15.3627%2017.7059C14.5662%2018.1041%2013.9204%2018.75%2013.5222%2019.5465L12.27%2022.0513L11.0179%2019.5465C10.6197%2018.75%209.97387%2018.1041%209.17738%2017.7059L6.67188%2016.4531L9.17738%2015.2004C9.97387%2014.8021%2010.6197%2014.1563%2011.0179%2013.3597Z'%20fill='%23CFE7FA'/%3e%3cpath%20d='M19.0178%207.18859L19.4704%206.2832L19.923%207.18859C20.3212%207.98511%2020.967%208.63098%2021.7635%209.02923L22.6694%209.48215L21.7635%209.93506C20.967%2010.3333%2020.3212%2010.9792%2019.923%2011.7757L19.4704%2012.6811L19.0178%2011.7757C18.6196%2010.9792%2017.9738%2010.3333%2017.1773%209.93506L16.2715%209.48215L17.1773%209.02923C17.9738%208.63098%2018.6196%207.98511%2019.0178%207.18859Z'%20fill='%23CFE7FA'/%3e%3cpath%20d='M19.0178%2021.3561L19.4704%2020.4507L19.923%2021.3561C20.3212%2022.1526%2020.967%2022.7985%2021.7635%2023.1967L22.6694%2023.6496L21.7635%2024.1025C20.967%2024.5008%2020.3212%2025.1467%2019.923%2025.9432L19.4704%2026.8486L19.0178%2025.9432C18.6196%2025.1467%2017.9738%2024.5008%2017.1773%2024.1025L16.2715%2023.6496L17.1773%2023.1967C17.9738%2022.7985%2018.6196%2022.1526%2019.0178%2021.3561Z'%20fill='%23CFE7FA'/%3e%3c/svg%3e";
1
+ const e = "data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.8'%3e%3cg%20clip-path='url(%23clip0_11623_94780)'%3e%3cpath%20d='M8.93929%2014.7575C12.1504%2014.7575%2014.7536%2012.1543%2014.7536%208.94319C14.7536%205.73205%2012.1504%203.12891%208.93929%203.12891C5.72814%203.12891%203.125%205.73205%203.125%208.94319C3.125%2012.1543%205.72814%2014.7575%208.93929%2014.7575Z'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8642%2016.872L13.0469%2013.0547'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.4688%201.47559C13.0214%202.58108%2013.918%203.47752%2015.0234%204.03027L15.9619%204.5L15.0234%204.96973C13.918%205.52248%2013.0214%206.41892%2012.4688%207.52441L12%208.46191L11.5313%207.52441C10.9786%206.41892%2010.082%205.52248%208.97656%204.96973L8.03711%204.5L8.97656%204.03027C10.082%203.47752%2010.9786%202.58108%2011.5313%201.47559L12%200.538086L12.4688%201.47559Z'%20fill='white'%20stroke='%233E8BD1'%20stroke-width='1.375'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_11623_94780'%3e%3crect%20width='16'%20height='18'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
2
2
  export {
3
- L as default
3
+ e as default
4
4
  };
5
5
  //# sourceMappingURL=index72.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index72.js","sources":["../src/assets/icons/ai-off.svg?url"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='%233A91DA'/%3e%3cpath%20d='M11.0179%2013.3597L12.27%2010.855L13.5222%2013.3597C13.9204%2014.1563%2014.5662%2014.8021%2015.3627%2015.2004L17.8682%2016.4531L15.3627%2017.7059C14.5662%2018.1041%2013.9204%2018.75%2013.5222%2019.5465L12.27%2022.0513L11.0179%2019.5465C10.6197%2018.75%209.97387%2018.1041%209.17738%2017.7059L6.67188%2016.4531L9.17738%2015.2004C9.97387%2014.8021%2010.6197%2014.1563%2011.0179%2013.3597Z'%20fill='%23CFE7FA'/%3e%3cpath%20d='M19.0178%207.18859L19.4704%206.2832L19.923%207.18859C20.3212%207.98511%2020.967%208.63098%2021.7635%209.02923L22.6694%209.48215L21.7635%209.93506C20.967%2010.3333%2020.3212%2010.9792%2019.923%2011.7757L19.4704%2012.6811L19.0178%2011.7757C18.6196%2010.9792%2017.9738%2010.3333%2017.1773%209.93506L16.2715%209.48215L17.1773%209.02923C17.9738%208.63098%2018.6196%207.98511%2019.0178%207.18859Z'%20fill='%23CFE7FA'/%3e%3cpath%20d='M19.0178%2021.3561L19.4704%2020.4507L19.923%2021.3561C20.3212%2022.1526%2020.967%2022.7985%2021.7635%2023.1967L22.6694%2023.6496L21.7635%2024.1025C20.967%2024.5008%2020.3212%2025.1467%2019.923%2025.9432L19.4704%2026.8486L19.0178%2025.9432C18.6196%2025.1467%2017.9738%2024.5008%2017.1773%2024.1025L16.2715%2023.6496L17.1773%2023.1967C17.9738%2022.7985%2018.6196%2022.1526%2019.0178%2021.3561Z'%20fill='%23CFE7FA'/%3e%3c/svg%3e\""],"names":["__vite_glob_0_0"],"mappings":"AAAA,MAAAA,IAAe;"}
1
+ {"version":3,"file":"index72.js","sources":["../src/assets/icons/ai-search.svg?url"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.8'%3e%3cg%20clip-path='url(%23clip0_11623_94780)'%3e%3cpath%20d='M8.93929%2014.7575C12.1504%2014.7575%2014.7536%2012.1543%2014.7536%208.94319C14.7536%205.73205%2012.1504%203.12891%208.93929%203.12891C5.72814%203.12891%203.125%205.73205%203.125%208.94319C3.125%2012.1543%205.72814%2014.7575%208.93929%2014.7575Z'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8642%2016.872L13.0469%2013.0547'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.4688%201.47559C13.0214%202.58108%2013.918%203.47752%2015.0234%204.03027L15.9619%204.5L15.0234%204.96973C13.918%205.52248%2013.0214%206.41892%2012.4688%207.52441L12%208.46191L11.5313%207.52441C10.9786%206.41892%2010.082%205.52248%208.97656%204.96973L8.03711%204.5L8.97656%204.03027C10.082%203.47752%2010.9786%202.58108%2011.5313%201.47559L12%200.538086L12.4688%201.47559Z'%20fill='white'%20stroke='%233E8BD1'%20stroke-width='1.375'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_11623_94780'%3e%3crect%20width='16'%20height='18'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\""],"names":["__vite_glob_0_1"],"mappings":"AAAA,MAAAA,IAAe;"}
package/dist/index73.js CHANGED
@@ -1,5 +1,5 @@
1
- const e = "data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.8'%3e%3cg%20clip-path='url(%23clip0_11623_94780)'%3e%3cpath%20d='M8.93929%2014.7575C12.1504%2014.7575%2014.7536%2012.1543%2014.7536%208.94319C14.7536%205.73205%2012.1504%203.12891%208.93929%203.12891C5.72814%203.12891%203.125%205.73205%203.125%208.94319C3.125%2012.1543%205.72814%2014.7575%208.93929%2014.7575Z'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8642%2016.872L13.0469%2013.0547'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.4688%201.47559C13.0214%202.58108%2013.918%203.47752%2015.0234%204.03027L15.9619%204.5L15.0234%204.96973C13.918%205.52248%2013.0214%206.41892%2012.4688%207.52441L12%208.46191L11.5313%207.52441C10.9786%206.41892%2010.082%205.52248%208.97656%204.96973L8.03711%204.5L8.97656%204.03027C10.082%203.47752%2010.9786%202.58108%2011.5313%201.47559L12%200.538086L12.4688%201.47559Z'%20fill='white'%20stroke='%233E8BD1'%20stroke-width='1.375'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_11623_94780'%3e%3crect%20width='16'%20height='18'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
1
+ const L = "data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.4958%207.65801L9.58298%205.83203L8.67016%207.65801C8.37987%208.23869%207.90907%208.70953%207.32841%208.99985L5.50189%209.91312L7.32841%2010.8264C7.90907%2011.1167%208.37987%2011.5876%208.67016%2012.1682L9.58298%2013.9942L10.4958%2012.1682C10.7861%2011.5876%2011.2569%2011.1167%2011.8375%2010.8264L13.6641%209.91312L11.8375%208.99986C11.2569%208.70953%2010.7861%208.23869%2010.4958%207.65801Z'%20fill='%23415575'%20stroke='%23415575'/%3e%3cpath%20d='M4.66587%203.16003L4.33592%202.5L4.00597%203.16003C3.71568%203.7407%203.24488%204.21155%202.66423%204.50187L2.00387%204.83205L2.66422%205.16223C3.24487%205.45255%203.71568%205.9234%204.00597%206.50407L4.33592%207.1641L4.66587%206.50407C4.95615%205.9234%205.42696%205.45255%206.00761%205.16223L6.66797%204.83205L6.00761%204.50187C5.42696%204.21155%204.95615%203.7407%204.66587%203.16003Z'%20fill='%23415575'%20stroke='%23415575'/%3e%3c/svg%3e";
2
2
  export {
3
- e as default
3
+ L as default
4
4
  };
5
5
  //# sourceMappingURL=index73.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index73.js","sources":["../src/assets/icons/ai-search.svg?url"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.8'%3e%3cg%20clip-path='url(%23clip0_11623_94780)'%3e%3cpath%20d='M8.93929%2014.7575C12.1504%2014.7575%2014.7536%2012.1543%2014.7536%208.94319C14.7536%205.73205%2012.1504%203.12891%208.93929%203.12891C5.72814%203.12891%203.125%205.73205%203.125%208.94319C3.125%2012.1543%205.72814%2014.7575%208.93929%2014.7575Z'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8642%2016.872L13.0469%2013.0547'%20stroke='%23D8E8F6'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.4688%201.47559C13.0214%202.58108%2013.918%203.47752%2015.0234%204.03027L15.9619%204.5L15.0234%204.96973C13.918%205.52248%2013.0214%206.41892%2012.4688%207.52441L12%208.46191L11.5313%207.52441C10.9786%206.41892%2010.082%205.52248%208.97656%204.96973L8.03711%204.5L8.97656%204.03027C10.082%203.47752%2010.9786%202.58108%2011.5313%201.47559L12%200.538086L12.4688%201.47559Z'%20fill='white'%20stroke='%233E8BD1'%20stroke-width='1.375'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_11623_94780'%3e%3crect%20width='16'%20height='18'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\""],"names":["__vite_glob_0_1"],"mappings":"AAAA,MAAAA,IAAe;"}
1
+ {"version":3,"file":"index73.js","sources":["../src/assets/icons/ai-stars.svg?url"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.4958%207.65801L9.58298%205.83203L8.67016%207.65801C8.37987%208.23869%207.90907%208.70953%207.32841%208.99985L5.50189%209.91312L7.32841%2010.8264C7.90907%2011.1167%208.37987%2011.5876%208.67016%2012.1682L9.58298%2013.9942L10.4958%2012.1682C10.7861%2011.5876%2011.2569%2011.1167%2011.8375%2010.8264L13.6641%209.91312L11.8375%208.99986C11.2569%208.70953%2010.7861%208.23869%2010.4958%207.65801Z'%20fill='%23415575'%20stroke='%23415575'/%3e%3cpath%20d='M4.66587%203.16003L4.33592%202.5L4.00597%203.16003C3.71568%203.7407%203.24488%204.21155%202.66423%204.50187L2.00387%204.83205L2.66422%205.16223C3.24487%205.45255%203.71568%205.9234%204.00597%206.50407L4.33592%207.1641L4.66587%206.50407C4.95615%205.9234%205.42696%205.45255%206.00761%205.16223L6.66797%204.83205L6.00761%204.50187C5.42696%204.21155%204.95615%203.7407%204.66587%203.16003Z'%20fill='%23415575'%20stroke='%23415575'/%3e%3c/svg%3e\""],"names":["__vite_glob_0_2"],"mappings":"AAAA,MAAAA,IAAe;"}