@primer/react-brand 0.77.0 → 0.78.0-rc.6fbe9fb5
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.
- package/docs/components/ActionMenu/index.md +65 -19
- package/docs/components/ButtonGroup/index.md +9 -6
- package/docs/components/ButtonGroup/react.md +26 -6
- package/docs/components/IconButton/index.md +99 -0
- package/docs/components/IconButton/react.md +189 -0
- package/docs/components/Tooltip/index.md +24 -13
- package/docs/components/index.md +1 -0
- package/docs/forms/TextInput/index.md +4 -2
- package/docs/index.md +3 -2
- package/esm/ActionMenu/ActionMenu.d.ts +18 -24
- package/esm/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/esm/ActionMenu/ActionMenu.js +247 -168
- package/esm/ActionMenu/ActionMenu.js.map +1 -1
- package/esm/ActionMenu/ActionMenu.module-DlO2FtEt.css +1 -0
- package/esm/ActionMenu/ActionMenu.module.js +4 -1
- package/esm/ActionMenu/ActionMenu.module.js.map +1 -1
- package/esm/ActionMenu/ActionMenuContext.d.ts +23 -0
- package/esm/ActionMenu/ActionMenuContext.d.ts.map +1 -0
- package/esm/ActionMenu/ActionMenuContext.js +24 -0
- package/esm/ActionMenu/ActionMenuContext.js.map +1 -0
- package/esm/Button/Button.d.ts +4 -2
- package/esm/Button/Button.d.ts.map +1 -1
- package/esm/Button/Button.js +25 -24
- package/esm/Button/Button.js.map +1 -1
- package/esm/Button/Button.module-CqRiLusx.css +1 -0
- package/esm/Button/Button.module.js +1 -1
- package/esm/Button/Button.module.js.map +1 -1
- package/esm/ButtonGroup/ButtonGroup.d.ts +7 -1
- package/esm/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/esm/ButtonGroup/ButtonGroup.js +44 -22
- package/esm/ButtonGroup/ButtonGroup.js.map +1 -1
- package/esm/ButtonGroup/ButtonGroup.module-pJbqxGBe.css +1 -0
- package/esm/ButtonGroup/ButtonGroup.module.js +8 -3
- package/esm/ButtonGroup/ButtonGroup.module.js.map +1 -1
- package/esm/FAQ/{FAQGroup.module-qm5jP0zF.css → FAQGroup.module-DNyxktEm.css} +1 -1
- package/esm/FAQ/FAQGroup.module.js +1 -1
- package/esm/FAQ/FAQGroup.module.js.map +1 -1
- package/esm/IconButton/IconButton.d.ts +30 -0
- package/esm/IconButton/IconButton.d.ts.map +1 -0
- package/esm/IconButton/IconButton.js +68 -0
- package/esm/IconButton/IconButton.js.map +1 -0
- package/esm/IconButton/IconButton.module-tmxv8TCl.css +1 -0
- package/esm/IconButton/IconButton.module.js +19 -0
- package/esm/IconButton/IconButton.module.js.map +1 -0
- package/esm/IconButton/index.d.ts +2 -0
- package/esm/IconButton/index.d.ts.map +1 -0
- package/esm/PricingOptions/PricingOptions.js +26 -26
- package/esm/Tooltip/Tooltip.d.ts +5 -2
- package/esm/Tooltip/Tooltip.d.ts.map +1 -1
- package/esm/Tooltip/Tooltip.js +90 -45
- package/esm/Tooltip/Tooltip.js.map +1 -1
- package/esm/Tooltip/Tooltip.module-CSt4tNaI.css +1 -0
- package/esm/Tooltip/Tooltip.module.js +1 -1
- package/esm/Tooltip/Tooltip.module.js.map +1 -1
- package/esm/forms/TextInput/TextInput.d.ts +4 -2
- package/esm/forms/TextInput/TextInput.d.ts.map +1 -1
- package/esm/forms/TextInput/TextInput.js +8 -3
- package/esm/forms/TextInput/TextInput.js.map +1 -1
- package/esm/forms/TextInput/TextInput.module-CeOwKkHk.css +1 -0
- package/esm/forms/TextInput/TextInput.module.js +10 -1
- package/esm/forms/TextInput/TextInput.module.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.esm.js +70 -68
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes-mgXFtgvP.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/button/base-DhkVnZYz.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/base-DLPw97mz.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes-D7iaptsa.css +1 -0
- package/lib/ActionMenu/ActionMenu.d.ts +18 -24
- package/lib/ActionMenu/ActionMenuContext.d.ts +22 -0
- package/lib/Button/Button.d.ts +4 -2
- package/lib/ButtonGroup/ButtonGroup.d.ts +7 -1
- package/lib/IconButton/IconButton.d.ts +29 -0
- package/lib/IconButton/index.d.ts +1 -0
- package/lib/Tooltip/Tooltip.d.ts +5 -2
- package/lib/css/main.css +659 -347
- package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/base/colors/light.css +1 -1
- package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
- package/lib/design-tokens/css/tokens/functional/animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +5 -1
- package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/bento/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/blinking-cursor/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/base.css +13 -0
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/comparison-table.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/eyebrow-banner.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/faq.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon-button/base.css +15 -0
- package/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes.css +39 -0
- package/lib/design-tokens/css/tokens/functional/components/icon-button/colors.css +21 -0
- package/lib/design-tokens/css/tokens/functional/components/ide/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-code/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-code/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/river.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/statistic/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/viewport.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
- package/lib/design-tokens/js/module/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/button/base.js +25 -0
- package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/footer/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/icon-button/base.js +31 -0
- package/lib/design-tokens/js/module/tokens/functional/components/icon-button/colors.js +83 -0
- package/lib/design-tokens/js/module/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-code/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/button/base.js +11 -0
- package/lib/design-tokens/js/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/footer/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/icon-button/base.js +13 -0
- package/lib/design-tokens/js/tokens/functional/components/icon-button/colors.js +19 -0
- package/lib/design-tokens/js/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-code/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/json/colors.json +16 -0
- package/lib/design-tokens/scss/tokens/base/colors/light.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/typography/typography.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/animation/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/colors/global.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/bento/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/button/base.scss +10 -0
- package/lib/design-tokens/scss/tokens/functional/components/card/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/card/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/comparison-table/comparison-table.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/eyebrow-banner/eyebrow-banner.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/faq.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/footer/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/footer/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/frosted-glass-vfx/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/grid.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/hero/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/icon/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/icon-button/base.scss +12 -0
- package/lib/design-tokens/scss/tokens/functional/components/icon-button/colors.scss +18 -0
- package/lib/design-tokens/scss/tokens/functional/components/ide/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/image/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-code/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/label/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/media-playlist/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/pricing-options.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/prose/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/river.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/section/section.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/statistic/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/sub-nav/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/token/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tooltip/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/video-player/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/border.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/breakpoints.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-coarse.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-fine.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/viewport.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography-responsive.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography.scss +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/button/base.d.ts +28 -0
- package/lib/design-tokens/ts/tokens/functional/components/button/base.js +25 -0
- package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/base.d.ts +34 -0
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/base.js +31 -0
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/colors.d.ts +44 -0
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/colors.js +41 -0
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-code/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-code/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
- package/lib/forms/TextInput/TextInput.d.ts +4 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/llms.txt +3 -2
- package/package.json +1 -1
- package/esm/ActionMenu/ActionMenu.module-BAeHTqHw.css +0 -1
- package/esm/Button/Button.module-9oHHqqnx.css +0 -1
- package/esm/ButtonGroup/ButtonGroup.module-wZYyupar.css +0 -1
- package/esm/Tooltip/Tooltip.module-5Km7qGR5.css +0 -1
- package/esm/forms/TextInput/TextInput.module-CrmcmO_m.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes-B69RzUbe.css +0 -1
package/esm/Tooltip/Tooltip.js
CHANGED
|
@@ -8,106 +8,151 @@ import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
|
8
8
|
import { getAnchoredPosition as d } from "@primer/behaviors";
|
|
9
9
|
import { apply as f, isSupported as p } from "@oddbird/popover-polyfill/fn";
|
|
10
10
|
//#region src/Tooltip/Tooltip.tsx
|
|
11
|
-
var m =
|
|
11
|
+
var m = [
|
|
12
|
+
"nw",
|
|
13
|
+
"n",
|
|
14
|
+
"ne",
|
|
15
|
+
"e",
|
|
16
|
+
"se",
|
|
17
|
+
"s",
|
|
18
|
+
"sw",
|
|
19
|
+
"w"
|
|
20
|
+
], h = [
|
|
21
|
+
"short",
|
|
22
|
+
"medium",
|
|
23
|
+
"long"
|
|
24
|
+
], g = {
|
|
25
|
+
nw: {
|
|
26
|
+
side: "outside-top",
|
|
27
|
+
align: "end"
|
|
28
|
+
},
|
|
12
29
|
n: {
|
|
13
30
|
side: "outside-top",
|
|
14
31
|
align: "center"
|
|
15
32
|
},
|
|
33
|
+
ne: {
|
|
34
|
+
side: "outside-top",
|
|
35
|
+
align: "start"
|
|
36
|
+
},
|
|
16
37
|
e: {
|
|
17
38
|
side: "outside-right",
|
|
18
39
|
align: "center"
|
|
19
40
|
},
|
|
41
|
+
se: {
|
|
42
|
+
side: "outside-bottom",
|
|
43
|
+
align: "start"
|
|
44
|
+
},
|
|
20
45
|
s: {
|
|
21
46
|
side: "outside-bottom",
|
|
22
47
|
align: "center"
|
|
23
48
|
},
|
|
49
|
+
sw: {
|
|
50
|
+
side: "outside-bottom",
|
|
51
|
+
align: "end"
|
|
52
|
+
},
|
|
24
53
|
w: {
|
|
25
54
|
side: "outside-left",
|
|
26
55
|
align: "center"
|
|
27
56
|
}
|
|
28
|
-
},
|
|
57
|
+
}, _ = {
|
|
58
|
+
"outside-top-end": "nw",
|
|
29
59
|
"outside-top-center": "n",
|
|
60
|
+
"outside-top-start": "ne",
|
|
30
61
|
"outside-right-center": "e",
|
|
62
|
+
"outside-bottom-start": "se",
|
|
31
63
|
"outside-bottom-center": "s",
|
|
64
|
+
"outside-bottom-end": "sw",
|
|
32
65
|
"outside-left-center": "w"
|
|
33
|
-
},
|
|
66
|
+
}, v = {
|
|
67
|
+
short: 50,
|
|
68
|
+
medium: 400,
|
|
69
|
+
long: 1200
|
|
70
|
+
}, y = [
|
|
34
71
|
"a[href]",
|
|
35
72
|
"button:not(:disabled)",
|
|
36
73
|
"summary",
|
|
37
74
|
"select",
|
|
38
75
|
"input:not([type=hidden])",
|
|
39
76
|
"textarea"
|
|
40
|
-
],
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
A.current
|
|
45
|
-
|
|
77
|
+
], b = (e) => y.some((t) => e.matches(t)) || e.hasAttribute("role") && e.getAttribute("role") === "button", x = i.createContext({}), S = i.forwardRef(({ direction: m = "s", delay: h = "short", text: y, type: S = "description", children: C, id: w, className: T, ...E }, D) => {
|
|
78
|
+
let O = t(w), k = a.only(C) ?? null, A = n(D), j = s(null), M = s(null), N = s(null), [P, F] = c(m), I = i.useCallback(() => {
|
|
79
|
+
M.current &&= (clearTimeout(M.current), null);
|
|
80
|
+
let e = A.current?.getAttribute("aria-haspopup");
|
|
81
|
+
A.current?.getAttribute("aria-expanded") === "true" && e !== null && e !== "false" || (N.current &&= (clearTimeout(N.current), null), j.current && A.current && typeof j.current.showPopover == "function" && !j.current.matches(":popover-open") && j.current.showPopover());
|
|
82
|
+
}, [j, A]), L = i.useCallback(() => {
|
|
83
|
+
M.current && clearTimeout(M.current), M.current = setTimeout(() => {
|
|
84
|
+
M.current = null, I();
|
|
85
|
+
}, v[h]);
|
|
86
|
+
}, [h, I]), R = i.useCallback(() => {
|
|
87
|
+
M.current &&= (clearTimeout(M.current), null), N.current = setTimeout(() => {
|
|
88
|
+
j.current && A.current && typeof j.current.hidePopover == "function" && j.current.matches(":popover-open") && j.current.hidePopover();
|
|
46
89
|
}, 200);
|
|
47
|
-
}, [
|
|
90
|
+
}, [j, A]);
|
|
48
91
|
return o(() => () => {
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
if (!
|
|
52
|
-
let e =
|
|
53
|
-
if (!(e || n) && (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") && console.warn("The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or equivalent interactive element instead."),
|
|
54
|
-
let e =
|
|
92
|
+
M.current && clearTimeout(M.current), N.current && clearTimeout(N.current);
|
|
93
|
+
}, [N]), o(() => {
|
|
94
|
+
if (!j.current || !A.current) return;
|
|
95
|
+
let e = b(A.current), t = A.current.childNodes, n = Array.from(t).some((e) => e instanceof HTMLElement && b(e));
|
|
96
|
+
if (!(e || n) && (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") && console.warn("The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or equivalent interactive element instead."), S === "label") {
|
|
97
|
+
let e = A.current.hasAttribute("aria-label"), t = Array.from(A.current.childNodes).some((e) => e instanceof HTMLElement && e.hasAttribute("aria-label"));
|
|
55
98
|
(e || t) && (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") && console.warn("The label type `Tooltip` is going to be used here to label the trigger element. Please remove the aria-label from the trigger element.");
|
|
56
99
|
}
|
|
57
100
|
typeof window < "u" && (p() || f());
|
|
58
|
-
let r =
|
|
101
|
+
let r = j.current, i = A.current;
|
|
59
102
|
r.setAttribute("popover", "auto");
|
|
60
103
|
let a = {
|
|
61
|
-
side: m
|
|
62
|
-
align: m
|
|
104
|
+
side: g[m].side,
|
|
105
|
+
align: g[m].align,
|
|
63
106
|
anchorOffset: 8
|
|
64
107
|
}, o = () => {
|
|
65
108
|
let { top: e, left: t, anchorAlign: n, anchorSide: o } = d(r, i, a);
|
|
66
109
|
r.style.top = `${e}px`, r.style.left = `${t}px`;
|
|
67
|
-
let s =
|
|
68
|
-
|
|
110
|
+
let s = r.getBoundingClientRect(), c = i.getBoundingClientRect(), l = o === "outside-top" || o === "outside-bottom", u = l ? c.left + c.width / 2 - s.left : c.top + c.height / 2 - s.top, f = l ? s.width : s.height, p = Math.max(0, Math.min(u, f));
|
|
111
|
+
r.style.setProperty("--p", `${p}px`);
|
|
112
|
+
let m = _[`${o}-${n}`];
|
|
113
|
+
F(m);
|
|
69
114
|
};
|
|
70
115
|
return r.addEventListener("toggle", o), () => {
|
|
71
116
|
r.removeEventListener("toggle", o);
|
|
72
117
|
};
|
|
73
118
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
]), /* @__PURE__ */ u(
|
|
79
|
-
value: { tooltipId:
|
|
80
|
-
children: [
|
|
81
|
-
ref:
|
|
82
|
-
"aria-describedby":
|
|
83
|
-
"aria-labelledby":
|
|
119
|
+
j,
|
|
120
|
+
A,
|
|
121
|
+
m,
|
|
122
|
+
S
|
|
123
|
+
]), /* @__PURE__ */ u(x.Provider, {
|
|
124
|
+
value: { tooltipId: O },
|
|
125
|
+
children: [k && i.cloneElement(k, {
|
|
126
|
+
ref: A,
|
|
127
|
+
"aria-describedby": S === "description" ? O : k.props["aria-describedby"],
|
|
128
|
+
"aria-labelledby": S === "label" ? O : k.props["aria-labelledby"],
|
|
84
129
|
onBlur: (e) => {
|
|
85
|
-
|
|
130
|
+
R(), k.props.onBlur?.(e);
|
|
86
131
|
},
|
|
87
132
|
onFocus: (e) => {
|
|
88
|
-
|
|
133
|
+
I(), k.props.onFocus?.(e);
|
|
89
134
|
},
|
|
90
135
|
onMouseEnter: (e) => {
|
|
91
|
-
|
|
136
|
+
L(), k.props.onMouseEnter?.(e);
|
|
92
137
|
},
|
|
93
138
|
onMouseLeave: (e) => {
|
|
94
|
-
|
|
139
|
+
R(), k.props.onMouseLeave?.(e);
|
|
95
140
|
}
|
|
96
141
|
}), /* @__PURE__ */ l("div", {
|
|
97
|
-
className: e(r.Tooltip,
|
|
98
|
-
ref:
|
|
99
|
-
"data-direction":
|
|
100
|
-
...
|
|
101
|
-
role:
|
|
102
|
-
"aria-hidden":
|
|
103
|
-
id:
|
|
104
|
-
onMouseEnter:
|
|
105
|
-
onMouseLeave:
|
|
142
|
+
className: e(r.Tooltip, T),
|
|
143
|
+
ref: j,
|
|
144
|
+
"data-direction": P,
|
|
145
|
+
...E,
|
|
146
|
+
role: S === "description" ? "tooltip" : void 0,
|
|
147
|
+
"aria-hidden": S === "label" || void 0,
|
|
148
|
+
id: O,
|
|
149
|
+
onMouseEnter: I,
|
|
150
|
+
onMouseLeave: R,
|
|
106
151
|
children: y
|
|
107
152
|
})]
|
|
108
153
|
});
|
|
109
154
|
});
|
|
110
155
|
//#endregion
|
|
111
|
-
export {
|
|
156
|
+
export { S as Tooltip, x as TooltipContext, h as TooltipDelays, m as TooltipDirections };
|
|
112
157
|
|
|
113
158
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","names":[],"sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, {Children, useEffect, useRef, useState} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../hooks/useId'\nimport {getAnchoredPosition} from '@primer/behaviors'\nimport type {AnchorSide, AnchorAlignment} from '@primer/behaviors'\nimport {isSupported, apply} from '@oddbird/popover-polyfill/fn'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Tooltip.module.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css'\nimport {BaseProps} from '../component-helpers'\n\ntype TooltipDirection = 'n' | 'e' | 's' | 'w'\nexport type TooltipProps = {\n direction?: TooltipDirection\n text: string\n type?: 'label' | 'description'\n children?: React.ReactNode\n} & BaseProps<HTMLDivElement>\n\nexport type TriggerPropsType = {\n 'aria-describedby'?: string\n 'aria-labelledby'?: string\n 'aria-label'?: string\n onBlur?: React.FocusEventHandler\n onFocus?: React.FocusEventHandler\n onMouseEnter?: React.MouseEventHandler\n onMouseLeave?: React.MouseEventHandler\n ref?: React.RefObject<HTMLElement | null>\n}\n\n// map tooltip direction to anchoredPosition props\nconst directionToPosition: Record<TooltipDirection, {side: AnchorSide; align: AnchorAlignment}> = {\n n: {side: 'outside-top', align: 'center'},\n e: {side: 'outside-right', align: 'center'},\n s: {side: 'outside-bottom', align: 'center'},\n w: {side: 'outside-left', align: 'center'},\n}\n\n// map anchoredPosition props to tooltip direction\nconst positionToDirection: Record<string, TooltipDirection> = {\n 'outside-top-center': 'n',\n 'outside-right-center': 'e',\n 'outside-bottom-center': 's',\n 'outside-left-center': 'w',\n}\n\n// The list is from GitHub's custom-axe-rules https://github.com/github/github/blob/master/app/assets/modules/github/axe-custom-rules.ts#L3\nconst interactiveElements = [\n 'a[href]',\n 'button:not(:disabled)',\n 'summary',\n 'select',\n 'input:not([type=hidden])',\n 'textarea',\n]\n\nconst isInteractive = (element: HTMLElement) => {\n return (\n interactiveElements.some(selector => element.matches(selector)) ||\n (element.hasAttribute('role') && element.getAttribute('role') === 'button')\n )\n}\nexport const TooltipContext = React.createContext<{tooltipId?: string}>({})\n\nexport const Tooltip = React.forwardRef(\n ({direction = 's', text, type = 'description', children, id, className, ...rest}: TooltipProps, forwardedRef) => {\n const tooltipId = useId(id)\n const child = (Children.only(children) as React.ReactElement<TriggerPropsType> | null) ?? null\n const triggerRef = useProvidedRefOrCreate(forwardedRef as React.RefObject<HTMLElement | null> | null)\n const tooltipElRef = useRef<HTMLDivElement>(null)\n // Used to delay the closing of the tooltip to make sure the user can move the mouse from the trigger to the tooltip\n const closeTooltipTimeoutRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipCloseTimeout = 200\n\n const [calculatedDirection, setCalculatedDirection] = useState<TooltipDirection>(direction)\n\n const openTooltip = React.useCallback(() => {\n if (closeTooltipTimeoutRef.current) {\n clearTimeout(closeTooltipTimeoutRef.current)\n closeTooltipTimeoutRef.current = null\n }\n\n if (tooltipElRef.current && triggerRef.current && !tooltipElRef.current.matches(':popover-open')) {\n tooltipElRef.current.showPopover()\n }\n }, [tooltipElRef, triggerRef])\n\n const closeTooltip = React.useCallback(() => {\n closeTooltipTimeoutRef.current = setTimeout(() => {\n if (tooltipElRef.current && triggerRef.current && tooltipElRef.current.matches(':popover-open')) {\n tooltipElRef.current.hidePopover()\n }\n }, tooltipCloseTimeout)\n }, [tooltipElRef, triggerRef])\n\n useEffect(() => {\n return () => {\n if (closeTooltipTimeoutRef.current) {\n clearTimeout(closeTooltipTimeoutRef.current)\n }\n }\n }, [closeTooltipTimeoutRef])\n\n useEffect(() => {\n if (!tooltipElRef.current || !triggerRef.current) return\n /*\n * ACCESSIBILITY CHECKS\n */\n // Has trigger element or any of its children interactive elements?\n const isTriggerInteractive = isInteractive(triggerRef.current)\n const triggerChildren = triggerRef.current.childNodes\n const hasInteractiveChild = Array.from(triggerChildren).some(triggerChild => {\n return triggerChild instanceof HTMLElement && isInteractive(triggerChild)\n })\n\n if (\n !(isTriggerInteractive || hasInteractiveChild) &&\n (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or equivalent interactive element instead.',\n )\n }\n\n // If the tooltip is used for labelling the interactive element, the trigger element or any of its children should not have aria-label\n if (type === 'label') {\n const hasAriaLabel = triggerRef.current.hasAttribute('aria-label')\n const hasAriaLabelInChildren = Array.from(triggerRef.current.childNodes).some(\n triggerChild => triggerChild instanceof HTMLElement && triggerChild.hasAttribute('aria-label'),\n )\n\n if (\n (hasAriaLabel || hasAriaLabelInChildren) &&\n (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'The label type `Tooltip` is going to be used here to label the trigger element. Please remove the aria-label from the trigger element.',\n )\n }\n }\n\n // SSR safe polyfill apply\n if (typeof window !== 'undefined') {\n if (!isSupported()) {\n apply()\n }\n }\n\n /*\n * TOOLTIP POSITIONING\n */\n const tooltip = tooltipElRef.current\n const trigger = triggerRef.current\n tooltip.setAttribute('popover', 'auto')\n const settings = {\n side: directionToPosition[direction].side,\n align: directionToPosition[direction].align,\n anchorOffset: 8,\n }\n\n const positionSet = () => {\n const {top, left, anchorAlign, anchorSide} = getAnchoredPosition(tooltip, trigger, settings)\n\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n // This is required to make sure the popover is positioned correctly i.e. when there is not enough space on the specified direction, we set a new direction to position the ::after\n const calculatedDirectionString = positionToDirection[`${anchorSide}-${anchorAlign}` as string]\n setCalculatedDirection(calculatedDirectionString)\n }\n\n tooltip.addEventListener('toggle', positionSet)\n\n return () => {\n tooltip.removeEventListener('toggle', positionSet)\n }\n }, [tooltipElRef, triggerRef, direction, type])\n\n return (\n <TooltipContext.Provider value={{tooltipId}}>\n {child &&\n React.cloneElement(child, {\n ref: triggerRef,\n // If it is a type description, we use tooltip to describe the trigger\n 'aria-describedby': type === 'description' ? tooltipId : child.props['aria-describedby'],\n // If it is a label type, we use tooltip to label the trigger\n 'aria-labelledby': type === 'label' ? tooltipId : child.props['aria-labelledby'],\n onBlur: (event: React.FocusEvent) => {\n closeTooltip()\n child.props.onBlur?.(event)\n },\n onFocus: (event: React.FocusEvent) => {\n openTooltip()\n child.props.onFocus?.(event)\n },\n onMouseEnter: (event: React.MouseEvent) => {\n openTooltip()\n child.props.onMouseEnter?.(event)\n },\n onMouseLeave: (event: React.MouseEvent) => {\n closeTooltip()\n child.props.onMouseLeave?.(event)\n },\n })}\n <div\n className={clsx(styles.Tooltip, className)}\n ref={tooltipElRef}\n data-direction={calculatedDirection}\n {...rest}\n // Only need tooltip role if the tooltip is a description for supplementary information\n role={type === 'description' ? 'tooltip' : undefined}\n // stop AT from announcing the tooltip twice when it is a label type because it will be announced with \"aria-labelledby\"\n aria-hidden={type === 'label' ? true : undefined}\n id={tooltipId}\n // mouse leave and enter on the tooltip itself is needed to keep the tooltip open when the mouse is over the tooltip\n onMouseEnter={openTooltip}\n onMouseLeave={closeTooltip}\n >\n {text}\n </div>\n </TooltipContext.Provider>\n )\n },\n)\n"],"mappings":";;;;;;;;;;AAiCA,IAAM,IAA4F;CAChG,GAAG;EAAC,MAAM;EAAe,OAAO;CAAQ;CACxC,GAAG;EAAC,MAAM;EAAiB,OAAO;CAAQ;CAC1C,GAAG;EAAC,MAAM;EAAkB,OAAO;CAAQ;CAC3C,GAAG;EAAC,MAAM;EAAgB,OAAO;CAAQ;AAC3C,GAGM,IAAwD;CAC5D,sBAAsB;CACtB,wBAAwB;CACxB,yBAAyB;CACzB,uBAAuB;AACzB,GAGM,IAAsB;CAC1B;CACA;CACA;CACA;CACA;CACA;AACF,GAEM,KAAiB,MAEnB,EAAoB,MAAK,MAAY,EAAQ,QAAQ,CAAQ,CAAC,KAC7D,EAAQ,aAAa,MAAM,KA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B;IAEzC,AADA,EAAa,GACb,EAAM,MAAM,eAAe,CAAK;GAClC;EACF,CAAC,GACH,kBAAC,OAAD;GACE,WAAW,EAAK,EAAO,SAAS,CAAS;GACzC,KAAK;GACL,kBAAgB;GAChB,GAAI;GAEJ,MAAM,MAAS,gBAAgB,YAAY,KAAA;GAE3C,eAAa,MAAS,WAAiB,KAAA;GACvC,IAAI;GAEJ,cAAc;GACd,cAAc;aAEb;EACE,CAAA,CACkB;;AAE7B,CACF"}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":[],"sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, {Children, useEffect, useRef, useState} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../hooks/useId'\nimport {getAnchoredPosition} from '@primer/behaviors'\nimport type {AnchorSide, AnchorAlignment} from '@primer/behaviors'\nimport {isSupported, apply} from '@oddbird/popover-polyfill/fn'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Tooltip.module.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css'\nimport {BaseProps} from '../component-helpers'\n\nexport const TooltipDirections = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'] as const\nexport const TooltipDelays = ['short', 'medium', 'long'] as const\nexport type TooltipDirection = (typeof TooltipDirections)[number]\nexport type TooltipDelay = (typeof TooltipDelays)[number]\nexport type TooltipProps = {\n direction?: TooltipDirection\n delay?: TooltipDelay\n text: string\n type?: 'label' | 'description'\n children?: React.ReactNode\n} & BaseProps<HTMLDivElement>\n\nexport type TriggerPropsType = {\n 'aria-describedby'?: string\n 'aria-labelledby'?: string\n 'aria-label'?: string\n onBlur?: React.FocusEventHandler\n onFocus?: React.FocusEventHandler\n onMouseEnter?: React.MouseEventHandler\n onMouseLeave?: React.MouseEventHandler\n ref?: React.RefObject<HTMLElement | null>\n}\n\n// map tooltip direction to anchoredPosition props\nconst directionToPosition: Record<TooltipDirection, {side: AnchorSide; align: AnchorAlignment}> = {\n nw: {side: 'outside-top', align: 'end'},\n n: {side: 'outside-top', align: 'center'},\n ne: {side: 'outside-top', align: 'start'},\n e: {side: 'outside-right', align: 'center'},\n se: {side: 'outside-bottom', align: 'start'},\n s: {side: 'outside-bottom', align: 'center'},\n sw: {side: 'outside-bottom', align: 'end'},\n w: {side: 'outside-left', align: 'center'},\n}\n\n// map anchoredPosition props to tooltip direction\nconst positionToDirection: Record<string, TooltipDirection> = {\n 'outside-top-end': 'nw',\n 'outside-top-center': 'n',\n 'outside-top-start': 'ne',\n 'outside-right-center': 'e',\n 'outside-bottom-start': 'se',\n 'outside-bottom-center': 's',\n 'outside-bottom-end': 'sw',\n 'outside-left-center': 'w',\n}\n\nconst tooltipDelayMap: Record<TooltipDelay, number> = {\n short: 50,\n medium: 400,\n long: 1200,\n}\n\n// The list is from GitHub's custom-axe-rules https://github.com/github/github/blob/master/app/assets/modules/github/axe-custom-rules.ts#L3\nconst interactiveElements = [\n 'a[href]',\n 'button:not(:disabled)',\n 'summary',\n 'select',\n 'input:not([type=hidden])',\n 'textarea',\n]\n\nconst isInteractive = (element: HTMLElement) => {\n return (\n interactiveElements.some(selector => element.matches(selector)) ||\n (element.hasAttribute('role') && element.getAttribute('role') === 'button')\n )\n}\nexport const TooltipContext = React.createContext<{tooltipId?: string}>({})\n\nexport const Tooltip = React.forwardRef(\n (\n {direction = 's', delay = 'short', text, type = 'description', children, id, className, ...rest}: TooltipProps,\n forwardedRef,\n ) => {\n const tooltipId = useId(id)\n const child = (Children.only(children) as React.ReactElement<TriggerPropsType> | null) ?? null\n const triggerRef = useProvidedRefOrCreate(forwardedRef as React.RefObject<HTMLElement | null> | null)\n const tooltipElRef = useRef<HTMLDivElement>(null)\n const openTooltipTimeoutRef = useRef<NodeJS.Timeout | null>(null)\n // Used to delay the closing of the tooltip to make sure the user can move the mouse from the trigger to the tooltip\n const closeTooltipTimeoutRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipCloseTimeout = 200\n\n const [calculatedDirection, setCalculatedDirection] = useState<TooltipDirection>(direction)\n\n const openTooltip = React.useCallback(() => {\n if (openTooltipTimeoutRef.current) {\n clearTimeout(openTooltipTimeoutRef.current)\n openTooltipTimeoutRef.current = null\n }\n\n const ariaHasPopup = triggerRef.current?.getAttribute('aria-haspopup')\n const hasActivePopup =\n triggerRef.current?.getAttribute('aria-expanded') === 'true' &&\n ariaHasPopup !== null &&\n ariaHasPopup !== 'false'\n if (hasActivePopup) return\n\n if (closeTooltipTimeoutRef.current) {\n clearTimeout(closeTooltipTimeoutRef.current)\n closeTooltipTimeoutRef.current = null\n }\n\n if (\n tooltipElRef.current &&\n triggerRef.current &&\n typeof tooltipElRef.current.showPopover === 'function' &&\n !tooltipElRef.current.matches(':popover-open')\n ) {\n tooltipElRef.current.showPopover()\n }\n }, [tooltipElRef, triggerRef])\n\n const openTooltipWithDelay = React.useCallback(() => {\n if (openTooltipTimeoutRef.current) {\n clearTimeout(openTooltipTimeoutRef.current)\n }\n\n openTooltipTimeoutRef.current = setTimeout(() => {\n openTooltipTimeoutRef.current = null\n openTooltip()\n }, tooltipDelayMap[delay])\n }, [delay, openTooltip])\n\n const closeTooltip = React.useCallback(() => {\n if (openTooltipTimeoutRef.current) {\n clearTimeout(openTooltipTimeoutRef.current)\n openTooltipTimeoutRef.current = null\n }\n\n closeTooltipTimeoutRef.current = setTimeout(() => {\n if (\n tooltipElRef.current &&\n triggerRef.current &&\n typeof tooltipElRef.current.hidePopover === 'function' &&\n tooltipElRef.current.matches(':popover-open')\n ) {\n tooltipElRef.current.hidePopover()\n }\n }, tooltipCloseTimeout)\n }, [tooltipElRef, triggerRef])\n\n useEffect(() => {\n return () => {\n if (openTooltipTimeoutRef.current) {\n clearTimeout(openTooltipTimeoutRef.current)\n }\n if (closeTooltipTimeoutRef.current) {\n clearTimeout(closeTooltipTimeoutRef.current)\n }\n }\n }, [closeTooltipTimeoutRef])\n\n useEffect(() => {\n if (!tooltipElRef.current || !triggerRef.current) return\n /*\n * ACCESSIBILITY CHECKS\n */\n // Has trigger element or any of its children interactive elements?\n const isTriggerInteractive = isInteractive(triggerRef.current)\n const triggerChildren = triggerRef.current.childNodes\n const hasInteractiveChild = Array.from(triggerChildren).some(triggerChild => {\n return triggerChild instanceof HTMLElement && isInteractive(triggerChild)\n })\n\n if (\n !(isTriggerInteractive || hasInteractiveChild) &&\n (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or equivalent interactive element instead.',\n )\n }\n\n // If the tooltip is used for labelling the interactive element, the trigger element or any of its children should not have aria-label\n if (type === 'label') {\n const hasAriaLabel = triggerRef.current.hasAttribute('aria-label')\n const hasAriaLabelInChildren = Array.from(triggerRef.current.childNodes).some(\n triggerChild => triggerChild instanceof HTMLElement && triggerChild.hasAttribute('aria-label'),\n )\n\n if (\n (hasAriaLabel || hasAriaLabelInChildren) &&\n (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'The label type `Tooltip` is going to be used here to label the trigger element. Please remove the aria-label from the trigger element.',\n )\n }\n }\n\n // SSR safe polyfill apply\n if (typeof window !== 'undefined') {\n if (!isSupported()) {\n apply()\n }\n }\n\n /*\n * TOOLTIP POSITIONING\n */\n const tooltip = tooltipElRef.current\n const trigger = triggerRef.current\n tooltip.setAttribute('popover', 'auto')\n const settings = {\n side: directionToPosition[direction].side,\n align: directionToPosition[direction].align,\n anchorOffset: 8,\n }\n\n const positionSet = () => {\n const {top, left, anchorAlign, anchorSide} = getAnchoredPosition(tooltip, trigger, settings)\n\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n const tooltipRect = tooltip.getBoundingClientRect()\n const triggerRect = trigger.getBoundingClientRect()\n const isVerticalPlacement = anchorSide === 'outside-top' || anchorSide === 'outside-bottom'\n const caretPosition = isVerticalPlacement\n ? triggerRect.left + triggerRect.width / 2 - tooltipRect.left\n : triggerRect.top + triggerRect.height / 2 - tooltipRect.top\n const tooltipSize = isVerticalPlacement ? tooltipRect.width : tooltipRect.height\n const constrainedCaretPosition = Math.max(0, Math.min(caretPosition, tooltipSize))\n\n tooltip.style.setProperty('--p', `${constrainedCaretPosition}px`)\n\n // This is required to make sure the popover is positioned correctly i.e. when there is not enough space on the specified direction, we set a new direction to position the ::after\n const calculatedDirectionString = positionToDirection[`${anchorSide}-${anchorAlign}` as string]\n setCalculatedDirection(calculatedDirectionString)\n }\n\n tooltip.addEventListener('toggle', positionSet)\n\n return () => {\n tooltip.removeEventListener('toggle', positionSet)\n }\n }, [tooltipElRef, triggerRef, direction, type])\n\n return (\n <TooltipContext.Provider value={{tooltipId}}>\n {child &&\n React.cloneElement(child, {\n ref: triggerRef,\n // If it is a type description, we use tooltip to describe the trigger\n 'aria-describedby': type === 'description' ? tooltipId : child.props['aria-describedby'],\n // If it is a label type, we use tooltip to label the trigger\n 'aria-labelledby': type === 'label' ? tooltipId : child.props['aria-labelledby'],\n onBlur: (event: React.FocusEvent) => {\n closeTooltip()\n child.props.onBlur?.(event)\n },\n onFocus: (event: React.FocusEvent) => {\n openTooltip()\n child.props.onFocus?.(event)\n },\n onMouseEnter: (event: React.MouseEvent) => {\n openTooltipWithDelay()\n child.props.onMouseEnter?.(event)\n },\n onMouseLeave: (event: React.MouseEvent) => {\n closeTooltip()\n child.props.onMouseLeave?.(event)\n },\n })}\n <div\n className={clsx(styles.Tooltip, className)}\n ref={tooltipElRef}\n data-direction={calculatedDirection}\n {...rest}\n // Only need tooltip role if the tooltip is a description for supplementary information\n role={type === 'description' ? 'tooltip' : undefined}\n // stop AT from announcing the tooltip twice when it is a label type because it will be announced with \"aria-labelledby\"\n aria-hidden={type === 'label' ? true : undefined}\n id={tooltipId}\n // mouse leave and enter on the tooltip itself is needed to keep the tooltip open when the mouse is over the tooltip\n onMouseE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ACvE,EAAuB,CAAyB;EAClD;EAIA,OAFA,EAAQ,iBAAiB,UAAU,CAAW,SAEjC;GACX,EAAQ,oBAAoB,UAAU,CAAW;EACnD;CACF,GAAG;EAAC;EAAc;EAAY;EAAW;CAAI,CAAC,GAG5C,kBAAC,EAAe,UAAhB;EAAyB,OAAO,EAAC,aAAS;YAA1C,CACG,KACC,EAAM,aAAa,GAAO;GACxB,KAAK;GAEL,oBAAoB,MAAS,gBAAgB,IAAY,EAAM,MAAM;GAErE,mBAAmB,MAAS,UAAU,IAAY,EAAM,MAAM;GAC9D,SAAS,MAA4B;IAEnC,AADA,EAAa,GACb,EAAM,MAAM,SAAS,CAAK;GAC5B;GACA,UAAU,MAA4B;IAEpC,AADA,EAAY,GACZ,EAAM,MAAM,UAAU,CAAK;GAC7B;GACA,eAAe,MAA4B;IAEzC,AADA,EAAqB,GACrB,EAAM,MAAM,eAAe,CAAK;GAClC;GACA,eAAe,MAA4B;IAEzC,AADA,EAAa,GACb,EAAM,MAAM,eAAe,CAAK;GAClC;EACF,CAAC,GACH,kBAAC,OAAD;GACE,WAAW,EAAK,EAAO,SAAS,CAAS;GACzC,KAAK;GACL,kBAAgB;GAChB,GAAI;GAEJ,MAAM,MAAS,gBAAgB,YAAY,KAAA;GAE3C,eAAa,MAAS,WAAiB,KAAA;GACvC,IAAI;GAEJ,cAAc;GACd,cAAc;aAEb;EACE,CAAA,CACkB;;AAE7B,CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Primer_Brand__Tooltip-module__Tooltip___0Eipx{display:none}@media (forced-colors:active){.Primer_Brand__Tooltip-module__Tooltip___0Eipx{outline:var(--brand-borderWidth-thin) solid transparent}}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[popover]{--offset:var(--base-size-8,--base-size-8);--b:1em;--h:.5em;--p:50%;--r:var(--brand-borderRadius-medium);--c:var(--brand-color-neutral-emphasisPlus);clip:auto;white-space:normal;width:max-content;font:normal normal var(--brand-text-size-100) / var(--brand-text-lineHeight-100) var(--brand-fontStack-sansSerif);-webkit-font-smoothing:subpixel-antialiased;color:var(--brand-Tooltip-color-default);text-align:center;word-wrap:break-word;background:var(--c);border-radius:var(--r);opacity:0;border:0;max-width:250px;margin:auto;padding:.5em .75em;position:absolute;inset:auto;overflow:visible}:is(.Primer_Brand__Tooltip-module__Tooltip___0Eipx[popover]:popover-open,.Primer_Brand__Tooltip-module__Tooltip___0Eipx[popover].Primer_Brand__Tooltip-module__\:popover-open___GpZlX){animation-name:Primer_Brand__Tooltip-module__tooltip-appear___hAyFD;animation-duration:.2s;animation-duration:var(--brand-animation-duration-faster,.2s);animation-timing-function:ease-in;animation-delay:0s;animation-fill-mode:forwards;display:block}.Primer_Brand__Tooltip-module__Tooltip___0Eipx:after{height:var(--offset);content:"";display:block;position:absolute;left:0;right:0}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=n],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=ne],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=nw]{-o-border-image:conic-gradient(var(--c) 0, var(--c) 0) 0 / var(--r) calc(100% - var(--p) - var(--b) / 2) 0 calc(var(--p) - var(--b) / 2) / 0 0 var(--h) 0;border-image:conic-gradient(var(--c) 0, var(--c) 0) fill 0 / var(--r) calc(100% - var(--p) - var(--b) / 2) 0 calc(var(--p) - var(--b) / 2) / 0 0 var(--h) 0;clip-path:polygon(0 100%, 0 0, 100% 0, 100% 100%, min(100%, var(--p) + var(--b) / 2) 100%, var(--p) calc(100% + var(--h)), max(0%, var(--p) - var(--b) / 2) 100%)}@supports (background:conic-gradient(red 0deg, red 0deg 1deg, red 2deg)){.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=n],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=ne],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=nw]{-o-border-image:conic-gradient(var(--c) 0 0) 0 / var(--r) calc(100% - var(--p) - var(--b) / 2) 0 calc(var(--p) - var(--b) / 2) / 0 0 var(--h) 0;border-image:conic-gradient(var(--c) 0 0) fill 0 / var(--r) calc(100% - var(--p) - var(--b) / 2) 0 calc(var(--p) - var(--b) / 2) / 0 0 var(--h) 0}}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=s],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=se],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=sw]{-o-border-image:conic-gradient(var(--c) 0, var(--c) 0) 0/ 0 calc(100% - var(--p) - var(--b) / 2) var(--r) calc(var(--p) - var(--b) / 2) / var(--h) 0 0 0;border-image:conic-gradient(var(--c) 0, var(--c) 0) fill 0/ 0 calc(100% - var(--p) - var(--b) / 2) var(--r) calc(var(--p) - var(--b) / 2) / var(--h) 0 0 0;clip-path:polygon(0 0, 0 100%, 100% 100%, 100% 0, min(100%, var(--p) + var(--b) / 2) 0, var(--p) calc(-1 * var(--h)), max(0%, var(--p) - var(--b) / 2) 0)}@supports (background:conic-gradient(red 0deg, red 0deg 1deg, red 2deg)){.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=s],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=se],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=sw]{-o-border-image:conic-gradient(var(--c) 0 0) 0/ 0 calc(100% - var(--p) - var(--b) / 2) var(--r) calc(var(--p) - var(--b) / 2) / var(--h) 0 0 0;border-image:conic-gradient(var(--c) 0 0) fill 0/ 0 calc(100% - var(--p) - var(--b) / 2) var(--r) calc(var(--p) - var(--b) / 2) / var(--h) 0 0 0}}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=w]{-o-border-image:conic-gradient(var(--c) 0, var(--c) 0) 0 / calc(var(--p) - var(--b) / 2) 0 calc(100% - var(--p) - var(--b) / 2) var(--r) / 0 var(--h) 0 0;border-image:conic-gradient(var(--c) 0, var(--c) 0) fill 0 / calc(var(--p) - var(--b) / 2) 0 calc(100% - var(--p) - var(--b) / 2) var(--r) / 0 var(--h) 0 0;clip-path:polygon(100% 100%, 0 100%, 0 0, 100% 0, 100% max(0%, var(--p) - var(--b) / 2), calc(100% + var(--h)) var(--p), 100% min(100%, var(--p) + var(--b) / 2))}@supports (background:conic-gradient(red 0deg, red 0deg 1deg, red 2deg)){.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=w]{-o-border-image:conic-gradient(var(--c) 0 0) 0 / calc(var(--p) - var(--b) / 2) 0 calc(100% - var(--p) - var(--b) / 2) var(--r) / 0 var(--h) 0 0;border-image:conic-gradient(var(--c) 0 0) fill 0 / calc(var(--p) - var(--b) / 2) 0 calc(100% - var(--p) - var(--b) / 2) var(--r) / 0 var(--h) 0 0}}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=e]{-o-border-image:conic-gradient(var(--c) 0, var(--c) 0) 0 / calc(var(--p) - var(--b) / 2) var(--r) calc(100% - var(--p) - var(--b) / 2) 0/ 0 0 0 var(--h);border-image:conic-gradient(var(--c) 0, var(--c) 0) fill 0 / calc(var(--p) - var(--b) / 2) var(--r) calc(100% - var(--p) - var(--b) / 2) 0/ 0 0 0 var(--h);clip-path:polygon(0 100%, 100% 100%, 100% 0, 0 0, 0 max(0%, var(--p) - var(--b) / 2), calc(-1 * var(--h)) var(--p), 0 min(100%, var(--p) + var(--b) / 2))}@supports (background:conic-gradient(red 0deg, red 0deg 1deg, red 2deg)){.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=e]{-o-border-image:conic-gradient(var(--c) 0 0) 0 / calc(var(--p) - var(--b) / 2) var(--r) calc(100% - var(--p) - var(--b) / 2) 0/ 0 0 0 var(--h);border-image:conic-gradient(var(--c) 0 0) fill 0 / calc(var(--p) - var(--b) / 2) var(--r) calc(100% - var(--p) - var(--b) / 2) 0/ 0 0 0 var(--h)}}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=ne],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=se]{--p:25%}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=nw],.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=sw]{--p:75%}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=n]:after,.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=ne]:after,.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=nw]:after{top:100%}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=s]:after,.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=se]:after,.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=sw]:after{bottom:100%}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=w]:after{height:100%;width:var(--offset);content:"";display:block;position:absolute;bottom:0;left:100%}.Primer_Brand__Tooltip-module__Tooltip___0Eipx[data-direction=e]:after{height:100%;width:var(--offset);content:"";margin-left:calc(var(--offset) * -1px);display:block;position:absolute;bottom:0;right:100%}@keyframes Primer_Brand__Tooltip-module__tooltip-appear___hAyFD{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion:reduce){.Primer_Brand__Tooltip-module__Tooltip___0Eipx,.Primer_Brand__Tooltip-module__Tooltip___0Eipx:before,.Primer_Brand__Tooltip-module__Tooltip___0Eipx:after,.Primer_Brand__Tooltip-module__Tooltip___0Eipx *{animation-duration:0s!important}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './Tooltip.module-
|
|
1
|
+
import './Tooltip.module-CSt4tNaI.css';//#region src/Tooltip/Tooltip.module.css
|
|
2
2
|
var e = "Primer_Brand__Tooltip-module__Tooltip___0Eipx", t = {
|
|
3
3
|
Tooltip: e,
|
|
4
4
|
":popover-open": "Primer_Brand__Tooltip-module__:popover-open___GpZlX",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.module.js","names":[],"sources":["../../src/Tooltip/Tooltip.module.css"],"sourcesContent":[".Tooltip {\n display: none;\n}\n\n@media (forced-colors: active) {\n .Tooltip {\n outline: var(--brand-borderWidth-thin) solid transparent;\n }\n}\n\n/* Overriding the default popover styles */\n.Tooltip[popover] {\n --offset: var(\n --base-size-8,\n --base-size-8\n ); /* This is a \"magic number\". Just gives some room to make sure the tooltip stay open when mouse leaves the trigger to hover tooltip */\n /* these vars are for the triangle, via https://www.smashingmagazine.com/2024/03/modern-css-tooltips-speech-bubbles-part1/ */\n --b: 1em; /* triangle base width */\n --h: 0.5em; /* triangle height */\n --p: 50%; /* center triangle position (0%:left 100%:right) */\n --r: var(--brand-borderRadius-medium); /* border radius */\n --c: var(--brand-color-neutral-emphasisPlus); /* bg color */\n\n position: absolute;\n padding: 0.5em 0.75em;\n width: max-content;\n margin: auto;\n clip: auto;\n white-space: normal;\n font: normal normal var(--brand-text-size-100) / var(--brand-text-lineHeight-100) var(--brand-fontStack-sansSerif);\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--brand-Tooltip-color-default);\n text-align: center;\n word-wrap: break-word;\n background: var(--c);\n border-radius: var(--r);\n border: 0;\n opacity: 0;\n max-width: 250px;\n inset: auto;\n /* for scrollbar */\n overflow: visible;\n}\n\n.Tooltip[popover]:popover-open, /* selector in chrome is :popover-open */\n.Tooltip[popover].\\:popover-open {\n /* selector in firefox and safari is \\:popover-open */\n display: block;\n animation-name: tooltip-appear;\n animation-duration: var(--brand-animation-duration-faster, 0.2s);\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: 0s;\n}\n\n/* This is needed to keep the tooltip open when the user leaves the trigger element to hover tooltip */\n.Tooltip::after {\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: var(--offset);\n content: '';\n}\n\n/* Directional styles */\n.Tooltip[data-direction='n'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0 / var(--r) calc(100% - var(--p) - var(--b) / 2) 0\n calc(var(--p) - var(--b) / 2) / 0 0 var(--h) 0;\n clip-path: polygon(\n 0 100%,\n 0 0,\n 100% 0,\n 100% 100%,\n min(100%, var(--p) + var(--b) / 2) 100%,\n var(--p) calc(100% + var(--h)),\n max(0%, var(--p) - var(--b) / 2) 100%\n );\n}\n\n.Tooltip[data-direction='s'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0/ 0 calc(100% - var(--p) - var(--b) / 2) var(--r) calc(\n var(--p) - var(--b) / 2\n ) / var(--h) 0 0 0;\n clip-path: polygon(\n 0 0,\n 0 100%,\n 100% 100%,\n 100% 0,\n min(100%, var(--p) + var(--b) / 2) 0,\n var(--p) calc(-1 * var(--h)),\n max(0%, var(--p) - var(--b) / 2) 0\n );\n}\n\n.Tooltip[data-direction='w'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0 / calc(var(--p) - var(--b) / 2) 0\n calc(100% - var(--p) - var(--b) / 2) var(--r) / 0 var(--h) 0 0;\n clip-path: polygon(\n 100% 100%,\n 0 100%,\n 0 0,\n 100% 0,\n 100% max(0%, var(--p) - var(--b) / 2),\n calc(100% + var(--h)) var(--p),\n 100% min(100%, var(--p) + var(--b) / 2)\n );\n}\n\n.Tooltip[data-direction='e'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0 / calc(var(--p) - var(--b) / 2) var(--r)\n calc(100% - var(--p) - var(--b) / 2) 0/ 0 0 0 var(--h);\n clip-path: polygon(\n 0 100%,\n 100% 100%,\n 100% 0,\n 0 0,\n 0 max(0%, var(--p) - var(--b) / 2),\n calc(-1 * var(--h)) var(--p),\n 0 min(100%, var(--p) + var(--b) / 2)\n );\n}\n\n.Tooltip[data-direction='n']::after {\n top: 100%;\n}\n\n.Tooltip[data-direction='s']::after {\n bottom: 100%;\n}\n\n.Tooltip[data-direction='w']::after {\n position: absolute;\n display: block;\n height: 100%;\n width: var(--offset);\n content: '';\n bottom: 0;\n left: 100%;\n}\n\n.Tooltip[data-direction='e']::after {\n position: absolute;\n display: block;\n height: 100%;\n width: var(--offset);\n content: '';\n bottom: 0;\n right: 100%;\n margin-left: calc(var(--offset) * -1px);\n}\n\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n .Tooltip,\n .Tooltip::before,\n .Tooltip::after,\n .Tooltip * {\n animation-duration: 0s !important;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Tooltip.module.js","names":[],"sources":["../../src/Tooltip/Tooltip.module.css"],"sourcesContent":[".Tooltip {\n display: none;\n}\n\n@media (forced-colors: active) {\n .Tooltip {\n outline: var(--brand-borderWidth-thin) solid transparent;\n }\n}\n\n/* Overriding the default popover styles */\n.Tooltip[popover] {\n --offset: var(\n --base-size-8,\n --base-size-8\n ); /* This is a \"magic number\". Just gives some room to make sure the tooltip stay open when mouse leaves the trigger to hover tooltip */\n /* these vars are for the triangle, via https://www.smashingmagazine.com/2024/03/modern-css-tooltips-speech-bubbles-part1/ */\n --b: 1em; /* triangle base width */\n --h: 0.5em; /* triangle height */\n --p: 50%; /* center triangle position (0%:left 100%:right) */\n --r: var(--brand-borderRadius-medium); /* border radius */\n --c: var(--brand-color-neutral-emphasisPlus); /* bg color */\n\n position: absolute;\n padding: 0.5em 0.75em;\n width: max-content;\n margin: auto;\n clip: auto;\n white-space: normal;\n font: normal normal var(--brand-text-size-100) / var(--brand-text-lineHeight-100) var(--brand-fontStack-sansSerif);\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--brand-Tooltip-color-default);\n text-align: center;\n word-wrap: break-word;\n background: var(--c);\n border-radius: var(--r);\n border: 0;\n opacity: 0;\n max-width: 250px;\n inset: auto;\n /* for scrollbar */\n overflow: visible;\n}\n\n.Tooltip[popover]:popover-open, /* selector in chrome is :popover-open */\n.Tooltip[popover].\\:popover-open {\n /* selector in firefox and safari is \\:popover-open */\n display: block;\n animation-name: tooltip-appear;\n animation-duration: var(--brand-animation-duration-faster, 0.2s);\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: 0s;\n}\n\n/* This is needed to keep the tooltip open when the user leaves the trigger element to hover tooltip */\n.Tooltip::after {\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: var(--offset);\n content: '';\n}\n\n/* Directional styles */\n.Tooltip[data-direction='n'],\n.Tooltip[data-direction='ne'],\n.Tooltip[data-direction='nw'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0 / var(--r) calc(100% - var(--p) - var(--b) / 2) 0\n calc(var(--p) - var(--b) / 2) / 0 0 var(--h) 0;\n clip-path: polygon(\n 0 100%,\n 0 0,\n 100% 0,\n 100% 100%,\n min(100%, var(--p) + var(--b) / 2) 100%,\n var(--p) calc(100% + var(--h)),\n max(0%, var(--p) - var(--b) / 2) 100%\n );\n}\n\n.Tooltip[data-direction='s'],\n.Tooltip[data-direction='se'],\n.Tooltip[data-direction='sw'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0/ 0 calc(100% - var(--p) - var(--b) / 2) var(--r) calc(\n var(--p) - var(--b) / 2\n ) / var(--h) 0 0 0;\n clip-path: polygon(\n 0 0,\n 0 100%,\n 100% 100%,\n 100% 0,\n min(100%, var(--p) + var(--b) / 2) 0,\n var(--p) calc(-1 * var(--h)),\n max(0%, var(--p) - var(--b) / 2) 0\n );\n}\n\n.Tooltip[data-direction='w'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0 / calc(var(--p) - var(--b) / 2) 0\n calc(100% - var(--p) - var(--b) / 2) var(--r) / 0 var(--h) 0 0;\n clip-path: polygon(\n 100% 100%,\n 0 100%,\n 0 0,\n 100% 0,\n 100% max(0%, var(--p) - var(--b) / 2),\n calc(100% + var(--h)) var(--p),\n 100% min(100%, var(--p) + var(--b) / 2)\n );\n}\n\n.Tooltip[data-direction='e'] {\n border-image: conic-gradient(var(--c) 0 0) fill 0 / calc(var(--p) - var(--b) / 2) var(--r)\n calc(100% - var(--p) - var(--b) / 2) 0/ 0 0 0 var(--h);\n clip-path: polygon(\n 0 100%,\n 100% 100%,\n 100% 0,\n 0 0,\n 0 max(0%, var(--p) - var(--b) / 2),\n calc(-1 * var(--h)) var(--p),\n 0 min(100%, var(--p) + var(--b) / 2)\n );\n}\n\n.Tooltip[data-direction='ne'],\n.Tooltip[data-direction='se'] {\n --p: 25%;\n}\n\n.Tooltip[data-direction='nw'],\n.Tooltip[data-direction='sw'] {\n --p: 75%;\n}\n\n.Tooltip[data-direction='n']::after,\n.Tooltip[data-direction='ne']::after,\n.Tooltip[data-direction='nw']::after {\n top: 100%;\n}\n\n.Tooltip[data-direction='s']::after,\n.Tooltip[data-direction='se']::after,\n.Tooltip[data-direction='sw']::after {\n bottom: 100%;\n}\n\n.Tooltip[data-direction='w']::after {\n position: absolute;\n display: block;\n height: 100%;\n width: var(--offset);\n content: '';\n bottom: 0;\n left: 100%;\n}\n\n.Tooltip[data-direction='e']::after {\n position: absolute;\n display: block;\n height: 100%;\n width: var(--offset);\n content: '';\n bottom: 0;\n right: 100%;\n margin-left: calc(var(--offset) * -1px);\n}\n\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n .Tooltip,\n .Tooltip::before,\n .Tooltip::after,\n .Tooltip * {\n animation-duration: 0s !important;\n }\n}\n"],"mappings":""}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BaseProps } from '../../component-helpers';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FormValidationStatus } from '../form-types';
|
|
4
4
|
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css';
|
|
5
5
|
import type { Icon } from '@primer/octicons-react';
|
|
6
6
|
type VisualType = React.ReactElement | React.ReactNode | Icon;
|
|
7
|
+
export declare const TextInputSizes: readonly ["small", "medium", "large"];
|
|
8
|
+
export type TextInputSize = (typeof TextInputSizes)[number];
|
|
7
9
|
export type TextInputProps = {
|
|
8
10
|
/**
|
|
9
11
|
* Applies full width styling.
|
|
@@ -28,7 +30,7 @@ export type TextInputProps = {
|
|
|
28
30
|
/**
|
|
29
31
|
* Applies alternative sizing to the input
|
|
30
32
|
*/
|
|
31
|
-
size?:
|
|
33
|
+
size?: TextInputSize;
|
|
32
34
|
/**
|
|
33
35
|
* Applies non-interactive text to end of input.
|
|
34
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../src/forms/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../src/forms/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAA;AAGvD,OAAO,2GAA2G,CAAA;AAElH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAA;AAEhD,KAAK,UAAU,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;AAE7D,eAAO,MAAM,cAAc,uCAAwC,CAAA;AACnE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3D,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAAA;IAC/G;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,GACpE,SAAS,CAAC,gBAAgB,CAAC,CAAA;AAkK7B,eAAO,MAAM,SAAS,6FAAgC,CAAA"}
|
|
@@ -5,7 +5,12 @@ import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/com
|
|
|
5
5
|
import r from "./TextInput.module.js";
|
|
6
6
|
import i, { forwardRef as a, useMemo as o } from "react";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
//#region src/forms/TextInput/TextInput.tsx
|
|
9
|
+
var l = [
|
|
10
|
+
"small",
|
|
11
|
+
"medium",
|
|
12
|
+
"large"
|
|
13
|
+
], u = a(({ className: a, disabled: l, fullWidth: u = !1, invisible: d = !1, leadingText: f, leadingVisual: p, monospace: m, placeholder: h, size: g = "medium", trailingText: _, trailingVisual: v, validationStatus: y, ...b }, x) => {
|
|
9
14
|
let S = t(), C = f && !p, w = p && !f, T = _ && !v, E = v && !_, D = `${S}-leading-text`, O = `${S}-leading-visual`, k = `${S}-trailing-visual`, A = `${S}-trailing-text`, j = o(() => [
|
|
10
15
|
{
|
|
11
16
|
condition: C,
|
|
@@ -87,8 +92,8 @@ var l = a(({ className: a, disabled: l, fullWidth: u = !1, invisible: d = !1, le
|
|
|
87
92
|
]
|
|
88
93
|
});
|
|
89
94
|
});
|
|
90
|
-
|
|
95
|
+
u.displayName = "TextInput";
|
|
91
96
|
//#endregion
|
|
92
|
-
export {
|
|
97
|
+
export { u as TextInput, l as TextInputSizes };
|
|
93
98
|
|
|
94
99
|
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","names":[],"sources":["../../../src/forms/TextInput/TextInput.tsx"],"sourcesContent":["import React, {forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {
|
|
1
|
+
{"version":3,"file":"TextInput.js","names":[],"sources":["../../../src/forms/TextInput/TextInput.tsx"],"sourcesContent":["import React, {forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormValidationStatus} from '../form-types'\nimport {Text} from '../../Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './TextInput.module.css'\nimport type {Icon} from '@primer/octicons-react'\n\ntype VisualType = React.ReactElement | React.ReactNode | Icon\n\nexport const TextInputSizes = ['small', 'medium', 'large'] as const\nexport type TextInputSize = (typeof TextInputSizes)[number]\n\nexport type TextInputProps = {\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * Removes border\n */\n invisible?: boolean\n /**\n * Applies non-interactive text to start of input.\n */\n leadingText?: string\n /**\n * Applies non-interactive iconography to start of input.\n */\n leadingVisual?: VisualType\n /**\n * Applies monospace styling.\n */\n monospace?: boolean\n /**\n * Applies alternative sizing to the input\n */\n size?: TextInputSize\n /**\n * Applies non-interactive text to end of input.\n */\n trailingText?: string\n /**\n * Applies non-interactive iconography to end of input.\n */\n trailingVisual?: VisualType\n /**\n * Constrains the input type to single line inputs.\n */\n type?: 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local'\n /**\n * Applies a required attribute to the input\n */\n required?: boolean\n /**\n *\n */\n validationStatus?: FormValidationStatus\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> &\n BaseProps<HTMLInputElement>\n\nconst TextInputInternal = (\n {\n className,\n disabled,\n fullWidth = false,\n invisible = false,\n leadingText,\n leadingVisual: LeadingVisual,\n monospace,\n placeholder,\n size = 'medium',\n trailingText,\n trailingVisual: TrailingVisual,\n validationStatus,\n ...rest\n }: TextInputProps,\n ref,\n) => {\n const uniqueId = useId()\n\n const showLeadingText = leadingText && !LeadingVisual\n const showLeadingVisual = LeadingVisual && !leadingText\n const showTrailingText = trailingText && !TrailingVisual\n const showTrailingVisual = TrailingVisual && !trailingText\n\n const leadingTextId = `${uniqueId}-leading-text`\n const leadingVisualId = `${uniqueId}-leading-visual`\n const trailingVisualId = `${uniqueId}-trailing-visual`\n const trailingTextId = `${uniqueId}-trailing-text`\n\n const describedBy = useMemo(() => {\n const elements = [\n {condition: showLeadingText, id: leadingTextId},\n {condition: showLeadingVisual, id: leadingVisualId},\n {condition: showTrailingVisual, id: trailingVisualId},\n {condition: showTrailingText, id: trailingTextId},\n ]\n\n return elements\n .filter(({condition}) => condition)\n .map(({id}) => id)\n .join(' ')\n }, [\n showLeadingText,\n showLeadingVisual,\n showTrailingVisual,\n showTrailingText,\n leadingTextId,\n leadingVisualId,\n trailingVisualId,\n trailingTextId,\n ])\n\n return (\n <span\n className={clsx(\n styles['TextInput-wrapper'],\n styles[`TextInput-wrapper--${size}`],\n fullWidth && styles['TextInput-wrapper--fullWidth'],\n invisible && styles['TextInput-wrapper--invisible'],\n disabled && styles['TextInput-wrapper--disabled'],\n monospace && styles['TextInput-wrapper--monospace'],\n validationStatus && styles[`TextInput-wrapper--${validationStatus}`],\n )}\n >\n {showLeadingText && (\n <span\n className={clsx(\n styles['TextInput-leading-text'],\n styles[`TextInput-leading-text--${size}`],\n disabled && styles['TextInput-leading-text--disabled'],\n validationStatus && styles[`TextInput-leading-text--${validationStatus}`],\n )}\n >\n <Text\n size={size === 'large' ? '200' : '100'}\n as=\"span\"\n className={clsx(styles['TextInput-leading-text-inner'], styles[`TextInput-leading-text-inner--${size}`])}\n id={leadingTextId}\n >\n {leadingText}\n </Text>\n </span>\n )}\n {showLeadingVisual && (\n <span className={clsx(styles['TextInput-leading-visual'], styles[`TextInput-leading-visual--${size}`])}>\n {LeadingVisual &&\n React.isValidElement<{className?: string; width?: number; height?: number; id?: string}>(LeadingVisual)\n ? React.cloneElement(LeadingVisual, {\n className: clsx(\n styles['TextInput-leading-visual-icon'],\n styles[`TextInput-leading-visual-icon--${size}`],\n ),\n width: size === 'large' ? 20 : 16,\n height: size === 'large' ? 20 : 16,\n id: leadingVisualId,\n })\n : null}\n </span>\n )}\n <input\n type=\"text\"\n ref={ref}\n className={clsx(\n styles.TextInput,\n 'TextInput',\n styles[`TextInput--${size}`],\n fullWidth && styles['TextInput--fullWidth'],\n LeadingVisual && styles[`TextInput--has-leading-visual--${size}`],\n TrailingVisual && styles[`TextInput--has-trailing-visual--${size}`],\n validationStatus && styles[`TextInput--${validationStatus}`],\n leadingText && !LeadingVisual && styles['TextInput--has-leading-text'],\n trailingText && !TrailingVisual && styles['TextInput--has-trailing-text'],\n className,\n )}\n placeholder={placeholder}\n disabled={disabled}\n aria-invalid={validationStatus === 'error'}\n aria-describedby={describedBy || undefined}\n {...rest}\n />\n {showTrailingVisual && (\n <span className={clsx(styles['TextInput-trailing-visual'], styles[`TextInput-trailing-visual--${size}`])}>\n {TrailingVisual &&\n React.isValidElement<{className?: string; width?: number; height?: number; id?: string}>(TrailingVisual)\n ? React.cloneElement(TrailingVisual, {\n className: clsx(\n styles['TextInput-trailing-visual-icon'],\n styles[`TextInput-trailing-visual-icon--${size}`],\n ),\n width: size === 'large' ? 20 : 16,\n height: size === 'large' ? 20 : 16,\n id: trailingVisualId,\n })\n : null}\n </span>\n )}\n {showTrailingText && (\n <span\n className={clsx(\n styles['TextInput-trailing-text'],\n styles[`TextInput-trailing-text--${size}`],\n disabled && styles['TextInput-trailing-text--disabled'],\n validationStatus && styles[`TextInput-trailing-text--${validationStatus}`],\n )}\n >\n <Text\n size={size === 'large' ? '200' : '100'}\n as=\"span\"\n className={clsx(styles['TextInput-trailing-text-inner'], styles[`TextInput-trailing-text-inner--${size}`])}\n id={trailingTextId}\n >\n {trailingText}\n </Text>\n </span>\n )}\n </span>\n )\n}\n\nexport const TextInput = forwardRef(TextInputInternal)\n\nTextInput.displayName = 'TextInput'\n"],"mappings":";;;;;;;;AAcA,IAAa,IAAiB;CAAC;CAAS;CAAU;AAAO,GAmN5C,IAAY,GA/JvB,EACE,cACA,aACA,eAAY,IACZ,eAAY,IACZ,gBACA,eAAe,GACf,cACA,gBACA,UAAO,UACP,iBACA,gBAAgB,GAChB,qBACA,GAAG,KAEL,MACG;CACH,IAAM,IAAW,EAAM,GAEjB,IAAkB,KAAe,CAAC,GAClC,IAAoB,KAAiB,CAAC,GACtC,IAAmB,KAAgB,CAAC,GACpC,IAAqB,KAAkB,CAAC,GAExC,IAAgB,GAAG,EAAS,gBAC5B,IAAkB,GAAG,EAAS,kBAC9B,IAAmB,GAAG,EAAS,mBAC/B,IAAiB,GAAG,EAAS,iBAE7B,IAAc,QAQX;EANL;GAAC,WAAW;GAAiB,IAAI;EAAa;EAC9C;GAAC,WAAW;GAAmB,IAAI;EAAe;EAClD;GAAC,WAAW;GAAoB,IAAI;EAAgB;EACpD;GAAC,WAAW;GAAkB,IAAI;EAAc;CAG3C,CAAA,CACJ,QAAQ,EAAC,mBAAe,CAAS,CAAC,CAClC,KAAK,EAAC,YAAQ,CAAE,CAAC,CACjB,KAAK,GAAG,GACV;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OAC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AAmC,IAC5C;KACA,OAAO,MAAS,UAAU,KAAK;KAC/B,QAAQ,MAAS,UAAU,KAAK;KAChC,IAAI;IACN,CAAC,IACD;GACA,CAAA;GAEP,KACC,kBAAC,QAAD;IACE,WAAW,EACT,EAAO,4BACP,EAAO,4BAA4B,MACnC,KAAY,EAAO,sCACnB,KAAoB,EAAO,4BAA4B,IACzD;cAEA,kBAAC,GAAD;KACE,MAAM,MAAS,UAAU,QAAQ;KACjC,IAAG;KACH,WAAW,EAAK,EAAO,kCAAkC,EAAO,kCAAkC,IAAO;KACzG,IAAI;eAEH;IACG,CAAA;GACF,CAAA;EAEJ;;AAEV,CAEqD;AAErD,EAAU,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Primer_Brand__TextInput-module__TextInput___d6r3B{color:var(--brand-control-color-fg-default);background-color:var(--brand-color-canvas-default);border-radius:var(--brand-borderRadius-medium);line-height:var(--brand-text-lineHeight-100);transition:var(--brand-control-animation-duration) var(--brand-control-animation-easing);border:none;transition-property:color,background-color,box-shadow;display:flex}.Primer_Brand__TextInput-module__TextInput___d6r3B::placeholder{color:var(--brand-color-text-muted);opacity:1}.Primer_Brand__TextInput-module__TextInput___d6r3B[disabled]{-webkit-text-fill-color:var(--brand-control-color-fg-disabled);color:var(--brand-control-color-fg-disabled);cursor:not-allowed;background-color:var(--brand-control-color-canvas-disabled);opacity:1}.Primer_Brand__TextInput-module__TextInput___d6r3B:focus{outline:none}.Primer_Brand__TextInput-module__TextInput-wrapper--small___stgw8{height:var(--brand-control-small-size)}.Primer_Brand__TextInput-module__TextInput--small___kSAfx{font-weight:var(--brand-text-weight-100);font-size:var(--brand-text-size-100);padding:var(--brand-control-small-paddingBlock) var(--brand-control-small-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-wrapper--medium___MBN0V{height:var(--brand-control-medium-size)}.Primer_Brand__TextInput-module__TextInput--medium___fpyd0{font-weight:var(--brand-text-weight-100);font-size:var(--brand-text-size-100);padding:var(--brand-control-medium-paddingBlock-normal) var(--brand-control-medium-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput--large___S8mM0{font-weight:var(--brand-text-weight-200);font-size:var(--brand-text-size-200);padding:var(--brand-control-large-paddingBlock-normal) var(--brand-control-large-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-wrapper--large___dAIbF{height:var(--brand-control-large-size)}.Primer_Brand__TextInput-module__TextInput--fullWidth___95umM{width:100%}.Primer_Brand__TextInput-module__TextInput-wrapper--disabled___tIAWj{border-color:var(--brand-control-color-border-disabled)}.Primer_Brand__TextInput-module__TextInput-wrapper___atqQQ{font-family:var(--brand-body-fontFamily);border:solid 1px var(--brand-control-color-border-default);border:solid var(--brand-borderWidth-thin,1px) var(--brand-control-color-border-default);border-radius:var(--brand-borderRadius-medium);transition:var(--brand-control-animation-duration) var(--brand-control-animation-easing);transition-property:border;display:inline-flex;position:relative}.Primer_Brand__TextInput-module__TextInput-wrapper--invisible___5R_bN{border-color:#0000}.Primer_Brand__TextInput-module__TextInput-wrapper--fullWidth___qZXkv{width:100%;display:flex}.Primer_Brand__TextInput-module__TextInput-wrapper___atqQQ:not(.Primer_Brand__TextInput-module__TextInput-wrapper--fullWidth___qZXkv){width:min-content}.Primer_Brand__TextInput-module__TextInput-wrapper--monospace___lZCyL{font-family:var(--brand-fontStack-monospace)}.Primer_Brand__TextInput-module__TextInput-wrapper___atqQQ:focus-within{border-color:var(--brand-control-color-focus);box-shadow:0 0 0 1px var(--brand-control-color-focus);outline:none}@media (forced-colors:active){.Primer_Brand__TextInput-module__TextInput-wrapper___atqQQ:focus-within{outline:var(--brand-borderWidth-thick) solid Highlight;outline-offset:var(--base-size-2)}}.Primer_Brand__TextInput-module__TextInput-wrapper--success___T0cdn,.Primer_Brand__TextInput-module__TextInput-wrapper--success___T0cdn.Primer_Brand__TextInput-module__TextInput-wrapper--disabled___tIAWj{border-color:var(--brand-color-success-fg)}.Primer_Brand__TextInput-module__TextInput-wrapper--error___P_A__,.Primer_Brand__TextInput-module__TextInput-wrapper--error___P_A__.Primer_Brand__TextInput-module__TextInput-wrapper--disabled___tIAWj{border-color:var(--brand-color-danger-fg)}.Primer_Brand__TextInput-module__TextInput--has-leading-visual--small___LJ4kp{padding-inline-start:calc(var(--brand-control-small-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-small-gap))}.Primer_Brand__TextInput-module__TextInput--has-leading-visual--medium___FofyW{padding-inline-start:calc(var(--brand-control-medium-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-medium-gap))}.Primer_Brand__TextInput-module__TextInput--has-leading-visual--large___m_yq4{padding-inline-start:calc(var(--brand-control-large-paddingInline-condensed) + var(--base-size-20) + var(--brand-control-large-gap))}.Primer_Brand__TextInput-module__TextInput--has-trailing-visual--small___2RNSF{padding-inline-end:calc(var(--brand-control-small-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-small-gap))}.Primer_Brand__TextInput-module__TextInput--has-trailing-visual--medium___i_tux{padding-inline-end:calc(var(--brand-control-medium-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-medium-gap))}.Primer_Brand__TextInput-module__TextInput--has-trailing-visual--large___9LFb4{padding-inline-end:calc(var(--brand-control-medium-paddingInline-condensed) + var(--base-size-20) + var(--brand-control-medium-gap))}.Primer_Brand__TextInput-module__TextInput-leading-visual___pCl6H,.Primer_Brand__TextInput-module__TextInput-trailing-visual___uMm5J{width:var(--base-size-16);height:100%;color:var(--brand-color-text-default);pointer-events:none;align-items:center;display:flex;position:absolute;top:0}.Primer_Brand__TextInput-module__TextInput-leading-visual--medium___J1m0x{left:var(--brand-control-medium-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-trailing-visual--medium___42l_Q{right:var(--brand-control-medium-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-leading-visual--small___fER_a{left:var(--brand-control-small-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-trailing-visual--small___iP2u4{right:var(--brand-control-small-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-leading-visual--large___FfFfu{left:var(--brand-control-large-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-trailing-visual--large___6qKcW{right:var(--brand-control-large-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-leading-visual-icon--medium___SGqdF,.Primer_Brand__TextInput-module__TextInput-leading-visual-icon--small___AKlUK{width:var(--base-size-16);height:var(--base-size-16)}.Primer_Brand__TextInput-module__TextInput-leading-visual-icon--large___tEaFR{width:var(--base-size-20);height:var(--base-size-20)}.Primer_Brand__TextInput-module__TextInput-leading-text___KJH7i,.Primer_Brand__TextInput-module__TextInput-trailing-text___9OMo1{color:var(--brand-color-text-muted);pointer-events:none;white-space:nowrap;align-items:center;display:flex}.Primer_Brand__TextInput-module__TextInput-leading-text--disabled___mkec2,.Primer_Brand__TextInput-module__TextInput-trailing-text--disabled___HXuFW{color:var(--brand-control-color-fg-disabled);background-color:var(--brand-control-color-canvas-disabled)}.Primer_Brand__TextInput-module__TextInput-leading-text___KJH7i{border-top-left-radius:6px;border-top-left-radius:var(--brand-borderRadius-medium,6px);border-bottom-left-radius:6px;border-bottom-left-radius:var(--brand-borderRadius-medium,6px);border-right:0}.Primer_Brand__TextInput-module__TextInput-trailing-text___9OMo1{border-top-right-radius:6px;border-top-right-radius:var(--brand-borderRadius-medium,6px);border-bottom-right-radius:6px;border-bottom-right-radius:var(--brand-borderRadius-medium,6px);border-left:0}.Primer_Brand__TextInput-module__TextInput-leading-text-inner___xYm04,.Primer_Brand__TextInput-module__TextInput-trailing-text-inner___dLGj9{color:var(--brand-color-text-muted);display:inline-flex}.Primer_Brand__TextInput-module__TextInput-leading-text-inner--medium___yh500,.Primer_Brand__TextInput-module__TextInput-trailing-text-inner--medium___H8Wax{padding-inline:var(--brand-control-medium-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-leading-text-inner--small___dPVPe,.Primer_Brand__TextInput-module__TextInput-trailing-text-inner--small___3Vxff{padding-inline:var(--brand-control-small-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-leading-text-inner--large___LLej6,.Primer_Brand__TextInput-module__TextInput-trailing-text-inner--large___1Qudx{padding-inline:var(--brand-control-large-paddingInline-condensed)}.Primer_Brand__TextInput-module__TextInput-leading-text-inner___xYm04{border-right:1px solid var(--brand-color-border-default)}.Primer_Brand__TextInput-module__TextInput-trailing-text-inner___dLGj9{border-left:1px solid var(--brand-color-border-default)}.Primer_Brand__TextInput-module__TextInput--has-leading-text___yXCjP{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.Primer_Brand__TextInput-module__TextInput--has-trailing-text___bPsRQ{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.Primer_Brand__TextInput-module__TextInput-leading-text--success____KS_D,.Primer_Brand__TextInput-module__TextInput-trailing-text--success___WCi_J{border-color:var(--brand-color-success-fg)}.Primer_Brand__TextInput-module__TextInput-leading-text--error___WAcZB,.Primer_Brand__TextInput-module__TextInput-trailing-text--error____yUSw{border-color:var(--brand-color-danger-fg)}@media (prefers-reduced-motion:reduce){.Primer_Brand__TextInput-module__TextInput___d6r3B,.Primer_Brand__TextInput-module__Checkbox___NeBpg:before,.Primer_Brand__TextInput-module__Checkbox___NeBpg:after,.Primer_Brand__TextInput-module__Checkbox___NeBpg *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import './TextInput.module-
|
|
1
|
+
import './TextInput.module-CeOwKkHk.css';//#region src/forms/TextInput/TextInput.module.css
|
|
2
2
|
var e = "Primer_Brand__TextInput-module__TextInput___d6r3B", t = "Primer_Brand__TextInput-module__Checkbox___NeBpg", n = {
|
|
3
3
|
TextInput: e,
|
|
4
|
+
"TextInput-wrapper--small": "Primer_Brand__TextInput-module__TextInput-wrapper--small___stgw8",
|
|
5
|
+
"TextInput--small": "Primer_Brand__TextInput-module__TextInput--small___kSAfx",
|
|
4
6
|
"TextInput-wrapper--medium": "Primer_Brand__TextInput-module__TextInput-wrapper--medium___MBN0V",
|
|
5
7
|
"TextInput--medium": "Primer_Brand__TextInput-module__TextInput--medium___fpyd0",
|
|
6
8
|
"TextInput--large": "Primer_Brand__TextInput-module__TextInput--large___S8mM0",
|
|
@@ -13,17 +15,22 @@ var e = "Primer_Brand__TextInput-module__TextInput___d6r3B", t = "Primer_Brand__
|
|
|
13
15
|
"TextInput-wrapper--monospace": "Primer_Brand__TextInput-module__TextInput-wrapper--monospace___lZCyL",
|
|
14
16
|
"TextInput-wrapper--success": "Primer_Brand__TextInput-module__TextInput-wrapper--success___T0cdn",
|
|
15
17
|
"TextInput-wrapper--error": "Primer_Brand__TextInput-module__TextInput-wrapper--error___P_A__",
|
|
18
|
+
"TextInput--has-leading-visual--small": "Primer_Brand__TextInput-module__TextInput--has-leading-visual--small___LJ4kp",
|
|
16
19
|
"TextInput--has-leading-visual--medium": "Primer_Brand__TextInput-module__TextInput--has-leading-visual--medium___FofyW",
|
|
17
20
|
"TextInput--has-leading-visual--large": "Primer_Brand__TextInput-module__TextInput--has-leading-visual--large___m_yq4",
|
|
21
|
+
"TextInput--has-trailing-visual--small": "Primer_Brand__TextInput-module__TextInput--has-trailing-visual--small___2RNSF",
|
|
18
22
|
"TextInput--has-trailing-visual--medium": "Primer_Brand__TextInput-module__TextInput--has-trailing-visual--medium___i_tux",
|
|
19
23
|
"TextInput--has-trailing-visual--large": "Primer_Brand__TextInput-module__TextInput--has-trailing-visual--large___9LFb4",
|
|
20
24
|
"TextInput-leading-visual": "Primer_Brand__TextInput-module__TextInput-leading-visual___pCl6H",
|
|
21
25
|
"TextInput-trailing-visual": "Primer_Brand__TextInput-module__TextInput-trailing-visual___uMm5J",
|
|
22
26
|
"TextInput-leading-visual--medium": "Primer_Brand__TextInput-module__TextInput-leading-visual--medium___J1m0x",
|
|
23
27
|
"TextInput-trailing-visual--medium": "Primer_Brand__TextInput-module__TextInput-trailing-visual--medium___42l_Q",
|
|
28
|
+
"TextInput-leading-visual--small": "Primer_Brand__TextInput-module__TextInput-leading-visual--small___fER_a",
|
|
29
|
+
"TextInput-trailing-visual--small": "Primer_Brand__TextInput-module__TextInput-trailing-visual--small___iP2u4",
|
|
24
30
|
"TextInput-leading-visual--large": "Primer_Brand__TextInput-module__TextInput-leading-visual--large___FfFfu",
|
|
25
31
|
"TextInput-trailing-visual--large": "Primer_Brand__TextInput-module__TextInput-trailing-visual--large___6qKcW",
|
|
26
32
|
"TextInput-leading-visual-icon--medium": "Primer_Brand__TextInput-module__TextInput-leading-visual-icon--medium___SGqdF",
|
|
33
|
+
"TextInput-leading-visual-icon--small": "Primer_Brand__TextInput-module__TextInput-leading-visual-icon--small___AKlUK",
|
|
27
34
|
"TextInput-leading-visual-icon--large": "Primer_Brand__TextInput-module__TextInput-leading-visual-icon--large___tEaFR",
|
|
28
35
|
"TextInput-leading-text": "Primer_Brand__TextInput-module__TextInput-leading-text___KJH7i",
|
|
29
36
|
"TextInput-trailing-text": "Primer_Brand__TextInput-module__TextInput-trailing-text___9OMo1",
|
|
@@ -33,6 +40,8 @@ var e = "Primer_Brand__TextInput-module__TextInput___d6r3B", t = "Primer_Brand__
|
|
|
33
40
|
"TextInput-trailing-text-inner": "Primer_Brand__TextInput-module__TextInput-trailing-text-inner___dLGj9",
|
|
34
41
|
"TextInput-leading-text-inner--medium": "Primer_Brand__TextInput-module__TextInput-leading-text-inner--medium___yh500",
|
|
35
42
|
"TextInput-trailing-text-inner--medium": "Primer_Brand__TextInput-module__TextInput-trailing-text-inner--medium___H8Wax",
|
|
43
|
+
"TextInput-leading-text-inner--small": "Primer_Brand__TextInput-module__TextInput-leading-text-inner--small___dPVPe",
|
|
44
|
+
"TextInput-trailing-text-inner--small": "Primer_Brand__TextInput-module__TextInput-trailing-text-inner--small___3Vxff",
|
|
36
45
|
"TextInput-leading-text-inner--large": "Primer_Brand__TextInput-module__TextInput-leading-text-inner--large___LLej6",
|
|
37
46
|
"TextInput-trailing-text-inner--large": "Primer_Brand__TextInput-module__TextInput-trailing-text-inner--large___1Qudx",
|
|
38
47
|
"TextInput--has-leading-text": "Primer_Brand__TextInput-module__TextInput--has-leading-text___yXCjP",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.module.js","names":[],"sources":["../../../src/forms/TextInput/TextInput.module.css"],"sourcesContent":["/*\n * Default TextInput styles\n */\n.TextInput {\n display: flex;\n color: var(--brand-control-color-fg-default);\n background-color: var(--brand-color-canvas-default);\n border: none;\n border-radius: var(--brand-borderRadius-medium);\n line-height: var(--brand-text-lineHeight-100);\n transition: var(--brand-control-animation-duration) var(--brand-control-animation-easing);\n transition-property: color, background-color, box-shadow;\n}\n\n.TextInput::placeholder {\n color: var(--brand-color-text-muted);\n opacity: 1;\n}\n\n.TextInput[disabled] {\n -webkit-text-fill-color: var(--brand-control-color-fg-disabled);\n color: var(--brand-control-color-fg-disabled);\n cursor: not-allowed;\n background-color: var(--brand-control-color-canvas-disabled);\n opacity: 1;\n}\n\n.TextInput:focus {\n outline: none;\n}\n\n/*\n * Sizes\n */\n\n.TextInput-wrapper--medium {\n height: var(--brand-control-medium-size);\n}\n\n.TextInput--medium {\n font-weight: var(--brand-text-weight-100);\n font-size: var(--brand-text-size-100);\n padding: var(--brand-control-medium-paddingBlock-normal) var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput--large {\n font-weight: var(--brand-text-weight-200);\n font-size: var(--brand-text-size-200);\n padding: var(--brand-control-large-paddingBlock-normal) var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-wrapper--large {\n height: var(--brand-control-large-size);\n}\n\n/*\n * Visual states\n */\n.TextInput--fullWidth {\n width: 100%;\n}\n\n/*\n * TextInput wrapper\n */\n\n.TextInput-wrapper--disabled {\n border-color: var(--brand-control-color-border-disabled);\n}\n\n.TextInput-wrapper {\n font-family: var(--brand-body-fontFamily);\n display: inline-flex;\n position: relative;\n border: solid var(--brand-borderWidth-thin, 1px) var(--brand-control-color-border-default);\n border-radius: var(--brand-borderRadius-medium);\n transition: var(--brand-control-animation-duration) var(--brand-control-animation-easing);\n transition-property: border;\n}\n\n.TextInput-wrapper--invisible {\n border-color: transparent;\n}\n\n.TextInput-wrapper--fullWidth {\n width: 100%;\n display: flex;\n}\n\n.TextInput-wrapper:not(.TextInput-wrapper--fullWidth) {\n width: min-content;\n}\n\n.TextInput-wrapper--monospace {\n font-family: var(--brand-fontStack-monospace);\n}\n\n.TextInput-wrapper:focus-within {\n border-color: var(--brand-control-color-focus);\n box-shadow: 0 0 0 1px var(--brand-control-color-focus);\n outline: none;\n}\n\n@media (forced-colors: active) {\n .TextInput-wrapper:focus-within {\n outline: var(--brand-borderWidth-thick) solid Highlight;\n outline-offset: var(--base-size-2);\n }\n}\n\n/*\n * Validation\n */\n\n.TextInput-wrapper--success,\n.TextInput-wrapper--success.TextInput-wrapper--disabled {\n border-color: var(--brand-color-success-fg);\n}\n\n.TextInput-wrapper--error,\n.TextInput-wrapper--error.TextInput-wrapper--disabled {\n border-color: var(--brand-color-danger-fg);\n}\n\n/*\n * TextInput visuals\n */\n.TextInput--has-leading-visual--medium {\n padding-inline-start: calc(\n var(--brand-control-medium-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-medium-gap)\n );\n}\n\n.TextInput--has-leading-visual--large {\n padding-inline-start: calc(\n var(--brand-control-large-paddingInline-condensed) + var(--base-size-20) + var(--brand-control-large-gap)\n );\n}\n\n.TextInput--has-trailing-visual--medium {\n padding-inline-end: calc(\n var(--brand-control-medium-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-medium-gap)\n );\n}\n\n.TextInput--has-trailing-visual--large {\n padding-inline-end: calc(\n var(--brand-control-medium-paddingInline-condensed) + var(--base-size-20) + var(--brand-control-medium-gap)\n );\n}\n\n.TextInput-leading-visual,\n.TextInput-trailing-visual {\n display: grid;\n position: absolute;\n top: 0;\n display: flex;\n width: var(--base-size-16);\n height: 100%;\n align-items: center;\n color: var(--color-fg-muted);\n pointer-events: none;\n color: var(--brand-color-text-default);\n}\n\n.TextInput-leading-visual--medium {\n left: var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput-trailing-visual--medium {\n right: var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput-leading-visual--large {\n left: var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-trailing-visual--large {\n right: var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-leading-visual-icon--medium {\n width: var(--base-size-16);\n height: var(--base-size-16);\n}\n\n.TextInput-leading-visual-icon--large {\n width: var(--base-size-20);\n height: var(--base-size-20);\n}\n\n/*\n * TextInput leading and trailing text\n */\n\n.TextInput-leading-text,\n.TextInput-trailing-text {\n display: flex;\n align-items: center;\n color: var(--brand-color-text-muted);\n pointer-events: none;\n white-space: nowrap;\n}\n\n.TextInput-leading-text--disabled,\n.TextInput-trailing-text--disabled {\n color: var(--brand-control-color-fg-disabled);\n background-color: var(--brand-control-color-canvas-disabled);\n}\n\n.TextInput-leading-text {\n border-top-left-radius: var(--brand-borderRadius-medium, 6px);\n border-bottom-left-radius: var(--brand-borderRadius-medium, 6px);\n border-right: 0;\n}\n\n.TextInput-trailing-text {\n border-top-right-radius: var(--brand-borderRadius-medium, 6px);\n border-bottom-right-radius: var(--brand-borderRadius-medium, 6px);\n border-left: 0;\n}\n\n.TextInput-leading-text-inner,\n.TextInput-trailing-text-inner {\n display: inline-flex;\n color: var(--brand-color-text-muted);\n}\n\n.TextInput-leading-text-inner--medium,\n.TextInput-trailing-text-inner--medium {\n padding-inline: var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput-leading-text-inner--large,\n.TextInput-trailing-text-inner--large {\n padding-inline: var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-leading-text-inner {\n border-right: 1px solid var(--brand-color-border-default);\n}\n\n.TextInput-trailing-text-inner {\n border-left: 1px solid var(--brand-color-border-default);\n}\n\n.TextInput--has-leading-text {\n border-left: 0;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.TextInput--has-trailing-text {\n border-right: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.TextInput-leading-text--success,\n.TextInput-trailing-text--success {\n border-color: var(--brand-color-success-fg);\n}\n\n.TextInput-leading-text--error,\n.TextInput-trailing-text--error {\n border-color: var(--brand-color-danger-fg);\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n .TextInput,\n .Checkbox::before,\n .Checkbox::after,\n .Checkbox * {\n animation: none !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"TextInput.module.js","names":[],"sources":["../../../src/forms/TextInput/TextInput.module.css"],"sourcesContent":["/*\n * Default TextInput styles\n */\n.TextInput {\n display: flex;\n color: var(--brand-control-color-fg-default);\n background-color: var(--brand-color-canvas-default);\n border: none;\n border-radius: var(--brand-borderRadius-medium);\n line-height: var(--brand-text-lineHeight-100);\n transition: var(--brand-control-animation-duration) var(--brand-control-animation-easing);\n transition-property: color, background-color, box-shadow;\n}\n\n.TextInput::placeholder {\n color: var(--brand-color-text-muted);\n opacity: 1;\n}\n\n.TextInput[disabled] {\n -webkit-text-fill-color: var(--brand-control-color-fg-disabled);\n color: var(--brand-control-color-fg-disabled);\n cursor: not-allowed;\n background-color: var(--brand-control-color-canvas-disabled);\n opacity: 1;\n}\n\n.TextInput:focus {\n outline: none;\n}\n\n/*\n * Sizes\n */\n\n.TextInput-wrapper--small {\n height: var(--brand-control-small-size);\n}\n\n.TextInput--small {\n font-weight: var(--brand-text-weight-100);\n font-size: var(--brand-text-size-100);\n padding: var(--brand-control-small-paddingBlock) var(--brand-control-small-paddingInline-condensed);\n}\n\n.TextInput-wrapper--medium {\n height: var(--brand-control-medium-size);\n}\n\n.TextInput--medium {\n font-weight: var(--brand-text-weight-100);\n font-size: var(--brand-text-size-100);\n padding: var(--brand-control-medium-paddingBlock-normal) var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput--large {\n font-weight: var(--brand-text-weight-200);\n font-size: var(--brand-text-size-200);\n padding: var(--brand-control-large-paddingBlock-normal) var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-wrapper--large {\n height: var(--brand-control-large-size);\n}\n\n/*\n * Visual states\n */\n.TextInput--fullWidth {\n width: 100%;\n}\n\n/*\n * TextInput wrapper\n */\n\n.TextInput-wrapper--disabled {\n border-color: var(--brand-control-color-border-disabled);\n}\n\n.TextInput-wrapper {\n font-family: var(--brand-body-fontFamily);\n display: inline-flex;\n position: relative;\n border: solid var(--brand-borderWidth-thin, 1px) var(--brand-control-color-border-default);\n border-radius: var(--brand-borderRadius-medium);\n transition: var(--brand-control-animation-duration) var(--brand-control-animation-easing);\n transition-property: border;\n}\n\n.TextInput-wrapper--invisible {\n border-color: transparent;\n}\n\n.TextInput-wrapper--fullWidth {\n width: 100%;\n display: flex;\n}\n\n.TextInput-wrapper:not(.TextInput-wrapper--fullWidth) {\n width: min-content;\n}\n\n.TextInput-wrapper--monospace {\n font-family: var(--brand-fontStack-monospace);\n}\n\n.TextInput-wrapper:focus-within {\n border-color: var(--brand-control-color-focus);\n box-shadow: 0 0 0 1px var(--brand-control-color-focus);\n outline: none;\n}\n\n@media (forced-colors: active) {\n .TextInput-wrapper:focus-within {\n outline: var(--brand-borderWidth-thick) solid Highlight;\n outline-offset: var(--base-size-2);\n }\n}\n\n/*\n * Validation\n */\n\n.TextInput-wrapper--success,\n.TextInput-wrapper--success.TextInput-wrapper--disabled {\n border-color: var(--brand-color-success-fg);\n}\n\n.TextInput-wrapper--error,\n.TextInput-wrapper--error.TextInput-wrapper--disabled {\n border-color: var(--brand-color-danger-fg);\n}\n\n/*\n * TextInput visuals\n */\n.TextInput--has-leading-visual--small {\n padding-inline-start: calc(\n var(--brand-control-small-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-small-gap)\n );\n}\n\n.TextInput--has-leading-visual--medium {\n padding-inline-start: calc(\n var(--brand-control-medium-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-medium-gap)\n );\n}\n\n.TextInput--has-leading-visual--large {\n padding-inline-start: calc(\n var(--brand-control-large-paddingInline-condensed) + var(--base-size-20) + var(--brand-control-large-gap)\n );\n}\n\n.TextInput--has-trailing-visual--small {\n padding-inline-end: calc(\n var(--brand-control-small-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-small-gap)\n );\n}\n\n.TextInput--has-trailing-visual--medium {\n padding-inline-end: calc(\n var(--brand-control-medium-paddingInline-condensed) + var(--base-size-16) + var(--brand-control-medium-gap)\n );\n}\n\n.TextInput--has-trailing-visual--large {\n padding-inline-end: calc(\n var(--brand-control-medium-paddingInline-condensed) + var(--base-size-20) + var(--brand-control-medium-gap)\n );\n}\n\n.TextInput-leading-visual,\n.TextInput-trailing-visual {\n display: grid;\n position: absolute;\n top: 0;\n display: flex;\n width: var(--base-size-16);\n height: 100%;\n align-items: center;\n color: var(--color-fg-muted);\n pointer-events: none;\n color: var(--brand-color-text-default);\n}\n\n.TextInput-leading-visual--medium {\n left: var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput-trailing-visual--medium {\n right: var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput-leading-visual--small {\n left: var(--brand-control-small-paddingInline-condensed);\n}\n\n.TextInput-trailing-visual--small {\n right: var(--brand-control-small-paddingInline-condensed);\n}\n\n.TextInput-leading-visual--large {\n left: var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-trailing-visual--large {\n right: var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-leading-visual-icon--medium {\n width: var(--base-size-16);\n height: var(--base-size-16);\n}\n\n.TextInput-leading-visual-icon--small {\n width: var(--base-size-16);\n height: var(--base-size-16);\n}\n\n.TextInput-leading-visual-icon--large {\n width: var(--base-size-20);\n height: var(--base-size-20);\n}\n\n/*\n * TextInput leading and trailing text\n */\n\n.TextInput-leading-text,\n.TextInput-trailing-text {\n display: flex;\n align-items: center;\n color: var(--brand-color-text-muted);\n pointer-events: none;\n white-space: nowrap;\n}\n\n.TextInput-leading-text--disabled,\n.TextInput-trailing-text--disabled {\n color: var(--brand-control-color-fg-disabled);\n background-color: var(--brand-control-color-canvas-disabled);\n}\n\n.TextInput-leading-text {\n border-top-left-radius: var(--brand-borderRadius-medium, 6px);\n border-bottom-left-radius: var(--brand-borderRadius-medium, 6px);\n border-right: 0;\n}\n\n.TextInput-trailing-text {\n border-top-right-radius: var(--brand-borderRadius-medium, 6px);\n border-bottom-right-radius: var(--brand-borderRadius-medium, 6px);\n border-left: 0;\n}\n\n.TextInput-leading-text-inner,\n.TextInput-trailing-text-inner {\n display: inline-flex;\n color: var(--brand-color-text-muted);\n}\n\n.TextInput-leading-text-inner--medium,\n.TextInput-trailing-text-inner--medium {\n padding-inline: var(--brand-control-medium-paddingInline-condensed);\n}\n\n.TextInput-leading-text-inner--small,\n.TextInput-trailing-text-inner--small {\n padding-inline: var(--brand-control-small-paddingInline-condensed);\n}\n\n.TextInput-leading-text-inner--large,\n.TextInput-trailing-text-inner--large {\n padding-inline: var(--brand-control-large-paddingInline-condensed);\n}\n\n.TextInput-leading-text-inner {\n border-right: 1px solid var(--brand-color-border-default);\n}\n\n.TextInput-trailing-text-inner {\n border-left: 1px solid var(--brand-color-border-default);\n}\n\n.TextInput--has-leading-text {\n border-left: 0;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.TextInput--has-trailing-text {\n border-right: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.TextInput-leading-text--success,\n.TextInput-trailing-text--success {\n border-color: var(--brand-color-success-fg);\n}\n\n.TextInput-leading-text--error,\n.TextInput-trailing-text--error {\n border-color: var(--brand-color-danger-fg);\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n .TextInput,\n .Checkbox::before,\n .Checkbox::after,\n .Checkbox * {\n animation: none !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n}\n"],"mappings":""}
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