From c47449c9ae3214d324a555c5806576a9c356bc60 Mon Sep 17 00:00:00 2001 From: LautaroPetaccio Date: Fri, 3 Apr 2026 19:30:07 -0300 Subject: [PATCH] fix: re-export semantic-ui components through CSS wrapper modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Components like Card, Button, Modal, etc. have wrapper modules in `src/components/` that re-export the semantic-ui-react component AND import a companion CSS file with dark theme overrides. Previously, `index.ts` re-exported these components directly from semantic-ui-react via `export * from 'semantic-ui-react'`, bypassing the wrapper modules entirely. The CSS side-effect imports in the wrappers were never reached through the export chain. This worked historically because bundlers like webpack and esbuild included all transitive modules regardless of whether they were reachable through exports. However, tree-shaking bundlers like Rolldown (used in Vite 8) only follow the actual import/export graph. Since nothing imported the wrapper modules, the CSS was dropped from production builds, resulting in missing dark theme styles (white card backgrounds, wrong border-radius, etc.). The fix replaces the wildcard `export * from 'semantic-ui-react'` with: - Explicit `export *` through each component wrapper that has CSS (Button, Card, Checkbox, Container, Dimmer, Dropdown, Header, Loader, Modal, Pagination, Popup, Radio, Segment, Table) - Explicit named exports for the remaining semantic-ui-react components that have no CSS overrides This ensures the CSS side-effect imports are part of the export chain and will be included by any bundler that follows it. The public API surface is unchanged — consumers still import the same components from the same paths. --- src/index.ts | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 180 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index aa25b081..97d2d543 100644 --- a/src/index.ts +++ b/src/index.ts @@ -99,12 +99,190 @@ export * from './components/SmartBadge' export * from './components/SmartIcon' export * from './components/CommunityBubble' export * from './components/AddressField' +export * from './components/Loader/Loader' export * from './components/Loader/LoadingText' export * from './components/RarityBadge' export * from './components/Web2TransactionModal' -// Semantic components +// Semantic component wrappers with CSS overrides. +// Re-exported through wrappers instead of directly from semantic-ui-react +// so that bundlers following the import chain (e.g. Rolldown) include +// the CSS side-effect imports in each wrapper module. +export * from './components/Button/Button' +export * from './components/Card/Card' +export * from './components/Checkbox/Checkbox' +export * from './components/Container/Container' +export * from './components/Dimmer/Dimmer' +export * from './components/Dropdown/Dropdown' +export * from './components/Header/Header' +export * from './components/Modal/Modal' +export * from './components/Pagination/Pagination' +export * from './components/Popup/Popup' +export * from './components/Radio/Radio' +export * from './components/Segment/Segment' +export * from './components/Table/Table' +// Semantic components without CSS overrides — re-exported directly. /* eslint-disable no-restricted-imports */ -export * from 'semantic-ui-react' +export { + Ref, + Confirm, + PaginationItem, + Portal, + PortalInner, + Select, + TextArea, + TransitionablePortal, + Visibility, + Breadcrumb, + BreadcrumbDivider, + BreadcrumbSection, + Form, + FormButton, + FormCheckbox, + FormDropdown, + FormField, + FormGroup, + FormInput, + FormRadio, + FormSelect, + FormTextArea, + Grid, + GridColumn, + GridRow, + Menu, + MenuHeader, + MenuItem, + MenuMenu, + MessageContent, + MessageHeader, + MessageItem, + MessageList, + TableBody, + TableCell, + TableFooter, + TableHeader, + TableHeaderCell, + TableRow, + ButtonContent, + ButtonGroup, + ButtonOr, + Divider, + Flag, + HeaderContent, + HeaderSubheader, + Icon, + IconGroup, + Image, + ImageGroup, + Input, + Label, + LabelDetail, + LabelGroup, + List, + ListContent, + ListDescription, + ListHeader, + ListIcon, + ListItem, + ListList, + Placeholder, + PlaceholderHeader, + PlaceholderImage, + PlaceholderLine, + PlaceholderParagraph, + Rail, + Reveal, + RevealContent, + SegmentGroup, + SegmentInline, + Step, + StepContent, + StepDescription, + StepGroup, + StepTitle, + Accordion, + AccordionAccordion, + AccordionContent, + AccordionPanel, + AccordionTitle, + DimmerDimmable, + DimmerInner, + DropdownDivider, + DropdownHeader, + DropdownItem, + DropdownMenu, + DropdownSearchInput, + Embed, + ModalActions, + ModalContent, + ModalDescription, + ModalDimmer, + ModalHeader, + PopupContent, + PopupHeader, + Progress, + Rating, + RatingIcon, + Search, + SearchCategory, + SearchResult, + SearchResults, + Sidebar, + SidebarPushable, + SidebarPusher, + Sticky, + Tab, + TabPane, + Transition, + TransitionGroup, + Advertisement, + CardContent, + CardDescription, + CardGroup, + CardHeader, + CardMeta, + Comment, + CommentAction, + CommentActions, + CommentAuthor, + CommentAvatar, + CommentContent, + CommentGroup, + CommentMetadata, + CommentText, + Feed, + FeedContent, + FeedDate, + FeedEvent, + FeedExtra, + FeedLabel, + FeedLike, + FeedMeta, + FeedSummary, + FeedUser, + Item, + ItemContent, + ItemDescription, + ItemExtra, + ItemGroup, + ItemHeader, + ItemImage, + ItemMeta, + Statistic, + StatisticGroup, + StatisticLabel, + StatisticValue +} from 'semantic-ui-react' +export type { + ButtonProps, + CheckboxProps, + DropdownItemProps, + DropdownProps, + IconProps, + InputOnChangeData, + RadioProps, + SemanticICONS, + TextAreaProps +} from 'semantic-ui-react' // Colors export * from './colors'