@datalayer/primer-addons 1.0.54 → 1.0.56
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 +18 -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/appearance/ColorModeCircle.js +3 -1
- 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/ViewTabs.d.ts +48 -0
- package/lib/components/tabs/ViewTabs.js +40 -0
- package/lib/components/tabs/ViewTabs.stories.d.ts +13 -0
- package/lib/components/tabs/ViewTabs.stories.js +30 -0
- package/lib/components/tabs/index.d.ts +1 -0
- package/lib/components/tabs/index.js +5 -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/toolbar/Toolbar.d.ts +14 -2
- package/lib/components/toolbar/Toolbar.js +102 -8
- package/lib/components/toolbar/ToolbarRenderer.d.ts +2 -0
- package/lib/components/toolbar/ToolbarRenderer.js +3 -1
- package/lib/components/toolbar/types.d.ts +6 -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
|
@@ -48,7 +48,7 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState, } from "react"
|
|
|
48
48
|
import { ActionMenu, IconButton } from "@primer/react";
|
|
49
49
|
import { KebabHorizontalIcon } from "@primer/octicons-react";
|
|
50
50
|
import { Box } from "../box/Box";
|
|
51
|
-
import { ToolbarRenderer } from "./ToolbarRenderer";
|
|
51
|
+
import { SPACER_MIN_WIDTH, ToolbarRenderer } from "./ToolbarRenderer";
|
|
52
52
|
/** Space between two items, as the flex `gap` below sets it, by default. */
|
|
53
53
|
const ITEM_GAP = 2;
|
|
54
54
|
/** Room kept at the end of the line for the button opening the rest. */
|
|
@@ -81,11 +81,25 @@ function tidyDividers(list) {
|
|
|
81
81
|
* line first among equals — with every priority equal, the tail of the
|
|
82
82
|
* line, as a reader expects.
|
|
83
83
|
*/
|
|
84
|
-
export function overflowKeys(ordered, widthOf, available, gap = ITEM_GAP, triggerWidth = OVERFLOW_TRIGGER_WIDTH
|
|
84
|
+
export function overflowKeys(ordered, widthOf, available, gap = ITEM_GAP, triggerWidth = OVERFLOW_TRIGGER_WIDTH,
|
|
85
|
+
/**
|
|
86
|
+
* Whether an item is laid out on the line: one that draws nothing yet
|
|
87
|
+
* (a chip waiting for its data) is 0px wide and still takes its gap.
|
|
88
|
+
* Unsaid, an item 0px wide takes none.
|
|
89
|
+
*/
|
|
90
|
+
laidOut) {
|
|
85
91
|
const hidden = new Set();
|
|
86
|
-
|
|
92
|
+
// A spacer takes what is left, and never less than its minimum: that minimum, and its gap, are on the line
|
|
93
|
+
// whatever the room (the chat header's leading spacer, 8px and a gap, pushed its last button past the edge).
|
|
94
|
+
const widthOfItem = (item) => item.type === "spacer" ? SPACER_MIN_WIDTH : widthOf(item.key);
|
|
87
95
|
const used = () => {
|
|
88
|
-
|
|
96
|
+
// What the line holds, as the browser lays it out: a 0px item that is
|
|
97
|
+
// on the line takes its gap like any other (the Accountant's two empty
|
|
98
|
+
// chips pushed its last button 2px past the edge, 28 November 2026).
|
|
99
|
+
const shown = ordered.filter((item) => !hidden.has(item.key) &&
|
|
100
|
+
(item.type === "spacer" ||
|
|
101
|
+
widthOfItem(item) > 0 ||
|
|
102
|
+
laidOut?.(item.key) === true));
|
|
89
103
|
const total = shown.reduce((sum, item) => sum + widthOfItem(item), 0);
|
|
90
104
|
return (total +
|
|
91
105
|
Math.max(0, shown.length - 1) * gap +
|
|
@@ -106,7 +120,22 @@ export function overflowKeys(ordered, widthOf, available, gap = ITEM_GAP, trigge
|
|
|
106
120
|
}
|
|
107
121
|
return hidden;
|
|
108
122
|
}
|
|
109
|
-
|
|
123
|
+
/**
|
|
124
|
+
* The least room a line needs: the items that never leave it — pinned, spacers at their minimum, and those laid
|
|
125
|
+
* out empty, which still take their gap — and, when any item can leave, the menu's button with its gap.
|
|
126
|
+
* Exported for tests.
|
|
127
|
+
*/
|
|
128
|
+
export function minimumWidthOf(ordered, widthOf, gap = ITEM_GAP, triggerWidth = OVERFLOW_TRIGGER_WIDTH, laidOut) {
|
|
129
|
+
const width = (item) => (item.type === "spacer" ? SPACER_MIN_WIDTH : widthOf(item.key));
|
|
130
|
+
const stays = ordered.filter((item) => item.type === "spacer" ||
|
|
131
|
+
(item.pinned === true && width(item) > 0) ||
|
|
132
|
+
(width(item) === 0 && laidOut?.(item.key) === true));
|
|
133
|
+
const leaves = ordered.some((item) => !item.pinned && item.type !== "spacer" && width(item) > 0);
|
|
134
|
+
return (stays.reduce((sum, item) => sum + width(item), 0) +
|
|
135
|
+
Math.max(0, stays.length - 1) * gap +
|
|
136
|
+
(leaves ? gap + triggerWidth : 0));
|
|
137
|
+
}
|
|
138
|
+
export function Toolbar({ items, extraItems, className, disabled, ariaLabel = "Editor toolbar", overflow = true, variant = "bar", gap = ITEM_GAP, overflowAriaLabel, keyboardNavigation = true, onMinimumWidth, }) {
|
|
110
139
|
const allItems = useMemo(() => {
|
|
111
140
|
if (!extraItems?.length)
|
|
112
141
|
return items;
|
|
@@ -138,6 +167,8 @@ export function Toolbar({ items, extraItems, className, disabled, ariaLabel = "E
|
|
|
138
167
|
.sort((a, b) => (a.order ?? 100) - (b.order ?? 100)), [allItems]);
|
|
139
168
|
const containerRef = useRef(null);
|
|
140
169
|
const rowRef = useRef(null);
|
|
170
|
+
/** Room the line takes that the sum of its items does not account for. */
|
|
171
|
+
const unseen = useRef(0);
|
|
141
172
|
/*
|
|
142
173
|
* The width of every item, by key, measured while it was on the line.
|
|
143
174
|
*
|
|
@@ -148,6 +179,11 @@ export function Toolbar({ items, extraItems, className, disabled, ariaLabel = "E
|
|
|
148
179
|
*/
|
|
149
180
|
const widths = useRef(new Map());
|
|
150
181
|
const [hiddenKeys, setHiddenKeys] = useState(() => new Set());
|
|
182
|
+
// What is off the line now, for the measurement to compare its answer with.
|
|
183
|
+
const hiddenNow = useRef(hiddenKeys);
|
|
184
|
+
hiddenNow.current = hiddenKeys;
|
|
185
|
+
// The least room last told to the host.
|
|
186
|
+
const minimumNow = useRef(-1);
|
|
151
187
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
152
188
|
const keys = useMemo(() => ordered.map((item) => item.key).join("\u0000"), [ordered]);
|
|
153
189
|
const measure = useCallback(() => {
|
|
@@ -166,12 +202,16 @@ export function Toolbar({ items, extraItems, className, disabled, ariaLabel = "E
|
|
|
166
202
|
*/
|
|
167
203
|
// Read off the wrappers' attribute rather than built into a selector: a
|
|
168
204
|
// key is the host's text, and `CSS.escape` is not everywhere (jsdom).
|
|
205
|
+
const onTheLine = new Set();
|
|
169
206
|
row
|
|
170
207
|
.querySelectorAll("[data-toolbar-key]")
|
|
171
208
|
.forEach((node) => {
|
|
172
209
|
const key = node.getAttribute("data-toolbar-key");
|
|
173
210
|
if (key !== null) {
|
|
174
211
|
widths.current.set(key, node.getBoundingClientRect().width);
|
|
212
|
+
if (getComputedStyle(node).display !== "none") {
|
|
213
|
+
onTheLine.add(key);
|
|
214
|
+
}
|
|
175
215
|
}
|
|
176
216
|
});
|
|
177
217
|
const style = getComputedStyle(container);
|
|
@@ -196,15 +236,40 @@ export function Toolbar({ items, extraItems, className, disabled, ariaLabel = "E
|
|
|
196
236
|
}
|
|
197
237
|
// An item never measured is assumed to fit; the next pass, once it has
|
|
198
238
|
// been on the line, knows better.
|
|
199
|
-
const
|
|
239
|
+
const widthOf = (key) => widths.current.get(key) ?? 0;
|
|
240
|
+
const laidOut = (key) => onTheLine.has(key);
|
|
241
|
+
/*
|
|
242
|
+
* The browser has the last word. Where the sum says the line fits and
|
|
243
|
+
* the line runs past the edge anyway (a gap or a margin the sum does
|
|
244
|
+
* not know of), the excess is remembered and taken off the room — kept
|
|
245
|
+
* until the items change, so that moving one into the menu, which ends
|
|
246
|
+
* the excess, does not bring it straight back.
|
|
247
|
+
*/
|
|
248
|
+
let next = overflowKeys(ordered, widthOf, available - unseen.current, gap, undefined, laidOut);
|
|
249
|
+
// Read on the line itself: it shrinks beside the menu's button, and what runs past it runs under that button.
|
|
250
|
+
// Only when the sum agrees with what is drawn: mid-change, the line can still show the items the sum moved.
|
|
251
|
+
const excess = row.scrollWidth - row.clientWidth;
|
|
252
|
+
const agrees = next.size === hiddenNow.current.size &&
|
|
253
|
+
[...next].every((key) => hiddenNow.current.has(key));
|
|
254
|
+
if (agrees && excess > 0.5) {
|
|
255
|
+
unseen.current += excess;
|
|
256
|
+
next = overflowKeys(ordered, widthOf, available - unseen.current, gap, undefined, laidOut);
|
|
257
|
+
}
|
|
258
|
+
// The least room the line needs, told to the host when it changes.
|
|
259
|
+
const minimum = Math.ceil(minimumWidthOf(ordered, widthOf, gap, undefined, laidOut));
|
|
260
|
+
if (minimum !== minimumNow.current) {
|
|
261
|
+
minimumNow.current = minimum;
|
|
262
|
+
onMinimumWidth?.(minimum);
|
|
263
|
+
}
|
|
200
264
|
setHiddenKeys((previous) => previous.size === next.size && [...next].every((key) => previous.has(key))
|
|
201
265
|
? previous
|
|
202
266
|
: next);
|
|
203
|
-
}, [ordered, gap]);
|
|
267
|
+
}, [ordered, gap, onMinimumWidth]);
|
|
204
268
|
useLayoutEffect(() => {
|
|
205
269
|
// A new set of items is shown whole first, so each one is measured on
|
|
206
270
|
// the line before anything is taken off it.
|
|
207
271
|
setHiddenKeys(new Set());
|
|
272
|
+
unseen.current = 0;
|
|
208
273
|
}, [keys, overflow]);
|
|
209
274
|
useLayoutEffect(() => {
|
|
210
275
|
if (!overflow) {
|
|
@@ -229,7 +294,36 @@ export function Toolbar({ items, extraItems, className, disabled, ariaLabel = "E
|
|
|
229
294
|
row
|
|
230
295
|
.querySelectorAll("[data-toolbar-key]")
|
|
231
296
|
.forEach((node) => observer.observe(node));
|
|
232
|
-
|
|
297
|
+
/*
|
|
298
|
+
* And what changes without changing size: a chip that waits for its data
|
|
299
|
+
* is put on the line still 0px wide, which takes a gap and resizes
|
|
300
|
+
* nothing — the Accountant's two empty chips pushed the agent chooser
|
|
301
|
+
* past the edge on first load, unheard (28 November 2026).
|
|
302
|
+
*/
|
|
303
|
+
let frame = 0;
|
|
304
|
+
const mutations = typeof MutationObserver === "undefined"
|
|
305
|
+
? null
|
|
306
|
+
: new MutationObserver(() => {
|
|
307
|
+
if (frame === 0) {
|
|
308
|
+
frame = requestAnimationFrame(() => {
|
|
309
|
+
frame = 0;
|
|
310
|
+
measure();
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
mutations?.observe(row, {
|
|
315
|
+
subtree: true,
|
|
316
|
+
childList: true,
|
|
317
|
+
attributes: true,
|
|
318
|
+
attributeFilter: ["style", "class", "hidden"],
|
|
319
|
+
});
|
|
320
|
+
return () => {
|
|
321
|
+
observer.disconnect();
|
|
322
|
+
mutations?.disconnect();
|
|
323
|
+
if (frame !== 0) {
|
|
324
|
+
cancelAnimationFrame(frame);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
233
327
|
}, [measure, overflow, hiddenKeys]);
|
|
234
328
|
const onKeyDown = useCallback((event) => {
|
|
235
329
|
if (!keyboardNavigation) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ToolbarItem } from "./types";
|
|
2
|
+
/** The least a spacer takes on the line: the overflow counts it, so the two never disagree. */
|
|
3
|
+
export declare const SPACER_MIN_WIDTH = 8;
|
|
2
4
|
export interface ToolbarRendererProps {
|
|
3
5
|
items: ToolbarItem[];
|
|
4
6
|
disabled?: boolean;
|
|
@@ -15,6 +15,8 @@ import { Box } from "../box/Box";
|
|
|
15
15
|
import { ToolbarButton } from "./ToolbarButton";
|
|
16
16
|
import { ToolbarDropdown } from "./ToolbarDropdown";
|
|
17
17
|
import { ToolbarDivider } from "./ToolbarDivider";
|
|
18
|
+
/** The least a spacer takes on the line: the overflow counts it, so the two never disagree. */
|
|
19
|
+
export const SPACER_MIN_WIDTH = 8;
|
|
18
20
|
/**
|
|
19
21
|
* Sort items by order, then render each one according to its type.
|
|
20
22
|
*/
|
|
@@ -32,7 +34,7 @@ export function ToolbarRenderer({ items, disabled, size = "medium", showLabel =
|
|
|
32
34
|
case "divider":
|
|
33
35
|
return (_jsx(Fragment, { children: _jsx(ToolbarDivider, { orientation: direction === "column" ? "horizontal" : "vertical" }) }, item.key));
|
|
34
36
|
case "spacer":
|
|
35
|
-
return (_jsx(Box, { sx: { flex: "1 1 auto", minWidth:
|
|
37
|
+
return (_jsx(Box, { sx: { flex: "1 1 auto", minWidth: SPACER_MIN_WIDTH } }, item.key));
|
|
36
38
|
case "custom":
|
|
37
39
|
return _jsx(Fragment, { children: item.render() }, item.key);
|
|
38
40
|
default:
|
|
@@ -181,6 +181,12 @@ export interface ToolbarProps {
|
|
|
181
181
|
* default.
|
|
182
182
|
*/
|
|
183
183
|
keyboardNavigation?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* The least room the line needs, in pixels: what never leaves it (pinned items, spacers at their minimum, the
|
|
186
|
+
* gaps of items laid out empty) and, when anything can leave, the menu's button. Called when it changes, so a
|
|
187
|
+
* host can keep that room for the toolbar — what is beside it gives way instead of running under it.
|
|
188
|
+
*/
|
|
189
|
+
onMinimumWidth?: (width: number) => void;
|
|
184
190
|
}
|
|
185
191
|
/**
|
|
186
192
|
* Props for the extensible FloatingToolbar component.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncate: one line of text, cut by an ellipsis at a width, the whole text in
|
|
3
|
+
* its tooltip — Primer's `Truncate`
|
|
4
|
+
* (packages/react/src/Truncate/Truncate.tsx), drawn on Primer Addons' `Box`.
|
|
5
|
+
*
|
|
6
|
+
* What it adds: its `sx` is a real `sx`. Primer's own drops what its CSS module
|
|
7
|
+
* does not foresee — a container query among them, so a header's description
|
|
8
|
+
* could not leave a row too short to say it and showed its first letter
|
|
9
|
+
* ("W…"). Here the base styles and the caller's `sx` are one object, nested
|
|
10
|
+
* selectors, `@media` and `@container` included. Everything else is Primer's:
|
|
11
|
+
* `title` (required), `inline`, `expandable` and `maxWidth` (125px by default),
|
|
12
|
+
* `as`.
|
|
13
|
+
*
|
|
14
|
+
* @module components/truncate/Truncate
|
|
15
|
+
*/
|
|
16
|
+
import { type CSSProperties, type ElementType, type ReactNode } from 'react';
|
|
17
|
+
/** Styles as `sx` takes them: nested selectors, `@media` and `@container` included. */
|
|
18
|
+
export type TruncateSx = Record<string, unknown>;
|
|
19
|
+
export type TruncateProps = {
|
|
20
|
+
/** The whole text, shown in the tooltip. */
|
|
21
|
+
title: string;
|
|
22
|
+
/** Drawn inline (`inline-block`), beside other text; else as its parent's `display`. */
|
|
23
|
+
inline?: boolean;
|
|
24
|
+
/** Shows the whole text on hover. */
|
|
25
|
+
expandable?: boolean;
|
|
26
|
+
/** The width it is cut at: pixels when a number, any CSS length when a string; 125px by default. */
|
|
27
|
+
maxWidth?: number | string;
|
|
28
|
+
/** The element drawn. */
|
|
29
|
+
as?: ElementType;
|
|
30
|
+
/** Styles, merged over the base ones. */
|
|
31
|
+
sx?: TruncateSx;
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
/** `data-*`, `aria-*`, `id` and the other attributes, passed through. */
|
|
36
|
+
[attribute: `data-${string}` | `aria-${string}`]: unknown;
|
|
37
|
+
id?: string;
|
|
38
|
+
};
|
|
39
|
+
/** The base styles: Primer's CSS module, as `sx`. */
|
|
40
|
+
export declare const TRUNCATE_SX: TruncateSx;
|
|
41
|
+
/** The `--truncate-max-width` a `maxWidth` gives. */
|
|
42
|
+
export declare const truncateMaxWidth: (maxWidth: number | string | undefined) => string | undefined;
|
|
43
|
+
export declare const Truncate: import("react").ForwardRefExoticComponent<TruncateProps & import("react").RefAttributes<HTMLElement>>;
|
|
44
|
+
export default Truncate;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Truncate: one line of text, cut by an ellipsis at a width, the whole text in
|
|
8
|
+
* its tooltip — Primer's `Truncate`
|
|
9
|
+
* (packages/react/src/Truncate/Truncate.tsx), drawn on Primer Addons' `Box`.
|
|
10
|
+
*
|
|
11
|
+
* What it adds: its `sx` is a real `sx`. Primer's own drops what its CSS module
|
|
12
|
+
* does not foresee — a container query among them, so a header's description
|
|
13
|
+
* could not leave a row too short to say it and showed its first letter
|
|
14
|
+
* ("W…"). Here the base styles and the caller's `sx` are one object, nested
|
|
15
|
+
* selectors, `@media` and `@container` included. Everything else is Primer's:
|
|
16
|
+
* `title` (required), `inline`, `expandable` and `maxWidth` (125px by default),
|
|
17
|
+
* `as`.
|
|
18
|
+
*
|
|
19
|
+
* @module components/truncate/Truncate
|
|
20
|
+
*/
|
|
21
|
+
import { forwardRef, } from 'react';
|
|
22
|
+
import { Box } from '../box/Box';
|
|
23
|
+
/** The base styles: Primer's CSS module, as `sx`. */
|
|
24
|
+
export const TRUNCATE_SX = {
|
|
25
|
+
display: 'inherit',
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
textOverflow: 'ellipsis',
|
|
28
|
+
whiteSpace: 'nowrap',
|
|
29
|
+
maxWidth: 'var(--truncate-max-width)',
|
|
30
|
+
'&[data-expandable]:hover': { maxWidth: '10000px' },
|
|
31
|
+
'&[data-inline]': { display: 'inline-block', verticalAlign: 'top' },
|
|
32
|
+
};
|
|
33
|
+
/** The `--truncate-max-width` a `maxWidth` gives. */
|
|
34
|
+
export const truncateMaxWidth = (maxWidth) => typeof maxWidth === 'number'
|
|
35
|
+
? `${maxWidth}px`
|
|
36
|
+
: typeof maxWidth === 'string'
|
|
37
|
+
? maxWidth
|
|
38
|
+
: undefined;
|
|
39
|
+
export const Truncate = forwardRef(function Truncate({ as = 'div', children, className, title, inline, expandable, maxWidth = 125, style, sx, ...rest }, ref) {
|
|
40
|
+
return (_jsx(Box, { as: as, ...rest, ref: ref, className: className, "data-expandable": expandable ? '' : undefined, "data-inline": inline ? '' : undefined, title: title, style: {
|
|
41
|
+
...style,
|
|
42
|
+
['--truncate-max-width']: truncateMaxWidth(maxWidth),
|
|
43
|
+
}, sx: { ...TRUNCATE_SX, ...sx }, children: children }));
|
|
44
|
+
});
|
|
45
|
+
Truncate.displayName = 'Truncate';
|
|
46
|
+
export default Truncate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<import("./Truncate").TruncateProps & import("react").RefAttributes<HTMLElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const Expandable: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '../box/Box';
|
|
3
|
+
import { Truncate } from './Truncate';
|
|
4
|
+
const LONG = 'datalayer-agent-runtime-with-a-very-long-name-7f3a9c2e';
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Truncate',
|
|
7
|
+
component: Truncate,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: { layout: 'fullscreen' },
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: { title: LONG, children: LONG, maxWidth: 160 },
|
|
14
|
+
render: args => (_jsx(Box, { p: 3, bg: "canvas.default", children: _jsx(Truncate, { ...args }) })),
|
|
15
|
+
};
|
|
16
|
+
export const Expandable = {
|
|
17
|
+
args: { title: LONG, children: LONG, expandable: true },
|
|
18
|
+
render: args => (_jsx(Box, { p: 3, bg: "canvas.default", children: _jsx(Truncate, { ...args }) })),
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Truncate';
|
|
@@ -94,7 +94,7 @@ export declare const agentFocusRing: {
|
|
|
94
94
|
readonly dark: "#636363";
|
|
95
95
|
};
|
|
96
96
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
97
|
-
export declare const agentThemeStyles: import("
|
|
97
|
+
export declare const agentThemeStyles: import("..").ThemeStyles;
|
|
98
98
|
/**
|
|
99
99
|
* The agent theme's whole stylesheet (`ThemeStyles.css`): its controls as
|
|
100
100
|
* pills and its tables rounder, drawn from its shape, then its own rules.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
2
|
-
export declare const datalayerThemeStyles: import("
|
|
2
|
+
export declare const datalayerThemeStyles: import("..").ThemeStyles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
2
|
-
export declare const earthThemeStyles: import("
|
|
2
|
+
export declare const earthThemeStyles: import("..").ThemeStyles;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
3
3
|
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
4
4
|
*/
|
|
5
|
-
export declare const ivoryThemeStyles: import("
|
|
5
|
+
export declare const ivoryThemeStyles: import("..").ThemeStyles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
2
|
-
export declare const lovelyThemeStyles: import("
|
|
2
|
+
export declare const lovelyThemeStyles: import("..").ThemeStyles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
2
|
-
export declare const matrixThemeStyles: import("
|
|
2
|
+
export declare const matrixThemeStyles: import("..").ThemeStyles;
|
|
@@ -22,4 +22,4 @@ export declare const metalFocusRing: {
|
|
|
22
22
|
readonly dark: string;
|
|
23
23
|
};
|
|
24
24
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode: Agent's curves, Metal's look. */
|
|
25
|
-
export declare const metalThemeStyles: import("
|
|
25
|
+
export declare const metalThemeStyles: import("..").ThemeStyles;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
3
3
|
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
4
4
|
*/
|
|
5
|
-
export declare const sandThemeStyles: import("
|
|
5
|
+
export declare const sandThemeStyles: import("..").ThemeStyles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
2
|
-
export declare const spatialThemeStyles: import("
|
|
2
|
+
export declare const spatialThemeStyles: import("..").ThemeStyles;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
3
3
|
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
4
4
|
*/
|
|
5
|
-
export declare const sunThemeStyles: import("
|
|
5
|
+
export declare const sunThemeStyles: import("..").ThemeStyles;
|
|
@@ -6,4 +6,4 @@ export declare const vscodeDark: ThemeColorDefs;
|
|
|
6
6
|
* the portable theme tokens carry. The web's `vscodeThemeStyles`
|
|
7
7
|
* (`vscodeTheme.ts`) adds the editors' face to it.
|
|
8
8
|
*/
|
|
9
|
-
export declare const vscodePortableThemeStyles: import("
|
|
9
|
+
export declare const vscodePortableThemeStyles: import("..").ThemeStyles;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
export function jsonToCSVString(json) {
|
|
6
|
+
const headers = Object.keys(json[0]);
|
|
7
|
+
let csvString = '';
|
|
8
|
+
csvString += headers.join(',') + '\n';
|
|
9
|
+
json.forEach((obj) => {
|
|
10
|
+
const rowCells = headers.map(header => {
|
|
11
|
+
const val = obj[header];
|
|
12
|
+
if (typeof val === 'number') {
|
|
13
|
+
return val;
|
|
14
|
+
}
|
|
15
|
+
if (typeof val === 'string') {
|
|
16
|
+
return val;
|
|
17
|
+
}
|
|
18
|
+
if (val instanceof Date) {
|
|
19
|
+
return val.toISOString();
|
|
20
|
+
}
|
|
21
|
+
return '';
|
|
22
|
+
});
|
|
23
|
+
const row = rowCells.join(',');
|
|
24
|
+
csvString += row + '\n';
|
|
25
|
+
});
|
|
26
|
+
return csvString;
|
|
27
|
+
}
|
|
28
|
+
export const downloadJson = (data, fileName, extension) => {
|
|
29
|
+
const jsonData = new Blob([JSON.stringify(data)], {
|
|
30
|
+
type: 'application/json',
|
|
31
|
+
});
|
|
32
|
+
const jsonURL = URL.createObjectURL(jsonData);
|
|
33
|
+
const jsonLink = document.createElement('a');
|
|
34
|
+
jsonLink.href = jsonURL;
|
|
35
|
+
jsonLink.download = `${fileName}.${extension}`;
|
|
36
|
+
document.body.appendChild(jsonLink);
|
|
37
|
+
jsonLink.click();
|
|
38
|
+
document.body.removeChild(jsonLink);
|
|
39
|
+
};
|
|
40
|
+
export const downloadCSV = (data, fileName) => {
|
|
41
|
+
const csvString = jsonToCSVString(data);
|
|
42
|
+
const csvData = new Blob([csvString], { type: 'text/csv' });
|
|
43
|
+
const csvURL = URL.createObjectURL(csvData);
|
|
44
|
+
const csvLink = document.createElement('a');
|
|
45
|
+
csvLink.href = csvURL;
|
|
46
|
+
csvLink.download = `${fileName}.csv`;
|
|
47
|
+
document.body.appendChild(csvLink);
|
|
48
|
+
csvLink.click();
|
|
49
|
+
document.body.removeChild(csvLink);
|
|
50
|
+
};
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/primer-addons",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.56",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run build:lib",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"@primer/react": "^37.31.0",
|
|
42
42
|
"react-loading-skeleton": "^3.5.0",
|
|
43
43
|
"styled-components": "^5.3.10",
|
|
44
|
+
"usehooks-ts": "3.1.1",
|
|
44
45
|
"zustand": "^5.0.0"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
@@ -51,6 +52,8 @@
|
|
|
51
52
|
"react": "19.2.8",
|
|
52
53
|
"react-dom": "19.2.8",
|
|
53
54
|
"jsdom": "^26.1.0",
|
|
55
|
+
"@testing-library/dom": "^10.4.1",
|
|
56
|
+
"@testing-library/react": "^16.3.3",
|
|
54
57
|
"rimraf": "^6.0.1",
|
|
55
58
|
"vitest": "^3.2.7",
|
|
56
59
|
"@storybook/addon-docs": "^9.0.15",
|