From 6c83436865020a7b3e6cb4bf4bcc80d4d2037638 Mon Sep 17 00:00:00 2001 From: Jamie Henson Date: Tue, 23 Jun 2026 13:25:17 +0100 Subject: [PATCH] feat(docs): docs-native Icon component, drop @ably/ui/core/Icon (DX-1128) Vendor a local Icon that renders only Ably's own glyphs (product, social, tech, gui-prod). Heroicons are now imported directly from @heroicons/react as components at each call site, so they tree-shake instead of going through a name->component lookup that bundles the whole set. This keeps the custom Icon's responsibility narrow and matches the direction for the rest of the vendored components. --- .eslintignore | 2 + .prettierignore | 3 + package.json | 1 + src/components/Examples/ExamplesCheckbox.tsx | 9 +- src/components/Examples/ExamplesFilter.tsx | 11 +- src/components/Examples/ExamplesGrid.tsx | 4 +- src/components/Examples/ExamplesRenderer.tsx | 2 +- .../Icon/glyphs/icon-gui-ably-badge.tsx | 14 ++ .../icon-gui-prod-ai-transport-outline.tsx | 14 ++ .../icon-gui-prod-ai-transport-solid.tsx | 14 ++ .../glyphs/icon-gui-prod-chat-outline.tsx | 14 ++ .../Icon/glyphs/icon-gui-prod-chat-solid.tsx | 14 ++ .../icon-gui-prod-liveobjects-outline.tsx | 14 ++ .../icon-gui-prod-liveobjects-solid.tsx | 14 ++ .../glyphs/icon-gui-prod-livesync-outline.tsx | 14 ++ .../glyphs/icon-gui-prod-livesync-solid.tsx | 14 ++ .../glyphs/icon-gui-prod-pubsub-outline.tsx | 14 ++ .../glyphs/icon-gui-prod-pubsub-solid.tsx | 14 ++ .../glyphs/icon-gui-prod-spaces-outline.tsx | 14 ++ .../glyphs/icon-gui-prod-spaces-solid.tsx | 14 ++ .../Icon/glyphs/icon-gui-resources.tsx | 14 ++ .../glyphs/icon-product-ai-transport-mono.tsx | 14 ++ .../Icon/glyphs/icon-product-ai-transport.tsx | 14 ++ .../Icon/glyphs/icon-product-chat-mono.tsx | 14 ++ .../Icon/glyphs/icon-product-chat.tsx | 14 ++ .../glyphs/icon-product-liveobjects-mono.tsx | 14 ++ .../Icon/glyphs/icon-product-liveobjects.tsx | 14 ++ .../glyphs/icon-product-livesync-mono.tsx | 14 ++ .../Icon/glyphs/icon-product-livesync.tsx | 14 ++ .../glyphs/icon-product-platform-mono.tsx | 14 ++ .../Icon/glyphs/icon-product-platform.tsx | 14 ++ .../Icon/glyphs/icon-product-pubsub-mono.tsx | 14 ++ .../Icon/glyphs/icon-product-pubsub.tsx | 14 ++ .../Icon/glyphs/icon-product-spaces-mono.tsx | 14 ++ .../Icon/glyphs/icon-product-spaces.tsx | 14 ++ .../Icon/glyphs/icon-social-discord-mono.tsx | 14 ++ .../Icon/glyphs/icon-social-github-mono.tsx | 14 ++ .../Icon/glyphs/icon-social-github.tsx | 14 ++ .../Icon/glyphs/icon-social-linkedin-mono.tsx | 14 ++ .../glyphs/icon-social-stackoverflow-mono.tsx | 14 ++ .../Icon/glyphs/icon-social-x-mono.tsx | 14 ++ .../Icon/glyphs/icon-social-youtube-mono.tsx | 14 ++ .../Icon/glyphs/icon-tech-android-full.tsx | 14 ++ .../Icon/glyphs/icon-tech-claude-mono.tsx | 14 ++ .../Icon/glyphs/icon-tech-csharp.tsx | 14 ++ .../Icon/glyphs/icon-tech-flutter.tsx | 14 ++ src/components/Icon/glyphs/icon-tech-go.tsx | 14 ++ src/components/Icon/glyphs/icon-tech-java.tsx | 14 ++ .../Icon/glyphs/icon-tech-javascript.tsx | 14 ++ src/components/Icon/glyphs/icon-tech-json.tsx | 14 ++ .../Icon/glyphs/icon-tech-kotlin.tsx | 14 ++ .../glyphs/icon-tech-laravel-broadcast.tsx | 14 ++ .../Icon/glyphs/icon-tech-nextjs.tsx | 16 +++ .../Icon/glyphs/icon-tech-nodejs.tsx | 14 ++ .../Icon/glyphs/icon-tech-objectivec.tsx | 14 ++ .../Icon/glyphs/icon-tech-openai.tsx | 14 ++ src/components/Icon/glyphs/icon-tech-php.tsx | 14 ++ .../Icon/glyphs/icon-tech-postgres.tsx | 14 ++ .../Icon/glyphs/icon-tech-python.tsx | 14 ++ .../Icon/glyphs/icon-tech-react.tsx | 14 ++ .../Icon/glyphs/icon-tech-reactnative.tsx | 14 ++ src/components/Icon/glyphs/icon-tech-ruby.tsx | 14 ++ .../Icon/glyphs/icon-tech-swift.tsx | 14 ++ .../Icon/glyphs/icon-tech-typescript.tsx | 14 ++ .../Icon/glyphs/icon-tech-vercel.tsx | 14 ++ src/components/Icon/glyphs/icon-tech-web.tsx | 14 ++ src/components/Icon/glyphs/index.ts | 126 ++++++++++++++++++ src/components/Icon/index.tsx | 60 +++++++++ src/components/Icon/set-unique-ids.ts | 32 +++++ src/components/Icon/types.ts | 5 + src/components/Layout/Breadcrumbs.tsx | 28 ++-- src/components/Layout/CopyForLLM.test.tsx | 2 +- src/components/Layout/CopyForLLM.tsx | 16 ++- src/components/Layout/Footer.tsx | 51 +++---- src/components/Layout/Header.test.tsx | 6 +- src/components/Layout/Header.tsx | 43 ++++-- .../Layout/LanguageSelector.test.tsx | 7 +- src/components/Layout/LanguageSelector.tsx | 22 ++- src/components/Layout/LeftSidebar.tsx | 18 +-- src/components/Layout/MDXWrapper.test.tsx | 2 +- src/components/Layout/ProductBar.test.tsx | 2 +- src/components/Layout/ProductBar.tsx | 7 +- src/components/Layout/mdx/tiles.tsx | 4 +- src/components/Markdown/CodeBlock.test.tsx | 2 +- src/components/Markdown/CodeBlock.tsx | 4 +- src/components/Redoc/GoTopButton.tsx | 8 +- src/components/SDKsPage/Card/index.tsx | 5 +- src/components/blocks/dividers/Aside.tsx | 7 +- .../blocks/software/Code/ApiKeyIndicator.tsx | 4 +- src/data/nav/types.ts | 2 +- src/pages/docs/api/chat-rest.tsx | 9 +- src/pages/docs/api/control-api.tsx | 9 +- src/pages/docs/api/liveobjects-rest.tsx | 9 +- src/templates/examples.tsx | 4 +- 94 files changed, 1206 insertions(+), 148 deletions(-) create mode 100644 .eslintignore create mode 100644 src/components/Icon/glyphs/icon-gui-ably-badge.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-ai-transport-outline.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-ai-transport-solid.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-chat-outline.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-chat-solid.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-liveobjects-outline.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-liveobjects-solid.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-livesync-outline.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-livesync-solid.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-pubsub-outline.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-pubsub-solid.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-spaces-outline.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-prod-spaces-solid.tsx create mode 100644 src/components/Icon/glyphs/icon-gui-resources.tsx create mode 100644 src/components/Icon/glyphs/icon-product-ai-transport-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-product-ai-transport.tsx create mode 100644 src/components/Icon/glyphs/icon-product-chat-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-product-chat.tsx create mode 100644 src/components/Icon/glyphs/icon-product-liveobjects-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-product-liveobjects.tsx create mode 100644 src/components/Icon/glyphs/icon-product-livesync-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-product-livesync.tsx create mode 100644 src/components/Icon/glyphs/icon-product-platform-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-product-platform.tsx create mode 100644 src/components/Icon/glyphs/icon-product-pubsub-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-product-pubsub.tsx create mode 100644 src/components/Icon/glyphs/icon-product-spaces-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-product-spaces.tsx create mode 100644 src/components/Icon/glyphs/icon-social-discord-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-social-github-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-social-github.tsx create mode 100644 src/components/Icon/glyphs/icon-social-linkedin-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-social-stackoverflow-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-social-x-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-social-youtube-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-android-full.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-claude-mono.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-csharp.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-flutter.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-go.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-java.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-javascript.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-json.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-kotlin.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-laravel-broadcast.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-nextjs.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-nodejs.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-objectivec.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-openai.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-php.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-postgres.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-python.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-react.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-reactnative.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-ruby.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-swift.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-typescript.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-vercel.tsx create mode 100644 src/components/Icon/glyphs/icon-tech-web.tsx create mode 100644 src/components/Icon/glyphs/index.ts create mode 100644 src/components/Icon/index.tsx create mode 100644 src/components/Icon/set-unique-ids.ts create mode 100644 src/components/Icon/types.ts diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..f7ec20a985 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +# Icon glyphs — generated via SVGR from @ably/ui's SVG sources (DX-1128) +src/components/Icon/glyphs/ diff --git a/.prettierignore b/.prettierignore index f8dfafd431..2ceb138a62 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,3 +9,6 @@ data/onPostBuild/__fixtures__/*.mdx # Vendored @ably/ui design tokens, reset and component CSS (DX-1128) - do not reformat src/styles/ui/ + +# Icon glyphs — generated via SVGR from @ably/ui's SVG sources (DX-1128), do not reformat +src/components/Icon/glyphs/ diff --git a/package.json b/package.json index 6e322c5409..66340d43c3 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@codesandbox/sandpack-react": "^2.20.0", "@codesandbox/sandpack-themes": "^2.0.21", "@gfx/zopfli": "^1.0.15", + "@heroicons/react": "^2.2.0", "@mdx-js/react": "^2.3.0", "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-dropdown-menu": "^2.1.16", diff --git a/src/components/Examples/ExamplesCheckbox.tsx b/src/components/Examples/ExamplesCheckbox.tsx index 1b756abe85..31871d63bf 100644 --- a/src/components/Examples/ExamplesCheckbox.tsx +++ b/src/components/Examples/ExamplesCheckbox.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import Icon from '@ably/ui/core/Icon'; import cn from 'src/utilities/cn'; +import { CheckIcon } from '@heroicons/react/24/outline'; const ExamplesCheckbox = ({ label, @@ -35,10 +35,9 @@ const ExamplesCheckbox = ({ data-ui-checkbox-styled="" className={cn(['ui-checkbox-styled', disabled && '!border-neutral-800 !bg-orange-600'])} > -