@lidofinance/lido-app-ui 1.14.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +33 -14
  2. package/dist/README.md +33 -14
  3. package/dist/cjs/breadcrumbs/Breadcrumbs.cjs +10 -3
  4. package/dist/cjs/breadcrumbs/Breadcrumbs.cjs.map +1 -1
  5. package/dist/cjs/button/Button.cjs +7 -7
  6. package/dist/cjs/button/Button.cjs.map +1 -1
  7. package/dist/cjs/button/ButtonContent.cjs +0 -2
  8. package/dist/cjs/button/ButtonContent.cjs.map +1 -1
  9. package/dist/cjs/button/LinkButton.cjs +6 -35
  10. package/dist/cjs/button/LinkButton.cjs.map +1 -1
  11. package/dist/cjs/counter/Counter.module.css.cjs +1 -1
  12. package/dist/cjs/disclaimer/Disclaimer.cjs +0 -1
  13. package/dist/cjs/disclaimer/Disclaimer.cjs.map +1 -1
  14. package/dist/cjs/hidden/Hidden.cjs.map +1 -1
  15. package/dist/cjs/hidden/Hidden.module.css.cjs +1 -1
  16. package/dist/cjs/icon-button/CloseButton.cjs.map +1 -1
  17. package/dist/cjs/icon-button/IconButton.cjs +7 -7
  18. package/dist/cjs/icon-button/IconButton.cjs.map +1 -1
  19. package/dist/cjs/index.cjs +5 -2
  20. package/dist/cjs/index.cjs.map +1 -1
  21. package/dist/cjs/index.css +14 -6
  22. package/dist/cjs/info-tooltip/InfoTooltip.cjs +4 -4
  23. package/dist/cjs/info-tooltip/InfoTooltip.cjs.map +1 -1
  24. package/dist/cjs/info-tooltip/InfoTooltip.module.css.cjs +1 -1
  25. package/dist/cjs/input/Input.cjs +23 -11
  26. package/dist/cjs/input/Input.cjs.map +1 -1
  27. package/dist/cjs/input/Input.module.css.cjs +1 -1
  28. package/dist/cjs/link-provider/Anchor.cjs +19 -6
  29. package/dist/cjs/link-provider/Anchor.cjs.map +1 -1
  30. package/dist/cjs/link-provider/LinkProvider.cjs +1 -1
  31. package/dist/cjs/link-provider/LinkProvider.cjs.map +1 -1
  32. package/dist/cjs/logo/Logo.cjs.map +1 -1
  33. package/dist/cjs/nav-link/NavLink.cjs +7 -3
  34. package/dist/cjs/nav-link/NavLink.cjs.map +1 -1
  35. package/dist/cjs/rich-input/RichInput.cjs +46 -16
  36. package/dist/cjs/rich-input/RichInput.cjs.map +1 -1
  37. package/dist/cjs/rich-input/RichInput.module.css.cjs +1 -1
  38. package/dist/cjs/sidebar/Sidebar.cjs +2 -2
  39. package/dist/cjs/sidebar/Sidebar.cjs.map +1 -1
  40. package/dist/cjs/sidebar/SidebarToggle.cjs +1 -1
  41. package/dist/cjs/sidebar/SidebarToggle.cjs.map +1 -1
  42. package/dist/cjs/small-card/SmallCard.cjs.map +1 -1
  43. package/dist/cjs/stack/Stack.cjs +1 -1
  44. package/dist/cjs/stack/Stack.cjs.map +1 -1
  45. package/dist/cjs/tag/Tag.cjs.map +1 -1
  46. package/dist/cjs/tag/Tag.module.css.cjs +1 -1
  47. package/dist/cjs/text-link/TextLink.cjs +1 -3
  48. package/dist/cjs/text-link/TextLink.cjs.map +1 -1
  49. package/dist/cjs/theme-switcher/ThemeSwitcher.cjs.map +1 -1
  50. package/dist/cjs/typography/Typography.cjs +21 -8
  51. package/dist/cjs/typography/Typography.cjs.map +1 -1
  52. package/dist/cjs/typography/Typography.module.css.cjs +1 -1
  53. package/dist/cjs/utils/ActionElement.cjs +1 -1
  54. package/dist/cjs/utils/ActionElement.cjs.map +1 -1
  55. package/dist/cjs/utils/breakpoints.cjs +11 -12
  56. package/dist/cjs/utils/breakpoints.cjs.map +1 -1
  57. package/dist/cjs/utils/joinAriaLabel.cjs +8 -0
  58. package/dist/cjs/utils/joinAriaLabel.cjs.map +1 -0
  59. package/dist/cjs/utils/responsive.cjs.map +1 -1
  60. package/dist/esm/breadcrumbs/Breadcrumbs.mjs +10 -3
  61. package/dist/esm/breadcrumbs/Breadcrumbs.mjs.map +1 -1
  62. package/dist/esm/button/Button.mjs +7 -7
  63. package/dist/esm/button/Button.mjs.map +1 -1
  64. package/dist/esm/button/ButtonContent.mjs +1 -2
  65. package/dist/esm/button/ButtonContent.mjs.map +1 -1
  66. package/dist/esm/button/LinkButton.mjs +6 -35
  67. package/dist/esm/button/LinkButton.mjs.map +1 -1
  68. package/dist/esm/counter/Counter.module.css.mjs +1 -1
  69. package/dist/esm/disclaimer/Disclaimer.mjs +0 -1
  70. package/dist/esm/disclaimer/Disclaimer.mjs.map +1 -1
  71. package/dist/esm/hidden/Hidden.mjs.map +1 -1
  72. package/dist/esm/hidden/Hidden.module.css.mjs +1 -1
  73. package/dist/esm/icon-button/CloseButton.mjs.map +1 -1
  74. package/dist/esm/icon-button/IconButton.mjs +7 -7
  75. package/dist/esm/icon-button/IconButton.mjs.map +1 -1
  76. package/dist/esm/index.css +14 -6
  77. package/dist/esm/index.mjs +2 -2
  78. package/dist/esm/index.mjs.map +1 -1
  79. package/dist/esm/info-tooltip/InfoTooltip.mjs +4 -4
  80. package/dist/esm/info-tooltip/InfoTooltip.mjs.map +1 -1
  81. package/dist/esm/info-tooltip/InfoTooltip.module.css.mjs +1 -1
  82. package/dist/esm/input/Input.mjs +23 -11
  83. package/dist/esm/input/Input.mjs.map +1 -1
  84. package/dist/esm/input/Input.module.css.mjs +1 -1
  85. package/dist/esm/link-provider/Anchor.mjs +19 -7
  86. package/dist/esm/link-provider/Anchor.mjs.map +1 -1
  87. package/dist/esm/link-provider/LinkProvider.mjs +1 -1
  88. package/dist/esm/link-provider/LinkProvider.mjs.map +1 -1
  89. package/dist/esm/logo/Logo.mjs.map +1 -1
  90. package/dist/esm/nav-link/NavLink.mjs +8 -4
  91. package/dist/esm/nav-link/NavLink.mjs.map +1 -1
  92. package/dist/esm/rich-input/RichInput.mjs +46 -16
  93. package/dist/esm/rich-input/RichInput.mjs.map +1 -1
  94. package/dist/esm/rich-input/RichInput.module.css.mjs +1 -1
  95. package/dist/esm/sidebar/Sidebar.mjs +2 -2
  96. package/dist/esm/sidebar/Sidebar.mjs.map +1 -1
  97. package/dist/esm/sidebar/SidebarToggle.mjs +1 -1
  98. package/dist/esm/sidebar/SidebarToggle.mjs.map +1 -1
  99. package/dist/esm/small-card/SmallCard.mjs.map +1 -1
  100. package/dist/esm/stack/Stack.mjs +1 -1
  101. package/dist/esm/stack/Stack.mjs.map +1 -1
  102. package/dist/esm/tag/Tag.mjs.map +1 -1
  103. package/dist/esm/tag/Tag.module.css.mjs +1 -1
  104. package/dist/esm/text-link/TextLink.mjs +1 -3
  105. package/dist/esm/text-link/TextLink.mjs.map +1 -1
  106. package/dist/esm/theme-switcher/ThemeSwitcher.mjs.map +1 -1
  107. package/dist/esm/typography/Typography.mjs +19 -9
  108. package/dist/esm/typography/Typography.mjs.map +1 -1
  109. package/dist/esm/typography/Typography.module.css.mjs +1 -1
  110. package/dist/esm/utils/ActionElement.mjs +1 -1
  111. package/dist/esm/utils/ActionElement.mjs.map +1 -1
  112. package/dist/esm/utils/breakpoints.mjs +10 -11
  113. package/dist/esm/utils/breakpoints.mjs.map +1 -1
  114. package/dist/esm/utils/joinAriaLabel.mjs +4 -0
  115. package/dist/esm/utils/joinAriaLabel.mjs.map +1 -0
  116. package/dist/esm/utils/responsive.mjs.map +1 -1
  117. package/dist/index.css +14 -6
  118. package/dist/styles/breakpoints.css +10 -16
  119. package/dist/styles/typography-mixins.css +14 -4
  120. package/dist/types/breadcrumbs/Breadcrumbs.d.ts +2 -2
  121. package/dist/types/breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  122. package/dist/types/button/Button.d.ts +4 -10
  123. package/dist/types/button/Button.d.ts.map +1 -1
  124. package/dist/types/button/ButtonContent.d.ts +0 -1
  125. package/dist/types/button/ButtonContent.d.ts.map +1 -1
  126. package/dist/types/button/LinkButton.d.ts +9 -8
  127. package/dist/types/button/LinkButton.d.ts.map +1 -1
  128. package/dist/types/button/index.d.ts +1 -1
  129. package/dist/types/button/index.d.ts.map +1 -1
  130. package/dist/types/button/types.d.ts +4 -0
  131. package/dist/types/button/types.d.ts.map +1 -1
  132. package/dist/types/hidden/Hidden.d.ts +4 -4
  133. package/dist/types/hidden/Hidden.d.ts.map +1 -1
  134. package/dist/types/icon-button/CloseButton.d.ts +3 -3
  135. package/dist/types/icon-button/CloseButton.d.ts.map +1 -1
  136. package/dist/types/icon-button/IconButton.d.ts +4 -38
  137. package/dist/types/icon-button/IconButton.d.ts.map +1 -1
  138. package/dist/types/icon-button/index.d.ts +1 -1
  139. package/dist/types/icon-button/index.d.ts.map +1 -1
  140. package/dist/types/icon-button/types.d.ts +26 -0
  141. package/dist/types/icon-button/types.d.ts.map +1 -0
  142. package/dist/types/index.d.ts +1 -1
  143. package/dist/types/index.d.ts.map +1 -1
  144. package/dist/types/info-tooltip/InfoTooltip.d.ts +4 -1
  145. package/dist/types/info-tooltip/InfoTooltip.d.ts.map +1 -1
  146. package/dist/types/input/Input.d.ts +5 -1
  147. package/dist/types/input/Input.d.ts.map +1 -1
  148. package/dist/types/link-provider/Anchor.d.ts +3 -2
  149. package/dist/types/link-provider/Anchor.d.ts.map +1 -1
  150. package/dist/types/link-provider/LinkProvider.d.ts +1 -1
  151. package/dist/types/link-provider/LinkProvider.d.ts.map +1 -1
  152. package/dist/types/logo/Logo.d.ts +5 -8
  153. package/dist/types/logo/Logo.d.ts.map +1 -1
  154. package/dist/types/nav-link/NavLink.d.ts +2 -2
  155. package/dist/types/nav-link/NavLink.d.ts.map +1 -1
  156. package/dist/types/rich-input/RichInput.d.ts +9 -2
  157. package/dist/types/rich-input/RichInput.d.ts.map +1 -1
  158. package/dist/types/sidebar/Sidebar.d.ts +2 -2
  159. package/dist/types/sidebar/Sidebar.d.ts.map +1 -1
  160. package/dist/types/sidebar/SidebarToggle.d.ts +4 -4
  161. package/dist/types/sidebar/SidebarToggle.d.ts.map +1 -1
  162. package/dist/types/small-card/SmallCard.d.ts +2 -8
  163. package/dist/types/small-card/SmallCard.d.ts.map +1 -1
  164. package/dist/types/stack/Stack.d.ts +1 -1
  165. package/dist/types/stack/Stack.d.ts.map +1 -1
  166. package/dist/types/tag/Tag.d.ts +3 -1
  167. package/dist/types/tag/Tag.d.ts.map +1 -1
  168. package/dist/types/text-link/TextLink.d.ts +3 -9
  169. package/dist/types/text-link/TextLink.d.ts.map +1 -1
  170. package/dist/types/theme-switcher/ThemeSwitcher.d.ts +3 -3
  171. package/dist/types/theme-switcher/ThemeSwitcher.d.ts.map +1 -1
  172. package/dist/types/typography/Typography.d.ts +15 -6
  173. package/dist/types/typography/Typography.d.ts.map +1 -1
  174. package/dist/types/utils/ActionElement.d.ts +11 -1
  175. package/dist/types/utils/ActionElement.d.ts.map +1 -1
  176. package/dist/types/utils/breakpoints.d.ts +9 -10
  177. package/dist/types/utils/breakpoints.d.ts.map +1 -1
  178. package/dist/types/utils/index.d.ts +3 -2
  179. package/dist/types/utils/index.d.ts.map +1 -1
  180. package/dist/types/utils/joinAriaLabel.d.ts +2 -0
  181. package/dist/types/utils/joinAriaLabel.d.ts.map +1 -0
  182. package/dist/types/utils/responsive.d.ts +12 -16
  183. package/dist/types/utils/responsive.d.ts.map +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { ThemeToggler as SharedThemeToggler } from '@lidofinance/lido-shared-ui'\n\nexport * from './icons'\n\nexport * from './accordion'\nexport * from './address'\nexport * from './address-button'\nexport * from './badge'\nexport * from './banner'\nexport * from './breadcrumbs'\nexport * from './button'\nexport * from './card'\nexport * from './checkbox'\nexport * from './copy'\nexport * from './counter'\nexport * from './data-list'\nexport * from './disclaimer'\nexport * from './divider'\nexport * from './error-page'\nexport * from './footer'\nexport * from './grid'\nexport * from './header'\nexport * from './hex'\nexport * from './hidden'\nexport {\n Portal,\n useBodyScrollLock,\n useEscape,\n useFocusTrap,\n useOutsideClick,\n} from './hooks'\nexport type { FocusTrapOptions, PortalProps } from './hooks'\nexport * from './icon-button'\nexport * from './identicon'\nexport * from './info-tooltip'\nexport * from './input'\nexport * from './link-provider'\nexport * from './logo'\nexport * from './message-box'\nexport * from './modal'\nexport * from './nav-link'\nexport * from './notification'\nexport * from './page-layout'\nexport * from './pagination'\nexport * from './popover'\nexport * from './radio-button'\nexport * from './rich-input'\nexport * from './section-title'\nexport * from './segmented-control'\nexport * from './sidebar'\nexport * from './skeleton'\nexport * from './skip-link'\nexport * from './slider'\nexport * from './small-card'\nexport * from './stack'\nexport * from './stat-item'\nexport * from './switch'\nexport * from './tabs'\nexport * from './tag'\nexport * from './text-link'\nexport * from './theme-switcher'\nexport * from './token-amount'\nexport * from './token-selector'\nexport * from './tooltip'\nexport * from './tx-status'\nexport * from './typography'\nexport {\n breakpoints,\n breakpointWidths,\n logoBreakpointWidth,\n sidebarBreakpointWidth,\n spaces,\n} from './utils'\nexport type { Breakpoint, Responsive, Space } from './utils'\n\n// Everything lido-shared-ui exposes is re-exported, so app products get the\n// same non-production banner and theming primitives as the landing. Their\n// styles come in through src/styles/global.css.\nexport * from '@lidofinance/lido-shared-ui'\n\n/** Unstyled in app-ui (relies on `--lido-ui-*` tokens); prefer `ThemeSwitcher`. */\nexport const ThemeToggler = SharedThemeToggler\n"],"names":["ThemeToggler","SharedThemeToggler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA;AACO,MAAMA,YAAY,GAAGC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { ThemeToggler as SharedThemeToggler } from '@lidofinance/lido-shared-ui'\n\nexport * from './icons'\n\nexport * from './accordion'\nexport * from './address'\nexport * from './address-button'\nexport * from './badge'\nexport * from './banner'\nexport * from './breadcrumbs'\nexport * from './button'\nexport * from './card'\nexport * from './checkbox'\nexport * from './copy'\nexport * from './counter'\nexport * from './data-list'\nexport * from './disclaimer'\nexport * from './divider'\nexport * from './error-page'\nexport * from './footer'\nexport * from './grid'\nexport * from './header'\nexport * from './hex'\nexport * from './hidden'\nexport {\n Portal,\n useBodyScrollLock,\n useEscape,\n useFocusTrap,\n useOutsideClick,\n} from './hooks'\nexport type { FocusTrapOptions, PortalProps } from './hooks'\nexport * from './icon-button'\nexport * from './identicon'\nexport * from './info-tooltip'\nexport * from './input'\nexport * from './link-provider'\nexport * from './logo'\nexport * from './message-box'\nexport * from './modal'\nexport * from './nav-link'\nexport * from './notification'\nexport * from './page-layout'\nexport * from './pagination'\nexport * from './popover'\nexport * from './radio-button'\nexport * from './rich-input'\nexport * from './section-title'\nexport * from './segmented-control'\nexport * from './sidebar'\nexport * from './skeleton'\nexport * from './skip-link'\nexport * from './slider'\nexport * from './small-card'\nexport * from './stack'\nexport * from './stat-item'\nexport * from './switch'\nexport * from './tabs'\nexport * from './tag'\nexport * from './text-link'\nexport * from './theme-switcher'\nexport * from './token-amount'\nexport * from './token-selector'\nexport * from './tooltip'\nexport * from './tx-status'\nexport * from './typography'\nexport {\n breakpoints,\n breakpointWidths,\n downQuery,\n upQuery,\n spaces,\n} from './utils'\nexport type { Breakpoint, Responsive, Space } from './utils'\n\n// Everything lido-shared-ui exposes is re-exported, so app products get the\n// same non-production banner and theming primitives as the landing. Their\n// styles come in through src/styles/global.css.\nexport * from '@lidofinance/lido-shared-ui'\n\n/** Unstyled in app-ui (relies on `--lido-ui-*` tokens); prefer `ThemeSwitcher`. */\nexport const ThemeToggler = SharedThemeToggler\n"],"names":["ThemeToggler","SharedThemeToggler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA;AACO,MAAMA,YAAY,GAAGC;;;;"}
