@metamask/design-system-react 0.23.0 → 0.24.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 (92) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/components/BannerAlert/BannerAlert.d.cts +58 -30
  3. package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
  4. package/dist/components/BannerAlert/BannerAlert.d.mts +58 -30
  5. package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
  6. package/dist/components/BannerBase/BannerBase.d.cts +58 -30
  7. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  8. package/dist/components/BannerBase/BannerBase.d.mts +58 -30
  9. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  10. package/dist/components/Icon/icons/FlashFilled.cjs +32 -0
  11. package/dist/components/Icon/icons/FlashFilled.cjs.map +1 -0
  12. package/dist/components/Icon/icons/FlashFilled.d.cts +4 -0
  13. package/dist/components/Icon/icons/FlashFilled.d.cts.map +1 -0
  14. package/dist/components/Icon/icons/FlashFilled.d.mts +4 -0
  15. package/dist/components/Icon/icons/FlashFilled.d.mts.map +1 -0
  16. package/dist/components/Icon/icons/FlashFilled.mjs +7 -0
  17. package/dist/components/Icon/icons/FlashFilled.mjs.map +1 -0
  18. package/dist/components/Icon/icons/Telegram.cjs +1 -1
  19. package/dist/components/Icon/icons/Telegram.cjs.map +1 -1
  20. package/dist/components/Icon/icons/Telegram.mjs +1 -1
  21. package/dist/components/Icon/icons/Telegram.mjs.map +1 -1
  22. package/dist/components/Icon/icons/index.cjs +2 -0
  23. package/dist/components/Icon/icons/index.cjs.map +1 -1
  24. package/dist/components/Icon/icons/index.d.cts +1 -0
  25. package/dist/components/Icon/icons/index.d.cts.map +1 -1
  26. package/dist/components/Icon/icons/index.d.mts +1 -0
  27. package/dist/components/Icon/icons/index.d.mts.map +1 -1
  28. package/dist/components/Icon/icons/index.mjs +2 -0
  29. package/dist/components/Icon/icons/index.mjs.map +1 -1
  30. package/dist/components/Modal/Modal.types.cjs.map +1 -1
  31. package/dist/components/Modal/Modal.types.d.cts +2 -2
  32. package/dist/components/Modal/Modal.types.d.cts.map +1 -1
  33. package/dist/components/Modal/Modal.types.d.mts +2 -2
  34. package/dist/components/Modal/Modal.types.d.mts.map +1 -1
  35. package/dist/components/Modal/Modal.types.mjs.map +1 -1
  36. package/dist/components/ModalFocus/ModalFocus.types.cjs.map +1 -1
  37. package/dist/components/ModalFocus/ModalFocus.types.d.cts +2 -2
  38. package/dist/components/ModalFocus/ModalFocus.types.d.cts.map +1 -1
  39. package/dist/components/ModalFocus/ModalFocus.types.d.mts +2 -2
  40. package/dist/components/ModalFocus/ModalFocus.types.d.mts.map +1 -1
  41. package/dist/components/ModalFocus/ModalFocus.types.mjs.map +1 -1
  42. package/dist/components/Text/Text.cjs +3 -1
  43. package/dist/components/Text/Text.cjs.map +1 -1
  44. package/dist/components/Text/Text.constants.cjs.map +1 -1
  45. package/dist/components/Text/Text.constants.d.cts +1 -1
  46. package/dist/components/Text/Text.constants.d.cts.map +1 -1
  47. package/dist/components/Text/Text.constants.d.mts +1 -1
  48. package/dist/components/Text/Text.constants.d.mts.map +1 -1
  49. package/dist/components/Text/Text.constants.mjs.map +1 -1
  50. package/dist/components/Text/Text.d.cts.map +1 -1
  51. package/dist/components/Text/Text.d.mts.map +1 -1
  52. package/dist/components/Text/Text.mjs +3 -1
  53. package/dist/components/Text/Text.mjs.map +1 -1
  54. package/dist/components/Text/Text.types.cjs.map +1 -1
  55. package/dist/components/Text/Text.types.d.cts +2 -2
  56. package/dist/components/Text/Text.types.d.cts.map +1 -1
  57. package/dist/components/Text/Text.types.d.mts +2 -2
  58. package/dist/components/Text/Text.types.d.mts.map +1 -1
  59. package/dist/components/Text/Text.types.mjs.map +1 -1
  60. package/dist/components/TextField/TextField.cjs +77 -0
  61. package/dist/components/TextField/TextField.cjs.map +1 -0
  62. package/dist/components/TextField/TextField.d.cts +324 -0
  63. package/dist/components/TextField/TextField.d.cts.map +1 -0
  64. package/dist/components/TextField/TextField.d.mts +324 -0
  65. package/dist/components/TextField/TextField.d.mts.map +1 -0
  66. package/dist/components/TextField/TextField.mjs +58 -0
  67. package/dist/components/TextField/TextField.mjs.map +1 -0
  68. package/dist/components/TextField/TextField.types.cjs +26 -0
  69. package/dist/components/TextField/TextField.types.cjs.map +1 -0
  70. package/dist/components/TextField/TextField.types.d.cts +102 -0
  71. package/dist/components/TextField/TextField.types.d.cts.map +1 -0
  72. package/dist/components/TextField/TextField.types.d.mts +102 -0
  73. package/dist/components/TextField/TextField.types.d.mts.map +1 -0
  74. package/dist/components/TextField/TextField.types.mjs +23 -0
  75. package/dist/components/TextField/TextField.types.mjs.map +1 -0
  76. package/dist/components/TextField/index.cjs +9 -0
  77. package/dist/components/TextField/index.cjs.map +1 -0
  78. package/dist/components/TextField/index.d.cts +4 -0
  79. package/dist/components/TextField/index.d.cts.map +1 -0
  80. package/dist/components/TextField/index.d.mts +4 -0
  81. package/dist/components/TextField/index.d.mts.map +1 -0
  82. package/dist/components/TextField/index.mjs +3 -0
  83. package/dist/components/TextField/index.mjs.map +1 -0
  84. package/dist/components/index.cjs +5 -1
  85. package/dist/components/index.cjs.map +1 -1
  86. package/dist/components/index.d.cts +2 -0
  87. package/dist/components/index.d.cts.map +1 -1
  88. package/dist/components/index.d.mts +2 -0
  89. package/dist/components/index.d.mts.map +1 -1
  90. package/dist/components/index.mjs +1 -0
  91. package/dist/components/index.mjs.map +1 -1
  92. package/package.json +7 -5
