@atom-learning/components 10.1.0 → 11.0.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.
Files changed (48) hide show
  1. package/dist/components/action-icon/ActionIcon.d.ts +4 -3
  2. package/dist/components/action-icon/ActionIcon.js +4 -2
  3. package/dist/components/action-icon/ActionIcon.js.map +1 -1
  4. package/dist/components/banner/banner-regular/BannerRegular.d.ts +1 -0
  5. package/dist/components/banner/banner-regular/BannerRegularDismiss.d.ts +5 -3
  6. package/dist/components/banner/banner-slim/BannerSlim.d.ts +9 -2
  7. package/dist/components/banner/banner-slim/BannerSlimDismiss.d.ts +5 -3
  8. package/dist/components/button/Button.d.ts +2 -2
  9. package/dist/components/button/Button.js +21 -17
  10. package/dist/components/button/Button.js.map +1 -1
  11. package/dist/components/dropdown-menu/DropdownMenu.d.ts +2 -1
  12. package/dist/components/dropdown-menu/DropdownMenuLinkItem.d.ts +2 -1
  13. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js +18 -13
  14. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -1
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/link/Link.d.ts +2 -2
  17. package/dist/components/link/Link.js +13 -9
  18. package/dist/components/link/Link.js.map +1 -1
  19. package/dist/components/navigation/NavigationMenu.d.ts +2 -1
  20. package/dist/components/navigation/NavigationMenuLink.d.ts +2 -1
  21. package/dist/components/navigation/NavigationMenuLink.js +28 -13
  22. package/dist/components/navigation/NavigationMenuLink.js.map +1 -1
  23. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.d.ts +4 -2
  24. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.d.ts +4 -2
  25. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js +5 -3
  26. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js.map +1 -1
  27. package/dist/components/number-input/NumberInputStepper.d.ts +5 -3
  28. package/dist/components/pagination/PaginationNextButton.d.ts +5 -3
  29. package/dist/components/pagination/PaginationPreviousButton.d.ts +5 -3
  30. package/dist/components/router-provider/Router.d.ts +9 -0
  31. package/dist/components/router-provider/Router.js +7 -0
  32. package/dist/components/router-provider/Router.js.map +1 -0
  33. package/dist/components/router-provider/RouterProvider.d.ts +16 -0
  34. package/dist/components/router-provider/RouterProvider.js +23 -0
  35. package/dist/components/router-provider/RouterProvider.js.map +1 -0
  36. package/dist/components/sortable/Handle.d.ts +5 -3
  37. package/dist/components/tile-interactive/TileInteractive.d.ts +5 -3
  38. package/dist/components/tile-interactive/TileInteractive.js +4 -2
  39. package/dist/components/tile-interactive/TileInteractive.js.map +1 -1
  40. package/dist/components/tile-toggle-group/TileToggleGroupItem.d.ts +5 -2
  41. package/dist/components/top-bar/TopBar.d.ts +4 -2
  42. package/dist/docgen.json +1 -1
  43. package/dist/index.cjs.js +108 -59
  44. package/dist/index.cjs.js.map +1 -1
  45. package/dist/index.d.ts +0 -1
  46. package/dist/index.js +2 -1
  47. package/package.json +1 -1
  48. package/dist/types/navigatorActions.types.d.ts +0 -5