@@ -6,6 +6,9 @@ import { IconInfo } from '../icons/components/base/IconInfo.mjs';
6
6
 
7
7
  const InfoTooltip = _ref => {
8
8
  let {
9
+ icon = /*#__PURE__*/jsx(IconInfo, {
10
+ "aria-hidden": "true"
11
+ }),
9
12
  size = 16,
10
13
  tone = 'secondary',
11
14
  className,
@@ -18,10 +21,7 @@ const InfoTooltip = _ref => {
18
21
  "aria-label": ariaLabel ?? 'More info',
19
22
  className: cn(styles.root, styles[`size${size}`], styles[tone], className),
20
23
  ...rest,
21
- children: /*#__PURE__*/jsx(IconInfo, {
22
- className: styles.icon,
23
- "aria-hidden": "true"
24
- })
24
+ children: icon
25
25
  });
26
26
  };
27
27
  InfoTooltip.displayName = 'InfoTooltip';
@@ -1 +1 @@
1
- {"version":3,"file":"InfoTooltip.mjs","sources":["../../../src/info-tooltip/InfoTooltip.tsx"],"sourcesContent":["import cn from 'classnames'\n\nimport { IconInfo } from '../icons'\nimport { Tooltip, type TooltipProps } from '../tooltip'\nimport styles from './InfoTooltip.module.css'\n\nexport type InfoTooltipSize = 16 | 20\nexport type InfoTooltipTone = 'secondary' | 'tertiary'\n\nexport type InfoTooltipProps = Omit<TooltipProps, 'children'> & {\n size?: InfoTooltipSize\n tone?: InfoTooltipTone\n}\n\nexport const InfoTooltip = ({\n size = 16,\n tone = 'secondary',\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: InfoTooltipProps) => (\n <Tooltip\n tabIndex={0}\n role='img'\n aria-label={ariaLabel ?? 'More info'}\n className={cn(styles.root, styles[`size${size}`], styles[tone], className)}\n {...rest}\n >\n <IconInfo className={styles.icon} aria-hidden='true' />\n </Tooltip>\n)\n\nInfoTooltip.displayName = 'InfoTooltip'\n"],"names":["InfoTooltip","_ref","size","tone","className","ariaLabel","rest","_jsx","Tooltip","tabIndex","role","cn","styles","root","children","IconInfo","icon","displayName"],"mappings":";;;;;;AAcO,MAAMA,WAAW,GAAGC,IAAA,IAAA;EAAA,IAAC;AAC1BC,IAAAA,IAAI,GAAG,EAAE;AACTC,IAAAA,IAAI,GAAG,WAAW;IAClBC,SAAS;AACT,IAAA,YAAY,EAAEC,SAAS;IACvB,GAAGC,IAAAA;AACa,GAAC,GAAAL,IAAA,CAAA;EAAA,oBACjBM,GAAA,CAACC,OAAO,EAAA;AACNC,IAAAA,QAAQ,EAAE,CAAE;AACZC,IAAAA,IAAI,EAAC,KAAK;IACV,YAAYL,EAAAA,SAAS,IAAI,WAAY;IACrCD,SAAS,EAAEO,EAAE,CAACC,MAAM,CAACC,IAAI,EAAED,MAAM,CAAC,CAAA,IAAA,EAAOV,IAAI,CAAE,CAAA,CAAC,EAAEU,MAAM,CAACT,IAAI,CAAC,EAAEC,SAAS,CAAE;AAAA,IAAA,GACvEE,IAAI;IAAAQ,QAAA,eAERP,GAAA,CAACQ,QAAQ,EAAA;MAACX,SAAS,EAAEQ,MAAM,CAACI,IAAK;MAAC,aAAY,EAAA,MAAA;KAAQ,CAAA;AAAC,GAChD,CAAC,CAAA;AAAA,EACX;AAEDhB,WAAW,CAACiB,WAAW,GAAG,aAAa;;;;"}
1
+ {"version":3,"file":"InfoTooltip.mjs","sources":["../../../src/info-tooltip/InfoTooltip.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport cn from 'classnames'\n\nimport { IconInfo } from '../icons'\nimport { Tooltip, type TooltipProps } from '../tooltip'\nimport styles from './InfoTooltip.module.css'\n\nexport type InfoTooltipSize = 16 | 20\nexport type InfoTooltipTone = 'secondary' | 'tertiary'\n\nexport type InfoTooltipProps = Omit<TooltipProps, 'children'> & {\n /** Glyph; defaults to the info icon. */\n icon?: ReactNode\n size?: InfoTooltipSize\n tone?: InfoTooltipTone\n}\n\nexport const InfoTooltip = ({\n icon = <IconInfo aria-hidden='true' />,\n size = 16,\n tone = 'secondary',\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: InfoTooltipProps) => (\n <Tooltip\n tabIndex={0}\n role='img'\n aria-label={ariaLabel ?? 'More info'}\n className={cn(styles.root, styles[`size${size}`], styles[tone], className)}\n {...rest}\n >\n {icon}\n </Tooltip>\n)\n\nInfoTooltip.displayName = 'InfoTooltip'\n"],"names":["InfoTooltip","_ref","icon","_jsx","IconInfo","size","tone","className","ariaLabel","rest","Tooltip","tabIndex","role","cn","styles","root","children","displayName"],"mappings":";;;;;;AAkBO,MAAMA,WAAW,GAAGC,IAAA,IAAA;EAAA,IAAC;IAC1BC,IAAI,gBAAGC,GAAA,CAACC,QAAQ,EAAA;MAAC,aAAY,EAAA,MAAA;AAAM,KAAE,CAAC;AACtCC,IAAAA,IAAI,GAAG,EAAE;AACTC,IAAAA,IAAI,GAAG,WAAW;IAClBC,SAAS;AACT,IAAA,YAAY,EAAEC,SAAS;IACvB,GAAGC,IAAAA;AACa,GAAC,GAAAR,IAAA,CAAA;EAAA,oBACjBE,GAAA,CAACO,OAAO,EAAA;AACNC,IAAAA,QAAQ,EAAE,CAAE;AACZC,IAAAA,IAAI,EAAC,KAAK;IACV,YAAYJ,EAAAA,SAAS,IAAI,WAAY;IACrCD,SAAS,EAAEM,EAAE,CAACC,MAAM,CAACC,IAAI,EAAED,MAAM,CAAC,CAAA,IAAA,EAAOT,IAAI,CAAE,CAAA,CAAC,EAAES,MAAM,CAACR,IAAI,CAAC,EAAEC,SAAS,CAAE;AAAA,IAAA,GACvEE,IAAI;AAAAO,IAAAA,QAAA,EAEPd,IAAAA;AAAI,GACE,CAAC,CAAA;AAAA,EACX;AAEDF,WAAW,CAACiB,WAAW,GAAG,aAAa;;;;"}
@@ -1,4 +1,4 @@
1
- const styles = {"root":"InfoTooltip-module_root__HGLUD","secondary":"InfoTooltip-module_secondary__XmntX","tertiary":"InfoTooltip-module_tertiary__L0AVh","icon":"InfoTooltip-module_icon__fpCrp","size16":"InfoTooltip-module_size16__7XWPZ","size20":"InfoTooltip-module_size20__Ivz-f"};
1
+ const styles = {"root":"InfoTooltip-module_root__HGLUD","secondary":"InfoTooltip-module_secondary__XmntX","tertiary":"InfoTooltip-module_tertiary__L0AVh","size16":"InfoTooltip-module_size16__7XWPZ","size20":"InfoTooltip-module_size20__Ivz-f"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=InfoTooltip.module.css.mjs.map
@@ -3,8 +3,9 @@ import cn from 'classnames';
3
3
  import styles from './Input.module.css.mjs';
4
4
  import { jsxs, jsx } from 'react/jsx-runtime';
5
5
  import { InfoTooltip } from '../info-tooltip/InfoTooltip.mjs';
6
+ import { Skeleton } from '../skeleton/Skeleton.mjs';
6
7
 
7
- /** Bordered text field; `icon` adds a leading icon, `label`/`description`/`error` add the field chrome, `tooltip` puts an info icon next to the label. */
8
+ /** Bordered text field; `icon` adds a leading icon, `label`/`description`/`error` add the field chrome, `tooltip` puts an info icon next to the label, `loading` swaps the value for a skeleton. */
8
9
  const Input = /*#__PURE__*/forwardRef((_ref, ref) => {
9
10
  let {
10
11
  size = 'default',
@@ -14,6 +15,8 @@ const Input = /*#__PURE__*/forwardRef((_ref, ref) => {
14
15
  description,
15
16
  error,
16
17
  disabled,
18
+ loading,
19
+ readOnly,
17
20
  className,
18
21
  id,
19
22
  dataTestId,
@@ -41,22 +44,31 @@ const Input = /*#__PURE__*/forwardRef((_ref, ref) => {
41
44
  }) : null, /*#__PURE__*/jsxs("label", {
42
45
  className: cn(styles.root, styles[size], {
43
46
  [styles.error]: hasError,
44
- [styles.disabled]: disabled
47
+ [styles.disabled]: disabled,
48
+ [styles.loading]: loading
45
49
  }),
46
50
  children: [icon ? /*#__PURE__*/jsx("span", {
47
51
  className: styles.icon,
48
52
  "aria-hidden": "true",
49
53
  "data-testid": dataTestId?.icon,
50
54
  children: icon
51
- }) : null, /*#__PURE__*/jsx("input", {
52
- ref: ref,
53
- id: inputId,
54
- className: styles.input,
55
- disabled: disabled,
56
- "aria-invalid": hasError || undefined,
57
- "aria-describedby": showErrorMessage ? errorId : undefined,
58
- "data-testid": dataTestId?.input,
59
- ...rest
55
+ }) : null, /*#__PURE__*/jsxs("span", {
56
+ className: styles.control,
57
+ children: [/*#__PURE__*/jsx("input", {
58
+ ref: ref,
59
+ id: inputId,
60
+ className: styles.input,
61
+ disabled: disabled,
62
+ readOnly: loading || readOnly,
63
+ "aria-busy": loading || undefined,
64
+ "aria-invalid": hasError || undefined,
65
+ "aria-describedby": showErrorMessage ? errorId : undefined,
66
+ "data-testid": dataTestId?.input,
67
+ ...rest
68
+ }), loading ? /*#__PURE__*/jsx(Skeleton, {
69
+ variant: "text",
70
+ className: styles.skeleton
71
+ }) : null]
60
72
  })]
61
73
  }), showErrorMessage ? /*#__PURE__*/jsx("p", {
62
74
  id: errorId,
@@ -1 +1 @@
1
- {"version":3,"file":"Input.mjs","sources":["../../../src/input/Input.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\n\nimport cn from 'classnames'\n\nimport { InfoTooltip } from '../info-tooltip'\nimport styles from './Input.module.css'\n\nexport type InputSize = 'default' | 'small'\n\nexport type InputDataTestId = {\n root?: string\n label?: string\n icon?: string\n input?: string\n error?: string\n description?: string\n}\n\nexport type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {\n size?: InputSize\n icon?: ReactNode\n label?: ReactNode\n tooltip?: ReactNode\n description?: ReactNode\n error?: ReactNode | boolean\n dataTestId?: InputDataTestId\n}\n\n/** Bordered text field; `icon` adds a leading icon, `label`/`description`/`error` add the field chrome, `tooltip` puts an info icon next to the label. */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n size = 'default',\n icon,\n label,\n tooltip,\n description,\n error,\n disabled,\n className,\n id,\n dataTestId,\n ...rest\n },\n ref,\n ) => {\n const fallbackId = useId()\n const inputId = id ?? fallbackId\n const errorId = `${inputId}-error`\n\n const hasError = Boolean(error)\n const errorMessage = typeof error === 'boolean' ? null : error\n const showErrorMessage = errorMessage != null\n\n return (\n <div\n className={cn(styles.field, className)}\n data-testid={dataTestId?.root}\n >\n {label != null ? (\n <span className={styles.labelRow}>\n <label\n className={styles.label}\n htmlFor={inputId}\n data-testid={dataTestId?.label}\n >\n {label}\n </label>\n {tooltip != null ? <InfoTooltip content={tooltip} /> : null}\n </span>\n ) : null}\n <label\n className={cn(styles.root, styles[size], {\n [styles.error]: hasError,\n [styles.disabled]: disabled,\n })}\n >\n {icon ? (\n <span\n className={styles.icon}\n aria-hidden='true'\n data-testid={dataTestId?.icon}\n >\n {icon}\n </span>\n ) : null}\n <input\n ref={ref}\n id={inputId}\n className={styles.input}\n disabled={disabled}\n aria-invalid={hasError || undefined}\n aria-describedby={showErrorMessage ? errorId : undefined}\n data-testid={dataTestId?.input}\n {...rest}\n />\n </label>\n {showErrorMessage ? (\n <p\n id={errorId}\n className={styles.errorText}\n role='alert'\n data-testid={dataTestId?.error}\n >\n {errorMessage}\n </p>\n ) : null}\n {description != null ? (\n <p\n className={styles.description}\n data-testid={dataTestId?.description}\n >\n {description}\n </p>\n ) : null}\n </div>\n )\n },\n)\n\nInput.displayName = 'Input'\n"],"names":["Input","forwardRef","_ref","ref","size","icon","label","tooltip","description","error","disabled","className","id","dataTestId","rest","fallbackId","useId","inputId","errorId","hasError","Boolean","errorMessage","showErrorMessage","_jsxs","cn","styles","field","root","children","labelRow","_jsx","htmlFor","InfoTooltip","content","input","undefined","errorText","role","displayName"],"mappings":";;;;;;AAiCA;AACO,MAAMA,KAAK,gBAAGC,UAAU,CAC7B,CAAAC,IAAA,EAcEC,GAAG,KACA;EAAA,IAdH;AACEC,IAAAA,IAAI,GAAG,SAAS;IAChBC,IAAI;IACJC,KAAK;IACLC,OAAO;IACPC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC,SAAS;IACTC,EA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F,EAAC;AAEDR,KAAK,CAACsC,WAAW,GAAG,OAAO;;;;"}
1
+ {"version":3,"file":"Input.mjs","sources":["../../../src/input/Input.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\n\nimport cn from 'classnames'\n\nimport { InfoTooltip } from '../info-tooltip'\nimport { Skeleton } from '../skeleton'\nimport styles from './Input.module.css'\n\nexport type InputSize = 'default' | 'small'\n\nexport type InputDataTestId = {\n root?: string\n label?: string\n icon?: string\n input?: string\n error?: string\n description?: string\n}\n\nexport type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {\n size?: InputSize\n icon?: ReactNode\n label?: ReactNode\n tooltip?: ReactNode\n description?: ReactNode\n error?: ReactNode | boolean\n /** Swaps the value for a skeleton and makes the field read-only. */\n loading?: boolean\n dataTestId?: InputDataTestId\n}\n\n/** Bordered text field; `icon` adds a leading icon, `label`/`description`/`error` add the field chrome, `tooltip` puts an info icon next to the label, `loading` swaps the value for a skeleton. */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n size = 'default',\n icon,\n label,\n tooltip,\n description,\n error,\n disabled,\n loading,\n readOnly,\n className,\n id,\n dataTestId,\n ...rest\n },\n ref,\n ) => {\n const fallbackId = useId()\n const inputId = id ?? fallbackId\n const errorId = `${inputId}-error`\n\n const hasError = Boolean(error)\n const errorMessage = typeof error === 'boolean' ? null : error\n const showErrorMessage = errorMessage != null\n\n return (\n <div\n className={cn(styles.field, className)}\n data-testid={dataTestId?.root}\n >\n {label != null ? (\n <span className={styles.labelRow}>\n <label\n className={styles.label}\n htmlFor={inputId}\n data-testid={dataTestId?.label}\n >\n {label}\n </label>\n {tooltip != null ? <InfoTooltip content={tooltip} /> : null}\n </span>\n ) : null}\n <label\n className={cn(styles.root, styles[size], {\n [styles.error]: hasError,\n [styles.disabled]: disabled,\n [styles.loading]: loading,\n })}\n >\n {icon ? (\n <span\n className={styles.icon}\n aria-hidden='true'\n data-testid={dataTestId?.icon}\n >\n {icon}\n </span>\n ) : null}\n <span className={styles.control}>\n <input\n ref={ref}\n id={inputId}\n className={styles.input}\n disabled={disabled}\n readOnly={loading || readOnly}\n aria-busy={loading || undefined}\n aria-invalid={hasError || undefined}\n aria-describedby={showErrorMessage ? errorId : undefined}\n data-testid={dataTestId?.input}\n {...rest}\n />\n {loading ? (\n <Skeleton variant='text' className={styles.skeleton} />\n ) : null}\n </span>\n </label>\n {showErrorMessage ? (\n <p\n id={errorId}\n className={styles.errorText}\n role='alert'\n data-testid={dataTestId?.error}\n >\n {errorMessage}\n </p>\n ) : null}\n {description != null ? (\n <p\n className={styles.description}\n data-testid={dataTestId?.description}\n >\n {description}\n </p>\n ) : null}\n </div>\n )\n },\n)\n\nInput.displayName = 'Input'\n"],"names":["Input","forwardRef","_ref","ref","size","icon","label","tooltip","description","error","disabled","loading","readOnly","className","id","dataTestId","rest","fallbackId","useId","inputId","errorId","hasError","Boolean","errorMessage","showErrorMessage","_jsxs","cn","styles","field","root","children","labelRow","_jsx","htmlFor","InfoTooltip","content","control","input","undefined","Skeleton","variant","skeleton","errorText","role","displayName"],"mappings":";;;;;;;AAoCA;AACO,MAAMA,KAAK,gBAAGC,UAAU,CAC7B,CAAAC,IAAA,EAgBEC,GAAG,KACA;EAAA,IAhBH;AACEC,IAAAA,IAAI,GAAG,SAAS;IAChBC,IAAI;IACJC,KAAK;IACLC,OAAO;IACPC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC,OAAO;IACPC,QAAQ;IACRC,SAAS;IACTC,EAAE;IACFC,UAAU;IACV,GAAGC,IAAAA;AACL,GAAC,GAAAd,IAAA,CAAA;AAGD,EAAA,MAAMe,UAAU,GAAGC,KAAK,EAAE,CAAA;AAC1B,EAAA,MAAMC,OAAO,GAAGL,EAAE,IAAIG,UAAU,CAAA;AAChC,EAAA,MAAMG,OAAO,GAAG,CAAGD,EAAAA,OAAO,CAAQ,MAAA,CAAA,CAAA;AAElC,EAAA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B,aAAaO,EAAAA,UAAU,EAAEP,WAAY;AAAAsB,MAAAA,QAAA,EAEpCtB,WAAAA;KACA,CAAC,GACF,IAAI,CAAA;AAAA,GACL,CAAC,CAAA;AAEV,CACF,EAAC;AAEDR,KAAK,CAAC4C,WAAW,GAAG,OAAO;;;;"}
@@ -1,4 +1,4 @@
1
- const styles = {"field":"Input-module_field__INC-m","labelRow":"Input-module_labelRow__AT-Kg","label":"Input-module_label__1UZiS","root":"Input-module_root__zCKm2","input":"Input-module_input__paElZ","error":"Input-module_error__kcS-O","disabled":"Input-module_disabled__fbybp","default":"Input-module_default__UeWH5","small":"Input-module_small__ESlJP","icon":"Input-module_icon__2IBf9","errorText":"Input-module_errorText__jYCqP","description":"Input-module_description__EVlJm"};
1
+ const styles = {"field":"Input-module_field__INC-m","labelRow":"Input-module_labelRow__AT-Kg","label":"Input-module_label__1UZiS","root":"Input-module_root__zCKm2","input":"Input-module_input__paElZ","error":"Input-module_error__kcS-O","disabled":"Input-module_disabled__fbybp","default":"Input-module_default__UeWH5","control":"Input-module_control__bTG7Y","small":"Input-module_small__ESlJP","loading":"Input-module_loading__pBWPp","skeleton":"Input-module_skeleton__-STiF","icon":"Input-module_icon__2IBf9","errorText":"Input-module_errorText__jYCqP","description":"Input-module_description__EVlJm"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=Input.module.css.mjs.map
@@ -3,32 +3,44 @@ import { useLinkComponents } from './LinkProvider.mjs';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
5
5
  const ABSOLUTE_URL = /^([a-z][a-z\d+.-]*:|\/\/)/i;
6
- const pickLink = (_ref, href, _ref2) => {
6
+ const WEB_URL = /^(https?:)?\/\//i;
7
+ const opensInNewTab = _ref => {
8
+ let {
9
+ href,
10
+ target,
11
+ external
12
+ } = _ref;
13
+ return external ?? (target === undefined && href !== undefined && WEB_URL.test(href));
14
+ };
15
+ const pickLink = (_ref2, href, _ref3) => {
7
16
  let {
8
17
  component,
9
18
  externalComponent
10
- } = _ref;
19
+ } = _ref2;
11
20
  let {
12
21
  target,
13
22
  download
14
- } = _ref2;
23
+ } = _ref3;
15
24
  if (ABSOLUTE_URL.test(href)) return externalComponent;
16
25
  if (href.startsWith('#') || target && target !== '_self' || download != null && download !== false) return undefined;
17
26
  return component;
18
27
  };
19
28
 
20
29
  /** `<a>` that hands in-app hrefs to `LinkProvider`'s `component` and absolute URLs to its `externalComponent`. */
21
- const Anchor = /*#__PURE__*/forwardRef((_ref3, ref) => {
30
+ const Anchor = /*#__PURE__*/forwardRef((_ref4, ref) => {
22
31
  let {
23
32
  external,
24
33
  disabled,
25
34
  linkProps,
26
35
  ...rest
27
- } = _ref3;
36
+ } = _ref4;
28
37
  const links = useLinkComponents();
29
38
  const props = {
30
39
  ...rest,
31
- ...(external && {
40
+ ...(!disabled && opensInNewTab({
41
+ ...rest,
42
+ external
43
+ }) && {
32
44
  target: rest.target ?? '_blank',
33
45
  rel: rest.rel ?? 'noopener noreferrer'
34
46
  }),
@@ -61,5 +73,5 @@ const Anchor = /*#__PURE__*/forwardRef((_ref3, ref) => {
61
73
  });
62
74
  Anchor.displayName = 'Anchor';
63
75
 
64
- export { Anchor };
76
+ export { Anchor, opensInNewTab };
65
77
  //# sourceMappingURL=Anchor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Anchor.mjs","sources":["../../../src/link-provider/Anchor.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes } from 'react'\n\nimport {\n useLinkComponents,\n type LinkComponents,\n type LinkRouterProps,\n} from './LinkProvider'\n\nconst ABSOLUTE_URL = /^([a-z][a-z\\d+.-]*:|\\/\\/)/i\n\nexport type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n /** Opens in a new tab: defaults `target` to `_blank` and `rel` to `noopener noreferrer`; an explicit `rel` wins. */\n external?: boolean\n /** Renders an href-less `role='link'` with `aria-disabled`, and drops `onClick`. */\n disabled?: boolean\n /** Router-only props (e.g. `prefetch`), passed to `LinkProvider` components and never to a plain `<a>`. */\n linkProps?: LinkRouterProps\n}\n\nconst pickLink = (\n { component, externalComponent }: LinkComponents,\n href: string,\n { target, download }: AnchorHTMLAttributes<HTMLAnchorElement>,\n) => {\n if (ABSOLUTE_URL.test(href)) return externalComponent\n if (\n href.startsWith('#') ||\n (target && target !== '_self') ||\n (download != null && download !== false)\n )\n return undefined\n return component\n}\n\n/** `<a>` that hands in-app hrefs to `LinkProvider`'s `component` and absolute URLs to its `externalComponent`. */\nexport const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(\n ({ external, disabled, linkProps, ...rest }, ref) => {\n const links = useLinkComponents()\n const props: AnchorHTMLAttributes<HTMLAnchorElement> = {\n ...rest,\n ...(external && {\n target: rest.target ?? '_blank',\n rel: rest.rel ?? 'noopener noreferrer',\n }),\n ...(disabled && {\n href: undefined,\n onClick: undefined,\n tabIndex: undefined,\n role: rest.role ?? 'link',\n 'aria-disabled': true,\n }),\n }\n const { href } = props\n\n if (href !== undefined) {\n const Link = pickLink(links, href, props)\n if (Link) return <Link ref={ref} {...props} {...linkProps} href={href} />\n }\n\n // eslint-disable-next-line jsx-a11y/anchor-has-content -- children arrive via props\n return <a ref={ref} {...props} />\n },\n)\n\nAnchor.displayName = 'Anchor'\n"],"names":["ABSOLUTE_URL","pickLink","_ref","href","_ref2","component","externalComponent","target","download","test","startsWith","undefined","Anchor","forwardRef","_ref3","ref","external","disabled","linkProps","rest","links","useLinkComponents","props","rel","onClick","tabIndex","role","Link","_jsx","displayName"],"mappings":";;;;AAQA,MAAMA,YAAY,GAAG,4BAA4B,CAAA;AAWjD,MAAMC,QAAQ,GAAGA,CAAAC,IAAA,EAEfC,IAAY,EAAAC,KAAA,KAET;EAAA,IAHH;IAAEC,SAAS;AAAEC,IAAAA,iBAAAA;AAAkC,GAAC,GAAAJ,IAAA,CAAA;EAAA,IAEhD;IAAEK,MAAM;AAAEC,IAAAA,QAAAA;AAAkD,GAAC,GAAAJ,KAAA,CAAA;E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oBAAOC,GAAA,CAACD,IAAI,EAAA;AAACZ,MAAAA,GAAG,EAAEA,GAAI;AAAA,MAAA,GAAKO,KAAK;AAAA,MAAA,GAAMJ,SAAS;AAAEf,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAE,CAAC,CAAA;AAC3E,GAAA;;AAEA;AACA,EAAA,oBAAOyB,GAAA,CAAA,GAAA,EAAA;AAAGb,IAAAA,GAAG,EAAEA,GAAI;IAAA,GAAKO,KAAAA;AAAK,GAAG,CAAC,CAAA;AACnC,CACF,EAAC;AAEDV,MAAM,CAACiB,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Anchor.mjs","sources":["../../../src/link-provider/Anchor.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes } from 'react'\n\nimport {\n useLinkComponents,\n type LinkComponents,\n type LinkRouterProps,\n} from './LinkProvider'\n\nconst ABSOLUTE_URL = /^([a-z][a-z\\d+.-]*:|\\/\\/)/i\nconst WEB_URL = /^(https?:)?\\/\\//i\n\nexport type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n /** @deprecated Absolute http(s) URLs open in a new tab automatically; pass `target` to override. */\n external?: boolean\n /** Renders an href-less `role='link'` with `aria-disabled`, and drops `onClick`. */\n disabled?: boolean\n /** Router-only props (e.g. `prefetch`), passed to `LinkProvider` components and never to a plain `<a>`. */\n linkProps?: LinkRouterProps\n}\n\nexport const opensInNewTab = ({\n href,\n target,\n external,\n}: Pick<AnchorProps, 'href' | 'target' | 'external'>) =>\n external ?? (target === undefined && href !== undefined && WEB_URL.test(href))\n\nconst pickLink = (\n { component, externalComponent }: LinkComponents,\n href: string,\n { target, download }: AnchorHTMLAttributes<HTMLAnchorElement>,\n) => {\n if (ABSOLUTE_URL.test(href)) return externalComponent\n if (\n href.startsWith('#') ||\n (target && target !== '_self') ||\n (download != null && download !== false)\n )\n return undefined\n return component\n}\n\n/** `<a>` that hands in-app hrefs to `LinkProvider`'s `component` and absolute URLs to its `externalComponent`. */\nexport const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(\n ({ external, disabled, linkProps, ...rest }, ref) => {\n const links = useLinkComponents()\n const props: AnchorHTMLAttributes<HTMLAnchorElement> = {\n ...rest,\n ...(!disabled &&\n opensInNewTab({ ...rest, external }) && {\n target: rest.target ?? '_blank',\n rel: rest.rel ?? 'noopener noreferrer',\n }),\n ...(disabled && {\n href: undefined,\n onClick: undefined,\n tabIndex: undefined,\n role: rest.role ?? 'link',\n 'aria-disabled': true,\n }),\n }\n const { href } = props\n\n if (href !== undefined) {\n const Link = pickLink(links, href, props)\n if (Link) return <Link ref={ref} {...props} {...linkProps} href={href} />\n }\n\n // eslint-disable-next-line jsx-a11y/anchor-has-content -- children arrive via props\n return <a ref={ref} {...props} />\n },\n)\n\nAnchor.displayName = 'Anchor'\n"],"names":["ABSOLUTE_URL","WEB_URL","opensInNewTab","_ref","href","target","external","undefined","test","pickLink","_ref2","_ref3","component","externalComponent","download","startsWith","Anchor","forwardRef","_ref4","ref","disabled","linkProps","rest","links","useLinkComponents","props","rel","onClick","tabIndex","role","Link","_jsx","displayName"],"mappings":";;;;AAQA,MAAMA,YAAY,GAAG,4BAA4B,CAAA;AACjD,MAAMC,OAAO,GAAG,kBAAkB,CAAA;AAW3B,MAAMC,aAAa,GAAGC,IAAA,IAAA;EAAA,IAAC;IAC5BC,IAAI;IACJC,MAAM;AACNC,IAAAA,QAAAA;AACiD,GAAC,GAAAH,IAAA,CAAA;AAAA,EAAA,OAClDG,QAAQ,KAAKD,MAAM,KAAKE,SAAS,IAAIH,IAAI,KAAKG,SAAS,IAAIN,OAAO,CAACO,IAAI,CAACJ,IAAI,CAAC,CAAC,CAAA;AAAA,EAAA;AAEhF,MAAMK,QAAQ,GAAGA,CAAAC,KAAA,EAEfN,IAAY,EAAAO,KAAA,KAET;EAAA,IAHH;IAAEC,SAAS;AAAEC,IAAAA,iBAAAA;AAAkC,GAAC,GAAAH,KAAA,CAAA;EAAA,IAEhD;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,CAAA;EAEtB,IAAIrB,IAAI,KAAKG,SAAS,EAAE;IACtB,MAAMuB,IAAI,GAAGrB,QAAQ,CAACc,KAAK,EAAEnB,IAAI,EAAEqB,KAAK,CAAC,CAAA;AACzC,IAAA,IAAIK,IAAI,EAAE,oBAAOC,GAAA,CAACD,IAAI,EAAA;AAACX,MAAAA,GAAG,EAAEA,GAAI;AAAA,MAAA,GAAKM,KAAK;AAAA,MAAA,GAAMJ,SAAS;AAAEjB,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAE,CAAC,CAAA;AAC3E,GAAA;;AAEA;AACA,EAAA,oBAAO2B,GAAA,CAAA,GAAA,EAAA;AAAGZ,IAAAA,GAAG,EAAEA,GAAI;IAAA,GAAKM,KAAAA;AAAK,GAAG,CAAC,CAAA;AACnC,CACF,EAAC;AAEDT,MAAM,CAACgB,WAAW,GAAG,QAAQ;;;;"}
@@ -2,7 +2,7 @@ import { useMemo, createContext, useContext } from 'react';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
4
  const LinkContext = /*#__PURE__*/createContext({});
5
- /** Renders app-ui links with your components: `component` for in-app hrefs (e.g. Next.js `Link`), `externalComponent` for absolute URLs; both must be `forwardRef` components that forward `ref` to an `<a>`. Pass stable references (module-level, not inline functions): inline ones remount every link on each render. In-app hash links, `download` links and non-`_self` `target` links stay a plain `<a>`; absolute URLs always go to `externalComponent` when set. `TextLink`, `NavLink`, `SmallCard`, `LinkButton`, `Tag`, `Breadcrumbs` items and `Logo` with `href` use it. */
5
+ /** Renders app-ui links with your components: `component` for in-app hrefs, `externalComponent` for absolute URLs. Both must be `forwardRef` components forwarding `ref` to an `<a>`, and stable module-level references, or every link remounts each render. */
6
6
  const LinkProvider = _ref => {
7
7
  let {
8
8
  component,
@@ -1 +1 @@
1
- {"version":3,"file":"LinkProvider.mjs","sources":["../../../src/link-provider/LinkProvider.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n useMemo,\n type AnchorHTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react'\n\n/** Augment via `declare module '@lidofinance/lido-app-ui'` to type router-only props (e.g. Next's `prefetch`), set per link with `linkProps`. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface LinkRouterProps {}\n\nexport type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n LinkRouterProps & {\n href: string\n ref?: Ref<HTMLAnchorElement>\n }\n\n/** Wrap adapters in `forwardRef`: under React 18 `ref` arrives as the second argument, never as a prop. */\nexport type LinkComponent = (props: LinkComponentProps) => ReactNode\n\nexport type LinkComponents = {\n /** Renders in-app hrefs (relative, not hash, `download` or non-`_self` `target`). */\n component?: LinkComponent\n /** Renders absolute URLs, including `mailto:` and protocol-relative `//`. */\n externalComponent?: LinkComponent\n}\n\nconst LinkContext = createContext<LinkComponents>({})\n\nexport type LinkProviderProps = LinkComponents & {\n children?: ReactNode\n}\n\n/** Renders app-ui links with your components: `component` for in-app hrefs (e.g. Next.js `Link`), `externalComponent` for absolute URLs; both must be `forwardRef` components that forward `ref` to an `<a>`. Pass stable references (module-level, not inline functions): inline ones remount every link on each render. In-app hash links, `download` links and non-`_self` `target` links stay a plain `<a>`; absolute URLs always go to `externalComponent` when set. `TextLink`, `NavLink`, `SmallCard`, `LinkButton`, `Tag`, `Breadcrumbs` items and `Logo` with `href` use it. */\nexport const LinkProvider = ({\n component,\n externalComponent,\n children,\n}: LinkProviderProps) => {\n const value = useMemo(\n () => ({ component, externalComponent }),\n [component, externalComponent],\n )\n return <LinkContext.Provider value={value}>{children}</LinkContext.Provider>\n}\n\nexport const useLinkComponents = () => useContext(LinkContext)\n"],"names":["LinkContext","createContext","LinkProvider","_ref","component","externalComponent","children","value","useMemo","_jsx","Provider","useLinkComponents","useContext"],"mappings":";;;AA6BA,MAAMA,WAAW,gBAAGC,aAAa,CAAiB,EAAE,CAAC,CAAA;AAMrD;AACaC,MAAAA,YAAY,GAAGC,IAAA,IAIH;EAAA,IAJI;IAC3BC,SAAS;IACTC,iBAAiB;AACjBC,IAAAA,QAAAA;AACiB,GAAC,GAAAH,IAAA,CAAA;AAClB,EAAA,MAAMI,KAAK,GAAGC,OAAO,CACnB,OAAO;IAAEJ,SAAS;AAAEC,IAAAA,iBAAAA;AAAkB,GAAC,CAAC,EACxC,CAACD,SAAS,EAAEC,iBAAiB,CAC/B,CAAC,CAAA;AACD,EAAA,oBAAOI,GAAA,CAACT,WAAW,CAACU,QAAQ,EAAA;AAACH,IAAAA,KAAK,EAAEA,KAAM;AAAAD,IAAAA,QAAA,EAAEA,QAAAA;AAAQ,GAAuB,CAAC,CAAA;AAC9E,EAAC;AAEM,MAAMK,iBAAiB,GAAGA,MAAMC,UAAU,CAACZ,WAAW;;;;"}
1
+ {"version":3,"file":"LinkProvider.mjs","sources":["../../../src/link-provider/LinkProvider.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n useMemo,\n type AnchorHTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react'\n\n/** Augment via `declare module '@lidofinance/lido-app-ui'` to type router-only props (e.g. Next's `prefetch`), set per link with `linkProps`. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface LinkRouterProps {}\n\nexport type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n LinkRouterProps & {\n href: string\n ref?: Ref<HTMLAnchorElement>\n }\n\n/** Wrap adapters in `forwardRef`: under React 18 `ref` arrives as the second argument, never as a prop. */\nexport type LinkComponent = (props: LinkComponentProps) => ReactNode\n\nexport type LinkComponents = {\n /** Renders in-app hrefs (relative, not hash, `download` or non-`_self` `target`). */\n component?: LinkComponent\n /** Renders absolute URLs, including `mailto:` and protocol-relative `//`. */\n externalComponent?: LinkComponent\n}\n\nconst LinkContext = createContext<LinkComponents>({})\n\nexport type LinkProviderProps = LinkComponents & {\n children?: ReactNode\n}\n\n/** Renders app-ui links with your components: `component` for in-app hrefs, `externalComponent` for absolute URLs. Both must be `forwardRef` components forwarding `ref` to an `<a>`, and stable module-level references, or every link remounts each render. */\nexport const LinkProvider = ({\n component,\n externalComponent,\n children,\n}: LinkProviderProps) => {\n const value = useMemo(\n () => ({ component, externalComponent }),\n [component, externalComponent],\n )\n return <LinkContext.Provider value={value}>{children}</LinkContext.Provider>\n}\n\nexport const useLinkComponents = () => useContext(LinkContext)\n"],"names":["LinkContext","createContext","LinkProvider","_ref","component","externalComponent","children","value","useMemo","_jsx","Provider","useLinkComponents","useContext"],"mappings":";;;AA6BA,MAAMA,WAAW,gBAAGC,aAAa,CAAiB,EAAE,CAAC,CAAA;AAMrD;AACaC,MAAAA,YAAY,GAAGC,IAAA,IAIH;EAAA,IAJI;IAC3BC,SAAS;IACTC,iBAAiB;AACjBC,IAAAA,QAAAA;AACiB,GAAC,GAAAH,IAAA,CAAA;AAClB,EAAA,MAAMI,KAAK,GAAGC,OAAO,CACnB,OAAO;IAAEJ,SAAS;AAAEC,IAAAA,iBAAAA;AAAkB,GAAC,CAAC,EACxC,CAACD,SAAS,EAAEC,iBAAiB,CAC/B,CAAC,CAAA;AACD,EAAA,oBAAOI,GAAA,CAACT,WAAW,CAACU,QAAQ,EAAA;AAACH,IAAAA,KAAK,EAAEA,KAAM;AAAAD,IAAAA,QAAA,EAAEA,QAAAA;AAAQ,GAAuB,CAAC,CAAA;AAC9E,EAAC;AAEM,MAAMK,iBAAiB,GAAGA,MAAMC,UAAU,CAACZ,WAAW;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.mjs","sources":["../../../src/logo/Logo.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type Ref,\n} from 'react'\n\nimport cn from 'classnames'\n\nimport { ActionElement } from '../utils'\nimport styles from './Logo.module.css'\n\nexport type LogoVariant = 'full' | 'compact' | 'auto'\n\nexport type LogoDataTestId = { root?: string; product?: string }\n\nexport type LogoProps = Omit<HTMLAttributes<HTMLElement>, 'children'> &\n Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'target' | 'download'> & {\n /** `full` shows the wordmark, `compact` drops it, `auto` drops it below `--lido-app-ui-breakpoint-logo` (1024px), overridable per instance with `--lido-app-ui-logo-breakpoint`. */\n variant?: LogoVariant\n /** Product name shown after a divider and added to the accessible name. */\n product?: string\n /** Renders a link; with only `onClick` it renders a button, otherwise a plain `role=\"img\"` element. */\n href?: string\n /** Opens the link in a new tab; needs `href`. */\n external?: boolean\n dataTestId?: LogoDataTestId\n }\n\nconst DROPLET = (\n <svg\n className={styles.droplet}\n viewBox='38 26 23 32'\n fill='currentColor'\n aria-hidden='true'\n >\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M49.485 26L57.6 38.398l-8.116 4.613-8.117-4.613L49.485 26zM43.85 37.81l5.634-8.602 5.633 8.601-5.633 3.201-5.634-3.2z'\n />\n <path d='M49.478 45.736l-9.416-5.35-.255.39c-2.896 4.428-2.25 10.226 1.554 13.945 4.48 4.372 11.747 4.372 16.233 0 3.812-3.719 4.458-9.517 1.554-13.945l-.254-.39-9.416 5.35z' />\n </svg>\n)\n\nconst WORDMARK = (\n <span className={styles.wordmark}>\n <svg\n className={styles.wordmarkSvg}\n viewBox='61 26 101 32'\n fill='currentColor'\n aria-hidden='true'\n >\n <path d='M90.17 50.449H79.462V33.551h3.267v13.917h7.441v2.981zm16.422 0h-3.267V33.551h3.267V50.45zm13.242 0V33.551h5.597c.85 0 1.54.029 2.062.093 1.351.156 2.519.624 3.492 1.398.988.773 1.735 1.767 2.244 2.98.515 1.207.769 2.534.769 3.982 0 1.448-.254 2.775-.769 3.988-.516 1.207-1.264 2.193-2.244 2.967-.98.773-2.141 1.242-3.492 1.398-.53.064-1.219.092-2.062.092h-5.597zm5.597-3.002c.85 0 1.474-.043 1.873-.12a3.218 3.218 0 001.801-1.001 5.002 5.002 0 001.082-1.923 7.97 7.97 0 00.363-2.406 7.96 7.96 0 00-.371-2.442c-.239-.76-.602-1.398-1.096-1.916a3.123 3.123 0 00-1.779-.972c-.399-.078-1.023-.12-1.873-.12h-2.279V47.44h2.279v.007zm28.191 3.357c-1.707 0-3.188-.362-4.458-1.093a7.432 7.432 0 01-2.919-3.102c-.675-1.327-1.009-2.867-1.009-4.613 0-1.745.334-3.285 1.009-4.613.683-1.327 1.656-2.356 2.919-3.087 1.263-.738 2.751-1.1 4.458-1.1 1.706 0 3.187.37 4.457 1.1a7.27 7.27 0 012.904 3.087c.683 1.328 1.024 2.868 1.024 4.613 0 1.746-.341 3.286-1.024 4.613-.675 1.328-1.641 2.364-2.904 3.102-1.263.73-2.751 1.093-4.457 1.093zm.094-3.002c1.06 0 1.946-.242 2.664-.717.719-.476 1.264-1.15 1.619-2.016.363-.865.538-1.887.538-3.065 0-1.817-.422-3.237-1.271-4.259-.849-1.021-2.098-1.54-3.746-1.54-1.06 0-1.946.242-2.664.717-.719.476-1.264 1.15-1.619 2.016-.363.865-.538 1.887-.538 3.066 0 1.816.421 3.236 1.271 4.258.849 1.022 2.098 1.54 3.746 1.54z' />\n </svg>\n </span>\n)\n\n/** Lido droplet with wordmark and an optional product name. */\nexport const Logo = forwardRef<HTMLElement, LogoProps>(\n (\n {\n variant = 'full',\n product,\n href,\n external,\n onClick,\n className,\n dataTestId,\n ...rest\n },\n ref,\n ) => {\n const label = product ? `Lido ${product}` : 'Lido'\n const content = (\n <>\n <span className={styles.mark}>\n {DROPLET}\n {variant === 'compact' ? null : WORDMARK}\n </span>\n {product ? (\n <>\n <span className={styles.divider} aria-hidden='true' />\n <span className={styles.product} data-testid={dataTestId?.product}>\n {product}\n </span>\n </>\n ) : null}\n </>\n )\n const classes = cn(styles.root, styles[variant], className)\n\n if (href || onClick) {\n return (\n <ActionElement\n ref={ref as Ref<HTMLAnchorElement | HTMLButtonElement>}\n className={cn(classes, styles.interactive)}\n aria-label={label}\n data-testid={dataTestId?.root}\n {...{\n href,\n external: href ? external : undefined,\n onClick,\n ...rest,\n }}\n >\n {content}\n </ActionElement>\n )\n }\n\n return (\n <span\n ref={ref as Ref<HTMLSpanElement>}\n role='img'\n aria-label={label}\n className={classes}\n data-testid={dataTestId?.root}\n {...rest}\n >\n {content}\n </span>\n )\n },\n)\n\nLogo.displayName = 'Logo'\n"],"names":["DROPLET","_jsxs","className","styles","droplet","viewBox","fill","children","_jsx","fillRule","clipRule","d","WORDMARK","wordmark","wordmarkSvg","Logo","forwardRef","_ref","ref","variant","product","href","external","onClick","dataTestId","rest","label","content","_Fragment","mark","divider","classes","cn","root","ActionElement","interactive","undefined","role","displayName"],"mappings":";;;;;;AA6BA,MAAMA,OAAO,gBACXC,IAAA,CAAA,KAAA,EAAA;EACEC,SAAS,EAAEC,MAAM,CAACC,OAAQ;AAC1BC,EAAAA,OAAO,EAAC,aAAa;AACrBC,EAAAA,IAAI,EAAC,cAAc;AACnB,EAAA,aAAA,EAAY,MAAM;AAAAC,EAAAA,QAAA,gBAElBC,GAAA,CAAA,MAAA,EAAA;AACEC,IAAAA,QAAQ,EAAC,SAAS;AAClBC,IAAAA,QAAQ,EAAC,SAAS;AAClBC,IAAAA,CAAC,EAAC,uHAAA;GACH,CAAC,eACFH,GAAA,CAAA,MAAA,EAAA;AAAMG,IAAAA,CAAC,EAAC,sKAAA;AAAsK,GAAE,CAAC,CAAA;AAAA,CAC9K,CACN,CAAA;AAED,MAAMC,QAAQ,gBACZJ,GAAA,CAAA,MAAA,EAAA;EAAMN,SAAS,EAAEC,MAAM,CAACU,QAAS;AAAAN,EAAAA,QAAA,eAC/BC,GAAA,CAAA,KAAA,EAAA;IACEN,SAAS,EAAEC,MAAM,CAACW,WAAY;AAC9BT,IAAAA,OAAO,EAAC,cAAc;AACtBC,IAAAA,IAAI,EAAC,cAAc;AACnB,IAAA,aAAA,EAAY,MAAM;AAAAC,IAAAA,QAAA,eAElBC,GAAA,CAAA,MAAA,EAAA;AAAMG,MAAAA,CAAC,EAAC,0zCAAA;KAA4zC,CAAA;GACj0C,CAAA;AAAC,CACF,CACP,CAAA;;AAED;AACO,MAAMI,IAAI,gBAAGC,UAAU,CAC5B,CAAAC,IAAA,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,CAACgC,WAAW,CAAE;AAC3C,MAAA,YAAA,EAAYT,KAAM;MAClB,aAAaF,EAAAA,UAAU,EAAES,IAAK;MAE5BZ,IAAI;AACJC,MAAAA,QAAQ,EAAED,IAAI,GAAGC,QAAQ,GAAGc,SAAS;MACrCb,OAAO;AACP,MAAA,GAAGE,IAAI;AAAAlB,MAAAA,QAAA,EAGRoB,OAAAA;AAAO,KACK,CAAC,CAAA;AAEpB,GAAA;AAEA,EAAA,oBACEnB,GAAA,CAAA,MAAA,EAAA;AACEU,IAAAA,GAAG,EAAEA,GAA4B;AACjCmB,IAAAA,IAAI,EAAC,KAAK;AACV,IAAA,YAAA,EAAYX,KAAM;AAClBxB,IAAAA,SAAS,EAAE6B,OAAQ;IACnB,aAAaP,EAAAA,UAAU,EAAES,IAAK;AAAA,IAAA,GAC1BR,IAAI;AAAAlB,IAAAA,QAAA,EAEPoB,OAAAA;AAAO,GACJ,CAAC,CAAA;AAEX,CACF,EAAC;AAEDZ,IAAI,CAACuB,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Logo.mjs","sources":["../../../src/logo/Logo.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type Ref,\n} from 'react'\n\nimport cn from 'classnames'\n\nimport type { AnchorProps } from '../link-provider/Anchor'\nimport { ActionElement } from '../utils'\nimport styles from './Logo.module.css'\n\nexport type LogoVariant = 'full' | 'compact' | 'auto'\n\nexport type LogoDataTestId = { root?: string; product?: string }\n\nexport type LogoProps = Omit<HTMLAttributes<HTMLElement>, 'children'> &\n Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'target' | 'download'> & {\n /** `full` shows the wordmark, `compact` drops it, `auto` drops it at `--lido-app-ui-breakpoint-lg` and below (1024px), overridable per instance with `--lido-app-ui-logo-breakpoint`. */\n variant?: LogoVariant\n /** Product name shown after a divider and added to the accessible name. */\n product?: string\n /** Renders a link; with only `onClick` it renders a button, otherwise a plain `role=\"img\"` element. */\n href?: string\n dataTestId?: LogoDataTestId\n } & Pick<AnchorProps, 'external'>\n\nconst DROPLET = (\n <svg\n className={styles.droplet}\n viewBox='38 26 23 32'\n fill='currentColor'\n aria-hidden='true'\n >\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M49.485 26L57.6 38.398l-8.116 4.613-8.117-4.613L49.485 26zM43.85 37.81l5.634-8.602 5.633 8.601-5.633 3.201-5.634-3.2z'\n />\n <path d='M49.478 45.736l-9.416-5.35-.255.39c-2.896 4.428-2.25 10.226 1.554 13.945 4.48 4.372 11.747 4.372 16.233 0 3.812-3.719 4.458-9.517 1.554-13.945l-.254-.39-9.416 5.35z' />\n </svg>\n)\n\nconst WORDMARK = (\n <span className={styles.wordmark}>\n <svg\n className={styles.wordmarkSvg}\n viewBox='61 26 101 32'\n fill='currentColor'\n aria-hidden='true'\n >\n <path d='M90.17 50.449H79.462V33.551h3.267v13.917h7.441v2.981zm16.422 0h-3.267V33.551h3.267V50.45zm13.242 0V33.551h5.597c.85 0 1.54.029 2.062.093 1.351.156 2.519.624 3.492 1.398.988.773 1.735 1.767 2.244 2.98.515 1.207.769 2.534.769 3.982 0 1.448-.254 2.775-.769 3.988-.516 1.207-1.264 2.193-2.244 2.967-.98.773-2.141 1.242-3.492 1.398-.53.064-1.219.092-2.062.092h-5.597zm5.597-3.002c.85 0 1.474-.043 1.873-.12a3.218 3.218 0 001.801-1.001 5.002 5.002 0 001.082-1.923 7.97 7.97 0 00.363-2.406 7.96 7.96 0 00-.371-2.442c-.239-.76-.602-1.398-1.096-1.916a3.123 3.123 0 00-1.779-.972c-.399-.078-1.023-.12-1.873-.12h-2.279V47.44h2.279v.007zm28.191 3.357c-1.707 0-3.188-.362-4.458-1.093a7.432 7.432 0 01-2.919-3.102c-.675-1.327-1.009-2.867-1.009-4.613 0-1.745.334-3.285 1.009-4.613.683-1.327 1.656-2.356 2.919-3.087 1.263-.738 2.751-1.1 4.458-1.1 1.706 0 3.187.37 4.457 1.1a7.27 7.27 0 012.904 3.087c.683 1.328 1.024 2.868 1.024 4.613 0 1.746-.341 3.286-1.024 4.613-.675 1.328-1.641 2.364-2.904 3.102-1.263.73-2.751 1.093-4.457 1.093zm.094-3.002c1.06 0 1.946-.242 2.664-.717.719-.476 1.264-1.15 1.619-2.016.363-.865.538-1.887.538-3.065 0-1.817-.422-3.237-1.271-4.259-.849-1.021-2.098-1.54-3.746-1.54-1.06 0-1.946.242-2.664.717-.719.476-1.264 1.15-1.619 2.016-.363.865-.538 1.887-.538 3.066 0 1.816.421 3.236 1.271 4.258.849 1.022 2.098 1.54 3.746 1.54z' />\n </svg>\n </span>\n)\n\n/** Lido droplet with wordmark and an optional product name. */\nexport const Logo = forwardRef<HTMLElement, LogoProps>(\n (\n {\n variant = 'full',\n product,\n href,\n external,\n onClick,\n className,\n dataTestId,\n ...rest\n },\n ref,\n ) => {\n const label = product ? `Lido ${product}` : 'Lido'\n const content = (\n <>\n <span className={styles.mark}>\n {DROPLET}\n {variant === 'compact' ? null : WORDMARK}\n </span>\n {product ? (\n <>\n <span className={styles.divider} aria-hidden='true' />\n <span className={styles.product} data-testid={dataTestId?.product}>\n {product}\n </span>\n </>\n ) : null}\n </>\n )\n const classes = cn(styles.root, styles[variant], className)\n\n if (href || onClick) {\n return (\n <ActionElement\n ref={ref as Ref<HTMLAnchorElement | HTMLButtonElement>}\n className={cn(classes, styles.interactive)}\n aria-label={label}\n data-testid={dataTestId?.root}\n {...{\n href,\n external: href ? external : undefined,\n onClick,\n ...rest,\n }}\n >\n {content}\n </ActionElement>\n )\n }\n\n return (\n <span\n ref={ref as Ref<HTMLSpanElement>}\n role='img'\n aria-label={label}\n className={classes}\n data-testid={dataTestId?.root}\n {...rest}\n >\n {content}\n </span>\n )\n },\n)\n\nLogo.displayName = 'Logo'\n"],"names":["DROPLET","_jsxs","className","styles","droplet","viewBox","fill","children","_jsx","fillRule","clipRule","d","WORDMARK","wordmark","wordmarkSvg","Logo","forwardRef","_ref","ref","variant","product","href","external","onClick","dataTestId","rest","label","content","_Fragment","mark","divider","classes","cn","root","ActionElement","interactive","undefined","role","displayName"],"mappings":";;;;;;AA4BA,MAAMA,OAAO,gBACXC,IAAA,CAAA,KAAA,EAAA;EACEC,SAAS,EAAEC,MAAM,CAACC,OAAQ;AAC1BC,EAAAA,OAAO,EAAC,aAAa;AACrBC,EAAAA,IAAI,EAAC,cAAc;AACnB,EAAA,aAAA,EAAY,MAAM;AAAAC,EAAAA,QAAA,gBAElBC,GAAA,CAAA,MAAA,EAAA;AACEC,IAAAA,QAAQ,EAAC,SAAS;AAClBC,IAAAA,QAAQ,EAAC,SAAS;AAClBC,IAAAA,CAAC,EAAC,uHAAA;GACH,CAAC,eACFH,GAAA,CAAA,MAAA,EAAA;AAAMG,IAAAA,CAAC,EAAC,sKAAA;AAAsK,GAAE,CAAC,CAAA;AAAA,CAC9K,CACN,CAAA;AAED,MAAMC,QAAQ,gBACZJ,GAAA,CAAA,MAAA,EAAA;EAAMN,SAAS,EAAEC,MAAM,CAACU,QAAS;AAAAN,EAAAA,QAAA,eAC/BC,GAAA,CAAA,KAAA,EAAA;IACEN,SAAS,EAAEC,MAAM,CAACW,WAAY;AAC9BT,IAAAA,OAAO,EAAC,cAAc;AACtBC,IAAAA,IAAI,EAAC,cAAc;AACnB,IAAA,aAAA,EAAY,MAAM;AAAAC,IAAAA,QAAA,eAElBC,GAAA,CAAA,MAAA,EAAA;AAAMG,MAAAA,CAAC,EAAC,0zCAAA;KAA4zC,CAAA;GACj0C,CAAA;AAAC,CACF,CACP,CAAA;;AAED;AACO,MAAMI,IAAI,gBAAGC,UAAU,CAC5B,CAAAC,IAAA,EAWEC,GAAG,KACA;EAAA,IAXH;AACEC,IAAAA,OAAO,GAAG,MAAM;IAChBC,OAAO;IACPC,IAAI;IACJC,QAAQ;IACRC,OAAO;IACPrB,SAAS;IACTsB,UAAU;IACV,GAAGC,IAAAA;AACL,GAAC,GAAAR,IAAA,CAAA;EAGD,MAAMS,KAAK,GAA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B,MAAAA,QAAA,EAGRoB,OAAAA;AAAO,KACK,CAAC,CAAA;AAEpB,GAAA;AAEA,EAAA,oBACEnB,GAAA,CAAA,MAAA,EAAA;AACEU,IAAAA,GAAG,EAAEA,GAA4B;AACjCmB,IAAAA,IAAI,EAAC,KAAK;AACV,IAAA,YAAA,EAAYX,KAAM;AAClBxB,IAAAA,SAAS,EAAE6B,OAAQ;IACnB,aAAaP,EAAAA,UAAU,EAAES,IAAK;AAAA,IAAA,GAC1BR,IAAI;AAAAlB,IAAAA,QAAA,EAEPoB,OAAAA;AAAO,GACJ,CAAC,CAAA;AAEX,CACF,EAAC;AAEDZ,IAAI,CAACuB,WAAW,GAAG,MAAM;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import cn from 'classnames';
3
- import { Anchor } from '../link-provider/Anchor.mjs';
3
+ import { opensInNewTab, Anchor } from '../link-provider/Anchor.mjs';
4
4
  import styles from './NavLink.module.css.mjs';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
  import { IconLink } from '../icons/components/base/IconLink.mjs';
@@ -10,17 +10,21 @@ const NavLink = /*#__PURE__*/forwardRef((_ref, ref) => {
10
10
  let {
11
11
  active = false,
12
12
  icon,
13
- external = false,
13
+ external,
14
14
  className,
15
15
  children,
16
16
  dataTestId,
17
17
  ...rest
18
18
  } = _ref;
19
+ const newTab = opensInNewTab({
20
+ ...rest,
21
+ external
22
+ });
19
23
  return /*#__PURE__*/jsxs(Anchor, {
20
24
  ref: ref,
21
25
  className: cn(styles.link, active && styles.active, className),
22
26
  "aria-current": active ? 'page' : undefined,
23
- external: external,
27
+ external: newTab,
24
28
  "data-testid": dataTestId?.root,
25
29
  ...rest,
26
30
  children: [icon != null ? /*#__PURE__*/jsx("span", {
@@ -28,7 +32,7 @@ const NavLink = /*#__PURE__*/forwardRef((_ref, ref) => {
28
32
  "aria-hidden": "true",
29
33
  "data-testid": dataTestId?.icon,
30
34
  children: icon
31
- }) : null, children, external ? /*#__PURE__*/jsx("span", {
35
+ }) : null, children, newTab ? /*#__PURE__*/jsx("span", {
32
36
  className: styles.icon,
33
37
  "aria-hidden": "true",
34
38
  "data-testid": dataTestId?.externalIcon,
@@ -1 +1 @@
1
- {"version":3,"file":"NavLink.mjs","sources":["../../../src/nav-link/NavLink.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type ReactNode } from 'react'\n\nimport cn from 'classnames'\n\nimport { IconLink } from '../icons'\nimport { Anchor, type AnchorProps } from '../link-provider/Anchor'\nimport styles from './NavLink.module.css'\n\nexport type NavLinkDataTestId = {\n root?: string\n icon?: string\n externalIcon?: string\n}\n\nexport type NavLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n /** Marks the current page: sets `aria-current=\"page\"` and the active style. */\n active?: boolean\n /** Leading icon. */\n icon?: ReactNode\n /** Opens in a new tab and appends the external-link arrow. */\n external?: boolean\n linkProps?: AnchorProps['linkProps']\n dataTestId?: NavLinkDataTestId\n}\n\n/** Top-navigation link for a Header; pass `aria-current` for sections active on sub-routes (HeaderNav centers any truthy value). */\nexport const NavLink = forwardRef<HTMLAnchorElement, NavLinkProps>(\n (\n {\n active = false,\n icon,\n external = false,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n ) => (\n <Anchor\n ref={ref}\n className={cn(styles.link, active && styles.active, className)}\n aria-current={active ? 'page' : undefined}\n external={external}\n data-testid={dataTestId?.root}\n {...rest}\n >\n {icon != null ? (\n <span\n className={styles.icon}\n aria-hidden='true'\n data-testid={dataTestId?.icon}\n >\n {icon}\n </span>\n ) : null}\n {children}\n {external ? (\n <span\n className={styles.icon}\n aria-hidden='true'\n data-testid={dataTestId?.externalIcon}\n >\n <IconLink />\n </span>\n ) : null}\n </Anchor>\n ),\n)\n\nNavLink.displayName = 'NavLink'\n"],"names":["NavLink","forwardRef","_ref","ref","active","icon","external","className","children","dataTestId","rest","_jsxs","Anchor","cn","styles","link","undefined","root","_jsx","externalIcon","IconLink","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":"NavLink.mjs","sources":["../../../src/nav-link/NavLink.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type ReactNode } from 'react'\n\nimport cn from 'classnames'\n\nimport { IconLink } from '../icons'\nimport {\n Anchor,\n opensInNewTab,\n type AnchorProps,\n} from '../link-provider/Anchor'\nimport styles from './NavLink.module.css'\n\nexport type NavLinkDataTestId = {\n root?: string\n icon?: string\n externalIcon?: string\n}\n\nexport type NavLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n /** Marks the current page: sets `aria-current=\"page\"` and the active style. */\n active?: boolean\n /** Leading icon. */\n icon?: ReactNode\n /** @deprecated Absolute http(s) URLs open in a new tab with the arrow automatically; pass `target` to override. */\n external?: boolean\n linkProps?: AnchorProps['linkProps']\n dataTestId?: NavLinkDataTestId\n}\n\n/** Top-navigation link for a Header; pass `aria-current` for sections active on sub-routes (HeaderNav centers any truthy value). */\nexport const NavLink = forwardRef<HTMLAnchorElement, NavLinkProps>(\n (\n {\n active = false,\n icon,\n external,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n ) => {\n const newTab = opensInNewTab({ ...rest, external })\n return (\n <Anchor\n ref={ref}\n className={cn(styles.link, active && styles.active, className)}\n aria-current={active ? 'page' : undefined}\n external={newTab}\n data-testid={dataTestId?.root}\n {...rest}\n >\n {icon != null ? (\n <span\n className={styles.icon}\n aria-hidden='true'\n data-testid={dataTestId?.icon}\n >\n {icon}\n </span>\n ) : null}\n {children}\n {newTab ? (\n <span\n className={styles.icon}\n aria-hidden='true'\n data-testid={dataTestId?.externalIcon}\n >\n <IconLink />\n </span>\n ) : null}\n </Anchor>\n )\n },\n)\n\nNavLink.displayName = 'NavLink'\n"],"names":["NavLink","forwardRef","_ref","ref","active","icon","external","className","children","dataTestId","rest","newTab","opensInNewTab","_jsxs","Anchor","cn","styles","link","undefined","root","_jsx","externalIcon","IconLink","displayName"],"mappings":";;;;;;;AA6BA;AACO,MAAMA,OAAO,gBAAGC,UAAU,CAC/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;;;"}
@@ -4,7 +4,9 @@ import styles from './RichInput.module.css.mjs';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
  import { Tag } from '../tag/Tag.mjs';
6
6
  import { InfoTooltip } from '../info-tooltip/InfoTooltip.mjs';
7
+ import { IconLockKeyhole } from '../icons/components/base/IconLockKeyhole.mjs';
7
8
  import { Tooltip } from '../tooltip/Tooltip.mjs';
9
+ import { Skeleton } from '../skeleton/Skeleton.mjs';
8
10
 
9
11
  // Keep only digits and a single decimal point; comma is treated as the
10
12
  // decimal separator and normalized to a dot (en-US canonical form).
@@ -18,7 +20,7 @@ const sanitizeDecimal = raw => {
18
20
  };
19
21
  const noop = () => undefined;
20
22
 
21
- /** Amount field for supply and borrow forms: token picker, fiat equivalent, balance and a Max shortcut in one card; input is filtered to decimals as you type. `disabled` dims the card and hides Max. */
23
+ /** Amount field for supply and borrow forms: token picker, fiat equivalent, balance and a Max shortcut in one card; input is filtered to decimals as you type. `disabled` dims the card and hides Max; `locked` makes it read-only without Max; `loading` shows a skeleton for the amount and hides the fiat line. */
22
24
  const RichInput = _ref => {
23
25
  let {
24
26
  label,
@@ -37,6 +39,10 @@ const RichInput = _ref => {
37
39
  className,
38
40
  id,
39
41
  disabled,
42
+ locked,
43
+ lockedTooltip,
44
+ loading,
45
+ readOnly,
40
46
  dataTestId,
41
47
  ...inputProps
42
48
  } = _ref;
@@ -46,8 +52,9 @@ const RichInput = _ref => {
46
52
  const hasError = !!error;
47
53
  const showErrorMessage = !!errorText;
48
54
  const errorId = `${inputId}-error`;
49
- const showMax = showMaxButton && !disabled;
50
- const hasBottomRow = secondaryValue != null || balance != null || showMax;
55
+ const showMax = showMaxButton && !disabled && !locked && !loading;
56
+ const showSecondary = secondaryValue != null && !loading;
57
+ const hasBottomRow = showSecondary || balance != null || showMax;
51
58
  const maxTag = /*#__PURE__*/jsx(Tag, {
52
59
  as: "button",
53
60
  dataTestId: {
@@ -86,7 +93,7 @@ const RichInput = _ref => {
86
93
  className: cn(styles.root, className),
87
94
  "data-testid": dataTestId?.root,
88
95
  children: [/*#__PURE__*/jsxs("div", {
89
- className: cn(styles.card, hasError && styles.error),
96
+ className: cn(styles.card, hasError && styles.error, locked && styles.locked, loading && styles.loading),
90
97
  onClick: handleRootClick,
91
98
  children: [label != null ? /*#__PURE__*/jsxs("span", {
92
99
  className: styles.labelRow,
@@ -98,27 +105,50 @@ const RichInput = _ref => {
98
105
  }), labelTooltip != null ? /*#__PURE__*/jsx(InfoTooltip, {
99
106
  content: labelTooltip,
100
107
  size: 20
108
+ }) : null, locked ? lockedTooltip != null ? /*#__PURE__*/jsx(InfoTooltip, {
109
+ icon: /*#__PURE__*/jsx(IconLockKeyhole, {
110
+ "aria-hidden": "true"
111
+ }),
112
+ size: 20,
113
+ "aria-label": "Locked",
114
+ content: lockedTooltip,
115
+ className: styles.lock,
116
+ dataTestId: {
117
+ root: dataTestId?.lock
118
+ }
119
+ }) : /*#__PURE__*/jsx(IconLockKeyhole, {
120
+ "aria-hidden": "true",
121
+ className: cn(styles.lock, styles.lockIcon),
122
+ "data-testid": dataTestId?.lock
101
123
  }) : null]
102
124
  }) : null, /*#__PURE__*/jsxs("div", {
103
125
  className: styles.amountRow,
104
- children: [/*#__PURE__*/jsx("input", {
105
- ref: inputRef,
106
- id: inputId,
107
- className: styles.input,
108
- inputMode: "decimal",
109
- disabled: disabled,
110
- "aria-invalid": hasError || undefined,
111
- "aria-describedby": showErrorMessage ? errorId : undefined,
112
- onChange: handleChange,
113
- "data-testid": dataTestId?.input,
114
- ...inputProps
126
+ children: [/*#__PURE__*/jsxs("span", {
127
+ className: styles.amount,
128
+ children: [/*#__PURE__*/jsx("input", {
129
+ ref: inputRef,
130
+ id: inputId,
131
+ className: styles.input,
132
+ inputMode: "decimal",
133
+ disabled: disabled,
134
+ readOnly: locked || loading || readOnly,
135
+ "aria-busy": loading || undefined,
136
+ "aria-invalid": hasError || undefined,
137
+ "aria-describedby": showErrorMessage ? errorId : undefined,
138
+ onChange: handleChange,
139
+ "data-testid": dataTestId?.input,
140
+ ...inputProps
141
+ }), loading ? /*#__PURE__*/jsx(Skeleton, {
142
+ variant: "text",
143
+ className: styles.amountSkeleton
144
+ }) : null]
115
145
  }), tokenSelector != null ? /*#__PURE__*/jsx("div", {
116
146
  className: styles.token,
117
147
  children: tokenSelector
118
148
  }) : null]
119
149
  }), hasBottomRow ? /*#__PURE__*/jsxs("div", {
120
150
  className: styles.bottomRow,
121
- children: [secondaryValue != null ? /*#__PURE__*/jsx("span", {
151
+ children: [showSecondary ? /*#__PURE__*/jsx("span", {
122
152
  "data-testid": dataTestId?.secondaryValue,
123
153
  className: styles.secondary,
124
154
  children: secondaryValue
@@ -1 +1 @@
1
- {"version":3,"file":"RichInput.mjs","sources":["../../../src/rich-input/RichInput.tsx"],"sourcesContent":["import {\n useId,\n useRef,\n type ChangeEvent,\n type InputHTMLAttributes,\n type MouseEvent,\n type MouseEventHandler,\n type ReactNode,\n} from 'react'\n\nimport cn from 'classnames'\nimport { InfoTooltip } from '../info-tooltip'\nimport { Tag } from '../tag'\nimport { Tooltip, type TooltipPosition } from '../tooltip'\n\nimport styles from './RichInput.module.css'\n\nexport type RichInputDataTestId = {\n root?: string\n label?: string\n input?: string\n secondaryValue?: string\n balance?: string\n maxButton?: string\n error?: string\n}\n\nexport type RichInputProps = InputHTMLAttributes<HTMLInputElement> & {\n label?: ReactNode\n labelTooltip?: ReactNode\n /** Fiat equivalent, bottom left. */\n secondaryValue?: ReactNode\n /** Wallet balance, bottom right. */\n balance?: ReactNode\n /** Slot for a `TokenSelector`. */\n tokenSelector?: ReactNode\n /** Marks the card invalid. */\n error?: boolean\n errorText?: ReactNode\n showMaxButton?: boolean\n onMaxClick?: MouseEventHandler<HTMLButtonElement>\n /** Dims the Max shortcut, leaving the field editable. */\n maxDisabled?: boolean\n /** Explains what Max actually fills in. */\n maxTooltip?: ReactNode\n maxTooltipPosition?: TooltipPosition\n dataTestId?: RichInputDataTestId\n}\n\n// Keep only digits and a single decimal point; comma is treated as the\n// decimal separator and normalized to a dot (en-US canonical form).\nconst sanitizeDecimal = (raw: string): string => {\n const normalized = raw.replace(/,/g, '.').replace(/[^\\d.]/g, '')\n const firstDot = normalized.indexOf('.')\n if (firstDot === -1) return normalized\n const head = normalized.slice(0, firstDot + 1)\n const tail = normalized.slice(firstDot + 1).replace(/\\./g, '')\n return head + tail\n}\n\nconst noop = () => undefined\n\n/** Amount field for supply and borrow forms: token picker, fiat equivalent, balance and a Max shortcut in one card; input is filtered to decimals as you type. `disabled` dims the card and hides Max. */\nexport const RichInput = ({\n label,\n labelTooltip,\n secondaryValue,\n balance,\n tokenSelector,\n error,\n errorText,\n showMaxButton = true,\n onMaxClick,\n maxDisabled,\n maxTooltip,\n maxTooltipPosition = 'bottom-left',\n onChange,\n className,\n id,\n disabled,\n dataTestId,\n ...inputProps\n}: RichInputProps) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const fallbackId = useId()\n const inputId = id ?? fallbackId\n\n const hasError = !!error\n const showErrorMessage = !!errorText\n const errorId = `${inputId}-error`\n const showMax = showMaxButton && !disabled\n const hasBottomRow = secondaryValue != null || balance != null || showMax\n\n const maxTag = (\n <Tag\n as='button'\n dataTestId={{ root: dataTestId?.maxButton }}\n onClick={onMaxClick ?? noop}\n disabled={maxDisabled}\n >\n Max\n </Tag>\n )\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const { value: rawValue, selectionStart } = event.target\n const sanitized = sanitizeDecimal(rawValue)\n\n if (sanitized !== rawValue) {\n // Rewrite the DOM value before bubbling up so the parent (controlled\n // or not) only ever sees the clean value and no invalid char sticks.\n const removed = rawValue.length - sanitized.length\n event.target.value = sanitized\n if (selectionStart != null) {\n const caret = Math.max(0, selectionStart - removed)\n event.target.setSelectionRange(caret, caret)\n }\n }\n\n onChange?.(event)\n }\n\n const handleRootClick = (event: MouseEvent<HTMLDivElement>) => {\n if (!(event.target instanceof Element)) return\n if (\n event.target.closest('button, input, label, [role=\"listbox\"], [tabindex]')\n ) {\n return\n }\n inputRef.current?.focus()\n }\n\n return (\n <div className={cn(styles.root, className)} data-testid={dataTestId?.root}>\n {/*\n Clicking the padding around the field focuses it — a pointer convenience\n on top of the real control. Keyboard users tab straight to the input.\n */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={cn(styles.card, hasError && styles.error)}\n onClick={handleRootClick}\n >\n {label != null ? (\n <span className={styles.labelRow}>\n <label\n data-testid={dataTestId?.label}\n className={styles.label}\n htmlFor={inputId}\n >\n {label}\n </label>\n {labelTooltip != null ? (\n <InfoTooltip content={labelTooltip} size={20} />\n ) : null}\n </span>\n ) : null}\n <div className={styles.amountRow}>\n <input\n ref={inputRef}\n id={inputId}\n className={styles.input}\n inputMode='decimal'\n disabled={disabled}\n aria-invalid={hasError || undefined}\n aria-describedby={showErrorMessage ? errorId : undefined}\n onChange={handleChange}\n data-testid={dataTestId?.input}\n {...inputProps}\n />\n {tokenSelector != null ? (\n <div className={styles.token}>{tokenSelector}</div>\n ) : null}\n </div>\n {hasBottomRow ? (\n <div className={styles.bottomRow}>\n {secondaryValue != null ? (\n <span\n data-testid={dataTestId?.secondaryValue}\n className={styles.secondary}\n >\n {secondaryValue}\n </span>\n ) : null}\n <div className={styles.balanceGroup}>\n {balance != null ? (\n <span\n className={styles.balance}\n data-testid={dataTestId?.balance}\n >\n {balance}\n </span>\n ) : null}\n {showMax && maxTooltip != null ? (\n <Tooltip\n content={maxTooltip}\n position={maxTooltipPosition}\n width={240}\n >\n {maxTag}\n </Tooltip>\n ) : showMax ? (\n maxTag\n ) : null}\n </div>\n </div>\n ) : null}\n </div>\n {showErrorMessage ? (\n <div\n id={errorId}\n className={styles.errorMessage}\n data-testid={dataTestId?.error}\n >\n {errorText}\n </div>\n ) : null}\n </div>\n )\n}\n"],"names":["sanitizeDecimal","raw","normalized","replace","firstDot","indexOf","head","slice","tail","noop","undefined","RichInput","_ref","label","labelTooltip","secondaryValue","balance","tokenSelector","error","errorText","showMaxButton","onMaxClick","maxDisabled","maxTooltip","maxTooltipPosition","onChange","className","id","disabled","dataTestId","inputProps","inputRef","useRef","fallbackId","useId","inputId","hasError","showErrorMessage","errorId","showMax","hasBottomRow","maxTag","_jsx","Tag","as","root","maxButton","onClick","children","handleChange","event","value","rawValue","selectionStart","target","sanitized","removed","length","caret","Math","max","setSelectionRange","handleRootClick","Element","closest","current","focus","_jsxs","cn","styles","card","labelRow","htmlFor","InfoTooltip","content","size","amountRow","ref","input","inputMode","token","bottomRow","secondary","balanceGroup","Tooltip","position","width","errorMessage"],"mappings":";;;;;;;;AAiDA;AACA;AACA,MAAMA,eAAe,GAAIC,GAAW,IAAa;AAC/C,EAAA,MAAMC,UAAU,GAAGD,GAAG,CAACE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAACA,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAChE,EAAA,MAAMC,QAAQ,GAAGF,UAAU,CAACG,OAAO,CAAC,GAAG,CAAC,CAAA;AACxC,EAAA,IAAID,QAAQ,KAAK,CAAC,CAAC,EAAE,OAAOF,UAAU,CAAA;EACtC,MAAMI,IAAI,GAAGJ,UAAU,CAACK,KAAK,CAAC,CAAC,EAAEH,QAAQ,GAAG,CAAC,CAAC,CAAA;AAC9C,EAAA,MAAMI,IAAI,GAAGN,UAAU,CAACK,KAAK,CAACH,QAAQ,GAAG,CAAC,CAAC,CAACD,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;EAC9D,OAAOG,IAAI,GAAGE,IAAI,CAAA;AACpB,CAAC,CAAA;AAED,MAAMC,IAAI,GAAGA,MAAMC,SAAS,CAAA;;AAE5B;AACaC,MAAAA,SAAS,GAAGC,IAAA,IAmBH;EAAA,IAnBI;IACxBC,KAAK;IACLC,YAAY;IACZC,cAAc;IACdC,OAAO;IACPC,aAAa;IACbC,KAAK;IACLC,SAAS;AACTC,IAAAA,aAAa,GAAG,IAAI;IACp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ef,\n type ChangeEvent,\n type InputHTMLAttributes,\n type MouseEvent,\n type MouseEventHandler,\n type ReactNode,\n} from 'react'\n\nimport cn from 'classnames'\nimport { IconLockKeyhole } from '../icons'\nimport { InfoTooltip } from '../info-tooltip'\nimport { Skeleton } from '../skeleton'\nimport { Tag } from '../tag'\nimport { Tooltip, type TooltipPosition } from '../tooltip'\n\nimport styles from './RichInput.module.css'\n\nexport type RichInputDataTestId = {\n root?: string\n label?: string\n input?: string\n secondaryValue?: string\n balance?: string\n maxButton?: string\n error?: string\n lock?: string\n}\n\nexport type RichInputProps = InputHTMLAttributes<HTMLInputElement> & {\n label?: ReactNode\n labelTooltip?: ReactNode\n /** Fiat equivalent, bottom left. */\n secondaryValue?: ReactNode\n /** Wallet balance, bottom right. */\n balance?: ReactNode\n /** Slot for a `TokenSelector`. */\n tokenSelector?: ReactNode\n /** Marks the card invalid. */\n error?: boolean\n errorText?: ReactNode\n showMaxButton?: boolean\n onMaxClick?: MouseEventHandler<HTMLButtonElement>\n /** Dims the Max shortcut, leaving the field editable. */\n maxDisabled?: boolean\n /** Explains what Max actually fills in. */\n maxTooltip?: ReactNode\n maxTooltipPosition?: TooltipPosition\n /** Value can't be edited. */\n locked?: boolean\n /** Tooltip on the lock icon. */\n lockedTooltip?: ReactNode\n /** Swaps the amount for a skeleton, hides the fiat line and makes the field read-only without Max. */\n loading?: boolean\n dataTestId?: RichInputDataTestId\n}\n\n// Keep only digits and a single decimal point; comma is treated as the\n// decimal separator and normalized to a dot (en-US canonical form).\nconst sanitizeDecimal = (raw: string): string => {\n const normalized = raw.replace(/,/g, '.').replace(/[^\\d.]/g, '')\n const firstDot = normalized.indexOf('.')\n if (firstDot === -1) return normalized\n const head = normalized.slice(0, firstDot + 1)\n const tail = normalized.slice(firstDot + 1).replace(/\\./g, '')\n return head + tail\n}\n\nconst noop = () => undefined\n\n/** Amount field for supply and borrow forms: token picker, fiat equivalent, balance and a Max shortcut in one card; input is filtered to decimals as you type. `disabled` dims the card and hides Max; `locked` makes it read-only without Max; `loading` shows a skeleton for the amount and hides the fiat line. */\nexport const RichInput = ({\n label,\n labelTooltip,\n secondaryValue,\n balance,\n tokenSelector,\n error,\n errorText,\n showMaxButton = true,\n onMaxClick,\n maxDisabled,\n maxTooltip,\n maxTooltipPosition = 'bottom-left',\n onChange,\n className,\n id,\n disabled,\n locked,\n lockedTooltip,\n loading,\n readOnly,\n dataTestId,\n ...inputProps\n}: RichInputProps) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const fallbackId = useId()\n const inputId = id ?? fallbackId\n\n const hasError = !!error\n const showErrorMessage = !!errorText\n const errorId = `${inputId}-error`\n const showMax = showMaxButton && !disabled && !locked && !loading\n const showSecondary = secondaryValue != null && !loading\n const hasBottomRow = showSecondary || balance != null || showMax\n\n const maxTag = (\n <Tag\n as='button'\n dataTestId={{ root: dataTestId?.maxButton }}\n onClick={onMaxClick ?? noop}\n disabled={maxDisabled}\n >\n Max\n </Tag>\n )\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const { value: rawValue, selectionStart } = event.target\n const sanitized = sanitizeDecimal(rawValue)\n\n if (sanitized !== rawValue) {\n // Rewrite the DOM value before bubbling up so the parent (controlled\n // or not) only ever sees the clean value and no invalid char sticks.\n const removed = rawValue.length - sanitized.length\n event.target.value = sanitized\n if (selectionStart != null) {\n const caret = Math.max(0, selectionStart - removed)\n event.target.setSelectionRange(caret, caret)\n }\n }\n\n onChange?.(event)\n }\n\n const handleRootClick = (event: MouseEvent<HTMLDivElement>) => {\n if (!(event.target instanceof Element)) return\n if (\n event.target.closest('button, input, label, [role=\"listbox\"], [tabindex]')\n ) {\n return\n }\n inputRef.current?.focus()\n }\n\n return (\n <div className={cn(styles.root, className)} data-testid={dataTestId?.root}>\n {/*\n Clicking the padding around the field focuses it — a pointer convenience\n on top of the real control. Keyboard users tab straight to the input.\n */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={cn(\n styles.card,\n hasError && styles.error,\n locked && styles.locked,\n loading && styles.loading,\n )}\n onClick={handleRootClick}\n >\n {label != null ? (\n <span className={styles.labelRow}>\n <label\n data-testid={dataTestId?.label}\n className={styles.label}\n htmlFor={inputId}\n >\n {label}\n </label>\n {labelTooltip != null ? (\n <InfoTooltip content={labelTooltip} size={20} />\n ) : null}\n {locked ? (\n lockedTooltip != null ? (\n <InfoTooltip\n icon={<IconLockKeyhole aria-hidden='true' />}\n size={20}\n aria-label='Locked'\n content={lockedTooltip}\n className={styles.lock}\n dataTestId={{ root: dataTestId?.lock }}\n />\n ) : (\n <IconLockKeyhole\n aria-hidden='true'\n className={cn(styles.lock, styles.lockIcon)}\n data-testid={dataTestId?.lock}\n />\n )\n ) : null}\n </span>\n ) : null}\n <div className={styles.amountRow}>\n <span className={styles.amount}>\n <input\n ref={inputRef}\n id={inputId}\n className={styles.input}\n inputMode='decimal'\n disabled={disabled}\n readOnly={locked || loading || readOnly}\n aria-busy={loading || undefined}\n aria-invalid={hasError || undefined}\n aria-describedby={showErrorMessage ? errorId : undefined}\n onChange={handleChange}\n data-testid={dataTestId?.input}\n {...inputProps}\n />\n {loading ? (\n <Skeleton variant='text' className={styles.amountSkeleton} />\n ) : null}\n </span>\n {tokenSelector != null ? (\n <div className={styles.token}>{tokenSelector}</div>\n ) : null}\n </div>\n {hasBottomRow ? (\n <div className={styles.bottomRow}>\n {showSecondary ? (\n <span\n data-testid={dataTestId?.secondaryValue}\n className={styles.secondary}\n >\n {secondaryValue}\n </span>\n ) : null}\n <div className={styles.balanceGroup}>\n {balance != null ? (\n <span\n className={styles.balance}\n data-testid={dataTestId?.balance}\n >\n {balance}\n </span>\n ) : null}\n {showMax && maxTooltip != null ? (\n <Tooltip\n content={maxTooltip}\n position={maxTooltipPosition}\n width={240}\n >\n {maxTag}\n </Tooltip>\n ) : showMax ? (\n maxTag\n ) : null}\n </div>\n </div>\n ) : null}\n </div>\n {showErrorMessage ? (\n <div\n id={errorId}\n className={styles.errorMessage}\n data-testid={dataTestId?.error}\n >\n {errorText}\n </div>\n ) : null}\n </div>\n )\n}\n"],"names":["sanitizeDecimal","raw","normalized","replace","firstDot","indexOf","head","slice","tail","noop","undefined","RichInput","_ref","label","labelTooltip","secondaryValue","balance","tokenSelector","error","errorText","showMaxButton","onMaxClick","maxDisabled","maxTooltip","maxTooltipPosition","onChange","className","id","disabled","locked","lockedTooltip","loading","readOnly","dataTestId","inputProps","inputRef","useRef","fallbackId","useId","inputId","hasError","showErrorMessage","errorId","showMax","showSecondary","hasBottomRow","maxTag","_jsx","Tag","as","root","maxButton","onClick","children","handleChange","event","value","rawValue","selectionStart","target","sanitized","removed","length","caret","Math","max","setSelectionRange","handleRootClick","Element","closest","current","focus","_jsxs","cn","styles","card","labelRow","htmlFor","InfoTooltip","content","size","icon","IconLockKeyhole","lock","lockIcon","amountRow","amount","ref","input","inputMode","Skeleton","variant","amountSkeleton","token","bottomRow","secondary","balanceGroup","Tooltip","position","width","errorMessage"],"mappings":";;;;;;;;;;AA0DA;AACA;AACA,MAAMA,eAAe,GAAIC,GAAW,IAAa;AAC/C,EAAA,MAAMC,UAAU,GAAGD,GAAG,CAACE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAACA,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAChE,EAAA,MAAMC,QAAQ,GAAGF,UAAU,CAACG,OAAO,CAAC,GAAG,CAAC,CAAA;AACxC,EAAA,IAAID,QAAQ,KAAK,CAAC,CAAC,EAAE,OAAOF,UAAU,CAAA;EACtC,MAAMI,IAAI,GAAGJ,UAAU,CAACK,KAAK,CAAC,CAAC,EAAEH,QAAQ,GAAG,CAAC,CAAC,CAAA;AAC9C,EAAA,MAAMI,IAAI,GAAGN,UAAU,CAACK,KAAK,CAACH,QAAQ,GAAG,CAAC,CAAC,CAACD,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;EAC9D,OAAOG,IAAI,GAAGE,IAAI,CAAA;AACpB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anE,EAAAA,UAAU,EAAEf,KAAM;AAAAmC,MAAAA,QAAA,EAE9BlC,SAAAA;KACE,CAAC,GACJ,IAAI,CAAA;AAAA,GACL,CAAC,CAAA;AAEV;;;;"}
@@ -1,4 +1,4 @@
1
- const styles = {"root":"RichInput-module_root__2RrAF","card":"RichInput-module_card__wDqv1","error":"RichInput-module_error__iuacN","input":"RichInput-module_input__G69-P","labelRow":"RichInput-module_labelRow__bh0KF","label":"RichInput-module_label__FNaLW","amountRow":"RichInput-module_amountRow__GWqIG","token":"RichInput-module_token__qSEX1","bottomRow":"RichInput-module_bottomRow__2SnLx","secondary":"RichInput-module_secondary__pftTQ","balanceGroup":"RichInput-module_balanceGroup__q4-lT","balance":"RichInput-module_balance__y-Ukz","errorMessage":"RichInput-module_errorMessage__axdve"};
1
+ const styles = {"root":"RichInput-module_root__2RrAF","card":"RichInput-module_card__wDqv1","locked":"RichInput-module_locked__fGImq","loading":"RichInput-module_loading__yxt8-","error":"RichInput-module_error__iuacN","input":"RichInput-module_input__G69-P","lock":"RichInput-module_lock__adGaA","lockIcon":"RichInput-module_lockIcon__wJpHd","labelRow":"RichInput-module_labelRow__bh0KF","label":"RichInput-module_label__FNaLW","amountRow":"RichInput-module_amountRow__GWqIG","amount":"RichInput-module_amount__CGSLZ","amountSkeleton":"RichInput-module_amountSkeleton__4wzNO","token":"RichInput-module_token__qSEX1","bottomRow":"RichInput-module_bottomRow__2SnLx","secondary":"RichInput-module_secondary__pftTQ","balanceGroup":"RichInput-module_balanceGroup__q4-lT","balance":"RichInput-module_balance__y-Ukz","errorMessage":"RichInput-module_errorMessage__axdve"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=RichInput.module.css.mjs.map