@datalayer/primer-addons 1.0.55 → 1.0.57
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/README.md +26 -0
- package/lib/components/animated-text/AnimatedText.d.ts +56 -0
- package/lib/components/animated-text/AnimatedText.js +100 -0
- package/lib/components/animated-text/AnimatedText.stories.d.ts +14 -0
- package/lib/components/animated-text/AnimatedText.stories.js +21 -0
- package/lib/components/animated-text/index.d.ts +1 -0
- package/lib/components/animated-text/index.js +5 -0
- package/lib/components/buttons/Buttons.stories.d.ts +14 -0
- package/lib/components/buttons/Buttons.stories.js +24 -0
- package/lib/components/buttons/CopyToClipboardButton.d.ts +13 -0
- package/lib/components/buttons/CopyToClipboardButton.js +73 -0
- package/lib/components/buttons/DownloadCSVButton.d.ts +8 -0
- package/lib/components/buttons/DownloadCSVButton.js +12 -0
- package/lib/components/buttons/DownloadJsonButton.d.ts +9 -0
- package/lib/components/buttons/DownloadJsonButton.js +12 -0
- package/lib/components/buttons/LongActionButton.d.ts +29 -0
- package/lib/components/buttons/LongActionButton.js +23 -0
- package/lib/components/buttons/UploadButton.d.ts +35 -0
- package/lib/components/buttons/UploadButton.js +35 -0
- package/lib/components/buttons/VariantType.d.ts +1 -0
- package/lib/components/buttons/VariantType.js +5 -0
- package/lib/components/buttons/index.d.ts +6 -0
- package/lib/components/buttons/index.js +10 -0
- package/lib/components/display/AvatarSkeleton.d.ts +5 -0
- package/lib/components/display/AvatarSkeleton.js +11 -0
- package/lib/components/display/BusyDots.d.ts +9 -0
- package/lib/components/display/BusyDots.js +31 -0
- package/lib/components/display/CenteredSpinner.d.ts +11 -0
- package/lib/components/display/CenteredSpinner.js +11 -0
- package/lib/components/display/CodePreview.d.ts +4 -0
- package/lib/components/display/CodePreview.js +15 -0
- package/lib/components/display/Display.stories.d.ts +17 -0
- package/lib/components/display/Display.stories.js +27 -0
- package/lib/components/display/HorizontalCenter.d.ts +6 -0
- package/lib/components/display/HorizontalCenter.js +10 -0
- package/lib/components/display/NotebookSkeleton.d.ts +2 -0
- package/lib/components/display/NotebookSkeleton.js +11 -0
- package/lib/components/display/Placeholder.d.ts +2 -0
- package/lib/components/display/Placeholder.js +9 -0
- package/lib/components/display/VisuallyHidden.d.ts +5 -0
- package/lib/components/display/VisuallyHidden.js +24 -0
- package/lib/components/display/index.d.ts +8 -0
- package/lib/components/display/index.js +12 -0
- package/lib/components/emoji/FluentEmoji.d.ts +33 -0
- package/lib/components/emoji/FluentEmoji.js +66 -0
- package/lib/components/emoji/FluentEmoji.stories.d.ts +14 -0
- package/lib/components/emoji/FluentEmoji.stories.js +19 -0
- package/lib/components/emoji/faceEmojis.d.ts +24 -0
- package/lib/components/emoji/faceEmojis.js +229 -0
- package/lib/components/emoji/fluent/loaders.d.ts +12 -0
- package/lib/components/emoji/fluent/loaders.js +200 -0
- package/lib/components/emoji/fluent/svg/1f304.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f304.js +9 -0
- package/lib/components/emoji/fluent/svg/1f308.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f308.js +9 -0
- package/lib/components/emoji/fluent/svg/1f30a.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f30a.js +9 -0
- package/lib/components/emoji/fluent/svg/1f30d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f30d.js +9 -0
- package/lib/components/emoji/fluent/svg/1f30f.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f30f.js +9 -0
- package/lib/components/emoji/fluent/svg/1f310.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f310.js +9 -0
- package/lib/components/emoji/fluent/svg/1f31f.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f31f.js +9 -0
- package/lib/components/emoji/fluent/svg/1f324.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f324.js +9 -0
- package/lib/components/emoji/fluent/svg/1f326.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f326.js +9 -0
- package/lib/components/emoji/fluent/svg/1f327.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f327.js +9 -0
- package/lib/components/emoji/fluent/svg/1f331.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f331.js +9 -0
- package/lib/components/emoji/fluent/svg/1f33e.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f33e.js +9 -0
- package/lib/components/emoji/fluent/svg/1f340.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f340.js +9 -0
- package/lib/components/emoji/fluent/svg/1f355.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f355.js +9 -0
- package/lib/components/emoji/fluent/svg/1f372.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f372.js +9 -0
- package/lib/components/emoji/fluent/svg/1f373.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f373.js +9 -0
- package/lib/components/emoji/fluent/svg/1f381.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f381.js +9 -0
- package/lib/components/emoji/fluent/svg/1f385.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f385.js +9 -0
- package/lib/components/emoji/fluent/svg/1f386.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f386.js +9 -0
- package/lib/components/emoji/fluent/svg/1f387.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f387.js +9 -0
- package/lib/components/emoji/fluent/svg/1f389.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f389.js +9 -0
- package/lib/components/emoji/fluent/svg/1f393.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f393.js +9 -0
- package/lib/components/emoji/fluent/svg/1f399.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f399.js +9 -0
- package/lib/components/emoji/fluent/svg/1f39b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f39b.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3a8.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3a8.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3ab.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3ab.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3ac.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3ac.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3af.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3af.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3b5.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3b5.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3c4.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3c4.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3c6.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3c6.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3ca.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3ca.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3d7.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3d7.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3db.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3db.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3e0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3e0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3e2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3e2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3e5.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3e5.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3e6.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3e6.js +9 -0
- package/lib/components/emoji/fluent/svg/1f3f7.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3f7.js +9 -0
- package/lib/components/emoji/fluent/svg/1f409.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f409.js +9 -0
- package/lib/components/emoji/fluent/svg/1f419.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f419.js +9 -0
- package/lib/components/emoji/fluent/svg/1f41b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f41b.js +9 -0
- package/lib/components/emoji/fluent/svg/1f41d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f41d.js +9 -0
- package/lib/components/emoji/fluent/svg/1f427.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f427.js +9 -0
- package/lib/components/emoji/fluent/svg/1f431.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f431.js +9 -0
- package/lib/components/emoji/fluent/svg/1f432.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f432.js +9 -0
- package/lib/components/emoji/fluent/svg/1f433.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f433.js +9 -0
- package/lib/components/emoji/fluent/svg/1f436.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f436.js +9 -0
- package/lib/components/emoji/fluent/svg/1f440.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f440.js +9 -0
- package/lib/components/emoji/fluent/svg/1f441.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f441.js +9 -0
- package/lib/components/emoji/fluent/svg/1f44b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f44b.js +9 -0
- package/lib/components/emoji/fluent/svg/1f450.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f450.js +9 -0
- package/lib/components/emoji/fluent/svg/1f465.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f465.js +9 -0
- package/lib/components/emoji/fluent/svg/1f477.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f477.js +9 -0
- package/lib/components/emoji/fluent/svg/1f47d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f47d.js +9 -0
- package/lib/components/emoji/fluent/svg/1f47e.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f47e.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4a1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4a1.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4ac.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4ac.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4b0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4b0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4b3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4b3.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4b9.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4b9.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4bc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4bc.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4be.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4be.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4c1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c1.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4c2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4c4.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c4.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4c5.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c5.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4c8.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c8.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4ca.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4ca.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4cb.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4cb.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4cc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4cc.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4d1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4d1.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4d3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4d3.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4d6.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4d6.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4da.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4da.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4dc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4dc.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4dd.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4dd.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4de.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4de.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4e1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e1.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4e2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4e3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e3.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4e6.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e6.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4e7.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e7.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4ec.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4ec.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4f0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4f0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f4f7.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4f7.js +9 -0
- package/lib/components/emoji/fluent/svg/1f500.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f500.js +9 -0
- package/lib/components/emoji/fluent/svg/1f501.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f501.js +9 -0
- package/lib/components/emoji/fluent/svg/1f504.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f504.js +9 -0
- package/lib/components/emoji/fluent/svg/1f50d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f50d.js +9 -0
- package/lib/components/emoji/fluent/svg/1f50e.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f50e.js +9 -0
- package/lib/components/emoji/fluent/svg/1f511.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f511.js +9 -0
- package/lib/components/emoji/fluent/svg/1f512.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f512.js +9 -0
- package/lib/components/emoji/fluent/svg/1f514.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f514.js +9 -0
- package/lib/components/emoji/fluent/svg/1f525.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f525.js +9 -0
- package/lib/components/emoji/fluent/svg/1f527.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f527.js +9 -0
- package/lib/components/emoji/fluent/svg/1f52c.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f52c.js +9 -0
- package/lib/components/emoji/fluent/svg/1f52d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f52d.js +9 -0
- package/lib/components/emoji/fluent/svg/1f552.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f552.js +9 -0
- package/lib/components/emoji/fluent/svg/1f58a.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f58a.js +9 -0
- package/lib/components/emoji/fluent/svg/1f58b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f58b.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5b2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5b2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5bc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5bc.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5c2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5c2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5c3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5c3.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5d1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5d1.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5d3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5d3.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5dc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5dc.js +9 -0
- package/lib/components/emoji/fluent/svg/1f5fa.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5fa.js +9 -0
- package/lib/components/emoji/fluent/svg/1f600.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f600.js +9 -0
- package/lib/components/emoji/fluent/svg/1f604.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f604.js +9 -0
- package/lib/components/emoji/fluent/svg/1f60e.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f60e.js +9 -0
- package/lib/components/emoji/fluent/svg/1f642.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f642.js +9 -0
- package/lib/components/emoji/fluent/svg/1f680.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f680.js +9 -0
- package/lib/components/emoji/fluent/svg/1f69a.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f69a.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6a2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6a2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6a7.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6a7.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6b2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6b2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6cd.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6cd.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6d2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6d2.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6df.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6df.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6e0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6e0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6e1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6e1.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6eb.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6eb.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6f0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6f0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f6f8.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f6f8.js +9 -0
- package/lib/components/emoji/fluent/svg/1f913.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f913.js +9 -0
- package/lib/components/emoji/fluent/svg/1f916.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f916.js +9 -0
- package/lib/components/emoji/fluent/svg/1f917.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f917.js +9 -0
- package/lib/components/emoji/fluent/svg/1f91d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f91d.js +9 -0
- package/lib/components/emoji/fluent/svg/1f920.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f920.js +9 -0
- package/lib/components/emoji/fluent/svg/1f977.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f977.js +9 -0
- package/lib/components/emoji/fluent/svg/1f984.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f984.js +9 -0
- package/lib/components/emoji/fluent/svg/1f988.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f988.js +9 -0
- package/lib/components/emoji/fluent/svg/1f989.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f989.js +9 -0
- package/lib/components/emoji/fluent/svg/1f98a.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f98a.js +9 -0
- package/lib/components/emoji/fluent/svg/1f98e.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f98e.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f33e.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f33e.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f373.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f373.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f393.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f393.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f3eb.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f3eb.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f4bb.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f4bb.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f4bc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f4bc.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f52c.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f52c.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f680.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-1f680.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-2695.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-2695.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-2696.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-2696.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9dd.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9dd.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9e0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9e0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9e9.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9e9.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9ea.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9ea.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9ec.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9ec.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9ed.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9ed.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9ee.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9ee.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9f0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9f0.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9f9.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9f9.js +9 -0
- package/lib/components/emoji/fluent/svg/1f9fe.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9fe.js +9 -0
- package/lib/components/emoji/fluent/svg/1fa79.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa79.js +9 -0
- package/lib/components/emoji/fluent/svg/1fa84.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa84.js +9 -0
- package/lib/components/emoji/fluent/svg/1fa90.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa90.js +9 -0
- package/lib/components/emoji/fluent/svg/1fa9d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa9d.js +9 -0
- package/lib/components/emoji/fluent/svg/1fa9f.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa9f.js +9 -0
- package/lib/components/emoji/fluent/svg/23f0.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/23f0.js +9 -0
- package/lib/components/emoji/fluent/svg/23f3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/23f3.js +9 -0
- package/lib/components/emoji/fluent/svg/2600.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2600.js +9 -0
- package/lib/components/emoji/fluent/svg/2601.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2601.js +9 -0
- package/lib/components/emoji/fluent/svg/2603.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2603.js +9 -0
- package/lib/components/emoji/fluent/svg/2611.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2611.js +9 -0
- package/lib/components/emoji/fluent/svg/2615.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2615.js +9 -0
- package/lib/components/emoji/fluent/svg/262f.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/262f.js +9 -0
- package/lib/components/emoji/fluent/svg/2696.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2696.js +9 -0
- package/lib/components/emoji/fluent/svg/2699.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2699.js +9 -0
- package/lib/components/emoji/fluent/svg/269b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/269b.js +9 -0
- package/lib/components/emoji/fluent/svg/26a1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/26a1.js +9 -0
- package/lib/components/emoji/fluent/svg/2702.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2702.js +9 -0
- package/lib/components/emoji/fluent/svg/2705.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2705.js +9 -0
- package/lib/components/emoji/fluent/svg/2709.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2709.js +9 -0
- package/lib/components/emoji/fluent/svg/270d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/270d.js +9 -0
- package/lib/components/emoji/fluent/svg/270f.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/270f.js +9 -0
- package/lib/components/emoji/fluent/svg/2712.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2712.js +9 -0
- package/lib/components/emoji/fluent/svg/2728.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2728.js +9 -0
- package/lib/components/emoji/fluent/svg/2764.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2764.js +9 -0
- package/lib/components/emoji/fluent/svg/2b1c.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2b1c.js +9 -0
- package/lib/components/emoji/fluent/svg/2b50.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2b50.js +9 -0
- package/lib/components/emoji/index.d.ts +3 -0
- package/lib/components/emoji/index.js +7 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.js +11 -0
- package/lib/components/labels/StatusLabels.d.ts +55 -0
- package/lib/components/labels/StatusLabels.js +77 -0
- package/lib/components/labels/StatusLabels.stories.d.ts +14 -0
- package/lib/components/labels/StatusLabels.stories.js +19 -0
- package/lib/components/labels/VisibilityLabel.d.ts +4 -0
- package/lib/components/labels/VisibilityLabel.js +14 -0
- package/lib/components/labels/index.d.ts +2 -0
- package/lib/components/labels/index.js +6 -0
- package/lib/components/progress/Progress.stories.d.ts +14 -0
- package/lib/components/progress/Progress.stories.js +20 -0
- package/lib/components/progress/ProgressRing.d.ts +37 -0
- package/lib/components/progress/ProgressRing.js +31 -0
- package/lib/components/progress/SpinnerBar.d.ts +2 -0
- package/lib/components/progress/SpinnerBar.js +21 -0
- package/lib/components/progress/Timer.d.ts +10 -0
- package/lib/components/progress/Timer.js +24 -0
- package/lib/components/progress/index.d.ts +3 -0
- package/lib/components/progress/index.js +7 -0
- package/lib/components/scroll-area/ScrollArea.d.ts +7 -7
- package/lib/components/sparklines/Sparklines.d.ts +16 -0
- package/lib/components/sparklines/Sparklines.js +68 -0
- package/lib/components/sparklines/Sparklines.stories.d.ts +12 -0
- package/lib/components/sparklines/Sparklines.stories.js +15 -0
- package/lib/components/sparklines/SparklinesLine.d.ts +8 -0
- package/lib/components/sparklines/SparklinesLine.js +37 -0
- package/lib/components/sparklines/dataProcessing.d.ts +23 -0
- package/lib/components/sparklines/dataProcessing.js +35 -0
- package/lib/components/sparklines/index.d.ts +5 -0
- package/lib/components/sparklines/index.js +7 -0
- package/lib/components/sparklines/types.d.ts +36 -0
- package/lib/components/sparklines/types.js +5 -0
- package/lib/components/tabs/RouteTabs.d.ts +38 -0
- package/lib/components/tabs/RouteTabs.js +8 -0
- package/lib/components/tabs/RouteTabs.stories.d.ts +12 -0
- package/lib/components/tabs/RouteTabs.stories.js +31 -0
- package/lib/components/tabs/ViewTabs.d.ts +49 -0
- package/lib/components/tabs/ViewTabs.js +40 -0
- package/lib/components/tabs/ViewTabs.stories.d.ts +14 -0
- package/lib/components/tabs/ViewTabs.stories.js +42 -0
- package/lib/components/tabs/index.d.ts +3 -0
- package/lib/components/tabs/index.js +7 -0
- package/lib/components/tabs/useTabParam.d.ts +18 -0
- package/lib/components/tabs/useTabParam.js +37 -0
- package/lib/components/timeline/Timeline.d.ts +20 -0
- package/lib/components/timeline/Timeline.js +58 -0
- package/lib/components/timeline/Timeline.stories.d.ts +12 -0
- package/lib/components/timeline/Timeline.stories.js +22 -0
- package/lib/components/timeline/index.d.ts +1 -0
- package/lib/components/timeline/index.js +5 -0
- package/lib/components/toast/ToastPanel.d.ts +11 -0
- package/lib/components/toast/ToastPanel.js +43 -0
- package/lib/components/toast/ToastPanel.stories.d.ts +12 -0
- package/lib/components/toast/ToastPanel.stories.js +16 -0
- package/lib/components/toast/index.d.ts +2 -0
- package/lib/components/toast/index.js +6 -0
- package/lib/components/toast/toastQueue.d.ts +35 -0
- package/lib/components/toast/toastQueue.js +47 -0
- package/lib/components/truncate/Truncate.d.ts +44 -0
- package/lib/components/truncate/Truncate.js +46 -0
- package/lib/components/truncate/Truncate.stories.d.ts +13 -0
- package/lib/components/truncate/Truncate.stories.js +19 -0
- package/lib/components/truncate/index.d.ts +1 -0
- package/lib/components/truncate/index.js +5 -0
- package/lib/theme/themes/agentThemeStyles.d.ts +1 -1
- package/lib/theme/themes/datalayerThemeStyles.d.ts +1 -1
- package/lib/theme/themes/earthThemeStyles.d.ts +1 -1
- package/lib/theme/themes/ivoryThemeStyles.d.ts +1 -1
- package/lib/theme/themes/lovelyThemeStyles.d.ts +1 -1
- package/lib/theme/themes/matrixThemeStyles.d.ts +1 -1
- package/lib/theme/themes/metalThemeStyles.d.ts +1 -1
- package/lib/theme/themes/sandThemeStyles.d.ts +1 -1
- package/lib/theme/themes/spatialThemeStyles.d.ts +1 -1
- package/lib/theme/themes/sunThemeStyles.d.ts +1 -1
- package/lib/theme/themes/vscodeThemeStyles.d.ts +1 -1
- package/lib/utils/Download.d.ts +3 -0
- package/lib/utils/Download.js +50 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -17,6 +17,8 @@ This project has been [shared in a discussion](https://github.com/primer/react/d
|
|
|
17
17
|
|
|
18
18
|
## Current Addons
|
|
19
19
|
|
|
20
|
+
- [x] Action buttons: Copy to Clipboard, Long Action, Upload, Download as CSV or JSON
|
|
21
|
+
- [x] Animated Text
|
|
20
22
|
- [x] Appearance controls, menus, theme previews and collaborator palettes
|
|
21
23
|
- [x] Box
|
|
22
24
|
- [x] Calendar Picker
|
|
@@ -26,14 +28,38 @@ This project has been [shared in a discussion](https://github.com/primer/react/d
|
|
|
26
28
|
- [x] Color Swatch and Color Picker
|
|
27
29
|
- [x] Content Loader
|
|
28
30
|
- [x] Date Picker
|
|
31
|
+
- [x] Display helpers: Busy Dots, Centered Spinner, Avatar and Notebook skeletons, Code Preview, Horizontal Center, Visually Hidden, Placeholder
|
|
29
32
|
- [x] Entity Avatar
|
|
33
|
+
- [x] Fluent Emoji (and the faces offered, `FACE_EMOJIS`)
|
|
30
34
|
- [x] Hover Card
|
|
31
35
|
- [x] Datalayer logos and text marks
|
|
36
|
+
- [x] Progress Ring, Timer and Spinner Bar
|
|
32
37
|
- [x] Sheet
|
|
33
38
|
- [x] Side Overlay
|
|
34
39
|
- [x] Slider
|
|
35
40
|
- [x] Sliding Panel
|
|
41
|
+
- [x] Sparklines
|
|
42
|
+
- [x] Status Labels and Visibility Label
|
|
43
|
+
- [x] Timeline
|
|
44
|
+
- [x] Toast Panel and its queue (`toastQueue`)
|
|
36
45
|
- [x] Toolbar and Floating Toolbar
|
|
46
|
+
- [x] Route Tabs (tabs that are routes, navigated by the host)
|
|
47
|
+
- [x] Truncate
|
|
48
|
+
- [x] View Tabs and `useTabParam` (the open tab in the address)
|
|
49
|
+
|
|
50
|
+
The action buttons, Animated Text, the display helpers, Fluent Emoji, the
|
|
51
|
+
progress components, Sparklines, the labels, Timeline, the toasts, Truncate
|
|
52
|
+
and View Tabs were Datalayer core's (`@datalayer/core/lib/components/...`)
|
|
53
|
+
until 29 November 2026; they are imported from `@datalayer/primer-addons`
|
|
54
|
+
now, with no alias left in core. Fluent Emoji's drawings are regenerated by
|
|
55
|
+
`scripts/generate-fluent-emoji.py`.
|
|
56
|
+
|
|
57
|
+
`useTabParam` (core's until then) and Route Tabs (the Datalayer landing's
|
|
58
|
+
`Tabs`) followed the same day. Neither carries a router: `useTabParam` is
|
|
59
|
+
handed the search pair React Router's `useSearchParams()` returns,
|
|
60
|
+
`useTabParam(ids, useSearchParams(), 'part')`, and Route Tabs a `navigate`
|
|
61
|
+
called with the chosen tab's `to`. The gallery's *Tabs* page shows both
|
|
62
|
+
beside View Tabs.
|
|
37
63
|
|
|
38
64
|
The components use the active theme's semantic tokens rather than fixed
|
|
39
65
|
visual values. For example, toolbar icon buttons and dropdown triggers read
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* One piece of an animated line.
|
|
4
|
+
*
|
|
5
|
+
* A string is written as it is. An object cycles through its words, and every
|
|
6
|
+
* cycling piece of the same line advances together — so a sentence can name
|
|
7
|
+
* two things that change at once and still read as one sentence rather than
|
|
8
|
+
* two independent slot machines.
|
|
9
|
+
*/
|
|
10
|
+
export type AnimatedTextPart = string | AnimatedTextWords;
|
|
11
|
+
export type AnimatedTextWords = {
|
|
12
|
+
/** The words this piece cycles through. */
|
|
13
|
+
words: string[];
|
|
14
|
+
/**
|
|
15
|
+
* The colour of the words, as a Primer foreground token name — `accent`,
|
|
16
|
+
* `success`, `attention`, `severe`, `done`, `muted` — or any CSS colour.
|
|
17
|
+
* Given a token name the colour follows the theme, light or dark, because
|
|
18
|
+
* it resolves to the CSS variable Primer sets.
|
|
19
|
+
*/
|
|
20
|
+
color?: AnimatedTextColor;
|
|
21
|
+
};
|
|
22
|
+
export type AnimatedTextColor = 'accent' | 'success' | 'attention' | 'severe' | 'done' | 'muted' | 'default' | (string & {});
|
|
23
|
+
export interface AnimatedTextProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children' | 'color'> {
|
|
24
|
+
/** Text before the cycling words. Ignored when `parts` is given. */
|
|
25
|
+
prefix?: string;
|
|
26
|
+
/** The words to cycle through. Ignored when `parts` is given. */
|
|
27
|
+
words?: string[];
|
|
28
|
+
/** Text after the cycling words. Ignored when `parts` is given. */
|
|
29
|
+
suffix?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The line, as a sequence of fixed and cycling pieces. Every cycling piece
|
|
32
|
+
* advances on the same tick, so several of them stay in step.
|
|
33
|
+
*/
|
|
34
|
+
parts?: AnimatedTextPart[];
|
|
35
|
+
/** Colour applied to cycling pieces that do not name their own. */
|
|
36
|
+
color?: AnimatedTextColor;
|
|
37
|
+
intervalMs?: number;
|
|
38
|
+
transitionMs?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A line of text in which one or more words change, in step.
|
|
42
|
+
*
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <AnimatedText
|
|
45
|
+
* parts={[
|
|
46
|
+
* 'Bring ',
|
|
47
|
+
* { words: ['Claude', 'Codex', 'Cursor'], color: 'accent' },
|
|
48
|
+
* '. Datalayer gives it a secure endpoint to your ',
|
|
49
|
+
* { words: ['Notebooks', 'Data', 'Code Sandboxes'], color: 'success' },
|
|
50
|
+
* '.',
|
|
51
|
+
* ]}
|
|
52
|
+
* />
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function AnimatedText({ prefix, words, suffix, parts, color, intervalMs, transitionMs, style, ...rest }: AnimatedTextProps): JSX.Element;
|
|
56
|
+
export default AnimatedText;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
/** The Primer foreground tokens, which carry the theme with them. */
|
|
4
|
+
const THEME_COLORS = {
|
|
5
|
+
accent: 'var(--fgColor-accent, var(--color-accent-fg))',
|
|
6
|
+
success: 'var(--fgColor-success, var(--color-success-fg))',
|
|
7
|
+
attention: 'var(--fgColor-attention, var(--color-attention-fg))',
|
|
8
|
+
severe: 'var(--fgColor-severe, var(--color-severe-fg))',
|
|
9
|
+
done: 'var(--fgColor-done, var(--color-done-fg))',
|
|
10
|
+
muted: 'var(--fgColor-muted, var(--color-fg-muted))',
|
|
11
|
+
default: 'inherit',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a colour: a known token becomes the themed CSS variable, anything
|
|
15
|
+
* else is passed through so a caller can still give a literal colour.
|
|
16
|
+
*/
|
|
17
|
+
function resolveColor(color) {
|
|
18
|
+
if (!color) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return THEME_COLORS[color] ?? color;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A line of text in which one or more words change, in step.
|
|
25
|
+
*
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <AnimatedText
|
|
28
|
+
* parts={[
|
|
29
|
+
* 'Bring ',
|
|
30
|
+
* { words: ['Claude', 'Codex', 'Cursor'], color: 'accent' },
|
|
31
|
+
* '. Datalayer gives it a secure endpoint to your ',
|
|
32
|
+
* { words: ['Notebooks', 'Data', 'Code Sandboxes'], color: 'success' },
|
|
33
|
+
* '.',
|
|
34
|
+
* ]}
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export function AnimatedText({ prefix, words, suffix, parts, color, intervalMs = 1800, transitionMs = 240, style, ...rest }) {
|
|
39
|
+
// The older three-prop form is the same thing with one cycling piece.
|
|
40
|
+
const resolvedParts = useMemo(() => {
|
|
41
|
+
if (parts && parts.length > 0) {
|
|
42
|
+
return parts;
|
|
43
|
+
}
|
|
44
|
+
return [prefix ?? '', { words: words ?? [] }, suffix ?? ''];
|
|
45
|
+
}, [parts, prefix, suffix, words]);
|
|
46
|
+
const cyclingParts = useMemo(() => resolvedParts.filter((part) => typeof part !== 'string' &&
|
|
47
|
+
part.words.filter(word => word.trim().length > 0).length > 0), [resolvedParts]);
|
|
48
|
+
// One index for the whole line: what makes several cycling pieces change
|
|
49
|
+
// together rather than drifting apart.
|
|
50
|
+
const [step, setStep] = useState(0);
|
|
51
|
+
const [visible, setVisible] = useState(true);
|
|
52
|
+
// The tick has to run until every piece has come back round, so a line
|
|
53
|
+
// pairing three words with four does not repeat after three.
|
|
54
|
+
const cycleLength = useMemo(() => {
|
|
55
|
+
const lengths = cyclingParts.map(part => part.words.filter(word => word.trim().length > 0).length);
|
|
56
|
+
return lengths.reduce((total, length) => lowestCommonMultiple(total, length), 1);
|
|
57
|
+
}, [cyclingParts]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (cycleLength <= 1) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const timer = setInterval(() => {
|
|
63
|
+
setVisible(false);
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
setStep(previous => (previous + 1) % cycleLength);
|
|
66
|
+
setVisible(true);
|
|
67
|
+
}, transitionMs);
|
|
68
|
+
}, intervalMs);
|
|
69
|
+
return () => {
|
|
70
|
+
clearInterval(timer);
|
|
71
|
+
};
|
|
72
|
+
}, [cycleLength, intervalMs, transitionMs]);
|
|
73
|
+
const wordStyle = (part) => ({
|
|
74
|
+
display: 'inline-block',
|
|
75
|
+
color: resolveColor(part.color ?? color),
|
|
76
|
+
transition: `opacity ${transitionMs}ms ease, transform ${transitionMs}ms ease`,
|
|
77
|
+
opacity: visible ? 1 : 0,
|
|
78
|
+
transform: visible ? 'translateY(0)' : 'translateY(0.25em)',
|
|
79
|
+
});
|
|
80
|
+
return (_jsx("span", { ...rest, style: style, children: resolvedParts.map((part, index) => {
|
|
81
|
+
if (typeof part === 'string') {
|
|
82
|
+
return _jsx("span", { children: part }, `fixed-${index}`);
|
|
83
|
+
}
|
|
84
|
+
const available = part.words.filter(word => word.trim().length > 0);
|
|
85
|
+
if (available.length === 0) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
return (_jsx("span", { "aria-live": "polite", style: wordStyle(part), children: available[step % available.length] }, `words-${index}`));
|
|
89
|
+
}) }));
|
|
90
|
+
}
|
|
91
|
+
function greatestCommonDivisor(a, b) {
|
|
92
|
+
return b === 0 ? a : greatestCommonDivisor(b, a % b);
|
|
93
|
+
}
|
|
94
|
+
function lowestCommonMultiple(a, b) {
|
|
95
|
+
if (a === 0 || b === 0) {
|
|
96
|
+
return Math.max(a, b);
|
|
97
|
+
}
|
|
98
|
+
return Math.abs(a * b) / greatestCommonDivisor(a, b);
|
|
99
|
+
}
|
|
100
|
+
export default AnimatedText;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { AnimatedText } from './AnimatedText';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof AnimatedText;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Words: Story;
|
|
14
|
+
export declare const Parts: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '../box/Box';
|
|
3
|
+
import { AnimatedText } from './AnimatedText';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/AnimatedText',
|
|
6
|
+
component: AnimatedText,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: { layout: 'fullscreen' },
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Words = {
|
|
12
|
+
args: { prefix: 'Agents that ', words: ['analyse', 'report', 'alert'], suffix: ' for you.', color: 'accent' },
|
|
13
|
+
render: args => (_jsx(Box, { p: 3, bg: "canvas.default", fontSize: 4, children: _jsx(AnimatedText, { ...args }) })),
|
|
14
|
+
};
|
|
15
|
+
export const Parts = {
|
|
16
|
+
args: {
|
|
17
|
+
parts: ['Run ', { words: ['notebooks', 'agents'], color: 'success' }, ' on ', { words: ['GPUs', 'CPUs'], color: 'done' }],
|
|
18
|
+
intervalMs: 1800,
|
|
19
|
+
},
|
|
20
|
+
render: args => (_jsx(Box, { p: 3, bg: "canvas.default", fontSize: 3, children: _jsx(AnimatedText, { ...args }) })),
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AnimatedText';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CopyToClipboardButton } from './CopyToClipboardButton';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CopyToClipboardButton;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const CopyToClipboard: Story;
|
|
14
|
+
export declare const AllButtons: Story;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SyncIcon } from '@primer/octicons-react';
|
|
3
|
+
import { Box } from '../box/Box';
|
|
4
|
+
import { CopyToClipboardButton } from './CopyToClipboardButton';
|
|
5
|
+
import { DownloadCSVButton } from './DownloadCSVButton';
|
|
6
|
+
import { DownloadJsonButton } from './DownloadJsonButton';
|
|
7
|
+
import { LongActionButton } from './LongActionButton';
|
|
8
|
+
import { UploadButton, UploadIconButton } from './UploadButton';
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Components/Buttons',
|
|
11
|
+
component: CopyToClipboardButton,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
parameters: { layout: 'fullscreen' },
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
17
|
+
export const CopyToClipboard = {
|
|
18
|
+
args: { value: 'dla_3f9c2e7d8b1a21e', ariaLabel: 'Copy the key' },
|
|
19
|
+
render: args => (_jsx(Box, { p: 3, bg: "canvas.default", children: _jsx(CopyToClipboardButton, { ...args }) })),
|
|
20
|
+
};
|
|
21
|
+
export const AllButtons = {
|
|
22
|
+
args: { value: 'copied' },
|
|
23
|
+
render: args => (_jsxs(Box, { p: 3, bg: "canvas.default", display: "flex", gap: 3, alignItems: "center", children: [_jsx(CopyToClipboardButton, { ...args }), _jsx(LongActionButton, { label: "Refresh", icon: SyncIcon, onClick: () => wait(2000) }), _jsx(UploadButton, { label: "Upload", upload: () => wait(100) }), _jsx(UploadIconButton, { label: "Upload a file", upload: () => wait(100) }), _jsx(DownloadCSVButton, { data: [{ name: 'alpha', runs: 12 }], fileName: "runs" }), _jsx(DownloadJsonButton, { data: [{ name: 'alpha', runs: 12 }], fileName: "runs" })] })),
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type CopyToClipboardButtonProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
ariaLabel?: string;
|
|
4
|
+
successText?: string;
|
|
5
|
+
errorText?: string;
|
|
6
|
+
direction?: 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
size?: 'small' | 'medium';
|
|
9
|
+
variant?: 'default' | 'invisible' | 'primary' | 'danger';
|
|
10
|
+
onResult?: (copied: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare function CopyToClipboardButton({ value, ariaLabel, successText, errorText, direction, disabled, size, variant, onResult, }: CopyToClipboardButtonProps): import("react").JSX.Element;
|
|
13
|
+
export default CopyToClipboardButton;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* A button that copies a value, its tooltip saying what it copies, then
|
|
8
|
+
* whether it did.
|
|
9
|
+
*
|
|
10
|
+
* @module components/buttons/CopyToClipboardButton
|
|
11
|
+
*/
|
|
12
|
+
import { useMemo, useState } from 'react';
|
|
13
|
+
import { IconButton, Tooltip } from '@primer/react';
|
|
14
|
+
import { CopyIcon } from '@primer/octicons-react';
|
|
15
|
+
const ellipsize = (value, max = 96) => {
|
|
16
|
+
if (!value) {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
if (value.length <= max) {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
const head = Math.floor((max - 1) / 2);
|
|
23
|
+
const tail = max - head - 1;
|
|
24
|
+
return `${value.slice(0, head)}…${value.slice(-tail)}`;
|
|
25
|
+
};
|
|
26
|
+
export function CopyToClipboardButton({ value, ariaLabel = 'Copy to clipboard', successText = 'Copied', errorText = 'Unable to copy', direction = 'n', disabled = false, size = 'small', variant = 'invisible', onResult, }) {
|
|
27
|
+
const [status, setStatus] = useState('idle');
|
|
28
|
+
const hasValue = Boolean(value && value.trim());
|
|
29
|
+
const tooltip = useMemo(() => {
|
|
30
|
+
if (status === 'success') {
|
|
31
|
+
return successText;
|
|
32
|
+
}
|
|
33
|
+
if (status === 'error') {
|
|
34
|
+
return errorText;
|
|
35
|
+
}
|
|
36
|
+
return hasValue ? `Copy: ${ellipsize(value)}` : 'Nothing to copy';
|
|
37
|
+
}, [status, successText, errorText, hasValue, value]);
|
|
38
|
+
const handleClick = async () => {
|
|
39
|
+
if (!hasValue || disabled) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
if (!navigator?.clipboard?.writeText) {
|
|
44
|
+
throw new Error('Clipboard API unavailable');
|
|
45
|
+
}
|
|
46
|
+
await navigator.clipboard.writeText(value);
|
|
47
|
+
setStatus('success');
|
|
48
|
+
onResult?.(true);
|
|
49
|
+
window.setTimeout(() => setStatus('idle'), 1500);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
setStatus('error');
|
|
53
|
+
onResult?.(false);
|
|
54
|
+
window.setTimeout(() => setStatus('idle'), 1800);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const isDisabled = disabled || !hasValue;
|
|
58
|
+
const button = (_jsx(IconButton, { "aria-label": ariaLabel, icon: CopyIcon, size: size, variant: variant, disabled: isDisabled, onClick: handleClick }));
|
|
59
|
+
/*
|
|
60
|
+
* A disabled button wears no tooltip.
|
|
61
|
+
*
|
|
62
|
+
* `Tooltip` only takes interactive content — `button:not([disabled])` — and
|
|
63
|
+
* throws on anything else, which is what a disabled button is. Nothing is
|
|
64
|
+
* lost by leaving it out: a disabled element fires no pointer event, so the
|
|
65
|
+
* tooltip would never have shown. `IconButton` does the same with the one
|
|
66
|
+
* it renders of its own.
|
|
67
|
+
*/
|
|
68
|
+
if (isDisabled) {
|
|
69
|
+
return button;
|
|
70
|
+
}
|
|
71
|
+
return (_jsx(Tooltip, { text: tooltip, direction: direction, children: button }));
|
|
72
|
+
}
|
|
73
|
+
export default CopyToClipboardButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VariantType } from './VariantType';
|
|
2
|
+
type IDownloadCSVButtonProps = {
|
|
3
|
+
data?: object;
|
|
4
|
+
fileName: string;
|
|
5
|
+
variant?: VariantType;
|
|
6
|
+
};
|
|
7
|
+
export declare const DownloadCSVButton: ({ data, fileName, variant, }: IDownloadCSVButtonProps) => import("react").JSX.Element;
|
|
8
|
+
export default DownloadCSVButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
import { Button } from '@primer/react';
|
|
7
|
+
import { DownloadIcon } from '@primer/octicons-react';
|
|
8
|
+
import { downloadCSV } from '../../utils/Download';
|
|
9
|
+
export const DownloadCSVButton = ({ data, fileName, variant = 'default', }) => {
|
|
10
|
+
return (_jsx(Button, { variant: variant, leadingVisual: DownloadIcon, onClick: () => downloadCSV(data, fileName), children: "Download" }));
|
|
11
|
+
};
|
|
12
|
+
export default DownloadCSVButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantType } from './VariantType';
|
|
2
|
+
type IDownloadJsonButtonProps = {
|
|
3
|
+
data?: object;
|
|
4
|
+
fileName: string;
|
|
5
|
+
extension?: string;
|
|
6
|
+
variant?: VariantType;
|
|
7
|
+
};
|
|
8
|
+
export declare const DownloadJsonButton: ({ data, fileName, variant, extension, }: IDownloadJsonButtonProps) => import("react").JSX.Element;
|
|
9
|
+
export default DownloadJsonButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
import { Button } from '@primer/react';
|
|
7
|
+
import { DownloadIcon } from '@primer/octicons-react';
|
|
8
|
+
import { downloadJson } from '../../utils/Download';
|
|
9
|
+
export const DownloadJsonButton = ({ data, fileName, variant = 'default', extension = 'json', }) => {
|
|
10
|
+
return (_jsx(Button, { variant: variant, leadingVisual: DownloadIcon, onClick: () => downloadJson(data, fileName, extension), children: "Download" }));
|
|
11
|
+
};
|
|
12
|
+
export default DownloadJsonButton;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { type ElementType } from 'react';
|
|
3
|
+
type ILongActionButtonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Button onClick callback
|
|
6
|
+
*/
|
|
7
|
+
onClick: () => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Button icon
|
|
10
|
+
*/
|
|
11
|
+
icon: ElementType<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Force displaying button as inProgress
|
|
14
|
+
*/
|
|
15
|
+
inProgress?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Button label
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Button disabled state
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Icon button displaying a spinner while its callback is running.
|
|
27
|
+
*/
|
|
28
|
+
export declare function LongActionButton(props: ILongActionButtonProps): JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { IconButton, Spinner } from '@primer/react';
|
|
4
|
+
/**
|
|
5
|
+
* Icon button displaying a spinner while its callback is running.
|
|
6
|
+
*/
|
|
7
|
+
export function LongActionButton(props) {
|
|
8
|
+
const { label, disabled, onClick, icon, inProgress } = props;
|
|
9
|
+
const [internalInProgress, setInternalInProgress] = useState(false);
|
|
10
|
+
const handleClick = useCallback(async () => {
|
|
11
|
+
setInternalInProgress(true);
|
|
12
|
+
try {
|
|
13
|
+
await onClick();
|
|
14
|
+
}
|
|
15
|
+
finally {
|
|
16
|
+
setInternalInProgress(false);
|
|
17
|
+
}
|
|
18
|
+
}, [onClick, setInternalInProgress]);
|
|
19
|
+
return (
|
|
20
|
+
// The label is Primer's tooltip already; a `title` beside it added the
|
|
21
|
+
// browser's own tooltip a second later (the user, 21 November 2026).
|
|
22
|
+
_jsx(IconButton, { "aria-label": label, disabled: disabled || internalInProgress || inProgress, icon: internalInProgress || inProgress ? () => _jsx(Spinner, { size: "small" }) : icon, size: "small", variant: "invisible", onClick: handleClick }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { VariantType } from './VariantType';
|
|
3
|
+
interface IUploadBaseButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Button component factory
|
|
6
|
+
*/
|
|
7
|
+
buttonFactory: (onClick: () => void) => JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the upload support one or more files
|
|
10
|
+
*/
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Upload callback
|
|
14
|
+
*/
|
|
15
|
+
upload: (file: File) => Promise<unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface IUploadIconButtonProps extends Omit<IUploadBaseButtonProps, 'buttonFactory'> {
|
|
18
|
+
/**
|
|
19
|
+
* Button aria-label
|
|
20
|
+
*/
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function UploadIconButton(props: IUploadIconButtonProps): JSX.Element;
|
|
24
|
+
export interface IUploadButtonProps extends Omit<IUploadBaseButtonProps, 'buttonFactory'> {
|
|
25
|
+
/**
|
|
26
|
+
* Button aria-label
|
|
27
|
+
*/
|
|
28
|
+
label: string;
|
|
29
|
+
/**
|
|
30
|
+
* Button variant
|
|
31
|
+
*/
|
|
32
|
+
variant?: VariantType;
|
|
33
|
+
}
|
|
34
|
+
export declare function UploadButton({ label, variant, ...others }: IUploadButtonProps): JSX.Element;
|
|
35
|
+
export default UploadButton;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useRef } from 'react';
|
|
3
|
+
import { Button, IconButton } from '@primer/react';
|
|
4
|
+
import { UploadIcon } from '@primer/octicons-react';
|
|
5
|
+
function UploadBaseButton(props) {
|
|
6
|
+
const { buttonFactory, multiple, upload } = props;
|
|
7
|
+
const inputRef = useRef(null);
|
|
8
|
+
const onInputChanged = useCallback(() => {
|
|
9
|
+
if (inputRef.current && inputRef.current.files) {
|
|
10
|
+
const files = Array.from(inputRef.current.files);
|
|
11
|
+
Promise.all(files.map(file => upload(file))).catch(reason => {
|
|
12
|
+
const msg = 'Failed to upload files.';
|
|
13
|
+
console.error(msg, reason);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}, [inputRef.current, upload]);
|
|
17
|
+
const onInputClick = useCallback(() => {
|
|
18
|
+
if (inputRef.current) {
|
|
19
|
+
inputRef.current.value = '';
|
|
20
|
+
}
|
|
21
|
+
}, [inputRef.current]);
|
|
22
|
+
return (_jsxs(_Fragment, { children: [buttonFactory(() => {
|
|
23
|
+
inputRef.current?.click();
|
|
24
|
+
}), _jsx("input", { ref: inputRef, style: { display: 'none' }, type: "file", multiple: multiple, onClick: onInputClick, onChange: onInputChanged })] }));
|
|
25
|
+
}
|
|
26
|
+
export function UploadIconButton(props) {
|
|
27
|
+
const { label, ...others } = props;
|
|
28
|
+
const factory = useMemo(() => (onClick) => (_jsx(IconButton, { "aria-label": label, icon: UploadIcon, size: "small", variant: "invisible", onClick: onClick })), [label]);
|
|
29
|
+
return _jsx(UploadBaseButton, { buttonFactory: factory, ...others });
|
|
30
|
+
}
|
|
31
|
+
export function UploadButton({ label, variant = 'primary', ...others }) {
|
|
32
|
+
const factory = useMemo(() => (onClick) => (_jsx(Button, { "aria-label": label, leadingVisual: () => _jsx(UploadIcon, { fill: "white" }), size: "small", variant: variant, onClick: onClick, children: label })), [label, variant]);
|
|
33
|
+
return _jsx(UploadBaseButton, { buttonFactory: factory, ...others });
|
|
34
|
+
}
|
|
35
|
+
export default UploadButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type VariantType = 'default' | 'primary' | 'invisible' | 'danger' | 'link';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
export * from './CopyToClipboardButton';
|
|
6
|
+
export * from './DownloadCSVButton';
|
|
7
|
+
export * from './DownloadJsonButton';
|
|
8
|
+
export * from './LongActionButton';
|
|
9
|
+
export * from './UploadButton';
|
|
10
|
+
export * from './VariantType';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
import { SkeletonAvatar } from '@primer/react/experimental';
|
|
7
|
+
export const AvatarSkeleton = (props) => {
|
|
8
|
+
const { size } = props;
|
|
9
|
+
return (_jsx(_Fragment, { children: _jsx(SkeletonAvatar, { size: size }) }));
|
|
10
|
+
};
|
|
11
|
+
export default AvatarSkeleton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type BusyDotsProps = {
|
|
2
|
+
color?: string;
|
|
3
|
+
fontSize?: number;
|
|
4
|
+
ml?: number;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
intervalMs?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function BusyDots({ color, fontSize, ml, ariaLabel, intervalMs, }: BusyDotsProps): import("react").JSX.Element;
|
|
9
|
+
export default BusyDots;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import { Text } from '@primer/react';
|
|
8
|
+
const DOTS = ['.', '..', '...'];
|
|
9
|
+
export function BusyDots({ color = 'fg.muted', fontSize = 0, ml = 1, ariaLabel = 'In progress', intervalMs = 450, }) {
|
|
10
|
+
const [index, setIndex] = useState(0);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const timer = window.setInterval(() => {
|
|
13
|
+
setIndex(prev => (prev + 1) % DOTS.length);
|
|
14
|
+
}, intervalMs);
|
|
15
|
+
return () => window.clearInterval(timer);
|
|
16
|
+
}, [intervalMs]);
|
|
17
|
+
return (_jsxs(Text, { as: "span", sx: {
|
|
18
|
+
ml,
|
|
19
|
+
color,
|
|
20
|
+
fontSize,
|
|
21
|
+
display: 'inline-block',
|
|
22
|
+
position: 'relative',
|
|
23
|
+
fontWeight: 'semibold',
|
|
24
|
+
}, "aria-label": ariaLabel, children: [_jsx(Text, { as: "span", sx: { visibility: 'hidden' }, children: "..." }), _jsx(Text, { as: "span", sx: {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
left: 0,
|
|
27
|
+
top: 0,
|
|
28
|
+
whiteSpace: 'nowrap',
|
|
29
|
+
}, children: DOTS[index] })] }));
|
|
30
|
+
}
|
|
31
|
+
export default BusyDots;
|