@@ -1 +1 @@
1
- {"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,uCAAuC;AAExC,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW;IAC9B,CAAC,UAAU,CAAC,MAAM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AAC,WAAW,CAAC,cAAc,CAAC,EAAE,IAAI;IAClC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import {\n FontFamily,\n FontStyle,\n FontWeight,\n TextVariant,\n} from '@metamask/design-system-shared';\n\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: Record<FontWeight, string> = {\n [FontWeight.Bold]: 'font-bold',\n [FontWeight.Medium]: 'font-medium',\n [FontWeight.Regular]: 'font-regular',\n};\n\nexport const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string> = {\n [FontFamily.Default]: 'font-default',\n [FontFamily.Accent]: 'font-accent',\n [FontFamily.Hero]: 'font-hero',\n};\n\nexport const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string> = {\n [FontStyle.Italic]: 'italic',\n [FontStyle.Normal]: 'not-italic',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
1
+ {"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACZ,uCAAuC;AAExC,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW;IAC9B,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,cAAc;CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,cAAc;IACpC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa;IAClC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA8B;IAClE,CAAC,SAAS,CAAC,MAAM,CAAC,EAA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AAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,WAAW;IACtC,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,WAAW;IACzC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,0BAA0B;CAC1D,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAG7B;IACF,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,IAAI;IAC/B,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,IAAI;IAClC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import {\n FontFamily,\n FontStyle,\n FontWeight,\n TextVariant,\n} from '@metamask/design-system-shared';\n\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: Record<FontWeight, string> = {\n [FontWeight.Bold]: 'font-bold',\n [FontWeight.Medium]: 'font-medium',\n [FontWeight.Regular]: 'font-regular',\n};\n\nexport const TWCLASSMAP_TEXT_FONTFAMILY: Record<FontFamily, string> = {\n [FontFamily.Default]: 'font-default',\n [FontFamily.Accent]: 'font-accent',\n [FontFamily.Hero]: 'font-hero',\n};\n\nexport const TWCLASSMAP_TEXT_FONTSTYLE: Record<FontStyle, string> = {\n [FontStyle.Italic]: 'italic',\n [FontStyle.Normal]: 'not-italic',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof React.JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAwCpC,CAAC"}
1
+ {"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA0CpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAwCpC,CAAC"}
1
+ {"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAY1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA0CpC,CAAC"}
@@ -13,7 +13,9 @@ import { TWCLASSMAP_TEXT_VARIANT_FONTSTYLE, TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,
13
13
  export const Text = ({ variant = TextVariant.BodyMd, children, className, fontWeight, fontFamily = FontFamily.Default, fontStyle, textTransform, textAlign, overflowWrap, ellipsis, asChild, color = TextColor.TextDefault, style, ...props }) => {
14
14
  // When asChild is true, use Radix Slot to merge props onto the child component.
15
15
  // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
16
- const Component = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];
16
+ const Component = asChild
17
+ ? Slot
18
+ : MAP_TEXT_VARIANT_TAG[variant];
17
19
  const mergedClassName = `${twMerge(color, TWCLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight
18
20
  ? TWCLASSMAP_TEXT_FONTWEIGHT[fontWeight]
19
21
  : TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle ? TWCLASSMAP_TEXT_FONTSTYLE[fontStyle] : undefined, TWCLASSMAP_TEXT_FONTFAMILY[fontFamily], textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
@@ -1 +1 @@
1
- {"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACZ,uCAAuC;AACxC,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACrB,6BAAyB;AAG1B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,UAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,GAAG,OAAO,CAChC,KAAK,EACL,iCAAiC,CAAC,OAAO,CAAC,EAC1C,UAAU;QACR,CAAC,CAAC,0BAA0B,CAAC,UAAU,CAAC;QACxC,CAAC,CAAC,kCAAkC,CAAC,OAAO,CAAC,EAC/C,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAC5D,0BAA0B,CAAC,UAAU,CAAC,EACtC,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,EAAE,CAAC;IAEJ,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n FontFamily,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE,\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTFAMILY,\n TWCLASSMAP_TEXT_FONTSTYLE,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n MAP_TEXT_VARIANT_TAG,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight\n ? TWCLASSMAP_TEXT_FONTWEIGHT[fontWeight]\n : TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle ? TWCLASSMAP_TEXT_FONTSTYLE[fontStyle] : undefined,\n TWCLASSMAP_TEXT_FONTFAMILY[fontFamily],\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n )}`;\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACZ,uCAAuC;AACxC,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACrB,6BAAyB;AAG1B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,UAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAsB,OAAO;QAC1C,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAElC,MAAM,eAAe,GAAG,GAAG,OAAO,CAChC,KAAK,EACL,iCAAiC,CAAC,OAAO,CAAC,EAC1C,UAAU;QACR,CAAC,CAAC,0BAA0B,CAAC,UAAU,CAAC;QACxC,CAAC,CAAC,kCAAkC,CAAC,OAAO,CAAC,EAC/C,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAC5D,0BAA0B,CAAC,UAAU,CAAC,EACtC,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,EAAE,CAAC;IAEJ,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n FontFamily,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE,\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTFAMILY,\n TWCLASSMAP_TEXT_FONTSTYLE,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n MAP_TEXT_VARIANT_TAG,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component: React.ElementType = asChild\n ? Slot\n : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n TWCLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight\n ? TWCLASSMAP_TEXT_FONTWEIGHT[fontWeight]\n : TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle ? TWCLASSMAP_TEXT_FONTSTYLE[fontStyle] : undefined,\n TWCLASSMAP_TEXT_FONTFAMILY[fontFamily],\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n )}`;\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask/design-system-shared';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?: React.CSSProperties;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional boolean that adds an ellipsis (...) when text overflows its container.\n *\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}
1
+ {"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask/design-system-shared';\nimport type { CSSProperties } from 'react';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?: CSSProperties;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional boolean that adds an ellipsis (...) when text overflows its container.\n *\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}
@@ -1,11 +1,11 @@
1
- /// <reference types="react" />
2
1
  import type { TextPropsShared } from "@metamask/design-system-shared";
2
+ import type { CSSProperties } from "react";
3
3
  import type { OverflowWrap, TextAlign, TextTransform } from "../../types/index.cjs";
4
4
  export type TextProps = TextPropsShared & {
5
5
  /**
6
6
  * Optional prop for inline styles
7
7
  */
8
- style?: React.CSSProperties;
8
+ style?: CSSProperties;
9
9
  /**
10
10
  * Optional prop for additional CSS classes to be applied to the Text component.
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -1,11 +1,11 @@
1
- /// <reference types="react" />
2
1
  import type { TextPropsShared } from "@metamask/design-system-shared";
2
+ import type { CSSProperties } from "react";
3
3
  import type { OverflowWrap, TextAlign, TextTransform } from "../../types/index.mjs";
4
4
  export type TextProps = TextPropsShared & {
5
5
  /**
6
6
  * Optional prop for inline styles
7
7
  */
8
- style?: React.CSSProperties;
8
+ style?: CSSProperties;
9
9
  /**
10
10
  * Optional prop for additional CSS classes to be applied to the Text component.
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,8BAAoB;AAE1E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.types.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask/design-system-shared';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?: React.CSSProperties;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional boolean that adds an ellipsis (...) when text overflows its container.\n *\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}
1
+ {"version":3,"file":"Text.types.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask/design-system-shared';\nimport type { CSSProperties } from 'react';\n\nimport type { OverflowWrap, TextAlign, TextTransform } from '../../types';\n\nexport type TextProps = TextPropsShared & {\n /**\n * Optional prop for inline styles\n */\n style?: CSSProperties;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional boolean that adds an ellipsis (...) when text overflows its container.\n *\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TextField = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const tw_merge_1 = require("../../utils/tw-merge.cjs");
29
+ const Input_1 = require("../Input/index.cjs");
30
+ const TextField_types_1 = require("./TextField.types.cjs");
31
+ const SIZE_CLASS = {
32
+ [TextField_types_1.TextFieldSize.Sm]: 'h-8',
33
+ [TextField_types_1.TextFieldSize.Md]: 'h-10',
34
+ [TextField_types_1.TextFieldSize.Lg]: 'h-12',
35
+ };
36
+ exports.TextField = (0, react_1.forwardRef)(({ autoFocus = false, className, id, inputElement, inputProps, inputRef, isDisabled = false, isError = false, isReadOnly = false, maxLength, name, onBlur, onChange, onClick, onFocus, placeholder, required, size = TextField_types_1.TextFieldSize.Md, startAccessory, endAccessory, style, truncate = true, type = TextField_types_1.TextFieldType.Text, value, ...rest }, ref) => {
37
+ const internalInputRef = (0, react_1.useRef)(null);
38
+ const [isFocused, setIsFocused] = (0, react_1.useState)(autoFocus);
39
+ (0, react_1.useEffect)(() => {
40
+ if (isDisabled) {
41
+ setIsFocused(false);
42
+ }
43
+ }, [isDisabled]);
44
+ const handleClick = (0, react_1.useCallback)((event) => {
45
+ if (isDisabled) {
46
+ return;
47
+ }
48
+ internalInputRef.current?.focus();
49
+ onClick?.(event);
50
+ }, [isDisabled, onClick]);
51
+ const handleFocus = (0, react_1.useCallback)((event) => {
52
+ setIsFocused(true);
53
+ onFocus?.(event);
54
+ }, [onFocus]);
55
+ const handleBlur = (0, react_1.useCallback)((event) => {
56
+ setIsFocused(false);
57
+ onBlur?.(event);
58
+ }, [onBlur]);
59
+ const handleInputRef = (0, react_1.useCallback)((node) => {
60
+ internalInputRef.current = node;
61
+ if (typeof inputRef === 'function') {
62
+ inputRef(node);
63
+ }
64
+ else if (inputRef && 'current' in inputRef) {
65
+ inputRef.current = node;
66
+ }
67
+ }, [inputRef]);
68
+ const { className: inputClassNameFromProps, ...inputRest } = inputProps ?? {};
69
+ const containerClassName = (0, tw_merge_1.twMerge)('inline-flex items-center rounded-lg border bg-default transition-colors', SIZE_CLASS[size], startAccessory ? 'pl-4' : 'pl-0', endAccessory ? 'pr-4' : 'pr-0', isDisabled && 'cursor-not-allowed border-muted opacity-50', !isDisabled && isError && 'border-error-default', !isDisabled && !isError && isFocused && 'border-default', !isDisabled && !isError && !isFocused && 'border-muted', className);
70
+ const innerInputClassName = (0, tw_merge_1.twMerge)('m-0 h-full min-w-0 flex-1 border-0 bg-transparent p-0', startAccessory ? 'pl-2' : 'pl-4', endAccessory ? 'pr-2' : 'pr-4', truncate && 'truncate', inputClassNameFromProps);
71
+ return (react_1.default.createElement("div", { ref: ref, className: containerClassName, style: style, onClick: handleClick, ...rest },
72
+ startAccessory,
73
+ inputElement ?? (react_1.default.createElement(Input_1.Input, { ...inputRest, ref: handleInputRef, id: id, name: name, type: type, value: value, placeholder: placeholder, autoFocus: autoFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, isStateStylesDisabled: true, maxLength: maxLength, required: required, "aria-invalid": isError || undefined, onChange: onChange, onFocus: handleFocus, onBlur: handleBlur, className: innerInputClassName })),
74
+ endAccessory));
75
+ });
76
+ exports.TextField.displayName = 'TextField';
77
+ //# sourceMappingURL=TextField.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAMe;AAEf,uDAA+C;AAC/C,8CAAiC;AAEjC,2DAAiE;AAGjE,MAAM,UAAU,GAAkC;IAChD,CAAC,+BAAa,CAAC,EAAE,CAAC,EAAE,KAAK;IACzB,CAAC,+BAAa,CAAC,EAAE,CAAC,EAAE,MAAM;IAC1B,CAAC,+BAAa,CAAC,EAAE,CAAC,EAAE,MAAM;CAC3B,CAAC;AAEW,QAA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9B,QAAQ,IAAI,UAAU,EACtB,uBAAuB,CACxB,CAAC;IAEF,OAAO,CACL,uCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,kBAAkB,EAC7B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,WAAW,KAChB,IAAI;QAEP,cAAc;QACd,YAAY,IAAI,CACf,8BAAC,aAAK,OACA,SAAS,EACb,GAAG,EAAE,cAAc,EACnB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,qBAAqB,QACrB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,kBACJ,OAAO,IAAI,SAAS,EAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,mBAAmB,GAC9B,CACH;QACA,YAAY,CACT,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC","sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Input } from '../Input';\n\nimport { TextFieldSize, TextFieldType } from './TextField.types';\nimport type { TextFieldProps } from './TextField.types';\n\nconst SIZE_CLASS: Record<TextFieldSize, string> = {\n [TextFieldSize.Sm]: 'h-8',\n [TextFieldSize.Md]: 'h-10',\n [TextFieldSize.Lg]: 'h-12',\n};\n\nexport const TextField = forwardRef<HTMLDivElement, TextFieldProps>(\n (\n {\n autoFocus = false,\n className,\n id,\n inputElement,\n inputProps,\n inputRef,\n isDisabled = false,\n isError = false,\n isReadOnly = false,\n maxLength,\n name,\n onBlur,\n onChange,\n onClick,\n onFocus,\n placeholder,\n required,\n size = TextFieldSize.Md,\n startAccessory,\n endAccessory,\n style,\n truncate = true,\n type = TextFieldType.Text,\n value,\n ...rest\n },\n ref,\n ) => {\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const [isFocused, setIsFocused] = useState(autoFocus);\n\n useEffect(() => {\n if (isDisabled) {\n setIsFocused(false);\n }\n }, [isDisabled]);\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (isDisabled) {\n return;\n }\n internalInputRef.current?.focus();\n onClick?.(event);\n },\n [isDisabled, onClick],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false);\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const handleInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n internalInputRef.current = node;\n if (typeof inputRef === 'function') {\n inputRef(node);\n } else if (inputRef && 'current' in inputRef) {\n (\n inputRef as React.MutableRefObject<HTMLInputElement | null>\n ).current = node;\n }\n },\n [inputRef],\n );\n\n const { className: inputClassNameFromProps, ...inputRest } =\n inputProps ?? {};\n\n const containerClassName = twMerge(\n 'inline-flex items-center rounded-lg border bg-default transition-colors',\n SIZE_CLASS[size],\n startAccessory ? 'pl-4' : 'pl-0',\n endAccessory ? 'pr-4' : 'pr-0',\n isDisabled && 'cursor-not-allowed border-muted opacity-50',\n !isDisabled && isError && 'border-error-default',\n !isDisabled && !isError && isFocused && 'border-default',\n !isDisabled && !isError && !isFocused && 'border-muted',\n className,\n );\n\n const innerInputClassName = twMerge(\n 'm-0 h-full min-w-0 flex-1 border-0 bg-transparent p-0',\n startAccessory ? 'pl-2' : 'pl-4',\n endAccessory ? 'pr-2' : 'pr-4',\n truncate && 'truncate',\n inputClassNameFromProps,\n );\n\n return (\n <div\n ref={ref}\n className={containerClassName}\n style={style}\n onClick={handleClick}\n {...rest}\n >\n {startAccessory}\n {inputElement ?? (\n <Input\n {...inputRest}\n ref={handleInputRef}\n id={id}\n name={name}\n type={type}\n value={value}\n placeholder={placeholder}\n autoFocus={autoFocus}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isStateStylesDisabled\n maxLength={maxLength}\n required={required}\n aria-invalid={isError || undefined}\n onChange={onChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n className={innerInputClassName}\n />\n )}\n {endAccessory}\n </div>\n );\n },\n);\n\nTextField.displayName = 'TextField';\n"]}
@@ -0,0 +1,324 @@
1
+ import React from "react";
2
+ import { TextFieldSize, TextFieldType } from "./TextField.types.cjs";
3
+ export declare const TextField: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onFocus" | "onBlur" | "onChange" | "onClick"> & Omit<import("@metamask/design-system-shared").InputPropsShared, "isStateStylesDisabled" | "textVariant"> & {
4
+ isError?: boolean | undefined;
5
+ startAccessory?: React.ReactNode;
6
+ endAccessory?: React.ReactNode;
7
+ inputElement?: React.ReactNode;
8
+ } & {
9
+ size?: TextFieldSize | undefined;
10
+ type?: TextFieldType | undefined;
11
+ truncate?: boolean | undefined;
12
+ maxLength?: number | undefined;
13
+ name?: string | undefined;
14
+ id?: string | undefined;
15
+ required?: boolean | undefined;
16
+ inputProps?: {
17
+ max?: string | number | undefined;
18
+ key?: React.Key | null | undefined;
19
+ height?: string | number | undefined;
20
+ width?: string | number | undefined;
21
+ min?: string | number | undefined;
22
+ color?: string | undefined;
23
+ content?: string | undefined;
24
+ translate?: "yes" | "no" | undefined;
25
+ hidden?: boolean | undefined;
26
+ form?: string | undefined;
27
+ slot?: string | undefined;
28
+ style?: React.CSSProperties | undefined;
29
+ title?: string | undefined;
30
+ dir?: string | undefined;
31
+ pattern?: string | undefined;
32
+ rel?: string | undefined;
33
+ accessKey?: string | undefined;
34
+ draggable?: (boolean | "false" | "true") | undefined;
35
+ inert?: boolean | undefined;
36
+ lang?: string | undefined;
37
+ popover?: "" | "auto" | "manual" | "hint" | undefined;
38
+ className?: string | undefined;
39
+ part?: string | undefined;
40
+ prefix?: string | undefined;
41
+ role?: React.AriaRole | undefined;
42
+ children?: React.ReactNode;
43
+ contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
44
+ enterKeyHint?: "search" | "next" | "done" | "enter" | "go" | "previous" | "send" | undefined;
45
+ inputMode?: "search" | "numeric" | "none" | "url" | "text" | "email" | "tel" | "decimal" | undefined;
46
+ nonce?: string | undefined;
47
+ tabIndex?: number | undefined;
48
+ multiple?: boolean | undefined;
49
+ size?: number | undefined;
50
+ accept?: string | undefined;
51
+ alt?: string | undefined;
52
+ autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
53
+ capture?: boolean | "environment" | "user" | undefined;
54
+ checked?: boolean | undefined;
55
+ formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
56
+ formEncType?: string | undefined;
57
+ formMethod?: string | undefined;
58
+ formNoValidate?: boolean | undefined;
59
+ formTarget?: string | undefined;
60
+ list?: string | undefined;
61
+ minLength?: number | undefined;
62
+ src?: string | undefined;
63
+ step?: string | number | undefined;
64
+ defaultChecked?: boolean | undefined;
65
+ suppressContentEditableWarning?: boolean | undefined;
66
+ suppressHydrationWarning?: boolean | undefined;
67
+ autoCapitalize?: "none" | "off" | "on" | (string & {}) | "words" | "sentences" | "characters" | undefined;
68
+ contextMenu?: string | undefined;
69
+ spellCheck?: (boolean | "false" | "true") | undefined;
70
+ radioGroup?: string | undefined;
71
+ about?: string | undefined;
72
+ datatype?: string | undefined;
73
+ inlist?: any;
74
+ property?: string | undefined;
75
+ resource?: string | undefined;
76
+ rev?: string | undefined;
77
+ typeof?: string | undefined;
78
+ vocab?: string | undefined;
79
+ autoCorrect?: string | undefined;
80
+ autoSave?: string | undefined;
81
+ itemProp?: string | undefined;
82
+ itemScope?: boolean | undefined;
83
+ itemType?: string | undefined;
84
+ itemID?: string | undefined;
85
+ itemRef?: string | undefined;
86
+ results?: number | undefined;
87
+ security?: string | undefined;
88
+ unselectable?: "off" | "on" | undefined;
89
+ popoverTargetAction?: "hide" | "show" | "toggle" | undefined;
90
+ popoverTarget?: string | undefined;
91
+ is?: string | undefined;
92
+ exportparts?: string | undefined;
93
+ "aria-activedescendant"?: string | undefined;
94
+ "aria-atomic"?: (boolean | "false" | "true") | undefined;
95
+ "aria-autocomplete"?: "inline" | "both" | "none" | "list" | undefined;
96
+ "aria-braillelabel"?: string | undefined;
97
+ "aria-brailleroledescription"?: string | undefined;
98
+ "aria-busy"?: (boolean | "false" | "true") | undefined;
99
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
100
+ "aria-colcount"?: number | undefined;
101
+ "aria-colindex"?: number | undefined;
102
+ "aria-colindextext"?: string | undefined;
103
+ "aria-colspan"?: number | undefined;
104
+ "aria-controls"?: string | undefined;
105
+ "aria-current"?: boolean | "false" | "time" | "location" | "page" | "true" | "step" | "date" | undefined;
106
+ "aria-describedby"?: string | undefined;
107
+ "aria-description"?: string | undefined;
108
+ "aria-details"?: string | undefined;
109
+ "aria-disabled"?: (boolean | "false" | "true") | undefined;
110
+ "aria-dropeffect"?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
111
+ "aria-errormessage"?: string | undefined;
112
+ "aria-expanded"?: (boolean | "false" | "true") | undefined;
113
+ "aria-flowto"?: string | undefined;
114
+ "aria-grabbed"?: (boolean | "false" | "true") | undefined;
115
+ "aria-haspopup"?: boolean | "false" | "grid" | "dialog" | "menu" | "listbox" | "true" | "tree" | undefined;
116
+ "aria-hidden"?: (boolean | "false" | "true") | undefined;
117
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
118
+ "aria-keyshortcuts"?: string | undefined;
119
+ "aria-label"?: string | undefined;
120
+ "aria-labelledby"?: string | undefined;
121
+ "aria-level"?: number | undefined;
122
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
123
+ "aria-modal"?: (boolean | "false" | "true") | undefined;
124
+ "aria-multiline"?: (boolean | "false" | "true") | undefined;
125
+ "aria-multiselectable"?: (boolean | "false" | "true") | undefined;
126
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
127
+ "aria-owns"?: string | undefined;
128
+ "aria-placeholder"?: string | undefined;
129
+ "aria-posinset"?: number | undefined;
130
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
131
+ "aria-readonly"?: (boolean | "false" | "true") | undefined;
132
+ "aria-relevant"?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
133
+ "aria-required"?: (boolean | "false" | "true") | undefined;
134
+ "aria-roledescription"?: string | undefined;
135
+ "aria-rowcount"?: number | undefined;
136
+ "aria-rowindex"?: number | undefined;
137
+ "aria-rowindextext"?: string | undefined;
138
+ "aria-rowspan"?: number | undefined;
139
+ "aria-selected"?: (boolean | "false" | "true") | undefined;
140
+ "aria-setsize"?: number | undefined;
141
+ "aria-sort"?: "none" | "other" | "ascending" | "descending" | undefined;
142
+ "aria-valuemax"?: number | undefined;
143
+ "aria-valuemin"?: number | undefined;
144
+ "aria-valuenow"?: number | undefined;
145
+ "aria-valuetext"?: string | undefined;
146
+ dangerouslySetInnerHTML?: {
147
+ __html: string | TrustedHTML;
148
+ } | undefined;
149
+ onCopy?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
150
+ onCopyCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
151
+ onCut?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
152
+ onCutCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
153
+ onPaste?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
154
+ onPasteCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
155
+ onCompositionEnd?: React.CompositionEventHandler<HTMLInputElement> | undefined;
156
+ onCompositionEndCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
157
+ onCompositionStart?: React.CompositionEventHandler<HTMLInputElement> | undefined;
158
+ onCompositionStartCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
159
+ onCompositionUpdate?: React.CompositionEventHandler<HTMLInputElement> | undefined;
160
+ onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
161
+ onFocusCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
162
+ onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
163
+ onChangeCapture?: React.ChangeEventHandler<HTMLInputElement, Element> | undefined;
164
+ onBeforeInput?: React.InputEventHandler<HTMLInputElement> | undefined;
165
+ onBeforeInputCapture?: React.InputEventHandler<HTMLInputElement> | undefined;
166
+ onInput?: React.InputEventHandler<HTMLInputElement> | undefined;
167
+ onInputCapture?: React.InputEventHandler<HTMLInputElement> | undefined;
168
+ onReset?: React.ReactEventHandler<HTMLInputElement> | undefined;
169
+ onResetCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
170
+ onSubmit?: React.SubmitEventHandler<HTMLInputElement> | undefined;
171
+ onSubmitCapture?: React.SubmitEventHandler<HTMLInputElement> | undefined;
172
+ onInvalid?: React.ReactEventHandler<HTMLInputElement> | undefined;
173
+ onInvalidCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
174
+ onLoad?: React.ReactEventHandler<HTMLInputElement> | undefined;
175
+ onLoadCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
176
+ onError?: React.ReactEventHandler<HTMLInputElement> | undefined;
177
+ onErrorCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
178
+ onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
179
+ onKeyDownCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
180
+ onKeyPress?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
181
+ onKeyPressCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
182
+ onKeyUp?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
183
+ onKeyUpCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
184
+ onAbort?: React.ReactEventHandler<HTMLInputElement> | undefined;
185
+ onAbortCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
186
+ onCanPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
187
+ onCanPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
188
+ onCanPlayThrough?: React.ReactEventHandler<HTMLInputElement> | undefined;
189
+ onCanPlayThroughCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
190
+ onDurationChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
191
+ onDurationChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
192
+ onEmptied?: React.ReactEventHandler<HTMLInputElement> | undefined;
193
+ onEmptiedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
194
+ onEncrypted?: React.ReactEventHandler<HTMLInputElement> | undefined;
195
+ onEncryptedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
196
+ onEnded?: React.ReactEventHandler<HTMLInputElement> | undefined;
197
+ onEndedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
198
+ onLoadedData?: React.ReactEventHandler<HTMLInputElement> | undefined;
199
+ onLoadedDataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
200
+ onLoadedMetadata?: React.ReactEventHandler<HTMLInputElement> | undefined;
201
+ onLoadedMetadataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
202
+ onLoadStart?: React.ReactEventHandler<HTMLInputElement> | undefined;
203
+ onLoadStartCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
204
+ onPause?: React.ReactEventHandler<HTMLInputElement> | undefined;
205
+ onPauseCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
206
+ onPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
207
+ onPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
208
+ onPlaying?: React.ReactEventHandler<HTMLInputElement> | undefined;
209
+ onPlayingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
210
+ onProgress?: React.ReactEventHandler<HTMLInputElement> | undefined;
211
+ onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
212
+ onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
213
+ onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
214
+ onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
215
+ onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
216
+ onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
217
+ onSeekingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
218
+ onStalled?: React.ReactEventHandler<HTMLInputElement> | undefined;
219
+ onStalledCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
220
+ onSuspend?: React.ReactEventHandler<HTMLInputElement> | undefined;
221
+ onSuspendCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
222
+ onTimeUpdate?: React.ReactEventHandler<HTMLInputElement> | undefined;
223
+ onTimeUpdateCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
224
+ onVolumeChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
225
+ onVolumeChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
226
+ onWaiting?: React.ReactEventHandler<HTMLInputElement> | undefined;
227
+ onWaitingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
228
+ onAuxClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
229
+ onAuxClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
230
+ onClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
231
+ onClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
232
+ onContextMenu?: React.MouseEventHandler<HTMLInputElement> | undefined;
233
+ onContextMenuCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
234
+ onDoubleClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
235
+ onDoubleClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
236
+ onDrag?: React.DragEventHandler<HTMLInputElement> | undefined;
237
+ onDragCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
238
+ onDragEnd?: React.DragEventHandler<HTMLInputElement> | undefined;
239
+ onDragEndCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
240
+ onDragEnter?: React.DragEventHandler<HTMLInputElement> | undefined;
241
+ onDragEnterCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
242
+ onDragExit?: React.DragEventHandler<HTMLInputElement> | undefined;
243
+ onDragExitCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
244
+ onDragLeave?: React.DragEventHandler<HTMLInputElement> | undefined;
245
+ onDragLeaveCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
246
+ onDragOver?: React.DragEventHandler<HTMLInputElement> | undefined;
247
+ onDragOverCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
248
+ onDragStart?: React.DragEventHandler<HTMLInputElement> | undefined;
249
+ onDragStartCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
250
+ onDrop?: React.DragEventHandler<HTMLInputElement> | undefined;
251
+ onDropCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
252
+ onMouseDown?: React.MouseEventHandler<HTMLInputElement> | undefined;
253
+ onMouseDownCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
254
+ onMouseEnter?: React.MouseEventHandler<HTMLInputElement> | undefined;
255
+ onMouseLeave?: React.MouseEventHandler<HTMLInputElement> | undefined;
256
+ onMouseMove?: React.MouseEventHandler<HTMLInputElement> | undefined;
257
+ onMouseMoveCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
258
+ onMouseOut?: React.MouseEventHandler<HTMLInputElement> | undefined;
259
+ onMouseOutCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
260
+ onMouseOver?: React.MouseEventHandler<HTMLInputElement> | undefined;
261
+ onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
262
+ onMouseUp?: React.MouseEventHandler<HTMLInputElement> | undefined;
263
+ onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
264
+ onSelect?: React.ReactEventHandler<HTMLInputElement> | undefined;
265
+ onSelectCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
266
+ onTouchCancel?: React.TouchEventHandler<HTMLInputElement> | undefined;
267
+ onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
268
+ onTouchEnd?: React.TouchEventHandler<HTMLInputElement> | undefined;
269
+ onTouchEndCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
270
+ onTouchMove?: React.TouchEventHandler<HTMLInputElement> | undefined;
271
+ onTouchMoveCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
272
+ onTouchStart?: React.TouchEventHandler<HTMLInputElement> | undefined;
273
+ onTouchStartCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
274
+ onPointerDown?: React.PointerEventHandler<HTMLInputElement> | undefined;
275
+ onPointerDownCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
276
+ onPointerMove?: React.PointerEventHandler<HTMLInputElement> | undefined;
277
+ onPointerMoveCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
278
+ onPointerUp?: React.PointerEventHandler<HTMLInputElement> | undefined;
279
+ onPointerUpCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
280
+ onPointerCancel?: React.PointerEventHandler<HTMLInputElement> | undefined;
281
+ onPointerCancelCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
282
+ onPointerEnter?: React.PointerEventHandler<HTMLInputElement> | undefined;
283
+ onPointerLeave?: React.PointerEventHandler<HTMLInputElement> | undefined;
284
+ onPointerOver?: React.PointerEventHandler<HTMLInputElement> | undefined;
285
+ onPointerOverCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
286
+ onPointerOut?: React.PointerEventHandler<HTMLInputElement> | undefined;
287
+ onPointerOutCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
288
+ onGotPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
289
+ onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
290
+ onLostPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
291
+ onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
292
+ onScroll?: React.UIEventHandler<HTMLInputElement> | undefined;
293
+ onScrollCapture?: React.UIEventHandler<HTMLInputElement> | undefined;
294
+ onScrollEnd?: React.UIEventHandler<HTMLInputElement> | undefined;
295
+ onScrollEndCapture?: React.UIEventHandler<HTMLInputElement> | undefined;
296
+ onWheel?: React.WheelEventHandler<HTMLInputElement> | undefined;
297
+ onWheelCapture?: React.WheelEventHandler<HTMLInputElement> | undefined;
298
+ onAnimationStart?: React.AnimationEventHandler<HTMLInputElement> | undefined;
299
+ onAnimationStartCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
300
+ onAnimationEnd?: React.AnimationEventHandler<HTMLInputElement> | undefined;
301
+ onAnimationEndCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
302
+ onAnimationIteration?: React.AnimationEventHandler<HTMLInputElement> | undefined;
303
+ onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
304
+ onToggle?: React.ToggleEventHandler<HTMLInputElement> | undefined;
305
+ onBeforeToggle?: React.ToggleEventHandler<HTMLInputElement> | undefined;
306
+ onTransitionCancel?: React.TransitionEventHandler<HTMLInputElement> | undefined;
307
+ onTransitionCancelCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
308
+ onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement> | undefined;
309
+ onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
310
+ onTransitionRun?: React.TransitionEventHandler<HTMLInputElement> | undefined;
311
+ onTransitionRunCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
312
+ onTransitionStart?: React.TransitionEventHandler<HTMLInputElement> | undefined;
313
+ onTransitionStartCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
314
+ textVariant?: import("@metamask/design-system-shared").TextVariant | undefined;
315
+ } | undefined;
316
+ inputRef?: React.Ref<HTMLInputElement> | undefined;
317
+ onChange?: ((event: React.ChangeEvent<HTMLInputElement, Element>) => void) | undefined;
318
+ onFocus?: ((event: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
319
+ onBlur?: ((event: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
320
+ onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
321
+ className?: string | undefined;
322
+ style?: React.CSSProperties | undefined;
323
+ } & React.RefAttributes<HTMLDivElement>>;
324
+ //# sourceMappingURL=TextField.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,cAAc;AAKf,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,8BAA0B;AASjE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA2IrB,CAAC"}