@eylulg/ui 1.2.0 → 2.0.1
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 +172 -223
- package/dist/components/{Avatar → atoms/Avatar}/Avatar.d.ts +3 -1
- package/dist/components/{Avatar → atoms/Avatar}/Avatar.js +4 -4
- package/dist/components/atoms/Avatar/Avatar.js.map +1 -0
- package/dist/components/{Avatar → atoms/Avatar}/index.d.ts +1 -1
- package/dist/components/atoms/Avatar/index.js +2 -0
- package/dist/components/{Badge → atoms/Badge}/Badge.d.ts +10 -6
- package/dist/components/{Badge → atoms/Badge}/Badge.js +12 -16
- package/dist/components/atoms/Badge/Badge.js.map +1 -0
- package/dist/components/atoms/Badge/index.d.ts +2 -0
- package/dist/components/atoms/BrandLoader/BrandLoader.d.ts +14 -0
- package/dist/components/atoms/BrandLoader/BrandLoader.js +57 -0
- package/dist/components/atoms/BrandLoader/BrandLoader.js.map +1 -0
- package/dist/components/atoms/BrandLoader/index.d.ts +2 -0
- package/dist/components/atoms/BrandLoader/index.js +2 -0
- package/dist/{chrome → components/atoms/BrandLogo}/BrandLogo.d.ts +1 -1
- package/dist/{chrome → components/atoms/BrandLogo}/BrandLogo.js +3 -4
- package/dist/components/atoms/BrandLogo/BrandLogo.js.map +1 -0
- package/dist/components/atoms/BrandLogo/index.d.ts +2 -0
- package/dist/components/atoms/BrandLogo/index.js +1 -0
- package/dist/components/{Button → atoms/Button}/Button.d.ts +13 -9
- package/dist/components/atoms/Button/Button.js +88 -0
- package/dist/components/atoms/Button/Button.js.map +1 -0
- package/dist/components/{Button → atoms/Button}/buttonStyles.d.ts +4 -6
- package/dist/components/atoms/Button/buttonStyles.js +25 -0
- package/dist/components/atoms/Button/buttonStyles.js.map +1 -0
- package/dist/components/atoms/Button/index.d.ts +2 -0
- package/dist/components/atoms/Button/index.js +4 -0
- package/dist/components/{Checkbox → atoms/Checkbox}/Checkbox.js +10 -14
- package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/atoms/IconButton/IconButton.d.ts +21 -0
- package/dist/components/atoms/IconButton/IconButton.js +43 -0
- package/dist/components/atoms/IconButton/IconButton.js.map +1 -0
- package/dist/components/{Kbd → atoms/Kbd}/Kbd.d.ts +2 -2
- package/dist/components/{Kbd → atoms/Kbd}/Kbd.js +9 -8
- package/dist/components/atoms/Kbd/Kbd.js.map +1 -0
- package/dist/components/atoms/NavItem/NavItem.d.ts +24 -0
- package/dist/components/atoms/NavItem/NavItem.js +42 -0
- package/dist/components/atoms/NavItem/NavItem.js.map +1 -0
- package/dist/components/atoms/NavItem/index.d.ts +2 -0
- package/dist/components/atoms/NavItem/index.js +1 -0
- package/dist/components/{ProgressBar → atoms/ProgressBar}/ProgressBar.d.ts +2 -2
- package/dist/components/{ProgressBar → atoms/ProgressBar}/ProgressBar.js +6 -5
- package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/components/atoms/ProgressBar/index.d.ts +2 -0
- package/dist/components/{Skeleton → atoms/Skeleton}/Skeleton.js +3 -5
- package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/{Spinner → atoms/Spinner}/Spinner.js +2 -2
- package/dist/components/atoms/Spinner/Spinner.js.map +1 -0
- package/dist/components/{Switch → atoms/Switch}/Switch.d.ts +3 -3
- package/dist/components/atoms/Switch/Switch.js +35 -0
- package/dist/components/atoms/Switch/Switch.js.map +1 -0
- package/dist/components/atoms/TextLink/TextLink.d.ts +18 -0
- package/dist/components/atoms/TextLink/TextLink.js +21 -0
- package/dist/components/atoms/TextLink/TextLink.js.map +1 -0
- package/dist/components/atoms/TextLink/index.d.ts +2 -0
- package/dist/components/atoms/TextLink/index.js +1 -0
- package/dist/components/{Tooltip → atoms/Tooltip}/Tooltip.js +4 -4
- package/dist/components/atoms/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/{Tooltip → atoms/Tooltip}/TooltipOverlay.js +2 -2
- package/dist/components/atoms/Tooltip/TooltipOverlay.js.map +1 -0
- package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/Breadcrumbs.js +5 -4
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/components/{Card → molecules/Card}/Card.d.ts +3 -1
- package/dist/components/{Card → molecules/Card}/Card.js +21 -13
- package/dist/components/molecules/Card/Card.js.map +1 -0
- package/dist/components/molecules/Card/index.d.ts +2 -0
- package/dist/components/{CodeBlock → molecules/CodeBlock}/CodeBlock.d.ts +7 -5
- package/dist/components/{CodeBlock → molecules/CodeBlock}/CodeBlock.js +20 -12
- package/dist/components/molecules/CodeBlock/CodeBlock.js.map +1 -0
- package/dist/components/{Combobox → molecules/Combobox}/Combobox.d.ts +4 -1
- package/dist/components/molecules/Combobox/Combobox.js +91 -0
- package/dist/components/molecules/Combobox/Combobox.js.map +1 -0
- package/dist/components/{DatePicker → molecules/DatePicker}/DatePicker.d.ts +7 -4
- package/dist/components/molecules/DatePicker/DatePicker.js +138 -0
- package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/molecules/Dialog/Dialog.d.ts +20 -0
- package/dist/components/{Dialog → molecules/Dialog}/Dialog.js +7 -7
- package/dist/components/molecules/Dialog/Dialog.js.map +1 -0
- package/dist/components/molecules/Dialog/DialogOverlay.d.ts +3 -0
- package/dist/components/molecules/Dialog/DialogOverlay.js +60 -0
- package/dist/components/molecules/Dialog/DialogOverlay.js.map +1 -0
- package/dist/components/molecules/Drawer/Drawer.d.ts +21 -0
- package/dist/components/{Drawer → molecules/Drawer}/Drawer.js +7 -7
- package/dist/components/molecules/Drawer/Drawer.js.map +1 -0
- package/dist/components/{Drawer → molecules/Drawer}/DrawerOverlay.d.ts +1 -1
- package/dist/components/molecules/Drawer/DrawerOverlay.js +66 -0
- package/dist/components/molecules/Drawer/DrawerOverlay.js.map +1 -0
- package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenu.d.ts +8 -9
- package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenu.js +8 -20
- package/dist/components/molecules/DropdownMenu/DropdownMenu.js.map +1 -0
- package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenuParts.d.ts +1 -1
- package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenuParts.js +17 -28
- package/dist/components/molecules/DropdownMenu/DropdownMenuParts.js.map +1 -0
- package/dist/components/{EmptyState → molecules/EmptyState}/EmptyState.d.ts +3 -4
- package/dist/components/{EmptyState → molecules/EmptyState}/EmptyState.js +6 -5
- package/dist/components/molecules/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/{FileDropZone → molecules/FileDropZone}/FileDropZone.d.ts +1 -1
- package/dist/components/{FileDropZone → molecules/FileDropZone}/FileDropZone.js +6 -5
- package/dist/components/molecules/FileDropZone/FileDropZone.js.map +1 -0
- package/dist/components/{Input → molecules/Input}/Input.d.ts +8 -6
- package/dist/components/molecules/Input/Input.js +45 -0
- package/dist/components/molecules/Input/Input.js.map +1 -0
- package/dist/components/molecules/Input/index.d.ts +2 -0
- package/dist/components/{Pagination → molecules/Pagination}/Pagination.d.ts +6 -2
- package/dist/components/{Pagination → molecules/Pagination}/Pagination.js +44 -34
- package/dist/components/molecules/Pagination/Pagination.js.map +1 -0
- package/dist/components/molecules/Pagination/index.d.ts +2 -0
- package/dist/components/molecules/Pagination/index.js +2 -0
- package/dist/components/{Popover → molecules/Popover}/Popover.d.ts +1 -1
- package/dist/components/{Popover → molecules/Popover}/Popover.js +7 -7
- package/dist/components/molecules/Popover/Popover.js.map +1 -0
- package/dist/components/{Popover → molecules/Popover}/PopoverOverlay.js +5 -4
- package/dist/components/molecules/Popover/PopoverOverlay.js.map +1 -0
- package/dist/components/molecules/RadioGroup/RadioGroup.js +43 -0
- package/dist/components/molecules/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/{SegmentedControl → molecules/SegmentedControl}/SegmentedControl.d.ts +6 -7
- package/dist/components/molecules/SegmentedControl/SegmentedControl.js +71 -0
- package/dist/components/molecules/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/molecules/SegmentedControl/index.d.ts +2 -0
- package/dist/components/{Select → molecules/Select}/Select.d.ts +4 -1
- package/dist/components/molecules/Select/Select.js +58 -0
- package/dist/components/molecules/Select/Select.js.map +1 -0
- package/dist/components/molecules/Stat/Stat.d.ts +36 -0
- package/dist/components/molecules/Stat/Stat.js +85 -0
- package/dist/components/molecules/Stat/Stat.js.map +1 -0
- package/dist/components/molecules/Stat/index.d.ts +2 -0
- package/dist/components/molecules/Stat/index.js +2 -0
- package/dist/components/{Tabs → molecules/Tabs}/Tabs.js +5 -5
- package/dist/components/molecules/Tabs/Tabs.js.map +1 -0
- package/dist/components/molecules/Tag/Tag.js +49 -0
- package/dist/components/molecules/Tag/Tag.js.map +1 -0
- package/dist/components/{Textarea → molecules/Textarea}/Textarea.d.ts +3 -11
- package/dist/components/molecules/Textarea/Textarea.js +29 -0
- package/dist/components/molecules/Textarea/Textarea.js.map +1 -0
- package/dist/components/molecules/Textarea/index.d.ts +2 -0
- package/dist/components/{Toast → molecules/Toast}/Toast.d.ts +12 -8
- package/dist/components/{Toast → molecules/Toast}/Toast.js +13 -18
- package/dist/components/molecules/Toast/Toast.js.map +1 -0
- package/dist/components/molecules/Toast/ToastItem.d.ts +6 -0
- package/dist/components/{Toast → molecules/Toast}/ToastItem.js +25 -27
- package/dist/components/molecules/Toast/ToastItem.js.map +1 -0
- package/dist/components/{Toast → molecules/Toast}/index.d.ts +1 -1
- package/dist/components/{Chart → organisms/Chart}/BarChart.d.ts +1 -1
- package/dist/components/organisms/Chart/BarChart.js +304 -0
- package/dist/components/organisms/Chart/BarChart.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/ChartFrame.d.ts +2 -2
- package/dist/components/{Chart → organisms/Chart}/ChartFrame.js +14 -18
- package/dist/components/organisms/Chart/ChartFrame.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/ChartLegend.d.ts +3 -2
- package/dist/components/{Chart → organisms/Chart}/ChartLegend.js +2 -2
- package/dist/components/organisms/Chart/ChartLegend.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/ChartTable.js +8 -12
- package/dist/components/organisms/Chart/ChartTable.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/ChartTooltip.d.ts +3 -2
- package/dist/components/{Chart → organisms/Chart}/ChartTooltip.js +3 -3
- package/dist/components/organisms/Chart/ChartTooltip.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/HeatGrid.d.ts +6 -3
- package/dist/components/organisms/Chart/HeatGrid.js +235 -0
- package/dist/components/organisms/Chart/HeatGrid.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/LineChart.d.ts +1 -1
- package/dist/components/organisms/Chart/LineChart.js +227 -0
- package/dist/components/organisms/Chart/LineChart.js.map +1 -0
- package/dist/components/organisms/Chart/Sparkline.d.ts +14 -0
- package/dist/components/organisms/Chart/Sparkline.js +39 -0
- package/dist/components/organisms/Chart/Sparkline.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/format.d.ts +2 -0
- package/dist/components/{Chart → organisms/Chart}/format.js +6 -4
- package/dist/components/organisms/Chart/format.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/geometry.js +1 -1
- package/dist/components/organisms/Chart/geometry.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/index.d.ts +2 -2
- package/dist/components/{Chart → organisms/Chart}/index.js +2 -2
- package/dist/components/{Chart → organisms/Chart}/interaction.d.ts +10 -6
- package/dist/components/{Chart → organisms/Chart}/interaction.js +13 -10
- package/dist/components/organisms/Chart/interaction.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/labels.js +1 -1
- package/dist/components/organisms/Chart/labels.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/scale.js +1 -1
- package/dist/components/organisms/Chart/scale.js.map +1 -0
- package/dist/components/organisms/Chart/series.d.ts +30 -0
- package/dist/components/organisms/Chart/series.js +108 -0
- package/dist/components/organisms/Chart/series.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/summary.js +2 -5
- package/dist/components/organisms/Chart/summary.js.map +1 -0
- package/dist/components/{Chart → organisms/Chart}/types.d.ts +2 -2
- package/dist/components/{Chart → organisms/Chart}/useElementWidth.js +1 -1
- package/dist/components/organisms/Chart/useElementWidth.js.map +1 -0
- package/dist/components/{CommandPalette → organisms/CommandPalette}/CommandPalette.d.ts +7 -8
- package/dist/components/{CommandPalette → organisms/CommandPalette}/CommandPalette.js +4 -10
- package/dist/components/organisms/CommandPalette/CommandPalette.js.map +1 -0
- package/dist/components/organisms/CommandPalette/CommandPaletteOverlay.d.ts +4 -0
- package/dist/components/organisms/CommandPalette/CommandPaletteOverlay.js +150 -0
- package/dist/components/organisms/CommandPalette/CommandPaletteOverlay.js.map +1 -0
- package/dist/components/{CommandPalette → organisms/CommandPalette}/index.d.ts +1 -1
- package/dist/components/{PageHeader → organisms/PageHeader}/PageHeader.js +5 -5
- package/dist/components/organisms/PageHeader/PageHeader.js.map +1 -0
- package/dist/{chrome → components/organisms/SidebarNav}/SidebarNav.d.ts +1 -1
- package/dist/{chrome → components/organisms/SidebarNav}/SidebarNav.js +18 -26
- package/dist/components/organisms/SidebarNav/SidebarNav.js.map +1 -0
- package/dist/components/organisms/SidebarNav/index.d.ts +2 -0
- package/dist/components/organisms/SidebarNav/index.js +2 -0
- package/dist/components/organisms/SiteFooter/SiteFooter.d.ts +33 -0
- package/dist/components/organisms/SiteFooter/SiteFooter.js +87 -0
- package/dist/components/organisms/SiteFooter/SiteFooter.js.map +1 -0
- package/dist/components/organisms/SiteFooter/index.d.ts +2 -0
- package/dist/components/organisms/SiteFooter/index.js +1 -0
- package/dist/components/{Table → organisms/Table}/Table.d.ts +9 -6
- package/dist/components/{Table → organisms/Table}/Table.js +36 -23
- package/dist/components/organisms/Table/Table.js.map +1 -0
- package/dist/components/organisms/ThemeToggle/ThemeToggle.d.ts +36 -0
- package/dist/components/organisms/ThemeToggle/ThemeToggle.js +88 -0
- package/dist/components/organisms/ThemeToggle/ThemeToggle.js.map +1 -0
- package/dist/components/organisms/ThemeToggle/ThemeToggleMenu.d.ts +14 -0
- package/dist/components/organisms/ThemeToggle/ThemeToggleMenu.js +50 -0
- package/dist/components/organisms/ThemeToggle/ThemeToggleMenu.js.map +1 -0
- package/dist/components/organisms/ThemeToggle/index.d.ts +2 -0
- package/dist/components/organisms/ThemeToggle/index.js +2 -0
- package/dist/components/organisms/ThemeToggle/themeChoices.d.ts +7 -0
- package/dist/components/organisms/ThemeToggle/themeChoices.js +17 -0
- package/dist/components/organisms/ThemeToggle/themeChoices.js.map +1 -0
- package/dist/components/organisms/TopNav/TopNav.d.ts +51 -0
- package/dist/components/organisms/TopNav/TopNav.js +148 -0
- package/dist/components/organisms/TopNav/TopNav.js.map +1 -0
- package/dist/components/organisms/TopNav/index.d.ts +2 -0
- package/dist/components/organisms/TopNav/index.js +2 -0
- package/dist/{chrome → components/templates/AppShell}/AppShell.d.ts +10 -6
- package/dist/{chrome → components/templates/AppShell}/AppShell.js +12 -17
- package/dist/components/templates/AppShell/AppShell.js.map +1 -0
- package/dist/components/templates/AppShell/index.d.ts +2 -0
- package/dist/components/templates/AppShell/index.js +1 -0
- package/dist/{chrome → data}/projects.d.ts +13 -6
- package/dist/{chrome → data}/projects.js +43 -14
- package/dist/data/projects.js.map +1 -0
- package/dist/fonts.css +27 -2
- package/dist/index.d.ts +56 -38
- package/dist/index.js +55 -42
- package/dist/internal/Field.d.ts +16 -11
- package/dist/internal/Field.js +30 -23
- package/dist/internal/Field.js.map +1 -1
- package/dist/internal/OverlayParts.d.ts +43 -0
- package/dist/internal/OverlayParts.js +43 -0
- package/dist/internal/OverlayParts.js.map +1 -0
- package/dist/internal/PreloadOnIntent.d.ts +2 -3
- package/dist/internal/PreloadOnIntent.js +3 -3
- package/dist/internal/PreloadOnIntent.js.map +1 -1
- package/dist/{chrome → internal}/brandLogoPath.js +1 -2
- package/dist/internal/brandLogoPath.js.map +1 -0
- package/dist/internal/button.d.ts +7 -0
- package/dist/internal/button.js +19 -0
- package/dist/internal/button.js.map +1 -0
- package/dist/internal/control.d.ts +32 -0
- package/dist/internal/control.js +59 -0
- package/dist/internal/control.js.map +1 -0
- package/dist/internal/focusRing.d.ts +7 -1
- package/dist/internal/focusRing.js +8 -3
- package/dist/internal/focusRing.js.map +1 -1
- package/dist/internal/layout.d.ts +9 -0
- package/dist/internal/layout.js +13 -0
- package/dist/internal/layout.js.map +1 -0
- package/dist/internal/lazyModule.d.ts +8 -2
- package/dist/internal/lazyModule.js +20 -6
- package/dist/internal/lazyModule.js.map +1 -1
- package/dist/internal/link.d.ts +3 -0
- package/dist/internal/link.js +10 -0
- package/dist/internal/link.js.map +1 -0
- package/dist/internal/listParts.d.ts +12 -0
- package/dist/internal/listParts.js +32 -0
- package/dist/internal/listParts.js.map +1 -0
- package/dist/internal/surfaces.d.ts +11 -5
- package/dist/internal/surfaces.js +13 -7
- package/dist/internal/surfaces.js.map +1 -1
- package/dist/internal/toggle.d.ts +8 -0
- package/dist/internal/toggle.js +22 -0
- package/dist/internal/toggle.js.map +1 -0
- package/dist/internal/types.d.ts +2 -5
- package/dist/{chrome → router}/Anchor.js +1 -2
- package/dist/{chrome → router}/Anchor.js.map +1 -1
- package/dist/{chrome → router}/LinkRouter.js +1 -1
- package/dist/{chrome → router}/LinkRouter.js.map +1 -1
- package/dist/{chrome → router}/types.d.ts +3 -3
- package/dist/styles/themes/variants.d.ts +0 -12
- package/dist/styles/themes/variants.js +3 -43
- package/dist/styles/themes/variants.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{chrome → theme}/themeScript.d.ts +2 -5
- package/dist/{chrome → theme}/themeScript.js +4 -7
- package/dist/theme/themeScript.js.map +1 -0
- package/dist/{chrome → theme}/useTheme.js +1 -1
- package/dist/theme/useTheme.js.map +1 -0
- package/dist/theme.css +87 -56
- package/dist/tokens.css +42 -48
- package/dist/utils/cx.d.ts +0 -12
- package/dist/utils/cx.js +18 -10
- package/dist/utils/cx.js.map +1 -1
- package/package.json +147 -107
- package/dist/chrome/AppShell.js.map +0 -1
- package/dist/chrome/BrandLogo.js.map +0 -1
- package/dist/chrome/BrandMark.d.ts +0 -12
- package/dist/chrome/BrandMark.js +0 -40
- package/dist/chrome/BrandMark.js.map +0 -1
- package/dist/chrome/MobileMenu.d.ts +0 -19
- package/dist/chrome/MobileMenu.js +0 -52
- package/dist/chrome/MobileMenu.js.map +0 -1
- package/dist/chrome/ProjectSwitcher.d.ts +0 -30
- package/dist/chrome/ProjectSwitcher.js +0 -64
- package/dist/chrome/ProjectSwitcher.js.map +0 -1
- package/dist/chrome/ProjectSwitcherMenu.d.ts +0 -13
- package/dist/chrome/ProjectSwitcherMenu.js +0 -50
- package/dist/chrome/ProjectSwitcherMenu.js.map +0 -1
- package/dist/chrome/SidebarNav.js.map +0 -1
- package/dist/chrome/SiteFooter.d.ts +0 -37
- package/dist/chrome/SiteFooter.js +0 -105
- package/dist/chrome/SiteFooter.js.map +0 -1
- package/dist/chrome/TextSizeToggle.d.ts +0 -11
- package/dist/chrome/TextSizeToggle.js +0 -38
- package/dist/chrome/TextSizeToggle.js.map +0 -1
- package/dist/chrome/ThemeToggle.d.ts +0 -26
- package/dist/chrome/ThemeToggle.js +0 -100
- package/dist/chrome/ThemeToggle.js.map +0 -1
- package/dist/chrome/ThemeToggleMenu.d.ts +0 -16
- package/dist/chrome/ThemeToggleMenu.js +0 -42
- package/dist/chrome/ThemeToggleMenu.js.map +0 -1
- package/dist/chrome/TopNav.d.ts +0 -42
- package/dist/chrome/TopNav.js +0 -117
- package/dist/chrome/TopNav.js.map +0 -1
- package/dist/chrome/brandLogoPath.js.map +0 -1
- package/dist/chrome/index.d.ts +0 -28
- package/dist/chrome/index.js +0 -15
- package/dist/chrome/projects.js.map +0 -1
- package/dist/chrome/themeChoices.d.ts +0 -6
- package/dist/chrome/themeChoices.js +0 -18
- package/dist/chrome/themeChoices.js.map +0 -1
- package/dist/chrome/themeScript.js.map +0 -1
- package/dist/chrome/useTextSize.d.ts +0 -16
- package/dist/chrome/useTextSize.js +0 -64
- package/dist/chrome/useTextSize.js.map +0 -1
- package/dist/chrome/useTheme.js.map +0 -1
- package/dist/components/Avatar/Avatar.js.map +0 -1
- package/dist/components/Avatar/index.js +0 -2
- package/dist/components/Badge/Badge.js.map +0 -1
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +0 -1
- package/dist/components/Button/Button.js +0 -73
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/buttonStyles.js +0 -32
- package/dist/components/Button/buttonStyles.js.map +0 -1
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Button/index.js +0 -4
- package/dist/components/Card/Card.js.map +0 -1
- package/dist/components/Card/index.d.ts +0 -2
- package/dist/components/Chart/BarChart.js +0 -327
- package/dist/components/Chart/BarChart.js.map +0 -1
- package/dist/components/Chart/ChartFrame.js.map +0 -1
- package/dist/components/Chart/ChartLegend.js.map +0 -1
- package/dist/components/Chart/ChartTable.js.map +0 -1
- package/dist/components/Chart/ChartTooltip.js.map +0 -1
- package/dist/components/Chart/HeatGrid.js +0 -256
- package/dist/components/Chart/HeatGrid.js.map +0 -1
- package/dist/components/Chart/LineChart.js +0 -248
- package/dist/components/Chart/LineChart.js.map +0 -1
- package/dist/components/Chart/format.js.map +0 -1
- package/dist/components/Chart/geometry.js.map +0 -1
- package/dist/components/Chart/interaction.js.map +0 -1
- package/dist/components/Chart/labels.js.map +0 -1
- package/dist/components/Chart/scale.js.map +0 -1
- package/dist/components/Chart/series.d.ts +0 -14
- package/dist/components/Chart/series.js +0 -72
- package/dist/components/Chart/series.js.map +0 -1
- package/dist/components/Chart/summary.js.map +0 -1
- package/dist/components/Chart/useElementWidth.js.map +0 -1
- package/dist/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/CodeBlock/CodeBlock.js.map +0 -1
- package/dist/components/Combobox/Combobox.js +0 -106
- package/dist/components/Combobox/Combobox.js.map +0 -1
- package/dist/components/CommandPalette/CommandPalette.js.map +0 -1
- package/dist/components/CommandPalette/CommandPaletteOverlay.d.ts +0 -11
- package/dist/components/CommandPalette/CommandPaletteOverlay.js +0 -180
- package/dist/components/CommandPalette/CommandPaletteOverlay.js.map +0 -1
- package/dist/components/DatePicker/DatePicker.js +0 -142
- package/dist/components/DatePicker/DatePicker.js.map +0 -1
- package/dist/components/Dialog/Dialog.d.ts +0 -37
- package/dist/components/Dialog/Dialog.js.map +0 -1
- package/dist/components/Dialog/DialogOverlay.d.ts +0 -3
- package/dist/components/Dialog/DialogOverlay.js +0 -72
- package/dist/components/Dialog/DialogOverlay.js.map +0 -1
- package/dist/components/Drawer/Drawer.d.ts +0 -36
- package/dist/components/Drawer/Drawer.js.map +0 -1
- package/dist/components/Drawer/DrawerOverlay.js +0 -71
- package/dist/components/Drawer/DrawerOverlay.js.map +0 -1
- package/dist/components/DropdownMenu/DropdownMenu.js.map +0 -1
- package/dist/components/DropdownMenu/DropdownMenuParts.js.map +0 -1
- package/dist/components/EmptyState/EmptyState.js.map +0 -1
- package/dist/components/FileDropZone/FileDropZone.js.map +0 -1
- package/dist/components/IconButton/IconButton.d.ts +0 -17
- package/dist/components/IconButton/IconButton.js +0 -37
- package/dist/components/IconButton/IconButton.js.map +0 -1
- package/dist/components/Input/Input.js +0 -43
- package/dist/components/Input/Input.js.map +0 -1
- package/dist/components/Input/index.d.ts +0 -2
- package/dist/components/Kbd/Kbd.js.map +0 -1
- package/dist/components/PageHeader/PageHeader.js.map +0 -1
- package/dist/components/Pagination/Pagination.js.map +0 -1
- package/dist/components/Pagination/index.d.ts +0 -2
- package/dist/components/Pagination/index.js +0 -2
- package/dist/components/Popover/Popover.js.map +0 -1
- package/dist/components/Popover/PopoverOverlay.js.map +0 -1
- package/dist/components/ProgressBar/ProgressBar.js.map +0 -1
- package/dist/components/ProgressBar/index.d.ts +0 -2
- package/dist/components/RadioGroup/RadioGroup.js +0 -46
- package/dist/components/RadioGroup/RadioGroup.js.map +0 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +0 -55
- package/dist/components/SegmentedControl/SegmentedControl.js.map +0 -1
- package/dist/components/SegmentedControl/index.d.ts +0 -2
- package/dist/components/Select/Select.js +0 -64
- package/dist/components/Select/Select.js.map +0 -1
- package/dist/components/Skeleton/Skeleton.js.map +0 -1
- package/dist/components/Spinner/Spinner.js.map +0 -1
- package/dist/components/Stat/Stat.d.ts +0 -49
- package/dist/components/Stat/Stat.js +0 -125
- package/dist/components/Stat/Stat.js.map +0 -1
- package/dist/components/Stat/index.d.ts +0 -2
- package/dist/components/Stat/index.js +0 -2
- package/dist/components/Switch/Switch.js +0 -39
- package/dist/components/Switch/Switch.js.map +0 -1
- package/dist/components/Table/Table.js.map +0 -1
- package/dist/components/Tabs/Tabs.js.map +0 -1
- package/dist/components/Tag/Tag.js +0 -48
- package/dist/components/Tag/Tag.js.map +0 -1
- package/dist/components/Textarea/Textarea.js +0 -30
- package/dist/components/Textarea/Textarea.js.map +0 -1
- package/dist/components/Textarea/index.d.ts +0 -2
- package/dist/components/Toast/Toast.js.map +0 -1
- package/dist/components/Toast/ToastItem.d.ts +0 -6
- package/dist/components/Toast/ToastItem.js.map +0 -1
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/Tooltip/TooltipOverlay.js.map +0 -1
- package/dist/internal/LazyDialogTrigger.d.ts +0 -8
- package/dist/internal/LazyDialogTrigger.js +0 -15
- package/dist/internal/LazyDialogTrigger.js.map +0 -1
- package/dist/internal/Spinner.d.ts +0 -3
- package/dist/internal/Spinner.js +0 -14
- package/dist/internal/Spinner.js.map +0 -1
- package/dist/internal/useLazyMenuTrigger.d.ts +0 -23
- package/dist/internal/useLazyMenuTrigger.js +0 -47
- package/dist/internal/useLazyMenuTrigger.js.map +0 -1
- package/dist/utils/cxLite.d.ts +0 -12
- package/dist/utils/cxLite.js +0 -23
- package/dist/utils/cxLite.js.map +0 -1
- /package/dist/components/{Badge → atoms/Badge}/index.js +0 -0
- /package/dist/components/{Checkbox → atoms/Checkbox}/Checkbox.d.ts +0 -0
- /package/dist/components/{Checkbox → atoms/Checkbox}/index.d.ts +0 -0
- /package/dist/components/{Checkbox → atoms/Checkbox}/index.js +0 -0
- /package/dist/components/{IconButton → atoms/IconButton}/index.d.ts +0 -0
- /package/dist/components/{IconButton → atoms/IconButton}/index.js +0 -0
- /package/dist/components/{Kbd → atoms/Kbd}/index.d.ts +0 -0
- /package/dist/components/{Kbd → atoms/Kbd}/index.js +0 -0
- /package/dist/components/{ProgressBar → atoms/ProgressBar}/index.js +0 -0
- /package/dist/components/{Skeleton → atoms/Skeleton}/Skeleton.d.ts +0 -0
- /package/dist/components/{Skeleton → atoms/Skeleton}/index.d.ts +0 -0
- /package/dist/components/{Skeleton → atoms/Skeleton}/index.js +0 -0
- /package/dist/components/{Spinner → atoms/Spinner}/Spinner.d.ts +0 -0
- /package/dist/components/{Spinner → atoms/Spinner}/index.d.ts +0 -0
- /package/dist/components/{Spinner → atoms/Spinner}/index.js +0 -0
- /package/dist/components/{Switch → atoms/Switch}/index.d.ts +0 -0
- /package/dist/components/{Switch → atoms/Switch}/index.js +0 -0
- /package/dist/components/{Tooltip → atoms/Tooltip}/Tooltip.d.ts +0 -0
- /package/dist/components/{Tooltip → atoms/Tooltip}/TooltipOverlay.d.ts +0 -0
- /package/dist/components/{Tooltip → atoms/Tooltip}/index.d.ts +0 -0
- /package/dist/components/{Tooltip → atoms/Tooltip}/index.js +0 -0
- /package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/Breadcrumbs.d.ts +0 -0
- /package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/index.d.ts +0 -0
- /package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/index.js +0 -0
- /package/dist/components/{Card → molecules/Card}/index.js +0 -0
- /package/dist/components/{CodeBlock → molecules/CodeBlock}/index.d.ts +0 -0
- /package/dist/components/{CodeBlock → molecules/CodeBlock}/index.js +0 -0
- /package/dist/components/{Combobox → molecules/Combobox}/index.d.ts +0 -0
- /package/dist/components/{Combobox → molecules/Combobox}/index.js +0 -0
- /package/dist/components/{DatePicker → molecules/DatePicker}/index.d.ts +0 -0
- /package/dist/components/{DatePicker → molecules/DatePicker}/index.js +0 -0
- /package/dist/components/{Dialog → molecules/Dialog}/index.d.ts +0 -0
- /package/dist/components/{Dialog → molecules/Dialog}/index.js +0 -0
- /package/dist/components/{Drawer → molecules/Drawer}/index.d.ts +0 -0
- /package/dist/components/{Drawer → molecules/Drawer}/index.js +0 -0
- /package/dist/components/{DropdownMenu → molecules/DropdownMenu}/index.d.ts +0 -0
- /package/dist/components/{DropdownMenu → molecules/DropdownMenu}/index.js +0 -0
- /package/dist/components/{EmptyState → molecules/EmptyState}/index.d.ts +0 -0
- /package/dist/components/{EmptyState → molecules/EmptyState}/index.js +0 -0
- /package/dist/components/{FileDropZone → molecules/FileDropZone}/index.d.ts +0 -0
- /package/dist/components/{FileDropZone → molecules/FileDropZone}/index.js +0 -0
- /package/dist/components/{Input → molecules/Input}/index.js +0 -0
- /package/dist/components/{Popover → molecules/Popover}/PopoverOverlay.d.ts +0 -0
- /package/dist/components/{Popover → molecules/Popover}/index.d.ts +0 -0
- /package/dist/components/{Popover → molecules/Popover}/index.js +0 -0
- /package/dist/components/{RadioGroup → molecules/RadioGroup}/RadioGroup.d.ts +0 -0
- /package/dist/components/{RadioGroup → molecules/RadioGroup}/index.d.ts +0 -0
- /package/dist/components/{RadioGroup → molecules/RadioGroup}/index.js +0 -0
- /package/dist/components/{SegmentedControl → molecules/SegmentedControl}/index.js +0 -0
- /package/dist/components/{Select → molecules/Select}/index.d.ts +0 -0
- /package/dist/components/{Select → molecules/Select}/index.js +0 -0
- /package/dist/components/{Tabs → molecules/Tabs}/Tabs.d.ts +0 -0
- /package/dist/components/{Tabs → molecules/Tabs}/index.d.ts +0 -0
- /package/dist/components/{Tabs → molecules/Tabs}/index.js +0 -0
- /package/dist/components/{Tag → molecules/Tag}/Tag.d.ts +0 -0
- /package/dist/components/{Tag → molecules/Tag}/index.d.ts +0 -0
- /package/dist/components/{Tag → molecules/Tag}/index.js +0 -0
- /package/dist/components/{Textarea → molecules/Textarea}/index.js +0 -0
- /package/dist/components/{Toast → molecules/Toast}/index.js +0 -0
- /package/dist/components/{Chart → organisms/Chart}/ChartTable.d.ts +0 -0
- /package/dist/components/{Chart → organisms/Chart}/geometry.d.ts +0 -0
- /package/dist/components/{Chart → organisms/Chart}/labels.d.ts +0 -0
- /package/dist/components/{Chart → organisms/Chart}/scale.d.ts +0 -0
- /package/dist/components/{Chart → organisms/Chart}/summary.d.ts +0 -0
- /package/dist/components/{Chart → organisms/Chart}/useElementWidth.d.ts +0 -0
- /package/dist/components/{CommandPalette → organisms/CommandPalette}/index.js +0 -0
- /package/dist/components/{PageHeader → organisms/PageHeader}/PageHeader.d.ts +0 -0
- /package/dist/components/{PageHeader → organisms/PageHeader}/index.d.ts +0 -0
- /package/dist/components/{PageHeader → organisms/PageHeader}/index.js +0 -0
- /package/dist/components/{Table → organisms/Table}/index.d.ts +0 -0
- /package/dist/components/{Table → organisms/Table}/index.js +0 -0
- /package/dist/{chrome → internal}/brandLogoPath.d.ts +0 -0
- /package/dist/{chrome → router}/Anchor.d.ts +0 -0
- /package/dist/{chrome → router}/LinkRouter.d.ts +0 -0
- /package/dist/{chrome → theme}/useTheme.d.ts +0 -0
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { FieldErrorMessage, FieldHint, FieldLabel } from "../../internal/Field.js";
|
|
3
|
-
import { focusRing } from "../../internal/focusRing.js";
|
|
4
|
-
import { popoverSurface } from "../../internal/surfaces.js";
|
|
5
|
-
import { cx } from "../../utils/cx.js";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { CalendarDays, ChevronLeft, ChevronRight } from "lucide-react";
|
|
8
|
-
import { Button, Calendar, CalendarCell, CalendarGrid, DateInput, DatePicker, DateRangePicker, DateSegment, Dialog, Group, Heading, Popover, RangeCalendar, composeRenderProps } from "react-aria-components";
|
|
9
|
-
// src/components/DatePicker/DatePicker.tsx
|
|
10
|
-
var field = "group flex flex-col gap-1.5";
|
|
11
|
-
var control = "flex h-control-md w-full items-center gap-2 rounded-md border border-control bg-primary ps-3 pe-1 text-md text-primary shadow-xs transition-shadow data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled data-disabled:text-disabled data-focus-within:border-brand data-focus-within:ring-4 data-focus-within:ring-focus/25 group-data-invalid:border-error";
|
|
12
|
-
var input = "flex min-w-0 items-center";
|
|
13
|
-
var segment = "rounded-xs px-0.5 tabular-nums caret-transparent outline-none data-placeholder:text-placeholder data-focused:bg-brand-solid data-focused:text-on-solid data-[type=literal]:px-0 data-[type=literal]:text-tertiary";
|
|
14
|
-
var calendarButton = ["ms-auto flex size-control-sm shrink-0 cursor-pointer items-center justify-center rounded-sm text-fg-tertiary data-hovered:bg-hover data-hovered:text-fg-secondary data-pressed:bg-tertiary", focusRing].join(" ");
|
|
15
|
-
var popover = [popoverSurface, "p-3"].join(" ");
|
|
16
|
-
var calendarHeader = "mb-2 flex items-center justify-between gap-2";
|
|
17
|
-
var navButton = ["flex size-control-sm cursor-pointer items-center justify-center rounded-sm text-fg-secondary data-hovered:bg-hover data-disabled:cursor-not-allowed data-disabled:text-fg-disabled", focusRing].join(" ");
|
|
18
|
-
var cell = ["flex size-9 cursor-pointer items-center justify-center rounded-sm text-sm text-primary data-hovered:bg-hover data-outside-month:hidden data-disabled:cursor-not-allowed data-disabled:text-disabled data-unavailable:text-disabled data-unavailable:line-through data-selected:bg-brand-solid data-selected:text-on-solid", focusRing].join(" ");
|
|
19
|
-
var rangeCell = ["flex size-9 cursor-pointer items-center justify-center text-sm text-primary data-hovered:bg-hover data-outside-month:hidden data-disabled:cursor-not-allowed data-disabled:text-disabled data-selected:bg-brand-subtle data-selected:text-brand data-selection-start:rounded-s-sm data-selection-start:bg-brand-solid data-selection-start:text-on-solid data-selection-end:rounded-e-sm data-selection-end:bg-brand-solid data-selection-end:text-on-solid", focusRing].join(" ");
|
|
20
|
-
function Segment(props) {
|
|
21
|
-
return /* @__PURE__ */ jsx(DateSegment, {
|
|
22
|
-
...props,
|
|
23
|
-
className: segment
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function CalendarTrigger({ label }) {
|
|
27
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
28
|
-
"aria-label": label,
|
|
29
|
-
className: calendarButton,
|
|
30
|
-
children: /* @__PURE__ */ jsx(CalendarDays, {
|
|
31
|
-
"aria-hidden": "true",
|
|
32
|
-
className: "size-4"
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function CalendarHeader() {
|
|
37
|
-
return /* @__PURE__ */ jsxs("header", {
|
|
38
|
-
className: calendarHeader,
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ jsx(Button, {
|
|
41
|
-
slot: "previous",
|
|
42
|
-
className: navButton,
|
|
43
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, {
|
|
44
|
-
"aria-hidden": "true",
|
|
45
|
-
className: "size-4"
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ jsx(Heading, { className: "text-sm font-semibold text-primary" }),
|
|
49
|
-
/* @__PURE__ */ jsx(Button, {
|
|
50
|
-
slot: "next",
|
|
51
|
-
className: navButton,
|
|
52
|
-
children: /* @__PURE__ */ jsx(ChevronRight, {
|
|
53
|
-
"aria-hidden": "true",
|
|
54
|
-
className: "size-4"
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* A date field with typed segments and a calendar popover. Arrow keys change
|
|
62
|
-
* a segment, typing fills it, and the calendar button opens a month grid where
|
|
63
|
-
* arrow keys move between days and Enter picks one.
|
|
64
|
-
*/
|
|
65
|
-
function DatePicker$1({ label, hint, errorMessage, calendarLabel = "Open calendar", isInvalid, className, ...props }) {
|
|
66
|
-
return /* @__PURE__ */ jsxs(DatePicker, {
|
|
67
|
-
...props,
|
|
68
|
-
isInvalid: isInvalid ?? Boolean(errorMessage),
|
|
69
|
-
className: composeRenderProps(className, (consumer) => cx(field, consumer)),
|
|
70
|
-
children: [
|
|
71
|
-
label && /* @__PURE__ */ jsx(FieldLabel, { children: label }),
|
|
72
|
-
/* @__PURE__ */ jsxs(Group, {
|
|
73
|
-
className: control,
|
|
74
|
-
children: [/* @__PURE__ */ jsx(DateInput, {
|
|
75
|
-
className: input,
|
|
76
|
-
children: (dateSegment) => /* @__PURE__ */ jsx(Segment, { segment: dateSegment })
|
|
77
|
-
}), /* @__PURE__ */ jsx(CalendarTrigger, { label: calendarLabel })]
|
|
78
|
-
}),
|
|
79
|
-
hint && !errorMessage && /* @__PURE__ */ jsx(FieldHint, { children: hint }),
|
|
80
|
-
/* @__PURE__ */ jsx(FieldErrorMessage, { children: errorMessage }),
|
|
81
|
-
/* @__PURE__ */ jsx(Popover, {
|
|
82
|
-
placement: "bottom start",
|
|
83
|
-
className: popover,
|
|
84
|
-
children: /* @__PURE__ */ jsx(Dialog, {
|
|
85
|
-
className: "outline-none",
|
|
86
|
-
children: /* @__PURE__ */ jsxs(Calendar, { children: [/* @__PURE__ */ jsx(CalendarHeader, {}), /* @__PURE__ */ jsx(CalendarGrid, { children: (date) => /* @__PURE__ */ jsx(CalendarCell, {
|
|
87
|
-
date,
|
|
88
|
-
className: cell
|
|
89
|
-
}) })] })
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
/** Like DatePicker, with a start and an end date and a range calendar. */
|
|
96
|
-
function DateRangePicker$1({ label, hint, errorMessage, calendarLabel = "Open calendar", isInvalid, className, ...props }) {
|
|
97
|
-
return /* @__PURE__ */ jsxs(DateRangePicker, {
|
|
98
|
-
...props,
|
|
99
|
-
isInvalid: isInvalid ?? Boolean(errorMessage),
|
|
100
|
-
className: composeRenderProps(className, (consumer) => cx(field, consumer)),
|
|
101
|
-
children: [
|
|
102
|
-
label && /* @__PURE__ */ jsx(FieldLabel, { children: label }),
|
|
103
|
-
/* @__PURE__ */ jsxs(Group, {
|
|
104
|
-
className: control,
|
|
105
|
-
children: [
|
|
106
|
-
/* @__PURE__ */ jsx(DateInput, {
|
|
107
|
-
slot: "start",
|
|
108
|
-
className: input,
|
|
109
|
-
children: (dateSegment) => /* @__PURE__ */ jsx(Segment, { segment: dateSegment })
|
|
110
|
-
}),
|
|
111
|
-
/* @__PURE__ */ jsx("span", {
|
|
112
|
-
"aria-hidden": "true",
|
|
113
|
-
className: "text-tertiary",
|
|
114
|
-
children: "to"
|
|
115
|
-
}),
|
|
116
|
-
/* @__PURE__ */ jsx(DateInput, {
|
|
117
|
-
slot: "end",
|
|
118
|
-
className: input,
|
|
119
|
-
children: (dateSegment) => /* @__PURE__ */ jsx(Segment, { segment: dateSegment })
|
|
120
|
-
}),
|
|
121
|
-
/* @__PURE__ */ jsx(CalendarTrigger, { label: calendarLabel })
|
|
122
|
-
]
|
|
123
|
-
}),
|
|
124
|
-
hint && !errorMessage && /* @__PURE__ */ jsx(FieldHint, { children: hint }),
|
|
125
|
-
/* @__PURE__ */ jsx(FieldErrorMessage, { children: errorMessage }),
|
|
126
|
-
/* @__PURE__ */ jsx(Popover, {
|
|
127
|
-
placement: "bottom start",
|
|
128
|
-
className: popover,
|
|
129
|
-
children: /* @__PURE__ */ jsx(Dialog, {
|
|
130
|
-
className: "outline-none",
|
|
131
|
-
children: /* @__PURE__ */ jsxs(RangeCalendar, { children: [/* @__PURE__ */ jsx(CalendarHeader, {}), /* @__PURE__ */ jsx(CalendarGrid, { children: (date) => /* @__PURE__ */ jsx(CalendarCell, {
|
|
132
|
-
date,
|
|
133
|
-
className: rangeCell
|
|
134
|
-
}) })] })
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
]
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
export { DatePicker$1 as DatePicker, DateRangePicker$1 as DateRangePicker };
|
|
141
|
-
|
|
142
|
-
//# sourceMappingURL=DatePicker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","names":["AriaButton","DatePicker","AriaDatePicker","DateRangePicker","AriaDateRangePicker"],"sources":["../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { CalendarDays, ChevronLeft, ChevronRight } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport {\n Button as AriaButton,\n Calendar,\n CalendarCell,\n CalendarGrid,\n DateInput,\n DatePicker as AriaDatePicker,\n DateRangePicker as AriaDateRangePicker,\n DateSegment,\n Dialog,\n Group,\n Heading,\n Popover,\n RangeCalendar,\n composeRenderProps,\n type DatePickerProps as AriaDatePickerProps,\n type DateRangePickerProps as AriaDateRangePickerProps,\n type DateSegmentProps,\n type DateValue,\n} from 'react-aria-components';\nimport { FieldErrorMessage, FieldHint, FieldLabel } from '../../internal/Field';\nimport { focusRing } from '../../internal/focusRing';\nimport { popoverSurface } from '../../internal/surfaces';\nimport { cx } from '../../utils/cx';\n\ninterface FieldProps {\n /** Visible label. If omitted, pass `aria-label`. */\n label?: ReactNode;\n /** Helper text below the field, linked with aria-describedby. */\n hint?: ReactNode;\n /** Error text. Setting it also marks the field invalid. */\n errorMessage?: string;\n /** Accessible name of the button that opens the calendar. */\n calendarLabel?: string;\n}\n\nexport interface DatePickerProps<T extends DateValue> extends AriaDatePickerProps<T>, FieldProps {}\n\nexport interface DateRangePickerProps<T extends DateValue>\n extends AriaDateRangePickerProps<T>, FieldProps {}\n\nconst field = 'group flex flex-col gap-1.5';\nconst control =\n 'flex h-control-md w-full items-center gap-2 rounded-md border border-control bg-primary ps-3 pe-1 text-md text-primary shadow-xs transition-shadow data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled data-disabled:text-disabled data-focus-within:border-brand data-focus-within:ring-4 data-focus-within:ring-focus/25 group-data-invalid:border-error';\nconst input = 'flex min-w-0 items-center';\nconst segment =\n 'rounded-xs px-0.5 tabular-nums caret-transparent outline-none data-placeholder:text-placeholder data-focused:bg-brand-solid data-focused:text-on-solid data-[type=literal]:px-0 data-[type=literal]:text-tertiary';\nconst calendarButton = [\n 'ms-auto flex size-control-sm shrink-0 cursor-pointer items-center justify-center rounded-sm text-fg-tertiary data-hovered:bg-hover data-hovered:text-fg-secondary data-pressed:bg-tertiary',\n focusRing,\n].join(' ');\nconst popover = [popoverSurface, 'p-3'].join(' ');\nconst calendarHeader = 'mb-2 flex items-center justify-between gap-2';\nconst navButton = [\n 'flex size-control-sm cursor-pointer items-center justify-center rounded-sm text-fg-secondary data-hovered:bg-hover data-disabled:cursor-not-allowed data-disabled:text-fg-disabled',\n focusRing,\n].join(' ');\nconst cell = [\n 'flex size-9 cursor-pointer items-center justify-center rounded-sm text-sm text-primary data-hovered:bg-hover data-outside-month:hidden data-disabled:cursor-not-allowed data-disabled:text-disabled data-unavailable:text-disabled data-unavailable:line-through data-selected:bg-brand-solid data-selected:text-on-solid',\n focusRing,\n].join(' ');\nconst rangeCell = [\n 'flex size-9 cursor-pointer items-center justify-center text-sm text-primary data-hovered:bg-hover data-outside-month:hidden data-disabled:cursor-not-allowed data-disabled:text-disabled data-selected:bg-brand-subtle data-selected:text-brand data-selection-start:rounded-s-sm data-selection-start:bg-brand-solid data-selection-start:text-on-solid data-selection-end:rounded-e-sm data-selection-end:bg-brand-solid data-selection-end:text-on-solid',\n focusRing,\n].join(' ');\n\nfunction Segment(props: DateSegmentProps) {\n return <DateSegment {...props} className={segment} />;\n}\n\nfunction CalendarTrigger({ label }: { label: string }) {\n return (\n <AriaButton aria-label={label} className={calendarButton}>\n <CalendarDays aria-hidden='true' className='size-4' />\n </AriaButton>\n );\n}\n\nfunction CalendarHeader() {\n return (\n <header className={calendarHeader}>\n <AriaButton slot='previous' className={navButton}>\n <ChevronLeft aria-hidden='true' className='size-4' />\n </AriaButton>\n <Heading className='text-sm font-semibold text-primary' />\n <AriaButton slot='next' className={navButton}>\n <ChevronRight aria-hidden='true' className='size-4' />\n </AriaButton>\n </header>\n );\n}\n\n/**\n * A date field with typed segments and a calendar popover. Arrow keys change\n * a segment, typing fills it, and the calendar button opens a month grid where\n * arrow keys move between days and Enter picks one.\n */\nexport function DatePicker<T extends DateValue>({\n label,\n hint,\n errorMessage,\n calendarLabel = 'Open calendar',\n isInvalid,\n className,\n ...props\n}: DatePickerProps<T>) {\n return (\n <AriaDatePicker\n {...props}\n isInvalid={isInvalid ?? Boolean(errorMessage)}\n className={composeRenderProps(className, (consumer) => cx(field, consumer))}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n <Group className={control}>\n <DateInput className={input}>\n {(dateSegment) => <Segment segment={dateSegment} />}\n </DateInput>\n <CalendarTrigger label={calendarLabel} />\n </Group>\n {hint && !errorMessage && <FieldHint>{hint}</FieldHint>}\n <FieldErrorMessage>{errorMessage}</FieldErrorMessage>\n <Popover placement='bottom start' className={popover}>\n <Dialog className='outline-none'>\n <Calendar>\n <CalendarHeader />\n <CalendarGrid>{(date) => <CalendarCell date={date} className={cell} />}</CalendarGrid>\n </Calendar>\n </Dialog>\n </Popover>\n </AriaDatePicker>\n );\n}\n\n/** Like DatePicker, with a start and an end date and a range calendar. */\nexport function DateRangePicker<T extends DateValue>({\n label,\n hint,\n errorMessage,\n calendarLabel = 'Open calendar',\n isInvalid,\n className,\n ...props\n}: DateRangePickerProps<T>) {\n return (\n <AriaDateRangePicker\n {...props}\n isInvalid={isInvalid ?? Boolean(errorMessage)}\n className={composeRenderProps(className, (consumer) => cx(field, consumer))}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n <Group className={control}>\n <DateInput slot='start' className={input}>\n {(dateSegment) => <Segment segment={dateSegment} />}\n </DateInput>\n <span aria-hidden='true' className='text-tertiary'>\n to\n </span>\n <DateInput slot='end' className={input}>\n {(dateSegment) => <Segment segment={dateSegment} />}\n </DateInput>\n <CalendarTrigger label={calendarLabel} />\n </Group>\n {hint && !errorMessage && <FieldHint>{hint}</FieldHint>}\n <FieldErrorMessage>{errorMessage}</FieldErrorMessage>\n <Popover placement='bottom start' className={popover}>\n <Dialog className='outline-none'>\n <RangeCalendar>\n <CalendarHeader />\n <CalendarGrid>\n {(date) => <CalendarCell date={date} className={rangeCell} />}\n </CalendarGrid>\n </RangeCalendar>\n </Dialog>\n </Popover>\n </AriaDateRangePicker>\n );\n}\n"],"mappings":";;;;;;;;;AA2CA,IAAM,QAAQ;AACd,IAAM,UACJ;AACF,IAAM,QAAQ;AACd,IAAM,UACJ;AACF,IAAM,iBAAiB,CACrB,8LACA,SACF,CAAC,CAAC,KAAK,GAAG;AACV,IAAM,UAAU,CAAC,gBAAgB,KAAK,CAAC,CAAC,KAAK,GAAG;AAChD,IAAM,iBAAiB;AACvB,IAAM,YAAY,CAChB,sLACA,SACF,CAAC,CAAC,KAAK,GAAG;AACV,IAAM,OAAO,CACX,6TACA,SACF,CAAC,CAAC,KAAK,GAAG;AACV,IAAM,YAAY,CAChB,+bACA,SACF,CAAC,CAAC,KAAK,GAAG;AAEV,SAAS,QAAQ,OAAyB;CACxC,OAAO,oBAAC,aAAD;EAAa,GAAI;EAAO,WAAW;CAAU,CAAA;AACtD;AAEA,SAAS,gBAAgB,EAAE,SAA4B;CACrD,OACE,oBAACA,QAAD;EAAY,cAAY;EAAO,WAAW;EACxC,UAAA,oBAAC,cAAD;GAAc,eAAY;GAAO,WAAU;EAAU,CAAA;CAC3C,CAAA;AAEhB;AAEA,SAAS,iBAAiB;CACxB,OACE,qBAAC,UAAD;EAAQ,WAAW;EAAnB,UAAA;GACE,oBAACA,QAAD;IAAY,MAAK;IAAW,WAAW;IACrC,UAAA,oBAAC,aAAD;KAAa,eAAY;KAAO,WAAU;IAAU,CAAA;GAC1C,CAAA;GACZ,oBAAC,SAAD,EAAS,WAAU,qCAAsC,CAAA;GACzD,oBAACA,QAAD;IAAY,MAAK;IAAO,WAAW;IACjC,UAAA,oBAAC,cAAD;KAAc,eAAY;KAAO,WAAU;IAAU,CAAA;GAC3C,CAAA;EACN;;AAEZ;;;;;;AAOA,SAAgBC,aAAgC,EAC9C,OACA,MACA,cACA,gBAAgB,iBAChB,WACA,WACA,GAAG,SACkB;CACrB,OACE,qBAACC,YAAD;EACE,GAAI;EACJ,WAAW,aAAa,QAAQ,YAAY;EAC5C,WAAW,mBAAmB,YAAY,aAAa,GAAG,OAAO,QAAQ,CAAC;EAH5E,UAAA;GAKG,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;GACzC,qBAAC,OAAD;IAAO,WAAW;IAAlB,UAAA,CACE,oBAAC,WAAD;KAAW,WAAW;KAClB,WAAA,gBAAgB,oBAAC,SAAD,EAAS,SAAS,YAAc,CAAA;IACzC,CAAA,GACX,oBAAC,iBAAD,EAAiB,OAAO,cAAgB,CAAA,CACnC;;GACN,QAAQ,CAAC,gBAAgB,oBAAC,WAAD,EAAA,UAAY,KAAgB,CAAA;GACtD,oBAAC,mBAAD,EAAA,UAAoB,aAAgC,CAAA;GACpD,oBAAC,SAAD;IAAS,WAAU;IAAe,WAAW;IAC3C,UAAA,oBAAC,QAAD;KAAQ,WAAU;KAChB,UAAA,qBAAC,UAAD,EAAA,UAAA,CACE,oBAAC,gBAAD,CAAiB,CAAA,GACjB,oBAAC,cAAD,EAAA,WAAgB,SAAS,oBAAC,cAAD;MAAoB;MAAM,WAAW;KAAO,CAAA,EAAgB,CAAA,CAC7E,EAAA,CAAA;IACJ,CAAA;GACD,CAAA;EACK;;AAEpB;;AAGA,SAAgBC,kBAAqC,EACnD,OACA,MACA,cACA,gBAAgB,iBAChB,WACA,WACA,GAAG,SACuB;CAC1B,OACE,qBAACC,iBAAD;EACE,GAAI;EACJ,WAAW,aAAa,QAAQ,YAAY;EAC5C,WAAW,mBAAmB,YAAY,aAAa,GAAG,OAAO,QAAQ,CAAC;EAH5E,UAAA;GAKG,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;GACzC,qBAAC,OAAD;IAAO,WAAW;IAAlB,UAAA;KACE,oBAAC,WAAD;MAAW,MAAK;MAAQ,WAAW;MAC/B,WAAA,gBAAgB,oBAAC,SAAD,EAAS,SAAS,YAAc,CAAA;KACzC,CAAA;KACX,oBAAC,QAAD;MAAM,eAAY;MAAO,WAAU;MAAgB,UAAA;KAE7C,CAAA;KACN,oBAAC,WAAD;MAAW,MAAK;MAAM,WAAW;MAC7B,WAAA,gBAAgB,oBAAC,SAAD,EAAS,SAAS,YAAc,CAAA;KACzC,CAAA;KACX,oBAAC,iBAAD,EAAiB,OAAO,cAAgB,CAAA;IACnC;;GACN,QAAQ,CAAC,gBAAgB,oBAAC,WAAD,EAAA,UAAY,KAAgB,CAAA;GACtD,oBAAC,mBAAD,EAAA,UAAoB,aAAgC,CAAA;GACpD,oBAAC,SAAD;IAAS,WAAU;IAAe,WAAW;IAC3C,UAAA,oBAAC,QAAD;KAAQ,WAAU;KAChB,UAAA,qBAAC,eAAD,EAAA,UAAA,CACE,oBAAC,gBAAD,CAAiB,CAAA,GACjB,oBAAC,cAAD,EAAA,WACI,SAAS,oBAAC,cAAD;MAAoB;MAAM,WAAW;KAAY,CAAA,EAChD,CAAA,CACD,EAAA,CAAA;IACT,CAAA;GACD,CAAA;EACU;;AAEzB"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type DialogTriggerProps, type ModalOverlayProps } from 'react-aria-components';
|
|
3
|
-
export type DialogSize = 'sm' | 'md' | 'lg';
|
|
4
|
-
export interface DialogProps extends Pick<ModalOverlayProps, 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'isDismissable' | 'isKeyboardDismissDisabled'> {
|
|
5
|
-
/** Heading, also used as the dialog's accessible name. */
|
|
6
|
-
title: ReactNode;
|
|
7
|
-
description?: ReactNode;
|
|
8
|
-
/** Body content, or a function that receives `close`. */
|
|
9
|
-
children?: ReactNode | ((options: {
|
|
10
|
-
close: () => void;
|
|
11
|
-
}) => ReactNode);
|
|
12
|
-
/** Action buttons, rendered in the footer. Also accepts a function that receives `close`. */
|
|
13
|
-
footer?: ReactNode | ((options: {
|
|
14
|
-
close: () => void;
|
|
15
|
-
}) => ReactNode);
|
|
16
|
-
size?: DialogSize;
|
|
17
|
-
/** Role "alertdialog" for destructive confirmations that need an explicit choice. */
|
|
18
|
-
role?: 'dialog' | 'alertdialog';
|
|
19
|
-
/** Controls in the header next to the title, such as a button to open the item in a page. They come before the close button. */
|
|
20
|
-
headerActions?: ReactNode;
|
|
21
|
-
/** Hide the close button in the header. */
|
|
22
|
-
hideCloseButton?: boolean;
|
|
23
|
-
closeLabel?: string;
|
|
24
|
-
className?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* A modal dialog. Focus moves into the dialog when it opens, is trapped while
|
|
28
|
-
* open and returns to the trigger on close. Place it inside a DialogTrigger
|
|
29
|
-
* next to the button that opens it, or control it with isOpen.
|
|
30
|
-
*
|
|
31
|
-
* The modal's code loads the first time it opens, or earlier when the trigger
|
|
32
|
-
* is hovered or focused, so the very first open can take a moment on a slow
|
|
33
|
-
* connection.
|
|
34
|
-
*/
|
|
35
|
-
export declare function Dialog(props: DialogProps): import("react").JSX.Element | null;
|
|
36
|
-
/** Wraps a trigger button and its Dialog, and preloads the dialog on hover or focus of the trigger. */
|
|
37
|
-
export declare function DialogTrigger(props: DialogTriggerProps): import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["Dialog","DialogTrigger"],"sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { useContext, type ReactNode } from 'react';\nimport {\n OverlayTriggerStateContext,\n type DialogTriggerProps,\n type ModalOverlayProps,\n} from 'react-aria-components';\nimport { LazyDialogTrigger } from '../../internal/LazyDialogTrigger';\nimport { createLazyModule } from '../../internal/lazyModule';\n\nexport type DialogSize = 'sm' | 'md' | 'lg';\n\nexport interface DialogProps extends Pick<\n ModalOverlayProps,\n 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'isDismissable' | 'isKeyboardDismissDisabled'\n> {\n /** Heading, also used as the dialog's accessible name. */\n title: ReactNode;\n description?: ReactNode;\n /** Body content, or a function that receives `close`. */\n children?: ReactNode | ((options: { close: () => void }) => ReactNode);\n /** Action buttons, rendered in the footer. Also accepts a function that receives `close`. */\n footer?: ReactNode | ((options: { close: () => void }) => ReactNode);\n size?: DialogSize;\n /** Role \"alertdialog\" for destructive confirmations that need an explicit choice. */\n role?: 'dialog' | 'alertdialog';\n /** Controls in the header next to the title, such as a button to open the item in a page. They come before the close button. */\n headerActions?: ReactNode;\n /** Hide the close button in the header. */\n hideCloseButton?: boolean;\n closeLabel?: string;\n className?: string;\n}\n\nconst overlay = /*#__PURE__*/ createLazyModule(() => import('./DialogOverlay'));\n\n/**\n * A modal dialog. Focus moves into the dialog when it opens, is trapped while\n * open and returns to the trigger on close. Place it inside a DialogTrigger\n * next to the button that opens it, or control it with isOpen.\n *\n * The modal's code loads the first time it opens, or earlier when the trigger\n * is hovered or focused, so the very first open can take a moment on a slow\n * connection.\n */\nexport function Dialog(props: DialogProps) {\n const triggerState = useContext(OverlayTriggerStateContext);\n const isWanted = props.isOpen ?? props.defaultOpen ?? triggerState?.isOpen ?? false;\n const loaded = overlay.useModule(isWanted);\n return loaded ? <loaded.DialogOverlay {...props} /> : null;\n}\n\n/** Wraps a trigger button and its Dialog, and preloads the dialog on hover or focus of the trigger. */\nexport function DialogTrigger(props: DialogTriggerProps) {\n return <LazyDialogTrigger module={overlay} {...props} />;\n}\n"],"mappings":";;;;;;;AAiCA,IAAM,UAAwB,qCAAuB,OAAO,qBAAkB;;;;;;;;;;AAW9E,SAAgBA,SAAO,OAAoB;CACzC,MAAM,eAAe,WAAW,0BAA0B;CAC1D,MAAM,WAAW,MAAM,UAAU,MAAM,eAAe,cAAc,UAAU;CAC9E,MAAM,SAAS,QAAQ,UAAU,QAAQ;CACzC,OAAO,SAAS,oBAAC,OAAO,eAAR,EAAsB,GAAI,MAAQ,CAAA,IAAI;AACxD;;AAGA,SAAgBC,gBAAc,OAA2B;CACvD,OAAO,oBAAC,mBAAD;EAAmB,QAAQ;EAAS,GAAI;CAAQ,CAAA;AACzD"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DialogProps } from './Dialog';
|
|
2
|
-
/** The modal behind Dialog. Dialog loads this module the first time it opens. */
|
|
3
|
-
export declare function DialogOverlay({ title, description, children, footer, headerActions, size, role, hideCloseButton, closeLabel, isDismissable, className, ...overlayProps }: DialogProps): import("react").JSX.Element;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cx } from "../../utils/cx.js";
|
|
3
|
-
import { IconButton } from "../IconButton/IconButton.js";
|
|
4
|
-
import { useId } from "react";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { X } from "lucide-react";
|
|
7
|
-
import { Dialog, Heading, Modal, ModalOverlay } from "react-aria-components";
|
|
8
|
-
// src/components/Dialog/DialogOverlay.tsx
|
|
9
|
-
var sizes = {
|
|
10
|
-
sm: "max-w-sm",
|
|
11
|
-
md: "max-w-lg",
|
|
12
|
-
lg: "max-w-2xl"
|
|
13
|
-
};
|
|
14
|
-
/** The modal behind Dialog. Dialog loads this module the first time it opens. */
|
|
15
|
-
function DialogOverlay({ title, description, children, footer, headerActions, size = "md", role = "dialog", hideCloseButton = false, closeLabel = "Close", isDismissable = true, className, ...overlayProps }) {
|
|
16
|
-
const descriptionId = useId();
|
|
17
|
-
return /* @__PURE__ */ jsx(ModalOverlay, {
|
|
18
|
-
...overlayProps,
|
|
19
|
-
isDismissable,
|
|
20
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-overlay p-4",
|
|
21
|
-
children: /* @__PURE__ */ jsx(Modal, {
|
|
22
|
-
className: cx("w-full", sizes[size]),
|
|
23
|
-
children: /* @__PURE__ */ jsx(Dialog, {
|
|
24
|
-
role,
|
|
25
|
-
"aria-describedby": description ? descriptionId : void 0,
|
|
26
|
-
className: cx("flex max-h-[85vh] flex-col gap-4 overflow-auto rounded-xl bg-elevated p-card text-primary shadow-xl outline-none", className),
|
|
27
|
-
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
-
/* @__PURE__ */ jsxs("div", {
|
|
29
|
-
className: "flex items-start gap-2",
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ jsxs("div", {
|
|
32
|
-
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
33
|
-
children: [/* @__PURE__ */ jsx(Heading, {
|
|
34
|
-
slot: "title",
|
|
35
|
-
className: "font-display text-lg font-semibold text-primary",
|
|
36
|
-
children: title
|
|
37
|
-
}), description && /* @__PURE__ */ jsx("p", {
|
|
38
|
-
id: descriptionId,
|
|
39
|
-
className: "text-sm text-tertiary",
|
|
40
|
-
children: description
|
|
41
|
-
})]
|
|
42
|
-
}),
|
|
43
|
-
headerActions && /* @__PURE__ */ jsx("div", {
|
|
44
|
-
className: "flex shrink-0 items-center gap-1",
|
|
45
|
-
children: headerActions
|
|
46
|
-
}),
|
|
47
|
-
!hideCloseButton && /* @__PURE__ */ jsx(IconButton, {
|
|
48
|
-
icon: X,
|
|
49
|
-
"aria-label": closeLabel,
|
|
50
|
-
variant: "tertiary",
|
|
51
|
-
size: "sm",
|
|
52
|
-
onPress: close,
|
|
53
|
-
className: "-mt-1 -mr-1 shrink-0"
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
}),
|
|
57
|
-
children && /* @__PURE__ */ jsx("div", {
|
|
58
|
-
className: "text-sm text-secondary",
|
|
59
|
-
children: typeof children === "function" ? children({ close }) : children
|
|
60
|
-
}),
|
|
61
|
-
footer && /* @__PURE__ */ jsx("div", {
|
|
62
|
-
className: "mt-2 flex flex-col-reverse gap-3 sm:flex-row sm:justify-end",
|
|
63
|
-
children: typeof footer === "function" ? footer({ close }) : footer
|
|
64
|
-
})
|
|
65
|
-
] })
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
export { DialogOverlay };
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=DialogOverlay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialogOverlay.js","names":["AriaDialog","_Fragment"],"sources":["../../../src/components/Dialog/DialogOverlay.tsx"],"sourcesContent":["import { X } from 'lucide-react';\nimport { useId } from 'react';\nimport { Dialog as AriaDialog, Heading, Modal, ModalOverlay } from 'react-aria-components';\nimport { cx } from '../../utils/cx';\nimport { IconButton } from '../IconButton/IconButton';\nimport type { DialogProps, DialogSize } from './Dialog';\n\nconst sizes: Record<DialogSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-lg',\n lg: 'max-w-2xl',\n};\n\n/** The modal behind Dialog. Dialog loads this module the first time it opens. */\nexport function DialogOverlay({\n title,\n description,\n children,\n footer,\n headerActions,\n size = 'md',\n role = 'dialog',\n hideCloseButton = false,\n closeLabel = 'Close',\n isDismissable = true,\n className,\n ...overlayProps\n}: DialogProps) {\n const descriptionId = useId();\n return (\n <ModalOverlay\n {...overlayProps}\n isDismissable={isDismissable}\n className='fixed inset-0 z-50 flex items-center justify-center bg-overlay p-4'\n >\n <Modal className={cx('w-full', sizes[size])}>\n <AriaDialog\n role={role}\n aria-describedby={description ? descriptionId : undefined}\n className={cx(\n 'flex max-h-[85vh] flex-col gap-4 overflow-auto rounded-xl bg-elevated p-card text-primary shadow-xl outline-none',\n className,\n )}\n >\n {({ close }) => (\n <>\n <div className='flex items-start gap-2'>\n <div className='flex min-w-0 flex-1 flex-col gap-1'>\n <Heading slot='title' className='font-display text-lg font-semibold text-primary'>\n {title}\n </Heading>\n {description && (\n <p id={descriptionId} className='text-sm text-tertiary'>\n {description}\n </p>\n )}\n </div>\n {headerActions && (\n <div className='flex shrink-0 items-center gap-1'>{headerActions}</div>\n )}\n {!hideCloseButton && (\n <IconButton\n icon={X}\n aria-label={closeLabel}\n variant='tertiary'\n size='sm'\n onPress={close}\n className='-mt-1 -mr-1 shrink-0'\n />\n )}\n </div>\n {children && (\n <div className='text-sm text-secondary'>\n {typeof children === 'function' ? children({ close }) : children}\n </div>\n )}\n {footer && (\n <div className='mt-2 flex flex-col-reverse gap-3 sm:flex-row sm:justify-end'>\n {typeof footer === 'function' ? footer({ close }) : footer}\n </div>\n )}\n </>\n )}\n </AriaDialog>\n </Modal>\n </ModalOverlay>\n );\n}\n"],"mappings":";;;;;;;;AAOA,IAAM,QAAoC;CACxC,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;;AAGA,SAAgB,cAAc,EAC5B,OACA,aACA,UACA,QACA,eACA,OAAO,MACP,OAAO,UACP,kBAAkB,OAClB,aAAa,SACb,gBAAgB,MAChB,WACA,GAAG,gBACW;CACd,MAAM,gBAAgB,MAAM;CAC5B,OACE,oBAAC,cAAD;EACE,GAAI;EACW;EACf,WAAU;EAEV,UAAA,oBAAC,OAAD;GAAO,WAAW,GAAG,UAAU,MAAM,KAAK;GACxC,UAAA,oBAACA,QAAD;IACQ;IACN,oBAAkB,cAAc,gBAAgB,KAAA;IAChD,WAAW,GACT,oHACA,SACF;IAEE,WAAA,EAAE,YACF,qBAAAC,UAAA,EAAA,UAAA;KACE,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA;OACE,qBAAC,OAAD;QAAK,WAAU;QAAf,UAAA,CACE,oBAAC,SAAD;SAAS,MAAK;SAAQ,WAAU;SAC7B,UAAA;QACM,CAAA,GACR,eACC,oBAAC,KAAD;SAAG,IAAI;SAAe,WAAU;SAC7B,UAAA;QACA,CAAA,CAEF;;OACJ,iBACC,oBAAC,OAAD;QAAK,WAAU;QAAoC,UAAA;OAAmB,CAAA;OAEvE,CAAC,mBACA,oBAAC,YAAD;QACE,MAAM;QACN,cAAY;QACZ,SAAQ;QACR,MAAK;QACL,SAAS;QACT,WAAU;OACX,CAAA;MAEA;;KACJ,YACC,oBAAC,OAAD;MAAK,WAAU;MACZ,UAAA,OAAO,aAAa,aAAa,SAAS,EAAE,MAAM,CAAC,IAAI;KACrD,CAAA;KAEN,UACC,oBAAC,OAAD;MAAK,WAAU;MACZ,UAAA,OAAO,WAAW,aAAa,OAAO,EAAE,MAAM,CAAC,IAAI;KACjD,CAAA;IAEP,EAAA,CAAA;GAEM,CAAA;EACP,CAAA;CACK,CAAA;AAElB"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type DialogTriggerProps, type ModalOverlayProps } from 'react-aria-components';
|
|
3
|
-
export type DrawerSide = 'left' | 'right' | 'bottom';
|
|
4
|
-
export type DrawerSize = 'sm' | 'md' | 'lg';
|
|
5
|
-
export interface DrawerProps extends Pick<ModalOverlayProps, 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'isDismissable' | 'isKeyboardDismissDisabled'> {
|
|
6
|
-
/** Heading, also used as the accessible name. */
|
|
7
|
-
title: ReactNode;
|
|
8
|
-
/** Hide the heading visually but keep it as the accessible name. */
|
|
9
|
-
hideTitle?: boolean;
|
|
10
|
-
description?: ReactNode;
|
|
11
|
-
/** Body content, or a function that receives `close`. */
|
|
12
|
-
children?: ReactNode | ((options: {
|
|
13
|
-
close: () => void;
|
|
14
|
-
}) => ReactNode);
|
|
15
|
-
/** Sticky footer, usually action buttons. Also accepts a function that receives `close`. */
|
|
16
|
-
footer?: ReactNode | ((options: {
|
|
17
|
-
close: () => void;
|
|
18
|
-
}) => ReactNode);
|
|
19
|
-
/** Edge the panel slides in from. */
|
|
20
|
-
side?: DrawerSide;
|
|
21
|
-
size?: DrawerSize;
|
|
22
|
-
closeLabel?: string;
|
|
23
|
-
className?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* A side panel (also called a sheet) on React Aria's Modal. It slides in from
|
|
27
|
-
* an edge, traps focus while open, closes on Escape or a click on the
|
|
28
|
-
* backdrop, and returns focus to the trigger. Use it for navigation on small
|
|
29
|
-
* screens, filters and detail views.
|
|
30
|
-
*
|
|
31
|
-
* The panel's code loads the first time it opens, or earlier when the trigger
|
|
32
|
-
* is hovered or focused.
|
|
33
|
-
*/
|
|
34
|
-
export declare function Drawer(props: DrawerProps): import("react").JSX.Element | null;
|
|
35
|
-
/** Wraps a trigger button and its Drawer, and preloads the drawer on hover or focus of the trigger. */
|
|
36
|
-
export declare function DrawerTrigger(props: DialogTriggerProps): import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","names":[],"sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { useContext, type ReactNode } from 'react';\nimport {\n OverlayTriggerStateContext,\n type DialogTriggerProps,\n type ModalOverlayProps,\n} from 'react-aria-components';\nimport { LazyDialogTrigger } from '../../internal/LazyDialogTrigger';\nimport { createLazyModule } from '../../internal/lazyModule';\n\nexport type DrawerSide = 'left' | 'right' | 'bottom';\nexport type DrawerSize = 'sm' | 'md' | 'lg';\n\nexport interface DrawerProps extends Pick<\n ModalOverlayProps,\n 'isOpen' | 'defaultOpen' | 'onOpenChange' | 'isDismissable' | 'isKeyboardDismissDisabled'\n> {\n /** Heading, also used as the accessible name. */\n title: ReactNode;\n /** Hide the heading visually but keep it as the accessible name. */\n hideTitle?: boolean;\n description?: ReactNode;\n /** Body content, or a function that receives `close`. */\n children?: ReactNode | ((options: { close: () => void }) => ReactNode);\n /** Sticky footer, usually action buttons. Also accepts a function that receives `close`. */\n footer?: ReactNode | ((options: { close: () => void }) => ReactNode);\n /** Edge the panel slides in from. */\n side?: DrawerSide;\n size?: DrawerSize;\n closeLabel?: string;\n className?: string;\n}\n\nconst overlay = /*#__PURE__*/ createLazyModule(() => import('./DrawerOverlay'));\n\n/**\n * A side panel (also called a sheet) on React Aria's Modal. It slides in from\n * an edge, traps focus while open, closes on Escape or a click on the\n * backdrop, and returns focus to the trigger. Use it for navigation on small\n * screens, filters and detail views.\n *\n * The panel's code loads the first time it opens, or earlier when the trigger\n * is hovered or focused.\n */\nexport function Drawer(props: DrawerProps) {\n const triggerState = useContext(OverlayTriggerStateContext);\n const isWanted = props.isOpen ?? props.defaultOpen ?? triggerState?.isOpen ?? false;\n const loaded = overlay.useModule(isWanted);\n return loaded ? <loaded.DrawerOverlay {...props} /> : null;\n}\n\n/** Wraps a trigger button and its Drawer, and preloads the drawer on hover or focus of the trigger. */\nexport function DrawerTrigger(props: DialogTriggerProps) {\n return <LazyDialogTrigger module={overlay} {...props} />;\n}\n"],"mappings":";;;;;;;AAgCA,IAAM,UAAwB,qCAAuB,OAAO,qBAAkB;;;;;;;;;;AAW9E,SAAgB,OAAO,OAAoB;CACzC,MAAM,eAAe,WAAW,0BAA0B;CAC1D,MAAM,WAAW,MAAM,UAAU,MAAM,eAAe,cAAc,UAAU;CAC9E,MAAM,SAAS,QAAQ,UAAU,QAAQ;CACzC,OAAO,SAAS,oBAAC,OAAO,eAAR,EAAsB,GAAI,MAAQ,CAAA,IAAI;AACxD;;AAGA,SAAgB,cAAc,OAA2B;CACvD,OAAO,oBAAC,mBAAD;EAAmB,QAAQ;EAAS,GAAI;CAAQ,CAAA;AACzD"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cx } from "../../utils/cx.js";
|
|
3
|
-
import { IconButton } from "../IconButton/IconButton.js";
|
|
4
|
-
import { useId } from "react";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { X } from "lucide-react";
|
|
7
|
-
import { Dialog, Heading, Modal, ModalOverlay } from "react-aria-components";
|
|
8
|
-
// src/components/Drawer/DrawerOverlay.tsx
|
|
9
|
-
var panel = {
|
|
10
|
-
right: "inset-y-0 right-0 h-full w-full border-l data-entering:translate-x-full data-exiting:translate-x-full",
|
|
11
|
-
left: "inset-y-0 left-0 h-full w-full border-r data-entering:-translate-x-full data-exiting:-translate-x-full",
|
|
12
|
-
bottom: "inset-x-0 bottom-0 max-h-[85vh] w-full rounded-t-2xl border-t data-entering:translate-y-full data-exiting:translate-y-full"
|
|
13
|
-
};
|
|
14
|
-
var overlay = "fixed inset-0 z-50 bg-overlay transition-opacity duration-200 data-entering:opacity-0 data-exiting:opacity-0 motion-reduce:transition-none";
|
|
15
|
-
var widths = {
|
|
16
|
-
sm: "max-w-xs",
|
|
17
|
-
md: "max-w-md",
|
|
18
|
-
lg: "max-w-2xl"
|
|
19
|
-
};
|
|
20
|
-
/** The panel behind Drawer. Drawer loads this module the first time it opens. */
|
|
21
|
-
function DrawerOverlay({ title, hideTitle = false, description, children, footer, side = "right", size = "md", closeLabel = "Close", isDismissable = true, className, ...overlayProps }) {
|
|
22
|
-
const descriptionId = useId();
|
|
23
|
-
return /* @__PURE__ */ jsx(ModalOverlay, {
|
|
24
|
-
...overlayProps,
|
|
25
|
-
isDismissable,
|
|
26
|
-
className: overlay,
|
|
27
|
-
children: /* @__PURE__ */ jsx(Modal, {
|
|
28
|
-
"data-side": side,
|
|
29
|
-
className: cx("fixed flex flex-col border-subtle bg-elevated text-primary shadow-xl outline-none", "transition-transform duration-200 ease-out motion-reduce:transition-none", panel[side], side !== "bottom" && widths[size], className),
|
|
30
|
-
children: /* @__PURE__ */ jsx(Dialog, {
|
|
31
|
-
"aria-describedby": description ? descriptionId : void 0,
|
|
32
|
-
className: "flex min-h-0 flex-1 flex-col outline-none",
|
|
33
|
-
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
-
/* @__PURE__ */ jsxs("div", {
|
|
35
|
-
className: "flex items-start gap-3 border-b border-subtle p-card pb-4",
|
|
36
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
37
|
-
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
38
|
-
children: [/* @__PURE__ */ jsx(Heading, {
|
|
39
|
-
slot: "title",
|
|
40
|
-
className: cx("font-display text-lg font-semibold text-primary", hideTitle && "sr-only"),
|
|
41
|
-
children: title
|
|
42
|
-
}), description && /* @__PURE__ */ jsx("p", {
|
|
43
|
-
id: descriptionId,
|
|
44
|
-
className: "text-sm text-tertiary",
|
|
45
|
-
children: description
|
|
46
|
-
})]
|
|
47
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
48
|
-
icon: X,
|
|
49
|
-
"aria-label": closeLabel,
|
|
50
|
-
variant: "tertiary",
|
|
51
|
-
size: "sm",
|
|
52
|
-
onPress: close,
|
|
53
|
-
className: "-mt-1 -mr-1 shrink-0"
|
|
54
|
-
})]
|
|
55
|
-
}),
|
|
56
|
-
/* @__PURE__ */ jsx("div", {
|
|
57
|
-
className: "min-h-0 flex-1 overflow-auto p-card text-sm text-secondary",
|
|
58
|
-
children: typeof children === "function" ? children({ close }) : children
|
|
59
|
-
}),
|
|
60
|
-
footer && /* @__PURE__ */ jsx("div", {
|
|
61
|
-
className: "flex flex-col-reverse gap-3 border-t border-subtle p-card pt-4 sm:flex-row sm:justify-end",
|
|
62
|
-
children: typeof footer === "function" ? footer({ close }) : footer
|
|
63
|
-
})
|
|
64
|
-
] })
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
export { DrawerOverlay };
|
|
70
|
-
|
|
71
|
-
//# sourceMappingURL=DrawerOverlay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerOverlay.js","names":["AriaDialog","_Fragment"],"sources":["../../../src/components/Drawer/DrawerOverlay.tsx"],"sourcesContent":["import { X } from 'lucide-react';\nimport { useId } from 'react';\nimport { Dialog as AriaDialog, Heading, Modal, ModalOverlay } from 'react-aria-components';\nimport { cx } from '../../utils/cx';\nimport { IconButton } from '../IconButton/IconButton';\nimport type { DrawerProps, DrawerSide, DrawerSize } from './Drawer';\n\nconst panel: Record<DrawerSide, string> = {\n right:\n 'inset-y-0 right-0 h-full w-full border-l data-entering:translate-x-full data-exiting:translate-x-full',\n left: 'inset-y-0 left-0 h-full w-full border-r data-entering:-translate-x-full data-exiting:-translate-x-full',\n bottom:\n 'inset-x-0 bottom-0 max-h-[85vh] w-full rounded-t-2xl border-t data-entering:translate-y-full data-exiting:translate-y-full',\n};\n\nconst overlay =\n 'fixed inset-0 z-50 bg-overlay transition-opacity duration-200 data-entering:opacity-0 data-exiting:opacity-0 motion-reduce:transition-none';\n\nconst widths: Record<DrawerSize, string> = {\n sm: 'max-w-xs',\n md: 'max-w-md',\n lg: 'max-w-2xl',\n};\n\n/** The panel behind Drawer. Drawer loads this module the first time it opens. */\nexport function DrawerOverlay({\n title,\n hideTitle = false,\n description,\n children,\n footer,\n side = 'right',\n size = 'md',\n closeLabel = 'Close',\n isDismissable = true,\n className,\n ...overlayProps\n}: DrawerProps) {\n const descriptionId = useId();\n return (\n <ModalOverlay {...overlayProps} isDismissable={isDismissable} className={overlay}>\n <Modal\n data-side={side}\n className={cx(\n 'fixed flex flex-col border-subtle bg-elevated text-primary shadow-xl outline-none',\n 'transition-transform duration-200 ease-out motion-reduce:transition-none',\n panel[side],\n side !== 'bottom' && widths[size],\n className,\n )}\n >\n <AriaDialog\n aria-describedby={description ? descriptionId : undefined}\n className='flex min-h-0 flex-1 flex-col outline-none'\n >\n {({ close }) => (\n <>\n <div className='flex items-start gap-3 border-b border-subtle p-card pb-4'>\n <div className='flex min-w-0 flex-1 flex-col gap-1'>\n <Heading\n slot='title'\n className={cx(\n 'font-display text-lg font-semibold text-primary',\n hideTitle && 'sr-only',\n )}\n >\n {title}\n </Heading>\n {description && (\n <p id={descriptionId} className='text-sm text-tertiary'>\n {description}\n </p>\n )}\n </div>\n <IconButton\n icon={X}\n aria-label={closeLabel}\n variant='tertiary'\n size='sm'\n onPress={close}\n className='-mt-1 -mr-1 shrink-0'\n />\n </div>\n <div className='min-h-0 flex-1 overflow-auto p-card text-sm text-secondary'>\n {typeof children === 'function' ? children({ close }) : children}\n </div>\n {footer && (\n <div className='flex flex-col-reverse gap-3 border-t border-subtle p-card pt-4 sm:flex-row sm:justify-end'>\n {typeof footer === 'function' ? footer({ close }) : footer}\n </div>\n )}\n </>\n )}\n </AriaDialog>\n </Modal>\n </ModalOverlay>\n );\n}\n"],"mappings":";;;;;;;;AAOA,IAAM,QAAoC;CACxC,OACE;CACF,MAAM;CACN,QACE;AACJ;AAEA,IAAM,UACJ;AAEF,IAAM,SAAqC;CACzC,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;;AAGA,SAAgB,cAAc,EAC5B,OACA,YAAY,OACZ,aACA,UACA,QACA,OAAO,SACP,OAAO,MACP,aAAa,SACb,gBAAgB,MAChB,WACA,GAAG,gBACW;CACd,MAAM,gBAAgB,MAAM;CAC5B,OACE,oBAAC,cAAD;EAAc,GAAI;EAA6B;EAAe,WAAW;EACvE,UAAA,oBAAC,OAAD;GACE,aAAW;GACX,WAAW,GACT,qFACA,4EACA,MAAM,OACN,SAAS,YAAY,OAAO,OAC5B,SACF;GAEA,UAAA,oBAACA,QAAD;IACE,oBAAkB,cAAc,gBAAgB,KAAA;IAChD,WAAU;IAER,WAAA,EAAE,YACF,qBAAAC,UAAA,EAAA,UAAA;KACE,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,qBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,oBAAC,SAAD;QACE,MAAK;QACL,WAAW,GACT,mDACA,aAAa,SACf;QAEC,UAAA;OACM,CAAA,GACR,eACC,oBAAC,KAAD;QAAG,IAAI;QAAe,WAAU;QAC7B,UAAA;OACA,CAAA,CAEF;MACL,CAAA,GAAA,oBAAC,YAAD;OACE,MAAM;OACN,cAAY;OACZ,SAAQ;OACR,MAAK;OACL,SAAS;OACT,WAAU;MACX,CAAA,CACE;;KACL,oBAAC,OAAD;MAAK,WAAU;MACZ,UAAA,OAAO,aAAa,aAAa,SAAS,EAAE,MAAM,CAAC,IAAI;KACrD,CAAA;KACJ,UACC,oBAAC,OAAD;MAAK,WAAU;MACZ,UAAA,OAAO,WAAW,aAAa,OAAO,EAAE,MAAM,CAAC,IAAI;KACjD,CAAA;IAEP,EAAA,CAAA;GAEM,CAAA;EACP,CAAA;CACK,CAAA;AAElB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":[],"sources":["../../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { useContext, type ReactNode } from 'react';\nimport {\n MenuTrigger,\n OverlayTriggerStateContext,\n type MenuItemProps,\n type MenuProps,\n type MenuSectionProps,\n type MenuTriggerProps,\n type PopoverProps,\n type SubmenuTriggerProps,\n} from 'react-aria-components';\nimport { createLazyModule } from '../../internal/lazyModule';\nimport { PreloadOnIntent } from '../../internal/PreloadOnIntent';\nimport type { IconComponent } from '../../internal/types';\n\nexport type DropdownMenuProps = MenuTriggerProps;\n\nexport interface DropdownMenuContentProps<T extends object> extends MenuProps<T> {\n placement?: PopoverProps['placement'];\n /** Class for the floating surface. */\n popoverClassName?: string;\n}\n\nexport interface DropdownMenuItemProps<T extends object = object> extends Omit<\n MenuItemProps<T>,\n 'children'\n> {\n children: ReactNode;\n /** Leading icon component, for example from lucide-react. */\n icon?: IconComponent;\n /**\n * Secondary line under the label. It becomes part of the item's accessible\n * name, which then starts with the label, so the name always contains the\n * visible text (WCAG 2.5.3).\n */\n description?: ReactNode;\n /** Keyboard shortcut hint, such as \"⌘K\". Display only. */\n shortcut?: string;\n /** Destructive styling, for delete and similar actions. */\n isDanger?: boolean;\n}\n\nexport interface DropdownMenuSectionProps<T extends object> extends Omit<\n MenuSectionProps<T>,\n 'children'\n> {\n /** Visible group heading, also the group's accessible name. */\n title?: ReactNode;\n children: ReactNode;\n}\n\nconst menu = /*#__PURE__*/ createLazyModule(() => import('./DropdownMenuParts'));\n\n/**\n * Wraps a trigger and a DropdownMenuContent. Opens on press, Enter, Space or\n * the arrow keys. Inside, arrow keys move, typing jumps to a matching item,\n * Enter activates and Escape closes and returns focus to the trigger.\n *\n * The menu's code loads the first time it opens, or earlier when the trigger\n * is hovered or focused, so the very first open can take a moment on a slow\n * connection. The trigger works at once.\n */\nexport function DropdownMenu(props: DropdownMenuProps) {\n return (\n <PreloadOnIntent module={menu}>\n <MenuTrigger {...props} />\n </PreloadOnIntent>\n );\n}\n\nexport function DropdownMenuContent<T extends object>(props: DropdownMenuContentProps<T>) {\n const triggerState = useContext(OverlayTriggerStateContext);\n const parts = menu.useModule(triggerState?.isOpen ?? false);\n return parts ? <parts.DropdownMenuContent {...props} /> : null;\n}\n\nexport function DropdownMenuItem<T extends object = object>(props: DropdownMenuItemProps<T>) {\n const parts = menu.get();\n return parts ? <parts.DropdownMenuItem {...props} /> : null;\n}\n\n/**\n * Groups items under an optional heading. Set `selectionMode=\"multiple\"` for\n * checkbox items or `\"single\"` for a radio style group.\n */\nexport function DropdownMenuSection<T extends object>(props: DropdownMenuSectionProps<T>) {\n const parts = menu.get();\n return parts ? <parts.DropdownMenuSection {...props} /> : null;\n}\n\nexport function DropdownMenuSeparator() {\n const parts = menu.get();\n return parts ? <parts.DropdownMenuSeparator /> : null;\n}\n\n/** Nests a submenu: pass a DropdownMenuItem and a DropdownMenuContent. */\nexport function DropdownSubmenu(props: SubmenuTriggerProps) {\n const parts = menu.get();\n return parts ? <parts.DropdownSubmenu {...props} /> : null;\n}\n"],"mappings":";;;;;;;AAmDA,IAAM,OAAqB,qCAAuB,OAAO,yBAAsB;;;;;;;;;;AAW/E,SAAgB,aAAa,OAA0B;CACrD,OACE,oBAAC,iBAAD;EAAiB,QAAQ;EACvB,UAAA,oBAAC,aAAD,EAAa,GAAI,MAAQ,CAAA;CACV,CAAA;AAErB;AAEA,SAAgB,oBAAsC,OAAoC;CACxF,MAAM,eAAe,WAAW,0BAA0B;CAC1D,MAAM,QAAQ,KAAK,UAAU,cAAc,UAAU,KAAK;CAC1D,OAAO,QAAQ,oBAAC,MAAM,qBAAP,EAA2B,GAAI,MAAQ,CAAA,IAAI;AAC5D;AAEA,SAAgB,iBAA4C,OAAiC;CAC3F,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,kBAAP,EAAwB,GAAI,MAAQ,CAAA,IAAI;AACzD;;;;;AAMA,SAAgB,oBAAsC,OAAoC;CACxF,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,qBAAP,EAA2B,GAAI,MAAQ,CAAA,IAAI;AAC5D;AAEA,SAAgB,wBAAwB;CACtC,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,uBAAP,CAA8B,CAAA,IAAI;AACnD;;AAGA,SAAgB,gBAAgB,OAA4B;CAC1D,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,iBAAP,EAAuB,GAAI,MAAQ,CAAA,IAAI;AACxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuParts.js","names":["Menu","_Fragment"],"sources":["../../../src/components/DropdownMenu/DropdownMenuParts.tsx"],"sourcesContent":["import { Check, ChevronRight } from 'lucide-react';\nimport {\n Header,\n Keyboard,\n Menu,\n MenuItem,\n MenuSection,\n Popover,\n Separator,\n SubmenuTrigger,\n Text,\n composeRenderProps,\n} from 'react-aria-components';\nimport {\n listItem,\n listSectionHeader,\n listSeparator,\n popoverSurface,\n} from '../../internal/surfaces';\nimport { cx } from '../../utils/cx';\nimport type {\n DropdownMenuContentProps,\n DropdownMenuItemProps,\n DropdownMenuSectionProps,\n} from './DropdownMenu';\n\nexport function DropdownMenuContent<T extends object>({\n placement = 'bottom start',\n popoverClassName,\n className,\n ...props\n}: DropdownMenuContentProps<T>) {\n return (\n <Popover\n placement={placement}\n offset={4}\n className={cx(popoverSurface, 'min-w-48', popoverClassName)}\n >\n <Menu\n {...props}\n className={composeRenderProps(className, (consumer) =>\n cx('max-h-[inherit] outline-none', consumer),\n )}\n />\n </Popover>\n );\n}\n\nexport function DropdownMenuItem<T extends object = object>({\n children,\n icon: Icon,\n description,\n shortcut,\n isDanger = false,\n className,\n ...props\n}: DropdownMenuItemProps<T>) {\n const textValue = props.textValue ?? (typeof children === 'string' ? children : undefined);\n return (\n <MenuItem\n {...props}\n textValue={textValue}\n className={composeRenderProps(className, (consumer) =>\n cx(listItem, isDanger && 'text-error', consumer),\n )}\n >\n {({ isSelected, selectionMode, hasSubmenu }) => (\n <>\n {selectionMode !== 'none' && (\n <span className='flex size-4 shrink-0 items-center justify-center' aria-hidden='true'>\n {isSelected && <Check className='size-4 text-fg-brand' />}\n </span>\n )}\n {Icon && (\n <Icon\n aria-hidden='true'\n className={cx('size-4 shrink-0', isDanger ? 'text-fg-error' : 'text-fg-tertiary')}\n />\n )}\n {description ? (\n <span className='flex min-w-0 flex-1 flex-col'>\n <span className='truncate'>{children}</span>\n <span className='truncate text-xs text-tertiary'>{description}</span>\n </span>\n ) : (\n <Text slot='label' className='min-w-0 flex-1 truncate'>\n {children}\n </Text>\n )}\n {shortcut && (\n <Keyboard className='ml-4 font-mono text-xs text-tertiary'>{shortcut}</Keyboard>\n )}\n {hasSubmenu && <ChevronRight aria-hidden='true' className='size-4 text-fg-tertiary' />}\n </>\n )}\n </MenuItem>\n );\n}\n\nexport function DropdownMenuSection<T extends object>({\n title,\n children,\n className,\n ...props\n}: DropdownMenuSectionProps<T>) {\n return (\n <MenuSection {...props} className={cx('flex flex-col', className)}>\n {title && <Header className={listSectionHeader}>{title}</Header>}\n {children}\n </MenuSection>\n );\n}\n\nexport function DropdownMenuSeparator() {\n return <Separator className={listSeparator} />;\n}\n\nexport const DropdownSubmenu = SubmenuTrigger;\n"],"mappings":";;;;;;;AA0BA,SAAgB,oBAAsC,EACpD,YAAY,gBACZ,kBACA,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,SAAD;EACa;EACX,QAAQ;EACR,WAAW,GAAG,gBAAgB,YAAY,gBAAgB;EAE1D,UAAA,oBAACA,QAAD;GACE,GAAI;GACJ,WAAW,mBAAmB,YAAY,aACxC,GAAG,gCAAgC,QAAQ,CAC7C;EACD,CAAA;CACM,CAAA;AAEb;AAEA,SAAgB,iBAA4C,EAC1D,UACA,MAAM,MACN,aACA,UACA,WAAW,OACX,WACA,GAAG,SACwB;CAC3B,MAAM,YAAY,MAAM,cAAc,OAAO,aAAa,WAAW,WAAW,KAAA;CAChF,OACE,oBAAC,UAAD;EACE,GAAI;EACO;EACX,WAAW,mBAAmB,YAAY,aACxC,GAAG,UAAU,YAAY,cAAc,QAAQ,CACjD;EAEE,WAAA,EAAE,YAAY,eAAe,iBAC7B,qBAAAC,UAAA,EAAA,UAAA;GACG,kBAAkB,UACjB,oBAAC,QAAD;IAAM,WAAU;IAAmD,eAAY;IAC5E,UAAA,cAAc,oBAAC,OAAD,EAAO,WAAU,uBAAwB,CAAA;GACpD,CAAA;GAEP,QACC,oBAAC,MAAD;IACE,eAAY;IACZ,WAAW,GAAG,mBAAmB,WAAW,kBAAkB,kBAAkB;GACjF,CAAA;GAEF,cACC,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,oBAAC,QAAD;KAAM,WAAU;KAAY;IAAe,CAAA,GAC3C,oBAAC,QAAD;KAAM,WAAU;KAAkC,UAAA;IAAkB,CAAA,CAChE;GAEN,CAAA,IAAA,oBAAC,MAAD;IAAM,MAAK;IAAQ,WAAU;IAC1B;GACG,CAAA;GAEP,YACC,oBAAC,UAAD;IAAU,WAAU;IAAwC,UAAA;GAAmB,CAAA;GAEhF,cAAc,oBAAC,cAAD;IAAc,eAAY;IAAO,WAAU;GAA2B,CAAA;EACrF,EAAA,CAAA;CAEI,CAAA;AAEd;AAEA,SAAgB,oBAAsC,EACpD,OACA,UACA,WACA,GAAG,SAC2B;CAC9B,OACE,qBAAC,aAAD;EAAa,GAAI;EAAO,WAAW,GAAG,iBAAiB,SAAS;EAAhE,UAAA,CACG,SAAS,oBAAC,QAAD;GAAQ,WAAA;GAA+B,UAAA;EAAc,CAAA,GAC9D,QACU;;AAEjB;AAEA,SAAgB,wBAAwB;CACtC,OAAO,oBAAC,WAAD,EAAW,WAAW,cAAgB,CAAA;AAC/C;AAEA,IAAa,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { IconComponent } from '../../internal/types';\nimport { cx } from '../../utils/cx';\n\nexport type EmptyStateSize = 'sm' | 'md';\n\nexport interface EmptyStateProps {\n title: ReactNode;\n description?: ReactNode;\n /** Decorative icon, for example from lucide-react. */\n icon?: IconComponent;\n /** The main way forward, usually a primary Button. */\n primaryAction?: ReactNode;\n /** An alternative, usually a secondary Button or a link. */\n secondaryAction?: ReactNode;\n /** Use 1 when the empty state is the whole page, such as a 404. */\n headingLevel?: 1 | 2 | 3 | 4;\n size?: EmptyStateSize;\n className?: string;\n}\n\nconst headings = { 1: 'h1', 2: 'h2', 3: 'h3', 4: 'h4' } as const;\n\nconst sizes: Record<EmptyStateSize, { root: string; icon: string; title: string }> = {\n sm: { root: 'gap-2 py-6', icon: 'size-10 [&>svg]:size-5', title: 'text-md' },\n md: { root: 'gap-3 py-12', icon: 'size-12 [&>svg]:size-6', title: 'text-lg' },\n};\n\nconst iconFrame =\n 'flex items-center justify-center rounded-xl border border-subtle bg-primary text-fg-secondary shadow-xs';\n\n/** What to show when a list, search or view has nothing in it yet, and what to do next. */\nexport function EmptyState({\n title,\n description,\n icon: Icon,\n primaryAction,\n secondaryAction,\n headingLevel = 2,\n size = 'md',\n className,\n}: EmptyStateProps) {\n const Heading = headings[headingLevel];\n return (\n <div\n className={cx(\n 'mx-auto flex max-w-md flex-col items-center px-4 text-center',\n sizes[size].root,\n className,\n )}\n >\n {Icon && (\n <div className={cx(iconFrame, sizes[size].icon)}>\n <Icon aria-hidden='true' />\n </div>\n )}\n <Heading className={cx('font-display font-semibold text-primary', sizes[size].title)}>\n {title}\n </Heading>\n {description && <p className='text-sm text-tertiary'>{description}</p>}\n {(primaryAction ?? secondaryAction) && (\n <div className='mt-2 flex flex-wrap items-center justify-center gap-3'>\n {secondaryAction}\n {primaryAction}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;AAqBA,IAAM,WAAW;CAAE,GAAG;CAAM,GAAG;CAAM,GAAG;CAAM,GAAG;AAAK;AAEtD,IAAM,QAA+E;CACnF,IAAI;EAAE,MAAM;EAAc,MAAM;EAA0B,OAAO;CAAU;CAC3E,IAAI;EAAE,MAAM;EAAe,MAAM;EAA0B,OAAO;CAAU;AAC9E;AAEA,IAAM,YACJ;;AAGF,SAAgB,WAAW,EACzB,OACA,aACA,MAAM,MACN,eACA,iBACA,eAAe,GACf,OAAO,MACP,aACkB;CAClB,MAAM,UAAU,SAAS;CACzB,OACE,qBAAC,OAAD;EACE,WAAW,GACT,gEACA,MAAM,KAAK,CAAC,MACZ,SACF;EALF,UAAA;GAOG,QACC,oBAAC,OAAD;IAAK,WAAW,GAAG,WAAW,MAAM,KAAK,CAAC,IAAI;IAC5C,UAAA,oBAAC,MAAD,EAAM,eAAY,OAAQ,CAAA;GACvB,CAAA;GAEP,oBAAC,SAAD;IAAS,WAAW,GAAG,2CAA2C,MAAM,KAAK,CAAC,KAAK;IAChF,UAAA;GACM,CAAA;GACR,eAAe,oBAAC,KAAD;IAAG,WAAU;IAAyB,UAAA;GAAe,CAAA;IACnE,iBAAiB,oBACjB,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,iBACA,aACE;;EAEJ;;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropZone.js","names":["Button"],"sources":["../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { Upload } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport {\n DropZone,\n FileTrigger,\n Text,\n isFileDropItem,\n type DropZoneProps,\n} from 'react-aria-components';\nimport { focusRing } from '../../internal/focusRing';\nimport { cx } from '../../utils/cx';\nimport { Button } from '../Button/Button';\n\nexport interface FileDropZoneProps {\n /** What the area is for, such as \"Drop a JSON file here\". Also its accessible name. */\n label: ReactNode;\n /** Constraints before the user errs, such as \"JSON, up to 2 MB\". */\n hint?: ReactNode;\n /** Text of the button that opens the file picker. Start with a verb. */\n buttonLabel?: string;\n /**\n * Accepted files: extensions (\".json\"), MIME types (\"application/json\") or\n * wildcards (\"image/*\"). Applied to the picker and to dropped files.\n */\n acceptedFileTypes?: readonly string[];\n allowsMultiple?: boolean;\n isDisabled?: boolean;\n /** Files the user chose or dropped that match `acceptedFileTypes`. */\n onSelect: (files: File[]) => void;\n /** Files that were dropped or picked but not accepted: a wrong type, or extra files when only one is allowed. */\n onReject?: (files: File[]) => void;\n className?: string;\n}\n\nconst zone = [\n 'flex flex-col items-center gap-2 rounded-lg border-2 border-dashed border-control bg-primary p-card text-center transition-colors',\n 'data-drop-target:border-brand data-drop-target:bg-brand-subtle',\n 'data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled',\n focusRing,\n].join(' ');\n\n/**\n * Whether a file matches an `accept` style list: extensions, MIME types or\n * wildcards. An empty or missing list accepts everything.\n */\nexport function acceptsFile(file: Pick<File, 'name' | 'type'>, accepted?: readonly string[]) {\n if (!accepted || accepted.length === 0) return true;\n const name = file.name.toLowerCase();\n return accepted.some((pattern) => {\n const rule = pattern.trim().toLowerCase();\n if (rule.startsWith('.')) return name.endsWith(rule);\n if (rule.endsWith('/*')) return file.type.toLowerCase().startsWith(rule.slice(0, -1));\n return file.type.toLowerCase() === rule;\n });\n}\n\n/**\n * Splits files into those to keep and those to refuse: files that do not\n * match `accepted`, and, when only one file is allowed, every match after the first.\n */\nexport function sortFiles(\n files: File[],\n accepted: readonly string[] | undefined,\n multiple: boolean,\n) {\n const matching = files.filter((file) => acceptsFile(file, accepted));\n const selected = multiple ? matching : matching.slice(0, 1);\n const rejected = files.filter((file) => !selected.includes(file));\n return { selected, rejected };\n}\n\n/**\n * A drop area with a button that opens the file picker, so files can be added\n * by dragging or by keyboard. React Aria's DropZone and FileTrigger do the\n * work; this adds the look, type checking and a single `onSelect`. It holds no\n * file list: show what was chosen next to it.\n */\nexport function FileDropZone({\n label,\n hint,\n buttonLabel = 'Choose file',\n acceptedFileTypes,\n allowsMultiple = false,\n isDisabled = false,\n onSelect,\n onReject,\n className,\n}: FileDropZoneProps) {\n function route(files: File[]) {\n const { selected, rejected } = sortFiles(files, acceptedFileTypes, allowsMultiple);\n if (selected.length > 0) onSelect(selected);\n if (rejected.length > 0) onReject?.(rejected);\n }\n\n async function handleDrop(event: Parameters<NonNullable<DropZoneProps['onDrop']>>[0]) {\n const items = event.items.filter(isFileDropItem);\n route(await Promise.all(items.map((item) => item.getFile())));\n }\n\n function handleSelect(files: FileList | null) {\n route(files ? [...files] : []);\n }\n\n return (\n <DropZone isDisabled={isDisabled} onDrop={handleDrop} className={cx(zone, className)}>\n <Upload aria-hidden='true' className='size-6 text-fg-tertiary' />\n <Text slot='label' className='text-sm font-medium text-primary'>\n {label}\n </Text>\n {hint && <span className='text-sm text-tertiary'>{hint}</span>}\n <FileTrigger\n acceptedFileTypes={acceptedFileTypes}\n allowsMultiple={allowsMultiple}\n onSelect={handleSelect}\n >\n <Button variant='secondary' size='sm' isDisabled={isDisabled}>\n {buttonLabel}\n </Button>\n </FileTrigger>\n </DropZone>\n );\n}\n"],"mappings":";;;;;;;;AAkCA,IAAM,OAAO;CACX;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;;;;;AAMV,SAAgB,YAAY,MAAmC,UAA8B;CAC3F,IAAI,CAAC,YAAY,SAAS,WAAW,GAAG,OAAO;CAC/C,MAAM,OAAO,KAAK,KAAK,YAAY;CACnC,OAAO,SAAS,MAAM,YAAY;EAChC,MAAM,OAAO,QAAQ,KAAK,CAAC,CAAC,YAAY;EACxC,IAAI,KAAK,WAAW,GAAG,GAAG,OAAO,KAAK,SAAS,IAAI;EACnD,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO,KAAK,KAAK,YAAY,CAAC,CAAC,WAAW,KAAK,MAAM,GAAG,EAAE,CAAC;EACpF,OAAO,KAAK,KAAK,YAAY,MAAM;CACrC,CAAC;AACH;;;;;AAMA,SAAgB,UACd,OACA,UACA,UACA;CACA,MAAM,WAAW,MAAM,QAAQ,SAAS,YAAY,MAAM,QAAQ,CAAC;CACnE,MAAM,WAAW,WAAW,WAAW,SAAS,MAAM,GAAG,CAAC;CAE1D,OAAO;EAAE;EAAU,UADF,MAAM,QAAQ,SAAS,CAAC,SAAS,SAAS,IAAI,CAC5C;CAAS;AAC9B;;;;;;;AAQA,SAAgB,aAAa,EAC3B,OACA,MACA,cAAc,eACd,mBACA,iBAAiB,OACjB,aAAa,OACb,UACA,UACA,aACoB;CACpB,SAAS,MAAM,OAAe;EAC5B,MAAM,EAAE,UAAU,aAAa,UAAU,OAAO,mBAAmB,cAAc;EACjF,IAAI,SAAS,SAAS,GAAG,SAAS,QAAQ;EAC1C,IAAI,SAAS,SAAS,GAAG,WAAW,QAAQ;CAC9C;CAEA,eAAe,WAAW,OAA4D;EACpF,MAAM,QAAQ,MAAM,MAAM,OAAO,cAAc;EAC/C,MAAM,MAAM,QAAQ,IAAI,MAAM,KAAK,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC;CAC9D;CAEA,SAAS,aAAa,OAAwB;EAC5C,MAAM,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;CAC/B;CAEA,OACE,qBAAC,UAAD;EAAsB;EAAY,QAAQ;EAAY,WAAW,GAAG,MAAM,SAAS;EAAnF,UAAA;GACE,oBAAC,QAAD;IAAQ,eAAY;IAAO,WAAU;GAA2B,CAAA;GAChE,oBAAC,MAAD;IAAM,MAAK;IAAQ,WAAU;IAC1B,UAAA;GACG,CAAA;GACL,QAAQ,oBAAC,QAAD;IAAM,WAAU;IAAyB,UAAA;GAAW,CAAA;GAC7D,oBAAC,aAAD;IACqB;IACH;IAChB,UAAU;IAEV,UAAA,oBAACA,UAAD;KAAQ,SAAQ;KAAY,MAAK;KAAiB;KAC/C,UAAA;IACK,CAAA;GACG,CAAA;EACL;;AAEd"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Ref } from 'react';
|
|
2
|
-
import { type ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
|
-
import type { IconComponent } from '../../internal/types';
|
|
4
|
-
import { type ButtonVariant } from '../Button/buttonStyles';
|
|
5
|
-
export type IconButtonSize = 'sm' | 'md' | 'lg';
|
|
6
|
-
export interface IconButtonProps extends Omit<AriaButtonProps, 'children' | 'isPending'> {
|
|
7
|
-
/** The icon to render. */
|
|
8
|
-
icon: IconComponent;
|
|
9
|
-
/** Required: an icon alone has no accessible name. */
|
|
10
|
-
'aria-label': string;
|
|
11
|
-
variant?: ButtonVariant;
|
|
12
|
-
size?: IconButtonSize;
|
|
13
|
-
isLoading?: boolean;
|
|
14
|
-
/** Ref to the button element, for example to return focus to it. */
|
|
15
|
-
ref?: Ref<HTMLButtonElement>;
|
|
16
|
-
}
|
|
17
|
-
export declare function IconButton({ icon: Icon, variant, size, isLoading, ref, className, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Spinner } from "../../internal/Spinner.js";
|
|
3
|
-
import { cx } from "../../utils/cx.js";
|
|
4
|
-
import { buttonBase, buttonVariants } from "../Button/buttonStyles.js";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { Button, composeRenderProps } from "react-aria-components";
|
|
7
|
-
// src/components/IconButton/IconButton.tsx
|
|
8
|
-
var sizes = {
|
|
9
|
-
sm: {
|
|
10
|
-
button: "size-control-sm",
|
|
11
|
-
icon: "size-4"
|
|
12
|
-
},
|
|
13
|
-
md: {
|
|
14
|
-
button: "size-control-md",
|
|
15
|
-
icon: "size-5"
|
|
16
|
-
},
|
|
17
|
-
lg: {
|
|
18
|
-
button: "size-control-lg",
|
|
19
|
-
icon: "size-5"
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
function IconButton({ icon: Icon, variant = "secondary", size = "md", isLoading = false, ref, className, ...props }) {
|
|
23
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
24
|
-
...props,
|
|
25
|
-
ref,
|
|
26
|
-
isPending: isLoading,
|
|
27
|
-
"data-variant": variant,
|
|
28
|
-
className: composeRenderProps(className, (consumer) => cx(buttonBase, buttonVariants[variant], "p-0", sizes[size].button, consumer)),
|
|
29
|
-
children: ({ isPending }) => isPending ? /* @__PURE__ */ jsx(Spinner, { className: sizes[size].icon }) : /* @__PURE__ */ jsx(Icon, {
|
|
30
|
-
"aria-hidden": "true",
|
|
31
|
-
className: sizes[size].icon
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
export { IconButton };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","names":["AriaButton"],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { Ref } from 'react';\nimport {\n Button as AriaButton,\n composeRenderProps,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Spinner } from '../../internal/Spinner';\nimport type { IconComponent } from '../../internal/types';\nimport { cx } from '../../utils/cx';\nimport { buttonBase, buttonVariants, type ButtonVariant } from '../Button/buttonStyles';\n\nexport type IconButtonSize = 'sm' | 'md' | 'lg';\n\nexport interface IconButtonProps extends Omit<AriaButtonProps, 'children' | 'isPending'> {\n /** The icon to render. */\n icon: IconComponent;\n /** Required: an icon alone has no accessible name. */\n 'aria-label': string;\n variant?: ButtonVariant;\n size?: IconButtonSize;\n isLoading?: boolean;\n /** Ref to the button element, for example to return focus to it. */\n ref?: Ref<HTMLButtonElement>;\n}\n\nconst sizes: Record<IconButtonSize, { button: string; icon: string }> = {\n sm: { button: 'size-control-sm', icon: 'size-4' },\n md: { button: 'size-control-md', icon: 'size-5' },\n lg: { button: 'size-control-lg', icon: 'size-5' },\n};\n\nexport function IconButton({\n icon: Icon,\n variant = 'secondary',\n size = 'md',\n isLoading = false,\n ref,\n className,\n ...props\n}: IconButtonProps) {\n return (\n <AriaButton\n {...props}\n ref={ref}\n isPending={isLoading}\n data-variant={variant}\n className={composeRenderProps(className, (consumer) =>\n cx(buttonBase, buttonVariants[variant], 'p-0', sizes[size].button, consumer),\n )}\n >\n {({ isPending }) =>\n isPending ? (\n <Spinner className={sizes[size].icon} />\n ) : (\n <Icon aria-hidden='true' className={sizes[size].icon} />\n )\n }\n </AriaButton>\n );\n}\n"],"mappings":";;;;;;;AAyBA,IAAM,QAAkE;CACtE,IAAI;EAAE,QAAQ;EAAmB,MAAM;CAAS;CAChD,IAAI;EAAE,QAAQ;EAAmB,MAAM;CAAS;CAChD,IAAI;EAAE,QAAQ;EAAmB,MAAM;CAAS;AAClD;AAEA,SAAgB,WAAW,EACzB,MAAM,MACN,UAAU,aACV,OAAO,MACP,YAAY,OACZ,KACA,WACA,GAAG,SACe;CAClB,OACE,oBAACA,QAAD;EACE,GAAI;EACC;EACL,WAAW;EACX,gBAAc;EACd,WAAW,mBAAmB,YAAY,aACxC,GAAG,YAAY,eAAe,UAAU,OAAO,MAAM,KAAK,CAAC,QAAQ,QAAQ,CAC7E;EAEE,WAAA,EAAE,gBACF,YACE,oBAAC,SAAD,EAAS,WAAW,MAAM,KAAK,CAAC,KAAO,CAAA,IAEvC,oBAAC,MAAD;GAAM,eAAY;GAAO,WAAW,MAAM,KAAK,CAAC;EAAO,CAAA;CAGjD,CAAA;AAEhB"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { FieldErrorMessage, FieldHint, FieldLabel } from "../../internal/Field.js";
|
|
3
|
-
import { cx } from "../../utils/cx.js";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { Group, Input, TextField, composeRenderProps } from "react-aria-components";
|
|
6
|
-
// src/components/Input/Input.tsx
|
|
7
|
-
var sizes = {
|
|
8
|
-
sm: "h-control-sm text-sm",
|
|
9
|
-
md: "h-control-md text-md"
|
|
10
|
-
};
|
|
11
|
-
function Input$1({ label, hint, errorMessage, placeholder, size = "md", iconLeading: IconLeading, iconTrailing: IconTrailing, inputClassName, ref, className, isInvalid, ...props }) {
|
|
12
|
-
return /* @__PURE__ */ jsxs(TextField, {
|
|
13
|
-
...props,
|
|
14
|
-
isInvalid: isInvalid ?? Boolean(errorMessage),
|
|
15
|
-
className: composeRenderProps(className, (consumer) => cx("flex flex-col gap-1.5", consumer)),
|
|
16
|
-
children: [
|
|
17
|
-
label && /* @__PURE__ */ jsx(FieldLabel, { children: label }),
|
|
18
|
-
/* @__PURE__ */ jsxs(Group, {
|
|
19
|
-
className: cx("flex items-center gap-2 rounded-md border border-control bg-primary px-3 shadow-xs transition-shadow", "data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled", "data-invalid:border-error", "data-focus-within:border-brand data-focus-within:ring-4 data-focus-within:ring-focus/25", "data-invalid:data-focus-within:border-error data-invalid:data-focus-within:ring-error/25", sizes[size]),
|
|
20
|
-
children: [
|
|
21
|
-
IconLeading && /* @__PURE__ */ jsx(IconLeading, {
|
|
22
|
-
"aria-hidden": "true",
|
|
23
|
-
className: "size-4 shrink-0 text-fg-tertiary"
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ jsx(Input, {
|
|
26
|
-
ref,
|
|
27
|
-
placeholder,
|
|
28
|
-
className: cx("min-w-0 flex-1 bg-transparent text-primary outline-none placeholder:text-placeholder", "disabled:cursor-not-allowed disabled:text-disabled", inputClassName)
|
|
29
|
-
}),
|
|
30
|
-
IconTrailing && /* @__PURE__ */ jsx(IconTrailing, {
|
|
31
|
-
"aria-hidden": "true",
|
|
32
|
-
className: "size-4 shrink-0 text-fg-tertiary"
|
|
33
|
-
})
|
|
34
|
-
]
|
|
35
|
-
}),
|
|
36
|
-
hint && !errorMessage && /* @__PURE__ */ jsx(FieldHint, { children: hint }),
|
|
37
|
-
/* @__PURE__ */ jsx(FieldErrorMessage, { children: errorMessage })
|
|
38
|
-
]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
export { Input$1 as Input };
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","names":["Input","AriaInput"],"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport {\n Group,\n Input as AriaInput,\n TextField,\n composeRenderProps,\n type TextFieldProps,\n} from 'react-aria-components';\nimport { FieldErrorMessage, FieldHint, FieldLabel } from '../../internal/Field';\nimport type { IconComponent } from '../../internal/types';\nimport { cx } from '../../utils/cx';\n\nexport type InputSize = 'sm' | 'md';\n\nexport interface InputProps extends Omit<TextFieldProps, 'children'> {\n /** Visible label. If omitted, pass `aria-label` instead. */\n label?: ReactNode;\n /** Helper text below the field, linked with aria-describedby. */\n hint?: ReactNode;\n /** Error text. Setting it also marks the field invalid. */\n errorMessage?: string;\n placeholder?: string;\n size?: InputSize;\n iconLeading?: IconComponent;\n iconTrailing?: IconComponent;\n /** Class applied to the native input element. */\n inputClassName?: string;\n /** Ref to the native input element, not the wrapper. */\n ref?: Ref<HTMLInputElement>;\n}\n\nconst sizes: Record<InputSize, string> = {\n sm: 'h-control-sm text-sm',\n md: 'h-control-md text-md',\n};\n\nexport function Input({\n label,\n hint,\n errorMessage,\n placeholder,\n size = 'md',\n iconLeading: IconLeading,\n iconTrailing: IconTrailing,\n inputClassName,\n ref,\n className,\n isInvalid,\n ...props\n}: InputProps) {\n return (\n <TextField\n {...props}\n isInvalid={isInvalid ?? Boolean(errorMessage)}\n className={composeRenderProps(className, (consumer) => cx('flex flex-col gap-1.5', consumer))}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n <Group\n className={cx(\n 'flex items-center gap-2 rounded-md border border-control bg-primary px-3 shadow-xs transition-shadow',\n 'data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled',\n 'data-invalid:border-error',\n 'data-focus-within:border-brand data-focus-within:ring-4 data-focus-within:ring-focus/25',\n 'data-invalid:data-focus-within:border-error data-invalid:data-focus-within:ring-error/25',\n sizes[size],\n )}\n >\n {IconLeading && (\n <IconLeading aria-hidden='true' className='size-4 shrink-0 text-fg-tertiary' />\n )}\n <AriaInput\n ref={ref}\n placeholder={placeholder}\n className={cx(\n 'min-w-0 flex-1 bg-transparent text-primary outline-none placeholder:text-placeholder',\n 'disabled:cursor-not-allowed disabled:text-disabled',\n inputClassName,\n )}\n />\n {IconTrailing && (\n <IconTrailing aria-hidden='true' className='size-4 shrink-0 text-fg-tertiary' />\n )}\n </Group>\n {hint && !errorMessage && <FieldHint>{hint}</FieldHint>}\n <FieldErrorMessage>{errorMessage}</FieldErrorMessage>\n </TextField>\n );\n}\n"],"mappings":";;;;;;AA+BA,IAAM,QAAmC;CACvC,IAAI;CACJ,IAAI;AACN;AAEA,SAAgBA,QAAM,EACpB,OACA,MACA,cACA,aACA,OAAO,MACP,aAAa,aACb,cAAc,cACd,gBACA,KACA,WACA,WACA,GAAG,SACU;CACb,OACE,qBAAC,WAAD;EACE,GAAI;EACJ,WAAW,aAAa,QAAQ,YAAY;EAC5C,WAAW,mBAAmB,YAAY,aAAa,GAAG,yBAAyB,QAAQ,CAAC;EAH9F,UAAA;GAKG,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;GACzC,qBAAC,OAAD;IACE,WAAW,GACT,wGACA,4FACA,6BACA,2FACA,4FACA,MAAM,KACR;IARF,UAAA;KAUG,eACC,oBAAC,aAAD;MAAa,eAAY;MAAO,WAAU;KAAoC,CAAA;KAEhF,oBAACC,OAAD;MACO;MACQ;MACb,WAAW,GACT,wFACA,sDACA,cACF;KACD,CAAA;KACA,gBACC,oBAAC,cAAD;MAAc,eAAY;MAAO,WAAU;KAAoC,CAAA;IAE5E;;GACN,QAAQ,CAAC,gBAAgB,oBAAC,WAAD,EAAA,UAAY,KAAgB,CAAA;GACtD,oBAAC,mBAAD,EAAA,UAAoB,aAAgC,CAAA;EAC3C;;AAEf"}
|