@atom-learning/components 10.0.1 → 10.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/action-icon/ActionIcon.d.ts +4 -3
- package/dist/components/action-icon/ActionIcon.js +5 -3
- package/dist/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/components/badge/BadgeText.js +1 -1
- package/dist/components/badge/BadgeText.js.map +1 -1
- package/dist/components/banner/BannerContainer.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegular.d.ts +1 -0
- package/dist/components/banner/banner-regular/BannerRegularActions.js +1 -1
- package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularDismiss.d.ts +5 -3
- package/dist/components/banner/banner-slim/BannerSlim.d.ts +9 -2
- package/dist/components/banner/banner-slim/BannerSlimDismiss.d.ts +5 -3
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/button/Button.js +21 -17
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/calendar/Calendar.js +2 -2
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/carousel/Carousel.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupAllItem.js +3 -2
- package/dist/components/checkbox-group/CheckboxGroupAllItem.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupChecked.context.js +1 -1
- package/dist/components/checkbox-group/CheckboxGroupChecked.context.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupMounted.context.js +1 -1
- package/dist/components/checkbox-group/CheckboxGroupMounted.context.js.map +1 -1
- package/dist/components/chip/Chip.js +2 -2
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/create-password-field/CreatePasswordField.js +5 -5
- package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
- package/dist/components/data-table/DataTableHeaderCell.js +8 -8
- package/dist/components/data-table/DataTableHeaderCell.js.map +1 -1
- package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js.map +1 -1
- package/dist/components/data-table/getNewAsyncData.js +1 -1
- package/dist/components/data-table/getNewAsyncData.js.map +1 -1
- package/dist/components/date-input/DateInput.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +2 -1
- package/dist/components/dropdown-menu/DropdownMenuLinkItem.d.ts +2 -1
- package/dist/components/dropdown-menu/DropdownMenuLinkItem.js +18 -13
- package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -1
- package/dist/components/file-drop/FileDrop.js +2 -2
- package/dist/components/file-drop/FileDrop.js.map +1 -1
- package/dist/components/form/useFieldError.js +2 -1
- package/dist/components/form/useFieldError.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/link/Link.d.ts +2 -2
- package/dist/components/link/Link.js +13 -9
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/navigation/NavigationMenu.d.ts +2 -1
- package/dist/components/navigation/NavigationMenu.js +1 -1
- package/dist/components/navigation/NavigationMenu.js.map +1 -1
- package/dist/components/navigation/NavigationMenuLink.d.ts +2 -1
- package/dist/components/navigation/NavigationMenuLink.js +28 -13
- package/dist/components/navigation/NavigationMenuLink.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVertical.d.ts +4 -2
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.d.ts +4 -2
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js +5 -3
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js.map +1 -1
- package/dist/components/number-input/NumberInputStepper.d.ts +5 -3
- package/dist/components/pagination/PaginationItems.js +2 -2
- package/dist/components/pagination/PaginationItems.js.map +1 -1
- package/dist/components/pagination/PaginationNextButton.d.ts +5 -3
- package/dist/components/pagination/PaginationPreviousButton.d.ts +5 -3
- package/dist/components/pagination/pagination.helper.js +5 -3
- package/dist/components/pagination/pagination.helper.js.map +1 -1
- package/dist/components/router-provider/Router.d.ts +9 -0
- package/dist/components/router-provider/Router.js +7 -0
- package/dist/components/router-provider/Router.js.map +1 -0
- package/dist/components/router-provider/RouterProvider.d.ts +16 -0
- package/dist/components/router-provider/RouterProvider.js +23 -0
- package/dist/components/router-provider/RouterProvider.js.map +1 -0
- package/dist/components/select-menu/SelectMenu.d.ts +16 -9
- package/dist/components/select-menu/SelectMenu.js +6 -4
- package/dist/components/select-menu/SelectMenu.js.map +1 -1
- package/dist/components/select-menu/SelectMenuContent.d.ts +5 -3
- package/dist/components/select-menu/SelectMenuContent.js +24 -65
- package/dist/components/select-menu/SelectMenuContent.js.map +1 -1
- package/dist/components/select-menu/SelectMenuItem.d.ts +5 -3
- package/dist/components/select-menu/SelectMenuItem.js +15 -15
- package/dist/components/select-menu/SelectMenuItem.js.map +1 -1
- package/dist/components/select-menu/SelectMenuLabel.d.ts +2 -2
- package/dist/components/select-menu/SelectMenuLabel.js +2 -2
- package/dist/components/select-menu/SelectMenuLabel.js.map +1 -1
- package/dist/components/select-menu/SelectMenuSeparator.d.ts +2 -2
- package/dist/components/select-menu/SelectMenuSeparator.js +2 -2
- package/dist/components/select-menu/SelectMenuSeparator.js.map +1 -1
- package/dist/components/select-menu/SelectMenuTrigger.d.ts +3 -2
- package/dist/components/select-menu/SelectMenuTrigger.js +12 -12
- package/dist/components/select-menu/SelectMenuTrigger.js.map +1 -1
- package/dist/components/select-menu-field/SelectMenuField.js +5 -5
- package/dist/components/select-menu-field/SelectMenuField.js.map +1 -1
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/slider-field/SliderField.js +2 -1
- package/dist/components/slider-field/SliderField.js.map +1 -1
- package/dist/components/sortable/Handle.d.ts +5 -3
- package/dist/components/stepper/Stepper.js +1 -1
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/stepper/StepperSteps.js +7 -5
- package/dist/components/stepper/StepperSteps.js.map +1 -1
- package/dist/components/table/useStickyColumnsCss.js +1 -1
- package/dist/components/table/useStickyColumnsCss.js.map +1 -1
- package/dist/components/tile-interactive/TileInteractive.d.ts +5 -3
- package/dist/components/tile-interactive/TileInteractive.js +4 -2
- package/dist/components/tile-interactive/TileInteractive.js.map +1 -1
- package/dist/components/tile-toggle-group/TileToggleGroupItem.d.ts +5 -2
- package/dist/components/top-bar/TopBar.d.ts +4 -2
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +239 -218
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -1
- package/dist/styled.js +15 -11
- package/dist/styled.js.map +1 -1
- package/dist/utilities/hooks/useResizeObserver.js +1 -3
- package/dist/utilities/hooks/useResizeObserver.js.map +1 -1
- package/dist/utilities/uri/index.js +2 -1
- package/dist/utilities/uri/index.js.map +1 -1
- package/package.json +15 -7
- package/src/utilities.css +1 -1
- package/dist/types/navigatorActions.types.d.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuLink.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { getExternalAnchorProps } from '../../utilities/uri'\nimport { navigationMenuBaseItemStyles } from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n base: [\n ...navigationMenuBaseItemStyles,\n 'disabled:bg-none',\n 'disabled:cursor-default',\n 'disabled:opacity-30',\n 'disabled:text-text'\n ]\n})\n\nconst ListItem = NavigationMenuPrimitive.Item\n\nconst StyledLink = styled(NavigationMenuPrimitive.Link, {\n base: [\n ...navigationMenuBaseItemStyles,\n 'block',\n 'no-underline',\n 'leading-none'\n ],\n variants: {\n elementType: {\n dropdownItem: [\n 'data-active:bg-background-selected',\n 'data-active:text-text-selected',\n 'data-active:hover:bg-background-selected-hover',\n 'data-active:hover:text-text-selected-hover',\n 'data-active:active:bg-background-selected-pressed',\n 'data-active:active:text-text-selected-pressed',\n 'data-active:focus-visible:shadow-[0_0_0_2px_var(--color-primary-800)]',\n 'data-active:focus-visible:text-text-selected-focus'\n ],\n link: [\n 'data-active:font-semibold',\n 'data-active:text-item-(--background-selected)',\n 'data-active:after:-translate-x-1/2',\n 'data-active:after:absolute',\n 'data-active:after:bg-item-(--background-selected)',\n 'data-active:after:block',\n 'data-active:after:bottom-0',\n 'data-active:after:h-0.5',\n 'data-active:after:left-1/2',\n 'data-active:after:rounded-md',\n 'data-active:after:translate-y-0',\n 'data-active:after:w-6'\n ]\n }\n }\n})\n\nexport const NavigationMenuLink = ({\n ref,\n children,\n href,\n disabled,\n className,\n variant = 'link',\n ...rest\n}: Omit<React.ComponentProps<typeof StyledLink>, 'elementType'> & {\n disabled?: boolean\n variant?: React.ComponentProps<typeof StyledLink>['elementType']\n ref?: React.Ref<HTMLAnchorElement>\n}) => (\n <ListItem>\n
|
|
1
|
+
{"version":3,"file":"NavigationMenuLink.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { getExternalAnchorProps } from '../../utilities/uri'\nimport { useRouterLinkProps } from '../router-provider/RouterProvider'\nimport { navigationMenuBaseItemStyles } from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n base: [\n ...navigationMenuBaseItemStyles,\n 'disabled:bg-none',\n 'disabled:cursor-default',\n 'disabled:opacity-30',\n 'disabled:text-text'\n ]\n})\n\nconst ListItem = NavigationMenuPrimitive.Item\n\nconst StyledLink = styled(NavigationMenuPrimitive.Link, {\n base: [\n ...navigationMenuBaseItemStyles,\n 'block',\n 'no-underline',\n 'leading-none'\n ],\n variants: {\n elementType: {\n dropdownItem: [\n 'data-active:bg-background-selected',\n 'data-active:text-text-selected',\n 'data-active:hover:bg-background-selected-hover',\n 'data-active:hover:text-text-selected-hover',\n 'data-active:active:bg-background-selected-pressed',\n 'data-active:active:text-text-selected-pressed',\n 'data-active:focus-visible:shadow-[0_0_0_2px_var(--color-primary-800)]',\n 'data-active:focus-visible:text-text-selected-focus'\n ],\n link: [\n 'data-active:font-semibold',\n 'data-active:text-item-(--background-selected)',\n 'data-active:after:-translate-x-1/2',\n 'data-active:after:absolute',\n 'data-active:after:bg-item-(--background-selected)',\n 'data-active:after:block',\n 'data-active:after:bottom-0',\n 'data-active:after:h-0.5',\n 'data-active:after:left-1/2',\n 'data-active:after:rounded-md',\n 'data-active:after:translate-y-0',\n 'data-active:after:w-6'\n ]\n }\n }\n})\n\nexport const NavigationMenuLink = ({\n ref,\n children,\n href,\n disabled,\n className,\n variant = 'link',\n reloadDocument,\n ...rest\n}: Omit<React.ComponentProps<typeof StyledLink>, 'elementType'> & {\n disabled?: boolean\n variant?: React.ComponentProps<typeof StyledLink>['elementType']\n reloadDocument?: boolean\n ref?: React.Ref<HTMLAnchorElement>\n}) => {\n const routerLinkProps = useRouterLinkProps(href, { reloadDocument })\n const RouterLink = routerLinkProps.as\n\n return (\n <ListItem>\n {disabled ? (\n <DisabledButton disabled className={className}>\n {children}\n </DisabledButton>\n ) : RouterLink ? (\n <StyledLink\n href={href}\n ref={ref}\n elementType={variant}\n className={className}\n asChild\n {...rest}\n >\n <RouterLink href={href}>{children}</RouterLink>\n </StyledLink>\n ) : (\n <StyledLink\n href={href}\n ref={ref}\n elementType={variant}\n className={className}\n {...getExternalAnchorProps(href)}\n {...rest}\n >\n {children}\n </StyledLink>\n )}\n </ListItem>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,iBAAiB,OAAO,UAAU,EACtC,MAAM;CACJ,GAAG;CACH;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAM,WAAW,wBAAwB;AAEzC,IAAM,aAAa,OAAO,wBAAwB,MAAM;CACtD,MAAM;EACJ,GAAG;EACH;EACA;EACA;CACF;CACA,UAAU,EACR,aAAa;EACX,cAAc;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF,EACF;AACF,CAAC;AAED,IAAa,sBAAsB,EACjC,KACA,UACA,MACA,UACA,WACA,UAAU,QACV,gBACA,GAAG,WAMC;CAEJ,MAAM,aADkB,mBAAmB,MAAM,EAAE,eAAe,CAC/C,CAAA,CAAgB;CAEnC,OACE,oBAAC,UAAD,EAAA,UACG,WACC,oBAAC,gBAAD;EAAgB,UAAA;EAAoB;EACjC;CACa,CAAA,IACd,aACF,oBAAC,YAAD;EACQ;EACD;EACL,aAAa;EACF;EACX,SAAA;EACA,GAAI;YAEJ,oBAAC,YAAD;GAAkB;GAAO;EAAqB,CAAA;CACpC,CAAA,IAEZ,oBAAC,YAAD;EACQ;EACD;EACL,aAAa;EACF;EACX,GAAI,uBAAuB,IAAI;EAC/B,GAAI;EAEH;CACS,CAAA,EAEN,CAAA;AAEd"}
|
|
@@ -2,11 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
declare const StyledRoot: import("../..").PolymorphicComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-navigation-menu").NavigationMenuProps & React.RefAttributes<HTMLElement>>, unknown>;
|
|
3
3
|
type NavigationVerticalProps = Omit<React.ComponentProps<typeof StyledRoot>, 'delayDuration' | 'skipDelayDuration' | 'defaultValue' | 'value' | 'onValueChange'>;
|
|
4
4
|
export declare const NavigationMenuVertical: (({ children, ...rest }: NavigationVerticalProps) => React.JSX.Element) & {
|
|
5
|
-
Link: ({ as, href, children, ...rest }: {
|
|
5
|
+
Link: ({ as, href, children, reloadDocument, ...rest }: {
|
|
6
6
|
size?: "lg" | "md" | undefined;
|
|
7
7
|
} & {
|
|
8
8
|
as?: never;
|
|
9
|
-
} & Omit<import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "as" | "size">
|
|
9
|
+
} & Omit<import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "as" | "size"> & {
|
|
10
|
+
reloadDocument?: boolean;
|
|
11
|
+
}) => React.JSX.Element;
|
|
10
12
|
Accordion: ({ defaultOpen, open, onOpenChange, disabled, ...rest }: import("@radix-ui/react-collapsible").CollapsibleProps & React.RefAttributes<HTMLDivElement> & {
|
|
11
13
|
key?: React.Key | null | undefined;
|
|
12
14
|
ref?: React.Ref<HTMLLIElement> | undefined;
|
|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
declare const StyledNavigationMenuVerticalLink: import("../..").PolymorphicComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>, {
|
|
3
3
|
size?: "lg" | "md" | undefined;
|
|
4
4
|
}>;
|
|
5
|
-
type NavigationMenuVerticalItemProps = React.ComponentProps<typeof StyledNavigationMenuVerticalLink
|
|
6
|
-
|
|
5
|
+
type NavigationMenuVerticalItemProps = React.ComponentProps<typeof StyledNavigationMenuVerticalLink> & {
|
|
6
|
+
reloadDocument?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const NavigationMenuVerticalLink: ({ as, href, children, reloadDocument, ...rest }: NavigationMenuVerticalItemProps) => React.JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { styled } from "../../styled.js";
|
|
2
2
|
import { getExternalAnchorProps } from "../../utilities/uri/index.js";
|
|
3
|
+
import { useRouterLinkProps } from "../router-provider/RouterProvider.js";
|
|
3
4
|
import { preventEvent } from "../../utilities/event/preventEvent.js";
|
|
4
5
|
import { NavigationMenuVerticalItem } from "./NavigationMenuVerticalItem.js";
|
|
5
6
|
import { navigationMenuVerticalItemStyles } from "./NavigationMenuVertical.styles.js";
|
|
@@ -15,9 +16,10 @@ var StyledNavigationMenuVerticalLink = styled(Link, {
|
|
|
15
16
|
lg: ["min-h-12"]
|
|
16
17
|
} }
|
|
17
18
|
});
|
|
18
|
-
var NavigationMenuVerticalLink = ({ as, href, children, ...rest }) => {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
var NavigationMenuVerticalLink = ({ as, href, children, reloadDocument, ...rest }) => {
|
|
20
|
+
const routerLinkProps = useRouterLinkProps(href, { reloadDocument });
|
|
21
|
+
const Component = as || routerLinkProps.as || (href ? "a" : "button");
|
|
22
|
+
const componentProps = as || routerLinkProps.as ? {} : href ? getExternalAnchorProps(href) : { type: "button" };
|
|
21
23
|
return /* @__PURE__ */ jsx(NavigationMenuVerticalItem, { children: /* @__PURE__ */ jsx(StyledNavigationMenuVerticalLink, {
|
|
22
24
|
size: "lg",
|
|
23
25
|
href,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalLink.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalLink.tsx"],"sourcesContent":["import { Link } from '@radix-ui/react-navigation-menu'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { preventEvent } from '../../utilities/event/preventEvent'\nimport { getExternalAnchorProps } from '../../utilities/uri'\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalLink = styled(Link, {\n base: navigationMenuVerticalItemStyles,\n variants: {\n size: {\n md: ['min-h-10'],\n lg: ['min-h-12']\n }\n }\n})\n\ntype NavigationMenuVerticalItemProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalLink\n
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalLink.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalLink.tsx"],"sourcesContent":["import { Link } from '@radix-ui/react-navigation-menu'\nimport * as React from 'react'\n\nimport { styled } from '../../styled'\nimport { preventEvent } from '../../utilities/event/preventEvent'\nimport { getExternalAnchorProps } from '../../utilities/uri'\nimport { useRouterLinkProps } from '../router-provider/RouterProvider'\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalLink = styled(Link, {\n base: navigationMenuVerticalItemStyles,\n variants: {\n size: {\n md: ['min-h-10'],\n lg: ['min-h-12']\n }\n }\n})\n\ntype NavigationMenuVerticalItemProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalLink\n> & { reloadDocument?: boolean }\n\nexport const NavigationMenuVerticalLink = ({\n as,\n href,\n children,\n reloadDocument,\n ...rest\n}: NavigationMenuVerticalItemProps) => {\n const routerLinkProps = useRouterLinkProps(href, { reloadDocument })\n const Component = as || routerLinkProps.as || (href ? 'a' : 'button')\n const componentProps =\n as || routerLinkProps.as\n ? {}\n : href\n ? getExternalAnchorProps(href)\n : { type: 'button' }\n\n return (\n <NavigationMenuVerticalItem>\n <StyledNavigationMenuVerticalLink\n size=\"lg\"\n href={href}\n {...rest}\n {...componentProps}\n onSelect={preventEvent}\n asChild // ?: Can't use `as` for this as we lose `data-active` etc. attributes when we try to. Using `asChild` and `Component` as a workaround.\n >\n <Component>\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n </Component>\n </StyledNavigationMenuVerticalLink>\n </NavigationMenuVerticalItem>\n )\n}\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,mCAAmC,OAAO,MAAM;CACpD,MAAM;CACN,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,UAAU;EACf,IAAI,CAAC,UAAU;CACjB,EACF;AACF,CAAC;AAMD,IAAa,8BAA8B,EACzC,IACA,MACA,UACA,gBACA,GAAG,WACkC;CACrC,MAAM,kBAAkB,mBAAmB,MAAM,EAAE,eAAe,CAAC;CACnE,MAAM,YAAY,MAAM,gBAAgB,OAAO,OAAO,MAAM;CAC5D,MAAM,iBACJ,MAAM,gBAAgB,KAClB,CAAC,IACD,OACE,uBAAuB,IAAI,IAC3B,EAAE,MAAM,SAAS;CAEzB,OACE,oBAAC,4BAAD,EAAA,UACE,oBAAC,kCAAD;EACE,MAAK;EACC;EACN,GAAI;EACJ,GAAI;EACJ,UAAU;EACV,SAAA;YAEA,oBAAC,WAAD,EAAA,UACE,oBAAC,mCAAD,EACG,SACgC,CAAA,EAC1B,CAAA;CACqB,CAAA,EACR,CAAA;AAEhC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ActionIcon } from '../action-icon/ActionIcon';
|
|
3
|
-
declare const StyledStepperButton: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, ...rest }: Omit<{
|
|
3
|
+
declare const StyledStepperButton: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, reloadDocument, ...rest }: Omit<{
|
|
4
4
|
theme?: ("danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white">>) | undefined;
|
|
5
5
|
appearance?: ("outline" | "simple" | "solid" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "outline" | "simple" | "solid">>) | undefined;
|
|
6
6
|
size?: ("lg" | "md" | "sm" | "xs" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm" | "xs">>) | undefined;
|
|
7
7
|
isRounded?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
|
|
8
8
|
} & {
|
|
9
9
|
as?: never;
|
|
10
|
-
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "label" | "
|
|
10
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "href" | "label" | "reloadDocument" | "tooltipSide"> & {
|
|
11
11
|
as?: React.ElementType;
|
|
12
12
|
children: React.ReactNode;
|
|
13
|
+
href?: string;
|
|
13
14
|
label: string;
|
|
14
|
-
|
|
15
|
+
reloadDocument?: boolean;
|
|
16
|
+
} & Omit<import("../..").OptionalTooltipWrapperProps, "label">) => React.JSX.Element, {
|
|
15
17
|
fieldAppearance?: "modern" | "standard" | undefined;
|
|
16
18
|
fieldTheme?: "grey" | "white" | undefined;
|
|
17
19
|
emphasis?: "bold" | undefined;
|
|
@@ -9,9 +9,9 @@ import { Fragment, jsx } from "react/jsx-runtime";
|
|
|
9
9
|
//#region src/components/pagination/PaginationItems.tsx
|
|
10
10
|
var PaginationItems = () => {
|
|
11
11
|
const { paginationItems } = usePagination();
|
|
12
|
-
return /* @__PURE__ */ jsx(Fragment, { children: paginationItems.map((paginationItem
|
|
12
|
+
return /* @__PURE__ */ jsx(Fragment, { children: paginationItems.map((paginationItem) => {
|
|
13
13
|
switch (paginationItem) {
|
|
14
|
-
case VIEW_ALL_POPOVER: return /* @__PURE__ */ jsx(PaginationPopover, {}, paginationItem
|
|
14
|
+
case VIEW_ALL_POPOVER: return /* @__PURE__ */ jsx(PaginationPopover, {}, paginationItem);
|
|
15
15
|
case GO_TO_PREVIOUS_PAGE: return /* @__PURE__ */ jsx(PaginationPreviousButton, {}, paginationItem);
|
|
16
16
|
case GO_TO_NEXT_PAGE: return /* @__PURE__ */ jsx(PaginationNextButton, {}, paginationItem);
|
|
17
17
|
default: return /* @__PURE__ */ jsx(PaginationPage, { pageNumber: paginationItem }, paginationItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationItems.js","names":[],"sources":["../../../src/components/pagination/PaginationItems.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationNextButton } from './PaginationNextButton'\nimport { PaginationPage } from './PaginationPage'\nimport { PaginationPopover } from './PaginationPopover'\nimport { PaginationPreviousButton } from './PaginationPreviousButton'\nimport { usePagination } from './usePagination'\n\nexport const PaginationItems = () => {\n const { paginationItems } = usePagination()\n\n return (\n <>\n {paginationItems.map((paginationItem
|
|
1
|
+
{"version":3,"file":"PaginationItems.js","names":[],"sources":["../../../src/components/pagination/PaginationItems.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationNextButton } from './PaginationNextButton'\nimport { PaginationPage } from './PaginationPage'\nimport { PaginationPopover } from './PaginationPopover'\nimport { PaginationPreviousButton } from './PaginationPreviousButton'\nimport { usePagination } from './usePagination'\n\nexport const PaginationItems = () => {\n const { paginationItems } = usePagination()\n\n return (\n <>\n {paginationItems.map((paginationItem) => {\n switch (paginationItem) {\n case VIEW_ALL_POPOVER:\n return <PaginationPopover key={paginationItem} />\n case GO_TO_PREVIOUS_PAGE:\n return <PaginationPreviousButton key={paginationItem} />\n case GO_TO_NEXT_PAGE:\n return <PaginationNextButton key={paginationItem} />\n default:\n return (\n <PaginationPage\n key={paginationItem}\n pageNumber={paginationItem}\n />\n )\n }\n })}\n </>\n )\n}\n"],"mappings":";;;;;;;;;AAaA,IAAa,wBAAwB;CACnC,MAAM,EAAE,oBAAoB,cAAc;CAE1C,OACE,oBAAA,UAAA,EAAA,UACG,gBAAgB,KAAK,mBAAmB;EACvC,QAAQ,gBAAR;GACE,KAAK,kBACH,OAAO,oBAAC,mBAAD,CAAyC,GAAjB,cAAiB;GAClD,KAAK,qBACH,OAAO,oBAAC,0BAAD,CAAgD,GAAjB,cAAiB;GACzD,KAAK,iBACH,OAAO,oBAAC,sBAAD,CAA4C,GAAjB,cAAiB;GACrD,SACE,OACE,oBAAC,gBAAD,EAEE,YAAY,eACb,GAFM,cAEN;EAEP;CACF,CAAC,EACD,CAAA;AAEN"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const StyledActionIcon: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, ...rest }: Omit<{
|
|
2
|
+
declare const StyledActionIcon: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, reloadDocument, ...rest }: Omit<{
|
|
3
3
|
theme?: ("danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white">>) | undefined;
|
|
4
4
|
appearance?: ("outline" | "simple" | "solid" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "outline" | "simple" | "solid">>) | undefined;
|
|
5
5
|
size?: ("lg" | "md" | "sm" | "xs" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm" | "xs">>) | undefined;
|
|
6
6
|
isRounded?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
|
|
7
7
|
} & {
|
|
8
8
|
as?: never;
|
|
9
|
-
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "label" | "
|
|
9
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "href" | "label" | "reloadDocument" | "tooltipSide"> & {
|
|
10
10
|
as?: React.ElementType;
|
|
11
11
|
children: React.ReactNode;
|
|
12
|
+
href?: string;
|
|
12
13
|
label: string;
|
|
13
|
-
|
|
14
|
+
reloadDocument?: boolean;
|
|
15
|
+
} & Omit<import("../..").OptionalTooltipWrapperProps, "label">) => React.JSX.Element, unknown>;
|
|
14
16
|
export declare const PaginationNextButton: (props: Partial<React.ComponentProps<typeof StyledActionIcon>>) => React.JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const StyledActionIcon: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, ...rest }: Omit<{
|
|
2
|
+
declare const StyledActionIcon: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, reloadDocument, ...rest }: Omit<{
|
|
3
3
|
theme?: ("danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "danger" | "neutral" | "primary" | "primaryDark" | "success" | "warning" | "white">>) | undefined;
|
|
4
4
|
appearance?: ("outline" | "simple" | "solid" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "outline" | "simple" | "solid">>) | undefined;
|
|
5
5
|
size?: ("lg" | "md" | "sm" | "xs" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm" | "xs">>) | undefined;
|
|
6
6
|
isRounded?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
|
|
7
7
|
} & {
|
|
8
8
|
as?: never;
|
|
9
|
-
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "label" | "
|
|
9
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "href" | "label" | "reloadDocument" | "tooltipSide"> & {
|
|
10
10
|
as?: React.ElementType;
|
|
11
11
|
children: React.ReactNode;
|
|
12
|
+
href?: string;
|
|
12
13
|
label: string;
|
|
13
|
-
|
|
14
|
+
reloadDocument?: boolean;
|
|
15
|
+
} & Omit<import("../..").OptionalTooltipWrapperProps, "label">) => React.JSX.Element, unknown>;
|
|
14
16
|
export declare const PaginationPreviousButton: (props: Partial<React.ComponentProps<typeof StyledActionIcon>>) => React.JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -29,7 +29,7 @@ var getPaginationElementsToRender = (currentPage, pagesCount, visibleElementsCou
|
|
|
29
29
|
if (canFitViewAllPopover) visiblePagesCount -= 1;
|
|
30
30
|
if (canFitEdgePage) visiblePagesCount -= 1;
|
|
31
31
|
const firstPage = paginationPages[0];
|
|
32
|
-
const lastPage = paginationPages
|
|
32
|
+
const lastPage = paginationPages.at(-1);
|
|
33
33
|
/**
|
|
34
34
|
* If we're truncating and current page is at the start of the page list,
|
|
35
35
|
* render the initial truncated page list, e.g.
|
|
@@ -104,14 +104,16 @@ var getPaginationElementsToRender = (currentPage, pagesCount, visibleElementsCou
|
|
|
104
104
|
};
|
|
105
105
|
var findNextAvailablePage = (startPage, disabledPages, pagesCount) => {
|
|
106
106
|
if (startPage > pagesCount) return;
|
|
107
|
+
const disabledSet = new Set(disabledPages);
|
|
107
108
|
let nextPage = startPage;
|
|
108
|
-
while (
|
|
109
|
+
while (disabledSet.has(nextPage)) nextPage++;
|
|
109
110
|
return nextPage;
|
|
110
111
|
};
|
|
111
112
|
var findPreviousAvailablePage = (startPage, disabledPages) => {
|
|
112
113
|
if (startPage < 1) return;
|
|
114
|
+
const disabledSet = new Set(disabledPages);
|
|
113
115
|
let previousPage = startPage;
|
|
114
|
-
while (
|
|
116
|
+
while (disabledSet.has(previousPage)) previousPage--;
|
|
115
117
|
return previousPage;
|
|
116
118
|
};
|
|
117
119
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.helper.js","names":[],"sources":["../../../src/components/pagination/pagination.helper.ts"],"sourcesContent":["import {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport type { PaginationItemsToRender } from './types'\n\nexport const getPaginationElementsToRender = (\n currentPage: number,\n pagesCount: number,\n visibleElementsCount: number\n): PaginationItemsToRender => {\n const paginationPages = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n /*\n * As we always show the `<` `>` arrows,\n * subtract 2 from `visibleElementsCount` (one for each of the GO_TO_PREVIOUS/NEXT_PAGE arrows)\n * to get the `visiblePagesCount`\n */\n let visiblePagesCount = visibleElementsCount - 2\n const withPreviousNextPageArrows = (paginationPages) => [\n GO_TO_PREVIOUS_PAGE,\n ...paginationPages,\n GO_TO_NEXT_PAGE\n ]\n\n /**\n * If fewer pages than threshold for truncating render them all.\n *\n * pagesCount: 6\n * visibleElementsCount: >=6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, 3, 4, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | 3 | | 4 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (pagesCount <= visiblePagesCount) {\n return withPreviousNextPageArrows(paginationPages)\n }\n\n /**\n * If current page is either at the very start or at the very end of the pages\n */\n const canFitEdgePage = visibleElementsCount >= 5\n const canFitViewAllPopover = visibleElementsCount >= 4\n const canFitPages = visibleElementsCount >= 3\n\n if (canFitViewAllPopover) {\n // Subtract one from visiblePagesCount to accomodate for us adding the `[…]` VIEW_ALL_POPOVER\n visiblePagesCount -= 1\n }\n\n if (canFitEdgePage) {\n // Subtract one more from visiblePagesCount to accomodate for us adding the GO_TO_PREVIOUS/NEXT_PAGE arrows\n visiblePagesCount -= 1\n }\n\n const firstPage = paginationPages[0]\n const lastPage = paginationPages
|
|
1
|
+
{"version":3,"file":"pagination.helper.js","names":[],"sources":["../../../src/components/pagination/pagination.helper.ts"],"sourcesContent":["import {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport type { PaginationItemsToRender } from './types'\n\nexport const getPaginationElementsToRender = (\n currentPage: number,\n pagesCount: number,\n visibleElementsCount: number\n): PaginationItemsToRender => {\n const paginationPages = Array.from(\n { length: pagesCount },\n (_, index) => index + 1\n )\n\n /*\n * As we always show the `<` `>` arrows,\n * subtract 2 from `visibleElementsCount` (one for each of the GO_TO_PREVIOUS/NEXT_PAGE arrows)\n * to get the `visiblePagesCount`\n */\n let visiblePagesCount = visibleElementsCount - 2\n const withPreviousNextPageArrows = (paginationPages) => [\n GO_TO_PREVIOUS_PAGE,\n ...paginationPages,\n GO_TO_NEXT_PAGE\n ]\n\n /**\n * If fewer pages than threshold for truncating render them all.\n *\n * pagesCount: 6\n * visibleElementsCount: >=6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, 3, 4, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | 3 | | 4 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (pagesCount <= visiblePagesCount) {\n return withPreviousNextPageArrows(paginationPages)\n }\n\n /**\n * If current page is either at the very start or at the very end of the pages\n */\n const canFitEdgePage = visibleElementsCount >= 5\n const canFitViewAllPopover = visibleElementsCount >= 4\n const canFitPages = visibleElementsCount >= 3\n\n if (canFitViewAllPopover) {\n // Subtract one from visiblePagesCount to accomodate for us adding the `[…]` VIEW_ALL_POPOVER\n visiblePagesCount -= 1\n }\n\n if (canFitEdgePage) {\n // Subtract one more from visiblePagesCount to accomodate for us adding the GO_TO_PREVIOUS/NEXT_PAGE arrows\n visiblePagesCount -= 1\n }\n\n const firstPage = paginationPages[0]\n // Non-null: this line is only reached when pagesCount exceeds the visible\n // threshold, so paginationPages always has a last element. `.at()` widens to\n // `T | undefined`, which the index access it replaced did not.\n const lastPage = paginationPages.at(-1)!\n\n /**\n * If we're truncating and current page is at the start of the page list,\n * render the initial truncated page list, e.g.\n *\n * pagesCount: 8\n * currentPage: 1/2\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, 2, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | 2 | | … | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage < visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitPages) {\n newPaginationItems.push(...paginationPages.slice(0, visiblePagesCount))\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitEdgePage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page is towards the end of the\n * page list (depending on visibleElementsCount),\n * render a truncated page list from the end, e.g.\n *\n * pagesCount: 8\n * currentPage: 7/8\n * visibleElementsCount: 6\n * returns [GO_TO_PREVIOUS_PAGE, 1, VIEW_ALL_POPOVER, 7, 8, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 1 | | … | | 7 | | 8 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n */\n if (currentPage > pagesCount - visiblePagesCount) {\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitEdgePage) {\n newPaginationItems.push(firstPage)\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitPages) {\n newPaginationItems.push(\n ...paginationPages.slice(pagesCount - visiblePagesCount, pagesCount)\n )\n }\n return withPreviousNextPageArrows(newPaginationItems)\n }\n\n /**\n * If we're truncating and the current page doesn't meet any of the previous conditions\n * (we're in the middle)\n * render a truncated page list from a specific index relative to `currentPage`, e.g.\n *\n * currentPage: 4\n * visibleElementsCount: 6 // VisibleElementsAmount.LESS\n * returns [GO_TO_PREVIOUS_PAGE, 3, 4, VIEW_ALL_POPOVER, 6, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 3 | | 4 | | … | | 6 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+\n *\n * currentPage: 6\n * visibleElementsCount: 8 // VisibleElementsAmount.MORE\n * returns [GO_TO_PREVIOUS_PAGE, 4, 5, 6, 7, VIEW_ALL_POPOVER, 10, GO_TO_NEXT_PAGE]\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n * | < | | 4 | | 5 | | 6 | | 7 | | … | | 10 | | > |\n * +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+\n */\n const canFitCurrentPage = canFitPages\n const canFitCurrentPageAndPreviousPage = visibleElementsCount >= 6\n const canFitCurrentPageAndPreviousPageAndNextPage = visibleElementsCount >= 7\n const canFitLastPage = canFitEdgePage\n\n const newPaginationItems = [] as PaginationItemsToRender\n if (canFitCurrentPageAndPreviousPageAndNextPage) {\n newPaginationItems.push(\n ...paginationPages.slice(\n currentPage + 1 - visiblePagesCount,\n currentPage + 1\n )\n )\n } else if (canFitCurrentPageAndPreviousPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - visiblePagesCount, currentPage)\n )\n } else if (canFitCurrentPage) {\n newPaginationItems.push(\n ...paginationPages.slice(currentPage - 1, currentPage - 1 + 1)\n )\n }\n if (canFitViewAllPopover) {\n newPaginationItems.push(VIEW_ALL_POPOVER)\n }\n if (canFitLastPage) {\n newPaginationItems.push(lastPage)\n }\n return withPreviousNextPageArrows(newPaginationItems)\n}\n\nexport const findNextAvailablePage = (\n startPage: number,\n disabledPages: number[],\n pagesCount: number\n): number | undefined => {\n if (startPage > pagesCount) return\n const disabledSet = new Set(disabledPages)\n let nextPage = startPage\n while (disabledSet.has(nextPage)) {\n nextPage++\n }\n return nextPage\n}\n\nexport const findPreviousAvailablePage = (\n startPage: number,\n disabledPages: number[]\n): number | undefined => {\n if (startPage < 1) return\n const disabledSet = new Set(disabledPages)\n let previousPage = startPage\n while (disabledSet.has(previousPage)) {\n previousPage--\n }\n return previousPage\n}\n"],"mappings":";;AAOA,IAAa,iCACX,aACA,YACA,yBAC4B;CAC5B,MAAM,kBAAkB,MAAM,KAC5B,EAAE,QAAQ,WAAW,IACpB,GAAG,UAAU,QAAQ,CACxB;CAOA,IAAI,oBAAoB,uBAAuB;CAC/C,MAAM,8BAA8B,oBAAoB;EACtD;EACA,GAAG;EACH;CACF;;;;;;;;;;;;CAaA,IAAI,cAAc,mBAChB,OAAO,2BAA2B,eAAe;;;;CAMnD,MAAM,iBAAiB,wBAAwB;CAC/C,MAAM,uBAAuB,wBAAwB;CACrD,MAAM,cAAc,wBAAwB;CAE5C,IAAI,sBAEF,qBAAqB;CAGvB,IAAI,gBAEF,qBAAqB;CAGvB,MAAM,YAAY,gBAAgB;CAIlC,MAAM,WAAW,gBAAgB,GAAG,EAAE;;;;;;;;;;;;;;CAetC,IAAI,cAAc,mBAAmB;EACnC,MAAM,qBAAqB,CAAC;EAC5B,IAAI,aACF,mBAAmB,KAAK,GAAG,gBAAgB,MAAM,GAAG,iBAAiB,CAAC;EAExE,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;EAE1C,IAAI,gBACF,mBAAmB,KAAK,QAAQ;EAElC,OAAO,2BAA2B,kBAAkB;CACtD;;;;;;;;;;;;;;;CAgBA,IAAI,cAAc,aAAa,mBAAmB;EAChD,MAAM,qBAAqB,CAAC;EAC5B,IAAI,gBACF,mBAAmB,KAAK,SAAS;EAEnC,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;EAE1C,IAAI,aACF,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,aAAa,mBAAmB,UAAU,CACrE;EAEF,OAAO,2BAA2B,kBAAkB;CACtD;;;;;;;;;;;;;;;;;;;;CAqBA,MAAM,oBAAoB;CAC1B,MAAM,mCAAmC,wBAAwB;CACjE,MAAM,8CAA8C,wBAAwB;CAC5E,MAAM,iBAAiB;CAEvB,MAAM,qBAAqB,CAAC;CAC5B,IAAI,6CACF,mBAAmB,KACjB,GAAG,gBAAgB,MACjB,cAAc,IAAI,mBAClB,cAAc,CAChB,CACF;MACK,IAAI,kCACT,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,mBAAmB,WAAW,CACvE;MACK,IAAI,mBACT,mBAAmB,KACjB,GAAG,gBAAgB,MAAM,cAAc,GAAG,cAAc,IAAI,CAAC,CAC/D;CAEF,IAAI,sBACF,mBAAmB,KAAK,gBAAgB;CAE1C,IAAI,gBACF,mBAAmB,KAAK,QAAQ;CAElC,OAAO,2BAA2B,kBAAkB;AACtD;AAEA,IAAa,yBACX,WACA,eACA,eACuB;CACvB,IAAI,YAAY,YAAY;CAC5B,MAAM,cAAc,IAAI,IAAI,aAAa;CACzC,IAAI,WAAW;CACf,OAAO,YAAY,IAAI,QAAQ,GAC7B;CAEF,OAAO;AACT;AAEA,IAAa,6BACX,WACA,kBACuB;CACvB,IAAI,YAAY,GAAG;CACnB,MAAM,cAAc,IAAI,IAAI,aAAa;CACzC,IAAI,eAAe;CACnB,OAAO,YAAY,IAAI,YAAY,GACjC;CAEF,OAAO;AACT"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const Router: {
|
|
2
|
+
Provider: {
|
|
3
|
+
({ link, children }: {
|
|
4
|
+
link: import("react").ComponentClass<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, any> | import("react").FunctionComponent<import("react").AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.js","names":[],"sources":["../../../src/components/router-provider/Router.ts"],"sourcesContent":["import { RouterProvider } from './RouterProvider'\n\n// The router integration lives under the `Router` name; there is no root\n// component to render, only the context provider. This compound must live in\n// its own module, not the components barrel — a value declared in the barrel\n// forces the root barrel's `export *` to pull the whole barrel (all components)\n// into the eager entry chunk instead of resolving each export to its individual\n// module.\nexport const Router = { Provider: RouterProvider }\n"],"mappings":";;AAQA,IAAa,SAAS,EAAE,UAAU,eAAe"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type LinkComponent = React.ComponentType<React.AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
3
|
+
type RouterProviderProps = {
|
|
4
|
+
link: LinkComponent;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function RouterProvider({ link, children }: RouterProviderProps): React.JSX.Element;
|
|
8
|
+
export declare namespace RouterProvider {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const useRouterLinkProps: (href?: string, { reloadDocument }?: {
|
|
12
|
+
reloadDocument?: boolean;
|
|
13
|
+
}) => {
|
|
14
|
+
as?: React.ElementType;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/router-provider/RouterProvider.tsx
|
|
4
|
+
var RouterContext = React$1.createContext({});
|
|
5
|
+
var RouterProvider = ({ link, children }) => {
|
|
6
|
+
const value = React$1.useMemo(() => ({ link }), [link]);
|
|
7
|
+
return /* @__PURE__ */ jsx(RouterContext.Provider, {
|
|
8
|
+
value,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var isAbsoluteUrl = (url) => /^https?:\/\//.test(url || "");
|
|
13
|
+
var EMPTY = {};
|
|
14
|
+
var useRouterLinkProps = (href, { reloadDocument } = {}) => {
|
|
15
|
+
const { link } = React$1.useContext(RouterContext);
|
|
16
|
+
if (!link || !href || isAbsoluteUrl(href) || reloadDocument) return EMPTY;
|
|
17
|
+
return { as: link };
|
|
18
|
+
};
|
|
19
|
+
RouterProvider.displayName = "Router.Provider";
|
|
20
|
+
//#endregion
|
|
21
|
+
export { RouterProvider, useRouterLinkProps };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=RouterProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouterProvider.js","names":[],"sources":["../../../src/components/router-provider/RouterProvider.tsx"],"sourcesContent":["import * as React from 'react'\n\ntype LinkComponent = React.ComponentType<\n React.AnchorHTMLAttributes<HTMLAnchorElement>\n>\n\ntype RouterContextValue = {\n link?: LinkComponent\n}\n\nconst RouterContext = React.createContext<RouterContextValue>({})\n\ntype RouterProviderProps = {\n link: LinkComponent\n children: React.ReactNode\n}\n\nexport const RouterProvider = ({ link, children }: RouterProviderProps) => {\n const value = React.useMemo<RouterContextValue>(() => ({ link }), [link])\n return (\n <RouterContext.Provider value={value}>{children}</RouterContext.Provider>\n )\n}\n\nconst isAbsoluteUrl = (url?: string) => /^https?:\\/\\//.test(url || '')\n\n// `as` is surfaced as the broad `React.ElementType` (not the narrower\n// `LinkComponent`) so it feeds straight into styled()'s polymorphic `as` prop:\n// a concrete component type makes TS infer element-specific props and reject the\n// call, whereas `ElementType` lets inference land on the polymorphic signature.\nconst EMPTY: { as?: React.ElementType } = {}\n\nexport const useRouterLinkProps = (\n href?: string,\n { reloadDocument }: { reloadDocument?: boolean } = {}\n): { as?: React.ElementType } => {\n const { link } = React.useContext(RouterContext)\n\n if (!link || !href || isAbsoluteUrl(href) || reloadDocument) {\n return EMPTY\n }\n\n return { as: link }\n}\n\nRouterProvider.displayName = 'Router.Provider'\n"],"mappings":";;;AAUA,IAAM,gBAAgB,QAAM,cAAkC,CAAC,CAAC;AAOhE,IAAa,kBAAkB,EAAE,MAAM,eAAoC;CACzE,MAAM,QAAQ,QAAM,eAAmC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC;CACxE,OACE,oBAAC,cAAc,UAAf;EAA+B;EAAQ;CAAiC,CAAA;AAE5E;AAEA,IAAM,iBAAiB,QAAiB,eAAe,KAAK,OAAO,EAAE;AAMrE,IAAM,QAAoC,CAAC;AAE3C,IAAa,sBACX,MACA,EAAE,mBAAiD,CAAC,MACrB;CAC/B,MAAM,EAAE,SAAS,QAAM,WAAW,aAAa;CAE/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,cAAc,IAAI,KAAK,gBAC3C,OAAO;CAGT,OAAO,EAAE,IAAI,KAAK;AACpB;AAEA,eAAe,cAAc"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuProps = Omit<AriaComponents.SelectProps<object>, 'className' | 'style' | 'children'> & {
|
|
4
4
|
size?: 'sm' | 'md' | 'lg';
|
|
5
5
|
theme?: 'white' | 'grey';
|
|
6
6
|
state?: 'error';
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
7
9
|
};
|
|
8
|
-
export declare const SelectMenu: (({ size, theme, state, children, ...rest }: SelectMenuProps) => React.JSX.Element) & {
|
|
9
|
-
Trigger: ({ ref, placeholder, children, ...rest }:
|
|
10
|
+
export declare const SelectMenu: (({ size, theme, state, className, children, ...rest }: SelectMenuProps) => React.JSX.Element) & {
|
|
11
|
+
Trigger: ({ ref, placeholder, children, ...rest }: Omit<AriaComponents.ButtonProps & React.RefAttributes<HTMLButtonElement>, "aria-label" | "aria-labelledby" | "children"> & {
|
|
10
12
|
placeholder?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
11
14
|
}) => React.JSX.Element;
|
|
12
|
-
Content: ({ ref, children,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
Content: ({ ref, children, offset, ...rest }: Omit<AriaComponents.PopoverProps & React.RefAttributes<HTMLElement>, "children"> & {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}) => React.JSX.Element;
|
|
18
|
+
Item: ({ children, textValue, ...rest }: Omit<AriaComponents.ListBoxItemProps<object>, "children"> & {
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
|
+
Group: <T>(props: AriaComponents.ListBoxSectionProps<T> & React.RefAttributes<HTMLElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
15
22
|
Label: {
|
|
16
|
-
({ className, ...rest }:
|
|
23
|
+
({ className, ...rest }: AriaComponents.HeaderProps & React.RefAttributes<HTMLElement>): React.JSX.Element;
|
|
17
24
|
displayName: string;
|
|
18
25
|
};
|
|
19
|
-
Separator: import("../..").StyledComponent<React.
|
|
26
|
+
Separator: import("../..").StyledComponent<(props: AriaComponents.SeparatorProps & React.RefAttributes<HTMLElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null, unknown>;
|
|
20
27
|
};
|
|
21
28
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cn } from "../../styled.js";
|
|
1
2
|
import { SelectMenuContext } from "./SelectMenu.context.js";
|
|
2
3
|
import { SelectMenuContent } from "./SelectMenuContent.js";
|
|
3
4
|
import { SelectMenuItem } from "./SelectMenuItem.js";
|
|
@@ -6,9 +7,9 @@ import { SelectMenuSeparator } from "./SelectMenuSeparator.js";
|
|
|
6
7
|
import { SelectMenuTrigger } from "./SelectMenuTrigger.js";
|
|
7
8
|
import * as React$1 from "react";
|
|
8
9
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
import * as
|
|
10
|
+
import * as AriaComponents from "react-aria-components";
|
|
10
11
|
//#region src/components/select-menu/SelectMenu.tsx
|
|
11
|
-
var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest }) => {
|
|
12
|
+
var SelectMenuRoot = ({ size = "md", theme = "grey", state, className, children, ...rest }) => {
|
|
12
13
|
return /* @__PURE__ */ jsx(SelectMenuContext, {
|
|
13
14
|
value: React$1.useMemo(() => ({
|
|
14
15
|
size,
|
|
@@ -19,7 +20,8 @@ var SelectMenuRoot = ({ size = "md", theme = "grey", state, children, ...rest })
|
|
|
19
20
|
theme,
|
|
20
21
|
state
|
|
21
22
|
]),
|
|
22
|
-
children: /* @__PURE__ */ jsx(
|
|
23
|
+
children: /* @__PURE__ */ jsx(AriaComponents.Select, {
|
|
24
|
+
className: cn("w-full", className),
|
|
23
25
|
...rest,
|
|
24
26
|
children
|
|
25
27
|
})
|
|
@@ -29,7 +31,7 @@ var SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {
|
|
|
29
31
|
Trigger: SelectMenuTrigger,
|
|
30
32
|
Content: SelectMenuContent,
|
|
31
33
|
Item: SelectMenuItem,
|
|
32
|
-
Group:
|
|
34
|
+
Group: AriaComponents.ListBoxSection,
|
|
33
35
|
Label: SelectMenuLabel,
|
|
34
36
|
Separator: SelectMenuSeparator
|
|
35
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenu.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.tsx"],"sourcesContent":["import * as
|
|
1
|
+
{"version":3,"file":"SelectMenu.js","names":[],"sources":["../../../src/components/select-menu/SelectMenu.tsx"],"sourcesContent":["import * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { cn } from '../../styled'\nimport { SelectMenuContext } from './SelectMenu.context'\nimport { SelectMenuContent } from './SelectMenuContent'\nimport { SelectMenuItem } from './SelectMenuItem'\nimport { SelectMenuLabel } from './SelectMenuLabel'\nimport { SelectMenuSeparator } from './SelectMenuSeparator'\nimport { SelectMenuTrigger } from './SelectMenuTrigger'\n\ntype SelectMenuProps = Omit<\n AriaComponents.SelectProps<object>,\n 'className' | 'style' | 'children'\n> & {\n size?: 'sm' | 'md' | 'lg'\n theme?: 'white' | 'grey'\n state?: 'error'\n className?: string\n children?: React.ReactNode\n}\n\nconst SelectMenuRoot = ({\n size = 'md',\n theme = 'grey',\n state,\n className,\n children,\n ...rest\n}: SelectMenuProps) => {\n const value = React.useMemo(\n () => ({ size, theme, state }),\n [size, theme, state]\n )\n return (\n <SelectMenuContext value={value}>\n {/* w-full so the trigger fills its container even in flex/inline layouts\n (react-aria wraps the trigger in an extra div). Consumers can override\n the width — or anything else — via className, e.g. w-auto / w-64. */}\n <AriaComponents.Select className={cn('w-full', className)} {...rest}>\n {children}\n </AriaComponents.Select>\n </SelectMenuContext>\n )\n}\n\nexport const SelectMenu = /* @__PURE__ */ Object.assign(SelectMenuRoot, {\n Trigger: SelectMenuTrigger,\n Content: SelectMenuContent,\n Item: SelectMenuItem,\n Group: AriaComponents.ListBoxSection,\n Label: SelectMenuLabel,\n Separator: SelectMenuSeparator\n})\n"],"mappings":";;;;;;;;;;;AAsBA,IAAM,kBAAkB,EACtB,OAAO,MACP,QAAQ,QACR,OACA,WACA,UACA,GAAG,WACkB;CAKrB,OACE,oBAAC,mBAAD;EAA0B,OALd,QAAM,eACX;GAAE;GAAM;GAAO;EAAM,IAC5B;GAAC;GAAM;GAAO;EAAK,CAGO;YAIxB,oBAAC,eAAe,QAAhB;GAAuB,WAAW,GAAG,UAAU,SAAS;GAAG,GAAI;GAC5D;EACoB,CAAA;CACN,CAAA;AAEvB;AAEA,IAAa,aAA6B,uBAAO,OAAO,gBAAgB;CACtE,SAAS;CACT,SAAS;CACT,MAAM;CACN,OAAO,eAAe;CACtB,OAAO;CACP,WAAW;AACb,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuContentProps = Omit<React.ComponentPropsWithRef<typeof AriaComponents.Popover>, 'children'> & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SelectMenuContent: ({ ref, children, offset, ...rest }: SelectMenuContentProps) => React.JSX.Element;
|
|
5
7
|
export {};
|
|
@@ -1,73 +1,32 @@
|
|
|
1
1
|
import { styled } from "../../styled.js";
|
|
2
|
-
import { Icon } from "../icon/Icon.js";
|
|
3
2
|
import "react";
|
|
4
|
-
import { jsx
|
|
5
|
-
import
|
|
6
|
-
import * as RadixSelect from "@radix-ui/react-select";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as AriaComponents from "react-aria-components";
|
|
7
5
|
//#region src/components/select-menu/SelectMenuContent.tsx
|
|
8
|
-
var Content = styled(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
popper: ["max-h-(--radix-select-content-available-height)", "min-w-(--radix-select-trigger-width)"],
|
|
27
|
-
"item-aligned": []
|
|
28
|
-
} }
|
|
29
|
-
});
|
|
30
|
-
var Viewport = styled(RadixSelect.Viewport, {
|
|
31
|
-
base: ["p-1", "w-full"],
|
|
32
|
-
variants: { position: {
|
|
33
|
-
popper: ["h-(--radix-select-content-available-height)"],
|
|
34
|
-
"item-aligned": []
|
|
35
|
-
} }
|
|
36
|
-
});
|
|
37
|
-
var ScrollUpButton = styled(RadixSelect.ScrollUpButton, { base: [
|
|
38
|
-
"flex",
|
|
39
|
-
"items-center",
|
|
40
|
-
"justify-center",
|
|
41
|
-
"h-6",
|
|
42
|
-
"cursor-default"
|
|
43
|
-
] });
|
|
44
|
-
var ScrollDownButton = styled(RadixSelect.ScrollDownButton, { base: [
|
|
45
|
-
"flex",
|
|
46
|
-
"items-center",
|
|
47
|
-
"justify-center",
|
|
48
|
-
"h-6",
|
|
49
|
-
"cursor-default"
|
|
50
|
-
] });
|
|
51
|
-
var SelectMenuContent = ({ ref, children, position = "popper", sideOffset = 4, ...rest }) => /* @__PURE__ */ jsx(RadixSelect.Portal, { children: /* @__PURE__ */ jsxs(Content, {
|
|
6
|
+
var Content = styled(AriaComponents.Popover, { base: [
|
|
7
|
+
"bg-white",
|
|
8
|
+
"rounded-md",
|
|
9
|
+
"shadow-lg",
|
|
10
|
+
"z-10",
|
|
11
|
+
"overflow-hidden",
|
|
12
|
+
"will-change-transform",
|
|
13
|
+
"min-w-[var(--trigger-width)]",
|
|
14
|
+
"max-w-[min(calc(100vw-(--spacing(4))),--spacing(100))]"
|
|
15
|
+
] }, { enablePolymorphism: false });
|
|
16
|
+
var Viewport = styled(AriaComponents.ListBox, { base: [
|
|
17
|
+
"max-h-[inherit]",
|
|
18
|
+
"w-full",
|
|
19
|
+
"overflow-auto",
|
|
20
|
+
"p-1",
|
|
21
|
+
"outline-none"
|
|
22
|
+
] }, { enablePolymorphism: false });
|
|
23
|
+
var SelectMenuContent = ({ ref, children, offset = 4, ...rest }) => /* @__PURE__ */ jsx(Content, {
|
|
52
24
|
ref,
|
|
53
|
-
|
|
54
|
-
|
|
25
|
+
offset,
|
|
26
|
+
containerPadding: 8,
|
|
55
27
|
...rest,
|
|
56
|
-
children:
|
|
57
|
-
|
|
58
|
-
is: ChevronUp,
|
|
59
|
-
className: "text-grey-700 size-4"
|
|
60
|
-
}) }),
|
|
61
|
-
/* @__PURE__ */ jsx(Viewport, {
|
|
62
|
-
position,
|
|
63
|
-
children
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ jsx(ScrollDownButton, { children: /* @__PURE__ */ jsx(Icon, {
|
|
66
|
-
is: ChevronDown,
|
|
67
|
-
className: "text-grey-700 size-4"
|
|
68
|
-
}) })
|
|
69
|
-
]
|
|
70
|
-
}) });
|
|
28
|
+
children: /* @__PURE__ */ jsx(Viewport, { children })
|
|
29
|
+
});
|
|
71
30
|
//#endregion
|
|
72
31
|
export { SelectMenuContent };
|
|
73
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenuContent.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuContent.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"SelectMenuContent.js","names":[],"sources":["../../../src/components/select-menu/SelectMenuContent.tsx"],"sourcesContent":["import * as React from 'react'\nimport * as AriaComponents from 'react-aria-components'\n\nimport { styled } from '../../styled'\n\nconst Content = styled(\n AriaComponents.Popover,\n {\n base: [\n 'bg-white',\n 'rounded-md',\n 'shadow-lg',\n 'z-10',\n 'overflow-hidden',\n 'will-change-transform',\n // Floors at the trigger width; caps at min(viewport − 8px per edge, 400px)\n // on the --spacing() scale: --spacing(4)=16px (2×8px), --spacing(100)=400px.\n 'min-w-[var(--trigger-width)]',\n 'max-w-[min(calc(100vw-(--spacing(4))),--spacing(100))]'\n ]\n },\n { enablePolymorphism: false }\n)\n\nconst Viewport = styled(\n AriaComponents.ListBox,\n {\n base: ['max-h-[inherit]', 'w-full', 'overflow-auto', 'p-1', 'outline-none']\n },\n { enablePolymorphism: false }\n)\n\ntype SelectMenuContentProps = Omit<\n React.ComponentPropsWithRef<typeof AriaComponents.Popover>,\n 'children'\n> & {\n children?: React.ReactNode\n}\n\nexport const SelectMenuContent = ({\n ref,\n children,\n offset = 4,\n ...rest\n}: SelectMenuContentProps) => (\n // offset/containerPadding are react-aria positioner props in px (JS numbers,\n // not CSS), so they can't use the --spacing() scale: 4px gap from the trigger,\n // 8px minimum inset from every viewport edge (the 2×8px behind the max-width).\n <Content ref={ref} offset={offset} containerPadding={8} {...rest}>\n <Viewport>{children}</Viewport>\n </Content>\n)\n"],"mappings":";;;;;AAKA,IAAM,UAAU,OACd,eAAe,SACf,EACE,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;AACF,EACF,GACA,EAAE,oBAAoB,MAAM,CAC9B;AAEA,IAAM,WAAW,OACf,eAAe,SACf,EACE,MAAM;CAAC;CAAmB;CAAU;CAAiB;CAAO;AAAc,EAC5E,GACA,EAAE,oBAAoB,MAAM,CAC9B;AASA,IAAa,qBAAqB,EAChC,KACA,UACA,SAAS,GACT,GAAG,WAKH,oBAAC,SAAD;CAAc;CAAa;CAAQ,kBAAkB;CAAG,GAAI;WAC1D,oBAAC,UAAD,EAAW,SAAmB,CAAA;AACvB,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import * as AriaComponents from 'react-aria-components';
|
|
3
|
+
type SelectMenuItemProps = Omit<AriaComponents.ListBoxItemProps, 'children'> & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const SelectMenuItem: ({ children, textValue, ...rest }: SelectMenuItemProps) => React.JSX.Element;
|
|
5
7
|
export {};
|