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
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { NebaWindowControl, NebaWindowOffset, NebaWindowOs } from '../../internal/window.js';
|
|
4
|
+
import type { NebaColor, NebaElevation, NebaSize } from '../../types.js';
|
|
5
|
+
export type { NebaWindowControl, NebaWindowOffset, NebaWindowOs } from '../../internal/window.js';
|
|
6
|
+
/** The three CSS positions a window can be laid out with. */
|
|
7
|
+
export type WindowPanePosition = 'static' | 'absolute' | 'fixed';
|
|
8
|
+
/** What a resize reports: the window's size in pixels. */
|
|
9
|
+
export interface WindowPaneSize {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface WindowPaneProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title' | 'onResize'> {
|
|
14
|
+
/**
|
|
15
|
+
* Whose window this is a picture of. Decides where the controls sit, how they
|
|
16
|
+
* are drawn, how tall the title bar is and how its corners are cut.
|
|
17
|
+
* @default 'macos'
|
|
18
|
+
*/
|
|
19
|
+
os?: NebaWindowOs;
|
|
20
|
+
/** The window's name, in the title bar. Also what names the window itself. */
|
|
21
|
+
title?: React.ReactNode;
|
|
22
|
+
/** A glyph beside the title — the app's mark. */
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
/** Anything else the title bar carries, set beside the controls. */
|
|
25
|
+
actions?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Which of the three buttons the title bar has. `true` is all of them,
|
|
28
|
+
* `false` is none, and an array is exactly the ones named — a window that can
|
|
29
|
+
* be closed but not minimized is `['close']`.
|
|
30
|
+
*
|
|
31
|
+
* The order is the system's rather than the array's: macOS puts close first
|
|
32
|
+
* and Windows puts it last, and that is not something a caller should have to
|
|
33
|
+
* remember.
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
controls?: boolean | readonly NebaWindowControl[];
|
|
37
|
+
/**
|
|
38
|
+
* The scale of the chrome — the title bar's height, its buttons and its type.
|
|
39
|
+
* It does not touch the content, which is the caller's and is laid out at its
|
|
40
|
+
* own scale, exactly as it would be on a desktop where the title bar does not
|
|
41
|
+
* grow with the document.
|
|
42
|
+
* @default 'md'
|
|
43
|
+
*/
|
|
44
|
+
size?: NebaSize;
|
|
45
|
+
/** The colour family the focus rings and an `accent` title bar take. @default 'primary' */
|
|
46
|
+
color?: NebaColor;
|
|
47
|
+
/**
|
|
48
|
+
* Dyes the title bar with the colour family, the way Windows offers to. Off,
|
|
49
|
+
* the bar is the neutral shade the system draws by default.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
accent?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* How much of what is behind the window shows through its chrome, from `0` to
|
|
55
|
+
* `1`. It applies to the title bar, the body's own fill and the border —
|
|
56
|
+
* never to the content on it, which stays exactly as legible as it was.
|
|
57
|
+
*
|
|
58
|
+
* Anything above `0` also turns the acrylic on, so the page underneath is
|
|
59
|
+
* blurred rather than merely visible. `1` is a window that is nothing but its
|
|
60
|
+
* edge and its chrome.
|
|
61
|
+
* @default 0
|
|
62
|
+
*/
|
|
63
|
+
transparency?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Whether this is the window in front.
|
|
66
|
+
*
|
|
67
|
+
* Left out, the window works it out for itself: it is in front until another
|
|
68
|
+
* WindowPane on the page is pressed or takes the focus, exactly as windows on
|
|
69
|
+
* a desktop behave. A click on the page *around* the windows changes nothing
|
|
70
|
+
* — a paragraph is not a desktop.
|
|
71
|
+
*
|
|
72
|
+
* Pass it to drive that yourself, which is what a caller keeping its own
|
|
73
|
+
* z-order wants.
|
|
74
|
+
*
|
|
75
|
+
* What being in front looks like is the system's: coloured traffic lights on
|
|
76
|
+
* macOS against grey ones, an accent title bar and an accent border on
|
|
77
|
+
* Windows 10, a tinted header bar on GNOME — and, on all four, a window one
|
|
78
|
+
* step further off the page than the ones behind it.
|
|
79
|
+
*/
|
|
80
|
+
active?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The shadow around the window. `2` here, against the `0` everything else
|
|
83
|
+
* defaults to, for the reason Pill's is `2`: a window is by definition not
|
|
84
|
+
* part of the page it is on.
|
|
85
|
+
* @default 2
|
|
86
|
+
*/
|
|
87
|
+
elevation?: NebaElevation;
|
|
88
|
+
/**
|
|
89
|
+
* How the window is laid out. `static` leaves it in the flow (as a
|
|
90
|
+
* relatively positioned box, so `offset` can move it without disturbing
|
|
91
|
+
* anything around it); `absolute` pins it inside the nearest positioned
|
|
92
|
+
* ancestor, which is what a desktop full of windows wants; `fixed` pins it to
|
|
93
|
+
* the viewport.
|
|
94
|
+
* @default 'static'
|
|
95
|
+
*/
|
|
96
|
+
position?: WindowPanePosition;
|
|
97
|
+
/** Lets the title bar be dragged. @default false */
|
|
98
|
+
draggable?: boolean;
|
|
99
|
+
/** Lets the edges and corners be dragged. @default false */
|
|
100
|
+
resizable?: boolean;
|
|
101
|
+
/** The window's width — a number in pixels or any CSS length. */
|
|
102
|
+
width?: number | string;
|
|
103
|
+
/** And its height. Left out, the window is as tall as what is in it. */
|
|
104
|
+
height?: number | string;
|
|
105
|
+
/** How small it may be dragged, in pixels. @default 180 */
|
|
106
|
+
minWidth?: number;
|
|
107
|
+
/** The same downward. Defaults to the title bar's own height. */
|
|
108
|
+
minHeight?: number;
|
|
109
|
+
/** How far it has been dragged from where the layout put it. */
|
|
110
|
+
offset?: NebaWindowOffset;
|
|
111
|
+
/** Where an uncontrolled window starts. @default { x: 0, y: 0 } */
|
|
112
|
+
defaultOffset?: NebaWindowOffset;
|
|
113
|
+
onOffsetChange?: (offset: NebaWindowOffset) => void;
|
|
114
|
+
/** Fires with the window's size, in pixels, while an edge is dragged. */
|
|
115
|
+
onResize?: (size: WindowPaneSize) => void;
|
|
116
|
+
/** Whether the window is on screen at all. Closing it renders nothing. */
|
|
117
|
+
open?: boolean;
|
|
118
|
+
/** @default true */
|
|
119
|
+
defaultOpen?: boolean;
|
|
120
|
+
onOpenChange?: (open: boolean) => void;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the window is rolled up to its title bar. This is what minimizing
|
|
123
|
+
* means for a window that is part of a page rather than of a desktop: there
|
|
124
|
+
* is no dock for it to go to, so it stays where it is with nothing under the
|
|
125
|
+
* bar.
|
|
126
|
+
*/
|
|
127
|
+
minimized?: boolean;
|
|
128
|
+
/** @default false */
|
|
129
|
+
defaultMinimized?: boolean;
|
|
130
|
+
onMinimizedChange?: (minimized: boolean) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Whether the window fills whatever is holding it. Its corners go square
|
|
133
|
+
* while it does, as they do on every system.
|
|
134
|
+
*/
|
|
135
|
+
maximized?: boolean;
|
|
136
|
+
/** @default false */
|
|
137
|
+
defaultMaximized?: boolean;
|
|
138
|
+
onMaximizedChange?: (maximized: boolean) => void;
|
|
139
|
+
/** Whether content taller than the window scrolls. @default true */
|
|
140
|
+
scroll?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Which language the title bar's buttons name themselves in — a BCP 47 tag
|
|
143
|
+
* such as `ko`, `pt-BR` or `zh-Hant`. Unsupported tags fall back to English.
|
|
144
|
+
*/
|
|
145
|
+
locale?: string;
|
|
146
|
+
/** Overrides the buttons' own names. */
|
|
147
|
+
minimizeLabel?: string;
|
|
148
|
+
maximizeLabel?: string;
|
|
149
|
+
restoreLabel?: string;
|
|
150
|
+
closeLabel?: string;
|
|
151
|
+
resizeLabel?: string;
|
|
152
|
+
/** Renders something other than a `<div>`: `render={<section />}`. */
|
|
153
|
+
render?: useRender.RenderProp;
|
|
154
|
+
/** What is in the window. */
|
|
155
|
+
children?: React.ReactNode;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A window, drawn the way one of four systems draws it, with anything at all
|
|
159
|
+
* inside it.
|
|
160
|
+
*
|
|
161
|
+
* It is not a real window and does not pretend to be one: there is no desktop,
|
|
162
|
+
* no z-order and no dock. What it is is a *frame that behaves* — the title bar
|
|
163
|
+
* drags, the corners resize, the three buttons are real buttons with real names
|
|
164
|
+
* — so a screenshot of an app, a demo of a feature or a piece of a landing page
|
|
165
|
+
* can be shown as the thing it will be rather than as a picture of it.
|
|
166
|
+
*
|
|
167
|
+
* Nothing here is transformed. A dragged window moves on `left` and `top` and a
|
|
168
|
+
* resized one changes `width` and `height`, which is what keeps the text inside
|
|
169
|
+
* it at whole pixels through both gestures — a `translate()` would resample
|
|
170
|
+
* every glyph in the window for the length of the drag, which is exactly what
|
|
171
|
+
* the house rule against transforming a surface exists to prevent.
|
|
172
|
+
*
|
|
173
|
+
* `minimize` rolls the window up to its title bar rather than sending it
|
|
174
|
+
* anywhere, because a page has nowhere to send it to. `maximize` fills whatever
|
|
175
|
+
* is holding the window, which is the container for `position="absolute"` and
|
|
176
|
+
* the viewport for `fixed`.
|
|
177
|
+
*/
|
|
178
|
+
export declare const WindowPane: React.ForwardRefExoticComponent<WindowPaneProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import{useRender as r}from"@base-ui/react/use-render";import{actionMessages as o,useMessages as s,windowMessages as a}from"../../internal/i18n.js";import{cx as l,hasContent as d,iconClasses as c,surfaceClasses as u}from"../../internal/styles.js";import{WindowControls as m,orderControls as h,windowChrome as g,windowMetrics as w,windowSlots as f}from"../../internal/window.js";function p(e,t,n){const[r,o]=i.useState(t),s=void 0!==e;return[s?e:r,i.useCallback(e=>{s||o(e),n?.(e)},[s,n])]}const b=[{edge:"n",className:"inset-x-3 top-0 h-1.5 cursor-ns-resize"},{edge:"s",className:"inset-x-3 bottom-0 h-1.5 cursor-ns-resize"},{edge:"w",className:"inset-y-3 left-0 w-1.5 cursor-ew-resize"},{edge:"e",className:"inset-y-3 right-0 w-1.5 cursor-ew-resize"},{edge:"nw",className:"top-0 left-0 size-3 cursor-nwse-resize"},{edge:"ne",className:"top-0 right-0 size-3 cursor-nesw-resize"},{edge:"sw",className:"bottom-0 left-0 size-3 cursor-nesw-resize"},{edge:"se",className:"right-0 bottom-0 size-3 cursor-nwse-resize"}];export const WindowPane=/*@__PURE__*/i.forwardRef(function({os:v="macos",title:x,icon:y,actions:z,controls:E=!0,size:N="md",color:k="primary",accent:C=!1,transparency:L=0,active:M,elevation:S=2,position:P="static",draggable:R=!1,resizable:I=!1,width:j,height:B,minWidth:D=180,minHeight:A,offset:T,defaultOffset:H,onOffsetChange:W,onResize:O,open:X,defaultOpen:$=!0,onOpenChange:F,minimized:Y,defaultMinimized:_=!1,onMinimizedChange:q,maximized:K,defaultMaximized:U=!1,onMaximizedChange:V,scroll:G=!0,locale:J,minimizeLabel:Q,maximizeLabel:Z,restoreLabel:ee,closeLabel:te,resizeLabel:ne,render:ie,className:re,style:oe,children:se,...ae},le){const de=s(a,J),ce=s(o,J),ue=g(v),me=w(v,N),he=i.useId(),[ge,we]=p(X,$,F),[fe,pe]=p(Y,_,q),[be,ve]=p(K,U,V),[xe,ye]=p(T,H??{x:0,y:0},W),[ze,Ee]=i.useState(null),[Ne,ke]=i.useState(!0),Ce=M??Ne,[Le,Me]=i.useState(null),[Se,Pe]=i.useState(null),[Re,Ie]=i.useState(!1),[je,Be]=i.useState(!1),[De,Ae]=i.useState(ge);De!==ge&&(Ae(ge),Be(!ge)),i.useEffect(()=>{if(!je)return;const e=window.setTimeout(()=>Be(!1),260);return()=>window.clearTimeout(e)},[je]);const Te=i.useRef(null),He=i.useCallback(e=>{Te.current=e,"function"==typeof le?le(e):le&&(le.current=e)},[le]);i.useEffect(()=>{if(void 0!==M)return;const e=Te.current;if(!e)return;const t=t=>{const n=t.target;if(!(n instanceof Node))return;if(e.contains(n))return void ke(!0);const i=n instanceof Element?n:n.parentElement;i?.closest(".neba-window")&&ke(!1)};return document.addEventListener("pointerdown",t,!0),document.addEventListener("focusin",t,!0),()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("focusin",t,!0)}},[M]);const We=i.useRef(null);function Oe(e,t){if(0!==e.button)return;We.current?.();const n=e.currentTarget;n.setPointerCapture(e.pointerId),n.dataset.dragging="true",Ie(!0);const i=e.clientX,r=e.clientY,o=document.body.style.getPropertyValue("-webkit-user-select");document.body.style.setProperty("-webkit-user-select","none");const s=e=>{t(e.clientX-i,e.clientY-r)},a=()=>{We.current=null,Ie(!1),n.removeEventListener("pointermove",s),n.removeEventListener("pointerup",a),n.removeEventListener("pointercancel",a),delete n.dataset.dragging,o?document.body.style.setProperty("-webkit-user-select",o):document.body.style.removeProperty("-webkit-user-select")};We.current=a,n.addEventListener("pointermove",s),n.addEventListener("pointerup",a),n.addEventListener("pointercancel",a)}i.useEffect(()=>()=>We.current?.(),[]);const Xe={width:Math.max(0,D),height:Math.max(me.bar,A??me.bar)};function $e(e){Ee(e),O?.(e)}const Fe=h(v,!0===E?["minimize","maximize","close"]:!1===E?[]:E),Ye=Fe.includes("maximize");i.useEffect(()=>{if(fe||null===Se)return;const e=window.setTimeout(()=>Pe(null),400);return()=>window.clearTimeout(e)},[fe,Se]);const _e={minimize:Q??de.minimize,maximize:Z??de.maximize,restore:ee??de.restore,close:te??ce.close},qe=e(m,{os:v,metrics:me,controls:Fe,maximized:be,active:Ce,labels:_e,onCommand:function(e){"close"===e?we(!1):"minimize"===e?function(e){const t=Te.current,n=t?.firstElementChild;if(t&&n instanceof HTMLElement&&Me(n.offsetHeight+(t.offsetHeight-t.clientHeight)),e&&void 0===(ze?.height??B)&&t)return Pe(t.getBoundingClientRect().height),void requestAnimationFrame(()=>pe(!0));pe(e)}(!fe):ve(!be)}}),Ke=d(x)?e("span",{id:he,className:"min-w-0 truncate",children:x}):null,Ue=d(y)?e("span",{className:"flex shrink-0 items-center",children:y}):null,Ve=t("div",{className:l("relative flex shrink-0 items-center select-none",c,R&&!be?"cursor-grab active:cursor-grabbing":""),style:{height:me.bar,textShadow:"var(--n-window-bar-shadow)",fontWeight:me.weight,paddingInlineStart:me.padX,paddingInlineEnd:me.padEnd,gap:Math.round(.7*me.title),fontSize:me.title,backgroundColor:"var(--n-window-bar)",backgroundImage:"var(--n-window-bar-image)",color:"var(--n-window-bar-fg)",borderBlockEnd:ue.rule?"1px solid var(--n-window-line)":void 0},onPointerDown:function(e){if(!R||be)return;const t={...xe};Oe(e,(e,n)=>ye({x:t.x+e,y:t.y+n}))},onDoubleClick:Ye?()=>ve(!be):void 0,children:["start"===ue.controlsSide?qe:null,"center"===ue.titleAlign?e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 flex items-center justify-center",style:{paddingInline:me.controlsWidth(Fe.length)+2*me.padX},children:t("span",{className:"flex min-w-0 items-center",style:{gap:Math.round(.5*me.title)},children:[Ue,Ke]})}):t(n,{children:[Ue,Ke]}),e("span",{className:"flex-1"}),d(z)?e("span",{className:"flex shrink-0 items-center",style:{gap:Math.round(.5*me.title)},onPointerDown:e=>e.stopPropagation(),children:z}):null,"end"===ue.controlsSide?qe:null]}),Ge=be?{left:0,top:0,width:"100%",height:"100%"}:{left:xe.x,top:xe.y,width:ze?.width??j,height:fe?Le??me.bar:ze?.height??B??Se??void 0},Je=r({render:ie,ref:He,props:{role:"group","aria-labelledby":Ke?he:void 0,className:l("neba-window relative flex min-w-0 flex-col overflow-hidden",L>0?u:"",ue.glass&&0===L?"[backdrop-filter:var(--neba-blur)]":"","[transition-property:left,top,width,height,opacity,box-shadow,background-color,border-color,border-radius]","[transition-duration:var(--neba-duration-window)]","[transition-timing-function:var(--neba-ease)]","motion-reduce:[transition-duration:0ms]","data-[gesture]:[transition-property:none]",re),"data-gesture":Re?"":void 0,inert:!ge||void 0,style:{opacity:ge?void 0:0,...f({os:v,color:k,accent:C,transparency:L,active:Ce,elevation:S}),position:"static"===P?"relative":P,...Ge,borderRadius:be?0:`${me.radius}px ${me.radius}px ${me.radiusBottom}px ${me.radiusBottom}px`,borderStyle:"solid",borderWidth:me.frame,borderColor:"var(--n-window-line)",backgroundColor:"var(--n-window-band)",boxShadow:"var(--n-window-shadow), var(--neba-plate-glass)",...oe},children:t(n,{children:[Ve,e("div",{className:l("min-h-0 flex-1",G?"overflow-auto":"overflow-hidden"),style:{backgroundColor:"var(--n-window-body)",marginInline:me.band.side,marginBottom:me.band.bottom,boxShadow:me.band.side>0?"inset 0 0 0 1px rgb(0 0 0 / 0.12)":void 0},inert:fe,children:se}),!I||be||fe?null:b.map(t=>{const n="se"===t.edge;return e("div",{role:n?"button":void 0,tabIndex:n?0:void 0,"aria-label":n?ne??de.resize:void 0,"aria-hidden":n?void 0:"true",className:l("absolute z-10 touch-none",t.className,n?"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]":""),onPointerDown:e=>function(e,t){const n=Te.current;if(!n||be)return;const i=n.getBoundingClientRect(),r={width:i.width,height:i.height,x:xe.x,y:xe.y},o=e.includes("e"),s=e.includes("w"),a=e.includes("n"),l=e.includes("s");Oe(t,(e,t)=>{let{width:n,height:i}=r,{x:d,y:c}=r;o&&(n=Math.max(Xe.width,r.width+e)),l&&(i=Math.max(Xe.height,r.height+t)),s&&(n=Math.max(Xe.width,r.width-e),d=r.x+(r.width-n)),a&&(i=Math.max(Xe.height,r.height-t),c=r.y+(r.height-i)),$e({width:n,height:i}),(s||a)&&ye({x:d,y:c})})}(t.edge,e),onKeyDown:n?e=>{const t={ArrowRight:[16,0],ArrowLeft:[-16,0],ArrowDown:[0,16],ArrowUp:[0,-16]}[e.key];t&&(e.preventDefault(),function(e,t){const n=Te.current;if(!n)return;const i=n.getBoundingClientRect();$e({width:Math.max(Xe.width,i.width+e),height:Math.max(Xe.height,i.height+t)})}(t[0],t[1]))}:void 0},t.edge)})]}),...ae}});return ge||je?Je:null});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{WindowPane}from"./WindowPane.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,89 +1,92 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './components/accordion';
|
|
3
|
-
export * from './components/alert';
|
|
4
|
-
export * from './components/animate-appear';
|
|
5
|
-
export * from './components/animate-blink';
|
|
6
|
-
export * from './components/animate-fade';
|
|
7
|
-
export * from './components/animate-grow';
|
|
8
|
-
export * from './components/animate-headline';
|
|
9
|
-
export * from './components/animate-lighting';
|
|
10
|
-
export * from './components/animate-marquee';
|
|
11
|
-
export * from './components/animate-rotate';
|
|
12
|
-
export * from './components/animate-slide';
|
|
13
|
-
export * from './components/animate-typing';
|
|
14
|
-
export * from './components/animate-zoom';
|
|
15
|
-
export * from './components/area-chart';
|
|
16
|
-
export * from './components/aspect-ratio';
|
|
17
|
-
export * from './components/avatar';
|
|
18
|
-
export * from './components/badge';
|
|
19
|
-
export * from './components/bar-chart';
|
|
20
|
-
export * from './components/blockquote';
|
|
21
|
-
export * from './components/bottom-navigation';
|
|
22
|
-
export * from './components/box';
|
|
23
|
-
export * from './components/breadcrumb';
|
|
24
|
-
export * from './components/button';
|
|
25
|
-
export * from './components/button-group';
|
|
26
|
-
export * from './components/card';
|
|
27
|
-
export * from './components/carousel';
|
|
28
|
-
export * from './components/chat-bubble';
|
|
29
|
-
export * from './components/checkbox';
|
|
30
|
-
export * from './components/chip';
|
|
31
|
-
export * from './components/collapsible';
|
|
32
|
-
export * from './components/color-picker';
|
|
33
|
-
export * from './components/combobox';
|
|
34
|
-
export * from './components/container';
|
|
35
|
-
export * from './components/data-table';
|
|
36
|
-
export * from './components/date-picker';
|
|
37
|
-
export * from './components/date-range-picker';
|
|
38
|
-
export * from './components/date-time-picker';
|
|
39
|
-
export * from './components/dialog';
|
|
40
|
-
export * from './components/divider';
|
|
41
|
-
export * from './components/drawer';
|
|
42
|
-
export * from './components/empty';
|
|
43
|
-
export * from './components/file-picker';
|
|
44
|
-
export * from './components/grid';
|
|
45
|
-
export * from './components/floating-action-button';
|
|
46
|
-
export * from './components/
|
|
47
|
-
export * from './components/
|
|
48
|
-
export * from './components/
|
|
49
|
-
export * from './components/
|
|
50
|
-
export * from './components/icon
|
|
51
|
-
export * from './components/
|
|
52
|
-
export * from './components/
|
|
53
|
-
export * from './components/
|
|
54
|
-
export * from './components/
|
|
55
|
-
export * from './components/
|
|
56
|
-
export * from './components/
|
|
57
|
-
export * from './components/
|
|
58
|
-
export * from './components/
|
|
59
|
-
export * from './components/
|
|
60
|
-
export * from './components/
|
|
61
|
-
export * from './components/
|
|
62
|
-
export * from './components/
|
|
63
|
-
export * from './components/
|
|
64
|
-
export * from './components/progress-
|
|
65
|
-
export * from './components/progress-
|
|
66
|
-
export * from './components/
|
|
67
|
-
export * from './components/
|
|
68
|
-
export * from './components/
|
|
69
|
-
export * from './components/
|
|
70
|
-
export * from './components/
|
|
71
|
-
export * from './components/
|
|
72
|
-
export * from './components/
|
|
73
|
-
export * from './components/
|
|
74
|
-
export * from './components/
|
|
75
|
-
export * from './components/
|
|
76
|
-
export * from './components/
|
|
77
|
-
export * from './components/
|
|
78
|
-
export * from './components/
|
|
79
|
-
export * from './components/
|
|
80
|
-
export * from './components/
|
|
81
|
-
export * from './components/
|
|
82
|
-
export * from './components/
|
|
83
|
-
export * from './components/
|
|
84
|
-
export * from './components/
|
|
85
|
-
export * from './components/
|
|
86
|
-
export * from './components/
|
|
87
|
-
export * from './components/
|
|
88
|
-
export * from './components/
|
|
89
|
-
export * from './components/
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './components/accordion/index.js';
|
|
3
|
+
export * from './components/alert/index.js';
|
|
4
|
+
export * from './components/animate-appear/index.js';
|
|
5
|
+
export * from './components/animate-blink/index.js';
|
|
6
|
+
export * from './components/animate-fade/index.js';
|
|
7
|
+
export * from './components/animate-grow/index.js';
|
|
8
|
+
export * from './components/animate-headline/index.js';
|
|
9
|
+
export * from './components/animate-lighting/index.js';
|
|
10
|
+
export * from './components/animate-marquee/index.js';
|
|
11
|
+
export * from './components/animate-rotate/index.js';
|
|
12
|
+
export * from './components/animate-slide/index.js';
|
|
13
|
+
export * from './components/animate-typing/index.js';
|
|
14
|
+
export * from './components/animate-zoom/index.js';
|
|
15
|
+
export * from './components/area-chart/index.js';
|
|
16
|
+
export * from './components/aspect-ratio/index.js';
|
|
17
|
+
export * from './components/avatar/index.js';
|
|
18
|
+
export * from './components/badge/index.js';
|
|
19
|
+
export * from './components/bar-chart/index.js';
|
|
20
|
+
export * from './components/blockquote/index.js';
|
|
21
|
+
export * from './components/bottom-navigation/index.js';
|
|
22
|
+
export * from './components/box/index.js';
|
|
23
|
+
export * from './components/breadcrumb/index.js';
|
|
24
|
+
export * from './components/button/index.js';
|
|
25
|
+
export * from './components/button-group/index.js';
|
|
26
|
+
export * from './components/card/index.js';
|
|
27
|
+
export * from './components/carousel/index.js';
|
|
28
|
+
export * from './components/chat-bubble/index.js';
|
|
29
|
+
export * from './components/checkbox/index.js';
|
|
30
|
+
export * from './components/chip/index.js';
|
|
31
|
+
export * from './components/collapsible/index.js';
|
|
32
|
+
export * from './components/color-picker/index.js';
|
|
33
|
+
export * from './components/combobox/index.js';
|
|
34
|
+
export * from './components/container/index.js';
|
|
35
|
+
export * from './components/data-table/index.js';
|
|
36
|
+
export * from './components/date-picker/index.js';
|
|
37
|
+
export * from './components/date-range-picker/index.js';
|
|
38
|
+
export * from './components/date-time-picker/index.js';
|
|
39
|
+
export * from './components/dialog/index.js';
|
|
40
|
+
export * from './components/divider/index.js';
|
|
41
|
+
export * from './components/drawer/index.js';
|
|
42
|
+
export * from './components/empty/index.js';
|
|
43
|
+
export * from './components/file-picker/index.js';
|
|
44
|
+
export * from './components/grid/index.js';
|
|
45
|
+
export * from './components/floating-action-button/index.js';
|
|
46
|
+
export * from './components/floating-bottom-navigation/index.js';
|
|
47
|
+
export * from './components/grid-container/index.js';
|
|
48
|
+
export * from './components/heatmap-chart/index.js';
|
|
49
|
+
export * from './components/highlight/index.js';
|
|
50
|
+
export * from './components/icon/index.js';
|
|
51
|
+
export * from './components/icon-button/index.js';
|
|
52
|
+
export * from './components/line-chart/index.js';
|
|
53
|
+
export * from './components/list/index.js';
|
|
54
|
+
export * from './components/menu/index.js';
|
|
55
|
+
export * from './components/mockup/index.js';
|
|
56
|
+
export * from './components/number-field/index.js';
|
|
57
|
+
export * from './components/otp-field/index.js';
|
|
58
|
+
export * from './components/overlay/index.js';
|
|
59
|
+
export * from './components/pagination/index.js';
|
|
60
|
+
export * from './components/panes/index.js';
|
|
61
|
+
export * from './components/pie-chart/index.js';
|
|
62
|
+
export * from './components/pill/index.js';
|
|
63
|
+
export * from './components/popover/index.js';
|
|
64
|
+
export * from './components/progress-box/index.js';
|
|
65
|
+
export * from './components/progress-circular/index.js';
|
|
66
|
+
export * from './components/progress-linear/index.js';
|
|
67
|
+
export * from './components/radio-group/index.js';
|
|
68
|
+
export * from './components/rating/index.js';
|
|
69
|
+
export * from './components/scatter-chart/index.js';
|
|
70
|
+
export * from './components/scroll-zone/index.js';
|
|
71
|
+
export * from './components/segmented-button/index.js';
|
|
72
|
+
export * from './components/select/index.js';
|
|
73
|
+
export * from './components/shortcut/index.js';
|
|
74
|
+
export * from './components/skeleton/index.js';
|
|
75
|
+
export * from './components/slider/index.js';
|
|
76
|
+
export * from './components/sparkline/index.js';
|
|
77
|
+
export * from './components/spoiler/index.js';
|
|
78
|
+
export * from './components/statistic/index.js';
|
|
79
|
+
export * from './components/switch/index.js';
|
|
80
|
+
export * from './components/table/index.js';
|
|
81
|
+
export * from './components/tabs/index.js';
|
|
82
|
+
export * from './components/text-field/index.js';
|
|
83
|
+
export * from './components/text-link/index.js';
|
|
84
|
+
export * from './components/time-picker/index.js';
|
|
85
|
+
export * from './components/timeline/index.js';
|
|
86
|
+
export * from './components/timeline-chart/index.js';
|
|
87
|
+
export * from './components/toast/index.js';
|
|
88
|
+
export * from './components/toolbar/index.js';
|
|
89
|
+
export * from './components/tooltip/index.js';
|
|
90
|
+
export * from './components/tree-view/index.js';
|
|
91
|
+
export * from './components/typography/index.js';
|
|
92
|
+
export * from './components/window-pane/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./types";export*from"./components/accordion";export*from"./components/alert";export*from"./components/animate-appear";export*from"./components/animate-blink";export*from"./components/animate-fade";export*from"./components/animate-grow";export*from"./components/animate-headline";export*from"./components/animate-lighting";export*from"./components/animate-marquee";export*from"./components/animate-rotate";export*from"./components/animate-slide";export*from"./components/animate-typing";export*from"./components/animate-zoom";export*from"./components/area-chart";export*from"./components/aspect-ratio";export*from"./components/avatar";export*from"./components/badge";export*from"./components/bar-chart";export*from"./components/blockquote";export*from"./components/bottom-navigation";export*from"./components/box";export*from"./components/breadcrumb";export*from"./components/button";export*from"./components/button-group";export*from"./components/card";export*from"./components/carousel";export*from"./components/chat-bubble";export*from"./components/checkbox";export*from"./components/chip";export*from"./components/collapsible";export*from"./components/color-picker";export*from"./components/combobox";export*from"./components/container";export*from"./components/data-table";export*from"./components/date-picker";export*from"./components/date-range-picker";export*from"./components/date-time-picker";export*from"./components/dialog";export*from"./components/divider";export*from"./components/drawer";export*from"./components/empty";export*from"./components/file-picker";export*from"./components/grid";export*from"./components/floating-action-button";export*from"./components/grid-container";export*from"./components/heatmap-chart";export*from"./components/highlight";export*from"./components/icon";export*from"./components/icon-button";export*from"./components/line-chart";export*from"./components/list";export*from"./components/menu";export*from"./components/mockup";export*from"./components/number-field";export*from"./components/otp-field";export*from"./components/overlay";export*from"./components/pagination";export*from"./components/panes";export*from"./components/pie-chart";export*from"./components/pill";export*from"./components/popover";export*from"./components/progress-box";export*from"./components/progress-circular";export*from"./components/progress-linear";export*from"./components/radio-group";export*from"./components/rating";export*from"./components/scatter-chart";export*from"./components/segmented-button";export*from"./components/select";export*from"./components/shortcut";export*from"./components/skeleton";export*from"./components/slider";export*from"./components/sparkline";export*from"./components/spoiler";export*from"./components/statistic";export*from"./components/switch";export*from"./components/table";export*from"./components/tabs";export*from"./components/text-field";export*from"./components/text-link";export*from"./components/time-picker";export*from"./components/timeline";export*from"./components/timeline-chart";export*from"./components/toast";export*from"./components/toolbar";export*from"./components/tooltip";export*from"./components/tree-view";export*from"./components/typography";
|
|
1
|
+
export*from"./types.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/container/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/dialog/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/file-picker/index.js";export*from"./components/grid/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/grid-container/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/mockup/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popover/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/shortcut/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/sparkline/index.js";export*from"./components/spoiler/index.js";export*from"./components/statistic/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toast/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tree-view/index.js";export*from"./components/typography/index.js";export*from"./components/window-pane/index.js";
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* components, and their logic stays in their own files.
|
|
29
29
|
*/
|
|
30
30
|
import * as React from 'react';
|
|
31
|
-
import type { NebaAnimateRepeat, NebaAnimateTrigger, NebaAnimation, NebaSide, NebaTransition } from '../types';
|
|
31
|
+
import type { NebaAnimateRepeat, NebaAnimateTrigger, NebaAnimation, NebaSide, NebaTransition } from '../types.js';
|
|
32
32
|
/**
|
|
33
33
|
* Which keyframe an effect runs.
|
|
34
34
|
*
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { NebaDensity, NebaSize } from '../types.js';
|
|
3
|
+
/** A destination's value. The same restraint Tabs and SegmentedButton put on theirs. */
|
|
4
|
+
export type BottomNavigationValue = string | number;
|
|
5
|
+
/**
|
|
6
|
+
* Which labels are drawn.
|
|
7
|
+
*
|
|
8
|
+
* - `all` — every destination is named. The only one that works for a reader
|
|
9
|
+
* who has not used the app before, and the default on the bar that spans an
|
|
10
|
+
* edge of the window.
|
|
11
|
+
* - `selected` — only the destination that is current. The bar keeps its height
|
|
12
|
+
* either way, because the named one is always the tallest; what changes is
|
|
13
|
+
* how much of the row is words. The names the other items lose are still in
|
|
14
|
+
* the document for a screen reader.
|
|
15
|
+
* - `none` — glyphs only, with every name read out but never drawn.
|
|
16
|
+
*/
|
|
17
|
+
export type BottomNavigationLabels = 'all' | 'selected' | 'none';
|
|
18
|
+
/**
|
|
19
|
+
* What an item inherits from the bar around it.
|
|
20
|
+
*
|
|
21
|
+
* The same arrangement ButtonGroup, List, Tabs and SegmentedButton use: `size`,
|
|
22
|
+
* `density` and which destination is current belong to the *set*. A bar whose
|
|
23
|
+
* third item is a size out is not a bar.
|
|
24
|
+
*
|
|
25
|
+
* It lives in `internal/` for the reason `menu.ts` does rather than the reason
|
|
26
|
+
* `button-group.ts` does: two bars provide it — BottomNavigation and
|
|
27
|
+
* FloatingBottomNavigation — and one item reads it. Keeping it in either bar's
|
|
28
|
+
* file would make the other one import its sibling to draw a row of buttons.
|
|
29
|
+
*/
|
|
30
|
+
export interface BottomNavigationContextValue {
|
|
31
|
+
value: BottomNavigationValue | null;
|
|
32
|
+
change: (value: BottomNavigationValue) => void;
|
|
33
|
+
size: NebaSize;
|
|
34
|
+
density: NebaDensity;
|
|
35
|
+
labels: BottomNavigationLabels;
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the bar around the item is the floating one.
|
|
39
|
+
*
|
|
40
|
+
* It is the shape of the item that differs and not its behaviour: a bar
|
|
41
|
+
* pinned to an edge divides its whole width between its destinations, while a
|
|
42
|
+
* lozenge hovering over the page is only as wide as what is in it, so its
|
|
43
|
+
* items are sized by their content and cut as stadiums rather than as sheets.
|
|
44
|
+
*/
|
|
45
|
+
floating: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare const BottomNavigationContext: React.Context<BottomNavigationContextValue>;
|
|
48
|
+
/**
|
|
49
|
+
* The row's floor, and the one number the two bars have to agree on.
|
|
50
|
+
*
|
|
51
|
+
* `md` is 56px, which is the height a bottom navigation has had since the first
|
|
52
|
+
* one — tall enough for a glyph with a word under it and short enough that it
|
|
53
|
+
* is not competing with the page it is on. A floating bar is the same object
|
|
54
|
+
* lifted off the edge, so it is the same height; the ladder around it keeps the
|
|
55
|
+
* same proportion to the glyph and the name it holds.
|
|
56
|
+
*/
|
|
57
|
+
export declare const barMinHeightClasses: Record<NebaSize, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"react";export const BottomNavigationContext=/*@__PURE__*/t.createContext({value:null,change:()=>{},size:"md",density:"default",labels:"all",disabled:!1,floating:!1});export const barMinHeightClasses={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-18"};
|
|
@@ -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
|
/**
|
|
4
4
|
* What a Button inherits from the ButtonGroup around it.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";export const ButtonGroupContext
|
|
1
|
+
import*as t from"react";export const ButtonGroupContext=/*@__PURE__*/t.createContext(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type TimeUnit } from './date';
|
|
3
|
-
import type { NebaColor, NebaDensity, NebaSize, NebaWeekday } from '../types';
|
|
2
|
+
import { type TimeUnit } from './date.js';
|
|
3
|
+
import type { NebaColor, NebaDensity, NebaSize, NebaWeekday } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* The calendar grid and the clock columns, written once for the four pickers.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{Button as r}from"../components/button/Button";import{ChevronIcon as a}from"./icons";import{controlHeightClasses as l,controlTextClasses as s,cx as i,gapClasses as c,metaTextClasses as u,pressTransitionClasses as d,srOnlyClasses as m,transitionClasses as h}from"./styles";import{addDays as g,addMonths as f,addYears as b,calendarWeeks as p,compareDay as v,daysInMonth as x,isDayOutside as w,isMonthBeforeYear as y,isSameDay as D,isSameMonth as N,isValidDate as S,makeDate as M,meridiemLabels as P,monthLabels as C,startOfDay as k,startOfMonth as Y,today as z,weekdayLabels as A,withTime as F,YEAR_PAGE_SIZE as E,yearPageStart as T}from"./date";import{dateFormatter as j}from"./format";export const defaultPickerLabels={previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",now:"Now",clear:"Clear",done:"Done",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End"};export function usePickerLabels(e){return o.useMemo(()=>e?{...defaultPickerLabels,...e}:defaultPickerLabels,[e])}const R={xs:"1.375rem",sm:"1.625rem",md:"2rem",lg:"2.5rem",xl:"3rem"},B={xs:"rounded-(--neba-radius-xs)",sm:"rounded-(--neba-radius-xs)",md:"rounded-(--neba-radius-sm)",lg:"rounded-(--neba-radius-md)",xl:"rounded-(--neba-radius-lg)"},H={xs:"rounded-s-(--neba-radius-xs)",sm:"rounded-s-(--neba-radius-xs)",md:"rounded-s-(--neba-radius-sm)",lg:"rounded-s-(--neba-radius-md)",xl:"rounded-s-(--neba-radius-lg)"},L={xs:"rounded-e-(--neba-radius-xs)",sm:"rounded-e-(--neba-radius-xs)",md:"rounded-e-(--neba-radius-sm)",lg:"rounded-e-(--neba-radius-md)",xl:"rounded-e-(--neba-radius-lg)"},K=["relative flex select-none items-center justify-center tabular-nums","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",h,d,"focus-visible:z-10 focus-visible:[outline:2px_solid_var(--n-ring)]","focus-visible:[outline-offset:-2px]"].join(" ");function O({children:n,label:o,selected:r,inRange:a=!1,rangeEdge:l=null,current:s=!1,muted:c=!1,disabled:u=!1,focused:d=!1,size:m,className:h,onClick:g,onPointerEnter:f,onKeyDown:b}){return t("button",{type:"button",role:"gridcell","aria-label":o,"aria-selected":r,"aria-current":s?"date":void 0,"aria-disabled":u||void 0,tabIndex:d?0:-1,"data-focus-target":d?"true":void 0,className:i(K,"start"===l?H[m]:"end"===l?L[m]:"middle"===l?"rounded-none":B[m],u?"cursor-not-allowed text-(--neba-disabled-fg)":r?"cursor-pointer bg-(--n-fill) font-semibold text-(--n-on-solid) hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)":a?"cursor-pointer bg-(--n-soft) text-(--neba-fg) hover:bg-(--n-soft-hover) active:bg-(--n-soft-press)":s?"cursor-pointer font-semibold text-(--n-accent) hover:bg-(--n-soft) active:bg-(--n-soft-press)":c?"cursor-pointer text-(--neba-muted-fg) hover:bg-(--n-soft) active:bg-(--n-soft-press)":"cursor-pointer text-(--neba-fg) hover:bg-(--n-soft) active:bg-(--n-soft-press)",h),onClick:()=>{u||g()},onPointerEnter:f,onKeyDown:b,children:[n,s?e("span",{"aria-hidden":"true",className:"absolute bottom-[0.18em] size-[0.22em] rounded-full bg-current"}):null]})}function U({size:o,color:u,view:d,month:m,locale:h,labels:g,showPreviousButton:f,showNextButton:b,onStep:p,onViewChange:v}){const x=C(h,"long")[m.getMonth()],w=String(m.getFullYear()),D=y(h),N="day"===d?[g.previousMonth,g.nextMonth]:"month"===d?[g.previousYear,g.nextYear]:[g.previousYears,g.nextYears],S=(t,n)=>n?e(r,{variant:"text",size:o,color:u,density:"compact","aria-label":N[-1===t?0:1],onClick:()=>p(t),startIcon:e("span",{className:i("flex items-center",-1===t?"rotate-90 rtl:-rotate-90":"-rotate-90 rtl:rotate-90"),children:e(a,{})})}):e("span",{"aria-hidden":"true",className:i(l[o],"w-(--n-cell)")}),M=t=>e("span",{className:i("flex items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]",t&&"rotate-180"),children:e(a,{})}),P=e(r,{variant:"text",size:o,color:u,density:"compact","aria-label":g.chooseMonth,"aria-expanded":"month"===d,onClick:()=>v("month"===d?"day":"month"),endIcon:M("month"===d),children:x},"month"),k=e(r,{variant:"text",size:o,color:u,density:"compact",className:"tabular-nums","aria-label":g.chooseYear,"aria-expanded":"year"===d,onClick:()=>v("year"===d?"day":"year"),endIcon:M("year"===d),children:w},"year"),Y=T(m.getFullYear());return t("div",{className:"flex items-center justify-between gap-1",children:[S(-1,f),e("div",{className:i("flex min-w-0 flex-1 items-center justify-center",c[o]),children:"year"===d?e("span",{className:i("flex items-center font-medium tabular-nums text-(--neba-fg)",l[o],s[o]),children:`${Y}–${Y+E-1}`}):"month"===d?k:t(n,D?{children:[P,k]}:{children:[k,P]})}),S(1,b)]})}export function Calendar({size:n,color:r,locale:a,weekStartsOn:l,month:s,onMonthChange:u,selected:d,rangeStart:m=null,rangeEnd:h=null,onSelect:g,onPreviewChange:p,minDate:v,maxDate:x,shouldDisableDate:y,showOutsideDays:D=!0,autoFocus:P=!1,showPreviousButton:C=!0,showNextButton:A=!0,labels:F,className:T}){const[j,B]=o.useState("day"),H=o.useMemo(()=>d.filter(S),[d]),[L,K]=o.useState(()=>{const e=H.find(e=>N(e,s));return e?k(e):N(z(),s)?z():Y(s)}),O=o.useRef(P),_=o.useRef(null);o.useEffect(()=>{K(e=>N(e,s)?e:Y(s))},[s]),o.useLayoutEffect(()=>{O.current&&(O.current=!1,_.current?.querySelector('[data-focus-target="true"]')?.focus({preventScroll:!0}))});const V=o.useCallback(e=>w(e,v,x)||(y?.(e)??!1),[v,x,y]),G=e=>{O.current=!0,B(e)},J=e=>{O.current=!0,u(e)};return t("div",{ref:_,className:i("flex flex-col",c[n],T),style:{"--n-cell":R[n]},onPointerLeave:()=>p?.(null),children:[e(U,{size:n,color:r,view:j,month:s,locale:a,labels:F,showPreviousButton:C,showNextButton:A,onStep:e=>{u("day"===j?f(s,e):b(s,"month"===j?e:e*E))},onViewChange:G}),e("div",{className:"h-[calc(var(--n-cell)*7)] w-[calc(var(--n-cell)*7)]",children:"day"===j?e(q,{size:n,locale:a,weekStartsOn:l,month:s,chosen:H,rangeStart:m,rangeEnd:h,focusedDate:L,showOutsideDays:D,isDisabled:V,onSelect:e=>{K(e),g(e)},onPreviewChange:p,onMoveFocus:e=>{O.current=!0,K(e),N(e,s)||u(Y(e))}}):"month"===j?e(I,{size:n,locale:a,month:s,chosen:H,minDate:v,maxDate:x,onMoveCursor:J,onPick:e=>{u(M(s.getFullYear(),e,1)),G("day")}}):e($,{size:n,month:s,chosen:H,minDate:v,maxDate:x,onMoveCursor:J,onPick:e=>{u(M(e,s.getMonth(),1)),G("month")}})})]})}function q({size:n,locale:o,weekStartsOn:r,month:a,chosen:l,rangeStart:c,rangeEnd:d,focusedDate:m,showOutsideDays:h,isDisabled:b,onSelect:x,onPreviewChange:w,onMoveFocus:y}){const M=p(a,r),P=A(o,r,"short"),C=A(o,r,"long"),k=j(o,{dateStyle:"full"}),Y=(E=d,S(F=c)&&S(E)?v(F,E)<=0?[F,E]:[E,F]:null);var F,E;const T=z();return t("div",{role:"grid",className:"flex h-full flex-col",children:[e("div",{role:"row",className:"grid grid-cols-7",children:P.map((t,o)=>e("span",{role:"columnheader","aria-label":C[o],className:i("flex h-(--n-cell) items-center justify-center font-medium text-(--neba-muted-fg) select-none",u[n]),children:t},o))}),M.map((t,o)=>e("div",{role:"row",className:"grid grid-cols-7",children:t.map(t=>{const o=!N(t,a);if(o&&!h)return e("span",{role:"gridcell","aria-hidden":"true",className:"size-(--n-cell)"},t.getTime());const c=l.some(e=>D(e,t)),u=null!==Y&&v(t,Y[0])>=0&&v(t,Y[1])<=0,d=null!==Y&&u&&D(t,Y[0]),p=null!==Y&&u&&D(t,Y[1]);return e(O,{size:n,label:k.format(t),selected:c,inRange:u&&!c,rangeEdge:u?d&&p?"both":d?"start":p?"end":"middle":null,current:D(t,T)&&!c,muted:o,disabled:b(t),focused:D(t,m),className:i("size-(--n-cell)",s[n]),onClick:()=>x(t),onPointerEnter:()=>w?.(t),onKeyDown:e=>((e,t)=>{const n=(t.getDay()-r+7)%7,o={ArrowLeft:()=>g(t,-1),ArrowRight:()=>g(t,1),ArrowUp:()=>g(t,-7),ArrowDown:()=>g(t,7),Home:()=>g(t,-n),End:()=>g(t,6-n),PageUp:()=>f(t,e.shiftKey?-12:-1),PageDown:()=>f(t,e.shiftKey?12:1)}[e.key];o&&(e.preventDefault(),y(o()))})(e,t),children:t.getDate()},t.getTime())})},o))]})}function I({size:t,locale:n,month:o,chosen:r,minDate:a,maxDate:l,onMoveCursor:c,onPick:u}){const d=C(n,"short"),m=C(n,"long"),h=o.getFullYear(),g=new Date,b=e=>{const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];void 0!==t&&(e.preventDefault(),c(f(Y(o),t)))};return e("div",{role:"grid",className:"flex h-full flex-col justify-evenly",children:[0,1,2,3].map(n=>e("div",{role:"row",className:"grid grid-cols-3 gap-1",children:[0,1,2].map(c=>{const f=3*n+c,p=M(h,f,1),w=M(h,f,x(h,f));return e(O,{size:t,label:`${m[f]} ${h}`,selected:r.some(e=>e.getFullYear()===h&&e.getMonth()===f),current:g.getFullYear()===h&&g.getMonth()===f,disabled:S(a)&&v(w,a)<0||S(l)&&v(p,l)>0,focused:f===o.getMonth(),className:i("h-(--n-cell) w-full",s[t]),onClick:()=>u(f),onKeyDown:b,children:d[f]},f)})},n))})}function $({size:t,month:n,chosen:o,minDate:r,maxDate:a,onMoveCursor:l,onPick:c}){const u=T(n.getFullYear()),d=(new Date).getFullYear(),m=e=>{const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-4,ArrowDown:4,PageUp:-E,PageDown:E}[e.key];void 0!==t&&(e.preventDefault(),l(b(Y(n),t)))};return e("div",{role:"grid",className:"flex h-full flex-col justify-evenly",children:[0,1,2].map(l=>e("div",{role:"row",className:"grid grid-cols-4 gap-1",children:[0,1,2,3].map(h=>{const g=u+4*l+h;return e(O,{size:t,label:String(g),selected:o.some(e=>e.getFullYear()===g),current:g===d,disabled:S(r)&&g<r.getFullYear()||S(a)&&g>a.getFullYear(),focused:g===n.getFullYear(),className:i("h-(--n-cell) w-full",s[t]),onClick:()=>c(g),onKeyDown:m,children:g},g)})},l))})}function _(e){const t=e.parentElement;if(!t)return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.top-o.top-t.clientTop+t.scrollTop,a=r+n.height;r<t.scrollTop?t.scrollTop=r:a>t.scrollTop+t.clientHeight&&(t.scrollTop=a-t.clientHeight)}export function TimeGrid({size:n,density:r,locale:a,value:c,referenceDate:u,onChange:d,hour12:h,showSeconds:g,hourStep:f,minuteStep:b,secondStep:p,shouldDisableTime:v,autoFocus:x=!1,labels:w,className:y}){const D=c??u,N=o.useRef(null),[S,M]=o.useMemo(()=>P(a),[a]);o.useEffect(()=>{const e=N.current;if(e?.querySelectorAll('[data-chosen="true"]').forEach(_),x){const t=e?.querySelector('[role="listbox"]');(t?.querySelector('[data-chosen="true"]')??t?.querySelector('[role="option"]'))?.focus({preventScroll:!0})}},[x]);const C=o.useMemo(()=>{const e=Math.ceil((h?12:24)/f),t=Array.from({length:e},(e,t)=>t*f);return h?t.map(e=>0===e?12:e):t},[h,f]),k=o.useMemo(()=>Array.from({length:Math.ceil(60/b)},(e,t)=>t*b),[b]),Y=o.useMemo(()=>Array.from({length:Math.ceil(60/p)},(e,t)=>t*p),[p]),z=e=>String(e).padStart(2,"0"),A=h?D.getHours()%12||12:D.getHours(),E=(t,o,r,a,u)=>e("div",{role:"listbox","aria-label":o,className:i("flex flex-col gap-0.5 overflow-y-auto overscroll-contain","h-[calc(var(--n-cell)*7)] w-[calc(var(--n-cell)*2)]","scroll-py-0.5 [scrollbar-width:thin]"),children:r.map(o=>{const r=((e,t)=>F(D,"hour"===e?{hours:h?t%12+(D.getHours()>=12?12:0):t}:"minute"===e?{minutes:t}:"second"===e?{seconds:t}:{hours:D.getHours()%12+12*t}))(t,o),m=null!==c&&a(o),g=v?.(r,t)??!1;return e("button",{type:"button",role:"option","aria-selected":m,"aria-disabled":g||void 0,"data-chosen":m?"true":void 0,className:i(K,B[n],l[n],s[n],"w-full shrink-0",g?"cursor-not-allowed text-(--neba-disabled-fg)":m?"cursor-pointer bg-(--n-fill) font-semibold text-(--n-on-solid) hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)":"cursor-pointer text-(--neba-fg) hover:bg-(--n-soft) active:bg-(--n-soft-press)"),onClick:()=>{g||d(r)},children:u(o)},o)})},t);return t("div",{ref:N,className:i("flex","compact"===r?"gap-0.5":"gap-1",y),style:{"--n-cell":R[n]},children:[E("hour",w.hour,C,e=>e===A,e=>h?String(e):z(e)),E("minute",w.minute,k,e=>e===D.getMinutes(),z),g?E("second",w.second,Y,e=>e===D.getSeconds(),z):null,h?E("meridiem",w.meridiem,[0,1],e=>(D.getHours()>=12?1:0)===e,e=>0===e?S:M):null,e("span",{className:m,"aria-live":"polite",children:null===c?"":j(a,{hour:"numeric",minute:"2-digit",...g?{second:"2-digit"}:{}}).format(c)})]})}
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{Button as r}from"../components/button/Button.js";import{ChevronIcon as a}from"./icons.js";import{controlHeightClasses as l,controlTextClasses as s,cx as i,gapClasses as c,metaTextClasses as u,pressTransitionClasses as d,srOnlyClasses as m,transitionClasses as h}from"./styles.js";import{addDays as g,addMonths as f,addYears as b,calendarWeeks as p,compareDay as v,daysInMonth as x,isDayOutside as w,isMonthBeforeYear as y,isSameDay as D,isSameMonth as N,isValidDate as S,makeDate as M,meridiemLabels as P,monthLabels as C,startOfDay as k,startOfMonth as Y,today as z,weekdayLabels as A,withTime as F,YEAR_PAGE_SIZE as j,yearPageStart as E}from"./date.js";import{dateFormatter as T}from"./format.js";export const defaultPickerLabels={previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",now:"Now",clear:"Clear",done:"Done",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End"};export function usePickerLabels(e){return o.useMemo(()=>e?{...defaultPickerLabels,...e}:defaultPickerLabels,[e])}const R={xs:"1.375rem",sm:"1.625rem",md:"2rem",lg:"2.5rem",xl:"3rem"},B={xs:"rounded-(--neba-radius-xs)",sm:"rounded-(--neba-radius-xs)",md:"rounded-(--neba-radius-sm)",lg:"rounded-(--neba-radius-md)",xl:"rounded-(--neba-radius-lg)"},H={xs:"rounded-s-(--neba-radius-xs)",sm:"rounded-s-(--neba-radius-xs)",md:"rounded-s-(--neba-radius-sm)",lg:"rounded-s-(--neba-radius-md)",xl:"rounded-s-(--neba-radius-lg)"},L={xs:"rounded-e-(--neba-radius-xs)",sm:"rounded-e-(--neba-radius-xs)",md:"rounded-e-(--neba-radius-sm)",lg:"rounded-e-(--neba-radius-md)",xl:"rounded-e-(--neba-radius-lg)"},K=["relative flex select-none items-center justify-center tabular-nums","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",h,d,"focus-visible:z-10 focus-visible:[outline:2px_solid_var(--n-ring)]","focus-visible:[outline-offset:-2px]"].join(" ");function O({children:n,label:o,selected:r,inRange:a=!1,rangeEdge:l=null,current:s=!1,muted:c=!1,disabled:u=!1,focused:d=!1,size:m,className:h,onClick:g,onPointerEnter:f,onKeyDown:b}){return t("button",{type:"button",role:"gridcell","aria-label":o,"aria-selected":r,"aria-current":s?"date":void 0,"aria-disabled":u||void 0,tabIndex:d?0:-1,"data-focus-target":d?"true":void 0,className:i(K,"start"===l?H[m]:"end"===l?L[m]:"middle"===l?"rounded-none":B[m],u?"cursor-not-allowed text-(--neba-disabled-fg)":r?"cursor-pointer bg-(--n-fill) font-semibold text-(--n-on-solid) hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)":a?"cursor-pointer bg-(--n-soft) text-(--neba-fg) hover:bg-(--n-soft-hover) active:bg-(--n-soft-press)":s?"cursor-pointer font-semibold text-(--n-accent) hover:bg-(--n-soft) active:bg-(--n-soft-press)":c?"cursor-pointer text-(--neba-muted-fg) hover:bg-(--n-soft) active:bg-(--n-soft-press)":"cursor-pointer text-(--neba-fg) hover:bg-(--n-soft) active:bg-(--n-soft-press)",h),onClick:()=>{u||g()},onPointerEnter:f,onKeyDown:b,children:[n,s?e("span",{"aria-hidden":"true",className:"absolute bottom-[0.18em] size-[0.22em] rounded-full bg-current"}):null]})}function U({size:o,color:u,view:d,month:m,locale:h,labels:g,showPreviousButton:f,showNextButton:b,onStep:p,onViewChange:v}){const x=C(h,"long")[m.getMonth()],w=String(m.getFullYear()),D=y(h),N="day"===d?[g.previousMonth,g.nextMonth]:"month"===d?[g.previousYear,g.nextYear]:[g.previousYears,g.nextYears],S=(t,n)=>n?e(r,{variant:"text",size:o,color:u,density:"compact","aria-label":N[-1===t?0:1],onClick:()=>p(t),startIcon:e("span",{className:i("flex items-center",-1===t?"rotate-90 rtl:-rotate-90":"-rotate-90 rtl:rotate-90"),children:e(a,{})})}):e("span",{"aria-hidden":"true",className:i(l[o],"w-(--n-cell)")}),M=t=>e("span",{className:i("flex items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]",t&&"rotate-180"),children:e(a,{})}),P=e(r,{variant:"text",size:o,color:u,density:"compact","aria-label":g.chooseMonth,"aria-expanded":"month"===d,onClick:()=>v("month"===d?"day":"month"),endIcon:M("month"===d),children:x},"month"),k=e(r,{variant:"text",size:o,color:u,density:"compact",className:"tabular-nums","aria-label":g.chooseYear,"aria-expanded":"year"===d,onClick:()=>v("year"===d?"day":"year"),endIcon:M("year"===d),children:w},"year"),Y=E(m.getFullYear());return t("div",{className:"flex items-center justify-between gap-1",children:[S(-1,f),e("div",{className:i("flex min-w-0 flex-1 items-center justify-center",c[o]),children:"year"===d?e("span",{className:i("flex items-center font-medium tabular-nums text-(--neba-fg)",l[o],s[o]),children:`${Y}–${Y+j-1}`}):"month"===d?k:t(n,D?{children:[P,k]}:{children:[k,P]})}),S(1,b)]})}export function Calendar({size:n,color:r,locale:a,weekStartsOn:l,month:s,onMonthChange:u,selected:d,rangeStart:m=null,rangeEnd:h=null,onSelect:g,onPreviewChange:p,minDate:v,maxDate:x,shouldDisableDate:y,showOutsideDays:D=!0,autoFocus:P=!1,showPreviousButton:C=!0,showNextButton:A=!0,labels:F,className:E}){const[T,B]=o.useState("day"),H=o.useMemo(()=>d.filter(S),[d]),[L,K]=o.useState(()=>{const e=H.find(e=>N(e,s));return e?k(e):N(z(),s)?z():Y(s)}),O=o.useRef(P),_=o.useRef(null);o.useEffect(()=>{K(e=>N(e,s)?e:Y(s))},[s]),o.useLayoutEffect(()=>{O.current&&(O.current=!1,_.current?.querySelector('[data-focus-target="true"]')?.focus({preventScroll:!0}))});const V=o.useCallback(e=>w(e,v,x)||(y?.(e)??!1),[v,x,y]),G=e=>{O.current=!0,B(e)},J=e=>{O.current=!0,u(e)};return t("div",{ref:_,className:i("flex flex-col",c[n],E),style:{"--n-cell":R[n]},onPointerLeave:()=>p?.(null),children:[e(U,{size:n,color:r,view:T,month:s,locale:a,labels:F,showPreviousButton:C,showNextButton:A,onStep:e=>{u("day"===T?f(s,e):b(s,"month"===T?e:e*j))},onViewChange:G}),e("div",{className:"h-[calc(var(--n-cell)*7)] w-[calc(var(--n-cell)*7)]",children:"day"===T?e(q,{size:n,locale:a,weekStartsOn:l,month:s,chosen:H,rangeStart:m,rangeEnd:h,focusedDate:L,showOutsideDays:D,isDisabled:V,onSelect:e=>{K(e),g(e)},onPreviewChange:p,onMoveFocus:e=>{O.current=!0,K(e),N(e,s)||u(Y(e))}}):"month"===T?e(I,{size:n,locale:a,month:s,chosen:H,minDate:v,maxDate:x,onMoveCursor:J,onPick:e=>{u(M(s.getFullYear(),e,1)),G("day")}}):e($,{size:n,month:s,chosen:H,minDate:v,maxDate:x,onMoveCursor:J,onPick:e=>{u(M(e,s.getMonth(),1)),G("month")}})})]})}function q({size:n,locale:o,weekStartsOn:r,month:a,chosen:l,rangeStart:c,rangeEnd:d,focusedDate:m,showOutsideDays:h,isDisabled:b,onSelect:x,onPreviewChange:w,onMoveFocus:y}){const M=p(a,r),P=A(o,r,"short"),C=A(o,r,"long"),k=T(o,{dateStyle:"full"}),Y=(j=d,S(F=c)&&S(j)?v(F,j)<=0?[F,j]:[j,F]:null);var F,j;const E=z();return t("div",{role:"grid",className:"flex h-full flex-col",children:[e("div",{role:"row",className:"grid grid-cols-7",children:P.map((t,o)=>e("span",{role:"columnheader","aria-label":C[o],className:i("flex h-(--n-cell) items-center justify-center font-medium text-(--neba-muted-fg) select-none",u[n]),children:t},o))}),M.map((t,o)=>e("div",{role:"row",className:"grid grid-cols-7",children:t.map(t=>{const o=!N(t,a);if(o&&!h)return e("span",{role:"gridcell","aria-hidden":"true",className:"size-(--n-cell)"},t.getTime());const c=l.some(e=>D(e,t)),u=null!==Y&&v(t,Y[0])>=0&&v(t,Y[1])<=0,d=null!==Y&&u&&D(t,Y[0]),p=null!==Y&&u&&D(t,Y[1]);return e(O,{size:n,label:k.format(t),selected:c,inRange:u&&!c,rangeEdge:u?d&&p?"both":d?"start":p?"end":"middle":null,current:D(t,E)&&!c,muted:o,disabled:b(t),focused:D(t,m),className:i("size-(--n-cell)",s[n]),onClick:()=>x(t),onPointerEnter:()=>w?.(t),onKeyDown:e=>((e,t)=>{const n=(t.getDay()-r+7)%7,o={ArrowLeft:()=>g(t,-1),ArrowRight:()=>g(t,1),ArrowUp:()=>g(t,-7),ArrowDown:()=>g(t,7),Home:()=>g(t,-n),End:()=>g(t,6-n),PageUp:()=>f(t,e.shiftKey?-12:-1),PageDown:()=>f(t,e.shiftKey?12:1)}[e.key];o&&(e.preventDefault(),y(o()))})(e,t),children:t.getDate()},t.getTime())})},o))]})}function I({size:t,locale:n,month:o,chosen:r,minDate:a,maxDate:l,onMoveCursor:c,onPick:u}){const d=C(n,"short"),m=C(n,"long"),h=o.getFullYear(),g=new Date,b=e=>{const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];void 0!==t&&(e.preventDefault(),c(f(Y(o),t)))};return e("div",{role:"grid",className:"flex h-full flex-col justify-evenly",children:[0,1,2,3].map(n=>e("div",{role:"row",className:"grid grid-cols-3 gap-1",children:[0,1,2].map(c=>{const f=3*n+c,p=M(h,f,1),w=M(h,f,x(h,f));return e(O,{size:t,label:`${m[f]} ${h}`,selected:r.some(e=>e.getFullYear()===h&&e.getMonth()===f),current:g.getFullYear()===h&&g.getMonth()===f,disabled:S(a)&&v(w,a)<0||S(l)&&v(p,l)>0,focused:f===o.getMonth(),className:i("h-(--n-cell) w-full",s[t]),onClick:()=>u(f),onKeyDown:b,children:d[f]},f)})},n))})}function $({size:t,month:n,chosen:o,minDate:r,maxDate:a,onMoveCursor:l,onPick:c}){const u=E(n.getFullYear()),d=(new Date).getFullYear(),m=e=>{const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-4,ArrowDown:4,PageUp:-j,PageDown:j}[e.key];void 0!==t&&(e.preventDefault(),l(b(Y(n),t)))};return e("div",{role:"grid",className:"flex h-full flex-col justify-evenly",children:[0,1,2].map(l=>e("div",{role:"row",className:"grid grid-cols-4 gap-1",children:[0,1,2,3].map(h=>{const g=u+4*l+h;return e(O,{size:t,label:String(g),selected:o.some(e=>e.getFullYear()===g),current:g===d,disabled:S(r)&&g<r.getFullYear()||S(a)&&g>a.getFullYear(),focused:g===n.getFullYear(),className:i("h-(--n-cell) w-full",s[t]),onClick:()=>c(g),onKeyDown:m,children:g},g)})},l))})}function _(e){const t=e.parentElement;if(!t)return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.top-o.top-t.clientTop+t.scrollTop,a=r+n.height;r<t.scrollTop?t.scrollTop=r:a>t.scrollTop+t.clientHeight&&(t.scrollTop=a-t.clientHeight)}export function TimeGrid({size:n,density:r,locale:a,value:c,referenceDate:u,onChange:d,hour12:h,showSeconds:g,hourStep:f,minuteStep:b,secondStep:p,shouldDisableTime:v,autoFocus:x=!1,labels:w,className:y}){const D=c??u,N=o.useRef(null),[S,M]=o.useMemo(()=>P(a),[a]);o.useEffect(()=>{const e=N.current;if(e?.querySelectorAll('[data-chosen="true"]').forEach(_),x){const t=e?.querySelector('[role="listbox"]');(t?.querySelector('[data-chosen="true"]')??t?.querySelector('[role="option"]'))?.focus({preventScroll:!0})}},[x]);const C=o.useMemo(()=>{const e=Math.ceil((h?12:24)/f),t=Array.from({length:e},(e,t)=>t*f);return h?t.map(e=>0===e?12:e):t},[h,f]),k=o.useMemo(()=>Array.from({length:Math.ceil(60/b)},(e,t)=>t*b),[b]),Y=o.useMemo(()=>Array.from({length:Math.ceil(60/p)},(e,t)=>t*p),[p]),z=e=>String(e).padStart(2,"0"),A=h?D.getHours()%12||12:D.getHours(),j=(t,o,r,a,u)=>e("div",{role:"listbox","aria-label":o,className:i("flex flex-col gap-0.5 overflow-y-auto overscroll-contain","h-[calc(var(--n-cell)*7)] w-[calc(var(--n-cell)*2)]","scroll-py-0.5 [scrollbar-width:thin]"),children:r.map(o=>{const r=((e,t)=>F(D,"hour"===e?{hours:h?t%12+(D.getHours()>=12?12:0):t}:"minute"===e?{minutes:t}:"second"===e?{seconds:t}:{hours:D.getHours()%12+12*t}))(t,o),m=null!==c&&a(o),g=v?.(r,t)??!1;return e("button",{type:"button",role:"option","aria-selected":m,"aria-disabled":g||void 0,"data-chosen":m?"true":void 0,className:i(K,B[n],l[n],s[n],"w-full shrink-0",g?"cursor-not-allowed text-(--neba-disabled-fg)":m?"cursor-pointer bg-(--n-fill) font-semibold text-(--n-on-solid) hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)":"cursor-pointer text-(--neba-fg) hover:bg-(--n-soft) active:bg-(--n-soft-press)"),onClick:()=>{g||d(r)},children:u(o)},o)})},t);return t("div",{ref:N,className:i("flex","compact"===r?"gap-0.5":"gap-1",y),style:{"--n-cell":R[n]},children:[j("hour",w.hour,C,e=>e===A,e=>h?String(e):z(e)),j("minute",w.minute,k,e=>e===D.getMinutes(),z),g?j("second",w.second,Y,e=>e===D.getSeconds(),z):null,h?j("meridiem",w.meridiem,[0,1],e=>(D.getHours()>=12?1:0)===e,e=>0===e?S:M):null,e("span",{className:m,"aria-live":"polite",children:null===c?"":T(a,{hour:"numeric",minute:"2-digit",...g?{second:"2-digit"}:{}}).format(c)})]})}
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* element is, and nothing in here does arithmetic that is not layout.
|
|
17
17
|
*/
|
|
18
18
|
import * as React from 'react';
|
|
19
|
-
import { type BoxProps } from '../components/box/Box';
|
|
20
|
-
import { type BandScale, type ChartValue, type PlotBox, type ValueScale } from './chart';
|
|
21
|
-
import type { NebaChartAxis, NebaChartCategory, NebaChartLegend, NebaChartSeries, NebaChartTooltip, NebaSize } from '../types';
|
|
19
|
+
import { type BoxProps } from '../components/box/Box.js';
|
|
20
|
+
import { type BandScale, type ChartValue, type PlotBox, type ValueScale } from './chart.js';
|
|
21
|
+
import type { NebaChartAxis, NebaChartCategory, NebaChartLegend, NebaChartSeries, NebaChartTooltip, NebaSize } from '../types.js';
|
|
22
22
|
/**
|
|
23
23
|
* How wide the chart actually is, in pixels.
|
|
24
24
|
*
|