@@ -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 Component = as || (href ? "a" : "button");
20
- const componentProps = as ? {} : href ? getExternalAnchorProps(href) : { type: "button" };
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>\n\nexport const NavigationMenuVerticalLink = ({\n as,\n href,\n children,\n ...rest\n}: NavigationMenuVerticalItemProps) => {\n const Component = (as || (href ? 'a' : 'button')) as React.ElementType\n const componentProps = 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":";;;;;;;;;;AAUA,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,GAAG,WACkC;CACrC,MAAM,YAAa,OAAO,OAAO,MAAM;CACvC,MAAM,iBAAiB,KACnB,CAAC,IACD,OACE,uBAAuB,IAAI,IAC3B,EAAE,MAAM,SAAS;CAEvB,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
+ {"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" | "tooltipSide" | keyof import("../..").NavigatorActions> & {
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
- } & Omit<import("../..").OptionalTooltipWrapperProps, "label"> & import("../..").NavigatorActions) => React.JSX.Element, {
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;
@@ -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" | "tooltipSide" | keyof import("../..").NavigatorActions> & {
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
- } & Omit<import("../..").OptionalTooltipWrapperProps, "label"> & import("../..").NavigatorActions) => React.JSX.Element, unknown>;
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" | "tooltipSide" | keyof import("../..").NavigatorActions> & {
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
- } & Omit<import("../..").OptionalTooltipWrapperProps, "label"> & import("../..").NavigatorActions) => React.JSX.Element, unknown>;
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 {};
@@ -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,7 @@
1
+ import { RouterProvider } from "./RouterProvider.js";
2
+ //#region src/components/router-provider/Router.ts
3
+ var Router = { Provider: RouterProvider };
4
+ //#endregion
5
+ export { Router };
6
+
7
+ //# sourceMappingURL=Router.js.map
@@ -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,17 +1,19 @@
1
1
  import * as React from 'react';
2
2
  import { Icon } from '../icon/Icon';
3
- export declare const StyledHandle: import("../..").PolymorphicComponent<({ ref, children, theme, appearance, size, label, href, disabled, hasTooltip, tooltipSide, ...rest }: Omit<{
3
+ export declare const StyledHandle: 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" | "tooltipSide" | keyof import("../..").NavigatorActions> & {
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
- } & Omit<import("../..").OptionalTooltipWrapperProps, "label"> & import("../..").NavigatorActions) => React.JSX.Element, {
15
+ reloadDocument?: boolean;
16
+ } & Omit<import("../..").OptionalTooltipWrapperProps, "label">) => React.JSX.Element, {
15
17
  isDragging?: boolean | undefined;
16
18
  }>;
