From c984e55ab254804642dbbbb167ea86ea04de79a8 Mon Sep 17 00:00:00 2001 From: Thomas Draier Date: Fri, 5 Jul 2024 13:33:37 +0200 Subject: [PATCH] Refactor packaging, compile tsc & tailwind --- sparkle/.eslintrc.js | 1 + sparkle/package-lock.json | 4 +- sparkle/package.json | 12 +- sparkle/rollup.config.mjs | 19 +- sparkle/src/_index.ts | 716 ------------------ sparkle/src/components/AssistantPreview.tsx | 12 +- sparkle/src/components/Avatar.tsx | 4 +- sparkle/src/components/Banner.tsx | 3 +- sparkle/src/components/BarHeader.tsx | 16 +- sparkle/src/components/Button.tsx | 6 +- sparkle/src/components/Checkbox.tsx | 4 +- sparkle/src/components/Citation.tsx | 6 +- sparkle/src/components/Collapsible.tsx | 4 +- sparkle/src/components/DataTable.tsx | 2 +- sparkle/src/components/DropdownMenu.tsx | 12 +- sparkle/src/components/Item.tsx | 6 +- sparkle/src/components/Pagination.tsx | 6 +- sparkle/src/components/Popup.tsx | 4 +- sparkle/src/components/PriceTable.tsx | 8 +- sparkle/src/components/Tree.tsx | 16 +- .../ZoomableImageCitationWrapper.tsx | 4 +- sparkle/src/components/index.ts | 46 ++ sparkle/src/icons/index.ts | 2 + sparkle/src/icons/solid/index.ts | 230 +++--- sparkle/src/icons/stroke/index.ts | 230 +++--- sparkle/src/index.ts | 7 +- sparkle/src/index_with_tw_base.ts | 2 +- sparkle/src/lib/index.ts | 1 + sparkle/src/logo/index.ts | 48 ++ sparkle/src/stories/Banner.stories.tsx | 2 +- sparkle/src/stories/BarHeader.stories.tsx | 14 +- sparkle/src/stories/Citation.stories.tsx | 1 + sparkle/src/stories/DataTable.stories.tsx | 2 +- sparkle/src/stories/Page.stories.tsx | 10 +- sparkle/src/stories/Tree.stories.tsx | 4 +- sparkle/src/styles/tailwind.css | 16 +- sparkle/tsconfig.json | 17 +- 37 files changed, 437 insertions(+), 1060 deletions(-) delete mode 100644 sparkle/src/_index.ts create mode 100644 sparkle/src/components/index.ts create mode 100644 sparkle/src/icons/index.ts create mode 100644 sparkle/src/lib/index.ts create mode 100644 sparkle/src/logo/index.ts diff --git a/sparkle/.eslintrc.js b/sparkle/.eslintrc.js index 9b6f8a864e3c5..191f15d0913b7 100644 --- a/sparkle/.eslintrc.js +++ b/sparkle/.eslintrc.js @@ -9,6 +9,7 @@ module.exports = { ignorePatterns: [ "rollup.config.js", "eslint.js", + ".eslintrc.js", "dist/", "node_modules/", "svgr.config.js", diff --git a/sparkle/package-lock.json b/sparkle/package-lock.json index fc44b77b2226f..58a5ed1238497 100644 --- a/sparkle/package-lock.json +++ b/sparkle/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dust-tt/sparkle", - "version": "0.2.186", + "version": "0.2.187", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dust-tt/sparkle", - "version": "0.2.186", + "version": "0.2.187", "license": "ISC", "dependencies": { "@emoji-mart/data": "^1.1.2", diff --git a/sparkle/package.json b/sparkle/package.json index 6bff9f453daa5..73ccd4955f71e 100644 --- a/sparkle/package.json +++ b/sparkle/package.json @@ -2,8 +2,11 @@ "name": "@dust-tt/sparkle", "version": "0.2.187", "scripts": { - "build": "rm -rf dist && rollup -c", - "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true", + "build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs", + "tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css", + "build:esm": "npm run copy:esm && tsc && tsc-alias", + "copy:esm": "copyfiles -u 1 src/**/*.css src/**/*.svg src/**/*.png src/**/*.json dist/esm", + "build:cjs": "rollup -c", "storybook": "storybook dev -p 6006 --debug-webpack", "build-storybook": "storybook build", "format:check": "prettier --check .", @@ -11,7 +14,7 @@ "lint": "eslint ." }, "main": "dist/cjs/index.js", - "types": "dist/cjs/index.d.ts", + "types": "dist/esm/index.d.ts", "module": "dist/esm/index.js", "files": [ "dist/", @@ -45,6 +48,7 @@ "autoprefixer": "^10.4.14", "babel-loader": "^9.1.3", "babel-preset-react-app": "^10.0.1", + "copyfiles": "^2.4.1", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-simple-import-sort": "^12.1.0", @@ -60,7 +64,9 @@ "sass-loader": "^13.3.2", "storybook": "^7.4.6", "tailwindcss": "^3.2.4", + "tsc-alias": "^1.8.10", "typescript": "^5.4.5", + "typescript-transform-paths": "^3.4.7", "uuid": "^9.0.1" }, "peerDependencies": { diff --git a/sparkle/rollup.config.mjs b/sparkle/rollup.config.mjs index 7ef5ecfd5a15c..0813d2f5a8167 100644 --- a/sparkle/rollup.config.mjs +++ b/sparkle/rollup.config.mjs @@ -1,7 +1,6 @@ import commonjs from "@rollup/plugin-commonjs"; import json from "@rollup/plugin-json"; import resolve from "@rollup/plugin-node-resolve"; -import typescript from "@rollup/plugin-typescript"; import autoprefixer from "autoprefixer"; import fs from "fs"; import path from "path"; @@ -10,23 +9,13 @@ import postcss from "rollup-plugin-postcss"; import tailwindcss from "tailwindcss"; import { fileURLToPath } from "url"; -let tsPluginOptions = { - tsconfig: "./tsconfig.json", - outputToFilesystem: true, -}; - const __dirname = path.dirname(fileURLToPath(import.meta.url)); const pkg = JSON.parse( fs.readFileSync(path.resolve(__dirname, "package.json"), "utf-8") ); -let entryFile = "src/index.ts"; -tsPluginOptions.exclude = "src/index_with_tw_base.ts"; -if (process.env.INCLUDE_TW_BASE) { - entryFile = "src/index_with_tw_base.ts"; - tsPluginOptions.exclude = "src/index.ts"; -} +let entryFile = "dist/esm/index.js"; const config = { input: entryFile, @@ -37,17 +26,11 @@ const config = { sourcemap: true, name: "react-lib", }, - { - file: pkg.module, - format: "esm", - sourcemap: true, - }, ], plugins: [ external(), resolve(), commonjs(), - typescript(tsPluginOptions), postcss({ plugins: [ tailwindcss({ diff --git a/sparkle/src/_index.ts b/sparkle/src/_index.ts deleted file mode 100644 index a348ef2e9760d..0000000000000 --- a/sparkle/src/_index.ts +++ /dev/null @@ -1,716 +0,0 @@ -import { SparkleContext } from "./context"; -export { SparkleContext }; - -import * as avatarUtils from "./lib/avatar/utils"; -export { avatarUtils }; - -import { Div3D, Hover3D } from "./components/Hover3D"; -export { Div3D, Hover3D }; - -import { Hoverable } from "./components/Hoverable"; -export { Hoverable }; - -import { Button } from "./components/Button"; -export { Button }; - -import { CardButton } from "./components/CardButton"; -export { CardButton }; - -import { EmojiPicker } from "./components/EmojiPicker"; -export { EmojiPicker }; - -import { SliderToggle } from "./components/SliderToggle"; -export { SliderToggle }; - -import { Collapsible } from "./components/Collapsible"; -export { Collapsible }; - -import { Tab } from "./components/Tab"; -export { Tab }; - -import { Item } from "./components/Item"; -export { Item }; - -import { ContextItem } from "./components/ContextItem"; -export { ContextItem }; - -import { AssistantPreview } from "./components/AssistantPreview"; -export { AssistantPreview }; - -import { Banner } from "./components/Banner"; -export { Banner }; - -import { PaginatedCitationsGrid } from "./components/PaginatedCitationsGrid"; -export { PaginatedCitationsGrid }; - -import { Notification } from "./components/Notification"; -export { Notification }; - -import { Chip } from "./components/Chip"; -export { Chip }; - -import { Citation } from "./components/Citation"; -export { Citation }; - -import { ZoomableImageCitationWrapper } from "./components/ZoomableImageCitationWrapper"; -export { ZoomableImageCitationWrapper }; - -import { DropdownMenu } from "./components/DropdownMenu"; -export { DropdownMenu }; - -import { Page } from "./components/Page"; -export { Page }; - -import { Pagination } from "./components/Pagination"; -export { Pagination }; - -import { BarHeader } from "./components/BarHeader"; -export { BarHeader }; - -import { PriceTable } from "./components/PriceTable"; -export { PriceTable }; - -import { Icon } from "./components/Icon"; -export { Icon }; - -import { Logo } from "./logo/Logo"; -export { Logo }; - -import { Checkbox } from "./components/Checkbox"; -export { Checkbox }; - -import { IconButton } from "./components/IconButton"; -export { IconButton }; - -import { Tree } from "./components/Tree"; -export { Tree }; - -import { IconToggleButton } from "./components/IconToggleButton"; -export { IconToggleButton }; - -import { Tooltip } from "./components/Tooltip"; -export { Tooltip }; - -import { ContentMessage } from "./components/ContentMessage"; -export { ContentMessage }; - -import { ColorPicker } from "./components/ColorPicker"; -export { ColorPicker }; - -import { Avatar } from "./components/Avatar"; -export { Avatar }; - -import Spinner from "./components/Spinner"; -export { Spinner }; - -import CollapseButton from "./components/CollapseButton"; -export { CollapseButton }; - -import { Modal } from "./components/Modal"; -export { Modal }; - -import ConfettiBackground from "./components/ConfettiBackground"; -export { ConfettiBackground }; - -import { ElementModal } from "./components/ElementModal"; -export { ElementModal }; - -import { Dialog } from "./components/Dialog"; -export { Dialog }; - -import { ElementDialog } from "./components/ElementDialog"; -export { ElementDialog }; - -import { Input } from "./components/Input"; -export { Input }; - -import { Searchbar } from "./components/Searchbar"; -export { Searchbar }; - -import { RadioButton } from "./components/RadioButton"; -export { RadioButton }; - -import { Popup } from "./components/Popup"; -export { Popup }; - -import { FilterChips } from "./components/FilterChips"; -export { FilterChips }; - -import { TextArea } from "./components/TextArea"; -export { TextArea }; - -import { Markdown } from "./components/Markdown"; -export { Markdown }; - -import { DataTable } from "./components/DataTable"; -export { DataTable }; - -import { - LogoHorizontalColor as LogoHorizontalColorLogo, - LogoHorizontalColorLayer1 as LogoHorizontalColorLogoLayer1, - LogoHorizontalColorLayer2 as LogoHorizontalColorLogoLayer2, - LogoHorizontalDark as LogoHorizontalDarkLogo, - LogoHorizontalWhite as LogoHorizontalWhiteLogo, - LogoSquareColor as LogoSquareColorLogo, - LogoSquareColorLayer1 as LogoSquareColorLogoLayer1, - LogoSquareColorLayer2 as LogoSquareColorLogoLayer2, - LogoSquareDark as LogoSquareDarkLogo, - LogoSquareWhite as LogoSquareWhiteLogo, -} from "./logo/dust"; - -export { - LogoHorizontalColorLogo, - LogoHorizontalColorLogoLayer1, - LogoHorizontalColorLogoLayer2, - LogoHorizontalDarkLogo, - LogoHorizontalWhiteLogo, - LogoSquareColorLogo, - LogoSquareColorLogoLayer1, - LogoSquareColorLogoLayer2, - LogoSquareDarkLogo, - LogoSquareWhiteLogo, -}; - -import { - Ai21 as Ai21Logo, - Anthropic as AnthropicLogo, - AnthropicWhite as AnthropicWhiteLogo, - Claude as ClaudeLogo, - Cohere as CohereLogo, - Confluence as ConfluenceLogo, - Drive as DriveLogo, - Gemini as GeminiLogo, - Github as GithubLogo, - GithubWhite as GithubWhiteLogo, - Gong as GongLogo, - Google as GoogleLogo, - GoogleDoc as GoogleDocLogo, - GooglePdf as GooglePdfLogo, - GoogleSlide as GoogleSlideLogo, - GoogleSpreadsheet as GoogleSpreadsheetLogo, - Gpt3 as Gpt3Logo, - Gpt4 as Gpt4Logo, - HuggingFace as HuggingFaceLogo, - Intercom as IntercomLogo, - Microsoft as MicrosoftLogo, - MicrosoftExcel as MicrosoftExcelLogo, - MicrosoftPowerpoint as MicrosoftPowerpointLogo, - MicrosoftWord as MicrosoftWordLogo, - Mistral as MistralLogo, - Notion as NotionLogo, - Office as OfficeLogo, - Openai as OpenaiLogo, - OpenaiWhite as OpenaiWhiteLogo, - Replicate as ReplicateLogo, - Salesforce as SalesforceLogo, - Slack as SlackLogo, - Zapier as ZapierLogo, -} from "./logo/platforms"; - -export { - Ai21Logo, - AnthropicLogo, - AnthropicWhiteLogo, - ClaudeLogo, - CohereLogo, - ConfluenceLogo, - DriveLogo, - GeminiLogo, - GithubLogo, - GithubWhiteLogo, - GongLogo, - GoogleDocLogo, - GoogleLogo, - GooglePdfLogo, - GoogleSlideLogo, - GoogleSpreadsheetLogo, - Gpt3Logo, - Gpt4Logo, - HuggingFaceLogo, - IntercomLogo, - MicrosoftExcelLogo, - MicrosoftLogo, - MicrosoftPowerpointLogo, - MicrosoftWordLogo, - MistralLogo, - NotionLogo, - OfficeLogo, - OpenaiLogo, - OpenaiWhiteLogo, - ReplicateLogo, - SalesforceLogo, - SlackLogo, - ZapierLogo, -}; - -import { - ArrowDown as ArrowDownIcon, - ArrowDownCircle as ArrowDownCircleIcon, - ArrowDownOnSquare as ArrowDownOnSquareIcon, - ArrowLeft as ArrowLeftIcon, - ArrowPath as ArrowPathIcon, - ArrowRight as ArrowRightIcon, - ArrowUp as ArrowUpIcon, - ArrowUpOnSquare as ArrowUpOnSquareIcon, - Attachment as AttachmentIcon, - Backspace as BackspaceIcon, - Bookmark as BookmarkIcon, - BookOpen as BookOpenIcon, - Braces as BracesIcon, - Card as CardIcon, - ChatBubbleBottomCenterPlus as ChatBubbleBottomCenterPlusIcon, - ChatBubbleBottomCenterText as ChatBubbleBottomCenterTextIcon, - ChatBubbleLeftRight as ChatBubbleLeftRightIcon, - Check as CheckIcon, - CheckCircle as CheckCircleIcon, - ChevronDown as ChevronDownIcon, - ChevronLeft as ChevronLeftIcon, - ChevronRight as ChevronRightIcon, - ChevronUp as ChevronUpIcon, - ChevronUpDown as ChevronUpDownIcon, - Circle as CircleIcon, - Clipboard as ClipboardIcon, - ClipboardCheck as ClipboardCheckIcon, - Clock as ClockIcon, - CloudArrowDown as CloudArrowDownIcon, - CloudArrowLeftRight as CloudArrowLeftRightIcon, - CloudArrowUp as CloudArrowUpIcon, - CloudX as CloudXIcon, - Cog6Tooth as Cog6ToothIcon, - Command as CommandIcon, - CommandLine as CommandLineIcon, - Cube as CubeIcon, - Dash as DashIcon, - Document as DocumentIcon, - DocumentDuplicate as DocumentDuplicateIcon, - DocumentPile as DocumentPileIcon, - DocumentPlus as DocumentPlusIcon, - DocumentText as DocumentTextIcon, - Dust as DustIcon, - EmotionLaugh as EmotionLaughIcon, - Equalizer as EqualizerIcon, - ExclamationCircle as ExclamationCircleIcon, - ExternalLink as ExternalLinkIcon, - Eye as EyeIcon, - EyeSlash as EyeSlashIcon, - Flag as FlagIcon, - Folder as FolderIcon, - FolderOpen as FolderOpenIcon, - Fullscreen as FullscreenIcon, - FullscreenExit as FullscreenExitIcon, - GlobeAlt as GlobeAltIcon, - Grab as GrabIcon, - HandHeart as HandHeartIcon, - HandThumbDown as HandThumbDownIcon, - HandThumbUp as HandThumbUpIcon, - HeartAlt as HeartAltIcon, - Hexagon as HexagonIcon, - Image as ImageIcon, - InformationCircle as InformationCircleIcon, - Key as KeyIcon, - Lightbulb as LightbulbIcon, - Link as LinkIcon, - List as ListIcon, - ListAdd as ListAddIcon, - ListCheck as ListCheckIcon, - ListRemove as ListRemoveIcon, - Lock as LockIcon, - Login as LoginIcon, - Logout as LogoutIcon, - Magic as MagicIcon, - MagnifyingGlass as MagnifyingGlassIcon, - Menu as MenuIcon, - More as MoreIcon, - MovingMail as MovingMailIcon, - Paint as PaintIcon, - PaperAirplane as PaperAirplaneIcon, - Pause as PauseIcon, - PencilSquare as PencilSquareIcon, - Planet as PlanetIcon, - Play as PlayIcon, - Plus as PlusIcon, - PlusCircle as PlusCircleIcon, - Pushpin as PushpinIcon, - Puzzle as PuzzleIcon, - QuestionMarkCircle as QuestionMarkCircleIcon, - Reaction as ReactionIcon, - Rectangle as RectangleIcon, - Robot as RobotIcon, - Rocket as RocketIcon, - Scan as ScanIcon, - Server as ServerIcon, - ShakeHands as ShakeHandsIcon, - Shapes as ShapesIcon, - Sparkles as SparklesIcon, - Square as SquareIcon, - Square3Stack3D as Square3Stack3DIcon, - Star as StarIcon, - Stop as StopIcon, - Table as TableIcon, - Template as TemplateIcon, - TestTube as TestTubeIcon, - Time as TimeIcon, - Trash as TrashIcon, - Triangle as TriangleIcon, - User as UserIcon, - UserArrow as UserArrowIcon, - UserGroup as UserGroupIcon, - UserPlus as UserPlusIcon, - Wrench as WrenchIcon, - XCircle as XCircleIcon, - XMark as XMarkIcon, -} from "./icons/solid"; - -export { - ArrowDownCircleIcon, - ArrowDownIcon, - ArrowDownOnSquareIcon, - ArrowLeftIcon, - ArrowPathIcon, - ArrowRightIcon, - ArrowUpIcon, - ArrowUpOnSquareIcon, - AttachmentIcon, - BackspaceIcon, - BookmarkIcon, - BookOpenIcon, - BracesIcon, - CardIcon, - ChatBubbleBottomCenterPlusIcon, - ChatBubbleBottomCenterTextIcon, - ChatBubbleLeftRightIcon, - CheckCircleIcon, - CheckIcon, - ChevronDownIcon, - ChevronLeftIcon, - ChevronRightIcon, - ChevronUpDownIcon, - ChevronUpIcon, - CircleIcon, - ClipboardCheckIcon, - ClipboardIcon, - ClockIcon, - CloudArrowDownIcon, - CloudArrowLeftRightIcon, - CloudArrowUpIcon, - CloudXIcon, - Cog6ToothIcon, - CommandIcon, - CommandLineIcon, - CubeIcon, - DashIcon, - DocumentDuplicateIcon, - DocumentIcon, - DocumentPileIcon, - DocumentPlusIcon, - DocumentTextIcon, - DustIcon, - EmotionLaughIcon, - EqualizerIcon, - ExclamationCircleIcon, - ExternalLinkIcon, - EyeIcon, - EyeSlashIcon, - FlagIcon, - FolderIcon, - FolderOpenIcon, - FullscreenExitIcon, - FullscreenIcon, - GlobeAltIcon, - GrabIcon, - HandHeartIcon, - HandThumbDownIcon, - HandThumbUpIcon, - HeartAltIcon, - HexagonIcon, - ImageIcon, - InformationCircleIcon, - KeyIcon, - LightbulbIcon, - LinkIcon, - ListAddIcon, - ListCheckIcon, - ListIcon, - ListRemoveIcon, - LockIcon, - LoginIcon, - LogoutIcon, - MagicIcon, - MagnifyingGlassIcon, - MenuIcon, - MoreIcon, - MovingMailIcon, - PaintIcon, - PaperAirplaneIcon, - PauseIcon, - PencilSquareIcon, - PlanetIcon, - PlayIcon, - PlusCircleIcon, - PlusIcon, - PushpinIcon, - PuzzleIcon, - QuestionMarkCircleIcon, - ReactionIcon, - RectangleIcon, - RobotIcon, - RocketIcon, - ScanIcon, - ServerIcon, - ShakeHandsIcon, - ShapesIcon, - SparklesIcon, - Square3Stack3DIcon, - SquareIcon, - StarIcon, - StopIcon, - TableIcon, - TemplateIcon, - TestTubeIcon, - TimeIcon, - TrashIcon, - TriangleIcon, - UserArrowIcon, - UserGroupIcon, - UserIcon, - UserPlusIcon, - WrenchIcon, - XCircleIcon, - XMarkIcon, -}; - -import { - ArrowDown as ArrowDownStrokeIcon, - ArrowDownCircle as ArrowDownCircleStrokeIcon, - ArrowDownOnSquare as ArrowDownOnSquareStrokeIcon, - ArrowLeft as ArrowLeftStrokeIcon, - ArrowPath as ArrowPathStrokeIcon, - ArrowRight as ArrowRightStrokeIcon, - ArrowUp as ArrowUpStrokeIcon, - ArrowUpOnSquare as ArrowUpOnSquareStrokeIcon, - Attachment as AttachmentStrokeIcon, - Backspace as BackspaceStrokeIcon, - Bookmark as BookmarkStrokeIcon, - BookOpen as BookOpenStrokeIcon, - Braces as BracesStrokeIcon, - Card as CardStrokeIcon, - ChatBubbleBottomCenterPlus as ChatBubbleBottomCenterPlusStrokeIcon, - ChatBubbleBottomCenterText as ChatBubbleBottomCenterTextStrokeIcon, - ChatBubbleLeftRight as ChatBubbleLeftRightStrokeIcon, - Check as CheckStrokeIcon, - CheckCircle as CheckCircleStrokeIcon, - ChevronDown as ChevronDownStrokeIcon, - ChevronLeft as ChevronLeftStrokeIcon, - ChevronRight as ChevronRightStrokeIcon, - ChevronUp as ChevronUpStrokeIcon, - ChevronUpDown as ChevronUpDownStrokeIcon, - Circle as CircleStrokeIcon, - Clipboard as ClipboardStrokeIcon, - ClipboardCheck as ClipboardCheckStrokeIcon, - Clock as ClockStrokeIcon, - CloudArrowDown as CloudArrowDownStrokeIcon, - CloudArrowLeftRight as CloudArrowLeftRightStrokeIcon, - CloudArrowUp as CloudArrowUpStrokeIcon, - CloudX as CloudXStrokeIcon, - Cog6Tooth as Cog6ToothStrokeIcon, - Command as CommandStrokeIcon, - CommandLine as CommandLineStrokeIcon, - Cube as CubeStrokeIcon, - Dash as DashStrokeIcon, - Document as DocumentStrokeIcon, - DocumentDuplicate as DocumentDuplicateStrokeIcon, - DocumentPile as DocumentPileStrokeIcon, - DocumentPlus as DocumentPlusStrokeIcon, - DocumentText as DocumentTextStrokeIcon, - Dust as DustStrokeIcon, - EmotionLaugh as EmotionLaughStrokeIcon, - Equalizer as EqualizerStrokeIcon, - ExclamationCircle as ExclamationCircleStrokeIcon, - ExternalLink as ExternalLinkStrokeIcon, - Eye as EyeStrokeIcon, - EyeSlash as EyeSlashStrokeIcon, - Flag as FlagStrokeIcon, - Folder as FolderStrokeIcon, - FolderOpen as FolderOpenStrokeIcon, - Fullscreen as FullscreenStrokeIcon, - FullscreenExit as FullscreenExitStrokeIcon, - GlobeAlt as GlobeAltStrokeIcon, - Grab as GrabStrokeIcon, - HandHeart as HandHeartStrokeIcon, - HandThumbDown as HandThumbDownStrokeIcon, - HandThumbUp as HandThumbUpStrokeIcon, - HeartAlt as HeartAltStrokeIcon, - Hexagon as HexagonStrokeIcon, - Image as ImageStrokeIcon, - InformationCircle as InformationCircleStrokeIcon, - Key as KeyStrokeIcon, - Lightbulb as LightbulbStrokeIcon, - Link as LinkStrokeIcon, - List as ListStrokeIcon, - ListAdd as ListAddStrokeIcon, - ListCheck as ListCheckStrokeIcon, - ListRemove as ListRemoveStrokeIcon, - Lock as LockStrokeIcon, - Login as LoginStrokeIcon, - Logout as LogoutStrokeIcon, - Magic as MagicStrokeIcon, - MagnifyingGlass as MagnifyingGlassStrokeIcon, - Menu as MenuStrokeIcon, - More as MoreStrokeIcon, - MovingMail as MovingMailStrokeIcon, - Paint as PaintStrokeIcon, - PaperAirplane as PaperAirplaneStrokeIcon, - Pause as PauseStrokeIcon, - PencilSquare as PencilSquareStrokeIcon, - Planet as PlanetStrokeIcon, - Play as PlayStrokeIcon, - Plus as PlusStrokeIcon, - PlusCircle as PlusCircleStrokeIcon, - Pushpin as PushpinStrokeIcon, - Puzzle as PuzzleStrokeIcon, - QuestionMarkCircle as QuestionMarkCircleStrokeIcon, - Reaction as ReactionStrokeIcon, - Rectangle as RectangleStrokeIcon, - Robot as RobotStrokeIcon, - Rocket as RocketStrokeIcon, - Scan as ScanStrokeIcon, - Server as ServerStrokeIcon, - ShakeHands as ShakeHandsStrokeIcon, - Shapes as ShapesStrokeIcon, - Sparkles as SparklesStrokeIcon, - Square as SquareStrokeIcon, - Square3Stack3D as Square3Stack3DStrokeIcon, - Star as StarStrokeIcon, - Stop as StopStrokeIcon, - Table as TableStrokeIcon, - Template as TemplateStrokeIcon, - TestTube as TestTubeStrokeIcon, - Time as TimeStrokeIcon, - Trash as TrashStrokeIcon, - Triangle as TriangleStrokeIcon, - User as UserStrokeIcon, - UserArrow as UserArrowStrokeIcon, - UserGroup as UserGroupStrokeIcon, - UserPlus as UserPlusStrokeIcon, - Wrench as WrenchStrokeIcon, - XCircle as XCircleStrokeIcon, - XMark as XMarkStrokeIcon, -} from "./icons/stroke"; - -export { - ArrowDownCircleStrokeIcon, - ArrowDownOnSquareStrokeIcon, - ArrowDownStrokeIcon, - ArrowLeftStrokeIcon, - ArrowPathStrokeIcon, - ArrowRightStrokeIcon, - ArrowUpOnSquareStrokeIcon, - ArrowUpStrokeIcon, - AttachmentStrokeIcon, - BackspaceStrokeIcon, - BookmarkStrokeIcon, - BookOpenStrokeIcon, - BracesStrokeIcon, - CardStrokeIcon, - ChatBubbleBottomCenterPlusStrokeIcon, - ChatBubbleBottomCenterTextStrokeIcon, - ChatBubbleLeftRightStrokeIcon, - CheckCircleStrokeIcon, - CheckStrokeIcon, - ChevronDownStrokeIcon, - ChevronLeftStrokeIcon, - ChevronRightStrokeIcon, - ChevronUpDownStrokeIcon, - ChevronUpStrokeIcon, - CircleStrokeIcon, - ClipboardCheckStrokeIcon, - ClipboardStrokeIcon, - ClockStrokeIcon, - CloudArrowDownStrokeIcon, - CloudArrowLeftRightStrokeIcon, - CloudArrowUpStrokeIcon, - CloudXStrokeIcon, - Cog6ToothStrokeIcon, - CommandLineStrokeIcon, - CommandStrokeIcon, - CubeStrokeIcon, - DashStrokeIcon, - DocumentDuplicateStrokeIcon, - DocumentPileStrokeIcon, - DocumentPlusStrokeIcon, - DocumentStrokeIcon, - DocumentTextStrokeIcon, - DustStrokeIcon, - EmotionLaughStrokeIcon, - EqualizerStrokeIcon, - ExclamationCircleStrokeIcon, - ExternalLinkStrokeIcon, - EyeSlashStrokeIcon, - EyeStrokeIcon, - FlagStrokeIcon, - FolderOpenStrokeIcon, - FolderStrokeIcon, - FullscreenExitStrokeIcon, - FullscreenStrokeIcon, - GlobeAltStrokeIcon, - GrabStrokeIcon, - HandHeartStrokeIcon, - HandThumbDownStrokeIcon, - HandThumbUpStrokeIcon, - HeartAltStrokeIcon, - HexagonStrokeIcon, - ImageStrokeIcon, - InformationCircleStrokeIcon, - KeyStrokeIcon, - LightbulbStrokeIcon, - LinkStrokeIcon, - ListAddStrokeIcon, - ListCheckStrokeIcon, - ListRemoveStrokeIcon, - ListStrokeIcon, - LockStrokeIcon, - LoginStrokeIcon, - LogoutStrokeIcon, - MagicStrokeIcon, - MagnifyingGlassStrokeIcon, - MenuStrokeIcon, - MoreStrokeIcon, - MovingMailStrokeIcon, - PaintStrokeIcon, - PaperAirplaneStrokeIcon, - PauseStrokeIcon, - PencilSquareStrokeIcon, - PlanetStrokeIcon, - PlayStrokeIcon, - PlusCircleStrokeIcon, - PlusStrokeIcon, - PushpinStrokeIcon, - PuzzleStrokeIcon, - QuestionMarkCircleStrokeIcon, - ReactionStrokeIcon, - RectangleStrokeIcon, - RobotStrokeIcon, - RocketStrokeIcon, - ScanStrokeIcon, - ServerStrokeIcon, - ShakeHandsStrokeIcon, - ShapesStrokeIcon, - SparklesStrokeIcon, - Square3Stack3DStrokeIcon, - SquareStrokeIcon, - StarStrokeIcon, - StopStrokeIcon, - TableStrokeIcon, - TemplateStrokeIcon, - TestTubeStrokeIcon, - TimeStrokeIcon, - TrashStrokeIcon, - TriangleStrokeIcon, - UserArrowStrokeIcon, - UserGroupStrokeIcon, - UserPlusStrokeIcon, - UserStrokeIcon, - WrenchStrokeIcon, - XCircleStrokeIcon, - XMarkStrokeIcon, -}; diff --git a/sparkle/src/components/AssistantPreview.tsx b/sparkle/src/components/AssistantPreview.tsx index 29423c1721aa8..9fe3022d60403 100644 --- a/sparkle/src/components/AssistantPreview.tsx +++ b/sparkle/src/components/AssistantPreview.tsx @@ -1,7 +1,9 @@ import React, { useState } from "react"; -import { Button, CardButton, MoreIcon } from "@sparkle/_index"; import { Avatar } from "@sparkle/components/Avatar"; +import { Button } from "@sparkle/components/Button"; +import { CardButton } from "@sparkle/components/CardButton"; +import { MoreIcon } from "@sparkle/icons/solid"; import { classNames } from "@sparkle/lib/utils"; type AssistantPreviewVariant = "list" | "minimal"; @@ -50,8 +52,8 @@ const titleClassNames = { getWindowWidth() <= breakpoints.sm ? "s-text-sm" : getWindowWidth() <= breakpoints.md - ? "s-text-base" - : "" + ? "s-text-base" + : "" }`, }; @@ -62,8 +64,8 @@ const subtitleClassNames = { getWindowWidth() <= breakpoints.sm ? "s-text-xs" : getWindowWidth() <= breakpoints.md - ? "s-text-xs" - : "s-text-sm" + ? "s-text-xs" + : "s-text-sm" }`, }; diff --git a/sparkle/src/components/Avatar.tsx b/sparkle/src/components/Avatar.tsx index 1caaf55ae1cfc..51bcdfbe7a578 100644 --- a/sparkle/src/components/Avatar.tsx +++ b/sparkle/src/components/Avatar.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; -import { User } from "@sparkle/icons/solid"; +import { UserIcon } from "@sparkle/icons/solid"; import { getEmojiAndBackgroundFromUrl } from "@sparkle/lib/avatar/utils"; import { classNames } from "@sparkle/lib/utils"; @@ -190,7 +190,7 @@ export function Avatar({ {/\+/.test(name) ? name : name[0].toUpperCase()} ) : ( - + )} ); diff --git a/sparkle/src/components/Banner.tsx b/sparkle/src/components/Banner.tsx index a3ead4232cd62..612f7c9d79bc3 100644 --- a/sparkle/src/components/Banner.tsx +++ b/sparkle/src/components/Banner.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; -import { IconButton, XMarkIcon } from "@sparkle/_index"; +import { IconButton } from "@sparkle/components/IconButton"; +import { XMarkIcon } from "@sparkle/icons/solid"; import { classNames } from "@sparkle/lib/utils"; interface BannerProps { diff --git a/sparkle/src/components/BarHeader.tsx b/sparkle/src/components/BarHeader.tsx index 7fb37be4376e4..d43a2b0098aba 100644 --- a/sparkle/src/components/BarHeader.tsx +++ b/sparkle/src/components/BarHeader.tsx @@ -1,10 +1,10 @@ import React from "react"; import { - ArrowUpOnSquare, - ChevronLeft, - Trash, - XMark, + ArrowUpOnSquareIcon, + ChevronLeftIcon, + TrashIcon, + XMarkIcon, } from "@sparkle/icons/solid"; import { classNames } from "@sparkle/lib/utils"; @@ -82,7 +82,7 @@ BarHeader.ButtonBar = function (props: BarHeaderButtonBarProps) { return (