@primer/react-brand 0.79.1-rc.ed00156c → 0.80.0-rc.4bfa3a79
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/LogoSuite/react.md +215 -13
- package/docs/components/Spinner/index.md +56 -0
- package/docs/components/index.md +1 -0
- package/docs/forms/FormControl/index.md +5 -0
- package/docs/forms/ToggleSwitch/index.md +129 -0
- package/docs/forms/index.md +1 -0
- package/docs/index.md +4 -2
- package/docs/introduction/theming.md +13 -0
- package/esm/Accordion/Accordion.js +1 -1
- package/esm/Accordion/{Accordion.module-B-iFuyHy.css → Accordion.module-B-vGHUg7.css} +1 -1
- package/esm/Accordion/Accordion.module.js +1 -1
- package/esm/Accordion/Accordion.module.js.map +1 -1
- package/esm/ActionMenu/ActionMenu.js +3 -3
- package/esm/ActionMenu/ActionMenu.js.map +1 -1
- package/esm/AnchorNav/AnchorNav.js +1 -1
- package/esm/Breadcrumbs/Breadcrumbs.js +1 -1
- package/esm/Button/Button.js +1 -1
- package/esm/CTABanner/CTABanner.js +1 -1
- package/esm/Card/Card.js +1 -1
- package/esm/ComparisonTable/ComparisonTable.js +1 -1
- package/esm/EyebrowBanner/EyebrowBanner.js +1 -1
- package/esm/FAQ/FAQ.js +1 -1
- package/esm/FAQ/FAQGroup.js +1 -1
- package/esm/FeatureComparisonTable/FeatureComparisonTable.js +1 -1
- package/esm/FeatureComparisonTable/FeatureComparisonTable.module-BH8n2Ttj.css +1 -0
- package/esm/FeatureComparisonTable/FeatureComparisonTable.module.js +1 -2
- package/esm/FeatureComparisonTable/FeatureComparisonTable.module.js.map +1 -1
- package/esm/FeatureComparisonTable/sub-components/FeatureComparisonTableRow.d.ts.map +1 -1
- package/esm/FeatureComparisonTable/sub-components/FeatureComparisonTableRow.js +1 -1
- package/esm/FeatureComparisonTable/sub-components/FeatureComparisonTableRow.js.map +1 -1
- package/esm/FrostedGlassVFX/FrostedGlassVFX.js +1 -1
- package/esm/Grid/Grid.js +1 -1
- package/esm/Heading/Heading.module-ChqO_lH5.css +1 -0
- package/esm/Heading/Heading.module.js +1 -1
- package/esm/Heading/Heading.module.js.map +1 -1
- package/esm/IDE/IDE.js +1 -1
- package/esm/Icon/Icon.js +1 -1
- package/esm/IconButton/IconButton.d.ts.map +1 -1
- package/esm/IconButton/IconButton.js +44 -42
- package/esm/IconButton/IconButton.js.map +1 -1
- package/esm/IconButton/{IconButton.module-tmxv8TCl.css → IconButton.module-D2UJBm7x.css} +1 -1
- package/esm/IconButton/IconButton.module.js +4 -5
- package/esm/IconButton/IconButton.module.js.map +1 -1
- package/esm/InlineCode/InlineCode.js +1 -1
- package/esm/InlineLink/InlineLink.js +1 -1
- package/esm/InlineLink/{InlineLink.module-6R63us8B.css → InlineLink.module-BXx17-pO.css} +1 -1
- package/esm/InlineLink/InlineLink.module.js +1 -1
- package/esm/InlineLink/InlineLink.module.js.map +1 -1
- package/esm/Label/Label.js +1 -1
- package/esm/Label/Label.module-ChD9OmD6.css +1 -0
- package/esm/Label/Label.module.js +1 -1
- package/esm/Label/Label.module.js.map +1 -1
- package/esm/Link/Link.js +1 -1
- package/esm/LogoSuite/LogoSuite.d.ts +5 -1
- package/esm/LogoSuite/LogoSuite.d.ts.map +1 -1
- package/esm/LogoSuite/LogoSuite.js +37 -34
- package/esm/LogoSuite/LogoSuite.js.map +1 -1
- package/esm/LogoSuite/LogoSuite.module-BUJyNoZs.css +1 -0
- package/esm/LogoSuite/LogoSuite.module.js +3 -1
- package/esm/LogoSuite/LogoSuite.module.js.map +1 -1
- package/esm/MediaPlaylist/MediaPlaylist.js +1 -1
- package/esm/MinimalFooter/MinimalFooter.js +1 -1
- package/esm/MinimalVideoPlayer/MinimalVideoPlayer.d.ts.map +1 -1
- package/esm/MinimalVideoPlayer/MinimalVideoPlayer.js +33 -42
- package/esm/MinimalVideoPlayer/MinimalVideoPlayer.js.map +1 -1
- package/esm/NavList/NavList.js +1 -1
- package/esm/NavList/{NavList.module-zvpwnkzz.css → NavList.module-f9LV2-bb.css} +1 -1
- package/esm/NavList/NavList.module.js +1 -1
- package/esm/NavList/NavList.module.js.map +1 -1
- package/esm/PlayIcon.d.ts +3 -0
- package/esm/PlayIcon.d.ts.map +1 -0
- package/esm/PlayIcon.js +22 -0
- package/esm/PlayIcon.js.map +1 -0
- package/esm/PricingOptions/PricingOptions.js +1 -1
- package/esm/Prose/Prose.js +1 -1
- package/esm/Spinner/Spinner.d.ts +11 -0
- package/esm/Spinner/Spinner.d.ts.map +1 -0
- package/esm/Spinner/Spinner.js +48 -0
- package/esm/Spinner/Spinner.js.map +1 -0
- package/esm/Spinner/Spinner.module-BjDTZLR7.css +1 -0
- package/esm/Spinner/Spinner.module.js +13 -0
- package/esm/Spinner/Spinner.module.js.map +1 -0
- package/esm/Spinner/index.d.ts +3 -0
- package/esm/Spinner/index.d.ts.map +1 -0
- package/esm/SubNav/SubNav.js +1 -1
- package/esm/SubNav/SubNav.module-kWRa0Laq.css +1 -0
- package/esm/SubNav/SubNav.module.js +1 -1
- package/esm/SubNav/SubNav.module.js.map +1 -1
- package/esm/SubdomainNavBar/SubdomainNavBar.js +1 -1
- package/esm/Tabs/Tabs.js +1 -1
- package/esm/Testimonial/Testimonial.js +1 -1
- package/esm/Text/Text.module-Bf-3ooDP.css +1 -0
- package/esm/Text/Text.module.js +1 -1
- package/esm/Text/Text.module.js.map +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.js +1 -1
- package/esm/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/esm/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/esm/ThemeProvider/ThemeProvider.js +11 -9
- package/esm/ThemeProvider/ThemeProvider.js.map +1 -1
- package/esm/Tiles/Tiles.js +1 -1
- package/esm/Timeline/Timeline.js +1 -1
- package/esm/Token/Token.js +1 -1
- package/esm/Token/Token.module-Di856FbT.css +1 -0
- package/esm/Token/Token.module.js +1 -1
- package/esm/Token/Token.module.js.map +1 -1
- package/esm/Tooltip/Tooltip.js +1 -1
- package/esm/VideoPlayer/VideoPlayer.js +1 -1
- package/esm/css/stylesheets.js +1 -1
- package/esm/forms/Checkbox/Checkbox.js +1 -1
- package/esm/forms/FormControl/FormControl.d.ts.map +1 -1
- package/esm/forms/FormControl/FormControl.js +125 -105
- package/esm/forms/FormControl/FormControl.js.map +1 -1
- package/esm/forms/FormControl/FormControl.module-NDvIk_Aq.css +1 -0
- package/esm/forms/FormControl/FormControl.module.js +7 -4
- package/esm/forms/FormControl/FormControl.module.js.map +1 -1
- package/esm/forms/Radio/Radio.js +1 -1
- package/esm/forms/Select/Select.js +1 -1
- package/esm/forms/TextInput/TextInput.js +1 -1
- package/esm/forms/Textarea/Textarea.js +1 -1
- package/esm/forms/ToggleSwitch/ToggleSwitch.d.ts +34 -0
- package/esm/forms/ToggleSwitch/ToggleSwitch.d.ts.map +1 -0
- package/esm/forms/ToggleSwitch/ToggleSwitch.js +81 -0
- package/esm/forms/ToggleSwitch/ToggleSwitch.js.map +1 -0
- package/esm/forms/ToggleSwitch/ToggleSwitch.module-C_gXnHNW.css +1 -0
- package/esm/forms/ToggleSwitch/ToggleSwitch.module.js +18 -0
- package/esm/forms/ToggleSwitch/ToggleSwitch.module.js.map +1 -0
- package/esm/forms/ToggleSwitch/index.d.ts +3 -0
- package/esm/forms/ToggleSwitch/index.d.ts.map +1 -0
- package/esm/forms/index.d.ts +1 -0
- package/esm/forms/index.d.ts.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.esm.js +72 -70
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes-CBE7L2wV.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/colors/global-with-modes-CjksF091.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes-DKHKbQRW.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes-CyS5r4GY.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes-CD0Na993.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes-BngjsaKj.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes-Bog-yunW.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes-BbjIdlS-.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes-q-NjRozG.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-DKA7xAYz.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes-HElP20qs.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes-BTVqJ9iR.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes-BygKJG38.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/feature-comparison-table/colors-with-modes-k7YIWAQV.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes-PKZWykxm.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes-fV7rwA0l.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes-Chf_t26p.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes-BPFx95T7.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/base-_lTjJKpQ.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes-BsaQYf6M.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes-CTreurKT.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/inline-code/colors-with-modes-B72y-n-A.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes-CT7QXZTs.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes-S_161ALk.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes-JvDrymoz.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes-BsfJ9fNj.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes-DTTUHiv1.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes-BCIP0l57.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes-DNrd36sc.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes-BVL83uw2.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes-DOJW-F1w.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/spinner/base-BUCpHNCY.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes-ufFxqo2V.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes-8aCELL7I.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes-J9EPudv_.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes-D9l5QVGg.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes-isyQx5qj.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes-wctZLA5X.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes-BLWCqYua.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes-DNNJvx8C.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/toggle-switch/base-CWVI8qLT.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors-with-modes-Byi9AmE8.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes-CzvPUrZu.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes-CjEAA-Ic.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes-M9ib_BKQ.css +1 -0
- package/esm/river/River/River.js +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScroll.js +1 -1
- package/lib/LogoSuite/LogoSuite.d.ts +5 -1
- package/lib/PlayIcon.d.ts +2 -0
- package/lib/Spinner/Spinner.d.ts +10 -0
- package/lib/Spinner/index.d.ts +2 -0
- package/lib/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/lib/css/main.css +1444 -165
- package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +141 -2
- 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 +45 -2
- 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 +38 -2
- package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +12 -2
- package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +10 -2
- 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 +9 -2
- package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +9 -2
- package/lib/design-tokens/css/tokens/functional/components/button/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +35 -2
- 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 +10 -2
- 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 +10 -2
- 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 +47 -2
- package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +16 -2
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +52 -2
- 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 +13 -2
- 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/feature-comparison-table/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/feature-comparison-table/colors-with-modes.css +17 -2
- 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 +18 -2
- 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 +11 -2
- package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +9 -2
- 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 +36 -2
- 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 +3 -3
- package/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes.css +22 -2
- package/lib/design-tokens/css/tokens/functional/components/icon-button/colors.css +1 -1
- 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 +29 -2
- 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 +11 -2
- 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 +10 -2
- 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 +33 -2
- 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 +10 -2
- 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 +14 -2
- 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 +9 -2
- 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 +9 -2
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +16 -2
- 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 +10 -2
- 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 +10 -2
- package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/spinner/base.css +12 -0
- package/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes.css +20 -0
- package/lib/design-tokens/css/tokens/functional/components/spinner/colors.css +8 -0
- 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 +20 -2
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +19 -2
- 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 +14 -2
- 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 +55 -2
- 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 +11 -2
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +11 -2
- 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 +9 -2
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/toggle-switch/base.css +30 -0
- package/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors-with-modes.css +44 -0
- package/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors.css +16 -0
- package/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes.css +21 -2
- 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 +9 -2
- 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 +20 -2
- 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 +1 -1
- 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/feature-comparison-table/base.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 +2 -2
- package/lib/design-tokens/js/module/tokens/functional/components/icon-button/colors.js +1 -1
- 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/spinner/base.js +20 -0
- package/lib/design-tokens/js/module/tokens/functional/components/spinner/colors.js +15 -0
- 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/tiles/base.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/toggle-switch/base.js +56 -0
- package/lib/design-tokens/js/module/tokens/functional/components/toggle-switch/colors.js +63 -0
- 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 +1 -1
- 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/feature-comparison-table/base.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 +3 -3
- package/lib/design-tokens/js/tokens/functional/components/icon-button/colors.js +1 -1
- 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/spinner/base.js +10 -0
- package/lib/design-tokens/js/tokens/functional/components/spinner/colors.js +6 -0
- 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/tiles/base.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/toggle-switch/base.js +28 -0
- package/lib/design-tokens/js/tokens/functional/components/toggle-switch/colors.js +14 -0
- 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 +11 -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 +1 -1
- 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/feature-comparison-table/base.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 +3 -3
- package/lib/design-tokens/scss/tokens/functional/components/icon-button/colors.scss +1 -1
- 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/spinner/base.scss +9 -0
- package/lib/design-tokens/scss/tokens/functional/components/spinner/colors.scss +5 -0
- 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/tiles/base.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/toggle-switch/base.scss +27 -0
- package/lib/design-tokens/scss/tokens/functional/components/toggle-switch/colors.scss +13 -0
- 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 +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/button/base.js +1 -1
- 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/feature-comparison-table/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/feature-comparison-table/base.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 +2 -2
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/base.js +2 -2
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/colors.js +1 -1
- 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/spinner/base.d.ts +23 -0
- package/lib/design-tokens/ts/tokens/functional/components/spinner/base.js +20 -0
- package/lib/design-tokens/ts/tokens/functional/components/spinner/colors.d.ts +15 -0
- package/lib/design-tokens/ts/tokens/functional/components/spinner/colors.js +12 -0
- 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/tiles/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tiles/base.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/toggle-switch/base.d.ts +59 -0
- package/lib/design-tokens/ts/tokens/functional/components/toggle-switch/base.js +56 -0
- package/lib/design-tokens/ts/tokens/functional/components/toggle-switch/colors.d.ts +39 -0
- package/lib/design-tokens/ts/tokens/functional/components/toggle-switch/colors.js +36 -0
- 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/ToggleSwitch/ToggleSwitch.d.ts +33 -0
- package/lib/forms/ToggleSwitch/index.d.ts +2 -0
- package/lib/forms/index.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/llms.txt +4 -2
- package/package.json +1 -1
- package/esm/FeatureComparisonTable/FeatureComparisonTable.module-CGnj3YJu.css +0 -1
- package/esm/Heading/Heading.module-YfiTxQkR.css +0 -1
- package/esm/Label/Label.module-DDkalJAE.css +0 -1
- package/esm/LogoSuite/LogoSuite.module-BCbX-lfy.css +0 -1
- package/esm/SubNav/SubNav.module-cyUt0N_h.css +0 -1
- package/esm/Text/Text.module-D0UHZ0pq.css +0 -1
- package/esm/Token/Token.module-DtWE9IPI.css +0 -1
- package/esm/forms/FormControl/FormControl.module-CSNT689n.css +0 -1
- package/esm/node_modules/@primer/octicons-react/dist/icons/PlayIcon.js +0 -20
- package/esm/node_modules/@primer/octicons-react/dist/icons/PlayIcon.js.map +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes-BVk7bh0Y.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/colors/global-with-modes-Bdet_nBw.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes-PcQKqJQI.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes-mgXFtgvP.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes-98imfMkq.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes-DYugDcQy.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes-kII0kqk3.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes-C43pQ5wc.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes-D2oNfyDt.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-C05YPRXo.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes-B9zRp3WA.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes-BzV3LYhH.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes-Dc8Ya1HV.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/feature-comparison-table/colors-with-modes-Dw8AMSYp.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes-CMFhnjfv.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes-CMw13Yda.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes-6QocK2fy.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes-Bjhpbkke.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/base-DLPw97mz.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes-D7iaptsa.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes-DSf1PV6b.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/inline-code/colors-with-modes-Bj7XtHMY.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes-DujakhtG.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes-BB1L_8rS.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes-Dh1w7a05.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes-B8ia26TA.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes-YId8eSZQ.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes-CGyt2t8f.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes-DBi2l0Re.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes-Y3yB1rAU.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes-omPmv64b.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes-Bna3nyXf.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes-C_lnz8M6.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes-DCEDN6wM.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes-8ryG-BX6.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes-BucKYl1n.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes-DTTqGOfy.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes-DDIdeMJX.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes-5VT1x9eF.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes-BrRCxJ2E.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes-CTkp-z-l.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.js","names":[],"sources":["../../../src/forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {PropsWithChildren} from 'react'\nimport {useId} from '../../hooks/useId'\nimport {clsx} from 'clsx'\nimport {AlertFillIcon, CheckCircleFillIcon} from '@primer/octicons-react'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormValidationStatus, FormInputSizes} from '../'\n\nimport {Checkbox} from '../Checkbox'\nimport {Select} from '../Select'\nimport {TextInput} from '../TextInput'\nimport {Textarea} from '../Textarea'\nimport {Radio} from '../Radio'\nimport {Text} from '../../Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './FormControl.module.css'\n\nexport type FormControlProps = BaseProps<HTMLElement> & {\n /**\n * Apply a decorative border to the form control.\n */\n hasBorder?: boolean\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * A unique identifier for the form control.\n * This is used to associate the form control with its associated label.\n * If an id is not provided, a unique id will be generated.\n */\n id?: string\n /**\n * Applies required styling to the label and input.\n */\n required?: boolean\n /**\n * Alternative sizes for inputs and labels.\n */\n size?: FormInputSizes\n /**\n * Provides contextual validation feedback to all children, showing relevant messaging where applicable.\n */\n validationStatus?: FormValidationStatus\n}\n\n/**\n * The Checkbox and the Radio components both use the trick of using a <label> to render the visual control,\n * and visually hiding the <input>. This means that, when you add a FormControl.Label alongside your\n * Checkbox/Radio, the <input> technically has two <label> elements associated with it.\n * That doesn't appear to be a problem (it's valid HTML and NVDA announces it correctly) but it does annoy\n * our Storybook Axe tests because they only seem to look at one of the labels.\n * To fix this, we recommend that the FormControl.Label always appears before the Checkbox/Radio in the DOM,\n * even though it visually appears after the Checkbox/Radio, as this keeps Storybook Axe happy.\n */\n\nconst Root = ({\n children,\n className,\n hasBorder,\n fullWidth,\n id,\n required,\n size = 'medium',\n validationStatus,\n ...rest\n}: PropsWithChildren<FormControlProps>) => {\n const uniqueId = useId(id)\n const childrenArr = React.Children.toArray(children)\n\n const isInlineControl = childrenArr.some(\n child => React.isValidElement(child) && (child.type === Checkbox || child.type === Radio),\n )\n\n const containsHint = childrenArr.some(child => React.isValidElement(child) && child.type === FormControlHint)\n const containsValidation = childrenArr.some(\n child => React.isValidElement(child) && child.type === FormControlValidation,\n )\n\n return (\n <section\n id={`FormControl--${uniqueId}`}\n className={clsx(\n styles.FormControl,\n fullWidth && styles[`FormControl--fullWidth`],\n isInlineControl && styles['FormControl--checkbox'],\n hasBorder && styles['FormControl--border'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (!React.isValidElement(child)) return child\n\n const describedBy =\n [containsHint && `${uniqueId}-hint`, containsValidation && `${uniqueId}-validation`]\n .filter(Boolean)\n .join(' ') || undefined\n\n if (child.type === TextInput) {\n const element = child as React.ReactElement<React.ComponentProps<typeof TextInput>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Textarea) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Textarea>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Select) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Select>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Checkbox) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Checkbox>>\n return React.cloneElement(element, {\n className: clsx(element.props.className, styles['FormControl-control--checkbox']),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Radio) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Radio>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-control--radio'], element.props.className),\n id: uniqueId,\n name: element.props.name,\n required: element.props.required || required,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === FormControlLabel) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlLabel>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-label--checkbox'], element.props.className),\n htmlFor: uniqueId,\n children: element.props.children,\n required,\n validationStatus,\n size,\n showRequiredIndicator: isInlineControl ? false : element.props.showRequiredIndicator,\n })\n }\n\n if (child.type === FormControlValidation) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlValidation>>\n return React.cloneElement(element, {\n className: clsx(isInlineControl && styles['FormControl-validation-checkbox'], element.props.className),\n validationStatus,\n id: `${uniqueId}-validation`,\n })\n }\n\n if (child.type === FormControlHint) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlHint>>\n return React.cloneElement(element, {\n id: `${uniqueId}-hint`,\n })\n }\n\n return child\n })}\n </section>\n )\n}\n\ntype FormControlLabelProps = {\n htmlFor?: string\n required?: boolean\n showRequiredIndicator?: boolean\n size?: FormInputSizes\n validationStatus?: FormValidationStatus\n visuallyHidden?: boolean\n} & BaseProps<HTMLLabelElement>\n\nconst FormControlLabel = ({\n children,\n className,\n htmlFor,\n required,\n showRequiredIndicator = true,\n size = 'medium',\n validationStatus,\n visuallyHidden,\n ...rest\n}: PropsWithChildren<FormControlLabelProps>) => {\n return (\n <label\n htmlFor={htmlFor}\n className={clsx(\n styles['FormControl-label'],\n validationStatus && styles[`FormControl-label--${validationStatus}`],\n styles[`FormControl-label--${size}`],\n visuallyHidden && styles['FormControl-label--visually-hidden'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (React.isValidElement<FormControlHintProps>(child) && child.type === FormControlHint) {\n return React.cloneElement(child, {\n className: clsx(styles['FormControl--visible'], child.props.className),\n })\n }\n return child\n })}\n\n {required && showRequiredIndicator && (\n <span className={styles['FormControl-label-required']} aria-hidden>\n {' '}\n *\n </span>\n )}\n </label>\n )\n}\n\ntype FormControlValidationProps = {\n children: string\n validationStatus?: FormValidationStatus\n} & BaseProps<HTMLSpanElement>\n\nconst FormControlValidation = ({children, validationStatus, className, ...props}: FormControlValidationProps) => {\n return (\n <Text\n as=\"span\"\n size=\"100\"\n className={clsx(\n styles['FormControl-validation'],\n validationStatus && styles['FormControl-validation--animate-in'],\n validationStatus && styles[`FormControl-validation--${validationStatus}`],\n className,\n )}\n {...props}\n >\n {validationStatus === 'error' && (\n <span className={styles['FormControl-validation-error-icon']}>\n <AlertFillIcon />\n </span>\n )}\n {validationStatus === 'success' && (\n <span className={styles['FormControl-validation-success-icon']}>\n <CheckCircleFillIcon />\n </span>\n )}\n {children}\n </Text>\n )\n}\n\ntype FormControlHintProps = PropsWithChildren<BaseProps<HTMLSpanElement>>\n\nconst FormControlHint = ({className, ...rest}: FormControlHintProps) => {\n return <Text as=\"span\" size=\"100\" variant=\"muted\" className={clsx(styles['FormControl-hint'], className)} {...rest} />\n}\n\n/**\n * FormControl\n * {@link https://primer.style/brand/components/FormControl/ See usage examples}.\n */\nexport const FormControl = Object.assign(Root, {\n Label: FormControlLabel,\n Validation: FormControlValidation,\n Hint: FormControlHint,\n})\n"],"mappings":";;;;;;;;;;;;;;;AAyDA,IAAM,KAAQ,EACZ,aACA,cACA,cACA,cACA,OACA,aACA,UAAO,UACP,qBACA,GAAG,QACsC;CACzC,IAAM,IAAW,EAAM,CAAE,GACnB,IAAc,EAAM,SAAS,QAAQ,CAAQ,GAE7C,IAAkB,EAAY,MAClC,MAAS,EAAM,eAAe,CAAK,MAAM,EAAM,SAAS,KAAY,EAAM,SAAS,EACrF,GAEM,IAAe,EAAY,MAAK,MAAS,EAAM,eAAe,CAAK,KAAK,EAAM,SAAS,CAAe,GACtG,IAAqB,EAAY,MACrC,MAAS,EAAM,eAAe,CAAK,KAAK,EAAM,SAAS,CACzD;CAEA,OACE,kBAAC,WAAD;EACE,IAAI,gBAAgB;EACpB,WAAW,EACT,EAAO,aACP,KAAa,EAAO,2BACpB,KAAmB,EAAO,0BAC1B,KAAa,EAAO,wBACpB,CACF;EACA,GAAI;YAEH,EAAM,SAAS,IAAI,IAAU,MAAS;GACrC,IAAI,CAAC,EAAM,eAAe,CAAK,GAAG,OAAO;GAEzC,IAAM,IACJ,CAAC,KAAgB,GAAG,EAAS,QAAQ,KAAsB,GAAG,EAAS,YAAY,CAAC,CACjF,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,KAAK,KAAA;GAElB,IAAI,EAAM,SAAS,GAAW;IAC5B,IAAM,IAAU;IAChB,OAAO,EAAM,aAAa,GAAS;KACjC,WAAW,EAAK,EAAQ,MAAM,SAAS;KACvC,IAAI;KACJ,MAAM,EAAQ,MAAM,QAAQ;KAC5B,UAAU,EAAQ,MAAM,YAAY;KACpC,kBAAkB,EAAQ,MAAM,oBAAoB;KACpD;KACA;KACA,oBAAoB;IACtB,CAAC;GACH;GAEA,IAAI,EAAM,SAAS,GAAU;IAC3B,IAAM,IAAU;IAChB,OAAO,EAAM,aAAa,GAAS;KACjC,WAAW,EAAK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AD;CAAM,IAAG;CAAO,MAAK;CAAM,SAAQ;CAAQ,WAAW,EAAK,EAAO,qBAAqB,CAAS;CAAG,GAAI;AAAO,CAAA,GAO1G,IAAc,OAAO,OAAO,GAAM;CAC7C,OAAO;CACP,YAAY;CACZ,MAAM;AACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"FormControl.js","names":[],"sources":["../../../src/forms/FormControl/FormControl.tsx"],"sourcesContent":["import React, {PropsWithChildren} from 'react'\nimport {useId} from '../../hooks/useId'\nimport {clsx} from 'clsx'\nimport {AlertFillIcon, CheckCircleFillIcon} from '@primer/octicons-react'\n\nimport type {BaseProps} from '../../component-helpers'\nimport type {FormValidationStatus, FormInputSizes} from '../'\n\nimport {Checkbox} from '../Checkbox'\nimport {Select} from '../Select'\nimport {TextInput} from '../TextInput'\nimport {Textarea} from '../Textarea'\nimport {Radio} from '../Radio'\nimport {ToggleSwitch} from '../ToggleSwitch'\nimport type {ToggleSwitchInternalProps} from '../ToggleSwitch/ToggleSwitch'\nimport {Spinner} from '../../Spinner/Spinner'\nimport {Text} from '../../Text'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css'\nimport styles from './FormControl.module.css'\nimport toggleSwitchStyles from '../ToggleSwitch/ToggleSwitch.module.css'\n\nexport type FormControlProps = BaseProps<HTMLElement> & {\n /**\n * Apply a decorative border to the form control.\n */\n hasBorder?: boolean\n /**\n * Applies full width styling.\n */\n fullWidth?: boolean\n /**\n * A unique identifier for the form control.\n * This is used to associate the form control with its associated label.\n * If an id is not provided, a unique id will be generated.\n */\n id?: string\n /**\n * Applies required styling to the label and input.\n */\n required?: boolean\n /**\n * Alternative sizes for inputs and labels.\n */\n size?: FormInputSizes\n /**\n * Provides contextual validation feedback to all children, showing relevant messaging where applicable.\n */\n validationStatus?: FormValidationStatus\n}\n\n/**\n * The Checkbox and the Radio components both use the trick of using a <label> to render the visual control,\n * and visually hiding the <input>. This means that, when you add a FormControl.Label alongside your\n * Checkbox/Radio, the <input> technically has two <label> elements associated with it.\n * That doesn't appear to be a problem (it's valid HTML and NVDA announces it correctly) but it does annoy\n * our Storybook Axe tests because they only seem to look at one of the labels.\n * To fix this, we recommend that the FormControl.Label always appears before the Checkbox/Radio in the DOM,\n * even though it visually appears after the Checkbox/Radio, as this keeps Storybook Axe happy.\n */\n\nconst Root = ({\n children,\n className,\n hasBorder,\n fullWidth,\n id,\n required,\n size = 'medium',\n validationStatus,\n ...rest\n}: PropsWithChildren<FormControlProps>) => {\n const uniqueId = useId(id)\n const childrenArr = React.Children.toArray(children)\n\n const isCheckboxOrRadio = childrenArr.some(\n child => React.isValidElement(child) && (child.type === Checkbox || child.type === Radio),\n )\n const toggleSwitchElement = childrenArr.find(child => React.isValidElement(child) && child.type === ToggleSwitch) as\n | React.ReactElement<ToggleSwitchInternalProps>\n | undefined\n const isToggleSwitch = Boolean(toggleSwitchElement)\n const describedBy =\n [\n childrenArr.some(child => React.isValidElement(child) && child.type === FormControlHint) && `${uniqueId}-hint`,\n childrenArr.some(child => React.isValidElement(child) && child.type === FormControlValidation) &&\n `${uniqueId}-validation`,\n ]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <section\n id={`FormControl--${uniqueId}`}\n className={clsx(\n styles.FormControl,\n fullWidth && styles[`FormControl--fullWidth`],\n isCheckboxOrRadio && styles['FormControl--checkbox'],\n isToggleSwitch && styles['FormControl--toggle-switch'],\n hasBorder && styles['FormControl--border'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (!React.isValidElement(child)) return child\n\n if (child.type === TextInput) {\n const element = child as React.ReactElement<React.ComponentProps<typeof TextInput>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Textarea) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Textarea>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Select) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Select>>\n return React.cloneElement(element, {\n className: clsx(element.props.className),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n fullWidth,\n size,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Checkbox) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Checkbox>>\n return React.cloneElement(element, {\n className: clsx(element.props.className, styles['FormControl-control--checkbox']),\n id: uniqueId,\n name: element.props.name || uniqueId,\n required: element.props.required || required,\n validationStatus: element.props.validationStatus || validationStatus,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === Radio) {\n const element = child as React.ReactElement<React.ComponentProps<typeof Radio>>\n return React.cloneElement(element, {\n className: clsx(isCheckboxOrRadio && styles['FormControl-control--radio'], element.props.className),\n id: uniqueId,\n name: element.props.name,\n required: element.props.required || required,\n 'aria-describedby': describedBy,\n })\n }\n\n if (child.type === ToggleSwitch) {\n const element = child as React.ReactElement<ToggleSwitchInternalProps>\n const descriptions = [element.props['aria-describedby'], describedBy].filter(Boolean).join(' ')\n return React.cloneElement(element, {\n className: clsx(styles['FormControl-control--toggle-switch'], element.props.className),\n id: uniqueId,\n toggleSwitchSpinnerInLabel: childrenArr.some(\n labelChild =>\n React.isValidElement<React.ComponentProps<typeof FormControlLabel>>(labelChild) &&\n labelChild.type === FormControlLabel &&\n !labelChild.props.visuallyHidden,\n ),\n 'aria-describedby': descriptions ? [...new Set(descriptions.split(/\\s+/))].join(' ') : undefined,\n 'aria-invalid': element.props['aria-invalid'] ?? (validationStatus === 'error' ? true : undefined),\n })\n }\n\n if (child.type === FormControlLabel) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlLabel>>\n return React.cloneElement(element, {\n className: clsx(\n isCheckboxOrRadio && styles['FormControl-label--checkbox'],\n isToggleSwitch && styles['FormControl-label--toggle-switch'],\n element.props.className,\n ),\n htmlFor: uniqueId,\n children:\n toggleSwitchElement?.props.loading && !element.props.visuallyHidden\n ? [\n ...React.Children.toArray(element.props.children),\n <span\n key=\"toggleSwitch-spinner\"\n aria-hidden=\"true\"\n className={styles['FormControl-toggleSwitch-spinnerSlot']}\n >\n <Spinner\n size=\"small\"\n accessibleLabel={null}\n className={toggleSwitchStyles['ToggleSwitch-spinner']}\n data-testid={ToggleSwitch.testIds.spinner}\n />\n </span>,\n ]\n : element.props.children,\n required: isToggleSwitch ? false : required,\n validationStatus,\n size,\n showRequiredIndicator: isCheckboxOrRadio ? false : element.props.showRequiredIndicator,\n })\n }\n\n if (child.type === FormControlValidation) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlValidation>>\n return React.cloneElement(element, {\n validationStatus,\n id: `${uniqueId}-validation`,\n })\n }\n\n if (child.type === FormControlHint) {\n const element = child as React.ReactElement<React.ComponentProps<typeof FormControlHint>>\n return React.cloneElement(element, {\n id: `${uniqueId}-hint`,\n })\n }\n\n return child\n })}\n </section>\n )\n}\n\ntype FormControlLabelProps = {\n htmlFor?: string\n required?: boolean\n showRequiredIndicator?: boolean\n size?: FormInputSizes\n validationStatus?: FormValidationStatus\n visuallyHidden?: boolean\n} & BaseProps<HTMLLabelElement>\n\nconst FormControlLabel = ({\n children,\n className,\n htmlFor,\n required,\n showRequiredIndicator = true,\n size = 'medium',\n validationStatus,\n visuallyHidden,\n ...rest\n}: PropsWithChildren<FormControlLabelProps>) => {\n return (\n <label\n htmlFor={htmlFor}\n className={clsx(\n styles['FormControl-label'],\n validationStatus && styles[`FormControl-label--${validationStatus}`],\n styles[`FormControl-label--${size}`],\n visuallyHidden && styles['FormControl-label--visually-hidden'],\n className,\n )}\n {...rest}\n >\n {React.Children.map(children, child => {\n if (React.isValidElement<FormControlHintProps>(child) && child.type === FormControlHint) {\n return React.cloneElement(child, {\n className: clsx(styles['FormControl--visible'], child.props.className),\n })\n }\n return child\n })}\n\n {required && showRequiredIndicator && (\n <span className={styles['FormControl-label-required']} aria-hidden>\n {' '}\n *\n </span>\n )}\n </label>\n )\n}\n\ntype FormControlValidationProps = {\n children: string\n validationStatus?: FormValidationStatus\n} & BaseProps<HTMLSpanElement>\n\nconst FormControlValidation = ({children, validationStatus, className, ...props}: FormControlValidationProps) => {\n return (\n <Text\n as=\"span\"\n size=\"100\"\n className={clsx(\n styles['FormControl-validation'],\n validationStatus && styles['FormControl-validation--animate-in'],\n validationStatus && styles[`FormControl-validation--${validationStatus}`],\n className,\n )}\n {...props}\n >\n {validationStatus === 'error' && (\n <span className={styles['FormControl-validation-error-icon']}>\n <AlertFillIcon />\n </span>\n )}\n {validationStatus === 'success' && (\n <span className={styles['FormControl-validation-success-icon']}>\n <CheckCircleFillIcon />\n </span>\n )}\n {children}\n </Text>\n )\n}\n\ntype FormControlHintProps = PropsWithChildren<BaseProps<HTMLSpanElement>>\n\nconst FormControlHint = ({className, ...rest}: FormControlHintProps) => {\n return <Text as=\"span\" size=\"100\" variant=\"muted\" className={clsx(styles['FormControl-hint'], className)} {...rest} />\n}\n\n/**\n * FormControl\n * {@link https://primer.style/brand/components/FormControl/ See usage examples}.\n */\nexport const FormControl = Object.assign(Root, {\n Label: FormControlLabel,\n Validation: FormControlValidation,\n Hint: FormControlHint,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6DA,IAAM,KAAQ,EACZ,aACA,cACA,cACA,cACA,OACA,aACA,UAAO,UACP,qBACA,GAAG,QACsC;CACzC,IAAM,IAAW,EAAM,CAAE,GACnB,IAAc,EAAM,SAAS,QAAQ,CAAQ,GAE7C,IAAoB,EAAY,MACpC,MAAS,EAAM,eAAe,CAAK,MAAM,EAAM,SAAS,KAAY,EAAM,SAAS,EACrF,GACM,IAAsB,EAAY,MAAK,MAAS,EAAM,eAAe,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G,KAAI,GAED;GAEH;IASL,KAAyB,EAAC,aAAU,qBAAkB,cAAW,GAAG,QAEtE,kBAAC,GAAD;CACE,IAAG;CACH,MAAK;CACL,WAAW,EACT,EAAO,2BACP,KAAoB,EAAO,uCAC3B,KAAoB,EAAO,2BAA2B,MACtD,CACF;CACA,GAAI;WATN;EAWG,MAAqB,WACpB,kBAAC,QAAD;GAAM,WAAW,EAAO;aACtB,kBAAC,GAAD,CAAgB,CAAA;EACZ,CAAA;EAEP,MAAqB,aACpB,kBAAC,QAAD;GAAM,WAAW,EAAO;aACtB,kBAAC,GAAD,CAAsB,CAAA;EAClB,CAAA;EAEP;CACG;IAMJ,KAAmB,EAAC,cAAW,GAAG,QAC/B,kBAAC,GAAD;CAAM,IAAG;CAAO,MAAK;CAAM,SAAQ;CAAQ,WAAW,EAAK,EAAO,qBAAqB,CAAS;CAAG,GAAI;AAAO,CAAA,GAO1G,IAAc,OAAO,OAAO,GAAM;CAC7C,OAAO;CACP,YAAY;CACZ,MAAM;AACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Primer_Brand__FormControl-module__FormControl___xyCI6{font-family:var(--brand-body-fontFamily);gap:var(--base-size-8);flex-direction:column;display:inline-flex}.Primer_Brand__FormControl-module__FormControl--fullWidth____kgvY{width:100%}.Primer_Brand__FormControl-module__FormControl--checkbox___bF4ig{grid-template-columns:auto 1fr;display:grid}.Primer_Brand__FormControl-module__FormControl--toggle-switch___HomKh{grid-column-gap:var(--brand-ToggleSwitch-label-gap);-moz-column-gap:var(--brand-ToggleSwitch-label-gap);column-gap:var(--brand-ToggleSwitch-label-gap);grid-template-columns:auto minmax(0,1fr);align-items:center;display:grid}.Primer_Brand__FormControl-module__FormControl-control--toggle-switch___pwbrT{grid-area:1/1;align-self:start}.Primer_Brand__FormControl-module__FormControl-label--toggle-switch____nCka{cursor:pointer;word-wrap:anywhere;grid-area:1/2;min-width:0}.Primer_Brand__FormControl-module__FormControl-label--medium___bj84g.Primer_Brand__FormControl-module__FormControl-label--toggle-switch____nCka{font-size:var(--brand-ToggleSwitch-label-fontSize);line-height:max(var(--brand-ToggleSwitch-label-lineHeight), var(--brand-ToggleSwitch-target-minHeight))}.Primer_Brand__FormControl-module__FormControl-toggleSwitch-spinnerSlot___WwrPk{width:var(--brand-ToggleSwitch-loading-size);height:var(--brand-ToggleSwitch-loading-size);vertical-align:middle;pointer-events:none;justify-content:center;align-items:center;margin-inline-start:var(--brand-ToggleSwitch-loading-gap);display:inline-flex}.Primer_Brand__FormControl-module__FormControl--border___JkgNP{border:1px solid var(--brand-control-color-border-default);border-radius:var(--brand-borderRadius-medium);padding:var(--base-size-12)}.Primer_Brand__FormControl-module__FormControl-label____oJE0{color:var(--brand-color-text-default);font-weight:var(--base-text-weight-medium);font-family:var(--brand-body-fontFamily)}.Primer_Brand__FormControl-module__FormControl-label--visually-hidden___1ZVMo{clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.Primer_Brand__FormControl-module__FormControl-label--medium___bj84g{letter-spacing:var(--brand-text-letterSpacing-100);font-size:var(--brand-text-size-100);line-height:var(--brand-text-lineHeight-100)}.Primer_Brand__FormControl-module__FormControl-label--large___o1TMW{letter-spacing:var(--brand-text-letterSpacing-300);font-size:var(--brand-text-size-300);line-height:var(--brand-text-lineHeight-300)}.Primer_Brand__FormControl-module__FormControl-label--checkbox___xZxFK{cursor:pointer;font-size:var(--brand-text-size-100);font-weight:var(--base-text-weight-medium);line-height:var(--base-size-24);width:100%;position:relative;top:1px}.Primer_Brand__FormControl-module__FormControl-control--radio___ml5zt{margin:2px 0 0}.Primer_Brand__FormControl-module__FormControl-hint___DmKlt{grid-column:1/3;display:block}.Primer_Brand__FormControl-module__FormControl-validation___GOPld{gap:var(--base-size-4);grid-column:1/3;align-items:center;display:flex}.Primer_Brand__FormControl-module__FormControl-validation--success___kOKNY{color:var(--brand-color-success-fg)}.Primer_Brand__FormControl-module__FormControl-validation--error___T5KVh{color:var(--brand-control-color-validation-error)}.Primer_Brand__FormControl-module__FormControl-validation-success-icon___zPbVN,.Primer_Brand__FormControl-module__FormControl-validation-error-icon___hijkD{display:flex}.Primer_Brand__FormControl-module__FormControl-validation--animate-in___bQToQ{animation:.17s cubic-bezier(.44,.74,.36,1) Primer_Brand__FormControl-module__FormControlValidationFadeIn___tj0TP}@keyframes Primer_Brand__FormControl-module__FormControlValidationFadeIn___tj0TP{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import './FormControl.module-
|
|
1
|
+
import './FormControl.module-NDvIk_Aq.css';//#region src/forms/FormControl/FormControl.module.css
|
|
2
2
|
var e = "Primer_Brand__FormControl-module__FormControl___xyCI6", t = "Primer_Brand__FormControl-module__FormControlValidationFadeIn___tj0TP", n = {
|
|
3
3
|
FormControl: e,
|
|
4
4
|
"FormControl--fullWidth": "Primer_Brand__FormControl-module__FormControl--fullWidth____kgvY",
|
|
5
5
|
"FormControl--checkbox": "Primer_Brand__FormControl-module__FormControl--checkbox___bF4ig",
|
|
6
|
+
"FormControl--toggle-switch": "Primer_Brand__FormControl-module__FormControl--toggle-switch___HomKh",
|
|
7
|
+
"FormControl-control--toggle-switch": "Primer_Brand__FormControl-module__FormControl-control--toggle-switch___pwbrT",
|
|
8
|
+
"FormControl-label--toggle-switch": "Primer_Brand__FormControl-module__FormControl-label--toggle-switch____nCka",
|
|
9
|
+
"FormControl-label--medium": "Primer_Brand__FormControl-module__FormControl-label--medium___bj84g",
|
|
10
|
+
"FormControl-toggleSwitch-spinnerSlot": "Primer_Brand__FormControl-module__FormControl-toggleSwitch-spinnerSlot___WwrPk",
|
|
6
11
|
"FormControl--border": "Primer_Brand__FormControl-module__FormControl--border___JkgNP",
|
|
7
12
|
"FormControl-label": "Primer_Brand__FormControl-module__FormControl-label____oJE0",
|
|
8
13
|
"FormControl-label--visually-hidden": "Primer_Brand__FormControl-module__FormControl-label--visually-hidden___1ZVMo",
|
|
9
|
-
"FormControl-label--medium": "Primer_Brand__FormControl-module__FormControl-label--medium___bj84g",
|
|
10
14
|
"FormControl-label--large": "Primer_Brand__FormControl-module__FormControl-label--large___o1TMW",
|
|
11
15
|
"FormControl-label--checkbox": "Primer_Brand__FormControl-module__FormControl-label--checkbox___xZxFK",
|
|
12
16
|
"FormControl-control--radio": "Primer_Brand__FormControl-module__FormControl-control--radio___ml5zt",
|
|
@@ -17,8 +21,7 @@ var e = "Primer_Brand__FormControl-module__FormControl___xyCI6", t = "Primer_Bra
|
|
|
17
21
|
"FormControl-validation-success-icon": "Primer_Brand__FormControl-module__FormControl-validation-success-icon___zPbVN",
|
|
18
22
|
"FormControl-validation-error-icon": "Primer_Brand__FormControl-module__FormControl-validation-error-icon___hijkD",
|
|
19
23
|
"FormControl-validation--animate-in": "Primer_Brand__FormControl-module__FormControl-validation--animate-in___bQToQ",
|
|
20
|
-
FormControlValidationFadeIn: t
|
|
21
|
-
"FormControl-validation-checkbox": "Primer_Brand__FormControl-module__FormControl-validation-checkbox___o5dVo"
|
|
24
|
+
FormControlValidationFadeIn: t
|
|
22
25
|
};
|
|
23
26
|
//#endregion
|
|
24
27
|
export { e as FormControl, t as FormControlValidationFadeIn, n as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.module.js","names":[],"sources":["../../../src/forms/FormControl/FormControl.module.css"],"sourcesContent":[".FormControl {\n display: inline-flex;\n font-family: var(--brand-body-fontFamily);\n flex-direction: column;\n gap: var(--base-size-8);\n}\n\n.FormControl--fullWidth {\n width: 100%;\n}\n\n.FormControl--checkbox {\n display: grid;\n grid-template-columns: auto 1fr;\n}\n\n.FormControl--border {\n border: 1px solid var(--brand-control-color-border-default);\n border-radius: var(--brand-borderRadius-medium);\n padding: var(--base-size-12);\n}\n\n.FormControl-label {\n color: var(--brand-color-text-default);\n font-weight: var(--base-text-weight-medium);\n font-family: var(--brand-body-fontFamily);\n}\n\n.FormControl-label--visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.FormControl-label--medium {\n letter-spacing: var(--brand-text-letterSpacing-100);\n font-size: var(--brand-text-size-100);\n line-height: var(--brand-text-lineHeight-100);\n}\n\n.FormControl-label--large {\n letter-spacing: var(--brand-text-letterSpacing-300);\n font-size: var(--brand-text-size-300);\n line-height: var(--brand-text-lineHeight-300);\n}\n\n.FormControl-label--checkbox {\n cursor: pointer;\n font-size: var(--brand-text-size-100);\n font-weight: var(--base-text-weight-medium);\n line-height: var(--base-size-24);\n width: 100%;\n position: relative;\n top: 1px;\n}\n\n.FormControl-control--radio {\n margin: 2px 0 0;\n}\n\n.FormControl-hint {\n grid-column: 1 / 3;\n display: block;\n}\n\n/*Validation*/\n.FormControl-validation {\n display: flex;\n gap: var(--base-size-4);\n align-items: center;\n}\n\n.FormControl-validation--success {\n color: var(--brand-color-success-fg);\n}\n\n.FormControl-validation--error {\n color: var(--brand-color-
|
|
1
|
+
{"version":3,"file":"FormControl.module.js","names":[],"sources":["../../../src/forms/FormControl/FormControl.module.css"],"sourcesContent":[".FormControl {\n display: inline-flex;\n font-family: var(--brand-body-fontFamily);\n flex-direction: column;\n gap: var(--base-size-8);\n}\n\n.FormControl--fullWidth {\n width: 100%;\n}\n\n.FormControl--checkbox {\n display: grid;\n grid-template-columns: auto 1fr;\n}\n\n.FormControl--toggle-switch {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n column-gap: var(--brand-ToggleSwitch-label-gap);\n align-items: center;\n}\n\n.FormControl-control--toggle-switch {\n grid-column: 1;\n grid-row: 1;\n align-self: start;\n}\n\n.FormControl-label--toggle-switch {\n grid-column: 2;\n grid-row: 1;\n min-width: 0;\n cursor: pointer;\n overflow-wrap: anywhere;\n}\n\n.FormControl-label--medium.FormControl-label--toggle-switch {\n font-size: var(--brand-ToggleSwitch-label-fontSize);\n line-height: max(var(--brand-ToggleSwitch-label-lineHeight), var(--brand-ToggleSwitch-target-minHeight));\n}\n\n.FormControl-toggleSwitch-spinnerSlot {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--brand-ToggleSwitch-loading-size);\n height: var(--brand-ToggleSwitch-loading-size);\n margin-inline-start: var(--brand-ToggleSwitch-loading-gap);\n vertical-align: middle;\n pointer-events: none;\n}\n\n.FormControl--border {\n border: 1px solid var(--brand-control-color-border-default);\n border-radius: var(--brand-borderRadius-medium);\n padding: var(--base-size-12);\n}\n\n.FormControl-label {\n color: var(--brand-color-text-default);\n font-weight: var(--base-text-weight-medium);\n font-family: var(--brand-body-fontFamily);\n}\n\n.FormControl-label--visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.FormControl-label--medium {\n letter-spacing: var(--brand-text-letterSpacing-100);\n font-size: var(--brand-text-size-100);\n line-height: var(--brand-text-lineHeight-100);\n}\n\n.FormControl-label--large {\n letter-spacing: var(--brand-text-letterSpacing-300);\n font-size: var(--brand-text-size-300);\n line-height: var(--brand-text-lineHeight-300);\n}\n\n.FormControl-label--checkbox {\n cursor: pointer;\n font-size: var(--brand-text-size-100);\n font-weight: var(--base-text-weight-medium);\n line-height: var(--base-size-24);\n width: 100%;\n position: relative;\n top: 1px;\n}\n\n.FormControl-control--radio {\n margin: 2px 0 0;\n}\n\n.FormControl-hint {\n grid-column: 1 / 3;\n display: block;\n}\n\n/*Validation*/\n.FormControl-validation {\n grid-column: 1 / 3;\n display: flex;\n gap: var(--base-size-4);\n align-items: center;\n}\n\n.FormControl-validation--success {\n color: var(--brand-color-success-fg);\n}\n\n.FormControl-validation--error {\n color: var(--brand-control-color-validation-error);\n}\n\n.FormControl-validation-success-icon {\n display: flex;\n}\n\n.FormControl-validation-error-icon {\n display: flex;\n}\n\n.FormControl-validation--animate-in {\n animation: 170ms FormControlValidationFadeIn cubic-bezier(0.44, 0.74, 0.36, 1);\n}\n\n@keyframes FormControlValidationFadeIn {\n 0% {\n opacity: 0;\n transform: translateY(-100%);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n}\n"],"mappings":""}
|
package/esm/forms/Radio/Radio.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx as e } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { useId as t } from "../../hooks/useId.js";
|
|
3
3
|
import { useProvidedRefOrCreate as n } from "../../hooks/useRef.js";
|
|
4
|
-
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-
|
|
4
|
+
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-DKA7xAYz.css';/* empty css */
|
|
5
5
|
import r from "./Radio.module.js";
|
|
6
6
|
import { forwardRef as i, useCallback as a } from "react";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clsx as e } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
|
-
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-
|
|
2
|
+
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-DKA7xAYz.css';/* empty css */
|
|
3
3
|
import t from "./Select.module.js";
|
|
4
4
|
import { forwardRef as n } from "react";
|
|
5
5
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx as e } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { useId as t } from "../../hooks/useId.js";
|
|
3
3
|
import { Text as n } from "../../Text/Text.js";
|
|
4
|
-
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-
|
|
4
|
+
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-DKA7xAYz.css';/* empty css */
|
|
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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clsx as e } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
|
-
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-
|
|
2
|
+
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-DKA7xAYz.css';/* empty css */
|
|
3
3
|
import t from "./Textarea.module.js";
|
|
4
4
|
import { forwardRef as n } from "react";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/toggle-switch/base.css';
|
|
3
|
+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors-with-modes.css';
|
|
4
|
+
type ToggleSwitchSize = 'small' | 'medium';
|
|
5
|
+
type ToggleSwitchSpinnerPosition = 'start' | 'end';
|
|
6
|
+
type ToggleSwitchButtonPropKeysToOmit = 'aria-busy' | 'aria-checked' | 'aria-disabled' | 'children' | 'onChange' | 'role' | 'type';
|
|
7
|
+
export type ToggleSwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, ToggleSwitchButtonPropKeysToOmit> & {
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
defaultChecked?: boolean;
|
|
11
|
+
onChange?: (checked: boolean) => void;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
size?: ToggleSwitchSize;
|
|
14
|
+
loadingLabel?: string;
|
|
15
|
+
loadingLabelDelay?: number;
|
|
16
|
+
spinnerPosition?: ToggleSwitchSpinnerPosition;
|
|
17
|
+
};
|
|
18
|
+
export type ToggleSwitchInternalProps = ToggleSwitchProps & {
|
|
19
|
+
toggleSwitchSpinnerInLabel?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type ToggleSwitchComponent = React.ForwardRefExoticComponent<ToggleSwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
/**
|
|
23
|
+
* Use ToggleSwitch for settings that take effect immediately.
|
|
24
|
+
* @see https://primer.style/brand/forms/ToggleSwitch
|
|
25
|
+
*/
|
|
26
|
+
export declare const ToggleSwitch: ToggleSwitchComponent & {
|
|
27
|
+
testIds: {
|
|
28
|
+
root: string;
|
|
29
|
+
spinner: string;
|
|
30
|
+
loadingAnnouncement: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=ToggleSwitch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.d.ts","sourceRoot":"","sources":["../../../src/forms/ToggleSwitch/ToggleSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkC,KAAK,oBAAoB,EAAyB,MAAM,OAAO,CAAA;AAK/G,OAAO,oGAAoG,CAAA;AAC3G,OAAO,iHAAiH,CAAA;AAGxH,KAAK,gBAAgB,GAAG,OAAO,GAAG,QAAQ,CAAA;AAC1C,KAAK,2BAA2B,GAAG,OAAO,GAAG,KAAK,CAAA;AAElD,KAAK,gCAAgC,GACjC,WAAW,GACX,cAAc,GACd,eAAe,GACf,UAAU,GACV,UAAU,GACV,MAAM,GACN,MAAM,CAAA;AAEV,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,gCAAgC,CAAC,GAAG;IAChH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,2BAA2B,CAAA;CAC9C,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GAAG;IAC1D,0BAA0B,CAAC,EAAE,OAAO,CAAA;CACrC,CAAA;AAQD,KAAK,qBAAqB,GAAG,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAqHxH;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;CAAiC,CAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { clsx as e } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
|
+
import { useId as t } from "../../hooks/useId.js";
|
|
3
|
+
import { Spinner as n } from "../../Spinner/Spinner.js";
|
|
4
|
+
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors-with-modes-Byi9AmE8.css';import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/toggle-switch/base-CWVI8qLT.css';/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
import r from "./ToggleSwitch.module.js";
|
|
7
|
+
import { forwardRef as i, useEffect as a, useState as o } from "react";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
//#region src/forms/ToggleSwitch/ToggleSwitch.tsx
|
|
10
|
+
var l = {
|
|
11
|
+
root: "ToggleSwitch",
|
|
12
|
+
spinner: "ToggleSwitch-spinner",
|
|
13
|
+
loadingAnnouncement: "ToggleSwitch-loading-announcement"
|
|
14
|
+
}, u = i(function({ checked: i, defaultChecked: u = !1, onChange: d, onClick: f, disabled: p = !1, loading: m = !1, size: h = "medium", loadingLabel: g = "Loading", loadingLabelDelay: _ = 2e3, spinnerPosition: v = "end", toggleSwitchSpinnerInLabel: y = !1, id: b, className: x, "aria-label": S, "aria-labelledby": C, "aria-describedby": w, "aria-invalid": T, "data-testid": E, ...D }, O) {
|
|
15
|
+
let k = t(b), A = `${k}-loading`, [j, M] = o(u), [N, P] = o(!1), F = i ?? j;
|
|
16
|
+
a(() => {
|
|
17
|
+
if (P(!1), !m) return;
|
|
18
|
+
let e = setTimeout(() => P(!0), Math.max(0, _));
|
|
19
|
+
return () => clearTimeout(e);
|
|
20
|
+
}, [m, _]);
|
|
21
|
+
let I = [w, m && N && g && A].filter(Boolean).join(" ") || void 0, L = (e) => {
|
|
22
|
+
if (p) {
|
|
23
|
+
e.preventDefault(), e.stopPropagation();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (f?.(e), e.defaultPrevented) return;
|
|
27
|
+
let t = !F;
|
|
28
|
+
i === void 0 && M(t), d?.(t);
|
|
29
|
+
}, R = !y && m ? /* @__PURE__ */ s("span", {
|
|
30
|
+
className: r["ToggleSwitch-spinnerSlot"],
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: /* @__PURE__ */ s(n, {
|
|
33
|
+
size: "small",
|
|
34
|
+
accessibleLabel: null,
|
|
35
|
+
className: r["ToggleSwitch-spinner"],
|
|
36
|
+
"data-testid": l.spinner
|
|
37
|
+
})
|
|
38
|
+
}) : null;
|
|
39
|
+
return /* @__PURE__ */ c("div", {
|
|
40
|
+
className: e(r.ToggleSwitch, r[`ToggleSwitch--${h}`], x),
|
|
41
|
+
"data-testid": E || l.root,
|
|
42
|
+
children: [
|
|
43
|
+
v === "start" && R,
|
|
44
|
+
/* @__PURE__ */ s("button", {
|
|
45
|
+
...D,
|
|
46
|
+
id: k,
|
|
47
|
+
ref: O,
|
|
48
|
+
type: "button",
|
|
49
|
+
role: "switch",
|
|
50
|
+
"aria-checked": F,
|
|
51
|
+
"aria-disabled": p || void 0,
|
|
52
|
+
"aria-busy": m || void 0,
|
|
53
|
+
"aria-label": S,
|
|
54
|
+
"aria-labelledby": C,
|
|
55
|
+
"aria-describedby": I,
|
|
56
|
+
"aria-invalid": T,
|
|
57
|
+
className: e(r["ToggleSwitch-button"], p && r["ToggleSwitch-button--unavailable"]),
|
|
58
|
+
onClick: L,
|
|
59
|
+
children: /* @__PURE__ */ s("span", {
|
|
60
|
+
className: r["ToggleSwitch-track"],
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
children: /* @__PURE__ */ s("span", { className: e(r["ToggleSwitch-thumb"], F && r["ToggleSwitch-thumb--checked"], p && r["ToggleSwitch-thumb--disabled"]) })
|
|
63
|
+
})
|
|
64
|
+
}),
|
|
65
|
+
v === "end" && R,
|
|
66
|
+
/* @__PURE__ */ s("span", {
|
|
67
|
+
id: A,
|
|
68
|
+
role: "status",
|
|
69
|
+
"aria-live": "polite",
|
|
70
|
+
"aria-atomic": "true",
|
|
71
|
+
className: "visually-hidden",
|
|
72
|
+
"data-testid": l.loadingAnnouncement,
|
|
73
|
+
children: m && N ? g : null
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
}), d = Object.assign(u, { testIds: l });
|
|
78
|
+
//#endregion
|
|
79
|
+
export { d as ToggleSwitch };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=ToggleSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.js","names":[],"sources":["../../../src/forms/ToggleSwitch/ToggleSwitch.tsx"],"sourcesContent":["import React, {forwardRef, useEffect, useState, type ButtonHTMLAttributes, type MouseEventHandler} from 'react'\nimport {clsx} from 'clsx'\nimport {useId} from '../../hooks/useId'\nimport {Spinner} from '../../Spinner/Spinner'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/toggle-switch/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors-with-modes.css'\nimport styles from './ToggleSwitch.module.css'\n\ntype ToggleSwitchSize = 'small' | 'medium'\ntype ToggleSwitchSpinnerPosition = 'start' | 'end'\n\ntype ToggleSwitchButtonPropKeysToOmit =\n | 'aria-busy'\n | 'aria-checked'\n | 'aria-disabled'\n | 'children'\n | 'onChange'\n | 'role'\n | 'type'\n\nexport type ToggleSwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, ToggleSwitchButtonPropKeysToOmit> & {\n 'data-testid'?: string\n checked?: boolean\n defaultChecked?: boolean\n onChange?: (checked: boolean) => void\n loading?: boolean\n size?: ToggleSwitchSize\n loadingLabel?: string\n loadingLabelDelay?: number\n spinnerPosition?: ToggleSwitchSpinnerPosition\n}\n\nexport type ToggleSwitchInternalProps = ToggleSwitchProps & {\n toggleSwitchSpinnerInLabel?: boolean\n}\n\nconst testIds = {\n root: 'ToggleSwitch',\n spinner: 'ToggleSwitch-spinner',\n loadingAnnouncement: 'ToggleSwitch-loading-announcement',\n}\n\ntype ToggleSwitchComponent = React.ForwardRefExoticComponent<ToggleSwitchProps & React.RefAttributes<HTMLButtonElement>>\n\nconst Root: ToggleSwitchComponent = forwardRef<HTMLButtonElement, ToggleSwitchInternalProps>(function ToggleSwitch(\n {\n checked,\n defaultChecked = false,\n onChange,\n onClick,\n disabled = false,\n loading = false,\n size = 'medium',\n loadingLabel = 'Loading',\n loadingLabelDelay = 2000,\n spinnerPosition = 'end',\n toggleSwitchSpinnerInLabel = false,\n id,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'data-testid': testId,\n ...rest\n },\n ref,\n) {\n const uniqueId = useId(id)\n const loadingId = `${uniqueId}-loading`\n const [internalChecked, setInternalChecked] = useState(defaultChecked)\n const [announceLoading, setAnnounceLoading] = useState(false)\n const isChecked = checked ?? internalChecked\n\n useEffect(() => {\n setAnnounceLoading(false)\n if (!loading) return\n\n const timeout = setTimeout(() => setAnnounceLoading(true), Math.max(0, loadingLabelDelay))\n return () => clearTimeout(timeout)\n }, [loading, loadingLabelDelay])\n\n const describedBy =\n [ariaDescribedBy, loading && announceLoading && loadingLabel && loadingId].filter(Boolean).join(' ') || undefined\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = event => {\n if (disabled) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n\n onClick?.(event)\n if (event.defaultPrevented) return\n\n const nextChecked = !isChecked\n if (checked === undefined) setInternalChecked(nextChecked)\n onChange?.(nextChecked)\n }\n\n const spinnerElement =\n !toggleSwitchSpinnerInLabel && loading ? (\n <span className={styles['ToggleSwitch-spinnerSlot']} aria-hidden=\"true\">\n <Spinner\n size=\"small\"\n accessibleLabel={null}\n className={styles['ToggleSwitch-spinner']}\n data-testid={testIds.spinner}\n />\n </span>\n ) : null\n\n return (\n <div\n className={clsx(styles.ToggleSwitch, styles[`ToggleSwitch--${size}`], className)}\n data-testid={testId || testIds.root}\n >\n {spinnerPosition === 'start' && spinnerElement}\n <button\n {...rest}\n id={uniqueId}\n ref={ref}\n type=\"button\"\n role=\"switch\"\n aria-checked={isChecked}\n aria-disabled={disabled || undefined}\n aria-busy={loading || undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={describedBy}\n aria-invalid={ariaInvalid}\n className={clsx(styles['ToggleSwitch-button'], disabled && styles['ToggleSwitch-button--unavailable'])}\n onClick={handleClick}\n >\n <span className={styles['ToggleSwitch-track']} aria-hidden=\"true\">\n <span\n className={clsx(\n styles['ToggleSwitch-thumb'],\n isChecked && styles['ToggleSwitch-thumb--checked'],\n disabled && styles['ToggleSwitch-thumb--disabled'],\n )}\n />\n </span>\n </button>\n {spinnerPosition === 'end' && spinnerElement}\n <span\n id={loadingId}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"visually-hidden\"\n data-testid={testIds.loadingAnnouncement}\n >\n {loading && announceLoading ? loadingLabel : null}\n </span>\n </div>\n )\n})\n\n/**\n * Use ToggleSwitch for settings that take effect immediately.\n * @see https://primer.style/brand/forms/ToggleSwitch\n */\nexport const ToggleSwitch = Object.assign(Root, {testIds})\n"],"mappings":";;;;;;;;;AAqCA,IAAM,IAAU;CACd,MAAM;CACN,SAAS;CACT,qBAAqB;AACvB,GAIM,IAA8B,EAAyD,SAC3F,EACE,YACA,oBAAiB,IACjB,aACA,YACA,cAAW,IACX,aAAU,IACV,UAAO,UACP,kBAAe,WACf,uBAAoB,KACpB,qBAAkB,OAClB,gCAA6B,IAC7B,OACA,cACA,cAAc,GACd,mBAAmB,GACnB,oBAAoB,GACpB,gBAAgB,GAChB,eAAe,GACf,GAAG,KAEL,GACA;CACA,IAAM,IAAW,EAAM,CAAE,GACnB,IAAY,GAAG,EAAS,WACxB,CAAC,GAAiB,KAAsB,EAAS,CAAc,GAC/D,CAAC,GAAiB,KAAsB,EAAS,EAAK,GACtD,IAAY,KAAW;CAE7B,QAAgB;EAEd,IADA,EAAmB,EAAK,GACpB,CAAC,GAAS;EAEd,IAAM,IAAU,iBAAiB,EAAmB,EAAI,GAAG,KAAK,IAAI,GAAG,CAAiB,CAAC;EACzF,aAAa,aAAa,CAAO;CACnC,GAAG,CAAC,GAAS,CAAiB,CAAC;CAE/B,IAAM,IACJ,CAAC,GAAiB,KAAW,KAAmB,KAAgB,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA,GAEpG,KAAoD,MAAS;EACjE,IAAI,GAAU;GAEZ,AADA,EAAM,eAAe,GACrB,EAAM,gBAAgB;GACtB;EACF;EAGA,IADA,IAAU,CAAK,GACX,EAAM,kBAAkB;EAE5B,IAAM,IAAc,CAAC;EAErB,AADI,MAAY,KAAA,KAAW,EAAmB,CAAW,GACzD,IAAW,CAAW;CACxB,GAEM,IACJ,CAAC,KAA8B,IAC7B,kBAAC,QAAD;EAAM,WAAW,EAAO;EAA6B,eAAY;YAC/D,kBAAC,GAAD;GACE,MAAK;GACL,iBAAiB;GACjB,WAAW,EAAO;GAClB,eAAa,EAAQ;EACtB,CAAA;CACG,CAAA,IACJ;CAEN,OACE,kBAAC,OAAD;EACE,WAAW,EAAK,EAAO,cAAc,EAAO,iBAAiB,MAAS,CAAS;EAC/E,eAAa,KAAU,EAAQ;YAFjC;GAIG,MAAoB,WAAW;GAChC,kBAAC,UAAD;IACE,GAAI;IACJ,IAAI;IACC;IACL,MAAK;IACL,MAAK;IACL,gBAAc;IACd,iBAAe,KAAY,KAAA;IAC3B,aAAW,KAAW,KAAA;IACtB,cAAY;IACZ,mBAAiB;IACjB,oBAAkB;IAClB,gBAAc;IACd,WAAW,EAAK,EAAO,wBAAwB,KAAY,EAAO,mCAAmC;IACrG,SAAS;cAET,kBAAC,QAAD;KAAM,WAAW,EAAO;KAAuB,eAAY;eACzD,kBAAC,QAAD,EACE,WAAW,EACT,EAAO,uBACP,KAAa,EAAO,gCACpB,KAAY,EAAO,+BACrB,EACD,CAAA;IACG,CAAA;GACA,CAAA;GACP,MAAoB,SAAS;GAC9B,kBAAC,QAAD;IACE,IAAI;IACJ,MAAK;IACL,aAAU;IACV,eAAY;IACZ,WAAU;IACV,eAAa,EAAQ;cAEpB,KAAW,IAAkB,IAAe;GACzC,CAAA;EACH;;AAET,CAAC,GAMY,IAAe,OAAO,OAAO,GAAM,EAAC,WAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Primer_Brand__ToggleSwitch-module__ToggleSwitch___jeVpE{align-items:center;gap:var(--brand-ToggleSwitch-loading-gap);vertical-align:middle;flex-shrink:0;display:inline-flex}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ{min-height:var(--brand-ToggleSwitch-target-minHeight);cursor:pointer;appearance:none;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:flex}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ:focus-visible{outline:none}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ:focus-visible .Primer_Brand__ToggleSwitch-module__ToggleSwitch-track___ROVFK{outline:var(--brand-ToggleSwitch-focus-width) solid var(--brand-color-focus);outline-offset:var(--brand-ToggleSwitch-focus-offset)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button--unavailable___NJjiR{cursor:not-allowed}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-track___ROVFK{box-sizing:border-box;border:var(--brand-ToggleSwitch-track-borderWidth) solid var(--brand-ToggleSwitch-track-borderColor);border-radius:var(--brand-ToggleSwitch-track-borderRadius);background:var(--brand-ToggleSwitch-track-bgColor);display:block;position:relative}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM{box-sizing:border-box;border:var(--brand-ToggleSwitch-thumb-borderWidth) solid var(--brand-ToggleSwitch-thumb-borderColor);border-radius:var(--brand-ToggleSwitch-thumb-borderRadius);background:var(--brand-ToggleSwitch-thumb-off-bgColor-rest);transition:inset-inline-start var(--brand-animation-duration-faster) var(--brand-animation-easing-default);position:absolute;top:50%;transform:translateY(-50%)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--checked___y1Okd{background:var(--brand-ToggleSwitch-thumb-on-bgColor-rest)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ:not(.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button--unavailable___NJjiR):hover .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM{background:var(--brand-ToggleSwitch-thumb-off-bgColor-hover)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ:not(.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button--unavailable___NJjiR):hover .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--checked___y1Okd{background:var(--brand-ToggleSwitch-thumb-on-bgColor-hover)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--disabled___V14xX{background:var(--brand-ToggleSwitch-thumb-disabled-bgColor)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch--medium___3nBxC .Primer_Brand__ToggleSwitch-module__ToggleSwitch-track___ROVFK{width:var(--brand-ToggleSwitch-track-width-medium);height:var(--brand-ToggleSwitch-track-height-medium)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch--small___rA6Qp .Primer_Brand__ToggleSwitch-module__ToggleSwitch-track___ROVFK{width:var(--brand-ToggleSwitch-track-width-small);height:var(--brand-ToggleSwitch-track-height-small)}.Primer_Brand__ToggleSwitch-module__ToggleSwitch--medium___3nBxC .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM{width:var(--brand-ToggleSwitch-thumb-size-medium);height:var(--brand-ToggleSwitch-thumb-size-medium);inset-inline-start:calc(var(--brand-ToggleSwitch-thumb-inset-medium) - var(--brand-ToggleSwitch-track-borderWidth))}.Primer_Brand__ToggleSwitch-module__ToggleSwitch--small___rA6Qp .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM{width:var(--brand-ToggleSwitch-thumb-size-small);height:var(--brand-ToggleSwitch-thumb-size-small);inset-inline-start:calc(var(--brand-ToggleSwitch-thumb-inset-small) - var(--brand-ToggleSwitch-track-borderWidth))}.Primer_Brand__ToggleSwitch-module__ToggleSwitch--medium___3nBxC .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--checked___y1Okd{inset-inline-start:calc(var(--brand-ToggleSwitch-thumb-inset-medium) - var(--brand-ToggleSwitch-track-borderWidth) + var(--brand-ToggleSwitch-thumb-travel-medium))}.Primer_Brand__ToggleSwitch-module__ToggleSwitch--small___rA6Qp .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--checked___y1Okd{inset-inline-start:calc(var(--brand-ToggleSwitch-thumb-inset-small) - var(--brand-ToggleSwitch-track-borderWidth) + var(--brand-ToggleSwitch-thumb-travel-small))}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-spinnerSlot___kHm79{flex:0 0 var(--brand-ToggleSwitch-loading-size);width:var(--brand-ToggleSwitch-loading-size);height:var(--brand-ToggleSwitch-loading-size);pointer-events:none;justify-content:center;align-items:center;display:flex}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-spinner___7lOlX{color:var(--brand-ToggleSwitch-loading-fgColor);animation-duration:var(--brand-ToggleSwitch-loading-duration)}@media (prefers-reduced-motion:reduce){.Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM{transition:none}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-spinner___7lOlX{animation:none}}@media (forced-colors:active){.Primer_Brand__ToggleSwitch-module__ToggleSwitch-track___ROVFK{background:canvas;border-color:buttontext}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM,.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ:not(.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button--unavailable___NJjiR):hover .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM{forced-color-adjust:none;background:buttontext;border-color:buttontext}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--checked___y1Okd,.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ:not(.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button--unavailable___NJjiR):hover .Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--checked___y1Okd{background:highlight}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--disabled___V14xX{background:graytext}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ:focus-visible .Primer_Brand__ToggleSwitch-module__ToggleSwitch-track___ROVFK{outline-color:highlight}.Primer_Brand__ToggleSwitch-module__ToggleSwitch-spinner___7lOlX{color:canvastext}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './ToggleSwitch.module-C_gXnHNW.css';//#region src/forms/ToggleSwitch/ToggleSwitch.module.css
|
|
2
|
+
var e = "Primer_Brand__ToggleSwitch-module__ToggleSwitch___jeVpE", t = {
|
|
3
|
+
ToggleSwitch: e,
|
|
4
|
+
"ToggleSwitch-button": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-button___OGPOZ",
|
|
5
|
+
"ToggleSwitch-track": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-track___ROVFK",
|
|
6
|
+
"ToggleSwitch-button--unavailable": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-button--unavailable___NJjiR",
|
|
7
|
+
"ToggleSwitch-thumb": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb___riVjM",
|
|
8
|
+
"ToggleSwitch-thumb--checked": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--checked___y1Okd",
|
|
9
|
+
"ToggleSwitch-thumb--disabled": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-thumb--disabled___V14xX",
|
|
10
|
+
"ToggleSwitch--medium": "Primer_Brand__ToggleSwitch-module__ToggleSwitch--medium___3nBxC",
|
|
11
|
+
"ToggleSwitch--small": "Primer_Brand__ToggleSwitch-module__ToggleSwitch--small___rA6Qp",
|
|
12
|
+
"ToggleSwitch-spinnerSlot": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-spinnerSlot___kHm79",
|
|
13
|
+
"ToggleSwitch-spinner": "Primer_Brand__ToggleSwitch-module__ToggleSwitch-spinner___7lOlX"
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as ToggleSwitch, t as default };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=ToggleSwitch.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.module.js","names":[],"sources":["../../../src/forms/ToggleSwitch/ToggleSwitch.module.css"],"sourcesContent":[".ToggleSwitch {\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n gap: var(--brand-ToggleSwitch-loading-gap);\n vertical-align: middle;\n}\n\n.ToggleSwitch-button {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: var(--brand-ToggleSwitch-target-minHeight);\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n appearance: none;\n}\n\n.ToggleSwitch-button:focus-visible {\n outline: none;\n}\n\n.ToggleSwitch-button:focus-visible .ToggleSwitch-track {\n outline: var(--brand-ToggleSwitch-focus-width) solid var(--brand-color-focus);\n outline-offset: var(--brand-ToggleSwitch-focus-offset);\n}\n\n.ToggleSwitch-button--unavailable {\n cursor: not-allowed;\n}\n\n.ToggleSwitch-track {\n position: relative;\n display: block;\n box-sizing: border-box;\n border: var(--brand-ToggleSwitch-track-borderWidth) solid var(--brand-ToggleSwitch-track-borderColor);\n border-radius: var(--brand-ToggleSwitch-track-borderRadius);\n background: var(--brand-ToggleSwitch-track-bgColor);\n}\n\n.ToggleSwitch-thumb {\n position: absolute;\n top: 50%;\n box-sizing: border-box;\n border: var(--brand-ToggleSwitch-thumb-borderWidth) solid var(--brand-ToggleSwitch-thumb-borderColor);\n border-radius: var(--brand-ToggleSwitch-thumb-borderRadius);\n background: var(--brand-ToggleSwitch-thumb-off-bgColor-rest);\n transform: translateY(-50%);\n transition: inset-inline-start var(--brand-animation-duration-faster) var(--brand-animation-easing-default);\n}\n\n.ToggleSwitch-thumb--checked {\n background: var(--brand-ToggleSwitch-thumb-on-bgColor-rest);\n}\n\n.ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb {\n background: var(--brand-ToggleSwitch-thumb-off-bgColor-hover);\n}\n\n.ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb--checked {\n background: var(--brand-ToggleSwitch-thumb-on-bgColor-hover);\n}\n\n.ToggleSwitch-thumb--disabled {\n background: var(--brand-ToggleSwitch-thumb-disabled-bgColor);\n}\n\n.ToggleSwitch--medium .ToggleSwitch-track {\n width: var(--brand-ToggleSwitch-track-width-medium);\n height: var(--brand-ToggleSwitch-track-height-medium);\n}\n\n.ToggleSwitch--small .ToggleSwitch-track {\n width: var(--brand-ToggleSwitch-track-width-small);\n height: var(--brand-ToggleSwitch-track-height-small);\n}\n\n.ToggleSwitch--medium .ToggleSwitch-thumb {\n inset-inline-start: calc(var(--brand-ToggleSwitch-thumb-inset-medium) - var(--brand-ToggleSwitch-track-borderWidth));\n width: var(--brand-ToggleSwitch-thumb-size-medium);\n height: var(--brand-ToggleSwitch-thumb-size-medium);\n}\n\n.ToggleSwitch--small .ToggleSwitch-thumb {\n inset-inline-start: calc(var(--brand-ToggleSwitch-thumb-inset-small) - var(--brand-ToggleSwitch-track-borderWidth));\n width: var(--brand-ToggleSwitch-thumb-size-small);\n height: var(--brand-ToggleSwitch-thumb-size-small);\n}\n\n.ToggleSwitch--medium .ToggleSwitch-thumb--checked {\n inset-inline-start: calc(\n var(--brand-ToggleSwitch-thumb-inset-medium) - var(--brand-ToggleSwitch-track-borderWidth) +\n var(--brand-ToggleSwitch-thumb-travel-medium)\n );\n}\n\n.ToggleSwitch--small .ToggleSwitch-thumb--checked {\n inset-inline-start: calc(\n var(--brand-ToggleSwitch-thumb-inset-small) - var(--brand-ToggleSwitch-track-borderWidth) +\n var(--brand-ToggleSwitch-thumb-travel-small)\n );\n}\n\n.ToggleSwitch-spinnerSlot {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 var(--brand-ToggleSwitch-loading-size);\n width: var(--brand-ToggleSwitch-loading-size);\n height: var(--brand-ToggleSwitch-loading-size);\n pointer-events: none;\n}\n\n.ToggleSwitch-spinner {\n color: var(--brand-ToggleSwitch-loading-fgColor);\n animation-duration: var(--brand-ToggleSwitch-loading-duration);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ToggleSwitch-thumb {\n transition: none;\n }\n\n .ToggleSwitch-spinner {\n animation: none;\n }\n}\n\n@media (forced-colors: active) {\n .ToggleSwitch-track {\n border-color: ButtonText;\n background: Canvas;\n }\n\n .ToggleSwitch-thumb,\n .ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb {\n forced-color-adjust: none;\n border-color: ButtonText;\n background: ButtonText;\n }\n\n .ToggleSwitch-thumb--checked,\n .ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb--checked {\n background: Highlight;\n }\n\n .ToggleSwitch-thumb--disabled {\n background: GrayText;\n }\n\n .ToggleSwitch-button:focus-visible .ToggleSwitch-track {\n outline-color: Highlight;\n }\n\n .ToggleSwitch-spinner {\n color: CanvasText;\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/ToggleSwitch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,YAAY,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAA"}
|
package/esm/forms/index.d.ts
CHANGED
package/esm/forms/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
|
package/esm/index.d.ts
CHANGED
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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