neba 1.5.0 → 1.7.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 +36 -5
- package/dist/components/accordion/Accordion.d.ts +1 -1
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/alert/Alert.d.ts +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/alert/index.js +1 -1
- package/dist/components/animate-appear/AnimateAppear.d.ts +1 -1
- package/dist/components/animate-appear/AnimateAppear.js +1 -1
- package/dist/components/animate-appear/index.d.ts +2 -2
- package/dist/components/animate-appear/index.js +1 -1
- package/dist/components/animate-blink/AnimateBlink.d.ts +1 -1
- package/dist/components/animate-blink/AnimateBlink.js +1 -1
- package/dist/components/animate-blink/index.d.ts +2 -2
- package/dist/components/animate-blink/index.js +1 -1
- package/dist/components/animate-fade/AnimateFade.d.ts +1 -1
- package/dist/components/animate-fade/AnimateFade.js +1 -1
- package/dist/components/animate-fade/index.d.ts +2 -2
- package/dist/components/animate-fade/index.js +1 -1
- package/dist/components/animate-grow/AnimateGrow.d.ts +1 -1
- package/dist/components/animate-grow/AnimateGrow.js +1 -1
- package/dist/components/animate-grow/index.d.ts +2 -2
- package/dist/components/animate-grow/index.js +1 -1
- package/dist/components/animate-headline/AnimateHeadline.d.ts +1 -1
- package/dist/components/animate-headline/AnimateHeadline.js +1 -1
- package/dist/components/animate-headline/index.d.ts +2 -2
- package/dist/components/animate-headline/index.js +1 -1
- package/dist/components/animate-lighting/AnimateLighting.d.ts +1 -1
- package/dist/components/animate-lighting/AnimateLighting.js +1 -1
- package/dist/components/animate-lighting/index.d.ts +2 -2
- package/dist/components/animate-lighting/index.js +1 -1
- package/dist/components/animate-marquee/AnimateMarquee.d.ts +1 -1
- package/dist/components/animate-marquee/AnimateMarquee.js +1 -1
- package/dist/components/animate-marquee/index.d.ts +2 -2
- package/dist/components/animate-marquee/index.js +1 -1
- package/dist/components/animate-rotate/AnimateRotate.d.ts +1 -1
- package/dist/components/animate-rotate/AnimateRotate.js +1 -1
- package/dist/components/animate-rotate/index.d.ts +2 -2
- package/dist/components/animate-rotate/index.js +1 -1
- package/dist/components/animate-slide/AnimateSlide.d.ts +1 -1
- package/dist/components/animate-slide/AnimateSlide.js +1 -1
- package/dist/components/animate-slide/index.d.ts +2 -2
- package/dist/components/animate-slide/index.js +1 -1
- package/dist/components/animate-typing/AnimateTyping.d.ts +1 -1
- package/dist/components/animate-typing/AnimateTyping.js +1 -1
- package/dist/components/animate-typing/index.d.ts +2 -2
- package/dist/components/animate-typing/index.js +1 -1
- package/dist/components/animate-zoom/AnimateZoom.d.ts +1 -1
- package/dist/components/animate-zoom/AnimateZoom.js +1 -1
- package/dist/components/animate-zoom/index.d.ts +2 -2
- package/dist/components/animate-zoom/index.js +1 -1
- package/dist/components/area-chart/AreaChart.d.ts +3 -3
- package/dist/components/area-chart/AreaChart.js +1 -1
- package/dist/components/area-chart/index.d.ts +2 -2
- package/dist/components/area-chart/index.js +1 -1
- package/dist/components/aspect-ratio/AspectRatio.d.ts +1 -1
- package/dist/components/aspect-ratio/AspectRatio.js +1 -1
- package/dist/components/aspect-ratio/index.d.ts +2 -2
- package/dist/components/aspect-ratio/index.js +1 -1
- package/dist/components/avatar/Avatar.d.ts +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/bar-chart/BarChart.d.ts +2 -2
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/bar-chart/index.d.ts +2 -2
- package/dist/components/bar-chart/index.js +1 -1
- package/dist/components/blockquote/Blockquote.d.ts +1 -1
- package/dist/components/blockquote/Blockquote.js +1 -1
- package/dist/components/blockquote/index.d.ts +2 -2
- package/dist/components/blockquote/index.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.d.ts +3 -15
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/bottom-navigation/index.d.ts +1 -1
- package/dist/components/bottom-navigation/index.js +1 -1
- package/dist/components/box/Box.d.ts +1 -1
- package/dist/components/box/Box.js +1 -1
- package/dist/components/box/index.d.ts +2 -2
- package/dist/components/box/index.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/breadcrumb/index.d.ts +2 -2
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/ButtonGroup.d.ts +1 -1
- package/dist/components/button-group/ButtonGroup.js +1 -1
- package/dist/components/button-group/index.d.ts +2 -2
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/card/Card.js +1 -1
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/card/index.js +1 -1
- package/dist/components/carousel/Carousel.d.ts +1 -1
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/carousel/index.d.ts +2 -2
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.d.ts +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/chat-bubble/index.d.ts +2 -2
- package/dist/components/chat-bubble/index.js +1 -1
- package/dist/components/checkbox/Checkbox.d.ts +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/chip/Chip.d.ts +1 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/collapsible/Collapsible.d.ts +1 -1
- package/dist/components/collapsible/Collapsible.js +1 -1
- package/dist/components/collapsible/index.d.ts +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +2 -2
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +1 -1
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/combobox/index.d.ts +2 -2
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/container/Container.d.ts +1 -1
- package/dist/components/container/Container.js +1 -1
- package/dist/components/container/index.d.ts +2 -2
- package/dist/components/container/index.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +1 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/data-table/index.d.ts +2 -2
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +3 -3
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.d.ts +3 -3
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/date-range-picker/index.d.ts +2 -2
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/DateTimePicker.d.ts +4 -4
- package/dist/components/date-time-picker/DateTimePicker.js +1 -1
- package/dist/components/date-time-picker/index.d.ts +2 -2
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/dialog/index.d.ts +2 -2
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/divider/Divider.d.ts +1 -1
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/divider/index.d.ts +2 -2
- package/dist/components/divider/index.js +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/empty/Empty.d.ts +1 -1
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/empty/index.d.ts +2 -2
- package/dist/components/empty/index.js +1 -1
- package/dist/components/file-picker/FilePicker.d.ts +1 -1
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/file-picker/index.d.ts +2 -2
- package/dist/components/file-picker/index.js +1 -1
- package/dist/components/floating-action-button/FloatingActionButton.d.ts +1 -1
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/floating-action-button/index.d.ts +1 -1
- package/dist/components/floating-action-button/index.js +1 -1
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.d.ts +91 -0
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -0
- package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
- package/dist/components/floating-bottom-navigation/index.js +1 -0
- package/dist/components/grid/Grid.d.ts +1 -1
- package/dist/components/grid/Grid.js +1 -1
- package/dist/components/grid/index.d.ts +2 -2
- package/dist/components/grid/index.js +1 -1
- package/dist/components/grid-container/GridContainer.d.ts +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/grid-container/index.d.ts +2 -2
- package/dist/components/grid-container/index.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.d.ts +3 -3
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/heatmap-chart/index.d.ts +2 -2
- package/dist/components/heatmap-chart/index.js +1 -1
- package/dist/components/highlight/Highlight.d.ts +2 -2
- package/dist/components/highlight/Highlight.js +1 -1
- package/dist/components/highlight/index.d.ts +2 -2
- package/dist/components/highlight/index.js +1 -1
- package/dist/components/icon/Icon.d.ts +1 -1
- package/dist/components/icon/Icon.js +1 -1
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon-button/IconButton.d.ts +1 -1
- package/dist/components/icon-button/IconButton.js +1 -1
- package/dist/components/icon-button/index.d.ts +2 -2
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/line-chart/LineChart.d.ts +3 -3
- package/dist/components/line-chart/LineChart.js +1 -1
- package/dist/components/line-chart/index.d.ts +2 -2
- package/dist/components/line-chart/index.js +1 -1
- package/dist/components/list/List.d.ts +1 -1
- package/dist/components/list/List.js +1 -1
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/index.js +1 -1
- package/dist/components/menu/Menu.d.ts +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/mockup/Mockup.d.ts +3 -3
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/mockup/index.d.ts +2 -2
- package/dist/components/mockup/index.js +1 -1
- package/dist/components/number-field/NumberField.d.ts +1 -1
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/number-field/index.d.ts +2 -2
- package/dist/components/number-field/index.js +1 -1
- package/dist/components/otp-field/OtpField.d.ts +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/otp-field/index.d.ts +2 -2
- package/dist/components/otp-field/index.js +1 -1
- package/dist/components/overlay/Overlay.d.ts +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/overlay/index.d.ts +2 -2
- package/dist/components/overlay/index.js +1 -1
- package/dist/components/pagination/Pagination.d.ts +1 -1
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/panes/Panes.d.ts +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/panes/index.d.ts +2 -2
- package/dist/components/panes/index.js +1 -1
- package/dist/components/pie-chart/PieChart.d.ts +2 -2
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/pie-chart/index.d.ts +2 -2
- package/dist/components/pie-chart/index.js +1 -1
- package/dist/components/pill/Pill.d.ts +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/pill/index.d.ts +2 -2
- package/dist/components/pill/index.js +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/progress-box/ProgressBox.d.ts +2 -2
- package/dist/components/progress-box/ProgressBox.js +1 -1
- package/dist/components/progress-box/index.d.ts +2 -2
- package/dist/components/progress-box/index.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.d.ts +2 -2
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-circular/index.d.ts +2 -2
- package/dist/components/progress-circular/index.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.d.ts +2 -2
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/progress-linear/index.d.ts +2 -2
- package/dist/components/progress-linear/index.js +1 -1
- package/dist/components/radio-group/RadioGroup.d.ts +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/radio-group/index.d.ts +2 -2
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/rating/Rating.d.ts +1 -1
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/rating/index.d.ts +1 -1
- package/dist/components/rating/index.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.d.ts +2 -2
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scatter-chart/index.d.ts +2 -2
- package/dist/components/scatter-chart/index.js +1 -1
- package/dist/components/scroll-zone/ScrollZone.d.ts +126 -0
- package/dist/components/scroll-zone/ScrollZone.js +1 -0
- package/dist/components/scroll-zone/index.d.ts +2 -0
- package/dist/components/scroll-zone/index.js +1 -0
- package/dist/components/segmented-button/SegmentedButton.d.ts +1 -1
- package/dist/components/segmented-button/SegmentedButton.js +1 -1
- package/dist/components/segmented-button/index.d.ts +2 -2
- package/dist/components/segmented-button/index.js +1 -1
- package/dist/components/select/Select.d.ts +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/index.js +1 -1
- package/dist/components/shortcut/Shortcut.d.ts +1 -1
- package/dist/components/shortcut/Shortcut.js +1 -1
- package/dist/components/shortcut/index.d.ts +2 -2
- package/dist/components/shortcut/index.js +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/slider/Slider.d.ts +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/sparkline/Sparkline.d.ts +1 -1
- package/dist/components/sparkline/Sparkline.js +1 -1
- package/dist/components/sparkline/index.d.ts +2 -2
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/spoiler/Spoiler.d.ts +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/spoiler/index.d.ts +2 -2
- package/dist/components/spoiler/index.js +1 -1
- package/dist/components/statistic/Statistic.d.ts +2 -2
- package/dist/components/statistic/Statistic.js +1 -1
- package/dist/components/statistic/index.d.ts +2 -2
- package/dist/components/statistic/index.js +1 -1
- package/dist/components/switch/Switch.d.ts +1 -1
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/table/Table.d.ts +2 -2
- package/dist/components/table/Table.js +1 -1
- package/dist/components/table/index.d.ts +2 -2
- package/dist/components/table/index.js +1 -1
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/text-field/TextField.d.ts +1 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-link/TextLink.d.ts +1 -1
- package/dist/components/text-link/TextLink.js +1 -1
- package/dist/components/text-link/index.d.ts +2 -2
- package/dist/components/text-link/index.js +1 -1
- package/dist/components/time-picker/TimePicker.d.ts +2 -2
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/time-picker/index.d.ts +2 -2
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/timeline/Timeline.d.ts +1 -1
- package/dist/components/timeline/Timeline.js +1 -1
- package/dist/components/timeline/index.d.ts +2 -2
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.d.ts +2 -2
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/timeline-chart/index.d.ts +2 -2
- package/dist/components/timeline-chart/index.js +1 -1
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toolbar/Toolbar.d.ts +1 -1
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/toolbar/index.d.ts +2 -2
- package/dist/components/toolbar/index.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tree-view/TreeView.d.ts +1 -1
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/tree-view/index.d.ts +2 -2
- package/dist/components/tree-view/index.js +1 -1
- package/dist/components/typography/Typography.d.ts +1 -1
- package/dist/components/typography/Typography.js +1 -1
- package/dist/components/typography/index.d.ts +2 -2
- package/dist/components/typography/index.js +1 -1
- package/dist/components/window-pane/WindowPane.d.ts +178 -0
- package/dist/components/window-pane/WindowPane.js +1 -0
- package/dist/components/window-pane/index.d.ts +2 -0
- package/dist/components/window-pane/index.js +1 -0
- package/dist/index.d.ts +92 -89
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +1 -1
- package/dist/internal/bottom-navigation.d.ts +57 -0
- package/dist/internal/bottom-navigation.js +1 -0
- package/dist/internal/button-group.d.ts +1 -1
- package/dist/internal/button-group.js +1 -1
- package/dist/internal/calendar.d.ts +2 -2
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +3 -3
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.d.ts +2 -2
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +1 -1
- package/dist/internal/chart.js +1 -1
- package/dist/internal/data-table.d.ts +1 -1
- package/dist/internal/date.d.ts +1 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/grid.d.ts +1 -1
- package/dist/internal/i18n.d.ts +346 -205
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/icons.d.ts +18 -2
- package/dist/internal/icons.js +1 -1
- package/dist/internal/menu.d.ts +1 -1
- package/dist/internal/menu.js +1 -1
- package/dist/internal/mockup.d.ts +1 -1
- package/dist/internal/picker.d.ts +2 -2
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +1 -1
- package/dist/internal/styles.d.ts +1 -1
- package/dist/internal/window.d.ts +201 -0
- package/dist/internal/window.js +1 -0
- package/dist/locales/ar.d.ts +14 -0
- package/dist/locales/ar.js +1 -0
- package/dist/locales/de.d.ts +14 -0
- package/dist/locales/de.js +1 -0
- package/dist/locales/es.d.ts +14 -0
- package/dist/locales/es.js +1 -0
- package/dist/locales/fr.d.ts +14 -0
- package/dist/locales/fr.js +1 -0
- package/dist/locales/hi.d.ts +14 -0
- package/dist/locales/hi.js +1 -0
- package/dist/locales/id.d.ts +14 -0
- package/dist/locales/id.js +1 -0
- package/dist/locales/index.d.ts +45 -0
- package/dist/locales/index.js +1 -0
- package/dist/locales/it.d.ts +14 -0
- package/dist/locales/it.js +1 -0
- package/dist/locales/ja.d.ts +14 -0
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ko.d.ts +14 -0
- package/dist/locales/ko.js +1 -0
- package/dist/locales/nl.d.ts +14 -0
- package/dist/locales/nl.js +1 -0
- package/dist/locales/pl.d.ts +14 -0
- package/dist/locales/pl.js +1 -0
- package/dist/locales/pt.d.ts +14 -0
- package/dist/locales/pt.js +1 -0
- package/dist/locales/ru.d.ts +14 -0
- package/dist/locales/ru.js +1 -0
- package/dist/locales/th.d.ts +14 -0
- package/dist/locales/th.js +1 -0
- package/dist/locales/tr.d.ts +14 -0
- package/dist/locales/tr.js +1 -0
- package/dist/locales/vi.d.ts +14 -0
- package/dist/locales/vi.js +1 -0
- package/dist/locales/zh-hans.d.ts +17 -0
- package/dist/locales/zh-hans.js +1 -0
- package/dist/locales/zh-hant.d.ts +17 -0
- package/dist/locales/zh-hant.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +6 -0
- package/package.json +41 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Radio as BaseUIRadio } from '@base-ui/react/radio';
|
|
3
3
|
import { RadioGroup as BaseUIRadioGroup } from '@base-ui/react/radio-group';
|
|
4
|
-
import type { NebaColor, NebaOrientation, NebaSize } from '../../types';
|
|
4
|
+
import type { NebaColor, NebaOrientation, NebaSize } from '../../types.js';
|
|
5
5
|
export interface RadioGroupProps extends Omit<React.ComponentPropsWithoutRef<typeof BaseUIRadioGroup>, 'className' | 'style' | 'render'> {
|
|
6
6
|
/** @default 'md' */
|
|
7
7
|
size?: NebaSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as o}from"@base-ui/react/field";import{controlTextClasses as i,metaTextClasses as t,surfaceClasses as s,tickDotClasses as d,tickRowLeadingClasses as c,tickSizeClasses as b,transitionClasses as f}from"../../internal/styles";const h
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as o}from"@base-ui/react/field";import{controlTextClasses as i,metaTextClasses as t,surfaceClasses as s,tickDotClasses as d,tickRowLeadingClasses as c,tickSizeClasses as b,transitionClasses as f}from"../../internal/styles.js";const h=/*@__PURE__*/r.createContext({size:"md",color:"primary",readOnly:!1}),m=["relative inline-flex shrink-0 items-center justify-center rounded-full border","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",f,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),u=[s,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),p=[s,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),v=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" ");export const Radio=/*@__PURE__*/r.forwardRef(function({label:l,description:s,disabled:f=!1,className:x,style:g,...j},y){const N=r.useContext(h),$=j.readOnly??N.readOnly;return e(o.Root,{disabled:f,className:["flex flex-col",x??""].filter(Boolean).join(" "),style:g,children:a("div",{className:`flex items-start gap-2 ${i[N.size]} ${c}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(n.Root,{ref:y,className:[m,b[N.size],f?v:$?p:u].join(" "),disabled:f,...j,children:e(n.Indicator,{className:`rounded-full bg-current ${d[N.size]}`})})}),l||s?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(o.Label,{className:["leading-[1.4]",f?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)"].join(" "),children:l}):null,s?e(o.Description,{className:`${t[N.size]} text-(--neba-muted-fg)`,children:s}):null]}):null]})})});export const RadioGroup=/*@__PURE__*/r.forwardRef(function({size:n="md",color:i="primary",orientation:s="vertical",label:d,description:c,error:b,invalid:f,disabled:m=!1,readOnly:u=!1,className:p,style:v,children:x,...g},j){const y=null!=b&&!1!==b&&""!==b,N=f??y,$=N?"danger":i,k={"--n-fill":`var(--neba-${$}-fill)`,"--n-fill-hover":`var(--neba-${$}-fill-hover)`,"--n-on-solid":`var(--neba-${$}-on-solid)`,"--n-accent":`var(--neba-${$}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${$}-line)`,"--n-line-hover":`var(--neba-${$}-line-hover)`,"--n-ring":`var(--neba-${$}-ring)`},R=r.useMemo(()=>({size:n,color:$,readOnly:u}),[n,$,u]);return e(h.Provider,{value:R,children:a(o.Root,{disabled:m,invalid:N,className:["flex flex-col gap-1.5",p??""].filter(Boolean).join(" "),style:{...k,...v},children:[d?e(o.Label,{className:[t[n],"font-medium",m?"text-(--neba-disabled-fg)":"text-(--neba-fg)"].join(" "),children:d}):null,c?e(o.Description,{className:`${t[n]} text-(--neba-muted-fg)`,children:c}):null,e(l,{ref:j,disabled:m,readOnly:u,className:["flex","horizontal"===s?"flex-row flex-wrap gap-x-5 gap-y-2":"flex-col gap-2"].join(" "),...g,children:x}),y?e(o.Error,{match:!0,className:`${t[n]} text-(--n-accent)`,children:b}):null]})})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Radio, RadioGroup } from './RadioGroup';
|
|
2
|
-
export type { RadioGroupProps, RadioProps } from './RadioGroup';
|
|
1
|
+
export { Radio, RadioGroup } from './RadioGroup.js';
|
|
2
|
+
export type { RadioGroupProps, RadioProps } from './RadioGroup.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Radio,RadioGroup}from"./RadioGroup";
|
|
1
|
+
export{Radio,RadioGroup}from"./RadioGroup.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { NebaColor, NebaSize } from '../../types';
|
|
2
|
+
import type { NebaColor, NebaSize } from '../../types.js';
|
|
3
3
|
export interface RatingProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
4
4
|
/** How much is rated. Use with `onValueChange` for a controlled Rating. */
|
|
5
5
|
value?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{StarIcon as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{StarIcon as l,StarOutlineIcon as t}from"../../internal/icons.js";import{fillMessage as r,ratingMessages as i,useMessages as o}from"../../internal/i18n.js";import{controlSlots as s,focusWithinRingClasses as d,gapClasses as m,iconSizeClasses as c,radiusClasses as u,srOnlyClasses as h,transitionClasses as f}from"../../internal/styles.js";const b="flex items-center justify-center";export const Rating=/*@__PURE__*/n.forwardRef(function({value:p,defaultValue:x=0,onValueChange:y,count:v=5,precision:g=1,icon:j,emptyIcon:N,clearable:M=!0,readOnly:w=!1,disabled:k=!1,name:S,required:C=!1,size:L="md",color:P="warning",locale:q,label:I,valueLabel:A,className:B,style:R,onPointerLeave:V,...z},E){const F=o(i,q),O=n.useId(),D=S??O,[G,H]=n.useState(x),J=void 0!==p,K=J?p:G,[Q,T]=n.useState(null),U=Math.max(1,Math.floor(v)),W=g>0&&g<=1?g:1,X=Math.round(1/W),Y=Math.max(0,Math.min(U,Q??K)),Z=n.useCallback(e=>A?A(e,U):e<=0?F.empty:r(F.value,{value:String(e),max:String(U)}),[A,U,F]),$=e=>{J||H(e),y?.(e)},_=Array.from({length:U},(n,r)=>{const i=Math.max(0,Math.min(1,Y-r));return a("span",{className:["relative inline-flex shrink-0",c[L],u.xs,w||k?"":d].filter(Boolean).join(" "),children:[e("span",{className:[b,c[L],k?"text-(--neba-disabled-fg)":"text-(--n-empty)"].join(" "),children:N??e(t,{})}),e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 start-0 overflow-hidden",style:{width:100*i+"%"},children:e("span",{className:[b,c[L],k?"text-(--neba-disabled-fg)":"text-(--n-fill)",f].join(" "),children:j??e(l,{})})}),w?null:Array.from({length:X},(a,n)=>{const l=Number((r+(n+1)*W).toFixed(4));return e("label",{className:["absolute inset-y-0",k?"cursor-not-allowed":"cursor-pointer"].join(" "),style:{insetInlineStart:100*n/X+"%",width:100/X+"%"},onPointerEnter:()=>{k||T(l)},children:e("input",{type:"radio",className:h,name:D,value:l,checked:K===l,disabled:k,required:C,"aria-label":Z(l),onChange:()=>$(l),onClick:()=>{M&&K===l&&$(0)}})},l)})]},r)}),ee=["inline-flex items-center align-middle",m[L],k?"cursor-not-allowed":"",B??""].filter(Boolean).join(" "),ae={...s(P,0,"solid"),"--n-empty":"color-mix(in oklab, var(--neba-muted-fg) 40%, transparent)",...R};return e("div",w?{ref:E,role:"img","aria-label":Z(Math.max(0,Math.min(U,K))),className:ee,style:ae,onPointerLeave:V,...z,children:_}:{ref:E,role:"radiogroup","aria-label":I??F.label,"aria-disabled":k||void 0,"aria-required":C||void 0,className:ee,style:ae,onPointerLeave:e=>{T(null),V?.(e)},...z,children:_})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Rating';
|
|
1
|
+
export * from './Rating.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./Rating";
|
|
1
|
+
export*from"./Rating.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type CartesianChartProps } from '../../internal/chart-frame';
|
|
3
|
-
import { type MarkShape } from '../../internal/chart';
|
|
2
|
+
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
|
+
import { type MarkShape } from '../../internal/chart.js';
|
|
4
4
|
export interface ScatterChartProps extends CartesianChartProps {
|
|
5
5
|
/**
|
|
6
6
|
* What each mark is drawn as.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as l}from"../../internal/chart-frame";import{bubbleRadius as t,formatCategory as i,markerRadii as s,markGap as o,markPath as n,markShapes as c,plotHeights as u,pointX as d}from"../../internal/chart";import{cx as h,srOnlyClasses as m}from"../../internal/styles";export function ScatterChart({shape:r="auto",pointRadius:i,maxRadius:o,series:h,categories:m,size:p="md",xAxis:b,...v}){const y=i??s[p],g=o??Math.max(y+2,("number"==typeof v.height?v.height:u[p])/12),z=h.reduce((e,r)=>r.color?e:e+1,0),
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as l}from"../../internal/chart-frame.js";import{bubbleRadius as t,formatCategory as i,markerRadii as s,markGap as o,markPath as n,markShapes as c,plotHeights as u,pointX as d}from"../../internal/chart.js";import{cx as h,srOnlyClasses as m}from"../../internal/styles.js";export function ScatterChart({shape:r="auto",pointRadius:i,maxRadius:o,series:h,categories:m,size:p="md",xAxis:b,...v}){const y=i??s[p],g=o??Math.max(y+2,("number"==typeof v.height?v.height:u[p])/12),z=h.reduce((e,r)=>r.color?e:e+1,0),j="auto"===r||"varied"===r?"circle":r,k="varied"===r||"auto"===r&&z>3,M=a.useCallback(e=>k?c[e%c.length]:j,[k,j]),w=a.useCallback(e=>{const r=[];let a=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(a=Math.max(a,e.z))})}),e.values.forEach((l,i)=>{e.visible[i]&&l.forEach((l,s)=>{if(null===l.value)return;const o=d(l,s,m);null!==o&&r.push({series:i,index:s,x:e.categoryValuePx(o),y:e.valuePx(l.value),r:void 0===l.z?y:t(l.z,a,g,2)})})}),r},[m,y,g]);return e(l,{...v,series:h,categories:m,size:p,xScale:"value",xAxis:b,marks:w,markInset:g,includeZero:!1,swatch:(r,a)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:n(M(r),5,5,4),fill:a})}),table:r=>e(f,{id:r,series:h,categories:m,label:v.label,xLabel:b?.label,yLabel:v.yAxis?.label,locale:v.locale,format:v.format}),children:r=>e(x,{context:r,shapeOf:M})})}function x({context:r,shapeOf:l}){const{marks:t,values:i,colors:s,hovered:c,activeMark:u}=r,d=a.useMemo(()=>[...t].sort((e,r)=>r.r-e.r),[t]);return e("g",{children:d.map(r=>{const a=i[r.series]?.[r.index],t=null!==c&&c!==r.series,d=u?.series===r.series&&u?.index===r.index;return e("path",{d:n(l(r.series),r.x,r.y,d?r.r+1:r.r),fill:a?.color??s[r.series],stroke:"var(--neba-chart-gap)",strokeWidth:o,opacity:t?.28:1},`${r.series}-${r.index}`)})})}function f({id:l,series:t,categories:s,label:o,xLabel:n,yLabel:c,locale:u,format:d}){const x=a.useMemo(()=>new Intl.NumberFormat(u,d??{maximumFractionDigits:2}),[u,d]),f=t.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:l,className:h(m),children:[o?e("caption",{children:o}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:n??"x"}),e("th",{scope:"col",children:c??"y"}),f?e("th",{scope:"col",children:"z"}):null]})}),e("tbody",{children:t.flatMap((a,l)=>a.data.map((t,o)=>{const n="object"==typeof t&&null!==t?t:null,c=n?n.y:"number"==typeof t?t:null,d=n?.x??s?.[o]??o;return r("tr",{children:[e("th",{scope:"row",children:a.name??l+1}),e("td",{children:i(d,u)}),e("td",{children:null!==c&&Number.isFinite(c)?x.format(c):""}),f?e("td",{children:void 0===n?.z?"":x.format(n.z)}):null]},`${l}-${o}`)}))})]})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ScatterChart } from './ScatterChart';
|
|
2
|
-
export type { ScatterChartProps } from './ScatterChart';
|
|
1
|
+
export { ScatterChart } from './ScatterChart.js';
|
|
2
|
+
export type { ScatterChartProps } from './ScatterChart.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScatterChart}from"./ScatterChart";
|
|
1
|
+
export{ScatterChart}from"./ScatterChart.js";
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { NebaOrientation, NebaStyleProps } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* When the scroll buttons are drawn.
|
|
5
|
+
*
|
|
6
|
+
* - `auto` — only the one that has somewhere to go, and neither of them while
|
|
7
|
+
* everything fits. The default: a control that cannot do anything is worse
|
|
8
|
+
* than no control, and a row that does not overflow is not a scroller.
|
|
9
|
+
* - `always` — both, from the first paint, with the one that has nowhere to go
|
|
10
|
+
* `disabled` rather than gone. What a row whose content arrives later wants,
|
|
11
|
+
* since the buttons do not appear under the pointer half a second in.
|
|
12
|
+
* - `none` — none at all. Dragging, the wheel and the arrow keys are still
|
|
13
|
+
* there; this is the strip that scrolls the way a phone scrolls.
|
|
14
|
+
*/
|
|
15
|
+
export type ScrollZoneButtons = 'auto' | 'always' | 'none';
|
|
16
|
+
/**
|
|
17
|
+
* What pressing a scroll button does.
|
|
18
|
+
*
|
|
19
|
+
* - `item` — moves to the next child along, `step` of them at a time. The
|
|
20
|
+
* default, and the only one that lands on something rather than between two
|
|
21
|
+
* things.
|
|
22
|
+
* - `page` — moves by everything currently on screen, the way Page Down does.
|
|
23
|
+
* - `hold` — scrolls for as long as the button is held, at `speed` pixels a
|
|
24
|
+
* second. A press too short to be a hold falls back to one `item`, so the
|
|
25
|
+
* button is never dead to a quick tap.
|
|
26
|
+
*/
|
|
27
|
+
export type ScrollZoneMode = 'item' | 'page' | 'hold';
|
|
28
|
+
/**
|
|
29
|
+
* Where the scroll buttons sit, which is also where the strip ends.
|
|
30
|
+
*
|
|
31
|
+
* - `overlay` — over the ends of the strip, which keeps every pixel of the box
|
|
32
|
+
* for content and lets an item pass under a button. The default, and what a
|
|
33
|
+
* shelf of pictures wants.
|
|
34
|
+
* - `inline` — beside the strip, in the layout. The scroller stops where the
|
|
35
|
+
* button starts, so an item is *cut off* at the button's edge rather than
|
|
36
|
+
* sliding beneath it: nothing is ever half-hidden behind a control, and the
|
|
37
|
+
* button is legible over the page rather than over whatever it landed on.
|
|
38
|
+
*
|
|
39
|
+
* The lane an `inline` button sits in is kept even while that button has
|
|
40
|
+
* nowhere to go, or the strip would resize under the pointer every time it
|
|
41
|
+
* reached an end.
|
|
42
|
+
*/
|
|
43
|
+
export type ScrollZoneButtonPlacement = 'overlay' | 'inline';
|
|
44
|
+
export interface ScrollZoneProps extends NebaStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
45
|
+
/**
|
|
46
|
+
* Which way the children run, and therefore which way the zone scrolls.
|
|
47
|
+
* @default 'horizontal'
|
|
48
|
+
*/
|
|
49
|
+
orientation?: NebaOrientation;
|
|
50
|
+
/**
|
|
51
|
+
* How many rows a horizontal zone lays its children out in before it starts a
|
|
52
|
+
* new column — and how many columns a vertical one uses. `2` is the shelf
|
|
53
|
+
* that holds twice as much in the same width.
|
|
54
|
+
* @default 1
|
|
55
|
+
*/
|
|
56
|
+
lines?: number;
|
|
57
|
+
/**
|
|
58
|
+
* The gap between children, on Tailwind's spacing scale: `2` is `0.5rem`, the
|
|
59
|
+
* same step `gap-2` is. The same ladder GridContainer's own `spacing` is on.
|
|
60
|
+
* @default 2
|
|
61
|
+
*/
|
|
62
|
+
spacing?: number;
|
|
63
|
+
/** When the scroll buttons are drawn. @default 'auto' */
|
|
64
|
+
buttons?: ScrollZoneButtons;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the buttons sit over the strip or beside it. `inline` is what to
|
|
67
|
+
* reach for when an item disappearing under a button reads as a bug rather
|
|
68
|
+
* than as depth.
|
|
69
|
+
* @default 'overlay'
|
|
70
|
+
*/
|
|
71
|
+
buttonPlacement?: ScrollZoneButtonPlacement;
|
|
72
|
+
/** What pressing one does. @default 'item' */
|
|
73
|
+
mode?: ScrollZoneMode;
|
|
74
|
+
/** How many children one press moves, in `item` mode. @default 1 */
|
|
75
|
+
step?: number;
|
|
76
|
+
/** How fast a held button scrolls, in pixels a second. @default 900 */
|
|
77
|
+
speed?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Snaps the nearest child to the leading edge when the scrolling stops —
|
|
80
|
+
* dragging and the wheel included, not only the buttons.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
snap?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Lets a mouse or a pen drag the strip along, the way a finger already does.
|
|
86
|
+
* Touch is left to the browser, whose own scrolling is better than anything a
|
|
87
|
+
* handler can imitate: momentum, rubber-banding and the scrollbar all come
|
|
88
|
+
* with it.
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
drag?: boolean;
|
|
92
|
+
/** Shows the native scrollbar. @default false */
|
|
93
|
+
scrollbar?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Which language the buttons name themselves in — a BCP 47 tag such as `ko`,
|
|
96
|
+
* `pt-BR` or `zh-Hant`. Unsupported tags fall back to English.
|
|
97
|
+
*/
|
|
98
|
+
locale?: string;
|
|
99
|
+
/** What the scrollable region is called — "Categories", "Recent files". */
|
|
100
|
+
label?: string;
|
|
101
|
+
/** Overrides the buttons' own names. */
|
|
102
|
+
previousLabel?: string;
|
|
103
|
+
nextLabel?: string;
|
|
104
|
+
/** What is being laid out. Every top-level child is one item of the strip. */
|
|
105
|
+
children?: React.ReactNode;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A strip of anything, laid out in one direction and scrolled in it.
|
|
109
|
+
*
|
|
110
|
+
* The mechanism is an ordinary scroll container, and everything the component
|
|
111
|
+
* offers is a way of driving one. Swiping on a phone, two-finger dragging on a
|
|
112
|
+
* trackpad, the wheel, the arrow keys and the scrollbar are the browser's own
|
|
113
|
+
* and are never intercepted; what is added on top is a pair of buttons for the
|
|
114
|
+
* pointer that has neither a wheel nor a finger, and a mouse drag for the strip
|
|
115
|
+
* that reads as something to pull rather than something to page.
|
|
116
|
+
*
|
|
117
|
+
* Nothing is transformed. A translated track would have to argue for an
|
|
118
|
+
* exception to the house rule; a scroll offset does not, and it is also what
|
|
119
|
+
* makes the strip run the other way under RTL without being told, keeps the
|
|
120
|
+
* scrollbar honest, and lets the browser scroll a focused child into view.
|
|
121
|
+
*
|
|
122
|
+
* `lines` is what separates this from a Carousel: a Carousel is one thing at a
|
|
123
|
+
* time and knows which one, a ScrollZone is a shelf that happens to be longer
|
|
124
|
+
* than the room it is in.
|
|
125
|
+
*/
|
|
126
|
+
export declare const ScrollZone: React.ForwardRefExoticComponent<ScrollZoneProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{IconButton as r}from"../icon-button/IconButton.js";import{spacingValue as o}from"../../internal/grid.js";import{scrollMessages as i,useMessages as s}from"../../internal/i18n.js";import{ChevronIcon as a}from"../../internal/icons.js";import{cx as l}from"../../internal/styles.js";const c={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-3",xl:"p-4"},u={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-3",xl:"gap-4"};export const ScrollZone=/*@__PURE__*/n.forwardRef(function({orientation:d="horizontal",lines:m=1,spacing:p=2,buttons:f="auto",buttonPlacement:v="overlay",mode:b="item",step:w=1,speed:g=900,snap:h=!1,drag:y=!0,scrollbar:x=!1,variant:k="solid",size:L="md",color:E="primary",density:C="default",locale:R,label:j,previousLabel:P,nextLabel:M,className:N,style:T,children:A,...z},D){const S=s(i,R),B="horizontal"===d,F=Math.max(1,Math.round(m)),H=Math.max(1,Math.round(w)),I=n.useRef(null),W=n.useRef(null),[$,q]=n.useState({back:!1,forward:!1}),O=n.useCallback(()=>{const e=I.current;if(!e)return;const t=B?e.clientWidth:e.clientHeight,n=B?e.scrollWidth:e.scrollHeight,r=Math.abs(B?e.scrollLeft:e.scrollTop);q(e=>{const o=r>1,i=n-t-r>1;return e.back===o&&e.forward===i?e:{back:o,forward:i}})},[B]);n.useEffect(()=>{const e=I.current,t=W.current;if(!e)return;if(O(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(O);return n.observe(e),t&&n.observe(t),()=>n.disconnect()},[O]);const X=n.useCallback(()=>{const e=I.current;return e&&B&&"rtl"===getComputedStyle(e).direction?-1:1},[B]),Y=n.useCallback((e,t)=>{const n=I.current;if(!n)return;const r=t?"undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"auto":"smooth":"auto";n.scrollBy(B?{left:e,behavior:r}:{top:e,behavior:r})},[B]),_=n.useCallback(()=>{const e=I.current,t=W.current;if(!e||!t)return[];const n=B&&"rtl"===getComputedStyle(e).direction,r=B?n?"right":"left":"top",o=n?-1:1,i=e.getBoundingClientRect()[r],s=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-i)*o);s.includes(t)||s.push(t)}return s.sort((e,t)=>e-t)},[B]),K=n.useCallback((e,t=b)=>{const n=I.current;if(!n)return;const r=X(),o=B?n.clientWidth:n.clientHeight;if("page"===t)return void Y(o*(e?1:-1)*r,!0);const i=_(),s=i.filter(e=>e>1),a=i.filter(e=>e<-1),l=e?s[H-1]:a[a.length-H];Y(void 0!==l?l*r:o*(e?1:-1)*r,!0)},[X,B,_,H,b,Y]),V=n.useRef(null);n.useEffect(()=>()=>V.current?.(),[]);const Z=n.useCallback((e,t)=>{if(V.current)return;const n=X(),r=performance.now();let o=r,i=0;const s=t=>{const r=t-o;o=t,Y(g*r/1e3*(e?1:-1)*n,!1),i=requestAnimationFrame(s)};i=requestAnimationFrame(s);const a=()=>{cancelAnimationFrame(i),V.current=null,window.removeEventListener(t,a),window.removeEventListener("pointercancel",a),window.removeEventListener("blur",a),performance.now()-r<140&&K(e,"item")};V.current=a,window.addEventListener(t,a),window.addEventListener("pointercancel",a),window.addEventListener("blur",a)},[K,X,Y,g]),G=n.useRef(null);function J(e){return"hold"!==b?{onClick:()=>K(e)}:{onPointerDown:t=>{0===t.button&&Z(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Z(e,"keyup"))}}}n.useEffect(()=>()=>G.current?.(),[]);const Q="none"!==f&&("always"===f||$.back||$.forward),U="inline"===v;function ee(t){const n=t?$.forward:$.back;if("auto"===f&&!n&&!U)return e("span",{});const o=B?t?"-rotate-90 rtl:rotate-90":"rotate-90 rtl:-rotate-90":t?"":"rotate-180",i="auto"===f&&!n,s=e(r,{variant:k,size:L,color:E,density:C,elevation:1,label:t?M??S.next:P??S.previous,disabled:!n,className:"pointer-events-auto",icon:e("span",{className:l("flex items-center",o),children:e(a,{})}),...J(t)});return U?e("span",{className:l("flex shrink-0 items-center justify-center",i?"invisible":""),inert:i,children:s}):s}return t("div",{ref:D,className:l("relative flex min-w-0",U&&B?"flex-row items-stretch":"flex-col",U?u[L]:"",N),style:{"--n-ring":`var(--neba-${E}-ring)`,...T},...z,children:[Q&&U?ee(!1):null,e("div",{ref:I,tabIndex:0,role:j?"group":void 0,"aria-label":j,className:l("min-h-0 min-w-0 grow",B?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden",h?B?"snap-x snap-mandatory":"snap-y snap-mandatory":"",x?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",y&&($.back||$.forward)?"cursor-grab data-[dragging]:cursor-grabbing":"","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"),onScroll:O,onPointerDown:function(e){if(!y||"touch"===e.pointerType||0!==e.button)return;G.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,o=t.scrollLeft,i=t.scrollTop;let s=!1;const a=document.body.style.getPropertyValue("-webkit-user-select"),l=e=>{const a=e.clientX-n,l=e.clientY-r;if(!s){if(Math.abs(B?a:l)<4)return;s=!0,t.setPointerCapture(e.pointerId),t.dataset.dragging="true",document.body.style.setProperty("-webkit-user-select","none")}B?t.scrollLeft=o-a:t.scrollTop=i-l},c=()=>{G.current=null,t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",c),delete t.dataset.dragging,a?document.body.style.setProperty("-webkit-user-select",a):document.body.style.removeProperty("-webkit-user-select")},u=()=>{const e=s;if(c(),!e)return;const n=e=>{e.stopPropagation(),e.preventDefault()};t.addEventListener("click",n,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener("click",n,!0),0)};G.current=c,t.addEventListener("pointermove",l),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",c)},children:e("div",{ref:W,className:l(h?"[&>*]:snap-start":""),style:{display:"grid",gap:o(p),gridAutoFlow:B?"column":"row",...B?{width:"max-content",gridTemplateRows:`repeat(${F}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${F}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:A})}),Q&&U?ee(!0):null,Q&&!U?t("div",{className:l("pointer-events-none absolute inset-0 flex justify-between",B?"items-center":"flex-col items-center",c[L]),children:[ee(!1),ee(!0)]}):null]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{ScrollZone}from"./ScrollZone.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { NebaElevation, NebaStyleProps, NebaVariant } from '../../types';
|
|
2
|
+
import type { NebaElevation, NebaStyleProps, NebaVariant } from '../../types.js';
|
|
3
3
|
/** A segment's value. The same restraint Tabs and Select put on theirs. */
|
|
4
4
|
export type SegmentValue = string | number;
|
|
5
5
|
export interface SegmentedButtonProps extends Omit<NebaStyleProps, 'variant'>, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as r}from"@base-ui/react/radio-group";import{controlHeightClasses as s,controlSlots as l,controlTextClasses as o,gapClasses as i,hasContent as d,iconClasses as u,paddingXClasses as c,surfaceClasses as f,transitionClasses as h}from"../../internal/styles";const p
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as r}from"@base-ui/react/radio-group";import{controlHeightClasses as s,controlSlots as l,controlTextClasses as o,gapClasses as i,hasContent as d,iconClasses as u,paddingXClasses as c,surfaceClasses as f,transitionClasses as h}from"../../internal/styles.js";const p=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",fullWidth:!1}),b={solid:`${f} bg-(--n-panel) p-1 [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,outline:`${f} border bg-(--n-panel) p-1 [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,text:""},m={solid:`${f} bg-(--n-fill) [box-shadow:var(--neba-shadow-1),var(--neba-plate-solid)]`,outline:`${f} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,text:`${f} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`},v={solid:"data-[checked]:text-(--n-on-solid)",outline:"data-[checked]:text-(--n-accent)",text:"data-[checked]:text-(--n-accent)"};export const Segment=/*@__PURE__*/a.forwardRef(function({value:r,startIcon:l,endIcon:f,disabled:b=!1,className:m,children:x,...g},y){const{variant:w,size:k,density:$,fullWidth:j}=a.useContext(p);return t(n.Root,{ref:y,value:r,disabled:b,"data-segment":"",className:["relative z-10 inline-flex shrink-0 cursor-pointer items-center justify-center select-none","whitespace-nowrap font-medium","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",s[k],o[k],i[k],c[$][k],"rounded-full",h,u,"text-(--neba-muted-fg) hover:text-(--neba-fg)",v[w],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","data-[readonly]:cursor-default",j?"flex-1":"",m??""].filter(Boolean).join(" "),...g,children:[d(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,x,d(f)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:f}):null]})});export const SegmentedButton=/*@__PURE__*/a.forwardRef(function({variant:n="outline",size:s="md",color:o="primary",density:i="default",elevation:d=0,value:u,defaultValue:c=null,onValueChange:f,disabled:v=!1,readOnly:x=!1,name:g,fullWidth:y=!1,className:w,style:k,children:$,...j},R){const[N,z]=a.useState(c),W=void 0!==u,C=W?u:N,P=a.useRef(null),S=a.useRef(null),A=a.useCallback(e=>{const t=P.current,a=S.current;if(!t||!a)return;const n=t.querySelector("[data-segment][data-checked]");if(!n)return;const r=!e||!a.hasAttribute("data-ready");r&&a.removeAttribute("data-ready"),a.style.setProperty("--n-seg-x",`${n.offsetLeft}px`),a.style.setProperty("--n-seg-y",`${n.offsetTop}px`),a.style.setProperty("--n-seg-w",`${n.offsetWidth}px`),a.style.setProperty("--n-seg-h",`${n.offsetHeight}px`),r&&a.offsetWidth,a.setAttribute("data-ready","")},[]);a.useLayoutEffect(()=>{A(!0)},[A,C,n,s,i,y,$]),a.useEffect(()=>{const e=P.current;if(!e)return;const t=new ResizeObserver(()=>A(!1));return t.observe(e),()=>t.disconnect()},[A]);const B=a.useMemo(()=>({variant:n,size:s,density:i,fullWidth:y}),[n,s,i,y]);return e(p.Provider,{value:B,children:t(r,{ref:e=>{P.current=e,"function"==typeof R?R(e):R&&(R.current=e)},value:C,onValueChange:e=>{const t=e??null;W||z(t),f?.(t)},disabled:v,readOnly:x,name:g,className:["relative inline-flex items-center rounded-full",b[n],h,x?"[filter:saturate(0.55)]":"",y?"flex w-full":"",w??""].filter(Boolean).join(" "),style:{...l(o,d,n),...k},...j,children:[null!=C?e("span",{ref:S,"aria-hidden":"true",className:["pointer-events-none absolute rounded-full","left-(--n-seg-x) top-(--n-seg-y) h-(--n-seg-h) w-(--n-seg-w)",m[n],"[transition-property:left,top,width,height]","[transition-timing-function:var(--neba-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--neba-duration)]"].join(" ")}):null,$]})})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Segment, SegmentedButton } from './SegmentedButton';
|
|
2
|
-
export type { SegmentedButtonProps, SegmentProps, SegmentValue } from './SegmentedButton';
|
|
1
|
+
export { Segment, SegmentedButton } from './SegmentedButton.js';
|
|
2
|
+
export type { SegmentedButtonProps, SegmentProps, SegmentValue } from './SegmentedButton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Segment,SegmentedButton}from"./SegmentedButton";
|
|
1
|
+
export{Segment,SegmentedButton}from"./SegmentedButton.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Select as l}from"@base-ui/react/select";import{Field as n}from"@base-ui/react/field";import{CheckIcon as r,ChevronIcon as i}from"../../internal/icons";import{WidthSizer as s}from"../../internal/sizer";import{controlHeightClasses as o,controlTextLeadingClasses as d,disabledClasses as c,fieldReadOnlyClasses as m,fieldRestClasses as u,focusWithinRingClasses as h,gapClasses as f,hasContent as p,iconClasses as b,metaTextClasses as g,paddingXClasses as x,radiusClasses as v,stackGapClasses as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Select as l}from"@base-ui/react/select";import{Field as n}from"@base-ui/react/field";import{CheckIcon as r,ChevronIcon as i}from"../../internal/icons.js";import{WidthSizer as s}from"../../internal/sizer.js";import{controlHeightClasses as o,controlTextLeadingClasses as d,disabledClasses as c,fieldReadOnlyClasses as m,fieldRestClasses as u,focusWithinRingClasses as h,gapClasses as f,hasContent as p,iconClasses as b,metaTextClasses as g,paddingXClasses as x,radiusClasses as v,stackGapClasses as j,surfaceClasses as N,surfaceSlots as w,transitionClasses as y}from"../../internal/styles.js";const I=["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",y,"focus-within:[transition-duration:0ms]",h,b].join(" "),S=[N,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","min-w-[var(--anchor-width)] border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]"].join(" "),$=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",y,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-accent)","data-[selected]:text-(--n-accent) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" ");export const Select=/*@__PURE__*/t.forwardRef(function({variant:h="outline",size:b="md",color:N="primary",density:y="default",elevation:V=0,items:z,value:k,defaultValue:O,onValueChange:P,placeholder:R,label:T,description:q,error:C,invalid:M,startIcon:W,fullWidth:_=!1,disabled:B=!1,readOnly:D=!1,required:E=!1,name:L,id:A,className:F,style:G,...H},J){const K=null!=C&&!1!==C&&""!==C,Q=M??K,U=Q?"danger":N,X=t.useMemo(()=>z.map(e=>({label:e.label??String(e.value),value:e.value})),[z]),Y=t.useMemo(()=>[...z.map(e=>e.label??String(e.value)),...p(R)?[R]:[]],[z,R]);return a(n.Root,{disabled:B,invalid:Q,className:["flex-col align-top",j[b],_?"flex w-full":"inline-flex",F??""].filter(Boolean).join(" "),style:{...w(U,V),...G},...H,children:[T?e(n.Label,{className:[g[b],"font-medium",B?"text-(--neba-disabled-fg)":"text-(--neba-fg)"].join(" "),children:T}):null,a(l.Root,{id:A,name:L,items:X,value:k,defaultValue:O,onValueChange:e=>P?.(e),disabled:B,readOnly:D,required:E,children:[a(l.Trigger,{ref:J,className:[I,o[b],d[b],v[b],f[b],x[y][b],B?c[h]:D?`${m[h]} cursor-default`:u[h]].join(" "),children:[W?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:W}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(l.Value,{className:["w-full truncate text-start","data-[placeholder]:text-(--neba-muted-fg)"].join(" "),placeholder:R}),e(s,{samples:Y})]}),e(l.Icon,{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(i,{})})]}),e(l.Portal,{children:e(l.Positioner,{className:"neba-portal z-50 [outline:none]",sideOffset:6,alignItemWithTrigger:!1,children:e(l.Popup,{className:`${S} ${v[b]} ${d[b]}`,style:w(U,3),children:z.map(t=>a(l.Item,{value:t.value,disabled:t.disabled,className:$,children:[e(l.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(r,{})}),e(l.ItemText,{className:"truncate",children:t.label??String(t.value)})]},String(t.value)))})})})]}),q?e(n.Description,{className:`${g[b]} text-(--neba-muted-fg)`,children:q}):null,K?e(n.Error,{match:!0,className:`${g[b]} text-(--n-accent)`,children:C}):null]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Select } from './Select';
|
|
2
|
-
export type { SelectOption, SelectProps, SelectValue } from './Select';
|
|
1
|
+
export { Select } from './Select.js';
|
|
2
|
+
export type { SelectOption, SelectProps, SelectValue } from './Select.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Select}from"./Select";
|
|
1
|
+
export{Select}from"./Select.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n,Fragment as e,jsxs as a}from"react/jsx-runtime";import*as o from"react";import{controlHeightClasses as t,controlSlots as r,controlTextClasses as l,paddingXClasses as s,radiusClasses as m,srOnlyClasses as i,surfaceClasses as c,transitionClasses as d}from"../../internal/styles";const w=n=>({symbol:n,name:n}),u={mod:{mac:{symbol:"⌘",name:"Command"},windows:w("Ctrl"),linux:w("Ctrl")},meta:{mac:{symbol:"⌘",name:"Command"},windows:w("Win"),linux:w("Super")},ctrl:{mac:{symbol:"⌃",name:"Control"},windows:w("Ctrl"),linux:w("Ctrl")},alt:{mac:{symbol:"⌥",name:"Option"},windows:w("Alt"),linux:w("Alt")},shift:{mac:{symbol:"⇧",name:"Shift"},windows:w("Shift"),linux:w("Shift")},enter:{mac:{symbol:"↩",name:"Enter"},windows:w("Enter"),linux:w("Enter")},tab:{mac:{symbol:"⇥",name:"Tab"},windows:w("Tab"),linux:w("Tab")},escape:{mac:{symbol:"⎋",name:"Escape"},windows:w("Esc"),linux:w("Esc")},backspace:{mac:{symbol:"⌫",name:"Backspace"},windows:w("Backspace"),linux:w("Backspace")},delete:{mac:{symbol:"⌦",name:"Delete"},windows:w("Del"),linux:w("Del")},capslock:{mac:{symbol:"⇪",name:"Caps Lock"},windows:w("Caps Lock"),linux:w("Caps Lock")}},p={cmdorctrl:"mod",commandorcontrol:"mod",cmd:"meta",command:"meta",super:"meta",win:"meta",windows:"meta",control:"ctrl",option:"alt",opt:"alt",return:"enter",esc:"escape",del:"delete",caps:"capslock"},b={up:{symbol:"↑",name:"Arrow up"},down:{symbol:"↓",name:"Arrow down"},left:{symbol:"←",name:"Arrow left"},right:{symbol:"→",name:"Arrow right"},arrowup:{symbol:"↑",name:"Arrow up"},arrowdown:{symbol:"↓",name:"Arrow down"},arrowleft:{symbol:"←",name:"Arrow left"},arrowright:{symbol:"→",name:"Arrow right"}};function f(){if("undefined"==typeof navigator)return"windows";const n=navigator.userAgentData,e=`${n?.platform??""} ${navigator.platform??""} ${navigator.userAgent??""}`;return/mac|iphone|ipad|ipod/i.test(e)?"mac":/win/i.test(e)?"windows":"linux"}function y(){return()=>{}}function x(){return"windows"}const g={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},h={solid:[c,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[c,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-(--n-soft)"},v={xs:"min-w-5.5",sm:"min-w-6.5",md:"min-w-8",lg:"min-w-10",xl:"min-w-12"};export const Shortcut
|
|
1
|
+
import{jsx as n,Fragment as e,jsxs as a}from"react/jsx-runtime";import*as o from"react";import{controlHeightClasses as t,controlSlots as r,controlTextClasses as l,paddingXClasses as s,radiusClasses as m,srOnlyClasses as i,surfaceClasses as c,transitionClasses as d}from"../../internal/styles.js";const w=n=>({symbol:n,name:n}),u={mod:{mac:{symbol:"⌘",name:"Command"},windows:w("Ctrl"),linux:w("Ctrl")},meta:{mac:{symbol:"⌘",name:"Command"},windows:w("Win"),linux:w("Super")},ctrl:{mac:{symbol:"⌃",name:"Control"},windows:w("Ctrl"),linux:w("Ctrl")},alt:{mac:{symbol:"⌥",name:"Option"},windows:w("Alt"),linux:w("Alt")},shift:{mac:{symbol:"⇧",name:"Shift"},windows:w("Shift"),linux:w("Shift")},enter:{mac:{symbol:"↩",name:"Enter"},windows:w("Enter"),linux:w("Enter")},tab:{mac:{symbol:"⇥",name:"Tab"},windows:w("Tab"),linux:w("Tab")},escape:{mac:{symbol:"⎋",name:"Escape"},windows:w("Esc"),linux:w("Esc")},backspace:{mac:{symbol:"⌫",name:"Backspace"},windows:w("Backspace"),linux:w("Backspace")},delete:{mac:{symbol:"⌦",name:"Delete"},windows:w("Del"),linux:w("Del")},capslock:{mac:{symbol:"⇪",name:"Caps Lock"},windows:w("Caps Lock"),linux:w("Caps Lock")}},p={cmdorctrl:"mod",commandorcontrol:"mod",cmd:"meta",command:"meta",super:"meta",win:"meta",windows:"meta",control:"ctrl",option:"alt",opt:"alt",return:"enter",esc:"escape",del:"delete",caps:"capslock"},b={up:{symbol:"↑",name:"Arrow up"},down:{symbol:"↓",name:"Arrow down"},left:{symbol:"←",name:"Arrow left"},right:{symbol:"→",name:"Arrow right"},arrowup:{symbol:"↑",name:"Arrow up"},arrowdown:{symbol:"↓",name:"Arrow down"},arrowleft:{symbol:"←",name:"Arrow left"},arrowright:{symbol:"→",name:"Arrow right"}};function f(){if("undefined"==typeof navigator)return"windows";const n=navigator.userAgentData,e=`${n?.platform??""} ${navigator.platform??""} ${navigator.userAgent??""}`;return/mac|iphone|ipad|ipod/i.test(e)?"mac":/win/i.test(e)?"windows":"linux"}function y(){return()=>{}}function x(){return"windows"}const g={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},h={solid:[c,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[c,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-(--n-soft)"},v={xs:"min-w-5.5",sm:"min-w-6.5",md:"min-w-8",lg:"min-w-10",xl:"min-w-12"};export const Shortcut=/*@__PURE__*/o.forwardRef(function({variant:c="outline",size:A="md",color:k="secondary",density:C="compact",elevation:j=0,keys:E,os:S="auto",separator:B,className:N,style:D,...L},T){const $=o.useSyncExternalStore(y,f,x),F="auto"===S?$:S,z=g[A],O=function(n){return Array.isArray(n)?n.map(n=>n.trim()).filter(Boolean):n.split("+").map(n=>n.trim()).filter(Boolean)}(E),R=O.map(n=>function(n,e){const a=n.toLowerCase().replace(/[\s_-]/g,""),o=p[a]??a,t=b[o];if(t)return t;const r=u[o];return r?r[e]:w(1===n.length?n.toUpperCase():n)}(n,F)),U=void 0===B?"mac"===F?null:"+":B,W=["inline-flex shrink-0 items-center justify-center","font-mono font-medium leading-none whitespace-nowrap tabular-nums",t[z],l[z],v[z],s[C][z],m[z],h[c],d].join(" ");return n("span",{ref:T,className:["inline-flex max-w-full items-center gap-1 align-middle",N??""].filter(Boolean).join(" "),style:{...r(k,j,c),...D},...L,children:R.map((t,r)=>a(o.Fragment,{children:[r>0&&null!==U?n("span",{"aria-hidden":"true",className:"text-(--neba-muted-fg)",children:U}):null,n("kbd",{className:W,children:t.symbol===t.name?t.symbol:a(e,{children:[n("span",{"aria-hidden":"true",children:t.symbol}),n("span",{className:i,children:t.name})]})})]},r))})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Shortcut } from './Shortcut';
|
|
2
|
-
export type { ShortcutOS, ShortcutProps } from './Shortcut';
|
|
1
|
+
export { Shortcut } from './Shortcut.js';
|
|
2
|
+
export type { ShortcutOS, ShortcutProps } from './Shortcut.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Shortcut}from"./Shortcut";
|
|
1
|
+
export{Shortcut}from"./Shortcut.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useRender as l}from"@base-ui/react/use-render";import{controlHeightClasses as n,controlSquareClasses as d,surfaceSlots as o}from"../../internal/styles";const
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useRender as l}from"@base-ui/react/use-render";import{controlHeightClasses as n,controlSquareClasses as d,surfaceSlots as o}from"../../internal/styles.js";const s={xs:"h-[0.6875rem]",sm:"h-[0.75rem]",md:"h-[0.8125rem]",lg:"h-[0.9375rem]",xl:"h-[1.0625rem]"},a={xs:"gap-[0.3125rem]",sm:"gap-[0.375rem]",md:"gap-[0.5625rem]",lg:"gap-[0.5625rem]",xl:"gap-[0.6875rem]"},m={xs:"rounded-[0.3125rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"},i={xs:"h-12",sm:"h-16",md:"h-20",lg:"h-28",xl:"h-36"},t={xs:"rounded-(--neba-radius-xs)",sm:"rounded-(--neba-radius-sm)",md:"rounded-(--neba-radius-md)",lg:"rounded-(--neba-radius-lg)",xl:"rounded-(--neba-radius-xl)"},u="relative overflow-hidden bg-(--n-soft-hover)";function f(e){if(void 0!==e)return"number"==typeof e?`${e}px`:e}export const Skeleton=/*@__PURE__*/r.forwardRef(function({shape:r="line",lines:h=1,size:c="md",color:x="secondary",width:g,height:p,animated:b=!0,label:w,render:y,className:$,style:v,...j},k){const N=b?"neba-skeleton":"",B="circle"===r?`rounded-full ${n[c]} ${d[c]} shrink-0`:"rect"===r?`w-full ${t[c]} ${void 0===p?i[c]:""}`:`w-full ${m[c]} ${s[c]}`,z=w?{role:"status","aria-busy":!0,"aria-label":w}:{"aria-hidden":!0},A="line"===r&&h>1;return l({render:y,ref:k,props:{className:(A?["flex w-full flex-col",a[c],$??""]:[u,N,B,$??""]).filter(Boolean).join(" "),style:{...o(x,0),width:f(g),height:f(p),...v},...z,...A?{children:Array.from({length:h},(r,l)=>e("div",{className:[u,N,m[c],s[c],l===h-1?"w-3/5":"w-full"].filter(Boolean).join(" ")},l))}:null,...j}})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Skeleton } from './Skeleton';
|
|
2
|
-
export type { NebaSkeletonShape, SkeletonProps } from './Skeleton';
|
|
1
|
+
export { Skeleton } from './Skeleton.js';
|
|
2
|
+
export type { NebaSkeletonShape, SkeletonProps } from './Skeleton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Skeleton}from"./Skeleton";
|
|
1
|
+
export{Skeleton}from"./Skeleton.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Slider as BaseUISlider } from '@base-ui/react/slider';
|
|
3
|
-
import type { NebaColor, NebaOrientation, NebaSize } from '../../types';
|
|
3
|
+
import type { NebaColor, NebaOrientation, NebaSize } from '../../types.js';
|
|
4
4
|
type BaseSliderProps = Omit<React.ComponentPropsWithoutRef<typeof BaseUISlider.Root>, 'className' | 'style' | 'render' | 'children' | 'orientation'>;
|
|
5
5
|
export interface SliderProps extends BaseSliderProps {
|
|
6
6
|
/** @default 'md' */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Slider as r}from"@base-ui/react/slider";import{metaTextClasses as n,surfaceClasses as s,transitionClasses as o}from"../../internal/styles";const t={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"},i={xs:"w-1",sm:"w-1.5",md:"w-1.5",lg:"w-2",xl:"w-2.5"},c={xs:"size-3",sm:"size-3.5",md:"size-4",lg:"size-5",xl:"size-6"},d={xs:"h-4",sm:"h-4.5",md:"h-5",lg:"h-6",xl:"h-7"},f={xs:"w-4",sm:"w-4.5",md:"w-5",lg:"w-6",xl:"w-7"},u="rounded-full bg-(--n-soft)",m=`rounded-full bg-(--n-fill) ${o}`,h=["rounded-full border bg-(--neba-surface)",s,"[border-color:var(--n-line-hover)]","[box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]","cursor-grab select-none active:cursor-grabbing",o,"hover:[box-shadow:var(--neba-shadow-2),0_0_0_4px_var(--n-soft)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[dragging]:[box-shadow:var(--neba-shadow-1),0_0_0_6px_var(--n-soft-hover)]"].join(" ");export const Slider
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Slider as r}from"@base-ui/react/slider";import{metaTextClasses as n,surfaceClasses as s,transitionClasses as o}from"../../internal/styles.js";const t={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"},i={xs:"w-1",sm:"w-1.5",md:"w-1.5",lg:"w-2",xl:"w-2.5"},c={xs:"size-3",sm:"size-3.5",md:"size-4",lg:"size-5",xl:"size-6"},d={xs:"h-4",sm:"h-4.5",md:"h-5",lg:"h-6",xl:"h-7"},f={xs:"w-4",sm:"w-4.5",md:"w-5",lg:"w-6",xl:"w-7"},u="rounded-full bg-(--n-soft)",m=`rounded-full bg-(--n-fill) ${o}`,h=["rounded-full border bg-(--neba-surface)",s,"[border-color:var(--n-line-hover)]","[box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]","cursor-grab select-none active:cursor-grabbing",o,"hover:[box-shadow:var(--neba-shadow-2),0_0_0_4px_var(--n-soft)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[dragging]:[box-shadow:var(--neba-shadow-1),0_0_0_6px_var(--n-soft-hover)]"].join(" ");export const Slider=/*@__PURE__*/a.forwardRef(function({size:a="md",color:s="primary",orientation:o="horizontal",label:b,description:x,showValue:v=!1,disabled:g=!1,className:w,style:p,...$},_){const y="vertical"===o,N={"--n-fill":`var(--neba-${s}-fill)`,"--n-accent":`var(--neba-${s}-accent)`,"--n-soft":`var(--neba-${s}-soft)`,"--n-soft-hover":`var(--neba-${s}-soft-hover)`,"--n-line-hover":`var(--neba-${s}-line-hover)`,"--n-ring":`var(--neba-${s}-ring)`},j=$.value??$.defaultValue,z=Array.isArray(j)?j.length:1;return l(r.Root,{ref:_,orientation:o,disabled:g,className:["flex",y?"w-fit flex-col items-center gap-2":"w-full flex-col gap-1.5",g?"[filter:saturate(0.25)] opacity-70 [&_*]:cursor-not-allowed":"",w??""].filter(Boolean).join(" "),style:{...N,...p},...$,children:[b||v?l("div",{className:`flex w-full items-baseline gap-2 ${n[a]}`,children:[b?e(r.Label,{className:g?"font-medium text-(--neba-disabled-fg)":"font-medium text-(--neba-fg)",children:b}):null,v?e(r.Value,{className:"ms-auto tabular-nums text-(--neba-muted-fg)",children:"function"==typeof v?v:null}):null]}):null,e(r.Control,{className:["flex touch-none select-none items-center justify-center",y?`${f[a]} h-40 flex-col`:`w-full ${d[a]}`].join(" "),children:l(r.Track,{className:[u,y?`${i[a]} h-full`:`${t[a]} w-full`].join(" "),children:[e(r.Indicator,{className:m}),Array.from({length:z},(l,n)=>e(r.Thumb,{index:n,className:`${h} ${c[a]}`},n))]})}),x?e("div",{className:`${n[a]} text-(--neba-muted-fg)`,children:x}):null]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Slider } from './Slider';
|
|
2
|
-
export type { SliderProps } from './Slider';
|
|
1
|
+
export { Slider } from './Slider.js';
|
|
2
|
+
export type { SliderProps } from './Slider.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Slider}from"./Slider";
|
|
1
|
+
export{Slider}from"./Slider.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { NebaChartCurve, NebaChartDatum, NebaColor, NebaSize } from '../../types';
|
|
2
|
+
import type { NebaChartCurve, NebaChartDatum, NebaColor, NebaSize } from '../../types.js';
|
|
3
3
|
export interface SparklineProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {
|
|
4
4
|
/** The values. `null` is a gap, exactly as it is on every other chart. */
|
|
5
5
|
data: readonly NebaChartDatum[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as e,Fragment as l}from"react/jsx-runtime";import*as r from"react";import{areaPath as t,barMaxThickness as n,barPath as i,barRadius as o,extentOf as s,lineWidths as h,markerRadii as m,markGap as c,resolveColor as u,sparklineHeights as d,toValue as p}from"../../internal/chart";import{useMeasuredWidth as f}from"../../internal/chart-frame";import{cx as x,srOnlyClasses as v}from"../../internal/styles";import{linePath as b}from"../../internal/chart";export const Sparkline
|
|
1
|
+
import{jsx as a,jsxs as e,Fragment as l}from"react/jsx-runtime";import*as r from"react";import{areaPath as t,barMaxThickness as n,barPath as i,barRadius as o,extentOf as s,lineWidths as h,markerRadii as m,markGap as c,resolveColor as u,sparklineHeights as d,toValue as p}from"../../internal/chart.js";import{useMeasuredWidth as f}from"../../internal/chart-frame.js";import{cx as x,srOnlyClasses as v}from"../../internal/styles.js";import{linePath as b}from"../../internal/chart.js";export const Sparkline=/*@__PURE__*/r.forwardRef(function({data:g,shape:M="line",curve:k="linear",size:y="md",color:j,endDot:w=!1,baseline:$,min:N,max:W,width:C,label:L,className:R,style:z,...B},D){const F=r.useRef(null),G=f(F),I=r.useId().replace(/:/g,""),S=r.useMemo(()=>g.map(p),[g]),q=d[y],A=h[y],E=m[y],H=s([S],!1),J=N??(H?Math.min(H.min,$??H.min):0),K=(W??(H?Math.max(H.max,$??H.max):1))-J||1,O="number"==typeof C?C:G,P=u(j??"var(--neba-chart-1)"),Q="bar"===M?0:A/2+(w?E:0),T=Q,U=Math.max(1,q-2*Q),V=a=>T+(1-(a-J)/K)*U,X=S.length>1?O/(S.length-1):O,Y=S.map((a,e)=>null===a.value?null:{x:e*X,y:V(a.value)}),Z=(()=>{for(let a=S.length-1;a>=0;a--)if(null!==S[a].value)return a;return-1})(),_=Math.min(n[y]/2,Math.max(1,O/Math.max(1,S.length)-c));return e("div",{ref:D,className:x("relative block",R??void 0),style:{width:C??"100%",height:q,...z},...B,children:[a("div",{ref:F,className:"absolute inset-0",children:O>0&&S.length>0?e("svg",{width:O,height:q,viewBox:`0 0 ${O} ${q}`,role:L?"img":"presentation","aria-label":L,"aria-hidden":!L||void 0,className:"block overflow-visible",children:["area"===M?e(l,{children:[a("defs",{children:e("linearGradient",{id:`${I}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[a("stop",{offset:"0%",stopColor:`color-mix(in oklab, ${P} 32%, transparent)`}),a("stop",{offset:"100%",stopColor:`color-mix(in oklab, ${P} 2%, transparent)`})]})}),a("path",{d:t(Y,q,k),fill:`url(#${I}-fill)`})]}):null,void 0!==$?a("line",{x1:0,x2:O,y1:V($),y2:V($),stroke:"var(--neba-chart-baseline)",strokeWidth:1}):null,"bar"===M?S.map((e,l)=>null===e.value?null:a("path",{d:i(l*(O/Math.max(1,S.length))+(O/Math.max(1,S.length)-_)/2,Math.min(V(e.value),V(Math.max(J,0))),_,Math.max(1,Math.abs(V(e.value)-V(Math.max(J,0)))),o/2,e.value>=0?"up":"down"),fill:e.color??P},l)):a("path",{d:b(Y,k),fill:"none",stroke:P,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round"}),w&&Z>=0&&"bar"!==M?a("circle",{cx:Y[Z].x,cy:Y[Z].y,r:E,fill:P,stroke:"var(--neba-chart-gap)",strokeWidth:c}):null]}):null}),L?a("span",{className:v,children:S.map(a=>null===a.value?"—":a.value).join(", ")}):null]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Sparkline } from './Sparkline';
|
|
2
|
-
export type { SparklineProps } from './Sparkline';
|
|
1
|
+
export { Sparkline } from './Sparkline.js';
|
|
2
|
+
export type { SparklineProps } from './Sparkline.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Sparkline}from"./Sparkline";
|
|
1
|
+
export{Sparkline}from"./Sparkline.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { NebaColor, NebaDensity, NebaElevation, NebaSize, NebaVariant } from '../../types';
|
|
2
|
+
import type { NebaColor, NebaDensity, NebaElevation, NebaSize, NebaVariant } from '../../types.js';
|
|
3
3
|
export interface SpoilerProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'onChange'> {
|
|
4
4
|
/** Whether the content is uncovered. Pass it to drive the Spoiler yourself. */
|
|
5
5
|
revealed?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Button as r}from"../button/Button.js";import{spoilerMessages as i,useMessages as o}from"../../internal/i18n.js";import{boxPaddingClasses as l,boxPaddingXClasses as t,boxPaddingYClasses as s}from"../box/Box.js";import{hasContent as d,metaTextClasses as c,radiusClasses as m,surfaceClasses as v,surfaceSlots as f,transitionClasses as u}from"../../internal/styles.js";const b={solid:[v,"bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[v,"border bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"bg-transparent"},p="[background-color:color-mix(in_oklab,var(--neba-surface)_55%,transparent)]";export const Spoiler=/*@__PURE__*/a.forwardRef(function({revealed:v,defaultRevealed:x=!1,onRevealedChange:h,locale:j,label:g,hideLabel:y,description:w,action:N,reversible:k=!1,maxHeight:z,blur:B=10,padded:_=!0,variant:C="outline",size:R="md",color:H="primary",density:S="default",elevation:$=0,className:I,style:L,children:q,...A},D){const E=o(i,j),F=a.useId(),[G,J]=a.useState(x),K=v??G,M=e=>{void 0===v&&J(e),h?.(e)},O=!1===w?null:w??E.notice;return n("div",{ref:D,className:["relative isolate overflow-hidden",m[R],b[C],u,I??""].filter(Boolean).join(" "),style:{...f(H,$),...L},...A,children:[e("div",{id:F,className:["min-w-0",_?l[S][R]:"","[transition:filter_var(--neba-duration-fill)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]",K?"":"select-none"].filter(Boolean).join(" "),style:{filter:K?void 0:`blur(${B}px)`,maxHeight:K?void 0:z,overflow:K?void 0:"hidden"},inert:!K,children:q}),K?null:n("div",{className:["absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 text-center",l[S][R],p].join(" "),children:[d(O)?e("p",{className:`m-0 text-(--neba-muted-fg) ${c[R]}`,children:O}):null,N??e(r,{size:R,color:H,density:S,onClick:()=>M(!0),"aria-expanded":!1,"aria-controls":F,children:g??E.reveal})]}),K&&k?e("div",{className:["flex justify-end",t[S][R],s[S][R],"pt-0"].join(" "),children:e(r,{variant:"text",size:R,color:H,density:S,onClick:()=>M(!1),"aria-expanded":!0,"aria-controls":F,children:y??E.hide})}):null]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Spoiler } from './Spoiler';
|
|
2
|
-
export type { SpoilerProps } from './Spoiler';
|
|
1
|
+
export { Spoiler } from './Spoiler.js';
|
|
2
|
+
export type { SpoilerProps } from './Spoiler.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Spoiler}from"./Spoiler";
|
|
1
|
+
export{Spoiler}from"./Spoiler.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type BoxProps } from '../box/Box';
|
|
3
|
-
import type { NebaAlign } from '../../types';
|
|
2
|
+
import { type BoxProps } from '../box/Box.js';
|
|
3
|
+
import type { NebaAlign } from '../../types.js';
|
|
4
4
|
export interface StatisticProps extends Omit<BoxProps, 'title' | 'prefix'> {
|
|
5
5
|
/**
|
|
6
6
|
* What the number is. The name of the measure, not a sentence about it —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Box as n}from"../box/Box";import{Chip as a}from"../chip/Chip";import{MinusIcon as r,TrendDownIcon as s,TrendUpIcon as m}from"../../internal/icons";import{numberFormatter as i}from"../../internal/format";import{hasContent as o,metaTextClasses as c,sheetSectionGapClasses as u}from"../../internal/styles";const d={xs:"text-[1.125rem]/[1.375rem]",sm:"text-[1.375rem]/[1.625rem]",md:"text-[1.75rem]/[2rem]",lg:"text-[2.25rem]/[2.5rem]",xl:"text-[2.875rem]/[3.25rem]"},x={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1rem]",lg:"text-[1.25rem]",xl:"text-[1.5rem]"},f={xs:"gap-y-0.5",sm:"gap-y-0.5",md:"gap-y-1",lg:"gap-y-1",xl:"gap-y-1.5"},p={start:"items-start text-start",center:"items-center text-center",end:"items-end text-end"},h={up:e(m,{}),down:e(s,{}),flat:e(r,{})};export const Statistic
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Box as n}from"../box/Box.js";import{Chip as a}from"../chip/Chip.js";import{MinusIcon as r,TrendDownIcon as s,TrendUpIcon as m}from"../../internal/icons.js";import{numberFormatter as i}from"../../internal/format.js";import{hasContent as o,metaTextClasses as c,sheetSectionGapClasses as u}from"../../internal/styles.js";const d={xs:"text-[1.125rem]/[1.375rem]",sm:"text-[1.375rem]/[1.625rem]",md:"text-[1.75rem]/[2rem]",lg:"text-[2.25rem]/[2.5rem]",xl:"text-[2.875rem]/[3.25rem]"},x={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1rem]",lg:"text-[1.25rem]",xl:"text-[1.5rem]"},f={xs:"gap-y-0.5",sm:"gap-y-0.5",md:"gap-y-1",lg:"gap-y-1",xl:"gap-y-1.5"},p={start:"items-start text-start",center:"items-center text-center",end:"items-end text-end"},h={up:e(m,{}),down:e(s,{}),flat:e(r,{})};export const Statistic=/*@__PURE__*/l.forwardRef(function({size:l="md",color:r="primary",density:s="default",label:m,value:b,format:g,locale:j,prefix:w,unit:N,icon:y,previousValue:$,delta:v="percent",betterWhen:z="up",caption:B,align:M="start",className:k,children:C,...F},I){const R="number"==typeof b?b:null,S=null===R?b:i(j,g).format(R),V=null!==R&&void 0!==$?R-$:null,W=null!==V&&0!==$&&void 0!==$?V/Math.abs($):null,q=null===V?null:V>0?"up":V<0?"down":"flat";let A=null;if(null!==V&&null!==q&&"none"!==v){const e=V>0?"+":V<0?"-":"",t=`${e}${i(j,g).format(Math.abs(V))}`,l=null===W?null:`${e}${(100*Math.abs(W)).toFixed(1).replace(/\.0$/,"")}%`;A="absolute"===v?t:"both"===v?[l,t].filter(Boolean).join(" · "):l??t}const D=null===q||"flat"===q?"secondary":q===z?"success":"danger",E=null!==A||o(B);return t(n,{ref:I,size:l,color:r,density:s,className:["flex flex-col",u[l],p[M],k??""].filter(Boolean).join(" "),...F,children:[o(m)||o(y)?t("div",{className:["flex min-w-0 items-center gap-1.5 font-medium text-(--neba-muted-fg)",c[l]].join(" "),children:[o(y)?e("span",{className:"flex shrink-0 items-center",children:y}):null,o(m)?e("span",{className:"min-w-0 truncate",children:m}):null]}):null,t("div",{className:["flex min-w-0 flex-wrap items-baseline gap-1 font-semibold text-(--neba-fg) tabular-nums",d[l]].join(" "),children:[o(w)?e("span",{className:`font-medium text-(--neba-muted-fg) ${x[l]}`,children:w}):null,e("span",{className:"min-w-0 break-words",children:S}),o(N)?e("span",{className:`font-medium text-(--neba-muted-fg) ${x[l]}`,children:N}):null]}),E?t("div",{className:`flex min-w-0 flex-wrap items-center gap-x-2 ${f[l]}`,children:[null!==A&&null!==q?e(a,{size:l,variant:"text",color:D,startIcon:h[q],className:"tabular-nums",children:A}):null,o(B)?e("span",{className:`min-w-0 text-(--neba-muted-fg) ${c[l]}`,children:B}):null]}):null,C]})});
|