se-design 1.0.79-dev1 → 1.0.80

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 (223) hide show
  1. package/dist/assets/style.css +1 -1
  2. package/dist/index10.js.map +1 -1
  3. package/dist/index100.js.map +1 -1
  4. package/dist/index101.js.map +1 -1
  5. package/dist/index102.js.map +1 -1
  6. package/dist/index103.js.map +1 -1
  7. package/dist/index104.js.map +1 -1
  8. package/dist/index105.js.map +1 -1
  9. package/dist/index106.js.map +1 -1
  10. package/dist/index107.js.map +1 -1
  11. package/dist/index108.js.map +1 -1
  12. package/dist/index109.js.map +1 -1
  13. package/dist/index11.js.map +1 -1
  14. package/dist/index110.js.map +1 -1
  15. package/dist/index111.js.map +1 -1
  16. package/dist/index112.js.map +1 -1
  17. package/dist/index113.js.map +1 -1
  18. package/dist/index114.js.map +1 -1
  19. package/dist/index115.js.map +1 -1
  20. package/dist/index116.js.map +1 -1
  21. package/dist/index117.js.map +1 -1
  22. package/dist/index118.js.map +1 -1
  23. package/dist/index119.js.map +1 -1
  24. package/dist/index12.js.map +1 -1
  25. package/dist/index120.js.map +1 -1
  26. package/dist/index121.js.map +1 -1
  27. package/dist/index122.js.map +1 -1
  28. package/dist/index123.js.map +1 -1
  29. package/dist/index124.js.map +1 -1
  30. package/dist/index125.js.map +1 -1
  31. package/dist/index126.js.map +1 -1
  32. package/dist/index127.js.map +1 -1
  33. package/dist/index128.js.map +1 -1
  34. package/dist/index129.js.map +1 -1
  35. package/dist/index13.js.map +1 -1
  36. package/dist/index130.js.map +1 -1
  37. package/dist/index131.js.map +1 -1
  38. package/dist/index132.js.map +1 -1
  39. package/dist/index133.js.map +1 -1
  40. package/dist/index134.js.map +1 -1
  41. package/dist/index135.js.map +1 -1
  42. package/dist/index136.js.map +1 -1
  43. package/dist/index137.js.map +1 -1
  44. package/dist/index138.js.map +1 -1
  45. package/dist/index139.js.map +1 -1
  46. package/dist/index14.js.map +1 -1
  47. package/dist/index140.js.map +1 -1
  48. package/dist/index141.js.map +1 -1
  49. package/dist/index142.js.map +1 -1
  50. package/dist/index143.js.map +1 -1
  51. package/dist/index144.js.map +1 -1
  52. package/dist/index145.js.map +1 -1
  53. package/dist/index146.js.map +1 -1
  54. package/dist/index147.js.map +1 -1
  55. package/dist/index148.js.map +1 -1
  56. package/dist/index149.js.map +1 -1
  57. package/dist/index150.js.map +1 -1
  58. package/dist/index151.js.map +1 -1
  59. package/dist/index152.js.map +1 -1
  60. package/dist/index153.js.map +1 -1
  61. package/dist/index154.js.map +1 -1
  62. package/dist/index155.js.map +1 -1
  63. package/dist/index156.js.map +1 -1
  64. package/dist/index157.js.map +1 -1
  65. package/dist/index158.js.map +1 -1
  66. package/dist/index159.js.map +1 -1
  67. package/dist/index16.js.map +1 -1
  68. package/dist/index160.js.map +1 -1
  69. package/dist/index161.js.map +1 -1
  70. package/dist/index162.js.map +1 -1
  71. package/dist/index163.js.map +1 -1
  72. package/dist/index164.js.map +1 -1
  73. package/dist/index165.js.map +1 -1
  74. package/dist/index166.js.map +1 -1
  75. package/dist/index167.js.map +1 -1
  76. package/dist/index168.js.map +1 -1
  77. package/dist/index169.js.map +1 -1
  78. package/dist/index17.js.map +1 -1
  79. package/dist/index170.js.map +1 -1
  80. package/dist/index171.js.map +1 -1
  81. package/dist/index172.js.map +1 -1
  82. package/dist/index173.js.map +1 -1
  83. package/dist/index174.js.map +1 -1
  84. package/dist/index175.js.map +1 -1
  85. package/dist/index176.js.map +1 -1
  86. package/dist/index177.js.map +1 -1
  87. package/dist/index178.js.map +1 -1
  88. package/dist/index179.js.map +1 -1
  89. package/dist/index18.js.map +1 -1
  90. package/dist/index180.js.map +1 -1
  91. package/dist/index181.js.map +1 -1
  92. package/dist/index182.js.map +1 -1
  93. package/dist/index183.js.map +1 -1
  94. package/dist/index184.js.map +1 -1
  95. package/dist/index185.js.map +1 -1
  96. package/dist/index186.js.map +1 -1
  97. package/dist/index187.js.map +1 -1
  98. package/dist/index188.js.map +1 -1
  99. package/dist/index189.js.map +1 -1
  100. package/dist/index19.js.map +1 -1
  101. package/dist/index190.js.map +1 -1
  102. package/dist/index191.js.map +1 -1
  103. package/dist/index192.js.map +1 -1
  104. package/dist/index193.js.map +1 -1
  105. package/dist/index194.js.map +1 -1
  106. package/dist/index195.js.map +1 -1
  107. package/dist/index196.js.map +1 -1
  108. package/dist/index197.js.map +1 -1
  109. package/dist/index198.js.map +1 -1
  110. package/dist/index199.js.map +1 -1
  111. package/dist/index20.js.map +1 -1
  112. package/dist/index200.js.map +1 -1
  113. package/dist/index201.js.map +1 -1
  114. package/dist/index208.js.map +1 -1
  115. package/dist/index209.js +1 -1
  116. package/dist/index209.js.map +1 -1
  117. package/dist/index21.js.map +1 -1
  118. package/dist/index217.js.map +1 -1
  119. package/dist/index22.js.map +1 -1
  120. package/dist/index228.js.map +1 -1
  121. package/dist/index23.js.map +1 -1
  122. package/dist/index237.js.map +1 -1
  123. package/dist/index24.js.map +1 -1
  124. package/dist/index240.js.map +1 -1
  125. package/dist/index241.js +1 -1
  126. package/dist/index241.js.map +1 -1
  127. package/dist/index242.js.map +1 -1
  128. package/dist/index244.js.map +1 -1
  129. package/dist/index245.js.map +1 -1
  130. package/dist/index246.js.map +1 -1
  131. package/dist/index247.js.map +1 -1
  132. package/dist/index248.js.map +1 -1
  133. package/dist/index25.js.map +1 -1
  134. package/dist/index250.js.map +1 -1
  135. package/dist/index251.js.map +1 -1
  136. package/dist/index252.js.map +1 -1
  137. package/dist/index254.js.map +1 -1
  138. package/dist/index255.js.map +1 -1
  139. package/dist/index256.js.map +1 -1
  140. package/dist/index259.js.map +1 -1
  141. package/dist/index26.js.map +1 -1
  142. package/dist/index27.js.map +1 -1
  143. package/dist/index28.js.map +1 -1
  144. package/dist/index29.js.map +1 -1
  145. package/dist/index3.js.map +1 -1
  146. package/dist/index30.js.map +1 -1
  147. package/dist/index31.js.map +1 -1
  148. package/dist/index32.js.map +1 -1
  149. package/dist/index33.js.map +1 -1
  150. package/dist/index34.js.map +1 -1
  151. package/dist/index35.js.map +1 -1
  152. package/dist/index36.js.map +1 -1
  153. package/dist/index37.js.map +1 -1
  154. package/dist/index38.js.map +1 -1
  155. package/dist/index39.js.map +1 -1
  156. package/dist/index4.js.map +1 -1
  157. package/dist/index40.js.map +1 -1
  158. package/dist/index41.js.map +1 -1
  159. package/dist/index42.js.map +1 -1
  160. package/dist/index43.js.map +1 -1
  161. package/dist/index44.js.map +1 -1
  162. package/dist/index45.js.map +1 -1
  163. package/dist/index46.js.map +1 -1
  164. package/dist/index47.js.map +1 -1
  165. package/dist/index48.js.map +1 -1
  166. package/dist/index49.js.map +1 -1
  167. package/dist/index5.js.map +1 -1
  168. package/dist/index50.js.map +1 -1
  169. package/dist/index51.js +9 -9
  170. package/dist/index51.js.map +1 -1
  171. package/dist/index52.js.map +1 -1
  172. package/dist/index53.js.map +1 -1
  173. package/dist/index54.js.map +1 -1
  174. package/dist/index55.js.map +1 -1
  175. package/dist/index56.js.map +1 -1
  176. package/dist/index57.js.map +1 -1
  177. package/dist/index58.js.map +1 -1
  178. package/dist/index59.js.map +1 -1
  179. package/dist/index6.js +102 -102
  180. package/dist/index6.js.map +1 -1
  181. package/dist/index60.js.map +1 -1
  182. package/dist/index61.js.map +1 -1
  183. package/dist/index62.js.map +1 -1
  184. package/dist/index63.js.map +1 -1
  185. package/dist/index64.js.map +1 -1
  186. package/dist/index65.js.map +1 -1
  187. package/dist/index67.js.map +1 -1
  188. package/dist/index68.js.map +1 -1
  189. package/dist/index69.js.map +1 -1
  190. package/dist/index7.js.map +1 -1
  191. package/dist/index70.js.map +1 -1
  192. package/dist/index71.js.map +1 -1
  193. package/dist/index72.js +53 -48
  194. package/dist/index72.js.map +1 -1
  195. package/dist/index73.js.map +1 -1
  196. package/dist/index74.js.map +1 -1
  197. package/dist/index75.js.map +1 -1
  198. package/dist/index76.js.map +1 -1
  199. package/dist/index77.js.map +1 -1
  200. package/dist/index78.js.map +1 -1
  201. package/dist/index8.js.map +1 -1
  202. package/dist/index80.js.map +1 -1
  203. package/dist/index81.js.map +1 -1
  204. package/dist/index82.js.map +1 -1
  205. package/dist/index83.js.map +1 -1
  206. package/dist/index84.js.map +1 -1
  207. package/dist/index85.js.map +1 -1
  208. package/dist/index86.js.map +1 -1
  209. package/dist/index87.js.map +1 -1
  210. package/dist/index88.js.map +1 -1
  211. package/dist/index89.js.map +1 -1
  212. package/dist/index9.js.map +1 -1
  213. package/dist/index90.js.map +1 -1
  214. package/dist/index91.js.map +1 -1
  215. package/dist/index92.js.map +1 -1
  216. package/dist/index93.js.map +1 -1
  217. package/dist/index94.js.map +1 -1
  218. package/dist/index95.js.map +1 -1
  219. package/dist/index96.js.map +1 -1
  220. package/dist/index97.js.map +1 -1
  221. package/dist/index98.js.map +1 -1
  222. package/dist/index99.js.map +1 -1
  223. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index52.js","sources":["../src/components/InputWithIcon/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport './styles.scss';\n\nexport interface InputIconProps {\n className?: string;\n disabled?: boolean;\n disableHover?: boolean;\n name: string;\n onClick?: () => void;\n position: 'left' | 'right';\n style?: React.CSSProperties;\n /**\n * Accessible name for the icon when it is interactive (onClick provided).\n * Required for a11y when the icon has its own onClick.\n */\n ariaLabel?: string;\n}\n\nexport interface InputWithIconProps {\n disabled?: boolean;\n error?: boolean;\n errorMessage?: string;\n id?: string;\n inputStyle?: React.CSSProperties;\n label?: string;\n leftIcon?: InputIconProps;\n maxLength?: number | undefined;\n onChange?: (value: string) => void;\n onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n placeholder?: string;\n readOnly?: boolean;\n rightIcon?: InputIconProps;\n style?: React.CSSProperties;\n tag?: string;\n type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';\n value: string;\n className?: string;\n automationId?: string;\n /**\n * Accessible name when no visible label exists.\n * Prefer a visible label prop instead where possible.\n */\n ariaLabel?: string;\n /**\n * ID(s) of external visible element(s) that label this input.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this input (hints, notes, constraints).\n * Announced by screen readers after the label and value, giving extra context.\n */\n ariaDescribedBy?: string;\n /**\n * Set to \"dialog\" when this input opens a date picker or other dialog.\n */\n ariaHasPopup?: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';\n /**\n * Additional props spread directly onto the inner <input> element.\n */\n inputProps?: Record<string, any>;\n /**\n * Ref forwarded to the inner <input> element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\nexport function InputWithIcon({\n disabled,\n error,\n errorMessage,\n id,\n inputStyle,\n label,\n leftIcon,\n maxLength,\n onChange,\n onClick,\n onKeyDown,\n placeholder,\n readOnly,\n rightIcon,\n style,\n tag,\n type = 'text',\n value,\n className = '',\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaHasPopup,\n inputProps,\n inputRef\n}: InputWithIconProps) {\n const inputId = useStableId(id, 'se-input-icon');\n const Element = tag || 'input';\n\n const accessibleNameProps = getA11yNameAttributes({ ariaLabel, ariaLabelledBy, ariaDescribedBy });\n\n // Trigger mode: readOnly + onClick means the whole widget acts as one interactive element\n // (e.g. a date picker trigger). ONE tab stop — the input — and the icon is always decorative.\n // The wrapper div becomes the unified mouse click zone so clicking anywhere, including the\n // icon area, fires the action without a second focusable element.\n //\n // Non-trigger mode: normal editable input. If an icon has its own onClick it is an independent\n // action (e.g. show/hide password) and becomes its own accessible button via Icon's useAccessiblePress.\n const isTriggerMode = !!readOnly && !!onClick;\n\n const renderIcon = (iconProps: InputIconProps) => {\n if (!iconProps) return null;\n\n const isIconDisabled = disabled || iconProps.disabled;\n // In trigger mode icon is always decorative — the wrapper is the click zone for the whole widget.\n // In non-trigger mode pass onClick to Icon so it uses useAccessiblePress:\n // role=\"button\", tabIndex=0, Enter/Space, focus-outline. Decorative when no onClick.\n const iconOnClick = isTriggerMode || isIconDisabled ? undefined : iconProps.onClick;\n\n return (\n <div\n className={`input-with-icon-icon input-with-icon-icon-${iconProps.position} ${iconProps.className || ''} ${isIconDisabled ? 'disabled' : ''} ${iconProps.disableHover ? 'no-hover' : ''}`}\n style={iconProps.style}\n >\n <Icon\n name={iconProps.name}\n onClick={iconOnClick}\n ariaLabel={iconOnClick ? iconProps.ariaLabel : undefined}\n />\n </div>\n );\n };\n\n // In trigger mode Enter/Space on the focused input fires the action, same as a button would.\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isTriggerMode && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n onClick!(e as any);\n }\n onKeyDown?.(e);\n };\n\n const hasLeftIcon = !!leftIcon;\n const hasRightIcon = !!rightIcon;\n\n return (\n <div className={`input-with-icon-main-container ${className}`} style={style} data-automation-id={automationId}>\n {label && <label className=\"label-container\" htmlFor={inputId}>{label}</label>}\n <div\n className={`input-with-icon-wrapper ${hasLeftIcon ? 'has-left-icon' : ''} ${hasRightIcon ? 'has-right-icon' : ''}`}\n // In trigger mode the wrapper is the unified mouse click zone — clicking anywhere in the\n // widget (including the icon area) fires the action. Don't also put onClick on the input\n // element or it would double-fire when the input itself is clicked.\n onClick={isTriggerMode ? (e) => onClick!(e as any) : undefined}\n style={isTriggerMode ? { cursor: 'pointer' } : undefined}\n >\n {renderIcon(leftIcon!)}\n {React.createElement(Element, {\n ref: inputRef,\n id: inputId,\n value,\n onChange: onChange\n ? (e: React.ChangeEvent<HTMLInputElement>) => onChange(e.target.value)\n : undefined,\n // In trigger mode don't attach onClick to the input — the wrapper handles it.\n onClick: isTriggerMode ? undefined : onClick,\n onKeyDown: handleKeyDown,\n disabled,\n readOnly,\n type,\n className: `input-with-icon-element ${error ? 'input-with-icon-container-error' : 'input-with-icon-container-default'} ${disabled ? 'input-with-icon-container-disabled' : ''}`,\n maxLength: maxLength ? maxLength : undefined,\n placeholder: placeholder,\n // In trigger mode: pointer cursor so it matches the wrapper, and no text selection\n // since the value is display-only — selecting \"90 days\" with a caret is misleading.\n style: isTriggerMode\n ? { cursor: 'pointer', userSelect: 'none', ...inputStyle }\n : inputStyle,\n 'aria-haspopup': ariaHasPopup,\n ...accessibleNameProps,\n ...inputProps\n })}\n {renderIcon(rightIcon!)}\n </div>\n {(error || maxLength) &&\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'}`}>\n {error && <div className=\"error-message\">{errorMessage}</div>}\n {maxLength && <div className=\"max-word\">{maxLength && value?.length + '/' + maxLength}</div>}\n </div>\n }\n </div>\n );\n}\n"],"names":["React__default","Icon","useStableId","getA11yNameAttributes","InputWithIcon","disabled","error","errorMessage","id","inputStyle","label","leftIcon","maxLength","onChange","onClick","onKeyDown","placeholder","readOnly","rightIcon","style","tag","type","value","className","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaHasPopup","inputProps","inputRef","inputId","Element","accessibleNameProps","isTriggerMode","renderIcon","iconProps","isIconDisabled","iconOnClick","undefined","React","createElement","position","disableHover","name","handleKeyDown","e","key","preventDefault","hasLeftIcon","hasRightIcon","htmlFor","cursor","ref","target","userSelect","length"],"mappings":"AAsEO,OAAAA,OAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,yBAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;AAAA,SAASC,EAAc;AAAA,EAC5BC,UAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,IAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,UAAAA;AAAAA,E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A,EAAAA,CACJ,GACAM,EAAWjB,CAAU,CACnB,IACHZ,KAASM,MACT4B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKlB,WAAW,GAAGjB,IAAQ,uBAAuB,oBAAoB;AAAA,EAAA,GACnEA,KAASkC,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKlB,WAAU;AAAA,EAAA,GAAiBhB,CAAkB,GAC3DK,KAAa4B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKlB,WAAU;AAAA,EAAA,GAAYX,KAAaU,GAAOkC,SAAS,MAAM5C,CAAe,CACxF,CAEJ;AAET;"}
1
+ {"version":3,"file":"index52.js","sources":["../src/components/InputWithIcon/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport './styles.scss';\n\nexport interface InputIconProps {\n className?: string;\n disabled?: boolean;\n disableHover?: boolean;\n name: string;\n onClick?: () => void;\n position: 'left' | 'right';\n style?: React.CSSProperties;\n /**\n * Accessible name for the icon when it is interactive (onClick provided).\n * Required for a11y when the icon has its own onClick.\n */\n ariaLabel?: string;\n}\n\nexport interface InputWithIconProps {\n disabled?: boolean;\n error?: boolean;\n errorMessage?: string;\n id?: string;\n inputStyle?: React.CSSProperties;\n label?: string;\n leftIcon?: InputIconProps;\n maxLength?: number | undefined;\n onChange?: (value: string) => void;\n onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n placeholder?: string;\n readOnly?: boolean;\n rightIcon?: InputIconProps;\n style?: React.CSSProperties;\n tag?: string;\n type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';\n value: string;\n className?: string;\n automationId?: string;\n /**\n * Accessible name when no visible label exists.\n * Prefer a visible label prop instead where possible.\n */\n ariaLabel?: string;\n /**\n * ID(s) of external visible element(s) that label this input.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this input (hints, notes, constraints).\n * Announced by screen readers after the label and value, giving extra context.\n */\n ariaDescribedBy?: string;\n /**\n * Set to \"dialog\" when this input opens a date picker or other dialog.\n */\n ariaHasPopup?: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';\n /**\n * Additional props spread directly onto the inner <input> element.\n */\n inputProps?: Record<string, any>;\n /**\n * Ref forwarded to the inner <input> element.\n */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\nexport function InputWithIcon({\n disabled,\n error,\n errorMessage,\n id,\n inputStyle,\n label,\n leftIcon,\n maxLength,\n onChange,\n onClick,\n onKeyDown,\n placeholder,\n readOnly,\n rightIcon,\n style,\n tag,\n type = 'text',\n value,\n className = '',\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaHasPopup,\n inputProps,\n inputRef\n}: InputWithIconProps) {\n const inputId = useStableId(id, 'se-input-icon');\n const Element = tag || 'input';\n\n const accessibleNameProps = getA11yNameAttributes({ ariaLabel, ariaLabelledBy, ariaDescribedBy });\n\n // Trigger mode: readOnly + onClick means the whole widget acts as one interactive element\n // (e.g. a date picker trigger). ONE tab stop — the input — and the icon is always decorative.\n // The wrapper div becomes the unified mouse click zone so clicking anywhere, including the\n // icon area, fires the action without a second focusable element.\n //\n // Non-trigger mode: normal editable input. If an icon has its own onClick it is an independent\n // action (e.g. show/hide password) and becomes its own accessible button via Icon's useAccessiblePress.\n const isTriggerMode = !!readOnly && !!onClick;\n\n const renderIcon = (iconProps: InputIconProps) => {\n if (!iconProps) return null;\n\n const isIconDisabled = disabled || iconProps.disabled;\n // In trigger mode icon is always decorative — the wrapper is the click zone for the whole widget.\n // In non-trigger mode pass onClick to Icon so it uses useAccessiblePress:\n // role=\"button\", tabIndex=0, Enter/Space, focus-outline. Decorative when no onClick.\n const iconOnClick = isTriggerMode || isIconDisabled ? undefined : iconProps.onClick;\n\n return (\n <div\n className={`input-with-icon-icon input-with-icon-icon-${iconProps.position} ${iconProps.className || ''} ${isIconDisabled ? 'disabled' : ''} ${iconProps.disableHover ? 'no-hover' : ''}`}\n style={iconProps.style}\n >\n <Icon\n name={iconProps.name}\n onClick={iconOnClick}\n ariaLabel={iconOnClick ? iconProps.ariaLabel : undefined}\n />\n </div>\n );\n };\n\n // In trigger mode Enter/Space on the focused input fires the action, same as a button would.\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isTriggerMode && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n onClick!(e as any);\n }\n onKeyDown?.(e);\n };\n\n const hasLeftIcon = !!leftIcon;\n const hasRightIcon = !!rightIcon;\n\n return (\n <div className={`input-with-icon-main-container ${className}`} style={style} data-automation-id={automationId}>\n {label && <label className=\"label-container\" htmlFor={inputId}>{label}</label>}\n <div\n className={`input-with-icon-wrapper ${hasLeftIcon ? 'has-left-icon' : ''} ${hasRightIcon ? 'has-right-icon' : ''}`}\n // In trigger mode the wrapper is the unified mouse click zone — clicking anywhere in the\n // widget (including the icon area) fires the action. Don't also put onClick on the input\n // element or it would double-fire when the input itself is clicked.\n onClick={isTriggerMode ? (e) => onClick!(e as any) : undefined}\n style={isTriggerMode ? { cursor: 'pointer' } : undefined}\n >\n {renderIcon(leftIcon!)}\n {React.createElement(Element, {\n ref: inputRef,\n id: inputId,\n value,\n onChange: onChange\n ? (e: React.ChangeEvent<HTMLInputElement>) => onChange(e.target.value)\n : undefined,\n // In trigger mode don't attach onClick to the input — the wrapper handles it.\n onClick: isTriggerMode ? undefined : onClick,\n onKeyDown: handleKeyDown,\n disabled,\n readOnly,\n type,\n className: `input-with-icon-element ${error ? 'input-with-icon-container-error' : 'input-with-icon-container-default'} ${disabled ? 'input-with-icon-container-disabled' : ''}`,\n maxLength: maxLength ? maxLength : undefined,\n placeholder: placeholder,\n // In trigger mode: pointer cursor so it matches the wrapper, and no text selection\n // since the value is display-only — selecting \"90 days\" with a caret is misleading.\n style: isTriggerMode\n ? { cursor: 'pointer', userSelect: 'none', ...inputStyle }\n : inputStyle,\n 'aria-haspopup': ariaHasPopup,\n ...accessibleNameProps,\n ...inputProps\n })}\n {renderIcon(rightIcon!)}\n </div>\n {(error || maxLength) &&\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'}`}>\n {error && <div className=\"error-message\">{errorMessage}</div>}\n {maxLength && <div className=\"max-word\">{maxLength && value?.length + '/' + maxLength}</div>}\n </div>\n }\n </div>\n );\n}\n"],"names":["React__default","Icon","useStableId","getA11yNameAttributes","InputWithIcon","disabled","error","errorMessage","id","inputStyle","label","leftIcon","maxLength","onChange","onClick","onKeyDown","placeholder","readOnly","rightIcon","style","tag","type","value","className","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaHasPopup","inputProps","inputRef","inputId","Element","accessibleNameProps","isTriggerMode","renderIcon","iconProps","isIconDisabled","iconOnClick","undefined","React","createElement","position","disableHover","name","handleKeyDown","e","key","preventDefault","hasLeftIcon","hasRightIcon","htmlFor","cursor","ref","target","userSelect","length"],"mappings":"AAsEO,OAAAA,OAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,yBAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;AAAA,SAASC,EAAc;AAAA,EAC5BC,UAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,IAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,KAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,OAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,WAA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,KAASmC,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IAAKlB,WAAU;AAAA,KAAiBhB,CAAkB,GAC3DK,KAAa4B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKlB,WAAU;AAAA,EAAA,GAAYX,KAAaU,GAAOkC,SAAS,MAAM5C,CAAe,CACxF,CAEJ;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index53.js","sources":["../src/components/DownloadWidget/index.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport { delay } from 'utils/delay';\n\nimport { Icon } from '../Icon';\n\ntype ItemType = { label: string; id?: number; metadata?: any };\n\ntype DownloadWidgetProps = {\n title: string;\n itemsList: ItemType[];\n handleDownload: (downloadItem?: any) => void;\n backgroundColor?: string;\n titleBackgroundColor?: string;\n};\n\nexport const DownloadWidget = (props: DownloadWidgetProps) => {\n const {\n title = '',\n itemsList = [],\n handleDownload,\n backgroundColor = 'var(--color-white)',\n titleBackgroundColor = 'var(--color-blue-50)'\n } = props;\n\n useEffect(() => {\n if (itemsList?.length > 0) {\n itemsList?.forEach((downloadItem) => {\n delay(2000).then(() => {\n handleDownload(downloadItem);\n });\n });\n }\n }, [itemsList?.length]);\n\n return (\n <div\n className=\"download-widgets-container rounded-t-xl border border-[var(--color-gray-400)] w-[300px] overflow-hidden fixed bottom-0 right-5 z-[1100]\"\n style={{ backgroundColor }}\n >\n <div className=\"p-4 text-base font-medium\" style={{ backgroundColor: titleBackgroundColor }}>\n {title}\n </div>\n {itemsList?.map((item) => (\n <div className=\" download-item flex items-center gap-2 px-4 pt-4 last:pb-4\">\n <span className=\"text-base font-normal flex-1\">{item.label}</span>\n <Icon name=\"checked-circle\" stroke=\"var(--color-green-500)\" size={16} />\n </div>\n ))}\n </div>\n );\n};\n"],"names":["React__default","useEffect","delay","Icon","DownloadWidget","props","title","itemsList","handleDownload","backgroundColor","titleBackgroundColor","length","forEach","downloadItem","then","React","createElement","className","style","map","item","label","name","stroke","size"],"mappings":"AAgBO,OAAAA,KAAA,aAAAC,SAAA;AAAA,SAAA,SAAAC,SAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,MAAMC,IAAiBA,CAACC,MAA+B;AAC5D,QAAM;AAAA,IACJC,OAAAA,IAAQ;AAAA,IACRC,WAAAA,IAAY,CAAA;AAAA,IACZC,gBAAAA;AAAAA,IACAC,iBAAAA,IAAkB;AAAA,IAClBC,sBAAAA,IAAuB;AAAA,EAAA,IACrBL;AAEJJ,SAAAA,EAAU,MAAM;AACd,IAAIM,GAAWI,SAAS,KACtBJ,GAAWK,QAASC,CAAAA,MAAiB;AACnCX,MAAAA,EAAM,GAAI,EAAEY,KAAK,MAAM;AACrBN,QAAAA,EAAeK,CAAY;AAAA,MAC7B,CAAC;AAAA,IACH,CAAC;AAAA,EAEL,GAAG,CAACN,GAAWI,MAAM,CAAC,GAGpBI,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEC,WAAU;AAAA,IACVC,OAAO;AAAA,MAAET,iBAAAA;AAAAA,IAAAA;AAAAA,EAAgB,GAEzBM,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,IAA4BC,OAAO;AAAA,MAAET,iBAAiBC;AAAAA,IAAAA;AAAAA,EAAqB,GACvFJ,CACE,GACJC,GAAWY,IAAKC,CAAAA,MACfL,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,EAAA,GACbF,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMC,WAAU;AAAA,EAAA,GAAgCG,EAAKC,KAAY,GACjEN,gBAAAA,EAAAC,cAACb,GAAI;AAAA,IAACmB,MAAK;AAAA,IAAiBC,QAAO;AAAA,IAAyBC,MAAM;AAAA,EAAA,CAAK,CACpE,CACN,CACE;AAET;"}
1
+ {"version":3,"file":"index53.js","sources":["../src/components/DownloadWidget/index.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\n\nimport { delay } from 'utils/delay';\n\nimport { Icon } from '../Icon';\n\ntype ItemType = { label: string; id?: number; metadata?: any };\n\ntype DownloadWidgetProps = {\n title: string;\n itemsList: ItemType[];\n handleDownload: (downloadItem?: any) => void;\n backgroundColor?: string;\n titleBackgroundColor?: string;\n};\n\nexport const DownloadWidget = (props: DownloadWidgetProps) => {\n const {\n title = '',\n itemsList = [],\n handleDownload,\n backgroundColor = 'var(--color-white)',\n titleBackgroundColor = 'var(--color-blue-50)'\n } = props;\n\n useEffect(() => {\n if (itemsList?.length > 0) {\n itemsList?.forEach((downloadItem) => {\n delay(2000).then(() => {\n handleDownload(downloadItem);\n });\n });\n }\n }, [itemsList?.length]);\n\n return (\n <div\n className=\"download-widgets-container rounded-t-xl border border-[var(--color-gray-400)] w-[300px] overflow-hidden fixed bottom-0 right-5 z-[1100]\"\n style={{ backgroundColor }}\n >\n <div className=\"p-4 text-base font-medium\" style={{ backgroundColor: titleBackgroundColor }}>\n {title}\n </div>\n {itemsList?.map((item) => (\n <div className=\" download-item flex items-center gap-2 px-4 pt-4 last:pb-4\">\n <span className=\"text-base font-normal flex-1\">{item.label}</span>\n <Icon name=\"checked-circle\" stroke=\"var(--color-green-500)\" size={16} />\n </div>\n ))}\n </div>\n );\n};\n"],"names":["DownloadWidget","props","title","itemsList","handleDownload","backgroundColor","titleBackgroundColor","useEffect","length","forEach","downloadItem","delay","then","React","createElement","className","style","map","item","label","Icon","name","stroke","size"],"mappings":"AAgBaA,OAAAA,KAAAA,aAAAA,SAAAA;AAAAA,SAAAA,SAAAA,SAAAA;AAAAA,SAAAA,QAAAA,SAAAA;AAAAA,MAAAA,IAAiBA,CAACC,MAA+B;AACtD,QAAA;AAAA,IACJC,OAAAA,IAAQ;AAAA,IACRC,WAAAA,IAAY,CAAE;AAAA,IACdC,gBAAAA;AAAAA,IACAC,iBAAAA,IAAkB;AAAA,IAClBC,sBAAAA,IAAuB;AAAA,EACrBL,IAAAA;AAEJM,SAAAA,EAAU,MAAM;AACVJ,IAAAA,GAAWK,SAAS,KACtBL,GAAWM,QAASC,CAAiBA,MAAA;AAC7B,MAAAC,EAAA,GAAI,EAAEC,KAAK,MAAM;AACrBR,QAAAA,EAAeM,CAAY;AAAA,MAAA,CAC5B;AAAA,IAAA,CACF;AAAA,EACH,GACC,CAACP,GAAWK,MAAM,CAAC,GAGpBK,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEC,WAAU;AAAA,IACVC,OAAO;AAAA,MAAEX,iBAAAA;AAAAA,IAAgB;AAAA,EAAA,GAEzBS,gBAAAA,EAAAA,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,IAA4BC,OAAO;AAAA,MAAEX,iBAAiBC;AAAAA,IAAqB;AAAA,EAAA,GACvFJ,CACE,GACJC,GAAWc,IAAKC,CACfL,MAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,EAAA,GACbD,gBAAAA,EAAAA,cAAA,QAAA;AAAA,IAAMC,WAAU;AAAA,KAAgCG,EAAKC,KAAY,GACjEN,gBAAAA,EAAAC,cAACM,GAAI;AAAA,IAACC,MAAK;AAAA,IAAiBC,QAAO;AAAA,IAAyBC,MAAM;AAAA,EAAA,CAAK,CACpE,CACN,CACE;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index54.js","sources":["../src/components/RadioSwitch/index.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * This is Radio Switch, Only one option can be selected at a time.\n * There can be multiple options, but only one can be selected at a time.\n */\nexport interface RadioSwitchOption {\n label: string;\n value: string;\n}\n\nexport interface RadioSwitchProps {\n checkedRadioOption?: string;\n optionList: RadioSwitchOption[];\n onChange?: (value: string) => void;\n switchWidth?: string;\n automationId?: string;\n}\n\nexport const RadioSwitch: React.FC<RadioSwitchProps> = ({ checkedRadioOption, optionList, onChange, switchWidth, automationId = '' }) => {\n const handleChange = (value: string) => {\n if (onChange) {\n onChange(value);\n }\n };\n\n return (\n <div\n className=\"flex rounded-full border border-gray-300 bg-white min-w-[110px] h-[34px]\"\n role=\"radiogroup\"\n aria-label=\"Switch options\"\n data-automation-id={automationId}\n style={{\n width: switchWidth\n // Moved min-w-[100px] and h-[34px] to Tailwind classes below, so these inline styles are no longer needed.\n }}\n >\n {optionList.map((option) => (\n <div\n key={option.value}\n className={`relative flex-1 flex items-center block py-2 px-4 rounded-[24px] w-full text-center cursor-pointer transition-all duration-200 ${\n option.value === checkedRadioOption\n ? 'bg-[var(--color-blue-100)] text-[var(--color-blue-500)] shadow-sm'\n : 'text-gray-700 hover:text-gray-900'\n }`}\n onClick={() => handleChange(option.value)}\n data-automation-id={`radio-switch-option-${option.value}`}\n >\n <input\n type=\"radio\"\n name=\"switch\"\n id={`switch-${option.value}`}\n checked={option.value === checkedRadioOption}\n className=\"sr-only\" // Hide the input but keep it accessible\n />\n <label htmlFor={`switch-${option.value}`} className={' cursor-pointer '}>\n {option.label}\n </label>\n </div>\n ))}\n </div>\n );\n};\n"],"names":["RadioSwitch","checkedRadioOption","optionList","onChange","switchWidth","automationId","handleChange","value","React","createElement","className","role","style","width","map","option","key","onClick","type","name","id","checked","htmlFor","label"],"mappings":";AAmBO,MAAMA,IAA0CA,CAAC;AAAA,EAAEC,oBAAAA;AAAAA,EAAoBC,YAAAA;AAAAA,EAAYC,UAAAA;AAAAA,EAAUC,aAAAA;AAAAA,EAAaC,cAAAA,IAAe;AAAG,MAAM;AACvI,QAAMC,IAAeA,CAACC,MAAkB;AACtC,IAAIJ,KACFA,EAASI,CAAK;AAAA,EAElB;AAEA,SACEC,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEC,WAAU;AAAA,IACVC,MAAK;AAAA,IACL,cAAW;AAAA,IACX,sBAAoBN;AAAAA,IACpBO,OAAO;AAAA,MACLC,OAAOT;AAAAA;AAAAA,IAAAA;AAAAA,EAET,GAECF,EAAWY,IAAKC,CAAAA,MACfP,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEO,KAAKD,EAAOR;AAAAA,IACZG,WAAW,kIACTK,EAAOR,UAAUN,IACb,sEACA,mCAAmC;AAAA,IAEzCgB,SAASA,MAAMX,EAAaS,EAAOR,KAAK;AAAA,IACxC,sBAAoB,uBAAuBQ,EAAOR,KAAK;AAAA,EAAA,GAEvDC,gBAAAA,EAAAC,cAAA,SAAA;AAAA,IACES,MAAK;AAAA,IACLC,MAAK;AAAA,IACLC,IAAI,UAAUL,EAAOR,KAAK;AAAA,IAC1Bc,SAASN,EAAOR,UAAUN;AAAAA,IAC1BS,WAAU;AAAA;AAAA,EAAA,CACX,GACDF,gBAAAA,EAAAC,cAAA,SAAA;AAAA,IAAOa,SAAS,UAAUP,EAAOR,KAAK;AAAA,IAAIG,WAAW;AAAA,EAAA,GAClDK,EAAOQ,KACH,CACJ,CACN,CACE;AAET;"}
1
+ {"version":3,"file":"index54.js","sources":["../src/components/RadioSwitch/index.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * This is Radio Switch, Only one option can be selected at a time.\n * There can be multiple options, but only one can be selected at a time.\n */\nexport interface RadioSwitchOption {\n label: string;\n value: string;\n}\n\nexport interface RadioSwitchProps {\n checkedRadioOption?: string;\n optionList: RadioSwitchOption[];\n onChange?: (value: string) => void;\n switchWidth?: string;\n automationId?: string;\n}\n\nexport const RadioSwitch: React.FC<RadioSwitchProps> = ({ checkedRadioOption, optionList, onChange, switchWidth, automationId = '' }) => {\n const handleChange = (value: string) => {\n if (onChange) {\n onChange(value);\n }\n };\n\n return (\n <div\n className=\"flex rounded-full border border-gray-300 bg-white min-w-[110px] h-[34px]\"\n role=\"radiogroup\"\n aria-label=\"Switch options\"\n data-automation-id={automationId}\n style={{\n width: switchWidth\n // Moved min-w-[100px] and h-[34px] to Tailwind classes below, so these inline styles are no longer needed.\n }}\n >\n {optionList.map((option) => (\n <div\n key={option.value}\n className={`relative flex-1 flex items-center block py-2 px-4 rounded-[24px] w-full text-center cursor-pointer transition-all duration-200 ${\n option.value === checkedRadioOption\n ? 'bg-[var(--color-blue-100)] text-[var(--color-blue-500)] shadow-sm'\n : 'text-gray-700 hover:text-gray-900'\n }`}\n onClick={() => handleChange(option.value)}\n data-automation-id={`radio-switch-option-${option.value}`}\n >\n <input\n type=\"radio\"\n name=\"switch\"\n id={`switch-${option.value}`}\n checked={option.value === checkedRadioOption}\n className=\"sr-only\" // Hide the input but keep it accessible\n />\n <label htmlFor={`switch-${option.value}`} className={' cursor-pointer '}>\n {option.label}\n </label>\n </div>\n ))}\n </div>\n );\n};\n"],"names":["RadioSwitch","checkedRadioOption","optionList","onChange","switchWidth","automationId","handleChange","value","React","createElement","className","role","style","width","map","option","key","onClick","type","name","id","checked","htmlFor","label"],"mappings":";AAmBO,MAAMA,IAA0CA,CAAC;AAAA,EAAEC,oBAAAA;AAAAA,EAAoBC,YAAAA;AAAAA,EAAYC,UAAAA;AAAAA,EAAUC,aAAAA;AAAAA,EAAaC,cAAAA,IAAe;AAAG,MAAM;AACjIC,QAAAA,IAAeA,CAACC,MAAkB;AACtC,IAAIJ,KACFA,EAASI,CAAK;AAAA,EAChB;AAIAC,SAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEC,WAAU;AAAA,IACVC,MAAK;AAAA,IACL,cAAW;AAAA,IACX,sBAAoBN;AAAAA,IACpBO,OAAO;AAAA,MACLC,OAAOT;AAAAA;AAAAA,IAET;AAAA,EAAA,GAECF,EAAWY,IAAKC,CACfP,MAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEO,KAAKD,EAAOR;AAAAA,IACZG,WAAW,kIACTK,EAAOR,UAAUN,IACb,sEACA,mCAAmC;AAAA,IAEzCgB,SAASA,MAAMX,EAAaS,EAAOR,KAAK;AAAA,IACxC,sBAAoB,uBAAuBQ,EAAOR,KAAK;AAAA,EAAA,GAEvDE,gBAAAA,EAAAA,cAAA,SAAA;AAAA,IACES,MAAK;AAAA,IACLC,MAAK;AAAA,IACLC,IAAI,UAAUL,EAAOR,KAAK;AAAA,IAC1Bc,SAASN,EAAOR,UAAUN;AAAAA,IAC1BS,WAAU;AAAA;AAAA,EAAA,CACX,GACDD,gBAAAA,EAAAA,cAAA,SAAA;AAAA,IAAOa,SAAS,UAAUP,EAAOR,KAAK;AAAA,IAAIG,WAAW;AAAA,EAClDK,GAAAA,EAAOQ,KACH,CACJ,CACN,CACE;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index55.js","sources":["../src/components/ShimmerLoader/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport './style.scss';\n\nexport interface ShimmerElement {\n type: 'text' | 'rect' | 'rect-sm' | 'circle' | 'avatar' | 'image' | 'button';\n width: number | string;\n height: number | string;\n borderRadius?: number | string;\n margin?: string;\n className?: string;\n children?: ShimmerElement[];\n}\n\nexport interface ShimmerContainer {\n type: 'container';\n direction?: 'row' | 'column';\n gap?: number | string;\n padding?: string;\n margin?: string;\n alignItems?: string;\n flex?: number | string;\n className?: string;\n children: (ShimmerElement | ShimmerContainer)[];\n}\n\nexport type ShimmerStructure = (ShimmerElement | ShimmerContainer)[];\n\nexport interface ShimmerLoaderProps {\n structure: ShimmerStructure;\n className?: string;\n animationDuration?: number;\n baseColor?: string;\n highlightColor?: string;\n width?: number | string;\n height?: number | string;\n}\n\nconst ShimmerElementComponent: FC<{\n element: ShimmerElement;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ element, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n width: typeof element.width === 'number' ? `${element.width}px` : element.width,\n height: typeof element.height === 'number' ? `${element.height}px` : element.height,\n borderRadius: element.borderRadius\n ? typeof element.borderRadius === 'number'\n ? `${element.borderRadius}px`\n : element.borderRadius\n : undefined,\n margin: element.margin,\n '--shimmer-duration': `${animationDuration}s`,\n '--shimmer-base-color': baseColor,\n '--shimmer-highlight-color': highlightColor\n } as React.CSSProperties;\n\n const shimmerClass = `se-design-shimmer-element se-design-shimmer-${element.type}`;\n\n return (\n <div className={shimmerClass} style={style}>\n {element.children &&\n element.children.map((child, index) => (\n <ShimmerElementComponent\n key={index}\n element={child}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ))}\n </div>\n );\n};\n\nconst ShimmerContainerComponent: FC<{\n container: ShimmerContainer;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ container, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n display: 'flex',\n flexDirection: container.direction || 'column',\n gap: typeof container.gap === 'number' ? `${container.gap}px` : container.gap,\n padding: container.padding,\n margin: container.margin,\n alignItems: container.alignItems,\n flex: container.flex\n };\n\n return (\n <div className={`se-design-shimmer-container ${container.className || ''}`} style={style}>\n {container.children.map((element, index) =>\n element.type === 'container' ? (\n <ShimmerContainerComponent\n key={index}\n container={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ) : (\n <ShimmerElementComponent\n key={index}\n element={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )\n )}\n </div>\n );\n};\n\nexport const ShimmerLoader: FC<ShimmerLoaderProps> = ({\n structure,\n className = '',\n animationDuration = 3,\n baseColor = 'var(--color-gray-600)',\n highlightColor = 'var(--color-gray-500)',\n width,\n height\n}) => {\n const containerStyle: React.CSSProperties = {\n width: width ? (typeof width === 'number' ? `${width}px` : width) : '100%',\n height: height ? (typeof height === 'number' ? `${height}px` : height) : 'auto',\n '--shimmer-duration': `${animationDuration}s`,\n '--shimmer-base-color': baseColor,\n '--shimmer-highlight-color': highlightColor\n } as React.CSSProperties;\n\n return (\n <div className={`se-design-shimmer-loader ${className}`} style={containerStyle}>\n {structure.map((item, index) => {\n if (item.type === 'container') {\n return (\n <ShimmerContainerComponent\n key={index}\n container={item}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n );\n } else {\n return (\n <ShimmerElementComponent\n key={index}\n element={item}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n );\n }\n })}\n </div>\n );\n};\n\nexport default ShimmerLoader;\n"],"names":["ShimmerElementComponent","element","animationDuration","baseColor","highlightColor","style","width","height","borderRadius","undefined","margin","shimmerClass","type","React","createElement","className","children","map","child","index","key","ShimmerContainerComponent","container","display","flexDirection","direction","gap","padding","alignItems","flex","ShimmerLoader","structure","containerStyle","item"],"mappings":";;AAqCA,MAAMA,IAKDA,CAAC;AAAA,EAAEC,SAAAA;AAAAA,EAASC,mBAAAA;AAAAA,EAAmBC,WAAAA;AAAAA,EAAWC,gBAAAA;AAAe,MAAM;AAClE,QAAMC,IAA6B;AAAA,IACjCC,OAAO,OAAOL,EAAQK,SAAU,WAAW,GAAGL,EAAQK,KAAK,OAAOL,EAAQK;AAAAA,IAC1EC,QAAQ,OAAON,EAAQM,UAAW,WAAW,GAAGN,EAAQM,MAAM,OAAON,EAAQM;AAAAA,IAC7EC,cAAcP,EAAQO,eAClB,OAAOP,EAAQO,gBAAiB,WAC9B,GAAGP,EAAQO,YAAY,OACvBP,EAAQO,eACVC;AAAAA,IACJC,QAAQT,EAAQS;AAAAA,IAChB,sBAAsB,GAAGR,CAAiB;AAAA,IAC1C,wBAAwBC;AAAAA,IACxB,6BAA6BC;AAAAA,EAAAA,GAGzBO,IAAe,+CAA+CV,EAAQW,IAAI;AAEhF,SACEC,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAWJ;AAAAA,IAAcN,OAAAA;AAAAA,EAAAA,GAC3BJ,EAAQe,YACPf,EAAQe,SAASC,IAAI,CAACC,GAAOC,MAC3BN,gBAAAA,EAAAC,cAACd,GAAuB;AAAA,IACtBoB,KAAKD;AAAAA,IACLlB,SAASiB;AAAAA,IACThB,mBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA,CACD,CACF,CACA;AAET,GAEMiB,IAKDA,CAAC;AAAA,EAAEC,WAAAA;AAAAA,EAAWpB,mBAAAA;AAAAA,EAAmBC,WAAAA;AAAAA,EAAWC,gBAAAA;AAAe,MAAM;AACpE,QAAMC,IAA6B;A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A,IACxB,6BAA6BC;AAAAA,EAAAA;AAG/B,SACES,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAW,4BAA4BA,CAAS;AAAA,IAAIV,OAAO2B;AAAAA,EAAAA,GAC7DD,EAAUd,IAAI,CAACgB,GAAMd,MAChBc,EAAKrB,SAAS,cAEdC,gBAAAA,EAAAC,cAACO,GAAyB;AAAA,IACxBD,KAAKD;AAAAA,IACLG,WAAWW;AAAAA,IACX/B,mBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA,CACD,IAIDS,gBAAAA,EAAAC,cAACd,GAAuB;AAAA,IACtBoB,KAAKD;AAAAA,IACLlB,SAASgC;AAAAA,IACT/B,mBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA,CACD,CAGN,CACE;AAET;"}
1
+ {"version":3,"file":"index55.js","sources":["../src/components/ShimmerLoader/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport './style.scss';\n\nexport interface ShimmerElement {\n type: 'text' | 'rect' | 'rect-sm' | 'circle' | 'avatar' | 'image' | 'button';\n width: number | string;\n height: number | string;\n borderRadius?: number | string;\n margin?: string;\n className?: string;\n children?: ShimmerElement[];\n}\n\nexport interface ShimmerContainer {\n type: 'container';\n direction?: 'row' | 'column';\n gap?: number | string;\n padding?: string;\n margin?: string;\n alignItems?: string;\n flex?: number | string;\n className?: string;\n children: (ShimmerElement | ShimmerContainer)[];\n}\n\nexport type ShimmerStructure = (ShimmerElement | ShimmerContainer)[];\n\nexport interface ShimmerLoaderProps {\n structure: ShimmerStructure;\n className?: string;\n animationDuration?: number;\n baseColor?: string;\n highlightColor?: string;\n width?: number | string;\n height?: number | string;\n}\n\nconst ShimmerElementComponent: FC<{\n element: ShimmerElement;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ element, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n width: typeof element.width === 'number' ? `${element.width}px` : element.width,\n height: typeof element.height === 'number' ? `${element.height}px` : element.height,\n borderRadius: element.borderRadius\n ? typeof element.borderRadius === 'number'\n ? `${element.borderRadius}px`\n : element.borderRadius\n : undefined,\n margin: element.margin,\n '--shimmer-duration': `${animationDuration}s`,\n '--shimmer-base-color': baseColor,\n '--shimmer-highlight-color': highlightColor\n } as React.CSSProperties;\n\n const shimmerClass = `se-design-shimmer-element se-design-shimmer-${element.type}`;\n\n return (\n <div className={shimmerClass} style={style}>\n {element.children &&\n element.children.map((child, index) => (\n <ShimmerElementComponent\n key={index}\n element={child}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ))}\n </div>\n );\n};\n\nconst ShimmerContainerComponent: FC<{\n container: ShimmerContainer;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ container, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n display: 'flex',\n flexDirection: container.direction || 'column',\n gap: typeof container.gap === 'number' ? `${container.gap}px` : container.gap,\n padding: container.padding,\n margin: container.margin,\n alignItems: container.alignItems,\n flex: container.flex\n };\n\n return (\n <div className={`se-design-shimmer-container ${container.className || ''}`} style={style}>\n {container.children.map((element, index) =>\n element.type === 'container' ? (\n <ShimmerContainerComponent\n key={index}\n container={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ) : (\n <ShimmerElementComponent\n key={index}\n element={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )\n )}\n </div>\n );\n};\n\nexport const ShimmerLoader: FC<ShimmerLoaderProps> = ({\n structure,\n className = '',\n animationDuration = 3,\n baseColor = 'var(--color-gray-600)',\n highlightColor = 'var(--color-gray-500)',\n width,\n height\n}) => {\n const containerStyle: React.CSSProperties = {\n width: width ? (typeof width === 'number' ? `${width}px` : width) : '100%',\n height: height ? (typeof height === 'number' ? `${height}px` : height) : 'auto',\n '--shimmer-duration': `${animationDuration}s`,\n '--shimmer-base-color': baseColor,\n '--shimmer-highlight-color': highlightColor\n } as React.CSSProperties;\n\n return (\n <div className={`se-design-shimmer-loader ${className}`} style={containerStyle}>\n {structure.map((item, index) => {\n if (item.type === 'container') {\n return (\n <ShimmerContainerComponent\n key={index}\n container={item}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n );\n } else {\n return (\n <ShimmerElementComponent\n key={index}\n element={item}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n );\n }\n })}\n </div>\n );\n};\n\nexport default ShimmerLoader;\n"],"names":["ShimmerElementComponent","element","animationDuration","baseColor","highlightColor","style","width","height","borderRadius","undefined","margin","shimmerClass","type","React","createElement","className","children","map","child","index","key","ShimmerContainerComponent","container","display","flexDirection","direction","gap","padding","alignItems","flex","ShimmerLoader","structure","containerStyle","item"],"mappings":";;AAqCA,MAAMA,IAKDA,CAAC;AAAA,EAAEC,SAAAA;AAAAA,EAASC,mBAAAA;AAAAA,EAAmBC,WAAAA;AAAAA,EAAWC,gBAAAA;AAAe,MAAM;AAClE,QAAMC,IAA6B;AAAA,IACjCC,OAAO,OAAOL,EAAQK,SAAU,WAAW,GAAGL,EAAQK,KAAK,OAAOL,EAAQK;AAAAA,IAC1EC,QAAQ,OAAON,EAAQM,UAAW,WAAW,GAAGN,EAAQM,MAAM,OAAON,EAAQM;AAAAA,IAC7EC,cAAcP,EAAQO,eAClB,OAAOP,EAAQO,gBAAiB,WAC9B,GAAGP,EAAQO,YAAY,OACvBP,EAAQO,eACVC;AAAAA,IACJC,QAAQT,EAAQS;AAAAA,IAChB,sBAAsB,GAAGR,CAAiB;AAAA,IAC1C,wBAAwBC;AAAAA,IACxB,6BAA6BC;AAAAA,EAAAA,GAGzBO,IAAe,+CAA+CV,EAAQW,IAAI;AAG9EC,SAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAWJ;AAAAA,IAAcN,OAAAA;AAAAA,EAAa,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WAAAA,IAAY;AAAA,EACZb,mBAAAA,IAAoB;AAAA,EACpBC,WAAAA,IAAY;AAAA,EACZC,gBAAAA,IAAiB;AAAA,EACjBE,OAAAA;AAAAA,EACAC,QAAAA;AACF,MAAM;AACJ,QAAMyB,IAAsC;AAAA,IAC1C1B,OAAOA,IAAS,OAAOA,KAAU,WAAW,GAAGA,CAAK,OAAOA,IAAS;AAAA,IACpEC,QAAQA,IAAU,OAAOA,KAAW,WAAW,GAAGA,CAAM,OAAOA,IAAU;AAAA,IACzE,sBAAsB,GAAGL,CAAiB;AAAA,IAC1C,wBAAwBC;AAAAA,IACxB,6BAA6BC;AAAAA,EAAAA;AAI7BS,SAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAW,4BAA4BA,CAAS;AAAA,IAAIV,OAAO2B;AAAAA,EAC7DD,GAAAA,EAAUd,IAAI,CAACgB,GAAMd,MAChBc,EAAKrB,SAAS,cAEdC,gBAAAA,EAAAC,cAACO,GAAyB;AAAA,IACxBD,KAAKD;AAAAA,IACLG,WAAWW;AAAAA,IACX/B,mBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA,CACD,IAIDS,gBAAAA,EAAAC,cAACd,GAAuB;AAAA,IACtBoB,KAAKD;AAAAA,IACLlB,SAASgC;AAAAA,IACT/B,mBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA,CACD,CAGN,CACE;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index56.js","sources":["../src/components/SnackBar/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { Icon, IconProps } from '../Icon';\nimport { ProgressBar } from '../ProgressBar';\nimport './style.scss';\n\nexport type SnackbarPosition =\n | 'top-right'\n | 'top-left'\n | 'bottom-right'\n | 'bottom-left'\n | 'top-center'\n | 'bottom-center';\n\nexport type SnackbarVariant = 'default' | 'success' | 'warning' | 'error' | 'info';\n\nexport type SnackbarAction = {\n label: string;\n onClick: () => void;\n variant?: 'primary' | 'secondary';\n};\n\nexport type SnackbarItem = {\n id: string | number;\n name: string;\n type: 'file' | 'folder';\n fileType?: 'doc' | 'pdf' | 'image' | 'other';\n icon?: string;\n onClick?: () => void;\n};\n\nexport interface SnackbarProps {\n /** Whether the snackbar is open */\n open: boolean;\n /** Function to close the snackbar */\n onClose: () => void;\n /** Title text displayed prominently */\n title?: string;\n /** Description text displayed below title */\n description?: string;\n /** Position of the snackbar on screen */\n position?: SnackbarPosition;\n /** Visual variant of the snackbar */\n variant?: SnackbarVariant;\n /** Auto-hide duration in milliseconds (0 = no auto-hide) */\n autoHideDuration?: number;\n /** Whether to show close button */\n showCloseButton?: boolean;\n /** Optional action button */\n action?: SnackbarAction;\n /** Custom className for additional styling */\n className?: string;\n /** Custom styles */\n style?: React.CSSProperties;\n /** Whether to show progress indicator */\n showProgress?: boolean;\n /** Progress value (0-100) */\n progress?: number;\n /** Icon props object (name, fill, stroke, rotation, size, etc.) */\n iconProps?: Omit<IconProps, 'className'>;\n /** List of items to display in expandable section */\n items?: SnackbarItem[];\n /** Whether items list is expanded by default */\n defaultExpanded?: boolean;\n /** Compact mode - renders a simple inline notification with just icon and title */\n compact?: boolean;\n /** Automation ID for testing */\n automationId?: string;\n}\n\nexport const Snackbar: React.FC<SnackbarProps> = ({\n open,\n onClose,\n title,\n description,\n position = 'bottom-right',\n variant = 'default',\n autoHideDuration = 6000,\n showCloseButton = true,\n action,\n className = '',\n style,\n showProgress = false,\n progress = 0,\n iconProps,\n items,\n defaultExpanded = false,\n compact = false,\n automationId = ''\n}) => {\n const [isVisible, setIsVisible] = useState(false);\n const [isExiting, setIsExiting] = useState(false);\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\n\n useEffect(() => {\n if (open) {\n setIsVisible(true);\n setIsExiting(false);\n\n // Auto-hide functionality\n if (autoHideDuration > 0) {\n const timer = setTimeout(() => {\n handleClose();\n }, autoHideDuration);\n\n return () => clearTimeout(timer);\n }\n }\n }, [open, autoHideDuration]);\n\n const handleClose = () => {\n setIsExiting(true);\n setTimeout(() => {\n setIsVisible(false);\n setIsExiting(false);\n onClose();\n }, 300); // Animation duration\n };\n\n const handleToggleExpanded = () => {\n setIsExpanded(!isExpanded);\n };\n\n const getFileIcon = (item: SnackbarItem) => {\n if (item.icon) return item.icon;\n\n if (item.type === 'folder') return 'folder-empty';\n if (item.type === 'file') return 'file-empty';\n\n return 'file-empty';\n\n // switch (item.fileType) {\n // case 'doc':\n // return 'docFile';\n // case 'pdf':\n // return 'pdf-file';\n // case 'image':\n // return 'file-empty';\n // default:\n // return 'file-empty';\n // }\n };\n\n if (!isVisible) return null;\n\n const getPositionClasses = () => {\n const positionMap = {\n 'top-right': 'top-4 right-4',\n 'top-left': 'top-4 left-4',\n 'bottom-right': 'bottom-4 right-4',\n 'bottom-left': 'bottom-4 left-4',\n 'top-center': 'top-4 snackbar-center',\n 'bottom-center': 'bottom-4 snackbar-center'\n };\n return positionMap[position];\n };\n\n const getVariantClasses = () => {\n const variantMap = {\n default: 'snackbar-default',\n success: 'snackbar-success',\n warning: 'snackbar-warning',\n error: 'snackbar-error',\n info: 'snackbar-info'\n };\n return variantMap[variant];\n };\n\n const getContainerStyle = (): React.CSSProperties => {\n const baseStyle = style || {};\n\n if (position === 'top-center' || position === 'bottom-center') {\n return {\n ...baseStyle,\n left: '50%',\n // Initial transform for center - animation will override but preserve translateX(-50%)\n transform: 'translateX(-50%)'\n };\n }\n\n return baseStyle;\n };\n\n return (\n <div className=\"snackbar-backdrop fixed inset-0 z-[1000] pointer-events-none\">\n <div\n className={`\n snackbar-container\n ${getPositionClasses()}\n ${getVariantClasses()}\n ${isExiting ? 'snackbar-exit' : 'snackbar-enter'}\n ${compact ? 'snackbar-compact' : ''}\n ${className}\n `}\n style={getContainerStyle()}\n role=\"alert\"\n aria-live=\"polite\"\n data-automation-id={automationId}\n >\n {compact ? (\n // Compact mode - simple inline notification\n <div className=\"snackbar-compact-content\">\n {iconProps?.name && <Icon {...iconProps} size={iconProps.size ?? 16} className=\"snackbar-compact-icon\" />}\n {title && <span className=\"snackbar-compact-title\">{title}</span>}\n </div>\n ) : (\n // Full mode - standard snackbar with all features\n <div className=\"snackbar-content\">\n {/* Header with icon, title, expand/collapse, and close button */}\n <div className=\"snackbar-header\">\n <div className=\"snackbar-title-section\">\n {iconProps?.name && <Icon {...iconProps} size={iconProps.size ?? 20} className=\"snackbar-icon\" />}\n {title && <h4 className=\"snackbar-title\">{title}</h4>}\n </div>\n <div className=\"snackbar-header-actions\">\n {items && items.length > 0 && (\n <Icon\n name=\"chevron\"\n size={16}\n stroke=\"var(--color-gray-100)\"\n rotation={isExpanded ? '0' : '180'}\n className=\"snackbar-expand-icon\"\n onClick={handleToggleExpanded}\n />\n )}\n {showCloseButton && !showProgress && (\n <Icon\n name=\"close\"\n size={16}\n fill=\"var(--color-gray-600)\"\n className=\"snackbar-close-icon\"\n onClick={handleClose}\n />\n )}\n </div>\n </div>\n\n {/* Description */}\n {description && <div className=\"snackbar-description\">{description}</div>}\n\n {/* Progress bar */}\n {showProgress && (\n <div className=\"snackbar-progress-container\">\n {progress === -1 ? (\n <div className=\"snackbar-indeterminate-progress\">\n <div className=\"snackbar-progress-gradient\"></div>\n </div>\n ) : (\n <ProgressBar\n totalTasks={100}\n completedTasks={progress}\n needPercentageCompleted={false}\n progressBarColor=\"var(--color-green-500)\"\n />\n )}\n </div>\n )}\n\n {/* Expandable Items List */}\n {items && items.length > 0 && (\n <div\n className={`snackbar-items-container ${\n isExpanded ? 'snackbar-items-expanded' : 'snackbar-items-collapsed'\n }`}\n >\n <div className=\"snackbar-items-list\">\n {items.map((item) => (\n <div key={item.id} className=\"snackbar-item\" onClick={item.onClick}>\n <div className=\"snackbar-item-content\">\n <Icon name={getFileIcon(item)} size={16} className=\"snackbar-item-icon\" />\n <span className=\"snackbar-item-name\">{item.name}</span>\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Action button */}\n {action && (\n <div className=\"snackbar-actions\">\n <button\n className={`snackbar-action-button snackbar-action-${action.variant || 'primary'}`}\n onClick={action.onClick}\n >\n {action.label}\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["Snackbar","open","onClose","title","description","position","variant","autoHideDuration","showCloseButton","action","className","style","showProgress","progress","iconProps","items","defaultExpanded","compact","automationId","isVisible","setIsVisible","useState","isExiting","setIsExiting","isExpanded","setIsExpanded","useEffect","timer","setTimeout","handleClose","clearTimeout","handleToggleExpanded","getFileIcon","item","icon","type","getPositionClasses","getVariantClasses","default","success","warning","error","info","getContainerStyle","baseStyle","left","transform","React","createElement","role","name","Icon","_extends","size","length","stroke","rotation","onClick","fill","ProgressBar","totalTasks","completedTasks","needPercentageCompleted","progressBarColor","map","key","id","label"],"mappings":";;;;;;;;;;;;;AAqEO,MAAMA,IAAoCA,CAAC;AAAA,EAChDC,MAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,SAAAA,IAAU;AAAA,EACVC,kBAAAA,IAAmB;AAAA,EACnBC,iBAAAA,IAAkB;AAAA,EAClBC,QAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,OAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,iBAAAA,IAAkB;AAAA,EAClBC,SAAAA,IAAU;AAAA,EACVC,cAAAA,IAAe;AACjB,MAAM;AACJ,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAC1C,CAACG,GAAYC,CAAa,IAAIJ,EAASL,CAAe;AAE5DU,EAAAA,EAAU,MAAM;AACd,QAAIzB,MACFmB,EAAa,EAAI,GACjBG,EAAa,EAAK,GAGdhB,IAA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AAI;AAAA,MAAGoB,MAAM;AAAA,MAAI3C,WAAU;AAAA,IAAA,CAAsB,GACzEqC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,MAAMtC,WAAU;AAAA,IAAA,GAAsBuB,EAAKiB,IAAW,CACnD,CACF,CACN,CACE,CACF,GAINzC,KACCsC,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MAAKtC,WAAU;AAAA,IAAA,GACbqC,gBAAAA,EAAAC,cAAA,UAAA;AAAA,MACEtC,WAAW,0CAA0CD,EAAOH,WAAW,SAAS;AAAA,MAChFmD,SAAShD,EAAOgD;AAAAA,IAAAA,GAEfhD,EAAO0D,KACF,CACL,CAEJ;AAAA,GAEJ,CACF;AAET;"}
1
+ {"version":3,"file":"index56.js","sources":["../src/components/SnackBar/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { Icon, IconProps } from '../Icon';\nimport { ProgressBar } from '../ProgressBar';\nimport './style.scss';\n\nexport type SnackbarPosition =\n | 'top-right'\n | 'top-left'\n | 'bottom-right'\n | 'bottom-left'\n | 'top-center'\n | 'bottom-center';\n\nexport type SnackbarVariant = 'default' | 'success' | 'warning' | 'error' | 'info';\n\nexport type SnackbarAction = {\n label: string;\n onClick: () => void;\n variant?: 'primary' | 'secondary';\n};\n\nexport type SnackbarItem = {\n id: string | number;\n name: string;\n type: 'file' | 'folder';\n fileType?: 'doc' | 'pdf' | 'image' | 'other';\n icon?: string;\n onClick?: () => void;\n};\n\nexport interface SnackbarProps {\n /** Whether the snackbar is open */\n open: boolean;\n /** Function to close the snackbar */\n onClose: () => void;\n /** Title text displayed prominently */\n title?: string;\n /** Description text displayed below title */\n description?: string;\n /** Position of the snackbar on screen */\n position?: SnackbarPosition;\n /** Visual variant of the snackbar */\n variant?: SnackbarVariant;\n /** Auto-hide duration in milliseconds (0 = no auto-hide) */\n autoHideDuration?: number;\n /** Whether to show close button */\n showCloseButton?: boolean;\n /** Optional action button */\n action?: SnackbarAction;\n /** Custom className for additional styling */\n className?: string;\n /** Custom styles */\n style?: React.CSSProperties;\n /** Whether to show progress indicator */\n showProgress?: boolean;\n /** Progress value (0-100) */\n progress?: number;\n /** Icon props object (name, fill, stroke, rotation, size, etc.) */\n iconProps?: Omit<IconProps, 'className'>;\n /** List of items to display in expandable section */\n items?: SnackbarItem[];\n /** Whether items list is expanded by default */\n defaultExpanded?: boolean;\n /** Compact mode - renders a simple inline notification with just icon and title */\n compact?: boolean;\n /** Automation ID for testing */\n automationId?: string;\n}\n\nexport const Snackbar: React.FC<SnackbarProps> = ({\n open,\n onClose,\n title,\n description,\n position = 'bottom-right',\n variant = 'default',\n autoHideDuration = 6000,\n showCloseButton = true,\n action,\n className = '',\n style,\n showProgress = false,\n progress = 0,\n iconProps,\n items,\n defaultExpanded = false,\n compact = false,\n automationId = ''\n}) => {\n const [isVisible, setIsVisible] = useState(false);\n const [isExiting, setIsExiting] = useState(false);\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\n\n useEffect(() => {\n if (open) {\n setIsVisible(true);\n setIsExiting(false);\n\n // Auto-hide functionality\n if (autoHideDuration > 0) {\n const timer = setTimeout(() => {\n handleClose();\n }, autoHideDuration);\n\n return () => clearTimeout(timer);\n }\n }\n }, [open, autoHideDuration]);\n\n const handleClose = () => {\n setIsExiting(true);\n setTimeout(() => {\n setIsVisible(false);\n setIsExiting(false);\n onClose();\n }, 300); // Animation duration\n };\n\n const handleToggleExpanded = () => {\n setIsExpanded(!isExpanded);\n };\n\n const getFileIcon = (item: SnackbarItem) => {\n if (item.icon) return item.icon;\n\n if (item.type === 'folder') return 'folder-empty';\n if (item.type === 'file') return 'file-empty';\n\n return 'file-empty';\n\n // switch (item.fileType) {\n // case 'doc':\n // return 'docFile';\n // case 'pdf':\n // return 'pdf-file';\n // case 'image':\n // return 'file-empty';\n // default:\n // return 'file-empty';\n // }\n };\n\n if (!isVisible) return null;\n\n const getPositionClasses = () => {\n const positionMap = {\n 'top-right': 'top-4 right-4',\n 'top-left': 'top-4 left-4',\n 'bottom-right': 'bottom-4 right-4',\n 'bottom-left': 'bottom-4 left-4',\n 'top-center': 'top-4 snackbar-center',\n 'bottom-center': 'bottom-4 snackbar-center'\n };\n return positionMap[position];\n };\n\n const getVariantClasses = () => {\n const variantMap = {\n default: 'snackbar-default',\n success: 'snackbar-success',\n warning: 'snackbar-warning',\n error: 'snackbar-error',\n info: 'snackbar-info'\n };\n return variantMap[variant];\n };\n\n const getContainerStyle = (): React.CSSProperties => {\n const baseStyle = style || {};\n\n if (position === 'top-center' || position === 'bottom-center') {\n return {\n ...baseStyle,\n left: '50%',\n // Initial transform for center - animation will override but preserve translateX(-50%)\n transform: 'translateX(-50%)'\n };\n }\n\n return baseStyle;\n };\n\n return (\n <div className=\"snackbar-backdrop fixed inset-0 z-[1000] pointer-events-none\">\n <div\n className={`\n snackbar-container\n ${getPositionClasses()}\n ${getVariantClasses()}\n ${isExiting ? 'snackbar-exit' : 'snackbar-enter'}\n ${compact ? 'snackbar-compact' : ''}\n ${className}\n `}\n style={getContainerStyle()}\n role=\"alert\"\n aria-live=\"polite\"\n data-automation-id={automationId}\n >\n {compact ? (\n // Compact mode - simple inline notification\n <div className=\"snackbar-compact-content\">\n {iconProps?.name && <Icon {...iconProps} size={iconProps.size ?? 16} className=\"snackbar-compact-icon\" />}\n {title && <span className=\"snackbar-compact-title\">{title}</span>}\n </div>\n ) : (\n // Full mode - standard snackbar with all features\n <div className=\"snackbar-content\">\n {/* Header with icon, title, expand/collapse, and close button */}\n <div className=\"snackbar-header\">\n <div className=\"snackbar-title-section\">\n {iconProps?.name && <Icon {...iconProps} size={iconProps.size ?? 20} className=\"snackbar-icon\" />}\n {title && <h4 className=\"snackbar-title\">{title}</h4>}\n </div>\n <div className=\"snackbar-header-actions\">\n {items && items.length > 0 && (\n <Icon\n name=\"chevron\"\n size={16}\n stroke=\"var(--color-gray-100)\"\n rotation={isExpanded ? '0' : '180'}\n className=\"snackbar-expand-icon\"\n onClick={handleToggleExpanded}\n />\n )}\n {showCloseButton && !showProgress && (\n <Icon\n name=\"close\"\n size={16}\n fill=\"var(--color-gray-600)\"\n className=\"snackbar-close-icon\"\n onClick={handleClose}\n />\n )}\n </div>\n </div>\n\n {/* Description */}\n {description && <div className=\"snackbar-description\">{description}</div>}\n\n {/* Progress bar */}\n {showProgress && (\n <div className=\"snackbar-progress-container\">\n {progress === -1 ? (\n <div className=\"snackbar-indeterminate-progress\">\n <div className=\"snackbar-progress-gradient\"></div>\n </div>\n ) : (\n <ProgressBar\n totalTasks={100}\n completedTasks={progress}\n needPercentageCompleted={false}\n progressBarColor=\"var(--color-green-500)\"\n />\n )}\n </div>\n )}\n\n {/* Expandable Items List */}\n {items && items.length > 0 && (\n <div\n className={`snackbar-items-container ${\n isExpanded ? 'snackbar-items-expanded' : 'snackbar-items-collapsed'\n }`}\n >\n <div className=\"snackbar-items-list\">\n {items.map((item) => (\n <div key={item.id} className=\"snackbar-item\" onClick={item.onClick}>\n <div className=\"snackbar-item-content\">\n <Icon name={getFileIcon(item)} size={16} className=\"snackbar-item-icon\" />\n <span className=\"snackbar-item-name\">{item.name}</span>\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Action button */}\n {action && (\n <div className=\"snackbar-actions\">\n <button\n className={`snackbar-action-button snackbar-action-${action.variant || 'primary'}`}\n onClick={action.onClick}\n >\n {action.label}\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["Snackbar","open","onClose","title","description","position","variant","autoHideDuration","showCloseButton","action","className","style","showProgress","progress","iconProps","items","defaultExpanded","compact","automationId","isVisible","setIsVisible","useState","isExiting","setIsExiting","isExpanded","setIsExpanded","useEffect","timer","setTimeout","handleClose","clearTimeout","handleToggleExpanded","getFileIcon","item","icon","type","getPositionClasses","getVariantClasses","default","success","warning","error","info","getContainerStyle","baseStyle","left","transform","React","createElement","role","name","Icon","_extends","size","length","stroke","rotation","onClick","fill","ProgressBar","totalTasks","completedTasks","needPercentageCompleted","progressBarColor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AA;AAAA,MAAKtC,WAAU;AAAA,IAAkC,CAAA,CAC9C,IAELqC,gBAAAA,EAAAC,cAACW,GAAW;AAAA,MACVC,YAAY;AAAA,MACZC,gBAAgBhD;AAAAA,MAChBiD,yBAAyB;AAAA,MACzBC,kBAAiB;AAAA,IAAA,CAClB,CAEA,GAINhD,KAASA,EAAMuC,SAAS,KACvBN,gBAAAA,EAAAA,cAAA,OAAA;AAAA,MACEtC,WAAW,4BACTc,IAAa,4BAA4B,0BAA0B;AAAA,IAAA,GAGrEwB,gBAAAA,EAAAA,cAAA,OAAA;AAAA,MAAKtC,WAAU;AAAA,IAAA,GACZK,EAAMiD,IAAK/B,CACVc,MAAAA,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MAAKiB,KAAKhC,EAAKiC;AAAAA,MAAIxD,WAAU;AAAA,MAAgB+C,SAASxB,EAAKwB;AAAAA,IAAAA,GACzDT,gBAAAA,EAAAA,cAAA,OAAA;AAAA,MAAKtC,WAAU;AAAA,IAAA,GACbsC,gBAAAA,EAAAA,cAACG,GAAI;AAAA,MAACD,MAAMlB,EAAYC,CAAI;AAAA,MAAGoB,MAAM;AAAA,MAAI3C,WAAU;AAAA,IAAA,CAAsB,GACzEsC,gBAAAA,EAAAA,cAAA,QAAA;AAAA,MAAMtC,WAAU;AAAA,IAAA,GAAsBuB,EAAKiB,IAAW,CACnD,CACF,CACN,CACE,CACF,GAINzC,KACCuC,gBAAAA,EAAAA,cAAA,OAAA;AAAA,MAAKtC,WAAU;AAAA,IAAA,GACbsC,gBAAAA,EAAAA,cAAA,UAAA;AAAA,MACEtC,WAAW,0CAA0CD,EAAOH,WAAW,SAAS;AAAA,MAChFmD,SAAShD,EAAOgD;AAAAA,IAAAA,GAEfhD,EAAO0D,KACF,CACL,CAEJ;AAAA,GAEJ,CACF;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index57.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,E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MsB,CAAAA,MAAO;AACXtE,MAAAA,EAAUqB,QAAQN,CAAK,IAAIuD;AAAAA,IAC7B;AAAA,IACAC,MAAK;AAAA,IACLC,WAAU;AAAA,IACVC,WAAW;AAAA,IACXzD,OAAAA;AAAAA,IACAlC,UAAUA,CAAC+C,MAAqCF,EAAaZ,GAAOc,EAAE6C,OAAO1D,KAAK;AAAA,IAClF2D,WAAWA,CAAC9C,MAAuCD,EAAcb,GAAOc,CAAC;AAAA,IACzE+C,SAASrC;AAAAA,IACTsC,SAASA,MAAMnB,EAAY3C,CAAK;AAAA,IAChC+D,QAAQlB;AAAAA,IACR3E,UAAAA;AAAAA,IACAC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBASPD,IACI,iDACA6E,IACA,mIACA,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":"index57.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;A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AOc,CAAC;AAAA,IACzE+C,SAASrC;AAAAA,IACTsC,SAASA,MAAMnB,EAAY3C,CAAK;AAAA,IAChC+D,QAAQlB;AAAAA,IACR3E,UAAAA;AAAAA,IACAC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBASPD,IACI,iDACA6E,IACA,mIACA,mIAAmI;AAAA;AAAA,IAG3IiB,OAAO;AAAA,MACLC,KAAK;AAAA,IACP;AAAA,IACA,cAAY,aAAajE,IAAQ,CAAC,OAAOlC,CAAM;AAAA,IAC/C,gBAAciF;AAAAA,IACd,oBAAkBE;AAAAA,IAClB,sBAAoB,aAAajD,CAAK;AAAA,EACvC,CAAA,CACF,CACE,GACJgD,KAAgBG,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAK3E,IAAIc;AAAAA,IAASpB,WAAU;AAAA,IAA4BkF,MAAK;AAAA,EAAA,GAASL,CAAkB,CACtG;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index58.js","sources":["../src/components/InfoBar/index.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { Icon } from \"../Icon\";\n\nexport interface InfoBarProps {\n className?: string;\n message: string;\n backgroundColor?: string;\n textColor?: string;\n borderColor?: string;\n actionJSX?: () => React.ReactNode;\n}\n\nexport const InfoBar: FC<InfoBarProps> = ({\n className = \"\",\n message = \"\",\n backgroundColor = 'var(--color-yellow-50)',\n textColor = 'var(--color-yellow-800)',\n borderColor = 'var(--color-yellow-200)',\n actionJSX = () => <></>\n}) => {\n\n return (\n <div\n className={`se-design-info-bar ${className} px-3 py-2 border rounded-[6px]`}\n style={{ backgroundColor, borderColor, color: textColor }}\n >\n <div className={`info-bar-message flex items-center gap-2`}>\n <div style={{ transform: 'rotate(180deg)' }}><Icon name=\"info\" stroke={textColor} /></div>\n <span style={{ color: textColor }}>{message}</span>\n </div>\n <div className={`info-bar-action ml-[22px]`}>\n {actionJSX()}\n </div>\n </div>\n );\n};"],"names":["InfoBar","className","message","backgroundColor","textColor","borderColor","actionJSX","React","createElement","Fragment","style","color","transform","Icon","name","stroke"],"mappings":";;AAYO,MAAMA,IAA4BA,CAAC;AAAA,EACxCC,WAAAA,IAAY;AAAA,EACZC,SAAAA,IAAU;AAAA,EACVC,iBAAAA,IAAkB;AAAA,EAClBC,WAAAA,IAAY;AAAA,EACZC,aAAAA,IAAc;AAAA,EACdC,WAAAA,IAAYA,MAAMC,gBAAAA,EAAAC,cAAAD,EAAAE,UAAA,IAAI;AACxB,MAGIF,gBAAAA,EAAAC,cAAA,OAAA;AAAA,EACEP,WAAW,sBAAsBA,CAAS;AAAA,EAC1CS,OAAO;AAAA,IAAEP,iBAAAA;AAAAA,IAAiBE,aAAAA;AAAAA,IAAaM,OAAOP;AAAAA,EAAAA;AAAU,GAExDG,gBAAAA,EAAAC,cAAA,OAAA;AAAA,EAAKP,WAAW;AAAA,GACdM,gBAAAA,EAAAC,cAAA,OAAA;AAAA,EAAKE,OAAO;AAAA,IAAEE,WAAW;AAAA,EAAA;AAAiB,GAAGL,gBAAAA,EAAAC,cAACK,GAAI;AAAA,EAACC,MAAK;AAAA,EAAOC,QAAQX;AAAAA,CAAY,CAAM,GACzFG,gBAAAA,EAAAC,cAAA,QAAA;AAAA,EAAME,OAAO;AAAA,IAAEC,OAAOP;AAAAA,EAAAA;AAAU,GAAIF,CAAc,CAC/C,GACLK,gBAAAA,EAAAC,cAAA,OAAA;AAAA,EAAKP,WAAW;AAAA,GACbK,EAAAA,CACE,CACF;"}
1
+ {"version":3,"file":"index58.js","sources":["../src/components/InfoBar/index.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { Icon } from \"../Icon\";\n\nexport interface InfoBarProps {\n className?: string;\n message: string;\n backgroundColor?: string;\n textColor?: string;\n borderColor?: string;\n actionJSX?: () => React.ReactNode;\n}\n\nexport const InfoBar: FC<InfoBarProps> = ({\n className = \"\",\n message = \"\",\n backgroundColor = 'var(--color-yellow-50)',\n textColor = 'var(--color-yellow-800)',\n borderColor = 'var(--color-yellow-200)',\n actionJSX = () => <></>\n}) => {\n\n return (\n <div\n className={`se-design-info-bar ${className} px-3 py-2 border rounded-[6px]`}\n style={{ backgroundColor, borderColor, color: textColor }}\n >\n <div className={`info-bar-message flex items-center gap-2`}>\n <div style={{ transform: 'rotate(180deg)' }}><Icon name=\"info\" stroke={textColor} /></div>\n <span style={{ color: textColor }}>{message}</span>\n </div>\n <div className={`info-bar-action ml-[22px]`}>\n {actionJSX()}\n </div>\n </div>\n );\n};"],"names":["InfoBar","className","message","backgroundColor","textColor","borderColor","actionJSX","React","createElement","Fragment","style","color","transform","Icon","name","stroke"],"mappings":";;AAYO,MAAMA,IAA4BA,CAAC;AAAA,EACxCC,WAAAA,IAAY;AAAA,EACZC,SAAAA,IAAU;AAAA,EACVC,iBAAAA,IAAkB;AAAA,EAClBC,WAAAA,IAAY;AAAA,EACZC,aAAAA,IAAc;AAAA,EACdC,WAAAA,IAAYA,MAAMC,gBAAAA,EAAAC,cAAAD,EAAAE,UAAI,IAAA;AACxB,MAGIF,gBAAAA,EAAAC,cAAA,OAAA;AAAA,EACEP,WAAW,sBAAsBA,CAAS;AAAA,EAC1CS,OAAO;AAAA,IAAEP,iBAAAA;AAAAA,IAAiBE,aAAAA;AAAAA,IAAaM,OAAOP;AAAAA,EAAU;AAAA,GAExDI,gBAAAA,EAAAA,cAAA,OAAA;AAAA,EAAKP,WAAW;AAAA,GACdO,gBAAAA,EAAAA,cAAA,OAAA;AAAA,EAAKE,OAAO;AAAA,IAAEE,WAAW;AAAA,EAAiB;AAAA,GAAGJ,gBAAAA,EAAAA,cAACK,GAAI;AAAA,EAACC,MAAK;AAAA,EAAOC,QAAQX;AAAY,CAAA,CAAM,GACzFG,gBAAAA,EAAAC,cAAA,QAAA;AAAA,EAAME,OAAO;AAAA,IAAEC,OAAOP;AAAAA,EAAU;GAAIF,CAAc,CAC/C,GACLK,gBAAAA,EAAAC,cAAA,OAAA;AAAA,EAAKP,WAAW;AAAA,GACbK,EACE,CAAA,CACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index59.js","sources":["../src/components/BottomSheet/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef } from 'react';\nimport { CustomModal } from '../CustomModal';\nimport { Icon } from '../Icon';\n\nimport './style.scss';\n\nexport interface BottomSheetProps {\n isOpen: boolean;\n title?: string;\n onClose: () => void;\n showCloseIcon?: boolean;\n showBackButton?: boolean;\n onBack?: () => void;\n children: React.ReactNode;\n className?: string;\n automationId?: string;\n minHeight?: string;\n}\n\ninterface BottomSheetContentProps {\n title?: string;\n onClose: () => void;\n showCloseIcon?: boolean;\n showBackButton?: boolean;\n onBack?: () => void;\n children: React.ReactNode;\n className?: string;\n automationId?: string;\n minHeight?: string;\n}\n\nconst BottomSheetContent: FC<BottomSheetContentProps> = ({\n children = null,\n title = '',\n onClose = () => {},\n showCloseIcon = false,\n showBackButton = false,\n onBack = () => {},\n className = '',\n automationId = '',\n minHeight = 'auto'\n}) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const [startY, setStartY] = useState<number>(0);\n const [currentY, setCurrentY] = useState<number>(0);\n const [isDragging, setIsDragging] = useState<boolean>(false);\n\n const handleTouchStart = (e: React.TouchEvent) => {\n setStartY(e.touches[0].clientY);\n setCurrentY(e.touches[0].clientY);\n setIsDragging(true);\n };\n\n const handleTouchMove = (e: React.TouchEvent) => {\n if (!isDragging) return;\n\n const touchY = e.touches[0].clientY;\n const deltaY = touchY - startY;\n\n // Only allow dragging down\n if (deltaY > 0) {\n setCurrentY(touchY);\n if (contentRef.current) {\n contentRef.current.style.transform = `translateY(${deltaY}px)`;\n }\n }\n };\n\n const handleTouchEnd = () => {\n if (!isDragging) return;\n\n const deltaY = currentY - startY;\n const threshold = 60; // pixels to swipe down to trigger close\n\n if (deltaY > threshold) {\n // Trigger close\n onClose();\n } else {\n // Reset position\n if (contentRef.current) {\n contentRef.current.style.transform = 'translateY(0)';\n }\n }\n\n setIsDragging(false);\n setStartY(0);\n setCurrentY(0);\n };\n\n return (\n <div\n ref={contentRef}\n className={`se-design-bottom-sheet relative h-max max-h-[98vh] rounded-t-2xl flex flex-col pt-5 ${className}`}\n onClick={(e) => e.stopPropagation()}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n data-automation-id={automationId}\n style={{ minHeight }}\n >\n {(title || showBackButton) && (\n <div className=\"se-design-bottom-sheet-header flex items-center justify-left gap-3 mr-6 px-4\">\n {showBackButton && (\n <Icon\n name=\"back\"\n stroke=\"var(--color-gray-700)\"\n onClick={onBack}\n className=\"se-design-bottom-sheet-back-icon cursor-pointer\"\n automationId={`${automationId}-back-icon`}\n />\n )}\n {title && <div className=\"se-design-bottom-sheet-title text-lg font-semibold\">{title}</div>}\n </div>\n )}\n {showCloseIcon && (\n <Icon\n name=\"close\"\n onClick={onClose}\n className=\"se-design-bottom-sheet-close-icon absolute top-6 right-4 cursor-pointer z-10\"\n automationId={`${automationId}-close-icon`}\n />\n )}\n <div className=\"se-design-bottom-sheet-content px-4 pb-5 flex-1 min-h-0 overflow-y-auto\">{children}</div>\n </div>\n );\n};\n\nexport const BottomSheet: FC<BottomSheetProps> = ({\n isOpen = false,\n title = '',\n onClose = () => {},\n children = null,\n showCloseIcon = true,\n showBackButton = false,\n onBack = () => {},\n className = '',\n automationId = 'bottomsheet',\n minHeight = ''\n}) => {\n return (\n <CustomModal\n isOpen={isOpen}\n onClose={onClose}\n onModalClick={onClose}\n className=\"custom-bottom-sheet\"\n renderModalContent={() => (\n <BottomSheetContent\n title={title}\n onClose={onClose}\n showCloseIcon={showCloseIcon}\n showBackButton={showBackButton}\n onBack={onBack}\n className={className}\n automationId={automationId}\n minHeight={minHeight}\n >\n {children}\n </BottomSheetContent>\n )}\n />\n );\n};\n"],"names":["BottomSheetContent","children","title","onClose","showCloseIcon","showBackButton","onBack","className","automationId","minHeight","contentRef","useRef","startY","setStartY","useState","currentY","setCurrentY","isDragging","setIsDragging","handleTouchStart","e","touches","clientY","handleTouchMove","touchY","deltaY","current","style","transform","handleTouchEnd","React","createElement","ref","onClick","stopPropagation","onTouchStart","onTouchMove","onTouchEnd","Icon","name","stroke","BottomSheet","isOpen","CustomModal","onModalClick","renderModalContent"],"mappings":";;;;AA+BA,MAAMA,IAAkDA,CAAC;AAAA,EACvDC,UAAAA,IAAW;AAAA,EACXC,OAAAA,IAAQ;AAAA,EACRC,SAAAA,IAAUA,MAAM;AAAA,EAAC;AAAA,EACjBC,eAAAA,IAAgB;AAAA,EAChBC,gBAAAA,IAAiB;AAAA,EACjBC,QAAAA,IAASA,MAAM;AAAA,EAAC;AAAA,EAChBC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,WAAAA,IAAY;AACd,MAAM;AACJ,QAAMC,IAAaC,EAAuB,IAAI,GACxC,CAACC,GAAQC,CAAS,IAAIC,EAAiB,CAAC,GACxC,CAACC,GAAUC,CAAW,IAAIF,EAAiB,CAAC,GAC5C,CAACG,GAAYC,CAAa,IAAIJ,EAAkB,EAAK,GAErDK,IAAmBA,CAACC,MAAwB;AAChDP,IAAAA,EAAUO,EAAEC,QAAQ,CAAC,EAAEC,OAAO,GAC9BN,EAAYI,EAAEC,QAAQ,CAAC,EAAEC,OAAO,GAChCJ,EAAc,EAAI;AAAA,EACpB,GAEMK,IAAkBA,CAACH,MAAwB;AAC/C,QAAI,CAACH,EAAY;AAEjB,UAAMO,IAASJ,EAAEC,QAAQ,CAAC,EAAEC,SACtBG,IAASD,IAASZ;AAGxB,IAAIa,IAAS,MACXT,EAAYQ,CAAM,GACdd,EAAWgB,YACbhB,EAAWgB,QAAQC,MAAMC,YAAY,cAAcH,CAAM;AAAA,EAG/D,GAEMI,IAAiBA,MAAM;AAC3B,QAAI,CAACZ,EAAY;AAKjB,IAHeF,IAAWH,IACR,KAIhBT,EAAAA,IAGIO,EAAWgB,YACbhB,EAAWgB,QAAQC,MAAMC,YAAY,kBAIzCV,EAAc,EAAK,GACnBL,EA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AA,EACfC,WAAAA,IAAY;AACd,MAEIqB,gBAAAA,EAAAC,cAACY,GAAW;AAAA,EACVD,QAAAA;AAAAA,EACAvC,SAAAA;AAAAA,EACAyC,cAAczC;AAAAA,EACdI,WAAU;AAAA,EACVsC,oBAAoBA,MAClBf,gBAAAA,EAAAC,cAAC/B,GAAkB;AAAA,IACjBE,OAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,WAAAA;AAAAA,EAAAA,GAECR,CACiB;AAAA,CAEvB;"}
1
+ {"version":3,"file":"index59.js","sources":["../src/components/BottomSheet/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef } from 'react';\nimport { CustomModal } from '../CustomModal';\nimport { Icon } from '../Icon';\n\nimport './style.scss';\n\nexport interface BottomSheetProps {\n isOpen: boolean;\n title?: string;\n onClose: () => void;\n showCloseIcon?: boolean;\n showBackButton?: boolean;\n onBack?: () => void;\n children: React.ReactNode;\n className?: string;\n automationId?: string;\n minHeight?: string;\n}\n\ninterface BottomSheetContentProps {\n title?: string;\n onClose: () => void;\n showCloseIcon?: boolean;\n showBackButton?: boolean;\n onBack?: () => void;\n children: React.ReactNode;\n className?: string;\n automationId?: string;\n minHeight?: string;\n}\n\nconst BottomSheetContent: FC<BottomSheetContentProps> = ({\n children = null,\n title = '',\n onClose = () => {},\n showCloseIcon = false,\n showBackButton = false,\n onBack = () => {},\n className = '',\n automationId = '',\n minHeight = 'auto'\n}) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const [startY, setStartY] = useState<number>(0);\n const [currentY, setCurrentY] = useState<number>(0);\n const [isDragging, setIsDragging] = useState<boolean>(false);\n\n const handleTouchStart = (e: React.TouchEvent) => {\n setStartY(e.touches[0].clientY);\n setCurrentY(e.touches[0].clientY);\n setIsDragging(true);\n };\n\n const handleTouchMove = (e: React.TouchEvent) => {\n if (!isDragging) return;\n\n const touchY = e.touches[0].clientY;\n const deltaY = touchY - startY;\n\n // Only allow dragging down\n if (deltaY > 0) {\n setCurrentY(touchY);\n if (contentRef.current) {\n contentRef.current.style.transform = `translateY(${deltaY}px)`;\n }\n }\n };\n\n const handleTouchEnd = () => {\n if (!isDragging) return;\n\n const deltaY = currentY - startY;\n const threshold = 60; // pixels to swipe down to trigger close\n\n if (deltaY > threshold) {\n // Trigger close\n onClose();\n } else {\n // Reset position\n if (contentRef.current) {\n contentRef.current.style.transform = 'translateY(0)';\n }\n }\n\n setIsDragging(false);\n setStartY(0);\n setCurrentY(0);\n };\n\n return (\n <div\n ref={contentRef}\n className={`se-design-bottom-sheet relative h-max max-h-[98vh] rounded-t-2xl flex flex-col pt-5 ${className}`}\n onClick={(e) => e.stopPropagation()}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n data-automation-id={automationId}\n style={{ minHeight }}\n >\n {(title || showBackButton) && (\n <div className=\"se-design-bottom-sheet-header flex items-center justify-left gap-3 mr-6 px-4\">\n {showBackButton && (\n <Icon\n name=\"back\"\n stroke=\"var(--color-gray-700)\"\n onClick={onBack}\n className=\"se-design-bottom-sheet-back-icon cursor-pointer\"\n automationId={`${automationId}-back-icon`}\n />\n )}\n {title && <div className=\"se-design-bottom-sheet-title text-lg font-semibold\">{title}</div>}\n </div>\n )}\n {showCloseIcon && (\n <Icon\n name=\"close\"\n onClick={onClose}\n className=\"se-design-bottom-sheet-close-icon absolute top-6 right-4 cursor-pointer z-10\"\n automationId={`${automationId}-close-icon`}\n />\n )}\n <div className=\"se-design-bottom-sheet-content px-4 pb-5 flex-1 min-h-0 overflow-y-auto\">{children}</div>\n </div>\n );\n};\n\nexport const BottomSheet: FC<BottomSheetProps> = ({\n isOpen = false,\n title = '',\n onClose = () => {},\n children = null,\n showCloseIcon = true,\n showBackButton = false,\n onBack = () => {},\n className = '',\n automationId = 'bottomsheet',\n minHeight = ''\n}) => {\n return (\n <CustomModal\n isOpen={isOpen}\n onClose={onClose}\n onModalClick={onClose}\n className=\"custom-bottom-sheet\"\n renderModalContent={() => (\n <BottomSheetContent\n title={title}\n onClose={onClose}\n showCloseIcon={showCloseIcon}\n showBackButton={showBackButton}\n onBack={onBack}\n className={className}\n automationId={automationId}\n minHeight={minHeight}\n >\n {children}\n </BottomSheetContent>\n )}\n />\n );\n};\n"],"names":["BottomSheetContent","children","title","onClose","showCloseIcon","showBackButton","onBack","className","automationId","minHeight","contentRef","useRef","startY","setStartY","useState","currentY","setCurrentY","isDragging","setIsDragging","handleTouchStart","e","touches","clientY","handleTouchMove","touchY","deltaY","current","style","transform","handleTouchEnd","React","createElement","ref","onClick","stopPropagation","onTouchStart","onTouchMove","onTouchEnd","Icon","name","stroke","BottomSheet","isOpen","CustomModal","onModalClick","renderModalContent"],"mappings":";;;;AA+BA,MAAMA,IAAkDA,CAAC;AAAA,EACvDC,UAAAA,IAAW;AAAA,EACXC,OAAAA,IAAQ;AAAA,EACRC,SAAAA,IAAUA,MAAM;AAAA,EAAC;AAAA,EACjBC,eAAAA,IAAgB;AAAA,EAChBC,gBAAAA,IAAiB;AAAA,EACjBC,QAAAA,IAASA,MAAM;AAAA,EAAC;AAAA,EAChBC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,WAAAA,IAAY;AACd,MAAM;AACEC,QAAAA,IAAaC,EAAuB,IAAI,GACxC,CAACC,GAAQC,CAAS,IAAIC,EAAiB,CAAC,GACxC,CAACC,GAAUC,CAAW,IAAIF,EAAiB,CAAC,GAC5C,CAACG,GAAYC,CAAa,IAAIJ,EAAkB,EAAK,GAErDK,IAAmBA,CAACC,MAAwB;AAChDP,IAAAA,EAAUO,EAAEC,QAAQ,CAAC,EAAEC,OAAO,GAC9BN,EAAYI,EAAEC,QAAQ,CAAC,EAAEC,OAAO,GAChCJ,EAAc,EAAI;AAAA,EAAA,GAGdK,IAAkBA,CAACH,MAAwB;AAC/C,Q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