@atom-learning/components 9.0.0-beta.4 → 9.0.0-beta.5

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.
@@ -14,10 +14,17 @@ export declare const BannerSlim: {
14
14
  (props: React.ComponentPropsWithoutRef<typeof import("../..").Image>): React.JSX.Element;
15
15
  displayName: string;
16
16
  };
17
- Button: {
18
- ({ className, ...rest }: React.ComponentProps<typeof import("../..").Button>): React.JSX.Element;
19
- displayName: string;
20
- };
17
+ Button: import("../../..").PolymorphicComponent<"button", Omit<{
18
+ theme?: ("danger" | "neutral" | "primary" | "secondary" | "success" | "warning" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "danger" | "neutral" | "primary" | "secondary" | "success" | "warning">>) | undefined;
19
+ appearance?: ("outline" | "solid" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "outline" | "solid">>) | undefined;
20
+ size?: ("lg" | "md" | "sm" | "xl" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm" | "xl">>) | undefined;
21
+ isLoading?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
22
+ fullWidth?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
23
+ }, "children" | "isLoading" | keyof import("../../..").NavigatorActions> & {
24
+ children: React.ReactNode;
25
+ href?: string;
26
+ isLoading?: boolean;
27
+ } & import("../../..").NavigatorActions>;
21
28
  Dismiss: {
22
29
  ({ label, ...rest }: {
23
30
  key?: React.Key | null | undefined;
@@ -1,6 +1,5 @@
1
- import * as React from 'react';
1
+ import { type PolymorphicComponent } from '../../../styled';
2
2
  import { Button } from '../../button/Button';
3
- export declare function BannerSlimButton({ className, ...rest }: React.ComponentProps<typeof Button>): React.JSX.Element;
4
- export declare namespace BannerSlimButton {
5
- var displayName: string;
6
- }
3
+ type ButtonOwnProps = typeof Button extends PolymorphicComponent<infer _Element, infer OwnProps> ? OwnProps : never;
4
+ export declare const BannerSlimButton: PolymorphicComponent<'button', ButtonOwnProps>;
5
+ export {};
@@ -5,7 +5,7 @@ import { useBannerContext } from "../Banner.context.js";
5
5
  import * as React$1 from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/components/banner/banner-slim/BannerSlimButton.tsx
8
- var BannerSlimButton = ({ className, ...rest }) => {
8
+ var BannerSlimButton = (({ className, ...rest }) => {
9
9
  const { emphasis, size } = useBannerContext();
10
10
  return /* @__PURE__ */ jsx(Button, {
11
11
  size: "md",
@@ -14,7 +14,7 @@ var BannerSlimButton = ({ className, ...rest }) => {
14
14
  ...rest,
15
15
  className: cn("ml-auto", className)
16
16
  });
17
- };
17
+ });
18
18
  BannerSlimButton.displayName = "BannerSlimButton";
19
19
  //#endregion
20
20
  export { BannerSlimButton };
@@ -1 +1 @@
1
- {"version":3,"file":"BannerSlimButton.js","names":[],"sources":["../../../../src/components/banner/banner-slim/BannerSlimButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '../../../styled'\nimport { overrideStyledVariantValue } from '../../../utilities/override-styled-variant-value/overrideStyledVariantValue'\nimport { Button } from '../../button/Button'\nimport { useBannerContext } from '../Banner.context'\n\nexport const BannerSlimButton = ({\n className,\n ...rest\n}: React.ComponentProps<typeof Button>) => {\n const { emphasis, size } = useBannerContext()\n\n const fullWidth = React.useMemo(\n () => overrideStyledVariantValue(size, (s) => s === 'sm'),\n [size]\n )\n\n return (\n <Button\n size=\"md\"\n fullWidth={fullWidth}\n theme={emphasis === 'bold' ? 'neutral' : 'primary'}\n {...rest}\n className={cn('ml-auto', className)}\n />\n )\n}\n\nBannerSlimButton.displayName = 'BannerSlimButton'\n"],"mappings":";;;;;;;AAOA,IAAa,oBAAoB,EAC/B,WACA,GAAG,WACsC;CACzC,MAAM,EAAE,UAAU,SAAS,iBAAiB;CAO5C,OACE,oBAAC,QAAD;EACE,MAAK;EACM,WARG,QAAM,cAChB,2BAA2B,OAAO,MAAM,MAAM,IAAI,GACxD,CAAC,IAAI,CAMQ;EACX,OAAO,aAAa,SAAS,YAAY;EACzC,GAAI;EACJ,WAAW,GAAG,WAAW,SAAS;CACnC,CAAA;AAEL;AAEA,iBAAiB,cAAc"}
1
+ {"version":3,"file":"BannerSlimButton.js","names":[],"sources":["../../../../src/components/banner/banner-slim/BannerSlimButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { type PolymorphicComponent, cn } from '../../../styled'\nimport { overrideStyledVariantValue } from '../../../utilities/override-styled-variant-value/overrideStyledVariantValue'\nimport { Button } from '../../button/Button'\nimport { useBannerContext } from '../Banner.context'\n\n// Re-expose Button's own props so BannerSlim.Button stays polymorphic (keeps\n// `as`, e.g. `<BannerSlim.Button as=\"a\" href>`). Typing with\n// React.ComponentProps<typeof Button> alone would collapse to the default\n// element and drop `as` (as?: never).\ntype ButtonOwnProps =\n typeof Button extends PolymorphicComponent<infer _Element, infer OwnProps>\n ? OwnProps\n : never\n\nexport const BannerSlimButton = (({\n className,\n ...rest\n}: React.ComponentProps<typeof Button>) => {\n const { emphasis, size } = useBannerContext()\n\n const fullWidth = React.useMemo(\n () => overrideStyledVariantValue(size, (s) => s === 'sm'),\n [size]\n )\n\n return (\n <Button\n size=\"md\"\n fullWidth={fullWidth}\n theme={emphasis === 'bold' ? 'neutral' : 'primary'}\n {...rest}\n className={cn('ml-auto', className)}\n />\n )\n}) as PolymorphicComponent<'button', ButtonOwnProps>\n\nBannerSlimButton.displayName = 'BannerSlimButton'\n"],"mappings":";;;;;;;AAgBA,IAAa,qBAAqB,EAChC,WACA,GAAG,WACsC;CACzC,MAAM,EAAE,UAAU,SAAS,iBAAiB;CAO5C,OACE,oBAAC,QAAD;EACE,MAAK;EACM,WARG,QAAM,cAChB,2BAA2B,OAAO,MAAM,MAAM,IAAI,GACxD,CAAC,IAAI,CAMQ;EACX,OAAO,aAAa,SAAS,YAAY;EACzC,GAAI;EACJ,WAAW,GAAG,WAAW,SAAS;CACnC,CAAA;AAEL;AAEA,iBAAiB,cAAc"}
@@ -1,12 +1,13 @@
1
- import * as React from 'react';
2
1
  import { type TcolorScheme } from '../../experiments/color-scheme/ColorScheme';
3
- export declare const StyledTile: import("../..").PolymorphicComponent<"div", {
2
+ import { type PolymorphicComponent } from '../../styled';
3
+ export declare const StyledTile: PolymorphicComponent<"div", {
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;
7
7
  }>;
8
- type TileProps = React.ComponentProps<typeof StyledTile> & {
8
+ type StyledTileOwnProps = typeof StyledTile extends PolymorphicComponent<infer _Element, infer OwnProps> ? OwnProps : never;
9
+ type TileOwnProps = StyledTileOwnProps & {
9
10
  colorScheme?: TcolorScheme;
10
11
  };
11
- export declare const Tile: ({ ref, children, borderRadius, colorScheme, ...rest }: TileProps) => React.JSX.Element;
12
+ export declare const Tile: PolymorphicComponent<'div', TileOwnProps>;
12
13
  export {};
@@ -24,7 +24,7 @@ var StyledTile = styled("div", {
24
24
  diffused: { true: ["supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]", "supports-color-mix:backdrop-blur-sm"] }
25
25
  }
26
26
  }, { enableResponsiveVariants: true });
27
- var Tile = ({ ref, children, borderRadius = "lg", colorScheme = {}, ...rest }) => /* @__PURE__ */ jsx(ColorScheme, {
27
+ var Tile = (({ ref, children, borderRadius = "lg", colorScheme = {}, ...rest }) => /* @__PURE__ */ jsx(ColorScheme, {
28
28
  asChild: true,
29
29
  base: "grey1",
30
30
  accent: "primary2",
@@ -36,7 +36,7 @@ var Tile = ({ ref, children, borderRadius = "lg", colorScheme = {}, ...rest }) =
36
36
  ...rest,
37
37
  children
38
38
  })
39
- });
39
+ }));
40
40
  //#endregion
41
41
  export { StyledTile, Tile };
42
42
 
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.js","names":[],"sources":["../../../src/components/tile/Tile.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n ColorScheme,\n type TcolorScheme\n} from '../../experiments/color-scheme/ColorScheme'\nimport { styled } from '../../styled'\n\nexport const StyledTile = styled(\n 'div',\n {\n base: [\n 'box-border',\n 'flex',\n 'flex-col',\n 'relative',\n 'border',\n 'bg-(--base-1)',\n 'text-(--foreground)',\n 'border-transparent'\n ],\n variants: {\n borderRadius: {\n sm: ['rounded-sm'],\n md: ['rounded-md'],\n lg: ['rounded-xl']\n },\n border: {\n true: ['border-(--base-3)']\n },\n diffused: {\n true: [\n 'supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]',\n 'supports-color-mix:backdrop-blur-sm'\n ]\n }\n }\n },\n { enableResponsiveVariants: true }\n)\n\ntype TileProps = React.ComponentProps<typeof StyledTile> & {\n colorScheme?: TcolorScheme\n}\n\nexport const Tile = ({\n ref,\n children,\n borderRadius = 'lg',\n colorScheme = {},\n ...rest\n}: TileProps) => (\n <ColorScheme\n asChild\n base=\"grey1\"\n accent=\"primary2\"\n interactive=\"loContrast\"\n {...colorScheme}\n >\n <StyledTile ref={ref} borderRadius={borderRadius} {...rest}>\n {children}\n </StyledTile>\n </ColorScheme>\n)\n"],"mappings":";;;;;AAQA,IAAa,aAAa,OACxB,OACA;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,cAAc;GACZ,IAAI,CAAC,YAAY;GACjB,IAAI,CAAC,YAAY;GACjB,IAAI,CAAC,YAAY;EACnB;EACA,QAAQ,EACN,MAAM,CAAC,mBAAmB,EAC5B;EACA,UAAU,EACR,MAAM,CACJ,wEACA,qCACF,EACF;CACF;AACF,GACA,EAAE,0BAA0B,KAAK,CACnC;AAMA,IAAa,QAAQ,EACnB,KACA,UACA,eAAe,MACf,cAAc,CAAC,GACf,GAAG,WAEH,oBAAC,aAAD;CACE,SAAA;CACA,MAAK;CACL,QAAO;CACP,aAAY;CACZ,GAAI;WAEJ,oBAAC,YAAD;EAAiB;EAAmB;EAAc,GAAI;EACnD;CACS,CAAA;AACD,CAAA"}
1
+ {"version":3,"file":"Tile.js","names":[],"sources":["../../../src/components/tile/Tile.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n ColorScheme,\n type TcolorScheme\n} from '../../experiments/color-scheme/ColorScheme'\nimport { type PolymorphicComponent, styled } from '../../styled'\n\nexport const StyledTile = styled(\n 'div',\n {\n base: [\n 'box-border',\n 'flex',\n 'flex-col',\n 'relative',\n 'border',\n 'bg-(--base-1)',\n 'text-(--foreground)',\n 'border-transparent'\n ],\n variants: {\n borderRadius: {\n sm: ['rounded-sm'],\n md: ['rounded-md'],\n lg: ['rounded-xl']\n },\n border: {\n true: ['border-(--base-3)']\n },\n diffused: {\n true: [\n 'supports-color-mix:bg-[color-mix(in_hsl,(--base-1)_70%,transparent)]',\n 'supports-color-mix:backdrop-blur-sm'\n ]\n }\n }\n },\n { enableResponsiveVariants: true }\n)\n\n// Re-expose StyledTile's own props so Tile stays polymorphic (keeps `as`, e.g.\n// `<Tile as=\"a\" href>`). Typing with React.ComponentProps<typeof StyledTile>\n// would collapse to the default element and drop `as` (as?: never).\ntype StyledTileOwnProps =\n typeof StyledTile extends PolymorphicComponent<infer _Element, infer OwnProps>\n ? OwnProps\n : never\n\ntype TileOwnProps = StyledTileOwnProps & { colorScheme?: TcolorScheme }\n\nexport const Tile = (({\n ref,\n children,\n borderRadius = 'lg',\n colorScheme = {},\n ...rest\n}: React.ComponentProps<typeof StyledTile> & {\n colorScheme?: TcolorScheme\n}) => (\n <ColorScheme\n asChild\n base=\"grey1\"\n accent=\"primary2\"\n interactive=\"loContrast\"\n {...colorScheme}\n >\n <StyledTile ref={ref} borderRadius={borderRadius} {...rest}>\n {children}\n </StyledTile>\n </ColorScheme>\n)) as PolymorphicComponent<'div', TileOwnProps>\n"],"mappings":";;;;;AAQA,IAAa,aAAa,OACxB,OACA;CACE,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,cAAc;GACZ,IAAI,CAAC,YAAY;GACjB,IAAI,CAAC,YAAY;GACjB,IAAI,CAAC,YAAY;EACnB;EACA,QAAQ,EACN,MAAM,CAAC,mBAAmB,EAC5B;EACA,UAAU,EACR,MAAM,CACJ,wEACA,qCACF,EACF;CACF;AACF,GACA,EAAE,0BAA0B,KAAK,CACnC;AAYA,IAAa,SAAS,EACpB,KACA,UACA,eAAe,MACf,cAAc,CAAC,GACf,GAAG,WAIH,oBAAC,aAAD;CACE,SAAA;CACA,MAAK;CACL,QAAO;CACP,aAAY;CACZ,GAAI;WAEJ,oBAAC,YAAD;EAAiB;EAAmB;EAAc,GAAI;EACnD;CACS,CAAA;AACD,CAAA"}
@@ -1,15 +1,19 @@
1
1
  import * as React from 'react';
2
2
  import type { NavigatorActions } from '../../types/navigatorActions.types';
3
3
  import type { Override } from '../../utilities/types';
4
- declare const StyledTileInteractive: import("../..").PolymorphicComponent<({ ref, children, borderRadius, colorScheme, ...rest }: {
4
+ declare const StyledTileInteractive: import("../..").PolymorphicComponent<import("../..").PolymorphicComponent<"div", {
5
5
  borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
6
6
  border?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
7
7
  diffused?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
8
8
  } & {
9
- as?: never;
10
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as" | "border" | "borderRadius" | "diffused"> & {
11
9
  colorScheme?: import("../..").TcolorScheme;
12
- }) => React.JSX.Element, unknown>;
10
+ }>, {
11
+ borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
12
+ border?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
13
+ diffused?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
14
+ } & {
15
+ colorScheme?: import("../..").TcolorScheme;
16
+ }>;
13
17
  type TileInteractiveProps = Override<React.ComponentProps<typeof StyledTileInteractive> & React.ButtonHTMLAttributes<HTMLButtonElement> & NavigatorActions, {
14
18
  as?: React.ElementType;
15
19
  }>;
@@ -1,16 +1,22 @@
1
1
  import * as ToggleGroup from '@radix-ui/react-toggle-group';
2
2
  import * as React from 'react';
3
3
  declare const StyledTileToggleGroupItem: import("../..").PolymorphicComponent<({ ref, onClick, href, type, as, ...rest }: Omit<{
4
+ borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
5
+ border?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
6
+ diffused?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
7
+ } & {
8
+ colorScheme?: import("../..").TcolorScheme;
9
+ } & {
4
10
  as?: never;
5
11
  } & Omit<{
6
12
  borderRadius?: ("lg" | "md" | "sm" | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", "lg" | "md" | "sm">>) | undefined;
7
13
  border?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
8
14
  diffused?: (boolean | Partial<Record<"@initial" | "@lg" | "@md" | "@sm" | "@xl", boolean>>) | undefined;
9
15
  } & {
10
- as?: never;
11
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as" | "border" | "borderRadius" | "diffused"> & {
12
16
  colorScheme?: import("../..").TcolorScheme;
13
- }, "as"> & React.ButtonHTMLAttributes<HTMLButtonElement> & import("../..").NavigatorActions, "as"> & {
17
+ } & {
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"> & {
14
20
  as?: React.ElementType;
15
21
  }) => React.JSX.Element, unknown>;
16
22
  type TileToggleGroupItem = React.ComponentProps<typeof ToggleGroup.Item> & React.ComponentProps<typeof StyledTileToggleGroupItem>;