17
19
  export type HandleProps = Omit<React.ComponentProps<typeof StyledHandle>, 'children' | 'size'> & {
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import type { NavigatorActions } from '../../types/navigatorActions.types';
3
2
  import type { Override } from '../../utilities/types';
4
3
  declare const StyledTileInteractive: import("../..").PolymorphicComponent<import("../..").PolymorphicComponent<"div", {
5
4
  borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
@@ -14,8 +13,11 @@ declare const StyledTileInteractive: import("../..").PolymorphicComponent<import
14
13
  } & {
15
14
  colorScheme?: import("../..").TcolorScheme;
16
15
  }>;
17
- type TileInteractiveProps = Override<React.ComponentProps<typeof StyledTileInteractive> & React.ButtonHTMLAttributes<HTMLButtonElement> & NavigatorActions, {
16
+ type TileInteractiveProps = Override<React.ComponentProps<typeof StyledTileInteractive> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
17
+ href?: string;
18
+ reloadDocument?: boolean;
19
+ }, {
18
20
  as?: React.ElementType;
19
21
  }>;
20
- export declare const TileInteractive: ({ ref, onClick, href, type, as, ...rest }: TileInteractiveProps) => React.JSX.Element;
22
+ export declare const TileInteractive: ({ ref, onClick, href, type, as, reloadDocument, ...rest }: TileInteractiveProps) => React.JSX.Element;
21
23
  export {};
@@ -1,4 +1,5 @@
1
1
  import { styled } from "../../styled.js";
2
+ import { useRouterLinkProps } from "../router-provider/RouterProvider.js";
2
3
  import { Tile } from "../tile/Tile.js";
3
4
  import "react";
4
5
  import { jsx } from "react/jsx-runtime";
@@ -29,9 +30,10 @@ var StyledTileInteractive = styled(Tile, { base: [
29
30
  "not-disabled:transition-transform",
30
31
  "not-disabled:translate-y-0"
31
32
  ] });
32
- var TileInteractive = ({ ref, onClick, href, type = "button", as, ...rest }) => {
33
+ var TileInteractive = ({ ref, onClick, href, type = "button", as, reloadDocument, ...rest }) => {
34
+ const routerLinkProps = useRouterLinkProps(href, { reloadDocument });
33
35
  const elementSpecificProps = !!href ? {
34
- as: as || "a",
36
+ as: as || routerLinkProps.as || "a",
35
37
  href,
36
38
  onClick: void 0
37
39
  } : {
@@ -1 +1 @@
1
- {"version":3,"file":"TileInteractive.js","names":[],"sources":["../../../src/components/tile-interactive/TileInteractive.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport type { NavigatorActions } from '../../types/navigatorActions.types'\nimport type { Override } from '../../utilities/types'\nimport { Tile } from '../tile/Tile'\n\nconst StyledTileInteractive = styled(Tile, {\n base: [\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--base-2)',\n 'not-disabled:after:absolute',\n 'not-disabled:after:duration-250',\n 'not-disabled:after:ease-out',\n 'not-disabled:after:inset-0',\n 'not-disabled:after:opacity-0',\n 'not-disabled:after:pointer-events-none',\n 'not-disabled:after:rounded-[inherit]',\n 'not-disabled:after:shadow-lg',\n 'not-disabled:after:transition-opacity',\n 'not-disabled:cursor-pointer',\n 'not-disabled:duration-250',\n 'not-disabled:ease-in',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:after:opacity-100',\n 'not-disabled:hover:-translate-y-0.5',\n 'not-disabled:transition-transform',\n 'not-disabled:translate-y-0'\n ]\n})\n\ntype TileInteractiveProps = Override<\n React.ComponentProps<typeof StyledTileInteractive> &\n React.ButtonHTMLAttributes<HTMLButtonElement> &\n NavigatorActions,\n { as?: React.ElementType }\n>\n\nexport const TileInteractive = ({\n ref,\n onClick,\n href,\n type = 'button',\n as,\n ...rest\n}: TileInteractiveProps) => {\n const isLink = !!href\n const elementSpecificProps = isLink\n ? {\n as: as || 'a',\n href,\n onClick: undefined\n }\n : {\n as: as || 'button',\n type,\n onClick\n }\n\n return <StyledTileInteractive {...rest} {...elementSpecificProps} ref={ref} />\n}\n"],"mappings":";;;;;AAOA,IAAM,wBAAwB,OAAO,MAAM,EACzC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AASD,IAAa,mBAAmB,EAC9B,KACA,SACA,MACA,OAAO,UACP,IACA,GAAG,WACuB;CAE1B,MAAM,uBAAuB,CADb,CAAC,OAEb;EACE,IAAI,MAAM;EACV;EACA,SAAS,KAAA;CACX,IACA;EACE,IAAI,MAAM;EACV;EACA;CACF;CAEJ,OAAO,oBAAC,uBAAD;EAAuB,GAAI;EAAM,GAAI;EAA2B;CAAM,CAAA;AAC/E"}
1
+ {"version":3,"file":"TileInteractive.js","names":[],"sources":["../../../src/components/tile-interactive/TileInteractive.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '../../styled'\nimport type { Override } from '../../utilities/types'\nimport { useRouterLinkProps } from '../router-provider/RouterProvider'\nimport { Tile } from '../tile/Tile'\n\nconst StyledTileInteractive = styled(Tile, {\n base: [\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--base-2)',\n 'not-disabled:after:absolute',\n 'not-disabled:after:duration-250',\n 'not-disabled:after:ease-out',\n 'not-disabled:after:inset-0',\n 'not-disabled:after:opacity-0',\n 'not-disabled:after:pointer-events-none',\n 'not-disabled:after:rounded-[inherit]',\n 'not-disabled:after:shadow-lg',\n 'not-disabled:after:transition-opacity',\n 'not-disabled:cursor-pointer',\n 'not-disabled:duration-250',\n 'not-disabled:ease-in',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:after:opacity-100',\n 'not-disabled:hover:-translate-y-0.5',\n 'not-disabled:transition-transform',\n 'not-disabled:translate-y-0'\n ]\n})\n\ntype TileInteractiveProps = Override<\n React.ComponentProps<typeof StyledTileInteractive> &\n React.ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: string\n reloadDocument?: boolean\n },\n { as?: React.ElementType }\n>\n\nexport const TileInteractive = ({\n ref,\n onClick,\n href,\n type = 'button',\n as,\n reloadDocument,\n ...rest\n}: TileInteractiveProps) => {\n const routerLinkProps = useRouterLinkProps(href, { reloadDocument })\n const isLink = !!href\n const elementSpecificProps = isLink\n ? {\n as: as || routerLinkProps.as || 'a',\n href,\n onClick: undefined\n }\n : {\n as: as || 'button',\n type,\n onClick\n }\n\n return <StyledTileInteractive {...rest} {...elementSpecificProps} ref={ref} />\n}\n"],"mappings":";;;;;;AAOA,IAAM,wBAAwB,OAAO,MAAM,EACzC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAWD,IAAa,mBAAmB,EAC9B,KACA,SACA,MACA,OAAO,UACP,IACA,gBACA,GAAG,WACuB;CAC1B,MAAM,kBAAkB,mBAAmB,MAAM,EAAE,eAAe,CAAC;CAEnE,MAAM,uBAAuB,CADb,CAAC,OAEb;EACE,IAAI,MAAM,gBAAgB,MAAM;EAChC;EACA,SAAS,KAAA;CACX,IACA;EACE,IAAI,MAAM;EACV;EACA;CACF;CAEJ,OAAO,oBAAC,uBAAD;EAAuB,GAAI;EAAM,GAAI;EAA2B;CAAM,CAAA;AAC/E"}
@@ -1,6 +1,6 @@
1
1
  import * as ToggleGroup from '@radix-ui/react-toggle-group';
2
2
  import * as React from 'react';
3
- declare const StyledTileToggleGroupItem: import("../..").PolymorphicComponent<({ ref, onClick, href, type, as, ...rest }: Omit<{
3
+ declare const StyledTileToggleGroupItem: import("../..").PolymorphicComponent<({ ref, onClick, href, type, as, reloadDocument, ...rest }: Omit<{
4
4
  borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
5
5
  border?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
6
6
  diffused?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
@@ -16,7 +16,10 @@ declare const StyledTileToggleGroupItem: import("../..").PolymorphicComponent<({
16
16
  colorScheme?: import("../..").TcolorScheme;
17
17
  } & {
18
18
  as?: never;
19
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as" | "border" | "borderRadius" | "colorScheme" | "diffused">, "as" | "border" | "borderRadius" | "colorScheme" | "diffused"> & React.ButtonHTMLAttributes<HTMLButtonElement> & import("../..").NavigatorActions, "as"> & {
19
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as" | "border" | "borderRadius" | "colorScheme" | "diffused">, "as" | "border" | "borderRadius" | "colorScheme" | "diffused"> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
20
+ href?: string;
21
+ reloadDocument?: boolean;
22
+ }, "as"> & {
20
23
  as?: React.ElementType;
21
24
  }) => React.JSX.Element, unknown>;
22
25
  type TileToggleGroupItem = React.ComponentProps<typeof ToggleGroup.Item> & React.ComponentProps<typeof StyledTileToggleGroupItem>;
@@ -34,11 +34,13 @@ export declare const TopBar: {
34
34
  isRounded?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
35
35
  } & {
36
36
  as?: never;
37
- } & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "label" | "tooltipSide" | keyof import("../..").NavigatorActions> & {
37
+ } & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "appearance" | "as" | "isRounded" | "size" | "theme">, "as" | "children" | "hasTooltip" | "href" | "label" | "reloadDocument" | "tooltipSide"> & {
38
38
  as?: React.ElementType;
39
39
  children: React.ReactNode;
40
+ href?: string;
40
41
  label: string;
41
- } & Omit<import("../..").OptionalTooltipWrapperProps, "label"> & import("../..").NavigatorActions, "children" | "size"> & {
42
+ reloadDocument?: boolean;
43
+ } & Omit<import("../..").OptionalTooltipWrapperProps, "label">, "children" | "size"> & {
42
44
  icon: React.FC<React.SVGProps<SVGSVGElement>>;
43
45
  label: string;
44
46
  }) => React.JSX.Element;