tempest-react-sdk 0.62.0 → 0.64.0
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 +10 -7
- package/dist/br/BrazilMap.module.cjs +1 -0
- package/dist/br/BrazilMap.module.cjs.map +1 -1
- package/dist/br/BrazilMap.module.js +1 -0
- package/dist/br/BrazilMap.module.js.map +1 -1
- package/dist/br/MapLegend.module.cjs +1 -0
- package/dist/br/MapLegend.module.cjs.map +1 -1
- package/dist/br/MapLegend.module.js +1 -0
- package/dist/br/MapLegend.module.js.map +1 -1
- package/dist/br/MunicipalitySearch.module.cjs +1 -0
- package/dist/br/MunicipalitySearch.module.cjs.map +1 -1
- package/dist/br/MunicipalitySearch.module.js +1 -0
- package/dist/br/MunicipalitySearch.module.js.map +1 -1
- package/dist/br/PixQRCode.module.cjs +1 -0
- package/dist/br/PixQRCode.module.cjs.map +1 -1
- package/dist/br/PixQRCode.module.js +1 -0
- package/dist/br/PixQRCode.module.js.map +1 -1
- package/dist/components/AIChat/AIChat.module.cjs +1 -0
- package/dist/components/AIChat/AIChat.module.cjs.map +1 -1
- package/dist/components/AIChat/AIChat.module.js +1 -0
- package/dist/components/AIChat/AIChat.module.js.map +1 -1
- package/dist/components/Accordion/Accordion.module.cjs +1 -0
- package/dist/components/Accordion/Accordion.module.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.module.js +1 -0
- package/dist/components/Accordion/Accordion.module.js.map +1 -1
- package/dist/components/Alert/Alert.module.cjs +1 -0
- package/dist/components/Alert/Alert.module.cjs.map +1 -1
- package/dist/components/Alert/Alert.module.js +1 -0
- package/dist/components/Alert/Alert.module.js.map +1 -1
- package/dist/components/AppBar/AppBar.module.cjs +1 -0
- package/dist/components/AppBar/AppBar.module.cjs.map +1 -1
- package/dist/components/AppBar/AppBar.module.js +1 -0
- package/dist/components/AppBar/AppBar.module.js.map +1 -1
- package/dist/components/AppShell/AppShell.module.cjs +1 -0
- package/dist/components/AppShell/AppShell.module.cjs.map +1 -1
- package/dist/components/AppShell/AppShell.module.js +1 -0
- package/dist/components/AppShell/AppShell.module.js.map +1 -1
- package/dist/components/AspectRatio/AspectRatio.module.cjs +1 -0
- package/dist/components/AspectRatio/AspectRatio.module.cjs.map +1 -1
- package/dist/components/AspectRatio/AspectRatio.module.js +1 -0
- package/dist/components/AspectRatio/AspectRatio.module.js.map +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.module.cjs +1 -0
- package/dist/components/AudioPlayer/AudioPlayer.module.cjs.map +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.module.js +1 -0
- package/dist/components/AudioPlayer/AudioPlayer.module.js.map +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.module.cjs +1 -0
- package/dist/components/AudioRecorder/AudioRecorder.module.cjs.map +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.module.js +1 -0
- package/dist/components/AudioRecorder/AudioRecorder.module.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.cjs +1 -0
- package/dist/components/Avatar/Avatar.module.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.module.js +1 -0
- package/dist/components/Avatar/Avatar.module.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.module.cjs +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.module.js +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.js.map +1 -1
- package/dist/components/Badge/Badge.module.cjs +1 -0
- package/dist/components/Badge/Badge.module.cjs.map +1 -1
- package/dist/components/Badge/Badge.module.js +1 -0
- package/dist/components/Badge/Badge.module.js.map +1 -1
- package/dist/components/Banner/Banner.module.cjs +1 -0
- package/dist/components/Banner/Banner.module.cjs.map +1 -1
- package/dist/components/Banner/Banner.module.js +1 -0
- package/dist/components/Banner/Banner.module.js.map +1 -1
- package/dist/components/BarList/BarList.module.cjs +1 -0
- package/dist/components/BarList/BarList.module.cjs.map +1 -1
- package/dist/components/BarList/BarList.module.js +1 -0
- package/dist/components/BarList/BarList.module.js.map +1 -1
- package/dist/components/BarcodeScanner/BarcodeScanner.module.cjs +1 -0
- package/dist/components/BarcodeScanner/BarcodeScanner.module.cjs.map +1 -1
- package/dist/components/BarcodeScanner/BarcodeScanner.module.js +1 -0
- package/dist/components/BarcodeScanner/BarcodeScanner.module.js.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.module.cjs +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.module.cjs.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.module.js +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.module.js.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.module.cjs +1 -0
- package/dist/components/BottomSheet/BottomSheet.module.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.module.js +1 -0
- package/dist/components/BottomSheet/BottomSheet.module.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.module.js +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.module.js.map +1 -1
- package/dist/components/Button/Button.module.cjs +1 -0
- package/dist/components/Button/Button.module.cjs.map +1 -1
- package/dist/components/Button/Button.module.js +1 -0
- package/dist/components/Button/Button.module.js.map +1 -1
- package/dist/components/Calendar/Calendar.module.cjs +1 -0
- package/dist/components/Calendar/Calendar.module.cjs.map +1 -1
- package/dist/components/Calendar/Calendar.module.js +1 -0
- package/dist/components/Calendar/Calendar.module.js.map +1 -1
- package/dist/components/Card/Card.module.cjs +1 -0
- package/dist/components/Card/Card.module.cjs.map +1 -1
- package/dist/components/Card/Card.module.js +1 -0
- package/dist/components/Card/Card.module.js.map +1 -1
- package/dist/components/Carousel/Carousel.module.cjs +1 -0
- package/dist/components/Carousel/Carousel.module.cjs.map +1 -1
- package/dist/components/Carousel/Carousel.module.js +1 -0
- package/dist/components/Carousel/Carousel.module.js.map +1 -1
- package/dist/components/Center/Center.module.cjs +1 -0
- package/dist/components/Center/Center.module.cjs.map +1 -1
- package/dist/components/Center/Center.module.js +1 -0
- package/dist/components/Center/Center.module.js.map +1 -1
- package/dist/components/Chat/Chat.cjs +1 -1
- package/dist/components/Chat/Chat.cjs.map +1 -1
- package/dist/components/Chat/Chat.js +71 -96
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/Chat/Chat.module.cjs +2 -1
- package/dist/components/Chat/Chat.module.cjs.map +1 -1
- package/dist/components/Chat/Chat.module.js +31 -8
- package/dist/components/Chat/Chat.module.js.map +1 -1
- package/dist/components/Chat/ChatActionsMenu.cjs +2 -0
- package/dist/components/Chat/ChatActionsMenu.cjs.map +1 -0
- package/dist/components/Chat/ChatActionsMenu.js +14 -0
- package/dist/components/Chat/ChatActionsMenu.js.map +1 -0
- package/dist/components/Chat/ChatAttachments.cjs +2 -0
- package/dist/components/Chat/ChatAttachments.cjs.map +1 -0
- package/dist/components/Chat/ChatAttachments.js +80 -0
- package/dist/components/Chat/ChatAttachments.js.map +1 -0
- package/dist/components/Chat/ChatBubble.cjs +2 -0
- package/dist/components/Chat/ChatBubble.cjs.map +1 -0
- package/dist/components/Chat/ChatBubble.js +155 -0
- package/dist/components/Chat/ChatBubble.js.map +1 -0
- package/dist/components/Chat/chat-groups.cjs +1 -1
- package/dist/components/Chat/chat-groups.cjs.map +1 -1
- package/dist/components/Chat/chat-groups.js +42 -2
- package/dist/components/Chat/chat-groups.js.map +1 -1
- package/dist/components/Chat/chat-receipt.cjs +2 -0
- package/dist/components/Chat/chat-receipt.cjs.map +1 -0
- package/dist/components/Chat/chat-receipt.js +14 -0
- package/dist/components/Chat/chat-receipt.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.module.cjs +1 -0
- package/dist/components/Checkbox/Checkbox.module.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.js +1 -0
- package/dist/components/Checkbox/Checkbox.module.js.map +1 -1
- package/dist/components/ChipInput/ChipInput.module.cjs +1 -0
- package/dist/components/ChipInput/ChipInput.module.cjs.map +1 -1
- package/dist/components/ChipInput/ChipInput.module.js +1 -0
- package/dist/components/ChipInput/ChipInput.module.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.module.cjs +1 -0
- package/dist/components/CodeBlock/CodeBlock.module.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.module.js +1 -0
- package/dist/components/CodeBlock/CodeBlock.module.js.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.cjs +1 -0
- package/dist/components/Collapsible/Collapsible.module.cjs.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.js +1 -0
- package/dist/components/Collapsible/Collapsible.module.js.map +1 -1
- package/dist/components/Combobox/Combobox.module.cjs +1 -0
- package/dist/components/Combobox/Combobox.module.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.module.js +1 -0
- package/dist/components/Combobox/Combobox.module.js.map +1 -1
- package/dist/components/Command/Command.module.cjs +1 -0
- package/dist/components/Command/Command.module.cjs.map +1 -1
- package/dist/components/Command/Command.module.js +1 -0
- package/dist/components/Command/Command.module.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/ContextMenu/ContextMenu.cjs.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +100 -48
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.module.cjs +1 -0
- package/dist/components/ContextMenu/ContextMenu.module.cjs.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.module.js +1 -0
- package/dist/components/ContextMenu/ContextMenu.module.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.module.cjs +1 -0
- package/dist/components/CopyButton/CopyButton.module.cjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.module.js +1 -0
- package/dist/components/CopyButton/CopyButton.module.js.map +1 -1
- package/dist/components/DataList/DataList.module.cjs +1 -0
- package/dist/components/DataList/DataList.module.cjs.map +1 -1
- package/dist/components/DataList/DataList.module.js +1 -0
- package/dist/components/DataList/DataList.module.js.map +1 -1
- package/dist/components/DataTable/DataTable.module.cjs +1 -0
- package/dist/components/DataTable/DataTable.module.cjs.map +1 -1
- package/dist/components/DataTable/DataTable.module.js +1 -0
- package/dist/components/DataTable/DataTable.module.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.module.cjs +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.module.cjs.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.module.js +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.module.js.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.module.cjs +1 -0
- package/dist/components/DescriptionList/DescriptionList.module.cjs.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.module.js +1 -0
- package/dist/components/DescriptionList/DescriptionList.module.js.map +1 -1
- package/dist/components/Divider/Divider.module.cjs +1 -0
- package/dist/components/Divider/Divider.module.cjs.map +1 -1
- package/dist/components/Divider/Divider.module.js +1 -0
- package/dist/components/Divider/Divider.module.js.map +1 -1
- package/dist/components/Drawer/Drawer.module.cjs +1 -0
- package/dist/components/Drawer/Drawer.module.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.module.js +1 -0
- package/dist/components/Drawer/Drawer.module.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.module.cjs +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.module.cjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.module.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.module.js.map +1 -1
- package/dist/components/Dropzone/Dropzone.module.cjs +1 -0
- package/dist/components/Dropzone/Dropzone.module.cjs.map +1 -1
- package/dist/components/Dropzone/Dropzone.module.js +1 -0
- package/dist/components/Dropzone/Dropzone.module.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.module.cjs +1 -0
- package/dist/components/EmptyState/EmptyState.module.cjs.map +1 -1
- package/dist/components/EmptyState/EmptyState.module.js +1 -0
- package/dist/components/EmptyState/EmptyState.module.js.map +1 -1
- package/dist/components/ErrorState/ErrorState.module.cjs +1 -0
- package/dist/components/ErrorState/ErrorState.module.cjs.map +1 -1
- package/dist/components/ErrorState/ErrorState.module.js +1 -0
- package/dist/components/ErrorState/ErrorState.module.js.map +1 -1
- package/dist/components/ErrorText/ErrorText.module.cjs +1 -0
- package/dist/components/ErrorText/ErrorText.module.cjs.map +1 -1
- package/dist/components/ErrorText/ErrorText.module.js +1 -0
- package/dist/components/ErrorText/ErrorText.module.js.map +1 -1
- package/dist/components/FileUpload/FileUpload.module.cjs +1 -0
- package/dist/components/FileUpload/FileUpload.module.cjs.map +1 -1
- package/dist/components/FileUpload/FileUpload.module.js +1 -0
- package/dist/components/FileUpload/FileUpload.module.js.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.cjs +1 -0
- package/dist/components/FilterBar/FilterBar.module.cjs.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.js +1 -0
- package/dist/components/FilterBar/FilterBar.module.js.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs +1 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.js +1 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.module.js.map +1 -1
- package/dist/components/Form/Form.module.cjs +1 -0
- package/dist/components/Form/Form.module.cjs.map +1 -1
- package/dist/components/Form/Form.module.js +1 -0
- package/dist/components/Form/Form.module.js.map +1 -1
- package/dist/components/HoverCard/HoverCard.module.cjs +1 -0
- package/dist/components/HoverCard/HoverCard.module.cjs.map +1 -1
- package/dist/components/HoverCard/HoverCard.module.js +1 -0
- package/dist/components/HoverCard/HoverCard.module.js.map +1 -1
- package/dist/components/Image/Image.module.cjs +1 -0
- package/dist/components/Image/Image.module.cjs.map +1 -1
- package/dist/components/Image/Image.module.js +1 -0
- package/dist/components/Image/Image.module.js.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.cjs +1 -0
- package/dist/components/ImageCropper/ImageCropper.module.cjs.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.js +1 -0
- package/dist/components/ImageCropper/ImageCropper.module.js.map +1 -1
- package/dist/components/Input/Input.module.cjs +1 -0
- package/dist/components/Input/Input.module.cjs.map +1 -1
- package/dist/components/Input/Input.module.js +1 -0
- package/dist/components/Input/Input.module.js.map +1 -1
- package/dist/components/InstallBanner/InstallBanner.module.cjs +1 -0
- package/dist/components/InstallBanner/InstallBanner.module.cjs.map +1 -1
- package/dist/components/InstallBanner/InstallBanner.module.js +1 -0
- package/dist/components/InstallBanner/InstallBanner.module.js.map +1 -1
- package/dist/components/Kanban/Kanban.module.cjs +1 -0
- package/dist/components/Kanban/Kanban.module.cjs.map +1 -1
- package/dist/components/Kanban/Kanban.module.js +1 -0
- package/dist/components/Kanban/Kanban.module.js.map +1 -1
- package/dist/components/Kbd/Kbd.module.cjs +1 -0
- package/dist/components/Kbd/Kbd.module.cjs.map +1 -1
- package/dist/components/Kbd/Kbd.module.js +1 -0
- package/dist/components/Kbd/Kbd.module.js.map +1 -1
- package/dist/components/Label/Label.module.cjs +1 -0
- package/dist/components/Label/Label.module.cjs.map +1 -1
- package/dist/components/Label/Label.module.js +1 -0
- package/dist/components/Label/Label.module.js.map +1 -1
- package/dist/components/Layout/Layout.module.cjs +1 -0
- package/dist/components/Layout/Layout.module.cjs.map +1 -1
- package/dist/components/Layout/Layout.module.js +1 -0
- package/dist/components/Layout/Layout.module.js.map +1 -1
- package/dist/components/Lightbox/Lightbox.module.cjs +1 -0
- package/dist/components/Lightbox/Lightbox.module.cjs.map +1 -1
- package/dist/components/Lightbox/Lightbox.module.js +1 -0
- package/dist/components/Lightbox/Lightbox.module.js.map +1 -1
- package/dist/components/ListTile/ListTile.module.cjs +1 -0
- package/dist/components/ListTile/ListTile.module.cjs.map +1 -1
- package/dist/components/ListTile/ListTile.module.js +1 -0
- package/dist/components/ListTile/ListTile.module.js.map +1 -1
- package/dist/components/Markdown/Markdown.module.cjs +1 -0
- package/dist/components/Markdown/Markdown.module.cjs.map +1 -1
- package/dist/components/Markdown/Markdown.module.js +1 -0
- package/dist/components/Markdown/Markdown.module.js.map +1 -1
- package/dist/components/Masonry/Masonry.module.cjs +1 -0
- package/dist/components/Masonry/Masonry.module.cjs.map +1 -1
- package/dist/components/Masonry/Masonry.module.js +1 -0
- package/dist/components/Masonry/Masonry.module.js.map +1 -1
- package/dist/components/Menubar/Menubar.module.cjs +1 -0
- package/dist/components/Menubar/Menubar.module.cjs.map +1 -1
- package/dist/components/Menubar/Menubar.module.js +1 -0
- package/dist/components/Menubar/Menubar.module.js.map +1 -1
- package/dist/components/Modal/Modal.module.cjs +1 -0
- package/dist/components/Modal/Modal.module.cjs.map +1 -1
- package/dist/components/Modal/Modal.module.js +1 -0
- package/dist/components/Modal/Modal.module.js.map +1 -1
- package/dist/components/ModalsManager/ModalsManager.module.cjs +1 -0
- package/dist/components/ModalsManager/ModalsManager.module.cjs.map +1 -1
- package/dist/components/ModalsManager/ModalsManager.module.js +1 -0
- package/dist/components/ModalsManager/ModalsManager.module.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.module.cjs +1 -0
- package/dist/components/MultiSelect/MultiSelect.module.cjs.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.module.js +1 -0
- package/dist/components/MultiSelect/MultiSelect.module.js.map +1 -1
- package/dist/components/NProgress/NProgress.module.cjs +1 -0
- package/dist/components/NProgress/NProgress.module.cjs.map +1 -1
- package/dist/components/NProgress/NProgress.module.js +1 -0
- package/dist/components/NProgress/NProgress.module.js.map +1 -1
- package/dist/components/Navbar/Navbar.module.cjs +1 -0
- package/dist/components/Navbar/Navbar.module.cjs.map +1 -1
- package/dist/components/Navbar/Navbar.module.js +1 -0
- package/dist/components/Navbar/Navbar.module.js.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.cjs +1 -0
- package/dist/components/NavigationMenu/NavigationMenu.module.cjs.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.js +1 -0
- package/dist/components/NavigationMenu/NavigationMenu.module.js.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.cjs +1 -0
- package/dist/components/NavigationRail/NavigationRail.module.cjs.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.js +1 -0
- package/dist/components/NavigationRail/NavigationRail.module.js.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.module.cjs +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.module.js +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -1
- package/dist/components/OfflineIndicator/OfflineIndicator.module.cjs +1 -0
- package/dist/components/OfflineIndicator/OfflineIndicator.module.cjs.map +1 -1
- package/dist/components/OfflineIndicator/OfflineIndicator.module.js +1 -0
- package/dist/components/OfflineIndicator/OfflineIndicator.module.js.map +1 -1
- package/dist/components/Page/Page.module.cjs +1 -0
- package/dist/components/Page/Page.module.cjs.map +1 -1
- package/dist/components/Page/Page.module.js +1 -0
- package/dist/components/Page/Page.module.js.map +1 -1
- package/dist/components/Pagination/Pagination.module.cjs +1 -0
- package/dist/components/Pagination/Pagination.module.cjs.map +1 -1
- package/dist/components/Pagination/Pagination.module.js +1 -0
- package/dist/components/Pagination/Pagination.module.js.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.module.cjs +1 -0
- package/dist/components/PasswordInput/PasswordInput.module.cjs.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.module.js +1 -0
- package/dist/components/PasswordInput/PasswordInput.module.js.map +1 -1
- package/dist/components/PinInput/PinInput.module.cjs +1 -0
- package/dist/components/PinInput/PinInput.module.cjs.map +1 -1
- package/dist/components/PinInput/PinInput.module.js +1 -0
- package/dist/components/PinInput/PinInput.module.js.map +1 -1
- package/dist/components/Popover/Popover.module.cjs +1 -0
- package/dist/components/Popover/Popover.module.cjs.map +1 -1
- package/dist/components/Popover/Popover.module.js +1 -0
- package/dist/components/Popover/Popover.module.js.map +1 -1
- package/dist/components/Progress/Progress.module.cjs +1 -0
- package/dist/components/Progress/Progress.module.cjs.map +1 -1
- package/dist/components/Progress/Progress.module.js +1 -0
- package/dist/components/Progress/Progress.module.js.map +1 -1
- package/dist/components/QRCode/QRCode.module.cjs +1 -0
- package/dist/components/QRCode/QRCode.module.cjs.map +1 -1
- package/dist/components/QRCode/QRCode.module.js +1 -0
- package/dist/components/QRCode/QRCode.module.js.map +1 -1
- package/dist/components/Radio/Radio.module.cjs +1 -0
- package/dist/components/Radio/Radio.module.cjs.map +1 -1
- package/dist/components/Radio/Radio.module.js +1 -0
- package/dist/components/Radio/Radio.module.js.map +1 -1
- package/dist/components/RangeSlider/RangeSlider.module.cjs +1 -0
- package/dist/components/RangeSlider/RangeSlider.module.cjs.map +1 -1
- package/dist/components/RangeSlider/RangeSlider.module.js +1 -0
- package/dist/components/RangeSlider/RangeSlider.module.js.map +1 -1
- package/dist/components/RatingStars/RatingStars.module.cjs +1 -0
- package/dist/components/RatingStars/RatingStars.module.cjs.map +1 -1
- package/dist/components/RatingStars/RatingStars.module.js +1 -0
- package/dist/components/RatingStars/RatingStars.module.js.map +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.module.cjs +1 -0
- package/dist/components/RefreshIndicator/RefreshIndicator.module.cjs.map +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.module.js +1 -0
- package/dist/components/RefreshIndicator/RefreshIndicator.module.js.map +1 -1
- package/dist/components/Resizable/Resizable.module.cjs +1 -0
- package/dist/components/Resizable/Resizable.module.cjs.map +1 -1
- package/dist/components/Resizable/Resizable.module.js +1 -0
- package/dist/components/Resizable/Resizable.module.js.map +1 -1
- package/dist/components/SafeArea/SafeArea.module.cjs +1 -0
- package/dist/components/SafeArea/SafeArea.module.cjs.map +1 -1
- package/dist/components/SafeArea/SafeArea.module.js +1 -0
- package/dist/components/SafeArea/SafeArea.module.js.map +1 -1
- package/dist/components/Scheduler/Scheduler.module.cjs +1 -0
- package/dist/components/Scheduler/Scheduler.module.cjs.map +1 -1
- package/dist/components/Scheduler/Scheduler.module.js +1 -0
- package/dist/components/Scheduler/Scheduler.module.js.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.module.cjs +1 -0
- package/dist/components/ScrollArea/ScrollArea.module.cjs.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.module.js +1 -0
- package/dist/components/ScrollArea/ScrollArea.module.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.module.cjs +1 -0
- package/dist/components/SearchBar/SearchBar.module.cjs.map +1 -1
- package/dist/components/SearchBar/SearchBar.module.js +1 -0
- package/dist/components/SearchBar/SearchBar.module.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.module.cjs +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.module.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.module.js +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.module.js.map +1 -1
- package/dist/components/Select/Select.module.cjs +1 -0
- package/dist/components/Select/Select.module.cjs.map +1 -1
- package/dist/components/Select/Select.module.js +1 -0
- package/dist/components/Select/Select.module.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.module.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.js +1 -0
- package/dist/components/Sidebar/Sidebar.module.js.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.module.cjs +1 -0
- package/dist/components/SignaturePad/SignaturePad.module.cjs.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.module.js +1 -0
- package/dist/components/SignaturePad/SignaturePad.module.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.cjs +1 -0
- package/dist/components/Skeleton/Skeleton.module.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.js +1 -0
- package/dist/components/Skeleton/Skeleton.module.js.map +1 -1
- package/dist/components/Slider/Slider.module.cjs +1 -0
- package/dist/components/Slider/Slider.module.cjs.map +1 -1
- package/dist/components/Slider/Slider.module.js +1 -0
- package/dist/components/Slider/Slider.module.js.map +1 -1
- package/dist/components/Spacer/Spacer.module.cjs +1 -0
- package/dist/components/Spacer/Spacer.module.cjs.map +1 -1
- package/dist/components/Spacer/Spacer.module.js +1 -0
- package/dist/components/Spacer/Spacer.module.js.map +1 -1
- package/dist/components/Sparkline/Sparkline.module.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.module.cjs.map +1 -1
- package/dist/components/Sparkline/Sparkline.module.js +1 -0
- package/dist/components/Sparkline/Sparkline.module.js.map +1 -1
- package/dist/components/Spinner/Spinner.module.cjs +1 -0
- package/dist/components/Spinner/Spinner.module.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.module.js +1 -0
- package/dist/components/Spinner/Spinner.module.js.map +1 -1
- package/dist/components/Stat/Stat.module.cjs +1 -0
- package/dist/components/Stat/Stat.module.cjs.map +1 -1
- package/dist/components/Stat/Stat.module.js +1 -0
- package/dist/components/Stat/Stat.module.js.map +1 -1
- package/dist/components/Stepper/Stepper.module.cjs +1 -0
- package/dist/components/Stepper/Stepper.module.cjs.map +1 -1
- package/dist/components/Stepper/Stepper.module.js +1 -0
- package/dist/components/Stepper/Stepper.module.js.map +1 -1
- package/dist/components/StepperInput/StepperInput.module.cjs +1 -0
- package/dist/components/StepperInput/StepperInput.module.cjs.map +1 -1
- package/dist/components/StepperInput/StepperInput.module.js +1 -0
- package/dist/components/StepperInput/StepperInput.module.js.map +1 -1
- package/dist/components/Switch/Switch.module.cjs +1 -0
- package/dist/components/Switch/Switch.module.cjs.map +1 -1
- package/dist/components/Switch/Switch.module.js +1 -0
- package/dist/components/Switch/Switch.module.js.map +1 -1
- package/dist/components/SyncStatusBadge/SyncStatusBadge.module.cjs +1 -0
- package/dist/components/SyncStatusBadge/SyncStatusBadge.module.cjs.map +1 -1
- package/dist/components/SyncStatusBadge/SyncStatusBadge.module.js +1 -0
- package/dist/components/SyncStatusBadge/SyncStatusBadge.module.js.map +1 -1
- package/dist/components/Table/Table.module.cjs +1 -0
- package/dist/components/Table/Table.module.cjs.map +1 -1
- package/dist/components/Table/Table.module.js +1 -0
- package/dist/components/Table/Table.module.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.cjs +1 -0
- package/dist/components/Tabs/Tabs.module.cjs.map +1 -1
- package/dist/components/Tabs/Tabs.module.js +1 -0
- package/dist/components/Tabs/Tabs.module.js.map +1 -1
- package/dist/components/Tag/Tag.module.cjs +1 -0
- package/dist/components/Tag/Tag.module.cjs.map +1 -1
- package/dist/components/Tag/Tag.module.js +1 -0
- package/dist/components/Tag/Tag.module.js.map +1 -1
- package/dist/components/Textarea/Textarea.module.cjs +1 -0
- package/dist/components/Textarea/Textarea.module.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.module.js +1 -0
- package/dist/components/Textarea/Textarea.module.js.map +1 -1
- package/dist/components/TimePicker/TimePicker.module.cjs +1 -0
- package/dist/components/TimePicker/TimePicker.module.cjs.map +1 -1
- package/dist/components/TimePicker/TimePicker.module.js +1 -0
- package/dist/components/TimePicker/TimePicker.module.js.map +1 -1
- package/dist/components/Timeline/Timeline.module.cjs +1 -0
- package/dist/components/Timeline/Timeline.module.cjs.map +1 -1
- package/dist/components/Timeline/Timeline.module.js +1 -0
- package/dist/components/Timeline/Timeline.module.js.map +1 -1
- package/dist/components/Toast/Toast.module.cjs +1 -0
- package/dist/components/Toast/Toast.module.cjs.map +1 -1
- package/dist/components/Toast/Toast.module.js +1 -0
- package/dist/components/Toast/Toast.module.js.map +1 -1
- package/dist/components/Toggle/Toggle.module.cjs +1 -0
- package/dist/components/Toggle/Toggle.module.cjs.map +1 -1
- package/dist/components/Toggle/Toggle.module.js +1 -0
- package/dist/components/Toggle/Toggle.module.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.module.cjs.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.js +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.module.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.module.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.js +1 -0
- package/dist/components/Tooltip/Tooltip.module.js.map +1 -1
- package/dist/components/Tour/Tour.module.cjs +1 -0
- package/dist/components/Tour/Tour.module.cjs.map +1 -1
- package/dist/components/Tour/Tour.module.js +1 -0
- package/dist/components/Tour/Tour.module.js.map +1 -1
- package/dist/components/Transfer/Transfer.module.cjs +1 -0
- package/dist/components/Transfer/Transfer.module.cjs.map +1 -1
- package/dist/components/Transfer/Transfer.module.js +1 -0
- package/dist/components/Transfer/Transfer.module.js.map +1 -1
- package/dist/components/TreeView/TreeView.module.cjs +1 -0
- package/dist/components/TreeView/TreeView.module.cjs.map +1 -1
- package/dist/components/TreeView/TreeView.module.js +1 -0
- package/dist/components/TreeView/TreeView.module.js.map +1 -1
- package/dist/components/TruncateText/TruncateText.module.cjs +1 -0
- package/dist/components/TruncateText/TruncateText.module.cjs.map +1 -1
- package/dist/components/TruncateText/TruncateText.module.js +1 -0
- package/dist/components/TruncateText/TruncateText.module.js.map +1 -1
- package/dist/components/UpdatePrompt/UpdatePrompt.module.cjs +1 -0
- package/dist/components/UpdatePrompt/UpdatePrompt.module.cjs.map +1 -1
- package/dist/components/UpdatePrompt/UpdatePrompt.module.js +1 -0
- package/dist/components/UpdatePrompt/UpdatePrompt.module.js.map +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.module.cjs +1 -0
- package/dist/components/VideoPlayer/VideoPlayer.module.cjs.map +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.module.js +1 -0
- package/dist/components/VideoPlayer/VideoPlayer.module.js.map +1 -1
- package/dist/components/VirtualList/VirtualList.module.cjs +1 -0
- package/dist/components/VirtualList/VirtualList.module.cjs.map +1 -1
- package/dist/components/VirtualList/VirtualList.module.js +1 -0
- package/dist/components/VirtualList/VirtualList.module.js.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.cjs +1 -0
- package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.js +1 -0
- package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.module.cjs +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.module.cjs.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.module.js +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.module.js.map +1 -1
- package/dist/components/Wizard/Wizard.module.cjs +1 -0
- package/dist/components/Wizard/Wizard.module.cjs.map +1 -1
- package/dist/components/Wizard/Wizard.module.js +1 -0
- package/dist/components/Wizard/Wizard.module.js.map +1 -1
- package/dist/editor/RichTextEditor.module.cjs +1 -0
- package/dist/editor/RichTextEditor.module.cjs.map +1 -1
- package/dist/editor/RichTextEditor.module.js +1 -0
- package/dist/editor/RichTextEditor.module.js.map +1 -1
- package/dist/geo/TrajectoryMap.module.cjs +1 -0
- package/dist/geo/TrajectoryMap.module.cjs.map +1 -1
- package/dist/geo/TrajectoryMap.module.js +1 -0
- package/dist/geo/TrajectoryMap.module.js.map +1 -1
- package/dist/icons/IconPicker.module.cjs +1 -0
- package/dist/icons/IconPicker.module.cjs.map +1 -1
- package/dist/icons/IconPicker.module.js +1 -0
- package/dist/icons/IconPicker.module.js.map +1 -1
- package/dist/styles/AIChat.css +1 -78
- package/dist/styles/Accordion.css +1 -11
- package/dist/styles/Alert.css +1 -31
- package/dist/styles/AppBar.css +1 -16
- package/dist/styles/AppShell.css +1 -7
- package/dist/styles/AspectRatio.css +1 -2
- package/dist/styles/AudioPlayer.css +1 -12
- package/dist/styles/AudioRecorder.css +1 -19
- package/dist/styles/Avatar.css +1 -12
- package/dist/styles/AvatarGroup.css +1 -17
- package/dist/styles/Badge.css +1 -24
- package/dist/styles/Banner.css +1 -12
- package/dist/styles/BarList.css +1 -9
- package/dist/styles/BarcodeScanner.css +1 -20
- package/dist/styles/BottomNavigation.css +1 -9
- package/dist/styles/BottomSheet.css +1 -10
- package/dist/styles/BrazilMap.css +1 -19
- package/dist/styles/Breadcrumbs.css +1 -7
- package/dist/styles/Button.css +1 -41
- package/dist/styles/Calendar.css +1 -15
- package/dist/styles/Card.css +1 -14
- package/dist/styles/Carousel.css +1 -16
- package/dist/styles/Center.css +1 -4
- package/dist/styles/Chat.css +1 -34
- package/dist/styles/Checkbox.css +1 -10
- package/dist/styles/ChipInput.css +1 -12
- package/dist/styles/CodeBlock.css +1 -24
- package/dist/styles/Collapsible.css +1 -5
- package/dist/styles/Combobox.css +1 -17
- package/dist/styles/Command.css +1 -19
- package/dist/styles/ContextMenu.css +1 -10
- package/dist/styles/CopyButton.css +1 -3
- package/dist/styles/DataList.css +1 -2
- package/dist/styles/DataTable.css +1 -18
- package/dist/styles/DateRangePicker.css +1 -21
- package/dist/styles/DescriptionList.css +1 -3
- package/dist/styles/Divider.css +1 -10
- package/dist/styles/Drawer.css +1 -21
- package/dist/styles/DropdownMenu.css +1 -15
- package/dist/styles/Dropzone.css +1 -6
- package/dist/styles/EmptyState.css +1 -5
- package/dist/styles/ErrorState.css +1 -5
- package/dist/styles/ErrorText.css +1 -1
- package/dist/styles/FileUpload.css +1 -16
- package/dist/styles/FilterBar.css +1 -18
- package/dist/styles/FloatingActionButton.css +1 -22
- package/dist/styles/Form.css +1 -20
- package/dist/styles/HoverCard.css +1 -10
- package/dist/styles/IconPicker.css +1 -5
- package/dist/styles/Image.css +1 -1
- package/dist/styles/ImageCropper.css +1 -15
- package/dist/styles/Input.css +1 -23
- package/dist/styles/InstallBanner.css +1 -7
- package/dist/styles/Kanban.css +1 -14
- package/dist/styles/Kbd.css +1 -4
- package/dist/styles/Label.css +1 -2
- package/dist/styles/Layout.css +1 -21
- package/dist/styles/Lightbox.css +1 -20
- package/dist/styles/ListTile.css +1 -13
- package/dist/styles/MapLegend.css +1 -8
- package/dist/styles/Markdown.css +1 -23
- package/dist/styles/Masonry.css +1 -3
- package/dist/styles/Menubar.css +1 -16
- package/dist/styles/Modal.css +1 -20
- package/dist/styles/ModalsManager.css +1 -1
- package/dist/styles/MultiSelect.css +1 -20
- package/dist/styles/MunicipalitySearch.css +1 -5
- package/dist/styles/NProgress.css +1 -1
- package/dist/styles/Navbar.css +1 -9
- package/dist/styles/NavigationMenu.css +1 -11
- package/dist/styles/NavigationRail.css +1 -13
- package/dist/styles/NotificationCenter.css +1 -20
- package/dist/styles/OfflineIndicator.css +1 -6
- package/dist/styles/Page.css +1 -12
- package/dist/styles/Pagination.css +1 -11
- package/dist/styles/PasswordInput.css +1 -20
- package/dist/styles/PinInput.css +1 -12
- package/dist/styles/PixQRCode.css +1 -8
- package/dist/styles/Popover.css +1 -9
- package/dist/styles/Progress.css +1 -10
- package/dist/styles/QRCode.css +1 -2
- package/dist/styles/Radio.css +1 -13
- package/dist/styles/RangeSlider.css +1 -14
- package/dist/styles/RatingStars.css +1 -10
- package/dist/styles/RefreshIndicator.css +1 -4
- package/dist/styles/Resizable.css +1 -12
- package/dist/styles/RichTextEditor.css +1 -18
- package/dist/styles/SafeArea.css +1 -6
- package/dist/styles/Scheduler.css +1 -23
- package/dist/styles/ScrollArea.css +1 -6
- package/dist/styles/SearchBar.css +1 -10
- package/dist/styles/SegmentedControl.css +1 -11
- package/dist/styles/Select.css +1 -13
- package/dist/styles/Sidebar.css +1 -18
- package/dist/styles/SignaturePad.css +1 -5
- package/dist/styles/Skeleton.css +1 -6
- package/dist/styles/Slider.css +1 -14
- package/dist/styles/Spacer.css +1 -3
- package/dist/styles/Sparkline.css +1 -3
- package/dist/styles/Spinner.css +1 -11
- package/dist/styles/Stat.css +1 -11
- package/dist/styles/Stepper.css +1 -16
- package/dist/styles/StepperInput.css +1 -14
- package/dist/styles/Switch.css +1 -10
- package/dist/styles/SyncStatusBadge.css +1 -12
- package/dist/styles/Table.css +1 -15
- package/dist/styles/Tabs.css +1 -13
- package/dist/styles/Tag.css +1 -13
- package/dist/styles/Textarea.css +1 -12
- package/dist/styles/TimePicker.css +1 -13
- package/dist/styles/Timeline.css +1 -16
- package/dist/styles/Toast.css +1 -20
- package/dist/styles/Toggle.css +1 -11
- package/dist/styles/ToggleGroup.css +1 -8
- package/dist/styles/Tooltip.css +1 -9
- package/dist/styles/Tour.css +1 -19
- package/dist/styles/TrajectoryMap.css +1 -15
- package/dist/styles/Transfer.css +1 -20
- package/dist/styles/TreeView.css +1 -16
- package/dist/styles/TruncateText.css +1 -1
- package/dist/styles/UpdatePrompt.css +1 -9
- package/dist/styles/VideoPlayer.css +1 -22
- package/dist/styles/VirtualList.css +1 -4
- package/dist/styles/VirtualTable.css +1 -16
- package/dist/styles/VisuallyHidden.css +1 -1
- package/dist/styles/Wizard.css +1 -3
- package/dist/styles/advanced.css +2 -0
- package/dist/styles/chat.css +28 -0
- package/dist/styles/component/AIChat.css +79 -0
- package/dist/styles/component/Accordion.css +12 -0
- package/dist/styles/component/Alert.css +32 -0
- package/dist/styles/component/AppBar.css +17 -0
- package/dist/styles/component/AppShell.css +8 -0
- package/dist/styles/component/AspectRatio.css +3 -0
- package/dist/styles/component/AudioPlayer.css +13 -0
- package/dist/styles/component/AudioRecorder.css +20 -0
- package/dist/styles/component/Avatar.css +13 -0
- package/dist/styles/component/AvatarGroup.css +18 -0
- package/dist/styles/component/Badge.css +25 -0
- package/dist/styles/component/Banner.css +13 -0
- package/dist/styles/component/BarList.css +10 -0
- package/dist/styles/component/BarcodeScanner.css +21 -0
- package/dist/styles/component/BottomNavigation.css +10 -0
- package/dist/styles/component/BottomSheet.css +11 -0
- package/dist/styles/component/BrazilMap.css +20 -0
- package/dist/styles/component/Breadcrumbs.css +8 -0
- package/dist/styles/component/Button.css +42 -0
- package/dist/styles/component/Calendar.css +16 -0
- package/dist/styles/component/Card.css +15 -0
- package/dist/styles/component/Carousel.css +17 -0
- package/dist/styles/component/Center.css +5 -0
- package/dist/styles/component/Chat.css +63 -0
- package/dist/styles/component/Checkbox.css +11 -0
- package/dist/styles/component/ChipInput.css +13 -0
- package/dist/styles/component/CodeBlock.css +25 -0
- package/dist/styles/component/Collapsible.css +6 -0
- package/dist/styles/component/Combobox.css +18 -0
- package/dist/styles/component/Command.css +20 -0
- package/dist/styles/component/ContextMenu.css +13 -0
- package/dist/styles/component/CopyButton.css +4 -0
- package/dist/styles/component/DataList.css +3 -0
- package/dist/styles/component/DataTable.css +19 -0
- package/dist/styles/component/DateRangePicker.css +22 -0
- package/dist/styles/component/DescriptionList.css +4 -0
- package/dist/styles/component/Divider.css +11 -0
- package/dist/styles/component/Drawer.css +22 -0
- package/dist/styles/component/DropdownMenu.css +16 -0
- package/dist/styles/component/Dropzone.css +7 -0
- package/dist/styles/component/EmptyState.css +6 -0
- package/dist/styles/component/ErrorState.css +6 -0
- package/dist/styles/component/ErrorText.css +2 -0
- package/dist/styles/component/FileUpload.css +17 -0
- package/dist/styles/component/FilterBar.css +19 -0
- package/dist/styles/component/FloatingActionButton.css +23 -0
- package/dist/styles/component/Form.css +21 -0
- package/dist/styles/component/HoverCard.css +11 -0
- package/dist/styles/component/IconPicker.css +6 -0
- package/dist/styles/component/Image.css +2 -0
- package/dist/styles/component/ImageCropper.css +16 -0
- package/dist/styles/component/Input.css +24 -0
- package/dist/styles/component/InstallBanner.css +8 -0
- package/dist/styles/component/Kanban.css +15 -0
- package/dist/styles/component/Kbd.css +5 -0
- package/dist/styles/component/Label.css +3 -0
- package/dist/styles/component/Layout.css +22 -0
- package/dist/styles/component/Lightbox.css +21 -0
- package/dist/styles/component/ListTile.css +14 -0
- package/dist/styles/component/MapLegend.css +9 -0
- package/dist/styles/component/Markdown.css +24 -0
- package/dist/styles/component/Masonry.css +4 -0
- package/dist/styles/component/Menubar.css +17 -0
- package/dist/styles/component/Modal.css +21 -0
- package/dist/styles/component/ModalsManager.css +2 -0
- package/dist/styles/component/MultiSelect.css +21 -0
- package/dist/styles/component/MunicipalitySearch.css +6 -0
- package/dist/styles/component/NProgress.css +2 -0
- package/dist/styles/component/Navbar.css +10 -0
- package/dist/styles/component/NavigationMenu.css +12 -0
- package/dist/styles/component/NavigationRail.css +14 -0
- package/dist/styles/component/NotificationCenter.css +21 -0
- package/dist/styles/component/OfflineIndicator.css +7 -0
- package/dist/styles/component/Page.css +13 -0
- package/dist/styles/component/Pagination.css +12 -0
- package/dist/styles/component/PasswordInput.css +21 -0
- package/dist/styles/component/PinInput.css +13 -0
- package/dist/styles/component/PixQRCode.css +9 -0
- package/dist/styles/component/Popover.css +10 -0
- package/dist/styles/component/Progress.css +11 -0
- package/dist/styles/component/QRCode.css +3 -0
- package/dist/styles/component/Radio.css +14 -0
- package/dist/styles/component/RangeSlider.css +15 -0
- package/dist/styles/component/RatingStars.css +11 -0
- package/dist/styles/component/RefreshIndicator.css +5 -0
- package/dist/styles/component/Resizable.css +13 -0
- package/dist/styles/component/RichTextEditor.css +19 -0
- package/dist/styles/component/SafeArea.css +7 -0
- package/dist/styles/component/Scheduler.css +24 -0
- package/dist/styles/component/ScrollArea.css +7 -0
- package/dist/styles/component/SearchBar.css +11 -0
- package/dist/styles/component/SegmentedControl.css +12 -0
- package/dist/styles/component/Select.css +14 -0
- package/dist/styles/component/Sidebar.css +19 -0
- package/dist/styles/component/SignaturePad.css +6 -0
- package/dist/styles/component/Skeleton.css +7 -0
- package/dist/styles/component/Slider.css +15 -0
- package/dist/styles/component/Spacer.css +4 -0
- package/dist/styles/component/Sparkline.css +4 -0
- package/dist/styles/component/Spinner.css +12 -0
- package/dist/styles/component/Stat.css +12 -0
- package/dist/styles/component/Stepper.css +17 -0
- package/dist/styles/component/StepperInput.css +15 -0
- package/dist/styles/component/Switch.css +11 -0
- package/dist/styles/component/SyncStatusBadge.css +13 -0
- package/dist/styles/component/Table.css +16 -0
- package/dist/styles/component/Tabs.css +14 -0
- package/dist/styles/component/Tag.css +14 -0
- package/dist/styles/component/Textarea.css +13 -0
- package/dist/styles/component/TimePicker.css +14 -0
- package/dist/styles/component/Timeline.css +17 -0
- package/dist/styles/component/Toast.css +21 -0
- package/dist/styles/component/Toggle.css +12 -0
- package/dist/styles/component/ToggleGroup.css +9 -0
- package/dist/styles/component/Tooltip.css +10 -0
- package/dist/styles/component/Tour.css +20 -0
- package/dist/styles/component/TrajectoryMap.css +16 -0
- package/dist/styles/component/Transfer.css +21 -0
- package/dist/styles/component/TreeView.css +17 -0
- package/dist/styles/component/TruncateText.css +2 -0
- package/dist/styles/component/UpdatePrompt.css +10 -0
- package/dist/styles/component/VideoPlayer.css +23 -0
- package/dist/styles/component/VirtualList.css +5 -0
- package/dist/styles/component/VirtualTable.css +17 -0
- package/dist/styles/component/VisuallyHidden.css +2 -0
- package/dist/styles/component/Wizard.css +4 -0
- package/dist/styles/manifest.json +202 -190
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +1 -1
- package/dist/tempest-react-sdk.d.ts +253 -10
- package/dist/tempest-react-sdk.js +169 -167
- package/dist/theme/create-theme.cjs +3 -3
- package/dist/theme/create-theme.cjs.map +1 -1
- package/dist/theme/create-theme.js +109 -57
- package/dist/theme/create-theme.js.map +1 -1
- package/dist/vite/narrow-tokens.cjs +3 -0
- package/dist/vite/narrow-tokens.cjs.map +1 -0
- package/dist/vite/narrow-tokens.js +50 -0
- package/dist/vite/narrow-tokens.js.map +1 -0
- package/dist/vite/tempest-styles.cjs +6 -4
- package/dist/vite/tempest-styles.cjs.map +1 -1
- package/dist/vite/tempest-styles.js +73 -47
- package/dist/vite/tempest-styles.js.map +1 -1
- package/dist/vite.d.ts +19 -0
- package/loader/css-loader-hooks.mjs +37 -0
- package/loader/css-loader.mjs +46 -0
- package/package.json +4 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
`,
|
|
3
|
-
`)}\n`;let
|
|
4
|
-
`)}\n`}async function
|
|
1
|
+
const e=require("./narrow-tokens.cjs");let t=require("node:path"),n=require("node:fs/promises"),r=require("node:fs"),i=require("node:url");var a=`tempest-react-sdk/styles/auto.css`,o=`\0tempest-styles/auto.css`,s=/^tempest-react-sdk(\/(charts|editor|br|icons))?$/,c=/\.[cm]?[jt]sx?$/,l=/\.(css|scss|sass|less)$/,u=new Set([`node_modules`,`dist`,`build`,`coverage`]);function d(e){let t=new Set;for(let n of e.matchAll(/\bimport\s+(type\s+)?([^;'"]*?)\s+from\s*["']([^"']+)["']/g)){let[,e,r,i]=n;if(!s.test(i??``)||e)continue;if(/^\s*\*\s+as\s/.test(r??``))return null;let a=/\{([^}]*)\}/.exec(r??``);if(a)for(let e of(a[1]??``).split(`,`)){let n=e.trim();if(!n||n.startsWith(`type `))continue;let r=n.split(/\s+as\s+/)[0]?.trim();r&&t.add(r)}}return[...t]}function f(e,t,n=`scoped`,r=null){let i=`/* Generated by tempestStyles() — the CSS this app actually uses. */
|
|
2
|
+
`,a=r===null?[`tokens.css`]:[],o=n===`global`?r===null?[t.core]:[...a,`base.css`]:n===`scoped`?[...a,`scoped.css`]:a,s=r===null?``:`${r}\n`;if(e===null)return`${i}${(n===`global`?[t.core,`../styles.css`]:[...o,`../styles.css`]).map(e=>`@import "tempest-react-sdk/styles/${e}";`).join(`
|
|
3
|
+
`)}\n${s}`;let c=new Set;for(let n of e)for(let e of t.components[n]??[])c.add(e);return`${i}${[...o,...[...c].sort()].map(e=>`@import "tempest-react-sdk/styles/${e}";`).join(`
|
|
4
|
+
`)}\n${s}`}function p(e,t,n){if(e===null)return[`../styles.css`];let r=new Set;n===`scoped`&&r.add(`scoped.css`),n===`global`&&r.add(`base.css`);for(let n of e)for(let e of t.components[n]??[])r.add(e);return[...r].sort()}async function m(e,r){let i=[],a;try{a=await(0,n.readdir)(e,{withFileTypes:!0})}catch{return i}for(let n of a)if(n.isDirectory()){if(r.has(n.name)||n.name.startsWith(`.`))continue;i.push(...await m((0,t.join)(e,n.name),r))}else n.isFile()&&(c.test(n.name)||l.test(n.name))&&i.push((0,t.join)(e,n.name));return i}function h(e){let n=(0,t.join)(`tempest-react-sdk`,`dist`,`styles`,`manifest.json`),a=[],o=(0,t.resolve)(e);for(;;){a.push((0,t.join)(o,`node_modules`,n));let e=(0,t.dirname)(o);if(e===o)break;o=e}a.push((0,t.join)((0,t.dirname)((0,i.fileURLToPath)({}.url)),`..`,`styles`,`manifest.json`));for(let e of a)try{return{manifest:JSON.parse((0,r.readFileSync)(e,`utf8`)),dir:(0,t.dirname)(e)}}catch{continue}throw Error(`tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found — the installed SDK predates it. Upgrade, or drop the plugin and import tempest-react-sdk/styles.css.`)}function g(i={}){let{dir:a=`src`,include:s=[],skipDirs:c,reset:g=`scoped`,tokens:_=`used`}=i,v=new Set(c??u),y=process.cwd(),b=[...s],x=``,S=async()=>{let e=new Set(s),r=[],i=!1;for(let o of await m((0,t.resolve)(y,a),v)){let t;try{t=await(0,n.readFile)(o,`utf8`)}catch{continue}if(t.includes(`--tempest-`)&&r.push(t),l.test(o))continue;let a=d(t);if(a===null)i=!0;else for(let t of a)e.add(t)}x=r.join(`
|
|
5
|
+
`),b=i?null:[...e]},C=(n,i)=>{if(_===`all`||b===null)return null;let a;try{a=(0,r.readFileSync)((0,t.join)(i,`tokens.css`),`utf8`)}catch{return null}let o=[x];for(let e of p(b,n,g))try{o.push((0,r.readFileSync)((0,t.join)(i,e),`utf8`))}catch{return null}return e.narrowTokens(a,o.join(`
|
|
6
|
+
`))};return{name:`tempest-styles`,enforce:`pre`,configResolved(e){y=e.root??y},async buildStart(){await S()},resolveId(e){return e===`tempest-react-sdk/styles/auto.css`?o:null},load(e){if(e!==o)return null;let{manifest:t,dir:n}=h(y);return f(b,t,g,C(t,n))}}}exports.TEMPEST_STYLES_ID=a,exports.buildStyleEntry=f,exports.scanStyleImports=d,exports.selectedSheets=p,exports.tempestStyles=g;
|
|
5
7
|
//# sourceMappingURL=tempest-styles.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tempest-styles.cjs","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset — `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` — so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet — tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name → the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them — a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from — the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them — the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n): string {\n const banner = \"/* Generated by tempestStyles() — the CSS this app actually uses. */\\n\";\n const foundation =\n reset === \"global\"\n ? [manifest.core]\n : reset === \"scoped\"\n ? [\"tokens.css\", \"scoped.css\"]\n : [\"tokens.css\"];\n\n if (names === null) {\n const whole = reset === \"global\" ? [\"../styles.css\"] : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n`;\n}\n\n/**\n * Walk a directory and collect every source file path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (entry.isFile() && SOURCE_FILE.test(entry.name)) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function — `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest.\n * @throws If no installed copy carries one — an SDK older than the manifest.\n */\nfunction readManifest(root: string): StyleManifest {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n return JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found — \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships — measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven — a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against — components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too — to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx — the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch — the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n const scanned = scanStyleImports(code);\n if (scanned === null) {\n names = null;\n return;\n }\n for (const name of scanned) found.add(name);\n }\n names = [...found];\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\n\n load(id: string) {\n return id === RESOLVED_ID ? buildStyleEntry(names, readManifest(root), reset) : null;\n },\n };\n}\n"],"mappings":"oGAQA,IAAa,EAAoB,oCAE3B,EAAc,4BAGd,EAAgB,mDAEhB,EAAc,kBACd,EAAY,IAAI,IAAI,CAAC,eAAgB,OAAQ,QAAS,UAAU,CAAC,EAsDvE,SAAgB,EAAiB,EAA+B,CAC5D,IAAM,EAAQ,IAAI,IAElB,IAAK,IAAM,KAAS,EAAK,SACrB,4DACJ,EAAG,CACC,GAAM,EAAG,EAAU,EAAQ,GAAa,EAExC,GADI,CAAC,EAAc,KAAK,GAAa,EAAE,GACnC,EAAU,SACd,GAAI,gBAAgB,KAAK,GAAU,EAAE,EAAG,OAAO,KAE/C,IAAM,EAAS,cAAc,KAAK,GAAU,EAAE,EACzC,KACL,IAAK,IAAM,KAAS,EAAO,IAAM,GAAA,CAAI,MAAM,GAAG,EAAG,CAC7C,IAAM,EAAU,EAAK,KAAK,EAC1B,GAAI,CAAC,GAAW,EAAQ,WAAW,OAAO,EAAG,SAC7C,IAAM,EAAO,EAAQ,MAAM,UAAU,CA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,EAAM,IAAI,CAAI,CAC9C,CACA,EAAQ,CAAC,GAAG,CAAK,CACrB,EAEA,MAAO,CACH,KAAM,iBACN,QAAS,MAET,eAAe,EAA2B,CACtC,EAAO,EAAO,MAAQ,CAC1B,EAEA,MAAM,YAAa,CACf,MAAM,EAAO,CACjB,EAEA,UAAU,EAAY,CAClB,OAAO,IAAA,oCAA2B,EAAc,IACpD,EAEA,KAAK,EAAY,CACb,OAAO,IAAO,EAAc,EAAgB,EAAO,EAAa,CAAI,EAAG,CAAK,EAAI,IACpF,CACJ,CACJ"}
|
|
1
|
+
{"version":3,"file":"tempest-styles.cjs","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { narrowTokens } from \"./narrow-tokens\";\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\n\n/**\n * The app's own stylesheets, scanned for token reads rather than for imports.\n *\n * An app is documented as free to read `--tempest-*` in CSS of its own, so cutting\n * the token sheet to what the SDK's components reach would drop tokens the app is\n * still reading — and a dropped token is not a smaller sheet, it is an unset\n * property. These files contribute reads to the closure and nothing else.\n */\nconst STYLE_FILE = /\\.(css|scss|sass|less)$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset — `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` — so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/**\n * How much of the token sheet an app takes.\n *\n * `\"used\"` emits only the tokens the selected stylesheets — and the app's own CSS —\n * can reach, following token-to-token references. `\"all\"` emits `tokens.css` whole,\n * which is what to reach for when the app names tokens somewhere the scan cannot\n * see: a token read from a CSS-in-JS library, a sibling package's stylesheet, a\n * `<style>` block in `index.html`.\n */\nexport type TokenMode = \"used\" | \"all\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet — tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name → the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them — a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n /**\n * How much of the token sheet to emit. Default: `\"used\"`.\n *\n * The default falls back to the whole sheet on its own whenever a token name is\n * assembled at runtime (`` `var(--tempest-${tone})` ``), so `\"all\"` is for the\n * case the scan cannot see at all — a token read from outside `dir`.\n */\n tokens?: TokenMode;\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from — the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them — the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * The narrowed token block is the exception, and it goes last for a reason the\n * cascade does not explain: `@import` is only valid before any rule, so a token\n * block written above the imports would make every one of them invalid and the\n * components would arrive with no CSS at all. Putting it last is safe because the\n * block declares custom properties and nothing else — resolving `var()` does not\n * depend on where in the document the declaration sits, only on which selector\n * wins, and no component sheet declares a token to compete with.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @param tokenBlock - The narrowed token sheet, or `null` to `@import` it whole.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n tokenBlock: string | null = null,\n): string {\n const banner = \"/* Generated by tempestStyles() — the CSS this app actually uses. */\\n\";\n const tokenSheets = tokenBlock === null ? [\"tokens.css\"] : [];\n const foundation =\n reset === \"global\"\n ? tokenBlock === null\n ? [manifest.core]\n : [...tokenSheets, \"base.css\"]\n : reset === \"scoped\"\n ? [...tokenSheets, \"scoped.css\"]\n : tokenSheets;\n\n const trailer = tokenBlock === null ? \"\" : `${tokenBlock}\\n`;\n\n if (names === null) {\n const whole =\n reset === \"global\"\n ? [manifest.core, \"../styles.css\"]\n : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n${trailer}`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n${trailer}`;\n}\n\n/**\n * The stylesheets an entry will load, by name, for the token closure to read.\n *\n * @param names - Export names the app imports, or `null` when unknowable.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @returns Stylesheet file names under `dist/styles/`.\n */\nexport function selectedSheets(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode,\n): string[] {\n if (names === null) return [\"../styles.css\"];\n const sheets = new Set<string>();\n if (reset === \"scoped\") sheets.add(\"scoped.css\");\n if (reset === \"global\") sheets.add(\"base.css\");\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n return [...sheets].sort();\n}\n\n/**\n * Walk a directory and collect every source and stylesheet path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (\n entry.isFile() &&\n (SOURCE_FILE.test(entry.name) || STYLE_FILE.test(entry.name))\n ) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function — `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest and the directory it was read from, which is also where the\n * stylesheets it names live.\n * @throws If no installed copy carries one — an SDK older than the manifest.\n */\nfunction readManifest(root: string): { manifest: StyleManifest; dir: string } {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n const manifest = JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n return { manifest, dir: dirname(candidate) };\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found — \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships — measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven — a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against — components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too — to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx — the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\", tokens = \"used\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n let appStyleUsage = \"\";\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch — the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n const usage: string[] = [];\n let namespaced = false;\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n if (code.includes(\"--tempest-\")) usage.push(code);\n if (STYLE_FILE.test(file)) continue;\n const scanned = scanStyleImports(code);\n if (scanned === null) namespaced = true;\n else for (const name of scanned) found.add(name);\n }\n appStyleUsage = usage.join(\"\\n\");\n names = namespaced ? null : [...found];\n };\n\n /**\n * The token block for this build, or `null` to `@import` the whole sheet.\n *\n * Reads the stylesheets the entry is about to load and closes over the tokens\n * they consult, plus the ones the app's own CSS consults. Any read it cannot\n * resolve statically — a name assembled at runtime, an unreadable sheet, a\n * package too old to ship `tokens.css` — returns `null`, which costs bytes and\n * never correctness. Serving a token sheet with a hole in it would do the\n * opposite.\n *\n * @param manifest - The published style manifest.\n * @param styleDir - Directory the manifest and its stylesheets live in.\n * @returns The narrowed sheet, or `null`.\n */\n const narrowedTokens = (manifest: StyleManifest, styleDir: string): string | null => {\n if (tokens === \"all\" || names === null) return null;\n let tokensCss: string;\n try {\n tokensCss = readFileSync(join(styleDir, \"tokens.css\"), \"utf8\");\n } catch {\n return null;\n }\n const parts: string[] = [appStyleUsage];\n for (const sheet of selectedSheets(names, manifest, reset)) {\n try {\n parts.push(readFileSync(join(styleDir, sheet), \"utf8\"));\n } catch {\n return null;\n }\n }\n return narrowTokens(tokensCss, parts.join(\"\\n\"));\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\n\n load(id: string) {\n if (id !== RESOLVED_ID) return null;\n const { manifest, dir: styleDir } = readManifest(root);\n return buildStyleEntry(names, manifest, reset, narrowedTokens(manifest, styleDir));\n },\n };\n}\n"],"mappings":"2IASA,IAAa,EAAoB,oCAE3B,EAAc,4BAGd,EAAgB,mDAEhB,EAAc,kBAUd,EAAa,0BACb,EAAY,IAAI,IAAI,CAAC,eAAgB,OAAQ,QAAS,UAAU,CAAC,EAyEvE,SAAgB,EAAiB,EAA+B,CAC5D,IAAM,EAAQ,IAAI,IAElB,IAAK,IAAM,KAAS,EAAK,SACrB,4DACJ,EAAG,CACC,GAAM,EAAG,EAAU,EAAQ,GAA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AO,KAC/C,IAAI,EACJ,GAAI,CACA,GAAA,EAAY,EAAA,aAAA,EAAA,EAAa,EAAA,KAAA,CAAK,EAAU,YAAY,EAAG,MAAM,CACjE,MAAQ,CACJ,OAAO,IACX,CACA,IAAM,EAAkB,CAAC,CAAa,EACtC,IAAK,IAAM,KAAS,EAAe,EAAO,EAAU,CAAK,EACrD,GAAI,CACA,EAAM,MAAA,EAAK,EAAA,aAAA,EAAA,EAAa,EAAA,KAAA,CAAK,EAAU,CAAK,EAAG,MAAM,CAAC,CAC1D,MAAQ,CACJ,OAAO,IACX,CAEJ,OAAO,EAAA,aAAa,EAAW,EAAM,KAAK;CAAI,CAAC,CACnD,EAEA,MAAO,CACH,KAAM,iBACN,QAAS,MAET,eAAe,EAA2B,CACtC,EAAO,EAAO,MAAQ,CAC1B,EAEA,MAAM,YAAa,CACf,MAAM,EAAO,CACjB,EAEA,UAAU,EAAY,CAClB,OAAO,IAAA,oCAA2B,EAAc,IACpD,EAEA,KAAK,EAAY,CACb,GAAI,IAAO,EAAa,OAAO,KAC/B,GAAM,CAAE,WAAU,IAAK,GAAa,EAAa,CAAI,EACrD,OAAO,EAAgB,EAAO,EAAU,EAAO,EAAe,EAAU,CAAQ,CAAC,CACrF,CACJ,CACJ"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { narrowTokens as e } from "./narrow-tokens.js";
|
|
2
|
+
import { dirname as t, join as n, resolve as r } from "node:path";
|
|
3
|
+
import { readFile as i, readdir as a } from "node:fs/promises";
|
|
4
|
+
import { readFileSync as o } from "node:fs";
|
|
5
|
+
import { fileURLToPath as s } from "node:url";
|
|
5
6
|
//#region src/vite/tempest-styles.ts
|
|
6
|
-
var
|
|
7
|
+
var c = "tempest-react-sdk/styles/auto.css", l = "\0tempest-styles/auto.css", u = /^tempest-react-sdk(\/(charts|editor|br|icons))?$/, d = /\.[cm]?[jt]sx?$/, f = /\.(css|scss|sass|less)$/, p = /* @__PURE__ */ new Set([
|
|
7
8
|
"node_modules",
|
|
8
9
|
"dist",
|
|
9
10
|
"build",
|
|
10
11
|
"coverage"
|
|
11
12
|
]);
|
|
12
|
-
function
|
|
13
|
+
function m(e) {
|
|
13
14
|
let t = /* @__PURE__ */ new Set();
|
|
14
15
|
for (let n of e.matchAll(/\bimport\s+(type\s+)?([^;'"]*?)\s+from\s*["']([^"']+)["']/g)) {
|
|
15
16
|
let [, e, r, i] = n;
|
|
16
|
-
if (!
|
|
17
|
+
if (!u.test(i ?? "") || e) continue;
|
|
17
18
|
if (/^\s*\*\s+as\s/.test(r ?? "")) return null;
|
|
18
19
|
let a = /\{([^}]*)\}/.exec(r ?? "");
|
|
19
20
|
if (a) for (let e of (a[1] ?? "").split(",")) {
|
|
@@ -25,79 +26,104 @@ function f(e) {
|
|
|
25
26
|
}
|
|
26
27
|
return [...t];
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
let
|
|
30
|
-
if (e === null) return `${
|
|
31
|
-
let
|
|
32
|
-
for (let n of e) for (let e of t.components[n] ?? [])
|
|
33
|
-
return `${
|
|
29
|
+
function h(e, t, n = "scoped", r = null) {
|
|
30
|
+
let i = "/* Generated by tempestStyles() — the CSS this app actually uses. */\n", a = r === null ? ["tokens.css"] : [], o = n === "global" ? r === null ? [t.core] : [...a, "base.css"] : n === "scoped" ? [...a, "scoped.css"] : a, s = r === null ? "" : `${r}\n`;
|
|
31
|
+
if (e === null) return `${i}${(n === "global" ? [t.core, "../styles.css"] : [...o, "../styles.css"]).map((e) => `@import "tempest-react-sdk/styles/${e}";`).join("\n")}\n${s}`;
|
|
32
|
+
let c = /* @__PURE__ */ new Set();
|
|
33
|
+
for (let n of e) for (let e of t.components[n] ?? []) c.add(e);
|
|
34
|
+
return `${i}${[...o, ...[...c].sort()].map((e) => `@import "tempest-react-sdk/styles/${e}";`).join("\n")}\n${s}`;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
function g(e, t, n) {
|
|
37
|
+
if (e === null) return ["../styles.css"];
|
|
38
|
+
let r = /* @__PURE__ */ new Set();
|
|
39
|
+
n === "scoped" && r.add("scoped.css"), n === "global" && r.add("base.css");
|
|
40
|
+
for (let n of e) for (let e of t.components[n] ?? []) r.add(e);
|
|
41
|
+
return [...r].sort();
|
|
42
|
+
}
|
|
43
|
+
async function _(e, t) {
|
|
44
|
+
let r = [], i;
|
|
37
45
|
try {
|
|
38
|
-
|
|
46
|
+
i = await a(e, { withFileTypes: !0 });
|
|
39
47
|
} catch {
|
|
40
48
|
return r;
|
|
41
49
|
}
|
|
42
|
-
for (let
|
|
43
|
-
if (
|
|
44
|
-
r.push(...await
|
|
45
|
-
} else
|
|
50
|
+
for (let a of i) if (a.isDirectory()) {
|
|
51
|
+
if (t.has(a.name) || a.name.startsWith(".")) continue;
|
|
52
|
+
r.push(...await _(n(e, a.name), t));
|
|
53
|
+
} else a.isFile() && (d.test(a.name) || f.test(a.name)) && r.push(n(e, a.name));
|
|
46
54
|
return r;
|
|
47
55
|
}
|
|
48
|
-
function
|
|
49
|
-
let i =
|
|
56
|
+
function v(e) {
|
|
57
|
+
let i = n("tempest-react-sdk", "dist", "styles", "manifest.json"), a = [], c = r(e);
|
|
50
58
|
for (;;) {
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
if (
|
|
54
|
-
c =
|
|
59
|
+
a.push(n(c, "node_modules", i));
|
|
60
|
+
let e = t(c);
|
|
61
|
+
if (e === c) break;
|
|
62
|
+
c = e;
|
|
55
63
|
}
|
|
56
|
-
|
|
57
|
-
for (let e of
|
|
58
|
-
return
|
|
64
|
+
a.push(n(t(s(import.meta.url)), "..", "styles", "manifest.json"));
|
|
65
|
+
for (let e of a) try {
|
|
66
|
+
return {
|
|
67
|
+
manifest: JSON.parse(o(e, "utf8")),
|
|
68
|
+
dir: t(e)
|
|
69
|
+
};
|
|
59
70
|
} catch {
|
|
60
71
|
continue;
|
|
61
72
|
}
|
|
62
73
|
throw Error("tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found — the installed SDK predates it. Upgrade, or drop the plugin and import tempest-react-sdk/styles.css.");
|
|
63
74
|
}
|
|
64
|
-
function
|
|
65
|
-
let { dir:
|
|
66
|
-
let e = new Set(
|
|
67
|
-
for (let
|
|
68
|
-
let
|
|
75
|
+
function y(t = {}) {
|
|
76
|
+
let { dir: a = "src", include: s = [], skipDirs: c, reset: u = "scoped", tokens: d = "used" } = t, y = new Set(c ?? p), b = process.cwd(), x = [...s], S = "", C = async () => {
|
|
77
|
+
let e = new Set(s), t = [], n = !1;
|
|
78
|
+
for (let o of await _(r(b, a), y)) {
|
|
79
|
+
let r;
|
|
69
80
|
try {
|
|
70
|
-
|
|
81
|
+
r = await i(o, "utf8");
|
|
71
82
|
} catch {
|
|
72
83
|
continue;
|
|
73
84
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
if (r.includes("--tempest-") && t.push(r), f.test(o)) continue;
|
|
86
|
+
let a = m(r);
|
|
87
|
+
if (a === null) n = !0;
|
|
88
|
+
else for (let t of a) e.add(t);
|
|
89
|
+
}
|
|
90
|
+
S = t.join("\n"), x = n ? null : [...e];
|
|
91
|
+
}, w = (t, r) => {
|
|
92
|
+
if (d === "all" || x === null) return null;
|
|
93
|
+
let i;
|
|
94
|
+
try {
|
|
95
|
+
i = o(n(r, "tokens.css"), "utf8");
|
|
96
|
+
} catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
let a = [S];
|
|
100
|
+
for (let e of g(x, t, u)) try {
|
|
101
|
+
a.push(o(n(r, e), "utf8"));
|
|
102
|
+
} catch {
|
|
103
|
+
return null;
|
|
80
104
|
}
|
|
81
|
-
|
|
105
|
+
return e(i, a.join("\n"));
|
|
82
106
|
};
|
|
83
107
|
return {
|
|
84
108
|
name: "tempest-styles",
|
|
85
109
|
enforce: "pre",
|
|
86
110
|
configResolved(e) {
|
|
87
|
-
|
|
111
|
+
b = e.root ?? b;
|
|
88
112
|
},
|
|
89
113
|
async buildStart() {
|
|
90
|
-
await
|
|
114
|
+
await C();
|
|
91
115
|
},
|
|
92
116
|
resolveId(e) {
|
|
93
|
-
return e === "tempest-react-sdk/styles/auto.css" ?
|
|
117
|
+
return e === "tempest-react-sdk/styles/auto.css" ? l : null;
|
|
94
118
|
},
|
|
95
119
|
load(e) {
|
|
96
|
-
|
|
120
|
+
if (e !== l) return null;
|
|
121
|
+
let { manifest: t, dir: n } = v(b);
|
|
122
|
+
return h(x, t, u, w(t, n));
|
|
97
123
|
}
|
|
98
124
|
};
|
|
99
125
|
}
|
|
100
126
|
//#endregion
|
|
101
|
-
export {
|
|
127
|
+
export { c as TEMPEST_STYLES_ID, h as buildStyleEntry, m as scanStyleImports, g as selectedSheets, y as tempestStyles };
|
|
102
128
|
|
|
103
129
|
//# sourceMappingURL=tempest-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tempest-styles.js","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset — `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` — so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet — tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name → the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them — a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from — the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them — the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n): string {\n const banner = \"/* Generated by tempestStyles() — the CSS this app actually uses. */\\n\";\n const foundation =\n reset === \"global\"\n ? [manifest.core]\n : reset === \"scoped\"\n ? [\"tokens.css\", \"scoped.css\"]\n : [\"tokens.css\"];\n\n if (names === null) {\n const whole = reset === \"global\" ? [\"../styles.css\"] : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n`;\n}\n\n/**\n * Walk a directory and collect every source file path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (entry.isFile() && SOURCE_FILE.test(entry.name)) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function — `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest.\n * @throws If no installed copy carries one — an SDK older than the manifest.\n */\nfunction readManifest(root: string): StyleManifest {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n return JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found — \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships — measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven — a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against — components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too — to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx — the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch — the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n const scanned = scanStyleImports(code);\n if (scanned === null) {\n names = null;\n return;\n }\n for (const name of scanned) found.add(name);\n }\n names = [...found];\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\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F,IAAM,EAAE,SAAM,OAAO,aAAU,CAAC,GAAG,aAAU,WAAQ,aAAa,GAC5D,IAAO,IAAI,IAAY,KAAY,CAAS,GAC9C,IAAO,QAAQ,IAAI,GACnB,IAAyB,CAAC,GAAG,CAAO,GAWlC,IAAS,YAA2B;EACtC,IAAM,IAAQ,IAAI,IAAY,CAAO;EACrC,KAAK,IAAM,KAAQ,MAAM,EAAmB,EAAQ,GAAM,CAAG,GAAG,CAAI,GAAG;GACnE,IAAI;GACJ,IAAI;IACA,IAAO,MAAM,EAAS,GAAM,MAAM;GACtC,QAAQ;IACJ;GACJ;GACA,IAAM,IAAU,EAAiB,CAAI;GACrC,IAAI,MAAY,MAAM;IAClB,IAAQ;IACR;GACJ;GACA,KAAK,IAAM,KAAQ,GAAS,EAAM,IAAI,CAAI;EAC9C;EACA,IAAQ,CAAC,GAAG,CAAK;CACrB;CAEA,OAAO;EACH,MAAM;EACN,SAAS;EAET,eAAe,GAA2B;GACtC,IAAO,EAAO,QAAQ;EAC1B;EAEA,MAAM,aAAa;GACf,MAAM,EAAO;EACjB;EAEA,UAAU,GAAY;GAClB,OAAO,MAAA,sCAA2B,IAAc;EACpD;EAEA,KAAK,GAAY;GACb,OAAO,MAAO,IAAc,EAAgB,GAAO,EAAa,CAAI,GAAG,CAAK,IAAI;EACpF;CACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"tempest-styles.js","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { narrowTokens } from \"./narrow-tokens\";\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\n\n/**\n * The app's own stylesheets, scanned for token reads rather than for imports.\n *\n * An app is documented as free to read `--tempest-*` in CSS of its own, so cutting\n * the token sheet to what the SDK's components reach would drop tokens the app is\n * still reading — and a dropped token is not a smaller sheet, it is an unset\n * property. These files contribute reads to the closure and nothing else.\n */\nconst STYLE_FILE = /\\.(css|scss|sass|less)$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset — `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` — so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/**\n * How much of the token sheet an app takes.\n *\n * `\"used\"` emits only the tokens the selected stylesheets — and the app's own CSS —\n * can reach, following token-to-token references. `\"all\"` emits `tokens.css` whole,\n * which is what to reach for when the app names tokens somewhere the scan cannot\n * see: a token read from a CSS-in-JS library, a sibling package's stylesheet, a\n * `<style>` block in `index.html`.\n */\nexport type TokenMode = \"used\" | \"all\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet — tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name → the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them — a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n /**\n * How much of the token sheet to emit. Default: `\"used\"`.\n *\n * The default falls back to the whole sheet on its own whenever a token name is\n * assembled at runtime (`` `var(--tempest-${tone})` ``), so `\"all\"` is for the\n * case the scan cannot see at all — a token read from outside `dir`.\n */\n tokens?: TokenMode;\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from — the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them — the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * The narrowed token block is the exception, and it goes last for a reason the\n * cascade does not explain: `@import` is only valid before any rule, so a token\n * block written above the imports would make every one of them invalid and the\n * components would arrive with no CSS at all. Putting it last is safe because the\n * block declares custom properties and nothing else — resolving `var()` does not\n * depend on where in the document the declaration sits, only on which selector\n * wins, and no component sheet declares a token to compete with.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @param tokenBlock - The narrowed token sheet, or `null` to `@import` it whole.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n tokenBlock: string | null = null,\n): string {\n const banner = \"/* Generated by tempestStyles() — the CSS this app actually uses. */\\n\";\n const tokenSheets = tokenBlock === null ? [\"tokens.css\"] : [];\n const foundation =\n reset === \"global\"\n ? tokenBlock === null\n ? [manifest.core]\n : [...tokenSheets, \"base.css\"]\n : reset === \"scoped\"\n ? [...tokenSheets, \"scoped.css\"]\n : tokenSheets;\n\n const trailer = tokenBlock === null ? \"\" : `${tokenBlock}\\n`;\n\n if (names === null) {\n const whole =\n reset === \"global\"\n ? [manifest.core, \"../styles.css\"]\n : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n${trailer}`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n${trailer}`;\n}\n\n/**\n * The stylesheets an entry will load, by name, for the token closure to read.\n *\n * @param names - Export names the app imports, or `null` when unknowable.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @returns Stylesheet file names under `dist/styles/`.\n */\nexport function selectedSheets(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode,\n): string[] {\n if (names === null) return [\"../styles.css\"];\n const sheets = new Set<string>();\n if (reset === \"scoped\") sheets.add(\"scoped.css\");\n if (reset === \"global\") sheets.add(\"base.css\");\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n return [...sheets].sort();\n}\n\n/**\n * Walk a directory and collect every source and stylesheet path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (\n entry.isFile() &&\n (SOURCE_FILE.test(entry.name) || STYLE_FILE.test(entry.name))\n ) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function — `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest and the directory it was read from, which is also where the\n * stylesheets it names live.\n * @throws If no installed copy carries one — an SDK older than the manifest.\n */\nfunction readManifest(root: string): { manifest: StyleManifest; dir: string } {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n const manifest = JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n return { manifest, dir: dirname(candidate) };\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found — \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships — measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven — a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against — components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too — to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx — the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\", tokens = \"used\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n let appStyleUsage = \"\";\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch — the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n const usage: string[] = [];\n let namespaced = false;\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n if (code.includes(\"--tempest-\")) usage.push(code);\n if (STYLE_FILE.test(file)) continue;\n const scanned = scanStyleImports(code);\n if (scanned === null) namespaced = true;\n else for (const name of scanned) found.add(name);\n }\n appStyleUsage = usage.join(\"\\n\");\n names = namespaced ? null : [...found];\n };\n\n /**\n * The token block for this build, or `null` to `@import` the whole sheet.\n *\n * Reads the stylesheets the entry is about to load and closes over the tokens\n * they consult, plus the ones the app's own CSS consults. Any read it cannot\n * resolve statically — a name assembled at runtime, an unreadable sheet, a\n * package too old to ship `tokens.css` — returns `null`, which costs bytes and\n * never correctness. Serving a token sheet with a hole in it would do the\n * opposite.\n *\n * @param manifest - The published style manifest.\n * @param styleDir - Directory the manifest and its stylesheets live in.\n * @returns The narrowed sheet, or `null`.\n */\n const narrowedTokens = (manifest: StyleManifest, styleDir: string): string | null => {\n if (tokens === \"all\" || names === null) return null;\n let tokensCss: string;\n try {\n tokensCss = readFileSync(join(styleDir, \"tokens.css\"), \"utf8\");\n } catch {\n return null;\n }\n const parts: string[] = [appStyleUsage];\n for (const sheet of selectedSheets(names, manifest, reset)) {\n try {\n parts.push(readFileSync(join(styleDir, sheet), \"utf8\"));\n } catch {\n return null;\n }\n }\n return narrowTokens(tokensCss, parts.join(\"\\n\"));\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\n\n load(id: string) {\n if (id !== RESOLVED_ID) return null;\n const { manifest, dir: styleDir } = readManifest(root);\n return buildStyleEntry(names, manifest, reset, narrowedTokens(manifest, styleDir));\n },\n };\n}\n"],"mappings":";;;;;;AASA,IAAa,IAAoB,qCAE3B,IAAc,6BAGd,IAAgB,oDAEhB,IAAc,mBAUd,IAAa,2BACb,oBAAY,IAAI,IAAI;CAAC;CAAgB;CAAQ;CAAS;AAAU,CAAC;AAyEvE,SAAgB,EAAiB,GAA+B;CAC5D,IAAM,oBAAQ,IAAI,IAAY;CAE9B,KAAK,IAAM,KAAS,EAAK,SACrB,4DACJ,GAAG;EACC,IAAM,GAAG,GAAU,GAAQ,KAAa;EAExC,IADI,CAAC,EAAc,KAAK,KAAa,EAAE,KACnC,GAAU;EACd,IAAI,gBAAgB,KAAK,KAAU,EAAE,GAAG,OAAO;EAE/C,IAAM,IAAS,cAAc,KAAK,KAAU,EAAE;EACzC,OACL,KAAK,IAAM,MAAS,EAAO,MAAM,GAAA,CAAI,MAAM,GAAG,GAAG;GAC7C,IAAM,IAAU,EAAK,KAAK;GAC1B,IAAI,CAAC,KAAW,EAAQ,WAAW,OAAO,GAAG;GAC7C,IAAM,IAAO,EAAQ,MAAM,UAAU,CAAC,CAAC,EAAE,EAAE,KAAK;GAChD,AAAI,KAAM,EAAM,IAAI,CAAI;EAC5B;CACJ;CACA,OAAO,CAAC,GAAG,CAAK;AACpB;AAuBA,SAAgB,EACZ,GACA,GACA,IAAmB,UACnB,IAA4B,MACtB;CACN,IAAM,IAAS,0EACT,IAAc,MAAe,OAAO,CAAC,YAAY,IAAI,CAAC,GACtD,IACF,MAAU,WACJ,MAAe,OACX,CAAC,EAAS,IAAI,IACd,CAAC,GAAG,GAAa,UAAU,IAC/B,MAAU,WACR,CAAC,GAAG,GAAa,YAAY,IAC7B,GAEN,IAAU,MAAe,OAAO,KAAK,GA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AG;GAC3B,IAAM,IAAU,EAAiB,CAAI;GACrC,IAAI,MAAY,MAAM,IAAa;QAC9B,KAAK,IAAM,KAAQ,GAAS,EAAM,IAAI,CAAI;EACnD;EAEA,AADA,IAAgB,EAAM,KAAK,IAAI,GAC/B,IAAQ,IAAa,OAAO,CAAC,GAAG,CAAK;CACzC,GAgBM,KAAkB,GAAyB,MAAoC;EACjF,IAAI,MAAW,SAAS,MAAU,MAAM,OAAO;EAC/C,IAAI;EACJ,IAAI;GACA,IAAY,EAAa,EAAK,GAAU,YAAY,GAAG,MAAM;EACjE,QAAQ;GACJ,OAAO;EACX;EACA,IAAM,IAAkB,CAAC,CAAa;EACtC,KAAK,IAAM,KAAS,EAAe,GAAO,GAAU,CAAK,GACrD,IAAI;GACA,EAAM,KAAK,EAAa,EAAK,GAAU,CAAK,GAAG,MAAM,CAAC;EAC1D,QAAQ;GACJ,OAAO;EACX;EAEJ,OAAO,EAAa,GAAW,EAAM,KAAK,IAAI,CAAC;CACnD;CAEA,OAAO;EACH,MAAM;EACN,SAAS;EAET,eAAe,GAA2B;GACtC,IAAO,EAAO,QAAQ;EAC1B;EAEA,MAAM,aAAa;GACf,MAAM,EAAO;EACjB;EAEA,UAAU,GAAY;GAClB,OAAO,MAAA,sCAA2B,IAAc;EACpD;EAEA,KAAK,GAAY;GACb,IAAI,MAAO,GAAa,OAAO;GAC/B,IAAM,EAAE,aAAU,KAAK,MAAa,EAAa,CAAI;GACrD,OAAO,EAAgB,GAAO,GAAU,GAAO,EAAe,GAAU,CAAQ,CAAC;EACrF;CACJ;AACJ"}
|
package/dist/vite.d.ts
CHANGED
|
@@ -330,6 +330,14 @@ export declare interface TempestStylesOptions {
|
|
|
330
330
|
include?: readonly string[];
|
|
331
331
|
/** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */
|
|
332
332
|
skipDirs?: readonly string[];
|
|
333
|
+
/**
|
|
334
|
+
* How much of the token sheet to emit. Default: `"used"`.
|
|
335
|
+
*
|
|
336
|
+
* The default falls back to the whole sheet on its own whenever a token name is
|
|
337
|
+
* assembled at runtime (`` `var(--tempest-${tone})` ``), so `"all"` is for the
|
|
338
|
+
* case the scan cannot see at all — a token read from outside `dir`.
|
|
339
|
+
*/
|
|
340
|
+
tokens?: TokenMode;
|
|
333
341
|
}
|
|
334
342
|
|
|
335
343
|
/**
|
|
@@ -348,4 +356,15 @@ export declare type TempestVitePlugin = {
|
|
|
348
356
|
name: string;
|
|
349
357
|
} & Record<string, unknown>;
|
|
350
358
|
|
|
359
|
+
/**
|
|
360
|
+
* How much of the token sheet an app takes.
|
|
361
|
+
*
|
|
362
|
+
* `"used"` emits only the tokens the selected stylesheets — and the app's own CSS —
|
|
363
|
+
* can reach, following token-to-token references. `"all"` emits `tokens.css` whole,
|
|
364
|
+
* which is what to reach for when the app names tokens somewhere the scan cannot
|
|
365
|
+
* see: a token read from a CSS-in-JS library, a sibling package's stylesheet, a
|
|
366
|
+
* `<style>` block in `index.html`.
|
|
367
|
+
*/
|
|
368
|
+
export declare type TokenMode = "used" | "all";
|
|
369
|
+
|
|
351
370
|
export { }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESM loader hooks that resolve a stylesheet import to an empty module.
|
|
3
|
+
*
|
|
4
|
+
* Runs on the loader thread, which is why it is a separate file from the
|
|
5
|
+
* `register()` call in `css-loader.mjs`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const STYLESHEET = /\.(css|scss|sass|less)$/;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a stylesheet specifier without asking Node to identify its format.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} specifier - The import specifier.
|
|
14
|
+
* @param {{ parentURL?: string }} context - Resolution context.
|
|
15
|
+
* @param {Function} next - The next hook in the chain.
|
|
16
|
+
* @returns {object} The resolution result.
|
|
17
|
+
*/
|
|
18
|
+
export function resolve(specifier, context, next) {
|
|
19
|
+
if (!STYLESHEET.test(specifier)) return next(specifier, context);
|
|
20
|
+
const url = context.parentURL
|
|
21
|
+
? new URL(specifier, context.parentURL).href
|
|
22
|
+
: new URL(specifier, "file:///").href;
|
|
23
|
+
return { url, format: "module", shortCircuit: true };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Load a stylesheet as an empty ES module.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} url - The resolved URL.
|
|
30
|
+
* @param {object} context - Load context.
|
|
31
|
+
* @param {Function} next - The next hook in the chain.
|
|
32
|
+
* @returns {object} The load result.
|
|
33
|
+
*/
|
|
34
|
+
export function load(url, context, next) {
|
|
35
|
+
if (!STYLESHEET.test(new URL(url).pathname)) return next(url, context);
|
|
36
|
+
return { format: "module", source: "", shortCircuit: true };
|
|
37
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Let Node import this SDK without a bundler.
|
|
3
|
+
*
|
|
4
|
+
* Every component module imports its own stylesheet, which is what lets a bundler
|
|
5
|
+
* ship the CSS of the components an app mounts and drop the rest. Node has no
|
|
6
|
+
* loader for `.css`, so importing the package in plain Node — a script, a Jest
|
|
7
|
+
* suite with no stylesheet transform, anything reading the surface for
|
|
8
|
+
* introspection — fails at import time with:
|
|
9
|
+
*
|
|
10
|
+
* TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".css"
|
|
11
|
+
*
|
|
12
|
+
* This registers the missing loader, for ESM and CommonJS both, and resolves every
|
|
13
|
+
* stylesheet to an empty module. Nothing about the styles is emulated: it makes the
|
|
14
|
+
* import a no-op, which is the correct answer in a context that paints nothing.
|
|
15
|
+
*
|
|
16
|
+
* Use it before importing the SDK:
|
|
17
|
+
*
|
|
18
|
+
* node --import tempest-react-sdk/node-css-loader your-script.mjs
|
|
19
|
+
*
|
|
20
|
+
* Or from inside a script, before the first import of the package:
|
|
21
|
+
*
|
|
22
|
+
* import "tempest-react-sdk/node-css-loader";
|
|
23
|
+
* const sdk = await import("tempest-react-sdk");
|
|
24
|
+
*
|
|
25
|
+
* A bundler needs none of this — it is the tool that has the CSS loader. Vitest
|
|
26
|
+
* handles stylesheets on its own too. This is for plain Node.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { createRequire, register } from "node:module";
|
|
30
|
+
|
|
31
|
+
register("./css-loader-hooks.mjs", import.meta.url);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Teach `require` the same thing, for a CommonJS consumer.
|
|
35
|
+
*
|
|
36
|
+
* `register()` covers the ESM graph only; `require("…/Button.css")` would still
|
|
37
|
+
* reach the CommonJS extension table, which tries to parse the file as JavaScript.
|
|
38
|
+
*/
|
|
39
|
+
const require = createRequire(import.meta.url);
|
|
40
|
+
/** @type {{ _extensions: Record<string, (module: { exports: unknown }, filename: string) => void> }} */
|
|
41
|
+
const Module = require("node:module");
|
|
42
|
+
for (const extension of [".css", ".scss", ".sass", ".less"]) {
|
|
43
|
+
Module._extensions[extension] = (module) => {
|
|
44
|
+
module.exports = {};
|
|
45
|
+
};
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tempest-react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "SDK público da Tempest com componentes, hooks e integrações para projetos React.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
26
|
"bin",
|
|
27
|
+
"loader",
|
|
27
28
|
"template",
|
|
28
29
|
"template-pwa",
|
|
29
30
|
"README.md",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"import": "./dist/tempest-react-sdk.js",
|
|
46
47
|
"require": "./dist/tempest-react-sdk.cjs"
|
|
47
48
|
},
|
|
49
|
+
"./node-css-loader": "./loader/css-loader.mjs",
|
|
48
50
|
"./testing": {
|
|
49
51
|
"types": "./dist/testing.d.ts",
|
|
50
52
|
"import": "./dist/testing.js",
|
|
@@ -108,7 +110,7 @@
|
|
|
108
110
|
},
|
|
109
111
|
"scripts": {
|
|
110
112
|
"dev": "vite build --watch",
|
|
111
|
-
"build": "node scripts/gen-scoped-reset.mjs && tsc -b tsconfig.build.json && node --max-old-space-size=6144 ./node_modules/vite/bin/vite.js build && node scripts/split-css.mjs && node scripts/gen-style-manifest.mjs && node scripts/copy-css-assets.mjs",
|
|
113
|
+
"build": "node scripts/gen-scoped-reset.mjs && tsc -b tsconfig.build.json && node --max-old-space-size=6144 ./node_modules/vite/bin/vite.js build && node scripts/split-css.mjs && node scripts/gen-style-manifest.mjs && node scripts/copy-css-assets.mjs && node scripts/link-component-css.mjs",
|
|
112
114
|
"postbuild": "node scripts/check-dist-guards.mjs",
|
|
113
115
|
"typecheck": "tsc -b tsconfig.json --noEmit",
|
|
114
116
|
"lint": "eslint .",
|