@primer/react-brand 0.79.1-rc.5d6b749b → 0.80.0-rc.e1dc6447
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/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/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/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/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/functional/components/control/colors-with-modes-ChBPnVuN.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/spinner/base-BUCpHNCY.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes-izIk82NS.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-Ctf2MPJ3.css +1 -0
- package/lib/Spinner/Spinner.d.ts +10 -0
- package/lib/Spinner/index.d.ts +2 -0
- package/lib/css/main.css +423 -103
- package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/base/colors/light.css +1 -1
- package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
- package/lib/design-tokens/css/tokens/functional/animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/bento/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/blinking-cursor/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/comparison-table.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +3 -1
- package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/eyebrow-banner.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/faq.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/feature-comparison-table/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/feature-comparison-table/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon-button/base.css +3 -3
- package/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes.css +1 -1
- 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 +1 -1
- package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-code/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-code/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/river.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/spinner/base.css +12 -0
- package/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes.css +13 -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 +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/toggle-switch/base.css +30 -0
- package/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors-with-modes.css +29 -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 +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/viewport.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
- package/lib/design-tokens/js/module/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/button/base.js +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/forms/FormControl/FormControl.module-CSNT689n.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/icon-button/base-DLPw97mz.css +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Spinner
|
|
3
|
+
description: Use a spinner to indicate that content or an action is loading.
|
|
4
|
+
source: https://github.com/primer/brand/blob/main/packages/react/src/Spinner/Spinner.tsx
|
|
5
|
+
keywords: ['loading', 'progress', 'status', 'spinner']
|
|
6
|
+
storybook: '/brand/storybook/?path=/story/components-spinner--playground'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import {Spinner} from '@primer/react-brand'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Default
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
<Spinner />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Sizes
|
|
22
|
+
|
|
23
|
+
Use a named size or a number of CSS pixels for a custom size.
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
<Stack direction="horizontal" alignItems="center" gap="spacious">
|
|
27
|
+
<Spinner size="small" />
|
|
28
|
+
<Spinner size="medium" />
|
|
29
|
+
<Spinner size="large" />
|
|
30
|
+
<Spinner size={32} />
|
|
31
|
+
</Stack>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Custom accessible label
|
|
35
|
+
|
|
36
|
+
Use a concise label that describes the pending operation. Set `accessibleLabel` to `null` only when a parent component already communicates the loading state to assistive technologies.
|
|
37
|
+
|
|
38
|
+
```jsx
|
|
39
|
+
<Spinner accessibleLabel="Loading notification settings" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Accessibility
|
|
43
|
+
|
|
44
|
+
`Spinner` is non-interactive, and its SVG is hidden from assistive technologies. Use `accessibleLabel` to provide equivalent visually hidden loading text.
|
|
45
|
+
|
|
46
|
+
Do not rely on Spinner alone to communicate loading. It should be used as part of a broader loading state UI, which announces progress through a persistent `role="status"` or `aria-live` region.
|
|
47
|
+
|
|
48
|
+
When available, prefer a component's built-in loading behavior. Components such as [ToggleSwitch](../../forms/ToggleSwitch/index.md) and [IconButton](../IconButton/index.md) already provide the appropriate semantics and announcements.
|
|
49
|
+
|
|
50
|
+
## Component Props
|
|
51
|
+
|
|
52
|
+
| Name | Type | Default | Description |
|
|
53
|
+
| ----------------- | ------------------------------------------ | ----------- | -------------------------------------------------------------------------------- |
|
|
54
|
+
| `size` | `'small' \| 'medium' \| 'large' \| number` | `'medium'` | Named size or custom dimensions in CSS pixels. |
|
|
55
|
+
| `accessibleLabel` | `string \| null` | `'Loading'` | Visually hidden loading text. Use `null` when loading is communicated elsewhere. |
|
|
56
|
+
| `className` | `string` | | Class applied to the animated SVG. |
|
package/docs/components/index.md
CHANGED
|
@@ -44,6 +44,7 @@ description: Primer Brand UI components
|
|
|
44
44
|
- [Section](Section/react.md): Use the section component to group related content together.
|
|
45
45
|
- [Section intro](SectionIntro/react.md): Use the section intro component to provide a title, optional description and link to a new section in the page.
|
|
46
46
|
- [Section intro stacked](SectionIntroStacked/index.md): Use this section intro component to provide a heading, link and itemized content in a stacked layout.
|
|
47
|
+
- [Spinner](Spinner/index.md): Use a spinner to indicate that content or an action is loading.
|
|
47
48
|
- [Statistic](Statistic/index.md): Use the statistic component display concise numerical information
|
|
48
49
|
- [Sub nav](SubNav/index.md): A sub nav is a secondary navigation element, typically positioned beneath a primary navigation.
|
|
49
50
|
- [Subdomain nav bar](SubdomainNavBar/index.md): Use the subdomain nav bar component for top level navigation for subdomain sites.
|
|
@@ -56,6 +56,11 @@ import {FormControl} from '@primer/react-brand'
|
|
|
56
56
|
<FormControl.Label>Textarea</FormControl.Label>
|
|
57
57
|
<Textarea />
|
|
58
58
|
</FormControl>
|
|
59
|
+
{/* ToggleSwitch */}
|
|
60
|
+
<FormControl>
|
|
61
|
+
<FormControl.Label>Enable notifications</FormControl.Label>
|
|
62
|
+
<ToggleSwitch />
|
|
63
|
+
</FormControl>
|
|
59
64
|
</Stack>
|
|
60
65
|
```
|
|
61
66
|
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ToggleSwitch
|
|
3
|
+
description: Use a toggle switch for a boolean setting that takes effect immediately.
|
|
4
|
+
source: https://github.com/primer/brand/blob/main/packages/react/src/forms/ToggleSwitch/ToggleSwitch.tsx
|
|
5
|
+
keywords: ['form', 'control', 'switch', 'toggle', 'setting']
|
|
6
|
+
figma: 'https://www.figma.com/design/hUT1gnfCRTX7iPZSjOg8Vp/?node-id=7985-43209'
|
|
7
|
+
storybook: '/brand/storybook/?path=/story/components-forms-toggleswitch--playground'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import {ToggleSwitch} from '@primer/react-brand'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
### Default
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
<FormControl>
|
|
20
|
+
<FormControl.Label>Enable notifications</FormControl.Label>
|
|
21
|
+
<ToggleSwitch />
|
|
22
|
+
</FormControl>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Uncontrolled
|
|
26
|
+
|
|
27
|
+
`defaultChecked` sets the initial value. `onChange` receives the next boolean value, not a native change event.
|
|
28
|
+
|
|
29
|
+
```jsx
|
|
30
|
+
<FormControl>
|
|
31
|
+
<FormControl.Label>Automatically watch repositories</FormControl.Label>
|
|
32
|
+
<ToggleSwitch defaultChecked />
|
|
33
|
+
</FormControl>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Controlled
|
|
37
|
+
|
|
38
|
+
```jsx filename="noinline"
|
|
39
|
+
function Example() {
|
|
40
|
+
const [checked, setChecked] = React.useState(false)
|
|
41
|
+
return (
|
|
42
|
+
<FormControl>
|
|
43
|
+
<FormControl.Label>Automatically watch repositories</FormControl.Label>
|
|
44
|
+
<ToggleSwitch checked={checked} onChange={setChecked} />
|
|
45
|
+
</FormControl>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
render(Example)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Sizes
|
|
53
|
+
|
|
54
|
+
```jsx
|
|
55
|
+
<Stack direction="horizontal">
|
|
56
|
+
<FormControl>
|
|
57
|
+
<FormControl.Label>Small</FormControl.Label>
|
|
58
|
+
<ToggleSwitch size="small" />
|
|
59
|
+
</FormControl>
|
|
60
|
+
<FormControl>
|
|
61
|
+
<FormControl.Label>Medium</FormControl.Label>
|
|
62
|
+
<ToggleSwitch />
|
|
63
|
+
</FormControl>
|
|
64
|
+
</Stack>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Disabled
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
<FormControl>
|
|
71
|
+
<FormControl.Label>Enable notifications</FormControl.Label>
|
|
72
|
+
<ToggleSwitch defaultChecked disabled />
|
|
73
|
+
<FormControl.Hint>Notification settings are managed by your organization.</FormControl.Hint>
|
|
74
|
+
</FormControl>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Without `FormControl`
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
<Stack direction="horizontal" alignItems="center" gap="normal">
|
|
81
|
+
<Text as="span" id="notification-setting-label">
|
|
82
|
+
Enable notifications
|
|
83
|
+
</Text>
|
|
84
|
+
<ToggleSwitch aria-labelledby="notification-setting-label" />
|
|
85
|
+
</Stack>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Visually hidden label with `FormControl`
|
|
89
|
+
|
|
90
|
+
```jsx
|
|
91
|
+
<Stack gap="normal" direction="horizontal">
|
|
92
|
+
<Text as="span" id="visible-notification-label">
|
|
93
|
+
Enable notifications
|
|
94
|
+
</Text>
|
|
95
|
+
<FormControl>
|
|
96
|
+
<FormControl.Label visuallyHidden>Enable notifications</FormControl.Label>
|
|
97
|
+
<ToggleSwitch aria-labelledby="visible-notification-label" />
|
|
98
|
+
</FormControl>
|
|
99
|
+
</Stack>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Component Props
|
|
103
|
+
|
|
104
|
+
| Name | Type | Default | Description |
|
|
105
|
+
| ------------------- | -------------------------------------------- | ----------- | ------------------------------------------------------------------------------------- |
|
|
106
|
+
| `checked` | `boolean` | | Controlled on/off value. |
|
|
107
|
+
| `defaultChecked` | `boolean` | `false` | Initial uncontrolled value. |
|
|
108
|
+
| `onChange` | `(checked: boolean) => void` | | Called once per accepted activation with the next value. |
|
|
109
|
+
| `onClick` | `React.MouseEventHandler<HTMLButtonElement>` | | Activation callback receiving the button event. |
|
|
110
|
+
| `disabled` | `boolean` | `false` | Blocks activation while retaining keyboard focusability. |
|
|
111
|
+
| `loading` | `boolean` | `false` | Displays pending feedback and exposes `aria-busy` without blocking interaction. |
|
|
112
|
+
| `size` | `'small' \| 'medium'` | `'medium'` | Alternative sizes. |
|
|
113
|
+
| `loadingLabel` | `string` | `'Loading'` | Localized loading announcement. |
|
|
114
|
+
| `loadingLabelDelay` | `number` | `2000` | Announcement delay in milliseconds. |
|
|
115
|
+
| `spinnerPosition` | `'start' \| 'end'` | `'end'` | Indicator placement beside the switch when no visible FormControl label is available. |
|
|
116
|
+
| `aria-label` | `string` | | Explicit accessible name matching equivalent visible labeling. |
|
|
117
|
+
| `aria-labelledby` | `string` | | IDs of visible labeling elements. |
|
|
118
|
+
| `aria-describedby` | `string` | | Description IDs, combined with FormControl and loading descriptions. |
|
|
119
|
+
| `aria-invalid` | React ARIA attribute | | Validation state of the switch button. |
|
|
120
|
+
| `ref` | `React.Ref<HTMLButtonElement>` | | Ref for the focusable button. |
|
|
121
|
+
| `className` | `string` | | Class applied to the component wrapper. |
|
|
122
|
+
| `data-testid` | `string` | | Test ID applied to the component wrapper. |
|
|
123
|
+
|
|
124
|
+
Other standard button attributes, including `aria-controls`, `tabIndex`, keyboard handlers, and `style`, apply to the switch button.
|
|
125
|
+
|
|
126
|
+
## Related Components
|
|
127
|
+
|
|
128
|
+
- [FormControl](../FormControl/index.md)
|
|
129
|
+
- [Checkbox](../Checkbox/index.md)
|
package/docs/forms/index.md
CHANGED
|
@@ -12,3 +12,4 @@ title: Forms
|
|
|
12
12
|
- [Select](Select/index.md): Use the select component to enable selection of one option from a list.
|
|
13
13
|
- [Text input](TextInput/index.md): Use the text input component for single-line text field.
|
|
14
14
|
- [Textarea](TextArea/index.md): Use the textarea component for multi-line text input form fields.
|
|
15
|
+
- [ToggleSwitch](ToggleSwitch/index.md): Use a toggle switch for a boolean setting that takes effect immediately.
|
package/docs/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Primer Brand docs (v0.
|
|
1
|
+
# Primer Brand docs (v0.80.0-rc.e1dc6447)
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@primer/react-brand@0.
|
|
3
|
+
These docs are bundled with `@primer/react-brand@0.80.0-rc.e1dc6447` and match your installed version.
|
|
4
4
|
|
|
5
5
|
New here? Start with [Getting started](getting-started/index.md) for installation, global
|
|
6
6
|
stylesheet and font setup. Component directories are named after their import (e.g.
|
|
@@ -78,6 +78,7 @@ stylesheet and font setup. Component directories are named after their import (e
|
|
|
78
78
|
- [Section](components/Section/react.md): Use the section component to group related content together.
|
|
79
79
|
- [Section intro](components/SectionIntro/react.md): Use the section intro component to provide a title, optional description and link to a new section in the page.
|
|
80
80
|
- [Section intro stacked](components/SectionIntroStacked/index.md): Use this section intro component to provide a heading, link and itemized content in a stacked layout.
|
|
81
|
+
- [Spinner](components/Spinner/index.md): Use a spinner to indicate that content or an action is loading.
|
|
81
82
|
- [Statistic](components/Statistic/index.md): Use the statistic component display concise numerical information
|
|
82
83
|
- [Sub nav](components/SubNav/index.md): A sub nav is a secondary navigation element, typically positioned beneath a primary navigation.
|
|
83
84
|
- [Subdomain nav bar](components/SubdomainNavBar/index.md): Use the subdomain nav bar component for top level navigation for subdomain sites.
|
|
@@ -101,3 +102,4 @@ stylesheet and font setup. Component directories are named after their import (e
|
|
|
101
102
|
- [Select](forms/Select/index.md): Use the select component to enable selection of one option from a list.
|
|
102
103
|
- [Text input](forms/TextInput/index.md): Use the text input component for single-line text field.
|
|
103
104
|
- [Textarea](forms/TextArea/index.md): Use the textarea component for multi-line text input form fields.
|
|
105
|
+
- [ToggleSwitch](forms/ToggleSwitch/index.md): Use a toggle switch for a boolean setting that takes effect immediately.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6B,MAAM,OAAO,CAAA;AACjD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAA;AAUhD,OAAO,EAA0B,KAAK,gBAAgB,EAAC,MAAM,YAAY,CAAA;AACzE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6B,MAAM,OAAO,CAAA;AACjD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAA;AAUhD,OAAO,EAA0B,KAAK,gBAAgB,EAAC,MAAM,YAAY,CAAA;AACzE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAGnD,OAAO,kGAAkG,CAAA;AACzG,OAAO,+GAA+G,CAAA;AAGtH,eAAO,MAAM,kBAAkB,oEAAsD,CAAA;AACrF,eAAO,MAAM,eAAe,uCAA4B,CAAA;AACxD,eAAO,MAAM,wBAAwB,aAAuB,CAAA;AAC5D,eAAO,MAAM,qBAAqB,UAAoB,CAAA;AAEtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AACnE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7D,KAAK,mBAAmB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG;IAClF,EAAE,CAAC,EAAE,CAAC,CAAA;IACN,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,mBAAmB,CAAC,CAAC,CAAC,GAC1F,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,mBAAmB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAA;AAYpF,KAAK,mBAAmB,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAChE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAC/D,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;AAwG9B,eAAO,MAAM,UAAU,EAAiC,mBAAmB,CAAA"}
|
|
@@ -1,68 +1,70 @@
|
|
|
1
1
|
import { clsx as e } from "../node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { Button as t, ButtonSizes as n, ButtonVariants as r, defaultButtonSize as i, defaultButtonVariant as a } from "../Button/Button.js";
|
|
3
3
|
import { Tooltip as o, TooltipContext as s } from "../Tooltip/Tooltip.js";
|
|
4
|
-
import
|
|
4
|
+
import { Spinner as c } from "../Spinner/Spinner.js";
|
|
5
|
+
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes-D7iaptsa.css';import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/icon-button/base-_lTjJKpQ.css';/* empty css */
|
|
5
6
|
/* empty css */
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Fragment as
|
|
7
|
+
import l from "./IconButton.module.js";
|
|
8
|
+
import u, { forwardRef as d } from "react";
|
|
9
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
10
|
//#region src/IconButton/IconButton.tsx
|
|
10
|
-
var
|
|
11
|
+
var h = [
|
|
11
12
|
...r,
|
|
12
13
|
"danger",
|
|
13
14
|
"invisible"
|
|
14
|
-
],
|
|
15
|
+
], g = [...n], _ = a, v = i, y = {
|
|
15
16
|
root: "IconButton",
|
|
16
|
-
get
|
|
17
|
-
return `${this.root}-
|
|
17
|
+
get spinner() {
|
|
18
|
+
return `${this.root}-spinner`;
|
|
18
19
|
},
|
|
19
20
|
get loadingAnnouncement() {
|
|
20
21
|
return `${this.root}-loading-announcement`;
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
|
-
function
|
|
24
|
-
let { tooltipId:
|
|
24
|
+
function b({ as: n, icon: r, "aria-label": i, description: a, loading: d = !1, loadingAnnouncement: h = "Loading", rounded: g = !1, tooltipDirection: b = "s", size: x = v, variant: S = _, inactive: C = !1, disabled: w, className: T, onClick: E, "aria-disabled": D, "aria-expanded": O, "aria-haspopup": k, "data-testid": A, ...j }, M) {
|
|
25
|
+
let { tooltipId: N } = u.useContext(s), P = d && !w, F = C && !w && !P, I = !w && !N, L = a || i, R = S === "danger" ? "secondary" : S === "invisible" ? "subtle" : S;
|
|
25
26
|
process.env.NODE_ENV !== "production" && (i.trim() || console.warn("IconButton requires a non-empty `aria-label`."), [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
w,
|
|
28
|
+
d,
|
|
29
|
+
C
|
|
29
30
|
].filter(Boolean).length > 1 && console.warn("IconButton has conflicting props for `disabled`, `loading`, or `inactive` states."));
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
let z = P ? /* @__PURE__ */ p(c, {
|
|
32
|
+
accessibleLabel: null,
|
|
33
|
+
className: l.IconButton__spinner,
|
|
34
|
+
"data-testid": y.spinner
|
|
35
|
+
}) : /* @__PURE__ */ p(r, { className: l.IconButton__icon }), B = /* @__PURE__ */ p(t, {
|
|
36
|
+
...j,
|
|
37
|
+
ref: I ? void 0 : M,
|
|
36
38
|
as: n,
|
|
37
|
-
variant:
|
|
38
|
-
size:
|
|
39
|
-
disabled:
|
|
40
|
-
"aria-disabled":
|
|
41
|
-
"aria-expanded":
|
|
42
|
-
"aria-haspopup":
|
|
43
|
-
"aria-label": !
|
|
44
|
-
className: e(
|
|
45
|
-
"data-testid":
|
|
46
|
-
leadingVisual:
|
|
47
|
-
onClick:
|
|
39
|
+
variant: R,
|
|
40
|
+
size: x,
|
|
41
|
+
disabled: w,
|
|
42
|
+
"aria-disabled": P || F ? !0 : D,
|
|
43
|
+
"aria-expanded": O,
|
|
44
|
+
"aria-haspopup": k,
|
|
45
|
+
"aria-label": !I || a ? i : void 0,
|
|
46
|
+
className: e(l.IconButton, l[`IconButton--${x}`], l[`IconButton--variant-${S}`], F && l["IconButton--inactive"], g && l["IconButton--rounded"], T),
|
|
47
|
+
"data-testid": A || y.root,
|
|
48
|
+
leadingVisual: z,
|
|
49
|
+
onClick: P ? (e) => {
|
|
48
50
|
e.preventDefault(), e.stopPropagation();
|
|
49
|
-
} :
|
|
51
|
+
} : E
|
|
50
52
|
});
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
ref:
|
|
53
|
-
direction:
|
|
54
|
-
text:
|
|
53
|
+
return /* @__PURE__ */ m(f, { children: [I ? /* @__PURE__ */ p(o, {
|
|
54
|
+
ref: M,
|
|
55
|
+
direction: b,
|
|
56
|
+
text: L,
|
|
55
57
|
type: a ? "description" : "label",
|
|
56
|
-
children:
|
|
57
|
-
}) :
|
|
58
|
+
children: B
|
|
59
|
+
}) : B, /* @__PURE__ */ p("span", {
|
|
58
60
|
"aria-live": "polite",
|
|
59
|
-
className:
|
|
60
|
-
"data-testid":
|
|
61
|
-
children:
|
|
61
|
+
className: l.IconButton__loadingAnnouncement,
|
|
62
|
+
"data-testid": y.loadingAnnouncement,
|
|
63
|
+
children: P ? h : null
|
|
62
64
|
})] });
|
|
63
65
|
}
|
|
64
|
-
var
|
|
66
|
+
var x = d(b);
|
|
65
67
|
//#endregion
|
|
66
|
-
export {
|
|
68
|
+
export { x as IconButton, g as IconButtonSizes, h as IconButtonVariants, v as defaultIconButtonSize, _ as defaultIconButtonVariant };
|
|
67
69
|
|
|
68
70
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","names":[],"sources":["../../src/IconButton/IconButton.tsx"],"sourcesContent":["import {clsx} from 'clsx'\nimport React, {forwardRef, type Ref} from 'react'\nimport type {Icon} from '@primer/octicons-react'\n\nimport {\n Button,\n ButtonSizes,\n ButtonVariants,\n defaultButtonSize,\n defaultButtonVariant,\n type ButtonVariant,\n} from '../Button'\nimport {Tooltip, TooltipContext, type TooltipDirection} from '../Tooltip'\nimport type {BaseProps} from '../component-helpers'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/icon-button/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes.css'\nimport styles from './IconButton.module.css'\n\nexport const IconButtonVariants = [...ButtonVariants, 'danger', 'invisible'] as const\nexport const IconButtonSizes = [...ButtonSizes] as const\nexport const defaultIconButtonVariant = defaultButtonVariant\nexport const defaultIconButtonSize = defaultButtonSize\n\nexport type IconButtonVariant = (typeof IconButtonVariants)[number]\nexport type IconButtonSize = (typeof IconButtonSizes)[number]\n\ntype IconButtonBaseProps<C extends React.ElementType> = Omit<BaseProps<C>, 'ref'> & {\n as?: C\n variant?: IconButtonVariant\n icon: Icon\n 'aria-label': string\n description?: string\n inactive?: boolean\n loading?: boolean\n loadingAnnouncement?: string\n rounded?: boolean\n size?: IconButtonSize\n tooltipDirection?: TooltipDirection\n}\n\nexport type IconButtonProps<C extends React.ElementType = 'button'> = IconButtonBaseProps<C> &\n Omit<React.ComponentPropsWithoutRef<C>, keyof IconButtonBaseProps<C> | 'children'>\n\nconst iconButtonTestIds = {\n root: 'IconButton',\n get
|
|
1
|
+
{"version":3,"file":"IconButton.js","names":[],"sources":["../../src/IconButton/IconButton.tsx"],"sourcesContent":["import {clsx} from 'clsx'\nimport React, {forwardRef, type Ref} from 'react'\nimport type {Icon} from '@primer/octicons-react'\n\nimport {\n Button,\n ButtonSizes,\n ButtonVariants,\n defaultButtonSize,\n defaultButtonVariant,\n type ButtonVariant,\n} from '../Button'\nimport {Tooltip, TooltipContext, type TooltipDirection} from '../Tooltip'\nimport type {BaseProps} from '../component-helpers'\nimport {Spinner} from '../Spinner/Spinner'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/icon-button/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes.css'\nimport styles from './IconButton.module.css'\n\nexport const IconButtonVariants = [...ButtonVariants, 'danger', 'invisible'] as const\nexport const IconButtonSizes = [...ButtonSizes] as const\nexport const defaultIconButtonVariant = defaultButtonVariant\nexport const defaultIconButtonSize = defaultButtonSize\n\nexport type IconButtonVariant = (typeof IconButtonVariants)[number]\nexport type IconButtonSize = (typeof IconButtonSizes)[number]\n\ntype IconButtonBaseProps<C extends React.ElementType> = Omit<BaseProps<C>, 'ref'> & {\n as?: C\n variant?: IconButtonVariant\n icon: Icon\n 'aria-label': string\n description?: string\n inactive?: boolean\n loading?: boolean\n loadingAnnouncement?: string\n rounded?: boolean\n size?: IconButtonSize\n tooltipDirection?: TooltipDirection\n}\n\nexport type IconButtonProps<C extends React.ElementType = 'button'> = IconButtonBaseProps<C> &\n Omit<React.ComponentPropsWithoutRef<C>, keyof IconButtonBaseProps<C> | 'children'>\n\nconst iconButtonTestIds = {\n root: 'IconButton',\n get spinner() {\n return `${this.root}-spinner`\n },\n get loadingAnnouncement() {\n return `${this.root}-loading-announcement`\n },\n}\n\ntype IconButtonComponent = <C extends React.ElementType = 'button'>(\n props: IconButtonProps<C> & React.RefAttributes<HTMLButtonElement>,\n) => React.ReactElement | null\n\nfunction IconButtonRoot(\n {\n as,\n icon: IconComponent,\n 'aria-label': ariaLabel,\n description,\n loading = false,\n loadingAnnouncement = 'Loading',\n rounded = false,\n tooltipDirection = 's',\n size = defaultIconButtonSize,\n variant = defaultIconButtonVariant,\n inactive = false,\n disabled,\n className,\n onClick,\n 'aria-disabled': ariaDisabled,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'data-testid': testId,\n ...props\n }: React.PropsWithoutRef<IconButtonProps<React.ElementType>>,\n ref: Ref<HTMLButtonElement>,\n) {\n const {tooltipId: externalTooltipId} = React.useContext(TooltipContext)\n const isLoading = loading && !disabled\n const isInactive = inactive && !disabled && !isLoading\n const shouldRenderTooltip = !disabled && !externalTooltipId\n const tooltipText = description || ariaLabel\n const buttonVariant: ButtonVariant = variant === 'danger' ? 'secondary' : variant === 'invisible' ? 'subtle' : variant\n\n if (process.env.NODE_ENV !== 'production') {\n if (!ariaLabel.trim()) {\n // eslint-disable-next-line no-console\n console.warn('IconButton requires a non-empty `aria-label`.')\n }\n\n if ([disabled, loading, inactive].filter(Boolean).length > 1) {\n // eslint-disable-next-line no-console\n console.warn('IconButton has conflicting props for `disabled`, `loading`, or `inactive` states.')\n }\n }\n\n const ButtonIcon = isLoading ? (\n <Spinner accessibleLabel={null} className={styles.IconButton__spinner} data-testid={iconButtonTestIds.spinner} />\n ) : (\n <IconComponent className={styles.IconButton__icon} />\n )\n\n const ButtonElement = (\n <Button\n {...props}\n ref={shouldRenderTooltip ? undefined : ref}\n as={as}\n variant={buttonVariant}\n size={size}\n disabled={disabled}\n aria-disabled={isLoading || isInactive ? true : ariaDisabled}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={!shouldRenderTooltip || description ? ariaLabel : undefined}\n className={clsx(\n styles.IconButton,\n styles[`IconButton--${size}`],\n styles[`IconButton--variant-${variant}`],\n isInactive && styles['IconButton--inactive'],\n rounded && styles['IconButton--rounded'],\n className,\n )}\n data-testid={testId || iconButtonTestIds.root}\n leadingVisual={ButtonIcon}\n onClick={\n isLoading\n ? event => {\n event.preventDefault()\n event.stopPropagation()\n }\n : onClick\n }\n />\n )\n\n return (\n <>\n {shouldRenderTooltip ? (\n <Tooltip ref={ref} direction={tooltipDirection} text={tooltipText} type={description ? 'description' : 'label'}>\n {ButtonElement}\n </Tooltip>\n ) : (\n ButtonElement\n )}\n <span\n aria-live=\"polite\"\n className={styles.IconButton__loadingAnnouncement}\n data-testid={iconButtonTestIds.loadingAnnouncement}\n >\n {isLoading ? loadingAnnouncement : null}\n </span>\n </>\n )\n}\n\nexport const IconButton = forwardRef(IconButtonRoot) as IconButtonComponent\n"],"mappings":";;;;;;;;;;AAoBA,IAAa,IAAqB;CAAC,GAAG;CAAgB;CAAU;AAAW,GAC9D,IAAkB,CAAC,GAAG,CAAW,GACjC,IAA2B,GAC3B,IAAwB,GAsB/B,IAAoB;CACxB,MAAM;CACN,IAAI,UAAU;EACZ,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,sBAAsB;EACxB,OAAO,GAAG,KAAK,KAAK;CACtB;AACF;AAMA,SAAS,EACP,EACE,OACA,MAAM,GACN,cAAc,GACd,gBACA,aAAU,IACV,yBAAsB,WACtB,aAAU,IACV,sBAAmB,KACnB,UAAO,GACP,aAAU,GACV,cAAW,IACX,aACA,cACA,YACA,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,GAAG,KAEL,GACA;CACA,IAAM,EAAC,WAAW,MAAqB,EAAM,WAAW,CAAc,GAChE,IAAY,KAAW,CAAC,GACxB,IAAa,KAAY,CAAC,KAAY,CAAC,GACvC,IAAsB,CAAC,KAAY,CAAC,GACpC,IAAc,KAAe,GAC7B,IAA+B,MAAY,WAAW,cAAc,MAAY,cAAc,WAAW;CAE/G,AAAA,QAAA,IAAA,aAA6B,iBACtB,EAAU,KAAK,KAElB,QAAQ,KAAK,+CAA+C,GAG1D;EAAC;EAAU;EAAS;CAAQ,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,SAAS,KAEzD,QAAQ,KAAK,mFAAmF;CAIpG,IAAM,IAAa,IACjB,kBAAC,GAAD;EAAS,iBAAiB;EAAM,WAAW,EAAO;EAAqB,eAAa,EAAkB;CAAU,CAAA,IAEhH,kBAAC,GAAD,EAAe,WAAW,EAAO,iBAAmB,CAAA,GAGhD,IACJ,kBAAC,GAAD;EACE,GAAI;EACJ,KAAK,IAAsB,KAAA,IAAY;EACnC;EACJ,SAAS;EACH;EACI;EACV,iBAAe,KAAa,IAAa,KAAO;EAChD,iBAAe;EACf,iBAAe;EACf,cAAY,CAAC,KAAuB,IAAc,IAAY,KAAA;EAC9D,WAAW,EACT,EAAO,YACP,EAAO,eAAe,MACtB,EAAO,uBAAuB,MAC9B,KAAc,EAAO,yBACrB,KAAW,EAAO,wBAClB,CACF;EACA,eAAa,KAAU,EAAkB;EACzC,eAAe;EACf,SACE,KACI,MAAS;GAEP,AADA,EAAM,eAAe,GACrB,EAAM,gBAAgB;EACxB,IACA;CAEP,CAAA;CAGH,OACE,kBAAA,GAAA,EAAA,UAAA,CACG,IACC,kBAAC,GAAD;EAAc;EAAK,WAAW;EAAkB,MAAM;EAAa,MAAM,IAAc,gBAAgB;YACpG;CACM,CAAA,IAET,GAEF,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EAAO;EAClB,eAAa,EAAkB;YAE9B,IAAY,IAAsB;CAC/B,CAAA,CACN,EAAA,CAAA;AAEN;AAEA,IAAa,IAAa,EAAW,CAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Primer_Brand__IconButton-module__IconButton___68DKi{flex:none;gap:0;padding:0}.Primer_Brand__IconButton-module__IconButton___68DKi.Primer_Brand__IconButton-module__IconButton___68DKi{min-width:var(--brand-IconButton-control-size-medium);width:var(--brand-IconButton-control-size-medium);height:var(--brand-IconButton-control-size-medium)}.Primer_Brand__IconButton-module__IconButton--small___KXgb_.Primer_Brand__IconButton-module__IconButton--small___KXgb_{min-width:var(--brand-IconButton-control-size-small);width:var(--brand-IconButton-control-size-small);height:var(--brand-IconButton-control-size-small)}.Primer_Brand__IconButton-module__IconButton--large___ypAna.Primer_Brand__IconButton-module__IconButton--large___ypAna{min-width:var(--brand-IconButton-control-size-large);width:var(--brand-IconButton-control-size-large);height:var(--brand-IconButton-control-size-large)}.Primer_Brand__IconButton-module__IconButton--rounded___g_ngl.Primer_Brand__IconButton-module__IconButton--rounded___g_ngl{border-radius:var(--brand-borderRadius-full)}.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true]){color:var(--brand-IconButton-danger-fgColor-rest);background-color:var(--brand-IconButton-danger-bgColor-rest);border-color:var(--brand-IconButton-danger-borderColor-rest)}.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true]):not([aria-expanded=true]):hover{color:var(--brand-IconButton-danger-fgColor-hover);background-color:var(--brand-IconButton-danger-bgColor-hover);border-color:var(--brand-IconButton-danger-borderColor-hover)}.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true]):active,.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true])[aria-expanded=true]{color:var(--brand-IconButton-danger-fgColor-active);background-color:var(--brand-IconButton-danger-bgColor-active);border-color:var(--brand-IconButton-danger-borderColor-active)}.Primer_Brand__IconButton-module__IconButton--variant-invisible___gp_QC.Primer_Brand__IconButton-module__IconButton--variant-invisible___gp_QC:where(:not(:hover):not(:active):not([aria-expanded=true])){background-color:var(--brand-IconButton-invisible-bgColor-rest);border-color:var(--brand-IconButton-invisible-borderColor-rest);-webkit-backdrop-filter:none;backdrop-filter:none}.Primer_Brand__IconButton-module__IconButton--inactive___UanYd.Primer_Brand__IconButton-module__IconButton--inactive___UanYd,.Primer_Brand__IconButton-module__IconButton--inactive___UanYd.Primer_Brand__IconButton-module__IconButton--inactive___UanYd:hover,.Primer_Brand__IconButton-module__IconButton--inactive___UanYd.Primer_Brand__IconButton-module__IconButton--inactive___UanYd:active{color:var(--brand-IconButton-inactive-fgColor);cursor:auto;background-color:var(--brand-IconButton-inactive-bgColor);border-color:var(--brand-IconButton-inactive-borderColor);-webkit-backdrop-filter:none;backdrop-filter:none}.Primer_Brand__IconButton-module__IconButton--inactive___UanYd .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{color:inherit}.Primer_Brand__IconButton-module__IconButton--small___KXgb_ .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{width:var(--brand-IconButton-icon-size-small);height:var(--brand-IconButton-icon-size-small)}.Primer_Brand__IconButton-module__IconButton--medium____oYr1 .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{width:var(--brand-IconButton-icon-size-medium);height:var(--brand-IconButton-icon-size-medium)}.Primer_Brand__IconButton-module__IconButton--large___ypAna .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{width:var(--brand-IconButton-icon-size-large);height:var(--brand-IconButton-icon-size-large)}.Primer_Brand__IconButton-
|
|
1
|
+
.Primer_Brand__IconButton-module__IconButton___68DKi{flex:none;gap:0;padding:0}.Primer_Brand__IconButton-module__IconButton___68DKi.Primer_Brand__IconButton-module__IconButton___68DKi{min-width:var(--brand-IconButton-control-size-medium);width:var(--brand-IconButton-control-size-medium);height:var(--brand-IconButton-control-size-medium)}.Primer_Brand__IconButton-module__IconButton--small___KXgb_.Primer_Brand__IconButton-module__IconButton--small___KXgb_{min-width:var(--brand-IconButton-control-size-small);width:var(--brand-IconButton-control-size-small);height:var(--brand-IconButton-control-size-small)}.Primer_Brand__IconButton-module__IconButton--large___ypAna.Primer_Brand__IconButton-module__IconButton--large___ypAna{min-width:var(--brand-IconButton-control-size-large);width:var(--brand-IconButton-control-size-large);height:var(--brand-IconButton-control-size-large)}.Primer_Brand__IconButton-module__IconButton--rounded___g_ngl.Primer_Brand__IconButton-module__IconButton--rounded___g_ngl{border-radius:var(--brand-borderRadius-full)}.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true]){color:var(--brand-IconButton-danger-fgColor-rest);background-color:var(--brand-IconButton-danger-bgColor-rest);border-color:var(--brand-IconButton-danger-borderColor-rest)}.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true]):not([aria-expanded=true]):hover{color:var(--brand-IconButton-danger-fgColor-hover);background-color:var(--brand-IconButton-danger-bgColor-hover);border-color:var(--brand-IconButton-danger-borderColor-hover)}.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true]):active,.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH.Primer_Brand__IconButton-module__IconButton--variant-danger____mjeH:not([disabled]):not([aria-disabled=true])[aria-expanded=true]{color:var(--brand-IconButton-danger-fgColor-active);background-color:var(--brand-IconButton-danger-bgColor-active);border-color:var(--brand-IconButton-danger-borderColor-active)}.Primer_Brand__IconButton-module__IconButton--variant-invisible___gp_QC.Primer_Brand__IconButton-module__IconButton--variant-invisible___gp_QC:where(:not(:hover):not(:active):not([aria-expanded=true])){background-color:var(--brand-IconButton-invisible-bgColor-rest);border-color:var(--brand-IconButton-invisible-borderColor-rest);-webkit-backdrop-filter:none;backdrop-filter:none}.Primer_Brand__IconButton-module__IconButton--inactive___UanYd.Primer_Brand__IconButton-module__IconButton--inactive___UanYd,.Primer_Brand__IconButton-module__IconButton--inactive___UanYd.Primer_Brand__IconButton-module__IconButton--inactive___UanYd:hover,.Primer_Brand__IconButton-module__IconButton--inactive___UanYd.Primer_Brand__IconButton-module__IconButton--inactive___UanYd:active{color:var(--brand-IconButton-inactive-fgColor);cursor:auto;background-color:var(--brand-IconButton-inactive-bgColor);border-color:var(--brand-IconButton-inactive-borderColor);-webkit-backdrop-filter:none;backdrop-filter:none}.Primer_Brand__IconButton-module__IconButton--inactive___UanYd .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{color:inherit}.Primer_Brand__IconButton-module__IconButton--small___KXgb_ .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{width:var(--brand-IconButton-icon-size-small);height:var(--brand-IconButton-icon-size-small)}.Primer_Brand__IconButton-module__IconButton--medium____oYr1 .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{width:var(--brand-IconButton-icon-size-medium);height:var(--brand-IconButton-icon-size-medium)}.Primer_Brand__IconButton-module__IconButton--large___ypAna .Primer_Brand__IconButton-module__IconButton__icon___ilqkK{width:var(--brand-IconButton-icon-size-large);height:var(--brand-IconButton-icon-size-large)}.Primer_Brand__IconButton-module__IconButton__spinner___I4dHE.Primer_Brand__IconButton-module__IconButton__spinner___I4dHE{width:var(--brand-IconButton-icon-size-medium);height:var(--brand-IconButton-icon-size-medium);animation-duration:var(--brand-IconButton-spinner-animationDuration-default);display:block}.Primer_Brand__IconButton-module__IconButton--small___KXgb_ .Primer_Brand__IconButton-module__IconButton__spinner___I4dHE{width:var(--brand-IconButton-icon-size-small);height:var(--brand-IconButton-icon-size-small)}.Primer_Brand__IconButton-module__IconButton--large___ypAna .Primer_Brand__IconButton-module__IconButton__spinner___I4dHE{width:var(--brand-IconButton-icon-size-large);height:var(--brand-IconButton-icon-size-large)}.Primer_Brand__IconButton-module__IconButton__loadingAnnouncement___Ga8mZ{width:var(--base-size-1);height:var(--base-size-1);margin:calc(var(--base-size-1) * -1);clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;padding:0;position:absolute;overflow:hidden}@media (forced-colors:active){.Primer_Brand__IconButton-module__IconButton--inactive___UanYd{color:graytext;border-color:graytext}.Primer_Brand__IconButton-module__IconButton__spinner___I4dHE{color:buttontext}}@media (prefers-reduced-motion:reduce){.Primer_Brand__IconButton-module__IconButton__spinner___I4dHE{animation-duration:var(--brand-IconButton-spinner-animationDuration-reducedMotion)}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './IconButton.module-
|
|
2
|
-
var e = "Primer_Brand__IconButton-module__IconButton___68DKi", t = "Primer_Brand__IconButton-module__IconButton__icon___ilqkK", n = "Primer_Brand__IconButton-
|
|
1
|
+
import './IconButton.module-D2UJBm7x.css';//#region src/IconButton/IconButton.module.css
|
|
2
|
+
var e = "Primer_Brand__IconButton-module__IconButton___68DKi", t = "Primer_Brand__IconButton-module__IconButton__icon___ilqkK", n = "Primer_Brand__IconButton-module__IconButton__spinner___I4dHE", r = "Primer_Brand__IconButton-module__IconButton__loadingAnnouncement___Ga8mZ", i = {
|
|
3
3
|
IconButton: e,
|
|
4
4
|
"IconButton--small": "Primer_Brand__IconButton-module__IconButton--small___KXgb_",
|
|
5
5
|
"IconButton--large": "Primer_Brand__IconButton-module__IconButton--large___ypAna",
|
|
@@ -9,11 +9,10 @@ var e = "Primer_Brand__IconButton-module__IconButton___68DKi", t = "Primer_Brand
|
|
|
9
9
|
"IconButton--inactive": "Primer_Brand__IconButton-module__IconButton--inactive___UanYd",
|
|
10
10
|
IconButton__icon: t,
|
|
11
11
|
"IconButton--medium": "Primer_Brand__IconButton-module__IconButton--medium____oYr1",
|
|
12
|
-
|
|
13
|
-
"IconButton-spin": "Primer_Brand__IconButton-module__IconButton-spin___f8JZW",
|
|
12
|
+
IconButton__spinner: n,
|
|
14
13
|
IconButton__loadingAnnouncement: r
|
|
15
14
|
};
|
|
16
15
|
//#endregion
|
|
17
|
-
export { e as IconButton, t as IconButton__icon, r as IconButton__loadingAnnouncement, n as
|
|
16
|
+
export { e as IconButton, t as IconButton__icon, r as IconButton__loadingAnnouncement, n as IconButton__spinner, i as default };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=IconButton.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.module.js","names":[],"sources":["../../src/IconButton/IconButton.module.css"],"sourcesContent":[".IconButton {\n flex: none;\n gap: 0;\n padding: 0;\n}\n\n.IconButton.IconButton {\n min-width: var(--brand-IconButton-control-size-medium);\n width: var(--brand-IconButton-control-size-medium);\n height: var(--brand-IconButton-control-size-medium);\n}\n\n.IconButton--small.IconButton--small {\n min-width: var(--brand-IconButton-control-size-small);\n width: var(--brand-IconButton-control-size-small);\n height: var(--brand-IconButton-control-size-small);\n}\n\n.IconButton--large.IconButton--large {\n min-width: var(--brand-IconButton-control-size-large);\n width: var(--brand-IconButton-control-size-large);\n height: var(--brand-IconButton-control-size-large);\n}\n\n.IconButton--rounded.IconButton--rounded {\n border-radius: var(--brand-borderRadius-full);\n}\n\n.IconButton--variant-danger.IconButton--variant-danger:not([disabled], [aria-disabled='true']) {\n color: var(--brand-IconButton-danger-fgColor-rest);\n background-color: var(--brand-IconButton-danger-bgColor-rest);\n border-color: var(--brand-IconButton-danger-borderColor-rest);\n}\n\n.IconButton--variant-danger.IconButton--variant-danger:not(\n [disabled],\n [aria-disabled='true'],\n [aria-expanded='true']\n ):hover {\n color: var(--brand-IconButton-danger-fgColor-hover);\n background-color: var(--brand-IconButton-danger-bgColor-hover);\n border-color: var(--brand-IconButton-danger-borderColor-hover);\n}\n\n.IconButton--variant-danger.IconButton--variant-danger:not([disabled], [aria-disabled='true']):active,\n.IconButton--variant-danger.IconButton--variant-danger:not([disabled], [aria-disabled='true'])[aria-expanded='true'] {\n color: var(--brand-IconButton-danger-fgColor-active);\n background-color: var(--brand-IconButton-danger-bgColor-active);\n border-color: var(--brand-IconButton-danger-borderColor-active);\n}\n\n.IconButton--variant-invisible.IconButton--variant-invisible:where(:not(:hover, :active, [aria-expanded='true'])) {\n background-color: var(--brand-IconButton-invisible-bgColor-rest);\n border-color: var(--brand-IconButton-invisible-borderColor-rest);\n backdrop-filter: none;\n}\n\n.IconButton--inactive.IconButton--inactive,\n.IconButton--inactive.IconButton--inactive:hover,\n.IconButton--inactive.IconButton--inactive:active {\n color: var(--brand-IconButton-inactive-fgColor);\n cursor: auto;\n background-color: var(--brand-IconButton-inactive-bgColor);\n border-color: var(--brand-IconButton-inactive-borderColor);\n backdrop-filter: none;\n}\n\n.IconButton--inactive .IconButton__icon {\n color: inherit;\n}\n\n.IconButton--small .IconButton__icon {\n width: var(--brand-IconButton-icon-size-small);\n height: var(--brand-IconButton-icon-size-small);\n}\n\n.IconButton--medium .IconButton__icon {\n width: var(--brand-IconButton-icon-size-medium);\n height: var(--brand-IconButton-icon-size-medium);\n}\n\n.IconButton--large .IconButton__icon {\n width: var(--brand-IconButton-icon-size-large);\n height: var(--brand-IconButton-icon-size-large);\n}\n\n.
|
|
1
|
+
{"version":3,"file":"IconButton.module.js","names":[],"sources":["../../src/IconButton/IconButton.module.css"],"sourcesContent":[".IconButton {\n flex: none;\n gap: 0;\n padding: 0;\n}\n\n.IconButton.IconButton {\n min-width: var(--brand-IconButton-control-size-medium);\n width: var(--brand-IconButton-control-size-medium);\n height: var(--brand-IconButton-control-size-medium);\n}\n\n.IconButton--small.IconButton--small {\n min-width: var(--brand-IconButton-control-size-small);\n width: var(--brand-IconButton-control-size-small);\n height: var(--brand-IconButton-control-size-small);\n}\n\n.IconButton--large.IconButton--large {\n min-width: var(--brand-IconButton-control-size-large);\n width: var(--brand-IconButton-control-size-large);\n height: var(--brand-IconButton-control-size-large);\n}\n\n.IconButton--rounded.IconButton--rounded {\n border-radius: var(--brand-borderRadius-full);\n}\n\n.IconButton--variant-danger.IconButton--variant-danger:not([disabled], [aria-disabled='true']) {\n color: var(--brand-IconButton-danger-fgColor-rest);\n background-color: var(--brand-IconButton-danger-bgColor-rest);\n border-color: var(--brand-IconButton-danger-borderColor-rest);\n}\n\n.IconButton--variant-danger.IconButton--variant-danger:not(\n [disabled],\n [aria-disabled='true'],\n [aria-expanded='true']\n ):hover {\n color: var(--brand-IconButton-danger-fgColor-hover);\n background-color: var(--brand-IconButton-danger-bgColor-hover);\n border-color: var(--brand-IconButton-danger-borderColor-hover);\n}\n\n.IconButton--variant-danger.IconButton--variant-danger:not([disabled], [aria-disabled='true']):active,\n.IconButton--variant-danger.IconButton--variant-danger:not([disabled], [aria-disabled='true'])[aria-expanded='true'] {\n color: var(--brand-IconButton-danger-fgColor-active);\n background-color: var(--brand-IconButton-danger-bgColor-active);\n border-color: var(--brand-IconButton-danger-borderColor-active);\n}\n\n.IconButton--variant-invisible.IconButton--variant-invisible:where(:not(:hover, :active, [aria-expanded='true'])) {\n background-color: var(--brand-IconButton-invisible-bgColor-rest);\n border-color: var(--brand-IconButton-invisible-borderColor-rest);\n backdrop-filter: none;\n}\n\n.IconButton--inactive.IconButton--inactive,\n.IconButton--inactive.IconButton--inactive:hover,\n.IconButton--inactive.IconButton--inactive:active {\n color: var(--brand-IconButton-inactive-fgColor);\n cursor: auto;\n background-color: var(--brand-IconButton-inactive-bgColor);\n border-color: var(--brand-IconButton-inactive-borderColor);\n backdrop-filter: none;\n}\n\n.IconButton--inactive .IconButton__icon {\n color: inherit;\n}\n\n.IconButton--small .IconButton__icon {\n width: var(--brand-IconButton-icon-size-small);\n height: var(--brand-IconButton-icon-size-small);\n}\n\n.IconButton--medium .IconButton__icon {\n width: var(--brand-IconButton-icon-size-medium);\n height: var(--brand-IconButton-icon-size-medium);\n}\n\n.IconButton--large .IconButton__icon {\n width: var(--brand-IconButton-icon-size-large);\n height: var(--brand-IconButton-icon-size-large);\n}\n\n.IconButton__spinner.IconButton__spinner {\n display: block;\n width: var(--brand-IconButton-icon-size-medium);\n height: var(--brand-IconButton-icon-size-medium);\n animation-duration: var(--brand-IconButton-spinner-animationDuration-default);\n}\n\n.IconButton--small .IconButton__spinner {\n width: var(--brand-IconButton-icon-size-small);\n height: var(--brand-IconButton-icon-size-small);\n}\n\n.IconButton--large .IconButton__spinner {\n width: var(--brand-IconButton-icon-size-large);\n height: var(--brand-IconButton-icon-size-large);\n}\n\n.IconButton__loadingAnnouncement {\n position: absolute;\n width: var(--base-size-1);\n height: var(--base-size-1);\n padding: 0;\n margin: calc(var(--base-size-1) * -1);\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n@media (forced-colors: active) {\n .IconButton--inactive {\n color: GrayText;\n border-color: GrayText;\n }\n\n .IconButton__spinner {\n color: ButtonText;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .IconButton__spinner {\n animation-duration: var(--brand-IconButton-spinner-animationDuration-reducedMotion);\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/spinner/base.css';
|
|
3
|
+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes.css';
|
|
4
|
+
export type SpinnerProps = {
|
|
5
|
+
size?: 'small' | 'medium' | 'large' | number;
|
|
6
|
+
accessibleLabel?: string | null;
|
|
7
|
+
className?: string;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function Spinner({ size, accessibleLabel, className, 'data-testid': testId, }: SpinnerProps): React.JSX.Element;
|
|
11
|
+
//# sourceMappingURL=Spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,8FAA8F,CAAA;AACrG,OAAO,2GAA2G,CAAA;AAGlH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IAC5C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,wBAAgB,OAAO,CAAC,EACtB,IAAe,EACf,eAA2B,EAC3B,SAAS,EACT,aAAa,EAAE,MAAkB,GAClC,EAAE,YAAY,qBAqCd"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { clsx as e } from "../node_modules/clsx/dist/clsx.js";
|
|
2
|
+
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes-izIk82NS.css';import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/spinner/base-BUCpHNCY.css';/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import t from "./Spinner.module.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
7
|
+
//#region src/Spinner/Spinner.tsx
|
|
8
|
+
function i({ size: i = "medium", accessibleLabel: a = "Loading", className: o, "data-testid": s = "Spinner" }) {
|
|
9
|
+
let c = typeof i == "number" ? i : void 0;
|
|
10
|
+
return /* @__PURE__ */ r("span", {
|
|
11
|
+
className: t.Spinner__box,
|
|
12
|
+
"data-component": "Spinner",
|
|
13
|
+
children: [/* @__PURE__ */ r("svg", {
|
|
14
|
+
width: c,
|
|
15
|
+
height: c,
|
|
16
|
+
viewBox: "0 0 16 16",
|
|
17
|
+
fill: "none",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
focusable: "false",
|
|
20
|
+
className: e(t.Spinner, typeof i == "string" && t[`Spinner--${i}`], o),
|
|
21
|
+
"data-testid": s,
|
|
22
|
+
children: [/* @__PURE__ */ n("circle", {
|
|
23
|
+
cx: "8",
|
|
24
|
+
cy: "8",
|
|
25
|
+
r: "7",
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeOpacity: "0.25",
|
|
29
|
+
strokeWidth: "2",
|
|
30
|
+
vectorEffect: "non-scaling-stroke"
|
|
31
|
+
}), /* @__PURE__ */ n("path", {
|
|
32
|
+
d: "M15 8a7.002 7.002 0 00-7-7",
|
|
33
|
+
fill: "none",
|
|
34
|
+
stroke: "currentColor",
|
|
35
|
+
strokeWidth: "2",
|
|
36
|
+
strokeLinecap: "round",
|
|
37
|
+
vectorEffect: "non-scaling-stroke"
|
|
38
|
+
})]
|
|
39
|
+
}), a === null ? null : /* @__PURE__ */ n("span", {
|
|
40
|
+
className: "visually-hidden",
|
|
41
|
+
children: a
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { i as Spinner };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=Spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.js","names":[],"sources":["../../src/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react'\nimport {clsx} from 'clsx'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/spinner/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes.css'\nimport styles from './Spinner.module.css'\n\nexport type SpinnerProps = {\n size?: 'small' | 'medium' | 'large' | number\n accessibleLabel?: string | null\n className?: string\n 'data-testid'?: string\n}\n\nexport function Spinner({\n size = 'medium',\n accessibleLabel = 'Loading',\n className,\n 'data-testid': testId = 'Spinner',\n}: SpinnerProps) {\n const customSize = typeof size === 'number' ? size : undefined\n\n return (\n <span className={styles.Spinner__box} data-component=\"Spinner\">\n <svg\n width={customSize}\n height={customSize}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n focusable=\"false\"\n className={clsx(styles.Spinner, typeof size === 'string' && styles[`Spinner--${size}`], className)}\n data-testid={testId}\n >\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"7\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeOpacity=\"0.25\"\n strokeWidth=\"2\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <path\n d=\"M15 8a7.002 7.002 0 00-7-7\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n vectorEffect=\"non-scaling-stroke\"\n />\n </svg>\n {accessibleLabel !== null ? <span className=\"visually-hidden\">{accessibleLabel}</span> : null}\n </span>\n )\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,EAAQ,EACtB,UAAO,UACP,qBAAkB,WAClB,cACA,eAAe,IAAS,aACT;CACf,IAAM,IAAa,OAAO,KAAS,WAAW,IAAO,KAAA;CAErD,OACE,kBAAC,QAAD;EAAM,WAAW,EAAO;EAAc,kBAAe;YAArD,CACE,kBAAC,OAAD;GACE,OAAO;GACP,QAAQ;GACR,SAAQ;GACR,MAAK;GACL,eAAY;GACZ,WAAU;GACV,WAAW,EAAK,EAAO,SAAS,OAAO,KAAS,YAAY,EAAO,YAAY,MAAS,CAAS;GACjG,eAAa;aARf,CAUE,kBAAC,UAAD;IACE,IAAG;IACH,IAAG;IACH,GAAE;IACF,MAAK;IACL,QAAO;IACP,eAAc;IACd,aAAY;IACZ,cAAa;GACd,CAAA,GACD,kBAAC,QAAD;IACE,GAAE;IACF,MAAK;IACL,QAAO;IACP,aAAY;IACZ,eAAc;IACd,cAAa;GACd,CAAA,CACE;MACJ,MAAoB,OAAoE,OAA7D,kBAAC,QAAD;GAAM,WAAU;aAAmB;EAAsB,CAAA,CACjF;;AAEV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Primer_Brand__Spinner-module__Spinner__box___aHcR4{display:inline-flex}.Primer_Brand__Spinner-module__Spinner___udHxF{box-sizing:border-box;color:var(--brand-Spinner-fgColor);animation-name:Primer_Brand__Spinner-module__Spinner-spin___itSEr;animation-duration:var(--brand-Spinner-animationDuration-default);animation-timing-function:linear;animation-iteration-count:infinite;display:block;overflow:visible}.Primer_Brand__Spinner-module__Spinner--small___cMahj{width:var(--brand-Spinner-size-small);height:var(--brand-Spinner-size-small)}.Primer_Brand__Spinner-module__Spinner--medium___buMi2{width:var(--brand-Spinner-size-medium);height:var(--brand-Spinner-size-medium)}.Primer_Brand__Spinner-module__Spinner--large___8Bjgb{width:var(--brand-Spinner-size-large);height:var(--brand-Spinner-size-large)}@keyframes Primer_Brand__Spinner-module__Spinner-spin___itSEr{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.Primer_Brand__Spinner-module__Spinner___udHxF{animation-duration:var(--brand-Spinner-animationDuration-reducedMotion)}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './Spinner.module-BjDTZLR7.css';//#region src/Spinner/Spinner.module.css
|
|
2
|
+
var e = "Primer_Brand__Spinner-module__Spinner__box___aHcR4", t = "Primer_Brand__Spinner-module__Spinner___udHxF", n = {
|
|
3
|
+
Spinner__box: e,
|
|
4
|
+
Spinner: t,
|
|
5
|
+
"Spinner-spin": "Primer_Brand__Spinner-module__Spinner-spin___itSEr",
|
|
6
|
+
"Spinner--small": "Primer_Brand__Spinner-module__Spinner--small___cMahj",
|
|
7
|
+
"Spinner--medium": "Primer_Brand__Spinner-module__Spinner--medium___buMi2",
|
|
8
|
+
"Spinner--large": "Primer_Brand__Spinner-module__Spinner--large___8Bjgb"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as Spinner, e as Spinner__box, n as default };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=Spinner.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.module.js","names":[],"sources":["../../src/Spinner/Spinner.module.css"],"sourcesContent":[".Spinner__box {\n display: inline-flex;\n}\n\n.Spinner {\n display: block;\n box-sizing: border-box;\n overflow: visible;\n color: var(--brand-Spinner-fgColor);\n animation-name: Spinner-spin;\n animation-duration: var(--brand-Spinner-animationDuration-default);\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n.Spinner--small {\n width: var(--brand-Spinner-size-small);\n height: var(--brand-Spinner-size-small);\n}\n\n.Spinner--medium {\n width: var(--brand-Spinner-size-medium);\n height: var(--brand-Spinner-size-medium);\n}\n\n.Spinner--large {\n width: var(--brand-Spinner-size-large);\n height: var(--brand-Spinner-size-large);\n}\n\n@keyframes Spinner-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .Spinner {\n animation-duration: var(--brand-Spinner-animationDuration-reducedMotion);\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,YAAY,EAAC,YAAY,EAAC,MAAM,WAAW,CAAA"}
|
|
@@ -2,7 +2,7 @@ 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
4
|
import r from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
5
|
-
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-
|
|
5
|
+
import '../../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes-ChBPnVuN.css';/* empty css */
|
|
6
6
|
import i from "./Checkbox.module.js";
|
|
7
7
|
import { forwardRef as a, useCallback as o } from "react";
|
|
8
8
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.d.ts","sourceRoot":"","sources":["../../../src/forms/FormControl/FormControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAK9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,oBAAoB,EAAE,cAAc,EAAC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"FormControl.d.ts","sourceRoot":"","sources":["../../../src/forms/FormControl/FormControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAK9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAC,oBAAoB,EAAE,cAAc,EAAC,MAAM,KAAK,CAAA;AAY7D,OAAO,2GAA2G,CAAA;AAIlH,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG;IACtD;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC,CAAA;AAmMD,KAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAA;AA4C/B,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC,GAAG,SAAS,CAAC,eAAe,CAAC,CAAA;AA8B9B,KAAK,oBAAoB,GAAG,iBAAiB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAA;AAMzE;;;GAGG;AACH,eAAO,MAAM,WAAW,kGA3QrB,iBAAiB,CAAC,gBAAgB,CAAC;gIAgMnC,iBAAiB,CAAC,qBAAqB,CAAC;sEAqCuC,0BAA0B;mCA8B7D,oBAAoB;CAYjE,CAAA"}
|