@caseparts-org/caseblocks 0.0.75 → 0.0.77

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.
@@ -7,11 +7,16 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
7
7
  external?: boolean;
8
8
  children: React.ReactNode;
9
9
  }
10
+ /** Router component contract (e.g. next/link or react-router Link) */
11
+ export type RouterLike = React.ComponentType<{
12
+ href: string;
13
+ className?: string;
14
+ children: React.ReactNode;
15
+ } & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href">>;
10
16
  export declare function linkClassName({ className, unstyled, disabled, hideAt }: {
11
17
  className?: string;
12
18
  unstyled?: boolean;
13
19
  disabled?: boolean;
14
20
  hideAt?: HideAtProps["hideAt"];
15
21
  }): string;
16
- /** SSR‑safe base link primitive */
17
- export declare function Link({ href, disabled, unstyled, hideAt, className, children, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function Link({ href, disabled, unstyled, external, hideAt, className, children, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
@@ -1,48 +1,54 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { t as f } from "../../Text.module-Dzhzk2fH.js";
3
- import { c as d } from "../../clsx-OuTLNxxd.js";
4
- import { getHideAtStyles as k } from "../HideAt.js";
5
- import '../../assets/Link.css';const p = "_link_ygp31_1", x = "_disabled_ygp31_14", i = {
6
- link: p,
7
- disabled: x
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { t as p } from "../../Text.module-Dzhzk2fH.js";
3
+ import { c as u } from "../../clsx-OuTLNxxd.js";
4
+ import { getHideAtStyles as x } from "../HideAt.js";
5
+ import { routerOverride as l } from "./configureLink.js";
6
+ import '../../assets/Link.css';const k = "_link_ygp31_1", _ = "_disabled_ygp31_14", m = {
7
+ link: k,
8
+ disabled: _
8
9
  };
9
- function _({
10
- className: e,
10
+ function g({
11
+ className: o,
11
12
  unstyled: t,
12
- disabled: o,
13
+ disabled: r,
13
14
  hideAt: n
14
15
  }) {
15
- return d(
16
- e,
17
- !t && f["text-body"],
18
- !t && i.link,
19
- o && i.disabled,
20
- k(n)
16
+ return u(
17
+ o,
18
+ !t && p["text-body"],
19
+ !t && m.link,
20
+ r && m.disabled,
21
+ x(n)
21
22
  );
22
23
  }
23
- function h({
24
- href: e,
24
+ function S({
25
+ href: o,
25
26
  disabled: t = !1,
26
- unstyled: o = !1,
27
- // external,
28
- hideAt: n,
29
- className: r,
30
- children: l,
31
- // onClick,
32
- ...s
27
+ unstyled: r = !1,
28
+ external: n,
29
+ hideAt: c,
30
+ className: f,
31
+ children: i,
32
+ ...e
33
33
  }) {
34
- const a = _({ className: r, unstyled: o, disabled: t, hideAt: n }), m = {
35
- ...s,
36
- href: t ? "#" : e,
37
- className: a,
38
- // onClick: handleClick,
34
+ const d = g({ className: f, unstyled: r, disabled: t, hideAt: c }), a = {
35
+ ...e,
36
+ href: t ? "#" : o,
37
+ className: d,
39
38
  "aria-disabled": t || void 0,
40
- tabIndex: t ? -1 : s.tabIndex,
41
- role: t ? "link" : s.role
39
+ tabIndex: t ? -1 : e.tabIndex,
40
+ role: t ? "link" : e.role
42
41
  };
43
- return /* @__PURE__ */ c("a", { ...m, children: l });
42
+ return l ? /* @__PURE__ */ s(
43
+ l,
44
+ {
45
+ ...a,
46
+ "data-router-adapter": "configured",
47
+ children: i
48
+ }
49
+ ) : /* @__PURE__ */ s("a", { ...a, children: i });
44
50
  }
45
51
  export {
46
- h as Link,
47
- _ as linkClassName
52
+ S as Link,
53
+ g as linkClassName
48
54
  };
@@ -0,0 +1,3 @@
1
+ import { RouterLike } from './Link';
2
+ export declare let routerOverride: RouterLike | null;
3
+ export declare function configureLink(router: RouterLike): void;
@@ -0,0 +1,8 @@
1
+ let r = null;
2
+ function n(e) {
3
+ r = e;
4
+ }
5
+ export {
6
+ n as configureLink,
7
+ r as routerOverride
8
+ };
@@ -3,4 +3,4 @@ import { LinkProps } from '../Link/Link';
3
3
  import { ButtonStyleProps } from '../Button/buttonClassName';
4
4
  export interface LinkButtonProps extends LinkProps, HideAtProps, ButtonStyleProps {
5
5
  }
6
- export declare function LinkButton({ href, children, size, variant, hideAt, className, disabled, onClick, ...otherProps }: LinkButtonProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function LinkButton({ href, children, size, variant, hideAt, className, disabled, ...otherProps }: LinkButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,39 +1,31 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { Link as l } from "../Link/Link.js";
3
- import { buttonClassNames as x } from "../Button/buttonClassName.js";
4
- import { c as N } from "../../clsx-OuTLNxxd.js";
5
- function v({
6
- href: m,
7
- children: n,
8
- size: s,
9
- variant: e,
10
- hideAt: a,
11
- className: u,
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Link as u } from "../Link/Link.js";
3
+ import { buttonClassNames as f } from "../Button/buttonClassName.js";
4
+ import { c as p } from "../../clsx-OuTLNxxd.js";
5
+ function L({
6
+ href: o,
7
+ children: r,
8
+ size: m,
9
+ variant: s,
10
+ hideAt: n,
11
+ className: e,
12
12
  disabled: t,
13
- onClick: r,
14
- ...f
13
+ // onClick,
14
+ ...a
15
15
  }) {
16
- const p = x({ size: s, variant: e, hideAt: a, className: N(u), disabled: t });
17
- function i(o) {
18
- if (t) {
19
- o.preventDefault(), o.stopPropagation();
20
- return;
21
- }
22
- r == null || r(o);
23
- }
24
- return /* @__PURE__ */ c(
25
- l,
16
+ const c = f({ size: m, variant: s, hideAt: n, className: p(e), disabled: t });
17
+ return /* @__PURE__ */ i(
18
+ u,
26
19
  {
27
- href: m,
28
- className: p,
20
+ href: o,
21
+ className: c,
29
22
  disabled: t,
30
- onClick: i,
31
23
  unstyled: !0,
32
- ...f,
33
- children: n
24
+ ...a,
25
+ children: r
34
26
  }
35
27
  );
36
28
  }
37
29
  export {
38
- v as LinkButton
30
+ L as LinkButton
39
31
  };
@@ -1,6 +1,4 @@
1
1
  export * from './main-server';
2
- export { LinkButton } from './atoms/LinkButton/LinkButton';
3
- export type { LinkButtonProps } from './atoms/LinkButton/LinkButton';
4
2
  export { Image, ImageProvider } from './atoms/Image/Image';
5
3
  export type { ImageProps } from './atoms/Image/Image';
6
4
  export { Tooltip } from './molecules/Tooltip/Tooltip';
@@ -1,70 +1,71 @@
1
1
  import { Button as t } from "./atoms/Button/Button.js";
2
2
  import { Flex as p } from "./atoms/Flex/Flex.js";
3
3
  import { Column as x, Grid as f } from "./atoms/Grid/Grid.js";
4
- import { Head as n } from "./atoms/Root/Head.js";
4
+ import { Head as i } from "./atoms/Root/Head.js";
5
5
  import { Icon as u } from "./atoms/Icon/Icon.js";
6
6
  import { Root as c } from "./atoms/Root/Root.js";
7
- import { Separator as C } from "./atoms/Separator/Separator.js";
8
- import { Text as A } from "./atoms/Text/Text.js";
9
- import { Input as B } from "./atoms/Input/Input.js";
10
- import { Link as h } from "./atoms/Link/Link.js";
11
- import { createLinkAdapter as L } from "./atoms/Link/createLinkAdapter.js";
12
- import { Logo as T } from "./molecules/Logo/Logo.js";
13
- import { SearchBox as P } from "./molecules/SearchBox/SearchBox.js";
14
- import { QuantityInput as M } from "./molecules/QuantityInput/QuantityInput.js";
15
- import { Pricing as b } from "./molecules/Pricing/Pricing.js";
16
- import { LinkButton as w } from "./atoms/LinkButton/LinkButton.js";
17
- import { Image as H, ImageProvider as Q } from "./atoms/Image/Image.js";
7
+ import { Separator as g } from "./atoms/Separator/Separator.js";
8
+ import { Text as k } from "./atoms/Text/Text.js";
9
+ import { Input as A } from "./atoms/Input/Input.js";
10
+ import { Link as I } from "./atoms/Link/Link.js";
11
+ import { configureLink as L, routerOverride as S } from "./atoms/Link/configureLink.js";
12
+ import { LinkButton as F } from "./atoms/LinkButton/LinkButton.js";
13
+ import { Logo as y } from "./molecules/Logo/Logo.js";
14
+ import { SearchBox as N } from "./molecules/SearchBox/SearchBox.js";
15
+ import { QuantityInput as s } from "./molecules/QuantityInput/QuantityInput.js";
16
+ import { Pricing as G } from "./molecules/Pricing/Pricing.js";
17
+ import { Image as O, ImageProvider as Q } from "./atoms/Image/Image.js";
18
18
  import { Tooltip as V } from "./molecules/Tooltip/Tooltip.js";
19
19
  import { Account as q } from "./molecules/Account/Account.js";
20
20
  import { Avatar as D } from "./molecules/Avatar/Avatar.js";
21
21
  import { Chip as J } from "./molecules/Chip/Chip.js";
22
- import { ToggleView as O } from "./molecules/ToggleView/ToggleView.js";
23
- import { StatefulButton as W } from "./molecules/StatefulButton/StatefulButton.js";
24
- import { AnimatedCheckMark as Y } from "./molecules/StatefulButton/AnimatedCheckmark.js";
25
- import { AddToCart as _ } from "./molecules/AddToCart/AddToCart.js";
26
- import { Availability as oo } from "./molecules/Availability/Availability.js";
27
- import { BannerCard as to } from "./molecules/BannerCard/BannerCard.js";
28
- import { MainNav as po } from "./organisms/MainNav/MainNav.js";
29
- import { ChipSelector as xo } from "./organisms/ChipSelector/ChipSelector.js";
30
- import { Product as ao } from "./organisms/Product/Product.js";
31
- import { NotFound as io } from "./organisms/NotFound/NotFound.js";
32
- import { Carousel as co } from "./organisms/Carousel/Carousel.js";
22
+ import { ToggleView as U } from "./molecules/ToggleView/ToggleView.js";
23
+ import { StatefulButton as X } from "./molecules/StatefulButton/StatefulButton.js";
24
+ import { AnimatedCheckMark as Z } from "./molecules/StatefulButton/AnimatedCheckmark.js";
25
+ import { AddToCart as $ } from "./molecules/AddToCart/AddToCart.js";
26
+ import { Availability as ro } from "./molecules/Availability/Availability.js";
27
+ import { BannerCard as eo } from "./molecules/BannerCard/BannerCard.js";
28
+ import { MainNav as mo } from "./organisms/MainNav/MainNav.js";
29
+ import { ChipSelector as fo } from "./organisms/ChipSelector/ChipSelector.js";
30
+ import { Product as io } from "./organisms/Product/Product.js";
31
+ import { NotFound as uo } from "./organisms/NotFound/NotFound.js";
32
+ import { Carousel as lo } from "./organisms/Carousel/Carousel.js";
33
33
  import { Footer as Co } from "./organisms/Footer/Footer.js";
34
34
  export {
35
35
  q as Account,
36
- _ as AddToCart,
37
- Y as AnimatedCheckMark,
38
- oo as Availability,
36
+ $ as AddToCart,
37
+ Z as AnimatedCheckMark,
38
+ ro as Availability,
39
39
  D as Avatar,
40
- to as BannerCard,
40
+ eo as BannerCard,
41
41
  t as Button,
42
- co as Carousel,
42
+ lo as Carousel,
43
43
  J as Chip,
44
- xo as ChipSelector,
44
+ fo as ChipSelector,
45
45
  x as Column,
46
46
  p as Flex,
47
47
  Co as Footer,
48
48
  f as Grid,
49
- n as Head,
49
+ i as Head,
50
50
  u as Icon,
51
- H as Image,
51
+ O as Image,
52
52
  Q as ImageProvider,
53
- B as Input,
54
- h as Link,
55
- w as LinkButton,
56
- T as Logo,
57
- po as MainNav,
58
- io as NotFound,
59
- b as Pricing,
60
- ao as Product,
61
- M as QuantityInput,
53
+ A as Input,
54
+ I as Link,
55
+ F as LinkButton,
56
+ y as Logo,
57
+ mo as MainNav,
58
+ uo as NotFound,
59
+ G as Pricing,
60
+ io as Product,
61
+ s as QuantityInput,
62
62
  c as Root,
63
- P as SearchBox,
64
- C as Separator,
65
- W as StatefulButton,
66
- A as Text,
67
- O as ToggleView,
63
+ N as SearchBox,
64
+ g as Separator,
65
+ X as StatefulButton,
66
+ k as Text,
67
+ U as ToggleView,
68
68
  V as Tooltip,
69
- L as createLinkAdapter
69
+ L as configureLink,
70
+ S as routerOverride
70
71
  };
@@ -14,9 +14,10 @@ export type { TextProps } from './atoms/Text/Text';
14
14
  export { Input } from './atoms/Input/Input';
15
15
  export type { InputProps } from './atoms/Input/Input';
16
16
  export { Link } from './atoms/Link/Link';
17
- export type { LinkProps } from './atoms/Link/Link';
18
- export { createLinkAdapter } from './atoms/Link/createLinkAdapter';
19
- export type { RouterLike } from './atoms/Link/createLinkAdapter';
17
+ export { configureLink, routerOverride } from './atoms/Link/configureLink';
18
+ export type { LinkProps, RouterLike } from './atoms/Link/Link';
19
+ export { LinkButton } from './atoms/LinkButton/LinkButton';
20
+ export type { LinkButtonProps } from './atoms/LinkButton/LinkButton';
20
21
  export { Logo } from './molecules/Logo/Logo';
21
22
  export type { LogoProps } from './molecules/Logo/Logo';
22
23
  export { SearchBox } from './molecules/SearchBox/SearchBox';
@@ -1,33 +1,36 @@
1
1
  import { Button as t } from "./atoms/Button/Button.js";
2
2
  import { Flex as p } from "./atoms/Flex/Flex.js";
3
- import { Column as m, Grid as f } from "./atoms/Grid/Grid.js";
4
- import { Head as a } from "./atoms/Root/Head.js";
5
- import { Icon as u } from "./atoms/Icon/Icon.js";
6
- import { Root as d } from "./atoms/Root/Root.js";
7
- import { Separator as L } from "./atoms/Separator/Separator.js";
8
- import { Text as k } from "./atoms/Text/Text.js";
9
- import { Input as B } from "./atoms/Input/Input.js";
3
+ import { Column as f, Grid as m } from "./atoms/Grid/Grid.js";
4
+ import { Head as i } from "./atoms/Root/Head.js";
5
+ import { Icon as a } from "./atoms/Icon/Icon.js";
6
+ import { Root as L } from "./atoms/Root/Root.js";
7
+ import { Separator as g } from "./atoms/Separator/Separator.js";
8
+ import { Text as B } from "./atoms/Text/Text.js";
9
+ import { Input as l } from "./atoms/Input/Input.js";
10
10
  import { Link as h } from "./atoms/Link/Link.js";
11
- import { createLinkAdapter as A } from "./atoms/Link/createLinkAdapter.js";
12
- import { Logo as F } from "./molecules/Logo/Logo.js";
13
- import { SearchBox as H } from "./molecules/SearchBox/SearchBox.js";
14
- import { QuantityInput as Q } from "./molecules/QuantityInput/QuantityInput.js";
15
- import { Pricing as T } from "./molecules/Pricing/Pricing.js";
11
+ import { configureLink as y, routerOverride as C } from "./atoms/Link/configureLink.js";
12
+ import { LinkButton as G } from "./atoms/LinkButton/LinkButton.js";
13
+ import { Logo as O } from "./molecules/Logo/Logo.js";
14
+ import { SearchBox as Q } from "./molecules/SearchBox/SearchBox.js";
15
+ import { QuantityInput as T } from "./molecules/QuantityInput/QuantityInput.js";
16
+ import { Pricing as j } from "./molecules/Pricing/Pricing.js";
16
17
  export {
17
18
  t as Button,
18
- m as Column,
19
+ f as Column,
19
20
  p as Flex,
20
- f as Grid,
21
- a as Head,
22
- u as Icon,
23
- B as Input,
21
+ m as Grid,
22
+ i as Head,
23
+ a as Icon,
24
+ l as Input,
24
25
  h as Link,
25
- F as Logo,
26
- T as Pricing,
27
- Q as QuantityInput,
28
- d as Root,
29
- H as SearchBox,
30
- L as Separator,
31
- k as Text,
32
- A as createLinkAdapter
26
+ G as LinkButton,
27
+ O as Logo,
28
+ j as Pricing,
29
+ T as QuantityInput,
30
+ L as Root,
31
+ Q as SearchBox,
32
+ g as Separator,
33
+ B as Text,
34
+ y as configureLink,
35
+ C as routerOverride
33
36
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.75",
4
+ "version": "0.0.77",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- import { LinkProps } from './Link';
3
- /** Minimal contract a router link should satisfy */
4
- export type RouterLike = React.ComponentType<{
5
- href: string;
6
- className?: string;
7
- children: React.ReactNode;
8
- } & React.AnchorHTMLAttributes<HTMLAnchorElement>>;
9
- /** Build a styled, disabled-aware Link that delegates navigation to RouterLike */
10
- export declare function createLinkAdapter(RouterComponent: RouterLike): ({ href, disabled, unstyled, hideAt, className, children, onClick, ...rest }: LinkProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,40 +0,0 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { linkClassName as l } from "./Link.js";
3
- function k(n) {
4
- return function({
5
- href: o,
6
- disabled: r = !1,
7
- unstyled: f = !1,
8
- hideAt: p,
9
- className: u,
10
- children: i,
11
- onClick: t,
12
- ...e
13
- }) {
14
- function m(a) {
15
- if (r) {
16
- a.preventDefault(), a.stopPropagation();
17
- return;
18
- }
19
- t == null || t(a);
20
- }
21
- const x = l({ className: u, unstyled: f, disabled: r, hideAt: p });
22
- return /* @__PURE__ */ c(
23
- n,
24
- {
25
- ...e,
26
- href: r ? "#" : o,
27
- className: x,
28
- onClick: m,
29
- "aria-disabled": r || void 0,
30
- tabIndex: r ? -1 : e.tabIndex,
31
- role: r ? "link" : e.role,
32
- "data-router-adapter": "next",
33
- children: i
34
- }
35
- );
36
- };
37
- }
38
- export {
39
- k as createLinkAdapter
40
- };